chore: generate
deploy / deploy (push) Has been cancelled
nix-eval / nix-eval (push) Has been cancelled
nix-hashes / compute-hash (blacksmith-4vcpu-ubuntu-2404, x86_64-linux) (push) Has been cancelled
nix-hashes / compute-hash (blacksmith-4vcpu-ubuntu-2404-arm, aarch64-linux) (push) Has been cancelled
nix-hashes / compute-hash (macos-15-intel, x86_64-darwin) (push) Has been cancelled
nix-hashes / compute-hash (macos-latest, aarch64-darwin) (push) Has been cancelled
nix-hashes / update-hashes (push) Has been cancelled
publish / version (push) Has been cancelled
publish / build-cli (push) Has been cancelled
publish / sign-cli-windows (push) Has been cancelled
publish / build-electron (map[bun_install_flags:--os=darwin --cpu=arm64 host:macos-26 platform_flag:--mac --arm64 target:aarch64-apple-darwin]) (push) Has been cancelled
publish / build-electron (map[bun_install_flags:--os=darwin --cpu=x64 host:macos-26-intel platform_flag:--mac --x64 target:x86_64-apple-darwin]) (push) Has been cancelled
publish / build-electron (map[host:blacksmith-4vcpu-ubuntu-2404 platform_flag:--linux target:x86_64-unknown-linux-gnu]) (push) Has been cancelled
publish / build-electron (map[host:blacksmith-4vcpu-ubuntu-2404-arm platform_flag:--linux --arm64 target:aarch64-unknown-linux-gnu]) (push) Has been cancelled
publish / build-electron (map[host:blacksmith-4vcpu-windows-2025 platform_flag:--win target:x86_64-pc-windows-msvc]) (push) Has been cancelled
publish / build-electron (map[host:windows-2025 platform_flag:--win --arm64 target:aarch64-pc-windows-msvc]) (push) Has been cancelled
publish / publish (push) Has been cancelled
storybook / storybook build (push) Has been cancelled
containers / build (push) Has been cancelled
docs-locale-sync / sync-locales (push) Has been cancelled
generate / generate (push) Has been cancelled
typecheck / typecheck (push) Has been cancelled

