Skip to content

Commit 50a1e1e

Browse files
author
Daniel
committed
renaming app to workflow-cli, releasing goes to public npm, cli SPA as package
1 parent 15c9a44 commit 50a1e1e

58 files changed

Lines changed: 1992 additions & 2479 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.claude/commands/sync-translations.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ the `locales/` dirs (today: `en`, `de`).
1111

1212
- **`ts/workflow-builder/src/i18n/locales/*.json`** — the builder's private instance:
1313
canvas/panel/dialog UI **plus** the optional description overrides (below).
14-
- **`ts/app/src/i18n/locales/*.json`** — the host app's UI (toolbar, status, dialogs).
14+
- **`ts/workflow-cli/src/i18n/locales/*.json`** — the CLI host SPA's UI (toolbar, status, dialogs).
1515

1616
## What makes this repo different: descriptions live in code
1717

@@ -57,11 +57,11 @@ parity/description checks — don't re-derive it by hand.
5757

5858
## 2. Validate t() key usage (agent check)
5959

60-
The script can't see runtime usage. Search `ts/workflow-builder/src` and `ts/app/src`
60+
The script can't see runtime usage. Search `ts/workflow-builder/src` and `ts/workflow-cli/src`
6161
(`.ts`/`.tsx`) for translation keys and confirm each resolves:
6262

6363
- Direct: `` t("…") ``, `t('…')`, `` t(`…`) `` — for builder keys check
64-
`workflow-builder/.../en.json`; for app keys check `app/.../en.json`.
64+
`workflow-builder/.../en.json`; for CLI keys check `workflow-cli/.../en.json`.
6565
- Indirect: string literals later passed to `t()` (`labelKey: "…"`, `key: "…"`, arrays
6666
of keys). Look for `namespace.keyName`-shaped literals.
6767
- Template literals: extract the static prefix; a dynamic tail
@@ -73,7 +73,7 @@ resolve via `defaultValue` by design (see above).
7373

7474
## 3. Hardcoded user-visible strings (agent check)
7575

76-
Scan builder panels/dialogs/toolbars (and app UI) for user-visible strings that bypass
76+
Scan builder panels/dialogs/toolbars (and CLI SPA UI) for user-visible strings that bypass
7777
`t()`: JSX text, `placeholder`/`title`/`aria-label`/`alt`, toast/dialog titles and
7878
descriptions, error messages shown to users.
7979

.claude/scripts/sync-translations.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import { ModelRegistry } from "../../ts/workflow-core/src/model/index.ts";
3030
const here = dirname(fileURLToPath(import.meta.url));
3131
const tsRoot = join(here, "..", "..", "ts");
3232
const builderLocales = join(tsRoot, "workflow-builder", "src", "i18n", "locales");
33-
const appLocales = join(tsRoot, "app", "src", "i18n", "locales");
33+
const cliLocales = join(tsRoot, "workflow-cli", "src", "i18n", "locales");
3434

3535
// A locale key counts as a code-defined description override if it sits in one of
3636
// these namespaces and ends in `.description`. Everything else is "general UI".
@@ -147,7 +147,7 @@ function parity(label: string, dir: string) {
147147
}
148148
}
149149
parity("workflow-builder", builderLocales);
150-
parity("app", appLocales);
150+
parity("workflow-cli", cliLocales);
151151

152152
h("summary");
153153
log(issues === 0 ? "✓ no issues" : `⚠ ${issues} issue(s) — see above`);

.github/CONTRIBUTING.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Thanks for your interest in edge-agents! Please read our
1919
| ----------- | ------------------------------------------------------------------------------------------------- |
2020
| `contract/` | Language-neutral OpenAPI schemas — the **source of truth** for both Go and TS. |
2121
| `go/` | Go module: the engine runtime + LLM proxy. See [`go/CLAUDE.md`](../go/CLAUDE.md). |
22-
| `ts/` | npm workspace: `workflow-core`, `workflow-builder`, `app`. See [`ts/CLAUDE.md`](../ts/CLAUDE.md). |
22+
| `ts/` | npm workspace: `workflow-core`, `workflow-builder`, `workflow-cli`. See [`ts/CLAUDE.md`](../ts/CLAUDE.md). |
2323
| `skills/` | Claude Code skill wrapping the workflow CLI. |
2424

