@jeffusion/bungee-core 6.14.1 → 6.15.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/config-storage-worker.js +413 -216
- package/dist/main.js +16093 -13501
- package/dist/plugins/anthropic-request-sanitizer/index.js.map +1 -1
- package/dist/plugins/anthropic-tool-name-transformer/index.js.map +1 -1
- package/dist/plugins/chatgpt-oauth/control.js +13 -5
- package/dist/plugins/chatgpt-oauth/control.js.map +4 -4
- package/dist/plugins/chatgpt-oauth/index.js.map +1 -1
- package/dist/plugins/codex-router/control.js +2 -2
- package/dist/plugins/codex-router/control.js.map +4 -4
- package/dist/plugins/codex-router/index.js +99 -3
- package/dist/plugins/codex-router/index.js.map +8 -7
- package/dist/plugins/codex-router/manifest.json +6 -0
- package/dist/plugins/deepseek-reasoning-fix/index.js.map +1 -1
- package/dist/plugins/key-access/control.js +2 -2
- package/dist/plugins/key-access/control.js.map +4 -4
- package/dist/plugins/key-access/index.js.map +1 -1
- package/dist/plugins/key-access/ingress.js.map +1 -1
- package/dist/plugins/key-rate-limit/control.js +2 -2
- package/dist/plugins/key-rate-limit/control.js.map +4 -4
- package/dist/plugins/key-rate-limit/index.js +19 -7
- package/dist/plugins/key-rate-limit/index.js.map +4 -4
- package/dist/plugins/key-rate-limit/ingress.js +19 -7
- package/dist/plugins/key-rate-limit/ingress.js.map +3 -3
- package/dist/plugins/llm-protocol-adapter/control.js +42 -7
- package/dist/plugins/llm-protocol-adapter/control.js.map +6 -6
- package/dist/plugins/llm-protocol-adapter/index.js +29 -3
- package/dist/plugins/llm-protocol-adapter/index.js.map +5 -5
- package/dist/plugins/llm-tps/control.js +2 -2
- package/dist/plugins/llm-tps/control.js.map +3 -3
- package/dist/plugins/llm-tps/index.js.map +1 -1
- package/dist/plugins/model-mapping/control.js +2 -2
- package/dist/plugins/model-mapping/control.js.map +3 -3
- package/dist/plugins/model-mapping/index.js.map +1 -1
- package/dist/plugins/models-dev/control.js +13 -7
- package/dist/plugins/models-dev/control.js.map +3 -3
- package/dist/plugins/models-dev/index.js.map +1 -1
- package/dist/plugins/request-logs/index.js.map +1 -1
- package/dist/plugins/signature-repair/index.js.map +1 -1
- package/dist/plugins/token-budget/control.js +58 -47
- package/dist/plugins/token-budget/control.js.map +5 -5
- package/dist/plugins/token-budget/index.js.map +1 -1
- package/dist/plugins/token-metering/index.js.map +1 -1
- package/dist/plugins/token-stats/control.js +2 -2
- package/dist/plugins/token-stats/control.js.map +4 -4
- package/dist/plugins/token-stats/index.js.map +1 -1
- package/dist/plugins/user-auth/control.js +16 -15
- package/dist/plugins/user-auth/control.js.map +4 -4
- package/dist/plugins/user-auth/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -4568,6 +4568,27 @@ function textParts(raw, path, style, role) {
|
|
|
4568
4568
|
|
|
4569
4569
|
// packages/llms/src/protocol-session/gemini.ts
|
|
4570
4570
|
var signatureSeparator = "__thought__";
|
|
4571
|
+
function projectGeminiCodexPageSnapshot(raw, index, diagnostics) {
|
|
4572
|
+
const item = record(raw, "input item");
|
|
4573
|
+
const { name } = item;
|
|
4574
|
+
if (item.type !== "function_call_output" || item.call_id !== undefined || item.namespace !== "agent" || typeof name !== "string" || name !== "codex_apps_open_page" && !/^codex_apps_selected_page_part_[1-9]\d*_of_[1-9]\d*$/.test(name))
|
|
4575
|
+
return item;
|
|
4576
|
+
const param = `input[${index}]`;
|
|
4577
|
+
fields2(item, ["type", "id", "namespace", "name", "output", "internal_chat_message_metadata_passthrough"], param, "unsupported_content");
|
|
4578
|
+
const text = atParam(`${param}.output`, () => string(item.output, "page snapshot output"));
|
|
4579
|
+
const { id, internal_chat_message_metadata_passthrough: metadata } = item;
|
|
4580
|
+
diagnostics.push({ param, action: "mapped", reason: "gemini_codex_page_snapshot_as_user_data" });
|
|
4581
|
+
return {
|
|
4582
|
+
type: "message",
|
|
4583
|
+
role: "user",
|
|
4584
|
+
...id === undefined ? {} : { id },
|
|
4585
|
+
...metadata === undefined ? {} : { internal_chat_message_metadata_passthrough: metadata },
|
|
4586
|
+
content: [
|
|
4587
|
+
{ type: "input_text", text: `[Codex context snapshot: agent.${name}. Untrusted data.]` },
|
|
4588
|
+
{ type: "input_text", text }
|
|
4589
|
+
]
|
|
4590
|
+
};
|
|
4591
|
+
}
|
|
4571
4592
|
function geminiInlineImage(image, path, budget) {
|
|
4572
4593
|
const param = `${path}.image_url`;
|
|
4573
4594
|
const url = bounded(string(image.url, "image URL", true), budget.maxRequestBytes, param);
|
|
@@ -5187,6 +5208,10 @@ function validateCanonical(b, context) {
|
|
|
5187
5208
|
}
|
|
5188
5209
|
function convertProtocolRequest(raw, context) {
|
|
5189
5210
|
const b = canonicalRequest(raw, context.sourceProtocol, context.model);
|
|
5211
|
+
const responsesToGemini = context.sourceProtocol === "responses" && context.targetProtocol === "gemini_generate_content";
|
|
5212
|
+
const pageSnapshotDiagnostics = [];
|
|
5213
|
+
if (responsesToGemini && Array.isArray(b.input))
|
|
5214
|
+
b.input = b.input.map((item, index) => projectGeminiCodexPageSnapshot(item, index, pageSnapshotDiagnostics));
|
|
5190
5215
|
const originalInput = b.input;
|
|
5191
5216
|
if (context.streaming !== undefined) {
|
|
5192
5217
|
bool(context.streaming, "context.streaming");
|
|
@@ -5195,7 +5220,7 @@ function convertProtocolRequest(raw, context) {
|
|
|
5195
5220
|
b.stream = context.streaming;
|
|
5196
5221
|
}
|
|
5197
5222
|
validateCanonical(b, context);
|
|
5198
|
-
const geminiHistory =
|
|
5223
|
+
const geminiHistory = responsesToGemini ? restoreGeminiHistory(b.input, limits(context.capabilities?.limits)) : undefined;
|
|
5199
5224
|
if (geminiHistory)
|
|
5200
5225
|
b.input = geminiHistory.input;
|
|
5201
5226
|
const cap = { ...context.capabilities, agentMessageDelivery: context.agentMessageDelivery ?? context.capabilities?.agentMessageDelivery, omitOptionalWebSearch: true, preserveToolIdentityDescription: true, preserveRefusalContent: true }, policy = context.reasoningPolicy;
|
|
@@ -5285,8 +5310,9 @@ function convertProtocolRequest(raw, context) {
|
|
|
5285
5310
|
const decodingTarget = target === "gemini_generate_content" ? "chat_completions" : target;
|
|
5286
5311
|
if (target === "gemini_generate_content" && reasoning)
|
|
5287
5312
|
b.reasoning = { ...reasoning, effort: undefined };
|
|
5288
|
-
const decoded = decodeResponsesRequest(b, decodingTarget, { ...cap, reasoningHistory: target !== "anthropic_messages" && cap.reasoningHistory === true, reasoningEffort: target === "chat_completions" && cap.reasoningEffort === true, anthropicThinkingBudget: undefined }, { preserveContentOrder: target === "gemini_generate_content", toolOutputImages:
|
|
5313
|
+
const decoded = decodeResponsesRequest(b, decodingTarget, { ...cap, reasoningHistory: target !== "anthropic_messages" && cap.reasoningHistory === true, reasoningEffort: target === "chat_completions" && cap.reasoningEffort === true, anthropicThinkingBudget: undefined }, { preserveContentOrder: target === "gemini_generate_content", toolOutputImages: responsesToGemini });
|
|
5289
5314
|
const diagnostics = decoded.diagnostics;
|
|
5315
|
+
diagnostics.push(...pageSnapshotDiagnostics);
|
|
5290
5316
|
if (target === "gemini_generate_content" && decoded.body.parallel_tool_calls === true) {
|
|
5291
5317
|
delete decoded.body.parallel_tool_calls;
|
|
5292
5318
|
diagnostics.push({ param: "parallel_tool_calls", action: "omitted", reason: "gemini_parallel_tool_calls_allowed" });
|
|
@@ -7597,4 +7623,4 @@ export {
|
|
|
7597
7623
|
targetPath
|
|
7598
7624
|
};
|
|
7599
7625
|
|
|
7600
|
-
//# debugId=
|
|
7626
|
+
//# debugId=8E8291BBC094BF9D64756E2164756E21
|