@copilotkit/react-core 1.50.0-beta.6 → 1.50.0-beta.8

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.
Files changed (33) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/{chunk-PQPWQ6GH.mjs → chunk-BLDHD6Q2.mjs} +2 -2
  3. package/dist/{chunk-ZCV3A2FP.mjs → chunk-EKDPRKZT.mjs} +7 -9
  4. package/dist/chunk-EKDPRKZT.mjs.map +1 -0
  5. package/dist/{chunk-OX2QTNTD.mjs → chunk-KYY2WZSR.mjs} +2 -2
  6. package/dist/chunk-RQ6LWR6S.mjs +37 -0
  7. package/dist/chunk-RQ6LWR6S.mjs.map +1 -0
  8. package/dist/hooks/index.js +64 -43
  9. package/dist/hooks/index.js.map +1 -1
  10. package/dist/hooks/index.mjs +4 -4
  11. package/dist/hooks/use-copilot-chat-headless_c.js +6 -8
  12. package/dist/hooks/use-copilot-chat-headless_c.js.map +1 -1
  13. package/dist/hooks/use-copilot-chat-headless_c.mjs +2 -2
  14. package/dist/hooks/use-copilot-chat.js +6 -8
  15. package/dist/hooks/use-copilot-chat.js.map +1 -1
  16. package/dist/hooks/use-copilot-chat.mjs +2 -2
  17. package/dist/hooks/use-copilot-chat_internal.js +6 -8
  18. package/dist/hooks/use-copilot-chat_internal.js.map +1 -1
  19. package/dist/hooks/use-copilot-chat_internal.mjs +1 -1
  20. package/dist/hooks/use-copilot-readable.d.ts +4 -3
  21. package/dist/hooks/use-copilot-readable.js +29 -6
  22. package/dist/hooks/use-copilot-readable.js.map +1 -1
  23. package/dist/hooks/use-copilot-readable.mjs +1 -1
  24. package/dist/index.js +64 -43
  25. package/dist/index.js.map +1 -1
  26. package/dist/index.mjs +4 -4
  27. package/package.json +7 -7
  28. package/src/hooks/use-copilot-readable.ts +34 -15
  29. package/dist/chunk-2CYJN455.mjs +0 -14
  30. package/dist/chunk-2CYJN455.mjs.map +0 -1
  31. package/dist/chunk-ZCV3A2FP.mjs.map +0 -1
  32. /package/dist/{chunk-PQPWQ6GH.mjs.map → chunk-BLDHD6Q2.mjs.map} +0 -0
  33. /package/dist/{chunk-OX2QTNTD.mjs.map → chunk-KYY2WZSR.mjs.map} +0 -0
package/dist/index.mjs CHANGED
@@ -37,13 +37,13 @@ import {
37
37
  } from "./chunk-7DTB7S5V.mjs";
38
38
  import {
39
39
  useCopilotChatHeadless_c
40
- } from "./chunk-OX2QTNTD.mjs";
40
+ } from "./chunk-KYY2WZSR.mjs";
41
41
  import {
42
42
  useCopilotChat
43
- } from "./chunk-PQPWQ6GH.mjs";
43
+ } from "./chunk-BLDHD6Q2.mjs";
44
44
  import {
45
45
  useCopilotChatInternal
46
- } from "./chunk-ZCV3A2FP.mjs";
46
+ } from "./chunk-EKDPRKZT.mjs";
47
47
  import {
48
48
  useLangGraphInterruptRender
49
49
  } from "./chunk-VV56AVPB.mjs";
@@ -52,7 +52,7 @@ import {
52
52
  } from "./chunk-ZVF5Q6IH.mjs";
53
53
  import {
54
54
  useCopilotReadable
55
- } from "./chunk-2CYJN455.mjs";
55
+ } from "./chunk-RQ6LWR6S.mjs";
56
56
  import {
57
57
  useCopilotRuntimeClient
58
58
  } from "./chunk-6ESSSQ7Q.mjs";
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "publishConfig": {
10
10
  "access": "public"
11
11
  },
12
- "version": "1.50.0-beta.6",
12
+ "version": "1.50.0-beta.8",
13
13
  "sideEffects": [
14
14
  "**/*.css"
15
15
  ],
@@ -52,17 +52,17 @@
52
52
  "tsup": "^6.7.0",
53
53
  "typescript": "^5.2.3",
54
54
  "zod": ">=3.0.0",
55
- "eslint-config-custom": "1.4.6",
56
- "tsconfig": "1.4.6"
55
+ "tsconfig": "1.4.6",
56
+ "eslint-config-custom": "1.4.6"
57
57
  },
58
58
  "dependencies": {
59
- "@copilotkitnext/core": "0.0.25",
60
- "@copilotkitnext/react": "0.0.25",
59
+ "@copilotkitnext/core": "0.0.28",
60
+ "@copilotkitnext/react": "0.0.28",
61
61
  "@scarf/scarf": "^1.3.0",
62
62
  "react-markdown": "^8.0.7",
63
63
  "untruncate-json": "^0.0.1",
64
- "@copilotkit/runtime-client-gql": "1.50.0-beta.6",
65
- "@copilotkit/shared": "1.50.0-beta.6"
64
+ "@copilotkit/runtime-client-gql": "1.50.0-beta.8",
65
+ "@copilotkit/shared": "1.50.0-beta.8"
66
66
  },
67
67
  "keywords": [
68
68
  "copilotkit",
@@ -61,9 +61,10 @@
61
61
  * }
