@copilotkit/react-ui 1.10.0-next.2 → 1.10.0-next.4

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 (82) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/{chunk-O7KTFUAN.mjs → chunk-226ZMOE3.mjs} +2 -2
  3. package/dist/{chunk-QNG5G23E.mjs → chunk-2TABXABK.mjs} +2 -2
  4. package/dist/{chunk-SGFUVPDB.mjs → chunk-FFJHOZX6.mjs} +2 -2
  5. package/dist/{chunk-GVKA7RQQ.mjs → chunk-GDSZGYCE.mjs} +2 -2
  6. package/dist/{chunk-QN7T3GWI.mjs → chunk-JY2CSDKN.mjs} +4 -6
  7. package/dist/chunk-JY2CSDKN.mjs.map +1 -0
  8. package/dist/{chunk-7L34XQRL.mjs → chunk-P6O2MZGT.mjs} +4 -4
  9. package/dist/chunk-P6O2MZGT.mjs.map +1 -0
  10. package/dist/{chunk-DNSSBMAS.mjs → chunk-QKDRZ7WA.mjs} +4 -4
  11. package/dist/{chunk-WHDNKXMP.mjs → chunk-U5ATIGWH.mjs} +2 -2
  12. package/dist/chunk-U5ATIGWH.mjs.map +1 -0
  13. package/dist/{chunk-Q2467VHZ.mjs → chunk-W26XFBEG.mjs} +2 -2
  14. package/dist/chunk-W26XFBEG.mjs.map +1 -0
  15. package/dist/{chunk-PF3QW6U5.mjs → chunk-WYEGK6BP.mjs} +2 -2
  16. package/dist/components/chat/Chat.d.ts +11 -9
  17. package/dist/components/chat/Chat.js +3 -3
  18. package/dist/components/chat/Chat.js.map +1 -1
  19. package/dist/components/chat/Chat.mjs +4 -4
  20. package/dist/components/chat/Header.js +6 -8
  21. package/dist/components/chat/Header.js.map +1 -1
  22. package/dist/components/chat/Header.mjs +3 -3
  23. package/dist/components/chat/Messages.js +1 -1
  24. package/dist/components/chat/Messages.js.map +1 -1
  25. package/dist/components/chat/Messages.mjs +1 -1
  26. package/dist/components/chat/Modal.d.ts +1 -1
  27. package/dist/components/chat/Modal.js +23 -25
  28. package/dist/components/chat/Modal.js.map +1 -1
  29. package/dist/components/chat/Modal.mjs +8 -8
  30. package/dist/components/chat/Popup.d.ts +1 -1
  31. package/dist/components/chat/Popup.js +23 -25
  32. package/dist/components/chat/Popup.js.map +1 -1
  33. package/dist/components/chat/Popup.mjs +9 -9
  34. package/dist/components/chat/Sidebar.d.ts +1 -1
  35. package/dist/components/chat/Sidebar.js +23 -25
  36. package/dist/components/chat/Sidebar.js.map +1 -1
  37. package/dist/components/chat/Sidebar.mjs +9 -9
  38. package/dist/components/chat/Suggestion.js +1 -1
  39. package/dist/components/chat/Suggestion.js.map +1 -1
  40. package/dist/components/chat/Suggestion.mjs +1 -1
  41. package/dist/components/chat/Suggestions.js +1 -1
  42. package/dist/components/chat/Suggestions.js.map +1 -1
  43. package/dist/components/chat/Suggestions.mjs +2 -2
  44. package/dist/components/chat/index.d.ts +1 -1
  45. package/dist/components/chat/index.js +23 -25
  46. package/dist/components/chat/index.js.map +1 -1
  47. package/dist/components/chat/index.mjs +10 -10
  48. package/dist/components/dev-console/console.d.ts +1 -0
  49. package/dist/components/dev-console/console.js +6 -8
  50. package/dist/components/dev-console/console.js.map +1 -1
  51. package/dist/components/dev-console/console.mjs +2 -2
  52. package/dist/components/dev-console/index.d.ts +1 -3
  53. package/dist/components/dev-console/index.js +7 -9
  54. package/dist/components/dev-console/index.js.map +1 -1
  55. package/dist/components/dev-console/index.mjs +2 -2
  56. package/dist/components/dev-console/utils.d.ts +2 -2
  57. package/dist/components/dev-console/utils.js +2 -4
  58. package/dist/components/dev-console/utils.js.map +1 -1
  59. package/dist/components/dev-console/utils.mjs +1 -1
  60. package/dist/components/index.d.ts +2 -4
  61. package/dist/components/index.js +24 -26
  62. package/dist/components/index.js.map +1 -1
  63. package/dist/components/index.mjs +10 -10
  64. package/dist/index.d.ts +2 -4
  65. package/dist/index.js +26 -28
  66. package/dist/index.js.map +1 -1
  67. package/dist/index.mjs +10 -10
  68. package/package.json +5 -5
  69. package/src/components/chat/Chat.tsx +1 -1
  70. package/src/components/chat/Messages.tsx +2 -2
  71. package/src/components/chat/Suggestion.tsx +1 -1
  72. package/src/components/dev-console/utils.ts +1 -6
  73. package/dist/chunk-7L34XQRL.mjs.map +0 -1
  74. package/dist/chunk-Q2467VHZ.mjs.map +0 -1
  75. package/dist/chunk-QN7T3GWI.mjs.map +0 -1
  76. package/dist/chunk-WHDNKXMP.mjs.map +0 -1
  77. /package/dist/{chunk-O7KTFUAN.mjs.map → chunk-226ZMOE3.mjs.map} +0 -0
  78. /package/dist/{chunk-QNG5G23E.mjs.map → chunk-2TABXABK.mjs.map} +0 -0
  79. /package/dist/{chunk-SGFUVPDB.mjs.map → chunk-FFJHOZX6.mjs.map} +0 -0
  80. /package/dist/{chunk-GVKA7RQQ.mjs.map → chunk-GDSZGYCE.mjs.map} +0 -0
  81. /package/dist/{chunk-DNSSBMAS.mjs.map → chunk-QKDRZ7WA.mjs.map} +0 -0
  82. /package/dist/{chunk-PF3QW6U5.mjs.map → chunk-WYEGK6BP.mjs.map} +0 -0
