@copilotkit/react-ui 1.5.12-next.4 → 1.5.12-next.6
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 +20 -0
- package/dist/{chunk-CIP6WIZY.mjs → chunk-DGGCSR5M.mjs} +2 -2
- package/dist/{chunk-VN6664CL.mjs → chunk-E5SIPE2R.mjs} +8 -8
- package/dist/{chunk-HZGELGAZ.mjs → chunk-F2W5FD7L.mjs} +6 -6
- package/dist/{chunk-GUIGQMEU.mjs → chunk-GDOB4BYD.mjs} +2 -2
- package/dist/{chunk-RJCZRKTV.mjs → chunk-WGAZXTUA.mjs} +2 -1
- package/dist/chunk-WGAZXTUA.mjs.map +1 -0
- package/dist/{chunk-3CGR5FXK.mjs → chunk-YGWWZL4N.mjs} +11 -11
- package/dist/components/chat/Chat.js +1 -0
- package/dist/components/chat/Chat.js.map +1 -1
- package/dist/components/chat/Chat.mjs +12 -12
- package/dist/components/chat/Modal.js +1 -0
- package/dist/components/chat/Modal.js.map +1 -1
- package/dist/components/chat/Modal.mjs +14 -14
- package/dist/components/chat/Popup.js +1 -0
- package/dist/components/chat/Popup.js.map +1 -1
- package/dist/components/chat/Popup.mjs +15 -15
- package/dist/components/chat/Sidebar.js +1 -0
- package/dist/components/chat/Sidebar.js.map +1 -1
- package/dist/components/chat/Sidebar.mjs +15 -15
- package/dist/components/chat/Suggestion.js +1 -0
- package/dist/components/chat/Suggestion.js.map +1 -1
- package/dist/components/chat/Suggestion.mjs +1 -1
- package/dist/components/chat/index.js +1 -0
- package/dist/components/chat/index.js.map +1 -1
- package/dist/components/chat/index.mjs +18 -18
- package/dist/components/chat/messages/AssistantMessage.mjs +1 -1
- package/dist/components/dev-console/console.mjs +3 -3
- package/dist/components/dev-console/index.mjs +5 -5
- package/dist/components/index.js +1 -0
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +22 -22
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +22 -22
- package/package.json +4 -4
- package/src/components/chat/Suggestion.tsx +1 -0
- package/dist/chunk-RJCZRKTV.mjs.map +0 -1
- /package/dist/{chunk-CIP6WIZY.mjs.map → chunk-DGGCSR5M.mjs.map} +0 -0
- /package/dist/{chunk-VN6664CL.mjs.map → chunk-E5SIPE2R.mjs.map} +0 -0
- /package/dist/{chunk-HZGELGAZ.mjs.map → chunk-F2W5FD7L.mjs.map} +0 -0
- /package/dist/{chunk-GUIGQMEU.mjs.map → chunk-GDOB4BYD.mjs.map} +0 -0
- /package/dist/{chunk-3CGR5FXK.mjs.map → chunk-YGWWZL4N.mjs.map} +0 -0
package/dist/index.mjs
CHANGED
|
@@ -2,54 +2,54 @@
|
|
|
2
2
|
import "./chunk-EFZPSZWO.mjs";
|
|
3
3
|
import "./chunk-MMVDU6DF.mjs";
|
|
4
4
|
import "./chunk-SQMEPWVT.mjs";
|
|
5
|
+
import {
|
|
6
|
+
CopilotSidebar
|
|
7
|
+
} from "./chunk-DGGCSR5M.mjs";
|
|
5
8
|
import "./chunk-WB3YULQ4.mjs";
|
|
6
9
|
import {
|
|
7
10
|
CopilotPopup
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import
|
|
10
|
-
CopilotSidebar
|
|
11
|
-
} from "./chunk-CIP6WIZY.mjs";
|
|
12
|
-
import "./chunk-VN6664CL.mjs";
|
|
11
|
+
} from "./chunk-GDOB4BYD.mjs";
|
|
12
|
+
import "./chunk-E5SIPE2R.mjs";
|
|
13
13
|
import "./chunk-YAGE7RCE.mjs";
|
|
14
|
+
import "./chunk-VEC45H6Q.mjs";
|
|
14
15
|
import "./chunk-RQNJNK2W.mjs";
|
|
15
16
|
import {
|
|
16
17
|
CopilotChat
|
|
17
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-YGWWZL4N.mjs";
|
|
18
19
|
import "./chunk-UWWMAJ7R.mjs";
|
|
19
20
|
import "./chunk-F7VWGY77.mjs";
|
|
20
21
|
import "./chunk-OFYI4UU4.mjs";
|
|
21
22
|
import {
|
|
22
23
|
UserMessage
|
|
23
24
|
} from "./chunk-HEIDCT7I.mjs";
|
|
25
|
+
import "./chunk-V7W6IM2V.mjs";
|
|
24
26
|
import {
|
|
25
27
|
AssistantMessage
|
|
26
28
|
} from "./chunk-3VNMQWGT.mjs";
|
|
27
29
|
import "./chunk-XB6QCUPB.mjs";
|
|
30
|
+
import "./chunk-WGAZXTUA.mjs";
|
|
31
|
+
import {
|
|
32
|
+
CopilotDevConsole
|
|
33
|
+
} from "./chunk-F2W5FD7L.mjs";
|
|
34
|
+
import {
|
|
35
|
+
shouldShowDevConsole
|
|
36
|
+
} from "./chunk-PNQVKBPN.mjs";
|
|
37
|
+
import "./chunk-KXE2JCUH.mjs";
|
|
38
|
+
import "./chunk-TI7SY2RI.mjs";
|
|
39
|
+
import "./chunk-BH6PCAAL.mjs";
|
|
40
|
+
import "./chunk-OTPAZXVR.mjs";
|
|
41
|
+
import "./chunk-EMQEEXUB.mjs";
|
|
42
|
+
import "./chunk-YQFVRDNC.mjs";
|
|
28
43
|
import {
|
|
29
44
|
Markdown
|
|
30
45
|
} from "./chunk-YQ3D5IQV.mjs";
|
|
31
46
|
import "./chunk-34FREWVK.mjs";
|
|
32
47
|
import "./chunk-3XAXY2Z3.mjs";
|
|
33
|
-
import "./chunk-RJCZRKTV.mjs";
|
|
34
|
-
import "./chunk-UPTB2MVO.mjs";
|
|
35
|
-
import "./chunk-VEC45H6Q.mjs";
|
|
36
|
-
import "./chunk-EMQEEXUB.mjs";
|
|
37
|
-
import "./chunk-YQFVRDNC.mjs";
|
|
38
48
|
import {
|
|
39
49
|
useChatContext
|
|
40
50
|
} from "./chunk-CBBFRI3Q.mjs";
|
|
41
|
-
import "./chunk-
|
|
42
|
-
import {
|
|
43
|
-
CopilotDevConsole
|
|
44
|
-
} from "./chunk-HZGELGAZ.mjs";
|
|
45
|
-
import "./chunk-KXE2JCUH.mjs";
|
|
46
|
-
import "./chunk-TI7SY2RI.mjs";
|
|
47
|
-
import "./chunk-BH6PCAAL.mjs";
|
|
48
|
-
import {
|
|
49
|
-
shouldShowDevConsole
|
|
50
|
-
} from "./chunk-PNQVKBPN.mjs";
|
|
51
|
+
import "./chunk-UPTB2MVO.mjs";
|
|
51
52
|
import "./chunk-FZC7X5PK.mjs";
|
|
52
|
-
import "./chunk-OTPAZXVR.mjs";
|
|
53
53
|
import "./chunk-IU3WTXLQ.mjs";
|
|
54
54
|
import "./chunk-T26KLXLH.mjs";
|
|
55
55
|
import {
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"publishConfig": {
|
|
10
10
|
"access": "public"
|
|
11
11
|
},
|
|
12
|
-
"version": "1.5.12-next.
|
|
12
|
+
"version": "1.5.12-next.6",
|
|
13
13
|
"sideEffects": [
|
|
14
14
|
"**/*.css"
|
|
15
15
|
],
|
|
@@ -50,9 +50,9 @@
|
|
|
50
50
|
"react-syntax-highlighter": "^15.5.0",
|
|
51
51
|
"remark-gfm": "^3.0.1",
|
|
52
52
|
"remark-math": "^5.1.1",
|
|
53
|
-
"@copilotkit/react-core": "1.5.12-next.
|
|
54
|
-
"@copilotkit/runtime-client-gql": "1.5.12-next.
|
|
55
|
-
"@copilotkit/shared": "1.5.12-next.
|
|
53
|
+
"@copilotkit/react-core": "1.5.12-next.6",
|
|
54
|
+
"@copilotkit/runtime-client-gql": "1.5.12-next.6",
|
|
55
|
+
"@copilotkit/shared": "1.5.12-next.6"
|
|
56
56
|
},
|
|
57
57
|
"keywords": [
|
|
58
58
|
"copilotkit",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/chat/Suggestion.tsx"],"sourcesContent":["import {\n CopilotContextParams,\n extract,\n CopilotChatSuggestionConfiguration,\n CopilotMessagesContextParams,\n} from \"@copilotkit/react-core\";\nimport { SuggestionsProps } from \"./props\";\nimport { SmallSpinnerIcon } from \"./Icons\";\nimport { CopilotChatSuggestion } from \"../../types/suggestions\";\nimport { actionParametersToJsonSchema } from \"@copilotkit/shared\";\nimport { CopilotRequestType } from \"@copilotkit/runtime-client-gql\";\n\nexport function Suggestion({ title, message, onClick, partial, className }: SuggestionsProps) {\n return (\n <button\n disabled={partial}\n onClick={(e) => {\n e.preventDefault();\n onClick(message);\n }}\n className={className || \"suggestion\"}\n >\n {partial && SmallSpinnerIcon}\n <span>{title}</span>\n </button>\n );\n}\n\nexport const reloadSuggestions = async (\n context: CopilotContextParams & CopilotMessagesContextParams,\n chatSuggestionConfiguration: { [key: string]: CopilotChatSuggestionConfiguration },\n setCurrentSuggestions: (suggestions: { title: string; message: string }[]) => void,\n abortControllerRef: React.MutableRefObject<AbortController | null>,\n) => {\n const abortController = abortControllerRef.current;\n\n const tools = JSON.stringify(\n Object.values(context.actions).map((action) => ({\n name: action.name,\n description: action.description,\n jsonSchema: JSON.stringify(actionParametersToJsonSchema(action.parameters)),\n })),\n );\n\n const allSuggestions: CopilotChatSuggestion[] = [];\n\n for (const config of Object.values(chatSuggestionConfiguration)) {\n try {\n const numOfSuggestionsInstructions =\n config.minSuggestions === 0\n ? `Produce up to ${config.maxSuggestions} suggestions. ` +\n `If there are no highly relevant suggestions you can think of, provide an empty array.`\n : `Produce between ${config.minSuggestions} and ${config.maxSuggestions} suggestions.`;\n\n const result = await extract({\n context,\n instructions:\n \"Suggest what the user could say next. Provide clear, highly relevant suggestions. Do not literally suggest function calls. \",\n data:\n config.instructions +\n \"\\n\\n\" +\n numOfSuggestionsInstructions +\n \"\\n\\n\" +\n \"Available tools: \" +\n tools +\n \"\\n\\n\",\n requestType: CopilotRequestType.Task,\n parameters: [\n {\n name: \"suggestions\",\n type: \"object[]\",\n attributes: [\n {\n name: \"title\",\n description:\n \"The title of the suggestion. This is shown as a button and should be short.\",\n type: \"string\",\n },\n {\n name: \"message\",\n description:\n \"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.\",\n type: \"string\",\n },\n ],\n },\n ],\n include: {\n messages: true,\n readable: true,\n },\n abortSignal: abortController?.signal,\n stream: ({ status, args }) => {\n const suggestions = args.suggestions || [];\n const newSuggestions: CopilotChatSuggestion[] = [];\n for (let i = 0; i < suggestions.length; i++) {\n // if GPT provides too many suggestions, limit the number of suggestions\n if (config.maxSuggestions !== undefined && i >= config.maxSuggestions) {\n break;\n }\n const { title, message } = suggestions[i];\n\n // If this is the last suggestion and the status is not complete, mark it as partial\n const partial = i == suggestions.length - 1 && status !== \"complete\";\n\n newSuggestions.push({\n title,\n message,\n partial,\n className: config.className,\n });\n }\n setCurrentSuggestions([...allSuggestions, ...newSuggestions]);\n },\n });\n allSuggestions.push(...result.suggestions);\n } catch (error) {\n console.error(\"Error loading suggestions\", error);\n }\n }\n\n if (abortControllerRef.current === abortController) {\n abortControllerRef.current = null;\n }\n};\n"],"mappings":";;;;;;;;AAAA;AAAA,EAEE;AAAA,OAGK;AAIP,SAAS,oCAAoC;AAC7C,SAAS,0BAA0B;AAI/B,SASE,KATF;AAFG,SAAS,WAAW,EAAE,OAAO,SAAS,SAAS,SAAS,UAAU,GAAqB;AAC5F,SACE;AAAA,IAAC;AAAA;AAAA,MACC,UAAU;AAAA,MACV,SAAS,CAAC,MAAM;AACd,UAAE,eAAe;AACjB,gBAAQ,OAAO;AAAA,MACjB;AAAA,MACA,WAAW,aAAa;AAAA,MAEvB;AAAA,mBAAW;AAAA,QACZ,oBAAC,UAAM,iBAAM;AAAA;AAAA;AAAA,EACf;AAEJ;AAEO,IAAM,oBAAoB,CAC/B,SACA,6BACA,uBACA,uBACG;AACH,QAAM,kBAAkB,mBAAmB;AAE3C,QAAM,QAAQ,KAAK;AAAA,IACjB,OAAO,OAAO,QAAQ,OAAO,EAAE,IAAI,CAAC,YAAY;AAAA,MAC9C,MAAM,OAAO;AAAA,MACb,aAAa,OAAO;AAAA,MACpB,YAAY,KAAK,UAAU,6BAA6B,OAAO,UAAU,CAAC;AAAA,IAC5E,EAAE;AAAA,EACJ;AAEA,QAAM,iBAA0C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A,cAAQ,MAAM,6BAA6B,KAAK;AAAA,IAClD;AAAA,EACF;AAEA,MAAI,mBAAmB,YAAY,iBAAiB;AAClD,uBAAmB,UAAU;AAAA,EAC/B;AACF;","names":[]}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|