@ai-sdk/llamaindex 3.0.0-beta.17 → 3.0.0-beta.178

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 CHANGED
@@ -1,5 +1,1180 @@
1
1
  # @ai-sdk/llamaindex
2
2
 
3
+ ## 3.0.0-beta.178
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [b097c52]
8
+ - ai@7.0.0-beta.178
9
+
10
+ ## 3.0.0-beta.177
11
+
12
+ ### Patch Changes
13
+
14
+ - b8396f0: trigger initial beta release
15
+ - Updated dependencies [b8396f0]
16
+ - ai@7.0.0-beta.177
17
+
18
+ ## 3.0.0-canary.176
19
+
20
+ ### Patch Changes
21
+
22
+ - ai@7.0.0-canary.176
23
+
24
+ ## 3.0.0-canary.175
25
+
26
+ ### Patch Changes
27
+
28
+ - Updated dependencies [6ec57f5]
29
+ - ai@7.0.0-canary.175
30
+
31
+ ## 3.0.0-canary.174
32
+
33
+ ### Patch Changes
34
+
35
+ - ai@7.0.0-canary.174
36
+
37
+ ## 3.0.0-canary.173
38
+
39
+ ### Patch Changes
40
+
41
+ - ai@7.0.0-canary.173
42
+
43
+ ## 3.0.0-canary.172
44
+
45
+ ### Patch Changes
46
+
47
+ - Updated dependencies [25a64f8]
48
+ - Updated dependencies [375fdd7]
49
+ - Updated dependencies [f18b08f]
50
+ - Updated dependencies [b4507d5]
51
+ - ai@7.0.0-canary.172
52
+
53
+ ## 3.0.0-canary.171
54
+
55
+ ### Patch Changes
56
+
57
+ - Updated dependencies [89ad56f]
58
+ - Updated dependencies [f9a496f]
59
+ - Updated dependencies [3295831]
60
+ - ai@7.0.0-canary.171
61
+
62
+ ## 3.0.0-canary.170
63
+
64
+ ### Patch Changes
65
+
66
+ - Updated dependencies [bae5e2b]
67
+ - Updated dependencies [69d7128]
68
+ - ai@7.0.0-canary.170
69
+
70
+ ## 3.0.0-canary.169
71
+
72
+ ### Patch Changes
73
+
74
+ - Updated dependencies [a5018ab]
75
+ - Updated dependencies [21d3d60]
76
+ - Updated dependencies [426dbbb]
77
+ - Updated dependencies [7fd3360]
78
+ - ai@7.0.0-canary.169
79
+
80
+ ## 3.0.0-canary.168
81
+
82
+ ### Patch Changes
83
+
84
+ - Updated dependencies [1e4b350]
85
+ - ai@7.0.0-canary.168
86
+
87
+ ## 3.0.0-canary.167
88
+
89
+ ### Patch Changes
90
+
91
+ - Updated dependencies [4757690]
92
+ - Updated dependencies [eeefc3f]
93
+ - Updated dependencies [b79b6a8]
94
+ - ai@7.0.0-canary.167
95
+
96
+ ## 3.0.0-canary.166
97
+
98
+ ### Patch Changes
99
+
100
+ - Updated dependencies [19736ee]
101
+ - Updated dependencies [d66ae02]
102
+ - Updated dependencies [e4182bd]
103
+ - ai@7.0.0-canary.166
104
+
105
+ ## 3.0.0-canary.165
106
+
107
+ ### Patch Changes
108
+
109
+ - Updated dependencies [ce769dd]
110
+ - ai@7.0.0-canary.165
111
+
112
+ ## 3.0.0-canary.164
113
+
114
+ ### Patch Changes
115
+
116
+ - ai@7.0.0-canary.164
117
+
118
+ ## 3.0.0-canary.163
119
+
120
+ ### Patch Changes
121
+
122
+ - Updated dependencies [ee798eb]
123
+ - Updated dependencies [c907622]
124
+ - ai@7.0.0-canary.163
125
+
126
+ ## 3.0.0-canary.162
127
+
128
+ ### Patch Changes
129
+
130
+ - ai@7.0.0-canary.162
131
+
132
+ ## 3.0.0-canary.161
133
+
134
+ ### Patch Changes
135
+
136
+ - ai@7.0.0-canary.161
137
+
138
+ ## 3.0.0-canary.160
139
+
140
+ ### Patch Changes
141
+
142
+ - ai@7.0.0-canary.160
143
+
144
+ ## 3.0.0-canary.159
145
+
146
+ ### Patch Changes
147
+
148
+ - Updated dependencies [b5092f5]
149
+ - ai@7.0.0-canary.159
150
+
151
+ ## 3.0.0-canary.158
152
+
153
+ ### Patch Changes
154
+
155
+ - Updated dependencies [bcce2dd]
156
+ - ai@7.0.0-canary.158
157
+
158
+ ## 3.0.0-canary.157
159
+
160
+ ### Patch Changes
161
+
162
+ - ai@7.0.0-canary.157
163
+
164
+ ## 3.0.0-canary.156
165
+
166
+ ### Patch Changes
167
+
168
+ - Updated dependencies [023550e]
169
+ - Updated dependencies [e92fc45]
170
+ - ai@7.0.0-canary.156
171
+
172
+ ## 3.0.0-canary.155
173
+
174
+ ### Patch Changes
175
+
176
+ - Updated dependencies [e67d80e]
177
+ - Updated dependencies [6cca112]
178
+ - Updated dependencies [82fc0ab]
179
+ - Updated dependencies [76fd58c]
180
+ - ai@7.0.0-canary.155
181
+
182
+ ## 3.0.0-canary.154
183
+
184
+ ### Patch Changes
185
+
186
+ - Updated dependencies [594029e]
187
+ - ai@7.0.0-canary.154
188
+
189
+ ## 3.0.0-canary.153
190
+
191
+ ### Patch Changes
192
+
193
+ - Updated dependencies [6c93e36]
194
+ - ai@7.0.0-canary.153
195
+
196
+ ## 3.0.0-canary.152
197
+
198
+ ### Patch Changes
199
+
200
+ - ai@7.0.0-canary.152
201
+
202
+ ## 3.0.0-canary.151
203
+
204
+ ### Patch Changes
205
+
206
+ - ai@7.0.0-canary.151
207
+
208
+ ## 3.0.0-canary.150
209
+
210
+ ### Patch Changes
211
+
212
+ - ai@7.0.0-canary.150
213
+
214
+ ## 3.0.0-canary.149
215
+
216
+ ### Patch Changes
217
+
218
+ - Updated dependencies [e3d9c0e]
219
+ - ai@7.0.0-canary.149
220
+
221
+ ## 3.0.0-canary.148
222
+
223
+ ### Patch Changes
224
+
225
+ - Updated dependencies [2852a84]
226
+ - ai@7.0.0-canary.148
227
+
228
+ ## 3.0.0-canary.147
229
+
230
+ ### Patch Changes
231
+
232
+ - ai@7.0.0-canary.147
233
+
234
+ ## 3.0.0-canary.146
235
+
236
+ ### Patch Changes
237
+
238
+ - ai@7.0.0-canary.146
239
+
240
+ ## 3.0.0-canary.145
241
+
242
+ ### Patch Changes
243
+
244
+ - ai@7.0.0-canary.145
245
+
246
+ ## 3.0.0-canary.144
247
+
248
+ ### Patch Changes
249
+
250
+ - 7fc6bd6: Raise minimum supported Node.js version to 22. Supported versions: 22, 24, and 26.
251
+ - Updated dependencies [7fc6bd6]
252
+ - ai@7.0.0-canary.144
253
+
254
+ ## 3.0.0-canary.143
255
+
256
+ ### Patch Changes
257
+
258
+ - Updated dependencies [a6617c5]
259
+ - ai@7.0.0-canary.143
260
+
261
+ ## 3.0.0-canary.142
262
+
263
+ ### Patch Changes
264
+
265
+ - Updated dependencies [62d6481]
266
+ - ai@7.0.0-canary.142
267
+
268
+ ## 3.0.0-canary.141
269
+
270
+ ### Patch Changes
271
+
272
+ - Updated dependencies [e3a0419]
273
+ - ai@7.0.0-canary.141
274
+
275
+ ## 3.0.0-canary.140
276
+
277
+ ### Patch Changes
278
+
279
+ - ai@7.0.0-canary.140
280
+
281
+ ## 3.0.0-canary.139
282
+
283
+ ### Patch Changes
284
+
285
+ - Updated dependencies [334ae5d]
286
+ - Updated dependencies [28dfa06]
287
+ - Updated dependencies [e93fa91]
288
+ - ai@7.0.0-canary.139
289
+
290
+ ## 3.0.0-canary.138
291
+
292
+ ### Patch Changes
293
+
294
+ - ai@7.0.0-canary.138
295
+
296
+ ## 3.0.0-canary.137
297
+
298
+ ### Patch Changes
299
+
300
+ - Updated dependencies [98627e5]
301
+ - Updated dependencies [476e1ca]
302
+ - ai@7.0.0-canary.137
303
+
304
+ ## 3.0.0-canary.136
305
+
306
+ ### Patch Changes
307
+
308
+ - Updated dependencies [a7de9c9]
309
+ - ai@7.0.0-canary.136
310
+
311
+ ## 3.0.0-canary.135
312
+
313
+ ### Patch Changes
314
+
315
+ - ai@7.0.0-canary.135
316
+
317
+ ## 3.0.0-canary.134
318
+
319
+ ### Patch Changes
320
+
321
+ - Updated dependencies [ed74dae]
322
+ - Updated dependencies [f4cc8eb]
323
+ - Updated dependencies [e80ada0]
324
+ - Updated dependencies [1dca341]
325
+ - Updated dependencies [2605e5f]
326
+ - ai@7.0.0-canary.134
327
+
328
+ ## 3.0.0-canary.133
329
+
330
+ ### Patch Changes
331
+
332
+ - Updated dependencies [38ca8dc]
333
+ - Updated dependencies [6d76710]
334
+ - ai@7.0.0-canary.133
335
+
336
+ ## 3.0.0-canary.132
337
+
338
+ ### Patch Changes
339
+
340
+ - Updated dependencies [eaf849f]
341
+ - Updated dependencies [8565dcb]
342
+ - ai@7.0.0-canary.132
343
+
344
+ ## 3.0.0-canary.131
345
+
346
+ ### Patch Changes
347
+
348
+ - Updated dependencies [b67525f]
349
+ - Updated dependencies [ca446f8]
350
+ - Updated dependencies [bcacd48]
351
+ - ai@7.0.0-canary.131
352
+
353
+ ## 3.0.0-canary.130
354
+
355
+ ### Patch Changes
356
+
357
+ - ai@7.0.0-canary.130
358
+
359
+ ## 3.0.0-canary.129
360
+
361
+ ### Patch Changes
362
+
363
+ - Updated dependencies [d1b3786]
364
+ - ai@7.0.0-canary.129
365
+
366
+ ## 3.0.0-canary.128
367
+
368
+ ### Patch Changes
369
+
370
+ - ai@7.0.0-canary.128
371
+
372
+ ## 3.0.0-canary.127
373
+
374
+ ### Patch Changes
375
+
376
+ - Updated dependencies [e95e38d]
377
+ - Updated dependencies [016e877]
378
+ - Updated dependencies [ca99fea]
379
+ - Updated dependencies [d775a57]
380
+ - Updated dependencies [538c12b]
381
+ - ai@7.0.0-canary.127
382
+
383
+ ## 3.0.0-canary.126
384
+
385
+ ### Patch Changes
386
+
387
+ - ai@7.0.0-canary.126
388
+
389
+ ## 3.0.0-canary.125
390
+
391
+ ### Patch Changes
392
+
393
+ - Updated dependencies [fd4f578]
394
+ - Updated dependencies [31f69de]
395
+ - Updated dependencies [7c71ac6]
396
+ - Updated dependencies [c0c8ca2]
397
+ - Updated dependencies [5faf71c]
398
+ - Updated dependencies [69254e0]
399
+ - Updated dependencies [3015fc3]
400
+ - Updated dependencies [eee1166]
401
+ - Updated dependencies [7dbf992]
402
+ - ai@7.0.0-canary.125
403
+
404
+ ## 3.0.0-canary.124
405
+
406
+ ### Patch Changes
407
+
408
+ - Updated dependencies [69aeb0e]
409
+ - Updated dependencies [48e92f3]
410
+ - ai@7.0.0-canary.124
411
+
412
+ ## 3.0.0-canary.123
413
+
414
+ ### Patch Changes
415
+
416
+ - Updated dependencies [7392266]
417
+ - Updated dependencies [4bb4dbc]
418
+ - ai@7.0.0-canary.123
419
+
420
+ ## 3.0.0-canary.122
421
+
422
+ ### Patch Changes
423
+
424
+ - Updated dependencies [79b2468]
425
+ - Updated dependencies [c22750c]
426
+ - ai@7.0.0-canary.122
427
+
428
+ ## 3.0.0-canary.121
429
+
430
+ ### Patch Changes
431
+
432
+ - Updated dependencies [2427d88]
433
+ - Updated dependencies [5588abd]
434
+ - Updated dependencies [6dd6b83]
435
+ - ai@7.0.0-canary.121
436
+
437
+ ## 3.0.0-canary.120
438
+
439
+ ### Patch Changes
440
+
441
+ - Updated dependencies [5463d0d]
442
+ - ai@7.0.0-canary.120
443
+
444
+ ## 3.0.0-canary.119
445
+
446
+ ### Patch Changes
447
+
448
+ - ai@7.0.0-canary.119
449
+
450
+ ## 3.0.0-canary.118
451
+
452
+ ### Patch Changes
453
+
454
+ - Updated dependencies [47e65d6]
455
+ - ai@7.0.0-canary.118
456
+
457
+ ## 3.0.0-canary.117
458
+
459
+ ### Patch Changes
460
+
461
+ - 0c4c275: trigger initial canary release
462
+ - Updated dependencies [0c4c275]
463
+ - ai@7.0.0-canary.117
464
+
465
+ ## 3.0.0-beta.116
466
+
467
+ ### Patch Changes
468
+
469
+ - ai@7.0.0-beta.116
470
+
471
+ ## 3.0.0-beta.115
472
+
473
+ ### Patch Changes
474
+
475
+ - Updated dependencies [08d2129]
476
+ - Updated dependencies [202f107]
477
+ - ai@7.0.0-beta.115
478
+
479
+ ## 3.0.0-beta.114
480
+
481
+ ### Patch Changes
482
+
483
+ - 258c093: chore: ensure consistent import handling and avoid import duplicates or cycles
484
+ - Updated dependencies [43a6750]
485
+ - Updated dependencies [81caa5d]
486
+ - Updated dependencies [1f7db50]
487
+ - Updated dependencies [9bd6512]
488
+ - Updated dependencies [258c093]
489
+ - Updated dependencies [6147cdf]
490
+ - ai@7.0.0-beta.114
491
+
492
+ ## 3.0.0-beta.113
493
+
494
+ ### Patch Changes
495
+
496
+ - 9f0e36c: trigger release for all packages after provenance setup
497
+ - Updated dependencies [9f0e36c]
498
+ - ai@7.0.0-beta.113
499
+
500
+ ## 3.0.0-beta.112
501
+
502
+ ### Patch Changes
503
+
504
+ - Updated dependencies [5f3749c]
505
+ - Updated dependencies [0a51f7d]
506
+ - Updated dependencies [71d3022]
507
+ - Updated dependencies [67df0a0]
508
+ - Updated dependencies [4181cfe]
509
+ - Updated dependencies [51ce232]
510
+ - Updated dependencies [cf93359]
511
+ - Updated dependencies [befb78c]
512
+ - Updated dependencies [29d8cf4]
513
+ - Updated dependencies [58a2ad7]
514
+ - Updated dependencies [37d69b2]
515
+ - Updated dependencies [1043274]
516
+ - Updated dependencies [7f59f04]
517
+ - Updated dependencies [7677c1e]
518
+ - Updated dependencies [116c89f]
519
+ - Updated dependencies [f58f9bc]
520
+ - Updated dependencies [e1bfb9c]
521
+ - Updated dependencies [e87d71b]
522
+ - Updated dependencies [9d486aa]
523
+ - Updated dependencies [9b0bc8a]
524
+ - Updated dependencies [fc92055]
525
+ - Updated dependencies [4e095b0]
526
+ - ai@7.0.0-beta.112
527
+
528
+ ## 3.0.0-beta.111
529
+
530
+ ### Patch Changes
531
+
532
+ - Updated dependencies [f319fde]
533
+ - Updated dependencies [1949571]
534
+ - Updated dependencies [511902c]
535
+ - Updated dependencies [6542d93]
536
+ - Updated dependencies [2e98477]
537
+ - Updated dependencies [876fd3e]
538
+ - Updated dependencies [f32c750]
539
+ - ai@7.0.0-beta.111
540
+
541
+ ## 3.0.0-beta.110
542
+
543
+ ### Patch Changes
544
+
545
+ - Updated dependencies [72cb801]
546
+ - ai@7.0.0-beta.110
547
+
548
+ ## 3.0.0-beta.109
549
+
550
+ ### Patch Changes
551
+
552
+ - Updated dependencies [ec98264]
553
+ - Updated dependencies [eea8d98]
554
+ - Updated dependencies [75ef93e]
555
+ - ai@7.0.0-beta.109
556
+
557
+ ## 3.0.0-beta.108
558
+
559
+ ### Patch Changes
560
+
561
+ - ai@7.0.0-beta.108
562
+
563
+ ## 3.0.0-beta.107
564
+
565
+ ### Patch Changes
566
+
567
+ - Updated dependencies [350ea38]
568
+ - ai@7.0.0-beta.107
569
+
570
+ ## 3.0.0-beta.106
571
+
572
+ ### Patch Changes
573
+
574
+ - ai@7.0.0-beta.106
575
+
576
+ ## 3.0.0-beta.105
577
+
578
+ ### Patch Changes
579
+
580
+ - Updated dependencies [33d099c]
581
+ - ai@7.0.0-beta.105
582
+
583
+ ## 3.0.0-beta.104
584
+
585
+ ### Patch Changes
586
+
587
+ - Updated dependencies [2a74d43]
588
+ - ai@7.0.0-beta.104
589
+
590
+ ## 3.0.0-beta.103
591
+
592
+ ### Patch Changes
593
+
594
+ - Updated dependencies [382d53b]
595
+ - Updated dependencies [7bf7d7f]
596
+ - Updated dependencies [c3d4019]
597
+ - Updated dependencies [083947b]
598
+ - ai@7.0.0-beta.103
599
+
600
+ ## 3.0.0-beta.102
601
+
602
+ ### Patch Changes
603
+
604
+ - ai@7.0.0-beta.102
605
+
606
+ ## 3.0.0-beta.101
607
+
608
+ ### Patch Changes
609
+
610
+ - Updated dependencies [4873966]
611
+ - ai@7.0.0-beta.101
612
+
613
+ ## 3.0.0-beta.100
614
+
615
+ ### Patch Changes
616
+
617
+ - Updated dependencies [add1126]
618
+ - ai@7.0.0-beta.100
619
+
620
+ ## 3.0.0-beta.99
621
+
622
+ ### Patch Changes
623
+
624
+ - Updated dependencies [2a9c144]
625
+ - ai@7.0.0-beta.99
626
+
627
+ ## 3.0.0-beta.98
628
+
629
+ ### Patch Changes
630
+
631
+ - ai@7.0.0-beta.98
632
+
633
+ ## 3.0.0-beta.97
634
+
635
+ ### Patch Changes
636
+
637
+ - Updated dependencies [208d045]
638
+ - ai@7.0.0-beta.97
639
+
640
+ ## 3.0.0-beta.96
641
+
642
+ ### Patch Changes
643
+
644
+ - ai@7.0.0-beta.96
645
+
646
+ ## 3.0.0-beta.95
647
+
648
+ ### Patch Changes
649
+
650
+ - Updated dependencies [c4f4b5f]
651
+ - ai@7.0.0-beta.95
652
+
653
+ ## 3.0.0-beta.94
654
+
655
+ ### Patch Changes
656
+
657
+ - Updated dependencies [1582efa]
658
+ - ai@7.0.0-beta.94
659
+
660
+ ## 3.0.0-beta.93
661
+
662
+ ### Patch Changes
663
+
664
+ - Updated dependencies [bc47739]
665
+ - ai@7.0.0-beta.93
666
+
667
+ ## 3.0.0-beta.92
668
+
669
+ ### Patch Changes
670
+
671
+ - ai@7.0.0-beta.92
672
+
673
+ ## 3.0.0-beta.91
674
+
675
+ ### Patch Changes
676
+
677
+ - ai@7.0.0-beta.91
678
+
679
+ ## 3.0.0-beta.90
680
+
681
+ ### Patch Changes
682
+
683
+ - Updated dependencies [1db29c8]
684
+ - ai@7.0.0-beta.90
685
+
686
+ ## 3.0.0-beta.89
687
+
688
+ ### Patch Changes
689
+
690
+ - Updated dependencies [ff5eba1]
691
+ - ai@7.0.0-beta.89
692
+
693
+ ## 3.0.0-beta.88
694
+
695
+ ### Major Changes
696
+
697
+ - ef992f8: Remove CommonJS exports from all packages. All packages are now ESM-only (`"type": "module"`). Consumers using `require()` must switch to ESM `import` syntax.
698
+
699
+ ### Patch Changes
700
+
701
+ - Updated dependencies [ef992f8]
702
+ - ai@7.0.0-beta.88
703
+
704
+ ## 3.0.0-beta.87
705
+
706
+ ### Patch Changes
707
+
708
+ - ai@7.0.0-beta.87
709
+
710
+ ## 3.0.0-beta.86
711
+
712
+ ### Patch Changes
713
+
714
+ - Updated dependencies [5a6f514]
715
+ - ai@7.0.0-beta.86
716
+
717
+ ## 3.0.0-beta.85
718
+
719
+ ### Patch Changes
720
+
721
+ - Updated dependencies [57bf606]
722
+ - ai@7.0.0-beta.85
723
+
724
+ ## 3.0.0-beta.84
725
+
726
+ ### Patch Changes
727
+
728
+ - Updated dependencies [90e2d8a]
729
+ - ai@7.0.0-beta.84
730
+
731
+ ## 3.0.0-beta.83
732
+
733
+ ### Patch Changes
734
+
735
+ - ai@7.0.0-beta.83
736
+
737
+ ## 3.0.0-beta.82
738
+
739
+ ### Patch Changes
740
+
741
+ - Updated dependencies [e27ed76]
742
+ - ai@7.0.0-beta.82
743
+
744
+ ## 3.0.0-beta.81
745
+
746
+ ### Patch Changes
747
+
748
+ - Updated dependencies [2fe1099]
749
+ - Updated dependencies [f04adcb]
750
+ - ai@7.0.0-beta.81
751
+
752
+ ## 3.0.0-beta.80
753
+
754
+ ### Patch Changes
755
+
756
+ - Updated dependencies [3ae1786]
757
+ - ai@7.0.0-beta.80
758
+
759
+ ## 3.0.0-beta.79
760
+
761
+ ### Patch Changes
762
+
763
+ - Updated dependencies [6866afe]
764
+ - ai@7.0.0-beta.79
765
+
766
+ ## 3.0.0-beta.78
767
+
768
+ ### Patch Changes
769
+
770
+ - Updated dependencies [f372547]
771
+ - ai@7.0.0-beta.78
772
+
773
+ ## 3.0.0-beta.77
774
+
775
+ ### Patch Changes
776
+
777
+ - Updated dependencies [2add429]
778
+ - ai@7.0.0-beta.77
779
+
780
+ ## 3.0.0-beta.76
781
+
782
+ ### Patch Changes
783
+
784
+ - Updated dependencies [fcc6869]
785
+ - ai@7.0.0-beta.76
786
+
787
+ ## 3.0.0-beta.75
788
+
789
+ ### Patch Changes
790
+
791
+ - Updated dependencies [176466a]
792
+ - ai@7.0.0-beta.75
793
+
794
+ ## 3.0.0-beta.74
795
+
796
+ ### Patch Changes
797
+
798
+ - Updated dependencies [e311194]
799
+ - ai@7.0.0-beta.74
800
+
801
+ ## 3.0.0-beta.73
802
+
803
+ ### Patch Changes
804
+
805
+ - ai@7.0.0-beta.73
806
+
807
+ ## 3.0.0-beta.72
808
+
809
+ ### Patch Changes
810
+
811
+ - Updated dependencies [664a0eb]
812
+ - ai@7.0.0-beta.72
813
+
814
+ ## 3.0.0-beta.71
815
+
816
+ ### Patch Changes
817
+
818
+ - Updated dependencies [e68be55]
819
+ - ai@7.0.0-beta.71
820
+
821
+ ## 3.0.0-beta.70
822
+
823
+ ### Patch Changes
824
+
825
+ - ai@7.0.0-beta.70
826
+
827
+ ## 3.0.0-beta.69
828
+
829
+ ### Patch Changes
830
+
831
+ - Updated dependencies [34bd95d]
832
+ - Updated dependencies [008271d]
833
+ - Updated dependencies [72223e7]
834
+ - ai@7.0.0-beta.69
835
+
836
+ ## 3.0.0-beta.68
837
+
838
+ ### Patch Changes
839
+
840
+ - Updated dependencies [b0c2869]
841
+ - Updated dependencies [7e26e81]
842
+ - ai@7.0.0-beta.68
843
+
844
+ ## 3.0.0-beta.67
845
+
846
+ ### Patch Changes
847
+
848
+ - Updated dependencies [d1a8bed]
849
+ - ai@7.0.0-beta.67
850
+
851
+ ## 3.0.0-beta.66
852
+
853
+ ### Patch Changes
854
+
855
+ - ai@7.0.0-beta.66
856
+
857
+ ## 3.0.0-beta.65
858
+
859
+ ### Patch Changes
860
+
861
+ - ai@7.0.0-beta.65
862
+
863
+ ## 3.0.0-beta.64
864
+
865
+ ### Patch Changes
866
+
867
+ - ai@7.0.0-beta.64
868
+
869
+ ## 3.0.0-beta.63
870
+
871
+ ### Patch Changes
872
+
873
+ - Updated dependencies [6fd51c0]
874
+ - ai@7.0.0-beta.63
875
+
876
+ ## 3.0.0-beta.62
877
+
878
+ ### Patch Changes
879
+
880
+ - ai@7.0.0-beta.62
881
+
882
+ ## 3.0.0-beta.61
883
+
884
+ ### Patch Changes
885
+
886
+ - Updated dependencies [c29a26f]
887
+ - ai@7.0.0-beta.61
888
+
889
+ ## 3.0.0-beta.60
890
+
891
+ ### Patch Changes
892
+
893
+ - Updated dependencies [38fc777]
894
+ - ai@7.0.0-beta.60
895
+
896
+ ## 3.0.0-beta.59
897
+
898
+ ### Patch Changes
899
+
900
+ - ai@7.0.0-beta.59
901
+
902
+ ## 3.0.0-beta.58
903
+
904
+ ### Patch Changes
905
+
906
+ - Updated dependencies [2e17091]
907
+ - ai@7.0.0-beta.58
908
+
909
+ ## 3.0.0-beta.57
910
+
911
+ ### Patch Changes
912
+
913
+ - Updated dependencies [986c6fd]
914
+ - Updated dependencies [493295c]
915
+ - ai@7.0.0-beta.57
916
+
917
+ ## 3.0.0-beta.56
918
+
919
+ ### Patch Changes
920
+
921
+ - ai@7.0.0-beta.56
922
+
923
+ ## 3.0.0-beta.55
924
+
925
+ ### Patch Changes
926
+
927
+ - Updated dependencies [b3c9f6a]
928
+ - ai@7.0.0-beta.55
929
+
930
+ ## 3.0.0-beta.54
931
+
932
+ ### Patch Changes
933
+
934
+ - Updated dependencies [5d0f18e]
935
+ - ai@7.0.0-beta.54
936
+
937
+ ## 3.0.0-beta.53
938
+
939
+ ### Patch Changes
940
+
941
+ - Updated dependencies [9b47dea]
942
+ - ai@7.0.0-beta.53
943
+
944
+ ## 3.0.0-beta.52
945
+
946
+ ### Patch Changes
947
+
948
+ - Updated dependencies [b56301c]
949
+ - ai@7.0.0-beta.52
950
+
951
+ ## 3.0.0-beta.51
952
+
953
+ ### Patch Changes
954
+
955
+ - Updated dependencies [6abd098]
956
+ - ai@7.0.0-beta.51
957
+
958
+ ## 3.0.0-beta.50
959
+
960
+ ### Patch Changes
961
+
962
+ - Updated dependencies [3debdb7]
963
+ - ai@7.0.0-beta.50
964
+
965
+ ## 3.0.0-beta.49
966
+
967
+ ### Patch Changes
968
+
969
+ - ai@7.0.0-beta.49
970
+
971
+ ## 3.0.0-beta.48
972
+
973
+ ### Patch Changes
974
+
975
+ - Updated dependencies [5c4d910]
976
+ - ai@7.0.0-beta.48
977
+
978
+ ## 3.0.0-beta.47
979
+
980
+ ### Patch Changes
981
+
982
+ - Updated dependencies [bc67b4f]
983
+ - ai@7.0.0-beta.47
984
+
985
+ ## 3.0.0-beta.46
986
+
987
+ ### Patch Changes
988
+
989
+ - Updated dependencies [31ee822]
990
+ - ai@7.0.0-beta.46
991
+
992
+ ## 3.0.0-beta.45
993
+
994
+ ### Patch Changes
995
+
996
+ - ai@7.0.0-beta.45
997
+
998
+ ## 3.0.0-beta.44
999
+
1000
+ ### Patch Changes
1001
+
1002
+ - ai@7.0.0-beta.44
1003
+
1004
+ ## 3.0.0-beta.43
1005
+
1006
+ ### Patch Changes
1007
+
1008
+ - ai@7.0.0-beta.43
1009
+
1010
+ ## 3.0.0-beta.42
1011
+
1012
+ ### Patch Changes
1013
+
1014
+ - Updated dependencies [a3fd75b]
1015
+ - ai@7.0.0-beta.42
1016
+
1017
+ ## 3.0.0-beta.41
1018
+
1019
+ ### Patch Changes
1020
+
1021
+ - ai@7.0.0-beta.41
1022
+
1023
+ ## 3.0.0-beta.40
1024
+
1025
+ ### Patch Changes
1026
+
1027
+ - Updated dependencies [989d3d2]
1028
+ - ai@7.0.0-beta.40
1029
+
1030
+ ## 3.0.0-beta.39
1031
+
1032
+ ### Patch Changes
1033
+
1034
+ - Updated dependencies [f4cfccd]
1035
+ - ai@7.0.0-beta.39
1036
+
1037
+ ## 3.0.0-beta.38
1038
+
1039
+ ### Patch Changes
1040
+
1041
+ - Updated dependencies [1f509d4]
1042
+ - ai@7.0.0-beta.38
1043
+
1044
+ ## 3.0.0-beta.37
1045
+
1046
+ ### Patch Changes
1047
+
1048
+ - ai@7.0.0-beta.37
1049
+
1050
+ ## 3.0.0-beta.36
1051
+
1052
+ ### Patch Changes
1053
+
1054
+ - Updated dependencies [118b953]
1055
+ - ai@7.0.0-beta.36
1056
+
1057
+ ## 3.0.0-beta.35
1058
+
1059
+ ### Patch Changes
1060
+
1061
+ - Updated dependencies [99bf941]
1062
+ - ai@7.0.0-beta.35
1063
+
1064
+ ## 3.0.0-beta.34
1065
+
1066
+ ### Patch Changes
1067
+
1068
+ - ai@7.0.0-beta.34
1069
+
1070
+ ## 3.0.0-beta.33
1071
+
1072
+ ### Patch Changes
1073
+
1074
+ - Updated dependencies [caf1b6f]
1075
+ - ai@7.0.0-beta.33
1076
+
1077
+ ## 3.0.0-beta.32
1078
+
1079
+ ### Patch Changes
1080
+
1081
+ - Updated dependencies [4b46062]
1082
+ - ai@7.0.0-beta.32
1083
+
1084
+ ## 3.0.0-beta.31
1085
+
1086
+ ### Patch Changes
1087
+
1088
+ - Updated dependencies [e79e644]
1089
+ - ai@7.0.0-beta.31
1090
+
1091
+ ## 3.0.0-beta.30
1092
+
1093
+ ### Patch Changes
1094
+
1095
+ - Updated dependencies [f5a6f89]
1096
+ - ai@7.0.0-beta.30
1097
+
1098
+ ## 3.0.0-beta.29
1099
+
1100
+ ### Patch Changes
1101
+
1102
+ - Updated dependencies [877bf12]
1103
+ - ai@7.0.0-beta.29
1104
+
1105
+ ## 3.0.0-beta.28
1106
+
1107
+ ### Patch Changes
1108
+
1109
+ - Updated dependencies [b9cf502]
1110
+ - ai@7.0.0-beta.28
1111
+
1112
+ ## 3.0.0-beta.27
1113
+
1114
+ ### Patch Changes
1115
+
1116
+ - Updated dependencies [3887c70]
1117
+ - ai@7.0.0-beta.27
1118
+
1119
+ ## 3.0.0-beta.26
1120
+
1121
+ ### Patch Changes
1122
+
1123
+ - Updated dependencies [f0b0b20]
1124
+ - ai@7.0.0-beta.26
1125
+
1126
+ ## 3.0.0-beta.25
1127
+
1128
+ ### Patch Changes
1129
+
1130
+ - Updated dependencies [ff9ce30]
1131
+ - ai@7.0.0-beta.25
1132
+
1133
+ ## 3.0.0-beta.24
1134
+
1135
+ ### Patch Changes
1136
+
1137
+ - Updated dependencies [776b617]
1138
+ - ai@7.0.0-beta.24
1139
+
1140
+ ## 3.0.0-beta.23
1141
+
1142
+ ### Patch Changes
1143
+
1144
+ - Updated dependencies [80d4dde]
1145
+ - ai@7.0.0-beta.23
1146
+
1147
+ ## 3.0.0-beta.22
1148
+
1149
+ ### Patch Changes
1150
+
1151
+ - ai@7.0.0-beta.22
1152
+
1153
+ ## 3.0.0-beta.21
1154
+
1155
+ ### Patch Changes
1156
+
1157
+ - Updated dependencies [34fd051]
1158
+ - ai@7.0.0-beta.21
1159
+
1160
+ ## 3.0.0-beta.20
1161
+
1162
+ ### Patch Changes
1163
+
1164
+ - ai@7.0.0-beta.20
1165
+
1166
+ ## 3.0.0-beta.19
1167
+
1168
+ ### Patch Changes
1169
+
1170
+ - ai@7.0.0-beta.19
1171
+
1172
+ ## 3.0.0-beta.18
1173
+
1174
+ ### Patch Changes
1175
+
1176
+ - ai@7.0.0-beta.18
1177
+
3
1178
  ## 3.0.0-beta.17
