Repository navigation
feat(map): polylane map — run the first mapping via the user's coding agent - #41
Merged
Merged
Conversation
… coding agent
Adds a `headlessRun` recipe to the agent registry and a `polylane map`
command that launches the user's primary coding agent headlessly to map the
current repository (prompt: "Map this repository with Polylane"). This is what
the 0.2.x installer's "Or we can run it for you now?" step calls, so the user
never has to open their agent and paste the prompt by hand.
- `HeadlessRun` recipe ({ bin, args, env }) added to AgentSetup for the 8
agents with a documented scriptable one-shot + auto-approve: claude
(-p --permission-mode bypassPermissions), codex (exec --full-auto), cursor
(cursor-agent -p --force), gemini (-p --yolo), opencode (run), goose
(run --no-session -t, GOOSE_MODE=auto), pi (-p), cline (--yolo). IDE/extension
surfaces (warp, roo, windsurf, zed, vscode) have no recipe.
- `polylane map` resolves the agent (--agent flag > configured `agent` from
#38 > sole installed > interactive pick), verifies the binary is on PATH,
and falls back to any installed sibling CLI agent when the primary is
IDE-only, so a Windsurf/Zed user still maps through e.g. Claude Code.
`--dry-run` prints the command; no runnable agent prints the manual
instruction and exits 0. Registered as a no-auth command (like `setup`).
- 22 new tests (recipe coverage, sibling fallback, PATH probe); `map` added to
the resource-group and no-auth lists.
Part of unified onboarding (coreplanelabs/nominal#1165). Needs a CLI release
after merge for the installer to pick it up.
Co-Authored-By: Claude Opus 4.8 <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
Adds
polylane map— a command that launches the user's primary coding agent headlessly to map the current repository into their workspace (the agent runsstartMapping/advanceMappingover the authed MCP; the CLI just kicks it off). This is what the 0.2.x installer's new "Or we can run it for you now?" step calls, so a new user never has to open their agent and paste the mapping prompt by hand.Builds directly on #38 (which stores the user's primary coding agent) —
mapreads that choice.How it resolves and runs an agent
headlessRunrecipe ({ bin, args, env }) added toAgentSetupinsrc/agents/registry.tsfor the 8 agents with a documented scriptable one-shot + auto-approve:claude -p <prompt> --permission-mode bypassPermissionscodex exec --full-auto <prompt>cursor-agent -p <prompt> --forcegemini -p <prompt> --yoloopencode run <prompt>goose run --no-session -t <prompt>(GOOSE_MODE=auto)pi -p <prompt>cline --yolo <prompt>IDE/extension surfaces (warp, roo, windsurf, zed, vscode) have no recipe — they have no scriptable headless entry.
Agent resolution:
--agentflag > configuredagent(from feat(setup): let the user pick their primary coding agent #38) > the sole installed agent > interactive pick among installed agents.PATH check + sibling fallback: verifies the recipe's binary is installed, and if the primary agent is IDE-only, falls back to any installed sibling CLI agent — the map only needs an agent wired to the authed MCP, not the primary one. So a Windsurf/Zed user still maps through e.g. Claude Code (with a one-line notice). Only a user whose sole agent is IDE-only drops to the manual "open X and ask" instruction (exit 0).
--dry-runprints the exact command instead of running it. Registered as a no-auth command (likesetup) — it calls no API itself.Tests
22 new tests (
test/map.test.ts): recipe coverage for all 8 CLI agents + the 5 IDE-only exclusions, the sibling-fallback decision table, and the PATH probe.mapadded to the resource-group assertion (test/resolve.test.ts). Full suite: 255 pass, 0 fail.typecheck+lintclean. Smoke-tested the built binary: auto-detect,--agent codex,--agent windsurf(→ sibling), and--agent bogus(usage error) all behave.Rollout
Part of unified onboarding (coreplanelabs/nominal#1165). The companion polylanedotcom installer PR calls
polylane map; it probespolylane map --helpso older CLIs simply omit the offer. Needs a CLI release after merge for the installer to pick it up.🤖 Generated with Claude Code