greentic-flow-builder 0.1.0

AI-powered Adaptive Card flow builder with visual graph editor and demo runner
Documentation
# greentic-flow-builder

[![CI](https://github.com/greenticai/greentic-flow-builder/actions/workflows/ci.yml/badge.svg)](https://github.com/greenticai/greentic-flow-builder/actions/workflows/ci.yml)
[![CodeQL](https://github.com/greenticai/greentic-flow-builder/actions/workflows/codeql.yml/badge.svg)](https://github.com/greenticai/greentic-flow-builder/actions/workflows/codeql.yml)
[![crates.io](https://img.shields.io/crates/v/greentic-flow-builder.svg)](https://crates.io/crates/greentic-flow-builder)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Rust 1.94+](https://img.shields.io/badge/rust-1.94+-orange.svg)](https://www.rust-lang.org)

AI-powered Adaptive Card flow builder with a 3-layer template system, visual
graph editor, and web-based demo runner. Generate Microsoft Adaptive Cards
from natural-language prompts, compose multi-step flows, and preview them in
a React-Flow based editor — all driven by a small Rust binary.

## Features

- **3-layer template system** — 6 themes, 15 primitives, 42 presets across
  10 categories (navigation, content, HR, finance, helpdesk, dashboards,
  schedule, communication, alerts, data)
- **Compose escape hatch** — custom cards built from arrays of primitive sections
- **Web UI** — chat-driven LLM generation (OpenAI), React Flow graph editor,
  inline JSON editor, theme switcher, demo runner
- **External template packs** — bring your own presets/primitives/themes via
  local directories or remote `.tar.gz` archives
- **Deterministic rendering** — Handlebars + JSON Schema validation +
  Adaptive Cards v1.5 post-processing

## Quick Start

### Install

```bash
cargo install greentic-flow-builder
```

Or via `cargo binstall` (pre-built binaries):

```bash
cargo binstall greentic-flow-builder
```

### Launch the web UI

```bash
greentic-flow-builder ui --openai-api-key sk-... --port 3000
```

Then open http://localhost:3000.

### Render a card from the CLI

```bash
greentic-flow-builder render --preset menu-card --theme corporate \
  --data-json '{"brand":"Acme","title":"Hi","items":[{"id":"a","title":"A"}]}'
```

### List presets

```bash
greentic-flow-builder list
greentic-flow-builder list --category hr
greentic-flow-builder list --json
```

### Validate data against a preset schema

```bash
greentic-flow-builder validate --template menu-card --data-json '{...}'
```

## CLI Reference

| Command | Purpose |
|---|---|
| `ui` | Launch the web UI (OpenAI chat + visual graph editor) |
| `list` | List all presets, optionally filtered by category |
| `schema` | Print the JSON schema for a preset |
| `render` | Render a preset or compose a custom card from CLI data |
| `validate` | Validate input data against a preset schema |

Run `greentic-flow-builder --help` for full flags.

## API (when UI is running)

| Endpoint | Purpose |
|---|---|
| `GET /api/templates` | All presets grouped by category |
| `GET /api/templates/:name` | Full schema + example for one preset |
| `GET /api/primitives` | Primitive manifest |
| `GET /api/themes` | List themes |
| `GET /api/themes/:name` | Full theme (tokens + host_config) |
| `GET /api/discovery/search?q=...` | Keyword preset search |
| `POST /api/render` | Render preset OR compose sections |
| `POST /api/render-flow` | Render multi-card flow |
| `POST /api/chat` | LLM chat (returns JSON content) |

## External Template Packs

Load custom presets, primitives, or themes alongside the built-ins:

```bash
greentic-flow-builder ui --openai-api-key sk-... \
  --template-pack ./my-pack \
  --template-pack https://example.com/custom.tar.gz
```

Pack structure:

```
my-pack/
├── pack.json              { "name", "version", "description" }
├── primitives/            Optional
├── themes/                Optional
└── presets/
    └── category/
        ├── name.hbs
        └── name.schema.json
```

External packs override built-in entries by name (with a stderr warning).
Multiple `--template-pack` args merge in order.

## Development

```bash
# Full local CI
./ci/local_check.sh

# Standard Rust commands
cargo build
cargo test --workspace --all-features
cargo fmt --all -- --check
cargo clippy --workspace --all-targets --all-features -- -D warnings
```

See [`CLAUDE.md`](CLAUDE.md) for architecture details and conventions.

## License

MIT — see [`LICENSE`](LICENSE).