B1: generalize amico-run into the amico CLI (verb router) - #118
Merged
Conversation
Introduce the `amico` verb-router surface over the existing amico-run launch path, non-destructively. No package rename, no removed behavior. - Extract the launch body of cli.ts verbatim into src/launch.ts (`main` → `launch`); cli.ts becomes a thin `amico-run` bin wrapper. This lets BOTH the `amico-run` bin and the new `amico run` verb call the SAME launch path with no behavior fork. - Add src/amico.ts — the verb router. `run`/`resolve`/`sandbox` delegate verbatim to launch (`amico <verb> <args>` ≡ `amico-run <equiv-args>`). `--help` lists the full verb surface; unknown verb → exit 64. - Add src/verbs.ts — spine bookkeeping verbs (catalog/vault/device/note) as B1 STUBS: print intent + the module/slice each will generalize, exit 0. Real bodies are B2/B3/B5. - Add src/mcp_serve.ts — the optional MCP facade over the same verbs. STUB seam only: `--list` renders the verb↔tool mapping; the transport carries ZERO MCP SDK dependency so it stays within the S31 no-MCP guard (landing the real transport needs an explicit S31 amendment, as spec C did). - esbuild builds both dist/amico-run.js and dist/amico.js; package.json adds the `amico` bin; launcher/amico mirrors launcher/amico-run. - test/amico.test.ts covers router dispatch: --help surface, unknown-verb →64, verbatim run/resolve/sandbox delegation, stub verbs, mcp-serve facade. All existing amico-run tests stay green (106 → 120 with the 14 new router tests). Spec-20260708-112732 §7.3; plan-20260708-214610 slice B1. Closes #108 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this does
Introduces the
amicoverb-router surface generalizingamico-run— the foundation slice of the depth-1 tool-spine (issue #108, spec-20260708-112732 §7.3, plan-20260708-214610 slice B1). Non-destructive: no package rename, no removed behavior, no bookkeeping migrated.The seam
src/launch.ts— the amico-run launch body, extracted verbatim fromcli.ts(main→launch, self-invocation removed).cli.tsis now a thinamico-runbin wrapper importing it. This is the single delegation point: both theamico-runbin and the newamico runverb call the SAME launch path, so there is no behavior fork and the existing amico-run suite still exercises the real bodies.src/amico.ts— the verb router (newamicobin).run/resolve/sandboxdelegate verbatim:amico <verb> <args>≡amico-run <equivalent-args>.amico --helplists the full verb surface; unknown verb → exit 64; bareamico→ usage + exit 64.src/verbs.ts— the shared-spine bookkeeping verbs (catalog,vault,device,note) as clearly-marked B1 stubs: each prints its intent, the real module it will generalize, and the slice that lands the body, then exits 0. No bookkeeping logic migrated — that is B2/B3/B5.src/mcp_serve.ts— the optional MCP facade over the same verbs. Stub seam only:--listrenders the verb↔tool mapping; the transport carries zero MCP SDK dependency, keeping it inside thetest/s31.test.ts"no MCP in the orchestrator" guard. Landing the real transport will require an explicit, reviewed S31 amendment — exactly as spec C amended the S31 SolveSpec ban to name amico-run the launch gate.esbuild.config.mjsnow emits bothdist/amico-run.jsanddist/amico.js;package.jsonadds theamicobin;launcher/amicomirrorslauncher/amico-run.Tests
test/amico.test.ts(14 new tests) covers the router seam:--helpsurface, unknown-verb → 64, verbatimrun/resolve/sandboxdelegation (reusing the existing fixtures), the four stub verbs, and themcp-servefacade (--list+ no-flag).Full suite green;
tsc --noEmitclean. (Julia-gatedtest/slow/**not run — needsAMICO_TEST_JULIA_PROJECTper AGENTS.md.)Acceptance criteria (#108)
amico <verb>dispatch routes run/resolve/sandbox verbatim to existing amico-run behaviormcp-serveseams present (stubs this slice)Notes for review
packages/amico-run(bun/pnpm TS), no opencode/vendor surface.🤖 Generated with Claude Code