feat(routes): CLI projection input: 'json' takes canonical tool input through --input (#746) - #760
Conversation
🦋 Changeset detectedLatest commit: bf01e9e The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
commit: |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 58a45045d7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| * full parser in `build/manifest.ts` refuse the same set of documents. | ||
| */ | ||
| export const artifactManifestVersion = 4; | ||
| export const artifactManifestVersion = 5; |
There was a problem hiding this comment.
Update every manifest-version consumer to v5
With this bump, inspect renders v5 from the built manifest, but packages/agent-bundle/tests/cli.test.ts:634 still expects Built manifest: v4, so the required unit-test gate fails whenever that case runs. The public target/artifact references also still advertise version 4 in both locales (website/docs/en/reference/targets-artifacts.mdx:59,161,169 and the corresponding Chinese lines 54, 144, and 151); update these consumers as part of the version bump.
AGENTS.md reference: AGENTS.md:L128-L142
Useful? React with 👍 / 👎.
| --- | ||
| "agent-bundle": minor | ||
| "create-agent-bundle": patch |
There was a problem hiding this comment.
Split the stacked release into one changeset per PR
This commit adds this #757 changeset alongside .changeset/746-cli-projection-json-input.md, while changing the publishable agent-bundle and create-agent-bundle packages. The repository requires exactly one changeset per PR, so the stacked base must be separated before this change is merged rather than carrying two independent release records.
AGENTS.md reference: AGENTS.md:L159-L164
Useful? React with 👍 / 👎.
| const consumesRegistration = (fileNames: readonly string[]): boolean => | ||
| fileNames.some((fileName) => !fileName.endsWith('.d.ts') && consumerImport.test(ts.sys.readFile(fileName) ?? '')); |
There was a problem hiding this comment.
Check authored declaration consumers for AB4834
When a program consumes the registration only from an authored declaration file—for example, types/routes.d.ts imports AppRouteInput or ProviderValue to expose an application type—this predicate unconditionally skips that file. If the program omits .agent-bundle/routes.d.ts, validate therefore emits no AB4834 even though those exported types silently degrade to unknown; distinguish external/generated declarations from authored .d.ts inputs instead of excluding all declaration files.
Useful? React with 👍 / 👎.
|
Codex first-pass findings, addressed locally:
The failed Examples check ( |
eec9852 to
48853fc
Compare
… through --input (#746)
…reference (Codex finding)
48853fc to
bf01e9e
Compare
|
Rebased onto |
Closes #746.
Stacked on #757 (branch contains its commits; rebases onto
mainonce #757 lands).What
A
<tool>.cli.tsprojection may declareinput: 'json'. The command then takes the tool's canonical input as one JSON object through--input '<json>'— exactly the path the bulkroutes.mcpCommandsprojection already runs (parseMcpCommandInputis shared) — and never reads the tool's argv grammar. This is the mode for a schema the bounded grammar cannot express (nested object, union, transform): the object reaches the tool's owninputSchemaunchanged, so the tool contract is not weakened, schema issues are spelled under--input.<path>, a non-object--inputexits 2 before the tool runs, andcommand,aliases,description,confirm(--yes) andexitCodebehave as for a flag-bound projection.AB4814on a projected tool now recovers with this mode.input: 'json'withflags,positionals, or amapInputexport isAB4844(no merge precedence to define).inspect --routes, andagent-bundle.manifest.jsonrecordprojection.input: "json"; the closed artifact contract advances tomanifestVersion5 (schema, lean web reader, key inventoryv5).Tests
route-harnesstoolselect(discriminated union under a nested object) +select.cli.tsxJSON projection.tests/projection/cli-dispatch-json-projection.test.ts: compiled command shape, CLI ≡ MCP result with nested defaults, non-object--inputrefusal,--input.<path>issue spelling,--yesconfirmation, help text.tests/packed-stdio-projection.test.ts: the same command from the source-free packed bin.cli-projection.test.ts,manifest-schema.test.ts,web-manifest.test.ts,manifest-key-inventory.test.ts, contract matrix, in-memory MCP, harness manifest updated.Docs
en+zh:
guide/authoring/package-entries.mdx(JSON mode),reference/artifact-manifest.mdxandguide/concepts/architecture.mdx(manifestVersion 5,projection.input),docs/diagnostics.md(AB4814/AB4844/AB7001),docs/entry-conventions.md. Changeset:.changeset/746-cli-projection-json-input.md(agent-bundleminor — manifest contract bump).Local gate (current main + #757)
pnpm build && pnpm typecheck && pnpm lint— passpnpm test:unit— 4479 pass; 4 timeout-driven failures under concurrent load pass when rerun alone (106/106)pnpm test:projection— 197 pass;pnpm test:route-unit— 90 passpnpm docs:site:build— in progress, results appended belowDeslop: Claude Fable, 2 edits (helper placement in
cli-entry.ts, issue ref in a type comment).Self-review
Pending.