@@ -2,29 +2,29 @@ import "../chunk-MMVDU6DF.mjs";
2
2
  import "../chunk-SC6JRFAJ.mjs";
3
3
  import {
4
4
  CopilotSidebar
5
- } from "../chunk-QNG5G23E.mjs";
5
+ } from "../chunk-2TABXABK.mjs";
6
6
  import "../chunk-WB3YULQ4.mjs";
7
7
  import {
8
8
  CopilotPopup
9
- } from "../chunk-PF3QW6U5.mjs";
10
- import "../chunk-DNSSBMAS.mjs";
9
+ } from "../chunk-WYEGK6BP.mjs";
10
+ import "../chunk-QKDRZ7WA.mjs";
11
11
  import "../chunk-C3GSYRC3.mjs";
12
- import "../chunk-GVKA7RQQ.mjs";
12
+ import "../chunk-GDSZGYCE.mjs";
13
13
  import "../chunk-V7W6IM2V.mjs";
14
14
  import {
15
15
  CopilotDevConsole
16
- } from "../chunk-SGFUVPDB.mjs";
16
+ } from "../chunk-FFJHOZX6.mjs";
17
17
  import "../chunk-Q5V6S67N.mjs";
18
18
  import {
19
19
  shouldShowDevConsole
20
- } from "../chunk-QN7T3GWI.mjs";
20
+ } from "../chunk-JY2CSDKN.mjs";
21
21
  import "../chunk-KXE2JCUH.mjs";
22
22
  import "../chunk-NRA3CFEE.mjs";