4
1179
 
5
1180
  ### Patch Changes
package/dist/index.js CHANGED
@@ -1,31 +1,5 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // src/index.ts
21
- var src_exports = {};
22
- __export(src_exports, {
23
- toUIMessageStream: () => toUIMessageStream
24
- });
25
- module.exports = __toCommonJS(src_exports);
26
-
27
1
  // src/llamaindex-adapter.ts
28
- var import_internal = require("ai/internal");
2
+ import { convertAsyncIteratorToReadableStream } from "ai/internal";
29
3
 
30
4
  // src/stream-callbacks.ts
31
5
  function createCallbacksTransformer(callbacks = {}) {
@@ -53,7 +27,7 @@ function createCallbacksTransformer(callbacks = {}) {
53
27
  // src/llamaindex-adapter.ts
54
28
  function toUIMessageStream(stream, callbacks) {
55
29
  const trimStart = trimStartOfStream();
56
- return (0, import_internal.convertAsyncIteratorToReadableStream)(stream[Symbol.asyncIterator]()).pipeThrough(
30
+ return convertAsyncIteratorToReadableStream(stream[Symbol.asyncIterator]()).pipeThrough(
57
31
  new TransformStream({
58
32
  async transform(message, controller) {
59
33
  controller.enqueue(trimStart(message.delta));
@@ -83,8 +57,7 @@ function trimStartOfStream() {
83
57
  return text;
84
58
  };
85
59
  }
86
- // Annotate the CommonJS export names for ESM import in node:
87
- 0 && (module.exports = {
60
+ export {
88
61
  toUIMessageStream
89
- });
62
+ };
90
63
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/llamaindex-adapter.ts","../src/stream-callbacks.ts"],"sourcesContent":["export * from './llamaindex-adapter';\n","import { UIMessageChunk } from 'ai';\nimport { convertAsyncIteratorToReadableStream } from 'ai/internal';\nimport {\n createCallbacksTransformer,\n StreamCallbacks,\n} from './stream-callbacks';\n\ntype EngineResponse = {\n delta: string;\n};\n\nexport function toUIMessageStream(\n stream: AsyncIterable<EngineResponse>,\n callbacks?: StreamCallbacks,\n) {\n const trimStart = trimStartOfStream();\n\n return convertAsyncIteratorToReadableStream(stream[Symbol.asyncIterator]())\n .pipeThrough(\n new TransformStream({\n async transform(message, controller): Promise<void> {\n controller.enqueue(trimStart(message.delta));\n },\n }),\n )\n .pipeThrough(createCallbacksTransformer(callbacks))\n .pipeThrough(\n new TransformStream<string, UIMessageChunk>({\n start: async controller => {\n controller.enqueue({ type: 'text-start', id: '1' });\n },\n transform: async (chunk, controller) => {\n controller.enqueue({ type: 'text-delta', delta: chunk, id: '1' });\n },\n flush: async controller => {\n controller.enqueue({ type: 'text-end', id: '1' });\n },\n }),\n );\n}\n\nfunction trimStartOfStream(): (text: string) => string {\n let isStreamStart = true;\n\n return (text: string): string => {\n if (isStreamStart) {\n text = text.trimStart();\n if (text) isStreamStart = false;\n }\n return text;\n };\n}\n","/**\n * Configuration options and helper callback methods for stream lifecycle events.\n */\nexport interface StreamCallbacks {\n /** `onStart`: Called once when the stream is initialized. */\n onStart?: () => Promise<void> | void;\n\n /** `onFinal`: Called once when the stream is closed with the final completion message. */\n onFinal?: (completion: string) => Promise<void> | void;\n\n /** `onToken`: Called for each tokenized message. */\n onToken?: (token: string) => Promise<void> | void;\n\n /** `onText`: Called for each text chunk. */\n onText?: (text: string) => Promise<void> | void;\n}\n\n/**\n * Creates a transform stream that encodes input messages and invokes optional callback functions.\n * The transform stream uses the provided callbacks to execute custom logic at different stages of the stream's lifecycle.\n * - `onStart`: Called once when the stream is initialized.\n * - `onToken`: Called for each tokenized message.\n * - `onFinal`: Called once when the stream is closed with the final completion message.\n *\n * This function is useful when you want to process a stream of messages and perform specific actions during the stream's lifecycle.\n *\n * @param {StreamCallbacks} [callbacks] - An object containing the callback functions.\n * @return {TransformStream<string, Uint8Array>} A transform stream that encodes input messages as Uint8Array and allows the execution of custom logic through callbacks.\n *\n * @example\n * const callbacks = {\n * onStart: async () => console.log('Stream started'),\n * onToken: async (token) => console.log(`Token: ${token}`),\n * onFinal: async () => data.close()\n * };\n * const transformer = createCallbacksTransformer(callbacks);\n */\nexport function createCallbacksTransformer(\n callbacks: StreamCallbacks | undefined = {},\n): TransformStream<string, string> {\n let aggregatedResponse = '';\n\n return new TransformStream({\n async start(): Promise<void> {\n if (callbacks.onStart) await callbacks.onStart();\n },\n\n async transform(message, controller): Promise<void> {\n controller.enqueue(message);\n\n aggregatedResponse += message;\n\n if (callbacks.onToken) await callbacks.onToken(message);\n if (callbacks.onText && typeof message === 'string') {\n await callbacks.onText(message);\n }\n },\n\n async flush(): Promise<void> {\n if (callbacks.onFinal) {\n await callbacks.onFinal(aggregatedResponse);\n }\n },\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACCA,sBAAqD;;;ACoC9C,SAAS,2BACd,YAAyC,CAAC,GACT;AACjC,MAAI,qBAAqB;AAEzB,SAAO,IAAI,gBAAgB;AAAA,IACzB,MAAM,QAAuB;AAC3B,UAAI,UAAU,QAAS,OAAM,UAAU,QAAQ;AAAA,IACjD;AAAA,IAEA,MAAM,UAAU,SAAS,YAA2B;AAClD,iBAAW,QAAQ,OAAO;AAE1B,4BAAsB;AAEtB,UAAI,UAAU,QAAS,OAAM,UAAU,QAAQ,OAAO;AACtD,UAAI,UAAU,UAAU,OAAO,YAAY,UAAU;AACnD,cAAM,UAAU,OAAO,OAAO;AAAA,MAChC;AAAA,IACF;AAAA,IAEA,MAAM,QAAuB;AAC3B,UAAI,UAAU,SAAS;AACrB,cAAM,UAAU,QAAQ,kBAAkB;AAAA,MAC5C;AAAA,IACF;AAAA,EACF,CAAC;AACH;;;ADrDO,SAAS,kBACd,QACA,WACA;AACA,QAAM,YAAY,kBAAkB;AAEpC,aAAO,sDAAqC,OAAO,OAAO,aAAa,EAAE,CAAC,EACvE;AAAA,IACC,IAAI,gBAAgB;AAAA,MAClB,MAAM,UAAU,SAAS,YAA2B;AAClD,mBAAW,QAAQ,UAAU,QAAQ,KAAK,CAAC;AAAA,MAC7C;AAAA,IACF,CAAC;AAAA,EACH,EACC,YAAY,2BAA2B,SAAS,CAAC,EACjD;AAAA,IACC,IAAI,gBAAwC;AAAA,MAC1C,OAAO,OAAM,eAAc;AACzB,mBAAW,QAAQ,EAAE,MAAM,cAAc,IAAI,IAAI,CAAC;AAAA,MACpD;AAAA,MACA,WAAW,OAAO,OAAO,eAAe;AACtC,mBAAW,QAAQ,EAAE,MAAM,cAAc,OAAO,OAAO,IAAI,IAAI,CAAC;AAAA,MAClE;AAAA,MACA,OAAO,OAAM,eAAc;AACzB,mBAAW,QAAQ,EAAE,MAAM,YAAY,IAAI,IAAI,CAAC;AAAA,MAClD;AAAA,IACF,CAAC;AAAA,EACH;AACJ;AAEA,SAAS,oBAA8C;AACrD,MAAI,gBAAgB;AAEpB,SAAO,CAAC,SAAyB;AAC/B,QAAI,eAAe;AACjB,aAAO,KAAK,UAAU;AACtB,UAAI,KAAM,iBAAgB;AAAA,IAC5B;AACA,WAAO;AAAA,EACT;AACF;","names":[]}
1
+ {"version":3,"sources":["../src/llamaindex-adapter.ts","../src/stream-callbacks.ts"],"sourcesContent":["import type { UIMessageChunk } from 'ai';\nimport { convertAsyncIteratorToReadableStream } from 'ai/internal';\nimport {\n createCallbacksTransformer,\n type StreamCallbacks,\n} from './stream-callbacks';\ntype EngineResponse = {\n delta: string;\n};\n\nexport function toUIMessageStream(\n stream: AsyncIterable<EngineResponse>,\n callbacks?: StreamCallbacks,\n) {\n const trimStart = trimStartOfStream();\n\n return convertAsyncIteratorToReadableStream(stream[Symbol.asyncIterator]())\n .pipeThrough(\n new TransformStream({\n async transform(message, controller): Promise<void> {\n controller.enqueue(trimStart(message.delta));\n },\n }),\n )\n .pipeThrough(createCallbacksTransformer(callbacks))\n .pipeThrough(\n new TransformStream<string, UIMessageChunk>({\n start: async controller => {\n controller.enqueue({ type: 'text-start', id: '1' });\n },\n transform: async (chunk, controller) => {\n controller.enqueue({ type: 'text-delta', delta: chunk, id: '1' });\n },\n flush: async controller => {\n controller.enqueue({ type: 'text-end', id: '1' });\n },\n }),\n );\n}\n\nfunction trimStartOfStream(): (text: string) => string {\n let isStreamStart = true;\n\n return (text: string): string => {\n if (isStreamStart) {\n text = text.trimStart();\n if (text) isStreamStart = false;\n }\n return text;\n };\n}\n","/**\n * Configuration options and helper callback methods for stream lifecycle events.\n */\nexport interface StreamCallbacks {\n /** `onStart`: Called once when the stream is initialized. */\n onStart?: () => Promise<void> | void;\n\n /** `onFinal`: Called once when the stream is closed with the final completion message. */\n onFinal?: (completion: string) => Promise<void> | void;\n\n /** `onToken`: Called for each tokenized message. */\n onToken?: (token: string) => Promise<void> | void;\n\n /** `onText`: Called for each text chunk. */\n onText?: (text: string) => Promise<void> | void;\n}\n\n/**\n * Creates a transform stream that encodes input messages and invokes optional callback functions.\n * The transform stream uses the provided callbacks to execute custom logic at different stages of the stream's lifecycle.\n * - `onStart`: Called once when the stream is initialized.\n * - `onToken`: Called for each tokenized message.\n * - `onFinal`: Called once when the stream is closed with the final completion message.\n *\n * This function is useful when you want to process a stream of messages and perform specific actions during the stream's lifecycle.\n *\n * @param {StreamCallbacks} [callbacks] - An object containing the callback functions.\n * @return {TransformStream<string, Uint8Array>} A transform stream that encodes input messages as Uint8Array and allows the execution of custom logic through callbacks.\n *\n * @example\n * const callbacks = {\n * onStart: async () => console.log('Stream started'),\n * onToken: async (token) => console.log(`Token: ${token}`),\n * onFinal: async () => data.close()\n * };\n * const transformer = createCallbacksTransformer(callbacks);\n */\nexport function createCallbacksTransformer(\n callbacks: StreamCallbacks | undefined = {},\n): TransformStream<string, string> {\n let aggregatedResponse = '';\n\n return new TransformStream({\n async start(): Promise<void> {\n if (callbacks.onStart) await callbacks.onStart();\n },\n\n async transform(message, controller): Promise<void> {\n controller.enqueue(message);\n\n aggregatedResponse += message;\n\n if (callbacks.onToken) await callbacks.onToken(message);\n if (callbacks.onText && typeof message === 'string') {\n await callbacks.onText(message);\n }\n },\n\n async flush(): Promise<void> {\n if (callbacks.onFinal) {\n await callbacks.onFinal(aggregatedResponse);\n }\n },\n });\n}\n"],"mappings":";AACA,SAAS,4CAA4C;;;ACoC9C,SAAS,2BACd,YAAyC,CAAC,GACT;AACjC,MAAI,qBAAqB;AAEzB,SAAO,IAAI,gBAAgB;AAAA,IACzB,MAAM,QAAuB;AAC3B,UAAI,UAAU,QAAS,OAAM,UAAU,QAAQ;AAAA,IACjD;AAAA,IAEA,MAAM,UAAU,SAAS,YAA2B;AAClD,iBAAW,QAAQ,OAAO;AAE1B,4BAAsB;AAEtB,UAAI,UAAU,QAAS,OAAM,UAAU,QAAQ,OAAO;AACtD,UAAI,UAAU,UAAU,OAAO,YAAY,UAAU;AACnD,cAAM,UAAU,OAAO,OAAO;AAAA,MAChC;AAAA,IACF;AAAA,IAEA,MAAM,QAAuB;AAC3B,UAAI,UAAU,SAAS;AACrB,cAAM,UAAU,QAAQ,kBAAkB;AAAA,MAC5C;AAAA,IACF;AAAA,EACF,CAAC;AACH;;;ADtDO,SAAS,kBACd,QACA,WACA;AACA,QAAM,YAAY,kBAAkB;AAEpC,SAAO,qCAAqC,OAAO,OAAO,aAAa,EAAE,CAAC,EACvE;AAAA,IACC,IAAI,gBAAgB;AAAA,MAClB,MAAM,UAAU,SAAS,YAA2B;AAClD,mBAAW,QAAQ,UAAU,QAAQ,KAAK,CAAC;AAAA,MAC7C;AAAA,IACF,CAAC;AAAA,EACH,EACC,YAAY,2BAA2B,SAAS,CAAC,EACjD;AAAA,IACC,IAAI,gBAAwC;AAAA,MAC1C,OAAO,OAAM,eAAc;AACzB,mBAAW,QAAQ,EAAE,MAAM,cAAc,IAAI,IAAI,CAAC;AAAA,MACpD;AAAA,MACA,WAAW,OAAO,OAAO,eAAe;AACtC,mBAAW,QAAQ,EAAE,MAAM,cAAc,OAAO,OAAO,IAAI,IAAI,CAAC;AAAA,MAClE;AAAA,MACA,OAAO,OAAM,eAAc;AACzB,mBAAW,QAAQ,EAAE,MAAM,YAAY,IAAI,IAAI,CAAC;AAAA,MAClD;AAAA,IACF,CAAC;AAAA,EACH;AACJ;AAEA,SAAS,oBAA8C;AACrD,MAAI,gBAAgB;AAEpB,SAAO,CAAC,SAAyB;AAC/B,QAAI,eAAe;AACjB,aAAO,KAAK,UAAU;AACtB,UAAI,KAAM,iBAAgB;AAAA,IAC5B;AACA,WAAO;AAAA,EACT;AACF;","names":[]}
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@ai-sdk/llamaindex",
3
- "version": "3.0.0-beta.17",
3
+ "version": "3.0.0-beta.178",
4
+ "type": "module",
4
5
  "license": "Apache-2.0",
5
6
  "sideEffects": false,
6
7
  "main": "./dist/index.js",
7
- "module": "./dist/index.mjs",
8
8
  "types": "./dist/index.d.ts",
9
9
  "files": [
10
10
  "dist/**/*",
@@ -20,29 +20,31 @@
20
20
  "./package.json": "./package.json",
21
21
  ".": {
22
22
  "types": "./dist/index.d.ts",
23
- "import": "./dist/index.mjs",
24
- "require": "./dist/index.js"
23
+ "import": "./dist/index.js",
24
+ "default": "./dist/index.js"
25
25
  }
26
26
  },
27
27
  "dependencies": {
28
- "ai": "7.0.0-beta.17"
28
+ "ai": "7.0.0-beta.178"
29
29
  },
30
30
  "devDependencies": {
31
- "@types/node": "20.17.24",
32
- "tsup": "^8",
31
+ "@types/node": "22.19.19",
32
+ "tsup": "^8.5.1",
33
33
  "typescript": "5.8.3",
34
34
  "@vercel/ai-tsconfig": "0.0.0"
35
35
  },
36
36
  "engines": {
37
- "node": ">=18"
37
+ "node": ">=22"
38
38
  },
39
39
  "publishConfig": {
40
- "access": "public"
40
+ "access": "public",
41
+ "provenance": true
41
42
  },
42
43
  "homepage": "https://ai-sdk.dev/docs",
43
44
  "repository": {
44
45
  "type": "git",
45
- "url": "git+https://github.com/vercel/ai.git"
46
+ "url": "https://github.com/vercel/ai",
47
+ "directory": "packages/llamaindex"
46
48
  },
47
49
  "bugs": {
48
50
  "url": "https://github.com/vercel/ai/issues"
@@ -54,9 +56,7 @@
54
56
  "build": "pnpm clean && tsup --tsconfig tsconfig.build.json",
55
57
  "build:watch": "pnpm clean && tsup --watch",
56
58
  "clean": "del-cli dist *.tsbuildinfo",
57
- "lint": "eslint \"./**/*.ts*\"",
58
59
  "type-check": "tsc --build",
59
- "prettier-check": "prettier --check \"./**/*.ts*\"",
60
60
  "test": "pnpm test:node && pnpm test:edge",
61
61
  "test:update": "pnpm test:node -u",
62
62
  "test:watch": "vitest --config vitest.node.config.js",
@@ -1,10 +1,9 @@
1
- import { UIMessageChunk } from 'ai';
1
+ import type { UIMessageChunk } from 'ai';
2
2
  import { convertAsyncIteratorToReadableStream } from 'ai/internal';
3
3
  import {
4
4
  createCallbacksTransformer,
5
- StreamCallbacks,
5
+ type StreamCallbacks,
6
6
  } from './stream-callbacks';
7
-
8
7
  type EngineResponse = {
9
8
  delta: string;
10
9
  };
package/dist/index.d.mts DELETED
@@ -1,22 +0,0 @@
1
- import { UIMessageChunk } from 'ai';
2
-
3
- /**
4
- * Configuration options and helper callback methods for stream lifecycle events.
5
- */
6
- interface StreamCallbacks {
7
- /** `onStart`: Called once when the stream is initialized. */
8
- onStart?: () => Promise<void> | void;
9
- /** `onFinal`: Called once when the stream is closed with the final completion message. */
10
- onFinal?: (completion: string) => Promise<void> | void;
11
- /** `onToken`: Called for each tokenized message. */
12
- onToken?: (token: string) => Promise<void> | void;
13
- /** `onText`: Called for each text chunk. */
14
- onText?: (text: string) => Promise<void> | void;
15
- }
16
-
17
- type EngineResponse = {
18
- delta: string;
19
- };
20
- declare function toUIMessageStream(stream: AsyncIterable<EngineResponse>, callbacks?: StreamCallbacks): ReadableStream<UIMessageChunk>;
21
-
22
- export { toUIMessageStream };
package/dist/index.mjs DELETED
@@ -1,63 +0,0 @@
1
- // src/llamaindex-adapter.ts
2
- import { convertAsyncIteratorToReadableStream } from "ai/internal";
3
-
4
- // src/stream-callbacks.ts
5
- function createCallbacksTransformer(callbacks = {}) {
6
- let aggregatedResponse = "";
7
- return new TransformStream({
8
- async start() {
9
- if (callbacks.onStart) await callbacks.onStart();
10
- },
11
- async transform(message, controller) {
12
- controller.enqueue(message);
13
- aggregatedResponse += message;
14
- if (callbacks.onToken) await callbacks.onToken(message);
15
- if (callbacks.onText && typeof message === "string") {
16
- await callbacks.onText(message);
17
- }
18
- },
19
- async flush() {
20
- if (callbacks.onFinal) {
21
- await callbacks.onFinal(aggregatedResponse);
22
- }
23
- }
24
- });
25
- }
26
-
27
- // src/llamaindex-adapter.ts
28
- function toUIMessageStream(stream, callbacks) {
29
- const trimStart = trimStartOfStream();
30
- return convertAsyncIteratorToReadableStream(stream[Symbol.asyncIterator]()).pipeThrough(
31
- new TransformStream({
32
- async transform(message, controller) {
33
- controller.enqueue(trimStart(message.delta));
34
- }
35
- })
36
- ).pipeThrough(createCallbacksTransformer(callbacks)).pipeThrough(
37
- new TransformStream({
38
- start: async (controller) => {
39
- controller.enqueue({ type: "text-start", id: "1" });
40
- },
41
- transform: async (chunk, controller) => {
42
- controller.enqueue({ type: "text-delta", delta: chunk, id: "1" });
43
- },
44
- flush: async (controller) => {
45
- controller.enqueue({ type: "text-end", id: "1" });
46
- }
47
- })
48
- );
49
- }
50
- function trimStartOfStream() {
51
- let isStreamStart = true;
52
- return (text) => {
53
- if (isStreamStart) {
54
- text = text.trimStart();
55
- if (text) isStreamStart = false;
56
- }
57
- return text;
58
- };
59
- }
60
- export {
61
- toUIMessageStream
62
- };
63
- //# sourceMappingURL=index.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/llamaindex-adapter.ts","../src/stream-callbacks.ts"],"sourcesContent":["import { UIMessageChunk } from 'ai';\nimport { convertAsyncIteratorToReadableStream } from 'ai/internal';\nimport {\n createCallbacksTransformer,\n StreamCallbacks,\n} from './stream-callbacks';\n\ntype EngineResponse = {\n delta: string;\n};\n\nexport function toUIMessageStream(\n stream: AsyncIterable<EngineResponse>,\n callbacks?: StreamCallbacks,\n) {\n const trimStart = trimStartOfStream();\n\n return convertAsyncIteratorToReadableStream(stream[Symbol.asyncIterator]())\n .pipeThrough(\n new TransformStream({\n async transform(message, controller): Promise<void> {\n controller.enqueue(trimStart(message.delta));\n },\n }),\n )\n .pipeThrough(createCallbacksTransformer(callbacks))\n .pipeThrough(\n new TransformStream<string, UIMessageChunk>({\n start: async controller => {\n controller.enqueue({ type: 'text-start', id: '1' });\n },\n transform: async (chunk, controller) => {\n controller.enqueue({ type: 'text-delta', delta: chunk, id: '1' });\n },\n flush: async controller => {\n controller.enqueue({ type: 'text-end', id: '1' });\n },\n }),\n );\n}\n\nfunction trimStartOfStream(): (text: string) => string {\n let isStreamStart = true;\n\n return (text: string): string => {\n if (isStreamStart) {\n text = text.trimStart();\n if (text) isStreamStart = false;\n }\n return text;\n };\n}\n","/**\n * Configuration options and helper callback methods for stream lifecycle events.\n */\nexport interface StreamCallbacks {\n /** `onStart`: Called once when the stream is initialized. */\n onStart?: () => Promise<void> | void;\n\n /** `onFinal`: Called once when the stream is closed with the final completion message. */\n onFinal?: (completion: string) => Promise<void> | void;\n\n /** `onToken`: Called for each tokenized message. */\n onToken?: (token: string) => Promise<void> | void;\n\n /** `onText`: Called for each text chunk. */\n onText?: (text: string) => Promise<void> | void;\n}\n\n/**\n * Creates a transform stream that encodes input messages and invokes optional callback functions.\n * The transform stream uses the provided callbacks to execute custom logic at different stages of the stream's lifecycle.\n * - `onStart`: Called once when the stream is initialized.\n * - `onToken`: Called for each tokenized message.\n * - `onFinal`: Called once when the stream is closed with the final completion message.\n *\n * This function is useful when you want to process a stream of messages and perform specific actions during the stream's lifecycle.\n *\n * @param {StreamCallbacks} [callbacks] - An object containing the callback functions.\n * @return {TransformStream<string, Uint8Array>} A transform stream that encodes input messages as Uint8Array and allows the execution of custom logic through callbacks.\n *\n * @example\n * const callbacks = {\n * onStart: async () => console.log('Stream started'),\n * onToken: async (token) => console.log(`Token: ${token}`),\n * onFinal: async () => data.close()\n * };\n * const transformer = createCallbacksTransformer(callbacks);\n */\nexport function createCallbacksTransformer(\n callbacks: StreamCallbacks | undefined = {},\n): TransformStream<string, string> {\n let aggregatedResponse = '';\n\n return new TransformStream({\n async start(): Promise<void> {\n if (callbacks.onStart) await callbacks.onStart();\n },\n\n async transform(message, controller): Promise<void> {\n controller.enqueue(message);\n\n aggregatedResponse += message;\n\n if (callbacks.onToken) await callbacks.onToken(message);\n if (callbacks.onText && typeof message === 'string') {\n await callbacks.onText(message);\n }\n },\n\n async flush(): Promise<void> {\n if (callbacks.onFinal) {\n await callbacks.onFinal(aggregatedResponse);\n }\n },\n });\n}\n"],"mappings":";AACA,SAAS,4CAA4C;;;ACoC9C,SAAS,2BACd,YAAyC,CAAC,GACT;AACjC,MAAI,qBAAqB;AAEzB,SAAO,IAAI,gBAAgB;AAAA,IACzB,MAAM,QAAuB;AAC3B,UAAI,UAAU,QAAS,OAAM,UAAU,QAAQ;AAAA,IACjD;AAAA,IAEA,MAAM,UAAU,SAAS,YAA2B;AAClD,iBAAW,QAAQ,OAAO;AAE1B,4BAAsB;AAEtB,UAAI,UAAU,QAAS,OAAM,UAAU,QAAQ,OAAO;AACtD,UAAI,UAAU,UAAU,OAAO,YAAY,UAAU;AACnD,cAAM,UAAU,OAAO,OAAO;AAAA,MAChC;AAAA,IACF;AAAA,IAEA,MAAM,QAAuB;AAC3B,UAAI,UAAU,SAAS;AACrB,cAAM,UAAU,QAAQ,kBAAkB;AAAA,MAC5C;AAAA,IACF;AAAA,EACF,CAAC;AACH;;;ADrDO,SAAS,kBACd,QACA,WACA;AACA,QAAM,YAAY,kBAAkB;AAEpC,SAAO,qCAAqC,OAAO,OAAO,aAAa,EAAE,CAAC,EACvE;AAAA,IACC,IAAI,gBAAgB;AAAA,MAClB,MAAM,UAAU,SAAS,YAA2B;AAClD,mBAAW,QAAQ,UAAU,QAAQ,KAAK,CAAC;AAAA,MAC7C;AAAA,IACF,CAAC;AAAA,EACH,EACC,YAAY,2BAA2B,SAAS,CAAC,EACjD;AAAA,IACC,IAAI,gBAAwC;AAAA,MAC1C,OAAO,OAAM,eAAc;AACzB,mBAAW,QAAQ,EAAE,MAAM,cAAc,IAAI,IAAI,CAAC;AAAA,MACpD;AAAA,MACA,WAAW,OAAO,OAAO,eAAe;AACtC,mBAAW,QAAQ,EAAE,MAAM,cAAc,OAAO,OAAO,IAAI,IAAI,CAAC;AAAA,MAClE;AAAA,MACA,OAAO,OAAM,eAAc;AACzB,mBAAW,QAAQ,EAAE,MAAM,YAAY,IAAI,IAAI,CAAC;AAAA,MAClD;AAAA,IACF,CAAC;AAAA,EACH;AACJ;AAEA,SAAS,oBAA8C;AACrD,MAAI,gBAAgB;AAEpB,SAAO,CAAC,SAAyB;AAC/B,QAAI,eAAe;AACjB,aAAO,KAAK,UAAU;AACtB,UAAI,KAAM,iBAAgB;AAAA,IAC5B;AACA,WAAO;AAAA,EACT;AACF;","names":[]}