github-router 0.3.302 → 0.3.304

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/README.md +4 -4
  2. package/dist/{attribution-settings-B1xutIts.js → attribution-settings-C8iSwEAZ.js} +184 -93
  3. package/dist/attribution-settings-C8iSwEAZ.js.map +1 -0
  4. package/dist/browser-ext/manifest.json +1 -1
  5. package/dist/{claude-uRuzEH0W.js → claude-Drv0roq1.js} +63 -116
  6. package/dist/claude-Drv0roq1.js.map +1 -0
  7. package/dist/{codex-D5ag-liR.js → codex-kgVL5OyN.js} +4 -4
  8. package/dist/{codex-D5ag-liR.js.map → codex-kgVL5OyN.js.map} +1 -1
  9. package/dist/engine-xuIzQNV1.js +2 -0
  10. package/dist/{fast-profile-contract-K3P58nj3.js → fast-profile-contract-OuZQaGif.js} +26 -23
  11. package/dist/fast-profile-contract-OuZQaGif.js.map +1 -0
  12. package/dist/{gate-discovery-BTRVyKWu.js → gate-discovery-D4-F99e_.js} +2 -2
  13. package/dist/{gate-discovery-BTRVyKWu.js.map → gate-discovery-D4-F99e_.js.map} +1 -1
  14. package/dist/hooks.mjs +121 -50
  15. package/dist/hooks.sha256 +1 -1
  16. package/dist/{internal-fast-dispatch-guard-D2HcfXZv.js → internal-fast-dispatch-guard-BaUB-F8o.js} +71 -15
  17. package/dist/internal-fast-dispatch-guard-BaUB-F8o.js.map +1 -0
  18. package/dist/{internal-fast-dispatch-guard-CYOWbxjX.js → internal-fast-dispatch-guard-ByzwIsxA.js} +1 -1
  19. package/dist/{internal-max-dispatch-guard-BjSVXMvC.js → internal-max-dispatch-guard-CXRB-4a3.js} +31 -14
  20. package/dist/internal-max-dispatch-guard-CXRB-4a3.js.map +1 -0
  21. package/dist/{internal-max-dispatch-guard-Bcjavapx.js → internal-max-dispatch-guard-Sb6ACr_0.js} +1 -1
  22. package/dist/{internal-stop-hook-BZg__ab6.js → internal-stop-hook-D8LIWryj.js} +2 -2
  23. package/dist/{internal-stop-hook-BZg__ab6.js.map → internal-stop-hook-D8LIWryj.js.map} +1 -1
  24. package/dist/main.js +7 -7
  25. package/dist/{max-profile-contract-BTXowh6k.js → max-profile-contract-CiD5wyET.js} +19 -7
  26. package/dist/max-profile-contract-CiD5wyET.js.map +1 -0
  27. package/dist/{peer-mcp-personas-DwEiYeJS.js → peer-mcp-personas-D4bHdjOx.js} +420 -384
  28. package/dist/peer-mcp-personas-D4bHdjOx.js.map +1 -0
  29. package/dist/{provision-BLT1pCFy.js → provision-D3_GtXze.js} +2 -2
  30. package/dist/{provision-BLT1pCFy.js.map → provision-D3_GtXze.js.map} +1 -1
  31. package/dist/{serve-wEZoOijw.js → serve-DPRZX-2j.js} +5 -5
  32. package/dist/{serve-wEZoOijw.js.map → serve-DPRZX-2j.js.map} +1 -1
  33. package/dist/{server-setup-Zn5wkosb.js → server-setup-CSkdFAPP.js} +25 -19
  34. package/dist/server-setup-CSkdFAPP.js.map +1 -0
  35. package/dist/{start-DSqU8d8h.js → start-C6G5tu81.js} +3 -3
  36. package/dist/{start-DSqU8d8h.js.map → start-C6G5tu81.js.map} +1 -1
  37. package/package.json +1 -1
  38. package/dist/attribution-settings-B1xutIts.js.map +0 -1
  39. package/dist/claude-uRuzEH0W.js.map +0 -1
  40. package/dist/engine-2uMJ4Isk.js +0 -2
  41. package/dist/fast-profile-contract-K3P58nj3.js.map +0 -1
  42. package/dist/internal-fast-dispatch-guard-D2HcfXZv.js.map +0 -1
  43. package/dist/internal-max-dispatch-guard-BjSVXMvC.js.map +0 -1
  44. package/dist/max-profile-contract-BTXowh6k.js.map +0 -1
  45. package/dist/peer-mcp-personas-DwEiYeJS.js.map +0 -1
  46. package/dist/server-setup-Zn5wkosb.js.map +0 -1
