github-router 0.3.321 → 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-BrDqsuge.js → aic-ledger-BW3zMiCx.js} +19 -2
- package/dist/aic-ledger-BW3zMiCx.js.map +1 -0
- package/dist/{attribution-settings-DHWo0lyG.js → attribution-settings-z-U2L7ab.js} +4 -4
- package/dist/{attribution-settings-DHWo0lyG.js.map → attribution-settings-z-U2L7ab.js.map} +1 -1
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/{claude-uAFPKvuS.js → claude-DtWf7DEw.js} +8 -8
- package/dist/{claude-uAFPKvuS.js.map → claude-DtWf7DEw.js.map} +1 -1
- package/dist/{codex-CVHdye0h.js → codex-CDtFT-Qp.js} +4 -4
- package/dist/{codex-CVHdye0h.js.map → codex-CDtFT-Qp.js.map} +1 -1
- package/dist/{copilot-discount-BnJkEojk.js → copilot-discount-I6BrT7QE.js} +2 -2
- package/dist/{copilot-discount-BnJkEojk.js.map → copilot-discount-I6BrT7QE.js.map} +1 -1
- package/dist/engine-DA5laGIh.js +2 -0
- package/dist/{gate-discovery-DUBuxiLb.js → gate-discovery-j_hQ1IPc.js} +2 -2
- package/dist/{gate-discovery-DUBuxiLb.js.map → gate-discovery-j_hQ1IPc.js.map} +1 -1
- package/dist/{internal-aic-status-Dc2JQDsX.js → internal-aic-status-CKXxxb30.js} +3 -3
- package/dist/{internal-aic-status-Dc2JQDsX.js.map → internal-aic-status-CKXxxb30.js.map} +1 -1
- package/dist/{internal-stop-hook-DCjYE2x0.js → internal-stop-hook-BGTPRCtO.js} +2 -2
- package/dist/{internal-stop-hook-DCjYE2x0.js.map → internal-stop-hook-BGTPRCtO.js.map} +1 -1
- package/dist/main.js +6 -6
- package/dist/{peer-mcp-personas-BerVEkZ9.js → peer-mcp-personas-Gb0LfII0.js} +10 -7
- package/dist/{peer-mcp-personas-BerVEkZ9.js.map → peer-mcp-personas-Gb0LfII0.js.map} +1 -1
- package/dist/{provision-o4bXbsvB.js → provision-DagZEkdZ.js} +2 -2
- package/dist/{provision-o4bXbsvB.js.map → provision-DagZEkdZ.js.map} +1 -1
- package/dist/{serve-DSL2Fcnc.js → serve-DOMsmIk-.js} +5 -5
- package/dist/{serve-DSL2Fcnc.js.map → serve-DOMsmIk-.js.map} +1 -1
- package/dist/{server-setup-CXXKmPIE.js → server-setup-DQVRJluz.js} +23 -12
- package/dist/server-setup-DQVRJluz.js.map +1 -0
- package/dist/{start-Cl_1UMg_.js → start-CqSFR_s8.js} +3 -3
- package/dist/{start-Cl_1UMg_.js.map → start-CqSFR_s8.js.map} +1 -1
- package/package.json +1 -1
- package/dist/aic-ledger-BrDqsuge.js.map +0 -1
- package/dist/engine-57iIqICe.js +0 -2
- package/dist/server-setup-CXXKmPIE.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 { a as extractAndRecordPricedAic, f as
|
|
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";
|
|
@@ -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 () => {
|
|
@@ -3656,7 +3656,7 @@ function makeContentBlockStop(index) {
|
|
|
3656
3656
|
index
|
|
3657
3657
|
};
|
|
3658
3658
|
}
|
|
3659
|
-
function makeMessageDelta(stopReason, stopSequence, usage) {
|
|
3659
|
+
function makeMessageDelta(stopReason, stopSequence, usage, copilotUsage) {
|
|
3660
3660
|
return {
|
|
3661
3661
|
type: "message_delta",
|
|
3662
3662
|
delta: {
|
|
@@ -3668,7 +3668,8 @@ function makeMessageDelta(stopReason, stopSequence, usage) {
|
|
|
3668
3668
|
output_tokens: usage.output_tokens ?? 0,
|
|
3669
3669
|
cache_read_input_tokens: usage.cache_read_input_tokens ?? 0,
|
|
3670
3670
|
cache_creation_input_tokens: usage.cache_creation_input_tokens ?? 0
|
|
3671
|
-
}
|
|
3671
|
+
},
|
|
3672
|
+
...copilotUsage ? { copilot_usage: copilotUsage } : {}
|
|
3672
3673
|
};
|
|
3673
3674
|
}
|
|
3674
3675
|
function makeMessageStop() {
|
|
@@ -4623,6 +4624,7 @@ async function* synthAnthropicFromChat(upstream, opts) {
|
|
|
4623
4624
|
let usageCacheRead = 0;
|
|
4624
4625
|
let usageCacheWrite = 0;
|
|
4625
4626
|
let aicRecorded = false;
|
|
4627
|
+
let aicCopilotUsageWire;
|
|
4626
4628
|
let finishReason = null;
|
|
4627
4629
|
let sawDone = false;
|
|
4628
4630
|
yield makeMessageStart(messageId, opts.modelId);
|
|
@@ -4640,7 +4642,12 @@ async function* synthAnthropicFromChat(upstream, opts) {
|
|
|
4640
4642
|
continue;
|
|
4641
4643
|
}
|
|
4642
4644
|
if (!aicRecorded) {
|
|
4643
|
-
|
|
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
|
+
}
|
|
4644
4651
|
}
|
|
4645
4652
|
if (chunk.usage) {
|
|
4646
4653
|
usageIn = Math.max(usageIn, chunk.usage.prompt_tokens ?? 0);
|
|
@@ -4726,7 +4733,7 @@ async function* synthAnthropicFromChat(upstream, opts) {
|
|
|
4726
4733
|
output_tokens: usage.output,
|
|
4727
4734
|
cache_read_input_tokens: usage.cacheRead,
|
|
4728
4735
|
cache_creation_input_tokens: usage.cacheWrite
|
|
4729
|
-
});
|
|
4736
|
+
}, aicCopilotUsageWire);
|
|
4730
4737
|
yield makeMessageStop();
|
|
4731
4738
|
}
|
|
4732
4739
|
//#endregion
|
|
@@ -4882,7 +4889,7 @@ async function* synthAnthropicFromResponses(upstream, opts) {
|
|
|
4882
4889
|
let sawTool = false;
|
|
4883
4890
|
let hitMaxTokens = false;
|
|
4884
4891
|
let sawTerminal = false;
|
|
4885
|
-
let
|
|
4892
|
+
let aicCopilotUsageWire = void 0;
|
|
4886
4893
|
const closeCurrent = () => {
|
|
4887
4894
|
if (!current) return;
|
|
4888
4895
|
q.push(makeContentBlockStop(current.index));
|
|
@@ -5052,8 +5059,12 @@ async function* synthAnthropicFromResponses(upstream, opts) {
|
|
|
5052
5059
|
case "response.completed":
|
|
5053
5060
|
case "response.incomplete": {
|
|
5054
5061
|
sawTerminal = true;
|
|
5055
|
-
if (
|
|
5056
|
-
|
|
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
|
+
}
|
|
5057
5068
|
}
|
|
5058
5069
|
const u = ev.response?.usage;
|
|
5059
5070
|
if (u) {
|
|
@@ -5087,7 +5098,7 @@ async function* synthAnthropicFromResponses(upstream, opts) {
|
|
|
5087
5098
|
output_tokens: usage.output,
|
|
5088
5099
|
cache_read_input_tokens: usage.cacheRead,
|
|
5089
5100
|
cache_creation_input_tokens: usage.cacheWrite
|
|
5090
|
-
}));
|
|
5101
|
+
}, aicCopilotUsageWire));
|
|
5091
5102
|
q.push(makeMessageStop());
|
|
5092
5103
|
for (const e of q) yield e;
|
|
5093
5104
|
q.length = 0;
|
|
@@ -7901,4 +7912,4 @@ function getCodexEnvVars(serverUrl) {
|
|
|
7901
7912
|
//#endregion
|
|
7902
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 };
|
|
7903
7914
|
|
|
7904
|
-
//# sourceMappingURL=server-setup-
|
|
7915
|
+
//# sourceMappingURL=server-setup-DQVRJluz.js.map
|