@yourgpt/copilot-sdk 1.2.4 → 1.2.5
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-CVZ7LT5B.js → chunk-6NJKNYYW.js} +14 -12
- package/dist/chunk-6NJKNYYW.js.map +1 -0
- package/dist/{chunk-RMVUGFSK.cjs → chunk-OD6O6TQI.cjs} +14 -12
- package/dist/chunk-OD6O6TQI.cjs.map +1 -0
- package/dist/react/index.cjs +37 -37
- package/dist/react/index.js +1 -1
- package/dist/ui/index.cjs +4 -4
- package/dist/ui/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-CVZ7LT5B.js.map +0 -1
- package/dist/chunk-RMVUGFSK.cjs.map +0 -1
|
@@ -788,14 +788,16 @@ ${this.dynamicContext}`.trim() : this.config.systemPrompt,
|
|
|
788
788
|
this.debug("handleStreamResponse", `Processed ${chunkCount} chunks`);
|
|
789
789
|
const finalMessage = streamStateToMessage(this.streamState);
|
|
790
790
|
this.state.updateMessageById(this.streamState.messageId, () => finalMessage);
|
|
791
|
-
this.state.status = "ready";
|
|
792
791
|
if (!finalMessage.content && (!finalMessage.toolCalls || finalMessage.toolCalls.length === 0)) {
|
|
793
792
|
this.debug("warning", "Empty response - no content and no tool calls");
|
|
794
793
|
}
|
|
795
794
|
this.callbacks.onMessageFinish?.(finalMessage);
|
|
796
|
-
this.callbacks.onStatusChange?.("ready");
|
|
797
795
|
this.callbacks.onMessagesChange?.(this.state.messages);
|
|
798
|
-
|
|
796
|
+
if (!toolCallsEmitted) {
|
|
797
|
+
this.state.status = "ready";
|
|
798
|
+
this.callbacks.onStatusChange?.("ready");
|
|
799
|
+
this.callbacks.onFinish?.(this.state.messages);
|
|
800
|
+
}
|
|
799
801
|
this.emit("done", {});
|
|
800
802
|
this.streamState = null;
|
|
801
803
|
}
|
|
@@ -813,15 +815,15 @@ ${this.dynamicContext}`.trim() : this.config.systemPrompt,
|
|
|
813
815
|
};
|
|
814
816
|
this.state.pushMessage(message);
|
|
815
817
|
}
|
|
816
|
-
this.state.status = "ready";
|
|
817
|
-
this.callbacks.onStatusChange?.("ready");
|
|
818
818
|
this.callbacks.onMessagesChange?.(this.state.messages);
|
|
819
|
-
this.
|
|
820
|
-
if (
|
|
819
|
+
const hasToolCalls = response.requiresAction && this.state.messages.length > 0 && this.state.messages[this.state.messages.length - 1]?.toolCalls?.length;
|
|
820
|
+
if (hasToolCalls) {
|
|
821
821
|
const lastMessage = this.state.messages[this.state.messages.length - 1];
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
822
|
+
this.emit("toolCalls", { toolCalls: lastMessage.toolCalls });
|
|
823
|
+
} else {
|
|
824
|
+
this.state.status = "ready";
|
|
825
|
+
this.callbacks.onStatusChange?.("ready");
|
|
826
|
+
this.callbacks.onFinish?.(this.state.messages);
|
|
825
827
|
}
|
|
826
828
|
this.emit("done", {});
|
|
827
829
|
}
|
|
@@ -3602,5 +3604,5 @@ function useChat(config) {
|
|
|
3602
3604
|
}
|
|
3603
3605
|
|
|
3604
3606
|
export { AbstractAgentLoop, AbstractChat, CopilotProvider, ReactChat, ReactChatState, ReactThreadManager, ReactThreadManagerState, createPermissionStorage, createReactChat, createReactChatState, createReactThreadManager, createReactThreadManagerState, createSessionPermissionCache, formatKnowledgeResultsForAI, initialAgentLoopState, searchKnowledgeBase, useAIAction, useAIActions, useAIContext, useAIContexts, useAITools, useAgent, useCapabilities, useChat, useCopilot, useDevLogger, useFeatureSupport, useKnowledgeBase, useSuggestions, useSupportedMediaTypes, useThreadManager, useTool, useToolExecutor, useToolWithSchema, useTools, useToolsWithSchema };
|
|
3605
|
-
//# sourceMappingURL=chunk-
|
|
3606
|
-
//# sourceMappingURL=chunk-
|
|
3607
|
+
//# sourceMappingURL=chunk-6NJKNYYW.js.map
|
|
3608
|
+
//# sourceMappingURL=chunk-6NJKNYYW.js.map
|