23
23
  import "../chunk-BH6PCAAL.mjs";
24
24
  import "../chunk-UFN2VWSR.mjs";
25
25
  import {
26
26
  CopilotChat
27
- } from "../chunk-7L34XQRL.mjs";
27
+ } from "../chunk-P6O2MZGT.mjs";
28
28
  import "../chunk-JHUTTP5C.mjs";
29
29
  import {
30
30
  AssistantMessage
@@ -37,10 +37,10 @@ import {
37
37
  } from "../chunk-VVL6JFCJ.mjs";
38
38
  import {
39
39
  Suggestions
40
- } from "../chunk-O7KTFUAN.mjs";
40
+ } from "../chunk-226ZMOE3.mjs";
41
41
  import {
42
42
  Suggestion
43
- } from "../chunk-Q2467VHZ.mjs";
43
+ } from "../chunk-W26XFBEG.mjs";
44
44
  import "../chunk-PLHTVHUW.mjs";
45
45
  import "../chunk-DTRPPNSA.mjs";
46
46
  import "../chunk-CGEAG65D.mjs";
@@ -48,7 +48,7 @@ import "../chunk-QIOJXTIQ.mjs";
48
48
  import {
49
49
  Markdown
50
50
  } from "../chunk-E6MQUIZW.mjs";
51
- import "../chunk-WHDNKXMP.mjs";
51
+ import "../chunk-U5ATIGWH.mjs";
52
52
  import {
53
53
  useChatContext
54
54
  } from "../chunk-IEMQ2SQW.mjs";
package/dist/index.d.ts CHANGED
@@ -9,7 +9,7 @@ export { ImageRenderer } from './components/chat/messages/ImageRenderer.js';
9
9
  export { useChatContext } from './components/chat/ChatContext.js';
10
10
  export { Suggestions as RenderSuggestionsList } from './components/chat/Suggestions.js';
11
11
  export { Suggestion as RenderSuggestion } from './components/chat/Suggestion.js';
12
- export { shouldShowDevConsole } from './components/dev-console/utils.js';
12
+ export { shouldShowDevConsole } from '@copilotkit/react-core';
13
13
  export { CopilotDevConsole } from './components/dev-console/console.js';
14
14
  export { useCopilotChatSuggestions } from './hooks/use-copilot-chat-suggestions.js';
15
15
  export { CopilotKitCSSProperties } from './types/css.js';
@@ -20,9 +20,7 @@ import 'react/jsx-runtime';
20
20
  import './components/chat/Modal.js';
21
21
  import '@copilotkit/react-core/dist/types/coagent-state';
22
22
  import '@copilotkit/react-core/dist/hooks/use-tree';
23
- import '@copilotkit/react-core/dist/copilot-context-bd88d30d';
23
+ import '@copilotkit/react-core/dist/copilot-context-78fc727c';
24
24
  import '@copilotkit/react-core/dist/types/coagent-action';
25
- import '@copilotkit/react-core';
26
25
  import '@copilotkit/runtime-client-gql';
27
26
  import 'react-markdown';
28
- import './components/dev-console/types.js';
package/dist/index.js CHANGED
@@ -90,7 +90,7 @@ __export(src_exports, {
90
90
  RenderSuggestion: () => Suggestion,
91
91
  RenderSuggestionsList: () => Suggestions,
92
92
  UserMessage: () => UserMessage,
93
- shouldShowDevConsole: () => shouldShowDevConsole,
93
+ shouldShowDevConsole: () => import_react_core3.shouldShowDevConsole,
94
94
  useChatContext: () => useChatContext,
95
95
  useCopilotChatSuggestions: () => useCopilotChatSuggestions
96
96
  });
