@v0-sdk/ai-tools 0.2.0 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -61,6 +61,7 @@ declare function createChatTools(config?: V0ClientConfig): {
|
|
|
61
61
|
content: string;
|
|
62
62
|
locked: boolean;
|
|
63
63
|
}[];
|
|
64
|
+
screenshotUrl?: string;
|
|
64
65
|
} | undefined;
|
|
65
66
|
createdAt: string;
|
|
66
67
|
}>;
|
|
@@ -97,6 +98,7 @@ declare function createChatTools(config?: V0ClientConfig): {
|
|
|
97
98
|
content: string;
|
|
98
99
|
locked: boolean;
|
|
99
100
|
}[];
|
|
101
|
+
screenshotUrl?: string;
|
|
100
102
|
} | undefined;
|
|
101
103
|
updatedAt: string | undefined;
|
|
102
104
|
}>;
|
|
@@ -123,6 +125,7 @@ declare function createChatTools(config?: V0ClientConfig): {
|
|
|
123
125
|
content: string;
|
|
124
126
|
locked: boolean;
|
|
125
127
|
}[];
|
|
128
|
+
screenshotUrl?: string;
|
|
126
129
|
} | undefined;
|
|
127
130
|
messagesCount: number;
|
|
128
131
|
}>;
|
|
@@ -886,6 +889,7 @@ declare function v0Tools(config?: V0ToolsConfig): {
|
|
|
886
889
|
content: string;
|
|
887
890
|
locked: boolean;
|
|
888
891
|
}[];
|
|
892
|
+
screenshotUrl?: string;
|
|
889
893
|
} | undefined;
|
|
890
894
|
createdAt: string;
|
|
891
895
|
}>;
|
|
@@ -922,6 +926,7 @@ declare function v0Tools(config?: V0ToolsConfig): {
|
|
|
922
926
|
content: string;
|
|
923
927
|
locked: boolean;
|
|
924
928
|
}[];
|
|
929
|
+
screenshotUrl?: string;
|
|
925
930
|
} | undefined;
|
|
926
931
|
updatedAt: string | undefined;
|
|
927
932
|
}>;
|
|
@@ -948,6 +953,7 @@ declare function v0Tools(config?: V0ToolsConfig): {
|
|
|
948
953
|
content: string;
|
|
949
954
|
locked: boolean;
|
|
950
955
|
}[];
|
|
956
|
+
screenshotUrl?: string;
|
|
951
957
|
} | undefined;
|
|
952
958
|
messagesCount: number;
|
|
953
959
|
}>;
|
|
@@ -1076,6 +1082,7 @@ declare function v0ToolsByCategory(config?: V0ToolsConfig): {
|
|
|
1076
1082
|
content: string;
|
|
1077
1083
|
locked: boolean;
|
|
1078
1084
|
}[];
|
|
1085
|
+
screenshotUrl?: string;
|
|
1079
1086
|
} | undefined;
|
|
1080
1087
|
createdAt: string;
|
|
1081
1088
|
}>;
|
|
@@ -1112,6 +1119,7 @@ declare function v0ToolsByCategory(config?: V0ToolsConfig): {
|
|
|
1112
1119
|
content: string;
|
|
1113
1120
|
locked: boolean;
|
|
1114
1121
|
}[];
|
|
1122
|
+
screenshotUrl?: string;
|
|
1115
1123
|
} | undefined;
|
|
1116
1124
|
updatedAt: string | undefined;
|
|
1117
1125
|
}>;
|
|
@@ -1138,6 +1146,7 @@ declare function v0ToolsByCategory(config?: V0ToolsConfig): {
|
|
|
1138
1146
|
content: string;
|
|
1139
1147
|
locked: boolean;
|
|
1140
1148
|
}[];
|
|
1149
|
+
screenshotUrl?: string;
|
|
1141
1150
|
} | undefined;
|
|
1142
1151
|
messagesCount: number;
|
|
1143
1152
|
}>;
|
|
@@ -1877,6 +1886,7 @@ declare function v0ToolsFlat(config?: V0ToolsConfig): {
|
|
|
1877
1886
|
content: string;
|
|
1878
1887
|
locked: boolean;
|
|
1879
1888
|
}[];
|
|
1889
|
+
screenshotUrl?: string;
|
|
1880
1890
|
} | undefined;
|
|
1881
1891
|
createdAt: string;
|
|
1882
1892
|
}>;
|
|
@@ -1913,6 +1923,7 @@ declare function v0ToolsFlat(config?: V0ToolsConfig): {
|
|
|
1913
1923
|
content: string;
|
|
1914
1924
|
locked: boolean;
|
|
1915
1925
|
}[];
|
|
1926
|
+
screenshotUrl?: string;
|
|
1916
1927
|
} | undefined;
|
|
1917
1928
|
updatedAt: string | undefined;
|
|
1918
1929
|
}>;
|
|
@@ -1939,6 +1950,7 @@ declare function v0ToolsFlat(config?: V0ToolsConfig): {
|
|
|
1939
1950
|
content: string;
|
|
1940
1951
|
locked: boolean;
|
|
1941
1952
|
}[];
|
|
1953
|
+
screenshotUrl?: string;
|
|
1942
1954
|
} | undefined;
|
|
1943
1955
|
messagesCount: number;
|
|
1944
1956
|
}>;
|
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;;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 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;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@v0-sdk/ai-tools",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
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.14.0"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@types/node": "^22.12.0",
|