feat(create-agent-bundle): offer every compiled target in project creation - #759
Conversation
🦋 Changeset detectedLatest commit: b812c57 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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: 00cea295fb
ℹ️ 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".
| .replace(readmeInstallExample, [ | ||
| comment, | ||
| ...hosts.map((host) => `npx agent-bundle install ${host} --from node_modules/${packageName}`), | ||
| ...hosts.map((host) => `npx --no-install agent-bundle install ${host} --from node_modules/${packageName}`), |
There was a problem hiding this comment.
Drop
--no-install from consumer installation examples
In a clean consumer that has installed only the generated package, agent-bundle is absent because the templates declare it under devDependencies, which do not reach consumers (packages/agent-bundle/src/core/package-dependencies.ts:13-16). The npm v11 npx documentation states that --no-install is converted to --no, so these commands cancel instead of obtaining the missing CLI. Both generated READMEs present this as the command to run after publishing and installing the package, making the documented host-install flow fail unless the consumer happened to install agent-bundle separately; reserve the non-fetching form for commands run inside the scaffold or provide a runnable consumer command.
Useful? React with 👍 / 👎.
7d34b0e to
b812c57
Compare
Closes #745.
amphas been a built-in compiler adapter since #729, but project creation still offered fourtargets, so
create-agent-bundle --targets ampfailed withUnknown target "amp"for a host thecompiler builds. The scaffolder cannot import the compiler — project creation must not load the
registry, adapters, or renderer — so it now carries one small catalog of the two
agent-bundlefacts it needs, and a test holds that catalog to the compiler.
What changed
packages/create-agent-bundle/src/options.tsgainshostCatalog: every built-in target, whetheragent-bundle install <host>accepts it, and the templates it cannot carry with the compiler'sown reason.
targetNamesincludesamp.installableTargetsis derived from the catalog, andscaffold.tsreads it instead of its own hard-coded['claude', 'codex', 'cursor'], so ascaffolded README's install lines follow the catalog rather than a second list.
One combination is refused rather than deferred to the first build:
ampwithmcp-server.Amp's MCP configuration is skill-scoped and rejects that template's compiler-owned local
statusserver, which
agent-bundle validate --target ampreports asamp.mcp.generated-local. Theinteractive prompt does not offer a refused target, and a scripted run gets a usage error naming
the templates that target can use:
Two smaller corrections ride along, both in the files this change already touches:
mcp-servertemplate summary said "one conventionalsrc/mcp/<id>.tsentry"; the templateships
src/mcp/status/tools/report-status.tsxwith route-unit and projection pools.npx --no-install agent-bundle. In a scaffolded projectagent-bundleis always a local dependency, so a barenpxthere can only mean an accidentalregistry fetch of an unrelated package.
Guard
packages/create-agent-bundle/tests/host-catalog.test.tsasserts the catalog's target IDs equalcreateDefaultRegistry().names(), thatinstallablematches whatinstallHost()accepts foreach target, that every refusal names a real template and appears in
--help, and that therefused pair is rejected while
minimal/cli-toolwithampresolve.Record<TargetName, …>makes the catalog entry mandatory at compile time, so the next adapter cannot land without a
disposition.
Docs
The #754 pages that documented the gap now document the behavior, in both locales:
guide/start/quick-start,guide/start/capabilities, and theguide/development/troubleshootingrow for a target rejected at project creation.packages/create-agent-bundle/README.mdlists the five targets and the refused pair.Changeset:
patchoncreate-agent-bundle.Local gate
Run on
00cea295fb, which contains currentorigin/main(361d27ff5e):pnpm buildpnpm typecheckpnpm lintpnpm test:unitpnpm docs:site:buildpnpm test:packednpx rstest --config rstest.packed.config.ts run packages/create-agent-bundle/tests/scaffold-packed.e2e.test.tsThe packed scaffolder e2e is the end-to-end proof, not just a unit assertion: its
minimal-template case now scaffolds with
--targets portable,amp, installs the packed tarballs,runs the project's own
check, and asserts the emittedartifact/.amp/plugins/minimal-project/skills/getting-started/SKILL.md.Also verified by hand through the real built CLI: the refused pair exits 2 with the message
above, and
--template minimal --targets ampwritestargets: ['amp'].Deslop
Deslop: gpt-5.6-sol-max, 3 edits — renamed the help section from
Targets:toUnavailable combinations:(the--targetsline already lists the targets), replaced a commentthat hard-coded the very list it derives, and dropped a stale "package build's host order"
comment now that ordering comes from the catalog.
Self-review
Reviewer:
gpt-5.6-sol-max, thenclaude-fable-5-1-thinking-xhighon the fix commit.templates/minimal/README.mdstill said the compiler "emits installable artifacts for Claude Code, Codex, and Cursor, plus a portable layout" — a skills-only Amp scaffold shipped that stale list, since this template has no install section to rewrited415e46cab: the sentence is target-neutral, andscaffold.test.tsasserts the scaffolded README names no hostnpx --no-install, so a README that lost the flag would pass through silently instead of being rewrittend415e46cab: the flag is optional in the marker, always present in the rewrited415e46cab:options.test.tsinspects the options handed tomultiselectd415e46cabRe-gated after the fixes:
pnpm build,pnpm typecheck,pnpm lint,pnpm test:unit(4485 tests, 0 failures),
pnpm docs:site:build, and the packed scaffolder e2e (4/4).