@copilotkit/react-ui 1.3.0 → 1.3.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.
Files changed (203) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/chunk-54JAUBUJ.mjs +26 -0
  3. package/dist/chunk-54JAUBUJ.mjs.map +1 -0
  4. package/dist/chunk-5HHVL5WK.mjs +29 -0
  5. package/dist/chunk-5HHVL5WK.mjs.map +1 -0
  6. package/dist/chunk-B2KQEX2R.mjs +91 -0
  7. package/dist/chunk-B2KQEX2R.mjs.map +1 -0
  8. package/dist/chunk-BJPGMY3I.mjs +70 -0
  9. package/dist/chunk-BJPGMY3I.mjs.map +1 -0
  10. package/dist/chunk-EFZPSZWO.mjs +1 -0
  11. package/dist/chunk-EFZPSZWO.mjs.map +1 -0
  12. package/dist/chunk-FL4ETWFB.mjs +21 -0
  13. package/dist/chunk-FL4ETWFB.mjs.map +1 -0
  14. package/dist/chunk-FLV3J3VX.mjs +18 -0
  15. package/dist/chunk-FLV3J3VX.mjs.map +1 -0
  16. package/dist/chunk-FO7Z5LAL.mjs +118 -0
  17. package/dist/chunk-FO7Z5LAL.mjs.map +1 -0
  18. package/dist/chunk-FOZVHL73.mjs +171 -0
  19. package/dist/chunk-FOZVHL73.mjs.map +1 -0
  20. package/dist/chunk-FZC7X5PK.mjs +262 -0
  21. package/dist/chunk-FZC7X5PK.mjs.map +1 -0
  22. package/dist/chunk-H7TM5JE6.mjs +146 -0
  23. package/dist/chunk-H7TM5JE6.mjs.map +1 -0
  24. package/dist/chunk-HR36Y2FQ.mjs +167 -0
  25. package/dist/chunk-HR36Y2FQ.mjs.map +1 -0
  26. package/dist/chunk-I4QG2ZZU.mjs +220 -0
  27. package/dist/chunk-I4QG2ZZU.mjs.map +1 -0
  28. package/dist/chunk-IU3WTXLQ.mjs +1 -0
  29. package/dist/chunk-IU3WTXLQ.mjs.map +1 -0
  30. package/dist/chunk-JD7BAH7U.mjs +1 -0
  31. package/dist/chunk-JD7BAH7U.mjs.map +1 -0
  32. package/dist/chunk-MRFF7GSQ.mjs +1 -0
  33. package/dist/chunk-MRFF7GSQ.mjs.map +1 -0
  34. package/dist/chunk-MRXNTQOX.mjs +59 -0
  35. package/dist/chunk-MRXNTQOX.mjs.map +1 -0
  36. package/dist/chunk-OTPAZXVR.mjs +92 -0
  37. package/dist/chunk-OTPAZXVR.mjs.map +1 -0
  38. package/dist/chunk-QOEAEMUQ.mjs +30 -0
  39. package/dist/chunk-QOEAEMUQ.mjs.map +1 -0
  40. package/dist/chunk-T26KLXLH.mjs +1 -0
  41. package/dist/chunk-T26KLXLH.mjs.map +1 -0
  42. package/dist/chunk-U6J5DGOE.mjs +83 -0
  43. package/dist/chunk-U6J5DGOE.mjs.map +1 -0
  44. package/dist/chunk-UPTB2MVO.mjs +395 -0
  45. package/dist/chunk-UPTB2MVO.mjs.map +1 -0
  46. package/dist/chunk-V7W6IM2V.mjs +1 -0
  47. package/dist/chunk-V7W6IM2V.mjs.map +1 -0
  48. package/dist/chunk-VOBX4JOA.mjs +138 -0
  49. package/dist/chunk-VOBX4JOA.mjs.map +1 -0
  50. package/dist/chunk-WB3YULQ4.mjs +1 -0
  51. package/dist/chunk-WB3YULQ4.mjs.map +1 -0
  52. package/dist/chunk-WCPLXRZX.mjs +106 -0
  53. package/dist/chunk-WCPLXRZX.mjs.map +1 -0
  54. package/dist/chunk-XSUSSWDS.mjs +18 -0
  55. package/dist/chunk-XSUSSWDS.mjs.map +1 -0
  56. package/dist/chunk-YOH25I6N.mjs +25 -0
  57. package/dist/chunk-YOH25I6N.mjs.map +1 -0
  58. package/dist/chunk-YQ3D5IQV.mjs +75 -0
  59. package/dist/chunk-YQ3D5IQV.mjs.map +1 -0
  60. package/dist/chunk-YQFVRDNC.mjs +53 -0
  61. package/dist/chunk-YQFVRDNC.mjs.map +1 -0
  62. package/dist/components/chat/Button.js.map +1 -1
  63. package/dist/components/chat/Button.mjs +6 -30
  64. package/dist/components/chat/Button.mjs.map +1 -1
  65. package/dist/components/chat/Chat.d.ts +1 -1
  66. package/dist/components/chat/Chat.js +6 -3
  67. package/dist/components/chat/Chat.js.map +1 -1
  68. package/dist/components/chat/Chat.mjs +20 -1851
  69. package/dist/components/chat/Chat.mjs.map +1 -1
  70. package/dist/components/chat/ChatContext.d.ts +1 -1
  71. package/dist/components/chat/ChatContext.mjs +7 -228
  72. package/dist/components/chat/ChatContext.mjs.map +1 -1
  73. package/dist/components/chat/CodeBlock.js +2 -1
  74. package/dist/components/chat/CodeBlock.js.map +1 -1
  75. package/dist/components/chat/CodeBlock.mjs +8 -482
  76. package/dist/components/chat/CodeBlock.mjs.map +1 -1
  77. package/dist/components/chat/Header.mjs +6 -23
  78. package/dist/components/chat/Header.mjs.map +1 -1
  79. package/dist/components/chat/Icons.mjs +16 -271
  80. package/dist/components/chat/Icons.mjs.map +1 -1
  81. package/dist/components/chat/Input.js +4 -2
  82. package/dist/components/chat/Input.js.map +1 -1
  83. package/dist/components/chat/Input.mjs +8 -255
  84. package/dist/components/chat/Input.mjs.map +1 -1
  85. package/dist/components/chat/Markdown.js +2 -1
  86. package/dist/components/chat/Markdown.js.map +1 -1
  87. package/dist/components/chat/Markdown.mjs +7 -546
  88. package/dist/components/chat/Markdown.mjs.map +1 -1
  89. package/dist/components/chat/Messages.js +2 -1
  90. package/dist/components/chat/Messages.js.map +1 -1
  91. package/dist/components/chat/Messages.mjs +8 -723
  92. package/dist/components/chat/Messages.mjs.map +1 -1
  93. package/dist/components/chat/Modal.d.ts +1 -1
  94. package/dist/components/chat/Modal.js +6 -3
  95. package/dist/components/chat/Modal.js.map +1 -1
  96. package/dist/components/chat/Modal.mjs +22 -2052
  97. package/dist/components/chat/Modal.mjs.map +1 -1
  98. package/dist/components/chat/Popup.js +6 -3
  99. package/dist/components/chat/Popup.js.map +1 -1
  100. package/dist/components/chat/Popup.mjs +23 -2061
  101. package/dist/components/chat/Popup.mjs.map +1 -1
  102. package/dist/components/chat/Response.mjs +6 -23
  103. package/dist/components/chat/Response.mjs.map +1 -1
  104. package/dist/components/chat/Sidebar.js +6 -3
  105. package/dist/components/chat/Sidebar.js.map +1 -1
  106. package/dist/components/chat/Sidebar.mjs +23 -2072
  107. package/dist/components/chat/Sidebar.mjs.map +1 -1
  108. package/dist/components/chat/Suggestion.js.map +1 -1
  109. package/dist/components/chat/Suggestion.mjs +5 -152
  110. package/dist/components/chat/Suggestion.mjs.map +1 -1
  111. package/dist/components/chat/Textarea.js.map +1 -1
  112. package/dist/components/chat/Textarea.mjs +4 -48
  113. package/dist/components/chat/Textarea.mjs.map +1 -1
  114. package/dist/components/chat/Window.js.map +1 -1
  115. package/dist/components/chat/Window.mjs +6 -125
  116. package/dist/components/chat/Window.mjs.map +1 -1
  117. package/dist/components/chat/index.js +6 -3
  118. package/dist/components/chat/index.js.map +1 -1
  119. package/dist/components/chat/index.mjs +31 -2078
  120. package/dist/components/chat/index.mjs.map +1 -1
  121. package/dist/components/chat/props.d.ts +1 -1
  122. package/dist/components/chat/props.mjs +1 -0
  123. package/dist/components/dev-console/console.js.map +1 -1
  124. package/dist/components/dev-console/console.mjs +8 -478
  125. package/dist/components/dev-console/console.mjs.map +1 -1
  126. package/dist/components/dev-console/icons.mjs +8 -83
  127. package/dist/components/dev-console/icons.mjs.map +1 -1
  128. package/dist/components/dev-console/index.js.map +1 -1
  129. package/dist/components/dev-console/index.mjs +10 -476
  130. package/dist/components/dev-console/index.mjs.map +1 -1
  131. package/dist/components/dev-console/types.d.ts +1 -1
  132. package/dist/components/dev-console/utils.js.map +1 -1
  133. package/dist/components/dev-console/utils.mjs +8 -154
  134. package/dist/components/dev-console/utils.mjs.map +1 -1
  135. package/dist/components/index.js +6 -3
  136. package/dist/components/index.js.map +1 -1
  137. package/dist/components/index.mjs +32 -2078
  138. package/dist/components/index.mjs.map +1 -1
  139. package/dist/context/index.d.ts +1 -1
  140. package/dist/context/index.mjs +1 -0
  141. package/dist/hooks/index.mjs +5 -24
  142. package/dist/hooks/index.mjs.map +1 -1
  143. package/dist/hooks/use-copilot-chat-suggestions.mjs +4 -24
  144. package/dist/hooks/use-copilot-chat-suggestions.mjs.map +1 -1
  145. package/dist/hooks/use-copy-to-clipboard.d.ts +1 -1
  146. package/dist/hooks/use-copy-to-clipboard.mjs +4 -21
  147. package/dist/hooks/use-copy-to-clipboard.mjs.map +1 -1
  148. package/dist/hooks/use-push-to-talk.d.ts +1 -1
  149. package/dist/hooks/use-push-to-talk.js.map +1 -1
  150. package/dist/hooks/use-push-to-talk.mjs +6 -148
  151. package/dist/hooks/use-push-to-talk.mjs.map +1 -1
  152. package/dist/index.css +747 -1
  153. package/dist/index.css.map +1 -0
  154. package/dist/index.js +6 -10
  155. package/dist/index.js.map +1 -1
  156. package/dist/index.mjs +38 -2110
  157. package/dist/index.mjs.map +1 -1
  158. package/dist/lib/utils.mjs +3 -20
  159. package/dist/lib/utils.mjs.map +1 -1
  160. package/dist/lib/utils.test.d.ts +1 -1
  161. package/dist/types/css.d.ts +1 -1
  162. package/dist/types/index.mjs +1 -0
  163. package/dist/types/suggestions.d.ts +1 -1
  164. package/package.json +11 -19
  165. package/src/components/chat/Chat.tsx +4 -1
  166. package/src/components/chat/Popup.tsx +4 -1
  167. package/src/components/chat/Sidebar.tsx +3 -1
  168. package/tsup.config.ts +15 -59
  169. package/dist/components/chat/Button.d.mts +0 -7
  170. package/dist/components/chat/Chat.d.mts +0 -87
  171. package/dist/components/chat/ChatContext.d.mts +0 -105
  172. package/dist/components/chat/CodeBlock.d.mts +0 -14
  173. package/dist/components/chat/Header.d.mts +0 -7
  174. package/dist/components/chat/Icons.d.mts +0 -18
  175. package/dist/components/chat/Input.d.mts +0 -7
  176. package/dist/components/chat/Markdown.d.mts +0 -8
  177. package/dist/components/chat/Messages.d.mts +0 -7
  178. package/dist/components/chat/Modal.d.mts +0 -51
  179. package/dist/components/chat/Popup.d.mts +0 -13
  180. package/dist/components/chat/Response.d.mts +0 -7
  181. package/dist/components/chat/Sidebar.d.mts +0 -13
  182. package/dist/components/chat/Suggestion.d.mts +0 -14
  183. package/dist/components/chat/Textarea.d.mts +0 -13
  184. package/dist/components/chat/Window.d.mts +0 -7
  185. package/dist/components/chat/index.d.mts +0 -11
  186. package/dist/components/chat/props.d.mts +0 -35
  187. package/dist/components/dev-console/console.d.mts +0 -10
  188. package/dist/components/dev-console/icons.d.mts +0 -9
  189. package/dist/components/dev-console/index.d.mts +0 -5
  190. package/dist/components/dev-console/types.d.mts +0 -9
  191. package/dist/components/dev-console/utils.d.mts +0 -10
  192. package/dist/components/index.d.mts +0 -11
  193. package/dist/context/index.d.mts +0 -2
  194. package/dist/hooks/index.d.mts +0 -1
  195. package/dist/hooks/use-copilot-chat-suggestions.d.mts +0 -83
  196. package/dist/hooks/use-copy-to-clipboard.d.mts +0 -9
  197. package/dist/hooks/use-push-to-talk.d.mts +0 -19
  198. package/dist/index.d.mts +0 -13
  199. package/dist/lib/utils.d.mts +0 -4
  200. package/dist/lib/utils.test.d.mts +0 -2
  201. package/dist/types/css.d.mts +0 -16
  202. package/dist/types/index.d.mts +0 -2
  203. package/dist/types/suggestions.d.mts +0 -8
