@copilotkit/react-core 0.21.0-mme-pre-release.3 → 0.21.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/.turbo/turbo-build.log +134 -134
- package/CHANGELOG.md +38 -0
- package/dist/{chunk-NNUIXO74.mjs → chunk-JECDOVIL.mjs} +2 -4
- package/dist/chunk-JECDOVIL.mjs.map +1 -0
- package/dist/chunk-K3HLWC4F.mjs +47 -0
- package/dist/chunk-K3HLWC4F.mjs.map +1 -0
- package/dist/{chunk-WCI6UGKK.mjs → chunk-PO5VE42C.mjs} +2 -2
- package/dist/hooks/index.js +28 -76
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs +3 -3
- package/dist/hooks/use-copilot-action-implementation.d.ts +2 -3
- package/dist/hooks/use-copilot-action-implementation.js +0 -49
- package/dist/hooks/use-copilot-action-implementation.js.map +1 -1
- package/dist/hooks/use-copilot-action-implementation.mjs +1 -3
- package/dist/hooks/use-copilot-action.js.map +1 -1
- package/dist/hooks/use-copilot-action.mjs +2 -2
- package/dist/hooks/use-make-copilot-actionable.js +7 -59
- package/dist/hooks/use-make-copilot-actionable.js.map +1 -1
- package/dist/hooks/use-make-copilot-actionable.mjs +1 -2
- package/dist/index.js +30 -78
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -3
- package/package.json +4 -4
- package/src/hooks/use-copilot-action-implementation.ts +1 -52
- package/src/hooks/use-make-copilot-actionable.ts +1 -1
- package/dist/chunk-NNUIXO74.mjs.map +0 -1
- package/dist/chunk-UQKARKHD.mjs +0 -95
- package/dist/chunk-UQKARKHD.mjs.map +0 -1
- /package/dist/{chunk-WCI6UGKK.mjs.map → chunk-PO5VE42C.mjs.map} +0 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @copilotkit/react-core@0.21.0
|
|
2
|
+
> @copilotkit/react-core@0.21.0 build /home/runner/work/CopilotKit/CopilotKit/CopilotKit/packages/react-core
|
|
3
3
|
> tsup --clean
|
|
4
4
|
|
|
5
5
|
[34mCLI[39m Building entry: src/index.tsx, src/components/index.ts, src/context/copilot-context.tsx, src/context/index.ts, src/hooks/index.ts, src/hooks/use-chat.ts, src/hooks/use-copilot-action-implementation.ts, src/hooks/use-copilot-action.ts, src/hooks/use-copilot-chat.ts, src/hooks/use-flat-category-store.ts, src/hooks/use-make-copilot-actionable.ts, src/hooks/use-make-copilot-document-readable.ts, src/hooks/use-make-copilot-readable.ts, src/hooks/use-tree.ts, src/lib/copilot-task.ts, src/lib/index.ts, src/openai-assistants/index.ts, src/types/document-pointer.ts, src/types/frontend-action.ts, src/types/index.ts, src/types/system-message.ts, src/utils/fetch-chat-completion.ts, src/utils/utils.test.ts, src/utils/utils.ts, src/components/copilot-provider/copilotkit-props.tsx, src/components/copilot-provider/copilotkit.tsx, src/components/copilot-provider/index.ts, src/components/copilot-provider/standard-copilot-api-config.tsx, src/openai-assistants/hooks/index.ts, src/openai-assistants/hooks/use-assistants.ts, src/openai-assistants/hooks/use-copilot-chat-v2.ts, src/openai-assistants/utils/index.ts, src/openai-assistants/utils/process-message-stream.ts
|
|
@@ -10,10 +10,99 @@
|
|
|
10
10
|
[34mCLI[39m Cleaning output folder
|
|
11
11
|
[34mESM[39m Build start
|
|
12
12
|
[34mCJS[39m Build start
|
|
13
|
+
[32mCJS[39m [1mdist/index.js [22m[32m39.08 KB[39m
|
|
14
|
+
[32mCJS[39m [1mdist/components/index.js [22m[32m15.02 KB[39m
|
|
15
|
+
[32mCJS[39m [1mdist/context/copilot-context.js [22m[32m3.66 KB[39m
|
|
16
|
+
[32mCJS[39m [1mdist/hooks/index.js [22m[32m19.93 KB[39m
|
|
17
|
+
[32mCJS[39m [1mdist/lib/copilot-task.js [22m[32m7.38 KB[39m
|
|
18
|
+
[32mCJS[39m [1mdist/openai-assistants/index.js [22m[32m9.35 KB[39m
|
|
19
|
+
[32mCJS[39m [1mdist/types/document-pointer.js [22m[32m841.00 B[39m
|
|
20
|
+
[32mCJS[39m [1mdist/utils/fetch-chat-completion.js [22m[32m4.95 KB[39m
|
|
21
|
+
[32mCJS[39m [1mdist/components/copilot-provider/copilotkit-props.js [22m[32m878.00 B[39m
|
|
22
|
+
[32mCJS[39m [1mdist/openai-assistants/hooks/index.js [22m[32m9.25 KB[39m
|
|
23
|
+
[32mCJS[39m [1mdist/openai-assistants/utils/index.js [22m[32m2.30 KB[39m
|
|
24
|
+
[32mCJS[39m [1mdist/context/index.js [22m[32m3.64 KB[39m
|
|
25
|
+
[32mCJS[39m [1mdist/hooks/use-chat.js [22m[32m11.27 KB[39m
|
|
26
|
+
[32mCJS[39m [1mdist/hooks/use-copilot-action-implementation.js [22m[32m5.09 KB[39m
|
|
27
|
+
[32mCJS[39m [1mdist/hooks/use-copilot-action.js [22m[32m5.17 KB[39m
|
|
28
|
+
[32mCJS[39m [1mdist/hooks/use-copilot-chat.js [22m[32m16.00 KB[39m
|
|
29
|
+
[32mCJS[39m [1mdist/hooks/use-flat-category-store.js [22m[32m2.87 KB[39m
|
|
30
|
+
[32mCJS[39m [1mdist/hooks/use-make-copilot-actionable.js [22m[32m4.63 KB[39m
|
|
31
|
+
[32mCJS[39m [1mdist/hooks/use-make-copilot-document-readable.js [22m[32m4.26 KB[39m
|
|
32
|
+
[32mCJS[39m [1mdist/hooks/use-make-copilot-readable.js [22m[32m4.14 KB[39m
|
|
33
|
+
[32mCJS[39m [1mdist/hooks/use-tree.js [22m[32m5.53 KB[39m
|
|
34
|
+
[32mCJS[39m [1mdist/lib/index.js [22m[32m7.34 KB[39m
|
|
35
|
+
[32mCJS[39m [1mdist/types/frontend-action.js [22m[32m837.00 B[39m
|
|
36
|
+
[32mCJS[39m [1mdist/types/index.js [22m[32m797.00 B[39m
|
|
37
|
+
[32mCJS[39m [1mdist/types/system-message.js [22m[32m833.00 B[39m
|
|
38
|
+
[32mCJS[39m [1mdist/utils/utils.test.js [22m[32m184.00 B[39m
|
|
39
|
+
[32mCJS[39m [1mdist/utils/utils.js [22m[32m797.00 B[39m
|
|
40
|
+
[32mCJS[39m [1mdist/components/copilot-provider/copilotkit.js [22m[32m15.01 KB[39m
|
|
41
|
+
[32mCJS[39m [1mdist/components/copilot-provider/index.js [22m[32m15.06 KB[39m
|
|
42
|
+
[32mCJS[39m [1mdist/components/copilot-provider/standard-copilot-api-config.js [22m[32m1.48 KB[39m
|
|
43
|
+
[32mCJS[39m [1mdist/openai-assistants/hooks/use-assistants.js [22m[32m4.82 KB[39m
|
|
44
|
+
[32mCJS[39m [1mdist/openai-assistants/hooks/use-copilot-chat-v2.js [22m[32m9.34 KB[39m
|
|
45
|
+
[32mCJS[39m [1mdist/openai-assistants/utils/process-message-stream.js [22m[32m2.33 KB[39m
|
|
46
|
+
[32mCJS[39m [1mdist/index.js.map [22m[32m74.40 KB[39m
|
|
47
|
+
[32mCJS[39m [1mdist/components/index.js.map [22m[32m27.07 KB[39m
|
|
48
|
+
[32mCJS[39m [1mdist/context/copilot-context.js.map [22m[32m4.86 KB[39m
|
|
49
|
+
[32mCJS[39m [1mdist/hooks/index.js.map [22m[32m43.87 KB[39m
|
|
50
|
+
[32mCJS[39m [1mdist/lib/copilot-task.js.map [22m[32m16.37 KB[39m
|
|
51
|
+
[32mCJS[39m [1mdist/openai-assistants/index.js.map [22m[32m20.32 KB[39m
|
|
52
|
+
[32mCJS[39m [1mdist/types/document-pointer.js.map [22m[32m292.00 B[39m
|
|
53
|
+
[32mCJS[39m [1mdist/utils/fetch-chat-completion.js.map [22m[32m4.79 KB[39m
|
|
54
|
+
[32mCJS[39m [1mdist/components/copilot-provider/copilotkit-props.js.map [22m[32m1.12 KB[39m
|
|
55
|
+
[32mCJS[39m [1mdist/openai-assistants/hooks/index.js.map [22m[32m20.62 KB[39m
|
|
56
|
+
[32mCJS[39m [1mdist/openai-assistants/utils/index.js.map [22m[32m1.44 KB[39m
|
|
57
|
+
[32mCJS[39m [1mdist/context/index.js.map [22m[32m5.09 KB[39m
|
|
58
|
+
[32mCJS[39m [1mdist/hooks/use-chat.js.map [22m[32m17.88 KB[39m
|
|
59
|
+
[32mCJS[39m [1mdist/hooks/use-copilot-action-implementation.js.map [22m[32m8.27 KB[39m
|
|
60
|
+
[32mCJS[39m [1mdist/hooks/use-copilot-action.js.map [22m[32m9.86 KB[39m
|
|
61
|
+
[32mCJS[39m [1mdist/hooks/use-copilot-chat.js.map [22m[32m33.57 KB[39m
|
|
62
|
+
[32mCJS[39m [1mdist/hooks/use-flat-category-store.js.map [22m[32m4.25 KB[39m
|
|
63
|
+
[32mCJS[39m [1mdist/hooks/use-make-copilot-actionable.js.map [22m[32m6.63 KB[39m
|
|
64
|
+
[32mCJS[39m [1mdist/hooks/use-make-copilot-document-readable.js.map [22m[32m6.17 KB[39m
|
|
65
|
+
[32mCJS[39m [1mdist/hooks/use-make-copilot-readable.js.map [22m[32m6.22 KB[39m
|
|
66
|
+
[32mCJS[39m [1mdist/hooks/use-tree.js.map [22m[32m8.32 KB[39m
|
|
67
|
+
[32mCJS[39m [1mdist/lib/index.js.map [22m[32m16.43 KB[39m
|
|
68
|
+
[32mCJS[39m [1mdist/types/frontend-action.js.map [22m[32m1.70 KB[39m
|
|
69
|
+
[32mCJS[39m [1mdist/types/index.js.map [22m[32m253.00 B[39m
|
|
70
|
+
[32mCJS[39m [1mdist/types/system-message.js.map [22m[32m249.00 B[39m
|
|
71
|
+
[32mCJS[39m [1mdist/utils/utils.test.js.map [22m[32m354.00 B[39m
|
|
72
|
+
[32mCJS[39m [1mdist/utils/utils.js.map [22m[32m137.00 B[39m
|
|
73
|
+
[32mCJS[39m [1mdist/components/copilot-provider/copilotkit.js.map [22m[32m27.01 KB[39m
|
|
74
|
+
[32mCJS[39m [1mdist/components/copilot-provider/index.js.map [22m[32m27.20 KB[39m
|
|
75
|
+
[32mCJS[39m [1mdist/components/copilot-provider/standard-copilot-api-config.js.map [22m[32m1.17 KB[39m
|
|
76
|
+
[32mCJS[39m [1mdist/openai-assistants/hooks/use-assistants.js.map [22m[32m5.92 KB[39m
|
|
77
|
+
[32mCJS[39m [1mdist/openai-assistants/hooks/use-copilot-chat-v2.js.map [22m[32m20.23 KB[39m
|
|
78
|
+
[32mCJS[39m [1mdist/openai-assistants/utils/process-message-stream.js.map [22m[32m1.33 KB[39m
|
|
79
|
+
[32mCJS[39m ⚡️ Build success in 265ms
|
|
80
|
+
[32mESM[39m [1mdist/openai-assistants/utils/process-message-stream.mjs [22m[32m188.00 B[39m
|
|
81
|
+
[32mESM[39m [1mdist/components/copilot-provider/copilotkit-props.mjs [22m[32m59.00 B[39m
|
|
82
|
+
[32mESM[39m [1mdist/components/copilot-provider/copilotkit.mjs [22m[32m380.00 B[39m
|
|
83
|
+
[32mESM[39m [1mdist/components/copilot-provider/index.mjs [22m[32m396.00 B[39m
|
|
84
|
+
[32mESM[39m [1mdist/components/copilot-provider/standard-copilot-api-config.mjs [22m[32m201.00 B[39m
|
|
85
|
+
[32mESM[39m [1mdist/openai-assistants/hooks/index.mjs [22m[32m548.00 B[39m
|
|
86
|
+
[32mESM[39m [1mdist/openai-assistants/hooks/use-assistants.mjs [22m[32m2.59 KB[39m
|
|
87
|
+
[32mESM[39m [1mdist/openai-assistants/hooks/use-copilot-chat-v2.mjs [22m[32m575.00 B[39m
|
|
88
|
+
[32mESM[39m [1mdist/openai-assistants/utils/index.mjs [22m[32m206.00 B[39m
|
|
89
|
+
[32mESM[39m [1mdist/openai-assistants/index.mjs [22m[32m597.00 B[39m
|
|
90
|
+
[32mESM[39m [1mdist/types/document-pointer.mjs [22m[32m45.00 B[39m
|
|
91
|
+
[32mESM[39m [1mdist/types/frontend-action.mjs [22m[32m44.00 B[39m
|
|
92
|
+
[32mESM[39m [1mdist/types/index.mjs [22m[32m66.00 B[39m
|
|
93
|
+
[32mESM[39m [1mdist/types/system-message.mjs [22m[32m43.00 B[39m
|
|
94
|
+
[32mESM[39m [1mdist/utils/fetch-chat-completion.mjs [22m[32m319.00 B[39m
|
|
95
|
+
[32mESM[39m [1mdist/utils/utils.test.mjs [22m[32m170.00 B[39m
|
|
96
|
+
[32mESM[39m [1mdist/utils/utils.mjs [22m[32m34.00 B[39m
|
|
97
|
+
[32mESM[39m [1mdist/hooks/use-copilot-chat.mjs [22m[32m500.00 B[39m
|
|
98
|
+
[32mESM[39m [1mdist/hooks/use-flat-category-store.mjs [22m[32m216.00 B[39m
|
|
99
|
+
[32mESM[39m [1mdist/hooks/use-make-copilot-actionable.mjs [22m[32m241.00 B[39m
|
|
100
|
+
[32mESM[39m [1mdist/hooks/use-make-copilot-document-readable.mjs [22m[32m260.00 B[39m
|
|
101
|
+
[32mESM[39m [1mdist/hooks/use-make-copilot-readable.mjs [22m[32m235.00 B[39m
|
|
102
|
+
[32mESM[39m [1mdist/hooks/use-tree.mjs [22m[32m171.00 B[39m
|
|
103
|
+
[32mESM[39m [1mdist/lib/copilot-task.mjs [22m[32m410.00 B[39m
|
|
104
|
+
[32mESM[39m [1mdist/lib/index.mjs [22m[32m435.00 B[39m
|
|
13
105
|
[32mESM[39m [1mdist/index.mjs [22m[32m1.63 KB[39m
|
|
14
|
-
[32mESM[39m [1mdist/components/index.mjs [22m[32m407.00 B[39m
|
|
15
|
-
[32mESM[39m [1mdist/context/copilot-context.mjs [22m[32m219.00 B[39m
|
|
16
|
-
[32mESM[39m [1mdist/hooks/index.mjs [22m[32m881.00 B[39m
|
|
17
106
|
[32mESM[39m [1mdist/chunk-7GFKOIO7.mjs [22m[32m43.00 B[39m
|
|
18
107
|
[32mESM[39m [1mdist/chunk-BABVSMJR.mjs [22m[32m43.00 B[39m
|
|
19
108
|
[32mESM[39m [1mdist/chunk-XDKLZEPZ.mjs [22m[32m4.39 KB[39m
|
|
@@ -22,11 +111,14 @@
|
|
|
22
111
|
[32mESM[39m [1mdist/chunk-EFZPSZWO.mjs [22m[32m43.00 B[39m
|
|
23
112
|
[32mESM[39m [1mdist/chunk-LUGEI4YQ.mjs [22m[32m43.00 B[39m
|
|
24
113
|
[32mESM[39m [1mdist/chunk-OSQO6ASW.mjs [22m[32m3.17 KB[39m
|
|
114
|
+
[32mESM[39m [1mdist/components/index.mjs [22m[32m407.00 B[39m
|
|
115
|
+
[32mESM[39m [1mdist/context/copilot-context.mjs [22m[32m219.00 B[39m
|
|
25
116
|
[32mESM[39m [1mdist/context/index.mjs [22m[32m227.00 B[39m
|
|
26
117
|
[32mESM[39m [1mdist/chunk-VNRDQJXW.mjs [22m[32m43.00 B[39m
|
|
118
|
+
[32mESM[39m [1mdist/hooks/index.mjs [22m[32m881.00 B[39m
|
|
27
119
|
[32mESM[39m [1mdist/chunk-IOP6JX34.mjs [22m[32m43.00 B[39m
|
|
28
120
|
[32mESM[39m [1mdist/chunk-NUQYMU4U.mjs [22m[32m2.95 KB[39m
|
|
29
|
-
[32mESM[39m [1mdist/chunk-
|
|
121
|
+
[32mESM[39m [1mdist/chunk-JECDOVIL.mjs [22m[32m1.06 KB[39m
|
|
30
122
|
[32mESM[39m [1mdist/chunk-ZAB22RCR.mjs [22m[32m700.00 B[39m
|
|
31
123
|
[32mESM[39m [1mdist/chunk-4VUJYN3U.mjs [22m[32m640.00 B[39m
|
|
32
124
|
[32mESM[39m [1mdist/chunk-JD7BAH7U.mjs [22m[32m43.00 B[39m
|
|
@@ -38,41 +130,38 @@
|
|
|
38
130
|
[32mESM[39m [1mdist/hooks/use-chat.mjs [22m[32m174.00 B[39m
|
|
39
131
|
[32mESM[39m [1mdist/chunk-AEUR5JBT.mjs [22m[32m6.28 KB[39m
|
|
40
132
|
[32mESM[39m [1mdist/chunk-3WKJ25L3.mjs [22m[32m2.69 KB[39m
|
|
41
|
-
[32mESM[39m [1mdist/hooks/use-copilot-action-implementation.mjs [22m[
|
|
133
|
+
[32mESM[39m [1mdist/hooks/use-copilot-action-implementation.mjs [22m[32m259.00 B[39m
|
|
42
134
|
[32mESM[39m [1mdist/hooks/use-copilot-action.mjs [22m[32m248.00 B[39m
|
|
43
|
-
[32mESM[39m [1mdist/chunk-
|
|
44
|
-
[32mESM[39m [1mdist/chunk-
|
|
135
|
+
[32mESM[39m [1mdist/chunk-PO5VE42C.mjs [22m[32m299.00 B[39m
|
|
136
|
+
[32mESM[39m [1mdist/chunk-K3HLWC4F.mjs [22m[32m1.50 KB[39m
|
|
45
137
|
[32mESM[39m [1mdist/chunk-DVLYNQG4.mjs [22m[32m1.46 KB[39m
|
|
46
138
|
[32mESM[39m [1mdist/chunk-MRXNTQOX.mjs [22m[32m1.89 KB[39m
|
|
47
|
-
[32mESM[39m [1mdist/openai-assistants/utils/process-message-stream.mjs
|
|
48
|
-
[32mESM[39m [1mdist/components/copilot-provider/copilotkit-props.mjs
|
|
49
|
-
[32mESM[39m [1mdist/
|
|
50
|
-
[32mESM[39m [1mdist/
|
|
51
|
-
[32mESM[39m [1mdist/
|
|
52
|
-
[32mESM[39m [1mdist/
|
|
53
|
-
[32mESM[39m [1mdist/
|
|
54
|
-
[32mESM[39m [1mdist/
|
|
55
|
-
[32mESM[39m [1mdist/
|
|
56
|
-
[32mESM[39m [1mdist/openai-assistants/
|
|
57
|
-
[32mESM[39m [1mdist/
|
|
58
|
-
[32mESM[39m [1mdist/
|
|
59
|
-
[32mESM[39m [1mdist/
|
|
60
|
-
[32mESM[39m [1mdist/types/
|
|
61
|
-
[32mESM[39m [1mdist/
|
|
62
|
-
[32mESM[39m [1mdist/
|
|
63
|
-
[32mESM[39m [1mdist/utils/utils.
|
|
64
|
-
[32mESM[39m [1mdist/
|
|
65
|
-
[32mESM[39m [1mdist/hooks/use-
|
|
66
|
-
[32mESM[39m [1mdist/hooks/use-
|
|
67
|
-
[32mESM[39m [1mdist/hooks/use-make-copilot-
|
|
68
|
-
[32mESM[39m [1mdist/hooks/use-make-copilot-
|
|
69
|
-
[32mESM[39m [1mdist/hooks/use-
|
|
70
|
-
[32mESM[39m [1mdist/
|
|
71
|
-
[32mESM[39m [1mdist/lib/index.mjs
|
|
139
|
+
[32mESM[39m [1mdist/openai-assistants/utils/process-message-stream.mjs.map [22m[32m71.00 B[39m
|
|
140
|
+
[32mESM[39m [1mdist/components/copilot-provider/copilotkit-props.mjs.map [22m[32m71.00 B[39m
|
|
141
|
+
[32mESM[39m [1mdist/components/copilot-provider/copilotkit.mjs.map [22m[32m71.00 B[39m
|
|
142
|
+
[32mESM[39m [1mdist/components/copilot-provider/index.mjs.map [22m[32m71.00 B[39m
|
|
143
|
+
[32mESM[39m [1mdist/components/copilot-provider/standard-copilot-api-config.mjs.map [22m[32m71.00 B[39m
|
|
144
|
+
[32mESM[39m [1mdist/openai-assistants/hooks/index.mjs.map [22m[32m71.00 B[39m
|
|
145
|
+
[32mESM[39m [1mdist/openai-assistants/hooks/use-assistants.mjs.map [22m[32m4.67 KB[39m
|
|
146
|
+
[32mESM[39m [1mdist/openai-assistants/hooks/use-copilot-chat-v2.mjs.map [22m[32m71.00 B[39m
|
|
147
|
+
[32mESM[39m [1mdist/openai-assistants/utils/index.mjs.map [22m[32m71.00 B[39m
|
|
148
|
+
[32mESM[39m [1mdist/openai-assistants/index.mjs.map [22m[32m71.00 B[39m
|
|
149
|
+
[32mESM[39m [1mdist/types/document-pointer.mjs.map [22m[32m71.00 B[39m
|
|
150
|
+
[32mESM[39m [1mdist/types/frontend-action.mjs.map [22m[32m71.00 B[39m
|
|
151
|
+
[32mESM[39m [1mdist/types/index.mjs.map [22m[32m71.00 B[39m
|
|
152
|
+
[32mESM[39m [1mdist/types/system-message.mjs.map [22m[32m71.00 B[39m
|
|
153
|
+
[32mESM[39m [1mdist/utils/fetch-chat-completion.mjs.map [22m[32m71.00 B[39m
|
|
154
|
+
[32mESM[39m [1mdist/utils/utils.test.mjs.map [22m[32m352.00 B[39m
|
|
155
|
+
[32mESM[39m [1mdist/utils/utils.mjs.map [22m[32m71.00 B[39m
|
|
156
|
+
[32mESM[39m [1mdist/hooks/use-copilot-chat.mjs.map [22m[32m71.00 B[39m
|
|
157
|
+
[32mESM[39m [1mdist/hooks/use-flat-category-store.mjs.map [22m[32m71.00 B[39m
|
|
158
|
+
[32mESM[39m [1mdist/hooks/use-make-copilot-actionable.mjs.map [22m[32m71.00 B[39m
|
|
159
|
+
[32mESM[39m [1mdist/hooks/use-make-copilot-document-readable.mjs.map [22m[32m71.00 B[39m
|
|
160
|
+
[32mESM[39m [1mdist/hooks/use-make-copilot-readable.mjs.map [22m[32m71.00 B[39m
|
|
161
|
+
[32mESM[39m [1mdist/hooks/use-tree.mjs.map [22m[32m71.00 B[39m
|
|
162
|
+
[32mESM[39m [1mdist/lib/copilot-task.mjs.map [22m[32m71.00 B[39m
|
|
163
|
+
[32mESM[39m [1mdist/lib/index.mjs.map [22m[32m71.00 B[39m
|
|
72
164
|
[32mESM[39m [1mdist/index.mjs.map [22m[32m71.00 B[39m
|
|
73
|
-
[32mESM[39m [1mdist/components/index.mjs.map [22m[32m71.00 B[39m
|
|
74
|
-
[32mESM[39m [1mdist/context/copilot-context.mjs.map [22m[32m71.00 B[39m
|
|
75
|
-
[32mESM[39m [1mdist/hooks/index.mjs.map [22m[32m71.00 B[39m
|
|
76
165
|
[32mESM[39m [1mdist/chunk-7GFKOIO7.mjs.map [22m[32m71.00 B[39m
|
|
77
166
|
[32mESM[39m [1mdist/chunk-BABVSMJR.mjs.map [22m[32m71.00 B[39m
|
|
78
167
|
[32mESM[39m [1mdist/chunk-XDKLZEPZ.mjs.map [22m[32m7.90 KB[39m
|
|
@@ -81,11 +170,14 @@
|
|
|
81
170
|
[32mESM[39m [1mdist/chunk-EFZPSZWO.mjs.map [22m[32m71.00 B[39m
|
|
82
171
|
[32mESM[39m [1mdist/chunk-LUGEI4YQ.mjs.map [22m[32m71.00 B[39m
|
|
83
172
|
[32mESM[39m [1mdist/chunk-OSQO6ASW.mjs.map [22m[32m5.57 KB[39m
|
|
173
|
+
[32mESM[39m [1mdist/components/index.mjs.map [22m[32m71.00 B[39m
|
|
174
|
+
[32mESM[39m [1mdist/context/copilot-context.mjs.map [22m[32m71.00 B[39m
|
|
84
175
|
[32mESM[39m [1mdist/context/index.mjs.map [22m[32m71.00 B[39m
|
|
85
176
|
[32mESM[39m [1mdist/chunk-VNRDQJXW.mjs.map [22m[32m71.00 B[39m
|
|
177
|
+
[32mESM[39m [1mdist/hooks/index.mjs.map [22m[32m71.00 B[39m
|
|
86
178
|
[32mESM[39m [1mdist/chunk-IOP6JX34.mjs.map [22m[32m71.00 B[39m
|
|
87
179
|
[32mESM[39m [1mdist/chunk-NUQYMU4U.mjs.map [22m[32m4.68 KB[39m
|
|
88
|
-
[32mESM[39m [1mdist/chunk-
|
|
180
|
+
[32mESM[39m [1mdist/chunk-JECDOVIL.mjs.map [22m[32m1.89 KB[39m
|
|
89
181
|
[32mESM[39m [1mdist/chunk-ZAB22RCR.mjs.map [22m[32m1.42 KB[39m
|
|
90
182
|
[32mESM[39m [1mdist/chunk-4VUJYN3U.mjs.map [22m[32m1.47 KB[39m
|
|
91
183
|
[32mESM[39m [1mdist/chunk-JD7BAH7U.mjs.map [22m[32m71.00 B[39m
|
|
@@ -99,105 +191,13 @@
|
|
|
99
191
|
[32mESM[39m [1mdist/chunk-3WKJ25L3.mjs.map [22m[32m4.75 KB[39m
|
|
100
192
|
[32mESM[39m [1mdist/hooks/use-copilot-action-implementation.mjs.map [22m[32m71.00 B[39m
|
|
101
193
|
[32mESM[39m [1mdist/hooks/use-copilot-action.mjs.map [22m[32m71.00 B[39m
|
|
102
|
-
[32mESM[39m [1mdist/chunk-
|
|
103
|
-
[32mESM[39m [1mdist/chunk-
|
|
194
|
+
[32mESM[39m [1mdist/chunk-PO5VE42C.mjs.map [22m[32m1.66 KB[39m
|
|
195
|
+
[32mESM[39m [1mdist/chunk-K3HLWC4F.mjs.map [22m[32m3.52 KB[39m
|
|
104
196
|
[32mESM[39m [1mdist/chunk-DVLYNQG4.mjs.map [22m[32m4.77 KB[39m
|
|
105
197
|
[32mESM[39m [1mdist/chunk-MRXNTQOX.mjs.map [22m[32m71.00 B[39m
|
|
106
|
-
[32mESM[39m
|
|
107
|
-
[32mESM[39m [1mdist/components/copilot-provider/copilotkit-props.mjs.map [22m[32m71.00 B[39m
|
|
108
|
-
[32mESM[39m [1mdist/openai-assistants/hooks/index.mjs.map [22m[32m71.00 B[39m
|
|
109
|
-
[32mESM[39m [1mdist/types/document-pointer.mjs.map [22m[32m71.00 B[39m
|
|
110
|
-
[32mESM[39m [1mdist/utils/fetch-chat-completion.mjs.map [22m[32m71.00 B[39m
|
|
111
|
-
[32mESM[39m [1mdist/lib/copilot-task.mjs.map [22m[32m71.00 B[39m
|
|
112
|
-
[32mESM[39m [1mdist/components/copilot-provider/copilotkit.mjs.map [22m[32m71.00 B[39m
|
|
113
|
-
[32mESM[39m [1mdist/components/copilot-provider/index.mjs.map [22m[32m71.00 B[39m
|
|
114
|
-
[32mESM[39m [1mdist/components/copilot-provider/standard-copilot-api-config.mjs.map [22m[32m71.00 B[39m
|
|
115
|
-
[32mESM[39m [1mdist/openai-assistants/hooks/use-assistants.mjs.map [22m[32m4.67 KB[39m
|
|
116
|
-
[32mESM[39m [1mdist/openai-assistants/hooks/use-copilot-chat-v2.mjs.map [22m[32m71.00 B[39m
|
|
117
|
-
[32mESM[39m [1mdist/openai-assistants/utils/index.mjs.map [22m[32m71.00 B[39m
|
|
118
|
-
[32mESM[39m [1mdist/openai-assistants/index.mjs.map [22m[32m71.00 B[39m
|
|
119
|
-
[32mESM[39m [1mdist/types/frontend-action.mjs.map [22m[32m71.00 B[39m
|
|
120
|
-
[32mESM[39m [1mdist/types/index.mjs.map [22m[32m71.00 B[39m
|
|
121
|
-
[32mESM[39m [1mdist/types/system-message.mjs.map [22m[32m71.00 B[39m
|
|
122
|
-
[32mESM[39m [1mdist/utils/utils.test.mjs.map [22m[32m352.00 B[39m
|
|
123
|
-
[32mESM[39m [1mdist/utils/utils.mjs.map [22m[32m71.00 B[39m
|
|
124
|
-
[32mESM[39m [1mdist/hooks/use-copilot-chat.mjs.map [22m[32m71.00 B[39m
|
|
125
|
-
[32mESM[39m [1mdist/hooks/use-flat-category-store.mjs.map [22m[32m71.00 B[39m
|
|
126
|
-
[32mESM[39m [1mdist/hooks/use-make-copilot-actionable.mjs.map [22m[32m71.00 B[39m
|
|
127
|
-
[32mESM[39m [1mdist/hooks/use-make-copilot-document-readable.mjs.map [22m[32m71.00 B[39m
|
|
128
|
-
[32mESM[39m [1mdist/hooks/use-make-copilot-readable.mjs.map [22m[32m71.00 B[39m
|
|
129
|
-
[32mESM[39m [1mdist/hooks/use-tree.mjs.map [22m[32m71.00 B[39m
|
|
130
|
-
[32mESM[39m [1mdist/lib/index.mjs.map [22m[32m71.00 B[39m
|
|
131
|
-
[32mESM[39m ⚡️ Build success in 186ms
|
|
132
|
-
[32mCJS[39m [1mdist/index.js [22m[32m40.44 KB[39m
|
|
133
|
-
[32mCJS[39m [1mdist/components/index.js [22m[32m15.02 KB[39m
|
|
134
|
-
[32mCJS[39m [1mdist/context/copilot-context.js [22m[32m3.66 KB[39m
|
|
135
|
-
[32mCJS[39m [1mdist/context/index.js [22m[32m3.64 KB[39m
|
|
136
|
-
[32mCJS[39m [1mdist/hooks/index.js [22m[32m21.29 KB[39m
|
|
137
|
-
[32mCJS[39m [1mdist/hooks/use-chat.js [22m[32m11.27 KB[39m
|
|
138
|
-
[32mCJS[39m [1mdist/hooks/use-copilot-action-implementation.js [22m[32m6.57 KB[39m
|
|
139
|
-
[32mCJS[39m [1mdist/hooks/use-copilot-action.js [22m[32m5.17 KB[39m
|
|
140
|
-
[32mCJS[39m [1mdist/hooks/use-copilot-chat.js [22m[32m16.00 KB[39m
|
|
141
|
-
[32mCJS[39m [1mdist/hooks/use-flat-category-store.js [22m[32m2.87 KB[39m
|
|
142
|
-
[32mCJS[39m [1mdist/hooks/use-make-copilot-actionable.js [22m[32m6.12 KB[39m
|
|
143
|
-
[32mCJS[39m [1mdist/hooks/use-make-copilot-document-readable.js [22m[32m4.26 KB[39m
|
|
144
|
-
[32mCJS[39m [1mdist/hooks/use-make-copilot-readable.js [22m[32m4.14 KB[39m
|
|
145
|
-
[32mCJS[39m [1mdist/hooks/use-tree.js [22m[32m5.53 KB[39m
|
|
146
|
-
[32mCJS[39m [1mdist/lib/copilot-task.js [22m[32m7.38 KB[39m
|
|
147
|
-
[32mCJS[39m [1mdist/lib/index.js [22m[32m7.34 KB[39m
|
|
148
|
-
[32mCJS[39m [1mdist/openai-assistants/index.js [22m[32m9.35 KB[39m
|
|
149
|
-
[32mCJS[39m [1mdist/types/document-pointer.js [22m[32m841.00 B[39m
|
|
150
|
-
[32mCJS[39m [1mdist/types/frontend-action.js [22m[32m837.00 B[39m
|
|
151
|
-
[32mCJS[39m [1mdist/types/index.js [22m[32m797.00 B[39m
|
|
152
|
-
[32mCJS[39m [1mdist/types/system-message.js [22m[32m833.00 B[39m
|
|
153
|
-
[32mCJS[39m [1mdist/utils/fetch-chat-completion.js [22m[32m4.95 KB[39m
|
|
154
|
-
[32mCJS[39m [1mdist/utils/utils.test.js [22m[32m184.00 B[39m
|
|
155
|
-
[32mCJS[39m [1mdist/utils/utils.js [22m[32m797.00 B[39m
|
|
156
|
-
[32mCJS[39m [1mdist/components/copilot-provider/copilotkit-props.js [22m[32m878.00 B[39m
|
|
157
|
-
[32mCJS[39m [1mdist/components/copilot-provider/copilotkit.js [22m[32m15.01 KB[39m
|
|
158
|
-
[32mCJS[39m [1mdist/components/copilot-provider/index.js [22m[32m15.06 KB[39m
|
|
159
|
-
[32mCJS[39m [1mdist/components/copilot-provider/standard-copilot-api-config.js [22m[32m1.48 KB[39m
|
|
160
|
-
[32mCJS[39m [1mdist/openai-assistants/hooks/index.js [22m[32m9.25 KB[39m
|
|
161
|
-
[32mCJS[39m [1mdist/openai-assistants/hooks/use-assistants.js [22m[32m4.82 KB[39m
|
|
162
|
-
[32mCJS[39m [1mdist/openai-assistants/hooks/use-copilot-chat-v2.js [22m[32m9.34 KB[39m
|
|
163
|
-
[32mCJS[39m [1mdist/openai-assistants/utils/index.js [22m[32m2.30 KB[39m
|
|
164
|
-
[32mCJS[39m [1mdist/openai-assistants/utils/process-message-stream.js [22m[32m2.33 KB[39m
|
|
165
|
-
[32mCJS[39m [1mdist/index.js.map [22m[32m76.80 KB[39m
|
|
166
|
-
[32mCJS[39m [1mdist/components/index.js.map [22m[32m27.07 KB[39m
|
|
167
|
-
[32mCJS[39m [1mdist/context/copilot-context.js.map [22m[32m4.86 KB[39m
|
|
168
|
-
[32mCJS[39m [1mdist/context/index.js.map [22m[32m5.09 KB[39m
|
|
169
|
-
[32mCJS[39m [1mdist/hooks/index.js.map [22m[32m46.27 KB[39m
|
|
170
|
-
[32mCJS[39m [1mdist/hooks/use-chat.js.map [22m[32m17.88 KB[39m
|
|
171
|
-
[32mCJS[39m [1mdist/hooks/use-copilot-action-implementation.js.map [22m[32m10.69 KB[39m
|
|
172
|
-
[32mCJS[39m [1mdist/hooks/use-copilot-action.js.map [22m[32m11.43 KB[39m
|
|
173
|
-
[32mCJS[39m [1mdist/hooks/use-copilot-chat.js.map [22m[32m33.57 KB[39m
|
|
174
|
-
[32mCJS[39m [1mdist/hooks/use-flat-category-store.js.map [22m[32m4.25 KB[39m
|
|
175
|
-
[32mCJS[39m [1mdist/hooks/use-make-copilot-actionable.js.map [22m[32m11.82 KB[39m
|
|
176
|
-
[32mCJS[39m [1mdist/hooks/use-make-copilot-document-readable.js.map [22m[32m6.17 KB[39m
|
|
177
|
-
[32mCJS[39m [1mdist/hooks/use-make-copilot-readable.js.map [22m[32m6.22 KB[39m
|
|
178
|
-
[32mCJS[39m [1mdist/hooks/use-tree.js.map [22m[32m8.32 KB[39m
|
|
179
|
-
[32mCJS[39m [1mdist/lib/copilot-task.js.map [22m[32m16.37 KB[39m
|
|
180
|
-
[32mCJS[39m [1mdist/lib/index.js.map [22m[32m16.43 KB[39m
|
|
181
|
-
[32mCJS[39m [1mdist/openai-assistants/index.js.map [22m[32m20.32 KB[39m
|
|
182
|
-
[32mCJS[39m [1mdist/types/document-pointer.js.map [22m[32m292.00 B[39m
|
|
183
|
-
[32mCJS[39m [1mdist/types/frontend-action.js.map [22m[32m1.70 KB[39m
|
|
184
|
-
[32mCJS[39m [1mdist/types/index.js.map [22m[32m253.00 B[39m
|
|
185
|
-
[32mCJS[39m [1mdist/types/system-message.js.map [22m[32m249.00 B[39m
|
|
186
|
-
[32mCJS[39m [1mdist/utils/fetch-chat-completion.js.map [22m[32m4.79 KB[39m
|
|
187
|
-
[32mCJS[39m [1mdist/utils/utils.test.js.map [22m[32m354.00 B[39m
|
|
188
|
-
[32mCJS[39m [1mdist/utils/utils.js.map [22m[32m137.00 B[39m
|
|
189
|
-
[32mCJS[39m [1mdist/components/copilot-provider/copilotkit-props.js.map [22m[32m1.12 KB[39m
|
|
190
|
-
[32mCJS[39m [1mdist/components/copilot-provider/copilotkit.js.map [22m[32m27.01 KB[39m
|
|
191
|
-
[32mCJS[39m [1mdist/components/copilot-provider/index.js.map [22m[32m27.20 KB[39m
|
|
192
|
-
[32mCJS[39m [1mdist/components/copilot-provider/standard-copilot-api-config.js.map [22m[32m1.17 KB[39m
|
|
193
|
-
[32mCJS[39m [1mdist/openai-assistants/hooks/index.js.map [22m[32m20.62 KB[39m
|
|
194
|
-
[32mCJS[39m [1mdist/openai-assistants/hooks/use-assistants.js.map [22m[32m5.92 KB[39m
|
|
195
|
-
[32mCJS[39m [1mdist/openai-assistants/hooks/use-copilot-chat-v2.js.map [22m[32m20.23 KB[39m
|
|
196
|
-
[32mCJS[39m [1mdist/openai-assistants/utils/index.js.map [22m[32m1.44 KB[39m
|
|
197
|
-
[32mCJS[39m [1mdist/openai-assistants/utils/process-message-stream.js.map [22m[32m1.33 KB[39m
|
|
198
|
-
[32mCJS[39m ⚡️ Build success in 217ms
|
|
198
|
+
[32mESM[39m ⚡️ Build success in 272ms
|
|
199
199
|
[34mDTS[39m Build start
|
|
200
|
-
[32mDTS[39m ⚡️ Build success in
|
|
200
|
+
[32mDTS[39m ⚡️ Build success in 6127ms
|
|
201
201
|
[32mDTS[39m [1mdist/index.d.ts [22m[32m1.51 KB[39m
|
|
202
202
|
[32mDTS[39m [1mdist/components/copilot-provider/copilotkit.d.ts [22m[32m1.26 KB[39m
|
|
203
203
|
[32mDTS[39m [1mdist/components/copilot-provider/copilotkit-props.d.ts [22m[32m1007.00 B[39m
|
|
@@ -219,7 +219,7 @@
|
|
|
219
219
|
[32mDTS[39m [1mdist/components/index.d.ts [22m[32m186.00 B[39m
|
|
220
220
|
[32mDTS[39m [1mdist/context/index.d.ts [22m[32m267.00 B[39m
|
|
221
221
|
[32mDTS[39m [1mdist/hooks/index.d.ts [22m[32m672.00 B[39m
|
|
222
|
-
[32mDTS[39m [1mdist/hooks/use-copilot-action-implementation.d.ts [22m[
|
|
222
|
+
[32mDTS[39m [1mdist/hooks/use-copilot-action-implementation.d.ts [22m[32m283.00 B[39m
|
|
223
223
|
[32mDTS[39m [1mdist/hooks/use-flat-category-store.d.ts [22m[32m424.00 B[39m
|
|
224
224
|
[32mDTS[39m [1mdist/lib/index.d.ts [22m[32m261.00 B[39m
|
|
225
225
|
[32mDTS[39m [1mdist/openai-assistants/index.d.ts [22m[32m262.00 B[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,43 @@
|
|
|
1
1
|
# ui
|
|
2
2
|
|
|
3
|
+
## 0.21.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- c4010e7: Pre Release
|
|
8
|
+
- be00d61: Alpha
|
|
9
|
+
- ec8481c: Alpha
|
|
10
|
+
- 3fbee5d: OpenAIAdapter-getter
|
|
11
|
+
- e09dc44: Test backward compatibility of AnnotatedFunction on the backend
|
|
12
|
+
- 3f5ad60: OpenAIAdapter: make openai instance gettable
|
|
13
|
+
- 0dd6180: QA
|
|
14
|
+
- 225812d: QA new action type
|
|
15
|
+
- New actions: custom chat components, and typed arguments
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- Updated dependencies [c4010e7]
|
|
20
|
+
- Updated dependencies [be00d61]
|
|
21
|
+
- Updated dependencies [ec8481c]
|
|
22
|
+
- Updated dependencies [3fbee5d]
|
|
23
|
+
- Updated dependencies [e09dc44]
|
|
24
|
+
- Updated dependencies [3f5ad60]
|
|
25
|
+
- Updated dependencies [0dd6180]
|
|
26
|
+
- Updated dependencies [225812d]
|
|
27
|
+
- Updated dependencies
|
|
28
|
+
- @copilotkit/shared@0.5.0
|
|
29
|
+
|
|
30
|
+
## 0.21.0-mme-deprecate-annotated-function.4
|
|
31
|
+
|
|
32
|
+
### Minor Changes
|
|
33
|
+
|
|
34
|
+
- Test backward compatibility of AnnotatedFunction on the backend
|
|
35
|
+
|
|
36
|
+
### Patch Changes
|
|
37
|
+
|
|
38
|
+
- Updated dependencies
|
|
39
|
+
- @copilotkit/shared@0.5.0-mme-deprecate-annotated-function.4
|
|
40
|
+
|
|
3
41
|
## 0.21.0-mme-pre-release.3
|
|
4
42
|
|
|
5
43
|
### Minor Changes
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
annotatedFunctionToAction
|
|
3
|
-
} from "./chunk-UQKARKHD.mjs";
|
|
4
1
|
import {
|
|
5
2
|
CopilotContext
|
|
6
3
|
} from "./chunk-DVLYNQG4.mjs";
|
|
@@ -8,6 +5,7 @@ import {
|
|
|
8
5
|
// src/hooks/use-make-copilot-actionable.ts
|
|
9
6
|
import { useRef, useContext, useEffect, useMemo } from "react";
|
|
10
7
|
import { nanoid } from "nanoid";
|
|
8
|
+
import { annotatedFunctionToAction } from "@copilotkit/shared";
|
|
11
9
|
function useMakeCopilotActionable(annotatedFunction, dependencies) {
|
|
12
10
|
const idRef = useRef(nanoid());
|
|
13
11
|
const { setEntryPoint, removeEntryPoint } = useContext(CopilotContext);
|
|
@@ -32,4 +30,4 @@ function useMakeCopilotActionable(annotatedFunction, dependencies) {
|
|
|
32
30
|
export {
|
|
33
31
|
useMakeCopilotActionable
|
|
34
32
|
};
|
|
35
|
-
//# sourceMappingURL=chunk-
|
|
33
|
+
//# sourceMappingURL=chunk-JECDOVIL.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/hooks/use-make-copilot-actionable.ts"],"sourcesContent":["\"use client\";\n\nimport { useRef, useContext, useEffect, useMemo } from \"react\";\nimport { CopilotContext } from \"../context/copilot-context\";\nimport { AnnotatedFunction } from \"@copilotkit/shared\";\nimport { nanoid } from \"nanoid\";\nimport { annotatedFunctionToAction } from \"@copilotkit/shared\";\n\n/**\n * @deprecated Use the useCopilotAction function instead.\n */\nexport function useMakeCopilotActionable<ActionInput extends any[]>(\n annotatedFunction: AnnotatedFunction<ActionInput>,\n dependencies: any[],\n) {\n const idRef = useRef(nanoid()); // generate a unique id\n const { setEntryPoint, removeEntryPoint } = useContext(CopilotContext);\n\n const memoizedAnnotatedFunction: AnnotatedFunction<ActionInput> = useMemo(\n () => ({\n name: annotatedFunction.name,\n description: annotatedFunction.description,\n argumentAnnotations: annotatedFunction.argumentAnnotations,\n implementation: annotatedFunction.implementation,\n }),\n dependencies,\n );\n\n useEffect(() => {\n const action = annotatedFunctionToAction(memoizedAnnotatedFunction as AnnotatedFunction<any[]>);\n setEntryPoint(idRef.current, action);\n\n return () => {\n removeEntryPoint(idRef.current);\n };\n }, [memoizedAnnotatedFunction, setEntryPoint, removeEntryPoint]);\n}\n"],"mappings":";;;;;AAEA,SAAS,QAAQ,YAAY,WAAW,eAAe;AAGvD,SAAS,cAAc;AACvB,SAAS,iCAAiC;AAKnC,SAAS,yBACd,mBACA,cACA;AACA,QAAM,QAAQ,OAAO,OAAO,CAAC;AAC7B,QAAM,EAAE,eAAe,iBAAiB,IAAI,WAAW,cAAc;AAErE,QAAM,4BAA4D;AAAA,IAChE,OAAO;AAAA,MACL,MAAM,kBAAkB;AAAA,MACxB,aAAa,kBAAkB;AAAA,MAC/B,qBAAqB,kBAAkB;AAAA,MACvC,gBAAgB,kBAAkB;AAAA,IACpC;AAAA,IACA;AAAA,EACF;AAEA,YAAU,MAAM;AACd,UAAM,SAAS,0BAA0B,yBAAqD;AAC9F,kBAAc,MAAM,SAAS,MAAM;AAEnC,WAAO,MAAM;AACX,uBAAiB,MAAM,OAAO;AAAA,IAChC;AAAA,EACF,GAAG,CAAC,2BAA2B,eAAe,gBAAgB,CAAC;AACjE;","names":[]}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CopilotContext
|
|
3
|
+
} from "./chunk-DVLYNQG4.mjs";
|
|
4
|
+
|
|
5
|
+
// src/hooks/use-copilot-action-implementation.ts
|
|
6
|
+
import { useRef, useContext, useEffect } from "react";
|
|
7
|
+
import { nanoid } from "nanoid";
|
|
8
|
+
function useCopilotActionImplementation(action, dependencies) {
|
|
9
|
+
const { setEntryPoint, removeEntryPoint, entryPoints, chatComponentsCache } = useContext(CopilotContext);
|
|
10
|
+
const idRef = useRef(nanoid());
|
|
11
|
+
if (dependencies === void 0) {
|
|
12
|
+
if (entryPoints[idRef.current]) {
|
|
13
|
+
entryPoints[idRef.current].handler = action.handler;
|
|
14
|
+
if (typeof action.render === "function") {
|
|
15
|
+
if (chatComponentsCache.current !== null) {
|
|
16
|
+
chatComponentsCache.current[action.name] = action.render;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
setEntryPoint(idRef.current, action);
|
|
23
|
+
if (chatComponentsCache.current !== null && action.render !== void 0) {
|
|
24
|
+
chatComponentsCache.current[action.name] = action.render;
|
|
25
|
+
}
|
|
26
|
+
return () => {
|
|
27
|
+
removeEntryPoint(idRef.current);
|
|
28
|
+
};
|
|
29
|
+
}, [
|
|
30
|
+
setEntryPoint,
|
|
31
|
+
removeEntryPoint,
|
|
32
|
+
action.description,
|
|
33
|
+
action.name,
|
|
34
|
+
// This should be faster than deep equality checking
|
|
35
|
+
// In addition, all major JS engines guarantee the order of object keys
|
|
36
|
+
JSON.stringify(action.parameters),
|
|
37
|
+
// include render only if it's a string
|
|
38
|
+
typeof action.render === "string" ? action.render : void 0,
|
|
39
|
+
// dependencies set by the developer
|
|
40
|
+
...dependencies || []
|
|
41
|
+
]);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export {
|
|
45
|
+
useCopilotActionImplementation
|
|
46
|
+
};
|
|
47
|
+
//# sourceMappingURL=chunk-K3HLWC4F.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/hooks/use-copilot-action-implementation.ts"],"sourcesContent":["\"use client\";\n\nimport { Action, AnnotatedFunction, Parameter } from \"@copilotkit/shared\";\nimport { useRef, useContext, useEffect } from \"react\";\nimport { FrontendAction } from \"../types/frontend-action\";\nimport { CopilotContext } from \"../context/copilot-context\";\nimport { nanoid } from \"nanoid\";\n\n// We implement useCopilotActionImplementation dependency handling so that\n// the developer has the option to not provide any dependencies.\n// In this case, we assume they want to update the handler on each rerender.\n// To avoid getting stuck in an infinite loop, we update the handler directly,\n// skipping React state updates.\n// This is ok in this case, because the handler is not part of any UI that\n// needs to be updated.\n// useCallback, useMemo or other memoization techniques are not suitable here,\n// because they will cause a infinite rerender loop.\nexport function useCopilotActionImplementation<T extends Array<any> = []>(\n action: FrontendAction<T>,\n dependencies?: any[],\n): void {\n const { setEntryPoint, removeEntryPoint, entryPoints, chatComponentsCache } =\n useContext(CopilotContext);\n const idRef = useRef<string>(nanoid());\n\n // If the developer doesn't provide dependencies, we assume they want to\n // update handler and render function when the action object changes.\n // This ensures that any captured variables in the handler are up to date.\n if (dependencies === undefined) {\n if (entryPoints[idRef.current]) {\n entryPoints[idRef.current].handler = action.handler;\n if (typeof action.render === \"function\") {\n if (chatComponentsCache.current !== null) {\n chatComponentsCache.current[action.name] = action.render;\n }\n }\n }\n }\n\n useEffect(() => {\n setEntryPoint(idRef.current, action);\n if (chatComponentsCache.current !== null && action.render !== undefined) {\n chatComponentsCache.current[action.name] = action.render;\n }\n return () => {\n // NOTE: For now, we don't remove the chatComponentsCache entry when the action is removed.\n // This is because we currently don't have access to the messages array in CopilotContext.\n removeEntryPoint(idRef.current);\n };\n }, [\n setEntryPoint,\n removeEntryPoint,\n action.description,\n action.name,\n // This should be faster than deep equality checking\n // In addition, all major JS engines guarantee the order of object keys\n JSON.stringify(action.parameters),\n // include render only if it's a string\n typeof action.render === \"string\" ? action.render : undefined,\n // dependencies set by the developer\n ...(dependencies || []),\n ]);\n}\n"],"mappings":";;;;;AAGA,SAAS,QAAQ,YAAY,iBAAiB;AAG9C,SAAS,cAAc;AAWhB,SAAS,+BACd,QACA,cACM;AACN,QAAM,EAAE,eAAe,kBAAkB,aAAa,oBAAoB,IACxE,WAAW,cAAc;AAC3B,QAAM,QAAQ,OAAe,OAAO,CAAC;AAKrC,MAAI,iBAAiB,QAAW;AAC9B,QAAI,YAAY,MAAM,OAAO,GAAG;AAC9B,kBAAY,MAAM,OAAO,EAAE,UAAU,OAAO;AAC5C,UAAI,OAAO,OAAO,WAAW,YAAY;AACvC,YAAI,oBAAoB,YAAY,MAAM;AACxC,8BAAoB,QAAQ,OAAO,IAAI,IAAI,OAAO;AAAA,QACpD;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAEA,YAAU,MAAM;AACd,kBAAc,MAAM,SAAS,MAAM;AACnC,QAAI,oBAAoB,YAAY,QAAQ,OAAO,WAAW,QAAW;AACvE,0BAAoB,QAAQ,OAAO,IAAI,IAAI,OAAO;AAAA,IACpD;AACA,WAAO,MAAM;AAGX,uBAAiB,MAAM,OAAO;AAAA,IAChC;AAAA,EACF,GAAG;AAAA,IACD;AAAA,IACA;AAAA,IACA,OAAO;AAAA,IACP,OAAO;AAAA;AAAA;AAAA,IAGP,KAAK,UAAU,OAAO,UAAU;AAAA;AAAA,IAEhC,OAAO,OAAO,WAAW,WAAW,OAAO,SAAS;AAAA;AAAA,IAEpD,GAAI,gBAAgB,CAAC;AAAA,EACvB,CAAC;AACH;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useCopilotActionImplementation
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-K3HLWC4F.mjs";
|
|
4
4
|
|
|
5
5
|
// src/hooks/use-copilot-action.ts
|
|
6
6
|
function useCopilotAction(action, dependencies) {
|
|
@@ -10,4 +10,4 @@ function useCopilotAction(action, dependencies) {
|
|
|
10
10
|
export {
|
|
11
11
|
useCopilotAction
|
|
12
12
|
};
|
|
13
|
-
//# sourceMappingURL=chunk-
|
|
13
|
+
//# sourceMappingURL=chunk-PO5VE42C.mjs.map
|
package/dist/hooks/index.js
CHANGED
|
@@ -451,15 +451,36 @@ ${additionalInstructions}` : "");
|
|
|
451
451
|
}
|
|
452
452
|
|
|
453
453
|
// src/hooks/use-make-copilot-actionable.ts
|
|
454
|
-
var import_react6 = require("react");
|
|
455
|
-
var import_nanoid3 = require("nanoid");
|
|
456
|
-
|
|
457
|
-
// src/hooks/use-copilot-action-implementation.ts
|
|
458
454
|
var import_react5 = require("react");
|
|
459
455
|
var import_nanoid2 = require("nanoid");
|
|
460
|
-
|
|
461
|
-
|
|
456
|
+
var import_shared4 = require("@copilotkit/shared");
|
|
457
|
+
function useMakeCopilotActionable(annotatedFunction, dependencies) {
|
|
462
458
|
const idRef = (0, import_react5.useRef)((0, import_nanoid2.nanoid)());
|
|
459
|
+
const { setEntryPoint, removeEntryPoint } = (0, import_react5.useContext)(CopilotContext);
|
|
460
|
+
const memoizedAnnotatedFunction = (0, import_react5.useMemo)(
|
|
461
|
+
() => ({
|
|
462
|
+
name: annotatedFunction.name,
|
|
463
|
+
description: annotatedFunction.description,
|
|
464
|
+
argumentAnnotations: annotatedFunction.argumentAnnotations,
|
|
465
|
+
implementation: annotatedFunction.implementation
|
|
466
|
+
}),
|
|
467
|
+
dependencies
|
|
468
|
+
);
|
|
469
|
+
(0, import_react5.useEffect)(() => {
|
|
470
|
+
const action = (0, import_shared4.annotatedFunctionToAction)(memoizedAnnotatedFunction);
|
|
471
|
+
setEntryPoint(idRef.current, action);
|
|
472
|
+
return () => {
|
|
473
|
+
removeEntryPoint(idRef.current);
|
|
474
|
+
};
|
|
475
|
+
}, [memoizedAnnotatedFunction, setEntryPoint, removeEntryPoint]);
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
// src/hooks/use-copilot-action-implementation.ts
|
|
479
|
+
var import_react6 = require("react");
|
|
480
|
+
var import_nanoid3 = require("nanoid");
|
|
481
|
+
function useCopilotActionImplementation(action, dependencies) {
|
|
482
|
+
const { setEntryPoint, removeEntryPoint, entryPoints, chatComponentsCache } = (0, import_react6.useContext)(CopilotContext);
|
|
483
|
+
const idRef = (0, import_react6.useRef)((0, import_nanoid3.nanoid)());
|
|
463
484
|
if (dependencies === void 0) {
|
|
464
485
|
if (entryPoints[idRef.current]) {
|
|
465
486
|
entryPoints[idRef.current].handler = action.handler;
|
|
@@ -470,7 +491,7 @@ function useCopilotActionImplementation(action, dependencies) {
|
|
|
470
491
|
}
|
|
471
492
|
}
|
|
472
493
|
}
|
|
473
|
-
(0,
|
|
494
|
+
(0, import_react6.useEffect)(() => {
|
|
474
495
|
setEntryPoint(idRef.current, action);
|
|
475
496
|
if (chatComponentsCache.current !== null && action.render !== void 0) {
|
|
476
497
|
chatComponentsCache.current[action.name] = action.render;
|
|
@@ -492,75 +513,6 @@ function useCopilotActionImplementation(action, dependencies) {
|
|
|
492
513
|
...dependencies || []
|
|
493
514
|
]);
|
|
494
515
|
}
|
|
495
|
-
function annotatedFunctionToAction(annotatedFunction) {
|
|
496
|
-
const parameters = annotatedFunction.argumentAnnotations.map((annotation) => {
|
|
497
|
-
switch (annotation.type) {
|
|
498
|
-
case "string":
|
|
499
|
-
case "number":
|
|
500
|
-
case "boolean":
|
|
501
|
-
case "object":
|
|
502
|
-
return {
|
|
503
|
-
name: annotation.name,
|
|
504
|
-
description: annotation.description,
|
|
505
|
-
type: annotation.type,
|
|
506
|
-
required: annotation.required
|
|
507
|
-
};
|
|
508
|
-
case "array":
|
|
509
|
-
let type;
|
|
510
|
-
if (annotation.items.type === "string") {
|
|
511
|
-
type = "string[]";
|
|
512
|
-
} else if (annotation.items.type === "number") {
|
|
513
|
-
type = "number[]";
|
|
514
|
-
} else if (annotation.items.type === "boolean") {
|
|
515
|
-
type = "boolean[]";
|
|
516
|
-
} else if (annotation.items.type === "object") {
|
|
517
|
-
type = "object[]";
|
|
518
|
-
} else {
|
|
519
|
-
type = "string[]";
|
|
520
|
-
}
|
|
521
|
-
return {
|
|
522
|
-
name: annotation.name,
|
|
523
|
-
description: annotation.description,
|
|
524
|
-
type,
|
|
525
|
-
required: annotation.required
|
|
526
|
-
};
|
|
527
|
-
}
|
|
528
|
-
});
|
|
529
|
-
return {
|
|
530
|
-
name: annotatedFunction.name,
|
|
531
|
-
description: annotatedFunction.description,
|
|
532
|
-
parameters,
|
|
533
|
-
handler: (args) => {
|
|
534
|
-
const paramsInCorrectOrder = [];
|
|
535
|
-
for (let arg of annotatedFunction.argumentAnnotations) {
|
|
536
|
-
paramsInCorrectOrder.push(args[arg.name]);
|
|
537
|
-
}
|
|
538
|
-
return annotatedFunction.implementation(...paramsInCorrectOrder);
|
|
539
|
-
}
|
|
540
|
-
};
|
|
541
|
-
}
|
|
542
|
-
|
|
543
|
-
// src/hooks/use-make-copilot-actionable.ts
|
|
544
|
-
function useMakeCopilotActionable(annotatedFunction, dependencies) {
|
|
545
|
-
const idRef = (0, import_react6.useRef)((0, import_nanoid3.nanoid)());
|
|
546
|
-
const { setEntryPoint, removeEntryPoint } = (0, import_react6.useContext)(CopilotContext);
|
|
547
|
-
const memoizedAnnotatedFunction = (0, import_react6.useMemo)(
|
|
548
|
-
() => ({
|
|
549
|
-
name: annotatedFunction.name,
|
|
550
|
-
description: annotatedFunction.description,
|
|
551
|
-
argumentAnnotations: annotatedFunction.argumentAnnotations,
|
|
552
|
-
implementation: annotatedFunction.implementation
|
|
553
|
-
}),
|
|
554
|
-
dependencies
|
|
555
|
-
);
|
|
556
|
-
(0, import_react6.useEffect)(() => {
|
|
557
|
-
const action = annotatedFunctionToAction(memoizedAnnotatedFunction);
|
|
558
|
-
setEntryPoint(idRef.current, action);
|
|
559
|
-
return () => {
|
|
560
|
-
removeEntryPoint(idRef.current);
|
|
561
|
-
};
|
|
562
|
-
}, [memoizedAnnotatedFunction, setEntryPoint, removeEntryPoint]);
|
|
563
|
-
}
|
|
564
516
|
|
|
565
517
|
// src/hooks/use-copilot-action.ts
|
|
566
518
|
function useCopilotAction(action, dependencies) {
|