@copilotkitnext/react 0.0.8 → 0.0.9-alpha.1
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.mts +62 -19
- package/dist/index.d.ts +62 -19
- package/dist/index.js +290 -146
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +301 -158
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +6 -5
package/dist/index.d.mts
CHANGED
|
@@ -27,16 +27,14 @@ declare const CopilotChatDefaultLabels: {
|
|
|
27
27
|
type CopilotChatLabels = typeof CopilotChatDefaultLabels;
|
|
28
28
|
interface CopilotChatConfigurationValue {
|
|
29
29
|
labels: CopilotChatLabels;
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
onChangeInput?: (value: string) => void;
|
|
30
|
+
agentId: string;
|
|
31
|
+
threadId: string;
|
|
33
32
|
}
|
|
34
33
|
interface CopilotChatConfigurationProviderProps {
|
|
35
34
|
children: ReactNode;
|
|
36
35
|
labels?: Partial<CopilotChatLabels>;
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
onChangeInput?: (value: string) => void;
|
|
36
|
+
agentId?: string;
|
|
37
|
+
threadId: string;
|
|
40
38
|
}
|
|
41
39
|
declare const CopilotChatConfigurationProvider: React__default.FC<CopilotChatConfigurationProviderProps>;
|
|
42
40
|
declare const useCopilotChatConfiguration: () => CopilotChatConfigurationValue;
|
|
@@ -120,9 +118,9 @@ declare namespace CopilotChatInput {
|
|
|
120
118
|
type CopilotChatToolCallsViewProps = {
|
|
121
119
|
message: AssistantMessage;
|
|
122
120
|
messages?: Message[];
|
|
123
|
-
|
|
121
|
+
isRunning?: boolean;
|
|
124
122
|
};
|
|
125
|
-
declare function CopilotChatToolCallsView({ message, messages,
|
|
123
|
+
declare function CopilotChatToolCallsView({ message, messages, isRunning, }: CopilotChatToolCallsViewProps): react_jsx_runtime.JSX.Element | null;
|
|
126
124
|
|
|
127
125
|
type CopilotChatAssistantMessageProps = WithSlots<{
|
|
128
126
|
markdownRenderer: typeof CopilotChatAssistantMessage.MarkdownRenderer;
|
|
@@ -140,11 +138,11 @@ type CopilotChatAssistantMessageProps = WithSlots<{
|
|
|
140
138
|
onRegenerate?: (message: AssistantMessage) => void;
|
|
141
139
|
message: AssistantMessage;
|
|
142
140
|
messages?: Message[];
|
|
143
|
-
|
|
141
|
+
isRunning?: boolean;
|
|
144
142
|
additionalToolbarItems?: React.ReactNode;
|
|
145
143
|
toolbarVisible?: boolean;
|
|
146
144
|
} & React.HTMLAttributes<HTMLDivElement>>;
|
|
147
|
-
declare function CopilotChatAssistantMessage({ message, messages,
|
|
145
|
+
declare function CopilotChatAssistantMessage({ message, messages, isRunning, onThumbsUp, onThumbsDown, onReadAloud, onRegenerate, additionalToolbarItems, toolbarVisible, markdownRenderer, toolbar, copyButton, thumbsUpButton, thumbsDownButton, readAloudButton, regenerateButton, toolCallsView, children, className, ...props }: CopilotChatAssistantMessageProps): react_jsx_runtime.JSX.Element;
|
|
148
146
|
declare namespace CopilotChatAssistantMessage {
|
|
149
147
|
const MarkdownRenderer: React.FC<React.HTMLAttributes<HTMLDivElement> & {
|
|
150
148
|
content: string;
|
|
@@ -212,16 +210,16 @@ type CopilotChatMessageViewProps = Omit<WithSlots<{
|
|
|
212
210
|
userMessage: typeof CopilotChatUserMessage;
|
|
213
211
|
cursor: typeof CopilotChatMessageView.Cursor;
|
|
214
212
|
}, {
|
|
215
|
-
|
|
213
|
+
isRunning?: boolean;
|
|
216
214
|
messages?: Message[];
|
|
217
215
|
} & React.HTMLAttributes<HTMLDivElement>>, "children"> & {
|
|
218
216
|
children?: (props: {
|
|
219
|
-
|
|
217
|
+
isRunning: boolean;
|
|
220
218
|
messages: Message[];
|
|
221
219
|
messageElements: React.ReactElement[];
|
|
222
220
|
}) => React.ReactElement;
|
|
223
221
|
};
|
|
224
|
-
declare function CopilotChatMessageView({ messages, assistantMessage, userMessage, cursor,
|
|
222
|
+
declare function CopilotChatMessageView({ messages, assistantMessage, userMessage, cursor, isRunning, children, className, ...props }: CopilotChatMessageViewProps): react_jsx_runtime.JSX.Element;
|
|
225
223
|
declare namespace CopilotChatMessageView {
|
|
226
224
|
var Cursor: ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => react_jsx_runtime.JSX.Element;
|
|
227
225
|
}
|
|
@@ -239,8 +237,10 @@ type CopilotChatViewProps = WithSlots<{
|
|
|
239
237
|
}, {
|
|
240
238
|
messages?: Message[];
|
|
241
239
|
autoScroll?: boolean;
|
|
240
|
+
inputProps?: Partial<Omit<CopilotChatInputProps, "children">>;
|
|
241
|
+
isRunning?: boolean;
|
|
242
242
|
} & React__default.HTMLAttributes<HTMLDivElement>>;
|
|
243
|
-
declare function CopilotChatView({ messageView, input, scrollView, scrollToBottomButton, feather, inputContainer, disclaimer, messages, autoScroll, children, className, ...props }: CopilotChatViewProps): string | number | bigint | boolean | Iterable<React__default.ReactNode> | Promise<string | number | bigint | boolean | React__default.ReactPortal | React__default.ReactElement<unknown, string | React__default.JSXElementConstructor<any>> | Iterable<React__default.ReactNode> | null | undefined> | react_jsx_runtime.JSX.Element | null | undefined;
|
|
243
|
+
declare function CopilotChatView({ messageView, input, scrollView, scrollToBottomButton, feather, inputContainer, disclaimer, messages, autoScroll, inputProps, isRunning, children, className, ...props }: CopilotChatViewProps): string | number | bigint | boolean | Iterable<React__default.ReactNode> | Promise<string | number | bigint | boolean | React__default.ReactPortal | React__default.ReactElement<unknown, string | React__default.JSXElementConstructor<any>> | Iterable<React__default.ReactNode> | null | undefined> | react_jsx_runtime.JSX.Element | null | undefined;
|
|
244
244
|
declare namespace CopilotChatView {
|
|
245
245
|
const ScrollView: React__default.FC<React__default.HTMLAttributes<HTMLDivElement> & {
|
|
246
246
|
autoScroll?: boolean;
|
|
@@ -265,7 +265,7 @@ declare function CopilotChat({ agentId, threadId, ...props }: CopilotChatProps):
|
|
|
265
265
|
interface UseRenderToolCallProps {
|
|
266
266
|
toolCall: ToolCall;
|
|
267
267
|
toolMessage?: ToolMessage;
|
|
268
|
-
|
|
268
|
+
isRunning: boolean;
|
|
269
269
|
}
|
|
270
270
|
/**
|
|
271
271
|
* Hook that returns a function to render tool calls based on the render functions
|
|
@@ -273,7 +273,7 @@ interface UseRenderToolCallProps {
|
|
|
273
273
|
*
|
|
274
274
|
* @returns A function that takes a tool call and optional tool message and returns the rendered component
|
|
275
275
|
*/
|
|
276
|
-
declare function useRenderToolCall(): ({ toolCall, toolMessage,
|
|
276
|
+
declare function useRenderToolCall(): ({ toolCall, toolMessage, isRunning, }: UseRenderToolCallProps) => React__default.ReactElement | null;
|
|
277
277
|
|
|
278
278
|
interface ReactToolCallRender<T> {
|
|
279
279
|
name: string;
|
|
@@ -284,14 +284,17 @@ interface ReactToolCallRender<T> {
|
|
|
284
284
|
*/
|
|
285
285
|
agentId?: string;
|
|
286
286
|
render: React.ComponentType<{
|
|
287
|
+
name: string;
|
|
287
288
|
args: Partial<T>;
|
|
288
289
|
status: ToolCallStatus.InProgress;
|
|
289
290
|
result: undefined;
|
|
290
291
|
} | {
|
|
292
|
+
name: string;
|
|
291
293
|
args: T;
|
|
292
294
|
status: ToolCallStatus.Executing;
|
|
293
295
|
result: undefined;
|
|
294
296
|
} | {
|
|
297
|
+
name: string;
|
|
295
298
|
args: T;
|
|
296
299
|
status: ToolCallStatus.Complete;
|
|
297
300
|
result: string;
|
|
@@ -331,12 +334,17 @@ type ReactHumanInTheLoop<T extends Record<string, unknown> = Record<string, unkn
|
|
|
331
334
|
|
|
332
335
|
declare function useHumanInTheLoop<T extends Record<string, unknown> = Record<string, unknown>>(tool: ReactHumanInTheLoop<T>): void;
|
|
333
336
|
|
|
337
|
+
declare enum UseAgentUpdate {
|
|
338
|
+
OnMessagesChanged = "OnMessagesChanged",
|
|
339
|
+
OnStateChanged = "OnStateChanged",
|
|
340
|
+
OnRunStatusChanged = "OnRunStatusChanged"
|
|
341
|
+
}
|
|
334
342
|
interface UseAgentProps {
|
|
335
343
|
agentId?: string;
|
|
344
|
+
updates?: UseAgentUpdate[];
|
|
336
345
|
}
|
|
337
|
-
declare function useAgent({ agentId }?: UseAgentProps): {
|
|
346
|
+
declare function useAgent({ agentId, updates }?: UseAgentProps): {
|
|
338
347
|
agent: AbstractAgent | undefined;
|
|
339
|
-
isRunning: boolean;
|
|
340
348
|
};
|
|
341
349
|
|
|
342
350
|
declare function useAgentContext(context: Context): void;
|
|
@@ -360,4 +368,39 @@ interface CopilotKitProviderProps {
|
|
|
360
368
|
declare const CopilotKitProvider: React__default.FC<CopilotKitProviderProps>;
|
|
361
369
|
declare const useCopilotKit: () => CopilotKitContextValue;
|
|
362
370
|
|
|
363
|
-
|
|
371
|
+
/**
|
|
372
|
+
* Helper to define a type-safe tool call render entry.
|
|
373
|
+
* - Accepts a single object whose keys match ReactToolCallRender's fields: { name, args, render, agentId? }.
|
|
374
|
+
* - Derives `args` type from the provided Zod schema.
|
|
375
|
+
* - Ensures the render function param type exactly matches ReactToolCallRender<T>["render"]'s param.
|
|
376
|
+
* - For wildcard tools (name: "*"), args is optional and defaults to z.any()
|
|
377
|
+
*/
|
|
378
|
+
type RenderProps<T> = {
|
|
379
|
+
name: string;
|
|
380
|
+
args: Partial<T>;
|
|
381
|
+
status: ToolCallStatus.InProgress;
|
|
382
|
+
result: undefined;
|
|
383
|
+
} | {
|
|
384
|
+
name: string;
|
|
385
|
+
args: T;
|
|
386
|
+
status: ToolCallStatus.Executing;
|
|
387
|
+
result: undefined;
|
|
388
|
+
} | {
|
|
389
|
+
name: string;
|
|
390
|
+
args: T;
|
|
391
|
+
status: ToolCallStatus.Complete;
|
|
392
|
+
result: string;
|
|
393
|
+
};
|
|
394
|
+
declare function defineToolCallRender(def: {
|
|
395
|
+
name: "*";
|
|
396
|
+
render: (props: RenderProps<any>) => React__default.ReactElement;
|
|
397
|
+
agentId?: string;
|
|
398
|
+
}): ReactToolCallRender<any>;
|
|
399
|
+
declare function defineToolCallRender<S extends z.ZodTypeAny>(def: {
|
|
400
|
+
name: string;
|
|
401
|
+
args: S;
|
|
402
|
+
render: (props: RenderProps<z.infer<S>>) => React__default.ReactElement;
|
|
403
|
+
agentId?: string;
|
|
404
|
+
}): ReactToolCallRender<z.infer<S>>;
|
|
405
|
+
|
|
406
|
+
export { AudioRecorderError, type AudioRecorderState, CopilotChat, CopilotChatAssistantMessage, type CopilotChatAssistantMessageProps, CopilotChatAudioRecorder, CopilotChatConfigurationProvider, type CopilotChatConfigurationProviderProps, type CopilotChatConfigurationValue, CopilotChatInput, type CopilotChatInputProps, type CopilotChatLabels, CopilotChatMessageView, type CopilotChatMessageViewProps, type CopilotChatProps, CopilotChatToolCallsView, type CopilotChatToolCallsViewProps, CopilotChatUserMessage, type CopilotChatUserMessageProps, CopilotChatView, type CopilotChatViewProps, type CopilotKitContextValue, CopilotKitProvider, type CopilotKitProviderProps, type ReactFrontendTool, type ReactHumanInTheLoop, type ReactToolCallRender, type ToolsMenuItem, defineToolCallRender, useAgent, useAgentContext, useCopilotChatConfiguration, useCopilotKit, useFrontendTool, useHumanInTheLoop, useRenderToolCall };
|
package/dist/index.d.ts
CHANGED
|
@@ -27,16 +27,14 @@ declare const CopilotChatDefaultLabels: {
|
|
|
27
27
|
type CopilotChatLabels = typeof CopilotChatDefaultLabels;
|
|
28
28
|
interface CopilotChatConfigurationValue {
|
|
29
29
|
labels: CopilotChatLabels;
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
onChangeInput?: (value: string) => void;
|
|
30
|
+
agentId: string;
|
|
31
|
+
threadId: string;
|
|
33
32
|
}
|
|
34
33
|
interface CopilotChatConfigurationProviderProps {
|
|
35
34
|
children: ReactNode;
|
|
36
35
|
labels?: Partial<CopilotChatLabels>;
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
onChangeInput?: (value: string) => void;
|
|
36
|
+
agentId?: string;
|
|
37
|
+
threadId: string;
|
|
40
38
|
}
|
|
41
39
|
declare const CopilotChatConfigurationProvider: React__default.FC<CopilotChatConfigurationProviderProps>;
|
|
42
40
|
declare const useCopilotChatConfiguration: () => CopilotChatConfigurationValue;
|
|
@@ -120,9 +118,9 @@ declare namespace CopilotChatInput {
|
|
|
120
118
|
type CopilotChatToolCallsViewProps = {
|
|
121
119
|
message: AssistantMessage;
|
|
122
120
|
messages?: Message[];
|
|
123
|
-
|
|
121
|
+
isRunning?: boolean;
|
|
124
122
|
};
|
|
125
|
-
declare function CopilotChatToolCallsView({ message, messages,
|
|
123
|
+
declare function CopilotChatToolCallsView({ message, messages, isRunning, }: CopilotChatToolCallsViewProps): react_jsx_runtime.JSX.Element | null;
|
|
126
124
|
|
|
127
125
|
type CopilotChatAssistantMessageProps = WithSlots<{
|
|
128
126
|
markdownRenderer: typeof CopilotChatAssistantMessage.MarkdownRenderer;
|
|
@@ -140,11 +138,11 @@ type CopilotChatAssistantMessageProps = WithSlots<{
|
|
|
140
138
|
onRegenerate?: (message: AssistantMessage) => void;
|
|
141
139
|
message: AssistantMessage;
|
|
142
140
|
messages?: Message[];
|
|
143
|
-
|
|
141
|
+
isRunning?: boolean;
|
|
144
142
|
additionalToolbarItems?: React.ReactNode;
|
|
145
143
|
toolbarVisible?: boolean;
|
|
146
144
|
} & React.HTMLAttributes<HTMLDivElement>>;
|
|
147
|
-
declare function CopilotChatAssistantMessage({ message, messages,
|
|
145
|
+
declare function CopilotChatAssistantMessage({ message, messages, isRunning, onThumbsUp, onThumbsDown, onReadAloud, onRegenerate, additionalToolbarItems, toolbarVisible, markdownRenderer, toolbar, copyButton, thumbsUpButton, thumbsDownButton, readAloudButton, regenerateButton, toolCallsView, children, className, ...props }: CopilotChatAssistantMessageProps): react_jsx_runtime.JSX.Element;
|
|
148
146
|
declare namespace CopilotChatAssistantMessage {
|
|
149
147
|
const MarkdownRenderer: React.FC<React.HTMLAttributes<HTMLDivElement> & {
|
|
150
148
|
content: string;
|
|
@@ -212,16 +210,16 @@ type CopilotChatMessageViewProps = Omit<WithSlots<{
|
|
|
212
210
|
userMessage: typeof CopilotChatUserMessage;
|
|
213
211
|
cursor: typeof CopilotChatMessageView.Cursor;
|
|
214
212
|
}, {
|
|
215
|
-
|
|
213
|
+
isRunning?: boolean;
|
|
216
214
|
messages?: Message[];
|
|
217
215
|
} & React.HTMLAttributes<HTMLDivElement>>, "children"> & {
|
|
218
216
|
children?: (props: {
|
|
219
|
-
|
|
217
|
+
isRunning: boolean;
|
|
220
218
|
messages: Message[];
|
|
221
219
|
messageElements: React.ReactElement[];
|
|
222
220
|
}) => React.ReactElement;
|
|
223
221
|
};
|
|
224
|
-
declare function CopilotChatMessageView({ messages, assistantMessage, userMessage, cursor,
|
|
222
|
+
declare function CopilotChatMessageView({ messages, assistantMessage, userMessage, cursor, isRunning, children, className, ...props }: CopilotChatMessageViewProps): react_jsx_runtime.JSX.Element;
|
|
225
223
|
declare namespace CopilotChatMessageView {
|
|
226
224
|
var Cursor: ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => react_jsx_runtime.JSX.Element;
|
|
227
225
|
}
|
|
@@ -239,8 +237,10 @@ type CopilotChatViewProps = WithSlots<{
|
|
|
239
237
|
}, {
|
|
240
238
|
messages?: Message[];
|
|
241
239
|
autoScroll?: boolean;
|
|
240
|
+
inputProps?: Partial<Omit<CopilotChatInputProps, "children">>;
|
|
241
|
+
isRunning?: boolean;
|
|
242
242
|
} & React__default.HTMLAttributes<HTMLDivElement>>;
|
|
243
|
-
declare function CopilotChatView({ messageView, input, scrollView, scrollToBottomButton, feather, inputContainer, disclaimer, messages, autoScroll, children, className, ...props }: CopilotChatViewProps): string | number | bigint | boolean | Iterable<React__default.ReactNode> | Promise<string | number | bigint | boolean | React__default.ReactPortal | React__default.ReactElement<unknown, string | React__default.JSXElementConstructor<any>> | Iterable<React__default.ReactNode> | null | undefined> | react_jsx_runtime.JSX.Element | null | undefined;
|
|
243
|
+
declare function CopilotChatView({ messageView, input, scrollView, scrollToBottomButton, feather, inputContainer, disclaimer, messages, autoScroll, inputProps, isRunning, children, className, ...props }: CopilotChatViewProps): string | number | bigint | boolean | Iterable<React__default.ReactNode> | Promise<string | number | bigint | boolean | React__default.ReactPortal | React__default.ReactElement<unknown, string | React__default.JSXElementConstructor<any>> | Iterable<React__default.ReactNode> | null | undefined> | react_jsx_runtime.JSX.Element | null | undefined;
|
|
244
244
|
declare namespace CopilotChatView {
|
|
245
245
|
const ScrollView: React__default.FC<React__default.HTMLAttributes<HTMLDivElement> & {
|
|
246
246
|
autoScroll?: boolean;
|
|
@@ -265,7 +265,7 @@ declare function CopilotChat({ agentId, threadId, ...props }: CopilotChatProps):
|
|
|
265
265
|
interface UseRenderToolCallProps {
|
|
266
266
|
toolCall: ToolCall;
|
|
267
267
|
toolMessage?: ToolMessage;
|
|
268
|
-
|
|
268
|
+
isRunning: boolean;
|
|
269
269
|
}
|
|
270
270
|
/**
|
|
271
271
|
* Hook that returns a function to render tool calls based on the render functions
|
|
@@ -273,7 +273,7 @@ interface UseRenderToolCallProps {
|
|
|
273
273
|
*
|
|
274
274
|
* @returns A function that takes a tool call and optional tool message and returns the rendered component
|
|
275
275
|
*/
|
|
276
|
-
declare function useRenderToolCall(): ({ toolCall, toolMessage,
|
|
276
|
+
declare function useRenderToolCall(): ({ toolCall, toolMessage, isRunning, }: UseRenderToolCallProps) => React__default.ReactElement | null;
|
|
277
277
|
|
|
278
278
|
interface ReactToolCallRender<T> {
|
|
279
279
|
name: string;
|
|
@@ -284,14 +284,17 @@ interface ReactToolCallRender<T> {
|
|
|
284
284
|
*/
|
|
285
285
|
agentId?: string;
|
|
286
286
|
render: React.ComponentType<{
|
|
287
|
+
name: string;
|
|
287
288
|
args: Partial<T>;
|
|
288
289
|
status: ToolCallStatus.InProgress;
|
|
289
290
|
result: undefined;
|
|
290
291
|
} | {
|
|
292
|
+
name: string;
|
|
291
293
|
args: T;
|
|
292
294
|
status: ToolCallStatus.Executing;
|
|
293
295
|
result: undefined;
|
|
294
296
|
} | {
|
|
297
|
+
name: string;
|
|
295
298
|
args: T;
|
|
296
299
|
status: ToolCallStatus.Complete;
|
|
297
300
|
result: string;
|
|
@@ -331,12 +334,17 @@ type ReactHumanInTheLoop<T extends Record<string, unknown> = Record<string, unkn
|
|
|
331
334
|
|
|
332
335
|
declare function useHumanInTheLoop<T extends Record<string, unknown> = Record<string, unknown>>(tool: ReactHumanInTheLoop<T>): void;
|
|
333
336
|
|
|
337
|
+
declare enum UseAgentUpdate {
|
|
338
|
+
OnMessagesChanged = "OnMessagesChanged",
|
|
339
|
+
OnStateChanged = "OnStateChanged",
|
|
340
|
+
OnRunStatusChanged = "OnRunStatusChanged"
|
|
341
|
+
}
|
|
334
342
|
interface UseAgentProps {
|
|
335
343
|
agentId?: string;
|
|
344
|
+
updates?: UseAgentUpdate[];
|
|
336
345
|
}
|
|
337
|
-
declare function useAgent({ agentId }?: UseAgentProps): {
|
|
346
|
+
declare function useAgent({ agentId, updates }?: UseAgentProps): {
|
|
338
347
|
agent: AbstractAgent | undefined;
|
|
339
|
-
isRunning: boolean;
|
|
340
348
|
};
|
|
341
349
|
|
|
342
350
|
declare function useAgentContext(context: Context): void;
|
|
@@ -360,4 +368,39 @@ interface CopilotKitProviderProps {
|
|
|
360
368
|
declare const CopilotKitProvider: React__default.FC<CopilotKitProviderProps>;
|
|
361
369
|
declare const useCopilotKit: () => CopilotKitContextValue;
|
|
362
370
|
|
|
363
|
-
|
|
371
|
+
/**
|
|
372
|
+
* Helper to define a type-safe tool call render entry.
|
|
373
|
+
* - Accepts a single object whose keys match ReactToolCallRender's fields: { name, args, render, agentId? }.
|
|
374
|
+
* - Derives `args` type from the provided Zod schema.
|
|
375
|
+
* - Ensures the render function param type exactly matches ReactToolCallRender<T>["render"]'s param.
|
|
376
|
+
* - For wildcard tools (name: "*"), args is optional and defaults to z.any()
|
|
377
|
+
*/
|
|
378
|
+
type RenderProps<T> = {
|
|
379
|
+
name: string;
|
|
380
|
+
args: Partial<T>;
|
|
381
|
+
status: ToolCallStatus.InProgress;
|
|
382
|
+
result: undefined;
|
|
383
|
+
} | {
|
|
384
|
+
name: string;
|
|
385
|
+
args: T;
|
|
386
|
+
status: ToolCallStatus.Executing;
|
|
387
|
+
result: undefined;
|
|
388
|
+
} | {
|
|
389
|
+
name: string;
|
|
390
|
+
args: T;
|
|
391
|
+
status: ToolCallStatus.Complete;
|
|
392
|
+
result: string;
|
|
393
|
+
};
|
|
394
|
+
declare function defineToolCallRender(def: {
|
|
395
|
+
name: "*";
|
|
396
|
+
render: (props: RenderProps<any>) => React__default.ReactElement;
|
|
397
|
+
agentId?: string;
|
|
398
|
+
}): ReactToolCallRender<any>;
|
|
399
|
+
declare function defineToolCallRender<S extends z.ZodTypeAny>(def: {
|
|
400
|
+
name: string;
|
|
401
|
+
args: S;
|
|
402
|
+
render: (props: RenderProps<z.infer<S>>) => React__default.ReactElement;
|
|
403
|
+
agentId?: string;
|
|
404
|
+
}): ReactToolCallRender<z.infer<S>>;
|
|
405
|
+
|
|
406
|
+
export { AudioRecorderError, type AudioRecorderState, CopilotChat, CopilotChatAssistantMessage, type CopilotChatAssistantMessageProps, CopilotChatAudioRecorder, CopilotChatConfigurationProvider, type CopilotChatConfigurationProviderProps, type CopilotChatConfigurationValue, CopilotChatInput, type CopilotChatInputProps, type CopilotChatLabels, CopilotChatMessageView, type CopilotChatMessageViewProps, type CopilotChatProps, CopilotChatToolCallsView, type CopilotChatToolCallsViewProps, CopilotChatUserMessage, type CopilotChatUserMessageProps, CopilotChatView, type CopilotChatViewProps, type CopilotKitContextValue, CopilotKitProvider, type CopilotKitProviderProps, type ReactFrontendTool, type ReactHumanInTheLoop, type ReactToolCallRender, type ToolsMenuItem, defineToolCallRender, useAgent, useAgentContext, useCopilotChatConfiguration, useCopilotKit, useFrontendTool, useHumanInTheLoop, useRenderToolCall };
|