github-router 0.3.357 → 0.3.369
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/ado-tools-C0sY_rX1.js +1 -0
- package/dist/{aic-ledger-BuFrsGur.js → aic-ledger-_mvGW2Ev.js} +42 -7
- package/dist/aic-ledger-_mvGW2Ev.js.map +1 -0
- package/dist/{aic-statusline-settings-DBS9sEGC.js → aic-statusline-settings-B5EMMSFC.js} +2 -2
- package/dist/{aic-statusline-settings-DBS9sEGC.js.map → aic-statusline-settings-B5EMMSFC.js.map} +1 -1
- package/dist/{attribution-settings-D9PxJxkL.js → attribution-settings-zoBxw08y.js} +374 -218
- package/dist/attribution-settings-zoBxw08y.js.map +1 -0
- package/dist/{auth-DFawaLJU.js → auth-B3UvYB2r.js} +3 -3
- package/dist/{auth-DFawaLJU.js.map → auth-B3UvYB2r.js.map} +1 -1
- package/dist/{balanced-profile-contract-DtnTIBjL.js → balanced-profile-contract-Dm_usmw7.js} +7 -1
- package/dist/{balanced-profile-contract-DtnTIBjL.js.map → balanced-profile-contract-Dm_usmw7.js.map} +1 -1
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/{check-usage-BkVEl-Su.js → check-usage-45vyaLfl.js} +4 -4
- package/dist/{check-usage-BkVEl-Su.js.map → check-usage-45vyaLfl.js.map} +1 -1
- package/dist/{claude-BTYQjK-K.js → claude-BbIfnWbm.js} +92 -42
- package/dist/claude-BbIfnWbm.js.map +1 -0
- package/dist/{claude-md-injection-Cpzolxin.js → claude-md-injection-BtBG1RBZ.js} +153 -37
- package/dist/claude-md-injection-BtBG1RBZ.js.map +1 -0
- package/dist/{codex-TdsG6C9K.js → codex-CZVlP2tB.js} +7 -7
- package/dist/{codex-TdsG6C9K.js.map → codex-CZVlP2tB.js.map} +1 -1
- package/dist/{copilot-discount-Bsmv_3OX.js → copilot-discount-BuDbQOHq.js} +2 -2
- package/dist/{copilot-discount-Bsmv_3OX.js.map → copilot-discount-BuDbQOHq.js.map} +1 -1
- package/dist/{debug-DkNTuErv.js → debug-DL2JsRqY.js} +2 -2
- package/dist/{debug-DkNTuErv.js.map → debug-DL2JsRqY.js.map} +1 -1
- package/dist/engine-DeIo-VIR.js +1 -0
- package/dist/{gate-discovery-NNQg0t0H.js → gate-discovery-BYyYeUnn.js} +5 -5
- package/dist/{gate-discovery-NNQg0t0H.js.map → gate-discovery-BYyYeUnn.js.map} +1 -1
- package/dist/{get-copilot-usage-P9chc-X2.js → get-copilot-usage-BbGmK03C.js} +2 -2
- package/dist/{get-copilot-usage-P9chc-X2.js.map → get-copilot-usage-BbGmK03C.js.map} +1 -1
- package/dist/hooks.mjs +262 -117
- package/dist/hooks.sha256 +1 -1
- package/dist/{index-cmd-BkfYr9FH.js → index-cmd-CjRcmYk3.js} +4 -4
- package/dist/{index-cmd-BkfYr9FH.js.map → index-cmd-CjRcmYk3.js.map} +1 -1
- package/dist/{internal-aic-status-C6L4-ncP.js → internal-aic-status-BAVomi5A.js} +4 -4
- package/dist/{internal-aic-status-C6L4-ncP.js.map → internal-aic-status-BAVomi5A.js.map} +1 -1
- package/dist/{internal-artifact-open-DgJ3PCtt.js → internal-artifact-open-NAGn9Mgt.js} +2 -2
- package/dist/{internal-artifact-open-DgJ3PCtt.js.map → internal-artifact-open-NAGn9Mgt.js.map} +1 -1
- package/dist/{internal-fast-dispatch-guard-CicGz6oM.js → internal-fast-dispatch-guard-De_DJOyZ.js} +1 -1
- package/dist/{internal-fast-dispatch-guard-CgBtUsQI.js → internal-fast-dispatch-guard-_n-A8hgo.js} +3 -3
- package/dist/{internal-fast-dispatch-guard-CgBtUsQI.js.map → internal-fast-dispatch-guard-_n-A8hgo.js.map} +1 -1
- package/dist/{internal-first-mate-guard-DTXPT7JW.js → internal-first-mate-guard-C8GwLbaX.js} +1 -1
- package/dist/{internal-first-mate-guard-BfWYN6Jb.js → internal-first-mate-guard-GufCUMl3.js} +3 -3
- package/dist/{internal-first-mate-guard-BfWYN6Jb.js.map → internal-first-mate-guard-GufCUMl3.js.map} +1 -1
- package/dist/{internal-max-dispatch-guard-mNl9CCir.js → internal-max-dispatch-guard-BB0vwiPx.js} +1 -1
- package/dist/{internal-max-dispatch-guard-CY8l9SDw.js → internal-max-dispatch-guard-BodVFHRC.js} +2 -2
- package/dist/{internal-max-dispatch-guard-CY8l9SDw.js.map → internal-max-dispatch-guard-BodVFHRC.js.map} +1 -1
- package/dist/{internal-plan-review-2OHTs8Nk.js → internal-plan-review-ChFx8wTX.js} +3 -3
- package/dist/{internal-plan-review-2OHTs8Nk.js.map → internal-plan-review-ChFx8wTX.js.map} +1 -1
- package/dist/{internal-prompt-submit-DZ_-2A6a.js → internal-prompt-submit-B-kKTl-8.js} +2 -2
- package/dist/{internal-prompt-submit-CkfUcu34.js → internal-prompt-submit-bi7F7pKk.js} +4 -4
- package/dist/{internal-prompt-submit-CkfUcu34.js.map → internal-prompt-submit-bi7F7pKk.js.map} +1 -1
- package/dist/{internal-rebrief-EhBHAHsz.js → internal-rebrief-B6ZJS6Mp.js} +4 -4
- package/dist/{internal-rebrief-EhBHAHsz.js.map → internal-rebrief-B6ZJS6Mp.js.map} +1 -1
- package/dist/{internal-session-bind-Bv50ju2n.js → internal-session-bind-dsUOcKxU.js} +2 -2
- package/dist/{internal-session-bind-Bv50ju2n.js.map → internal-session-bind-dsUOcKxU.js.map} +1 -1
- package/dist/{internal-stop-hook-Iz8XXE07.js → internal-stop-hook-BbyobGUU.js} +5 -5
- package/dist/{internal-stop-hook-Iz8XXE07.js.map → internal-stop-hook-BbyobGUU.js.map} +1 -1
- package/dist/{internal-stop-review-K6f8xsCh.js → internal-stop-review-D_KEV_04.js} +2 -2
- package/dist/{internal-stop-review-K6f8xsCh.js.map → internal-stop-review-D_KEV_04.js.map} +1 -1
- package/dist/{internal-worker-guard-GVhTjVlR.js → internal-worker-guard-DB6shBIn.js} +2 -2
- package/dist/{internal-worker-guard-GVhTjVlR.js.map → internal-worker-guard-DB6shBIn.js.map} +1 -1
- package/dist/{internal-workspace-header-d2hFf9Jy.js → internal-workspace-header-DBg5Y7oN.js} +2 -2
- package/dist/{internal-workspace-header-d2hFf9Jy.js.map → internal-workspace-header-DBg5Y7oN.js.map} +1 -1
- package/dist/{lifecycle-C6cxM_Nk.js → lifecycle-9nX09dBl.js} +2 -2
- package/dist/{lifecycle-C6cxM_Nk.js.map → lifecycle-9nX09dBl.js.map} +1 -1
- package/dist/lifecycle-C_CT13c9.js +1 -0
- package/dist/lifecycle-DibiH857.js +1 -0
- package/dist/{lifecycle-pl9QpvqD.js → lifecycle-Gge2Dadd.js} +2 -2
- package/dist/{lifecycle-pl9QpvqD.js.map → lifecycle-Gge2Dadd.js.map} +1 -1
- package/dist/main.js +23 -23
- package/dist/{mcp-workspace-header-Su8uUxJg.js → mcp-workspace-header-Xw9B1W6T.js} +2 -2
- package/dist/{mcp-workspace-header-Su8uUxJg.js.map → mcp-workspace-header-Xw9B1W6T.js.map} +1 -1
- package/dist/{models-D8v8OTbN.js → models-BR6i348u.js} +3 -3
- package/dist/{models-D8v8OTbN.js.map → models-BR6i348u.js.map} +1 -1
- package/dist/{orchestration-Bov4rZEi.js → orchestration-D3-2ulhX.js} +2 -2
- package/dist/{orchestration-Bov4rZEi.js.map → orchestration-D3-2ulhX.js.map} +1 -1
- package/dist/{paths-BSI_EtDT.js → paths-C5477RGC.js} +48 -4
- package/dist/paths-C5477RGC.js.map +1 -0
- package/dist/paths-CEswtFj5.js +1 -0
- package/dist/{peer-mcp-personas-GANlrtNR.js → peer-mcp-personas-DNtWI2C1.js} +1139 -398
- package/dist/peer-mcp-personas-DNtWI2C1.js.map +1 -0
- package/dist/{pi-TKFwPyLA.js → pi-Bc-MVgAo.js} +397 -603
- package/dist/pi-Bc-MVgAo.js.map +1 -0
- package/dist/{plan-review-hook-CHK1wL3-.js → plan-review-hook-C9K-em4D.js} +3 -3
- package/dist/{plan-review-hook-CHK1wL3-.js.map → plan-review-hook-C9K-em4D.js.map} +1 -1
- package/dist/{provision-BNN6yRk8.js → provision-DUWdcY_a.js} +5 -5
- package/dist/{provision-BNN6yRk8.js.map → provision-DUWdcY_a.js.map} +1 -1
- package/dist/{self-invocation-Dk_UHD_v.js → self-invocation-BtcGj-lY.js} +2 -2
- package/dist/{self-invocation-Dk_UHD_v.js.map → self-invocation-BtcGj-lY.js.map} +1 -1
- package/dist/{serve-BaeLm9Um.js → serve-CmWOTR7m.js} +14 -14
- package/dist/{serve-BaeLm9Um.js.map → serve-CmWOTR7m.js.map} +1 -1
- package/dist/{server-setup-BcUQv5ac.js → server-setup-CIzmDJzT.js} +848 -103
- package/dist/server-setup-CIzmDJzT.js.map +1 -0
- package/dist/{service-backend-DHyd9vjW.js → service-backend-B6D_DY1Z.js} +3 -3
- package/dist/{service-backend-DHyd9vjW.js.map → service-backend-B6D_DY1Z.js.map} +1 -1
- package/dist/{start-BdoGJc36.js → start-rlpaeAtx.js} +4 -4
- package/dist/{start-BdoGJc36.js.map → start-rlpaeAtx.js.map} +1 -1
- package/dist/state-CiwCLVDZ.js.map +1 -1
- package/dist/{static-context-pack-dKrzbfIN.js → static-context-pack-DvwLWlbe.js} +371 -64
- package/dist/static-context-pack-DvwLWlbe.js.map +1 -0
- package/dist/{stop-gate-hook-CC7VWkZM.js → stop-gate-hook-DnLC09Lg.js} +3 -3
- package/dist/{stop-gate-hook-CC7VWkZM.js.map → stop-gate-hook-DnLC09Lg.js.map} +1 -1
- package/dist/{stop-gate-policy-CoR8xKNQ.js → stop-gate-policy-Dx9c98_d.js} +2 -2
- package/dist/{stop-gate-policy-CoR8xKNQ.js.map → stop-gate-policy-Dx9c98_d.js.map} +1 -1
- package/dist/{token-CA2s70qj.js → token-OTb61rOC.js} +2 -2
- package/dist/{token-CA2s70qj.js.map → token-OTb61rOC.js.map} +1 -1
- package/dist/{worker-dispatch-B_rriT7z.js → worker-dispatch-B1w2qfjX.js} +2 -2
- package/dist/{worker-dispatch-B_rriT7z.js.map → worker-dispatch-B1w2qfjX.js.map} +1 -1
- package/docs/azure-mcp.md +29 -31
- package/package.json +1 -1
- package/dist/ado-tools-DqLJ-u19.js +0 -1
- package/dist/aic-ledger-BuFrsGur.js.map +0 -1
- package/dist/attribution-settings-D9PxJxkL.js.map +0 -1
- package/dist/claude-BTYQjK-K.js.map +0 -1
- package/dist/claude-md-injection-Cpzolxin.js.map +0 -1
- package/dist/engine-CmhUwYI5.js +0 -1
- package/dist/lifecycle-BU_d2QMs.js +0 -1
- package/dist/lifecycle-ByFyew_w.js +0 -1
- package/dist/paths-BSI_EtDT.js.map +0 -1
- package/dist/paths-BYxX9DfA.js +0 -1
- package/dist/peer-mcp-personas-GANlrtNR.js.map +0 -1
- package/dist/pi-TKFwPyLA.js.map +0 -1
- package/dist/server-setup-BcUQv5ac.js.map +0 -1
- package/dist/static-context-pack-dKrzbfIN.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { r as BALANCED_PROFILE_MODELS, t as BALANCED_PROFILE_CONTRACT } from "./balanced-profile-contract-
|
|
2
|
-
import { t as buildSelfCommand } from "./self-invocation-
|
|
3
|
-
import { s as isSubagentContext } from "./stop-gate-policy-
|
|
1
|
+
import { r as BALANCED_PROFILE_MODELS, t as BALANCED_PROFILE_CONTRACT } from "./balanced-profile-contract-Dm_usmw7.js";
|
|
2
|
+
import { t as buildSelfCommand } from "./self-invocation-BtcGj-lY.js";
|
|
3
|
+
import { s as isSubagentContext } from "./stop-gate-policy-Dx9c98_d.js";
|
|
4
4
|
import { existsSync, readFileSync, readdirSync } from "node:fs";
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
//#region src/lib/cheapest-profile-contract.ts
|
|
@@ -92,6 +92,15 @@ const CHEAPEST_PROFILE_ADVISOR_EFFORT = "medium";
|
|
|
92
92
|
const CHEAPEST_PROFILE_ORACLE_MODEL = CHEAPEST_PROFILE_MODELS.oracle;
|
|
93
93
|
const CHEAPEST_PROFILE_ORACLE_EFFORT = "high";
|
|
94
94
|
/**
|
|
95
|
+
* The Copilot model the prompt-rewrite hooks dispatch on.
|
|
96
|
+
*
|
|
97
|
+
* Separate from `advisorModel` because the two are only incidentally the same
|
|
98
|
+
* tier today: a rewrite is always a Copilot call, so a family member whose
|
|
99
|
+
* consultants move to another transport must not drag the rewrite along with
|
|
100
|
+
* them (see `cheaplocal-profile-contract.ts`).
|
|
101
|
+
*/
|
|
102
|
+
const CHEAPEST_PROFILE_REWRITE_MODEL = CHEAPEST_PROFILE_MODELS.advisor;
|
|
103
|
+
/**
|
|
95
104
|
* Synthesized MCP consultant tools for `-m cheapest`: Oracle only, like
|
|
96
105
|
* `-m cheap` (never `astra`).
|
|
97
106
|
*/
|
|
@@ -131,10 +140,193 @@ const CHEAPEST_PROFILE_CONTRACT = Object.freeze({
|
|
|
131
140
|
advisorEffort: CHEAPEST_PROFILE_ADVISOR_EFFORT,
|
|
132
141
|
oracleModel: CHEAPEST_PROFILE_ORACLE_MODEL,
|
|
133
142
|
oracleEffort: CHEAPEST_PROFILE_ORACLE_EFFORT,
|
|
143
|
+
rewriteModel: CHEAPEST_PROFILE_REWRITE_MODEL,
|
|
144
|
+
/**
|
|
145
|
+
* Where the Advisor and Oracle are served. `cheapest` and `cheapest2` both
|
|
146
|
+
* consult Copilot; `cheaplocal` is the family member that consults the local
|
|
147
|
+
* endpoint. Consumers branch on this value, never on a profile id.
|
|
148
|
+
*/
|
|
149
|
+
consultTransport: "copilot",
|
|
134
150
|
synthesizedPeers: CHEAPEST_PROFILE_SYNTHESIZED_PEERS,
|
|
135
151
|
delegationGraph: CHEAPEST_PROFILE_DELEGATION_GRAPH
|
|
136
152
|
});
|
|
137
153
|
//#endregion
|
|
154
|
+
//#region src/lib/cheapest2-profile-contract.ts
|
|
155
|
+
/**
|
|
156
|
+
* Fixed identities for the literal `github-router claude -m cheapest2` profile.
|
|
157
|
+
*
|
|
158
|
+
* `cheapest2` is `cheapest` with the Sol tier moved from `gpt-5.6-sol` to
|
|
159
|
+
* `gpt-6.1-sol` and the Advisor raised to `high`. Everything else — the
|
|
160
|
+
* `gpt-6-luna`/max lead, the Luna subagents, the bare-slug 200K window, the
|
|
161
|
+
* curated 24K Advisor transcript budget, the Oracle-only peer set, the
|
|
162
|
+
* three-agent surface and the delegation graph — is inherited verbatim.
|
|
163
|
+
*
|
|
164
|
+
* Derived from `CHEAPEST_PROFILE_CONTRACT` by spread rather than copied: a
|
|
165
|
+
* field added to the family later is inherited here automatically, and the
|
|
166
|
+
* declared deltas are the only lines in this file that can drift.
|
|
167
|
+
*/
|
|
168
|
+
/** The 6.1 Sol tier that distinguishes this profile from `cheapest`. */
|
|
169
|
+
const CHEAPEST2_SOL_MODEL = "gpt-6.1-sol";
|
|
170
|
+
const CHEAPEST2_PROFILE_MODELS = Object.freeze({
|
|
171
|
+
...CHEAPEST_PROFILE_MODELS,
|
|
172
|
+
advisor: CHEAPEST2_SOL_MODEL,
|
|
173
|
+
oracle: CHEAPEST2_SOL_MODEL
|
|
174
|
+
});
|
|
175
|
+
const CHEAPEST2_PROFILE_NATIVE_MODELS = Object.freeze({
|
|
176
|
+
Explore: CHEAPEST2_PROFILE_MODELS.explore,
|
|
177
|
+
"General-Purpose": CHEAPEST2_PROFILE_MODELS["General-Purpose"],
|
|
178
|
+
reviewer: CHEAPEST2_PROFILE_MODELS.reviewer
|
|
179
|
+
});
|
|
180
|
+
const CHEAPEST2_PROFILE_ADVISOR_MODEL = CHEAPEST2_PROFILE_MODELS.advisor;
|
|
181
|
+
const CHEAPEST2_PROFILE_ADVISOR_CLIENT_MODEL = CHEAPEST2_PROFILE_MODELS.advisor;
|
|
182
|
+
/**
|
|
183
|
+
* The one non-model delta from `cheapest`: the Advisor runs at `high`. The
|
|
184
|
+
* Claude path already forces `high` on the wire for any cheapest-profile
|
|
185
|
+
* Advisor (`resolveAdvisorEffort`, `fastProfile = true`); this declaration
|
|
186
|
+
* matches the wire and makes the Pi runtime's Advisor `high` too.
|
|
187
|
+
*/
|
|
188
|
+
const CHEAPEST2_PROFILE_ADVISOR_EFFORT = "high";
|
|
189
|
+
const CHEAPEST2_PROFILE_ORACLE_MODEL = CHEAPEST2_PROFILE_MODELS.oracle;
|
|
190
|
+
/** The rewrite stays on this sibling's own Sol tier. */
|
|
191
|
+
const CHEAPEST2_PROFILE_REWRITE_MODEL = CHEAPEST2_PROFILE_MODELS.advisor;
|
|
192
|
+
/** The `-m cheapest2` aggregate: the base contract with only the Sol
|
|
193
|
+
* identities and the Advisor effort replaced. */
|
|
194
|
+
const CHEAPEST2_PROFILE_CONTRACT = Object.freeze({
|
|
195
|
+
...CHEAPEST_PROFILE_CONTRACT,
|
|
196
|
+
models: CHEAPEST2_PROFILE_MODELS,
|
|
197
|
+
nativeModels: CHEAPEST2_PROFILE_NATIVE_MODELS,
|
|
198
|
+
advisorModel: CHEAPEST2_PROFILE_ADVISOR_MODEL,
|
|
199
|
+
advisorClientModel: CHEAPEST2_PROFILE_ADVISOR_CLIENT_MODEL,
|
|
200
|
+
advisorEffort: CHEAPEST2_PROFILE_ADVISOR_EFFORT,
|
|
201
|
+
oracleModel: CHEAPEST2_PROFILE_ORACLE_MODEL,
|
|
202
|
+
rewriteModel: CHEAPEST2_PROFILE_REWRITE_MODEL
|
|
203
|
+
});
|
|
204
|
+
//#endregion
|
|
205
|
+
//#region src/lib/local-profile-contract.ts
|
|
206
|
+
/**
|
|
207
|
+
* Fixed identities for the literal `github-router claude -m local` and
|
|
208
|
+
* `-m local2` launch profiles.
|
|
209
|
+
*
|
|
210
|
+
* Both profiles route the MAIN agent loop at a locally running model server
|
|
211
|
+
* instead of Copilot, so their model ids are the three Anthropic tier names the
|
|
212
|
+
* server itself resolves (`opus` / `sonnet` / `haiku`) rather than catalog
|
|
213
|
+
* slugs. Nothing here assumes which stack is serving them, what else its model
|
|
214
|
+
* list contains, or that any capability beyond "Claude Code works with it" is
|
|
215
|
+
* present.
|
|
216
|
+
*
|
|
217
|
+
* Everything that is NOT a model identity is inherited from
|
|
218
|
+
* `CHEAPEST_PROFILE_CONTRACT` by reference rather than copied: the roster
|
|
219
|
+
* (`Explore` / `General-Purpose` / `reviewer`, no `Plan`), the delegation graph,
|
|
220
|
+
* the per-role efforts, the synthesized peer set and the 200K windows are the
|
|
221
|
+
* cheapest profile's, so "the prompts are the same as cheapest" holds by
|
|
222
|
+
* construction and cannot drift one file away from the prose that describes it.
|
|
223
|
+
*
|
|
224
|
+
* Declared deltas only:
|
|
225
|
+
* - `models` / `nativeModels` — the local tier ids.
|
|
226
|
+
* - `oracleModel` — `cheapest2`'s `gpt-6.1-sol`, because the Oracle is an MCP
|
|
227
|
+
* persona that still runs on Copilot: it is a consult the local lead makes,
|
|
228
|
+
* not a local turn.
|
|
229
|
+
* - NO `leadEffort`. The launcher seeds `CLAUDE_CODE_EFFORT_LEVEL` for the
|
|
230
|
+
* cheapest family, and we know nothing about the local server's effort
|
|
231
|
+
* ladder, so the client's own picker decides. The type-level absence is
|
|
232
|
+
* what stops a future edit from seeding one by accident.
|
|
233
|
+
* - NO advisor fields on `local`: that profile is Advisor-free by design,
|
|
234
|
+
* exactly like `balanced`. `local2` adds them back.
|
|
235
|
+
*/
|
|
236
|
+
/**
|
|
237
|
+
* The three ids the local endpoint resolves. Claude Code's `/model` picker and
|
|
238
|
+
* its tier env vars speak these names, and the server maps each onto whatever
|
|
239
|
+
* it actually has loaded, so the proxy never learns (or guesses) a real model
|
|
240
|
+
* slug.
|
|
241
|
+
*/
|
|
242
|
+
const LOCAL_PROFILE_TIER_MODELS = Object.freeze({
|
|
243
|
+
opus: "opus",
|
|
244
|
+
sonnet: "sonnet",
|
|
245
|
+
haiku: "haiku"
|
|
246
|
+
});
|
|
247
|
+
const LOCAL_PROFILE_MODELS = Object.freeze({
|
|
248
|
+
lead: LOCAL_PROFILE_TIER_MODELS.opus,
|
|
249
|
+
explore: LOCAL_PROFILE_TIER_MODELS.haiku,
|
|
250
|
+
"General-Purpose": LOCAL_PROFILE_TIER_MODELS.sonnet,
|
|
251
|
+
reviewer: LOCAL_PROFILE_TIER_MODELS.opus,
|
|
252
|
+
/** Copilot-served MCP persona, inherited from `cheapest2`. */
|
|
253
|
+
oracle: CHEAPEST2_SOL_MODEL
|
|
254
|
+
});
|
|
255
|
+
const LOCAL_PROFILE_NATIVE_AGENT_NAMES = CHEAPEST_PROFILE_NATIVE_AGENT_NAMES;
|
|
256
|
+
const LOCAL_PROFILE_NATIVE_MODELS = Object.freeze({
|
|
257
|
+
Explore: LOCAL_PROFILE_MODELS.explore,
|
|
258
|
+
"General-Purpose": LOCAL_PROFILE_MODELS["General-Purpose"],
|
|
259
|
+
reviewer: LOCAL_PROFILE_MODELS.reviewer
|
|
260
|
+
});
|
|
261
|
+
/**
|
|
262
|
+
* Per-role efforts are the cheapest profile's verbatim. They ride on the
|
|
263
|
+
* subagent `.md` frontmatter, which is a prompt-level preference the local
|
|
264
|
+
* server may ignore; the LEAD effort is deliberately NOT seeded (see above).
|
|
265
|
+
*/
|
|
266
|
+
const LOCAL_PROFILE_NATIVE_EFFORTS = CHEAPEST_PROFILE_NATIVE_EFFORTS;
|
|
267
|
+
/** 200K: enforced client-side by `CLAUDE_CODE_DISABLE_1M_CONTEXT=1`. */
|
|
268
|
+
const LOCAL_PROFILE_LEAD_CONTEXT_TOKENS = 2e5;
|
|
269
|
+
const LOCAL_PROFILE_SUBAGENT_CONTEXT_TOKENS = CHEAPEST_PROFILE_SUBAGENT_CONTEXT_TOKENS;
|
|
270
|
+
const LOCAL_PROFILE_ORACLE_MODEL = LOCAL_PROFILE_MODELS.oracle;
|
|
271
|
+
/**
|
|
272
|
+
* Every fixed identity for `-m local` in one frozen aggregate.
|
|
273
|
+
*
|
|
274
|
+
* `local2` derives from this by spread, adding only its Advisor block.
|
|
275
|
+
*/
|
|
276
|
+
const LOCAL_PROFILE_CONTRACT = Object.freeze({
|
|
277
|
+
models: LOCAL_PROFILE_MODELS,
|
|
278
|
+
tierModels: LOCAL_PROFILE_TIER_MODELS,
|
|
279
|
+
nativeAgentNames: LOCAL_PROFILE_NATIVE_AGENT_NAMES,
|
|
280
|
+
nativeModels: LOCAL_PROFILE_NATIVE_MODELS,
|
|
281
|
+
nativeEfforts: LOCAL_PROFILE_NATIVE_EFFORTS,
|
|
282
|
+
leadContextTokens: LOCAL_PROFILE_LEAD_CONTEXT_TOKENS,
|
|
283
|
+
subagentContextTokens: LOCAL_PROFILE_SUBAGENT_CONTEXT_TOKENS,
|
|
284
|
+
oracleModel: LOCAL_PROFILE_ORACLE_MODEL,
|
|
285
|
+
oracleEffort: CHEAPEST_PROFILE_ORACLE_EFFORT,
|
|
286
|
+
synthesizedPeers: CHEAPEST_PROFILE_SYNTHESIZED_PEERS,
|
|
287
|
+
delegationGraph: CHEAPEST_PROFILE_DELEGATION_GRAPH,
|
|
288
|
+
/**
|
|
289
|
+
* The consultants here are Copilot dispatches even though the LEAD is local:
|
|
290
|
+
* `local`'s Oracle persona and `local2`'s curated Advisor both run on the
|
|
291
|
+
* inherited Copilot slug. Declared so the cheapest family's transport field
|
|
292
|
+
* is present across every contract a curated-Advisor call site can hold.
|
|
293
|
+
*/
|
|
294
|
+
consultTransport: "copilot"
|
|
295
|
+
});
|
|
296
|
+
/**
|
|
297
|
+
* The `-m local2` Advisor: `gpt-6.1-sol` on Copilot, `high`, at the cheapest
|
|
298
|
+
* family's default window and curated ("small digest") transcript budget.
|
|
299
|
+
*
|
|
300
|
+
* The lead turn stays local and free; only the Advisor consult is billed.
|
|
301
|
+
*/
|
|
302
|
+
const LOCAL2_PROFILE_ADVISOR_MODEL = CHEAPEST2_SOL_MODEL;
|
|
303
|
+
const LOCAL2_PROFILE_ADVISOR_CLIENT_MODEL = CHEAPEST2_SOL_MODEL;
|
|
304
|
+
const LOCAL2_PROFILE_ADVISOR_CONTEXT_TOKENS = LOCAL_PROFILE_SUBAGENT_CONTEXT_TOKENS;
|
|
305
|
+
const LOCAL2_PROFILE_ADVISOR_TRANSCRIPT_TOKENS_DEFAULT = CHEAPEST_PROFILE_ADVISOR_TRANSCRIPT_TOKENS_DEFAULT;
|
|
306
|
+
const LOCAL2_PROFILE_ADVISOR_TRANSCRIPT_TOKENS_MIN = CHEAPEST_PROFILE_ADVISOR_TRANSCRIPT_TOKENS_MIN;
|
|
307
|
+
const LOCAL2_PROFILE_ADVISOR_TRANSCRIPT_TOKENS_MAX = CHEAPEST_PROFILE_ADVISOR_TRANSCRIPT_TOKENS_MAX;
|
|
308
|
+
/** Matches `cheapest2`: the curated protégé consult runs its advisor at `high`. */
|
|
309
|
+
const LOCAL2_PROFILE_ADVISOR_EFFORT = "high";
|
|
310
|
+
/**
|
|
311
|
+
* The `-m local2` aggregate: the local contract plus the curated Advisor.
|
|
312
|
+
*
|
|
313
|
+
* The advisor fields are present HERE and absent from `LOCAL_PROFILE_CONTRACT`
|
|
314
|
+
* on purpose, so every advisor call site has to name the profile it is serving
|
|
315
|
+
* instead of inheriting one by accident.
|
|
316
|
+
*/
|
|
317
|
+
const LOCAL2_PROFILE_CONTRACT = Object.freeze({
|
|
318
|
+
...LOCAL_PROFILE_CONTRACT,
|
|
319
|
+
advisorModel: LOCAL2_PROFILE_ADVISOR_MODEL,
|
|
320
|
+
advisorClientModel: LOCAL2_PROFILE_ADVISOR_CLIENT_MODEL,
|
|
321
|
+
advisorContextTokens: LOCAL2_PROFILE_ADVISOR_CONTEXT_TOKENS,
|
|
322
|
+
advisorTranscriptTokensDefault: LOCAL2_PROFILE_ADVISOR_TRANSCRIPT_TOKENS_DEFAULT,
|
|
323
|
+
advisorTranscriptTokensMin: LOCAL2_PROFILE_ADVISOR_TRANSCRIPT_TOKENS_MIN,
|
|
324
|
+
advisorTranscriptTokensMax: LOCAL2_PROFILE_ADVISOR_TRANSCRIPT_TOKENS_MAX,
|
|
325
|
+
advisorEffort: LOCAL2_PROFILE_ADVISOR_EFFORT
|
|
326
|
+
});
|
|
327
|
+
/** The local lead slug, used by the child-env/tier-row wiring. */
|
|
328
|
+
const LOCAL_PROFILE_LEAD_MODEL = LOCAL_PROFILE_MODELS.lead;
|
|
329
|
+
//#endregion
|
|
138
330
|
//#region src/lib/balanced2-profile-contract.ts
|
|
139
331
|
/**
|
|
140
332
|
* Fixed identities for the literal `github-router claude -m balanced2` profile.
|
|
@@ -179,80 +371,139 @@ const BALANCED2_PROFILE_CONTRACT = Object.freeze({
|
|
|
179
371
|
oracleModel: BALANCED2_PROFILE_ORACLE_MODEL
|
|
180
372
|
});
|
|
181
373
|
//#endregion
|
|
182
|
-
//#region src/lib/
|
|
374
|
+
//#region src/lib/cheaplocal-profile-contract.ts
|
|
183
375
|
/**
|
|
184
|
-
* Fixed identities for the literal `github-router claude -m
|
|
376
|
+
* Fixed identities for the literal `github-router claude -m cheaplocal` profile.
|
|
185
377
|
*
|
|
186
|
-
* `
|
|
187
|
-
*
|
|
188
|
-
* `
|
|
189
|
-
*
|
|
190
|
-
* three-agent surface and the delegation graph — is inherited verbatim.
|
|
378
|
+
* `cheaplocal` is `cheapest` with its two consultants moved off Copilot: the
|
|
379
|
+
* Advisor and the Oracle are served by the local Anthropic-Messages endpoint
|
|
380
|
+
* (the same one `-m local` / `-m local2` point their main loop at) instead of a
|
|
381
|
+
* Copilot model.
|
|
191
382
|
*
|
|
192
|
-
*
|
|
193
|
-
*
|
|
194
|
-
*
|
|
383
|
+
* Everything else is inherited verbatim from `CHEAPEST_PROFILE_CONTRACT`:
|
|
384
|
+
* the `gpt-6-luna`/max lead, the Luna natives, the bare-slug 200K window, the
|
|
385
|
+
* curated 24K Advisor digest, the Oracle-only peer set, the three-agent surface
|
|
386
|
+
* and the delegation graph.
|
|
387
|
+
*
|
|
388
|
+
* Nothing in this file may characterize the local model. The endpoint is the
|
|
389
|
+
* only fact the profile carries about it, so no name, window, price or speed
|
|
390
|
+
* claim is made anywhere: the contract names a bare SLUG (`opus`) and a
|
|
391
|
+
* transport, and prose that reaches the model describes the consultants by
|
|
392
|
+
* transport ("the local model"), never by identity. The one effort the consult
|
|
393
|
+
* requests (`LOCAL_CONSULT_EFFORT`) is the operator's setting, not a property
|
|
394
|
+
* of the model.
|
|
395
|
+
*
|
|
396
|
+
* Derived by spread rather than copied, so a field added to the cheapest family
|
|
397
|
+
* later is inherited here automatically and the declared deltas below are the
|
|
398
|
+
* only lines that can drift.
|
|
195
399
|
*/
|
|
196
|
-
/**
|
|
197
|
-
|
|
198
|
-
|
|
400
|
+
/**
|
|
401
|
+
* The one model id this profile sends to the local endpoint.
|
|
402
|
+
*
|
|
403
|
+
* Bare, like the `-m local` lead: the profile assumes nothing about which model
|
|
404
|
+
* answers, and the endpoint maps the id itself. It is deliberately the SAME id
|
|
405
|
+
* for the Advisor and the Oracle because a second spelling would imply a
|
|
406
|
+
* distinction the profile cannot observe.
|
|
407
|
+
*/
|
|
408
|
+
const CHEAPLOCAL_CONSULT_MODEL = "opus";
|
|
409
|
+
/**
|
|
410
|
+
* The Copilot model the prompt-rewrite hooks run on. Under `cheaplocal` the
|
|
411
|
+
* consultants are local, but the rewrite is a Copilot dispatch and must stay
|
|
412
|
+
* inside the profile's `{sol, luna}` egress ceiling, so it keeps the base
|
|
413
|
+
* family's Sol rather than following `advisorModel` to the local slug.
|
|
414
|
+
*/
|
|
415
|
+
const CHEAPLOCAL_PROFILE_REWRITE_MODEL = "gpt-5.6-sol";
|
|
416
|
+
const CHEAPLOCAL_PROFILE_MODELS = Object.freeze({
|
|
199
417
|
...CHEAPEST_PROFILE_MODELS,
|
|
200
|
-
advisor:
|
|
201
|
-
oracle:
|
|
418
|
+
advisor: CHEAPLOCAL_CONSULT_MODEL,
|
|
419
|
+
oracle: CHEAPLOCAL_CONSULT_MODEL
|
|
202
420
|
});
|
|
203
|
-
const
|
|
204
|
-
Explore:
|
|
205
|
-
"General-Purpose":
|
|
206
|
-
reviewer:
|
|
421
|
+
const CHEAPLOCAL_PROFILE_NATIVE_MODELS = Object.freeze({
|
|
422
|
+
Explore: CHEAPLOCAL_PROFILE_MODELS.explore,
|
|
423
|
+
"General-Purpose": CHEAPLOCAL_PROFILE_MODELS["General-Purpose"],
|
|
424
|
+
reviewer: CHEAPLOCAL_PROFILE_MODELS.reviewer
|
|
207
425
|
});
|
|
208
|
-
const
|
|
209
|
-
const CHEAPEST2_PROFILE_ADVISOR_CLIENT_MODEL = CHEAPEST2_PROFILE_MODELS.advisor;
|
|
426
|
+
const CHEAPLOCAL_PROFILE_ADVISOR_MODEL = CHEAPLOCAL_PROFILE_MODELS.advisor;
|
|
210
427
|
/**
|
|
211
|
-
*
|
|
212
|
-
*
|
|
213
|
-
*
|
|
214
|
-
*
|
|
428
|
+
* Client-visible Advisor identity. A LABEL, not the model that answers: the
|
|
429
|
+
* wire id sent to the endpoint is `CHEAPLOCAL_CONSULT_MODEL`, and nothing in
|
|
430
|
+
* this profile can observe which model receives it.
|
|
431
|
+
*
|
|
432
|
+
* It is deliberately not a model id at all, for two reasons. First, naming a
|
|
433
|
+
* model here would make the client UI claim that model is consulting, which the
|
|
434
|
+
* profile cannot know. Second, Claude Code resolves a RECOGNIZED model alias
|
|
435
|
+
* through its own registry before putting the value in the native Advisor
|
|
436
|
+
* tool's `model` field: `--advisor opus` arrives at the proxy as
|
|
437
|
+
* `claude-opus-5.5`, so an alias can never be a stable pin for the strict
|
|
438
|
+
* client-drift check. `local` is not a model alias, so it passes through
|
|
439
|
+
* verbatim.
|
|
215
440
|
*/
|
|
216
|
-
const
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
*
|
|
220
|
-
|
|
441
|
+
const CHEAPLOCAL_PROFILE_ADVISOR_CLIENT_MODEL = "local";
|
|
442
|
+
/**
|
|
443
|
+
* The declared effort is inherited but never transmitted: the local transport
|
|
444
|
+
* sends one fixed `max` request (`LOCAL_CONSULT_EFFORT`) instead of the
|
|
445
|
+
* family's Copilot effort, so the field exists only so the family contract
|
|
446
|
+
* stays a complete object.
|
|
447
|
+
*/
|
|
448
|
+
const CHEAPLOCAL_PROFILE_ADVISOR_EFFORT = CHEAPEST_PROFILE_CONTRACT.advisorEffort;
|
|
449
|
+
const CHEAPLOCAL_PROFILE_ORACLE_MODEL = CHEAPLOCAL_PROFILE_MODELS.oracle;
|
|
450
|
+
/** The `-m cheaplocal` aggregate: the base contract with the two consultants
|
|
451
|
+
* pointed at the local endpoint. */
|
|
452
|
+
const CHEAPLOCAL_PROFILE_CONTRACT = Object.freeze({
|
|
221
453
|
...CHEAPEST_PROFILE_CONTRACT,
|
|
222
|
-
models:
|
|
223
|
-
nativeModels:
|
|
224
|
-
advisorModel:
|
|
225
|
-
advisorClientModel:
|
|
226
|
-
advisorEffort:
|
|
227
|
-
oracleModel:
|
|
454
|
+
models: CHEAPLOCAL_PROFILE_MODELS,
|
|
455
|
+
nativeModels: CHEAPLOCAL_PROFILE_NATIVE_MODELS,
|
|
456
|
+
advisorModel: CHEAPLOCAL_PROFILE_ADVISOR_MODEL,
|
|
457
|
+
advisorClientModel: CHEAPLOCAL_PROFILE_ADVISOR_CLIENT_MODEL,
|
|
458
|
+
advisorEffort: CHEAPLOCAL_PROFILE_ADVISOR_EFFORT,
|
|
459
|
+
oracleModel: CHEAPLOCAL_PROFILE_ORACLE_MODEL,
|
|
460
|
+
rewriteModel: CHEAPLOCAL_PROFILE_REWRITE_MODEL,
|
|
461
|
+
consultTransport: "local"
|
|
228
462
|
});
|
|
229
463
|
//#endregion
|
|
230
464
|
//#region src/lib/profile-family.ts
|
|
231
465
|
/**
|
|
232
|
-
* The `cheapest`/`cheapest2` and `balanced`/`balanced2`
|
|
466
|
+
* The `cheapest`/`cheapest2`/`cheaplocal` and `balanced`/`balanced2`
|
|
467
|
+
* launch-profile families.
|
|
233
468
|
*
|
|
234
469
|
* The `-2` aliases are not separate tiers: each is its base profile with a
|
|
235
470
|
* declared set of Sol identities replaced (`cheapest2`: Advisor + Oracle at
|
|
236
471
|
* `gpt-6.1-sol`, Advisor effort `high`; `balanced2`: lead + reviewer at
|
|
237
472
|
* `gpt-6.1-sol`, Oracle `grok-4.7`). Every consumer therefore asks the family
|
|
238
473
|
* helpers below rather than comparing against one literal id, which is what
|
|
239
|
-
* keeps the
|
|
474
|
+
* keeps the siblings from drifting: a check written for `cheapest` covers
|
|
240
475
|
* `cheapest2` by construction instead of needing a parallel branch.
|
|
241
476
|
*
|
|
242
|
-
*
|
|
477
|
+
* `cheaplocal` is a third cheapest sibling, not a local-family member: its lead
|
|
478
|
+
* and natives stay on Copilot and only its two consultants move to the local
|
|
479
|
+
* endpoint. It joins the family because every lead/native/window decision is
|
|
480
|
+
* identical to `cheapest`; the transport difference rides on the contract's
|
|
481
|
+
* `consultTransport`, so consumers branch on data rather than on this id.
|
|
482
|
+
*
|
|
483
|
+
* This module imports only the five contract modules — never
|
|
243
484
|
* `launch-profile.ts` — so it can be imported from anywhere in `src/lib`
|
|
244
485
|
* without creating a cycle.
|
|
245
486
|
*/
|
|
246
487
|
function isCheapestFamily(profileId) {
|
|
247
|
-
return profileId === "cheapest" || profileId === "cheapest2";
|
|
488
|
+
return profileId === "cheapest" || profileId === "cheapest2" || profileId === "cheaplocal";
|
|
489
|
+
}
|
|
490
|
+
/** The one cheapest sibling whose consultants leave Copilot. The predicate
|
|
491
|
+
* form matters at call sites that must EXCLUDE the id: Pi rejects it, and a
|
|
492
|
+
* plain `boolean` would leave `CheapestProfileId` intact after the refusal. */
|
|
493
|
+
function isCheaplocalProfile(profileId) {
|
|
494
|
+
return profileId === "cheaplocal";
|
|
248
495
|
}
|
|
249
496
|
function isBalancedFamily(profileId) {
|
|
250
497
|
return profileId === "balanced" || profileId === "balanced2";
|
|
251
498
|
}
|
|
499
|
+
function isLocalFamily(profileId) {
|
|
500
|
+
return profileId === "local" || profileId === "local2";
|
|
501
|
+
}
|
|
252
502
|
/**
|
|
253
|
-
* Every FIXED-ROSTER launch profile: `fast`, the cheap pair,
|
|
254
|
-
*
|
|
255
|
-
* mirror purge and status line the router owns
|
|
503
|
+
* Every FIXED-ROSTER launch profile: `fast`, the cheap pair, the three cheapest
|
|
504
|
+
* siblings, the balanced pair, and the local pair. These are the launches whose
|
|
505
|
+
* MCP surface, picker rows, mirror purge and status line the router owns
|
|
506
|
+
* outright.
|
|
256
507
|
*
|
|
257
508
|
* `max` is deliberately absent. It shares some of the same wiring, but it
|
|
258
509
|
* has its own reviewer/roster path rather than the shared fast-style
|
|
@@ -264,8 +515,11 @@ const PINNED_PROFILE_IDS = /* @__PURE__ */ new Set([
|
|
|
264
515
|
"cheap1m",
|
|
265
516
|
"cheapest",
|
|
266
517
|
"cheapest2",
|
|
518
|
+
"cheaplocal",
|
|
267
519
|
"balanced",
|
|
268
|
-
"balanced2"
|
|
520
|
+
"balanced2",
|
|
521
|
+
"local",
|
|
522
|
+
"local2"
|
|
269
523
|
]);
|
|
270
524
|
function isPinnedLaunchProfile(profileId) {
|
|
271
525
|
return profileId != null && PINNED_PROFILE_IDS.has(profileId);
|
|
@@ -275,13 +529,38 @@ function isPinnedLaunchProfile(profileId) {
|
|
|
275
529
|
* non-family launch still gets a complete, valid object rather than
|
|
276
530
|
* `undefined`. */
|
|
277
531
|
function cheapestContractFor(profileId) {
|
|
278
|
-
|
|
532
|
+
if (profileId === "cheapest2") return CHEAPEST2_PROFILE_CONTRACT;
|
|
533
|
+
if (profileId === "cheaplocal") return CHEAPLOCAL_PROFILE_CONTRACT;
|
|
534
|
+
return CHEAPEST_PROFILE_CONTRACT;
|
|
279
535
|
}
|
|
280
536
|
/** The contract for a balanced-family profile (base fallback, as above). */
|
|
281
537
|
function balancedContractFor(profileId) {
|
|
282
538
|
return profileId === "balanced2" ? BALANCED2_PROFILE_CONTRACT : BALANCED_PROFILE_CONTRACT;
|
|
283
539
|
}
|
|
284
540
|
/**
|
|
541
|
+
* The contract for a local-family profile (base fallback, as above).
|
|
542
|
+
*
|
|
543
|
+
* Local is a THIRD family, not a cheapest sibling: its egress and model ids
|
|
544
|
+
* differ while its prose is inherited. `cheapestContractFor` is never the
|
|
545
|
+
* accessor for it, precisely because that function would hand back a Copilot
|
|
546
|
+
* model id for a launch that must never name one.
|
|
547
|
+
*/
|
|
548
|
+
function localContractFor(profileId) {
|
|
549
|
+
return profileId === "local2" ? LOCAL2_PROFILE_CONTRACT : LOCAL_PROFILE_CONTRACT;
|
|
550
|
+
}
|
|
551
|
+
/**
|
|
552
|
+
* The `local2` contract including its Advisor block.
|
|
553
|
+
*
|
|
554
|
+
* A dedicated accessor rather than a widening of `localContractFor`: the base
|
|
555
|
+
* local contract has NO advisor fields at the type level (Advisor-free by
|
|
556
|
+
* design), so reading `localContractFor(id).advisorModel` is a type error on
|
|
557
|
+
* the union. Every advisor site therefore has to name `local2` to reach this
|
|
558
|
+
* function — which is exactly the property the contract's doc asks for.
|
|
559
|
+
*/
|
|
560
|
+
function local2AdvisorContract() {
|
|
561
|
+
return LOCAL2_PROFILE_CONTRACT;
|
|
562
|
+
}
|
|
563
|
+
/**
|
|
285
564
|
* Human-readable model name for prose and descriptors. These strings reach
|
|
286
565
|
* the model's own instructions and the user's terminal, so they are spelled
|
|
287
566
|
* out rather than derived: "GPT-6.1 Sol" is not mechanical from the slug, and
|
|
@@ -301,12 +580,15 @@ function displayModelName(modelId) {
|
|
|
301
580
|
return MODEL_DISPLAY_NAMES[modelId] ?? modelId;
|
|
302
581
|
}
|
|
303
582
|
/**
|
|
304
|
-
* The model the cheapest-family prompt rewrite runs on.
|
|
305
|
-
*
|
|
306
|
-
*
|
|
583
|
+
* The model the cheapest-family prompt rewrite runs on.
|
|
584
|
+
*
|
|
585
|
+
* Read from `rewriteModel`, NOT `advisorModel`: the rewrite is always a Copilot
|
|
586
|
+
* dispatch, so a sibling whose consultants moved to the local endpoint must not
|
|
587
|
+
* hand a local slug to it. One call site serves every member and a future tier
|
|
588
|
+
* only has to change its contract.
|
|
307
589
|
*/
|
|
308
590
|
function cheapestRewriteModelFor(profileId) {
|
|
309
|
-
return cheapestContractFor(profileId).
|
|
591
|
+
return cheapestContractFor(profileId).rewriteModel;
|
|
310
592
|
}
|
|
311
593
|
//#endregion
|
|
312
594
|
//#region src/lib/cheapest-prompt-rewrite.ts
|
|
@@ -592,27 +874,51 @@ function decidePromptSubmit(input) {
|
|
|
592
874
|
return decision;
|
|
593
875
|
}
|
|
594
876
|
/**
|
|
877
|
+
* The tool name the tip and the scope note point at. Claude Code resolves the
|
|
878
|
+
* scoped `search` group under its bare key; Pi always prefixes its native MCP
|
|
879
|
+
* servers with `gh-router-` (`PI_MCP_SERVER_PREFIX`) so the same group lands
|
|
880
|
+
* under a different name there.
|
|
881
|
+
*
|
|
882
|
+
* Declared BEFORE `PROMPT_SEARCH_TIP`: that const evaluates at module load,
|
|
883
|
+
* so a declaration below it would still be in its temporal dead zone.
|
|
884
|
+
*/
|
|
885
|
+
const DEFAULT_PROMPT_SEARCH_TOOL = "mcp__search__code";
|
|
886
|
+
getPromptSearchTip(true);
|
|
887
|
+
/**
|
|
595
888
|
* Build the search tip for the launch's search backend. When Bluebird is
|
|
596
889
|
* enabled it owns both semantic and lexical calls; otherwise local ColBERT is
|
|
597
890
|
* used when enabled, or lexical-only search when neither backend is enabled.
|
|
891
|
+
*
|
|
892
|
+
* `searchToolName` exists because the advice is client-facing prose, not
|
|
893
|
+
* policy: the decision to search is identical everywhere, but Pi's MCP server
|
|
894
|
+
* keys carry a `gh-router-` prefix, so naming Claude's tool there would point
|
|
895
|
+
* the model at a tool it cannot call.
|
|
598
896
|
*/
|
|
599
|
-
function getPromptSearchTip(searchEnabled, bluebirdEnabled = false) {
|
|
600
|
-
|
|
601
|
-
if (
|
|
602
|
-
return
|
|
897
|
+
function getPromptSearchTip(searchEnabled, bluebirdEnabled = false, searchToolName = DEFAULT_PROMPT_SEARCH_TOOL) {
|
|
898
|
+
const tool = searchToolName;
|
|
899
|
+
if (bluebirdEnabled) return `TIP (advisory): when this task needs code context, search Bluebird semantic + lexical in parallel — two \`${tool}\` calls issued in the same turn. Bluebird failures are visible and do not fall back locally.`;
|
|
900
|
+
if (searchEnabled) return `TIP (advisory): when this task needs code context, search lexical + semantic in parallel — one \`${tool}\` call with mode:"lexical" and one with mode:"semantic", issued in the same turn — before concluding.`;
|
|
901
|
+
return `TIP (advisory): when this task needs code context, search lexical (\`${tool}\` with mode:"lexical"/"exact"/"regex" for exact symbols, filenames, errors, routes, flags, and config keys), issuing parallel calls in the same turn — before concluding.`;
|
|
603
902
|
}
|
|
604
903
|
/**
|
|
904
|
+
* The large-task escalation advice inside the scope note. Names the two Claude
|
|
905
|
+
* Code skills that compose a floor-raising run; a client without those skills
|
|
906
|
+
* passes its own sentence through `scopeAdvice`.
|
|
907
|
+
*/
|
|
908
|
+
const DEFAULT_PROMPT_SCOPE_ADVICE = "Consider /gh-research first to saturate understanding, then /gh-orchestrate to compose a floor-raising workflow.";
|
|
909
|
+
/**
|
|
605
910
|
* Build the scope-inference system prompt for the launch's search backend.
|
|
606
911
|
* Mirrors `getPromptSearchTip`: Bluebird and local ColBERT variants ground the
|
|
607
912
|
* inference in lexical + semantic results; the local-only variant in lexical results.
|
|
608
913
|
*/
|
|
609
|
-
function getPromptScopeSystem(searchEnabled, bluebirdEnabled = false) {
|
|
914
|
+
function getPromptScopeSystem(searchEnabled, bluebirdEnabled = false, scopeAdvice = DEFAULT_PROMPT_SCOPE_ADVICE) {
|
|
610
915
|
return `You are a scoping assistant for a coding agent about to act on a user's request. You are given the user's request and the results of ${bluebirdEnabled ? "a Bluebird lexical + semantic code search" : searchEnabled ? "a local lexical + semantic code search" : "a lexical code search"} over the relevant repository. Produce a SHORT advisory note (<= 120 words), plain text only:
|
|
611
916
|
1. SCOPE: one line — is this trivial, focused (one area), or large/cross-cutting — grounded in what the search surfaced (reference the most relevant file(s) by name).
|
|
612
917
|
2. GOAL: restate the user's OWN ask as a single measurable objective, in THEIR terms. Do NOT invent new requirements or acceptance criteria beyond what they asked.
|
|
613
|
-
3. Only if the task is large/cross-cutting, add a final line: "
|
|
918
|
+
3. Only if the task is large/cross-cutting, add a final line: "${scopeAdvice}" Omit it for a focused or trivial task.
|
|
614
919
|
This is advisory — the agent decides whether to follow it. Be concrete and concise; no preamble.`;
|
|
615
920
|
}
|
|
921
|
+
getPromptScopeSystem(true);
|
|
616
922
|
/** Max chars of each search-result blob fed into the scope inference. */
|
|
617
923
|
const SEARCH_CONTEXT_CAP = 6144;
|
|
618
924
|
/** Wrap the prior-turn review findings in an explicitly NON-AUTHORITATIVE frame. */
|
|
@@ -671,7 +977,8 @@ async function decidePromptSubmitV2(input) {
|
|
|
671
977
|
const searchEnabled = input.searchEnabled === true;
|
|
672
978
|
const bluebirdEnabled = input.bluebirdEnabled === true;
|
|
673
979
|
const semanticAvailable = searchEnabled || bluebirdEnabled;
|
|
674
|
-
const
|
|
980
|
+
const fallbackGoal = input.prose?.fallbackGoal ?? "GOAL (advisory): for a non-trivial task, FIRST run /gh-research on this ask to information saturation — verify the load-bearing claims against the actual code before planning, and do not plan or write code until research is saturated. THEN, for an implementation or change task, run /gh-orchestrate to compose and run a floor-raising workflow (it checkpoints before expensive work). Skip both for a trivial ask; you may decline if they do not fit.";
|
|
981
|
+
const searchTip = getPromptSearchTip(searchEnabled, bluebirdEnabled, input.prose?.searchToolName);
|
|
675
982
|
if (input.rewrite && isCheapestRewriteEligible({
|
|
676
983
|
profile: input.profile,
|
|
677
984
|
promptIsNonTrivial: isNonTrivialPrompt(prompt),
|
|
@@ -699,15 +1006,15 @@ async function decidePromptSubmitV2(input) {
|
|
|
699
1006
|
if (rewrite.timedOut) {
|
|
700
1007
|
decision.inject = joinSections([
|
|
701
1008
|
searchTip,
|
|
702
|
-
|
|
1009
|
+
fallbackGoal,
|
|
703
1010
|
findingsBlock
|
|
704
1011
|
]);
|
|
705
1012
|
return decision;
|
|
706
1013
|
}
|
|
707
1014
|
}
|
|
708
|
-
const scopeSystem = getPromptScopeSystem(searchEnabled, bluebirdEnabled);
|
|
1015
|
+
const scopeSystem = getPromptScopeSystem(searchEnabled, bluebirdEnabled, input.prose?.scopeAdvice);
|
|
709
1016
|
const timeoutMs = input.io.timeoutMs ?? 22e3;
|
|
710
|
-
let goal =
|
|
1017
|
+
let goal = fallbackGoal;
|
|
711
1018
|
let timer;
|
|
712
1019
|
const controller = new AbortController();
|
|
713
1020
|
try {
|
|
@@ -1137,6 +1444,6 @@ function buildStaticPack(workspace) {
|
|
|
1137
1444
|
};
|
|
1138
1445
|
}
|
|
1139
1446
|
//#endregion
|
|
1140
|
-
export { CHEAPEST_PROFILE_ADVISOR_MODEL as C,
|
|
1447
|
+
export { CHEAPEST_PROFILE_ADVISOR_MODEL as A, BALANCED2_PROFILE_MODELS as C, LOCAL_PROFILE_TIER_MODELS as D, LOCAL_PROFILE_NATIVE_MODELS as E, CHEAPEST_PROFILE_NATIVE_AGENT_NAMES as F, CHEAPEST_PROFILE_NATIVE_EFFORTS as I, CHEAPEST_PROFILE_ADVISOR_TRANSCRIPT_TOKENS_MAX as M, CHEAPEST_PROFILE_ADVISOR_TRANSCRIPT_TOKENS_MIN as N, CHEAPEST2_PROFILE_MODELS as O, CHEAPEST_PROFILE_MODELS as P, localContractFor as S, LOCAL_PROFILE_NATIVE_AGENT_NAMES as T, isCheapestFamily as _, decidePromptSubmitV2 as a, isPinnedLaunchProfile as b, CHEAPEST_REWRITE_EFFORT as c, runCheapestRewrite as d, balancedContractFor as f, isBalancedFamily as g, displayModelName as h, decidePromptSubmit as i, CHEAPEST_PROFILE_ADVISOR_TRANSCRIPT_TOKENS_DEFAULT as j, CHEAPEST_PROFILE_ADVISOR_CLIENT_MODEL as k, buildRebriefSystem as l, cheapestRewriteModelFor as m, PROMPT_STEER_GOAL as n, getPromptSearchTip as o, cheapestContractFor as p, buildPromptSubmitHookCommand as r, isNonTrivialPrompt as s, buildStaticPack as t, isCheapestRewriteDisabledEnv as u, isCheaplocalProfile as v, LOCAL_PROFILE_LEAD_MODEL as w, local2AdvisorContract as x, isLocalFamily as y };
|
|
1141
1448
|
|
|
1142
|
-
//# sourceMappingURL=static-context-pack-
|
|
1449
|
+
//# sourceMappingURL=static-context-pack-DvwLWlbe.js.map
|