@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.
package/dist/index.d.cts CHANGED
@@ -346,7 +346,7 @@ declare function useCopilotAction<const T extends Parameter[] | [] = []>(action:
346
346
  * useful for showing intermediate state or progress during Agentic Copilot operations.
347
347
  * To get started using rendering intermediate state through this hook, checkout the documentation.
348
348
  *
349
- * https://docs.copilotkit.ai/coagents/shared-state/predictive-state-updates
349
+ * https://docs.copilotkit.ai/langgraph-python/shared-state/predictive-state-updates
350
350
  */
351
351
  declare function useCoAgentStateRender<T = any>(action: CoAgentStateRender<T>, dependencies?: any[]): void;
352
352
  //#endregion
@@ -498,7 +498,7 @@ type HintFunction = (params: HintFunctionParams) => Message$1 | undefined;
498
498
  * This hook is used to integrate an agent into your application. With its use, you can
499
499
  * render and update the state of the agent, allowing for a dynamic and interactive experience.
500
500
  * We call these shared state experiences "agentic copilots". To get started using agentic copilots, which
501
- * we refer to as CoAgents, checkout the documentation at https://docs.copilotkit.ai/coagents/quickstart/langgraph.
501
+ * we refer to as CoAgents, checkout the documentation at https://docs.copilotkit.ai/langgraph-python/quickstart.
502
502
  */
503
503
  declare function useCoAgent<T = any>(options: UseCoagentOptions<T>): UseCoagentReturnType<T>;
504
504
  //#endregion
package/dist/index.d.mts CHANGED
@@ -346,7 +346,7 @@ declare function useCopilotAction<const T extends Parameter[] | [] = []>(action:
346
346
  * useful for showing intermediate state or progress during Agentic Copilot operations.
347
347
  * To get started using rendering intermediate state through this hook, checkout the documentation.
348
348
  *
349
- * https://docs.copilotkit.ai/coagents/shared-state/predictive-state-updates
349
+ * https://docs.copilotkit.ai/langgraph-python/shared-state/predictive-state-updates
350
350
  */
351
351
  declare function useCoAgentStateRender<T = any>(action: CoAgentStateRender<T>, dependencies?: any[]): void;
352
352
  //#endregion
@@ -498,7 +498,7 @@ type HintFunction = (params: HintFunctionParams) => Message | undefined;
498
498
  * This hook is used to integrate an agent into your application. With its use, you can
499
499
  * render and update the state of the agent, allowing for a dynamic and interactive experience.
500
500
  * We call these shared state experiences "agentic copilots". To get started using agentic copilots, which
501
- * we refer to as CoAgents, checkout the documentation at https://docs.copilotkit.ai/coagents/quickstart/langgraph.
501
+ * we refer to as CoAgents, checkout the documentation at https://docs.copilotkit.ai/langgraph-python/quickstart.
502
502
  */
503
503
  declare function useCoAgent<T = any>(options: UseCoagentOptions<T>): UseCoagentReturnType<T>;
504
504
  //#endregion
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
 
3
- import { B as useInterrupt, G as useAgent, H as useSuggestions, J as useFrontendTool$1, K as useHumanInTheLoop$1, V as useConfigureSuggestions, X as useRenderCustomMessages, a as ThreadsProvider, c as CoAgentStateRendersProvider, d as shouldShowDevConsole, f as useToast, g as useCopilotContext, gt as useCopilotChatConfiguration, h as CopilotContext, i as ThreadsContext, l as useCoAgentStateRenders, lt as defineToolCallRenderer, m as useCopilotMessagesContext, n as defaultCopilotContextCategories, o as useThreads, ot as useRenderToolCall$1, p as CopilotMessagesContext, r as CoAgentStateRenderBridge, s as CoAgentStateRendersContext, t as CopilotKit, u as useAsyncCallback, ut as useCopilotKit } from "./copilotkit-CC8DjOiC.mjs";
3
+ import { B as useInterrupt, G as useAgent, H as useSuggestions, J as useFrontendTool$1, K as useHumanInTheLoop$1, V as useConfigureSuggestions, X as useRenderCustomMessages, a as ThreadsProvider, c as CoAgentStateRendersProvider, d as shouldShowDevConsole, f as useToast, g as useCopilotContext, gt as useCopilotChatConfiguration, h as CopilotContext, i as ThreadsContext, l as useCoAgentStateRenders, lt as defineToolCallRenderer, m as useCopilotMessagesContext, n as defaultCopilotContextCategories, o as useThreads, ot as useRenderToolCall$1, p as CopilotMessagesContext, r as CoAgentStateRenderBridge, s as CoAgentStateRendersContext, t as CopilotKit, u as useAsyncCallback, ut as useCopilotKit } from "./copilotkit-L4mM_JqG.mjs";
4
4
  import React, { Fragment, createElement, useCallback, useContext, useEffect, useMemo, useRef, useState } from "react";
5
5
  import { CopilotKitCoreRuntimeConnectionStatus, ToolCallStatus } from "@copilotkit/core";
6
6
  import { AGUIConnectNotImplementedError, HttpAgent } from "@ag-ui/client";
@@ -336,80 +336,6 @@ function useLegacyCoagentRenderer({ copilotkit, agent, agentId, threadId }) {
336
336
  //#endregion
337
337
  //#region src/hooks/use-copilot-chat.ts
338
338
  /**
339
- * `useCopilotChat` is a lightweight React hook for headless chat interactions.
340
- * Perfect for controlling the prebuilt chat components programmatically.
341
- *
342
- * **Open Source Friendly** - Works without requiring a free public license key.
343
- *
344
- * <Callout title="Looking for fully headless UI?">
345
- * Get started with [useCopilotChatHeadless_c](https://docs.copilotkit.ai/reference/v1/hooks/useCopilotChatHeadless_c).
346
- * </Callout>
347
- *
348
- * ## Use Cases
349
- *
350
- * - **Programmatic Messaging**: Send messages without displaying chat UI
351
- * - **Programmatic control**: Control prebuilt component programmatically
352
- * - **Background Operations**: Trigger AI interactions in the background
353
- * - **Fire-and-Forget**: Send messages without needing to read responses
354
- *
355
- * ## Usage
356
- *
357
- * ```tsx
358
- * import { TextMessage, MessageRole } from "@copilotkit/runtime-client-gql";
359
- *
360
- * const { appendMessage } = useCopilotChat();
361
- *
362
- * // Example usage without naming conflicts
363
- * const handleSendMessage = async (content: string) => {
364
- * await appendMessage(
365
- * new TextMessage({
366
- * role: MessageRole.User,
367
- * content,
368
- * })
369
- * );
370
- * };
371
- * ```
372
- *
373
- * ## Return Values
374
- * The following properties are returned from the hook:
375
- *
376
- * <PropertyReference name="visibleMessages" type="DeprecatedGqlMessage[]" deprecated>
377
- * Array of messages in old non-AG-UI format, use for compatibility only
378
- * </PropertyReference>
379
- *
380
- * <PropertyReference name="appendMessage" type="(message: DeprecatedGqlMessage, options?) => Promise<void>" deprecated>
381
- * Append message using old format, use `sendMessage` instead
382
- * </PropertyReference>
383
- *
384
- * <PropertyReference name="reloadMessages" type="(messageId: string) => Promise<void>">
385
- * Regenerate the response for a specific message by ID
386
- * </PropertyReference>
387
- *
388
- * <PropertyReference name="stopGeneration" type="() => void">
389
- * Stop the current message generation process
390
- * </PropertyReference>
391
- *
392
- * <PropertyReference name="reset" type="() => void">
393
- * Clear all messages and reset chat state completely
394
- * </PropertyReference>
395
- *
396
- * <PropertyReference name="isLoading" type="boolean">
397
- * Whether the chat is currently generating a response
398
- * </PropertyReference>
399
- *
400
- * <PropertyReference name="runChatCompletion" type="() => Promise<Message[]>">
401
- * Manually trigger chat completion for advanced usage
402
- * </PropertyReference>
403
- *
404
- * <PropertyReference name="mcpServers" type="MCPServerConfig[]">
405
- * Array of Model Context Protocol server configurations
406
- * </PropertyReference>
407
- *
408
- * <PropertyReference name="setMcpServers" type="(servers: MCPServerConfig[]) => void">
409
- * Update MCP server configurations for enhanced context
410
- * </PropertyReference>
411
- */
412
- /**
413
339
  * A lightweight React hook for headless chat interactions.
414
340
  * Perfect for programmatic messaging, background operations, and custom UI implementations.
415
341
  *
@@ -1026,7 +952,7 @@ function useCopilotAction(action, dependencies) {
1026
952
  * useful for showing intermediate state or progress during Agentic Copilot operations.
1027
953
  * To get started using rendering intermediate state through this hook, checkout the documentation.
1028
954
  *
1029
- * https://docs.copilotkit.ai/coagents/shared-state/predictive-state-updates
955
+ * https://docs.copilotkit.ai/langgraph-python/shared-state/predictive-state-updates
1030
956
  */
1031
957
  function useCoAgentStateRender(action, dependencies) {
1032
958
  const { chatComponentsCache, availableAgents } = useContext(CopilotContext);
@@ -1335,7 +1261,7 @@ function useAgentNodeName(agentName) {
1335
1261
  * This hook is used to integrate an agent into your application. With its use, you can
1336
1262
  * render and update the state of the agent, allowing for a dynamic and interactive experience.
1337
1263
  * We call these shared state experiences "agentic copilots". To get started using agentic copilots, which
1338
- * we refer to as CoAgents, checkout the documentation at https://docs.copilotkit.ai/coagents/quickstart/langgraph.
1264
+ * we refer to as CoAgents, checkout the documentation at https://docs.copilotkit.ai/langgraph-python/quickstart.
1339
1265
  */
1340
1266
  function useCoAgent(options) {
1341
1267
  const { agent } = useAgent({ agentId: options.name });