@@ -1,12 +1,12 @@
1
- import { $ as UNKNOWN_EFFORT_ANCHOR, $t as countTokens, An as BUDGET_SMALL_FAST_SLUG, B as resolveAdvisorEffort, Bt as MAX_LUNA_HIGH_ALIAS_ID, Cn as provisionTreeSitterAssets, D as toolbeltEnabled, F as ADVISOR_TOOL_INSTRUCTIONS, Fn as UPSTREAM_FETCH_TIMEOUT_MS, Ft as LUNA_HAIKU_ALIAS_ID, G as repairRejectedThinkingHistory, Gn as oneMContextDisabled, Gt as maxAliasEffort, H as formatThinkingRepairDecline, Hn as upstreamMaxConnections, Ht as canonicalizeAliasModel, I as FAST_ADVISOR_TOOL_INSTRUCTIONS, In as UPSTREAM_INACTIVITY_TIMEOUT_MS, J as isControllerClosedError, Jn as withInstallLock, K as buildAnthropicErrorEvent, Kn as withOneMSuffix, Kt as maxAliasModel, L as buildAdvisorStream, Ln as generateRandomPort, Lt as LUNA_REAL_MODEL_ID, N as searchWeb, On as toolbeltPathOverride, P as ADVISOR_INTERNAL_TOOL_NAME, Pt as LUNA_DRIVER_ALIAS_ID, Q as EFFORT_ORDER, Qt as shimDefaultsToXhigh, R as injectAdvisorTool, Rn as isBudgetClaudeLead, U as rememberThinkingHistoryRepair, Un as classifyMessagesRoute, V as resolveAdvisorModel, Vn as upstreamAllowH2, Vt as MAX_LUNA_MAX_ALIAS_ID, W as repairKnownThinkingHistory, Wn as catalogAdvertises1M, Wt as isMaxModelAlias, X as readIteratorWithTimeout, Y as logStreamError, Yt as resolveModelAlias, Z as relayAnthropicStream, cn as warnOnTokenPriceDrift, dn as createChatCompletions, en as createMessages, et as bucketEffort, fn as MAX_RESPONSE_BODY_BYTES, hn as normalizeOpenAIUsage, i as assertMcpToolSurfaceConsistent, in as findLaunchBySecret, ln as resolveMcpToolTimeoutMs, lt as agentToolsEnabled, mn as parseJsonOrDiagnose, nn as getTokenCount, nt as handleMcpDelete, pn as readResponseBodyCapped, q as buildOpenAIErrorEvent, qn as withOneMSuffixForLead, rn as getTokenizerFromModel, rt as handleMcpPost, sn as assembleResponsesPayload, tn as getTextTokenCount, tt as clampEffort, un as createResponses, z as isAdvisorRequested, zt as LUNA_SONNET_ALIAS_ID } from "./peer-mcp-personas-DwEiYeJS.js";
1
+ import { $ as UNKNOWN_EFFORT_ANCHOR, An as MAX_LUNA_HIGH_ALIAS_ID, At as countTokens, B as resolveAdvisorEffort, Bn as resolveModelAlias, Bt as resolveMcpToolTimeoutMs, Cn as withOneMSuffix, D as toolbeltEnabled, Dn as LUNA_REAL_MODEL_ID, En as LUNA_HAIKU_ALIAS_ID, F as ADVISOR_TOOL_INSTRUCTIONS, Fn as isRetiredFastModelAlias, Ft as findLaunchBySecret, G as repairRejectedThinkingHistory, Gt as parseJsonOrDiagnose, H as formatThinkingRepairDecline, Ht as createChatCompletions, I as FAST_ADVISOR_TOOL_INSTRUCTIONS, In as maxAliasEffort, J as isControllerClosedError, K as buildAnthropicErrorEvent, Kt as normalizeOpenAIUsage, L as buildAdvisorStream, Ln as maxAliasModel, Mn as canonicalizeAliasModel, Mt as getTextTokenCount, N as searchWeb, Nt as getTokenCount, P as ADVISOR_INTERNAL_TOOL_NAME, Pn as isMaxModelAlias, Pt as getTokenizerFromModel, Q as EFFORT_ORDER, R as injectAdvisorTool, Rt as assembleResponsesPayload, Sn as oneMContextDisabled, Tn as LUNA_DRIVER_ALIAS_ID, U as rememberThinkingHistoryRepair, Un as withInstallLock, Ut as MAX_RESPONSE_BODY_BYTES, V as resolveAdvisorModel, Vt as createResponses, W as repairKnownThinkingHistory, Wt as readResponseBodyCapped, X as readIteratorWithTimeout, Y as logStreamError, Z as relayAnthropicStream, an as toolbeltPathOverride, bn as classifyMessagesRoute, en as provisionTreeSitterAssets, et as bucketEffort, fn as UPSTREAM_FETCH_TIMEOUT_MS, hn as isBudgetClaudeLead, i as assertMcpToolSurfaceConsistent, it as agentToolsEnabled, jn as MAX_LUNA_MAX_ALIAS_ID, jt as createMessages, kn as LUNA_SONNET_ALIAS_ID, kt as shimDefaultsToXhigh, mn as generateRandomPort, nt as handleMcpDelete, pn as UPSTREAM_INACTIVITY_TIMEOUT_MS, q as buildOpenAIErrorEvent, rt as handleMcpPost, sn as BUDGET_SMALL_FAST_SLUG, tt as clampEffort, vn as upstreamAllowH2, wn as withOneMSuffixForLead, xn as catalogAdvertises1M, yn as upstreamMaxConnections, z as isAdvisorRequested, zt as warnOnTokenPriceDrift } from "./peer-mcp-personas-D4bHdjOx.js";
2
2
  import { t as getPackageVersion } from "./version-C8x2hQrZ.js";
