github-router 0.3.347 → 0.3.348
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-50S3mk4N.js → attribution-settings-P_vba-ri.js} +22 -12
- package/dist/attribution-settings-P_vba-ri.js.map +1 -0
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/{claude-D0rojAcX.js → claude-D26fp1ih.js} +14 -13
- package/dist/claude-D26fp1ih.js.map +1 -0
- package/dist/{codex-kcdKpoOe.js → codex-DM97sCtu.js} +4 -4
- package/dist/{codex-kcdKpoOe.js.map → codex-DM97sCtu.js.map} +1 -1
- package/dist/engine-VTQo0qUy.js +2 -0
- package/dist/{gate-discovery-CzZ5Oc3H.js → gate-discovery-V-mslLHt.js} +4 -4
- package/dist/{gate-discovery-CzZ5Oc3H.js.map → gate-discovery-V-mslLHt.js.map} +1 -1
- package/dist/hooks.mjs +250 -3
- package/dist/hooks.sha256 +1 -1
- package/dist/{internal-artifact-open-lta2UPnE.js → internal-artifact-open-CXJbMXpq.js} +2 -2
- package/dist/{internal-artifact-open-lta2UPnE.js.map → internal-artifact-open-CXJbMXpq.js.map} +1 -1
- package/dist/{internal-plan-review-B4f0dpss.js → internal-plan-review-F-WbltsT.js} +3 -3
- package/dist/{internal-plan-review-B4f0dpss.js.map → internal-plan-review-F-WbltsT.js.map} +1 -1
- package/dist/{internal-prompt-submit-DGxv_Vgl.js → internal-prompt-submit-B1nd4y4V.js} +92 -6
- package/dist/internal-prompt-submit-B1nd4y4V.js.map +1 -0
- package/dist/{internal-session-bind-IpZ5hJzR.js → internal-session-bind-LrYEo-kg.js} +2 -2
- package/dist/{internal-session-bind-IpZ5hJzR.js.map → internal-session-bind-LrYEo-kg.js.map} +1 -1
- package/dist/{internal-stop-hook-BdVV3NyD.js → internal-stop-hook-v5WF6Kc2.js} +5 -5
- package/dist/{internal-stop-hook-BdVV3NyD.js.map → internal-stop-hook-v5WF6Kc2.js.map} +1 -1
- package/dist/{internal-stop-review-C7bOxX1q.js → internal-stop-review-nL003JIj.js} +2 -2
- package/dist/{internal-stop-review-C7bOxX1q.js.map → internal-stop-review-nL003JIj.js.map} +1 -1
- package/dist/main.js +11 -11
- package/dist/{orchestration-Ccmfslh4.js → orchestration-DjuJRhXn.js} +2 -2
- package/dist/{orchestration-Ccmfslh4.js.map → orchestration-DjuJRhXn.js.map} +1 -1
- package/dist/{peer-mcp-personas-DlmmbpD6.js → peer-mcp-personas-C200IycG.js} +49 -15
- package/dist/peer-mcp-personas-C200IycG.js.map +1 -0
- package/dist/{pi-07uTIAcP.js → pi-BWGfNpi7.js} +4 -4
- package/dist/{pi-07uTIAcP.js.map → pi-BWGfNpi7.js.map} +1 -1
- package/dist/{plan-review-hook-BTvxvCCo.js → plan-review-hook-DMqPHBBN.js} +2 -2
- package/dist/{plan-review-hook-BTvxvCCo.js.map → plan-review-hook-DMqPHBBN.js.map} +1 -1
- package/dist/prompt-submit-hook-wjuHUrpS.js +352 -0
- package/dist/prompt-submit-hook-wjuHUrpS.js.map +1 -0
- package/dist/{provision-D_rmmqTq.js → provision-BFTONLfA.js} +2 -2
- package/dist/{provision-D_rmmqTq.js.map → provision-BFTONLfA.js.map} +1 -1
- package/dist/{serve-DbrYa6zo.js → serve-D9xQeGqi.js} +8 -8
- package/dist/{serve-DbrYa6zo.js.map → serve-D9xQeGqi.js.map} +1 -1
- package/dist/{server-setup-CKhj8I0W.js → server-setup-R1HQtpR9.js} +64 -22
- package/dist/{server-setup-CKhj8I0W.js.map → server-setup-R1HQtpR9.js.map} +1 -1
- package/dist/{start-BXVrchgI.js → start-vg2n8UjI.js} +3 -3
- package/dist/{start-BXVrchgI.js.map → start-vg2n8UjI.js.map} +1 -1
- package/dist/{stop-gate-hook-DZVfKoSh.js → stop-gate-hook-DRcYQAtf.js} +2 -2
- package/dist/{stop-gate-hook-DZVfKoSh.js.map → stop-gate-hook-DRcYQAtf.js.map} +1 -1
- package/dist/{stop-gate-policy-Gd_cNT9-.js → stop-gate-policy-CbLklfV2.js} +21 -2
- package/dist/{stop-gate-policy-Gd_cNT9-.js.map → stop-gate-policy-CbLklfV2.js.map} +1 -1
- package/package.json +1 -1
- package/dist/attribution-settings-50S3mk4N.js.map +0 -1
- package/dist/claude-D0rojAcX.js.map +0 -1
- package/dist/engine-BWxxbsSu.js +0 -2
- package/dist/internal-prompt-submit-DGxv_Vgl.js.map +0 -1
- package/dist/peer-mcp-personas-DlmmbpD6.js.map +0 -1
- package/dist/prompt-submit-hook-BeLUDy_m.js +0 -173
- package/dist/prompt-submit-hook-BeLUDy_m.js.map +0 -1
|
@@ -7,7 +7,7 @@ import { r as fetchWithTransientRetry } from "./upstream-retry-i1k1Xai2.js";
|
|
|
7
7
|
import { t as getCopilotUsage } from "./get-copilot-usage-C_6ast5h.js";
|
|
8
8
|
import { c as runCommandVoid, i as parseBoolEnv, o as resolveExecutable, r as killManagedTree, s as runCommandCapture } from "./exec-MCU1H-KZ.js";
|
|
9
9
|
import { _ as FAST_PROFILE_MODELS, f as FAST_PROFILE_ADVISOR_MODEL, i as BALANCED_PROFILE_NATIVE_AGENT_NAMES, l as BALANCED_PROFILE_SUBAGENT_CONTEXT_TOKENS, n as BALANCED_PROFILE_LEAD_EFFORT, r as BALANCED_PROFILE_MODELS, v as FAST_PROFILE_NATIVE_AGENT_NAMES } from "./balanced-profile-contract-XiIj4O1U.js";
|
|
10
|
-
import { $ as
|
|
10
|
+
import { $ as readIteratorWithTimeout, $t as createChatCompletions, An as oneMContextDisabled, B as injectAdvisorTool, Bt as shimDefaultsToXhigh, Cn as isBudgetClaudeLead, D as toolbeltEnabled, Dn as upstreamMaxConnections, En as upstreamAllowH2, F as ADVISOR_TOOL_INSTRUCTIONS, G as formatThinkingRepairDecline, Gn as CHEAP_PROFILE_NATIVE_AGENT_NAMES, Gt as getTokenizerFromModel, H as resolveAdvisorEffort, Hn as CHEAPEST_PROFILE_SUBAGENT_CONTEXT_TOKENS, Ht as createMessages, I as CHEAPEST_ADVISOR_TOOL_INSTRUCTIONS, In as CHEAPEST_PROFILE_MODELS, J as repairRejectedThinkingHistory, Jn as CHEAP_PROFILE_SUBAGENT_CONTEXT_TOKENS, K as rememberThinkingHistoryRepair, Kt as findLaunchBySecret, L as CHEAPEST_REVIEWER_ADVISOR_TOOL_INSTRUCTIONS, Ln as CHEAPEST_PROFILE_NATIVE_AGENT_NAMES, Mn as withOneMSuffixForLead, N as searchWeb, Nn as CHEAPEST_PROFILE_ADVISOR_CLIENT_MODEL, On as classifyMessagesRoute, P as ADVISOR_INTERNAL_TOOL_NAME, Q as logStreamError, Qt as createResponses, R as FAST_ADVISOR_TOOL_INSTRUCTIONS, Sn as generateRandomPort, U as resolveAdvisorModel, Un as CHEAP_PROFILE_ADVISOR_CLIENT_MODEL, Ut as getTextTokenCount, V as isAdvisorRequested, Vt as countTokens, W as resolveCheapestAdvisorModel, Wn as CHEAP_PROFILE_MODELS, Wt as getTokenCount, X as buildOpenAIErrorEvent, Xt as warnOnTokenPriceDrift, Y as buildAnthropicErrorEvent, Yt as assembleResponsesPayload, Z as isControllerClosedError, Zt as resolveMcpToolTimeoutMs, at as handleMcpDelete, bn as UPSTREAM_FETCH_TIMEOUT_MS, en as MAX_RESPONSE_BODY_BYTES, et as relayAnthropicStream, hn as BUDGET_SMALL_FAST_SLUG, i as assertMcpToolSurfaceConsistent, it as clampEffort, jn as withOneMSuffix, kn as catalogAdvertises1M, nn as parseJsonOrDiagnose, nt as UNKNOWN_EFFORT_ANCHOR, ot as handleMcpPost, pn as toolbeltPathOverride, q as repairKnownThinkingHistory, rn as normalizeOpenAIUsage, rt as bucketEffort, st as agentToolsEnabled, tn as readResponseBodyCapped, tt as EFFORT_ORDER, xn as UPSTREAM_INACTIVITY_TIMEOUT_MS, z as buildAdvisorStream } from "./peer-mcp-personas-C200IycG.js";
|
|
11
11
|
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--dAYkEG1.js";
|
|
12
12
|
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-D4oMcg7c.js";
|
|
13
13
|
import consola from "consola";
|
|
@@ -576,7 +576,7 @@ const CHEAP_REVIEWER_ALIAS_ID = "gh-router-cheap-reviewer-max";
|
|
|
576
576
|
const CHEAPEST_EXPLORE_ALIAS_ID = "gh-router-cheapest-explore-high";
|
|
577
577
|
const CHEAPEST_GENERAL_PURPOSE_ALIAS_ID = "gh-router-cheapest-general-purpose-xhigh";
|
|
578
578
|
const CHEAPEST_IMPLEMENTER_ALIAS_ID = "gh-router-cheapest-implementer-max";
|
|
579
|
-
const CHEAPEST_REVIEWER_ALIAS_ID = "gh-router-cheapest-reviewer-
|
|
579
|
+
const CHEAPEST_REVIEWER_ALIAS_ID = "gh-router-cheapest-reviewer-max";
|
|
580
580
|
/**
|
|
581
581
|
* Balanced-profile subagent aliases (`-m balanced`). Same non-catalog
|
|
582
582
|
* mechanism as the cheap aliases above, with the balanced roster's own
|
|
@@ -663,7 +663,8 @@ const RETIRED_FAST_ALIAS_IDS = /* @__PURE__ */ new Set([
|
|
|
663
663
|
LUNA_IMPLEMENTER_ALIAS_ID,
|
|
664
664
|
FAST_CRITIC_ALIAS_ID,
|
|
665
665
|
"gh-router-balanced-general-purpose-high",
|
|
666
|
-
"gh-router-balanced-reviewer-max"
|
|
666
|
+
"gh-router-balanced-reviewer-max",
|
|
667
|
+
"gh-router-cheapest-reviewer-high"
|
|
667
668
|
]);
|
|
668
669
|
const MODEL_ALIAS_TABLE = /* @__PURE__ */ new Map([
|
|
669
670
|
[LUNA_DRIVER_ALIAS_ID, {
|
|
@@ -744,7 +745,7 @@ const MODEL_ALIAS_TABLE = /* @__PURE__ */ new Map([
|
|
|
744
745
|
[CHEAPEST_REVIEWER_ALIAS_ID, {
|
|
745
746
|
aliasId: CHEAPEST_REVIEWER_ALIAS_ID,
|
|
746
747
|
realModel: CHEAPEST_PROFILE_MODELS.reviewer,
|
|
747
|
-
absentEffortDefault: "
|
|
748
|
+
absentEffortDefault: "max"
|
|
748
749
|
}],
|
|
749
750
|
[BALANCED_EXPLORE_ALIAS_ID, {
|
|
750
751
|
aliasId: BALANCED_EXPLORE_ALIAS_ID,
|
|
@@ -1023,10 +1024,10 @@ function formatCheapPrerequisiteFailure(missing) {
|
|
|
1023
1024
|
const CHEAPEST_SUBAGENT_MIN_CONTEXT_TOKENS = CHEAPEST_PROFILE_SUBAGENT_CONTEXT_TOKENS;
|
|
1024
1025
|
/**
|
|
1025
1026
|
* Validate the live Copilot catalog for `-m cheapest`: Luna lead at the 200K
|
|
1026
|
-
* default window, Luna Explore/GP roles, a
|
|
1027
|
-
* Oracle, and a Sol/medium Advisor — all at the
|
|
1028
|
-
* their fixed efforts and supported endpoints. There is no
|
|
1029
|
-
* lead plans directly.
|
|
1027
|
+
* default window, Luna Explore/GP roles, a Luna/max reviewer (protege of the
|
|
1028
|
+
* Sol Advisor), a Sol/high Oracle, and a Sol/medium Advisor — all at the
|
|
1029
|
+
* 200K default with their fixed efforts and supported endpoints. There is no
|
|
1030
|
+
* `Plan` role: the lead plans directly.
|
|
1030
1031
|
*
|
|
1031
1032
|
* `opts.peers === false` (the Pi `--no-peers` path) validates the LEAD only:
|
|
1032
1033
|
* no peer or native-role model is used in that launch, so requiring them
|
|
@@ -2514,7 +2515,7 @@ function collectToolFieldKeys(body) {
|
|
|
2514
2515
|
//#endregion
|
|
2515
2516
|
//#region package.json
|
|
2516
2517
|
var name = "github-router";
|
|
2517
|
-
var version = "0.3.
|
|
2518
|
+
var version = "0.3.348";
|
|
2518
2519
|
//#endregion
|
|
2519
2520
|
//#region src/lib/approval.ts
|
|
2520
2521
|
const awaitApproval = async () => {
|
|
@@ -5690,7 +5691,7 @@ function explicitEffortOf(value) {
|
|
|
5690
5691
|
* balanced) shares fast's effort mapping (same model-to-effort rows, just
|
|
5691
5692
|
* bare subagent slugs at the wiring layer), so this preprocess is shared.
|
|
5692
5693
|
* Note the reviewer differs: fast reviews on Sonnet 5/xhigh while cheap
|
|
5693
|
-
* reviews on Luna/max, cheapest reviews on
|
|
5694
|
+
* reviews on Luna/max, cheapest reviews on Luna/max, and balanced reviews
|
|
5694
5695
|
* on Sol/high — all rows exist here, so each profile's reviewer resolves to
|
|
5695
5696
|
* its fixed effort. The balanced LEAD is the other exception: bare Sol leads
|
|
5696
5697
|
* at medium (`BALANCED_PROFILE_LEAD_EFFORT`), not the shared high.
|
|
@@ -6098,6 +6099,28 @@ function cheapestAdvisorMetadataMismatch(rawBody) {
|
|
|
6098
6099
|
if (stripTrailingOneMSuffix(model).base !== CHEAPEST_PROFILE_ADVISOR_CLIENT_MODEL) return `the native Advisor tool requested ${JSON.stringify(model)} instead of ${JSON.stringify(CHEAPEST_PROFILE_ADVISOR_CLIENT_MODEL)}`;
|
|
6099
6100
|
}
|
|
6100
6101
|
}
|
|
6102
|
+
/**
|
|
6103
|
+
* True when the request's `model` is the cheapest reviewer's pinned alias
|
|
6104
|
+
* (bare or `[1m]`-decorated — `resolveModelAlias` strips the bracket).
|
|
6105
|
+
*
|
|
6106
|
+
* Role detection by MODEL rather than by `x-claude-code-agent-id`: classic
|
|
6107
|
+
* Task spawns send the bare role name ("reviewer"), but Agent-team teammates
|
|
6108
|
+
* send stable name-based ids ("reviewer-advisor-only[@team]"), so an
|
|
6109
|
+
* agent-id exact-match misses every teammate spawn. The frontmatter pins the
|
|
6110
|
+
* reviewer to its alias, invocation-level overrides are stripped by the
|
|
6111
|
+
* dispatch ACL, and `/model` switches affect only the lead — so the alias is
|
|
6112
|
+
* the robust discriminator across spawn styles. Fail-closed: unparseable
|
|
6113
|
+
* bodies and non-alias ids (bare Luna = lead, Explore/GP carry their own
|
|
6114
|
+
* aliases) return false.
|
|
6115
|
+
*/
|
|
6116
|
+
function isCheapestReviewerModel(rawBody) {
|
|
6117
|
+
try {
|
|
6118
|
+
const body = JSON.parse(rawBody);
|
|
6119
|
+
return typeof body.model === "string" && resolveModelAlias(body.model)?.aliasId === "gh-router-cheapest-reviewer-max";
|
|
6120
|
+
} catch {
|
|
6121
|
+
return false;
|
|
6122
|
+
}
|
|
6123
|
+
}
|
|
6101
6124
|
function stripAdvisorTool(rawBody) {
|
|
6102
6125
|
let body;
|
|
6103
6126
|
try {
|
|
@@ -6235,7 +6258,8 @@ async function handleCompletion(c) {
|
|
|
6235
6258
|
const cheapProfileRequest = identity.launch?.profileId === "cheap" || identity.launch?.profileId === "cheap1m";
|
|
6236
6259
|
const cheapestProfileRequest = identity.launch?.profileId === "cheapest";
|
|
6237
6260
|
const balancedProfileRequest = identity.launch?.profileId === "balanced";
|
|
6238
|
-
const
|
|
6261
|
+
const subagentAgentId = (c.req.header("x-claude-code-agent-id") ?? "").trim();
|
|
6262
|
+
const subagentRequest = subagentAgentId.length > 0;
|
|
6239
6263
|
const fastSubagentRequest = fastProfileRequest && subagentRequest;
|
|
6240
6264
|
const maxSubagentRequest = maxProfileRequest && subagentRequest;
|
|
6241
6265
|
const cheapSubagentRequest = cheapProfileRequest && subagentRequest;
|
|
@@ -6245,12 +6269,15 @@ async function handleCompletion(c) {
|
|
|
6245
6269
|
const maxLeadAdvisor = maxProfileRequest && !maxSubagentRequest;
|
|
6246
6270
|
const cheapLeadAdvisor = cheapProfileRequest && !cheapSubagentRequest;
|
|
6247
6271
|
const cheapestLeadAdvisor = cheapestProfileRequest && !cheapestSubagentRequest;
|
|
6248
|
-
const
|
|
6272
|
+
const cheapestReviewerAdvisor = cheapestProfileRequest && (subagentAgentId === "reviewer" || isCheapestReviewerModel(rawBody));
|
|
6273
|
+
if (cheapestProfileRequest && subagentRequest) consola.debug(`cheapest subagent advisor gate: agentId=${JSON.stringify(subagentAgentId)} reviewerModel=${isCheapestReviewerModel(rawBody)} granted=${cheapestReviewerAdvisor && advisorRequested}`);
|
|
6274
|
+
const advisorEnabled = advisorRequested && !fastSubagentRequest && !maxSubagentRequest && !cheapSubagentRequest && (!cheapestSubagentRequest || cheapestReviewerAdvisor) && !balancedSubagentRequest;
|
|
6249
6275
|
const fastAdvisorEnabled = fastLeadAdvisor && advisorRequested && hasNonEmptyTools(rawBody);
|
|
6250
6276
|
const maxAdvisorEnabled = maxLeadAdvisor && advisorRequested && hasNonEmptyTools(rawBody);
|
|
6251
6277
|
const cheapAdvisorEnabled = cheapLeadAdvisor && advisorRequested && hasNonEmptyTools(rawBody);
|
|
6252
6278
|
const cheapestAdvisorEnabled = cheapestLeadAdvisor && advisorRequested && hasNonEmptyTools(rawBody);
|
|
6253
|
-
const
|
|
6279
|
+
const cheapestReviewerEnabled = cheapestReviewerAdvisor && advisorRequested && hasNonEmptyTools(rawBody);
|
|
6280
|
+
const advisorBehaviorEnabled = balancedProfileRequest ? false : fastLeadAdvisor ? fastAdvisorEnabled : cheapLeadAdvisor ? cheapAdvisorEnabled : cheapestLeadAdvisor ? cheapestAdvisorEnabled : maxLeadAdvisor ? maxAdvisorEnabled : cheapestReviewerAdvisor ? cheapestReviewerEnabled : advisorEnabled;
|
|
6254
6281
|
let fastAdvisorChoice;
|
|
6255
6282
|
let maxAdvisorChoice;
|
|
6256
6283
|
if (maxAdvisorEnabled) {
|
|
@@ -6332,6 +6359,17 @@ async function handleCompletion(c) {
|
|
|
6332
6359
|
}, 503);
|
|
6333
6360
|
}
|
|
6334
6361
|
}
|
|
6362
|
+
if (cheapestReviewerEnabled && !fastAdvisorChoice) try {
|
|
6363
|
+
fastAdvisorChoice = resolveCheapestAdvisorModel();
|
|
6364
|
+
} catch (error) {
|
|
6365
|
+
return c.json({
|
|
6366
|
+
type: "error",
|
|
6367
|
+
error: {
|
|
6368
|
+
type: "api_error",
|
|
6369
|
+
message: error instanceof Error ? error.message : String(error)
|
|
6370
|
+
}
|
|
6371
|
+
}, 503);
|
|
6372
|
+
}
|
|
6335
6373
|
const fastPreprocess = preprocessFastRequest(rawBody, identity.launch, subagentRequest);
|
|
6336
6374
|
if (fastPreprocess.retiredAlias || fastPreprocess.rejectedAlias || fastPreprocess.rejectedModel) {
|
|
6337
6375
|
const profileId = identity.launch?.profileId;
|
|
@@ -6347,7 +6385,7 @@ async function handleCompletion(c) {
|
|
|
6347
6385
|
}
|
|
6348
6386
|
let finalBody = await processWebSearch(fastPreprocess.body);
|
|
6349
6387
|
finalBody = sanitizeAnthropicBody(finalBody);
|
|
6350
|
-
if (fastSubagentRequest || maxSubagentRequest) finalBody = stripAdvisorTool(finalBody);
|
|
6388
|
+
if (fastSubagentRequest || maxSubagentRequest || cheapestSubagentRequest && !cheapestReviewerAdvisor) finalBody = stripAdvisorTool(finalBody);
|
|
6351
6389
|
const loopGuard = guardAnthropicBody(finalBody);
|
|
6352
6390
|
if (loopGuard.action === "abort") return c.json({
|
|
6353
6391
|
type: "error",
|
|
@@ -6358,7 +6396,7 @@ async function handleCompletion(c) {
|
|
|
6358
6396
|
}, 400, { "x-should-retry": "false" });
|
|
6359
6397
|
if (loopGuard.body !== void 0) finalBody = loopGuard.body;
|
|
6360
6398
|
if (advisorBehaviorEnabled) {
|
|
6361
|
-
finalBody = injectAdvisorTool(finalBody, fastLeadAdvisor ? FAST_ADVISOR_TOOL_INSTRUCTIONS : maxLeadAdvisor ? MAX_PROFILE_ADVISOR_INSTRUCTIONS : void 0);
|
|
6399
|
+
finalBody = injectAdvisorTool(finalBody, cheapestReviewerAdvisor ? CHEAPEST_REVIEWER_ADVISOR_TOOL_INSTRUCTIONS : cheapestLeadAdvisor ? CHEAPEST_ADVISOR_TOOL_INSTRUCTIONS : fastLeadAdvisor ? FAST_ADVISOR_TOOL_INSTRUCTIONS : maxLeadAdvisor ? MAX_PROFILE_ADVISOR_INSTRUCTIONS : void 0);
|
|
6362
6400
|
consola.info("ADVISOR enabled for this request — injecting __anthropic_advisor tool; will translate tool_use → server_tool_use{advisor} on the SSE stream");
|
|
6363
6401
|
}
|
|
6364
6402
|
if (finalBody.includes("\"mcp_servers\"")) try {
|
|
@@ -6382,7 +6420,7 @@ async function handleCompletion(c) {
|
|
|
6382
6420
|
parsedBase = JSON.parse(promptWindowBody);
|
|
6383
6421
|
} catch {}
|
|
6384
6422
|
const wantsStream = parsedBase?.stream === true;
|
|
6385
|
-
if ((fastAdvisorEnabled || cheapAdvisorEnabled || cheapestAdvisorEnabled || maxAdvisorEnabled) && wantsStream) {
|
|
6423
|
+
if ((fastAdvisorEnabled || cheapAdvisorEnabled || cheapestAdvisorEnabled || maxAdvisorEnabled || cheapestReviewerEnabled) && wantsStream) {
|
|
6386
6424
|
const initialConversation = Array.isArray(parsedBase.messages) ? parsedBase.messages : [];
|
|
6387
6425
|
const parsedInitial = parseAnthropicRequest(parsedBase, modelId, selectedModel);
|
|
6388
6426
|
const translatedAdvisorAborter = new AbortController();
|
|
@@ -6405,7 +6443,7 @@ async function handleCompletion(c) {
|
|
|
6405
6443
|
effort: maxAdvisorChoice.effort,
|
|
6406
6444
|
escalated: false,
|
|
6407
6445
|
fastProfile: false
|
|
6408
|
-
} : cheapAdvisorEnabled || cheapestAdvisorEnabled ? {
|
|
6446
|
+
} : cheapAdvisorEnabled || cheapestAdvisorEnabled || cheapestReviewerEnabled ? {
|
|
6409
6447
|
model: fastAdvisorChoice.model,
|
|
6410
6448
|
effort: resolveAdvisorEffort(rawBody, fastAdvisorChoice.model, true),
|
|
6411
6449
|
escalated: fastAdvisorChoice.escalated,
|
|
@@ -6423,9 +6461,11 @@ async function handleCompletion(c) {
|
|
|
6423
6461
|
requestHeaders: {},
|
|
6424
6462
|
advisorModel: advisorChoice.model,
|
|
6425
6463
|
advisorEscalated: advisorChoice.escalated,
|
|
6426
|
-
advisorFastProfile: advisorChoice.fastProfile,
|
|
6464
|
+
advisorFastProfile: advisorChoice.fastProfile && !cheapestReviewerEnabled,
|
|
6427
6465
|
advisorMaxProfile: maxAdvisorEnabled,
|
|
6428
|
-
advisorCheapProfile: cheapAdvisorEnabled || cheapestAdvisorEnabled,
|
|
6466
|
+
advisorCheapProfile: cheapAdvisorEnabled || cheapestAdvisorEnabled || cheapestReviewerEnabled,
|
|
6467
|
+
advisorReviewerProfile: cheapestReviewerEnabled,
|
|
6468
|
+
advisorMaxTurns: cheapestReviewerEnabled ? 5 : void 0,
|
|
6429
6469
|
advisorEffort: advisorChoice.effort,
|
|
6430
6470
|
externalAborter: translatedAdvisorAborter,
|
|
6431
6471
|
continueTurn: makeShimContinueTurn(endpoint, {
|
|
@@ -6548,9 +6588,11 @@ async function handleCompletion(c) {
|
|
|
6548
6588
|
requestHeaders,
|
|
6549
6589
|
advisorModel: advisorChoice.model,
|
|
6550
6590
|
advisorEscalated: advisorChoice.escalated,
|
|
6551
|
-
advisorFastProfile: fastLeadAdvisor || cheapLeadAdvisor || cheapestLeadAdvisor,
|
|
6591
|
+
advisorFastProfile: (fastLeadAdvisor || cheapLeadAdvisor || cheapestLeadAdvisor) && !cheapestReviewerEnabled,
|
|
6552
6592
|
advisorMaxProfile: maxAdvisorEnabled,
|
|
6553
|
-
advisorCheapProfile: cheapLeadAdvisor || cheapestLeadAdvisor,
|
|
6593
|
+
advisorCheapProfile: cheapLeadAdvisor || cheapestLeadAdvisor || cheapestReviewerEnabled,
|
|
6594
|
+
advisorReviewerProfile: cheapestReviewerEnabled,
|
|
6595
|
+
advisorMaxTurns: cheapestReviewerEnabled ? 5 : void 0,
|
|
6554
6596
|
advisorEffort: maxAdvisorChoice ? maxAdvisorChoice.effort : resolveAdvisorEffort(rawBody, advisorChoice.model, fastLeadAdvisor || cheapLeadAdvisor || cheapestLeadAdvisor),
|
|
6555
6597
|
externalAborter: advisorAborter
|
|
6556
6598
|
}), {
|
|
@@ -8190,4 +8232,4 @@ function getPiLaunchEnvVars(mirrorDir) {
|
|
|
8190
8232
|
//#endregion
|
|
8191
8233
|
export { formatFastPrerequisiteFailure as A, runSelfUpdate as B, CHEAP_REVIEWER_ALIAS_ID as C, formatCheap1mPrerequisiteFailure as D, formatBalancedPrerequisiteFailure as E, validateCheapProfilePrerequisites as F, updateClaude as H, validateCheapestProfilePrerequisites as I, validateFastProfilePrerequisites as L, resolveLaunchProfile as M, validateBalancedProfilePrerequisites as N, formatCheapPrerequisiteFailure as O, validateCheap1mProfilePrerequisites as P, validateMaxProfileLaunch as R, CHEAP_PLAN_ALIAS_ID as S, MAX_BROWSE_LOW_ALIAS_ID as T, checkClaudeVersion as V, CHEAPEST_EXPLORE_ALIAS_ID as _, setupAndServe as a, CHEAP_EXPLORE_ALIAS_ID as b, startKeepAwake as c, listModelsForEndpoint as d, enableFileLogging as f, BROWSE_LOW_ALIAS_ID as g, BALANCED_REVIEWER_ALIAS_ID as h, parseSharedArgs as i, profileDescriptor as j, formatCheapestPrerequisiteFailure as k, stopKeepAwake as l, BALANCED_GENERAL_PURPOSE_ALIAS_ID as m, getCodexEnvVars as n, sharedServerArgs as o, BALANCED_EXPLORE_ALIAS_ID as p, getPiLaunchEnvVars as r, LAUNCH_SECRET_HEADER as s, getClaudeCodeEnvVars as t, injectModelPickerSettingsFile as u, CHEAPEST_GENERAL_PURPOSE_ALIAS_ID as v, LUNA_SCOUT_ALIAS_ID as w, CHEAP_GENERAL_PURPOSE_ALIAS_ID as x, CHEAPEST_REVIEWER_ALIAS_ID as y, queueDetachedGlobalInstall as z };
|
|
8192
8234
|
|
|
8193
|
-
//# sourceMappingURL=server-setup-
|
|
8235
|
+
//# sourceMappingURL=server-setup-R1HQtpR9.js.map
|