2525
`go/` and `ts/` are independent — you only need the toolchain for the side you touch.
@@ -40,7 +40,7 @@ go test ./...
4040

4141
Format edited files with `goimports -w <file>`.
4242

43-
### TypeScript (workflow model, builder, app)
43+
### TypeScript (workflow model, builder, cli)
4444

4545
Requires Node 20+.
4646

@@ -52,7 +52,7 @@ npm run typecheck
5252
npm run lint
5353
npm run build
5454
npm test
55-
cd app && npm run dev # run the reference SPA (embeds the visual builder)
55+
cd workflow-cli && npm run dev # run the reference SPA (embeds the visual builder)
5656
```
5757

5858
## The contract is the source of truth (read this first)
@@ -102,7 +102,7 @@ Use clear, prefixed messages: `feat:`, `fix:`, `refactor:`, `test:`, `docs:`.
102102

103103
edge-agents uses a **two-tier license model**: the `contract/` and
104104
`ts/workflow-core/` subdirectories are released under [Apache-2.0](../contract/LICENSE),
105-
and all other components (engine, LLM proxy, workflow-builder, app) are released
105+
and all other components (engine, LLM proxy, workflow-builder, workflow-cli) are released
106106
under [AGPL-3.0](../LICENSE) with the option for ForestHub to also offer them under a
107107
separate commercial license for use cases that are incompatible with the AGPL
108108
(commercial licensing: root@foresthub.ai). To keep this model viable, every
@@ -163,7 +163,7 @@ The repository uses a two-tier license model:
163163

164164
- Contributions to `contract/` and `ts/workflow-core/` are released under
165165
**Apache-2.0**.
166-
- Contributions to all other paths (engine, LLM proxy, workflow-builder, app) are
166+
- Contributions to all other paths (engine, LLM proxy, workflow-builder, workflow-cli) are
167167
released under **AGPL-3.0-only** with the option for ForestHub to also offer them
168168
under a commercial license (per the CLA above).
169169

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ body:
2727
- Contract (OpenAPI schemas)
2828
- workflow-core (TS)
2929
- workflow-builder (TS, visual canvas)
30-
- app / fh-builder CLI (TS)
30+
- workflow-cli / fh-workflow CLI (TS)
3131
- skills
3232
- Other / not sure
3333
validations:

.github/ISSUE_TEMPLATE/feature_request.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ body:
5353
- Contract (OpenAPI schemas)
5454
- workflow-core (TS)
5555
- workflow-builder (TS, visual canvas)
56-
- app / fh-builder CLI (TS)
56+
- workflow-cli / fh-workflow CLI (TS)
5757
- skills
5858
- Other / not sure
5959
validations:

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
# Node
44
node_modules/
55
ts/**/dist/
6+
ts/**/dist-cli/
67
*.tsbuildinfo
8+
*.tgz
79

810
# Go
911
*.test

CLAUDE.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ go/ Go module — go.mod lives HERE, not at repo root, so `go get`
2020
Module: github.com/ForestHubAI/edge-agents/go. See go/CLAUDE.md.
2121
2222
ts/ npm workspace: workflow-core (headless model), workflow-builder
23-
(React canvas), app (reference SPA + CLI). See ts/CLAUDE.md.
23+
(React canvas), workflow-cli (fh-workflow CLI + reference SPA).
24+
See ts/CLAUDE.md.
2425
2526
skills/ Claude Code skill wrapping the workflow CLI.
2627
```

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,13 @@ Requires the Go version pinned in `go/go.mod`. Configuration via `ENGINE_*` env
6060
```sh
6161
cd ts
6262
npm ci
63-
cd app && npm run dev # http://localhost:5173
63+
cd workflow-cli && npm run dev # http://localhost:5173
6464
```
6565

