@copilotkitnext/react 0.0.13-alpha.0 → 0.0.13
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 +83 -33
- package/dist/index.d.ts +83 -33
- package/dist/index.js +486 -325
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +449 -278
- package/dist/index.mjs.map +1 -1
- package/package.json +7 -5
package/dist/index.d.mts
CHANGED
|
@@ -2,8 +2,10 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
|
2
2
|
import * as React$1 from 'react';
|
|
3
3
|
import React__default, { ReactNode } from 'react';
|
|
4
4
|
import { AssistantMessage, Message, UserMessage, ToolCall, ToolMessage } from '@ag-ui/core';
|
|
5
|
-
import { Suggestion, ToolCallStatus, FrontendTool, DynamicSuggestionsConfig, StaticSuggestionsConfig,
|
|
5
|
+
import { Suggestion, CopilotKitCore, ToolCallStatus, FrontendTool, DynamicSuggestionsConfig, StaticSuggestionsConfig, CopilotKitCoreConfig, CopilotKitCoreSubscriber } from '@copilotkitnext/core';
|
|
6
6
|
import { z } from 'zod';
|
|
7
|
+
import * as _lit_labs_react from '@lit-labs/react';
|
|
8
|
+
import { WebInspectorElement } from '@copilotkitnext/web-inspector';
|
|
7
9
|
import { AbstractAgent, Context } from '@ag-ui/client';
|
|
8
10
|
|
|
9
11
|
declare const CopilotChatDefaultLabels: {
|
|
@@ -359,7 +361,14 @@ declare namespace CopilotSidebar {
|
|
|
359
361
|
var displayName: string;
|
|
360
362
|
}
|
|
361
363
|
|
|
362
|
-
declare const WildcardToolCallRender:
|
|
364
|
+
declare const WildcardToolCallRender: ReactToolCallRenderer<any>;
|
|
365
|
+
|
|
366
|
+
declare const WebInspectorBase: _lit_labs_react.ReactWebComponent<WebInspectorElement, {}>;
|
|
367
|
+
type WebInspectorBaseProps = React$1.ComponentProps<typeof WebInspectorBase>;
|
|
368
|
+
interface WebInspectorProps extends Omit<WebInspectorBaseProps, "core"> {
|
|
369
|
+
core?: CopilotKitCore | null;
|
|
370
|
+
}
|
|
371
|
+
declare const WebInspector: React$1.ForwardRefExoticComponent<Omit<WebInspectorProps, "ref"> & React$1.RefAttributes<WebInspectorElement>>;
|
|
363
372
|
|
|
364
373
|
interface UseRenderToolCallProps {
|
|
365
374
|
toolCall: ToolCall;
|
|
@@ -373,12 +382,33 @@ interface UseRenderToolCallProps {
|
|
|
373
382
|
*/
|
|
374
383
|
declare function useRenderToolCall(): ({ toolCall, toolMessage, }: UseRenderToolCallProps) => React__default.ReactElement | null;
|
|
375
384
|
|
|
376
|
-
|
|
385
|
+
type ReactCustomMessageRendererPosition = "before" | "after";
|
|
386
|
+
interface ReactCustomMessageRenderer {
|
|
387
|
+
agentId?: string;
|
|
388
|
+
render: React.ComponentType<{
|
|
389
|
+
message: Message;
|
|
390
|
+
position: ReactCustomMessageRendererPosition;
|
|
391
|
+
runId: string;
|
|
392
|
+
messageIndex: number;
|
|
393
|
+
messageIndexInRun: number;
|
|
394
|
+
numberOfMessagesInRun: number;
|
|
395
|
+
agentId: string;
|
|
396
|
+
stateSnapshot: any;
|
|
397
|
+
}> | null;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
interface UseRenderCustomMessagesParams {
|
|
401
|
+
message: Message;
|
|
402
|
+
position: ReactCustomMessageRendererPosition;
|
|
403
|
+
}
|
|
404
|
+
declare function useRenderCustomMessages(): ((params: UseRenderCustomMessagesParams) => react_jsx_runtime.JSX.Element | null) | null;
|
|
405
|
+
|
|
406
|
+
interface ReactToolCallRenderer<T> {
|
|
377
407
|
name: string;
|
|
378
408
|
args: z.ZodSchema<T>;
|
|
379
409
|
/**
|
|
380
|
-
* Optional agent ID to constrain this tool
|
|
381
|
-
* If specified, this
|
|
410
|
+
* Optional agent ID to constrain this tool renderer to a specific agent.
|
|
411
|
+
* If specified, this renderer will only be used for the specified agent.
|
|
382
412
|
*/
|
|
383
413
|
agentId?: string;
|
|
384
414
|
render: React.ComponentType<{
|
|
@@ -400,7 +430,7 @@ interface ReactToolCallRender<T> {
|
|
|
400
430
|
}
|
|
401
431
|
|
|
402
432
|
type ReactFrontendTool<T extends Record<string, unknown> = Record<string, unknown>> = FrontendTool<T> & {
|
|
403
|
-
render?:
|
|
433
|
+
render?: ReactToolCallRenderer<T>["render"];
|
|
404
434
|
};
|
|
405
435
|
|
|
406
436
|
declare function useFrontendTool<T extends Record<string, unknown> = Record<string, unknown>>(tool: ReactFrontendTool<T>): void;
|
|
@@ -468,30 +498,11 @@ interface UseConfigureSuggestionsOptions {
|
|
|
468
498
|
}
|
|
469
499
|
declare function useConfigureSuggestions(config: SuggestionsConfigInput | null | undefined, options?: UseConfigureSuggestionsOptions): void;
|
|
470
500
|
|
|
471
|
-
interface CopilotKitContextValue {
|
|
472
|
-
copilotkit: CopilotKitCore;
|
|
473
|
-
renderToolCalls: ReactToolCallRender<any>[];
|
|
474
|
-
currentRenderToolCalls: ReactToolCallRender<unknown>[];
|
|
475
|
-
setCurrentRenderToolCalls: React__default.Dispatch<React__default.SetStateAction<ReactToolCallRender<unknown>[]>>;
|
|
476
|
-
}
|
|
477
|
-
interface CopilotKitProviderProps {
|
|
478
|
-
children: ReactNode;
|
|
479
|
-
runtimeUrl?: string;
|
|
480
|
-
headers?: Record<string, string>;
|
|
481
|
-
properties?: Record<string, unknown>;
|
|
482
|
-
agents__unsafe_dev_only?: Record<string, AbstractAgent>;
|
|
483
|
-
renderToolCalls?: ReactToolCallRender<any>[];
|
|
484
|
-
frontendTools?: ReactFrontendTool[];
|
|
485
|
-
humanInTheLoop?: ReactHumanInTheLoop[];
|
|
486
|
-
}
|
|
487
|
-
declare const CopilotKitProvider: React__default.FC<CopilotKitProviderProps>;
|
|
488
|
-
declare const useCopilotKit: () => CopilotKitContextValue;
|
|
489
|
-
|
|
490
501
|
/**
|
|
491
|
-
* Helper to define a type-safe tool call
|
|
492
|
-
* - Accepts a single object whose keys match
|
|
502
|
+
* Helper to define a type-safe tool call renderer entry.
|
|
503
|
+
* - Accepts a single object whose keys match ReactToolCallRenderer's fields: { name, args, render, agentId? }.
|
|
493
504
|
* - Derives `args` type from the provided Zod schema.
|
|
494
|
-
* - Ensures the render function param type exactly matches
|
|
505
|
+
* - Ensures the render function param type exactly matches ReactToolCallRenderer<T>["render"]'s param.
|
|
495
506
|
* - For wildcard tools (name: "*"), args is optional and defaults to z.any()
|
|
496
507
|
*/
|
|
497
508
|
type RenderProps<T> = {
|
|
@@ -510,16 +521,55 @@ type RenderProps<T> = {
|
|
|
510
521
|
status: ToolCallStatus.Complete;
|
|
511
522
|
result: string;
|
|
512
523
|
};
|
|
513
|
-
declare function
|
|
524
|
+
declare function defineToolCallRenderer(def: {
|
|
514
525
|
name: "*";
|
|
515
526
|
render: (props: RenderProps<any>) => React__default.ReactElement;
|
|
516
527
|
agentId?: string;
|
|
517
|
-
}):
|
|
518
|
-
declare function
|
|
528
|
+
}): ReactToolCallRenderer<any>;
|
|
529
|
+
declare function defineToolCallRenderer<S extends z.ZodTypeAny>(def: {
|
|
519
530
|
name: string;
|
|
520
531
|
args: S;
|
|
521
532
|
render: (props: RenderProps<z.infer<S>>) => React__default.ReactElement;
|
|
522
533
|
agentId?: string;
|
|
523
|
-
}):
|
|
534
|
+
}): ReactToolCallRenderer<z.infer<S>>;
|
|
535
|
+
|
|
536
|
+
interface CopilotKitCoreReactConfig extends CopilotKitCoreConfig {
|
|
537
|
+
renderToolCalls?: ReactToolCallRenderer<any>[];
|
|
538
|
+
renderCustomMessages?: ReactCustomMessageRenderer[];
|
|
539
|
+
}
|
|
540
|
+
interface CopilotKitCoreReactSubscriber extends CopilotKitCoreSubscriber {
|
|
541
|
+
onRenderToolCallsChanged?: (event: {
|
|
542
|
+
copilotkit: CopilotKitCore;
|
|
543
|
+
renderToolCalls: ReactToolCallRenderer<any>[];
|
|
544
|
+
}) => void | Promise<void>;
|
|
545
|
+
}
|
|
546
|
+
declare class CopilotKitCoreReact extends CopilotKitCore {
|
|
547
|
+
private _renderToolCalls;
|
|
548
|
+
private _renderCustomMessages;
|
|
549
|
+
constructor(config: CopilotKitCoreReactConfig);
|
|
550
|
+
get renderCustomMessages(): Readonly<ReactCustomMessageRenderer[]>;
|
|
551
|
+
get renderToolCalls(): Readonly<ReactToolCallRenderer<any>>[];
|
|
552
|
+
setRenderToolCalls(renderToolCalls: ReactToolCallRenderer<any>[]): void;
|
|
553
|
+
subscribe(subscriber: CopilotKitCoreReactSubscriber): () => void;
|
|
554
|
+
unsubscribe(subscriber: CopilotKitCoreReactSubscriber): void;
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
interface CopilotKitContextValue {
|
|
558
|
+
copilotkit: CopilotKitCoreReact;
|
|
559
|
+
}
|
|
560
|
+
interface CopilotKitProviderProps {
|
|
561
|
+
children: ReactNode;
|
|
562
|
+
runtimeUrl?: string;
|
|
563
|
+
headers?: Record<string, string>;
|
|
564
|
+
properties?: Record<string, unknown>;
|
|
565
|
+
agents__unsafe_dev_only?: Record<string, AbstractAgent>;
|
|
566
|
+
renderToolCalls?: ReactToolCallRenderer<any>[];
|
|
567
|
+
renderCustomMessages?: ReactCustomMessageRenderer[];
|
|
568
|
+
frontendTools?: ReactFrontendTool[];
|
|
569
|
+
humanInTheLoop?: ReactHumanInTheLoop[];
|
|
570
|
+
showDevConsole?: boolean | "auto";
|
|
571
|
+
}
|
|
572
|
+
declare const CopilotKitProvider: React__default.FC<CopilotKitProviderProps>;
|
|
573
|
+
declare const useCopilotKit: () => CopilotKitContextValue;
|
|
524
574
|
|
|
525
|
-
export { AudioRecorderError, type AudioRecorderState, CopilotChat, CopilotChatAssistantMessage, type CopilotChatAssistantMessageProps, CopilotChatAudioRecorder, CopilotChatConfigurationProvider, type CopilotChatConfigurationProviderProps, type CopilotChatConfigurationValue, CopilotChatInput, type CopilotChatInputProps, type CopilotChatLabels, CopilotChatMessageView, type CopilotChatMessageViewProps, type CopilotChatProps, CopilotChatSuggestionPill, type CopilotChatSuggestionPillProps, CopilotChatSuggestionView, type CopilotChatSuggestionViewProps, CopilotChatToggleButton, DefaultCloseIcon as CopilotChatToggleButtonCloseIcon, DefaultOpenIcon as CopilotChatToggleButtonOpenIcon, type CopilotChatToggleButtonProps, CopilotChatToolCallsView, type CopilotChatToolCallsViewProps, CopilotChatUserMessage, type CopilotChatUserMessageProps, CopilotChatView, type CopilotChatViewProps, type CopilotKitContextValue, CopilotKitProvider, type CopilotKitProviderProps, CopilotModalHeader, type CopilotModalHeaderProps, CopilotSidebar, type CopilotSidebarProps, CopilotSidebarView, type CopilotSidebarViewProps, type ReactFrontendTool, type ReactHumanInTheLoop, type
|
|
575
|
+
export { AudioRecorderError, type AudioRecorderState, CopilotChat, CopilotChatAssistantMessage, type CopilotChatAssistantMessageProps, CopilotChatAudioRecorder, CopilotChatConfigurationProvider, type CopilotChatConfigurationProviderProps, type CopilotChatConfigurationValue, CopilotChatInput, type CopilotChatInputProps, type CopilotChatLabels, CopilotChatMessageView, type CopilotChatMessageViewProps, type CopilotChatProps, CopilotChatSuggestionPill, type CopilotChatSuggestionPillProps, CopilotChatSuggestionView, type CopilotChatSuggestionViewProps, CopilotChatToggleButton, DefaultCloseIcon as CopilotChatToggleButtonCloseIcon, DefaultOpenIcon as CopilotChatToggleButtonOpenIcon, type CopilotChatToggleButtonProps, CopilotChatToolCallsView, type CopilotChatToolCallsViewProps, CopilotChatUserMessage, type CopilotChatUserMessageProps, CopilotChatView, type CopilotChatViewProps, type CopilotKitContextValue, CopilotKitCoreReact, type CopilotKitCoreReactConfig, type CopilotKitCoreReactSubscriber, CopilotKitProvider, type CopilotKitProviderProps, CopilotModalHeader, type CopilotModalHeaderProps, CopilotSidebar, type CopilotSidebarProps, CopilotSidebarView, type CopilotSidebarViewProps, type ReactCustomMessageRenderer, type ReactCustomMessageRendererPosition, type ReactFrontendTool, type ReactHumanInTheLoop, type ReactToolCallRenderer, type ToolsMenuItem, WebInspector, type WebInspectorBaseProps, type WebInspectorProps, WildcardToolCallRender, defineToolCallRenderer, useAgent, useAgentContext, useConfigureSuggestions, useCopilotChatConfiguration, useCopilotKit, useFrontendTool, useHumanInTheLoop, useRenderCustomMessages, useRenderToolCall, useSuggestions };
|
package/dist/index.d.ts
CHANGED
|
@@ -2,8 +2,10 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
|
2
2
|
import * as React$1 from 'react';
|
|
3
3
|
import React__default, { ReactNode } from 'react';
|
|
4
4
|
import { AssistantMessage, Message, UserMessage, ToolCall, ToolMessage } from '@ag-ui/core';
|
|
5
|
-
import { Suggestion, ToolCallStatus, FrontendTool, DynamicSuggestionsConfig, StaticSuggestionsConfig,
|
|
5
|
+
import { Suggestion, CopilotKitCore, ToolCallStatus, FrontendTool, DynamicSuggestionsConfig, StaticSuggestionsConfig, CopilotKitCoreConfig, CopilotKitCoreSubscriber } from '@copilotkitnext/core';
|
|
6
6
|
import { z } from 'zod';
|
|
7
|
+
import * as _lit_labs_react from '@lit-labs/react';
|
|
8
|
+
import { WebInspectorElement } from '@copilotkitnext/web-inspector';
|
|
7
9
|
import { AbstractAgent, Context } from '@ag-ui/client';
|
|
8
10
|
|
|
9
11
|
declare const CopilotChatDefaultLabels: {
|
|
@@ -359,7 +361,14 @@ declare namespace CopilotSidebar {
|
|
|
359
361
|
var displayName: string;
|
|
360
362
|
}
|
|
361
363
|
|
|
362
|
-
declare const WildcardToolCallRender:
|
|
364
|
+
declare const WildcardToolCallRender: ReactToolCallRenderer<any>;
|
|
365
|
+
|
|
366
|
+
declare const WebInspectorBase: _lit_labs_react.ReactWebComponent<WebInspectorElement, {}>;
|
|
367
|
+
type WebInspectorBaseProps = React$1.ComponentProps<typeof WebInspectorBase>;
|
|
368
|
+
interface WebInspectorProps extends Omit<WebInspectorBaseProps, "core"> {
|
|
369
|
+
core?: CopilotKitCore | null;
|
|
370
|
+
}
|
|
371
|
+
declare const WebInspector: React$1.ForwardRefExoticComponent<Omit<WebInspectorProps, "ref"> & React$1.RefAttributes<WebInspectorElement>>;
|
|
363
372
|
|
|
364
373
|
interface UseRenderToolCallProps {
|
|
365
374
|
toolCall: ToolCall;
|
|
@@ -373,12 +382,33 @@ interface UseRenderToolCallProps {
|
|
|
373
382
|
*/
|
|
374
383
|
declare function useRenderToolCall(): ({ toolCall, toolMessage, }: UseRenderToolCallProps) => React__default.ReactElement | null;
|
|
375
384
|
|
|
376
|
-
|
|
385
|
+
type ReactCustomMessageRendererPosition = "before" | "after";
|
|
386
|
+
interface ReactCustomMessageRenderer {
|
|
387
|
+
agentId?: string;
|
|
388
|
+
render: React.ComponentType<{
|
|
389
|
+
message: Message;
|
|
390
|
+
position: ReactCustomMessageRendererPosition;
|
|
391
|
+
runId: string;
|
|
392
|
+
messageIndex: number;
|
|
393
|
+
messageIndexInRun: number;
|
|
394
|
+
numberOfMessagesInRun: number;
|
|
395
|
+
agentId: string;
|
|
396
|
+
stateSnapshot: any;
|
|
397
|
+
}> | null;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
interface UseRenderCustomMessagesParams {
|
|
401
|
+
message: Message;
|
|
402
|
+
position: ReactCustomMessageRendererPosition;
|
|
403
|
+
}
|
|
404
|
+
declare function useRenderCustomMessages(): ((params: UseRenderCustomMessagesParams) => react_jsx_runtime.JSX.Element | null) | null;
|
|
405
|
+
|
|
406
|
+
interface ReactToolCallRenderer<T> {
|
|
377
407
|
name: string;
|
|
378
408
|
args: z.ZodSchema<T>;
|
|
379
409
|
/**
|
|
380
|
-
* Optional agent ID to constrain this tool
|
|
381
|
-
* If specified, this
|
|
410
|
+
* Optional agent ID to constrain this tool renderer to a specific agent.
|
|
411
|
+
* If specified, this renderer will only be used for the specified agent.
|
|
382
412
|
*/
|
|
383
413
|
agentId?: string;
|
|
384
414
|
render: React.ComponentType<{
|
|
@@ -400,7 +430,7 @@ interface ReactToolCallRender<T> {
|
|
|
400
430
|
}
|
|
401
431
|
|
|
402
432
|
type ReactFrontendTool<T extends Record<string, unknown> = Record<string, unknown>> = FrontendTool<T> & {
|
|
403
|
-
render?:
|
|
433
|
+
render?: ReactToolCallRenderer<T>["render"];
|
|
404
434
|
};
|
|
405
435
|
|
|
406
436
|
declare function useFrontendTool<T extends Record<string, unknown> = Record<string, unknown>>(tool: ReactFrontendTool<T>): void;
|
|
@@ -468,30 +498,11 @@ interface UseConfigureSuggestionsOptions {
|
|
|
468
498
|
}
|
|
469
499
|
declare function useConfigureSuggestions(config: SuggestionsConfigInput | null | undefined, options?: UseConfigureSuggestionsOptions): void;
|
|
470
500
|
|
|
471
|
-
interface CopilotKitContextValue {
|
|
472
|
-
copilotkit: CopilotKitCore;
|
|
473
|
-
renderToolCalls: ReactToolCallRender<any>[];
|
|
474
|
-
currentRenderToolCalls: ReactToolCallRender<unknown>[];
|
|
475
|
-
setCurrentRenderToolCalls: React__default.Dispatch<React__default.SetStateAction<ReactToolCallRender<unknown>[]>>;
|
|
476
|
-
}
|
|
477
|
-
interface CopilotKitProviderProps {
|
|
478
|
-
children: ReactNode;
|
|
479
|
-
runtimeUrl?: string;
|
|
480
|
-
headers?: Record<string, string>;
|
|
481
|
-
properties?: Record<string, unknown>;
|
|
482
|
-
agents__unsafe_dev_only?: Record<string, AbstractAgent>;
|
|
483
|
-
renderToolCalls?: ReactToolCallRender<any>[];
|
|
484
|
-
frontendTools?: ReactFrontendTool[];
|
|
485
|
-
humanInTheLoop?: ReactHumanInTheLoop[];
|
|
486
|
-
}
|
|
487
|
-
declare const CopilotKitProvider: React__default.FC<CopilotKitProviderProps>;
|
|
488
|
-
declare const useCopilotKit: () => CopilotKitContextValue;
|
|
489
|
-
|
|
490
501
|
/**
|
|
491
|
-
* Helper to define a type-safe tool call
|
|
492
|
-
* - Accepts a single object whose keys match
|
|
502
|
+
* Helper to define a type-safe tool call renderer entry.
|
|
503
|
+
* - Accepts a single object whose keys match ReactToolCallRenderer's fields: { name, args, render, agentId? }.
|
|
493
504
|
* - Derives `args` type from the provided Zod schema.
|
|
494
|
-
* - Ensures the render function param type exactly matches
|
|
505
|
+
* - Ensures the render function param type exactly matches ReactToolCallRenderer<T>["render"]'s param.
|
|
495
506
|
* - For wildcard tools (name: "*"), args is optional and defaults to z.any()
|
|
496
507
|
*/
|
|
497
508
|
type RenderProps<T> = {
|
|
@@ -510,16 +521,55 @@ type RenderProps<T> = {
|
|
|
510
521
|
status: ToolCallStatus.Complete;
|
|
511
522
|
result: string;
|
|
512
523
|
};
|
|
513
|
-
declare function
|
|
524
|
+
declare function defineToolCallRenderer(def: {
|
|
514
525
|
name: "*";
|
|
515
526
|
render: (props: RenderProps<any>) => React__default.ReactElement;
|
|
516
527
|
agentId?: string;
|
|
517
|
-
}):
|
|
518
|
-
declare function
|
|
528
|
+
}): ReactToolCallRenderer<any>;
|
|
529
|
+
declare function defineToolCallRenderer<S extends z.ZodTypeAny>(def: {
|
|
519
530
|
name: string;
|
|
520
531
|
args: S;
|
|
521
532
|
render: (props: RenderProps<z.infer<S>>) => React__default.ReactElement;
|
|
522
533
|
agentId?: string;
|
|
523
|
-
}):
|
|
534
|
+
}): ReactToolCallRenderer<z.infer<S>>;
|
|
535
|
+
|
|
536
|
+
interface CopilotKitCoreReactConfig extends CopilotKitCoreConfig {
|
|
537
|
+
renderToolCalls?: ReactToolCallRenderer<any>[];
|
|
538
|
+
renderCustomMessages?: ReactCustomMessageRenderer[];
|
|
539
|
+
}
|
|
540
|
+
interface CopilotKitCoreReactSubscriber extends CopilotKitCoreSubscriber {
|
|
541
|
+
onRenderToolCallsChanged?: (event: {
|
|
542
|
+
copilotkit: CopilotKitCore;
|
|
543
|
+
renderToolCalls: ReactToolCallRenderer<any>[];
|
|
544
|
+
}) => void | Promise<void>;
|
|
545
|
+
}
|
|
546
|
+
declare class CopilotKitCoreReact extends CopilotKitCore {
|
|
547
|
+
private _renderToolCalls;
|
|
548
|
+
private _renderCustomMessages;
|
|
549
|
+
constructor(config: CopilotKitCoreReactConfig);
|
|
550
|
+
get renderCustomMessages(): Readonly<ReactCustomMessageRenderer[]>;
|
|
551
|
+
get renderToolCalls(): Readonly<ReactToolCallRenderer<any>>[];
|
|
552
|
+
setRenderToolCalls(renderToolCalls: ReactToolCallRenderer<any>[]): void;
|
|
553
|
+
subscribe(subscriber: CopilotKitCoreReactSubscriber): () => void;
|
|
554
|
+
unsubscribe(subscriber: CopilotKitCoreReactSubscriber): void;
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
interface CopilotKitContextValue {
|
|
558
|
+
copilotkit: CopilotKitCoreReact;
|
|
559
|
+
}
|
|
560
|
+
interface CopilotKitProviderProps {
|
|
561
|
+
children: ReactNode;
|
|
562
|
+
runtimeUrl?: string;
|
|
563
|
+
headers?: Record<string, string>;
|
|
564
|
+
properties?: Record<string, unknown>;
|
|
565
|
+
agents__unsafe_dev_only?: Record<string, AbstractAgent>;
|
|
566
|
+
renderToolCalls?: ReactToolCallRenderer<any>[];
|
|
567
|
+
renderCustomMessages?: ReactCustomMessageRenderer[];
|
|
568
|
+
frontendTools?: ReactFrontendTool[];
|
|
569
|
+
humanInTheLoop?: ReactHumanInTheLoop[];
|
|
570
|
+
showDevConsole?: boolean | "auto";
|
|
571
|
+
}
|
|
572
|
+
declare const CopilotKitProvider: React__default.FC<CopilotKitProviderProps>;
|
|
573
|
+
declare const useCopilotKit: () => CopilotKitContextValue;
|
|
524
574
|
|
|
525
|
-
export { AudioRecorderError, type AudioRecorderState, CopilotChat, CopilotChatAssistantMessage, type CopilotChatAssistantMessageProps, CopilotChatAudioRecorder, CopilotChatConfigurationProvider, type CopilotChatConfigurationProviderProps, type CopilotChatConfigurationValue, CopilotChatInput, type CopilotChatInputProps, type CopilotChatLabels, CopilotChatMessageView, type CopilotChatMessageViewProps, type CopilotChatProps, CopilotChatSuggestionPill, type CopilotChatSuggestionPillProps, CopilotChatSuggestionView, type CopilotChatSuggestionViewProps, CopilotChatToggleButton, DefaultCloseIcon as CopilotChatToggleButtonCloseIcon, DefaultOpenIcon as CopilotChatToggleButtonOpenIcon, type CopilotChatToggleButtonProps, CopilotChatToolCallsView, type CopilotChatToolCallsViewProps, CopilotChatUserMessage, type CopilotChatUserMessageProps, CopilotChatView, type CopilotChatViewProps, type CopilotKitContextValue, CopilotKitProvider, type CopilotKitProviderProps, CopilotModalHeader, type CopilotModalHeaderProps, CopilotSidebar, type CopilotSidebarProps, CopilotSidebarView, type CopilotSidebarViewProps, type ReactFrontendTool, type ReactHumanInTheLoop, type
|
|
575
|
+
export { AudioRecorderError, type AudioRecorderState, CopilotChat, CopilotChatAssistantMessage, type CopilotChatAssistantMessageProps, CopilotChatAudioRecorder, CopilotChatConfigurationProvider, type CopilotChatConfigurationProviderProps, type CopilotChatConfigurationValue, CopilotChatInput, type CopilotChatInputProps, type CopilotChatLabels, CopilotChatMessageView, type CopilotChatMessageViewProps, type CopilotChatProps, CopilotChatSuggestionPill, type CopilotChatSuggestionPillProps, CopilotChatSuggestionView, type CopilotChatSuggestionViewProps, CopilotChatToggleButton, DefaultCloseIcon as CopilotChatToggleButtonCloseIcon, DefaultOpenIcon as CopilotChatToggleButtonOpenIcon, type CopilotChatToggleButtonProps, CopilotChatToolCallsView, type CopilotChatToolCallsViewProps, CopilotChatUserMessage, type CopilotChatUserMessageProps, CopilotChatView, type CopilotChatViewProps, type CopilotKitContextValue, CopilotKitCoreReact, type CopilotKitCoreReactConfig, type CopilotKitCoreReactSubscriber, CopilotKitProvider, type CopilotKitProviderProps, CopilotModalHeader, type CopilotModalHeaderProps, CopilotSidebar, type CopilotSidebarProps, CopilotSidebarView, type CopilotSidebarViewProps, type ReactCustomMessageRenderer, type ReactCustomMessageRendererPosition, type ReactFrontendTool, type ReactHumanInTheLoop, type ReactToolCallRenderer, type ToolsMenuItem, WebInspector, type WebInspectorBaseProps, type WebInspectorProps, WildcardToolCallRender, defineToolCallRenderer, useAgent, useAgentContext, useConfigureSuggestions, useCopilotChatConfiguration, useCopilotKit, useFrontendTool, useHumanInTheLoop, useRenderCustomMessages, useRenderToolCall, useSuggestions };
|