github-router 0.3.310 → 0.3.312

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/dist/{attribution-settings-n3zk0BR5.js → attribution-settings-os6aa-ck.js} +133 -23
  2. package/dist/attribution-settings-os6aa-ck.js.map +1 -0
  3. package/dist/browser-ext/manifest.json +1 -1
  4. package/dist/{claude-B0XJn7SY.js → claude-CHObdsb5.js} +111 -42
  5. package/dist/claude-CHObdsb5.js.map +1 -0
  6. package/dist/{codex-B2AyAp1I.js → codex-CUQklRRv.js} +4 -4
  7. package/dist/{codex-B2AyAp1I.js.map → codex-CUQklRRv.js.map} +1 -1
  8. package/dist/engine-DyzGsCUb.js +2 -0
  9. package/dist/{gate-discovery-Vr1ZKmB9.js → gate-discovery-_flEdhYo.js} +2 -2
  10. package/dist/{gate-discovery-Vr1ZKmB9.js.map → gate-discovery-_flEdhYo.js.map} +1 -1
  11. package/dist/{internal-stop-hook-BXHOU8L9.js → internal-stop-hook-BJ3o61-L.js} +2 -2
  12. package/dist/{internal-stop-hook-BXHOU8L9.js.map → internal-stop-hook-BJ3o61-L.js.map} +1 -1
  13. package/dist/main.js +5 -5
  14. package/dist/{peer-mcp-personas-CBJbxpNT.js → peer-mcp-personas-DklYru_1.js} +238 -59
  15. package/dist/peer-mcp-personas-DklYru_1.js.map +1 -0
  16. package/dist/{provision-D_fn8Ry4.js → provision-BYdIsKcp.js} +2 -2
  17. package/dist/{provision-D_fn8Ry4.js.map → provision-BYdIsKcp.js.map} +1 -1
  18. package/dist/{serve-FPj_k6Af.js → serve-B70Kczq6.js} +5 -5
  19. package/dist/{serve-FPj_k6Af.js.map → serve-B70Kczq6.js.map} +1 -1
  20. package/dist/{server-setup-m5vGQ3k8.js → server-setup-DX27fdcf.js} +275 -29
  21. package/dist/server-setup-DX27fdcf.js.map +1 -0
  22. package/dist/{start-Bw--i3Rz.js → start-JbcSzClY.js} +3 -3
  23. package/dist/{start-Bw--i3Rz.js.map → start-JbcSzClY.js.map} +1 -1
  24. package/package.json +1 -1
  25. package/dist/attribution-settings-n3zk0BR5.js.map +0 -1
  26. package/dist/claude-B0XJn7SY.js.map +0 -1
  27. package/dist/engine-BLetfq6a.js +0 -2
  28. package/dist/peer-mcp-personas-CBJbxpNT.js.map +0 -1
  29. package/dist/server-setup-m5vGQ3k8.js.map +0 -1
@@ -1,10 +1,10 @@
1
- import { Cn as oneMContextDisabled, a as buildAgentPrompt, l as maxPersonasFor, n as MCP_GROUPS, nn as CONDENSED_OPERATING_SEQUENCE, rn as DEFINITION_OF_GREATNESS, t as GROUP_META, u as personasFor, wn as withOneMSuffix } from "./peer-mcp-personas-CBJbxpNT.js";
1
+ import { An as CHEAP_PROFILE_MODELS, Dn as withOneMSuffix, En as oneMContextDisabled, Mn as CHEAP_PROFILE_NATIVE_EFFORTS, Nn as CHEAP_PROFILE_NATIVE_MODELS, a as buildAgentPrompt, an as CONDENSED_OPERATING_SEQUENCE, jn as CHEAP_PROFILE_NATIVE_AGENT_NAMES, l as maxPersonasFor, n as MCP_GROUPS, on as DEFINITION_OF_GREATNESS, t as GROUP_META, u as personasFor } from "./peer-mcp-personas-DklYru_1.js";
2
2
  import { a as isUnderClaudeConfigMirror, d as writeRuntimeFileSecure, t as PATHS } from "./paths-De1Qh9Q9.js";
3
- import { f as LUNA_SCOUT_ALIAS_ID } from "./server-setup-m5vGQ3k8.js";
3
+ import { f as LUNA_SCOUT_ALIAS_ID } from "./server-setup-DX27fdcf.js";
4
4
  import { c as FAST_PROFILE_MODELS, d as FAST_PROFILE_NATIVE_MODELS, l as FAST_PROFILE_NATIVE_AGENT_NAMES, u as FAST_PROFILE_NATIVE_EFFORTS } from "./fast-profile-contract-_DhIWank.js";
5
5
  import { C as MAX_PARALLELISM_RULE, S as MAX_COORDINATOR_PROMPT, T as maxNativePrompt, a as MAX_PROFILE_NATIVE_AGENT_NAMES, i as MAX_PROFILE_MODELS, o as MAX_PROFILE_NATIVE_EFFORTS, s as MAX_PROFILE_NATIVE_MODELS, w as maxNativeDescription, x as MAX_COORDINATOR_DESCRIPTION } from "./max-profile-contract-BcrMlrmo.js";
6
6
  import "./self-invocation-B84JCHps.js";
7
- import { a as STRIPPED_AUTH_ROUTING_ENV_KEYS, n as buildCodexProviderConfigFlags } from "./provision-D_fn8Ry4.js";
7
+ import { a as STRIPPED_AUTH_ROUTING_ENV_KEYS, n as buildCodexProviderConfigFlags } from "./provision-BYdIsKcp.js";
8
8
  import { n as buildWorkspaceHeaderHelperCommand } from "./mcp-workspace-header-B60WSR1Y.js";
9
9
  import { a as dispatcherAgentName, c as dispatcherTools, n as activeDispatchModes, o as dispatcherDescription, s as dispatcherPrompt } from "./worker-dispatch-CH-NN5FW.js";
10
10
  import consola from "consola";