3
3
  import { i as ensurePaths, t as PATHS } from "./paths-IcZW8gZx.js";
4
4
  import { t as state } from "./state-B8adscCv.js";
5
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-CbuFyx-B.js";
6
6
  import { t as getCopilotUsage } from "./get-copilot-usage-ByjQqhdi.js";
7
7
  import { a as resolveExecutable, n as killManagedTree, o as runCommandCapture, r as parseBoolEnv, s as runCommandVoid } from "./exec-y8C_MU8A.js";
8
- import { r as FAST_PROFILE_ADVISOR_MODEL } from "./fast-profile-contract-K3P58nj3.js";
9
- import { b as stripTrailingOneMSuffix, d as maxAdvisorPinIsValid, i as MAX_PROFILE_MODELS, l as maxAdvisorEffortForModel, m as maxOpusModel, n as MAX_PROFILE_ALLOWED_LEAD_MODEL_IDS, t as MAX_PROFILE_ADVISOR_INSTRUCTIONS, u as maxAdvisorModelFromPin } from "./max-profile-contract-BTXowh6k.js";
8
+ import { r as FAST_PROFILE_ADVISOR_MODEL } from "./fast-profile-contract-OuZQaGif.js";
9
+ import { d as maxAdvisorPinIsValid, i as MAX_PROFILE_MODELS, l as maxAdvisorEffortForModel, m as maxOpusModel, n as MAX_PROFILE_ALLOWED_LEAD_MODEL_IDS, t as MAX_PROFILE_ADVISOR_INSTRUCTIONS, u as maxAdvisorModelFromPin, x as stripTrailingOneMSuffix } from "./max-profile-contract-CiD5wyET.js";
10
10
  import consola from "consola";
11
11
  import * as fs$2 from "node:fs";
12
12
  import fs, { existsSync } from "node:fs";
