agentbox-sdk 0.1.313 → 0.1.314
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/agents/index.js
CHANGED
|
@@ -4141,6 +4141,7 @@ var OpenCodeAgentAdapter = class {
|
|
|
4141
4141
|
let streamedTextFromSse = "";
|
|
4142
4142
|
const assistantTextByMessageId = /* @__PURE__ */ new Map();
|
|
4143
4143
|
const announcedAssistantCompletions = /* @__PURE__ */ new Set();
|
|
4144
|
+
const partTypeById = /* @__PURE__ */ new Map();
|
|
4144
4145
|
let dispatchError;
|
|
4145
4146
|
let firstSseEventLogged = false;
|
|
4146
4147
|
let sendToSession;
|
|
@@ -4391,16 +4392,28 @@ var OpenCodeAgentAdapter = class {
|
|
|
4391
4392
|
resolveSessionTerminal();
|
|
4392
4393
|
}
|
|
4393
4394
|
}
|
|
4395
|
+
if (payloadRecord?.type === "message.part.updated") {
|
|
4396
|
+
const properties = payloadRecord.properties;
|
|
4397
|
+
const part = properties?.part;
|
|
4398
|
+
if (part && typeof part.id === "string" && typeof part.type === "string") {
|
|
4399
|
+
partTypeById.set(part.id, part.type);
|
|
4400
|
+
}
|
|
4401
|
+
}
|
|
4394
4402
|
if (payloadRecord?.type === "message.part.delta") {
|
|
4395
4403
|
const properties = payloadRecord.properties;
|
|
4396
4404
|
const eventSessionId = typeof properties?.sessionID === "string" ? properties.sessionID : void 0;
|
|
4397
4405
|
const eventMessageId = typeof properties?.messageID === "string" ? properties.messageID : void 0;
|
|
4406
|
+
const eventPartId = typeof properties?.partID === "string" ? properties.partID : void 0;
|
|
4398
4407
|
const isForeignSession = eventSessionId !== void 0 && eventSessionId !== sessionId || eventSessionId === void 0 && eventMessageId !== void 0 && foreignMessageIds.has(eventMessageId);
|
|
4399
4408
|
if (isForeignSession) {
|
|
4400
4409
|
continue;
|
|
4401
4410
|
}
|
|
4402
4411
|
const delta = typeof properties?.delta === "string" ? properties.delta : "";
|
|
4403
|
-
|
|
4412
|
+
const field = typeof properties?.field === "string" ? properties.field : void 0;
|
|
4413
|
+
const partType = eventPartId ? partTypeById.get(eventPartId) : void 0;
|
|
4414
|
+
const isTextDelta = field === "text" && partType !== "reasoning";
|
|
4415
|
+
const isReasoningDelta = field === "text" && partType === "reasoning" || field === "reasoning_content" || field === "reasoning_details";
|
|
4416
|
+
if (delta && isTextDelta) {
|
|
4404
4417
|
streamedTextFromSse += delta;
|
|
4405
4418
|
if (eventMessageId) {
|
|
4406
4419
|
assistantTextByMessageId.set(
|
|
@@ -4419,7 +4432,7 @@ var OpenCodeAgentAdapter = class {
|
|
|
4419
4432
|
{ delta }
|
|
4420
4433
|
)
|
|
4421
4434
|
);
|
|
4422
|
-
} else if (delta &&
|
|
4435
|
+
} else if (delta && isReasoningDelta) {
|
|
4423
4436
|
sink.emitEvent(
|
|
4424
4437
|
createNormalizedEvent(
|
|
4425
4438
|
"reasoning.delta",
|
package/dist/index.js
CHANGED