You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(cli): rendered commands and output modes (#102 stage 3) (#186)
* feat(cli): compile src/cli/** routes into a routed CLI executable (#102 stage 2)
Conventional command routes now compile into one collision-checked command
graph on the route-graph IR: path nesting is identity, the static config
export supplies description/aliases/positionals/exit-code policy, and a
bounded documented zod grammar projects each route's inputSchema onto argv
with named AB4814 diagnostics for everything outside it. The graph feeds the
existing package-build pipeline as one generated Rslib executable (cli-entry
runtime shell aliased in, exactly like mcp-entry); commands run inside the
typed Agent request context and keep the one-JSON-line stdout contract.
New diagnostics AB4813 (command/alias/bin collisions), AB4814 (argv policy),
AB4815 (route contract), AB4816 (rendered commands gated until stage 3).
* feat(cli): render .tsx commands and scripts through the dispatcher (#102 stage 3)
Rendered CLI routes and conventional rendered scripts now execute through
the runtime dispatcher's public stream() against a sibling react-server
worker, with four output modes: in-place TTY progress, one final piped
Markdown document, --json canonical value, and --ndjson sequence-numbered
render events (CLI/script dialect, never MCP stdout). Plain .ts keeps
ordinary Node semantics. Lifts the AB4807/AB4816 stage gates (retired, not
reused), consciously flips the docs-contract pin to the narrowed runRscCli
compatibility claim with the routed-CLI replacement pins, and updates
framework-mode's power-tier reference. Proof: audiobook-curator's manual
CLI operation registry migrates to fifteen src/cli/ routes — fourteen plain
commands byte-parity, library-audit rendered.
* test(harness): pin the rendered flag on compiled CLI commands (#190 reconcile)
|`AB4804`| error | A `routes` mode override is not `generated`/`custom`/`command`/`remote` for a server, or `generated`/`conventional` for the CLI. |
197
218
|`AB4805`| error | A route module exports `config` through a rejected declaration shape (`let`/`var`, destructuring, `export { config }`, a function or class, a missing initializer), or the extracted value is not an object. |
198
219
|`AB4806`| error | A route module's `config` initializer is dynamic — the message names the offending construct and position. |
199
-
|`AB4807`|error|A conventional `src/scripts/` route is a rendered-script module (`.tsx`/`.jsx`); rendered scripts are not supported yet. Rename it to `.ts`, prefix a path segment with `_` to keep it private, or declare it under `scripts` in config to opt into plain bundling. |
220
+
|`AB4807`|retired|The stage-1 rendered-script gate. Rendered script routes ship through the Agent renderer pipeline since #102 stage 3; the code is never reused. |
200
221
|`AB4808`| error | A conventional `src/scripts/` route nests below the scripts root; conventional scripts ship as direct children only. Move it up, prefix a path segment with `_`, or declare it under `scripts` in config with a flat name. |
201
222
|`AB4809`| error | A conventional `src/scripts/` route and a configured `scripts` entry share one script identity through different files. Point the config entry at the module to claim it, or rename one of the two. |
202
223
|`AB4810`| error | A generated MCP route is missing named `inputSchema`/`resultSchema` exports or its default export is not an async function component. |
|`AB4813`| error | The command graph collides: a route is both a command module and a command group, an alias collides with a sibling command, group, or alias, an alias is unsafe or duplicated, or an explicit `bin` entry claims the generated CLI executable's name. |
206
227
|`AB4814`| error | A CLI route's `inputSchema` leaves the bounded argv grammar (the message names the offending construct and position), a key projects onto a reserved or duplicate option name, a required boolean has no flag expression, or `config.positionals` violates the positional policy. |
207
228
|`AB4815`| error | A CLI route does not satisfy the routed command contract: missing named `inputSchema`/`resultSchema` exports, a default export that is not an async function, or malformed `config.description`/`aliases`/`exitCode` fields. |
208
-
|`AB4816`|error|A conventional `src/cli/**` route is a rendered-command module (`.tsx`/`.jsx`); rendered commands are not supported yet. Rename it to `.ts`, or prefix a path segment with `_` to keep it private. |
229
+
|`AB4816`|retired|The stage-2 rendered-command gate. Rendered command routes render through the dispatcher since #102 stage 3; the code is never reused. |
Copy file name to clipboardExpand all lines: docs/entry-conventions.md
+19-3Lines changed: 19 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -59,8 +59,9 @@ entries carry `provenance.kind: 'conventional'` in the normalized model.
59
59
|`src/mcp/<server-id>.ts`| Stdio entry for the declared MCP server `<server-id>` that names no `entry`, `command`, or `url`. | Declare `entry` explicitly |
60
60
|`src/mcp/<server>/{tools,resources,prompts}/*.{ts,tsx}`| Generated MCP server routes; path supplies identity and each executable module supplies static `config`, schemas, and one async default Server Component. | Set `routes.servers.<server>` to `custom`, `command`, or `remote`|
61
61
|`src/mcp/<server>/apps/*.{ts,tsx}`| Browser MCP App entry compiled to self-contained HTML and registered on the generated server; static `config.resourceUri` is required. | Use a custom server or prefix the file with `_`|
62
-
|`src/scripts/<name>.ts`| Plain script compiled to `scripts/<name>.mjs` in every selected target artifact — the same pipeline explicit `scripts` entries use. A `scripts` entry that references the file claims it. Rendered (`.tsx`) and nested modules are hard errors until later #102 stages (`AB4807`/`AB4808`). | Prefix a path segment with `_`, or claim the file with an explicit `scripts` entry |
63
-
|`src/cli/**/*.ts`| Routed CLI commands compiled into one collision-checked command graph and one generated package executable named after `plugin.name` (superseding the `src/cli.ts` bin convention for the project). Nesting is identity: `src/cli/library/audit.ts` runs as `<bin> library audit`. Rendered (`.tsx`) command routes are hard errors until #102 stage 3 (`AB4816`). |`bin: false`, `routes.cli: 'conventional'`, or prefix a path segment with `_`|
62
+
|`src/scripts/<name>.ts`| Plain script compiled to `scripts/<name>.mjs` in every selected target artifact — the same pipeline explicit `scripts` entries use, with ordinary Node stdout/stderr semantics. A `scripts` entry that references the file claims it. Nested modules are hard errors (`AB4808`). | Prefix a path segment with `_`, or claim the file with an explicit `scripts` entry |
63
+
|`src/scripts/<name>.tsx`| Rendered script: the async default component receives `{ argv, signal }` and renders through the Agent renderer with the CLI output contract (`--json`, `--ndjson`, TTY progress, piped Markdown). Compiles to `scripts/<name>.mjs` plus a `scripts/<name>-flight.mjs` react-server worker. The extension is the explicit, visible contract — plain `.ts` scripts are never wrapped in React behavior, and explicit `scripts` config entries stay plain regardless of extension. | Rename to `.ts`, prefix a path segment with `_`, or claim the file with an explicit `scripts` entry |
64
+
|`src/cli/**/*.{ts,tsx}`| Routed CLI commands compiled into one collision-checked command graph and one generated package executable named after `plugin.name` (superseding the `src/cli.ts` bin convention for the project). Nesting is identity: `src/cli/library/audit.ts` runs as `<bin> library audit`. Plain `.ts` commands execute directly and print one canonical JSON line; `.tsx` commands render through the dispatcher with the four output modes. |`bin: false`, `routes.cli: 'conventional'`, or prefix a path segment with `_`|
0 commit comments