This commit is contained in:
opencode-agent[bot]
2026-06-04 06:59:09 +00:00
parent 1ff19103a2
commit 30ec231aaf
19 changed files with 3592 additions and 2882 deletions
+21 -7
View File
@@ -88,8 +88,17 @@ const names = (() => {
return false
}
})()
if (musl) return arch === "x64" ? (baseline ? [`${base}-baseline-musl`, `${base}-musl`, `${base}-baseline`, base] : [`${base}-musl`, `${base}-baseline-musl`, base, `${base}-baseline`]) : [`${base}-musl`, base]
return arch === "x64" ? (baseline ? [`${base}-baseline`, base, `${base}-baseline-musl`, `${base}-musl`] : [base, `${base}-baseline`, `${base}-musl`, `${base}-baseline-musl`]) : [base, `${base}-musl`]
if (musl)
return arch === "x64"
? baseline
? [`${base}-baseline-musl`, `${base}-musl`, `${base}-baseline`, base]
: [`${base}-musl`, `${base}-baseline-musl`, base, `${base}-baseline`]
: [`${base}-musl`, base]
return arch === "x64"
? baseline
? [`${base}-baseline`, base, `${base}-baseline-musl`, `${base}-musl`]
: [base, `${base}-baseline`, `${base}-musl`, `${base}-baseline-musl`]
: [base, `${base}-musl`]
}
return arch === "x64" ? (baseline ? [`${base}-baseline`, base] : [base, `${base}-baseline`]) : [base]
})()
@@ -98,10 +107,11 @@ function findBinary(startDir) {
let current = startDir
for (;;) {
const modules = path.join(current, "node_modules")
if (fs.existsSync(modules)) for (const name of names) {
const candidate = path.join(modules, name, "bin", binary)
if (fs.existsSync(candidate)) return candidate
}
if (fs.existsSync(modules))
for (const name of names) {
const candidate = path.join(modules, name, "bin", binary)
if (fs.existsSync(candidate)) return candidate
}
const parent = path.dirname(current)
if (parent === current) return
current = parent
@@ -110,7 +120,11 @@ function findBinary(startDir) {
const resolved = envPath || (fs.existsSync(cached) ? cached : findBinary(scriptDir))
if (!resolved) {
console.error("It seems that your package manager failed to install the right lildax CLI package. Try manually installing " + names.map((name) => `"${name}"`).join(" or ") + " package")
console.error(
"It seems that your package manager failed to install the right lildax CLI package. Try manually installing " +
names.map((name) => `"${name}"`).join(" or ") +
" package",
)
process.exit(1)
}
run(resolved)
+5 -1
View File
@@ -44,5 +44,9 @@ await Bun.file(`./dist/${pkg.name}/package.json`).write(
),
)
await Promise.all(Object.entries(binaries).map(([name, version]) => publish(`./dist/${name.replace("@opencode-ai/", "")}`, name, version)))
await Promise.all(
Object.entries(binaries).map(([name, version]) =>
publish(`./dist/${name.replace("@opencode-ai/", "")}`, name, version),
),
)
await publish(`./dist/${pkg.name}`, pkg.name, version)
+3 -1
View File
@@ -11,7 +11,9 @@ export type Input<Value> =
: never
type RuntimeHandler = (input: unknown) => Effect.Effect<void, unknown, Daemon.Service>
type Loader<Node extends Spec.Any> = () => Promise<{ default: (input: Input<Node>) => Effect.Effect<void, any, Daemon.Service> }>
type Loader<Node extends Spec.Any> = () => Promise<{
default: (input: Input<Node>) => Effect.Effect<void, any, Daemon.Service>
}>
type ProvidedCommand = Command.Command<string, unknown, unknown, unknown, Daemon.Service>
export type Handlers<Node extends Spec.Any> = keyof Node["commands"] extends never
+3 -5
View File
@@ -125,11 +125,9 @@ export const layer = Layer.effect(
const register = Effect.fn("cli.daemon.register")(function* (address: HttpServer.Address) {
const temp = file + ".tmp"
yield* fs.makeDirectory(directory, { recursive: true })
yield* fs.writeFileString(
temp,
JSON.stringify({ url: HttpServer.formatAddress(address), pid: process.pid }),
{ mode: 0o600 },
)
yield* fs.writeFileString(temp, JSON.stringify({ url: HttpServer.formatAddress(address), pid: process.pid }), {
mode: 0o600,
})
yield* fs.rename(temp, file)
// The metadata file represents this live listener, not persistent config.
// Scope shutdown removes it when the server exits normally.
+3 -1
View File
@@ -22,7 +22,9 @@ export const Plugin = PluginV2.define({
const documents = yield* Effect.forEach(yield* config.entries(), (entry) => {
if (entry.type === "document") return Effect.succeed([{ commands: entry.info.commands }])
return loadDirectory(fs, entry.path).pipe(
Effect.map((commands) => [{ commands: Object.fromEntries(commands.map((command) => [command.name, command.info])) }]),
Effect.map((commands) => [
{ commands: Object.fromEntries(commands.map((command) => [command.name, command.info])) },
]),
)
}).pipe(Effect.map((documents) => documents.flat()))
+6 -2
View File
@@ -23,8 +23,12 @@ export const Plugin = PluginV2.define({
yield* transform((editor) => {
for (const directory of directories) {
editor.source(new SkillV2.DirectorySource({ type: "directory", path: AbsolutePath.make(path.join(directory, "skill")) }))
editor.source(new SkillV2.DirectorySource({ type: "directory", path: AbsolutePath.make(path.join(directory, "skills")) }))
editor.source(
new SkillV2.DirectorySource({ type: "directory", path: AbsolutePath.make(path.join(directory, "skill")) }),
)
editor.source(
new SkillV2.DirectorySource({ type: "directory", path: AbsolutePath.make(path.join(directory, "skills")) }),
)
}
for (const item of items) {
if (URL.canParse(item) && /^(https?:)$/.test(new URL(item).protocol)) {
+3 -1
View File
@@ -10,7 +10,9 @@ export const Plugin = PluginV2.define({
effect: Effect.gen(function* () {
const skill = yield* SkillV2.Service
const transform = yield* skill.transform()
const content = yield* Effect.promise(() => Bun.file(new URL("./skill/customize-opencode.md", import.meta.url)).text())
const content = yield* Effect.promise(() =>
Bun.file(new URL("./skill/customize-opencode.md", import.meta.url)).text(),
)
yield* transform((editor) => {
editor.source(
+5 -1
View File
@@ -37,7 +37,11 @@ export const Source = Schema.Union([DirectorySource, UrlSource, EmbeddedSource])
return false
},
key: (source: DirectorySource | UrlSource | EmbeddedSource) =>
source.type === "directory" ? `directory:${source.path}` : source.type === "url" ? `url:${source.url}` : `embedded:${source.skill.name}`,
source.type === "directory"
? `directory:${source.path}`
: source.type === "url"
? `url:${source.url}`
: `embedded:${source.skill.name}`,
})),
)
export type Source = typeof Source.Type
+5 -5
View File
@@ -12,10 +12,7 @@ const project = AbsolutePath.make("/repo")
const it = testEffect(
CommandV2.locationLayer.pipe(
Layer.provide(
Layer.succeed(
Location.Service,
Location.Service.of(location({ directory }, { projectDirectory: project })),
),
Layer.succeed(Location.Service, Location.Service.of(location({ directory }, { projectDirectory: project }))),
),
),
)
@@ -26,7 +23,10 @@ describe("CommandPlugin.Plugin", () => {
const command = yield* CommandV2.Service
yield* CommandPlugin.Plugin.effect.pipe(
Effect.provideService(CommandV2.Service, command),
Effect.provideService(Location.Service, Location.Service.of(location({ directory }, { projectDirectory: project }))),
Effect.provideService(
Location.Service,
Location.Service.of(location({ directory }, { projectDirectory: project })),
),
)
expect(yield* command.get("init")).toMatchObject({
+2 -8
View File
@@ -1017,20 +1017,14 @@ export type Error = ModelNotFoundError | InitError | NoProvidersError | NoModels
export interface Interface {
readonly list: () => Effect.Effect<Record<ProviderV2.ID, Info>>
readonly getProvider: (providerID: ProviderV2.ID) => Effect.Effect<Info>
readonly getModel: (
providerID: ProviderV2.ID,
modelID: ModelV2.ID,
) => Effect.Effect<Model, ModelNotFoundError>
readonly getModel: (providerID: ProviderV2.ID, modelID: ModelV2.ID) => Effect.Effect<Model, ModelNotFoundError>
readonly getLanguage: (model: Model) => Effect.Effect<LanguageModelV3, ModelNotFoundError>
readonly closest: (
providerID: ProviderV2.ID,
query: string[],
) => Effect.Effect<{ providerID: ProviderV2.ID; modelID: string } | undefined>
readonly getSmallModel: (providerID: ProviderV2.ID) => Effect.Effect<Model | undefined>
readonly defaultModel: () => Effect.Effect<
{ providerID: ProviderV2.ID; modelID: ModelV2.ID },
DefaultModelError
>
readonly defaultModel: () => Effect.Effect<{ providerID: ProviderV2.ID; modelID: ModelV2.ID }, DefaultModelError>
}
interface State {
@@ -192,7 +192,15 @@ type RouteRequirements =
export function createRoutes(
corsOptions?: CorsOptions,
): Layer.Layer<never, EffectConfig.ConfigError, RouteRequirements> {
return Layer.mergeAll(rootApiRoutes, eventApiRoutes, ptyConnectApiRoutes, instanceRoutes, v2Routes, docRoute, uiRoute).pipe(
return Layer.mergeAll(
rootApiRoutes,
eventApiRoutes,
ptyConnectApiRoutes,
instanceRoutes,
v2Routes,
docRoute,
uiRoute,
).pipe(
Layer.provide([
errorLayer,
compressionLayer,
+16 -31
View File
@@ -574,10 +574,7 @@ export const layer: Layer.Layer<
}
log.info("created", result)
yield* events.publish(
SessionV1.Event.Created,
{ sessionID: result.id, info: result },
)
yield* events.publish(SessionV1.Event.Created, { sessionID: result.id, info: result })
return result
})
@@ -664,10 +661,7 @@ export const layer: Layer.Layer<
yield* remove(child.id)
}
yield* events.publish(
SessionV1.Event.Deleted,
{ sessionID, info: session },
)
yield* events.publish(SessionV1.Event.Deleted, { sessionID, info: session })
yield* events.remove(sessionID)
} catch (e) {
log.error(e)
@@ -682,14 +676,11 @@ export const layer: Layer.Layer<
const updatePart = <T extends SessionV1.Part>(part: T): Effect.Effect<T> =>
Effect.gen(function* () {
yield* events.publish(
SessionV1.Event.PartUpdated,
{
sessionID: part.sessionID,
part: structuredClone(part),
time: Date.now(),
},
)
yield* events.publish(SessionV1.Event.PartUpdated, {
sessionID: part.sessionID,
part: structuredClone(part),
time: Date.now(),
})
return part
}).pipe(Effect.withSpan("Session.updatePart"))
@@ -892,13 +883,10 @@ export const layer: Layer.Layer<
sessionID: SessionID
messageID: MessageID
}) {
yield* events.publish(
SessionV1.Event.MessageRemoved,
{
sessionID: input.sessionID,
messageID: input.messageID,
},
)
yield* events.publish(SessionV1.Event.MessageRemoved, {
sessionID: input.sessionID,
messageID: input.messageID,
})
return input.messageID
})
@@ -907,14 +895,11 @@ export const layer: Layer.Layer<
messageID: MessageID
partID: PartID
}) {
yield* events.publish(
SessionV1.Event.PartRemoved,
{
sessionID: input.sessionID,
messageID: input.messageID,
partID: input.partID,
},
)
yield* events.publish(SessionV1.Event.PartRemoved, {
sessionID: input.sessionID,
messageID: input.messageID,
partID: input.partID,
})
return input.partID
})
@@ -980,14 +980,8 @@ it.instance(
it.instance("getModel returns consistent results", () =>
Effect.gen(function* () {
yield* set("ANTHROPIC_API_KEY", "test-api-key")
const model1 = yield* Provider.use.getModel(
ProviderV2.ID.anthropic,
ModelV2.ID.make("claude-sonnet-4-20250514"),
)
const model2 = yield* Provider.use.getModel(
ProviderV2.ID.anthropic,
ModelV2.ID.make("claude-sonnet-4-20250514"),
)
const model1 = yield* Provider.use.getModel(ProviderV2.ID.anthropic, ModelV2.ID.make("claude-sonnet-4-20250514"))
const model2 = yield* Provider.use.getModel(ProviderV2.ID.anthropic, ModelV2.ID.make("claude-sonnet-4-20250514"))
expect(model1.providerID).toEqual(model2.providerID)
expect(model1.id).toEqual(model2.id)
expect(model1).toEqual(model2)
@@ -457,7 +457,8 @@ describe("session HttpApi", () => {
})}`,
{ headers },
)
const sessionCursor = (yield* json<{ data: Session.Info[]; cursor: { next?: string } }>(sessionPage)).cursor.next
const sessionCursor = (yield* json<{ data: Session.Info[]; cursor: { next?: string } }>(sessionPage)).cursor
.next
expect(sessionCursor).toBeTruthy()
expect(JSON.parse(Buffer.from(sessionCursor!, "base64url").toString("utf8"))).toMatchObject({
order: "asc",
@@ -57,7 +57,10 @@ describe("v2 location HttpApi", () => {
for (const route of ["/api/command", "/api/skill"]) {
const response = await request(route, tmp.path)
expect(response.status).toBe(200)
const body = (await response.json()) as { location: { directory: string; project: { id: string } }; data: unknown }
const body = (await response.json()) as {
location: { directory: string; project: { id: string } }
data: unknown
}
expect(body.data).toBeArray()
expect(body.location.directory).toBe(tmp.path)
expect(body.location.project.id).toBeTruthy()
+1 -4
View File
@@ -1671,10 +1671,7 @@ describe("session.llm.stream", () => {
]
const request = waitRequest("/messages", createEventResponse(chunks))
const resolved = yield* Provider.use.getModel(
ProviderV2.ID.make("anthropic"),
ModelV2.ID.make(model.id),
)
const resolved = yield* Provider.use.getModel(ProviderV2.ID.make("anthropic"), ModelV2.ID.make(model.id))
const sessionID = SessionID.make("session-test-anthropic-tools")
const agent = {
name: "test",
+3478 -2783
View File
@@ -8395,1671 +8395,6 @@
]
}
},
"/api/session": {
"get": {
"tags": ["v2"],
"operationId": "v2.session.list",
"parameters": [
{
"name": "workspace",
"in": "query",
"schema": {
"type": "string",
"pattern": "^wrk"
},
"required": false
},
{
"name": "limit",
"in": "query",
"schema": {
"type": "number"
},
"required": false
},
{
"name": "order",
"in": "query",
"schema": {
"type": "string",
"enum": ["asc", "desc"]
},
"required": false
},
{
"name": "search",
"in": "query",
"schema": {
"type": "string"
},
"required": false
},
{
"name": "directory",
"in": "query",
"schema": {
"type": "string"
},
"required": false
},
{
"name": "project",
"in": "query",
"schema": {
"type": "string"
},
"required": false
},
{
"name": "subpath",
"in": "query",
"schema": {
"type": "string"
},
"required": false
},
{
"name": "cursor",
"in": "query",
"schema": {
"type": "string",
"description": "Opaque pagination cursor returned as cursor.previous or cursor.next in the previous response."
},
"required": false
}
],
"security": [],
"responses": {
"200": {
"description": "V2SessionsResponse",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/V2SessionsResponse"
}
}
}
},
"400": {
"description": "InvalidCursorError | InvalidRequestError",
"content": {
"application/json": {
"schema": {
"anyOf": [
{
"$ref": "#/components/schemas/InvalidCursorError"
},
{
"$ref": "#/components/schemas/InvalidRequestError"
},
{
"$ref": "#/components/schemas/InvalidRequestError"
}
]
}
}
}
},
"401": {
"description": "UnauthorizedError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UnauthorizedError"
}
}
}
}
},
"description": "Retrieve sessions in the requested order. Items keep that order across pages; use cursor.next or cursor.previous to move through the ordered list.",
"summary": "List v2 sessions",
"x-codeSamples": [
{
"lang": "js",
"source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.list({\n ...\n})"
}
]
}
},
"/api/session/{sessionID}/prompt": {
"post": {
"tags": ["v2"],
"operationId": "v2.session.prompt",
"parameters": [
{
"name": "sessionID",
"in": "path",
"schema": {
"type": "string",
"pattern": "^ses"
},
"required": true
},
{
"name": "directory",
"in": "query",
"schema": {
"type": "string"
},
"required": false
},
{
"name": "workspace",
"in": "query",
"schema": {
"type": "string"
},
"required": false
}
],
"security": [],
"responses": {
"200": {
"description": "Session.Message.User",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SessionMessageUser"
}
}
}
},
"400": {
"description": "InvalidRequestError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/InvalidRequestError"
}
}
}
},
"401": {
"description": "UnauthorizedError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UnauthorizedError"
}
}
}
},
"404": {
"description": "SessionNotFoundError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SessionNotFoundError"
}
}
}
},
"409": {
"description": "ConflictError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ConflictError"
}
}
}
}
},
"description": "Durably admit one v2 session input and schedule agent-loop execution unless resume is false.",
"summary": "Send v2 message",
"requestBody": {
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"prompt": {
"$ref": "#/components/schemas/Prompt"
},
"delivery": {
"type": "string",
"enum": ["steer", "queue"]
},
"resume": {
"type": "boolean"
}
},
"required": ["prompt"],
"additionalProperties": false
}
}
},
"required": true
},
"x-codeSamples": [
{
"lang": "js",
"source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.prompt({\n ...\n})"
}
]
}
},
"/api/session/{sessionID}/compact": {
"post": {
"tags": ["v2"],
"operationId": "v2.session.compact",
"parameters": [
{
"name": "sessionID",
"in": "path",
"schema": {
"type": "string",
"pattern": "^ses"
},
"required": true
},
{
"name": "directory",
"in": "query",
"schema": {
"type": "string"
},
"required": false
},
{
"name": "workspace",
"in": "query",
"schema": {
"type": "string"
},
"required": false
}
],
"security": [],
"responses": {
"204": {
"description": "<No Content>"
},
"400": {
"description": "InvalidRequestError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/InvalidRequestError"
}
}
}
},
"401": {
"description": "UnauthorizedError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UnauthorizedError"
}
}
}
},
"404": {
"description": "SessionNotFoundError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SessionNotFoundError"
}
}
}
},
"503": {
"description": "ServiceUnavailableError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ServiceUnavailableError"
}
}
}
}
},
"description": "Compact a v2 session conversation.",
"summary": "Compact v2 session",
"x-codeSamples": [
{
"lang": "js",
"source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.compact({\n ...\n})"
}
]
}
},
"/api/session/{sessionID}/wait": {
"post": {
"tags": ["v2"],
"operationId": "v2.session.wait",
"parameters": [
{
"name": "sessionID",
"in": "path",
"schema": {
"type": "string",
"pattern": "^ses"
},
"required": true
},
{
"name": "directory",
"in": "query",
"schema": {
"type": "string"
},
"required": false
},
{
"name": "workspace",
"in": "query",
"schema": {
"type": "string"
},
"required": false
}
],
"security": [],
"responses": {
"204": {
"description": "<No Content>"
},
"400": {
"description": "InvalidRequestError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/InvalidRequestError"
}
}
}
},
"401": {
"description": "UnauthorizedError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UnauthorizedError"
}
}
}
},
"404": {
"description": "SessionNotFoundError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SessionNotFoundError"
}
}
}
},
"503": {
"description": "ServiceUnavailableError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ServiceUnavailableError"
}
}
}
}
},
"description": "Wait for a v2 session agent loop to become idle.",
"summary": "Wait for v2 session",
"x-codeSamples": [
{
"lang": "js",
"source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.wait({\n ...\n})"
}
]
}
},
"/api/session/{sessionID}/context": {
"get": {
"tags": ["v2"],
"operationId": "v2.session.context",
"parameters": [
{
"name": "sessionID",
"in": "path",
"schema": {
"type": "string",
"pattern": "^ses"
},
"required": true
},
{
"name": "directory",
"in": "query",
"schema": {
"type": "string"
},
"required": false
},
{
"name": "workspace",
"in": "query",
"schema": {
"type": "string"
},
"required": false
}
],
"security": [],
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/SessionMessage"
}
}
}
}
},
"400": {
"description": "InvalidRequestError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/InvalidRequestError"
}
}
}
},
"401": {
"description": "UnauthorizedError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UnauthorizedError"
}
}
}
},
"404": {
"description": "SessionNotFoundError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SessionNotFoundError"
}
}
}
},
"500": {
"description": "UnknownError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UnknownError1"
}
}
}
}
},
"description": "Retrieve the active context messages for a v2 session (all messages after the last compaction).",
"summary": "Get v2 session context",
"x-codeSamples": [
{
"lang": "js",
"source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.context({\n ...\n})"
}
]
}
},
"/api/session/{sessionID}/message": {
"get": {
"tags": ["v2 messages"],
"operationId": "v2.session.messages",
"parameters": [
{
"name": "sessionID",
"in": "path",
"schema": {
"type": "string",
"pattern": "^ses"
},
"required": true
},
{
"name": "directory",
"in": "query",
"schema": {
"type": "string"
},
"required": false
},
{
"name": "workspace",
"in": "query",
"schema": {
"type": "string"
},
"required": false
},
{
"name": "limit",
"in": "query",
"schema": {
"type": "number"
},
"required": false
},
{
"name": "order",
"in": "query",
"schema": {
"type": "string",
"enum": ["asc", "desc"]
},
"required": false
},
{
"name": "cursor",
"in": "query",
"schema": {
"type": "string",
"description": "Opaque pagination cursor returned as cursor.previous or cursor.next in the previous response. Do not combine with order."
},
"required": false
}
],
"security": [],
"responses": {
"200": {
"description": "V2SessionMessagesResponse",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/V2SessionMessagesResponse"
}
}
}
},
"400": {
"description": "InvalidCursorError | InvalidRequestError",
"content": {
"application/json": {
"schema": {
"anyOf": [
{
"$ref": "#/components/schemas/InvalidCursorError"
},
{
"$ref": "#/components/schemas/InvalidRequestError"
}
]
}
}
}
},
"401": {
"description": "UnauthorizedError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UnauthorizedError"
}
}
}
},
"404": {
"description": "SessionNotFoundError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SessionNotFoundError"
}
}
}
},
"500": {
"description": "UnknownError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UnknownError1"
}
}
}
}
},
"description": "Retrieve projected v2 messages for a session. Items keep the requested order across pages; use cursor.next or cursor.previous to move through the ordered timeline.",
"summary": "Get v2 session messages",
"x-codeSamples": [
{
"lang": "js",
"source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.messages({\n ...\n})"
}
]
}
},
"/api/model": {
"get": {
"tags": ["v2 models"],
"operationId": "v2.model.list",
"parameters": [
{
"name": "location",
"in": "query",
"schema": {
"type": "object",
"properties": {
"directory": {
"type": "string"
},
"workspace": {
"type": "string"
}
},
"additionalProperties": false
},
"required": false,
"style": "deepObject",
"explode": true
}
],
"security": [],
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/ModelV2PublicInfo"
}
}
}
}
},
"400": {
"description": "InvalidRequestError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/InvalidRequestError"
}
}
}
},
"401": {
"description": "UnauthorizedError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UnauthorizedError"
}
}
}
},
"503": {
"description": "ServiceUnavailableError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ServiceUnavailableError"
}
}
}
}
},
"description": "Retrieve available v2 models ordered by release date.",
"summary": "List v2 models",
"x-codeSamples": [
{
"lang": "js",
"source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.model.list({\n ...\n})"
}
]
}
},
"/api/provider": {
"get": {
"tags": ["v2 providers"],
"operationId": "v2.provider.list",
"parameters": [
{
"name": "location",
"in": "query",
"schema": {
"type": "object",
"properties": {
"directory": {
"type": "string"
},
"workspace": {
"type": "string"
}
},
"additionalProperties": false
},
"required": false,
"style": "deepObject",
"explode": true
}
],
"security": [],
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/ProviderV2PublicInfo"
}
}
}
}
},
"400": {
"description": "InvalidRequestError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/InvalidRequestError"
}
}
}
},
"401": {
"description": "UnauthorizedError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UnauthorizedError"
}
}
}
},
"503": {
"description": "ServiceUnavailableError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ServiceUnavailableError"
}
}
}
}
},
"description": "Retrieve active v2 AI providers so clients can show provider availability and configuration.",
"summary": "List v2 providers",
"x-codeSamples": [
{
"lang": "js",
"source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.provider.list({\n ...\n})"
}
]
}
},
"/api/provider/{providerID}": {
"get": {
"tags": ["v2 providers"],
"operationId": "v2.provider.get",
"parameters": [
{
"name": "providerID",
"in": "path",
"schema": {
"type": "string"
},
"required": true
},
{
"name": "location",
"in": "query",
"schema": {
"type": "object",
"properties": {
"directory": {
"type": "string"
},
"workspace": {
"type": "string"
}
},
"additionalProperties": false
},
"required": false,
"style": "deepObject",
"explode": true
}
],
"security": [],
"responses": {
"200": {
"description": "ProviderV2.PublicInfo",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ProviderV2PublicInfo"
}
}
}
},
"400": {
"description": "InvalidRequestError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/InvalidRequestError"
}
}
}
},
"401": {
"description": "UnauthorizedError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UnauthorizedError"
}
}
}
},
"404": {
"description": "ProviderNotFoundError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ProviderNotFoundError"
}
}
}
},
"503": {
"description": "ServiceUnavailableError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ServiceUnavailableError"
}
}
}
}
},
"description": "Retrieve a single v2 AI provider so clients can inspect its availability and endpoint settings.",
"summary": "Get v2 provider",
"x-codeSamples": [
{
"lang": "js",
"source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.provider.get({\n ...\n})"
}
]
}
},
"/api/permission/request": {
"get": {
"tags": ["v2 permissions"],
"operationId": "v2.permission.request.list",
"parameters": [
{
"name": "location",
"in": "query",
"schema": {
"type": "object",
"properties": {
"directory": {
"type": "string"
},
"workspace": {
"type": "string"
}
},
"additionalProperties": false
},
"required": false,
"style": "deepObject",
"explode": true
}
],
"security": [],
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/PermissionV2Request"
}
}
}
}
},
"400": {
"description": "InvalidRequestError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/InvalidRequestError"
}
}
}
},
"401": {
"description": "UnauthorizedError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UnauthorizedError"
}
}
}
}
},
"description": "Retrieve pending permission requests for a location.",
"summary": "List pending permission requests",
"x-codeSamples": [
{
"lang": "js",
"source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.permission.request.list({\n ...\n})"
}
]
}
},
"/api/session/{sessionID}/permission/request": {
"get": {
"tags": ["v2 session permissions"],
"operationId": "v2.session.permission.list",
"parameters": [
{
"name": "sessionID",
"in": "path",
"schema": {
"type": "string",
"pattern": "^ses"
},
"required": true
}
],
"security": [],
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/PermissionV2Request"
}
}
}
}
},
"400": {
"description": "InvalidRequestError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/InvalidRequestError"
}
}
}
},
"401": {
"description": "UnauthorizedError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UnauthorizedError"
}
}
}
},
"404": {
"description": "SessionNotFoundError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SessionNotFoundError"
}
}
}
}
},
"description": "Retrieve pending permission requests owned by a session.",
"summary": "List session permission requests",
"x-codeSamples": [
{
"lang": "js",
"source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.permission.list({\n ...\n})"
}
]
}
},
"/api/session/{sessionID}/permission/request/{requestID}/reply": {
"post": {
"tags": ["v2 session permissions"],
"operationId": "v2.session.permission.reply",
"parameters": [
{
"name": "sessionID",
"in": "path",
"schema": {
"type": "string",
"pattern": "^ses"
},
"required": true
},
{
"name": "requestID",
"in": "path",
"schema": {
"type": "string",
"pattern": "^per"
},
"required": true
}
],
"security": [],
"responses": {
"204": {
"description": "<No Content>"
},
"400": {
"description": "InvalidRequestError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/InvalidRequestError"
}
}
}
},
"401": {
"description": "UnauthorizedError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UnauthorizedError"
}
}
}
},
"404": {
"description": "SessionNotFoundError | PermissionNotFoundError",
"content": {
"application/json": {
"schema": {
"anyOf": [
{
"$ref": "#/components/schemas/SessionNotFoundError"
},
{
"$ref": "#/components/schemas/PermissionNotFoundError"
}
]
}
}
}
}
},
"description": "Respond to a pending permission request owned by a session.",
"summary": "Reply to pending permission request",
"requestBody": {
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"reply": {
"$ref": "#/components/schemas/PermissionV2Reply"
},
"message": {
"type": "string"
}
},
"required": ["reply"],
"additionalProperties": false
}
}
},
"required": true
},
"x-codeSamples": [
{
"lang": "js",
"source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.permission.reply({\n ...\n})"
}
]
}
},
"/api/permission/saved": {
"get": {
"tags": ["v2 saved permissions"],
"operationId": "v2.permission.saved.list",
"parameters": [
{
"name": "projectID",
"in": "query",
"schema": {
"type": "string"
},
"required": false
}
],
"security": [],
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/PermissionSavedInfo"
}
}
}
}
},
"400": {
"description": "InvalidRequestError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/InvalidRequestError"
}
}
}
},
"401": {
"description": "UnauthorizedError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UnauthorizedError"
}
}
}
}
},
"description": "Retrieve saved permissions, optionally filtered by project.",
"summary": "List saved permissions",
"x-codeSamples": [
{
"lang": "js",
"source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.permission.saved.list({\n ...\n})"
}
]
}
},
"/api/permission/saved/{id}": {
"delete": {
"tags": ["v2 saved permissions"],
"operationId": "v2.permission.saved.remove",
"parameters": [
{
"name": "id",
"in": "path",
"schema": {
"type": "string"
},
"required": true
}
],
"security": [],
"responses": {
"204": {
"description": "<No Content>"
},
"400": {
"description": "InvalidRequestError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/InvalidRequestError"
}
}
}
},
"401": {
"description": "UnauthorizedError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UnauthorizedError"
}
}
}
}
},
"description": "Remove a saved permission by ID.",
"summary": "Remove saved permission",
"x-codeSamples": [
{
"lang": "js",
"source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.permission.saved.remove({\n ...\n})"
}
]
}
},
"/api/fs/read": {
"get": {
"tags": ["v2 filesystem"],
"operationId": "v2.fs.read",
"parameters": [
{
"name": "location",
"in": "query",
"schema": {
"type": "object",
"properties": {
"directory": {
"type": "string"
},
"workspace": {
"type": "string"
}
},
"additionalProperties": false
},
"required": false,
"style": "deepObject",
"explode": true
},
{
"name": "path",
"in": "query",
"schema": {
"type": "string"
},
"required": true
},
{
"name": "reference",
"in": "query",
"schema": {
"type": "string"
},
"required": false
}
],
"security": [],
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"anyOf": [
{
"$ref": "#/components/schemas/FileSystemTextContent"
},
{
"$ref": "#/components/schemas/FileSystemBinaryContent"
}
]
}
}
}
},
"400": {
"description": "InvalidRequestError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/InvalidRequestError"
}
}
}
},
"401": {
"description": "UnauthorizedError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UnauthorizedError"
}
}
}
}
},
"description": "Read one file relative to the requested location.",
"summary": "Read file",
"x-codeSamples": [
{
"lang": "js",
"source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.fs.read({\n ...\n})"
}
]
}
},
"/api/fs/list": {
"get": {
"tags": ["v2 filesystem"],
"operationId": "v2.fs.list",
"parameters": [
{
"name": "location",
"in": "query",
"schema": {
"type": "object",
"properties": {
"directory": {
"type": "string"
},
"workspace": {
"type": "string"
}
},
"additionalProperties": false
},
"required": false,
"style": "deepObject",
"explode": true
},
{
"name": "path",
"in": "query",
"schema": {
"type": "string"
},
"required": false
},
{
"name": "reference",
"in": "query",
"schema": {
"type": "string"
},
"required": false
}
],
"security": [],
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/FileSystemEntry"
}
}
}
}
},
"400": {
"description": "InvalidRequestError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/InvalidRequestError"
}
}
}
},
"401": {
"description": "UnauthorizedError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UnauthorizedError"
}
}
}
}
},
"description": "List direct children of one directory relative to the requested location.",
"summary": "List directory",
"x-codeSamples": [
{
"lang": "js",
"source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.fs.list({\n ...\n})"
}
]
}
},
"/api/question/request": {
"get": {
"tags": ["v2 questions"],
"operationId": "v2.question.request.list",
"parameters": [
{
"name": "location",
"in": "query",
"schema": {
"type": "object",
"properties": {
"directory": {
"type": "string"
},
"workspace": {
"type": "string"
}
},
"additionalProperties": false
},
"required": false,
"style": "deepObject",
"explode": true
}
],
"security": [],
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/QuestionV2Request"
}
}
}
}
},
"400": {
"description": "InvalidRequestError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/InvalidRequestError"
}
}
}
},
"401": {
"description": "UnauthorizedError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UnauthorizedError"
}
}
}
}
},
"description": "Retrieve pending question requests for a location.",
"summary": "List pending question requests",
"x-codeSamples": [
{
"lang": "js",
"source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.question.request.list({\n ...\n})"
}
]
}
},
"/api/session/{sessionID}/question/request/{requestID}/reply": {
"post": {
"tags": ["v2 session questions"],
"operationId": "v2.session.question.reply",
"parameters": [
{
"name": "sessionID",
"in": "path",
"schema": {
"type": "string",
"pattern": "^ses"
},
"required": true
},
{
"name": "requestID",
"in": "path",
"schema": {
"type": "string",
"pattern": "^que"
},
"required": true
}
],
"security": [],
"responses": {
"204": {
"description": "<No Content>"
},
"400": {
"description": "InvalidRequestError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/InvalidRequestError"
}
}
}
},
"401": {
"description": "UnauthorizedError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UnauthorizedError"
}
}
}
},
"404": {
"description": "SessionNotFoundError | QuestionNotFoundError",
"content": {
"application/json": {
"schema": {
"anyOf": [
{
"$ref": "#/components/schemas/SessionNotFoundError"
},
{
"$ref": "#/components/schemas/QuestionNotFoundError"
}
]
}
}
}
}
},
"description": "Answer a pending question request owned by a session.",
"summary": "Reply to pending question request",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/QuestionV2Reply"
}
}
},
"required": true
},
"x-codeSamples": [
{
"lang": "js",
"source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.question.reply({\n ...\n})"
}
]
}
},
"/api/session/{sessionID}/question/request/{requestID}/reject": {
"post": {
"tags": ["v2 session questions"],
"operationId": "v2.session.question.reject",
"parameters": [
{
"name": "sessionID",
"in": "path",
"schema": {
"type": "string",
"pattern": "^ses"
},
"required": true
},
{
"name": "requestID",
"in": "path",
"schema": {
"type": "string",
"pattern": "^que"
},
"required": true
}
],
"security": [],
"responses": {
"204": {
"description": "<No Content>"
},
"400": {
"description": "InvalidRequestError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/InvalidRequestError"
}
}
}
},
"401": {
"description": "UnauthorizedError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UnauthorizedError"
}
}
}
},
"404": {
"description": "SessionNotFoundError | QuestionNotFoundError",
"content": {
"application/json": {
"schema": {
"anyOf": [
{
"$ref": "#/components/schemas/SessionNotFoundError"
},
{
"$ref": "#/components/schemas/QuestionNotFoundError"
}
]
}
}
}
}
},
"description": "Reject a pending question request owned by a session.",
"summary": "Reject pending question request",
"x-codeSamples": [
{
"lang": "js",
"source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.question.reject({\n ...\n})"
}
]
}
},
"/tui/append-prompt": {
"post": {
"tags": ["tui"],
@@ -11441,6 +9776,2056 @@
]
}
},
"/api/health": {
"get": {
"tags": ["opencode experimental HttpApi"],
"operationId": "v2.health.get",
"parameters": [],
"security": [],
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"healthy": {
"type": "boolean",
"enum": [true]
}
},
"required": ["healthy"],
"additionalProperties": false
}
}
}
},
"400": {
"description": "InvalidRequestError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/InvalidRequestError"
}
}
}
},
"401": {
"description": "UnauthorizedError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UnauthorizedError"
}
}
}
}
},
"description": "Check whether the v2 API server is ready to accept requests.",
"summary": "Check v2 server health",
"x-codeSamples": [
{
"lang": "js",
"source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.health.get({\n ...\n})"
}
]
}
},
"/api/agent": {
"get": {
"tags": ["opencode experimental HttpApi"],
"operationId": "v2.agent.list",
"parameters": [
{
"name": "location",
"in": "query",
"schema": {
"type": "object",
"properties": {
"directory": {
"type": "string"
},
"workspace": {
"type": "string"
}
},
"additionalProperties": false
},
"required": false,
"style": "deepObject",
"explode": true
}
],
"security": [],
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"location": {
"$ref": "#/components/schemas/LocationInfo"
},
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/AgentV2Info"
}
}
},
"required": ["location", "data"],
"additionalProperties": false
}
}
}
},
"400": {
"description": "InvalidRequestError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/InvalidRequestError"
}
}
}
},
"401": {
"description": "UnauthorizedError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UnauthorizedError"
}
}
}
}
},
"description": "Retrieve currently registered v2 agents.",
"summary": "List v2 agents",
"x-codeSamples": [
{
"lang": "js",
"source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.agent.list({\n ...\n})"
}
]
}
},
"/api/session": {
"get": {
"tags": ["v2"],
"operationId": "v2.session.list",
"parameters": [
{
"name": "workspace",
"in": "query",
"schema": {
"type": "string",
"pattern": "^wrk"
},
"required": false
},
{
"name": "limit",
"in": "query",
"schema": {
"type": "number"
},
"required": false
},
{
"name": "order",
"in": "query",
"schema": {
"type": "string",
"enum": ["asc", "desc"]
},
"required": false
},
{
"name": "search",
"in": "query",
"schema": {
"type": "string"
},
"required": false
},
{
"name": "directory",
"in": "query",
"schema": {
"type": "string"
},
"required": false
},
{
"name": "project",
"in": "query",
"schema": {
"type": "string"
},
"required": false
},
{
"name": "subpath",
"in": "query",
"schema": {
"type": "string"
},
"required": false
},
{
"name": "cursor",
"in": "query",
"schema": {
"type": "string",
"description": "Opaque pagination cursor returned as cursor.previous or cursor.next in the previous response."
},
"required": false
}
],
"security": [],
"responses": {
"200": {
"description": "V2SessionsResponse",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/V2SessionsResponse"
}
}
}
},
"400": {
"description": "InvalidCursorError | InvalidRequestError",
"content": {
"application/json": {
"schema": {
"anyOf": [
{
"$ref": "#/components/schemas/InvalidCursorError"
},
{
"$ref": "#/components/schemas/InvalidRequestError"
},
{
"$ref": "#/components/schemas/InvalidRequestError"
}
]
}
}
}
},
"401": {
"description": "UnauthorizedError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UnauthorizedError"
}
}
}
}
},
"description": "Retrieve sessions in the requested order. Items keep that order across pages; use cursor.next or cursor.previous to move through the ordered list.",
"summary": "List v2 sessions",
"x-codeSamples": [
{
"lang": "js",
"source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.list({\n ...\n})"
}
]
}
},
"/api/session/{sessionID}/prompt": {
"post": {
"tags": ["v2"],
"operationId": "v2.session.prompt",
"parameters": [
{
"name": "sessionID",
"in": "path",
"schema": {
"type": "string",
"pattern": "^ses"
},
"required": true
}
],
"security": [],
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/SessionMessageUser"
}
},
"required": ["data"],
"additionalProperties": false
}
}
}
},
"400": {
"description": "InvalidRequestError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/InvalidRequestError"
}
}
}
},
"401": {
"description": "UnauthorizedError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UnauthorizedError"
}
}
}
},
"404": {
"description": "SessionNotFoundError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SessionNotFoundError"
}
}
}
},
"409": {
"description": "ConflictError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ConflictError"
}
}
}
}
},
"description": "Durably admit one v2 session input and schedule agent-loop execution unless resume is false.",
"summary": "Send v2 message",
"requestBody": {
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"prompt": {
"$ref": "#/components/schemas/Prompt"
},
"delivery": {
"type": "string",
"enum": ["steer", "queue"]
},
"resume": {
"type": "boolean"
}
},
"required": ["prompt"],
"additionalProperties": false
}
}
},
"required": true
},
"x-codeSamples": [
{
"lang": "js",
"source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.prompt({\n ...\n})"
}
]
}
},
"/api/session/{sessionID}/compact": {
"post": {
"tags": ["v2"],
"operationId": "v2.session.compact",
"parameters": [
{
"name": "sessionID",
"in": "path",
"schema": {
"type": "string",
"pattern": "^ses"
},
"required": true
}
],
"security": [],
"responses": {
"204": {
"description": "<No Content>"
},
"400": {
"description": "InvalidRequestError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/InvalidRequestError"
}
}
}
},
"401": {
"description": "UnauthorizedError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UnauthorizedError"
}
}
}
},
"404": {
"description": "SessionNotFoundError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SessionNotFoundError"
}
}
}
},
"503": {
"description": "ServiceUnavailableError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ServiceUnavailableError"
}
}
}
}
},
"description": "Compact a v2 session conversation.",
"summary": "Compact v2 session",
"x-codeSamples": [
{
"lang": "js",
"source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.compact({\n ...\n})"
}
]
}
},
"/api/session/{sessionID}/wait": {
"post": {
"tags": ["v2"],
"operationId": "v2.session.wait",
"parameters": [
{
"name": "sessionID",
"in": "path",
"schema": {
"type": "string",
"pattern": "^ses"
},
"required": true
}
],
"security": [],
"responses": {
"204": {
"description": "<No Content>"
},
"400": {
"description": "InvalidRequestError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/InvalidRequestError"
}
}
}
},
"401": {
"description": "UnauthorizedError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UnauthorizedError"
}
}
}
},
"404": {
"description": "SessionNotFoundError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SessionNotFoundError"
}
}
}
},
"503": {
"description": "ServiceUnavailableError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ServiceUnavailableError"
}
}
}
}
},
"description": "Wait for a v2 session agent loop to become idle.",
"summary": "Wait for v2 session",
"x-codeSamples": [
{
"lang": "js",
"source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.wait({\n ...\n})"
}
]
}
},
"/api/session/{sessionID}/context": {
"get": {
"tags": ["v2"],
"operationId": "v2.session.context",
"parameters": [
{
"name": "sessionID",
"in": "path",
"schema": {
"type": "string",
"pattern": "^ses"
},
"required": true
}
],
"security": [],
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/SessionMessage"
}
}
},
"required": ["data"],
"additionalProperties": false
}
}
}
},
"400": {
"description": "InvalidRequestError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/InvalidRequestError"
}
}
}
},
"401": {
"description": "UnauthorizedError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UnauthorizedError"
}
}
}
},
"404": {
"description": "SessionNotFoundError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SessionNotFoundError"
}
}
}
},
"500": {
"description": "UnknownError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UnknownError1"
}
}
}
}
},
"description": "Retrieve the active context messages for a v2 session (all messages after the last compaction).",
"summary": "Get v2 session context",
"x-codeSamples": [
{
"lang": "js",
"source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.context({\n ...\n})"
}
]
}
},
"/api/session/{sessionID}/message": {
"get": {
"tags": ["v2 messages"],
"operationId": "v2.session.messages",
"parameters": [
{
"name": "sessionID",
"in": "path",
"schema": {
"type": "string",
"pattern": "^ses"
},
"required": true
},
{
"name": "limit",
"in": "query",
"schema": {
"type": "number"
},
"required": false
},
{
"name": "order",
"in": "query",
"schema": {
"type": "string",
"enum": ["asc", "desc"]
},
"required": false
},
{
"name": "cursor",
"in": "query",
"schema": {
"type": "string",
"description": "Opaque pagination cursor returned as cursor.previous or cursor.next in the previous response. Do not combine with order."
},
"required": false
}
],
"security": [],
"responses": {
"200": {
"description": "V2SessionMessagesResponse",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/V2SessionMessagesResponse"
}
}
}
},
"400": {
"description": "InvalidCursorError | InvalidRequestError",
"content": {
"application/json": {
"schema": {
"anyOf": [
{
"$ref": "#/components/schemas/InvalidCursorError"
},
{
"$ref": "#/components/schemas/InvalidRequestError"
}
]
}
}
}
},
"401": {
"description": "UnauthorizedError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UnauthorizedError"
}
}
}
},
"404": {
"description": "SessionNotFoundError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SessionNotFoundError"
}
}
}
},
"500": {
"description": "UnknownError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UnknownError1"
}
}
}
}
},
"description": "Retrieve projected v2 messages for a session. Items keep the requested order across pages; use cursor.next or cursor.previous to move through the ordered timeline.",
"summary": "Get v2 session messages",
"x-codeSamples": [
{
"lang": "js",
"source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.messages({\n ...\n})"
}
]
}
},
"/api/model": {
"get": {
"tags": ["v2 models"],
"operationId": "v2.model.list",
"parameters": [
{
"name": "location",
"in": "query",
"schema": {
"type": "object",
"properties": {
"directory": {
"type": "string"
},
"workspace": {
"type": "string"
}
},
"additionalProperties": false
},
"required": false,
"style": "deepObject",
"explode": true
}
],
"security": [],
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"location": {
"$ref": "#/components/schemas/LocationInfo"
},
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/ModelV2Info"
}
}
},
"required": ["location", "data"],
"additionalProperties": false
}
}
}
},
"400": {
"description": "InvalidRequestError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/InvalidRequestError"
}
}
}
},
"401": {
"description": "UnauthorizedError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UnauthorizedError"
}
}
}
},
"503": {
"description": "ServiceUnavailableError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ServiceUnavailableError"
}
}
}
}
},
"description": "Retrieve available v2 models ordered by release date.",
"summary": "List v2 models",
"x-codeSamples": [
{
"lang": "js",
"source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.model.list({\n ...\n})"
}
]
}
},
"/api/provider": {
"get": {
"tags": ["v2 providers"],
"operationId": "v2.provider.list",
"parameters": [
{
"name": "location",
"in": "query",
"schema": {
"type": "object",
"properties": {
"directory": {
"type": "string"
},
"workspace": {
"type": "string"
}
},
"additionalProperties": false
},
"required": false,
"style": "deepObject",
"explode": true
}
],
"security": [],
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"location": {
"$ref": "#/components/schemas/LocationInfo"
},
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/ProviderV2Info"
}
}
},
"required": ["location", "data"],
"additionalProperties": false
}
}
}
},
"400": {
"description": "InvalidRequestError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/InvalidRequestError"
}
}
}
},
"401": {
"description": "UnauthorizedError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UnauthorizedError"
}
}
}
},
"503": {
"description": "ServiceUnavailableError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ServiceUnavailableError"
}
}
}
}
},
"description": "Retrieve active v2 AI providers so clients can show provider availability and configuration.",
"summary": "List v2 providers",
"x-codeSamples": [
{
"lang": "js",
"source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.provider.list({\n ...\n})"
}
]
}
},
"/api/provider/{providerID}": {
"get": {
"tags": ["v2 providers"],
"operationId": "v2.provider.get",
"parameters": [
{
"name": "providerID",
"in": "path",
"schema": {
"type": "string"
},
"required": true
},
{
"name": "location",
"in": "query",
"schema": {
"type": "object",
"properties": {
"directory": {
"type": "string"
},
"workspace": {
"type": "string"
}
},
"additionalProperties": false
},
"required": false,
"style": "deepObject",
"explode": true
}
],
"security": [],
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"location": {
"$ref": "#/components/schemas/LocationInfo"
},
"data": {
"$ref": "#/components/schemas/ProviderV2Info"
}
},
"required": ["location", "data"],
"additionalProperties": false
}
}
}
},
"400": {
"description": "InvalidRequestError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/InvalidRequestError"
}
}
}
},
"401": {
"description": "UnauthorizedError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UnauthorizedError"
}
}
}
},
"404": {
"description": "ProviderNotFoundError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ProviderNotFoundError"
}
}
}
},
"503": {
"description": "ServiceUnavailableError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ServiceUnavailableError"
}
}
}
}
},
"description": "Retrieve a single v2 AI provider so clients can inspect its availability and endpoint settings.",
"summary": "Get v2 provider",
"x-codeSamples": [
{
"lang": "js",
"source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.provider.get({\n ...\n})"
}
]
}
},
"/api/permission/request": {
"get": {
"tags": ["v2 permissions"],
"operationId": "v2.permission.request.list",
"parameters": [
{
"name": "location",
"in": "query",
"schema": {
"type": "object",
"properties": {
"directory": {
"type": "string"
},
"workspace": {
"type": "string"
}
},
"additionalProperties": false
},
"required": false,
"style": "deepObject",
"explode": true
}
],
"security": [],
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"location": {
"$ref": "#/components/schemas/LocationInfo"
},
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/PermissionV2Request"
}
}
},
"required": ["location", "data"],
"additionalProperties": false
}
}
}
},
"400": {
"description": "InvalidRequestError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/InvalidRequestError"
}
}
}
},
"401": {
"description": "UnauthorizedError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UnauthorizedError"
}
}
}
}
},
"description": "Retrieve pending permission requests for a location.",
"summary": "List pending permission requests",
"x-codeSamples": [
{
"lang": "js",
"source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.permission.request.list({\n ...\n})"
}
]
}
},
"/api/session/{sessionID}/permission/request": {
"get": {
"tags": ["v2 session permissions"],
"operationId": "v2.session.permission.list",
"parameters": [
{
"name": "sessionID",
"in": "path",
"schema": {
"type": "string",
"pattern": "^ses"
},
"required": true
}
],
"security": [],
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/PermissionV2Request"
}
}
},
"required": ["data"],
"additionalProperties": false
}
}
}
},
"400": {
"description": "InvalidRequestError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/InvalidRequestError"
}
}
}
},
"401": {
"description": "UnauthorizedError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UnauthorizedError"
}
}
}
},
"404": {
"description": "SessionNotFoundError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SessionNotFoundError"
}
}
}
}
},
"description": "Retrieve pending permission requests owned by a session.",
"summary": "List session permission requests",
"x-codeSamples": [
{
"lang": "js",
"source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.permission.list({\n ...\n})"
}
]
}
},
"/api/session/{sessionID}/permission/request/{requestID}/reply": {
"post": {
"tags": ["v2 session permissions"],
"operationId": "v2.session.permission.reply",
"parameters": [
{
"name": "sessionID",
"in": "path",
"schema": {
"type": "string",
"pattern": "^ses"
},
"required": true
},
{
"name": "requestID",
"in": "path",
"schema": {
"type": "string",
"pattern": "^per"
},
"required": true
}
],
"security": [],
"responses": {
"204": {
"description": "<No Content>"
},
"400": {
"description": "InvalidRequestError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/InvalidRequestError"
}
}
}
},
"401": {
"description": "UnauthorizedError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UnauthorizedError"
}
}
}
},
"404": {
"description": "SessionNotFoundError | PermissionNotFoundError",
"content": {
"application/json": {
"schema": {
"anyOf": [
{
"$ref": "#/components/schemas/SessionNotFoundError"
},
{
"$ref": "#/components/schemas/PermissionNotFoundError"
}
]
}
}
}
}
},
"description": "Respond to a pending permission request owned by a session.",
"summary": "Reply to pending permission request",
"requestBody": {
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"reply": {
"$ref": "#/components/schemas/PermissionV2Reply"
},
"message": {
"type": "string"
}
},
"required": ["reply"],
"additionalProperties": false
}
}
},
"required": true
},
"x-codeSamples": [
{
"lang": "js",
"source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.permission.reply({\n ...\n})"
}
]
}
},
"/api/permission/saved": {
"get": {
"tags": ["v2 saved permissions"],
"operationId": "v2.permission.saved.list",
"parameters": [
{
"name": "projectID",
"in": "query",
"schema": {
"type": "string"
},
"required": false
}
],
"security": [],
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/PermissionSavedInfo"
}
}
},
"required": ["data"],
"additionalProperties": false
}
}
}
},
"400": {
"description": "InvalidRequestError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/InvalidRequestError"
}
}
}
},
"401": {
"description": "UnauthorizedError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UnauthorizedError"
}
}
}
}
},
"description": "Retrieve saved permissions, optionally filtered by project.",
"summary": "List saved permissions",
"x-codeSamples": [
{
"lang": "js",
"source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.permission.saved.list({\n ...\n})"
}
]
}
},
"/api/permission/saved/{id}": {
"delete": {
"tags": ["v2 saved permissions"],
"operationId": "v2.permission.saved.remove",
"parameters": [
{
"name": "id",
"in": "path",
"schema": {
"type": "string"
},
"required": true
}
],
"security": [],
"responses": {
"204": {
"description": "<No Content>"
},
"400": {
"description": "InvalidRequestError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/InvalidRequestError"
}
}
}
},
"401": {
"description": "UnauthorizedError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UnauthorizedError"
}
}
}
}
},
"description": "Remove a saved permission by ID.",
"summary": "Remove saved permission",
"x-codeSamples": [
{
"lang": "js",
"source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.permission.saved.remove({\n ...\n})"
}
]
}
},
"/api/fs/read": {
"get": {
"tags": ["v2 filesystem"],
"operationId": "v2.fs.read",
"parameters": [
{
"name": "location",
"in": "query",
"schema": {
"type": "object",
"properties": {
"directory": {
"type": "string"
},
"workspace": {
"type": "string"
}
},
"additionalProperties": false
},
"required": false,
"style": "deepObject",
"explode": true
},
{
"name": "path",
"in": "query",
"schema": {
"type": "string"
},
"required": true
},
{
"name": "reference",
"in": "query",
"schema": {
"type": "string"
},
"required": false
}
],
"security": [],
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"location": {
"$ref": "#/components/schemas/LocationInfo"
},
"data": {
"anyOf": [
{
"$ref": "#/components/schemas/FileSystemTextContent"
},
{
"$ref": "#/components/schemas/FileSystemBinaryContent"
}
]
}
},
"required": ["location", "data"],
"additionalProperties": false
}
}
}
},
"400": {
"description": "InvalidRequestError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/InvalidRequestError"
}
}
}
},
"401": {
"description": "UnauthorizedError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UnauthorizedError"
}
}
}
}
},
"description": "Read one file relative to the requested location.",
"summary": "Read file",
"x-codeSamples": [
{
"lang": "js",
"source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.fs.read({\n ...\n})"
}
]
}
},
"/api/fs/list": {
"get": {
"tags": ["v2 filesystem"],
"operationId": "v2.fs.list",
"parameters": [
{
"name": "location",
"in": "query",
"schema": {
"type": "object",
"properties": {
"directory": {
"type": "string"
},
"workspace": {
"type": "string"
}
},
"additionalProperties": false
},
"required": false,
"style": "deepObject",
"explode": true
},
{
"name": "path",
"in": "query",
"schema": {
"type": "string"
},
"required": false
},
{
"name": "reference",
"in": "query",
"schema": {
"type": "string"
},
"required": false
}
],
"security": [],
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"location": {
"$ref": "#/components/schemas/LocationInfo"
},
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/FileSystemEntry"
}
}
},
"required": ["location", "data"],
"additionalProperties": false
}
}
}
},
"400": {
"description": "InvalidRequestError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/InvalidRequestError"
}
}
}
},
"401": {
"description": "UnauthorizedError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UnauthorizedError"
}
}
}
}
},
"description": "List direct children of one directory relative to the requested location.",
"summary": "List directory",
"x-codeSamples": [
{
"lang": "js",
"source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.fs.list({\n ...\n})"
}
]
}
},
"/api/command": {
"get": {
"tags": ["v2 commands"],
"operationId": "v2.command.list",
"parameters": [
{
"name": "location",
"in": "query",
"schema": {
"type": "object",
"properties": {
"directory": {
"type": "string"
},
"workspace": {
"type": "string"
}
},
"additionalProperties": false
},
"required": false,
"style": "deepObject",
"explode": true
}
],
"security": [],
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"location": {
"$ref": "#/components/schemas/LocationInfo"
},
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/CommandV2Info"
}
}
},
"required": ["location", "data"],
"additionalProperties": false
}
}
}
},
"400": {
"description": "InvalidRequestError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/InvalidRequestError"
}
}
}
},
"401": {
"description": "UnauthorizedError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UnauthorizedError"
}
}
}
}
},
"description": "Retrieve currently registered v2 commands.",
"summary": "List v2 commands",
"x-codeSamples": [
{
"lang": "js",
"source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.command.list({\n ...\n})"
}
]
}
},
"/api/skill": {
"get": {
"tags": ["v2 skills"],
"operationId": "v2.skill.list",
"parameters": [
{
"name": "location",
"in": "query",
"schema": {
"type": "object",
"properties": {
"directory": {
"type": "string"
},
"workspace": {
"type": "string"
}
},
"additionalProperties": false
},
"required": false,
"style": "deepObject",
"explode": true
}
],
"security": [],
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"location": {
"$ref": "#/components/schemas/LocationInfo"
},
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/SkillV2Info"
}
}
},
"required": ["location", "data"],
"additionalProperties": false
}
}
}
},
"400": {
"description": "InvalidRequestError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/InvalidRequestError"
}
}
}
},
"401": {
"description": "UnauthorizedError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UnauthorizedError"
}
}
}
}
},
"description": "Retrieve currently registered v2 skills.",
"summary": "List v2 skills",
"x-codeSamples": [
{
"lang": "js",
"source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.skill.list({\n ...\n})"
}
]
}
},
"/api/event": {
"get": {
"tags": ["v2 events"],
"operationId": "v2.event.subscribe",
"parameters": [
{
"name": "location",
"in": "query",
"schema": {
"type": "object",
"properties": {
"directory": {
"type": "string"
},
"workspace": {
"type": "string"
}
},
"additionalProperties": false
},
"required": false,
"style": "deepObject",
"explode": true
}
],
"security": [],
"responses": {
"200": {
"description": "Success",
"content": {
"text/event-stream": {
"schema": {
"type": "string"
}
}
}
},
"400": {
"description": "InvalidRequestError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/InvalidRequestError"
}
}
}
},
"401": {
"description": "UnauthorizedError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UnauthorizedError"
}
}
}
}
},
"description": "Subscribe to native EventV2 payloads for a location.",
"summary": "Subscribe to v2 events",
"x-codeSamples": [
{
"lang": "js",
"source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.event.subscribe({\n ...\n})"
}
]
}
},
"/api/question/request": {
"get": {
"tags": ["v2 questions"],
"operationId": "v2.question.request.list",
"parameters": [
{
"name": "location",
"in": "query",
"schema": {
"type": "object",
"properties": {
"directory": {
"type": "string"
},
"workspace": {
"type": "string"
}
},
"additionalProperties": false
},
"required": false,
"style": "deepObject",
"explode": true
}
],
"security": [],
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"location": {
"$ref": "#/components/schemas/LocationInfo"
},
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/QuestionV2Request"
}
}
},
"required": ["location", "data"],
"additionalProperties": false
}
}
}
},
"400": {
"description": "InvalidRequestError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/InvalidRequestError"
}
}
}
},
"401": {
"description": "UnauthorizedError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UnauthorizedError"
}
}
}
}
},
"description": "Retrieve pending question requests for a location.",
"summary": "List pending question requests",
"x-codeSamples": [
{
"lang": "js",
"source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.question.request.list({\n ...\n})"
}
]
}
},
"/api/session/{sessionID}/question/request/{requestID}/reply": {
"post": {
"tags": ["v2 session questions"],
"operationId": "v2.session.question.reply",
"parameters": [
{
"name": "sessionID",
"in": "path",
"schema": {
"type": "string",
"pattern": "^ses"
},
"required": true
},
{
"name": "requestID",
"in": "path",
"schema": {
"type": "string",
"pattern": "^que"
},
"required": true
}
],
"security": [],
"responses": {
"204": {
"description": "<No Content>"
},
"400": {
"description": "InvalidRequestError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/InvalidRequestError"
}
}
}
},
"401": {
"description": "UnauthorizedError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UnauthorizedError"
}
}
}
},
"404": {
"description": "SessionNotFoundError | QuestionNotFoundError",
"content": {
"application/json": {
"schema": {
"anyOf": [
{
"$ref": "#/components/schemas/SessionNotFoundError"
},
{
"$ref": "#/components/schemas/QuestionNotFoundError"
}
]
}
}
}
}
},
"description": "Answer a pending question request owned by a session.",
"summary": "Reply to pending question request",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/QuestionV2Reply"
}
}
},
"required": true
},
"x-codeSamples": [
{
"lang": "js",
"source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.question.reply({\n ...\n})"
}
]
}
},
"/api/session/{sessionID}/question/request/{requestID}/reject": {
"post": {
"tags": ["v2 session questions"],
"operationId": "v2.session.question.reject",
"parameters": [
{
"name": "sessionID",
"in": "path",
"schema": {
"type": "string",
"pattern": "^ses"
},
"required": true
},
{
"name": "requestID",
"in": "path",
"schema": {
"type": "string",
"pattern": "^que"
},
"required": true
}
],
"security": [],
"responses": {
"204": {
"description": "<No Content>"
},
"400": {
"description": "InvalidRequestError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/InvalidRequestError"
}
}
}
},
"401": {
"description": "UnauthorizedError",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UnauthorizedError"
}
}
}
},
"404": {
"description": "SessionNotFoundError | QuestionNotFoundError",
"content": {
"application/json": {
"schema": {
"anyOf": [
{
"$ref": "#/components/schemas/SessionNotFoundError"
},
{
"$ref": "#/components/schemas/QuestionNotFoundError"
}
]
}
}
}
}
},
"description": "Reject a pending question request owned by a session.",
"summary": "Reject pending question request",
"x-codeSamples": [
{
"lang": "js",
"source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.question.reject({\n ...\n})"
}
]
}
},
"/pty/{ptyID}/connect": {
"get": {
"tags": ["pty"],
@@ -17096,6 +17481,9 @@
"model": {
"type": "string"
},
"variant": {
"type": "string"
},
"subtask": {
"type": "boolean"
}
@@ -19186,169 +19574,6 @@
"required": ["_tag", "sessionID", "message"],
"additionalProperties": false
},
"V2SessionsResponse": {
"type": "object",
"properties": {
"items": {
"type": "array",
"items": {
"$ref": "#/components/schemas/SessionV2Info"
}
},
"cursor": {
"type": "object",
"properties": {
"previous": {
"type": "string"
},
"next": {
"type": "string"
}
},
"additionalProperties": false
}
},
"required": ["items", "cursor"],
"additionalProperties": false
},
"InvalidCursorError": {
"type": "object",
"properties": {
"_tag": {
"type": "string",
"enum": ["InvalidCursorError"]
},
"message": {
"type": "string"
}
},
"required": ["_tag", "message"],
"additionalProperties": false
},
"UnauthorizedError": {
"type": "object",
"properties": {
"_tag": {
"type": "string",
"enum": ["UnauthorizedError"]
},
"message": {
"type": "string"
}
},
"required": ["_tag", "message"],
"additionalProperties": false
},
"ConflictError": {
"type": "object",
"properties": {
"_tag": {
"type": "string",
"enum": ["ConflictError"]
},
"message": {
"type": "string"
},
"resource": {
"type": "string"
}
},
"required": ["_tag", "message"],
"additionalProperties": false
},
"SessionNotFoundError": {
"type": "object",
"properties": {
"_tag": {
"type": "string",
"enum": ["SessionNotFoundError"]
},
"sessionID": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": ["_tag", "sessionID", "message"],
"additionalProperties": false
},
"ServiceUnavailableError": {
"type": "object",
"properties": {
"_tag": {
"type": "string",
"enum": ["ServiceUnavailableError"]
},
"message": {
"type": "string"
},
"service": {
"type": "string"
}
},
"required": ["_tag", "message"],
"additionalProperties": false
},
"UnknownError1": {
"type": "object",
"properties": {
"_tag": {
"type": "string",
"enum": ["UnknownError"]
},
"message": {
"type": "string"
},
"ref": {
"type": "string"
}
},
"required": ["_tag", "message"],
"additionalProperties": false
},
"V2SessionMessagesResponse": {
"type": "object",
"properties": {
"items": {
"type": "array",
"items": {
"$ref": "#/components/schemas/SessionMessage"
}
},
"cursor": {
"type": "object",
"properties": {
"previous": {
"type": "string"
},
"next": {
"type": "string"
}
},
"additionalProperties": false
}
},
"required": ["items", "cursor"],
"additionalProperties": false
},
"ProviderNotFoundError": {
"type": "object",
"properties": {
"_tag": {
"type": "string",
"enum": ["ProviderNotFoundError"]
},
"providerID": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": ["_tag", "providerID", "message"],
"additionalProperties": false
},
"EventTuiPromptAppend": {
"type": "object",
"properties": {
@@ -19584,6 +19809,169 @@
"required": ["name", "data"],
"additionalProperties": false
},
"UnauthorizedError": {
"type": "object",
"properties": {
"_tag": {
"type": "string",
"enum": ["UnauthorizedError"]
},
"message": {
"type": "string"
}
},
"required": ["_tag", "message"],
"additionalProperties": false
},
"V2SessionsResponse": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/SessionV2Info"
}
},
"cursor": {
"type": "object",
"properties": {
"previous": {
"type": "string"
},
"next": {
"type": "string"
}
},
"additionalProperties": false
}
},
"required": ["data", "cursor"],
"additionalProperties": false
},
"InvalidCursorError": {
"type": "object",
"properties": {
"_tag": {
"type": "string",
"enum": ["InvalidCursorError"]
},
"message": {
"type": "string"
}
},
"required": ["_tag", "message"],
"additionalProperties": false
},
"ConflictError": {
"type": "object",
"properties": {
"_tag": {
"type": "string",
"enum": ["ConflictError"]
},
"message": {
"type": "string"
},
"resource": {
"type": "string"
}
},
"required": ["_tag", "message"],
"additionalProperties": false
},
"SessionNotFoundError": {
"type": "object",
"properties": {
"_tag": {
"type": "string",
"enum": ["SessionNotFoundError"]
},
"sessionID": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": ["_tag", "sessionID", "message"],
"additionalProperties": false
},
"ServiceUnavailableError": {
"type": "object",
"properties": {
"_tag": {
"type": "string",
"enum": ["ServiceUnavailableError"]
},
"message": {
"type": "string"
},
"service": {
"type": "string"
}
},
"required": ["_tag", "message"],
"additionalProperties": false
},
"UnknownError1": {
"type": "object",
"properties": {
"_tag": {
"type": "string",
"enum": ["UnknownError"]
},
"message": {
"type": "string"
},
"ref": {
"type": "string"
}
},
"required": ["_tag", "message"],
"additionalProperties": false
},
"V2SessionMessagesResponse": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/SessionMessage"
}
},
"cursor": {
"type": "object",
"properties": {
"previous": {
"type": "string"
},
"next": {
"type": "string"
}
},
"additionalProperties": false
}
},
"required": ["data", "cursor"],
"additionalProperties": false
},
"ProviderNotFoundError": {
"type": "object",
"properties": {
"_tag": {
"type": "string",
"enum": ["ProviderNotFoundError"]
},
"providerID": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": ["_tag", "providerID", "message"],
"additionalProperties": false
},
"effect_HttpApiError_Forbidden": {
"type": "object",
"properties": {
@@ -20359,36 +20747,45 @@
"type": "string",
"enum": ["sync"]
},
"name": {
"type": "string",
"enum": ["session.created.1"]
},
"id": {
"type": "string"
},
"seq": {
"type": "number"
},
"aggregateID": {
"type": "string",
"enum": ["sessionID"]
},
"data": {
"syncEvent": {
"type": "object",
"properties": {
"sessionID": {
"type": {
"type": "string",
"pattern": "^ses"
"enum": ["session.created.1"]
},
"info": {
"$ref": "#/components/schemas/Session"
"id": {
"type": "string"
},
"seq": {
"type": "number"
},
"aggregateID": {
"type": "string"
},
"data": {
"type": "object",
"properties": {
"sessionID": {
"type": "string",
"pattern": "^ses"
},
"info": {
"$ref": "#/components/schemas/Session"
}
},
"required": ["sessionID", "info"],
"additionalProperties": false
}
},
"required": ["sessionID", "info"],
"required": ["type", "id", "seq", "aggregateID", "data"],
"additionalProperties": false
}
},
"required": ["type", "name", "id", "seq", "aggregateID", "data"],
"required": ["type", "id", "syncEvent"],
"additionalProperties": false
},
"SyncEventSessionUpdated": {
@@ -20398,36 +20795,45 @@
"type": "string",
"enum": ["sync"]
},
"name": {
"type": "string",
"enum": ["session.updated.1"]
},
"id": {
"type": "string"
},
"seq": {
"type": "number"
},
"aggregateID": {
"type": "string",
"enum": ["sessionID"]
},
"data": {
"syncEvent": {
"type": "object",
"properties": {
"sessionID": {
"type": {
"type": "string",
"pattern": "^ses"
"enum": ["session.updated.1"]
},
"info": {
"$ref": "#/components/schemas/Session"
"id": {
"type": "string"
},
"seq": {
"type": "number"
},
"aggregateID": {
"type": "string"
},
"data": {
"type": "object",
"properties": {
"sessionID": {
"type": "string",
"pattern": "^ses"
},
"info": {
"$ref": "#/components/schemas/Session"
}
},
"required": ["sessionID", "info"],
"additionalProperties": false
}
},
"required": ["sessionID", "info"],
"required": ["type", "id", "seq", "aggregateID", "data"],
"additionalProperties": false
}
},
"required": ["type", "name", "id", "seq", "aggregateID", "data"],
"required": ["type", "id", "syncEvent"],
"additionalProperties": false
},
"SyncEventSessionDeleted": {
@@ -20437,36 +20843,45 @@
"type": "string",
"enum": ["sync"]
},
"name": {
"type": "string",
"enum": ["session.deleted.1"]
},
"id": {
"type": "string"
},
"seq": {
"type": "number"
},
"aggregateID": {
"type": "string",
"enum": ["sessionID"]
},
"data": {
"syncEvent": {
"type": "object",
"properties": {
"sessionID": {
"type": {
"type": "string",
"pattern": "^ses"
"enum": ["session.deleted.1"]
},
"info": {
"$ref": "#/components/schemas/Session"
"id": {
"type": "string"
},
"seq": {
"type": "number"
},
"aggregateID": {
"type": "string"
},
"data": {
"type": "object",
"properties": {
"sessionID": {
"type": "string",
"pattern": "^ses"
},
"info": {
"$ref": "#/components/schemas/Session"
}
},
"required": ["sessionID", "info"],
"additionalProperties": false
}
},
"required": ["sessionID", "info"],
"required": ["type", "id", "seq", "aggregateID", "data"],
"additionalProperties": false
}
},
"required": ["type", "name", "id", "seq", "aggregateID", "data"],
"required": ["type", "id", "syncEvent"],
"additionalProperties": false
},
"SyncEventMessageUpdated": {
@@ -20476,36 +20891,45 @@
"type": "string",
"enum": ["sync"]
},
"name": {
"type": "string",
"enum": ["message.updated.1"]
},
"id": {
"type": "string"
},
"seq": {
"type": "number"
},
"aggregateID": {
"type": "string",
"enum": ["sessionID"]
},
"data": {
"syncEvent": {
"type": "object",
"properties": {
"sessionID": {
"type": {
"type": "string",
"pattern": "^ses"
"enum": ["message.updated.1"]
},
"info": {
"$ref": "#/components/schemas/Message"
"id": {
"type": "string"
},
"seq": {
"type": "number"
},
"aggregateID": {
"type": "string"
},
"data": {
"type": "object",
"properties": {
"sessionID": {
"type": "string",
"pattern": "^ses"
},
"info": {
"$ref": "#/components/schemas/Message"
}
},
"required": ["sessionID", "info"],
"additionalProperties": false
}
},
"required": ["sessionID", "info"],
"required": ["type", "id", "seq", "aggregateID", "data"],
"additionalProperties": false
}
},
"required": ["type", "name", "id", "seq", "aggregateID", "data"],
"required": ["type", "id", "syncEvent"],
"additionalProperties": false
},
"SyncEventMessageRemoved": {
@@ -20515,37 +20939,46 @@
"type": "string",
"enum": ["sync"]
},
"name": {
"type": "string",
"enum": ["message.removed.1"]
},
"id": {
"type": "string"
},
"seq": {
"type": "number"
},
"aggregateID": {
"type": "string",
"enum": ["sessionID"]
},
"data": {
"syncEvent": {
"type": "object",
"properties": {
"sessionID": {
"type": {
"type": "string",
"pattern": "^ses"
"enum": ["message.removed.1"]
},
"messageID": {
"type": "string",
"pattern": "^msg"
"id": {
"type": "string"
},
"seq": {
"type": "number"
},
"aggregateID": {
"type": "string"
},
"data": {
"type": "object",
"properties": {
"sessionID": {
"type": "string",
"pattern": "^ses"
},
"messageID": {
"type": "string",
"pattern": "^msg"
}
},
"required": ["sessionID", "messageID"],
"additionalProperties": false
}
},
"required": ["sessionID", "messageID"],
"required": ["type", "id", "seq", "aggregateID", "data"],
"additionalProperties": false
}
},
"required": ["type", "name", "id", "seq", "aggregateID", "data"],
"required": ["type", "id", "syncEvent"],
"additionalProperties": false
},
"SyncEventMessagePartUpdated": {
@@ -20555,39 +20988,48 @@
"type": "string",
"enum": ["sync"]
},
"name": {
"type": "string",
"enum": ["message.part.updated.1"]
},
"id": {
"type": "string"
},
"seq": {
"type": "number"
},
"aggregateID": {
"type": "string",
"enum": ["sessionID"]
},
"data": {
"syncEvent": {
"type": "object",
"properties": {
"sessionID": {
"type": {
"type": "string",
"pattern": "^ses"
"enum": ["message.part.updated.1"]
},
"part": {
"$ref": "#/components/schemas/Part"
"id": {
"type": "string"
},
"time": {
"seq": {
"type": "number"
},
"aggregateID": {
"type": "string"
},
"data": {
"type": "object",
"properties": {
"sessionID": {
"type": "string",
"pattern": "^ses"
},
"part": {
"$ref": "#/components/schemas/Part"
},
"time": {
"type": "number"
}
},
"required": ["sessionID", "part", "time"],
"additionalProperties": false
}
},
"required": ["sessionID", "part", "time"],
"required": ["type", "id", "seq", "aggregateID", "data"],
"additionalProperties": false
}
},
"required": ["type", "name", "id", "seq", "aggregateID", "data"],
"required": ["type", "id", "syncEvent"],
"additionalProperties": false
},
"SyncEventMessagePartRemoved": {
@@ -20597,41 +21039,50 @@
"type": "string",
"enum": ["sync"]
},
"name": {
"type": "string",
"enum": ["message.part.removed.1"]
},
"id": {
"type": "string"
},
"seq": {
"type": "number"
},
"aggregateID": {
"type": "string",
"enum": ["sessionID"]
},
"data": {
"syncEvent": {
"type": "object",
"properties": {
"sessionID": {
"type": {
"type": "string",
"pattern": "^ses"
"enum": ["message.part.removed.1"]
},
"messageID": {
"type": "string",
"pattern": "^msg"
"id": {
"type": "string"
},
"partID": {
"type": "string",
"pattern": "^prt"
"seq": {
"type": "number"
},
"aggregateID": {
"type": "string"
},
"data": {
"type": "object",
"properties": {
"sessionID": {
"type": "string",
"pattern": "^ses"
},
"messageID": {
"type": "string",
"pattern": "^msg"
},
"partID": {
"type": "string",
"pattern": "^prt"
}
},
"required": ["sessionID", "messageID", "partID"],
"additionalProperties": false
}
},
"required": ["sessionID", "messageID", "partID"],
"required": ["type", "id", "seq", "aggregateID", "data"],
"additionalProperties": false
}
},
"required": ["type", "name", "id", "seq", "aggregateID", "data"],
"required": ["type", "id", "syncEvent"],
"additionalProperties": false
},
"SyncEventSessionNextAgentSwitched": {
@@ -20641,39 +21092,48 @@
"type": "string",
"enum": ["sync"]
},
"name": {
"type": "string",
"enum": ["session.next.agent.switched.1"]
},
"id": {
"type": "string"
},
"seq": {
"type": "number"
},
"aggregateID": {
"type": "string",
"enum": ["sessionID"]
},
"data": {
"syncEvent": {
"type": "object",
"properties": {
"timestamp": {
"type": {
"type": "string",
"enum": ["session.next.agent.switched.1"]
},
"id": {
"type": "string"
},
"seq": {
"type": "number"
},
"sessionID": {
"type": "string",
"pattern": "^ses"
},
"agent": {
"aggregateID": {
"type": "string"
},
"data": {
"type": "object",
"properties": {
"timestamp": {
"type": "number"
},
"sessionID": {
"type": "string",
"pattern": "^ses"
},
"agent": {
"type": "string"
}
},
"required": ["timestamp", "sessionID", "agent"],
"additionalProperties": false
}
},
"required": ["timestamp", "sessionID", "agent"],
"required": ["type", "id", "seq", "aggregateID", "data"],
"additionalProperties": false
}
},
"required": ["type", "name", "id", "seq", "aggregateID", "data"],
"required": ["type", "id", "syncEvent"],
"additionalProperties": false
},
"SyncEventSessionNextModelSwitched": {
@@ -20683,52 +21143,61 @@
"type": "string",
"enum": ["sync"]
},
"name": {
"type": "string",
"enum": ["session.next.model.switched.1"]
},
"id": {
"type": "string"
},
"seq": {
"type": "number"
},
"aggregateID": {
"type": "string",
"enum": ["sessionID"]
},
"data": {
"syncEvent": {
"type": "object",
"properties": {
"timestamp": {
"type": {
"type": "string",
"enum": ["session.next.model.switched.1"]
},
"id": {
"type": "string"
},
"seq": {
"type": "number"
},
"sessionID": {
"type": "string",
"pattern": "^ses"
"aggregateID": {
"type": "string"
},
"model": {
"data": {
"type": "object",
"properties": {
"id": {
"type": "string"
"timestamp": {
"type": "number"
},
"providerID": {
"type": "string"
"sessionID": {
"type": "string",
"pattern": "^ses"
},
"variant": {
"type": "string"
"model": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"providerID": {
"type": "string"
},
"variant": {
"type": "string"
}
},
"required": ["id", "providerID"],
"additionalProperties": false
}
},
"required": ["id", "providerID"],
"required": ["timestamp", "sessionID", "model"],
"additionalProperties": false
}
},
"required": ["timestamp", "sessionID", "model"],
"required": ["type", "id", "seq", "aggregateID", "data"],
"additionalProperties": false
}
},
"required": ["type", "name", "id", "seq", "aggregateID", "data"],
"required": ["type", "id", "syncEvent"],
"additionalProperties": false
},
"SyncEventSessionNextPrompted": {
@@ -20738,43 +21207,52 @@
"type": "string",
"enum": ["sync"]
},
"name": {
"type": "string",
"enum": ["session.next.prompted.1"]
},
"id": {
"type": "string"
},
"seq": {
"type": "number"
},
"aggregateID": {
"type": "string",
"enum": ["sessionID"]
},
"data": {
"syncEvent": {
"type": "object",
"properties": {
"timestamp": {
"type": {
"type": "string",
"enum": ["session.next.prompted.1"]
},
"id": {
"type": "string"
},
"seq": {
"type": "number"
},
"sessionID": {
"type": "string",
"pattern": "^ses"
"aggregateID": {
"type": "string"
},
"prompt": {
"$ref": "#/components/schemas/Prompt"
},
"delivery": {
"type": "string",
"enum": ["steer", "queue"]
"data": {
"type": "object",
"properties": {
"timestamp": {
"type": "number"
},
"sessionID": {
"type": "string",
"pattern": "^ses"
},
"prompt": {
"$ref": "#/components/schemas/Prompt"
},
"delivery": {
"type": "string",
"enum": ["steer", "queue"]
}
},
"required": ["timestamp", "sessionID", "prompt", "delivery"],
"additionalProperties": false
}
},
"required": ["timestamp", "sessionID", "prompt", "delivery"],
"required": ["type", "id", "seq", "aggregateID", "data"],
"additionalProperties": false
}
},
"required": ["type", "name", "id", "seq", "aggregateID", "data"],
"required": ["type", "id", "syncEvent"],
"additionalProperties": false
},
"SyncEventSessionNextSynthetic": {
@@ -20784,39 +21262,48 @@
"type": "string",
"enum": ["sync"]
},
"name": {
"type": "string",
"enum": ["session.next.synthetic.1"]
},
"id": {
"type": "string"
},
"seq": {
"type": "number"
},
"aggregateID": {
"type": "string",
"enum": ["sessionID"]
},
"data": {
"syncEvent": {
"type": "object",
"properties": {
"timestamp": {
"type": {
"type": "string",
"enum": ["session.next.synthetic.1"]
},
"id": {
"type": "string"
},
"seq": {
"type": "number"
},
"sessionID": {
"type": "string",
"pattern": "^ses"
},
"text": {
"aggregateID": {
"type": "string"
},
"data": {
"type": "object",
"properties": {
"timestamp": {
"type": "number"
},
"sessionID": {
"type": "string",
"pattern": "^ses"
},
"text": {
"type": "string"
}
},
"required": ["timestamp", "sessionID", "text"],
"additionalProperties": false
}
},
"required": ["timestamp", "sessionID", "text"],
"required": ["type", "id", "seq", "aggregateID", "data"],
"additionalProperties": false
}
},
"required": ["type", "name", "id", "seq", "aggregateID", "data"],
"required": ["type", "id", "syncEvent"],
"additionalProperties": false
},
"SyncEventSessionNextShellStarted": {
@@ -20826,42 +21313,51 @@
"type": "string",
"enum": ["sync"]
},
"name": {
"type": "string",
"enum": ["session.next.shell.started.1"]
},
"id": {
"type": "string"
},
"seq": {
"type": "number"
},
"aggregateID": {
"type": "string",
"enum": ["sessionID"]
},
"data": {
"syncEvent": {
"type": "object",
"properties": {
"timestamp": {
"type": {
"type": "string",
"enum": ["session.next.shell.started.1"]
},
"id": {
"type": "string"
},
"seq": {
"type": "number"
},
"sessionID": {
"type": "string",
"pattern": "^ses"
},
"callID": {
"aggregateID": {
"type": "string"
},
"command": {
"type": "string"
"data": {
"type": "object",
"properties": {
"timestamp": {
"type": "number"
},
"sessionID": {
"type": "string",
"pattern": "^ses"
},
"callID": {
"type": "string"
},
"command": {
"type": "string"
}
},
"required": ["timestamp", "sessionID", "callID", "command"],
"additionalProperties": false
}
},
"required": ["timestamp", "sessionID", "callID", "command"],
"required": ["type", "id", "seq", "aggregateID", "data"],
"additionalProperties": false
}
},
"required": ["type", "name", "id", "seq", "aggregateID", "data"],
"required": ["type", "id", "syncEvent"],
"additionalProperties": false
},
"SyncEventSessionNextShellEnded": {
@@ -20871,42 +21367,51 @@
"type": "string",
"enum": ["sync"]
},
"name": {
"type": "string",
"enum": ["session.next.shell.ended.1"]
},
"id": {
"type": "string"
},
"seq": {
"type": "number"
},
"aggregateID": {
"type": "string",
"enum": ["sessionID"]
},
"data": {
"syncEvent": {
"type": "object",
"properties": {
"timestamp": {
"type": {
"type": "string",
"enum": ["session.next.shell.ended.1"]
},
"id": {
"type": "string"
},
"seq": {
"type": "number"
},
"sessionID": {
"type": "string",
"pattern": "^ses"
},
"callID": {
"aggregateID": {
"type": "string"
},
"output": {
"type": "string"
"data": {
"type": "object",
"properties": {
"timestamp": {
"type": "number"
},
"sessionID": {
"type": "string",
"pattern": "^ses"
},
"callID": {
"type": "string"
},
"output": {
"type": "string"
}
},
"required": ["timestamp", "sessionID", "callID", "output"],
"additionalProperties": false
}
},
"required": ["timestamp", "sessionID", "callID", "output"],
"required": ["type", "id", "seq", "aggregateID", "data"],
"additionalProperties": false
}
},
"required": ["type", "name", "id", "seq", "aggregateID", "data"],
"required": ["type", "id", "syncEvent"],
"additionalProperties": false
},
"SyncEventSessionNextStepStarted": {
@@ -20916,58 +21421,67 @@
"type": "string",
"enum": ["sync"]
},
"name": {
"type": "string",
"enum": ["session.next.step.started.1"]
},
"id": {
"type": "string"
},
"seq": {
"type": "number"
},
"aggregateID": {
"type": "string",
"enum": ["sessionID"]
},
"data": {
"syncEvent": {
"type": "object",
"properties": {
"timestamp": {
"type": "number"
},
"sessionID": {
"type": {
"type": "string",
"pattern": "^ses"
"enum": ["session.next.step.started.1"]
},
"agent": {
"id": {
"type": "string"
},
"model": {
"seq": {
"type": "number"
},
"aggregateID": {
"type": "string"
},
"data": {
"type": "object",
"properties": {
"id": {
"timestamp": {
"type": "number"
},
"sessionID": {
"type": "string",
"pattern": "^ses"
},
"agent": {
"type": "string"
},
"providerID": {
"type": "string"
"model": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"providerID": {
"type": "string"
},
"variant": {
"type": "string"
}
},
"required": ["id", "providerID"],
"additionalProperties": false
},
"variant": {
"snapshot": {
"type": "string"
}
},
"required": ["id", "providerID"],
"required": ["timestamp", "sessionID", "agent", "model"],
"additionalProperties": false
},
"snapshot": {
"type": "string"
}
},
"required": ["timestamp", "sessionID", "agent", "model"],
"required": ["type", "id", "seq", "aggregateID", "data"],
"additionalProperties": false
}
},
"required": ["type", "name", "id", "seq", "aggregateID", "data"],
"required": ["type", "id", "syncEvent"],
"additionalProperties": false
},
"SyncEventSessionNextStepEnded": {
@@ -20977,77 +21491,86 @@
"type": "string",
"enum": ["sync"]
},
"name": {
"type": "string",
"enum": ["session.next.step.ended.2"]
},
"id": {
"type": "string"
},
"seq": {
"type": "number"
},
"aggregateID": {
"type": "string",
"enum": ["sessionID"]
},
"data": {
"syncEvent": {
"type": "object",
"properties": {
"timestamp": {
"type": "number"
},
"sessionID": {
"type": {
"type": "string",
"pattern": "^ses"
"enum": ["session.next.step.ended.2"]
},
"assistantMessageID": {
"id": {
"type": "string"
},
"finish": {
"type": "string"
},
"cost": {
"seq": {
"type": "number"
},
"tokens": {
"aggregateID": {
"type": "string"
},
"data": {
"type": "object",
"properties": {
"input": {
"timestamp": {
"type": "number"
},
"output": {
"sessionID": {
"type": "string",
"pattern": "^ses"
},
"assistantMessageID": {
"type": "string"
},
"finish": {
"type": "string"
},
"cost": {
"type": "number"
},
"reasoning": {
"type": "number"
},
"cache": {
"tokens": {
"type": "object",
"properties": {
"read": {
"input": {
"type": "number"
},
"write": {
"output": {
"type": "number"
},
"reasoning": {
"type": "number"
},
"cache": {
"type": "object",
"properties": {
"read": {
"type": "number"
},
"write": {
"type": "number"
}
},
"required": ["read", "write"],
"additionalProperties": false
}
},
"required": ["read", "write"],
"required": ["input", "output", "reasoning", "cache"],
"additionalProperties": false
},
"snapshot": {
"type": "string"
}
},
"required": ["input", "output", "reasoning", "cache"],
"required": ["timestamp", "sessionID", "assistantMessageID", "finish", "cost", "tokens"],
"additionalProperties": false
},
"snapshot": {
"type": "string"
}
},
"required": ["timestamp", "sessionID", "assistantMessageID", "finish", "cost", "tokens"],
"required": ["type", "id", "seq", "aggregateID", "data"],
"additionalProperties": false
}
},
"required": ["type", "name", "id", "seq", "aggregateID", "data"],
"required": ["type", "id", "syncEvent"],
"additionalProperties": false
},
"SyncEventSessionNextStepFailed": {
@@ -21057,42 +21580,51 @@
"type": "string",
"enum": ["sync"]
},
"name": {
"type": "string",
"enum": ["session.next.step.failed.2"]
},
"id": {
"type": "string"
},
"seq": {
"type": "number"
},
"aggregateID": {
"type": "string",
"enum": ["sessionID"]
},
"data": {
"syncEvent": {
"type": "object",
"properties": {
"timestamp": {
"type": "number"
},
"sessionID": {
"type": {
"type": "string",
"pattern": "^ses"
"enum": ["session.next.step.failed.2"]
},
"assistantMessageID": {
"id": {
"type": "string"
},
"error": {
"$ref": "#/components/schemas/SessionErrorUnknown"
"seq": {
"type": "number"
},
"aggregateID": {
"type": "string"
},
"data": {
"type": "object",
"properties": {
"timestamp": {
"type": "number"
},
"sessionID": {
"type": "string",
"pattern": "^ses"
},
"assistantMessageID": {
"type": "string"
},
"error": {
"$ref": "#/components/schemas/SessionErrorUnknown"
}
},
"required": ["timestamp", "sessionID", "assistantMessageID", "error"],
"additionalProperties": false
}
},
"required": ["timestamp", "sessionID", "assistantMessageID", "error"],
"required": ["type", "id", "seq", "aggregateID", "data"],
"additionalProperties": false
}
},
"required": ["type", "name", "id", "seq", "aggregateID", "data"],
"required": ["type", "id", "syncEvent"],
"additionalProperties": false
},
"SyncEventSessionNextTextStarted": {
@@ -21102,39 +21634,48 @@
"type": "string",
"enum": ["sync"]
},
"name": {
"type": "string",
"enum": ["session.next.text.started.1"]
},
"id": {
"type": "string"
},
"seq": {
"type": "number"
},
"aggregateID": {
"type": "string",
"enum": ["sessionID"]
},
"data": {
"syncEvent": {
"type": "object",
"properties": {
"timestamp": {
"type": {
"type": "string",
"enum": ["session.next.text.started.1"]
},
"id": {
"type": "string"
},
"seq": {
"type": "number"
},
"sessionID": {
"type": "string",
"pattern": "^ses"
},
"textID": {
"aggregateID": {
"type": "string"
},
"data": {
"type": "object",
"properties": {
"timestamp": {
"type": "number"
},
"sessionID": {
"type": "string",
"pattern": "^ses"
},
"textID": {
"type": "string"
}
},
"required": ["timestamp", "sessionID", "textID"],
"additionalProperties": false
}
},
"required": ["timestamp", "sessionID", "textID"],
"required": ["type", "id", "seq", "aggregateID", "data"],
"additionalProperties": false
}
},
"required": ["type", "name", "id", "seq", "aggregateID", "data"],
"required": ["type", "id", "syncEvent"],
"additionalProperties": false
},
"SyncEventSessionNextTextEnded": {
@@ -21144,42 +21685,51 @@
"type": "string",
"enum": ["sync"]
},
"name": {
"type": "string",
"enum": ["session.next.text.ended.1"]
},
"id": {
"type": "string"
},
"seq": {
"type": "number"
},
"aggregateID": {
"type": "string",
"enum": ["sessionID"]
},
"data": {
"syncEvent": {
"type": "object",
"properties": {
"timestamp": {
"type": {
"type": "string",
"enum": ["session.next.text.ended.1"]
},
"id": {
"type": "string"
},
"seq": {
"type": "number"
},
"sessionID": {
"type": "string",
"pattern": "^ses"
},
"textID": {
"aggregateID": {
"type": "string"
},
"text": {
"type": "string"
"data": {
"type": "object",
"properties": {
"timestamp": {
"type": "number"
},
"sessionID": {
"type": "string",
"pattern": "^ses"
},
"textID": {
"type": "string"
},
"text": {
"type": "string"
}
},
"required": ["timestamp", "sessionID", "textID", "text"],
"additionalProperties": false
}
},
"required": ["timestamp", "sessionID", "textID", "text"],
"required": ["type", "id", "seq", "aggregateID", "data"],
"additionalProperties": false
}
},
"required": ["type", "name", "id", "seq", "aggregateID", "data"],
"required": ["type", "id", "syncEvent"],
"additionalProperties": false
},
"SyncEventSessionNextReasoningStarted": {
@@ -21189,45 +21739,54 @@
"type": "string",
"enum": ["sync"]
},
"name": {
"type": "string",
"enum": ["session.next.reasoning.started.1"]
},
"id": {
"type": "string"
},
"seq": {
"type": "number"
},
"aggregateID": {
"type": "string",
"enum": ["sessionID"]
},
"data": {
"syncEvent": {
"type": "object",
"properties": {
"timestamp": {
"type": "number"
},
"sessionID": {
"type": {
"type": "string",
"pattern": "^ses"
"enum": ["session.next.reasoning.started.1"]
},
"reasoningID": {
"id": {
"type": "string"
},
"providerMetadata": {
"seq": {
"type": "number"
},
"aggregateID": {
"type": "string"
},
"data": {
"type": "object",
"additionalProperties": {
"type": "object"
}
"properties": {
"timestamp": {
"type": "number"
},
"sessionID": {
"type": "string",
"pattern": "^ses"
},
"reasoningID": {
"type": "string"
},
"providerMetadata": {
"type": "object",
"additionalProperties": {
"type": "object"
}
}
},
"required": ["timestamp", "sessionID", "reasoningID"],
"additionalProperties": false
}
},
"required": ["timestamp", "sessionID", "reasoningID"],
"required": ["type", "id", "seq", "aggregateID", "data"],
"additionalProperties": false
}
},
"required": ["type", "name", "id", "seq", "aggregateID", "data"],
"required": ["type", "id", "syncEvent"],
"additionalProperties": false
},
"SyncEventSessionNextReasoningEnded": {
@@ -21237,48 +21796,57 @@
"type": "string",
"enum": ["sync"]
},
"name": {
"type": "string",
"enum": ["session.next.reasoning.ended.1"]
},
"id": {
"type": "string"
},
"seq": {
"type": "number"
},
"aggregateID": {
"type": "string",
"enum": ["sessionID"]
},
"data": {
"syncEvent": {
"type": "object",
"properties": {
"timestamp": {
"type": {
"type": "string",
"enum": ["session.next.reasoning.ended.1"]
},
"id": {
"type": "string"
},
"seq": {
"type": "number"
},
"sessionID": {
"type": "string",
"pattern": "^ses"
},
"reasoningID": {
"aggregateID": {
"type": "string"
},
"text": {
"type": "string"
},
"providerMetadata": {
"data": {
"type": "object",
"additionalProperties": {
"type": "object"
}
"properties": {
"timestamp": {
"type": "number"
},
"sessionID": {
"type": "string",
"pattern": "^ses"
},
"reasoningID": {
"type": "string"
},
"text": {
"type": "string"
},
"providerMetadata": {
"type": "object",
"additionalProperties": {
"type": "object"
}
}
},
"required": ["timestamp", "sessionID", "reasoningID", "text"],
"additionalProperties": false
}
},
"required": ["timestamp", "sessionID", "reasoningID", "text"],
"required": ["type", "id", "seq", "aggregateID", "data"],
"additionalProperties": false
}
},
"required": ["type", "name", "id", "seq", "aggregateID", "data"],
"required": ["type", "id", "syncEvent"],
"additionalProperties": false
},
"SyncEventSessionNextToolInputStarted": {
@@ -21288,45 +21856,54 @@
"type": "string",
"enum": ["sync"]
},
"name": {
"type": "string",
"enum": ["session.next.tool.input.started.1"]
},
"id": {
"type": "string"
},
"seq": {
"type": "number"
},
"aggregateID": {
"type": "string",
"enum": ["sessionID"]
},
"data": {
"syncEvent": {
"type": "object",
"properties": {
"timestamp": {
"type": {
"type": "string",
"enum": ["session.next.tool.input.started.1"]
},
"id": {
"type": "string"
},
"seq": {
"type": "number"
},
"sessionID": {
"type": "string",
"pattern": "^ses"
},
"assistantMessageID": {
"aggregateID": {
"type": "string"
},
"callID": {
"type": "string"
},
"name": {
"type": "string"
"data": {
"type": "object",
"properties": {
"timestamp": {
"type": "number"
},
"sessionID": {
"type": "string",
"pattern": "^ses"
},
"assistantMessageID": {
"type": "string"
},
"callID": {
"type": "string"
},
"name": {
"type": "string"
}
},
"required": ["timestamp", "sessionID", "assistantMessageID", "callID", "name"],
"additionalProperties": false
}
},
"required": ["timestamp", "sessionID", "assistantMessageID", "callID", "name"],
"required": ["type", "id", "seq", "aggregateID", "data"],
"additionalProperties": false
}
},
"required": ["type", "name", "id", "seq", "aggregateID", "data"],
"required": ["type", "id", "syncEvent"],
"additionalProperties": false
},
"SyncEventSessionNextToolInputEnded": {
@@ -21336,45 +21913,54 @@
"type": "string",
"enum": ["sync"]
},
"name": {
"type": "string",
"enum": ["session.next.tool.input.ended.1"]
},
"id": {
"type": "string"
},
"seq": {
"type": "number"
},
"aggregateID": {
"type": "string",
"enum": ["sessionID"]
},
"data": {
"syncEvent": {
"type": "object",
"properties": {
"timestamp": {
"type": {
"type": "string",
"enum": ["session.next.tool.input.ended.1"]
},
"id": {
"type": "string"
},
"seq": {
"type": "number"
},
"sessionID": {
"type": "string",
"pattern": "^ses"
},
"assistantMessageID": {
"aggregateID": {
"type": "string"
},
"callID": {
"type": "string"
},
"text": {
"type": "string"
"data": {
"type": "object",
"properties": {
"timestamp": {
"type": "number"
},
"sessionID": {
"type": "string",
"pattern": "^ses"
},
"assistantMessageID": {
"type": "string"
},
"callID": {
"type": "string"
},
"text": {
"type": "string"
}
},
"required": ["timestamp", "sessionID", "assistantMessageID", "callID", "text"],
"additionalProperties": false
}
},
"required": ["timestamp", "sessionID", "assistantMessageID", "callID", "text"],
"required": ["type", "id", "seq", "aggregateID", "data"],
"additionalProperties": false
}
},
"required": ["type", "name", "id", "seq", "aggregateID", "data"],
"required": ["type", "id", "syncEvent"],
"additionalProperties": false
},
"SyncEventSessionNextToolCalled": {
@@ -21384,64 +21970,73 @@
"type": "string",
"enum": ["sync"]
},
"name": {
"type": "string",
"enum": ["session.next.tool.called.1"]
},
"id": {
"type": "string"
},
"seq": {
"type": "number"
},
"aggregateID": {
"type": "string",
"enum": ["sessionID"]
},
"data": {
"syncEvent": {
"type": "object",
"properties": {
"timestamp": {
"type": {
"type": "string",
"enum": ["session.next.tool.called.1"]
},
"id": {
"type": "string"
},
"seq": {
"type": "number"
},
"sessionID": {
"type": "string",
"pattern": "^ses"
},
"assistantMessageID": {
"aggregateID": {
"type": "string"
},
"callID": {
"type": "string"
},
"tool": {
"type": "string"
},
"input": {
"type": "object"
},
"provider": {
"data": {
"type": "object",
"properties": {
"executed": {
"type": "boolean"
"timestamp": {
"type": "number"
},
"metadata": {
"sessionID": {
"type": "string",
"pattern": "^ses"
},
"assistantMessageID": {
"type": "string"
},
"callID": {
"type": "string"
},
"tool": {
"type": "string"
},
"input": {
"type": "object"
},
"provider": {
"type": "object",
"additionalProperties": {
"type": "object"
}
"properties": {
"executed": {
"type": "boolean"
},
"metadata": {
"type": "object",
"additionalProperties": {
"type": "object"
}
}
},
"required": ["executed"],
"additionalProperties": false
}
},
"required": ["executed"],
"required": ["timestamp", "sessionID", "assistantMessageID", "callID", "tool", "input", "provider"],
"additionalProperties": false
}
},
"required": ["timestamp", "sessionID", "assistantMessageID", "callID", "tool", "input", "provider"],
"required": ["type", "id", "seq", "aggregateID", "data"],
"additionalProperties": false
}
},
"required": ["type", "name", "id", "seq", "aggregateID", "data"],
"required": ["type", "id", "syncEvent"],
"additionalProperties": false
},
"SyncEventSessionNextToolProgress": {
@@ -21451,58 +22046,67 @@
"type": "string",
"enum": ["sync"]
},
"name": {
"type": "string",
"enum": ["session.next.tool.progress.1"]
},
"id": {
"type": "string"
},
"seq": {
"type": "number"
},
"aggregateID": {
"type": "string",
"enum": ["sessionID"]
},
"data": {
"syncEvent": {
"type": "object",
"properties": {
"timestamp": {
"type": {
"type": "string",
"enum": ["session.next.tool.progress.1"]
},
"id": {
"type": "string"
},
"seq": {
"type": "number"
},
"sessionID": {
"type": "string",
"pattern": "^ses"
},
"assistantMessageID": {
"aggregateID": {
"type": "string"
},
"callID": {
"type": "string"
},
"structured": {
"type": "object"
},
"content": {
"type": "array",
"items": {
"anyOf": [
{
"$ref": "#/components/schemas/ToolTextContent"
},
{
"$ref": "#/components/schemas/ToolFileContent"
"data": {
"type": "object",
"properties": {
"timestamp": {
"type": "number"
},
"sessionID": {
"type": "string",
"pattern": "^ses"
},
"assistantMessageID": {
"type": "string"
},
"callID": {
"type": "string"
},
"structured": {
"type": "object"
},
"content": {
"type": "array",
"items": {
"anyOf": [
{
"$ref": "#/components/schemas/ToolTextContent"
},
{
"$ref": "#/components/schemas/ToolFileContent"
}
]
}
]
}
}
},
"required": ["timestamp", "sessionID", "assistantMessageID", "callID", "structured", "content"],
"additionalProperties": false
}
},
"required": ["timestamp", "sessionID", "assistantMessageID", "callID", "structured", "content"],
"required": ["type", "id", "seq", "aggregateID", "data"],
"additionalProperties": false
}
},
"required": ["type", "name", "id", "seq", "aggregateID", "data"],
"required": ["type", "id", "syncEvent"],
"additionalProperties": false
},
"SyncEventSessionNextToolSuccess": {
@@ -21512,75 +22116,92 @@
"type": "string",
"enum": ["sync"]
},
"name": {
"type": "string",
"enum": ["session.next.tool.success.1"]
},
"id": {
"type": "string"
},
"seq": {
"type": "number"
},
"aggregateID": {
"type": "string",
"enum": ["sessionID"]
},
"data": {
"syncEvent": {
"type": "object",
"properties": {
"timestamp": {
"type": {
"type": "string",
"enum": ["session.next.tool.success.1"]
},
"id": {
"type": "string"
},
"seq": {
"type": "number"
},
"sessionID": {
"type": "string",
"pattern": "^ses"
},
"assistantMessageID": {
"aggregateID": {
"type": "string"
},
"callID": {
"type": "string"
},
"structured": {
"type": "object"
},
"content": {
"type": "array",
"items": {
"anyOf": [
{
"$ref": "#/components/schemas/ToolTextContent"
},
{
"$ref": "#/components/schemas/ToolFileContent"
}
]
}
},
"result": {},
"provider": {
"data": {
"type": "object",
"properties": {
"executed": {
"type": "boolean"
"timestamp": {
"type": "number"
},
"metadata": {
"type": "object",
"additionalProperties": {
"type": "object"
"sessionID": {
"type": "string",
"pattern": "^ses"
},
"assistantMessageID": {
"type": "string"
},
"callID": {
"type": "string"
},
"structured": {
"type": "object"
},
"content": {
"type": "array",
"items": {
"anyOf": [
{
"$ref": "#/components/schemas/ToolTextContent"
},
{
"$ref": "#/components/schemas/ToolFileContent"
}
]
}
},
"result": {},
"provider": {
"type": "object",
"properties": {
"executed": {
"type": "boolean"
},
"metadata": {
"type": "object",
"additionalProperties": {
"type": "object"
}
}
},
"required": ["executed"],
"additionalProperties": false
}
},
"required": ["executed"],
"required": [
"timestamp",
"sessionID",
"assistantMessageID",
"callID",
"structured",
"content",
"provider"
],
"additionalProperties": false
}
},
"required": ["timestamp", "sessionID", "assistantMessageID", "callID", "structured", "content", "provider"],
"required": ["type", "id", "seq", "aggregateID", "data"],
"additionalProperties": false
}
},
"required": ["type", "name", "id", "seq", "aggregateID", "data"],
"required": ["type", "id", "syncEvent"],
"additionalProperties": false
},
"SyncEventSessionNextToolFailed": {
@@ -21590,62 +22211,71 @@
"type": "string",
"enum": ["sync"]
},
"name": {
"type": "string",
"enum": ["session.next.tool.failed.1"]
},
"id": {
"type": "string"
},
"seq": {
"type": "number"
},
"aggregateID": {
"type": "string",
"enum": ["sessionID"]
},
"data": {
"syncEvent": {
"type": "object",
"properties": {
"timestamp": {
"type": {
"type": "string",
"enum": ["session.next.tool.failed.1"]
},
"id": {
"type": "string"
},
"seq": {
"type": "number"
},
"sessionID": {
"type": "string",
"pattern": "^ses"
},
"assistantMessageID": {
"aggregateID": {
"type": "string"
},
"callID": {
"type": "string"
},
"error": {
"$ref": "#/components/schemas/SessionErrorUnknown"
},
"result": {},
"provider": {
"data": {
"type": "object",
"properties": {
"executed": {
"type": "boolean"
"timestamp": {
"type": "number"
},
"metadata": {
"sessionID": {
"type": "string",
"pattern": "^ses"
},
"assistantMessageID": {
"type": "string"
},
"callID": {
"type": "string"
},
"error": {
"$ref": "#/components/schemas/SessionErrorUnknown"
},
"result": {},
"provider": {
"type": "object",
"additionalProperties": {
"type": "object"
}
"properties": {
"executed": {
"type": "boolean"
},
"metadata": {
"type": "object",
"additionalProperties": {
"type": "object"
}
}
},
"required": ["executed"],
"additionalProperties": false
}
},
"required": ["executed"],
"required": ["timestamp", "sessionID", "assistantMessageID", "callID", "error", "provider"],
"additionalProperties": false
}
},
"required": ["timestamp", "sessionID", "assistantMessageID", "callID", "error", "provider"],
"required": ["type", "id", "seq", "aggregateID", "data"],
"additionalProperties": false
}
},
"required": ["type", "name", "id", "seq", "aggregateID", "data"],
"required": ["type", "id", "syncEvent"],
"additionalProperties": false
},
"SyncEventSessionNextRetried": {
@@ -21655,42 +22285,51 @@
"type": "string",
"enum": ["sync"]
},
"name": {
"type": "string",
"enum": ["session.next.retried.1"]
},
"id": {
"type": "string"
},
"seq": {
"type": "number"
},
"aggregateID": {
"type": "string",
"enum": ["sessionID"]
},
"data": {
"syncEvent": {
"type": "object",
"properties": {
"timestamp": {
"type": "number"
},
"sessionID": {
"type": {
"type": "string",
"pattern": "^ses"
"enum": ["session.next.retried.1"]
},
"attempt": {
"id": {
"type": "string"
},
"seq": {
"type": "number"
},
"error": {
"$ref": "#/components/schemas/SessionNextRetry_error"
"aggregateID": {
"type": "string"
},
"data": {
"type": "object",
"properties": {
"timestamp": {
"type": "number"
},
"sessionID": {
"type": "string",
"pattern": "^ses"
},
"attempt": {
"type": "number"
},
"error": {
"$ref": "#/components/schemas/SessionNextRetry_error"
}
},
"required": ["timestamp", "sessionID", "attempt", "error"],
"additionalProperties": false
}
},
"required": ["timestamp", "sessionID", "attempt", "error"],
"required": ["type", "id", "seq", "aggregateID", "data"],
"additionalProperties": false
}
},
"required": ["type", "name", "id", "seq", "aggregateID", "data"],
"required": ["type", "id", "syncEvent"],
"additionalProperties": false
},
"SyncEventSessionNextCompactionStarted": {
@@ -21700,40 +22339,49 @@
"type": "string",
"enum": ["sync"]
},
"name": {
"type": "string",
"enum": ["session.next.compaction.started.1"]
},
"id": {
"type": "string"
},
"seq": {
"type": "number"
},
"aggregateID": {
"type": "string",
"enum": ["sessionID"]
},
"data": {
"syncEvent": {
"type": "object",
"properties": {
"timestamp": {
"type": {
"type": "string",
"enum": ["session.next.compaction.started.1"]
},
"id": {
"type": "string"
},
"seq": {
"type": "number"
},
"sessionID": {
"type": "string",
"pattern": "^ses"
"aggregateID": {
"type": "string"
},
"reason": {
"type": "string",
"enum": ["auto", "manual"]
"data": {
"type": "object",
"properties": {
"timestamp": {
"type": "number"
},
"sessionID": {
"type": "string",
"pattern": "^ses"
},
"reason": {
"type": "string",
"enum": ["auto", "manual"]
}
},
"required": ["timestamp", "sessionID", "reason"],
"additionalProperties": false
}
},
"required": ["timestamp", "sessionID", "reason"],
"required": ["type", "id", "seq", "aggregateID", "data"],
"additionalProperties": false
}
},
"required": ["type", "name", "id", "seq", "aggregateID", "data"],
"required": ["type", "id", "syncEvent"],
"additionalProperties": false
},
"SyncEventSessionNextCompactionDelta": {
@@ -21743,39 +22391,48 @@
"type": "string",
"enum": ["sync"]
},
"name": {
"type": "string",
"enum": ["session.next.compaction.delta.1"]
},
"id": {
"type": "string"
},
"seq": {
"type": "number"
},
"aggregateID": {
"type": "string",
"enum": ["sessionID"]
},
"data": {
"syncEvent": {
"type": "object",
"properties": {
"timestamp": {
"type": {
"type": "string",
"enum": ["session.next.compaction.delta.1"]
},
"id": {
"type": "string"
},
"seq": {
"type": "number"
},
"sessionID": {
"type": "string",
"pattern": "^ses"
},
"text": {
"aggregateID": {
"type": "string"
},
"data": {
"type": "object",
"properties": {
"timestamp": {
"type": "number"
},
"sessionID": {
"type": "string",
"pattern": "^ses"
},
"text": {
"type": "string"
}
},
"required": ["timestamp", "sessionID", "text"],
"additionalProperties": false
}
},
"required": ["timestamp", "sessionID", "text"],
"required": ["type", "id", "seq", "aggregateID", "data"],
"additionalProperties": false
}
},
"required": ["type", "name", "id", "seq", "aggregateID", "data"],
"required": ["type", "id", "syncEvent"],
"additionalProperties": false
},
"SyncEventSessionNextCompactionEnded": {
@@ -21785,42 +22442,51 @@
"type": "string",
"enum": ["sync"]
},
"name": {
"type": "string",
"enum": ["session.next.compaction.ended.1"]
},
"id": {
"type": "string"
},
"seq": {
"type": "number"
},
"aggregateID": {
"type": "string",
"enum": ["sessionID"]
},
"data": {
"syncEvent": {
"type": "object",
"properties": {
"timestamp": {
"type": {
"type": "string",
"enum": ["session.next.compaction.ended.1"]
},
"id": {
"type": "string"
},
"seq": {
"type": "number"
},
"sessionID": {
"type": "string",
"pattern": "^ses"
},
"text": {
"aggregateID": {
"type": "string"
},
"include": {
"type": "string"
"data": {
"type": "object",
"properties": {
"timestamp": {
"type": "number"
},
"sessionID": {
"type": "string",
"pattern": "^ses"
},
"text": {
"type": "string"
},
"include": {
"type": "string"
}
},
"required": ["timestamp", "sessionID", "text"],
"additionalProperties": false
}
},
"required": ["timestamp", "sessionID", "text"],
"required": ["type", "id", "seq", "aggregateID", "data"],
"additionalProperties": false
}
},
"required": ["type", "name", "id", "seq", "aggregateID", "data"],
"required": ["type", "id", "syncEvent"],
"additionalProperties": false
},
"PolicyEffect": {
@@ -21860,6 +22526,133 @@
"required": ["directory"],
"additionalProperties": false
},
"LocationInfo": {
"type": "object",
"properties": {
"directory": {
"type": "string"
},
"workspaceID": {
"type": "string",
"pattern": "^wrk"
},
"project": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"directory": {
"type": "string"
}
},
"required": ["id", "directory"],
"additionalProperties": false
}
},
"required": ["directory", "project"],
"additionalProperties": false
},
"PermissionV2Effect": {
"type": "string",
"enum": ["allow", "deny", "ask"]
},
"PermissionV2Rule": {
"type": "object",
"properties": {
"action": {
"type": "string"
},
"resource": {
"type": "string"
},
"effect": {
"$ref": "#/components/schemas/PermissionV2Effect"
}
},
"required": ["action", "resource", "effect"],
"additionalProperties": false
},
"PermissionV2Ruleset": {
"type": "array",
"items": {
"$ref": "#/components/schemas/PermissionV2Rule"
}
},
"AgentV2Info": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"model": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"providerID": {
"type": "string"
},
"variant": {
"type": "string"
}
},
"required": ["id", "providerID"],
"additionalProperties": false
},
"request": {
"type": "object",
"properties": {
"headers": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"body": {
"type": "object"
}
},
"required": ["headers", "body"],
"additionalProperties": false
},
"system": {
"type": "string"
},
"description": {
"type": "string"
},
"mode": {
"type": "string",
"enum": ["subagent", "primary", "all"]
},
"hidden": {
"type": "boolean"
},
"color": {
"anyOf": [
{
"type": "string",
"pattern": "^#[0-9a-fA-F]{6}$"
},
{
"type": "string",
"enum": ["primary", "secondary", "accent", "success", "warning", "error", "info"]
}
]
},
"steps": {
"type": "integer",
"exclusiveMinimum": 0
},
"permissions": {
"$ref": "#/components/schemas/PermissionV2Ruleset"
}
},
"required": ["id", "request", "mode", "hidden", "permissions"],
"additionalProperties": false
},
"LocationRef": {
"type": "object",
"properties": {
@@ -22568,210 +23361,7 @@
}
]
},
"ModelV2PublicInfo": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"providerID": {
"type": "string"
},
"family": {
"type": "string"
},
"name": {
"type": "string"
},
"api": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string"
},
"type": {
"type": "string",
"enum": ["aisdk"]
},
"package": {
"type": "string"
},
"url": {
"type": "string"
}
},
"required": ["id", "type", "package"],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"id": {
"type": "string"
},
"type": {
"type": "string",
"enum": ["native"]
},
"url": {
"type": "string"
}
},
"required": ["id", "type"],
"additionalProperties": false
}
]
},
"capabilities": {
"type": "object",
"properties": {
"tools": {
"type": "boolean"
},
"input": {
"type": "array",
"items": {
"type": "string"
}
},
"output": {
"type": "array",
"items": {
"type": "string"
}
}
},
"required": ["tools", "input", "output"],
"additionalProperties": false
},
"variants": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
}
},
"required": ["id"],
"additionalProperties": false
}
},
"time": {
"type": "object",
"properties": {
"released": {
"anyOf": [
{
"type": "number"
},
{
"type": "string",
"enum": ["NaN"]
},
{
"type": "string",
"enum": ["Infinity"]
},
{
"type": "string",
"enum": ["-Infinity"]
},
{
"type": "string",
"enum": ["Infinity", "-Infinity", "NaN"]
}
]
}
},
"required": ["released"],
"additionalProperties": false
},
"cost": {
"type": "array",
"items": {
"type": "object",
"properties": {
"tier": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": ["context"]
},
"size": {
"type": "integer"
}
},
"required": ["type", "size"],
"additionalProperties": false
},
"input": {
"type": "number"
},
"output": {
"type": "number"
},
"cache": {
"type": "object",
"properties": {
"read": {
"type": "number"
},
"write": {
"type": "number"
}
},
"required": ["read", "write"],
"additionalProperties": false
}
},
"required": ["input", "output", "cache"],
"additionalProperties": false
}
},
"status": {
"type": "string",
"enum": ["alpha", "beta", "deprecated", "active"]
},
"enabled": {
"type": "boolean"
},
"limit": {
"type": "object",
"properties": {
"context": {
"type": "integer"
},
"input": {
"type": "integer"
},
"output": {
"type": "integer"
}
},
"required": ["context", "output"],
"additionalProperties": false
}
},
"required": [
"id",
"providerID",
"name",
"api",
"capabilities",
"variants",
"time",
"cost",
"status",
"enabled",
"limit"
],
"additionalProperties": false
},
"ProviderV2PublicInfo": {
"ProviderV2Info": {
"type": "object",
"properties": {
"id": {
@@ -22820,9 +23410,12 @@
"via": {
"type": "string",
"enum": ["custom"]
},
"data": {
"type": "object"
}
},
"required": ["via"],
"required": ["via", "data"],
"additionalProperties": false
}
]
@@ -22847,6 +23440,9 @@
},
"url": {
"type": "string"
},
"settings": {
"type": "object"
}
},
"required": ["type", "package"],
@@ -22861,15 +23457,34 @@
},
"url": {
"type": "string"
},
"settings": {
"type": "object"
}
},
"required": ["type"],
"required": ["type", "settings"],
"additionalProperties": false
}
]
},
"request": {
"type": "object",
"properties": {
"headers": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"body": {
"type": "object"
}
},
"required": ["headers", "body"],
"additionalProperties": false
}
},
"required": ["id", "name", "enabled", "env", "api"],
"required": ["id", "name", "enabled", "env", "api", "request"],
"additionalProperties": false
},
"PermissionV2Request": {
@@ -22985,6 +23600,66 @@
"required": ["path", "uri", "type", "mime"],
"additionalProperties": false
},
"CommandV2Info": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"template": {
"type": "string"
},
"description": {
"type": "string"
},
"agent": {
"type": "string"
},
"model": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"providerID": {
"type": "string"
},
"variant": {
"type": "string"
}
},
"required": ["id", "providerID"],
"additionalProperties": false
},
"subtask": {
"type": "boolean"
}
},
"required": ["name", "template"],
"additionalProperties": false
},
"SkillV2Info": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"description": {
"type": "string"
},
"slash": {
"type": "boolean"
},
"location": {
"type": "string"
},
"content": {
"type": "string"
}
},
"required": ["name", "location", "content"],
"additionalProperties": false
},
"QuestionV2Request": {
"type": "object",
"properties": {
@@ -25949,6 +26624,22 @@
"name": "sync",
"description": "Experimental HttpApi sync routes."
},
{
"name": "tui",
"description": "Experimental HttpApi TUI routes."
},
{
"name": "workspace",
"description": "Experimental HttpApi workspace routes."
},
{
"name": "opencode experimental HttpApi",
"description": "Experimental HttpApi surface for selected instance routes."
},
{
"name": "opencode experimental HttpApi",
"description": "Experimental HttpApi surface for selected instance routes."
},
{
"name": "v2",
"description": "Experimental v2 routes."
@@ -25981,6 +26672,18 @@
"name": "v2 filesystem",
"description": "Experimental v2 location-scoped filesystem routes."
},
{
"name": "v2 commands",
"description": "Experimental v2 command routes."
},
{
"name": "v2 skills",
"description": "Experimental v2 skill routes."
},
{
"name": "v2 events",
"description": "Experimental v2 event stream route."
},
{
"name": "v2 questions",
"description": "Experimental v2 question routes."
@@ -25989,14 +26692,6 @@
"name": "v2 session questions",
"description": "Experimental v2 session question routes."
},
{
"name": "tui",
"description": "Experimental HttpApi TUI routes."
},
{
"name": "workspace",
"description": "Experimental HttpApi workspace routes."
},
{
"name": "pty",
"description": "PTY websocket route."
+8 -6
View File
@@ -34,13 +34,15 @@ export const eventHandlers = HttpApiBuilder.group(V2Api, "v2.event", (handlers)
return HttpServerResponse.stream(
Stream.make(connected).pipe(
Stream.concat(
events.all().pipe(
Stream.filter(
(event) =>
event.location?.directory === location.directory &&
event.location.workspaceID === location.workspaceID,
events
.all()
.pipe(
Stream.filter(
(event) =>
event.location?.directory === location.directory &&
event.location.workspaceID === location.workspaceID,
),
),
),
),
Stream.map(eventData),
Stream.pipeThroughChannel(Sse.encode()),
+16 -15
View File
@@ -14,23 +14,24 @@ import { schemaErrorLayer } from "./middleware/schema-error"
export function createRoutes(password?: string) {
return HttpApiBuilder.layer(V2Api).pipe(
Layer.provide(v2Handlers),
Layer.provide(v2AuthorizationLayer),
Layer.provide(schemaErrorLayer),
Layer.provide(
password
? ServerAuth.Config.layer({ username: "opencode", password: Option.some(password) })
: ServerAuth.Config.defaultLayer,
),
Layer.provide(LocationServiceMap.layer),
Layer.provide(PermissionSaved.layer),
Layer.provide(SessionV2.defaultLayer),
Layer.provide(Database.defaultLayer),
Layer.provide(EventV2.defaultLayer),
Layer.provide(FetchHttpClient.layer),
Layer.provide(v2Handlers),
Layer.provide(v2AuthorizationLayer),
Layer.provide(schemaErrorLayer),
Layer.provide(
password
? ServerAuth.Config.layer({ username: "opencode", password: Option.some(password) })
: ServerAuth.Config.defaultLayer,
),
Layer.provide(LocationServiceMap.layer),
Layer.provide(PermissionSaved.layer),
Layer.provide(SessionV2.defaultLayer),
Layer.provide(Database.defaultLayer),
Layer.provide(EventV2.defaultLayer),
Layer.provide(FetchHttpClient.layer),
)
}
export const routes = createRoutes()
export const webHandler = () => HttpRouter.toWebHandler(routes.pipe(Layer.provide(HttpServer.layerServices)), { disableLogger: true })
export const webHandler = () =>
HttpRouter.toWebHandler(routes.pipe(Layer.provide(HttpServer.layerServices)), { disableLogger: true })