@yourgpt/copilot-sdk 2.1.8 → 2.5.1-beta.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.
@@ -2290,8 +2290,7 @@ ${this.dynamicContext}`.trim() : this.config.systemPrompt;
2290
2290
  (tc) => !pendingIds.has(tc?.id ?? "")
2291
2291
  ))
2292
2292
  continue;
2293
- if (msg.role === "tool" && msg.tool_call_id && pendingIds.has(msg.tool_call_id))
2294
- continue;
2293
+ if (msg.role === "tool" && msg.tool_call_id) continue;
2295
2294
  messagesToInsert.push({
2296
2295
  id: generateMessageId(),
2297
2296
  role: msg.role,
@@ -5685,11 +5684,14 @@ function CopilotProvider(props) {
5685
5684
  async (content, attachments) => {
5686
5685
  debugLog("Sending message:", content);
5687
5686
  setAgentIteration(0);
5687
+ setWasStopped(false);
5688
5688
  await chatRef.current?.sendMessage(content, attachments);
5689
5689
  },
5690
5690
  [debugLog]
5691
5691
  );
5692
+ const [wasStopped, setWasStopped] = useState(false);
5692
5693
  const stop = useCallback(() => {
5694
+ setWasStopped(true);
5693
5695
  chatRef.current?.stop();
5694
5696
  }, []);
5695
5697
  const clearMessages = useCallback(() => {
@@ -5766,6 +5768,7 @@ function CopilotProvider(props) {
5766
5768
  status,
5767
5769
  error,
5768
5770
  isLoading,
5771
+ wasStopped,
5769
5772
  // Chat actions
5770
5773
  sendMessage,
5771
5774
  stop,
@@ -5816,6 +5819,7 @@ function CopilotProvider(props) {
5816
5819
  status,
5817
5820
  error,
5818
5821
  isLoading,
5822
+ wasStopped,
5819
5823
  sendMessage,
5820
5824
  stop,
5821
5825
  clearMessages,
@@ -5954,5 +5958,5 @@ function useMCPTools(config) {
5954
5958
  }
5955
5959
 
5956
5960
  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 };
5957
- //# sourceMappingURL=chunk-ISOMZAYN.js.map
5958
- //# sourceMappingURL=chunk-ISOMZAYN.js.map
5961
+ //# sourceMappingURL=chunk-JPUKXFR4.js.map
5962
+ //# sourceMappingURL=chunk-JPUKXFR4.js.map