@jeffusion/bungee-core 6.2.0 → 6.2.1
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.
|
@@ -6184,7 +6184,7 @@ async function relayPayload(result, param, signal) {
|
|
|
6184
6184
|
const contentType = result.bodyHandle.identity.contentType;
|
|
6185
6185
|
if (contentType === "" || contentType.includes("text/event-stream") || contentType.includes("application/octet-stream")) {
|
|
6186
6186
|
const iterator = result.bodyHandle.events({ id: "llm-adapter.relay", mandatory: true, signal })[Symbol.asyncIterator]();
|
|
6187
|
-
let call, callIndex, args = "", argumentBytes = 0, argumentsDone, outputDone = false, terminal = false, done = false;
|
|
6187
|
+
let call, callIndex, args = "", argumentBytes = 0, sawArgumentDelta = false, argumentsDone, outputDone = false, terminal = false, done = false;
|
|
6188
6188
|
const reasoning = new Map;
|
|
6189
6189
|
let reasoningBytes = 0;
|
|
6190
6190
|
const reasoningEvents = new Set(["response.reasoning_summary_part.added", "response.reasoning_summary_part.done", "response.reasoning_summary_text.delta", "response.reasoning_summary_text.done", "response.reasoning_text.delta", "response.reasoning_text.done"]);
|
|
@@ -6218,6 +6218,8 @@ async function relayPayload(result, param, signal) {
|
|
|
6218
6218
|
if (event.type === "response.created" || event.type === "response.in_progress") {
|
|
6219
6219
|
if (event.response?.error || ["failed", "incomplete", "cancelled"].includes(event.response?.status))
|
|
6220
6220
|
invalid(param);
|
|
6221
|
+
} else if (event.type === "response.metadata") {
|
|
6222
|
+
continue;
|
|
6221
6223
|
} else if (event.type === "response.output_item.added") {
|
|
6222
6224
|
if (!Number.isSafeInteger(event.output_index) || event.output_index < 0 || event.output_index >= 128 || event.output_index === callIndex || reasoning.has(event.output_index) || typeof event.item?.id !== "string")
|
|
6223
6225
|
invalid(param);
|
|
@@ -6239,10 +6241,12 @@ async function relayPayload(result, param, signal) {
|
|
|
6239
6241
|
argumentBytes += Buffer.byteLength(event.delta);
|
|
6240
6242
|
if (argumentBytes > result.bodyHandle.maxBytes)
|
|
6241
6243
|
invalid(param);
|
|
6244
|
+
sawArgumentDelta = true;
|
|
6242
6245
|
args += event.delta;
|
|
6243
6246
|
} else if (event.type === "response.function_call_arguments.done") {
|
|
6244
|
-
if (!call || argumentsDone !== undefined || event.item_id !== call.id || event.output_index !== callIndex || event.arguments !== args)
|
|
6247
|
+
if (!call || argumentsDone !== undefined || event.item_id !== call.id || event.output_index !== callIndex || typeof event.arguments !== "string" || sawArgumentDelta && event.arguments !== args || Buffer.byteLength(event.arguments) > result.bodyHandle.maxBytes)
|
|
6245
6248
|
invalid(param);
|
|
6249
|
+
args = event.arguments;
|
|
6246
6250
|
argumentsDone = args;
|
|
6247
6251
|
} else if (event.type === "response.output_item.done") {
|
|
6248
6252
|
const thought = reasoning.get(event.output_index);
|
|
@@ -7143,4 +7147,4 @@ export {
|
|
|
7143
7147
|
targetPath
|
|
7144
7148
|
};
|
|
7145
7149
|
|
|
7146
|
-
//# debugId=
|
|
7150
|
+
//# debugId=7C2FFBD5947C86DA64756E2164756E21
|