github-router 0.3.320 → 0.3.322
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-DY03LbBM.js → aic-ledger-BW3zMiCx.js} +39 -2
- package/dist/aic-ledger-BW3zMiCx.js.map +1 -0
- package/dist/{attribution-settings-BelfdD6d.js → attribution-settings-z-U2L7ab.js} +4 -4
- package/dist/{attribution-settings-BelfdD6d.js.map → attribution-settings-z-U2L7ab.js.map} +1 -1
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/{claude-DFYqAA-N.js → claude-DtWf7DEw.js} +8 -8
- package/dist/{claude-DFYqAA-N.js.map → claude-DtWf7DEw.js.map} +1 -1
- package/dist/{codex-sh1xVngr.js → codex-CDtFT-Qp.js} +4 -4
- package/dist/{codex-sh1xVngr.js.map → codex-CDtFT-Qp.js.map} +1 -1
- package/dist/{copilot-discount-C3jx9Q-o.js → copilot-discount-I6BrT7QE.js} +2 -2
- package/dist/{copilot-discount-C3jx9Q-o.js.map → copilot-discount-I6BrT7QE.js.map} +1 -1
- package/dist/engine-DA5laGIh.js +2 -0
- package/dist/{gate-discovery-B17pvgE0.js → gate-discovery-j_hQ1IPc.js} +2 -2
- package/dist/{gate-discovery-B17pvgE0.js.map → gate-discovery-j_hQ1IPc.js.map} +1 -1
- package/dist/{internal-aic-status-BiblmImt.js → internal-aic-status-CKXxxb30.js} +3 -3
- package/dist/{internal-aic-status-BiblmImt.js.map → internal-aic-status-CKXxxb30.js.map} +1 -1
- package/dist/{internal-stop-hook-DZ6CCP4C.js → internal-stop-hook-BGTPRCtO.js} +2 -2
- package/dist/{internal-stop-hook-DZ6CCP4C.js.map → internal-stop-hook-BGTPRCtO.js.map} +1 -1
- package/dist/main.js +6 -6
- package/dist/{peer-mcp-personas-CRMVuMVF.js → peer-mcp-personas-Gb0LfII0.js} +12 -9
- package/dist/{peer-mcp-personas-CRMVuMVF.js.map → peer-mcp-personas-Gb0LfII0.js.map} +1 -1
- package/dist/{provision-Bn8-NDp7.js → provision-DagZEkdZ.js} +2 -2
- package/dist/{provision-Bn8-NDp7.js.map → provision-DagZEkdZ.js.map} +1 -1
- package/dist/{serve-BGopbB07.js → serve-DOMsmIk-.js} +5 -5
- package/dist/{serve-BGopbB07.js.map → serve-DOMsmIk-.js.map} +1 -1
- package/dist/{server-setup-ByyVi5SS.js → server-setup-DQVRJluz.js} +79 -19
- package/dist/server-setup-DQVRJluz.js.map +1 -0
- package/dist/{start-BQejjfMD.js → start-CqSFR_s8.js} +3 -3
- package/dist/{start-BQejjfMD.js.map → start-CqSFR_s8.js.map} +1 -1
- package/package.json +1 -1
- package/dist/aic-ledger-DY03LbBM.js.map +0 -1
- package/dist/engine-D5GNXylB.js +0 -2
- package/dist/server-setup-ByyVi5SS.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as EFFORT_ORDER, $t as parseJsonOrDiagnose, An as oneMContextDisabled, B as resolveAdvisorEffort, Bn as CHEAP_PROFILE_MODELS, Bt as getTextTokenCount, Cn as isBudgetClaudeLead, D as toolbeltEnabled, Dn as upstreamMaxConnections, En as upstreamAllowH2, F as ADVISOR_TOOL_INSTRUCTIONS, Fn as CHEAPEST_PROFILE_NATIVE_AGENT_NAMES, G as repairKnownThinkingHistory, Gn as withInstallLock, H as resolveCheapestAdvisorModel, Ht as getTokenizerFromModel, I as FAST_ADVISOR_TOOL_INSTRUCTIONS, J as buildOpenAIErrorEvent, Jt as resolveMcpToolTimeoutMs, K as repairRejectedThinkingHistory, Kt as assembleResponsesPayload, L as buildAdvisorStream, Lt as shimDefaultsToXhigh, Mn as withOneMSuffixForLead, N as searchWeb, Nn as CHEAPEST_PROFILE_ADVISOR_CLIENT_MODEL, On as classifyMessagesRoute, P as ADVISOR_INTERNAL_TOOL_NAME, Pn as CHEAPEST_PROFILE_MODELS, Q as relayAnthropicStream, Qt as readResponseBodyCapped, R as injectAdvisorTool, Rn as CHEAPEST_PROFILE_SUBAGENT_CONTEXT_TOKENS, Rt as countTokens, Sn as generateRandomPort, U as formatThinkingRepairDecline, Ut as findLaunchBySecret, V as resolveAdvisorModel, Vn as CHEAP_PROFILE_NATIVE_AGENT_NAMES, Vt as getTokenCount, W as rememberThinkingHistoryRepair, Wn as CHEAP_PROFILE_SUBAGENT_CONTEXT_TOKENS, X as logStreamError, Xt as createChatCompletions, Y as isControllerClosedError, Yt as createResponses, Z as readIteratorWithTimeout, Zt as MAX_RESPONSE_BODY_BYTES, at as agentToolsEnabled, bn as UPSTREAM_FETCH_TIMEOUT_MS, cn as provisionTreeSitterAssets, en as normalizeOpenAIUsage, et as UNKNOWN_EFFORT_ANCHOR, hn as BUDGET_SMALL_FAST_SLUG, i as assertMcpToolSurfaceConsistent, it as handleMcpPost, jn as withOneMSuffix, kn as catalogAdvertises1M, nt as clampEffort, pn as toolbeltPathOverride, q as buildAnthropicErrorEvent, qt as warnOnTokenPriceDrift, rt as handleMcpDelete, tt as bucketEffort, xn as UPSTREAM_INACTIVITY_TIMEOUT_MS, z as isAdvisorRequested, zn as CHEAP_PROFILE_ADVISOR_CLIENT_MODEL, zt as createMessages } from "./peer-mcp-personas-
|
|
1
|
+
import { $ as EFFORT_ORDER, $t as parseJsonOrDiagnose, An as oneMContextDisabled, B as resolveAdvisorEffort, Bn as CHEAP_PROFILE_MODELS, Bt as getTextTokenCount, Cn as isBudgetClaudeLead, D as toolbeltEnabled, Dn as upstreamMaxConnections, En as upstreamAllowH2, F as ADVISOR_TOOL_INSTRUCTIONS, Fn as CHEAPEST_PROFILE_NATIVE_AGENT_NAMES, G as repairKnownThinkingHistory, Gn as withInstallLock, H as resolveCheapestAdvisorModel, Ht as getTokenizerFromModel, I as FAST_ADVISOR_TOOL_INSTRUCTIONS, J as buildOpenAIErrorEvent, Jt as resolveMcpToolTimeoutMs, K as repairRejectedThinkingHistory, Kt as assembleResponsesPayload, L as buildAdvisorStream, Lt as shimDefaultsToXhigh, Mn as withOneMSuffixForLead, N as searchWeb, Nn as CHEAPEST_PROFILE_ADVISOR_CLIENT_MODEL, On as classifyMessagesRoute, P as ADVISOR_INTERNAL_TOOL_NAME, Pn as CHEAPEST_PROFILE_MODELS, Q as relayAnthropicStream, Qt as readResponseBodyCapped, R as injectAdvisorTool, Rn as CHEAPEST_PROFILE_SUBAGENT_CONTEXT_TOKENS, Rt as countTokens, Sn as generateRandomPort, U as formatThinkingRepairDecline, Ut as findLaunchBySecret, V as resolveAdvisorModel, Vn as CHEAP_PROFILE_NATIVE_AGENT_NAMES, Vt as getTokenCount, W as rememberThinkingHistoryRepair, Wn as CHEAP_PROFILE_SUBAGENT_CONTEXT_TOKENS, X as logStreamError, Xt as createChatCompletions, Y as isControllerClosedError, Yt as createResponses, Z as readIteratorWithTimeout, Zt as MAX_RESPONSE_BODY_BYTES, at as agentToolsEnabled, bn as UPSTREAM_FETCH_TIMEOUT_MS, cn as provisionTreeSitterAssets, en as normalizeOpenAIUsage, et as UNKNOWN_EFFORT_ANCHOR, hn as BUDGET_SMALL_FAST_SLUG, i as assertMcpToolSurfaceConsistent, it as handleMcpPost, jn as withOneMSuffix, kn as catalogAdvertises1M, nt as clampEffort, pn as toolbeltPathOverride, q as buildAnthropicErrorEvent, qt as warnOnTokenPriceDrift, rt as handleMcpDelete, tt as bucketEffort, xn as UPSTREAM_INACTIVITY_TIMEOUT_MS, z as isAdvisorRequested, zn as CHEAP_PROFILE_ADVISOR_CLIENT_MODEL, zt as createMessages } from "./peer-mcp-personas-Gb0LfII0.js";
|
|
2
2
|
import { t as getPackageVersion } from "./version-C8x2hQrZ.js";
|
|
3
3
|
import { i as ensurePaths, t as PATHS } from "./paths-CHBAj_t9.js";
|
|
4
4
|
import { t as state } from "./state-BlMpEFAt.js";
|
|
@@ -7,7 +7,7 @@ import { t as getCopilotUsage } from "./get-copilot-usage-BWCAzmSc.js";
|
|
|
7
7
|
import { c as runCommandVoid, i as parseBoolEnv, o as resolveExecutable, r as killManagedTree, s as runCommandCapture } from "./exec-COUT4QsS.js";
|
|
8
8
|
import { c as FAST_PROFILE_MODELS, l as FAST_PROFILE_NATIVE_AGENT_NAMES, r as FAST_PROFILE_ADVISOR_MODEL } from "./fast-profile-contract-_DhIWank.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 {
|
|
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-BW3zMiCx.js";
|
|
11
11
|
import consola from "consola";
|
|
12
12
|
import fs, { existsSync } from "node:fs";
|
|
13
13
|
import path from "node:path";
|
|
@@ -2171,10 +2171,10 @@ function formatTokens(n) {
|
|
|
2171
2171
|
* Build a context window summary: "in:1.2K out:50 ctx:1.2K/1M (0.1%)"
|
|
2172
2172
|
*/
|
|
2173
2173
|
function formatTokenInfo(inputTokens, outputTokens, cacheReadTokens, cacheWriteTokens, model, aicNano) {
|
|
2174
|
-
if (inputTokens === void 0) return void 0;
|
|
2174
|
+
if (inputTokens === void 0 && (aicNano ?? 0) <= 0) return void 0;
|
|
2175
2175
|
const parts = [];
|
|
2176
2176
|
const maxPrompt = model?.capabilities?.limits?.max_prompt_tokens;
|
|
2177
|
-
if (maxPrompt) {
|
|
2177
|
+
if (inputTokens !== void 0) if (maxPrompt) {
|
|
2178
2178
|
const pct = (inputTokens / maxPrompt * 100).toFixed(1);
|
|
2179
2179
|
parts.push(`in:${formatTokens(inputTokens)}/${formatTokens(maxPrompt)} (${pct}%)`);
|
|
2180
2180
|
} else parts.push(`in:${formatTokens(inputTokens)}`);
|
|
@@ -2291,7 +2291,7 @@ function collectToolFieldKeys(body) {
|
|
|
2291
2291
|
//#endregion
|
|
2292
2292
|
//#region package.json
|
|
2293
2293
|
var name = "github-router";
|
|
2294
|
-
var version = "0.3.
|
|
2294
|
+
var version = "0.3.322";
|
|
2295
2295
|
//#endregion
|
|
2296
2296
|
//#region src/lib/approval.ts
|
|
2297
2297
|
const awaitApproval = async () => {
|
|
@@ -3011,13 +3011,33 @@ async function handleCompletion$1(c) {
|
|
|
3011
3011
|
let upstreamFinished = firstResult.done;
|
|
3012
3012
|
let consumerCancelled = false;
|
|
3013
3013
|
let aicRecorded = false;
|
|
3014
|
+
let streamAicNano;
|
|
3015
|
+
let completionLogged = false;
|
|
3014
3016
|
const tapAic = (chunk) => {
|
|
3015
3017
|
if (aicRecorded || !chunk.data || chunk.data === "[DONE]") return;
|
|
3016
3018
|
try {
|
|
3017
3019
|
const parsed = JSON.parse(chunk.data);
|
|
3018
|
-
|
|
3020
|
+
const nano = extractAndRecordPricedAic(resolvedModel, parsed);
|
|
3021
|
+
if (nano !== void 0) {
|
|
3022
|
+
aicRecorded = true;
|
|
3023
|
+
streamAicNano = nano;
|
|
3024
|
+
}
|
|
3019
3025
|
} catch {}
|
|
3020
3026
|
};
|
|
3027
|
+
const logStreamCompletion = () => {
|
|
3028
|
+
if (completionLogged || consumerCancelled || streamAicNano === void 0) return;
|
|
3029
|
+
completionLogged = true;
|
|
3030
|
+
logRequest({
|
|
3031
|
+
method: "POST",
|
|
3032
|
+
path: c.req.path,
|
|
3033
|
+
model: originalModel,
|
|
3034
|
+
resolvedModel,
|
|
3035
|
+
aicNano: streamAicNano,
|
|
3036
|
+
status: 200,
|
|
3037
|
+
streaming: true,
|
|
3038
|
+
streamMs: Date.now() - startTime
|
|
3039
|
+
}, selectedModel, startTime);
|
|
3040
|
+
};
|
|
3021
3041
|
const safeClose = (controller) => {
|
|
3022
3042
|
try {
|
|
3023
3043
|
controller.close();
|
|
@@ -3061,6 +3081,7 @@ async function handleCompletion$1(c) {
|
|
|
3061
3081
|
}
|
|
3062
3082
|
if (result.done) {
|
|
3063
3083
|
upstreamFinished = true;
|
|
3084
|
+
logStreamCompletion();
|
|
3064
3085
|
safeClose(controller);
|
|
3065
3086
|
return;
|
|
3066
3087
|
}
|
|
@@ -3490,7 +3511,10 @@ function sanitizeAnthropicBody(rawBody) {
|
|
|
3490
3511
|
* Verified live: `copilot_usage` rides inside the terminal `message_delta`
|
|
3491
3512
|
* event beside `usage`. Chunks are arbitrary byte splits, so the tap buffers
|
|
3492
3513
|
* text, splits on blank-line event boundaries, and keeps the tail. Recording
|
|
3493
|
-
* fires at most once per tap instance (one terminal event per stream)
|
|
3514
|
+
* fires at most once per tap instance (one terminal event per stream), and
|
|
3515
|
+
* only for a priced reading: a zero-nano frame is skipped so an interim
|
|
3516
|
+
* free frame can never latch ahead of the real terminal value (same
|
|
3517
|
+
* contract as `extractAndRecordPricedAic`).
|
|
3494
3518
|
*
|
|
3495
3519
|
* Total and never throws — a malformed frame is skipped silently. The relay
|
|
3496
3520
|
* path additionally wraps the call in try/catch, so a tap bug can never break
|
|
@@ -3513,7 +3537,7 @@ function createAnthropicAicTap(record) {
|
|
|
3513
3537
|
try {
|
|
3514
3538
|
const parsed = JSON.parse(dataLines.join("\n"));
|
|
3515
3539
|
const usage = extractCopilotUsage(parsed.copilot_usage);
|
|
3516
|
-
if (usage) {
|
|
3540
|
+
if (usage && usage.totalNanoAiu > 0) {
|
|
3517
3541
|
recorded = true;
|
|
3518
3542
|
try {
|
|
3519
3543
|
record(usage);
|
|
@@ -3632,7 +3656,7 @@ function makeContentBlockStop(index) {
|
|
|
3632
3656
|
index
|
|
3633
3657
|
};
|
|
3634
3658
|
}
|
|
3635
|
-
function makeMessageDelta(stopReason, stopSequence, usage) {
|
|
3659
|
+
function makeMessageDelta(stopReason, stopSequence, usage, copilotUsage) {
|
|
3636
3660
|
return {
|
|
3637
3661
|
type: "message_delta",
|
|
3638
3662
|
delta: {
|
|
@@ -3644,7 +3668,8 @@ function makeMessageDelta(stopReason, stopSequence, usage) {
|
|
|
3644
3668
|
output_tokens: usage.output_tokens ?? 0,
|
|
3645
3669
|
cache_read_input_tokens: usage.cache_read_input_tokens ?? 0,
|
|
3646
3670
|
cache_creation_input_tokens: usage.cache_creation_input_tokens ?? 0
|
|
3647
|
-
}
|
|
3671
|
+
},
|
|
3672
|
+
...copilotUsage ? { copilot_usage: copilotUsage } : {}
|
|
3648
3673
|
};
|
|
3649
3674
|
}
|
|
3650
3675
|
function makeMessageStop() {
|
|
@@ -4599,6 +4624,7 @@ async function* synthAnthropicFromChat(upstream, opts) {
|
|
|
4599
4624
|
let usageCacheRead = 0;
|
|
4600
4625
|
let usageCacheWrite = 0;
|
|
4601
4626
|
let aicRecorded = false;
|
|
4627
|
+
let aicCopilotUsageWire;
|
|
4602
4628
|
let finishReason = null;
|
|
4603
4629
|
let sawDone = false;
|
|
4604
4630
|
yield makeMessageStart(messageId, opts.modelId);
|
|
@@ -4616,7 +4642,12 @@ async function* synthAnthropicFromChat(upstream, opts) {
|
|
|
4616
4642
|
continue;
|
|
4617
4643
|
}
|
|
4618
4644
|
if (!aicRecorded) {
|
|
4619
|
-
|
|
4645
|
+
const pricedUsage = extractCopilotUsage(chunk.copilot_usage);
|
|
4646
|
+
if (pricedUsage && pricedUsage.totalNanoAiu > 0) {
|
|
4647
|
+
recordAic(opts.modelId, pricedUsage);
|
|
4648
|
+
aicRecorded = true;
|
|
4649
|
+
aicCopilotUsageWire = copilotUsageToWire(pricedUsage);
|
|
4650
|
+
}
|
|
4620
4651
|
}
|
|
4621
4652
|
if (chunk.usage) {
|
|
4622
4653
|
usageIn = Math.max(usageIn, chunk.usage.prompt_tokens ?? 0);
|
|
@@ -4702,7 +4733,7 @@ async function* synthAnthropicFromChat(upstream, opts) {
|
|
|
4702
4733
|
output_tokens: usage.output,
|
|
4703
4734
|
cache_read_input_tokens: usage.cacheRead,
|
|
4704
4735
|
cache_creation_input_tokens: usage.cacheWrite
|
|
4705
|
-
});
|
|
4736
|
+
}, aicCopilotUsageWire);
|
|
4706
4737
|
yield makeMessageStop();
|
|
4707
4738
|
}
|
|
4708
4739
|
//#endregion
|
|
@@ -4858,7 +4889,7 @@ async function* synthAnthropicFromResponses(upstream, opts) {
|
|
|
4858
4889
|
let sawTool = false;
|
|
4859
4890
|
let hitMaxTokens = false;
|
|
4860
4891
|
let sawTerminal = false;
|
|
4861
|
-
let
|
|
4892
|
+
let aicCopilotUsageWire = void 0;
|
|
4862
4893
|
const closeCurrent = () => {
|
|
4863
4894
|
if (!current) return;
|
|
4864
4895
|
q.push(makeContentBlockStop(current.index));
|
|
@@ -5028,8 +5059,12 @@ async function* synthAnthropicFromResponses(upstream, opts) {
|
|
|
5028
5059
|
case "response.completed":
|
|
5029
5060
|
case "response.incomplete": {
|
|
5030
5061
|
sawTerminal = true;
|
|
5031
|
-
if (
|
|
5032
|
-
|
|
5062
|
+
if (aicCopilotUsageWire === void 0) {
|
|
5063
|
+
const usage = extractCopilotUsage(ev.copilot_usage);
|
|
5064
|
+
if (usage && usage.totalNanoAiu > 0) {
|
|
5065
|
+
recordAic(opts.modelId, usage);
|
|
5066
|
+
aicCopilotUsageWire = copilotUsageToWire(usage);
|
|
5067
|
+
}
|
|
5033
5068
|
}
|
|
5034
5069
|
const u = ev.response?.usage;
|
|
5035
5070
|
if (u) {
|
|
@@ -5063,7 +5098,7 @@ async function* synthAnthropicFromResponses(upstream, opts) {
|
|
|
5063
5098
|
output_tokens: usage.output,
|
|
5064
5099
|
cache_read_input_tokens: usage.cacheRead,
|
|
5065
5100
|
cache_creation_input_tokens: usage.cacheWrite
|
|
5066
|
-
}));
|
|
5101
|
+
}, aicCopilotUsageWire));
|
|
5067
5102
|
q.push(makeMessageStop());
|
|
5068
5103
|
for (const e of q) yield e;
|
|
5069
5104
|
q.length = 0;
|
|
@@ -6923,13 +6958,33 @@ async function handleResponses(c) {
|
|
|
6923
6958
|
let pendingFirstChunk = firstChunk;
|
|
6924
6959
|
let consumerCancelled = false;
|
|
6925
6960
|
let aicRecorded = false;
|
|
6961
|
+
let streamAicNano;
|
|
6962
|
+
let completionLogged = false;
|
|
6926
6963
|
const tapAic = (chunk) => {
|
|
6927
6964
|
if (aicRecorded || !chunk.data || chunk.data === "[DONE]") return;
|
|
6928
6965
|
try {
|
|
6929
6966
|
const parsed = JSON.parse(chunk.data);
|
|
6930
|
-
|
|
6967
|
+
const nano = extractAndRecordPricedAic(resolvedModel, parsed);
|
|
6968
|
+
if (nano !== void 0) {
|
|
6969
|
+
aicRecorded = true;
|
|
6970
|
+
streamAicNano = nano;
|
|
6971
|
+
}
|
|
6931
6972
|
} catch {}
|
|
6932
6973
|
};
|
|
6974
|
+
const logStreamCompletion = () => {
|
|
6975
|
+
if (completionLogged || consumerCancelled || streamAicNano === void 0) return;
|
|
6976
|
+
completionLogged = true;
|
|
6977
|
+
logRequest({
|
|
6978
|
+
method: "POST",
|
|
6979
|
+
path: c.req.path,
|
|
6980
|
+
model: originalModel,
|
|
6981
|
+
resolvedModel,
|
|
6982
|
+
aicNano: streamAicNano,
|
|
6983
|
+
status: 200,
|
|
6984
|
+
streaming: true,
|
|
6985
|
+
streamMs: Date.now() - startTime
|
|
6986
|
+
}, selectedModel, startTime);
|
|
6987
|
+
};
|
|
6933
6988
|
if (pendingFirstChunk !== void 0) tapAic(pendingFirstChunk);
|
|
6934
6989
|
const safeClose = (controller) => {
|
|
6935
6990
|
try {
|
|
@@ -6974,12 +7029,14 @@ async function handleResponses(c) {
|
|
|
6974
7029
|
}
|
|
6975
7030
|
if (result.done) {
|
|
6976
7031
|
upstreamFinished = true;
|
|
7032
|
+
logStreamCompletion();
|
|
6977
7033
|
safeClose(controller);
|
|
6978
7034
|
return;
|
|
6979
7035
|
}
|
|
6980
7036
|
if (result.value === void 0 || result.value === null) return;
|
|
6981
7037
|
if (result.value.data === "[DONE]") {
|
|
6982
7038
|
upstreamFinished = true;
|
|
7039
|
+
logStreamCompletion();
|
|
6983
7040
|
safeClose(controller);
|
|
6984
7041
|
return;
|
|
6985
7042
|
}
|
|
@@ -7078,12 +7135,14 @@ async function handleResponsesCompact(c) {
|
|
|
7078
7135
|
});
|
|
7079
7136
|
const response = await fetchWithTransientRetry(() => tryRefreshAndRetry(doFetch, "/responses/compact"), { label: "/responses/compact" });
|
|
7080
7137
|
if (response.ok) {
|
|
7138
|
+
const json = await response.json();
|
|
7139
|
+
extractAndRecordAic(resolveModel(body.model), json);
|
|
7081
7140
|
logRequest({
|
|
7082
7141
|
method: "POST",
|
|
7083
7142
|
path: c.req.path,
|
|
7084
7143
|
status: 200
|
|
7085
7144
|
}, void 0, startTime);
|
|
7086
|
-
return c.json(
|
|
7145
|
+
return c.json(json);
|
|
7087
7146
|
}
|
|
7088
7147
|
if (response.status === 404) {
|
|
7089
7148
|
consola.debug("Copilot API does not support /responses/compact, using synthetic compaction");
|
|
@@ -7130,6 +7189,7 @@ async function syntheticCompact(c, body, startTime) {
|
|
|
7130
7189
|
}, void 0, startTime);
|
|
7131
7190
|
throw error;
|
|
7132
7191
|
}
|
|
7192
|
+
extractAndRecordAic(resolveModel(body.model), result);
|
|
7133
7193
|
logRequest({
|
|
7134
7194
|
method: "POST",
|
|
7135
7195
|
path: c.req.path,
|
|
@@ -7852,4 +7912,4 @@ function getCodexEnvVars(serverUrl) {
|
|
|
7852
7912
|
//#endregion
|
|
7853
7913
|
export { validateCheapProfilePrerequisites as A, formatCheap1mPrerequisiteFailure as C, profileDescriptor as D, formatFastPrerequisiteFailure as E, checkClaudeVersion as F, updateClaude as I, validateFastProfilePrerequisites as M, validateMaxProfileLaunch as N, resolveLaunchProfile as O, runSelfUpdate as P, LUNA_SCOUT_ALIAS_ID as S, formatCheapestPrerequisiteFailure as T, CHEAP_EXPLORE_ALIAS_ID as _, sharedServerArgs as a, CHEAP_PLAN_ALIAS_ID as b, stopKeepAwake as c, enableFileLogging as d, CHEAPEST_EXPLORE_ALIAS_ID as f, CHEAPEST_REVIEWER_ALIAS_ID as g, CHEAPEST_PLAN_ALIAS_ID as h, setupAndServe as i, validateCheapestProfilePrerequisites as j, validateCheap1mProfilePrerequisites as k, injectModelPickerSettingsFile as l, CHEAPEST_IMPLEMENTER_ALIAS_ID as m, getCodexEnvVars as n, LAUNCH_SECRET_HEADER as o, CHEAPEST_GENERAL_PURPOSE_ALIAS_ID as p, parseSharedArgs as r, startKeepAwake as s, getClaudeCodeEnvVars as t, listModelsForEndpoint as u, CHEAP_GENERAL_PURPOSE_ALIAS_ID as v, formatCheapPrerequisiteFailure as w, CHEAP_REVIEWER_ALIAS_ID as x, CHEAP_IMPLEMENTER_ALIAS_ID as y };
|
|
7854
7914
|
|
|
7855
|
-
//# sourceMappingURL=server-setup-
|
|
7915
|
+
//# sourceMappingURL=server-setup-DQVRJluz.js.map
|