@v0-sdk/ai-tools 0.2.1 → 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 CHANGED
@@ -654,7 +654,6 @@ var v0Sdk = require('v0-sdk');
654
654
  });
655
655
  return {
656
656
  logs: result.logs,
657
- error: result.error,
658
657
  nextSince: result.nextSince
659
658
  };
660
659
  }
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: {
@@ -89,6 +90,7 @@ declare function createChatTools(config?: V0ClientConfig): {
89
90
  object: "version";
90
91
  status: "pending" | "completed" | "failed";
91
92
  demoUrl?: string;
93
+ screenshotUrl?: string;
92
94
  createdAt: string;
93
95
  updatedAt?: string;
94
96
  files: {
@@ -115,6 +117,7 @@ declare function createChatTools(config?: V0ClientConfig): {
115
117
  object: "version";
116
118
  status: "pending" | "completed" | "failed";
117
119
  demoUrl?: string;
120
+ screenshotUrl?: string;
118
121
  createdAt: string;
119
122
  updatedAt?: string;
120
123
  files: {
@@ -370,8 +373,15 @@ declare function createDeploymentTools(config?: V0ClientConfig): {
370
373
  deploymentId: string;
371
374
  since?: number | undefined;
372
375
  }, {
373
- logs: string[];
374
- error: string | undefined;
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
+ }[];
375
385
  nextSince: number | undefined;
376
386
  }>;
377
387
  getDeploymentErrors: ai.Tool<{
@@ -697,8 +707,15 @@ declare function v0Tools(config?: V0ToolsConfig): {
697
707
  deploymentId: string;
698
708
  since?: number | undefined;
699
709
  }, {
700
- logs: string[];
701
- error: string | undefined;
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
+ }[];
702
719
  nextSince: number | undefined;
703
720
  }>;
704
721
  getDeploymentErrors: ai.Tool<{
@@ -878,6 +895,7 @@ declare function v0Tools(config?: V0ToolsConfig): {
878
895
  object: "version";
879
896
  status: "pending" | "completed" | "failed";
880
897
  demoUrl?: string;
898
+ screenshotUrl?: string;
881
899
  createdAt: string;
882
900
  updatedAt?: string;
883
901
  files: {
@@ -914,6 +932,7 @@ declare function v0Tools(config?: V0ToolsConfig): {
914
932
  object: "version";
915
933
  status: "pending" | "completed" | "failed";
916
934
  demoUrl?: string;
935
+ screenshotUrl?: string;
917
936
  createdAt: string;
918
937
  updatedAt?: string;
919
938
  files: {
@@ -940,6 +959,7 @@ declare function v0Tools(config?: V0ToolsConfig): {
940
959
  object: "version";
941
960
  status: "pending" | "completed" | "failed";
942
961
  demoUrl?: string;
962
+ screenshotUrl?: string;
943
963
  createdAt: string;
944
964
  updatedAt?: string;
945
965
  files: {
@@ -1068,6 +1088,7 @@ declare function v0ToolsByCategory(config?: V0ToolsConfig): {
1068
1088
  object: "version";
1069
1089
  status: "pending" | "completed" | "failed";
1070
1090
  demoUrl?: string;
1091
+ screenshotUrl?: string;
1071
1092
  createdAt: string;
1072
1093
  updatedAt?: string;
1073
1094
  files: {
@@ -1104,6 +1125,7 @@ declare function v0ToolsByCategory(config?: V0ToolsConfig): {
1104
1125
  object: "version";
1105
1126
  status: "pending" | "completed" | "failed";
1106
1127
  demoUrl?: string;
1128
+ screenshotUrl?: string;
1107
1129
  createdAt: string;
1108
1130
  updatedAt?: string;
1109
1131
  files: {
@@ -1130,6 +1152,7 @@ declare function v0ToolsByCategory(config?: V0ToolsConfig): {
1130
1152
  object: "version";
1131
1153
  status: "pending" | "completed" | "failed";
1132
1154
  demoUrl?: string;
1155
+ screenshotUrl?: string;
1133
1156
  createdAt: string;
1134
1157
  updatedAt?: string;
1135
1158
  files: {
@@ -1383,8 +1406,15 @@ declare function v0ToolsByCategory(config?: V0ToolsConfig): {
1383
1406
  deploymentId: string;
1384
1407
  since?: number | undefined;
1385
1408
  }, {
1386
- logs: string[];
1387
- error: string | undefined;
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
+ }[];
1388
1418
  nextSince: number | undefined;
1389
1419
  }>;
1390
1420
  getDeploymentErrors: ai.Tool<{
@@ -1688,8 +1718,15 @@ declare function v0ToolsFlat(config?: V0ToolsConfig): {
1688
1718
  deploymentId: string;
1689
1719
  since?: number | undefined;
1690
1720
  }, {
1691
- logs: string[];
1692
- error: string | undefined;
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
+ }[];
1693
1730
  nextSince: number | undefined;
1694
1731
  }>;
1695
1732
  getDeploymentErrors: ai.Tool<{
@@ -1869,6 +1906,7 @@ declare function v0ToolsFlat(config?: V0ToolsConfig): {
1869
1906
  object: "version";
1870
1907
  status: "pending" | "completed" | "failed";
1871
1908
  demoUrl?: string;
1909
+ screenshotUrl?: string;
1872
1910
  createdAt: string;
1873
1911
  updatedAt?: string;
1874
1912
  files: {
@@ -1905,6 +1943,7 @@ declare function v0ToolsFlat(config?: V0ToolsConfig): {
1905
1943
  object: "version";
1906
1944
  status: "pending" | "completed" | "failed";
1907
1945
  demoUrl?: string;
1946
+ screenshotUrl?: string;
1908
1947
  createdAt: string;
1909
1948
  updatedAt?: string;
1910
1949
  files: {
@@ -1931,6 +1970,7 @@ declare function v0ToolsFlat(config?: V0ToolsConfig): {
1931
1970
  object: "version";
1932
1971
  status: "pending" | "completed" | "failed";
1933
1972
  demoUrl?: string;
1973
+ screenshotUrl?: string;
1934
1974
  createdAt: string;
1935
1975
  updatedAt?: string;
1936
1976
  files: {
@@ -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;;ACjKA;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;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;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;;;"}
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
@@ -652,7 +652,6 @@ import { createClient } from 'v0-sdk';
652
652
  });
653
653
  return {
654
654
  logs: result.logs,
655
- error: result.error,
656
655
  nextSince: result.nextSince
657
656
  };
658
657
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@v0-sdk/ai-tools",
3
- "version": "0.2.1",
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.13.0"
35
+ "v0-sdk": "0.15.0"
36
36
  },
37
37
  "devDependencies": {
38
38
  "@types/node": "^22.12.0",