Dax Raad 4 ヶ月 前
コミット
11840191f8

+ 1 - 1
packages/opencode/src/cli/cmd/tui/routes/session/index.tsx

@@ -1045,7 +1045,7 @@ function UserMessage(props: {
               </box>
               </box>
             </Show>
             </Show>
             <text fg={theme.textMuted}>
             <text fg={theme.textMuted}>
-              {ctx.usernameVisible() ? `${sync.data.config.username ?? "You"}` : "You"}
+              {ctx.usernameVisible() ? `${sync.data.config.username ?? "You "}` : "You "}
               <Show
               <Show
                 when={queued()}
                 when={queued()}
                 fallback={
                 fallback={

+ 0 - 25
packages/sdk/js/script/build.ts

@@ -12,31 +12,6 @@ await $`bun dev generate > ${dir}/openapi.json`.cwd(path.resolve(dir, "../../ope
 
 
 await $`rm -rf src/gen`
 await $`rm -rf src/gen`
 
 
-await createClient({
-  input: "./openapi.json",
-  output: {
-    path: "./src/gen",
-    tsConfigPath: path.join(dir, "tsconfig.json"),
-    clean: true,
-  },
-  plugins: [
-    {
-      name: "@hey-api/typescript",
-      exportFromIndex: false,
-    },
-    {
-      name: "@hey-api/sdk",
-      instance: "OpencodeClient",
-      exportFromIndex: false,
-      auth: false,
-    },
-    {
-      name: "@hey-api/client-fetch",
-      exportFromIndex: false,
-      baseUrl: "http://localhost:4096",
-    },
-  ],
-})
 await createClient({
 await createClient({
   input: "./openapi.json",
   input: "./openapi.json",
   output: {
   output: {

+ 10 - 6
packages/sdk/js/src/gen/client.gen.ts

@@ -1,7 +1,7 @@
 // This file is auto-generated by @hey-api/openapi-ts
 // This file is auto-generated by @hey-api/openapi-ts
 
 
-import { type ClientOptions, type Config, createClient, createConfig } from "./client/index.js"
-import type { ClientOptions as ClientOptions2 } from "./types.gen.js"
+import type { ClientOptions } from "./types.gen.js"
+import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from "./client/index.js"
 
 
 /**
 /**
  * The `createClientConfig()` function will be called on client initialization
  * The `createClientConfig()` function will be called on client initialization
@@ -11,8 +11,12 @@ import type { ClientOptions as ClientOptions2 } from "./types.gen.js"
  * `setConfig()`. This is useful for example if you're using Next.js
  * `setConfig()`. This is useful for example if you're using Next.js
  * to ensure your client always has the correct values.
  * to ensure your client always has the correct values.
  */
  */
-export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (
-  override?: Config<ClientOptions & T>,
-) => Config<Required<ClientOptions> & T>
+export type CreateClientConfig<T extends DefaultClientOptions = ClientOptions> = (
+  override?: Config<DefaultClientOptions & T>,
+) => Config<Required<DefaultClientOptions> & T>
 
 
-export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:4096" }))
+export const client = createClient(
+  createConfig<ClientOptions>({
+    baseUrl: "http://localhost:4096",
+  }),
+)

+ 34 - 100
packages/sdk/js/src/gen/client/client.gen.ts

@@ -1,8 +1,6 @@
 // This file is auto-generated by @hey-api/openapi-ts
 // This file is auto-generated by @hey-api/openapi-ts
 
 
 import { createSseClient } from "../core/serverSentEvents.gen.js"
 import { createSseClient } from "../core/serverSentEvents.gen.js"
-import type { HttpMethod } from "../core/types.gen.js"
-import { getValidRequestBody } from "../core/utils.gen.js"
 import type { Client, Config, RequestOptions, ResolvedRequestOptions } from "./types.gen.js"
 import type { Client, Config, RequestOptions, ResolvedRequestOptions } from "./types.gen.js"
 import {
 import {
   buildUrl,
   buildUrl,
@@ -51,12 +49,12 @@ export const createClient = (config: Config = {}): Client => {
       await opts.requestValidator(opts)
       await opts.requestValidator(opts)
     }
     }
 
 
-    if (opts.body !== undefined && opts.bodySerializer) {
+    if (opts.body && opts.bodySerializer) {
       opts.serializedBody = opts.bodySerializer(opts.body)
       opts.serializedBody = opts.bodySerializer(opts.body)
     }
     }
 
 
     // remove Content-Type header if body is empty to avoid sending invalid requests
     // remove Content-Type header if body is empty to avoid sending invalid requests
-    if (opts.body === undefined || opts.serializedBody === "") {
+    if (opts.serializedBody === undefined || opts.serializedBody === "") {
       opts.headers.delete("Content-Type")
       opts.headers.delete("Content-Type")
     }
     }
 
 
@@ -71,12 +69,12 @@ export const createClient = (config: Config = {}): Client => {
     const requestInit: ReqInit = {
     const requestInit: ReqInit = {
       redirect: "follow",
       redirect: "follow",
       ...opts,
       ...opts,
-      body: getValidRequestBody(opts),
+      body: opts.serializedBody,
     }
     }
 
 
     let request = new Request(url, requestInit)
     let request = new Request(url, requestInit)
 
 
-    for (const fn of interceptors.request.fns) {
+    for (const fn of interceptors.request._fns) {
       if (fn) {
       if (fn) {
         request = await fn(request, opts)
         request = await fn(request, opts)
       }
       }
@@ -85,37 +83,9 @@ export const createClient = (config: Config = {}): Client => {
     // fetch must be assigned here, otherwise it would throw the error:
     // fetch must be assigned here, otherwise it would throw the error:
     // TypeError: Failed to execute 'fetch' on 'Window': Illegal invocation
     // TypeError: Failed to execute 'fetch' on 'Window': Illegal invocation
     const _fetch = opts.fetch!
     const _fetch = opts.fetch!
-    let response: Response
+    let response = await _fetch(request)
 
 
-    try {
-      response = await _fetch(request)
-    } catch (error) {
-      // Handle fetch exceptions (AbortError, network errors, etc.)
-      let finalError = error
-
-      for (const fn of interceptors.error.fns) {
-        if (fn) {
-          finalError = (await fn(error, undefined as any, request, opts)) as unknown
-        }
-      }
-
-      finalError = finalError || ({} as unknown)
-
-      if (opts.throwOnError) {
-        throw finalError
-      }
-
-      // Return error response
-      return opts.responseStyle === "data"
-        ? undefined
-        : {
-            error: finalError,
-            request,
-            response: undefined as any,
-          }
-    }
-
-    for (const fn of interceptors.response.fns) {
+    for (const fn of interceptors.response._fns) {
       if (fn) {
       if (fn) {
         response = await fn(response, request, opts)
         response = await fn(response, request, opts)
       }
       }
@@ -127,36 +97,18 @@ export const createClient = (config: Config = {}): Client => {
     }
     }
 
 
     if (response.ok) {
     if (response.ok) {
-      const parseAs =
-        (opts.parseAs === "auto" ? getParseAs(response.headers.get("Content-Type")) : opts.parseAs) ?? "json"
-
       if (response.status === 204 || response.headers.get("Content-Length") === "0") {
       if (response.status === 204 || response.headers.get("Content-Length") === "0") {
-        let emptyData: any
-        switch (parseAs) {
-          case "arrayBuffer":
-          case "blob":
-          case "text":
-            emptyData = await response[parseAs]()
-            break
-          case "formData":
-            emptyData = new FormData()
-            break
-          case "stream":
-            emptyData = response.body
-            break
-          case "json":
-          default:
-            emptyData = {}
-            break
-        }
         return opts.responseStyle === "data"
         return opts.responseStyle === "data"
-          ? emptyData
+          ? {}
           : {
           : {
-              data: emptyData,
+              data: {},
               ...result,
               ...result,
             }
             }
       }
       }
 
 
+      const parseAs =
+        (opts.parseAs === "auto" ? getParseAs(response.headers.get("Content-Type")) : opts.parseAs) ?? "json"
+
       let data: any
       let data: any
       switch (parseAs) {
       switch (parseAs) {
         case "arrayBuffer":
         case "arrayBuffer":
@@ -205,7 +157,7 @@ export const createClient = (config: Config = {}): Client => {
     const error = jsonError ?? textError
     const error = jsonError ?? textError
     let finalError = error
     let finalError = error
 
 
-    for (const fn of interceptors.error.fns) {
+    for (const fn of interceptors.error._fns) {
       if (fn) {
       if (fn) {
         finalError = (await fn(error, response, request, opts)) as string
         finalError = (await fn(error, response, request, opts)) as string
       }
       }
@@ -226,53 +178,35 @@ export const createClient = (config: Config = {}): Client => {
         }
         }
   }
   }
 
 
-  const makeMethodFn = (method: Uppercase<HttpMethod>) => (options: RequestOptions) => request({ ...options, method })
-
-  const makeSseFn = (method: Uppercase<HttpMethod>) => async (options: RequestOptions) => {
-    const { opts, url } = await beforeRequest(options)
-    return createSseClient({
-      ...opts,
-      body: opts.body as BodyInit | null | undefined,
-      headers: opts.headers as unknown as Record<string, string>,
-      method,
-      onRequest: async (url, init) => {
-        let request = new Request(url, init)
-        for (const fn of interceptors.request.fns) {
-          if (fn) {
-            request = await fn(request, opts)
-          }
-        }
-        return request
-      },
-      url,
-    })
+  const makeMethod = (method: Required<Config>["method"]) => {
+    const fn = (options: RequestOptions) => request({ ...options, method })
+    fn.sse = async (options: RequestOptions) => {
+      const { opts, url } = await beforeRequest(options)
+      return createSseClient({
+        ...opts,
+        body: opts.body as BodyInit | null | undefined,
+        headers: opts.headers as unknown as Record<string, string>,
+        method,
+        url,
+      })
+    }
+    return fn
   }
   }
 
 
   return {
   return {
     buildUrl,
     buildUrl,
-    connect: makeMethodFn("CONNECT"),
-    delete: makeMethodFn("DELETE"),
-    get: makeMethodFn("GET"),
+    connect: makeMethod("CONNECT"),
+    delete: makeMethod("DELETE"),
+    get: makeMethod("GET"),
     getConfig,
     getConfig,
-    head: makeMethodFn("HEAD"),
+    head: makeMethod("HEAD"),
     interceptors,
     interceptors,
-    options: makeMethodFn("OPTIONS"),
-    patch: makeMethodFn("PATCH"),
-    post: makeMethodFn("POST"),
-    put: makeMethodFn("PUT"),
+    options: makeMethod("OPTIONS"),
+    patch: makeMethod("PATCH"),
+    post: makeMethod("POST"),
+    put: makeMethod("PUT"),
     request,
     request,
     setConfig,
     setConfig,
-    sse: {
-      connect: makeSseFn("CONNECT"),
-      delete: makeSseFn("DELETE"),
-      get: makeSseFn("GET"),
-      head: makeSseFn("HEAD"),
-      options: makeSseFn("OPTIONS"),
-      patch: makeSseFn("PATCH"),
-      post: makeSseFn("POST"),
-      put: makeSseFn("PUT"),
-      trace: makeSseFn("TRACE"),
-    },
-    trace: makeMethodFn("TRACE"),
+    trace: makeMethod("TRACE"),
   } as Client
   } as Client
 }
 }

+ 1 - 1
packages/sdk/js/src/gen/client/index.ts

@@ -8,7 +8,6 @@ export {
   urlSearchParamsBodySerializer,
   urlSearchParamsBodySerializer,
 } from "../core/bodySerializer.gen.js"
 } from "../core/bodySerializer.gen.js"
 export { buildClientParams } from "../core/params.gen.js"
 export { buildClientParams } from "../core/params.gen.js"
-export { serializeQueryKeyValue } from "../core/queryKeySerializer.gen.js"
 export { createClient } from "./client.gen.js"
 export { createClient } from "./client.gen.js"
 export type {
 export type {
   Client,
   Client,
@@ -16,6 +15,7 @@ export type {
   Config,
   Config,
   CreateClientConfig,
   CreateClientConfig,
   Options,
   Options,
+  OptionsLegacyParser,
   RequestOptions,
   RequestOptions,
   RequestResult,
   RequestResult,
   ResolvedRequestOptions,
   ResolvedRequestOptions,

+ 26 - 6
packages/sdk/js/src/gen/client/types.gen.ts

@@ -20,7 +20,7 @@ export interface Config<T extends ClientOptions = ClientOptions>
    *
    *
    * @default globalThis.fetch
    * @default globalThis.fetch
    */
    */
-  fetch?: typeof fetch
+  fetch?: (request: Request) => ReturnType<typeof fetch>
   /**
   /**
    * Please don't use the Fetch client for Next.js applications. The `next`
    * Please don't use the Fetch client for Next.js applications. The `next`
    * options won't have any effect.
    * options won't have any effect.
@@ -128,7 +128,7 @@ export interface ClientOptions {
   throwOnError?: boolean
   throwOnError?: boolean
 }
 }
 
 
-type MethodFn = <
+type MethodFnBase = <
   TData = unknown,
   TData = unknown,
   TError = unknown,
   TError = unknown,
   ThrowOnError extends boolean = false,
   ThrowOnError extends boolean = false,
@@ -137,7 +137,7 @@ type MethodFn = <
   options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, "method">,
   options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, "method">,
 ) => RequestResult<TData, TError, ThrowOnError, TResponseStyle>
 ) => RequestResult<TData, TError, ThrowOnError, TResponseStyle>
 
 
-type SseFn = <
+type MethodFnServerSentEvents = <
   TData = unknown,
   TData = unknown,
   TError = unknown,
   TError = unknown,
   ThrowOnError extends boolean = false,
   ThrowOnError extends boolean = false,
@@ -146,6 +146,10 @@ type SseFn = <
   options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, "method">,
   options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, "method">,
 ) => Promise<ServerSentEventsResult<TData, TError>>
 ) => Promise<ServerSentEventsResult<TData, TError>>
 
 
+type MethodFn = MethodFnBase & {
+  sse: MethodFnServerSentEvents
+}
+
 type RequestFn = <
 type RequestFn = <
   TData = unknown,
   TData = unknown,
   TError = unknown,
   TError = unknown,
@@ -164,10 +168,10 @@ type BuildUrlFn = <
     url: string
     url: string
   },
   },
 >(
 >(
-  options: TData & Options<TData>,
+  options: Pick<TData, "url"> & Options<TData>,
 ) => string
 ) => string
 
 
-export type Client = CoreClient<RequestFn, Config, MethodFn, BuildUrlFn, SseFn> & {
+export type Client = CoreClient<RequestFn, Config, MethodFn, BuildUrlFn> & {
   interceptors: Middleware<Request, Response, unknown, ResolvedRequestOptions>
   interceptors: Middleware<Request, Response, unknown, ResolvedRequestOptions>
 }
 }
 
 
@@ -199,4 +203,20 @@ export type Options<
   TResponse = unknown,
   TResponse = unknown,
   TResponseStyle extends ResponseStyle = "fields",
   TResponseStyle extends ResponseStyle = "fields",
 > = OmitKeys<RequestOptions<TResponse, TResponseStyle, ThrowOnError>, "body" | "path" | "query" | "url"> &
 > = OmitKeys<RequestOptions<TResponse, TResponseStyle, ThrowOnError>, "body" | "path" | "query" | "url"> &
-  ([TData] extends [never] ? unknown : Omit<TData, "url">)
+  Omit<TData, "url">
+
+export type OptionsLegacyParser<
+  TData = unknown,
+  ThrowOnError extends boolean = boolean,
+  TResponseStyle extends ResponseStyle = "fields",
+> = TData extends { body?: any }
+  ? TData extends { headers?: any }
+    ? OmitKeys<RequestOptions<unknown, TResponseStyle, ThrowOnError>, "body" | "headers" | "url"> & TData
+    : OmitKeys<RequestOptions<unknown, TResponseStyle, ThrowOnError>, "body" | "url"> &
+        TData &
+        Pick<RequestOptions<unknown, TResponseStyle, ThrowOnError>, "headers">
+  : TData extends { headers?: any }
+    ? OmitKeys<RequestOptions<unknown, TResponseStyle, ThrowOnError>, "headers" | "url"> &
+        TData &
+        Pick<RequestOptions<unknown, TResponseStyle, ThrowOnError>, "body">
+    : OmitKeys<RequestOptions<unknown, TResponseStyle, ThrowOnError>, "url"> & TData

+ 41 - 43
packages/sdk/js/src/gen/client/utils.gen.ts

@@ -7,7 +7,7 @@ import { serializeArrayParam, serializeObjectParam, serializePrimitiveParam } fr
 import { getUrl } from "../core/utils.gen.js"
 import { getUrl } from "../core/utils.gen.js"
 import type { Client, ClientOptions, Config, RequestOptions } from "./types.gen.js"
 import type { Client, ClientOptions, Config, RequestOptions } from "./types.gen.js"
 
 
-export const createQuerySerializer = <T = unknown>({ parameters = {}, ...args }: QuerySerializerOptions = {}) => {
+export const createQuerySerializer = <T = unknown>({ allowReserved, array, object }: QuerySerializerOptions = {}) => {
   const querySerializer = (queryParams: T) => {
   const querySerializer = (queryParams: T) => {
     const search: string[] = []
     const search: string[] = []
     if (queryParams && typeof queryParams === "object") {
     if (queryParams && typeof queryParams === "object") {
@@ -18,31 +18,29 @@ export const createQuerySerializer = <T = unknown>({ parameters = {}, ...args }:
           continue
           continue
         }
         }
 
 
-        const options = parameters[name] || args
-
         if (Array.isArray(value)) {
         if (Array.isArray(value)) {
           const serializedArray = serializeArrayParam({
           const serializedArray = serializeArrayParam({
-            allowReserved: options.allowReserved,
+            allowReserved,
             explode: true,
             explode: true,
             name,
             name,
             style: "form",
             style: "form",
             value,
             value,
-            ...options.array,
+            ...array,
           })
           })
           if (serializedArray) search.push(serializedArray)
           if (serializedArray) search.push(serializedArray)
         } else if (typeof value === "object") {
         } else if (typeof value === "object") {
           const serializedObject = serializeObjectParam({
           const serializedObject = serializeObjectParam({
-            allowReserved: options.allowReserved,
+            allowReserved,
             explode: true,
             explode: true,
             name,
             name,
             style: "deepObject",
             style: "deepObject",
             value: value as Record<string, unknown>,
             value: value as Record<string, unknown>,
-            ...options.object,
+            ...object,
           })
           })
           if (serializedObject) search.push(serializedObject)
           if (serializedObject) search.push(serializedObject)
         } else {
         } else {
           const serializedPrimitive = serializePrimitiveParam({
           const serializedPrimitive = serializePrimitiveParam({
-            allowReserved: options.allowReserved,
+            allowReserved,
             name,
             name,
             value: value as string,
             value: value as string,
           })
           })
@@ -164,22 +162,14 @@ export const mergeConfigs = (a: Config, b: Config): Config => {
   return config
   return config
 }
 }
 
 
-const headersEntries = (headers: Headers): Array<[string, string]> => {
-  const entries: Array<[string, string]> = []
-  headers.forEach((value, key) => {
-    entries.push([key, value])
-  })
-  return entries
-}
-
 export const mergeHeaders = (...headers: Array<Required<Config>["headers"] | undefined>): Headers => {
 export const mergeHeaders = (...headers: Array<Required<Config>["headers"] | undefined>): Headers => {
   const mergedHeaders = new Headers()
   const mergedHeaders = new Headers()
   for (const header of headers) {
   for (const header of headers) {
-    if (!header) {
+    if (!header || typeof header !== "object") {
       continue
       continue
     }
     }
 
 
-    const iterator = header instanceof Headers ? headersEntries(header) : Object.entries(header)
+    const iterator = header instanceof Headers ? header.entries() : Object.entries(header)
 
 
     for (const [key, value] of iterator) {
     for (const [key, value] of iterator) {
       if (value === null) {
       if (value === null) {
@@ -210,53 +200,61 @@ type ReqInterceptor<Req, Options> = (request: Req, options: Options) => Req | Pr
 type ResInterceptor<Res, Req, Options> = (response: Res, request: Req, options: Options) => Res | Promise<Res>
 type ResInterceptor<Res, Req, Options> = (response: Res, request: Req, options: Options) => Res | Promise<Res>
 
 
 class Interceptors<Interceptor> {
 class Interceptors<Interceptor> {
-  fns: Array<Interceptor | null> = []
+  _fns: (Interceptor | null)[]
 
 
-  clear(): void {
-    this.fns = []
+  constructor() {
+    this._fns = []
   }
   }
 
 
-  eject(id: number | Interceptor): void {
-    const index = this.getInterceptorIndex(id)
-    if (this.fns[index]) {
-      this.fns[index] = null
-    }
+  clear() {
+    this._fns = []
   }
   }
 
 
-  exists(id: number | Interceptor): boolean {
+  getInterceptorIndex(id: number | Interceptor): number {
+    if (typeof id === "number") {
+      return this._fns[id] ? id : -1
+    } else {
+      return this._fns.indexOf(id)
+    }
+  }
+  exists(id: number | Interceptor) {
     const index = this.getInterceptorIndex(id)
     const index = this.getInterceptorIndex(id)
-    return Boolean(this.fns[index])
+    return !!this._fns[index]
   }
   }
 
 
-  getInterceptorIndex(id: number | Interceptor): number {
-    if (typeof id === "number") {
-      return this.fns[id] ? id : -1
+  eject(id: number | Interceptor) {
+    const index = this.getInterceptorIndex(id)
+    if (this._fns[index]) {
+      this._fns[index] = null
     }
     }
-    return this.fns.indexOf(id)
   }
   }
 
 
-  update(id: number | Interceptor, fn: Interceptor): number | Interceptor | false {
+  update(id: number | Interceptor, fn: Interceptor) {
     const index = this.getInterceptorIndex(id)
     const index = this.getInterceptorIndex(id)
-    if (this.fns[index]) {
-      this.fns[index] = fn
+    if (this._fns[index]) {
+      this._fns[index] = fn
       return id
       return id
+    } else {
+      return false
     }
     }
-    return false
   }
   }
 
 
-  use(fn: Interceptor): number {
-    this.fns.push(fn)
-    return this.fns.length - 1
+  use(fn: Interceptor) {
+    this._fns = [...this._fns, fn]
+    return this._fns.length - 1
   }
   }
 }
 }
 
 
+// `createInterceptors()` response, meant for external use as it does not
+// expose internals
 export interface Middleware<Req, Res, Err, Options> {
 export interface Middleware<Req, Res, Err, Options> {
-  error: Interceptors<ErrInterceptor<Err, Res, Req, Options>>
-  request: Interceptors<ReqInterceptor<Req, Options>>
-  response: Interceptors<ResInterceptor<Res, Req, Options>>
+  error: Pick<Interceptors<ErrInterceptor<Err, Res, Req, Options>>, "eject" | "use">
+  request: Pick<Interceptors<ReqInterceptor<Req, Options>>, "eject" | "use">
+  response: Pick<Interceptors<ResInterceptor<Res, Req, Options>>, "eject" | "use">
 }
 }
 
 
-export const createInterceptors = <Req, Res, Err, Options>(): Middleware<Req, Res, Err, Options> => ({
+// do not add `Middleware` as return type so we can use _fns internally
+export const createInterceptors = <Req, Res, Err, Options>() => ({
   error: new Interceptors<ErrInterceptor<Err, Res, Req, Options>>(),
   error: new Interceptors<ErrInterceptor<Err, Res, Req, Options>>(),
   request: new Interceptors<ReqInterceptor<Req, Options>>(),
   request: new Interceptors<ReqInterceptor<Req, Options>>(),
   response: new Interceptors<ResInterceptor<Res, Req, Options>>(),
   response: new Interceptors<ResInterceptor<Res, Req, Options>>(),

+ 3 - 11
packages/sdk/js/src/gen/core/bodySerializer.gen.ts

@@ -6,18 +6,10 @@ export type QuerySerializer = (query: Record<string, unknown>) => string
 
 
 export type BodySerializer = (body: any) => any
 export type BodySerializer = (body: any) => any
 
 
-type QuerySerializerOptionsObject = {
+export interface QuerySerializerOptions {
   allowReserved?: boolean
   allowReserved?: boolean
-  array?: Partial<SerializerOptions<ArrayStyle>>
-  object?: Partial<SerializerOptions<ObjectStyle>>
-}
-
-export type QuerySerializerOptions = QuerySerializerOptionsObject & {
-  /**
-   * Per-parameter serialization overrides. When provided, these settings
-   * override the global array/object settings for specific parameter names.
-   */
-  parameters?: Record<string, QuerySerializerOptionsObject>
+  array?: SerializerOptions<ArrayStyle>
+  object?: SerializerOptions<ObjectStyle>
 }
 }
 
 
 const serializeFormDataPair = (data: FormData, key: string, value: unknown): void => {
 const serializeFormDataPair = (data: FormData, key: string, value: unknown): void => {

+ 9 - 34
packages/sdk/js/src/gen/core/params.gen.ts

@@ -23,17 +23,6 @@ export type Field =
       key?: string
       key?: string
       map?: string
       map?: string
     }
     }
-  | {
-      /**
-       * Field name. This is the name we want the user to see and use.
-       */
-      key: string
-      /**
-       * Field mapped name. This is the name we want to use in the request.
-       * If `in` is omitted, `map` aliases `key` to the transport layer.
-       */
-      map: Slot
-    }
 
 
 export interface Fields {
 export interface Fields {
   allowExtra?: Partial<Record<Slot, boolean>>
   allowExtra?: Partial<Record<Slot, boolean>>
@@ -52,14 +41,10 @@ const extraPrefixes = Object.entries(extraPrefixesMap)
 
 
 type KeyMap = Map<
 type KeyMap = Map<
   string,
   string,
-  | {
-      in: Slot
-      map?: string
-    }
-  | {
-      in?: never
-      map: Slot
-    }
+  {
+    in: Slot
+    map?: string
+  }
 >
 >
 
 
 const buildKeyMap = (fields: FieldsConfig, map?: KeyMap): KeyMap => {
 const buildKeyMap = (fields: FieldsConfig, map?: KeyMap): KeyMap => {
@@ -75,10 +60,6 @@ const buildKeyMap = (fields: FieldsConfig, map?: KeyMap): KeyMap => {
           map: config.map,
           map: config.map,
         })
         })
       }
       }
-    } else if ("key" in config) {
-      map.set(config.key, {
-        map: config.map,
-      })
     } else if (config.args) {
     } else if (config.args) {
       buildKeyMap(config.args, map)
       buildKeyMap(config.args, map)
     }
     }
@@ -127,9 +108,7 @@ export const buildClientParams = (args: ReadonlyArray<unknown>, fields: FieldsCo
       if (config.key) {
       if (config.key) {
         const field = map.get(config.key)!
         const field = map.get(config.key)!
         const name = field.map || config.key
         const name = field.map || config.key
-        if (field.in) {
-          ;(params[field.in] as Record<string, unknown>)[name] = arg
-        }
+        ;(params[field.in] as Record<string, unknown>)[name] = arg
       } else {
       } else {
         params.body = arg
         params.body = arg
       }
       }
@@ -138,20 +117,16 @@ export const buildClientParams = (args: ReadonlyArray<unknown>, fields: FieldsCo
         const field = map.get(key)
         const field = map.get(key)
 
 
         if (field) {
         if (field) {
-          if (field.in) {
-            const name = field.map || key
-            ;(params[field.in] as Record<string, unknown>)[name] = value
-          } else {
-            params[field.map] = value
-          }
+          const name = field.map || key
+          ;(params[field.in] as Record<string, unknown>)[name] = value
         } else {
         } else {
           const extra = extraPrefixes.find(([prefix]) => key.startsWith(prefix))
           const extra = extraPrefixes.find(([prefix]) => key.startsWith(prefix))
 
 
           if (extra) {
           if (extra) {
             const [prefix, slot] = extra
             const [prefix, slot] = extra
             ;(params[slot] as Record<string, unknown>)[key.slice(prefix.length)] = value
             ;(params[slot] as Record<string, unknown>)[key.slice(prefix.length)] = value
-          } else if ("allowExtra" in config && config.allowExtra) {
-            for (const [slot, allowed] of Object.entries(config.allowExtra)) {
+          } else {
+            for (const [slot, allowed] of Object.entries(config.allowExtra ?? {})) {
               if (allowed) {
               if (allowed) {
                 ;(params[slot as Slot] as Record<string, unknown>)[key] = value
                 ;(params[slot as Slot] as Record<string, unknown>)[key] = value
                 break
                 break

+ 1 - 28
packages/sdk/js/src/gen/core/serverSentEvents.gen.ts

@@ -4,17 +4,6 @@ import type { Config } from "./types.gen.js"
 
 
 export type ServerSentEventsOptions<TData = unknown> = Omit<RequestInit, "method"> &
 export type ServerSentEventsOptions<TData = unknown> = Omit<RequestInit, "method"> &
   Pick<Config, "method" | "responseTransformer" | "responseValidator"> & {
   Pick<Config, "method" | "responseTransformer" | "responseValidator"> & {
-    /**
-     * Fetch API implementation. You can use this option to provide a custom
-     * fetch instance.
-     *
-     * @default globalThis.fetch
-     */
-    fetch?: typeof fetch
-    /**
-     * Implementing clients can call request interceptors inside this hook.
-     */
-    onRequest?: (url: string, init: RequestInit) => Promise<Request>
     /**
     /**
      * Callback invoked when a network or parsing error occurs during streaming.
      * Callback invoked when a network or parsing error occurs during streaming.
      *
      *
@@ -32,7 +21,6 @@ export type ServerSentEventsOptions<TData = unknown> = Omit<RequestInit, "method
      * @returns Nothing (void).
      * @returns Nothing (void).
      */
      */
     onSseEvent?: (event: StreamEvent<TData>) => void
     onSseEvent?: (event: StreamEvent<TData>) => void
-    serializedBody?: RequestInit["body"]
     /**
     /**
      * Default retry delay in milliseconds.
      * Default retry delay in milliseconds.
      *
      *
@@ -76,7 +64,6 @@ export type ServerSentEventsResult<TData = unknown, TReturn = void, TNext = unkn
 }
 }
 
 
 export const createSseClient = <TData = unknown>({
 export const createSseClient = <TData = unknown>({
-  onRequest,
   onSseError,
   onSseError,
   onSseEvent,
   onSseEvent,
   responseTransformer,
   responseTransformer,
@@ -112,21 +99,7 @@ export const createSseClient = <TData = unknown>({
       }
       }
 
 
       try {
       try {
-        const requestInit: RequestInit = {
-          redirect: "follow",
-          ...options,
-          body: options.serializedBody,
-          headers,
-          signal,
-        }
-        let request = new Request(url, requestInit)
-        if (onRequest) {
-          request = await onRequest(url, requestInit)
-        }
-        // fetch must be assigned here, otherwise it would throw the error:
-        // TypeError: Failed to execute 'fetch' on 'Window': Illegal invocation
-        const _fetch = options.fetch ?? globalThis.fetch
-        const response = await _fetch(request)
+        const response = await fetch(url, { ...options, headers, signal })
 
 
         if (!response.ok) throw new Error(`SSE failed: ${response.status} ${response.statusText}`)
         if (!response.ok) throw new Error(`SSE failed: ${response.status} ${response.statusText}`)
 
 

+ 12 - 7
packages/sdk/js/src/gen/core/types.gen.ts

@@ -3,19 +3,24 @@
 import type { Auth, AuthToken } from "./auth.gen.js"
 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 type HttpMethod = "connect" | "delete" | "get" | "head" | "options" | "patch" | "post" | "put" | "trace"
-
-export type Client<RequestFn = never, Config = unknown, MethodFn = never, BuildUrlFn = never, SseFn = never> = {
+export interface Client<RequestFn = never, Config = unknown, MethodFn = never, BuildUrlFn = never> {
   /**
   /**
    * Returns the final request URL.
    * Returns the final request URL.
    */
    */
   buildUrl: BuildUrlFn
   buildUrl: BuildUrlFn
+  connect: MethodFn
+  delete: MethodFn
+  get: MethodFn
   getConfig: () => Config
   getConfig: () => Config
+  head: MethodFn
+  options: MethodFn
+  patch: MethodFn
+  post: MethodFn
+  put: MethodFn
   request: RequestFn
   request: RequestFn
   setConfig: (config: Config) => Config
   setConfig: (config: Config) => Config
-} & {
-  [K in HttpMethod]: MethodFn
-} & ([SseFn] extends [never] ? { sse?: never } : { sse: { [K in HttpMethod]: SseFn } })
+  trace: MethodFn
+}
 
 
 export interface Config {
 export interface Config {
   /**
   /**
@@ -42,7 +47,7 @@ export interface Config {
    *
    *
    * {@link https://developer.mozilla.org/docs/Web/API/fetch#method See more}
    * {@link https://developer.mozilla.org/docs/Web/API/fetch#method See more}
    */
    */
-  method?: Uppercase<HttpMethod>
+  method?: "CONNECT" | "DELETE" | "GET" | "HEAD" | "OPTIONS" | "PATCH" | "POST" | "PUT" | "TRACE"
   /**
   /**
    * A function for serializing request query parameters. By default, arrays
    * A function for serializing request query parameters. By default, arrays
    * will be exploded in form style, objects will be exploded in deepObject
    * will be exploded in form style, objects will be exploded in deepObject

+ 1 - 29
packages/sdk/js/src/gen/core/utils.gen.ts

@@ -1,6 +1,6 @@
 // This file is auto-generated by @hey-api/openapi-ts
 // This file is auto-generated by @hey-api/openapi-ts
 
 
-import type { BodySerializer, QuerySerializer } from "./bodySerializer.gen.js"
+import type { QuerySerializer } from "./bodySerializer.gen.js"
 import {
 import {
   type ArraySeparatorStyle,
   type ArraySeparatorStyle,
   serializeArrayParam,
   serializeArrayParam,
@@ -107,31 +107,3 @@ export const getUrl = ({
   }
   }
   return url
   return url
 }
 }
-
-export function getValidRequestBody(options: {
-  body?: unknown
-  bodySerializer?: BodySerializer | null
-  serializedBody?: unknown
-}) {
-  const hasBody = options.body !== undefined
-  const isSerializedBody = hasBody && options.bodySerializer
-
-  if (isSerializedBody) {
-    if ("serializedBody" in options) {
-      const hasSerializedBody = options.serializedBody !== undefined && options.serializedBody !== ""
-
-      return hasSerializedBody ? options.serializedBody : null
-    }
-
-    // not all clients implement a serializedBody property (i.e. client-axios)
-    return options.body !== "" ? options.body : null
-  }
-
-  // plain/text body
-  if (hasBody) {
-    return options.body
-  }
-
-  // no body was provided
-  return undefined
-}

ファイルの差分が大きいため隠しています
+ 271 - 289
packages/sdk/js/src/gen/sdk.gen.ts


+ 88 - 93
packages/sdk/js/src/gen/types.gen.ts

@@ -1,9 +1,5 @@
 // This file is auto-generated by @hey-api/openapi-ts
 // This file is auto-generated by @hey-api/openapi-ts
 
 
-export type ClientOptions = {
-  baseUrl: `${string}://${string}` | (string & {})
-}
-
 export type EventServerInstanceDisposed = {
 export type EventServerInstanceDisposed = {
   type: "server.instance.disposed"
   type: "server.instance.disposed"
   properties: {
   properties: {
@@ -626,20 +622,22 @@ export type EventTuiCommandExecute = {
   type: "tui.command.execute"
   type: "tui.command.execute"
   properties: {
   properties: {
     command:
     command:
-      | "session.list"
-      | "session.new"
-      | "session.share"
-      | "session.interrupt"
-      | "session.compact"
-      | "session.page.up"
-      | "session.page.down"
-      | "session.half.page.up"
-      | "session.half.page.down"
-      | "session.first"
-      | "session.last"
-      | "prompt.clear"
-      | "prompt.submit"
-      | "agent.cycle"
+      | (
+          | "session.list"
+          | "session.new"
+          | "session.share"
+          | "session.interrupt"
+          | "session.compact"
+          | "session.page.up"
+          | "session.page.down"
+          | "session.half.page.up"
+          | "session.half.page.down"
+          | "session.first"
+          | "session.last"
+          | "prompt.clear"
+          | "prompt.submit"
+          | "agent.cycle"
+        )
       | string
       | string
   }
   }
 }
 }
@@ -979,9 +977,7 @@ export type AgentConfig = {
   permission?: {
   permission?: {
     edit?: "ask" | "allow" | "deny"
     edit?: "ask" | "allow" | "deny"
     bash?:
     bash?:
-      | "ask"
-      | "allow"
-      | "deny"
+      | ("ask" | "allow" | "deny")
       | {
       | {
           [key: string]: "ask" | "allow" | "deny"
           [key: string]: "ask" | "allow" | "deny"
         }
         }
@@ -997,17 +993,12 @@ export type AgentConfig = {
         [key: string]: boolean
         [key: string]: boolean
       }
       }
     | boolean
     | boolean
-    | "subagent"
-    | "primary"
-    | "all"
-    | string
+    | ("subagent" | "primary" | "all")
     | number
     | number
     | {
     | {
         edit?: "ask" | "allow" | "deny"
         edit?: "ask" | "allow" | "deny"
         bash?:
         bash?:
-          | "ask"
-          | "allow"
-          | "deny"
+          | ("ask" | "allow" | "deny")
           | {
           | {
               [key: string]: "ask" | "allow" | "deny"
               [key: string]: "ask" | "allow" | "deny"
             }
             }
@@ -1083,7 +1074,7 @@ export type ProviderConfig = {
      * Timeout in milliseconds for requests to this provider. Default is 300000 (5 minutes). Set to false to disable timeout.
      * Timeout in milliseconds for requests to this provider. Default is 300000 (5 minutes). Set to false to disable timeout.
      */
      */
     timeout?: number | false
     timeout?: number | false
-    [key: string]: unknown | string | boolean | number | false | undefined
+    [key: string]: unknown | string | boolean | (number | false) | undefined
   }
   }
 }
 }
 
 
@@ -1311,9 +1302,7 @@ export type Config = {
   permission?: {
   permission?: {
     edit?: "ask" | "allow" | "deny"
     edit?: "ask" | "allow" | "deny"
     bash?:
     bash?:
-      | "ask"
-      | "allow"
-      | "deny"
+      | ("ask" | "allow" | "deny")
       | {
       | {
           [key: string]: "ask" | "allow" | "deny"
           [key: string]: "ask" | "allow" | "deny"
         }
         }
@@ -1771,12 +1760,12 @@ export type PtyCreateResponse = PtyCreateResponses[keyof PtyCreateResponses]
 export type PtyRemoveData = {
 export type PtyRemoveData = {
   body?: never
   body?: never
   path: {
   path: {
-    ptyID: string
+    id: string
   }
   }
   query?: {
   query?: {
     directory?: string
     directory?: string
   }
   }
-  url: "/pty/{ptyID}"
+  url: "/pty/{id}"
 }
 }
 
 
 export type PtyRemoveErrors = {
 export type PtyRemoveErrors = {
@@ -1800,12 +1789,12 @@ export type PtyRemoveResponse = PtyRemoveResponses[keyof PtyRemoveResponses]
 export type PtyGetData = {
 export type PtyGetData = {
   body?: never
   body?: never
   path: {
   path: {
-    ptyID: string
+    id: string
   }
   }
   query?: {
   query?: {
     directory?: string
     directory?: string
   }
   }
-  url: "/pty/{ptyID}"
+  url: "/pty/{id}"
 }
 }
 
 
 export type PtyGetErrors = {
 export type PtyGetErrors = {
@@ -1835,12 +1824,12 @@ export type PtyUpdateData = {
     }
     }
   }
   }
   path: {
   path: {
-    ptyID: string
+    id: string
   }
   }
   query?: {
   query?: {
     directory?: string
     directory?: string
   }
   }
-  url: "/pty/{ptyID}"
+  url: "/pty/{id}"
 }
 }
 
 
 export type PtyUpdateErrors = {
 export type PtyUpdateErrors = {
@@ -1864,12 +1853,12 @@ export type PtyUpdateResponse = PtyUpdateResponses[keyof PtyUpdateResponses]
 export type PtyConnectData = {
 export type PtyConnectData = {
   body?: never
   body?: never
   path: {
   path: {
-    ptyID: string
+    id: string
   }
   }
   query?: {
   query?: {
     directory?: string
     directory?: string
   }
   }
-  url: "/pty/{ptyID}/connect"
+  url: "/pty/{id}/connect"
 }
 }
 
 
 export type PtyConnectErrors = {
 export type PtyConnectErrors = {
@@ -2125,12 +2114,12 @@ export type SessionStatusResponse = SessionStatusResponses[keyof SessionStatusRe
 export type SessionDeleteData = {
 export type SessionDeleteData = {
   body?: never
   body?: never
   path: {
   path: {
-    sessionID: string
+    id: string
   }
   }
   query?: {
   query?: {
     directory?: string
     directory?: string
   }
   }
-  url: "/session/{sessionID}"
+  url: "/session/{id}"
 }
 }
 
 
 export type SessionDeleteErrors = {
 export type SessionDeleteErrors = {
@@ -2158,12 +2147,12 @@ export type SessionDeleteResponse = SessionDeleteResponses[keyof SessionDeleteRe
 export type SessionGetData = {
 export type SessionGetData = {
   body?: never
   body?: never
   path: {
   path: {
-    sessionID: string
+    id: string
   }
   }
   query?: {
   query?: {
     directory?: string
     directory?: string
   }
   }
-  url: "/session/{sessionID}"
+  url: "/session/{id}"
 }
 }
 
 
 export type SessionGetErrors = {
 export type SessionGetErrors = {
@@ -2193,12 +2182,12 @@ export type SessionUpdateData = {
     title?: string
     title?: string
   }
   }
   path: {
   path: {
-    sessionID: string
+    id: string
   }
   }
   query?: {
   query?: {
     directory?: string
     directory?: string
   }
   }
-  url: "/session/{sessionID}"
+  url: "/session/{id}"
 }
 }
 
 
 export type SessionUpdateErrors = {
 export type SessionUpdateErrors = {
@@ -2226,12 +2215,12 @@ export type SessionUpdateResponse = SessionUpdateResponses[keyof SessionUpdateRe
 export type SessionChildrenData = {
 export type SessionChildrenData = {
   body?: never
   body?: never
   path: {
   path: {
-    sessionID: string
+    id: string
   }
   }
   query?: {
   query?: {
     directory?: string
     directory?: string
   }
   }
-  url: "/session/{sessionID}/children"
+  url: "/session/{id}/children"
 }
 }
 
 
 export type SessionChildrenErrors = {
 export type SessionChildrenErrors = {
@@ -2262,12 +2251,12 @@ export type SessionTodoData = {
     /**
     /**
      * Session ID
      * Session ID
      */
      */
-    sessionID: string
+    id: string
   }
   }
   query?: {
   query?: {
     directory?: string
     directory?: string
   }
   }
-  url: "/session/{sessionID}/todo"
+  url: "/session/{id}/todo"
 }
 }
 
 
 export type SessionTodoErrors = {
 export type SessionTodoErrors = {
@@ -2302,12 +2291,12 @@ export type SessionInitData = {
     /**
     /**
      * Session ID
      * Session ID
      */
      */
-    sessionID: string
+    id: string
   }
   }
   query?: {
   query?: {
     directory?: string
     directory?: string
   }
   }
-  url: "/session/{sessionID}/init"
+  url: "/session/{id}/init"
 }
 }
 
 
 export type SessionInitErrors = {
 export type SessionInitErrors = {
@@ -2337,12 +2326,12 @@ export type SessionForkData = {
     messageID?: string
     messageID?: string
   }
   }
   path: {
   path: {
-    sessionID: string
+    id: string
   }
   }
   query?: {
   query?: {
     directory?: string
     directory?: string
   }
   }
-  url: "/session/{sessionID}/fork"
+  url: "/session/{id}/fork"
 }
 }
 
 
 export type SessionForkResponses = {
 export type SessionForkResponses = {
@@ -2357,12 +2346,12 @@ export type SessionForkResponse = SessionForkResponses[keyof SessionForkResponse
 export type SessionAbortData = {
 export type SessionAbortData = {
   body?: never
   body?: never
   path: {
   path: {
-    sessionID: string
+    id: string
   }
   }
   query?: {
   query?: {
     directory?: string
     directory?: string
   }
   }
-  url: "/session/{sessionID}/abort"
+  url: "/session/{id}/abort"
 }
 }
 
 
 export type SessionAbortErrors = {
 export type SessionAbortErrors = {
@@ -2390,12 +2379,12 @@ export type SessionAbortResponse = SessionAbortResponses[keyof SessionAbortRespo
 export type SessionUnshareData = {
 export type SessionUnshareData = {
   body?: never
   body?: never
   path: {
   path: {
-    sessionID: string
+    id: string
   }
   }
   query?: {
   query?: {
     directory?: string
     directory?: string
   }
   }
-  url: "/session/{sessionID}/share"
+  url: "/session/{id}/share"
 }
 }
 
 
 export type SessionUnshareErrors = {
 export type SessionUnshareErrors = {
@@ -2423,12 +2412,12 @@ export type SessionUnshareResponse = SessionUnshareResponses[keyof SessionUnshar
 export type SessionShareData = {
 export type SessionShareData = {
   body?: never
   body?: never
   path: {
   path: {
-    sessionID: string
+    id: string
   }
   }
   query?: {
   query?: {
     directory?: string
     directory?: string
   }
   }
-  url: "/session/{sessionID}/share"
+  url: "/session/{id}/share"
 }
 }
 
 
 export type SessionShareErrors = {
 export type SessionShareErrors = {
@@ -2459,13 +2448,13 @@ export type SessionDiffData = {
     /**
     /**
      * Session ID
      * Session ID
      */
      */
-    sessionID: string
+    id: string
   }
   }
   query?: {
   query?: {
     directory?: string
     directory?: string
     messageID?: string
     messageID?: string
   }
   }
-  url: "/session/{sessionID}/diff"
+  url: "/session/{id}/diff"
 }
 }
 
 
 export type SessionDiffErrors = {
 export type SessionDiffErrors = {
@@ -2499,12 +2488,12 @@ export type SessionSummarizeData = {
     /**
     /**
      * Session ID
      * Session ID
      */
      */
-    sessionID: string
+    id: string
   }
   }
   query?: {
   query?: {
     directory?: string
     directory?: string
   }
   }
-  url: "/session/{sessionID}/summarize"
+  url: "/session/{id}/summarize"
 }
 }
 
 
 export type SessionSummarizeErrors = {
 export type SessionSummarizeErrors = {
@@ -2535,13 +2524,13 @@ export type SessionMessagesData = {
     /**
     /**
      * Session ID
      * Session ID
      */
      */
-    sessionID: string
+    id: string
   }
   }
   query?: {
   query?: {
     directory?: string
     directory?: string
     limit?: number
     limit?: number
   }
   }
-  url: "/session/{sessionID}/message"
+  url: "/session/{id}/message"
 }
 }
 
 
 export type SessionMessagesErrors = {
 export type SessionMessagesErrors = {
@@ -2588,12 +2577,12 @@ export type SessionPromptData = {
     /**
     /**
      * Session ID
      * Session ID
      */
      */
-    sessionID: string
+    id: string
   }
   }
   query?: {
   query?: {
     directory?: string
     directory?: string
   }
   }
-  url: "/session/{sessionID}/message"
+  url: "/session/{id}/message"
 }
 }
 
 
 export type SessionPromptErrors = {
 export type SessionPromptErrors = {
@@ -2627,7 +2616,7 @@ export type SessionMessageData = {
     /**
     /**
      * Session ID
      * Session ID
      */
      */
-    sessionID: string
+    id: string
     /**
     /**
      * Message ID
      * Message ID
      */
      */
@@ -2636,7 +2625,7 @@ export type SessionMessageData = {
   query?: {
   query?: {
     directory?: string
     directory?: string
   }
   }
-  url: "/session/{sessionID}/message/{messageID}"
+  url: "/session/{id}/message/{messageID}"
 }
 }
 
 
 export type SessionMessageErrors = {
 export type SessionMessageErrors = {
@@ -2683,12 +2672,12 @@ export type SessionPromptAsyncData = {
     /**
     /**
      * Session ID
      * Session ID
      */
      */
-    sessionID: string
+    id: string
   }
   }
   query?: {
   query?: {
     directory?: string
     directory?: string
   }
   }
-  url: "/session/{sessionID}/prompt_async"
+  url: "/session/{id}/prompt_async"
 }
 }
 
 
 export type SessionPromptAsyncErrors = {
 export type SessionPromptAsyncErrors = {
@@ -2725,12 +2714,12 @@ export type SessionCommandData = {
     /**
     /**
      * Session ID
      * Session ID
      */
      */
-    sessionID: string
+    id: string
   }
   }
   query?: {
   query?: {
     directory?: string
     directory?: string
   }
   }
-  url: "/session/{sessionID}/command"
+  url: "/session/{id}/command"
 }
 }
 
 
 export type SessionCommandErrors = {
 export type SessionCommandErrors = {
@@ -2771,12 +2760,12 @@ export type SessionShellData = {
     /**
     /**
      * Session ID
      * Session ID
      */
      */
-    sessionID: string
+    id: string
   }
   }
   query?: {
   query?: {
     directory?: string
     directory?: string
   }
   }
-  url: "/session/{sessionID}/shell"
+  url: "/session/{id}/shell"
 }
 }
 
 
 export type SessionShellErrors = {
 export type SessionShellErrors = {
@@ -2807,12 +2796,12 @@ export type SessionRevertData = {
     partID?: string
     partID?: string
   }
   }
   path: {
   path: {
-    sessionID: string
+    id: string
   }
   }
   query?: {
   query?: {
     directory?: string
     directory?: string
   }
   }
-  url: "/session/{sessionID}/revert"
+  url: "/session/{id}/revert"
 }
 }
 
 
 export type SessionRevertErrors = {
 export type SessionRevertErrors = {
@@ -2840,12 +2829,12 @@ export type SessionRevertResponse = SessionRevertResponses[keyof SessionRevertRe
 export type SessionUnrevertData = {
 export type SessionUnrevertData = {
   body?: never
   body?: never
   path: {
   path: {
-    sessionID: string
+    id: string
   }
   }
   query?: {
   query?: {
     directory?: string
     directory?: string
   }
   }
-  url: "/session/{sessionID}/unrevert"
+  url: "/session/{id}/unrevert"
 }
 }
 
 
 export type SessionUnrevertErrors = {
 export type SessionUnrevertErrors = {
@@ -2870,21 +2859,21 @@ export type SessionUnrevertResponses = {
 
 
 export type SessionUnrevertResponse = SessionUnrevertResponses[keyof SessionUnrevertResponses]
 export type SessionUnrevertResponse = SessionUnrevertResponses[keyof SessionUnrevertResponses]
 
 
-export type PermissionRespondData = {
+export type PostSessionIdPermissionsPermissionIdData = {
   body?: {
   body?: {
     response: "once" | "always" | "reject"
     response: "once" | "always" | "reject"
   }
   }
   path: {
   path: {
-    sessionID: string
+    id: string
     permissionID: string
     permissionID: string
   }
   }
   query?: {
   query?: {
     directory?: string
     directory?: string
   }
   }
-  url: "/session/{sessionID}/permissions/{permissionID}"
+  url: "/session/{id}/permissions/{permissionID}"
 }
 }
 
 
-export type PermissionRespondErrors = {
+export type PostSessionIdPermissionsPermissionIdErrors = {
   /**
   /**
    * Bad request
    * Bad request
    */
    */
@@ -2895,16 +2884,18 @@ export type PermissionRespondErrors = {
   404: NotFoundError
   404: NotFoundError
 }
 }
 
 
-export type PermissionRespondError = PermissionRespondErrors[keyof PermissionRespondErrors]
+export type PostSessionIdPermissionsPermissionIdError =
+  PostSessionIdPermissionsPermissionIdErrors[keyof PostSessionIdPermissionsPermissionIdErrors]
 
 
-export type PermissionRespondResponses = {
+export type PostSessionIdPermissionsPermissionIdResponses = {
   /**
   /**
    * Permission processed successfully
    * Permission processed successfully
    */
    */
   200: boolean
   200: boolean
 }
 }
 
 
-export type PermissionRespondResponse = PermissionRespondResponses[keyof PermissionRespondResponses]
+export type PostSessionIdPermissionsPermissionIdResponse =
+  PostSessionIdPermissionsPermissionIdResponses[keyof PostSessionIdPermissionsPermissionIdResponses]
 
 
 export type CommandListData = {
 export type CommandListData = {
   body?: never
   body?: never
@@ -3050,12 +3041,12 @@ export type ProviderOauthAuthorizeData = {
     /**
     /**
      * Provider ID
      * Provider ID
      */
      */
-    providerID: string
+    id: string
   }
   }
   query?: {
   query?: {
     directory?: string
     directory?: string
   }
   }
-  url: "/provider/{providerID}/oauth/authorize"
+  url: "/provider/{id}/oauth/authorize"
 }
 }
 
 
 export type ProviderOauthAuthorizeErrors = {
 export type ProviderOauthAuthorizeErrors = {
@@ -3091,12 +3082,12 @@ export type ProviderOauthCallbackData = {
     /**
     /**
      * Provider ID
      * Provider ID
      */
      */
-    providerID: string
+    id: string
   }
   }
   query?: {
   query?: {
     directory?: string
     directory?: string
   }
   }
-  url: "/provider/{providerID}/oauth/callback"
+  url: "/provider/{id}/oauth/callback"
 }
 }
 
 
 export type ProviderOauthCallbackErrors = {
 export type ProviderOauthCallbackErrors = {
@@ -3800,12 +3791,12 @@ export type TuiControlResponseResponse = TuiControlResponseResponses[keyof TuiCo
 export type AuthSetData = {
 export type AuthSetData = {
   body?: Auth
   body?: Auth
   path: {
   path: {
-    providerID: string
+    id: string
   }
   }
   query?: {
   query?: {
     directory?: string
     directory?: string
   }
   }
-  url: "/auth/{providerID}"
+  url: "/auth/{id}"
 }
 }
 
 
 export type AuthSetErrors = {
 export type AuthSetErrors = {
@@ -3843,3 +3834,7 @@ export type EventSubscribeResponses = {
 }
 }
 
 
 export type EventSubscribeResponse = EventSubscribeResponses[keyof EventSubscribeResponses]
 export type EventSubscribeResponse = EventSubscribeResponses[keyof EventSubscribeResponses]
+
+export type ClientOptions = {
+  baseUrl: `${string}://${string}` | (string & {})
+}

この差分においてかなりの量のファイルが変更されているため、一部のファイルを表示していません