@copilotkit/react-ui 1.10.0-next.3 → 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 +10 -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
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CopilotPopup
|
|
3
|
-
} from "../../chunk-
|
|
4
|
-
import "../../chunk-
|
|
3
|
+
} from "../../chunk-WYEGK6BP.mjs";
|
|
4
|
+
import "../../chunk-QKDRZ7WA.mjs";
|
|
5
5
|
import "../../chunk-C3GSYRC3.mjs";
|
|
6
|
-
import "../../chunk-
|
|
6
|
+
import "../../chunk-GDSZGYCE.mjs";
|
|
7
7
|
import "../../chunk-V7W6IM2V.mjs";
|
|
8
|
-
import "../../chunk-
|
|
8
|
+
import "../../chunk-FFJHOZX6.mjs";
|
|
9
9
|
import "../../chunk-Q5V6S67N.mjs";
|
|
10
|
-
import "../../chunk-
|
|
10
|
+
import "../../chunk-JY2CSDKN.mjs";
|
|
11
11
|
import "../../chunk-KXE2JCUH.mjs";
|
|
12
12
|
import "../../chunk-NRA3CFEE.mjs";
|
|
13
13
|
import "../../chunk-BH6PCAAL.mjs";
|
|
14
14
|
import "../../chunk-UFN2VWSR.mjs";
|
|
15
|
-
import "../../chunk-
|
|
15
|
+
import "../../chunk-P6O2MZGT.mjs";
|
|
16
16
|
import "../../chunk-JHUTTP5C.mjs";
|
|
17
17
|
import "../../chunk-GCKKSSBU.mjs";
|
|
18
18
|
import "../../chunk-DBKRAOH7.mjs";
|
|
19
19
|
import "../../chunk-VVL6JFCJ.mjs";
|
|
20
|
-
import "../../chunk-
|
|
21
|
-
import "../../chunk-
|
|
20
|
+
import "../../chunk-226ZMOE3.mjs";
|
|
21
|
+
import "../../chunk-W26XFBEG.mjs";
|
|
22
22
|
import "../../chunk-PLHTVHUW.mjs";
|
|
23
23
|
import "../../chunk-DTRPPNSA.mjs";
|
|
24
24
|
import "../../chunk-CGEAG65D.mjs";
|
|
25
25
|
import "../../chunk-QIOJXTIQ.mjs";
|
|
26
26
|
import "../../chunk-E6MQUIZW.mjs";
|
|
27
|
-
import "../../chunk-
|
|
27
|
+
import "../../chunk-U5ATIGWH.mjs";
|
|
28
28
|
import "../../chunk-IEMQ2SQW.mjs";
|
|
29
29
|
import "../../chunk-B5IFB5YJ.mjs";
|
|
30
30
|
import "../../chunk-XWG3L6QC.mjs";
|
|
@@ -7,7 +7,7 @@ import '../../types/suggestions.js';
|
|
|
7
7
|
import './Chat.js';
|
|
8
8
|
import '@copilotkit/react-core/dist/types/coagent-state';
|
|
9
9
|
import '@copilotkit/react-core/dist/hooks/use-tree';
|
|
10
|
-
import '@copilotkit/react-core/dist/copilot-context-
|
|
10
|
+
import '@copilotkit/react-core/dist/copilot-context-78fc727c';
|
|
11
11
|
import '@copilotkit/react-core/dist/types/coagent-action';
|
|
12
12
|
import '@copilotkit/react-core';
|
|
13
13
|
import '@copilotkit/runtime-client-gql';
|
|
@@ -525,9 +525,7 @@ var Button = ({}) => {
|
|
|
525
525
|
|
|
526
526
|
// src/components/dev-console/utils.ts
|
|
527
527
|
var import_react_core2 = require("@copilotkit/react-core");
|
|
528
|
-
|
|
529
|
-
return showDevConsole;
|
|
530
|
-
}
|
|
528
|
+
var import_react_core3 = require("@copilotkit/react-core");
|
|
531
529
|
function getPublishedCopilotKitVersion(current, forceCheck = false) {
|
|
532
530
|
return __async(this, null, function* () {
|
|
533
531
|
const LOCAL_STORAGE_KEY = "__copilotkit_version_check__";
|
|
@@ -647,7 +645,7 @@ function logMessages(context) {
|
|
|
647
645
|
}
|
|
648
646
|
|
|
649
647
|
// src/components/dev-console/console.tsx
|
|
650
|
-
var
|
|
648
|
+
var import_react_core4 = require("@copilotkit/react-core");
|
|
651
649
|
var import_react4 = require("react");
|
|
652
650
|
|
|
653
651
|
// src/components/dev-console/icons.tsx
|
|
@@ -837,10 +835,10 @@ function CopilotKitHelpModal() {
|
|
|
837
835
|
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
838
836
|
function CopilotDevConsole() {
|
|
839
837
|
const currentVersion = import_shared2.COPILOTKIT_VERSION;
|
|
840
|
-
const context = (0,
|
|
838
|
+
const context = (0, import_react_core4.useCopilotContext)();
|
|
841
839
|
const [showDevConsole, setShowDevConsole] = (0, import_react4.useState)(false);
|
|
842
840
|
(0, import_react4.useEffect)(() => {
|
|
843
|
-
setShowDevConsole(shouldShowDevConsole(context.showDevConsole));
|
|
841
|
+
setShowDevConsole((0, import_react_core3.shouldShowDevConsole)(context.showDevConsole));
|
|
844
842
|
}, [context.showDevConsole]);
|
|
845
843
|
const dontRunTwiceInDevMode = (0, import_react4.useRef)(false);
|
|
846
844
|
const [versionStatus, setVersionStatus] = (0, import_react4.useState)("unknown");
|
|
@@ -966,8 +964,8 @@ function DebugMenuButton({
|
|
|
966
964
|
checkForUpdates,
|
|
967
965
|
mode
|
|
968
966
|
}) {
|
|
969
|
-
const context = (0,
|
|
970
|
-
const messagesContext = (0,
|
|
967
|
+
const context = (0, import_react_core4.useCopilotContext)();
|
|
968
|
+
const messagesContext = (0, import_react_core4.useCopilotMessagesContext)();
|
|
971
969
|
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_jsx_runtime8.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_react5.Menu, { children: [
|
|
972
970
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
973
971
|
import_react5.MenuButton,
|
|
@@ -1029,7 +1027,7 @@ var Header = ({}) => {
|
|
|
1029
1027
|
|
|
1030
1028
|
// src/components/chat/Messages.tsx
|
|
1031
1029
|
var import_react6 = require("react");
|
|
1032
|
-
var
|
|
1030
|
+
var import_react_core5 = require("@copilotkit/react-core");
|
|
1033
1031
|
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
1034
1032
|
var Messages = ({
|
|
1035
1033
|
inProgress,
|
|
@@ -1044,7 +1042,7 @@ var Messages = ({
|
|
|
1044
1042
|
markdownTagRenderers
|
|
1045
1043
|
}) => {
|
|
1046
1044
|
const { labels } = useChatContext();
|
|
1047
|
-
const { visibleMessages, interrupt } = (0,
|
|
1045
|
+
const { visibleMessages, interrupt } = (0, import_react_core5.useCopilotChatInternal)();
|
|
1048
1046
|
const initialMessages = (0, import_react6.useMemo)(() => makeInitialMessages(labels.initial), [labels.initial]);
|
|
1049
1047
|
const messages = [...initialMessages, ...visibleMessages];
|
|
1050
1048
|
const { messagesContainerRef, messagesEndRef } = useScrollToBottom(messages);
|
|
@@ -1217,7 +1215,7 @@ var AutoResizingTextarea = (0, import_react7.forwardRef)(
|
|
|
1217
1215
|
var Textarea_default = AutoResizingTextarea;
|
|
1218
1216
|
|
|
1219
1217
|
// src/hooks/use-push-to-talk.tsx
|
|
1220
|
-
var
|
|
1218
|
+
var import_react_core6 = require("@copilotkit/react-core");
|
|
1221
1219
|
var import_runtime_client_gql = require("@copilotkit/runtime-client-gql");
|
|
1222
1220
|
var import_react8 = require("react");
|
|
1223
1221
|
var startRecording = (mediaStreamRef, mediaRecorderRef, audioContextRef, recordedChunks, onStop) => __async(void 0, null, function* () {
|
|
@@ -1273,8 +1271,8 @@ var usePushToTalk = ({
|
|
|
1273
1271
|
const audioContextRef = (0, import_react8.useRef)(null);
|
|
1274
1272
|
const mediaRecorderRef = (0, import_react8.useRef)(null);
|
|
1275
1273
|
const recordedChunks = (0, import_react8.useRef)([]);
|
|
1276
|
-
const generalContext = (0,
|
|
1277
|
-
const messagesContext = (0,
|
|
1274
|
+
const generalContext = (0, import_react_core6.useCopilotContext)();
|
|
1275
|
+
const messagesContext = (0, import_react_core6.useCopilotMessagesContext)();
|
|
1278
1276
|
const context = __spreadValues(__spreadValues({}, generalContext), messagesContext);
|
|
1279
1277
|
const [startReadingFromMessageId, setStartReadingFromMessageId] = (0, import_react8.useState)(null);
|
|
1280
1278
|
(0, import_react8.useEffect)(() => {
|
|
@@ -1321,7 +1319,7 @@ var usePushToTalk = ({
|
|
|
1321
1319
|
};
|
|
1322
1320
|
|
|
1323
1321
|
// src/components/chat/Input.tsx
|
|
1324
|
-
var
|
|
1322
|
+
var import_react_core7 = require("@copilotkit/react-core");
|
|
1325
1323
|
|
|
1326
1324
|
// src/hooks/use-dark-mode.ts
|
|
1327
1325
|
var useDarkMode = () => {
|
|
@@ -1362,7 +1360,7 @@ var Input = ({
|
|
|
1362
1360
|
}) => {
|
|
1363
1361
|
var _a, _b;
|
|
1364
1362
|
const context = useChatContext();
|
|
1365
|
-
const copilotContext = (0,
|
|
1363
|
+
const copilotContext = (0, import_react_core7.useCopilotContext)();
|
|
1366
1364
|
const showPoweredBy = !((_a = copilotContext.copilotApiConfig) == null ? void 0 : _a.publicApiKey);
|
|
1367
1365
|
const pushToTalkConfigured = copilotContext.copilotApiConfig.textToSpeechUrl !== void 0 && copilotContext.copilotApiConfig.transcribeAudioUrl !== void 0;
|
|
1368
1366
|
const textareaRef = (0, import_react9.useRef)(null);
|
|
@@ -2169,9 +2167,9 @@ function RenderMessage(_a) {
|
|
|
2169
2167
|
|
|
2170
2168
|
// src/components/chat/Chat.tsx
|
|
2171
2169
|
var import_react14 = __toESM(require("react"));
|
|
2172
|
-
var import_react_core8 = require("@copilotkit/react-core");
|
|
2173
|
-
var import_shared3 = require("@copilotkit/shared");
|
|
2174
2170
|
var import_react_core9 = require("@copilotkit/react-core");
|
|
2171
|
+
var import_shared3 = require("@copilotkit/shared");
|
|
2172
|
+
var import_react_core10 = require("@copilotkit/react-core");
|
|
2175
2173
|
|
|
2176
2174
|
// src/components/chat/ImageUploadQueue.tsx
|
|
2177
2175
|
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
@@ -2252,12 +2250,12 @@ var ImageUploadQueue = ({
|
|
|
2252
2250
|
};
|
|
2253
2251
|
|
|
2254
2252
|
// src/components/chat/Suggestion.tsx
|
|
2255
|
-
var
|
|
2253
|
+
var import_react_core8 = require("@copilotkit/react-core");
|
|
2256
2254
|
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
2257
2255
|
function Suggestion({ title, onClick, partial, className }) {
|
|
2258
2256
|
if (!title)
|
|
2259
2257
|
return null;
|
|
2260
|
-
const { isLoading } = (0,
|
|
2258
|
+
const { isLoading } = (0, import_react_core8.useCopilotChatInternal)();
|
|
2261
2259
|
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2262
2260
|
"button",
|
|
2263
2261
|
{
|
|
@@ -2318,7 +2316,7 @@ function CopilotChat({
|
|
|
2318
2316
|
inputFileAccept = "image/*",
|
|
2319
2317
|
hideStopButton
|
|
2320
2318
|
}) {
|
|
2321
|
-
const { additionalInstructions, setChatInstructions } = (0,
|
|
2319
|
+
const { additionalInstructions, setChatInstructions } = (0, import_react_core9.useCopilotContext)();
|
|
2322
2320
|
const [selectedImages, setSelectedImages] = (0, import_react14.useState)([]);
|
|
2323
2321
|
const fileInputRef = (0, import_react14.useRef)(null);
|
|
2324
2322
|
(0, import_react14.useEffect)(() => {
|
|
@@ -2530,11 +2528,11 @@ var useCopilotChatLogic = (chatSuggestions, makeSystemMessage, onInProgress, onS
|
|
|
2530
2528
|
generateSuggestions,
|
|
2531
2529
|
resetSuggestions: resetSuggestionsFromHook,
|
|
2532
2530
|
isLoadingSuggestions
|
|
2533
|
-
} = (0,
|
|
2531
|
+
} = (0, import_react_core9.useCopilotChatInternal)({
|
|
2534
2532
|
makeSystemMessage
|
|
2535
2533
|
});
|
|
2536
|
-
const generalContext = (0,
|
|
2537
|
-
const messagesContext = (0,
|
|
2534
|
+
const generalContext = (0, import_react_core9.useCopilotContext)();
|
|
2535
|
+
const messagesContext = (0, import_react_core9.useCopilotMessagesContext)();
|
|
2538
2536
|
const { actions } = generalContext;
|
|
2539
2537
|
const [suggestionsFailed, setSuggestionsFailed] = (0, import_react14.useState)(false);
|
|
2540
2538
|
const hasGeneratedInitialSuggestions = (0, import_react14.useRef)(false);
|
|
@@ -2677,7 +2675,7 @@ var useCopilotChatLogic = (chatSuggestions, makeSystemMessage, onInProgress, onS
|
|
|
2677
2675
|
});
|
|
2678
2676
|
const runCurrentAgent = (hint) => __async(void 0, null, function* () {
|
|
2679
2677
|
if (generalContext.agentSession) {
|
|
2680
|
-
yield (0,
|
|
2678
|
+
yield (0, import_react_core10.runAgent)(
|
|
2681
2679
|
generalContext.agentSession.agentName,
|
|
2682
2680
|
stableContext,
|
|
2683
2681
|
appendMessage,
|
|
@@ -2688,7 +2686,7 @@ var useCopilotChatLogic = (chatSuggestions, makeSystemMessage, onInProgress, onS
|
|
|
2688
2686
|
});
|
|
2689
2687
|
const stopCurrentAgent = () => {
|
|
2690
2688
|
if (generalContext.agentSession) {
|
|
2691
|
-
(0,
|
|
2689
|
+
(0, import_react_core10.stopAgent)(generalContext.agentSession.agentName, stableContext);
|
|
2692
2690
|
}
|
|
2693
2691
|
};
|
|
2694
2692
|
const setCurrentAgentState = (state) => {
|