6666
**Validate a workflow:**
6767

6868
```sh
69-
cd ts/app
69+
cd ts/workflow-cli
7070
npm run validate -- path/to/file.workflow.json
7171
# exit 0 → clean; exit 1 → diagnostics JSON on stdout
7272
```
@@ -141,14 +141,14 @@ See [`go/CLAUDE.md`](go/CLAUDE.md) and [`ts/CLAUDE.md`](ts/CLAUDE.md) for deeper
141141
| [`go/`](go) | Engine binary, LLM proxy, hardware drivers, MQTT transport. Module `github.com/ForestHubAI/edge-agents/go`. |
142142
| [`ts/workflow-core`](ts/workflow-core) | `@foresthubai/workflow-core` — headless workflow model, validation, (de)serialization. No React. |
143143
| [`ts/workflow-builder`](ts/workflow-builder) | `@foresthubai/workflow-builder` — React canvas component. |
144-
| [`ts/app`](ts/app) | Reference SPA + `fh-builder` CLI. |
144+
| [`ts/workflow-cli`](ts/workflow-cli) | `@foresthubai/workflow-cli` — the `fh-workflow` CLI + the reference SPA it serves. |
145145
| [`examples/`](examples) | Runnable workflow examples per use case. |
146146
| [`skills/`](skills) | Claude Code skill wrapping the workflow CLI. |
147147

148148
## Releases
149149

150150
- **Go runtime** — tagged `go/vX.Y.Z`. `go get github.com/ForestHubAI/edge-agents/go@vX.Y.Z`. Current: `go/v1.0.1`.
151-
- **TypeScript packages** — `@foresthubai/workflow-core` and `@foresthubai/workflow-builder` ship in lockstep at the same version.
151+
- **TypeScript packages** — `@foresthubai/workflow-core`, `@foresthubai/workflow-builder`, and `@foresthubai/workflow-cli` ship in lockstep at the same version, published to public npm.
152152
- **Container image** — multi-arch (`linux/amd64`, `linux/arm64`), distroless, nonroot, published to GitHub Container Registry.
153153

