@copilotkit/react-core 0.25.0-multi-release-alpha.0 → 0.25.0-multi-feature-usecopilotreadable.3
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 +165 -162
- package/CHANGELOG.md +36 -3
- package/dist/chunk-5L5PJJNT.mjs +28 -0
- package/dist/chunk-5L5PJJNT.mjs.map +1 -0
- package/dist/{chunk-GVLCTSXW.mjs → chunk-BCKOSVRB.mjs} +2 -2
- package/dist/{chunk-KJQZ2VEU.mjs → chunk-EABGYUTZ.mjs} +1 -1
- package/dist/chunk-EABGYUTZ.mjs.map +1 -0
- package/dist/chunk-EYKDJBDE.mjs +1 -0
- package/dist/{chunk-QGRMN7L3.mjs → chunk-L45P674M.mjs} +4 -4
- package/dist/chunk-L45P674M.mjs.map +1 -0
- package/dist/{chunk-AEUR5JBT.mjs → chunk-X3FZ6GTK.mjs} +11 -1
- package/dist/chunk-X3FZ6GTK.mjs.map +1 -0
- package/dist/components/copilot-provider/copilotkit.mjs +9 -435
- package/dist/components/copilot-provider/copilotkit.mjs.map +1 -1
- package/dist/components/copilot-provider/index.mjs +10 -435
- package/dist/components/copilot-provider/index.mjs.map +1 -1
- package/dist/components/copilot-provider/standard-copilot-api-config.mjs +4 -9
- package/dist/components/copilot-provider/standard-copilot-api-config.mjs.map +1 -1
- package/dist/components/index.mjs +11 -435
- package/dist/components/index.mjs.map +1 -1
- package/dist/context/copilot-context.mjs +5 -64
- package/dist/context/copilot-context.mjs.map +1 -1
- package/dist/context/index.mjs +6 -64
- package/dist/context/index.mjs.map +1 -1
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.js +22 -0
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs +29 -528
- package/dist/hooks/index.mjs.map +1 -1
- package/dist/hooks/use-chat.mjs +4 -295
- package/dist/hooks/use-chat.mjs.map +1 -1
- package/dist/hooks/use-copilot-action-implementation.mjs +5 -102
- package/dist/hooks/use-copilot-action-implementation.mjs.map +1 -1
- package/dist/hooks/use-copilot-action.mjs +6 -107
- package/dist/hooks/use-copilot-action.mjs.map +1 -1
- package/dist/hooks/use-copilot-chat.mjs +13 -430
- package/dist/hooks/use-copilot-chat.mjs.map +1 -1
- package/dist/hooks/use-copilot-readable.d.ts +33 -0
- package/dist/hooks/use-copilot-readable.js +121 -0
- package/dist/hooks/use-copilot-readable.js.map +1 -0
- package/dist/hooks/use-copilot-readable.mjs +9 -0
- package/dist/hooks/use-copilot-readable.mjs.map +1 -0
- package/dist/hooks/use-flat-category-store.mjs +4 -65
- package/dist/hooks/use-flat-category-store.mjs.map +1 -1
- package/dist/hooks/use-make-copilot-actionable.mjs +5 -88
- package/dist/hooks/use-make-copilot-actionable.mjs.map +1 -1
- package/dist/hooks/use-make-copilot-document-readable.mjs +5 -78
- package/dist/hooks/use-make-copilot-document-readable.mjs.map +1 -1
- package/dist/hooks/use-make-copilot-readable.d.ts +1 -5
- package/dist/hooks/use-make-copilot-readable.js.map +1 -1
- package/dist/hooks/use-make-copilot-readable.mjs +5 -78
- package/dist/hooks/use-make-copilot-readable.mjs.map +1 -1
- package/dist/hooks/use-tree.mjs +4 -150
- package/dist/hooks/use-tree.mjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +33 -11
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +54 -1113
- package/dist/index.mjs.map +1 -1
- package/dist/lib/copilot-task.d.ts +7 -2
- package/dist/lib/copilot-task.js +3 -3
- package/dist/lib/copilot-task.js.map +1 -1
- package/dist/lib/copilot-task.mjs +11 -192
- package/dist/lib/copilot-task.mjs.map +1 -1
- package/dist/lib/index.js +3 -3
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/index.mjs +12 -192
- package/dist/lib/index.mjs.map +1 -1
- package/dist/openai-assistants/hooks/index.mjs +15 -228
- package/dist/openai-assistants/hooks/index.mjs.map +1 -1
- package/dist/openai-assistants/hooks/use-assistants.mjs +7 -45
- package/dist/openai-assistants/hooks/use-assistants.mjs.map +1 -1
- package/dist/openai-assistants/hooks/use-copilot-chat-v2.mjs +15 -228
- package/dist/openai-assistants/hooks/use-copilot-chat-v2.mjs.map +1 -1
- package/dist/openai-assistants/index.mjs +18 -228
- package/dist/openai-assistants/index.mjs.map +1 -1
- package/dist/openai-assistants/utils/index.mjs +5 -43
- package/dist/openai-assistants/utils/index.mjs.map +1 -1
- package/dist/openai-assistants/utils/process-message-stream.mjs +4 -43
- package/dist/openai-assistants/utils/process-message-stream.mjs.map +1 -1
- package/dist/types/index.mjs +1 -0
- package/dist/utils/fetch-chat-completion.mjs +5 -112
- package/dist/utils/fetch-chat-completion.mjs.map +1 -1
- package/package.json +4 -4
- package/src/hooks/index.ts +1 -0
- package/src/hooks/use-copilot-readable.ts +60 -0
- package/src/hooks/use-make-copilot-readable.ts +1 -5
- package/src/lib/copilot-task.ts +12 -5
- package/dist/chunk-AEUR5JBT.mjs.map +0 -1
- package/dist/chunk-IOP6JX34.mjs +0 -1
- package/dist/chunk-KJQZ2VEU.mjs.map +0 -1
- package/dist/chunk-QGRMN7L3.mjs.map +0 -1
- /package/dist/{chunk-GVLCTSXW.mjs.map → chunk-BCKOSVRB.mjs.map} +0 -0
- /package/dist/{chunk-IOP6JX34.mjs.map → chunk-EYKDJBDE.mjs.map} +0 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
Debugger attached.
|
|
2
1
|
|
|
3
|
-
> @copilotkit/react-core@0.25.0-function-calling-fixes.
|
|
2
|
+
> @copilotkit/react-core@0.25.0-function-calling-fixes.2 build /Users/ataibarkai/LocalGit/Recursively.ai/CopilotKit/CopilotKit/packages/react-core
|
|
4
3
|
> tsup --clean
|
|
5
4
|
|
|
6
|
-
|
|
7
|
-
CLI 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
|
|
5
|
+
CLI 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-copilot-readable.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
|
|
8
6
|
CLI Using tsconfig: tsconfig.json
|
|
9
7
|
CLI tsup v6.7.0
|
|
10
8
|
CLI Using tsup config: /Users/ataibarkai/LocalGit/Recursively.ai/CopilotKit/CopilotKit/packages/react-core/tsup.config.ts
|
|
@@ -12,215 +10,222 @@ CLI Target: es6
|
|
|
12
10
|
CLI Cleaning output folder
|
|
13
11
|
ESM Build start
|
|
14
12
|
CJS Build start
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
13
|
+
CJS dist/index.js 40.25 KB
|
|
14
|
+
CJS dist/hooks/use-tree.js 5.53 KB
|
|
15
|
+
CJS dist/types/document-pointer.js 841.00 B
|
|
16
|
+
CJS dist/utils/fetch-chat-completion.js 4.95 KB
|
|
17
|
+
CJS dist/openai-assistants/index.js 9.35 KB
|
|
18
|
+
CJS dist/lib/index.js 7.38 KB
|
|
19
|
+
CJS dist/types/system-message.js 833.00 B
|
|
20
|
+
CJS dist/utils/utils.test.js 184.00 B
|
|
21
|
+
CJS dist/lib/copilot-task.js 7.42 KB
|
|
22
|
+
CJS dist/utils/utils.js 797.00 B
|
|
23
|
+
CJS dist/types/index.js 797.00 B
|
|
24
|
+
CJS dist/types/frontend-action.js 837.00 B
|
|
25
|
+
CJS dist/components/copilot-provider/copilotkit-props.js 864.00 B
|
|
26
|
+
CJS dist/context/copilot-context.js 3.65 KB
|
|
27
|
+
CJS dist/hooks/use-copilot-action.js 5.16 KB
|
|
28
|
+
CJS dist/hooks/use-copilot-chat.js 16.25 KB
|
|
29
|
+
CJS dist/hooks/use-copilot-readable.js 4.36 KB
|
|
30
|
+
CJS dist/hooks/use-chat.js 11.52 KB
|
|
31
|
+
CJS dist/hooks/use-copilot-action-implementation.js 5.08 KB
|
|
32
|
+
CJS dist/context/index.js 3.64 KB
|
|
33
|
+
CJS dist/components/index.js 15.02 KB
|
|
34
|
+
CJS dist/hooks/use-make-copilot-readable.js 4.13 KB
|
|
35
|
+
CJS dist/components/copilot-provider/copilotkit.js 15.00 KB
|
|
36
|
+
CJS dist/components/copilot-provider/standard-copilot-api-config.js 1.48 KB
|
|
37
|
+
CJS dist/components/copilot-provider/index.js 15.06 KB
|
|
38
|
+
CJS dist/hooks/use-make-copilot-actionable.js 4.62 KB
|
|
39
|
+
CJS dist/hooks/index.js 21.04 KB
|
|
40
|
+
CJS dist/hooks/use-flat-category-store.js 2.87 KB
|
|
41
|
+
CJS dist/openai-assistants/hooks/use-assistants.js 4.81 KB
|
|
42
|
+
CJS dist/openai-assistants/utils/index.js 2.30 KB
|
|
43
|
+
CJS dist/openai-assistants/hooks/index.js 9.25 KB
|
|
44
|
+
CJS dist/openai-assistants/utils/process-message-stream.js 2.33 KB
|
|
45
|
+
CJS dist/openai-assistants/hooks/use-copilot-chat-v2.js 9.34 KB
|
|
46
|
+
CJS dist/hooks/use-make-copilot-document-readable.js 4.24 KB
|
|
47
|
+
CJS dist/index.js.map 76.98 KB
|
|
48
|
+
CJS dist/hooks/use-tree.js.map 8.32 KB
|
|
49
|
+
CJS dist/types/document-pointer.js.map 292.00 B
|
|
50
|
+
CJS dist/utils/fetch-chat-completion.js.map 4.79 KB
|
|
51
|
+
CJS dist/openai-assistants/index.js.map 20.45 KB
|
|
52
|
+
CJS dist/lib/index.js.map 16.70 KB
|
|
53
|
+
CJS dist/types/system-message.js.map 249.00 B
|
|
54
|
+
CJS dist/utils/utils.test.js.map 354.00 B
|
|
55
|
+
CJS dist/lib/copilot-task.js.map 16.64 KB
|
|
56
|
+
CJS dist/types/frontend-action.js.map 1.77 KB
|
|
57
|
+
CJS dist/types/index.js.map 338.00 B
|
|
58
|
+
CJS dist/utils/utils.js.map 137.00 B
|
|
59
|
+
CJS dist/components/copilot-provider/copilotkit-props.js.map 1.10 KB
|
|
60
|
+
CJS dist/hooks/use-copilot-action.js.map 9.85 KB
|
|
61
|
+
CJS dist/hooks/use-copilot-chat.js.map 34.09 KB
|
|
62
|
+
CJS dist/context/index.js.map 5.20 KB
|
|
63
|
+
CJS dist/hooks/use-copilot-readable.js.map 7.24 KB
|
|
64
|
+
CJS dist/components/index.js.map 27.20 KB
|
|
65
|
+
CJS dist/hooks/use-chat.js.map 18.27 KB
|
|
66
|
+
CJS dist/hooks/use-make-copilot-readable.js.map 5.94 KB
|
|
67
|
+
CJS dist/components/copilot-provider/copilotkit.js.map 27.14 KB
|
|
68
|
+
CJS dist/hooks/use-make-copilot-actionable.js.map 6.71 KB
|
|
69
|
+
CJS dist/hooks/index.js.map 46.25 KB
|
|
70
|
+
CJS dist/components/copilot-provider/index.js.map 27.33 KB
|
|
71
|
+
CJS dist/hooks/use-copilot-action-implementation.js.map 8.28 KB
|
|
72
|
+
CJS dist/openai-assistants/utils/index.js.map 1.44 KB
|
|
73
|
+
CJS dist/context/copilot-context.js.map 4.96 KB
|
|
74
|
+
CJS dist/hooks/use-flat-category-store.js.map 4.25 KB
|
|
75
|
+
CJS dist/openai-assistants/utils/process-message-stream.js.map 1.33 KB
|
|
76
|
+
CJS dist/openai-assistants/hooks/use-copilot-chat-v2.js.map 20.36 KB
|
|
77
|
+
CJS dist/hooks/use-make-copilot-document-readable.js.map 6.25 KB
|
|
78
|
+
CJS dist/components/copilot-provider/standard-copilot-api-config.js.map 1.17 KB
|
|
79
|
+
CJS dist/openai-assistants/hooks/index.js.map 20.75 KB
|
|
80
|
+
CJS dist/openai-assistants/hooks/use-assistants.js.map 5.90 KB
|
|
81
|
+
CJS ⚡️ Build success in 54ms
|
|
22
82
|
ESM dist/openai-assistants/utils/index.mjs 206.00 B
|
|
83
|
+
ESM dist/openai-assistants/hooks/index.mjs 548.00 B
|
|
84
|
+
ESM dist/context/index.mjs 227.00 B
|
|
85
|
+
ESM dist/components/index.mjs 407.00 B
|
|
86
|
+
ESM dist/utils/utils.mjs 34.00 B
|
|
87
|
+
ESM dist/openai-assistants/hooks/use-assistants.mjs 2.57 KB
|
|
88
|
+
ESM dist/types/index.mjs 66.00 B
|
|
23
89
|
ESM dist/types/document-pointer.mjs 45.00 B
|
|
24
|
-
ESM dist/
|
|
90
|
+
ESM dist/types/frontend-action.mjs 44.00 B
|
|
91
|
+
ESM dist/types/system-message.mjs 43.00 B
|
|
25
92
|
ESM dist/utils/fetch-chat-completion.mjs 319.00 B
|
|
26
|
-
ESM dist/
|
|
93
|
+
ESM dist/hooks/use-copilot-readable.mjs 208.00 B
|
|
27
94
|
ESM dist/utils/utils.test.mjs 170.00 B
|
|
28
|
-
ESM dist/hooks/use-flat-category-store.mjs 216.00 B
|
|
29
|
-
ESM dist/utils/utils.mjs 34.00 B
|
|
30
|
-
ESM dist/types/index.mjs 66.00 B
|
|
31
95
|
ESM dist/hooks/use-copilot-chat.mjs 500.00 B
|
|
96
|
+
ESM dist/hooks/use-flat-category-store.mjs 216.00 B
|
|
97
|
+
ESM dist/hooks/use-make-copilot-actionable.mjs 227.00 B
|
|
32
98
|
ESM dist/hooks/use-make-copilot-document-readable.mjs 246.00 B
|
|
33
|
-
ESM dist/chunk-BABVSMJR.mjs 43.00 B
|
|
34
|
-
ESM dist/hooks/use-make-copilot-readable.mjs 221.00 B
|
|
35
|
-
ESM dist/chunk-FCEPEM4B.mjs 4.39 KB
|
|
36
|
-
ESM dist/index.mjs 1.65 KB
|
|
37
|
-
ESM dist/lib/index.mjs 435.00 B
|
|
38
99
|
ESM dist/lib/copilot-task.mjs 410.00 B
|
|
39
|
-
ESM dist/
|
|
40
|
-
ESM dist/
|
|
100
|
+
ESM dist/index.mjs 1.73 KB
|
|
101
|
+
ESM dist/hooks/use-make-copilot-readable.mjs 221.00 B
|
|
102
|
+
ESM dist/chunk-7GFKOIO7.mjs 43.00 B
|
|
41
103
|
ESM dist/chunk-LUGEI4YQ.mjs 43.00 B
|
|
42
|
-
ESM dist/hooks/use-
|
|
43
|
-
ESM dist/
|
|
44
|
-
ESM dist/
|
|
104
|
+
ESM dist/hooks/use-tree.mjs 171.00 B
|
|
105
|
+
ESM dist/chunk-BABVSMJR.mjs 43.00 B
|
|
106
|
+
ESM dist/openai-assistants/index.mjs 597.00 B
|
|
107
|
+
ESM dist/chunk-FRAKUJWH.mjs 43.00 B
|
|
108
|
+
ESM dist/chunk-L45P674M.mjs 3.21 KB
|
|
109
|
+
ESM dist/chunk-EFZPSZWO.mjs 43.00 B
|
|
110
|
+
ESM dist/hooks/index.mjs 965.00 B
|
|
111
|
+
ESM dist/chunk-FCEPEM4B.mjs 4.39 KB
|
|
112
|
+
ESM dist/chunk-BCKOSVRB.mjs 2.95 KB
|
|
113
|
+
ESM dist/chunk-EYKDJBDE.mjs 43.00 B
|
|
45
114
|
ESM dist/chunk-VNRDQJXW.mjs 43.00 B
|
|
46
|
-
ESM dist/
|
|
47
|
-
ESM dist/types/frontend-action.mjs 44.00 B
|
|
48
|
-
ESM dist/chunk-GVLCTSXW.mjs 2.95 KB
|
|
49
|
-
ESM dist/chunk-IOP6JX34.mjs 43.00 B
|
|
50
|
-
ESM dist/chunk-BGB5G33N.mjs 1.06 KB
|
|
115
|
+
ESM dist/chunk-5L5PJJNT.mjs 909.00 B
|
|
51
116
|
ESM dist/chunk-H6V2C2AN.mjs 700.00 B
|
|
52
|
-
ESM dist/chunk-
|
|
117
|
+
ESM dist/chunk-EABGYUTZ.mjs 640.00 B
|
|
118
|
+
ESM dist/chunk-BGB5G33N.mjs 1.06 KB
|
|
53
119
|
ESM dist/chunk-SPCZTZCY.mjs 43.00 B
|
|
54
|
-
ESM dist/hooks/use-tree.mjs 171.00 B
|
|
55
|
-
ESM dist/chunk-H3FQWB4B.mjs 4.39 KB
|
|
56
|
-
ESM dist/chunk-3WKJ25L3.mjs 2.69 KB
|
|
57
120
|
ESM dist/chunk-JD7BAH7U.mjs 43.00 B
|
|
58
121
|
ESM dist/chunk-F2JIAPZQ.mjs 405.00 B
|
|
59
|
-
ESM dist/chunk-VUY2K2DI.mjs 3.89 KB
|
|
60
122
|
ESM dist/hooks/use-chat.mjs 174.00 B
|
|
123
|
+
ESM dist/chunk-VUY2K2DI.mjs 3.89 KB
|
|
124
|
+
ESM dist/chunk-YULKJPY3.mjs 1.84 KB
|
|
125
|
+
ESM dist/chunk-X3FZ6GTK.mjs 6.51 KB
|
|
61
126
|
ESM dist/hooks/use-copilot-action-implementation.mjs 245.00 B
|
|
62
|
-
ESM dist/chunk-75RLNHDB.mjs 1.50 KB
|
|
63
|
-
ESM dist/chunk-7GFKOIO7.mjs 43.00 B
|
|
64
|
-
ESM dist/chunk-ISKBWE4O.mjs 299.00 B
|
|
65
|
-
ESM dist/chunk-KIKHLN4X.mjs 1.46 KB
|
|
66
|
-
ESM dist/chunk-MRXNTQOX.mjs 1.89 KB
|
|
67
127
|
ESM dist/hooks/use-copilot-action.mjs 234.00 B
|
|
68
|
-
ESM dist/
|
|
69
|
-
ESM dist/
|
|
70
|
-
ESM dist/chunk-
|
|
71
|
-
ESM dist/
|
|
128
|
+
ESM dist/lib/index.mjs 435.00 B
|
|
129
|
+
ESM dist/chunk-H3FQWB4B.mjs 4.39 KB
|
|
130
|
+
ESM dist/chunk-3WKJ25L3.mjs 2.69 KB
|
|
131
|
+
ESM dist/openai-assistants/hooks/use-copilot-chat-v2.mjs 575.00 B
|
|
132
|
+
ESM dist/chunk-ISKBWE4O.mjs 299.00 B
|
|
133
|
+
ESM dist/openai-assistants/utils/process-message-stream.mjs 188.00 B
|
|
72
134
|
ESM dist/chunk-MZ5UN3BY.mjs 802.00 B
|
|
73
|
-
ESM dist/
|
|
74
|
-
ESM dist/
|
|
75
|
-
ESM dist/
|
|
76
|
-
ESM dist/
|
|
77
|
-
ESM dist/components/copilot-provider/
|
|
78
|
-
ESM dist/components/copilot-provider/
|
|
79
|
-
ESM dist/
|
|
135
|
+
ESM dist/context/copilot-context.mjs 205.00 B
|
|
136
|
+
ESM dist/chunk-MRXNTQOX.mjs 1.89 KB
|
|
137
|
+
ESM dist/chunk-75RLNHDB.mjs 1.50 KB
|
|
138
|
+
ESM dist/chunk-KIKHLN4X.mjs 1.46 KB
|
|
139
|
+
ESM dist/components/copilot-provider/copilotkit-props.mjs 45.00 B
|
|
140
|
+
ESM dist/components/copilot-provider/copilotkit.mjs 366.00 B
|
|
141
|
+
ESM dist/components/copilot-provider/index.mjs 396.00 B
|
|
142
|
+
ESM dist/components/copilot-provider/standard-copilot-api-config.mjs 201.00 B
|
|
80
143
|
ESM dist/openai-assistants/utils/index.mjs.map 71.00 B
|
|
81
|
-
ESM dist/
|
|
82
|
-
ESM dist/openai-assistants/hooks/
|
|
144
|
+
ESM dist/context/index.mjs.map 71.00 B
|
|
145
|
+
ESM dist/openai-assistants/hooks/index.mjs.map 71.00 B
|
|
146
|
+
ESM dist/components/index.mjs.map 71.00 B
|
|
83
147
|
ESM dist/openai-assistants/hooks/use-assistants.mjs.map 4.65 KB
|
|
148
|
+
ESM dist/types/document-pointer.mjs.map 71.00 B
|
|
84
149
|
ESM dist/utils/fetch-chat-completion.mjs.map 71.00 B
|
|
85
|
-
ESM dist/
|
|
86
|
-
ESM dist/utils/utils.test.mjs.map 352.00 B
|
|
87
|
-
ESM dist/hooks/use-flat-category-store.mjs.map 71.00 B
|
|
150
|
+
ESM dist/types/system-message.mjs.map 71.00 B
|
|
88
151
|
ESM dist/utils/utils.mjs.map 71.00 B
|
|
89
152
|
ESM dist/types/index.mjs.map 71.00 B
|
|
90
|
-
ESM dist/hooks/use-copilot-
|
|
153
|
+
ESM dist/hooks/use-make-copilot-actionable.mjs.map 71.00 B
|
|
91
154
|
ESM dist/hooks/use-make-copilot-document-readable.mjs.map 71.00 B
|
|
92
|
-
ESM dist/chunk-BABVSMJR.mjs.map 71.00 B
|
|
93
|
-
ESM dist/hooks/use-make-copilot-readable.mjs.map 71.00 B
|
|
94
|
-
ESM dist/chunk-FCEPEM4B.mjs.map 7.90 KB
|
|
95
155
|
ESM dist/index.mjs.map 71.00 B
|
|
96
|
-
ESM dist/lib/index.mjs.map 71.00 B
|
|
97
|
-
ESM dist/lib/copilot-task.mjs.map 71.00 B
|
|
98
|
-
ESM dist/chunk-EFZPSZWO.mjs.map 71.00 B
|
|
99
|
-
ESM dist/components/index.mjs.map 71.00 B
|
|
100
|
-
ESM dist/chunk-VNRDQJXW.mjs.map 71.00 B
|
|
101
|
-
ESM dist/context/copilot-context.mjs.map 71.00 B
|
|
102
156
|
ESM dist/types/frontend-action.mjs.map 71.00 B
|
|
157
|
+
ESM dist/hooks/use-make-copilot-readable.mjs.map 71.00 B
|
|
158
|
+
ESM dist/chunk-LUGEI4YQ.mjs.map 71.00 B
|
|
159
|
+
ESM dist/lib/copilot-task.mjs.map 71.00 B
|
|
160
|
+
ESM dist/hooks/use-copilot-chat.mjs.map 71.00 B
|
|
161
|
+
ESM dist/utils/utils.test.mjs.map 352.00 B
|
|
162
|
+
ESM dist/openai-assistants/index.mjs.map 71.00 B
|
|
163
|
+
ESM dist/hooks/use-copilot-readable.mjs.map 71.00 B
|
|
103
164
|
ESM dist/chunk-FRAKUJWH.mjs.map 71.00 B
|
|
104
|
-
ESM dist/hooks/
|
|
105
|
-
ESM dist/chunk-
|
|
106
|
-
ESM dist/chunk-
|
|
107
|
-
ESM dist/
|
|
165
|
+
ESM dist/hooks/index.mjs.map 71.00 B
|
|
166
|
+
ESM dist/chunk-BCKOSVRB.mjs.map 4.68 KB
|
|
167
|
+
ESM dist/chunk-FCEPEM4B.mjs.map 7.90 KB
|
|
168
|
+
ESM dist/chunk-EFZPSZWO.mjs.map 71.00 B
|
|
169
|
+
ESM dist/chunk-BABVSMJR.mjs.map 71.00 B
|
|
170
|
+
ESM dist/chunk-EYKDJBDE.mjs.map 71.00 B
|
|
171
|
+
ESM dist/chunk-H6V2C2AN.mjs.map 1.40 KB
|
|
172
|
+
ESM dist/chunk-L45P674M.mjs.map 5.81 KB
|
|
108
173
|
ESM dist/chunk-SPCZTZCY.mjs.map 71.00 B
|
|
109
|
-
ESM dist/chunk-
|
|
110
|
-
ESM dist/
|
|
174
|
+
ESM dist/chunk-5L5PJJNT.mjs.map 2.38 KB
|
|
175
|
+
ESM dist/hooks/use-chat.mjs.map 71.00 B
|
|
176
|
+
ESM dist/chunk-EABGYUTZ.mjs.map 1.08 KB
|
|
177
|
+
ESM dist/chunk-F2JIAPZQ.mjs.map 1.12 KB
|
|
178
|
+
ESM dist/chunk-YULKJPY3.mjs.map 4.21 KB
|
|
179
|
+
ESM dist/chunk-X3FZ6GTK.mjs.map 13.78 KB
|
|
111
180
|
ESM dist/hooks/use-tree.mjs.map 71.00 B
|
|
112
|
-
ESM dist/
|
|
181
|
+
ESM dist/lib/index.mjs.map 71.00 B
|
|
182
|
+
ESM dist/hooks/use-flat-category-store.mjs.map 71.00 B
|
|
183
|
+
ESM dist/chunk-7GFKOIO7.mjs.map 71.00 B
|
|
184
|
+
ESM dist/hooks/use-copilot-action.mjs.map 71.00 B
|
|
113
185
|
ESM dist/chunk-H3FQWB4B.mjs.map 8.78 KB
|
|
114
|
-
ESM dist/chunk-H6V2C2AN.mjs.map 1.40 KB
|
|
115
186
|
ESM dist/chunk-VUY2K2DI.mjs.map 8.27 KB
|
|
116
|
-
ESM dist/chunk-JD7BAH7U.mjs.map 71.00 B
|
|
117
|
-
ESM dist/hooks/use-chat.mjs.map 71.00 B
|
|
118
|
-
ESM dist/chunk-75RLNHDB.mjs.map 3.43 KB
|
|
119
187
|
ESM dist/chunk-3WKJ25L3.mjs.map 4.75 KB
|
|
120
|
-
ESM dist/
|
|
188
|
+
ESM dist/openai-assistants/hooks/use-copilot-chat-v2.mjs.map 71.00 B
|
|
189
|
+
ESM dist/chunk-JD7BAH7U.mjs.map 71.00 B
|
|
190
|
+
ESM dist/openai-assistants/utils/process-message-stream.mjs.map 71.00 B
|
|
191
|
+
ESM dist/chunk-VNRDQJXW.mjs.map 71.00 B
|
|
192
|
+
ESM dist/chunk-BGB5G33N.mjs.map 1.87 KB
|
|
193
|
+
ESM dist/context/copilot-context.mjs.map 71.00 B
|
|
121
194
|
ESM dist/hooks/use-copilot-action-implementation.mjs.map 71.00 B
|
|
122
195
|
ESM dist/chunk-ISKBWE4O.mjs.map 1.64 KB
|
|
123
|
-
ESM dist/chunk-KIKHLN4X.mjs.map 4.87 KB
|
|
124
|
-
ESM dist/hooks/use-copilot-action.mjs.map 71.00 B
|
|
125
|
-
ESM dist/chunk-F2JIAPZQ.mjs.map 1.12 KB
|
|
126
|
-
ESM dist/hooks/index.mjs.map 71.00 B
|
|
127
196
|
ESM dist/chunk-MRXNTQOX.mjs.map 71.00 B
|
|
128
|
-
ESM dist/
|
|
129
|
-
ESM dist/chunk-QGRMN7L3.mjs.map 5.57 KB
|
|
130
|
-
ESM dist/chunk-YULKJPY3.mjs.map 4.21 KB
|
|
197
|
+
ESM dist/chunk-KIKHLN4X.mjs.map 4.87 KB
|
|
131
198
|
ESM dist/chunk-MZ5UN3BY.mjs.map 1.26 KB
|
|
132
|
-
ESM dist/chunk-
|
|
133
|
-
ESM
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
CJS dist/index.js 39.09 KB
|
|
139
|
-
CJS dist/hooks/use-flat-category-store.js 2.87 KB
|
|
140
|
-
CJS dist/context/index.js 3.64 KB
|
|
141
|
-
CJS dist/hooks/use-make-copilot-document-readable.js 4.24 KB
|
|
142
|
-
CJS dist/hooks/use-make-copilot-actionable.js 4.62 KB
|
|
143
|
-
CJS dist/hooks/use-make-copilot-readable.js 4.13 KB
|
|
144
|
-
CJS dist/hooks/use-tree.js 5.53 KB
|
|
145
|
-
CJS dist/hooks/use-chat.js 11.27 KB
|
|
146
|
-
CJS dist/hooks/use-copilot-action-implementation.js 5.08 KB
|
|
147
|
-
CJS dist/lib/copilot-task.js 7.38 KB
|
|
148
|
-
CJS dist/lib/index.js 7.34 KB
|
|
149
|
-
CJS dist/openai-assistants/index.js 9.35 KB
|
|
150
|
-
CJS dist/types/frontend-action.js 837.00 B
|
|
151
|
-
CJS dist/types/index.js 797.00 B
|
|
152
|
-
CJS dist/types/document-pointer.js 841.00 B
|
|
153
|
-
CJS dist/types/system-message.js 833.00 B
|
|
154
|
-
CJS dist/utils/fetch-chat-completion.js 4.95 KB
|
|
155
|
-
CJS dist/context/copilot-context.js 3.65 KB
|
|
156
|
-
CJS dist/components/copilot-provider/copilotkit-props.js 864.00 B
|
|
157
|
-
CJS dist/components/copilot-provider/index.js 15.06 KB
|
|
158
|
-
CJS dist/utils/utils.test.js 184.00 B
|
|
159
|
-
CJS dist/utils/utils.js 797.00 B
|
|
160
|
-
CJS dist/openai-assistants/hooks/index.js 9.25 KB
|
|
161
|
-
CJS dist/openai-assistants/hooks/use-assistants.js 4.81 KB
|
|
162
|
-
CJS dist/openai-assistants/utils/index.js 2.30 KB
|
|
163
|
-
CJS dist/openai-assistants/hooks/use-copilot-chat-v2.js 9.34 KB
|
|
164
|
-
CJS dist/openai-assistants/utils/process-message-stream.js 2.33 KB
|
|
165
|
-
CJS dist/components/copilot-provider/standard-copilot-api-config.js 1.48 KB
|
|
166
|
-
CJS dist/components/copilot-provider/copilotkit.js 15.00 KB
|
|
167
|
-
CJS dist/components/index.js.map 27.20 KB
|
|
168
|
-
CJS dist/hooks/index.js.map 43.83 KB
|
|
169
|
-
CJS dist/context/index.js.map 5.20 KB
|
|
170
|
-
CJS dist/index.js.map 74.38 KB
|
|
171
|
-
CJS dist/hooks/use-make-copilot-document-readable.js.map 6.25 KB
|
|
172
|
-
CJS dist/hooks/use-make-copilot-readable.js.map 6.30 KB
|
|
173
|
-
CJS dist/hooks/use-tree.js.map 8.32 KB
|
|
174
|
-
CJS dist/hooks/use-make-copilot-actionable.js.map 6.71 KB
|
|
175
|
-
CJS dist/hooks/use-chat.js.map 17.88 KB
|
|
176
|
-
CJS dist/lib/index.js.map 16.46 KB
|
|
177
|
-
CJS dist/hooks/use-flat-category-store.js.map 4.25 KB
|
|
178
|
-
CJS dist/types/index.js.map 338.00 B
|
|
179
|
-
CJS dist/hooks/use-copilot-action.js.map 9.85 KB
|
|
180
|
-
CJS dist/openai-assistants/index.js.map 20.45 KB
|
|
181
|
-
CJS dist/hooks/use-copilot-action-implementation.js.map 8.28 KB
|
|
182
|
-
CJS dist/types/system-message.js.map 249.00 B
|
|
183
|
-
CJS dist/components/copilot-provider/index.js.map 27.33 KB
|
|
184
|
-
CJS dist/utils/fetch-chat-completion.js.map 4.79 KB
|
|
185
|
-
CJS dist/types/document-pointer.js.map 292.00 B
|
|
186
|
-
CJS dist/components/copilot-provider/copilotkit-props.js.map 1.10 KB
|
|
187
|
-
CJS dist/utils/utils.test.js.map 354.00 B
|
|
188
|
-
CJS dist/openai-assistants/hooks/index.js.map 20.75 KB
|
|
189
|
-
CJS dist/hooks/use-copilot-chat.js.map 33.70 KB
|
|
190
|
-
CJS dist/openai-assistants/hooks/use-assistants.js.map 5.90 KB
|
|
191
|
-
CJS dist/lib/copilot-task.js.map 16.40 KB
|
|
192
|
-
CJS dist/openai-assistants/utils/index.js.map 1.44 KB
|
|
193
|
-
CJS dist/openai-assistants/hooks/use-copilot-chat-v2.js.map 20.36 KB
|
|
194
|
-
CJS dist/openai-assistants/utils/process-message-stream.js.map 1.33 KB
|
|
195
|
-
CJS dist/components/copilot-provider/copilotkit.js.map 27.14 KB
|
|
196
|
-
CJS dist/components/copilot-provider/standard-copilot-api-config.js.map 1.17 KB
|
|
197
|
-
CJS dist/context/copilot-context.js.map 4.96 KB
|
|
198
|
-
CJS dist/types/frontend-action.js.map 1.77 KB
|
|
199
|
-
CJS dist/utils/utils.js.map 137.00 B
|
|
200
|
-
CJS ⚡️ Build success in 137ms
|
|
199
|
+
ESM dist/chunk-75RLNHDB.mjs.map 3.43 KB
|
|
200
|
+
ESM dist/components/copilot-provider/copilotkit-props.mjs.map 71.00 B
|
|
201
|
+
ESM dist/components/copilot-provider/copilotkit.mjs.map 71.00 B
|
|
202
|
+
ESM dist/components/copilot-provider/standard-copilot-api-config.mjs.map 71.00 B
|
|
203
|
+
ESM dist/components/copilot-provider/index.mjs.map 71.00 B
|
|
204
|
+
ESM ⚡️ Build success in 55ms
|
|
201
205
|
DTS Build start
|
|
202
|
-
DTS ⚡️ Build success in
|
|
203
|
-
DTS dist/index.d.ts 1.
|
|
206
|
+
DTS ⚡️ Build success in 2851ms
|
|
207
|
+
DTS dist/index.d.ts 1.63 KB
|
|
204
208
|
DTS dist/components/copilot-provider/copilotkit.d.ts 1.26 KB
|
|
205
209
|
DTS dist/components/copilot-provider/copilotkit-props.d.ts 1007.00 B
|
|
206
210
|
DTS dist/context/copilot-context.d.ts 2.54 KB
|
|
207
211
|
DTS dist/hooks/use-copilot-chat.d.ts 1.05 KB
|
|
208
212
|
DTS dist/hooks/use-make-copilot-actionable.d.ts 309.00 B
|
|
209
213
|
DTS dist/hooks/use-copilot-action.d.ts 286.00 B
|
|
210
|
-
DTS dist/hooks/use-make-copilot-readable.d.ts
|
|
214
|
+
DTS dist/hooks/use-make-copilot-readable.d.ts 228.00 B
|
|
211
215
|
DTS dist/hooks/use-make-copilot-document-readable.d.ts 516.00 B
|
|
212
216
|
DTS dist/hooks/use-chat.d.ts 2.73 KB
|
|
217
|
+
DTS dist/hooks/use-copilot-readable.d.ts 1.10 KB
|
|
213
218
|
DTS dist/types/document-pointer.d.ts 181.00 B
|
|
214
219
|
DTS dist/types/system-message.d.ts 132.00 B
|
|
215
220
|
DTS dist/types/frontend-action.d.ts 1.62 KB
|
|
216
221
|
DTS dist/openai-assistants/hooks/use-copilot-chat-v2.d.ts 1.41 KB
|
|
217
222
|
DTS dist/openai-assistants/utils/process-message-stream.d.ts 196.00 B
|
|
218
|
-
DTS dist/lib/copilot-task.d.ts 1.
|
|
223
|
+
DTS dist/lib/copilot-task.d.ts 1.21 KB
|
|
219
224
|
DTS dist/utils/fetch-chat-completion.d.ts 1.38 KB
|
|
220
225
|
DTS dist/hooks/use-tree.d.ts 543.00 B
|
|
221
226
|
DTS dist/components/index.d.ts 186.00 B
|
|
222
227
|
DTS dist/context/index.d.ts 267.00 B
|
|
223
|
-
DTS dist/hooks/index.d.ts
|
|
228
|
+
DTS dist/hooks/index.d.ts 736.00 B
|
|
224
229
|
DTS dist/hooks/use-copilot-action-implementation.d.ts 283.00 B
|
|
225
230
|
DTS dist/hooks/use-flat-category-store.d.ts 424.00 B
|
|
226
231
|
DTS dist/lib/index.d.ts 261.00 B
|
|
@@ -233,5 +238,3 @@ DTS dist/components/copilot-provider/standard-copilot-api-config.d.ts 875.00 B
|
|
|
233
238
|
DTS dist/openai-assistants/hooks/index.d.ts 182.00 B
|
|
234
239
|
DTS dist/openai-assistants/hooks/use-assistants.d.ts 551.00 B
|
|
235
240
|
DTS dist/openai-assistants/utils/index.d.ts 68.00 B
|
|
236
|
-
Waiting for the debugger to disconnect...
|
|
237
|
-
Waiting for the debugger to disconnect...
|
package/CHANGELOG.md
CHANGED
|
@@ -1,15 +1,48 @@
|
|
|
1
1
|
# ui
|
|
2
2
|
|
|
3
|
-
## 0.25.0-multi-
|
|
3
|
+
## 0.25.0-multi-feature-usecopilotreadable.3
|
|
4
4
|
|
|
5
5
|
### Minor Changes
|
|
6
6
|
|
|
7
|
-
-
|
|
7
|
+
- multiple new features, including new useCopilotReadable
|
|
8
8
|
|
|
9
9
|
### Patch Changes
|
|
10
10
|
|
|
11
11
|
- Updated dependencies
|
|
12
|
-
- @copilotkit/shared@0.9.0-multi-
|
|
12
|
+
- @copilotkit/shared@0.9.0-multi-feature-usecopilotreadable.3
|
|
13
|
+
|
|
14
|
+
## 0.25.0-function-calling-fixes.2
|
|
15
|
+
|
|
16
|
+
### Minor Changes
|
|
17
|
+
|
|
18
|
+
- fix backend function calling return values
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- Updated dependencies
|
|
23
|
+
- @copilotkit/shared@0.9.0-function-calling-fixes.2
|
|
24
|
+
|
|
25
|
+
## 0.25.0-function-calling-fixes.1
|
|
26
|
+
|
|
27
|
+
### Minor Changes
|
|
28
|
+
|
|
29
|
+
- gpt-4-turbo-april-2024 function calling fixes
|
|
30
|
+
|
|
31
|
+
### Patch Changes
|
|
32
|
+
|
|
33
|
+
- Updated dependencies
|
|
34
|
+
- @copilotkit/shared@0.9.0-function-calling-fixes.1
|
|
35
|
+
|
|
36
|
+
## 0.25.0-alpha.0
|
|
37
|
+
|
|
38
|
+
### Minor Changes
|
|
39
|
+
|
|
40
|
+
- gpt-4-turbo-april-2024
|
|
41
|
+
|
|
42
|
+
### Patch Changes
|
|
43
|
+
|
|
44
|
+
- Updated dependencies
|
|
45
|
+
- @copilotkit/shared@0.9.0-alpha.0
|
|
13
46
|
|
|
14
47
|
## 0.24.0
|
|
15
48
|
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CopilotContext
|
|
3
|
+
} from "./chunk-KIKHLN4X.mjs";
|
|
4
|
+
|
|
5
|
+
// src/hooks/use-copilot-readable.ts
|
|
6
|
+
import { useContext, useEffect, useRef } from "react";
|
|
7
|
+
function convertToJSON(description, value) {
|
|
8
|
+
return `${description}: ${typeof value === "string" ? value : JSON.stringify(value)}`;
|
|
9
|
+
}
|
|
10
|
+
function useCopilotReadable({ description, value, parentId, categories, convert }, dependencies) {
|
|
11
|
+
const { addContext, removeContext } = useContext(CopilotContext);
|
|
12
|
+
const idRef = useRef();
|
|
13
|
+
convert = convert || convertToJSON;
|
|
14
|
+
const information = convert(description, value);
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
const id = addContext(information, parentId, categories);
|
|
17
|
+
idRef.current = id;
|
|
18
|
+
return () => {
|
|
19
|
+
removeContext(id);
|
|
20
|
+
};
|
|
21
|
+
}, [information, parentId, addContext, removeContext, ...dependencies || []]);
|
|
22
|
+
return idRef.current;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export {
|
|
26
|
+
useCopilotReadable
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=chunk-5L5PJJNT.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/hooks/use-copilot-readable.ts"],"sourcesContent":["import { useContext, useEffect, useRef } from \"react\";\nimport { CopilotContext } from \"../context/copilot-context\";\n\n/**\n * Options for the useCopilotReadable hook.\n */\nexport interface UseCopilotReadableOptions {\n /**\n * The description of the information to be added to the Copilot context.\n */\n description: string;\n /**\n * The value to be added to the Copilot context.\n */\n value: any;\n /**\n * The ID of the parent context, if any.\n */\n parentId?: string;\n /**\n * An array of categories to control which context are visible where. Particularly useful\n * with CopilotTextarea (see `useMakeAutosuggestionFunction`)\n */\n categories?: string[];\n\n /**\n * A custom conversion function to use to serialize the value to a string. If not provided, the value\n * will be serialized using `JSON.stringify`.\n */\n convert?: (description: string, value: any) => string;\n}\n\nfunction convertToJSON(description: string, value: any): string {\n return `${description}: ${typeof value === \"string\" ? value : JSON.stringify(value)}`;\n}\n\n/**\n * Adds the given information to the Copilot context to make it readable by Copilot.\n */\nexport function useCopilotReadable(\n { description, value, parentId, categories, convert }: UseCopilotReadableOptions,\n dependencies?: any[],\n): string | undefined {\n const { addContext, removeContext } = useContext(CopilotContext);\n const idRef = useRef<string>();\n convert = convert || convertToJSON;\n\n const information = convert(description, value);\n\n useEffect(() => {\n const id = addContext(information, parentId, categories);\n idRef.current = id;\n\n return () => {\n removeContext(id);\n };\n }, [information, parentId, addContext, removeContext, ...(dependencies || [])]);\n\n return idRef.current;\n}\n"],"mappings":";;;;;AAAA,SAAS,YAAY,WAAW,cAAc;AAgC9C,SAAS,cAAc,aAAqB,OAAoB;AAC9D,SAAO,GAAG,gBAAgB,OAAO,UAAU,WAAW,QAAQ,KAAK,UAAU,KAAK;AACpF;AAKO,SAAS,mBACd,EAAE,aAAa,OAAO,UAAU,YAAY,QAAQ,GACpD,cACoB;AACpB,QAAM,EAAE,YAAY,cAAc,IAAI,WAAW,cAAc;AAC/D,QAAM,QAAQ,OAAe;AAC7B,YAAU,WAAW;AAErB,QAAM,cAAc,QAAQ,aAAa,KAAK;AAE9C,YAAU,MAAM;AACd,UAAM,KAAK,WAAW,aAAa,UAAU,UAAU;AACvD,UAAM,UAAU;AAEhB,WAAO,MAAM;AACX,oBAAc,EAAE;AAAA,IAClB;AAAA,EACF,GAAG,CAAC,aAAa,UAAU,YAAY,eAAe,GAAI,gBAAgB,CAAC,CAAE,CAAC;AAE9E,SAAO,MAAM;AACf;","names":[]}
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-H3FQWB4B.mjs";
|
|
4
4
|
import {
|
|
5
5
|
useChat
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-X3FZ6GTK.mjs";
|
|
7
7
|
import {
|
|
8
8
|
CopilotContext
|
|
9
9
|
} from "./chunk-KIKHLN4X.mjs";
|
|
@@ -91,4 +91,4 @@ export {
|
|
|
91
91
|
useCopilotChat,
|
|
92
92
|
defaultSystemMessage
|
|
93
93
|
};
|
|
94
|
-
//# sourceMappingURL=chunk-
|
|
94
|
+
//# sourceMappingURL=chunk-BCKOSVRB.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/hooks/use-make-copilot-readable.ts"],"sourcesContent":["import { useContext, useEffect, useRef } from \"react\";\nimport { CopilotContext } from \"../context/copilot-context\";\n\n/**\n * @deprecated Use the useCopilotReadable function instead.\n */\nexport function useMakeCopilotReadable(\n information: string,\n parentId?: string,\n categories?: string[],\n): string | undefined {\n const { addContext, removeContext } = useContext(CopilotContext);\n const idRef = useRef<string>();\n\n useEffect(() => {\n const id = addContext(information, parentId, categories);\n idRef.current = id;\n\n return () => {\n removeContext(id);\n };\n }, [information, parentId, addContext, removeContext]);\n\n return idRef.current;\n}\n"],"mappings":";;;;;AAAA,SAAS,YAAY,WAAW,cAAc;AAMvC,SAAS,uBACd,aACA,UACA,YACoB;AACpB,QAAM,EAAE,YAAY,cAAc,IAAI,WAAW,cAAc;AAC/D,QAAM,QAAQ,OAAe;AAE7B,YAAU,MAAM;AACd,UAAM,KAAK,WAAW,aAAa,UAAU,UAAU;AACvD,UAAM,UAAU;AAEhB,WAAO,MAAM;AACX,oBAAc,EAAE;AAAA,IAClB;AAAA,EACF,GAAG,CAAC,aAAa,UAAU,YAAY,aAAa,CAAC;AAErD,SAAO,MAAM;AACf;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=chunk-EYKDJBDE.mjs.map
|
|
@@ -13,12 +13,12 @@ var CopilotTask = class {
|
|
|
13
13
|
constructor(config) {
|
|
14
14
|
this.instructions = config.instructions;
|
|
15
15
|
this.actions = config.actions || [];
|
|
16
|
-
this.includeCopilotReadable = config.includeCopilotReadable
|
|
17
|
-
this.
|
|
16
|
+
this.includeCopilotReadable = config.includeCopilotReadable !== false;
|
|
17
|
+
this.includeCopilotActions = config.includeCopilotActions !== false && config.includeCopilotActionable !== false;
|
|
18
18
|
}
|
|
19
19
|
run(context, data) {
|
|
20
20
|
return __async(this, null, function* () {
|
|
21
|
-
const entryPoints = this.
|
|
21
|
+
const entryPoints = this.includeCopilotActions ? Object.assign({}, context.entryPoints) : {};
|
|
22
22
|
for (const fn of this.actions) {
|
|
23
23
|
entryPoints[fn.name] = fn;
|
|
24
24
|
}
|
|
@@ -99,4 +99,4 @@ ${instructions}
|
|
|
99
99
|
export {
|
|
100
100
|
CopilotTask
|
|
101
101
|
};
|
|
102
|
-
//# sourceMappingURL=chunk-
|
|
102
|
+
//# sourceMappingURL=chunk-L45P674M.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lib/copilot-task.ts"],"sourcesContent":["import { FunctionCall, Message } from \"@copilotkit/shared\";\nimport { FrontendAction } from \"../types/frontend-action\";\nimport { CopilotContextParams } from \"../context\";\nimport { defaultCopilotContextCategories } from \"../components\";\nimport { fetchAndDecodeChatCompletion } from \"../utils/fetch-chat-completion\";\n\nexport interface CopilotTaskConfig {\n /**\n * The instructions to be given to the assistant.\n */\n instructions: string;\n /**\n * Action definitions to be sent to the API.\n */\n actions?: FrontendAction<any>[];\n /**\n * Whether to include the copilot readable context in the task.\n */\n includeCopilotReadable?: boolean;\n\n /**\n * Whether to include actions defined via useCopilotAction in the task.\n * @deprecated Use the `includeCopilotActions` property instead.\n */\n includeCopilotActionable?: boolean;\n\n /**\n * Whether to include actions defined via useCopilotAction in the task.\n */\n includeCopilotActions?: boolean;\n}\n\nexport class CopilotTask<T = any> {\n private instructions: string;\n private actions: FrontendAction<any>[];\n private includeCopilotReadable: boolean;\n private includeCopilotActions: boolean;\n\n constructor(config: CopilotTaskConfig) {\n this.instructions = config.instructions;\n this.actions = config.actions || [];\n this.includeCopilotReadable = config.includeCopilotReadable !== false;\n this.includeCopilotActions =\n config.includeCopilotActions !== false && config.includeCopilotActionable !== false;\n }\n\n async run(context: CopilotContextParams, data?: T): Promise<void> {\n const entryPoints = this.includeCopilotActions ? Object.assign({}, context.entryPoints) : {};\n\n // merge functions into entry points\n for (const fn of this.actions) {\n entryPoints[fn.name] = fn;\n }\n\n let contextString = \"\";\n\n if (data) {\n contextString = (typeof data === \"string\" ? data : JSON.stringify(data)) + \"\\n\\n\";\n }\n\n if (this.includeCopilotReadable) {\n contextString += context.getContextString([], defaultCopilotContextCategories);\n }\n\n const systemMessage: Message = {\n id: \"system\",\n content: taskSystemMessage(contextString, this.instructions),\n role: \"system\",\n };\n\n const messages = [systemMessage];\n\n const response = await fetchAndDecodeChatCompletion({\n copilotConfig: context.copilotApiConfig,\n messages: messages,\n tools: context.getChatCompletionFunctionDescriptions(entryPoints),\n headers: context.copilotApiConfig.headers,\n body: context.copilotApiConfig.body,\n });\n\n if (!response.events) {\n throw new Error(\"Failed to execute task\");\n }\n\n const reader = response.events.getReader();\n let functionCalls: FunctionCall[] = [];\n\n while (true) {\n const { done, value } = await reader.read();\n\n if (done) {\n break;\n }\n\n if (value.type === \"function\") {\n functionCalls.push({\n name: value.name,\n arguments: JSON.stringify(value.arguments),\n });\n break;\n }\n }\n\n if (!functionCalls.length) {\n throw new Error(\"No function call occurred\");\n }\n\n const functionCallHandler = context.getFunctionCallHandler(entryPoints);\n for (const functionCall of functionCalls) {\n await functionCallHandler(messages, functionCall);\n }\n }\n}\n\nfunction taskSystemMessage(contextString: string, instructions: string): string {\n return `\nPlease act as an efficient, competent, conscientious, and industrious professional assistant.\n\nHelp the user achieve their goals, and you do so in a way that is as efficient as possible, without unnecessary fluff, but also without sacrificing professionalism.\nAlways be polite and respectful, and prefer brevity over verbosity.\n\nThe user has provided you with the following context:\n\\`\\`\\`\n${contextString}\n\\`\\`\\`\n\nThey have also provided you with functions you can call to initiate actions on their behalf.\n\nPlease assist them as best you can.\n\nThis is not a conversation, so please do not ask questions. Just call a function without saying anything else.\n\nThe user has given you the following task to complete:\n\n\\`\\`\\`\n${instructions}\n\\`\\`\\`\n`;\n}\n"],"mappings":";;;;;;;;;;;AAgCO,IAAM,cAAN,MAA2B;AAAA,EAMhC,YAAY,QAA2B;AACrC,SAAK,eAAe,OAAO;AAC3B,SAAK,UAAU,OAAO,WAAW,CAAC;AAClC,SAAK,yBAAyB,OAAO,2BAA2B;AAChE,SAAK,wBACH,OAAO,0BAA0B,SAAS,OAAO,6BAA6B;AAAA,EAClF;AAAA,EAEM,IAAI,SAA+B,MAAyB;AAAA;AAChE,YAAM,cAAc,KAAK,wBAAwB,OAAO,OAAO,CAAC,GAAG,QAAQ,WAAW,IAAI,CAAC;AAG3F,iBAAW,MAAM,KAAK,SAAS;AAC7B,oBAAY,GAAG,IAAI,IAAI;AAAA,MACzB;AAEA,UAAI,gBAAgB;AAEpB,UAAI,MAAM;AACR,yBAAiB,OAAO,SAAS,WAAW,OAAO,KAAK,UAAU,IAAI,KAAK;AAAA,MAC7E;AAEA,UAAI,KAAK,wBAAwB;AAC/B,yBAAiB,QAAQ,iBAAiB,CAAC,GAAG,+BAA+B;AAAA,MAC/E;AAEA,YAAM,gBAAyB;AAAA,QAC7B,IAAI;AAAA,QACJ,SAAS,kBAAkB,eAAe,KAAK,YAAY;AAAA,QAC3D,MAAM;AAAA,MACR;AAEA,YAAM,WAAW,CAAC,aAAa;AAE/B,YAAM,WAAW,MAAM,6BAA6B;AAAA,QAClD,eAAe,QAAQ;AAAA,QACvB;AAAA,QACA,OAAO,QAAQ,sCAAsC,WAAW;AAAA,QAChE,SAAS,QAAQ,iBAAiB;AAAA,QAClC,MAAM,QAAQ,iBAAiB;AAAA,MACjC,CAAC;AAED,UAAI,CAAC,SAAS,QAAQ;AACpB,cAAM,IAAI,MAAM,wBAAwB;AAAA,MAC1C;AAEA,YAAM,SAAS,SAAS,OAAO,UAAU;AACzC,UAAI,gBAAgC,CAAC;AAErC,aAAO,MAAM;AACX,cAAM,EAAE,MAAM,MAAM,IAAI,MAAM,OAAO,KAAK;AAE1C,YAAI,MAAM;AACR;AAAA,QACF;AAEA,YAAI,MAAM,SAAS,YAAY;AAC7B,wBAAc,KAAK;AAAA,YACjB,MAAM,MAAM;AAAA,YACZ,WAAW,KAAK,UAAU,MAAM,SAAS;AAAA,UAC3C,CAAC;AACD;AAAA,QACF;AAAA,MACF;AAEA,UAAI,CAAC,cAAc,QAAQ;AACzB,cAAM,IAAI,MAAM,2BAA2B;AAAA,MAC7C;AAEA,YAAM,sBAAsB,QAAQ,uBAAuB,WAAW;AACtE,iBAAW,gBAAgB,eAAe;AACxC,cAAM,oBAAoB,UAAU,YAAY;AAAA,MAClD;AAAA,IACF;AAAA;AACF;AAEA,SAAS,kBAAkB,eAAuB,cAA8B;AAC9E,SAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQP;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAYA;AAAA;AAAA;AAGF;","names":[]}
|
|
@@ -56,6 +56,16 @@ function useChat(options) {
|
|
|
56
56
|
runIdRef.current = response.headers.get("runid");
|
|
57
57
|
}
|
|
58
58
|
if (!response.events) {
|
|
59
|
+
setMessages([
|
|
60
|
+
...messages2,
|
|
61
|
+
{
|
|
62
|
+
id: nanoid(),
|
|
63
|
+
createdAt: /* @__PURE__ */ new Date(),
|
|
64
|
+
content: response.statusText,
|
|
65
|
+
role: "assistant"
|
|
66
|
+
}
|
|
67
|
+
]);
|
|
68
|
+
setIsLoading(false);
|
|
59
69
|
throw new Error("Failed to fetch chat completion");
|
|
60
70
|
}
|
|
61
71
|
const reader = response.events.getReader();
|
|
@@ -192,4 +202,4 @@ function useChat(options) {
|
|
|
192
202
|
export {
|
|
193
203
|
useChat
|
|
194
204
|
};
|
|
195
|
-
//# sourceMappingURL=chunk-
|
|
205
|
+
//# sourceMappingURL=chunk-X3FZ6GTK.mjs.map
|