@dotobokuri/fleet-console 1.66.0 → 1.67.0
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/client/assets/{_baseUniq-rDf4uMQX.js → _baseUniq-DG32CEpb.js} +1 -1
- package/dist/client/assets/{arc-btPQ2GHn.js → arc-CoHkSCMF.js} +1 -1
- package/dist/client/assets/{architectureDiagram-Q4EWVU46-DG6KDx34.js → architectureDiagram-Q4EWVU46-f0RKHqJg.js} +1 -1
- package/dist/client/assets/{blockDiagram-DXYQGD6D-XUrLsQey.js → blockDiagram-DXYQGD6D-Dxb3hLAV.js} +1 -1
- package/dist/client/assets/{c4Diagram-AHTNJAMY-DuXkZ8b1.js → c4Diagram-AHTNJAMY-C5q_ahSd.js} +1 -1
- package/dist/client/assets/channel-C-Qx-Oi-.js +1 -0
- package/dist/client/assets/{chunk-4BX2VUAB-C2tTKvHv.js → chunk-4BX2VUAB-BS0W4Fpt.js} +1 -1
- package/dist/client/assets/{chunk-4TB4RGXK-C5bwM8_h.js → chunk-4TB4RGXK-p03eWKTO.js} +1 -1
- package/dist/client/assets/{chunk-55IACEB6-BhcOy6C-.js → chunk-55IACEB6-BB1ALVX2.js} +1 -1
- package/dist/client/assets/{chunk-EDXVE4YY-TOZwStuB.js → chunk-EDXVE4YY-DV4N-Npm.js} +1 -1
- package/dist/client/assets/{chunk-FMBD7UC4-B8JSJHVV.js → chunk-FMBD7UC4-Da8VspnD.js} +1 -1
- package/dist/client/assets/{chunk-OYMX7WX6-BsNJ9iub.js → chunk-OYMX7WX6-CWTmAQhy.js} +1 -1
- package/dist/client/assets/{chunk-QZHKN3VN-BhHSM1D6.js → chunk-QZHKN3VN-DE9xUsy3.js} +1 -1
- package/dist/client/assets/{chunk-YZCP3GAM-B9d83zwz.js → chunk-YZCP3GAM-BxriNNdB.js} +1 -1
- package/dist/client/assets/classDiagram-6PBFFD2Q-DA7e8Mft.js +1 -0
- package/dist/client/assets/classDiagram-v2-HSJHXN6E-DA7e8Mft.js +1 -0
- package/dist/client/assets/clone-Rpb38n4i.js +1 -0
- package/dist/client/assets/{cose-bilkent-S5V4N54A-D5mwO2NV.js → cose-bilkent-S5V4N54A-B4sjskIn.js} +1 -1
- package/dist/client/assets/{dagre-KV5264BT-5fSh4g2E.js → dagre-KV5264BT-oJms5aS3.js} +1 -1
- package/dist/client/assets/{diagram-5BDNPKRD-CtCGKgkm.js → diagram-5BDNPKRD-BAbLGddM.js} +1 -1
- package/dist/client/assets/{diagram-G4DWMVQ6-CmGVsepF.js → diagram-G4DWMVQ6-BrhRQwe-.js} +1 -1
- package/dist/client/assets/{diagram-MMDJMWI5-BR9Rfnad.js → diagram-MMDJMWI5-Buxu7Ng3.js} +1 -1
- package/dist/client/assets/{diagram-TYMM5635-C9kuBFny.js → diagram-TYMM5635-Cnp__7LJ.js} +1 -1
- package/dist/client/assets/{erDiagram-SMLLAGMA-BlL5tH_h.js → erDiagram-SMLLAGMA-ctmZHrVO.js} +1 -1
- package/dist/client/assets/{flowDiagram-DWJPFMVM-IUe6EFlH.js → flowDiagram-DWJPFMVM-DsQXJqF_.js} +1 -1
- package/dist/client/assets/{ganttDiagram-T4ZO3ILL-G-CTHnXi.js → ganttDiagram-T4ZO3ILL-SAFJNY9M.js} +1 -1
- package/dist/client/assets/{gitGraphDiagram-UUTBAWPF-COUsDQ0n.js → gitGraphDiagram-UUTBAWPF-Bd5Dq0vQ.js} +1 -1
- package/dist/client/assets/{graph-BCiainCT.js → graph-DzMOPhFp.js} +1 -1
- package/dist/client/assets/index-BLA_qnPk.css +1 -0
- package/dist/client/assets/index-CGE8u6Es.js +465 -0
- package/dist/client/assets/{infoDiagram-42DDH7IO-DbNkXGyd.js → infoDiagram-42DDH7IO-BrEfG9P4.js} +1 -1
- package/dist/client/assets/{ishikawaDiagram-UXIWVN3A-Iqt-Zs6v.js → ishikawaDiagram-UXIWVN3A-Dg22orvH.js} +1 -1
- package/dist/client/assets/{journeyDiagram-VCZTEJTY-m7TrTD61.js → journeyDiagram-VCZTEJTY-DEcjEc6c.js} +1 -1
- package/dist/client/assets/{kanban-definition-6JOO6SKY-Df5KWqsi.js → kanban-definition-6JOO6SKY-C2Xa4znN.js} +1 -1
- package/dist/client/assets/{layout-BtA7fX7y.js → layout-B7E_-0ev.js} +1 -1
- package/dist/client/assets/{linear-DVL8mywl.js → linear-BXJsh3FL.js} +1 -1
- package/dist/client/assets/{mermaid.core-CmjUZw2x.js → mermaid.core-CdZpLnyY.js} +4 -4
- package/dist/client/assets/{min-BTu70auM.js → min-CEAFFcJY.js} +1 -1
- package/dist/client/assets/{mindmap-definition-QFDTVHPH-BYpo-Mnc.js → mindmap-definition-QFDTVHPH-iXzcnu1C.js} +1 -1
- package/dist/client/assets/{pieDiagram-DEJITSTG-B8zFmcim.js → pieDiagram-DEJITSTG-CdRN75ad.js} +1 -1
- package/dist/client/assets/{quadrantDiagram-34T5L4WZ-CMYVBi7F.js → quadrantDiagram-34T5L4WZ-Dscl0EFH.js} +1 -1
- package/dist/client/assets/{requirementDiagram-MS252O5E-BFeVMKvJ.js → requirementDiagram-MS252O5E-CLmSCaQs.js} +1 -1
- package/dist/client/assets/{sankeyDiagram-XADWPNL6-D2I70l9E.js → sankeyDiagram-XADWPNL6-BfPk87jf.js} +1 -1
- package/dist/client/assets/{sequenceDiagram-FGHM5R23-zawVvGJJ.js → sequenceDiagram-FGHM5R23-DE8sU8ej.js} +1 -1
- package/dist/client/assets/{stateDiagram-FHFEXIEX-DnBtIbuv.js → stateDiagram-FHFEXIEX-BmaQc1Nm.js} +1 -1
- package/dist/client/assets/stateDiagram-v2-QKLJ7IA2-TcoFpvuT.js +1 -0
- package/dist/client/assets/{timeline-definition-GMOUNBTQ-0gfoVpmY.js → timeline-definition-GMOUNBTQ-C4Z0umzx.js} +1 -1
- package/dist/client/assets/{vennDiagram-DHZGUBPP-CuaEOGH2.js → vennDiagram-DHZGUBPP-BKlcRXlE.js} +1 -1
- package/dist/client/assets/{wardley-RL74JXVD-C-H0Svof.js → wardley-RL74JXVD-B0RT7bAW.js} +1 -1
- package/dist/client/assets/{wardleyDiagram-NUSXRM2D-MQjjZFwh.js → wardleyDiagram-NUSXRM2D-mx28kvam.js} +1 -1
- package/dist/client/assets/{xychartDiagram-5P7HB3ND-BhTAVqtf.js → xychartDiagram-5P7HB3ND-DU6qIPI0.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/fleet-plugins/terminal/routes.mjs +403 -76
- package/dist/fleet.mjs +233 -53
- package/package.json +1 -1
- package/dist/client/assets/channel-CXR6clX_.js +0 -1
- package/dist/client/assets/classDiagram-6PBFFD2Q-4x7ZfFx0.js +0 -1
- package/dist/client/assets/classDiagram-v2-HSJHXN6E-4x7ZfFx0.js +0 -1
- package/dist/client/assets/clone-lkppJrH0.js +0 -1
- package/dist/client/assets/index-B1tQI7A5.js +0 -465
- package/dist/client/assets/index-D3b63Dhe.css +0 -1
- package/dist/client/assets/stateDiagram-v2-QKLJ7IA2-D7rH7_-p.js +0 -1
package/dist/fleet.mjs
CHANGED
|
@@ -21975,18 +21975,25 @@ function withheldClaudeSkillStub(name, tokens, budget) {
|
|
|
21975
21975
|
var CLAUDE_WEB_SEARCH_TOOL_NAME = "WebSearch";
|
|
21976
21976
|
var ANTHROPIC_WEB_SEARCH_TOOL_NAME = "web_search";
|
|
21977
21977
|
var ANTHROPIC_WEB_SEARCH_TOOL_TYPE = "web_search_20250305";
|
|
21978
|
-
|
|
21979
|
-
|
|
21978
|
+
var CLAUDE_WEB_SEARCH_TOOL_IDENTIFIERS = [
|
|
21979
|
+
CLAUDE_WEB_SEARCH_TOOL_NAME,
|
|
21980
|
+
ANTHROPIC_WEB_SEARCH_TOOL_NAME,
|
|
21981
|
+
ANTHROPIC_WEB_SEARCH_TOOL_TYPE
|
|
21982
|
+
];
|
|
21983
|
+
function matchesToolIdentifier(tool, identifiers) {
|
|
21984
|
+
return typeof tool.name === "string" && identifiers.has(tool.name) || typeof tool.type === "string" && identifiers.has(tool.type);
|
|
21980
21985
|
}
|
|
21981
|
-
function
|
|
21982
|
-
return choice?.type === "tool" &&
|
|
21986
|
+
function matchesToolChoice(choice, identifiers) {
|
|
21987
|
+
return choice?.type === "tool" && typeof choice.name === "string" && identifiers.has(choice.name);
|
|
21983
21988
|
}
|
|
21984
|
-
function
|
|
21989
|
+
function omitClaudeClientTools(request, names) {
|
|
21990
|
+
const identifiers = new Set(names);
|
|
21991
|
+
if (identifiers.size === 0) return { request, changed: false };
|
|
21985
21992
|
const tools = request.tools;
|
|
21986
|
-
const kept = tools?.filter((tool) => !
|
|
21993
|
+
const kept = tools?.filter((tool) => !matchesToolIdentifier(tool, identifiers));
|
|
21987
21994
|
const toolsChanged = tools !== void 0 && kept !== void 0 && kept.length !== tools.length;
|
|
21988
21995
|
const choice = request.tool_choice;
|
|
21989
|
-
const choiceChanged =
|
|
21996
|
+
const choiceChanged = matchesToolChoice(choice, identifiers);
|
|
21990
21997
|
if (!toolsChanged && !choiceChanged) {
|
|
21991
21998
|
return { request, changed: false };
|
|
21992
21999
|
}
|
|
@@ -22005,6 +22012,42 @@ function omitClaudeWebSearchTools(request) {
|
|
|
22005
22012
|
changed: true
|
|
22006
22013
|
};
|
|
22007
22014
|
}
|
|
22015
|
+
var CLAUDE_USAGE_LIMIT_DIRECTIVE = /^\s*\[Usage limit [^\]]*\]\s*$/;
|
|
22016
|
+
function stripClaudeUsageLimitDirectives(messages) {
|
|
22017
|
+
let removed = 0;
|
|
22018
|
+
const kept = [];
|
|
22019
|
+
for (const message of messages) {
|
|
22020
|
+
const stripped = stripUsageLimitBlocks(message);
|
|
22021
|
+
removed += stripped.removed;
|
|
22022
|
+
if (stripped.message !== null) kept.push(stripped.message);
|
|
22023
|
+
}
|
|
22024
|
+
if (removed === 0) return { messages, changed: false, removed: 0 };
|
|
22025
|
+
const last = kept[kept.length - 1];
|
|
22026
|
+
if (last === void 0 || last.role === "assistant") {
|
|
22027
|
+
return { messages, changed: false, removed: 0 };
|
|
22028
|
+
}
|
|
22029
|
+
return { messages: kept, changed: true, removed };
|
|
22030
|
+
}
|
|
22031
|
+
function stripUsageLimitBlocks(message) {
|
|
22032
|
+
const content = message.content;
|
|
22033
|
+
if (typeof content === "string") {
|
|
22034
|
+
return isClaudeUsageLimitDirective(content) ? { message: null, removed: 1 } : { message, removed: 0 };
|
|
22035
|
+
}
|
|
22036
|
+
if (!Array.isArray(content)) return { message, removed: 0 };
|
|
22037
|
+
const kept = content.filter(
|
|
22038
|
+
(block) => !(isClaudeTextBlock(block) && isClaudeUsageLimitDirective(block.text))
|
|
22039
|
+
);
|
|
22040
|
+
const removed = content.length - kept.length;
|
|
22041
|
+
if (removed === 0) return { message, removed: 0 };
|
|
22042
|
+
if (kept.length === 0) return { message: null, removed };
|
|
22043
|
+
return { message: { ...message, content: kept }, removed };
|
|
22044
|
+
}
|
|
22045
|
+
function isClaudeUsageLimitDirective(text) {
|
|
22046
|
+
return CLAUDE_USAGE_LIMIT_DIRECTIVE.test(text);
|
|
22047
|
+
}
|
|
22048
|
+
function omitClaudeWebSearchTools(request) {
|
|
22049
|
+
return omitClaudeClientTools(request, CLAUDE_WEB_SEARCH_TOOL_IDENTIFIERS);
|
|
22050
|
+
}
|
|
22008
22051
|
var benchmarks_default = {
|
|
22009
22052
|
version: 2,
|
|
22010
22053
|
sources: {
|
|
@@ -28446,22 +28489,42 @@ function parseXaiEventStream(body2, options, functionCallTimeoutMs) {
|
|
|
28446
28489
|
functionCallTimeoutMs
|
|
28447
28490
|
);
|
|
28448
28491
|
}
|
|
28492
|
+
var XAI_ASSEMBLY_DEADLINE = /* @__PURE__ */ Symbol("xai-assembly-deadline");
|
|
28449
28493
|
async function* assembleXaiFunctionCalls(source, controller, timeoutMs) {
|
|
28450
28494
|
const iterator = source[Symbol.asyncIterator]();
|
|
28451
28495
|
const pending = /* @__PURE__ */ new Map();
|
|
28496
|
+
let snapshot;
|
|
28452
28497
|
let completedNormally = false;
|
|
28453
28498
|
try {
|
|
28454
28499
|
while (true) {
|
|
28455
28500
|
const deadlineAt = earliestXaiFunctionCallDeadline(pending);
|
|
28456
|
-
const result = deadlineAt === void 0 ? await iterator.next() : await nextXaiEventBeforeDeadline(iterator, deadlineAt
|
|
28501
|
+
const result = deadlineAt === void 0 ? await iterator.next() : await nextXaiEventBeforeDeadline(iterator, deadlineAt);
|
|
28502
|
+
if (result === XAI_ASSEMBLY_DEADLINE) {
|
|
28503
|
+
yield* salvageXaiPendingCalls(
|
|
28504
|
+
pending,
|
|
28505
|
+
snapshot,
|
|
28506
|
+
`function call assembly exceeded ${timeoutMs}ms`,
|
|
28507
|
+
controller
|
|
28508
|
+
);
|
|
28509
|
+
completedNormally = true;
|
|
28510
|
+
return;
|
|
28511
|
+
}
|
|
28457
28512
|
if (result.done) {
|
|
28458
28513
|
if (pending.size > 0) {
|
|
28459
|
-
|
|
28514
|
+
yield* salvageXaiPendingCalls(
|
|
28515
|
+
pending,
|
|
28516
|
+
snapshot,
|
|
28517
|
+
"stream ended before function call output_item.done",
|
|
28518
|
+
controller
|
|
28519
|
+
);
|
|
28460
28520
|
}
|
|
28461
28521
|
completedNormally = true;
|
|
28462
28522
|
return;
|
|
28463
28523
|
}
|
|
28464
28524
|
const event = result.value;
|
|
28525
|
+
if (event.type === "response.created") {
|
|
28526
|
+
snapshot = event.response;
|
|
28527
|
+
}
|
|
28465
28528
|
if (event.type === "response.completed" && pending.size > 0) {
|
|
28466
28529
|
throw incompleteXaiFunctionCall("response.completed arrived before function call output_item.done");
|
|
28467
28530
|
}
|
|
@@ -28472,10 +28535,18 @@ async function* assembleXaiFunctionCalls(source, controller, timeoutMs) {
|
|
|
28472
28535
|
// Each call gets a full timeout from its own added event. Waiting uses the
|
|
28473
28536
|
// earliest active deadline, so a later parallel call is never shortened by
|
|
28474
28537
|
// an earlier call's age.
|
|
28475
|
-
deadlineAt: Date.now() + timeoutMs
|
|
28538
|
+
deadlineAt: Date.now() + timeoutMs,
|
|
28539
|
+
argumentsBuffer: ""
|
|
28476
28540
|
});
|
|
28477
28541
|
continue;
|
|
28478
28542
|
}
|
|
28543
|
+
if (event.type === "response.function_call_arguments.delta") {
|
|
28544
|
+
const call = pending.get(xaiFunctionCallKey(event.output_index, event.item_id));
|
|
28545
|
+
if (call !== void 0) {
|
|
28546
|
+
call.argumentsBuffer += event.delta;
|
|
28547
|
+
}
|
|
28548
|
+
continue;
|
|
28549
|
+
}
|
|
28479
28550
|
if (event.type === "response.function_call_arguments.done") {
|
|
28480
28551
|
const call = pending.get(xaiFunctionCallKey(event.output_index, event.item_id));
|
|
28481
28552
|
if (call !== void 0) {
|
|
@@ -28521,24 +28592,60 @@ function earliestXaiFunctionCallDeadline(pending) {
|
|
|
28521
28592
|
}
|
|
28522
28593
|
return earliest;
|
|
28523
28594
|
}
|
|
28524
|
-
async function
|
|
28525
|
-
const
|
|
28526
|
-
|
|
28527
|
-
|
|
28595
|
+
async function* salvageXaiPendingCalls(pending, snapshot, reason, controller) {
|
|
28596
|
+
const salvageable = [...pending.values()].every(
|
|
28597
|
+
(call) => completeXaiArguments(call) !== void 0
|
|
28598
|
+
);
|
|
28599
|
+
if (snapshot === void 0 || !salvageable) {
|
|
28600
|
+
const error51 = incompleteXaiFunctionCall(reason);
|
|
28528
28601
|
controller.abort(error51);
|
|
28529
28602
|
throw error51;
|
|
28530
28603
|
}
|
|
28604
|
+
wireLog("xai-responses.function_call.salvaged", {
|
|
28605
|
+
reason,
|
|
28606
|
+
calls: pending.size
|
|
28607
|
+
});
|
|
28608
|
+
controller.abort(incompleteXaiFunctionCall(reason));
|
|
28609
|
+
for (const [key, call] of pending) {
|
|
28610
|
+
const args = completeXaiArguments(call) ?? "";
|
|
28611
|
+
const item = { ...call.added.item, arguments: args };
|
|
28612
|
+
yield call.added;
|
|
28613
|
+
yield {
|
|
28614
|
+
type: "response.function_call_arguments.done",
|
|
28615
|
+
item_id: call.added.item.id,
|
|
28616
|
+
output_index: call.added.output_index,
|
|
28617
|
+
arguments: args
|
|
28618
|
+
};
|
|
28619
|
+
yield { type: "response.output_item.done", output_index: call.added.output_index, item };
|
|
28620
|
+
pending.delete(key);
|
|
28621
|
+
}
|
|
28622
|
+
yield { type: "response.completed", response: { ...snapshot, usage: null } };
|
|
28623
|
+
}
|
|
28624
|
+
function completeXaiArguments(call) {
|
|
28625
|
+
const candidate = call.argumentsDone?.arguments ?? call.argumentsBuffer;
|
|
28626
|
+
if (candidate.length === 0) return void 0;
|
|
28627
|
+
let parsed;
|
|
28628
|
+
try {
|
|
28629
|
+
parsed = JSON.parse(candidate);
|
|
28630
|
+
} catch {
|
|
28631
|
+
return void 0;
|
|
28632
|
+
}
|
|
28633
|
+
return typeof parsed === "object" && parsed !== null && !Array.isArray(parsed) ? candidate : void 0;
|
|
28634
|
+
}
|
|
28635
|
+
async function nextXaiEventBeforeDeadline(iterator, deadlineAt) {
|
|
28636
|
+
const remainingMs = deadlineAt - Date.now();
|
|
28637
|
+
if (remainingMs <= 0) {
|
|
28638
|
+
return XAI_ASSEMBLY_DEADLINE;
|
|
28639
|
+
}
|
|
28531
28640
|
let timeout;
|
|
28532
28641
|
const next = iterator.next();
|
|
28533
28642
|
void next.catch(() => void 0);
|
|
28534
28643
|
try {
|
|
28535
28644
|
return await Promise.race([
|
|
28536
28645
|
next,
|
|
28537
|
-
new Promise((
|
|
28646
|
+
new Promise((resolve3) => {
|
|
28538
28647
|
timeout = setTimeout(() => {
|
|
28539
|
-
|
|
28540
|
-
controller.abort(error51);
|
|
28541
|
-
reject(error51);
|
|
28648
|
+
resolve3(XAI_ASSEMBLY_DEADLINE);
|
|
28542
28649
|
}, remainingMs);
|
|
28543
28650
|
})
|
|
28544
28651
|
]);
|
|
@@ -28573,6 +28680,10 @@ function parseEventFrame3(frame) {
|
|
|
28573
28680
|
}
|
|
28574
28681
|
return canonicalEvent3(parsed);
|
|
28575
28682
|
}
|
|
28683
|
+
var XAI_EOS_SENTINEL = "<|eos|>";
|
|
28684
|
+
function withoutXaiSentinel(text) {
|
|
28685
|
+
return text.includes(XAI_EOS_SENTINEL) ? text.split(XAI_EOS_SENTINEL).join("") : text;
|
|
28686
|
+
}
|
|
28576
28687
|
function canonicalEvent3(value) {
|
|
28577
28688
|
if (!isRecord7(value) || typeof value.type !== "string") {
|
|
28578
28689
|
throw new UpstreamProtocolError("Grok CLI SSE event was not an object with a type");
|
|
@@ -28592,25 +28703,30 @@ function canonicalEvent3(value) {
|
|
|
28592
28703
|
content_index: number32(value.content_index, "content_index"),
|
|
28593
28704
|
part: {
|
|
28594
28705
|
type: "output_text",
|
|
28595
|
-
text: typeof part.text === "string" ? part.text : ""
|
|
28706
|
+
text: typeof part.text === "string" ? withoutXaiSentinel(part.text) : ""
|
|
28596
28707
|
}
|
|
28597
28708
|
};
|
|
28598
28709
|
}
|
|
28599
|
-
case "response.output_text.delta":
|
|
28710
|
+
case "response.output_text.delta": {
|
|
28711
|
+
const delta = withoutXaiSentinel(string32(value.delta, "delta"));
|
|
28712
|
+
if (delta.length === 0) {
|
|
28713
|
+
return void 0;
|
|
28714
|
+
}
|
|
28600
28715
|
return {
|
|
28601
28716
|
type: value.type,
|
|
28602
28717
|
item_id: string32(value.item_id, "item_id"),
|
|
28603
28718
|
output_index: number32(value.output_index, "output_index"),
|
|
28604
28719
|
content_index: number32(value.content_index, "content_index"),
|
|
28605
|
-
delta
|
|
28720
|
+
delta
|
|
28606
28721
|
};
|
|
28722
|
+
}
|
|
28607
28723
|
case "response.output_text.done":
|
|
28608
28724
|
return {
|
|
28609
28725
|
type: value.type,
|
|
28610
28726
|
item_id: string32(value.item_id, "item_id"),
|
|
28611
28727
|
output_index: number32(value.output_index, "output_index"),
|
|
28612
28728
|
content_index: number32(value.content_index, "content_index"),
|
|
28613
|
-
text: string32(value.text, "text")
|
|
28729
|
+
text: withoutXaiSentinel(string32(value.text, "text"))
|
|
28614
28730
|
};
|
|
28615
28731
|
case "response.reasoning_summary_text.delta":
|
|
28616
28732
|
case "response.reasoning_text.delta":
|
|
@@ -28632,11 +28748,17 @@ function canonicalEvent3(value) {
|
|
|
28632
28748
|
item
|
|
28633
28749
|
};
|
|
28634
28750
|
}
|
|
28635
|
-
//
|
|
28636
|
-
//
|
|
28637
|
-
//
|
|
28751
|
+
// Fragments still never reach the client — the assembler absorbs them and the `.done`
|
|
28752
|
+
// event carries the complete argument object. They are decoded rather than discarded
|
|
28753
|
+
// because this proxy has been measured ending a stream with the whole argument object
|
|
28754
|
+
// delivered as fragments and no terminal frame; the buffer is that turn's only copy.
|
|
28638
28755
|
case "response.function_call_arguments.delta":
|
|
28639
|
-
return
|
|
28756
|
+
return {
|
|
28757
|
+
type: value.type,
|
|
28758
|
+
item_id: string32(value.item_id, "item_id"),
|
|
28759
|
+
output_index: number32(value.output_index, "output_index"),
|
|
28760
|
+
delta: string32(value.delta, "delta")
|
|
28761
|
+
};
|
|
28640
28762
|
case "response.function_call_arguments.done":
|
|
28641
28763
|
return {
|
|
28642
28764
|
type: value.type,
|
|
@@ -29106,6 +29228,10 @@ function isCursorNativeRedirectToolName(name) {
|
|
|
29106
29228
|
const leaf = toolLeafName3(name).replace(/[_-]/g, "").toLowerCase();
|
|
29107
29229
|
return ["grep", "bash", "shellcommand", "execcommand"].includes(leaf);
|
|
29108
29230
|
}
|
|
29231
|
+
function isCursorWithheldToolName(name) {
|
|
29232
|
+
const leaf = toolLeafName3(name).replace(/[_-]/g, "").toLowerCase();
|
|
29233
|
+
return ["bash", "shellcommand", "execcommand"].includes(leaf);
|
|
29234
|
+
}
|
|
29109
29235
|
function cursorNativeExecRedirect(exec2, tools, providerIdentifier) {
|
|
29110
29236
|
const messageId = numberValue2(exec2.id ?? 0);
|
|
29111
29237
|
const execId = stringValue2(exec2.execId) || `redirect-${messageId}`;
|
|
@@ -29317,22 +29443,23 @@ function grepArguments(tool, input) {
|
|
|
29317
29443
|
args.path = input.path;
|
|
29318
29444
|
}
|
|
29319
29445
|
const optionMappings = [
|
|
29320
|
-
[input.glob || void 0, "glob"],
|
|
29321
|
-
[input.outputMode, "output_mode"],
|
|
29322
|
-
[input.caseInsensitive ? true : void 0, "case_insensitive"],
|
|
29323
|
-
[input.contextBefore, "context_before"],
|
|
29324
|
-
[input.contextAfter, "context_after"],
|
|
29325
|
-
[input.context, "context"],
|
|
29326
|
-
[input.type, "type"],
|
|
29327
|
-
[input.headLimit, "head_limit"],
|
|
29328
|
-
[input.multiline ? true : void 0, "multiline"],
|
|
29329
|
-
[input.sort, "sort"],
|
|
29330
|
-
[input.sortAscending, "sort_ascending"],
|
|
29331
|
-
[input.offset, "offset"]
|
|
29446
|
+
[input.glob || void 0, ["glob"]],
|
|
29447
|
+
[input.outputMode, ["output_mode"]],
|
|
29448
|
+
[input.caseInsensitive ? true : void 0, ["-i", "case_insensitive"]],
|
|
29449
|
+
[input.contextBefore, ["-B", "context_before"]],
|
|
29450
|
+
[input.contextAfter, ["-A", "context_after"]],
|
|
29451
|
+
[input.context, ["context", "-C"]],
|
|
29452
|
+
[input.type, ["type"]],
|
|
29453
|
+
[input.headLimit, ["head_limit"]],
|
|
29454
|
+
[input.multiline ? true : void 0, ["multiline"]],
|
|
29455
|
+
[input.sort, ["sort"]],
|
|
29456
|
+
[input.sortAscending, ["sort_ascending"]],
|
|
29457
|
+
[input.offset, ["offset"]]
|
|
29332
29458
|
];
|
|
29333
|
-
for (const [value,
|
|
29459
|
+
for (const [value, candidates] of optionMappings) {
|
|
29334
29460
|
if (value === void 0) continue;
|
|
29335
|
-
|
|
29461
|
+
const key = firstSchemaProperty(tool.inputSchemaValue, candidates);
|
|
29462
|
+
if (key === void 0) return null;
|
|
29336
29463
|
args[key] = value;
|
|
29337
29464
|
}
|
|
29338
29465
|
return args;
|
|
@@ -30951,7 +31078,7 @@ function applyCursorToolBudget(request) {
|
|
|
30951
31078
|
const supportsDeferredLoading = declaredTools.some((tool) => isCursorToolSearchName(tool.name));
|
|
30952
31079
|
const sourceTools = declaredTools.filter((tool) => {
|
|
30953
31080
|
const explicitlySelected = referencedNames.has(tool.name) || cursorToolMatches(tool.name, selectedName);
|
|
30954
|
-
if (
|
|
31081
|
+
if (isCursorWithheldToolName(tool.name) && !explicitlySelected) return false;
|
|
30955
31082
|
return !supportsDeferredLoading || tool.defer_loading !== true || isCursorToolSearchName(tool.name) || explicitlySelected;
|
|
30956
31083
|
});
|
|
30957
31084
|
const wireTools = sourceTools.map(toCursorWireTool);
|
|
@@ -33252,6 +33379,63 @@ function sortGatewayModelsByProvider(models) {
|
|
|
33252
33379
|
return GATEWAY_MODELS.indexOf(left) - GATEWAY_MODELS.indexOf(right);
|
|
33253
33380
|
});
|
|
33254
33381
|
}
|
|
33382
|
+
var codexRequestPolicy = {
|
|
33383
|
+
provider: "codex",
|
|
33384
|
+
shapeRequest: (request, steps) => steps.withholdWebSearchTools(steps.pruneSkillPayloads(request))
|
|
33385
|
+
};
|
|
33386
|
+
var cursorRequestPolicy = {
|
|
33387
|
+
provider: "cursor",
|
|
33388
|
+
shapeRequest: (request, steps) => steps.withholdWebSearchTools(steps.pruneSkillPayloads(request))
|
|
33389
|
+
};
|
|
33390
|
+
var kimiRequestPolicy = {
|
|
33391
|
+
provider: "kimi",
|
|
33392
|
+
shapeRequest: (request, steps) => steps.pruneSkillPayloads(request)
|
|
33393
|
+
};
|
|
33394
|
+
var opencodeGoRequestPolicy = {
|
|
33395
|
+
provider: "opencode",
|
|
33396
|
+
shapeRequest: (request, steps) => steps.withholdWebSearchTools(steps.pruneSkillPayloads(request))
|
|
33397
|
+
};
|
|
33398
|
+
var xaiRequestPolicy = {
|
|
33399
|
+
provider: "xai",
|
|
33400
|
+
shapeRequest: (request, steps) => steps.withholdWebSearchTools(steps.pruneSkillPayloads(request))
|
|
33401
|
+
};
|
|
33402
|
+
var POLICIES = {
|
|
33403
|
+
codex: codexRequestPolicy,
|
|
33404
|
+
cursor: cursorRequestPolicy,
|
|
33405
|
+
kimi: kimiRequestPolicy,
|
|
33406
|
+
// The provider id is `opencode`; its folder carries the `-go` subscription name.
|
|
33407
|
+
opencode: opencodeGoRequestPolicy,
|
|
33408
|
+
xai: xaiRequestPolicy
|
|
33409
|
+
};
|
|
33410
|
+
function resolveGatewayRequestPolicy(provider) {
|
|
33411
|
+
return POLICIES[provider];
|
|
33412
|
+
}
|
|
33413
|
+
function applyGatewayRequestPolicy(request, target2, withheldSkills) {
|
|
33414
|
+
const context = {
|
|
33415
|
+
target: target2,
|
|
33416
|
+
upstreamModel: upstreamModelId(target2),
|
|
33417
|
+
withheldSkills
|
|
33418
|
+
};
|
|
33419
|
+
const policy = resolveGatewayRequestPolicy(target2.provider);
|
|
33420
|
+
return policy.shapeRequest(request, buildPolicySteps(context), context);
|
|
33421
|
+
}
|
|
33422
|
+
function buildPolicySteps(context) {
|
|
33423
|
+
return {
|
|
33424
|
+
pruneSkillPayloads: (request) => {
|
|
33425
|
+
const pruned = pruneClaudeSkillPayloads(request.messages, {
|
|
33426
|
+
...typeof context.target.contextWindow === "number" ? { contextWindow: context.target.contextWindow } : {},
|
|
33427
|
+
model: context.upstreamModel,
|
|
33428
|
+
withheld: context.withheldSkills
|
|
33429
|
+
});
|
|
33430
|
+
for (const skill of pruned.withheld) context.withheldSkills.add(skill.name);
|
|
33431
|
+
return pruned.changed ? { ...request, messages: [...pruned.messages] } : request;
|
|
33432
|
+
},
|
|
33433
|
+
withholdWebSearchTools: (request) => {
|
|
33434
|
+
const omitted = omitClaudeWebSearchTools(request);
|
|
33435
|
+
return omitted.changed ? omitted.request : request;
|
|
33436
|
+
}
|
|
33437
|
+
};
|
|
33438
|
+
}
|
|
33255
33439
|
var HOP_BY_HOP_HEADERS = /* @__PURE__ */ new Set([
|
|
33256
33440
|
"connection",
|
|
33257
33441
|
"content-encoding",
|
|
@@ -33470,19 +33654,11 @@ function createAiGatewayRouter(deps) {
|
|
|
33470
33654
|
writeAnthropicError(res, 403, "permission_error", `AI gateway model is not enabled: ${requested}`);
|
|
33471
33655
|
return true;
|
|
33472
33656
|
}
|
|
33473
|
-
|
|
33474
|
-
|
|
33475
|
-
|
|
33476
|
-
model: upstreamModelId(target2),
|
|
33477
|
-
withheld: withheldSkills
|
|
33478
|
-
});
|
|
33479
|
-
for (const skill of pruned.withheld) withheldSkills.add(skill.name);
|
|
33480
|
-
if (pruned.changed) body2 = { ...body2, messages: [...pruned.messages] };
|
|
33481
|
-
}
|
|
33482
|
-
if (target2 && target2.provider !== "kimi") {
|
|
33483
|
-
const omitted = omitClaudeWebSearchTools(body2);
|
|
33484
|
-
if (omitted.changed) body2 = omitted.request;
|
|
33657
|
+
const withoutUsageLimitDirectives = stripClaudeUsageLimitDirectives(body2.messages);
|
|
33658
|
+
if (withoutUsageLimitDirectives.changed) {
|
|
33659
|
+
body2 = { ...body2, messages: [...withoutUsageLimitDirectives.messages] };
|
|
33485
33660
|
}
|
|
33661
|
+
if (target2) body2 = applyGatewayRequestPolicy(body2, target2, withheldSkills);
|
|
33486
33662
|
let credential = "";
|
|
33487
33663
|
let chatgptAccountId = "";
|
|
33488
33664
|
if (target2?.provider === "cursor") {
|
|
@@ -34676,9 +34852,13 @@ function buildClaudeGatewayArgs(context) {
|
|
|
34676
34852
|
]),
|
|
34677
34853
|
...context.mcpServers.length > 0 ? ["--mcp-config", buildClaudeMcpConfig(context.mcpServers)] : [],
|
|
34678
34854
|
...buildSettingsArgs(context.skillOverrides),
|
|
34855
|
+
...buildSearchToolArgs(),
|
|
34679
34856
|
"--dangerously-skip-permissions"
|
|
34680
34857
|
];
|
|
34681
34858
|
}
|
|
34859
|
+
function buildSearchToolArgs() {
|
|
34860
|
+
return ["--allowedTools", "Grep,Glob"];
|
|
34861
|
+
}
|
|
34682
34862
|
function buildSettingsArgs(skillOverrides) {
|
|
34683
34863
|
if (skillOverrides === void 0 || Object.keys(skillOverrides).length === 0) return [];
|
|
34684
34864
|
return ["--settings", JSON.stringify({ skillOverrides })];
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{ap as o,aq as n}from"./mermaid.core-CmjUZw2x.js";const t=(a,r)=>o.lang.round(n.parse(a)[r]);export{t as c};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{s as a,c as s,a as e,C as t}from"./chunk-4TB4RGXK-C5bwM8_h.js";import{_ as i}from"./mermaid.core-CmjUZw2x.js";import"./chunk-FMBD7UC4-B8JSJHVV.js";import"./chunk-YZCP3GAM-B9d83zwz.js";import"./chunk-55IACEB6-BhcOy6C-.js";import"./chunk-EDXVE4YY-TOZwStuB.js";import"./index-B1tQI7A5.js";var n={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{n as diagram};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{s as a,c as s,a as e,C as t}from"./chunk-4TB4RGXK-C5bwM8_h.js";import{_ as i}from"./mermaid.core-CmjUZw2x.js";import"./chunk-FMBD7UC4-B8JSJHVV.js";import"./chunk-YZCP3GAM-B9d83zwz.js";import"./chunk-55IACEB6-BhcOy6C-.js";import"./chunk-EDXVE4YY-TOZwStuB.js";import"./index-B1tQI7A5.js";var n={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{n as diagram};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as r}from"./graph-BCiainCT.js";var e=4;function a(o){return r(o,e)}export{a as c};
|