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.
- package/README.md +4 -4
- package/dist/{attribution-settings-B1xutIts.js → attribution-settings-C8iSwEAZ.js} +184 -93
- package/dist/attribution-settings-C8iSwEAZ.js.map +1 -0
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/{claude-uRuzEH0W.js → claude-Drv0roq1.js} +63 -116
- package/dist/claude-Drv0roq1.js.map +1 -0
- package/dist/{codex-D5ag-liR.js → codex-kgVL5OyN.js} +4 -4
- package/dist/{codex-D5ag-liR.js.map → codex-kgVL5OyN.js.map} +1 -1
- package/dist/engine-xuIzQNV1.js +2 -0
- package/dist/{fast-profile-contract-K3P58nj3.js → fast-profile-contract-OuZQaGif.js} +26 -23
- package/dist/fast-profile-contract-OuZQaGif.js.map +1 -0
- package/dist/{gate-discovery-BTRVyKWu.js → gate-discovery-D4-F99e_.js} +2 -2
- package/dist/{gate-discovery-BTRVyKWu.js.map → gate-discovery-D4-F99e_.js.map} +1 -1
- package/dist/hooks.mjs +121 -50
- package/dist/hooks.sha256 +1 -1
- package/dist/{internal-fast-dispatch-guard-D2HcfXZv.js → internal-fast-dispatch-guard-BaUB-F8o.js} +71 -15
- package/dist/internal-fast-dispatch-guard-BaUB-F8o.js.map +1 -0
- package/dist/{internal-fast-dispatch-guard-CYOWbxjX.js → internal-fast-dispatch-guard-ByzwIsxA.js} +1 -1
- package/dist/{internal-max-dispatch-guard-BjSVXMvC.js → internal-max-dispatch-guard-CXRB-4a3.js} +31 -14
- package/dist/internal-max-dispatch-guard-CXRB-4a3.js.map +1 -0
- package/dist/{internal-max-dispatch-guard-Bcjavapx.js → internal-max-dispatch-guard-Sb6ACr_0.js} +1 -1
- package/dist/{internal-stop-hook-BZg__ab6.js → internal-stop-hook-D8LIWryj.js} +2 -2
- package/dist/{internal-stop-hook-BZg__ab6.js.map → internal-stop-hook-D8LIWryj.js.map} +1 -1
- package/dist/main.js +7 -7
- package/dist/{max-profile-contract-BTXowh6k.js → max-profile-contract-CiD5wyET.js} +19 -7
- package/dist/max-profile-contract-CiD5wyET.js.map +1 -0
- package/dist/{peer-mcp-personas-DwEiYeJS.js → peer-mcp-personas-D4bHdjOx.js} +420 -384
- package/dist/peer-mcp-personas-D4bHdjOx.js.map +1 -0
- package/dist/{provision-BLT1pCFy.js → provision-D3_GtXze.js} +2 -2
- package/dist/{provision-BLT1pCFy.js.map → provision-D3_GtXze.js.map} +1 -1
- package/dist/{serve-wEZoOijw.js → serve-DPRZX-2j.js} +5 -5
- package/dist/{serve-wEZoOijw.js.map → serve-DPRZX-2j.js.map} +1 -1
- package/dist/{server-setup-Zn5wkosb.js → server-setup-CSkdFAPP.js} +25 -19
- package/dist/server-setup-CSkdFAPP.js.map +1 -0
- package/dist/{start-DSqU8d8h.js → start-C6G5tu81.js} +3 -3
- package/dist/{start-DSqU8d8h.js.map → start-C6G5tu81.js.map} +1 -1
- package/package.json +1 -1
- package/dist/attribution-settings-B1xutIts.js.map +0 -1
- package/dist/claude-uRuzEH0W.js.map +0 -1
- package/dist/engine-2uMJ4Isk.js +0 -2
- package/dist/fast-profile-contract-K3P58nj3.js.map +0 -1
- package/dist/internal-fast-dispatch-guard-D2HcfXZv.js.map +0 -1
- package/dist/internal-max-dispatch-guard-BjSVXMvC.js.map +0 -1
- package/dist/max-profile-contract-BTXowh6k.js.map +0 -1
- package/dist/peer-mcp-personas-DwEiYeJS.js.map +0 -1
- package/dist/server-setup-Zn5wkosb.js.map +0 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { $ as UNKNOWN_EFFORT_ANCHOR,
|
|
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-
|
|
9
|
-
import {
|
|
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.
|
|
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.
|
|
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.
|
|
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 ? "
|
|
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.
|
|
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.
|
|
6548
|
-
* row is retired: `gemini-3.
|
|
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.
|
|
6569
|
-
displayName: "Gemini 3.
|
|
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.
|
|
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-
|
|
6926
|
+
//# sourceMappingURL=server-setup-CSkdFAPP.js.map
|