154154
See [RELEASING.md](RELEASING.md).
@@ -171,7 +171,7 @@ Do not open public issues for security vulnerabilities. Use [GitHub private vuln
171171
| [`ts/workflow-core`](ts/workflow-core) (headless model) | **Apache-2.0** | Workflow model and validation. Same reasoning — should be embeddable into any TypeScript/JavaScript project without copyleft friction. |
172172
| [`go/`](go) (engine, LLM proxy, drivers) | **AGPL-3.0-only** or **commercial** | Keeps hosted "edge-agents as a service" offerings honest. For commercial use cases incompatible with AGPL, contact **root@foresthub.ai**. |
173173
| [`ts/workflow-builder`](ts/workflow-builder) (React canvas) | **AGPL-3.0-only** or **commercial** | Same dual-license terms as the engine. |
174-
| [`ts/app`](ts/app) (reference SPA, not published) | **AGPL-3.0-only** | Reference implementation, not for redistribution. |
174+
| [`ts/workflow-cli`](ts/workflow-cli) (`@foresthubai/workflow-cli` + reference SPA) | **AGPL-3.0-only** or **commercial** | Bundles the AGPL builder; same dual-license terms. |
175175

176176
For the AGPL components, the AGPL network clause applies — providing a modified version over a network requires making the corresponding source available to users of that service.
177177

RELEASING.md

Lines changed: 35 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@ never collide.
77
| Artifact | Ecosystem | Version source | Consumer pins with |
88
| ----------------------------------- | --------------------- | ------------------------- | ------------------------------------------- |
99
| `github.com/ForestHubAI/edge-agents/go` | Go modules | **git tag** `go/vX.Y.Z` | `go get ...@vX.Y.Z` |
10-
| `@foresthubai/workflow-core` | npm (GitHub Packages) | `version` in package.json | `npm i @foresthubai/workflow-core@X.Y.Z` |
11-
| `@foresthubai/workflow-builder` | npm (GitHub Packages) | `version` in package.json | `npm i @foresthubai/workflow-builder@X.Y.Z` |
10+
| `@foresthubai/workflow-core` | npm (public, npmjs) | `version` in package.json | `npm i @foresthubai/workflow-core@X.Y.Z` |
11+
| `@foresthubai/workflow-builder` | npm (public, npmjs) | `version` in package.json | `npm i @foresthubai/workflow-builder@X.Y.Z` |
12+
| `@foresthubai/workflow-cli` | npm (public, npmjs) | `version` in package.json | `npm i -g @foresthubai/workflow-cli@X.Y.Z` |
1213

13-
Go and TS version on **independent cadences**. The two TS packages, however, are
14+
Go and TS version on **independent cadences**. The three TS packages, however, are
1415
**locked to each other** (see below) — they always ship one shared version.
1516

1617
The real coupling risk between Go and TS is **not** version numbers — it's `contract/`
@@ -19,53 +20,62 @@ to diverge across ecosystems.
1920

2021
## TS (`@foresthubai/*`) — one lockstep command
2122

22-
`workflow-core` (headless) and `workflow-builder` (React) are **always released together
23-
at the same version**, and the builder pins core to that exact version. They are split
24-
into two packages only so a CLI can import core's validator without pulling in React —
25-
not because they version independently. There is therefore no changeset/changelog
26-
machinery: a release is a single command, run from `ts/`:
23+
`workflow-core` (headless), `workflow-builder` (React), and `workflow-cli` are **always
24+
released together at the same version**; the builder pins core to that exact version.
25+
core and builder are split only so a CLI can import core's validator without pulling in
26+
React — not because they version independently; `workflow-cli` needs no pin because it
27+
bundles core/builder from source at build time (they're its devDeps). There is therefore
28+
no changeset/changelog machinery: a release is a single command, run from `ts/`:
2729

2830
```sh
2931
npm run release -- 0.2.0
3032
```
3133

3234
`ts/scripts/release.mjs` then:
3335

34-
1. sets both packages' `version` to `0.2.0`,
36+
1. sets all three packages' `version` to `0.2.0`,
3537
2. pins `workflow-builder`'s `@foresthubai/workflow-core` dependency to exactly `0.2.0`,
3638
3. refreshes the lockfile, and
37-
4. runs `npm publish --workspaces` — which publishes core + builder and **skips** the
38-
private `@foresthubai/app`.
39+
4. runs `npm publish --workspaces` — which publishes core + builder + workflow-cli.
3940

40-
Each package's `prepublishOnly` rebuilds `dist/` first, so you never publish stale output.
41+
Each package's `prepublishOnly` rebuilds `dist/` (and the CLI bundle) first, so you never
42+
publish stale output.
4143

42-
### Registry: GitHub Packages
44+
### Registry: public npm (npmjs.com)
4345

44-
Both packages carry `publishConfig.registry = https://npm.pkg.github.com`.
46+
All three packages carry `publishConfig` targeting the public registry with public access:
4547

46-
**To publish**, npm needs a GitHub token with `write:packages`, supplied via `~/.npmrc`
47-
(never commit it):
48+
```jsonc
49+
"publishConfig": {
50+
"registry": "https://registry.npmjs.org/",
51+
"access": "public"
52+
}
53+
```
54+
55+
`access: public` is required — scoped packages (`@foresthubai/*`) publish as restricted
56+
by default, which fails on a free org plan.
57+
58+
**To publish**, you must be a member of the `@foresthubai` org on npmjs.com and be logged
59+
in (`npm login`). For CI, use an npm **automation** access token (bypasses 2FA) via
60+
`~/.npmrc` (never commit it):
4861

4962
```
50-
//npm.pkg.github.com/:_authToken=$[Token with write access]
63+
//registry.npmjs.org/:_authToken=${NPM_TOKEN}
5164
```
5265

53-
**To consume** (e.g. the private FE repo), add `FH_PACKAGES_TOKEN` as env variable and add an `.npmrc` in consumers' root folder:
66+
**To consume** — nothing special. They're public:
5467

55-
```
56-
@foresthubai:registry=https://npm.pkg.github.com
57-
//npm.pkg.github.com/:_authToken=${FH_PACKAGES_TOKEN}
68+
```sh
69+
npm i @foresthubai/workflow-core@X.Y.Z
5870
```
5971

60-
then `npm i @foresthubai/workflow-builder@X.Y.Z` as normal. See
72+
No `.npmrc`, scope mapping, or token needed (including from the private FE repo — drop any
73+
leftover `@foresthubai:registry=https://npm.pkg.github.com` redirect there). See
6174
[`ts/workflow-builder/README.md`](ts/workflow-builder/README.md) for the Tailwind/styles
6275
wiring the consumer must also do.
6376

6477
> **No automated changelog.** Put a one-line "what changed" in the release commit so the
6578
> FE maintainer (often future-you) can see why a pinned version moved.
66-
>
67-
> **Going public** keeps the `@foresthubai` scope — you'd own that org on npmjs.com and
68-
> drop the GitHub Packages registry line; the package name does not change.
6979
7080
## Go module — manual tag
7181

skills/workflow-generate/SKILL.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: workflow-generate
3-
description: Build a ForestHub workflow JSON from a natural-language description, conforming exactly to contract/workflow.yaml, and validate it via the fh-builder CLI. Use when the user describes a workflow in prose and wants a ready-to-use *.workflow.json.
3+
description: Build a ForestHub workflow JSON from a natural-language description, conforming exactly to contract/workflow.yaml, and validate it via the fh-workflow CLI. Use when the user describes a workflow in prose and wants a ready-to-use *.workflow.json.
44
---
55

66
# workflow-generate
@@ -19,9 +19,9 @@ The user describes a workflow in prose and wants a usable `*.workflow.json`.
1919

2020
Do NOT use this skill for:
2121

22-
- Editing an existing workflow visually — that's `fh-builder open`
22+
- Editing an existing workflow visually — that's `fh-workflow open`
2323
- Bundling a finished workflow for a controller — that's the `workflow-bundle` skill
24-
- Only checking an existing file — run `fh-builder check-schema` / `validate` directly
24+
- Only checking an existing file — run `fh-workflow check-schema` / `validate` directly
2525

2626
## How to run it
2727

@@ -117,7 +117,7 @@ schema check must be green **before** the semantic validator is run at all.
117117
**Gate 1 — structural (`check-schema`). Loop here until it passes.**
118118

119119
```bash
120-
node ts/app/cli/fh-builder.mjs check-schema <path>
120+
node ts/workflow-cli/cli/fh-workflow.mjs check-schema <path>
121121
```
122122

123123
It catches shape errors (wrong `type`, missing required field, bad enum) with a
@@ -129,7 +129,7 @@ check is still failing** — a malformed shape must never reach Gate 2.
129129
**Gate 2 — semantic (`validate`). Only once Gate 1 is green.**
130130

131131
```bash
132-
node ts/app/cli/fh-builder.mjs validate <path>
132+
node ts/workflow-cli/cli/fh-workflow.mjs validate <path>
133133
```
134134

135135
It catches semantics: missing required parameters, unconnected nodes, type
@@ -157,7 +157,7 @@ Close by asking whether any of these values should be changed — plainly, e.g.
157157
can correct it in one reply.
158158

159159
Finally, point at the natural next steps without doing them automatically:
160-
`fh-builder open <path>` to inspect visually, or the `workflow-bundle` skill to
160+
`fh-workflow open <path>` to inspect visually, or the `workflow-bundle` skill to
161161
ship it. **Never auto-bundle.**
162162

163163
## Notes for Claude

0 commit comments

Comments
 (0)