From 86b1226360475cc68747d3d6e101967afeba1dfa Mon Sep 17 00:00:00 2001 From: ctate <366502+ctate@users.noreply.github.com> Date: Fri, 17 Apr 2026 03:04:02 +0000 Subject: [PATCH] chore: update SDK from OpenAPI spec --- packages/v0-sdk/openapi.json | 687 ++++++++++++++++++++++++++++++++++ packages/v0-sdk/src/index.ts | 4 + packages/v0-sdk/src/sdk/v0.ts | 223 ++++++++++- 3 files changed, 911 insertions(+), 3 deletions(-) diff --git a/packages/v0-sdk/openapi.json b/packages/v0-sdk/openapi.json index 9e63656..e2b07ea 100644 --- a/packages/v0-sdk/openapi.json +++ b/packages/v0-sdk/openapi.json @@ -84,6 +84,7 @@ "type": "string", "enum": [ "v0-auto", + "v0-opus-4.7", "v0-mini", "v0-pro", "v0-max", @@ -120,6 +121,13 @@ "type": "string" } }, + "attachedSkillIds": { + "description": "Array of skill IDs (from skills.sh) to attach to this chat. Skills provide domain-specific knowledge and instructions that guide the AI. Maximum 3 skills per chat.", + "type": "array", + "items": { + "type": "string" + } + }, "metadata": { "default": {}, "description": "Arbitrary key-value data to attach to the chat. Useful for storing additional data about the chat, such as external user IDs.", @@ -1767,6 +1775,7 @@ "type": "string", "enum": [ "v0-auto", + "v0-opus-4.7", "v0-mini", "v0-pro", "v0-max", @@ -1798,6 +1807,25 @@ "items": { "type": "string" } + }, + "attachedSkillIds": { + "description": "Array of skill IDs (from skills.sh) to attach to this message. Skills provide domain-specific knowledge and instructions that guide the AI. Maximum 3 skills per chat.", + "type": "array", + "items": { + "type": "string" + } + }, + "action": { + "description": "An optional action to perform. Use `fix-with-v0` to trigger automatic error fixing — the message should contain the error logs or context to fix.", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "fix-with-v0" + } + }, + "required": ["type"], + "additionalProperties": false } }, "required": ["message"], @@ -3077,6 +3105,400 @@ ] } }, + "/chats/{chatId}/tasks/resolve": { + "post": { + "summary": "Resolve Task", + "description": "Resolves a pending task in a chat, continuing the conversation. The latest message in the active chat fork must be an assistant message currently blocked on a matching task (integration setup, plan approval, question answers, or permission grants).", + "operationId": "chats.resolveTask", + "tags": ["chats"], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "task": { + "anyOf": [ + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "confirmed-steps" + }, + "connectedIntegrationNames": { + "default": [], + "description": "Names of integrations that were successfully connected (e.g. \"Neon\", \"Supabase\"). Pass an empty array to skip.", + "type": "array", + "items": { + "type": "string", + "enum": [ + "Upstash for Redis", + "Upstash Search", + "Neon", + "Supabase", + "Amazon Aurora DSQL", + "Amazon Aurora PostgreSQL", + "Amazon DynamoDB", + "firebase", + "Groq", + "Grok", + "fal", + "Deep Infra", + "Stripe", + "Clerk", + "Convex", + "Blob", + "Edge Config", + "Vercel AI Gateway", + "Snowflake" + ] + } + }, + "connectedMcpPresetNames": { + "default": [], + "description": "Names of MCP presets that were connected (e.g. \"Linear\", \"Sentry\"). Pass an empty array to skip.", + "type": "array", + "items": { + "type": "string", + "enum": [ + "Linear", + "Notion", + "Context7", + "Sentry", + "Zapier", + "Glean", + "Hex", + "Sanity", + "Granola", + "PostHog", + "Contentful", + "Slack" + ] + } + }, + "appliedScripts": { + "default": [], + "description": "Names of scripts that were applied.", + "type": "array", + "items": { + "type": "string", + "minLength": 1 + } + }, + "addedEnvVars": { + "default": [], + "description": "Names of environment variables that were added.", + "type": "array", + "items": { + "type": "string", + "minLength": 1 + } + } + }, + "required": ["type"], + "additionalProperties": false, + "description": "Resolves an integration installation task. The agent asked the user to install integrations, MCP presets, or set environment variables. Send this after provisioning the integration on Vercel." + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "plan-exit-response" + }, + "status": { + "type": "string", + "enum": ["approved", "rejected", "request-changes"], + "description": "Whether the plan is approved, rejected, or needs changes." + }, + "content": { + "type": "string", + "minLength": 1, + "description": "Feedback or instructions for the agent." + } + }, + "required": ["type", "status", "content"], + "additionalProperties": false, + "description": "Resolves a plan review task. The agent proposed an implementation plan and is waiting for approval." + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "answered-questions" + }, + "answers": { + "type": "array", + "items": { + "type": "object", + "properties": { + "questionId": { + "type": "string", + "minLength": 1, + "description": "The ID of the question being answered." + }, + "questionText": { + "type": "string", + "minLength": 1, + "description": "The text of the question being answered." + }, + "selectedLabels": { + "type": "array", + "items": { + "type": "string", + "minLength": 1 + }, + "description": "The labels of the selected options. For single-select questions, pass one item." + }, + "customText": { + "description": "Free-form text input, used when the user selects \"Other\" or wants to add context.", + "type": "string", + "minLength": 1 + } + }, + "required": [ + "questionId", + "questionText", + "selectedLabels" + ], + "additionalProperties": false + }, + "description": "Answers to the questions the agent asked." + } + }, + "required": ["type", "answers"], + "additionalProperties": false, + "description": "Resolves a question task. The agent asked the user one or more multiple-choice questions." + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "confirmed-permissions" + }, + "permissions": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "ALLOW_DYNAMIC_TOOL_STRICT" + }, + "toolName": { + "type": "string", + "minLength": 1, + "description": "The name of the tool being permitted." + }, + "input": { + "description": "The tool call input arguments. Pass the exact input from the stopped task." + }, + "taskNameActive": { + "description": "Label shown while the tool is running (e.g. \"Running migration\").", + "anyOf": [ + { + "type": "string", + "minLength": 1 + }, + { + "type": "null" + } + ] + }, + "taskNameComplete": { + "description": "Label shown after the tool completes (e.g. \"Migration complete\").", + "anyOf": [ + { + "type": "string", + "minLength": 1 + }, + { + "type": "null" + } + ] + }, + "userMessage": { + "description": "Optional message from the user about this permission.", + "type": "string", + "minLength": 1 + } + }, + "required": ["type", "toolName", "input"], + "additionalProperties": false + }, + "description": "The permissions to grant. Pass the suggestedPermissions from the stopped task." + }, + "userMessage": { + "description": "Optional message from the user about the permission grant.", + "type": "string", + "minLength": 1 + } + }, + "required": ["type", "permissions"], + "additionalProperties": false, + "description": "Resolves a permission request task. The agent wants to execute a tool (shell command, script, MCP call) and needs approval. Also used to resolve environment variable prompts." + } + ], + "description": "The task resolution data. The latest message in the active chat fork must be an assistant message blocked on the matching task type." + }, + "responseMode": { + "default": "sync", + "description": "Controls how the response is delivered.\n\n- `\"sync\"`: The response is returned immediately with the HTTP request.\n- `\"async\"`: Returns a message placeholder immediately; use getById to poll for completion status and final output.\n- `\"experimental_stream\"`: Returns content parts as Server-Sent Events for real-time streaming.", + "type": "string", + "enum": ["sync", "async", "experimental_stream"] + }, + "modelConfiguration": { + "description": "Overrides for the model behavior.", + "type": "object", + "properties": { + "modelId": { + "default": "v0-pro", + "description": "Deprecated Model ID field preserved for backward compatibility.", + "deprecated": true, + "type": "string", + "enum": [ + "v0-auto", + "v0-opus-4.7", + "v0-mini", + "v0-pro", + "v0-max", + "v0-max-fast" + ] + }, + "imageGenerations": { + "default": false, + "type": "boolean", + "description": "Enables image generations to generate up to 5 images per version." + }, + "thinking": { + "default": false, + "type": "boolean", + "description": "Enables thinking to generate a response in multiple steps." + } + }, + "additionalProperties": false + } + }, + "required": ["task"], + "additionalProperties": false + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ChatDetail" + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedError" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenError" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundError" + } + } + } + }, + "409": { + "description": "Conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConflictError" + } + } + } + }, + "413": { + "description": "Payload Too Large", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PayloadTooLargeError" + } + } + } + }, + "422": { + "description": "Unprocessable Entity", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnprocessableEntityError" + } + } + } + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TooManyRequestsError" + } + } + } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InternalServerError" + } + } + } + } + }, + "parameters": [ + { + "name": "chatId", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "The unique identifier of the chat containing the pending task. Provided as a path parameter." + } + ], + "security": [ + { + "apiKey": [] + } + ] + } + }, "/deployments": { "get": { "summary": "Find Deployments", @@ -7500,6 +7922,258 @@ ] } }, + "/reports/usage/ai": { + "get": { + "summary": "Get AI Usage Report", + "description": "Retrieves v0 AI usage events for the authenticated user or active team scope.", + "operationId": "reports.getAIUsage", + "tags": ["reports"], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "object": { + "type": "string", + "const": "list" + }, + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "eventId": { + "type": "string" + }, + "modelId": { + "type": "string" + }, + "inputTokens": { + "type": "number" + }, + "outputTokens": { + "type": "number" + }, + "totalTokens": { + "type": "number" + }, + "cacheCreationInputTokens": { + "type": "number" + }, + "cacheReadInputTokens": { + "type": "number" + }, + "timestamp": { + "type": "string" + }, + "requestId": { + "type": "string" + }, + "useCase": { + "type": "string" + }, + "chatId": { + "type": "string" + }, + "messageId": { + "type": "string" + }, + "userId": { + "type": "string" + }, + "userEmail": { + "type": "string" + } + }, + "required": [ + "eventId", + "modelId", + "inputTokens", + "outputTokens", + "totalTokens", + "cacheCreationInputTokens", + "cacheReadInputTokens", + "timestamp", + "requestId", + "useCase", + "chatId", + "messageId", + "userId", + "userEmail" + ], + "additionalProperties": false + } + }, + "pagination": { + "type": "object", + "properties": { + "nextCursor": { + "type": ["string", "null"] + } + }, + "required": ["nextCursor"], + "additionalProperties": false + }, + "dateRange": { + "type": "object", + "properties": { + "start": { + "type": ["string", "null"] + }, + "end": { + "type": ["string", "null"] + } + }, + "required": ["start", "end"], + "additionalProperties": false + } + }, + "required": ["object", "data", "pagination", "dateRange"], + "additionalProperties": false + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedError" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenError" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundError" + } + } + } + }, + "409": { + "description": "Conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConflictError" + } + } + } + }, + "413": { + "description": "Payload Too Large", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PayloadTooLargeError" + } + } + } + }, + "422": { + "description": "Unprocessable Entity", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnprocessableEntityError" + } + } + } + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TooManyRequestsError" + } + } + } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InternalServerError" + } + } + } + } + }, + "parameters": [ + { + "name": "start", + "in": "query", + "required": false, + "schema": { + "description": "Inclusive start datetime filter.", + "type": "string", + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$" + }, + "description": "Inclusive start datetime filter." + }, + { + "name": "end", + "in": "query", + "required": false, + "schema": { + "description": "Exclusive end datetime filter.", + "type": "string", + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$" + }, + "description": "Exclusive end datetime filter." + }, + { + "name": "cursor", + "in": "query", + "required": false, + "schema": { + "description": "Opaque cursor returned by a previous request for forward pagination.", + "type": "string" + }, + "description": "Opaque cursor returned by a previous request for forward pagination." + }, + { + "name": "limit", + "in": "query", + "required": false, + "schema": { + "default": 1000, + "description": "Maximum number of rows to return.", + "type": "integer", + "minimum": 1, + "maximum": 5000 + }, + "description": "Maximum number of rows to return." + } + ], + "security": [ + { + "apiKey": [] + } + ] + } + }, "/reports/user-activity": { "get": { "summary": "Get User Activity Report", @@ -8931,6 +9605,10 @@ "description": "Optional ID of the v0 project associated with this chat.", "type": "string" }, + "vercelProjectId": { + "description": "Optional ID of the linked Vercel project, if connected.", + "type": "string" + }, "webUrl": { "type": "string", "description": "Web URL to view this chat in the browser." @@ -9463,6 +10141,7 @@ "type": "string", "enum": [ "v0-auto", + "v0-opus-4.7", "v0-mini", "v0-pro", "v0-max", @@ -9576,6 +10255,10 @@ "description": "Optional ID of the v0 project associated with this chat.", "type": "string" }, + "vercelProjectId": { + "description": "Optional ID of the linked Vercel project, if connected.", + "type": "string" + }, "webUrl": { "type": "string", "description": "Web URL to view this chat in the browser." @@ -11794,6 +12477,10 @@ "description": "Optional ID of the v0 project associated with this chat.", "type": "string" }, + "vercelProjectId": { + "description": "Optional ID of the linked Vercel project, if connected.", + "type": "string" + }, "webUrl": { "type": "string", "description": "Web URL to view this chat in the browser." diff --git a/packages/v0-sdk/src/index.ts b/packages/v0-sdk/src/index.ts index 7b62e30..edb9b2b 100644 --- a/packages/v0-sdk/src/index.ts +++ b/packages/v0-sdk/src/index.ts @@ -51,6 +51,7 @@ export type { ChatsFavoriteRequest, ChatsForkRequest, ChatsInitRequest, + ChatsResolveTaskRequest, ChatsSendMessageRequest, ChatsUpdateRequest, ChatsUpdateVersionRequest, @@ -81,6 +82,8 @@ export type { ChatsGetMessageResponse, ChatsGetVersionResponse, ChatsInitResponse, + ChatsResolveTaskResponse, + ChatsResolveTaskStreamResponse, ChatsResumeResponse, ChatsSendMessageResponse, ChatsSendMessageStreamResponse, @@ -118,6 +121,7 @@ export type { ProjectsUpdateEnvVarsResponse, ProjectsUpdateResponse, RateLimitsFindResponse, + ReportsGetAIUsageResponse, ReportsGetUsageResponse, ReportsGetUserActivityResponse, UserGetBillingResponse, diff --git a/packages/v0-sdk/src/sdk/v0.ts b/packages/v0-sdk/src/sdk/v0.ts index ababdf6..4b5e1e6 100644 --- a/packages/v0-sdk/src/sdk/v0.ts +++ b/packages/v0-sdk/src/sdk/v0.ts @@ -16,6 +16,7 @@ export type ChatDetail = { favorite: boolean authorId: string projectId?: string + vercelProjectId?: string webUrl: string apiUrl: string latestVersion?: { @@ -95,7 +96,13 @@ export type ChatDetail = { text: string modelConfiguration?: { /** @deprecated */ - modelId?: 'v0-auto' | 'v0-mini' | 'v0-pro' | 'v0-max' | 'v0-max-fast' + modelId?: + | 'v0-auto' + | 'v0-opus-4.7' + | 'v0-mini' + | 'v0-pro' + | 'v0-max' + | 'v0-max-fast' imageGenerations?: boolean thinking?: boolean } @@ -118,6 +125,7 @@ export type ChatSummary = { favorite: boolean authorId: string projectId?: string + vercelProjectId?: string webUrl: string apiUrl: string latestVersion?: { @@ -527,6 +535,7 @@ export type ProjectDetail = { favorite: boolean authorId: string projectId?: string + vercelProjectId?: string webUrl: string apiUrl: string latestVersion?: { @@ -742,13 +751,20 @@ export interface ChatsCreateRequest { projectId?: string modelConfiguration?: { /** @deprecated */ - modelId?: 'v0-auto' | 'v0-mini' | 'v0-pro' | 'v0-max' | 'v0-max-fast' + modelId?: + | 'v0-auto' + | 'v0-opus-4.7' + | 'v0-mini' + | 'v0-pro' + | 'v0-max' + | 'v0-max-fast' imageGenerations?: boolean thinking?: boolean } responseMode?: 'sync' | 'async' | 'experimental_stream' designSystemId?: string | null mcpServerIds?: string[] + attachedSkillIds?: string[] metadata?: Record } @@ -889,12 +905,22 @@ export interface ChatsSendMessageRequest { system?: string modelConfiguration?: { /** @deprecated */ - modelId?: 'v0-auto' | 'v0-mini' | 'v0-pro' | 'v0-max' | 'v0-max-fast' + modelId?: + | 'v0-auto' + | 'v0-opus-4.7' + | 'v0-mini' + | 'v0-pro' + | 'v0-max' + | 'v0-max-fast' imageGenerations?: boolean thinking?: boolean } responseMode?: 'sync' | 'async' | 'experimental_stream' mcpServerIds?: string[] + attachedSkillIds?: string[] + action?: { + type: 'fix-with-v0' + } } export type ChatsSendMessageResponse = ChatDetail @@ -940,6 +966,120 @@ export interface ChatsStopResponse { success: true } +export interface ChatsResolveTaskRequest { + task: + | { + type: 'confirmed-steps' + connectedIntegrationNames?: Array< + | 'Upstash for Redis' + | 'Upstash Search' + | 'Neon' + | 'Supabase' + | 'Amazon Aurora DSQL' + | 'Amazon Aurora PostgreSQL' + | 'Amazon DynamoDB' + | 'firebase' + | 'Groq' + | 'Grok' + | 'fal' + | 'Deep Infra' + | 'Stripe' + | 'Clerk' + | 'Convex' + | 'Blob' + | 'Edge Config' + | 'Vercel AI Gateway' + | 'Snowflake' + > + connectedMcpPresetNames?: Array< + | 'Linear' + | 'Notion' + | 'Context7' + | 'Sentry' + | 'Zapier' + | 'Glean' + | 'Hex' + | 'Sanity' + | 'Granola' + | 'PostHog' + | 'Contentful' + | 'Slack' + > + appliedScripts?: string[] + addedEnvVars?: string[] + status?: never + content?: never + answers?: never + permissions?: never + userMessage?: never + } + | { + type: 'plan-exit-response' + status: 'approved' | 'rejected' | 'request-changes' + content: string + connectedIntegrationNames?: never + connectedMcpPresetNames?: never + appliedScripts?: never + addedEnvVars?: never + answers?: never + permissions?: never + userMessage?: never + } + | { + type: 'answered-questions' + answers: { + questionId: string + questionText: string + selectedLabels: string[] + customText?: string + }[] + connectedIntegrationNames?: never + connectedMcpPresetNames?: never + appliedScripts?: never + addedEnvVars?: never + status?: never + content?: never + permissions?: never + userMessage?: never + } + | { + type: 'confirmed-permissions' + permissions: Array<{ + type: 'ALLOW_DYNAMIC_TOOL_STRICT' + toolName: string + input: unknown + taskNameActive?: string | unknown + taskNameComplete?: string | unknown + userMessage?: string + }> + userMessage?: string + connectedIntegrationNames?: never + connectedMcpPresetNames?: never + appliedScripts?: never + addedEnvVars?: never + status?: never + content?: never + answers?: never + } + responseMode?: 'sync' | 'async' | 'experimental_stream' + modelConfiguration?: { + /** @deprecated */ + modelId?: + | 'v0-auto' + | 'v0-opus-4.7' + | 'v0-mini' + | 'v0-pro' + | 'v0-max' + | 'v0-max-fast' + imageGenerations?: boolean + thinking?: boolean + } +} + +export type ChatsResolveTaskResponse = ChatDetail + +export type ChatsResolveTaskStreamResponse = ReadableStream + export interface DeploymentsFindResponse { object: 'list' data: DeploymentDetail[] @@ -1234,6 +1374,33 @@ export type ReportsGetUsageResponse = { } } +export type ReportsGetAIUsageResponse = { + object: 'list' + data: { + eventId: string + modelId: string + inputTokens: number + outputTokens: number + totalTokens: number + cacheCreationInputTokens: number + cacheReadInputTokens: number + timestamp: string + requestId: string + useCase: string + chatId: string + messageId: string + userId: string + userEmail: string + }[] + pagination: { + nextCursor: string | null + } + dateRange: { + start: string | null + end: string | null + } +} + export type ReportsGetUserActivityResponse = { object: 'list' data: Array<{ @@ -1405,6 +1572,7 @@ export function createClient(config: V0ClientConfig = {}) { responseMode: params.responseMode, designSystemId: params.designSystemId, mcpServerIds: params.mcpServerIds, + attachedSkillIds: params.attachedSkillIds, metadata: params.metadata, } @@ -1527,6 +1695,8 @@ export function createClient(config: V0ClientConfig = {}) { modelConfiguration: params.modelConfiguration, responseMode: params.responseMode, mcpServerIds: params.mcpServerIds, + attachedSkillIds: params.attachedSkillIds, + action: params.action, } if (params.responseMode === 'experimental_stream') { @@ -1695,6 +1865,30 @@ export function createClient(config: V0ClientConfig = {}) { { pathParams }, ) }, + + async resolveTask( + params: { chatId: string } & ChatsResolveTaskRequest, + ): Promise { + const pathParams = { chatId: params.chatId } + const body = { + task: params.task, + responseMode: params.responseMode, + modelConfiguration: params.modelConfiguration, + } + + if (params.responseMode === 'experimental_stream') { + return await streamingFetcher( + `/chats/${pathParams.chatId}/tasks/resolve`, + 'POST', + { pathParams, body }, + ) + } + + return fetcher(`/chats/${pathParams.chatId}/tasks/resolve`, 'POST', { + pathParams, + body, + }) + }, }, projects: { @@ -2100,6 +2294,29 @@ export function createClient(config: V0ClientConfig = {}) { }) }, + async getAIUsage(params?: { + start?: string + end?: string + cursor?: string + limit?: number + }): Promise { + const query = params + ? (Object.fromEntries( + Object.entries({ + start: params.start, + end: params.end, + cursor: params.cursor, + limit: + params.limit !== undefined ? String(params.limit) : undefined, + }).filter(([_, value]) => value !== undefined), + ) as Record) + : {} + const hasQuery = Object.keys(query).length > 0 + return fetcher(`/reports/usage/ai`, 'GET', { + ...(hasQuery ? { query } : {}), + }) + }, + async getUserActivity(params?: { startDate?: string endDate?: string