@v0-sdk/ai-tools 0.2.2 → 0.3.0
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.cjs +0 -1
- package/dist/index.d.ts +48 -20
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -53,6 +53,7 @@ declare function createChatTools(config?: V0ClientConfig): {
|
|
|
53
53
|
object: "version";
|
|
54
54
|
status: "pending" | "completed" | "failed";
|
|
55
55
|
demoUrl?: string;
|
|
56
|
+
screenshotUrl?: string;
|
|
56
57
|
createdAt: string;
|
|
57
58
|
updatedAt?: string;
|
|
58
59
|
files: {
|
|
@@ -61,7 +62,6 @@ declare function createChatTools(config?: V0ClientConfig): {
|
|
|
61
62
|
content: string;
|
|
62
63
|
locked: boolean;
|
|
63
64
|
}[];
|
|
64
|
-
screenshotUrl?: string;
|
|
65
65
|
} | undefined;
|
|
66
66
|
createdAt: string;
|
|
67
67
|
}>;
|
|
@@ -90,6 +90,7 @@ declare function createChatTools(config?: V0ClientConfig): {
|
|
|
90
90
|
object: "version";
|
|
91
91
|
status: "pending" | "completed" | "failed";
|
|
92
92
|
demoUrl?: string;
|
|
93
|
+
screenshotUrl?: string;
|
|
93
94
|
createdAt: string;
|
|
94
95
|
updatedAt?: string;
|
|
95
96
|
files: {
|
|
@@ -98,7 +99,6 @@ declare function createChatTools(config?: V0ClientConfig): {
|
|
|
98
99
|
content: string;
|
|
99
100
|
locked: boolean;
|
|
100
101
|
}[];
|
|
101
|
-
screenshotUrl?: string;
|
|
102
102
|
} | undefined;
|
|
103
103
|
updatedAt: string | undefined;
|
|
104
104
|
}>;
|
|
@@ -117,6 +117,7 @@ declare function createChatTools(config?: V0ClientConfig): {
|
|
|
117
117
|
object: "version";
|
|
118
118
|
status: "pending" | "completed" | "failed";
|
|
119
119
|
demoUrl?: string;
|
|
120
|
+
screenshotUrl?: string;
|
|
120
121
|
createdAt: string;
|
|
121
122
|
updatedAt?: string;
|
|
122
123
|
files: {
|
|
@@ -125,7 +126,6 @@ declare function createChatTools(config?: V0ClientConfig): {
|
|
|
125
126
|
content: string;
|
|
126
127
|
locked: boolean;
|
|
127
128
|
}[];
|
|
128
|
-
screenshotUrl?: string;
|
|
129
129
|
} | undefined;
|
|
130
130
|
messagesCount: number;
|
|
131
131
|
}>;
|
|
@@ -373,8 +373,15 @@ declare function createDeploymentTools(config?: V0ClientConfig): {
|
|
|
373
373
|
deploymentId: string;
|
|
374
374
|
since?: number | undefined;
|
|
375
375
|
}, {
|
|
376
|
-
logs:
|
|
377
|
-
|
|
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
|
+
}[];
|
|
378
385
|
nextSince: number | undefined;
|
|
379
386
|
}>;
|
|
380
387
|
getDeploymentErrors: ai.Tool<{
|
|
@@ -700,8 +707,15 @@ declare function v0Tools(config?: V0ToolsConfig): {
|
|
|
700
707
|
deploymentId: string;
|
|
701
708
|
since?: number | undefined;
|
|
702
709
|
}, {
|
|
703
|
-
logs:
|
|
704
|
-
|
|
710
|
+
logs: {
|
|
711
|
+
createdAt: string;
|
|
712
|
+
deploymentId: string;
|
|
713
|
+
id: string;
|
|
714
|
+
text: string;
|
|
715
|
+
type: "stdout" | "stderr";
|
|
716
|
+
level?: "error" | "warning" | "info";
|
|
717
|
+
object: "deployment_log";
|
|
718
|
+
}[];
|
|
705
719
|
nextSince: number | undefined;
|
|
706
720
|
}>;
|
|
707
721
|
getDeploymentErrors: ai.Tool<{
|
|
@@ -881,6 +895,7 @@ declare function v0Tools(config?: V0ToolsConfig): {
|
|
|
881
895
|
object: "version";
|
|
882
896
|
status: "pending" | "completed" | "failed";
|
|
883
897
|
demoUrl?: string;
|
|
898
|
+
screenshotUrl?: string;
|
|
884
899
|
createdAt: string;
|
|
885
900
|
updatedAt?: string;
|
|
886
901
|
files: {
|
|
@@ -889,7 +904,6 @@ declare function v0Tools(config?: V0ToolsConfig): {
|
|
|
889
904
|
content: string;
|
|
890
905
|
locked: boolean;
|
|
891
906
|
}[];
|
|
892
|
-
screenshotUrl?: string;
|
|
893
907
|
} | undefined;
|
|
894
908
|
createdAt: string;
|
|
895
909
|
}>;
|
|
@@ -918,6 +932,7 @@ declare function v0Tools(config?: V0ToolsConfig): {
|
|
|
918
932
|
object: "version";
|
|
919
933
|
status: "pending" | "completed" | "failed";
|
|
920
934
|
demoUrl?: string;
|
|
935
|
+
screenshotUrl?: string;
|
|
921
936
|
createdAt: string;
|
|
922
937
|
updatedAt?: string;
|
|
923
938
|
files: {
|
|
@@ -926,7 +941,6 @@ declare function v0Tools(config?: V0ToolsConfig): {
|
|
|
926
941
|
content: string;
|
|
927
942
|
locked: boolean;
|
|
928
943
|
}[];
|
|
929
|
-
screenshotUrl?: string;
|
|
930
944
|
} | undefined;
|
|
931
945
|
updatedAt: string | undefined;
|
|
932
946
|
}>;
|
|
@@ -945,6 +959,7 @@ declare function v0Tools(config?: V0ToolsConfig): {
|
|
|
945
959
|
object: "version";
|
|
946
960
|
status: "pending" | "completed" | "failed";
|
|
947
961
|
demoUrl?: string;
|
|
962
|
+
screenshotUrl?: string;
|
|
948
963
|
createdAt: string;
|
|
949
964
|
updatedAt?: string;
|
|
950
965
|
files: {
|
|
@@ -953,7 +968,6 @@ declare function v0Tools(config?: V0ToolsConfig): {
|
|
|
953
968
|
content: string;
|
|
954
969
|
locked: boolean;
|
|
955
970
|
}[];
|
|
956
|
-
screenshotUrl?: string;
|
|
957
971
|
} | undefined;
|
|
958
972
|
messagesCount: number;
|
|
959
973
|
}>;
|
|
@@ -1074,6 +1088,7 @@ declare function v0ToolsByCategory(config?: V0ToolsConfig): {
|
|
|
1074
1088
|
object: "version";
|
|
1075
1089
|
status: "pending" | "completed" | "failed";
|
|
1076
1090
|
demoUrl?: string;
|
|
1091
|
+
screenshotUrl?: string;
|
|
1077
1092
|
createdAt: string;
|
|
1078
1093
|
updatedAt?: string;
|
|
1079
1094
|
files: {
|
|
@@ -1082,7 +1097,6 @@ declare function v0ToolsByCategory(config?: V0ToolsConfig): {
|
|
|
1082
1097
|
content: string;
|
|
1083
1098
|
locked: boolean;
|
|
1084
1099
|
}[];
|
|
1085
|
-
screenshotUrl?: string;
|
|
1086
1100
|
} | undefined;
|
|
1087
1101
|
createdAt: string;
|
|
1088
1102
|
}>;
|
|
@@ -1111,6 +1125,7 @@ declare function v0ToolsByCategory(config?: V0ToolsConfig): {
|
|
|
1111
1125
|
object: "version";
|
|
1112
1126
|
status: "pending" | "completed" | "failed";
|
|
1113
1127
|
demoUrl?: string;
|
|
1128
|
+
screenshotUrl?: string;
|
|
1114
1129
|
createdAt: string;
|
|
1115
1130
|
updatedAt?: string;
|
|
1116
1131
|
files: {
|
|
@@ -1119,7 +1134,6 @@ declare function v0ToolsByCategory(config?: V0ToolsConfig): {
|
|
|
1119
1134
|
content: string;
|
|
1120
1135
|
locked: boolean;
|
|
1121
1136
|
}[];
|
|
1122
|
-
screenshotUrl?: string;
|
|
1123
1137
|
} | undefined;
|
|
1124
1138
|
updatedAt: string | undefined;
|
|
1125
1139
|
}>;
|
|
@@ -1138,6 +1152,7 @@ declare function v0ToolsByCategory(config?: V0ToolsConfig): {
|
|
|
1138
1152
|
object: "version";
|
|
1139
1153
|
status: "pending" | "completed" | "failed";
|
|
1140
1154
|
demoUrl?: string;
|
|
1155
|
+
screenshotUrl?: string;
|
|
1141
1156
|
createdAt: string;
|
|
1142
1157
|
updatedAt?: string;
|
|
1143
1158
|
files: {
|
|
@@ -1146,7 +1161,6 @@ declare function v0ToolsByCategory(config?: V0ToolsConfig): {
|
|
|
1146
1161
|
content: string;
|
|
1147
1162
|
locked: boolean;
|
|
1148
1163
|
}[];
|
|
1149
|
-
screenshotUrl?: string;
|
|
1150
1164
|
} | undefined;
|
|
1151
1165
|
messagesCount: number;
|
|
1152
1166
|
}>;
|
|
@@ -1392,8 +1406,15 @@ declare function v0ToolsByCategory(config?: V0ToolsConfig): {
|
|
|
1392
1406
|
deploymentId: string;
|
|
1393
1407
|
since?: number | undefined;
|
|
1394
1408
|
}, {
|
|
1395
|
-
logs:
|
|
1396
|
-
|
|
1409
|
+
logs: {
|
|
1410
|
+
createdAt: string;
|
|
1411
|
+
deploymentId: string;
|
|
1412
|
+
id: string;
|
|
1413
|
+
text: string;
|
|
1414
|
+
type: "stdout" | "stderr";
|
|
1415
|
+
level?: "error" | "warning" | "info";
|
|
1416
|
+
object: "deployment_log";
|
|
1417
|
+
}[];
|
|
1397
1418
|
nextSince: number | undefined;
|
|
1398
1419
|
}>;
|
|
1399
1420
|
getDeploymentErrors: ai.Tool<{
|
|
@@ -1697,8 +1718,15 @@ declare function v0ToolsFlat(config?: V0ToolsConfig): {
|
|
|
1697
1718
|
deploymentId: string;
|
|
1698
1719
|
since?: number | undefined;
|
|
1699
1720
|
}, {
|
|
1700
|
-
logs:
|
|
1701
|
-
|
|
1721
|
+
logs: {
|
|
1722
|
+
createdAt: string;
|
|
1723
|
+
deploymentId: string;
|
|
1724
|
+
id: string;
|
|
1725
|
+
text: string;
|
|
1726
|
+
type: "stdout" | "stderr";
|
|
1727
|
+
level?: "error" | "warning" | "info";
|
|
1728
|
+
object: "deployment_log";
|
|
1729
|
+
}[];
|
|
1702
1730
|
nextSince: number | undefined;
|
|
1703
1731
|
}>;
|
|
1704
1732
|
getDeploymentErrors: ai.Tool<{
|
|
@@ -1878,6 +1906,7 @@ declare function v0ToolsFlat(config?: V0ToolsConfig): {
|
|
|
1878
1906
|
object: "version";
|
|
1879
1907
|
status: "pending" | "completed" | "failed";
|
|
1880
1908
|
demoUrl?: string;
|
|
1909
|
+
screenshotUrl?: string;
|
|
1881
1910
|
createdAt: string;
|
|
1882
1911
|
updatedAt?: string;
|
|
1883
1912
|
files: {
|
|
@@ -1886,7 +1915,6 @@ declare function v0ToolsFlat(config?: V0ToolsConfig): {
|
|
|
1886
1915
|
content: string;
|
|
1887
1916
|
locked: boolean;
|
|
1888
1917
|
}[];
|
|
1889
|
-
screenshotUrl?: string;
|
|
1890
1918
|
} | undefined;
|
|
1891
1919
|
createdAt: string;
|
|
1892
1920
|
}>;
|
|
@@ -1915,6 +1943,7 @@ declare function v0ToolsFlat(config?: V0ToolsConfig): {
|
|
|
1915
1943
|
object: "version";
|
|
1916
1944
|
status: "pending" | "completed" | "failed";
|
|
1917
1945
|
demoUrl?: string;
|
|
1946
|
+
screenshotUrl?: string;
|
|
1918
1947
|
createdAt: string;
|
|
1919
1948
|
updatedAt?: string;
|
|
1920
1949
|
files: {
|
|
@@ -1923,7 +1952,6 @@ declare function v0ToolsFlat(config?: V0ToolsConfig): {
|
|
|
1923
1952
|
content: string;
|
|
1924
1953
|
locked: boolean;
|
|
1925
1954
|
}[];
|
|
1926
|
-
screenshotUrl?: string;
|
|
1927
1955
|
} | undefined;
|
|
1928
1956
|
updatedAt: string | undefined;
|
|
1929
1957
|
}>;
|
|
@@ -1942,6 +1970,7 @@ declare function v0ToolsFlat(config?: V0ToolsConfig): {
|
|
|
1942
1970
|
object: "version";
|
|
1943
1971
|
status: "pending" | "completed" | "failed";
|
|
1944
1972
|
demoUrl?: string;
|
|
1973
|
+
screenshotUrl?: string;
|
|
1945
1974
|
createdAt: string;
|
|
1946
1975
|
updatedAt?: string;
|
|
1947
1976
|
files: {
|
|
@@ -1950,7 +1979,6 @@ declare function v0ToolsFlat(config?: V0ToolsConfig): {
|
|
|
1950
1979
|
content: string;
|
|
1951
1980
|
locked: boolean;
|
|
1952
1981
|
}[];
|
|
1953
|
-
screenshotUrl?: string;
|
|
1954
1982
|
} | undefined;
|
|
1955
1983
|
messagesCount: number;
|
|
1956
1984
|
}>;
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sources":["../src/types.ts","../src/tools/chat-tools.ts","../src/tools/project-tools.ts","../src/tools/deployment-tools.ts","../src/tools/user-tools.ts","../src/tools/hook-tools.ts","../src/index.ts"],"sourcesContent":["import type { V0ClientConfig } from 'v0-sdk'\n\nexport interface V0ToolsConfig extends V0ClientConfig {\n /**\n * Optional base URL for v0 API\n * @default \"https://api.v0.dev\"\n */\n baseUrl?: string\n /**\n * API key for v0 authentication\n * If not provided, will use V0_API_KEY environment variable\n */\n apiKey?: string\n}\n","import { tool } from 'ai'\nimport { z } from 'zod'\nimport { createClient, type V0ClientConfig } from 'v0-sdk'\n\n/**\n * Creates chat-related AI SDK tools\n */\nexport function createChatTools(config: V0ClientConfig = {}) {\n const client = createClient(config)\n\n const createChat = tool({\n description: 'Create a new chat with v0',\n inputSchema: z.object({\n message: z.string().describe('The initial message to start the chat'),\n system: z.string().optional().describe('System prompt for the chat'),\n attachments: z\n .array(\n z.object({\n url: z.string().describe('URL of the attachment'),\n }),\n )\n .optional()\n .describe('File attachments for the chat'),\n chatPrivacy: z\n .enum(['public', 'private', 'team-edit', 'team', 'unlisted'])\n .optional()\n .describe('Privacy setting for the chat'),\n projectId: z\n .string()\n .optional()\n .describe('Project ID to associate with the chat'),\n modelConfiguration: z\n .object({\n modelId: z\n .enum(['v0-1.5-sm', 'v0-1.5-md', 'v0-1.5-lg', 'v0-gpt-5'])\n .describe('Model to use for the chat'),\n imageGenerations: z\n .boolean()\n .optional()\n .describe('Enable image generations'),\n thinking: z.boolean().optional().describe('Enable thinking mode'),\n })\n .optional()\n .describe('Model configuration for the chat'),\n responseMode: z\n .enum(['sync', 'async'])\n .optional()\n .describe('Response mode for the chat'),\n }),\n execute: async ({\n message,\n system,\n attachments,\n chatPrivacy,\n projectId,\n modelConfiguration,\n responseMode,\n }) => {\n const result = await client.chats.create({\n message,\n system,\n attachments,\n chatPrivacy,\n projectId,\n modelConfiguration,\n responseMode,\n })\n\n // Handle streaming vs non-streaming responses\n if (result instanceof ReadableStream) {\n return {\n chatId: 'streaming-chat',\n webUrl: 'N/A (streaming response)',\n apiUrl: 'N/A (streaming response)',\n privacy: 'N/A (streaming response)',\n name: 'N/A (streaming response)',\n favorite: false,\n latestVersion: 'N/A (streaming response)',\n createdAt: 'N/A (streaming response)',\n }\n }\n\n return {\n chatId: result.id,\n webUrl: result.webUrl,\n apiUrl: result.apiUrl,\n privacy: result.privacy,\n name: result.name,\n favorite: result.favorite,\n latestVersion: result.latestVersion,\n createdAt: result.createdAt,\n }\n },\n })\n\n const sendMessage = tool({\n description: 'Send a message to an existing chat',\n inputSchema: z.object({\n chatId: z.string().describe('ID of the chat to send message to'),\n message: z.string().describe('Message content to send'),\n attachments: z\n .array(\n z.object({\n url: z.string().describe('URL of the attachment'),\n }),\n )\n .optional()\n .describe('File attachments for the message'),\n modelConfiguration: z\n .object({\n modelId: z\n .enum(['v0-1.5-sm', 'v0-1.5-md', 'v0-1.5-lg', 'v0-gpt-5'])\n .describe('Model to use'),\n imageGenerations: z\n .boolean()\n .optional()\n .describe('Enable image generations'),\n thinking: z.boolean().optional().describe('Enable thinking mode'),\n })\n .optional()\n .describe('Model configuration'),\n responseMode: z\n .enum(['sync', 'async'])\n .optional()\n .describe('Response mode'),\n }),\n execute: async ({\n chatId,\n message,\n attachments,\n modelConfiguration,\n responseMode,\n }) => {\n const result = await client.chats.sendMessage({\n chatId,\n message,\n attachments,\n modelConfiguration,\n responseMode,\n })\n\n // Handle streaming vs non-streaming responses\n if (result instanceof ReadableStream) {\n return {\n chatId: 'streaming-chat',\n webUrl: 'N/A (streaming response)',\n latestVersion: 'N/A (streaming response)',\n updatedAt: 'N/A (streaming response)',\n }\n }\n\n return {\n chatId: result.id,\n webUrl: result.webUrl,\n latestVersion: result.latestVersion,\n updatedAt: result.updatedAt,\n }\n },\n })\n\n const getChat = tool({\n description: 'Get details of an existing chat',\n inputSchema: z.object({\n chatId: z.string().describe('ID of the chat to retrieve'),\n }),\n execute: async (params) => {\n const { chatId } = params\n const result = await client.chats.getById({ chatId })\n\n return {\n chatId: result.id,\n name: result.name,\n privacy: result.privacy,\n webUrl: result.webUrl,\n favorite: result.favorite,\n createdAt: result.createdAt,\n updatedAt: result.updatedAt,\n latestVersion: result.latestVersion,\n messagesCount: result.messages.length,\n }\n },\n })\n\n const updateChat = tool({\n description: 'Update properties of an existing chat',\n inputSchema: z.object({\n chatId: z.string().describe('ID of the chat to update'),\n name: z.string().optional().describe('New name for the chat'),\n privacy: z\n .enum(['public', 'private', 'team', 'team-edit', 'unlisted'])\n .optional()\n .describe('New privacy setting'),\n }),\n execute: async (params) => {\n const { chatId, name, privacy } = params\n const result = await client.chats.update({ chatId, name, privacy })\n\n return {\n chatId: result.id,\n name: result.name,\n privacy: result.privacy,\n updatedAt: result.updatedAt,\n }\n },\n })\n\n const deleteChat = tool({\n description: 'Delete an existing chat',\n inputSchema: z.object({\n chatId: z.string().describe('ID of the chat to delete'),\n }),\n execute: async (params) => {\n const { chatId } = params\n const result = await client.chats.delete({ chatId })\n\n return {\n chatId: result.id,\n deleted: result.deleted,\n }\n },\n })\n\n const favoriteChat = tool({\n description: 'Toggle favorite status of a chat',\n inputSchema: z.object({\n chatId: z.string().describe('ID of the chat'),\n isFavorite: z.boolean().describe('Whether to mark as favorite or not'),\n }),\n execute: async (params) => {\n const { chatId, isFavorite } = params\n const result = await client.chats.favorite({ chatId, isFavorite })\n\n return {\n chatId: result.id,\n favorited: result.favorited,\n }\n },\n })\n\n const forkChat = tool({\n description: 'Fork an existing chat to create a new version',\n inputSchema: z.object({\n chatId: z.string().describe('ID of the chat to fork'),\n versionId: z\n .string()\n .optional()\n .describe('Specific version ID to fork from'),\n privacy: z\n .enum(['public', 'private', 'team', 'team-edit', 'unlisted'])\n .optional()\n .describe('Privacy setting for the forked chat'),\n }),\n execute: async (params) => {\n const { chatId, versionId, privacy } = params\n const result = await client.chats.fork({ chatId, versionId, privacy })\n\n return {\n originalChatId: chatId,\n newChatId: result.id,\n webUrl: result.webUrl,\n privacy: result.privacy,\n createdAt: result.createdAt,\n }\n },\n })\n\n const listChats = tool({\n description: 'List all chats',\n inputSchema: z.object({\n limit: z.number().optional().describe('Number of chats to return'),\n offset: z.number().optional().describe('Offset for pagination'),\n isFavorite: z.boolean().optional().describe('Filter by favorite status'),\n }),\n execute: async (params) => {\n const { limit, offset, isFavorite } = params\n const result = await client.chats.find({ limit, offset, isFavorite })\n\n return {\n chats: result.data.map((chat) => ({\n chatId: chat.id,\n name: chat.name,\n privacy: chat.privacy,\n webUrl: chat.webUrl,\n favorite: chat.favorite,\n createdAt: chat.createdAt,\n updatedAt: chat.updatedAt,\n })),\n }\n },\n })\n\n return {\n createChat,\n sendMessage,\n getChat,\n updateChat,\n deleteChat,\n favoriteChat,\n forkChat,\n listChats,\n }\n}\n","import { tool } from 'ai'\nimport { z } from 'zod'\nimport { createClient, type V0ClientConfig } from 'v0-sdk'\n\n/**\n * Creates project-related AI SDK tools\n */\nexport function createProjectTools(config: V0ClientConfig = {}) {\n const client = createClient(config)\n\n const createProject = tool({\n description: 'Create a new project in v0',\n inputSchema: z.object({\n name: z.string().describe('Name of the project'),\n description: z.string().optional().describe('Description of the project'),\n icon: z.string().optional().describe('Icon for the project'),\n environmentVariables: z\n .array(\n z.object({\n key: z.string().describe('Environment variable key'),\n value: z.string().describe('Environment variable value'),\n }),\n )\n .optional()\n .describe('Environment variables for the project'),\n instructions: z\n .string()\n .optional()\n .describe('Custom instructions for the project'),\n vercelProjectId: z\n .string()\n .optional()\n .describe('Associated Vercel project ID'),\n privacy: z\n .enum(['private', 'team'])\n .optional()\n .describe('Privacy setting for the project'),\n }),\n execute: async ({\n name,\n description,\n icon,\n environmentVariables,\n instructions,\n vercelProjectId,\n privacy,\n }) => {\n const result = await client.projects.create({\n name,\n description,\n icon,\n environmentVariables,\n instructions,\n vercelProjectId,\n privacy,\n })\n\n return {\n projectId: result.id,\n name: result.name,\n description: result.description,\n privacy: result.privacy,\n webUrl: result.webUrl,\n apiUrl: result.apiUrl,\n createdAt: result.createdAt,\n vercelProjectId: result.vercelProjectId,\n }\n },\n })\n\n const getProject = tool({\n description: 'Get details of an existing project',\n inputSchema: z.object({\n projectId: z.string().describe('ID of the project to retrieve'),\n }),\n execute: async (params) => {\n const { projectId } = params\n const result = await client.projects.getById({ projectId })\n\n return {\n projectId: result.id,\n name: result.name,\n description: result.description,\n instructions: result.instructions,\n privacy: result.privacy,\n webUrl: result.webUrl,\n apiUrl: result.apiUrl,\n createdAt: result.createdAt,\n updatedAt: result.updatedAt,\n vercelProjectId: result.vercelProjectId,\n chatsCount: result.chats.length,\n }\n },\n })\n\n const updateProject = tool({\n description: 'Update properties of an existing project',\n inputSchema: z.object({\n projectId: z.string().describe('ID of the project to update'),\n name: z.string().optional().describe('New name for the project'),\n description: z\n .string()\n .optional()\n .describe('New description for the project'),\n instructions: z\n .string()\n .optional()\n .describe('New instructions for the project'),\n privacy: z\n .enum(['private', 'team'])\n .optional()\n .describe('New privacy setting'),\n }),\n execute: async ({\n projectId,\n name,\n description,\n instructions,\n privacy,\n }) => {\n const result = await client.projects.update({\n projectId,\n name,\n description,\n instructions,\n privacy,\n })\n\n return {\n projectId: result.id,\n name: result.name,\n description: result.description,\n instructions: result.instructions,\n privacy: result.privacy,\n updatedAt: result.updatedAt,\n }\n },\n })\n\n const listProjects = tool({\n description: 'List all projects',\n inputSchema: z.object({}),\n execute: async () => {\n const result = await client.projects.find()\n\n return {\n projects: result.data.map((project) => ({\n projectId: project.id,\n name: project.name,\n privacy: project.privacy,\n webUrl: project.webUrl,\n createdAt: project.createdAt,\n updatedAt: project.updatedAt,\n vercelProjectId: project.vercelProjectId,\n })),\n }\n },\n })\n\n const assignChatToProject = tool({\n description: 'Assign a chat to a project',\n inputSchema: z.object({\n projectId: z.string().describe('ID of the project'),\n chatId: z.string().describe('ID of the chat to assign'),\n }),\n execute: async (params) => {\n const { projectId, chatId } = params\n const result = await client.projects.assign({ projectId, chatId })\n\n return {\n projectId: result.id,\n assigned: result.assigned,\n }\n },\n })\n\n const getProjectByChat = tool({\n description: 'Get project details by chat ID',\n inputSchema: z.object({\n chatId: z.string().describe('ID of the chat'),\n }),\n execute: async (params) => {\n const { chatId } = params\n const result = await client.projects.getByChatId({ chatId })\n\n return {\n projectId: result.id,\n name: result.name,\n description: result.description,\n privacy: result.privacy,\n webUrl: result.webUrl,\n createdAt: result.createdAt,\n chatsCount: result.chats.length,\n }\n },\n })\n\n // Environment Variables Tools\n const createEnvironmentVariables = tool({\n description: 'Create environment variables for a project',\n inputSchema: z.object({\n projectId: z.string().describe('ID of the project'),\n environmentVariables: z\n .array(\n z.object({\n key: z.string().describe('Environment variable key'),\n value: z.string().describe('Environment variable value'),\n }),\n )\n .describe('Environment variables to create'),\n upsert: z\n .boolean()\n .optional()\n .describe('Whether to upsert existing variables'),\n decrypted: z\n .boolean()\n .optional()\n .describe('Whether to return decrypted values'),\n }),\n execute: async (params) => {\n const { projectId, environmentVariables, upsert, decrypted } = params\n const result = await client.projects.createEnvVars({\n projectId,\n environmentVariables,\n upsert,\n decrypted,\n })\n\n return {\n environmentVariables: result.data.map((envVar) => ({\n id: envVar.id,\n key: envVar.key,\n value: envVar.value,\n decrypted: envVar.decrypted,\n createdAt: envVar.createdAt,\n })),\n }\n },\n })\n\n const listEnvironmentVariables = tool({\n description: 'List environment variables for a project',\n inputSchema: z.object({\n projectId: z.string().describe('ID of the project'),\n decrypted: z\n .boolean()\n .optional()\n .describe('Whether to return decrypted values'),\n }),\n execute: async (params) => {\n const { projectId, decrypted } = params\n const result = await client.projects.findEnvVars({\n projectId,\n decrypted,\n })\n\n return {\n environmentVariables: result.data.map((envVar) => ({\n id: envVar.id,\n key: envVar.key,\n value: envVar.value,\n decrypted: envVar.decrypted,\n createdAt: envVar.createdAt,\n updatedAt: envVar.updatedAt,\n })),\n }\n },\n })\n\n const updateEnvironmentVariables = tool({\n description: 'Update environment variables for a project',\n inputSchema: z.object({\n projectId: z.string().describe('ID of the project'),\n environmentVariables: z\n .array(\n z.object({\n id: z.string().describe('Environment variable ID'),\n value: z.string().describe('New environment variable value'),\n }),\n )\n .describe('Environment variables to update'),\n decrypted: z\n .boolean()\n .optional()\n .describe('Whether to return decrypted values'),\n }),\n execute: async (params) => {\n const { projectId, environmentVariables, decrypted } = params\n const result = await client.projects.updateEnvVars({\n projectId,\n environmentVariables,\n decrypted,\n })\n\n return {\n environmentVariables: result.data.map((envVar) => ({\n id: envVar.id,\n key: envVar.key,\n value: envVar.value,\n decrypted: envVar.decrypted,\n updatedAt: envVar.updatedAt,\n })),\n }\n },\n })\n\n const deleteEnvironmentVariables = tool({\n description: 'Delete environment variables from a project',\n inputSchema: z.object({\n projectId: z.string().describe('ID of the project'),\n environmentVariableIds: z\n .array(z.string())\n .describe('IDs of environment variables to delete'),\n }),\n execute: async (params) => {\n const { projectId, environmentVariableIds } = params\n const result = await client.projects.deleteEnvVars({\n projectId,\n environmentVariableIds,\n })\n\n return {\n deletedVariables: result.data.map((envVar) => ({\n id: envVar.id,\n deleted: envVar.deleted,\n })),\n }\n },\n })\n\n return {\n createProject,\n getProject,\n updateProject,\n listProjects,\n assignChatToProject,\n getProjectByChat,\n createEnvironmentVariables,\n listEnvironmentVariables,\n updateEnvironmentVariables,\n deleteEnvironmentVariables,\n }\n}\n","import { tool } from 'ai'\nimport { z } from 'zod'\nimport { createClient, type V0ClientConfig } from 'v0-sdk'\n\n/**\n * Creates deployment-related AI SDK tools\n */\nexport function createDeploymentTools(config: V0ClientConfig = {}) {\n const client = createClient(config)\n\n const createDeployment = tool({\n description: 'Create a new deployment from a chat version',\n inputSchema: z.object({\n projectId: z.string().describe('ID of the project to deploy to'),\n chatId: z.string().describe('ID of the chat to deploy'),\n versionId: z.string().describe('ID of the specific version to deploy'),\n }),\n execute: async (params) => {\n const { projectId, chatId, versionId } = params\n const result = await client.deployments.create({\n projectId,\n chatId,\n versionId,\n })\n\n return {\n deploymentId: result.id,\n projectId: result.projectId,\n chatId: result.chatId,\n versionId: result.versionId,\n inspectorUrl: result.inspectorUrl,\n webUrl: result.webUrl,\n apiUrl: result.apiUrl,\n }\n },\n })\n\n const getDeployment = tool({\n description: 'Get details of an existing deployment',\n inputSchema: z.object({\n deploymentId: z.string().describe('ID of the deployment to retrieve'),\n }),\n execute: async (params) => {\n const { deploymentId } = params\n const result = await client.deployments.getById({ deploymentId })\n\n return {\n deploymentId: result.id,\n projectId: result.projectId,\n chatId: result.chatId,\n versionId: result.versionId,\n inspectorUrl: result.inspectorUrl,\n webUrl: result.webUrl,\n apiUrl: result.apiUrl,\n }\n },\n })\n\n const deleteDeployment = tool({\n description: 'Delete an existing deployment',\n inputSchema: z.object({\n deploymentId: z.string().describe('ID of the deployment to delete'),\n }),\n execute: async (params) => {\n const { deploymentId } = params\n const result = await client.deployments.delete({ deploymentId })\n\n return {\n deploymentId: result.id,\n deleted: result.deleted,\n }\n },\n })\n\n const listDeployments = tool({\n description: 'List deployments by project, chat, and version',\n inputSchema: z.object({\n projectId: z.string().describe('ID of the project'),\n chatId: z.string().describe('ID of the chat'),\n versionId: z.string().describe('ID of the version'),\n }),\n execute: async (params) => {\n const { projectId, chatId, versionId } = params\n const result = await client.deployments.find({\n projectId,\n chatId,\n versionId,\n })\n\n return {\n deployments: result.data.map((deployment) => ({\n deploymentId: deployment.id,\n projectId: deployment.projectId,\n chatId: deployment.chatId,\n versionId: deployment.versionId,\n inspectorUrl: deployment.inspectorUrl,\n webUrl: deployment.webUrl,\n apiUrl: deployment.apiUrl,\n })),\n }\n },\n })\n\n const getDeploymentLogs = tool({\n description: 'Get logs for a deployment',\n inputSchema: z.object({\n deploymentId: z.string().describe('ID of the deployment'),\n since: z.number().optional().describe('Timestamp to get logs since'),\n }),\n execute: async (params) => {\n const { deploymentId, since } = params\n const result = await client.deployments.findLogs({\n deploymentId,\n since,\n })\n\n return {\n logs: result.logs,\n error: result.error,\n nextSince: result.nextSince,\n }\n },\n })\n\n const getDeploymentErrors = tool({\n description: 'Get errors for a deployment',\n inputSchema: z.object({\n deploymentId: z.string().describe('ID of the deployment'),\n }),\n execute: async (params) => {\n const { deploymentId } = params\n const result = await client.deployments.findErrors({ deploymentId })\n\n return {\n error: result.error,\n fullErrorText: result.fullErrorText,\n errorType: result.errorType,\n formattedError: result.formattedError,\n }\n },\n })\n\n return {\n createDeployment,\n getDeployment,\n deleteDeployment,\n listDeployments,\n getDeploymentLogs,\n getDeploymentErrors,\n }\n}\n","import { tool } from 'ai'\nimport { z } from 'zod'\nimport { createClient, type V0ClientConfig } from 'v0-sdk'\n\n/**\n * Creates user-related AI SDK tools\n */\nexport function createUserTools(config: V0ClientConfig = {}) {\n const client = createClient(config)\n\n const getCurrentUser = tool({\n description: 'Get current user information',\n inputSchema: z.object({}),\n execute: async () => {\n const result = await client.user.get()\n\n return {\n userId: result.id,\n name: result.name,\n email: result.email,\n avatar: result.avatar,\n }\n },\n })\n\n const getUserBilling = tool({\n description: 'Get current user billing information',\n inputSchema: z.object({\n scope: z.string().optional().describe('Scope for billing information'),\n }),\n execute: async (params) => {\n const { scope } = params\n const result = await client.user.getBilling({ scope })\n\n if (result.billingType === 'token') {\n return {\n billingType: result.billingType,\n plan: result.data.plan,\n role: result.data.role,\n billingMode: result.data.billingMode,\n billingCycle: {\n start: result.data.billingCycle.start,\n end: result.data.billingCycle.end,\n },\n balance: {\n remaining: result.data.balance.remaining,\n total: result.data.balance.total,\n },\n onDemand: {\n balance: result.data.onDemand.balance,\n blocks: result.data.onDemand.blocks,\n },\n }\n } else {\n return {\n billingType: result.billingType,\n remaining: result.data.remaining,\n reset: result.data.reset,\n limit: result.data.limit,\n }\n }\n },\n })\n\n const getUserPlan = tool({\n description: 'Get current user plan information',\n inputSchema: z.object({}),\n execute: async () => {\n const result = await client.user.getPlan()\n\n return {\n plan: result.plan,\n billingCycle: {\n start: result.billingCycle.start,\n end: result.billingCycle.end,\n },\n balance: {\n remaining: result.balance.remaining,\n total: result.balance.total,\n },\n }\n },\n })\n\n const getUserScopes = tool({\n description: 'Get user scopes/permissions',\n inputSchema: z.object({}),\n execute: async () => {\n const result = await client.user.getScopes()\n\n return {\n scopes: result.data.map((scope) => ({\n id: scope.id,\n name: scope.name,\n })),\n }\n },\n })\n\n const getRateLimits = tool({\n description: 'Get current rate limit information',\n inputSchema: z.object({\n scope: z.string().optional().describe('Scope for rate limit information'),\n }),\n execute: async (params) => {\n const { scope } = params\n const result = await client.rateLimits.find({ scope })\n\n return {\n remaining: result.remaining,\n reset: result.reset,\n limit: result.limit,\n }\n },\n })\n\n return {\n getCurrentUser,\n getUserBilling,\n getUserPlan,\n getUserScopes,\n getRateLimits,\n }\n}\n","import { tool } from 'ai'\nimport { z } from 'zod'\nimport { createClient, type V0ClientConfig } from 'v0-sdk'\n\n/**\n * Creates webhook-related AI SDK tools\n */\nexport function createHookTools(config: V0ClientConfig = {}) {\n const client = createClient(config)\n\n const createHook = tool({\n description: 'Create a new webhook for v0 events',\n inputSchema: z.object({\n name: z.string().describe('Name of the webhook'),\n url: z.string().describe('URL to send webhook events to'),\n events: z\n .array(\n z.enum([\n 'chat.created',\n 'chat.updated',\n 'chat.deleted',\n 'message.created',\n 'message.updated',\n 'message.deleted',\n ]),\n )\n .describe('Events to listen for'),\n chatId: z\n .string()\n .optional()\n .describe('Specific chat ID to listen to events for'),\n }),\n execute: async (params) => {\n const { name, url, events, chatId } = params\n const result = await client.hooks.create({\n name,\n url,\n events,\n chatId,\n })\n\n return {\n hookId: result.id,\n name: result.name,\n url: result.url,\n events: result.events,\n chatId: result.chatId,\n }\n },\n })\n\n const getHook = tool({\n description: 'Get details of an existing webhook',\n inputSchema: z.object({\n hookId: z.string().describe('ID of the webhook to retrieve'),\n }),\n execute: async (params) => {\n const { hookId } = params\n const result = await client.hooks.getById({ hookId })\n\n return {\n hookId: result.id,\n name: result.name,\n url: result.url,\n events: result.events,\n chatId: result.chatId,\n }\n },\n })\n\n const updateHook = tool({\n description: 'Update properties of an existing webhook',\n inputSchema: z.object({\n hookId: z.string().describe('ID of the webhook to update'),\n name: z.string().optional().describe('New name for the webhook'),\n url: z.string().optional().describe('New URL for the webhook'),\n events: z\n .array(\n z.enum([\n 'chat.created',\n 'chat.updated',\n 'chat.deleted',\n 'message.created',\n 'message.updated',\n 'message.deleted',\n ]),\n )\n .optional()\n .describe('New events to listen for'),\n }),\n execute: async (params) => {\n const { hookId, name, url, events } = params\n const result = await client.hooks.update({\n hookId,\n name,\n url,\n events,\n })\n\n return {\n hookId: result.id,\n name: result.name,\n url: result.url,\n events: result.events,\n chatId: result.chatId,\n }\n },\n })\n\n const deleteHook = tool({\n description: 'Delete an existing webhook',\n inputSchema: z.object({\n hookId: z.string().describe('ID of the webhook to delete'),\n }),\n execute: async (params) => {\n const { hookId } = params\n const result = await client.hooks.delete({ hookId })\n\n return {\n hookId: result.id,\n deleted: result.deleted,\n }\n },\n })\n\n const listHooks = tool({\n description: 'List all webhooks',\n inputSchema: z.object({}),\n execute: async () => {\n const result = await client.hooks.find()\n\n return {\n hooks: result.data.map((hook) => ({\n hookId: hook.id,\n name: hook.name,\n })),\n }\n },\n })\n\n return {\n createHook,\n getHook,\n updateHook,\n deleteHook,\n listHooks,\n }\n}\n","import type { V0ToolsConfig } from './types'\nimport { createChatTools } from './tools/chat-tools'\nimport { createProjectTools } from './tools/project-tools'\nimport { createDeploymentTools } from './tools/deployment-tools'\nimport { createUserTools } from './tools/user-tools'\nimport { createHookTools } from './tools/hook-tools'\n\n/**\n * Creates all v0 AI SDK tools as a flat object.\n *\n * ⚠️ Note: This includes ALL available tools (~20+ tools) which adds significant context.\n * Consider using v0ToolsByCategory() to select only the tools you need.\n *\n * @param config Configuration for v0 client\n * @returns Flat object with all v0 tools ready to use with AI SDK\n *\n * @example\n * ```typescript\n * import { generateText } from 'ai'\n * import { v0Tools } from '@v0-sdk/ai-tools'\n *\n * const result = await generateText({\n * model: 'openai/gpt-4',\n * prompt: 'Create a new React component',\n * tools: v0Tools({\n * apiKey: process.env.V0_API_KEY\n * })\n * })\n * ```\n */\nexport function v0Tools(config: V0ToolsConfig = {}) {\n // Use environment variable if apiKey not provided\n const clientConfig = {\n ...config,\n apiKey: config.apiKey || process.env.V0_API_KEY,\n }\n\n const chatTools = createChatTools(clientConfig)\n const projectTools = createProjectTools(clientConfig)\n const deploymentTools = createDeploymentTools(clientConfig)\n const userTools = createUserTools(clientConfig)\n const hookTools = createHookTools(clientConfig)\n\n return {\n ...chatTools,\n ...projectTools,\n ...deploymentTools,\n ...userTools,\n ...hookTools,\n }\n}\n\n/**\n * Creates v0 tools organized by category for selective usage (recommended).\n * This allows you to include only the tools you need, reducing context size.\n *\n * @param config Configuration for v0 client\n * @returns Object containing all v0 tools organized by category\n *\n * @example\n * ```typescript\n * import { generateText } from 'ai'\n * import { v0ToolsByCategory } from '@v0-sdk/ai-tools'\n *\n * const tools = v0ToolsByCategory({\n * apiKey: process.env.V0_API_KEY\n * })\n *\n * // Only include chat and project tools\n * const result = await generateText({\n * model: 'openai/gpt-4',\n * prompt: 'Create a new React component',\n * tools: {\n * ...tools.chat,\n * ...tools.project\n * }\n * })\n * ```\n */\nexport function v0ToolsByCategory(config: V0ToolsConfig = {}) {\n // Use environment variable if apiKey not provided\n const clientConfig = {\n ...config,\n apiKey: config.apiKey || process.env.V0_API_KEY,\n }\n\n return {\n /**\n * Chat-related tools for creating, managing, and interacting with v0 chats\n */\n chat: createChatTools(clientConfig),\n\n /**\n * Project-related tools for creating and managing v0 projects\n */\n project: createProjectTools(clientConfig),\n\n /**\n * Deployment-related tools for creating and managing deployments\n */\n deployment: createDeploymentTools(clientConfig),\n\n /**\n * User-related tools for getting user information, billing, and rate limits\n */\n user: createUserTools(clientConfig),\n\n /**\n * Webhook tools for creating and managing event hooks\n */\n hook: createHookTools(clientConfig),\n }\n}\n\n/**\n * @deprecated Use v0Tools instead (now returns flat structure by default)\n */\nexport function v0ToolsFlat(config: V0ToolsConfig = {}) {\n return v0Tools(config)\n}\n\n// Export individual tool creators for more granular usage\nexport { createChatTools } from './tools/chat-tools'\nexport { createProjectTools } from './tools/project-tools'\nexport { createDeploymentTools } from './tools/deployment-tools'\nexport { createUserTools } from './tools/user-tools'\nexport { createHookTools } from './tools/hook-tools'\n\n// Export types\nexport type { V0ToolsConfig } from './types'\n\n// Default export\nexport default v0Tools\n"],"names":[],"mappings":";;;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACXA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpKA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1IA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjEA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzEA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sources":["../src/types.ts","../src/tools/chat-tools.ts","../src/tools/project-tools.ts","../src/tools/deployment-tools.ts","../src/tools/user-tools.ts","../src/tools/hook-tools.ts","../src/index.ts"],"sourcesContent":["import type { V0ClientConfig } from 'v0-sdk'\n\nexport interface V0ToolsConfig extends V0ClientConfig {\n /**\n * Optional base URL for v0 API\n * @default \"https://api.v0.dev\"\n */\n baseUrl?: string\n /**\n * API key for v0 authentication\n * If not provided, will use V0_API_KEY environment variable\n */\n apiKey?: string\n}\n","import { tool } from 'ai'\nimport { z } from 'zod'\nimport { createClient, type V0ClientConfig } from 'v0-sdk'\n\n/**\n * Creates chat-related AI SDK tools\n */\nexport function createChatTools(config: V0ClientConfig = {}) {\n const client = createClient(config)\n\n const createChat = tool({\n description: 'Create a new chat with v0',\n inputSchema: z.object({\n message: z.string().describe('The initial message to start the chat'),\n system: z.string().optional().describe('System prompt for the chat'),\n attachments: z\n .array(\n z.object({\n url: z.string().describe('URL of the attachment'),\n }),\n )\n .optional()\n .describe('File attachments for the chat'),\n chatPrivacy: z\n .enum(['public', 'private', 'team-edit', 'team', 'unlisted'])\n .optional()\n .describe('Privacy setting for the chat'),\n projectId: z\n .string()\n .optional()\n .describe('Project ID to associate with the chat'),\n modelConfiguration: z\n .object({\n modelId: z\n .enum(['v0-1.5-sm', 'v0-1.5-md', 'v0-1.5-lg', 'v0-gpt-5'])\n .describe('Model to use for the chat'),\n imageGenerations: z\n .boolean()\n .optional()\n .describe('Enable image generations'),\n thinking: z.boolean().optional().describe('Enable thinking mode'),\n })\n .optional()\n .describe('Model configuration for the chat'),\n responseMode: z\n .enum(['sync', 'async'])\n .optional()\n .describe('Response mode for the chat'),\n }),\n execute: async ({\n message,\n system,\n attachments,\n chatPrivacy,\n projectId,\n modelConfiguration,\n responseMode,\n }) => {\n const result = await client.chats.create({\n message,\n system,\n attachments,\n chatPrivacy,\n projectId,\n modelConfiguration,\n responseMode,\n })\n\n // Handle streaming vs non-streaming responses\n if (result instanceof ReadableStream) {\n return {\n chatId: 'streaming-chat',\n webUrl: 'N/A (streaming response)',\n apiUrl: 'N/A (streaming response)',\n privacy: 'N/A (streaming response)',\n name: 'N/A (streaming response)',\n favorite: false,\n latestVersion: 'N/A (streaming response)',\n createdAt: 'N/A (streaming response)',\n }\n }\n\n return {\n chatId: result.id,\n webUrl: result.webUrl,\n apiUrl: result.apiUrl,\n privacy: result.privacy,\n name: result.name,\n favorite: result.favorite,\n latestVersion: result.latestVersion,\n createdAt: result.createdAt,\n }\n },\n })\n\n const sendMessage = tool({\n description: 'Send a message to an existing chat',\n inputSchema: z.object({\n chatId: z.string().describe('ID of the chat to send message to'),\n message: z.string().describe('Message content to send'),\n attachments: z\n .array(\n z.object({\n url: z.string().describe('URL of the attachment'),\n }),\n )\n .optional()\n .describe('File attachments for the message'),\n modelConfiguration: z\n .object({\n modelId: z\n .enum(['v0-1.5-sm', 'v0-1.5-md', 'v0-1.5-lg', 'v0-gpt-5'])\n .describe('Model to use'),\n imageGenerations: z\n .boolean()\n .optional()\n .describe('Enable image generations'),\n thinking: z.boolean().optional().describe('Enable thinking mode'),\n })\n .optional()\n .describe('Model configuration'),\n responseMode: z\n .enum(['sync', 'async'])\n .optional()\n .describe('Response mode'),\n }),\n execute: async ({\n chatId,\n message,\n attachments,\n modelConfiguration,\n responseMode,\n }) => {\n const result = await client.chats.sendMessage({\n chatId,\n message,\n attachments,\n modelConfiguration,\n responseMode,\n })\n\n // Handle streaming vs non-streaming responses\n if (result instanceof ReadableStream) {\n return {\n chatId: 'streaming-chat',\n webUrl: 'N/A (streaming response)',\n latestVersion: 'N/A (streaming response)',\n updatedAt: 'N/A (streaming response)',\n }\n }\n\n return {\n chatId: result.id,\n webUrl: result.webUrl,\n latestVersion: result.latestVersion,\n updatedAt: result.updatedAt,\n }\n },\n })\n\n const getChat = tool({\n description: 'Get details of an existing chat',\n inputSchema: z.object({\n chatId: z.string().describe('ID of the chat to retrieve'),\n }),\n execute: async (params) => {\n const { chatId } = params\n const result = await client.chats.getById({ chatId })\n\n return {\n chatId: result.id,\n name: result.name,\n privacy: result.privacy,\n webUrl: result.webUrl,\n favorite: result.favorite,\n createdAt: result.createdAt,\n updatedAt: result.updatedAt,\n latestVersion: result.latestVersion,\n messagesCount: result.messages.length,\n }\n },\n })\n\n const updateChat = tool({\n description: 'Update properties of an existing chat',\n inputSchema: z.object({\n chatId: z.string().describe('ID of the chat to update'),\n name: z.string().optional().describe('New name for the chat'),\n privacy: z\n .enum(['public', 'private', 'team', 'team-edit', 'unlisted'])\n .optional()\n .describe('New privacy setting'),\n }),\n execute: async (params) => {\n const { chatId, name, privacy } = params\n const result = await client.chats.update({ chatId, name, privacy })\n\n return {\n chatId: result.id,\n name: result.name,\n privacy: result.privacy,\n updatedAt: result.updatedAt,\n }\n },\n })\n\n const deleteChat = tool({\n description: 'Delete an existing chat',\n inputSchema: z.object({\n chatId: z.string().describe('ID of the chat to delete'),\n }),\n execute: async (params) => {\n const { chatId } = params\n const result = await client.chats.delete({ chatId })\n\n return {\n chatId: result.id,\n deleted: result.deleted,\n }\n },\n })\n\n const favoriteChat = tool({\n description: 'Toggle favorite status of a chat',\n inputSchema: z.object({\n chatId: z.string().describe('ID of the chat'),\n isFavorite: z.boolean().describe('Whether to mark as favorite or not'),\n }),\n execute: async (params) => {\n const { chatId, isFavorite } = params\n const result = await client.chats.favorite({ chatId, isFavorite })\n\n return {\n chatId: result.id,\n favorited: result.favorited,\n }\n },\n })\n\n const forkChat = tool({\n description: 'Fork an existing chat to create a new version',\n inputSchema: z.object({\n chatId: z.string().describe('ID of the chat to fork'),\n versionId: z\n .string()\n .optional()\n .describe('Specific version ID to fork from'),\n privacy: z\n .enum(['public', 'private', 'team', 'team-edit', 'unlisted'])\n .optional()\n .describe('Privacy setting for the forked chat'),\n }),\n execute: async (params) => {\n const { chatId, versionId, privacy } = params\n const result = await client.chats.fork({ chatId, versionId, privacy })\n\n return {\n originalChatId: chatId,\n newChatId: result.id,\n webUrl: result.webUrl,\n privacy: result.privacy,\n createdAt: result.createdAt,\n }\n },\n })\n\n const listChats = tool({\n description: 'List all chats',\n inputSchema: z.object({\n limit: z.number().optional().describe('Number of chats to return'),\n offset: z.number().optional().describe('Offset for pagination'),\n isFavorite: z.boolean().optional().describe('Filter by favorite status'),\n }),\n execute: async (params) => {\n const { limit, offset, isFavorite } = params\n const result = await client.chats.find({ limit, offset, isFavorite })\n\n return {\n chats: result.data.map((chat) => ({\n chatId: chat.id,\n name: chat.name,\n privacy: chat.privacy,\n webUrl: chat.webUrl,\n favorite: chat.favorite,\n createdAt: chat.createdAt,\n updatedAt: chat.updatedAt,\n })),\n }\n },\n })\n\n return {\n createChat,\n sendMessage,\n getChat,\n updateChat,\n deleteChat,\n favoriteChat,\n forkChat,\n listChats,\n }\n}\n","import { tool } from 'ai'\nimport { z } from 'zod'\nimport { createClient, type V0ClientConfig } from 'v0-sdk'\n\n/**\n * Creates project-related AI SDK tools\n */\nexport function createProjectTools(config: V0ClientConfig = {}) {\n const client = createClient(config)\n\n const createProject = tool({\n description: 'Create a new project in v0',\n inputSchema: z.object({\n name: z.string().describe('Name of the project'),\n description: z.string().optional().describe('Description of the project'),\n icon: z.string().optional().describe('Icon for the project'),\n environmentVariables: z\n .array(\n z.object({\n key: z.string().describe('Environment variable key'),\n value: z.string().describe('Environment variable value'),\n }),\n )\n .optional()\n .describe('Environment variables for the project'),\n instructions: z\n .string()\n .optional()\n .describe('Custom instructions for the project'),\n vercelProjectId: z\n .string()\n .optional()\n .describe('Associated Vercel project ID'),\n privacy: z\n .enum(['private', 'team'])\n .optional()\n .describe('Privacy setting for the project'),\n }),\n execute: async ({\n name,\n description,\n icon,\n environmentVariables,\n instructions,\n vercelProjectId,\n privacy,\n }) => {\n const result = await client.projects.create({\n name,\n description,\n icon,\n environmentVariables,\n instructions,\n vercelProjectId,\n privacy,\n })\n\n return {\n projectId: result.id,\n name: result.name,\n description: result.description,\n privacy: result.privacy,\n webUrl: result.webUrl,\n apiUrl: result.apiUrl,\n createdAt: result.createdAt,\n vercelProjectId: result.vercelProjectId,\n }\n },\n })\n\n const getProject = tool({\n description: 'Get details of an existing project',\n inputSchema: z.object({\n projectId: z.string().describe('ID of the project to retrieve'),\n }),\n execute: async (params) => {\n const { projectId } = params\n const result = await client.projects.getById({ projectId })\n\n return {\n projectId: result.id,\n name: result.name,\n description: result.description,\n instructions: result.instructions,\n privacy: result.privacy,\n webUrl: result.webUrl,\n apiUrl: result.apiUrl,\n createdAt: result.createdAt,\n updatedAt: result.updatedAt,\n vercelProjectId: result.vercelProjectId,\n chatsCount: result.chats.length,\n }\n },\n })\n\n const updateProject = tool({\n description: 'Update properties of an existing project',\n inputSchema: z.object({\n projectId: z.string().describe('ID of the project to update'),\n name: z.string().optional().describe('New name for the project'),\n description: z\n .string()\n .optional()\n .describe('New description for the project'),\n instructions: z\n .string()\n .optional()\n .describe('New instructions for the project'),\n privacy: z\n .enum(['private', 'team'])\n .optional()\n .describe('New privacy setting'),\n }),\n execute: async ({\n projectId,\n name,\n description,\n instructions,\n privacy,\n }) => {\n const result = await client.projects.update({\n projectId,\n name,\n description,\n instructions,\n privacy,\n })\n\n return {\n projectId: result.id,\n name: result.name,\n description: result.description,\n instructions: result.instructions,\n privacy: result.privacy,\n updatedAt: result.updatedAt,\n }\n },\n })\n\n const listProjects = tool({\n description: 'List all projects',\n inputSchema: z.object({}),\n execute: async () => {\n const result = await client.projects.find()\n\n return {\n projects: result.data.map((project) => ({\n projectId: project.id,\n name: project.name,\n privacy: project.privacy,\n webUrl: project.webUrl,\n createdAt: project.createdAt,\n updatedAt: project.updatedAt,\n vercelProjectId: project.vercelProjectId,\n })),\n }\n },\n })\n\n const assignChatToProject = tool({\n description: 'Assign a chat to a project',\n inputSchema: z.object({\n projectId: z.string().describe('ID of the project'),\n chatId: z.string().describe('ID of the chat to assign'),\n }),\n execute: async (params) => {\n const { projectId, chatId } = params\n const result = await client.projects.assign({ projectId, chatId })\n\n return {\n projectId: result.id,\n assigned: result.assigned,\n }\n },\n })\n\n const getProjectByChat = tool({\n description: 'Get project details by chat ID',\n inputSchema: z.object({\n chatId: z.string().describe('ID of the chat'),\n }),\n execute: async (params) => {\n const { chatId } = params\n const result = await client.projects.getByChatId({ chatId })\n\n return {\n projectId: result.id,\n name: result.name,\n description: result.description,\n privacy: result.privacy,\n webUrl: result.webUrl,\n createdAt: result.createdAt,\n chatsCount: result.chats.length,\n }\n },\n })\n\n // Environment Variables Tools\n const createEnvironmentVariables = tool({\n description: 'Create environment variables for a project',\n inputSchema: z.object({\n projectId: z.string().describe('ID of the project'),\n environmentVariables: z\n .array(\n z.object({\n key: z.string().describe('Environment variable key'),\n value: z.string().describe('Environment variable value'),\n }),\n )\n .describe('Environment variables to create'),\n upsert: z\n .boolean()\n .optional()\n .describe('Whether to upsert existing variables'),\n decrypted: z\n .boolean()\n .optional()\n .describe('Whether to return decrypted values'),\n }),\n execute: async (params) => {\n const { projectId, environmentVariables, upsert, decrypted } = params\n const result = await client.projects.createEnvVars({\n projectId,\n environmentVariables,\n upsert,\n decrypted,\n })\n\n return {\n environmentVariables: result.data.map((envVar) => ({\n id: envVar.id,\n key: envVar.key,\n value: envVar.value,\n decrypted: envVar.decrypted,\n createdAt: envVar.createdAt,\n })),\n }\n },\n })\n\n const listEnvironmentVariables = tool({\n description: 'List environment variables for a project',\n inputSchema: z.object({\n projectId: z.string().describe('ID of the project'),\n decrypted: z\n .boolean()\n .optional()\n .describe('Whether to return decrypted values'),\n }),\n execute: async (params) => {\n const { projectId, decrypted } = params\n const result = await client.projects.findEnvVars({\n projectId,\n decrypted,\n })\n\n return {\n environmentVariables: result.data.map((envVar) => ({\n id: envVar.id,\n key: envVar.key,\n value: envVar.value,\n decrypted: envVar.decrypted,\n createdAt: envVar.createdAt,\n updatedAt: envVar.updatedAt,\n })),\n }\n },\n })\n\n const updateEnvironmentVariables = tool({\n description: 'Update environment variables for a project',\n inputSchema: z.object({\n projectId: z.string().describe('ID of the project'),\n environmentVariables: z\n .array(\n z.object({\n id: z.string().describe('Environment variable ID'),\n value: z.string().describe('New environment variable value'),\n }),\n )\n .describe('Environment variables to update'),\n decrypted: z\n .boolean()\n .optional()\n .describe('Whether to return decrypted values'),\n }),\n execute: async (params) => {\n const { projectId, environmentVariables, decrypted } = params\n const result = await client.projects.updateEnvVars({\n projectId,\n environmentVariables,\n decrypted,\n })\n\n return {\n environmentVariables: result.data.map((envVar) => ({\n id: envVar.id,\n key: envVar.key,\n value: envVar.value,\n decrypted: envVar.decrypted,\n updatedAt: envVar.updatedAt,\n })),\n }\n },\n })\n\n const deleteEnvironmentVariables = tool({\n description: 'Delete environment variables from a project',\n inputSchema: z.object({\n projectId: z.string().describe('ID of the project'),\n environmentVariableIds: z\n .array(z.string())\n .describe('IDs of environment variables to delete'),\n }),\n execute: async (params) => {\n const { projectId, environmentVariableIds } = params\n const result = await client.projects.deleteEnvVars({\n projectId,\n environmentVariableIds,\n })\n\n return {\n deletedVariables: result.data.map((envVar) => ({\n id: envVar.id,\n deleted: envVar.deleted,\n })),\n }\n },\n })\n\n return {\n createProject,\n getProject,\n updateProject,\n listProjects,\n assignChatToProject,\n getProjectByChat,\n createEnvironmentVariables,\n listEnvironmentVariables,\n updateEnvironmentVariables,\n deleteEnvironmentVariables,\n }\n}\n","import { tool } from 'ai'\nimport { z } from 'zod'\nimport { createClient, type V0ClientConfig } from 'v0-sdk'\n\n/**\n * Creates deployment-related AI SDK tools\n */\nexport function createDeploymentTools(config: V0ClientConfig = {}) {\n const client = createClient(config)\n\n const createDeployment = tool({\n description: 'Create a new deployment from a chat version',\n inputSchema: z.object({\n projectId: z.string().describe('ID of the project to deploy to'),\n chatId: z.string().describe('ID of the chat to deploy'),\n versionId: z.string().describe('ID of the specific version to deploy'),\n }),\n execute: async (params) => {\n const { projectId, chatId, versionId } = params\n const result = await client.deployments.create({\n projectId,\n chatId,\n versionId,\n })\n\n return {\n deploymentId: result.id,\n projectId: result.projectId,\n chatId: result.chatId,\n versionId: result.versionId,\n inspectorUrl: result.inspectorUrl,\n webUrl: result.webUrl,\n apiUrl: result.apiUrl,\n }\n },\n })\n\n const getDeployment = tool({\n description: 'Get details of an existing deployment',\n inputSchema: z.object({\n deploymentId: z.string().describe('ID of the deployment to retrieve'),\n }),\n execute: async (params) => {\n const { deploymentId } = params\n const result = await client.deployments.getById({ deploymentId })\n\n return {\n deploymentId: result.id,\n projectId: result.projectId,\n chatId: result.chatId,\n versionId: result.versionId,\n inspectorUrl: result.inspectorUrl,\n webUrl: result.webUrl,\n apiUrl: result.apiUrl,\n }\n },\n })\n\n const deleteDeployment = tool({\n description: 'Delete an existing deployment',\n inputSchema: z.object({\n deploymentId: z.string().describe('ID of the deployment to delete'),\n }),\n execute: async (params) => {\n const { deploymentId } = params\n const result = await client.deployments.delete({ deploymentId })\n\n return {\n deploymentId: result.id,\n deleted: result.deleted,\n }\n },\n })\n\n const listDeployments = tool({\n description: 'List deployments by project, chat, and version',\n inputSchema: z.object({\n projectId: z.string().describe('ID of the project'),\n chatId: z.string().describe('ID of the chat'),\n versionId: z.string().describe('ID of the version'),\n }),\n execute: async (params) => {\n const { projectId, chatId, versionId } = params\n const result = await client.deployments.find({\n projectId,\n chatId,\n versionId,\n })\n\n return {\n deployments: result.data.map((deployment) => ({\n deploymentId: deployment.id,\n projectId: deployment.projectId,\n chatId: deployment.chatId,\n versionId: deployment.versionId,\n inspectorUrl: deployment.inspectorUrl,\n webUrl: deployment.webUrl,\n apiUrl: deployment.apiUrl,\n })),\n }\n },\n })\n\n const getDeploymentLogs = tool({\n description: 'Get logs for a deployment',\n inputSchema: z.object({\n deploymentId: z.string().describe('ID of the deployment'),\n since: z.number().optional().describe('Timestamp to get logs since'),\n }),\n execute: async (params) => {\n const { deploymentId, since } = params\n const result = await client.deployments.findLogs({\n deploymentId,\n since,\n })\n\n return {\n logs: result.logs,\n nextSince: result.nextSince,\n }\n },\n })\n\n const getDeploymentErrors = tool({\n description: 'Get errors for a deployment',\n inputSchema: z.object({\n deploymentId: z.string().describe('ID of the deployment'),\n }),\n execute: async (params) => {\n const { deploymentId } = params\n const result = await client.deployments.findErrors({ deploymentId })\n\n return {\n error: result.error,\n fullErrorText: result.fullErrorText,\n errorType: result.errorType,\n formattedError: result.formattedError,\n }\n },\n })\n\n return {\n createDeployment,\n getDeployment,\n deleteDeployment,\n listDeployments,\n getDeploymentLogs,\n getDeploymentErrors,\n }\n}\n","import { tool } from 'ai'\nimport { z } from 'zod'\nimport { createClient, type V0ClientConfig } from 'v0-sdk'\n\n/**\n * Creates user-related AI SDK tools\n */\nexport function createUserTools(config: V0ClientConfig = {}) {\n const client = createClient(config)\n\n const getCurrentUser = tool({\n description: 'Get current user information',\n inputSchema: z.object({}),\n execute: async () => {\n const result = await client.user.get()\n\n return {\n userId: result.id,\n name: result.name,\n email: result.email,\n avatar: result.avatar,\n }\n },\n })\n\n const getUserBilling = tool({\n description: 'Get current user billing information',\n inputSchema: z.object({\n scope: z.string().optional().describe('Scope for billing information'),\n }),\n execute: async (params) => {\n const { scope } = params\n const result = await client.user.getBilling({ scope })\n\n if (result.billingType === 'token') {\n return {\n billingType: result.billingType,\n plan: result.data.plan,\n role: result.data.role,\n billingMode: result.data.billingMode,\n billingCycle: {\n start: result.data.billingCycle.start,\n end: result.data.billingCycle.end,\n },\n balance: {\n remaining: result.data.balance.remaining,\n total: result.data.balance.total,\n },\n onDemand: {\n balance: result.data.onDemand.balance,\n blocks: result.data.onDemand.blocks,\n },\n }\n } else {\n return {\n billingType: result.billingType,\n remaining: result.data.remaining,\n reset: result.data.reset,\n limit: result.data.limit,\n }\n }\n },\n })\n\n const getUserPlan = tool({\n description: 'Get current user plan information',\n inputSchema: z.object({}),\n execute: async () => {\n const result = await client.user.getPlan()\n\n return {\n plan: result.plan,\n billingCycle: {\n start: result.billingCycle.start,\n end: result.billingCycle.end,\n },\n balance: {\n remaining: result.balance.remaining,\n total: result.balance.total,\n },\n }\n },\n })\n\n const getUserScopes = tool({\n description: 'Get user scopes/permissions',\n inputSchema: z.object({}),\n execute: async () => {\n const result = await client.user.getScopes()\n\n return {\n scopes: result.data.map((scope) => ({\n id: scope.id,\n name: scope.name,\n })),\n }\n },\n })\n\n const getRateLimits = tool({\n description: 'Get current rate limit information',\n inputSchema: z.object({\n scope: z.string().optional().describe('Scope for rate limit information'),\n }),\n execute: async (params) => {\n const { scope } = params\n const result = await client.rateLimits.find({ scope })\n\n return {\n remaining: result.remaining,\n reset: result.reset,\n limit: result.limit,\n }\n },\n })\n\n return {\n getCurrentUser,\n getUserBilling,\n getUserPlan,\n getUserScopes,\n getRateLimits,\n }\n}\n","import { tool } from 'ai'\nimport { z } from 'zod'\nimport { createClient, type V0ClientConfig } from 'v0-sdk'\n\n/**\n * Creates webhook-related AI SDK tools\n */\nexport function createHookTools(config: V0ClientConfig = {}) {\n const client = createClient(config)\n\n const createHook = tool({\n description: 'Create a new webhook for v0 events',\n inputSchema: z.object({\n name: z.string().describe('Name of the webhook'),\n url: z.string().describe('URL to send webhook events to'),\n events: z\n .array(\n z.enum([\n 'chat.created',\n 'chat.updated',\n 'chat.deleted',\n 'message.created',\n 'message.updated',\n 'message.deleted',\n ]),\n )\n .describe('Events to listen for'),\n chatId: z\n .string()\n .optional()\n .describe('Specific chat ID to listen to events for'),\n }),\n execute: async (params) => {\n const { name, url, events, chatId } = params\n const result = await client.hooks.create({\n name,\n url,\n events,\n chatId,\n })\n\n return {\n hookId: result.id,\n name: result.name,\n url: result.url,\n events: result.events,\n chatId: result.chatId,\n }\n },\n })\n\n const getHook = tool({\n description: 'Get details of an existing webhook',\n inputSchema: z.object({\n hookId: z.string().describe('ID of the webhook to retrieve'),\n }),\n execute: async (params) => {\n const { hookId } = params\n const result = await client.hooks.getById({ hookId })\n\n return {\n hookId: result.id,\n name: result.name,\n url: result.url,\n events: result.events,\n chatId: result.chatId,\n }\n },\n })\n\n const updateHook = tool({\n description: 'Update properties of an existing webhook',\n inputSchema: z.object({\n hookId: z.string().describe('ID of the webhook to update'),\n name: z.string().optional().describe('New name for the webhook'),\n url: z.string().optional().describe('New URL for the webhook'),\n events: z\n .array(\n z.enum([\n 'chat.created',\n 'chat.updated',\n 'chat.deleted',\n 'message.created',\n 'message.updated',\n 'message.deleted',\n ]),\n )\n .optional()\n .describe('New events to listen for'),\n }),\n execute: async (params) => {\n const { hookId, name, url, events } = params\n const result = await client.hooks.update({\n hookId,\n name,\n url,\n events,\n })\n\n return {\n hookId: result.id,\n name: result.name,\n url: result.url,\n events: result.events,\n chatId: result.chatId,\n }\n },\n })\n\n const deleteHook = tool({\n description: 'Delete an existing webhook',\n inputSchema: z.object({\n hookId: z.string().describe('ID of the webhook to delete'),\n }),\n execute: async (params) => {\n const { hookId } = params\n const result = await client.hooks.delete({ hookId })\n\n return {\n hookId: result.id,\n deleted: result.deleted,\n }\n },\n })\n\n const listHooks = tool({\n description: 'List all webhooks',\n inputSchema: z.object({}),\n execute: async () => {\n const result = await client.hooks.find()\n\n return {\n hooks: result.data.map((hook) => ({\n hookId: hook.id,\n name: hook.name,\n })),\n }\n },\n })\n\n return {\n createHook,\n getHook,\n updateHook,\n deleteHook,\n listHooks,\n }\n}\n","import type { V0ToolsConfig } from './types'\nimport { createChatTools } from './tools/chat-tools'\nimport { createProjectTools } from './tools/project-tools'\nimport { createDeploymentTools } from './tools/deployment-tools'\nimport { createUserTools } from './tools/user-tools'\nimport { createHookTools } from './tools/hook-tools'\n\n/**\n * Creates all v0 AI SDK tools as a flat object.\n *\n * ⚠️ Note: This includes ALL available tools (~20+ tools) which adds significant context.\n * Consider using v0ToolsByCategory() to select only the tools you need.\n *\n * @param config Configuration for v0 client\n * @returns Flat object with all v0 tools ready to use with AI SDK\n *\n * @example\n * ```typescript\n * import { generateText } from 'ai'\n * import { v0Tools } from '@v0-sdk/ai-tools'\n *\n * const result = await generateText({\n * model: 'openai/gpt-4',\n * prompt: 'Create a new React component',\n * tools: v0Tools({\n * apiKey: process.env.V0_API_KEY\n * })\n * })\n * ```\n */\nexport function v0Tools(config: V0ToolsConfig = {}) {\n // Use environment variable if apiKey not provided\n const clientConfig = {\n ...config,\n apiKey: config.apiKey || process.env.V0_API_KEY,\n }\n\n const chatTools = createChatTools(clientConfig)\n const projectTools = createProjectTools(clientConfig)\n const deploymentTools = createDeploymentTools(clientConfig)\n const userTools = createUserTools(clientConfig)\n const hookTools = createHookTools(clientConfig)\n\n return {\n ...chatTools,\n ...projectTools,\n ...deploymentTools,\n ...userTools,\n ...hookTools,\n }\n}\n\n/**\n * Creates v0 tools organized by category for selective usage (recommended).\n * This allows you to include only the tools you need, reducing context size.\n *\n * @param config Configuration for v0 client\n * @returns Object containing all v0 tools organized by category\n *\n * @example\n * ```typescript\n * import { generateText } from 'ai'\n * import { v0ToolsByCategory } from '@v0-sdk/ai-tools'\n *\n * const tools = v0ToolsByCategory({\n * apiKey: process.env.V0_API_KEY\n * })\n *\n * // Only include chat and project tools\n * const result = await generateText({\n * model: 'openai/gpt-4',\n * prompt: 'Create a new React component',\n * tools: {\n * ...tools.chat,\n * ...tools.project\n * }\n * })\n * ```\n */\nexport function v0ToolsByCategory(config: V0ToolsConfig = {}) {\n // Use environment variable if apiKey not provided\n const clientConfig = {\n ...config,\n apiKey: config.apiKey || process.env.V0_API_KEY,\n }\n\n return {\n /**\n * Chat-related tools for creating, managing, and interacting with v0 chats\n */\n chat: createChatTools(clientConfig),\n\n /**\n * Project-related tools for creating and managing v0 projects\n */\n project: createProjectTools(clientConfig),\n\n /**\n * Deployment-related tools for creating and managing deployments\n */\n deployment: createDeploymentTools(clientConfig),\n\n /**\n * User-related tools for getting user information, billing, and rate limits\n */\n user: createUserTools(clientConfig),\n\n /**\n * Webhook tools for creating and managing event hooks\n */\n hook: createHookTools(clientConfig),\n }\n}\n\n/**\n * @deprecated Use v0Tools instead (now returns flat structure by default)\n */\nexport function v0ToolsFlat(config: V0ToolsConfig = {}) {\n return v0Tools(config)\n}\n\n// Export individual tool creators for more granular usage\nexport { createChatTools } from './tools/chat-tools'\nexport { createProjectTools } from './tools/project-tools'\nexport { createDeploymentTools } from './tools/deployment-tools'\nexport { createUserTools } from './tools/user-tools'\nexport { createHookTools } from './tools/hook-tools'\n\n// Export types\nexport type { V0ToolsConfig } from './types'\n\n// Default export\nexport default v0Tools\n"],"names":[],"mappings":";;;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACXA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpKA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1IA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxEA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzEA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;"}
|
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@v0-sdk/ai-tools",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "AI SDK tools for the v0 Platform API",
|
|
5
5
|
"homepage": "https://v0.dev/docs/api",
|
|
6
6
|
"repository": {
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"license": "Apache-2.0",
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"zod": "^3.23.8",
|
|
35
|
-
"v0-sdk": "0.
|
|
35
|
+
"v0-sdk": "0.15.0"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@types/node": "^22.12.0",
|