diff --git a/bun.lock b/bun.lock index 594cdc5b..79bdbde5 100644 --- a/bun.lock +++ b/bun.lock @@ -37,7 +37,7 @@ }, "packages/console/core": { "name": "@opencode-ai/console-core", - "version": "0.15.20", + "version": "0.15.23", "dependencies": { "@aws-sdk/client-sts": "3.782.0", "@jsx-email/render": "1.1.1", @@ -64,7 +64,7 @@ }, "packages/console/function": { "name": "@opencode-ai/console-function", - "version": "0.15.20", + "version": "0.15.23", "dependencies": { "@ai-sdk/anthropic": "2.0.0", "@ai-sdk/openai": "2.0.2", @@ -88,7 +88,7 @@ }, "packages/console/mail": { "name": "@opencode-ai/console-mail", - "version": "0.15.20", + "version": "0.15.23", "dependencies": { "@jsx-email/all": "2.2.3", "@jsx-email/cli": "1.4.3", @@ -109,7 +109,7 @@ }, "packages/desktop": { "name": "@opencode-ai/desktop", - "version": "0.15.20", + "version": "0.15.23", "dependencies": { "@kobalte/core": "catalog:", "@opencode-ai/sdk": "workspace:*", @@ -150,7 +150,7 @@ }, "packages/function": { "name": "@opencode-ai/function", - "version": "0.15.20", + "version": "0.15.23", "dependencies": { "@octokit/auth-app": "8.0.1", "@octokit/rest": "22.0.0", @@ -166,7 +166,7 @@ }, "packages/opencode": { "name": "opencode", - "version": "0.15.20", + "version": "0.15.23", "bin": { "opencode": "./bin/opencode", }, @@ -230,7 +230,7 @@ }, "packages/plugin": { "name": "@opencode-ai/plugin", - "version": "0.15.20", + "version": "0.15.23", "dependencies": { "@opencode-ai/sdk": "workspace:*", "zod": "catalog:", @@ -250,7 +250,7 @@ }, "packages/sdk/js": { "name": "@opencode-ai/sdk", - "version": "0.15.20", + "version": "0.15.23", "devDependencies": { "@hey-api/openapi-ts": "0.81.0", "@tsconfig/node22": "catalog:", @@ -261,7 +261,7 @@ }, "packages/slack": { "name": "@opencode-ai/slack", - "version": "0.15.20", + "version": "0.15.23", "dependencies": { "@opencode-ai/sdk": "workspace:*", "@slack/bolt": "^3.17.1", @@ -274,7 +274,7 @@ }, "packages/ui": { "name": "@opencode-ai/ui", - "version": "0.15.20", + "version": "0.15.23", "dependencies": { "@kobalte/core": "catalog:", "@pierre/precision-diffs": "catalog:", @@ -297,7 +297,7 @@ }, "packages/web": { "name": "@opencode-ai/web", - "version": "0.15.20", + "version": "0.15.23", "dependencies": { "@astrojs/cloudflare": "12.6.3", "@astrojs/markdown-remark": "6.3.1", diff --git a/packages/console/app/package.json b/packages/console/app/package.json index 0f36562b..d9d0d5ca 100644 --- a/packages/console/app/package.json +++ b/packages/console/app/package.json @@ -7,7 +7,7 @@ "dev:remote": "VITE_AUTH_URL=https://auth.dev.opencode.ai bun sst shell --stage=dev bun dev", "build": "vinxi build && ../../opencode/script/schema.ts ./.output/public/config.json", "start": "vinxi start", - "version": "0.15.20" + "version": "0.15.23" }, "dependencies": { "@ibm/plex": "6.4.1", diff --git a/packages/console/core/package.json b/packages/console/core/package.json index 16de536d..1361600b 100644 --- a/packages/console/core/package.json +++ b/packages/console/core/package.json @@ -1,7 +1,7 @@ { "$schema": "https://json.schemastore.org/package.json", "name": "@opencode-ai/console-core", - "version": "0.15.20", + "version": "0.15.23", "private": true, "type": "module", "dependencies": { diff --git a/packages/console/function/package.json b/packages/console/function/package.json index f2cb56d2..6229a530 100644 --- a/packages/console/function/package.json +++ b/packages/console/function/package.json @@ -1,6 +1,6 @@ { "name": "@opencode-ai/console-function", - "version": "0.15.20", + "version": "0.15.23", "$schema": "https://json.schemastore.org/package.json", "private": true, "type": "module", diff --git a/packages/console/mail/package.json b/packages/console/mail/package.json index f93660af..bd54e913 100644 --- a/packages/console/mail/package.json +++ b/packages/console/mail/package.json @@ -1,6 +1,6 @@ { "name": "@opencode-ai/console-mail", - "version": "0.15.20", + "version": "0.15.23", "dependencies": { "@jsx-email/all": "2.2.3", "@jsx-email/cli": "1.4.3", diff --git a/packages/desktop/package.json b/packages/desktop/package.json index 3861c49b..8e5b0167 100644 --- a/packages/desktop/package.json +++ b/packages/desktop/package.json @@ -1,6 +1,6 @@ { "name": "@opencode-ai/desktop", - "version": "0.15.20", + "version": "0.15.23", "description": "", "type": "module", "scripts": { diff --git a/packages/function/package.json b/packages/function/package.json index b1dd969e..837f093b 100644 --- a/packages/function/package.json +++ b/packages/function/package.json @@ -1,6 +1,6 @@ { "name": "@opencode-ai/function", - "version": "0.15.20", + "version": "0.15.23", "$schema": "https://json.schemastore.org/package.json", "private": true, "type": "module", diff --git a/packages/opencode/package.json b/packages/opencode/package.json index c50d4eae..ce7934b1 100644 --- a/packages/opencode/package.json +++ b/packages/opencode/package.json @@ -1,6 +1,6 @@ { "$schema": "https://json.schemastore.org/package.json", - "version": "0.15.20", + "version": "0.15.23", "name": "opencode", "type": "module", "private": true, diff --git a/packages/plugin/package.json b/packages/plugin/package.json index 8f5e6e82..037cdb64 100644 --- a/packages/plugin/package.json +++ b/packages/plugin/package.json @@ -1,7 +1,7 @@ { "$schema": "https://json.schemastore.org/package.json", "name": "@opencode-ai/plugin", - "version": "0.15.20", + "version": "0.15.23", "type": "module", "scripts": { "typecheck": "tsgo --noEmit", @@ -24,4 +24,4 @@ "typescript": "catalog:", "@typescript/native-preview": "catalog:" } -} +} \ No newline at end of file diff --git a/packages/sdk/js/package.json b/packages/sdk/js/package.json index 559ac650..46ceefd0 100644 --- a/packages/sdk/js/package.json +++ b/packages/sdk/js/package.json @@ -1,7 +1,7 @@ { "$schema": "https://json.schemastore.org/package.json", "name": "@opencode-ai/sdk", - "version": "0.15.20", + "version": "0.15.23", "type": "module", "scripts": { "typecheck": "tsgo --noEmit", @@ -26,4 +26,4 @@ "publishConfig": { "directory": "dist" } -} +} \ No newline at end of file diff --git a/packages/sdk/js/src/gen/client.gen.ts b/packages/sdk/js/src/gen/client.gen.ts index e7cdb292..77ef579a 100644 --- a/packages/sdk/js/src/gen/client.gen.ts +++ b/packages/sdk/js/src/gen/client.gen.ts @@ -1,7 +1,12 @@ // This file is auto-generated by @hey-api/openapi-ts import type { ClientOptions } from "./types.gen.js" -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from "./client/index.js" +import { + type Config, + type ClientOptions as DefaultClientOptions, + createClient, + createConfig, +} from "./client/index.js" /** * The `createClientConfig()` function will be called on client initialization diff --git a/packages/sdk/js/src/gen/client/client.gen.ts b/packages/sdk/js/src/gen/client/client.gen.ts index 34a8d0be..3a2499ef 100644 --- a/packages/sdk/js/src/gen/client/client.gen.ts +++ b/packages/sdk/js/src/gen/client/client.gen.ts @@ -107,7 +107,9 @@ export const createClient = (config: Config = {}): Client => { } const parseAs = - (opts.parseAs === "auto" ? getParseAs(response.headers.get("Content-Type")) : opts.parseAs) ?? "json" + (opts.parseAs === "auto" + ? getParseAs(response.headers.get("Content-Type")) + : opts.parseAs) ?? "json" let data: any switch (parseAs) { diff --git a/packages/sdk/js/src/gen/client/types.gen.ts b/packages/sdk/js/src/gen/client/types.gen.ts index db8e544c..1761dacb 100644 --- a/packages/sdk/js/src/gen/client/types.gen.ts +++ b/packages/sdk/js/src/gen/client/types.gen.ts @@ -1,7 +1,10 @@ // This file is auto-generated by @hey-api/openapi-ts import type { Auth } from "../core/auth.gen.js" -import type { ServerSentEventsOptions, ServerSentEventsResult } from "../core/serverSentEvents.gen.js" +import type { + ServerSentEventsOptions, + ServerSentEventsResult, +} from "../core/serverSentEvents.gen.js" import type { Client as CoreClient, Config as CoreConfig } from "../core/types.gen.js" import type { Middleware } from "./utils.gen.js" @@ -62,7 +65,11 @@ export interface RequestOptions< }>, Pick< ServerSentEventsOptions, - "onSseError" | "onSseEvent" | "sseDefaultRetryDelay" | "sseMaxRetryAttempts" | "sseMaxRetryDelay" + | "onSseError" + | "onSseEvent" + | "sseDefaultRetryDelay" + | "sseMaxRetryAttempts" + | "sseMaxRetryDelay" > { /** * Any body that you want to add to your request. @@ -202,7 +209,10 @@ export type Options< ThrowOnError extends boolean = boolean, TResponse = unknown, TResponseStyle extends ResponseStyle = "fields", -> = OmitKeys, "body" | "path" | "query" | "url"> & +> = OmitKeys< + RequestOptions, + "body" | "path" | "query" | "url" +> & Omit export type OptionsLegacyParser< @@ -211,7 +221,8 @@ export type OptionsLegacyParser< TResponseStyle extends ResponseStyle = "fields", > = TData extends { body?: any } ? TData extends { headers?: any } - ? OmitKeys, "body" | "headers" | "url"> & TData + ? OmitKeys, "body" | "headers" | "url"> & + TData : OmitKeys, "body" | "url"> & TData & Pick, "headers"> diff --git a/packages/sdk/js/src/gen/client/utils.gen.ts b/packages/sdk/js/src/gen/client/utils.gen.ts index 209bfbe8..53ffbad1 100644 --- a/packages/sdk/js/src/gen/client/utils.gen.ts +++ b/packages/sdk/js/src/gen/client/utils.gen.ts @@ -3,11 +3,19 @@ import { getAuthToken } from "../core/auth.gen.js" import type { QuerySerializerOptions } from "../core/bodySerializer.gen.js" import { jsonBodySerializer } from "../core/bodySerializer.gen.js" -import { serializeArrayParam, serializeObjectParam, serializePrimitiveParam } from "../core/pathSerializer.gen.js" +import { + serializeArrayParam, + serializeObjectParam, + serializePrimitiveParam, +} from "../core/pathSerializer.gen.js" import { getUrl } from "../core/utils.gen.js" import type { Client, ClientOptions, Config, RequestOptions } from "./types.gen.js" -export const createQuerySerializer = ({ allowReserved, array, object }: QuerySerializerOptions = {}) => { +export const createQuerySerializer = ({ + allowReserved, + array, + object, +}: QuerySerializerOptions = {}) => { const querySerializer = (queryParams: T) => { const search: string[] = [] if (queryParams && typeof queryParams === "object") { @@ -77,7 +85,9 @@ export const getParseAs = (contentType: string | null): Exclude cleanContent.startsWith(type))) { + if ( + ["application/", "audio/", "image/", "video/"].some((type) => cleanContent.startsWith(type)) + ) { return "blob" } @@ -97,7 +107,11 @@ const checkForExistence = ( if (!name) { return false } - if (options.headers.has(name) || options.query?.[name] || options.headers.get("Cookie")?.includes(`${name}=`)) { + if ( + options.headers.has(name) || + options.query?.[name] || + options.headers.get("Cookie")?.includes(`${name}=`) + ) { return true } return false @@ -162,7 +176,9 @@ export const mergeConfigs = (a: Config, b: Config): Config => { return config } -export const mergeHeaders = (...headers: Array["headers"] | undefined>): Headers => { +export const mergeHeaders = ( + ...headers: Array["headers"] | undefined> +): Headers => { const mergedHeaders = new Headers() for (const header of headers) { if (!header || typeof header !== "object") { @@ -181,7 +197,10 @@ export const mergeHeaders = (...headers: Array["headers"] | und } else if (value !== undefined) { // assume object headers are meant to be JSON stringified, i.e. their // content value in OpenAPI specification is 'application/json' - mergedHeaders.set(key, typeof value === "object" ? JSON.stringify(value) : (value as string)) + mergedHeaders.set( + key, + typeof value === "object" ? JSON.stringify(value) : (value as string), + ) } } } @@ -197,7 +216,11 @@ type ErrInterceptor = ( type ReqInterceptor = (request: Req, options: Options) => Req | Promise -type ResInterceptor = (response: Res, request: Req, options: Options) => Res | Promise +type ResInterceptor = ( + response: Res, + request: Req, + options: Options, +) => Res | Promise class Interceptors { _fns: (Interceptor | null)[] diff --git a/packages/sdk/js/src/gen/core/bodySerializer.gen.ts b/packages/sdk/js/src/gen/core/bodySerializer.gen.ts index 06606160..83e3f56d 100644 --- a/packages/sdk/js/src/gen/core/bodySerializer.gen.ts +++ b/packages/sdk/js/src/gen/core/bodySerializer.gen.ts @@ -31,7 +31,9 @@ const serializeUrlSearchParamsPair = (data: URLSearchParams, key: string, value: } export const formDataBodySerializer = { - bodySerializer: | Array>>(body: T): FormData => { + bodySerializer: | Array>>( + body: T, + ): FormData => { const data = new FormData() Object.entries(body).forEach(([key, value]) => { diff --git a/packages/sdk/js/src/gen/core/pathSerializer.gen.ts b/packages/sdk/js/src/gen/core/pathSerializer.gen.ts index 96be3bc5..f1352835 100644 --- a/packages/sdk/js/src/gen/core/pathSerializer.gen.ts +++ b/packages/sdk/js/src/gen/core/pathSerializer.gen.ts @@ -74,9 +74,9 @@ export const serializeArrayParam = ({ value: unknown[] }) => { if (!explode) { - const joinedValues = (allowReserved ? value : value.map((v) => encodeURIComponent(v as string))).join( - separatorArrayNoExplode(style), - ) + const joinedValues = ( + allowReserved ? value : value.map((v) => encodeURIComponent(v as string)) + ).join(separatorArrayNoExplode(style)) switch (style) { case "label": return `.${joinedValues}` @@ -106,7 +106,11 @@ export const serializeArrayParam = ({ return style === "label" || style === "matrix" ? separator + joinedValues : joinedValues } -export const serializePrimitiveParam = ({ allowReserved, name, value }: SerializePrimitiveParam) => { +export const serializePrimitiveParam = ({ + allowReserved, + name, + value, +}: SerializePrimitiveParam) => { if (value === undefined || value === null) { return "" } diff --git a/packages/sdk/js/src/gen/core/serverSentEvents.gen.ts b/packages/sdk/js/src/gen/core/serverSentEvents.gen.ts index 8f7fac54..183855da 100644 --- a/packages/sdk/js/src/gen/core/serverSentEvents.gen.ts +++ b/packages/sdk/js/src/gen/core/serverSentEvents.gen.ts @@ -60,7 +60,11 @@ export interface StreamEvent { } export type ServerSentEventsResult = { - stream: AsyncGenerator ? TData[keyof TData] : TData, TReturn, TNext> + stream: AsyncGenerator< + TData extends Record ? TData[keyof TData] : TData, + TReturn, + TNext + > } export const createSseClient = ({ diff --git a/packages/sdk/js/src/gen/core/types.gen.ts b/packages/sdk/js/src/gen/core/types.gen.ts index 16408b2d..b60604fe 100644 --- a/packages/sdk/js/src/gen/core/types.gen.ts +++ b/packages/sdk/js/src/gen/core/types.gen.ts @@ -1,7 +1,11 @@ // This file is auto-generated by @hey-api/openapi-ts import type { Auth, AuthToken } from "./auth.gen.js" -import type { BodySerializer, QuerySerializer, QuerySerializerOptions } from "./bodySerializer.gen.js" +import type { + BodySerializer, + QuerySerializer, + QuerySerializerOptions, +} from "./bodySerializer.gen.js" export interface Client { /** @@ -41,7 +45,10 @@ export interface Config { */ headers?: | RequestInit["headers"] - | Record + | Record< + string, + string | number | boolean | (string | number | boolean)[] | null | undefined | unknown + > /** * The request method. * diff --git a/packages/sdk/js/src/gen/core/utils.gen.ts b/packages/sdk/js/src/gen/core/utils.gen.ts index be18c608..62e02972 100644 --- a/packages/sdk/js/src/gen/core/utils.gen.ts +++ b/packages/sdk/js/src/gen/core/utils.gen.ts @@ -73,7 +73,9 @@ export const defaultPathSerializer = ({ path, url: _url }: PathSerializer) => { continue } - const replaceValue = encodeURIComponent(style === "label" ? `.${value as string}` : (value as string)) + const replaceValue = encodeURIComponent( + style === "label" ? `.${value as string}` : (value as string), + ) url = url.replace(match, replaceValue) } } diff --git a/packages/sdk/js/src/gen/sdk.gen.ts b/packages/sdk/js/src/gen/sdk.gen.ts index 4f224ea4..42e575dc 100644 --- a/packages/sdk/js/src/gen/sdk.gen.ts +++ b/packages/sdk/js/src/gen/sdk.gen.ts @@ -133,10 +133,10 @@ import type { } from "./types.gen.js" import { client as _heyApiClient } from "./client.gen.js" -export type Options = ClientOptions< - TData, - ThrowOnError -> & { +export type Options< + TData extends TDataShape = TDataShape, + ThrowOnError extends boolean = boolean, +> = ClientOptions & { /** * You can provide a client instance returned by `createClient()` instead of * individual options. This might be also useful if you want to implement a @@ -164,7 +164,9 @@ class Project extends _HeyApiClient { /** * List all projects */ - public list(options?: Options) { + public list( + options?: Options, + ) { return (options?.client ?? this._client).get({ url: "/project", ...options, @@ -174,7 +176,9 @@ class Project extends _HeyApiClient { /** * Get the current project */ - public current(options?: Options) { + public current( + options?: Options, + ) { return (options?.client ?? this._client).get({ url: "/project/current", ...options, @@ -196,8 +200,14 @@ class Config extends _HeyApiClient { /** * Update config */ - public update(options?: Options) { - return (options?.client ?? this._client).patch({ + public update( + options?: Options, + ) { + return (options?.client ?? this._client).patch< + ConfigUpdateResponses, + ConfigUpdateErrors, + ThrowOnError + >({ url: "/config", ...options, headers: { @@ -210,7 +220,9 @@ class Config extends _HeyApiClient { /** * List all providers */ - public providers(options?: Options) { + public providers( + options?: Options, + ) { return (options?.client ?? this._client).get({ url: "/config/providers", ...options, @@ -256,7 +268,9 @@ class Session extends _HeyApiClient { /** * List all sessions */ - public list(options?: Options) { + public list( + options?: Options, + ) { return (options?.client ?? this._client).get({ url: "/session", ...options, @@ -266,8 +280,14 @@ class Session extends _HeyApiClient { /** * Create a new session */ - public create(options?: Options) { - return (options?.client ?? this._client).post({ + public create( + options?: Options, + ) { + return (options?.client ?? this._client).post< + SessionCreateResponses, + SessionCreateErrors, + ThrowOnError + >({ url: "/session", ...options, headers: { @@ -280,8 +300,14 @@ class Session extends _HeyApiClient { /** * Delete a session and all its data */ - public delete(options: Options) { - return (options.client ?? this._client).delete({ + public delete( + options: Options, + ) { + return (options.client ?? this._client).delete< + SessionDeleteResponses, + SessionDeleteErrors, + ThrowOnError + >({ url: "/session/{id}", ...options, }) @@ -291,7 +317,11 @@ class Session extends _HeyApiClient { * Get session */ public get(options: Options) { - return (options.client ?? this._client).get({ + return (options.client ?? this._client).get< + SessionGetResponses, + SessionGetErrors, + ThrowOnError + >({ url: "/session/{id}", ...options, }) @@ -300,8 +330,14 @@ class Session extends _HeyApiClient { /** * Update session properties */ - public update(options: Options) { - return (options.client ?? this._client).patch({ + public update( + options: Options, + ) { + return (options.client ?? this._client).patch< + SessionUpdateResponses, + SessionUpdateErrors, + ThrowOnError + >({ url: "/session/{id}", ...options, headers: { @@ -314,8 +350,14 @@ class Session extends _HeyApiClient { /** * Get a session's children */ - public children(options: Options) { - return (options.client ?? this._client).get({ + public children( + options: Options, + ) { + return (options.client ?? this._client).get< + SessionChildrenResponses, + SessionChildrenErrors, + ThrowOnError + >({ url: "/session/{id}/children", ...options, }) @@ -324,8 +366,14 @@ class Session extends _HeyApiClient { /** * Get the todo list for a session */ - public todo(options: Options) { - return (options.client ?? this._client).get({ + public todo( + options: Options, + ) { + return (options.client ?? this._client).get< + SessionTodoResponses, + SessionTodoErrors, + ThrowOnError + >({ url: "/session/{id}/todo", ...options, }) @@ -334,8 +382,14 @@ class Session extends _HeyApiClient { /** * Analyze the app and create an AGENTS.md file */ - public init(options: Options) { - return (options.client ?? this._client).post({ + public init( + options: Options, + ) { + return (options.client ?? this._client).post< + SessionInitResponses, + SessionInitErrors, + ThrowOnError + >({ url: "/session/{id}/init", ...options, headers: { @@ -348,7 +402,9 @@ class Session extends _HeyApiClient { /** * Fork an existing session at a specific message */ - public fork(options: Options) { + public fork( + options: Options, + ) { return (options.client ?? this._client).post({ url: "/session/{id}/fork", ...options, @@ -362,8 +418,14 @@ class Session extends _HeyApiClient { /** * Abort a session */ - public abort(options: Options) { - return (options.client ?? this._client).post({ + public abort( + options: Options, + ) { + return (options.client ?? this._client).post< + SessionAbortResponses, + SessionAbortErrors, + ThrowOnError + >({ url: "/session/{id}/abort", ...options, }) @@ -372,8 +434,14 @@ class Session extends _HeyApiClient { /** * Unshare the session */ - public unshare(options: Options) { - return (options.client ?? this._client).delete({ + public unshare( + options: Options, + ) { + return (options.client ?? this._client).delete< + SessionUnshareResponses, + SessionUnshareErrors, + ThrowOnError + >({ url: "/session/{id}/share", ...options, }) @@ -382,8 +450,14 @@ class Session extends _HeyApiClient { /** * Share a session */ - public share(options: Options) { - return (options.client ?? this._client).post({ + public share( + options: Options, + ) { + return (options.client ?? this._client).post< + SessionShareResponses, + SessionShareErrors, + ThrowOnError + >({ url: "/session/{id}/share", ...options, }) @@ -392,7 +466,9 @@ class Session extends _HeyApiClient { /** * Get the diff that resulted from this user message */ - public diff(options: Options) { + public diff( + options: Options, + ) { return (options.client ?? this._client).get({ url: "/session/{id}/diff", ...options, @@ -402,8 +478,14 @@ class Session extends _HeyApiClient { /** * Summarize the session */ - public summarize(options: Options) { - return (options.client ?? this._client).post({ + public summarize( + options: Options, + ) { + return (options.client ?? this._client).post< + SessionSummarizeResponses, + SessionSummarizeErrors, + ThrowOnError + >({ url: "/session/{id}/summarize", ...options, headers: { @@ -416,8 +498,14 @@ class Session extends _HeyApiClient { /** * List messages for a session */ - public messages(options: Options) { - return (options.client ?? this._client).get({ + public messages( + options: Options, + ) { + return (options.client ?? this._client).get< + SessionMessagesResponses, + SessionMessagesErrors, + ThrowOnError + >({ url: "/session/{id}/message", ...options, }) @@ -426,8 +514,14 @@ class Session extends _HeyApiClient { /** * Create and send a new message to a session */ - public prompt(options: Options) { - return (options.client ?? this._client).post({ + public prompt( + options: Options, + ) { + return (options.client ?? this._client).post< + SessionPromptResponses, + SessionPromptErrors, + ThrowOnError + >({ url: "/session/{id}/message", ...options, headers: { @@ -440,8 +534,14 @@ class Session extends _HeyApiClient { /** * Get a message from a session */ - public message(options: Options) { - return (options.client ?? this._client).get({ + public message( + options: Options, + ) { + return (options.client ?? this._client).get< + SessionMessageResponses, + SessionMessageErrors, + ThrowOnError + >({ url: "/session/{id}/message/{messageID}", ...options, }) @@ -450,8 +550,14 @@ class Session extends _HeyApiClient { /** * Send a new command to a session */ - public command(options: Options) { - return (options.client ?? this._client).post({ + public command( + options: Options, + ) { + return (options.client ?? this._client).post< + SessionCommandResponses, + SessionCommandErrors, + ThrowOnError + >({ url: "/session/{id}/command", ...options, headers: { @@ -464,8 +570,14 @@ class Session extends _HeyApiClient { /** * Run a shell command */ - public shell(options: Options) { - return (options.client ?? this._client).post({ + public shell( + options: Options, + ) { + return (options.client ?? this._client).post< + SessionShellResponses, + SessionShellErrors, + ThrowOnError + >({ url: "/session/{id}/shell", ...options, headers: { @@ -478,8 +590,14 @@ class Session extends _HeyApiClient { /** * Revert a message */ - public revert(options: Options) { - return (options.client ?? this._client).post({ + public revert( + options: Options, + ) { + return (options.client ?? this._client).post< + SessionRevertResponses, + SessionRevertErrors, + ThrowOnError + >({ url: "/session/{id}/revert", ...options, headers: { @@ -492,8 +610,14 @@ class Session extends _HeyApiClient { /** * Restore all reverted messages */ - public unrevert(options: Options) { - return (options.client ?? this._client).post({ + public unrevert( + options: Options, + ) { + return (options.client ?? this._client).post< + SessionUnrevertResponses, + SessionUnrevertErrors, + ThrowOnError + >({ url: "/session/{id}/unrevert", ...options, }) @@ -504,7 +628,9 @@ class Command extends _HeyApiClient { /** * List all commands */ - public list(options?: Options) { + public list( + options?: Options, + ) { return (options?.client ?? this._client).get({ url: "/command", ...options, @@ -526,7 +652,9 @@ class Find extends _HeyApiClient { /** * Find files */ - public files(options: Options) { + public files( + options: Options, + ) { return (options.client ?? this._client).get({ url: "/find/file", ...options, @@ -536,7 +664,9 @@ class Find extends _HeyApiClient { /** * Find workspace symbols */ - public symbols(options: Options) { + public symbols( + options: Options, + ) { return (options.client ?? this._client).get({ url: "/find/symbol", ...options, @@ -568,7 +698,9 @@ class File extends _HeyApiClient { /** * Get file status */ - public status(options?: Options) { + public status( + options?: Options, + ) { return (options?.client ?? this._client).get({ url: "/file/status", ...options, @@ -594,7 +726,9 @@ class App extends _HeyApiClient { /** * List all agents */ - public agents(options?: Options) { + public agents( + options?: Options, + ) { return (options?.client ?? this._client).get({ url: "/agent", ...options, @@ -606,7 +740,9 @@ class Mcp extends _HeyApiClient { /** * Get MCP server status */ - public status(options?: Options) { + public status( + options?: Options, + ) { return (options?.client ?? this._client).get({ url: "/mcp", ...options, @@ -618,8 +754,14 @@ class Tui extends _HeyApiClient { /** * Append prompt to the TUI */ - public appendPrompt(options?: Options) { - return (options?.client ?? this._client).post({ + public appendPrompt( + options?: Options, + ) { + return (options?.client ?? this._client).post< + TuiAppendPromptResponses, + TuiAppendPromptErrors, + ThrowOnError + >({ url: "/tui/append-prompt", ...options, headers: { @@ -632,7 +774,9 @@ class Tui extends _HeyApiClient { /** * Open the help dialog */ - public openHelp(options?: Options) { + public openHelp( + options?: Options, + ) { return (options?.client ?? this._client).post({ url: "/tui/open-help", ...options, @@ -642,7 +786,9 @@ class Tui extends _HeyApiClient { /** * Open the session dialog */ - public openSessions(options?: Options) { + public openSessions( + options?: Options, + ) { return (options?.client ?? this._client).post({ url: "/tui/open-sessions", ...options, @@ -652,7 +798,9 @@ class Tui extends _HeyApiClient { /** * Open the theme dialog */ - public openThemes(options?: Options) { + public openThemes( + options?: Options, + ) { return (options?.client ?? this._client).post({ url: "/tui/open-themes", ...options, @@ -662,7 +810,9 @@ class Tui extends _HeyApiClient { /** * Open the model dialog */ - public openModels(options?: Options) { + public openModels( + options?: Options, + ) { return (options?.client ?? this._client).post({ url: "/tui/open-models", ...options, @@ -672,7 +822,9 @@ class Tui extends _HeyApiClient { /** * Submit the prompt */ - public submitPrompt(options?: Options) { + public submitPrompt( + options?: Options, + ) { return (options?.client ?? this._client).post({ url: "/tui/submit-prompt", ...options, @@ -682,7 +834,9 @@ class Tui extends _HeyApiClient { /** * Clear the prompt */ - public clearPrompt(options?: Options) { + public clearPrompt( + options?: Options, + ) { return (options?.client ?? this._client).post({ url: "/tui/clear-prompt", ...options, @@ -692,8 +846,14 @@ class Tui extends _HeyApiClient { /** * Execute a TUI command (e.g. agent_cycle) */ - public executeCommand(options?: Options) { - return (options?.client ?? this._client).post({ + public executeCommand( + options?: Options, + ) { + return (options?.client ?? this._client).post< + TuiExecuteCommandResponses, + TuiExecuteCommandErrors, + ThrowOnError + >({ url: "/tui/execute-command", ...options, headers: { @@ -706,7 +866,9 @@ class Tui extends _HeyApiClient { /** * Show a toast notification in the TUI */ - public showToast(options?: Options) { + public showToast( + options?: Options, + ) { return (options?.client ?? this._client).post({ url: "/tui/show-toast", ...options, @@ -738,8 +900,14 @@ class Event extends _HeyApiClient { /** * Get events */ - public subscribe(options?: Options) { - return (options?.client ?? this._client).get.sse({ + public subscribe( + options?: Options, + ) { + return (options?.client ?? this._client).get.sse< + EventSubscribeResponses, + unknown, + ThrowOnError + >({ url: "/event", ...options, }) diff --git a/packages/sdk/js/src/gen/types.gen.ts b/packages/sdk/js/src/gen/types.gen.ts index 0b55cc5b..0b8948c5 100644 --- a/packages/sdk/js/src/gen/types.gen.ts +++ b/packages/sdk/js/src/gen/types.gen.ts @@ -505,6 +505,10 @@ export type Config = { } }> } + /** + * Number of retries for chat completions on failure + */ + chatMaxRetries?: number disable_paste_summary?: boolean } } @@ -658,7 +662,12 @@ export type AssistantMessage = { created: number completed?: number } - error?: ProviderAuthError | UnknownError | MessageOutputLengthError | MessageAbortedError | ApiError + error?: + | ProviderAuthError + | UnknownError + | MessageOutputLengthError + | MessageAbortedError + | ApiError system: Array parentID: string modelID: string @@ -1222,7 +1231,12 @@ export type EventSessionError = { type: "session.error" properties: { sessionID?: string - error?: ProviderAuthError | UnknownError | MessageOutputLengthError | MessageAbortedError | ApiError + error?: + | ProviderAuthError + | UnknownError + | MessageOutputLengthError + | MessageAbortedError + | ApiError } } diff --git a/packages/slack/package.json b/packages/slack/package.json index 16756f5a..933136c0 100644 --- a/packages/slack/package.json +++ b/packages/slack/package.json @@ -1,6 +1,6 @@ { "name": "@opencode-ai/slack", - "version": "0.15.20", + "version": "0.15.23", "type": "module", "scripts": { "dev": "bun run src/index.ts", diff --git a/packages/ui/package.json b/packages/ui/package.json index d85dbee5..888bfc36 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -1,6 +1,6 @@ { "name": "@opencode-ai/ui", - "version": "0.15.20", + "version": "0.15.23", "type": "module", "exports": { ".": "./src/components/index.ts", diff --git a/packages/web/package.json b/packages/web/package.json index 6cacf9bd..80c88ebf 100644 --- a/packages/web/package.json +++ b/packages/web/package.json @@ -1,7 +1,7 @@ { "name": "@opencode-ai/web", "type": "module", - "version": "0.15.20", + "version": "0.15.23", "scripts": { "dev": "astro dev", "dev:remote": "VITE_API_URL=https://api.opencode.ai astro dev", diff --git a/sdks/vscode/package.json b/sdks/vscode/package.json index 854797b6..c3b80117 100644 --- a/sdks/vscode/package.json +++ b/sdks/vscode/package.json @@ -2,7 +2,7 @@ "name": "opencode", "displayName": "opencode", "description": "opencode for VS Code", - "version": "0.15.20", + "version": "0.15.23", "publisher": "sst-dev", "repository": { "type": "git",