github-router 0.3.292 → 0.3.293
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/{attribution-settings-CpLUCi8R.js → attribution-settings-Dx8TBPE8.js} +7 -7
- package/dist/attribution-settings-Dx8TBPE8.js.map +1 -0
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/{claude-_DYGKCw8.js → claude-BoAd_L2W.js} +26 -18
- package/dist/claude-BoAd_L2W.js.map +1 -0
- package/dist/{codex-rTJ8jW5G.js → codex-BdJgGT6Q.js} +4 -4
- package/dist/{codex-rTJ8jW5G.js.map → codex-BdJgGT6Q.js.map} +1 -1
- package/dist/engine-CK2b_cTt.js +2 -0
- package/dist/{gate-discovery-Bjar5dgv.js → gate-discovery-C30rfnyo.js} +2 -2
- package/dist/{gate-discovery-Bjar5dgv.js.map → gate-discovery-C30rfnyo.js.map} +1 -1
- package/dist/{internal-stop-hook-DrX2xlj0.js → internal-stop-hook-OnfK3BxE.js} +2 -2
- package/dist/{internal-stop-hook-DrX2xlj0.js.map → internal-stop-hook-OnfK3BxE.js.map} +1 -1
- package/dist/main.js +5 -5
- package/dist/{peer-mcp-personas-CHbl6MwM.js → peer-mcp-personas-DhI7ZPSx.js} +29 -12
- package/dist/{peer-mcp-personas-CHbl6MwM.js.map → peer-mcp-personas-DhI7ZPSx.js.map} +1 -1
- package/dist/{provision-BYFd9nPK.js → provision-CZJ4EWls.js} +2 -2
- package/dist/{provision-BYFd9nPK.js.map → provision-CZJ4EWls.js.map} +1 -1
- package/dist/{serve-BWMxDLnD.js → serve-RxWYzoOl.js} +5 -5
- package/dist/{serve-BWMxDLnD.js.map → serve-RxWYzoOl.js.map} +1 -1
- package/dist/{server-setup-CqlaZukJ.js → server-setup-DbvbW5Ve.js} +22 -15
- package/dist/{server-setup-CqlaZukJ.js.map → server-setup-DbvbW5Ve.js.map} +1 -1
- package/dist/{start-5MgGT4IF.js → start-BNcGsXsY.js} +3 -3
- package/dist/{start-5MgGT4IF.js.map → start-BNcGsXsY.js.map} +1 -1
- package/package.json +1 -1
- package/dist/attribution-settings-CpLUCi8R.js.map +0 -1
- package/dist/claude-_DYGKCw8.js.map +0 -1
- package/dist/engine-C9axTIu7.js +0 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as UNKNOWN_EFFORT_ANCHOR, $t as provisionTreeSitterAssets, At as shimDefaultsToXhigh, B as resolveAdvisorEffort, Bt as createResponses, Cn as withOneMSuffix, E as toolbeltEnabled, F as FAST_ADVISOR_TOOL_INSTRUCTIONS, G as repairRejectedThinkingHistory, Gt as normalizeOpenAIUsage, H as formatThinkingRepairDecline, Ht as MAX_RESPONSE_BODY_BYTES, I as buildAdvisorStream, J as isControllerClosedError, K as buildAnthropicErrorEvent, L as injectAdvisorTool, Lt as assembleResponsesPayload, M as searchWeb, Mt as createMessages, N as ADVISOR_INTERNAL_TOOL_NAME, Nt as getTokenCount, P as ADVISOR_TOOL_INSTRUCTIONS, Pt as findLaunchBySecret, Q as EFFORT_ORDER, R as isAdvisorRequested, Rt as warnOnTokenPriceDrift, Sn as oneMContextDisabled, Tn as withInstallLock, U as rememberThinkingHistoryRepair, Ut as readResponseBodyCapped, V as resolveAdvisorModel, Vt as createChatCompletions, W as repairKnownThinkingHistory, Wt as parseJsonOrDiagnose, X as readIteratorWithTimeout, Y as logStreamError, Z as relayAnthropicStream, _n as upstreamAllowH2, bn as pickEndpoint, dn as UPSTREAM_FETCH_TIMEOUT_MS, et as bucketEffort, fn as UPSTREAM_INACTIVITY_TIMEOUT_MS, i as assertMcpToolSurfaceConsistent, in as toolbeltPathOverride, jt as countTokens, mn as isBudgetClaudeLead, nt as handleMcpDelete, on as BUDGET_SMALL_FAST_SLUG, pn as generateRandomPort, q as buildOpenAIErrorEvent, rt as handleMcpPost, st as agentToolsEnabled, tt as clampEffort, vn as upstreamMaxConnections, wn as withOneMSuffixForLead, xn as catalogAdvertises1M, yn as classifyMessagesRoute, z as isFastProfileLead, zt as resolveMcpToolTimeoutMs } from "./peer-mcp-personas-DhI7ZPSx.js";
|
|
2
2
|
import { t as getPackageVersion } from "./version-C8x2hQrZ.js";
|
|
3
3
|
import { i as ensurePaths, t as PATHS } from "./paths-BH4J7slC.js";
|
|
4
4
|
import { A as state, 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-8drORhXg.js";
|
|
@@ -1656,7 +1656,7 @@ function collectToolFieldKeys(body) {
|
|
|
1656
1656
|
//#endregion
|
|
1657
1657
|
//#region package.json
|
|
1658
1658
|
var name = "github-router";
|
|
1659
|
-
var version = "0.3.
|
|
1659
|
+
var version = "0.3.293";
|
|
1660
1660
|
//#endregion
|
|
1661
1661
|
//#region src/lib/approval.ts
|
|
1662
1662
|
const awaitApproval = async () => {
|
|
@@ -4641,13 +4641,13 @@ function stripWebSearchTool(body) {
|
|
|
4641
4641
|
}
|
|
4642
4642
|
/**
|
|
4643
4643
|
* Strip the injected `__anthropic_advisor` tool (and any Anthropic-native
|
|
4644
|
-
* `advisor_*` typed tool) from a request body. Used
|
|
4645
|
-
*
|
|
4646
|
-
*
|
|
4647
|
-
*
|
|
4648
|
-
*
|
|
4649
|
-
*
|
|
4650
|
-
*
|
|
4644
|
+
* `advisor_*` typed tool) from a request body. Used on non-Claude shim paths
|
|
4645
|
+
* without an advisor handler and on authenticated fast Task-subagent requests,
|
|
4646
|
+
* where Advisor is intentionally lead-only. Mirrors stripWebSearchTool's
|
|
4647
|
+
* tool_choice cleanup. Returns the original string when nothing was removed.
|
|
4648
|
+
* End-to-end evidence for both stripped tool forms and the resulting 200 lives
|
|
4649
|
+
* in probes `shim_advisor_degrade_gpt55` and
|
|
4650
|
+
* `shim_advisor_degrade_gemini35flash`.
|
|
4651
4651
|
*/
|
|
4652
4652
|
function stripAdvisorTool(rawBody) {
|
|
4653
4653
|
let body;
|
|
@@ -4780,7 +4780,11 @@ async function handleCompletion(c) {
|
|
|
4780
4780
|
if (state.manualApprove) await awaitApproval();
|
|
4781
4781
|
const betaHeaders = extractBetaHeaders(c);
|
|
4782
4782
|
const incomingBeta = c.req.header("anthropic-beta");
|
|
4783
|
-
const
|
|
4783
|
+
const advisorRequested = isAdvisorRequested(incomingBeta);
|
|
4784
|
+
const fastProfileRequest = identity.launch?.profileId === "fast";
|
|
4785
|
+
const fastSubagentRequest = fastProfileRequest && Boolean(c.req.header("x-claude-code-agent-id"));
|
|
4786
|
+
const fastLeadAdvisor = fastProfileRequest && !fastSubagentRequest;
|
|
4787
|
+
const advisorEnabled = advisorRequested && !fastSubagentRequest;
|
|
4784
4788
|
const fastPreprocess = preprocessFastRequest(rawBody, identity.launch);
|
|
4785
4789
|
if (fastPreprocess.rejectedAlias || fastPreprocess.rejectedModel) {
|
|
4786
4790
|
const message = 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.`;
|
|
@@ -4794,6 +4798,7 @@ async function handleCompletion(c) {
|
|
|
4794
4798
|
}
|
|
4795
4799
|
let finalBody = await processWebSearch(fastPreprocess.body);
|
|
4796
4800
|
finalBody = sanitizeAnthropicBody(finalBody);
|
|
4801
|
+
if (fastSubagentRequest) finalBody = stripAdvisorTool(finalBody);
|
|
4797
4802
|
const loopGuard = guardAnthropicBody(finalBody);
|
|
4798
4803
|
if (loopGuard.action === "abort") return c.json({
|
|
4799
4804
|
type: "error",
|
|
@@ -4804,7 +4809,7 @@ async function handleCompletion(c) {
|
|
|
4804
4809
|
}, 400, { "x-should-retry": "false" });
|
|
4805
4810
|
if (loopGuard.body !== void 0) finalBody = loopGuard.body;
|
|
4806
4811
|
if (advisorEnabled) {
|
|
4807
|
-
finalBody = injectAdvisorTool(finalBody);
|
|
4812
|
+
finalBody = injectAdvisorTool(finalBody, fastLeadAdvisor ? FAST_ADVISOR_TOOL_INSTRUCTIONS : void 0);
|
|
4808
4813
|
consola.info("ADVISOR enabled for this request — injecting __anthropic_advisor tool; will translate tool_use → server_tool_use{advisor} on the SSE stream");
|
|
4809
4814
|
}
|
|
4810
4815
|
if (finalBody.includes("\"mcp_servers\"")) try {
|
|
@@ -4852,7 +4857,8 @@ async function handleCompletion(c) {
|
|
|
4852
4857
|
baseBody: parsedBase,
|
|
4853
4858
|
requestHeaders: {},
|
|
4854
4859
|
advisorModel: advisorChoice.model,
|
|
4855
|
-
advisorEscalated: advisorChoice.escalated
|
|
4860
|
+
advisorEscalated: advisorChoice.escalated,
|
|
4861
|
+
advisorFastProfile: fastLeadAdvisor,
|
|
4856
4862
|
advisorEffort: resolveAdvisorEffort(rawBody, advisorChoice.model, true),
|
|
4857
4863
|
externalAborter: fastAdvisorAborter,
|
|
4858
4864
|
continueTurn: makeShimContinueTurn(endpoint, {
|
|
@@ -4962,7 +4968,7 @@ async function handleCompletion(c) {
|
|
|
4962
4968
|
parsedBase = JSON.parse(nativeBody);
|
|
4963
4969
|
} catch {}
|
|
4964
4970
|
const initialConversation = Array.isArray(parsedBase.messages) ? parsedBase.messages : [];
|
|
4965
|
-
const advisorChoice = resolveAdvisorModel(originalModel);
|
|
4971
|
+
const advisorChoice = resolveAdvisorModel(originalModel, fastLeadAdvisor);
|
|
4966
4972
|
return new Response(buildAdvisorStream({
|
|
4967
4973
|
firstResponse: response,
|
|
4968
4974
|
initialConversation,
|
|
@@ -4970,7 +4976,8 @@ async function handleCompletion(c) {
|
|
|
4970
4976
|
requestHeaders,
|
|
4971
4977
|
advisorModel: advisorChoice.model,
|
|
4972
4978
|
advisorEscalated: advisorChoice.escalated,
|
|
4973
|
-
|
|
4979
|
+
advisorFastProfile: fastLeadAdvisor,
|
|
4980
|
+
advisorEffort: resolveAdvisorEffort(rawBody, advisorChoice.model, fastLeadAdvisor),
|
|
4974
4981
|
externalAborter: advisorAborter
|
|
4975
4982
|
}), {
|
|
4976
4983
|
status: response.status,
|
|
@@ -6575,4 +6582,4 @@ function getCodexEnvVars(serverUrl) {
|
|
|
6575
6582
|
//#endregion
|
|
6576
6583
|
export { validateFastProfilePrerequisites as _, sharedServerArgs as a, updateClaude as b, stopKeepAwake as c, LUNA_DRIVER_ALIAS_ID as d, LUNA_IMPLEMENTER_ALIAS_ID as f, resolveLaunchProfile as g, profileDescriptor as h, setupAndServe as i, listModelsForEndpoint as l, formatFastPrerequisiteFailure as m, getCodexEnvVars as n, LAUNCH_SECRET_HEADER as o, LUNA_SCOUT_ALIAS_ID as p, parseSharedArgs as r, startKeepAwake as s, getClaudeCodeEnvVars as t, enableFileLogging as u, runSelfUpdate as v, checkClaudeVersion as y };
|
|
6577
6584
|
|
|
6578
|
-
//# sourceMappingURL=server-setup-
|
|
6585
|
+
//# sourceMappingURL=server-setup-DbvbW5Ve.js.map
|