@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.
- package/CHANGELOG.md +18 -0
- package/dist/{chunk-O7KTFUAN.mjs → chunk-226ZMOE3.mjs} +2 -2
- package/dist/{chunk-QNG5G23E.mjs → chunk-2TABXABK.mjs} +2 -2
- package/dist/{chunk-SGFUVPDB.mjs → chunk-FFJHOZX6.mjs} +2 -2
- package/dist/{chunk-GVKA7RQQ.mjs → chunk-GDSZGYCE.mjs} +2 -2
- package/dist/{chunk-QN7T3GWI.mjs → chunk-JY2CSDKN.mjs} +4 -6
- package/dist/chunk-JY2CSDKN.mjs.map +1 -0
- package/dist/{chunk-7L34XQRL.mjs → chunk-P6O2MZGT.mjs} +4 -4
- package/dist/chunk-P6O2MZGT.mjs.map +1 -0
- package/dist/{chunk-DNSSBMAS.mjs → chunk-QKDRZ7WA.mjs} +4 -4
- package/dist/{chunk-WHDNKXMP.mjs → chunk-U5ATIGWH.mjs} +2 -2
- package/dist/chunk-U5ATIGWH.mjs.map +1 -0
- package/dist/{chunk-Q2467VHZ.mjs → chunk-W26XFBEG.mjs} +2 -2
- package/dist/chunk-W26XFBEG.mjs.map +1 -0
- package/dist/{chunk-PF3QW6U5.mjs → chunk-WYEGK6BP.mjs} +2 -2
- package/dist/components/chat/Chat.d.ts +11 -9
- package/dist/components/chat/Chat.js +3 -3
- package/dist/components/chat/Chat.js.map +1 -1
- package/dist/components/chat/Chat.mjs +4 -4
- package/dist/components/chat/Header.js +6 -8
- package/dist/components/chat/Header.js.map +1 -1
- package/dist/components/chat/Header.mjs +3 -3
- package/dist/components/chat/Messages.js +1 -1
- package/dist/components/chat/Messages.js.map +1 -1
- package/dist/components/chat/Messages.mjs +1 -1
- package/dist/components/chat/Modal.d.ts +1 -1
- package/dist/components/chat/Modal.js +23 -25
- package/dist/components/chat/Modal.js.map +1 -1
- package/dist/components/chat/Modal.mjs +8 -8
- package/dist/components/chat/Popup.d.ts +1 -1
- package/dist/components/chat/Popup.js +23 -25
- package/dist/components/chat/Popup.js.map +1 -1
- package/dist/components/chat/Popup.mjs +9 -9
- package/dist/components/chat/Sidebar.d.ts +1 -1
- package/dist/components/chat/Sidebar.js +23 -25
- package/dist/components/chat/Sidebar.js.map +1 -1
- package/dist/components/chat/Sidebar.mjs +9 -9
- package/dist/components/chat/Suggestion.js +1 -1
- package/dist/components/chat/Suggestion.js.map +1 -1
- package/dist/components/chat/Suggestion.mjs +1 -1
- package/dist/components/chat/Suggestions.js +1 -1
- package/dist/components/chat/Suggestions.js.map +1 -1
- package/dist/components/chat/Suggestions.mjs +2 -2
- package/dist/components/chat/index.d.ts +1 -1
- package/dist/components/chat/index.js +23 -25
- package/dist/components/chat/index.js.map +1 -1
- package/dist/components/chat/index.mjs +10 -10
- package/dist/components/dev-console/console.d.ts +1 -0
- package/dist/components/dev-console/console.js +6 -8
- package/dist/components/dev-console/console.js.map +1 -1
- package/dist/components/dev-console/console.mjs +2 -2
- package/dist/components/dev-console/index.d.ts +1 -3
- package/dist/components/dev-console/index.js +7 -9
- package/dist/components/dev-console/index.js.map +1 -1
- package/dist/components/dev-console/index.mjs +2 -2
- package/dist/components/dev-console/utils.d.ts +2 -2
- package/dist/components/dev-console/utils.js +2 -4
- package/dist/components/dev-console/utils.js.map +1 -1
- package/dist/components/dev-console/utils.mjs +1 -1
- package/dist/components/index.d.ts +2 -4
- package/dist/components/index.js +24 -26
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +10 -10
- package/dist/index.d.ts +2 -4
- package/dist/index.js +26 -28
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -10
- package/package.json +5 -5
- package/src/components/chat/Chat.tsx +1 -1
- package/src/components/chat/Messages.tsx +2 -2
- package/src/components/chat/Suggestion.tsx +1 -1
- package/src/components/dev-console/utils.ts +1 -6
- package/dist/chunk-7L34XQRL.mjs.map +0 -1
- package/dist/chunk-Q2467VHZ.mjs.map +0 -1
- package/dist/chunk-QN7T3GWI.mjs.map +0 -1
- package/dist/chunk-WHDNKXMP.mjs.map +0 -1
- /package/dist/{chunk-O7KTFUAN.mjs.map → chunk-226ZMOE3.mjs.map} +0 -0
- /package/dist/{chunk-QNG5G23E.mjs.map → chunk-2TABXABK.mjs.map} +0 -0
- /package/dist/{chunk-SGFUVPDB.mjs.map → chunk-FFJHOZX6.mjs.map} +0 -0
- /package/dist/{chunk-GVKA7RQQ.mjs.map → chunk-GDSZGYCE.mjs.map} +0 -0
- /package/dist/{chunk-DNSSBMAS.mjs.map → chunk-QKDRZ7WA.mjs.map} +0 -0
- /package/dist/{chunk-PF3QW6U5.mjs.map → chunk-WYEGK6BP.mjs.map} +0 -0
package/dist/components/index.js
CHANGED
|
@@ -89,7 +89,7 @@ __export(components_exports, {
|
|
|
89
89
|
RenderSuggestion: () => Suggestion,
|
|
90
90
|
RenderSuggestionsList: () => Suggestions,
|
|
91
91
|
UserMessage: () => UserMessage,
|
|
92
|
-
shouldShowDevConsole: () => shouldShowDevConsole,
|
|
92
|
+
shouldShowDevConsole: () => import_react_core3.shouldShowDevConsole,
|
|
93
93
|
useChatContext: () => useChatContext
|
|
94
94
|
});
|
|
95
95
|
module.exports = __toCommonJS(components_exports);
|
|
@@ -535,9 +535,7 @@ var Button = ({}) => {
|
|
|
535
535
|
|
|
536
536
|
// src/components/dev-console/utils.ts
|
|
537
537
|
var import_react_core2 = require("@copilotkit/react-core");
|
|
538
|
-
|
|
539
|
-
return showDevConsole;
|
|
540
|
-
}
|
|
538
|
+
var import_react_core3 = require("@copilotkit/react-core");
|
|
541
539
|
function getPublishedCopilotKitVersion(current, forceCheck = false) {
|
|
542
540
|
return __async(this, null, function* () {
|
|
543
541
|
const LOCAL_STORAGE_KEY = "__copilotkit_version_check__";
|
|
@@ -657,7 +655,7 @@ function logMessages(context) {
|
|
|
657
655
|
}
|
|
658
656
|
|
|
659
657
|
// src/components/dev-console/console.tsx
|
|
660
|
-
var
|
|
658
|
+
var import_react_core4 = require("@copilotkit/react-core");
|
|
661
659
|
var import_react4 = require("react");
|
|
662
660
|
|
|
663
661
|
// src/components/dev-console/icons.tsx
|
|
@@ -847,10 +845,10 @@ function CopilotKitHelpModal() {
|
|
|
847
845
|
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
848
846
|
function CopilotDevConsole() {
|
|
849
847
|
const currentVersion = import_shared2.COPILOTKIT_VERSION;
|
|
850
|
-
const context = (0,
|
|
848
|
+
const context = (0, import_react_core4.useCopilotContext)();
|
|
851
849
|
const [showDevConsole, setShowDevConsole] = (0, import_react4.useState)(false);
|
|
852
850
|
(0, import_react4.useEffect)(() => {
|
|
853
|
-
setShowDevConsole(shouldShowDevConsole(context.showDevConsole));
|
|
851
|
+
setShowDevConsole((0, import_react_core3.shouldShowDevConsole)(context.showDevConsole));
|
|
854
852
|
}, [context.showDevConsole]);
|
|
855
853
|
const dontRunTwiceInDevMode = (0, import_react4.useRef)(false);
|
|
856
854
|
const [versionStatus, setVersionStatus] = (0, import_react4.useState)("unknown");
|
|
@@ -976,8 +974,8 @@ function DebugMenuButton({
|
|
|
976
974
|
checkForUpdates,
|
|
977
975
|
mode
|
|
978
976
|
}) {
|
|
979
|
-
const context = (0,
|
|
980
|
-
const messagesContext = (0,
|
|
977
|
+
const context = (0, import_react_core4.useCopilotContext)();
|
|
978
|
+
const messagesContext = (0, import_react_core4.useCopilotMessagesContext)();
|
|
981
979
|
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_jsx_runtime8.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_react5.Menu, { children: [
|
|
982
980
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
983
981
|
import_react5.MenuButton,
|
|
@@ -1039,7 +1037,7 @@ var Header = ({}) => {
|
|
|
1039
1037
|
|
|
1040
1038
|
// src/components/chat/Messages.tsx
|
|
1041
1039
|
var import_react6 = require("react");
|
|
1042
|
-
var
|
|
1040
|
+
var import_react_core5 = require("@copilotkit/react-core");
|
|
1043
1041
|
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
1044
1042
|
var Messages = ({
|
|
1045
1043
|
inProgress,
|
|
@@ -1054,7 +1052,7 @@ var Messages = ({
|
|
|
1054
1052
|
markdownTagRenderers
|
|
1055
1053
|
}) => {
|
|
1056
1054
|
const { labels } = useChatContext();
|
|
1057
|
-
const { visibleMessages, interrupt } = (0,
|
|
1055
|
+
const { visibleMessages, interrupt } = (0, import_react_core5.useCopilotChatInternal)();
|
|
1058
1056
|
const initialMessages = (0, import_react6.useMemo)(() => makeInitialMessages(labels.initial), [labels.initial]);
|
|
1059
1057
|
const messages = [...initialMessages, ...visibleMessages];
|
|
1060
1058
|
const { messagesContainerRef, messagesEndRef } = useScrollToBottom(messages);
|
|
@@ -1227,7 +1225,7 @@ var AutoResizingTextarea = (0, import_react7.forwardRef)(
|
|
|
1227
1225
|
var Textarea_default = AutoResizingTextarea;
|
|
1228
1226
|
|
|
1229
1227
|
// src/hooks/use-push-to-talk.tsx
|
|
1230
|
-
var
|
|
1228
|
+
var import_react_core6 = require("@copilotkit/react-core");
|
|
1231
1229
|
var import_runtime_client_gql = require("@copilotkit/runtime-client-gql");
|
|
1232
1230
|
var import_react8 = require("react");
|
|
1233
1231
|
var startRecording = (mediaStreamRef, mediaRecorderRef, audioContextRef, recordedChunks, onStop) => __async(void 0, null, function* () {
|
|
@@ -1283,8 +1281,8 @@ var usePushToTalk = ({
|
|
|
1283
1281
|
const audioContextRef = (0, import_react8.useRef)(null);
|
|
1284
1282
|
const mediaRecorderRef = (0, import_react8.useRef)(null);
|
|
1285
1283
|
const recordedChunks = (0, import_react8.useRef)([]);
|
|
1286
|
-
const generalContext = (0,
|
|
1287
|
-
const messagesContext = (0,
|
|
1284
|
+
const generalContext = (0, import_react_core6.useCopilotContext)();
|
|
1285
|
+
const messagesContext = (0, import_react_core6.useCopilotMessagesContext)();
|
|
1288
1286
|
const context = __spreadValues(__spreadValues({}, generalContext), messagesContext);
|
|
1289
1287
|
const [startReadingFromMessageId, setStartReadingFromMessageId] = (0, import_react8.useState)(null);
|
|
1290
1288
|
(0, import_react8.useEffect)(() => {
|
|
@@ -1331,7 +1329,7 @@ var usePushToTalk = ({
|
|
|
1331
1329
|
};
|
|
1332
1330
|
|
|
1333
1331
|
// src/components/chat/Input.tsx
|
|
1334
|
-
var
|
|
1332
|
+
var import_react_core7 = require("@copilotkit/react-core");
|
|
1335
1333
|
|
|
1336
1334
|
// src/hooks/use-dark-mode.ts
|
|
1337
1335
|
var useDarkMode = () => {
|
|
@@ -1372,7 +1370,7 @@ var Input = ({
|
|
|
1372
1370
|
}) => {
|
|
1373
1371
|
var _a, _b;
|
|
1374
1372
|
const context = useChatContext();
|
|
1375
|
-
const copilotContext = (0,
|
|
1373
|
+
const copilotContext = (0, import_react_core7.useCopilotContext)();
|
|
1376
1374
|
const showPoweredBy = !((_a = copilotContext.copilotApiConfig) == null ? void 0 : _a.publicApiKey);
|
|
1377
1375
|
const pushToTalkConfigured = copilotContext.copilotApiConfig.textToSpeechUrl !== void 0 && copilotContext.copilotApiConfig.transcribeAudioUrl !== void 0;
|
|
1378
1376
|
const textareaRef = (0, import_react9.useRef)(null);
|
|
@@ -2179,9 +2177,9 @@ function RenderMessage(_a) {
|
|
|
2179
2177
|
|
|
2180
2178
|
// src/components/chat/Chat.tsx
|
|
2181
2179
|
var import_react14 = __toESM(require("react"));
|
|
2182
|
-
var import_react_core8 = require("@copilotkit/react-core");
|
|
2183
|
-
var import_shared3 = require("@copilotkit/shared");
|
|
2184
2180
|
var import_react_core9 = require("@copilotkit/react-core");
|
|
2181
|
+
var import_shared3 = require("@copilotkit/shared");
|
|
2182
|
+
var import_react_core10 = require("@copilotkit/react-core");
|
|
2185
2183
|
|
|
2186
2184
|
// src/components/chat/ImageUploadQueue.tsx
|
|
2187
2185
|
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
@@ -2262,12 +2260,12 @@ var ImageUploadQueue = ({
|
|
|
2262
2260
|
};
|
|
2263
2261
|
|
|
2264
2262
|
// src/components/chat/Suggestion.tsx
|
|
2265
|
-
var
|
|
2263
|
+
var import_react_core8 = require("@copilotkit/react-core");
|
|
2266
2264
|
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
2267
2265
|
function Suggestion({ title, onClick, partial, className }) {
|
|
2268
2266
|
if (!title)
|
|
2269
2267
|
return null;
|
|
2270
|
-
const { isLoading } = (0,
|
|
2268
|
+
const { isLoading } = (0, import_react_core8.useCopilotChatInternal)();
|
|
2271
2269
|
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2272
2270
|
"button",
|
|
2273
2271
|
{
|
|
@@ -2328,7 +2326,7 @@ function CopilotChat({
|
|
|
2328
2326
|
inputFileAccept = "image/*",
|
|
2329
2327
|
hideStopButton
|
|
2330
2328
|
}) {
|
|
2331
|
-
const { additionalInstructions, setChatInstructions } = (0,
|
|
2329
|
+
const { additionalInstructions, setChatInstructions } = (0, import_react_core9.useCopilotContext)();
|
|
2332
2330
|
const [selectedImages, setSelectedImages] = (0, import_react14.useState)([]);
|
|
2333
2331
|
const fileInputRef = (0, import_react14.useRef)(null);
|
|
2334
2332
|
(0, import_react14.useEffect)(() => {
|
|
@@ -2540,11 +2538,11 @@ var useCopilotChatLogic = (chatSuggestions, makeSystemMessage, onInProgress, onS
|
|
|
2540
2538
|
generateSuggestions,
|
|
2541
2539
|
resetSuggestions: resetSuggestionsFromHook,
|
|
2542
2540
|
isLoadingSuggestions
|
|
2543
|
-
} = (0,
|
|
2541
|
+
} = (0, import_react_core9.useCopilotChatInternal)({
|
|
2544
2542
|
makeSystemMessage
|
|
2545
2543
|
});
|
|
2546
|
-
const generalContext = (0,
|
|
2547
|
-
const messagesContext = (0,
|
|
2544
|
+
const generalContext = (0, import_react_core9.useCopilotContext)();
|
|
2545
|
+
const messagesContext = (0, import_react_core9.useCopilotMessagesContext)();
|
|
2548
2546
|
const { actions } = generalContext;
|
|
2549
2547
|
const [suggestionsFailed, setSuggestionsFailed] = (0, import_react14.useState)(false);
|
|
2550
2548
|
const hasGeneratedInitialSuggestions = (0, import_react14.useRef)(false);
|
|
@@ -2687,7 +2685,7 @@ var useCopilotChatLogic = (chatSuggestions, makeSystemMessage, onInProgress, onS
|
|
|
2687
2685
|
});
|
|
2688
2686
|
const runCurrentAgent = (hint) => __async(void 0, null, function* () {
|
|
2689
2687
|
if (generalContext.agentSession) {
|
|
2690
|
-
yield (0,
|
|
2688
|
+
yield (0, import_react_core10.runAgent)(
|
|
2691
2689
|
generalContext.agentSession.agentName,
|
|
2692
2690
|
stableContext,
|
|
2693
2691
|
appendMessage,
|
|
@@ -2698,7 +2696,7 @@ var useCopilotChatLogic = (chatSuggestions, makeSystemMessage, onInProgress, onS
|
|
|
2698
2696
|
});
|
|
2699
2697
|
const stopCurrentAgent = () => {
|
|
2700
2698
|
if (generalContext.agentSession) {
|
|
2701
|
-
(0,
|
|
2699
|
+
(0, import_react_core10.stopAgent)(generalContext.agentSession.agentName, stableContext);
|
|
2702
2700
|
}
|
|
2703
2701
|
};
|
|
2704
2702
|
const setCurrentAgentState = (state) => {
|