@copilotkit/react-core 2.0.0-rc.6 → 2.0.0-rc.61
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/README.md +1 -1
- package/dist/MarkdownRendererContext-QFCldfW_.d.cts +34 -0
- package/dist/MarkdownRendererContext-QFCldfW_.d.cts.map +1 -0
- package/dist/MarkdownRendererContext-aK63ZFd-.d.mts +34 -0
- package/dist/MarkdownRendererContext-aK63ZFd-.d.mts.map +1 -0
- package/dist/MarkdownSurfaces-Do948N1P.cjs +141 -0
- package/dist/MarkdownSurfaces-Do948N1P.cjs.map +1 -0
- package/dist/MarkdownSurfaces-rtE9wRUP.mjs +135 -0
- package/dist/MarkdownSurfaces-rtE9wRUP.mjs.map +1 -0
- package/dist/ProviderMarkdown-D0eI0aPo.cjs +268 -0
- package/dist/ProviderMarkdown-D0eI0aPo.cjs.map +1 -0
- package/dist/ProviderMarkdown-epL7F3Vt.mjs +214 -0
- package/dist/ProviderMarkdown-epL7F3Vt.mjs.map +1 -0
- package/dist/accessibility-BLK-gE0R.mjs +129 -0
- package/dist/accessibility-BLK-gE0R.mjs.map +1 -0
- package/dist/accessibility-GnodqxkH.cjs +228 -0
- package/dist/accessibility-GnodqxkH.cjs.map +1 -0
- package/dist/chat-B1zczXUD.mjs +1476 -0
- package/dist/chat-B1zczXUD.mjs.map +1 -0
- package/dist/chat-BZ_bvAkg.d.mts +38 -0
- package/dist/chat-BZ_bvAkg.d.mts.map +1 -0
- package/dist/chat-CkFZMo5E.cjs +1579 -0
- package/dist/chat-CkFZMo5E.cjs.map +1 -0
- package/dist/chat-CpZVyF_t.d.cts +38 -0
- package/dist/chat-CpZVyF_t.d.cts.map +1 -0
- package/dist/context.cjs +75 -63
- package/dist/context.cjs.map +1 -1
- package/dist/context.d.cts +62 -107
- package/dist/context.d.cts.map +1 -1
- package/dist/context.d.mts +62 -107
- package/dist/context.d.mts.map +1 -1
- package/dist/context.mjs +76 -64
- package/dist/context.mjs.map +1 -1
- package/dist/generative-ui/map.cjs +26 -0
- package/dist/generative-ui/map.cjs.map +1 -0
- package/dist/generative-ui/map.d.cts +23 -0
- package/dist/generative-ui/map.d.cts.map +1 -0
- package/dist/generative-ui/map.d.mts +23 -0
- package/dist/generative-ui/map.d.mts.map +1 -0
- package/dist/generative-ui/map.mjs +24 -0
- package/dist/generative-ui/map.mjs.map +1 -0
- package/dist/generative-ui/native.cjs +67 -0
- package/dist/generative-ui/native.cjs.map +1 -0
- package/dist/generative-ui/native.d.cts +156 -0
- package/dist/generative-ui/native.d.cts.map +1 -0
- package/dist/generative-ui/native.d.mts +156 -0
- package/dist/generative-ui/native.d.mts.map +1 -0
- package/dist/generative-ui/native.mjs +25 -0
- package/dist/generative-ui/native.mjs.map +1 -0
- package/dist/generative-ui.cjs +33 -8088
- package/dist/generative-ui.cjs.map +1 -1
- package/dist/generative-ui.d.cts +2472 -4789
- package/dist/generative-ui.d.cts.map +1 -1
- package/dist/generative-ui.d.mts +2472 -4789
- package/dist/generative-ui.d.mts.map +1 -1
- package/dist/generative-ui.mjs +9 -8074
- package/dist/generative-ui.mjs.map +1 -1
- package/dist/headless.cjs +289 -1054
- package/dist/headless.cjs.map +1 -1
- package/dist/headless.d.cts +149 -372
- package/dist/headless.d.cts.map +1 -1
- package/dist/headless.d.mts +123 -237
- package/dist/headless.d.mts.map +1 -1
- package/dist/headless.mjs +283 -1054
- package/dist/headless.mjs.map +1 -1
- package/dist/hooks-D2H3iL0N.d.mts +84 -0
- package/dist/hooks-D2H3iL0N.d.mts.map +1 -0
- package/dist/hooks-Dy8HeEdr.d.cts +84 -0
- package/dist/hooks-Dy8HeEdr.d.cts.map +1 -0
- package/dist/index.cjs +8702 -13238
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +312 -872
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +311 -871
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +1790 -7803
- package/dist/index.mjs.map +1 -1
- package/dist/index.umd.js +14075 -13828
- package/dist/index.umd.js.map +1 -1
- package/dist/refs-B5Dn59Pn.cjs +43 -0
- package/dist/refs-B5Dn59Pn.cjs.map +1 -0
- package/dist/refs-BW15wX_V.mjs +31 -0
- package/dist/refs-BW15wX_V.mjs.map +1 -0
- package/dist/runtime-context-B7f4M85q.d.mts +215 -0
- package/dist/runtime-context-B7f4M85q.d.mts.map +1 -0
- package/dist/runtime-context-CIkZS0ap.d.cts +215 -0
- package/dist/runtime-context-CIkZS0ap.d.cts.map +1 -0
- package/dist/standard-CSBR4FhM.mjs +5800 -0
- package/dist/standard-CSBR4FhM.mjs.map +1 -0
- package/dist/standard-DBjcBGyd.cjs +5796 -0
- package/dist/standard-DBjcBGyd.cjs.map +1 -0
- package/dist/use-generative-ui-root-CIp0ytE6.cjs +390 -0
- package/dist/use-generative-ui-root-CIp0ytE6.cjs.map +1 -0
- package/dist/use-generative-ui-root-oBqPa6uy.mjs +386 -0
- package/dist/use-generative-ui-root-oBqPa6uy.mjs.map +1 -0
- package/dist/v2/context.d.cts +28 -0
- package/dist/v2/context.d.mts +28 -0
- package/dist/v2/generative-ui/native.d.cts +112 -0
- package/dist/v2/generative-ui/native.d.mts +112 -0
- package/dist/v2/generative-ui.d.cts +96 -0
- package/dist/v2/generative-ui.d.mts +96 -0
- package/dist/v2/headless.d.cts +96 -0
- package/dist/v2/headless.d.mts +96 -0
- package/dist/v2/index.d.cts +2220 -0
- package/dist/v2/index.d.mts +2220 -0
- package/dist/v2/styles.css +5 -0
- package/package.json +116 -24
- package/dist/MarkdownRendererContext-B4Us6mwL.d.cts +0 -954
- package/dist/MarkdownRendererContext-B4Us6mwL.d.cts.map +0 -1
- package/dist/MarkdownRendererContext-CRKFzsEB.d.mts +0 -954
- package/dist/MarkdownRendererContext-CRKFzsEB.d.mts.map +0 -1
- package/dist/MarkdownSurfaces-Bd--93O1.mjs +0 -3676
- package/dist/MarkdownSurfaces-Bd--93O1.mjs.map +0 -1
- package/dist/MarkdownSurfaces-S4wfUl3J.cjs +0 -3991
- package/dist/MarkdownSurfaces-S4wfUl3J.cjs.map +0 -1
package/dist/headless.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"headless.d.cts","names":[],"sources":["../src/
|
|
1
|
+
{"version":3,"file":"headless.d.cts","names":[],"sources":["../src/providers/use-owned-core.ts","../src/providers/CopilotChatConfigurationProvider.tsx","../src/hooks/use-agent.tsx","../src/types/react-tool-call-renderer.ts","../src/types/frontend-tool.ts","../src/hooks/use-frontend-tool.tsx","../src/hooks/use-frontend-tools.tsx","../src/hooks/use-component.tsx","../src/types/human-in-the-loop.ts","../src/hooks/use-human-in-the-loop.tsx","../src/hooks/use-interrupt.tsx","../src/hooks/use-suggestions.tsx","../src/hooks/use-configure-suggestions.tsx","../src/hooks/use-agent-context.tsx","../src/hooks/use-threads.tsx","../src/hooks/use-render-tool.tsx","../src/hooks/use-render-tool-call.tsx","../src/types/defineToolCallRenderer.ts","../src/hooks/use-capabilities.tsx"],"mappings":";;;;;;;;;;;UAIU,UAAA;EACR,OAAA;AAAA;;;;;;AAJ4C;;;;;AAyB9C;;;;;;;;iBAAgB,aAAA,WAAwB,UAAA,CAAA,CACtC,GAAA,EAAK,gBAAA,CAAiB,CAAA,UACtB,MAAA,QAAc,CAAA,GAAC,CAAA;;;UCRA,6BAAA;EACf,MAAA,EAAQ,mBAAA;EACR,OAAA;EACA,QAAA;EACA,WAAA;EACA,YAAA,GAAe,IAAA;EDrBP;;;;;EC2BR,UAAA;EDL2B;;;;;ECW3B,aAAA,GAAgB,IAAA;EDTD;;;;;ECef,gBAAA;EDhBsB;;;;;;;ECwBtB,cAAA;;;AA/BF;;;;;;;;EA0CE,oBAAA,GAAuB,UAAA,GAAa,IAAA;EAKpC,mBAAA;EA1Ce;;;;;;;;;;;;;;;;;EA4Df,iBAAA,GACE,QAAA,UACA,OAAA;IAAY,QAAA;EAAA;EAwBsC;;;;;;;;;EAbpD,cAAA;E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;;;;;iBcgDgB,aAAA,CACd,MAAA;EACE,IAAA;EACA,MAAA,GAAS,KAAA,UAAe,KAAA,CAAM,YAAA;EAC9B,OAAA,WdnCc;EcqCd,KAAA;AAAA,GAEF,IAAA,GAAO,aAAA;;;;;;;;;;;;;;AdmCT;;;;;;;;;;;;;;iBcLgB,aAAA,WAAwB,gBAAA,CAAA,CACtC,MAAA;EACE,IAAA;EACA,UAAA,EAAY,CAAA;EACZ,MAAA,GAAS,KAAA,EAAO,eAAA,CAAgB,CAAA,MAAO,KAAA,CAAM,YAAA;EAC7C,OAAA,WdeS;EcbT,KAAA;AAAA,GAEF,IAAA,GAAO,aAAA;;;UChGQ,sBAAA;EACf,QAAA,EAAU,QAAA;EACV,WAAA,GAAc,WAAA;AAAA;;;;;;;iBAsHA,iBAAA,CAAA;EAAiB,QAAA;EAAA;AAAA,GAoB1B,sBAAA,KAAyB,OAAA,CAAM,YAAA;;;;;;;;;AhB9JQ;iBiBa9B,sBAAA,CAAuB,GAAA;EACrC,IAAA;EACA,MAAA,GAAS,KAAA,EAAO,mBAAA,UAA6B,OAAA,CAAM,YAAA;EACnD,OAAA;EACA,KAAA;AAAA,IACE,qBAAA;AAAA,iBAGY,sBAAA,WAAiC,gBAAA,CAAA,CAAkB,GAAA;EACjE,IAAA;EACA,IAAA,EAAM,CAAA;EACN,MAAA,GACE,KAAA,EAAO,mBAAA,CAAoB,iBAAA,CAAkB,CAAA,OAC1C,OAAA,CAAM,YAAA;EACX,OAAA;EACA,KAAA;AAAA,IACE,qBAAA,CAAsB,iBAAA,CAAkB,CAAA;;;;;;;;;;;;AjB7BE;;;;iBkBgB9B,eAAA,CACd,OAAA,YACC,iBAAA"}
|
package/dist/headless.d.mts
CHANGED
|
@@ -1,59 +1,40 @@
|
|
|
1
|
-
import React$1, { ComponentType, ReactNode } from "react";
|
|
1
|
+
import React$1, { ComponentType, MutableRefObject, ReactNode } from "react";
|
|
2
|
+
import * as _copilotkit_core0 from "@copilotkit/core";
|
|
3
|
+
import { CopilotChatDefaultLabels, CopilotChatLabels, CopilotChatLabels as CopilotChatLabels$1, FrontendTool, HumanInTheLoopRenderProps, InterruptEvent, InterruptHandlerProps, InterruptRenderProps, Suggestion, ToolCallRenderProps, ToolCallRendererDef, ɵChatConfigurationStore, ɵJsonSerializable, ɵSuggestionsConfigInput, ɵThreadSummary } from "@copilotkit/core";
|
|
2
4
|
import { InferSchemaOutput, StandardSchemaV1 } from "@copilotkit/shared";
|
|
3
|
-
import { DynamicSuggestionsConfig, FrontendTool, StaticSuggestionsConfig, Suggestion, ToolCallStatus } from "@copilotkit/core";
|
|
4
|
-
import { AbstractAgent, Interrupt, ResumeEntry, ResumeStatus, RunAgentResult } from "@ag-ui/client";
|
|
5
|
-
import { AgentCapabilities, ToolCall, ToolMessage } from "@ag-ui/core";
|
|
6
5
|
import { CopilotKitCoreReact, CopilotKitCoreReactConfig, useCopilotKit } from "@copilotkit/react-core/context";
|
|
6
|
+
import * as _ag_ui_client0 from "@ag-ui/client";
|
|
7
|
+
import { Interrupt, ResumeEntry, ResumeStatus } from "@ag-ui/client";
|
|
8
|
+
import { AgentCapabilities, ToolCall, ToolMessage } from "@ag-ui/core";
|
|
7
9
|
|
|
10
|
+
//#region src/providers/use-owned-core.d.ts
|
|
11
|
+
/** The part of a core this hook needs: something it can dispose. */
|
|
12
|
+
interface Disposable {
|
|
13
|
+
dispose(): void;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* @internal Create a core for the provider's lifetime and dispose it on
|
|
17
|
+
* unmount.
|
|
18
|
+
*
|
|
19
|
+
* The dispose waits one task. StrictMode (and Fast Refresh) unmount and
|
|
20
|
+
* remount effects in the same commit, so the remount cancels the pending
|
|
21
|
+
* dispose and the same core keeps working. When effects mount again after the
|
|
22
|
+
* core was really disposed (for example an `<Activity>` that was hidden and
|
|
23
|
+
* shown), the hook creates a new core and renders again: a disposed core is
|
|
24
|
+
* never reused.
|
|
25
|
+
*
|
|
26
|
+
* `ref` holds the current core. The provider owns it, so code that runs
|
|
27
|
+
* before the core exists can read `ref.current`.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* const coreRef = useRef<CopilotKitCoreReact | null>(null);
|
|
31
|
+
* const core = ɵuseOwnedCore(coreRef, () => new CopilotKitCoreReact(config));
|
|
32
|
+
*/
|
|
33
|
+
declare function ɵuseOwnedCore<T extends Disposable>(ref: MutableRefObject<T | null>, create: () => T): T;
|
|
34
|
+
//#endregion
|
|
8
35
|
//#region src/providers/CopilotChatConfigurationProvider.d.ts
|
|
9
|
-
declare const CopilotChatDefaultLabels: {
|
|
10
|
-
chatInputPlaceholder: string;
|
|
11
|
-
chatInputToolbarStartTranscribeButtonLabel: string;
|
|
12
|
-
chatInputToolbarCancelTranscribeButtonLabel: string;
|
|
13
|
-
chatInputToolbarFinishTranscribeButtonLabel: string;
|
|
14
|
-
chatInputToolbarAddButtonLabel: string;
|
|
15
|
-
chatInputToolbarToolsButtonLabel: string;
|
|
16
|
-
chatInputToolbarSendButtonLabel: string;
|
|
17
|
-
chatInputToolbarStopButtonLabel: string;
|
|
18
|
-
assistantMessageToolbarCopyCodeLabel: string;
|
|
19
|
-
assistantMessageToolbarCopyCodeCopiedLabel: string;
|
|
20
|
-
assistantMessageToolbarCopyMessageLabel: string;
|
|
21
|
-
assistantMessageToolbarInspectorLabel: string;
|
|
22
|
-
assistantMessageToolbarInspectorDescription: string;
|
|
23
|
-
assistantMessageToolbarInspectorLocalOnlyLabel: string;
|
|
24
|
-
assistantMessageToolbarInspectorLocalOnlyDescription: string;
|
|
25
|
-
assistantMessageToolbarInspectorTitle: string;
|
|
26
|
-
assistantMessageToolbarInspectorHideLabel: string;
|
|
27
|
-
assistantMessageToolbarInspectorHideDescription: string;
|
|
28
|
-
assistantMessageToolbarThumbsUpLabel: string;
|
|
29
|
-
assistantMessageToolbarThumbsDownLabel: string;
|
|
30
|
-
assistantMessageFeedbackCommentPlaceholder: string;
|
|
31
|
-
assistantMessageFeedbackCommentSubmitLabel: string;
|
|
32
|
-
assistantMessageToolbarReadAloudLabel: string;
|
|
33
|
-
assistantMessageToolbarRegenerateLabel: string;
|
|
34
|
-
userMessageToolbarCopyMessageLabel: string;
|
|
35
|
-
userMessageToolbarEditMessageLabel: string;
|
|
36
|
-
userMessageToolbarPreviousBranchLabel: string;
|
|
37
|
-
userMessageToolbarNextBranchLabel: string;
|
|
38
|
-
chatDisclaimerText: string;
|
|
39
|
-
chatToggleOpenLabel: string;
|
|
40
|
-
chatToggleCloseLabel: string;
|
|
41
|
-
chatScrollToBottomLabel: string;
|
|
42
|
-
modalHeaderTitle: string;
|
|
43
|
-
welcomeMessageText: string;
|
|
44
|
-
reasoningMessageThinkingLabel: string;
|
|
45
|
-
chatInputSlashMenuLabel: string;
|
|
46
|
-
chatInputSlashMenuEmptyText: string;
|
|
47
|
-
attachmentRemoveButtonLabel: string;
|
|
48
|
-
attachmentPlayVideoButtonLabel: string;
|
|
49
|
-
attachmentPreviewCloseButtonLabel: string;
|
|
50
|
-
modalHeaderCloseButtonLabel: string;
|
|
51
|
-
modalHeaderThreadsButtonLabel: string;
|
|
52
|
-
sidebarLabel: string;
|
|
53
|
-
};
|
|
54
|
-
type CopilotChatLabels = typeof CopilotChatDefaultLabels;
|
|
55
36
|
interface CopilotChatConfigurationValue {
|
|
56
|
-
labels: CopilotChatLabels;
|
|
37
|
+
labels: CopilotChatLabels$1;
|
|
57
38
|
agentId: string;
|
|
58
39
|
threadId: string;
|
|
59
40
|
isModalOpen: boolean;
|
|
@@ -103,7 +84,7 @@ interface CopilotChatConfigurationValue {
|
|
|
103
84
|
* `<CopilotThreadsDrawer>` selecting a thread row sets it explicitly so the chat
|
|
104
85
|
* connects to that backend thread.
|
|
105
86
|
*
|
|
106
|
-
* Guarded like the top-level `<
|
|
87
|
+
* Guarded like the top-level `<CopilotKitProvider>`'s `setThreadId`: when
|
|
107
88
|
* the consumer controls the threadId via the `threadId` prop on this
|
|
108
89
|
* provider, this is a no-op (a warning is logged) so a prop-controlled
|
|
109
90
|
* threadId is never silently overridden.
|
|
@@ -126,10 +107,15 @@ interface CopilotChatConfigurationValue {
|
|
|
126
107
|
* threadId is prop-controlled.
|
|
127
108
|
*/
|
|
128
109
|
startNewThread: () => void;
|
|
110
|
+
/**
|
|
111
|
+
* Internal: the core store behind this value, so a nested provider can link
|
|
112
|
+
* its own store to it.
|
|
113
|
+
*/
|
|
114
|
+
ɵstore?: ɵChatConfigurationStore;
|
|
129
115
|
}
|
|
130
116
|
interface CopilotChatConfigurationProviderProps {
|
|
131
117
|
children: ReactNode;
|
|
132
|
-
labels?: Partial<CopilotChatLabels>;
|
|
118
|
+
labels?: Partial<CopilotChatLabels$1>;
|
|
133
119
|
agentId?: string;
|
|
134
120
|
threadId?: string;
|
|
135
121
|
hasExplicitThreadId?: boolean;
|
|
@@ -263,7 +249,7 @@ declare function useAgent({
|
|
|
263
249
|
updates,
|
|
264
250
|
throttleMs
|
|
265
251
|
}?: UseAgentProps): {
|
|
266
|
-
agent: AbstractAgent;
|
|
252
|
+
agent: _ag_ui_client0.AbstractAgent | _copilotkit_core0.ProxiedCopilotRuntimeAgent;
|
|
267
253
|
/**
|
|
268
254
|
* Whether `agent` is the real, runtime-synced (or locally-registered) agent
|
|
269
255
|
* rather than a provisional stand-in returned while the runtime is still
|
|
@@ -282,45 +268,16 @@ declare function useAgent({
|
|
|
282
268
|
};
|
|
283
269
|
//#endregion
|
|
284
270
|
//#region src/types/react-tool-call-renderer.d.ts
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
*/
|
|
296
|
-
agentId?: string;
|
|
297
|
-
/**
|
|
298
|
-
* Whether calls this renderer draws join the chat's tool-call groups (see
|
|
299
|
-
* `toolCallDisplay` on `CopilotChatMessageView`). CopilotKit's built-in card
|
|
300
|
-
* sets it; a renderer that leaves it unset always shows its calls on their
|
|
301
|
-
* own, since the chat can't tell what it draws (it may even draw nothing).
|
|
302
|
-
*/
|
|
303
|
-
group?: boolean;
|
|
304
|
-
render: React.ComponentType<{
|
|
305
|
-
name: string;
|
|
306
|
-
toolCallId: string;
|
|
307
|
-
args: Partial<T>;
|
|
308
|
-
status: ToolCallStatus.InProgress;
|
|
309
|
-
result: undefined;
|
|
310
|
-
} | {
|
|
311
|
-
name: string;
|
|
312
|
-
toolCallId: string;
|
|
313
|
-
args: T;
|
|
314
|
-
status: ToolCallStatus.Executing;
|
|
315
|
-
result: undefined;
|
|
316
|
-
} | {
|
|
317
|
-
name: string;
|
|
318
|
-
toolCallId: string;
|
|
319
|
-
args: T;
|
|
320
|
-
status: ToolCallStatus.Complete;
|
|
321
|
-
result: string;
|
|
322
|
-
}>;
|
|
323
|
-
}
|
|
271
|
+
/**
|
|
272
|
+
* A tool call renderer for React: a React component that draws one tool call
|
|
273
|
+
* in the chat. The component receives {@link ToolCallRenderProps}.
|
|
274
|
+
*
|
|
275
|
+
* Pass a list of these to `renderToolCalls` on `CopilotKitProvider`, or build
|
|
276
|
+
* one with `defineToolCallRenderer`.
|
|
277
|
+
*
|
|
278
|
+
* @typeParam T - The shape of the tool arguments.
|
|
279
|
+
*/
|
|
280
|
+
type ReactToolCallRenderer<T = unknown> = ToolCallRendererDef<T, React$1.ComponentType<ToolCallRenderProps<T>>>;
|
|
324
281
|
//#endregion
|
|
325
282
|
//#region src/types/frontend-tool.d.ts
|
|
326
283
|
type ReactFrontendTool<T extends Record<string, unknown> = Record<string, unknown>> = FrontendTool<T> & {
|
|
@@ -328,6 +285,30 @@ type ReactFrontendTool<T extends Record<string, unknown> = Record<string, unknow
|
|
|
328
285
|
};
|
|
329
286
|
//#endregion
|
|
330
287
|
//#region src/hooks/use-frontend-tool.d.ts
|
|
288
|
+
/**
|
|
289
|
+
* Register a frontend tool while the component is mounted. The agent can
|
|
290
|
+
* call it, and its `render` component draws the call in the chat.
|
|
291
|
+
*
|
|
292
|
+
* A tool with the same name and agentId as a tool that is already registered
|
|
293
|
+
* (for example one from the provider's `tools`) overrides it while this
|
|
294
|
+
* component is mounted. When the component unmounts, the overridden tool is
|
|
295
|
+
* active again. The renderer stays registered after unmount, so past tool
|
|
296
|
+
* calls still render in the chat history.
|
|
297
|
+
*
|
|
298
|
+
* @param tool - The tool to register.
|
|
299
|
+
* @param deps - Extra values that re-register the tool when they change. Use
|
|
300
|
+
* it when the handler closes over a value that is not part of the tool.
|
|
301
|
+
*
|
|
302
|
+
* @example
|
|
303
|
+
* ```tsx
|
|
304
|
+
* useFrontendTool({
|
|
305
|
+
* name: "showWeather",
|
|
306
|
+
* description: "Show the weather for a city",
|
|
307
|
+
* parameters: z.object({ city: z.string() }),
|
|
308
|
+
* handler: async ({ city }) => `Sunny in ${city}`,
|
|
309
|
+
* });
|
|
310
|
+
* ```
|
|
311
|
+
*/
|
|
331
312
|
declare function useFrontendTool<T extends Record<string, unknown> = Record<string, unknown>>(tool: ReactFrontendTool<T>, deps?: ReadonlyArray<unknown>): void;
|
|
332
313
|
//#endregion
|
|
333
314
|
//#region src/hooks/use-frontend-tools.d.ts
|
|
@@ -341,8 +322,10 @@ declare function useFrontendTool<T extends Record<string, unknown> = Record<stri
|
|
|
341
322
|
*
|
|
342
323
|
* Tools are keyed by `name` plus `agentId`, the same as `useFrontendTool`. A
|
|
343
324
|
* tool that disappears from the array is unregistered on the next render, and
|
|
344
|
-
* every tool is unregistered on unmount.
|
|
345
|
-
*
|
|
325
|
+
* every tool is unregistered on unmount. A listed tool hides a tool with the
|
|
326
|
+
* same name and agentId (for example one from the provider's `tools`) until it
|
|
327
|
+
* is unregistered, and then the hidden tool is active again. Renderers stay
|
|
328
|
+
* registered after unmount so past tool calls still render in the chat history.
|
|
346
329
|
*
|
|
347
330
|
* @param tools - The tools to register. May be empty and may change length.
|
|
348
331
|
* @param deps - Extra dependencies that force re-registration, compared by
|
|
@@ -444,109 +427,30 @@ declare function useComponent<TSchema extends StandardSchemaV1<any, Record<strin
|
|
|
444
427
|
}, deps?: ReadonlyArray<unknown>): void;
|
|
445
428
|
//#endregion
|
|
446
429
|
//#region src/types/human-in-the-loop.d.ts
|
|
430
|
+
/**
|
|
431
|
+
* A human-in-the-loop tool for React. It has no handler: the agent waits until
|
|
432
|
+
* the `render` component calls `respond` with the user's answer.
|
|
433
|
+
*
|
|
434
|
+
* @typeParam T - The shape of the tool arguments.
|
|
435
|
+
*/
|
|
447
436
|
type ReactHumanInTheLoop<T extends Record<string, unknown> = Record<string, unknown>> = Omit<FrontendTool<T>, "handler"> & {
|
|
448
437
|
/**
|
|
449
|
-
* Render the human-in-the-loop UI for this tool call.
|
|
450
|
-
*
|
|
451
|
-
*
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
* stable key for correlating this interrupt with runtime (sub)agent
|
|
455
|
-
* attribution — e.g. the `agentId` reported by `onToolExecutionStart`, or
|
|
456
|
-
* per-run attribution stamped on the event stream — so the UI can label
|
|
457
|
-
* the interrupt with the agent that actually raised it.
|
|
458
|
-
* - `agentId` — the agent this tool was *registered* to (the tool's own
|
|
459
|
-
* `agentId`), or `undefined` for an unscoped tool. This is the static
|
|
460
|
-
* registration scope; it is NOT necessarily the runtime (sub)agent that
|
|
461
|
-
* raised the interrupt. For runtime attribution, correlate `toolCallId`
|
|
462
|
-
* with the event-stream/`onToolExecutionStart` agent id.
|
|
463
|
-
*/
|
|
464
|
-
render: React$1.ComponentType<{
|
|
465
|
-
name: string;
|
|
466
|
-
description: string;
|
|
467
|
-
toolCallId: string;
|
|
468
|
-
agentId?: string;
|
|
469
|
-
args: Partial<T>;
|
|
470
|
-
status: ToolCallStatus.InProgress;
|
|
471
|
-
result: undefined;
|
|
472
|
-
respond: undefined;
|
|
473
|
-
} | {
|
|
474
|
-
name: string;
|
|
475
|
-
description: string;
|
|
476
|
-
toolCallId: string;
|
|
477
|
-
agentId?: string;
|
|
478
|
-
args: T;
|
|
479
|
-
status: ToolCallStatus.Executing;
|
|
480
|
-
result: undefined;
|
|
481
|
-
respond: (result: unknown) => Promise<void>;
|
|
482
|
-
} | {
|
|
483
|
-
name: string;
|
|
484
|
-
description: string;
|
|
485
|
-
toolCallId: string;
|
|
486
|
-
agentId?: string;
|
|
487
|
-
args: T;
|
|
488
|
-
status: ToolCallStatus.Complete;
|
|
489
|
-
result: string;
|
|
490
|
-
respond: undefined;
|
|
491
|
-
}>;
|
|
438
|
+
* Render the human-in-the-loop UI for this tool call. The component
|
|
439
|
+
* receives {@link HumanInTheLoopRenderProps}, which also carry `toolCallId`
|
|
440
|
+
* and `agentId` for attribution.
|
|
441
|
+
*/
|
|
442
|
+
render: React$1.ComponentType<HumanInTheLoopRenderProps<T>>;
|
|
492
443
|
};
|
|
493
444
|
//#endregion
|
|
494
445
|
//#region src/hooks/use-human-in-the-loop.d.ts
|
|
495
446
|
declare function useHumanInTheLoop<T extends Record<string, unknown> = Record<string, unknown>>(tool: ReactHumanInTheLoop<T>, deps?: ReadonlyArray<unknown>): void;
|
|
496
447
|
//#endregion
|
|
497
|
-
//#region src/types/interrupt.d.ts
|
|
498
|
-
/** Legacy custom-event interrupt payload (agent emits a custom `on_interrupt` event). */
|
|
499
|
-
interface InterruptEvent<TValue = unknown> {
|
|
500
|
-
name: string;
|
|
501
|
-
value: TValue;
|
|
502
|
-
}
|
|
503
|
-
/**
|
|
504
|
-
* Resolve the agent with user input for an interrupt.
|
|
505
|
-
*
|
|
506
|
-
* - Standard interrupts: records `{ status: "resolved", payload }` for the target
|
|
507
|
-
* interrupt (defaults to the primary one). Resumes once every open interrupt is
|
|
508
|
-
* addressed; returns the resume run result, or `void` while still awaiting others.
|
|
509
|
-
* - Legacy interrupts: resumes immediately via `command.resume = payload`.
|
|
510
|
-
*/
|
|
511
|
-
type InterruptResolveFn = (payload?: unknown, interruptId?: string) => Promise<RunAgentResult | void>;
|
|
512
|
-
/**
|
|
513
|
-
* Cancel an interrupt.
|
|
514
|
-
*
|
|
515
|
-
* - Standard interrupts: records `{ status: "cancelled" }` for the target interrupt
|
|
516
|
-
* (defaults to the primary one), then resumes once all are addressed.
|
|
517
|
-
* - Legacy interrupts: dismisses the pending interrupt without resuming.
|
|
518
|
-
*/
|
|
519
|
-
type InterruptCancelFn = (interruptId?: string) => Promise<RunAgentResult | void>;
|
|
520
|
-
interface InterruptHandlerProps<TValue = unknown> {
|
|
521
|
-
/**
|
|
522
|
-
* Legacy event shape (`{ name, value }`). Always present for back-compat: for
|
|
523
|
-
* standard interrupts, `value` is the primary `Interrupt` and `name` is `"on_interrupt"`.
|
|
524
|
-
* Prefer `interrupt` / `interrupts` for standard interrupts.
|
|
525
|
-
*/
|
|
526
|
-
event: InterruptEvent<TValue>;
|
|
527
|
-
/** Primary standard interrupt (`interrupts[0]`), or `null` for legacy interrupts. */
|
|
528
|
-
interrupt: Interrupt | null;
|
|
529
|
-
/** All open standard interrupts (empty array for legacy interrupts). */
|
|
530
|
-
interrupts: Interrupt[];
|
|
531
|
-
resolve: InterruptResolveFn;
|
|
532
|
-
cancel: InterruptCancelFn;
|
|
533
|
-
}
|
|
534
|
-
interface InterruptRenderProps<TValue = unknown, TResult = unknown> {
|
|
535
|
-
event: InterruptEvent<TValue>;
|
|
536
|
-
interrupt: Interrupt | null;
|
|
537
|
-
interrupts: Interrupt[];
|
|
538
|
-
result: TResult;
|
|
539
|
-
resolve: InterruptResolveFn;
|
|
540
|
-
cancel: InterruptCancelFn;
|
|
541
|
-
}
|
|
542
|
-
//#endregion
|
|
543
448
|
//#region src/hooks/use-interrupt.d.ts
|
|
544
449
|
type InterruptHandlerFn<TValue, TResult> = (props: InterruptHandlerProps<TValue>) => TResult | PromiseLike<TResult>;
|
|
545
450
|
type InterruptResultFromHandler<THandler> = THandler extends ((...args: never[]) => infer TResult) ? TResult extends PromiseLike<infer TResolved> ? TResolved | null : TResult | null : null;
|
|
546
451
|
type InterruptResult<TValue, TResult> = InterruptResultFromHandler<InterruptHandlerFn<TValue, TResult>>;
|
|
547
452
|
type InterruptRenderInChat = boolean | undefined;
|
|
548
453
|
type UseInterruptReturn<TRenderInChat extends InterruptRenderInChat> = TRenderInChat extends false ? React$1.ReactElement | null : TRenderInChat extends true | undefined ? void : React$1.ReactElement | null | void;
|
|
549
|
-
/** Recognize thenables returned by interrupt preprocessing handlers. */
|
|
550
454
|
/**
|
|
551
455
|
* Configuration options for `useInterrupt`.
|
|
552
456
|
*/
|
|
@@ -620,29 +524,39 @@ declare function useSuggestions({
|
|
|
620
524
|
}?: UseSuggestionsOptions): UseSuggestionsResult;
|
|
621
525
|
//#endregion
|
|
622
526
|
//#region src/hooks/use-configure-suggestions.d.ts
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
527
|
+
/**
|
|
528
|
+
* Registers a suggestions configuration (dynamic or static) for the current
|
|
529
|
+
* chat. A global config (no `consumerAgentId`, or `"*"`) applies to every
|
|
530
|
+
* agent and loads for the surrounding chat's agent first.
|
|
531
|
+
*
|
|
532
|
+
* Pass `deps` to reload suggestions when values the config reads change.
|
|
533
|
+
*
|
|
534
|
+
* @example
|
|
535
|
+
* useConfigureSuggestions({
|
|
536
|
+
* instructions: "Suggest concise next steps for the user",
|
|
537
|
+
* available: "always",
|
|
538
|
+
* });
|
|
539
|
+
*/
|
|
540
|
+
declare function useConfigureSuggestions(config: ɵSuggestionsConfigInput | null | undefined, deps?: ReadonlyArray<unknown>): void;
|
|
629
541
|
//#endregion
|
|
630
542
|
//#region src/hooks/use-agent-context.d.ts
|
|
631
543
|
/**
|
|
632
544
|
* Represents any value that can be serialized to JSON.
|
|
633
545
|
*/
|
|
634
|
-
type JsonSerializable =
|
|
635
|
-
[key: string]: JsonSerializable;
|
|
636
|
-
};
|
|
546
|
+
type JsonSerializable = ɵJsonSerializable;
|
|
637
547
|
/**
|
|
638
548
|
* Context configuration for useAgentContext.
|
|
639
|
-
* Accepts any
|
|
549
|
+
* Accepts any value; a value that is not a string is sent as its JSON text.
|
|
640
550
|
*/
|
|
641
551
|
interface AgentContextInput {
|
|
642
552
|
/** A human-readable description of what this context represents */
|
|
643
553
|
description: string;
|
|
644
|
-
/**
|
|
645
|
-
|
|
554
|
+
/**
|
|
555
|
+
* The context value. A string is sent as-is; any other value is sent as its
|
|
556
|
+
* JSON text, so it should be JSON-serializable. Interface types and optional
|
|
557
|
+
* fields are accepted.
|
|
558
|
+
*/
|
|
559
|
+
value: unknown;
|
|
646
560
|
}
|
|
647
561
|
declare function useAgentContext(context: AgentContextInput): void;
|
|
648
562
|
//#endregion
|
|
@@ -651,23 +565,12 @@ declare function useAgentContext(context: AgentContextInput): void;
|
|
|
651
565
|
* A conversation thread managed by CopilotKit Intelligence.
|
|
652
566
|
*
|
|
653
567
|
* Each thread has a unique `id`, an optional human-readable `name`, and
|
|
654
|
-
*
|
|
568
|
+
* ISO-8601 `createdAt` and `updatedAt` timestamps. `lastRunAt` is the time of
|
|
569
|
+
* the most recent agent run, absent when the thread has never run; prefer it
|
|
570
|
+
* over `updatedAt` for "last activity", since rename and archive do not bump
|
|
571
|
+
* it. The shape is core's thread summary, which Angular also exposes.
|
|
655
572
|
*/
|
|
656
|
-
|
|
657
|
-
id: string;
|
|
658
|
-
agentId: string;
|
|
659
|
-
name: string | null;
|
|
660
|
-
archived: boolean;
|
|
661
|
-
createdAt: string;
|
|
662
|
-
updatedAt: string;
|
|
663
|
-
/**
|
|
664
|
-
* ISO-8601 timestamp of the most recent agent run on this thread. Absent
|
|
665
|
-
* when the thread has never been run. Prefer this over `updatedAt` for
|
|
666
|
-
* user-facing "last activity" displays — it is not bumped by metadata-only
|
|
667
|
-
* actions like rename or archive.
|
|
668
|
-
*/
|
|
669
|
-
lastRunAt?: string;
|
|
670
|
-
}
|
|
573
|
+
type Thread = ɵThreadSummary;
|
|
671
574
|
/**
|
|
672
575
|
* Configuration for the {@link useThreads} hook.
|
|
673
576
|
*
|
|
@@ -727,7 +630,9 @@ interface UseThreadsResult {
|
|
|
727
630
|
* `null`. Unlike {@link error}, this EXCLUDES developer/config errors (a
|
|
728
631
|
* missing runtime URL, or a runtime that does not advertise thread
|
|
729
632
|
* endpoints), so an end-user surface can render it directly without leaking
|
|
730
|
-
* a developer-facing configuration message into the UI.
|
|
633
|
+
* a developer-facing configuration message into the UI. It does report a
|
|
634
|
+
* runtime that refuses to list threads because the caller has no identity
|
|
635
|
+
* (no `identifyUser`), since the list cannot load until that is set.
|
|
731
636
|
*/
|
|
732
637
|
listError: Error | null;
|
|
733
638
|
/**
|
|
@@ -953,37 +858,18 @@ declare function useRenderToolCall(): ({
|
|
|
953
858
|
* - Accepts a single object whose keys match ReactToolCallRenderer's fields: { name, args, render, agentId? }.
|
|
954
859
|
* - Derives `args` type from the provided schema (any Standard Schema V1 compatible library).
|
|
955
860
|
* - Ensures the render function param type exactly matches ReactToolCallRenderer<T>["render"]'s param.
|
|
956
|
-
* - For wildcard tools (name: "*"), args is optional and defaults to
|
|
861
|
+
* - For wildcard tools (name: "*"), args is optional and defaults to a schema that accepts any value.
|
|
957
862
|
*/
|
|
958
|
-
type RenderProps<T> = {
|
|
959
|
-
name: string;
|
|
960
|
-
toolCallId: string;
|
|
961
|
-
args: Partial<T>;
|
|
962
|
-
status: ToolCallStatus.InProgress;
|
|
963
|
-
result: undefined;
|
|
964
|
-
} | {
|
|
965
|
-
name: string;
|
|
966
|
-
toolCallId: string;
|
|
967
|
-
args: T;
|
|
968
|
-
status: ToolCallStatus.Executing;
|
|
969
|
-
result: undefined;
|
|
970
|
-
} | {
|
|
971
|
-
name: string;
|
|
972
|
-
toolCallId: string;
|
|
973
|
-
args: T;
|
|
974
|
-
status: ToolCallStatus.Complete;
|
|
975
|
-
result: string;
|
|
976
|
-
};
|
|
977
863
|
declare function defineToolCallRenderer(def: {
|
|
978
864
|
name: "*";
|
|
979
|
-
render: (props:
|
|
865
|
+
render: (props: ToolCallRenderProps<any>) => React$1.ReactElement | null;
|
|
980
866
|
agentId?: string;
|
|
981
867
|
group?: boolean;
|
|
982
868
|
}): ReactToolCallRenderer<any>;
|
|
983
869
|
declare function defineToolCallRenderer<S extends StandardSchemaV1>(def: {
|
|
984
870
|
name: string;
|
|
985
871
|
args: S;
|
|
986
|
-
render: (props:
|
|
872
|
+
render: (props: ToolCallRenderProps<InferSchemaOutput<S>>) => React$1.ReactElement | null;
|
|
987
873
|
agentId?: string;
|
|
988
874
|
group?: boolean;
|
|
989
875
|
}): ReactToolCallRenderer<InferSchemaOutput<S>>;
|
|
@@ -1004,5 +890,5 @@ declare function defineToolCallRenderer<S extends StandardSchemaV1>(def: {
|
|
|
1004
890
|
*/
|
|
1005
891
|
declare function useCapabilities(agentId?: string): AgentCapabilities | undefined;
|
|
1006
892
|
//#endregion
|
|
1007
|
-
export { type AgentContextInput, CopilotChatConfigurationProvider, type CopilotChatConfigurationProviderProps, type CopilotChatConfigurationValue, CopilotChatDefaultLabels, type CopilotChatLabels, CopilotKitCoreReact, type CopilotKitCoreReactConfig, type Interrupt, type InterruptEvent, type InterruptHandlerProps, type InterruptRenderProps, type JsonSerializable, type ReactFrontendTool, type ReactHumanInTheLoop, type ReactToolCallRenderer, type RenderToolCompleteProps, type RenderToolExecutingProps, type RenderToolInProgressProps, type RenderToolProps, type ResumeEntry, type ResumeStatus, type Thread, UseAgentUpdate, type UseInterruptConfig, type UseThreadsInput, type UseThreadsResult, defineToolCallRenderer, useAgent, useAgentContext, useCapabilities, useComponent, useConfigureSuggestions, useCopilotChatConfiguration, useCopilotKit, useFrontendTool, useFrontendTools, useHumanInTheLoop, useInterrupt, useRenderTool, useRenderToolCall, useSuggestions, useThreads };
|
|
893
|
+
export { type AgentContextInput, CopilotChatConfigurationProvider, type CopilotChatConfigurationProviderProps, type CopilotChatConfigurationValue, CopilotChatDefaultLabels, type CopilotChatLabels, CopilotKitCoreReact, type CopilotKitCoreReactConfig, type Interrupt, type InterruptEvent, type InterruptHandlerProps, type InterruptRenderProps, type JsonSerializable, type ReactFrontendTool, type ReactHumanInTheLoop, type ReactToolCallRenderer, type RenderToolCompleteProps, type RenderToolExecutingProps, type RenderToolInProgressProps, type RenderToolProps, type ResumeEntry, type ResumeStatus, type Thread, UseAgentUpdate, type UseInterruptConfig, type UseThreadsInput, type UseThreadsResult, defineToolCallRenderer, useAgent, useAgentContext, useCapabilities, useComponent, useConfigureSuggestions, useCopilotChatConfiguration, useCopilotKit, useFrontendTool, useFrontendTools, useHumanInTheLoop, useInterrupt, useRenderTool, useRenderToolCall, useSuggestions, useThreads, ɵuseOwnedCore };
|
|
1008
894
|
//# sourceMappingURL=headless.d.mts.map
|
package/dist/headless.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"headless.d.mts","names":[],"sources":["../src/providers/CopilotChatConfigurationProvider.tsx","../src/hooks/use-agent.tsx","../src/types/react-tool-call-renderer.ts","../src/types/frontend-tool.ts","../src/hooks/use-frontend-tool.tsx","../src/hooks/use-frontend-tools.tsx","../src/hooks/use-component.tsx","../src/types/human-in-the-loop.ts","../src/hooks/use-human-in-the-loop.tsx","../src/
|
|
1
|
+
{"version":3,"file":"headless.d.mts","names":[],"sources":["../src/providers/use-owned-core.ts","../src/providers/CopilotChatConfigurationProvider.tsx","../src/hooks/use-agent.tsx","../src/types/react-tool-call-renderer.ts","../src/types/frontend-tool.ts","../src/hooks/use-frontend-tool.tsx","../src/hooks/use-frontend-tools.tsx","../src/hooks/use-component.tsx","../src/types/human-in-the-loop.ts","../src/hooks/use-human-in-the-loop.tsx","../src/hooks/use-interrupt.tsx","../src/hooks/use-suggestions.tsx","../src/hooks/use-configure-suggestions.tsx","../src/hooks/use-agent-context.tsx","../src/hooks/use-threads.tsx","../src/hooks/use-render-tool.tsx","../src/hooks/use-render-tool-call.tsx","../src/types/defineToolCallRenderer.ts","../src/hooks/use-capabilities.tsx"],"mappings":";;;;;;;;;;;UAIU,UAAA;EACR,OAAA;AAAA;;;;;;AAJ4C;;;;;AAyB9C;;;;;;;;iBAAgB,aAAA,WAAwB,UAAA,CAAA,CACtC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