github-router 0.3.321 → 0.3.323
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/{aic-ledger-BrDqsuge.js → aic-ledger-DRU89gJg.js} +20 -3
- package/dist/aic-ledger-DRU89gJg.js.map +1 -0
- package/dist/{attribution-settings-DHWo0lyG.js → attribution-settings-CX-kIrT8.js} +292 -101
- package/dist/attribution-settings-CX-kIrT8.js.map +1 -0
- package/dist/{auth-Iun7ftd8.js → auth-DSLN1arH.js} +3 -3
- package/dist/{auth-Iun7ftd8.js.map → auth-DSLN1arH.js.map} +1 -1
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/{check-usage-1c-0z3iy.js → check-usage-B_12ALvf.js} +4 -4
- package/dist/{check-usage-1c-0z3iy.js.map → check-usage-B_12ALvf.js.map} +1 -1
- package/dist/{claude-uAFPKvuS.js → claude-Cq1xGzbI.js} +61 -49
- package/dist/claude-Cq1xGzbI.js.map +1 -0
- package/dist/{codex-CVHdye0h.js → codex-INt1hc_5.js} +5 -5
- package/dist/{codex-CVHdye0h.js.map → codex-INt1hc_5.js.map} +1 -1
- package/dist/{copilot-discount-BnJkEojk.js → copilot-discount-D8t7Q3Tp.js} +2 -2
- package/dist/{copilot-discount-BnJkEojk.js.map → copilot-discount-D8t7Q3Tp.js.map} +1 -1
- package/dist/{debug-CDyXUPcC.js → debug-D8iD6G4O.js} +2 -2
- package/dist/{debug-CDyXUPcC.js.map → debug-D8iD6G4O.js.map} +1 -1
- package/dist/engine-4uuaURb0.js +2 -0
- package/dist/{fast-profile-contract-_DhIWank.js → fast-profile-contract-DmsyQQrw.js} +6 -11
- package/dist/fast-profile-contract-DmsyQQrw.js.map +1 -0
- package/dist/{gate-discovery-DUBuxiLb.js → gate-discovery-Z0QyjqM7.js} +5 -5
- package/dist/{gate-discovery-DUBuxiLb.js.map → gate-discovery-Z0QyjqM7.js.map} +1 -1
- package/dist/{get-copilot-usage-BWCAzmSc.js → get-copilot-usage-Bs-FEPMf.js} +2 -2
- package/dist/{get-copilot-usage-BWCAzmSc.js.map → get-copilot-usage-Bs-FEPMf.js.map} +1 -1
- package/dist/hooks.mjs +6 -12
- package/dist/hooks.sha256 +1 -1
- package/dist/{internal-aic-status-Dc2JQDsX.js → internal-aic-status-BaUKlisM.js} +3 -3
- package/dist/{internal-aic-status-Dc2JQDsX.js.map → internal-aic-status-BaUKlisM.js.map} +1 -1
- package/dist/{internal-artifact-open-CA1trJ15.js → internal-artifact-open-U-Ht7R-O.js} +2 -2
- package/dist/{internal-artifact-open-CA1trJ15.js.map → internal-artifact-open-U-Ht7R-O.js.map} +1 -1
- package/dist/{internal-fast-dispatch-guard-CZ4BZuAG.js → internal-fast-dispatch-guard-Dnjoj0pV.js} +4 -5
- package/dist/internal-fast-dispatch-guard-Dnjoj0pV.js.map +1 -0
- package/dist/{internal-fast-dispatch-guard-D5kozMpo.js → internal-fast-dispatch-guard-uztSu0c8.js} +1 -1
- package/dist/{internal-first-mate-guard-B_or0eN3.js → internal-first-mate-guard-Dvd1vZ4l.js} +1 -1
- package/dist/{internal-first-mate-guard-CiFH6X1H.js → internal-first-mate-guard-mvfZal_M.js} +3 -3
- package/dist/{internal-first-mate-guard-CiFH6X1H.js.map → internal-first-mate-guard-mvfZal_M.js.map} +1 -1
- package/dist/{internal-max-dispatch-guard-BGOHRYRt.js → internal-max-dispatch-guard-CxG_c3cc.js} +1 -1
- package/dist/{internal-max-dispatch-guard-CnBZxo5l.js → internal-max-dispatch-guard-Sp_rCYk_.js} +2 -2
- package/dist/{internal-max-dispatch-guard-CnBZxo5l.js.map → internal-max-dispatch-guard-Sp_rCYk_.js.map} +1 -1
- package/dist/{internal-plan-review-C73snnD8.js → internal-plan-review-Co01iHOW.js} +3 -3
- package/dist/{internal-plan-review-C73snnD8.js.map → internal-plan-review-Co01iHOW.js.map} +1 -1
- package/dist/{internal-prompt-submit-dov4UvBo.js → internal-prompt-submit-dflz0bqH.js} +4 -4
- package/dist/{internal-prompt-submit-dov4UvBo.js.map → internal-prompt-submit-dflz0bqH.js.map} +1 -1
- package/dist/{internal-session-bind-C3hrb9rP.js → internal-session-bind-BVQy7Vd4.js} +2 -2
- package/dist/{internal-session-bind-C3hrb9rP.js.map → internal-session-bind-BVQy7Vd4.js.map} +1 -1
- package/dist/{internal-stop-hook-DCjYE2x0.js → internal-stop-hook-DihBVzn2.js} +5 -5
- package/dist/{internal-stop-hook-DCjYE2x0.js.map → internal-stop-hook-DihBVzn2.js.map} +1 -1
- package/dist/{internal-stop-review-MBVYtrYS.js → internal-stop-review-CrnG4IJo.js} +2 -2
- package/dist/{internal-stop-review-MBVYtrYS.js.map → internal-stop-review-CrnG4IJo.js.map} +1 -1
- package/dist/{internal-worker-guard-dxGawAY3.js → internal-worker-guard-BSoS4wzV.js} +2 -2
- package/dist/{internal-worker-guard-dxGawAY3.js.map → internal-worker-guard-BSoS4wzV.js.map} +1 -1
- package/dist/{internal-workspace-header-_aEXOz5q.js → internal-workspace-header-booLOzwD.js} +2 -2
- package/dist/{internal-workspace-header-_aEXOz5q.js.map → internal-workspace-header-booLOzwD.js.map} +1 -1
- package/dist/{lifecycle-CJB2BwSJ.js → lifecycle-BYPEqFdV.js} +2 -2
- package/dist/{lifecycle-CJB2BwSJ.js.map → lifecycle-BYPEqFdV.js.map} +1 -1
- package/dist/{lifecycle-_BE0SnNs.js → lifecycle-C1LDvDD6.js} +2 -2
- package/dist/{lifecycle-_BE0SnNs.js.map → lifecycle-C1LDvDD6.js.map} +1 -1
- package/dist/lifecycle-Cz99P30h.js +2 -0
- package/dist/lifecycle-DqTFEJpS.js +2 -0
- package/dist/main.js +20 -20
- package/dist/{mcp-workspace-header-mXRLE8kg.js → mcp-workspace-header-BIW0SRgs.js} +2 -2
- package/dist/{mcp-workspace-header-mXRLE8kg.js.map → mcp-workspace-header-BIW0SRgs.js.map} +1 -1
- package/dist/{models-CSFIVxAH.js → models-B9tdaM6B.js} +3 -3
- package/dist/{models-CSFIVxAH.js.map → models-B9tdaM6B.js.map} +1 -1
- package/dist/{orchestration-B8kypXcZ.js → orchestration-DvsdorFq.js} +2 -2
- package/dist/{orchestration-B8kypXcZ.js.map → orchestration-DvsdorFq.js.map} +1 -1
- package/dist/{paths-CHBAj_t9.js → paths-BnZwolac.js} +4 -4
- package/dist/{paths-CHBAj_t9.js.map → paths-BnZwolac.js.map} +1 -1
- package/dist/paths-BzM6uxmd.js +2 -0
- package/dist/{peer-mcp-personas-BerVEkZ9.js → peer-mcp-personas-DcAErb_d.js} +209 -71
- package/dist/peer-mcp-personas-DcAErb_d.js.map +1 -0
- package/dist/{plan-review-hook-BMmw7wxR.js → plan-review-hook-BlsGnG02.js} +3 -3
- package/dist/{plan-review-hook-BMmw7wxR.js.map → plan-review-hook-BlsGnG02.js.map} +1 -1
- package/dist/{prompt-submit-hook-CGgT5m4Q.js → prompt-submit-hook-BJFLzCaT.js} +3 -3
- package/dist/{prompt-submit-hook-CGgT5m4Q.js.map → prompt-submit-hook-BJFLzCaT.js.map} +1 -1
- package/dist/{provision-o4bXbsvB.js → provision-B-a5KUCL.js} +4 -4
- package/dist/{provision-o4bXbsvB.js.map → provision-B-a5KUCL.js.map} +1 -1
- package/dist/{self-invocation-DahN1gw9.js → self-invocation-opSXHEs0.js} +2 -2
- package/dist/{self-invocation-DahN1gw9.js.map → self-invocation-opSXHEs0.js.map} +1 -1
- package/dist/{serve-DSL2Fcnc.js → serve-TiUhvpVp.js} +12 -12
- package/dist/{serve-DSL2Fcnc.js.map → serve-TiUhvpVp.js.map} +1 -1
- package/dist/{server-setup-CXXKmPIE.js → server-setup-CgbHmupe.js} +205 -57
- package/dist/server-setup-CgbHmupe.js.map +1 -0
- package/dist/{start-Cl_1UMg_.js → start-DNzOFabp.js} +3 -3
- package/dist/{start-Cl_1UMg_.js.map → start-DNzOFabp.js.map} +1 -1
- package/dist/{stop-gate-hook-D7N759TG.js → stop-gate-hook-DvNM8zFf.js} +3 -3
- package/dist/{stop-gate-hook-D7N759TG.js.map → stop-gate-hook-DvNM8zFf.js.map} +1 -1
- package/dist/{stop-gate-policy-C0gt04R0.js → stop-gate-policy-C5pXbY59.js} +2 -2
- package/dist/{stop-gate-policy-C0gt04R0.js.map → stop-gate-policy-C5pXbY59.js.map} +1 -1
- package/dist/{token-86uk6y4P.js → token-Css-ARGL.js} +2 -2
- package/dist/{token-86uk6y4P.js.map → token-Css-ARGL.js.map} +1 -1
- package/dist/{worker-dispatch-B-OA7tvU.js → worker-dispatch-DwS99DXz.js} +2 -2
- package/dist/{worker-dispatch-B-OA7tvU.js.map → worker-dispatch-DwS99DXz.js.map} +1 -1
- package/package.json +1 -1
- package/dist/aic-ledger-BrDqsuge.js.map +0 -1
- package/dist/attribution-settings-DHWo0lyG.js.map +0 -1
- package/dist/claude-uAFPKvuS.js.map +0 -1
- package/dist/engine-57iIqICe.js +0 -2
- package/dist/fast-profile-contract-_DhIWank.js.map +0 -1
- package/dist/internal-fast-dispatch-guard-CZ4BZuAG.js.map +0 -1
- package/dist/lifecycle-D0KsoSqz.js +0 -2
- package/dist/lifecycle-DimEguJO.js +0 -2
- package/dist/paths-eHoOwFzZ.js +0 -2
- package/dist/peer-mcp-personas-BerVEkZ9.js.map +0 -1
- package/dist/server-setup-CXXKmPIE.js.map +0 -1
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { n as explicitPackageRoot } from "./package-root-B-osctCk.js";
|
|
2
2
|
import { t as getPackageVersion } from "./version-C8x2hQrZ.js";
|
|
3
|
-
import { t as PATHS } from "./paths-
|
|
3
|
+
import { t as PATHS } from "./paths-BnZwolac.js";
|
|
4
4
|
import { t as state } from "./state-BlMpEFAt.js";
|
|
5
|
-
import { C as GITHUB_GRAPHQL_URL, D as githubAgentGraphQLHeaders, E as copilotVersion, O as githubAgentHeaders, S as GITHUB_API_BASE_URL, T as copilotHeaders, b as sanitizeTransportText, d as resolveModel, f as sleep$2, g as HTTPError, h as isAllowedCopilotHost, i as tryRefreshAndRetry, v as classifyTransportError, w as copilotBaseUrl, x as withTransientRetry, y as fetchWithTransientRetry } from "./token-
|
|
5
|
+
import { C as GITHUB_GRAPHQL_URL, D as githubAgentGraphQLHeaders, E as copilotVersion, O as githubAgentHeaders, S as GITHUB_API_BASE_URL, T as copilotHeaders, b as sanitizeTransportText, d as resolveModel, f as sleep$2, g as HTTPError, h as isAllowedCopilotHost, i as tryRefreshAndRetry, v as classifyTransportError, w as copilotBaseUrl, x as withTransientRetry, y as fetchWithTransientRetry } from "./token-Css-ARGL.js";
|
|
6
6
|
import { a as parseIntEnv, i as parseBoolEnv, l as runManagedExeCapture, o as resolveExecutable, u as spawnTaskkillBestEffort } from "./exec-COUT4QsS.js";
|
|
7
|
-
import { a as FAST_PROFILE_ASTRA_MODEL, c as FAST_PROFILE_MODELS, d as FAST_PROFILE_NATIVE_MODELS, f as FAST_PROFILE_ORACLE_EFFORT, n as FAST_PROFILE_ADVISOR_EFFORT, p as FAST_PROFILE_ORACLE_MODEL, r as FAST_PROFILE_ADVISOR_MODEL, u as FAST_PROFILE_NATIVE_EFFORTS } from "./fast-profile-contract-
|
|
7
|
+
import { a as FAST_PROFILE_ASTRA_MODEL, c as FAST_PROFILE_MODELS, d as FAST_PROFILE_NATIVE_MODELS, f as FAST_PROFILE_ORACLE_EFFORT, n as FAST_PROFILE_ADVISOR_EFFORT, p as FAST_PROFILE_ORACLE_MODEL, r as FAST_PROFILE_ADVISOR_MODEL, u as FAST_PROFILE_NATIVE_EFFORTS } from "./fast-profile-contract-DmsyQQrw.js";
|
|
8
8
|
import { A as normalizeTrailingOneMSuffix, D as maxPeerInstructions, E as maxPeerDescription, O as fastEndpointForCatalogId, b as MAX_ADVISOR_SYSTEM_PROMPT, f as maxCodexReviewerModel, g as maxProReplacementModel, h as maxOpusModel, i as MAX_PROFILE_MODELS, k as fastEndpointForModel, m as maxGrokModel, p as maxGeminiModel, r as MAX_PROFILE_LEAD_MODEL, v as maxSonnetModel } from "./max-profile-contract-Bl7I_EOC.js";
|
|
9
|
-
import { i as registerExitHandlers$1, n as getInstanceUuid, r as recordWorkerRepo, t as WorktreeRegistry } from "./lifecycle-
|
|
10
|
-
import { t as MCP_WORKSPACE_HEADER } from "./mcp-workspace-header-
|
|
9
|
+
import { i as registerExitHandlers$1, n as getInstanceUuid, r as recordWorkerRepo, t as WorktreeRegistry } from "./lifecycle-BYPEqFdV.js";
|
|
10
|
+
import { t as MCP_WORKSPACE_HEADER } from "./mcp-workspace-header-BIW0SRgs.js";
|
|
11
11
|
import { n as ArtifactError, r as applyInsecureTls, t as ArtifactClient } from "./client-CQMfroGV.js";
|
|
12
|
-
import { n as isPidAlive$1, r as registerColbertExitHandlers, s as trackChild, t as getColbertInstanceUuid } from "./lifecycle-
|
|
13
|
-
import { a as extractAndRecordPricedAic,
|
|
14
|
-
import { h as runGateChecks, m as sealedGateIds, p as resolveSealedGate } from "./stop-gate-hook-
|
|
15
|
-
import { t as liveExec } from "./orchestration-
|
|
12
|
+
import { n as isPidAlive$1, r as registerColbertExitHandlers, s as trackChild, t as getColbertInstanceUuid } from "./lifecycle-C1LDvDD6.js";
|
|
13
|
+
import { a as extractAndRecordPricedAic, i as extractAndRecordAic, l as recordAic, p as extractCopilotUsage } from "./aic-ledger-DRU89gJg.js";
|
|
14
|
+
import { h as runGateChecks, m as sealedGateIds, p as resolveSealedGate } from "./stop-gate-hook-DvNM8zFf.js";
|
|
15
|
+
import { t as liveExec } from "./orchestration-DvsdorFq.js";
|
|
16
16
|
import { createRequire } from "node:module";
|
|
17
17
|
import consola from "consola";
|
|
18
18
|
import { chmodSync, closeSync, constants, cpSync, existsSync, mkdirSync, openSync, readFileSync, readdirSync, realpathSync, renameSync, rmSync, statSync, unlinkSync, writeFileSync, writeSync } from "node:fs";
|
|
@@ -101,12 +101,31 @@ async function tryCreateLock(p) {
|
|
|
101
101
|
}
|
|
102
102
|
//#endregion
|
|
103
103
|
//#region src/lib/cheap-profile-contract.ts
|
|
104
|
+
/**
|
|
105
|
+
* Fixed identities for the literal `github-router claude -m cheap` and
|
|
106
|
+
* `-m cheap1m` cheap-family profiles.
|
|
107
|
+
*
|
|
108
|
+
* A cost-lean sibling of `-m fast`: identical fixed four-agent surface, but
|
|
109
|
+
* every SUBAGENT runs at Claude Code's 200K DEFAULT context window (bare
|
|
110
|
+
* slug, no `[1m]` accounting bracket). `-m cheap` also drives the Gemini
|
|
111
|
+
* LEAD at the same 200K default (bare slug, no `[1m]`) with medium effort,
|
|
112
|
+
* so its only peer is the `grok-4.6`/medium Oracle. `-m cheap1m` is the named successor of the
|
|
113
|
+
* original cheap launch: the leader keeps its full 1M window (`[1m]`) and
|
|
114
|
+
* the `astra` peer (`gpt-6-astra`) remains available next to Oracle — still
|
|
115
|
+
* at the 200K default window and medium effort.
|
|
116
|
+
*
|
|
117
|
+
* This module is deliberately dependency-free, including its own delegation
|
|
118
|
+
* graph literal: the cheap family shares fast's exact authority shape today,
|
|
119
|
+
* but each pinned profile owns its graph so tuning one roster cannot silently
|
|
120
|
+
* retune another. Launch validation, request routing, native-agent
|
|
121
|
+
* generation, and the PreToolUse ACL all import the same literals so a role
|
|
122
|
+
* cannot silently mean different things at each boundary.
|
|
123
|
+
*/
|
|
104
124
|
const CHEAP_PROFILE_MODELS = Object.freeze({
|
|
105
125
|
lead: "gemini-3.8-flash",
|
|
106
126
|
explore: "gpt-5.6-luna",
|
|
107
127
|
plan: "gpt-5.6-sol",
|
|
108
|
-
"
|
|
109
|
-
implementer: "gemini-3.8-flash",
|
|
128
|
+
"General-Purpose": "gemini-3.8-flash",
|
|
110
129
|
reviewer: "gpt-5.6-luna",
|
|
111
130
|
advisor: "gpt-5.6-sol",
|
|
112
131
|
oracle: "grok-4.6",
|
|
@@ -115,22 +134,19 @@ const CHEAP_PROFILE_MODELS = Object.freeze({
|
|
|
115
134
|
const CHEAP_PROFILE_NATIVE_AGENT_NAMES = [
|
|
116
135
|
"Explore",
|
|
117
136
|
"Plan",
|
|
118
|
-
"
|
|
119
|
-
"implementer",
|
|
137
|
+
"General-Purpose",
|
|
120
138
|
"reviewer"
|
|
121
139
|
];
|
|
122
140
|
const CHEAP_PROFILE_NATIVE_MODELS = Object.freeze({
|
|
123
141
|
Explore: CHEAP_PROFILE_MODELS.explore,
|
|
124
142
|
Plan: CHEAP_PROFILE_MODELS.plan,
|
|
125
|
-
"
|
|
126
|
-
implementer: CHEAP_PROFILE_MODELS.implementer,
|
|
143
|
+
"General-Purpose": CHEAP_PROFILE_MODELS["General-Purpose"],
|
|
127
144
|
reviewer: CHEAP_PROFILE_MODELS.reviewer
|
|
128
145
|
});
|
|
129
146
|
const CHEAP_PROFILE_NATIVE_EFFORTS = Object.freeze({
|
|
130
147
|
Explore: "high",
|
|
131
148
|
Plan: "high",
|
|
132
|
-
"
|
|
133
|
-
implementer: "high",
|
|
149
|
+
"General-Purpose": "max",
|
|
134
150
|
reviewer: "max"
|
|
135
151
|
});
|
|
136
152
|
/**
|
|
@@ -159,14 +175,33 @@ const CHEAP_PROFILE_ORACLE_EFFORT = "medium";
|
|
|
159
175
|
* astra peer). Runs at the 200K default window and medium effort. */
|
|
160
176
|
const CHEAP_PROFILE_ASTRA_MODEL = CHEAP_PROFILE_MODELS.astra;
|
|
161
177
|
const CHEAP_PROFILE_ASTRA_EFFORT = "medium";
|
|
178
|
+
Object.freeze({
|
|
179
|
+
Explore: Object.freeze([]),
|
|
180
|
+
Plan: Object.freeze(["Explore", "reviewer"]),
|
|
181
|
+
"General-Purpose": Object.freeze(["reviewer"]),
|
|
182
|
+
reviewer: Object.freeze([])
|
|
183
|
+
});
|
|
162
184
|
//#endregion
|
|
163
185
|
//#region src/lib/cheapest-profile-contract.ts
|
|
186
|
+
/**
|
|
187
|
+
* Fixed identities for the literal `github-router claude -m cheapest` profile.
|
|
188
|
+
*
|
|
189
|
+
* The cheapest all-200K tier: a `gpt-5.6-luna`/max LEAD at Claude Code's
|
|
190
|
+
* DEFAULT (bare-slug) 200K window, every subagent at the same 200K default,
|
|
191
|
+
* a `gemini-3.8-flash`/high Advisor (bare slug), and a `gpt-5.6-sol`/high
|
|
192
|
+
* primary Oracle. Oracle-only peer set (no `astra`), same exact four-agent
|
|
193
|
+
* surface and authority structure as the cheap family.
|
|
194
|
+
*
|
|
195
|
+
* This module is deliberately dependency-free, including its own delegation
|
|
196
|
+
* graph literal: cheapest shares the cheap family's authority shape today,
|
|
197
|
+
* but each pinned profile owns its graph so tuning one roster cannot silently
|
|
198
|
+
* retune another.
|
|
199
|
+
*/
|
|
164
200
|
const CHEAPEST_PROFILE_MODELS = Object.freeze({
|
|
165
201
|
lead: "gpt-5.6-luna",
|
|
166
202
|
explore: "gpt-5.6-luna",
|
|
167
203
|
plan: "gpt-5.6-sol",
|
|
168
|
-
"
|
|
169
|
-
implementer: "gpt-5.6-luna",
|
|
204
|
+
"General-Purpose": "gpt-5.6-luna",
|
|
170
205
|
reviewer: "gemini-3.8-flash",
|
|
171
206
|
advisor: "gemini-3.8-flash",
|
|
172
207
|
oracle: "gpt-5.6-sol"
|
|
@@ -174,22 +209,19 @@ const CHEAPEST_PROFILE_MODELS = Object.freeze({
|
|
|
174
209
|
const CHEAPEST_PROFILE_NATIVE_AGENT_NAMES = [
|
|
175
210
|
"Explore",
|
|
176
211
|
"Plan",
|
|
177
|
-
"
|
|
178
|
-
"implementer",
|
|
212
|
+
"General-Purpose",
|
|
179
213
|
"reviewer"
|
|
180
214
|
];
|
|
181
215
|
const CHEAPEST_PROFILE_NATIVE_MODELS = Object.freeze({
|
|
182
216
|
Explore: CHEAPEST_PROFILE_MODELS.explore,
|
|
183
217
|
Plan: CHEAPEST_PROFILE_MODELS.plan,
|
|
184
|
-
"
|
|
185
|
-
implementer: CHEAPEST_PROFILE_MODELS.implementer,
|
|
218
|
+
"General-Purpose": CHEAPEST_PROFILE_MODELS["General-Purpose"],
|
|
186
219
|
reviewer: CHEAPEST_PROFILE_MODELS.reviewer
|
|
187
220
|
});
|
|
188
221
|
const CHEAPEST_PROFILE_NATIVE_EFFORTS = Object.freeze({
|
|
189
222
|
Explore: "high",
|
|
190
223
|
Plan: "high",
|
|
191
|
-
"
|
|
192
|
-
implementer: "max",
|
|
224
|
+
"General-Purpose": "max",
|
|
193
225
|
reviewer: "high"
|
|
194
226
|
});
|
|
195
227
|
/**
|
|
@@ -207,6 +239,70 @@ const CHEAPEST_PROFILE_ADVISOR_MODEL = CHEAPEST_PROFILE_MODELS.advisor;
|
|
|
207
239
|
const CHEAPEST_PROFILE_ADVISOR_CLIENT_MODEL = CHEAPEST_PROFILE_MODELS.advisor;
|
|
208
240
|
const CHEAPEST_PROFILE_ORACLE_MODEL = CHEAPEST_PROFILE_MODELS.oracle;
|
|
209
241
|
const CHEAPEST_PROFILE_ORACLE_EFFORT = "high";
|
|
242
|
+
Object.freeze({
|
|
243
|
+
Explore: Object.freeze([]),
|
|
244
|
+
Plan: Object.freeze(["Explore", "reviewer"]),
|
|
245
|
+
"General-Purpose": Object.freeze(["reviewer"]),
|
|
246
|
+
reviewer: Object.freeze([])
|
|
247
|
+
});
|
|
248
|
+
//#endregion
|
|
249
|
+
//#region src/lib/balanced-profile-contract.ts
|
|
250
|
+
/**
|
|
251
|
+
* Fixed identities for the literal `github-router claude -m balanced` profile.
|
|
252
|
+
*
|
|
253
|
+
* The most-complex-tasks tier: a `gpt-5.6-sol`/medium LEAD at Claude Code's
|
|
254
|
+
* DEFAULT (bare-slug) 200K window, every subagent at the same 200K default,
|
|
255
|
+
* a `gpt-5.6-sol`/medium Advisor (bare slug), and a `grok-4.6`/medium primary
|
|
256
|
+
* Oracle. Oracle-only peer set (no `astra`), same exact four-agent surface
|
|
257
|
+
* and authority structure as the cheap family minus `implementer`.
|
|
258
|
+
*
|
|
259
|
+
* This module is deliberately dependency-free, including its own delegation
|
|
260
|
+
* graph literal: balanced shares cheap's authority shape today, but each
|
|
261
|
+
* pinned profile owns its graph so tuning one roster cannot silently retune
|
|
262
|
+
* another. The PreToolUse ACL reads each profile's own graph.
|
|
263
|
+
*/
|
|
264
|
+
const BALANCED_PROFILE_MODELS = Object.freeze({
|
|
265
|
+
lead: "gpt-5.6-sol",
|
|
266
|
+
explore: "gpt-5.6-luna",
|
|
267
|
+
plan: "gpt-5.6-sol",
|
|
268
|
+
"General-Purpose": "gemini-3.8-flash",
|
|
269
|
+
reviewer: "gpt-5.6-luna",
|
|
270
|
+
advisor: "gpt-5.6-sol",
|
|
271
|
+
oracle: "grok-4.6",
|
|
272
|
+
astra: "gpt-6-astra"
|
|
273
|
+
});
|
|
274
|
+
const BALANCED_PROFILE_NATIVE_AGENT_NAMES = [
|
|
275
|
+
"Explore",
|
|
276
|
+
"Plan",
|
|
277
|
+
"General-Purpose",
|
|
278
|
+
"reviewer"
|
|
279
|
+
];
|
|
280
|
+
const BALANCED_PROFILE_NATIVE_MODELS = Object.freeze({
|
|
281
|
+
Explore: BALANCED_PROFILE_MODELS.explore,
|
|
282
|
+
Plan: BALANCED_PROFILE_MODELS.plan,
|
|
283
|
+
"General-Purpose": BALANCED_PROFILE_MODELS["General-Purpose"],
|
|
284
|
+
reviewer: BALANCED_PROFILE_MODELS.reviewer
|
|
285
|
+
});
|
|
286
|
+
const BALANCED_PROFILE_NATIVE_EFFORTS = Object.freeze({
|
|
287
|
+
Explore: "high",
|
|
288
|
+
Plan: "high",
|
|
289
|
+
"General-Purpose": "high",
|
|
290
|
+
reviewer: "max"
|
|
291
|
+
});
|
|
292
|
+
/**
|
|
293
|
+
* Subagent/peer context window (tokens). Every non-lead role (and the lead
|
|
294
|
+
* as well) runs at Claude Code's DEFAULT (bare-slug) budget — 200K.
|
|
295
|
+
*/
|
|
296
|
+
const BALANCED_PROFILE_SUBAGENT_CONTEXT_TOKENS = 2e5;
|
|
297
|
+
const BALANCED_PROFILE_ADVISOR_MODEL = BALANCED_PROFILE_MODELS.advisor;
|
|
298
|
+
BALANCED_PROFILE_MODELS.advisor;
|
|
299
|
+
const BALANCED_PROFILE_ORACLE_MODEL = BALANCED_PROFILE_MODELS.oracle;
|
|
300
|
+
Object.freeze({
|
|
301
|
+
Explore: Object.freeze([]),
|
|
302
|
+
Plan: Object.freeze(["Explore", "reviewer"]),
|
|
303
|
+
"General-Purpose": Object.freeze(["reviewer"]),
|
|
304
|
+
reviewer: Object.freeze([])
|
|
305
|
+
});
|
|
210
306
|
//#endregion
|
|
211
307
|
//#region src/lib/one-m-context.ts
|
|
212
308
|
/**
|
|
@@ -582,6 +678,12 @@ const CHEAP_LEAD_MODEL = CHEAP_PROFILE_MODELS.lead;
|
|
|
582
678
|
* the default budget.
|
|
583
679
|
*/
|
|
584
680
|
const CHEAPEST_LEAD_MODEL = CHEAPEST_PROFILE_MODELS.lead;
|
|
681
|
+
/**
|
|
682
|
+
* The lead `-m balanced` selects. Sol at the 200K DEFAULT window (BARE
|
|
683
|
+
* slug, no `[1m]`) — the most-complex-tasks tier runs every role, lead
|
|
684
|
+
* included, at the default budget.
|
|
685
|
+
*/
|
|
686
|
+
const BALANCED_LEAD_MODEL = BALANCED_PROFILE_MODELS.lead;
|
|
585
687
|
/** Small/fast tier for a budget lead, in the two forms this codebase needs.
|
|
586
688
|
*
|
|
587
689
|
* `SLUG` is the Anthropic-published DASHED form and is what goes into
|
|
@@ -604,15 +706,18 @@ const BUDGET_SMALL_FAST_CATALOG_ID = "claude-haiku-4.5";
|
|
|
604
706
|
* leader at the 200K DEFAULT window, no astra peer)
|
|
605
707
|
* - `cheapest` → `CHEAPEST_LEAD_MODEL` BARE (the cheapest launch: Luna
|
|
606
708
|
* leader at the 200K DEFAULT window, no astra peer)
|
|
709
|
+
* - `balanced` → `BALANCED_LEAD_MODEL` BARE (the most-complex-tasks
|
|
710
|
+
* launch: Sol leader at the 200K DEFAULT window, Grok
|
|
711
|
+
* Oracle, no astra peer)
|
|
607
712
|
* - `N.M` → the best variant of that Opus family, via `pickClaudeDefault`
|
|
608
713
|
* - a full slug → unchanged, including Copilot slugs a power user pins
|
|
609
714
|
* - absent → the ordinary default
|
|
610
715
|
*
|
|
611
|
-
* Every branch except `cheap`/`cheapest` is `[1m]`-decorated against the
|
|
716
|
+
* Every branch except `cheap`/`cheapest`/`balanced` is `[1m]`-decorated against the
|
|
612
717
|
* live catalog, by `pickClaudeDefault` on the two Opus-family branches and
|
|
613
718
|
* by `withOneMSuffixForLead` on the rest — the decoration is catalog-gated
|
|
614
719
|
* per model, so a genuinely 200K model (`claude-haiku-4-5`) still comes back
|
|
615
|
-
* bare. `cheap`/`cheapest` deliberately skip the decoration entirely because
|
|
720
|
+
* bare. `cheap`/`cheapest`/`balanced` deliberately skip the decoration entirely because
|
|
616
721
|
* their whole cost lever is the 200K default lead window.
|
|
617
722
|
*
|
|
618
723
|
* `fast` resolves to an ordinary slug rather than setting a mode flag —
|
|
@@ -638,6 +743,7 @@ function resolveLeadSlugArg(modelArg) {
|
|
|
638
743
|
if (arg.toLowerCase() === "cheap1m") return withOneMSuffixForLead(CHEAP_LEAD_MODEL);
|
|
639
744
|
if (arg.toLowerCase() === "cheap") return CHEAP_LEAD_MODEL;
|
|
640
745
|
if (arg.toLowerCase() === "cheapest") return CHEAPEST_LEAD_MODEL;
|
|
746
|
+
if (arg.toLowerCase() === "balanced") return BALANCED_LEAD_MODEL;
|
|
641
747
|
const opusFamilyShorthand = arg.match(/^(\d+\.\d+)$/)?.[1];
|
|
642
748
|
if (opusFamilyShorthand) return pickClaudeDefault(opusFamilyShorthand);
|
|
643
749
|
return withOneMSuffixForLead(arg);
|
|
@@ -19095,7 +19201,7 @@ function logAudit$1(record) {
|
|
|
19095
19201
|
try {
|
|
19096
19202
|
const fs = await import("node:fs/promises");
|
|
19097
19203
|
const path = await import("node:path");
|
|
19098
|
-
const { PATHS } = await import("./paths-
|
|
19204
|
+
const { PATHS } = await import("./paths-BzM6uxmd.js");
|
|
19099
19205
|
const dir = path.join(PATHS.APP_DIR, "browser-mcp");
|
|
19100
19206
|
await fs.mkdir(dir, { recursive: true });
|
|
19101
19207
|
const line = JSON.stringify({
|
|
@@ -27888,8 +27994,8 @@ function generalPurposeFastModel() {
|
|
|
27888
27994
|
/** @deprecated Fast `scout` was renamed to capitalized `Explore`. */
|
|
27889
27995
|
const FAST_SCOUT_MODEL = FAST_PROFILE_NATIVE_MODELS.Explore;
|
|
27890
27996
|
const FAST_PLAN_MODEL = FAST_PROFILE_NATIVE_MODELS.Plan;
|
|
27891
|
-
const FAST_GENERAL_PURPOSE_MODEL = FAST_PROFILE_NATIVE_MODELS["
|
|
27892
|
-
|
|
27997
|
+
const FAST_GENERAL_PURPOSE_MODEL = FAST_PROFILE_NATIVE_MODELS["General-Purpose"];
|
|
27998
|
+
FAST_PROFILE_MODELS.gemini;
|
|
27893
27999
|
/** Grok 4.6 advertises 500K total context / 372K max prompt, so it remains bare
|
|
27894
28000
|
* and is gated by max_prompt_tokens rather than the 1M floor. */
|
|
27895
28001
|
const FAST_REVIEWER_MODEL = FAST_PROFILE_NATIVE_MODELS.reviewer;
|
|
@@ -27898,8 +28004,8 @@ const FAST_ORACLE_MODEL = FAST_PROFILE_ORACLE_MODEL;
|
|
|
27898
28004
|
/** Fixed effort pins for the fast profile. */
|
|
27899
28005
|
const FAST_EXPLORE_EFFORT = FAST_PROFILE_NATIVE_EFFORTS.Explore;
|
|
27900
28006
|
const FAST_PLAN_EFFORT = FAST_PROFILE_NATIVE_EFFORTS.Plan;
|
|
27901
|
-
const FAST_GENERAL_PURPOSE_EFFORT = FAST_PROFILE_NATIVE_EFFORTS["
|
|
27902
|
-
|
|
28007
|
+
const FAST_GENERAL_PURPOSE_EFFORT = FAST_PROFILE_NATIVE_EFFORTS["General-Purpose"];
|
|
28008
|
+
FAST_PROFILE_NATIVE_EFFORTS["General-Purpose"];
|
|
27903
28009
|
const FAST_REVIEWER_EFFORT = FAST_PROFILE_NATIVE_EFFORTS.reviewer;
|
|
27904
28010
|
const FAST_ORACLE_EFFORT = FAST_PROFILE_ORACLE_EFFORT;
|
|
27905
28011
|
const FAST_ADVISOR_EFFORT = FAST_PROFILE_ADVISOR_EFFORT;
|
|
@@ -27935,17 +28041,6 @@ function fastGeneralPurposeModel() {
|
|
|
27935
28041
|
const found = state.models?.data.find((m) => m.id === id);
|
|
27936
28042
|
const efforts = found?.capabilities?.supports?.reasoning_effort;
|
|
27937
28043
|
if (!Array.isArray(efforts) || !efforts.includes(FAST_GENERAL_PURPOSE_EFFORT)) return void 0;
|
|
27938
|
-
return found && fastEndpointForModel(found) === "responses" ? id : void 0;
|
|
27939
|
-
}
|
|
27940
|
-
function fastImplementerModel() {
|
|
27941
|
-
const id = firstPresentInCatalog([FAST_IMPLEMENTER_MODEL], {
|
|
27942
|
-
requireToolCalls: true,
|
|
27943
|
-
minContextTokens: ONE_M_TOKENS
|
|
27944
|
-
});
|
|
27945
|
-
if (!id) return void 0;
|
|
27946
|
-
const found = state.models?.data.find((m) => m.id === id);
|
|
27947
|
-
const efforts = found?.capabilities?.supports?.reasoning_effort;
|
|
27948
|
-
if (!Array.isArray(efforts) || !efforts.includes(FAST_IMPLEMENTER_EFFORT)) return void 0;
|
|
27949
28044
|
return found && fastEndpointForModel(found) === "chat" ? id : void 0;
|
|
27950
28045
|
}
|
|
27951
28046
|
/** Sonnet 5 1M xhigh reviewer for Fast profile. */
|
|
@@ -28009,7 +28104,7 @@ function cheapAdvisorModel() {
|
|
|
28009
28104
|
if ((found.capabilities?.limits?.max_context_window_tokens ?? 0) < 2e5) return void 0;
|
|
28010
28105
|
if (found.capabilities?.supports?.tool_calls !== true) return void 0;
|
|
28011
28106
|
const efforts = found.capabilities?.supports?.reasoning_effort;
|
|
28012
|
-
if (!Array.isArray(efforts) || !efforts.includes("
|
|
28107
|
+
if (!Array.isArray(efforts) || !efforts.includes("medium")) return void 0;
|
|
28013
28108
|
if (fastEndpointForModel(found) !== "responses") return void 0;
|
|
28014
28109
|
return CHEAP_PROFILE_ADVISOR_MODEL;
|
|
28015
28110
|
}
|
|
@@ -28083,6 +28178,39 @@ function cheapAstraModel() {
|
|
|
28083
28178
|
if (fastEndpointForModel(found) !== "responses") return void 0;
|
|
28084
28179
|
return CHEAP_PROFILE_ASTRA_MODEL;
|
|
28085
28180
|
}
|
|
28181
|
+
/** Sol/high Advisor for the balanced profile at the 200K default window. */
|
|
28182
|
+
function balancedAdvisorModel() {
|
|
28183
|
+
const found = state.models?.data.find((m) => m.id === BALANCED_PROFILE_ADVISOR_MODEL);
|
|
28184
|
+
if (!found) return void 0;
|
|
28185
|
+
if ((found.capabilities?.limits?.max_context_window_tokens ?? 0) < 2e5) return void 0;
|
|
28186
|
+
if (found.capabilities?.supports?.tool_calls !== true) return void 0;
|
|
28187
|
+
const efforts = found.capabilities?.supports?.reasoning_effort;
|
|
28188
|
+
if (!Array.isArray(efforts) || !efforts.includes("medium")) return void 0;
|
|
28189
|
+
if (fastEndpointForModel(found) !== "responses") return void 0;
|
|
28190
|
+
return BALANCED_PROFILE_ADVISOR_MODEL;
|
|
28191
|
+
}
|
|
28192
|
+
/** Exact Grok 4.6 only: the balanced Oracle at 200K/medium, like cheap. */
|
|
28193
|
+
function balancedOracleModel() {
|
|
28194
|
+
const found = state.models?.data.find((m) => m.id === BALANCED_PROFILE_ORACLE_MODEL);
|
|
28195
|
+
if (!found) return void 0;
|
|
28196
|
+
if ((found.capabilities?.limits?.max_context_window_tokens ?? 0) < 2e5) return void 0;
|
|
28197
|
+
if ((found.capabilities?.limits?.max_prompt_tokens ?? 0) <= 0) return void 0;
|
|
28198
|
+
const efforts = found.capabilities?.supports?.reasoning_effort;
|
|
28199
|
+
if (!Array.isArray(efforts) || !efforts.includes("medium")) return void 0;
|
|
28200
|
+
if (fastEndpointForModel(found) !== "responses") return void 0;
|
|
28201
|
+
return BALANCED_PROFILE_ORACLE_MODEL;
|
|
28202
|
+
}
|
|
28203
|
+
/** Luna/max reviewer for the balanced profile at the 200K default window. */
|
|
28204
|
+
function balancedReviewerModel() {
|
|
28205
|
+
const found = state.models?.data.find((m) => m.id === BALANCED_PROFILE_MODELS.reviewer);
|
|
28206
|
+
if (!found) return void 0;
|
|
28207
|
+
if (found.capabilities?.supports?.tool_calls !== true) return void 0;
|
|
28208
|
+
if ((found.capabilities?.limits?.max_context_window_tokens ?? 0) < 2e5) return void 0;
|
|
28209
|
+
const efforts = found.capabilities?.supports?.reasoning_effort;
|
|
28210
|
+
if (!Array.isArray(efforts) || !efforts.includes(BALANCED_PROFILE_NATIVE_EFFORTS.reviewer)) return void 0;
|
|
28211
|
+
if (fastEndpointForModel(found) !== "responses") return void 0;
|
|
28212
|
+
return BALANCED_PROFILE_MODELS.reviewer;
|
|
28213
|
+
}
|
|
28086
28214
|
/**
|
|
28087
28215
|
* Gate for the worker tools (`explore`, `review`, `implement`).
|
|
28088
28216
|
*
|
|
@@ -28498,7 +28626,7 @@ function fastToolIsEnabled(tool) {
|
|
|
28498
28626
|
}
|
|
28499
28627
|
/** Shared Fast projection for list and call, including non-persona dispatch kind. */
|
|
28500
28628
|
function fastAllowsTool(scope, launch, item) {
|
|
28501
|
-
if (launch.profileId !== "fast" && launch.profileId !== "cheap" && launch.profileId !== "cheap1m" && launch.profileId !== "cheapest") return true;
|
|
28629
|
+
if (launch.profileId !== "fast" && launch.profileId !== "cheap" && launch.profileId !== "cheap1m" && launch.profileId !== "cheapest" && launch.profileId !== "balanced") return true;
|
|
28502
28630
|
if (scope !== "all" && item.group !== scope) return false;
|
|
28503
28631
|
if (!launch.allowedGroups?.has(item.group)) return false;
|
|
28504
28632
|
if (item.persona) return false;
|
|
@@ -28550,12 +28678,13 @@ function toolEntries(scope, launch, audience = "shared") {
|
|
|
28550
28678
|
}));
|
|
28551
28679
|
return [...personaEntries, ...nonPersonaEntries];
|
|
28552
28680
|
}
|
|
28553
|
-
if (launch.profileId === "fast" || launch.profileId === "cheap" || launch.profileId === "cheap1m" || launch.profileId === "cheapest") {
|
|
28554
|
-
const isCheap = launch.profileId === "cheap" || launch.profileId === "cheap1m" || launch.profileId === "cheapest";
|
|
28681
|
+
if (launch.profileId === "fast" || launch.profileId === "cheap" || launch.profileId === "cheap1m" || launch.profileId === "cheapest" || launch.profileId === "balanced") {
|
|
28682
|
+
const isCheap = launch.profileId === "cheap" || launch.profileId === "cheap1m" || launch.profileId === "cheapest" || launch.profileId === "balanced";
|
|
28555
28683
|
const isCheapest = launch.profileId === "cheapest";
|
|
28684
|
+
const isBalanced = launch.profileId === "balanced";
|
|
28556
28685
|
const astraWired = launch.profileId === "fast" || launch.profileId === "cheap1m";
|
|
28557
28686
|
const astraAvailable = astraWired && (isCheap && !isCheapest ? cheapAstraModel() : isCheapest ? void 0 : fastAstraModel()) != null;
|
|
28558
|
-
const oracleGate = isCheapest ? cheapestOracleModel() : isCheap ? cheapOracleModel() : fastOracleModel();
|
|
28687
|
+
const oracleGate = isCheapest ? cheapestOracleModel() : isBalanced ? balancedOracleModel() : isCheap ? cheapOracleModel() : fastOracleModel();
|
|
28559
28688
|
const oracleDescriptor = isCheapest ? "GPT-5.6 Sol (200K context, high effort)" : void 0;
|
|
28560
28689
|
const entries = [];
|
|
28561
28690
|
if ((scope === "all" || scope === "peers") && launch.allowedGroups?.has("peers") && launch.allowedPersonas?.has("oracle") && oracleGate) entries.push(oracleToolEntry(isCheap, astraAvailable, oracleDescriptor));
|
|
@@ -29005,7 +29134,7 @@ async function handleToolsCall(body, scope, launch, audience = "shared", session
|
|
|
29005
29134
|
tool: maxTool
|
|
29006
29135
|
}) : false)) return rpcError(body.id, RPC_METHOD_NOT_FOUND, `tools/call: unknown tool "${name}"`);
|
|
29007
29136
|
}
|
|
29008
|
-
if ((launch.profileId === "fast" || launch.profileId === "cheap" || launch.profileId === "cheap1m" || launch.profileId === "cheapest") && name !== "oracle" && name !== "astra") {
|
|
29137
|
+
if ((launch.profileId === "fast" || launch.profileId === "cheap" || launch.profileId === "cheap1m" || launch.profileId === "cheapest" || launch.profileId === "balanced") && name !== "oracle" && name !== "astra") {
|
|
29009
29138
|
const fastPersona = activePersonas(launch).find((persona) => persona.toolNameHttp === name);
|
|
29010
29139
|
const fastTool = NON_PERSONA_MCP_TOOLS.find((tool) => tool.toolNameHttp === name);
|
|
29011
29140
|
if (!(fastPersona ? fastAllowsTool(scope, launch, {
|
|
@@ -29090,13 +29219,14 @@ async function handleToolsCall(body, scope, launch, audience = "shared", session
|
|
|
29090
29219
|
release();
|
|
29091
29220
|
}
|
|
29092
29221
|
}
|
|
29093
|
-
if ((launch.profileId === "fast" || launch.profileId === "cheap" || launch.profileId === "cheap1m" || launch.profileId === "cheapest") && name === "oracle") {
|
|
29222
|
+
if ((launch.profileId === "fast" || launch.profileId === "cheap" || launch.profileId === "cheap1m" || launch.profileId === "cheapest" || launch.profileId === "balanced") && name === "oracle") {
|
|
29094
29223
|
const isCheapestOracle = launch.profileId === "cheapest";
|
|
29095
|
-
const
|
|
29224
|
+
const isBalancedOracle = launch.profileId === "balanced";
|
|
29225
|
+
const isCheapOracle = launch.profileId === "cheap" || launch.profileId === "cheap1m" || isCheapestOracle || isBalancedOracle;
|
|
29096
29226
|
const oracleModel = isCheapestOracle ? CHEAPEST_PROFILE_ORACLE_MODEL : isCheapOracle ? CHEAP_PROFILE_ORACLE_MODEL : "claude-opus-5";
|
|
29097
29227
|
const oracleEndpoint = isCheapOracle ? "/v1/responses" : "/v1/messages";
|
|
29098
29228
|
const oracleEffort = isCheapestOracle ? CHEAPEST_PROFILE_ORACLE_EFFORT : isCheapOracle ? CHEAP_PROFILE_ORACLE_EFFORT : "high";
|
|
29099
|
-
if (scope !== "all" && scope !== "peers" || !launch.allowedGroups?.has("peers") || !launch.allowedPersonas?.has("oracle") || !(isCheapestOracle ? cheapestOracleModel() : isCheapOracle ? cheapOracleModel() : fastOracleModel())) return rpcError(body.id, RPC_METHOD_NOT_FOUND, `tools/call: unknown tool "${name}"`);
|
|
29229
|
+
if (scope !== "all" && scope !== "peers" || !launch.allowedGroups?.has("peers") || !launch.allowedPersonas?.has("oracle") || !(isCheapestOracle ? cheapestOracleModel() : isBalancedOracle ? balancedOracleModel() : isCheapOracle ? cheapOracleModel() : fastOracleModel())) return rpcError(body.id, RPC_METHOD_NOT_FOUND, `tools/call: unknown tool "${name}"`);
|
|
29100
29230
|
const query = typeof args.query === "string" ? args.query.trim() : "";
|
|
29101
29231
|
const context = typeof args.context === "string" ? args.context.trim() : "";
|
|
29102
29232
|
if (!query || !context) return rpcError(body.id, RPC_INVALID_PARAMS, "tools/call: oracle requires non-empty arguments.query and arguments.context");
|
|
@@ -29163,7 +29293,7 @@ async function handleToolsCall(body, scope, launch, audience = "shared", session
|
|
|
29163
29293
|
release();
|
|
29164
29294
|
}
|
|
29165
29295
|
}
|
|
29166
|
-
if ((launch.profileId === "fast" || launch.profileId === "cheap" || launch.profileId === "cheap1m" || launch.profileId === "cheapest") && PERSONAS_READ.some((p) => p.toolNameHttp === name)) return rpcError(body.id, RPC_METHOD_NOT_FOUND, `tools/call: unknown tool "${name}"`);
|
|
29296
|
+
if ((launch.profileId === "fast" || launch.profileId === "cheap" || launch.profileId === "cheap1m" || launch.profileId === "cheapest" || launch.profileId === "balanced") && PERSONAS_READ.some((p) => p.toolNameHttp === name)) return rpcError(body.id, RPC_METHOD_NOT_FOUND, `tools/call: unknown tool "${name}"`);
|
|
29167
29297
|
const persona = activePersonas(launch).find((p) => p.toolNameHttp === name);
|
|
29168
29298
|
const nonPersonaTool = persona ? void 0 : NON_PERSONA_MCP_TOOLS.find((t) => t.toolNameHttp === name);
|
|
29169
29299
|
if (!persona && !nonPersonaTool) return rpcError(body.id, RPC_METHOD_NOT_FOUND, `tools/call: unknown tool "${name}"`);
|
|
@@ -30921,6 +31051,7 @@ function buildAdvisorStream(opts) {
|
|
|
30921
31051
|
let pendingMessageDelta = null;
|
|
30922
31052
|
let pendingCopilotNano = 0;
|
|
30923
31053
|
const pendingCopilotDetails = [];
|
|
31054
|
+
let aicRecordedThisTurn = false;
|
|
30924
31055
|
const leadModelForAic = typeof opts.baseBody.model === "string" && opts.baseBody.model.length > 0 ? opts.baseBody.model : void 0;
|
|
30925
31056
|
const safeEnqueue = (bytes) => {
|
|
30926
31057
|
try {
|
|
@@ -30949,11 +31080,12 @@ function buildAdvisorStream(opts) {
|
|
|
30949
31080
|
}
|
|
30950
31081
|
for (const [key, value] of Object.entries(usage)) if (typeof value === "number" && Number.isFinite(value)) pendingMessageDelta.usage[key] = (pendingMessageDelta.usage[key] ?? 0) + value;
|
|
30951
31082
|
const turnAic = extractCopilotUsage(payload.copilot_usage);
|
|
30952
|
-
if (turnAic)
|
|
30953
|
-
|
|
30954
|
-
|
|
30955
|
-
|
|
30956
|
-
|
|
31083
|
+
if (!turnAic || turnAic.totalNanoAiu <= 0) return;
|
|
31084
|
+
if (aicRecordedThisTurn) return;
|
|
31085
|
+
aicRecordedThisTurn = true;
|
|
31086
|
+
pendingCopilotNano += turnAic.totalNanoAiu;
|
|
31087
|
+
pendingCopilotDetails.push(...turnAic.tokenDetails);
|
|
31088
|
+
recordAic(leadModelForAic, turnAic);
|
|
30957
31089
|
};
|
|
30958
31090
|
const emitTerminal = (forcedStopReason) => {
|
|
30959
31091
|
if (pendingMessageDelta || forcedStopReason) {
|
|
@@ -30984,6 +31116,7 @@ function buildAdvisorStream(opts) {
|
|
|
30984
31116
|
return safeEnqueueEvent("message_stop", { type: "message_stop" });
|
|
30985
31117
|
};
|
|
30986
31118
|
async function processOneTurn(response) {
|
|
31119
|
+
aicRecordedThisTurn = false;
|
|
30987
31120
|
const capturedBlocks = [];
|
|
30988
31121
|
const advisorToolUses = [];
|
|
30989
31122
|
let clientToolUseCount = 0;
|
|
@@ -36279,11 +36412,12 @@ function buildPeerAwarenessSnippet(opts) {
|
|
|
36279
36412
|
`\`mcp__${searchKey}__code\` provides semantic-first code search and \`mcp__${searchKey}__web\` provides citable web sources. Advisor is transcript-aware, primary-lead-only, and unavailable to native subagents and browse workers; it can detect framing drift but is not independent verification.${browserClause}${workerClause}${decideClause}${fleetClause}${agentsClause}${artifactClause}`
|
|
36280
36413
|
].join("\n");
|
|
36281
36414
|
}
|
|
36282
|
-
if (opts.profile === "fast" || opts.profile === "cheap" || opts.profile === "cheap1m" || opts.profile === "cheapest") {
|
|
36415
|
+
if (opts.profile === "fast" || opts.profile === "cheap" || opts.profile === "cheap1m" || opts.profile === "cheapest" || opts.profile === "balanced") {
|
|
36283
36416
|
const isCheap = opts.profile === "cheap" || opts.profile === "cheap1m";
|
|
36284
36417
|
const isCheapest = opts.profile === "cheapest";
|
|
36285
|
-
const
|
|
36286
|
-
const
|
|
36418
|
+
const isBalanced = opts.profile === "balanced";
|
|
36419
|
+
const profileLabel = isCheapest ? "cheapest" : isCheap ? "cheap" : isBalanced ? "balanced" : "fast";
|
|
36420
|
+
const oracleDescriptor = isCheapest ? "GPT-5.6 Sol (200K/high)" : isCheap || isBalanced ? "Grok 4.6 (200K/medium)" : "exact Opus 5 (1M/high)";
|
|
36287
36421
|
const astraDescriptor = isCheap && !isCheapest ? "200K/medium" : "200K/high";
|
|
36288
36422
|
const fastPeersKey = key("peers");
|
|
36289
36423
|
const fastSearchKey = key("search");
|
|
@@ -36292,13 +36426,16 @@ function buildPeerAwarenessSnippet(opts) {
|
|
|
36292
36426
|
const browserClause = opts.browserToolsAvailable ?? opts.browseAvailable ? ` \`mcp__${fastBrowserKey}__*\` is the opt-in browser surface.` : "";
|
|
36293
36427
|
const workerBrowseClause = opts.browseAvailable ? ` \`worker-browse\` runs delegated browsing tasks through \`mcp__${fastWorkersKey}__browse\`.` : "";
|
|
36294
36428
|
const artifactClause = opts.artifactToolsAvailable ? ` \`mcp__${fastPeersKey}__artifact_*\` provides artifact review with auto-open on plan completion.` : "";
|
|
36429
|
+
const astraClause = opts.astraAvailable && (opts.profile === "fast" || opts.profile === "cheap1m") ? ` \`mcp__${fastPeersKey}__astra\` is GPT-6 Astra (${astraDescriptor}), an expensive terminal escalation consultant available to the lead only for hardest dead ends.` : "";
|
|
36430
|
+
const searchClause = opts.semanticSearchAvailable === true ? `\`mcp__${fastSearchKey}__code\` is semantic-first code search (meaning-ranked; start lexical with mode:"lexical"/"exact" for symbols, filenames, errors, and config keys, then semantic for concepts) and \`mcp__${fastSearchKey}__web\` surfaces citable sources.` : `\`mcp__${fastSearchKey}__code\` is lexical code search (mode:"lexical"/"exact" for symbols, filenames, errors, and config keys; no model call) and \`mcp__${fastSearchKey}__web\` surfaces citable sources.`;
|
|
36431
|
+
const rosterClause = isCheapest ? "Native Task roster: `Explore` (broad repository discovery spanning more than a couple of files), `Plan` (sequencing, interfaces, migration risk, acceptance criteria in plan mode), `General-Purpose` (mixed investigation and execution, follows a Plan handoff when one exists), and `reviewer` (repo-aware verification of behavior-changing or risk-sensitive changes). Handle straightforward tasks directly and verify claims with concrete repository evidence and tests before declaring done." : "Native Task roster: `Explore` (mandatory cheap broad discovery, launch in parallel; lead/`Plan` delegate rather than self-sweep), `Plan` (sequencing, interfaces, migration risk, acceptance criteria in plan mode; delegate discovery to `Explore` and write handoff-ready steps for `General-Purpose`), `General-Purpose` (mixed execution; follows a Plan handoff when one exists and drives to a verified end state), and `reviewer` (repo-aware verification after non-trivial changes, before done). In plan mode, delegate planning to `Plan` and do not edit files. Verify claims with concrete repository evidence and tests before declaring done.";
|
|
36295
36432
|
return [
|
|
36296
36433
|
"## Peer review and advisor",
|
|
36297
36434
|
"",
|
|
36298
|
-
`This is the ${profileLabel} launch profile. Follow an evidence-first escalation ladder: settle factual claims directly through code, tests, and builds. Advisor is an optional, non-binding, lead-only transcript-aware sounding board for trajectory guidance, framing checks, or conflicting signals (direction, not dictation), not routine progress, waiting, verification, or completion. \`mcp__${fastPeersKey}__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.${
|
|
36435
|
+
`This is the ${profileLabel} launch profile. Follow an evidence-first escalation ladder: settle factual claims directly through code, tests, and builds. Advisor is an optional, non-binding, lead-only transcript-aware sounding board for trajectory guidance, framing checks, or conflicting signals (direction, not dictation), not routine progress, waiting, verification, or completion. \`mcp__${fastPeersKey}__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.${astraClause}`,
|
|
36299
36436
|
"",
|
|
36300
|
-
|
|
36301
|
-
"Native delegation is ACL-scoped: the lead may invoke all
|
|
36437
|
+
`${searchClause} ${rosterClause}${browserClause}${workerBrowseClause}${artifactClause}`,
|
|
36438
|
+
"Native delegation is ACL-scoped: the lead may invoke all four; `Plan` may invoke `Explore` and `reviewer`; `General-Purpose` may invoke `reviewer`; `Explore`, `reviewer`, and `worker-browse` cannot invoke native subagents."
|
|
36302
36439
|
].join("\n");
|
|
36303
36440
|
}
|
|
36304
36441
|
const peersKey = key("peers");
|
|
@@ -36360,11 +36497,12 @@ function buildPeerAwarenessSummary(opts) {
|
|
|
36360
36497
|
"Max native roster: `Explore` for broad discovery; `Plan` for interfaces, sequencing, risks, and acceptance criteria; `general-purpose` for bounded mixed execution; `implementer` for settled coding changes; `reviewer` for repository-aware verification and reproduction; `brainstorm` for materially different open approaches; and `peer-review-coordinator` for several distinct fresh-context review lenses. Configured models are deliberate role defaults.",
|
|
36361
36498
|
"Native roles can inspect the repository within their listed tools. Fresh-context peers see only the artifact and constraints supplied to them. Advisor is transcript-aware, optional, non-binding, and primary-lead-only; it can identify framing drift but is not independent verification or an approval gate. Detailed routing lives in each role or tool description, and the full gated capability inventory lives in CLAUDE.md."
|
|
36362
36499
|
].join("\n");
|
|
36363
|
-
if (opts.profile === "fast" || opts.profile === "cheap" || opts.profile === "cheap1m" || opts.profile === "cheapest") {
|
|
36500
|
+
if (opts.profile === "fast" || opts.profile === "cheap" || opts.profile === "cheap1m" || opts.profile === "cheapest" || opts.profile === "balanced") {
|
|
36364
36501
|
const isCheap = opts.profile === "cheap" || opts.profile === "cheap1m";
|
|
36365
36502
|
const isCheapest = opts.profile === "cheapest";
|
|
36366
|
-
const
|
|
36367
|
-
const
|
|
36503
|
+
const isBalanced = opts.profile === "balanced";
|
|
36504
|
+
const profileLabel = isCheapest ? "Cheapest" : isCheap ? "Cheap" : isBalanced ? "Balanced" : "Fast";
|
|
36505
|
+
const oracleDescriptor = isCheapest ? "GPT-5.6 Sol (200K/high)" : isCheap || isBalanced ? "Grok 4.6 (200K/medium)" : "exact Opus 5 (1M/high)";
|
|
36368
36506
|
const astraDescriptor = isCheap && !isCheapest ? "200K/medium" : "200K/high";
|
|
36369
36507
|
const browserClause = opts.browserToolsAvailable ?? opts.browseAvailable ? ` \`mcp__${key("browser")}__*\` provides the opt-in browser.` : "";
|
|
36370
36508
|
const workerBrowseClause = opts.browseAvailable ? ` \`worker-browse\` runs delegated browsing tasks through \`mcp__${key("workers")}__browse\`.` : "";
|
|
@@ -36372,8 +36510,8 @@ function buildPeerAwarenessSummary(opts) {
|
|
|
36372
36510
|
return [
|
|
36373
36511
|
"## Injected capabilities (summary)",
|
|
36374
36512
|
"",
|
|
36375
|
-
`${profileLabel} launch profile. Task roster: \`Explore\` (
|
|
36376
|
-
"Native delegation is ACL-scoped: the lead may invoke all
|
|
36513
|
+
isCheapest ? `${profileLabel} launch profile. Task roster: \`Explore\` (broad discovery), \`Plan\` (planning in plan mode), \`General-Purpose\` (mixed execution), \`reviewer\` (verification of behavior-changing or risk-sensitive changes). Handle straightforward tasks directly. Verify claims with concrete repository evidence and tests before declaring done.` : `${profileLabel} launch profile. Task roster: \`Explore\` (mandatory parallel discovery delegate), \`Plan\` (planning in plan mode, writes handoff-ready steps for \`General-Purpose\`), \`General-Purpose\` (mixed execution, follows a Plan handoff when one exists), \`reviewer\` (verification after implementation, before done). Verify claims with concrete repository evidence and tests before declaring done.`,
|
|
36514
|
+
"Native delegation is ACL-scoped: the lead may invoke all four; `Plan` may invoke `Explore` and `reviewer`; `General-Purpose` may invoke `reviewer`; `Explore`, `reviewer`, and `worker-browse` cannot invoke native subagents.",
|
|
36377
36515
|
`Advisor is optional, non-binding, transcript-aware, and lead-only for trajectory guidance or framing checks (direction, not dictation). \`mcp__${key("peers")}__oracle\` is ${oracleDescriptor}, an expert consultant for the lead and \`Plan\`, preferred over advisor for substantive trade-offs.${astraClause} \`mcp__${key("search")}__code\` and \`mcp__${key("search")}__web\` provide search.${browserClause}${workerBrowseClause}${opts.artifactToolsAvailable ? ` \`mcp__${key("peers")}__artifact_*\` provides human review with plan auto-open.` : ""}`
|
|
36378
36516
|
].join("\n");
|
|
36379
36517
|
}
|
|
@@ -37759,6 +37897,6 @@ function enumerateInjectedMcpToolNames(groupKeys, opts = {}) {
|
|
|
37759
37897
|
return [...new Set(names)];
|
|
37760
37898
|
}
|
|
37761
37899
|
//#endregion
|
|
37762
|
-
export { EFFORT_ORDER as $,
|
|
37900
|
+
export { EFFORT_ORDER as $, withInstallLock as $n, MAX_RESPONSE_BODY_BYTES as $t, TOOLBELT_TOOLS$1 as A, upstreamMaxConnections as An, implementerFastModel as At, resolveAdvisorEffort as B, BALANCED_PROFILE_SUBAGENT_CONTEXT_TOKENS as Bn, countTokens as Bt, runWorkerAgent as C, UPSTREAM_FETCH_TIMEOUT_MS as Cn, fastOracleModel as Ct, toolbeltEnabled as D, pickClaudeDefault as Dn, fleetToolsEnabled as Dt, buildToolbeltAwareness as E, isBudgetClaudeLead as En, fastScoutModel as Et, ADVISOR_TOOL_INSTRUCTIONS as F, withOneMSuffixForLead as Fn, scoutModel as Ft, repairKnownThinkingHistory as G, CHEAPEST_PROFILE_NATIVE_MODELS as Gn, findLaunchBySecret as Gt, resolveCheapestAdvisorModel as H, CHEAPEST_PROFILE_MODELS as Hn, getTextTokenCount as Ht, FAST_ADVISOR_TOOL_INSTRUCTIONS as I, BALANCED_PROFILE_MODELS as In, scribeModel as It, buildOpenAIErrorEvent as J, CHEAP_PROFILE_MODELS as Jn, assembleResponsesPayload as Jt, repairRejectedThinkingHistory as K, CHEAPEST_PROFILE_SUBAGENT_CONTEXT_TOKENS as Kn, registerLaunch as Kt, buildAdvisorStream as L, BALANCED_PROFILE_NATIVE_AGENT_NAMES as Ln, standInToolEnabled as Lt, satisfiesMinVersion as M, catalogAdvertises1M as Mn, resolveGeminiReviewModel as Mt, searchWeb as N, oneMContextDisabled as Nn, reviewerFastModel as Nt, toolbeltSkipSet as O, resolveLeadSlugArg as On, geminiAvailable as Ot, ADVISOR_INTERNAL_TOOL_NAME as P, withOneMSuffix as Pn, reviewerModel as Pt, relayAnthropicStream as Q, CHEAP_PROFILE_SUBAGENT_CONTEXT_TOKENS as Qn, createChatCompletions as Qt, injectAdvisorTool as R, BALANCED_PROFILE_NATIVE_EFFORTS as Rn, workerToolsEnabled as Rt, resolveWorkerRunOpts as S, DEFAULT_PORT as Sn, fastGeneralPurposeModel as St, availableToolCommands as T, generateRandomPort as Tn, fastReviewerModel as Tt, formatThinkingRepairDecline as U, CHEAPEST_PROFILE_NATIVE_AGENT_NAMES as Un, getTokenCount as Ut, resolveAdvisorModel as V, CHEAPEST_PROFILE_ADVISOR_CLIENT_MODEL as Vn, createMessages as Vt, rememberThinkingHistoryRepair as W, CHEAPEST_PROFILE_NATIVE_EFFORTS as Wn, getTokenizerFromModel as Wt, logStreamError as X, CHEAP_PROFILE_NATIVE_EFFORTS as Xn, resolveMcpToolTimeoutMs as Xt, isControllerClosedError as Y, CHEAP_PROFILE_NATIVE_AGENT_NAMES as Yn, warnOnTokenPriceDrift as Yt, readIteratorWithTimeout as Z, CHEAP_PROFILE_NATIVE_MODELS as Zn, createResponses as Zt, REVIEW_DEFAULT_MODEL as _, BUDGET_SMALL_FAST_CATALOG_ID as _n, cheapestAdvisorModel as _t, buildAgentPrompt as a, colbertDegradedWarning as an, agentToolsEnabled as at, resolveDefaultModel as b, DEFAULT_CODEX_MODEL as bn, fastAdvisorModel as bt, enumerateInjectedMcpToolNames as c, extractTarGzMember as cn, balancedOracleModel as ct, BROWSE_DEFAULT_MODEL as d, provisionTreeSitterAssets as dn, browseAgentEnabled as dt, readResponseBodyCapped as en, UNKNOWN_EFFORT_ANCHOR as et, DEFAULT_MODEL_CHAIN as f, CONDENSED_OPERATING_SEQUENCE as fn, browserCompoundToolsEnabled as ft, PLAN_DEFAULT_MODEL as g, toolbeltPathOverride as gn, cheapReviewerModel as gt, IMPLEMENT_DEFAULT_MODEL as h, collapsePathKeys as hn, cheapOracleModel as ht, assertMcpToolSurfaceConsistent as i, hasSupportedBrowserInstalled as in, handleMcpPost as it, assetFor as j, classifyMessagesRoute as jn, nativeSubagentModel as jt, vscodeRipgrepPath as k, upstreamAllowH2 as kn, generalPurposeFastModel as kt, maxPersonasFor as l, extractZipMember as ln, balancedReviewerModel as lt, EXPLORE_DEFAULT_THINKING as m, shouldUseInsecureTls as mn, cheapAdvisorModel as mt, MCP_GROUPS as n, normalizeOpenAIUsage as nn, clampEffort as nt, buildPeerAwarenessSnippet as o, provisionAndIndexColbert as on, artifactToolsEnabled as ot, EXPLORE_DEFAULT_MODEL as p, DEFINITION_OF_GREATNESS as pn, browserToolsEnabled as pt, buildAnthropicErrorEvent as q, CHEAP_PROFILE_ADVISOR_CLIENT_MODEL as qn, unregisterLaunch as qt, agentNamesForToolAllowlist as r, provisionBrowserAssets as rn, handleMcpDelete as rt, buildPeerAwarenessSummary as s, semanticSearchOptedIn as sn, balancedAdvisorModel as st, GROUP_META as t, parseJsonOrDiagnose as tn, bucketEffort as tt, personasFor as u, warmTreeSitterPool as un, brainstormModel as ut, TEST_DEFAULT_MODEL as v, BUDGET_SMALL_FAST_SLUG as vn, cheapestOracleModel as vt, buildEnv as w, UPSTREAM_INACTIVITY_TIMEOUT_MS as wn, fastPlanModel as wt, resolveModeDefaults as x, DEFAULT_CODEX_MODEL_FALLBACKS as xn, fastAstraModel as xt, appendPlanReminder as y, DEFAULT_CLAUDE_MODEL_FALLBACKS as yn, cheapestReviewerModel as yt, isAdvisorRequested as z, BALANCED_PROFILE_NATIVE_MODELS as zn, shimDefaultsToXhigh as zt };
|
|
37763
37901
|
|
|
37764
|
-
//# sourceMappingURL=peer-mcp-personas-
|
|
37902
|
+
//# sourceMappingURL=peer-mcp-personas-DcAErb_d.js.map
|