@copilotkit/sdk-js 0.0.0-mme-load-agent-state-20250117154700

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md ADDED
@@ -0,0 +1,578 @@
1
+ # @copilotkit/sdk-js
2
+
3
+ ## 0.0.0-mme-load-agent-state-20250117154700
4
+
5
+ ### Patch Changes
6
+
7
+ - @copilotkit/shared@0.0.0-mme-load-agent-state-20250117154700
8
+
9
+ ## 1.5.12-next.4
10
+
11
+ ### Patch Changes
12
+
13
+ - @copilotkit/shared@1.5.12-next.4
14
+
15
+ ## 1.5.12-next.3
16
+
17
+ ### Patch Changes
18
+
19
+ - @copilotkit/shared@1.5.12-next.3
20
+
21
+ ## 1.5.12-next.2
22
+
23
+ ### Patch Changes
24
+
25
+ - @copilotkit/shared@1.5.12-next.2
26
+
27
+ ## 1.5.12-next.1
28
+
29
+ ### Patch Changes
30
+
31
+ - @copilotkit/shared@1.5.12-next.1
32
+
33
+ ## 1.5.12-next.0
34
+
35
+ ### Patch Changes
36
+
37
+ - @copilotkit/shared@1.5.12-next.0
38
+
39
+ ## 1.5.11
40
+
41
+ ### Patch Changes
42
+
43
+ - @copilotkit/shared@1.5.11
44
+
45
+ ## 1.5.11-next.0
46
+
47
+ ### Patch Changes
48
+
49
+ - @copilotkit/shared@1.5.11-next.0
50
+
51
+ ## 1.5.10
52
+
53
+ ### Patch Changes
54
+
55
+ - @copilotkit/shared@1.5.10
56
+
57
+ ## 1.5.10-next.0
58
+
59
+ ### Patch Changes
60
+
61
+ - @copilotkit/shared@1.5.10-next.0
62
+
63
+ ## 1.5.9
64
+
65
+ ### Patch Changes
66
+
67
+ - @copilotkit/shared@1.5.9
68
+
69
+ ## 1.5.8
70
+
71
+ ### Patch Changes
72
+
73
+ - @copilotkit/shared@1.5.8
74
+
75
+ ## 1.5.6-next.0
76
+
77
+ ### Patch Changes
78
+
79
+ - @copilotkit/shared@1.5.6-next.0
80
+
81
+ ## 1.5.5-next.5
82
+
83
+ ### Patch Changes
84
+
85
+ - @copilotkit/shared@1.5.5-next.5
86
+
87
+ ## 1.5.5-next.3
88
+
89
+ ### Patch Changes
90
+
91
+ - @copilotkit/shared@1.5.5-next.3
92
+
93
+ ## 1.5.5-next.2
94
+
95
+ ### Patch Changes
96
+
97
+ - @copilotkit/shared@1.5.5-next.2
98
+
99
+ ## 1.5.4
100
+
101
+ ### Patch Changes
102
+
103
+ - @copilotkit/shared@1.5.4
104
+
105
+ ## 1.5.3
106
+
107
+ ### Patch Changes
108
+
109
+ - @copilotkit/shared@1.5.3
110
+
111
+ ## 1.5.2
112
+
113
+ ### Patch Changes
114
+
115
+ - @copilotkit/shared@1.5.2
116
+
117
+ ## 1.5.1
118
+
119
+ ### Patch Changes
120
+
121
+ - 5c01e9e: test prerelease #4
122
+ - da280ed: Test prerelease script
123
+ - 27e42d7: testing a prerelease
124
+ - 05240a9: test pre #2
125
+ - 33218fe: test prerelease #3
126
+ - 03f3d6f: Test next prerelease
127
+ - Updated dependencies [5c01e9e]
128
+ - Updated dependencies [da280ed]
129
+ - Updated dependencies [27e42d7]
130
+ - Updated dependencies [05240a9]
131
+ - Updated dependencies [33218fe]
132
+ - Updated dependencies [03f3d6f]
133
+ - @copilotkit/shared@1.5.1
134
+
135
+ ## 1.5.1-next.3
136
+
137
+ ### Patch Changes
138
+
139
+ - 33218fe: test prerelease #3
140
+ - Updated dependencies [33218fe]
141
+ - @copilotkit/shared@1.5.1-next.3
142
+
143
+ ## 1.5.1-next.2
144
+
145
+ ### Patch Changes
146
+
147
+ - da280ed: Test prerelease script
148
+ - Updated dependencies [da280ed]
149
+ - @copilotkit/shared@1.5.1-next.2
150
+
151
+ ## 1.5.1-next.1
152
+
153
+ ### Patch Changes
154
+
155
+ - 03f3d6f: Test next prerelease
156
+ - Updated dependencies [03f3d6f]
157
+ - @copilotkit/shared@1.5.1-next.1
158
+
159
+ ## 1.5.1-next.0
160
+
161
+ ### Patch Changes
162
+
163
+ - 27e42d7: testing a prerelease
164
+ - Updated dependencies [27e42d7]
165
+ - @copilotkit/shared@1.5.1-next.0
166
+
167
+ ## 1.5.0
168
+
169
+ ### Minor Changes
170
+
171
+ - 1b47092: Synchronize LangGraph messages with CopilotKit
172
+
173
+ ### Patch Changes
174
+
175
+ - 1b47092: CoAgents v0.3 prerelease
176
+ - Updated dependencies [1b47092]
177
+ - Updated dependencies [1b47092]
178
+ - @copilotkit/shared@1.5.0
179
+
180
+ ## 1.5.0-coagents-v0-3.0
181
+
182
+ ### Minor Changes
183
+
184
+ - Synchronize LangGraph messages with CopilotKit
185
+
186
+ ### Patch Changes
187
+
188
+ - e66bce4: CoAgents v0.3 prerelease
189
+ - Updated dependencies
190
+ - Updated dependencies [e66bce4]
191
+ - @copilotkit/shared@1.5.0-coagents-v0-3.0
192
+
193
+ ## 1.4.8
194
+
195
+ ### Patch Changes
196
+
197
+ - - Better error handling
198
+ - Introduce new "EmptyLLMAdapter" for when using CoAgents
199
+ - Improve dev console help options
200
+ - Allow CopilotKit remote endpoint without agents
201
+ - Updated dependencies
202
+ - @copilotkit/shared@1.4.8
203
+
204
+ ## 1.4.8-next.0
205
+
206
+ ### Patch Changes
207
+
208
+ - @copilotkit/shared@1.4.8-next.0
209
+
210
+ ## 1.4.7
211
+
212
+ ### Patch Changes
213
+
214
+ - Fix broken build script before release
215
+ - Updated dependencies
216
+ - @copilotkit/shared@1.4.7
217
+
218
+ ## 1.4.6
219
+
220
+ ### Patch Changes
221
+
222
+ - .
223
+
224
+ ## 1.4.5
225
+
226
+ ### Patch Changes
227
+
228
+ - testing release workflow
229
+ - Updated dependencies
230
+ - @copilotkit/shared@1.4.5
231
+
232
+ ## 1.4.5-next.0
233
+
234
+ ### Patch Changes
235
+
236
+ - testing release workflow
237
+ - Updated dependencies
238
+ - @copilotkit/shared@1.4.5-next.0
239
+
240
+ ## 1.4.4
241
+
242
+ ### Patch Changes
243
+
244
+ - @copilotkit/shared@1.4.4
245
+
246
+ ## 1.4.4-next.4
247
+
248
+ ### Patch Changes
249
+
250
+ - @copilotkit/shared@1.4.4-next.4
251
+
252
+ ## 1.4.4-next.3
253
+
254
+ ### Patch Changes
255
+
256
+ - @copilotkit/shared@1.4.4-next.3
257
+
258
+ ## 1.4.4-next.2
259
+
260
+ ### Patch Changes
261
+
262
+ - @copilotkit/shared@1.4.4-next.2
263
+
264
+ ## 1.4.4-next.1
265
+
266
+ ### Patch Changes
267
+
268
+ - @copilotkit/shared@1.4.4-next.1
269
+
270
+ ## 1.4.4-next.0
271
+
272
+ ### Patch Changes
273
+
274
+ - @copilotkit/shared@1.4.4-next.0
275
+
276
+ ## 1.4.3
277
+
278
+ ### Patch Changes
279
+
280
+ - c296282: - Better error surfacing when using LangGraph Platform streaming
281
+ - Ensure state is immediately set without using flushSync
282
+ - - Better error surfacing when using LangGraph Platform streaming
283
+ - Ensure state is immediately set without using flushSync
284
+ - Updated dependencies [c296282]
285
+ - Updated dependencies
286
+ - @copilotkit/shared@1.4.3
287
+
288
+ ## 1.4.3-pre.0
289
+
290
+ ### Patch Changes
291
+
292
+ - - Better error surfacing when using LangGraph Platform streaming
293
+ - Ensure state is immediately set without using flushSync
294
+ - Updated dependencies
295
+ - @copilotkit/shared@1.4.3-pre.0
296
+
297
+ ## 1.4.2
298
+
299
+ ### Patch Changes
300
+
301
+ - - Make sure agent state is set immediately (#1077)
302
+ - Support running an agent without messages (#1075)
303
+ - Updated dependencies
304
+ - @copilotkit/shared@1.4.2
305
+
306
+ ## 1.4.1
307
+
308
+ ### Patch Changes
309
+
310
+ - 1721cbd: lower case copilotkit property
311
+ - 1721cbd: add zod conversion
312
+ - 8d0144f: bump
313
+ - 8d0144f: bump
314
+ - 8d0144f: bump
315
+ - e16d95e: New prerelease
316
+ - 1721cbd: Add convertActionsToDynamicStructuredTools to sdk-js
317
+ - CopilotKit Core:
318
+
319
+ - Improved error messages and overall logs
320
+ - `useCopilotAction.renderAndAwait` renamed to `.renderAndAwaitForResponse` (backwards compatible, will be deprecated in the future)
321
+ - Improved scrolling behavior. It is now possible to scroll up during LLM response generation
322
+ - Added Azure OpenAI integration
323
+ - Updated interfaces for better developer ergonomics
324
+
325
+ CoAgents:
326
+
327
+ - Renamed `remoteActions` to `remoteEndpoints` (backwards compatible, will be deprecated in the future)
328
+ - Support for LangGraph Platform in Remote Endpoints
329
+ - LangGraph JS Support for CoAgents (locally via `langgraph dev`, `langgraph up` or deployed to LangGraph Platform)
330
+ - Improved LangSmith integration - requests made through CoAgents will now surface in LangSmith
331
+ - Enhanced state management and message handling
332
+
333
+ CopilotKid Back-end SDK:
334
+
335
+ - Released a whole-new `@copilotkit/sdk-js` for building agents with LangGraph JS Support
336
+
337
+ - 8d0144f: bump
338
+ - 8d0144f: bump
339
+ - fef1b74: fix assistant message CSS and propagate actions to LG JS
340
+ - Updated dependencies [1721cbd]
341
+ - Updated dependencies [1721cbd]
342
+ - Updated dependencies [8d0144f]
343
+ - Updated dependencies [8d0144f]
344
+ - Updated dependencies [8d0144f]
345
+ - Updated dependencies [e16d95e]
346
+ - Updated dependencies [1721cbd]
347
+ - Updated dependencies
348
+ - Updated dependencies [8d0144f]
349
+ - Updated dependencies [8d0144f]
350
+ - Updated dependencies [fef1b74]
351
+ - @copilotkit/shared@1.4.1
352
+
353
+ ## 1.4.1-pre.6
354
+
355
+ ### Patch Changes
356
+
357
+ - 1721cbd: lower case copilotkit property
358
+ - 1721cbd: add zod conversion
359
+ - 1721cbd: Add convertActionsToDynamicStructuredTools to sdk-js
360
+ - fix assistant message CSS and propagate actions to LG JS
361
+ - Updated dependencies [1721cbd]
362
+ - Updated dependencies [1721cbd]
363
+ - Updated dependencies [1721cbd]
364
+ - Updated dependencies
365
+ - @copilotkit/shared@1.4.1-pre.6
366
+
367
+ ## 1.4.1-pre.5
368
+
369
+ ### Patch Changes
370
+
371
+ - bump
372
+ - Updated dependencies
373
+ - @copilotkit/shared@1.4.1-pre.5
374
+
375
+ ## 1.4.1-pre.4
376
+
377
+ ### Patch Changes
378
+
379
+ - bump
380
+ - Updated dependencies
381
+ - @copilotkit/shared@1.4.1-pre.4
382
+
383
+ ## 1.4.1-pre.3
384
+
385
+ ### Patch Changes
386
+
387
+ - bump
388
+ - Updated dependencies
389
+ - @copilotkit/shared@1.4.1-pre.3
390
+
391
+ ## 1.4.1-pre.2
392
+
393
+ ### Patch Changes
394
+
395
+ - bump
396
+ - Updated dependencies
397
+ - @copilotkit/shared@1.4.1-pre.2
398
+
399
+ ## 1.4.1-pre.1
400
+
401
+ ### Patch Changes
402
+
403
+ - bump
404
+ - Updated dependencies
405
+ - @copilotkit/shared@1.4.1-pre.1
406
+
407
+ ## 1.4.1-pre.0
408
+
409
+ ### Patch Changes
410
+
411
+ - New prerelease
412
+ - Updated dependencies
413
+ - @copilotkit/shared@1.4.1-pre.0
414
+
415
+ ## 1.4.0
416
+
417
+ ### Minor Changes
418
+
419
+ CopilotKit Core:
420
+
421
+ - Improved error messages and overall logs
422
+ - `useCopilotAction.renderAndAwait` renamed to `.renderAndAwaitForResponse` (backwards compatible, will be deprecated in the future)
423
+ - Improved scrolling behavior. It is now possible to scroll up during LLM response generation
424
+ - Added Azure OpenAI integration
425
+ - Updated interfaces for better developer ergonomics
426
+
427
+ CoAgents:
428
+
429
+ - Renamed `remoteActions` to `remoteEndpoints` (backwards compatible, will be deprecated in the future)
430
+ - Support for LangGraph Platform in Remote Endpoints
431
+ - LangGraph JS Support for CoAgents (locally via `langgraph dev`, `langgraph up` or deployed to LangGraph Platform)
432
+ - Improved LangSmith integration - requests made through CoAgents will now surface in LangSmith
433
+ - Enhanced state management and message handling
434
+
435
+ CopilotKid Back-end SDK:
436
+
437
+ - Released a whole-new `@copilotkit/sdk-js` for building agents with LangGraph JS Support
438
+
439
+ ### Patch Changes
440
+
441
+ - f6fab28: update tsup config
442
+ - f6fab28: update entry
443
+ - f6fab28: export langchain module
444
+ - f6fab28: Ensure intermediate state config is sent as snake case
445
+ - f6fab28: update entry in tsup config
446
+ - a5efccd: Revert rxjs changes
447
+ - f6fab28: update entry
448
+ - f6fab28: Update exports
449
+ - f6fab28: Update exports
450
+ - f6fab28: Export LangGraph functions
451
+ - f6fab28: Update lockfile
452
+ - Updated dependencies [f6fab28]
453
+ - Updated dependencies [f6fab28]
454
+ - Updated dependencies
455
+ - Updated dependencies [f6fab28]
456
+ - Updated dependencies [8a77944]
457
+ - Updated dependencies [f6fab28]
458
+ - Updated dependencies [f6fab28]
459
+ - Updated dependencies [8a77944]
460
+ - Updated dependencies [a5efccd]
461
+ - Updated dependencies [f6fab28]
462
+ - Updated dependencies [f6fab28]
463
+ - Updated dependencies [f6fab28]
464
+ - Updated dependencies [332d744]
465
+ - Updated dependencies [f6fab28]
466
+ - Updated dependencies [f6fab28]
467
+ - @copilotkit/shared@1.4.0
468
+
469
+ ## 1.3.16-mme-revert-rxjs-changes.10
470
+
471
+ ### Patch Changes
472
+
473
+ - f6fab28: update tsup config
474
+ - f6fab28: update entry
475
+ - f6fab28: export langchain module
476
+ - f6fab28: Ensure intermediate state config is sent as snake case
477
+ - f6fab28: update entry in tsup config
478
+ - Revert rxjs changes
479
+ - f6fab28: update entry
480
+ - f6fab28: Update exports
481
+ - f6fab28: Update exports
482
+ - f6fab28: Export LangGraph functions
483
+ - f6fab28: Update lockfile
484
+ - Updated dependencies [f6fab28]
485
+ - Updated dependencies [f6fab28]
486
+ - Updated dependencies [f6fab28]
487
+ - Updated dependencies [8a77944]
488
+ - Updated dependencies [f6fab28]
489
+ - Updated dependencies [f6fab28]
490
+ - Updated dependencies [8a77944]
491
+ - Updated dependencies
492
+ - Updated dependencies [f6fab28]
493
+ - Updated dependencies [f6fab28]
494
+ - Updated dependencies [f6fab28]
495
+ - Updated dependencies [332d744]
496
+ - Updated dependencies [f6fab28]
497
+ - Updated dependencies [f6fab28]
498
+ - @copilotkit/shared@1.3.16-mme-revert-rxjs-changes.10
499
+
500
+ ## 1.3.16-mme-lgc-langgraph-package.9
501
+
502
+ ### Patch Changes
503
+
504
+ - update entry
505
+ - Updated dependencies
506
+ - @copilotkit/shared@1.3.16-mme-lgc-langgraph-package.9
507
+
508
+ ## 1.3.16-mme-lgc-langgraph-package.8
509
+
510
+ ### Patch Changes
511
+
512
+ - update entry
513
+ - Updated dependencies
514
+ - @copilotkit/shared@1.3.16-mme-lgc-langgraph-package.8
515
+
516
+ ## 1.3.16-mme-lgc-langgraph-package.7
517
+
518
+ ### Patch Changes
519
+
520
+ - update entry in tsup config
521
+ - Updated dependencies
522
+ - @copilotkit/shared@1.3.16-mme-lgc-langgraph-package.7
523
+
524
+ ## 1.3.16-mme-lgc-langgraph-package.6
525
+
526
+ ### Patch Changes
527
+
528
+ - Update exports
529
+ - Updated dependencies
530
+ - @copilotkit/shared@1.3.16-mme-lgc-langgraph-package.6
531
+
532
+ ## 1.3.16-mme-lgc-langgraph-package.5
533
+
534
+ ### Patch Changes
535
+
536
+ - update tsup config
537
+ - Updated dependencies
538
+ - @copilotkit/shared@1.3.16-mme-lgc-langgraph-package.5
539
+
540
+ ## 1.3.16-mme-lgc-langgraph-package.4
541
+
542
+ ### Patch Changes
543
+
544
+ - Update exports
545
+ - Updated dependencies
546
+ - @copilotkit/shared@1.3.16-mme-lgc-langgraph-package.4
547
+
548
+ ## 1.3.16-mme-lgc-langgraph-package.3
549
+
550
+ ### Patch Changes
551
+
552
+ - export langchain module
553
+ - Updated dependencies
554
+ - @copilotkit/shared@1.3.16-mme-lgc-langgraph-package.3
555
+
556
+ ## 1.3.16-mme-sdk-js.2
557
+
558
+ ### Patch Changes
559
+
560
+ - Ensure intermediate state config is sent as snake case
561
+ - Updated dependencies
562
+ - @copilotkit/shared@1.3.16-mme-sdk-js.2
563
+
564
+ ## 1.3.16-mme-sdk-js.1
565
+
566
+ ### Patch Changes
567
+
568
+ - Update lockfile
569
+ - Updated dependencies
570
+ - @copilotkit/shared@1.3.16-mme-sdk-js.1
571
+
572
+ ## 1.3.16-mme-sdk-js.0
573
+
574
+ ### Patch Changes
575
+
576
+ - Export LangGraph functions
577
+ - Updated dependencies
578
+ - @copilotkit/shared@1.3.16-mme-sdk-js.0
package/README.md ADDED
@@ -0,0 +1,46 @@
1
+ <div align="center">
2
+ <a href="https://copilotkit.ai" target="_blank">
3
+ <img src="https://github.com/copilotkit/copilotkit/raw/main/assets/banner.png" alt="CopilotKit Logo">
4
+ </a>
5
+
6
+ <br/>
7
+
8
+ <strong>
9
+ CopilotKit is the open-source framework for integrating powerful AI Copilots into any application. Easily implement custom AI Chatbots, AI Agents, AI Textareas, and more.
10
+ </strong>
11
+ </div>
12
+
13
+ <br/>
14
+
15
+ <div align="center">
16
+ <a href="https://www.npmjs.com/package/@copilotkit/react-core" target="_blank">
17
+ <img src="https://img.shields.io/npm/v/%40copilotkit%2Freact-core?logo=npm&logoColor=%23FFFFFF&label=Version&color=%236963ff" alt="NPM">
18
+ </a>
19
+ <img src="https://img.shields.io/github/license/copilotkit/copilotkit?color=%236963ff&label=License" alt="MIT">
20
+ <a href="https://discord.gg/6dffbvGU3D" target="_blank">
21
+ <img src="https://img.shields.io/discord/1122926057641742418?logo=discord&logoColor=%23FFFFFF&label=Discord&color=%236963ff" alt="Discord">
22
+ </a>
23
+ </div>
24
+ <br/>
25
+
26
+ <div align="center">
27
+ <a href="https://discord.gg/6dffbvGU3D?ref=github_readme" target="_blank">
28
+ <img src="https://github.com/copilotkit/copilotkit/raw/main/assets/btn_discord.png" alt="CopilotKit Discord" height="40px">
29
+ </a>
30
+ <a href="https://docs.copilotkit.ai?ref=github_readme" target="_blank">
31
+ <img src="https://github.com/copilotkit/copilotkit/raw/main/assets/btn_docs.png" alt="CopilotKit GitHub" height="40px">
32
+ </a>
33
+ <a href="https://cloud.copilotkit.ai?ref=github_readme" target="_blank">
34
+ <img src="https://github.com/copilotkit/copilotkit/raw/main/assets/btn_cloud.png" alt="CopilotKit GitHub" height="40px">
35
+ </a>
36
+ </div>
37
+
38
+ <br />
39
+
40
+ <div align="center">
41
+ <img src="https://github.com/CopilotKit/CopilotKit/raw/main/assets/animated-banner.gif" alt="CopilotKit Screenshot" style="border-radius: 15px;" />
42
+ </div>
43
+
44
+ # Documentation
45
+
46
+ To get started with CopilotKit, please check out the [documentation](https://docs.copilotkit.ai).
@@ -0,0 +1,95 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
+
4
+ // src/langgraph.ts
5
+ import { dispatchCustomEvent } from "@langchain/core/callbacks/dispatch";
6
+ import { convertJsonSchemaToZodSchema, randomId } from "@copilotkit/shared";
7
+ import { Annotation, MessagesAnnotation } from "@langchain/langgraph";
8
+ import { DynamicStructuredTool } from "@langchain/core/tools";
9
+ var CopilotKitPropertiesAnnotation = Annotation.Root({
10
+ actions: Annotation
11
+ });
12
+ var CopilotKitStateAnnotation = Annotation.Root({
13
+ copilotkit: Annotation,
14
+ ...MessagesAnnotation.spec
15
+ });
16
+ function copilotkitCustomizeConfig(baseConfig, options) {
17
+ const metadata = (baseConfig == null ? void 0 : baseConfig.metadata) || {};
18
+ if (options == null ? void 0 : options.emitAll) {
19
+ metadata["copilotkit:emit-tool-calls"] = true;
20
+ metadata["copilotkit:emit-messages"] = true;
21
+ } else {
22
+ if ((options == null ? void 0 : options.emitToolCalls) !== void 0) {
23
+ metadata["copilotkit:emit-tool-calls"] = options.emitToolCalls;
24
+ }
25
+ if ((options == null ? void 0 : options.emitMessages) !== void 0) {
26
+ metadata["copilotkit:emit-messages"] = options.emitMessages;
27
+ }
28
+ }
29
+ if (options == null ? void 0 : options.emitIntermediateState) {
30
+ const snakeCaseIntermediateState = options.emitIntermediateState.map((state) => ({
31
+ tool: state.tool,
32
+ tool_argument: state.toolArgument,
33
+ state_key: state.stateKey
34
+ }));
35
+ metadata["copilotkit:emit-intermediate-state"] = snakeCaseIntermediateState;
36
+ }
37
+ baseConfig = baseConfig || {};
38
+ return {
39
+ ...baseConfig,
40
+ metadata
41
+ };
42
+ }
43
+ __name(copilotkitCustomizeConfig, "copilotkitCustomizeConfig");
44
+ async function copilotkitExit(config) {
45
+ await dispatchCustomEvent("copilotkit_exit", {}, config);
46
+ }
47
+ __name(copilotkitExit, "copilotkitExit");
48
+ async function copilotkitEmitState(config, state) {
49
+ await dispatchCustomEvent("copilotkit_manually_emit_intermediate_state", state, config);
50
+ }
51
+ __name(copilotkitEmitState, "copilotkitEmitState");
52
+ async function copilotkitEmitMessage(config, message) {
53
+ await dispatchCustomEvent("copilotkit_manually_emit_message", {
54
+ message,
55
+ message_id: randomId(),
56
+ role: "assistant"
57
+ }, config);
58
+ }
59
+ __name(copilotkitEmitMessage, "copilotkitEmitMessage");
60
+ async function copilotkitEmitToolCall(config, name, args) {
61
+ await dispatchCustomEvent("copilotkit_manually_emit_tool_call", {
62
+ name,
63
+ args,
64
+ id: randomId()
65
+ }, config);
66
+ }
67
+ __name(copilotkitEmitToolCall, "copilotkitEmitToolCall");
68
+ function convertActionToDynamicStructuredTool(actionInput) {
69
+ return new DynamicStructuredTool({
70
+ name: actionInput.name,
71
+ description: actionInput.description,
72
+ schema: convertJsonSchemaToZodSchema(actionInput.parameters, true),
73
+ func: async () => {
74
+ return "";
75
+ }
76
+ });
77
+ }
78
+ __name(convertActionToDynamicStructuredTool, "convertActionToDynamicStructuredTool");
79
+ function convertActionsToDynamicStructuredTools(actions) {
80
+ return actions.map((action) => convertActionToDynamicStructuredTool(action));
81
+ }
82
+ __name(convertActionsToDynamicStructuredTools, "convertActionsToDynamicStructuredTools");
83
+
84
+ export {
85
+ CopilotKitPropertiesAnnotation,
86
+ CopilotKitStateAnnotation,
87
+ copilotkitCustomizeConfig,
88
+ copilotkitExit,
89
+ copilotkitEmitState,
90
+ copilotkitEmitMessage,
91
+ copilotkitEmitToolCall,
92
+ convertActionToDynamicStructuredTool,
93
+ convertActionsToDynamicStructuredTools
94
+ };
95
+ //# sourceMappingURL=chunk-HGYWIU6Y.mjs.map