@copilotkit/react-ui 1.5.8 → 1.5.10-next.0
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 +45 -0
- package/dist/chunk-22XXW3F6.mjs +304 -0
- package/dist/chunk-22XXW3F6.mjs.map +1 -0
- package/dist/chunk-3E7HY2UN.mjs +85 -0
- package/dist/chunk-3E7HY2UN.mjs.map +1 -0
- package/dist/chunk-3XAXY2Z3.mjs +18 -0
- package/dist/chunk-3XAXY2Z3.mjs.map +1 -0
- package/dist/chunk-54JAUBUJ.mjs +26 -0
- package/dist/chunk-54JAUBUJ.mjs.map +1 -0
- package/dist/chunk-6INMITFA.mjs +18 -0
- package/dist/chunk-6INMITFA.mjs.map +1 -0
- package/dist/chunk-6RN2UVSW.mjs +30 -0
- package/dist/chunk-6RN2UVSW.mjs.map +1 -0
- package/dist/chunk-7II4YL7R.mjs +170 -0
- package/dist/chunk-7II4YL7R.mjs.map +1 -0
- package/dist/chunk-BH6PCAAL.mjs +81 -0
- package/dist/chunk-BH6PCAAL.mjs.map +1 -0
- package/dist/chunk-CBBFRI3Q.mjs +81 -0
- package/dist/chunk-CBBFRI3Q.mjs.map +1 -0
- package/dist/chunk-D2AA7PDR.mjs +21 -0
- package/dist/chunk-D2AA7PDR.mjs.map +1 -0
- package/dist/chunk-EFZPSZWO.mjs +1 -0
- package/dist/chunk-EFZPSZWO.mjs.map +1 -0
- package/dist/chunk-EMQEEXUB.mjs +97 -0
- package/dist/chunk-EMQEEXUB.mjs.map +1 -0
- package/dist/chunk-FZC7X5PK.mjs +262 -0
- package/dist/chunk-FZC7X5PK.mjs.map +1 -0
- package/dist/chunk-HZGELGAZ.mjs +232 -0
- package/dist/chunk-HZGELGAZ.mjs.map +1 -0
- package/dist/chunk-IU3WTXLQ.mjs +1 -0
- package/dist/chunk-IU3WTXLQ.mjs.map +1 -0
- package/dist/chunk-KXE2JCUH.mjs +1 -0
- package/dist/chunk-KXE2JCUH.mjs.map +1 -0
- package/dist/chunk-MMVDU6DF.mjs +1 -0
- package/dist/chunk-MMVDU6DF.mjs.map +1 -0
- package/dist/chunk-MRFF7GSQ.mjs +1 -0
- package/dist/chunk-MRFF7GSQ.mjs.map +1 -0
- package/dist/chunk-MRXNTQOX.mjs +59 -0
- package/dist/chunk-MRXNTQOX.mjs.map +1 -0
- package/dist/chunk-NLZW3ZOG.mjs +95 -0
- package/dist/chunk-NLZW3ZOG.mjs.map +1 -0
- package/dist/chunk-OTPAZXVR.mjs +92 -0
- package/dist/chunk-OTPAZXVR.mjs.map +1 -0
- package/dist/chunk-PNQVKBPN.mjs +146 -0
- package/dist/chunk-PNQVKBPN.mjs.map +1 -0
- package/dist/chunk-RJCZRKTV.mjs +106 -0
- package/dist/chunk-RJCZRKTV.mjs.map +1 -0
- package/dist/chunk-RQNJNK2W.mjs +25 -0
- package/dist/chunk-RQNJNK2W.mjs.map +1 -0
- package/dist/chunk-RU73BEZM.mjs +41 -0
- package/dist/chunk-RU73BEZM.mjs.map +1 -0
- package/dist/chunk-S5MBUNGN.mjs +140 -0
- package/dist/chunk-S5MBUNGN.mjs.map +1 -0
- package/dist/chunk-T26KLXLH.mjs +1 -0
- package/dist/chunk-T26KLXLH.mjs.map +1 -0
- package/dist/chunk-TI7SY2RI.mjs +164 -0
- package/dist/chunk-TI7SY2RI.mjs.map +1 -0
- package/dist/chunk-UPTB2MVO.mjs +395 -0
- package/dist/chunk-UPTB2MVO.mjs.map +1 -0
- package/dist/chunk-V7W6IM2V.mjs +1 -0
- package/dist/chunk-V7W6IM2V.mjs.map +1 -0
- package/dist/chunk-VEC45H6Q.mjs +18 -0
- package/dist/chunk-VEC45H6Q.mjs.map +1 -0
- package/dist/chunk-WB3YULQ4.mjs +1 -0
- package/dist/chunk-WB3YULQ4.mjs.map +1 -0
- package/dist/chunk-YAGE7RCE.mjs +118 -0
- package/dist/chunk-YAGE7RCE.mjs.map +1 -0
- package/dist/chunk-YQ3D5IQV.mjs +75 -0
- package/dist/chunk-YQ3D5IQV.mjs.map +1 -0
- package/dist/chunk-YQFVRDNC.mjs +53 -0
- package/dist/chunk-YQFVRDNC.mjs.map +1 -0
- package/dist/chunk-Z2UZSN3K.mjs +29 -0
- package/dist/chunk-Z2UZSN3K.mjs.map +1 -0
- package/dist/chunk-ZABXREBH.mjs +65 -0
- package/dist/chunk-ZABXREBH.mjs.map +1 -0
- package/dist/components/chat/Button.d.ts +7 -0
- package/dist/components/chat/Button.js +71 -0
- package/dist/components/chat/Button.js.map +1 -0
- package/dist/components/chat/Button.mjs +10 -0
- package/dist/components/chat/Button.mjs.map +1 -0
- package/dist/components/chat/Chat.d.ts +148 -0
- package/dist/components/chat/Chat.js +2427 -0
- package/dist/components/chat/Chat.js.map +1 -0
- package/dist/components/chat/Chat.mjs +34 -0
- package/dist/components/chat/Chat.mjs.map +1 -0
- package/dist/components/chat/ChatContext.d.ts +105 -0
- package/dist/components/chat/ChatContext.js +279 -0
- package/dist/components/chat/ChatContext.js.map +1 -0
- package/dist/components/chat/ChatContext.mjs +13 -0
- package/dist/components/chat/ChatContext.mjs.map +1 -0
- package/dist/components/chat/CodeBlock.d.ts +14 -0
- package/dist/components/chat/CodeBlock.js +523 -0
- package/dist/components/chat/CodeBlock.js.map +1 -0
- package/dist/components/chat/CodeBlock.mjs +14 -0
- package/dist/components/chat/CodeBlock.mjs.map +1 -0
- package/dist/components/chat/Header.d.ts +7 -0
- package/dist/components/chat/Header.js +64 -0
- package/dist/components/chat/Header.js.map +1 -0
- package/dist/components/chat/Header.mjs +10 -0
- package/dist/components/chat/Header.mjs.map +1 -0
- package/dist/components/chat/Icons.d.ts +18 -0
- package/dist/components/chat/Icons.js +321 -0
- package/dist/components/chat/Icons.js.map +1 -0
- package/dist/components/chat/Icons.mjs +32 -0
- package/dist/components/chat/Icons.mjs.map +1 -0
- package/dist/components/chat/Input.d.ts +7 -0
- package/dist/components/chat/Input.js +324 -0
- package/dist/components/chat/Input.js.map +1 -0
- package/dist/components/chat/Input.mjs +12 -0
- package/dist/components/chat/Input.mjs.map +1 -0
- package/dist/components/chat/Markdown.d.ts +8 -0
- package/dist/components/chat/Markdown.js +583 -0
- package/dist/components/chat/Markdown.js.map +1 -0
- package/dist/components/chat/Markdown.mjs +11 -0
- package/dist/components/chat/Markdown.mjs.map +1 -0
- package/dist/components/chat/Messages.d.ts +12 -0
- package/dist/components/chat/Messages.js +217 -0
- package/dist/components/chat/Messages.js.map +1 -0
- package/dist/components/chat/Messages.mjs +12 -0
- package/dist/components/chat/Messages.mjs.map +1 -0
- package/dist/components/chat/Modal.d.ts +51 -0
- package/dist/components/chat/Modal.js +2626 -0
- package/dist/components/chat/Modal.js.map +1 -0
- package/dist/components/chat/Modal.mjs +34 -0
- package/dist/components/chat/Modal.mjs.map +1 -0
- package/dist/components/chat/Popup.d.ts +13 -0
- package/dist/components/chat/Popup.js +2637 -0
- package/dist/components/chat/Popup.js.map +1 -0
- package/dist/components/chat/Popup.mjs +35 -0
- package/dist/components/chat/Popup.mjs.map +1 -0
- package/dist/components/chat/Response.d.ts +7 -0
- package/dist/components/chat/Response.js +64 -0
- package/dist/components/chat/Response.js.map +1 -0
- package/dist/components/chat/Response.mjs +10 -0
- package/dist/components/chat/Response.mjs.map +1 -0
- package/dist/components/chat/Sidebar.d.ts +13 -0
- package/dist/components/chat/Sidebar.js +2646 -0
- package/dist/components/chat/Sidebar.js.map +1 -0
- package/dist/components/chat/Sidebar.mjs +35 -0
- package/dist/components/chat/Sidebar.mjs.map +1 -0
- package/dist/components/chat/Suggestion.d.ts +14 -0
- package/dist/components/chat/Suggestion.js +181 -0
- package/dist/components/chat/Suggestion.js.map +1 -0
- package/dist/components/chat/Suggestion.mjs +11 -0
- package/dist/components/chat/Suggestion.mjs.map +1 -0
- package/dist/components/chat/Textarea.d.ts +13 -0
- package/dist/components/chat/Textarea.js +73 -0
- package/dist/components/chat/Textarea.js.map +1 -0
- package/dist/components/chat/Textarea.mjs +8 -0
- package/dist/components/chat/Textarea.mjs.map +1 -0
- package/dist/components/chat/Window.d.ts +7 -0
- package/dist/components/chat/Window.js +164 -0
- package/dist/components/chat/Window.js.map +1 -0
- package/dist/components/chat/Window.mjs +10 -0
- package/dist/components/chat/Window.mjs.map +1 -0
- package/dist/components/chat/index.d.ts +11 -0
- package/dist/components/chat/index.js +2661 -0
- package/dist/components/chat/index.js.map +1 -0
- package/dist/components/chat/index.mjs +47 -0
- package/dist/components/chat/index.mjs.map +1 -0
- package/dist/components/chat/messages/RenderActionExecutionMessage.d.ts +7 -0
- package/dist/components/chat/messages/RenderActionExecutionMessage.js +131 -0
- package/dist/components/chat/messages/RenderActionExecutionMessage.js.map +1 -0
- package/dist/components/chat/messages/RenderActionExecutionMessage.mjs +10 -0
- package/dist/components/chat/messages/RenderActionExecutionMessage.mjs.map +1 -0
- package/dist/components/chat/messages/RenderAgentStateMessage.d.ts +7 -0
- package/dist/components/chat/messages/RenderAgentStateMessage.js +111 -0
- package/dist/components/chat/messages/RenderAgentStateMessage.js.map +1 -0
- package/dist/components/chat/messages/RenderAgentStateMessage.mjs +10 -0
- package/dist/components/chat/messages/RenderAgentStateMessage.mjs.map +1 -0
- package/dist/components/chat/messages/RenderResultMessage.d.ts +7 -0
- package/dist/components/chat/messages/RenderResultMessage.js +64 -0
- package/dist/components/chat/messages/RenderResultMessage.js.map +1 -0
- package/dist/components/chat/messages/RenderResultMessage.mjs +10 -0
- package/dist/components/chat/messages/RenderResultMessage.mjs.map +1 -0
- package/dist/components/chat/messages/RenderTextMessage.d.ts +7 -0
- package/dist/components/chat/messages/RenderTextMessage.js +629 -0
- package/dist/components/chat/messages/RenderTextMessage.js.map +1 -0
- package/dist/components/chat/messages/RenderTextMessage.mjs +13 -0
- package/dist/components/chat/messages/RenderTextMessage.mjs.map +1 -0
- package/dist/components/chat/props.d.ts +46 -0
- package/dist/components/chat/props.js +19 -0
- package/dist/components/chat/props.js.map +1 -0
- package/dist/components/chat/props.mjs +2 -0
- package/dist/components/chat/props.mjs.map +1 -0
- package/dist/components/dev-console/console.d.ts +10 -0
- package/dist/components/dev-console/console.js +720 -0
- package/dist/components/dev-console/console.js.map +1 -0
- package/dist/components/dev-console/console.mjs +17 -0
- package/dist/components/dev-console/console.mjs.map +1 -0
- package/dist/components/dev-console/icons.d.ts +9 -0
- package/dist/components/dev-console/icons.js +120 -0
- package/dist/components/dev-console/icons.js.map +1 -0
- package/dist/components/dev-console/icons.mjs +16 -0
- package/dist/components/dev-console/icons.mjs.map +1 -0
- package/dist/components/dev-console/index.d.ts +5 -0
- package/dist/components/dev-console/index.js +720 -0
- package/dist/components/dev-console/index.js.map +1 -0
- package/dist/components/dev-console/index.mjs +18 -0
- package/dist/components/dev-console/index.mjs.map +1 -0
- package/dist/components/dev-console/types.d.ts +9 -0
- package/dist/components/dev-console/types.js +19 -0
- package/dist/components/dev-console/types.js.map +1 -0
- package/dist/components/dev-console/types.mjs +1 -0
- package/dist/components/dev-console/types.mjs.map +1 -0
- package/dist/components/dev-console/utils.d.ts +10 -0
- package/dist/components/dev-console/utils.js +188 -0
- package/dist/components/dev-console/utils.js.map +1 -0
- package/dist/components/dev-console/utils.mjs +16 -0
- package/dist/components/dev-console/utils.mjs.map +1 -0
- package/dist/components/help-modal/icons.d.ts +9 -0
- package/dist/components/help-modal/icons.js +107 -0
- package/dist/components/help-modal/icons.js.map +1 -0
- package/dist/components/help-modal/icons.mjs +12 -0
- package/dist/components/help-modal/icons.mjs.map +1 -0
- package/dist/components/help-modal/index.d.ts +2 -0
- package/dist/components/help-modal/index.js +255 -0
- package/dist/components/help-modal/index.js.map +1 -0
- package/dist/components/help-modal/index.mjs +10 -0
- package/dist/components/help-modal/index.mjs.map +1 -0
- package/dist/components/help-modal/modal.d.ts +5 -0
- package/dist/components/help-modal/modal.js +253 -0
- package/dist/components/help-modal/modal.js.map +1 -0
- package/dist/components/help-modal/modal.mjs +9 -0
- package/dist/components/help-modal/modal.mjs.map +1 -0
- package/dist/components/index.d.ts +14 -0
- package/dist/components/index.js +2665 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/index.mjs +54 -0
- package/dist/components/index.mjs.map +1 -0
- package/dist/context/index.d.ts +2 -0
- package/dist/context/index.js +19 -0
- package/dist/context/index.js.map +1 -0
- package/dist/context/index.mjs +2 -0
- package/dist/context/index.mjs.map +1 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.js +55 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/hooks/index.mjs +9 -0
- package/dist/hooks/index.mjs.map +1 -0
- package/dist/hooks/use-copilot-chat-suggestions.d.ts +83 -0
- package/dist/hooks/use-copilot-chat-suggestions.js +53 -0
- package/dist/hooks/use-copilot-chat-suggestions.js.map +1 -0
- package/dist/hooks/use-copilot-chat-suggestions.mjs +8 -0
- package/dist/hooks/use-copilot-chat-suggestions.mjs.map +1 -0
- package/dist/hooks/use-copy-to-clipboard.d.ts +9 -0
- package/dist/hooks/use-copy-to-clipboard.js +60 -0
- package/dist/hooks/use-copy-to-clipboard.js.map +1 -0
- package/dist/hooks/use-copy-to-clipboard.mjs +8 -0
- package/dist/hooks/use-copy-to-clipboard.mjs.map +1 -0
- package/dist/hooks/use-push-to-talk.d.ts +19 -0
- package/dist/hooks/use-push-to-talk.js +195 -0
- package/dist/hooks/use-push-to-talk.js.map +1 -0
- package/dist/hooks/use-push-to-talk.mjs +12 -0
- package/dist/hooks/use-push-to-talk.mjs.map +1 -0
- package/dist/index.css +751 -0
- package/dist/index.css.map +1 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.js +2693 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +62 -0
- package/dist/index.mjs.map +1 -0
- package/dist/lib/utils.d.ts +4 -0
- package/dist/lib/utils.js +76 -0
- package/dist/lib/utils.js.map +1 -0
- package/dist/lib/utils.mjs +34 -0
- package/dist/lib/utils.mjs.map +1 -0
- package/dist/lib/utils.test.d.ts +2 -0
- package/dist/lib/utils.test.js +9 -0
- package/dist/lib/utils.test.js.map +1 -0
- package/dist/lib/utils.test.mjs +7 -0
- package/dist/lib/utils.test.mjs.map +1 -0
- package/dist/types/css.d.ts +16 -0
- package/dist/types/css.js +19 -0
- package/dist/types/css.js.map +1 -0
- package/dist/types/css.mjs +1 -0
- package/dist/types/css.mjs.map +1 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.js +19 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/index.mjs +2 -0
- package/dist/types/index.mjs.map +1 -0
- package/dist/types/suggestions.d.ts +8 -0
- package/dist/types/suggestions.js +19 -0
- package/dist/types/suggestions.js.map +1 -0
- package/dist/types/suggestions.mjs +1 -0
- package/dist/types/suggestions.mjs.map +1 -0
- package/package.json +4 -4
|
@@ -0,0 +1,2427 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __defProps = Object.defineProperties;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
7
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
9
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
10
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
11
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
12
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
13
|
+
var __spreadValues = (a, b) => {
|
|
14
|
+
for (var prop in b || (b = {}))
|
|
15
|
+
if (__hasOwnProp.call(b, prop))
|
|
16
|
+
__defNormalProp(a, prop, b[prop]);
|
|
17
|
+
if (__getOwnPropSymbols)
|
|
18
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
19
|
+
if (__propIsEnum.call(b, prop))
|
|
20
|
+
__defNormalProp(a, prop, b[prop]);
|
|
21
|
+
}
|
|
22
|
+
return a;
|
|
23
|
+
};
|
|
24
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
25
|
+
var __objRest = (source, exclude) => {
|
|
26
|
+
var target = {};
|
|
27
|
+
for (var prop in source)
|
|
28
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
29
|
+
target[prop] = source[prop];
|
|
30
|
+
if (source != null && __getOwnPropSymbols)
|
|
31
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
32
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
33
|
+
target[prop] = source[prop];
|
|
34
|
+
}
|
|
35
|
+
return target;
|
|
36
|
+
};
|
|
37
|
+
var __export = (target, all) => {
|
|
38
|
+
for (var name in all)
|
|
39
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
40
|
+
};
|
|
41
|
+
var __copyProps = (to, from, except, desc) => {
|
|
42
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
43
|
+
for (let key of __getOwnPropNames(from))
|
|
44
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
45
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
46
|
+
}
|
|
47
|
+
return to;
|
|
48
|
+
};
|
|
49
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
50
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
51
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
52
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
53
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
54
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
55
|
+
mod
|
|
56
|
+
));
|
|
57
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
58
|
+
var __async = (__this, __arguments, generator) => {
|
|
59
|
+
return new Promise((resolve, reject) => {
|
|
60
|
+
var fulfilled = (value) => {
|
|
61
|
+
try {
|
|
62
|
+
step(generator.next(value));
|
|
63
|
+
} catch (e) {
|
|
64
|
+
reject(e);
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
var rejected = (value) => {
|
|
68
|
+
try {
|
|
69
|
+
step(generator.throw(value));
|
|
70
|
+
} catch (e) {
|
|
71
|
+
reject(e);
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
75
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
76
|
+
});
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
// src/components/chat/Chat.tsx
|
|
80
|
+
var Chat_exports = {};
|
|
81
|
+
__export(Chat_exports, {
|
|
82
|
+
CopilotChat: () => CopilotChat,
|
|
83
|
+
WrappedCopilotChat: () => WrappedCopilotChat,
|
|
84
|
+
useCopilotChatLogic: () => useCopilotChatLogic
|
|
85
|
+
});
|
|
86
|
+
module.exports = __toCommonJS(Chat_exports);
|
|
87
|
+
|
|
88
|
+
// src/components/chat/ChatContext.tsx
|
|
89
|
+
var import_react = __toESM(require("react"));
|
|
90
|
+
|
|
91
|
+
// src/components/chat/Icons.tsx
|
|
92
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
93
|
+
var OpenIcon = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
94
|
+
"svg",
|
|
95
|
+
{
|
|
96
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
97
|
+
viewBox: "0 0 24 24",
|
|
98
|
+
fill: "currentColor",
|
|
99
|
+
width: "24",
|
|
100
|
+
height: "24",
|
|
101
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("g", { transform: "translate(24, 0) scale(-1, 1)", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
102
|
+
"path",
|
|
103
|
+
{
|
|
104
|
+
fillRule: "evenodd",
|
|
105
|
+
d: "M5.337 21.718a6.707 6.707 0 01-.533-.074.75.75 0 01-.44-1.223 3.73 3.73 0 00.814-1.686c.023-.115-.022-.317-.254-.543C3.274 16.587 2.25 14.41 2.25 12c0-5.03 4.428-9 9.75-9s9.75 3.97 9.75 9c0 5.03-4.428 9-9.75 9-.833 0-1.643-.097-2.417-.279a6.721 6.721 0 01-4.246.997z",
|
|
106
|
+
clipRule: "evenodd"
|
|
107
|
+
}
|
|
108
|
+
) })
|
|
109
|
+
}
|
|
110
|
+
);
|
|
111
|
+
var CloseIcon = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
112
|
+
"svg",
|
|
113
|
+
{
|
|
114
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
115
|
+
fill: "none",
|
|
116
|
+
viewBox: "0 0 24 24",
|
|
117
|
+
strokeWidth: "1.5",
|
|
118
|
+
stroke: "currentColor",
|
|
119
|
+
width: "24",
|
|
120
|
+
height: "24",
|
|
121
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19.5 8.25l-7.5 7.5-7.5-7.5" })
|
|
122
|
+
}
|
|
123
|
+
);
|
|
124
|
+
var HeaderCloseIcon = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
125
|
+
"svg",
|
|
126
|
+
{
|
|
127
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
128
|
+
fill: "none",
|
|
129
|
+
viewBox: "0 0 24 24",
|
|
130
|
+
strokeWidth: "1.5",
|
|
131
|
+
stroke: "currentColor",
|
|
132
|
+
width: "24",
|
|
133
|
+
height: "24",
|
|
134
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" })
|
|
135
|
+
}
|
|
136
|
+
);
|
|
137
|
+
var SendIcon = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
138
|
+
"svg",
|
|
139
|
+
{
|
|
140
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
141
|
+
fill: "none",
|
|
142
|
+
viewBox: "0 0 24 24",
|
|
143
|
+
strokeWidth: 1.5,
|
|
144
|
+
stroke: "currentColor",
|
|
145
|
+
width: "24",
|
|
146
|
+
height: "24",
|
|
147
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
148
|
+
"path",
|
|
149
|
+
{
|
|
150
|
+
strokeLinecap: "round",
|
|
151
|
+
strokeLinejoin: "round",
|
|
152
|
+
d: "M6 12L3.269 3.126A59.768 59.768 0 0121.485 12 59.77 59.77 0 013.27 20.876L5.999 12zm0 0h7.5"
|
|
153
|
+
}
|
|
154
|
+
)
|
|
155
|
+
}
|
|
156
|
+
);
|
|
157
|
+
var SpinnerIcon = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
158
|
+
"svg",
|
|
159
|
+
{
|
|
160
|
+
style: {
|
|
161
|
+
animation: "copilotKitSpinAnimation 1s linear infinite",
|
|
162
|
+
color: "rgb(107 114 128)"
|
|
163
|
+
},
|
|
164
|
+
width: "24",
|
|
165
|
+
height: "24",
|
|
166
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
167
|
+
fill: "none",
|
|
168
|
+
viewBox: "0 0 24 24",
|
|
169
|
+
children: [
|
|
170
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
171
|
+
"circle",
|
|
172
|
+
{
|
|
173
|
+
style: { opacity: 0.25 },
|
|
174
|
+
cx: "12",
|
|
175
|
+
cy: "12",
|
|
176
|
+
r: "10",
|
|
177
|
+
stroke: "currentColor",
|
|
178
|
+
strokeWidth: "4"
|
|
179
|
+
}
|
|
180
|
+
),
|
|
181
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
182
|
+
"path",
|
|
183
|
+
{
|
|
184
|
+
style: { opacity: 0.75 },
|
|
185
|
+
fill: "currentColor",
|
|
186
|
+
d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
|
|
187
|
+
}
|
|
188
|
+
)
|
|
189
|
+
]
|
|
190
|
+
}
|
|
191
|
+
);
|
|
192
|
+
var SmallSpinnerIcon = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
193
|
+
"svg",
|
|
194
|
+
{
|
|
195
|
+
style: {
|
|
196
|
+
animation: "copilotKitSpinAnimation 1s linear infinite"
|
|
197
|
+
},
|
|
198
|
+
width: "13",
|
|
199
|
+
height: "13",
|
|
200
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
201
|
+
fill: "none",
|
|
202
|
+
viewBox: "0 0 24 24",
|
|
203
|
+
children: [
|
|
204
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
205
|
+
"circle",
|
|
206
|
+
{
|
|
207
|
+
style: { opacity: 0.25 },
|
|
208
|
+
cx: "12",
|
|
209
|
+
cy: "12",
|
|
210
|
+
r: "10",
|
|
211
|
+
stroke: "currentColor",
|
|
212
|
+
strokeWidth: "4"
|
|
213
|
+
}
|
|
214
|
+
),
|
|
215
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
216
|
+
"path",
|
|
217
|
+
{
|
|
218
|
+
style: { opacity: 0.75 },
|
|
219
|
+
fill: "currentColor",
|
|
220
|
+
d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
|
|
221
|
+
}
|
|
222
|
+
)
|
|
223
|
+
]
|
|
224
|
+
}
|
|
225
|
+
);
|
|
226
|
+
var ActivityIcon = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
227
|
+
"svg",
|
|
228
|
+
{
|
|
229
|
+
style: {
|
|
230
|
+
display: "inline-block",
|
|
231
|
+
marginLeft: "0.25rem",
|
|
232
|
+
marginRight: "0.25rem"
|
|
233
|
+
},
|
|
234
|
+
height: "24",
|
|
235
|
+
width: "24",
|
|
236
|
+
viewBox: "0 0 27 27",
|
|
237
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
238
|
+
fill: "currentColor",
|
|
239
|
+
children: [
|
|
240
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("circle", { className: "copilotKitActivityDot1", cx: "4", cy: "12", r: "3" }),
|
|
241
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("circle", { className: "copilotKitActivityDot1 copilotKitActivityDot2", cx: "12", cy: "12", r: "3" }),
|
|
242
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("circle", { className: "copilotKitActivityDot1 copilotKitActivityDot3", cx: "20", cy: "12", r: "3" })
|
|
243
|
+
]
|
|
244
|
+
}
|
|
245
|
+
);
|
|
246
|
+
function CheckIcon(_a) {
|
|
247
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
248
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
249
|
+
"svg",
|
|
250
|
+
__spreadProps(__spreadValues({
|
|
251
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
252
|
+
viewBox: "0 0 256 256",
|
|
253
|
+
fill: "currentColor",
|
|
254
|
+
style: { height: "1rem", width: "1rem" },
|
|
255
|
+
className
|
|
256
|
+
}, props), {
|
|
257
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "m229.66 77.66-128 128a8 8 0 0 1-11.32 0l-56-56a8 8 0 0 1 11.32-11.32L96 188.69 218.34 66.34a8 8 0 0 1 11.32 11.32Z" })
|
|
258
|
+
})
|
|
259
|
+
);
|
|
260
|
+
}
|
|
261
|
+
function DownloadIcon(_a) {
|
|
262
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
263
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
264
|
+
"svg",
|
|
265
|
+
__spreadProps(__spreadValues({
|
|
266
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
267
|
+
viewBox: "0 0 256 256",
|
|
268
|
+
fill: "currentColor",
|
|
269
|
+
style: { height: "1rem", width: "1rem" },
|
|
270
|
+
className
|
|
271
|
+
}, props), {
|
|
272
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M224 152v56a16 16 0 0 1-16 16H48a16 16 0 0 1-16-16v-56a8 8 0 0 1 16 0v56h160v-56a8 8 0 0 1 16 0Zm-101.66 5.66a8 8 0 0 0 11.32 0l40-40a8 8 0 0 0-11.32-11.32L136 132.69V40a8 8 0 0 0-16 0v92.69l-26.34-26.35a8 8 0 0 0-11.32 11.32Z" })
|
|
273
|
+
})
|
|
274
|
+
);
|
|
275
|
+
}
|
|
276
|
+
function CopyIcon(_a) {
|
|
277
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
278
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
279
|
+
"svg",
|
|
280
|
+
__spreadProps(__spreadValues({
|
|
281
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
282
|
+
viewBox: "0 0 256 256",
|
|
283
|
+
fill: "currentColor",
|
|
284
|
+
style: { height: "1rem", width: "1rem" },
|
|
285
|
+
className
|
|
286
|
+
}, props), {
|
|
287
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M216 32H88a8 8 0 0 0-8 8v40H40a8 8 0 0 0-8 8v128a8 8 0 0 0 8 8h128a8 8 0 0 0 8-8v-40h40a8 8 0 0 0 8-8V40a8 8 0 0 0-8-8Zm-56 176H48V96h112Zm48-48h-32V88a8 8 0 0 0-8-8H96V48h112Z" })
|
|
288
|
+
})
|
|
289
|
+
);
|
|
290
|
+
}
|
|
291
|
+
var StopIcon = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
292
|
+
"svg",
|
|
293
|
+
{
|
|
294
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
295
|
+
viewBox: "0 0 256 256",
|
|
296
|
+
fill: "currentColor",
|
|
297
|
+
style: { height: "1rem", width: "1rem" },
|
|
298
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M128 24a104 104 0 1 0 104 104A104.11 104.11 0 0 0 128 24Zm0 192a88 88 0 1 1 88-88 88.1 88.1 0 0 1-88 88Zm24-120h-48a8 8 0 0 0-8 8v48a8 8 0 0 0 8 8h48a8 8 0 0 0 8-8v-48a8 8 0 0 0-8-8Zm-8 48h-32v-32h32Z" })
|
|
299
|
+
}
|
|
300
|
+
);
|
|
301
|
+
var RegenerateIcon = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
302
|
+
"svg",
|
|
303
|
+
{
|
|
304
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
305
|
+
viewBox: "0 0 256 256",
|
|
306
|
+
fill: "currentColor",
|
|
307
|
+
style: { height: "1rem", width: "1rem" },
|
|
308
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M197.67 186.37a8 8 0 0 1 0 11.29C196.58 198.73 170.82 224 128 224c-37.39 0-64.53-22.4-80-39.85V208a8 8 0 0 1-16 0v-48a8 8 0 0 1 8-8h48a8 8 0 0 1 0 16H55.44C67.76 183.35 93 208 128 208c36 0 58.14-21.46 58.36-21.68a8 8 0 0 1 11.31.05ZM216 40a8 8 0 0 0-8 8v23.85C192.53 54.4 165.39 32 128 32c-42.82 0-68.58 25.27-69.66 26.34a8 8 0 0 0 11.3 11.34C69.86 69.46 92 48 128 48c35 0 60.24 24.65 72.56 40H168a8 8 0 0 0 0 16h48a8 8 0 0 0 8-8V48a8 8 0 0 0-8-8Z" })
|
|
309
|
+
}
|
|
310
|
+
);
|
|
311
|
+
var PushToTalkIcon = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
312
|
+
"svg",
|
|
313
|
+
{
|
|
314
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
315
|
+
fill: "none",
|
|
316
|
+
viewBox: "0 0 24 24",
|
|
317
|
+
strokeWidth: 1.5,
|
|
318
|
+
stroke: "currentColor",
|
|
319
|
+
className: "w-6 h-6",
|
|
320
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
321
|
+
"path",
|
|
322
|
+
{
|
|
323
|
+
strokeLinecap: "round",
|
|
324
|
+
strokeLinejoin: "round",
|
|
325
|
+
d: "M12 18.75a6 6 0 0 0 6-6v-1.5m-6 7.5a6 6 0 0 1-6-6v-1.5m6 7.5v3.75m-3.75 0h7.5M12 15.75a3 3 0 0 1-3-3V4.5a3 3 0 1 1 6 0v8.25a3 3 0 0 1-3 3Z"
|
|
326
|
+
}
|
|
327
|
+
)
|
|
328
|
+
}
|
|
329
|
+
);
|
|
330
|
+
|
|
331
|
+
// src/components/chat/ChatContext.tsx
|
|
332
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
333
|
+
var ChatContext = import_react.default.createContext(void 0);
|
|
334
|
+
function useChatContext() {
|
|
335
|
+
const context = import_react.default.useContext(ChatContext);
|
|
336
|
+
if (context === void 0) {
|
|
337
|
+
throw new Error(
|
|
338
|
+
"Context not found. Did you forget to wrap your app in a <ChatContextProvider> component?"
|
|
339
|
+
);
|
|
340
|
+
}
|
|
341
|
+
return context;
|
|
342
|
+
}
|
|
343
|
+
var ChatContextProvider = ({
|
|
344
|
+
// temperature,
|
|
345
|
+
// instructions,
|
|
346
|
+
// maxFeedback,
|
|
347
|
+
labels,
|
|
348
|
+
icons,
|
|
349
|
+
children,
|
|
350
|
+
open,
|
|
351
|
+
setOpen
|
|
352
|
+
}) => {
|
|
353
|
+
const memoizedLabels = (0, import_react.useMemo)(
|
|
354
|
+
() => __spreadValues(__spreadValues({}, {
|
|
355
|
+
initial: "",
|
|
356
|
+
title: "CopilotKit",
|
|
357
|
+
placeholder: "Type a message...",
|
|
358
|
+
error: "\u274C An error occurred. Please try again.",
|
|
359
|
+
stopGenerating: "Stop generating",
|
|
360
|
+
regenerateResponse: "Regenerate response"
|
|
361
|
+
}), labels),
|
|
362
|
+
[labels]
|
|
363
|
+
);
|
|
364
|
+
const memoizedIcons = (0, import_react.useMemo)(
|
|
365
|
+
() => __spreadValues(__spreadValues({}, {
|
|
366
|
+
openIcon: OpenIcon,
|
|
367
|
+
closeIcon: CloseIcon,
|
|
368
|
+
headerCloseIcon: HeaderCloseIcon,
|
|
369
|
+
sendIcon: SendIcon,
|
|
370
|
+
activityIcon: ActivityIcon,
|
|
371
|
+
spinnerIcon: SpinnerIcon,
|
|
372
|
+
stopIcon: StopIcon,
|
|
373
|
+
regenerateIcon: RegenerateIcon,
|
|
374
|
+
pushToTalkIcon: PushToTalkIcon
|
|
375
|
+
}), icons),
|
|
376
|
+
[icons]
|
|
377
|
+
);
|
|
378
|
+
const context = (0, import_react.useMemo)(
|
|
379
|
+
() => ({
|
|
380
|
+
labels: memoizedLabels,
|
|
381
|
+
icons: memoizedIcons,
|
|
382
|
+
open,
|
|
383
|
+
setOpen
|
|
384
|
+
}),
|
|
385
|
+
[memoizedLabels, memoizedIcons, open, setOpen]
|
|
386
|
+
);
|
|
387
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ChatContext.Provider, { value: context, children });
|
|
388
|
+
};
|
|
389
|
+
|
|
390
|
+
// src/components/chat/Messages.tsx
|
|
391
|
+
var import_react2 = require("react");
|
|
392
|
+
var import_runtime_client_gql = require("@copilotkit/runtime-client-gql");
|
|
393
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
394
|
+
var Messages = ({
|
|
395
|
+
messages,
|
|
396
|
+
inProgress,
|
|
397
|
+
children,
|
|
398
|
+
RenderTextMessage: RenderTextMessage2,
|
|
399
|
+
RenderActionExecutionMessage: RenderActionExecutionMessage2,
|
|
400
|
+
RenderAgentStateMessage: RenderAgentStateMessage2,
|
|
401
|
+
RenderResultMessage: RenderResultMessage2
|
|
402
|
+
}) => {
|
|
403
|
+
const context = useChatContext();
|
|
404
|
+
const initialMessages = (0, import_react2.useMemo)(
|
|
405
|
+
() => makeInitialMessages(context.labels.initial),
|
|
406
|
+
[context.labels.initial]
|
|
407
|
+
);
|
|
408
|
+
messages = [...initialMessages, ...messages];
|
|
409
|
+
const actionResults = {};
|
|
410
|
+
for (let i = 0; i < messages.length; i++) {
|
|
411
|
+
if (messages[i].isActionExecutionMessage()) {
|
|
412
|
+
const id = messages[i].id;
|
|
413
|
+
const resultMessage = messages.find(
|
|
414
|
+
(message) => message.isResultMessage() && message.actionExecutionId === id
|
|
415
|
+
);
|
|
416
|
+
if (resultMessage) {
|
|
417
|
+
actionResults[id] = import_runtime_client_gql.ResultMessage.decodeResult(resultMessage.result || "");
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
const { messagesEndRef, messagesContainerRef } = useScrollToBottom(messages);
|
|
422
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "copilotKitMessages", ref: messagesContainerRef, children: [
|
|
423
|
+
messages.map((message, index) => {
|
|
424
|
+
const isCurrentMessage = index === messages.length - 1;
|
|
425
|
+
if (message.isTextMessage()) {
|
|
426
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
427
|
+
RenderTextMessage2,
|
|
428
|
+
{
|
|
429
|
+
message,
|
|
430
|
+
inProgress,
|
|
431
|
+
index,
|
|
432
|
+
isCurrentMessage
|
|
433
|
+
},
|
|
434
|
+
index
|
|
435
|
+
);
|
|
436
|
+
} else if (message.isActionExecutionMessage()) {
|
|
437
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
438
|
+
RenderActionExecutionMessage2,
|
|
439
|
+
{
|
|
440
|
+
message,
|
|
441
|
+
inProgress,
|
|
442
|
+
index,
|
|
443
|
+
isCurrentMessage,
|
|
444
|
+
actionResult: actionResults[message.id]
|
|
445
|
+
},
|
|
446
|
+
index
|
|
447
|
+
);
|
|
448
|
+
} else if (message.isAgentStateMessage()) {
|
|
449
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
450
|
+
RenderAgentStateMessage2,
|
|
451
|
+
{
|
|
452
|
+
message,
|
|
453
|
+
inProgress,
|
|
454
|
+
index,
|
|
455
|
+
isCurrentMessage
|
|
456
|
+
},
|
|
457
|
+
index
|
|
458
|
+
);
|
|
459
|
+
} else if (message.isResultMessage()) {
|
|
460
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
461
|
+
RenderResultMessage2,
|
|
462
|
+
{
|
|
463
|
+
message,
|
|
464
|
+
inProgress,
|
|
465
|
+
index,
|
|
466
|
+
isCurrentMessage
|
|
467
|
+
},
|
|
468
|
+
index
|
|
469
|
+
);
|
|
470
|
+
}
|
|
471
|
+
}),
|
|
472
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("footer", { ref: messagesEndRef, children })
|
|
473
|
+
] });
|
|
474
|
+
};
|
|
475
|
+
function makeInitialMessages(initial) {
|
|
476
|
+
let initialArray = [];
|
|
477
|
+
if (initial) {
|
|
478
|
+
if (Array.isArray(initial)) {
|
|
479
|
+
initialArray.push(...initial);
|
|
480
|
+
} else {
|
|
481
|
+
initialArray.push(initial);
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
return initialArray.map(
|
|
485
|
+
(message) => new import_runtime_client_gql.TextMessage({
|
|
486
|
+
role: import_runtime_client_gql.Role.Assistant,
|
|
487
|
+
content: message
|
|
488
|
+
})
|
|
489
|
+
);
|
|
490
|
+
}
|
|
491
|
+
function useScrollToBottom(messages) {
|
|
492
|
+
const messagesEndRef = (0, import_react2.useRef)(null);
|
|
493
|
+
const messagesContainerRef = (0, import_react2.useRef)(null);
|
|
494
|
+
const isProgrammaticScrollRef = (0, import_react2.useRef)(false);
|
|
495
|
+
const isUserScrollUpRef = (0, import_react2.useRef)(false);
|
|
496
|
+
const scrollToBottom = () => {
|
|
497
|
+
if (messagesEndRef.current) {
|
|
498
|
+
isProgrammaticScrollRef.current = true;
|
|
499
|
+
messagesEndRef.current.scrollIntoView({
|
|
500
|
+
behavior: "auto"
|
|
501
|
+
});
|
|
502
|
+
}
|
|
503
|
+
};
|
|
504
|
+
const handleScroll = () => {
|
|
505
|
+
if (isProgrammaticScrollRef.current) {
|
|
506
|
+
isProgrammaticScrollRef.current = false;
|
|
507
|
+
return;
|
|
508
|
+
}
|
|
509
|
+
if (messagesContainerRef.current) {
|
|
510
|
+
const { scrollTop, scrollHeight, clientHeight } = messagesContainerRef.current;
|
|
511
|
+
isUserScrollUpRef.current = scrollTop + clientHeight < scrollHeight;
|
|
512
|
+
}
|
|
513
|
+
};
|
|
514
|
+
(0, import_react2.useEffect)(() => {
|
|
515
|
+
const container = messagesContainerRef.current;
|
|
516
|
+
if (container) {
|
|
517
|
+
container.addEventListener("scroll", handleScroll);
|
|
518
|
+
}
|
|
519
|
+
return () => {
|
|
520
|
+
if (container) {
|
|
521
|
+
container.removeEventListener("scroll", handleScroll);
|
|
522
|
+
}
|
|
523
|
+
};
|
|
524
|
+
}, []);
|
|
525
|
+
(0, import_react2.useEffect)(() => {
|
|
526
|
+
const container = messagesContainerRef.current;
|
|
527
|
+
if (!container) {
|
|
528
|
+
return;
|
|
529
|
+
}
|
|
530
|
+
const mutationObserver = new MutationObserver(() => {
|
|
531
|
+
if (!isUserScrollUpRef.current) {
|
|
532
|
+
scrollToBottom();
|
|
533
|
+
}
|
|
534
|
+
});
|
|
535
|
+
mutationObserver.observe(container, {
|
|
536
|
+
childList: true,
|
|
537
|
+
subtree: true,
|
|
538
|
+
characterData: true
|
|
539
|
+
});
|
|
540
|
+
return () => {
|
|
541
|
+
mutationObserver.disconnect();
|
|
542
|
+
};
|
|
543
|
+
}, []);
|
|
544
|
+
(0, import_react2.useEffect)(() => {
|
|
545
|
+
isUserScrollUpRef.current = false;
|
|
546
|
+
scrollToBottom();
|
|
547
|
+
}, [messages.filter((m) => m.isTextMessage() && m.role === import_runtime_client_gql.Role.User).length]);
|
|
548
|
+
return { messagesEndRef, messagesContainerRef };
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
// src/components/chat/Input.tsx
|
|
552
|
+
var import_react5 = require("react");
|
|
553
|
+
|
|
554
|
+
// src/components/chat/Textarea.tsx
|
|
555
|
+
var import_react3 = require("react");
|
|
556
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
557
|
+
var AutoResizingTextarea = (0, import_react3.forwardRef)(
|
|
558
|
+
({ maxRows = 1, placeholder, value, onChange, onKeyDown, autoFocus }, ref) => {
|
|
559
|
+
const internalTextareaRef = (0, import_react3.useRef)(null);
|
|
560
|
+
const [maxHeight, setMaxHeight] = (0, import_react3.useState)(0);
|
|
561
|
+
(0, import_react3.useImperativeHandle)(ref, () => internalTextareaRef.current);
|
|
562
|
+
(0, import_react3.useEffect)(() => {
|
|
563
|
+
const calculateMaxHeight = () => {
|
|
564
|
+
const textarea = internalTextareaRef.current;
|
|
565
|
+
if (textarea) {
|
|
566
|
+
textarea.style.height = "auto";
|
|
567
|
+
const singleRowHeight = textarea.scrollHeight;
|
|
568
|
+
setMaxHeight(singleRowHeight * maxRows);
|
|
569
|
+
if (autoFocus) {
|
|
570
|
+
textarea.focus();
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
};
|
|
574
|
+
calculateMaxHeight();
|
|
575
|
+
}, [maxRows]);
|
|
576
|
+
(0, import_react3.useEffect)(() => {
|
|
577
|
+
const textarea = internalTextareaRef.current;
|
|
578
|
+
if (textarea) {
|
|
579
|
+
textarea.style.height = "auto";
|
|
580
|
+
textarea.style.height = `${Math.min(textarea.scrollHeight, maxHeight)}px`;
|
|
581
|
+
}
|
|
582
|
+
}, [value, maxHeight]);
|
|
583
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
584
|
+
"textarea",
|
|
585
|
+
{
|
|
586
|
+
ref: internalTextareaRef,
|
|
587
|
+
value,
|
|
588
|
+
onChange,
|
|
589
|
+
onKeyDown,
|
|
590
|
+
placeholder,
|
|
591
|
+
style: {
|
|
592
|
+
overflow: "auto",
|
|
593
|
+
resize: "none",
|
|
594
|
+
maxHeight: `${maxHeight}px`
|
|
595
|
+
},
|
|
596
|
+
rows: 1
|
|
597
|
+
}
|
|
598
|
+
);
|
|
599
|
+
}
|
|
600
|
+
);
|
|
601
|
+
var Textarea_default = AutoResizingTextarea;
|
|
602
|
+
|
|
603
|
+
// src/hooks/use-push-to-talk.tsx
|
|
604
|
+
var import_react_core = require("@copilotkit/react-core");
|
|
605
|
+
var import_react4 = require("react");
|
|
606
|
+
var startRecording = (mediaStreamRef, mediaRecorderRef, audioContextRef, recordedChunks, onStop) => __async(void 0, null, function* () {
|
|
607
|
+
if (!mediaStreamRef.current || !audioContextRef.current) {
|
|
608
|
+
mediaStreamRef.current = yield navigator.mediaDevices.getUserMedia({ audio: true });
|
|
609
|
+
audioContextRef.current = new window.AudioContext();
|
|
610
|
+
yield audioContextRef.current.resume();
|
|
611
|
+
}
|
|
612
|
+
mediaRecorderRef.current = new MediaRecorder(mediaStreamRef.current);
|
|
613
|
+
mediaRecorderRef.current.start(1e3);
|
|
614
|
+
mediaRecorderRef.current.ondataavailable = (event) => {
|
|
615
|
+
recordedChunks.push(event.data);
|
|
616
|
+
};
|
|
617
|
+
mediaRecorderRef.current.onstop = onStop;
|
|
618
|
+
});
|
|
619
|
+
var stopRecording = (mediaRecorderRef) => {
|
|
620
|
+
if (mediaRecorderRef.current && mediaRecorderRef.current.state !== "inactive") {
|
|
621
|
+
mediaRecorderRef.current.stop();
|
|
622
|
+
}
|
|
623
|
+
};
|
|
624
|
+
var transcribeAudio = (recordedChunks, transcribeAudioUrl) => __async(void 0, null, function* () {
|
|
625
|
+
const completeBlob = new Blob(recordedChunks, { type: "audio/mp4" });
|
|
626
|
+
const formData = new FormData();
|
|
627
|
+
formData.append("file", completeBlob, "recording.mp4");
|
|
628
|
+
const response = yield fetch(transcribeAudioUrl, {
|
|
629
|
+
method: "POST",
|
|
630
|
+
body: formData
|
|
631
|
+
});
|
|
632
|
+
if (!response.ok) {
|
|
633
|
+
throw new Error(`Error: ${response.statusText}`);
|
|
634
|
+
}
|
|
635
|
+
const transcription = yield response.json();
|
|
636
|
+
return transcription.text;
|
|
637
|
+
});
|
|
638
|
+
var playAudioResponse = (text, textToSpeechUrl, audioContext) => {
|
|
639
|
+
const encodedText = encodeURIComponent(text);
|
|
640
|
+
const url = `${textToSpeechUrl}?text=${encodedText}`;
|
|
641
|
+
fetch(url).then((response) => response.arrayBuffer()).then((arrayBuffer) => audioContext.decodeAudioData(arrayBuffer)).then((audioBuffer) => {
|
|
642
|
+
const source = audioContext.createBufferSource();
|
|
643
|
+
source.buffer = audioBuffer;
|
|
644
|
+
source.connect(audioContext.destination);
|
|
645
|
+
source.start(0);
|
|
646
|
+
}).catch((error) => {
|
|
647
|
+
console.error("Error with decoding audio data", error);
|
|
648
|
+
});
|
|
649
|
+
};
|
|
650
|
+
var usePushToTalk = ({
|
|
651
|
+
sendFunction,
|
|
652
|
+
inProgress
|
|
653
|
+
}) => {
|
|
654
|
+
const [pushToTalkState, setPushToTalkState] = (0, import_react4.useState)("idle");
|
|
655
|
+
const mediaStreamRef = (0, import_react4.useRef)(null);
|
|
656
|
+
const audioContextRef = (0, import_react4.useRef)(null);
|
|
657
|
+
const mediaRecorderRef = (0, import_react4.useRef)(null);
|
|
658
|
+
const recordedChunks = (0, import_react4.useRef)([]);
|
|
659
|
+
const generalContext = (0, import_react_core.useCopilotContext)();
|
|
660
|
+
const messagesContext = (0, import_react_core.useCopilotMessagesContext)();
|
|
661
|
+
const context = __spreadValues(__spreadValues({}, generalContext), messagesContext);
|
|
662
|
+
const [startReadingFromMessageId, setStartReadingFromMessageId] = (0, import_react4.useState)(null);
|
|
663
|
+
(0, import_react4.useEffect)(() => {
|
|
664
|
+
if (pushToTalkState === "recording") {
|
|
665
|
+
startRecording(
|
|
666
|
+
mediaStreamRef,
|
|
667
|
+
mediaRecorderRef,
|
|
668
|
+
audioContextRef,
|
|
669
|
+
recordedChunks.current,
|
|
670
|
+
() => {
|
|
671
|
+
setPushToTalkState("transcribing");
|
|
672
|
+
}
|
|
673
|
+
);
|
|
674
|
+
} else {
|
|
675
|
+
stopRecording(mediaRecorderRef);
|
|
676
|
+
if (pushToTalkState === "transcribing") {
|
|
677
|
+
transcribeAudio(recordedChunks.current, context.copilotApiConfig.transcribeAudioUrl).then(
|
|
678
|
+
(transcription) => __async(void 0, null, function* () {
|
|
679
|
+
recordedChunks.current = [];
|
|
680
|
+
setPushToTalkState("idle");
|
|
681
|
+
const message = yield sendFunction(transcription);
|
|
682
|
+
setStartReadingFromMessageId(message.id);
|
|
683
|
+
})
|
|
684
|
+
);
|
|
685
|
+
}
|
|
686
|
+
}
|
|
687
|
+
return () => {
|
|
688
|
+
stopRecording(mediaRecorderRef);
|
|
689
|
+
};
|
|
690
|
+
}, [pushToTalkState]);
|
|
691
|
+
(0, import_react4.useEffect)(() => {
|
|
692
|
+
if (inProgress === false && startReadingFromMessageId) {
|
|
693
|
+
const lastMessageIndex = context.messages.findIndex(
|
|
694
|
+
(message) => message.id === startReadingFromMessageId
|
|
695
|
+
);
|
|
696
|
+
const messagesAfterLast = context.messages.slice(lastMessageIndex + 1).filter(
|
|
697
|
+
(message) => message.isTextMessage() && message.role === "assistant"
|
|
698
|
+
);
|
|
699
|
+
const text = messagesAfterLast.map((message) => message.content).join("\n");
|
|
700
|
+
playAudioResponse(text, context.copilotApiConfig.textToSpeechUrl, audioContextRef.current);
|
|
701
|
+
setStartReadingFromMessageId(null);
|
|
702
|
+
}
|
|
703
|
+
}, [startReadingFromMessageId, inProgress]);
|
|
704
|
+
return { pushToTalkState, setPushToTalkState };
|
|
705
|
+
};
|
|
706
|
+
|
|
707
|
+
// src/components/chat/Input.tsx
|
|
708
|
+
var import_react_core2 = require("@copilotkit/react-core");
|
|
709
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
710
|
+
var Input = ({ inProgress, onSend, isVisible = false }) => {
|
|
711
|
+
const context = useChatContext();
|
|
712
|
+
const copilotContext = (0, import_react_core2.useCopilotContext)();
|
|
713
|
+
const pushToTalkConfigured = copilotContext.copilotApiConfig.textToSpeechUrl !== void 0 && copilotContext.copilotApiConfig.transcribeAudioUrl !== void 0;
|
|
714
|
+
const textareaRef = (0, import_react5.useRef)(null);
|
|
715
|
+
const handleDivClick = (event) => {
|
|
716
|
+
var _a;
|
|
717
|
+
if (event.target !== event.currentTarget)
|
|
718
|
+
return;
|
|
719
|
+
(_a = textareaRef.current) == null ? void 0 : _a.focus();
|
|
720
|
+
};
|
|
721
|
+
const [text, setText] = (0, import_react5.useState)("");
|
|
722
|
+
const send = () => {
|
|
723
|
+
var _a;
|
|
724
|
+
if (inProgress)
|
|
725
|
+
return;
|
|
726
|
+
onSend(text);
|
|
727
|
+
setText("");
|
|
728
|
+
(_a = textareaRef.current) == null ? void 0 : _a.focus();
|
|
729
|
+
};
|
|
730
|
+
(0, import_react5.useEffect)(() => {
|
|
731
|
+
var _a;
|
|
732
|
+
if (isVisible) {
|
|
733
|
+
(_a = textareaRef.current) == null ? void 0 : _a.focus();
|
|
734
|
+
}
|
|
735
|
+
}, [isVisible]);
|
|
736
|
+
const { pushToTalkState, setPushToTalkState } = usePushToTalk({
|
|
737
|
+
sendFunction: onSend,
|
|
738
|
+
inProgress
|
|
739
|
+
});
|
|
740
|
+
const sendIcon = inProgress || pushToTalkState === "transcribing" ? context.icons.activityIcon : context.icons.sendIcon;
|
|
741
|
+
const showPushToTalk = pushToTalkConfigured && (pushToTalkState === "idle" || pushToTalkState === "recording") && !inProgress;
|
|
742
|
+
const canSend = () => {
|
|
743
|
+
return !inProgress && text.trim().length > 0 && pushToTalkState === "idle";
|
|
744
|
+
};
|
|
745
|
+
const sendDisabled = !canSend();
|
|
746
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "copilotKitInput", onClick: handleDivClick, children: [
|
|
747
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
748
|
+
Textarea_default,
|
|
749
|
+
{
|
|
750
|
+
ref: textareaRef,
|
|
751
|
+
placeholder: context.labels.placeholder,
|
|
752
|
+
autoFocus: true,
|
|
753
|
+
maxRows: 5,
|
|
754
|
+
value: text,
|
|
755
|
+
onChange: (event) => setText(event.target.value),
|
|
756
|
+
onKeyDown: (event) => {
|
|
757
|
+
if (event.key === "Enter" && !event.shiftKey) {
|
|
758
|
+
event.preventDefault();
|
|
759
|
+
if (canSend()) {
|
|
760
|
+
send();
|
|
761
|
+
}
|
|
762
|
+
}
|
|
763
|
+
}
|
|
764
|
+
}
|
|
765
|
+
),
|
|
766
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "copilotKitInputControls", children: [
|
|
767
|
+
showPushToTalk && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
768
|
+
"button",
|
|
769
|
+
{
|
|
770
|
+
onClick: () => setPushToTalkState(pushToTalkState === "idle" ? "recording" : "transcribing"),
|
|
771
|
+
className: pushToTalkState === "recording" ? "copilotKitPushToTalkRecording" : "",
|
|
772
|
+
children: context.icons.pushToTalkIcon
|
|
773
|
+
}
|
|
774
|
+
),
|
|
775
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
776
|
+
"button",
|
|
777
|
+
{
|
|
778
|
+
disabled: sendDisabled,
|
|
779
|
+
onClick: send,
|
|
780
|
+
"data-copilotkit-in-progress": !!inProgress,
|
|
781
|
+
"data-testid": inProgress ? "copilot-chat-request-in-progress" : void 0,
|
|
782
|
+
children: sendIcon
|
|
783
|
+
}
|
|
784
|
+
)
|
|
785
|
+
] })
|
|
786
|
+
] });
|
|
787
|
+
};
|
|
788
|
+
|
|
789
|
+
// src/components/chat/Response.tsx
|
|
790
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
791
|
+
var ResponseButton = ({ onClick, inProgress }) => {
|
|
792
|
+
const context = useChatContext();
|
|
793
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("button", { onClick, className: "copilotKitResponseButton", children: [
|
|
794
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: inProgress ? context.icons.stopIcon : context.icons.regenerateIcon }),
|
|
795
|
+
inProgress ? context.labels.stopGenerating : context.labels.regenerateResponse
|
|
796
|
+
] });
|
|
797
|
+
};
|
|
798
|
+
|
|
799
|
+
// src/components/chat/Markdown.tsx
|
|
800
|
+
var import_react7 = require("react");
|
|
801
|
+
var import_react_markdown = __toESM(require("react-markdown"));
|
|
802
|
+
|
|
803
|
+
// src/components/chat/CodeBlock.tsx
|
|
804
|
+
var import_react6 = require("react");
|
|
805
|
+
var import_react_syntax_highlighter = require("react-syntax-highlighter");
|
|
806
|
+
|
|
807
|
+
// src/hooks/use-copy-to-clipboard.tsx
|
|
808
|
+
var React4 = __toESM(require("react"));
|
|
809
|
+
function useCopyToClipboard({ timeout = 2e3 }) {
|
|
810
|
+
const [isCopied, setIsCopied] = React4.useState(false);
|
|
811
|
+
const copyToClipboard = (value) => {
|
|
812
|
+
var _a;
|
|
813
|
+
if (typeof window === "undefined" || !((_a = navigator.clipboard) == null ? void 0 : _a.writeText)) {
|
|
814
|
+
return;
|
|
815
|
+
}
|
|
816
|
+
if (!value) {
|
|
817
|
+
return;
|
|
818
|
+
}
|
|
819
|
+
navigator.clipboard.writeText(value).then(() => {
|
|
820
|
+
setIsCopied(true);
|
|
821
|
+
setTimeout(() => {
|
|
822
|
+
setIsCopied(false);
|
|
823
|
+
}, timeout);
|
|
824
|
+
});
|
|
825
|
+
};
|
|
826
|
+
return { isCopied, copyToClipboard };
|
|
827
|
+
}
|
|
828
|
+
|
|
829
|
+
// src/components/chat/CodeBlock.tsx
|
|
830
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
831
|
+
var programmingLanguages = {
|
|
832
|
+
javascript: ".js",
|
|
833
|
+
python: ".py",
|
|
834
|
+
java: ".java",
|
|
835
|
+
c: ".c",
|
|
836
|
+
cpp: ".cpp",
|
|
837
|
+
"c++": ".cpp",
|
|
838
|
+
"c#": ".cs",
|
|
839
|
+
ruby: ".rb",
|
|
840
|
+
php: ".php",
|
|
841
|
+
swift: ".swift",
|
|
842
|
+
"objective-c": ".m",
|
|
843
|
+
kotlin: ".kt",
|
|
844
|
+
typescript: ".ts",
|
|
845
|
+
go: ".go",
|
|
846
|
+
perl: ".pl",
|
|
847
|
+
rust: ".rs",
|
|
848
|
+
scala: ".scala",
|
|
849
|
+
haskell: ".hs",
|
|
850
|
+
lua: ".lua",
|
|
851
|
+
shell: ".sh",
|
|
852
|
+
sql: ".sql",
|
|
853
|
+
html: ".html",
|
|
854
|
+
css: ".css"
|
|
855
|
+
// add more file extensions here, make sure the key is same as language prop in CodeBlock.tsx component
|
|
856
|
+
};
|
|
857
|
+
var generateRandomString = (length, lowercase = false) => {
|
|
858
|
+
const chars = "ABCDEFGHJKLMNPQRSTUVWXY3456789";
|
|
859
|
+
let result = "";
|
|
860
|
+
for (let i = 0; i < length; i++) {
|
|
861
|
+
result += chars.charAt(Math.floor(Math.random() * chars.length));
|
|
862
|
+
}
|
|
863
|
+
return lowercase ? result.toLowerCase() : result;
|
|
864
|
+
};
|
|
865
|
+
var CodeBlock = (0, import_react6.memo)(({ language, value }) => {
|
|
866
|
+
const { isCopied, copyToClipboard } = useCopyToClipboard({ timeout: 2e3 });
|
|
867
|
+
const downloadAsFile = () => {
|
|
868
|
+
if (typeof window === "undefined") {
|
|
869
|
+
return;
|
|
870
|
+
}
|
|
871
|
+
const fileExtension = programmingLanguages[language] || ".file";
|
|
872
|
+
const suggestedFileName = `file-${generateRandomString(3, true)}${fileExtension}`;
|
|
873
|
+
const fileName = window.prompt("Enter file name", suggestedFileName);
|
|
874
|
+
if (!fileName) {
|
|
875
|
+
return;
|
|
876
|
+
}
|
|
877
|
+
const blob = new Blob([value], { type: "text/plain" });
|
|
878
|
+
const url = URL.createObjectURL(blob);
|
|
879
|
+
const link = document.createElement("a");
|
|
880
|
+
link.download = fileName;
|
|
881
|
+
link.href = url;
|
|
882
|
+
link.style.display = "none";
|
|
883
|
+
document.body.appendChild(link);
|
|
884
|
+
link.click();
|
|
885
|
+
document.body.removeChild(link);
|
|
886
|
+
URL.revokeObjectURL(url);
|
|
887
|
+
};
|
|
888
|
+
const onCopy = () => {
|
|
889
|
+
if (isCopied)
|
|
890
|
+
return;
|
|
891
|
+
copyToClipboard(value);
|
|
892
|
+
};
|
|
893
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "copilotKitCodeBlock", children: [
|
|
894
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "copilotKitCodeBlockToolbar", children: [
|
|
895
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "copilotKitCodeBlockToolbarLanguage", children: language }),
|
|
896
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "copilotKitCodeBlockToolbarButtons", children: [
|
|
897
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("button", { className: "copilotKitCodeBlockToolbarButton", onClick: downloadAsFile, children: [
|
|
898
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(DownloadIcon, {}),
|
|
899
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "sr-only", children: "Download" })
|
|
900
|
+
] }),
|
|
901
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("button", { className: "copilotKitCodeBlockToolbarButton", onClick: onCopy, children: [
|
|
902
|
+
isCopied ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(CheckIcon, {}) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(CopyIcon, {}),
|
|
903
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "sr-only", children: "Copy code" })
|
|
904
|
+
] })
|
|
905
|
+
] })
|
|
906
|
+
] }),
|
|
907
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
908
|
+
import_react_syntax_highlighter.Prism,
|
|
909
|
+
{
|
|
910
|
+
language,
|
|
911
|
+
style: highlightStyle,
|
|
912
|
+
PreTag: "div",
|
|
913
|
+
customStyle: {
|
|
914
|
+
margin: 0,
|
|
915
|
+
borderBottomLeftRadius: "0.375rem",
|
|
916
|
+
borderBottomRightRadius: "0.375rem"
|
|
917
|
+
},
|
|
918
|
+
children: value
|
|
919
|
+
}
|
|
920
|
+
)
|
|
921
|
+
] });
|
|
922
|
+
});
|
|
923
|
+
CodeBlock.displayName = "CodeBlock";
|
|
924
|
+
var highlightStyle = {
|
|
925
|
+
'pre[class*="language-"]': {
|
|
926
|
+
color: "#d4d4d4",
|
|
927
|
+
fontSize: "13px",
|
|
928
|
+
textShadow: "none",
|
|
929
|
+
fontFamily: 'Menlo, Monaco, Consolas, "Andale Mono", "Ubuntu Mono", "Courier New", monospace',
|
|
930
|
+
direction: "ltr",
|
|
931
|
+
textAlign: "left",
|
|
932
|
+
whiteSpace: "pre",
|
|
933
|
+
wordSpacing: "normal",
|
|
934
|
+
wordBreak: "normal",
|
|
935
|
+
lineHeight: "1.5",
|
|
936
|
+
MozTabSize: "4",
|
|
937
|
+
OTabSize: "4",
|
|
938
|
+
tabSize: "4",
|
|
939
|
+
WebkitHyphens: "none",
|
|
940
|
+
MozHyphens: "none",
|
|
941
|
+
msHyphens: "none",
|
|
942
|
+
hyphens: "none",
|
|
943
|
+
padding: "1em",
|
|
944
|
+
margin: ".5em 0",
|
|
945
|
+
overflow: "auto",
|
|
946
|
+
background: "#1e1e1e"
|
|
947
|
+
},
|
|
948
|
+
'code[class*="language-"]': {
|
|
949
|
+
color: "#d4d4d4",
|
|
950
|
+
fontSize: "13px",
|
|
951
|
+
textShadow: "none",
|
|
952
|
+
fontFamily: 'Menlo, Monaco, Consolas, "Andale Mono", "Ubuntu Mono", "Courier New", monospace',
|
|
953
|
+
direction: "ltr",
|
|
954
|
+
textAlign: "left",
|
|
955
|
+
whiteSpace: "pre",
|
|
956
|
+
wordSpacing: "normal",
|
|
957
|
+
wordBreak: "normal",
|
|
958
|
+
lineHeight: "1.5",
|
|
959
|
+
MozTabSize: "4",
|
|
960
|
+
OTabSize: "4",
|
|
961
|
+
tabSize: "4",
|
|
962
|
+
WebkitHyphens: "none",
|
|
963
|
+
MozHyphens: "none",
|
|
964
|
+
msHyphens: "none",
|
|
965
|
+
hyphens: "none"
|
|
966
|
+
},
|
|
967
|
+
'pre[class*="language-"]::selection': {
|
|
968
|
+
textShadow: "none",
|
|
969
|
+
background: "#264F78"
|
|
970
|
+
},
|
|
971
|
+
'code[class*="language-"]::selection': {
|
|
972
|
+
textShadow: "none",
|
|
973
|
+
background: "#264F78"
|
|
974
|
+
},
|
|
975
|
+
'pre[class*="language-"] *::selection': {
|
|
976
|
+
textShadow: "none",
|
|
977
|
+
background: "#264F78"
|
|
978
|
+
},
|
|
979
|
+
'code[class*="language-"] *::selection': {
|
|
980
|
+
textShadow: "none",
|
|
981
|
+
background: "#264F78"
|
|
982
|
+
},
|
|
983
|
+
':not(pre) > code[class*="language-"]': {
|
|
984
|
+
padding: ".1em .3em",
|
|
985
|
+
borderRadius: ".3em",
|
|
986
|
+
color: "#db4c69",
|
|
987
|
+
background: "#1e1e1e"
|
|
988
|
+
},
|
|
989
|
+
".namespace": {
|
|
990
|
+
Opacity: ".7"
|
|
991
|
+
},
|
|
992
|
+
"doctype.doctype-tag": {
|
|
993
|
+
color: "#569CD6"
|
|
994
|
+
},
|
|
995
|
+
"doctype.name": {
|
|
996
|
+
color: "#9cdcfe"
|
|
997
|
+
},
|
|
998
|
+
comment: {
|
|
999
|
+
color: "#6a9955"
|
|
1000
|
+
},
|
|
1001
|
+
prolog: {
|
|
1002
|
+
color: "#6a9955"
|
|
1003
|
+
},
|
|
1004
|
+
punctuation: {
|
|
1005
|
+
color: "#d4d4d4"
|
|
1006
|
+
},
|
|
1007
|
+
".language-html .language-css .token.punctuation": {
|
|
1008
|
+
color: "#d4d4d4"
|
|
1009
|
+
},
|
|
1010
|
+
".language-html .language-javascript .token.punctuation": {
|
|
1011
|
+
color: "#d4d4d4"
|
|
1012
|
+
},
|
|
1013
|
+
property: {
|
|
1014
|
+
color: "#9cdcfe"
|
|
1015
|
+
},
|
|
1016
|
+
tag: {
|
|
1017
|
+
color: "#569cd6"
|
|
1018
|
+
},
|
|
1019
|
+
boolean: {
|
|
1020
|
+
color: "#569cd6"
|
|
1021
|
+
},
|
|
1022
|
+
number: {
|
|
1023
|
+
color: "#b5cea8"
|
|
1024
|
+
},
|
|
1025
|
+
constant: {
|
|
1026
|
+
color: "#9cdcfe"
|
|
1027
|
+
},
|
|
1028
|
+
symbol: {
|
|
1029
|
+
color: "#b5cea8"
|
|
1030
|
+
},
|
|
1031
|
+
inserted: {
|
|
1032
|
+
color: "#b5cea8"
|
|
1033
|
+
},
|
|
1034
|
+
unit: {
|
|
1035
|
+
color: "#b5cea8"
|
|
1036
|
+
},
|
|
1037
|
+
selector: {
|
|
1038
|
+
color: "#d7ba7d"
|
|
1039
|
+
},
|
|
1040
|
+
"attr-name": {
|
|
1041
|
+
color: "#9cdcfe"
|
|
1042
|
+
},
|
|
1043
|
+
string: {
|
|
1044
|
+
color: "#ce9178"
|
|
1045
|
+
},
|
|
1046
|
+
char: {
|
|
1047
|
+
color: "#ce9178"
|
|
1048
|
+
},
|
|
1049
|
+
builtin: {
|
|
1050
|
+
color: "#ce9178"
|
|
1051
|
+
},
|
|
1052
|
+
deleted: {
|
|
1053
|
+
color: "#ce9178"
|
|
1054
|
+
},
|
|
1055
|
+
".language-css .token.string.url": {
|
|
1056
|
+
textDecoration: "underline"
|
|
1057
|
+
},
|
|
1058
|
+
operator: {
|
|
1059
|
+
color: "#d4d4d4"
|
|
1060
|
+
},
|
|
1061
|
+
entity: {
|
|
1062
|
+
color: "#569cd6"
|
|
1063
|
+
},
|
|
1064
|
+
"operator.arrow": {
|
|
1065
|
+
color: "#569CD6"
|
|
1066
|
+
},
|
|
1067
|
+
atrule: {
|
|
1068
|
+
color: "#ce9178"
|
|
1069
|
+
},
|
|
1070
|
+
"atrule.rule": {
|
|
1071
|
+
color: "#c586c0"
|
|
1072
|
+
},
|
|
1073
|
+
"atrule.url": {
|
|
1074
|
+
color: "#9cdcfe"
|
|
1075
|
+
},
|
|
1076
|
+
"atrule.url.function": {
|
|
1077
|
+
color: "#dcdcaa"
|
|
1078
|
+
},
|
|
1079
|
+
"atrule.url.punctuation": {
|
|
1080
|
+
color: "#d4d4d4"
|
|
1081
|
+
},
|
|
1082
|
+
keyword: {
|
|
1083
|
+
color: "#569CD6"
|
|
1084
|
+
},
|
|
1085
|
+
"keyword.module": {
|
|
1086
|
+
color: "#c586c0"
|
|
1087
|
+
},
|
|
1088
|
+
"keyword.control-flow": {
|
|
1089
|
+
color: "#c586c0"
|
|
1090
|
+
},
|
|
1091
|
+
function: {
|
|
1092
|
+
color: "#dcdcaa"
|
|
1093
|
+
},
|
|
1094
|
+
"function.maybe-class-name": {
|
|
1095
|
+
color: "#dcdcaa"
|
|
1096
|
+
},
|
|
1097
|
+
regex: {
|
|
1098
|
+
color: "#d16969"
|
|
1099
|
+
},
|
|
1100
|
+
important: {
|
|
1101
|
+
color: "#569cd6"
|
|
1102
|
+
},
|
|
1103
|
+
italic: {
|
|
1104
|
+
fontStyle: "italic"
|
|
1105
|
+
},
|
|
1106
|
+
"class-name": {
|
|
1107
|
+
color: "#4ec9b0"
|
|
1108
|
+
},
|
|
1109
|
+
"maybe-class-name": {
|
|
1110
|
+
color: "#4ec9b0"
|
|
1111
|
+
},
|
|
1112
|
+
console: {
|
|
1113
|
+
color: "#9cdcfe"
|
|
1114
|
+
},
|
|
1115
|
+
parameter: {
|
|
1116
|
+
color: "#9cdcfe"
|
|
1117
|
+
},
|
|
1118
|
+
interpolation: {
|
|
1119
|
+
color: "#9cdcfe"
|
|
1120
|
+
},
|
|
1121
|
+
"punctuation.interpolation-punctuation": {
|
|
1122
|
+
color: "#569cd6"
|
|
1123
|
+
},
|
|
1124
|
+
variable: {
|
|
1125
|
+
color: "#9cdcfe"
|
|
1126
|
+
},
|
|
1127
|
+
"imports.maybe-class-name": {
|
|
1128
|
+
color: "#9cdcfe"
|
|
1129
|
+
},
|
|
1130
|
+
"exports.maybe-class-name": {
|
|
1131
|
+
color: "#9cdcfe"
|
|
1132
|
+
},
|
|
1133
|
+
escape: {
|
|
1134
|
+
color: "#d7ba7d"
|
|
1135
|
+
},
|
|
1136
|
+
"tag.punctuation": {
|
|
1137
|
+
color: "#808080"
|
|
1138
|
+
},
|
|
1139
|
+
cdata: {
|
|
1140
|
+
color: "#808080"
|
|
1141
|
+
},
|
|
1142
|
+
"attr-value": {
|
|
1143
|
+
color: "#ce9178"
|
|
1144
|
+
},
|
|
1145
|
+
"attr-value.punctuation": {
|
|
1146
|
+
color: "#ce9178"
|
|
1147
|
+
},
|
|
1148
|
+
"attr-value.punctuation.attr-equals": {
|
|
1149
|
+
color: "#d4d4d4"
|
|
1150
|
+
},
|
|
1151
|
+
namespace: {
|
|
1152
|
+
color: "#4ec9b0"
|
|
1153
|
+
},
|
|
1154
|
+
'pre[class*="language-javascript"]': {
|
|
1155
|
+
color: "#9cdcfe"
|
|
1156
|
+
},
|
|
1157
|
+
'code[class*="language-javascript"]': {
|
|
1158
|
+
color: "#9cdcfe"
|
|
1159
|
+
},
|
|
1160
|
+
'pre[class*="language-jsx"]': {
|
|
1161
|
+
color: "#9cdcfe"
|
|
1162
|
+
},
|
|
1163
|
+
'code[class*="language-jsx"]': {
|
|
1164
|
+
color: "#9cdcfe"
|
|
1165
|
+
},
|
|
1166
|
+
'pre[class*="language-typescript"]': {
|
|
1167
|
+
color: "#9cdcfe"
|
|
1168
|
+
},
|
|
1169
|
+
'code[class*="language-typescript"]': {
|
|
1170
|
+
color: "#9cdcfe"
|
|
1171
|
+
},
|
|
1172
|
+
'pre[class*="language-tsx"]': {
|
|
1173
|
+
color: "#9cdcfe"
|
|
1174
|
+
},
|
|
1175
|
+
'code[class*="language-tsx"]': {
|
|
1176
|
+
color: "#9cdcfe"
|
|
1177
|
+
},
|
|
1178
|
+
'pre[class*="language-css"]': {
|
|
1179
|
+
color: "#ce9178"
|
|
1180
|
+
},
|
|
1181
|
+
'code[class*="language-css"]': {
|
|
1182
|
+
color: "#ce9178"
|
|
1183
|
+
},
|
|
1184
|
+
'pre[class*="language-html"]': {
|
|
1185
|
+
color: "#d4d4d4"
|
|
1186
|
+
},
|
|
1187
|
+
'code[class*="language-html"]': {
|
|
1188
|
+
color: "#d4d4d4"
|
|
1189
|
+
},
|
|
1190
|
+
".language-regex .token.anchor": {
|
|
1191
|
+
color: "#dcdcaa"
|
|
1192
|
+
},
|
|
1193
|
+
".language-html .token.punctuation": {
|
|
1194
|
+
color: "#808080"
|
|
1195
|
+
},
|
|
1196
|
+
'pre[class*="language-"] > code[class*="language-"]': {
|
|
1197
|
+
position: "relative",
|
|
1198
|
+
zIndex: "1"
|
|
1199
|
+
},
|
|
1200
|
+
".line-highlight.line-highlight": {
|
|
1201
|
+
background: "#f7ebc6",
|
|
1202
|
+
boxShadow: "inset 5px 0 0 #f7d87c",
|
|
1203
|
+
zIndex: "0"
|
|
1204
|
+
}
|
|
1205
|
+
};
|
|
1206
|
+
|
|
1207
|
+
// src/components/chat/Markdown.tsx
|
|
1208
|
+
var import_remark_gfm = __toESM(require("remark-gfm"));
|
|
1209
|
+
var import_remark_math = __toESM(require("remark-math"));
|
|
1210
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
1211
|
+
var MemoizedReactMarkdown = (0, import_react7.memo)(
|
|
1212
|
+
import_react_markdown.default,
|
|
1213
|
+
(prevProps, nextProps) => prevProps.children === nextProps.children && prevProps.className === nextProps.className
|
|
1214
|
+
);
|
|
1215
|
+
var Markdown = ({ content }) => {
|
|
1216
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "copilotKitMarkdown", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(MemoizedReactMarkdown, { components, remarkPlugins: [import_remark_gfm.default, import_remark_math.default], children: content }) });
|
|
1217
|
+
};
|
|
1218
|
+
var components = {
|
|
1219
|
+
p({ children }) {
|
|
1220
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { children });
|
|
1221
|
+
},
|
|
1222
|
+
a(_a) {
|
|
1223
|
+
var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
|
|
1224
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1225
|
+
"a",
|
|
1226
|
+
__spreadProps(__spreadValues({
|
|
1227
|
+
style: { color: "blue", textDecoration: "underline" }
|
|
1228
|
+
}, props), {
|
|
1229
|
+
target: "_blank",
|
|
1230
|
+
rel: "noopener noreferrer",
|
|
1231
|
+
children
|
|
1232
|
+
})
|
|
1233
|
+
);
|
|
1234
|
+
},
|
|
1235
|
+
code(_c) {
|
|
1236
|
+
var _d = _c, { children, className, inline } = _d, props = __objRest(_d, ["children", "className", "inline"]);
|
|
1237
|
+
if (children.length) {
|
|
1238
|
+
if (children[0] == "\u258D") {
|
|
1239
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1240
|
+
"span",
|
|
1241
|
+
{
|
|
1242
|
+
style: {
|
|
1243
|
+
animation: "pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite",
|
|
1244
|
+
marginTop: "0.25rem"
|
|
1245
|
+
},
|
|
1246
|
+
children: "\u258D"
|
|
1247
|
+
}
|
|
1248
|
+
);
|
|
1249
|
+
}
|
|
1250
|
+
children[0] = children[0].replace("`\u258D`", "\u258D");
|
|
1251
|
+
}
|
|
1252
|
+
const match = /language-(\w+)/.exec(className || "");
|
|
1253
|
+
if (inline) {
|
|
1254
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("code", __spreadProps(__spreadValues({ className }, props), { children }));
|
|
1255
|
+
}
|
|
1256
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1257
|
+
CodeBlock,
|
|
1258
|
+
__spreadValues({
|
|
1259
|
+
language: match && match[1] || "",
|
|
1260
|
+
value: String(children).replace(/\n$/, "")
|
|
1261
|
+
}, props),
|
|
1262
|
+
Math.random()
|
|
1263
|
+
);
|
|
1264
|
+
}
|
|
1265
|
+
};
|
|
1266
|
+
|
|
1267
|
+
// src/components/chat/messages/RenderTextMessage.tsx
|
|
1268
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
1269
|
+
function RenderTextMessage(props) {
|
|
1270
|
+
const { message, inProgress, index, isCurrentMessage } = props;
|
|
1271
|
+
const { icons } = useChatContext();
|
|
1272
|
+
if (message.isTextMessage()) {
|
|
1273
|
+
if (message.role === "user") {
|
|
1274
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1275
|
+
"div",
|
|
1276
|
+
{
|
|
1277
|
+
"data-message-role": "user",
|
|
1278
|
+
className: "copilotKitMessage copilotKitUserMessage",
|
|
1279
|
+
children: message.content
|
|
1280
|
+
},
|
|
1281
|
+
index
|
|
1282
|
+
);
|
|
1283
|
+
} else if (message.role == "assistant") {
|
|
1284
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1285
|
+
"div",
|
|
1286
|
+
{
|
|
1287
|
+
"data-message-role": "assistant",
|
|
1288
|
+
className: `copilotKitMessage copilotKitAssistantMessage`,
|
|
1289
|
+
children: isCurrentMessage && inProgress && !message.content ? icons.spinnerIcon : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Markdown, { content: message.content })
|
|
1290
|
+
},
|
|
1291
|
+
index
|
|
1292
|
+
);
|
|
1293
|
+
}
|
|
1294
|
+
}
|
|
1295
|
+
}
|
|
1296
|
+
|
|
1297
|
+
// src/components/chat/messages/RenderActionExecutionMessage.tsx
|
|
1298
|
+
var import_runtime_client_gql2 = require("@copilotkit/runtime-client-gql");
|
|
1299
|
+
var import_react_core3 = require("@copilotkit/react-core");
|
|
1300
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
1301
|
+
function RenderActionExecutionMessage(props) {
|
|
1302
|
+
const { message, inProgress, index, isCurrentMessage, actionResult } = props;
|
|
1303
|
+
const { chatComponentsCache } = (0, import_react_core3.useCopilotContext)();
|
|
1304
|
+
const { icons } = useChatContext();
|
|
1305
|
+
if (message.isActionExecutionMessage()) {
|
|
1306
|
+
if (chatComponentsCache.current !== null && (chatComponentsCache.current.actions[message.name] || chatComponentsCache.current.actions["*"])) {
|
|
1307
|
+
const render = chatComponentsCache.current.actions[message.name] || chatComponentsCache.current.actions["*"];
|
|
1308
|
+
if (typeof render === "string") {
|
|
1309
|
+
if (isCurrentMessage && inProgress) {
|
|
1310
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: `copilotKitMessage copilotKitAssistantMessage`, children: [
|
|
1311
|
+
icons.spinnerIcon,
|
|
1312
|
+
" ",
|
|
1313
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "inProgressLabel", children: render })
|
|
1314
|
+
] }, index);
|
|
1315
|
+
} else {
|
|
1316
|
+
return null;
|
|
1317
|
+
}
|
|
1318
|
+
} else {
|
|
1319
|
+
const args = message.arguments;
|
|
1320
|
+
let status = "inProgress";
|
|
1321
|
+
if (actionResult !== void 0) {
|
|
1322
|
+
status = "complete";
|
|
1323
|
+
} else if (message.status.code !== import_runtime_client_gql2.MessageStatusCode.Pending) {
|
|
1324
|
+
status = "executing";
|
|
1325
|
+
}
|
|
1326
|
+
try {
|
|
1327
|
+
const toRender = render({
|
|
1328
|
+
status,
|
|
1329
|
+
args,
|
|
1330
|
+
result: actionResult,
|
|
1331
|
+
name: message.name
|
|
1332
|
+
});
|
|
1333
|
+
if (!toRender && status === "complete") {
|
|
1334
|
+
return null;
|
|
1335
|
+
}
|
|
1336
|
+
if (typeof toRender === "string") {
|
|
1337
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: `copilotKitMessage copilotKitAssistantMessage`, children: [
|
|
1338
|
+
isCurrentMessage && inProgress && icons.spinnerIcon,
|
|
1339
|
+
" ",
|
|
1340
|
+
toRender
|
|
1341
|
+
] }, index);
|
|
1342
|
+
} else {
|
|
1343
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1344
|
+
"div",
|
|
1345
|
+
{
|
|
1346
|
+
"data-message-type": "action-render",
|
|
1347
|
+
className: "copilotKitCustomAssistantMessage",
|
|
1348
|
+
children: toRender
|
|
1349
|
+
},
|
|
1350
|
+
index
|
|
1351
|
+
);
|
|
1352
|
+
}
|
|
1353
|
+
} catch (e) {
|
|
1354
|
+
console.error(`Error executing render function for action ${message.name}: ${e}`);
|
|
1355
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: `copilotKitMessage copilotKitAssistantMessage`, children: [
|
|
1356
|
+
isCurrentMessage && inProgress && icons.spinnerIcon,
|
|
1357
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("b", { children: [
|
|
1358
|
+
"\u274C Error executing render: ",
|
|
1359
|
+
message.name
|
|
1360
|
+
] }),
|
|
1361
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("br", {}),
|
|
1362
|
+
e instanceof Error ? e.message : String(e)
|
|
1363
|
+
] }, index);
|
|
1364
|
+
}
|
|
1365
|
+
}
|
|
1366
|
+
} else if (!inProgress || !isCurrentMessage) {
|
|
1367
|
+
return null;
|
|
1368
|
+
} else {
|
|
1369
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: `copilotKitMessage copilotKitAssistantMessage`, children: icons.spinnerIcon }, index);
|
|
1370
|
+
}
|
|
1371
|
+
}
|
|
1372
|
+
}
|
|
1373
|
+
|
|
1374
|
+
// src/components/chat/messages/RenderResultMessage.tsx
|
|
1375
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
1376
|
+
function RenderResultMessage(props) {
|
|
1377
|
+
const { message, inProgress, index, isCurrentMessage } = props;
|
|
1378
|
+
const { icons } = useChatContext();
|
|
1379
|
+
if (message.isResultMessage() && inProgress && isCurrentMessage) {
|
|
1380
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: `copilotKitMessage copilotKitAssistantMessage`, children: icons.spinnerIcon }, index);
|
|
1381
|
+
}
|
|
1382
|
+
}
|
|
1383
|
+
|
|
1384
|
+
// src/components/chat/messages/RenderAgentStateMessage.tsx
|
|
1385
|
+
var import_react_core4 = require("@copilotkit/react-core");
|
|
1386
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1387
|
+
function RenderAgentStateMessage(props) {
|
|
1388
|
+
const { message, inProgress, index, isCurrentMessage } = props;
|
|
1389
|
+
const { chatComponentsCache } = (0, import_react_core4.useCopilotContext)();
|
|
1390
|
+
const { icons } = useChatContext();
|
|
1391
|
+
if (message.isAgentStateMessage()) {
|
|
1392
|
+
let render;
|
|
1393
|
+
if (chatComponentsCache.current !== null) {
|
|
1394
|
+
render = chatComponentsCache.current.coAgentStateRenders[`${message.agentName}-${message.nodeName}`] || chatComponentsCache.current.coAgentStateRenders[`${message.agentName}-global`];
|
|
1395
|
+
}
|
|
1396
|
+
if (render) {
|
|
1397
|
+
if (typeof render === "string") {
|
|
1398
|
+
if (isCurrentMessage && inProgress) {
|
|
1399
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: `copilotKitMessage copilotKitAssistantMessage`, children: [
|
|
1400
|
+
icons.spinnerIcon,
|
|
1401
|
+
" ",
|
|
1402
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "inProgressLabel", children: render })
|
|
1403
|
+
] }, index);
|
|
1404
|
+
} else {
|
|
1405
|
+
return null;
|
|
1406
|
+
}
|
|
1407
|
+
} else {
|
|
1408
|
+
const state = message.state;
|
|
1409
|
+
let status = message.active ? "inProgress" : "complete";
|
|
1410
|
+
const toRender = render({
|
|
1411
|
+
status,
|
|
1412
|
+
state,
|
|
1413
|
+
nodeName: message.nodeName
|
|
1414
|
+
});
|
|
1415
|
+
if (!toRender && status === "complete") {
|
|
1416
|
+
return null;
|
|
1417
|
+
}
|
|
1418
|
+
if (!toRender && isCurrentMessage && inProgress) {
|
|
1419
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: `copilotKitMessage copilotKitAssistantMessage`, children: icons.spinnerIcon }, index);
|
|
1420
|
+
} else if (!toRender) {
|
|
1421
|
+
return null;
|
|
1422
|
+
}
|
|
1423
|
+
if (typeof toRender === "string") {
|
|
1424
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: `copilotKitMessage copilotKitAssistantMessage`, children: [
|
|
1425
|
+
isCurrentMessage && inProgress && icons.spinnerIcon,
|
|
1426
|
+
" ",
|
|
1427
|
+
toRender
|
|
1428
|
+
] }, index);
|
|
1429
|
+
} else {
|
|
1430
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "copilotKitCustomAssistantMessage", children: toRender }, index);
|
|
1431
|
+
}
|
|
1432
|
+
}
|
|
1433
|
+
} else if (!inProgress || !isCurrentMessage) {
|
|
1434
|
+
return null;
|
|
1435
|
+
} else {
|
|
1436
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: `copilotKitMessage copilotKitAssistantMessage`, children: icons.spinnerIcon }, index);
|
|
1437
|
+
}
|
|
1438
|
+
}
|
|
1439
|
+
}
|
|
1440
|
+
|
|
1441
|
+
// src/components/chat/Suggestion.tsx
|
|
1442
|
+
var import_react_core5 = require("@copilotkit/react-core");
|
|
1443
|
+
var import_shared = require("@copilotkit/shared");
|
|
1444
|
+
var import_runtime_client_gql3 = require("@copilotkit/runtime-client-gql");
|
|
1445
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1446
|
+
function Suggestion({ title, message, onClick, partial, className }) {
|
|
1447
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1448
|
+
"button",
|
|
1449
|
+
{
|
|
1450
|
+
disabled: partial,
|
|
1451
|
+
onClick: (e) => {
|
|
1452
|
+
e.preventDefault();
|
|
1453
|
+
onClick(message);
|
|
1454
|
+
},
|
|
1455
|
+
className: className || "suggestion",
|
|
1456
|
+
children: [
|
|
1457
|
+
partial && SmallSpinnerIcon,
|
|
1458
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children: title })
|
|
1459
|
+
]
|
|
1460
|
+
}
|
|
1461
|
+
);
|
|
1462
|
+
}
|
|
1463
|
+
var reloadSuggestions = (context, chatSuggestionConfiguration, setCurrentSuggestions, abortControllerRef) => __async(void 0, null, function* () {
|
|
1464
|
+
const abortController = abortControllerRef.current;
|
|
1465
|
+
const tools = JSON.stringify(
|
|
1466
|
+
Object.values(context.actions).map((action) => ({
|
|
1467
|
+
name: action.name,
|
|
1468
|
+
description: action.description,
|
|
1469
|
+
jsonSchema: JSON.stringify((0, import_shared.actionParametersToJsonSchema)(action.parameters))
|
|
1470
|
+
}))
|
|
1471
|
+
);
|
|
1472
|
+
const allSuggestions = [];
|
|
1473
|
+
for (const config of Object.values(chatSuggestionConfiguration)) {
|
|
1474
|
+
try {
|
|
1475
|
+
const numOfSuggestionsInstructions = config.minSuggestions === 0 ? `Produce up to ${config.maxSuggestions} suggestions. If there are no highly relevant suggestions you can think of, provide an empty array.` : `Produce between ${config.minSuggestions} and ${config.maxSuggestions} suggestions.`;
|
|
1476
|
+
const result = yield (0, import_react_core5.extract)({
|
|
1477
|
+
context,
|
|
1478
|
+
instructions: "Suggest what the user could say next. Provide clear, highly relevant suggestions. Do not literally suggest function calls. ",
|
|
1479
|
+
data: config.instructions + "\n\n" + numOfSuggestionsInstructions + "\n\nAvailable tools: " + tools + "\n\n",
|
|
1480
|
+
requestType: import_runtime_client_gql3.CopilotRequestType.Task,
|
|
1481
|
+
parameters: [
|
|
1482
|
+
{
|
|
1483
|
+
name: "suggestions",
|
|
1484
|
+
type: "object[]",
|
|
1485
|
+
attributes: [
|
|
1486
|
+
{
|
|
1487
|
+
name: "title",
|
|
1488
|
+
description: "The title of the suggestion. This is shown as a button and should be short.",
|
|
1489
|
+
type: "string"
|
|
1490
|
+
},
|
|
1491
|
+
{
|
|
1492
|
+
name: "message",
|
|
1493
|
+
description: "The message to send when the suggestion is clicked. This should be a clear, complete sentence and will be sent as an instruction to the AI.",
|
|
1494
|
+
type: "string"
|
|
1495
|
+
}
|
|
1496
|
+
]
|
|
1497
|
+
}
|
|
1498
|
+
],
|
|
1499
|
+
include: {
|
|
1500
|
+
messages: true,
|
|
1501
|
+
readable: true
|
|
1502
|
+
},
|
|
1503
|
+
abortSignal: abortController == null ? void 0 : abortController.signal,
|
|
1504
|
+
stream: ({ status, args }) => {
|
|
1505
|
+
const suggestions = args.suggestions || [];
|
|
1506
|
+
const newSuggestions = [];
|
|
1507
|
+
for (let i = 0; i < suggestions.length; i++) {
|
|
1508
|
+
if (config.maxSuggestions !== void 0 && i >= config.maxSuggestions) {
|
|
1509
|
+
break;
|
|
1510
|
+
}
|
|
1511
|
+
const { title, message } = suggestions[i];
|
|
1512
|
+
const partial = i == suggestions.length - 1 && status !== "complete";
|
|
1513
|
+
newSuggestions.push({
|
|
1514
|
+
title,
|
|
1515
|
+
message,
|
|
1516
|
+
partial,
|
|
1517
|
+
className: config.className
|
|
1518
|
+
});
|
|
1519
|
+
}
|
|
1520
|
+
setCurrentSuggestions([...allSuggestions, ...newSuggestions]);
|
|
1521
|
+
}
|
|
1522
|
+
});
|
|
1523
|
+
allSuggestions.push(...result.suggestions);
|
|
1524
|
+
} catch (error) {
|
|
1525
|
+
console.error("Error loading suggestions", error);
|
|
1526
|
+
}
|
|
1527
|
+
}
|
|
1528
|
+
if (abortControllerRef.current === abortController) {
|
|
1529
|
+
abortControllerRef.current = null;
|
|
1530
|
+
}
|
|
1531
|
+
});
|
|
1532
|
+
|
|
1533
|
+
// src/components/chat/Chat.tsx
|
|
1534
|
+
var import_react11 = __toESM(require("react"));
|
|
1535
|
+
var import_react_core8 = require("@copilotkit/react-core");
|
|
1536
|
+
var import_runtime_client_gql4 = require("@copilotkit/runtime-client-gql");
|
|
1537
|
+
var import_shared3 = require("@copilotkit/shared");
|
|
1538
|
+
|
|
1539
|
+
// src/components/dev-console/utils.ts
|
|
1540
|
+
var import_react_core6 = require("@copilotkit/react-core");
|
|
1541
|
+
function shouldShowDevConsole(showDevConsole) {
|
|
1542
|
+
if (typeof showDevConsole === "boolean") {
|
|
1543
|
+
return showDevConsole;
|
|
1544
|
+
}
|
|
1545
|
+
return getHostname() === "localhost" || getHostname() === "127.0.0.1" || getHostname() === "0.0.0.0" || getHostname() === "::1";
|
|
1546
|
+
}
|
|
1547
|
+
function getHostname() {
|
|
1548
|
+
if (typeof window !== "undefined" && window.location) {
|
|
1549
|
+
return window.location.hostname;
|
|
1550
|
+
}
|
|
1551
|
+
return "";
|
|
1552
|
+
}
|
|
1553
|
+
function getPublishedCopilotKitVersion(current, forceCheck = false) {
|
|
1554
|
+
return __async(this, null, function* () {
|
|
1555
|
+
const LOCAL_STORAGE_KEY = "__copilotkit_version_check__";
|
|
1556
|
+
const serializedVersion = localStorage.getItem(LOCAL_STORAGE_KEY);
|
|
1557
|
+
if (serializedVersion && !forceCheck) {
|
|
1558
|
+
try {
|
|
1559
|
+
const parsedVersion = JSON.parse(serializedVersion);
|
|
1560
|
+
const oneHour = 60 * 60 * 1e3;
|
|
1561
|
+
const now = (/* @__PURE__ */ new Date()).getTime();
|
|
1562
|
+
if (parsedVersion.current === current && now - new Date(parsedVersion.lastChecked).getTime() < oneHour) {
|
|
1563
|
+
return parsedVersion;
|
|
1564
|
+
}
|
|
1565
|
+
} catch (error) {
|
|
1566
|
+
console.error("Failed to parse CopilotKitVersion from localStorage", error);
|
|
1567
|
+
}
|
|
1568
|
+
}
|
|
1569
|
+
try {
|
|
1570
|
+
const response = yield fetch("https://api.cloud.stagingcopilotkit.ai/check-for-updates", {
|
|
1571
|
+
method: "POST",
|
|
1572
|
+
headers: {
|
|
1573
|
+
"Content-Type": "application/json"
|
|
1574
|
+
},
|
|
1575
|
+
body: JSON.stringify({
|
|
1576
|
+
packages: [
|
|
1577
|
+
{
|
|
1578
|
+
packageName: "@copilotkit/shared",
|
|
1579
|
+
packageVersion: current
|
|
1580
|
+
}
|
|
1581
|
+
]
|
|
1582
|
+
})
|
|
1583
|
+
});
|
|
1584
|
+
const data = yield response.json();
|
|
1585
|
+
const version = {
|
|
1586
|
+
current,
|
|
1587
|
+
lastChecked: (/* @__PURE__ */ new Date()).getTime(),
|
|
1588
|
+
latest: data.packages[0].latestVersion,
|
|
1589
|
+
severity: data.packages[0].severity,
|
|
1590
|
+
advisory: data.packages[0].advisory || null
|
|
1591
|
+
};
|
|
1592
|
+
localStorage.setItem(LOCAL_STORAGE_KEY, JSON.stringify(version));
|
|
1593
|
+
return version;
|
|
1594
|
+
} catch (error) {
|
|
1595
|
+
console.error("Failed to check for updates", error);
|
|
1596
|
+
throw error;
|
|
1597
|
+
}
|
|
1598
|
+
});
|
|
1599
|
+
}
|
|
1600
|
+
function logReadables(context) {
|
|
1601
|
+
console.log("%cCurrent Readables:", "font-size: 16px; font-weight: bold;");
|
|
1602
|
+
const readables = context.getContextString([], import_react_core6.defaultCopilotContextCategories).trim();
|
|
1603
|
+
if (readables.length === 0) {
|
|
1604
|
+
console.log("No readables found");
|
|
1605
|
+
return;
|
|
1606
|
+
}
|
|
1607
|
+
console.log(readables);
|
|
1608
|
+
}
|
|
1609
|
+
function logActions(context) {
|
|
1610
|
+
console.log("%cCurrent Actions:", "font-size: 16px; font-weight: bold;");
|
|
1611
|
+
if (Object.values(context.actions).length === 0) {
|
|
1612
|
+
console.log("No actions found");
|
|
1613
|
+
return;
|
|
1614
|
+
}
|
|
1615
|
+
for (const action of Object.values(context.actions)) {
|
|
1616
|
+
console.group(action.name);
|
|
1617
|
+
console.log("name", action.name);
|
|
1618
|
+
console.log("description", action.description);
|
|
1619
|
+
console.log("parameters", action.parameters);
|
|
1620
|
+
console.groupEnd();
|
|
1621
|
+
}
|
|
1622
|
+
}
|
|
1623
|
+
function logMessages(context) {
|
|
1624
|
+
console.log("%cCurrent Messages:", "font-size: 16px; font-weight: bold;");
|
|
1625
|
+
if (context.messages.length === 0) {
|
|
1626
|
+
console.log("No messages found");
|
|
1627
|
+
return;
|
|
1628
|
+
}
|
|
1629
|
+
const tableData = context.messages.map((message) => {
|
|
1630
|
+
if (message.isTextMessage()) {
|
|
1631
|
+
return {
|
|
1632
|
+
id: message.id,
|
|
1633
|
+
type: "TextMessage",
|
|
1634
|
+
role: message.role,
|
|
1635
|
+
name: void 0,
|
|
1636
|
+
scope: void 0,
|
|
1637
|
+
content: message.content
|
|
1638
|
+
};
|
|
1639
|
+
} else if (message.isActionExecutionMessage()) {
|
|
1640
|
+
return {
|
|
1641
|
+
id: message.id,
|
|
1642
|
+
type: "ActionExecutionMessage",
|
|
1643
|
+
role: void 0,
|
|
1644
|
+
name: message.name,
|
|
1645
|
+
scope: message.parentMessageId,
|
|
1646
|
+
content: message.arguments
|
|
1647
|
+
};
|
|
1648
|
+
} else if (message.isResultMessage()) {
|
|
1649
|
+
return {
|
|
1650
|
+
id: message.id,
|
|
1651
|
+
type: "ResultMessage",
|
|
1652
|
+
role: void 0,
|
|
1653
|
+
name: message.actionName,
|
|
1654
|
+
scope: message.actionExecutionId,
|
|
1655
|
+
content: message.result
|
|
1656
|
+
};
|
|
1657
|
+
} else if (message.isAgentStateMessage()) {
|
|
1658
|
+
return {
|
|
1659
|
+
id: message.id,
|
|
1660
|
+
type: `AgentStateMessage (running: ${message.running})`,
|
|
1661
|
+
role: message.role,
|
|
1662
|
+
name: void 0,
|
|
1663
|
+
scope: message.threadId,
|
|
1664
|
+
content: message.state
|
|
1665
|
+
};
|
|
1666
|
+
}
|
|
1667
|
+
});
|
|
1668
|
+
console.table(tableData);
|
|
1669
|
+
}
|
|
1670
|
+
|
|
1671
|
+
// src/components/dev-console/console.tsx
|
|
1672
|
+
var import_react_core7 = require("@copilotkit/react-core");
|
|
1673
|
+
var import_react9 = require("react");
|
|
1674
|
+
|
|
1675
|
+
// src/components/dev-console/icons.tsx
|
|
1676
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1677
|
+
var ExclamationMarkTriangleIcon = /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1678
|
+
"svg",
|
|
1679
|
+
{
|
|
1680
|
+
width: "13.3967723px",
|
|
1681
|
+
height: "12px",
|
|
1682
|
+
viewBox: "0 0 13.3967723 12",
|
|
1683
|
+
version: "1.1",
|
|
1684
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1685
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("g", { id: "Page-1", stroke: "none", strokeWidth: "1", fill: "none", fillRule: "evenodd", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("g", { id: "exclamation-triangle", fill: "#CD2121", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1686
|
+
"path",
|
|
1687
|
+
{
|
|
1688
|
+
d: "M5.39935802,0.75 C5.97670802,-0.25 7.42007802,-0.25 7.99742802,0.75 L13.193588,9.75 C13.770888,10.75 13.049288,12 11.894588,12 L1.50223802,12 C0.34753802,12 -0.37414898,10.75 0.20319802,9.75 L5.39935802,0.75 Z M6.69838802,2.5 C7.11260802,2.5 7.44838802,2.83579 7.44838802,3.25 L7.44838802,6.25 C7.44838802,6.66421 7.11260802,7 6.69838802,7 C6.28417802,7 5.94838802,6.66421 5.94838802,6.25 L5.94838802,3.25 C5.94838802,2.83579 6.28417802,2.5 6.69838802,2.5 Z M6.69838802,10.5 C7.25067802,10.5 7.69838802,10.0523 7.69838802,9.5 C7.69838802,8.9477 7.25067802,8.5 6.69838802,8.5 C6.14610802,8.5 5.69838802,8.9477 5.69838802,9.5 C5.69838802,10.0523 6.14610802,10.5 6.69838802,10.5 Z",
|
|
1689
|
+
id: "Shape"
|
|
1690
|
+
}
|
|
1691
|
+
) }) })
|
|
1692
|
+
}
|
|
1693
|
+
);
|
|
1694
|
+
var ExclamationMarkIcon = /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1695
|
+
"svg",
|
|
1696
|
+
{
|
|
1697
|
+
width: "14px",
|
|
1698
|
+
height: "14px",
|
|
1699
|
+
viewBox: "0 0 14 14",
|
|
1700
|
+
version: "1.1",
|
|
1701
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1702
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("g", { id: "Page-1", stroke: "none", strokeWidth: "1", fill: "none", fillRule: "evenodd", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("g", { id: "exclamation-circle", fill: "#EC662C", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1703
|
+
"path",
|
|
1704
|
+
{
|
|
1705
|
+
d: "M7,14 C10.866,14 14,10.866 14,7 C14,3.13401 10.866,0 7,0 C3.13401,0 0,3.13401 0,7 C0,10.866 3.13401,14 7,14 Z M7,3 C7.41421,3 7.75,3.33579 7.75,3.75 L7.75,6.75 C7.75,7.16421 7.41421,7.5 7,7.5 C6.58579,7.5 6.25,7.16421 6.25,6.75 L6.25,3.75 C6.25,3.33579 6.58579,3 7,3 Z M7,11 C7.55228,11 8,10.5523 8,10 C8,9.4477 7.55228,9 7,9 C6.44772,9 6,9.4477 6,10 C6,10.5523 6.44772,11 7,11 Z",
|
|
1706
|
+
id: "Shape"
|
|
1707
|
+
}
|
|
1708
|
+
) }) })
|
|
1709
|
+
}
|
|
1710
|
+
);
|
|
1711
|
+
var ChevronDownIcon = /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("svg", { width: "7px", height: "4px", viewBox: "0 0 7 4", version: "1.1", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("g", { id: "Page-1", stroke: "none", strokeWidth: "1", fill: "none", fillRule: "evenodd", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("g", { id: "Group", fill: "#000000", fillRule: "nonzero", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1712
|
+
"path",
|
|
1713
|
+
{
|
|
1714
|
+
d: "M3.71690723,3.90271086 C3.59268176,4.03242971 3.39143629,4.03242971 3.26721082,3.90271086 L0.0853966595,0.57605615 C-0.0314221035,0.444981627 -0.0279751448,0.240725043 0.0931934622,0.114040675 C0.214362069,-0.0126436935 0.409725445,-0.0162475626 0.535093061,0.105888951 L3.49205902,3.19746006 L6.44902499,0.105888951 C6.52834574,0.0168884389 6.64780588,-0.0197473458 6.7605411,0.0103538404 C6.87327633,0.0404550266 6.96130636,0.132492308 6.99009696,0.250359396 C7.01888756,0.368226483 6.98384687,0.493124608 6.89872139,0.57605615 L3.71690723,3.90271086 Z",
|
|
1715
|
+
id: "Path"
|
|
1716
|
+
}
|
|
1717
|
+
) }) }) });
|
|
1718
|
+
var CheckIcon2 = /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1719
|
+
"svg",
|
|
1720
|
+
{
|
|
1721
|
+
width: "14px",
|
|
1722
|
+
height: "14px",
|
|
1723
|
+
viewBox: "0 0 14 14",
|
|
1724
|
+
version: "1.1",
|
|
1725
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1726
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("g", { id: "Page-1", stroke: "none", strokeWidth: "1", fill: "none", fillRule: "evenodd", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("g", { id: "Group-2", transform: "translate(-118, 0)", fill: "#1BC030", fillRule: "nonzero", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("g", { id: "Group", transform: "translate(118, 0)", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1727
|
+
"path",
|
|
1728
|
+
{
|
|
1729
|
+
d: "M0,7 C0,3.13384615 3.13384615,0 7,0 C10.8661538,0 14,3.13384615 14,7 C14,10.8661538 10.8661538,14 7,14 C3.13384615,14 0,10.8661538 0,7 Z M9.59179487,5.69764103 C9.70905818,5.54139023 9.73249341,5.33388318 9.65303227,5.15541491 C9.57357113,4.97694665 9.40367989,4.85551619 9.20909814,4.83811118 C9.01451638,4.82070616 8.82577109,4.91005717 8.71589744,5.07158974 L6.39261538,8.32389744 L5.22666667,7.15794872 C5.01450582,6.96025518 4.68389046,6.9660885 4.47883563,7.17114332 C4.27378081,7.37619815 4.26794748,7.70681351 4.46564103,7.91897436 L6.08102564,9.53435897 C6.19289944,9.64614839 6.3482622,9.70310251 6.50588106,9.69010587 C6.66349993,9.67710922 6.80743532,9.59547613 6.89948718,9.46687179 L9.59179487,5.69764103 L9.59179487,5.69764103 Z",
|
|
1730
|
+
id: "Shape"
|
|
1731
|
+
}
|
|
1732
|
+
) }) }) })
|
|
1733
|
+
}
|
|
1734
|
+
);
|
|
1735
|
+
var CopilotKitIcon = /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
1736
|
+
"svg",
|
|
1737
|
+
{
|
|
1738
|
+
width: "33px",
|
|
1739
|
+
height: "35px",
|
|
1740
|
+
viewBox: "0 0 33 35",
|
|
1741
|
+
version: "1.1",
|
|
1742
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1743
|
+
children: [
|
|
1744
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("title", { children: "bd5c9079-929b-4d55-bdc9-16d1c8181b71" }),
|
|
1745
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("g", { id: "Page-1", stroke: "none", strokeWidth: "1", fill: "none", fillRule: "evenodd", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1746
|
+
"image",
|
|
1747
|
+
{
|
|
1748
|
+
x: "0",
|
|
1749
|
+
y: "0",
|
|
1750
|
+
width: "33",
|
|
1751
|
+
height: "35",
|
|
1752
|
+
xlinkHref: "data:image/png;base64,i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rti2jNb7Bg/TU33VxgevsJs/PDNOFhb6zPyKC6WGOmy82MX9L4GrMAXCbLXnw4+10L06yJqu7XbaSPbZmPB1oIm6pPl0Q1oUrp0EnAjpfxXAXApgJp6Zlmgotae3xUa2vQau8nc0AtsumIPZnfGC/7IqK+iK5TtQyo3YpS/TScsRW9opg5YYlO5fYKX0ByjzgwBEanUSOTEui2MDjf0vlrLr7VvvmRUBcac7mLNeBxqNlADJmTzlPwMYzXlcgv8yttBufdaeXBynhsIt8OEK3qupVyOcpnr9Dhruh1EOKnjztT2Ds1ja+q0yPm5fOp2uCwD1MKzesLnTyv6plHUuwDiH8FAu0CIoC6SFvZH837ar3ill4+5BV6/4ecfOLeBAw/HyryLiMwDmFdg3Min5aTS+Tz9zvXNps+H/s18fwQ7FcwDOayDosXAHWLIH54l0Nlrn4oRkLR1g9BX4t8I81iAbPW5VvgE5NbyMyf8zzKsySnL5NXMspd0w9v3cIvM+CMSr39s3G7d7MJbhwWUWIrt8hYeXAu9ndFGfZ2j9C8Lizv/Zb5ce5qEm7j2cibbT6cN/i+7qOMAxDzejA38hdiu6CKYDYBLVWolRQh9bMzZYOcdHtQqHErYEQHEmqgMWk3TeFgDzU5jKf9v3znv02X+guVVjEsFXH+A6kcdaD1Aub29v//VzChi1b49X4vdRhLr11vsHN1pz7Qj8bDKrLULpdyJzKocw1OwCKBm2zYKPCh1PiQ87sujILdnw1gKQrQiMDNmTj5nP0P2F714fHlStCp43M2kBT2t9EXjfBlBydEu37Pfn+J7/zXkIt50IxO3oK1rgKgEaU5YYAJhaUOCLawjufOW8i0Pnlm1/bo/7mAll9uO8/x9teQya14m6TgAAAABJRU5ErkJggg=="
|
|
1753
|
+
}
|
|
1754
|
+
) })
|
|
1755
|
+
]
|
|
1756
|
+
}
|
|
1757
|
+
);
|
|
1758
|
+
|
|
1759
|
+
// src/components/dev-console/console.tsx
|
|
1760
|
+
var import_react10 = require("@headlessui/react");
|
|
1761
|
+
var import_shared2 = require("@copilotkit/shared");
|
|
1762
|
+
|
|
1763
|
+
// src/components/help-modal/modal.tsx
|
|
1764
|
+
var import_react8 = require("react");
|
|
1765
|
+
|
|
1766
|
+
// src/components/help-modal/icons.tsx
|
|
1767
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
1768
|
+
var CloseIcon2 = () => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1769
|
+
"svg",
|
|
1770
|
+
{
|
|
1771
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1772
|
+
fill: "none",
|
|
1773
|
+
viewBox: "0 0 24 24",
|
|
1774
|
+
strokeWidth: "1.5",
|
|
1775
|
+
stroke: "currentColor",
|
|
1776
|
+
width: "20",
|
|
1777
|
+
height: "20",
|
|
1778
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" })
|
|
1779
|
+
}
|
|
1780
|
+
);
|
|
1781
|
+
var LoadingSpinnerIcon = ({ color = "rgb(107 114 128)" }) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
1782
|
+
"svg",
|
|
1783
|
+
{
|
|
1784
|
+
style: {
|
|
1785
|
+
animation: "copilotKitSpinAnimation 1s linear infinite",
|
|
1786
|
+
color
|
|
1787
|
+
},
|
|
1788
|
+
width: "24",
|
|
1789
|
+
height: "24",
|
|
1790
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1791
|
+
fill: "none",
|
|
1792
|
+
viewBox: "0 0 24 24",
|
|
1793
|
+
children: [
|
|
1794
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1795
|
+
"circle",
|
|
1796
|
+
{
|
|
1797
|
+
style: { opacity: 0.25 },
|
|
1798
|
+
cx: "12",
|
|
1799
|
+
cy: "12",
|
|
1800
|
+
r: "10",
|
|
1801
|
+
stroke: "currentColor",
|
|
1802
|
+
strokeWidth: "4"
|
|
1803
|
+
}
|
|
1804
|
+
),
|
|
1805
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1806
|
+
"path",
|
|
1807
|
+
{
|
|
1808
|
+
style: { opacity: 0.75 },
|
|
1809
|
+
fill: "currentColor",
|
|
1810
|
+
d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
|
|
1811
|
+
}
|
|
1812
|
+
)
|
|
1813
|
+
]
|
|
1814
|
+
}
|
|
1815
|
+
);
|
|
1816
|
+
|
|
1817
|
+
// src/components/help-modal/modal.tsx
|
|
1818
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
1819
|
+
function CopilotKitHelpModal() {
|
|
1820
|
+
const [showHelpModal, setShowHelpModal] = (0, import_react8.useState)(false);
|
|
1821
|
+
const [issueDescription, setIssueDescription] = (0, import_react8.useState)("");
|
|
1822
|
+
const [email, setEmail] = (0, import_react8.useState)("");
|
|
1823
|
+
const [emailError, setEmailError] = (0, import_react8.useState)("");
|
|
1824
|
+
const [submitting, setSubmitting] = (0, import_react8.useState)(false);
|
|
1825
|
+
const validateEmail = (email2) => {
|
|
1826
|
+
const re = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;
|
|
1827
|
+
return re.test(email2);
|
|
1828
|
+
};
|
|
1829
|
+
const handleSubmit = (e) => __async(this, null, function* () {
|
|
1830
|
+
e.preventDefault();
|
|
1831
|
+
if ((email == null ? void 0 : email.length) > 0 && !validateEmail(email)) {
|
|
1832
|
+
setEmailError("Please enter a valid email address");
|
|
1833
|
+
return;
|
|
1834
|
+
}
|
|
1835
|
+
setSubmitting(true);
|
|
1836
|
+
yield fetch("https://api.segment.io/v1/track", {
|
|
1837
|
+
method: "POST",
|
|
1838
|
+
headers: {
|
|
1839
|
+
"Content-Type": "application/json"
|
|
1840
|
+
},
|
|
1841
|
+
body: JSON.stringify({
|
|
1842
|
+
event: "oss.dev-console.help",
|
|
1843
|
+
anonymousId: window.crypto.randomUUID(),
|
|
1844
|
+
properties: { email, text: issueDescription },
|
|
1845
|
+
writeKey: "q0gQqvGYyw9pNyhIocNzefSYKGO1aiwW"
|
|
1846
|
+
})
|
|
1847
|
+
});
|
|
1848
|
+
setEmailError("");
|
|
1849
|
+
setEmail("");
|
|
1850
|
+
setIssueDescription("");
|
|
1851
|
+
setSubmitting(false);
|
|
1852
|
+
setShowHelpModal(false);
|
|
1853
|
+
});
|
|
1854
|
+
const HelpButton = () => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1855
|
+
"button",
|
|
1856
|
+
{
|
|
1857
|
+
onClick: () => setShowHelpModal(true),
|
|
1858
|
+
style: { width: "50px", height: "30px", marginRight: "0.25rem" },
|
|
1859
|
+
className: "text-sm p-0 bg-transparent rounded border border-blue-500",
|
|
1860
|
+
"aria-label": "Open Help",
|
|
1861
|
+
children: "Help"
|
|
1862
|
+
}
|
|
1863
|
+
);
|
|
1864
|
+
const submitButtonDisabled = (0, import_react8.useMemo)(
|
|
1865
|
+
() => submitting || !!emailError || issueDescription == null || (issueDescription == null ? void 0 : issueDescription.length) == 0,
|
|
1866
|
+
[submitting, emailError, issueDescription]
|
|
1867
|
+
);
|
|
1868
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
|
|
1869
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(HelpButton, {}),
|
|
1870
|
+
showHelpModal && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1871
|
+
"div",
|
|
1872
|
+
{
|
|
1873
|
+
className: "fixed inset-0 flex items-center justify-center p-4",
|
|
1874
|
+
style: { backgroundColor: "rgba(11, 15, 26, 0.5)", zIndex: 99 },
|
|
1875
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "bg-white rounded-lg shadow-xl max-w-md w-full p-4 flex-col relative", children: [
|
|
1876
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1877
|
+
"button",
|
|
1878
|
+
{
|
|
1879
|
+
className: "absolute text-gray-400 hover:text-gray-600 focus:outline-none",
|
|
1880
|
+
style: { top: "10px", right: "10px" },
|
|
1881
|
+
onClick: () => setShowHelpModal(false),
|
|
1882
|
+
"aria-label": "Close",
|
|
1883
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(CloseIcon2, {})
|
|
1884
|
+
}
|
|
1885
|
+
),
|
|
1886
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "w-full flex mb-6 justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("h2", { className: "text-2xl font-bold", children: "Help Options" }) }),
|
|
1887
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "space-y-4 mb-4", children: [
|
|
1888
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "block w-full text-center py-2 px-4 bg-blue-500 text-white rounded hover:bg-blue-600 transition duration-150 text-sm", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1889
|
+
"a",
|
|
1890
|
+
{
|
|
1891
|
+
href: "https://docs.copilotkit.ai/coagents/troubleshooting/common-issues",
|
|
1892
|
+
target: "_blank",
|
|
1893
|
+
rel: "noopener noreferrer",
|
|
1894
|
+
children: "Visit the Troubleshooting and FAQ section in the docs"
|
|
1895
|
+
}
|
|
1896
|
+
) }),
|
|
1897
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "block w-full text-center py-2 px-4 bg-blue-500 text-white rounded hover:bg-blue-600 transition duration-150 text-sm", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1898
|
+
"a",
|
|
1899
|
+
{
|
|
1900
|
+
href: "https://go.copilotkit.ai/dev-console-support-discord",
|
|
1901
|
+
target: "_blank",
|
|
1902
|
+
rel: "noopener noreferrer",
|
|
1903
|
+
children: "Go to Discord Support Channel (Community Support)"
|
|
1904
|
+
}
|
|
1905
|
+
) }),
|
|
1906
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "block w-full text-center py-2 px-4 bg-blue-500 text-white rounded hover:bg-blue-600 transition duration-150 text-sm", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1907
|
+
"a",
|
|
1908
|
+
{
|
|
1909
|
+
href: "https://go.copilotkit.ai/dev-console-support-slack",
|
|
1910
|
+
target: "_blank",
|
|
1911
|
+
rel: "noopener noreferrer",
|
|
1912
|
+
children: "Apply for Priority Direct Slack Support"
|
|
1913
|
+
}
|
|
1914
|
+
) })
|
|
1915
|
+
] }),
|
|
1916
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("form", { onSubmit: handleSubmit, className: "flex flex-col space-y-2", children: [
|
|
1917
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { children: [
|
|
1918
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("label", { htmlFor: "feedback", className: "block text-sm font-medium text-gray-700 mb-1", children: "Let us know what your issue is:" }),
|
|
1919
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1920
|
+
"textarea",
|
|
1921
|
+
{
|
|
1922
|
+
id: "feedback",
|
|
1923
|
+
rows: 4,
|
|
1924
|
+
className: "w-full px-3 py-2 text-gray-700 border rounded-lg focus:outline-none focus:border-blue-500",
|
|
1925
|
+
placeholder: "A Loom link / screen recording is always great!",
|
|
1926
|
+
onChange: (e) => setIssueDescription(e.target.value),
|
|
1927
|
+
value: issueDescription,
|
|
1928
|
+
required: true
|
|
1929
|
+
}
|
|
1930
|
+
)
|
|
1931
|
+
] }),
|
|
1932
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { children: [
|
|
1933
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("label", { htmlFor: "email", className: "block text-sm font-medium text-gray-700 mb-1", children: "Email (optional):" }),
|
|
1934
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1935
|
+
"input",
|
|
1936
|
+
{
|
|
1937
|
+
type: "email",
|
|
1938
|
+
id: "email",
|
|
1939
|
+
className: `w-full px-3 py-2 text-gray-700 border rounded-lg focus:outline-none focus:border-blue-500 ${emailError ? "border-red-500" : ""}`,
|
|
1940
|
+
placeholder: "Enter your email for follow-up",
|
|
1941
|
+
onChange: (e) => {
|
|
1942
|
+
setEmail(e.target.value);
|
|
1943
|
+
setEmailError("");
|
|
1944
|
+
},
|
|
1945
|
+
value: email
|
|
1946
|
+
}
|
|
1947
|
+
),
|
|
1948
|
+
emailError && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "text-red-500 text-sm mt-1", children: emailError })
|
|
1949
|
+
] }),
|
|
1950
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "bg-gray-50 px-4 py-4 sm:px-6 sm:flex sm:flex-row-reverse rounded-b-lg", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1951
|
+
"button",
|
|
1952
|
+
{
|
|
1953
|
+
type: "submit",
|
|
1954
|
+
onClick: handleSubmit,
|
|
1955
|
+
disabled: submitButtonDisabled,
|
|
1956
|
+
style: submitButtonDisabled ? { backgroundColor: "rgb(216, 216, 216)", color: "rgb(129, 129, 129)" } : void 0,
|
|
1957
|
+
className: "w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-blue-500 text-base font-medium text-white hover:bg-blue-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 sm:ml-3 sm:w-auto sm:text-sm disabled:shadow-none",
|
|
1958
|
+
children: submitting ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(LoadingSpinnerIcon, { color: "white" }) : "Submit"
|
|
1959
|
+
}
|
|
1960
|
+
) })
|
|
1961
|
+
] })
|
|
1962
|
+
] })
|
|
1963
|
+
}
|
|
1964
|
+
)
|
|
1965
|
+
] });
|
|
1966
|
+
}
|
|
1967
|
+
|
|
1968
|
+
// src/components/dev-console/console.tsx
|
|
1969
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
1970
|
+
function CopilotDevConsole() {
|
|
1971
|
+
const currentVersion = import_shared2.COPILOTKIT_VERSION;
|
|
1972
|
+
const context = (0, import_react_core7.useCopilotContext)();
|
|
1973
|
+
const [showDevConsole, setShowDevConsole] = (0, import_react9.useState)(false);
|
|
1974
|
+
(0, import_react9.useEffect)(() => {
|
|
1975
|
+
setShowDevConsole(shouldShowDevConsole(context.showDevConsole));
|
|
1976
|
+
}, [context.showDevConsole]);
|
|
1977
|
+
const dontRunTwiceInDevMode = (0, import_react9.useRef)(false);
|
|
1978
|
+
const [versionStatus, setVersionStatus] = (0, import_react9.useState)("unknown");
|
|
1979
|
+
const [latestVersion, setLatestVersion] = (0, import_react9.useState)("");
|
|
1980
|
+
const consoleRef = (0, import_react9.useRef)(null);
|
|
1981
|
+
const [debugButtonMode, setDebugButtonMode] = (0, import_react9.useState)("full");
|
|
1982
|
+
const checkForUpdates = (force = false) => {
|
|
1983
|
+
setVersionStatus("checking");
|
|
1984
|
+
getPublishedCopilotKitVersion(currentVersion, force).then((v) => {
|
|
1985
|
+
setLatestVersion(v.latest);
|
|
1986
|
+
let versionOk = false;
|
|
1987
|
+
if (v.current === v.latest) {
|
|
1988
|
+
versionOk = true;
|
|
1989
|
+
} else if (/[a-zA-Z]/.test(v.current)) {
|
|
1990
|
+
versionOk = true;
|
|
1991
|
+
}
|
|
1992
|
+
if (versionOk) {
|
|
1993
|
+
setVersionStatus("latest");
|
|
1994
|
+
} else if (v.severity !== "low") {
|
|
1995
|
+
setVersionStatus("outdated");
|
|
1996
|
+
} else {
|
|
1997
|
+
setVersionStatus("update-available");
|
|
1998
|
+
}
|
|
1999
|
+
}).catch((e) => {
|
|
2000
|
+
console.error(e);
|
|
2001
|
+
setVersionStatus("unknown");
|
|
2002
|
+
});
|
|
2003
|
+
};
|
|
2004
|
+
(0, import_react9.useEffect)(() => {
|
|
2005
|
+
if (dontRunTwiceInDevMode.current === true) {
|
|
2006
|
+
return;
|
|
2007
|
+
}
|
|
2008
|
+
dontRunTwiceInDevMode.current = true;
|
|
2009
|
+
checkForUpdates();
|
|
2010
|
+
}, []);
|
|
2011
|
+
(0, import_react9.useEffect)(() => {
|
|
2012
|
+
const handleResize = (entries) => {
|
|
2013
|
+
for (let entry of entries) {
|
|
2014
|
+
if (entry.target === consoleRef.current) {
|
|
2015
|
+
const width = entry.contentRect.width;
|
|
2016
|
+
if (width < 400) {
|
|
2017
|
+
setDebugButtonMode("compact");
|
|
2018
|
+
} else {
|
|
2019
|
+
setDebugButtonMode("full");
|
|
2020
|
+
}
|
|
2021
|
+
}
|
|
2022
|
+
}
|
|
2023
|
+
};
|
|
2024
|
+
const observer = new ResizeObserver(handleResize);
|
|
2025
|
+
if (consoleRef.current) {
|
|
2026
|
+
observer.observe(consoleRef.current);
|
|
2027
|
+
const initialWidth = consoleRef.current.getBoundingClientRect().width;
|
|
2028
|
+
if (initialWidth < 400) {
|
|
2029
|
+
setDebugButtonMode("compact");
|
|
2030
|
+
} else {
|
|
2031
|
+
setDebugButtonMode("full");
|
|
2032
|
+
}
|
|
2033
|
+
}
|
|
2034
|
+
return () => {
|
|
2035
|
+
if (consoleRef.current) {
|
|
2036
|
+
observer.unobserve(consoleRef.current);
|
|
2037
|
+
}
|
|
2038
|
+
};
|
|
2039
|
+
}, [consoleRef.current]);
|
|
2040
|
+
if (!showDevConsole) {
|
|
2041
|
+
return null;
|
|
2042
|
+
}
|
|
2043
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
2044
|
+
"div",
|
|
2045
|
+
{
|
|
2046
|
+
ref: consoleRef,
|
|
2047
|
+
className: "copilotKitDevConsole " + (versionStatus === "update-available" ? "copilotKitDevConsoleUpgrade" : "") + (versionStatus === "outdated" ? "copilotKitDevConsoleWarnOutdated" : ""),
|
|
2048
|
+
children: [
|
|
2049
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "copilotKitDevConsoleLogo", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("a", { href: "https://copilotkit.ai", target: "_blank", children: CopilotKitIcon }) }),
|
|
2050
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
2051
|
+
VersionInfo,
|
|
2052
|
+
{
|
|
2053
|
+
showDevConsole: context.showDevConsole,
|
|
2054
|
+
versionStatus,
|
|
2055
|
+
currentVersion,
|
|
2056
|
+
latestVersion
|
|
2057
|
+
}
|
|
2058
|
+
),
|
|
2059
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(CopilotKitHelpModal, {}),
|
|
2060
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
2061
|
+
DebugMenuButton,
|
|
2062
|
+
{
|
|
2063
|
+
setShowDevConsole,
|
|
2064
|
+
checkForUpdates,
|
|
2065
|
+
mode: debugButtonMode
|
|
2066
|
+
}
|
|
2067
|
+
)
|
|
2068
|
+
]
|
|
2069
|
+
}
|
|
2070
|
+
);
|
|
2071
|
+
}
|
|
2072
|
+
function VersionInfo({
|
|
2073
|
+
showDevConsole,
|
|
2074
|
+
versionStatus,
|
|
2075
|
+
currentVersion,
|
|
2076
|
+
latestVersion
|
|
2077
|
+
}) {
|
|
2078
|
+
const [copyStatus, setCopyStatus] = (0, import_react9.useState)("");
|
|
2079
|
+
let versionLabel = "";
|
|
2080
|
+
let versionIcon = "";
|
|
2081
|
+
let currentVersionLabel = currentVersion;
|
|
2082
|
+
if (versionStatus === "latest") {
|
|
2083
|
+
versionLabel = "latest";
|
|
2084
|
+
versionIcon = CheckIcon2;
|
|
2085
|
+
} else if (versionStatus === "checking") {
|
|
2086
|
+
versionLabel = "checking";
|
|
2087
|
+
versionIcon = SmallSpinnerIcon;
|
|
2088
|
+
} else if (versionStatus === "update-available") {
|
|
2089
|
+
versionLabel = "update available";
|
|
2090
|
+
versionIcon = ExclamationMarkIcon;
|
|
2091
|
+
currentVersionLabel = `${currentVersion} \u2192 ${latestVersion}`;
|
|
2092
|
+
} else if (versionStatus === "outdated") {
|
|
2093
|
+
versionLabel = "outdated";
|
|
2094
|
+
versionIcon = ExclamationMarkTriangleIcon;
|
|
2095
|
+
currentVersionLabel = `${currentVersion} \u2192 ${latestVersion}`;
|
|
2096
|
+
}
|
|
2097
|
+
let asideLabel = "";
|
|
2098
|
+
if (showDevConsole === "auto") {
|
|
2099
|
+
asideLabel = "(localhost only)";
|
|
2100
|
+
} else if (showDevConsole === true) {
|
|
2101
|
+
asideLabel = "(always on)";
|
|
2102
|
+
}
|
|
2103
|
+
const installCommand = [
|
|
2104
|
+
`npm install`,
|
|
2105
|
+
`@copilotkit/react-core@${latestVersion}`,
|
|
2106
|
+
`@copilotkit/react-ui@${latestVersion}`,
|
|
2107
|
+
`@copilotkit/react-textarea@${latestVersion}`
|
|
2108
|
+
].join(" ");
|
|
2109
|
+
const handleCopyClick = () => {
|
|
2110
|
+
navigator.clipboard.writeText(installCommand.trim()).then(() => {
|
|
2111
|
+
setCopyStatus("Command copied to clipboard!");
|
|
2112
|
+
setTimeout(() => setCopyStatus(""), 1e3);
|
|
2113
|
+
});
|
|
2114
|
+
};
|
|
2115
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "copilotKitVersionInfo", children: [
|
|
2116
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("header", { children: [
|
|
2117
|
+
"COPILOTKIT DEV CONSOLE",
|
|
2118
|
+
showDevConsole === "auto" && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("aside", { children: asideLabel })
|
|
2119
|
+
] }),
|
|
2120
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("section", { children: [
|
|
2121
|
+
"Version: ",
|
|
2122
|
+
versionLabel,
|
|
2123
|
+
" (",
|
|
2124
|
+
currentVersionLabel,
|
|
2125
|
+
") ",
|
|
2126
|
+
versionIcon
|
|
2127
|
+
] }),
|
|
2128
|
+
(versionStatus === "update-available" || versionStatus === "outdated") && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("footer", { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("button", { onClick: handleCopyClick, children: copyStatus || installCommand }) })
|
|
2129
|
+
] });
|
|
2130
|
+
}
|
|
2131
|
+
function DebugMenuButton({
|
|
2132
|
+
setShowDevConsole,
|
|
2133
|
+
checkForUpdates,
|
|
2134
|
+
mode
|
|
2135
|
+
}) {
|
|
2136
|
+
const context = (0, import_react_core7.useCopilotContext)();
|
|
2137
|
+
const messagesContext = (0, import_react_core7.useCopilotMessagesContext)();
|
|
2138
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "bg-black top-24 w-52 text-right", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_react10.Menu, { children: [
|
|
2139
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react10.MenuButton, { className: `copilotKitDebugMenuButton ${mode === "compact" ? "compact" : ""}`, children: mode == "compact" ? "Debug" : /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
|
|
2140
|
+
"Debug ",
|
|
2141
|
+
ChevronDownIcon
|
|
2142
|
+
] }) }),
|
|
2143
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
2144
|
+
import_react10.MenuItems,
|
|
2145
|
+
{
|
|
2146
|
+
transition: true,
|
|
2147
|
+
anchor: "bottom end",
|
|
2148
|
+
className: "copilotKitDebugMenu",
|
|
2149
|
+
style: { zIndex: 40 },
|
|
2150
|
+
children: [
|
|
2151
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react10.MenuItem, { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("button", { className: "copilotKitDebugMenuItem", onClick: () => logReadables(context), children: "Log Readables" }) }),
|
|
2152
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react10.MenuItem, { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("button", { className: "copilotKitDebugMenuItem", onClick: () => logActions(context), children: "Log Actions" }) }),
|
|
2153
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react10.MenuItem, { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
2154
|
+
"button",
|
|
2155
|
+
{
|
|
2156
|
+
className: "copilotKitDebugMenuItem",
|
|
2157
|
+
onClick: () => logMessages(messagesContext),
|
|
2158
|
+
children: "Log Messages"
|
|
2159
|
+
}
|
|
2160
|
+
) }),
|
|
2161
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react10.MenuItem, { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("button", { className: "copilotKitDebugMenuItem", onClick: () => checkForUpdates(true), children: "Check for Updates" }) }),
|
|
2162
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("hr", {}),
|
|
2163
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react10.MenuItem, { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("button", { className: "copilotKitDebugMenuItem", onClick: () => setShowDevConsole(false), children: "Hide Dev Console" }) })
|
|
2164
|
+
]
|
|
2165
|
+
}
|
|
2166
|
+
)
|
|
2167
|
+
] }) });
|
|
2168
|
+
}
|
|
2169
|
+
|
|
2170
|
+
// src/components/chat/Chat.tsx
|
|
2171
|
+
var import_react_core9 = require("@copilotkit/react-core");
|
|
2172
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
2173
|
+
function CopilotChat({
|
|
2174
|
+
instructions,
|
|
2175
|
+
onSubmitMessage,
|
|
2176
|
+
makeSystemMessage,
|
|
2177
|
+
showResponseButton = true,
|
|
2178
|
+
onInProgress,
|
|
2179
|
+
onStopGeneration,
|
|
2180
|
+
onReloadMessages,
|
|
2181
|
+
Messages: Messages2 = Messages,
|
|
2182
|
+
RenderTextMessage: RenderTextMessage2 = RenderTextMessage,
|
|
2183
|
+
RenderActionExecutionMessage: RenderActionExecutionMessage2 = RenderActionExecutionMessage,
|
|
2184
|
+
RenderAgentStateMessage: RenderAgentStateMessage2 = RenderAgentStateMessage,
|
|
2185
|
+
RenderResultMessage: RenderResultMessage2 = RenderResultMessage,
|
|
2186
|
+
Input: Input2 = Input,
|
|
2187
|
+
ResponseButton: ResponseButton2 = ResponseButton,
|
|
2188
|
+
className,
|
|
2189
|
+
icons,
|
|
2190
|
+
labels
|
|
2191
|
+
}) {
|
|
2192
|
+
const context = (0, import_react_core8.useCopilotContext)();
|
|
2193
|
+
(0, import_react11.useEffect)(() => {
|
|
2194
|
+
context.setChatInstructions(instructions || "");
|
|
2195
|
+
}, [instructions]);
|
|
2196
|
+
const {
|
|
2197
|
+
visibleMessages,
|
|
2198
|
+
isLoading,
|
|
2199
|
+
currentSuggestions,
|
|
2200
|
+
sendMessage,
|
|
2201
|
+
stopGeneration,
|
|
2202
|
+
reloadMessages
|
|
2203
|
+
} = useCopilotChatLogic(
|
|
2204
|
+
makeSystemMessage,
|
|
2205
|
+
onInProgress,
|
|
2206
|
+
onSubmitMessage,
|
|
2207
|
+
onStopGeneration,
|
|
2208
|
+
onReloadMessages
|
|
2209
|
+
);
|
|
2210
|
+
const chatContext = import_react11.default.useContext(ChatContext);
|
|
2211
|
+
const isVisible = chatContext ? chatContext.open : true;
|
|
2212
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(WrappedCopilotChat, { icons, labels, className, children: [
|
|
2213
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(CopilotDevConsole, {}),
|
|
2214
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
2215
|
+
Messages2,
|
|
2216
|
+
{
|
|
2217
|
+
RenderTextMessage: RenderTextMessage2,
|
|
2218
|
+
RenderActionExecutionMessage: RenderActionExecutionMessage2,
|
|
2219
|
+
RenderAgentStateMessage: RenderAgentStateMessage2,
|
|
2220
|
+
RenderResultMessage: RenderResultMessage2,
|
|
2221
|
+
messages: visibleMessages,
|
|
2222
|
+
inProgress: isLoading,
|
|
2223
|
+
children: [
|
|
2224
|
+
currentSuggestions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { children: [
|
|
2225
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("h6", { children: "Suggested:" }),
|
|
2226
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "suggestions", children: currentSuggestions.map((suggestion, index) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2227
|
+
Suggestion,
|
|
2228
|
+
{
|
|
2229
|
+
title: suggestion.title,
|
|
2230
|
+
message: suggestion.message,
|
|
2231
|
+
partial: suggestion.partial,
|
|
2232
|
+
className: suggestion.className,
|
|
2233
|
+
onClick: (message) => sendMessage(message)
|
|
2234
|
+
},
|
|
2235
|
+
index
|
|
2236
|
+
)) })
|
|
2237
|
+
] }),
|
|
2238
|
+
showResponseButton && visibleMessages.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2239
|
+
ResponseButton2,
|
|
2240
|
+
{
|
|
2241
|
+
onClick: isLoading ? stopGeneration : reloadMessages,
|
|
2242
|
+
inProgress: isLoading
|
|
2243
|
+
}
|
|
2244
|
+
)
|
|
2245
|
+
]
|
|
2246
|
+
}
|
|
2247
|
+
),
|
|
2248
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Input2, { inProgress: isLoading, onSend: sendMessage, isVisible })
|
|
2249
|
+
] });
|
|
2250
|
+
}
|
|
2251
|
+
function WrappedCopilotChat({
|
|
2252
|
+
children,
|
|
2253
|
+
icons,
|
|
2254
|
+
labels,
|
|
2255
|
+
className
|
|
2256
|
+
}) {
|
|
2257
|
+
const chatContext = import_react11.default.useContext(ChatContext);
|
|
2258
|
+
if (!chatContext) {
|
|
2259
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ChatContextProvider, { icons, labels, open: true, setOpen: () => {
|
|
2260
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: `copilotKitChat ${className}`, children }) });
|
|
2261
|
+
}
|
|
2262
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_jsx_runtime18.Fragment, { children });
|
|
2263
|
+
}
|
|
2264
|
+
var SUGGESTIONS_DEBOUNCE_TIMEOUT = 1e3;
|
|
2265
|
+
var useCopilotChatLogic = (makeSystemMessage, onInProgress, onSubmitMessage, onStopGeneration, onReloadMessages) => {
|
|
2266
|
+
var _a;
|
|
2267
|
+
const {
|
|
2268
|
+
visibleMessages,
|
|
2269
|
+
appendMessage,
|
|
2270
|
+
reloadMessages: defaultReloadMessages,
|
|
2271
|
+
stopGeneration: defaultStopGeneration,
|
|
2272
|
+
runChatCompletion,
|
|
2273
|
+
isLoading
|
|
2274
|
+
} = (0, import_react_core8.useCopilotChat)({
|
|
2275
|
+
id: (0, import_shared3.randomId)(),
|
|
2276
|
+
makeSystemMessage
|
|
2277
|
+
});
|
|
2278
|
+
const [currentSuggestions, setCurrentSuggestions] = (0, import_react11.useState)([]);
|
|
2279
|
+
const suggestionsAbortControllerRef = (0, import_react11.useRef)(null);
|
|
2280
|
+
const debounceTimerRef = (0, import_react11.useRef)();
|
|
2281
|
+
const abortSuggestions = () => {
|
|
2282
|
+
var _a2;
|
|
2283
|
+
(_a2 = suggestionsAbortControllerRef.current) == null ? void 0 : _a2.abort();
|
|
2284
|
+
suggestionsAbortControllerRef.current = null;
|
|
2285
|
+
};
|
|
2286
|
+
const generalContext = (0, import_react_core8.useCopilotContext)();
|
|
2287
|
+
const messagesContext = (0, import_react_core8.useCopilotMessagesContext)();
|
|
2288
|
+
const context = __spreadValues(__spreadValues({}, generalContext), messagesContext);
|
|
2289
|
+
(0, import_react11.useEffect)(() => {
|
|
2290
|
+
onInProgress == null ? void 0 : onInProgress(isLoading);
|
|
2291
|
+
abortSuggestions();
|
|
2292
|
+
debounceTimerRef.current = setTimeout(
|
|
2293
|
+
() => {
|
|
2294
|
+
if (!isLoading && Object.keys(context.chatSuggestionConfiguration).length !== 0) {
|
|
2295
|
+
suggestionsAbortControllerRef.current = new AbortController();
|
|
2296
|
+
reloadSuggestions(
|
|
2297
|
+
context,
|
|
2298
|
+
context.chatSuggestionConfiguration,
|
|
2299
|
+
setCurrentSuggestions,
|
|
2300
|
+
suggestionsAbortControllerRef
|
|
2301
|
+
);
|
|
2302
|
+
}
|
|
2303
|
+
},
|
|
2304
|
+
currentSuggestions.length == 0 ? 0 : SUGGESTIONS_DEBOUNCE_TIMEOUT
|
|
2305
|
+
);
|
|
2306
|
+
return () => {
|
|
2307
|
+
clearTimeout(debounceTimerRef.current);
|
|
2308
|
+
};
|
|
2309
|
+
}, [
|
|
2310
|
+
isLoading,
|
|
2311
|
+
context.chatSuggestionConfiguration,
|
|
2312
|
+
// hackish way to trigger suggestions reload on reset, but better than moving suggestions to the
|
|
2313
|
+
// global context
|
|
2314
|
+
visibleMessages.length == 0
|
|
2315
|
+
]);
|
|
2316
|
+
const sendMessage = (messageContent) => __async(void 0, null, function* () {
|
|
2317
|
+
abortSuggestions();
|
|
2318
|
+
setCurrentSuggestions([]);
|
|
2319
|
+
const message = new import_runtime_client_gql4.TextMessage({
|
|
2320
|
+
content: messageContent,
|
|
2321
|
+
role: import_runtime_client_gql4.Role.User
|
|
2322
|
+
});
|
|
2323
|
+
if (onSubmitMessage) {
|
|
2324
|
+
try {
|
|
2325
|
+
yield onSubmitMessage(messageContent);
|
|
2326
|
+
} catch (error) {
|
|
2327
|
+
console.error("Error in onSubmitMessage:", error);
|
|
2328
|
+
}
|
|
2329
|
+
}
|
|
2330
|
+
appendMessage(message);
|
|
2331
|
+
return message;
|
|
2332
|
+
});
|
|
2333
|
+
const messages = visibleMessages;
|
|
2334
|
+
const { setMessages } = messagesContext;
|
|
2335
|
+
const currentAgentName = (_a = generalContext.agentSession) == null ? void 0 : _a.agentName;
|
|
2336
|
+
const restartCurrentAgent = (hint) => __async(void 0, null, function* () {
|
|
2337
|
+
if (generalContext.agentSession) {
|
|
2338
|
+
generalContext.setAgentSession(__spreadProps(__spreadValues({}, generalContext.agentSession), {
|
|
2339
|
+
nodeName: void 0,
|
|
2340
|
+
threadId: void 0
|
|
2341
|
+
}));
|
|
2342
|
+
generalContext.setCoagentStates((prevAgentStates) => {
|
|
2343
|
+
return __spreadProps(__spreadValues({}, prevAgentStates), {
|
|
2344
|
+
[generalContext.agentSession.agentName]: __spreadProps(__spreadValues({}, prevAgentStates[generalContext.agentSession.agentName]), {
|
|
2345
|
+
threadId: void 0,
|
|
2346
|
+
nodeName: void 0,
|
|
2347
|
+
runId: void 0
|
|
2348
|
+
})
|
|
2349
|
+
});
|
|
2350
|
+
});
|
|
2351
|
+
}
|
|
2352
|
+
});
|
|
2353
|
+
const runCurrentAgent = (hint) => __async(void 0, null, function* () {
|
|
2354
|
+
if (generalContext.agentSession) {
|
|
2355
|
+
yield (0, import_react_core9.runAgent)(
|
|
2356
|
+
generalContext.agentSession.agentName,
|
|
2357
|
+
context,
|
|
2358
|
+
appendMessage,
|
|
2359
|
+
runChatCompletion,
|
|
2360
|
+
hint
|
|
2361
|
+
);
|
|
2362
|
+
}
|
|
2363
|
+
});
|
|
2364
|
+
const stopCurrentAgent = () => {
|
|
2365
|
+
if (generalContext.agentSession) {
|
|
2366
|
+
(0, import_react_core9.stopAgent)(generalContext.agentSession.agentName, context);
|
|
2367
|
+
}
|
|
2368
|
+
};
|
|
2369
|
+
const setCurrentAgentState = (state) => {
|
|
2370
|
+
if (generalContext.agentSession) {
|
|
2371
|
+
generalContext.setCoagentStates((prevAgentStates) => {
|
|
2372
|
+
return __spreadProps(__spreadValues({}, prevAgentStates), {
|
|
2373
|
+
[generalContext.agentSession.agentName]: {
|
|
2374
|
+
state
|
|
2375
|
+
}
|
|
2376
|
+
});
|
|
2377
|
+
});
|
|
2378
|
+
}
|
|
2379
|
+
};
|
|
2380
|
+
function stopGeneration() {
|
|
2381
|
+
if (onStopGeneration) {
|
|
2382
|
+
onStopGeneration({
|
|
2383
|
+
messages,
|
|
2384
|
+
setMessages,
|
|
2385
|
+
stopGeneration: defaultStopGeneration,
|
|
2386
|
+
currentAgentName,
|
|
2387
|
+
restartCurrentAgent,
|
|
2388
|
+
stopCurrentAgent,
|
|
2389
|
+
runCurrentAgent,
|
|
2390
|
+
setCurrentAgentState
|
|
2391
|
+
});
|
|
2392
|
+
} else {
|
|
2393
|
+
defaultStopGeneration();
|
|
2394
|
+
}
|
|
2395
|
+
}
|
|
2396
|
+
function reloadMessages() {
|
|
2397
|
+
if (onReloadMessages) {
|
|
2398
|
+
onReloadMessages({
|
|
2399
|
+
messages,
|
|
2400
|
+
setMessages,
|
|
2401
|
+
stopGeneration: defaultStopGeneration,
|
|
2402
|
+
currentAgentName,
|
|
2403
|
+
restartCurrentAgent,
|
|
2404
|
+
stopCurrentAgent,
|
|
2405
|
+
runCurrentAgent,
|
|
2406
|
+
setCurrentAgentState
|
|
2407
|
+
});
|
|
2408
|
+
} else {
|
|
2409
|
+
defaultReloadMessages();
|
|
2410
|
+
}
|
|
2411
|
+
}
|
|
2412
|
+
return {
|
|
2413
|
+
visibleMessages,
|
|
2414
|
+
isLoading,
|
|
2415
|
+
currentSuggestions,
|
|
2416
|
+
sendMessage,
|
|
2417
|
+
stopGeneration,
|
|
2418
|
+
reloadMessages
|
|
2419
|
+
};
|
|
2420
|
+
};
|
|
2421
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
2422
|
+
0 && (module.exports = {
|
|
2423
|
+
CopilotChat,
|
|
2424
|
+
WrappedCopilotChat,
|
|
2425
|
+
useCopilotChatLogic
|
|
2426
|
+
});
|
|
2427
|
+
//# sourceMappingURL=Chat.js.map
|