From 0e705e2a05fc611c0b95083c3a070560b60ef2ed Mon Sep 17 00:00:00 2001 From: Brendan Allan Date: Thu, 23 Jul 2026 12:04:25 +0800 Subject: [PATCH] chore(client): regenerate path API --- packages/client/src/effect/api/api.ts | 22 ++++++++++++++----- .../client/src/effect/generated/client.ts | 22 +++++++++++++------ packages/client/src/promise/api.ts | 9 ++++++++ .../client/src/promise/generated/client.ts | 16 ++++++++++++++ .../client/src/promise/generated/types.ts | 10 +++++++++ packages/client/src/promise/index.ts | 9 ++++++++ packages/client/test/promise.test.ts | 1 + 7 files changed, 76 insertions(+), 13 deletions(-) diff --git a/packages/client/src/effect/api/api.ts b/packages/client/src/effect/api/api.ts index 5a001c2630..c77bf4e831 100644 --- a/packages/client/src/effect/api/api.ts +++ b/packages/client/src/effect/api/api.ts @@ -1030,13 +1030,22 @@ export interface VcsApi { readonly diff: VcsDiffOperation } -export type Endpoint26_0Output = EffectValue> -export type DebugLocationListOperation = () => Effect.Effect +type Endpoint26_0Request = Parameters[0] +export type Endpoint26_0Input = { readonly location?: Endpoint26_0Request["query"]["location"] } +export type Endpoint26_0Output = EffectValue> +export type PathGetOperation = (input?: Endpoint26_0Input) => Effect.Effect -type Endpoint26_1Request = Parameters[0] -export type Endpoint26_1Input = { readonly location?: Endpoint26_1Request["query"]["location"] } -export type Endpoint26_1Output = EffectValue> -export type DebugLocationEvictOperation = (input?: Endpoint26_1Input) => Effect.Effect +export interface PathApi { + readonly get: PathGetOperation +} + +export type Endpoint27_0Output = EffectValue> +export type DebugLocationListOperation = () => Effect.Effect + +type Endpoint27_1Request = Parameters[0] +export type Endpoint27_1Input = { readonly location?: Endpoint27_1Request["query"]["location"] } +export type Endpoint27_1Output = EffectValue> +export type DebugLocationEvictOperation = (input?: Endpoint27_1Input) => Effect.Effect export interface DebugApi { readonly location: { readonly list: DebugLocationListOperation; readonly evict: DebugLocationEvictOperation } @@ -1069,5 +1078,6 @@ export interface AppApi { readonly reference: ReferenceApi readonly projectCopy: ProjectCopyApi readonly vcs: VcsApi + readonly path: PathApi readonly debug: DebugApi } diff --git a/packages/client/src/effect/generated/client.ts b/packages/client/src/effect/generated/client.ts index de18f5c05e..b2f983733d 100644 --- a/packages/client/src/effect/generated/client.ts +++ b/packages/client/src/effect/generated/client.ts @@ -1232,16 +1232,23 @@ const Endpoint25_1 = (raw: RawClient["server.vcs"]) => (input: Endpoint25_1Input const adaptGroup25 = (raw: RawClient["server.vcs"]) => ({ status: Endpoint25_0(raw), diff: Endpoint25_1(raw) }) -const Endpoint26_0 = (raw: RawClient["server.debug"]) => () => +type Endpoint26_0Request = Parameters[0] +type Endpoint26_0Input = { readonly location?: Endpoint26_0Request["query"]["location"] } +const Endpoint26_0 = (raw: RawClient["server.path"]) => (input?: Endpoint26_0Input) => + raw["path.get"]({ query: { location: input?.["location"] } }).pipe(Effect.mapError(mapClientError)) + +const adaptGroup26 = (raw: RawClient["server.path"]) => ({ get: Endpoint26_0(raw) }) + +const Endpoint27_0 = (raw: RawClient["server.debug"]) => () => raw["debug.location"]({}).pipe(Effect.mapError(mapClientError)) -type Endpoint26_1Request = Parameters[0] -type Endpoint26_1Input = { readonly location?: Endpoint26_1Request["query"]["location"] } -const Endpoint26_1 = (raw: RawClient["server.debug"]) => (input?: Endpoint26_1Input) => +type Endpoint27_1Request = Parameters[0] +type Endpoint27_1Input = { readonly location?: Endpoint27_1Request["query"]["location"] } +const Endpoint27_1 = (raw: RawClient["server.debug"]) => (input?: Endpoint27_1Input) => raw["debug.location.evict"]({ query: { location: input?.["location"] } }).pipe(Effect.mapError(mapClientError)) -const adaptGroup26 = (raw: RawClient["server.debug"]) => ({ - location: { list: Endpoint26_0(raw), evict: Endpoint26_1(raw) }, +const adaptGroup27 = (raw: RawClient["server.debug"]) => ({ + location: { list: Endpoint27_0(raw), evict: Endpoint27_1(raw) }, }) const adaptClient = (raw: RawClient) => ({ @@ -1271,7 +1278,8 @@ const adaptClient = (raw: RawClient) => ({ reference: adaptGroup23(raw["server.reference"]), projectCopy: adaptGroup24(raw["server.projectCopy"]), vcs: adaptGroup25(raw["server.vcs"]), - debug: adaptGroup26(raw["server.debug"]), + path: adaptGroup26(raw["server.path"]), + debug: adaptGroup27(raw["server.debug"]), }) export const make = (options?: { readonly baseUrl?: URL | string }) => diff --git a/packages/client/src/promise/api.ts b/packages/client/src/promise/api.ts index b4bc8635b2..0b4f8354b7 100644 --- a/packages/client/src/promise/api.ts +++ b/packages/client/src/promise/api.ts @@ -3,13 +3,22 @@ type Client = ReturnType export type AgentApi = Client["agent"] export type CommandApi = Client["command"] export type EventApi = Client["event"] +export type FileApi = Client["file"] export type IntegrationApi = Client["integration"] +export type MessageApi = Client["message"] +export type McpApi = Client["mcp"] export type ModelApi = Client["model"] export type PluginApi = Client["plugin"] +export type PermissionApi = Client["permission"] +export type PathApi = Client["path"] +export type ProjectApi = Client["project"] export type ProviderApi = Client["provider"] +export type QuestionApi = Client["question"] export type ReferenceApi = Client["reference"] export type SessionApi = Client["session"] export type SkillApi = Client["skill"] +export type PtyApi = Client["pty"] +export type VcsApi = Client["vcs"] export interface CatalogApi { readonly provider: ProviderApi diff --git a/packages/client/src/promise/generated/client.ts b/packages/client/src/promise/generated/client.ts index 97c84a5d7a..25f4008336 100644 --- a/packages/client/src/promise/generated/client.ts +++ b/packages/client/src/promise/generated/client.ts @@ -204,6 +204,8 @@ import type { VcsStatusOutput, VcsDiffInput, VcsDiffOutput, + PathGetInput, + PathGetOutput, DebugLocationListOutput, DebugLocationEvictInput, DebugLocationEvictOutput, @@ -1708,6 +1710,20 @@ export function make(options: ClientOptions) { requestOptions, ), }, + path: { + get: (input?: PathGetInput, requestOptions?: RequestOptions) => + request( + { + method: "GET", + path: `/api/path`, + query: { location: input?.["location"] }, + successStatus: 200, + declaredStatuses: [401, 400], + empty: false, + }, + requestOptions, + ), + }, debug: { location: { list: (requestOptions?: RequestOptions) => diff --git a/packages/client/src/promise/generated/types.ts b/packages/client/src/promise/generated/types.ts index a08c7b3246..623ce334b2 100644 --- a/packages/client/src/promise/generated/types.ts +++ b/packages/client/src/promise/generated/types.ts @@ -533,6 +533,8 @@ export type VcsFileStatus = { status: "added" | "deleted" | "modified" } +export type PathInfo = { home: string; state: string; config: string; worktree: string; directory: string } + export type SessionMessageModelSelected = { id: string metadata?: { [x: string]: JsonValue } @@ -4952,6 +4954,14 @@ export type VcsDiffOutput = { data: Array } +export type PathGetInput = { + readonly location?: { + readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined + }["location"] +} + +export type PathGetOutput = PathInfo + export type DebugLocationListOutput = Array export type DebugLocationEvictInput = { diff --git a/packages/client/src/promise/index.ts b/packages/client/src/promise/index.ts index fd889c64e5..2dd1f30557 100644 --- a/packages/client/src/promise/index.ts +++ b/packages/client/src/promise/index.ts @@ -4,13 +4,22 @@ export type { CatalogApi, CommandApi, EventApi, + FileApi, IntegrationApi, + MessageApi, + McpApi, ModelApi, + PermissionApi, + PathApi, PluginApi, + ProjectApi, ProviderApi, + QuestionApi, ReferenceApi, SessionApi, SkillApi, + PtyApi, + VcsApi, } from "./api.js" export type { EventSubscribeOutput as OpenCodeEvent } from "./generated/types" export type OpenCodeClient = ReturnType diff --git a/packages/client/test/promise.test.ts b/packages/client/test/promise.test.ts index d3c966ef9b..6716829119 100644 --- a/packages/client/test/promise.test.ts +++ b/packages/client/test/promise.test.ts @@ -31,6 +31,7 @@ test("exposes every standard HTTP API group", () => { "reference", "projectCopy", "vcs", + "path", "debug", ]) expect(Object.keys(client.debug)).toEqual(["location"])