Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1527a2260f | |||
| 8d71e43508 |
@@ -433,7 +433,7 @@ export async function CodexAuthPlugin(input: PluginInput): Promise<Hooks> {
|
||||
const tokens = await refreshAccessToken(currentAuth.refresh)
|
||||
const newAccountId = extractAccountId(tokens) || authWithAccount.accountId
|
||||
await input.client.auth.set({
|
||||
path: { id: "openai" },
|
||||
path: { providerID: "openai" },
|
||||
body: {
|
||||
type: "oauth",
|
||||
refresh: tokens.refresh_token,
|
||||
|
||||
@@ -332,7 +332,7 @@ export async function DigitalOceanAuthPlugin(input: PluginInput): Promise<Hooks>
|
||||
}
|
||||
await input.client.auth
|
||||
.set({
|
||||
path: { id: "digitalocean" },
|
||||
path: { providerID: "digitalocean" },
|
||||
body: { type: "api", key: ctx.auth.key, metadata: updated },
|
||||
})
|
||||
.catch((err) => log.warn("failed to persist refreshed routers", { error: err }))
|
||||
|
||||
@@ -124,7 +124,6 @@ export const layer = Layer.effect(
|
||||
}
|
||||
|
||||
const { Server } = yield* Effect.promise(() => import("../server/server"))
|
||||
|
||||
const client = createOpencodeClient({
|
||||
baseUrl: "http://localhost:4096",
|
||||
directory: ctx.directory,
|
||||
|
||||
@@ -130,7 +130,7 @@ describe("StructuredOutput Integration", () => {
|
||||
)
|
||||
|
||||
live(
|
||||
"works with text outputFormat (default)",
|
||||
"works with text format (default)",
|
||||
() =>
|
||||
Effect.gen(function* () {
|
||||
const prompt = yield* SessionPrompt.Service
|
||||
@@ -168,7 +168,7 @@ describe("StructuredOutput Integration", () => {
|
||||
)
|
||||
|
||||
live(
|
||||
"stores outputFormat on user message",
|
||||
"stores format on user message",
|
||||
() =>
|
||||
Effect.gen(function* () {
|
||||
const prompt = yield* SessionPrompt.Service
|
||||
@@ -200,7 +200,7 @@ describe("StructuredOutput Integration", () => {
|
||||
const messages = yield* sessions.messages({ sessionID: session.id })
|
||||
const userMessage = messages.find((m) => m.info.role === "user")
|
||||
|
||||
// Verify outputFormat was stored on user message
|
||||
// Verify format was stored on user message
|
||||
expect(userMessage).toBeDefined()
|
||||
if (userMessage?.info.role === "user") {
|
||||
expect(userMessage.info.format).toBeDefined()
|
||||
|
||||
@@ -99,7 +99,7 @@ describe("structured-output.StructuredOutputError", () => {
|
||||
})
|
||||
|
||||
describe("structured-output.UserMessage", () => {
|
||||
test("user message accepts outputFormat", () => {
|
||||
test("user message accepts format", () => {
|
||||
const result = decodeUser({
|
||||
id: MessageID.ascending(),
|
||||
sessionID: SessionID.descending(),
|
||||
@@ -107,7 +107,7 @@ describe("structured-output.UserMessage", () => {
|
||||
time: { created: Date.now() },
|
||||
agent: "default",
|
||||
model: { providerID: "anthropic", modelID: "claude-3" },
|
||||
outputFormat: {
|
||||
format: {
|
||||
type: "json_schema",
|
||||
schema: { type: "object" },
|
||||
},
|
||||
@@ -115,7 +115,7 @@ describe("structured-output.UserMessage", () => {
|
||||
expect(Exit.isSuccess(result)).toBe(true)
|
||||
})
|
||||
|
||||
test("user message works without outputFormat (optional)", () => {
|
||||
test("user message works without format (optional)", () => {
|
||||
const result = decodeUser({
|
||||
id: MessageID.ascending(),
|
||||
sessionID: SessionID.descending(),
|
||||
|
||||
@@ -4,7 +4,7 @@ import type {
|
||||
Project,
|
||||
Model,
|
||||
Provider,
|
||||
Permission,
|
||||
PermissionRequest,
|
||||
UserMessage,
|
||||
Message,
|
||||
Part,
|
||||
@@ -67,8 +67,16 @@ export type PluginInput = {
|
||||
|
||||
export type PluginOptions = Record<string, unknown>
|
||||
|
||||
type TuiConfig = {
|
||||
scroll_speed?: number
|
||||
scroll_acceleration?: { enabled?: boolean }
|
||||
diff_style?: "auto" | "stacked"
|
||||
}
|
||||
|
||||
export type Config = Omit<SDKConfig, "plugin"> & {
|
||||
plugin?: Array<string | [string, PluginOptions]>
|
||||
theme?: string
|
||||
tui?: TuiConfig
|
||||
}
|
||||
|
||||
export type Plugin = (input: PluginInput, options?: PluginOptions) => Promise<Hooks>
|
||||
@@ -257,7 +265,7 @@ export interface Hooks {
|
||||
input: { sessionID: string; agent: string; model: Model; provider: ProviderContext; message: UserMessage },
|
||||
output: { headers: Record<string, string> },
|
||||
) => Promise<void>
|
||||
"permission.ask"?: (input: Permission, output: { status: "ask" | "deny" | "allow" }) => Promise<void>
|
||||
"permission.ask"?: (input: PermissionRequest, output: { status: "ask" | "deny" | "allow" }) => Promise<void>
|
||||
"command.execute.before"?: (
|
||||
input: { command: string; sessionID: string; arguments: string },
|
||||
output: { parts: Part[] },
|
||||
|
||||
@@ -12,6 +12,33 @@ import { createClient } from "@hey-api/openapi-ts"
|
||||
const opencode = path.resolve(dir, "../../opencode")
|
||||
|
||||
await $`bun dev generate > ${dir}/openapi.json`.cwd(opencode)
|
||||
await Bun.write(path.join(dir, "openapi-legacy.json"), JSON.stringify(legacyOpenApi(await Bun.file("openapi.json").json())))
|
||||
|
||||
await createClient({
|
||||
input: "./openapi-legacy.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({
|
||||
input: "./openapi.json",
|
||||
@@ -45,3 +72,27 @@ await $`bun prettier --write src/v2`
|
||||
await $`rm -rf dist`
|
||||
await $`bun tsc`
|
||||
await $`rm openapi.json`
|
||||
await $`rm openapi-legacy.json`
|
||||
|
||||
type OpenApiSpec = {
|
||||
paths: Record<string, Record<string, { parameters?: Array<{ name: string; in: string }> }>>
|
||||
}
|
||||
|
||||
function legacyOpenApi(input: OpenApiSpec) {
|
||||
const spec = structuredClone(input)
|
||||
spec.paths = Object.fromEntries(
|
||||
Object.entries(spec.paths)
|
||||
.filter(([route]) => route !== "/api" && !route.startsWith("/api/"))
|
||||
.map(([route, item]) => [route.replaceAll("{sessionID}", "{id}"), renameLegacyPathParameters(item)]),
|
||||
)
|
||||
return spec
|
||||
}
|
||||
|
||||
function renameLegacyPathParameters(item: OpenApiSpec["paths"][string]) {
|
||||
for (const operation of Object.values(item)) {
|
||||
for (const parameter of operation.parameters ?? []) {
|
||||
if (parameter.in === "path" && parameter.name === "sessionID") parameter.name = "id"
|
||||
}
|
||||
}
|
||||
return item
|
||||
}
|
||||
|
||||
@@ -4,7 +4,10 @@ import { createClient } from "./gen/client/client.gen.js"
|
||||
import { type Config } from "./gen/client/types.gen.js"
|
||||
import { OpencodeClient } from "./gen/sdk.gen.js"
|
||||
import { wrapClientError } from "./error-interceptor.js"
|
||||
export { type Config as OpencodeClientConfig, OpencodeClient }
|
||||
export { OpencodeClient }
|
||||
|
||||
type Fetch = (request: Request) => ReturnType<typeof fetch>
|
||||
export type OpencodeClientConfig = Omit<Config, "fetch"> & { fetch?: Fetch; directory?: string }
|
||||
|
||||
function pick(value: string | null, fallback?: string) {
|
||||
if (!value) return
|
||||
@@ -30,9 +33,18 @@ function rewrite(request: Request, directory?: string) {
|
||||
return next
|
||||
}
|
||||
|
||||
export function createOpencodeClient(config?: Config & { directory?: string }) {
|
||||
function toFetch(input: Fetch | undefined): typeof fetch | undefined {
|
||||
if (!input) return
|
||||
return Object.assign(
|
||||
async (value: Parameters<typeof fetch>[0], init?: Parameters<typeof fetch>[1]) =>
|
||||
input(value instanceof Request && init === undefined ? value : new Request(value, init)),
|
||||
fetch,
|
||||
)
|
||||
}
|
||||
|
||||
export function createOpencodeClient(config?: OpencodeClientConfig) {
|
||||
if (!config?.fetch) {
|
||||
const customFetch: any = (req: any) => {
|
||||
const customFetch: Fetch = (req) => {
|
||||
// @ts-ignore
|
||||
req.timeout = false
|
||||
return fetch(req)
|
||||
@@ -50,7 +62,7 @@ export function createOpencodeClient(config?: Config & { directory?: string }) {
|
||||
}
|
||||
}
|
||||
|
||||
const client = createClient(config)
|
||||
const client = createClient({ ...config, fetch: toFetch(config?.fetch) })
|
||||
client.interceptors.request.use((request) => rewrite(request, config?.directory))
|
||||
client.interceptors.error.use(wrapClientError)
|
||||
return new OpencodeClient({ client })
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// 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 ClientOptions, type Config, createClient, createConfig } from "./client/index.js"
|
||||
import type { ClientOptions as ClientOptions2 } from "./types.gen.js"
|
||||
|
||||
/**
|
||||
* The `createClientConfig()` function will be called on client initialization
|
||||
@@ -11,12 +11,8 @@ import { type Config, type ClientOptions as DefaultClientOptions, createClient,
|
||||
* `setConfig()`. This is useful for example if you're using Next.js
|
||||
* to ensure your client always has the correct values.
|
||||
*/
|
||||
export type CreateClientConfig<T extends DefaultClientOptions = ClientOptions> = (
|
||||
override?: Config<DefaultClientOptions & T>,
|
||||
) => Config<Required<DefaultClientOptions> & T>
|
||||
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (
|
||||
override?: Config<ClientOptions & T>,
|
||||
) => Config<Required<ClientOptions> & T>
|
||||
|
||||
export const client = createClient(
|
||||
createConfig<ClientOptions>({
|
||||
baseUrl: "http://localhost:4096",
|
||||
}),
|
||||
)
|
||||
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: "http://localhost:4096" }))
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
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 {
|
||||
buildUrl,
|
||||
@@ -49,12 +51,12 @@ export const createClient = (config: Config = {}): Client => {
|
||||
await opts.requestValidator(opts)
|
||||
}
|
||||
|
||||
if (opts.body && opts.bodySerializer) {
|
||||
if (opts.body !== undefined && opts.bodySerializer) {
|
||||
opts.serializedBody = opts.bodySerializer(opts.body)
|
||||
}
|
||||
|
||||
// remove Content-Type header if body is empty to avoid sending invalid requests
|
||||
if (opts.serializedBody === undefined || opts.serializedBody === "") {
|
||||
if (opts.body === undefined || opts.serializedBody === "") {
|
||||
opts.headers.delete("Content-Type")
|
||||
}
|
||||
|
||||
@@ -69,12 +71,12 @@ export const createClient = (config: Config = {}): Client => {
|
||||
const requestInit: ReqInit = {
|
||||
redirect: "follow",
|
||||
...opts,
|
||||
body: opts.serializedBody,
|
||||
body: getValidRequestBody(opts),
|
||||
}
|
||||
|
||||
let request = new Request(url, requestInit)
|
||||
|
||||
for (const fn of interceptors.request._fns) {
|
||||
for (const fn of interceptors.request.fns) {
|
||||
if (fn) {
|
||||
request = await fn(request, opts)
|
||||
}
|
||||
@@ -83,9 +85,37 @@ export const createClient = (config: Config = {}): Client => {
|
||||
// fetch must be assigned here, otherwise it would throw the error:
|
||||
// TypeError: Failed to execute 'fetch' on 'Window': Illegal invocation
|
||||
const _fetch = opts.fetch!
|
||||
let response = await _fetch(request)
|
||||
let response: Response
|
||||
|
||||
for (const fn of interceptors.response._fns) {
|
||||
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) {
|
||||
if (fn) {
|
||||
response = await fn(response, request, opts)
|
||||
}
|
||||
@@ -97,27 +127,51 @@ export const createClient = (config: Config = {}): Client => {
|
||||
}
|
||||
|
||||
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") {
|
||||
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"
|
||||
? {}
|
||||
? emptyData
|
||||
: {
|
||||
data: {},
|
||||
data: emptyData,
|
||||
...result,
|
||||
}
|
||||
}
|
||||
|
||||
const parseAs =
|
||||
(opts.parseAs === "auto" ? getParseAs(response.headers.get("Content-Type")) : opts.parseAs) ?? "json"
|
||||
|
||||
let data: any
|
||||
switch (parseAs) {
|
||||
case "arrayBuffer":
|
||||
case "blob":
|
||||
case "formData":
|
||||
case "json":
|
||||
case "text":
|
||||
data = await response[parseAs]()
|
||||
break
|
||||
case "json": {
|
||||
// Some servers return 200 with no Content-Length and empty body.
|
||||
// response.json() would throw; read as text and parse if non-empty.
|
||||
const text = await response.text()
|
||||
data = text ? JSON.parse(text) : {}
|
||||
break
|
||||
}
|
||||
case "stream":
|
||||
return opts.responseStyle === "data"
|
||||
? response.body
|
||||
@@ -157,7 +211,7 @@ export const createClient = (config: Config = {}): Client => {
|
||||
const error = jsonError ?? textError
|
||||
let finalError = error
|
||||
|
||||
for (const fn of interceptors.error._fns) {
|
||||
for (const fn of interceptors.error.fns) {
|
||||
if (fn) {
|
||||
finalError = (await fn(error, response, request, opts)) as string
|
||||
}
|
||||
@@ -178,35 +232,54 @@ export const createClient = (config: Config = {}): Client => {
|
||||
}
|
||||
}
|
||||
|
||||
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
|
||||
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
|
||||
},
|
||||
serializedBody: getValidRequestBody(opts) as BodyInit | null | undefined,
|
||||
url,
|
||||
})
|
||||
}
|
||||
|
||||
return {
|
||||
buildUrl,
|
||||
connect: makeMethod("CONNECT"),
|
||||
delete: makeMethod("DELETE"),
|
||||
get: makeMethod("GET"),
|
||||
connect: makeMethodFn("CONNECT"),
|
||||
delete: makeMethodFn("DELETE"),
|
||||
get: makeMethodFn("GET"),
|
||||
getConfig,
|
||||
head: makeMethod("HEAD"),
|
||||
head: makeMethodFn("HEAD"),
|
||||
interceptors,
|
||||
options: makeMethod("OPTIONS"),
|
||||
patch: makeMethod("PATCH"),
|
||||
post: makeMethod("POST"),
|
||||
put: makeMethod("PUT"),
|
||||
options: makeMethodFn("OPTIONS"),
|
||||
patch: makeMethodFn("PATCH"),
|
||||
post: makeMethodFn("POST"),
|
||||
put: makeMethodFn("PUT"),
|
||||
request,
|
||||
setConfig,
|
||||
trace: makeMethod("TRACE"),
|
||||
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"),
|
||||
} as Client
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ export {
|
||||
urlSearchParamsBodySerializer,
|
||||
} from "../core/bodySerializer.gen.js"
|
||||
export { buildClientParams } from "../core/params.gen.js"
|
||||
export { serializeQueryKeyValue } from "../core/queryKeySerializer.gen.js"
|
||||
export { createClient } from "./client.gen.js"
|
||||
export type {
|
||||
Client,
|
||||
@@ -15,7 +16,6 @@ export type {
|
||||
Config,
|
||||
CreateClientConfig,
|
||||
Options,
|
||||
OptionsLegacyParser,
|
||||
RequestOptions,
|
||||
RequestResult,
|
||||
ResolvedRequestOptions,
|
||||
|
||||
@@ -20,7 +20,7 @@ export interface Config<T extends ClientOptions = ClientOptions>
|
||||
*
|
||||
* @default globalThis.fetch
|
||||
*/
|
||||
fetch?: (request: Request) => ReturnType<typeof fetch>
|
||||
fetch?: typeof fetch
|
||||
/**
|
||||
* Please don't use the Fetch client for Next.js applications. The `next`
|
||||
* options won't have any effect.
|
||||
@@ -128,7 +128,7 @@ export interface ClientOptions {
|
||||
throwOnError?: boolean
|
||||
}
|
||||
|
||||
type MethodFnBase = <
|
||||
type MethodFn = <
|
||||
TData = unknown,
|
||||
TError = unknown,
|
||||
ThrowOnError extends boolean = false,
|
||||
@@ -137,7 +137,7 @@ type MethodFnBase = <
|
||||
options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, "method">,
|
||||
) => RequestResult<TData, TError, ThrowOnError, TResponseStyle>
|
||||
|
||||
type MethodFnServerSentEvents = <
|
||||
type SseFn = <
|
||||
TData = unknown,
|
||||
TError = unknown,
|
||||
ThrowOnError extends boolean = false,
|
||||
@@ -146,10 +146,6 @@ type MethodFnServerSentEvents = <
|
||||
options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, "method">,
|
||||
) => Promise<ServerSentEventsResult<TData, TError>>
|
||||
|
||||
type MethodFn = MethodFnBase & {
|
||||
sse: MethodFnServerSentEvents
|
||||
}
|
||||
|
||||
type RequestFn = <
|
||||
TData = unknown,
|
||||
TError = unknown,
|
||||
@@ -168,10 +164,10 @@ type BuildUrlFn = <
|
||||
url: string
|
||||
},
|
||||
>(
|
||||
options: Pick<TData, "url"> & Options<TData>,
|
||||
options: TData & Options<TData>,
|
||||
) => string
|
||||
|
||||
export type Client = CoreClient<RequestFn, Config, MethodFn, BuildUrlFn> & {
|
||||
export type Client = CoreClient<RequestFn, Config, MethodFn, BuildUrlFn, SseFn> & {
|
||||
interceptors: Middleware<Request, Response, unknown, ResolvedRequestOptions>
|
||||
}
|
||||
|
||||
@@ -203,20 +199,4 @@ export type Options<
|
||||
TResponse = unknown,
|
||||
TResponseStyle extends ResponseStyle = "fields",
|
||||
> = OmitKeys<RequestOptions<TResponse, TResponseStyle, ThrowOnError>, "body" | "path" | "query" | "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
|
||||
([TData] extends [never] ? unknown : Omit<TData, "url">)
|
||||
|
||||
@@ -7,7 +7,7 @@ import { serializeArrayParam, serializeObjectParam, serializePrimitiveParam } fr
|
||||
import { getUrl } from "../core/utils.gen.js"
|
||||
import type { Client, ClientOptions, Config, RequestOptions } from "./types.gen.js"
|
||||
|
||||
export const createQuerySerializer = <T = unknown>({ allowReserved, array, object }: QuerySerializerOptions = {}) => {
|
||||
export const createQuerySerializer = <T = unknown>({ parameters = {}, ...args }: QuerySerializerOptions = {}) => {
|
||||
const querySerializer = (queryParams: T) => {
|
||||
const search: string[] = []
|
||||
if (queryParams && typeof queryParams === "object") {
|
||||
@@ -18,29 +18,31 @@ export const createQuerySerializer = <T = unknown>({ allowReserved, array, objec
|
||||
continue
|
||||
}
|
||||
|
||||
const options = parameters[name] || args
|
||||
|
||||
if (Array.isArray(value)) {
|
||||
const serializedArray = serializeArrayParam({
|
||||
allowReserved,
|
||||
allowReserved: options.allowReserved,
|
||||
explode: true,
|
||||
name,
|
||||
style: "form",
|
||||
value,
|
||||
...array,
|
||||
...options.array,
|
||||
})
|
||||
if (serializedArray) search.push(serializedArray)
|
||||
} else if (typeof value === "object") {
|
||||
const serializedObject = serializeObjectParam({
|
||||
allowReserved,
|
||||
allowReserved: options.allowReserved,
|
||||
explode: true,
|
||||
name,
|
||||
style: "deepObject",
|
||||
value: value as Record<string, unknown>,
|
||||
...object,
|
||||
...options.object,
|
||||
})
|
||||
if (serializedObject) search.push(serializedObject)
|
||||
} else {
|
||||
const serializedPrimitive = serializePrimitiveParam({
|
||||
allowReserved,
|
||||
allowReserved: options.allowReserved,
|
||||
name,
|
||||
value: value as string,
|
||||
})
|
||||
@@ -162,14 +164,22 @@ export const mergeConfigs = (a: Config, b: Config): 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 => {
|
||||
const mergedHeaders = new Headers()
|
||||
for (const header of headers) {
|
||||
if (!header || typeof header !== "object") {
|
||||
if (!header) {
|
||||
continue
|
||||
}
|
||||
|
||||
const iterator = header instanceof Headers ? header.entries() : Object.entries(header)
|
||||
const iterator = header instanceof Headers ? headersEntries(header) : Object.entries(header)
|
||||
|
||||
for (const [key, value] of iterator) {
|
||||
if (value === null) {
|
||||
@@ -200,61 +210,53 @@ type ReqInterceptor<Req, Options> = (request: Req, options: Options) => Req | Pr
|
||||
type ResInterceptor<Res, Req, Options> = (response: Res, request: Req, options: Options) => Res | Promise<Res>
|
||||
|
||||
class Interceptors<Interceptor> {
|
||||
_fns: (Interceptor | null)[]
|
||||
fns: Array<Interceptor | null> = []
|
||||
|
||||
constructor() {
|
||||
this._fns = []
|
||||
clear(): void {
|
||||
this.fns = []
|
||||
}
|
||||
|
||||
clear() {
|
||||
this._fns = []
|
||||
eject(id: number | Interceptor): void {
|
||||
const index = this.getInterceptorIndex(id)
|
||||
if (this.fns[index]) {
|
||||
this.fns[index] = null
|
||||
}
|
||||
}
|
||||
|
||||
exists(id: number | Interceptor): boolean {
|
||||
const index = this.getInterceptorIndex(id)
|
||||
return Boolean(this.fns[index])
|
||||
}
|
||||
|
||||
getInterceptorIndex(id: number | Interceptor): number {
|
||||
if (typeof id === "number") {
|
||||
return this._fns[id] ? id : -1
|
||||
} else {
|
||||
return this._fns.indexOf(id)
|
||||
return this.fns[id] ? id : -1
|
||||
}
|
||||
}
|
||||
exists(id: number | Interceptor) {
|
||||
const index = this.getInterceptorIndex(id)
|
||||
return !!this._fns[index]
|
||||
return this.fns.indexOf(id)
|
||||
}
|
||||
|
||||
eject(id: number | Interceptor) {
|
||||
update(id: number | Interceptor, fn: Interceptor): number | Interceptor | false {
|
||||
const index = this.getInterceptorIndex(id)
|
||||
if (this._fns[index]) {
|
||||
this._fns[index] = null
|
||||
}
|
||||
}
|
||||
|
||||
update(id: number | Interceptor, fn: Interceptor) {
|
||||
const index = this.getInterceptorIndex(id)
|
||||
if (this._fns[index]) {
|
||||
this._fns[index] = fn
|
||||
if (this.fns[index]) {
|
||||
this.fns[index] = fn
|
||||
return id
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
use(fn: Interceptor) {
|
||||
this._fns = [...this._fns, fn]
|
||||
return this._fns.length - 1
|
||||
use(fn: Interceptor): number {
|
||||
this.fns.push(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> {
|
||||
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">
|
||||
error: Interceptors<ErrInterceptor<Err, Res, Req, Options>>
|
||||
request: Interceptors<ReqInterceptor<Req, Options>>
|
||||
response: Interceptors<ResInterceptor<Res, Req, Options>>
|
||||
}
|
||||
|
||||
// do not add `Middleware` as return type so we can use _fns internally
|
||||
export const createInterceptors = <Req, Res, Err, Options>() => ({
|
||||
export const createInterceptors = <Req, Res, Err, Options>(): Middleware<Req, Res, Err, Options> => ({
|
||||
error: new Interceptors<ErrInterceptor<Err, Res, Req, Options>>(),
|
||||
request: new Interceptors<ReqInterceptor<Req, Options>>(),
|
||||
response: new Interceptors<ResInterceptor<Res, Req, Options>>(),
|
||||
|
||||
@@ -6,10 +6,18 @@ export type QuerySerializer = (query: Record<string, unknown>) => string
|
||||
|
||||
export type BodySerializer = (body: any) => any
|
||||
|
||||
export interface QuerySerializerOptions {
|
||||
type QuerySerializerOptionsObject = {
|
||||
allowReserved?: boolean
|
||||
array?: SerializerOptions<ArrayStyle>
|
||||
object?: SerializerOptions<ObjectStyle>
|
||||
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>
|
||||
}
|
||||
|
||||
const serializeFormDataPair = (data: FormData, key: string, value: unknown): void => {
|
||||
|
||||
@@ -23,6 +23,17 @@ export type Field =
|
||||
key?: 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 {
|
||||
allowExtra?: Partial<Record<Slot, boolean>>
|
||||
@@ -41,10 +52,14 @@ const extraPrefixes = Object.entries(extraPrefixesMap)
|
||||
|
||||
type KeyMap = Map<
|
||||
string,
|
||||
{
|
||||
in: Slot
|
||||
map?: string
|
||||
}
|
||||
| {
|
||||
in: Slot
|
||||
map?: string
|
||||
}
|
||||
| {
|
||||
in?: never
|
||||
map: Slot
|
||||
}
|
||||
>
|
||||
|
||||
const buildKeyMap = (fields: FieldsConfig, map?: KeyMap): KeyMap => {
|
||||
@@ -60,6 +75,10 @@ const buildKeyMap = (fields: FieldsConfig, map?: KeyMap): KeyMap => {
|
||||
map: config.map,
|
||||
})
|
||||
}
|
||||
} else if ("key" in config) {
|
||||
map.set(config.key, {
|
||||
map: config.map,
|
||||
})
|
||||
} else if (config.args) {
|
||||
buildKeyMap(config.args, map)
|
||||
}
|
||||
@@ -108,7 +127,9 @@ export const buildClientParams = (args: ReadonlyArray<unknown>, fields: FieldsCo
|
||||
if (config.key) {
|
||||
const field = map.get(config.key)!
|
||||
const name = field.map || config.key
|
||||
;(params[field.in] as Record<string, unknown>)[name] = arg
|
||||
if (field.in) {
|
||||
;(params[field.in] as Record<string, unknown>)[name] = arg
|
||||
}
|
||||
} else {
|
||||
params.body = arg
|
||||
}
|
||||
@@ -117,16 +138,20 @@ export const buildClientParams = (args: ReadonlyArray<unknown>, fields: FieldsCo
|
||||
const field = map.get(key)
|
||||
|
||||
if (field) {
|
||||
const name = field.map || key
|
||||
;(params[field.in] as Record<string, unknown>)[name] = value
|
||||
if (field.in) {
|
||||
const name = field.map || key
|
||||
;(params[field.in] as Record<string, unknown>)[name] = value
|
||||
} else {
|
||||
params[field.map] = value
|
||||
}
|
||||
} else {
|
||||
const extra = extraPrefixes.find(([prefix]) => key.startsWith(prefix))
|
||||
|
||||
if (extra) {
|
||||
const [prefix, slot] = extra
|
||||
;(params[slot] as Record<string, unknown>)[key.slice(prefix.length)] = value
|
||||
} else {
|
||||
for (const [slot, allowed] of Object.entries(config.allowExtra ?? {})) {
|
||||
} else if ("allowExtra" in config && config.allowExtra) {
|
||||
for (const [slot, allowed] of Object.entries(config.allowExtra)) {
|
||||
if (allowed) {
|
||||
;(params[slot as Slot] as Record<string, unknown>)[key] = value
|
||||
break
|
||||
|
||||
@@ -4,6 +4,17 @@ import type { Config } from "./types.gen.js"
|
||||
|
||||
export type ServerSentEventsOptions<TData = unknown> = Omit<RequestInit, "method"> &
|
||||
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.
|
||||
*
|
||||
@@ -21,6 +32,7 @@ export type ServerSentEventsOptions<TData = unknown> = Omit<RequestInit, "method
|
||||
* @returns Nothing (void).
|
||||
*/
|
||||
onSseEvent?: (event: StreamEvent<TData>) => void
|
||||
serializedBody?: RequestInit["body"]
|
||||
/**
|
||||
* Default retry delay in milliseconds.
|
||||
*
|
||||
@@ -64,6 +76,7 @@ export type ServerSentEventsResult<TData = unknown, TReturn = void, TNext = unkn
|
||||
}
|
||||
|
||||
export const createSseClient = <TData = unknown>({
|
||||
onRequest,
|
||||
onSseError,
|
||||
onSseEvent,
|
||||
responseTransformer,
|
||||
@@ -99,7 +112,21 @@ export const createSseClient = <TData = unknown>({
|
||||
}
|
||||
|
||||
try {
|
||||
const response = await fetch(url, { ...options, headers, signal })
|
||||
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)
|
||||
|
||||
if (!response.ok) throw new Error(`SSE failed: ${response.status} ${response.statusText}`)
|
||||
|
||||
@@ -111,7 +138,7 @@ export const createSseClient = <TData = unknown>({
|
||||
|
||||
const abortHandler = () => {
|
||||
try {
|
||||
void reader.cancel()
|
||||
reader.cancel()
|
||||
} catch {
|
||||
// noop
|
||||
}
|
||||
@@ -124,6 +151,8 @@ export const createSseClient = <TData = unknown>({
|
||||
const { done, value } = await reader.read()
|
||||
if (done) break
|
||||
buffer += value
|
||||
// Normalize line endings: CRLF -> LF, then CR -> LF
|
||||
buffer = buffer.replace(/\r\n/g, "\n").replace(/\r/g, "\n")
|
||||
|
||||
const chunks = buffer.split("\n\n")
|
||||
buffer = chunks.pop() ?? ""
|
||||
|
||||
@@ -3,24 +3,19 @@
|
||||
import type { Auth, AuthToken } from "./auth.gen.js"
|
||||
import type { BodySerializer, QuerySerializer, QuerySerializerOptions } from "./bodySerializer.gen.js"
|
||||
|
||||
export interface Client<RequestFn = never, Config = unknown, MethodFn = never, BuildUrlFn = never> {
|
||||
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> = {
|
||||
/**
|
||||
* Returns the final request URL.
|
||||
*/
|
||||
buildUrl: BuildUrlFn
|
||||
connect: MethodFn
|
||||
delete: MethodFn
|
||||
get: MethodFn
|
||||
getConfig: () => Config
|
||||
head: MethodFn
|
||||
options: MethodFn
|
||||
patch: MethodFn
|
||||
post: MethodFn
|
||||
put: MethodFn
|
||||
request: RequestFn
|
||||
setConfig: (config: Config) => Config
|
||||
trace: MethodFn
|
||||
}
|
||||
} & {
|
||||
[K in HttpMethod]: MethodFn
|
||||
} & ([SseFn] extends [never] ? { sse?: never } : { sse: { [K in HttpMethod]: SseFn } })
|
||||
|
||||
export interface Config {
|
||||
/**
|
||||
@@ -47,7 +42,7 @@ export interface Config {
|
||||
*
|
||||
* {@link https://developer.mozilla.org/docs/Web/API/fetch#method See more}
|
||||
*/
|
||||
method?: "CONNECT" | "DELETE" | "GET" | "HEAD" | "OPTIONS" | "PATCH" | "POST" | "PUT" | "TRACE"
|
||||
method?: Uppercase<HttpMethod>
|
||||
/**
|
||||
* A function for serializing request query parameters. By default, arrays
|
||||
* will be exploded in form style, objects will be exploded in deepObject
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import type { QuerySerializer } from "./bodySerializer.gen.js"
|
||||
import type { BodySerializer, QuerySerializer } from "./bodySerializer.gen.js"
|
||||
import {
|
||||
type ArraySeparatorStyle,
|
||||
serializeArrayParam,
|
||||
@@ -107,3 +107,31 @@ export const getUrl = ({
|
||||
}
|
||||
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
|
||||
}
|
||||
|
||||
+1743
-675
@@ -1,209 +1,322 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import type { Options as ClientOptions, TDataShape, Client } from "./client/index.js"
|
||||
import { client } from "./client.gen.js"
|
||||
import type { Client, Options as Options2, TDataShape } from "./client/index.js"
|
||||
import type {
|
||||
GlobalEventData,
|
||||
GlobalEventResponses,
|
||||
ProjectListData,
|
||||
ProjectListResponses,
|
||||
ProjectCurrentData,
|
||||
ProjectCurrentResponses,
|
||||
PtyListData,
|
||||
PtyListResponses,
|
||||
PtyCreateData,
|
||||
PtyCreateResponses,
|
||||
PtyCreateErrors,
|
||||
PtyRemoveData,
|
||||
PtyRemoveResponses,
|
||||
PtyRemoveErrors,
|
||||
PtyGetData,
|
||||
PtyGetResponses,
|
||||
PtyGetErrors,
|
||||
PtyUpdateData,
|
||||
PtyUpdateResponses,
|
||||
PtyUpdateErrors,
|
||||
PtyConnectData,
|
||||
PtyConnectResponses,
|
||||
PtyConnectErrors,
|
||||
ConfigGetData,
|
||||
ConfigGetResponses,
|
||||
ConfigUpdateData,
|
||||
ConfigUpdateResponses,
|
||||
ConfigUpdateErrors,
|
||||
ToolIdsData,
|
||||
ToolIdsResponses,
|
||||
ToolIdsErrors,
|
||||
ToolListData,
|
||||
ToolListResponses,
|
||||
ToolListErrors,
|
||||
InstanceDisposeData,
|
||||
InstanceDisposeResponses,
|
||||
PathGetData,
|
||||
PathGetResponses,
|
||||
VcsGetData,
|
||||
VcsGetResponses,
|
||||
SessionListData,
|
||||
SessionListResponses,
|
||||
SessionCreateData,
|
||||
SessionCreateResponses,
|
||||
SessionCreateErrors,
|
||||
SessionStatusData,
|
||||
SessionStatusResponses,
|
||||
SessionStatusErrors,
|
||||
SessionDeleteData,
|
||||
SessionDeleteResponses,
|
||||
SessionDeleteErrors,
|
||||
SessionGetData,
|
||||
SessionGetResponses,
|
||||
SessionGetErrors,
|
||||
SessionUpdateData,
|
||||
SessionUpdateResponses,
|
||||
SessionUpdateErrors,
|
||||
SessionChildrenData,
|
||||
SessionChildrenResponses,
|
||||
SessionChildrenErrors,
|
||||
SessionTodoData,
|
||||
SessionTodoResponses,
|
||||
SessionTodoErrors,
|
||||
SessionInitData,
|
||||
SessionInitResponses,
|
||||
SessionInitErrors,
|
||||
SessionForkData,
|
||||
SessionForkResponses,
|
||||
SessionAbortData,
|
||||
SessionAbortResponses,
|
||||
SessionAbortErrors,
|
||||
SessionUnshareData,
|
||||
SessionUnshareResponses,
|
||||
SessionUnshareErrors,
|
||||
SessionShareData,
|
||||
SessionShareResponses,
|
||||
SessionShareErrors,
|
||||
SessionDiffData,
|
||||
SessionDiffResponses,
|
||||
SessionDiffErrors,
|
||||
SessionSummarizeData,
|
||||
SessionSummarizeResponses,
|
||||
SessionSummarizeErrors,
|
||||
SessionMessagesData,
|
||||
SessionMessagesResponses,
|
||||
SessionMessagesErrors,
|
||||
SessionPromptData,
|
||||
SessionPromptResponses,
|
||||
SessionPromptErrors,
|
||||
SessionMessageData,
|
||||
SessionMessageResponses,
|
||||
SessionMessageErrors,
|
||||
SessionPromptAsyncData,
|
||||
SessionPromptAsyncResponses,
|
||||
SessionPromptAsyncErrors,
|
||||
SessionCommandData,
|
||||
SessionCommandResponses,
|
||||
SessionCommandErrors,
|
||||
SessionShellData,
|
||||
SessionShellResponses,
|
||||
SessionShellErrors,
|
||||
SessionRevertData,
|
||||
SessionRevertResponses,
|
||||
SessionRevertErrors,
|
||||
SessionUnrevertData,
|
||||
SessionUnrevertResponses,
|
||||
SessionUnrevertErrors,
|
||||
PostSessionIdPermissionsPermissionIdData,
|
||||
PostSessionIdPermissionsPermissionIdResponses,
|
||||
PostSessionIdPermissionsPermissionIdErrors,
|
||||
AppAgentsData,
|
||||
AppAgentsResponses,
|
||||
AppLogData,
|
||||
AppLogErrors,
|
||||
AppLogResponses,
|
||||
AppSkillsData,
|
||||
AppSkillsResponses,
|
||||
AuthRemoveData,
|
||||
AuthRemoveErrors,
|
||||
AuthRemoveResponses,
|
||||
AuthSetData,
|
||||
AuthSetErrors,
|
||||
AuthSetResponses,
|
||||
CommandListData,
|
||||
CommandListResponses,
|
||||
ConfigGetData,
|
||||
ConfigGetResponses,
|
||||
ConfigProvidersData,
|
||||
ConfigProvidersResponses,
|
||||
ProviderListData,
|
||||
ProviderListResponses,
|
||||
ProviderAuthData,
|
||||
ProviderAuthResponses,
|
||||
ProviderOauthAuthorizeData,
|
||||
ProviderOauthAuthorizeResponses,
|
||||
ProviderOauthAuthorizeErrors,
|
||||
ProviderOauthCallbackData,
|
||||
ProviderOauthCallbackResponses,
|
||||
ProviderOauthCallbackErrors,
|
||||
FindTextData,
|
||||
FindTextResponses,
|
||||
FindFilesData,
|
||||
FindFilesResponses,
|
||||
FindSymbolsData,
|
||||
FindSymbolsResponses,
|
||||
ConfigUpdateData,
|
||||
ConfigUpdateErrors,
|
||||
ConfigUpdateResponses,
|
||||
EventSubscribeData,
|
||||
EventSubscribeResponses,
|
||||
ExperimentalConsoleGetData,
|
||||
ExperimentalConsoleGetErrors,
|
||||
ExperimentalConsoleGetResponses,
|
||||
ExperimentalConsoleListOrgsData,
|
||||
ExperimentalConsoleListOrgsErrors,
|
||||
ExperimentalConsoleListOrgsResponses,
|
||||
ExperimentalConsoleSwitchOrgData,
|
||||
ExperimentalConsoleSwitchOrgResponses,
|
||||
ExperimentalResourceListData,
|
||||
ExperimentalResourceListResponses,
|
||||
ExperimentalSessionListData,
|
||||
ExperimentalSessionListResponses,
|
||||
ExperimentalWorkspaceAdapterListData,
|
||||
ExperimentalWorkspaceAdapterListResponses,
|
||||
ExperimentalWorkspaceCreateData,
|
||||
ExperimentalWorkspaceCreateErrors,
|
||||
ExperimentalWorkspaceCreateResponses,
|
||||
ExperimentalWorkspaceListData,
|
||||
ExperimentalWorkspaceListResponses,
|
||||
ExperimentalWorkspaceRemoveData,
|
||||
ExperimentalWorkspaceRemoveErrors,
|
||||
ExperimentalWorkspaceRemoveResponses,
|
||||
ExperimentalWorkspaceStatusData,
|
||||
ExperimentalWorkspaceStatusResponses,
|
||||
ExperimentalWorkspaceSyncListData,
|
||||
ExperimentalWorkspaceSyncListResponses,
|
||||
ExperimentalWorkspaceWarpData,
|
||||
ExperimentalWorkspaceWarpErrors,
|
||||
ExperimentalWorkspaceWarpResponses,
|
||||
FileListData,
|
||||
FileListResponses,
|
||||
FileReadData,
|
||||
FileReadResponses,
|
||||
FileStatusData,
|
||||
FileStatusResponses,
|
||||
AppLogData,
|
||||
AppLogResponses,
|
||||
AppLogErrors,
|
||||
AppAgentsData,
|
||||
AppAgentsResponses,
|
||||
McpStatusData,
|
||||
McpStatusResponses,
|
||||
FindFilesData,
|
||||
FindFilesResponses,
|
||||
FindSymbolsData,
|
||||
FindSymbolsResponses,
|
||||
FindTextData,
|
||||
FindTextResponses,
|
||||
FormatterStatusData,
|
||||
FormatterStatusResponses,
|
||||
GlobalConfigGetData,
|
||||
GlobalConfigGetResponses,
|
||||
GlobalConfigUpdateData,
|
||||
GlobalConfigUpdateErrors,
|
||||
GlobalConfigUpdateResponses,
|
||||
GlobalDisposeData,
|
||||
GlobalDisposeResponses,
|
||||
GlobalEventData,
|
||||
GlobalEventResponses,
|
||||
GlobalHealthData,
|
||||
GlobalHealthResponses,
|
||||
GlobalUpgradeData,
|
||||
GlobalUpgradeErrors,
|
||||
GlobalUpgradeResponses,
|
||||
InstanceDisposeData,
|
||||
InstanceDisposeResponses,
|
||||
LspStatusData,
|
||||
LspStatusResponses,
|
||||
McpAddData,
|
||||
McpAddResponses,
|
||||
McpAddErrors,
|
||||
McpAuthRemoveData,
|
||||
McpAuthRemoveResponses,
|
||||
McpAuthRemoveErrors,
|
||||
McpAuthStartData,
|
||||
McpAuthStartResponses,
|
||||
McpAuthStartErrors,
|
||||
McpAuthCallbackData,
|
||||
McpAuthCallbackResponses,
|
||||
McpAuthCallbackErrors,
|
||||
McpAddResponses,
|
||||
McpAuthAuthenticateData,
|
||||
McpAuthAuthenticateResponses,
|
||||
McpAuthAuthenticateErrors,
|
||||
McpAuthAuthenticateResponses,
|
||||
McpAuthCallbackData,
|
||||
McpAuthCallbackErrors,
|
||||
McpAuthCallbackResponses,
|
||||
McpAuthRemoveData,
|
||||
McpAuthRemoveErrors,
|
||||
McpAuthRemoveResponses,
|
||||
McpAuthStartData,
|
||||
McpAuthStartErrors,
|
||||
McpAuthStartResponses,
|
||||
McpConnectData,
|
||||
McpConnectResponses,
|
||||
McpDisconnectData,
|
||||
McpDisconnectResponses,
|
||||
LspStatusData,
|
||||
LspStatusResponses,
|
||||
FormatterStatusData,
|
||||
FormatterStatusResponses,
|
||||
McpStatusData,
|
||||
McpStatusResponses,
|
||||
PartDeleteData,
|
||||
PartDeleteErrors,
|
||||
PartDeleteResponses,
|
||||
PartUpdateData,
|
||||
PartUpdateErrors,
|
||||
PartUpdateResponses,
|
||||
PathGetData,
|
||||
PathGetResponses,
|
||||
PermissionListData,
|
||||
PermissionListResponses,
|
||||
PermissionReplyData,
|
||||
PermissionReplyErrors,
|
||||
PermissionReplyResponses,
|
||||
PermissionRespondData,
|
||||
PermissionRespondErrors,
|
||||
PermissionRespondResponses,
|
||||
ProjectCurrentData,
|
||||
ProjectCurrentResponses,
|
||||
ProjectInitGitData,
|
||||
ProjectInitGitResponses,
|
||||
ProjectListData,
|
||||
ProjectListResponses,
|
||||
ProjectUpdateData,
|
||||
ProjectUpdateErrors,
|
||||
ProjectUpdateResponses,
|
||||
ProviderAuthData,
|
||||
ProviderAuthResponses,
|
||||
ProviderListData,
|
||||
ProviderListResponses,
|
||||
ProviderOauthAuthorizeData,
|
||||
ProviderOauthAuthorizeErrors,
|
||||
ProviderOauthAuthorizeResponses,
|
||||
ProviderOauthCallbackData,
|
||||
ProviderOauthCallbackErrors,
|
||||
ProviderOauthCallbackResponses,
|
||||
PtyConnectData,
|
||||
PtyConnectErrors,
|
||||
PtyConnectResponses,
|
||||
PtyConnectTokenData,
|
||||
PtyConnectTokenErrors,
|
||||
PtyConnectTokenResponses,
|
||||
PtyCreateData,
|
||||
PtyCreateErrors,
|
||||
PtyCreateResponses,
|
||||
PtyGetData,
|
||||
PtyGetErrors,
|
||||
PtyGetResponses,
|
||||
PtyListData,
|
||||
PtyListResponses,
|
||||
PtyRemoveData,
|
||||
PtyRemoveErrors,
|
||||
PtyRemoveResponses,
|
||||
PtyShellsData,
|
||||
PtyShellsResponses,
|
||||
PtyUpdateData,
|
||||
PtyUpdateErrors,
|
||||
PtyUpdateResponses,
|
||||
QuestionListData,
|
||||
QuestionListResponses,
|
||||
QuestionRejectData,
|
||||
QuestionRejectErrors,
|
||||
QuestionRejectResponses,
|
||||
QuestionReplyData,
|
||||
QuestionReplyErrors,
|
||||
QuestionReplyResponses,
|
||||
SessionAbortData,
|
||||
SessionAbortErrors,
|
||||
SessionAbortResponses,
|
||||
SessionChildrenData,
|
||||
SessionChildrenErrors,
|
||||
SessionChildrenResponses,
|
||||
SessionCommandData,
|
||||
SessionCommandErrors,
|
||||
SessionCommandResponses,
|
||||
SessionCreateData,
|
||||
SessionCreateErrors,
|
||||
SessionCreateResponses,
|
||||
SessionDeleteData,
|
||||
SessionDeleteErrors,
|
||||
SessionDeleteMessageData,
|
||||
SessionDeleteMessageErrors,
|
||||
SessionDeleteMessageResponses,
|
||||
SessionDeleteResponses,
|
||||
SessionDiffData,
|
||||
SessionDiffResponses,
|
||||
SessionForkData,
|
||||
SessionForkErrors,
|
||||
SessionForkResponses,
|
||||
SessionGetData,
|
||||
SessionGetErrors,
|
||||
SessionGetResponses,
|
||||
SessionInitData,
|
||||
SessionInitErrors,
|
||||
SessionInitResponses,
|
||||
SessionListData,
|
||||
SessionListResponses,
|
||||
SessionMessageData,
|
||||
SessionMessageErrors,
|
||||
SessionMessageResponses,
|
||||
SessionMessagesData,
|
||||
SessionMessagesErrors,
|
||||
SessionMessagesResponses,
|
||||
SessionPromptAsyncData,
|
||||
SessionPromptAsyncErrors,
|
||||
SessionPromptAsyncResponses,
|
||||
SessionPromptData,
|
||||
SessionPromptErrors,
|
||||
SessionPromptResponses,
|
||||
SessionRevertData,
|
||||
SessionRevertErrors,
|
||||
SessionRevertResponses,
|
||||
SessionShareData,
|
||||
SessionShareErrors,
|
||||
SessionShareResponses,
|
||||
SessionShellData,
|
||||
SessionShellErrors,
|
||||
SessionShellResponses,
|
||||
SessionStatusData,
|
||||
SessionStatusErrors,
|
||||
SessionStatusResponses,
|
||||
SessionSummarizeData,
|
||||
SessionSummarizeErrors,
|
||||
SessionSummarizeResponses,
|
||||
SessionTodoData,
|
||||
SessionTodoErrors,
|
||||
SessionTodoResponses,
|
||||
SessionUnrevertData,
|
||||
SessionUnrevertErrors,
|
||||
SessionUnrevertResponses,
|
||||
SessionUnshareData,
|
||||
SessionUnshareErrors,
|
||||
SessionUnshareResponses,
|
||||
SessionUpdateData,
|
||||
SessionUpdateErrors,
|
||||
SessionUpdateResponses,
|
||||
SyncHistoryListData,
|
||||
SyncHistoryListErrors,
|
||||
SyncHistoryListResponses,
|
||||
SyncReplayData,
|
||||
SyncReplayErrors,
|
||||
SyncReplayResponses,
|
||||
SyncStartData,
|
||||
SyncStartResponses,
|
||||
SyncStealData,
|
||||
SyncStealErrors,
|
||||
SyncStealResponses,
|
||||
ToolIdsData,
|
||||
ToolIdsErrors,
|
||||
ToolIdsResponses,
|
||||
ToolListData,
|
||||
ToolListErrors,
|
||||
ToolListResponses,
|
||||
TuiAppendPromptData,
|
||||
TuiAppendPromptResponses,
|
||||
TuiAppendPromptErrors,
|
||||
TuiOpenHelpData,
|
||||
TuiOpenHelpResponses,
|
||||
TuiOpenSessionsData,
|
||||
TuiOpenSessionsResponses,
|
||||
TuiOpenThemesData,
|
||||
TuiOpenThemesResponses,
|
||||
TuiOpenModelsData,
|
||||
TuiOpenModelsResponses,
|
||||
TuiSubmitPromptData,
|
||||
TuiSubmitPromptResponses,
|
||||
TuiAppendPromptResponses,
|
||||
TuiClearPromptData,
|
||||
TuiClearPromptResponses,
|
||||
TuiExecuteCommandData,
|
||||
TuiExecuteCommandResponses,
|
||||
TuiExecuteCommandErrors,
|
||||
TuiShowToastData,
|
||||
TuiShowToastResponses,
|
||||
TuiPublishData,
|
||||
TuiPublishResponses,
|
||||
TuiPublishErrors,
|
||||
TuiControlNextData,
|
||||
TuiControlNextResponses,
|
||||
TuiControlResponseData,
|
||||
TuiControlResponseResponses,
|
||||
AuthSetData,
|
||||
AuthSetResponses,
|
||||
AuthSetErrors,
|
||||
EventSubscribeData,
|
||||
EventSubscribeResponses,
|
||||
TuiExecuteCommandData,
|
||||
TuiExecuteCommandErrors,
|
||||
TuiExecuteCommandResponses,
|
||||
TuiOpenHelpData,
|
||||
TuiOpenHelpResponses,
|
||||
TuiOpenModelsData,
|
||||
TuiOpenModelsResponses,
|
||||
TuiOpenSessionsData,
|
||||
TuiOpenSessionsResponses,
|
||||
TuiOpenThemesData,
|
||||
TuiOpenThemesResponses,
|
||||
TuiPublishData,
|
||||
TuiPublishErrors,
|
||||
TuiPublishResponses,
|
||||
TuiSelectSessionData,
|
||||
TuiSelectSessionErrors,
|
||||
TuiSelectSessionResponses,
|
||||
TuiShowToastData,
|
||||
TuiShowToastResponses,
|
||||
TuiSubmitPromptData,
|
||||
TuiSubmitPromptResponses,
|
||||
VcsApplyData,
|
||||
VcsApplyErrors,
|
||||
VcsApplyResponses,
|
||||
VcsDiffData,
|
||||
VcsDiffRawData,
|
||||
VcsDiffRawResponses,
|
||||
VcsDiffResponses,
|
||||
VcsGetData,
|
||||
VcsGetResponses,
|
||||
VcsStatusData,
|
||||
VcsStatusResponses,
|
||||
WorktreeCreateData,
|
||||
WorktreeCreateErrors,
|
||||
WorktreeCreateResponses,
|
||||
WorktreeListData,
|
||||
WorktreeListErrors,
|
||||
WorktreeListResponses,
|
||||
WorktreeRemoveData,
|
||||
WorktreeRemoveErrors,
|
||||
WorktreeRemoveResponses,
|
||||
WorktreeResetData,
|
||||
WorktreeResetErrors,
|
||||
WorktreeResetResponses,
|
||||
} from "./types.gen.js"
|
||||
import { client as _heyApiClient } from "./client.gen.js"
|
||||
|
||||
export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = ClientOptions<
|
||||
export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = Options2<
|
||||
TData,
|
||||
ThrowOnError
|
||||
> & {
|
||||
@@ -220,67 +333,71 @@ export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends
|
||||
meta?: Record<string, unknown>
|
||||
}
|
||||
|
||||
class _HeyApiClient {
|
||||
protected _client: Client = _heyApiClient
|
||||
class HeyApiClient {
|
||||
protected client: Client
|
||||
|
||||
constructor(args?: { client?: Client }) {
|
||||
if (args?.client) {
|
||||
this._client = args.client
|
||||
this.client = args?.client ?? client
|
||||
}
|
||||
}
|
||||
|
||||
class HeyApiRegistry<T> {
|
||||
private readonly defaultKey = "default"
|
||||
|
||||
private readonly instances: Map<string, T> = new Map()
|
||||
|
||||
get(key?: string): T {
|
||||
const instance = this.instances.get(key ?? this.defaultKey)
|
||||
if (!instance) {
|
||||
throw new Error(`No SDK client found. Create one with "new OpencodeClient()" to fix this error.`)
|
||||
}
|
||||
return instance
|
||||
}
|
||||
|
||||
set(value: T, key?: string): void {
|
||||
this.instances.set(key ?? this.defaultKey, value)
|
||||
}
|
||||
}
|
||||
|
||||
class Global extends _HeyApiClient {
|
||||
export class Auth extends HeyApiClient {
|
||||
/**
|
||||
* Get events
|
||||
* Remove auth credentials
|
||||
*
|
||||
* Remove authentication credentials
|
||||
*/
|
||||
public event<ThrowOnError extends boolean = false>(options?: Options<GlobalEventData, ThrowOnError>) {
|
||||
return (options?.client ?? this._client).get.sse<GlobalEventResponses, unknown, ThrowOnError>({
|
||||
url: "/global/event",
|
||||
public remove<ThrowOnError extends boolean = false>(options: Options<AuthRemoveData, ThrowOnError>) {
|
||||
return (options.client ?? this.client).delete<AuthRemoveResponses, AuthRemoveErrors, ThrowOnError>({
|
||||
url: "/auth/{providerID}",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Set auth credentials
|
||||
*
|
||||
* Set authentication credentials
|
||||
*/
|
||||
public set<ThrowOnError extends boolean = false>(options: Options<AuthSetData, ThrowOnError>) {
|
||||
return (options.client ?? this.client).put<AuthSetResponses, AuthSetErrors, ThrowOnError>({
|
||||
url: "/auth/{providerID}",
|
||||
...options,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
...options.headers,
|
||||
},
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
class Project extends _HeyApiClient {
|
||||
export class App extends HeyApiClient {
|
||||
/**
|
||||
* List all projects
|
||||
* Write log
|
||||
*
|
||||
* Write a log entry to the server logs with specified level and metadata.
|
||||
*/
|
||||
public list<ThrowOnError extends boolean = false>(options?: Options<ProjectListData, ThrowOnError>) {
|
||||
return (options?.client ?? this._client).get<ProjectListResponses, unknown, ThrowOnError>({
|
||||
url: "/project",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the current project
|
||||
*/
|
||||
public current<ThrowOnError extends boolean = false>(options?: Options<ProjectCurrentData, ThrowOnError>) {
|
||||
return (options?.client ?? this._client).get<ProjectCurrentResponses, unknown, ThrowOnError>({
|
||||
url: "/project/current",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
class Pty extends _HeyApiClient {
|
||||
/**
|
||||
* List all PTY sessions
|
||||
*/
|
||||
public list<ThrowOnError extends boolean = false>(options?: Options<PtyListData, ThrowOnError>) {
|
||||
return (options?.client ?? this._client).get<PtyListResponses, unknown, ThrowOnError>({
|
||||
url: "/pty",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new PTY session
|
||||
*/
|
||||
public create<ThrowOnError extends boolean = false>(options?: Options<PtyCreateData, ThrowOnError>) {
|
||||
return (options?.client ?? this._client).post<PtyCreateResponses, PtyCreateErrors, ThrowOnError>({
|
||||
url: "/pty",
|
||||
public log<ThrowOnError extends boolean = false>(options?: Options<AppLogData, ThrowOnError>) {
|
||||
return (options?.client ?? this.client).post<AppLogResponses, AppLogErrors, ThrowOnError>({
|
||||
url: "/log",
|
||||
...options,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
@@ -290,31 +407,716 @@ class Pty extends _HeyApiClient {
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove a PTY session
|
||||
* List agents
|
||||
*
|
||||
* Get a list of all available AI agents in the OpenCode system.
|
||||
*/
|
||||
public remove<ThrowOnError extends boolean = false>(options: Options<PtyRemoveData, ThrowOnError>) {
|
||||
return (options.client ?? this._client).delete<PtyRemoveResponses, PtyRemoveErrors, ThrowOnError>({
|
||||
url: "/pty/{id}",
|
||||
public agents<ThrowOnError extends boolean = false>(options?: Options<AppAgentsData, ThrowOnError>) {
|
||||
return (options?.client ?? this.client).get<AppAgentsResponses, unknown, ThrowOnError>({
|
||||
url: "/agent",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Get PTY session info
|
||||
* List skills
|
||||
*
|
||||
* Get a list of all available skills in the OpenCode system.
|
||||
*/
|
||||
public get<ThrowOnError extends boolean = false>(options: Options<PtyGetData, ThrowOnError>) {
|
||||
return (options.client ?? this._client).get<PtyGetResponses, PtyGetErrors, ThrowOnError>({
|
||||
url: "/pty/{id}",
|
||||
public skills<ThrowOnError extends boolean = false>(options?: Options<AppSkillsData, ThrowOnError>) {
|
||||
return (options?.client ?? this.client).get<AppSkillsResponses, unknown, ThrowOnError>({
|
||||
url: "/skill",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export class Config extends HeyApiClient {
|
||||
/**
|
||||
* Get global configuration
|
||||
*
|
||||
* Retrieve the current global OpenCode configuration settings and preferences.
|
||||
*/
|
||||
public get<ThrowOnError extends boolean = false>(options?: Options<GlobalConfigGetData, ThrowOnError>) {
|
||||
return (options?.client ?? this.client).get<GlobalConfigGetResponses, unknown, ThrowOnError>({
|
||||
url: "/global/config",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Update PTY session
|
||||
* Update global configuration
|
||||
*
|
||||
* Update global OpenCode configuration settings and preferences.
|
||||
*/
|
||||
public update<ThrowOnError extends boolean = false>(options: Options<PtyUpdateData, ThrowOnError>) {
|
||||
return (options.client ?? this._client).put<PtyUpdateResponses, PtyUpdateErrors, ThrowOnError>({
|
||||
url: "/pty/{id}",
|
||||
public update<ThrowOnError extends boolean = false>(options?: Options<GlobalConfigUpdateData, ThrowOnError>) {
|
||||
return (options?.client ?? this.client).patch<GlobalConfigUpdateResponses, GlobalConfigUpdateErrors, ThrowOnError>({
|
||||
url: "/global/config",
|
||||
...options,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
...options?.headers,
|
||||
},
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export class Global extends HeyApiClient {
|
||||
/**
|
||||
* Get health
|
||||
*
|
||||
* Get health information about the OpenCode server.
|
||||
*/
|
||||
public health<ThrowOnError extends boolean = false>(options?: Options<GlobalHealthData, ThrowOnError>) {
|
||||
return (options?.client ?? this.client).get<GlobalHealthResponses, unknown, ThrowOnError>({
|
||||
url: "/global/health",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Get global events
|
||||
*
|
||||
* Subscribe to global events from the OpenCode system using server-sent events.
|
||||
*/
|
||||
public event<ThrowOnError extends boolean = false>(options?: Options<GlobalEventData, ThrowOnError>) {
|
||||
return (options?.client ?? this.client).sse.get<GlobalEventResponses, unknown, ThrowOnError>({
|
||||
url: "/global/event",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Dispose instance
|
||||
*
|
||||
* Clean up and dispose all OpenCode instances, releasing all resources.
|
||||
*/
|
||||
public dispose<ThrowOnError extends boolean = false>(options?: Options<GlobalDisposeData, ThrowOnError>) {
|
||||
return (options?.client ?? this.client).post<GlobalDisposeResponses, unknown, ThrowOnError>({
|
||||
url: "/global/dispose",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Upgrade opencode
|
||||
*
|
||||
* Upgrade opencode to the specified version or latest if not specified.
|
||||
*/
|
||||
public upgrade<ThrowOnError extends boolean = false>(options?: Options<GlobalUpgradeData, ThrowOnError>) {
|
||||
return (options?.client ?? this.client).post<GlobalUpgradeResponses, GlobalUpgradeErrors, ThrowOnError>({
|
||||
url: "/global/upgrade",
|
||||
...options,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
...options?.headers,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
private _config?: Config
|
||||
get config(): Config {
|
||||
return (this._config ??= new Config({ client: this.client }))
|
||||
}
|
||||
}
|
||||
|
||||
export class Event extends HeyApiClient {
|
||||
/**
|
||||
* Subscribe to events
|
||||
*
|
||||
* Get events
|
||||
*/
|
||||
public subscribe<ThrowOnError extends boolean = false>(options?: Options<EventSubscribeData, ThrowOnError>) {
|
||||
return (options?.client ?? this.client).sse.get<EventSubscribeResponses, unknown, ThrowOnError>({
|
||||
url: "/event",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export class Config2 extends HeyApiClient {
|
||||
/**
|
||||
* Get configuration
|
||||
*
|
||||
* Retrieve the current OpenCode configuration settings and preferences.
|
||||
*/
|
||||
public get<ThrowOnError extends boolean = false>(options?: Options<ConfigGetData, ThrowOnError>) {
|
||||
return (options?.client ?? this.client).get<ConfigGetResponses, unknown, ThrowOnError>({
|
||||
url: "/config",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Update configuration
|
||||
*
|
||||
* Update OpenCode configuration settings and preferences.
|
||||
*/
|
||||
public update<ThrowOnError extends boolean = false>(options?: Options<ConfigUpdateData, ThrowOnError>) {
|
||||
return (options?.client ?? this.client).patch<ConfigUpdateResponses, ConfigUpdateErrors, ThrowOnError>({
|
||||
url: "/config",
|
||||
...options,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
...options?.headers,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* List config providers
|
||||
*
|
||||
* Get a list of all configured AI providers and their default models.
|
||||
*/
|
||||
public providers<ThrowOnError extends boolean = false>(options?: Options<ConfigProvidersData, ThrowOnError>) {
|
||||
return (options?.client ?? this.client).get<ConfigProvidersResponses, unknown, ThrowOnError>({
|
||||
url: "/config/providers",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export class Console extends HeyApiClient {
|
||||
/**
|
||||
* Get active Console provider metadata
|
||||
*
|
||||
* Get the active Console org name and the set of provider IDs managed by that Console org.
|
||||
*/
|
||||
public get<ThrowOnError extends boolean = false>(options?: Options<ExperimentalConsoleGetData, ThrowOnError>) {
|
||||
return (options?.client ?? this.client).get<
|
||||
ExperimentalConsoleGetResponses,
|
||||
ExperimentalConsoleGetErrors,
|
||||
ThrowOnError
|
||||
>({ url: "/experimental/console", ...options })
|
||||
}
|
||||
|
||||
/**
|
||||
* List switchable Console orgs
|
||||
*
|
||||
* Get the available Console orgs across logged-in accounts, including the current active org.
|
||||
*/
|
||||
public listOrgs<ThrowOnError extends boolean = false>(
|
||||
options?: Options<ExperimentalConsoleListOrgsData, ThrowOnError>,
|
||||
) {
|
||||
return (options?.client ?? this.client).get<
|
||||
ExperimentalConsoleListOrgsResponses,
|
||||
ExperimentalConsoleListOrgsErrors,
|
||||
ThrowOnError
|
||||
>({ url: "/experimental/console/orgs", ...options })
|
||||
}
|
||||
|
||||
/**
|
||||
* Switch active Console org
|
||||
*
|
||||
* Persist a new active Console account/org selection for the current local OpenCode state.
|
||||
*/
|
||||
public switchOrg<ThrowOnError extends boolean = false>(
|
||||
options?: Options<ExperimentalConsoleSwitchOrgData, ThrowOnError>,
|
||||
) {
|
||||
return (options?.client ?? this.client).post<ExperimentalConsoleSwitchOrgResponses, unknown, ThrowOnError>({
|
||||
url: "/experimental/console/switch",
|
||||
...options,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
...options?.headers,
|
||||
},
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export class Session extends HeyApiClient {
|
||||
/**
|
||||
* List sessions
|
||||
*
|
||||
* Get a list of all OpenCode sessions across projects, sorted by most recently updated. Archived sessions are excluded by default.
|
||||
*/
|
||||
public list<ThrowOnError extends boolean = false>(options?: Options<ExperimentalSessionListData, ThrowOnError>) {
|
||||
return (options?.client ?? this.client).get<ExperimentalSessionListResponses, unknown, ThrowOnError>({
|
||||
url: "/experimental/session",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export class Resource extends HeyApiClient {
|
||||
/**
|
||||
* Get MCP resources
|
||||
*
|
||||
* Get all available MCP resources from connected servers. Optionally filter by name.
|
||||
*/
|
||||
public list<ThrowOnError extends boolean = false>(options?: Options<ExperimentalResourceListData, ThrowOnError>) {
|
||||
return (options?.client ?? this.client).get<ExperimentalResourceListResponses, unknown, ThrowOnError>({
|
||||
url: "/experimental/resource",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export class Adapter extends HeyApiClient {
|
||||
/**
|
||||
* List workspace adapters
|
||||
*
|
||||
* List all available workspace adapters for the current project.
|
||||
*/
|
||||
public list<ThrowOnError extends boolean = false>(
|
||||
options?: Options<ExperimentalWorkspaceAdapterListData, ThrowOnError>,
|
||||
) {
|
||||
return (options?.client ?? this.client).get<ExperimentalWorkspaceAdapterListResponses, unknown, ThrowOnError>({
|
||||
url: "/experimental/workspace/adapter",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export class Workspace extends HeyApiClient {
|
||||
/**
|
||||
* List workspaces
|
||||
*
|
||||
* List all workspaces.
|
||||
*/
|
||||
public list<ThrowOnError extends boolean = false>(options?: Options<ExperimentalWorkspaceListData, ThrowOnError>) {
|
||||
return (options?.client ?? this.client).get<ExperimentalWorkspaceListResponses, unknown, ThrowOnError>({
|
||||
url: "/experimental/workspace",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Create workspace
|
||||
*
|
||||
* Create a workspace for the current project.
|
||||
*/
|
||||
public create<ThrowOnError extends boolean = false>(
|
||||
options?: Options<ExperimentalWorkspaceCreateData, ThrowOnError>,
|
||||
) {
|
||||
return (options?.client ?? this.client).post<
|
||||
ExperimentalWorkspaceCreateResponses,
|
||||
ExperimentalWorkspaceCreateErrors,
|
||||
ThrowOnError
|
||||
>({
|
||||
url: "/experimental/workspace",
|
||||
...options,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
...options?.headers,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Sync workspace list
|
||||
*
|
||||
* Register missing workspaces returned by workspace adapters.
|
||||
*/
|
||||
public syncList<ThrowOnError extends boolean = false>(
|
||||
options?: Options<ExperimentalWorkspaceSyncListData, ThrowOnError>,
|
||||
) {
|
||||
return (options?.client ?? this.client).post<ExperimentalWorkspaceSyncListResponses, unknown, ThrowOnError>({
|
||||
url: "/experimental/workspace/sync-list",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Workspace status
|
||||
*
|
||||
* Get connection status for workspaces in the current project.
|
||||
*/
|
||||
public status<ThrowOnError extends boolean = false>(
|
||||
options?: Options<ExperimentalWorkspaceStatusData, ThrowOnError>,
|
||||
) {
|
||||
return (options?.client ?? this.client).get<ExperimentalWorkspaceStatusResponses, unknown, ThrowOnError>({
|
||||
url: "/experimental/workspace/status",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove workspace
|
||||
*
|
||||
* Remove an existing workspace.
|
||||
*/
|
||||
public remove<ThrowOnError extends boolean = false>(options: Options<ExperimentalWorkspaceRemoveData, ThrowOnError>) {
|
||||
return (options.client ?? this.client).delete<
|
||||
ExperimentalWorkspaceRemoveResponses,
|
||||
ExperimentalWorkspaceRemoveErrors,
|
||||
ThrowOnError
|
||||
>({ url: "/experimental/workspace/{id}", ...options })
|
||||
}
|
||||
|
||||
/**
|
||||
* Warp session into workspace
|
||||
*
|
||||
* Move a session's sync history into the target workspace, or detach it to the local project.
|
||||
*/
|
||||
public warp<ThrowOnError extends boolean = false>(options?: Options<ExperimentalWorkspaceWarpData, ThrowOnError>) {
|
||||
return (options?.client ?? this.client).post<
|
||||
ExperimentalWorkspaceWarpResponses,
|
||||
ExperimentalWorkspaceWarpErrors,
|
||||
ThrowOnError
|
||||
>({
|
||||
url: "/experimental/workspace/warp",
|
||||
...options,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
...options?.headers,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
private _adapter?: Adapter
|
||||
get adapter(): Adapter {
|
||||
return (this._adapter ??= new Adapter({ client: this.client }))
|
||||
}
|
||||
}
|
||||
|
||||
export class Experimental extends HeyApiClient {
|
||||
private _console?: Console
|
||||
get console(): Console {
|
||||
return (this._console ??= new Console({ client: this.client }))
|
||||
}
|
||||
|
||||
private _session?: Session
|
||||
get session(): Session {
|
||||
return (this._session ??= new Session({ client: this.client }))
|
||||
}
|
||||
|
||||
private _resource?: Resource
|
||||
get resource(): Resource {
|
||||
return (this._resource ??= new Resource({ client: this.client }))
|
||||
}
|
||||
|
||||
private _workspace?: Workspace
|
||||
get workspace(): Workspace {
|
||||
return (this._workspace ??= new Workspace({ client: this.client }))
|
||||
}
|
||||
}
|
||||
|
||||
export class Tool extends HeyApiClient {
|
||||
/**
|
||||
* List tools
|
||||
*
|
||||
* Get a list of available tools with their JSON schema parameters for a specific provider and model combination.
|
||||
*/
|
||||
public list<ThrowOnError extends boolean = false>(options: Options<ToolListData, ThrowOnError>) {
|
||||
return (options.client ?? this.client).get<ToolListResponses, ToolListErrors, ThrowOnError>({
|
||||
url: "/experimental/tool",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* List tool IDs
|
||||
*
|
||||
* Get a list of all available tool IDs, including both built-in tools and dynamically registered tools.
|
||||
*/
|
||||
public ids<ThrowOnError extends boolean = false>(options?: Options<ToolIdsData, ThrowOnError>) {
|
||||
return (options?.client ?? this.client).get<ToolIdsResponses, ToolIdsErrors, ThrowOnError>({
|
||||
url: "/experimental/tool/ids",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export class Worktree extends HeyApiClient {
|
||||
/**
|
||||
* Remove worktree
|
||||
*
|
||||
* Remove a git worktree and delete its branch.
|
||||
*/
|
||||
public remove<ThrowOnError extends boolean = false>(options?: Options<WorktreeRemoveData, ThrowOnError>) {
|
||||
return (options?.client ?? this.client).delete<WorktreeRemoveResponses, WorktreeRemoveErrors, ThrowOnError>({
|
||||
url: "/experimental/worktree",
|
||||
...options,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
...options?.headers,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* List worktrees
|
||||
*
|
||||
* List all sandbox worktrees for the current project.
|
||||
*/
|
||||
public list<ThrowOnError extends boolean = false>(options?: Options<WorktreeListData, ThrowOnError>) {
|
||||
return (options?.client ?? this.client).get<WorktreeListResponses, WorktreeListErrors, ThrowOnError>({
|
||||
url: "/experimental/worktree",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Create worktree
|
||||
*
|
||||
* Create a new git worktree for the current project and run any configured startup scripts.
|
||||
*/
|
||||
public create<ThrowOnError extends boolean = false>(options?: Options<WorktreeCreateData, ThrowOnError>) {
|
||||
return (options?.client ?? this.client).post<WorktreeCreateResponses, WorktreeCreateErrors, ThrowOnError>({
|
||||
url: "/experimental/worktree",
|
||||
...options,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
...options?.headers,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset worktree
|
||||
*
|
||||
* Reset a worktree branch to the primary default branch.
|
||||
*/
|
||||
public reset<ThrowOnError extends boolean = false>(options?: Options<WorktreeResetData, ThrowOnError>) {
|
||||
return (options?.client ?? this.client).post<WorktreeResetResponses, WorktreeResetErrors, ThrowOnError>({
|
||||
url: "/experimental/worktree/reset",
|
||||
...options,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
...options?.headers,
|
||||
},
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export class Find extends HeyApiClient {
|
||||
/**
|
||||
* Find text
|
||||
*
|
||||
* Search for text patterns across files in the project using ripgrep.
|
||||
*/
|
||||
public text<ThrowOnError extends boolean = false>(options: Options<FindTextData, ThrowOnError>) {
|
||||
return (options.client ?? this.client).get<FindTextResponses, unknown, ThrowOnError>({ url: "/find", ...options })
|
||||
}
|
||||
|
||||
/**
|
||||
* Find files
|
||||
*
|
||||
* Search for files or directories by name or pattern in the project directory.
|
||||
*/
|
||||
public files<ThrowOnError extends boolean = false>(options: Options<FindFilesData, ThrowOnError>) {
|
||||
return (options.client ?? this.client).get<FindFilesResponses, unknown, ThrowOnError>({
|
||||
url: "/find/file",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Find symbols
|
||||
*
|
||||
* Search for workspace symbols like functions, classes, and variables using LSP.
|
||||
*/
|
||||
public symbols<ThrowOnError extends boolean = false>(options: Options<FindSymbolsData, ThrowOnError>) {
|
||||
return (options.client ?? this.client).get<FindSymbolsResponses, unknown, ThrowOnError>({
|
||||
url: "/find/symbol",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export class File extends HeyApiClient {
|
||||
/**
|
||||
* List files
|
||||
*
|
||||
* List files and directories in a specified path.
|
||||
*/
|
||||
public list<ThrowOnError extends boolean = false>(options: Options<FileListData, ThrowOnError>) {
|
||||
return (options.client ?? this.client).get<FileListResponses, unknown, ThrowOnError>({ url: "/file", ...options })
|
||||
}
|
||||
|
||||
/**
|
||||
* Read file
|
||||
*
|
||||
* Read the content of a specified file.
|
||||
*/
|
||||
public read<ThrowOnError extends boolean = false>(options: Options<FileReadData, ThrowOnError>) {
|
||||
return (options.client ?? this.client).get<FileReadResponses, unknown, ThrowOnError>({
|
||||
url: "/file/content",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Get file status
|
||||
*
|
||||
* Get the git status of all files in the project.
|
||||
*/
|
||||
public status<ThrowOnError extends boolean = false>(options?: Options<FileStatusData, ThrowOnError>) {
|
||||
return (options?.client ?? this.client).get<FileStatusResponses, unknown, ThrowOnError>({
|
||||
url: "/file/status",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export class Instance extends HeyApiClient {
|
||||
/**
|
||||
* Dispose instance
|
||||
*
|
||||
* Clean up and dispose the current OpenCode instance, releasing all resources.
|
||||
*/
|
||||
public dispose<ThrowOnError extends boolean = false>(options?: Options<InstanceDisposeData, ThrowOnError>) {
|
||||
return (options?.client ?? this.client).post<InstanceDisposeResponses, unknown, ThrowOnError>({
|
||||
url: "/instance/dispose",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export class Path extends HeyApiClient {
|
||||
/**
|
||||
* Get paths
|
||||
*
|
||||
* Retrieve the current working directory and related path information for the OpenCode instance.
|
||||
*/
|
||||
public get<ThrowOnError extends boolean = false>(options?: Options<PathGetData, ThrowOnError>) {
|
||||
return (options?.client ?? this.client).get<PathGetResponses, unknown, ThrowOnError>({ url: "/path", ...options })
|
||||
}
|
||||
}
|
||||
|
||||
export class Diff extends HeyApiClient {
|
||||
/**
|
||||
* Get raw VCS diff
|
||||
*
|
||||
* Retrieve a raw patch for current uncommitted changes.
|
||||
*/
|
||||
public raw<ThrowOnError extends boolean = false>(options?: Options<VcsDiffRawData, ThrowOnError>) {
|
||||
return (options?.client ?? this.client).get<VcsDiffRawResponses, unknown, ThrowOnError>({
|
||||
url: "/vcs/diff/raw",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export class Vcs extends HeyApiClient {
|
||||
/**
|
||||
* Get VCS info
|
||||
*
|
||||
* Retrieve version control system (VCS) information for the current project, such as git branch.
|
||||
*/
|
||||
public get<ThrowOnError extends boolean = false>(options?: Options<VcsGetData, ThrowOnError>) {
|
||||
return (options?.client ?? this.client).get<VcsGetResponses, unknown, ThrowOnError>({ url: "/vcs", ...options })
|
||||
}
|
||||
|
||||
/**
|
||||
* Get VCS status
|
||||
*
|
||||
* Retrieve changed files in the current working tree without patches.
|
||||
*/
|
||||
public status<ThrowOnError extends boolean = false>(options?: Options<VcsStatusData, ThrowOnError>) {
|
||||
return (options?.client ?? this.client).get<VcsStatusResponses, unknown, ThrowOnError>({
|
||||
url: "/vcs/status",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Get VCS diff
|
||||
*
|
||||
* Retrieve the current git diff for the working tree or against the default branch.
|
||||
*/
|
||||
public diff<ThrowOnError extends boolean = false>(options: Options<VcsDiffData, ThrowOnError>) {
|
||||
return (options.client ?? this.client).get<VcsDiffResponses, unknown, ThrowOnError>({
|
||||
url: "/vcs/diff",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Apply VCS patch
|
||||
*
|
||||
* Apply a raw patch to the current working tree.
|
||||
*/
|
||||
public apply<ThrowOnError extends boolean = false>(options?: Options<VcsApplyData, ThrowOnError>) {
|
||||
return (options?.client ?? this.client).post<VcsApplyResponses, VcsApplyErrors, ThrowOnError>({
|
||||
url: "/vcs/apply",
|
||||
...options,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
...options?.headers,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
private _diff?: Diff
|
||||
get diff2(): Diff {
|
||||
return (this._diff ??= new Diff({ client: this.client }))
|
||||
}
|
||||
}
|
||||
|
||||
export class Command extends HeyApiClient {
|
||||
/**
|
||||
* List commands
|
||||
*
|
||||
* Get a list of all available commands in the OpenCode system.
|
||||
*/
|
||||
public list<ThrowOnError extends boolean = false>(options?: Options<CommandListData, ThrowOnError>) {
|
||||
return (options?.client ?? this.client).get<CommandListResponses, unknown, ThrowOnError>({
|
||||
url: "/command",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export class Lsp extends HeyApiClient {
|
||||
/**
|
||||
* Get LSP status
|
||||
*
|
||||
* Get LSP server status
|
||||
*/
|
||||
public status<ThrowOnError extends boolean = false>(options?: Options<LspStatusData, ThrowOnError>) {
|
||||
return (options?.client ?? this.client).get<LspStatusResponses, unknown, ThrowOnError>({ url: "/lsp", ...options })
|
||||
}
|
||||
}
|
||||
|
||||
export class Formatter extends HeyApiClient {
|
||||
/**
|
||||
* Get formatter status
|
||||
*
|
||||
* Get formatter status
|
||||
*/
|
||||
public status<ThrowOnError extends boolean = false>(options?: Options<FormatterStatusData, ThrowOnError>) {
|
||||
return (options?.client ?? this.client).get<FormatterStatusResponses, unknown, ThrowOnError>({
|
||||
url: "/formatter",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export class Auth2 extends HeyApiClient {
|
||||
/**
|
||||
* Remove MCP OAuth
|
||||
*
|
||||
* Remove OAuth credentials for an MCP server.
|
||||
*/
|
||||
public remove<ThrowOnError extends boolean = false>(options: Options<McpAuthRemoveData, ThrowOnError>) {
|
||||
return (options.client ?? this.client).delete<McpAuthRemoveResponses, McpAuthRemoveErrors, ThrowOnError>({
|
||||
url: "/mcp/{name}/auth",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Start MCP OAuth
|
||||
*
|
||||
* Start OAuth authentication flow for a Model Context Protocol (MCP) server.
|
||||
*/
|
||||
public start<ThrowOnError extends boolean = false>(options: Options<McpAuthStartData, ThrowOnError>) {
|
||||
return (options.client ?? this.client).post<McpAuthStartResponses, McpAuthStartErrors, ThrowOnError>({
|
||||
url: "/mcp/{name}/auth",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Complete MCP OAuth
|
||||
*
|
||||
* Complete OAuth authentication for a Model Context Protocol (MCP) server using the authorization code.
|
||||
*/
|
||||
public callback<ThrowOnError extends boolean = false>(options: Options<McpAuthCallbackData, ThrowOnError>) {
|
||||
return (options.client ?? this.client).post<McpAuthCallbackResponses, McpAuthCallbackErrors, ThrowOnError>({
|
||||
url: "/mcp/{name}/auth/callback",
|
||||
...options,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
@@ -324,33 +1126,36 @@ class Pty extends _HeyApiClient {
|
||||
}
|
||||
|
||||
/**
|
||||
* Connect to a PTY session
|
||||
* Authenticate MCP OAuth
|
||||
*
|
||||
* Start OAuth flow and wait for callback (opens browser).
|
||||
*/
|
||||
public connect<ThrowOnError extends boolean = false>(options: Options<PtyConnectData, ThrowOnError>) {
|
||||
return (options.client ?? this._client).get<PtyConnectResponses, PtyConnectErrors, ThrowOnError>({
|
||||
url: "/pty/{id}/connect",
|
||||
public authenticate<ThrowOnError extends boolean = false>(options: Options<McpAuthAuthenticateData, ThrowOnError>) {
|
||||
return (options.client ?? this.client).post<McpAuthAuthenticateResponses, McpAuthAuthenticateErrors, ThrowOnError>({
|
||||
url: "/mcp/{name}/auth/authenticate",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
class Config extends _HeyApiClient {
|
||||
export class Mcp extends HeyApiClient {
|
||||
/**
|
||||
* Get config info
|
||||
* Get MCP status
|
||||
*
|
||||
* Get the status of all Model Context Protocol (MCP) servers.
|
||||
*/
|
||||
public get<ThrowOnError extends boolean = false>(options?: Options<ConfigGetData, ThrowOnError>) {
|
||||
return (options?.client ?? this._client).get<ConfigGetResponses, unknown, ThrowOnError>({
|
||||
url: "/config",
|
||||
...options,
|
||||
})
|
||||
public status<ThrowOnError extends boolean = false>(options?: Options<McpStatusData, ThrowOnError>) {
|
||||
return (options?.client ?? this.client).get<McpStatusResponses, unknown, ThrowOnError>({ url: "/mcp", ...options })
|
||||
}
|
||||
|
||||
/**
|
||||
* Update config
|
||||
* Add MCP server
|
||||
*
|
||||
* Dynamically add a new Model Context Protocol (MCP) server to the system.
|
||||
*/
|
||||
public update<ThrowOnError extends boolean = false>(options?: Options<ConfigUpdateData, ThrowOnError>) {
|
||||
return (options?.client ?? this._client).patch<ConfigUpdateResponses, ConfigUpdateErrors, ThrowOnError>({
|
||||
url: "/config",
|
||||
public add<ThrowOnError extends boolean = false>(options?: Options<McpAddData, ThrowOnError>) {
|
||||
return (options?.client ?? this.client).post<McpAddResponses, McpAddErrors, ThrowOnError>({
|
||||
url: "/mcp",
|
||||
...options,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
@@ -360,90 +1165,371 @@ class Config extends _HeyApiClient {
|
||||
}
|
||||
|
||||
/**
|
||||
* List all providers
|
||||
* Connect an MCP server.
|
||||
*/
|
||||
public providers<ThrowOnError extends boolean = false>(options?: Options<ConfigProvidersData, ThrowOnError>) {
|
||||
return (options?.client ?? this._client).get<ConfigProvidersResponses, unknown, ThrowOnError>({
|
||||
url: "/config/providers",
|
||||
public connect<ThrowOnError extends boolean = false>(options: Options<McpConnectData, ThrowOnError>) {
|
||||
return (options.client ?? this.client).post<McpConnectResponses, unknown, ThrowOnError>({
|
||||
url: "/mcp/{name}/connect",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Disconnect an MCP server.
|
||||
*/
|
||||
public disconnect<ThrowOnError extends boolean = false>(options: Options<McpDisconnectData, ThrowOnError>) {
|
||||
return (options.client ?? this.client).post<McpDisconnectResponses, unknown, ThrowOnError>({
|
||||
url: "/mcp/{name}/disconnect",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
|
||||
private _auth?: Auth2
|
||||
get auth(): Auth2 {
|
||||
return (this._auth ??= new Auth2({ client: this.client }))
|
||||
}
|
||||
}
|
||||
|
||||
export class Project extends HeyApiClient {
|
||||
/**
|
||||
* List all projects
|
||||
*
|
||||
* Get a list of projects that have been opened with OpenCode.
|
||||
*/
|
||||
public list<ThrowOnError extends boolean = false>(options?: Options<ProjectListData, ThrowOnError>) {
|
||||
return (options?.client ?? this.client).get<ProjectListResponses, unknown, ThrowOnError>({
|
||||
url: "/project",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Get current project
|
||||
*
|
||||
* Retrieve the currently active project that OpenCode is working with.
|
||||
*/
|
||||
public current<ThrowOnError extends boolean = false>(options?: Options<ProjectCurrentData, ThrowOnError>) {
|
||||
return (options?.client ?? this.client).get<ProjectCurrentResponses, unknown, ThrowOnError>({
|
||||
url: "/project/current",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize git repository
|
||||
*
|
||||
* Create a git repository for the current project and return the refreshed project info.
|
||||
*/
|
||||
public initGit<ThrowOnError extends boolean = false>(options?: Options<ProjectInitGitData, ThrowOnError>) {
|
||||
return (options?.client ?? this.client).post<ProjectInitGitResponses, unknown, ThrowOnError>({
|
||||
url: "/project/git/init",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Update project
|
||||
*
|
||||
* Update project properties such as name, icon, and commands.
|
||||
*/
|
||||
public update<ThrowOnError extends boolean = false>(options: Options<ProjectUpdateData, ThrowOnError>) {
|
||||
return (options.client ?? this.client).patch<ProjectUpdateResponses, ProjectUpdateErrors, ThrowOnError>({
|
||||
url: "/project/{projectID}",
|
||||
...options,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
...options.headers,
|
||||
},
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export class Pty extends HeyApiClient {
|
||||
/**
|
||||
* List available shells
|
||||
*
|
||||
* Get a list of available shells on the system.
|
||||
*/
|
||||
public shells<ThrowOnError extends boolean = false>(options?: Options<PtyShellsData, ThrowOnError>) {
|
||||
return (options?.client ?? this.client).get<PtyShellsResponses, unknown, ThrowOnError>({
|
||||
url: "/pty/shells",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* List PTY sessions
|
||||
*
|
||||
* Get a list of all active pseudo-terminal (PTY) sessions managed by OpenCode.
|
||||
*/
|
||||
public list<ThrowOnError extends boolean = false>(options?: Options<PtyListData, ThrowOnError>) {
|
||||
return (options?.client ?? this.client).get<PtyListResponses, unknown, ThrowOnError>({ url: "/pty", ...options })
|
||||
}
|
||||
|
||||
/**
|
||||
* Create PTY session
|
||||
*
|
||||
* Create a new pseudo-terminal (PTY) session for running shell commands and processes.
|
||||
*/
|
||||
public create<ThrowOnError extends boolean = false>(options?: Options<PtyCreateData, ThrowOnError>) {
|
||||
return (options?.client ?? this.client).post<PtyCreateResponses, PtyCreateErrors, ThrowOnError>({
|
||||
url: "/pty",
|
||||
...options,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
...options?.headers,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove PTY session
|
||||
*
|
||||
* Remove and terminate a specific pseudo-terminal (PTY) session.
|
||||
*/
|
||||
public remove<ThrowOnError extends boolean = false>(options: Options<PtyRemoveData, ThrowOnError>) {
|
||||
return (options.client ?? this.client).delete<PtyRemoveResponses, PtyRemoveErrors, ThrowOnError>({
|
||||
url: "/pty/{ptyID}",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Get PTY session
|
||||
*
|
||||
* Retrieve detailed information about a specific pseudo-terminal (PTY) session.
|
||||
*/
|
||||
public get<ThrowOnError extends boolean = false>(options: Options<PtyGetData, ThrowOnError>) {
|
||||
return (options.client ?? this.client).get<PtyGetResponses, PtyGetErrors, ThrowOnError>({
|
||||
url: "/pty/{ptyID}",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Update PTY session
|
||||
*
|
||||
* Update properties of an existing pseudo-terminal (PTY) session.
|
||||
*/
|
||||
public update<ThrowOnError extends boolean = false>(options: Options<PtyUpdateData, ThrowOnError>) {
|
||||
return (options.client ?? this.client).put<PtyUpdateResponses, PtyUpdateErrors, ThrowOnError>({
|
||||
url: "/pty/{ptyID}",
|
||||
...options,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
...options.headers,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Create PTY WebSocket token
|
||||
*
|
||||
* Create a short-lived ticket for opening a PTY WebSocket connection.
|
||||
*/
|
||||
public connectToken<ThrowOnError extends boolean = false>(options: Options<PtyConnectTokenData, ThrowOnError>) {
|
||||
return (options.client ?? this.client).post<PtyConnectTokenResponses, PtyConnectTokenErrors, ThrowOnError>({
|
||||
url: "/pty/{ptyID}/connect-token",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Connect to PTY session
|
||||
*
|
||||
* Establish a WebSocket connection to interact with a pseudo-terminal (PTY) session in real-time.
|
||||
*/
|
||||
public connect<ThrowOnError extends boolean = false>(options: Options<PtyConnectData, ThrowOnError>) {
|
||||
return (options.client ?? this.client).get<PtyConnectResponses, PtyConnectErrors, ThrowOnError>({
|
||||
url: "/pty/{ptyID}/connect",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
class Tool extends _HeyApiClient {
|
||||
export class Question extends HeyApiClient {
|
||||
/**
|
||||
* List all tool IDs (including built-in and dynamically registered)
|
||||
* List pending questions
|
||||
*
|
||||
* Get all pending question requests across all sessions.
|
||||
*/
|
||||
public ids<ThrowOnError extends boolean = false>(options?: Options<ToolIdsData, ThrowOnError>) {
|
||||
return (options?.client ?? this._client).get<ToolIdsResponses, ToolIdsErrors, ThrowOnError>({
|
||||
url: "/experimental/tool/ids",
|
||||
public list<ThrowOnError extends boolean = false>(options?: Options<QuestionListData, ThrowOnError>) {
|
||||
return (options?.client ?? this.client).get<QuestionListResponses, unknown, ThrowOnError>({
|
||||
url: "/question",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* List tools with JSON schema parameters for a provider/model
|
||||
* Reply to question request
|
||||
*
|
||||
* Provide answers to a question request from the AI assistant.
|
||||
*/
|
||||
public list<ThrowOnError extends boolean = false>(options: Options<ToolListData, ThrowOnError>) {
|
||||
return (options.client ?? this._client).get<ToolListResponses, ToolListErrors, ThrowOnError>({
|
||||
url: "/experimental/tool",
|
||||
public reply<ThrowOnError extends boolean = false>(options: Options<QuestionReplyData, ThrowOnError>) {
|
||||
return (options.client ?? this.client).post<QuestionReplyResponses, QuestionReplyErrors, ThrowOnError>({
|
||||
url: "/question/{requestID}/reply",
|
||||
...options,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
...options.headers,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Reject question request
|
||||
*
|
||||
* Reject a question request from the AI assistant.
|
||||
*/
|
||||
public reject<ThrowOnError extends boolean = false>(options: Options<QuestionRejectData, ThrowOnError>) {
|
||||
return (options.client ?? this.client).post<QuestionRejectResponses, QuestionRejectErrors, ThrowOnError>({
|
||||
url: "/question/{requestID}/reject",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
class Instance extends _HeyApiClient {
|
||||
export class Permission extends HeyApiClient {
|
||||
/**
|
||||
* Dispose the current instance
|
||||
* List pending permissions
|
||||
*
|
||||
* Get all pending permission requests across all sessions.
|
||||
*/
|
||||
public dispose<ThrowOnError extends boolean = false>(options?: Options<InstanceDisposeData, ThrowOnError>) {
|
||||
return (options?.client ?? this._client).post<InstanceDisposeResponses, unknown, ThrowOnError>({
|
||||
url: "/instance/dispose",
|
||||
public list<ThrowOnError extends boolean = false>(options?: Options<PermissionListData, ThrowOnError>) {
|
||||
return (options?.client ?? this.client).get<PermissionListResponses, unknown, ThrowOnError>({
|
||||
url: "/permission",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Respond to permission request
|
||||
*
|
||||
* Approve or deny a permission request from the AI assistant.
|
||||
*/
|
||||
public reply<ThrowOnError extends boolean = false>(options: Options<PermissionReplyData, ThrowOnError>) {
|
||||
return (options.client ?? this.client).post<PermissionReplyResponses, PermissionReplyErrors, ThrowOnError>({
|
||||
url: "/permission/{requestID}/reply",
|
||||
...options,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
...options.headers,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Respond to permission
|
||||
*
|
||||
* Approve or deny a permission request from the AI assistant.
|
||||
*
|
||||
* @deprecated
|
||||
*/
|
||||
public respond<ThrowOnError extends boolean = false>(options: Options<PermissionRespondData, ThrowOnError>) {
|
||||
return (options.client ?? this.client).post<PermissionRespondResponses, PermissionRespondErrors, ThrowOnError>({
|
||||
url: "/session/{id}/permissions/{permissionID}",
|
||||
...options,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
...options.headers,
|
||||
},
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
class Path extends _HeyApiClient {
|
||||
export class Oauth extends HeyApiClient {
|
||||
/**
|
||||
* Get the current path
|
||||
* Start OAuth authorization
|
||||
*
|
||||
* Start the OAuth authorization flow for a provider.
|
||||
*/
|
||||
public get<ThrowOnError extends boolean = false>(options?: Options<PathGetData, ThrowOnError>) {
|
||||
return (options?.client ?? this._client).get<PathGetResponses, unknown, ThrowOnError>({
|
||||
url: "/path",
|
||||
public authorize<ThrowOnError extends boolean = false>(options: Options<ProviderOauthAuthorizeData, ThrowOnError>) {
|
||||
return (options.client ?? this.client).post<
|
||||
ProviderOauthAuthorizeResponses,
|
||||
ProviderOauthAuthorizeErrors,
|
||||
ThrowOnError
|
||||
>({
|
||||
url: "/provider/{providerID}/oauth/authorize",
|
||||
...options,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
...options.headers,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle OAuth callback
|
||||
*
|
||||
* Handle the OAuth callback from a provider after user authorization.
|
||||
*/
|
||||
public callback<ThrowOnError extends boolean = false>(options: Options<ProviderOauthCallbackData, ThrowOnError>) {
|
||||
return (options.client ?? this.client).post<
|
||||
ProviderOauthCallbackResponses,
|
||||
ProviderOauthCallbackErrors,
|
||||
ThrowOnError
|
||||
>({
|
||||
url: "/provider/{providerID}/oauth/callback",
|
||||
...options,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
...options.headers,
|
||||
},
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
class Vcs extends _HeyApiClient {
|
||||
export class Provider extends HeyApiClient {
|
||||
/**
|
||||
* Get VCS info for the current instance
|
||||
* List providers
|
||||
*
|
||||
* Get a list of all available AI providers, including both available and connected ones.
|
||||
*/
|
||||
public get<ThrowOnError extends boolean = false>(options?: Options<VcsGetData, ThrowOnError>) {
|
||||
return (options?.client ?? this._client).get<VcsGetResponses, unknown, ThrowOnError>({
|
||||
url: "/vcs",
|
||||
public list<ThrowOnError extends boolean = false>(options?: Options<ProviderListData, ThrowOnError>) {
|
||||
return (options?.client ?? this.client).get<ProviderListResponses, unknown, ThrowOnError>({
|
||||
url: "/provider",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Get provider auth methods
|
||||
*
|
||||
* Retrieve available authentication methods for all AI providers.
|
||||
*/
|
||||
public auth<ThrowOnError extends boolean = false>(options?: Options<ProviderAuthData, ThrowOnError>) {
|
||||
return (options?.client ?? this.client).get<ProviderAuthResponses, unknown, ThrowOnError>({
|
||||
url: "/provider/auth",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
|
||||
private _oauth?: Oauth
|
||||
get oauth(): Oauth {
|
||||
return (this._oauth ??= new Oauth({ client: this.client }))
|
||||
}
|
||||
}
|
||||
|
||||
class Session extends _HeyApiClient {
|
||||
export class Session2 extends HeyApiClient {
|
||||
/**
|
||||
* List all sessions
|
||||
* List sessions
|
||||
*
|
||||
* Get a list of all OpenCode sessions, sorted by most recently updated.
|
||||
*/
|
||||
public list<ThrowOnError extends boolean = false>(options?: Options<SessionListData, ThrowOnError>) {
|
||||
return (options?.client ?? this._client).get<SessionListResponses, unknown, ThrowOnError>({
|
||||
return (options?.client ?? this.client).get<SessionListResponses, unknown, ThrowOnError>({
|
||||
url: "/session",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new session
|
||||
* Create session
|
||||
*
|
||||
* Create a new OpenCode session for interacting with AI assistants and managing conversations.
|
||||
*/
|
||||
public create<ThrowOnError extends boolean = false>(options?: Options<SessionCreateData, ThrowOnError>) {
|
||||
return (options?.client ?? this._client).post<SessionCreateResponses, SessionCreateErrors, ThrowOnError>({
|
||||
return (options?.client ?? this.client).post<SessionCreateResponses, SessionCreateErrors, ThrowOnError>({
|
||||
url: "/session",
|
||||
...options,
|
||||
headers: {
|
||||
@@ -455,19 +1541,23 @@ class Session extends _HeyApiClient {
|
||||
|
||||
/**
|
||||
* Get session status
|
||||
*
|
||||
* Retrieve the current status of all sessions, including active, idle, and completed states.
|
||||
*/
|
||||
public status<ThrowOnError extends boolean = false>(options?: Options<SessionStatusData, ThrowOnError>) {
|
||||
return (options?.client ?? this._client).get<SessionStatusResponses, SessionStatusErrors, ThrowOnError>({
|
||||
return (options?.client ?? this.client).get<SessionStatusResponses, SessionStatusErrors, ThrowOnError>({
|
||||
url: "/session/status",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a session and all its data
|
||||
* Delete session
|
||||
*
|
||||
* Delete a session and permanently remove all associated data, including messages and history.
|
||||
*/
|
||||
public delete<ThrowOnError extends boolean = false>(options: Options<SessionDeleteData, ThrowOnError>) {
|
||||
return (options.client ?? this._client).delete<SessionDeleteResponses, SessionDeleteErrors, ThrowOnError>({
|
||||
return (options.client ?? this.client).delete<SessionDeleteResponses, SessionDeleteErrors, ThrowOnError>({
|
||||
url: "/session/{id}",
|
||||
...options,
|
||||
})
|
||||
@@ -475,19 +1565,23 @@ class Session extends _HeyApiClient {
|
||||
|
||||
/**
|
||||
* Get session
|
||||
*
|
||||
* Retrieve detailed information about a specific OpenCode session.
|
||||
*/
|
||||
public get<ThrowOnError extends boolean = false>(options: Options<SessionGetData, ThrowOnError>) {
|
||||
return (options.client ?? this._client).get<SessionGetResponses, SessionGetErrors, ThrowOnError>({
|
||||
return (options.client ?? this.client).get<SessionGetResponses, SessionGetErrors, ThrowOnError>({
|
||||
url: "/session/{id}",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Update session properties
|
||||
* Update session
|
||||
*
|
||||
* Update properties of an existing session, such as title or other metadata.
|
||||
*/
|
||||
public update<ThrowOnError extends boolean = false>(options: Options<SessionUpdateData, ThrowOnError>) {
|
||||
return (options.client ?? this._client).patch<SessionUpdateResponses, SessionUpdateErrors, ThrowOnError>({
|
||||
return (options.client ?? this.client).patch<SessionUpdateResponses, SessionUpdateErrors, ThrowOnError>({
|
||||
url: "/session/{id}",
|
||||
...options,
|
||||
headers: {
|
||||
@@ -498,31 +1592,61 @@ class Session extends _HeyApiClient {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a session's children
|
||||
* Get session children
|
||||
*
|
||||
* Retrieve all child sessions that were forked from the specified parent session.
|
||||
*/
|
||||
public children<ThrowOnError extends boolean = false>(options: Options<SessionChildrenData, ThrowOnError>) {
|
||||
return (options.client ?? this._client).get<SessionChildrenResponses, SessionChildrenErrors, ThrowOnError>({
|
||||
return (options.client ?? this.client).get<SessionChildrenResponses, SessionChildrenErrors, ThrowOnError>({
|
||||
url: "/session/{id}/children",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the todo list for a session
|
||||
* Get session todos
|
||||
*
|
||||
* Retrieve the todo list associated with a specific session, showing tasks and action items.
|
||||
*/
|
||||
public todo<ThrowOnError extends boolean = false>(options: Options<SessionTodoData, ThrowOnError>) {
|
||||
return (options.client ?? this._client).get<SessionTodoResponses, SessionTodoErrors, ThrowOnError>({
|
||||
return (options.client ?? this.client).get<SessionTodoResponses, SessionTodoErrors, ThrowOnError>({
|
||||
url: "/session/{id}/todo",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Analyze the app and create an AGENTS.md file
|
||||
* Get message diff
|
||||
*
|
||||
* Get the file changes (diff) that resulted from a specific user message in the session.
|
||||
*/
|
||||
public init<ThrowOnError extends boolean = false>(options: Options<SessionInitData, ThrowOnError>) {
|
||||
return (options.client ?? this._client).post<SessionInitResponses, SessionInitErrors, ThrowOnError>({
|
||||
url: "/session/{id}/init",
|
||||
public diff<ThrowOnError extends boolean = false>(options: Options<SessionDiffData, ThrowOnError>) {
|
||||
return (options.client ?? this.client).get<SessionDiffResponses, unknown, ThrowOnError>({
|
||||
url: "/session/{id}/diff",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Get session messages
|
||||
*
|
||||
* Retrieve all messages in a session, including user prompts and AI responses.
|
||||
*/
|
||||
public messages<ThrowOnError extends boolean = false>(options: Options<SessionMessagesData, ThrowOnError>) {
|
||||
return (options.client ?? this.client).get<SessionMessagesResponses, SessionMessagesErrors, ThrowOnError>({
|
||||
url: "/session/{id}/message",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Send message
|
||||
*
|
||||
* Create and send a new message to a session, streaming the AI response.
|
||||
*/
|
||||
public prompt<ThrowOnError extends boolean = false>(options: Options<SessionPromptData, ThrowOnError>) {
|
||||
return (options.client ?? this.client).post<SessionPromptResponses, SessionPromptErrors, ThrowOnError>({
|
||||
url: "/session/{id}/message",
|
||||
...options,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
@@ -532,10 +1656,37 @@ class Session extends _HeyApiClient {
|
||||
}
|
||||
|
||||
/**
|
||||
* Fork an existing session at a specific message
|
||||
* Delete message
|
||||
*
|
||||
* Permanently delete a specific message and all of its parts from a session without reverting file changes.
|
||||
*/
|
||||
public deleteMessage<ThrowOnError extends boolean = false>(options: Options<SessionDeleteMessageData, ThrowOnError>) {
|
||||
return (options.client ?? this.client).delete<
|
||||
SessionDeleteMessageResponses,
|
||||
SessionDeleteMessageErrors,
|
||||
ThrowOnError
|
||||
>({ url: "/session/{id}/message/{messageID}", ...options })
|
||||
}
|
||||
|
||||
/**
|
||||
* Get message
|
||||
*
|
||||
* Retrieve a specific message from a session by its message ID.
|
||||
*/
|
||||
public message<ThrowOnError extends boolean = false>(options: Options<SessionMessageData, ThrowOnError>) {
|
||||
return (options.client ?? this.client).get<SessionMessageResponses, SessionMessageErrors, ThrowOnError>({
|
||||
url: "/session/{id}/message/{messageID}",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Fork session
|
||||
*
|
||||
* Create a new session by forking an existing session at a specific message point.
|
||||
*/
|
||||
public fork<ThrowOnError extends boolean = false>(options: Options<SessionForkData, ThrowOnError>) {
|
||||
return (options.client ?? this._client).post<SessionForkResponses, unknown, ThrowOnError>({
|
||||
return (options.client ?? this.client).post<SessionForkResponses, SessionForkErrors, ThrowOnError>({
|
||||
url: "/session/{id}/fork",
|
||||
...options,
|
||||
headers: {
|
||||
@@ -546,50 +1697,64 @@ class Session extends _HeyApiClient {
|
||||
}
|
||||
|
||||
/**
|
||||
* Abort a session
|
||||
* Abort session
|
||||
*
|
||||
* Abort an active session and stop any ongoing AI processing or command execution.
|
||||
*/
|
||||
public abort<ThrowOnError extends boolean = false>(options: Options<SessionAbortData, ThrowOnError>) {
|
||||
return (options.client ?? this._client).post<SessionAbortResponses, SessionAbortErrors, ThrowOnError>({
|
||||
return (options.client ?? this.client).post<SessionAbortResponses, SessionAbortErrors, ThrowOnError>({
|
||||
url: "/session/{id}/abort",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Unshare the session
|
||||
* Initialize session
|
||||
*
|
||||
* Analyze the current application and create an AGENTS.md file with project-specific agent configurations.
|
||||
*/
|
||||
public init<ThrowOnError extends boolean = false>(options: Options<SessionInitData, ThrowOnError>) {
|
||||
return (options.client ?? this.client).post<SessionInitResponses, SessionInitErrors, ThrowOnError>({
|
||||
url: "/session/{id}/init",
|
||||
...options,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
...options.headers,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Unshare session
|
||||
*
|
||||
* Remove the shareable link for a session, making it private again.
|
||||
*/
|
||||
public unshare<ThrowOnError extends boolean = false>(options: Options<SessionUnshareData, ThrowOnError>) {
|
||||
return (options.client ?? this._client).delete<SessionUnshareResponses, SessionUnshareErrors, ThrowOnError>({
|
||||
return (options.client ?? this.client).delete<SessionUnshareResponses, SessionUnshareErrors, ThrowOnError>({
|
||||
url: "/session/{id}/share",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Share a session
|
||||
* Share session
|
||||
*
|
||||
* Create a shareable link for a session, allowing others to view the conversation.
|
||||
*/
|
||||
public share<ThrowOnError extends boolean = false>(options: Options<SessionShareData, ThrowOnError>) {
|
||||
return (options.client ?? this._client).post<SessionShareResponses, SessionShareErrors, ThrowOnError>({
|
||||
return (options.client ?? this.client).post<SessionShareResponses, SessionShareErrors, ThrowOnError>({
|
||||
url: "/session/{id}/share",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the diff for this session
|
||||
*/
|
||||
public diff<ThrowOnError extends boolean = false>(options: Options<SessionDiffData, ThrowOnError>) {
|
||||
return (options.client ?? this._client).get<SessionDiffResponses, SessionDiffErrors, ThrowOnError>({
|
||||
url: "/session/{id}/diff",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Summarize the session
|
||||
* Summarize session
|
||||
*
|
||||
* Generate a concise summary of the session using AI compaction to preserve key information.
|
||||
*/
|
||||
public summarize<ThrowOnError extends boolean = false>(options: Options<SessionSummarizeData, ThrowOnError>) {
|
||||
return (options.client ?? this._client).post<SessionSummarizeResponses, SessionSummarizeErrors, ThrowOnError>({
|
||||
return (options.client ?? this.client).post<SessionSummarizeResponses, SessionSummarizeErrors, ThrowOnError>({
|
||||
url: "/session/{id}/summarize",
|
||||
...options,
|
||||
headers: {
|
||||
@@ -600,44 +1765,12 @@ class Session extends _HeyApiClient {
|
||||
}
|
||||
|
||||
/**
|
||||
* List messages for a session
|
||||
*/
|
||||
public messages<ThrowOnError extends boolean = false>(options: Options<SessionMessagesData, ThrowOnError>) {
|
||||
return (options.client ?? this._client).get<SessionMessagesResponses, SessionMessagesErrors, ThrowOnError>({
|
||||
url: "/session/{id}/message",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Create and send a new message to a session
|
||||
*/
|
||||
public prompt<ThrowOnError extends boolean = false>(options: Options<SessionPromptData, ThrowOnError>) {
|
||||
return (options.client ?? this._client).post<SessionPromptResponses, SessionPromptErrors, ThrowOnError>({
|
||||
url: "/session/{id}/message",
|
||||
...options,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
...options.headers,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a message from a session
|
||||
*/
|
||||
public message<ThrowOnError extends boolean = false>(options: Options<SessionMessageData, ThrowOnError>) {
|
||||
return (options.client ?? this._client).get<SessionMessageResponses, SessionMessageErrors, ThrowOnError>({
|
||||
url: "/session/{id}/message/{messageID}",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Create and send a new message to a session, start if needed and return immediately
|
||||
* Send async message
|
||||
*
|
||||
* Create and send a new message to a session asynchronously, starting the session if needed and returning immediately.
|
||||
*/
|
||||
public promptAsync<ThrowOnError extends boolean = false>(options: Options<SessionPromptAsyncData, ThrowOnError>) {
|
||||
return (options.client ?? this._client).post<SessionPromptAsyncResponses, SessionPromptAsyncErrors, ThrowOnError>({
|
||||
return (options.client ?? this.client).post<SessionPromptAsyncResponses, SessionPromptAsyncErrors, ThrowOnError>({
|
||||
url: "/session/{id}/prompt_async",
|
||||
...options,
|
||||
headers: {
|
||||
@@ -648,10 +1781,12 @@ class Session extends _HeyApiClient {
|
||||
}
|
||||
|
||||
/**
|
||||
* Send a new command to a session
|
||||
* Send command
|
||||
*
|
||||
* Send a new command to a session for execution by the AI assistant.
|
||||
*/
|
||||
public command<ThrowOnError extends boolean = false>(options: Options<SessionCommandData, ThrowOnError>) {
|
||||
return (options.client ?? this._client).post<SessionCommandResponses, SessionCommandErrors, ThrowOnError>({
|
||||
return (options.client ?? this.client).post<SessionCommandResponses, SessionCommandErrors, ThrowOnError>({
|
||||
url: "/session/{id}/command",
|
||||
...options,
|
||||
headers: {
|
||||
@@ -662,10 +1797,12 @@ class Session extends _HeyApiClient {
|
||||
}
|
||||
|
||||
/**
|
||||
* Run a shell command
|
||||
* Run shell command
|
||||
*
|
||||
* Execute a shell command within the session context and return the AI's response.
|
||||
*/
|
||||
public shell<ThrowOnError extends boolean = false>(options: Options<SessionShellData, ThrowOnError>) {
|
||||
return (options.client ?? this._client).post<SessionShellResponses, SessionShellErrors, ThrowOnError>({
|
||||
return (options.client ?? this.client).post<SessionShellResponses, SessionShellErrors, ThrowOnError>({
|
||||
url: "/session/{id}/shell",
|
||||
...options,
|
||||
headers: {
|
||||
@@ -676,10 +1813,12 @@ class Session extends _HeyApiClient {
|
||||
}
|
||||
|
||||
/**
|
||||
* Revert a message
|
||||
* Revert message
|
||||
*
|
||||
* Revert a specific message in a session, undoing its effects and restoring the previous state.
|
||||
*/
|
||||
public revert<ThrowOnError extends boolean = false>(options: Options<SessionRevertData, ThrowOnError>) {
|
||||
return (options.client ?? this._client).post<SessionRevertResponses, SessionRevertErrors, ThrowOnError>({
|
||||
return (options.client ?? this.client).post<SessionRevertResponses, SessionRevertErrors, ThrowOnError>({
|
||||
url: "/session/{id}/revert",
|
||||
...options,
|
||||
headers: {
|
||||
@@ -690,57 +1829,35 @@ class Session extends _HeyApiClient {
|
||||
}
|
||||
|
||||
/**
|
||||
* Restore all reverted messages
|
||||
* Restore reverted messages
|
||||
*
|
||||
* Restore all previously reverted messages in a session.
|
||||
*/
|
||||
public unrevert<ThrowOnError extends boolean = false>(options: Options<SessionUnrevertData, ThrowOnError>) {
|
||||
return (options.client ?? this._client).post<SessionUnrevertResponses, SessionUnrevertErrors, ThrowOnError>({
|
||||
return (options.client ?? this.client).post<SessionUnrevertResponses, SessionUnrevertErrors, ThrowOnError>({
|
||||
url: "/session/{id}/unrevert",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
class Command extends _HeyApiClient {
|
||||
export class Part extends HeyApiClient {
|
||||
/**
|
||||
* List all commands
|
||||
* Delete a part from a message.
|
||||
*/
|
||||
public list<ThrowOnError extends boolean = false>(options?: Options<CommandListData, ThrowOnError>) {
|
||||
return (options?.client ?? this._client).get<CommandListResponses, unknown, ThrowOnError>({
|
||||
url: "/command",
|
||||
public delete<ThrowOnError extends boolean = false>(options: Options<PartDeleteData, ThrowOnError>) {
|
||||
return (options.client ?? this.client).delete<PartDeleteResponses, PartDeleteErrors, ThrowOnError>({
|
||||
url: "/session/{id}/message/{messageID}/part/{partID}",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
class Oauth extends _HeyApiClient {
|
||||
/**
|
||||
* Authorize a provider using OAuth
|
||||
*/
|
||||
public authorize<ThrowOnError extends boolean = false>(options: Options<ProviderOauthAuthorizeData, ThrowOnError>) {
|
||||
return (options.client ?? this._client).post<
|
||||
ProviderOauthAuthorizeResponses,
|
||||
ProviderOauthAuthorizeErrors,
|
||||
ThrowOnError
|
||||
>({
|
||||
url: "/provider/{id}/oauth/authorize",
|
||||
...options,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
...options.headers,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle OAuth callback for a provider
|
||||
* Update a part in a message.
|
||||
*/
|
||||
public callback<ThrowOnError extends boolean = false>(options: Options<ProviderOauthCallbackData, ThrowOnError>) {
|
||||
return (options.client ?? this._client).post<
|
||||
ProviderOauthCallbackResponses,
|
||||
ProviderOauthCallbackErrors,
|
||||
ThrowOnError
|
||||
>({
|
||||
url: "/provider/{id}/oauth/callback",
|
||||
public update<ThrowOnError extends boolean = false>(options: Options<PartUpdateData, ThrowOnError>) {
|
||||
return (options.client ?? this.client).patch<PartUpdateResponses, PartUpdateErrors, ThrowOnError>({
|
||||
url: "/session/{id}/message/{messageID}/part/{partID}",
|
||||
...options,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
@@ -750,100 +1867,45 @@ class Oauth extends _HeyApiClient {
|
||||
}
|
||||
}
|
||||
|
||||
class Provider extends _HeyApiClient {
|
||||
export class History extends HeyApiClient {
|
||||
/**
|
||||
* List all providers
|
||||
* List sync events
|
||||
*
|
||||
* List sync events for all aggregates. Keys are aggregate IDs the client already knows about, values are the last known sequence ID. Events with seq > value are returned for those aggregates. Aggregates not listed in the input get their full history.
|
||||
*/
|
||||
public list<ThrowOnError extends boolean = false>(options?: Options<ProviderListData, ThrowOnError>) {
|
||||
return (options?.client ?? this._client).get<ProviderListResponses, unknown, ThrowOnError>({
|
||||
url: "/provider",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Get provider authentication methods
|
||||
*/
|
||||
public auth<ThrowOnError extends boolean = false>(options?: Options<ProviderAuthData, ThrowOnError>) {
|
||||
return (options?.client ?? this._client).get<ProviderAuthResponses, unknown, ThrowOnError>({
|
||||
url: "/provider/auth",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
oauth = new Oauth({ client: this._client })
|
||||
}
|
||||
|
||||
class Find extends _HeyApiClient {
|
||||
/**
|
||||
* Find text in files
|
||||
*/
|
||||
public text<ThrowOnError extends boolean = false>(options: Options<FindTextData, ThrowOnError>) {
|
||||
return (options.client ?? this._client).get<FindTextResponses, unknown, ThrowOnError>({
|
||||
url: "/find",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Find files
|
||||
*/
|
||||
public files<ThrowOnError extends boolean = false>(options: Options<FindFilesData, ThrowOnError>) {
|
||||
return (options.client ?? this._client).get<FindFilesResponses, unknown, ThrowOnError>({
|
||||
url: "/find/file",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Find workspace symbols
|
||||
*/
|
||||
public symbols<ThrowOnError extends boolean = false>(options: Options<FindSymbolsData, ThrowOnError>) {
|
||||
return (options.client ?? this._client).get<FindSymbolsResponses, unknown, ThrowOnError>({
|
||||
url: "/find/symbol",
|
||||
public list<ThrowOnError extends boolean = false>(options?: Options<SyncHistoryListData, ThrowOnError>) {
|
||||
return (options?.client ?? this.client).post<SyncHistoryListResponses, SyncHistoryListErrors, ThrowOnError>({
|
||||
url: "/sync/history",
|
||||
...options,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
...options?.headers,
|
||||
},
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
class File extends _HeyApiClient {
|
||||
export class Sync extends HeyApiClient {
|
||||
/**
|
||||
* List files and directories
|
||||
* Start workspace sync
|
||||
*
|
||||
* Start sync loops for workspaces in the current project that have active sessions.
|
||||
*/
|
||||
public list<ThrowOnError extends boolean = false>(options: Options<FileListData, ThrowOnError>) {
|
||||
return (options.client ?? this._client).get<FileListResponses, unknown, ThrowOnError>({
|
||||
url: "/file",
|
||||
public start<ThrowOnError extends boolean = false>(options?: Options<SyncStartData, ThrowOnError>) {
|
||||
return (options?.client ?? this.client).post<SyncStartResponses, unknown, ThrowOnError>({
|
||||
url: "/sync/start",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Read a file
|
||||
* Replay sync events
|
||||
*
|
||||
* Validate and replay a complete sync event history.
|
||||
*/
|
||||
public read<ThrowOnError extends boolean = false>(options: Options<FileReadData, ThrowOnError>) {
|
||||
return (options.client ?? this._client).get<FileReadResponses, unknown, ThrowOnError>({
|
||||
url: "/file/content",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Get file status
|
||||
*/
|
||||
public status<ThrowOnError extends boolean = false>(options?: Options<FileStatusData, ThrowOnError>) {
|
||||
return (options?.client ?? this._client).get<FileStatusResponses, unknown, ThrowOnError>({
|
||||
url: "/file/status",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
class App extends _HeyApiClient {
|
||||
/**
|
||||
* Write a log entry to the server logs
|
||||
*/
|
||||
public log<ThrowOnError extends boolean = false>(options?: Options<AppLogData, ThrowOnError>) {
|
||||
return (options?.client ?? this._client).post<AppLogResponses, AppLogErrors, ThrowOnError>({
|
||||
url: "/log",
|
||||
public replay<ThrowOnError extends boolean = false>(options?: Options<SyncReplayData, ThrowOnError>) {
|
||||
return (options?.client ?? this.client).post<SyncReplayResponses, SyncReplayErrors, ThrowOnError>({
|
||||
url: "/sync/replay",
|
||||
...options,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
@@ -853,95 +1915,13 @@ class App extends _HeyApiClient {
|
||||
}
|
||||
|
||||
/**
|
||||
* List all agents
|
||||
* Steal session into workspace
|
||||
*
|
||||
* Update a session to belong to the current workspace through the sync event system.
|
||||
*/
|
||||
public agents<ThrowOnError extends boolean = false>(options?: Options<AppAgentsData, ThrowOnError>) {
|
||||
return (options?.client ?? this._client).get<AppAgentsResponses, unknown, ThrowOnError>({
|
||||
url: "/agent",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
class Auth extends _HeyApiClient {
|
||||
/**
|
||||
* Remove OAuth credentials for an MCP server
|
||||
*/
|
||||
public remove<ThrowOnError extends boolean = false>(options: Options<McpAuthRemoveData, ThrowOnError>) {
|
||||
return (options.client ?? this._client).delete<McpAuthRemoveResponses, McpAuthRemoveErrors, ThrowOnError>({
|
||||
url: "/mcp/{name}/auth",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Start OAuth authentication flow for an MCP server
|
||||
*/
|
||||
public start<ThrowOnError extends boolean = false>(options: Options<McpAuthStartData, ThrowOnError>) {
|
||||
return (options.client ?? this._client).post<McpAuthStartResponses, McpAuthStartErrors, ThrowOnError>({
|
||||
url: "/mcp/{name}/auth",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Complete OAuth authentication with authorization code
|
||||
*/
|
||||
public callback<ThrowOnError extends boolean = false>(options: Options<McpAuthCallbackData, ThrowOnError>) {
|
||||
return (options.client ?? this._client).post<McpAuthCallbackResponses, McpAuthCallbackErrors, ThrowOnError>({
|
||||
url: "/mcp/{name}/auth/callback",
|
||||
...options,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
...options.headers,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Start OAuth flow and wait for callback (opens browser)
|
||||
*/
|
||||
public authenticate<ThrowOnError extends boolean = false>(options: Options<McpAuthAuthenticateData, ThrowOnError>) {
|
||||
return (options.client ?? this._client).post<McpAuthAuthenticateResponses, McpAuthAuthenticateErrors, ThrowOnError>(
|
||||
{
|
||||
url: "/mcp/{name}/auth/authenticate",
|
||||
...options,
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Set authentication credentials
|
||||
*/
|
||||
public set<ThrowOnError extends boolean = false>(options: Options<AuthSetData, ThrowOnError>) {
|
||||
return (options.client ?? this._client).put<AuthSetResponses, AuthSetErrors, ThrowOnError>({
|
||||
url: "/auth/{id}",
|
||||
...options,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
...options.headers,
|
||||
},
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
class Mcp extends _HeyApiClient {
|
||||
/**
|
||||
* Get MCP server status
|
||||
*/
|
||||
public status<ThrowOnError extends boolean = false>(options?: Options<McpStatusData, ThrowOnError>) {
|
||||
return (options?.client ?? this._client).get<McpStatusResponses, unknown, ThrowOnError>({
|
||||
url: "/mcp",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Add MCP server dynamically
|
||||
*/
|
||||
public add<ThrowOnError extends boolean = false>(options?: Options<McpAddData, ThrowOnError>) {
|
||||
return (options?.client ?? this._client).post<McpAddResponses, McpAddErrors, ThrowOnError>({
|
||||
url: "/mcp",
|
||||
public steal<ThrowOnError extends boolean = false>(options?: Options<SyncStealData, ThrowOnError>) {
|
||||
return (options?.client ?? this.client).post<SyncStealResponses, SyncStealErrors, ThrowOnError>({
|
||||
url: "/sync/steal",
|
||||
...options,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
@@ -950,69 +1930,32 @@ class Mcp extends _HeyApiClient {
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Connect an MCP server
|
||||
*/
|
||||
public connect<ThrowOnError extends boolean = false>(options: Options<McpConnectData, ThrowOnError>) {
|
||||
return (options.client ?? this._client).post<McpConnectResponses, unknown, ThrowOnError>({
|
||||
url: "/mcp/{name}/connect",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Disconnect an MCP server
|
||||
*/
|
||||
public disconnect<ThrowOnError extends boolean = false>(options: Options<McpDisconnectData, ThrowOnError>) {
|
||||
return (options.client ?? this._client).post<McpDisconnectResponses, unknown, ThrowOnError>({
|
||||
url: "/mcp/{name}/disconnect",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
|
||||
auth = new Auth({ client: this._client })
|
||||
}
|
||||
|
||||
class Lsp extends _HeyApiClient {
|
||||
/**
|
||||
* Get LSP server status
|
||||
*/
|
||||
public status<ThrowOnError extends boolean = false>(options?: Options<LspStatusData, ThrowOnError>) {
|
||||
return (options?.client ?? this._client).get<LspStatusResponses, unknown, ThrowOnError>({
|
||||
url: "/lsp",
|
||||
...options,
|
||||
})
|
||||
private _history?: History
|
||||
get history(): History {
|
||||
return (this._history ??= new History({ client: this.client }))
|
||||
}
|
||||
}
|
||||
|
||||
class Formatter extends _HeyApiClient {
|
||||
export class Control extends HeyApiClient {
|
||||
/**
|
||||
* Get formatter status
|
||||
*/
|
||||
public status<ThrowOnError extends boolean = false>(options?: Options<FormatterStatusData, ThrowOnError>) {
|
||||
return (options?.client ?? this._client).get<FormatterStatusResponses, unknown, ThrowOnError>({
|
||||
url: "/formatter",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
class Control extends _HeyApiClient {
|
||||
/**
|
||||
* Get the next TUI request from the queue
|
||||
* Get next TUI request
|
||||
*
|
||||
* Retrieve the next TUI request from the queue for processing.
|
||||
*/
|
||||
public next<ThrowOnError extends boolean = false>(options?: Options<TuiControlNextData, ThrowOnError>) {
|
||||
return (options?.client ?? this._client).get<TuiControlNextResponses, unknown, ThrowOnError>({
|
||||
return (options?.client ?? this.client).get<TuiControlNextResponses, unknown, ThrowOnError>({
|
||||
url: "/tui/control/next",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Submit a response to the TUI request queue
|
||||
* Submit TUI response
|
||||
*
|
||||
* Submit a response to the TUI request queue to complete a pending request.
|
||||
*/
|
||||
public response<ThrowOnError extends boolean = false>(options?: Options<TuiControlResponseData, ThrowOnError>) {
|
||||
return (options?.client ?? this._client).post<TuiControlResponseResponses, unknown, ThrowOnError>({
|
||||
return (options?.client ?? this.client).post<TuiControlResponseResponses, unknown, ThrowOnError>({
|
||||
url: "/tui/control/response",
|
||||
...options,
|
||||
headers: {
|
||||
@@ -1023,12 +1966,14 @@ class Control extends _HeyApiClient {
|
||||
}
|
||||
}
|
||||
|
||||
class Tui extends _HeyApiClient {
|
||||
export class Tui extends HeyApiClient {
|
||||
/**
|
||||
* Append prompt to the TUI
|
||||
* Append TUI prompt
|
||||
*
|
||||
* Append prompt to the TUI.
|
||||
*/
|
||||
public appendPrompt<ThrowOnError extends boolean = false>(options?: Options<TuiAppendPromptData, ThrowOnError>) {
|
||||
return (options?.client ?? this._client).post<TuiAppendPromptResponses, TuiAppendPromptErrors, ThrowOnError>({
|
||||
return (options?.client ?? this.client).post<TuiAppendPromptResponses, TuiAppendPromptErrors, ThrowOnError>({
|
||||
url: "/tui/append-prompt",
|
||||
...options,
|
||||
headers: {
|
||||
@@ -1039,70 +1984,84 @@ class Tui extends _HeyApiClient {
|
||||
}
|
||||
|
||||
/**
|
||||
* Open the help dialog
|
||||
* Open help dialog
|
||||
*
|
||||
* Open the help dialog in the TUI to display user assistance information.
|
||||
*/
|
||||
public openHelp<ThrowOnError extends boolean = false>(options?: Options<TuiOpenHelpData, ThrowOnError>) {
|
||||
return (options?.client ?? this._client).post<TuiOpenHelpResponses, unknown, ThrowOnError>({
|
||||
return (options?.client ?? this.client).post<TuiOpenHelpResponses, unknown, ThrowOnError>({
|
||||
url: "/tui/open-help",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Open the session dialog
|
||||
* Open sessions dialog
|
||||
*
|
||||
* Open the session dialog.
|
||||
*/
|
||||
public openSessions<ThrowOnError extends boolean = false>(options?: Options<TuiOpenSessionsData, ThrowOnError>) {
|
||||
return (options?.client ?? this._client).post<TuiOpenSessionsResponses, unknown, ThrowOnError>({
|
||||
return (options?.client ?? this.client).post<TuiOpenSessionsResponses, unknown, ThrowOnError>({
|
||||
url: "/tui/open-sessions",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Open the theme dialog
|
||||
* Open themes dialog
|
||||
*
|
||||
* Open the theme dialog.
|
||||
*/
|
||||
public openThemes<ThrowOnError extends boolean = false>(options?: Options<TuiOpenThemesData, ThrowOnError>) {
|
||||
return (options?.client ?? this._client).post<TuiOpenThemesResponses, unknown, ThrowOnError>({
|
||||
return (options?.client ?? this.client).post<TuiOpenThemesResponses, unknown, ThrowOnError>({
|
||||
url: "/tui/open-themes",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Open the model dialog
|
||||
* Open models dialog
|
||||
*
|
||||
* Open the model dialog.
|
||||
*/
|
||||
public openModels<ThrowOnError extends boolean = false>(options?: Options<TuiOpenModelsData, ThrowOnError>) {
|
||||
return (options?.client ?? this._client).post<TuiOpenModelsResponses, unknown, ThrowOnError>({
|
||||
return (options?.client ?? this.client).post<TuiOpenModelsResponses, unknown, ThrowOnError>({
|
||||
url: "/tui/open-models",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Submit the prompt
|
||||
* Submit TUI prompt
|
||||
*
|
||||
* Submit the prompt.
|
||||
*/
|
||||
public submitPrompt<ThrowOnError extends boolean = false>(options?: Options<TuiSubmitPromptData, ThrowOnError>) {
|
||||
return (options?.client ?? this._client).post<TuiSubmitPromptResponses, unknown, ThrowOnError>({
|
||||
return (options?.client ?? this.client).post<TuiSubmitPromptResponses, unknown, ThrowOnError>({
|
||||
url: "/tui/submit-prompt",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear the prompt
|
||||
* Clear TUI prompt
|
||||
*
|
||||
* Clear the prompt.
|
||||
*/
|
||||
public clearPrompt<ThrowOnError extends boolean = false>(options?: Options<TuiClearPromptData, ThrowOnError>) {
|
||||
return (options?.client ?? this._client).post<TuiClearPromptResponses, unknown, ThrowOnError>({
|
||||
return (options?.client ?? this.client).post<TuiClearPromptResponses, unknown, ThrowOnError>({
|
||||
url: "/tui/clear-prompt",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute a TUI command (e.g. agent_cycle)
|
||||
* Execute TUI command
|
||||
*
|
||||
* Execute a TUI command.
|
||||
*/
|
||||
public executeCommand<ThrowOnError extends boolean = false>(options?: Options<TuiExecuteCommandData, ThrowOnError>) {
|
||||
return (options?.client ?? this._client).post<TuiExecuteCommandResponses, TuiExecuteCommandErrors, ThrowOnError>({
|
||||
return (options?.client ?? this.client).post<TuiExecuteCommandResponses, TuiExecuteCommandErrors, ThrowOnError>({
|
||||
url: "/tui/execute-command",
|
||||
...options,
|
||||
headers: {
|
||||
@@ -1113,10 +2072,12 @@ class Tui extends _HeyApiClient {
|
||||
}
|
||||
|
||||
/**
|
||||
* Show a toast notification in the TUI
|
||||
* Show TUI toast
|
||||
*
|
||||
* Show a toast notification in the TUI.
|
||||
*/
|
||||
public showToast<ThrowOnError extends boolean = false>(options?: Options<TuiShowToastData, ThrowOnError>) {
|
||||
return (options?.client ?? this._client).post<TuiShowToastResponses, unknown, ThrowOnError>({
|
||||
return (options?.client ?? this.client).post<TuiShowToastResponses, unknown, ThrowOnError>({
|
||||
url: "/tui/show-toast",
|
||||
...options,
|
||||
headers: {
|
||||
@@ -1127,10 +2088,12 @@ class Tui extends _HeyApiClient {
|
||||
}
|
||||
|
||||
/**
|
||||
* Publish a TUI event
|
||||
* Publish TUI event
|
||||
*
|
||||
* Publish a TUI event.
|
||||
*/
|
||||
public publish<ThrowOnError extends boolean = false>(options?: Options<TuiPublishData, ThrowOnError>) {
|
||||
return (options?.client ?? this._client).post<TuiPublishResponses, TuiPublishErrors, ThrowOnError>({
|
||||
return (options?.client ?? this.client).post<TuiPublishResponses, TuiPublishErrors, ThrowOnError>({
|
||||
url: "/tui/publish",
|
||||
...options,
|
||||
headers: {
|
||||
@@ -1139,59 +2102,164 @@ class Tui extends _HeyApiClient {
|
||||
},
|
||||
})
|
||||
}
|
||||
control = new Control({ client: this._client })
|
||||
}
|
||||
|
||||
class Event extends _HeyApiClient {
|
||||
/**
|
||||
* Get events
|
||||
* Select session
|
||||
*
|
||||
* Navigate the TUI to display the specified session.
|
||||
*/
|
||||
public subscribe<ThrowOnError extends boolean = false>(options?: Options<EventSubscribeData, ThrowOnError>) {
|
||||
return (options?.client ?? this._client).get.sse<EventSubscribeResponses, unknown, ThrowOnError>({
|
||||
url: "/event",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export class OpencodeClient extends _HeyApiClient {
|
||||
/**
|
||||
* Respond to a permission request
|
||||
*/
|
||||
public postSessionIdPermissionsPermissionId<ThrowOnError extends boolean = false>(
|
||||
options: Options<PostSessionIdPermissionsPermissionIdData, ThrowOnError>,
|
||||
) {
|
||||
return (options.client ?? this._client).post<
|
||||
PostSessionIdPermissionsPermissionIdResponses,
|
||||
PostSessionIdPermissionsPermissionIdErrors,
|
||||
ThrowOnError
|
||||
>({
|
||||
url: "/session/{id}/permissions/{permissionID}",
|
||||
public selectSession<ThrowOnError extends boolean = false>(options?: Options<TuiSelectSessionData, ThrowOnError>) {
|
||||
return (options?.client ?? this.client).post<TuiSelectSessionResponses, TuiSelectSessionErrors, ThrowOnError>({
|
||||
url: "/tui/select-session",
|
||||
...options,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
...options.headers,
|
||||
...options?.headers,
|
||||
},
|
||||
})
|
||||
}
|
||||
global = new Global({ client: this._client })
|
||||
project = new Project({ client: this._client })
|
||||
pty = new Pty({ client: this._client })
|
||||
config = new Config({ client: this._client })
|
||||
tool = new Tool({ client: this._client })
|
||||
instance = new Instance({ client: this._client })
|
||||
path = new Path({ client: this._client })
|
||||
vcs = new Vcs({ client: this._client })
|
||||
session = new Session({ client: this._client })
|
||||
command = new Command({ client: this._client })
|
||||
provider = new Provider({ client: this._client })
|
||||
find = new Find({ client: this._client })
|
||||
file = new File({ client: this._client })
|
||||
app = new App({ client: this._client })
|
||||
mcp = new Mcp({ client: this._client })
|
||||
lsp = new Lsp({ client: this._client })
|
||||
formatter = new Formatter({ client: this._client })
|
||||
tui = new Tui({ client: this._client })
|
||||
auth = new Auth({ client: this._client })
|
||||
event = new Event({ client: this._client })
|
||||
|
||||
private _control?: Control
|
||||
get control(): Control {
|
||||
return (this._control ??= new Control({ client: this.client }))
|
||||
}
|
||||
}
|
||||
|
||||
export class OpencodeClient extends HeyApiClient {
|
||||
public static readonly __registry = new HeyApiRegistry<OpencodeClient>()
|
||||
|
||||
constructor(args?: { client?: Client; key?: string }) {
|
||||
super(args)
|
||||
OpencodeClient.__registry.set(this, args?.key)
|
||||
}
|
||||
|
||||
private _auth?: Auth
|
||||
get auth(): Auth {
|
||||
return (this._auth ??= new Auth({ client: this.client }))
|
||||
}
|
||||
|
||||
private _app?: App
|
||||
get app(): App {
|
||||
return (this._app ??= new App({ client: this.client }))
|
||||
}
|
||||
|
||||
private _global?: Global
|
||||
get global(): Global {
|
||||
return (this._global ??= new Global({ client: this.client }))
|
||||
}
|
||||
|
||||
private _event?: Event
|
||||
get event(): Event {
|
||||
return (this._event ??= new Event({ client: this.client }))
|
||||
}
|
||||
|
||||
private _config?: Config2
|
||||
get config(): Config2 {
|
||||
return (this._config ??= new Config2({ client: this.client }))
|
||||
}
|
||||
|
||||
private _experimental?: Experimental
|
||||
get experimental(): Experimental {
|
||||
return (this._experimental ??= new Experimental({ client: this.client }))
|
||||
}
|
||||
|
||||
private _tool?: Tool
|
||||
get tool(): Tool {
|
||||
return (this._tool ??= new Tool({ client: this.client }))
|
||||
}
|
||||
|
||||
private _worktree?: Worktree
|
||||
get worktree(): Worktree {
|
||||
return (this._worktree ??= new Worktree({ client: this.client }))
|
||||
}
|
||||
|
||||
private _find?: Find
|
||||
get find(): Find {
|
||||
return (this._find ??= new Find({ client: this.client }))
|
||||
}
|
||||
|
||||
private _file?: File
|
||||
get file(): File {
|
||||
return (this._file ??= new File({ client: this.client }))
|
||||
}
|
||||
|
||||
private _instance?: Instance
|
||||
get instance(): Instance {
|
||||
return (this._instance ??= new Instance({ client: this.client }))
|
||||
}
|
||||
|
||||
private _path?: Path
|
||||
get path(): Path {
|
||||
return (this._path ??= new Path({ client: this.client }))
|
||||
}
|
||||
|
||||
private _vcs?: Vcs
|
||||
get vcs(): Vcs {
|
||||
return (this._vcs ??= new Vcs({ client: this.client }))
|
||||
}
|
||||
|
||||
private _command?: Command
|
||||
get command(): Command {
|
||||
return (this._command ??= new Command({ client: this.client }))
|
||||
}
|
||||
|
||||
private _lsp?: Lsp
|
||||
get lsp(): Lsp {
|
||||
return (this._lsp ??= new Lsp({ client: this.client }))
|
||||
}
|
||||
|
||||
private _formatter?: Formatter
|
||||
get formatter(): Formatter {
|
||||
return (this._formatter ??= new Formatter({ client: this.client }))
|
||||
}
|
||||
|
||||
private _mcp?: Mcp
|
||||
get mcp(): Mcp {
|
||||
return (this._mcp ??= new Mcp({ client: this.client }))
|
||||
}
|
||||
|
||||
private _project?: Project
|
||||
get project(): Project {
|
||||
return (this._project ??= new Project({ client: this.client }))
|
||||
}
|
||||
|
||||
private _pty?: Pty
|
||||
get pty(): Pty {
|
||||
return (this._pty ??= new Pty({ client: this.client }))
|
||||
}
|
||||
|
||||
private _question?: Question
|
||||
get question(): Question {
|
||||
return (this._question ??= new Question({ client: this.client }))
|
||||
}
|
||||
|
||||
private _permission?: Permission
|
||||
get permission(): Permission {
|
||||
return (this._permission ??= new Permission({ client: this.client }))
|
||||
}
|
||||
|
||||
private _provider?: Provider
|
||||
get provider(): Provider {
|
||||
return (this._provider ??= new Provider({ client: this.client }))
|
||||
}
|
||||
|
||||
private _session?: Session2
|
||||
get session(): Session2 {
|
||||
return (this._session ??= new Session2({ client: this.client }))
|
||||
}
|
||||
|
||||
private _part?: Part
|
||||
get part(): Part {
|
||||
return (this._part ??= new Part({ client: this.client }))
|
||||
}
|
||||
|
||||
private _sync?: Sync
|
||||
get sync(): Sync {
|
||||
return (this._sync ??= new Sync({ client: this.client }))
|
||||
}
|
||||
|
||||
private _tui?: Tui
|
||||
get tui(): Tui {
|
||||
return (this._tui ??= new Tui({ client: this.client }))
|
||||
}
|
||||
}
|
||||
|
||||
+5462
-2222
@@ -1,72 +1,191 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
export type EventServerInstanceDisposed = {
|
||||
type: "server.instance.disposed"
|
||||
properties: {
|
||||
directory: string
|
||||
export type ClientOptions = {
|
||||
baseUrl: `${string}://${string}` | (string & {})
|
||||
}
|
||||
|
||||
export type Event =
|
||||
| EventTuiPromptAppend
|
||||
| EventTuiCommandExecute
|
||||
| EventTuiToastShow1
|
||||
| EventTuiSessionSelect
|
||||
| EventServerConnected
|
||||
| EventGlobalDisposed
|
||||
| EventServerInstanceDisposed
|
||||
| EventFileEdited
|
||||
| EventFileWatcherUpdated
|
||||
| EventLspClientDiagnostics
|
||||
| EventLspUpdated
|
||||
| EventMessagePartDelta
|
||||
| EventPermissionAsked
|
||||
| EventPermissionReplied
|
||||
| EventSessionDiff
|
||||
| EventSessionError
|
||||
| EventQuestionAsked
|
||||
| EventQuestionReplied
|
||||
| EventQuestionRejected
|
||||
| EventTodoUpdated
|
||||
| EventSessionStatus
|
||||
| EventSessionIdle
|
||||
| EventMcpToolsChanged
|
||||
| EventMcpBrowserOpenFailed
|
||||
| EventCommandExecuted
|
||||
| EventProjectUpdated
|
||||
| EventSessionCompacted
|
||||
| EventVcsBranchUpdated
|
||||
| EventWorkspaceReady
|
||||
| EventWorkspaceFailed
|
||||
| EventWorkspaceStatus
|
||||
| EventWorktreeReady
|
||||
| EventWorktreeFailed
|
||||
| EventPtyCreated
|
||||
| EventPtyUpdated
|
||||
| EventPtyExited
|
||||
| EventPtyDeleted
|
||||
| EventInstallationUpdated
|
||||
| EventInstallationUpdateAvailable
|
||||
| EventMessageUpdated
|
||||
| EventMessageRemoved
|
||||
| EventMessagePartUpdated
|
||||
| EventMessagePartRemoved
|
||||
| EventSessionCreated
|
||||
| EventSessionUpdated
|
||||
| EventSessionDeleted
|
||||
| EventSessionNextAgentSwitched
|
||||
| EventSessionNextModelSwitched
|
||||
| EventSessionNextPrompted
|
||||
| EventSessionNextSynthetic
|
||||
| EventSessionNextShellStarted
|
||||
| EventSessionNextShellEnded
|
||||
| EventSessionNextStepStarted
|
||||
| EventSessionNextStepEnded
|
||||
| EventSessionNextStepFailed
|
||||
| EventSessionNextTextStarted
|
||||
| EventSessionNextTextDelta
|
||||
| EventSessionNextTextEnded
|
||||
| EventSessionNextReasoningStarted
|
||||
| EventSessionNextReasoningDelta
|
||||
| EventSessionNextReasoningEnded
|
||||
| EventSessionNextToolInputStarted
|
||||
| EventSessionNextToolInputDelta
|
||||
| EventSessionNextToolInputEnded
|
||||
| EventSessionNextToolCalled
|
||||
| EventSessionNextToolProgress
|
||||
| EventSessionNextToolSuccess
|
||||
| EventSessionNextToolFailed
|
||||
| EventSessionNextRetried
|
||||
| EventSessionNextCompactionStarted
|
||||
| EventSessionNextCompactionDelta
|
||||
| EventSessionNextCompactionEnded
|
||||
| EventCatalogModelUpdated
|
||||
|
||||
export type OAuth = {
|
||||
type: "oauth"
|
||||
refresh: string
|
||||
access: string
|
||||
expires: number
|
||||
accountId?: string
|
||||
enterpriseUrl?: string
|
||||
}
|
||||
|
||||
export type ApiAuth = {
|
||||
type: "api"
|
||||
key: string
|
||||
metadata?: {
|
||||
[key: string]: string
|
||||
}
|
||||
}
|
||||
|
||||
export type EventInstallationUpdated = {
|
||||
type: "installation.updated"
|
||||
export type WellKnownAuth = {
|
||||
type: "wellknown"
|
||||
key: string
|
||||
token: string
|
||||
}
|
||||
|
||||
export type Auth = OAuth | ApiAuth | WellKnownAuth
|
||||
|
||||
export type EffectHttpApiErrorBadRequest = {
|
||||
_tag: "BadRequest"
|
||||
}
|
||||
|
||||
export type EventTuiPromptAppend = {
|
||||
id: string
|
||||
type: "tui.prompt.append"
|
||||
properties: {
|
||||
version: string
|
||||
text: string
|
||||
}
|
||||
}
|
||||
|
||||
export type EventInstallationUpdateAvailable = {
|
||||
type: "installation.update-available"
|
||||
export type EventTuiCommandExecute = {
|
||||
id: string
|
||||
type: "tui.command.execute"
|
||||
properties: {
|
||||
version: string
|
||||
command:
|
||||
| "session.list"
|
||||
| "session.new"
|
||||
| "session.share"
|
||||
| "session.interrupt"
|
||||
| "session.compact"
|
||||
| "session.page.up"
|
||||
| "session.page.down"
|
||||
| "session.line.up"
|
||||
| "session.line.down"
|
||||
| "session.half.page.up"
|
||||
| "session.half.page.down"
|
||||
| "session.first"
|
||||
| "session.last"
|
||||
| "prompt.clear"
|
||||
| "prompt.submit"
|
||||
| "agent.cycle"
|
||||
| string
|
||||
}
|
||||
}
|
||||
|
||||
export type EventLspClientDiagnostics = {
|
||||
type: "lsp.client.diagnostics"
|
||||
export type EventTuiToastShow = {
|
||||
id: string
|
||||
type: "tui.toast.show"
|
||||
properties: {
|
||||
serverID: string
|
||||
path: string
|
||||
title?: string
|
||||
message: string
|
||||
variant: "info" | "success" | "warning" | "error"
|
||||
duration?: number
|
||||
}
|
||||
}
|
||||
|
||||
export type EventLspUpdated = {
|
||||
type: "lsp.updated"
|
||||
export type EventTuiSessionSelect = {
|
||||
id: string
|
||||
type: "tui.session.select"
|
||||
properties: {
|
||||
[key: string]: unknown
|
||||
/**
|
||||
* Session ID to navigate to
|
||||
*/
|
||||
sessionID: string
|
||||
}
|
||||
}
|
||||
|
||||
export type FileDiff = {
|
||||
file: string
|
||||
before: string
|
||||
after: string
|
||||
additions: number
|
||||
deletions: number
|
||||
}
|
||||
|
||||
export type UserMessage = {
|
||||
export type PermissionRequest = {
|
||||
id: string
|
||||
sessionID: string
|
||||
role: "user"
|
||||
time: {
|
||||
created: number
|
||||
permission: string
|
||||
patterns: Array<string>
|
||||
metadata: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
summary?: {
|
||||
title?: string
|
||||
body?: string
|
||||
diffs: Array<FileDiff>
|
||||
}
|
||||
agent: string
|
||||
model: {
|
||||
providerID: string
|
||||
modelID: string
|
||||
}
|
||||
system?: string
|
||||
tools?: {
|
||||
[key: string]: boolean
|
||||
always: Array<string>
|
||||
tool?: {
|
||||
messageID: string
|
||||
callID: string
|
||||
}
|
||||
}
|
||||
|
||||
export type SnapshotFileDiff = {
|
||||
file?: string
|
||||
patch?: string
|
||||
additions: number
|
||||
deletions: number
|
||||
status?: "added" | "deleted" | "modified"
|
||||
}
|
||||
|
||||
export type ProviderAuthError = {
|
||||
name: "ProviderAuthError"
|
||||
data: {
|
||||
@@ -96,6 +215,22 @@ export type MessageAbortedError = {
|
||||
}
|
||||
}
|
||||
|
||||
export type StructuredOutputError = {
|
||||
name: "StructuredOutputError"
|
||||
data: {
|
||||
message: string
|
||||
retries: number
|
||||
}
|
||||
}
|
||||
|
||||
export type ContextOverflowError = {
|
||||
name: "ContextOverflowError"
|
||||
data: {
|
||||
message: string
|
||||
responseBody?: string
|
||||
}
|
||||
}
|
||||
|
||||
export type ApiError = {
|
||||
name: "APIError"
|
||||
data: {
|
||||
@@ -106,6 +241,177 @@ export type ApiError = {
|
||||
[key: string]: string
|
||||
}
|
||||
responseBody?: string
|
||||
metadata?: {
|
||||
[key: string]: string
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export type QuestionOption = {
|
||||
/**
|
||||
* Display text (1-5 words, concise)
|
||||
*/
|
||||
label: string
|
||||
/**
|
||||
* Explanation of choice
|
||||
*/
|
||||
description: string
|
||||
}
|
||||
|
||||
export type QuestionInfo = {
|
||||
/**
|
||||
* Complete question
|
||||
*/
|
||||
question: string
|
||||
/**
|
||||
* Very short label (max 30 chars)
|
||||
*/
|
||||
header: string
|
||||
/**
|
||||
* Available choices
|
||||
*/
|
||||
options: Array<QuestionOption>
|
||||
multiple?: boolean
|
||||
custom?: boolean
|
||||
}
|
||||
|
||||
export type QuestionTool = {
|
||||
messageID: string
|
||||
callID: string
|
||||
}
|
||||
|
||||
export type QuestionRequest = {
|
||||
id: string
|
||||
sessionID: string
|
||||
/**
|
||||
* Questions to ask
|
||||
*/
|
||||
questions: Array<QuestionInfo>
|
||||
tool?: QuestionTool
|
||||
}
|
||||
|
||||
export type QuestionAnswer = Array<string>
|
||||
|
||||
export type QuestionReplied = {
|
||||
sessionID: string
|
||||
requestID: string
|
||||
answers: Array<QuestionAnswer>
|
||||
}
|
||||
|
||||
export type QuestionRejected = {
|
||||
sessionID: string
|
||||
requestID: string
|
||||
}
|
||||
|
||||
export type Todo = {
|
||||
/**
|
||||
* Brief description of the task
|
||||
*/
|
||||
content: string
|
||||
/**
|
||||
* Current status of the task: pending, in_progress, completed, cancelled
|
||||
*/
|
||||
status: string
|
||||
/**
|
||||
* Priority level of the task: high, medium, low
|
||||
*/
|
||||
priority: string
|
||||
}
|
||||
|
||||
export type SessionStatus =
|
||||
| {
|
||||
type: "idle"
|
||||
}
|
||||
| {
|
||||
type: "retry"
|
||||
attempt: number
|
||||
message: string
|
||||
action?: {
|
||||
reason: string
|
||||
provider: string
|
||||
title: string
|
||||
message: string
|
||||
label: string
|
||||
link?: string
|
||||
}
|
||||
next: number
|
||||
}
|
||||
| {
|
||||
type: "busy"
|
||||
}
|
||||
|
||||
export type Project = {
|
||||
id: string
|
||||
worktree: string
|
||||
vcs?: "git"
|
||||
name?: string
|
||||
icon?: {
|
||||
url?: string
|
||||
override?: string
|
||||
color?: string
|
||||
}
|
||||
commands?: {
|
||||
/**
|
||||
* Startup script to run when creating a new workspace (worktree)
|
||||
*/
|
||||
start?: string
|
||||
}
|
||||
time: {
|
||||
created: number
|
||||
updated: number
|
||||
initialized?: number
|
||||
}
|
||||
sandboxes: Array<string>
|
||||
}
|
||||
|
||||
export type Pty = {
|
||||
id: string
|
||||
title: string
|
||||
command: string
|
||||
args: Array<string>
|
||||
cwd: string
|
||||
status: "running" | "exited"
|
||||
pid: number
|
||||
}
|
||||
|
||||
export type OutputFormatText = {
|
||||
type: "text"
|
||||
}
|
||||
|
||||
export type JsonSchema = {
|
||||
[key: string]: unknown
|
||||
}
|
||||
|
||||
export type OutputFormatJsonSchema = {
|
||||
type: "json_schema"
|
||||
schema: JsonSchema
|
||||
retryCount?: number
|
||||
}
|
||||
|
||||
export type OutputFormat = OutputFormatText | OutputFormatJsonSchema
|
||||
|
||||
export type UserMessage = {
|
||||
id: string
|
||||
sessionID: string
|
||||
role: "user"
|
||||
time: {
|
||||
created: number
|
||||
}
|
||||
format?: OutputFormat
|
||||
summary?: {
|
||||
title?: string
|
||||
body?: string
|
||||
diffs: Array<SnapshotFileDiff>
|
||||
}
|
||||
agent: string
|
||||
model: {
|
||||
providerID: string
|
||||
modelID: string
|
||||
variant?: string
|
||||
}
|
||||
system?: string
|
||||
tools?: {
|
||||
[key: string]: boolean
|
||||
}
|
||||
}
|
||||
|
||||
@@ -117,11 +423,19 @@ export type AssistantMessage = {
|
||||
created: number
|
||||
completed?: number
|
||||
}
|
||||
error?: ProviderAuthError | UnknownError | MessageOutputLengthError | MessageAbortedError | ApiError
|
||||
error?:
|
||||
| ProviderAuthError
|
||||
| UnknownError
|
||||
| MessageOutputLengthError
|
||||
| MessageAbortedError
|
||||
| StructuredOutputError
|
||||
| ContextOverflowError
|
||||
| ApiError
|
||||
parentID: string
|
||||
modelID: string
|
||||
providerID: string
|
||||
mode: string
|
||||
agent: string
|
||||
path: {
|
||||
cwd: string
|
||||
root: string
|
||||
@@ -129,6 +443,7 @@ export type AssistantMessage = {
|
||||
summary?: boolean
|
||||
cost: number
|
||||
tokens: {
|
||||
total?: number
|
||||
input: number
|
||||
output: number
|
||||
reasoning: number
|
||||
@@ -137,26 +452,13 @@ export type AssistantMessage = {
|
||||
write: number
|
||||
}
|
||||
}
|
||||
structured?: unknown
|
||||
variant?: string
|
||||
finish?: string
|
||||
}
|
||||
|
||||
export type Message = UserMessage | AssistantMessage
|
||||
|
||||
export type EventMessageUpdated = {
|
||||
type: "message.updated"
|
||||
properties: {
|
||||
info: Message
|
||||
}
|
||||
}
|
||||
|
||||
export type EventMessageRemoved = {
|
||||
type: "message.removed"
|
||||
properties: {
|
||||
sessionID: string
|
||||
messageID: string
|
||||
}
|
||||
}
|
||||
|
||||
export type TextPart = {
|
||||
id: string
|
||||
sessionID: string
|
||||
@@ -174,6 +476,21 @@ export type TextPart = {
|
||||
}
|
||||
}
|
||||
|
||||
export type SubtaskPart = {
|
||||
id: string
|
||||
sessionID: string
|
||||
messageID: string
|
||||
type: "subtask"
|
||||
prompt: string
|
||||
description: string
|
||||
agent: string
|
||||
model?: {
|
||||
providerID: string
|
||||
modelID: string
|
||||
}
|
||||
command?: string
|
||||
}
|
||||
|
||||
export type ReasoningPart = {
|
||||
id: string
|
||||
sessionID: string
|
||||
@@ -221,7 +538,14 @@ export type SymbolSource = {
|
||||
kind: number
|
||||
}
|
||||
|
||||
export type FilePartSource = FileSource | SymbolSource
|
||||
export type ResourceSource = {
|
||||
text: FilePartSourceText
|
||||
type: "resource"
|
||||
clientName: string
|
||||
uri: string
|
||||
}
|
||||
|
||||
export type FilePartSource = FileSource | SymbolSource | ResourceSource
|
||||
|
||||
export type FilePart = {
|
||||
id: string
|
||||
@@ -321,6 +645,7 @@ export type StepFinishPart = {
|
||||
snapshot?: string
|
||||
cost: number
|
||||
tokens: {
|
||||
total?: number
|
||||
input: number
|
||||
output: number
|
||||
reasoning: number
|
||||
@@ -379,19 +704,13 @@ export type CompactionPart = {
|
||||
messageID: string
|
||||
type: "compaction"
|
||||
auto: boolean
|
||||
overflow?: boolean
|
||||
tail_start_id?: string
|
||||
}
|
||||
|
||||
export type Part =
|
||||
| TextPart
|
||||
| {
|
||||
id: string
|
||||
sessionID: string
|
||||
messageID: string
|
||||
type: "subtask"
|
||||
prompt: string
|
||||
description: string
|
||||
agent: string
|
||||
}
|
||||
| SubtaskPart
|
||||
| ReasoningPart
|
||||
| FilePart
|
||||
| ToolPart
|
||||
@@ -403,154 +722,58 @@ export type Part =
|
||||
| RetryPart
|
||||
| CompactionPart
|
||||
|
||||
export type EventMessagePartUpdated = {
|
||||
type: "message.part.updated"
|
||||
properties: {
|
||||
part: Part
|
||||
delta?: string
|
||||
}
|
||||
export type PermissionAction = "allow" | "deny" | "ask"
|
||||
|
||||
export type PermissionRule = {
|
||||
permission: string
|
||||
pattern: string
|
||||
action: PermissionAction
|
||||
}
|
||||
|
||||
export type EventMessagePartRemoved = {
|
||||
type: "message.part.removed"
|
||||
properties: {
|
||||
sessionID: string
|
||||
messageID: string
|
||||
partID: string
|
||||
}
|
||||
}
|
||||
|
||||
export type Permission = {
|
||||
id: string
|
||||
type: string
|
||||
pattern?: string | Array<string>
|
||||
sessionID: string
|
||||
messageID: string
|
||||
callID?: string
|
||||
title: string
|
||||
metadata: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
time: {
|
||||
created: number
|
||||
}
|
||||
}
|
||||
|
||||
export type EventPermissionUpdated = {
|
||||
type: "permission.updated"
|
||||
properties: Permission
|
||||
}
|
||||
|
||||
export type EventPermissionReplied = {
|
||||
type: "permission.replied"
|
||||
properties: {
|
||||
sessionID: string
|
||||
permissionID: string
|
||||
response: string
|
||||
}
|
||||
}
|
||||
|
||||
export type SessionStatus =
|
||||
| {
|
||||
type: "idle"
|
||||
}
|
||||
| {
|
||||
type: "retry"
|
||||
attempt: number
|
||||
message: string
|
||||
next: number
|
||||
}
|
||||
| {
|
||||
type: "busy"
|
||||
}
|
||||
|
||||
export type EventSessionStatus = {
|
||||
type: "session.status"
|
||||
properties: {
|
||||
sessionID: string
|
||||
status: SessionStatus
|
||||
}
|
||||
}
|
||||
|
||||
export type EventSessionIdle = {
|
||||
type: "session.idle"
|
||||
properties: {
|
||||
sessionID: string
|
||||
}
|
||||
}
|
||||
|
||||
export type EventSessionCompacted = {
|
||||
type: "session.compacted"
|
||||
properties: {
|
||||
sessionID: string
|
||||
}
|
||||
}
|
||||
|
||||
export type EventFileEdited = {
|
||||
type: "file.edited"
|
||||
properties: {
|
||||
file: string
|
||||
}
|
||||
}
|
||||
|
||||
export type Todo = {
|
||||
/**
|
||||
* Brief description of the task
|
||||
*/
|
||||
content: string
|
||||
/**
|
||||
* Current status of the task: pending, in_progress, completed, cancelled
|
||||
*/
|
||||
status: string
|
||||
/**
|
||||
* Priority level of the task: high, medium, low
|
||||
*/
|
||||
priority: string
|
||||
/**
|
||||
* Unique identifier for the todo item
|
||||
*/
|
||||
id: string
|
||||
}
|
||||
|
||||
export type EventTodoUpdated = {
|
||||
type: "todo.updated"
|
||||
properties: {
|
||||
sessionID: string
|
||||
todos: Array<Todo>
|
||||
}
|
||||
}
|
||||
|
||||
export type EventCommandExecuted = {
|
||||
type: "command.executed"
|
||||
properties: {
|
||||
name: string
|
||||
sessionID: string
|
||||
arguments: string
|
||||
messageID: string
|
||||
}
|
||||
}
|
||||
export type PermissionRuleset = Array<PermissionRule>
|
||||
|
||||
export type Session = {
|
||||
id: string
|
||||
slug: string
|
||||
projectID: string
|
||||
workspaceID?: string
|
||||
directory: string
|
||||
path?: string
|
||||
parentID?: string
|
||||
summary?: {
|
||||
additions: number
|
||||
deletions: number
|
||||
files: number
|
||||
diffs?: Array<FileDiff>
|
||||
diffs?: Array<SnapshotFileDiff>
|
||||
}
|
||||
cost?: number
|
||||
tokens?: {
|
||||
input: number
|
||||
output: number
|
||||
reasoning: number
|
||||
cache: {
|
||||
read: number
|
||||
write: number
|
||||
}
|
||||
}
|
||||
share?: {
|
||||
url: string
|
||||
}
|
||||
title: string
|
||||
agent?: string
|
||||
model?: {
|
||||
id: string
|
||||
providerID: string
|
||||
variant?: string
|
||||
}
|
||||
version: string
|
||||
time: {
|
||||
created: number
|
||||
updated: number
|
||||
compacting?: number
|
||||
archived?: number
|
||||
}
|
||||
permission?: PermissionRuleset
|
||||
revert?: {
|
||||
messageID: string
|
||||
partID?: string
|
||||
@@ -559,421 +782,196 @@ export type Session = {
|
||||
}
|
||||
}
|
||||
|
||||
export type EventSessionCreated = {
|
||||
type: "session.created"
|
||||
properties: {
|
||||
info: Session
|
||||
}
|
||||
export type Prompt = {
|
||||
text: string
|
||||
files?: Array<PromptFileAttachment>
|
||||
agents?: Array<PromptAgentAttachment>
|
||||
references?: Array<PromptReferenceAttachment>
|
||||
}
|
||||
|
||||
export type EventSessionUpdated = {
|
||||
type: "session.updated"
|
||||
properties: {
|
||||
info: Session
|
||||
}
|
||||
}
|
||||
|
||||
export type EventSessionDeleted = {
|
||||
type: "session.deleted"
|
||||
properties: {
|
||||
info: Session
|
||||
}
|
||||
}
|
||||
|
||||
export type EventSessionDiff = {
|
||||
type: "session.diff"
|
||||
properties: {
|
||||
sessionID: string
|
||||
diff: Array<FileDiff>
|
||||
}
|
||||
}
|
||||
|
||||
export type EventSessionError = {
|
||||
type: "session.error"
|
||||
properties: {
|
||||
sessionID?: string
|
||||
error?: ProviderAuthError | UnknownError | MessageOutputLengthError | MessageAbortedError | ApiError
|
||||
}
|
||||
}
|
||||
|
||||
export type EventFileWatcherUpdated = {
|
||||
type: "file.watcher.updated"
|
||||
properties: {
|
||||
file: string
|
||||
event: "add" | "change" | "unlink"
|
||||
}
|
||||
}
|
||||
|
||||
export type EventVcsBranchUpdated = {
|
||||
type: "vcs.branch.updated"
|
||||
properties: {
|
||||
branch?: string
|
||||
}
|
||||
}
|
||||
|
||||
export type EventTuiPromptAppend = {
|
||||
type: "tui.prompt.append"
|
||||
properties: {
|
||||
text: string
|
||||
}
|
||||
}
|
||||
|
||||
export type EventTuiCommandExecute = {
|
||||
type: "tui.command.execute"
|
||||
properties: {
|
||||
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"
|
||||
)
|
||||
| string
|
||||
}
|
||||
}
|
||||
|
||||
export type EventTuiToastShow = {
|
||||
type: "tui.toast.show"
|
||||
properties: {
|
||||
title?: string
|
||||
message: string
|
||||
variant: "info" | "success" | "warning" | "error"
|
||||
/**
|
||||
* Duration in milliseconds
|
||||
*/
|
||||
duration?: number
|
||||
}
|
||||
}
|
||||
|
||||
export type Pty = {
|
||||
id: string
|
||||
title: string
|
||||
command: string
|
||||
args: Array<string>
|
||||
cwd: string
|
||||
status: "running" | "exited"
|
||||
pid: number
|
||||
}
|
||||
|
||||
export type EventPtyCreated = {
|
||||
type: "pty.created"
|
||||
properties: {
|
||||
info: Pty
|
||||
}
|
||||
}
|
||||
|
||||
export type EventPtyUpdated = {
|
||||
type: "pty.updated"
|
||||
properties: {
|
||||
info: Pty
|
||||
}
|
||||
}
|
||||
|
||||
export type EventPtyExited = {
|
||||
type: "pty.exited"
|
||||
properties: {
|
||||
id: string
|
||||
exitCode: number
|
||||
}
|
||||
}
|
||||
|
||||
export type EventPtyDeleted = {
|
||||
type: "pty.deleted"
|
||||
properties: {
|
||||
id: string
|
||||
}
|
||||
}
|
||||
|
||||
export type EventServerConnected = {
|
||||
type: "server.connected"
|
||||
properties: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
}
|
||||
|
||||
export type Event =
|
||||
| EventServerInstanceDisposed
|
||||
| EventInstallationUpdated
|
||||
| EventInstallationUpdateAvailable
|
||||
| EventLspClientDiagnostics
|
||||
| EventLspUpdated
|
||||
| EventMessageUpdated
|
||||
| EventMessageRemoved
|
||||
| EventMessagePartUpdated
|
||||
| EventMessagePartRemoved
|
||||
| EventPermissionUpdated
|
||||
| EventPermissionReplied
|
||||
| EventSessionStatus
|
||||
| EventSessionIdle
|
||||
| EventSessionCompacted
|
||||
| EventFileEdited
|
||||
| EventTodoUpdated
|
||||
| EventCommandExecuted
|
||||
| EventSessionCreated
|
||||
| EventSessionUpdated
|
||||
| EventSessionDeleted
|
||||
| EventSessionDiff
|
||||
| EventSessionError
|
||||
| EventFileWatcherUpdated
|
||||
| EventVcsBranchUpdated
|
||||
| EventTuiPromptAppend
|
||||
| EventTuiCommandExecute
|
||||
| EventTuiToastShow
|
||||
| EventPtyCreated
|
||||
| EventPtyUpdated
|
||||
| EventPtyExited
|
||||
| EventPtyDeleted
|
||||
| EventServerConnected
|
||||
|
||||
export type GlobalEvent = {
|
||||
directory: string
|
||||
payload: Event
|
||||
}
|
||||
|
||||
export type Project = {
|
||||
id: string
|
||||
worktree: string
|
||||
vcsDir?: string
|
||||
vcs?: "git"
|
||||
time: {
|
||||
created: number
|
||||
initialized?: number
|
||||
}
|
||||
}
|
||||
|
||||
export type BadRequestError = {
|
||||
name: "BadRequest"
|
||||
data: {
|
||||
message: string
|
||||
kind?: "Params" | "Headers" | "Query" | "Body" | "Payload"
|
||||
}
|
||||
}
|
||||
|
||||
export type NotFoundError = {
|
||||
name: "NotFoundError"
|
||||
data: {
|
||||
message: string
|
||||
}
|
||||
project?: string
|
||||
workspace?: string
|
||||
payload:
|
||||
| EventTuiPromptAppend
|
||||
| EventTuiCommandExecute
|
||||
| EventTuiToastShow
|
||||
| EventTuiSessionSelect
|
||||
| EventServerConnected
|
||||
| EventGlobalDisposed
|
||||
| EventServerInstanceDisposed
|
||||
| EventFileEdited
|
||||
| EventFileWatcherUpdated
|
||||
| EventLspClientDiagnostics
|
||||
| EventLspUpdated
|
||||
| EventMessagePartDelta
|
||||
| EventPermissionAsked
|
||||
| EventPermissionReplied
|
||||
| EventSessionDiff
|
||||
| EventSessionError
|
||||
| EventQuestionAsked
|
||||
| EventQuestionReplied
|
||||
| EventQuestionRejected
|
||||
| EventTodoUpdated
|
||||
| EventSessionStatus
|
||||
| EventSessionIdle
|
||||
| EventMcpToolsChanged
|
||||
| EventMcpBrowserOpenFailed
|
||||
| EventCommandExecuted
|
||||
| EventProjectUpdated
|
||||
| EventSessionCompacted
|
||||
| EventVcsBranchUpdated
|
||||
| EventWorkspaceReady
|
||||
| EventWorkspaceFailed
|
||||
| EventWorkspaceStatus
|
||||
| EventWorktreeReady
|
||||
| EventWorktreeFailed
|
||||
| EventPtyCreated
|
||||
| EventPtyUpdated
|
||||
| EventPtyExited
|
||||
| EventPtyDeleted
|
||||
| EventInstallationUpdated
|
||||
| EventInstallationUpdateAvailable
|
||||
| EventMessageUpdated
|
||||
| EventMessageRemoved
|
||||
| EventMessagePartUpdated
|
||||
| EventMessagePartRemoved
|
||||
| EventSessionCreated
|
||||
| EventSessionUpdated
|
||||
| EventSessionDeleted
|
||||
| EventSessionNextAgentSwitched
|
||||
| EventSessionNextModelSwitched
|
||||
| EventSessionNextPrompted
|
||||
| EventSessionNextSynthetic
|
||||
| EventSessionNextShellStarted
|
||||
| EventSessionNextShellEnded
|
||||
| EventSessionNextStepStarted
|
||||
| EventSessionNextStepEnded
|
||||
| EventSessionNextStepFailed
|
||||
| EventSessionNextTextStarted
|
||||
| EventSessionNextTextDelta
|
||||
| EventSessionNextTextEnded
|
||||
| EventSessionNextReasoningStarted
|
||||
| EventSessionNextReasoningDelta
|
||||
| EventSessionNextReasoningEnded
|
||||
| EventSessionNextToolInputStarted
|
||||
| EventSessionNextToolInputDelta
|
||||
| EventSessionNextToolInputEnded
|
||||
| EventSessionNextToolCalled
|
||||
| EventSessionNextToolProgress
|
||||
| EventSessionNextToolSuccess
|
||||
| EventSessionNextToolFailed
|
||||
| EventSessionNextRetried
|
||||
| EventSessionNextCompactionStarted
|
||||
| EventSessionNextCompactionDelta
|
||||
| EventSessionNextCompactionEnded
|
||||
| EventCatalogModelUpdated
|
||||
| SyncEventMessageUpdated
|
||||
| SyncEventMessageRemoved
|
||||
| SyncEventMessagePartUpdated
|
||||
| SyncEventMessagePartRemoved
|
||||
| SyncEventSessionCreated
|
||||
| SyncEventSessionUpdated
|
||||
| SyncEventSessionDeleted
|
||||
| SyncEventSessionNextAgentSwitched
|
||||
| SyncEventSessionNextModelSwitched
|
||||
| SyncEventSessionNextPrompted
|
||||
| SyncEventSessionNextSynthetic
|
||||
| SyncEventSessionNextShellStarted
|
||||
| SyncEventSessionNextShellEnded
|
||||
| SyncEventSessionNextStepStarted
|
||||
| SyncEventSessionNextStepEnded
|
||||
| SyncEventSessionNextStepFailed
|
||||
| SyncEventSessionNextTextStarted
|
||||
| SyncEventSessionNextTextDelta
|
||||
| SyncEventSessionNextTextEnded
|
||||
| SyncEventSessionNextReasoningStarted
|
||||
| SyncEventSessionNextReasoningDelta
|
||||
| SyncEventSessionNextReasoningEnded
|
||||
| SyncEventSessionNextToolInputStarted
|
||||
| SyncEventSessionNextToolInputDelta
|
||||
| SyncEventSessionNextToolInputEnded
|
||||
| SyncEventSessionNextToolCalled
|
||||
| SyncEventSessionNextToolProgress
|
||||
| SyncEventSessionNextToolSuccess
|
||||
| SyncEventSessionNextToolFailed
|
||||
| SyncEventSessionNextRetried
|
||||
| SyncEventSessionNextCompactionStarted
|
||||
| SyncEventSessionNextCompactionDelta
|
||||
| SyncEventSessionNextCompactionEnded
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom keybind configurations
|
||||
* Log level
|
||||
*/
|
||||
export type KeybindsConfig = {
|
||||
/**
|
||||
* Leader key for keybind combinations
|
||||
*/
|
||||
leader?: string
|
||||
/**
|
||||
* Exit the application
|
||||
*/
|
||||
app_exit?: string
|
||||
/**
|
||||
* Open external editor
|
||||
*/
|
||||
editor_open?: string
|
||||
/**
|
||||
* List available themes
|
||||
*/
|
||||
theme_list?: string
|
||||
/**
|
||||
* Toggle sidebar
|
||||
*/
|
||||
sidebar_toggle?: string
|
||||
/**
|
||||
* Toggle session scrollbar
|
||||
*/
|
||||
scrollbar_toggle?: string
|
||||
/**
|
||||
* Toggle username visibility
|
||||
*/
|
||||
username_toggle?: string
|
||||
/**
|
||||
* View status
|
||||
*/
|
||||
status_view?: string
|
||||
/**
|
||||
* Export session to editor
|
||||
*/
|
||||
session_export?: string
|
||||
/**
|
||||
* Create a new session
|
||||
*/
|
||||
session_new?: string
|
||||
/**
|
||||
* List all sessions
|
||||
*/
|
||||
session_list?: string
|
||||
/**
|
||||
* Show session timeline
|
||||
*/
|
||||
session_timeline?: string
|
||||
/**
|
||||
* Share current session
|
||||
*/
|
||||
session_share?: string
|
||||
/**
|
||||
* Unshare current session
|
||||
*/
|
||||
session_unshare?: string
|
||||
/**
|
||||
* Interrupt current session
|
||||
*/
|
||||
session_interrupt?: string
|
||||
/**
|
||||
* Compact the session
|
||||
*/
|
||||
session_compact?: string
|
||||
/**
|
||||
* Scroll messages up by one page
|
||||
*/
|
||||
messages_page_up?: string
|
||||
/**
|
||||
* Scroll messages down by one page
|
||||
*/
|
||||
messages_page_down?: string
|
||||
/**
|
||||
* Scroll messages up by one line
|
||||
*/
|
||||
messages_line_up?: string
|
||||
/**
|
||||
* Scroll messages down by one line
|
||||
*/
|
||||
messages_line_down?: string
|
||||
/**
|
||||
* Scroll messages up by half page
|
||||
*/
|
||||
messages_half_page_up?: string
|
||||
/**
|
||||
* Scroll messages down by half page
|
||||
*/
|
||||
messages_half_page_down?: string
|
||||
/**
|
||||
* Navigate to first message
|
||||
*/
|
||||
messages_first?: string
|
||||
/**
|
||||
* Navigate to last message
|
||||
*/
|
||||
messages_last?: string
|
||||
/**
|
||||
* Navigate to next message
|
||||
*/
|
||||
messages_next?: string
|
||||
/**
|
||||
* Navigate to previous message
|
||||
*/
|
||||
messages_previous?: string
|
||||
/**
|
||||
* Navigate to last user message
|
||||
*/
|
||||
messages_last_user?: string
|
||||
/**
|
||||
* Copy message
|
||||
*/
|
||||
messages_copy?: string
|
||||
/**
|
||||
* Undo message
|
||||
*/
|
||||
messages_undo?: string
|
||||
/**
|
||||
* Redo message
|
||||
*/
|
||||
messages_redo?: string
|
||||
/**
|
||||
* Toggle code block concealment in messages
|
||||
*/
|
||||
messages_toggle_conceal?: string
|
||||
/**
|
||||
* Toggle tool details visibility
|
||||
*/
|
||||
tool_details?: string
|
||||
/**
|
||||
* List available models
|
||||
*/
|
||||
model_list?: string
|
||||
/**
|
||||
* Next recently used model
|
||||
*/
|
||||
model_cycle_recent?: string
|
||||
/**
|
||||
* Previous recently used model
|
||||
*/
|
||||
model_cycle_recent_reverse?: string
|
||||
/**
|
||||
* List available commands
|
||||
*/
|
||||
command_list?: string
|
||||
/**
|
||||
* List agents
|
||||
*/
|
||||
agent_list?: string
|
||||
/**
|
||||
* Next agent
|
||||
*/
|
||||
agent_cycle?: string
|
||||
/**
|
||||
* Previous agent
|
||||
*/
|
||||
agent_cycle_reverse?: string
|
||||
/**
|
||||
* Clear input field
|
||||
*/
|
||||
input_clear?: string
|
||||
/**
|
||||
* Forward delete
|
||||
*/
|
||||
input_forward_delete?: string
|
||||
/**
|
||||
* Paste from clipboard
|
||||
*/
|
||||
input_paste?: string
|
||||
/**
|
||||
* Submit input
|
||||
*/
|
||||
input_submit?: string
|
||||
/**
|
||||
* Insert newline in input
|
||||
*/
|
||||
input_newline?: string
|
||||
/**
|
||||
* Previous history item
|
||||
*/
|
||||
history_previous?: string
|
||||
/**
|
||||
* Next history item
|
||||
*/
|
||||
history_next?: string
|
||||
/**
|
||||
* Next child session
|
||||
*/
|
||||
session_child_cycle?: string
|
||||
/**
|
||||
* Previous child session
|
||||
*/
|
||||
session_child_cycle_reverse?: string
|
||||
/**
|
||||
* Suspend terminal
|
||||
*/
|
||||
terminal_suspend?: string
|
||||
/**
|
||||
* Toggle terminal title
|
||||
*/
|
||||
terminal_title_toggle?: string
|
||||
export type LogLevel = "DEBUG" | "INFO" | "WARN" | "ERROR"
|
||||
|
||||
/**
|
||||
* Server configuration for opencode serve and web commands
|
||||
*/
|
||||
export type ServerConfig = {
|
||||
port?: number
|
||||
hostname?: string
|
||||
mdns?: boolean
|
||||
mdnsDomain?: string
|
||||
cors?: Array<string>
|
||||
}
|
||||
|
||||
export type ReferenceConfigEntry =
|
||||
| string
|
||||
| {
|
||||
/**
|
||||
* Git repository URL, host/path reference, or GitHub owner/repo shorthand
|
||||
*/
|
||||
repository: string
|
||||
branch?: string
|
||||
}
|
||||
| {
|
||||
/**
|
||||
* Absolute path, ~/ path, or workspace-relative path to a local reference directory
|
||||
*/
|
||||
path: string
|
||||
}
|
||||
|
||||
export type ReferenceConfig = {
|
||||
[key: string]: ReferenceConfigEntry
|
||||
}
|
||||
|
||||
export type PermissionActionConfig = "ask" | "allow" | "deny"
|
||||
|
||||
export type PermissionObjectConfig = {
|
||||
[key: string]: PermissionActionConfig
|
||||
}
|
||||
|
||||
export type PermissionRuleConfig = PermissionActionConfig | PermissionObjectConfig
|
||||
|
||||
export type PermissionConfig =
|
||||
| PermissionActionConfig
|
||||
| {
|
||||
read?: PermissionRuleConfig
|
||||
edit?: PermissionRuleConfig
|
||||
glob?: PermissionRuleConfig
|
||||
grep?: PermissionRuleConfig
|
||||
list?: PermissionRuleConfig
|
||||
bash?: PermissionRuleConfig
|
||||
task?: PermissionRuleConfig
|
||||
external_directory?: PermissionRuleConfig
|
||||
todowrite?: PermissionActionConfig
|
||||
question?: PermissionActionConfig
|
||||
webfetch?: PermissionActionConfig
|
||||
websearch?: PermissionActionConfig
|
||||
repo_clone?: PermissionRuleConfig
|
||||
repo_overview?: PermissionRuleConfig
|
||||
lsp?: PermissionRuleConfig
|
||||
doom_loop?: PermissionActionConfig
|
||||
skill?: PermissionRuleConfig
|
||||
[key: string]: PermissionRuleConfig | PermissionActionConfig | undefined
|
||||
}
|
||||
|
||||
export type AgentConfig = {
|
||||
model?: string
|
||||
variant?: string
|
||||
temperature?: number
|
||||
top_p?: number
|
||||
prompt?: string
|
||||
@@ -981,30 +979,19 @@ export type AgentConfig = {
|
||||
[key: string]: boolean
|
||||
}
|
||||
disable?: boolean
|
||||
/**
|
||||
* Description of when to use the agent
|
||||
*/
|
||||
description?: string
|
||||
mode?: "subagent" | "primary" | "all"
|
||||
/**
|
||||
* Hex color code for the agent (e.g., #FF5733)
|
||||
*/
|
||||
color?: string
|
||||
/**
|
||||
* Maximum number of agentic iterations before forcing text-only response
|
||||
*/
|
||||
maxSteps?: number
|
||||
permission?: {
|
||||
edit?: "ask" | "allow" | "deny"
|
||||
bash?:
|
||||
| ("ask" | "allow" | "deny")
|
||||
| {
|
||||
[key: string]: "ask" | "allow" | "deny"
|
||||
}
|
||||
webfetch?: "ask" | "allow" | "deny"
|
||||
doom_loop?: "ask" | "allow" | "deny"
|
||||
external_directory?: "ask" | "allow" | "deny"
|
||||
hidden?: boolean
|
||||
options?: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
/**
|
||||
* Hex color code (e.g., #FF5733) or theme color (e.g., primary)
|
||||
*/
|
||||
color?: string | "primary" | "secondary" | "accent" | "success" | "warning" | "error" | "info"
|
||||
steps?: number
|
||||
maxSteps?: number
|
||||
permission?: PermissionConfig
|
||||
[key: string]:
|
||||
| unknown
|
||||
| string
|
||||
@@ -1013,19 +1000,22 @@ export type AgentConfig = {
|
||||
[key: string]: boolean
|
||||
}
|
||||
| boolean
|
||||
| ("subagent" | "primary" | "all")
|
||||
| number
|
||||
| "subagent"
|
||||
| "primary"
|
||||
| "all"
|
||||
| {
|
||||
edit?: "ask" | "allow" | "deny"
|
||||
bash?:
|
||||
| ("ask" | "allow" | "deny")
|
||||
| {
|
||||
[key: string]: "ask" | "allow" | "deny"
|
||||
}
|
||||
webfetch?: "ask" | "allow" | "deny"
|
||||
doom_loop?: "ask" | "allow" | "deny"
|
||||
external_directory?: "ask" | "allow" | "deny"
|
||||
[key: string]: unknown
|
||||
}
|
||||
| string
|
||||
| "primary"
|
||||
| "secondary"
|
||||
| "accent"
|
||||
| "success"
|
||||
| "warning"
|
||||
| "error"
|
||||
| "info"
|
||||
| number
|
||||
| PermissionConfig
|
||||
| undefined
|
||||
}
|
||||
|
||||
@@ -1035,15 +1025,35 @@ export type ProviderConfig = {
|
||||
env?: Array<string>
|
||||
id?: string
|
||||
npm?: string
|
||||
whitelist?: Array<string>
|
||||
blacklist?: Array<string>
|
||||
options?: {
|
||||
apiKey?: string
|
||||
baseURL?: string
|
||||
enterpriseUrl?: string
|
||||
setCacheKey?: boolean
|
||||
/**
|
||||
* Timeout in milliseconds for requests to this provider. Default is 300000 (5 minutes). Set to false to disable timeout.
|
||||
*/
|
||||
timeout?: number | false
|
||||
chunkTimeout?: number
|
||||
[key: string]: unknown | string | boolean | number | false | number | undefined
|
||||
}
|
||||
models?: {
|
||||
[key: string]: {
|
||||
id?: string
|
||||
name?: string
|
||||
family?: string
|
||||
release_date?: string
|
||||
attachment?: boolean
|
||||
reasoning?: boolean
|
||||
temperature?: boolean
|
||||
tool_call?: boolean
|
||||
interleaved?:
|
||||
| true
|
||||
| {
|
||||
field: "reasoning_content" | "reasoning_details"
|
||||
}
|
||||
cost?: {
|
||||
input: number
|
||||
output: number
|
||||
@@ -1058,6 +1068,7 @@ export type ProviderConfig = {
|
||||
}
|
||||
limit?: {
|
||||
context: number
|
||||
input?: number
|
||||
output: number
|
||||
}
|
||||
modalities?: {
|
||||
@@ -1066,36 +1077,27 @@ export type ProviderConfig = {
|
||||
}
|
||||
experimental?: boolean
|
||||
status?: "alpha" | "beta" | "deprecated" | "active"
|
||||
provider?: {
|
||||
npm?: string
|
||||
api?: string
|
||||
}
|
||||
options?: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
headers?: {
|
||||
[key: string]: string
|
||||
}
|
||||
provider?: {
|
||||
npm: string
|
||||
/**
|
||||
* Variant-specific configuration
|
||||
*/
|
||||
variants?: {
|
||||
[key: string]: {
|
||||
disabled?: boolean
|
||||
[key: string]: unknown | boolean | undefined
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
whitelist?: Array<string>
|
||||
blacklist?: Array<string>
|
||||
options?: {
|
||||
apiKey?: string
|
||||
baseURL?: string
|
||||
/**
|
||||
* GitHub Enterprise URL for copilot authentication
|
||||
*/
|
||||
enterpriseUrl?: string
|
||||
/**
|
||||
* Enable promptCacheKey for this provider (default false)
|
||||
*/
|
||||
setCacheKey?: boolean
|
||||
/**
|
||||
* Timeout in milliseconds for requests to this provider. Default is 300000 (5 minutes). Set to false to disable timeout.
|
||||
*/
|
||||
timeout?: number | false
|
||||
[key: string]: unknown | string | boolean | (number | false) | undefined
|
||||
}
|
||||
}
|
||||
|
||||
export type McpLocalConfig = {
|
||||
@@ -1107,35 +1109,18 @@ export type McpLocalConfig = {
|
||||
* Command and arguments to run the MCP server
|
||||
*/
|
||||
command: Array<string>
|
||||
/**
|
||||
* Environment variables to set when running the MCP server
|
||||
*/
|
||||
environment?: {
|
||||
[key: string]: string
|
||||
}
|
||||
/**
|
||||
* Enable or disable the MCP server on startup
|
||||
*/
|
||||
enabled?: boolean
|
||||
/**
|
||||
* Timeout in ms for fetching tools from the MCP server. Defaults to 5000 (5 seconds) if not specified.
|
||||
*/
|
||||
timeout?: number
|
||||
}
|
||||
|
||||
export type McpOAuthConfig = {
|
||||
/**
|
||||
* OAuth client ID. If not provided, dynamic client registration (RFC 7591) will be attempted.
|
||||
*/
|
||||
clientId?: string
|
||||
/**
|
||||
* OAuth client secret (if required by the authorization server)
|
||||
*/
|
||||
clientSecret?: string
|
||||
/**
|
||||
* OAuth scopes to request during authorization
|
||||
*/
|
||||
scope?: string
|
||||
redirectUri?: string
|
||||
}
|
||||
|
||||
export type McpRemoteConfig = {
|
||||
@@ -1147,13 +1132,7 @@ export type McpRemoteConfig = {
|
||||
* URL of the remote MCP server
|
||||
*/
|
||||
url: string
|
||||
/**
|
||||
* Enable or disable the MCP server on startup
|
||||
*/
|
||||
enabled?: boolean
|
||||
/**
|
||||
* Headers to send with the request
|
||||
*/
|
||||
headers?: {
|
||||
[key: string]: string
|
||||
}
|
||||
@@ -1161,9 +1140,6 @@ export type McpRemoteConfig = {
|
||||
* OAuth authentication configuration for the MCP server. Set to false to disable OAuth auto-detection.
|
||||
*/
|
||||
oauth?: McpOAuthConfig | false
|
||||
/**
|
||||
* Timeout in ms for fetching tools from the MCP server. Defaults to 5000 (5 seconds) if not specified.
|
||||
*/
|
||||
timeout?: number
|
||||
}
|
||||
|
||||
@@ -1172,45 +1148,22 @@ export type McpRemoteConfig = {
|
||||
*/
|
||||
export type LayoutConfig = "auto" | "stretch"
|
||||
|
||||
export type ImageAttachmentConfig = {
|
||||
auto_resize?: boolean
|
||||
max_width?: number
|
||||
max_height?: number
|
||||
max_base64_bytes?: number
|
||||
}
|
||||
|
||||
export type AttachmentConfig = {
|
||||
image?: ImageAttachmentConfig
|
||||
}
|
||||
|
||||
export type Config = {
|
||||
/**
|
||||
* JSON schema reference for configuration validation
|
||||
*/
|
||||
$schema?: string
|
||||
/**
|
||||
* Theme name to use for the interface
|
||||
*/
|
||||
theme?: string
|
||||
keybinds?: KeybindsConfig
|
||||
/**
|
||||
* Log level
|
||||
*/
|
||||
logLevel?: "DEBUG" | "INFO" | "WARN" | "ERROR"
|
||||
/**
|
||||
* TUI specific settings
|
||||
*/
|
||||
tui?: {
|
||||
/**
|
||||
* TUI scroll speed
|
||||
*/
|
||||
scroll_speed?: number
|
||||
/**
|
||||
* Scroll acceleration settings
|
||||
*/
|
||||
scroll_acceleration?: {
|
||||
/**
|
||||
* Enable scroll acceleration
|
||||
*/
|
||||
enabled: boolean
|
||||
}
|
||||
/**
|
||||
* Control diff rendering style: 'auto' adapts to terminal width, 'stacked' always shows single column
|
||||
*/
|
||||
diff_style?: "auto" | "stacked"
|
||||
}
|
||||
/**
|
||||
* Command configuration, see https://opencode.ai/docs/commands
|
||||
*/
|
||||
shell?: string
|
||||
logLevel?: LogLevel
|
||||
server?: ServerConfig
|
||||
command?: {
|
||||
[key: string]: {
|
||||
template: string
|
||||
@@ -1220,75 +1173,68 @@ export type Config = {
|
||||
subtask?: boolean
|
||||
}
|
||||
}
|
||||
skills?: {
|
||||
paths?: Array<string>
|
||||
urls?: Array<string>
|
||||
}
|
||||
reference?: ReferenceConfig
|
||||
watcher?: {
|
||||
ignore?: Array<string>
|
||||
}
|
||||
plugin?: Array<string>
|
||||
snapshot?: boolean
|
||||
/**
|
||||
* Control sharing behavior:'manual' allows manual sharing via commands, 'auto' enables automatic sharing, 'disabled' disables all sharing
|
||||
*/
|
||||
plugin?: Array<
|
||||
| string
|
||||
| [
|
||||
string,
|
||||
{
|
||||
[key: string]: unknown
|
||||
},
|
||||
]
|
||||
>
|
||||
share?: "manual" | "auto" | "disabled"
|
||||
/**
|
||||
* @deprecated Use 'share' field instead. Share newly created sessions automatically
|
||||
*/
|
||||
autoshare?: boolean
|
||||
/**
|
||||
* Automatically update to the latest version. Set to true to auto-update, false to disable, or 'notify' to show update notifications
|
||||
*/
|
||||
autoupdate?: boolean | "notify"
|
||||
/**
|
||||
* Disable providers that are loaded automatically
|
||||
*/
|
||||
disabled_providers?: Array<string>
|
||||
/**
|
||||
* When set, ONLY these providers will be enabled. All other providers will be ignored
|
||||
*/
|
||||
enabled_providers?: Array<string>
|
||||
/**
|
||||
* Model to use in the format of provider/model, eg anthropic/claude-2
|
||||
*/
|
||||
model?: string
|
||||
/**
|
||||
* Small model to use for tasks like title generation in the format of provider/model
|
||||
*/
|
||||
small_model?: string
|
||||
/**
|
||||
* Custom username to display in conversations instead of system username
|
||||
*/
|
||||
default_agent?: string
|
||||
username?: string
|
||||
/**
|
||||
* @deprecated Use `agent` field instead.
|
||||
*/
|
||||
mode?: {
|
||||
build?: AgentConfig
|
||||
plan?: AgentConfig
|
||||
[key: string]: AgentConfig | undefined
|
||||
}
|
||||
/**
|
||||
* Agent configuration, see https://opencode.ai/docs/agent
|
||||
*/
|
||||
agent?: {
|
||||
plan?: AgentConfig
|
||||
build?: AgentConfig
|
||||
general?: AgentConfig
|
||||
explore?: AgentConfig
|
||||
scout?: AgentConfig
|
||||
title?: AgentConfig
|
||||
summary?: AgentConfig
|
||||
compaction?: AgentConfig
|
||||
[key: string]: AgentConfig | undefined
|
||||
}
|
||||
/**
|
||||
* Custom provider configurations and model overrides
|
||||
*/
|
||||
provider?: {
|
||||
[key: string]: ProviderConfig
|
||||
}
|
||||
/**
|
||||
* MCP (Model Context Protocol) server configurations
|
||||
*/
|
||||
mcp?: {
|
||||
[key: string]: McpLocalConfig | McpRemoteConfig
|
||||
[key: string]:
|
||||
| McpLocalConfig
|
||||
| McpRemoteConfig
|
||||
| {
|
||||
enabled: boolean
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Enable or configure formatters. Omit or set to false to disable, true to enable built-ins, or an object to enable built-ins with overrides.
|
||||
*/
|
||||
formatter?:
|
||||
| false
|
||||
| boolean
|
||||
| {
|
||||
[key: string]: {
|
||||
disabled?: boolean
|
||||
@@ -1299,8 +1245,11 @@ export type Config = {
|
||||
extensions?: Array<string>
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Enable or configure LSP servers. Omit or set to false to disable, true to enable built-ins, or an object to enable built-ins with overrides.
|
||||
*/
|
||||
lsp?:
|
||||
| false
|
||||
| boolean
|
||||
| {
|
||||
[key: string]:
|
||||
| {
|
||||
@@ -1318,141 +1267,37 @@ export type Config = {
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Additional instruction files or patterns to include
|
||||
*/
|
||||
instructions?: Array<string>
|
||||
layout?: LayoutConfig
|
||||
permission?: {
|
||||
edit?: "ask" | "allow" | "deny"
|
||||
bash?:
|
||||
| ("ask" | "allow" | "deny")
|
||||
| {
|
||||
[key: string]: "ask" | "allow" | "deny"
|
||||
}
|
||||
webfetch?: "ask" | "allow" | "deny"
|
||||
doom_loop?: "ask" | "allow" | "deny"
|
||||
external_directory?: "ask" | "allow" | "deny"
|
||||
}
|
||||
permission?: PermissionConfig
|
||||
tools?: {
|
||||
[key: string]: boolean
|
||||
}
|
||||
attachment?: AttachmentConfig
|
||||
enterprise?: {
|
||||
/**
|
||||
* Enterprise URL
|
||||
*/
|
||||
url?: string
|
||||
}
|
||||
tool_output?: {
|
||||
max_lines?: number
|
||||
max_bytes?: number
|
||||
}
|
||||
compaction?: {
|
||||
auto?: boolean
|
||||
prune?: boolean
|
||||
tail_turns?: number
|
||||
preserve_recent_tokens?: number
|
||||
reserved?: number
|
||||
}
|
||||
experimental?: {
|
||||
hook?: {
|
||||
file_edited?: {
|
||||
[key: string]: Array<{
|
||||
command: Array<string>
|
||||
environment?: {
|
||||
[key: string]: string
|
||||
}
|
||||
}>
|
||||
}
|
||||
session_completed?: Array<{
|
||||
command: Array<string>
|
||||
environment?: {
|
||||
[key: string]: string
|
||||
}
|
||||
}>
|
||||
}
|
||||
/**
|
||||
* Number of retries for chat completions on failure
|
||||
*/
|
||||
chatMaxRetries?: number
|
||||
disable_paste_summary?: boolean
|
||||
/**
|
||||
* Enable the batch tool
|
||||
*/
|
||||
batch_tool?: boolean
|
||||
/**
|
||||
* Enable OpenTelemetry spans for AI SDK calls (using the 'experimental_telemetry' flag)
|
||||
*/
|
||||
openTelemetry?: boolean
|
||||
/**
|
||||
* Tools that should only be available to primary agents.
|
||||
*/
|
||||
primary_tools?: Array<string>
|
||||
continue_loop_on_deny?: boolean
|
||||
mcp_timeout?: number
|
||||
}
|
||||
}
|
||||
|
||||
export type ToolIds = Array<string>
|
||||
|
||||
export type ToolListItem = {
|
||||
id: string
|
||||
description: string
|
||||
parameters: unknown
|
||||
}
|
||||
|
||||
export type ToolList = Array<ToolListItem>
|
||||
|
||||
export type Path = {
|
||||
state: string
|
||||
config: string
|
||||
worktree: string
|
||||
directory: string
|
||||
}
|
||||
|
||||
export type VcsInfo = {
|
||||
branch: string
|
||||
}
|
||||
|
||||
export type TextPartInput = {
|
||||
id?: string
|
||||
type: "text"
|
||||
text: string
|
||||
synthetic?: boolean
|
||||
ignored?: boolean
|
||||
time?: {
|
||||
start: number
|
||||
end?: number
|
||||
}
|
||||
metadata?: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
}
|
||||
|
||||
export type FilePartInput = {
|
||||
id?: string
|
||||
type: "file"
|
||||
mime: string
|
||||
filename?: string
|
||||
url: string
|
||||
source?: FilePartSource
|
||||
}
|
||||
|
||||
export type AgentPartInput = {
|
||||
id?: string
|
||||
type: "agent"
|
||||
name: string
|
||||
source?: {
|
||||
value: string
|
||||
start: number
|
||||
end: number
|
||||
}
|
||||
}
|
||||
|
||||
export type SubtaskPartInput = {
|
||||
id?: string
|
||||
type: "subtask"
|
||||
prompt: string
|
||||
description: string
|
||||
agent: string
|
||||
}
|
||||
|
||||
export type Command = {
|
||||
name: string
|
||||
description?: string
|
||||
agent?: string
|
||||
model?: string
|
||||
template: string
|
||||
subtask?: boolean
|
||||
}
|
||||
|
||||
export type Model = {
|
||||
id: string
|
||||
providerID: string
|
||||
@@ -1462,6 +1307,7 @@ export type Model = {
|
||||
npm: string
|
||||
}
|
||||
name: string
|
||||
family?: string
|
||||
capabilities: {
|
||||
temperature: boolean
|
||||
reasoning: boolean
|
||||
@@ -1481,6 +1327,11 @@ export type Model = {
|
||||
video: boolean
|
||||
pdf: boolean
|
||||
}
|
||||
interleaved:
|
||||
| boolean
|
||||
| {
|
||||
field: "reasoning_content" | "reasoning_details"
|
||||
}
|
||||
}
|
||||
cost: {
|
||||
input: number
|
||||
@@ -1489,6 +1340,18 @@ export type Model = {
|
||||
read: number
|
||||
write: number
|
||||
}
|
||||
tiers?: Array<{
|
||||
input: number
|
||||
output: number
|
||||
cache: {
|
||||
read: number
|
||||
write: number
|
||||
}
|
||||
tier: {
|
||||
type: "context"
|
||||
size: number
|
||||
}
|
||||
}>
|
||||
experimentalOver200K?: {
|
||||
input: number
|
||||
output: number
|
||||
@@ -1500,6 +1363,7 @@ export type Model = {
|
||||
}
|
||||
limit: {
|
||||
context: number
|
||||
input?: number
|
||||
output: number
|
||||
}
|
||||
status: "alpha" | "beta" | "deprecated" | "active"
|
||||
@@ -1509,6 +1373,12 @@ export type Model = {
|
||||
headers: {
|
||||
[key: string]: string
|
||||
}
|
||||
release_date: string
|
||||
variants?: {
|
||||
[key: string]: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export type Provider = {
|
||||
@@ -1525,15 +1395,125 @@ export type Provider = {
|
||||
}
|
||||
}
|
||||
|
||||
export type ProviderAuthMethod = {
|
||||
type: "oauth" | "api"
|
||||
label: string
|
||||
export type ConsoleState = {
|
||||
consoleManagedProviders: Array<string>
|
||||
activeOrgName?: string
|
||||
switchableOrgCount: number
|
||||
}
|
||||
|
||||
export type ProviderAuthAuthorization = {
|
||||
url: string
|
||||
method: "auto" | "code"
|
||||
instructions: string
|
||||
export type EffectHttpApiErrorInternalServerError = {
|
||||
_tag: "InternalServerError"
|
||||
}
|
||||
|
||||
export type ToolListItem = {
|
||||
id: string
|
||||
description: string
|
||||
parameters: unknown
|
||||
}
|
||||
|
||||
export type ToolList = Array<ToolListItem>
|
||||
|
||||
export type ToolIds = Array<string>
|
||||
|
||||
export type WorktreeError = {
|
||||
name:
|
||||
| "WorktreeNotGitError"
|
||||
| "WorktreeNameGenerationFailedError"
|
||||
| "WorktreeCreateFailedError"
|
||||
| "WorktreeStartCommandFailedError"
|
||||
| "WorktreeRemoveFailedError"
|
||||
| "WorktreeResetFailedError"
|
||||
| "WorktreeListFailedError"
|
||||
data: {
|
||||
message: string
|
||||
}
|
||||
}
|
||||
|
||||
export type WorktreeCreateInput = {
|
||||
name?: string
|
||||
/**
|
||||
* Additional startup script to run after the project's start command
|
||||
*/
|
||||
startCommand?: string
|
||||
}
|
||||
|
||||
export type Worktree = {
|
||||
name: string
|
||||
branch?: string
|
||||
directory: string
|
||||
}
|
||||
|
||||
export type WorktreeRemoveInput = {
|
||||
directory: string
|
||||
}
|
||||
|
||||
export type WorktreeResetInput = {
|
||||
directory: string
|
||||
}
|
||||
|
||||
export type ProjectSummary = {
|
||||
id: string
|
||||
name?: string
|
||||
worktree: string
|
||||
}
|
||||
|
||||
export type GlobalSession = {
|
||||
id: string
|
||||
slug: string
|
||||
projectID: string
|
||||
workspaceID?: string
|
||||
directory: string
|
||||
path?: string
|
||||
parentID?: string
|
||||
summary?: {
|
||||
additions: number
|
||||
deletions: number
|
||||
files: number
|
||||
diffs?: Array<SnapshotFileDiff>
|
||||
}
|
||||
cost?: number
|
||||
tokens?: {
|
||||
input: number
|
||||
output: number
|
||||
reasoning: number
|
||||
cache: {
|
||||
read: number
|
||||
write: number
|
||||
}
|
||||
}
|
||||
share?: {
|
||||
url: string
|
||||
}
|
||||
title: string
|
||||
agent?: string
|
||||
model?: {
|
||||
id: string
|
||||
providerID: string
|
||||
variant?: string
|
||||
}
|
||||
version: string
|
||||
time: {
|
||||
created: number
|
||||
updated: number
|
||||
compacting?: number
|
||||
archived?: number
|
||||
}
|
||||
permission?: PermissionRuleset
|
||||
revert?: {
|
||||
messageID: string
|
||||
partID?: string
|
||||
snapshot?: string
|
||||
diff?: string
|
||||
}
|
||||
project: ProjectSummary | null
|
||||
}
|
||||
|
||||
export type McpResource = {
|
||||
name: string
|
||||
uri: string
|
||||
description?: string
|
||||
mimeType?: string
|
||||
client: string
|
||||
}
|
||||
|
||||
export type Symbol = {
|
||||
@@ -1582,35 +1562,86 @@ export type File = {
|
||||
status: "added" | "deleted" | "modified"
|
||||
}
|
||||
|
||||
export type Path = {
|
||||
home: string
|
||||
state: string
|
||||
config: string
|
||||
worktree: string
|
||||
directory: string
|
||||
}
|
||||
|
||||
export type VcsInfo = {
|
||||
branch?: string
|
||||
default_branch?: string
|
||||
}
|
||||
|
||||
export type VcsFileStatus = {
|
||||
file: string
|
||||
additions: number
|
||||
deletions: number
|
||||
status: "added" | "deleted" | "modified"
|
||||
}
|
||||
|
||||
export type VcsFileDiff = {
|
||||
file: string
|
||||
patch?: string
|
||||
additions: number
|
||||
deletions: number
|
||||
status?: "added" | "deleted" | "modified"
|
||||
}
|
||||
|
||||
export type VcsApplyError = {
|
||||
name: "VcsApplyError"
|
||||
data: {
|
||||
message: string
|
||||
reason: "non-git" | "not-clean"
|
||||
}
|
||||
}
|
||||
|
||||
export type Command = {
|
||||
name: string
|
||||
description?: string
|
||||
agent?: string
|
||||
model?: string
|
||||
source?: "command" | "mcp" | "skill"
|
||||
template: string
|
||||
subtask?: boolean
|
||||
hints: Array<string>
|
||||
}
|
||||
|
||||
export type Agent = {
|
||||
name: string
|
||||
description?: string
|
||||
mode: "subagent" | "primary" | "all"
|
||||
builtIn: boolean
|
||||
native?: boolean
|
||||
hidden?: boolean
|
||||
topP?: number
|
||||
temperature?: number
|
||||
color?: string
|
||||
permission: {
|
||||
edit: "ask" | "allow" | "deny"
|
||||
bash: {
|
||||
[key: string]: "ask" | "allow" | "deny"
|
||||
}
|
||||
webfetch?: "ask" | "allow" | "deny"
|
||||
doom_loop?: "ask" | "allow" | "deny"
|
||||
external_directory?: "ask" | "allow" | "deny"
|
||||
}
|
||||
permission: PermissionRuleset
|
||||
model?: {
|
||||
modelID: string
|
||||
providerID: string
|
||||
}
|
||||
variant?: string
|
||||
prompt?: string
|
||||
tools: {
|
||||
[key: string]: boolean
|
||||
}
|
||||
options: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
maxSteps?: number
|
||||
steps?: number
|
||||
}
|
||||
|
||||
export type LspStatus = {
|
||||
id: string
|
||||
name: string
|
||||
root: string
|
||||
status: "connected" | "error"
|
||||
}
|
||||
|
||||
export type FormatterStatus = {
|
||||
name: string
|
||||
extensions: Array<string>
|
||||
enabled: boolean
|
||||
}
|
||||
|
||||
export type McpStatusConnected = {
|
||||
@@ -1642,42 +1673,2123 @@ export type McpStatus =
|
||||
| McpStatusNeedsAuth
|
||||
| McpStatusNeedsClientRegistration
|
||||
|
||||
export type LspStatus = {
|
||||
export type McpUnsupportedOAuthError = {
|
||||
error: string
|
||||
}
|
||||
|
||||
export type NotFoundError = {
|
||||
name: "NotFoundError"
|
||||
data: {
|
||||
message: string
|
||||
}
|
||||
}
|
||||
|
||||
export type EffectHttpApiErrorForbidden = {
|
||||
_tag: "Forbidden"
|
||||
}
|
||||
|
||||
export type ProviderAuthMethod = {
|
||||
type: "oauth" | "api"
|
||||
label: string
|
||||
prompts?: Array<
|
||||
| {
|
||||
type: "text"
|
||||
key: string
|
||||
message: string
|
||||
placeholder?: string
|
||||
when?: {
|
||||
key: string
|
||||
op: "eq" | "neq"
|
||||
value: string
|
||||
}
|
||||
}
|
||||
| {
|
||||
type: "select"
|
||||
key: string
|
||||
message: string
|
||||
options: Array<{
|
||||
label: string
|
||||
value: string
|
||||
hint?: string
|
||||
}>
|
||||
when?: {
|
||||
key: string
|
||||
op: "eq" | "neq"
|
||||
value: string
|
||||
}
|
||||
}
|
||||
>
|
||||
}
|
||||
|
||||
export type ProviderAuthAuthorization = {
|
||||
url: string
|
||||
method: "auto" | "code"
|
||||
instructions: string
|
||||
}
|
||||
|
||||
export type ProviderAuthError1 = {
|
||||
name:
|
||||
| "BadRequest"
|
||||
| "ProviderAuthOauthMissing"
|
||||
| "ProviderAuthOauthCodeMissing"
|
||||
| "ProviderAuthOauthCallbackFailed"
|
||||
| "ProviderAuthValidationFailed"
|
||||
data: {
|
||||
providerID?: string
|
||||
field?: string
|
||||
message?: string
|
||||
kind?: string
|
||||
}
|
||||
}
|
||||
|
||||
export type TextPartInput = {
|
||||
id?: string
|
||||
type: "text"
|
||||
text: string
|
||||
synthetic?: boolean
|
||||
ignored?: boolean
|
||||
time?: {
|
||||
start: number
|
||||
end?: number
|
||||
}
|
||||
metadata?: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
}
|
||||
|
||||
export type FilePartInput = {
|
||||
id?: string
|
||||
type: "file"
|
||||
mime: string
|
||||
filename?: string
|
||||
url: string
|
||||
source?: FilePartSource
|
||||
}
|
||||
|
||||
export type AgentPartInput = {
|
||||
id?: string
|
||||
type: "agent"
|
||||
name: string
|
||||
source?: {
|
||||
value: string
|
||||
start: number
|
||||
end: number
|
||||
}
|
||||
}
|
||||
|
||||
export type SubtaskPartInput = {
|
||||
id?: string
|
||||
type: "subtask"
|
||||
prompt: string
|
||||
description: string
|
||||
agent: string
|
||||
model?: {
|
||||
providerID: string
|
||||
modelID: string
|
||||
}
|
||||
command?: string
|
||||
}
|
||||
|
||||
export type V2SessionsResponse = {
|
||||
items: Array<SessionInfo>
|
||||
cursor: {
|
||||
previous?: string
|
||||
next?: string
|
||||
}
|
||||
}
|
||||
|
||||
export type V2SessionMessagesResponse = {
|
||||
items: Array<SessionMessage>
|
||||
cursor: {
|
||||
previous?: string
|
||||
next?: string
|
||||
}
|
||||
}
|
||||
|
||||
export type EventTuiPromptAppend2 = {
|
||||
type: "tui.prompt.append"
|
||||
properties: {
|
||||
text: string
|
||||
}
|
||||
}
|
||||
|
||||
export type EventTuiCommandExecute2 = {
|
||||
type: "tui.command.execute"
|
||||
properties: {
|
||||
command:
|
||||
| "session.list"
|
||||
| "session.new"
|
||||
| "session.share"
|
||||
| "session.interrupt"
|
||||
| "session.compact"
|
||||
| "session.page.up"
|
||||
| "session.page.down"
|
||||
| "session.line.up"
|
||||
| "session.line.down"
|
||||
| "session.half.page.up"
|
||||
| "session.half.page.down"
|
||||
| "session.first"
|
||||
| "session.last"
|
||||
| "prompt.clear"
|
||||
| "prompt.submit"
|
||||
| "agent.cycle"
|
||||
| string
|
||||
}
|
||||
}
|
||||
|
||||
export type EventTuiToastShow2 = {
|
||||
type: "tui.toast.show"
|
||||
properties: {
|
||||
title?: string
|
||||
message: string
|
||||
variant: "info" | "success" | "warning" | "error"
|
||||
duration?: number
|
||||
}
|
||||
}
|
||||
|
||||
export type EventTuiSessionSelect2 = {
|
||||
type: "tui.session.select"
|
||||
properties: {
|
||||
/**
|
||||
* Session ID to navigate to
|
||||
*/
|
||||
sessionID: string
|
||||
}
|
||||
}
|
||||
|
||||
export type Workspace = {
|
||||
id: string
|
||||
type: string
|
||||
name: string
|
||||
root: string
|
||||
status: "connected" | "error"
|
||||
branch?: string | null
|
||||
directory?: string | null
|
||||
extra?: unknown | null
|
||||
projectID: string
|
||||
timeUsed: number | "NaN" | "Infinity" | "-Infinity" | "Infinity" | "-Infinity" | "NaN"
|
||||
}
|
||||
|
||||
export type FormatterStatus = {
|
||||
export type WorkspaceWarpError = {
|
||||
name: "WorkspaceWarpError"
|
||||
data: {
|
||||
message: string
|
||||
}
|
||||
}
|
||||
|
||||
export type SyncEventMessageUpdated = {
|
||||
type: "sync"
|
||||
name: "message.updated.1"
|
||||
id: string
|
||||
seq: number
|
||||
aggregateID: "sessionID"
|
||||
data: {
|
||||
sessionID: string
|
||||
info: Message
|
||||
}
|
||||
}
|
||||
|
||||
export type SyncEventMessageRemoved = {
|
||||
type: "sync"
|
||||
name: "message.removed.1"
|
||||
id: string
|
||||
seq: number
|
||||
aggregateID: "sessionID"
|
||||
data: {
|
||||
sessionID: string
|
||||
messageID: string
|
||||
}
|
||||
}
|
||||
|
||||
export type SyncEventMessagePartUpdated = {
|
||||
type: "sync"
|
||||
name: "message.part.updated.1"
|
||||
id: string
|
||||
seq: number
|
||||
aggregateID: "sessionID"
|
||||
data: {
|
||||
sessionID: string
|
||||
part: Part
|
||||
time: number
|
||||
}
|
||||
}
|
||||
|
||||
export type SyncEventMessagePartRemoved = {
|
||||
type: "sync"
|
||||
name: "message.part.removed.1"
|
||||
id: string
|
||||
seq: number
|
||||
aggregateID: "sessionID"
|
||||
data: {
|
||||
sessionID: string
|
||||
messageID: string
|
||||
partID: string
|
||||
}
|
||||
}
|
||||
|
||||
export type SyncEventSessionCreated = {
|
||||
type: "sync"
|
||||
name: "session.created.1"
|
||||
id: string
|
||||
seq: number
|
||||
aggregateID: "sessionID"
|
||||
data: {
|
||||
sessionID: string
|
||||
info: Session
|
||||
}
|
||||
}
|
||||
|
||||
export type SyncEventSessionUpdated = {
|
||||
type: "sync"
|
||||
name: "session.updated.1"
|
||||
id: string
|
||||
seq: number
|
||||
aggregateID: "sessionID"
|
||||
data: {
|
||||
sessionID: string
|
||||
info: {
|
||||
id?: string | null
|
||||
slug?: string | null
|
||||
projectID?: string | null
|
||||
workspaceID?: string | null
|
||||
directory?: string | null
|
||||
path?: string | null
|
||||
parentID?: string | null
|
||||
summary?: {
|
||||
additions: number
|
||||
deletions: number
|
||||
files: number
|
||||
diffs?: Array<SnapshotFileDiff>
|
||||
} | null
|
||||
cost?: number | null
|
||||
tokens?: {
|
||||
input: number
|
||||
output: number
|
||||
reasoning: number
|
||||
cache: {
|
||||
read: number
|
||||
write: number
|
||||
}
|
||||
} | null
|
||||
share?: {
|
||||
url?: string | null
|
||||
}
|
||||
title?: string | null
|
||||
agent?: string | null
|
||||
model?: {
|
||||
id: string
|
||||
providerID: string
|
||||
variant?: string
|
||||
} | null
|
||||
version?: string | null
|
||||
time?: {
|
||||
created?: number | null
|
||||
updated?: number | null
|
||||
compacting?: number | null
|
||||
archived?: number | null
|
||||
}
|
||||
permission?: PermissionRuleset | null
|
||||
revert?: {
|
||||
messageID: string
|
||||
partID?: string
|
||||
snapshot?: string
|
||||
diff?: string
|
||||
} | null
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export type SyncEventSessionDeleted = {
|
||||
type: "sync"
|
||||
name: "session.deleted.1"
|
||||
id: string
|
||||
seq: number
|
||||
aggregateID: "sessionID"
|
||||
data: {
|
||||
sessionID: string
|
||||
info: Session
|
||||
}
|
||||
}
|
||||
|
||||
export type SyncEventSessionNextAgentSwitched = {
|
||||
type: "sync"
|
||||
name: "session.next.agent.switched.1"
|
||||
id: string
|
||||
seq: number
|
||||
aggregateID: "sessionID"
|
||||
data: {
|
||||
timestamp: number
|
||||
sessionID: string
|
||||
agent: string
|
||||
}
|
||||
}
|
||||
|
||||
export type SyncEventSessionNextModelSwitched = {
|
||||
type: "sync"
|
||||
name: "session.next.model.switched.1"
|
||||
id: string
|
||||
seq: number
|
||||
aggregateID: "sessionID"
|
||||
data: {
|
||||
timestamp: number
|
||||
sessionID: string
|
||||
model: {
|
||||
id: string
|
||||
providerID: string
|
||||
variant: string
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export type SyncEventSessionNextPrompted = {
|
||||
type: "sync"
|
||||
name: "session.next.prompted.1"
|
||||
id: string
|
||||
seq: number
|
||||
aggregateID: "sessionID"
|
||||
data: {
|
||||
timestamp: number
|
||||
sessionID: string
|
||||
prompt: Prompt
|
||||
}
|
||||
}
|
||||
|
||||
export type SyncEventSessionNextSynthetic = {
|
||||
type: "sync"
|
||||
name: "session.next.synthetic.1"
|
||||
id: string
|
||||
seq: number
|
||||
aggregateID: "sessionID"
|
||||
data: {
|
||||
timestamp: number
|
||||
sessionID: string
|
||||
text: string
|
||||
}
|
||||
}
|
||||
|
||||
export type SyncEventSessionNextShellStarted = {
|
||||
type: "sync"
|
||||
name: "session.next.shell.started.1"
|
||||
id: string
|
||||
seq: number
|
||||
aggregateID: "sessionID"
|
||||
data: {
|
||||
timestamp: number
|
||||
sessionID: string
|
||||
callID: string
|
||||
command: string
|
||||
}
|
||||
}
|
||||
|
||||
export type SyncEventSessionNextShellEnded = {
|
||||
type: "sync"
|
||||
name: "session.next.shell.ended.1"
|
||||
id: string
|
||||
seq: number
|
||||
aggregateID: "sessionID"
|
||||
data: {
|
||||
timestamp: number
|
||||
sessionID: string
|
||||
callID: string
|
||||
output: string
|
||||
}
|
||||
}
|
||||
|
||||
export type SyncEventSessionNextStepStarted = {
|
||||
type: "sync"
|
||||
name: "session.next.step.started.1"
|
||||
id: string
|
||||
seq: number
|
||||
aggregateID: "sessionID"
|
||||
data: {
|
||||
timestamp: number
|
||||
sessionID: string
|
||||
agent: string
|
||||
model: {
|
||||
id: string
|
||||
providerID: string
|
||||
variant: string
|
||||
}
|
||||
snapshot?: string
|
||||
}
|
||||
}
|
||||
|
||||
export type SyncEventSessionNextStepEnded = {
|
||||
type: "sync"
|
||||
name: "session.next.step.ended.1"
|
||||
id: string
|
||||
seq: number
|
||||
aggregateID: "sessionID"
|
||||
data: {
|
||||
timestamp: number
|
||||
sessionID: string
|
||||
finish: string
|
||||
cost: number
|
||||
tokens: {
|
||||
input: number
|
||||
output: number
|
||||
reasoning: number
|
||||
cache: {
|
||||
read: number
|
||||
write: number
|
||||
}
|
||||
}
|
||||
snapshot?: string
|
||||
}
|
||||
}
|
||||
|
||||
export type SyncEventSessionNextStepFailed = {
|
||||
type: "sync"
|
||||
name: "session.next.step.failed.1"
|
||||
id: string
|
||||
seq: number
|
||||
aggregateID: "sessionID"
|
||||
data: {
|
||||
timestamp: number
|
||||
sessionID: string
|
||||
error: SessionErrorUnknown
|
||||
}
|
||||
}
|
||||
|
||||
export type SyncEventSessionNextTextStarted = {
|
||||
type: "sync"
|
||||
name: "session.next.text.started.1"
|
||||
id: string
|
||||
seq: number
|
||||
aggregateID: "sessionID"
|
||||
data: {
|
||||
timestamp: number
|
||||
sessionID: string
|
||||
}
|
||||
}
|
||||
|
||||
export type SyncEventSessionNextTextDelta = {
|
||||
type: "sync"
|
||||
name: "session.next.text.delta.1"
|
||||
id: string
|
||||
seq: number
|
||||
aggregateID: "sessionID"
|
||||
data: {
|
||||
timestamp: number
|
||||
sessionID: string
|
||||
delta: string
|
||||
}
|
||||
}
|
||||
|
||||
export type SyncEventSessionNextTextEnded = {
|
||||
type: "sync"
|
||||
name: "session.next.text.ended.1"
|
||||
id: string
|
||||
seq: number
|
||||
aggregateID: "sessionID"
|
||||
data: {
|
||||
timestamp: number
|
||||
sessionID: string
|
||||
text: string
|
||||
}
|
||||
}
|
||||
|
||||
export type SyncEventSessionNextReasoningStarted = {
|
||||
type: "sync"
|
||||
name: "session.next.reasoning.started.1"
|
||||
id: string
|
||||
seq: number
|
||||
aggregateID: "sessionID"
|
||||
data: {
|
||||
timestamp: number
|
||||
sessionID: string
|
||||
reasoningID: string
|
||||
}
|
||||
}
|
||||
|
||||
export type SyncEventSessionNextReasoningDelta = {
|
||||
type: "sync"
|
||||
name: "session.next.reasoning.delta.1"
|
||||
id: string
|
||||
seq: number
|
||||
aggregateID: "sessionID"
|
||||
data: {
|
||||
timestamp: number
|
||||
sessionID: string
|
||||
reasoningID: string
|
||||
delta: string
|
||||
}
|
||||
}
|
||||
|
||||
export type SyncEventSessionNextReasoningEnded = {
|
||||
type: "sync"
|
||||
name: "session.next.reasoning.ended.1"
|
||||
id: string
|
||||
seq: number
|
||||
aggregateID: "sessionID"
|
||||
data: {
|
||||
timestamp: number
|
||||
sessionID: string
|
||||
reasoningID: string
|
||||
text: string
|
||||
}
|
||||
}
|
||||
|
||||
export type SyncEventSessionNextToolInputStarted = {
|
||||
type: "sync"
|
||||
name: "session.next.tool.input.started.1"
|
||||
id: string
|
||||
seq: number
|
||||
aggregateID: "sessionID"
|
||||
data: {
|
||||
timestamp: number
|
||||
sessionID: string
|
||||
callID: string
|
||||
name: string
|
||||
}
|
||||
}
|
||||
|
||||
export type SyncEventSessionNextToolInputDelta = {
|
||||
type: "sync"
|
||||
name: "session.next.tool.input.delta.1"
|
||||
id: string
|
||||
seq: number
|
||||
aggregateID: "sessionID"
|
||||
data: {
|
||||
timestamp: number
|
||||
sessionID: string
|
||||
callID: string
|
||||
delta: string
|
||||
}
|
||||
}
|
||||
|
||||
export type SyncEventSessionNextToolInputEnded = {
|
||||
type: "sync"
|
||||
name: "session.next.tool.input.ended.1"
|
||||
id: string
|
||||
seq: number
|
||||
aggregateID: "sessionID"
|
||||
data: {
|
||||
timestamp: number
|
||||
sessionID: string
|
||||
callID: string
|
||||
text: string
|
||||
}
|
||||
}
|
||||
|
||||
export type SyncEventSessionNextToolCalled = {
|
||||
type: "sync"
|
||||
name: "session.next.tool.called.1"
|
||||
id: string
|
||||
seq: number
|
||||
aggregateID: "sessionID"
|
||||
data: {
|
||||
timestamp: number
|
||||
sessionID: string
|
||||
callID: string
|
||||
tool: string
|
||||
input: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
provider: {
|
||||
executed: boolean
|
||||
metadata?: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export type SyncEventSessionNextToolProgress = {
|
||||
type: "sync"
|
||||
name: "session.next.tool.progress.1"
|
||||
id: string
|
||||
seq: number
|
||||
aggregateID: "sessionID"
|
||||
data: {
|
||||
timestamp: number
|
||||
sessionID: string
|
||||
callID: string
|
||||
structured: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
content: Array<ToolTextContent | ToolFileContent>
|
||||
}
|
||||
}
|
||||
|
||||
export type SyncEventSessionNextToolSuccess = {
|
||||
type: "sync"
|
||||
name: "session.next.tool.success.1"
|
||||
id: string
|
||||
seq: number
|
||||
aggregateID: "sessionID"
|
||||
data: {
|
||||
timestamp: number
|
||||
sessionID: string
|
||||
callID: string
|
||||
structured: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
content: Array<ToolTextContent | ToolFileContent>
|
||||
provider: {
|
||||
executed: boolean
|
||||
metadata?: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export type SyncEventSessionNextToolFailed = {
|
||||
type: "sync"
|
||||
name: "session.next.tool.failed.1"
|
||||
id: string
|
||||
seq: number
|
||||
aggregateID: "sessionID"
|
||||
data: {
|
||||
timestamp: number
|
||||
sessionID: string
|
||||
callID: string
|
||||
error: SessionErrorUnknown
|
||||
provider: {
|
||||
executed: boolean
|
||||
metadata?: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export type SyncEventSessionNextRetried = {
|
||||
type: "sync"
|
||||
name: "session.next.retried.1"
|
||||
id: string
|
||||
seq: number
|
||||
aggregateID: "sessionID"
|
||||
data: {
|
||||
timestamp: number
|
||||
sessionID: string
|
||||
attempt: number
|
||||
error: SessionNextRetryError
|
||||
}
|
||||
}
|
||||
|
||||
export type SyncEventSessionNextCompactionStarted = {
|
||||
type: "sync"
|
||||
name: "session.next.compaction.started.1"
|
||||
id: string
|
||||
seq: number
|
||||
aggregateID: "sessionID"
|
||||
data: {
|
||||
timestamp: number
|
||||
sessionID: string
|
||||
reason: "auto" | "manual"
|
||||
}
|
||||
}
|
||||
|
||||
export type SyncEventSessionNextCompactionDelta = {
|
||||
type: "sync"
|
||||
name: "session.next.compaction.delta.1"
|
||||
id: string
|
||||
seq: number
|
||||
aggregateID: "sessionID"
|
||||
data: {
|
||||
timestamp: number
|
||||
sessionID: string
|
||||
text: string
|
||||
}
|
||||
}
|
||||
|
||||
export type SyncEventSessionNextCompactionEnded = {
|
||||
type: "sync"
|
||||
name: "session.next.compaction.ended.1"
|
||||
id: string
|
||||
seq: number
|
||||
aggregateID: "sessionID"
|
||||
data: {
|
||||
timestamp: number
|
||||
sessionID: string
|
||||
text: string
|
||||
include?: string
|
||||
}
|
||||
}
|
||||
|
||||
export type EventServerConnected = {
|
||||
id: string
|
||||
type: "server.connected"
|
||||
properties: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
}
|
||||
|
||||
export type EventGlobalDisposed = {
|
||||
id: string
|
||||
type: "global.disposed"
|
||||
properties: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
}
|
||||
|
||||
export type EventServerInstanceDisposed = {
|
||||
id: string
|
||||
type: "server.instance.disposed"
|
||||
properties: {
|
||||
directory: string
|
||||
}
|
||||
}
|
||||
|
||||
export type EventFileEdited = {
|
||||
id: string
|
||||
type: "file.edited"
|
||||
properties: {
|
||||
file: string
|
||||
}
|
||||
}
|
||||
|
||||
export type EventFileWatcherUpdated = {
|
||||
id: string
|
||||
type: "file.watcher.updated"
|
||||
properties: {
|
||||
file: string
|
||||
event: "add" | "change" | "unlink"
|
||||
}
|
||||
}
|
||||
|
||||
export type EventLspClientDiagnostics = {
|
||||
id: string
|
||||
type: "lsp.client.diagnostics"
|
||||
properties: {
|
||||
serverID: string
|
||||
path: string
|
||||
}
|
||||
}
|
||||
|
||||
export type EventLspUpdated = {
|
||||
id: string
|
||||
type: "lsp.updated"
|
||||
properties: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
}
|
||||
|
||||
export type EventMessagePartDelta = {
|
||||
id: string
|
||||
type: "message.part.delta"
|
||||
properties: {
|
||||
sessionID: string
|
||||
messageID: string
|
||||
partID: string
|
||||
field: string
|
||||
delta: string
|
||||
}
|
||||
}
|
||||
|
||||
export type EventPermissionAsked = {
|
||||
id: string
|
||||
type: "permission.asked"
|
||||
properties: PermissionRequest
|
||||
}
|
||||
|
||||
export type EventPermissionReplied = {
|
||||
id: string
|
||||
type: "permission.replied"
|
||||
properties: {
|
||||
sessionID: string
|
||||
requestID: string
|
||||
reply: "once" | "always" | "reject"
|
||||
}
|
||||
}
|
||||
|
||||
export type EventSessionDiff = {
|
||||
id: string
|
||||
type: "session.diff"
|
||||
properties: {
|
||||
sessionID: string
|
||||
diff: Array<SnapshotFileDiff>
|
||||
}
|
||||
}
|
||||
|
||||
export type EventSessionError = {
|
||||
id: string
|
||||
type: "session.error"
|
||||
properties: {
|
||||
sessionID?: string
|
||||
error?:
|
||||
| ProviderAuthError
|
||||
| UnknownError
|
||||
| MessageOutputLengthError
|
||||
| MessageAbortedError
|
||||
| StructuredOutputError
|
||||
| ContextOverflowError
|
||||
| ApiError
|
||||
}
|
||||
}
|
||||
|
||||
export type EventQuestionAsked = {
|
||||
id: string
|
||||
type: "question.asked"
|
||||
properties: QuestionRequest
|
||||
}
|
||||
|
||||
export type EventQuestionReplied = {
|
||||
id: string
|
||||
type: "question.replied"
|
||||
properties: QuestionReplied
|
||||
}
|
||||
|
||||
export type EventQuestionRejected = {
|
||||
id: string
|
||||
type: "question.rejected"
|
||||
properties: QuestionRejected
|
||||
}
|
||||
|
||||
export type EventTodoUpdated = {
|
||||
id: string
|
||||
type: "todo.updated"
|
||||
properties: {
|
||||
sessionID: string
|
||||
todos: Array<Todo>
|
||||
}
|
||||
}
|
||||
|
||||
export type EventSessionStatus = {
|
||||
id: string
|
||||
type: "session.status"
|
||||
properties: {
|
||||
sessionID: string
|
||||
status: SessionStatus
|
||||
}
|
||||
}
|
||||
|
||||
export type EventSessionIdle = {
|
||||
id: string
|
||||
type: "session.idle"
|
||||
properties: {
|
||||
sessionID: string
|
||||
}
|
||||
}
|
||||
|
||||
export type EventMcpToolsChanged = {
|
||||
id: string
|
||||
type: "mcp.tools.changed"
|
||||
properties: {
|
||||
server: string
|
||||
}
|
||||
}
|
||||
|
||||
export type EventMcpBrowserOpenFailed = {
|
||||
id: string
|
||||
type: "mcp.browser.open.failed"
|
||||
properties: {
|
||||
mcpName: string
|
||||
url: string
|
||||
}
|
||||
}
|
||||
|
||||
export type EventCommandExecuted = {
|
||||
id: string
|
||||
type: "command.executed"
|
||||
properties: {
|
||||
name: string
|
||||
sessionID: string
|
||||
arguments: string
|
||||
messageID: string
|
||||
}
|
||||
}
|
||||
|
||||
export type EventProjectUpdated = {
|
||||
id: string
|
||||
type: "project.updated"
|
||||
properties: Project
|
||||
}
|
||||
|
||||
export type EventSessionCompacted = {
|
||||
id: string
|
||||
type: "session.compacted"
|
||||
properties: {
|
||||
sessionID: string
|
||||
}
|
||||
}
|
||||
|
||||
export type EventVcsBranchUpdated = {
|
||||
id: string
|
||||
type: "vcs.branch.updated"
|
||||
properties: {
|
||||
branch?: string
|
||||
}
|
||||
}
|
||||
|
||||
export type EventWorkspaceReady = {
|
||||
id: string
|
||||
type: "workspace.ready"
|
||||
properties: {
|
||||
name: string
|
||||
}
|
||||
}
|
||||
|
||||
export type EventWorkspaceFailed = {
|
||||
id: string
|
||||
type: "workspace.failed"
|
||||
properties: {
|
||||
message: string
|
||||
}
|
||||
}
|
||||
|
||||
export type EventWorkspaceStatus = {
|
||||
id: string
|
||||
type: "workspace.status"
|
||||
properties: {
|
||||
workspaceID: string
|
||||
status: "connected" | "connecting" | "disconnected" | "error"
|
||||
}
|
||||
}
|
||||
|
||||
export type EventWorktreeReady = {
|
||||
id: string
|
||||
type: "worktree.ready"
|
||||
properties: {
|
||||
name: string
|
||||
branch?: string
|
||||
}
|
||||
}
|
||||
|
||||
export type EventWorktreeFailed = {
|
||||
id: string
|
||||
type: "worktree.failed"
|
||||
properties: {
|
||||
message: string
|
||||
}
|
||||
}
|
||||
|
||||
export type EventPtyCreated = {
|
||||
id: string
|
||||
type: "pty.created"
|
||||
properties: {
|
||||
info: Pty
|
||||
}
|
||||
}
|
||||
|
||||
export type EventPtyUpdated = {
|
||||
id: string
|
||||
type: "pty.updated"
|
||||
properties: {
|
||||
info: Pty
|
||||
}
|
||||
}
|
||||
|
||||
export type EventPtyExited = {
|
||||
id: string
|
||||
type: "pty.exited"
|
||||
properties: {
|
||||
id: string
|
||||
exitCode: number
|
||||
}
|
||||
}
|
||||
|
||||
export type EventPtyDeleted = {
|
||||
id: string
|
||||
type: "pty.deleted"
|
||||
properties: {
|
||||
id: string
|
||||
}
|
||||
}
|
||||
|
||||
export type EventInstallationUpdated = {
|
||||
id: string
|
||||
type: "installation.updated"
|
||||
properties: {
|
||||
version: string
|
||||
}
|
||||
}
|
||||
|
||||
export type EventInstallationUpdateAvailable = {
|
||||
id: string
|
||||
type: "installation.update-available"
|
||||
properties: {
|
||||
version: string
|
||||
}
|
||||
}
|
||||
|
||||
export type EventMessageUpdated = {
|
||||
id: string
|
||||
type: "message.updated"
|
||||
properties: {
|
||||
sessionID: string
|
||||
info: Message
|
||||
}
|
||||
}
|
||||
|
||||
export type EventMessageRemoved = {
|
||||
id: string
|
||||
type: "message.removed"
|
||||
properties: {
|
||||
sessionID: string
|
||||
messageID: string
|
||||
}
|
||||
}
|
||||
|
||||
export type EventMessagePartUpdated = {
|
||||
id: string
|
||||
type: "message.part.updated"
|
||||
properties: {
|
||||
sessionID: string
|
||||
part: Part
|
||||
time: number
|
||||
}
|
||||
}
|
||||
|
||||
export type EventMessagePartRemoved = {
|
||||
id: string
|
||||
type: "message.part.removed"
|
||||
properties: {
|
||||
sessionID: string
|
||||
messageID: string
|
||||
partID: string
|
||||
}
|
||||
}
|
||||
|
||||
export type EventSessionCreated = {
|
||||
id: string
|
||||
type: "session.created"
|
||||
properties: {
|
||||
sessionID: string
|
||||
info: Session
|
||||
}
|
||||
}
|
||||
|
||||
export type EventSessionUpdated = {
|
||||
id: string
|
||||
type: "session.updated"
|
||||
properties: {
|
||||
sessionID: string
|
||||
info: Session
|
||||
}
|
||||
}
|
||||
|
||||
export type EventSessionDeleted = {
|
||||
id: string
|
||||
type: "session.deleted"
|
||||
properties: {
|
||||
sessionID: string
|
||||
info: Session
|
||||
}
|
||||
}
|
||||
|
||||
export type EventSessionNextAgentSwitched = {
|
||||
id: string
|
||||
type: "session.next.agent.switched"
|
||||
properties: {
|
||||
timestamp: number
|
||||
sessionID: string
|
||||
agent: string
|
||||
}
|
||||
}
|
||||
|
||||
export type EventSessionNextModelSwitched = {
|
||||
id: string
|
||||
type: "session.next.model.switched"
|
||||
properties: {
|
||||
timestamp: number
|
||||
sessionID: string
|
||||
model: {
|
||||
id: string
|
||||
providerID: string
|
||||
variant: string
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export type PromptSource = {
|
||||
start: number
|
||||
end: number
|
||||
text: string
|
||||
}
|
||||
|
||||
export type PromptFileAttachment = {
|
||||
uri: string
|
||||
mime: string
|
||||
name?: string
|
||||
description?: string
|
||||
source?: PromptSource
|
||||
}
|
||||
|
||||
export type PromptAgentAttachment = {
|
||||
name: string
|
||||
extensions: Array<string>
|
||||
enabled: boolean
|
||||
source?: PromptSource
|
||||
}
|
||||
|
||||
export type OAuth = {
|
||||
type: "oauth"
|
||||
refresh: string
|
||||
access: string
|
||||
expires: number
|
||||
enterpriseUrl?: string
|
||||
export type PromptReferenceAttachment = {
|
||||
name: string
|
||||
kind: "local" | "git" | "invalid"
|
||||
uri?: string
|
||||
repository?: string
|
||||
branch?: string
|
||||
target?: string
|
||||
targetUri?: string
|
||||
problem?: string
|
||||
source?: PromptSource
|
||||
}
|
||||
|
||||
export type ApiAuth = {
|
||||
type: "api"
|
||||
key: string
|
||||
export type EventSessionNextPrompted = {
|
||||
id: string
|
||||
type: "session.next.prompted"
|
||||
properties: {
|
||||
timestamp: number
|
||||
sessionID: string
|
||||
prompt: Prompt
|
||||
}
|
||||
}
|
||||
|
||||
export type EventSessionNextSynthetic = {
|
||||
id: string
|
||||
type: "session.next.synthetic"
|
||||
properties: {
|
||||
timestamp: number
|
||||
sessionID: string
|
||||
text: string
|
||||
}
|
||||
}
|
||||
|
||||
export type EventSessionNextShellStarted = {
|
||||
id: string
|
||||
type: "session.next.shell.started"
|
||||
properties: {
|
||||
timestamp: number
|
||||
sessionID: string
|
||||
callID: string
|
||||
command: string
|
||||
}
|
||||
}
|
||||
|
||||
export type EventSessionNextShellEnded = {
|
||||
id: string
|
||||
type: "session.next.shell.ended"
|
||||
properties: {
|
||||
timestamp: number
|
||||
sessionID: string
|
||||
callID: string
|
||||
output: string
|
||||
}
|
||||
}
|
||||
|
||||
export type EventSessionNextStepStarted = {
|
||||
id: string
|
||||
type: "session.next.step.started"
|
||||
properties: {
|
||||
timestamp: number
|
||||
sessionID: string
|
||||
agent: string
|
||||
model: {
|
||||
id: string
|
||||
providerID: string
|
||||
variant: string
|
||||
}
|
||||
snapshot?: string
|
||||
}
|
||||
}
|
||||
|
||||
export type EventSessionNextStepEnded = {
|
||||
id: string
|
||||
type: "session.next.step.ended"
|
||||
properties: {
|
||||
timestamp: number
|
||||
sessionID: string
|
||||
finish: string
|
||||
cost: number
|
||||
tokens: {
|
||||
input: number
|
||||
output: number
|
||||
reasoning: number
|
||||
cache: {
|
||||
read: number
|
||||
write: number
|
||||
}
|
||||
}
|
||||
snapshot?: string
|
||||
}
|
||||
}
|
||||
|
||||
export type SessionErrorUnknown = {
|
||||
type: "unknown"
|
||||
message: string
|
||||
}
|
||||
|
||||
export type EventSessionNextStepFailed = {
|
||||
id: string
|
||||
type: "session.next.step.failed"
|
||||
properties: {
|
||||
timestamp: number
|
||||
sessionID: string
|
||||
error: SessionErrorUnknown
|
||||
}
|
||||
}
|
||||
|
||||
export type EventSessionNextTextStarted = {
|
||||
id: string
|
||||
type: "session.next.text.started"
|
||||
properties: {
|
||||
timestamp: number
|
||||
sessionID: string
|
||||
}
|
||||
}
|
||||
|
||||
export type EventSessionNextTextDelta = {
|
||||
id: string
|
||||
type: "session.next.text.delta"
|
||||
properties: {
|
||||
timestamp: number
|
||||
sessionID: string
|
||||
delta: string
|
||||
}
|
||||
}
|
||||
|
||||
export type EventSessionNextTextEnded = {
|
||||
id: string
|
||||
type: "session.next.text.ended"
|
||||
properties: {
|
||||
timestamp: number
|
||||
sessionID: string
|
||||
text: string
|
||||
}
|
||||
}
|
||||
|
||||
export type EventSessionNextReasoningStarted = {
|
||||
id: string
|
||||
type: "session.next.reasoning.started"
|
||||
properties: {
|
||||
timestamp: number
|
||||
sessionID: string
|
||||
reasoningID: string
|
||||
}
|
||||
}
|
||||
|
||||
export type EventSessionNextReasoningDelta = {
|
||||
id: string
|
||||
type: "session.next.reasoning.delta"
|
||||
properties: {
|
||||
timestamp: number
|
||||
sessionID: string
|
||||
reasoningID: string
|
||||
delta: string
|
||||
}
|
||||
}
|
||||
|
||||
export type EventSessionNextReasoningEnded = {
|
||||
id: string
|
||||
type: "session.next.reasoning.ended"
|
||||
properties: {
|
||||
timestamp: number
|
||||
sessionID: string
|
||||
reasoningID: string
|
||||
text: string
|
||||
}
|
||||
}
|
||||
|
||||
export type EventSessionNextToolInputStarted = {
|
||||
id: string
|
||||
type: "session.next.tool.input.started"
|
||||
properties: {
|
||||
timestamp: number
|
||||
sessionID: string
|
||||
callID: string
|
||||
name: string
|
||||
}
|
||||
}
|
||||
|
||||
export type EventSessionNextToolInputDelta = {
|
||||
id: string
|
||||
type: "session.next.tool.input.delta"
|
||||
properties: {
|
||||
timestamp: number
|
||||
sessionID: string
|
||||
callID: string
|
||||
delta: string
|
||||
}
|
||||
}
|
||||
|
||||
export type EventSessionNextToolInputEnded = {
|
||||
id: string
|
||||
type: "session.next.tool.input.ended"
|
||||
properties: {
|
||||
timestamp: number
|
||||
sessionID: string
|
||||
callID: string
|
||||
text: string
|
||||
}
|
||||
}
|
||||
|
||||
export type EventSessionNextToolCalled = {
|
||||
id: string
|
||||
type: "session.next.tool.called"
|
||||
properties: {
|
||||
timestamp: number
|
||||
sessionID: string
|
||||
callID: string
|
||||
tool: string
|
||||
input: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
provider: {
|
||||
executed: boolean
|
||||
metadata?: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export type ToolTextContent = {
|
||||
type: "text"
|
||||
text: string
|
||||
}
|
||||
|
||||
export type ToolFileContent = {
|
||||
type: "file"
|
||||
uri: string
|
||||
mime: string
|
||||
name?: string
|
||||
}
|
||||
|
||||
export type EventSessionNextToolProgress = {
|
||||
id: string
|
||||
type: "session.next.tool.progress"
|
||||
properties: {
|
||||
timestamp: number
|
||||
sessionID: string
|
||||
callID: string
|
||||
structured: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
content: Array<ToolTextContent | ToolFileContent>
|
||||
}
|
||||
}
|
||||
|
||||
export type EventSessionNextToolSuccess = {
|
||||
id: string
|
||||
type: "session.next.tool.success"
|
||||
properties: {
|
||||
timestamp: number
|
||||
sessionID: string
|
||||
callID: string
|
||||
structured: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
content: Array<ToolTextContent | ToolFileContent>
|
||||
provider: {
|
||||
executed: boolean
|
||||
metadata?: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export type EventSessionNextToolFailed = {
|
||||
id: string
|
||||
type: "session.next.tool.failed"
|
||||
properties: {
|
||||
timestamp: number
|
||||
sessionID: string
|
||||
callID: string
|
||||
error: SessionErrorUnknown
|
||||
provider: {
|
||||
executed: boolean
|
||||
metadata?: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export type SessionNextRetryError = {
|
||||
message: string
|
||||
statusCode?: number
|
||||
isRetryable: boolean
|
||||
responseHeaders?: {
|
||||
[key: string]: string
|
||||
}
|
||||
responseBody?: string
|
||||
metadata?: {
|
||||
[key: string]: string
|
||||
}
|
||||
}
|
||||
|
||||
export type WellKnownAuth = {
|
||||
type: "wellknown"
|
||||
key: string
|
||||
token: string
|
||||
export type EventSessionNextRetried = {
|
||||
id: string
|
||||
type: "session.next.retried"
|
||||
properties: {
|
||||
timestamp: number
|
||||
sessionID: string
|
||||
attempt: number
|
||||
error: SessionNextRetryError
|
||||
}
|
||||
}
|
||||
|
||||
export type Auth = OAuth | ApiAuth | WellKnownAuth
|
||||
export type EventSessionNextCompactionStarted = {
|
||||
id: string
|
||||
type: "session.next.compaction.started"
|
||||
properties: {
|
||||
timestamp: number
|
||||
sessionID: string
|
||||
reason: "auto" | "manual"
|
||||
}
|
||||
}
|
||||
|
||||
export type EventSessionNextCompactionDelta = {
|
||||
id: string
|
||||
type: "session.next.compaction.delta"
|
||||
properties: {
|
||||
timestamp: number
|
||||
sessionID: string
|
||||
text: string
|
||||
}
|
||||
}
|
||||
|
||||
export type EventSessionNextCompactionEnded = {
|
||||
id: string
|
||||
type: "session.next.compaction.ended"
|
||||
properties: {
|
||||
timestamp: number
|
||||
sessionID: string
|
||||
text: string
|
||||
include?: string
|
||||
}
|
||||
}
|
||||
|
||||
export type ModelV2Info = {
|
||||
id: string
|
||||
apiID: string
|
||||
providerID: string
|
||||
family?: string
|
||||
name: string
|
||||
endpoint:
|
||||
| {
|
||||
type: "unknown"
|
||||
}
|
||||
| {
|
||||
type: "openai/responses"
|
||||
url: string
|
||||
websocket?: boolean
|
||||
}
|
||||
| {
|
||||
type: "openai/completions"
|
||||
url: string
|
||||
reasoning?:
|
||||
| {
|
||||
type: "reasoning_content"
|
||||
}
|
||||
| {
|
||||
type: "reasoning_details"
|
||||
}
|
||||
}
|
||||
| {
|
||||
type: "anthropic/messages"
|
||||
url: string
|
||||
}
|
||||
| {
|
||||
type: "aisdk"
|
||||
package: string
|
||||
url?: string
|
||||
}
|
||||
capabilities: {
|
||||
tools: boolean
|
||||
input: Array<string>
|
||||
output: Array<string>
|
||||
}
|
||||
options: {
|
||||
headers: {
|
||||
[key: string]: string
|
||||
}
|
||||
body: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
aisdk: {
|
||||
provider: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
request: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
}
|
||||
variant?: string
|
||||
}
|
||||
variants: Array<{
|
||||
id: string
|
||||
headers: {
|
||||
[key: string]: string
|
||||
}
|
||||
body: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
aisdk: {
|
||||
provider: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
request: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
}
|
||||
}>
|
||||
time: {
|
||||
released: number | "NaN" | "Infinity" | "-Infinity" | "Infinity" | "-Infinity" | "NaN"
|
||||
}
|
||||
cost: Array<{
|
||||
tier?: {
|
||||
type: "context"
|
||||
size: number
|
||||
}
|
||||
input: number
|
||||
output: number
|
||||
cache: {
|
||||
read: number
|
||||
write: number
|
||||
}
|
||||
}>
|
||||
status: "alpha" | "beta" | "deprecated" | "active"
|
||||
enabled: boolean
|
||||
limit: {
|
||||
context: number
|
||||
input?: number
|
||||
output: number
|
||||
}
|
||||
}
|
||||
|
||||
export type EventCatalogModelUpdated = {
|
||||
id: string
|
||||
type: "catalog.model.updated"
|
||||
properties: {
|
||||
model: ModelV2Info
|
||||
}
|
||||
}
|
||||
|
||||
export type SessionInfo = {
|
||||
id: string
|
||||
parentID?: string
|
||||
projectID: string
|
||||
workspaceID?: string
|
||||
path?: string
|
||||
agent?: string
|
||||
model?: {
|
||||
id: string
|
||||
providerID: string
|
||||
variant: string
|
||||
}
|
||||
cost: number
|
||||
tokens: {
|
||||
input: number
|
||||
output: number
|
||||
reasoning: number
|
||||
cache: {
|
||||
read: number
|
||||
write: number
|
||||
}
|
||||
}
|
||||
time: {
|
||||
created: number
|
||||
updated: number
|
||||
archived?: number
|
||||
}
|
||||
title: string
|
||||
}
|
||||
|
||||
export type SessionDelivery = "immediate" | "deferred"
|
||||
|
||||
export type SessionMessageAgentSwitched = {
|
||||
id: string
|
||||
metadata?: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
time: {
|
||||
created: number
|
||||
}
|
||||
type: "agent-switched"
|
||||
agent: string
|
||||
}
|
||||
|
||||
export type SessionMessageModelSwitched = {
|
||||
id: string
|
||||
metadata?: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
time: {
|
||||
created: number
|
||||
}
|
||||
type: "model-switched"
|
||||
model: {
|
||||
id: string
|
||||
providerID: string
|
||||
variant: string
|
||||
}
|
||||
}
|
||||
|
||||
export type SessionMessageUser = {
|
||||
id: string
|
||||
metadata?: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
time: {
|
||||
created: number
|
||||
}
|
||||
text: string
|
||||
files?: Array<PromptFileAttachment>
|
||||
agents?: Array<PromptAgentAttachment>
|
||||
references?: Array<PromptReferenceAttachment>
|
||||
type: "user"
|
||||
}
|
||||
|
||||
export type SessionMessageSynthetic = {
|
||||
id: string
|
||||
metadata?: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
time: {
|
||||
created: number
|
||||
}
|
||||
sessionID: string
|
||||
text: string
|
||||
type: "synthetic"
|
||||
}
|
||||
|
||||
export type SessionMessageShell = {
|
||||
id: string
|
||||
metadata?: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
time: {
|
||||
created: number
|
||||
completed?: number
|
||||
}
|
||||
type: "shell"
|
||||
callID: string
|
||||
command: string
|
||||
output: string
|
||||
}
|
||||
|
||||
export type SessionMessageAssistantText = {
|
||||
type: "text"
|
||||
text: string
|
||||
}
|
||||
|
||||
export type SessionMessageAssistantReasoning = {
|
||||
type: "reasoning"
|
||||
id: string
|
||||
text: string
|
||||
}
|
||||
|
||||
export type SessionMessageToolStatePending = {
|
||||
status: "pending"
|
||||
input: string
|
||||
}
|
||||
|
||||
export type SessionMessageToolStateRunning = {
|
||||
status: "running"
|
||||
input: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
structured: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
content: Array<ToolTextContent | ToolFileContent>
|
||||
}
|
||||
|
||||
export type SessionMessageToolStateCompleted = {
|
||||
status: "completed"
|
||||
input: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
attachments?: Array<PromptFileAttachment>
|
||||
content: Array<ToolTextContent | ToolFileContent>
|
||||
structured: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
}
|
||||
|
||||
export type SessionMessageToolStateError = {
|
||||
status: "error"
|
||||
input: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
content: Array<ToolTextContent | ToolFileContent>
|
||||
structured: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
error: SessionErrorUnknown
|
||||
}
|
||||
|
||||
export type SessionMessageAssistantTool = {
|
||||
type: "tool"
|
||||
id: string
|
||||
name: string
|
||||
provider?: {
|
||||
executed: boolean
|
||||
metadata?: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
}
|
||||
state:
|
||||
| SessionMessageToolStatePending
|
||||
| SessionMessageToolStateRunning
|
||||
| SessionMessageToolStateCompleted
|
||||
| SessionMessageToolStateError
|
||||
time: {
|
||||
created: number
|
||||
ran?: number
|
||||
completed?: number
|
||||
pruned?: number
|
||||
}
|
||||
}
|
||||
|
||||
export type SessionMessageAssistant = {
|
||||
id: string
|
||||
metadata?: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
time: {
|
||||
created: number
|
||||
completed?: number
|
||||
}
|
||||
type: "assistant"
|
||||
agent: string
|
||||
model: {
|
||||
id: string
|
||||
providerID: string
|
||||
variant: string
|
||||
}
|
||||
content: Array<SessionMessageAssistantText | SessionMessageAssistantReasoning | SessionMessageAssistantTool>
|
||||
snapshot?: {
|
||||
start?: string
|
||||
end?: string
|
||||
}
|
||||
finish?: string
|
||||
cost?: number
|
||||
tokens?: {
|
||||
input: number
|
||||
output: number
|
||||
reasoning: number
|
||||
cache: {
|
||||
read: number
|
||||
write: number
|
||||
}
|
||||
}
|
||||
error?: SessionErrorUnknown
|
||||
}
|
||||
|
||||
export type SessionMessageCompaction = {
|
||||
type: "compaction"
|
||||
reason: "auto" | "manual"
|
||||
summary: string
|
||||
include?: string
|
||||
id: string
|
||||
metadata?: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
time: {
|
||||
created: number
|
||||
}
|
||||
}
|
||||
|
||||
export type SessionMessage =
|
||||
| SessionMessageAgentSwitched
|
||||
| SessionMessageModelSwitched
|
||||
| SessionMessageUser
|
||||
| SessionMessageSynthetic
|
||||
| SessionMessageShell
|
||||
| SessionMessageAssistant
|
||||
| SessionMessageCompaction
|
||||
|
||||
export type ProviderV2Info = {
|
||||
id: string
|
||||
name: string
|
||||
enabled:
|
||||
| false
|
||||
| {
|
||||
via: "env"
|
||||
name: string
|
||||
}
|
||||
| {
|
||||
via: "auth"
|
||||
service: string
|
||||
}
|
||||
| {
|
||||
via: "custom"
|
||||
data: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
}
|
||||
env: Array<string>
|
||||
endpoint:
|
||||
| {
|
||||
type: "unknown"
|
||||
}
|
||||
| {
|
||||
type: "openai/responses"
|
||||
url: string
|
||||
websocket?: boolean
|
||||
}
|
||||
| {
|
||||
type: "openai/completions"
|
||||
url: string
|
||||
reasoning?:
|
||||
| {
|
||||
type: "reasoning_content"
|
||||
}
|
||||
| {
|
||||
type: "reasoning_details"
|
||||
}
|
||||
}
|
||||
| {
|
||||
type: "anthropic/messages"
|
||||
url: string
|
||||
}
|
||||
| {
|
||||
type: "aisdk"
|
||||
package: string
|
||||
url?: string
|
||||
}
|
||||
options: {
|
||||
headers: {
|
||||
[key: string]: string
|
||||
}
|
||||
body: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
aisdk: {
|
||||
provider: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
request: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export type EventTuiToastShow1 = {
|
||||
id: string
|
||||
type: "tui.toast.show"
|
||||
properties: {
|
||||
title?: string
|
||||
message: string
|
||||
variant: "info" | "success" | "warning" | "error"
|
||||
duration?: number
|
||||
}
|
||||
}
|
||||
|
||||
export type ModelV2Info1 = {
|
||||
id: string
|
||||
apiID: string
|
||||
providerID: string
|
||||
family?: string
|
||||
name: string
|
||||
endpoint:
|
||||
| {
|
||||
type: "unknown"
|
||||
}
|
||||
| {
|
||||
type: "openai/responses"
|
||||
url: string
|
||||
websocket?: boolean
|
||||
}
|
||||
| {
|
||||
type: "openai/completions"
|
||||
url: string
|
||||
reasoning?:
|
||||
| {
|
||||
type: "reasoning_content"
|
||||
}
|
||||
| {
|
||||
type: "reasoning_details"
|
||||
}
|
||||
}
|
||||
| {
|
||||
type: "anthropic/messages"
|
||||
url: string
|
||||
}
|
||||
| {
|
||||
type: "aisdk"
|
||||
package: string
|
||||
url?: string
|
||||
}
|
||||
capabilities: {
|
||||
tools: boolean
|
||||
input: Array<string>
|
||||
output: Array<string>
|
||||
}
|
||||
options: {
|
||||
headers: {
|
||||
[key: string]: string
|
||||
}
|
||||
body: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
aisdk: {
|
||||
provider: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
request: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
}
|
||||
variant?: string
|
||||
}
|
||||
variants: Array<{
|
||||
id: string
|
||||
headers: {
|
||||
[key: string]: string
|
||||
}
|
||||
body: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
aisdk: {
|
||||
provider: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
request: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
}
|
||||
}>
|
||||
time: {
|
||||
released: number | "NaN" | "Infinity" | "-Infinity"
|
||||
}
|
||||
cost: Array<{
|
||||
tier?: {
|
||||
type: "context"
|
||||
size: number
|
||||
}
|
||||
input: number
|
||||
output: number
|
||||
cache: {
|
||||
read: number
|
||||
write: number
|
||||
}
|
||||
}>
|
||||
status: "alpha" | "beta" | "deprecated" | "active"
|
||||
enabled: boolean
|
||||
limit: {
|
||||
context: number
|
||||
input?: number
|
||||
output: number
|
||||
}
|
||||
}
|
||||
|
||||
export type BadRequestError = {
|
||||
name: "BadRequest"
|
||||
data: {
|
||||
message: string
|
||||
kind?: "Params" | "Headers" | "Query" | "Body" | "Payload"
|
||||
}
|
||||
}
|
||||
|
||||
export type AuthRemoveData = {
|
||||
body?: never
|
||||
path: {
|
||||
providerID: string
|
||||
}
|
||||
query?: never
|
||||
url: "/auth/{providerID}"
|
||||
}
|
||||
|
||||
export type AuthRemoveErrors = {
|
||||
/**
|
||||
* Bad request
|
||||
*/
|
||||
400: BadRequestError
|
||||
}
|
||||
|
||||
export type AuthRemoveError = AuthRemoveErrors[keyof AuthRemoveErrors]
|
||||
|
||||
export type AuthRemoveResponses = {
|
||||
/**
|
||||
* Successfully removed authentication credentials
|
||||
*/
|
||||
200: boolean
|
||||
}
|
||||
|
||||
export type AuthRemoveResponse = AuthRemoveResponses[keyof AuthRemoveResponses]
|
||||
|
||||
export type AuthSetData = {
|
||||
body?: Auth
|
||||
path: {
|
||||
providerID: string
|
||||
}
|
||||
query?: never
|
||||
url: "/auth/{providerID}"
|
||||
}
|
||||
|
||||
export type AuthSetErrors = {
|
||||
/**
|
||||
* Bad request
|
||||
*/
|
||||
400: BadRequestError
|
||||
}
|
||||
|
||||
export type AuthSetError = AuthSetErrors[keyof AuthSetErrors]
|
||||
|
||||
export type AuthSetResponses = {
|
||||
/**
|
||||
* Successfully set authentication credentials
|
||||
*/
|
||||
200: boolean
|
||||
}
|
||||
|
||||
export type AuthSetResponse = AuthSetResponses[keyof AuthSetResponses]
|
||||
|
||||
export type AppLogData = {
|
||||
body?: {
|
||||
/**
|
||||
* Service name for the log entry
|
||||
*/
|
||||
service: string
|
||||
/**
|
||||
* Log level
|
||||
*/
|
||||
level: "debug" | "info" | "error" | "warn"
|
||||
/**
|
||||
* Log message
|
||||
*/
|
||||
message: string
|
||||
extra?: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
}
|
||||
path?: never
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/log"
|
||||
}
|
||||
|
||||
export type AppLogErrors = {
|
||||
/**
|
||||
* Bad request
|
||||
*/
|
||||
400: BadRequestError
|
||||
}
|
||||
|
||||
export type AppLogError = AppLogErrors[keyof AppLogErrors]
|
||||
|
||||
export type AppLogResponses = {
|
||||
/**
|
||||
* Log entry written successfully
|
||||
*/
|
||||
200: boolean
|
||||
}
|
||||
|
||||
export type AppLogResponse = AppLogResponses[keyof AppLogResponses]
|
||||
|
||||
export type GlobalHealthData = {
|
||||
body?: never
|
||||
path?: never
|
||||
query?: never
|
||||
url: "/global/health"
|
||||
}
|
||||
|
||||
export type GlobalHealthResponses = {
|
||||
/**
|
||||
* Health information
|
||||
*/
|
||||
200: {
|
||||
healthy: true
|
||||
version: string
|
||||
}
|
||||
}
|
||||
|
||||
export type GlobalHealthResponse = GlobalHealthResponses[keyof GlobalHealthResponses]
|
||||
|
||||
export type GlobalEventData = {
|
||||
body?: never
|
||||
@@ -1695,222 +3807,123 @@ export type GlobalEventResponses = {
|
||||
|
||||
export type GlobalEventResponse = GlobalEventResponses[keyof GlobalEventResponses]
|
||||
|
||||
export type ProjectListData = {
|
||||
export type GlobalConfigGetData = {
|
||||
body?: never
|
||||
path?: never
|
||||
query?: {
|
||||
directory?: string
|
||||
}
|
||||
url: "/project"
|
||||
query?: never
|
||||
url: "/global/config"
|
||||
}
|
||||
|
||||
export type ProjectListResponses = {
|
||||
export type GlobalConfigGetResponses = {
|
||||
/**
|
||||
* List of projects
|
||||
* Get global config info
|
||||
*/
|
||||
200: Array<Project>
|
||||
200: Config
|
||||
}
|
||||
|
||||
export type ProjectListResponse = ProjectListResponses[keyof ProjectListResponses]
|
||||
export type GlobalConfigGetResponse = GlobalConfigGetResponses[keyof GlobalConfigGetResponses]
|
||||
|
||||
export type ProjectCurrentData = {
|
||||
body?: never
|
||||
export type GlobalConfigUpdateData = {
|
||||
body?: Config
|
||||
path?: never
|
||||
query?: {
|
||||
directory?: string
|
||||
}
|
||||
url: "/project/current"
|
||||
query?: never
|
||||
url: "/global/config"
|
||||
}
|
||||
|
||||
export type ProjectCurrentResponses = {
|
||||
/**
|
||||
* Current project
|
||||
*/
|
||||
200: Project
|
||||
}
|
||||
|
||||
export type ProjectCurrentResponse = ProjectCurrentResponses[keyof ProjectCurrentResponses]
|
||||
|
||||
export type PtyListData = {
|
||||
body?: never
|
||||
path?: never
|
||||
query?: {
|
||||
directory?: string
|
||||
}
|
||||
url: "/pty"
|
||||
}
|
||||
|
||||
export type PtyListResponses = {
|
||||
/**
|
||||
* List of sessions
|
||||
*/
|
||||
200: Array<Pty>
|
||||
}
|
||||
|
||||
export type PtyListResponse = PtyListResponses[keyof PtyListResponses]
|
||||
|
||||
export type PtyCreateData = {
|
||||
body?: {
|
||||
command?: string
|
||||
args?: Array<string>
|
||||
cwd?: string
|
||||
title?: string
|
||||
env?: {
|
||||
[key: string]: string
|
||||
}
|
||||
}
|
||||
path?: never
|
||||
query?: {
|
||||
directory?: string
|
||||
}
|
||||
url: "/pty"
|
||||
}
|
||||
|
||||
export type PtyCreateErrors = {
|
||||
export type GlobalConfigUpdateErrors = {
|
||||
/**
|
||||
* Bad request
|
||||
*/
|
||||
400: BadRequestError
|
||||
}
|
||||
|
||||
export type PtyCreateError = PtyCreateErrors[keyof PtyCreateErrors]
|
||||
export type GlobalConfigUpdateError = GlobalConfigUpdateErrors[keyof GlobalConfigUpdateErrors]
|
||||
|
||||
export type PtyCreateResponses = {
|
||||
export type GlobalConfigUpdateResponses = {
|
||||
/**
|
||||
* Created session
|
||||
* Successfully updated global config
|
||||
*/
|
||||
200: Pty
|
||||
200: Config
|
||||
}
|
||||
|
||||
export type PtyCreateResponse = PtyCreateResponses[keyof PtyCreateResponses]
|
||||
export type GlobalConfigUpdateResponse = GlobalConfigUpdateResponses[keyof GlobalConfigUpdateResponses]
|
||||
|
||||
export type PtyRemoveData = {
|
||||
export type GlobalDisposeData = {
|
||||
body?: never
|
||||
path: {
|
||||
id: string
|
||||
}
|
||||
query?: {
|
||||
directory?: string
|
||||
}
|
||||
url: "/pty/{id}"
|
||||
path?: never
|
||||
query?: never
|
||||
url: "/global/dispose"
|
||||
}
|
||||
|
||||
export type PtyRemoveErrors = {
|
||||
export type GlobalDisposeResponses = {
|
||||
/**
|
||||
* Not found
|
||||
*/
|
||||
404: NotFoundError
|
||||
}
|
||||
|
||||
export type PtyRemoveError = PtyRemoveErrors[keyof PtyRemoveErrors]
|
||||
|
||||
export type PtyRemoveResponses = {
|
||||
/**
|
||||
* Session removed
|
||||
* Global disposed
|
||||
*/
|
||||
200: boolean
|
||||
}
|
||||
|
||||
export type PtyRemoveResponse = PtyRemoveResponses[keyof PtyRemoveResponses]
|
||||
export type GlobalDisposeResponse = GlobalDisposeResponses[keyof GlobalDisposeResponses]
|
||||
|
||||
export type PtyGetData = {
|
||||
body?: never
|
||||
path: {
|
||||
id: string
|
||||
}
|
||||
query?: {
|
||||
directory?: string
|
||||
}
|
||||
url: "/pty/{id}"
|
||||
}
|
||||
|
||||
export type PtyGetErrors = {
|
||||
/**
|
||||
* Not found
|
||||
*/
|
||||
404: NotFoundError
|
||||
}
|
||||
|
||||
export type PtyGetError = PtyGetErrors[keyof PtyGetErrors]
|
||||
|
||||
export type PtyGetResponses = {
|
||||
/**
|
||||
* Session info
|
||||
*/
|
||||
200: Pty
|
||||
}
|
||||
|
||||
export type PtyGetResponse = PtyGetResponses[keyof PtyGetResponses]
|
||||
|
||||
export type PtyUpdateData = {
|
||||
export type GlobalUpgradeData = {
|
||||
body?: {
|
||||
title?: string
|
||||
size?: {
|
||||
rows: number
|
||||
cols: number
|
||||
}
|
||||
target?: string
|
||||
}
|
||||
path: {
|
||||
id: string
|
||||
}
|
||||
query?: {
|
||||
directory?: string
|
||||
}
|
||||
url: "/pty/{id}"
|
||||
path?: never
|
||||
query?: never
|
||||
url: "/global/upgrade"
|
||||
}
|
||||
|
||||
export type PtyUpdateErrors = {
|
||||
export type GlobalUpgradeErrors = {
|
||||
/**
|
||||
* Bad request
|
||||
*/
|
||||
400: BadRequestError
|
||||
}
|
||||
|
||||
export type PtyUpdateError = PtyUpdateErrors[keyof PtyUpdateErrors]
|
||||
export type GlobalUpgradeError = GlobalUpgradeErrors[keyof GlobalUpgradeErrors]
|
||||
|
||||
export type PtyUpdateResponses = {
|
||||
export type GlobalUpgradeResponses = {
|
||||
/**
|
||||
* Updated session
|
||||
* Upgrade result
|
||||
*/
|
||||
200: Pty
|
||||
200:
|
||||
| {
|
||||
success: true
|
||||
version: string
|
||||
}
|
||||
| {
|
||||
success: false
|
||||
error: string
|
||||
}
|
||||
}
|
||||
|
||||
export type PtyUpdateResponse = PtyUpdateResponses[keyof PtyUpdateResponses]
|
||||
export type GlobalUpgradeResponse = GlobalUpgradeResponses[keyof GlobalUpgradeResponses]
|
||||
|
||||
export type PtyConnectData = {
|
||||
export type EventSubscribeData = {
|
||||
body?: never
|
||||
path: {
|
||||
id: string
|
||||
}
|
||||
path?: never
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/pty/{id}/connect"
|
||||
url: "/event"
|
||||
}
|
||||
|
||||
export type PtyConnectErrors = {
|
||||
export type EventSubscribeResponses = {
|
||||
/**
|
||||
* Not found
|
||||
* Event stream
|
||||
*/
|
||||
404: NotFoundError
|
||||
200: Event
|
||||
}
|
||||
|
||||
export type PtyConnectError = PtyConnectErrors[keyof PtyConnectErrors]
|
||||
|
||||
export type PtyConnectResponses = {
|
||||
/**
|
||||
* Connected session
|
||||
*/
|
||||
200: boolean
|
||||
}
|
||||
|
||||
export type PtyConnectResponse = PtyConnectResponses[keyof PtyConnectResponses]
|
||||
export type EventSubscribeResponse = EventSubscribeResponses[keyof EventSubscribeResponses]
|
||||
|
||||
export type ConfigGetData = {
|
||||
body?: never
|
||||
path?: never
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/config"
|
||||
}
|
||||
@@ -1929,6 +3942,7 @@ export type ConfigUpdateData = {
|
||||
path?: never
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/config"
|
||||
}
|
||||
@@ -1951,38 +3965,126 @@ export type ConfigUpdateResponses = {
|
||||
|
||||
export type ConfigUpdateResponse = ConfigUpdateResponses[keyof ConfigUpdateResponses]
|
||||
|
||||
export type ToolIdsData = {
|
||||
export type ConfigProvidersData = {
|
||||
body?: never
|
||||
path?: never
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/experimental/tool/ids"
|
||||
url: "/config/providers"
|
||||
}
|
||||
|
||||
export type ToolIdsErrors = {
|
||||
export type ConfigProvidersResponses = {
|
||||
/**
|
||||
* Bad request
|
||||
* List of providers
|
||||
*/
|
||||
400: BadRequestError
|
||||
200: {
|
||||
providers: Array<Provider>
|
||||
default: {
|
||||
[key: string]: string
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export type ToolIdsError = ToolIdsErrors[keyof ToolIdsErrors]
|
||||
export type ConfigProvidersResponse = ConfigProvidersResponses[keyof ConfigProvidersResponses]
|
||||
|
||||
export type ToolIdsResponses = {
|
||||
export type ExperimentalConsoleGetData = {
|
||||
body?: never
|
||||
path?: never
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/experimental/console"
|
||||
}
|
||||
|
||||
export type ExperimentalConsoleGetErrors = {
|
||||
/**
|
||||
* Tool IDs
|
||||
* InternalServerError
|
||||
*/
|
||||
200: ToolIds
|
||||
500: EffectHttpApiErrorInternalServerError
|
||||
}
|
||||
|
||||
export type ToolIdsResponse = ToolIdsResponses[keyof ToolIdsResponses]
|
||||
export type ExperimentalConsoleGetError = ExperimentalConsoleGetErrors[keyof ExperimentalConsoleGetErrors]
|
||||
|
||||
export type ExperimentalConsoleGetResponses = {
|
||||
/**
|
||||
* Active Console provider metadata
|
||||
*/
|
||||
200: ConsoleState
|
||||
}
|
||||
|
||||
export type ExperimentalConsoleGetResponse = ExperimentalConsoleGetResponses[keyof ExperimentalConsoleGetResponses]
|
||||
|
||||
export type ExperimentalConsoleListOrgsData = {
|
||||
body?: never
|
||||
path?: never
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/experimental/console/orgs"
|
||||
}
|
||||
|
||||
export type ExperimentalConsoleListOrgsErrors = {
|
||||
/**
|
||||
* InternalServerError
|
||||
*/
|
||||
500: EffectHttpApiErrorInternalServerError
|
||||
}
|
||||
|
||||
export type ExperimentalConsoleListOrgsError =
|
||||
ExperimentalConsoleListOrgsErrors[keyof ExperimentalConsoleListOrgsErrors]
|
||||
|
||||
export type ExperimentalConsoleListOrgsResponses = {
|
||||
/**
|
||||
* Switchable Console orgs
|
||||
*/
|
||||
200: {
|
||||
orgs: Array<{
|
||||
accountID: string
|
||||
accountEmail: string
|
||||
accountUrl: string
|
||||
orgID: string
|
||||
orgName: string
|
||||
active: boolean
|
||||
}>
|
||||
}
|
||||
}
|
||||
|
||||
export type ExperimentalConsoleListOrgsResponse =
|
||||
ExperimentalConsoleListOrgsResponses[keyof ExperimentalConsoleListOrgsResponses]
|
||||
|
||||
export type ExperimentalConsoleSwitchOrgData = {
|
||||
body?: {
|
||||
accountID: string
|
||||
orgID: string
|
||||
}
|
||||
path?: never
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/experimental/console/switch"
|
||||
}
|
||||
|
||||
export type ExperimentalConsoleSwitchOrgResponses = {
|
||||
/**
|
||||
* Switch success
|
||||
*/
|
||||
200: boolean
|
||||
}
|
||||
|
||||
export type ExperimentalConsoleSwitchOrgResponse =
|
||||
ExperimentalConsoleSwitchOrgResponses[keyof ExperimentalConsoleSwitchOrgResponses]
|
||||
|
||||
export type ToolListData = {
|
||||
body?: never
|
||||
path?: never
|
||||
query: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
provider: string
|
||||
model: string
|
||||
}
|
||||
@@ -2007,1139 +4109,199 @@ export type ToolListResponses = {
|
||||
|
||||
export type ToolListResponse = ToolListResponses[keyof ToolListResponses]
|
||||
|
||||
export type InstanceDisposeData = {
|
||||
export type ToolIdsData = {
|
||||
body?: never
|
||||
path?: never
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/instance/dispose"
|
||||
url: "/experimental/tool/ids"
|
||||
}
|
||||
|
||||
export type InstanceDisposeResponses = {
|
||||
export type ToolIdsErrors = {
|
||||
/**
|
||||
* Instance disposed
|
||||
* Bad request
|
||||
*/
|
||||
400: BadRequestError
|
||||
}
|
||||
|
||||
export type ToolIdsError = ToolIdsErrors[keyof ToolIdsErrors]
|
||||
|
||||
export type ToolIdsResponses = {
|
||||
/**
|
||||
* Tool IDs
|
||||
*/
|
||||
200: ToolIds
|
||||
}
|
||||
|
||||
export type ToolIdsResponse = ToolIdsResponses[keyof ToolIdsResponses]
|
||||
|
||||
export type WorktreeRemoveData = {
|
||||
body?: WorktreeRemoveInput
|
||||
path?: never
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/experimental/worktree"
|
||||
}
|
||||
|
||||
export type WorktreeRemoveErrors = {
|
||||
/**
|
||||
* WorktreeError
|
||||
*/
|
||||
400: WorktreeError
|
||||
}
|
||||
|
||||
export type WorktreeRemoveError = WorktreeRemoveErrors[keyof WorktreeRemoveErrors]
|
||||
|
||||
export type WorktreeRemoveResponses = {
|
||||
/**
|
||||
* Worktree removed
|
||||
*/
|
||||
200: boolean
|
||||
}
|
||||
|
||||
export type InstanceDisposeResponse = InstanceDisposeResponses[keyof InstanceDisposeResponses]
|
||||
export type WorktreeRemoveResponse = WorktreeRemoveResponses[keyof WorktreeRemoveResponses]
|
||||
|
||||
export type PathGetData = {
|
||||
export type WorktreeListData = {
|
||||
body?: never
|
||||
path?: never
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/path"
|
||||
url: "/experimental/worktree"
|
||||
}
|
||||
|
||||
export type PathGetResponses = {
|
||||
export type WorktreeListErrors = {
|
||||
/**
|
||||
* Path
|
||||
* WorktreeError
|
||||
*/
|
||||
200: Path
|
||||
400: WorktreeError
|
||||
}
|
||||
|
||||
export type PathGetResponse = PathGetResponses[keyof PathGetResponses]
|
||||
export type WorktreeListError = WorktreeListErrors[keyof WorktreeListErrors]
|
||||
|
||||
export type VcsGetData = {
|
||||
body?: never
|
||||
path?: never
|
||||
query?: {
|
||||
directory?: string
|
||||
}
|
||||
url: "/vcs"
|
||||
}
|
||||
|
||||
export type VcsGetResponses = {
|
||||
export type WorktreeListResponses = {
|
||||
/**
|
||||
* VCS info
|
||||
* List of worktree directories
|
||||
*/
|
||||
200: VcsInfo
|
||||
200: Array<string>
|
||||
}
|
||||
|
||||
export type VcsGetResponse = VcsGetResponses[keyof VcsGetResponses]
|
||||
export type WorktreeListResponse = WorktreeListResponses[keyof WorktreeListResponses]
|
||||
|
||||
export type SessionListData = {
|
||||
export type WorktreeCreateData = {
|
||||
body?: WorktreeCreateInput
|
||||
path?: never
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/experimental/worktree"
|
||||
}
|
||||
|
||||
export type WorktreeCreateErrors = {
|
||||
/**
|
||||
* WorktreeError
|
||||
*/
|
||||
400: WorktreeError
|
||||
}
|
||||
|
||||
export type WorktreeCreateError = WorktreeCreateErrors[keyof WorktreeCreateErrors]
|
||||
|
||||
export type WorktreeCreateResponses = {
|
||||
/**
|
||||
* Worktree created
|
||||
*/
|
||||
200: Worktree
|
||||
}
|
||||
|
||||
export type WorktreeCreateResponse = WorktreeCreateResponses[keyof WorktreeCreateResponses]
|
||||
|
||||
export type WorktreeResetData = {
|
||||
body?: WorktreeResetInput
|
||||
path?: never
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/experimental/worktree/reset"
|
||||
}
|
||||
|
||||
export type WorktreeResetErrors = {
|
||||
/**
|
||||
* WorktreeError
|
||||
*/
|
||||
400: WorktreeError
|
||||
}
|
||||
|
||||
export type WorktreeResetError = WorktreeResetErrors[keyof WorktreeResetErrors]
|
||||
|
||||
export type WorktreeResetResponses = {
|
||||
/**
|
||||
* Worktree reset
|
||||
*/
|
||||
200: boolean
|
||||
}
|
||||
|
||||
export type WorktreeResetResponse = WorktreeResetResponses[keyof WorktreeResetResponses]
|
||||
|
||||
export type ExperimentalSessionListData = {
|
||||
body?: never
|
||||
path?: never
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
roots?: boolean | "true" | "false"
|
||||
start?: number
|
||||
cursor?: number
|
||||
search?: string
|
||||
limit?: number
|
||||
archived?: boolean | "true" | "false"
|
||||
}
|
||||
url: "/session"
|
||||
url: "/experimental/session"
|
||||
}
|
||||
|
||||
export type SessionListResponses = {
|
||||
export type ExperimentalSessionListResponses = {
|
||||
/**
|
||||
* List of sessions
|
||||
*/
|
||||
200: Array<Session>
|
||||
200: Array<GlobalSession>
|
||||
}
|
||||
|
||||
export type SessionListResponse = SessionListResponses[keyof SessionListResponses]
|
||||
export type ExperimentalSessionListResponse = ExperimentalSessionListResponses[keyof ExperimentalSessionListResponses]
|
||||
|
||||
export type SessionCreateData = {
|
||||
body?: {
|
||||
parentID?: string
|
||||
title?: string
|
||||
}
|
||||
path?: never
|
||||
query?: {
|
||||
directory?: string
|
||||
}
|
||||
url: "/session"
|
||||
}
|
||||
|
||||
export type SessionCreateErrors = {
|
||||
/**
|
||||
* Bad request
|
||||
*/
|
||||
400: BadRequestError
|
||||
}
|
||||
|
||||
export type SessionCreateError = SessionCreateErrors[keyof SessionCreateErrors]
|
||||
|
||||
export type SessionCreateResponses = {
|
||||
/**
|
||||
* Successfully created session
|
||||
*/
|
||||
200: Session
|
||||
}
|
||||
|
||||
export type SessionCreateResponse = SessionCreateResponses[keyof SessionCreateResponses]
|
||||
|
||||
export type SessionStatusData = {
|
||||
export type ExperimentalResourceListData = {
|
||||
body?: never
|
||||
path?: never
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/session/status"
|
||||
url: "/experimental/resource"
|
||||
}
|
||||
|
||||
export type SessionStatusErrors = {
|
||||
export type ExperimentalResourceListResponses = {
|
||||
/**
|
||||
* Bad request
|
||||
*/
|
||||
400: BadRequestError
|
||||
}
|
||||
|
||||
export type SessionStatusError = SessionStatusErrors[keyof SessionStatusErrors]
|
||||
|
||||
export type SessionStatusResponses = {
|
||||
/**
|
||||
* Get session status
|
||||
* MCP resources
|
||||
*/
|
||||
200: {
|
||||
[key: string]: SessionStatus
|
||||
[key: string]: McpResource
|
||||
}
|
||||
}
|
||||
|
||||
export type SessionStatusResponse = SessionStatusResponses[keyof SessionStatusResponses]
|
||||
|
||||
export type SessionDeleteData = {
|
||||
body?: never
|
||||
path: {
|
||||
id: string
|
||||
}
|
||||
query?: {
|
||||
directory?: string
|
||||
}
|
||||
url: "/session/{id}"
|
||||
}
|
||||
|
||||
export type SessionDeleteErrors = {
|
||||
/**
|
||||
* Bad request
|
||||
*/
|
||||
400: BadRequestError
|
||||
/**
|
||||
* Not found
|
||||
*/
|
||||
404: NotFoundError
|
||||
}
|
||||
|
||||
export type SessionDeleteError = SessionDeleteErrors[keyof SessionDeleteErrors]
|
||||
|
||||
export type SessionDeleteResponses = {
|
||||
/**
|
||||
* Successfully deleted session
|
||||
*/
|
||||
200: boolean
|
||||
}
|
||||
|
||||
export type SessionDeleteResponse = SessionDeleteResponses[keyof SessionDeleteResponses]
|
||||
|
||||
export type SessionGetData = {
|
||||
body?: never
|
||||
path: {
|
||||
id: string
|
||||
}
|
||||
query?: {
|
||||
directory?: string
|
||||
}
|
||||
url: "/session/{id}"
|
||||
}
|
||||
|
||||
export type SessionGetErrors = {
|
||||
/**
|
||||
* Bad request
|
||||
*/
|
||||
400: BadRequestError
|
||||
/**
|
||||
* Not found
|
||||
*/
|
||||
404: NotFoundError
|
||||
}
|
||||
|
||||
export type SessionGetError = SessionGetErrors[keyof SessionGetErrors]
|
||||
|
||||
export type SessionGetResponses = {
|
||||
/**
|
||||
* Get session
|
||||
*/
|
||||
200: Session
|
||||
}
|
||||
|
||||
export type SessionGetResponse = SessionGetResponses[keyof SessionGetResponses]
|
||||
|
||||
export type SessionUpdateData = {
|
||||
body?: {
|
||||
title?: string
|
||||
}
|
||||
path: {
|
||||
id: string
|
||||
}
|
||||
query?: {
|
||||
directory?: string
|
||||
}
|
||||
url: "/session/{id}"
|
||||
}
|
||||
|
||||
export type SessionUpdateErrors = {
|
||||
/**
|
||||
* Bad request
|
||||
*/
|
||||
400: BadRequestError
|
||||
/**
|
||||
* Not found
|
||||
*/
|
||||
404: NotFoundError
|
||||
}
|
||||
|
||||
export type SessionUpdateError = SessionUpdateErrors[keyof SessionUpdateErrors]
|
||||
|
||||
export type SessionUpdateResponses = {
|
||||
/**
|
||||
* Successfully updated session
|
||||
*/
|
||||
200: Session
|
||||
}
|
||||
|
||||
export type SessionUpdateResponse = SessionUpdateResponses[keyof SessionUpdateResponses]
|
||||
|
||||
export type SessionChildrenData = {
|
||||
body?: never
|
||||
path: {
|
||||
id: string
|
||||
}
|
||||
query?: {
|
||||
directory?: string
|
||||
}
|
||||
url: "/session/{id}/children"
|
||||
}
|
||||
|
||||
export type SessionChildrenErrors = {
|
||||
/**
|
||||
* Bad request
|
||||
*/
|
||||
400: BadRequestError
|
||||
/**
|
||||
* Not found
|
||||
*/
|
||||
404: NotFoundError
|
||||
}
|
||||
|
||||
export type SessionChildrenError = SessionChildrenErrors[keyof SessionChildrenErrors]
|
||||
|
||||
export type SessionChildrenResponses = {
|
||||
/**
|
||||
* List of children
|
||||
*/
|
||||
200: Array<Session>
|
||||
}
|
||||
|
||||
export type SessionChildrenResponse = SessionChildrenResponses[keyof SessionChildrenResponses]
|
||||
|
||||
export type SessionTodoData = {
|
||||
body?: never
|
||||
path: {
|
||||
/**
|
||||
* Session ID
|
||||
*/
|
||||
id: string
|
||||
}
|
||||
query?: {
|
||||
directory?: string
|
||||
}
|
||||
url: "/session/{id}/todo"
|
||||
}
|
||||
|
||||
export type SessionTodoErrors = {
|
||||
/**
|
||||
* Bad request
|
||||
*/
|
||||
400: BadRequestError
|
||||
/**
|
||||
* Not found
|
||||
*/
|
||||
404: NotFoundError
|
||||
}
|
||||
|
||||
export type SessionTodoError = SessionTodoErrors[keyof SessionTodoErrors]
|
||||
|
||||
export type SessionTodoResponses = {
|
||||
/**
|
||||
* Todo list
|
||||
*/
|
||||
200: Array<Todo>
|
||||
}
|
||||
|
||||
export type SessionTodoResponse = SessionTodoResponses[keyof SessionTodoResponses]
|
||||
|
||||
export type SessionInitData = {
|
||||
body?: {
|
||||
modelID: string
|
||||
providerID: string
|
||||
messageID: string
|
||||
}
|
||||
path: {
|
||||
/**
|
||||
* Session ID
|
||||
*/
|
||||
id: string
|
||||
}
|
||||
query?: {
|
||||
directory?: string
|
||||
}
|
||||
url: "/session/{id}/init"
|
||||
}
|
||||
|
||||
export type SessionInitErrors = {
|
||||
/**
|
||||
* Bad request
|
||||
*/
|
||||
400: BadRequestError
|
||||
/**
|
||||
* Not found
|
||||
*/
|
||||
404: NotFoundError
|
||||
}
|
||||
|
||||
export type SessionInitError = SessionInitErrors[keyof SessionInitErrors]
|
||||
|
||||
export type SessionInitResponses = {
|
||||
/**
|
||||
* 200
|
||||
*/
|
||||
200: boolean
|
||||
}
|
||||
|
||||
export type SessionInitResponse = SessionInitResponses[keyof SessionInitResponses]
|
||||
|
||||
export type SessionForkData = {
|
||||
body?: {
|
||||
messageID?: string
|
||||
}
|
||||
path: {
|
||||
id: string
|
||||
}
|
||||
query?: {
|
||||
directory?: string
|
||||
}
|
||||
url: "/session/{id}/fork"
|
||||
}
|
||||
|
||||
export type SessionForkResponses = {
|
||||
/**
|
||||
* 200
|
||||
*/
|
||||
200: Session
|
||||
}
|
||||
|
||||
export type SessionForkResponse = SessionForkResponses[keyof SessionForkResponses]
|
||||
|
||||
export type SessionAbortData = {
|
||||
body?: never
|
||||
path: {
|
||||
id: string
|
||||
}
|
||||
query?: {
|
||||
directory?: string
|
||||
}
|
||||
url: "/session/{id}/abort"
|
||||
}
|
||||
|
||||
export type SessionAbortErrors = {
|
||||
/**
|
||||
* Bad request
|
||||
*/
|
||||
400: BadRequestError
|
||||
/**
|
||||
* Not found
|
||||
*/
|
||||
404: NotFoundError
|
||||
}
|
||||
|
||||
export type SessionAbortError = SessionAbortErrors[keyof SessionAbortErrors]
|
||||
|
||||
export type SessionAbortResponses = {
|
||||
/**
|
||||
* Aborted session
|
||||
*/
|
||||
200: boolean
|
||||
}
|
||||
|
||||
export type SessionAbortResponse = SessionAbortResponses[keyof SessionAbortResponses]
|
||||
|
||||
export type SessionUnshareData = {
|
||||
body?: never
|
||||
path: {
|
||||
id: string
|
||||
}
|
||||
query?: {
|
||||
directory?: string
|
||||
}
|
||||
url: "/session/{id}/share"
|
||||
}
|
||||
|
||||
export type SessionUnshareErrors = {
|
||||
/**
|
||||
* Bad request
|
||||
*/
|
||||
400: BadRequestError
|
||||
/**
|
||||
* Not found
|
||||
*/
|
||||
404: NotFoundError
|
||||
}
|
||||
|
||||
export type SessionUnshareError = SessionUnshareErrors[keyof SessionUnshareErrors]
|
||||
|
||||
export type SessionUnshareResponses = {
|
||||
/**
|
||||
* Successfully unshared session
|
||||
*/
|
||||
200: Session
|
||||
}
|
||||
|
||||
export type SessionUnshareResponse = SessionUnshareResponses[keyof SessionUnshareResponses]
|
||||
|
||||
export type SessionShareData = {
|
||||
body?: never
|
||||
path: {
|
||||
id: string
|
||||
}
|
||||
query?: {
|
||||
directory?: string
|
||||
}
|
||||
url: "/session/{id}/share"
|
||||
}
|
||||
|
||||
export type SessionShareErrors = {
|
||||
/**
|
||||
* Bad request
|
||||
*/
|
||||
400: BadRequestError
|
||||
/**
|
||||
* Not found
|
||||
*/
|
||||
404: NotFoundError
|
||||
}
|
||||
|
||||
export type SessionShareError = SessionShareErrors[keyof SessionShareErrors]
|
||||
|
||||
export type SessionShareResponses = {
|
||||
/**
|
||||
* Successfully shared session
|
||||
*/
|
||||
200: Session
|
||||
}
|
||||
|
||||
export type SessionShareResponse = SessionShareResponses[keyof SessionShareResponses]
|
||||
|
||||
export type SessionDiffData = {
|
||||
body?: never
|
||||
path: {
|
||||
/**
|
||||
* Session ID
|
||||
*/
|
||||
id: string
|
||||
}
|
||||
query?: {
|
||||
directory?: string
|
||||
messageID?: string
|
||||
}
|
||||
url: "/session/{id}/diff"
|
||||
}
|
||||
|
||||
export type SessionDiffErrors = {
|
||||
/**
|
||||
* Bad request
|
||||
*/
|
||||
400: BadRequestError
|
||||
/**
|
||||
* Not found
|
||||
*/
|
||||
404: NotFoundError
|
||||
}
|
||||
|
||||
export type SessionDiffError = SessionDiffErrors[keyof SessionDiffErrors]
|
||||
|
||||
export type SessionDiffResponses = {
|
||||
/**
|
||||
* List of diffs
|
||||
*/
|
||||
200: Array<FileDiff>
|
||||
}
|
||||
|
||||
export type SessionDiffResponse = SessionDiffResponses[keyof SessionDiffResponses]
|
||||
|
||||
export type SessionSummarizeData = {
|
||||
body?: {
|
||||
providerID: string
|
||||
modelID: string
|
||||
}
|
||||
path: {
|
||||
/**
|
||||
* Session ID
|
||||
*/
|
||||
id: string
|
||||
}
|
||||
query?: {
|
||||
directory?: string
|
||||
}
|
||||
url: "/session/{id}/summarize"
|
||||
}
|
||||
|
||||
export type SessionSummarizeErrors = {
|
||||
/**
|
||||
* Bad request
|
||||
*/
|
||||
400: BadRequestError
|
||||
/**
|
||||
* Not found
|
||||
*/
|
||||
404: NotFoundError
|
||||
}
|
||||
|
||||
export type SessionSummarizeError = SessionSummarizeErrors[keyof SessionSummarizeErrors]
|
||||
|
||||
export type SessionSummarizeResponses = {
|
||||
/**
|
||||
* Summarized session
|
||||
*/
|
||||
200: boolean
|
||||
}
|
||||
|
||||
export type SessionSummarizeResponse = SessionSummarizeResponses[keyof SessionSummarizeResponses]
|
||||
|
||||
export type SessionMessagesData = {
|
||||
body?: never
|
||||
path: {
|
||||
/**
|
||||
* Session ID
|
||||
*/
|
||||
id: string
|
||||
}
|
||||
query?: {
|
||||
directory?: string
|
||||
limit?: number
|
||||
}
|
||||
url: "/session/{id}/message"
|
||||
}
|
||||
|
||||
export type SessionMessagesErrors = {
|
||||
/**
|
||||
* Bad request
|
||||
*/
|
||||
400: BadRequestError
|
||||
/**
|
||||
* Not found
|
||||
*/
|
||||
404: NotFoundError
|
||||
}
|
||||
|
||||
export type SessionMessagesError = SessionMessagesErrors[keyof SessionMessagesErrors]
|
||||
|
||||
export type SessionMessagesResponses = {
|
||||
/**
|
||||
* List of messages
|
||||
*/
|
||||
200: Array<{
|
||||
info: Message
|
||||
parts: Array<Part>
|
||||
}>
|
||||
}
|
||||
|
||||
export type SessionMessagesResponse = SessionMessagesResponses[keyof SessionMessagesResponses]
|
||||
|
||||
export type SessionPromptData = {
|
||||
body?: {
|
||||
messageID?: string
|
||||
model?: {
|
||||
providerID: string
|
||||
modelID: string
|
||||
}
|
||||
agent?: string
|
||||
noReply?: boolean
|
||||
system?: string
|
||||
tools?: {
|
||||
[key: string]: boolean
|
||||
}
|
||||
parts: Array<TextPartInput | FilePartInput | AgentPartInput | SubtaskPartInput>
|
||||
}
|
||||
path: {
|
||||
/**
|
||||
* Session ID
|
||||
*/
|
||||
id: string
|
||||
}
|
||||
query?: {
|
||||
directory?: string
|
||||
}
|
||||
url: "/session/{id}/message"
|
||||
}
|
||||
|
||||
export type SessionPromptErrors = {
|
||||
/**
|
||||
* Bad request
|
||||
*/
|
||||
400: BadRequestError
|
||||
/**
|
||||
* Not found
|
||||
*/
|
||||
404: NotFoundError
|
||||
}
|
||||
|
||||
export type SessionPromptError = SessionPromptErrors[keyof SessionPromptErrors]
|
||||
|
||||
export type SessionPromptResponses = {
|
||||
/**
|
||||
* Created message
|
||||
*/
|
||||
200: {
|
||||
info: AssistantMessage
|
||||
parts: Array<Part>
|
||||
}
|
||||
}
|
||||
|
||||
export type SessionPromptResponse = SessionPromptResponses[keyof SessionPromptResponses]
|
||||
|
||||
export type SessionMessageData = {
|
||||
body?: never
|
||||
path: {
|
||||
/**
|
||||
* Session ID
|
||||
*/
|
||||
id: string
|
||||
/**
|
||||
* Message ID
|
||||
*/
|
||||
messageID: string
|
||||
}
|
||||
query?: {
|
||||
directory?: string
|
||||
}
|
||||
url: "/session/{id}/message/{messageID}"
|
||||
}
|
||||
|
||||
export type SessionMessageErrors = {
|
||||
/**
|
||||
* Bad request
|
||||
*/
|
||||
400: BadRequestError
|
||||
/**
|
||||
* Not found
|
||||
*/
|
||||
404: NotFoundError
|
||||
}
|
||||
|
||||
export type SessionMessageError = SessionMessageErrors[keyof SessionMessageErrors]
|
||||
|
||||
export type SessionMessageResponses = {
|
||||
/**
|
||||
* Message
|
||||
*/
|
||||
200: {
|
||||
info: Message
|
||||
parts: Array<Part>
|
||||
}
|
||||
}
|
||||
|
||||
export type SessionMessageResponse = SessionMessageResponses[keyof SessionMessageResponses]
|
||||
|
||||
export type SessionPromptAsyncData = {
|
||||
body?: {
|
||||
messageID?: string
|
||||
model?: {
|
||||
providerID: string
|
||||
modelID: string
|
||||
}
|
||||
agent?: string
|
||||
noReply?: boolean
|
||||
system?: string
|
||||
tools?: {
|
||||
[key: string]: boolean
|
||||
}
|
||||
parts: Array<TextPartInput | FilePartInput | AgentPartInput | SubtaskPartInput>
|
||||
}
|
||||
path: {
|
||||
/**
|
||||
* Session ID
|
||||
*/
|
||||
id: string
|
||||
}
|
||||
query?: {
|
||||
directory?: string
|
||||
}
|
||||
url: "/session/{id}/prompt_async"
|
||||
}
|
||||
|
||||
export type SessionPromptAsyncErrors = {
|
||||
/**
|
||||
* Bad request
|
||||
*/
|
||||
400: BadRequestError
|
||||
/**
|
||||
* Not found
|
||||
*/
|
||||
404: NotFoundError
|
||||
}
|
||||
|
||||
export type SessionPromptAsyncError = SessionPromptAsyncErrors[keyof SessionPromptAsyncErrors]
|
||||
|
||||
export type SessionPromptAsyncResponses = {
|
||||
/**
|
||||
* Prompt accepted
|
||||
*/
|
||||
204: void
|
||||
}
|
||||
|
||||
export type SessionPromptAsyncResponse = SessionPromptAsyncResponses[keyof SessionPromptAsyncResponses]
|
||||
|
||||
export type SessionCommandData = {
|
||||
body?: {
|
||||
messageID?: string
|
||||
agent?: string
|
||||
model?: string
|
||||
arguments: string
|
||||
command: string
|
||||
}
|
||||
path: {
|
||||
/**
|
||||
* Session ID
|
||||
*/
|
||||
id: string
|
||||
}
|
||||
query?: {
|
||||
directory?: string
|
||||
}
|
||||
url: "/session/{id}/command"
|
||||
}
|
||||
|
||||
export type SessionCommandErrors = {
|
||||
/**
|
||||
* Bad request
|
||||
*/
|
||||
400: BadRequestError
|
||||
/**
|
||||
* Not found
|
||||
*/
|
||||
404: NotFoundError
|
||||
}
|
||||
|
||||
export type SessionCommandError = SessionCommandErrors[keyof SessionCommandErrors]
|
||||
|
||||
export type SessionCommandResponses = {
|
||||
/**
|
||||
* Created message
|
||||
*/
|
||||
200: {
|
||||
info: AssistantMessage
|
||||
parts: Array<Part>
|
||||
}
|
||||
}
|
||||
|
||||
export type SessionCommandResponse = SessionCommandResponses[keyof SessionCommandResponses]
|
||||
|
||||
export type SessionShellData = {
|
||||
body?: {
|
||||
agent: string
|
||||
model?: {
|
||||
providerID: string
|
||||
modelID: string
|
||||
}
|
||||
command: string
|
||||
}
|
||||
path: {
|
||||
/**
|
||||
* Session ID
|
||||
*/
|
||||
id: string
|
||||
}
|
||||
query?: {
|
||||
directory?: string
|
||||
}
|
||||
url: "/session/{id}/shell"
|
||||
}
|
||||
|
||||
export type SessionShellErrors = {
|
||||
/**
|
||||
* Bad request
|
||||
*/
|
||||
400: BadRequestError
|
||||
/**
|
||||
* Not found
|
||||
*/
|
||||
404: NotFoundError
|
||||
}
|
||||
|
||||
export type SessionShellError = SessionShellErrors[keyof SessionShellErrors]
|
||||
|
||||
export type SessionShellResponses = {
|
||||
/**
|
||||
* Created message
|
||||
*/
|
||||
200: AssistantMessage
|
||||
}
|
||||
|
||||
export type SessionShellResponse = SessionShellResponses[keyof SessionShellResponses]
|
||||
|
||||
export type SessionRevertData = {
|
||||
body?: {
|
||||
messageID: string
|
||||
partID?: string
|
||||
}
|
||||
path: {
|
||||
id: string
|
||||
}
|
||||
query?: {
|
||||
directory?: string
|
||||
}
|
||||
url: "/session/{id}/revert"
|
||||
}
|
||||
|
||||
export type SessionRevertErrors = {
|
||||
/**
|
||||
* Bad request
|
||||
*/
|
||||
400: BadRequestError
|
||||
/**
|
||||
* Not found
|
||||
*/
|
||||
404: NotFoundError
|
||||
}
|
||||
|
||||
export type SessionRevertError = SessionRevertErrors[keyof SessionRevertErrors]
|
||||
|
||||
export type SessionRevertResponses = {
|
||||
/**
|
||||
* Updated session
|
||||
*/
|
||||
200: Session
|
||||
}
|
||||
|
||||
export type SessionRevertResponse = SessionRevertResponses[keyof SessionRevertResponses]
|
||||
|
||||
export type SessionUnrevertData = {
|
||||
body?: never
|
||||
path: {
|
||||
id: string
|
||||
}
|
||||
query?: {
|
||||
directory?: string
|
||||
}
|
||||
url: "/session/{id}/unrevert"
|
||||
}
|
||||
|
||||
export type SessionUnrevertErrors = {
|
||||
/**
|
||||
* Bad request
|
||||
*/
|
||||
400: BadRequestError
|
||||
/**
|
||||
* Not found
|
||||
*/
|
||||
404: NotFoundError
|
||||
}
|
||||
|
||||
export type SessionUnrevertError = SessionUnrevertErrors[keyof SessionUnrevertErrors]
|
||||
|
||||
export type SessionUnrevertResponses = {
|
||||
/**
|
||||
* Updated session
|
||||
*/
|
||||
200: Session
|
||||
}
|
||||
|
||||
export type SessionUnrevertResponse = SessionUnrevertResponses[keyof SessionUnrevertResponses]
|
||||
|
||||
export type PostSessionIdPermissionsPermissionIdData = {
|
||||
body?: {
|
||||
response: "once" | "always" | "reject"
|
||||
}
|
||||
path: {
|
||||
id: string
|
||||
permissionID: string
|
||||
}
|
||||
query?: {
|
||||
directory?: string
|
||||
}
|
||||
url: "/session/{id}/permissions/{permissionID}"
|
||||
}
|
||||
|
||||
export type PostSessionIdPermissionsPermissionIdErrors = {
|
||||
/**
|
||||
* Bad request
|
||||
*/
|
||||
400: BadRequestError
|
||||
/**
|
||||
* Not found
|
||||
*/
|
||||
404: NotFoundError
|
||||
}
|
||||
|
||||
export type PostSessionIdPermissionsPermissionIdError =
|
||||
PostSessionIdPermissionsPermissionIdErrors[keyof PostSessionIdPermissionsPermissionIdErrors]
|
||||
|
||||
export type PostSessionIdPermissionsPermissionIdResponses = {
|
||||
/**
|
||||
* Permission processed successfully
|
||||
*/
|
||||
200: boolean
|
||||
}
|
||||
|
||||
export type PostSessionIdPermissionsPermissionIdResponse =
|
||||
PostSessionIdPermissionsPermissionIdResponses[keyof PostSessionIdPermissionsPermissionIdResponses]
|
||||
|
||||
export type CommandListData = {
|
||||
body?: never
|
||||
path?: never
|
||||
query?: {
|
||||
directory?: string
|
||||
}
|
||||
url: "/command"
|
||||
}
|
||||
|
||||
export type CommandListResponses = {
|
||||
/**
|
||||
* List of commands
|
||||
*/
|
||||
200: Array<Command>
|
||||
}
|
||||
|
||||
export type CommandListResponse = CommandListResponses[keyof CommandListResponses]
|
||||
|
||||
export type ConfigProvidersData = {
|
||||
body?: never
|
||||
path?: never
|
||||
query?: {
|
||||
directory?: string
|
||||
}
|
||||
url: "/config/providers"
|
||||
}
|
||||
|
||||
export type ConfigProvidersResponses = {
|
||||
/**
|
||||
* List of providers
|
||||
*/
|
||||
200: {
|
||||
providers: Array<Provider>
|
||||
default: {
|
||||
[key: string]: string
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export type ConfigProvidersResponse = ConfigProvidersResponses[keyof ConfigProvidersResponses]
|
||||
|
||||
export type ProviderListData = {
|
||||
body?: never
|
||||
path?: never
|
||||
query?: {
|
||||
directory?: string
|
||||
}
|
||||
url: "/provider"
|
||||
}
|
||||
|
||||
export type ProviderListResponses = {
|
||||
/**
|
||||
* List of providers
|
||||
*/
|
||||
200: {
|
||||
all: Array<{
|
||||
api?: string
|
||||
name: string
|
||||
env: Array<string>
|
||||
id: string
|
||||
npm?: string
|
||||
models: {
|
||||
[key: string]: {
|
||||
id: string
|
||||
name: string
|
||||
release_date: string
|
||||
attachment: boolean
|
||||
reasoning: boolean
|
||||
temperature: boolean
|
||||
tool_call: boolean
|
||||
cost?: {
|
||||
input: number
|
||||
output: number
|
||||
cache_read?: number
|
||||
cache_write?: number
|
||||
context_over_200k?: {
|
||||
input: number
|
||||
output: number
|
||||
cache_read?: number
|
||||
cache_write?: number
|
||||
}
|
||||
}
|
||||
limit: {
|
||||
context: number
|
||||
output: number
|
||||
}
|
||||
modalities?: {
|
||||
input: Array<"text" | "audio" | "image" | "video" | "pdf">
|
||||
output: Array<"text" | "audio" | "image" | "video" | "pdf">
|
||||
}
|
||||
experimental?: boolean
|
||||
status?: "alpha" | "beta" | "deprecated" | "active"
|
||||
options: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
headers?: {
|
||||
[key: string]: string
|
||||
}
|
||||
provider?: {
|
||||
npm: string
|
||||
}
|
||||
}
|
||||
}
|
||||
}>
|
||||
default: {
|
||||
[key: string]: string
|
||||
}
|
||||
connected: Array<string>
|
||||
}
|
||||
}
|
||||
|
||||
export type ProviderListResponse = ProviderListResponses[keyof ProviderListResponses]
|
||||
|
||||
export type ProviderAuthData = {
|
||||
body?: never
|
||||
path?: never
|
||||
query?: {
|
||||
directory?: string
|
||||
}
|
||||
url: "/provider/auth"
|
||||
}
|
||||
|
||||
export type ProviderAuthResponses = {
|
||||
/**
|
||||
* Provider auth methods
|
||||
*/
|
||||
200: {
|
||||
[key: string]: Array<ProviderAuthMethod>
|
||||
}
|
||||
}
|
||||
|
||||
export type ProviderAuthResponse = ProviderAuthResponses[keyof ProviderAuthResponses]
|
||||
|
||||
export type ProviderOauthAuthorizeData = {
|
||||
body?: {
|
||||
/**
|
||||
* Auth method index
|
||||
*/
|
||||
method: number
|
||||
}
|
||||
path: {
|
||||
/**
|
||||
* Provider ID
|
||||
*/
|
||||
id: string
|
||||
}
|
||||
query?: {
|
||||
directory?: string
|
||||
}
|
||||
url: "/provider/{id}/oauth/authorize"
|
||||
}
|
||||
|
||||
export type ProviderOauthAuthorizeErrors = {
|
||||
/**
|
||||
* Bad request
|
||||
*/
|
||||
400: BadRequestError
|
||||
}
|
||||
|
||||
export type ProviderOauthAuthorizeError = ProviderOauthAuthorizeErrors[keyof ProviderOauthAuthorizeErrors]
|
||||
|
||||
export type ProviderOauthAuthorizeResponses = {
|
||||
/**
|
||||
* Authorization URL and method
|
||||
*/
|
||||
200: ProviderAuthAuthorization
|
||||
}
|
||||
|
||||
export type ProviderOauthAuthorizeResponse = ProviderOauthAuthorizeResponses[keyof ProviderOauthAuthorizeResponses]
|
||||
|
||||
export type ProviderOauthCallbackData = {
|
||||
body?: {
|
||||
/**
|
||||
* Auth method index
|
||||
*/
|
||||
method: number
|
||||
/**
|
||||
* OAuth authorization code
|
||||
*/
|
||||
code?: string
|
||||
}
|
||||
path: {
|
||||
/**
|
||||
* Provider ID
|
||||
*/
|
||||
id: string
|
||||
}
|
||||
query?: {
|
||||
directory?: string
|
||||
}
|
||||
url: "/provider/{id}/oauth/callback"
|
||||
}
|
||||
|
||||
export type ProviderOauthCallbackErrors = {
|
||||
/**
|
||||
* Bad request
|
||||
*/
|
||||
400: BadRequestError
|
||||
}
|
||||
|
||||
export type ProviderOauthCallbackError = ProviderOauthCallbackErrors[keyof ProviderOauthCallbackErrors]
|
||||
|
||||
export type ProviderOauthCallbackResponses = {
|
||||
/**
|
||||
* OAuth callback processed successfully
|
||||
*/
|
||||
200: boolean
|
||||
}
|
||||
|
||||
export type ProviderOauthCallbackResponse = ProviderOauthCallbackResponses[keyof ProviderOauthCallbackResponses]
|
||||
export type ExperimentalResourceListResponse =
|
||||
ExperimentalResourceListResponses[keyof ExperimentalResourceListResponses]
|
||||
|
||||
export type FindTextData = {
|
||||
body?: never
|
||||
path?: never
|
||||
query: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
pattern: string
|
||||
}
|
||||
url: "/find"
|
||||
@@ -3175,8 +4337,11 @@ export type FindFilesData = {
|
||||
path?: never
|
||||
query: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
query: string
|
||||
dirs?: "true" | "false"
|
||||
type?: "file" | "directory"
|
||||
limit?: number
|
||||
}
|
||||
url: "/find/file"
|
||||
}
|
||||
@@ -3195,6 +4360,7 @@ export type FindSymbolsData = {
|
||||
path?: never
|
||||
query: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
query: string
|
||||
}
|
||||
url: "/find/symbol"
|
||||
@@ -3214,6 +4380,7 @@ export type FileListData = {
|
||||
path?: never
|
||||
query: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
path: string
|
||||
}
|
||||
url: "/file"
|
||||
@@ -3233,6 +4400,7 @@ export type FileReadData = {
|
||||
path?: never
|
||||
query: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
path: string
|
||||
}
|
||||
url: "/file/content"
|
||||
@@ -3252,6 +4420,7 @@ export type FileStatusData = {
|
||||
path?: never
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/file/status"
|
||||
}
|
||||
@@ -3265,57 +4434,178 @@ export type FileStatusResponses = {
|
||||
|
||||
export type FileStatusResponse = FileStatusResponses[keyof FileStatusResponses]
|
||||
|
||||
export type AppLogData = {
|
||||
body?: {
|
||||
/**
|
||||
* Service name for the log entry
|
||||
*/
|
||||
service: string
|
||||
/**
|
||||
* Log level
|
||||
*/
|
||||
level: "debug" | "info" | "error" | "warn"
|
||||
/**
|
||||
* Log message
|
||||
*/
|
||||
message: string
|
||||
/**
|
||||
* Additional metadata for the log entry
|
||||
*/
|
||||
extra?: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
}
|
||||
export type InstanceDisposeData = {
|
||||
body?: never
|
||||
path?: never
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/log"
|
||||
url: "/instance/dispose"
|
||||
}
|
||||
|
||||
export type AppLogErrors = {
|
||||
export type InstanceDisposeResponses = {
|
||||
/**
|
||||
* Bad request
|
||||
*/
|
||||
400: BadRequestError
|
||||
}
|
||||
|
||||
export type AppLogError = AppLogErrors[keyof AppLogErrors]
|
||||
|
||||
export type AppLogResponses = {
|
||||
/**
|
||||
* Log entry written successfully
|
||||
* Instance disposed
|
||||
*/
|
||||
200: boolean
|
||||
}
|
||||
|
||||
export type AppLogResponse = AppLogResponses[keyof AppLogResponses]
|
||||
export type InstanceDisposeResponse = InstanceDisposeResponses[keyof InstanceDisposeResponses]
|
||||
|
||||
export type PathGetData = {
|
||||
body?: never
|
||||
path?: never
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/path"
|
||||
}
|
||||
|
||||
export type PathGetResponses = {
|
||||
/**
|
||||
* Path
|
||||
*/
|
||||
200: Path
|
||||
}
|
||||
|
||||
export type PathGetResponse = PathGetResponses[keyof PathGetResponses]
|
||||
|
||||
export type VcsGetData = {
|
||||
body?: never
|
||||
path?: never
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/vcs"
|
||||
}
|
||||
|
||||
export type VcsGetResponses = {
|
||||
/**
|
||||
* VCS info
|
||||
*/
|
||||
200: VcsInfo
|
||||
}
|
||||
|
||||
export type VcsGetResponse = VcsGetResponses[keyof VcsGetResponses]
|
||||
|
||||
export type VcsStatusData = {
|
||||
body?: never
|
||||
path?: never
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/vcs/status"
|
||||
}
|
||||
|
||||
export type VcsStatusResponses = {
|
||||
/**
|
||||
* VCS status
|
||||
*/
|
||||
200: Array<VcsFileStatus>
|
||||
}
|
||||
|
||||
export type VcsStatusResponse = VcsStatusResponses[keyof VcsStatusResponses]
|
||||
|
||||
export type VcsDiffData = {
|
||||
body?: never
|
||||
path?: never
|
||||
query: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
mode: "git" | "branch"
|
||||
}
|
||||
url: "/vcs/diff"
|
||||
}
|
||||
|
||||
export type VcsDiffResponses = {
|
||||
/**
|
||||
* VCS diff
|
||||
*/
|
||||
200: Array<VcsFileDiff>
|
||||
}
|
||||
|
||||
export type VcsDiffResponse = VcsDiffResponses[keyof VcsDiffResponses]
|
||||
|
||||
export type VcsDiffRawData = {
|
||||
body?: never
|
||||
path?: never
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/vcs/diff/raw"
|
||||
}
|
||||
|
||||
export type VcsDiffRawResponses = {
|
||||
/**
|
||||
* Raw VCS diff
|
||||
*/
|
||||
200: string
|
||||
}
|
||||
|
||||
export type VcsDiffRawResponse = VcsDiffRawResponses[keyof VcsDiffRawResponses]
|
||||
|
||||
export type VcsApplyData = {
|
||||
body?: {
|
||||
patch: string
|
||||
}
|
||||
path?: never
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/vcs/apply"
|
||||
}
|
||||
|
||||
export type VcsApplyErrors = {
|
||||
/**
|
||||
* VcsApplyError
|
||||
*/
|
||||
400: VcsApplyError
|
||||
}
|
||||
|
||||
export type VcsApplyError2 = VcsApplyErrors[keyof VcsApplyErrors]
|
||||
|
||||
export type VcsApplyResponses = {
|
||||
/**
|
||||
* VCS patch applied
|
||||
*/
|
||||
200: {
|
||||
applied: boolean
|
||||
}
|
||||
}
|
||||
|
||||
export type VcsApplyResponse = VcsApplyResponses[keyof VcsApplyResponses]
|
||||
|
||||
export type CommandListData = {
|
||||
body?: never
|
||||
path?: never
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/command"
|
||||
}
|
||||
|
||||
export type CommandListResponses = {
|
||||
/**
|
||||
* List of commands
|
||||
*/
|
||||
200: Array<Command>
|
||||
}
|
||||
|
||||
export type CommandListResponse = CommandListResponses[keyof CommandListResponses]
|
||||
|
||||
export type AppAgentsData = {
|
||||
body?: never
|
||||
path?: never
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/agent"
|
||||
}
|
||||
@@ -3329,11 +4619,74 @@ export type AppAgentsResponses = {
|
||||
|
||||
export type AppAgentsResponse = AppAgentsResponses[keyof AppAgentsResponses]
|
||||
|
||||
export type AppSkillsData = {
|
||||
body?: never
|
||||
path?: never
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/skill"
|
||||
}
|
||||
|
||||
export type AppSkillsResponses = {
|
||||
/**
|
||||
* List of skills
|
||||
*/
|
||||
200: Array<{
|
||||
name: string
|
||||
description?: string
|
||||
location: string
|
||||
content: string
|
||||
}>
|
||||
}
|
||||
|
||||
export type AppSkillsResponse = AppSkillsResponses[keyof AppSkillsResponses]
|
||||
|
||||
export type LspStatusData = {
|
||||
body?: never
|
||||
path?: never
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/lsp"
|
||||
}
|
||||
|
||||
export type LspStatusResponses = {
|
||||
/**
|
||||
* LSP server status
|
||||
*/
|
||||
200: Array<LspStatus>
|
||||
}
|
||||
|
||||
export type LspStatusResponse = LspStatusResponses[keyof LspStatusResponses]
|
||||
|
||||
export type FormatterStatusData = {
|
||||
body?: never
|
||||
path?: never
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/formatter"
|
||||
}
|
||||
|
||||
export type FormatterStatusResponses = {
|
||||
/**
|
||||
* Formatter status
|
||||
*/
|
||||
200: Array<FormatterStatus>
|
||||
}
|
||||
|
||||
export type FormatterStatusResponse = FormatterStatusResponses[keyof FormatterStatusResponses]
|
||||
|
||||
export type McpStatusData = {
|
||||
body?: never
|
||||
path?: never
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/mcp"
|
||||
}
|
||||
@@ -3357,6 +4710,7 @@ export type McpAddData = {
|
||||
path?: never
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/mcp"
|
||||
}
|
||||
@@ -3388,6 +4742,7 @@ export type McpAuthRemoveData = {
|
||||
}
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/mcp/{name}/auth"
|
||||
}
|
||||
@@ -3419,15 +4774,16 @@ export type McpAuthStartData = {
|
||||
}
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/mcp/{name}/auth"
|
||||
}
|
||||
|
||||
export type McpAuthStartErrors = {
|
||||
/**
|
||||
* Bad request
|
||||
* McpUnsupportedOAuthError
|
||||
*/
|
||||
400: BadRequestError
|
||||
400: McpUnsupportedOAuthError
|
||||
/**
|
||||
* Not found
|
||||
*/
|
||||
@@ -3441,10 +4797,8 @@ export type McpAuthStartResponses = {
|
||||
* OAuth flow started
|
||||
*/
|
||||
200: {
|
||||
/**
|
||||
* URL to open in browser for authorization
|
||||
*/
|
||||
authorizationUrl: string
|
||||
oauthState: string
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3452,9 +4806,6 @@ export type McpAuthStartResponse = McpAuthStartResponses[keyof McpAuthStartRespo
|
||||
|
||||
export type McpAuthCallbackData = {
|
||||
body?: {
|
||||
/**
|
||||
* Authorization code from OAuth callback
|
||||
*/
|
||||
code: string
|
||||
}
|
||||
path: {
|
||||
@@ -3462,6 +4813,7 @@ export type McpAuthCallbackData = {
|
||||
}
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/mcp/{name}/auth/callback"
|
||||
}
|
||||
@@ -3495,15 +4847,16 @@ export type McpAuthAuthenticateData = {
|
||||
}
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/mcp/{name}/auth/authenticate"
|
||||
}
|
||||
|
||||
export type McpAuthAuthenticateErrors = {
|
||||
/**
|
||||
* Bad request
|
||||
* McpUnsupportedOAuthError
|
||||
*/
|
||||
400: BadRequestError
|
||||
400: McpUnsupportedOAuthError
|
||||
/**
|
||||
* Not found
|
||||
*/
|
||||
@@ -3528,6 +4881,7 @@ export type McpConnectData = {
|
||||
}
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/mcp/{name}/connect"
|
||||
}
|
||||
@@ -3548,6 +4902,7 @@ export type McpDisconnectData = {
|
||||
}
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/mcp/{name}/disconnect"
|
||||
}
|
||||
@@ -3561,41 +4916,1710 @@ export type McpDisconnectResponses = {
|
||||
|
||||
export type McpDisconnectResponse = McpDisconnectResponses[keyof McpDisconnectResponses]
|
||||
|
||||
export type LspStatusData = {
|
||||
export type ProjectListData = {
|
||||
body?: never
|
||||
path?: never
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/lsp"
|
||||
url: "/project"
|
||||
}
|
||||
|
||||
export type LspStatusResponses = {
|
||||
export type ProjectListResponses = {
|
||||
/**
|
||||
* LSP server status
|
||||
* List of projects
|
||||
*/
|
||||
200: Array<LspStatus>
|
||||
200: Array<Project>
|
||||
}
|
||||
|
||||
export type LspStatusResponse = LspStatusResponses[keyof LspStatusResponses]
|
||||
export type ProjectListResponse = ProjectListResponses[keyof ProjectListResponses]
|
||||
|
||||
export type FormatterStatusData = {
|
||||
export type ProjectCurrentData = {
|
||||
body?: never
|
||||
path?: never
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/formatter"
|
||||
url: "/project/current"
|
||||
}
|
||||
|
||||
export type FormatterStatusResponses = {
|
||||
export type ProjectCurrentResponses = {
|
||||
/**
|
||||
* Formatter status
|
||||
* Current project information
|
||||
*/
|
||||
200: Array<FormatterStatus>
|
||||
200: Project
|
||||
}
|
||||
|
||||
export type FormatterStatusResponse = FormatterStatusResponses[keyof FormatterStatusResponses]
|
||||
export type ProjectCurrentResponse = ProjectCurrentResponses[keyof ProjectCurrentResponses]
|
||||
|
||||
export type ProjectInitGitData = {
|
||||
body?: never
|
||||
path?: never
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/project/git/init"
|
||||
}
|
||||
|
||||
export type ProjectInitGitResponses = {
|
||||
/**
|
||||
* Project information after git initialization
|
||||
*/
|
||||
200: Project
|
||||
}
|
||||
|
||||
export type ProjectInitGitResponse = ProjectInitGitResponses[keyof ProjectInitGitResponses]
|
||||
|
||||
export type ProjectUpdateData = {
|
||||
body?: {
|
||||
name?: string
|
||||
icon?: {
|
||||
url?: string
|
||||
override?: string
|
||||
color?: string
|
||||
}
|
||||
commands?: {
|
||||
/**
|
||||
* Startup script to run when creating a new workspace (worktree)
|
||||
*/
|
||||
start?: string
|
||||
}
|
||||
}
|
||||
path: {
|
||||
projectID: string
|
||||
}
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/project/{projectID}"
|
||||
}
|
||||
|
||||
export type ProjectUpdateErrors = {
|
||||
/**
|
||||
* Bad request
|
||||
*/
|
||||
400: BadRequestError
|
||||
/**
|
||||
* Not found
|
||||
*/
|
||||
404: NotFoundError
|
||||
}
|
||||
|
||||
export type ProjectUpdateError = ProjectUpdateErrors[keyof ProjectUpdateErrors]
|
||||
|
||||
export type ProjectUpdateResponses = {
|
||||
/**
|
||||
* Updated project information
|
||||
*/
|
||||
200: Project
|
||||
}
|
||||
|
||||
export type ProjectUpdateResponse = ProjectUpdateResponses[keyof ProjectUpdateResponses]
|
||||
|
||||
export type PtyShellsData = {
|
||||
body?: never
|
||||
path?: never
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/pty/shells"
|
||||
}
|
||||
|
||||
export type PtyShellsResponses = {
|
||||
/**
|
||||
* List of shells
|
||||
*/
|
||||
200: Array<{
|
||||
path: string
|
||||
name: string
|
||||
acceptable: boolean
|
||||
}>
|
||||
}
|
||||
|
||||
export type PtyShellsResponse = PtyShellsResponses[keyof PtyShellsResponses]
|
||||
|
||||
export type PtyListData = {
|
||||
body?: never
|
||||
path?: never
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/pty"
|
||||
}
|
||||
|
||||
export type PtyListResponses = {
|
||||
/**
|
||||
* List of sessions
|
||||
*/
|
||||
200: Array<Pty>
|
||||
}
|
||||
|
||||
export type PtyListResponse = PtyListResponses[keyof PtyListResponses]
|
||||
|
||||
export type PtyCreateData = {
|
||||
body?: {
|
||||
command?: string
|
||||
args?: Array<string>
|
||||
cwd?: string
|
||||
title?: string
|
||||
env?: {
|
||||
[key: string]: string
|
||||
}
|
||||
}
|
||||
path?: never
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/pty"
|
||||
}
|
||||
|
||||
export type PtyCreateErrors = {
|
||||
/**
|
||||
* Bad request
|
||||
*/
|
||||
400: BadRequestError
|
||||
}
|
||||
|
||||
export type PtyCreateError = PtyCreateErrors[keyof PtyCreateErrors]
|
||||
|
||||
export type PtyCreateResponses = {
|
||||
/**
|
||||
* Created session
|
||||
*/
|
||||
200: Pty
|
||||
}
|
||||
|
||||
export type PtyCreateResponse = PtyCreateResponses[keyof PtyCreateResponses]
|
||||
|
||||
export type PtyRemoveData = {
|
||||
body?: never
|
||||
path: {
|
||||
ptyID: string
|
||||
}
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/pty/{ptyID}"
|
||||
}
|
||||
|
||||
export type PtyRemoveErrors = {
|
||||
/**
|
||||
* NotFoundError
|
||||
*/
|
||||
404: NotFoundError
|
||||
}
|
||||
|
||||
export type PtyRemoveError = PtyRemoveErrors[keyof PtyRemoveErrors]
|
||||
|
||||
export type PtyRemoveResponses = {
|
||||
/**
|
||||
* Session removed
|
||||
*/
|
||||
200: boolean
|
||||
}
|
||||
|
||||
export type PtyRemoveResponse = PtyRemoveResponses[keyof PtyRemoveResponses]
|
||||
|
||||
export type PtyGetData = {
|
||||
body?: never
|
||||
path: {
|
||||
ptyID: string
|
||||
}
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/pty/{ptyID}"
|
||||
}
|
||||
|
||||
export type PtyGetErrors = {
|
||||
/**
|
||||
* NotFoundError
|
||||
*/
|
||||
404: NotFoundError
|
||||
}
|
||||
|
||||
export type PtyGetError = PtyGetErrors[keyof PtyGetErrors]
|
||||
|
||||
export type PtyGetResponses = {
|
||||
/**
|
||||
* Session info
|
||||
*/
|
||||
200: Pty
|
||||
}
|
||||
|
||||
export type PtyGetResponse = PtyGetResponses[keyof PtyGetResponses]
|
||||
|
||||
export type PtyUpdateData = {
|
||||
body?: {
|
||||
title?: string
|
||||
size?: {
|
||||
rows: number
|
||||
cols: number
|
||||
}
|
||||
}
|
||||
path: {
|
||||
ptyID: string
|
||||
}
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/pty/{ptyID}"
|
||||
}
|
||||
|
||||
export type PtyUpdateErrors = {
|
||||
/**
|
||||
* Bad request
|
||||
*/
|
||||
400: BadRequestError
|
||||
}
|
||||
|
||||
export type PtyUpdateError = PtyUpdateErrors[keyof PtyUpdateErrors]
|
||||
|
||||
export type PtyUpdateResponses = {
|
||||
/**
|
||||
* Updated session
|
||||
*/
|
||||
200: Pty
|
||||
}
|
||||
|
||||
export type PtyUpdateResponse = PtyUpdateResponses[keyof PtyUpdateResponses]
|
||||
|
||||
export type PtyConnectTokenData = {
|
||||
body?: never
|
||||
path: {
|
||||
ptyID: string
|
||||
}
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/pty/{ptyID}/connect-token"
|
||||
}
|
||||
|
||||
export type PtyConnectTokenErrors = {
|
||||
/**
|
||||
* Forbidden
|
||||
*/
|
||||
403: EffectHttpApiErrorForbidden
|
||||
/**
|
||||
* NotFoundError
|
||||
*/
|
||||
404: NotFoundError
|
||||
}
|
||||
|
||||
export type PtyConnectTokenError = PtyConnectTokenErrors[keyof PtyConnectTokenErrors]
|
||||
|
||||
export type PtyConnectTokenResponses = {
|
||||
/**
|
||||
* WebSocket connect token
|
||||
*/
|
||||
200: {
|
||||
ticket: string
|
||||
expires_in: number
|
||||
}
|
||||
}
|
||||
|
||||
export type PtyConnectTokenResponse = PtyConnectTokenResponses[keyof PtyConnectTokenResponses]
|
||||
|
||||
export type QuestionListData = {
|
||||
body?: never
|
||||
path?: never
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/question"
|
||||
}
|
||||
|
||||
export type QuestionListResponses = {
|
||||
/**
|
||||
* List of pending questions
|
||||
*/
|
||||
200: Array<QuestionRequest>
|
||||
}
|
||||
|
||||
export type QuestionListResponse = QuestionListResponses[keyof QuestionListResponses]
|
||||
|
||||
export type QuestionReplyData = {
|
||||
body?: {
|
||||
/**
|
||||
* User answers in order of questions (each answer is an array of selected labels)
|
||||
*/
|
||||
answers: Array<QuestionAnswer>
|
||||
}
|
||||
path: {
|
||||
requestID: string
|
||||
}
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/question/{requestID}/reply"
|
||||
}
|
||||
|
||||
export type QuestionReplyErrors = {
|
||||
/**
|
||||
* Bad request
|
||||
*/
|
||||
400: BadRequestError
|
||||
/**
|
||||
* Not found
|
||||
*/
|
||||
404: NotFoundError
|
||||
}
|
||||
|
||||
export type QuestionReplyError = QuestionReplyErrors[keyof QuestionReplyErrors]
|
||||
|
||||
export type QuestionReplyResponses = {
|
||||
/**
|
||||
* Question answered successfully
|
||||
*/
|
||||
200: boolean
|
||||
}
|
||||
|
||||
export type QuestionReplyResponse = QuestionReplyResponses[keyof QuestionReplyResponses]
|
||||
|
||||
export type QuestionRejectData = {
|
||||
body?: never
|
||||
path: {
|
||||
requestID: string
|
||||
}
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/question/{requestID}/reject"
|
||||
}
|
||||
|
||||
export type QuestionRejectErrors = {
|
||||
/**
|
||||
* Bad request
|
||||
*/
|
||||
400: BadRequestError
|
||||
/**
|
||||
* Not found
|
||||
*/
|
||||
404: NotFoundError
|
||||
}
|
||||
|
||||
export type QuestionRejectError = QuestionRejectErrors[keyof QuestionRejectErrors]
|
||||
|
||||
export type QuestionRejectResponses = {
|
||||
/**
|
||||
* Question rejected successfully
|
||||
*/
|
||||
200: boolean
|
||||
}
|
||||
|
||||
export type QuestionRejectResponse = QuestionRejectResponses[keyof QuestionRejectResponses]
|
||||
|
||||
export type PermissionListData = {
|
||||
body?: never
|
||||
path?: never
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/permission"
|
||||
}
|
||||
|
||||
export type PermissionListResponses = {
|
||||
/**
|
||||
* List of pending permissions
|
||||
*/
|
||||
200: Array<PermissionRequest>
|
||||
}
|
||||
|
||||
export type PermissionListResponse = PermissionListResponses[keyof PermissionListResponses]
|
||||
|
||||
export type PermissionReplyData = {
|
||||
body?: {
|
||||
reply: "once" | "always" | "reject"
|
||||
message?: string
|
||||
}
|
||||
path: {
|
||||
requestID: string
|
||||
}
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/permission/{requestID}/reply"
|
||||
}
|
||||
|
||||
export type PermissionReplyErrors = {
|
||||
/**
|
||||
* Bad request
|
||||
*/
|
||||
400: BadRequestError
|
||||
/**
|
||||
* Not found
|
||||
*/
|
||||
404: NotFoundError
|
||||
}
|
||||
|
||||
export type PermissionReplyError = PermissionReplyErrors[keyof PermissionReplyErrors]
|
||||
|
||||
export type PermissionReplyResponses = {
|
||||
/**
|
||||
* Permission processed successfully
|
||||
*/
|
||||
200: boolean
|
||||
}
|
||||
|
||||
export type PermissionReplyResponse = PermissionReplyResponses[keyof PermissionReplyResponses]
|
||||
|
||||
export type ProviderListData = {
|
||||
body?: never
|
||||
path?: never
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/provider"
|
||||
}
|
||||
|
||||
export type ProviderListResponses = {
|
||||
/**
|
||||
* List of providers
|
||||
*/
|
||||
200: {
|
||||
all: Array<Provider>
|
||||
default: {
|
||||
[key: string]: string
|
||||
}
|
||||
connected: Array<string>
|
||||
}
|
||||
}
|
||||
|
||||
export type ProviderListResponse = ProviderListResponses[keyof ProviderListResponses]
|
||||
|
||||
export type ProviderAuthData = {
|
||||
body?: never
|
||||
path?: never
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/provider/auth"
|
||||
}
|
||||
|
||||
export type ProviderAuthResponses = {
|
||||
/**
|
||||
* Provider auth methods
|
||||
*/
|
||||
200: {
|
||||
[key: string]: Array<ProviderAuthMethod>
|
||||
}
|
||||
}
|
||||
|
||||
export type ProviderAuthResponse = ProviderAuthResponses[keyof ProviderAuthResponses]
|
||||
|
||||
export type ProviderOauthAuthorizeData = {
|
||||
body?: {
|
||||
/**
|
||||
* Auth method index
|
||||
*/
|
||||
method: number
|
||||
inputs?: {
|
||||
[key: string]: string
|
||||
}
|
||||
}
|
||||
path: {
|
||||
providerID: string
|
||||
}
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/provider/{providerID}/oauth/authorize"
|
||||
}
|
||||
|
||||
export type ProviderOauthAuthorizeErrors = {
|
||||
/**
|
||||
* ProviderAuthError
|
||||
*/
|
||||
400: ProviderAuthError1
|
||||
}
|
||||
|
||||
export type ProviderOauthAuthorizeError = ProviderOauthAuthorizeErrors[keyof ProviderOauthAuthorizeErrors]
|
||||
|
||||
export type ProviderOauthAuthorizeResponses = {
|
||||
/**
|
||||
* Authorization URL and method
|
||||
*/
|
||||
200: ProviderAuthAuthorization
|
||||
}
|
||||
|
||||
export type ProviderOauthAuthorizeResponse = ProviderOauthAuthorizeResponses[keyof ProviderOauthAuthorizeResponses]
|
||||
|
||||
export type ProviderOauthCallbackData = {
|
||||
body?: {
|
||||
/**
|
||||
* Auth method index
|
||||
*/
|
||||
method: number
|
||||
code?: string
|
||||
}
|
||||
path: {
|
||||
providerID: string
|
||||
}
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/provider/{providerID}/oauth/callback"
|
||||
}
|
||||
|
||||
export type ProviderOauthCallbackErrors = {
|
||||
/**
|
||||
* ProviderAuthError
|
||||
*/
|
||||
400: ProviderAuthError1
|
||||
}
|
||||
|
||||
export type ProviderOauthCallbackError = ProviderOauthCallbackErrors[keyof ProviderOauthCallbackErrors]
|
||||
|
||||
export type ProviderOauthCallbackResponses = {
|
||||
/**
|
||||
* OAuth callback processed successfully
|
||||
*/
|
||||
200: boolean
|
||||
}
|
||||
|
||||
export type ProviderOauthCallbackResponse = ProviderOauthCallbackResponses[keyof ProviderOauthCallbackResponses]
|
||||
|
||||
export type SessionListData = {
|
||||
body?: never
|
||||
path?: never
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
scope?: "project"
|
||||
path?: string
|
||||
roots?: boolean | "true" | "false"
|
||||
start?: number
|
||||
search?: string
|
||||
limit?: number
|
||||
}
|
||||
url: "/session"
|
||||
}
|
||||
|
||||
export type SessionListResponses = {
|
||||
/**
|
||||
* List of sessions
|
||||
*/
|
||||
200: Array<Session>
|
||||
}
|
||||
|
||||
export type SessionListResponse = SessionListResponses[keyof SessionListResponses]
|
||||
|
||||
export type SessionCreateData = {
|
||||
body?: {
|
||||
parentID?: string
|
||||
title?: string
|
||||
agent?: string
|
||||
model?: {
|
||||
id: string
|
||||
providerID: string
|
||||
variant?: string
|
||||
}
|
||||
permission?: PermissionRuleset
|
||||
workspaceID?: string
|
||||
}
|
||||
path?: never
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/session"
|
||||
}
|
||||
|
||||
export type SessionCreateErrors = {
|
||||
/**
|
||||
* Bad request
|
||||
*/
|
||||
400: BadRequestError
|
||||
}
|
||||
|
||||
export type SessionCreateError = SessionCreateErrors[keyof SessionCreateErrors]
|
||||
|
||||
export type SessionCreateResponses = {
|
||||
/**
|
||||
* Successfully created session
|
||||
*/
|
||||
200: Session
|
||||
}
|
||||
|
||||
export type SessionCreateResponse = SessionCreateResponses[keyof SessionCreateResponses]
|
||||
|
||||
export type SessionStatusData = {
|
||||
body?: never
|
||||
path?: never
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/session/status"
|
||||
}
|
||||
|
||||
export type SessionStatusErrors = {
|
||||
/**
|
||||
* Bad request
|
||||
*/
|
||||
400: BadRequestError
|
||||
}
|
||||
|
||||
export type SessionStatusError = SessionStatusErrors[keyof SessionStatusErrors]
|
||||
|
||||
export type SessionStatusResponses = {
|
||||
/**
|
||||
* Get session status
|
||||
*/
|
||||
200: {
|
||||
[key: string]: SessionStatus
|
||||
}
|
||||
}
|
||||
|
||||
export type SessionStatusResponse = SessionStatusResponses[keyof SessionStatusResponses]
|
||||
|
||||
export type SessionDeleteData = {
|
||||
body?: never
|
||||
path: {
|
||||
id: string
|
||||
}
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/session/{id}"
|
||||
}
|
||||
|
||||
export type SessionDeleteErrors = {
|
||||
/**
|
||||
* Bad request
|
||||
*/
|
||||
400: BadRequestError
|
||||
/**
|
||||
* NotFoundError
|
||||
*/
|
||||
404: NotFoundError
|
||||
}
|
||||
|
||||
export type SessionDeleteError = SessionDeleteErrors[keyof SessionDeleteErrors]
|
||||
|
||||
export type SessionDeleteResponses = {
|
||||
/**
|
||||
* Successfully deleted session
|
||||
*/
|
||||
200: boolean
|
||||
}
|
||||
|
||||
export type SessionDeleteResponse = SessionDeleteResponses[keyof SessionDeleteResponses]
|
||||
|
||||
export type SessionGetData = {
|
||||
body?: never
|
||||
path: {
|
||||
id: string
|
||||
}
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/session/{id}"
|
||||
}
|
||||
|
||||
export type SessionGetErrors = {
|
||||
/**
|
||||
* Bad request
|
||||
*/
|
||||
400: BadRequestError
|
||||
/**
|
||||
* NotFoundError
|
||||
*/
|
||||
404: NotFoundError
|
||||
}
|
||||
|
||||
export type SessionGetError = SessionGetErrors[keyof SessionGetErrors]
|
||||
|
||||
export type SessionGetResponses = {
|
||||
/**
|
||||
* Get session
|
||||
*/
|
||||
200: Session
|
||||
}
|
||||
|
||||
export type SessionGetResponse = SessionGetResponses[keyof SessionGetResponses]
|
||||
|
||||
export type SessionUpdateData = {
|
||||
body?: {
|
||||
title?: string
|
||||
permission?: PermissionRuleset
|
||||
time?: {
|
||||
archived?: number
|
||||
}
|
||||
}
|
||||
path: {
|
||||
id: string
|
||||
}
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/session/{id}"
|
||||
}
|
||||
|
||||
export type SessionUpdateErrors = {
|
||||
/**
|
||||
* Bad request
|
||||
*/
|
||||
400: BadRequestError
|
||||
/**
|
||||
* NotFoundError
|
||||
*/
|
||||
404: NotFoundError
|
||||
}
|
||||
|
||||
export type SessionUpdateError = SessionUpdateErrors[keyof SessionUpdateErrors]
|
||||
|
||||
export type SessionUpdateResponses = {
|
||||
/**
|
||||
* Successfully updated session
|
||||
*/
|
||||
200: Session
|
||||
}
|
||||
|
||||
export type SessionUpdateResponse = SessionUpdateResponses[keyof SessionUpdateResponses]
|
||||
|
||||
export type SessionChildrenData = {
|
||||
body?: never
|
||||
path: {
|
||||
id: string
|
||||
}
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/session/{id}/children"
|
||||
}
|
||||
|
||||
export type SessionChildrenErrors = {
|
||||
/**
|
||||
* Bad request
|
||||
*/
|
||||
400: BadRequestError
|
||||
/**
|
||||
* NotFoundError
|
||||
*/
|
||||
404: NotFoundError
|
||||
}
|
||||
|
||||
export type SessionChildrenError = SessionChildrenErrors[keyof SessionChildrenErrors]
|
||||
|
||||
export type SessionChildrenResponses = {
|
||||
/**
|
||||
* List of children
|
||||
*/
|
||||
200: Array<Session>
|
||||
}
|
||||
|
||||
export type SessionChildrenResponse = SessionChildrenResponses[keyof SessionChildrenResponses]
|
||||
|
||||
export type SessionTodoData = {
|
||||
body?: never
|
||||
path: {
|
||||
id: string
|
||||
}
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/session/{id}/todo"
|
||||
}
|
||||
|
||||
export type SessionTodoErrors = {
|
||||
/**
|
||||
* Bad request
|
||||
*/
|
||||
400: BadRequestError
|
||||
/**
|
||||
* NotFoundError
|
||||
*/
|
||||
404: NotFoundError
|
||||
}
|
||||
|
||||
export type SessionTodoError = SessionTodoErrors[keyof SessionTodoErrors]
|
||||
|
||||
export type SessionTodoResponses = {
|
||||
/**
|
||||
* Todo list
|
||||
*/
|
||||
200: Array<Todo>
|
||||
}
|
||||
|
||||
export type SessionTodoResponse = SessionTodoResponses[keyof SessionTodoResponses]
|
||||
|
||||
export type SessionDiffData = {
|
||||
body?: never
|
||||
path: {
|
||||
id: string
|
||||
}
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
messageID?: string
|
||||
}
|
||||
url: "/session/{id}/diff"
|
||||
}
|
||||
|
||||
export type SessionDiffResponses = {
|
||||
/**
|
||||
* Successfully retrieved diff
|
||||
*/
|
||||
200: Array<SnapshotFileDiff>
|
||||
}
|
||||
|
||||
export type SessionDiffResponse = SessionDiffResponses[keyof SessionDiffResponses]
|
||||
|
||||
export type SessionMessagesData = {
|
||||
body?: never
|
||||
path: {
|
||||
id: string
|
||||
}
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
limit?: number
|
||||
before?: string
|
||||
}
|
||||
url: "/session/{id}/message"
|
||||
}
|
||||
|
||||
export type SessionMessagesErrors = {
|
||||
/**
|
||||
* Bad request
|
||||
*/
|
||||
400: BadRequestError
|
||||
/**
|
||||
* NotFoundError
|
||||
*/
|
||||
404: NotFoundError
|
||||
}
|
||||
|
||||
export type SessionMessagesError = SessionMessagesErrors[keyof SessionMessagesErrors]
|
||||
|
||||
export type SessionMessagesResponses = {
|
||||
/**
|
||||
* List of messages
|
||||
*/
|
||||
200: Array<{
|
||||
info: Message
|
||||
parts: Array<Part>
|
||||
}>
|
||||
}
|
||||
|
||||
export type SessionMessagesResponse = SessionMessagesResponses[keyof SessionMessagesResponses]
|
||||
|
||||
export type SessionPromptData = {
|
||||
body?: {
|
||||
messageID?: string
|
||||
model?: {
|
||||
providerID: string
|
||||
modelID: string
|
||||
}
|
||||
agent?: string
|
||||
noReply?: boolean
|
||||
tools?: {
|
||||
[key: string]: boolean
|
||||
}
|
||||
format?: OutputFormat
|
||||
system?: string
|
||||
variant?: string
|
||||
parts: Array<TextPartInput | FilePartInput | AgentPartInput | SubtaskPartInput>
|
||||
}
|
||||
path: {
|
||||
id: string
|
||||
}
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/session/{id}/message"
|
||||
}
|
||||
|
||||
export type SessionPromptErrors = {
|
||||
/**
|
||||
* Bad request
|
||||
*/
|
||||
400: BadRequestError
|
||||
/**
|
||||
* NotFoundError
|
||||
*/
|
||||
404: NotFoundError
|
||||
}
|
||||
|
||||
export type SessionPromptError = SessionPromptErrors[keyof SessionPromptErrors]
|
||||
|
||||
export type SessionPromptResponses = {
|
||||
/**
|
||||
* Created message
|
||||
*/
|
||||
200: {
|
||||
info: AssistantMessage
|
||||
parts: Array<Part>
|
||||
}
|
||||
}
|
||||
|
||||
export type SessionPromptResponse = SessionPromptResponses[keyof SessionPromptResponses]
|
||||
|
||||
export type SessionDeleteMessageData = {
|
||||
body?: never
|
||||
path: {
|
||||
id: string
|
||||
messageID: string
|
||||
}
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/session/{id}/message/{messageID}"
|
||||
}
|
||||
|
||||
export type SessionDeleteMessageErrors = {
|
||||
/**
|
||||
* Bad request
|
||||
*/
|
||||
400: BadRequestError
|
||||
/**
|
||||
* NotFoundError
|
||||
*/
|
||||
404: NotFoundError
|
||||
}
|
||||
|
||||
export type SessionDeleteMessageError = SessionDeleteMessageErrors[keyof SessionDeleteMessageErrors]
|
||||
|
||||
export type SessionDeleteMessageResponses = {
|
||||
/**
|
||||
* Successfully deleted message
|
||||
*/
|
||||
200: boolean
|
||||
}
|
||||
|
||||
export type SessionDeleteMessageResponse = SessionDeleteMessageResponses[keyof SessionDeleteMessageResponses]
|
||||
|
||||
export type SessionMessageData = {
|
||||
body?: never
|
||||
path: {
|
||||
id: string
|
||||
messageID: string
|
||||
}
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/session/{id}/message/{messageID}"
|
||||
}
|
||||
|
||||
export type SessionMessageErrors = {
|
||||
/**
|
||||
* Bad request
|
||||
*/
|
||||
400: BadRequestError
|
||||
/**
|
||||
* NotFoundError
|
||||
*/
|
||||
404: NotFoundError
|
||||
}
|
||||
|
||||
export type SessionMessageError = SessionMessageErrors[keyof SessionMessageErrors]
|
||||
|
||||
export type SessionMessageResponses = {
|
||||
/**
|
||||
* Message
|
||||
*/
|
||||
200: {
|
||||
info: Message
|
||||
parts: Array<Part>
|
||||
}
|
||||
}
|
||||
|
||||
export type SessionMessageResponse = SessionMessageResponses[keyof SessionMessageResponses]
|
||||
|
||||
export type SessionForkData = {
|
||||
body?: {
|
||||
messageID?: string
|
||||
}
|
||||
path: {
|
||||
id: string
|
||||
}
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/session/{id}/fork"
|
||||
}
|
||||
|
||||
export type SessionForkErrors = {
|
||||
/**
|
||||
* Bad request
|
||||
*/
|
||||
400: BadRequestError
|
||||
/**
|
||||
* NotFoundError
|
||||
*/
|
||||
404: NotFoundError
|
||||
}
|
||||
|
||||
export type SessionForkError = SessionForkErrors[keyof SessionForkErrors]
|
||||
|
||||
export type SessionForkResponses = {
|
||||
/**
|
||||
* 200
|
||||
*/
|
||||
200: Session
|
||||
}
|
||||
|
||||
export type SessionForkResponse = SessionForkResponses[keyof SessionForkResponses]
|
||||
|
||||
export type SessionAbortData = {
|
||||
body?: never
|
||||
path: {
|
||||
id: string
|
||||
}
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/session/{id}/abort"
|
||||
}
|
||||
|
||||
export type SessionAbortErrors = {
|
||||
/**
|
||||
* Bad request
|
||||
*/
|
||||
400: BadRequestError
|
||||
}
|
||||
|
||||
export type SessionAbortError = SessionAbortErrors[keyof SessionAbortErrors]
|
||||
|
||||
export type SessionAbortResponses = {
|
||||
/**
|
||||
* Aborted session
|
||||
*/
|
||||
200: boolean
|
||||
}
|
||||
|
||||
export type SessionAbortResponse = SessionAbortResponses[keyof SessionAbortResponses]
|
||||
|
||||
export type SessionInitData = {
|
||||
body?: {
|
||||
modelID: string
|
||||
providerID: string
|
||||
messageID: string
|
||||
}
|
||||
path: {
|
||||
id: string
|
||||
}
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/session/{id}/init"
|
||||
}
|
||||
|
||||
export type SessionInitErrors = {
|
||||
/**
|
||||
* Bad request
|
||||
*/
|
||||
400: BadRequestError
|
||||
/**
|
||||
* NotFoundError
|
||||
*/
|
||||
404: NotFoundError
|
||||
}
|
||||
|
||||
export type SessionInitError = SessionInitErrors[keyof SessionInitErrors]
|
||||
|
||||
export type SessionInitResponses = {
|
||||
/**
|
||||
* 200
|
||||
*/
|
||||
200: boolean
|
||||
}
|
||||
|
||||
export type SessionInitResponse = SessionInitResponses[keyof SessionInitResponses]
|
||||
|
||||
export type SessionUnshareData = {
|
||||
body?: never
|
||||
path: {
|
||||
id: string
|
||||
}
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/session/{id}/share"
|
||||
}
|
||||
|
||||
export type SessionUnshareErrors = {
|
||||
/**
|
||||
* NotFoundError
|
||||
*/
|
||||
404: NotFoundError
|
||||
/**
|
||||
* InternalServerError
|
||||
*/
|
||||
500: EffectHttpApiErrorInternalServerError
|
||||
}
|
||||
|
||||
export type SessionUnshareError = SessionUnshareErrors[keyof SessionUnshareErrors]
|
||||
|
||||
export type SessionUnshareResponses = {
|
||||
/**
|
||||
* Successfully unshared session
|
||||
*/
|
||||
200: Session
|
||||
}
|
||||
|
||||
export type SessionUnshareResponse = SessionUnshareResponses[keyof SessionUnshareResponses]
|
||||
|
||||
export type SessionShareData = {
|
||||
body?: never
|
||||
path: {
|
||||
id: string
|
||||
}
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/session/{id}/share"
|
||||
}
|
||||
|
||||
export type SessionShareErrors = {
|
||||
/**
|
||||
* NotFoundError
|
||||
*/
|
||||
404: NotFoundError
|
||||
/**
|
||||
* InternalServerError
|
||||
*/
|
||||
500: EffectHttpApiErrorInternalServerError
|
||||
}
|
||||
|
||||
export type SessionShareError = SessionShareErrors[keyof SessionShareErrors]
|
||||
|
||||
export type SessionShareResponses = {
|
||||
/**
|
||||
* Successfully shared session
|
||||
*/
|
||||
200: Session
|
||||
}
|
||||
|
||||
export type SessionShareResponse = SessionShareResponses[keyof SessionShareResponses]
|
||||
|
||||
export type SessionSummarizeData = {
|
||||
body?: {
|
||||
providerID: string
|
||||
modelID: string
|
||||
auto?: boolean
|
||||
}
|
||||
path: {
|
||||
id: string
|
||||
}
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/session/{id}/summarize"
|
||||
}
|
||||
|
||||
export type SessionSummarizeErrors = {
|
||||
/**
|
||||
* Bad request
|
||||
*/
|
||||
400: BadRequestError
|
||||
/**
|
||||
* NotFoundError
|
||||
*/
|
||||
404: NotFoundError
|
||||
}
|
||||
|
||||
export type SessionSummarizeError = SessionSummarizeErrors[keyof SessionSummarizeErrors]
|
||||
|
||||
export type SessionSummarizeResponses = {
|
||||
/**
|
||||
* Summarized session
|
||||
*/
|
||||
200: boolean
|
||||
}
|
||||
|
||||
export type SessionSummarizeResponse = SessionSummarizeResponses[keyof SessionSummarizeResponses]
|
||||
|
||||
export type SessionPromptAsyncData = {
|
||||
body?: {
|
||||
messageID?: string
|
||||
model?: {
|
||||
providerID: string
|
||||
modelID: string
|
||||
}
|
||||
agent?: string
|
||||
noReply?: boolean
|
||||
tools?: {
|
||||
[key: string]: boolean
|
||||
}
|
||||
format?: OutputFormat
|
||||
system?: string
|
||||
variant?: string
|
||||
parts: Array<TextPartInput | FilePartInput | AgentPartInput | SubtaskPartInput>
|
||||
}
|
||||
path: {
|
||||
id: string
|
||||
}
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/session/{id}/prompt_async"
|
||||
}
|
||||
|
||||
export type SessionPromptAsyncErrors = {
|
||||
/**
|
||||
* Bad request
|
||||
*/
|
||||
400: BadRequestError
|
||||
/**
|
||||
* NotFoundError
|
||||
*/
|
||||
404: NotFoundError
|
||||
}
|
||||
|
||||
export type SessionPromptAsyncError = SessionPromptAsyncErrors[keyof SessionPromptAsyncErrors]
|
||||
|
||||
export type SessionPromptAsyncResponses = {
|
||||
/**
|
||||
* Prompt accepted
|
||||
*/
|
||||
204: void
|
||||
}
|
||||
|
||||
export type SessionPromptAsyncResponse = SessionPromptAsyncResponses[keyof SessionPromptAsyncResponses]
|
||||
|
||||
export type SessionCommandData = {
|
||||
body?: {
|
||||
messageID?: string
|
||||
agent?: string
|
||||
model?: string
|
||||
arguments: string
|
||||
command: string
|
||||
variant?: string
|
||||
parts?: Array<{
|
||||
id?: string
|
||||
type: "file"
|
||||
mime: string
|
||||
filename?: string
|
||||
url: string
|
||||
source?: FilePartSource
|
||||
}>
|
||||
}
|
||||
path: {
|
||||
id: string
|
||||
}
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/session/{id}/command"
|
||||
}
|
||||
|
||||
export type SessionCommandErrors = {
|
||||
/**
|
||||
* Bad request
|
||||
*/
|
||||
400: BadRequestError
|
||||
/**
|
||||
* NotFoundError
|
||||
*/
|
||||
404: NotFoundError
|
||||
}
|
||||
|
||||
export type SessionCommandError = SessionCommandErrors[keyof SessionCommandErrors]
|
||||
|
||||
export type SessionCommandResponses = {
|
||||
/**
|
||||
* Created message
|
||||
*/
|
||||
200: {
|
||||
info: AssistantMessage
|
||||
parts: Array<Part>
|
||||
}
|
||||
}
|
||||
|
||||
export type SessionCommandResponse = SessionCommandResponses[keyof SessionCommandResponses]
|
||||
|
||||
export type SessionShellData = {
|
||||
body?: {
|
||||
messageID?: string
|
||||
agent: string
|
||||
model?: {
|
||||
providerID: string
|
||||
modelID: string
|
||||
}
|
||||
command: string
|
||||
}
|
||||
path: {
|
||||
id: string
|
||||
}
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/session/{id}/shell"
|
||||
}
|
||||
|
||||
export type SessionShellErrors = {
|
||||
/**
|
||||
* Bad request
|
||||
*/
|
||||
400: BadRequestError
|
||||
/**
|
||||
* NotFoundError
|
||||
*/
|
||||
404: NotFoundError
|
||||
}
|
||||
|
||||
export type SessionShellError = SessionShellErrors[keyof SessionShellErrors]
|
||||
|
||||
export type SessionShellResponses = {
|
||||
/**
|
||||
* Created message
|
||||
*/
|
||||
200: {
|
||||
info: Message
|
||||
parts: Array<Part>
|
||||
}
|
||||
}
|
||||
|
||||
export type SessionShellResponse = SessionShellResponses[keyof SessionShellResponses]
|
||||
|
||||
export type SessionRevertData = {
|
||||
body?: {
|
||||
messageID: string
|
||||
partID?: string
|
||||
}
|
||||
path: {
|
||||
id: string
|
||||
}
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/session/{id}/revert"
|
||||
}
|
||||
|
||||
export type SessionRevertErrors = {
|
||||
/**
|
||||
* Bad request
|
||||
*/
|
||||
400: BadRequestError
|
||||
/**
|
||||
* NotFoundError
|
||||
*/
|
||||
404: NotFoundError
|
||||
}
|
||||
|
||||
export type SessionRevertError = SessionRevertErrors[keyof SessionRevertErrors]
|
||||
|
||||
export type SessionRevertResponses = {
|
||||
/**
|
||||
* Updated session
|
||||
*/
|
||||
200: Session
|
||||
}
|
||||
|
||||
export type SessionRevertResponse = SessionRevertResponses[keyof SessionRevertResponses]
|
||||
|
||||
export type SessionUnrevertData = {
|
||||
body?: never
|
||||
path: {
|
||||
id: string
|
||||
}
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/session/{id}/unrevert"
|
||||
}
|
||||
|
||||
export type SessionUnrevertErrors = {
|
||||
/**
|
||||
* Bad request
|
||||
*/
|
||||
400: BadRequestError
|
||||
/**
|
||||
* NotFoundError
|
||||
*/
|
||||
404: NotFoundError
|
||||
}
|
||||
|
||||
export type SessionUnrevertError = SessionUnrevertErrors[keyof SessionUnrevertErrors]
|
||||
|
||||
export type SessionUnrevertResponses = {
|
||||
/**
|
||||
* Updated session
|
||||
*/
|
||||
200: Session
|
||||
}
|
||||
|
||||
export type SessionUnrevertResponse = SessionUnrevertResponses[keyof SessionUnrevertResponses]
|
||||
|
||||
export type PermissionRespondData = {
|
||||
body?: {
|
||||
response: "once" | "always" | "reject"
|
||||
}
|
||||
path: {
|
||||
id: string
|
||||
permissionID: string
|
||||
}
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/session/{id}/permissions/{permissionID}"
|
||||
}
|
||||
|
||||
export type PermissionRespondErrors = {
|
||||
/**
|
||||
* Bad request
|
||||
*/
|
||||
400: BadRequestError
|
||||
/**
|
||||
* NotFoundError
|
||||
*/
|
||||
404: NotFoundError
|
||||
}
|
||||
|
||||
export type PermissionRespondError = PermissionRespondErrors[keyof PermissionRespondErrors]
|
||||
|
||||
export type PermissionRespondResponses = {
|
||||
/**
|
||||
* Permission processed successfully
|
||||
*/
|
||||
200: boolean
|
||||
}
|
||||
|
||||
export type PermissionRespondResponse = PermissionRespondResponses[keyof PermissionRespondResponses]
|
||||
|
||||
export type PartDeleteData = {
|
||||
body?: never
|
||||
path: {
|
||||
id: string
|
||||
messageID: string
|
||||
partID: string
|
||||
}
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/session/{id}/message/{messageID}/part/{partID}"
|
||||
}
|
||||
|
||||
export type PartDeleteErrors = {
|
||||
/**
|
||||
* Bad request
|
||||
*/
|
||||
400: BadRequestError
|
||||
/**
|
||||
* NotFoundError
|
||||
*/
|
||||
404: NotFoundError
|
||||
}
|
||||
|
||||
export type PartDeleteError = PartDeleteErrors[keyof PartDeleteErrors]
|
||||
|
||||
export type PartDeleteResponses = {
|
||||
/**
|
||||
* Successfully deleted part
|
||||
*/
|
||||
200: boolean
|
||||
}
|
||||
|
||||
export type PartDeleteResponse = PartDeleteResponses[keyof PartDeleteResponses]
|
||||
|
||||
export type PartUpdateData = {
|
||||
body?: Part
|
||||
path: {
|
||||
id: string
|
||||
messageID: string
|
||||
partID: string
|
||||
}
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/session/{id}/message/{messageID}/part/{partID}"
|
||||
}
|
||||
|
||||
export type PartUpdateErrors = {
|
||||
/**
|
||||
* Bad request
|
||||
*/
|
||||
400: BadRequestError
|
||||
/**
|
||||
* NotFoundError
|
||||
*/
|
||||
404: NotFoundError
|
||||
}
|
||||
|
||||
export type PartUpdateError = PartUpdateErrors[keyof PartUpdateErrors]
|
||||
|
||||
export type PartUpdateResponses = {
|
||||
/**
|
||||
* Successfully updated part
|
||||
*/
|
||||
200: Part
|
||||
}
|
||||
|
||||
export type PartUpdateResponse = PartUpdateResponses[keyof PartUpdateResponses]
|
||||
|
||||
export type SyncStartData = {
|
||||
body?: never
|
||||
path?: never
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/sync/start"
|
||||
}
|
||||
|
||||
export type SyncStartResponses = {
|
||||
/**
|
||||
* Workspace sync started
|
||||
*/
|
||||
200: boolean
|
||||
}
|
||||
|
||||
export type SyncStartResponse = SyncStartResponses[keyof SyncStartResponses]
|
||||
|
||||
export type SyncReplayData = {
|
||||
body?: {
|
||||
directory: string
|
||||
events: Array<{
|
||||
id: string
|
||||
aggregateID: string
|
||||
seq: number
|
||||
type: string
|
||||
data: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
}>
|
||||
}
|
||||
path?: never
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/sync/replay"
|
||||
}
|
||||
|
||||
export type SyncReplayErrors = {
|
||||
/**
|
||||
* Bad request
|
||||
*/
|
||||
400: BadRequestError
|
||||
}
|
||||
|
||||
export type SyncReplayError = SyncReplayErrors[keyof SyncReplayErrors]
|
||||
|
||||
export type SyncReplayResponses = {
|
||||
/**
|
||||
* Replayed sync events
|
||||
*/
|
||||
200: {
|
||||
sessionID: string
|
||||
}
|
||||
}
|
||||
|
||||
export type SyncReplayResponse = SyncReplayResponses[keyof SyncReplayResponses]
|
||||
|
||||
export type SyncStealData = {
|
||||
body?: {
|
||||
sessionID: string
|
||||
}
|
||||
path?: never
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/sync/steal"
|
||||
}
|
||||
|
||||
export type SyncStealErrors = {
|
||||
/**
|
||||
* Bad request
|
||||
*/
|
||||
400: BadRequestError
|
||||
}
|
||||
|
||||
export type SyncStealError = SyncStealErrors[keyof SyncStealErrors]
|
||||
|
||||
export type SyncStealResponses = {
|
||||
/**
|
||||
* Session stolen into workspace
|
||||
*/
|
||||
200: {
|
||||
sessionID: string
|
||||
}
|
||||
}
|
||||
|
||||
export type SyncStealResponse = SyncStealResponses[keyof SyncStealResponses]
|
||||
|
||||
export type SyncHistoryListData = {
|
||||
body?: {
|
||||
[key: string]: number
|
||||
}
|
||||
path?: never
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/sync/history"
|
||||
}
|
||||
|
||||
export type SyncHistoryListErrors = {
|
||||
/**
|
||||
* Bad request
|
||||
*/
|
||||
400: BadRequestError
|
||||
}
|
||||
|
||||
export type SyncHistoryListError = SyncHistoryListErrors[keyof SyncHistoryListErrors]
|
||||
|
||||
export type SyncHistoryListResponses = {
|
||||
/**
|
||||
* Sync events
|
||||
*/
|
||||
200: Array<{
|
||||
id: string
|
||||
aggregate_id: string
|
||||
seq: number
|
||||
type: string
|
||||
data: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
}>
|
||||
}
|
||||
|
||||
export type SyncHistoryListResponse = SyncHistoryListResponses[keyof SyncHistoryListResponses]
|
||||
|
||||
export type TuiAppendPromptData = {
|
||||
body?: {
|
||||
@@ -3604,6 +6628,7 @@ export type TuiAppendPromptData = {
|
||||
path?: never
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/tui/append-prompt"
|
||||
}
|
||||
@@ -3631,6 +6656,7 @@ export type TuiOpenHelpData = {
|
||||
path?: never
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/tui/open-help"
|
||||
}
|
||||
@@ -3649,6 +6675,7 @@ export type TuiOpenSessionsData = {
|
||||
path?: never
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/tui/open-sessions"
|
||||
}
|
||||
@@ -3667,6 +6694,7 @@ export type TuiOpenThemesData = {
|
||||
path?: never
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/tui/open-themes"
|
||||
}
|
||||
@@ -3685,6 +6713,7 @@ export type TuiOpenModelsData = {
|
||||
path?: never
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/tui/open-models"
|
||||
}
|
||||
@@ -3703,6 +6732,7 @@ export type TuiSubmitPromptData = {
|
||||
path?: never
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/tui/submit-prompt"
|
||||
}
|
||||
@@ -3721,6 +6751,7 @@ export type TuiClearPromptData = {
|
||||
path?: never
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/tui/clear-prompt"
|
||||
}
|
||||
@@ -3741,6 +6772,7 @@ export type TuiExecuteCommandData = {
|
||||
path?: never
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/tui/execute-command"
|
||||
}
|
||||
@@ -3768,14 +6800,12 @@ export type TuiShowToastData = {
|
||||
title?: string
|
||||
message: string
|
||||
variant: "info" | "success" | "warning" | "error"
|
||||
/**
|
||||
* Duration in milliseconds
|
||||
*/
|
||||
duration?: number
|
||||
}
|
||||
path?: never
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/tui/show-toast"
|
||||
}
|
||||
@@ -3790,10 +6820,11 @@ export type TuiShowToastResponses = {
|
||||
export type TuiShowToastResponse = TuiShowToastResponses[keyof TuiShowToastResponses]
|
||||
|
||||
export type TuiPublishData = {
|
||||
body?: EventTuiPromptAppend | EventTuiCommandExecute | EventTuiToastShow
|
||||
body?: EventTuiPromptAppend2 | EventTuiCommandExecute2 | EventTuiToastShow2 | EventTuiSessionSelect2
|
||||
path?: never
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/tui/publish"
|
||||
}
|
||||
@@ -3816,11 +6847,49 @@ export type TuiPublishResponses = {
|
||||
|
||||
export type TuiPublishResponse = TuiPublishResponses[keyof TuiPublishResponses]
|
||||
|
||||
export type TuiSelectSessionData = {
|
||||
body?: {
|
||||
/**
|
||||
* Session ID to navigate to
|
||||
*/
|
||||
sessionID: string
|
||||
}
|
||||
path?: never
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/tui/select-session"
|
||||
}
|
||||
|
||||
export type TuiSelectSessionErrors = {
|
||||
/**
|
||||
* Bad request
|
||||
*/
|
||||
400: BadRequestError
|
||||
/**
|
||||
* NotFoundError
|
||||
*/
|
||||
404: NotFoundError
|
||||
}
|
||||
|
||||
export type TuiSelectSessionError = TuiSelectSessionErrors[keyof TuiSelectSessionErrors]
|
||||
|
||||
export type TuiSelectSessionResponses = {
|
||||
/**
|
||||
* Session selected successfully
|
||||
*/
|
||||
200: boolean
|
||||
}
|
||||
|
||||
export type TuiSelectSessionResponse = TuiSelectSessionResponses[keyof TuiSelectSessionResponses]
|
||||
|
||||
export type TuiControlNextData = {
|
||||
body?: never
|
||||
path?: never
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/tui/control/next"
|
||||
}
|
||||
@@ -3842,6 +6911,7 @@ export type TuiControlResponseData = {
|
||||
path?: never
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/tui/control/response"
|
||||
}
|
||||
@@ -3855,53 +6925,223 @@ export type TuiControlResponseResponses = {
|
||||
|
||||
export type TuiControlResponseResponse = TuiControlResponseResponses[keyof TuiControlResponseResponses]
|
||||
|
||||
export type AuthSetData = {
|
||||
body?: Auth
|
||||
path: {
|
||||
id: string
|
||||
}
|
||||
export type ExperimentalWorkspaceAdapterListData = {
|
||||
body?: never
|
||||
path?: never
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/auth/{id}"
|
||||
url: "/experimental/workspace/adapter"
|
||||
}
|
||||
|
||||
export type AuthSetErrors = {
|
||||
export type ExperimentalWorkspaceAdapterListResponses = {
|
||||
/**
|
||||
* Workspace adapters
|
||||
*/
|
||||
200: Array<{
|
||||
type: string
|
||||
name: string
|
||||
description: string
|
||||
}>
|
||||
}
|
||||
|
||||
export type ExperimentalWorkspaceAdapterListResponse =
|
||||
ExperimentalWorkspaceAdapterListResponses[keyof ExperimentalWorkspaceAdapterListResponses]
|
||||
|
||||
export type ExperimentalWorkspaceListData = {
|
||||
body?: never
|
||||
path?: never
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/experimental/workspace"
|
||||
}
|
||||
|
||||
export type ExperimentalWorkspaceListResponses = {
|
||||
/**
|
||||
* Workspaces
|
||||
*/
|
||||
200: Array<Workspace>
|
||||
}
|
||||
|
||||
export type ExperimentalWorkspaceListResponse =
|
||||
ExperimentalWorkspaceListResponses[keyof ExperimentalWorkspaceListResponses]
|
||||
|
||||
export type ExperimentalWorkspaceCreateData = {
|
||||
body?: {
|
||||
id?: string
|
||||
type: string
|
||||
branch?: string | null
|
||||
extra?: unknown | null
|
||||
}
|
||||
path?: never
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/experimental/workspace"
|
||||
}
|
||||
|
||||
export type ExperimentalWorkspaceCreateErrors = {
|
||||
/**
|
||||
* Bad request
|
||||
*/
|
||||
400: BadRequestError
|
||||
}
|
||||
|
||||
export type AuthSetError = AuthSetErrors[keyof AuthSetErrors]
|
||||
export type ExperimentalWorkspaceCreateError =
|
||||
ExperimentalWorkspaceCreateErrors[keyof ExperimentalWorkspaceCreateErrors]
|
||||
|
||||
export type AuthSetResponses = {
|
||||
export type ExperimentalWorkspaceCreateResponses = {
|
||||
/**
|
||||
* Successfully set authentication credentials
|
||||
* Workspace created
|
||||
*/
|
||||
200: boolean
|
||||
200: Workspace
|
||||
}
|
||||
|
||||
export type AuthSetResponse = AuthSetResponses[keyof AuthSetResponses]
|
||||
export type ExperimentalWorkspaceCreateResponse =
|
||||
ExperimentalWorkspaceCreateResponses[keyof ExperimentalWorkspaceCreateResponses]
|
||||
|
||||
export type EventSubscribeData = {
|
||||
export type ExperimentalWorkspaceSyncListData = {
|
||||
body?: never
|
||||
path?: never
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/event"
|
||||
url: "/experimental/workspace/sync-list"
|
||||
}
|
||||
|
||||
export type EventSubscribeResponses = {
|
||||
export type ExperimentalWorkspaceSyncListResponses = {
|
||||
/**
|
||||
* Event stream
|
||||
* Workspace list synced
|
||||
*/
|
||||
200: Event
|
||||
204: void
|
||||
}
|
||||
|
||||
export type EventSubscribeResponse = EventSubscribeResponses[keyof EventSubscribeResponses]
|
||||
export type ExperimentalWorkspaceSyncListResponse =
|
||||
ExperimentalWorkspaceSyncListResponses[keyof ExperimentalWorkspaceSyncListResponses]
|
||||
|
||||
export type ClientOptions = {
|
||||
baseUrl: `${string}://${string}` | (string & {})
|
||||
export type ExperimentalWorkspaceStatusData = {
|
||||
body?: never
|
||||
path?: never
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/experimental/workspace/status"
|
||||
}
|
||||
|
||||
export type ExperimentalWorkspaceStatusResponses = {
|
||||
/**
|
||||
* Workspace status
|
||||
*/
|
||||
200: Array<{
|
||||
workspaceID: string
|
||||
status: "connected" | "connecting" | "disconnected" | "error"
|
||||
}>
|
||||
}
|
||||
|
||||
export type ExperimentalWorkspaceStatusResponse =
|
||||
ExperimentalWorkspaceStatusResponses[keyof ExperimentalWorkspaceStatusResponses]
|
||||
|
||||
export type ExperimentalWorkspaceRemoveData = {
|
||||
body?: never
|
||||
path: {
|
||||
id: string
|
||||
}
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/experimental/workspace/{id}"
|
||||
}
|
||||
|
||||
export type ExperimentalWorkspaceRemoveErrors = {
|
||||
/**
|
||||
* Bad request
|
||||
*/
|
||||
400: BadRequestError
|
||||
}
|
||||
|
||||
export type ExperimentalWorkspaceRemoveError =
|
||||
ExperimentalWorkspaceRemoveErrors[keyof ExperimentalWorkspaceRemoveErrors]
|
||||
|
||||
export type ExperimentalWorkspaceRemoveResponses = {
|
||||
/**
|
||||
* Workspace removed
|
||||
*/
|
||||
200: Workspace
|
||||
}
|
||||
|
||||
export type ExperimentalWorkspaceRemoveResponse =
|
||||
ExperimentalWorkspaceRemoveResponses[keyof ExperimentalWorkspaceRemoveResponses]
|
||||
|
||||
export type ExperimentalWorkspaceWarpData = {
|
||||
body?: {
|
||||
id: string | null
|
||||
sessionID: string
|
||||
copyChanges?: boolean
|
||||
}
|
||||
path?: never
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/experimental/workspace/warp"
|
||||
}
|
||||
|
||||
export type ExperimentalWorkspaceWarpErrors = {
|
||||
/**
|
||||
* WorkspaceWarpError | VcsApplyError
|
||||
*/
|
||||
400: WorkspaceWarpError | VcsApplyError
|
||||
}
|
||||
|
||||
export type ExperimentalWorkspaceWarpError = ExperimentalWorkspaceWarpErrors[keyof ExperimentalWorkspaceWarpErrors]
|
||||
|
||||
export type ExperimentalWorkspaceWarpResponses = {
|
||||
/**
|
||||
* Session warped
|
||||
*/
|
||||
204: void
|
||||
}
|
||||
|
||||
export type ExperimentalWorkspaceWarpResponse =
|
||||
ExperimentalWorkspaceWarpResponses[keyof ExperimentalWorkspaceWarpResponses]
|
||||
|
||||
export type PtyConnectData = {
|
||||
body?: never
|
||||
path: {
|
||||
ptyID: string
|
||||
}
|
||||
query?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
url: "/pty/{ptyID}/connect"
|
||||
}
|
||||
|
||||
export type PtyConnectErrors = {
|
||||
/**
|
||||
* Forbidden
|
||||
*/
|
||||
403: EffectHttpApiErrorForbidden
|
||||
/**
|
||||
* Not found
|
||||
*/
|
||||
404: NotFoundError
|
||||
}
|
||||
|
||||
export type PtyConnectError = PtyConnectErrors[keyof PtyConnectErrors]
|
||||
|
||||
export type PtyConnectResponses = {
|
||||
/**
|
||||
* Connected session
|
||||
*/
|
||||
200: boolean
|
||||
}
|
||||
|
||||
export type PtyConnectResponse = PtyConnectResponses[keyof PtyConnectResponses]
|
||||
|
||||
@@ -148,7 +148,7 @@ const result = await client.session.prompt({
|
||||
})
|
||||
|
||||
// Access the structured output
|
||||
console.log(result.data.info.structured_output)
|
||||
console.log(result.data.info.structured)
|
||||
// { company: "Anthropic", founded: 2021, products: ["Claude", "Claude API"] }
|
||||
```
|
||||
|
||||
@@ -175,8 +175,8 @@ console.log(result.data.info.structured_output)
|
||||
|
||||
```typescript
|
||||
if (result.data.info.error?.name === "StructuredOutputError") {
|
||||
console.error("Failed to produce structured output:", result.data.info.error.message)
|
||||
console.error("Attempts:", result.data.info.error.retries)
|
||||
console.error("Failed to produce structured output:", result.data.info.error.data.message)
|
||||
console.error("Attempts:", result.data.info.error.data.retries)
|
||||
}
|
||||
```
|
||||
|
||||
@@ -313,7 +313,7 @@ const { providers, default: defaults } = await client.config.providers()
|
||||
| `session.summarize({ path, body })` | تلخيص جلسة | يعيد `boolean` |
|
||||
| `session.messages({ path })` | سرد الرسائل في جلسة | يعيد `{ info: `<a href={typesUrl}><code>Message</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}[]` |
|
||||
| `session.message({ path })` | جلب تفاصيل الرسالة | يعيد `{ info: `<a href={typesUrl}><code>Message</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}` |
|
||||
| `session.prompt({ path, body })` | إرسال رسالة مطالبة | `body.noReply: true` يعيد UserMessage (للسياق فقط). الافتراضي يعيد <a href={typesUrl}><code>AssistantMessage</code></a> مع استجابة AI. يدعم `body.outputFormat` من أجل [المخرجات المنظمة](#المخرجات-المنظمة) |
|
||||
| `session.prompt({ path, body })` | إرسال رسالة مطالبة | `body.noReply: true` يعيد UserMessage (للسياق فقط). الافتراضي يعيد <a href={typesUrl}><code>AssistantMessage</code></a> مع استجابة AI. يدعم `body.format` من أجل [المخرجات المنظمة](#المخرجات-المنظمة) |
|
||||
| `session.command({ path, body })` | إرسال أمر إلى الجلسة | يعيد `{ info: `<a href={typesUrl}><code>AssistantMessage</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}` |
|
||||
| `session.shell({ path, body })` | تشغيل أمر shell | يعيد <a href={typesUrl}><code>AssistantMessage</code></a> |
|
||||
| `session.revert({ path, body })` | التراجع عن رسالة | يعيد <a href={typesUrl}><code>Session</code></a> |
|
||||
|
||||
@@ -148,7 +148,7 @@ const result = await client.session.prompt({
|
||||
})
|
||||
|
||||
// Access the structured output
|
||||
console.log(result.data.info.structured_output)
|
||||
console.log(result.data.info.structured)
|
||||
// { company: "Anthropic", founded: 2021, products: ["Claude", "Claude API"] }
|
||||
```
|
||||
|
||||
@@ -175,8 +175,8 @@ Ako model ne uspije proizvesti validan strukturirani izlaz nakon svih ponovnih p
|
||||
|
||||
```typescript
|
||||
if (result.data.info.error?.name === "StructuredOutputError") {
|
||||
console.error("Failed to produce structured output:", result.data.info.error.message)
|
||||
console.error("Attempts:", result.data.info.error.retries)
|
||||
console.error("Failed to produce structured output:", result.data.info.error.data.message)
|
||||
console.error("Attempts:", result.data.info.error.data.retries)
|
||||
}
|
||||
```
|
||||
|
||||
@@ -313,7 +313,7 @@ const { providers, default: defaults } = await client.config.providers()
|
||||
| `session.summarize({ path, body })` | Summarize session | Returns `boolean` |
|
||||
| `session.messages({ path })` | List messages in a session | Returns `{ info: `<a href={typesUrl}><code>Message</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}[]` |
|
||||
| `session.message({ path })` | Get message details | Returns `{ info: `<a href={typesUrl}><code>Message</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}` |
|
||||
| `session.prompt({ path, body })` | Send prompt message | `body.noReply: true` returns UserMessage (context only). Default returns <a href={typesUrl}><code>AssistantMessage</code></a> with AI response. Supports `body.outputFormat` for [structured output](#strukturirani-izlaz) |
|
||||
| `session.prompt({ path, body })` | Send prompt message | `body.noReply: true` returns UserMessage (context only). Default returns <a href={typesUrl}><code>AssistantMessage</code></a> with AI response. Supports `body.format` for [structured output](#strukturirani-izlaz) |
|
||||
| `session.command({ path, body })` | Send command to session | Returns `{ info: `<a href={typesUrl}><code>AssistantMessage</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}` |
|
||||
| `session.shell({ path, body })` | Run a shell command | Returns <a href={typesUrl}><code>AssistantMessage</code></a> |
|
||||
| `session.revert({ path, body })` | Revert a message | Returns <a href={typesUrl}><code>Session</code></a> |
|
||||
|
||||
@@ -148,7 +148,7 @@ const result = await client.session.prompt({
|
||||
})
|
||||
|
||||
// Access the structured output
|
||||
console.log(result.data.info.structured_output)
|
||||
console.log(result.data.info.structured)
|
||||
// { company: "Anthropic", founded: 2021, products: ["Claude", "Claude API"] }
|
||||
```
|
||||
|
||||
@@ -175,8 +175,8 @@ Hvis modellen ikke formår at producere gyldigt struktureret output efter alle f
|
||||
|
||||
```typescript
|
||||
if (result.data.info.error?.name === "StructuredOutputError") {
|
||||
console.error("Failed to produce structured output:", result.data.info.error.message)
|
||||
console.error("Attempts:", result.data.info.error.retries)
|
||||
console.error("Failed to produce structured output:", result.data.info.error.data.message)
|
||||
console.error("Attempts:", result.data.info.error.data.retries)
|
||||
}
|
||||
```
|
||||
|
||||
@@ -313,7 +313,7 @@ const { providers, default: defaults } = await client.config.providers()
|
||||
| `session.summarize({ path, body })` | Oppsummer sessionen | Returnerer `boolean` |
|
||||
| `session.messages({ path })` | Liste meldinger i en session | Returnerer `{ info: `<a href={typesUrl}><code>Message</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}[]` |
|
||||
| `session.message({ path })` | Få meldingsdetaljer | Returnerer `{ info: `<a href={typesUrl}><code>Message</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}` |
|
||||
| `session.prompt({ path, body })` | Send melding | `body.noReply: true` returnerer UserMessage (kun kontekst). Standard returnerer <a href={typesUrl}><code>AssistantMessage</code></a> med AI svar. Understøtter `body.outputFormat` for [struktureret output](#struktureret-output) |
|
||||
| `session.prompt({ path, body })` | Send melding | `body.noReply: true` returnerer UserMessage (kun kontekst). Standard returnerer <a href={typesUrl}><code>AssistantMessage</code></a> med AI svar. Understøtter `body.format` for [struktureret output](#struktureret-output) |
|
||||
| `session.command({ path, body })` | Send kommando til session | Returnerer `{ info: `<a href={typesUrl}><code>AssistantMessage</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}` |
|
||||
| `session.shell({ path, body })` | Kjør en shell-kommando | Returnerer <a href={typesUrl}><code>AssistantMessage</code></a> |
|
||||
| `session.revert({ path, body })` | Tilbakestill en melding | Returnerer <a href={typesUrl}><code>Session</code></a> |
|
||||
|
||||
@@ -150,7 +150,7 @@ const result = await client.session.prompt({
|
||||
})
|
||||
|
||||
// Zugriff auf die strukturierte Ausgabe
|
||||
console.log(result.data.info.structured_output)
|
||||
console.log(result.data.info.structured)
|
||||
// { company: "Anthropic", founded: 2021, products: ["Claude", "Claude API"] }
|
||||
```
|
||||
|
||||
@@ -177,8 +177,8 @@ Wenn das Modell nach allen Wiederholungen keine valide strukturierte Ausgabe lie
|
||||
|
||||
```typescript
|
||||
if (result.data.info.error?.name === "StructuredOutputError") {
|
||||
console.error("Strukturierte Ausgabe fehlgeschlagen:", result.data.info.error.message)
|
||||
console.error("Versuche:", result.data.info.error.retries)
|
||||
console.error("Strukturierte Ausgabe fehlgeschlagen:", result.data.info.error.data.message)
|
||||
console.error("Versuche:", result.data.info.error.data.retries)
|
||||
}
|
||||
```
|
||||
|
||||
@@ -315,7 +315,7 @@ const { providers, default: defaults } = await client.config.providers()
|
||||
| `session.summarize({ path, body })` | Fasst Session zusammen | Gibt `boolean` zurueck |
|
||||
| `session.messages({ path })` | Listet Nachrichten einer Session | Gibt `{ info: `<a href={typesUrl}><code>Message</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}[]` zurueck |
|
||||
| `session.message({ path })` | Ruft Nachrichtendetails ab | Gibt `{ info: `<a href={typesUrl}><code>Message</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}` zurueck |
|
||||
| `session.prompt({ path, body })` | Sendet Prompt-Nachricht | `body.noReply: true` gibt UserMessage (nur Kontext) zurueck. Standard gibt <a href={typesUrl}><code>AssistantMessage</code></a> mit AI-Antwort zurueck. Unterstuetzt `body.outputFormat` fuer [strukturierte Ausgabe](#structured-output) |
|
||||
| `session.prompt({ path, body })` | Sendet Prompt-Nachricht | `body.noReply: true` gibt UserMessage (nur Kontext) zurueck. Standard gibt <a href={typesUrl}><code>AssistantMessage</code></a> mit AI-Antwort zurueck. Unterstuetzt `body.format` fuer [strukturierte Ausgabe](#structured-output) |
|
||||
| `session.command({ path, body })` | Sendet Befehl an Session | Gibt `{ info: `<a href={typesUrl}><code>AssistantMessage</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}` zurueck |
|
||||
| `session.shell({ path, body })` | Fuehrt Shell-Befehl aus | Gibt <a href={typesUrl}><code>AssistantMessage</code></a> zurueck |
|
||||
| `session.revert({ path, body })` | Setzt Nachricht zurueck | Gibt <a href={typesUrl}><code>Session</code></a> zurueck |
|
||||
|
||||
@@ -148,7 +148,7 @@ const result = await client.session.prompt({
|
||||
})
|
||||
|
||||
// Access the structured output
|
||||
console.log(result.data.info.structured_output)
|
||||
console.log(result.data.info.structured)
|
||||
// { company: "Anthropic", founded: 2021, products: ["Claude", "Claude API"] }
|
||||
```
|
||||
|
||||
@@ -175,8 +175,8 @@ Si el modelo no logra producir una salida estructurada válida después de todos
|
||||
|
||||
```typescript
|
||||
if (result.data.info.error?.name === "StructuredOutputError") {
|
||||
console.error("Failed to produce structured output:", result.data.info.error.message)
|
||||
console.error("Attempts:", result.data.info.error.retries)
|
||||
console.error("Failed to produce structured output:", result.data.info.error.data.message)
|
||||
console.error("Attempts:", result.data.info.error.data.retries)
|
||||
}
|
||||
```
|
||||
|
||||
@@ -313,7 +313,7 @@ const { providers, default: defaults } = await client.config.providers()
|
||||
| `session.summarize({ path, body })` | Resumir sesión | Devuelve `boolean` |
|
||||
| `session.messages({ path })` | Listar mensajes en una sesión | Devuelve `{ info: `<a href={typesUrl}><code>Message</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}[]` |
|
||||
| `session.message({ path })` | Obtener detalles del mensaje | Devuelve `{ info: `<a href={typesUrl}><code>Message</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}` |
|
||||
| `session.prompt({ path, body })` | Enviar mensaje rápido | `body.noReply: true` devuelve UserMessage (solo contexto). El valor predeterminado devuelve <a href={typesUrl}><code>AssistantMessage</code></a> con respuesta de IA. Admite `body.outputFormat` para [salida estructurada](#salida-estructurada) |
|
||||
| `session.prompt({ path, body })` | Enviar mensaje rápido | `body.noReply: true` devuelve UserMessage (solo contexto). El valor predeterminado devuelve <a href={typesUrl}><code>AssistantMessage</code></a> con respuesta de IA. Admite `body.format` para [salida estructurada](#salida-estructurada) |
|
||||
| `session.command({ path, body })` | Enviar comando a la sesión | Devuelve `{ info: `<a href={typesUrl}><code>AssistantMessage</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}` |
|
||||
| `session.shell({ path, body })` | Ejecute un comando de shell | Devuelve <a href={typesUrl}><code>AssistantMessage</code></a> |
|
||||
| `session.revert({ path, body })` | Revertir un mensaje | Devuelve <a href={typesUrl}><code>Session</code></a> |
|
||||
|
||||
@@ -148,7 +148,7 @@ const result = await client.session.prompt({
|
||||
})
|
||||
|
||||
// Access the structured output
|
||||
console.log(result.data.info.structured_output)
|
||||
console.log(result.data.info.structured)
|
||||
// { company: "Anthropic", founded: 2021, products: ["Claude", "Claude API"] }
|
||||
```
|
||||
|
||||
@@ -175,8 +175,8 @@ Si le modèle ne parvient pas à produire une sortie structurée valide après t
|
||||
|
||||
```typescript
|
||||
if (result.data.info.error?.name === "StructuredOutputError") {
|
||||
console.error("Failed to produce structured output:", result.data.info.error.message)
|
||||
console.error("Attempts:", result.data.info.error.retries)
|
||||
console.error("Failed to produce structured output:", result.data.info.error.data.message)
|
||||
console.error("Attempts:", result.data.info.error.data.retries)
|
||||
}
|
||||
```
|
||||
|
||||
@@ -313,7 +313,7 @@ const { providers, default: defaults } = await client.config.providers()
|
||||
| `session.summarize({ path, body })` | Résumer la séance | Renvoie `boolean` |
|
||||
| `session.messages({ path })` | Liste des messages dans une session | Renvoie `{ info: `<a href={typesUrl}><code>Message</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}[]` |
|
||||
| `session.message({ path })` | Obtenir les détails du message | Renvoie `{ info: `<a href={typesUrl}><code>Message</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}` |
|
||||
| `session.prompt({ path, body })` | Envoyer un message d'invite | `body.noReply: true` renvoie UserMessage (contexte uniquement). La valeur par défaut renvoie <a href={typesUrl}><code>AssistantMessage</code></a> avec réponse IA. Prend en charge `body.outputFormat` pour [sortie structurée](#structured-output) |
|
||||
| `session.prompt({ path, body })` | Envoyer un message d'invite | `body.noReply: true` renvoie UserMessage (contexte uniquement). La valeur par défaut renvoie <a href={typesUrl}><code>AssistantMessage</code></a> avec réponse IA. Prend en charge `body.format` pour [sortie structurée](#structured-output) |
|
||||
| `session.command({ path, body })` | Envoyer la commande à la session | Renvoie `{ info: `<a href={typesUrl}><code>AssistantMessage</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}` |
|
||||
| `session.shell({ path, body })` | Exécuter une commande shell | Renvoie <a href={typesUrl}><code>AssistantMessage</code></a> |
|
||||
| `session.revert({ path, body })` | Rétablir un message | Renvoie <a href={typesUrl}><code>Session</code></a> |
|
||||
|
||||
@@ -148,7 +148,7 @@ const result = await client.session.prompt({
|
||||
})
|
||||
|
||||
// Access the structured output
|
||||
console.log(result.data.info.structured_output)
|
||||
console.log(result.data.info.structured)
|
||||
// { company: "Anthropic", founded: 2021, products: ["Claude", "Claude API"] }
|
||||
```
|
||||
|
||||
@@ -175,8 +175,8 @@ Se il modello non riesce a produrre un output strutturato valido dopo tutti i te
|
||||
|
||||
```typescript
|
||||
if (result.data.info.error?.name === "StructuredOutputError") {
|
||||
console.error("Failed to produce structured output:", result.data.info.error.message)
|
||||
console.error("Attempts:", result.data.info.error.retries)
|
||||
console.error("Failed to produce structured output:", result.data.info.error.data.message)
|
||||
console.error("Attempts:", result.data.info.error.data.retries)
|
||||
}
|
||||
```
|
||||
|
||||
@@ -313,7 +313,7 @@ const { providers, default: defaults } = await client.config.providers()
|
||||
| `session.summarize({ path, body })` | Riassume la sessione | Returns `boolean` |
|
||||
| `session.messages({ path })` | Elenca i messaggi della sessione | Returns `{ info: `<a href={typesUrl}><code>Message</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}[]` |
|
||||
| `session.message({ path })` | Ottieni dettagli di un messaggio | Returns `{ info: `<a href={typesUrl}><code>Message</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}` |
|
||||
| `session.prompt({ path, body })` | Invia un prompt | `body.noReply: true` returns UserMessage (solo contesto). Di default ritorna <a href={typesUrl}><code>AssistantMessage</code></a> con risposta AI. Supporta `body.outputFormat` per [output strutturato](#output-strutturato) |
|
||||
| `session.prompt({ path, body })` | Invia un prompt | `body.noReply: true` returns UserMessage (solo contesto). Di default ritorna <a href={typesUrl}><code>AssistantMessage</code></a> con risposta AI. Supporta `body.format` per [output strutturato](#output-strutturato) |
|
||||
| `session.command({ path, body })` | Invia un comando alla sessione | Returns `{ info: `<a href={typesUrl}><code>AssistantMessage</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}` |
|
||||
| `session.shell({ path, body })` | Esegue un comando shell | Returns <a href={typesUrl}><code>AssistantMessage</code></a> |
|
||||
| `session.revert({ path, body })` | Ripristina un messaggio | Returns <a href={typesUrl}><code>Session</code></a> |
|
||||
|
||||
@@ -148,7 +148,7 @@ const result = await client.session.prompt({
|
||||
})
|
||||
|
||||
// Access the structured output
|
||||
console.log(result.data.info.structured_output)
|
||||
console.log(result.data.info.structured)
|
||||
// { company: "Anthropic", founded: 2021, products: ["Claude", "Claude API"] }
|
||||
```
|
||||
|
||||
@@ -175,8 +175,8 @@ console.log(result.data.info.structured_output)
|
||||
|
||||
```typescript
|
||||
if (result.data.info.error?.name === "StructuredOutputError") {
|
||||
console.error("Failed to produce structured output:", result.data.info.error.message)
|
||||
console.error("Attempts:", result.data.info.error.retries)
|
||||
console.error("Failed to produce structured output:", result.data.info.error.data.message)
|
||||
console.error("Attempts:", result.data.info.error.data.retries)
|
||||
}
|
||||
```
|
||||
|
||||
@@ -313,7 +313,7 @@ const { providers, default: defaults } = await client.config.providers()
|
||||
| `session.summarize({ path, body })` | セッションを要約する | 戻り値 `boolean` |
|
||||
| `session.messages({ path })` | セッション内のメッセージをリストする | 戻り値 `{ info: `<a href={typesUrl}><code>Message</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}[]` |
|
||||
| `session.message({ path })` | メッセージの詳細を取得する | 戻り値 `{ info: `<a href={typesUrl}><code>Message</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}` |
|
||||
| `session.prompt({ path, body })` | プロンプトメッセージを送信する | `body.noReply: true` は UserMessage (コンテキストのみ) を返します。デフォルトでは、AI 応答を含む <a href={typesUrl}><code>AssistantMessage</code></a> を返します。[構造化出力](#構造化出力) のための `body.outputFormat` をサポートします。 |
|
||||
| `session.prompt({ path, body })` | プロンプトメッセージを送信する | `body.noReply: true` は UserMessage (コンテキストのみ) を返します。デフォルトでは、AI 応答を含む <a href={typesUrl}><code>AssistantMessage</code></a> を返します。[構造化出力](#構造化出力) のための `body.format` をサポートします。 |
|
||||
| `session.command({ path, body })` | コマンドをセッションに送信 | 戻り値 `{ info: `<a href={typesUrl}><code>AssistantMessage</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}` |
|
||||
| `session.shell({ path, body })` | シェルコマンドを実行する | 戻り値 <a href={typesUrl}><code>AssistantMessage</code></a> |
|
||||
| `session.revert({ path, body })` | メッセージを元に戻す | 戻り値 <a href={typesUrl}><code>Session</code></a> |
|
||||
|
||||
@@ -148,7 +148,7 @@ const result = await client.session.prompt({
|
||||
})
|
||||
|
||||
// Access the structured output
|
||||
console.log(result.data.info.structured_output)
|
||||
console.log(result.data.info.structured)
|
||||
// { company: "Anthropic", founded: 2021, products: ["Claude", "Claude API"] }
|
||||
```
|
||||
|
||||
@@ -175,8 +175,8 @@ console.log(result.data.info.structured_output)
|
||||
|
||||
```typescript
|
||||
if (result.data.info.error?.name === "StructuredOutputError") {
|
||||
console.error("Failed to produce structured output:", result.data.info.error.message)
|
||||
console.error("Attempts:", result.data.info.error.retries)
|
||||
console.error("Failed to produce structured output:", result.data.info.error.data.message)
|
||||
console.error("Attempts:", result.data.info.error.data.retries)
|
||||
}
|
||||
```
|
||||
|
||||
@@ -313,7 +313,7 @@ const { providers, default: defaults } = await client.config.providers()
|
||||
| `session.summarize({ path, body })` | 세션 요약 | 반품 `boolean` |
|
||||
| `session.messages({ path })` | 세션의 메시지 목록 | `{ info: `<a href={typesUrl}><code>Message</code></a>`, parts: `<a href={typesUrl}><code>Part</code></a>`}[]` |
|
||||
| `session.message({ path })` | 메시지 상세정보 | 반품 `{ info: `<a href={typesUrl}><code>Message</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}` |
|
||||
| `session.prompt({ path, body })` | prompt 메시지 보내기 | `body.noReply: true`는 UserMessage(컨텍스트 전용)를 반환합니다. 기본값은 AI 응답과 함께 <a href={typesUrl}><code>AssistantMessage</code></a>를 반환합니다. [구조화된 출력](#구조화된-출력)을 위한 `body.outputFormat`을 지원합니다 |
|
||||
| `session.prompt({ path, body })` | prompt 메시지 보내기 | `body.noReply: true`는 UserMessage(컨텍스트 전용)를 반환합니다. 기본값은 AI 응답과 함께 <a href={typesUrl}><code>AssistantMessage</code></a>를 반환합니다. [구조화된 출력](#구조화된-출력)을 위한 `body.format`을 지원합니다 |
|
||||
| `session.command({ path, body })` | 세션으로 명령을 전송 | `{ info: `<a href={typesUrl}><code>AssistantMessage</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}` |
|
||||
| `session.shell({ path, body })` | shell 명령을 실행 | <a href={typesUrl}><code>AssistantMessage</code></a> |
|
||||
| `session.revert({ path, body })` | 메시지 다시 변환 | <a href={typesUrl}><code>Session</code></a> |
|
||||
|
||||
@@ -148,7 +148,7 @@ const result = await client.session.prompt({
|
||||
})
|
||||
|
||||
// Access the structured output
|
||||
console.log(result.data.info.structured_output)
|
||||
console.log(result.data.info.structured)
|
||||
// { company: "Anthropic", founded: 2021, products: ["Claude", "Claude API"] }
|
||||
```
|
||||
|
||||
@@ -175,8 +175,8 @@ Hvis modellen ikke klarer å produsere gyldig strukturert utdata etter alle fors
|
||||
|
||||
```typescript
|
||||
if (result.data.info.error?.name === "StructuredOutputError") {
|
||||
console.error("Failed to produce structured output:", result.data.info.error.message)
|
||||
console.error("Attempts:", result.data.info.error.retries)
|
||||
console.error("Failed to produce structured output:", result.data.info.error.data.message)
|
||||
console.error("Attempts:", result.data.info.error.data.retries)
|
||||
}
|
||||
```
|
||||
|
||||
@@ -313,7 +313,7 @@ const { providers, default: defaults } = await client.config.providers()
|
||||
| `session.summarize({ path, body })` | Oppsummer økten | Returnerer `boolean` |
|
||||
| `session.messages({ path })` | List meldinger i en økt | Returnerer `{ info: `<a href={typesUrl}><code>Message</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}[]` |
|
||||
| `session.message({ path })` | Hent meldingsdetaljer | Returnerer `{ info: `<a href={typesUrl}><code>Message</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}` |
|
||||
| `session.prompt({ path, body })` | Send melding | `body.noReply: true` returnerer UserMessage (kun kontekst). Standard returnerer <a href={typesUrl}><code>AssistantMessage</code></a> med AI svar. Støtter `body.outputFormat` for [strukturert utdata](#strukturert-utdata) |
|
||||
| `session.prompt({ path, body })` | Send melding | `body.noReply: true` returnerer UserMessage (kun kontekst). Standard returnerer <a href={typesUrl}><code>AssistantMessage</code></a> med AI svar. Støtter `body.format` for [strukturert utdata](#strukturert-utdata) |
|
||||
| `session.command({ path, body })` | Send kommando til økt | Returnerer `{ info: `<a href={typesUrl}><code>AssistantMessage</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}` |
|
||||
| `session.shell({ path, body })` | Kjør en shell-kommando | Returnerer <a href={typesUrl}><code>AssistantMessage</code></a> |
|
||||
| `session.revert({ path, body })` | Tilbakestill en melding | Returnerer <a href={typesUrl}><code>Session</code></a> |
|
||||
|
||||
@@ -148,7 +148,7 @@ const result = await client.session.prompt({
|
||||
})
|
||||
|
||||
// Access the structured output
|
||||
console.log(result.data.info.structured_output)
|
||||
console.log(result.data.info.structured)
|
||||
// { company: "Anthropic", founded: 2021, products: ["Claude", "Claude API"] }
|
||||
```
|
||||
|
||||
@@ -175,8 +175,8 @@ Jeśli model nie wygeneruje prawidłowych ustrukturyzowanych danych wyjściowych
|
||||
|
||||
```typescript
|
||||
if (result.data.info.error?.name === "StructuredOutputError") {
|
||||
console.error("Failed to produce structured output:", result.data.info.error.message)
|
||||
console.error("Attempts:", result.data.info.error.retries)
|
||||
console.error("Failed to produce structured output:", result.data.info.error.data.message)
|
||||
console.error("Attempts:", result.data.info.error.data.retries)
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@@ -148,7 +148,7 @@ const result = await client.session.prompt({
|
||||
})
|
||||
|
||||
// Acessar a saída estruturada
|
||||
console.log(result.data.info.structured_output)
|
||||
console.log(result.data.info.structured)
|
||||
// { company: "Anthropic", founded: 2021, products: ["Claude", "Claude API"] }
|
||||
```
|
||||
|
||||
@@ -175,8 +175,8 @@ Se o modelo falhar em produzir uma saída estruturada válida após todas as ten
|
||||
|
||||
```typescript
|
||||
if (result.data.info.error?.name === "StructuredOutputError") {
|
||||
console.error("Failed to produce structured output:", result.data.info.error.message)
|
||||
console.error("Attempts:", result.data.info.error.retries)
|
||||
console.error("Failed to produce structured output:", result.data.info.error.data.message)
|
||||
console.error("Attempts:", result.data.info.error.data.retries)
|
||||
}
|
||||
```
|
||||
|
||||
@@ -313,7 +313,7 @@ const { providers, default: defaults } = await client.config.providers()
|
||||
| `session.summarize({ path, body })` | Resumir sessão | Retorna `boolean` |
|
||||
| `session.messages({ path })` | Listar mensagens em uma sessão | Retorna `{ info: `<a href={typesUrl}><code>Message</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}[]` |
|
||||
| `session.message({ path })` | Obter detalhes da mensagem | Retorna `{ info: `<a href={typesUrl}><code>Message</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}` |
|
||||
| `session.prompt({ path, body })` | Enviar mensagem de prompt | `body.noReply: true` retorna UserMessage (apenas contexto). O padrão retorna <a href={typesUrl}><code>AssistantMessage</code></a> com resposta da AI. Suporta `body.outputFormat` para [saída estruturada](#saída-estruturada) |
|
||||
| `session.prompt({ path, body })` | Enviar mensagem de prompt | `body.noReply: true` retorna UserMessage (apenas contexto). O padrão retorna <a href={typesUrl}><code>AssistantMessage</code></a> com resposta da AI. Suporta `body.format` para [saída estruturada](#saída-estruturada) |
|
||||
| `session.command({ path, body })` | Enviar comando para a sessão | Retorna `{ info: `<a href={typesUrl}><code>AssistantMessage</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}` |
|
||||
| `session.shell({ path, body })` | Executar um comando shell | Retorna <a href={typesUrl}><code>AssistantMessage</code></a> |
|
||||
| `session.revert({ path, body })` | Reverter uma mensagem | Retorna <a href={typesUrl}><code>Session</code></a> |
|
||||
|
||||
@@ -148,7 +148,7 @@ const result = await client.session.prompt({
|
||||
})
|
||||
|
||||
// Access the structured output
|
||||
console.log(result.data.info.structured_output)
|
||||
console.log(result.data.info.structured)
|
||||
// { company: "Anthropic", founded: 2021, products: ["Claude", "Claude API"] }
|
||||
```
|
||||
|
||||
@@ -175,8 +175,8 @@ console.log(result.data.info.structured_output)
|
||||
|
||||
```typescript
|
||||
if (result.data.info.error?.name === "StructuredOutputError") {
|
||||
console.error("Failed to produce structured output:", result.data.info.error.message)
|
||||
console.error("Attempts:", result.data.info.error.retries)
|
||||
console.error("Failed to produce structured output:", result.data.info.error.data.message)
|
||||
console.error("Attempts:", result.data.info.error.data.retries)
|
||||
}
|
||||
```
|
||||
|
||||
@@ -313,7 +313,7 @@ const { providers, default: defaults } = await client.config.providers()
|
||||
| `session.summarize({ path, body })` | Summarize session | Returns `boolean` |
|
||||
| `session.messages({ path })` | List messages in a session | Returns `{ info: `<a href={typesUrl}><code>Message</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}[]` |
|
||||
| `session.message({ path })` | Get message details | Returns `{ info: `<a href={typesUrl}><code>Message</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}` |
|
||||
| `session.prompt({ path, body })` | Send prompt message | `body.noReply: true` возвращает UserMessage (только контекст). По умолчанию возвращает <a href={typesUrl}><code>AssistantMessage</code></a> с ответом ИИ. Поддерживает `body.outputFormat` для [структурированного вывода](#структурированный-вывод) |
|
||||
| `session.prompt({ path, body })` | Send prompt message | `body.noReply: true` возвращает UserMessage (только контекст). По умолчанию возвращает <a href={typesUrl}><code>AssistantMessage</code></a> с ответом ИИ. Поддерживает `body.format` для [структурированного вывода](#структурированный-вывод) |
|
||||
| `session.command({ path, body })` | Send command to session | Returns `{ info: `<a href={typesUrl}><code>AssistantMessage</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}` |
|
||||
| `session.shell({ path, body })` | Run a shell command | Returns <a href={typesUrl}><code>AssistantMessage</code></a> |
|
||||
| `session.revert({ path, body })` | Revert a message | Returns <a href={typesUrl}><code>Session</code></a> |
|
||||
|
||||
@@ -148,7 +148,7 @@ const result = await client.session.prompt({
|
||||
})
|
||||
|
||||
// Access the structured output
|
||||
console.log(result.data.info.structured_output)
|
||||
console.log(result.data.info.structured)
|
||||
// { company: "Anthropic", founded: 2021, products: ["Claude", "Claude API"] }
|
||||
```
|
||||
|
||||
@@ -175,8 +175,8 @@ If the model fails to produce valid structured output after all retries, the res
|
||||
|
||||
```typescript
|
||||
if (result.data.info.error?.name === "StructuredOutputError") {
|
||||
console.error("Failed to produce structured output:", result.data.info.error.message)
|
||||
console.error("Attempts:", result.data.info.error.retries)
|
||||
console.error("Failed to produce structured output:", result.data.info.error.data.message)
|
||||
console.error("Attempts:", result.data.info.error.data.retries)
|
||||
}
|
||||
```
|
||||
|
||||
@@ -313,7 +313,7 @@ const { providers, default: defaults } = await client.config.providers()
|
||||
| `session.summarize({ path, body })` | Summarize session | Returns `boolean` |
|
||||
| `session.messages({ path })` | List messages in a session | Returns `{ info: `<a href={typesUrl}><code>Message</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}[]` |
|
||||
| `session.message({ path })` | Get message details | Returns `{ info: `<a href={typesUrl}><code>Message</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}` |
|
||||
| `session.prompt({ path, body })` | Send prompt message | `body.noReply: true` returns UserMessage (context only). Default returns <a href={typesUrl}><code>AssistantMessage</code></a> with AI response. Supports `body.outputFormat` for [structured output](#structured-output) |
|
||||
| `session.prompt({ path, body })` | Send prompt message | `body.noReply: true` returns UserMessage (context only). Default returns <a href={typesUrl}><code>AssistantMessage</code></a> with AI response. Supports `body.format` for [structured output](#structured-output) |
|
||||
| `session.command({ path, body })` | Send command to session | Returns `{ info: `<a href={typesUrl}><code>AssistantMessage</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}` |
|
||||
| `session.shell({ path, body })` | Run a shell command | Returns <a href={typesUrl}><code>AssistantMessage</code></a> |
|
||||
| `session.revert({ path, body })` | Revert a message | Returns <a href={typesUrl}><code>Session</code></a> |
|
||||
|
||||
@@ -148,7 +148,7 @@ const result = await client.session.prompt({
|
||||
})
|
||||
|
||||
// Access the structured output
|
||||
console.log(result.data.info.structured_output)
|
||||
console.log(result.data.info.structured)
|
||||
// { company: "Anthropic", founded: 2021, products: ["Claude", "Claude API"] }
|
||||
```
|
||||
|
||||
@@ -175,8 +175,8 @@ console.log(result.data.info.structured_output)
|
||||
|
||||
```typescript
|
||||
if (result.data.info.error?.name === "StructuredOutputError") {
|
||||
console.error("Failed to produce structured output:", result.data.info.error.message)
|
||||
console.error("Attempts:", result.data.info.error.retries)
|
||||
console.error("Failed to produce structured output:", result.data.info.error.data.message)
|
||||
console.error("Attempts:", result.data.info.error.data.retries)
|
||||
}
|
||||
```
|
||||
|
||||
@@ -313,7 +313,7 @@ const { providers, default: defaults } = await client.config.providers()
|
||||
| `session.summarize({ path, body })` | สรุปเซสชัน | ส่งคืน `boolean` |
|
||||
| `session.messages({ path })` | แสดงรายการข้อความในเซสชัน | ส่งคืน `{ info: `<a href={typesUrl}><code>ข้อความ</code></a>`, parts: `<a href={typesUrl}><code>ส่วน[]</code></a>`}[]` |
|
||||
| `session.message({ path })` | รับรายละเอียดข้อความ | ส่งคืน `{ info: `<a href={typesUrl}><code>ข้อความ</code></a>`, parts: `<a href={typesUrl}><code>ส่วน[]</code></a>`}` |
|
||||
| `session.prompt({ path, body })` | ส่งข้อความแจ้ง | `body.noReply: true` ส่งคืน UserMessage (บริบทเท่านั้น) ค่าเริ่มต้นส่งคืน <a href={typesUrl}><code>AssistantMessage</code></a> พร้อมการตอบสนองของ AI รองรับ `body.outputFormat` สำหรับ [ผลลัพธ์แบบมีโครงสร้าง](#ผลลัพธ์แบบมีโครงสร้าง) |
|
||||
| `session.prompt({ path, body })` | ส่งข้อความแจ้ง | `body.noReply: true` ส่งคืน UserMessage (บริบทเท่านั้น) ค่าเริ่มต้นส่งคืน <a href={typesUrl}><code>AssistantMessage</code></a> พร้อมการตอบสนองของ AI รองรับ `body.format` สำหรับ [ผลลัพธ์แบบมีโครงสร้าง](#ผลลัพธ์แบบมีโครงสร้าง) |
|
||||
| `session.command({ path, body })` | ส่งคำสั่งไปยังเซสชั่น | ส่งคืน `{ info: `<a href={typesUrl}><code>AssistantMessage</code></a>`, parts: `<a href={typesUrl}><code>ส่วน[]</code></a>`}` |
|
||||
| `session.shell({ path, body })` | รันคำสั่ง shell | ส่งคืน <a href={typesUrl}><code>AssistantMessage</code></a> |
|
||||
| `session.revert({ path, body })` | คืนค่าข้อความ | ส่งคืน <a href={typesUrl}><code>เซสชัน</code></a> |
|
||||
|
||||
@@ -148,7 +148,7 @@ const result = await client.session.prompt({
|
||||
})
|
||||
|
||||
// Yapılandırılmış çıktıya erişin
|
||||
console.log(result.data.info.structured_output)
|
||||
console.log(result.data.info.structured)
|
||||
// { company: "Anthropic", founded: 2021, products: ["Claude", "Claude API"] }
|
||||
```
|
||||
|
||||
@@ -175,8 +175,8 @@ Model, tüm yeniden denemelerden sonra geçerli bir yapılandırılmış çıkt
|
||||
|
||||
```typescript
|
||||
if (result.data.info.error?.name === "StructuredOutputError") {
|
||||
console.error("Yapılandırılmış çıktı üretilemedi:", result.data.info.error.message)
|
||||
console.error("Denemeler:", result.data.info.error.retries)
|
||||
console.error("Yapılandırılmış çıktı üretilemedi:", result.data.info.error.data.message)
|
||||
console.error("Denemeler:", result.data.info.error.data.retries)
|
||||
}
|
||||
```
|
||||
|
||||
@@ -313,7 +313,7 @@ const { providers, default: defaults } = await client.config.providers()
|
||||
| `session.summarize({ path, body })` | Oturumu özetle | `boolean` döndürür |
|
||||
| `session.messages({ path })` | Oturumdaki mesajları listele | `{ info: `<a href={typesUrl}><code>Message</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}[]` döndürür |
|
||||
| `session.message({ path })` | Mesaj ayrıntılarını al | `{ info: `<a href={typesUrl}><code>Message</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}` döndürür |
|
||||
| `session.prompt({ path, body })` | İstem mesajı gönder | `body.noReply: true` UserMessage (yalnızca bağlam) döndürür. Varsayılan olarak AI yanıtıyla <a href={typesUrl}><code>AssistantMessage</code></a> döndürür. [yapılandırılmış çıktı](#yapılandırılmış-çıktı) için `body.outputFormat` destekler |
|
||||
| `session.prompt({ path, body })` | İstem mesajı gönder | `body.noReply: true` UserMessage (yalnızca bağlam) döndürür. Varsayılan olarak AI yanıtıyla <a href={typesUrl}><code>AssistantMessage</code></a> döndürür. [yapılandırılmış çıktı](#yapılandırılmış-çıktı) için `body.format` destekler |
|
||||
| `session.command({ path, body })` | Oturuma komut gönder | `{ info: `<a href={typesUrl}><code>AssistantMessage</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}` döndürür |
|
||||
| `session.shell({ path, body })` | Bir kabuk komutu çalıştır | <a href={typesUrl}><code>AssistantMessage</code></a> döndürür |
|
||||
| `session.revert({ path, body })` | Bir mesajı geri al | <a href={typesUrl}><code>Session</code></a> döndürür |
|
||||
|
||||
@@ -148,7 +148,7 @@ const result = await client.session.prompt({
|
||||
})
|
||||
|
||||
// Access the structured output
|
||||
console.log(result.data.info.structured_output)
|
||||
console.log(result.data.info.structured)
|
||||
// { company: "Anthropic", founded: 2021, products: ["Claude", "Claude API"] }
|
||||
```
|
||||
|
||||
@@ -175,8 +175,8 @@ console.log(result.data.info.structured_output)
|
||||
|
||||
```typescript
|
||||
if (result.data.info.error?.name === "StructuredOutputError") {
|
||||
console.error("Failed to produce structured output:", result.data.info.error.message)
|
||||
console.error("Attempts:", result.data.info.error.retries)
|
||||
console.error("Failed to produce structured output:", result.data.info.error.data.message)
|
||||
console.error("Attempts:", result.data.info.error.data.retries)
|
||||
}
|
||||
```
|
||||
|
||||
@@ -313,7 +313,7 @@ const { providers, default: defaults } = await client.config.providers()
|
||||
| `session.summarize({ path, body })` | 总结会话 | 返回 `boolean` |
|
||||
| `session.messages({ path })` | 列出会话中的消息 | 返回 `{ info: `<a href={typesUrl}><code>Message</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}[]` |
|
||||
| `session.message({ path })` | 获取消息详情 | 返回 `{ info: `<a href={typesUrl}><code>Message</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}` |
|
||||
| `session.prompt({ path, body })` | 发送提示词消息 | `body.noReply: true` 返回 UserMessage(仅注入上下文)。默认返回带有 AI 响应的 <a href={typesUrl}><code>AssistantMessage</code></a>。支持通过 `body.outputFormat` 使用[结构化输出](#结构化输出) |
|
||||
| `session.prompt({ path, body })` | 发送提示词消息 | `body.noReply: true` 返回 UserMessage(仅注入上下文)。默认返回带有 AI 响应的 <a href={typesUrl}><code>AssistantMessage</code></a>。支持通过 `body.format` 使用[结构化输出](#结构化输出) |
|
||||
| `session.command({ path, body })` | 向会话发送命令 | 返回 `{ info: `<a href={typesUrl}><code>AssistantMessage</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}` |
|
||||
| `session.shell({ path, body })` | 执行 shell 命令 | 返回 <a href={typesUrl}><code>AssistantMessage</code></a> |
|
||||
| `session.revert({ path, body })` | 撤回消息 | 返回 <a href={typesUrl}><code>Session</code></a> |
|
||||
|
||||
@@ -148,7 +148,7 @@ const result = await client.session.prompt({
|
||||
})
|
||||
|
||||
// Access the structured output
|
||||
console.log(result.data.info.structured_output)
|
||||
console.log(result.data.info.structured)
|
||||
// { company: "Anthropic", founded: 2021, products: ["Claude", "Claude API"] }
|
||||
```
|
||||
|
||||
@@ -175,8 +175,8 @@ console.log(result.data.info.structured_output)
|
||||
|
||||
```typescript
|
||||
if (result.data.info.error?.name === "StructuredOutputError") {
|
||||
console.error("Failed to produce structured output:", result.data.info.error.message)
|
||||
console.error("Attempts:", result.data.info.error.retries)
|
||||
console.error("Failed to produce structured output:", result.data.info.error.data.message)
|
||||
console.error("Attempts:", result.data.info.error.data.retries)
|
||||
}
|
||||
```
|
||||
|
||||
@@ -313,7 +313,7 @@ const { providers, default: defaults } = await client.config.providers()
|
||||
| `session.summarize({ path, body })` | 摘要工作階段 | 回傳 `boolean` |
|
||||
| `session.messages({ path })` | 列出工作階段中的訊息 | 回傳 `{ info: `<a href={typesUrl}><code>Message</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}[]` |
|
||||
| `session.message({ path })` | 取得訊息詳情 | 回傳 `{ info: `<a href={typesUrl}><code>Message</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}` |
|
||||
| `session.prompt({ path, body })` | 傳送提示訊息 | `body.noReply: true` 回傳 UserMessage(僅注入上下文)。預設回傳帶有 AI 回應的 <a href={typesUrl}><code>AssistantMessage</code></a>。支援透過 `body.outputFormat` 使用[結構化輸出](#結構化輸出) |
|
||||
| `session.prompt({ path, body })` | 傳送提示訊息 | `body.noReply: true` 回傳 UserMessage(僅注入上下文)。預設回傳帶有 AI 回應的 <a href={typesUrl}><code>AssistantMessage</code></a>。支援透過 `body.format` 使用[結構化輸出](#結構化輸出) |
|
||||
| `session.command({ path, body })` | 向工作階段傳送指令 | 回傳 `{ info: `<a href={typesUrl}><code>AssistantMessage</code></a>`, parts: `<a href={typesUrl}><code>Part[]</code></a>`}` |
|
||||
| `session.shell({ path, body })` | 執行 shell 指令 | 回傳 <a href={typesUrl}><code>AssistantMessage</code></a> |
|
||||
| `session.revert({ path, body })` | 還原訊息 | 回傳 <a href={typesUrl}><code>Session</code></a> |
|
||||
|
||||
Reference in New Issue
Block a user