@@ -18,6 +18,7 @@
18
18
  *
19
19
  * ```tsx
20
20
  * import { CopilotSidebar } from "@copilotkit/react-ui";
21
+ * import "@copilotkit/react-ui/styles.css";
21
22
  *
22
23
  * <CopilotSidebar
23
24
  * labels={{
@@ -32,8 +33,9 @@
32
33
  * ### Look & Feel
33
34
  *
34
35
  * By default, CopilotKit components do not have any styles. You can import CopilotKit's stylesheet at the root of your project:
35
- * ```tsx fileName="YourRootComponent.tsx"
36
+ * ```tsx fileName="YourRootComponent.tsx" {2}
36
37
  * ...
38
+ * import "@copilotkit/react-ui/styles.css";
37
39
  *
38
40
  * export function YourRootComponent() {
39
41
  * return (
package/tsup.config.ts CHANGED
@@ -1,60 +1,16 @@
1
- import { defineConfig, Options } from "tsup-async-inject-style";
2
- import fs from "fs";
3
- import path from "path";
4
- import postcss from "postcss";
5
- import autoprefixer from "autoprefixer";
6
- import tailwindcss from "tailwindcss";
7
- import cssnano from "cssnano";
8
- import postcssImport from "postcss-import";
9
- import postcssNested from "postcss-nested";
1
+ import { defineConfig, Options } from "tsup";
10
2
 
11
- export default defineConfig((options: Options) => {
12
- return {
13
- entry: ["src/**/*.ts", "src/**/*.tsx"],
14
- format: ["esm", "cjs"],
15
- dts: true,
16
- minify: false,
17
- external: ["react"],
18
- splitting: false,
19
- clean: true,
20
- sourcemap: true,
21
- exclude: [
22
- "**/*.test.ts", // Exclude TypeScript test files
23
- "**/*.test.tsx", // Exclude TypeScript React test files
24
- "**/__tests__/*", // Exclude any files inside a __tests__ directory
25
- ],
26
- onSuccess: async () => {
27
- // Create index.css file for backwards compatibility
28
- fs.writeFileSync(
29
- path.resolve(process.cwd(), "dist/index.css"),
30
- `/* This is here for backwards compatibility */`,
31
- );
32
- },
33
- injectStyle: async (_, filePath) => {
34
- const cwd = process.cwd();
35
- const outputPath = path.resolve(cwd, "dist/index.css");
36
- const rawCSS = fs.readFileSync(filePath, "utf8");
37
-
38
- const resultCSS = await postcss([
39
- postcssImport(),
40
- postcssNested(),
41
- tailwindcss,
42
- autoprefixer,
43
- cssnano({ preset: "default" }),
44
- ]).process(rawCSS, { from: filePath, to: outputPath });
45
-
46
- if (resultCSS.css === undefined) {
47
- throw new Error("No CSS output");
48
- }
49
-
50
- return `
51
- if (globalThis.hasOwnProperty("document")) {
52
- const style = document?.createElement("style");
53
- style.innerHTML = '${resultCSS}';
54
- document?.head.appendChild(style);
55
- }
56
- `;
57
- },
58
- ...options,
59
- };
60
- });
3
+ export default defineConfig((options: Options) => ({
4
+ entry: ["src/**/*.{ts,tsx}"],
5
+ format: ["esm", "cjs"],
6
+ dts: true,
7
+ minify: false,
8
+ external: ["react"],
9
+ sourcemap: true,
10
+ exclude: [
11
+ "**/*.test.ts", // Exclude TypeScript test files
12
+ "**/*.test.tsx", // Exclude TypeScript React test files
13
+ "**/__tests__/*", // Exclude any files inside a __tests__ directory
14
+ ],
15
+ ...options,
16
+ }));
@@ -1,7 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { ButtonProps } from './props.mjs';
3
- import '@copilotkit/runtime-client-gql';
4
-
5
- declare const Button: ({}: ButtonProps) => react_jsx_runtime.JSX.Element;
6
-
7
- export { Button };
@@ -1,87 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { CopilotChatIcons, CopilotChatLabels } from './ChatContext.mjs';
3
- import React__default from 'react';
4
- import { SystemMessageFunction } from '@copilotkit/react-core';
5
- import { CopilotChatSuggestion } from '../../types/suggestions.mjs';
6
- import { Message } from '@copilotkit/runtime-client-gql';
7
- import { MessagesProps, InputProps, ResponseButtonProps } from './props.mjs';
8
-
9
- /**
10
- * Props for CopilotChat component.
11
- */
12
- interface CopilotChatProps {
13
- /**
14
- * Custom instructions to be added to the system message. Use this property to
15
- * provide additional context or guidance to the language model, influencing
16
- * its responses. These instructions can include specific directions,
17
- * preferences, or criteria that the model should consider when generating
18
- * its output, thereby tailoring the conversation more precisely to the
19
- * user's needs or the application's requirements.
20
- */
21
- instructions?: string;
22
- /**
23
- * A callback that gets called when the in progress state changes.
24
- */
25
- onInProgress?: (inProgress: boolean) => void;
26
- /**
27
- * A callback that gets called when a new message it submitted.
28
- */
29
- onSubmitMessage?: (message: string) => void | Promise<void>;
30
- /**
31
- * Icons can be used to set custom icons for the chat window.
32
- */
33
- icons?: CopilotChatIcons;
34
- /**
35
- * Labels can be used to set custom labels for the chat window.
36
- */
37
- labels?: CopilotChatLabels;
38
- /**
39
- * A function that takes in context string and instructions and returns
40
- * the system message to include in the chat request.
41
- * Use this to completely override the system message, when providing
42
- * instructions is not enough.
43
- */
44
- makeSystemMessage?: SystemMessageFunction;
45
- /**
46
- * Whether to show the response button.
47
- * @default true
48
- */
49
- showResponseButton?: boolean;
50
- /**
51
- * A custom Messages component to use instead of the default.
52
- */
53
- Messages?: React__default.ComponentType<MessagesProps>;
54
- /**
55
- * A custom Input component to use instead of the default.
56
- */
57
- Input?: React__default.ComponentType<InputProps>;
58
- /**
59
- * A custom ResponseButton component to use instead of the default.
60
- */
61
- ResponseButton?: React__default.ComponentType<ResponseButtonProps>;
62
- /**
63
- * A class name to apply to the root element.
64
- */
65
- className?: string;
66
- /**
67
- * Children to render.
68
- */
69
- children?: React__default.ReactNode;
70
- }
71
- declare function CopilotChat({ instructions, onSubmitMessage, makeSystemMessage, showResponseButton, onInProgress, Messages, Input, ResponseButton, className, icons, labels, }: CopilotChatProps): react_jsx_runtime.JSX.Element;
72
- declare function WrappedCopilotChat({ children, icons, labels, className, }: {
73
- children: React__default.ReactNode;
74
- icons?: CopilotChatIcons;
75
- labels?: CopilotChatLabels;
76
- className?: string;
77
- }): react_jsx_runtime.JSX.Element;
78
- declare const useCopilotChatLogic: (makeSystemMessage?: SystemMessageFunction, onInProgress?: (isLoading: boolean) => void, onSubmitMessage?: (messageContent: string) => Promise<void> | void) => {
79
- visibleMessages: Message[];
80
- isLoading: boolean;
81
- currentSuggestions: CopilotChatSuggestion[];
82
- sendMessage: (messageContent: string) => Promise<Message>;
83
- stopGeneration: () => void;
84
- reloadMessages: () => Promise<void>;
85
- };
86
-
87
- export { CopilotChat, type CopilotChatProps, WrappedCopilotChat, useCopilotChatLogic };
@@ -1,105 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import React__default from 'react';
3
-
4
- /**
5
- * Icons for CopilotChat component.
6
- */
7
- interface CopilotChatIcons {
8
- /**
9
- * The icon to use for the open chat button.
10
- * @default <OpenIcon />
11
- */
12
- openIcon?: React__default.ReactNode;
13
- /**
14
- * The icon to use for the close chat button.
15
- * @default <CloseIcon />
16
- */
17
- closeIcon?: React__default.ReactNode;
18
- /**
19
- * The icon to use for the close chat button in the header.
20
- * @default <HeaderCloseIcon />
21
- */
22
- headerCloseIcon?: React__default.ReactNode;
23
- /**
24
- * The icon to use for the send button.
25
- * @default <SendIcon />
26
- */
27
- sendIcon?: React__default.ReactNode;
28
- /**
29
- * The icon to use for the activity indicator.
30
- * @default <ActivityIcon />
31
- */
32
- activityIcon?: React__default.ReactNode;
33
- /**
34
- * The icon to use for the spinner.
35
- * @default <SpinnerIcon />
36
- */
37
- spinnerIcon?: React__default.ReactNode;
38
- /**
39
- * The icon to use for the stop button.
40
- * @default <StopIcon />
41
- */
42
- stopIcon?: React__default.ReactNode;
43
- /**
44
- * The icon to use for the regenerate button.
45
- * @default <RegenerateIcon />
46
- */
47
- regenerateIcon?: React__default.ReactNode;
48
- /**
49
- * The icons to use for push to talk.
50
- * @default <PushToTalkIcon />
51
- */
52
- pushToTalkIcon?: React__default.ReactNode;
53
- }
54
- /**
55
- * Labels for CopilotChat component.
56
- */
57
- interface CopilotChatLabels {
58
- /**
59
- * The initial message(s) to display in the chat window.
60
- */
61
- initial?: string | string[];
62
- /**
63
- * The title to display in the header.
64
- * @default "CopilotKit"
65
- */
66
- title?: string;
67
- /**
68
- * The placeholder to display in the input.
69
- * @default "Type a message..."
70
- */
71
- placeholder?: string;
72
- /**
73
- * The message to display when an error occurs.
74
- * @default "❌ An error occurred. Please try again."
75
- */
76
- error?: string;
77
- /**
78
- * The label to display on the stop button.
79
- * @default "Stop generating"
80
- */
81
- stopGenerating?: string;
82
- /**
83
- * The label to display on the regenerate button.
84
- * @default "Regenerate response"
85
- */
86
- regenerateResponse?: string;
87
- }
88
- interface ChatContext {
89
- labels: Required<CopilotChatLabels>;
90
- icons: Required<CopilotChatIcons>;
91
- open: boolean;
92
- setOpen: (open: boolean) => void;
93
- }
94
- declare const ChatContext: React__default.Context<ChatContext | undefined>;
95
- declare function useChatContext(): ChatContext;
96
- interface ChatContextProps {
97
- labels?: CopilotChatLabels;
98
- icons?: CopilotChatIcons;
99
- children?: React__default.ReactNode;
100
- open: boolean;
101
- setOpen: (open: boolean) => void;
102
- }
103
- declare const ChatContextProvider: ({ labels, icons, children, open, setOpen, }: ChatContextProps) => react_jsx_runtime.JSX.Element;
104
-
105
- export { ChatContext, ChatContextProvider, type CopilotChatIcons, type CopilotChatLabels, useChatContext };
@@ -1,14 +0,0 @@
1
- import { FC } from 'react';
2
-
3
- interface Props {
4
- language: string;
5
- value: string;
6
- }
7
- interface languageMap {
8
- [key: string]: string | undefined;
9
- }
10
- declare const programmingLanguages: languageMap;
11
- declare const generateRandomString: (length: number, lowercase?: boolean) => string;
12
- declare const CodeBlock: FC<Props>;
13
-
14
- export { CodeBlock, generateRandomString, programmingLanguages };
@@ -1,7 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { HeaderProps } from './props.mjs';
3
- import '@copilotkit/runtime-client-gql';
4
-
5
- declare const Header: ({}: HeaderProps) => react_jsx_runtime.JSX.Element;
6
-
7
- export { Header };
@@ -1,18 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import React__default from 'react';
3
-
4
- declare const OpenIcon: react_jsx_runtime.JSX.Element;
5
- declare const CloseIcon: react_jsx_runtime.JSX.Element;
6
- declare const HeaderCloseIcon: react_jsx_runtime.JSX.Element;
7
- declare const SendIcon: react_jsx_runtime.JSX.Element;
8
- declare const SpinnerIcon: react_jsx_runtime.JSX.Element;
9
- declare const SmallSpinnerIcon: react_jsx_runtime.JSX.Element;
10
- declare const ActivityIcon: react_jsx_runtime.JSX.Element;
11
- declare function CheckIcon({ className, ...props }: React__default.ComponentProps<"svg">): react_jsx_runtime.JSX.Element;
12
- declare function DownloadIcon({ className, ...props }: React__default.ComponentProps<"svg">): react_jsx_runtime.JSX.Element;
13
- declare function CopyIcon({ className, ...props }: React__default.ComponentProps<"svg">): react_jsx_runtime.JSX.Element;
14
- declare const StopIcon: react_jsx_runtime.JSX.Element;
15
- declare const RegenerateIcon: react_jsx_runtime.JSX.Element;
16
- declare const PushToTalkIcon: react_jsx_runtime.JSX.Element;
17
-
18
- export { ActivityIcon, CheckIcon, CloseIcon, CopyIcon, DownloadIcon, HeaderCloseIcon, OpenIcon, PushToTalkIcon, RegenerateIcon, SendIcon, SmallSpinnerIcon, SpinnerIcon, StopIcon };
@@ -1,7 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { InputProps } from './props.mjs';
3
- import '@copilotkit/runtime-client-gql';
4
-
5
- declare const Input: ({ inProgress, onSend, isVisible }: InputProps) => react_jsx_runtime.JSX.Element;
6
-
7
- export { Input };
@@ -1,8 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
-
3
- type MarkdownProps = {
4
- content: string;
5
- };
6
- declare const Markdown: ({ content }: MarkdownProps) => react_jsx_runtime.JSX.Element;
7
-
8
- export { Markdown };
@@ -1,7 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { MessagesProps } from './props.mjs';
3
- import '@copilotkit/runtime-client-gql';
4
-
5
- declare const Messages: ({ messages, inProgress, children }: MessagesProps) => react_jsx_runtime.JSX.Element;
6
-
7
- export { Messages };
@@ -1,51 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import React__default from 'react';
3
- import { WindowProps, ButtonProps, HeaderProps } from './props.mjs';
4
- import { CopilotChatProps } from './Chat.mjs';
5
- import '@copilotkit/runtime-client-gql';
6
- import './ChatContext.mjs';
7
- import '@copilotkit/react-core';
8
- import '../../types/suggestions.mjs';
9
-
10
- interface CopilotModalProps extends CopilotChatProps {
11
- /**
12
- * Whether the chat window should be open by default.
13
- * @default false
14
- */
15
- defaultOpen?: boolean;
16
- /**
17
- * If the chat window should close when the user clicks outside of it.
18
- * @default true
19
- */
20
- clickOutsideToClose?: boolean;
21
- /**
22
- * If the chat window should close when the user hits the Escape key.
23
- * @default true
24
- */
25
- hitEscapeToClose?: boolean;
26
- /**
27
- * The shortcut key to open the chat window.
28
- * Uses Command-[shortcut] on a Mac and Ctrl-[shortcut] on Windows.
29
- * @default '/'
30
- */
31
- shortcut?: string;
32
- /**
33
- * A callback that gets called when the chat window opens or closes.
34
- */
35
- onSetOpen?: (open: boolean) => void;
36
- /**
37
- * A custom Window component to use instead of the default.
38
- */
39
- Window?: React__default.ComponentType<WindowProps>;
40
- /**
41
- * A custom Button component to use instead of the default.
42
- */
43
- Button?: React__default.ComponentType<ButtonProps>;
44
- /**
45
- * A custom Header component to use instead of the default.
46
- */
47
- Header?: React__default.ComponentType<HeaderProps>;
48
- }
49
- declare const CopilotModal: ({ instructions, defaultOpen, clickOutsideToClose, hitEscapeToClose, onSetOpen, onSubmitMessage, shortcut, icons, labels, makeSystemMessage, showResponseButton, onInProgress, Window, Button, Header, Messages, Input, ResponseButton, className, children, }: CopilotModalProps) => react_jsx_runtime.JSX.Element;
50
-
51
- export { CopilotModal, type CopilotModalProps };
@@ -1,13 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { CopilotModalProps } from './Modal.mjs';
3
- import 'react';
4
- import './props.mjs';
5
- import '@copilotkit/runtime-client-gql';
6
- import './Chat.mjs';
7
- import './ChatContext.mjs';
8
- import '@copilotkit/react-core';
9
- import '../../types/suggestions.mjs';
10
-
11
- declare function CopilotPopup(props: CopilotModalProps): react_jsx_runtime.JSX.Element;
12
-
13
- export { CopilotPopup };
@@ -1,7 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { ResponseButtonProps } from './props.mjs';
3
- import '@copilotkit/runtime-client-gql';
4
-
5
- declare const ResponseButton: ({ onClick, inProgress }: ResponseButtonProps) => react_jsx_runtime.JSX.Element;
6
-
7
- export { ResponseButton };
@@ -1,13 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { CopilotModalProps } from './Modal.mjs';
3
- import 'react';
4
- import './props.mjs';
5
- import '@copilotkit/runtime-client-gql';
6
- import './Chat.mjs';
7
- import './ChatContext.mjs';
8
- import '@copilotkit/react-core';
9
- import '../../types/suggestions.mjs';
10
-
11
- declare function CopilotSidebar(props: CopilotModalProps): react_jsx_runtime.JSX.Element;
12
-
13
- export { CopilotSidebar };
@@ -1,14 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { CopilotContextParams, CopilotChatSuggestionConfiguration } from '@copilotkit/react-core';
3
- import { SuggestionsProps } from './props.mjs';
4
- import '@copilotkit/runtime-client-gql';
5
-
6
- declare function Suggestion({ title, message, onClick, partial, className }: SuggestionsProps): react_jsx_runtime.JSX.Element;
7
- declare const reloadSuggestions: (context: CopilotContextParams, chatSuggestionConfiguration: {
8
- [key: string]: CopilotChatSuggestionConfiguration;
9
- }, setCurrentSuggestions: (suggestions: {
10
- title: string;
11
- message: string;
12
- }[]) => void, abortControllerRef: React.MutableRefObject<AbortController | null>) => Promise<void>;
13
-
14
- export { Suggestion, reloadSuggestions };
@@ -1,13 +0,0 @@
1
- import React__default from 'react';
2
-
3
- interface AutoResizingTextareaProps {
4
- maxRows?: number;
5
- placeholder?: string;
6
- value: string;
7
- onChange: (event: React__default.ChangeEvent<HTMLTextAreaElement>) => void;
8
- onKeyDown?: (event: React__default.KeyboardEvent<HTMLTextAreaElement>) => void;
9
- autoFocus?: boolean;
10
- }
11
- declare const AutoResizingTextarea: React__default.ForwardRefExoticComponent<AutoResizingTextareaProps & React__default.RefAttributes<HTMLTextAreaElement>>;
12
-
13
- export { AutoResizingTextarea as default };
@@ -1,7 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { WindowProps } from './props.mjs';
3
- import '@copilotkit/runtime-client-gql';
4
-
5
- declare const Window: ({ children, clickOutsideToClose, shortcut, hitEscapeToClose, }: WindowProps) => react_jsx_runtime.JSX.Element;
6
-
7
- export { Window };
@@ -1,11 +0,0 @@
1
- export { ButtonProps, HeaderProps, InputProps, MessagesProps, ResponseButtonProps, SuggestionsProps, WindowProps } from './props.mjs';
2
- export { CopilotPopup } from './Popup.mjs';
3
- export { CopilotSidebar } from './Sidebar.mjs';
4
- export { CopilotChat } from './Chat.mjs';
5
- export { useChatContext } from './ChatContext.mjs';
6
- import '@copilotkit/runtime-client-gql';
7
- import 'react/jsx-runtime';
8
- import './Modal.mjs';
9
- import 'react';
10
- import '@copilotkit/react-core';
11
- import '../../types/suggestions.mjs';
@@ -1,35 +0,0 @@
1
- import { Message } from '@copilotkit/runtime-client-gql';
2
-
3
- interface ButtonProps {
4
- }
5
- interface WindowProps {
6
- clickOutsideToClose: boolean;
7
- hitEscapeToClose: boolean;
8
- shortcut: string;
9
- children?: React.ReactNode;
10
- }
11
- interface HeaderProps {
12
- }
13
- interface SuggestionsProps {
14
- title: string;
15
- message: string;
16
- partial?: boolean;
17
- className?: string;
18
- onClick: (message: string) => void;
19
- }
20
- interface MessagesProps {
21
- messages: Message[];
22
- inProgress: boolean;
23
- children?: React.ReactNode;
24
- }
25
- interface InputProps {
26
- inProgress: boolean;
27
- onSend: (text: string) => Promise<Message>;
28
- isVisible?: boolean;
29
- }
30
- interface ResponseButtonProps {
31
- onClick: () => void;
32
- inProgress: boolean;
33
- }
34
-
35
- export type { ButtonProps, HeaderProps, InputProps, MessagesProps, ResponseButtonProps, SuggestionsProps, WindowProps };
@@ -1,10 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
-
3
- declare function CopilotDevConsole(): react_jsx_runtime.JSX.Element | null;
4
- declare function DebugMenuButton({ setShowDevConsole, checkForUpdates, mode, }: {
5
- setShowDevConsole: (show: boolean) => void;
6
- checkForUpdates: (force: boolean) => void;
7
- mode: "full" | "compact";
8
- }): react_jsx_runtime.JSX.Element;
9
-
10
- export { CopilotDevConsole, DebugMenuButton as default };
@@ -1,9 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
-
3
- declare const ExclamationMarkTriangleIcon: react_jsx_runtime.JSX.Element;
4
- declare const ExclamationMarkIcon: react_jsx_runtime.JSX.Element;
5
- declare const ChevronDownIcon: react_jsx_runtime.JSX.Element;
6
- declare const CheckIcon: react_jsx_runtime.JSX.Element;
7
- declare const CopilotKitIcon: react_jsx_runtime.JSX.Element;
8
-
9
- export { CheckIcon, ChevronDownIcon, CopilotKitIcon, ExclamationMarkIcon, ExclamationMarkTriangleIcon };
@@ -1,5 +0,0 @@
1
- export { shouldShowDevConsole } from './utils.mjs';
2
- export { CopilotDevConsole } from './console.mjs';
3
- import '@copilotkit/react-core';
4
- import './types.mjs';
5
- import 'react/jsx-runtime';
@@ -1,9 +0,0 @@
1
- interface CopilotKitVersion {
2
- current: string;
3
- latest: string;
4
- severity: "low" | "medium" | "high";
5
- advisory: string | null;
6
- lastChecked: number;
7
- }
8
-
9
- export type { CopilotKitVersion };
@@ -1,10 +0,0 @@
1
- import { CopilotContextParams } from '@copilotkit/react-core';
2
- import { CopilotKitVersion } from './types.mjs';
3
-
4
- declare function shouldShowDevConsole(showDevConsole: boolean | "auto"): boolean;
5
- declare function getPublishedCopilotKitVersion(current: string, forceCheck?: boolean): Promise<CopilotKitVersion>;
6
- declare function logReadables(context: CopilotContextParams): void;
7
- declare function logActions(context: CopilotContextParams): void;
8
- declare function logMessages(context: CopilotContextParams): void;
9
-
10
- export { getPublishedCopilotKitVersion, logActions, logMessages, logReadables, shouldShowDevConsole };
@@ -1,11 +0,0 @@
1
- export { ButtonProps, HeaderProps, InputProps, MessagesProps, ResponseButtonProps, SuggestionsProps, WindowProps } from './chat/props.mjs';
2
- export { CopilotPopup } from './chat/Popup.mjs';
3
- export { CopilotSidebar } from './chat/Sidebar.mjs';
4
- export { CopilotChat } from './chat/Chat.mjs';
5
- export { useChatContext } from './chat/ChatContext.mjs';
6
- import '@copilotkit/runtime-client-gql';
7
- import 'react/jsx-runtime';
8
- import './chat/Modal.mjs';
9
- import 'react';
10
- import '@copilotkit/react-core';
11
- import '../types/suggestions.mjs';
@@ -1,2 +0,0 @@
1
-
2
- export { }
@@ -1 +0,0 @@
1
- export { useCopilotChatSuggestions } from './use-copilot-chat-suggestions.mjs';