@@ -537,9 +537,7 @@ var Button = ({}) => {
537
537
 
538
538
  // src/components/dev-console/utils.ts
539
539
  var import_react_core2 = require("@copilotkit/react-core");
540
- function shouldShowDevConsole(showDevConsole) {
541
- return showDevConsole;
542
- }
540
+ var import_react_core3 = require("@copilotkit/react-core");
543
541
  function getPublishedCopilotKitVersion(current, forceCheck = false) {
544
542
  return __async(this, null, function* () {
545
543
  const LOCAL_STORAGE_KEY = "__copilotkit_version_check__";
@@ -659,7 +657,7 @@ function logMessages(context) {
659
657
  }
660
658
 
661
659
  // src/components/dev-console/console.tsx
662
- var import_react_core3 = require("@copilotkit/react-core");
660
+ var import_react_core4 = require("@copilotkit/react-core");
663
661
  var import_react4 = require("react");
664
662
 
665
663
  // src/components/dev-console/icons.tsx
@@ -849,10 +847,10 @@ function CopilotKitHelpModal() {
849
847
  var import_jsx_runtime8 = require("react/jsx-runtime");
850
848
  function CopilotDevConsole() {
851
849
  const currentVersion = import_shared2.COPILOTKIT_VERSION;
852
- const context = (0, import_react_core3.useCopilotContext)();
850
+ const context = (0, import_react_core4.useCopilotContext)();
853
851
  const [showDevConsole, setShowDevConsole] = (0, import_react4.useState)(false);
854
852
  (0, import_react4.useEffect)(() => {
855
- setShowDevConsole(shouldShowDevConsole(context.showDevConsole));
853
+ setShowDevConsole((0, import_react_core3.shouldShowDevConsole)(context.showDevConsole));
856
854
  }, [context.showDevConsole]);
857
855
  const dontRunTwiceInDevMode = (0, import_react4.useRef)(false);
858
856
  const [versionStatus, setVersionStatus] = (0, import_react4.useState)("unknown");
@@ -978,8 +976,8 @@ function DebugMenuButton({
978
976
  checkForUpdates,
979
977
  mode
980
978
  }) {
981
- const context = (0, import_react_core3.useCopilotContext)();
982
- const messagesContext = (0, import_react_core3.useCopilotMessagesContext)();
979
+ const context = (0, import_react_core4.useCopilotContext)();
980
+ const messagesContext = (0, import_react_core4.useCopilotMessagesContext)();
983
981
  return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_jsx_runtime8.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_react5.Menu, { children: [
984
982
  /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
985
983
  import_react5.MenuButton,
@@ -1041,7 +1039,7 @@ var Header = ({}) => {
1041
1039
 
1042
1040
  // src/components/chat/Messages.tsx
1043
1041
  var import_react6 = require("react");
1044
- var import_react_core4 = require("@copilotkit/react-core");
1042
+ var import_react_core5 = require("@copilotkit/react-core");
1045
1043
  var import_jsx_runtime10 = require("react/jsx-runtime");
1046
1044
  var Messages = ({
1047
1045
  inProgress,
@@ -1056,7 +1054,7 @@ var Messages = ({
1056
1054
  markdownTagRenderers
1057
1055
  }) => {
1058
1056
  const { labels } = useChatContext();
1059
- const { visibleMessages, interrupt } = (0, import_react_core4.useCopilotChat)();
1057
+ const { visibleMessages, interrupt } = (0, import_react_core5.useCopilotChatInternal)();
1060
1058
  const initialMessages = (0, import_react6.useMemo)(() => makeInitialMessages(labels.initial), [labels.initial]);
1061
1059
  const messages = [...initialMessages, ...visibleMessages];
1062
1060
  const { messagesContainerRef, messagesEndRef } = useScrollToBottom(messages);
@@ -1229,7 +1227,7 @@ var AutoResizingTextarea = (0, import_react7.forwardRef)(
1229
1227
  var Textarea_default = AutoResizingTextarea;
1230
1228
 
1231
1229
  // src/hooks/use-push-to-talk.tsx
1232
- var import_react_core5 = require("@copilotkit/react-core");
1230
+ var import_react_core6 = require("@copilotkit/react-core");
1233
1231
  var import_runtime_client_gql = require("@copilotkit/runtime-client-gql");
1234
1232
  var import_react8 = require("react");
1235
1233
  var startRecording = (mediaStreamRef, mediaRecorderRef, audioContextRef, recordedChunks, onStop) => __async(void 0, null, function* () {
@@ -1285,8 +1283,8 @@ var usePushToTalk = ({
1285
1283
  const audioContextRef = (0, import_react8.useRef)(null);
1286
1284
  const mediaRecorderRef = (0, import_react8.useRef)(null);
1287
1285
  const recordedChunks = (0, import_react8.useRef)([]);
1288
- const generalContext = (0, import_react_core5.useCopilotContext)();
1289
- const messagesContext = (0, import_react_core5.useCopilotMessagesContext)();
1286
+ const generalContext = (0, import_react_core6.useCopilotContext)();
1287
+ const messagesContext = (0, import_react_core6.useCopilotMessagesContext)();
1290
1288
  const context = __spreadValues(__spreadValues({}, generalContext), messagesContext);
1291
1289
  const [startReadingFromMessageId, setStartReadingFromMessageId] = (0, import_react8.useState)(null);
1292
1290
  (0, import_react8.useEffect)(() => {
@@ -1333,7 +1331,7 @@ var usePushToTalk = ({
1333
1331
  };
1334
1332
 
1335
1333
  // src/components/chat/Input.tsx
1336
- var import_react_core6 = require("@copilotkit/react-core");
1334
+ var import_react_core7 = require("@copilotkit/react-core");
1337
1335
 
1338
1336
  // src/hooks/use-dark-mode.ts
1339
1337
  var useDarkMode = () => {
@@ -1374,7 +1372,7 @@ var Input = ({
1374
1372
  }) => {
1375
1373
  var _a, _b;
1376
1374
  const context = useChatContext();
1377
- const copilotContext = (0, import_react_core6.useCopilotContext)();
1375
+ const copilotContext = (0, import_react_core7.useCopilotContext)();
1378
1376
  const showPoweredBy = !((_a = copilotContext.copilotApiConfig) == null ? void 0 : _a.publicApiKey);
1379
1377
  const pushToTalkConfigured = copilotContext.copilotApiConfig.textToSpeechUrl !== void 0 && copilotContext.copilotApiConfig.transcribeAudioUrl !== void 0;
1380
1378
  const textareaRef = (0, import_react9.useRef)(null);
@@ -2181,9 +2179,9 @@ function RenderMessage(_a) {
2181
2179
 
2182
2180
  // src/components/chat/Chat.tsx
2183
2181
  var import_react14 = __toESM(require("react"));
2184
- var import_react_core8 = require("@copilotkit/react-core");
2185
- var import_shared3 = require("@copilotkit/shared");
2186
2182
  var import_react_core9 = require("@copilotkit/react-core");
2183
+ var import_shared3 = require("@copilotkit/shared");
2184
+ var import_react_core10 = require("@copilotkit/react-core");
2187
2185
 
2188
2186
  // src/components/chat/ImageUploadQueue.tsx
2189
2187
  var import_jsx_runtime20 = require("react/jsx-runtime");
@@ -2264,12 +2262,12 @@ var ImageUploadQueue = ({
2264
2262
  };
2265
2263
 
2266
2264
  // src/components/chat/Suggestion.tsx
2267
- var import_react_core7 = require("@copilotkit/react-core");
2265
+ var import_react_core8 = require("@copilotkit/react-core");
2268
2266
  var import_jsx_runtime21 = require("react/jsx-runtime");
2269
2267
  function Suggestion({ title, onClick, partial, className }) {
2270
2268
  if (!title)
2271
2269
  return null;
2272
- const { isLoading } = (0, import_react_core7.useCopilotChat)();
2270
+ const { isLoading } = (0, import_react_core8.useCopilotChatInternal)();
2273
2271
  return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
2274
2272
  "button",
2275
2273
  {
@@ -2330,7 +2328,7 @@ function CopilotChat({
2330
2328
  inputFileAccept = "image/*",
2331
2329
  hideStopButton
2332
2330
  }) {
2333
- const { additionalInstructions, setChatInstructions } = (0, import_react_core8.useCopilotContext)();
2331
+ const { additionalInstructions, setChatInstructions } = (0, import_react_core9.useCopilotContext)();
2334
2332
  const [selectedImages, setSelectedImages] = (0, import_react14.useState)([]);
2335
2333
  const fileInputRef = (0, import_react14.useRef)(null);
2336
2334
  (0, import_react14.useEffect)(() => {
@@ -2542,11 +2540,11 @@ var useCopilotChatLogic = (chatSuggestions, makeSystemMessage, onInProgress, onS
2542
2540
  generateSuggestions,
2543
2541
  resetSuggestions: resetSuggestionsFromHook,
2544
2542
  isLoadingSuggestions
2545
- } = (0, import_react_core8.useCopilotChat)({
2543
+ } = (0, import_react_core9.useCopilotChatInternal)({
2546
2544
  makeSystemMessage
2547
2545
  });
2548
- const generalContext = (0, import_react_core8.useCopilotContext)();
2549
- const messagesContext = (0, import_react_core8.useCopilotMessagesContext)();
2546
+ const generalContext = (0, import_react_core9.useCopilotContext)();
2547
+ const messagesContext = (0, import_react_core9.useCopilotMessagesContext)();
2550
2548
  const { actions } = generalContext;
2551
2549
  const [suggestionsFailed, setSuggestionsFailed] = (0, import_react14.useState)(false);
2552
2550
  const hasGeneratedInitialSuggestions = (0, import_react14.useRef)(false);
@@ -2689,7 +2687,7 @@ var useCopilotChatLogic = (chatSuggestions, makeSystemMessage, onInProgress, onS
2689
2687
  });
2690
2688
  const runCurrentAgent = (hint) => __async(void 0, null, function* () {
2691
2689
  if (generalContext.agentSession) {
2692
- yield (0, import_react_core9.runAgent)(
2690
+ yield (0, import_react_core10.runAgent)(
2693
2691
  generalContext.agentSession.agentName,
2694
2692
  stableContext,
2695
2693
  appendMessage,
@@ -2700,7 +2698,7 @@ var useCopilotChatLogic = (chatSuggestions, makeSystemMessage, onInProgress, onS
2700
2698
  });
2701
2699
  const stopCurrentAgent = () => {
2702
2700
  if (generalContext.agentSession) {
2703
- (0, import_react_core9.stopAgent)(generalContext.agentSession.agentName, stableContext);
2701
+ (0, import_react_core10.stopAgent)(generalContext.agentSession.agentName, stableContext);
2704
2702
  }
2705
2703
  };
2706
2704
  const setCurrentAgentState = (state) => {
@@ -2897,7 +2895,7 @@ function CopilotSidebar(props) {
2897
2895
 
2898
2896
  // src/hooks/use-copilot-chat-suggestions.tsx
2899
2897
  var import_react17 = require("react");
2900
- var import_react_core10 = require("@copilotkit/react-core");
2898
+ var import_react_core11 = require("@copilotkit/react-core");
2901
2899
  var import_shared4 = require("@copilotkit/shared");
2902
2900
  function useCopilotChatSuggestions({
2903
2901
  available = "enabled",
@@ -2906,7 +2904,7 @@ function useCopilotChatSuggestions({
2906
2904
  minSuggestions = 1,
2907
2905
  maxSuggestions = 3
2908
2906
  }, dependencies = []) {
2909
- const context = (0, import_react_core10.useCopilotContext)();
2907
+ const context = (0, import_react_core11.useCopilotContext)();
2910
2908
  (0, import_react17.useEffect)(() => {
2911
2909
  if (available === "disabled")
2912
2910
  return;