Skip to content

feat(map): polylane map — run the first mapping via the user's coding agent - #41

Merged
justinhelmer merged 1 commit into
mainfrom
onb/polylane-map
Aug 18, 2026
Merged

justinhelmer merged 1 commit into
mainfrom
onb/polylane-map

Conversation

@justinhelmer

Copy link
Copy Markdown
Contributor

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 runs startMapping/advanceMapping over 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) — map reads that choice.

How it resolves and runs an agent

  • headlessRun recipe ({ bin, args, env }) added to AgentSetup in src/agents/registry.ts for the 8 agents with a documented scriptable one-shot + auto-approve:

    agent invocation
    claude claude -p <prompt> --permission-mode bypassPermissions
    codex codex exec --full-auto <prompt>
    cursor cursor-agent -p <prompt> --force
    gemini gemini -p <prompt> --yolo
    opencode opencode run <prompt>
    goose goose run --no-session -t <prompt> (GOOSE_MODE=auto)
    pi pi -p <prompt>
    cline cline --yolo <prompt>

    IDE/extension surfaces (warp, roo, windsurf, zed, vscode) have no recipe — they have no scriptable headless entry.

  • Agent resolution: --agent flag > configured agent (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-run prints the exact command instead of running it. Registered as a no-auth command (like setup) — 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. map added to the resource-group assertion (test/resolve.test.ts). Full suite: 255 pass, 0 fail. typecheck + lint clean. 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 probes polylane map --help so older CLIs simply omit the offer. Needs a CLI release after merge for the installer to pick it up.

🤖 Generated with Claude Code

… 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>
@justinhelmer
justinhelmer merged commit c24d024 into main Aug 18, 2026
3 checks passed
@justinhelmer
justinhelmer deleted the onb/polylane-map branch August 18, 2026 21:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant