github-router 0.3.322 → 0.3.324
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-BW3zMiCx.js → aic-ledger-DRU89gJg.js} +2 -2
- package/dist/{aic-ledger-BW3zMiCx.js.map → aic-ledger-DRU89gJg.js.map} +1 -1
- package/dist/{attribution-settings-z-U2L7ab.js → attribution-settings-sTUXqFzx.js} +649 -101
- package/dist/attribution-settings-sTUXqFzx.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-DtWf7DEw.js → claude-Bni6m56W.js} +61 -49
- package/dist/claude-Bni6m56W.js.map +1 -0
- package/dist/{codex-CDtFT-Qp.js → codex-DAnu246m.js} +5 -5
- package/dist/{codex-CDtFT-Qp.js.map → codex-DAnu246m.js.map} +1 -1
- package/dist/{copilot-discount-I6BrT7QE.js → copilot-discount-D8t7Q3Tp.js} +2 -2
- package/dist/{copilot-discount-I6BrT7QE.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-j_hQ1IPc.js → gate-discovery-Z0QyjqM7.js} +5 -5
- package/dist/{gate-discovery-j_hQ1IPc.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 +32 -12
- package/dist/hooks.sha256 +1 -1
- package/dist/{internal-aic-status-CKXxxb30.js → internal-aic-status-BaUKlisM.js} +3 -3
- package/dist/{internal-aic-status-CKXxxb30.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-CiFH6X1H.js → internal-first-mate-guard-Cj_g7RFr.js} +3 -3
- package/dist/{internal-first-mate-guard-CiFH6X1H.js.map → internal-first-mate-guard-Cj_g7RFr.js.map} +1 -1
- package/dist/{internal-first-mate-guard-B_or0eN3.js → internal-first-mate-guard-ZqPHrYlh.js} +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-BGTPRCtO.js → internal-stop-hook-DihBVzn2.js} +5 -5
- package/dist/{internal-stop-hook-BGTPRCtO.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-Dd14aDXQ.js} +2 -2
- package/dist/{internal-worker-guard-dxGawAY3.js.map → internal-worker-guard-Dd14aDXQ.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-Gb0LfII0.js → peer-mcp-personas-DcAErb_d.js} +201 -66
- 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-DagZEkdZ.js → provision-B-a5KUCL.js} +4 -4
- package/dist/{provision-DagZEkdZ.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-DOMsmIk-.js → serve-BGGcy8Nq.js} +14 -13
- package/dist/serve-BGGcy8Nq.js.map +1 -0
- package/dist/{server-setup-DQVRJluz.js → server-setup-CZ3tEsgq.js} +237 -49
- package/dist/server-setup-CZ3tEsgq.js.map +1 -0
- package/dist/{start-CqSFR_s8.js → start-XFIxMRkE.js} +3 -3
- package/dist/{start-CqSFR_s8.js.map → start-XFIxMRkE.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-CcQygiAA.js} +28 -2
- package/dist/{worker-dispatch-B-OA7tvU.js.map → worker-dispatch-CcQygiAA.js.map} +1 -1
- package/package.json +1 -1
- package/dist/attribution-settings-z-U2L7ab.js.map +0 -1
- package/dist/claude-DtWf7DEw.js.map +0 -1
- package/dist/engine-DA5laGIh.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-Gb0LfII0.js.map +0 -1
- package/dist/serve-DOMsmIk-.js.map +0 -1
- package/dist/server-setup-DQVRJluz.js.map +0 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { $ as EFFORT_ORDER, $t as
|
|
1
|
+
import { $ as EFFORT_ORDER, $n as withInstallLock, $t as MAX_RESPONSE_BODY_BYTES, An as upstreamMaxConnections, B as resolveAdvisorEffort, Bn as BALANCED_PROFILE_SUBAGENT_CONTEXT_TOKENS, Bt as countTokens, Cn as UPSTREAM_FETCH_TIMEOUT_MS, D as toolbeltEnabled, En as isBudgetClaudeLead, F as ADVISOR_TOOL_INSTRUCTIONS, Fn as withOneMSuffixForLead, G as repairKnownThinkingHistory, Gt as findLaunchBySecret, H as resolveCheapestAdvisorModel, Hn as CHEAPEST_PROFILE_MODELS, Ht as getTextTokenCount, I as FAST_ADVISOR_TOOL_INSTRUCTIONS, In as BALANCED_PROFILE_MODELS, J as buildOpenAIErrorEvent, Jn as CHEAP_PROFILE_MODELS, Jt as assembleResponsesPayload, K as repairRejectedThinkingHistory, Kn as CHEAPEST_PROFILE_SUBAGENT_CONTEXT_TOKENS, L as buildAdvisorStream, Ln as BALANCED_PROFILE_NATIVE_AGENT_NAMES, Mn as catalogAdvertises1M, N as searchWeb, Nn as oneMContextDisabled, P as ADVISOR_INTERNAL_TOOL_NAME, Pn as withOneMSuffix, Q as relayAnthropicStream, Qn as CHEAP_PROFILE_SUBAGENT_CONTEXT_TOKENS, Qt as createChatCompletions, R as injectAdvisorTool, Tn as generateRandomPort, U as formatThinkingRepairDecline, Un as CHEAPEST_PROFILE_NATIVE_AGENT_NAMES, Ut as getTokenCount, V as resolveAdvisorModel, Vn as CHEAPEST_PROFILE_ADVISOR_CLIENT_MODEL, Vt as createMessages, W as rememberThinkingHistoryRepair, Wt as getTokenizerFromModel, X as logStreamError, Xt as resolveMcpToolTimeoutMs, Y as isControllerClosedError, Yn as CHEAP_PROFILE_NATIVE_AGENT_NAMES, Yt as warnOnTokenPriceDrift, Z as readIteratorWithTimeout, Zt as createResponses, at as agentToolsEnabled, dn as provisionTreeSitterAssets, en as readResponseBodyCapped, et as UNKNOWN_EFFORT_ANCHOR, gn as toolbeltPathOverride, i as assertMcpToolSurfaceConsistent, it as handleMcpPost, jn as classifyMessagesRoute, kn as upstreamAllowH2, nn as normalizeOpenAIUsage, nt as clampEffort, q as buildAnthropicErrorEvent, qn as CHEAP_PROFILE_ADVISOR_CLIENT_MODEL, rt as handleMcpDelete, tn as parseJsonOrDiagnose, tt as bucketEffort, vn as BUDGET_SMALL_FAST_SLUG, wn as UPSTREAM_INACTIVITY_TIMEOUT_MS, z as isAdvisorRequested, zt as shimDefaultsToXhigh } from "./peer-mcp-personas-DcAErb_d.js";
|
|
2
2
|
import { t as getPackageVersion } from "./version-C8x2hQrZ.js";
|
|
3
|
-
import { i as ensurePaths, t as PATHS } from "./paths-
|
|
3
|
+
import { i as ensurePaths, t as PATHS } from "./paths-BnZwolac.js";
|
|
4
4
|
import { t as state } from "./state-BlMpEFAt.js";
|
|
5
|
-
import { T as copilotHeaders, _ as forwardError, a as cacheCopilotVersion, c as filterBetaHeader, d as resolveModel, f as sleep, g as HTTPError, i as tryRefreshAndRetry, l as isNullish, n as setupGitHubAgentToken, o as cacheModels, r as setupGitHubToken, s as cacheVSCodeVersion, t as setupCopilotToken, w as copilotBaseUrl, y as fetchWithTransientRetry } from "./token-
|
|
6
|
-
import { t as getCopilotUsage } from "./get-copilot-usage-
|
|
5
|
+
import { T as copilotHeaders, _ as forwardError, a as cacheCopilotVersion, c as filterBetaHeader, d as resolveModel, f as sleep, g as HTTPError, i as tryRefreshAndRetry, l as isNullish, n as setupGitHubAgentToken, o as cacheModels, r as setupGitHubToken, s as cacheVSCodeVersion, t as setupCopilotToken, w as copilotBaseUrl, y as fetchWithTransientRetry } from "./token-Css-ARGL.js";
|
|
6
|
+
import { t as getCopilotUsage } from "./get-copilot-usage-Bs-FEPMf.js";
|
|
7
7
|
import { c as runCommandVoid, i as parseBoolEnv, o as resolveExecutable, r as killManagedTree, s as runCommandCapture } from "./exec-COUT4QsS.js";
|
|
8
|
-
import { c as FAST_PROFILE_MODELS, l as FAST_PROFILE_NATIVE_AGENT_NAMES, r as FAST_PROFILE_ADVISOR_MODEL } from "./fast-profile-contract-
|
|
8
|
+
import { c as FAST_PROFILE_MODELS, l as FAST_PROFILE_NATIVE_AGENT_NAMES, r as FAST_PROFILE_ADVISOR_MODEL } from "./fast-profile-contract-DmsyQQrw.js";
|
|
9
9
|
import { A as normalizeTrailingOneMSuffix, a as MAX_PROFILE_NATIVE_AGENT_NAMES, d as maxAdvisorPinIsValid, h as maxOpusModel, i as MAX_PROFILE_MODELS, j as stripTrailingOneMSuffix, k as fastEndpointForModel, l as maxAdvisorEffortForModel, n as MAX_PROFILE_ALLOWED_LEAD_MODEL_IDS, t as MAX_PROFILE_ADVISOR_INSTRUCTIONS, u as maxAdvisorModelFromPin, y as validateMaxProfilePrerequisites } from "./max-profile-contract-Bl7I_EOC.js";
|
|
10
|
-
import { a as extractAndRecordPricedAic, f as copilotUsageToWire, h as nanoAiuToCredits, i as extractAndRecordAic, l as recordAic, m as formatAic, p as extractCopilotUsage } from "./aic-ledger-
|
|
10
|
+
import { a as extractAndRecordPricedAic, f as copilotUsageToWire, h as nanoAiuToCredits, i as extractAndRecordAic, l as recordAic, m as formatAic, p as extractCopilotUsage } from "./aic-ledger-DRU89gJg.js";
|
|
11
11
|
import consola from "consola";
|
|
12
12
|
import fs, { existsSync } from "node:fs";
|
|
13
13
|
import path from "node:path";
|
|
@@ -362,8 +362,8 @@ const STANDARD_PROFILE = Object.freeze({
|
|
|
362
362
|
hasCoordinator: true
|
|
363
363
|
});
|
|
364
364
|
/**
|
|
365
|
-
* The `-m fast` roster: exactly
|
|
366
|
-
* `
|
|
365
|
+
* The `-m fast` roster: exactly four native agents (`Explore`, `Plan`,
|
|
366
|
+
* `General-Purpose`, `Reviewer`), the fast-only `oracle` peer
|
|
367
367
|
* tool, no coordinator, and `peers`/`search` plus optional browser and
|
|
368
368
|
* browse-only worker groups. Core workers, `orchestrate`, `decide`, `fleet`,
|
|
369
369
|
* and `first-mate` remain hard denies even when their standard gates pass.
|
|
@@ -440,6 +440,25 @@ const CHEAPEST_PROFILE = Object.freeze({
|
|
|
440
440
|
hasCoordinator: false
|
|
441
441
|
});
|
|
442
442
|
/**
|
|
443
|
+
* The `-m balanced` roster: the most-complex-tasks tier. A Sol/high lead at
|
|
444
|
+
* the 200K default window, the same four-agent surface as cheap
|
|
445
|
+
* (`Explore`/`Plan`/`General-Purpose`/`Reviewer`, every role at 200K), and
|
|
446
|
+
* the Grok-4.6/medium Oracle-only peer set. Hard-denies match fast's: core
|
|
447
|
+
* workers, `orchestrate`, `decide`, `fleet`, and `first-mate`.
|
|
448
|
+
*/
|
|
449
|
+
const BALANCED_PROFILE = Object.freeze({
|
|
450
|
+
id: "balanced",
|
|
451
|
+
nativeRoster: new Set(BALANCED_PROFILE_NATIVE_AGENT_NAMES),
|
|
452
|
+
personaAllowlist: /* @__PURE__ */ new Set(["oracle"]),
|
|
453
|
+
allowedGroups: /* @__PURE__ */ new Set([
|
|
454
|
+
"peers",
|
|
455
|
+
"search",
|
|
456
|
+
"workers",
|
|
457
|
+
"browser"
|
|
458
|
+
]),
|
|
459
|
+
hasCoordinator: false
|
|
460
|
+
});
|
|
461
|
+
/**
|
|
443
462
|
* The `-m max` profile: Sol/Luna-led, browse-only workers, and explicit
|
|
444
463
|
* cross-lab peer names. The descriptor is a hard projection for bound launch
|
|
445
464
|
* requests; unbound/BYO traffic remains standard because it has no registry
|
|
@@ -475,6 +494,7 @@ function profileDescriptor(id) {
|
|
|
475
494
|
if (id === "cheap1m") return CHEAP1M_PROFILE;
|
|
476
495
|
if (id === "cheap") return CHEAP_PROFILE;
|
|
477
496
|
if (id === "cheapest") return CHEAPEST_PROFILE;
|
|
497
|
+
if (id === "balanced") return BALANCED_PROFILE;
|
|
478
498
|
return STANDARD_PROFILE;
|
|
479
499
|
}
|
|
480
500
|
/**
|
|
@@ -495,6 +515,7 @@ function resolveLaunchProfile(modelArg) {
|
|
|
495
515
|
if (arg === "cheap1m") return "cheap1m";
|
|
496
516
|
if (arg === "cheap") return "cheap";
|
|
497
517
|
if (arg === "cheapest") return "cheapest";
|
|
518
|
+
if (arg === "balanced") return "balanced";
|
|
498
519
|
return "standard";
|
|
499
520
|
}
|
|
500
521
|
function validateMaxProfileLaunch(catalog) {
|
|
@@ -543,6 +564,17 @@ const CHEAPEST_PLAN_ALIAS_ID = "gh-router-cheapest-plan-high";
|
|
|
543
564
|
const CHEAPEST_GENERAL_PURPOSE_ALIAS_ID = "gh-router-cheapest-general-purpose-xhigh";
|
|
544
565
|
const CHEAPEST_IMPLEMENTER_ALIAS_ID = "gh-router-cheapest-implementer-max";
|
|
545
566
|
const CHEAPEST_REVIEWER_ALIAS_ID = "gh-router-cheapest-reviewer-high";
|
|
567
|
+
/**
|
|
568
|
+
* Balanced-profile subagent aliases (`-m balanced`). Same non-catalog
|
|
569
|
+
* mechanism as the cheap aliases above, with the balanced roster's own
|
|
570
|
+
* identities and efforts (`BALANCED_PROFILE_NATIVE_MODELS` /
|
|
571
|
+
* `BALANCED_PROFILE_NATIVE_EFFORTS`, pinned by a drift test). Emitted BARE by
|
|
572
|
+
* `buildBalancedProfileAgentDefinitions`.
|
|
573
|
+
*/
|
|
574
|
+
const BALANCED_EXPLORE_ALIAS_ID = "gh-router-balanced-explore-high";
|
|
575
|
+
const BALANCED_PLAN_ALIAS_ID = "gh-router-balanced-plan-high";
|
|
576
|
+
const BALANCED_GENERAL_PURPOSE_ALIAS_ID = "gh-router-balanced-general-purpose-high";
|
|
577
|
+
const BALANCED_REVIEWER_ALIAS_ID = "gh-router-balanced-reviewer-max";
|
|
546
578
|
const LUNA_SONNET_ALIAS_ID = "gh-router-luna-sonnet-xhigh";
|
|
547
579
|
/**
|
|
548
580
|
* Router-owned alias id for the fast profile's Haiku-tier row
|
|
@@ -554,9 +586,25 @@ const LUNA_HAIKU_ALIAS_ID = "gh-router-luna-haiku-high";
|
|
|
554
586
|
* boundary and are never valid on standard or fast launches. */
|
|
555
587
|
const MAX_LUNA_HIGH_ALIAS_ID = "gh-router-max-luna-high";
|
|
556
588
|
const MAX_LUNA_MAX_ALIAS_ID = "gh-router-max-luna-max";
|
|
589
|
+
/**
|
|
590
|
+
* Pipeline skill aliases (`/gh-gather-context`, `/gh-plan`, `/gh-implement`).
|
|
591
|
+
* Router-owned, non-catalog identities shared by every pinned profile: all
|
|
592
|
+
* skill models run at the 200K DEFAULT window with bare slugs, so the alias
|
|
593
|
+
* only carries the fixed effort until the authenticated request boundary.
|
|
594
|
+
* Emitted BARE (no `[1m]`) wherever skill worker briefs name a model.
|
|
595
|
+
*/
|
|
596
|
+
const SKILL_GATHER_CONTEXT_LEAD_ALIAS_ID = "gh-router-skill-gather-context-lead-high";
|
|
597
|
+
const SKILL_GATHER_CONTEXT_EXPLORE_ALIAS_ID = "gh-router-skill-gather-context-explore-high";
|
|
598
|
+
const SKILL_PLAN_LEAD_ALIAS_ID = "gh-router-skill-plan-lead-medium";
|
|
599
|
+
const SKILL_IMPLEMENT_LEAD_ALIAS_ID = "gh-router-skill-implement-lead-max";
|
|
600
|
+
const SKILL_IMPLEMENT_TASK_ALIAS_ID = "gh-router-skill-implement-task-max";
|
|
601
|
+
const SKILL_REVIEW_PASS1_ALIAS_ID = "gh-router-skill-review-pass1-max";
|
|
602
|
+
const SKILL_REVIEW_PASS2_ALIAS_ID = "gh-router-skill-review-pass2-medium";
|
|
557
603
|
/** The real Copilot catalog id every Luna alias (including the driver
|
|
558
604
|
* itself) canonicalizes to. */
|
|
559
605
|
const LUNA_REAL_MODEL_ID = FAST_PROFILE_MODELS.luna;
|
|
606
|
+
/** The real Copilot catalog id every Sol skill alias canonicalizes to. */
|
|
607
|
+
const SKILL_SOL_REAL_MODEL_ID = FAST_PROFILE_MODELS.plan;
|
|
560
608
|
const MAX_ALIAS_IDS = /* @__PURE__ */ new Set([MAX_LUNA_HIGH_ALIAS_ID, MAX_LUNA_MAX_ALIAS_ID]);
|
|
561
609
|
function isMaxModelAlias(id) {
|
|
562
610
|
return MAX_ALIAS_IDS.has(stripTrailingOneMSuffix(id).base);
|
|
@@ -624,13 +672,13 @@ const MODEL_ALIAS_TABLE = /* @__PURE__ */ new Map([
|
|
|
624
672
|
}],
|
|
625
673
|
[CHEAP_GENERAL_PURPOSE_ALIAS_ID, {
|
|
626
674
|
aliasId: CHEAP_GENERAL_PURPOSE_ALIAS_ID,
|
|
627
|
-
realModel: CHEAP_PROFILE_MODELS["
|
|
675
|
+
realModel: CHEAP_PROFILE_MODELS["General-Purpose"],
|
|
628
676
|
absentEffortDefault: "max"
|
|
629
677
|
}],
|
|
630
678
|
[CHEAP_IMPLEMENTER_ALIAS_ID, {
|
|
631
679
|
aliasId: CHEAP_IMPLEMENTER_ALIAS_ID,
|
|
632
|
-
realModel: CHEAP_PROFILE_MODELS
|
|
633
|
-
absentEffortDefault: "
|
|
680
|
+
realModel: CHEAP_PROFILE_MODELS["General-Purpose"],
|
|
681
|
+
absentEffortDefault: "max"
|
|
634
682
|
}],
|
|
635
683
|
[CHEAP_REVIEWER_ALIAS_ID, {
|
|
636
684
|
aliasId: CHEAP_REVIEWER_ALIAS_ID,
|
|
@@ -649,18 +697,73 @@ const MODEL_ALIAS_TABLE = /* @__PURE__ */ new Map([
|
|
|
649
697
|
}],
|
|
650
698
|
[CHEAPEST_GENERAL_PURPOSE_ALIAS_ID, {
|
|
651
699
|
aliasId: CHEAPEST_GENERAL_PURPOSE_ALIAS_ID,
|
|
652
|
-
realModel: CHEAPEST_PROFILE_MODELS["
|
|
653
|
-
absentEffortDefault: "
|
|
700
|
+
realModel: CHEAPEST_PROFILE_MODELS["General-Purpose"],
|
|
701
|
+
absentEffortDefault: "max"
|
|
654
702
|
}],
|
|
655
703
|
[CHEAPEST_IMPLEMENTER_ALIAS_ID, {
|
|
656
704
|
aliasId: CHEAPEST_IMPLEMENTER_ALIAS_ID,
|
|
657
|
-
realModel: CHEAPEST_PROFILE_MODELS
|
|
705
|
+
realModel: CHEAPEST_PROFILE_MODELS["General-Purpose"],
|
|
658
706
|
absentEffortDefault: "max"
|
|
659
707
|
}],
|
|
660
708
|
[CHEAPEST_REVIEWER_ALIAS_ID, {
|
|
661
709
|
aliasId: CHEAPEST_REVIEWER_ALIAS_ID,
|
|
662
710
|
realModel: CHEAPEST_PROFILE_MODELS.reviewer,
|
|
663
711
|
absentEffortDefault: "high"
|
|
712
|
+
}],
|
|
713
|
+
[BALANCED_EXPLORE_ALIAS_ID, {
|
|
714
|
+
aliasId: BALANCED_EXPLORE_ALIAS_ID,
|
|
715
|
+
realModel: BALANCED_PROFILE_MODELS.explore,
|
|
716
|
+
absentEffortDefault: "high"
|
|
717
|
+
}],
|
|
718
|
+
[BALANCED_PLAN_ALIAS_ID, {
|
|
719
|
+
aliasId: BALANCED_PLAN_ALIAS_ID,
|
|
720
|
+
realModel: BALANCED_PROFILE_MODELS.plan,
|
|
721
|
+
absentEffortDefault: "high"
|
|
722
|
+
}],
|
|
723
|
+
[BALANCED_GENERAL_PURPOSE_ALIAS_ID, {
|
|
724
|
+
aliasId: BALANCED_GENERAL_PURPOSE_ALIAS_ID,
|
|
725
|
+
realModel: BALANCED_PROFILE_MODELS["General-Purpose"],
|
|
726
|
+
absentEffortDefault: "high"
|
|
727
|
+
}],
|
|
728
|
+
[BALANCED_REVIEWER_ALIAS_ID, {
|
|
729
|
+
aliasId: BALANCED_REVIEWER_ALIAS_ID,
|
|
730
|
+
realModel: BALANCED_PROFILE_MODELS.reviewer,
|
|
731
|
+
absentEffortDefault: "max"
|
|
732
|
+
}],
|
|
733
|
+
[SKILL_GATHER_CONTEXT_LEAD_ALIAS_ID, {
|
|
734
|
+
aliasId: SKILL_GATHER_CONTEXT_LEAD_ALIAS_ID,
|
|
735
|
+
realModel: LUNA_REAL_MODEL_ID,
|
|
736
|
+
absentEffortDefault: "high"
|
|
737
|
+
}],
|
|
738
|
+
[SKILL_GATHER_CONTEXT_EXPLORE_ALIAS_ID, {
|
|
739
|
+
aliasId: SKILL_GATHER_CONTEXT_EXPLORE_ALIAS_ID,
|
|
740
|
+
realModel: LUNA_REAL_MODEL_ID,
|
|
741
|
+
absentEffortDefault: "high"
|
|
742
|
+
}],
|
|
743
|
+
[SKILL_PLAN_LEAD_ALIAS_ID, {
|
|
744
|
+
aliasId: SKILL_PLAN_LEAD_ALIAS_ID,
|
|
745
|
+
realModel: SKILL_SOL_REAL_MODEL_ID,
|
|
746
|
+
absentEffortDefault: "medium"
|
|
747
|
+
}],
|
|
748
|
+
[SKILL_IMPLEMENT_LEAD_ALIAS_ID, {
|
|
749
|
+
aliasId: SKILL_IMPLEMENT_LEAD_ALIAS_ID,
|
|
750
|
+
realModel: LUNA_REAL_MODEL_ID,
|
|
751
|
+
absentEffortDefault: "max"
|
|
752
|
+
}],
|
|
753
|
+
[SKILL_IMPLEMENT_TASK_ALIAS_ID, {
|
|
754
|
+
aliasId: SKILL_IMPLEMENT_TASK_ALIAS_ID,
|
|
755
|
+
realModel: LUNA_REAL_MODEL_ID,
|
|
756
|
+
absentEffortDefault: "max"
|
|
757
|
+
}],
|
|
758
|
+
[SKILL_REVIEW_PASS1_ALIAS_ID, {
|
|
759
|
+
aliasId: SKILL_REVIEW_PASS1_ALIAS_ID,
|
|
760
|
+
realModel: LUNA_REAL_MODEL_ID,
|
|
761
|
+
absentEffortDefault: "max"
|
|
762
|
+
}],
|
|
763
|
+
[SKILL_REVIEW_PASS2_ALIAS_ID, {
|
|
764
|
+
aliasId: SKILL_REVIEW_PASS2_ALIAS_ID,
|
|
765
|
+
realModel: SKILL_SOL_REAL_MODEL_ID,
|
|
766
|
+
absentEffortDefault: "medium"
|
|
664
767
|
}]
|
|
665
768
|
]);
|
|
666
769
|
/**
|
|
@@ -721,10 +824,10 @@ function hasUsablePromptMetadata(model) {
|
|
|
721
824
|
* than silently substituting or dropping an agent.
|
|
722
825
|
*
|
|
723
826
|
* Checks, per the fast-launch-profile design:
|
|
724
|
-
* - Luna
|
|
827
|
+
* - Luna Explore: tool calls, >=1M, high+max, Responses.
|
|
725
828
|
* - Sol Plan: tool calls, >=1M, high, Responses.
|
|
726
|
-
* -
|
|
727
|
-
* - Gemini
|
|
829
|
+
* - Sonnet reviewer: tool calls, >=1M, xhigh, Messages, prompt metadata.
|
|
830
|
+
* - Gemini lead/General-Purpose: tool calls, >=1M, high, chat-completions.
|
|
728
831
|
* - Opus Oracle: exact Opus 5, >=1M, adaptive/high, Messages, prompt metadata.
|
|
729
832
|
*
|
|
730
833
|
* Pure over the passed-in catalog snapshot so it's unit-testable without
|
|
@@ -758,13 +861,13 @@ function validateFastProfilePrerequisites(catalog) {
|
|
|
758
861
|
if (!hasUsablePromptMetadata(sonnet)) missing.push(`${FAST_PROFILE_MODELS.reviewer}: no usable max_prompt_tokens metadata`);
|
|
759
862
|
if (!supportsEndpoint(sonnet, "messages")) missing.push(`${FAST_PROFILE_MODELS.reviewer}: does not advertise a supported Messages endpoint`);
|
|
760
863
|
}
|
|
761
|
-
const gemini = findModel(catalog, FAST_PROFILE_MODELS.
|
|
762
|
-
if (!gemini) missing.push(`${FAST_PROFILE_MODELS.
|
|
864
|
+
const gemini = findModel(catalog, FAST_PROFILE_MODELS.gemini);
|
|
865
|
+
if (!gemini) missing.push(`${FAST_PROFILE_MODELS.gemini}: absent from the live catalog`);
|
|
763
866
|
else {
|
|
764
|
-
if (!hasToolCalls(gemini)) missing.push(`${FAST_PROFILE_MODELS.
|
|
765
|
-
if (!hasContextAtLeast(gemini, FAST_REQUIRED_CONTEXT_TOKENS)) missing.push(`${FAST_PROFILE_MODELS.
|
|
766
|
-
if (!supportsEffort(gemini, "high")) missing.push(`${FAST_PROFILE_MODELS.
|
|
767
|
-
if (!supportsEndpoint(gemini, "chat")) missing.push(`${FAST_PROFILE_MODELS.
|
|
867
|
+
if (!hasToolCalls(gemini)) missing.push(`${FAST_PROFILE_MODELS.gemini}: does not advertise tool_calls`);
|
|
868
|
+
if (!hasContextAtLeast(gemini, FAST_REQUIRED_CONTEXT_TOKENS)) missing.push(`${FAST_PROFILE_MODELS.gemini}: advertised context window is below 1M`);
|
|
869
|
+
if (!supportsEffort(gemini, "high")) missing.push(`${FAST_PROFILE_MODELS.gemini}: does not advertise a "high" reasoning effort`);
|
|
870
|
+
if (!supportsEndpoint(gemini, "chat")) missing.push(`${FAST_PROFILE_MODELS.gemini}: does not advertise a supported chat-completions endpoint`);
|
|
768
871
|
}
|
|
769
872
|
const opus = findModel(catalog, FAST_PROFILE_MODELS.oracle);
|
|
770
873
|
if (!opus) missing.push(`${FAST_PROFILE_MODELS.oracle}: absent from the live catalog`);
|
|
@@ -795,7 +898,7 @@ const CHEAP_SUBAGENT_MIN_CONTEXT_TOKENS = CHEAP_PROFILE_SUBAGENT_CONTEXT_TOKENS;
|
|
|
795
898
|
/**
|
|
796
899
|
* Shared cheap-family roster prerequisite check, parameterized only by the
|
|
797
900
|
* LEAD's context gate. Both `-m cheap` (200K lead floor) and `-m cheap1m`
|
|
798
|
-
* (1M lead window) validate the EXACT same
|
|
901
|
+
* (1M lead window) validate the EXACT same four-agent roster: the lead gate
|
|
799
902
|
* is the only requirement that differs between the two cheap siblings, and
|
|
800
903
|
* every subagent runs at the 200K default window either way. A non-1M
|
|
801
904
|
* luna/sol/sonnet/grok is acceptable as long as the roster models advertise
|
|
@@ -932,6 +1035,60 @@ function validateCheapestProfilePrerequisites(catalog) {
|
|
|
932
1035
|
function formatCheapestPrerequisiteFailure(missing) {
|
|
933
1036
|
return "github-router claude -m cheapest requires the following live-catalog capabilities, which this account's catalog does not fully provide:\n" + missing.map((m) => ` - ${m}`).join("\n") + "\n\nFalling back or silently dropping an agent is not supported for the cheapest profile's exact roster. Run plain `github-router claude` instead.";
|
|
934
1037
|
}
|
|
1038
|
+
/** The subagent window floor: every balanced role runs at the 200K default. */
|
|
1039
|
+
const BALANCED_SUBAGENT_MIN_CONTEXT_TOKENS = BALANCED_PROFILE_SUBAGENT_CONTEXT_TOKENS;
|
|
1040
|
+
/**
|
|
1041
|
+
* Validate the live Copilot catalog for `-m balanced`: Sol lead at the 200K
|
|
1042
|
+
* default window, Luna Explore/Reviewer roles, Sol Plan, Gemini
|
|
1043
|
+
* General-Purpose, and a Grok Oracle — all at the 200K default with their
|
|
1044
|
+
* fixed efforts and supported endpoints.
|
|
1045
|
+
*/
|
|
1046
|
+
function validateBalancedProfilePrerequisites(catalog) {
|
|
1047
|
+
const missing = [];
|
|
1048
|
+
const sol = findModel(catalog, BALANCED_PROFILE_MODELS.lead);
|
|
1049
|
+
if (!sol) missing.push(`${BALANCED_PROFILE_MODELS.lead}: absent from the live catalog`);
|
|
1050
|
+
else {
|
|
1051
|
+
if (!hasToolCalls(sol)) missing.push(`${BALANCED_PROFILE_MODELS.lead}: does not advertise tool_calls`);
|
|
1052
|
+
if (!hasContextAtLeast(sol, BALANCED_SUBAGENT_MIN_CONTEXT_TOKENS)) missing.push(`${BALANCED_PROFILE_MODELS.lead}: advertised context window is below the 200K subagent floor`);
|
|
1053
|
+
if (!supportsEffort(sol, "high")) missing.push(`${BALANCED_PROFILE_MODELS.lead}: does not advertise a "high" reasoning effort`);
|
|
1054
|
+
if (!supportsEndpoint(sol, "responses")) missing.push(`${BALANCED_PROFILE_MODELS.lead}: does not advertise a supported Responses endpoint`);
|
|
1055
|
+
}
|
|
1056
|
+
const luna = findModel(catalog, BALANCED_PROFILE_MODELS.explore);
|
|
1057
|
+
if (!luna) missing.push(`${BALANCED_PROFILE_MODELS.explore}: absent from the live catalog`);
|
|
1058
|
+
else {
|
|
1059
|
+
if (!hasToolCalls(luna)) missing.push(`${BALANCED_PROFILE_MODELS.explore}: does not advertise tool_calls`);
|
|
1060
|
+
if (!hasContextAtLeast(luna, BALANCED_SUBAGENT_MIN_CONTEXT_TOKENS)) missing.push(`${BALANCED_PROFILE_MODELS.explore}: advertised context window is below the 200K subagent floor`);
|
|
1061
|
+
if (!supportsEffort(luna, "high") || !supportsEffort(luna, "max")) missing.push(`${BALANCED_PROFILE_MODELS.explore}: does not advertise both "high" and "max" reasoning effort`);
|
|
1062
|
+
if (!supportsEndpoint(luna, "responses")) missing.push(`${BALANCED_PROFILE_MODELS.explore}: does not advertise a supported Responses endpoint`);
|
|
1063
|
+
}
|
|
1064
|
+
const gemini = findModel(catalog, BALANCED_PROFILE_MODELS["General-Purpose"]);
|
|
1065
|
+
if (!gemini) missing.push(`${BALANCED_PROFILE_MODELS["General-Purpose"]}: absent from the live catalog`);
|
|
1066
|
+
else {
|
|
1067
|
+
if (!hasToolCalls(gemini)) missing.push(`${BALANCED_PROFILE_MODELS["General-Purpose"]}: does not advertise tool_calls`);
|
|
1068
|
+
if (!hasContextAtLeast(gemini, BALANCED_SUBAGENT_MIN_CONTEXT_TOKENS)) missing.push(`${BALANCED_PROFILE_MODELS["General-Purpose"]}: advertised context window is below the 200K subagent floor`);
|
|
1069
|
+
if (!supportsEffort(gemini, "high")) missing.push(`${BALANCED_PROFILE_MODELS["General-Purpose"]}: does not advertise a "high" reasoning effort`);
|
|
1070
|
+
if (!supportsEndpoint(gemini, "chat")) missing.push(`${BALANCED_PROFILE_MODELS["General-Purpose"]}: does not advertise a supported chat-completions endpoint`);
|
|
1071
|
+
}
|
|
1072
|
+
const grok = findModel(catalog, BALANCED_PROFILE_MODELS.oracle);
|
|
1073
|
+
if (!grok) missing.push(`${BALANCED_PROFILE_MODELS.oracle}: absent from the live catalog`);
|
|
1074
|
+
else {
|
|
1075
|
+
if (!hasContextAtLeast(grok, BALANCED_SUBAGENT_MIN_CONTEXT_TOKENS)) missing.push(`${BALANCED_PROFILE_MODELS.oracle}: advertised context window is below the 200K subagent floor`);
|
|
1076
|
+
if (!supportsEffort(grok, "medium")) missing.push(`${BALANCED_PROFILE_MODELS.oracle}: does not advertise a "medium" reasoning effort`);
|
|
1077
|
+
if (!hasUsablePromptMetadata(grok)) missing.push(`${BALANCED_PROFILE_MODELS.oracle}: no usable max_prompt_tokens metadata`);
|
|
1078
|
+
if (!supportsEndpoint(grok, "responses")) missing.push(`${BALANCED_PROFILE_MODELS.oracle}: does not advertise a supported Responses endpoint`);
|
|
1079
|
+
}
|
|
1080
|
+
return {
|
|
1081
|
+
ok: missing.length === 0,
|
|
1082
|
+
missing
|
|
1083
|
+
};
|
|
1084
|
+
}
|
|
1085
|
+
/**
|
|
1086
|
+
* Format `validateBalancedProfilePrerequisites`'s failure list into the
|
|
1087
|
+
* launch error message.
|
|
1088
|
+
*/
|
|
1089
|
+
function formatBalancedPrerequisiteFailure(missing) {
|
|
1090
|
+
return "github-router claude -m balanced requires the following live-catalog capabilities, which this account's catalog does not fully provide:\n" + missing.map((m) => ` - ${m}`).join("\n") + "\n\nFalling back or silently dropping an agent is not supported for the balanced profile's exact roster. Run plain `github-router claude` instead.";
|
|
1091
|
+
}
|
|
935
1092
|
//#endregion
|
|
936
1093
|
//#region src/lib/file-log-reporter.ts
|
|
937
1094
|
const MAX_LOG_BYTES = 1048576;
|
|
@@ -1316,6 +1473,32 @@ const CHEAPEST_PICKER_MODELS = Object.freeze([
|
|
|
1316
1473
|
neverOneM: true
|
|
1317
1474
|
}
|
|
1318
1475
|
]);
|
|
1476
|
+
const BALANCED_PICKER_MODELS = Object.freeze([
|
|
1477
|
+
{
|
|
1478
|
+
id: "gpt-5.6-sol",
|
|
1479
|
+
label: "GPT-5.6 Sol",
|
|
1480
|
+
behavesAs: "claude-opus-5",
|
|
1481
|
+
neverOneM: true
|
|
1482
|
+
},
|
|
1483
|
+
{
|
|
1484
|
+
id: "gpt-5.6-luna",
|
|
1485
|
+
label: "GPT-5.6 Luna",
|
|
1486
|
+
behavesAs: "claude-opus-5",
|
|
1487
|
+
neverOneM: true
|
|
1488
|
+
},
|
|
1489
|
+
{
|
|
1490
|
+
id: "gemini-3.8-flash",
|
|
1491
|
+
label: "Gemini 3.8 Flash",
|
|
1492
|
+
behavesAs: "claude-sonnet-5",
|
|
1493
|
+
neverOneM: true
|
|
1494
|
+
},
|
|
1495
|
+
{
|
|
1496
|
+
id: "grok-4.6",
|
|
1497
|
+
label: "Grok 4.6",
|
|
1498
|
+
behavesAs: "claude-sonnet-5",
|
|
1499
|
+
neverOneM: true
|
|
1500
|
+
}
|
|
1501
|
+
]);
|
|
1319
1502
|
/**
|
|
1320
1503
|
* Return the ordered, profile-specific `/model` rows supported by the live
|
|
1321
1504
|
* Copilot catalog. Fast intentionally shares Standard's four-row inventory;
|
|
@@ -1333,7 +1516,7 @@ function selectableModelsInCatalog(profile) {
|
|
|
1333
1516
|
const catalog = state.models?.data;
|
|
1334
1517
|
if (!catalog || catalog.length === 0) return [];
|
|
1335
1518
|
const present = new Set(catalog.map((entry) => entry.id));
|
|
1336
|
-
return (profile === "max" ? MAX_PICKER_MODELS : profile === "cheap" || profile === "cheap1m" ? CHEAP_PICKER_MODELS : profile === "cheapest" ? CHEAPEST_PICKER_MODELS : STANDARD_PICKER_MODELS).filter((entry) => present.has(entry.id)).map((entry) => ({
|
|
1519
|
+
return (profile === "max" ? MAX_PICKER_MODELS : profile === "cheap" || profile === "cheap1m" ? CHEAP_PICKER_MODELS : profile === "cheapest" ? CHEAPEST_PICKER_MODELS : profile === "balanced" ? BALANCED_PICKER_MODELS : STANDARD_PICKER_MODELS).filter((entry) => present.has(entry.id)).map((entry) => ({
|
|
1337
1520
|
model: entry.neverOneM ? entry.id : withOneMSuffix(entry.id),
|
|
1338
1521
|
label: entry.label,
|
|
1339
1522
|
behavesAs: entry.behavesAs
|
|
@@ -1371,7 +1554,7 @@ async function renameSettingsWithRetry(temp, target) {
|
|
|
1371
1554
|
* 200K session's `/model` UI.
|
|
1372
1555
|
*/
|
|
1373
1556
|
function routerWinsPicker(profile) {
|
|
1374
|
-
return profile === "fast" || profile === "cheap" || profile === "cheap1m" || profile === "cheapest";
|
|
1557
|
+
return profile === "fast" || profile === "cheap" || profile === "cheap1m" || profile === "cheapest" || profile === "balanced";
|
|
1375
1558
|
}
|
|
1376
1559
|
function modelIdsFromExistingPicker(value) {
|
|
1377
1560
|
if (!value || typeof value !== "object" || Array.isArray(value)) return [];
|
|
@@ -2291,7 +2474,7 @@ function collectToolFieldKeys(body) {
|
|
|
2291
2474
|
//#endregion
|
|
2292
2475
|
//#region package.json
|
|
2293
2476
|
var name = "github-router";
|
|
2294
|
-
var version = "0.3.
|
|
2477
|
+
var version = "0.3.324";
|
|
2295
2478
|
//#endregion
|
|
2296
2479
|
//#region src/lib/approval.ts
|
|
2297
2480
|
const awaitApproval = async () => {
|
|
@@ -5443,7 +5626,7 @@ function preprocessMaxRequest(rawBody, launch, subagentRequest = false) {
|
|
|
5443
5626
|
Object.freeze([MAX_LUNA_HIGH_ALIAS_ID, MAX_LUNA_MAX_ALIAS_ID]);
|
|
5444
5627
|
//#endregion
|
|
5445
5628
|
//#region src/lib/fast-request-preprocess.ts
|
|
5446
|
-
const cheapFamily = (profileId) => profileId === "cheap" || profileId === "cheap1m" || profileId === "cheapest";
|
|
5629
|
+
const cheapFamily = (profileId) => profileId === "cheap" || profileId === "cheap1m" || profileId === "cheapest" || profileId === "balanced";
|
|
5447
5630
|
const pinnedProfile = (profileId) => profileId === "fast" || cheapFamily(profileId);
|
|
5448
5631
|
/**
|
|
5449
5632
|
* Profiles whose every selectable `/model` row must stay at Claude Code's
|
|
@@ -5451,24 +5634,25 @@ const pinnedProfile = (profileId) => profileId === "fast" || cheapFamily(profile
|
|
|
5451
5634
|
* `fast` keeps 1M on lead and subagents by design; `cheap1m` keeps 1M on
|
|
5452
5635
|
* the lead only (its subagents are bare-by-construction).
|
|
5453
5636
|
*/
|
|
5454
|
-
const bareEnforcedProfile = (profileId) => profileId === "cheap" || profileId === "cheapest";
|
|
5637
|
+
const bareEnforcedProfile = (profileId) => profileId === "cheap" || profileId === "cheapest" || profileId === "balanced";
|
|
5455
5638
|
function explicitEffortOf(value) {
|
|
5456
5639
|
return typeof value === "string" && value.trim() !== "" ? value : void 0;
|
|
5457
5640
|
}
|
|
5458
5641
|
/**
|
|
5459
|
-
* Apply authenticated fast/cheap-profile model and effort policy before
|
|
5642
|
+
* Apply authenticated fast/cheap/balanced-profile model and effort policy before
|
|
5460
5643
|
* ordinary model resolution. Synthetic aliases are refused outside an
|
|
5461
5644
|
* authenticated pinned launch, so raw/BYO traffic cannot opt itself into
|
|
5462
|
-
* private profile semantics. The cheap family (including cheapest
|
|
5463
|
-
* fast's effort mapping (same model-to-effort rows, just
|
|
5464
|
-
* slugs at the wiring layer), so this preprocess is shared.
|
|
5645
|
+
* private profile semantics. The cheap family (including cheapest and
|
|
5646
|
+
* balanced) shares fast's effort mapping (same model-to-effort rows, just
|
|
5647
|
+
* bare subagent slugs at the wiring layer), so this preprocess is shared.
|
|
5465
5648
|
* Note the reviewer differs: fast reviews on Sonnet 5/xhigh while cheap
|
|
5466
|
-
* reviews on Luna/max
|
|
5467
|
-
* here, so each profile's reviewer resolves to
|
|
5649
|
+
* reviews on Luna/max, cheapest reviews on Gemini/high, and balanced reviews
|
|
5650
|
+
* on Luna/max — all rows exist here, so each profile's reviewer resolves to
|
|
5651
|
+
* its fixed effort.
|
|
5468
5652
|
*
|
|
5469
|
-
* Pinned-profile isolation (fast/cheap/cheap1m/cheapest): only
|
|
5653
|
+
* Pinned-profile isolation (fast/cheap/cheap1m/cheapest/balanced): only
|
|
5470
5654
|
* router-provided models are accepted (anything else is `rejectedModel`).
|
|
5471
|
-
* Context: cheap/cheapest traffic is stripped to the bare 200K id;
|
|
5655
|
+
* Context: cheap/cheapest/balanced traffic is stripped to the bare 200K id;
|
|
5472
5656
|
* cheap1m subagent traffic is stripped while its lead keeps 1M; fast
|
|
5473
5657
|
* keeps 1M on both. Effort: picker changes apply to the lead session
|
|
5474
5658
|
* only — lead requests keep an explicit `output_config.effort` when
|
|
@@ -6005,21 +6189,25 @@ async function handleCompletion(c) {
|
|
|
6005
6189
|
const maxProfileRequest = identity.launch?.profileId === "max";
|
|
6006
6190
|
const cheapProfileRequest = identity.launch?.profileId === "cheap" || identity.launch?.profileId === "cheap1m";
|
|
6007
6191
|
const cheapestProfileRequest = identity.launch?.profileId === "cheapest";
|
|
6192
|
+
const balancedProfileRequest = identity.launch?.profileId === "balanced";
|
|
6008
6193
|
const subagentRequest = Boolean(c.req.header("x-claude-code-agent-id"));
|
|
6009
6194
|
const fastSubagentRequest = fastProfileRequest && subagentRequest;
|
|
6010
6195
|
const maxSubagentRequest = maxProfileRequest && subagentRequest;
|
|
6011
6196
|
const cheapSubagentRequest = cheapProfileRequest && subagentRequest;
|
|
6012
6197
|
const cheapestSubagentRequest = cheapestProfileRequest && subagentRequest;
|
|
6198
|
+
const balancedSubagentRequest = balancedProfileRequest && subagentRequest;
|
|
6013
6199
|
const fastLeadAdvisor = fastProfileRequest && !fastSubagentRequest;
|
|
6014
6200
|
const maxLeadAdvisor = maxProfileRequest && !maxSubagentRequest;
|
|
6015
6201
|
const cheapLeadAdvisor = cheapProfileRequest && !cheapSubagentRequest;
|
|
6016
6202
|
const cheapestLeadAdvisor = cheapestProfileRequest && !cheapestSubagentRequest;
|
|
6017
|
-
const
|
|
6203
|
+
const balancedLeadAdvisor = balancedProfileRequest && !balancedSubagentRequest;
|
|
6204
|
+
const advisorEnabled = advisorRequested && !fastSubagentRequest && !maxSubagentRequest && !cheapSubagentRequest && !cheapestSubagentRequest && !balancedSubagentRequest;
|
|
6018
6205
|
const fastAdvisorEnabled = fastLeadAdvisor && advisorRequested && hasNonEmptyTools(rawBody);
|
|
6019
6206
|
const maxAdvisorEnabled = maxLeadAdvisor && advisorRequested && hasNonEmptyTools(rawBody);
|
|
6020
6207
|
const cheapAdvisorEnabled = cheapLeadAdvisor && advisorRequested && hasNonEmptyTools(rawBody);
|
|
6021
6208
|
const cheapestAdvisorEnabled = cheapestLeadAdvisor && advisorRequested && hasNonEmptyTools(rawBody);
|
|
6022
|
-
const
|
|
6209
|
+
const balancedAdvisorEnabled = balancedLeadAdvisor && advisorRequested && hasNonEmptyTools(rawBody);
|
|
6210
|
+
const advisorBehaviorEnabled = fastLeadAdvisor ? fastAdvisorEnabled : cheapLeadAdvisor ? cheapAdvisorEnabled : cheapestLeadAdvisor ? cheapestAdvisorEnabled : balancedLeadAdvisor ? balancedAdvisorEnabled : maxLeadAdvisor ? maxAdvisorEnabled : advisorEnabled;
|
|
6023
6211
|
let fastAdvisorChoice;
|
|
6024
6212
|
let maxAdvisorChoice;
|
|
6025
6213
|
if (maxAdvisorEnabled) {
|
|
@@ -6058,9 +6246,9 @@ async function handleCompletion(c) {
|
|
|
6058
6246
|
}, 503);
|
|
6059
6247
|
}
|
|
6060
6248
|
}
|
|
6061
|
-
if (cheapAdvisorEnabled) {
|
|
6249
|
+
if (cheapAdvisorEnabled || balancedAdvisorEnabled) {
|
|
6062
6250
|
const mismatch = fastAdvisorMetadataMismatch(rawBody);
|
|
6063
|
-
const relaunchProfile = identity.launch?.profileId === "cheap1m" ? "cheap1m" : "cheap";
|
|
6251
|
+
const relaunchProfile = identity.launch?.profileId === "cheap1m" ? "cheap1m" : identity.launch?.profileId === "balanced" ? "balanced" : "cheap";
|
|
6064
6252
|
if (mismatch) return c.json({
|
|
6065
6253
|
type: "error",
|
|
6066
6254
|
error: {
|
|
@@ -6151,7 +6339,7 @@ async function handleCompletion(c) {
|
|
|
6151
6339
|
parsedBase = JSON.parse(promptWindowBody);
|
|
6152
6340
|
} catch {}
|
|
6153
6341
|
const wantsStream = parsedBase?.stream === true;
|
|
6154
|
-
if ((fastAdvisorEnabled || cheapAdvisorEnabled || cheapestAdvisorEnabled || maxAdvisorEnabled) && wantsStream) {
|
|
6342
|
+
if ((fastAdvisorEnabled || cheapAdvisorEnabled || cheapestAdvisorEnabled || balancedAdvisorEnabled || maxAdvisorEnabled) && wantsStream) {
|
|
6155
6343
|
const initialConversation = Array.isArray(parsedBase.messages) ? parsedBase.messages : [];
|
|
6156
6344
|
const parsedInitial = parseAnthropicRequest(parsedBase, modelId, selectedModel);
|
|
6157
6345
|
const translatedAdvisorAborter = new AbortController();
|
|
@@ -6174,7 +6362,7 @@ async function handleCompletion(c) {
|
|
|
6174
6362
|
effort: maxAdvisorChoice.effort,
|
|
6175
6363
|
escalated: false,
|
|
6176
6364
|
fastProfile: false
|
|
6177
|
-
} : cheapAdvisorEnabled || cheapestAdvisorEnabled ? {
|
|
6365
|
+
} : cheapAdvisorEnabled || cheapestAdvisorEnabled || balancedAdvisorEnabled ? {
|
|
6178
6366
|
model: fastAdvisorChoice.model,
|
|
6179
6367
|
effort: resolveAdvisorEffort(rawBody, fastAdvisorChoice.model, true),
|
|
6180
6368
|
escalated: fastAdvisorChoice.escalated,
|
|
@@ -6194,7 +6382,7 @@ async function handleCompletion(c) {
|
|
|
6194
6382
|
advisorEscalated: advisorChoice.escalated,
|
|
6195
6383
|
advisorFastProfile: advisorChoice.fastProfile,
|
|
6196
6384
|
advisorMaxProfile: maxAdvisorEnabled,
|
|
6197
|
-
advisorCheapProfile: cheapAdvisorEnabled || cheapestAdvisorEnabled,
|
|
6385
|
+
advisorCheapProfile: cheapAdvisorEnabled || cheapestAdvisorEnabled || balancedAdvisorEnabled,
|
|
6198
6386
|
advisorEffort: advisorChoice.effort,
|
|
6199
6387
|
externalAborter: translatedAdvisorAborter,
|
|
6200
6388
|
continueTurn: makeShimContinueTurn(endpoint, {
|
|
@@ -6317,10 +6505,10 @@ async function handleCompletion(c) {
|
|
|
6317
6505
|
requestHeaders,
|
|
6318
6506
|
advisorModel: advisorChoice.model,
|
|
6319
6507
|
advisorEscalated: advisorChoice.escalated,
|
|
6320
|
-
advisorFastProfile: fastLeadAdvisor || cheapLeadAdvisor || cheapestLeadAdvisor,
|
|
6508
|
+
advisorFastProfile: fastLeadAdvisor || cheapLeadAdvisor || cheapestLeadAdvisor || balancedLeadAdvisor,
|
|
6321
6509
|
advisorMaxProfile: maxAdvisorEnabled,
|
|
6322
|
-
advisorCheapProfile: cheapLeadAdvisor || cheapestLeadAdvisor,
|
|
6323
|
-
advisorEffort: maxAdvisorChoice ? maxAdvisorChoice.effort : resolveAdvisorEffort(rawBody, advisorChoice.model, fastLeadAdvisor || cheapLeadAdvisor || cheapestLeadAdvisor),
|
|
6510
|
+
advisorCheapProfile: cheapLeadAdvisor || cheapestLeadAdvisor || balancedLeadAdvisor,
|
|
6511
|
+
advisorEffort: maxAdvisorChoice ? maxAdvisorChoice.effort : resolveAdvisorEffort(rawBody, advisorChoice.model, fastLeadAdvisor || cheapLeadAdvisor || cheapestLeadAdvisor || balancedLeadAdvisor),
|
|
6324
6512
|
externalAborter: advisorAborter
|
|
6325
6513
|
}), {
|
|
6326
6514
|
status: response.status,
|
|
@@ -7910,6 +8098,6 @@ function getCodexEnvVars(serverUrl) {
|
|
|
7910
8098
|
return vars;
|
|
7911
8099
|
}
|
|
7912
8100
|
//#endregion
|
|
7913
|
-
export {
|
|
8101
|
+
export { profileDescriptor as A, updateClaude as B, CHEAP_REVIEWER_ALIAS_ID as C, formatCheapPrerequisiteFailure as D, formatCheap1mPrerequisiteFailure as E, validateCheapestProfilePrerequisites as F, validateFastProfilePrerequisites as I, validateMaxProfileLaunch as L, validateBalancedProfilePrerequisites as M, validateCheap1mProfilePrerequisites as N, formatCheapestPrerequisiteFailure as O, validateCheapProfilePrerequisites as P, runSelfUpdate as R, CHEAP_PLAN_ALIAS_ID as S, formatBalancedPrerequisiteFailure as T, CHEAPEST_GENERAL_PURPOSE_ALIAS_ID as _, sharedServerArgs as a, CHEAP_EXPLORE_ALIAS_ID as b, stopKeepAwake as c, enableFileLogging as d, BALANCED_EXPLORE_ALIAS_ID as f, CHEAPEST_EXPLORE_ALIAS_ID as g, BALANCED_REVIEWER_ALIAS_ID as h, setupAndServe as i, resolveLaunchProfile as j, formatFastPrerequisiteFailure as k, injectModelPickerSettingsFile as l, BALANCED_PLAN_ALIAS_ID as m, getCodexEnvVars as n, LAUNCH_SECRET_HEADER as o, BALANCED_GENERAL_PURPOSE_ALIAS_ID as p, parseSharedArgs as r, startKeepAwake as s, getClaudeCodeEnvVars as t, listModelsForEndpoint as u, CHEAPEST_PLAN_ALIAS_ID as v, LUNA_SCOUT_ALIAS_ID as w, CHEAP_GENERAL_PURPOSE_ALIAS_ID as x, CHEAPEST_REVIEWER_ALIAS_ID as y, checkClaudeVersion as z };
|
|
7914
8102
|
|
|
7915
|
-
//# sourceMappingURL=server-setup-
|
|
8103
|
+
//# sourceMappingURL=server-setup-CZ3tEsgq.js.map
|