@copilotkit/react-core 1.55.3-canary.1776243725 → 1.55.3-canary.1776260990
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/{copilotkit-EfopO2gn.d.cts → copilotkit-9_JxoZgF.d.cts} +8 -1
- package/dist/{copilotkit-EfopO2gn.d.cts.map → copilotkit-9_JxoZgF.d.cts.map} +1 -1
- package/dist/{copilotkit-BoOnQHlE.cjs → copilotkit-9l47K1Ot.cjs} +3 -2
- package/dist/{copilotkit-BoOnQHlE.cjs.map → copilotkit-9l47K1Ot.cjs.map} +1 -1
- package/dist/{copilotkit-opur-20s.d.mts → copilotkit-Dcf7Lkjb.d.mts} +8 -1
- package/dist/{copilotkit-opur-20s.d.mts.map → copilotkit-Dcf7Lkjb.d.mts.map} +1 -1
- package/dist/{copilotkit-Bm4ox8G0.mjs → copilotkit-a2pL_KeT.mjs} +3 -2
- package/dist/{copilotkit-Bm4ox8G0.mjs.map → copilotkit-a2pL_KeT.mjs.map} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.umd.js +3 -1
- package/dist/index.umd.js.map +1 -1
- package/dist/v2/index.cjs +1 -1
- package/dist/v2/index.d.cts +1 -1
- package/dist/v2/index.d.mts +1 -1
- package/dist/v2/index.mjs +1 -1
- package/dist/v2/index.umd.js +3 -1
- package/dist/v2/index.umd.js.map +1 -1
- package/package.json +6 -6
- package/src/v2/hooks/use-interrupt.tsx +10 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@copilotkit/react-core",
|
|
3
|
-
"version": "1.55.3-canary.
|
|
3
|
+
"version": "1.55.3-canary.1776260990",
|
|
4
4
|
"private": false,
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai",
|
|
@@ -73,11 +73,11 @@
|
|
|
73
73
|
"untruncate-json": "^0.0.1",
|
|
74
74
|
"use-stick-to-bottom": "^1.1.1",
|
|
75
75
|
"zod-to-json-schema": "^3.24.5",
|
|
76
|
-
"@copilotkit/a2ui-renderer": "1.55.3-canary.
|
|
77
|
-
"@copilotkit/core": "1.55.3-canary.
|
|
78
|
-
"@copilotkit/
|
|
79
|
-
"@copilotkit/runtime-client-gql": "1.55.3-canary.
|
|
80
|
-
"@copilotkit/
|
|
76
|
+
"@copilotkit/a2ui-renderer": "1.55.3-canary.1776260990",
|
|
77
|
+
"@copilotkit/core": "1.55.3-canary.1776260990",
|
|
78
|
+
"@copilotkit/web-inspector": "1.55.3-canary.1776260990",
|
|
79
|
+
"@copilotkit/runtime-client-gql": "1.55.3-canary.1776260990",
|
|
80
|
+
"@copilotkit/shared": "1.55.3-canary.1776260990"
|
|
81
81
|
},
|
|
82
82
|
"devDependencies": {
|
|
83
83
|
"@tailwindcss/cli": "^4.1.11",
|
|
@@ -7,6 +7,7 @@ import React, {
|
|
|
7
7
|
} from "react";
|
|
8
8
|
import { useCopilotKit } from "../providers/CopilotKitProvider";
|
|
9
9
|
import { useAgent } from "./use-agent";
|
|
10
|
+
import type { AbstractAgent } from "@ag-ui/client";
|
|
10
11
|
import type {
|
|
11
12
|
InterruptEvent,
|
|
12
13
|
InterruptRenderProps,
|
|
@@ -79,6 +80,13 @@ interface UseInterruptConfigBase<TValue = unknown, TResult = never> {
|
|
|
79
80
|
enabled?: (event: InterruptEvent<TValue>) => boolean;
|
|
80
81
|
/** Optional agent id. Defaults to the current configured chat agent. */
|
|
81
82
|
agentId?: string;
|
|
83
|
+
/**
|
|
84
|
+
* Optional agent instance to subscribe to. When provided, the hook uses
|
|
85
|
+
* this instance directly instead of creating one internally via `useAgent`.
|
|
86
|
+
* This is useful in multiplexer setups where the consumer already holds
|
|
87
|
+
* the agent instance that `runAgent` will execute on.
|
|
88
|
+
*/
|
|
89
|
+
agent?: AbstractAgent;
|
|
82
90
|
}
|
|
83
91
|
|
|
84
92
|
export interface UseInterruptInChatConfig<
|
|
@@ -183,7 +191,8 @@ export function useInterrupt<
|
|
|
183
191
|
): UseInterruptReturn<TRenderInChat> {
|
|
184
192
|
/* eslint-enable @typescript-eslint/no-explicit-any */
|
|
185
193
|
const { copilotkit } = useCopilotKit();
|
|
186
|
-
const { agent } = useAgent({ agentId: config.agentId });
|
|
194
|
+
const { agent: internalAgent } = useAgent({ agentId: config.agentId });
|
|
195
|
+
const agent = config.agent ?? internalAgent;
|
|
187
196
|
const [pendingEvent, setPendingEvent] = useState<InterruptEvent | null>(null);
|
|
188
197
|
const pendingEventRef = useRef(pendingEvent);
|
|
189
198
|
pendingEventRef.current = pendingEvent;
|