62
62
  * ```
63
63
  */
64
+ import { useCopilotKit } from "@copilotkitnext/react";
64
65
  import { useEffect, useRef } from "react";
65
- import { useCopilotContext } from "../context/copilot-context";
66
- import { useAgentContext } from "@copilotkitnext/react";
66
+
67
+ type DataType = object | number | string | boolean | null | undefined;
67
68
 
68
69
  /**
69
70
  * Options for the useCopilotReadable hook.
@@ -76,7 +77,7 @@ export interface UseCopilotReadableOptions {
76
77
  /**
77
78
  * The value to be added to the Copilot context. Object values are automatically stringified.
78
79
  */
79
- value: any;
80
+ value: DataType | Record<string, any> | DataType[];
80
81
  /**
81
82
  * The ID of the parent context, if any.
82
83
  */
@@ -96,23 +97,41 @@ export interface UseCopilotReadableOptions {
96
97
  * A custom conversion function to use to serialize the value to a string. If not provided, the value
97
98
  * will be serialized using `JSON.stringify`.
98
99
  */
99
- convert?: (description: string, value: any) => string;
100
- }
101
-
102
- function convertToJSON(description: string, value: any): string {
103
- return `${description}: ${typeof value === "string" ? value : JSON.stringify(value)}`;
100
+ convert?: (value: any) => string;
104
101
  }
105
102
 
106
103
  /**
107
104
  * Adds the given information to the Copilot context to make it readable by Copilot.
108
105
  */
109
106
  export function useCopilotReadable(
110
- { description, value }: UseCopilotReadableOptions,
107
+ { description, value, convert, available }: UseCopilotReadableOptions,
111
108
  dependencies?: any[],
112
- ): undefined {
113
- useAgentContext({
114
- description,
115
- value,
116
- });
117
- return;
109
+ ): string | undefined {
110
+ const { copilotkit } = useCopilotKit();
111
+ const ctxIdRef = useRef<string | undefined>(undefined);
112
+ useEffect(() => {
113
+ if (!copilotkit) return;
114
+
115
+ const found = Object.entries(copilotkit.context).find(([id, ctxItem]) => {
116
+ return JSON.stringify({ description, value }) == JSON.stringify(ctxItem);
117
+ });
118
+ if (found) {
119
+ ctxIdRef.current = found[0];
120
+ if (available === "disabled") copilotkit.removeContext(ctxIdRef.current);
121
+ return;
122
+ }
123
+ if (!found && available === "disabled") return;
124
+
125
+ ctxIdRef.current = copilotkit.addContext({
126
+ description,
127
+ value: (convert ?? JSON.stringify)(value),
128
+ });
129
+
130
+ return () => {
131
+ if (!ctxIdRef.current) return;
132
+ copilotkit.removeContext(ctxIdRef.current);
133
+ };
134
+ }, [description, value, convert]);
135
+
136
+ return ctxIdRef.current;
118
137
  }
@@ -1,14 +0,0 @@
1
- // src/hooks/use-copilot-readable.ts
2
- import { useAgentContext } from "@copilotkitnext/react";
3
- function useCopilotReadable({ description, value }, dependencies) {
4
- useAgentContext({
5
- description,
6
- value
7
- });
8
- return;
9
- }
10
-
11
- export {
12
- useCopilotReadable
13
- };
14
- //# sourceMappingURL=chunk-2CYJN455.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/hooks/use-copilot-readable.ts"],"sourcesContent":["/**\n * `useCopilotReadable` is a React hook that provides app-state and other information\n * to the Copilot. Optionally, the hook can also handle hierarchical state within your\n * application, passing these parent-child relationships to the Copilot.\n *\n * ## Usage\n *\n * ### Simple Usage\n *\n * In its most basic usage, useCopilotReadable accepts a single string argument\n * representing any piece of app state, making it available for the Copilot to use\n * as context when responding to user input.\n *\n * ```tsx\n * import { useCopilotReadable } from \"@copilotkit/react-core\";\n *\n * export function MyComponent() {\n * const [employees, setEmployees] = useState([]);\n *\n * useCopilotReadable({\n * description: \"The list of employees\",\n * value: employees,\n * });\n * }\n * ```\n *\n * ### Nested Components\n *\n * Optionally, you can maintain the hierarchical structure of information by passing\n * `parentId`. This allows you to use `useCopilotReadable` in nested components:\n *\n * ```tsx /employeeContextId/1 {17,23}\n * import { useCopilotReadable } from \"@copilotkit/react-core\";\n *\n * function Employee(props: EmployeeProps) {\n * const { employeeName, workProfile, metadata } = props;\n *\n * // propagate any information to copilot\n * const employeeContextId = useCopilotReadable({\n * description: \"Employee name\",\n * value: employeeName\n * });\n *\n * // Pass a parentID to maintain a hierarchical structure.\n * // Especially useful with child React components, list elements, etc.\n * useCopilotReadable({\n * description: \"Work profile\",\n * value: workProfile.description(),\n * parentId: employeeContextId\n * });\n *\n * useCopilotReadable({\n * description: \"Employee metadata\",\n * value: metadata.description(),\n * parentId: employeeContextId\n * });\n *\n * return (\n * // Render as usual...\n * );\n * }\n * ```\n */\nimport { useEffect, useRef } from \"react\";\nimport { useCopilotContext } from \"../context/copilot-context\";\nimport { useAgentContext } from \"@copilotkitnext/react\";\n\n/**\n * Options for the useCopilotReadable hook.\n */\nexport interface UseCopilotReadableOptions {\n /**\n * The description of the information to be added to the Copilot context.\n */\n description: string;\n /**\n * The value to be added to the Copilot context. Object values are automatically stringified.\n */\n value: any;\n /**\n * The ID of the parent context, if any.\n */\n parentId?: string;\n /**\n * An array of categories to control which context are visible where. Particularly useful\n * with CopilotTextarea (see `useMakeAutosuggestionFunction`)\n */\n categories?: string[];\n\n /**\n * Whether the context is available to the Copilot.\n */\n available?: \"enabled\" | \"disabled\";\n\n /**\n * A custom conversion function to use to serialize the value to a string. If not provided, the value\n * will be serialized using `JSON.stringify`.\n */\n convert?: (description: string, value: any) => string;\n}\n\nfunction convertToJSON(description: string, value: any): string {\n return `${description}: ${typeof value === \"string\" ? value : JSON.stringify(value)}`;\n}\n\n/**\n * Adds the given information to the Copilot context to make it readable by Copilot.\n */\nexport function useCopilotReadable(\n { description, value }: UseCopilotReadableOptions,\n dependencies?: any[],\n): undefined {\n useAgentContext({\n description,\n value,\n });\n return;\n}\n"],"mappings":";AAiEA,SAAS,uBAAuB;AA2CzB,SAAS,mBACd,EAAE,aAAa,MAAM,GACrB,cACW;AACX,kBAAgB;AAAA,IACd;AAAA,IACA;AAAA,EACF,CAAC;AACD;AACF;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/hooks/use-copilot-chat_internal.ts","../../../node_modules/.pnpm/@ag-ui+core@0.0.42-alpha.1/node_modules/@ag-ui/core/src/types.ts","../../../node_modules/.pnpm/@ag-ui+core@0.0.42-alpha.1/node_modules/@ag-ui/core/src/events.ts"],"sourcesContent":["import { useRef, useEffect, useCallback, useMemo, useState, createElement } from \"react\";\nimport { useCopilotContext } from \"../context/copilot-context\";\nimport { SystemMessageFunction } from \"../types\";\nimport { useAsyncCallback } from \"../components/error-boundary/error-utils\";\nimport { Message } from \"@copilotkit/shared\";\nimport { gqlToAGUI, Message as DeprecatedGqlMessage } from \"@copilotkit/runtime-client-gql\";\nimport { useLangGraphInterruptRender } from \"./use-langgraph-interrupt-render\";\nimport {\n useAgent,\n useCopilotChatConfiguration,\n useCopilotKit,\n useRenderCustomMessages,\n useSuggestions,\n} from \"@copilotkitnext/react\";\nimport { Suggestion } from \"@copilotkitnext/core\";\nimport { useLazyToolRenderer } from \"./use-lazy-tool-renderer\";\nimport {\n useConfigureChatSuggestions,\n UseCopilotChatSuggestionsConfiguration,\n} from \"./use-configure-chat-suggestions\";\nimport { AbstractAgent, AGUIConnectNotImplementedError } from \"@ag-ui/client\";\nimport {\n CoAgentStateRenderBridge,\n type CoAgentStateRenderBridgeProps,\n} from \"./use-coagent-state-render-bridge\";\n\n/**\n * The type of suggestions to use in the chat.\n *\n * `auto` - Suggestions are generated automatically.\n * `manual` - Suggestions are controlled programmatically.\n * `SuggestionItem[]` - Static suggestions array.\n */\nexport type ChatSuggestions = \"auto\" | \"manual\" | Omit<Suggestion, \"isLoading\">[];\n\nexport interface AppendMessageOptions {\n /**\n * Whether to run the chat completion after appending the message. Defaults to `true`.\n */\n followUp?: boolean;\n /**\n * Whether to clear the suggestions after appending the message. Defaults to `true`.\n */\n clearSuggestions?: boolean;\n}\n\nexport interface UseCopilotChatOptions {\n /**\n * A unique identifier for the chat. If not provided, a random one will be\n * generated. When provided, the `useChat` hook with the same `id` will\n * have shared states across components.\n */\n id?: string;\n\n /**\n * HTTP headers to be sent with the API request.\n */\n headers?: Record<string, string> | Headers;\n\n /**\n * Initial messages to populate the chat with.\n */\n initialMessages?: Message[];\n\n /**\n * A function to generate the system message. Defaults to `defaultSystemMessage`.\n */\n makeSystemMessage?: SystemMessageFunction;\n\n /**\n * Disables inclusion of CopilotKit’s default system message. When true, no system message is sent (this also suppresses any custom message from <code>makeSystemMessage</code>).\n */\n disableSystemMessage?: boolean;\n\n suggestions?: ChatSuggestions;\n}\n\nexport interface MCPServerConfig {\n endpoint: string;\n apiKey?: string;\n}\n\n// Old suggestion item interface, for returning from useCopilotChatInternal\ninterface SuggestionItem {\n title: string;\n message: string;\n partial?: boolean;\n className?: string;\n}\n\nexport interface UseCopilotChatReturn {\n /**\n * @deprecated use `messages` instead, this is an old non ag-ui version of the messages\n * Array of messages currently visible in the chat interface\n *\n * This is the visible messages, not the raw messages from the runtime client.\n */\n visibleMessages: DeprecatedGqlMessage[];\n\n /**\n * The messages that are currently in the chat in AG-UI format.\n */\n messages: Message[];\n\n /** @deprecated use `sendMessage` in `useCopilotChatHeadless_c` instead. This will be removed in a future major version. */\n appendMessage: (message: DeprecatedGqlMessage, options?: AppendMessageOptions) => Promise<void>;\n\n /**\n * Send a new message to the chat\n *\n * ```tsx\n * await sendMessage({\n * id: \"123\",\n * role: \"user\",\n * content: \"Hello, process this request\",\n * });\n * ```\n */\n sendMessage: (message: Message, options?: AppendMessageOptions) => Promise<void>;\n\n /**\n * Replace all messages in the chat\n *\n * ```tsx\n * setMessages([\n * { id: \"123\", role: \"user\", content: \"Hello, process this request\" },\n * { id: \"456\", role: \"assistant\", content: \"Hello, I'm the assistant\" },\n * ]);\n * ```\n *\n * **Deprecated** non-ag-ui version:\n *\n * ```tsx\n * setMessages([\n * new TextMessage({\n * content: \"Hello, process this request\",\n * role: gqlRole.User,\n * }),\n * new TextMessage({\n * content: \"Hello, I'm the assistant\",\n * role: gqlRole.Assistant,\n * ]);\n * ```\n *\n */\n setMessages: (messages: Message[] | DeprecatedGqlMessage[]) => void;\n\n /**\n * Remove a specific message by ID\n *\n * ```tsx\n * deleteMessage(\"123\");\n * ```\n */\n deleteMessage: (messageId: string) => void;\n\n /**\n * Regenerate the response for a specific message\n *\n * ```tsx\n * reloadMessages(\"123\");\n * ```\n */\n reloadMessages: (messageId: string) => Promise<void>;\n\n /**\n * Stop the current message generation\n *\n * ```tsx\n * if (isLoading) {\n * stopGeneration();\n * }\n * ```\n */\n stopGeneration: () => void;\n\n /**\n * Clear all messages and reset chat state\n *\n * ```tsx\n * reset();\n * console.log(messages); // []\n * ```\n */\n reset: () => void;\n\n /**\n * Whether the chat is currently generating a response\n *\n * ```tsx\n * if (isLoading) {\n * console.log(\"Loading...\");\n * } else {\n * console.log(\"Not loading\");\n * }\n */\n isLoading: boolean;\n\n /**\n * Whether the chat agent is available to generate responses\n *\n * ```tsx\n * if (isAvailable) {\n * console.log(\"Loading...\");\n * } else {\n * console.log(\"Not loading\");\n * }\n */\n isAvailable: boolean;\n\n /** Manually trigger chat completion (advanced usage) */\n runChatCompletion: () => Promise<Message[]>;\n\n /** MCP (Model Context Protocol) server configurations */\n mcpServers: MCPServerConfig[];\n\n /** Update MCP server configurations */\n setMcpServers: (mcpServers: MCPServerConfig[]) => void;\n\n /**\n * Current suggestions array\n * Use this to read the current suggestions or in conjunction with setSuggestions for manual control\n */\n suggestions: Suggestion[];\n\n /**\n * Manually set suggestions\n * Useful for manual mode or custom suggestion workflows\n */\n setSuggestions: (suggestions: Omit<Suggestion, \"isLoading\">[]) => void;\n\n /**\n * Trigger AI-powered suggestion generation\n * Uses configurations from useCopilotChatSuggestions hooks\n * Respects global debouncing - only one generation can run at a time\n *\n * ```tsx\n * generateSuggestions();\n * console.log(suggestions); // [suggestion1, suggestion2, suggestion3]\n * ```\n */\n generateSuggestions: () => Promise<void>;\n\n /**\n * Clear all current suggestions\n * Also resets suggestion generation state\n */\n resetSuggestions: () => void;\n\n /** Whether suggestions are currently being generated */\n isLoadingSuggestions: boolean;\n\n /** Interrupt content for human-in-the-loop workflows */\n interrupt: string | React.ReactElement | null;\n\n agent?: ReturnType<typeof useAgent>[\"agent\"];\n\n threadId?: string;\n}\n\nfunction useConfigureSuggestions(suggestions?: UseCopilotChatOptions[\"suggestions\"]) {\n let suggestionsConfig: UseCopilotChatSuggestionsConfiguration;\n\n if (Array.isArray(suggestions)) {\n suggestionsConfig = {\n suggestions,\n available: \"always\",\n };\n } else if (suggestions === \"auto\") {\n suggestionsConfig = {\n available: suggestions === \"auto\" ? \"always\" : \"disabled\",\n instructions:\n \"Suggest what the user could say next. Provide clear, highly relevant suggestions. Do not literally suggest function calls.\",\n };\n } else {\n suggestionsConfig = { available: \"disabled\" } as UseCopilotChatSuggestionsConfiguration;\n }\n\n useConfigureChatSuggestions(suggestionsConfig);\n}\n\nexport function useCopilotChatInternal({\n suggestions,\n}: UseCopilotChatOptions = {}): UseCopilotChatReturn {\n const { copilotkit } = useCopilotKit();\n const { threadId, agentSession } = useCopilotContext();\n const existingConfig = useCopilotChatConfiguration();\n const [agentAvailable, setAgentAvailable] = useState(false);\n useConfigureSuggestions(suggestions);\n\n // Apply priority: props > existing config > defaults\n const resolvedAgentId = existingConfig?.agentId ?? \"default\";\n const { agent } = useAgent({ agentId: resolvedAgentId });\n\n useEffect(() => {\n const connect = async (agent: AbstractAgent) => {\n setAgentAvailable(false);\n try {\n await copilotkit.connectAgent({ agent });\n setAgentAvailable(true);\n } catch (error) {\n if (error instanceof AGUIConnectNotImplementedError) {\n // connect not implemented, ignore\n } else {\n throw error;\n }\n }\n };\n if (agent && existingConfig?.threadId && agent.threadId !== existingConfig.threadId) {\n agent.threadId = existingConfig.threadId;\n connect(agent);\n }\n return () => {};\n }, [existingConfig?.threadId, agent, copilotkit, resolvedAgentId]);\n\n const interrupt = useLangGraphInterruptRender(agent);\n\n const reset = () => {\n agent?.setMessages([]);\n agent?.setState(null);\n };\n\n const deleteMessage = useCallback(\n (messageId: string) => {\n const filteredMessages = (agent?.messages ?? []).filter(\n (message) => message.id !== messageId,\n );\n agent?.setMessages(filteredMessages);\n },\n [agent?.setMessages, agent?.messages],\n );\n\n const latestDelete = useUpdatedRef(deleteMessage);\n const latestDeleteFunc = useCallback(\n (messageId: string) => {\n return latestDelete.current(messageId);\n },\n [latestDelete],\n );\n\n const currentSuggestions = useSuggestions({ agentId: resolvedAgentId });\n\n const reload = useAsyncCallback(\n async (reloadMessageId: string): Promise<void> => {\n const messages = agent?.messages ?? [];\n // TODO: get isLoading\n const isLoading = false;\n if (isLoading || messages.length === 0) {\n return;\n }\n\n const reloadMessageIndex = messages.findIndex((msg) => msg.id === reloadMessageId);\n if (reloadMessageIndex === -1) {\n console.warn(`Message with id ${reloadMessageId} not found`);\n return;\n }\n\n const reloadMessageRole = messages[reloadMessageIndex].role;\n if (reloadMessageRole !== \"assistant\") {\n console.warn(`Regenerate cannot be performed on ${reloadMessageRole} role`);\n return;\n }\n let historyCutoff: Message[] = [messages[0]];\n\n if (messages.length > 2 && reloadMessageIndex !== 0) {\n // message to regenerate from is now first.\n // Work backwards to find the first the closest user message\n const lastUserMessageBeforeRegenerate = messages\n .slice(0, reloadMessageIndex)\n .reverse()\n .find((msg) => msg.role === \"user\");\n\n if (!lastUserMessageBeforeRegenerate) {\n historyCutoff = [messages[0]];\n } else {\n const indexOfLastUserMessageBeforeRegenerate = messages.findIndex(\n (msg) => msg.id === lastUserMessageBeforeRegenerate.id,\n );\n // Include the user message, remove everything after it\n historyCutoff = messages.slice(0, indexOfLastUserMessageBeforeRegenerate + 1);\n }\n } else if (messages.length > 2 && reloadMessageIndex === 0) {\n historyCutoff = [messages[0], messages[1]];\n }\n\n agent?.setMessages(historyCutoff);\n\n if (agent) {\n copilotkit.runAgent({ agent });\n }\n return;\n },\n [agent?.setMessages, copilotkit?.runAgent],\n );\n\n const latestSendMessageFunc = useAsyncCallback(\n async (message: Message, options?: AppendMessageOptions) => {\n if (!agent) return;\n const followUp = options?.followUp ?? true;\n if (options?.clearSuggestions) {\n copilotkit.clearSuggestions(resolvedAgentId);\n }\n agent?.addMessage(message);\n if (followUp) {\n try {\n await copilotkit.runAgent({ agent });\n } catch (error) {\n console.error(\"CopilotChat: runAgent failed\", error);\n }\n }\n },\n [agent, copilotkit, resolvedAgentId],\n );\n\n const latestAppendFunc = useAsyncCallback(\n async (message: DeprecatedGqlMessage, options?: AppendMessageOptions) => {\n return latestSendMessageFunc(gqlToAGUI([message])[0], options);\n },\n [latestSendMessageFunc],\n );\n\n const latestSetMessages = useUpdatedRef(agent?.setMessages);\n const latestSetMessagesFunc = useCallback(\n (messages: Message[] | DeprecatedGqlMessage[]) => {\n if (messages.every((message) => message instanceof DeprecatedGqlMessage)) {\n return latestSetMessages.current?.(gqlToAGUI(messages));\n }\n return latestSetMessages.current?.(messages);\n },\n [latestSetMessages, agent],\n );\n\n const latestReload = useUpdatedRef(reload);\n const latestReloadFunc = useAsyncCallback(\n async (messageId: string) => {\n return await latestReload.current(messageId);\n },\n [latestReload],\n );\n\n const latestStop = useUpdatedRef(agent?.abortRun);\n const latestStopFunc = useCallback(() => {\n return latestStop.current?.();\n }, [latestStop]);\n\n const latestReset = useUpdatedRef(reset);\n const latestResetFunc = useCallback(() => {\n return latestReset.current();\n }, [latestReset]);\n\n const lazyToolRendered = useLazyToolRenderer();\n const renderCustomMessage = useRenderCustomMessages();\n const legacyCustomMessageRenderer = useLegacyCoagentRenderer({\n copilotkit,\n agent,\n agentId: resolvedAgentId,\n threadId: existingConfig?.threadId ?? threadId,\n });\n const allMessages = agent?.messages ?? [];\n const resolvedMessages = useMemo(() => {\n let processedMessages = allMessages.map((message) => {\n if (message.role !== \"assistant\") {\n return message;\n }\n\n const lazyRendered = lazyToolRendered(message, allMessages);\n if (lazyRendered) {\n const renderedGenUi = lazyRendered();\n if (renderedGenUi) {\n return { ...message, generativeUI: () => renderedGenUi };\n }\n }\n\n const bridgeRenderer =\n legacyCustomMessageRenderer || renderCustomMessage\n ? () => {\n const customRender = renderCustomMessage?.({\n message,\n position: \"before\",\n });\n if (customRender) {\n return customRender;\n }\n return legacyCustomMessageRenderer?.({ message, position: \"before\" });\n }\n : null;\n\n if (bridgeRenderer) {\n return { ...message, generativeUI: bridgeRenderer };\n }\n return message;\n });\n\n const hasAssistantMessages = processedMessages.some((msg) => msg.role === \"assistant\");\n\n // TODO: what is this?\n // if (legacyCustomMessageRenderer && !hasAssistantMessages) {\n // const placeholderId = `coagent-state-render-${resolvedAgentId}`;\n // const placeholderMessage: Message = {\n // id: placeholderId,\n // role: \"assistant\",\n // content: \"\",\n // name: \"coagent-state-render\",\n // };\n // processedMessages = [\n // ...processedMessages,\n // {\n // ...placeholderMessage,\n // generativeUI: () =>\n // legacyCustomMessageRenderer({\n // message: placeholderMessage,\n // position: \"before\",\n // }),\n // } as Message,\n // ];\n // }\n\n return processedMessages;\n }, [\n agent?.messages,\n lazyToolRendered,\n allMessages,\n renderCustomMessage,\n // legacyCustomMessageRenderer,\n resolvedAgentId,\n ]);\n\n // @ts-ignore\n return {\n messages: resolvedMessages,\n sendMessage: latestSendMessageFunc,\n appendMessage: latestAppendFunc,\n setMessages: latestSetMessagesFunc,\n reloadMessages: latestReloadFunc,\n stopGeneration: latestStopFunc,\n reset: latestResetFunc,\n deleteMessage: latestDeleteFunc,\n isAvailable: agentAvailable,\n isLoading: Boolean(agent?.isRunning),\n // mcpServers,\n // setMcpServers,\n suggestions: currentSuggestions.suggestions,\n setSuggestions: (suggestions: Omit<Suggestion, \"isLoading\">[]) =>\n copilotkit.addSuggestionsConfig({ suggestions }),\n generateSuggestions: async () => copilotkit.reloadSuggestions(resolvedAgentId),\n resetSuggestions: () => copilotkit.clearSuggestions(resolvedAgentId),\n isLoadingSuggestions: currentSuggestions.isLoading,\n interrupt,\n agent,\n threadId,\n };\n}\n\n// store `value` in a ref and update\n// it whenever it changes.\nfunction useUpdatedRef<T>(value: T) {\n const ref = useRef(value);\n\n useEffect(() => {\n ref.current = value;\n }, [value]);\n\n return ref;\n}\n\ntype LegacyRenderParams = {\n message: Message;\n position: \"before\" | \"after\";\n};\n\ntype LegacyRenderer = ((args: LegacyRenderParams) => any) | null;\n\nfunction useLegacyCoagentRenderer({\n copilotkit,\n agent,\n agentId,\n threadId,\n}: {\n copilotkit: ReturnType<typeof useCopilotKit>[\"copilotkit\"];\n agent?: AbstractAgent;\n agentId: string;\n threadId?: string;\n}): LegacyRenderer {\n return useMemo(() => {\n if (!copilotkit || !agent) {\n return null;\n }\n\n return ({ message, position }: LegacyRenderParams) => {\n const effectiveThreadId = threadId ?? agent.threadId ?? \"default\";\n const existingRunId = copilotkit.getRunIdForMessage(agentId, effectiveThreadId, message.id);\n const runId = existingRunId || `pending:${message.id}`;\n const messageIndex = Math.max(\n agent.messages.findIndex((msg) => msg.id === message.id),\n 0,\n );\n\n const bridgeProps: CoAgentStateRenderBridgeProps = {\n message: message as any,\n position,\n runId,\n messageIndex,\n messageIndexInRun: 0,\n numberOfMessagesInRun: 1,\n agentId,\n stateSnapshot: (message as any).state,\n };\n\n return createElement(CoAgentStateRenderBridge, bridgeProps) as any;\n };\n }, [agent, agentId, copilotkit, threadId]);\n}\n\nexport function defaultSystemMessage(\n contextString: string,\n additionalInstructions?: string,\n): string {\n return (\n `\nPlease act as an efficient, competent, conscientious, and industrious professional assistant.\n\nHelp the user achieve their goals, and you do so in a way that is as efficient as possible, without unnecessary fluff, but also without sacrificing professionalism.\nAlways be polite and respectful, and prefer brevity over verbosity.\n\nThe user has provided you with the following context:\n\\`\\`\\`\n${contextString}\n\\`\\`\\`\n\nThey have also provided you with functions you can call to initiate actions on their behalf, or functions you can call to receive more information.\n\nPlease assist them as best you can.\n\nYou can ask them for clarifying questions if needed, but don't be annoying about it. If you can reasonably 'fill in the blanks' yourself, do so.\n\nIf you would like to call a function, call it without saying anything else.\nIn case of a function error:\n- If this error stems from incorrect function parameters or syntax, you may retry with corrected arguments.\n- If the error's source is unclear or seems unrelated to your input, do not attempt further retries.\n` + (additionalInstructions ? `\\n\\n${additionalInstructions}` : \"\")\n );\n}\n","import { z } from \"zod\";\n\nexport const FunctionCallSchema = z.object({\n name: z.string(),\n arguments: z.string(),\n});\n\nexport const ToolCallSchema = z.object({\n id: z.string(),\n type: z.literal(\"function\"),\n function: FunctionCallSchema,\n});\n\nexport const BaseMessageSchema = z.object({\n id: z.string(),\n role: z.string(),\n content: z.string().optional(),\n name: z.string().optional(),\n});\n\nexport const TextInputContentSchema = z.object({\n type: z.literal(\"text\"),\n text: z.string(),\n});\n\nconst BinaryInputContentObjectSchema = z.object({\n type: z.literal(\"binary\"),\n mimeType: z.string(),\n id: z.string().optional(),\n url: z.string().optional(),\n data: z.string().optional(),\n filename: z.string().optional(),\n});\n\nconst ensureBinaryPayload = (\n value: { id?: string; url?: string; data?: string },\n ctx: z.RefinementCtx,\n) => {\n if (!value.id && !value.url && !value.data) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: \"BinaryInputContent requires at least one of id, url, or data.\",\n path: [\"id\"],\n });\n }\n};\n\nexport const BinaryInputContentSchema = BinaryInputContentObjectSchema.superRefine((value, ctx) => {\n ensureBinaryPayload(value, ctx);\n});\n\nconst InputContentBaseSchema = z.discriminatedUnion(\"type\", [\n TextInputContentSchema,\n BinaryInputContentObjectSchema,\n]);\n\nexport const InputContentSchema = InputContentBaseSchema.superRefine((value, ctx) => {\n if (value.type === \"binary\") {\n ensureBinaryPayload(value, ctx);\n }\n});\n\nexport const DeveloperMessageSchema = BaseMessageSchema.extend({\n role: z.literal(\"developer\"),\n content: z.string(),\n});\n\nexport const SystemMessageSchema = BaseMessageSchema.extend({\n role: z.literal(\"system\"),\n content: z.string(),\n});\n\nexport const AssistantMessageSchema = BaseMessageSchema.extend({\n role: z.literal(\"assistant\"),\n content: z.string().optional(),\n toolCalls: z.array(ToolCallSchema).optional(),\n});\n\nexport const UserMessageSchema = BaseMessageSchema.extend({\n role: z.literal(\"user\"),\n content: z.union([z.string(), z.array(InputContentSchema)]),\n});\n\nexport const ToolMessageSchema = z.object({\n id: z.string(),\n content: z.string(),\n role: z.literal(\"tool\"),\n toolCallId: z.string(),\n error: z.string().optional(),\n});\n\nexport const ActivityMessageSchema = z.object({\n id: z.string(),\n role: z.literal(\"activity\"),\n activityType: z.string(),\n content: z.record(z.any()),\n});\n\nexport const MessageSchema = z.discriminatedUnion(\"role\", [\n DeveloperMessageSchema,\n SystemMessageSchema,\n AssistantMessageSchema,\n UserMessageSchema,\n ToolMessageSchema,\n ActivityMessageSchema,\n]);\n\nexport const RoleSchema = z.union([\n z.literal(\"developer\"),\n z.literal(\"system\"),\n z.literal(\"assistant\"),\n z.literal(\"user\"),\n z.literal(\"tool\"),\n z.literal(\"activity\"),\n]);\n\nexport const ContextSchema = z.object({\n description: z.string(),\n value: z.string(),\n});\n\nexport const ToolSchema = z.object({\n name: z.string(),\n description: z.string(),\n parameters: z.any(), // JSON Schema for the tool parameters\n});\n\nexport const RunAgentInputSchema = z.object({\n threadId: z.string(),\n runId: z.string(),\n parentRunId: z.string().optional(),\n state: z.any(),\n messages: z.array(MessageSchema),\n tools: z.array(ToolSchema),\n context: z.array(ContextSchema),\n forwardedProps: z.any(),\n});\n\nexport const StateSchema = z.any();\n\nexport type ToolCall = z.infer<typeof ToolCallSchema>;\nexport type FunctionCall = z.infer<typeof FunctionCallSchema>;\nexport type TextInputContent = z.infer<typeof TextInputContentSchema>;\nexport type BinaryInputContent = z.infer<typeof BinaryInputContentSchema>;\nexport type InputContent = z.infer<typeof InputContentSchema>;\nexport type DeveloperMessage = z.infer<typeof DeveloperMessageSchema>;\nexport type SystemMessage = z.infer<typeof SystemMessageSchema>;\nexport type AssistantMessage = z.infer<typeof AssistantMessageSchema>;\nexport type UserMessage = z.infer<typeof UserMessageSchema>;\nexport type ToolMessage = z.infer<typeof ToolMessageSchema>;\nexport type ActivityMessage = z.infer<typeof ActivityMessageSchema>;\nexport type Message = z.infer<typeof MessageSchema>;\nexport type Context = z.infer<typeof ContextSchema>;\nexport type Tool = z.infer<typeof ToolSchema>;\nexport type RunAgentInput = z.infer<typeof RunAgentInputSchema>;\nexport type State = z.infer<typeof StateSchema>;\nexport type Role = z.infer<typeof RoleSchema>;\n\nexport class AGUIError extends Error {\n constructor(message: string) {\n super(message);\n }\n}\n\nexport class AGUIConnectNotImplementedError extends AGUIError {\n constructor() {\n super(\"Connect not implemented. This method is not supported by the current agent.\");\n }\n}\n","import { z } from \"zod\";\nimport { MessageSchema, StateSchema, RunAgentInputSchema } from \"./types\";\n\n// Text messages can have any role except \"tool\"\nconst TextMessageRoleSchema = z.union([\n z.literal(\"developer\"),\n z.literal(\"system\"),\n z.literal(\"assistant\"),\n z.literal(\"user\"),\n]);\n\nexport enum EventType {\n TEXT_MESSAGE_START = \"TEXT_MESSAGE_START\",\n TEXT_MESSAGE_CONTENT = \"TEXT_MESSAGE_CONTENT\",\n TEXT_MESSAGE_END = \"TEXT_MESSAGE_END\",\n TEXT_MESSAGE_CHUNK = \"TEXT_MESSAGE_CHUNK\",\n THINKING_TEXT_MESSAGE_START = \"THINKING_TEXT_MESSAGE_START\",\n THINKING_TEXT_MESSAGE_CONTENT = \"THINKING_TEXT_MESSAGE_CONTENT\",\n THINKING_TEXT_MESSAGE_END = \"THINKING_TEXT_MESSAGE_END\",\n TOOL_CALL_START = \"TOOL_CALL_START\",\n TOOL_CALL_ARGS = \"TOOL_CALL_ARGS\",\n TOOL_CALL_END = \"TOOL_CALL_END\",\n TOOL_CALL_CHUNK = \"TOOL_CALL_CHUNK\",\n TOOL_CALL_RESULT = \"TOOL_CALL_RESULT\",\n THINKING_START = \"THINKING_START\",\n THINKING_END = \"THINKING_END\",\n STATE_SNAPSHOT = \"STATE_SNAPSHOT\",\n STATE_DELTA = \"STATE_DELTA\",\n MESSAGES_SNAPSHOT = \"MESSAGES_SNAPSHOT\",\n ACTIVITY_SNAPSHOT = \"ACTIVITY_SNAPSHOT\",\n ACTIVITY_DELTA = \"ACTIVITY_DELTA\",\n RAW = \"RAW\",\n CUSTOM = \"CUSTOM\",\n RUN_STARTED = \"RUN_STARTED\",\n RUN_FINISHED = \"RUN_FINISHED\",\n RUN_ERROR = \"RUN_ERROR\",\n STEP_STARTED = \"STEP_STARTED\",\n STEP_FINISHED = \"STEP_FINISHED\",\n}\n\nexport const BaseEventSchema = z.object({\n type: z.nativeEnum(EventType),\n timestamp: z.number().optional(),\n rawEvent: z.any().optional(),\n});\n\nexport const TextMessageStartEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.TEXT_MESSAGE_START),\n messageId: z.string(),\n role: TextMessageRoleSchema.default(\"assistant\"),\n});\n\nexport const TextMessageContentEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.TEXT_MESSAGE_CONTENT),\n messageId: z.string(),\n delta: z.string().refine((s) => s.length > 0, \"Delta must not be an empty string\"),\n});\n\nexport const TextMessageEndEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.TEXT_MESSAGE_END),\n messageId: z.string(),\n});\n\nexport const TextMessageChunkEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.TEXT_MESSAGE_CHUNK),\n messageId: z.string().optional(),\n role: TextMessageRoleSchema.optional(),\n delta: z.string().optional(),\n});\n\nexport const ThinkingTextMessageStartEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.THINKING_TEXT_MESSAGE_START),\n});\n\nexport const ThinkingTextMessageContentEventSchema = TextMessageContentEventSchema.omit({\n messageId: true,\n type: true,\n}).extend({\n type: z.literal(EventType.THINKING_TEXT_MESSAGE_CONTENT),\n});\n\nexport const ThinkingTextMessageEndEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.THINKING_TEXT_MESSAGE_END),\n});\n\nexport const ToolCallStartEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.TOOL_CALL_START),\n toolCallId: z.string(),\n toolCallName: z.string(),\n parentMessageId: z.string().optional(),\n});\n\nexport const ToolCallArgsEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.TOOL_CALL_ARGS),\n toolCallId: z.string(),\n delta: z.string(),\n});\n\nexport const ToolCallEndEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.TOOL_CALL_END),\n toolCallId: z.string(),\n});\n\nexport const ToolCallResultEventSchema = BaseEventSchema.extend({\n messageId: z.string(),\n type: z.literal(EventType.TOOL_CALL_RESULT),\n toolCallId: z.string(),\n content: z.string(),\n role: z.literal(\"tool\").optional(),\n});\n\nexport const ToolCallChunkEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.TOOL_CALL_CHUNK),\n toolCallId: z.string().optional(),\n toolCallName: z.string().optional(),\n parentMessageId: z.string().optional(),\n delta: z.string().optional(),\n});\n\nexport const ThinkingStartEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.THINKING_START),\n title: z.string().optional(),\n});\n\nexport const ThinkingEndEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.THINKING_END),\n});\n\nexport const StateSnapshotEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.STATE_SNAPSHOT),\n snapshot: StateSchema,\n});\n\nexport const StateDeltaEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.STATE_DELTA),\n delta: z.array(z.any()), // JSON Patch (RFC 6902)\n});\n\nexport const MessagesSnapshotEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.MESSAGES_SNAPSHOT),\n messages: z.array(MessageSchema),\n});\n\nexport const ActivitySnapshotEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.ACTIVITY_SNAPSHOT),\n messageId: z.string(),\n activityType: z.string(),\n content: z.record(z.any()),\n replace: z.boolean().optional().default(true),\n});\n\nexport const ActivityDeltaEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.ACTIVITY_DELTA),\n messageId: z.string(),\n activityType: z.string(),\n patch: z.array(z.any()),\n});\n\nexport const RawEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.RAW),\n event: z.any(),\n source: z.string().optional(),\n});\n\nexport const CustomEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.CUSTOM),\n name: z.string(),\n value: z.any(),\n});\n\nexport const RunStartedEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.RUN_STARTED),\n threadId: z.string(),\n runId: z.string(),\n parentRunId: z.string().optional(),\n input: RunAgentInputSchema.optional(),\n});\n\nexport const RunFinishedEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.RUN_FINISHED),\n threadId: z.string(),\n runId: z.string(),\n result: z.any().optional(),\n});\n\nexport const RunErrorEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.RUN_ERROR),\n message: z.string(),\n code: z.string().optional(),\n});\n\nexport const StepStartedEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.STEP_STARTED),\n stepName: z.string(),\n});\n\nexport const StepFinishedEventSchema = BaseEventSchema.extend({\n type: z.literal(EventType.STEP_FINISHED),\n stepName: z.string(),\n});\n\nexport const EventSchemas = z.discriminatedUnion(\"type\", [\n TextMessageStartEventSchema,\n TextMessageContentEventSchema,\n TextMessageEndEventSchema,\n TextMessageChunkEventSchema,\n ThinkingStartEventSchema,\n ThinkingEndEventSchema,\n ThinkingTextMessageStartEventSchema,\n ThinkingTextMessageContentEventSchema,\n ThinkingTextMessageEndEventSchema,\n ToolCallStartEventSchema,\n ToolCallArgsEventSchema,\n ToolCallEndEventSchema,\n ToolCallChunkEventSchema,\n ToolCallResultEventSchema,\n StateSnapshotEventSchema,\n StateDeltaEventSchema,\n MessagesSnapshotEventSchema,\n ActivitySnapshotEventSchema,\n ActivityDeltaEventSchema,\n RawEventSchema,\n CustomEventSchema,\n RunStartedEventSchema,\n RunFinishedEventSchema,\n RunErrorEventSchema,\n StepStartedEventSchema,\n StepFinishedEventSchema,\n]);\n\nexport type BaseEvent = z.infer<typeof BaseEventSchema>;\nexport type TextMessageStartEvent = z.infer<typeof TextMessageStartEventSchema>;\nexport type TextMessageContentEvent = z.infer<typeof TextMessageContentEventSchema>;\nexport type TextMessageEndEvent = z.infer<typeof TextMessageEndEventSchema>;\nexport type TextMessageChunkEvent = z.infer<typeof TextMessageChunkEventSchema>;\nexport type ThinkingTextMessageStartEvent = z.infer<typeof ThinkingTextMessageStartEventSchema>;\nexport type ThinkingTextMessageContentEvent = z.infer<typeof ThinkingTextMessageContentEventSchema>;\nexport type ThinkingTextMessageEndEvent = z.infer<typeof ThinkingTextMessageEndEventSchema>;\nexport type ToolCallStartEvent = z.infer<typeof ToolCallStartEventSchema>;\nexport type ToolCallArgsEvent = z.infer<typeof ToolCallArgsEventSchema>;\nexport type ToolCallEndEvent = z.infer<typeof ToolCallEndEventSchema>;\nexport type ToolCallChunkEvent = z.infer<typeof ToolCallChunkEventSchema>;\nexport type ToolCallResultEvent = z.infer<typeof ToolCallResultEventSchema>;\nexport type ThinkingStartEvent = z.infer<typeof ThinkingStartEventSchema>;\nexport type ThinkingEndEvent = z.infer<typeof ThinkingEndEventSchema>;\nexport type StateSnapshotEvent = z.infer<typeof StateSnapshotEventSchema>;\nexport type StateDeltaEvent = z.infer<typeof StateDeltaEventSchema>;\nexport type MessagesSnapshotEvent = z.infer<typeof MessagesSnapshotEventSchema>;\nexport type ActivitySnapshotEvent = z.infer<typeof ActivitySnapshotEventSchema>;\nexport type ActivityDeltaEvent = z.infer<typeof ActivityDeltaEventSchema>;\nexport type RawEvent = z.infer<typeof RawEventSchema>;\nexport type CustomEvent = z.infer<typeof CustomEventSchema>;\nexport type RunStartedEvent = z.infer<typeof RunStartedEventSchema>;\nexport type RunFinishedEvent = z.infer<typeof RunFinishedEventSchema>;\nexport type RunErrorEvent = z.infer<typeof RunErrorEventSchema>;\nexport type StepStartedEvent = z.infer<typeof StepStartedEventSchema>;\nexport type StepFinishedEvent = z.infer<typeof StepFinishedEventSchema>;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,QAAQ,WAAW,aAAa,SAAS,UAAU,qBAAqB;AAKjF,SAAS,WAAW,WAAW,4BA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