github-router 0.3.295 → 0.3.302
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.
- package/dist/{attribution-settings-pkIop1NU.js → attribution-settings-B1xutIts.js} +153 -16
- package/dist/attribution-settings-B1xutIts.js.map +1 -0
- package/dist/{auth-CluG5e-l.js → auth-CpjOjoUG.js} +4 -3
- package/dist/{auth-CluG5e-l.js.map → auth-CpjOjoUG.js.map} +1 -1
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/{check-usage-iOzfnKJe.js → check-usage-BsN3S4Fu.js} +4 -4
- package/dist/{check-usage-iOzfnKJe.js.map → check-usage-BsN3S4Fu.js.map} +1 -1
- package/dist/{claude-DNmxk-Rm.js → claude-uRuzEH0W.js} +216 -112
- package/dist/claude-uRuzEH0W.js.map +1 -0
- package/dist/{codex-Dl4gpHn-.js → codex-D5ag-liR.js} +6 -5
- package/dist/{codex-Dl4gpHn-.js.map → codex-D5ag-liR.js.map} +1 -1
- package/dist/{debug-DsEwleGg.js → debug-BXRPyeqO.js} +2 -2
- package/dist/{debug-DsEwleGg.js.map → debug-BXRPyeqO.js.map} +1 -1
- package/dist/engine-2uMJ4Isk.js +2 -0
- package/dist/fast-profile-contract-K3P58nj3.js +57 -0
- package/dist/fast-profile-contract-K3P58nj3.js.map +1 -0
- package/dist/{gate-discovery-WcduofL4.js → gate-discovery-BTRVyKWu.js} +5 -5
- package/dist/{gate-discovery-WcduofL4.js.map → gate-discovery-BTRVyKWu.js.map} +1 -1
- package/dist/{get-copilot-usage-B7Z4XVWj.js → get-copilot-usage-ByjQqhdi.js} +3 -2
- package/dist/{get-copilot-usage-B7Z4XVWj.js.map → get-copilot-usage-ByjQqhdi.js.map} +1 -1
- package/dist/hooks.mjs +351 -21
- package/dist/hooks.sha256 +1 -1
- package/dist/{internal-artifact-open-D6tKMg8v.js → internal-artifact-open-DRSxShAW.js} +2 -2
- package/dist/{internal-artifact-open-D6tKMg8v.js.map → internal-artifact-open-DRSxShAW.js.map} +1 -1
- package/dist/{internal-fast-dispatch-guard-CPlCrTlU.js → internal-fast-dispatch-guard-CYOWbxjX.js} +1 -1
- package/dist/{internal-fast-dispatch-guard-Xyu17k9X.js → internal-fast-dispatch-guard-D2HcfXZv.js} +22 -18
- package/dist/internal-fast-dispatch-guard-D2HcfXZv.js.map +1 -0
- package/dist/{internal-first-mate-guard-C9BV7J4U.js → internal-first-mate-guard-Bcb5JwiO.js} +3 -3
- package/dist/{internal-first-mate-guard-C9BV7J4U.js.map → internal-first-mate-guard-Bcb5JwiO.js.map} +1 -1
- package/dist/{internal-first-mate-guard-WJApyc8j.js → internal-first-mate-guard-Brh_uois.js} +1 -1
- package/dist/internal-max-dispatch-guard-Bcjavapx.js +2 -0
- package/dist/internal-max-dispatch-guard-BjSVXMvC.js +198 -0
- package/dist/internal-max-dispatch-guard-BjSVXMvC.js.map +1 -0
- package/dist/{internal-plan-review-t3PuNfuL.js → internal-plan-review-DVY-iV2x.js} +3 -3
- package/dist/{internal-plan-review-t3PuNfuL.js.map → internal-plan-review-DVY-iV2x.js.map} +1 -1
- package/dist/{internal-prompt-submit-C3KovHQG.js → internal-prompt-submit-BTqRn4FW.js} +4 -4
- package/dist/{internal-prompt-submit-C3KovHQG.js.map → internal-prompt-submit-BTqRn4FW.js.map} +1 -1
- package/dist/{internal-session-bind-d2uoja8I.js → internal-session-bind-YfH656lt.js} +2 -2
- package/dist/{internal-session-bind-d2uoja8I.js.map → internal-session-bind-YfH656lt.js.map} +1 -1
- package/dist/{internal-stop-hook-DJFtGCsE.js → internal-stop-hook-BZg__ab6.js} +5 -5
- package/dist/{internal-stop-hook-DJFtGCsE.js.map → internal-stop-hook-BZg__ab6.js.map} +1 -1
- package/dist/{internal-stop-review-YtDUGXpX.js → internal-stop-review-B8MmEyQ1.js} +2 -2
- package/dist/{internal-stop-review-YtDUGXpX.js.map → internal-stop-review-B8MmEyQ1.js.map} +1 -1
- package/dist/{internal-worker-guard-CdkeS9PN.js → internal-worker-guard-Dr6W83TC.js} +2 -2
- package/dist/{internal-worker-guard-CdkeS9PN.js.map → internal-worker-guard-Dr6W83TC.js.map} +1 -1
- package/dist/{internal-workspace-header-tuBXJV22.js → internal-workspace-header-Cep0WSIb.js} +2 -2
- package/dist/{internal-workspace-header-tuBXJV22.js.map → internal-workspace-header-Cep0WSIb.js.map} +1 -1
- package/dist/lifecycle-4TZrJuAa.js +2 -0
- package/dist/{lifecycle-CM9eTzvk.js → lifecycle-CmPJ6e_6.js} +2 -2
- package/dist/{lifecycle-CM9eTzvk.js.map → lifecycle-CmPJ6e_6.js.map} +1 -1
- package/dist/{lifecycle-Bg6doY3-.js → lifecycle-DgsJ_8Am.js} +2 -2
- package/dist/{lifecycle-Bg6doY3-.js.map → lifecycle-DgsJ_8Am.js.map} +1 -1
- package/dist/lifecycle-O91Vzzb-.js +2 -0
- package/dist/main.js +19 -18
- package/dist/main.js.map +1 -1
- package/dist/max-profile-contract-BTXowh6k.js +264 -0
- package/dist/max-profile-contract-BTXowh6k.js.map +1 -0
- package/dist/{mcp-workspace-header-dERl2YTT.js → mcp-workspace-header-NzFD0Wgd.js} +2 -2
- package/dist/{mcp-workspace-header-dERl2YTT.js.map → mcp-workspace-header-NzFD0Wgd.js.map} +1 -1
- package/dist/{models-DZ4hYsR7.js → models-1KwEUgzd.js} +3 -3
- package/dist/{models-DZ4hYsR7.js.map → models-1KwEUgzd.js.map} +1 -1
- package/dist/{orchestration-BiGCEwbH.js → orchestration-CYyp9w-t.js} +2 -2
- package/dist/{orchestration-BiGCEwbH.js.map → orchestration-CYyp9w-t.js.map} +1 -1
- package/dist/paths-DDAiPVto.js +2 -0
- package/dist/{paths-Ci485qSJ.js → paths-IcZW8gZx.js} +4 -4
- package/dist/{paths-Ci485qSJ.js.map → paths-IcZW8gZx.js.map} +1 -1
- package/dist/{peer-mcp-personas-BwNtC8jt.js → peer-mcp-personas-DwEiYeJS.js} +498 -260
- package/dist/peer-mcp-personas-DwEiYeJS.js.map +1 -0
- package/dist/{plan-review-hook-DuW0pSoM.js → plan-review-hook-szSNt6uU.js} +3 -3
- package/dist/{plan-review-hook-DuW0pSoM.js.map → plan-review-hook-szSNt6uU.js.map} +1 -1
- package/dist/{prompt-submit-hook-IMl7ssfr.js → prompt-submit-hook-ZUxo_jEl.js} +3 -3
- package/dist/{prompt-submit-hook-IMl7ssfr.js.map → prompt-submit-hook-ZUxo_jEl.js.map} +1 -1
- package/dist/{provision-DeNqzvSM.js → provision-BLT1pCFy.js} +4 -4
- package/dist/{provision-DeNqzvSM.js.map → provision-BLT1pCFy.js.map} +1 -1
- package/dist/{self-invocation-DAB_od0C.js → self-invocation-BJWbA8ka.js} +2 -2
- package/dist/{self-invocation-DAB_od0C.js.map → self-invocation-BJWbA8ka.js.map} +1 -1
- package/dist/{serve-BS5EmCpM.js → serve-wEZoOijw.js} +13 -12
- package/dist/{serve-BS5EmCpM.js.map → serve-wEZoOijw.js.map} +1 -1
- package/dist/{server-setup-DsGJnJ_O.js → server-setup-Zn5wkosb.js} +268 -41
- package/dist/server-setup-Zn5wkosb.js.map +1 -0
- package/dist/{start-vJdt2MiM.js → start-DSqU8d8h.js} +3 -3
- package/dist/{start-vJdt2MiM.js.map → start-DSqU8d8h.js.map} +1 -1
- package/dist/state-B8adscCv.js +51 -0
- package/dist/state-B8adscCv.js.map +1 -0
- package/dist/{stop-gate-hook-DQnh_KfI.js → stop-gate-hook-CJOk28zd.js} +3 -3
- package/dist/{stop-gate-hook-DQnh_KfI.js.map → stop-gate-hook-CJOk28zd.js.map} +1 -1
- package/dist/{stop-gate-policy-DMr3KVmw.js → stop-gate-policy-zhzRIj6G.js} +2 -2
- package/dist/{stop-gate-policy-DMr3KVmw.js.map → stop-gate-policy-zhzRIj6G.js.map} +1 -1
- package/dist/{token-BtJhjXXu.js → token-CbuFyx-B.js} +4 -50
- package/dist/token-CbuFyx-B.js.map +1 -0
- package/dist/{worker-dispatch-BEHkTbnH.js → worker-dispatch-DgP5yT26.js} +2 -2
- package/dist/{worker-dispatch-BEHkTbnH.js.map → worker-dispatch-DgP5yT26.js.map} +1 -1
- package/package.json +1 -1
- package/dist/attribution-settings-pkIop1NU.js.map +0 -1
- package/dist/claude-DNmxk-Rm.js.map +0 -1
- package/dist/engine-XnluJUs6.js +0 -2
- package/dist/internal-fast-dispatch-guard-Xyu17k9X.js.map +0 -1
- package/dist/lifecycle-CGLt1cJQ.js +0 -2
- package/dist/lifecycle-DoUwpVDB.js +0 -2
- package/dist/paths-GD7bgGGy.js +0 -2
- package/dist/peer-mcp-personas-BwNtC8jt.js.map +0 -1
- package/dist/server-setup-DsGJnJ_O.js.map +0 -1
- package/dist/token-BtJhjXXu.js.map +0 -1
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { It as
|
|
2
|
-
import { a as isUnderClaudeConfigMirror, d as writeRuntimeFileSecure, t as PATHS } from "./paths-
|
|
3
|
-
import "./
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import { a as
|
|
1
|
+
import { Gn as oneMContextDisabled, It as LUNA_IMPLEMENTER_ALIAS_ID, Kn as withOneMSuffix, Nt as FAST_CRITIC_ALIAS_ID, Rt as LUNA_SCOUT_ALIAS_ID, Tn as DEFINITION_OF_GREATNESS, a as buildAgentPrompt, l as maxPersonasFor, n as MCP_GROUPS, t as GROUP_META, u as personasFor, wn as CONDENSED_OPERATING_SEQUENCE } from "./peer-mcp-personas-DwEiYeJS.js";
|
|
2
|
+
import { a as isUnderClaudeConfigMirror, d as writeRuntimeFileSecure, t as PATHS } from "./paths-IcZW8gZx.js";
|
|
3
|
+
import { o as FAST_PROFILE_NATIVE_AGENT_NAMES } from "./fast-profile-contract-K3P58nj3.js";
|
|
4
|
+
import "./self-invocation-BJWbA8ka.js";
|
|
5
|
+
import { a as MAX_PROFILE_NATIVE_AGENT_NAMES, i as MAX_PROFILE_MODELS, o as MAX_PROFILE_NATIVE_EFFORTS, s as MAX_PROFILE_NATIVE_MODELS } from "./max-profile-contract-BTXowh6k.js";
|
|
6
|
+
import { a as STRIPPED_AUTH_ROUTING_ENV_KEYS, n as buildCodexProviderConfigFlags } from "./provision-BLT1pCFy.js";
|
|
7
|
+
import { n as buildWorkspaceHeaderHelperCommand } from "./mcp-workspace-header-NzFD0Wgd.js";
|
|
8
|
+
import { a as dispatcherAgentName, c as dispatcherTools, n as activeDispatchModes, o as dispatcherDescription, s as dispatcherPrompt } from "./worker-dispatch-DgP5yT26.js";
|
|
7
9
|
import consola from "consola";
|
|
8
10
|
import path from "node:path";
|
|
9
11
|
import { randomBytes } from "node:crypto";
|
|
@@ -224,7 +226,7 @@ function readOnlyToolSteer() {
|
|
|
224
226
|
return "Use Read to read files and Grep/Glob plus the semantic code search tool to find them; Bash is for read-only inspection such as git log, git blame, and git show. Do not modify any file, and do not run mutating commands.";
|
|
225
227
|
}
|
|
226
228
|
/**
|
|
227
|
-
* `tools:` allowlist for
|
|
229
|
+
* `tools:` allowlist for read-only natives (`scout`, fast `Explore`, `brainstorm`), modelled
|
|
228
230
|
* on Claude Code's own `Explore`/`Plan` built-ins, which run with every tool
|
|
229
231
|
* EXCEPT Agent / Artifact / ExitPlanMode / Edit / Write / NotebookEdit — note
|
|
230
232
|
* that Anthropic's own read-only agent keeps Bash, which is what makes `git log`
|
|
@@ -271,6 +273,109 @@ function decorateGuaranteedOneM(id) {
|
|
|
271
273
|
if (oneMContextDisabled() || /\[1m\]$/i.test(id)) return id;
|
|
272
274
|
return `${id}[1m]`;
|
|
273
275
|
}
|
|
276
|
+
/** Build the literal `-m max` native roster. Max shadows the client built-ins
|
|
277
|
+
* and every emitted role carries an explicit model and effort. */
|
|
278
|
+
function buildMaxProfileAgentDefinitions(opts) {
|
|
279
|
+
const modelFor = (value, fallback) => nonEmptyModel(value) ?? fallback;
|
|
280
|
+
const exploreModel = modelFor(opts.maxExploreModel, MAX_PROFILE_NATIVE_MODELS.Explore);
|
|
281
|
+
const planModel = modelFor(opts.maxPlanModel, MAX_PROFILE_NATIVE_MODELS.Plan);
|
|
282
|
+
const generalModel = modelFor(opts.maxGeneralPurposeModel, MAX_PROFILE_NATIVE_MODELS["general-purpose"]);
|
|
283
|
+
const implementerModel = modelFor(opts.maxImplementerModel, MAX_PROFILE_NATIVE_MODELS.implementer);
|
|
284
|
+
const reviewerModel = modelFor(opts.maxReviewerModel, modelFor(opts.maxGeminiModel, modelFor(opts.maxGrokModel, MAX_PROFILE_NATIVE_MODELS.reviewer)));
|
|
285
|
+
const brainstormModel = modelFor(opts.maxBrainstormModel, modelFor(opts.maxGrokModel, modelFor(opts.maxGeminiModel, MAX_PROFILE_NATIVE_MODELS.brainstorm)));
|
|
286
|
+
const peersKey = peersKeyOf(opts.groupKeys);
|
|
287
|
+
const searchKey = opts.groupKeys.search ?? GROUP_META.search.preferredKey;
|
|
288
|
+
const searchMcpServers = opts.serverUrl ? { [searchKey]: httpEntryFor(opts.serverUrl, "search", opts.nonce, opts.workspaceHeaderCmd) } : void 0;
|
|
289
|
+
const peersMcpServers = opts.serverUrl ? { [peersKey]: httpEntryFor(opts.serverUrl, "peers", opts.nonce, opts.workspaceHeaderCmd) } : void 0;
|
|
290
|
+
const oneM = (model) => model === MAX_PROFILE_MODELS.grok ? model : decorateGuaranteedOneM(model);
|
|
291
|
+
const effort = (name) => MAX_PROFILE_NATIVE_EFFORTS[name];
|
|
292
|
+
const base = (name, model, roleEffort) => ({
|
|
293
|
+
description: `Max-profile ${name} subagent running ${model}. This model is the deliberate default for the role; use it first and override only after a concrete failure or task-model mismatch. Max dispatch strips Claude Code's required built-in model placeholder so the roster model remains authoritative; clients that can send catalog ids may override only to Luna, Gemini 3.7 Flash, or Grok 4.6.`,
|
|
294
|
+
prompt: `You are the max-profile ${name} subagent. Work from the supplied brief, verify against the actual repository, and return concrete evidence with file:line references. You do not have Advisor. Do not spawn further agents.`,
|
|
295
|
+
model: oneM(model),
|
|
296
|
+
effort: roleEffort
|
|
297
|
+
});
|
|
298
|
+
const researchTools = [
|
|
299
|
+
"Read",
|
|
300
|
+
"Grep",
|
|
301
|
+
"Glob",
|
|
302
|
+
"Bash",
|
|
303
|
+
"WebFetch",
|
|
304
|
+
"WebSearch",
|
|
305
|
+
`mcp__${searchKey}__*`
|
|
306
|
+
];
|
|
307
|
+
const peerList = (opts.maxPersonaNames ?? maxPersonasFor({
|
|
308
|
+
solModel: opts.maxPeerModels?.sol,
|
|
309
|
+
lunaModel: opts.maxPeerModels?.luna,
|
|
310
|
+
opusModel: opts.maxPeerModels?.opus,
|
|
311
|
+
geminiModel: opts.maxPeerModels?.gemini ?? opts.maxGeminiModel,
|
|
312
|
+
grokModel: opts.maxPeerModels?.grok ?? opts.maxGrokModel
|
|
313
|
+
}).map((persona) => persona.toolNameHttp)).map((name) => `\`${name}\``).join(", ");
|
|
314
|
+
const out = {
|
|
315
|
+
Explore: {
|
|
316
|
+
...base("Explore", exploreModel, opts.maxExploreEffort ?? effort("Explore")),
|
|
317
|
+
description: `Max-profile read-only exploration subagent running ${exploreModel}. Best suited to broad, multi-file discovery that should return conclusions and file:line evidence without filling the lead's context.`,
|
|
318
|
+
prompt: "Role: read-only repository exploration. Answer the supplied question with a concise evidence packet: conclusions, load-bearing file:line citations, relevant commands or sources checked, and explicit gaps. The caller retains planning and implementation. " + readOnlyToolSteer(),
|
|
319
|
+
tools: researchTools,
|
|
320
|
+
...searchMcpServers ? { mcpServers: searchMcpServers } : {}
|
|
321
|
+
},
|
|
322
|
+
Plan: {
|
|
323
|
+
...base("Plan", planModel, opts.maxPlanEffort ?? effort("Plan")),
|
|
324
|
+
description: `Max-profile plan consultant running ${planModel} at high effort. Best suited to non-trivial changes where sequencing, interfaces, migration risk, or explicit acceptance criteria benefit from a separate planning view.`,
|
|
325
|
+
prompt: "Role: implementation planning. Given the goal, constraints, and available evidence, return a coherent plan with affected files or symbols, important invariants and risks, acceptance criteria, and useful verification. Surface assumptions or missing decisions; the lead owns plan acceptance and execution. " + readOnlyToolSteer(),
|
|
326
|
+
tools: researchTools,
|
|
327
|
+
...searchMcpServers ? { mcpServers: searchMcpServers } : {}
|
|
328
|
+
},
|
|
329
|
+
"general-purpose": {
|
|
330
|
+
...base("general-purpose", generalModel, opts.maxGeneralPurposeEffort ?? effort("general-purpose")),
|
|
331
|
+
description: `Max-profile general-purpose execution subagent running ${generalModel}. Best suited to mixed or unusual work that does not fit the narrower discovery, planning, implementation, review, or ideation roles.`,
|
|
332
|
+
prompt: "Role: catch-all execution for the supplied bounded task. Deliver the requested outcome within its stated scope and return the files or artifacts changed, verification evidence, and unresolved risks. The lead owns integration and final decisions. " + fileToolSteer("builds, tests, and git"),
|
|
333
|
+
...searchMcpServers ? { mcpServers: searchMcpServers } : {}
|
|
334
|
+
},
|
|
335
|
+
implementer: {
|
|
336
|
+
...base("implementer", implementerModel, opts.maxImplementerEffort ?? effort("implementer")),
|
|
337
|
+
description: `Max-profile implementation subagent running ${implementerModel} at high effort. Best suited to a bounded coding change whose desired outcome and constraints are known but whose implementation still needs judgment.`,
|
|
338
|
+
prompt: "Role: coding implementation for a settled desired outcome. Make a coherent, scoped change consistent with repository conventions and acceptance criteria. Return the files changed, observable behavior, checks and results, and unresolved risks; surface material ambiguity rather than silently deciding product or architecture questions. " + fileToolSteer("builds, tests, and git"),
|
|
339
|
+
...searchMcpServers ? { mcpServers: searchMcpServers } : {}
|
|
340
|
+
},
|
|
341
|
+
reviewer: {
|
|
342
|
+
...base("reviewer", reviewerModel, opts.maxReviewerEffort ?? effort("reviewer")),
|
|
343
|
+
description: `Max-profile repository-aware verifier running ${reviewerModel}. Best suited to assessing an implementation or reproducing a failure when code execution and surrounding repository context matter.`,
|
|
344
|
+
prompt: "Role: independent repository-aware verification. Assess the supplied artifact against its intent and the actual repository or runtime state. Return verified or clearly plausible findings, severity, file:line evidence, concrete failure scenarios, checks run and results, and a go/no-go; distinguish no findings from checks not run. The lead owns remediation and approval. " + fileToolSteer("builds, tests, and reproductions"),
|
|
345
|
+
tools: researchTools,
|
|
346
|
+
...searchMcpServers ? { mcpServers: searchMcpServers } : {}
|
|
347
|
+
},
|
|
348
|
+
brainstorm: {
|
|
349
|
+
...base("brainstorm", brainstormModel, opts.maxBrainstormEffort ?? effort("brainstorm")),
|
|
350
|
+
description: `Max-profile divergent-options subagent running ${brainstormModel}. Best suited to an open decision where materially different repository-feasible approaches remain plausible.`,
|
|
351
|
+
prompt: "Role: divergent option generation. Return materially distinct, repository-feasible alternatives with trade-offs, assumptions, failure modes, and evidence that would discriminate among them. A recommendation is useful when the available evidence supports one; the lead owns the decision and planning. " + readOnlyToolSteer(),
|
|
352
|
+
tools: researchTools,
|
|
353
|
+
...searchMcpServers ? { mcpServers: searchMcpServers } : {}
|
|
354
|
+
},
|
|
355
|
+
"peer-review-coordinator": {
|
|
356
|
+
description: `Max-profile peer-review coordinator running ${MAX_PROFILE_MODELS.luna} at maximum effort. Best suited to consequential plans or diffs where several independent, cross-family lenses are likely to add value beyond one review.`,
|
|
357
|
+
prompt: `Role: synthesize independent fresh-context review of the supplied artifact and constraints. Available peers: ${peerList || "(none)"}. Select a risk-proportionate set with distinct useful lenses, preserving independence and avoiding redundant same-model calls unless their scopes differ. Return deduplicated, severity-ranked findings with sources, file:line evidence where applicable, concrete failure scenarios, disagreements, confidence, and evidence gaps. Peer output is advisory; the lead owns go/no-go and remediation.`,
|
|
358
|
+
model: oneM(MAX_PROFILE_MODELS.luna),
|
|
359
|
+
effort: opts.maxCoordinatorEffort ?? effort("peer-review-coordinator"),
|
|
360
|
+
tools: [`mcp__${peersKey}__*`],
|
|
361
|
+
...peersMcpServers ? { mcpServers: peersMcpServers } : {}
|
|
362
|
+
}
|
|
363
|
+
};
|
|
364
|
+
if (opts.browseAvailable && opts.groupKeys.workers) {
|
|
365
|
+
const workersKey = workersKeyOf(opts.groupKeys);
|
|
366
|
+
out["worker-browse"] = {
|
|
367
|
+
description: dispatcherDescription("browse"),
|
|
368
|
+
prompt: dispatcherPrompt("browse", workersKey),
|
|
369
|
+
model: oneM(MAX_PROFILE_MODELS.luna),
|
|
370
|
+
effort: "high",
|
|
371
|
+
tools: dispatcherTools("browse", workersKey),
|
|
372
|
+
...opts.serverUrl ? { mcpServers: { [workersKey]: httpEntryFor(opts.serverUrl, "workers", opts.nonce, opts.workspaceHeaderCmd) } } : {}
|
|
373
|
+
};
|
|
374
|
+
}
|
|
375
|
+
const roster = opts.nativeRoster == null ? new Set(MAX_PROFILE_NATIVE_AGENT_NAMES) : opts.nativeRoster instanceof Set ? opts.nativeRoster : new Set(opts.nativeRoster);
|
|
376
|
+
for (const name of Object.keys(out)) if (name !== "worker-browse" && !roster.has(name)) delete out[name];
|
|
377
|
+
return out;
|
|
378
|
+
}
|
|
274
379
|
/** Build the literal `-m fast` native roster. This is intentionally separate
|
|
275
380
|
* from the standard definitions: the names overlap, but their role bodies,
|
|
276
381
|
* fixed model assignments, and efforts are profile contracts. */
|
|
@@ -280,7 +385,7 @@ function buildFastProfileAgentDefinitions(opts) {
|
|
|
280
385
|
const reviewerModel = nonEmptyModel(opts.reviewerModel);
|
|
281
386
|
const plannerModel = nonEmptyModel(opts.plannerModel);
|
|
282
387
|
const criticModel = nonEmptyModel(opts.criticModel);
|
|
283
|
-
if (!scoutModel || !implementerModel || !reviewerModel || !plannerModel || !criticModel) throw new Error("fast profile requires resolved
|
|
388
|
+
if (!scoutModel || !implementerModel || !reviewerModel || !plannerModel || !criticModel) throw new Error("fast profile requires resolved Explore, implementer, reviewer, planner, and critic models");
|
|
284
389
|
const searchKey = opts.groupKeys.search ?? GROUP_META.search.preferredKey;
|
|
285
390
|
const peersKey = peersKeyOf(opts.groupKeys);
|
|
286
391
|
const searchMcp = opts.serverUrl ? { mcpServers: { [searchKey]: httpEntryFor(opts.serverUrl, "search", opts.nonce, opts.workspaceHeaderCmd) } } : {};
|
|
@@ -305,7 +410,7 @@ function buildFastProfileAgentDefinitions(opts) {
|
|
|
305
410
|
const reviewerPrompt = "You are the fast profile's repository-aware reviewer. Verify what is actually true by reading the code and running the relevant build, tests, or end-to-end reproduction. Find root causes rather than symptoms. Do not modify production code. Report severity-ranked findings with `file:line` evidence and a clear go/no-go. You do not have Advisor; independently reach your verdict from repository evidence. Use Oracle only as a last resort for one precise unresolved question after your own investigation. " + fileToolSteer("builds and reproductions") + " Do not spawn further agents.";
|
|
306
411
|
const criticPrompt = "You are the fast profile's fresh-context cross-lab critic. Assess the supplied plan, design, diff, or decision against its stated constraints. Look for overlooked failure modes, unsupported assumptions, and simpler safer alternatives. Do not modify files, run mutating commands, or spawn agents. Return concise severity-ranked findings with `file:line` evidence where applicable. " + readOnlyToolSteer();
|
|
307
412
|
const out = {
|
|
308
|
-
|
|
413
|
+
Explore: {
|
|
309
414
|
description: `Read-only exploration subagent running ${scoutModel}. Use for broad repository discovery before the lead drafts a plan; return conclusions with file:line evidence, not file dumps.`,
|
|
310
415
|
prompt: "Investigate the repository read-only. Cast a wide net, then return a concise evidence packet for the lead: conclusions, load-bearing `file:line` citations, commands checked, and explicit gaps. Do not plan, edit, or spawn agents. " + readOnlyToolSteer(),
|
|
311
416
|
tools: scoutTools,
|
|
@@ -340,7 +445,7 @@ function buildFastProfileAgentDefinitions(opts) {
|
|
|
340
445
|
},
|
|
341
446
|
planner: {
|
|
342
447
|
description: `Plan consultant and approver running ${plannerModel}. Invoke only after Luna has done the repository legwork and drafted a plan; pass a handcrafted evidence packet and the complete draft. The lead must not implement until this agent returns APPROVE.`,
|
|
343
|
-
prompt: "You are the fast profile's final plan consultant and approver, not a first-pass planner. The caller must provide the user goal, acceptance criteria, repository/domain constraints, Luna's `file:line` and command/test evidence, the complete draft plan, settled decisions, and one focused review question. Selectively verify disputed citations or narrow evidence gaps with read/search tools, but do not repeat broad discovery, edit files, or execute the plan. Return exactly one leading verdict: `APPROVE`, `REVISE`, or `NEED_MORE_CONTEXT`. APPROVE only when the plan is safe, ordered, complete, and verifiable. REVISE must give concrete corrections. NEED_MORE_CONTEXT must name the exact evidence Luna should collect. You do not have Advisor; independently reach your verdict from the evidence packet and selective verification. Use Oracle only as a last resort for one precise unresolved question after your own review. The Task/Agent capability is restricted by the fast in-session ACL: you may invoke only `reviewer`, `
|
|
448
|
+
prompt: "You are the fast profile's final plan consultant and approver, not a first-pass planner. The caller must provide the user goal, acceptance criteria, repository/domain constraints, Luna's `file:line` and command/test evidence, the complete draft plan, settled decisions, and one focused review question. Selectively verify disputed citations or narrow evidence gaps with read/search tools, but do not repeat broad discovery, edit files, or execute the plan. Return exactly one leading verdict: `APPROVE`, `REVISE`, or `NEED_MORE_CONTEXT`. APPROVE only when the plan is safe, ordered, complete, and verifiable. REVISE must give concrete corrections. NEED_MORE_CONTEXT must name the exact evidence Luna should collect. You do not have Advisor; independently reach your verdict from the evidence packet and selective verification. Use Oracle only as a last resort for one precise unresolved question after your own review. The Task/Agent capability is restricted by the fast in-session ACL: you may invoke only `reviewer`, `Explore`, or `critic`; do not invoke any other role. Bash is for evidence commands only; this is not a shell sandbox. " + readOnlyToolSteer(),
|
|
344
449
|
tools: plannerTools,
|
|
345
450
|
model: decorateGuaranteedOneM(plannerModel),
|
|
346
451
|
effort: opts.plannerEffort ?? "high",
|
|
@@ -350,7 +455,7 @@ function buildFastProfileAgentDefinitions(opts) {
|
|
|
350
455
|
}
|
|
351
456
|
}
|
|
352
457
|
};
|
|
353
|
-
const roster = opts.nativeRoster == null ?
|
|
458
|
+
const roster = opts.nativeRoster == null ? new Set(FAST_PROFILE_NATIVE_AGENT_NAMES) : opts.nativeRoster instanceof Set ? opts.nativeRoster : new Set(opts.nativeRoster);
|
|
354
459
|
if (roster) {
|
|
355
460
|
for (const name of Object.keys(out)) if (!roster.has(name)) delete out[name];
|
|
356
461
|
}
|
|
@@ -366,9 +471,10 @@ function buildFastProfileAgentDefinitions(opts) {
|
|
|
366
471
|
* per Phase 2A of the peer-MCP plan.
|
|
367
472
|
*/
|
|
368
473
|
function buildPeerAgentDefinitions(opts) {
|
|
474
|
+
if (opts.maxProfile) return buildMaxProfileAgentDefinitions(opts);
|
|
369
475
|
if (opts.fastProfile) return buildFastProfileAgentDefinitions(opts);
|
|
370
476
|
const out = {};
|
|
371
|
-
const personas =
|
|
477
|
+
const personas = personasFor({
|
|
372
478
|
codexCli: opts.codexCli,
|
|
373
479
|
geminiAvailable: opts.geminiAvailable,
|
|
374
480
|
geminiModel: opts.geminiModel,
|
|
@@ -818,6 +924,24 @@ async function writePeerMcpRuntimeFiles(serverUrl, opts) {
|
|
|
818
924
|
plannerEffort: opts.plannerEffort,
|
|
819
925
|
criticModel: opts.criticModel,
|
|
820
926
|
criticEffort: opts.criticEffort,
|
|
927
|
+
maxProfile: opts.maxProfile,
|
|
928
|
+
maxExploreModel: opts.maxExploreModel,
|
|
929
|
+
maxPlanModel: opts.maxPlanModel,
|
|
930
|
+
maxGeneralPurposeModel: opts.maxGeneralPurposeModel,
|
|
931
|
+
maxImplementerModel: opts.maxImplementerModel,
|
|
932
|
+
maxReviewerModel: opts.maxReviewerModel,
|
|
933
|
+
maxBrainstormModel: opts.maxBrainstormModel,
|
|
934
|
+
maxGeminiModel: opts.maxGeminiModel,
|
|
935
|
+
maxGrokModel: opts.maxGrokModel,
|
|
936
|
+
maxExploreEffort: opts.maxExploreEffort,
|
|
937
|
+
maxPlanEffort: opts.maxPlanEffort,
|
|
938
|
+
maxGeneralPurposeEffort: opts.maxGeneralPurposeEffort,
|
|
939
|
+
maxImplementerEffort: opts.maxImplementerEffort,
|
|
940
|
+
maxReviewerEffort: opts.maxReviewerEffort,
|
|
941
|
+
maxBrainstormEffort: opts.maxBrainstormEffort,
|
|
942
|
+
maxCoordinatorEffort: opts.maxCoordinatorEffort,
|
|
943
|
+
maxPersonaNames: opts.maxPersonaNames,
|
|
944
|
+
maxPeerModels: opts.maxPeerModels,
|
|
821
945
|
nonce,
|
|
822
946
|
codexHome,
|
|
823
947
|
serverUrl,
|
|
@@ -843,7 +967,13 @@ async function writePeerMcpRuntimeFiles(serverUrl, opts) {
|
|
|
843
967
|
}
|
|
844
968
|
const completeMdResult = mdResult;
|
|
845
969
|
if (!completeMdResult) throw new Error("peer MCP agent files were not generated");
|
|
846
|
-
const personas = opts.
|
|
970
|
+
const personas = opts.maxProfile ? maxPersonasFor({
|
|
971
|
+
solModel: opts.maxPeerModels?.sol,
|
|
972
|
+
lunaModel: opts.maxPeerModels?.luna,
|
|
973
|
+
opusModel: opts.maxPeerModels?.opus,
|
|
974
|
+
geminiModel: opts.maxPeerModels?.gemini,
|
|
975
|
+
grokModel: opts.maxPeerModels?.grok
|
|
976
|
+
}) : opts.fastProfile ? [] : personasFor({
|
|
847
977
|
codexCli: opts.codexCli,
|
|
848
978
|
geminiAvailable: opts.geminiAvailable,
|
|
849
979
|
geminiModel: opts.geminiModel,
|
|
@@ -1918,7 +2048,7 @@ function joinClauses(parts) {
|
|
|
1918
2048
|
* tier; reserve `reviewer` for the higher-stakes assessment it is there for. */
|
|
1919
2049
|
function buildNativeReachClauses(opts) {
|
|
1920
2050
|
if (opts.profile === "fast") return joinClauses([
|
|
1921
|
-
"`
|
|
2051
|
+
"`Explore` to find or understand something in the repo",
|
|
1922
2052
|
"`implementer` for approved mechanical coding changes",
|
|
1923
2053
|
"`reviewer` for repository-aware verification, reproduction, and root-causing",
|
|
1924
2054
|
"`planner` as the Sol plan consultant and approver after Luna has drafted with evidence",
|
|
@@ -1944,6 +2074,7 @@ function buildNativeReachClauses(opts) {
|
|
|
1944
2074
|
return joinClauses(clauses);
|
|
1945
2075
|
}
|
|
1946
2076
|
function buildOperatingDefaultsDirective(opts = {}) {
|
|
2077
|
+
if (opts.profile === "max") 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 and may use the roster as a set of complementary capabilities, not a required sequence: direct tools suit narrow facts; `Explore` broad discovery; `brainstorm` open design choices; `Plan` changes where sequencing, interfaces, or acceptance criteria benefit from a separate view; `implementer` bounded coding; `general-purpose` mixed work; and `reviewer` repository-aware verification. Independent work can run in parallel when that improves context isolation or latency. A fresh-context peer from another model family can be useful where correlated blind spots matter and deterministic evidence does not settle the issue; `peer-review-coordinator` is available when the risk justifies several lenses. Small or obvious tasks are often better handled directly, and model output remains evidence to synthesize rather than a vote. Each role's configured model is the deliberate default for role fit and diversity; overrides are most useful after a concrete mismatch. On every retained max surface, Gemini 3.1 Pro is replaced by Grok 4.6/high when available, otherwise Gemini 3.7 Flash 1M/high. Advisor is optional, non-binding counsel for one focused consequential uncertainty that the normal evidence and roles cannot settle; it has no approval or workflow authority, and a further consultation is useful only when materially new evidence changes the question.";
|
|
1947
2078
|
if (opts.profile === "fast") {
|
|
1948
2079
|
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, so no injected Task roster, search, or Oracle is available. 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.";
|
|
1949
2080
|
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, and review to the right subagent. Reach for " + buildNativeReachClauses(opts) + "; Task subagents run in parallel. That keeps your own context free to reason and collaborate with the user. Delegate only when work is wide or slow; do trivial and surgical work directly. Luna investigates and drafts. The lead must give `planner` a handcrafted evidence packet and must not implement until `planner` returns `APPROVE`. Advisor is an optional, non-binding, lead-only transcript-aware sounding board for consequential unresolved uncertainty, conflicting evidence, or a genuinely stuck path; never use it for routine progress, waiting, directly verifiable facts, planner approval, reviewer verification, or completion ritual. `oracle` is exact Opus 5 (1M/high), stateless and last resort after the normal paths remain stuck. Before declaring work done, run the relevant build/tests and ask `reviewer` for repository-aware verification. Verify claims, report uncertainty, and stop named teammates when finished.";
|
|
@@ -2448,6 +2579,12 @@ const INJECTED_SKILLS = [
|
|
|
2448
2579
|
FIRST_MATE_OPERATE_SKILL,
|
|
2449
2580
|
FIRST_MATE_CONDUCT_SKILL
|
|
2450
2581
|
];
|
|
2582
|
+
function injectedSkillsForLaunch(selection) {
|
|
2583
|
+
if (selection.profileId === "fast") return [];
|
|
2584
|
+
if (selection.profileId === "max") return selection.firstMateEnabled ? INJECTED_SKILLS.filter((skill) => skill.name.startsWith("gh-first-mate")) : [];
|
|
2585
|
+
if (!selection.workerSkillsActive) return [];
|
|
2586
|
+
return INJECTED_SKILLS.filter((skill) => selection.firstMateEnabled || !skill.name.startsWith("gh-first-mate"));
|
|
2587
|
+
}
|
|
2451
2588
|
//#endregion
|
|
2452
2589
|
//#region src/lib/attribution-settings.ts
|
|
2453
2590
|
/**
|
|
@@ -2513,6 +2650,6 @@ async function injectAttributionSuppressionIntoSettingsFile(settingsPath) {
|
|
|
2513
2650
|
return { written: true };
|
|
2514
2651
|
}
|
|
2515
2652
|
//#endregion
|
|
2516
|
-
export {
|
|
2653
|
+
export { writePeerMcpRuntimeFiles as S, BUILTIN_SUBAGENT_DEFINITIONS as _, OPERATING_DEFAULTS_DIGEST as a, resolveGroupKeysFromMirror as b, buildOperatingDefaultsDirective as c, prependStyleDirectiveToMirroredClaudeMd as d, SEAMLESS_BUILTIN_TOOLS as f, sanitizeServeSettingsEnv as g, planModeAllowRules as h, writeInjectedSkill as i, prependArtifactPanelDirectiveToMirroredClaudeMd as l, injectAllowRules as m, INJECTED_SKILLS as n, appendPeerAwarenessToMirroredClaudeMd as o, configureServeDefaultPermissionMode as p, injectedSkillsForLaunch as r, appendToolbeltAwarenessToMirroredClaudeMd as s, injectAttributionSuppressionIntoSettingsFile as t, prependOperatingDefaultsToMirroredClaudeMd as u, injectPeerMcpIntoMirror as v, workersKeyOf as x, resolveCodexCliBackend as y };
|
|
2517
2654
|
|
|
2518
|
-
//# sourceMappingURL=attribution-settings-
|
|
2655
|
+
//# sourceMappingURL=attribution-settings-B1xutIts.js.map
|