@yourgpt/copilot-sdk 2.1.5-alpha.8 → 2.1.7
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/{chunk-KYVWKMUT.js → chunk-H3LX6FTP.js} +3 -3
- package/dist/{chunk-KYVWKMUT.js.map → chunk-H3LX6FTP.js.map} +1 -1
- package/dist/{chunk-JV2L3WZS.cjs → chunk-IDAQU3FP.cjs} +18 -3
- package/dist/chunk-IDAQU3FP.cjs.map +1 -0
- package/dist/{chunk-FDZVDGNR.js → chunk-ISOMZAYN.js} +18 -3
- package/dist/chunk-ISOMZAYN.js.map +1 -0
- package/dist/{chunk-KLSKP6AZ.cjs → chunk-JFVTY757.cjs} +16 -16
- package/dist/{chunk-KLSKP6AZ.cjs.map → chunk-JFVTY757.cjs.map} +1 -1
- package/dist/experimental/index.cjs +2 -2
- package/dist/experimental/index.js +1 -1
- package/dist/react/index.cjs +62 -62
- package/dist/react/index.d.cts +4 -0
- package/dist/react/index.d.ts +4 -0
- package/dist/react/index.js +2 -2
- package/dist/styles.css +21 -0
- package/dist/ui/index.cjs +5 -5
- package/dist/ui/index.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-FDZVDGNR.js.map +0 -1
- package/dist/chunk-JV2L3WZS.cjs.map +0 -1
|
@@ -2211,7 +2211,7 @@ ${this.dynamicContext}`.trim() : this.config.systemPrompt;
|
|
|
2211
2211
|
this.handleError(error);
|
|
2212
2212
|
return;
|
|
2213
2213
|
}
|
|
2214
|
-
if (chunk.type === "message:end" && this.streamState?.
|
|
2214
|
+
if (chunk.type === "message:end" && this.streamState !== null && (this.streamState.content || (this.streamState.toolResults?.size ?? 0) > 0)) {
|
|
2215
2215
|
this.debug("message:end mid-stream", {
|
|
2216
2216
|
messageId: this.streamState.messageId,
|
|
2217
2217
|
contentLength: this.streamState.content.length,
|
|
@@ -2286,6 +2286,12 @@ ${this.dynamicContext}`.trim() : this.config.systemPrompt;
|
|
|
2286
2286
|
continue;
|
|
2287
2287
|
}
|
|
2288
2288
|
if (msg.role === "assistant" && !msg.tool_calls?.length) continue;
|
|
2289
|
+
if (msg.role === "assistant" && msg.tool_calls?.length && msg.tool_calls.every(
|
|
2290
|
+
(tc) => !pendingIds.has(tc?.id ?? "")
|
|
2291
|
+
))
|
|
2292
|
+
continue;
|
|
2293
|
+
if (msg.role === "tool" && msg.tool_call_id && pendingIds.has(msg.tool_call_id))
|
|
2294
|
+
continue;
|
|
2289
2295
|
messagesToInsert.push({
|
|
2290
2296
|
id: generateMessageId(),
|
|
2291
2297
|
role: msg.role,
|
|
@@ -2403,6 +2409,15 @@ ${this.dynamicContext}`.trim() : this.config.systemPrompt;
|
|
|
2403
2409
|
if (chunk.type === "message:delta") {
|
|
2404
2410
|
this.callbacks.onMessageDelta?.(assistantMessage.id, chunk.content);
|
|
2405
2411
|
}
|
|
2412
|
+
if (chunk.type === "thread:created") {
|
|
2413
|
+
const serverThreadId = chunk.threadId;
|
|
2414
|
+
if (!this.config.threadId || this.config.threadId !== serverThreadId) {
|
|
2415
|
+
this.config.threadId = serverThreadId;
|
|
2416
|
+
this.sessionInitPromise = null;
|
|
2417
|
+
this.setSessionStatus("ready");
|
|
2418
|
+
this.callbacks.onThreadChange?.(serverThreadId);
|
|
2419
|
+
}
|
|
2420
|
+
}
|
|
2406
2421
|
if (isStreamDone(chunk)) {
|
|
2407
2422
|
this.debug("streamDone", {
|
|
2408
2423
|
chunkType: chunk.type,
|
|
@@ -5939,5 +5954,5 @@ function useMCPTools(config) {
|
|
|
5939
5954
|
}
|
|
5940
5955
|
|
|
5941
5956
|
export { AbstractAgentLoop, AbstractChat, CopilotProvider, MessageHistoryContext, MessageTree, ReactChatState, SkillProvider, createReactChatState, defaultMessageHistoryConfig, initialAgentLoopState, isCompactionMarker, keepToolPairsAtomic, toDisplayMessage, toLLMMessage, toLLMMessages, useAIContext, useAIContexts, useCopilot, useMCPClient, useMCPTools, useMessageHistory, useMessageHistoryContext, useSkillContext, useTool, useTools };
|
|
5942
|
-
//# sourceMappingURL=chunk-
|
|
5943
|
-
//# sourceMappingURL=chunk-
|
|
5957
|
+
//# sourceMappingURL=chunk-ISOMZAYN.js.map
|
|
5958
|
+
//# sourceMappingURL=chunk-ISOMZAYN.js.map
|