@copilotkitnext/react 0.0.14 → 0.0.16

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 CHANGED
@@ -79,21 +79,19 @@ type ToolsMenuItem = {
79
79
  action?: never;
80
80
  items: (ToolsMenuItem | "-")[];
81
81
  });
82
- type CopilotChatInputProps = WithSlots<{
82
+ type CopilotChatInputSlots = {
83
83
  textArea: typeof CopilotChatInput.TextArea;
84
84
  sendButton: typeof CopilotChatInput.SendButton;
85
85
  startTranscribeButton: typeof CopilotChatInput.StartTranscribeButton;
86
86
  cancelTranscribeButton: typeof CopilotChatInput.CancelTranscribeButton;
87
87
  finishTranscribeButton: typeof CopilotChatInput.FinishTranscribeButton;
88
- addFileButton: typeof CopilotChatInput.AddFileButton;
89
- toolsButton: typeof CopilotChatInput.ToolsButton;
90
- toolbar: typeof CopilotChatInput.Toolbar;
88
+ addMenuButton: typeof CopilotChatInput.AddMenuButton;
91
89
  audioRecorder: typeof CopilotChatAudioRecorder;
92
- }, {
90
+ };
91
+ type CopilotChatInputRestProps = {
93
92
  mode?: CopilotChatInputMode;
94
93
  toolsMenu?: (ToolsMenuItem | "-")[];
95
94
  autoFocus?: boolean;
96
- additionalToolbarItems?: React__default.ReactNode;
97
95
  onSubmitMessage?: (value: string) => void;
98
96
  onStartTranscribe?: () => void;
99
97
  onCancelTranscribe?: () => void;
@@ -101,8 +99,15 @@ type CopilotChatInputProps = WithSlots<{
101
99
  onAddFile?: () => void;
102
100
  value?: string;
103
101
  onChange?: (value: string) => void;
104
- } & Omit<React__default.HTMLAttributes<HTMLDivElement>, "onChange">>;
105
- declare function CopilotChatInput({ mode, onSubmitMessage, onStartTranscribe, onCancelTranscribe, onFinishTranscribe, onAddFile, onChange, value, toolsMenu, autoFocus, additionalToolbarItems, textArea, sendButton, startTranscribeButton, cancelTranscribeButton, finishTranscribeButton, addFileButton, toolsButton, toolbar, audioRecorder, children, className, ...props }: CopilotChatInputProps): react_jsx_runtime.JSX.Element;
102
+ } & Omit<React__default.HTMLAttributes<HTMLDivElement>, "onChange">;
103
+ type CopilotChatInputBaseProps = WithSlots<CopilotChatInputSlots, CopilotChatInputRestProps>;
104
+ type CopilotChatInputChildrenArgs = CopilotChatInputBaseProps extends {
105
+ children?: infer C;
106
+ } ? C extends (props: infer P) => React__default.ReactNode ? P : never : never;
107
+ type CopilotChatInputProps = Omit<CopilotChatInputBaseProps, "children"> & {
108
+ children?: (props: CopilotChatInputChildrenArgs) => React__default.ReactNode;
109
+ };
110
+ declare function CopilotChatInput({ mode, onSubmitMessage, onStartTranscribe, onCancelTranscribe, onFinishTranscribe, onAddFile, onChange, value, toolsMenu, autoFocus, textArea, sendButton, startTranscribeButton, cancelTranscribeButton, finishTranscribeButton, addMenuButton, audioRecorder, children, className, ...props }: CopilotChatInputProps): react_jsx_runtime.JSX.Element;
106
111
  declare namespace CopilotChatInput {
107
112
  const SendButton: React__default.FC<React__default.ButtonHTMLAttributes<HTMLButtonElement>>;
108
113
  const ToolbarButton: React__default.FC<React__default.ButtonHTMLAttributes<HTMLButtonElement> & {
@@ -113,14 +118,11 @@ declare namespace CopilotChatInput {
113
118
  const StartTranscribeButton: React__default.FC<React__default.ButtonHTMLAttributes<HTMLButtonElement>>;
114
119
  const CancelTranscribeButton: React__default.FC<React__default.ButtonHTMLAttributes<HTMLButtonElement>>;
115
120
  const FinishTranscribeButton: React__default.FC<React__default.ButtonHTMLAttributes<HTMLButtonElement>>;
116
- const AddFileButton: React__default.FC<React__default.ButtonHTMLAttributes<HTMLButtonElement>>;
117
- const ToolsButton: React__default.FC<React__default.ButtonHTMLAttributes<HTMLButtonElement> & {
121
+ const AddMenuButton: React__default.FC<React__default.ButtonHTMLAttributes<HTMLButtonElement> & {
118
122
  toolsMenu?: (ToolsMenuItem | "-")[];
123
+ onAddFile?: () => void;
119
124
  }>;
120
- const Toolbar: React__default.FC<React__default.HTMLAttributes<HTMLDivElement>>;
121
- interface TextAreaProps extends React__default.TextareaHTMLAttributes<HTMLTextAreaElement> {
122
- maxRows?: number;
123
- }
125
+ type TextAreaProps = React__default.TextareaHTMLAttributes<HTMLTextAreaElement>;
124
126
  const TextArea: React__default.ForwardRefExoticComponent<TextAreaProps & React__default.RefAttributes<HTMLTextAreaElement>>;
125
127
  const AudioRecorder: React__default.ForwardRefExoticComponent<React__default.HTMLAttributes<HTMLDivElement> & React__default.RefAttributes<any>>;
126
128
  }
@@ -300,6 +302,7 @@ declare namespace CopilotChatView {
300
302
  const Feather: React__default.FC<React__default.HTMLAttributes<HTMLDivElement>>;
301
303
  const InputContainer: React__default.ForwardRefExoticComponent<React__default.HTMLAttributes<HTMLDivElement> & {
302
304
  children: React__default.ReactNode;
305
+ keyboardHeight?: number;
303
306
  } & React__default.RefAttributes<HTMLDivElement>>;
304
307
  const Disclaimer: React__default.FC<React__default.HTMLAttributes<HTMLDivElement>>;
305
308
  }
@@ -352,6 +355,17 @@ declare namespace CopilotSidebarView {
352
355
  var displayName: string;
353
356
  }
354
357
 
358
+ type CopilotPopupViewProps = CopilotChatViewProps & {
359
+ header?: SlotValue<typeof CopilotModalHeader>;
360
+ width?: number | string;
361
+ height?: number | string;
362
+ clickOutsideToClose?: boolean;
363
+ };
364
+ declare function CopilotPopupView({ header, width, height, clickOutsideToClose, className, ...restProps }: CopilotPopupViewProps): react_jsx_runtime.JSX.Element;
365
+ declare namespace CopilotPopupView {
366
+ var displayName: string;
367
+ }
368
+
355
369
  type CopilotSidebarProps = Omit<CopilotChatProps, "chatView"> & {
356
370
  header?: CopilotSidebarViewProps["header"];
357
371
  defaultOpen?: boolean;
@@ -362,6 +376,18 @@ declare namespace CopilotSidebar {
362
376
  var displayName: string;
363
377
  }
364
378
 
379
+ type CopilotPopupProps = Omit<CopilotChatProps, "chatView"> & {
380
+ header?: CopilotPopupViewProps["header"];
381
+ defaultOpen?: boolean;
382
+ width?: CopilotPopupViewProps["width"];
383
+ height?: CopilotPopupViewProps["height"];
384
+ clickOutsideToClose?: CopilotPopupViewProps["clickOutsideToClose"];
385
+ };
386
+ declare function CopilotPopup({ header, defaultOpen, width, height, clickOutsideToClose, ...chatProps }: CopilotPopupProps): react_jsx_runtime.JSX.Element;
387
+ declare namespace CopilotPopup {
388
+ var displayName: string;
389
+ }
390
+
365
391
  declare const WildcardToolCallRender: ReactToolCallRenderer<any>;
366
392
 
367
393
  declare const CopilotKitInspectorBase: _lit_labs_react.ReactWebComponent<WebInspectorElement, {}>;
@@ -573,4 +599,4 @@ interface CopilotKitProviderProps {
573
599
  declare const CopilotKitProvider: React__default.FC<CopilotKitProviderProps>;
574
600
  declare const useCopilotKit: () => CopilotKitContextValue;
575
601
 
576
- 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, CopilotKitInspector, type CopilotKitInspectorBaseProps, type CopilotKitInspectorProps, CopilotKitProvider, type CopilotKitProviderProps, CopilotModalHeader, type CopilotModalHeaderProps, CopilotSidebar, type CopilotSidebarProps, CopilotSidebarView, type CopilotSidebarViewProps, type ReactCustomMessageRenderer, type ReactCustomMessageRendererPosition, type ReactFrontendTool, type ReactHumanInTheLoop, type ReactToolCallRenderer, type ToolsMenuItem, WildcardToolCallRender, defineToolCallRenderer, useAgent, useAgentContext, useConfigureSuggestions, useCopilotChatConfiguration, useCopilotKit, useFrontendTool, useHumanInTheLoop, useRenderCustomMessages, useRenderToolCall, useSuggestions };
602
+ 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, CopilotKitInspector, type CopilotKitInspectorBaseProps, type CopilotKitInspectorProps, CopilotKitProvider, type CopilotKitProviderProps, CopilotModalHeader, type CopilotModalHeaderProps, CopilotPopup, type CopilotPopupProps, CopilotPopupView, type CopilotPopupViewProps, CopilotSidebar, type CopilotSidebarProps, CopilotSidebarView, type CopilotSidebarViewProps, type ReactCustomMessageRenderer, type ReactCustomMessageRendererPosition, type ReactFrontendTool, type ReactHumanInTheLoop, type ReactToolCallRenderer, type ToolsMenuItem, WildcardToolCallRender, defineToolCallRenderer, useAgent, useAgentContext, useConfigureSuggestions, useCopilotChatConfiguration, useCopilotKit, useFrontendTool, useHumanInTheLoop, useRenderCustomMessages, useRenderToolCall, useSuggestions };
package/dist/index.d.ts CHANGED
@@ -79,21 +79,19 @@ type ToolsMenuItem = {
79
79
  action?: never;
80
80
  items: (ToolsMenuItem | "-")[];
81
81
  });
82
- type CopilotChatInputProps = WithSlots<{
82
+ type CopilotChatInputSlots = {
83
83
  textArea: typeof CopilotChatInput.TextArea;
84
84
  sendButton: typeof CopilotChatInput.SendButton;
85
85
  startTranscribeButton: typeof CopilotChatInput.StartTranscribeButton;
86
86
  cancelTranscribeButton: typeof CopilotChatInput.CancelTranscribeButton;
87
87
  finishTranscribeButton: typeof CopilotChatInput.FinishTranscribeButton;
88
- addFileButton: typeof CopilotChatInput.AddFileButton;
89
- toolsButton: typeof CopilotChatInput.ToolsButton;
90
- toolbar: typeof CopilotChatInput.Toolbar;
88
+ addMenuButton: typeof CopilotChatInput.AddMenuButton;
91
89
  audioRecorder: typeof CopilotChatAudioRecorder;
92
- }, {
90
+ };
91
+ type CopilotChatInputRestProps = {
93
92
  mode?: CopilotChatInputMode;
94
93
  toolsMenu?: (ToolsMenuItem | "-")[];
95
94
  autoFocus?: boolean;
96
- additionalToolbarItems?: React__default.ReactNode;
97
95
  onSubmitMessage?: (value: string) => void;
98
96
  onStartTranscribe?: () => void;
99
97
  onCancelTranscribe?: () => void;
@@ -101,8 +99,15 @@ type CopilotChatInputProps = WithSlots<{
101
99
  onAddFile?: () => void;
102
100
  value?: string;
103
101
  onChange?: (value: string) => void;
104
- } & Omit<React__default.HTMLAttributes<HTMLDivElement>, "onChange">>;
105
- declare function CopilotChatInput({ mode, onSubmitMessage, onStartTranscribe, onCancelTranscribe, onFinishTranscribe, onAddFile, onChange, value, toolsMenu, autoFocus, additionalToolbarItems, textArea, sendButton, startTranscribeButton, cancelTranscribeButton, finishTranscribeButton, addFileButton, toolsButton, toolbar, audioRecorder, children, className, ...props }: CopilotChatInputProps): react_jsx_runtime.JSX.Element;
102
+ } & Omit<React__default.HTMLAttributes<HTMLDivElement>, "onChange">;
103
+ type CopilotChatInputBaseProps = WithSlots<CopilotChatInputSlots, CopilotChatInputRestProps>;
104
+ type CopilotChatInputChildrenArgs = CopilotChatInputBaseProps extends {
105
+ children?: infer C;
106
+ } ? C extends (props: infer P) => React__default.ReactNode ? P : never : never;
107
+ type CopilotChatInputProps = Omit<CopilotChatInputBaseProps, "children"> & {
108
+ children?: (props: CopilotChatInputChildrenArgs) => React__default.ReactNode;
109
+ };
110
+ declare function CopilotChatInput({ mode, onSubmitMessage, onStartTranscribe, onCancelTranscribe, onFinishTranscribe, onAddFile, onChange, value, toolsMenu, autoFocus, textArea, sendButton, startTranscribeButton, cancelTranscribeButton, finishTranscribeButton, addMenuButton, audioRecorder, children, className, ...props }: CopilotChatInputProps): react_jsx_runtime.JSX.Element;
106
111
  declare namespace CopilotChatInput {
107
112
  const SendButton: React__default.FC<React__default.ButtonHTMLAttributes<HTMLButtonElement>>;
108
113
  const ToolbarButton: React__default.FC<React__default.ButtonHTMLAttributes<HTMLButtonElement> & {
@@ -113,14 +118,11 @@ declare namespace CopilotChatInput {
113
118
  const StartTranscribeButton: React__default.FC<React__default.ButtonHTMLAttributes<HTMLButtonElement>>;
114
119
  const CancelTranscribeButton: React__default.FC<React__default.ButtonHTMLAttributes<HTMLButtonElement>>;
115
120
  const FinishTranscribeButton: React__default.FC<React__default.ButtonHTMLAttributes<HTMLButtonElement>>;
116
- const AddFileButton: React__default.FC<React__default.ButtonHTMLAttributes<HTMLButtonElement>>;
117
- const ToolsButton: React__default.FC<React__default.ButtonHTMLAttributes<HTMLButtonElement> & {
121
+ const AddMenuButton: React__default.FC<React__default.ButtonHTMLAttributes<HTMLButtonElement> & {
118
122
  toolsMenu?: (ToolsMenuItem | "-")[];
123
+ onAddFile?: () => void;
119
124
  }>;
120
- const Toolbar: React__default.FC<React__default.HTMLAttributes<HTMLDivElement>>;
121
- interface TextAreaProps extends React__default.TextareaHTMLAttributes<HTMLTextAreaElement> {
122
- maxRows?: number;
123
- }
125
+ type TextAreaProps = React__default.TextareaHTMLAttributes<HTMLTextAreaElement>;
124
126
  const TextArea: React__default.ForwardRefExoticComponent<TextAreaProps & React__default.RefAttributes<HTMLTextAreaElement>>;
125
127
  const AudioRecorder: React__default.ForwardRefExoticComponent<React__default.HTMLAttributes<HTMLDivElement> & React__default.RefAttributes<any>>;
126
128
  }
@@ -300,6 +302,7 @@ declare namespace CopilotChatView {
300
302
  const Feather: React__default.FC<React__default.HTMLAttributes<HTMLDivElement>>;
301
303
  const InputContainer: React__default.ForwardRefExoticComponent<React__default.HTMLAttributes<HTMLDivElement> & {
302
304
  children: React__default.ReactNode;
305
+ keyboardHeight?: number;
303
306
  } & React__default.RefAttributes<HTMLDivElement>>;
304
307
  const Disclaimer: React__default.FC<React__default.HTMLAttributes<HTMLDivElement>>;
305
308
  }
@@ -352,6 +355,17 @@ declare namespace CopilotSidebarView {
352
355
  var displayName: string;
353
356
  }
354
357
 
358
+ type CopilotPopupViewProps = CopilotChatViewProps & {
359
+ header?: SlotValue<typeof CopilotModalHeader>;
360
+ width?: number | string;
361
+ height?: number | string;
362
+ clickOutsideToClose?: boolean;
363
+ };
364
+ declare function CopilotPopupView({ header, width, height, clickOutsideToClose, className, ...restProps }: CopilotPopupViewProps): react_jsx_runtime.JSX.Element;
365
+ declare namespace CopilotPopupView {
366
+ var displayName: string;
367
+ }
368
+
355
369
  type CopilotSidebarProps = Omit<CopilotChatProps, "chatView"> & {
356
370
  header?: CopilotSidebarViewProps["header"];
357
371
  defaultOpen?: boolean;
@@ -362,6 +376,18 @@ declare namespace CopilotSidebar {
362
376
  var displayName: string;
363
377
  }
364
378
 
379
+ type CopilotPopupProps = Omit<CopilotChatProps, "chatView"> & {
380
+ header?: CopilotPopupViewProps["header"];
381
+ defaultOpen?: boolean;
382
+ width?: CopilotPopupViewProps["width"];
383
+ height?: CopilotPopupViewProps["height"];
384
+ clickOutsideToClose?: CopilotPopupViewProps["clickOutsideToClose"];
385
+ };
386
+ declare function CopilotPopup({ header, defaultOpen, width, height, clickOutsideToClose, ...chatProps }: CopilotPopupProps): react_jsx_runtime.JSX.Element;
387
+ declare namespace CopilotPopup {
388
+ var displayName: string;
389
+ }
390
+
365
391
  declare const WildcardToolCallRender: ReactToolCallRenderer<any>;
366
392
 
367
393
  declare const CopilotKitInspectorBase: _lit_labs_react.ReactWebComponent<WebInspectorElement, {}>;
@@ -573,4 +599,4 @@ interface CopilotKitProviderProps {
573
599
  declare const CopilotKitProvider: React__default.FC<CopilotKitProviderProps>;
574
600
  declare const useCopilotKit: () => CopilotKitContextValue;
575
601
 
576
- 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, CopilotKitInspector, type CopilotKitInspectorBaseProps, type CopilotKitInspectorProps, CopilotKitProvider, type CopilotKitProviderProps, CopilotModalHeader, type CopilotModalHeaderProps, CopilotSidebar, type CopilotSidebarProps, CopilotSidebarView, type CopilotSidebarViewProps, type ReactCustomMessageRenderer, type ReactCustomMessageRendererPosition, type ReactFrontendTool, type ReactHumanInTheLoop, type ReactToolCallRenderer, type ToolsMenuItem, WildcardToolCallRender, defineToolCallRenderer, useAgent, useAgentContext, useConfigureSuggestions, useCopilotChatConfiguration, useCopilotKit, useFrontendTool, useHumanInTheLoop, useRenderCustomMessages, useRenderToolCall, useSuggestions };
602
+ 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, CopilotKitInspector, type CopilotKitInspectorBaseProps, type CopilotKitInspectorProps, CopilotKitProvider, type CopilotKitProviderProps, CopilotModalHeader, type CopilotModalHeaderProps, CopilotPopup, type CopilotPopupProps, CopilotPopupView, type CopilotPopupViewProps, CopilotSidebar, type CopilotSidebarProps, CopilotSidebarView, type CopilotSidebarViewProps, type ReactCustomMessageRenderer, type ReactCustomMessageRendererPosition, type ReactFrontendTool, type ReactHumanInTheLoop, type ReactToolCallRenderer, type ToolsMenuItem, WildcardToolCallRender, defineToolCallRenderer, useAgent, useAgentContext, useConfigureSuggestions, useCopilotChatConfiguration, useCopilotKit, useFrontendTool, useHumanInTheLoop, useRenderCustomMessages, useRenderToolCall, useSuggestions };