@@ -1502,7 +1502,7 @@ function collectToolFieldKeys(body) {
1502
1502
  //#endregion
1503
1503
  //#region package.json
1504
1504
  var name = "github-router";
1505
- var version = "0.3.302";
1505
+ var version = "0.3.304";
1506
1506
  //#endregion
1507
1507
  //#region src/lib/approval.ts
1508
1508
  const awaitApproval = async () => {
@@ -4367,12 +4367,12 @@ function identityPreflightErrorResponse(c, reason, path = "/v1/messages") {
4367
4367
  //#region src/lib/max-request-preprocess.ts
4368
4368
  function maxRequestError(result) {
4369
4369
  if (result.rejectedAlias) return `Router-owned model alias ${JSON.stringify(result.rejectedAlias)} is valid only for an authenticated -m max launch.`;
4370
- if (result.rejectedModel) return `Model ${JSON.stringify(result.rejectedModel)} is outside the fixed -m max model set (Sol, Luna, Gemini 3.7 Flash, or Opus 5).`;
4370
+ if (result.rejectedModel) return `Model ${JSON.stringify(result.rejectedModel)} is outside the fixed -m max model set (Sol, Luna, Gemini 3.8 Flash, or Opus 5).`;
4371
4371
  }
4372
4372
  const MAX_MODEL_EFFORTS = Object.freeze({
4373
4373
  "gpt-5.6-sol": "high",
4374
4374
  "gpt-5.6-luna": "high",
4375
- "gemini-3.7-flash": "high",
4375
+ "gemini-3.8-flash": "high",
4376
4376
  "claude-opus-5": "high"
4377
4377
  });
4378
4378
  function allowedModel(base) {
@@ -4427,14 +4427,14 @@ function preprocessMaxRequest(rawBody, launch, subagentRequest = false) {
4427
4427
  modified: true
4428
4428
  };
4429
4429
  }
4430
- const allowedSubagentModel = subagentRequest && base === "grok-4.6";
4430
+ const allowedSubagentModel = subagentRequest && (base === "grok-4.6" || base === "gpt-5.6-luna");
4431
4431
  if (!allowedModel(base) && !allowedSubagentModel) return {
4432
4432
  body: rawBody,
4433
4433
  originalModel,
4434
4434
  modified: false,
4435
4435
  rejectedModel: originalModel
4436
4436
  };
4437
- const effort = allowedSubagentModel ? "medium" : MAX_MODEL_EFFORTS[base];
4437
+ const effort = allowedSubagentModel ? base === "gpt-5.6-luna" ? "max" : "high" : MAX_MODEL_EFFORTS[base];
4438
4438
  if (!effort) return {
4439
4439
  body: rawBody,
4440
4440
  originalModel,
@@ -4475,6 +4475,12 @@ function preprocessFastRequest(rawBody, launch, subagentRequest = false) {
4475
4475
  body: rawBody,
4476
4476
  modified: false
4477
4477
  };
4478
+ if (isRetiredFastModelAlias(originalModel)) return {
4479
+ body: rawBody,
4480
+ originalModel,
4481
+ modified: false,
4482
+ retiredAlias: originalModel
4483
+ };
4478
4484
  const alias = resolveModelAlias(originalModel);
4479
4485
  if (alias && (launch?.profileId !== "fast" || isMaxModelAlias(originalModel))) return {
4480
4486
  body: rawBody,
@@ -4495,7 +4501,7 @@ function preprocessFastRequest(rawBody, launch, subagentRequest = false) {
4495
4501
  } else if (bare === "gpt-5.6-luna") effort = "max";
4496
4502
  else if (bare === "gpt-5.6-sol") effort = "high";
4497
4503
  else if (bare === "grok-4.6") effort = "medium";
4498
- else if (bare === "gemini-3.7-flash") effort = "high";
4504
+ else if (bare === "gemini-3.8-flash") effort = "high";
4499
4505
  else if (bare === "claude-opus-5") effort = "high";
4500
4506
  if (!effort && !alias) return {
4501
4507
  body: rawBody,
@@ -5003,8 +5009,8 @@ async function handleCompletion(c) {
5003
5009
  }
5004
5010
  }
5005
5011
  const fastPreprocess = preprocessFastRequest(rawBody, identity.launch, subagentRequest);
5006
- if (fastPreprocess.rejectedAlias || fastPreprocess.rejectedModel) {
5007
- const message = identity.launch?.profileId === "max" ? maxRequestError(fastPreprocess) ?? "Invalid max request" : fastPreprocess.rejectedAlias ? `Router-owned model alias ${JSON.stringify(fastPreprocess.rejectedAlias)} is valid only for an authenticated -m fast launch.` : `Model ${JSON.stringify(fastPreprocess.rejectedModel)} is outside the fixed -m fast model set.`;
5012
+ if (fastPreprocess.retiredAlias || fastPreprocess.rejectedAlias || fastPreprocess.rejectedModel) {
5013
+ const message = fastPreprocess.retiredAlias ? `Router-owned model alias ${JSON.stringify(fastPreprocess.retiredAlias)} belongs to a retired Fast role and is no longer valid. Relaunch or select a current Fast role.` : identity.launch?.profileId === "max" ? maxRequestError(fastPreprocess) ?? "Invalid max request" : fastPreprocess.rejectedAlias ? `Router-owned model alias ${JSON.stringify(fastPreprocess.rejectedAlias)} is valid only for an authenticated -m fast launch.` : `Model ${JSON.stringify(fastPreprocess.rejectedModel)} is outside the fixed -m fast model set.`;
5008
5014
  return c.json({
5009
5015
  type: "error",
5010
5016
  error: {
@@ -5551,8 +5557,8 @@ async function handleCountTokens(c) {
5551
5557
  const rawBody = await c.req.text();
5552
5558
  const subagentRequest = Boolean(c.req.header("x-claude-code-agent-id"));
5553
5559
  const fastPreprocess = preprocessFastRequest(rawBody, identity.launch, subagentRequest);
5554
- if (fastPreprocess.rejectedAlias || fastPreprocess.rejectedModel) {
5555
- const message = identity.launch?.profileId === "max" ? maxRequestError(fastPreprocess) ?? "Invalid max request" : fastPreprocess.rejectedAlias ? `Router-owned model alias ${JSON.stringify(fastPreprocess.rejectedAlias)} is valid only for an authenticated -m fast launch.` : `Model ${JSON.stringify(fastPreprocess.rejectedModel)} is outside the fixed -m fast model set.`;
5560
+ if (fastPreprocess.retiredAlias || fastPreprocess.rejectedAlias || fastPreprocess.rejectedModel) {
5561
+ const message = fastPreprocess.retiredAlias ? `Router-owned model alias ${JSON.stringify(fastPreprocess.retiredAlias)} belongs to a retired Fast role and is no longer valid. Relaunch or select a current Fast role.` : identity.launch?.profileId === "max" ? maxRequestError(fastPreprocess) ?? "Invalid max request" : fastPreprocess.rejectedAlias ? `Router-owned model alias ${JSON.stringify(fastPreprocess.rejectedAlias)} is valid only for an authenticated -m fast launch.` : `Model ${JSON.stringify(fastPreprocess.rejectedModel)} is outside the fixed -m fast model set.`;
5556
5562
  return c.json({
5557
5563
  type: "error",
5558
5564
  error: {
@@ -6544,8 +6550,8 @@ function parseSharedArgs(args) {
6544
6550
  * Copilot `/responses` (gpt) or `/chat/completions` (gemini/grok).
6545
6551
  *
6546
6552
  * This list is EXACT and STATIC — no dynamic Gemini-review append (the
6547
- * earlier `gemini-3.1-pro-preview`-preferred / `gemini-3.7-flash`-fallback
6548
- * row is retired: `gemini-3.7-flash` is now a first-class row on its own,
6553
+ * earlier `gemini-3.1-pro-preview`-preferred / `gemini-3.8-flash`-fallback
6554
+ * row is retired: `gemini-3.8-flash` is now a first-class row on its own,
6549
6555
  * always at this fixed id). A model missing from the catalog is simply
6550
6556
  * omitted, never substituted — see `nativeSelectableModelsInCatalog`.
6551
6557
  *
@@ -6565,8 +6571,8 @@ const NATIVE_NON_CLAUDE_MODELS = [
6565
6571
  displayName: "GPT-5.6 Luna"
6566
6572
  },
6567
6573
  {
6568
- id: "gemini-3.7-flash",
6569
- displayName: "Gemini 3.7 Flash"
6574
+ id: "gemini-3.8-flash",
6575
+ displayName: "Gemini 3.8 Flash"
6570
6576
  },
6571
6577
  {
6572
6578
  id: "grok-4.6",
@@ -6621,7 +6627,7 @@ const MAX_NATIVE_MODELS = [
6621
6627
  },
6622
6628
  {
6623
6629
  id: MAX_PROFILE_MODELS.gemini,
6624
- displayName: "Gemini 3.7 Flash"
6630
+ displayName: "Gemini 3.8 Flash"
6625
6631
  },
6626
6632
  {
6627
6633
  id: MAX_PROFILE_MODELS.opus,
@@ -6917,4 +6923,4 @@ function getCodexEnvVars(serverUrl) {
6917
6923
  //#endregion
6918
6924
  export { sharedServerArgs as a, stopKeepAwake as c, runSelfUpdate as d, checkClaudeVersion as f, setupAndServe as i, listModelsForEndpoint as l, getCodexEnvVars as n, LAUNCH_SECRET_HEADER as o, updateClaude as p, parseSharedArgs as r, startKeepAwake as s, getClaudeCodeEnvVars as t, enableFileLogging as u };
6919
6925
 
6920
- //# sourceMappingURL=server-setup-Zn5wkosb.js.map
6926
+ //# sourceMappingURL=server-setup-CSkdFAPP.js.map