@copilotkit/react-core 1.57.4 → 1.58.0-canary.thread-id-propagation

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.
@@ -2127,7 +2127,7 @@ const MCPAppsActivityContentSchema = zod.z.object({
2127
2127
  resourceUri: zod.z.string(),
2128
2128
  serverHash: zod.z.string(),
2129
2129
  serverId: zod.z.string().optional(),
2130
- toolInput: zod.z.record(zod.z.unknown()).optional()
2130
+ toolInput: zod.z.record(zod.z.string(), zod.z.unknown()).optional()
2131
2131
  });
2132
2132
  function isRequest(msg) {
2133
2133
  return "id" in msg && "method" in msg;
@@ -4159,6 +4159,17 @@ function useAgent({ agentId, updates, throttleMs } = {}) {
4159
4159
  (0, react.useEffect)(() => {
4160
4160
  if (agent instanceof _ag_ui_client.HttpAgent) agent.headers = { ...copilotkit.headers };
4161
4161
  }, [agent, JSON.stringify(copilotkit.headers)]);
4162
+ const chatConfig = useCopilotChatConfiguration();
4163
+ const configThreadId = chatConfig?.threadId;
4164
+ const configHasExplicitThreadId = chatConfig?.hasExplicitThreadId;
4165
+ (0, react.useEffect)(() => {
4166
+ if (!configHasExplicitThreadId || !configThreadId) return;
4167
+ agent.threadId = configThreadId;
4168
+ }, [
4169
+ agent,
4170
+ configThreadId,
4171
+ configHasExplicitThreadId
4172
+ ]);
4162
4173
  return { agent };
4163
4174
  }
4164
4175
 
@@ -8789,7 +8800,7 @@ const getErrorActions = (error) => {
8789
8800
  switch (error.code) {
8790
8801
  case _copilotkit_shared.CopilotKitErrorCode.MISSING_PUBLIC_API_KEY_ERROR: return { primary: {
8791
8802
  label: "Show me how",
8792
- onClick: () => window.open("https://docs.copilotkit.ai/premium#how-do-i-get-access-to-premium-features", "_blank", "noopener,noreferrer")
8803
+ onClick: () => window.open("https://docs.copilotkit.ai/premium/overview#getting-access", "_blank", "noopener,noreferrer")
8793
8804
  } };
8794
8805
  case _copilotkit_shared.CopilotKitErrorCode.UPGRADE_REQUIRED_ERROR: return { primary: {
8795
8806
  label: "Upgrade",
@@ -10426,4 +10437,4 @@ Object.defineProperty(exports, 'useToast', {
10426
10437
  return useToast;
10427
10438
  }
10428
10439
  });
10429
- //# sourceMappingURL=copilotkit-CtXcs1ea.cjs.map
10440
+ //# sourceMappingURL=copilotkit-B4ouY7qC.cjs.map