@jeffusion/bungee-core 6.16.2 → 6.17.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/main.js +5709 -2207
- package/dist/observability-worker.js +3245 -1495
- package/dist/plugins/anthropic-request-sanitizer/index.js.map +2 -2
- package/dist/plugins/anthropic-tool-name-transformer/index.js.map +2 -2
- package/dist/plugins/chatgpt-oauth/index.js +37 -15
- package/dist/plugins/chatgpt-oauth/index.js.map +5 -5
- package/dist/plugins/codex-router/index.js +21 -3
- package/dist/plugins/codex-router/index.js.map +5 -5
- package/dist/plugins/deepseek-reasoning-fix/index.js.map +2 -2
- package/dist/plugins/key-access/index.js +1 -1
- package/dist/plugins/key-access/index.js.map +4 -4
- package/dist/plugins/key-access/ingress.js +1 -1
- package/dist/plugins/key-access/ingress.js.map +3 -3
- package/dist/plugins/key-rate-limit/index.js.map +2 -2
- package/dist/plugins/llm-protocol-adapter/control.js +1 -1
- package/dist/plugins/llm-protocol-adapter/control.js.map +3 -3
- package/dist/plugins/llm-protocol-adapter/index.js +1 -1
- package/dist/plugins/llm-protocol-adapter/index.js.map +5 -5
- package/dist/plugins/llm-tps/index.js.map +2 -2
- package/dist/plugins/model-mapping/index.js +1 -1
- package/dist/plugins/model-mapping/index.js.map +4 -4
- package/dist/plugins/models-dev/index.js.map +2 -2
- package/dist/plugins/request-logs/index.js +505 -118
- package/dist/plugins/request-logs/index.js.map +11 -10
- package/dist/plugins/request-logs/ingress.js +3 -23
- package/dist/plugins/request-logs/ingress.js.map +3 -3
- package/dist/plugins/request-logs/ui/RequestLogsPage.svelte +215 -130
- package/dist/plugins/signature-repair/index.js.map +2 -2
- package/dist/plugins/token-budget/index.js.map +2 -2
- package/dist/plugins/token-metering/index.js.map +2 -2
- package/dist/plugins/token-stats/control.js +111 -40
- package/dist/plugins/token-stats/control.js.map +6 -6
- package/dist/plugins/token-stats/index.js +92 -39
- package/dist/plugins/token-stats/index.js.map +5 -5
- package/dist/plugins/user-auth/index.js.map +2 -2
- package/package.json +3 -2
|
@@ -1418,6 +1418,17 @@ function applyToolAllowlist(body, input, allowlist) {
|
|
|
1418
1418
|
}
|
|
1419
1419
|
|
|
1420
1420
|
// plugins/codex-router/server/index.ts
|
|
1421
|
+
function recordHistoryRejection(requestId, branch, reason) {
|
|
1422
|
+
try {
|
|
1423
|
+
console.error(JSON.stringify({
|
|
1424
|
+
event: "codex_router_history_rejected",
|
|
1425
|
+
code: "codex_router_unrestorable_history_start_new_conversation",
|
|
1426
|
+
.../^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(requestId) ? { requestId } : {},
|
|
1427
|
+
branch,
|
|
1428
|
+
reason
|
|
1429
|
+
}));
|
|
1430
|
+
} catch {}
|
|
1431
|
+
}
|
|
1421
1432
|
var CodexRouterPlugin = definePlugin(class {
|
|
1422
1433
|
static name = "codex-router";
|
|
1423
1434
|
static version = "1.0.0";
|
|
@@ -1487,8 +1498,11 @@ var CodexRouterPlugin = definePlugin(class {
|
|
|
1487
1498
|
if (!Array.isArray(delta))
|
|
1488
1499
|
throw new DataAdmissionError(422, "codex_router_invalid_history");
|
|
1489
1500
|
if (protocol === "responses" && prior.items.some((item) => item.encrypted_content || item.type === "compaction")) {
|
|
1490
|
-
|
|
1501
|
+
const reason = JSON.stringify(prior.target) !== JSON.stringify(binding.target) ? "target_mismatch" : prior.origin?.provider !== binding.provider ? "provider_mismatch" : prior.origin?.model !== binding.model ? "model_mismatch" : !prior.origin?.upstreamId ? "upstream_missing" : undefined;
|
|
1502
|
+
if (reason) {
|
|
1503
|
+
recordHistoryRejection(context.requestId, "native_history_origin", reason);
|
|
1491
1504
|
throw new DataAdmissionError(422, "codex_router_unrestorable_history_start_new_conversation");
|
|
1505
|
+
}
|
|
1492
1506
|
requiredUpstreamId = prior.origin.upstreamId;
|
|
1493
1507
|
}
|
|
1494
1508
|
input.input = [...prior.items, ...delta];
|
|
@@ -1508,8 +1522,10 @@ var CodexRouterPlugin = definePlugin(class {
|
|
|
1508
1522
|
message: "This Chat target cannot restore a native compaction item. Switch back to the original Responses route, or start a new conversation with a readable summary."
|
|
1509
1523
|
});
|
|
1510
1524
|
}
|
|
1511
|
-
if (protocol !== "responses" && protocol !== "gemini_generate_content" && !allowLossyContinuation && logicalInput.some((item) => item?.encrypted_content || item?.type === "compaction"))
|
|
1525
|
+
if (protocol !== "responses" && protocol !== "gemini_generate_content" && !allowLossyContinuation && logicalInput.some((item) => item?.encrypted_content || item?.type === "compaction")) {
|
|
1526
|
+
recordHistoryRejection(context.requestId, "target_history_protocol", "opaque_history_unsupported");
|
|
1512
1527
|
throw new DataAdmissionError(422, "codex_router_unrestorable_history_start_new_conversation");
|
|
1528
|
+
}
|
|
1513
1529
|
const hasTools = input.tools?.length || logicalInput.some((item) => (item?.type === "additional_tools" || item?.type === "tool_search_output") && item.tools?.length);
|
|
1514
1530
|
if (hasTools && (!capabilities.toolCall || binding.capabilityOverrides?.tools === false))
|
|
1515
1531
|
throw new DataAdmissionError(422, "codex_router_tools_unsupported");
|
|
@@ -1622,6 +1638,7 @@ var CodexRouterPlugin = definePlugin(class {
|
|
|
1622
1638
|
headers.delete(key);
|
|
1623
1639
|
headers.set("content-type", "application/json");
|
|
1624
1640
|
headers.set("etag", headers.get("etag") ?? record.snapshot.upstreamEtag);
|
|
1641
|
+
context.responseOrigin = "gateway";
|
|
1625
1642
|
return { ...result, response: new Response(JSON.stringify(record.snapshot.native), { headers }) };
|
|
1626
1643
|
}
|
|
1627
1644
|
}
|
|
@@ -1638,6 +1655,7 @@ var CodexRouterPlugin = definePlugin(class {
|
|
|
1638
1655
|
const merged = await this.catalogResponse(native, response.headers, record, response.status);
|
|
1639
1656
|
if (record && !record.signal.aborted)
|
|
1640
1657
|
this.snapshots.put(record.snapshotKey, native, response.headers.get("etag"));
|
|
1658
|
+
context.responseOrigin = "gateway";
|
|
1641
1659
|
return merged;
|
|
1642
1660
|
});
|
|
1643
1661
|
hooks.onFinally.tap("codex-router.catalog-cleanup", (context) => {
|
|
@@ -1681,4 +1699,4 @@ export {
|
|
|
1681
1699
|
server_default as default
|
|
1682
1700
|
};
|
|
1683
1701
|
|
|
1684
|
-
//# debugId=
|
|
1702
|
+
//# debugId=1C3BC34B59FC62CB64756E2164756E21
|