@v0-sdk/ai-tools 0.3.7 → 3.0.0-canary.bf3a020

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/dist/index.d.ts DELETED
@@ -1,2034 +0,0 @@
1
- import * as ai from 'ai';
2
- import { V0ClientConfig } from 'v0-sdk';
3
-
4
- interface V0ToolsConfig extends V0ClientConfig {
5
- /**
6
- * Optional base URL for v0 API
7
- * @default "https://api.v0.dev"
8
- */
9
- baseUrl?: string;
10
- /**
11
- * API key for v0 authentication
12
- * If not provided, will use V0_API_KEY environment variable
13
- */
14
- apiKey?: string;
15
- }
16
-
17
- /**
18
- * Creates chat-related AI SDK tools
19
- */
20
- declare function createChatTools(config?: V0ClientConfig): {
21
- createChat: ai.Tool<{
22
- message: string;
23
- system?: string | undefined;
24
- attachments?: {
25
- url: string;
26
- }[] | undefined;
27
- chatPrivacy?: "public" | "private" | "team-edit" | "team" | "unlisted" | undefined;
28
- projectId?: string | undefined;
29
- modelConfiguration?: {
30
- modelId: "v0-mini" | "v0-pro" | "v0-max" | "v0-max-fast";
31
- imageGenerations?: boolean | undefined;
32
- thinking?: boolean | undefined;
33
- } | undefined;
34
- responseMode?: "sync" | "async" | undefined;
35
- }, {
36
- chatId: string;
37
- webUrl: string;
38
- apiUrl: string;
39
- privacy: string;
40
- name: string;
41
- favorite: boolean;
42
- latestVersion: string;
43
- createdAt: string;
44
- } | {
45
- chatId: string;
46
- webUrl: string;
47
- apiUrl: string;
48
- privacy: "public" | "private" | "team-edit" | "team" | "unlisted";
49
- name: string | undefined;
50
- favorite: boolean;
51
- latestVersion: {
52
- id: string;
53
- object: "version";
54
- status: "pending" | "completed" | "failed";
55
- demoUrl?: string;
56
- screenshotUrl?: string;
57
- createdAt: string;
58
- updatedAt?: string;
59
- files: {
60
- object: "file";
61
- name: string;
62
- content: string;
63
- locked: boolean;
64
- }[];
65
- } | undefined;
66
- createdAt: string;
67
- }>;
68
- sendMessage: ai.Tool<{
69
- message: string;
70
- chatId: string;
71
- attachments?: {
72
- url: string;
73
- }[] | undefined;
74
- modelConfiguration?: {
75
- modelId: "v0-mini" | "v0-pro" | "v0-max" | "v0-max-fast";
76
- imageGenerations?: boolean | undefined;
77
- thinking?: boolean | undefined;
78
- } | undefined;
79
- responseMode?: "sync" | "async" | undefined;
80
- }, {
81
- chatId: string;
82
- webUrl: string;
83
- latestVersion: string;
84
- updatedAt: string;
85
- } | {
86
- chatId: string;
87
- webUrl: string;
88
- latestVersion: {
89
- id: string;
90
- object: "version";
91
- status: "pending" | "completed" | "failed";
92
- demoUrl?: string;
93
- screenshotUrl?: string;
94
- createdAt: string;
95
- updatedAt?: string;
96
- files: {
97
- object: "file";
98
- name: string;
99
- content: string;
100
- locked: boolean;
101
- }[];
102
- } | undefined;
103
- updatedAt: string | undefined;
104
- }>;
105
- getChat: ai.Tool<{
106
- chatId: string;
107
- }, {
108
- chatId: string;
109
- name: string | undefined;
110
- privacy: "public" | "private" | "team-edit" | "team" | "unlisted";
111
- webUrl: string;
112
- favorite: boolean;
113
- createdAt: string;
114
- updatedAt: string | undefined;
115
- latestVersion: {
116
- id: string;
117
- object: "version";
118
- status: "pending" | "completed" | "failed";
119
- demoUrl?: string;
120
- screenshotUrl?: string;
121
- createdAt: string;
122
- updatedAt?: string;
123
- files: {
124
- object: "file";
125
- name: string;
126
- content: string;
127
- locked: boolean;
128
- }[];
129
- } | undefined;
130
- messagesCount: number;
131
- }>;
132
- updateChat: ai.Tool<{
133
- chatId: string;
134
- name?: string | undefined;
135
- privacy?: "public" | "private" | "team-edit" | "team" | "unlisted" | undefined;
136
- }, {
137
- chatId: string;
138
- name: string | undefined;
139
- privacy: "public" | "private" | "team-edit" | "team" | "unlisted";
140
- updatedAt: string | undefined;
141
- }>;
142
- deleteChat: ai.Tool<{
143
- chatId: string;
144
- }, {
145
- chatId: string;
146
- deleted: true;
147
- }>;
148
- favoriteChat: ai.Tool<{
149
- chatId: string;
150
- isFavorite: boolean;
151
- }, {
152
- chatId: string;
153
- favorited: boolean;
154
- }>;
155
- forkChat: ai.Tool<{
156
- chatId: string;
157
- privacy?: "public" | "private" | "team-edit" | "team" | "unlisted" | undefined;
158
- versionId?: string | undefined;
159
- }, {
160
- originalChatId: string;
161
- newChatId: string;
162
- webUrl: string;
163
- privacy: "public" | "private" | "team-edit" | "team" | "unlisted";
164
- createdAt: string;
165
- }>;
166
- listChats: ai.Tool<{
167
- isFavorite?: boolean | undefined;
168
- limit?: number | undefined;
169
- offset?: number | undefined;
170
- }, {
171
- chats: {
172
- chatId: string;
173
- name: string | undefined;
174
- privacy: "public" | "private" | "team-edit" | "team" | "unlisted";
175
- webUrl: string;
176
- favorite: boolean;
177
- createdAt: string;
178
- updatedAt: string | undefined;
179
- }[];
180
- }>;
181
- };
182
-
183
- /**
184
- * Creates project-related AI SDK tools
185
- */
186
- declare function createProjectTools(config?: V0ClientConfig): {
187
- createProject: ai.Tool<{
188
- name: string;
189
- description?: string | undefined;
190
- privacy?: "private" | "team" | undefined;
191
- icon?: string | undefined;
192
- environmentVariables?: {
193
- value: string;
194
- key: string;
195
- }[] | undefined;
196
- instructions?: string | undefined;
197
- vercelProjectId?: string | undefined;
198
- }, {
199
- projectId: string;
200
- name: string;
201
- description: string | undefined;
202
- privacy: "private" | "team";
203
- webUrl: string;
204
- apiUrl: string;
205
- createdAt: string;
206
- vercelProjectId: string | undefined;
207
- }>;
208
- getProject: ai.Tool<{
209
- projectId: string;
210
- }, {
211
- projectId: string;
212
- name: string;
213
- description: string | undefined;
214
- instructions: string | undefined;
215
- privacy: "private" | "team";
216
- webUrl: string;
217
- apiUrl: string;
218
- createdAt: string;
219
- updatedAt: string | undefined;
220
- vercelProjectId: string | undefined;
221
- chatsCount: number;
222
- }>;
223
- updateProject: ai.Tool<{
224
- projectId: string;
225
- description?: string | undefined;
226
- name?: string | undefined;
227
- privacy?: "private" | "team" | undefined;
228
- instructions?: string | undefined;
229
- }, {
230
- projectId: string;
231
- name: string;
232
- description: string | undefined;
233
- instructions: string | undefined;
234
- privacy: "private" | "team";
235
- updatedAt: string | undefined;
236
- }>;
237
- listProjects: ai.Tool<{}, {
238
- projects: {
239
- projectId: string;
240
- name: string;
241
- privacy: "private" | "team";
242
- webUrl: string;
243
- createdAt: string;
244
- updatedAt: string | undefined;
245
- vercelProjectId: string | undefined;
246
- }[];
247
- }>;
248
- assignChatToProject: ai.Tool<{
249
- projectId: string;
250
- chatId: string;
251
- }, {
252
- projectId: string;
253
- assigned: true;
254
- }>;
255
- getProjectByChat: ai.Tool<{
256
- chatId: string;
257
- }, {
258
- projectId: string;
259
- name: string;
260
- description: string | undefined;
261
- privacy: "private" | "team";
262
- webUrl: string;
263
- createdAt: string;
264
- chatsCount: number;
265
- }>;
266
- createEnvironmentVariables: ai.Tool<{
267
- projectId: string;
268
- environmentVariables: {
269
- value: string;
270
- key: string;
271
- }[];
272
- upsert?: boolean | undefined;
273
- decrypted?: boolean | undefined;
274
- }, {
275
- environmentVariables: {
276
- id: string;
277
- key: string;
278
- value: string;
279
- decrypted: boolean;
280
- createdAt: number;
281
- }[];
282
- }>;
283
- listEnvironmentVariables: ai.Tool<{
284
- projectId: string;
285
- decrypted?: boolean | undefined;
286
- }, {
287
- environmentVariables: {
288
- id: string;
289
- key: string;
290
- value: string;
291
- decrypted: boolean;
292
- createdAt: number;
293
- updatedAt: number | undefined;
294
- }[];
295
- }>;
296
- updateEnvironmentVariables: ai.Tool<{
297
- projectId: string;
298
- environmentVariables: {
299
- value: string;
300
- id: string;
301
- }[];
302
- decrypted?: boolean | undefined;
303
- }, {
304
- environmentVariables: {
305
- id: string;
306
- key: string;
307
- value: string;
308
- decrypted: boolean;
309
- updatedAt: number | undefined;
310
- }[];
311
- }>;
312
- deleteEnvironmentVariables: ai.Tool<{
313
- projectId: string;
314
- environmentVariableIds: string[];
315
- }, {
316
- deletedVariables: {
317
- id: string;
318
- deleted: true;
319
- }[];
320
- }>;
321
- };
322
-
323
- /**
324
- * Creates deployment-related AI SDK tools
325
- */
326
- declare function createDeploymentTools(config?: V0ClientConfig): {
327
- createDeployment: ai.Tool<{
328
- projectId: string;
329
- chatId: string;
330
- versionId: string;
331
- }, {
332
- deploymentId: string;
333
- projectId: string;
334
- chatId: string;
335
- versionId: string;
336
- inspectorUrl: string;
337
- webUrl: string;
338
- apiUrl: string;
339
- }>;
340
- getDeployment: ai.Tool<{
341
- deploymentId: string;
342
- }, {
343
- deploymentId: string;
344
- projectId: string;
345
- chatId: string;
346
- versionId: string;
347
- inspectorUrl: string;
348
- webUrl: string;
349
- apiUrl: string;
350
- }>;
351
- deleteDeployment: ai.Tool<{
352
- deploymentId: string;
353
- }, {
354
- deploymentId: string;
355
- deleted: true;
356
- }>;
357
- listDeployments: ai.Tool<{
358
- projectId: string;
359
- chatId: string;
360
- versionId: string;
361
- }, {
362
- deployments: {
363
- deploymentId: string;
364
- projectId: string;
365
- chatId: string;
366
- versionId: string;
367
- inspectorUrl: string;
368
- webUrl: string;
369
- apiUrl: string;
370
- }[];
371
- }>;
372
- getDeploymentLogs: ai.Tool<{
373
- deploymentId: string;
374
- since?: number | undefined;
375
- }, {
376
- logs: {
377
- createdAt: string;
378
- deploymentId: string;
379
- id: string;
380
- text: string;
381
- type: "stdout" | "stderr";
382
- level?: "error" | "warning" | "info";
383
- object: "deployment_log";
384
- }[];
385
- nextSince: number | undefined;
386
- }>;
387
- getDeploymentErrors: ai.Tool<{
388
- deploymentId: string;
389
- }, {
390
- fullErrorText: string | undefined;
391
- errorType: string | undefined;
392
- formattedError: string | undefined;
393
- }>;
394
- };
395
-
396
- /**
397
- * Creates user-related AI SDK tools
398
- */
399
- declare function createUserTools(config?: V0ClientConfig): {
400
- getCurrentUser: ai.Tool<{}, {
401
- userId: string;
402
- name: string | undefined;
403
- email: string;
404
- avatar: string;
405
- }>;
406
- getUserBilling: ai.Tool<{
407
- scope?: string | undefined;
408
- }, {
409
- billingType: "token";
410
- plan: string;
411
- role: string;
412
- billingMode: "test" | undefined;
413
- billingCycle: {
414
- start: number;
415
- end: number;
416
- };
417
- balance: {
418
- remaining: number;
419
- total: number;
420
- };
421
- onDemand: {
422
- balance: number;
423
- blocks: {
424
- expirationDate?: number;
425
- effectiveDate: number;
426
- originalBalance: number;
427
- currentBalance: number;
428
- }[] | undefined;
429
- };
430
- remaining?: undefined;
431
- reset?: undefined;
432
- limit?: undefined;
433
- } | {
434
- billingType: "legacy";
435
- remaining: number | undefined;
436
- reset: number | undefined;
437
- limit: number;
438
- plan?: undefined;
439
- role?: undefined;
440
- billingMode?: undefined;
441
- billingCycle?: undefined;
442
- balance?: undefined;
443
- onDemand?: undefined;
444
- }>;
445
- getUserPlan: ai.Tool<{}, {
446
- plan: string;
447
- billingCycle: {
448
- start: number;
449
- end: number;
450
- };
451
- balance: {
452
- remaining: number;
453
- total: number;
454
- };
455
- }>;
456
- getUserScopes: ai.Tool<{}, {
457
- scopes: {
458
- id: string;
459
- name: string | undefined;
460
- }[];
461
- }>;
462
- getRateLimits: ai.Tool<{
463
- scope?: string | undefined;
464
- }, {
465
- remaining: number | undefined;
466
- reset: number | undefined;
467
- limit: number;
468
- }>;
469
- };
470
-
471
- /**
472
- * Creates webhook-related AI SDK tools
473
- */
474
- declare function createHookTools(config?: V0ClientConfig): {
475
- createHook: ai.Tool<{
476
- url: string;
477
- name: string;
478
- events: ("chat.created" | "chat.updated" | "chat.deleted" | "message.created" | "message.updated" | "message.deleted")[];
479
- chatId?: string | undefined;
480
- }, {
481
- hookId: string;
482
- name: string;
483
- url: string;
484
- events: ("chat.created" | "chat.updated" | "chat.deleted" | "message.created" | "message.updated" | "message.deleted" | "message.finished")[];
485
- chatId: string | undefined;
486
- }>;
487
- getHook: ai.Tool<{
488
- hookId: string;
489
- }, {
490
- hookId: string;
491
- name: string;
492
- url: string;
493
- events: ("chat.created" | "chat.updated" | "chat.deleted" | "message.created" | "message.updated" | "message.deleted" | "message.finished")[];
494
- chatId: string | undefined;
495
- }>;
496
- updateHook: ai.Tool<{
497
- hookId: string;
498
- url?: string | undefined;
499
- name?: string | undefined;
500
- events?: ("chat.created" | "chat.updated" | "chat.deleted" | "message.created" | "message.updated" | "message.deleted")[] | undefined;
501
- }, {
502
- hookId: string;
503
- name: string;
504
- url: string;
505
- events: ("chat.created" | "chat.updated" | "chat.deleted" | "message.created" | "message.updated" | "message.deleted" | "message.finished")[];
506
- chatId: string | undefined;
507
- }>;
508
- deleteHook: ai.Tool<{
509
- hookId: string;
510
- }, {
511
- hookId: string;
512
- deleted: true;
513
- }>;
514
- listHooks: ai.Tool<{}, {
515
- hooks: {
516
- hookId: string;
517
- name: string;
518
- }[];
519
- }>;
520
- };
521
-
522
- /**
523
- * Creates all v0 AI SDK tools as a flat object.
524
- *
525
- * ⚠️ Note: This includes ALL available tools (~20+ tools) which adds significant context.
526
- * Consider using v0ToolsByCategory() to select only the tools you need.
527
- *
528
- * @param config Configuration for v0 client
529
- * @returns Flat object with all v0 tools ready to use with AI SDK
530
- *
531
- * @example
532
- * ```typescript
533
- * import { generateText } from 'ai'
534
- * import { v0Tools } from '@v0-sdk/ai-tools'
535
- *
536
- * const result = await generateText({
537
- * model: 'openai/gpt-4',
538
- * prompt: 'Create a new React component',
539
- * tools: v0Tools({
540
- * apiKey: process.env.V0_API_KEY
541
- * })
542
- * })
543
- * ```
544
- */
545
- declare function v0Tools(config?: V0ToolsConfig): {
546
- createHook: ai.Tool<{
547
- url: string;
548
- name: string;
549
- events: ("chat.created" | "chat.updated" | "chat.deleted" | "message.created" | "message.updated" | "message.deleted")[];
550
- chatId?: string | undefined;
551
- }, {
552
- hookId: string;
553
- name: string;
554
- url: string;
555
- events: ("chat.created" | "chat.updated" | "chat.deleted" | "message.created" | "message.updated" | "message.deleted" | "message.finished")[];
556
- chatId: string | undefined;
557
- }>;
558
- getHook: ai.Tool<{
559
- hookId: string;
560
- }, {
561
- hookId: string;
562
- name: string;
563
- url: string;
564
- events: ("chat.created" | "chat.updated" | "chat.deleted" | "message.created" | "message.updated" | "message.deleted" | "message.finished")[];
565
- chatId: string | undefined;
566
- }>;
567
- updateHook: ai.Tool<{
568
- hookId: string;
569
- url?: string | undefined;
570
- name?: string | undefined;
571
- events?: ("chat.created" | "chat.updated" | "chat.deleted" | "message.created" | "message.updated" | "message.deleted")[] | undefined;
572
- }, {
573
- hookId: string;
574
- name: string;
575
- url: string;
576
- events: ("chat.created" | "chat.updated" | "chat.deleted" | "message.created" | "message.updated" | "message.deleted" | "message.finished")[];
577
- chatId: string | undefined;
578
- }>;
579
- deleteHook: ai.Tool<{
580
- hookId: string;
581
- }, {
582
- hookId: string;
583
- deleted: true;
584
- }>;
585
- listHooks: ai.Tool<{}, {
586
- hooks: {
587
- hookId: string;
588
- name: string;
589
- }[];
590
- }>;
591
- getCurrentUser: ai.Tool<{}, {
592
- userId: string;
593
- name: string | undefined;
594
- email: string;
595
- avatar: string;
596
- }>;
597
- getUserBilling: ai.Tool<{
598
- scope?: string | undefined;
599
- }, {
600
- billingType: "token";
601
- plan: string;
602
- role: string;
603
- billingMode: "test" | undefined;
604
- billingCycle: {
605
- start: number;
606
- end: number;
607
- };
608
- balance: {
609
- remaining: number;
610
- total: number;
611
- };
612
- onDemand: {
613
- balance: number;
614
- blocks: {
615
- expirationDate?: number;
616
- effectiveDate: number;
617
- originalBalance: number;
618
- currentBalance: number;
619
- }[] | undefined;
620
- };
621
- remaining?: undefined;
622
- reset?: undefined;
623
- limit?: undefined;
624
- } | {
625
- billingType: "legacy";
626
- remaining: number | undefined;
627
- reset: number | undefined;
628
- limit: number;
629
- plan?: undefined;
630
- role?: undefined;
631
- billingMode?: undefined;
632
- billingCycle?: undefined;
633
- balance?: undefined;
634
- onDemand?: undefined;
635
- }>;
636
- getUserPlan: ai.Tool<{}, {
637
- plan: string;
638
- billingCycle: {
639
- start: number;
640
- end: number;
641
- };
642
- balance: {
643
- remaining: number;
644
- total: number;
645
- };
646
- }>;
647
- getUserScopes: ai.Tool<{}, {
648
- scopes: {
649
- id: string;
650
- name: string | undefined;
651
- }[];
652
- }>;
653
- getRateLimits: ai.Tool<{
654
- scope?: string | undefined;
655
- }, {
656
- remaining: number | undefined;
657
- reset: number | undefined;
658
- limit: number;
659
- }>;
660
- createDeployment: ai.Tool<{
661
- projectId: string;
662
- chatId: string;
663
- versionId: string;
664
- }, {
665
- deploymentId: string;
666
- projectId: string;
667
- chatId: string;
668
- versionId: string;
669
- inspectorUrl: string;
670
- webUrl: string;
671
- apiUrl: string;
672
- }>;
673
- getDeployment: ai.Tool<{
674
- deploymentId: string;
675
- }, {
676
- deploymentId: string;
677
- projectId: string;
678
- chatId: string;
679
- versionId: string;
680
- inspectorUrl: string;
681
- webUrl: string;
682
- apiUrl: string;
683
- }>;
684
- deleteDeployment: ai.Tool<{
685
- deploymentId: string;
686
- }, {
687
- deploymentId: string;
688
- deleted: true;
689
- }>;
690
- listDeployments: ai.Tool<{
691
- projectId: string;
692
- chatId: string;
693
- versionId: string;
694
- }, {
695
- deployments: {
696
- deploymentId: string;
697
- projectId: string;
698
- chatId: string;
699
- versionId: string;
700
- inspectorUrl: string;
701
- webUrl: string;
702
- apiUrl: string;
703
- }[];
704
- }>;
705
- getDeploymentLogs: ai.Tool<{
706
- deploymentId: string;
707
- since?: number | undefined;
708
- }, {
709
- logs: {
710
- createdAt: string;
711
- deploymentId: string;
712
- id: string;
713
- text: string;
714
- type: "stdout" | "stderr";
715
- level?: "error" | "warning" | "info";
716
- object: "deployment_log";
717
- }[];
718
- nextSince: number | undefined;
719
- }>;
720
- getDeploymentErrors: ai.Tool<{
721
- deploymentId: string;
722
- }, {
723
- fullErrorText: string | undefined;
724
- errorType: string | undefined;
725
- formattedError: string | undefined;
726
- }>;
727
- createProject: ai.Tool<{
728
- name: string;
729
- description?: string | undefined;
730
- privacy?: "private" | "team" | undefined;
731
- icon?: string | undefined;
732
- environmentVariables?: {
733
- value: string;
734
- key: string;
735
- }[] | undefined;
736
- instructions?: string | undefined;
737
- vercelProjectId?: string | undefined;
738
- }, {
739
- projectId: string;
740
- name: string;
741
- description: string | undefined;
742
- privacy: "private" | "team";
743
- webUrl: string;
744
- apiUrl: string;
745
- createdAt: string;
746
- vercelProjectId: string | undefined;
747
- }>;
748
- getProject: ai.Tool<{
749
- projectId: string;
750
- }, {
751
- projectId: string;
752
- name: string;
753
- description: string | undefined;
754
- instructions: string | undefined;
755
- privacy: "private" | "team";
756
- webUrl: string;
757
- apiUrl: string;
758
- createdAt: string;
759
- updatedAt: string | undefined;
760
- vercelProjectId: string | undefined;
761
- chatsCount: number;
762
- }>;
763
- updateProject: ai.Tool<{
764
- projectId: string;
765
- description?: string | undefined;
766
- name?: string | undefined;
767
- privacy?: "private" | "team" | undefined;
768
- instructions?: string | undefined;
769
- }, {
770
- projectId: string;
771
- name: string;
772
- description: string | undefined;
773
- instructions: string | undefined;
774
- privacy: "private" | "team";
775
- updatedAt: string | undefined;
776
- }>;
777
- listProjects: ai.Tool<{}, {
778
- projects: {
779
- projectId: string;
780
- name: string;
781
- privacy: "private" | "team";
782
- webUrl: string;
783
- createdAt: string;
784
- updatedAt: string | undefined;
785
- vercelProjectId: string | undefined;
786
- }[];
787
- }>;
788
- assignChatToProject: ai.Tool<{
789
- projectId: string;
790
- chatId: string;
791
- }, {
792
- projectId: string;
793
- assigned: true;
794
- }>;
795
- getProjectByChat: ai.Tool<{
796
- chatId: string;
797
- }, {
798
- projectId: string;
799
- name: string;
800
- description: string | undefined;
801
- privacy: "private" | "team";
802
- webUrl: string;
803
- createdAt: string;
804
- chatsCount: number;
805
- }>;
806
- createEnvironmentVariables: ai.Tool<{
807
- projectId: string;
808
- environmentVariables: {
809
- value: string;
810
- key: string;
811
- }[];
812
- upsert?: boolean | undefined;
813
- decrypted?: boolean | undefined;
814
- }, {
815
- environmentVariables: {
816
- id: string;
817
- key: string;
818
- value: string;
819
- decrypted: boolean;
820
- createdAt: number;
821
- }[];
822
- }>;
823
- listEnvironmentVariables: ai.Tool<{
824
- projectId: string;
825
- decrypted?: boolean | undefined;
826
- }, {
827
- environmentVariables: {
828
- id: string;
829
- key: string;
830
- value: string;
831
- decrypted: boolean;
832
- createdAt: number;
833
- updatedAt: number | undefined;
834
- }[];
835
- }>;
836
- updateEnvironmentVariables: ai.Tool<{
837
- projectId: string;
838
- environmentVariables: {
839
- value: string;
840
- id: string;
841
- }[];
842
- decrypted?: boolean | undefined;
843
- }, {
844
- environmentVariables: {
845
- id: string;
846
- key: string;
847
- value: string;
848
- decrypted: boolean;
849
- updatedAt: number | undefined;
850
- }[];
851
- }>;
852
- deleteEnvironmentVariables: ai.Tool<{
853
- projectId: string;
854
- environmentVariableIds: string[];
855
- }, {
856
- deletedVariables: {
857
- id: string;
858
- deleted: true;
859
- }[];
860
- }>;
861
- createChat: ai.Tool<{
862
- message: string;
863
- system?: string | undefined;
864
- attachments?: {
865
- url: string;
866
- }[] | undefined;
867
- chatPrivacy?: "public" | "private" | "team-edit" | "team" | "unlisted" | undefined;
868
- projectId?: string | undefined;
869
- modelConfiguration?: {
870
- modelId: "v0-mini" | "v0-pro" | "v0-max" | "v0-max-fast";
871
- imageGenerations?: boolean | undefined;
872
- thinking?: boolean | undefined;
873
- } | undefined;
874
- responseMode?: "sync" | "async" | undefined;
875
- }, {
876
- chatId: string;
877
- webUrl: string;
878
- apiUrl: string;
879
- privacy: string;
880
- name: string;
881
- favorite: boolean;
882
- latestVersion: string;
883
- createdAt: string;
884
- } | {
885
- chatId: string;
886
- webUrl: string;
887
- apiUrl: string;
888
- privacy: "public" | "private" | "team-edit" | "team" | "unlisted";
889
- name: string | undefined;
890
- favorite: boolean;
891
- latestVersion: {
892
- id: string;
893
- object: "version";
894
- status: "pending" | "completed" | "failed";
895
- demoUrl?: string;
896
- screenshotUrl?: string;
897
- createdAt: string;
898
- updatedAt?: string;
899
- files: {
900
- object: "file";
901
- name: string;
902
- content: string;
903
- locked: boolean;
904
- }[];
905
- } | undefined;
906
- createdAt: string;
907
- }>;
908
- sendMessage: ai.Tool<{
909
- message: string;
910
- chatId: string;
911
- attachments?: {
912
- url: string;
913
- }[] | undefined;
914
- modelConfiguration?: {
915
- modelId: "v0-mini" | "v0-pro" | "v0-max" | "v0-max-fast";
916
- imageGenerations?: boolean | undefined;
917
- thinking?: boolean | undefined;
918
- } | undefined;
919
- responseMode?: "sync" | "async" | undefined;
920
- }, {
921
- chatId: string;
922
- webUrl: string;
923
- latestVersion: string;
924
- updatedAt: string;
925
- } | {
926
- chatId: string;
927
- webUrl: string;
928
- latestVersion: {
929
- id: string;
930
- object: "version";
931
- status: "pending" | "completed" | "failed";
932
- demoUrl?: string;
933
- screenshotUrl?: string;
934
- createdAt: string;
935
- updatedAt?: string;
936
- files: {
937
- object: "file";
938
- name: string;
939
- content: string;
940
- locked: boolean;
941
- }[];
942
- } | undefined;
943
- updatedAt: string | undefined;
944
- }>;
945
- getChat: ai.Tool<{
946
- chatId: string;
947
- }, {
948
- chatId: string;
949
- name: string | undefined;
950
- privacy: "public" | "private" | "team-edit" | "team" | "unlisted";
951
- webUrl: string;
952
- favorite: boolean;
953
- createdAt: string;
954
- updatedAt: string | undefined;
955
- latestVersion: {
956
- id: string;
957
- object: "version";
958
- status: "pending" | "completed" | "failed";
959
- demoUrl?: string;
960
- screenshotUrl?: string;
961
- createdAt: string;
962
- updatedAt?: string;
963
- files: {
964
- object: "file";
965
- name: string;
966
- content: string;
967
- locked: boolean;
968
- }[];
969
- } | undefined;
970
- messagesCount: number;
971
- }>;
972
- updateChat: ai.Tool<{
973
- chatId: string;
974
- name?: string | undefined;
975
- privacy?: "public" | "private" | "team-edit" | "team" | "unlisted" | undefined;
976
- }, {
977
- chatId: string;
978
- name: string | undefined;
979
- privacy: "public" | "private" | "team-edit" | "team" | "unlisted";
980
- updatedAt: string | undefined;
981
- }>;
982
- deleteChat: ai.Tool<{
983
- chatId: string;
984
- }, {
985
- chatId: string;
986
- deleted: true;
987
- }>;
988
- favoriteChat: ai.Tool<{
989
- chatId: string;
990
- isFavorite: boolean;
991
- }, {
992
- chatId: string;
993
- favorited: boolean;
994
- }>;
995
- forkChat: ai.Tool<{
996
- chatId: string;
997
- privacy?: "public" | "private" | "team-edit" | "team" | "unlisted" | undefined;
998
- versionId?: string | undefined;
999
- }, {
1000
- originalChatId: string;
1001
- newChatId: string;
1002
- webUrl: string;
1003
- privacy: "public" | "private" | "team-edit" | "team" | "unlisted";
1004
- createdAt: string;
1005
- }>;
1006
- listChats: ai.Tool<{
1007
- isFavorite?: boolean | undefined;
1008
- limit?: number | undefined;
1009
- offset?: number | undefined;
1010
- }, {
1011
- chats: {
1012
- chatId: string;
1013
- name: string | undefined;
1014
- privacy: "public" | "private" | "team-edit" | "team" | "unlisted";
1015
- webUrl: string;
1016
- favorite: boolean;
1017
- createdAt: string;
1018
- updatedAt: string | undefined;
1019
- }[];
1020
- }>;
1021
- };
1022
- /**
1023
- * Creates v0 tools organized by category for selective usage (recommended).
1024
- * This allows you to include only the tools you need, reducing context size.
1025
- *
1026
- * @param config Configuration for v0 client
1027
- * @returns Object containing all v0 tools organized by category
1028
- *
1029
- * @example
1030
- * ```typescript
1031
- * import { generateText } from 'ai'
1032
- * import { v0ToolsByCategory } from '@v0-sdk/ai-tools'
1033
- *
1034
- * const tools = v0ToolsByCategory({
1035
- * apiKey: process.env.V0_API_KEY
1036
- * })
1037
- *
1038
- * // Only include chat and project tools
1039
- * const result = await generateText({
1040
- * model: 'openai/gpt-4',
1041
- * prompt: 'Create a new React component',
1042
- * tools: {
1043
- * ...tools.chat,
1044
- * ...tools.project
1045
- * }
1046
- * })
1047
- * ```
1048
- */
1049
- declare function v0ToolsByCategory(config?: V0ToolsConfig): {
1050
- /**
1051
- * Chat-related tools for creating, managing, and interacting with v0 chats
1052
- */
1053
- chat: {
1054
- createChat: ai.Tool<{
1055
- message: string;
1056
- system?: string | undefined;
1057
- attachments?: {
1058
- url: string;
1059
- }[] | undefined;
1060
- chatPrivacy?: "public" | "private" | "team-edit" | "team" | "unlisted" | undefined;
1061
- projectId?: string | undefined;
1062
- modelConfiguration?: {
1063
- modelId: "v0-mini" | "v0-pro" | "v0-max" | "v0-max-fast";
1064
- imageGenerations?: boolean | undefined;
1065
- thinking?: boolean | undefined;
1066
- } | undefined;
1067
- responseMode?: "sync" | "async" | undefined;
1068
- }, {
1069
- chatId: string;
1070
- webUrl: string;
1071
- apiUrl: string;
1072
- privacy: string;
1073
- name: string;
1074
- favorite: boolean;
1075
- latestVersion: string;
1076
- createdAt: string;
1077
- } | {
1078
- chatId: string;
1079
- webUrl: string;
1080
- apiUrl: string;
1081
- privacy: "public" | "private" | "team-edit" | "team" | "unlisted";
1082
- name: string | undefined;
1083
- favorite: boolean;
1084
- latestVersion: {
1085
- id: string;
1086
- object: "version";
1087
- status: "pending" | "completed" | "failed";
1088
- demoUrl?: string;
1089
- screenshotUrl?: string;
1090
- createdAt: string;
1091
- updatedAt?: string;
1092
- files: {
1093
- object: "file";
1094
- name: string;
1095
- content: string;
1096
- locked: boolean;
1097
- }[];
1098
- } | undefined;
1099
- createdAt: string;
1100
- }>;
1101
- sendMessage: ai.Tool<{
1102
- message: string;
1103
- chatId: string;
1104
- attachments?: {
1105
- url: string;
1106
- }[] | undefined;
1107
- modelConfiguration?: {
1108
- modelId: "v0-mini" | "v0-pro" | "v0-max" | "v0-max-fast";
1109
- imageGenerations?: boolean | undefined;
1110
- thinking?: boolean | undefined;
1111
- } | undefined;
1112
- responseMode?: "sync" | "async" | undefined;
1113
- }, {
1114
- chatId: string;
1115
- webUrl: string;
1116
- latestVersion: string;
1117
- updatedAt: string;
1118
- } | {
1119
- chatId: string;
1120
- webUrl: string;
1121
- latestVersion: {
1122
- id: string;
1123
- object: "version";
1124
- status: "pending" | "completed" | "failed";
1125
- demoUrl?: string;
1126
- screenshotUrl?: string;
1127
- createdAt: string;
1128
- updatedAt?: string;
1129
- files: {
1130
- object: "file";
1131
- name: string;
1132
- content: string;
1133
- locked: boolean;
1134
- }[];
1135
- } | undefined;
1136
- updatedAt: string | undefined;
1137
- }>;
1138
- getChat: ai.Tool<{
1139
- chatId: string;
1140
- }, {
1141
- chatId: string;
1142
- name: string | undefined;
1143
- privacy: "public" | "private" | "team-edit" | "team" | "unlisted";
1144
- webUrl: string;
1145
- favorite: boolean;
1146
- createdAt: string;
1147
- updatedAt: string | undefined;
1148
- latestVersion: {
1149
- id: string;
1150
- object: "version";
1151
- status: "pending" | "completed" | "failed";
1152
- demoUrl?: string;
1153
- screenshotUrl?: string;
1154
- createdAt: string;
1155
- updatedAt?: string;
1156
- files: {
1157
- object: "file";
1158
- name: string;
1159
- content: string;
1160
- locked: boolean;
1161
- }[];
1162
- } | undefined;
1163
- messagesCount: number;
1164
- }>;
1165
- updateChat: ai.Tool<{
1166
- chatId: string;
1167
- name?: string | undefined;
1168
- privacy?: "public" | "private" | "team-edit" | "team" | "unlisted" | undefined;
1169
- }, {
1170
- chatId: string;
1171
- name: string | undefined;
1172
- privacy: "public" | "private" | "team-edit" | "team" | "unlisted";
1173
- updatedAt: string | undefined;
1174
- }>;
1175
- deleteChat: ai.Tool<{
1176
- chatId: string;
1177
- }, {
1178
- chatId: string;
1179
- deleted: true;
1180
- }>;
1181
- favoriteChat: ai.Tool<{
1182
- chatId: string;
1183
- isFavorite: boolean;
1184
- }, {
1185
- chatId: string;
1186
- favorited: boolean;
1187
- }>;
1188
- forkChat: ai.Tool<{
1189
- chatId: string;
1190
- privacy?: "public" | "private" | "team-edit" | "team" | "unlisted" | undefined;
1191
- versionId?: string | undefined;
1192
- }, {
1193
- originalChatId: string;
1194
- newChatId: string;
1195
- webUrl: string;
1196
- privacy: "public" | "private" | "team-edit" | "team" | "unlisted";
1197
- createdAt: string;
1198
- }>;
1199
- listChats: ai.Tool<{
1200
- isFavorite?: boolean | undefined;
1201
- limit?: number | undefined;
1202
- offset?: number | undefined;
1203
- }, {
1204
- chats: {
1205
- chatId: string;
1206
- name: string | undefined;
1207
- privacy: "public" | "private" | "team-edit" | "team" | "unlisted";
1208
- webUrl: string;
1209
- favorite: boolean;
1210
- createdAt: string;
1211
- updatedAt: string | undefined;
1212
- }[];
1213
- }>;
1214
- };
1215
- /**
1216
- * Project-related tools for creating and managing v0 projects
1217
- */
1218
- project: {
1219
- createProject: ai.Tool<{
1220
- name: string;
1221
- description?: string | undefined;
1222
- privacy?: "private" | "team" | undefined;
1223
- icon?: string | undefined;
1224
- environmentVariables?: {
1225
- value: string;
1226
- key: string;
1227
- }[] | undefined;
1228
- instructions?: string | undefined;
1229
- vercelProjectId?: string | undefined;
1230
- }, {
1231
- projectId: string;
1232
- name: string;
1233
- description: string | undefined;
1234
- privacy: "private" | "team";
1235
- webUrl: string;
1236
- apiUrl: string;
1237
- createdAt: string;
1238
- vercelProjectId: string | undefined;
1239
- }>;
1240
- getProject: ai.Tool<{
1241
- projectId: string;
1242
- }, {
1243
- projectId: string;
1244
- name: string;
1245
- description: string | undefined;
1246
- instructions: string | undefined;
1247
- privacy: "private" | "team";
1248
- webUrl: string;
1249
- apiUrl: string;
1250
- createdAt: string;
1251
- updatedAt: string | undefined;
1252
- vercelProjectId: string | undefined;
1253
- chatsCount: number;
1254
- }>;
1255
- updateProject: ai.Tool<{
1256
- projectId: string;
1257
- description?: string | undefined;
1258
- name?: string | undefined;
1259
- privacy?: "private" | "team" | undefined;
1260
- instructions?: string | undefined;
1261
- }, {
1262
- projectId: string;
1263
- name: string;
1264
- description: string | undefined;
1265
- instructions: string | undefined;
1266
- privacy: "private" | "team";
1267
- updatedAt: string | undefined;
1268
- }>;
1269
- listProjects: ai.Tool<{}, {
1270
- projects: {
1271
- projectId: string;
1272
- name: string;
1273
- privacy: "private" | "team";
1274
- webUrl: string;
1275
- createdAt: string;
1276
- updatedAt: string | undefined;
1277
- vercelProjectId: string | undefined;
1278
- }[];
1279
- }>;
1280
- assignChatToProject: ai.Tool<{
1281
- projectId: string;
1282
- chatId: string;
1283
- }, {
1284
- projectId: string;
1285
- assigned: true;
1286
- }>;
1287
- getProjectByChat: ai.Tool<{
1288
- chatId: string;
1289
- }, {
1290
- projectId: string;
1291
- name: string;
1292
- description: string | undefined;
1293
- privacy: "private" | "team";
1294
- webUrl: string;
1295
- createdAt: string;
1296
- chatsCount: number;
1297
- }>;
1298
- createEnvironmentVariables: ai.Tool<{
1299
- projectId: string;
1300
- environmentVariables: {
1301
- value: string;
1302
- key: string;
1303
- }[];
1304
- upsert?: boolean | undefined;
1305
- decrypted?: boolean | undefined;
1306
- }, {
1307
- environmentVariables: {
1308
- id: string;
1309
- key: string;
1310
- value: string;
1311
- decrypted: boolean;
1312
- createdAt: number;
1313
- }[];
1314
- }>;
1315
- listEnvironmentVariables: ai.Tool<{
1316
- projectId: string;
1317
- decrypted?: boolean | undefined;
1318
- }, {
1319
- environmentVariables: {
1320
- id: string;
1321
- key: string;
1322
- value: string;
1323
- decrypted: boolean;
1324
- createdAt: number;
1325
- updatedAt: number | undefined;
1326
- }[];
1327
- }>;
1328
- updateEnvironmentVariables: ai.Tool<{
1329
- projectId: string;
1330
- environmentVariables: {
1331
- value: string;
1332
- id: string;
1333
- }[];
1334
- decrypted?: boolean | undefined;
1335
- }, {
1336
- environmentVariables: {
1337
- id: string;
1338
- key: string;
1339
- value: string;
1340
- decrypted: boolean;
1341
- updatedAt: number | undefined;
1342
- }[];
1343
- }>;
1344
- deleteEnvironmentVariables: ai.Tool<{
1345
- projectId: string;
1346
- environmentVariableIds: string[];
1347
- }, {
1348
- deletedVariables: {
1349
- id: string;
1350
- deleted: true;
1351
- }[];
1352
- }>;
1353
- };
1354
- /**
1355
- * Deployment-related tools for creating and managing deployments
1356
- */
1357
- deployment: {
1358
- createDeployment: ai.Tool<{
1359
- projectId: string;
1360
- chatId: string;
1361
- versionId: string;
1362
- }, {
1363
- deploymentId: string;
1364
- projectId: string;
1365
- chatId: string;
1366
- versionId: string;
1367
- inspectorUrl: string;
1368
- webUrl: string;
1369
- apiUrl: string;
1370
- }>;
1371
- getDeployment: ai.Tool<{
1372
- deploymentId: string;
1373
- }, {
1374
- deploymentId: string;
1375
- projectId: string;
1376
- chatId: string;
1377
- versionId: string;
1378
- inspectorUrl: string;
1379
- webUrl: string;
1380
- apiUrl: string;
1381
- }>;
1382
- deleteDeployment: ai.Tool<{
1383
- deploymentId: string;
1384
- }, {
1385
- deploymentId: string;
1386
- deleted: true;
1387
- }>;
1388
- listDeployments: ai.Tool<{
1389
- projectId: string;
1390
- chatId: string;
1391
- versionId: string;
1392
- }, {
1393
- deployments: {
1394
- deploymentId: string;
1395
- projectId: string;
1396
- chatId: string;
1397
- versionId: string;
1398
- inspectorUrl: string;
1399
- webUrl: string;
1400
- apiUrl: string;
1401
- }[];
1402
- }>;
1403
- getDeploymentLogs: ai.Tool<{
1404
- deploymentId: string;
1405
- since?: number | undefined;
1406
- }, {
1407
- logs: {
1408
- createdAt: string;
1409
- deploymentId: string;
1410
- id: string;
1411
- text: string;
1412
- type: "stdout" | "stderr";
1413
- level?: "error" | "warning" | "info";
1414
- object: "deployment_log";
1415
- }[];
1416
- nextSince: number | undefined;
1417
- }>;
1418
- getDeploymentErrors: ai.Tool<{
1419
- deploymentId: string;
1420
- }, {
1421
- fullErrorText: string | undefined;
1422
- errorType: string | undefined;
1423
- formattedError: string | undefined;
1424
- }>;
1425
- };
1426
- /**
1427
- * User-related tools for getting user information, billing, and rate limits
1428
- */
1429
- user: {
1430
- getCurrentUser: ai.Tool<{}, {
1431
- userId: string;
1432
- name: string | undefined;
1433
- email: string;
1434
- avatar: string;
1435
- }>;
1436
- getUserBilling: ai.Tool<{
1437
- scope?: string | undefined;
1438
- }, {
1439
- billingType: "token";
1440
- plan: string;
1441
- role: string;
1442
- billingMode: "test" | undefined;
1443
- billingCycle: {
1444
- start: number;
1445
- end: number;
1446
- };
1447
- balance: {
1448
- remaining: number;
1449
- total: number;
1450
- };
1451
- onDemand: {
1452
- balance: number;
1453
- blocks: {
1454
- expirationDate?: number;
1455
- effectiveDate: number;
1456
- originalBalance: number;
1457
- currentBalance: number;
1458
- }[] | undefined;
1459
- };
1460
- remaining?: undefined;
1461
- reset?: undefined;
1462
- limit?: undefined;
1463
- } | {
1464
- billingType: "legacy";
1465
- remaining: number | undefined;
1466
- reset: number | undefined;
1467
- limit: number;
1468
- plan?: undefined;
1469
- role?: undefined;
1470
- billingMode?: undefined;
1471
- billingCycle?: undefined;
1472
- balance?: undefined;
1473
- onDemand?: undefined;
1474
- }>;
1475
- getUserPlan: ai.Tool<{}, {
1476
- plan: string;
1477
- billingCycle: {
1478
- start: number;
1479
- end: number;
1480
- };
1481
- balance: {
1482
- remaining: number;
1483
- total: number;
1484
- };
1485
- }>;
1486
- getUserScopes: ai.Tool<{}, {
1487
- scopes: {
1488
- id: string;
1489
- name: string | undefined;
1490
- }[];
1491
- }>;
1492
- getRateLimits: ai.Tool<{
1493
- scope?: string | undefined;
1494
- }, {
1495
- remaining: number | undefined;
1496
- reset: number | undefined;
1497
- limit: number;
1498
- }>;
1499
- };
1500
- /**
1501
- * Webhook tools for creating and managing event hooks
1502
- */
1503
- hook: {
1504
- createHook: ai.Tool<{
1505
- url: string;
1506
- name: string;
1507
- events: ("chat.created" | "chat.updated" | "chat.deleted" | "message.created" | "message.updated" | "message.deleted")[];
1508
- chatId?: string | undefined;
1509
- }, {
1510
- hookId: string;
1511
- name: string;
1512
- url: string;
1513
- events: ("chat.created" | "chat.updated" | "chat.deleted" | "message.created" | "message.updated" | "message.deleted" | "message.finished")[];
1514
- chatId: string | undefined;
1515
- }>;
1516
- getHook: ai.Tool<{
1517
- hookId: string;
1518
- }, {
1519
- hookId: string;
1520
- name: string;
1521
- url: string;
1522
- events: ("chat.created" | "chat.updated" | "chat.deleted" | "message.created" | "message.updated" | "message.deleted" | "message.finished")[];
1523
- chatId: string | undefined;
1524
- }>;
1525
- updateHook: ai.Tool<{
1526
- hookId: string;
1527
- url?: string | undefined;
1528
- name?: string | undefined;
1529
- events?: ("chat.created" | "chat.updated" | "chat.deleted" | "message.created" | "message.updated" | "message.deleted")[] | undefined;
1530
- }, {
1531
- hookId: string;
1532
- name: string;
1533
- url: string;
1534
- events: ("chat.created" | "chat.updated" | "chat.deleted" | "message.created" | "message.updated" | "message.deleted" | "message.finished")[];
1535
- chatId: string | undefined;
1536
- }>;
1537
- deleteHook: ai.Tool<{
1538
- hookId: string;
1539
- }, {
1540
- hookId: string;
1541
- deleted: true;
1542
- }>;
1543
- listHooks: ai.Tool<{}, {
1544
- hooks: {
1545
- hookId: string;
1546
- name: string;
1547
- }[];
1548
- }>;
1549
- };
1550
- };
1551
- /**
1552
- * @deprecated Use v0Tools instead (now returns flat structure by default)
1553
- */
1554
- declare function v0ToolsFlat(config?: V0ToolsConfig): {
1555
- createHook: ai.Tool<{
1556
- url: string;
1557
- name: string;
1558
- events: ("chat.created" | "chat.updated" | "chat.deleted" | "message.created" | "message.updated" | "message.deleted")[];
1559
- chatId?: string | undefined;
1560
- }, {
1561
- hookId: string;
1562
- name: string;
1563
- url: string;
1564
- events: ("chat.created" | "chat.updated" | "chat.deleted" | "message.created" | "message.updated" | "message.deleted" | "message.finished")[];
1565
- chatId: string | undefined;
1566
- }>;
1567
- getHook: ai.Tool<{
1568
- hookId: string;
1569
- }, {
1570
- hookId: string;
1571
- name: string;
1572
- url: string;
1573
- events: ("chat.created" | "chat.updated" | "chat.deleted" | "message.created" | "message.updated" | "message.deleted" | "message.finished")[];
1574
- chatId: string | undefined;
1575
- }>;
1576
- updateHook: ai.Tool<{
1577
- hookId: string;
1578
- url?: string | undefined;
1579
- name?: string | undefined;
1580
- events?: ("chat.created" | "chat.updated" | "chat.deleted" | "message.created" | "message.updated" | "message.deleted")[] | undefined;
1581
- }, {
1582
- hookId: string;
1583
- name: string;
1584
- url: string;
1585
- events: ("chat.created" | "chat.updated" | "chat.deleted" | "message.created" | "message.updated" | "message.deleted" | "message.finished")[];
1586
- chatId: string | undefined;
1587
- }>;
1588
- deleteHook: ai.Tool<{
1589
- hookId: string;
1590
- }, {
1591
- hookId: string;
1592
- deleted: true;
1593
- }>;
1594
- listHooks: ai.Tool<{}, {
1595
- hooks: {
1596
- hookId: string;
1597
- name: string;
1598
- }[];
1599
- }>;
1600
- getCurrentUser: ai.Tool<{}, {
1601
- userId: string;
1602
- name: string | undefined;
1603
- email: string;
1604
- avatar: string;
1605
- }>;
1606
- getUserBilling: ai.Tool<{
1607
- scope?: string | undefined;
1608
- }, {
1609
- billingType: "token";
1610
- plan: string;
1611
- role: string;
1612
- billingMode: "test" | undefined;
1613
- billingCycle: {
1614
- start: number;
1615
- end: number;
1616
- };
1617
- balance: {
1618
- remaining: number;
1619
- total: number;
1620
- };
1621
- onDemand: {
1622
- balance: number;
1623
- blocks: {
1624
- expirationDate?: number;
1625
- effectiveDate: number;
1626
- originalBalance: number;
1627
- currentBalance: number;
1628
- }[] | undefined;
1629
- };
1630
- remaining?: undefined;
1631
- reset?: undefined;
1632
- limit?: undefined;
1633
- } | {
1634
- billingType: "legacy";
1635
- remaining: number | undefined;
1636
- reset: number | undefined;
1637
- limit: number;
1638
- plan?: undefined;
1639
- role?: undefined;
1640
- billingMode?: undefined;
1641
- billingCycle?: undefined;
1642
- balance?: undefined;
1643
- onDemand?: undefined;
1644
- }>;
1645
- getUserPlan: ai.Tool<{}, {
1646
- plan: string;
1647
- billingCycle: {
1648
- start: number;
1649
- end: number;
1650
- };
1651
- balance: {
1652
- remaining: number;
1653
- total: number;
1654
- };
1655
- }>;
1656
- getUserScopes: ai.Tool<{}, {
1657
- scopes: {
1658
- id: string;
1659
- name: string | undefined;
1660
- }[];
1661
- }>;
1662
- getRateLimits: ai.Tool<{
1663
- scope?: string | undefined;
1664
- }, {
1665
- remaining: number | undefined;
1666
- reset: number | undefined;
1667
- limit: number;
1668
- }>;
1669
- createDeployment: ai.Tool<{
1670
- projectId: string;
1671
- chatId: string;
1672
- versionId: string;
1673
- }, {
1674
- deploymentId: string;
1675
- projectId: string;
1676
- chatId: string;
1677
- versionId: string;
1678
- inspectorUrl: string;
1679
- webUrl: string;
1680
- apiUrl: string;
1681
- }>;
1682
- getDeployment: ai.Tool<{
1683
- deploymentId: string;
1684
- }, {
1685
- deploymentId: string;
1686
- projectId: string;
1687
- chatId: string;
1688
- versionId: string;
1689
- inspectorUrl: string;
1690
- webUrl: string;
1691
- apiUrl: string;
1692
- }>;
1693
- deleteDeployment: ai.Tool<{
1694
- deploymentId: string;
1695
- }, {
1696
- deploymentId: string;
1697
- deleted: true;
1698
- }>;
1699
- listDeployments: ai.Tool<{
1700
- projectId: string;
1701
- chatId: string;
1702
- versionId: string;
1703
- }, {
1704
- deployments: {
1705
- deploymentId: string;
1706
- projectId: string;
1707
- chatId: string;
1708
- versionId: string;
1709
- inspectorUrl: string;
1710
- webUrl: string;
1711
- apiUrl: string;
1712
- }[];
1713
- }>;
1714
- getDeploymentLogs: ai.Tool<{
1715
- deploymentId: string;
1716
- since?: number | undefined;
1717
- }, {
1718
- logs: {
1719
- createdAt: string;
1720
- deploymentId: string;
1721
- id: string;
1722
- text: string;
1723
- type: "stdout" | "stderr";
1724
- level?: "error" | "warning" | "info";
1725
- object: "deployment_log";
1726
- }[];
1727
- nextSince: number | undefined;
1728
- }>;
1729
- getDeploymentErrors: ai.Tool<{
1730
- deploymentId: string;
1731
- }, {
1732
- fullErrorText: string | undefined;
1733
- errorType: string | undefined;
1734
- formattedError: string | undefined;
1735
- }>;
1736
- createProject: ai.Tool<{
1737
- name: string;
1738
- description?: string | undefined;
1739
- privacy?: "private" | "team" | undefined;
1740
- icon?: string | undefined;
1741
- environmentVariables?: {
1742
- value: string;
1743
- key: string;
1744
- }[] | undefined;
1745
- instructions?: string | undefined;
1746
- vercelProjectId?: string | undefined;
1747
- }, {
1748
- projectId: string;
1749
- name: string;
1750
- description: string | undefined;
1751
- privacy: "private" | "team";
1752
- webUrl: string;
1753
- apiUrl: string;
1754
- createdAt: string;
1755
- vercelProjectId: string | undefined;
1756
- }>;
1757
- getProject: ai.Tool<{
1758
- projectId: string;
1759
- }, {
1760
- projectId: string;
1761
- name: string;
1762
- description: string | undefined;
1763
- instructions: string | undefined;
1764
- privacy: "private" | "team";
1765
- webUrl: string;
1766
- apiUrl: string;
1767
- createdAt: string;
1768
- updatedAt: string | undefined;
1769
- vercelProjectId: string | undefined;
1770
- chatsCount: number;
1771
- }>;
1772
- updateProject: ai.Tool<{
1773
- projectId: string;
1774
- description?: string | undefined;
1775
- name?: string | undefined;
1776
- privacy?: "private" | "team" | undefined;
1777
- instructions?: string | undefined;
1778
- }, {
1779
- projectId: string;
1780
- name: string;
1781
- description: string | undefined;
1782
- instructions: string | undefined;
1783
- privacy: "private" | "team";
1784
- updatedAt: string | undefined;
1785
- }>;
1786
- listProjects: ai.Tool<{}, {
1787
- projects: {
1788
- projectId: string;
1789
- name: string;
1790
- privacy: "private" | "team";
1791
- webUrl: string;
1792
- createdAt: string;
1793
- updatedAt: string | undefined;
1794
- vercelProjectId: string | undefined;
1795
- }[];
1796
- }>;
1797
- assignChatToProject: ai.Tool<{
1798
- projectId: string;
1799
- chatId: string;
1800
- }, {
1801
- projectId: string;
1802
- assigned: true;
1803
- }>;
1804
- getProjectByChat: ai.Tool<{
1805
- chatId: string;
1806
- }, {
1807
- projectId: string;
1808
- name: string;
1809
- description: string | undefined;
1810
- privacy: "private" | "team";
1811
- webUrl: string;
1812
- createdAt: string;
1813
- chatsCount: number;
1814
- }>;
1815
- createEnvironmentVariables: ai.Tool<{
1816
- projectId: string;
1817
- environmentVariables: {
1818
- value: string;
1819
- key: string;
1820
- }[];
1821
- upsert?: boolean | undefined;
1822
- decrypted?: boolean | undefined;
1823
- }, {
1824
- environmentVariables: {
1825
- id: string;
1826
- key: string;
1827
- value: string;
1828
- decrypted: boolean;
1829
- createdAt: number;
1830
- }[];
1831
- }>;
1832
- listEnvironmentVariables: ai.Tool<{
1833
- projectId: string;
1834
- decrypted?: boolean | undefined;
1835
- }, {
1836
- environmentVariables: {
1837
- id: string;
1838
- key: string;
1839
- value: string;
1840
- decrypted: boolean;
1841
- createdAt: number;
1842
- updatedAt: number | undefined;
1843
- }[];
1844
- }>;
1845
- updateEnvironmentVariables: ai.Tool<{
1846
- projectId: string;
1847
- environmentVariables: {
1848
- value: string;
1849
- id: string;
1850
- }[];
1851
- decrypted?: boolean | undefined;
1852
- }, {
1853
- environmentVariables: {
1854
- id: string;
1855
- key: string;
1856
- value: string;
1857
- decrypted: boolean;
1858
- updatedAt: number | undefined;
1859
- }[];
1860
- }>;
1861
- deleteEnvironmentVariables: ai.Tool<{
1862
- projectId: string;
1863
- environmentVariableIds: string[];
1864
- }, {
1865
- deletedVariables: {
1866
- id: string;
1867
- deleted: true;
1868
- }[];
1869
- }>;
1870
- createChat: ai.Tool<{
1871
- message: string;
1872
- system?: string | undefined;
1873
- attachments?: {
1874
- url: string;
1875
- }[] | undefined;
1876
- chatPrivacy?: "public" | "private" | "team-edit" | "team" | "unlisted" | undefined;
1877
- projectId?: string | undefined;
1878
- modelConfiguration?: {
1879
- modelId: "v0-mini" | "v0-pro" | "v0-max" | "v0-max-fast";
1880
- imageGenerations?: boolean | undefined;
1881
- thinking?: boolean | undefined;
1882
- } | undefined;
1883
- responseMode?: "sync" | "async" | undefined;
1884
- }, {
1885
- chatId: string;
1886
- webUrl: string;
1887
- apiUrl: string;
1888
- privacy: string;
1889
- name: string;
1890
- favorite: boolean;
1891
- latestVersion: string;
1892
- createdAt: string;
1893
- } | {
1894
- chatId: string;
1895
- webUrl: string;
1896
- apiUrl: string;
1897
- privacy: "public" | "private" | "team-edit" | "team" | "unlisted";
1898
- name: string | undefined;
1899
- favorite: boolean;
1900
- latestVersion: {
1901
- id: string;
1902
- object: "version";
1903
- status: "pending" | "completed" | "failed";
1904
- demoUrl?: string;
1905
- screenshotUrl?: string;
1906
- createdAt: string;
1907
- updatedAt?: string;
1908
- files: {
1909
- object: "file";
1910
- name: string;
1911
- content: string;
1912
- locked: boolean;
1913
- }[];
1914
- } | undefined;
1915
- createdAt: string;
1916
- }>;
1917
- sendMessage: ai.Tool<{
1918
- message: string;
1919
- chatId: string;
1920
- attachments?: {
1921
- url: string;
1922
- }[] | undefined;
1923
- modelConfiguration?: {
1924
- modelId: "v0-mini" | "v0-pro" | "v0-max" | "v0-max-fast";
1925
- imageGenerations?: boolean | undefined;
1926
- thinking?: boolean | undefined;
1927
- } | undefined;
1928
- responseMode?: "sync" | "async" | undefined;
1929
- }, {
1930
- chatId: string;
1931
- webUrl: string;
1932
- latestVersion: string;
1933
- updatedAt: string;
1934
- } | {
1935
- chatId: string;
1936
- webUrl: string;
1937
- latestVersion: {
1938
- id: string;
1939
- object: "version";
1940
- status: "pending" | "completed" | "failed";
1941
- demoUrl?: string;
1942
- screenshotUrl?: string;
1943
- createdAt: string;
1944
- updatedAt?: string;
1945
- files: {
1946
- object: "file";
1947
- name: string;
1948
- content: string;
1949
- locked: boolean;
1950
- }[];
1951
- } | undefined;
1952
- updatedAt: string | undefined;
1953
- }>;
1954
- getChat: ai.Tool<{
1955
- chatId: string;
1956
- }, {
1957
- chatId: string;
1958
- name: string | undefined;
1959
- privacy: "public" | "private" | "team-edit" | "team" | "unlisted";
1960
- webUrl: string;
1961
- favorite: boolean;
1962
- createdAt: string;
1963
- updatedAt: string | undefined;
1964
- latestVersion: {
1965
- id: string;
1966
- object: "version";
1967
- status: "pending" | "completed" | "failed";
1968
- demoUrl?: string;
1969
- screenshotUrl?: string;
1970
- createdAt: string;
1971
- updatedAt?: string;
1972
- files: {
1973
- object: "file";
1974
- name: string;
1975
- content: string;
1976
- locked: boolean;
1977
- }[];
1978
- } | undefined;
1979
- messagesCount: number;
1980
- }>;
1981
- updateChat: ai.Tool<{
1982
- chatId: string;
1983
- name?: string | undefined;
1984
- privacy?: "public" | "private" | "team-edit" | "team" | "unlisted" | undefined;
1985
- }, {
1986
- chatId: string;
1987
- name: string | undefined;
1988
- privacy: "public" | "private" | "team-edit" | "team" | "unlisted";
1989
- updatedAt: string | undefined;
1990
- }>;
1991
- deleteChat: ai.Tool<{
1992
- chatId: string;
1993
- }, {
1994
- chatId: string;
1995
- deleted: true;
1996
- }>;
1997
- favoriteChat: ai.Tool<{
1998
- chatId: string;
1999
- isFavorite: boolean;
2000
- }, {
2001
- chatId: string;
2002
- favorited: boolean;
2003
- }>;
2004
- forkChat: ai.Tool<{
2005
- chatId: string;
2006
- privacy?: "public" | "private" | "team-edit" | "team" | "unlisted" | undefined;
2007
- versionId?: string | undefined;
2008
- }, {
2009
- originalChatId: string;
2010
- newChatId: string;
2011
- webUrl: string;
2012
- privacy: "public" | "private" | "team-edit" | "team" | "unlisted";
2013
- createdAt: string;
2014
- }>;
2015
- listChats: ai.Tool<{
2016
- isFavorite?: boolean | undefined;
2017
- limit?: number | undefined;
2018
- offset?: number | undefined;
2019
- }, {
2020
- chats: {
2021
- chatId: string;
2022
- name: string | undefined;
2023
- privacy: "public" | "private" | "team-edit" | "team" | "unlisted";
2024
- webUrl: string;
2025
- favorite: boolean;
2026
- createdAt: string;
2027
- updatedAt: string | undefined;
2028
- }[];
2029
- }>;
2030
- };
2031
-
2032
- export { createChatTools, createDeploymentTools, createHookTools, createProjectTools, createUserTools, v0Tools as default, v0Tools, v0ToolsByCategory, v0ToolsFlat };
2033
- export type { V0ToolsConfig };
2034
- //# sourceMappingURL=index.d.ts.map