@copilotkit/react-core 0.20.0-alpha.2 → 0.20.0-arnold-backend-only-props.1
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 +123 -123
- package/CHANGELOG.md +3 -14
- package/dist/{chunk-CPEUPJQJ.mjs → chunk-2EP7VLPI.mjs} +2 -2
- package/dist/{chunk-TZPIY754.mjs → chunk-2FHJTQBT.mjs} +3 -3
- package/dist/{chunk-4LKP4DMT.mjs → chunk-6WZFE6II.mjs} +3 -3
- package/dist/{chunk-XBLCD24W.mjs → chunk-JVCBCB2T.mjs} +2 -2
- package/dist/{chunk-JIKWSWIX.mjs → chunk-L4GSQI5V.mjs} +6 -3
- package/dist/chunk-L4GSQI5V.mjs.map +1 -0
- package/dist/{chunk-NW27C3BV.mjs → chunk-M35FKB5H.mjs} +2 -2
- package/dist/{chunk-KAZJPE2I.mjs → chunk-PHK2K7UB.mjs} +3 -3
- package/dist/chunk-PHK2K7UB.mjs.map +1 -0
- package/dist/{chunk-AVLJ3AWG.mjs → chunk-PLHQWEH7.mjs} +4 -4
- package/dist/{chunk-4OWTRVNI.mjs → chunk-S7ZVOTYK.mjs} +1 -1
- package/dist/chunk-S7ZVOTYK.mjs.map +1 -0
- package/dist/{chunk-K2LVBFRY.mjs → chunk-WH4L73VS.mjs} +2 -2
- package/dist/components/copilot-provider/copilotkit-props.d.ts +11 -0
- package/dist/components/copilot-provider/copilotkit-props.js.map +1 -1
- package/dist/components/copilot-provider/copilotkit.js +1 -1
- package/dist/components/copilot-provider/copilotkit.js.map +1 -1
- package/dist/components/copilot-provider/copilotkit.mjs +2 -2
- package/dist/components/copilot-provider/index.js +1 -1
- package/dist/components/copilot-provider/index.js.map +1 -1
- package/dist/components/copilot-provider/index.mjs +2 -2
- package/dist/components/index.js +1 -1
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +2 -2
- package/dist/context/copilot-context.d.ts +11 -0
- package/dist/context/copilot-context.js.map +1 -1
- package/dist/context/copilot-context.mjs +1 -1
- package/dist/context/index.js.map +1 -1
- package/dist/context/index.mjs +1 -1
- package/dist/hooks/index.js +5 -2
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs +8 -8
- package/dist/hooks/use-chat.js +5 -2
- package/dist/hooks/use-chat.js.map +1 -1
- package/dist/hooks/use-chat.mjs +2 -2
- package/dist/hooks/use-copilot-chat.js +5 -2
- package/dist/hooks/use-copilot-chat.js.map +1 -1
- package/dist/hooks/use-copilot-chat.mjs +5 -5
- package/dist/hooks/use-make-copilot-actionable.js.map +1 -1
- package/dist/hooks/use-make-copilot-actionable.mjs +2 -2
- package/dist/hooks/use-make-copilot-document-readable.js.map +1 -1
- package/dist/hooks/use-make-copilot-document-readable.mjs +2 -2
- package/dist/hooks/use-make-copilot-readable.js.map +1 -1
- package/dist/hooks/use-make-copilot-readable.mjs +2 -2
- package/dist/index.js +6 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -10
- package/dist/lib/copilot-task.js +5 -2
- package/dist/lib/copilot-task.js.map +1 -1
- package/dist/lib/copilot-task.mjs +4 -4
- package/dist/lib/index.js +5 -2
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/index.mjs +4 -4
- package/dist/openai-assistants/hooks/index.js.map +1 -1
- package/dist/openai-assistants/hooks/index.mjs +3 -3
- package/dist/openai-assistants/hooks/use-copilot-chat-v2.js.map +1 -1
- package/dist/openai-assistants/hooks/use-copilot-chat-v2.mjs +3 -3
- package/dist/openai-assistants/index.js.map +1 -1
- package/dist/openai-assistants/index.mjs +3 -3
- package/dist/utils/fetch-chat-completion.js +5 -2
- package/dist/utils/fetch-chat-completion.js.map +1 -1
- package/dist/utils/fetch-chat-completion.mjs +1 -1
- package/package.json +4 -4
- package/src/components/copilot-provider/copilotkit-props.tsx +12 -0
- package/src/components/copilot-provider/copilotkit.tsx +4 -1
- package/src/context/copilot-context.tsx +12 -0
- package/src/utils/fetch-chat-completion.ts +3 -0
- package/dist/chunk-4OWTRVNI.mjs.map +0 -1
- package/dist/chunk-JIKWSWIX.mjs.map +0 -1
- package/dist/chunk-KAZJPE2I.mjs.map +0 -1
- /package/dist/{chunk-CPEUPJQJ.mjs.map → chunk-2EP7VLPI.mjs.map} +0 -0
- /package/dist/{chunk-TZPIY754.mjs.map → chunk-2FHJTQBT.mjs.map} +0 -0
- /package/dist/{chunk-4LKP4DMT.mjs.map → chunk-6WZFE6II.mjs.map} +0 -0
- /package/dist/{chunk-XBLCD24W.mjs.map → chunk-JVCBCB2T.mjs.map} +0 -0
- /package/dist/{chunk-NW27C3BV.mjs.map → chunk-M35FKB5H.mjs.map} +0 -0
- /package/dist/{chunk-AVLJ3AWG.mjs.map → chunk-PLHQWEH7.mjs.map} +0 -0
- /package/dist/{chunk-K2LVBFRY.mjs.map → chunk-WH4L73VS.mjs.map} +0 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -10,182 +10,182 @@ CLI Target: es6
|
|
|
10
10
|
CLI Cleaning output folder
|
|
11
11
|
ESM Build start
|
|
12
12
|
CJS Build start
|
|
13
|
-
CJS dist/utils/fetch-chat-completion.js 4.78 KB
|
|
14
|
-
CJS dist/types/document-pointer.js 841.00 B
|
|
15
|
-
CJS dist/lib/copilot-task.js 7.17 KB
|
|
16
13
|
CJS dist/openai-assistants/index.js 9.31 KB
|
|
14
|
+
CJS dist/lib/copilot-task.js 7.39 KB
|
|
15
|
+
CJS dist/utils/fetch-chat-completion.js 5.00 KB
|
|
17
16
|
CJS dist/components/copilot-provider/copilotkit-props.js 878.00 B
|
|
18
|
-
CJS dist/openai-assistants/hooks/
|
|
19
|
-
CJS dist/openai-assistants/utils/
|
|
20
|
-
CJS dist/
|
|
21
|
-
CJS dist/index.js
|
|
17
|
+
CJS dist/openai-assistants/hooks/use-assistants.js 4.82 KB
|
|
18
|
+
CJS dist/openai-assistants/utils/process-message-stream.js 2.33 KB
|
|
19
|
+
CJS dist/types/document-pointer.js 841.00 B
|
|
20
|
+
CJS dist/index.js 36.03 KB
|
|
22
21
|
CJS dist/context/copilot-context.js 3.62 KB
|
|
23
|
-
CJS dist/components/index.js 15.
|
|
22
|
+
CJS dist/components/index.js 15.17 KB
|
|
23
|
+
CJS dist/context/index.js 3.60 KB
|
|
24
|
+
CJS dist/hooks/index.js 16.65 KB
|
|
25
|
+
CJS dist/hooks/use-chat.js 9.25 KB
|
|
26
|
+
CJS dist/hooks/use-make-copilot-document-readable.js 4.22 KB
|
|
24
27
|
CJS dist/hooks/use-make-copilot-actionable.js 4.47 KB
|
|
25
|
-
CJS dist/hooks/use-copilot-chat.js 14.25 KB
|
|
26
|
-
CJS dist/hooks/use-chat.js 9.02 KB
|
|
27
|
-
CJS dist/hooks/index.js 16.42 KB
|
|
28
28
|
CJS dist/hooks/use-make-copilot-readable.js 4.10 KB
|
|
29
|
-
CJS dist/lib/index.js 7.13 KB
|
|
30
|
-
CJS dist/hooks/use-make-copilot-document-readable.js 4.22 KB
|
|
31
29
|
CJS dist/hooks/use-tree.js 5.53 KB
|
|
30
|
+
CJS dist/lib/index.js 7.35 KB
|
|
32
31
|
CJS dist/types/system-message.js 833.00 B
|
|
33
|
-
CJS dist/utils/utils.js 797.00 B
|
|
34
32
|
CJS dist/utils/utils.test.js 184.00 B
|
|
35
|
-
CJS dist/
|
|
33
|
+
CJS dist/utils/utils.js 797.00 B
|
|
36
34
|
CJS dist/types/index.js 797.00 B
|
|
37
|
-
CJS dist/components/copilot-provider/
|
|
38
|
-
CJS dist/
|
|
39
|
-
CJS dist/hooks/
|
|
40
|
-
CJS dist/components/copilot-provider/copilotkit.js 15.11 KB
|
|
41
|
-
CJS dist/openai-assistants/utils/process-message-stream.js 2.33 KB
|
|
35
|
+
CJS dist/components/copilot-provider/copilotkit.js 15.17 KB
|
|
36
|
+
CJS dist/components/copilot-provider/standard-copilot-api-config.js 1.48 KB
|
|
37
|
+
CJS dist/openai-assistants/hooks/index.js 9.21 KB
|
|
42
38
|
CJS dist/openai-assistants/hooks/use-copilot-chat-v2.js 9.30 KB
|
|
43
|
-
CJS dist/
|
|
44
|
-
CJS dist/
|
|
39
|
+
CJS dist/hooks/use-flat-category-store.js 2.87 KB
|
|
40
|
+
CJS dist/components/copilot-provider/index.js 15.21 KB
|
|
41
|
+
CJS dist/hooks/use-copilot-chat.js 14.48 KB
|
|
42
|
+
CJS dist/openai-assistants/utils/index.js 2.30 KB
|
|
43
|
+
CJS dist/openai-assistants/index.js.map 20.99 KB
|
|
44
|
+
CJS dist/lib/copilot-task.js.map 16.72 KB
|
|
45
|
+
CJS dist/utils/fetch-chat-completion.js.map 4.31 KB
|
|
46
|
+
CJS dist/components/copilot-provider/copilotkit-props.js.map 1.12 KB
|
|
47
|
+
CJS dist/openai-assistants/hooks/use-assistants.js.map 5.92 KB
|
|
48
|
+
CJS dist/openai-assistants/utils/process-message-stream.js.map 1.33 KB
|
|
45
49
|
CJS dist/types/document-pointer.js.map 292.00 B
|
|
46
|
-
CJS dist/
|
|
47
|
-
CJS dist/
|
|
48
|
-
CJS dist/
|
|
49
|
-
CJS dist/
|
|
50
|
-
CJS dist/
|
|
51
|
-
CJS dist/
|
|
52
|
-
CJS dist/index.js.map 66.55 KB
|
|
53
|
-
CJS dist/hooks/use-make-copilot-actionable.js.map 5.98 KB
|
|
54
|
-
CJS dist/components/index.js.map 27.51 KB
|
|
55
|
-
CJS dist/hooks/index.js.map 35.91 KB
|
|
56
|
-
CJS dist/hooks/use-copilot-chat.js.map 31.00 KB
|
|
57
|
-
CJS dist/hooks/use-chat.js.map 15.00 KB
|
|
58
|
-
CJS dist/hooks/use-make-copilot-document-readable.js.map 5.75 KB
|
|
59
|
-
CJS dist/types/system-message.js.map 249.00 B
|
|
50
|
+
CJS dist/context/copilot-context.js.map 4.68 KB
|
|
51
|
+
CJS dist/context/index.js.map 4.91 KB
|
|
52
|
+
CJS dist/hooks/index.js.map 36.47 KB
|
|
53
|
+
CJS dist/hooks/use-chat.js.map 15.27 KB
|
|
54
|
+
CJS dist/hooks/use-make-copilot-document-readable.js.map 5.99 KB
|
|
55
|
+
CJS dist/components/index.js.map 27.80 KB
|
|
60
56
|
CJS dist/hooks/use-tree.js.map 8.32 KB
|
|
57
|
+
CJS dist/lib/index.js.map 16.78 KB
|
|
58
|
+
CJS dist/hooks/use-make-copilot-actionable.js.map 6.22 KB
|
|
59
|
+
CJS dist/hooks/use-make-copilot-readable.js.map 6.04 KB
|
|
60
|
+
CJS dist/types/system-message.js.map 249.00 B
|
|
61
61
|
CJS dist/utils/utils.js.map 137.00 B
|
|
62
|
-
CJS dist/lib/index.js.map 16.46 KB
|
|
63
|
-
CJS dist/components/copilot-provider/standard-copilot-api-config.js.map 1.17 KB
|
|
64
|
-
CJS dist/hooks/use-make-copilot-readable.js.map 5.79 KB
|
|
65
|
-
CJS dist/utils/utils.test.js.map 354.00 B
|
|
66
62
|
CJS dist/types/index.js.map 253.00 B
|
|
67
|
-
CJS dist/
|
|
68
|
-
CJS dist/
|
|
63
|
+
CJS dist/components/copilot-provider/copilotkit.js.map 27.74 KB
|
|
64
|
+
CJS dist/utils/utils.test.js.map 354.00 B
|
|
65
|
+
CJS dist/openai-assistants/hooks/use-copilot-chat-v2.js.map 20.90 KB
|
|
66
|
+
CJS dist/openai-assistants/hooks/index.js.map 21.29 KB
|
|
67
|
+
CJS dist/index.js.map 67.11 KB
|
|
69
68
|
CJS dist/hooks/use-flat-category-store.js.map 4.25 KB
|
|
70
|
-
CJS dist/
|
|
71
|
-
CJS dist/components/copilot-provider/
|
|
72
|
-
CJS dist/
|
|
73
|
-
CJS
|
|
69
|
+
CJS dist/components/copilot-provider/index.js.map 27.93 KB
|
|
70
|
+
CJS dist/components/copilot-provider/standard-copilot-api-config.js.map 1.17 KB
|
|
71
|
+
CJS dist/hooks/use-copilot-chat.js.map 31.56 KB
|
|
72
|
+
CJS dist/openai-assistants/utils/index.js.map 1.44 KB
|
|
73
|
+
CJS ⚡️ Build success in 43ms
|
|
74
74
|
ESM dist/index.mjs 1.52 KB
|
|
75
75
|
ESM dist/components/index.mjs 407.00 B
|
|
76
|
-
ESM dist/context/index.mjs 227.00 B
|
|
77
|
-
ESM dist/hooks/index.mjs 769.00 B
|
|
78
|
-
ESM dist/chunk-4LKP4DMT.mjs 4.39 KB
|
|
79
|
-
ESM dist/chunk-LUGEI4YQ.mjs 43.00 B
|
|
80
|
-
ESM dist/chunk-MZ5UN3BY.mjs 802.00 B
|
|
81
|
-
ESM dist/chunk-FRAKUJWH.mjs 43.00 B
|
|
82
76
|
ESM dist/context/copilot-context.mjs 219.00 B
|
|
77
|
+
ESM dist/hooks/index.mjs 769.00 B
|
|
83
78
|
ESM dist/chunk-7GFKOIO7.mjs 43.00 B
|
|
79
|
+
ESM dist/chunk-2FHJTQBT.mjs 3.17 KB
|
|
80
|
+
ESM dist/chunk-FRAKUJWH.mjs 43.00 B
|
|
81
|
+
ESM dist/chunk-MZ5UN3BY.mjs 802.00 B
|
|
82
|
+
ESM dist/context/index.mjs 227.00 B
|
|
84
83
|
ESM dist/chunk-VNRDQJXW.mjs 43.00 B
|
|
85
|
-
ESM dist/chunk-
|
|
86
|
-
ESM dist/chunk-
|
|
87
|
-
ESM dist/chunk-
|
|
88
|
-
ESM dist/
|
|
89
|
-
ESM dist/chunk-K2LVBFRY.mjs 970.00 B
|
|
90
|
-
ESM dist/chunk-EFZPSZWO.mjs 43.00 B
|
|
91
|
-
ESM dist/chunk-AVLJ3AWG.mjs 2.89 KB
|
|
84
|
+
ESM dist/chunk-WH4L73VS.mjs 970.00 B
|
|
85
|
+
ESM dist/chunk-5UGLWBZJ.mjs 43.00 B
|
|
86
|
+
ESM dist/chunk-JVCBCB2T.mjs 700.00 B
|
|
87
|
+
ESM dist/chunk-2EP7VLPI.mjs 640.00 B
|
|
92
88
|
ESM dist/hooks/use-chat.mjs 174.00 B
|
|
93
|
-
ESM dist/
|
|
89
|
+
ESM dist/hooks/use-copilot-chat.mjs 500.00 B
|
|
90
|
+
ESM dist/chunk-PLHQWEH7.mjs 2.89 KB
|
|
94
91
|
ESM dist/chunk-SPCZTZCY.mjs 43.00 B
|
|
95
92
|
ESM dist/chunk-F2JIAPZQ.mjs 405.00 B
|
|
93
|
+
ESM dist/chunk-6WZFE6II.mjs 4.39 KB
|
|
96
94
|
ESM dist/chunk-VUY2K2DI.mjs 3.89 KB
|
|
97
|
-
ESM dist/chunk-
|
|
98
|
-
ESM dist/chunk-
|
|
99
|
-
ESM dist/chunk-JIKWSWIX.mjs 2.35 KB
|
|
100
|
-
ESM dist/chunk-5UGLWBZJ.mjs 43.00 B
|
|
95
|
+
ESM dist/chunk-L4GSQI5V.mjs 2.58 KB
|
|
96
|
+
ESM dist/chunk-M35FKB5H.mjs 5.04 KB
|
|
101
97
|
ESM dist/chunk-YULKJPY3.mjs 1.84 KB
|
|
98
|
+
ESM dist/chunk-S7ZVOTYK.mjs 1.42 KB
|
|
102
99
|
ESM dist/hooks/use-flat-category-store.mjs 216.00 B
|
|
103
|
-
ESM dist/chunk-JD7BAH7U.mjs 43.00 B
|
|
104
|
-
ESM dist/chunk-NW27C3BV.mjs 5.04 KB
|
|
105
100
|
ESM dist/chunk-MRXNTQOX.mjs 1.89 KB
|
|
106
|
-
ESM dist/
|
|
107
|
-
ESM dist/
|
|
101
|
+
ESM dist/chunk-LUGEI4YQ.mjs 43.00 B
|
|
102
|
+
ESM dist/chunk-JD7BAH7U.mjs 43.00 B
|
|
103
|
+
ESM dist/chunk-BABVSMJR.mjs 43.00 B
|
|
104
|
+
ESM dist/chunk-EFZPSZWO.mjs 43.00 B
|
|
105
|
+
ESM dist/chunk-PHK2K7UB.mjs 4.60 KB
|
|
108
106
|
ESM dist/openai-assistants/hooks/use-copilot-chat-v2.mjs 575.00 B
|
|
109
|
-
ESM dist/types/index.mjs 66.00 B
|
|
110
|
-
ESM dist/openai-assistants/utils/process-message-stream.mjs 188.00 B
|
|
111
107
|
ESM dist/openai-assistants/hooks/use-assistants.mjs 2.59 KB
|
|
112
|
-
ESM dist/utils/utils.mjs 34.00 B
|
|
113
|
-
ESM dist/utils/utils.test.mjs 170.00 B
|
|
114
|
-
ESM dist/components/copilot-provider/index.mjs 396.00 B
|
|
115
108
|
ESM dist/types/system-message.mjs 43.00 B
|
|
116
|
-
ESM dist/
|
|
117
|
-
ESM dist/
|
|
118
|
-
ESM dist/
|
|
109
|
+
ESM dist/utils/utils.test.mjs 170.00 B
|
|
110
|
+
ESM dist/utils/fetch-chat-completion.mjs 319.00 B
|
|
111
|
+
ESM dist/components/copilot-provider/copilotkit-props.mjs 59.00 B
|
|
112
|
+
ESM dist/types/index.mjs 66.00 B
|
|
119
113
|
ESM dist/hooks/use-make-copilot-actionable.mjs 241.00 B
|
|
120
|
-
ESM dist/
|
|
114
|
+
ESM dist/openai-assistants/hooks/index.mjs 548.00 B
|
|
115
|
+
ESM dist/hooks/use-tree.mjs 171.00 B
|
|
116
|
+
ESM dist/hooks/use-make-copilot-readable.mjs 235.00 B
|
|
117
|
+
ESM dist/utils/utils.mjs 34.00 B
|
|
121
118
|
ESM dist/components/copilot-provider/copilotkit.mjs 380.00 B
|
|
122
|
-
ESM dist/components/copilot-provider/copilotkit-props.mjs 59.00 B
|
|
123
|
-
ESM dist/types/document-pointer.mjs 45.00 B
|
|
124
|
-
ESM dist/utils/fetch-chat-completion.mjs 319.00 B
|
|
125
|
-
ESM dist/hooks/use-make-copilot-document-readable.mjs 260.00 B
|
|
126
119
|
ESM dist/lib/index.mjs 435.00 B
|
|
127
|
-
ESM dist/
|
|
128
|
-
ESM dist/
|
|
120
|
+
ESM dist/lib/copilot-task.mjs 410.00 B
|
|
121
|
+
ESM dist/hooks/use-make-copilot-document-readable.mjs 260.00 B
|
|
122
|
+
ESM dist/openai-assistants/index.mjs 597.00 B
|
|
123
|
+
ESM dist/types/document-pointer.mjs 45.00 B
|
|
124
|
+
ESM dist/openai-assistants/utils/process-message-stream.mjs 188.00 B
|
|
125
|
+
ESM dist/openai-assistants/utils/index.mjs 206.00 B
|
|
126
|
+
ESM dist/components/copilot-provider/index.mjs 396.00 B
|
|
127
|
+
ESM dist/components/copilot-provider/standard-copilot-api-config.mjs 201.00 B
|
|
129
128
|
ESM dist/index.mjs.map 71.00 B
|
|
130
|
-
ESM dist/
|
|
131
|
-
ESM dist/hooks/index.mjs.map 71.00 B
|
|
132
|
-
ESM dist/chunk-LUGEI4YQ.mjs.map 71.00 B
|
|
133
|
-
ESM dist/chunk-4LKP4DMT.mjs.map 7.90 KB
|
|
134
|
-
ESM dist/chunk-7GFKOIO7.mjs.map 71.00 B
|
|
129
|
+
ESM dist/components/index.mjs.map 71.00 B
|
|
135
130
|
ESM dist/context/copilot-context.mjs.map 71.00 B
|
|
131
|
+
ESM dist/hooks/index.mjs.map 71.00 B
|
|
132
|
+
ESM dist/context/index.mjs.map 71.00 B
|
|
133
|
+
ESM dist/chunk-FRAKUJWH.mjs.map 71.00 B
|
|
136
134
|
ESM dist/chunk-MZ5UN3BY.mjs.map 1.26 KB
|
|
137
|
-
ESM dist/chunk-
|
|
138
|
-
ESM dist/chunk-
|
|
135
|
+
ESM dist/chunk-WH4L73VS.mjs.map 1.66 KB
|
|
136
|
+
ESM dist/chunk-5UGLWBZJ.mjs.map 71.00 B
|
|
139
137
|
ESM dist/chunk-VNRDQJXW.mjs.map 71.00 B
|
|
138
|
+
ESM dist/chunk-2FHJTQBT.mjs.map 5.55 KB
|
|
139
|
+
ESM dist/chunk-2EP7VLPI.mjs.map 1.47 KB
|
|
140
140
|
ESM dist/hooks/use-copilot-chat.mjs.map 71.00 B
|
|
141
|
-
ESM dist/chunk-
|
|
142
|
-
ESM dist/chunk-
|
|
143
|
-
ESM dist/
|
|
144
|
-
ESM dist/chunk-SPCZTZCY.mjs.map 71.00 B
|
|
141
|
+
ESM dist/chunk-7GFKOIO7.mjs.map 71.00 B
|
|
142
|
+
ESM dist/chunk-JVCBCB2T.mjs.map 1.42 KB
|
|
143
|
+
ESM dist/hooks/use-chat.mjs.map 71.00 B
|
|
145
144
|
ESM dist/chunk-VUY2K2DI.mjs.map 8.27 KB
|
|
145
|
+
ESM dist/chunk-L4GSQI5V.mjs.map 4.26 KB
|
|
146
146
|
ESM dist/chunk-F2JIAPZQ.mjs.map 1.12 KB
|
|
147
|
-
ESM dist/chunk-
|
|
148
|
-
ESM dist/chunk-EFZPSZWO.mjs.map 71.00 B
|
|
149
|
-
ESM dist/chunk-JIKWSWIX.mjs.map 3.98 KB
|
|
150
|
-
ESM dist/chunk-BABVSMJR.mjs.map 71.00 B
|
|
151
|
-
ESM dist/chunk-AVLJ3AWG.mjs.map 4.59 KB
|
|
152
|
-
ESM dist/chunk-5UGLWBZJ.mjs.map 71.00 B
|
|
153
|
-
ESM dist/chunk-4OWTRVNI.mjs.map 4.35 KB
|
|
154
|
-
ESM dist/hooks/use-flat-category-store.mjs.map 71.00 B
|
|
155
|
-
ESM dist/hooks/use-chat.mjs.map 71.00 B
|
|
156
|
-
ESM dist/chunk-JD7BAH7U.mjs.map 71.00 B
|
|
147
|
+
ESM dist/chunk-6WZFE6II.mjs.map 7.90 KB
|
|
157
148
|
ESM dist/chunk-YULKJPY3.mjs.map 4.21 KB
|
|
158
|
-
ESM dist/chunk-
|
|
149
|
+
ESM dist/chunk-S7ZVOTYK.mjs.map 4.59 KB
|
|
159
150
|
ESM dist/chunk-MRXNTQOX.mjs.map 71.00 B
|
|
160
|
-
ESM dist/
|
|
151
|
+
ESM dist/chunk-PLHQWEH7.mjs.map 4.59 KB
|
|
152
|
+
ESM dist/chunk-LUGEI4YQ.mjs.map 71.00 B
|
|
153
|
+
ESM dist/chunk-JD7BAH7U.mjs.map 71.00 B
|
|
154
|
+
ESM dist/hooks/use-flat-category-store.mjs.map 71.00 B
|
|
155
|
+
ESM dist/chunk-BABVSMJR.mjs.map 71.00 B
|
|
156
|
+
ESM dist/chunk-M35FKB5H.mjs.map 11.29 KB
|
|
157
|
+
ESM dist/chunk-SPCZTZCY.mjs.map 71.00 B
|
|
158
|
+
ESM dist/chunk-EFZPSZWO.mjs.map 71.00 B
|
|
159
|
+
ESM dist/chunk-PHK2K7UB.mjs.map 9.68 KB
|
|
161
160
|
ESM dist/openai-assistants/hooks/use-copilot-chat-v2.mjs.map 71.00 B
|
|
162
|
-
ESM dist/utils/utils.mjs.map 71.00 B
|
|
163
161
|
ESM dist/openai-assistants/hooks/use-assistants.mjs.map 4.67 KB
|
|
164
|
-
ESM dist/
|
|
165
|
-
ESM dist/
|
|
166
|
-
ESM dist/openai-assistants/utils/index.mjs.map 71.00 B
|
|
167
|
-
ESM dist/openai-assistants/index.mjs.map 71.00 B
|
|
168
|
-
ESM dist/hooks/use-make-copilot-readable.mjs.map 71.00 B
|
|
162
|
+
ESM dist/types/index.mjs.map 71.00 B
|
|
163
|
+
ESM dist/utils/fetch-chat-completion.mjs.map 71.00 B
|
|
169
164
|
ESM dist/hooks/use-make-copilot-actionable.mjs.map 71.00 B
|
|
170
|
-
ESM dist/components/copilot-provider/copilotkit-props.mjs.map 71.00 B
|
|
171
165
|
ESM dist/types/system-message.mjs.map 71.00 B
|
|
166
|
+
ESM dist/hooks/use-tree.mjs.map 71.00 B
|
|
167
|
+
ESM dist/hooks/use-make-copilot-readable.mjs.map 71.00 B
|
|
168
|
+
ESM dist/utils/utils.mjs.map 71.00 B
|
|
172
169
|
ESM dist/lib/copilot-task.mjs.map 71.00 B
|
|
170
|
+
ESM dist/lib/index.mjs.map 71.00 B
|
|
171
|
+
ESM dist/hooks/use-make-copilot-document-readable.mjs.map 71.00 B
|
|
173
172
|
ESM dist/components/copilot-provider/copilotkit.mjs.map 71.00 B
|
|
174
|
-
ESM dist/
|
|
173
|
+
ESM dist/openai-assistants/index.mjs.map 71.00 B
|
|
174
|
+
ESM dist/types/document-pointer.mjs.map 71.00 B
|
|
175
175
|
ESM dist/openai-assistants/hooks/index.mjs.map 71.00 B
|
|
176
|
+
ESM dist/utils/utils.test.mjs.map 352.00 B
|
|
176
177
|
ESM dist/openai-assistants/utils/process-message-stream.mjs.map 71.00 B
|
|
177
|
-
ESM dist/utils/
|
|
178
|
-
ESM dist/
|
|
179
|
-
ESM dist/
|
|
180
|
-
ESM dist/
|
|
181
|
-
ESM
|
|
182
|
-
ESM ⚡️ Build success in 39ms
|
|
178
|
+
ESM dist/openai-assistants/utils/index.mjs.map 71.00 B
|
|
179
|
+
ESM dist/components/copilot-provider/copilotkit-props.mjs.map 71.00 B
|
|
180
|
+
ESM dist/components/copilot-provider/standard-copilot-api-config.mjs.map 71.00 B
|
|
181
|
+
ESM dist/components/copilot-provider/index.mjs.map 71.00 B
|
|
182
|
+
ESM ⚡️ Build success in 46ms
|
|
183
183
|
DTS Build start
|
|
184
|
-
DTS ⚡️ Build success in
|
|
184
|
+
DTS ⚡️ Build success in 2081ms
|
|
185
185
|
DTS dist/index.d.ts 1.41 KB
|
|
186
186
|
DTS dist/components/copilot-provider/copilotkit.d.ts 1.26 KB
|
|
187
|
-
DTS dist/components/copilot-provider/copilotkit-props.d.ts
|
|
188
|
-
DTS dist/context/copilot-context.d.ts 2.
|
|
187
|
+
DTS dist/components/copilot-provider/copilotkit-props.d.ts 1007.00 B
|
|
188
|
+
DTS dist/context/copilot-context.d.ts 2.31 KB
|
|
189
189
|
DTS dist/hooks/use-copilot-chat.d.ts 1.01 KB
|
|
190
190
|
DTS dist/hooks/use-make-copilot-actionable.d.ts 243.00 B
|
|
191
191
|
DTS dist/hooks/use-make-copilot-readable.d.ts 598.00 B
|
package/CHANGELOG.md
CHANGED
|
@@ -1,26 +1,15 @@
|
|
|
1
1
|
# ui
|
|
2
2
|
|
|
3
|
-
## 0.20.0-
|
|
3
|
+
## 0.20.0-arnold-backend-only-props.1
|
|
4
4
|
|
|
5
5
|
### Minor Changes
|
|
6
6
|
|
|
7
|
-
-
|
|
7
|
+
- backend-only-props
|
|
8
8
|
|
|
9
9
|
### Patch Changes
|
|
10
10
|
|
|
11
11
|
- Updated dependencies
|
|
12
|
-
- @copilotkit/shared@0.4.0-
|
|
13
|
-
|
|
14
|
-
## 0.20.0-tools.1
|
|
15
|
-
|
|
16
|
-
### Minor Changes
|
|
17
|
-
|
|
18
|
-
- function return
|
|
19
|
-
|
|
20
|
-
### Patch Changes
|
|
21
|
-
|
|
22
|
-
- Updated dependencies
|
|
23
|
-
- @copilotkit/shared@0.4.0-tools.1
|
|
12
|
+
- @copilotkit/shared@0.4.0-arnold-backend-only-props.1
|
|
24
13
|
|
|
25
14
|
## 0.20.0-tools.0
|
|
26
15
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CopilotContext
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-S7ZVOTYK.mjs";
|
|
4
4
|
|
|
5
5
|
// src/hooks/use-make-copilot-readable.ts
|
|
6
6
|
import { useContext, useEffect, useRef } from "react";
|
|
@@ -20,4 +20,4 @@ function useMakeCopilotReadable(information, parentId, categories) {
|
|
|
20
20
|
export {
|
|
21
21
|
useMakeCopilotReadable
|
|
22
22
|
};
|
|
23
|
-
//# sourceMappingURL=chunk-
|
|
23
|
+
//# sourceMappingURL=chunk-2EP7VLPI.mjs.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
defaultCopilotContextCategories
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-PHK2K7UB.mjs";
|
|
4
4
|
import {
|
|
5
5
|
fetchAndDecodeChatCompletion
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-L4GSQI5V.mjs";
|
|
7
7
|
import {
|
|
8
8
|
__async
|
|
9
9
|
} from "./chunk-MRXNTQOX.mjs";
|
|
@@ -99,4 +99,4 @@ ${instructions}
|
|
|
99
99
|
export {
|
|
100
100
|
CopilotTask
|
|
101
101
|
};
|
|
102
|
-
//# sourceMappingURL=chunk-
|
|
102
|
+
//# sourceMappingURL=chunk-2FHJTQBT.mjs.map
|
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
} from "./chunk-MZ5UN3BY.mjs";
|
|
4
4
|
import {
|
|
5
5
|
defaultCopilotContextCategories
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-PHK2K7UB.mjs";
|
|
7
7
|
import {
|
|
8
8
|
CopilotContext
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-S7ZVOTYK.mjs";
|
|
10
10
|
import {
|
|
11
11
|
__async,
|
|
12
12
|
__spreadValues
|
|
@@ -134,4 +134,4 @@ export {
|
|
|
134
134
|
useCopilotChatV2,
|
|
135
135
|
defaultSystemMessage
|
|
136
136
|
};
|
|
137
|
-
//# sourceMappingURL=chunk-
|
|
137
|
+
//# sourceMappingURL=chunk-6WZFE6II.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CopilotContext
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-S7ZVOTYK.mjs";
|
|
4
4
|
|
|
5
5
|
// src/hooks/use-make-copilot-document-readable.ts
|
|
6
6
|
import { useContext, useEffect, useRef } from "react";
|
|
@@ -20,4 +20,4 @@ function useMakeCopilotDocumentReadable(document, categories, dependencies = [])
|
|
|
20
20
|
export {
|
|
21
21
|
useMakeCopilotDocumentReadable
|
|
22
22
|
};
|
|
23
|
-
//# sourceMappingURL=chunk-
|
|
23
|
+
//# sourceMappingURL=chunk-JVCBCB2T.mjs.map
|
|
@@ -32,11 +32,14 @@ function fetchChatCompletion(_0) {
|
|
|
32
32
|
headers: __spreadValues(__spreadValues({
|
|
33
33
|
"Content-Type": "application/json"
|
|
34
34
|
}, copilotConfig.headers), headers ? __spreadValues({}, headers) : {}),
|
|
35
|
-
body: JSON.stringify(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({
|
|
35
|
+
body: JSON.stringify(__spreadValues(__spreadProps(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({
|
|
36
36
|
model,
|
|
37
37
|
messages: cleanedMessages,
|
|
38
38
|
stream: true
|
|
39
|
-
}, tools.length ? { tools } : {}), temperature ? { temperature } : {}), tools.length != 0 ? { tool_choice: "auto" } : {}), copilotConfig.body),
|
|
39
|
+
}, tools.length ? { tools } : {}), temperature ? { temperature } : {}), tools.length != 0 ? { tool_choice: "auto" } : {}), copilotConfig.body), copilotConfig.backendOnlyProps), {
|
|
40
|
+
//get backendOnlyPropsKeys to backend to remove them from the forwardedProps
|
|
41
|
+
backend_only_props_keys: Object.keys(copilotConfig["body"] || {})
|
|
42
|
+
}), body ? __spreadValues({}, body) : {})),
|
|
40
43
|
signal
|
|
41
44
|
});
|
|
42
45
|
return response;
|
|
@@ -70,4 +73,4 @@ export {
|
|
|
70
73
|
fetchAndDecodeChatCompletion,
|
|
71
74
|
fetchAndDecodeChatCompletionAsText
|
|
72
75
|
};
|
|
73
|
-
//# sourceMappingURL=chunk-
|
|
76
|
+
//# sourceMappingURL=chunk-L4GSQI5V.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/utils/fetch-chat-completion.ts"],"sourcesContent":["import {\n Message,\n ToolDefinition,\n ChatCompletionEvent,\n decodeChatCompletion,\n parseChatCompletion,\n decodeChatCompletionAsText,\n} from \"@copilotkit/shared\";\nimport { CopilotApiConfig } from \"../context\";\n\nexport interface FetchChatCompletionParams {\n copilotConfig: CopilotApiConfig;\n model?: string;\n messages: Message[];\n tools?: ToolDefinition[];\n temperature?: number;\n maxTokens?: number;\n headers?: Record<string, string> | Headers;\n body?: object;\n signal?: AbortSignal;\n}\n\nexport async function fetchChatCompletion({\n copilotConfig,\n model,\n messages,\n tools,\n temperature,\n headers,\n body,\n signal,\n}: FetchChatCompletionParams): Promise<Response> {\n temperature ||= 0.5;\n tools ||= [];\n\n // clean up any extra properties from messages\n const cleanedMessages = messages.map((message) => {\n const { content, role, name, function_call } = message;\n return { content, role, name, function_call };\n });\n\n const response = await fetch(copilotConfig.chatApiEndpoint, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n ...copilotConfig.headers,\n ...(headers ? { ...headers } : {}),\n },\n body: JSON.stringify({\n model,\n messages: cleanedMessages,\n stream: true,\n ...(tools.length ? { tools } : {}),\n ...(temperature ? { temperature } : {}),\n ...(tools.length != 0 ? { tool_choice: \"auto\" } : {}),\n ...copilotConfig.body,\n ...copilotConfig.backendOnlyProps,\n //get backendOnlyPropsKeys to backend to remove them from the forwardedProps\n backend_only_props_keys: Object.keys(copilotConfig[\"body\"] || {}),\n ...(body ? { ...body } : {}),\n }),\n signal,\n });\n\n return response;\n}\n\nexport interface DecodedChatCompletionResponse extends Response {\n events: ReadableStream<ChatCompletionEvent> | null;\n}\n\nexport async function fetchAndDecodeChatCompletion(\n params: FetchChatCompletionParams,\n): Promise<DecodedChatCompletionResponse> {\n const response = await fetchChatCompletion(params);\n if (!response.ok || !response.body) {\n return { ...response, events: null };\n }\n const events = await decodeChatCompletion(parseChatCompletion(response.body));\n return { ...response, events };\n}\n\nexport interface DecodedChatCompletionResponseAsText extends Response {\n events: ReadableStream<string> | null;\n}\n\nexport async function fetchAndDecodeChatCompletionAsText(\n params: FetchChatCompletionParams,\n): Promise<DecodedChatCompletionResponseAsText> {\n const response = await fetchChatCompletion(params);\n if (!response.ok || !response.body) {\n return { ...response, events: null };\n }\n const events = await decodeChatCompletionAsText(\n decodeChatCompletion(parseChatCompletion(response.body)),\n );\n return { ...response, events };\n}\n"],"mappings":";;;;;;;AAAA;AAAA,EAIE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAeP,SAAsB,oBAAoB,IASO;AAAA,6CATP;AAAA,IACxC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,GAAiD;AAC/C,kCAAgB;AAChB,sBAAU,CAAC;AAGX,UAAM,kBAAkB,SAAS,IAAI,CAAC,YAAY;AAChD,YAAM,EAAE,SAAS,MAAM,MAAM,cAAc,IAAI;AAC/C,aAAO,EAAE,SAAS,MAAM,MAAM,cAAc;AAAA,IAC9C,C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2
|
fetchAndDecodeChatCompletion
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-L4GSQI5V.mjs";
|
|
4
4
|
import {
|
|
5
5
|
__async
|
|
6
6
|
} from "./chunk-MRXNTQOX.mjs";
|
|
@@ -155,4 +155,4 @@ function useChat(options) {
|
|
|
155
155
|
export {
|
|
156
156
|
useChat
|
|
157
157
|
};
|
|
158
|
-
//# sourceMappingURL=chunk-
|
|
158
|
+
//# sourceMappingURL=chunk-M35FKB5H.mjs.map
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
} from "./chunk-VUY2K2DI.mjs";
|
|
7
7
|
import {
|
|
8
8
|
CopilotContext
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-S7ZVOTYK.mjs";
|
|
10
10
|
import {
|
|
11
11
|
use_flat_category_store_default
|
|
12
12
|
} from "./chunk-YULKJPY3.mjs";
|
|
@@ -105,7 +105,7 @@ ${nonDocumentStrings}`;
|
|
|
105
105
|
props.url,
|
|
106
106
|
`${props.url}/v2`,
|
|
107
107
|
props.headers || {},
|
|
108
|
-
props.body
|
|
108
|
+
__spreadValues(__spreadValues({}, props.body), props.backendOnlyProps)
|
|
109
109
|
);
|
|
110
110
|
return /* @__PURE__ */ jsx(
|
|
111
111
|
CopilotContext.Provider,
|
|
@@ -159,4 +159,4 @@ export {
|
|
|
159
159
|
CopilotKit,
|
|
160
160
|
defaultCopilotContextCategories
|
|
161
161
|
};
|
|
162
|
-
//# sourceMappingURL=chunk-
|
|
162
|
+
//# sourceMappingURL=chunk-PHK2K7UB.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/copilot-provider/copilotkit.tsx"],"sourcesContent":["\"use client\";\n\nimport { FunctionDefinition } from \"@copilotkit/shared\";\nimport { useCallback, useState } from \"react\";\nimport { CopilotContext, CopilotApiConfig } from \"../../context/copilot-context\";\nimport useTree from \"../../hooks/use-tree\";\nimport { DocumentPointer } from \"../../types\";\nimport {\n FunctionCallHandler,\n AnnotatedFunction,\n annotatedFunctionToChatCompletionFunction,\n} from \"@copilotkit/shared\";\nimport useFlatCategoryStore from \"../../hooks/use-flat-category-store\";\nimport { StandardCopilotApiConfig } from \"./standard-copilot-api-config\";\nimport { CopilotKitProps } from \"./copilotkit-props\";\nimport { ToolDefinition } from \"@copilotkit/shared\";\n\n/**\n * The CopilotKit component.\n * This component provides the Copilot context to its children.\n * It can be configured either with a chat API endpoint or a CopilotApiConfig.\n *\n * NOTE: The backend can use OpenAI, or you can bring your own LLM.\n * For examples of the backend api implementation, see `examples/next-openai` usage (under `src/api/copilotkit`),\n * or read the documentation at https://docs.copilotkit.ai\n * In particular, Getting-Started > Quickstart-Backend: https://docs.copilotkit.ai/getting-started/quickstart-backend\n *\n * Example usage:\n * ```\n * <CopilotKit url=\"https://your.copilotkit.api\">\n * <App />\n * </CopilotKit>\n * ```\n *\n * or\n *\n * ```\n * const copilotApiConfig = new StandardCopilotApiConfig(\n * \"https://your.copilotkit.api/v1\",\n * \"https://your.copilotkit.api/v2\",\n * {},\n * {}\n * );\n *\n * // ...\n *\n * <CopilotKit chatApiConfig={copilotApiConfig}>\n * <App />\n * </CopilotKit>\n * ```\n *\n * @param props - The props for the component.\n * @returns The CopilotKit component.\n */\nexport function CopilotKit({ children, ...props }: CopilotKitProps) {\n // Compute all the functions and properties that we need to pass\n // to the CopilotContext.\n\n const [entryPoints, setEntryPoints] = useState<Record<string, AnnotatedFunction<any[]>>>({});\n\n const { addElement, removeElement, printTree } = useTree();\n\n const {\n addElement: addDocument,\n removeElement: removeDocument,\n allElements: allDocuments,\n } = useFlatCategoryStore<DocumentPointer>();\n\n const setEntryPoint = useCallback((id: string, entryPoint: AnnotatedFunction<any[]>) => {\n setEntryPoints((prevPoints) => {\n return {\n ...prevPoints,\n [id]: entryPoint,\n };\n });\n }, []);\n\n const removeEntryPoint = useCallback((id: string) => {\n setEntryPoints((prevPoints) => {\n const newPoints = { ...prevPoints };\n delete newPoints[id];\n return newPoints;\n });\n }, []);\n\n const getContextString = useCallback(\n (documents: DocumentPointer[], categories: string[]) => {\n const documentsString = documents\n .map((document) => {\n return `${document.name} (${document.sourceApplication}):\\n${document.getContents()}`;\n })\n .join(\"\\n\\n\");\n\n const nonDocumentStrings = printTree(categories);\n\n return `${documentsString}\\n\\n${nonDocumentStrings}`;\n },\n [printTree],\n );\n\n const addContext = useCallback(\n (\n context: string,\n parentId?: string,\n categories: string[] = defaultCopilotContextCategories,\n ) => {\n return addElement(context, categories, parentId);\n },\n [addElement],\n );\n\n const removeContext = useCallback(\n (id: string) => {\n removeElement(id);\n },\n [removeElement],\n );\n\n const getChatCompletionFunctionDescriptions = useCallback(\n (customEntryPoints?: Record<string, AnnotatedFunction<any[]>>) => {\n return entryPointsToChatCompletionFunctions(Object.values(customEntryPoints || entryPoints));\n },\n [entryPoints],\n );\n\n const getFunctionCallHandler = useCallback(\n (customEntryPoints?: Record<string, AnnotatedFunction<any[]>>) => {\n return entryPointsToFunctionCallHandler(Object.values(customEntryPoints || entryPoints));\n },\n [entryPoints],\n );\n\n const getDocumentsContext = useCallback(\n (categories: string[]) => {\n return allDocuments(categories);\n },\n [allDocuments],\n );\n\n const addDocumentContext = useCallback(\n (documentPointer: DocumentPointer, categories: string[] = defaultCopilotContextCategories) => {\n return addDocument(documentPointer, categories);\n },\n [addDocument],\n );\n\n const removeDocumentContext = useCallback(\n (documentId: string) => {\n removeDocument(documentId);\n },\n [removeDocument],\n );\n\n // get the appropriate CopilotApiConfig from the props\n const copilotApiConfig: CopilotApiConfig = new StandardCopilotApiConfig(\n props.url,\n `${props.url}/v2`,\n props.headers || {},\n {\n ...props.body,\n ...props.backendOnlyProps,\n },\n );\n\n return (\n <CopilotContext.Provider\n value={{\n entryPoints,\n getChatCompletionFunctionDescriptions,\n getFunctionCallHandler,\n setEntryPoint,\n removeEntryPoint,\n getContextString,\n addContext,\n removeContext,\n getDocumentsContext,\n addDocumentContext,\n removeDocumentContext,\n copilotApiConfig: copilotApiConfig,\n }}\n >\n {children}\n </CopilotContext.Provider>\n );\n}\n\nexport const defaultCopilotContextCategories = [\"global\"];\n\nfunction entryPointsToFunctionCallHandler(\n entryPoints: AnnotatedFunction<any[]>[],\n): FunctionCallHandler {\n return async (chatMessages, functionCall) => {\n let entrypointsByFunctionName: Record<string, AnnotatedFunction<any[]>> = {};\n for (let entryPoint of entryPoints) {\n entrypointsByFunctionName[entryPoint.name] = entryPoint;\n }\n\n const entryPointFunction = entrypointsByFunctionName[functionCall.name || \"\"];\n if (entryPointFunction) {\n let functionCallArguments: Record<string, any>[] = [];\n if (functionCall.arguments) {\n functionCallArguments = JSON.parse(functionCall.arguments);\n }\n\n const paramsInCorrectOrder: any[] = [];\n for (let arg of entryPointFunction.argumentAnnotations) {\n paramsInCorrectOrder.push(\n functionCallArguments[arg.name as keyof typeof functionCallArguments],\n );\n }\n\n await entryPointFunction.implementation(...paramsInCorrectOrder);\n\n // commented out becasue for now we don't want to return anything\n // const result = await entryPointFunction.implementation(\n // ...parsedFunctionCallArguments\n // );\n // const functionResponse: ChatRequest = {\n // messages: [\n // ...chatMessages,\n // {\n // id: nanoid(),\n // name: functionCall.name,\n // role: 'function' as const,\n // content: JSON.stringify(result),\n // },\n // ],\n // };\n\n // return functionResponse;\n }\n };\n}\n\nfunction entryPointsToChatCompletionFunctions(\n entryPoints: AnnotatedFunction<any[]>[],\n): ToolDefinition[] {\n return entryPoints.map(annotatedFunctionToChatCompletionFunction);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAGA,SAAS,aAAa,gBAAgB;AAItC;AAAA,EAGE;AAAA,OACK;AA0JH;AA/GG,SAAS,WAAW,IAAyC;AAAzC,eAAE,WAtD7B,IAsD2B,IAAe,kBAAf,IAAe,CAAb;AAI3B,QAAM,CAAC,aAAa,cAAc,IAAI,SAAmD,CAAC,CAAC;AAE3F,QAAM,EAAE,YAAY,eAAe,UAAU,IAAI,iBAAQ;AAEzD,QAAM;AAAA,I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6BAAqB;AAAA,UACnB,sBAAsB,IAAI,IAA0C;AAAA,QACtE;AAAA,MACF;AAEA,YAAM,mBAAmB,eAAe,GAAG,oBAAoB;AAAA,IAmBjE;AAAA,EACF;AACF;AAEA,SAAS,qCACP,aACkB;AAClB,SAAO,YAAY,IAAI,yCAAyC;AAClE;","names":[]}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
defaultCopilotContextCategories
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-PHK2K7UB.mjs";
|
|
4
4
|
import {
|
|
5
5
|
CopilotContext
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-S7ZVOTYK.mjs";
|
|
7
7
|
import {
|
|
8
8
|
useChat
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-M35FKB5H.mjs";
|
|
10
10
|
import {
|
|
11
11
|
__objRest,
|
|
12
12
|
__spreadProps,
|
|
@@ -91,4 +91,4 @@ export {
|
|
|
91
91
|
useCopilotChat,
|
|
92
92
|
defaultSystemMessage
|
|
93
93
|
};
|
|
94
|
-
//# sourceMappingURL=chunk-
|
|
94
|
+
//# sourceMappingURL=chunk-PLHQWEH7.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/context/copilot-context.tsx"],"sourcesContent":["\"use client\";\n\nimport { FunctionCallHandler, AnnotatedFunction, ToolDefinition } from \"@copilotkit/shared\";\nimport React from \"react\";\nimport { TreeNodeId } from \"../hooks/use-tree\";\nimport { DocumentPointer } from \"../types\";\n\n/**\n * Interface for the configuration of the Copilot API.\n */\nexport interface CopilotApiConfig {\n /**\n * The endpoint for the chat API.\n */\n chatApiEndpoint: string;\n\n /**\n * The endpoint for the chat API v2.\n */\n chatApiEndpointV2: string;\n\n /**\n * additional headers to be sent with the request\n * @default {}\n * @example\n * ```\n * {\n * 'Authorization': 'Bearer your_token_here'\n * }\n * ```\n */\n headers: Record<string, string>;\n\n /**\n * Additional body params to be sent with the request\n * @default {}\n * @example\n * ```\n * {\n * 'message': 'Hello, world!'\n * }\n * ```\n */\n body: Record<string, any>;\n\n /**\n * Backend only props that will be combined to body params to be sent with the request\n * @default {}\n * @example\n * ```\n * {\n * 'user_id': 'user_id'\n * }\n * ```\n */\n backendOnlyProps?: Record<string, any>;\n}\n\nexport interface CopilotContextParams {\n // function-calling\n entryPoints: Record<string, AnnotatedFunction<any[]>>;\n setEntryPoint: (id: string, entryPoint: AnnotatedFunction<any[]>) => void;\n removeEntryPoint: (id: string) => void;\n getChatCompletionFunctionDescriptions: (\n customEntryPoints?: Record<string, AnnotatedFunction<any[]>>,\n ) => ToolDefinition[];\n getFunctionCallHandler: (\n customEntryPoints?: Record<string, AnnotatedFunction<any[]>>,\n ) => FunctionCallHandler;\n\n // text context\n addContext: (context: string, parentId?: string, categories?: string[]) => TreeNodeId;\n removeContext: (id: TreeNodeId) => void;\n getContextString: (documents: DocumentPointer[], categories: string[]) => string;\n\n // document context\n addDocumentContext: (documentPointer: DocumentPointer, categories?: string[]) => TreeNodeId;\n removeDocumentContext: (documentId: string) => void;\n getDocumentsContext: (categories: string[]) => DocumentPointer[];\n\n // api endpoints\n copilotApiConfig: CopilotApiConfig;\n}\n\nconst emptyCopilotContext: CopilotContextParams = {\n entryPoints: {},\n setEntryPoint: () => {},\n removeEntryPoint: () => {},\n getChatCompletionFunctionDescriptions: () => returnAndThrowInDebug([]),\n getFunctionCallHandler: () => returnAndThrowInDebug(async () => {}),\n\n getContextString: (documents: DocumentPointer[], categories: string[]) =>\n returnAndThrowInDebug(\"\"),\n addContext: () => \"\",\n removeContext: () => {},\n\n getDocumentsContext: (categories: string[]) => returnAndThrowInDebug([]),\n addDocumentContext: () => returnAndThrowInDebug(\"\"),\n removeDocumentContext: () => {},\n\n copilotApiConfig: new (class implements CopilotApiConfig {\n get chatApiEndpoint(): string {\n throw new Error(\"Remember to wrap your app in a `<CopilotKit> {...} </CopilotKit>` !!!\");\n }\n get chatApiEndpointV2(): string {\n throw new Error(\"Remember to wrap your app in a `<CopilotKit> {...} </CopilotKit>` !!!\");\n }\n get headers(): Record<string, string> {\n return {};\n }\n get body(): Record<string, any> {\n return {};\n }\n })(),\n};\n\nexport const CopilotContext = React.createContext<CopilotContextParams>(emptyCopilotContext);\n\nexport function useCopilotContext(): CopilotContextParams {\n return React.useContext(CopilotContext);\n}\n\nfunction returnAndThrowInDebug<T>(value: T): T {\n throw new Error(\"Remember to wrap your app in a `<CopilotKit> {...} </CopilotKit>` !!!\");\n return value;\n}\n"],"mappings":";;;;;AAGA,OAAO,WAAW;AAiFlB,IAAM,sBAA4C;AAAA,EAChD,aAAa,CAAC;AAAA,EACd,eAAe,MAAM;AAAA,EAAC;AAAA,EACtB,kBAAkB,MAAM;AAAA,EAAC;AAAA,EACzB,uCAAuC,MAAM,sBAAsB,CAAC,CAAC;AAAA,EACrE,wBAAwB,MAAM,sBAAsB,MAAY;AAAA,EAAC,EAAC;AAAA,EAElE,kBAAkB,CAAC,WAA8B,eAC/C,sBAAsB,EAAE;AAAA,EAC1B,YAAY,MAAM;AAAA,EAClB,eAAe,MAAM;AAAA,EAAC;AAAA,EAEtB,qBAAqB,CAAC,eAAyB,sBAAsB,CAAC,CAAC;AAAA,EACvE,oBAAoB,MAAM,sBAAsB,EAAE;AAAA,EAClD,uBAAuB,MAAM;AAAA,EAAC;AAAA,EAE9B,kBAAkB,IAAK,MAAkC;AAAA,IACvD,IAAI,kBAA0B;AAC5B,YAAM,IAAI,MAAM,uEAAuE;AAAA,IACzF;AAAA,IACA,IAAI,oBAA4B;AAC9B,YAAM,IAAI,MAAM,uEAAuE;AAAA,IACzF;AAAA,IACA,IAAI,UAAkC;AACpC,aAAO,CAAC;AAAA,IACV;AAAA,IACA,IAAI,OAA4B;AAC9B,aAAO,CAAC;AAAA,IACV;AAAA,EACF,EAAG;AACL;AAEO,IAAM,iBAAiB,MAAM,cAAoC,mBAAmB;AAEpF,SAAS,oBAA0C;AACxD,SAAO,MAAM,WAAW,cAAc;AACxC;AAEA,SAAS,sBAAyB,OAAa;AAC7C,QAAM,IAAI,MAAM,uEAAuE;AACvF,SAAO;AACT;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CopilotContext
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-S7ZVOTYK.mjs";
|
|
4
4
|
|
|
5
5
|
// src/hooks/use-make-copilot-actionable.ts
|
|
6
6
|
import { useRef, useContext, useEffect, useMemo } from "react";
|
|
@@ -28,4 +28,4 @@ function useMakeCopilotActionable(annotatedFunction, dependencies) {
|
|
|
28
28
|
export {
|
|
29
29
|
useMakeCopilotActionable
|
|
30
30
|
};
|
|
31
|
-
//# sourceMappingURL=chunk-
|
|
31
|
+
//# sourceMappingURL=chunk-WH4L73VS.mjs.map
|
|
@@ -34,6 +34,17 @@ interface CopilotKitProps {
|
|
|
34
34
|
* The children to be rendered within the CopilotKit.
|
|
35
35
|
*/
|
|
36
36
|
children: ReactNode;
|
|
37
|
+
/**
|
|
38
|
+
* Backend only props that will be combined to body params to be sent with the request
|
|
39
|
+
* @default {}
|
|
40
|
+
* @example
|
|
41
|
+
* ```
|
|
42
|
+
* {
|
|
43
|
+
* 'user_id': 'users_id',
|
|
44
|
+
* }
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
backendOnlyProps?: Record<string, any>;
|
|
37
48
|
}
|
|
38
49
|
|
|
39
50
|
export { CopilotKitProps };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/copilot-provider/copilotkit-props.tsx"],"sourcesContent":["\"use client\";\nimport { ReactNode } from \"react\";\n\n/**\n * Props for CopilotKit.\n */\n\nexport interface CopilotKitProps {\n /**\n * The endpoint for the chat API.\n */\n url: string;\n\n /**\n * additional headers to be sent with the request\n * @default {}\n * @example\n * ```\n * {\n * 'Authorization': 'Bearer your_token_here'\n * }\n * ```\n */\n headers?: Record<string, string>;\n\n /**\n * Additional body params to be sent with the request\n * @default {}\n * @example\n * ```\n * {\n * 'message': 'Hello, world!'\n * }\n * ```\n */\n body?: Record<string, any>;\n\n /**\n * The children to be rendered within the CopilotKit.\n */\n children: ReactNode;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../src/components/copilot-provider/copilotkit-props.tsx"],"sourcesContent":["\"use client\";\nimport { ReactNode } from \"react\";\n\n/**\n * Props for CopilotKit.\n */\n\nexport interface CopilotKitProps {\n /**\n * The endpoint for the chat API.\n */\n url: string;\n\n /**\n * additional headers to be sent with the request\n * @default {}\n * @example\n * ```\n * {\n * 'Authorization': 'Bearer your_token_here'\n * }\n * ```\n */\n headers?: Record<string, string>;\n\n /**\n * Additional body params to be sent with the request\n * @default {}\n * @example\n * ```\n * {\n * 'message': 'Hello, world!'\n * }\n * ```\n */\n body?: Record<string, any>;\n\n /**\n * The children to be rendered within the CopilotKit.\n */\n children: ReactNode;\n\n /**\n * Backend only props that will be combined to body params to be sent with the request\n * @default {}\n * @example\n * ```\n * {\n * 'user_id': 'users_id',\n * }\n * ```\n */\n backendOnlyProps?: Record<string, any>;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
|
@@ -420,7 +420,7 @@ ${nonDocumentStrings}`;
|
|
|
420
420
|
props.url,
|
|
421
421
|
`${props.url}/v2`,
|
|
422
422
|
props.headers || {},
|
|
423
|
-
props.body
|
|
423
|
+
__spreadValues(__spreadValues({}, props.body), props.backendOnlyProps)
|
|
424
424
|
);
|
|
425
425
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
426
426
|
CopilotContext.Provider,
|