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