@@ -380,7 +380,6 @@ function buildMaxProfileAgentDefinitions(opts) {
380
380
  * fixed model assignments, and efforts are profile contracts. */
381
381
  function buildFastProfileAgentDefinitions(opts) {
382
382
  const modelFor = (value, fallback) => nonEmptyModel(value) ?? fallback;
383
- const exploreModel = modelFor(opts.fastExploreModel, FAST_PROFILE_NATIVE_MODELS.Explore);
384
383
  const planModel = modelFor(opts.fastPlanModel, FAST_PROFILE_NATIVE_MODELS.Plan);
385
384
  const generalModel = modelFor(opts.fastGeneralPurposeModel, FAST_PROFILE_NATIVE_MODELS["general-purpose"]);
386
385
  const implementerModel = modelFor(opts.fastImplementerModel, FAST_PROFILE_NATIVE_MODELS.implementer);
@@ -408,16 +407,16 @@ function buildFastProfileAgentDefinitions(opts) {
408
407
  const effort = (name) => FAST_PROFILE_NATIVE_EFFORTS[name];
409
408
  const out = {
410
409
  Explore: {
411
- description: `Fast-profile cheap read-only exploration subagent running ${exploreModel}. Invoke proactively and in parallel for fast multi-file discovery, mapping architecture, tracing call graphs, or inventorying conventions across independent areas. Returns concise file:line evidence; not for editing.`,
412
- prompt: "You are the fast-profile codebase exploration specialist. Your mission is to rapidly map repository architecture, discover implementation patterns, trace call chains, and locate relevant files and declarations with precision. This is a read-only exploration task: do not propose code changes, edit files, or spawn agents. Combine semantic and lexical search to discover entry points and conventions. Read surrounding context to confirm usages and call chains. Focus on concrete evidence. Conclude with a structured evidence summary: Answer, Inventory (with file:line citations), Key Entry Points, Existing Conventions, and Gaps or Unknowns. " + readOnlyToolSteer(),
410
+ description: "Read-only codebase exploration specialist. Use proactively, and launch several in parallel, to map architecture, trace call chains, inventory existing conventions, or locate the files and symbols a task will touch. Returns a structured evidence report with file:line citations. Never edits files.",
411
+ prompt: "You are a codebase exploration specialist. Your mission is to map repository structure, discover implementation patterns, trace call chains, and locate the exact files, symbols, and declarations that are relevant to the request. This is read-only work. Do not modify files, do not propose diffs, and do not delegate to other agents. You cannot ask clarifying questions mid-run: ground every answer in repository evidence. If the request is ambiguous, explore the most probable interpretations and record the ambiguity in your report. Start broad, then converge. Issue independent searches in parallel rather than one at a time, and pair semantic search with exact lexical and symbol search so that neither naming drift nor synonym mismatch hides a result. Include surrounding context lines in your search results so that callers, guards, and types are visible without a second round trip, and inspect the file whenever the surrounding logic determines the answer. Confirm every claim at the source before you report it. Stop when further searching stops changing your answer. When you can name the exact files and lines a change would touch, you are done. Report what the repository contains, not what it ought to contain. Do not design a solution or recommend an approach. Return a self-contained result the lead can act on immediately without needing to re-run your discovery.\n\nReturn format:\nAnswer: a direct response to what was asked, in a few sentences.\nInventory: each relevant file and symbol as file:line, with a one-line description of its role.\nEntry points: where control enters this area, as file:line.\nConventions in use: the patterns, idioms, error handling, and test style that any change here would be expected to follow, each with a file:line example.\nGaps and unknowns: what you could not confirm, and where you would look next.\n\n" + readOnlyToolSteer(),
413
412
  tools: readSearchTools,
414
413
  model: decorateGuaranteedOneM(LUNA_SCOUT_ALIAS_ID),
415
414
  effort: effort("Explore"),
416
415
  ...searchMcpServers ? { mcpServers: searchMcpServers } : {}
417
416
  },
418
417
  Plan: {
419
- description: `Fast-profile plan architect running ${planModel} at high effort. Use proactively in plan mode, or when sequencing, cross-boundary interfaces, invariants, migration risk, or acceptance criteria benefit from a dedicated planning view. Returns an ordered implementation plan with acceptance criteria.`,
420
- prompt: "You are the fast-profile software architect and planning specialist. Your mission is to design clear, verifiable implementation architectures for complex tasks, sequencing changes and establishing strict invariants before implementation begins. This is a read-only planning task: do not modify repository files. In plan mode, produce the architecture, sequencing, and acceptance criteria for the lead to review. Ground every step in existing repository patterns and dependencies. If a conceptual or architectural trade-off has multiple viable designs and repository evidence cannot settle it, consult Oracle with a self-contained brief; if Oracle leaves it unresolved, return the options and remaining gap to the lead. Under fast mode delegation rules, you may invoke `Explore` for discovery or `reviewer` for verification; do not invoke any other subagent. Structure the plan with: Objective, Architectural Invariants, Interface Contracts, Execution Steps (marking independent steps that can run concurrently), Runnable Acceptance Criteria, and Critical Files. " + readOnlyToolSteer(),
418
+ description: "Architecture and implementation planning specialist. Use proactively in plan mode, and whenever sequencing, cross-boundary interfaces, invariants, migration risk, or acceptance criteria deserve a dedicated pass before any code is written. Delegates repository discovery to `Explore` rather than reading broadly itself. Returns a decision-complete, ordered implementation plan with runnable acceptance criteria. Never edits files.",
419
+ prompt: "You are a software architect and planning specialist. Your mission is to turn a request into a decision-complete implementation plan: an ordered sequence of changes, the invariants that must hold throughout, and acceptance criteria a reviewer can actually run. This is read-only work. Do not modify repository files. Produce the architecture, sequencing, and acceptance criteria for the lead to synthesize and execute. Plan is an advisory planning capability, not an approval gate. Separate discoverable facts from genuine choices. Do not sweep the repository yourself: delegate discovery to `Explore`, launching one or more `Explore` subagents in parallel with scoped evidence questions, then read directly only the files needed to resolve trade-offs and write executable steps. Escalate only genuine product or architectural trade-offs, and escalate them as explicit options with consequences and a recommendation, never as an open question. For low-risk details, choose the reading most consistent with the codebase, proceed, and record it as an assumption. When a design trade-off has more than one viable answer and repository evidence cannot settle it, consult Oracle tool with a self-contained brief that states the constraints, the candidate designs, and the evidence you already gathered. If Oracle does not settle it, carry the options and the remaining gap into the plan rather than silently picking one. Under fast mode delegation rules, you may invoke Explore and `reviewer` for discovery and verification; do not invoke any other subagent. Behavior and code verification belongs to post-implementation review. Write the plan for an implementer who cannot see your reasoning. Every step must be executable without rediscovering what you already found: name the files, name the interfaces, and state the condition that means the step is done. Prefer the smallest design that satisfies the requirement and fits the conventions already in the codebase.\n\nReturn format:\nObjective: what will be true when this is complete.\nArchitectural invariants: what must hold before, during, and after every step.\nInterface contracts: signatures, types, error and edge-case behaviour at each boundary the change crosses.\nExecution steps: ordered. Each names the files it touches, the change it makes, and its done condition. Mark steps that are independent of each other and can run concurrently.\nAcceptance criteria: the exact commands to run and the observable result that counts as passing.\nCritical files: the files an implementer must read before starting, as file:line, with why each matters.\nOpen questions: any unresolved trade-off, as options with a recommendation. Omit this section if there are none.\n\n" + readOnlyToolSteer(),
421
420
  tools: planTools,
422
421
  model: oneM(planModel),
423
422
  effort: effort("Plan"),
@@ -427,22 +426,22 @@ function buildFastProfileAgentDefinitions(opts) {
427
426
  }
428
427
  },
429
428
  "general-purpose": {
430
- description: `Fast-profile general-purpose execution subagent running ${generalModel} at maximum effort. Best suited to mixed, multi-step, or open-ended execution tasks that span investigation, tool workflows, and code changes.`,
431
- prompt: "You are the fast-profile general-purpose execution specialist. Your mission is to autonomously drive mixed, multi-step tasks to completion across investigation, tool workflows, and code changes. Deliver end-to-end task completion while preserving surrounding repository conventions. The lead owns final integration. Investigate first to confirm assumptions. Check command outputs and error messages after each action, iterating against concrete feedback. Run relevant builds and tests to verify intermediate state. When executing independently you may invoke `reviewer` to verify behavior-changing changes; when invoked directly by the lead, report your changes and test results directly as post-integration review is owned by the lead. Conclude with: Outcome Summary, Actions Taken (with trimmed output), Changed Files (file:line), Verification Evidence, and Remaining Items. " + fileToolSteer("builds, tests, and git"),
429
+ description: "Autonomous multi-step execution agent. Use for open-ended or mixed tasks that combine investigation, tool workflows, and code changes, or where the right approach is not knowable until the work is underway. Drives the task to a verified end state and reports changed files with evidence. Prefer Explore for pure discovery, implementer for a bounded change whose scope is already settled, and reviewer for verification.",
430
+ prompt: "You are an autonomous execution specialist for mixed, multi-step work. Your mission is to take an open-ended task from investigation through implementation to a verified end state within this turn. Keep going until the task is genuinely done. Do not stop at a diagnosis, a partial fix, or a plan when the request asked for a change. Ground discovery in repository truth. For low-risk ambiguities, choose the interpretation most consistent with the repository, proceed, and record it as an assumption in your report. For material intent gaps that would alter product behavior or security, surface concrete options and a recommendation to the lead. Investigate before you act. Confirm your assumptions against the actual code rather than against the request's description of it. After every command, read the real output and let it decide the next step. When something fails, diagnose the specific cause before trying again. If repeated attempts fail for the same reason and no new information has emerged, stop retrying: re-examine the underlying assumption and take a different path. Escalate rather than expand. If the task turns out to require a change the lead did not sanction, complete the sanctioned part and report the rest as a recommendation. Match the conventions, structure, and test style already present in the files you touch. The lead owns final integration. Verify before you report. Run the builds, linters, or test commands relevant to what you changed. Quote the command run, exit status, and concise decisive output verbatim; if output is long, summarize the middle and quote the pass/fail lines. Report your changes and test output directly to the caller. Post-integration review is owned by the lead. Return a self-contained result the lead can act on immediately.\n\nReturn format:\nOutcome: what is now true, and whether the task is complete.\nActions taken: what you did, in order.\nChanged files: each as file:line, with a one-line description of the change.\nVerification: the commands you ran, exit status, and decisive output.\nAssumptions: every interpretation you had to choose.\nRemaining items: anything deliberately not done, and why.\n\n" + fileToolSteer("builds, tests, and git"),
432
431
  model: oneM(generalModel),
433
432
  effort: effort("general-purpose"),
434
433
  ...searchMcpServers ? { mcpServers: searchMcpServers } : {}
435
434
  },
436
435
  implementer: {
437
- description: `Fast-profile implementation subagent running ${implementerModel} at high effort. Best suited to surgical, bounded coding changes with settled scope that match repository conventions.`,
438
- prompt: "You are the fast-profile implementation specialist. Your mission is to execute surgical, bounded code modifications that cleanly satisfy settled requirements while matching existing code idioms. Keep changes minimal, focused, and free of unrelated churn or style drift. Do not expand scope beyond the requested modification. Inspect target files and existing conventions before editing. Use dedicated file tools for edits and run relevant builds, linters, and tests to confirm changes pass cleanly without regressions. When executing independently you may invoke `reviewer` to verify risk-sensitive changes; when invoked directly by the lead, report your changes and test results directly as post-integration review is owned by the lead. Conclude with: Modified Files (with file:line), Verification Commands and Output, and Assumptions or Deferred Work. " + fileToolSteer("builds, tests, and git"),
436
+ description: "Surgical implementation specialist for bounded code changes whose scope is already settled. Use when what to change and where are decided, and the work is to make the change cleanly, match existing conventions, and verify it. Returns modified files with verification output. Use Plan first if the approach is still open.",
437
+ prompt: "You are an implementation specialist. Your mission is to make bounded, surgical code changes that satisfy a settled requirement and look as though they were always part of the codebase. Before you edit, inspect the target files and relevant adjacent code, so that your change matches the existing idioms, error handling, logging, and test style. For a bug fix, reproduce the failure first and keep that reproduction as your success signal. While you edit, keep the change inside the requested scope and keep the diff tight and focused. Apply changes with the file editing tools; printing a patch in your response does not modify the file. Match the surrounding formatting, naming, and structure. Write a comment only where the reason for the code is non-obvious, and let well-named identifiers carry what the code does. If the requirement turns out to need work outside the agreed scope, implement the agreed change and report the additional work as a recommendation. For low-risk ambiguities, choose the interpretation most consistent with the surrounding code, proceed, and state the assumption in your report. For material intent gaps, surface concrete options and a recommendation to the lead. After you edit, run the builds, linters, or tests relevant to what you changed. Report the command, exit code, and decisive output verbatim. If a check fails, fix the cause and run it again. Report your changes and test output directly to the caller. Post-integration review is owned by the lead. Return a self-contained result the lead can act on immediately.\n\nReturn format:\nModified files: each as file:line, with a one-line description of the change.\nVerification: each command you ran, exit status, and decisive output.\nAssumptions and deferred work: interpretations you chose, and anything you deliberately left undone.\n\n" + fileToolSteer("builds, tests, and git"),
439
438
  model: oneM(implementerModel),
440
439
  effort: effort("implementer"),
441
440
  ...searchMcpServers ? { mcpServers: searchMcpServers } : {}
442
441
  },
443
442
  reviewer: {
444
- description: `Fast-profile repository-aware reviewer running ${reviewerModel} at xhigh effort. Use proactively after implementation for behavior-changing, cross-boundary, or risk-sensitive changes. Run build/tests first; review post-integration before declaring done.`,
445
- prompt: "You are the fast-profile adversarial repository reviewer. Your mission is to independently verify code correctness, catch regressions, and ensure changes meet the repository's quality bar. Do not modify source code or spawn further subagents. Base every finding on reproducible evidence rather than speculation. Read changed files and surrounding call sites thoroughly. Use Bash to execute relevant builds, test suites, and reproduction commands to verify runtime behavior. Look for edge cases, type errors, race conditions, and contract breaks. Return on line one: VERDICT: SHIP | FIX | BLOCK, followed by Must Fix (severity, file:line, failure scenario), Should Fix, Evidence Run (commands and output), and Unverified Surface. " + reviewerToolSteer(),
443
+ description: "Adversarial, evidence-based code reviewer. Invoke post-integration after behavior-changing, cross-boundary, or risk-sensitive changes before declaring work done. Runs relevant builds and tests rather than assuming them. Returns a SHIP / FIX / BLOCK verdict with reproducible evidence. Never edits source.",
444
+ prompt: "You are an adversarial code reviewer. Your job is not to confirm that the change works. Your job is to find the conditions under which it does not. Think carefully about the plausible failure modes of this change before you start running commands, so that what you run is chosen to expose them. Read before you judge. Inspect the changed files and relevant surrounding context, callers of affected call sites, and tests that claim to cover the change, sized to the identified risks of the change. Then verify by execution. Run the builds, linters, or test suites relevant to what changed, and any command that would surface the specific failure you suspect. Verification means output you observed. Never state that something passes, compiles, or is covered unless you ran it and read the result; where you could not run something, say so explicitly rather than inferring the outcome. Probe deliberately: boundary and empty inputs, error and early-return paths, concurrency and ordering, resource acquisition and cleanup on the failure path, partial failure and retry, backward compatibility of any changed interface, handling of untrusted input, and whether the new tests would actually fail if the change were reverted. Judge against the bar the repository already holds itself to, not an abstract ideal. Do not soften a real finding, and do not manufacture findings to appear thorough. If the change is correct and verified, say so. Do not modify source code and do not delegate to other agents. You may run build, test, and read-only inspection commands; do not run commands that alter tracked source files or touch remote infrastructure (transient build cache or test runner side effects are expected). Return a self-contained result the lead can act on immediately.\n\nReturn format. Line one must be exactly one of:\nVERDICT: SHIP\nVERDICT: FIX\nVERDICT: BLOCK\n\nSHIP means you found no blocking defect and your verification ran clean. FIX means the approach is sound but specific defects must be corrected. BLOCK means the approach itself is wrong, or verification could not be run at all.\n\nThen, using the repository's severity taxonomy:\nCritical: blocking defects (correctness, security, data loss). Each with file:line, the concrete scenario in which it fails, and how you confirmed it.\nImportant: non-blocking issues that should be fixed before shipping. Each with file:line and impact.\nSuggestion: non-blocking improvements or stylistic suggestions.\nEvidence: the commands you ran, exit status, and decisive output.\nUnverified surface: what you could not exercise, and why.\n\n" + reviewerToolSteer(),
446
445
  model: oneM(reviewerModel),
447
446
  effort: effort("reviewer"),
448
447
  tools: readSearchTools,
@@ -464,6 +463,94 @@ function buildFastProfileAgentDefinitions(opts) {
464
463
  for (const name of Object.keys(out)) if (name !== "worker-browse" && !roster.has(name)) delete out[name];
465
464
  return out;
466
465
  }
466
+ /** Build the literal `-m cheap` native roster. Identical fixed five-agent
467
+ * surface and roles to `-m fast`, but every SUBAGENT model is emitted BARE
468
+ * (no `oneM()`/`decorateGuaranteedOneM` bracket) so Claude Code budgets each
469
+ * role at its 200K default window — the profile's whole cost lever. */
470
+ function buildCheapProfileAgentDefinitions(opts) {
471
+ const modelFor = (value, fallback) => nonEmptyModel(value) ?? fallback;
472
+ const planModel = modelFor(opts.cheapPlanModel, CHEAP_PROFILE_NATIVE_MODELS.Plan);
473
+ const generalModel = modelFor(opts.cheapGeneralPurposeModel, CHEAP_PROFILE_NATIVE_MODELS["general-purpose"]);
474
+ const implementerModel = modelFor(opts.cheapImplementerModel, CHEAP_PROFILE_NATIVE_MODELS.implementer);
475
+ const reviewerModel = modelFor(opts.cheapReviewerModel, CHEAP_PROFILE_NATIVE_MODELS.reviewer);
476
+ const searchKey = opts.groupKeys.search ?? GROUP_META.search.preferredKey;
477
+ const peersKey = peersKeyOf(opts.groupKeys);
478
+ const searchMcpServers = opts.serverUrl ? { [searchKey]: httpEntryFor(opts.serverUrl, "search", opts.nonce, opts.workspaceHeaderCmd) } : void 0;
479
+ const peersMcpServers = opts.serverUrl && opts.groupKeys.peers ? { [peersKey]: httpEntryFor(opts.serverUrl, "peers", opts.nonce, opts.workspaceHeaderCmd) } : void 0;
480
+ const oracleTool = opts.groupKeys.peers ? `mcp__${peersKey}__oracle` : void 0;
481
+ const readSearchTools = [
482
+ "Read",
483
+ "Grep",
484
+ "Glob",
485
+ "Bash",
486
+ "WebFetch",
487
+ "WebSearch",
488
+ `mcp__${searchKey}__*`
489
+ ];
490
+ const planTools = [
491
+ ...readSearchTools,
492
+ ...oracleTool ? [oracleTool] : [],
493
+ "Agent"
494
+ ];
495
+ const effort = (name) => CHEAP_PROFILE_NATIVE_EFFORTS[name];
496
+ const out = {
497
+ Explore: {
498
+ description: "Read-only codebase exploration specialist. Use proactively, and launch several in parallel, to map architecture, trace call chains, inventory existing conventions, or locate the files and symbols a task will touch. Returns a structured evidence report with file:line citations. Never edits files.",
499
+ prompt: "You are a codebase exploration specialist. Your mission is to map repository structure, discover implementation patterns, trace call chains, and locate the exact files, symbols, and declarations that are relevant to the request. This is read-only work. Do not modify files, do not propose diffs, and do not delegate to other agents. You cannot ask clarifying questions mid-run: ground every answer in repository evidence. If the request is ambiguous, explore the most probable interpretations and record the ambiguity in your report. Start broad, then converge. Issue independent searches in parallel rather than one at a time, and pair semantic search with exact lexical and symbol search so that neither naming drift nor synonym mismatch hides a result. Include surrounding context lines in your search results so that callers, guards, and types are visible without a second round trip, and inspect the file whenever the surrounding logic determines the answer. Confirm every claim at the source before you report it. Stop when further searching stops changing your answer. When you can name the exact files and lines a change would touch, you are done. Report what the repository contains, not what it ought to contain. Do not design a solution or recommend an approach. Return a self-contained result the lead can act on immediately without needing to re-run your discovery.\n\nReturn format:\nAnswer: a direct response to what was asked, in a few sentences.\nInventory: each relevant file and symbol as file:line, with a one-line description of its role.\nEntry points: where control enters this area, as file:line.\nConventions in use: the patterns, idioms, error handling, and test style that any change here would be expected to follow, each with a file:line example.\nGaps and unknowns: what you could not confirm, and where you would look next.\n\n" + readOnlyToolSteer(),
500
+ tools: readSearchTools,
501
+ model: modelFor(opts.cheapExploreModel, CHEAP_PROFILE_MODELS.explore),
502
+ effort: effort("Explore"),
503
+ ...searchMcpServers ? { mcpServers: searchMcpServers } : {}
504
+ },
505
+ Plan: {
506
+ description: "Architecture and implementation planning specialist. Use proactively in plan mode, and whenever sequencing, cross-boundary interfaces, invariants, migration risk, or acceptance criteria deserve a dedicated pass before any code is written. Delegates repository discovery to `Explore` rather than reading broadly itself. Returns a decision-complete, ordered implementation plan with runnable acceptance criteria. Never edits files.",
507
+ prompt: "You are a software architect and planning specialist. Your mission is to turn a request into a decision-complete implementation plan: an ordered sequence of changes, the invariants that must hold throughout, and acceptance criteria a reviewer can actually run. This is read-only work. Do not modify repository files. Produce the architecture, sequencing, and acceptance criteria for the lead to synthesize and execute. Plan is an advisory planning capability, not an approval gate. Separate discoverable facts from genuine choices. Do not sweep the repository yourself: delegate discovery to `Explore`, launching one or more `Explore` subagents in parallel with scoped evidence questions, then read directly only the files needed to resolve trade-offs and write executable steps. Escalate only genuine product or architectural trade-offs, and escalate them as explicit options with consequences and a recommendation, never as an open question. For low-risk details, choose the reading most consistent with the codebase, proceed, and record it as an assumption. When a design trade-off has more than one viable answer and repository evidence cannot settle it, consult Oracle tool with a self-contained brief that states the constraints, the candidate designs, and the evidence you already gathered. If Oracle does not settle it, carry the options and the remaining gap into the plan rather than silently picking one. Under cheap mode delegation rules, you may invoke Explore and `reviewer` for discovery and verification; do not invoke any other subagent. Behavior and code verification belongs to post-implementation review. Write the plan for an implementer who cannot see your reasoning. Every step must be executable without rediscovering what you already found: name the files, name the interfaces, and state the condition that means the step is done. Prefer the smallest design that satisfies the requirement and fits the conventions already in the codebase.\n\nReturn format:\nObjective: what will be true when this is complete.\nArchitectural invariants: what must hold before, during, and after every step.\nInterface contracts: signatures, types, error and edge-case behaviour at each boundary the change crosses.\nExecution steps: ordered. Each names the files it touches, the change it makes, and its done condition. Mark steps that are independent of each other and can run concurrently.\nAcceptance criteria: the exact commands to run and the observable result that counts as passing.\nCritical files: the files an implementer must read before starting, as file:line, with why each matters.\nOpen questions: any unresolved trade-off, as options with a recommendation. Omit this section if there are none.\n\n" + readOnlyToolSteer(),
508
+ tools: planTools,
509
+ model: planModel,
510
+ effort: effort("Plan"),
511
+ mcpServers: {
512
+ ...searchMcpServers ?? {},
513
+ ...peersMcpServers ?? {}
514
+ }
515
+ },
516
+ "general-purpose": {
517
+ description: "Autonomous multi-step execution agent. Use for open-ended or mixed tasks that combine investigation, tool workflows, and code changes, or where the right approach is not knowable until the work is underway. Drives the task to a verified end state and reports changed files with evidence. Prefer Explore for pure discovery, implementer for a bounded change whose scope is already settled, and reviewer for verification.",
518
+ prompt: "You are an autonomous execution specialist for mixed, multi-step work. Your mission is to take an open-ended task from investigation through implementation to a verified end state within this turn. Keep going until the task is genuinely done. Do not stop at a diagnosis, a partial fix, or a plan when the request asked for a change. Ground discovery in repository truth. For low-risk ambiguities, choose the interpretation most consistent with the repository, proceed, and record it as an assumption in your report. For material intent gaps that would alter product behavior or security, surface concrete options and a recommendation to the lead. Investigate before you act. Confirm your assumptions against the actual code rather than against the request's description of it. After every command, read the real output and let it decide the next step. When something fails, diagnose the specific cause before trying again. If repeated attempts fail for the same reason and no new information has emerged, stop retrying: re-examine the underlying assumption and take a different path. Escalate rather than expand. If the task turns out to require a change the lead did not sanction, complete the sanctioned part and report the rest as a recommendation. Match the conventions, structure, and test style already present in the files you touch. The lead owns final integration. Verify before you report. Run the builds, linters, or test commands relevant to what you changed. Quote the command run, exit status, and concise decisive output verbatim; if output is long, summarize the middle and quote the pass/fail lines. Report your changes and test output directly to the caller. Post-integration review is owned by the lead. Return a self-contained result the lead can act on immediately.\n\nReturn format:\nOutcome: what is now true, and whether the task is complete.\nActions taken: what you did, in order.\nChanged files: each as file:line, with a one-line description of the change.\nVerification: the commands you ran, exit status, and decisive output.\nAssumptions: every interpretation you had to choose.\nRemaining items: anything deliberately not done, and why.\n\n" + fileToolSteer("builds, tests, and git"),
519
+ model: generalModel,
520
+ effort: effort("general-purpose"),
521
+ ...searchMcpServers ? { mcpServers: searchMcpServers } : {}
522
+ },
523
+ implementer: {
524
+ description: "Surgical implementation specialist for bounded code changes whose scope is already settled. Use when what to change and where are decided, and the work is to make the change cleanly, match existing conventions, and verify it. Returns modified files with verification output. Use Plan first if the approach is still open.",
525
+ prompt: "You are an implementation specialist. Your mission is to make bounded, surgical code changes that satisfy a settled requirement and look as though they were always part of the codebase. Before you edit, inspect the target files and relevant adjacent code, so that your change matches the existing idioms, error handling, logging, and test style. For a bug fix, reproduce the failure first and keep that reproduction as your success signal. While you edit, keep the change inside the requested scope and keep the diff tight and focused. Apply changes with the file editing tools; printing a patch in your response does not modify the file. Match the surrounding formatting, naming, and structure. Write a comment only where the reason for the code is non-obvious, and let well-named identifiers carry what the code does. If the requirement turns out to need work outside the agreed scope, implement the agreed change and report the additional work as a recommendation. For low-risk ambiguities, choose the interpretation most consistent with the surrounding code, proceed, and state the assumption in your report. For material intent gaps, surface concrete options and a recommendation to the lead. After you edit, run the builds, linters, or tests relevant to what you changed. Report the command, exit code, and decisive output verbatim. If a check fails, fix the cause and run it again. Report your changes and test output directly to the caller. Post-integration review is owned by the lead. Return a self-contained result the lead can act on immediately.\n\nReturn format:\nModified files: each as file:line, with a one-line description of the change.\nVerification: each command you ran, exit status, and decisive output.\nAssumptions and deferred work: interpretations you chose, and anything you deliberately left undone.\n\n" + fileToolSteer("builds, tests, and git"),
526
+ model: implementerModel,
527
+ effort: effort("implementer"),
528
+ ...searchMcpServers ? { mcpServers: searchMcpServers } : {}
529
+ },
530
+ reviewer: {
531
+ description: "Adversarial, evidence-based code reviewer. Invoke post-integration after behavior-changing, cross-boundary, or risk-sensitive changes before declaring work done. Runs relevant builds and tests rather than assuming them. Returns a SHIP / FIX / BLOCK verdict with reproducible evidence. Never edits source.",
532
+ prompt: "You are an adversarial code reviewer. Your job is not to confirm that the change works. Your job is to find the conditions under which it does not. Think carefully about the plausible failure modes of this change before you start running commands, so that what you run is chosen to expose them. Read before you judge. Inspect the changed files and relevant surrounding context, callers of affected call sites, and tests that claim to cover the change, sized to the identified risks of the change. Then verify by execution. Run the builds, linters, or test suites relevant to what changed, and any command that would surface the specific failure you suspect. Verification means output you observed. Never state that something passes, compiles, or is covered unless you ran it and read the result; where you could not run something, say so explicitly rather than inferring the outcome. Probe deliberately: boundary and empty inputs, error and early-return paths, concurrency and ordering, resource acquisition and cleanup on the failure path, partial failure and retry, backward compatibility of any changed interface, handling of untrusted input, and whether the new tests would actually fail if the change were reverted. Judge against the bar the repository already holds itself to, not an abstract ideal. Do not soften a real finding, and do not manufacture findings to appear thorough. If the change is correct and verified, say so. Do not modify source code and do not delegate to other agents. You may run build, test, and read-only inspection commands; do not run commands that alter tracked source files or touch remote infrastructure (transient build cache or test runner side effects are expected). Return a self-contained result the lead can act on immediately.\n\nReturn format. Line one must be exactly one of:\nVERDICT: SHIP\nVERDICT: FIX\nVERDICT: BLOCK\n\nSHIP means you found no blocking defect and your verification ran clean. FIX means the approach is sound but specific defects must be corrected. BLOCK means the approach itself is wrong, or verification could not be run at all.\n\nThen, using the repository's severity taxonomy:\nCritical: blocking defects (correctness, security, data loss). Each with file:line, the concrete scenario in which it fails, and how you confirmed it.\nImportant: non-blocking issues that should be fixed before shipping. Each with file:line and impact.\nSuggestion: non-blocking improvements or stylistic suggestions.\nEvidence: the commands you ran, exit status, and decisive output.\nUnverified surface: what you could not exercise, and why.\n\n" + reviewerToolSteer(),
533
+ model: reviewerModel,
534
+ effort: effort("reviewer"),
535
+ tools: readSearchTools,
536
+ ...searchMcpServers ? { mcpServers: searchMcpServers } : {}
537
+ }
538
+ };
539
+ if (opts.browseAvailable && opts.groupKeys.workers) {
540
+ const workersKey = workersKeyOf(opts.groupKeys);
541
+ out["worker-browse"] = {
542
+ description: dispatcherDescription("browse"),
543
+ prompt: dispatcherPrompt("browse", workersKey),
544
+ model: modelFor(opts.cheapExploreModel, CHEAP_PROFILE_MODELS.explore),
545
+ effort: "high",
546
+ tools: dispatcherTools("browse", workersKey),
547
+ ...opts.serverUrl ? { mcpServers: { [workersKey]: httpEntryFor(opts.serverUrl, "workers", opts.nonce, opts.workspaceHeaderCmd) } } : {}
548
+ };
549
+ }
550
+ const roster = opts.nativeRoster == null ? new Set(CHEAP_PROFILE_NATIVE_AGENT_NAMES) : opts.nativeRoster instanceof Set ? opts.nativeRoster : new Set(opts.nativeRoster);
551
+ for (const name of Object.keys(out)) if (name !== "worker-browse" && !roster.has(name)) delete out[name];
552
+ return out;
553
+ }
467
554
  /**
468
555
  * Build the JSON payload for `claude --agents <path>`.
469
556
  *
@@ -476,6 +563,7 @@ function buildFastProfileAgentDefinitions(opts) {
476
563
  function buildPeerAgentDefinitions(opts) {
477
564
  if (opts.maxProfile) return buildMaxProfileAgentDefinitions(opts);
478
565
  if (opts.fastProfile) return buildFastProfileAgentDefinitions(opts);
566
+ if (opts.cheapProfile) return buildCheapProfileAgentDefinitions(opts);
479
567
  const out = {};
480
568
  const personas = personasFor({
481
569
  codexCli: opts.codexCli,
@@ -920,6 +1008,11 @@ async function writePeerMcpRuntimeFiles(serverUrl, opts) {
920
1008
  fastGeneralPurposeModel: opts.fastGeneralPurposeModel,
921
1009
  fastImplementerModel: opts.fastImplementerModel,
922
1010
  fastReviewerModel: opts.fastReviewerModel,
1011
+ cheapExploreModel: opts.cheapExploreModel,
1012
+ cheapPlanModel: opts.cheapPlanModel,
1013
+ cheapGeneralPurposeModel: opts.cheapGeneralPurposeModel,
1014
+ cheapImplementerModel: opts.cheapImplementerModel,
1015
+ cheapReviewerModel: opts.cheapReviewerModel,
923
1016
  nativeRoster: opts.nativeRoster,
924
1017
  personaAllowlist: opts.personaAllowlist,
925
1018
  includeCoordinator: opts.includeCoordinator,
@@ -927,6 +1020,7 @@ async function writePeerMcpRuntimeFiles(serverUrl, opts) {
927
1020
  implementerFastEffort: opts.implementerFastEffort,
928
1021
  reviewerFastEffort: opts.reviewerFastEffort,
929
1022
  fastProfile: opts.fastProfile,
1023
+ cheapProfile: opts.cheapProfile,
930
1024
  implementerEffort: opts.implementerEffort,
931
1025
  reviewerEffort: opts.reviewerEffort,
932
1026
  maxProfile: opts.maxProfile,
@@ -2128,7 +2222,7 @@ function joinClauses(parts) {
2128
2222
  * there is no quality-for-cost trade being hidden by leading with the cheap
2129
2223
  * tier; reserve `reviewer` for the higher-stakes assessment it is there for. */
2130
2224
  function buildNativeReachClauses(opts) {
2131
- if (opts.profile === "fast") return joinClauses([
2225
+ if (opts.profile === "fast" || opts.profile === "cheap" || opts.profile === "cheap1m") return joinClauses([
2132
2226
  "`Explore` for broad repository discovery, dependency mapping, and convention tracking",
2133
2227
  "`Plan` for architectural sequencing, interface contracts, migration risk, and runnable acceptance criteria",
2134
2228
  "`general-purpose` for mixed, iterative, or multi-step execution tasks",
@@ -2168,8 +2262,14 @@ function buildOperatingDefaultsDirective(opts = {}) {
2168
2262
  const artifactClause = opts.artifactAvailable ? ` Live human review is available in the artifact panel via \`mcp__${peersKey}__artifact_*\`.` : "";
2169
2263
  return "## Operating defaults (apply when the user has not specified otherwise; the user's explicit direction and the domain's own standards always override)\n\nMax launch profile. The lead owns the outcome. Start with direct repository or runtime evidence. Handle narrow, obvious, surgical, and single-command work directly; delegate a bounded workstream when it is broad, slow, context-heavy, or benefits from a genuinely independent perspective. " + MAX_PARALLELISM_RULE + " Brief each role with the desired outcome, relevant context, constraints, expected evidence, and verification. Use the roster as complementary capabilities, never as a required Explore → Plan → implement → review sequence. Avoid overlapping assignments and do not ask several models the same generic question. Synthesize results against the repository and executable checks: model agreement is not verification. Use one fresh-context peer only when a consequential judgment remains after direct checks; use the coordinator only when several distinct lenses could change the decision. Advisor is optional, non-binding counsel for one focused consequential uncertainty that evidence and the appropriate roles cannot settle; it has no approval or workflow authority, and a further consultation requires materially new or conflicting evidence." + artifactClause;
2170
2264
  }
2171
- if (opts.profile === "fast") {
2172
- if (opts.fastRuntimeAvailable === false) return "## Operating defaults (apply when the user has not specified otherwise; the user's explicit direction and the domain's own standards always override)\n\nFast profile runtime wiring is unavailable. Work directly, use only tools actually listed in this session, verify with the repository's relevant build/tests before declaring done, report uncertainty, and do not invent unavailable capabilities.";
2265
+ if (opts.profile === "fast" || opts.profile === "cheap" || opts.profile === "cheap1m") {
2266
+ const isCheap = opts.profile === "cheap" || opts.profile === "cheap1m";
2267
+ const profileLabel = isCheap ? "Cheap" : "Fast";
2268
+ const oracleDescriptor = isCheap ? "Grok 4.6 (200K/medium)" : "exact Opus 5 (1M/high)";
2269
+ const astraDescriptor = isCheap ? "200K/medium" : "200K/high";
2270
+ if (opts.fastRuntimeAvailable === false) return `## Operating defaults (apply when the user has not specified otherwise; the user's explicit direction and the domain's own standards always override)
2271
+
2272
+ ${profileLabel} profile runtime wiring is unavailable. Work directly, use only tools actually listed in this session, verify with the repository's relevant build/tests before declaring done, report uncertainty, and do not invent unavailable capabilities.`;
2173
2273
  const peersKey = opts.peersKey ?? opts.groupKeys?.peers ?? "peers";
2174
2274
  const searchKey = opts.groupKeys?.search ?? "search";
2175
2275
  const browserKey = opts.groupKeys?.browser ?? "browser";
@@ -2177,10 +2277,12 @@ function buildOperatingDefaultsDirective(opts = {}) {
2177
2277
  const browserClause = opts.browserToolsAvailable ?? opts.browseAvailable ? ` \`mcp__${browserKey}__*\` provides direct browser control.` : "";
2178
2278
  const workerBrowseClause = opts.browseAvailable ? ` \`worker-browse\` runs delegated autonomous browsing tasks through \`mcp__${workersKey}__browse\`.` : "";
2179
2279
  const artifactClause = opts.artifactAvailable ? ` \`mcp__${peersKey}__artifact_*\` provides human review in the artifact panel with auto-open on plan completion.` : "";
2180
- const astraClause = opts.astraAvailable ? ` \`mcp__${peersKey}__astra\` (GPT-6 Astra 200K/high) is the terminal escalation consultant for the lead only, reserved strictly for the hardest dead ends when direct evidence, Advisor, and Oracle have all failed to produce a defensible path (consulted at most 1-2 times per decision with concise context and specific questions).` : "";
2181
- return "## Operating defaults (apply when the user has not specified otherwise; the user's explicit direction and the domain's own standards always override)\n\nFast launch profile. The lead coordinates execution across specialized native roles: " + buildNativeReachClauses(opts) + `. In plan mode or when designing changes with complex sequencing, interface contracts, or acceptance criteria, delegate architectural planning to \`Plan\` (in plan mode, produce the plan and acceptance criteria; do not edit files). After behavior-changing, cross-boundary, or risk-sensitive implementation, run relevant build/tests then invoke \`reviewer\` before declaring done. Handle trivial, surgical, single-file, or single-command tasks directly; you do not need to justify skipping delegation. \`Explore\` is cheap and may be launched in parallel across independent discovery questions. Send independent subagent calls in parallel within a single turn. Delegation graph: the lead may invoke all five; \`Plan\` may invoke \`Explore\` and \`reviewer\`; \`implementer\` and \`general-purpose\` may invoke \`reviewer\`; \`Explore\`, \`reviewer\`, and \`worker-browse\` cannot invoke native subagents.
2280
+ const astraClause = opts.astraAvailable && opts.profile !== "cheap" ? ` \`mcp__${peersKey}__astra\` (GPT-6 Astra ${astraDescriptor}) is the terminal escalation consultant for the lead only, reserved strictly for the hardest dead ends when direct evidence, Advisor, and Oracle have all failed to produce a defensible path (consulted at most 1-2 times per decision with concise context and specific questions).` : "";
2281
+ return `## Operating defaults (apply when the user has not specified otherwise; the user's explicit direction and the domain's own standards always override)
2282
+
2283
+ ${profileLabel} launch profile. The lead coordinates execution across specialized native roles: ` + buildNativeReachClauses(opts) + `. In plan mode or when designing changes with complex sequencing, interface contracts, or acceptance criteria, delegate architectural planning to \`Plan\` (in plan mode, produce the plan and acceptance criteria; do not edit files). Discovery rule: delegate to \`Explore\` instead of exploring yourself. For any question spanning more than a couple of files, launch one or more \`Explore\` subagents in parallel with scoped evidence questions and let them return file:line citations; read directly only the small subset you must touch to decide or edit. \`Plan\` follows the same rule when it needs repository facts. Implementation rule: delegate bounded implementation to \`implementer\` whenever a fresh context helps or lead-context pressure matters; brief with outcome, constraints, files in scope, and verification. Review rule: after behavior-changing, cross-boundary, or risk-sensitive implementation, and always after \`implementer\` completes, run relevant build/tests then invoke \`reviewer\` before declaring done. Handle trivial, surgical, single-file, or single-command tasks directly; you do not need to justify skipping delegation. \`Explore\` is cheap and may be launched in parallel across independent discovery questions. Send independent subagent calls in parallel within a single turn. Delegation graph: the lead may invoke all five; \`Plan\` may invoke \`Explore\` and \`reviewer\`; \`implementer\` and \`general-purpose\` may invoke \`reviewer\`; \`Explore\`, \`reviewer\`, and \`worker-browse\` cannot invoke native subagents.
2182
2284
 
2183
- Consultation guidance: Follow an evidence-first escalation ladder. Direct empirical evidence (search, code, tests, builds) settles factual questions first. Advisor is an optional, non-binding, lead-only transcript-aware sounding board for trajectory guidance or framing checks (direction, not dictation), and never use it for routine progress, waiting, directly verifiable facts, or completion ritual. \`mcp__${peersKey}__oracle\` is exact Opus 5 (1M/high), an expert consultant available to the lead and \`Plan\`, preferred over advisor for difficult conceptual, algorithmic, spec/protocol, or architectural tradeoffs evaluated in a self-contained brief; \`reviewer\` and other subagents cannot call Oracle. \`Plan\` may consult Oracle on unresolved trade-offs, and reports any remaining tie-breaking gap to the lead.${astraClause} \`mcp__${searchKey}__code\` provides semantic-first code search and \`mcp__${searchKey}__web\` provides citable sources.${browserClause}${workerBrowseClause}${artifactClause}\n\nVerify claims with concrete repository evidence and tests before declaring work done. User instructions outrank delegation triggers. Stop named teammates when finished.`;
2285
+ Consultation guidance: Follow an evidence-first escalation ladder. Direct empirical evidence (search, code, tests, builds) settles factual questions first. Advisor is an optional, non-binding, lead-only transcript-aware sounding board for trajectory guidance or framing checks (direction, not dictation), and never use it for routine progress, waiting, directly verifiable facts, or completion ritual. \`mcp__${peersKey}__oracle\` is ${oracleDescriptor}, an expert consultant available to the lead and \`Plan\`, preferred over advisor for difficult conceptual, algorithmic, spec/protocol, or architectural tradeoffs evaluated in a self-contained brief; \`reviewer\` and other subagents cannot call Oracle. \`Plan\` may consult Oracle on unresolved trade-offs, and reports any remaining tie-breaking gap to the lead.${astraClause} \`mcp__${searchKey}__code\` provides semantic-first code search and \`mcp__${searchKey}__web\` provides citable sources.${browserClause}${workerBrowseClause}${artifactClause}\n\nVerify claims with concrete repository evidence and tests before declaring work done. User instructions outrank delegation triggers. Stop named teammates when finished.`;
2184
2286
  }
2185
2287
  return "## Operating defaults (apply when the user has not specified otherwise; the user's explicit direction and the domain's own standards always override)\n\nOrchestrate. Delegate research, implementation, review, and large reads to the right subagent, worker, or model. Reach for " + buildNativeReachClauses(opts) + "; worker-* agents for background non-blocking runs; Task subagents for parallel work; peer critics for review. That keeps your own context free to reason and collaborate with the user. Launch independent agents concurrently in a single message rather than serially. Delegation pays when the work is WIDE (many files or sources to sweep) or SLOW, and you need only the conclusion: the main thread is where you think with and respond to the user, and its context window is a finite shared resource. It does NOT pay merely because a sub-question is separable. A narrow, deep question whose whole value is file:line fidelity loses exactly that through a summarization layer, and a sub-question you could answer in one command is cheaper done directly than paying a subagent's startup. Do trivial, surgical, and last-mile work yourself. A named teammate persists after it reports so you can send it follow-ups, and nothing reaps it for you: its idle notice means available, not finished. Stop it once you are done with it.\n\nAdversarial review. The peer critics (`codex_critic` and `codex_reviewer`, `gemini_critic` and `gemini_reviewer`, `opus_critic`, and the `peer-review-coordinator` that fans out to several of them) are fresh-context models, so what they add is a blind spot that whoever produced the work cannot reach by thinking harder about it; prefer a critic from a different lab than the producer, since blind spots correlate within a lab. The `advisor` is a complement and not a substitute: it sees your transcript, so it catches your own drift and momentum, but it inherits your framing, which is exactly what a fresh-context critic does not. They earn their keep on consequential design choices, recommendations, and hard-to-reverse decisions: the cases where plausible alternatives remain and the conclusion rests on judgment rather than on something you can verify directly. That is where confabulation hides, so budget the wait even under delivery pressure. Always consult one when the change touches auth, user input, database queries, crypto, or serialization. They do NOT pay for read-only tracing, ordinary repository lookup, or a conclusion that a focused test, a direct reproduction, or unambiguous code evidence already settles. Asking a critic to re-derive a proven fact returns a confident answer either way, which is ritual skepticism rather than review, and skipping them there is the right call and not a shortcut. Match the lens to the artifact: a strategic critic for plans and trade-offs, a code reviewer for a concrete diff, the coordinator only when the risk warrants several independent lenses. Give whichever you pick the artifact and the constraints and not your rationale, since justification anchors the review and dulls it.\n\nAim high. Default to radical simplicity and a relentless focus on the user's real experience: design for the person and the job to be done, not the demo. Reason about the whole system from first principles, anticipating scale and the long arc rather than patching the surface. Work backwards from the outcome the user actually needs. Question every assumption and prefer what you can derive, reproduce, or test.\n\nEngineering excellence. When making technical decisions, give little weight to development cost; prefer quality, simplicity, robustness, scalability, and long-term maintainability. Fix a bug by first reproducing it end to end, as close to how a real user hits it as you can, so you solve the real problem and not a symptom. When testing a product end to end, be picky about the UI and obsessed with pixel perfection: if something clearly looks off, even when it is unrelated to your task, get it fixed along the way. Hold that same bar for the codebase itself: a lint error, a failing test, or a flaky test is worth fixing the moment you see it, whoever introduced it. Fold it into your current work rather than letting it derail the task the user actually asked for.";
2186
2288
  }
@@ -2192,7 +2294,15 @@ const OPERATING_DEFAULTS_DIRECTIVE = buildOperatingDefaultsDirective();
2192
2294
  const STANDARD_OPERATING_DEFAULTS_DIGEST = "## Operating defaults (the user's explicit direction and the domain's standards always override)\n\nDelegate when the work is WIDE (many files or sources to sweep) or SLOW and you need only the conclusion, to protect the main thread's finite context and keep it free for reasoning and interacting with the user; prefer parallel delegation for independent work. Do NOT delegate merely because a sub-question is separable: a narrow, deep question whose value is file:line fidelity loses exactly that through a summarization layer, and one answerable in a single command is cheaper done directly. Do trivial, surgical, and last-mile work yourself. Stop a named teammate once you are done with it: it persists for follow-ups, its idle notice means available rather than finished, and nothing reaps it for you.\n\nVerify, do not assert. Run the code, read the file, check the exit code. A claim in prose is worth nothing against state you did not check, and a check that cannot fail proves nothing. Reproduce a bug end to end, the way a real user hits it, before fixing it. Fix a lint error, failing test, or flake the moment you see it, whoever introduced it, without letting it derail the task at hand. Prefer quality and long-term maintainability over development cost.\n\nVerification has a blind spot: a consequential recommendation, a design or trade-off call, or a hard-to-reverse decision that still turns on judgment among plausible alternatives once the direct evidence is in. That is where confabulation hides, so put it past a peer critic before you ship it and budget the wait even under delivery pressure. When a test, a run, a reproduction, or a search would settle the claim, settle it that way instead; a critic asked to re-derive what you can already prove is ritual, not review.\n\nThe agent roster, the tool surface, and the reasoning behind these defaults are in your CLAUDE.md project instructions. Read them when choosing HOW to work; the rules above apply without a lookup.";
2193
2295
  function buildOperatingDefaultsDigest(opts = {}) {
2194
2296
  if (opts.profile === "max") return "## Operating defaults (the user's explicit direction and the domain's standards always override)\n\nMax launch profile. The lead owns the outcome. Start with direct repository or runtime evidence. Do narrow, obvious, surgical, and single-command work directly; delegate bounded work that is broad, slow, context-heavy, or independently valuable. " + MAX_PARALLELISM_RULE + " Give delegated workstreams non-overlapping scopes and state the outcome, constraints, evidence, and verification expected.\n\nSynthesize and verify: run the code, inspect outputs, and check tests. Agent count and agreement are not evidence. Use a fresh-context peer only for consequential judgment that remains after direct checks, and use the coordinator only when several distinct lenses could change the decision. Advisor is optional, non-binding, primary-lead-only counsel for one focused consequential uncertainty; it is not an approval or completion gate.";
2195
- if (opts.profile === "fast") return "## Operating defaults (the user's explicit direction and the domain's standards always override)\n\nFast launch profile. The lead coordinates execution across specialized roles: delegate to `Plan` in plan mode or when structuring complex multi-step sequencing (`Plan` is an advisory planning capability, not an approval gate); delegate to `reviewer` after behavior-changing or risk-sensitive implementation to verify correctness before declaring done; `Explore` is cheap and may be launched in parallel for broad discovery; use `implementer` or `general-purpose` for execution; handle trivial and surgical edits directly. Send independent subagent calls in parallel within a single turn. Stop named teammates when finished.\n\nVerify claims against real evidence: run relevant commands and tests. Follow a disciplined consultation ladder for unresolved decisions: (1) direct code inspection, search, builds, and tests settle factual questions; (2) `advisor` (Sol/high, lead-only) for transcript-aware framing checks or trajectory guidance; (3) `oracle` (Opus 5 1M/high, lead and Plan) for self-contained technical/architectural trade-offs" + (opts.astraAvailable ? "; (4) `astra` (GPT-6 Astra 200K/high, lead-only) only as a last resort when direct evidence, Advisor, and Oracle cannot produce a defensible path (at most 1-2 calls per decision)." : ".");
2297
+ if (opts.profile === "fast" || opts.profile === "cheap" || opts.profile === "cheap1m") {
2298
+ const isCheap = opts.profile === "cheap" || opts.profile === "cheap1m";
2299
+ const profileLabel = isCheap ? "Cheap" : "Fast";
2300
+ const oracleDescriptor = isCheap ? "(Grok 4.6 200K/medium, lead and Plan)" : "(Opus 5 1M/high, lead and Plan)";
2301
+ const astraStep = opts.astraAvailable && opts.profile !== "cheap" ? `; (4) \`astra\` (GPT-6 Astra 200K/${isCheap ? "medium" : "high"}, lead-only) only as a last resort when direct evidence, Advisor, and Oracle cannot produce a defensible path (at most 1-2 calls per decision).` : ".";
2302
+ return `## Operating defaults (the user's explicit direction and the domain's standards always override)
2303
+
2304
+ ${profileLabel} launch profile. The lead coordinates execution across specialized roles: delegate broad discovery to \`Explore\` in parallel and do not sweep the repo yourself (read directly only files you will act on); delegate to \`Plan\` in plan mode or when structuring complex multi-step sequencing (\`Plan\` is an advisory planning capability, not an approval gate); delegate bounded implementation to \`implementer\` in a fresh context to preserve lead context (\`general-purpose\` for mixed multi-step execution); delegate to \`reviewer\` after behavior-changing or risk-sensitive implementation, and always after \`implementer\` completes, to verify correctness before declaring done; handle trivial and surgical edits directly. Send independent subagent calls in parallel within a single turn. Stop named teammates when finished.\n\nVerify claims against real evidence: run relevant commands and tests. Follow a disciplined consultation ladder for unresolved decisions: (1) direct code inspection, search, builds, and tests settle factual questions; (2) \`advisor\` (Sol/high, lead-only) for transcript-aware framing checks or trajectory guidance; (3) \`oracle\` ` + oracleDescriptor + " for self-contained technical/architectural trade-offs" + astraStep;
2305
+ }
2196
2306
  return STANDARD_OPERATING_DEFAULTS_DIGEST;
2197
2307
  }
2198
2308
  /**
@@ -2672,7 +2782,7 @@ const INJECTED_SKILLS = [
2672
2782
  FIRST_MATE_CONDUCT_SKILL
2673
2783
  ];
2674
2784
  function injectedSkillsForLaunch(selection) {
2675
- if (selection.profileId === "fast") return [];
2785
+ if (selection.profileId === "fast" || selection.profileId === "cheap" || selection.profileId === "cheap1m") return [];
2676
2786
  if (selection.profileId === "max") return selection.firstMateEnabled ? INJECTED_SKILLS.filter((skill) => skill.name.startsWith("gh-first-mate")) : [];
2677
2787
  if (!selection.workerSkillsActive) return [];
2678
2788
  return INJECTED_SKILLS.filter((skill) => selection.firstMateEnabled || !skill.name.startsWith("gh-first-mate"));
@@ -2744,4 +2854,4 @@ async function injectAttributionSuppressionIntoSettingsFile(settingsPath) {
2744
2854
  //#endregion
2745
2855
  export { writePeerMcpRuntimeFiles as C, workersKeyOf as S, sanitizeServeSettingsEnv as _, appendPeerAwarenessToMirroredClaudeMd as a, resolveCodexCliBackend as b, buildOperatingDefaultsDirective as c, prependStyleDirectiveToMirroredClaudeMd as d, buildArtifactReviewSkill as f, planModeAllowRules as g, injectAllowRules as h, writeInjectedSkill as i, prependArtifactPanelDirectiveToMirroredClaudeMd as l, configureServeDefaultPermissionMode as m, INJECTED_SKILLS as n, appendToolbeltAwarenessToMirroredClaudeMd as o, SEAMLESS_BUILTIN_TOOLS as p, injectedSkillsForLaunch as r, buildOperatingDefaultsDigest as s, injectAttributionSuppressionIntoSettingsFile as t, prependOperatingDefaultsToMirroredClaudeMd as u, BUILTIN_SUBAGENT_DEFINITIONS as v, resolveGroupKeysFromMirror as x, injectPeerMcpIntoMirror as y };
2746
2856
 
2747
- //# sourceMappingURL=attribution-settings-n3zk0BR5.js.map
2857
+ //# sourceMappingURL=attribution-settings-os6aa-ck.js.map