@copilotkit/react-core 1.55.3-canary.1776260990 → 1.56.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.
- package/dist/{copilotkit-a2pL_KeT.mjs → copilotkit-BebqQrYT.mjs} +8 -6
- package/dist/copilotkit-BebqQrYT.mjs.map +1 -0
- package/dist/{copilotkit-9l47K1Ot.cjs → copilotkit-Cvb6WpAX.cjs} +8 -6
- package/dist/copilotkit-Cvb6WpAX.cjs.map +1 -0
- package/dist/{copilotkit-9_JxoZgF.d.cts → copilotkit-Dv8zU8_U.d.cts} +21 -9
- package/dist/{copilotkit-Dcf7Lkjb.d.mts.map → copilotkit-Dv8zU8_U.d.cts.map} +1 -1
- package/dist/{copilotkit-Dcf7Lkjb.d.mts → copilotkit-f2Uq0RwG.d.mts} +21 -9
- package/dist/{copilotkit-9_JxoZgF.d.cts.map → copilotkit-f2Uq0RwG.d.mts.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 +7 -6
- 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 +7 -6
- package/dist/v2/index.umd.js.map +1 -1
- package/package.json +6 -6
- package/src/components/copilot-provider/copilotkit-props.tsx +17 -1
- package/src/v2/hooks/use-interrupt.tsx +1 -10
- package/src/v2/providers/CopilotKitProvider.tsx +9 -0
- package/dist/copilotkit-9l47K1Ot.cjs.map +0 -1
- package/dist/copilotkit-a2pL_KeT.mjs.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@copilotkit/react-core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.56.0",
|
|
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.
|
|
77
|
-
"@copilotkit/core": "1.
|
|
78
|
-
"@copilotkit/
|
|
79
|
-
"@copilotkit/
|
|
80
|
-
"@copilotkit/shared": "1.
|
|
76
|
+
"@copilotkit/a2ui-renderer": "1.56.0",
|
|
77
|
+
"@copilotkit/core": "1.56.0",
|
|
78
|
+
"@copilotkit/runtime-client-gql": "1.56.0",
|
|
79
|
+
"@copilotkit/web-inspector": "1.56.0",
|
|
80
|
+
"@copilotkit/shared": "1.56.0"
|
|
81
81
|
},
|
|
82
82
|
"devDependencies": {
|
|
83
83
|
"@tailwindcss/cli": "^4.1.11",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ForwardedParametersInput } from "@copilotkit/runtime-client-gql";
|
|
2
2
|
import { ReactNode } from "react";
|
|
3
3
|
import { AuthState } from "../../context/copilot-context";
|
|
4
|
-
import { CopilotErrorHandler } from "@copilotkit/shared";
|
|
4
|
+
import { CopilotErrorHandler, DebugConfig } from "@copilotkit/shared";
|
|
5
5
|
import { CopilotKitProviderProps } from "../../v2";
|
|
6
6
|
/**
|
|
7
7
|
* Props for CopilotKit.
|
|
@@ -195,4 +195,20 @@ export interface CopilotKitProps extends Omit<
|
|
|
195
195
|
* to enabled.
|
|
196
196
|
*/
|
|
197
197
|
enableInspector?: boolean;
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* Enable debug logging. On the server (`CopilotRuntime`), this enables
|
|
201
|
+
* structured Pino logging of the AG-UI event pipeline. On the client,
|
|
202
|
+
* this configuration is forwarded to the AG-UI transport layer
|
|
203
|
+
* (`transformChunks`) for transport-level debug output.
|
|
204
|
+
*
|
|
205
|
+
* Pass `true` for full output, or an object for granular control:
|
|
206
|
+
*
|
|
207
|
+
* ```tsx
|
|
208
|
+
* <CopilotKit debug={true} runtimeUrl="...">
|
|
209
|
+
* {children}
|
|
210
|
+
* </CopilotKit>
|
|
211
|
+
* ```
|
|
212
|
+
*/
|
|
213
|
+
debug?: DebugConfig;
|
|
198
214
|
}
|
|
@@ -7,7 +7,6 @@ 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";
|
|
11
10
|
import type {
|
|
12
11
|
InterruptEvent,
|
|
13
12
|
InterruptRenderProps,
|
|
@@ -80,13 +79,6 @@ interface UseInterruptConfigBase<TValue = unknown, TResult = never> {
|
|
|
80
79
|
enabled?: (event: InterruptEvent<TValue>) => boolean;
|
|
81
80
|
/** Optional agent id. Defaults to the current configured chat agent. */
|
|
82
81
|
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;
|
|
90
82
|
}
|
|
91
83
|
|
|
92
84
|
export interface UseInterruptInChatConfig<
|
|
@@ -191,8 +183,7 @@ export function useInterrupt<
|
|
|
191
183
|
): UseInterruptReturn<TRenderInChat> {
|
|
192
184
|
/* eslint-enable @typescript-eslint/no-explicit-any */
|
|
193
185
|
const { copilotkit } = useCopilotKit();
|
|
194
|
-
const { agent
|
|
195
|
-
const agent = config.agent ?? internalAgent;
|
|
186
|
+
const { agent } = useAgent({ agentId: config.agentId });
|
|
196
187
|
const [pendingEvent, setPendingEvent] = useState<InterruptEvent | null>(null);
|
|
197
188
|
const pendingEventRef = useRef(pendingEvent);
|
|
198
189
|
pendingEventRef.current = pendingEvent;
|
|
@@ -21,6 +21,7 @@ import { LicenseWarningBanner } from "../components/license-warning-banner";
|
|
|
21
21
|
import {
|
|
22
22
|
createLicenseContextValue,
|
|
23
23
|
type LicenseContextValue,
|
|
24
|
+
type DebugConfig,
|
|
24
25
|
} from "@copilotkit/shared";
|
|
25
26
|
import type { CopilotKitCoreErrorCode } from "@copilotkit/core";
|
|
26
27
|
import {
|
|
@@ -234,6 +235,10 @@ export interface CopilotKitProviderProps {
|
|
|
234
235
|
* Defaults to `{ horizontal: "right", vertical: "top" }`.
|
|
235
236
|
*/
|
|
236
237
|
inspectorDefaultAnchor?: Anchor;
|
|
238
|
+
/**
|
|
239
|
+
* Enable debug logging for the client-side event pipeline.
|
|
240
|
+
*/
|
|
241
|
+
debug?: DebugConfig;
|
|
237
242
|
}
|
|
238
243
|
|
|
239
244
|
// Small helper to normalize array props to a stable reference and warn
|
|
@@ -283,6 +288,7 @@ export const CopilotKitProvider: React.FC<CopilotKitProviderProps> = ({
|
|
|
283
288
|
a2ui,
|
|
284
289
|
defaultThrottleMs,
|
|
285
290
|
inspectorDefaultAnchor,
|
|
291
|
+
debug,
|
|
286
292
|
}) => {
|
|
287
293
|
const [shouldRenderInspector, setShouldRenderInspector] = useState(false);
|
|
288
294
|
const [runtimeA2UIEnabled, setRuntimeA2UIEnabled] = useState(false);
|
|
@@ -554,6 +560,7 @@ export const CopilotKitProvider: React.FC<CopilotKitProviderProps> = ({
|
|
|
554
560
|
renderToolCalls: allRenderToolCalls,
|
|
555
561
|
renderActivityMessages: allActivityRenderers,
|
|
556
562
|
renderCustomMessages: renderCustomMessagesList,
|
|
563
|
+
debug,
|
|
557
564
|
});
|
|
558
565
|
// Set initial defaultThrottleMs synchronously so child hooks see the
|
|
559
566
|
// correct value on their first render (before useEffect fires).
|
|
@@ -665,6 +672,7 @@ export const CopilotKitProvider: React.FC<CopilotKitProviderProps> = ({
|
|
|
665
672
|
copilotkit.setCredentials(credentials);
|
|
666
673
|
copilotkit.setProperties(properties);
|
|
667
674
|
copilotkit.setAgents__unsafe_dev_only(mergedAgents);
|
|
675
|
+
copilotkit.setDebug(debug);
|
|
668
676
|
}, [
|
|
669
677
|
copilotkit,
|
|
670
678
|
chatApiEndpoint,
|
|
@@ -673,6 +681,7 @@ export const CopilotKitProvider: React.FC<CopilotKitProviderProps> = ({
|
|
|
673
681
|
properties,
|
|
674
682
|
mergedAgents,
|
|
675
683
|
useSingleEndpoint,
|
|
684
|
+
debug,
|
|
676
685
|
]);
|
|
677
686
|
|
|
678
687
|
// Sync render/tool arrays to the stable instance via setters.
|