diff --git a/packages/client/script/build.ts b/packages/client/script/build.ts index 70f1dcc587..8e432b0a17 100644 --- a/packages/client/script/build.ts +++ b/packages/client/script/build.ts @@ -17,12 +17,7 @@ await Effect.runPromise( [ write( emitPromise(promiseContract, { - outputTypes: { - "events.subscribe": { - name: "OpenCodeEventEncoded", - import: 'import type { OpenCodeEventEncoded } from "@opencode-ai/protocol/groups/event"', - }, - }, + mutableOutputs: true, }), fileURLToPath(new URL("../src/promise/generated", import.meta.url)), ), diff --git a/packages/client/src/promise/generated/types.ts b/packages/client/src/promise/generated/types.ts index c61fdb5eea..0ae6093ba6 100644 --- a/packages/client/src/promise/generated/types.ts +++ b/packages/client/src/promise/generated/types.ts @@ -1,12 +1,4 @@ -import type { OpenCodeEventEncoded } from "@opencode-ai/protocol/groups/event" - -export type JsonValue = - | null - | boolean - | number - | string - | ReadonlyArray - | { readonly [key: string]: JsonValue } +export type JsonValue = null | boolean | number | string | Array | { [key: string]: JsonValue } export type UnauthorizedError = { readonly _tag: "UnauthorizedError"; readonly message: string } export const isUnauthorizedError = (value: unknown): value is UnauthorizedError => @@ -157,9 +149,9 @@ export type ProjectCopyError = { export const isProjectCopyError = (value: unknown): value is ProjectCopyError => typeof value === "object" && value !== null && "name" in value && value["name"] === "ProjectCopyError" -export type HealthGetOutput = { readonly healthy: true; readonly version: string; readonly pid: number } +export type HealthGetOutput = { healthy: true; version: string; pid: number } -export type ServerGetOutput = { readonly urls: ReadonlyArray } +export type ServerGetOutput = { urls: Array } export type LocationGetInput = { readonly location?: { @@ -167,11 +159,7 @@ export type LocationGetInput = { }["location"] } -export type LocationGetOutput = { - readonly directory: string - readonly workspaceID?: string - readonly project: { readonly id: string; readonly directory: string } -} +export type LocationGetOutput = { directory: string; workspaceID?: string; project: { id: string; directory: string } } export type AgentListInput = { readonly location?: { @@ -180,31 +168,23 @@ export type AgentListInput = { } export type AgentListOutput = { - readonly location: { - readonly directory: string - readonly workspaceID?: string - readonly project: { readonly id: string; readonly directory: string } - } - readonly data: ReadonlyArray<{ - readonly id: string - readonly name: string - readonly model?: { readonly id: string; readonly providerID: string; readonly variant?: string } - readonly request: { - readonly settings: { readonly [x: string]: JsonValue } - readonly headers: { readonly [x: string]: string } - readonly body: { readonly [x: string]: JsonValue } + location: { directory: string; workspaceID?: string; project: { id: string; directory: string } } + data: Array<{ + id: string + name: string + model?: { id: string; providerID: string; variant?: string } + request: { + settings: { [x: string]: JsonValue } + headers: { [x: string]: string } + body: { [x: string]: JsonValue } } - readonly system?: string - readonly description?: string - readonly mode: "subagent" | "primary" | "all" - readonly hidden: boolean - readonly color?: string | "primary" | "secondary" | "accent" | "success" | "warning" | "error" | "info" - readonly steps?: number - readonly permissions: ReadonlyArray<{ - readonly action: string - readonly resource: string - readonly effect: "allow" | "deny" | "ask" - }> + system?: string + description?: string + mode: "subagent" | "primary" | "all" + hidden: boolean + color?: string | "primary" | "secondary" | "accent" | "success" | "warning" | "error" | "info" + steps?: number + permissions: Array<{ action: string; resource: string; effect: "allow" | "deny" | "ask" }> }> } @@ -215,12 +195,8 @@ export type PluginListInput = { } export type PluginListOutput = { - readonly location: { - readonly directory: string - readonly workspaceID?: string - readonly project: { readonly id: string; readonly directory: string } - } - readonly data: ReadonlyArray<{ readonly id: string }> + location: { directory: string; workspaceID?: string; project: { id: string; directory: string } } + data: Array<{ id: string }> } export type SessionListInput = { @@ -326,38 +302,33 @@ export type SessionListInput = { } export type SessionListOutput = { - readonly data: ReadonlyArray<{ - readonly id: string - readonly parentID?: string - readonly fork?: { readonly sessionID: string; readonly messageID?: string } - readonly projectID: string - readonly agent?: string - readonly model?: { readonly id: string; readonly providerID: string; readonly variant?: string } - readonly cost: number - readonly tokens: { - readonly input: number - readonly output: number - readonly reasoning: number - readonly cache: { readonly read: number; readonly write: number } - } - readonly time: { readonly created: number; readonly updated: number; readonly archived?: number } - readonly title: string - readonly location: { readonly directory: string; readonly workspaceID?: string } - readonly subpath?: string - readonly revert?: { - readonly messageID: string - readonly partID?: string - readonly snapshot?: string - readonly files?: ReadonlyArray<{ - readonly file: string - readonly patch: string - readonly additions: number - readonly deletions: number - readonly status: "added" | "deleted" | "modified" + data: Array<{ + id: string + parentID?: string + fork?: { sessionID: string; messageID?: string } + projectID: string + agent?: string + model?: { id: string; providerID: string; variant?: string } + cost: number + tokens: { input: number; output: number; reasoning: number; cache: { read: number; write: number } } + time: { created: number; updated: number; archived?: number } + title: string + location: { directory: string; workspaceID?: string } + subpath?: string + revert?: { + messageID: string + partID?: string + snapshot?: string + files?: Array<{ + file: string + patch: string + additions: number + deletions: number + status: "added" | "deleted" | "modified" }> } }> - readonly cursor: { readonly previous?: string | null; readonly next?: string | null } + cursor: { previous?: string | null; next?: string | null } } export type SessionCreateInput = { @@ -388,72 +359,62 @@ export type SessionCreateInput = { } export type SessionCreateOutput = { - readonly data: { - readonly id: string - readonly parentID?: string - readonly fork?: { readonly sessionID: string; readonly messageID?: string } - readonly projectID: string - readonly agent?: string - readonly model?: { readonly id: string; readonly providerID: string; readonly variant?: string } - readonly cost: number - readonly tokens: { - readonly input: number - readonly output: number - readonly reasoning: number - readonly cache: { readonly read: number; readonly write: number } - } - readonly time: { readonly created: number; readonly updated: number; readonly archived?: number } - readonly title: string - readonly location: { readonly directory: string; readonly workspaceID?: string } - readonly subpath?: string - readonly revert?: { - readonly messageID: string - readonly partID?: string - readonly snapshot?: string - readonly files?: ReadonlyArray<{ - readonly file: string - readonly patch: string - readonly additions: number - readonly deletions: number - readonly status: "added" | "deleted" | "modified" + data: { + id: string + parentID?: string + fork?: { sessionID: string; messageID?: string } + projectID: string + agent?: string + model?: { id: string; providerID: string; variant?: string } + cost: number + tokens: { input: number; output: number; reasoning: number; cache: { read: number; write: number } } + time: { created: number; updated: number; archived?: number } + title: string + location: { directory: string; workspaceID?: string } + subpath?: string + revert?: { + messageID: string + partID?: string + snapshot?: string + files?: Array<{ + file: string + patch: string + additions: number + deletions: number + status: "added" | "deleted" | "modified" }> } } }["data"] -export type SessionActiveOutput = { readonly data: { readonly [x: string]: { readonly type: "running" } } }["data"] +export type SessionActiveOutput = { data: { [x: string]: { type: "running" } } }["data"] export type SessionGetInput = { readonly sessionID: { readonly sessionID: string }["sessionID"] } export type SessionGetOutput = { - readonly data: { - readonly id: string - readonly parentID?: string - readonly fork?: { readonly sessionID: string; readonly messageID?: string } - readonly projectID: string - readonly agent?: string - readonly model?: { readonly id: string; readonly providerID: string; readonly variant?: string } - readonly cost: number - readonly tokens: { - readonly input: number - readonly output: number - readonly reasoning: number - readonly cache: { readonly read: number; readonly write: number } - } - readonly time: { readonly created: number; readonly updated: number; readonly archived?: number } - readonly title: string - readonly location: { readonly directory: string; readonly workspaceID?: string } - readonly subpath?: string - readonly revert?: { - readonly messageID: string - readonly partID?: string - readonly snapshot?: string - readonly files?: ReadonlyArray<{ - readonly file: string - readonly patch: string - readonly additions: number - readonly deletions: number - readonly status: "added" | "deleted" | "modified" + data: { + id: string + parentID?: string + fork?: { sessionID: string; messageID?: string } + projectID: string + agent?: string + model?: { id: string; providerID: string; variant?: string } + cost: number + tokens: { input: number; output: number; reasoning: number; cache: { read: number; write: number } } + time: { created: number; updated: number; archived?: number } + title: string + location: { directory: string; workspaceID?: string } + subpath?: string + revert?: { + messageID: string + partID?: string + snapshot?: string + files?: Array<{ + file: string + patch: string + additions: number + deletions: number + status: "added" | "deleted" | "modified" }> } } @@ -469,34 +430,29 @@ export type SessionForkInput = { } export type SessionForkOutput = { - readonly data: { - readonly id: string - readonly parentID?: string - readonly fork?: { readonly sessionID: string; readonly messageID?: string } - readonly projectID: string - readonly agent?: string - readonly model?: { readonly id: string; readonly providerID: string; readonly variant?: string } - readonly cost: number - readonly tokens: { - readonly input: number - readonly output: number - readonly reasoning: number - readonly cache: { readonly read: number; readonly write: number } - } - readonly time: { readonly created: number; readonly updated: number; readonly archived?: number } - readonly title: string - readonly location: { readonly directory: string; readonly workspaceID?: string } - readonly subpath?: string - readonly revert?: { - readonly messageID: string - readonly partID?: string - readonly snapshot?: string - readonly files?: ReadonlyArray<{ - readonly file: string - readonly patch: string - readonly additions: number - readonly deletions: number - readonly status: "added" | "deleted" | "modified" + data: { + id: string + parentID?: string + fork?: { sessionID: string; messageID?: string } + projectID: string + agent?: string + model?: { id: string; providerID: string; variant?: string } + cost: number + tokens: { input: number; output: number; reasoning: number; cache: { read: number; write: number } } + time: { created: number; updated: number; archived?: number } + title: string + location: { directory: string; workspaceID?: string } + subpath?: string + revert?: { + messageID: string + partID?: string + snapshot?: string + files?: Array<{ + file: string + patch: string + additions: number + deletions: number + status: "added" | "deleted" | "modified" }> } } @@ -663,30 +619,27 @@ export type SessionPromptInput = { } export type SessionPromptOutput = { - readonly data: { - readonly admittedSeq: number - readonly id: string - readonly sessionID: string - readonly timeCreated: number - readonly promotedSeq?: number - readonly type: "user" - readonly data: { - readonly text: string - readonly files?: ReadonlyArray<{ - readonly data: string - readonly mime: string - readonly source: { readonly type: "inline" } | { readonly type: "uri"; readonly uri: string } - readonly name?: string - readonly description?: string - readonly mention?: { readonly start: number; readonly end: number; readonly text: string } + data: { + admittedSeq: number + id: string + sessionID: string + timeCreated: number + promotedSeq?: number + type: "user" + data: { + text: string + files?: Array<{ + data: string + mime: string + source: { type: "inline" } | { type: "uri"; uri: string } + name?: string + description?: string + mention?: { start: number; end: number; text: string } }> - readonly agents?: ReadonlyArray<{ - readonly name: string - readonly mention?: { readonly start: number; readonly end: number; readonly text: string } - }> - readonly metadata?: { readonly [x: string]: JsonValue } + agents?: Array<{ name: string; mention?: { start: number; end: number; text: string } }> + metadata?: { [x: string]: JsonValue } } - readonly delivery: "steer" | "queue" + delivery: "steer" | "queue" } }["data"] @@ -866,30 +819,27 @@ export type SessionCommandInput = { } export type SessionCommandOutput = { - readonly data: { - readonly admittedSeq: number - readonly id: string - readonly sessionID: string - readonly timeCreated: number - readonly promotedSeq?: number - readonly type: "user" - readonly data: { - readonly text: string - readonly files?: ReadonlyArray<{ - readonly data: string - readonly mime: string - readonly source: { readonly type: "inline" } | { readonly type: "uri"; readonly uri: string } - readonly name?: string - readonly description?: string - readonly mention?: { readonly start: number; readonly end: number; readonly text: string } + data: { + admittedSeq: number + id: string + sessionID: string + timeCreated: number + promotedSeq?: number + type: "user" + data: { + text: string + files?: Array<{ + data: string + mime: string + source: { type: "inline" } | { type: "uri"; uri: string } + name?: string + description?: string + mention?: { start: number; end: number; text: string } }> - readonly agents?: ReadonlyArray<{ - readonly name: string - readonly mention?: { readonly start: number; readonly end: number; readonly text: string } - }> - readonly metadata?: { readonly [x: string]: JsonValue } + agents?: Array<{ name: string; mention?: { start: number; end: number; text: string } }> + metadata?: { [x: string]: JsonValue } } - readonly delivery: "steer" | "queue" + delivery: "steer" | "queue" } }["data"] @@ -967,19 +917,15 @@ export type SessionSyntheticInput = { } export type SessionSyntheticOutput = { - readonly data: { - readonly admittedSeq: number - readonly id: string - readonly sessionID: string - readonly timeCreated: number - readonly promotedSeq?: number - readonly type: "synthetic" - readonly data: { - readonly text: string - readonly description?: string - readonly metadata?: { readonly [x: string]: JsonValue } - } - readonly delivery: "steer" | "queue" + data: { + admittedSeq: number + id: string + sessionID: string + timeCreated: number + promotedSeq?: number + type: "synthetic" + data: { text: string; description?: string; metadata?: { [x: string]: JsonValue } } + delivery: "steer" | "queue" } }["data"] @@ -997,13 +943,13 @@ export type SessionCompactInput = { } export type SessionCompactOutput = { - readonly data: { - readonly admittedSeq: number - readonly id: string - readonly sessionID: string - readonly timeCreated: number - readonly type: "compaction" - readonly handledSeq?: number + data: { + admittedSeq: number + id: string + sessionID: string + timeCreated: number + type: "compaction" + handledSeq?: number } }["data"] @@ -1018,16 +964,16 @@ export type SessionRevertStageInput = { } export type SessionRevertStageOutput = { - readonly data: { - readonly messageID: string - readonly partID?: string - readonly snapshot?: string - readonly files?: ReadonlyArray<{ - readonly file: string - readonly patch: string - readonly additions: number - readonly deletions: number - readonly status: "added" | "deleted" | "modified" + data: { + messageID: string + partID?: string + snapshot?: string + files?: Array<{ + file: string + patch: string + additions: number + deletions: number + status: "added" | "deleted" | "modified" }> } }["data"] @@ -1043,183 +989,157 @@ export type SessionRevertCommitOutput = void export type SessionContextInput = { readonly sessionID: { readonly sessionID: string }["sessionID"] } export type SessionContextOutput = { - readonly data: ReadonlyArray< + data: Array< | { - readonly id: string - readonly metadata?: { readonly [x: string]: JsonValue } - readonly time: { readonly created: number } - readonly type: "agent-switched" - readonly agent: string + id: string + metadata?: { [x: string]: JsonValue } + time: { created: number } + type: "agent-switched" + agent: string } | { - readonly id: string - readonly metadata?: { readonly [x: string]: JsonValue } - readonly time: { readonly created: number } - readonly type: "model-switched" - readonly model: { readonly id: string; readonly providerID: string; readonly variant?: string } - readonly previous?: { readonly id: string; readonly providerID: string; readonly variant?: string } + id: string + metadata?: { [x: string]: JsonValue } + time: { created: number } + type: "model-switched" + model: { id: string; providerID: string; variant?: string } + previous?: { id: string; providerID: string; variant?: string } } | { - readonly id: string - readonly metadata?: { readonly [x: string]: JsonValue } - readonly time: { readonly created: number } - readonly text: string - readonly files?: ReadonlyArray<{ - readonly data: string - readonly mime: string - readonly source: { readonly type: "inline" } | { readonly type: "uri"; readonly uri: string } - readonly name?: string - readonly description?: string - readonly mention?: { readonly start: number; readonly end: number; readonly text: string } + id: string + metadata?: { [x: string]: JsonValue } + time: { created: number } + text: string + files?: Array<{ + data: string + mime: string + source: { type: "inline" } | { type: "uri"; uri: string } + name?: string + description?: string + mention?: { start: number; end: number; text: string } }> - readonly agents?: ReadonlyArray<{ - readonly name: string - readonly mention?: { readonly start: number; readonly end: number; readonly text: string } - }> - readonly type: "user" + agents?: Array<{ name: string; mention?: { start: number; end: number; text: string } }> + type: "user" } | { - readonly id: string - readonly metadata?: { readonly [x: string]: JsonValue } - readonly time: { readonly created: number } - readonly text: string - readonly description?: string - readonly type: "synthetic" + id: string + metadata?: { [x: string]: JsonValue } + time: { created: number } + text: string + description?: string + type: "synthetic" + } + | { id: string; metadata?: { [x: string]: JsonValue }; time: { created: number }; type: "system"; text: string } + | { + id: string + metadata?: { [x: string]: JsonValue } + time: { created: number } + type: "skill" + skill: string + name: string + text: string } | { - readonly id: string - readonly metadata?: { readonly [x: string]: JsonValue } - readonly time: { readonly created: number } - readonly type: "system" - readonly text: string + id: string + metadata?: { [x: string]: JsonValue } + time: { created: number; completed?: number } + type: "shell" + shellID: string + command: string + status: "running" | "exited" | "timeout" | "killed" + exit?: number | "Infinity" | "-Infinity" | "NaN" + output?: { output: string; cursor: number; size: number; truncated: boolean } } | { - readonly id: string - readonly metadata?: { readonly [x: string]: JsonValue } - readonly time: { readonly created: number } - readonly type: "skill" - readonly skill: string - readonly name: string - readonly text: string - } - | { - readonly id: string - readonly metadata?: { readonly [x: string]: JsonValue } - readonly time: { readonly created: number; readonly completed?: number } - readonly type: "shell" - readonly shellID: string - readonly command: string - readonly status: "running" | "exited" | "timeout" | "killed" - readonly exit?: number | "Infinity" | "-Infinity" | "NaN" - readonly output?: { - readonly output: string - readonly cursor: number - readonly size: number - readonly truncated: boolean - } - } - | { - readonly id: string - readonly metadata?: { readonly [x: string]: JsonValue } - readonly time: { readonly created: number; readonly completed?: number } - readonly type: "assistant" - readonly agent: string - readonly model: { readonly id: string; readonly providerID: string; readonly variant?: string } - readonly content: ReadonlyArray< - | { readonly type: "text"; readonly text: string } + id: string + metadata?: { [x: string]: JsonValue } + time: { created: number; completed?: number } + type: "assistant" + agent: string + model: { id: string; providerID: string; variant?: string } + content: Array< + | { type: "text"; text: string } | { - readonly type: "reasoning" - readonly text: string - readonly state?: { readonly [x: string]: JsonValue } - readonly time?: { readonly created: number; readonly completed?: number } + type: "reasoning" + text: string + state?: { [x: string]: JsonValue } + time?: { created: number; completed?: number } } | { - readonly type: "tool" - readonly id: string - readonly name: string - readonly executed?: boolean - readonly providerState?: { readonly [x: string]: JsonValue } - readonly providerResultState?: { readonly [x: string]: JsonValue } - readonly state: - | { readonly status: "streaming"; readonly input: string } + type: "tool" + id: string + name: string + executed?: boolean + providerState?: { [x: string]: JsonValue } + providerResultState?: { [x: string]: JsonValue } + state: + | { status: "streaming"; input: string } | { - readonly status: "running" - readonly input: { readonly [x: string]: JsonValue } - readonly structured: { readonly [x: string]: JsonValue } - readonly content: ReadonlyArray< - | { readonly type: "text"; readonly text: string } - | { readonly type: "file"; readonly uri: string; readonly mime: string; readonly name?: string } + status: "running" + input: { [x: string]: JsonValue } + structured: { [x: string]: JsonValue } + content: Array< + { type: "text"; text: string } | { type: "file"; uri: string; mime: string; name?: string } > } | { - readonly status: "completed" - readonly input: { readonly [x: string]: JsonValue } - readonly content: ReadonlyArray< - | { readonly type: "text"; readonly text: string } - | { readonly type: "file"; readonly uri: string; readonly mime: string; readonly name?: string } + status: "completed" + input: { [x: string]: JsonValue } + content: Array< + { type: "text"; text: string } | { type: "file"; uri: string; mime: string; name?: string } > - readonly structured: { readonly [x: string]: JsonValue } - readonly result?: JsonValue + structured: { [x: string]: JsonValue } + result?: JsonValue } | { - readonly status: "error" - readonly input: { readonly [x: string]: JsonValue } - readonly content: ReadonlyArray< - | { readonly type: "text"; readonly text: string } - | { readonly type: "file"; readonly uri: string; readonly mime: string; readonly name?: string } + status: "error" + input: { [x: string]: JsonValue } + content: Array< + { type: "text"; text: string } | { type: "file"; uri: string; mime: string; name?: string } > - readonly structured: { readonly [x: string]: JsonValue } - readonly error: { readonly type: string; readonly message: string } - readonly result?: JsonValue + structured: { [x: string]: JsonValue } + error: { type: string; message: string } + result?: JsonValue } - readonly time: { readonly created: number; readonly ran?: number; readonly completed?: number } + time: { created: number; ran?: number; completed?: number } } > - readonly snapshot?: { readonly start?: string; readonly end?: string; readonly files?: ReadonlyArray } - readonly finish?: "stop" | "length" | "tool-calls" | "content-filter" | "error" | "unknown" - readonly cost?: number - readonly tokens?: { - readonly input: number - readonly output: number - readonly reasoning: number - readonly cache: { readonly read: number; readonly write: number } - } - readonly error?: { readonly type: string; readonly message: string } - readonly retry?: { - readonly attempt: number - readonly at: number - readonly error: { readonly type: string; readonly message: string } - } + snapshot?: { start?: string; end?: string; files?: Array } + finish?: "stop" | "length" | "tool-calls" | "content-filter" | "error" | "unknown" + cost?: number + tokens?: { input: number; output: number; reasoning: number; cache: { read: number; write: number } } + error?: { type: string; message: string } + retry?: { attempt: number; at: number; error: { type: string; message: string } } } | ( | { - readonly type: "compaction" - readonly id: string - readonly metadata?: { readonly [x: string]: JsonValue } - readonly time: { readonly created: number } - readonly status: "running" - readonly reason: "auto" | "manual" - readonly summary: string - readonly recent: string + type: "compaction" + id: string + metadata?: { [x: string]: JsonValue } + time: { created: number } + status: "running" + reason: "auto" | "manual" + summary: string + recent: string } | { - readonly type: "compaction" - readonly id: string - readonly metadata?: { readonly [x: string]: JsonValue } - readonly time: { readonly created: number } - readonly status: "completed" - readonly reason: "auto" | "manual" - readonly summary: string - readonly recent: string + type: "compaction" + id: string + metadata?: { [x: string]: JsonValue } + time: { created: number } + status: "completed" + reason: "auto" | "manual" + summary: string + recent: string } | { - readonly type: "compaction" - readonly id: string - readonly metadata?: { readonly [x: string]: JsonValue } - readonly time: { readonly created: number } - readonly status: "failed" - readonly reason: "auto" | "manual" - readonly error: { readonly type: string; readonly message: string } + type: "compaction" + id: string + metadata?: { [x: string]: JsonValue } + time: { created: number } + status: "failed" + reason: "auto" | "manual" + error: { type: string; message: string } } ) > @@ -1227,9 +1147,7 @@ export type SessionContextOutput = { export type SessionInstructionsEntryListInput = { readonly sessionID: { readonly sessionID: string }["sessionID"] } -export type SessionInstructionsEntryListOutput = { - readonly data: ReadonlyArray<{ readonly key: string; readonly value: JsonValue }> -}["data"] +export type SessionInstructionsEntryListOutput = { data: Array<{ key: string; value: JsonValue }> }["data"] export type SessionInstructionsEntryPutInput = { readonly sessionID: { readonly sessionID: string; readonly key: string }["sessionID"] @@ -1255,563 +1173,485 @@ export type SessionLogInput = { export type SessionLogOutput = | ( | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "session.agent.selected" - readonly durable: { readonly aggregateID: string; readonly seq: number; readonly version: 1 } - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { readonly sessionID: string; readonly agent: string } + id: string + created: number + metadata?: { [x: string]: unknown } + type: "session.agent.selected" + durable: { aggregateID: string; seq: number; version: 1 } + location?: { directory: string; workspaceID?: string } + data: { sessionID: string; agent: string } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "session.model.selected" - readonly durable: { readonly aggregateID: string; readonly seq: number; readonly version: 1 } - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { - readonly sessionID: string - readonly model: { readonly id: string; readonly providerID: string; readonly variant?: string } - } + id: string + created: number + metadata?: { [x: string]: unknown } + type: "session.model.selected" + durable: { aggregateID: string; seq: number; version: 1 } + location?: { directory: string; workspaceID?: string } + data: { sessionID: string; model: { id: string; providerID: string; variant?: string } } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "session.moved" - readonly durable: { readonly aggregateID: string; readonly seq: number; readonly version: 1 } - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { - readonly sessionID: string - readonly location: { readonly directory: string; readonly workspaceID?: string } - readonly subpath?: string - } + id: string + created: number + metadata?: { [x: string]: unknown } + type: "session.moved" + durable: { aggregateID: string; seq: number; version: 1 } + location?: { directory: string; workspaceID?: string } + data: { sessionID: string; location: { directory: string; workspaceID?: string }; subpath?: string } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "session.renamed" - readonly durable: { readonly aggregateID: string; readonly seq: number; readonly version: 1 } - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { readonly sessionID: string; readonly title: string } + id: string + created: number + metadata?: { [x: string]: unknown } + type: "session.renamed" + durable: { aggregateID: string; seq: number; version: 1 } + location?: { directory: string; workspaceID?: string } + data: { sessionID: string; title: string } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "session.deleted" - readonly durable: { readonly aggregateID: string; readonly seq: number; readonly version: 2 } - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { readonly sessionID: string } + id: string + created: number + metadata?: { [x: string]: unknown } + type: "session.deleted" + durable: { aggregateID: string; seq: number; version: 2 } + location?: { directory: string; workspaceID?: string } + data: { sessionID: string } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "session.forked" - readonly durable: { readonly aggregateID: string; readonly seq: number; readonly version: 1 } - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { readonly sessionID: string; readonly parentID: string; readonly from?: string } + id: string + created: number + metadata?: { [x: string]: unknown } + type: "session.forked" + durable: { aggregateID: string; seq: number; version: 1 } + location?: { directory: string; workspaceID?: string } + data: { sessionID: string; parentID: string; from?: string } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "session.input.promoted" - readonly durable: { readonly aggregateID: string; readonly seq: number; readonly version: 1 } - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { readonly sessionID: string; readonly inputID: string } + id: string + created: number + metadata?: { [x: string]: unknown } + type: "session.input.promoted" + durable: { aggregateID: string; seq: number; version: 1 } + location?: { directory: string; workspaceID?: string } + data: { sessionID: string; inputID: string } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "session.input.admitted" - readonly durable: { readonly aggregateID: string; readonly seq: number; readonly version: 1 } - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { - readonly sessionID: string - readonly inputID: string - readonly input: + id: string + created: number + metadata?: { [x: string]: unknown } + type: "session.input.admitted" + durable: { aggregateID: string; seq: number; version: 1 } + location?: { directory: string; workspaceID?: string } + data: { + sessionID: string + inputID: string + input: | { - readonly type: "user" - readonly data: { - readonly text: string - readonly files?: ReadonlyArray<{ - readonly data: string - readonly mime: string - readonly source: { readonly type: "inline" } | { readonly type: "uri"; readonly uri: string } - readonly name?: string - readonly description?: string - readonly mention?: { readonly start: number; readonly end: number; readonly text: string } + type: "user" + data: { + text: string + files?: Array<{ + data: string + mime: string + source: { type: "inline" } | { type: "uri"; uri: string } + name?: string + description?: string + mention?: { start: number; end: number; text: string } }> - readonly agents?: ReadonlyArray<{ - readonly name: string - readonly mention?: { readonly start: number; readonly end: number; readonly text: string } - }> - readonly metadata?: { readonly [x: string]: unknown } + agents?: Array<{ name: string; mention?: { start: number; end: number; text: string } }> + metadata?: { [x: string]: unknown } } - readonly delivery: "steer" | "queue" + delivery: "steer" | "queue" } | { - readonly type: "synthetic" - readonly data: { - readonly text: string - readonly description?: string - readonly metadata?: { readonly [x: string]: unknown } - } - readonly delivery: "steer" | "queue" + type: "synthetic" + data: { text: string; description?: string; metadata?: { [x: string]: unknown } } + delivery: "steer" | "queue" } } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "session.execution.started" - readonly durable: { readonly aggregateID: string; readonly seq: number; readonly version: 1 } - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { readonly sessionID: string } + id: string + created: number + metadata?: { [x: string]: unknown } + type: "session.execution.started" + durable: { aggregateID: string; seq: number; version: 1 } + location?: { directory: string; workspaceID?: string } + data: { sessionID: string } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "session.execution.succeeded" - readonly durable: { readonly aggregateID: string; readonly seq: number; readonly version: 1 } - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { readonly sessionID: string } + id: string + created: number + metadata?: { [x: string]: unknown } + type: "session.execution.succeeded" + durable: { aggregateID: string; seq: number; version: 1 } + location?: { directory: string; workspaceID?: string } + data: { sessionID: string } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "session.execution.failed" - readonly durable: { readonly aggregateID: string; readonly seq: number; readonly version: 1 } - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { - readonly sessionID: string - readonly error: { readonly type: string; readonly message: string } - } + id: string + created: number + metadata?: { [x: string]: unknown } + type: "session.execution.failed" + durable: { aggregateID: string; seq: number; version: 1 } + location?: { directory: string; workspaceID?: string } + data: { sessionID: string; error: { type: string; message: string } } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "session.execution.interrupted" - readonly durable: { readonly aggregateID: string; readonly seq: number; readonly version: 1 } - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { readonly sessionID: string; readonly reason: "user" | "shutdown" | "superseded" } + id: string + created: number + metadata?: { [x: string]: unknown } + type: "session.execution.interrupted" + durable: { aggregateID: string; seq: number; version: 1 } + location?: { directory: string; workspaceID?: string } + data: { sessionID: string; reason: "user" | "shutdown" | "superseded" } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "session.instructions.updated" - readonly durable: { readonly aggregateID: string; readonly seq: number; readonly version: 1 } - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { readonly sessionID: string; readonly text: string } + id: string + created: number + metadata?: { [x: string]: unknown } + type: "session.instructions.updated" + durable: { aggregateID: string; seq: number; version: 1 } + location?: { directory: string; workspaceID?: string } + data: { sessionID: string; text: string } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "session.synthetic" - readonly durable: { readonly aggregateID: string; readonly seq: number; readonly version: 1 } - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { - readonly sessionID: string - readonly text: string - readonly description?: string - readonly metadata?: { readonly [x: string]: unknown } - } + id: string + created: number + metadata?: { [x: string]: unknown } + type: "session.synthetic" + durable: { aggregateID: string; seq: number; version: 1 } + location?: { directory: string; workspaceID?: string } + data: { sessionID: string; text: string; description?: string; metadata?: { [x: string]: unknown } } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "session.skill.activated" - readonly durable: { readonly aggregateID: string; readonly seq: number; readonly version: 1 } - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { - readonly sessionID: string - readonly id: string - readonly name: string - readonly text: string - } + id: string + created: number + metadata?: { [x: string]: unknown } + type: "session.skill.activated" + durable: { aggregateID: string; seq: number; version: 1 } + location?: { directory: string; workspaceID?: string } + data: { sessionID: string; id: string; name: string; text: string } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "session.shell.started" - readonly durable: { readonly aggregateID: string; readonly seq: number; readonly version: 1 } - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { - readonly sessionID: string - readonly shell: { - readonly id: string - readonly status: "running" | "exited" | "timeout" | "killed" - readonly command: string - readonly cwd: string - readonly shell: string - readonly file: string - readonly pid?: number - readonly exit?: number - readonly metadata: { readonly [x: string]: unknown } - readonly time: { readonly started: number; readonly completed?: number } + id: string + created: number + metadata?: { [x: string]: unknown } + type: "session.shell.started" + durable: { aggregateID: string; seq: number; version: 1 } + location?: { directory: string; workspaceID?: string } + data: { + sessionID: string + shell: { + id: string + status: "running" | "exited" | "timeout" | "killed" + command: string + cwd: string + shell: string + file: string + pid?: number + exit?: number + metadata: { [x: string]: unknown } + time: { started: number; completed?: number } } } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "session.shell.ended" - readonly durable: { readonly aggregateID: string; readonly seq: number; readonly version: 1 } - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { - readonly sessionID: string - readonly shell: { - readonly id: string - readonly status: "running" | "exited" | "timeout" | "killed" - readonly command: string - readonly cwd: string - readonly shell: string - readonly file: string - readonly pid?: number - readonly exit?: number - readonly metadata: { readonly [x: string]: unknown } - readonly time: { readonly started: number; readonly completed?: number } - } - readonly output: { - readonly output: string - readonly cursor: number - readonly size: number - readonly truncated: boolean + id: string + created: number + metadata?: { [x: string]: unknown } + type: "session.shell.ended" + durable: { aggregateID: string; seq: number; version: 1 } + location?: { directory: string; workspaceID?: string } + data: { + sessionID: string + shell: { + id: string + status: "running" | "exited" | "timeout" | "killed" + command: string + cwd: string + shell: string + file: string + pid?: number + exit?: number + metadata: { [x: string]: unknown } + time: { started: number; completed?: number } } + output: { output: string; cursor: number; size: number; truncated: boolean } } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "session.step.started" - readonly durable: { readonly aggregateID: string; readonly seq: number; readonly version: 1 } - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { - readonly sessionID: string - readonly assistantMessageID: string - readonly agent: string - readonly model: { readonly id: string; readonly providerID: string; readonly variant?: string } - readonly snapshot?: string + id: string + created: number + metadata?: { [x: string]: unknown } + type: "session.step.started" + durable: { aggregateID: string; seq: number; version: 1 } + location?: { directory: string; workspaceID?: string } + data: { + sessionID: string + assistantMessageID: string + agent: string + model: { id: string; providerID: string; variant?: string } + snapshot?: string } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "session.step.ended" - readonly durable: { readonly aggregateID: string; readonly seq: number; readonly version: 1 } - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { - readonly sessionID: string - readonly assistantMessageID: string - readonly finish: "stop" | "length" | "tool-calls" | "content-filter" | "error" | "unknown" - readonly cost: number - readonly tokens: { - readonly input: number - readonly output: number - readonly reasoning: number - readonly cache: { readonly read: number; readonly write: number } - } - readonly snapshot?: string - readonly files?: ReadonlyArray + id: string + created: number + metadata?: { [x: string]: unknown } + type: "session.step.ended" + durable: { aggregateID: string; seq: number; version: 1 } + location?: { directory: string; workspaceID?: string } + data: { + sessionID: string + assistantMessageID: string + finish: "stop" | "length" | "tool-calls" | "content-filter" | "error" | "unknown" + cost: number + tokens: { input: number; output: number; reasoning: number; cache: { read: number; write: number } } + snapshot?: string + files?: Array } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "session.step.failed" - readonly durable: { readonly aggregateID: string; readonly seq: number; readonly version: 1 } - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { - readonly sessionID: string - readonly assistantMessageID: string - readonly error: { readonly type: string; readonly message: string } - readonly cost?: number - readonly tokens?: { - readonly input: number - readonly output: number - readonly reasoning: number - readonly cache: { readonly read: number; readonly write: number } - } + id: string + created: number + metadata?: { [x: string]: unknown } + type: "session.step.failed" + durable: { aggregateID: string; seq: number; version: 1 } + location?: { directory: string; workspaceID?: string } + data: { + sessionID: string + assistantMessageID: string + error: { type: string; message: string } + cost?: number + tokens?: { input: number; output: number; reasoning: number; cache: { read: number; write: number } } } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "session.text.started" - readonly durable: { readonly aggregateID: string; readonly seq: number; readonly version: 1 } - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { readonly sessionID: string; readonly assistantMessageID: string; readonly ordinal: number } + id: string + created: number + metadata?: { [x: string]: unknown } + type: "session.text.started" + durable: { aggregateID: string; seq: number; version: 1 } + location?: { directory: string; workspaceID?: string } + data: { sessionID: string; assistantMessageID: string; ordinal: number } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "session.text.ended" - readonly durable: { readonly aggregateID: string; readonly seq: number; readonly version: 1 } - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { - readonly sessionID: string - readonly assistantMessageID: string - readonly ordinal: number - readonly text: string + id: string + created: number + metadata?: { [x: string]: unknown } + type: "session.text.ended" + durable: { aggregateID: string; seq: number; version: 1 } + location?: { directory: string; workspaceID?: string } + data: { sessionID: string; assistantMessageID: string; ordinal: number; text: string } + } + | { + id: string + created: number + metadata?: { [x: string]: unknown } + type: "session.reasoning.started" + durable: { aggregateID: string; seq: number; version: 1 } + location?: { directory: string; workspaceID?: string } + data: { sessionID: string; assistantMessageID: string; ordinal: number; state?: { [x: string]: unknown } } + } + | { + id: string + created: number + metadata?: { [x: string]: unknown } + type: "session.reasoning.ended" + durable: { aggregateID: string; seq: number; version: 1 } + location?: { directory: string; workspaceID?: string } + data: { + sessionID: string + assistantMessageID: string + ordinal: number + text: string + state?: { [x: string]: unknown } } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "session.reasoning.started" - readonly durable: { readonly aggregateID: string; readonly seq: number; readonly version: 1 } - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { - readonly sessionID: string - readonly assistantMessageID: string - readonly ordinal: number - readonly state?: { readonly [x: string]: unknown } + id: string + created: number + metadata?: { [x: string]: unknown } + type: "session.tool.input.started" + durable: { aggregateID: string; seq: number; version: 1 } + location?: { directory: string; workspaceID?: string } + data: { sessionID: string; assistantMessageID: string; callID: string; name: string } + } + | { + id: string + created: number + metadata?: { [x: string]: unknown } + type: "session.tool.input.ended" + durable: { aggregateID: string; seq: number; version: 1 } + location?: { directory: string; workspaceID?: string } + data: { sessionID: string; assistantMessageID: string; callID: string; text: string } + } + | { + id: string + created: number + metadata?: { [x: string]: unknown } + type: "session.tool.called" + durable: { aggregateID: string; seq: number; version: 1 } + location?: { directory: string; workspaceID?: string } + data: { + sessionID: string + assistantMessageID: string + callID: string + input: { [x: string]: unknown } + executed: boolean + state?: { [x: string]: unknown } } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "session.reasoning.ended" - readonly durable: { readonly aggregateID: string; readonly seq: number; readonly version: 1 } - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { - readonly sessionID: string - readonly assistantMessageID: string - readonly ordinal: number - readonly text: string - readonly state?: { readonly [x: string]: unknown } + id: string + created: number + metadata?: { [x: string]: unknown } + type: "session.tool.progress" + durable: { aggregateID: string; seq: number; version: 1 } + location?: { directory: string; workspaceID?: string } + data: { + sessionID: string + assistantMessageID: string + callID: string + structured: { [x: string]: unknown } + content: Array<{ type: "text"; text: string } | { type: "file"; uri: string; mime: string; name?: string }> } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "session.tool.input.started" - readonly durable: { readonly aggregateID: string; readonly seq: number; readonly version: 1 } - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { - readonly sessionID: string - readonly assistantMessageID: string - readonly callID: string - readonly name: string + id: string + created: number + metadata?: { [x: string]: unknown } + type: "session.tool.success" + durable: { aggregateID: string; seq: number; version: 1 } + location?: { directory: string; workspaceID?: string } + data: { + sessionID: string + assistantMessageID: string + callID: string + structured: { [x: string]: unknown } + content: Array<{ type: "text"; text: string } | { type: "file"; uri: string; mime: string; name?: string }> + result?: unknown + executed: boolean + resultState?: { [x: string]: unknown } } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "session.tool.input.ended" - readonly durable: { readonly aggregateID: string; readonly seq: number; readonly version: 1 } - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { - readonly sessionID: string - readonly assistantMessageID: string - readonly callID: string - readonly text: string + id: string + created: number + metadata?: { [x: string]: unknown } + type: "session.tool.failed" + durable: { aggregateID: string; seq: number; version: 1 } + location?: { directory: string; workspaceID?: string } + data: { + sessionID: string + assistantMessageID: string + callID: string + error: { type: string; message: string } + result?: unknown + executed: boolean + resultState?: { [x: string]: unknown } } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "session.tool.called" - readonly durable: { readonly aggregateID: string; readonly seq: number; readonly version: 1 } - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { - readonly sessionID: string - readonly assistantMessageID: string - readonly callID: string - readonly input: { readonly [x: string]: unknown } - readonly executed: boolean - readonly state?: { readonly [x: string]: unknown } + id: string + created: number + metadata?: { [x: string]: unknown } + type: "session.retry.scheduled" + durable: { aggregateID: string; seq: number; version: 1 } + location?: { directory: string; workspaceID?: string } + data: { + sessionID: string + assistantMessageID: string + attempt: number + at: number + error: { type: string; message: string } } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "session.tool.progress" - readonly durable: { readonly aggregateID: string; readonly seq: number; readonly version: 1 } - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { - readonly sessionID: string - readonly assistantMessageID: string - readonly callID: string - readonly structured: { readonly [x: string]: unknown } - readonly content: ReadonlyArray< - | { readonly type: "text"; readonly text: string } - | { readonly type: "file"; readonly uri: string; readonly mime: string; readonly name?: string } - > + id: string + created: number + metadata?: { [x: string]: unknown } + type: "session.compaction.admitted" + durable: { aggregateID: string; seq: number; version: 1 } + location?: { directory: string; workspaceID?: string } + data: { sessionID: string; inputID: string } + } + | { + id: string + created: number + metadata?: { [x: string]: unknown } + type: "session.compaction.started" + durable: { aggregateID: string; seq: number; version: 1 } + location?: { directory: string; workspaceID?: string } + data: { sessionID: string; reason: "auto" | "manual"; recent: string; inputID?: string } + } + | { + id: string + created: number + metadata?: { [x: string]: unknown } + type: "session.compaction.ended" + durable: { aggregateID: string; seq: number; version: 1 } + location?: { directory: string; workspaceID?: string } + data: { sessionID: string; reason: "auto" | "manual"; text: string; recent: string } + } + | { + id: string + created: number + metadata?: { [x: string]: unknown } + type: "session.compaction.failed" + durable: { aggregateID: string; seq: number; version: 1 } + location?: { directory: string; workspaceID?: string } + data: { + sessionID: string + reason: "auto" | "manual" + error: { type: string; message: string } + inputID?: string } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "session.tool.success" - readonly durable: { readonly aggregateID: string; readonly seq: number; readonly version: 1 } - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { - readonly sessionID: string - readonly assistantMessageID: string - readonly callID: string - readonly structured: { readonly [x: string]: unknown } - readonly content: ReadonlyArray< - | { readonly type: "text"; readonly text: string } - | { readonly type: "file"; readonly uri: string; readonly mime: string; readonly name?: string } - > - readonly result?: unknown - readonly executed: boolean - readonly resultState?: { readonly [x: string]: unknown } - } - } - | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "session.tool.failed" - readonly durable: { readonly aggregateID: string; readonly seq: number; readonly version: 1 } - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { - readonly sessionID: string - readonly assistantMessageID: string - readonly callID: string - readonly error: { readonly type: string; readonly message: string } - readonly result?: unknown - readonly executed: boolean - readonly resultState?: { readonly [x: string]: unknown } - } - } - | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "session.retry.scheduled" - readonly durable: { readonly aggregateID: string; readonly seq: number; readonly version: 1 } - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { - readonly sessionID: string - readonly assistantMessageID: string - readonly attempt: number - readonly at: number - readonly error: { readonly type: string; readonly message: string } - } - } - | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "session.compaction.admitted" - readonly durable: { readonly aggregateID: string; readonly seq: number; readonly version: 1 } - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { readonly sessionID: string; readonly inputID: string } - } - | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "session.compaction.started" - readonly durable: { readonly aggregateID: string; readonly seq: number; readonly version: 1 } - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { - readonly sessionID: string - readonly reason: "auto" | "manual" - readonly recent: string - readonly inputID?: string - } - } - | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "session.compaction.ended" - readonly durable: { readonly aggregateID: string; readonly seq: number; readonly version: 1 } - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { - readonly sessionID: string - readonly reason: "auto" | "manual" - readonly text: string - readonly recent: string - } - } - | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "session.compaction.failed" - readonly durable: { readonly aggregateID: string; readonly seq: number; readonly version: 1 } - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { - readonly sessionID: string - readonly reason: "auto" | "manual" - readonly error: { readonly type: string; readonly message: string } - readonly inputID?: string - } - } - | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "session.revert.staged" - readonly durable: { readonly aggregateID: string; readonly seq: number; readonly version: 1 } - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { - readonly sessionID: string - readonly revert: { - readonly messageID: string - readonly partID?: string - readonly snapshot?: string - readonly files?: ReadonlyArray<{ - readonly file: string - readonly patch: string - readonly additions: number - readonly deletions: number - readonly status: "added" | "deleted" | "modified" + id: string + created: number + metadata?: { [x: string]: unknown } + type: "session.revert.staged" + durable: { aggregateID: string; seq: number; version: 1 } + location?: { directory: string; workspaceID?: string } + data: { + sessionID: string + revert: { + messageID: string + partID?: string + snapshot?: string + files?: Array<{ + file: string + patch: string + additions: number + deletions: number + status: "added" | "deleted" | "modified" }> } } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "session.revert.cleared" - readonly durable: { readonly aggregateID: string; readonly seq: number; readonly version: 1 } - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { readonly sessionID: string } + id: string + created: number + metadata?: { [x: string]: unknown } + type: "session.revert.cleared" + durable: { aggregateID: string; seq: number; version: 1 } + location?: { directory: string; workspaceID?: string } + data: { sessionID: string } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "session.revert.committed" - readonly durable: { readonly aggregateID: string; readonly seq: number; readonly version: 1 } - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { readonly sessionID: string; readonly to: string } + id: string + created: number + metadata?: { [x: string]: unknown } + type: "session.revert.committed" + durable: { aggregateID: string; seq: number; version: 1 } + location?: { directory: string; workspaceID?: string } + data: { sessionID: string; to: string } } ) - | { readonly type: "log.synced"; readonly aggregateID: string; readonly seq?: number } + | { type: "log.synced"; aggregateID: string; seq?: number } export type SessionInterruptInput = { readonly sessionID: { readonly sessionID: string }["sessionID"] } @@ -1827,183 +1667,157 @@ export type SessionMessageInput = { } export type SessionMessageOutput = { - readonly data: + data: | { - readonly id: string - readonly metadata?: { readonly [x: string]: JsonValue } - readonly time: { readonly created: number } - readonly type: "agent-switched" - readonly agent: string + id: string + metadata?: { [x: string]: JsonValue } + time: { created: number } + type: "agent-switched" + agent: string } | { - readonly id: string - readonly metadata?: { readonly [x: string]: JsonValue } - readonly time: { readonly created: number } - readonly type: "model-switched" - readonly model: { readonly id: string; readonly providerID: string; readonly variant?: string } - readonly previous?: { readonly id: string; readonly providerID: string; readonly variant?: string } + id: string + metadata?: { [x: string]: JsonValue } + time: { created: number } + type: "model-switched" + model: { id: string; providerID: string; variant?: string } + previous?: { id: string; providerID: string; variant?: string } } | { - readonly id: string - readonly metadata?: { readonly [x: string]: JsonValue } - readonly time: { readonly created: number } - readonly text: string - readonly files?: ReadonlyArray<{ - readonly data: string - readonly mime: string - readonly source: { readonly type: "inline" } | { readonly type: "uri"; readonly uri: string } - readonly name?: string - readonly description?: string - readonly mention?: { readonly start: number; readonly end: number; readonly text: string } + id: string + metadata?: { [x: string]: JsonValue } + time: { created: number } + text: string + files?: Array<{ + data: string + mime: string + source: { type: "inline" } | { type: "uri"; uri: string } + name?: string + description?: string + mention?: { start: number; end: number; text: string } }> - readonly agents?: ReadonlyArray<{ - readonly name: string - readonly mention?: { readonly start: number; readonly end: number; readonly text: string } - }> - readonly type: "user" + agents?: Array<{ name: string; mention?: { start: number; end: number; text: string } }> + type: "user" } | { - readonly id: string - readonly metadata?: { readonly [x: string]: JsonValue } - readonly time: { readonly created: number } - readonly text: string - readonly description?: string - readonly type: "synthetic" + id: string + metadata?: { [x: string]: JsonValue } + time: { created: number } + text: string + description?: string + type: "synthetic" + } + | { id: string; metadata?: { [x: string]: JsonValue }; time: { created: number }; type: "system"; text: string } + | { + id: string + metadata?: { [x: string]: JsonValue } + time: { created: number } + type: "skill" + skill: string + name: string + text: string } | { - readonly id: string - readonly metadata?: { readonly [x: string]: JsonValue } - readonly time: { readonly created: number } - readonly type: "system" - readonly text: string + id: string + metadata?: { [x: string]: JsonValue } + time: { created: number; completed?: number } + type: "shell" + shellID: string + command: string + status: "running" | "exited" | "timeout" | "killed" + exit?: number | "Infinity" | "-Infinity" | "NaN" + output?: { output: string; cursor: number; size: number; truncated: boolean } } | { - readonly id: string - readonly metadata?: { readonly [x: string]: JsonValue } - readonly time: { readonly created: number } - readonly type: "skill" - readonly skill: string - readonly name: string - readonly text: string - } - | { - readonly id: string - readonly metadata?: { readonly [x: string]: JsonValue } - readonly time: { readonly created: number; readonly completed?: number } - readonly type: "shell" - readonly shellID: string - readonly command: string - readonly status: "running" | "exited" | "timeout" | "killed" - readonly exit?: number | "Infinity" | "-Infinity" | "NaN" - readonly output?: { - readonly output: string - readonly cursor: number - readonly size: number - readonly truncated: boolean - } - } - | { - readonly id: string - readonly metadata?: { readonly [x: string]: JsonValue } - readonly time: { readonly created: number; readonly completed?: number } - readonly type: "assistant" - readonly agent: string - readonly model: { readonly id: string; readonly providerID: string; readonly variant?: string } - readonly content: ReadonlyArray< - | { readonly type: "text"; readonly text: string } + id: string + metadata?: { [x: string]: JsonValue } + time: { created: number; completed?: number } + type: "assistant" + agent: string + model: { id: string; providerID: string; variant?: string } + content: Array< + | { type: "text"; text: string } | { - readonly type: "reasoning" - readonly text: string - readonly state?: { readonly [x: string]: JsonValue } - readonly time?: { readonly created: number; readonly completed?: number } + type: "reasoning" + text: string + state?: { [x: string]: JsonValue } + time?: { created: number; completed?: number } } | { - readonly type: "tool" - readonly id: string - readonly name: string - readonly executed?: boolean - readonly providerState?: { readonly [x: string]: JsonValue } - readonly providerResultState?: { readonly [x: string]: JsonValue } - readonly state: - | { readonly status: "streaming"; readonly input: string } + type: "tool" + id: string + name: string + executed?: boolean + providerState?: { [x: string]: JsonValue } + providerResultState?: { [x: string]: JsonValue } + state: + | { status: "streaming"; input: string } | { - readonly status: "running" - readonly input: { readonly [x: string]: JsonValue } - readonly structured: { readonly [x: string]: JsonValue } - readonly content: ReadonlyArray< - | { readonly type: "text"; readonly text: string } - | { readonly type: "file"; readonly uri: string; readonly mime: string; readonly name?: string } + status: "running" + input: { [x: string]: JsonValue } + structured: { [x: string]: JsonValue } + content: Array< + { type: "text"; text: string } | { type: "file"; uri: string; mime: string; name?: string } > } | { - readonly status: "completed" - readonly input: { readonly [x: string]: JsonValue } - readonly content: ReadonlyArray< - | { readonly type: "text"; readonly text: string } - | { readonly type: "file"; readonly uri: string; readonly mime: string; readonly name?: string } + status: "completed" + input: { [x: string]: JsonValue } + content: Array< + { type: "text"; text: string } | { type: "file"; uri: string; mime: string; name?: string } > - readonly structured: { readonly [x: string]: JsonValue } - readonly result?: JsonValue + structured: { [x: string]: JsonValue } + result?: JsonValue } | { - readonly status: "error" - readonly input: { readonly [x: string]: JsonValue } - readonly content: ReadonlyArray< - | { readonly type: "text"; readonly text: string } - | { readonly type: "file"; readonly uri: string; readonly mime: string; readonly name?: string } + status: "error" + input: { [x: string]: JsonValue } + content: Array< + { type: "text"; text: string } | { type: "file"; uri: string; mime: string; name?: string } > - readonly structured: { readonly [x: string]: JsonValue } - readonly error: { readonly type: string; readonly message: string } - readonly result?: JsonValue + structured: { [x: string]: JsonValue } + error: { type: string; message: string } + result?: JsonValue } - readonly time: { readonly created: number; readonly ran?: number; readonly completed?: number } + time: { created: number; ran?: number; completed?: number } } > - readonly snapshot?: { readonly start?: string; readonly end?: string; readonly files?: ReadonlyArray } - readonly finish?: "stop" | "length" | "tool-calls" | "content-filter" | "error" | "unknown" - readonly cost?: number - readonly tokens?: { - readonly input: number - readonly output: number - readonly reasoning: number - readonly cache: { readonly read: number; readonly write: number } - } - readonly error?: { readonly type: string; readonly message: string } - readonly retry?: { - readonly attempt: number - readonly at: number - readonly error: { readonly type: string; readonly message: string } - } + snapshot?: { start?: string; end?: string; files?: Array } + finish?: "stop" | "length" | "tool-calls" | "content-filter" | "error" | "unknown" + cost?: number + tokens?: { input: number; output: number; reasoning: number; cache: { read: number; write: number } } + error?: { type: string; message: string } + retry?: { attempt: number; at: number; error: { type: string; message: string } } } | ( | { - readonly type: "compaction" - readonly id: string - readonly metadata?: { readonly [x: string]: JsonValue } - readonly time: { readonly created: number } - readonly status: "running" - readonly reason: "auto" | "manual" - readonly summary: string - readonly recent: string + type: "compaction" + id: string + metadata?: { [x: string]: JsonValue } + time: { created: number } + status: "running" + reason: "auto" | "manual" + summary: string + recent: string } | { - readonly type: "compaction" - readonly id: string - readonly metadata?: { readonly [x: string]: JsonValue } - readonly time: { readonly created: number } - readonly status: "completed" - readonly reason: "auto" | "manual" - readonly summary: string - readonly recent: string + type: "compaction" + id: string + metadata?: { [x: string]: JsonValue } + time: { created: number } + status: "completed" + reason: "auto" | "manual" + summary: string + recent: string } | { - readonly type: "compaction" - readonly id: string - readonly metadata?: { readonly [x: string]: JsonValue } - readonly time: { readonly created: number } - readonly status: "failed" - readonly reason: "auto" | "manual" - readonly error: { readonly type: string; readonly message: string } + type: "compaction" + id: string + metadata?: { [x: string]: JsonValue } + time: { created: number } + status: "failed" + reason: "auto" | "manual" + error: { type: string; message: string } } ) }["data"] @@ -2028,187 +1842,161 @@ export type MessageListInput = { } export type MessageListOutput = { - readonly data: ReadonlyArray< + data: Array< | { - readonly id: string - readonly metadata?: { readonly [x: string]: JsonValue } - readonly time: { readonly created: number } - readonly type: "agent-switched" - readonly agent: string + id: string + metadata?: { [x: string]: JsonValue } + time: { created: number } + type: "agent-switched" + agent: string } | { - readonly id: string - readonly metadata?: { readonly [x: string]: JsonValue } - readonly time: { readonly created: number } - readonly type: "model-switched" - readonly model: { readonly id: string; readonly providerID: string; readonly variant?: string } - readonly previous?: { readonly id: string; readonly providerID: string; readonly variant?: string } + id: string + metadata?: { [x: string]: JsonValue } + time: { created: number } + type: "model-switched" + model: { id: string; providerID: string; variant?: string } + previous?: { id: string; providerID: string; variant?: string } } | { - readonly id: string - readonly metadata?: { readonly [x: string]: JsonValue } - readonly time: { readonly created: number } - readonly text: string - readonly files?: ReadonlyArray<{ - readonly data: string - readonly mime: string - readonly source: { readonly type: "inline" } | { readonly type: "uri"; readonly uri: string } - readonly name?: string - readonly description?: string - readonly mention?: { readonly start: number; readonly end: number; readonly text: string } + id: string + metadata?: { [x: string]: JsonValue } + time: { created: number } + text: string + files?: Array<{ + data: string + mime: string + source: { type: "inline" } | { type: "uri"; uri: string } + name?: string + description?: string + mention?: { start: number; end: number; text: string } }> - readonly agents?: ReadonlyArray<{ - readonly name: string - readonly mention?: { readonly start: number; readonly end: number; readonly text: string } - }> - readonly type: "user" + agents?: Array<{ name: string; mention?: { start: number; end: number; text: string } }> + type: "user" } | { - readonly id: string - readonly metadata?: { readonly [x: string]: JsonValue } - readonly time: { readonly created: number } - readonly text: string - readonly description?: string - readonly type: "synthetic" + id: string + metadata?: { [x: string]: JsonValue } + time: { created: number } + text: string + description?: string + type: "synthetic" + } + | { id: string; metadata?: { [x: string]: JsonValue }; time: { created: number }; type: "system"; text: string } + | { + id: string + metadata?: { [x: string]: JsonValue } + time: { created: number } + type: "skill" + skill: string + name: string + text: string } | { - readonly id: string - readonly metadata?: { readonly [x: string]: JsonValue } - readonly time: { readonly created: number } - readonly type: "system" - readonly text: string + id: string + metadata?: { [x: string]: JsonValue } + time: { created: number; completed?: number } + type: "shell" + shellID: string + command: string + status: "running" | "exited" | "timeout" | "killed" + exit?: number | "Infinity" | "-Infinity" | "NaN" + output?: { output: string; cursor: number; size: number; truncated: boolean } } | { - readonly id: string - readonly metadata?: { readonly [x: string]: JsonValue } - readonly time: { readonly created: number } - readonly type: "skill" - readonly skill: string - readonly name: string - readonly text: string - } - | { - readonly id: string - readonly metadata?: { readonly [x: string]: JsonValue } - readonly time: { readonly created: number; readonly completed?: number } - readonly type: "shell" - readonly shellID: string - readonly command: string - readonly status: "running" | "exited" | "timeout" | "killed" - readonly exit?: number | "Infinity" | "-Infinity" | "NaN" - readonly output?: { - readonly output: string - readonly cursor: number - readonly size: number - readonly truncated: boolean - } - } - | { - readonly id: string - readonly metadata?: { readonly [x: string]: JsonValue } - readonly time: { readonly created: number; readonly completed?: number } - readonly type: "assistant" - readonly agent: string - readonly model: { readonly id: string; readonly providerID: string; readonly variant?: string } - readonly content: ReadonlyArray< - | { readonly type: "text"; readonly text: string } + id: string + metadata?: { [x: string]: JsonValue } + time: { created: number; completed?: number } + type: "assistant" + agent: string + model: { id: string; providerID: string; variant?: string } + content: Array< + | { type: "text"; text: string } | { - readonly type: "reasoning" - readonly text: string - readonly state?: { readonly [x: string]: JsonValue } - readonly time?: { readonly created: number; readonly completed?: number } + type: "reasoning" + text: string + state?: { [x: string]: JsonValue } + time?: { created: number; completed?: number } } | { - readonly type: "tool" - readonly id: string - readonly name: string - readonly executed?: boolean - readonly providerState?: { readonly [x: string]: JsonValue } - readonly providerResultState?: { readonly [x: string]: JsonValue } - readonly state: - | { readonly status: "streaming"; readonly input: string } + type: "tool" + id: string + name: string + executed?: boolean + providerState?: { [x: string]: JsonValue } + providerResultState?: { [x: string]: JsonValue } + state: + | { status: "streaming"; input: string } | { - readonly status: "running" - readonly input: { readonly [x: string]: JsonValue } - readonly structured: { readonly [x: string]: JsonValue } - readonly content: ReadonlyArray< - | { readonly type: "text"; readonly text: string } - | { readonly type: "file"; readonly uri: string; readonly mime: string; readonly name?: string } + status: "running" + input: { [x: string]: JsonValue } + structured: { [x: string]: JsonValue } + content: Array< + { type: "text"; text: string } | { type: "file"; uri: string; mime: string; name?: string } > } | { - readonly status: "completed" - readonly input: { readonly [x: string]: JsonValue } - readonly content: ReadonlyArray< - | { readonly type: "text"; readonly text: string } - | { readonly type: "file"; readonly uri: string; readonly mime: string; readonly name?: string } + status: "completed" + input: { [x: string]: JsonValue } + content: Array< + { type: "text"; text: string } | { type: "file"; uri: string; mime: string; name?: string } > - readonly structured: { readonly [x: string]: JsonValue } - readonly result?: JsonValue + structured: { [x: string]: JsonValue } + result?: JsonValue } | { - readonly status: "error" - readonly input: { readonly [x: string]: JsonValue } - readonly content: ReadonlyArray< - | { readonly type: "text"; readonly text: string } - | { readonly type: "file"; readonly uri: string; readonly mime: string; readonly name?: string } + status: "error" + input: { [x: string]: JsonValue } + content: Array< + { type: "text"; text: string } | { type: "file"; uri: string; mime: string; name?: string } > - readonly structured: { readonly [x: string]: JsonValue } - readonly error: { readonly type: string; readonly message: string } - readonly result?: JsonValue + structured: { [x: string]: JsonValue } + error: { type: string; message: string } + result?: JsonValue } - readonly time: { readonly created: number; readonly ran?: number; readonly completed?: number } + time: { created: number; ran?: number; completed?: number } } > - readonly snapshot?: { readonly start?: string; readonly end?: string; readonly files?: ReadonlyArray } - readonly finish?: "stop" | "length" | "tool-calls" | "content-filter" | "error" | "unknown" - readonly cost?: number - readonly tokens?: { - readonly input: number - readonly output: number - readonly reasoning: number - readonly cache: { readonly read: number; readonly write: number } - } - readonly error?: { readonly type: string; readonly message: string } - readonly retry?: { - readonly attempt: number - readonly at: number - readonly error: { readonly type: string; readonly message: string } - } + snapshot?: { start?: string; end?: string; files?: Array } + finish?: "stop" | "length" | "tool-calls" | "content-filter" | "error" | "unknown" + cost?: number + tokens?: { input: number; output: number; reasoning: number; cache: { read: number; write: number } } + error?: { type: string; message: string } + retry?: { attempt: number; at: number; error: { type: string; message: string } } } | ( | { - readonly type: "compaction" - readonly id: string - readonly metadata?: { readonly [x: string]: JsonValue } - readonly time: { readonly created: number } - readonly status: "running" - readonly reason: "auto" | "manual" - readonly summary: string - readonly recent: string + type: "compaction" + id: string + metadata?: { [x: string]: JsonValue } + time: { created: number } + status: "running" + reason: "auto" | "manual" + summary: string + recent: string } | { - readonly type: "compaction" - readonly id: string - readonly metadata?: { readonly [x: string]: JsonValue } - readonly time: { readonly created: number } - readonly status: "completed" - readonly reason: "auto" | "manual" - readonly summary: string - readonly recent: string + type: "compaction" + id: string + metadata?: { [x: string]: JsonValue } + time: { created: number } + status: "completed" + reason: "auto" | "manual" + summary: string + recent: string } | { - readonly type: "compaction" - readonly id: string - readonly metadata?: { readonly [x: string]: JsonValue } - readonly time: { readonly created: number } - readonly status: "failed" - readonly reason: "auto" | "manual" - readonly error: { readonly type: string; readonly message: string } + type: "compaction" + id: string + metadata?: { [x: string]: JsonValue } + time: { created: number } + status: "failed" + reason: "auto" | "manual" + error: { type: string; message: string } } ) > - readonly cursor: { readonly previous?: string | null; readonly next?: string | null } + cursor: { previous?: string | null; next?: string | null } } export type ModelListInput = { @@ -2218,42 +2006,34 @@ export type ModelListInput = { } export type ModelListOutput = { - readonly location: { - readonly directory: string - readonly workspaceID?: string - readonly project: { readonly id: string; readonly directory: string } - } - readonly data: ReadonlyArray<{ - readonly id: string - readonly modelID: string - readonly providerID: string - readonly family?: string - readonly name: string - readonly package?: string - readonly settings?: { readonly [x: string]: JsonValue } - readonly headers?: { readonly [x: string]: string } - readonly body?: { readonly [x: string]: JsonValue } - readonly capabilities: { - readonly tools: boolean - readonly input: ReadonlyArray - readonly output: ReadonlyArray - } - readonly variants: ReadonlyArray<{ - readonly id: string - readonly settings?: { readonly [x: string]: JsonValue } - readonly headers?: { readonly [x: string]: string } - readonly body?: { readonly [x: string]: JsonValue } + location: { directory: string; workspaceID?: string; project: { id: string; directory: string } } + data: Array<{ + id: string + modelID: string + providerID: string + family?: string + name: string + package?: string + settings?: { [x: string]: JsonValue } + headers?: { [x: string]: string } + body?: { [x: string]: JsonValue } + capabilities: { tools: boolean; input: Array; output: Array } + variants: Array<{ + id: string + settings?: { [x: string]: JsonValue } + headers?: { [x: string]: string } + body?: { [x: string]: JsonValue } }> - readonly time: { readonly released: number } - readonly cost: ReadonlyArray<{ - readonly tier?: { readonly type: "context"; readonly size: number } - readonly input: number - readonly output: number - readonly cache: { readonly read: number; readonly write: number } + time: { released: number } + cost: Array<{ + tier?: { type: "context"; size: number } + input: number + output: number + cache: { read: number; write: number } }> - readonly status: "alpha" | "beta" | "deprecated" | "active" - readonly enabled: boolean - readonly limit: { readonly context: number; readonly input?: number; readonly output: number } + status: "alpha" | "beta" | "deprecated" | "active" + enabled: boolean + limit: { context: number; input?: number; output: number } }> } @@ -2264,42 +2044,34 @@ export type ModelDefaultInput = { } export type ModelDefaultOutput = { - readonly location: { - readonly directory: string - readonly workspaceID?: string - readonly project: { readonly id: string; readonly directory: string } - } - readonly data: { - readonly id: string - readonly modelID: string - readonly providerID: string - readonly family?: string - readonly name: string - readonly package?: string - readonly settings?: { readonly [x: string]: JsonValue } - readonly headers?: { readonly [x: string]: string } - readonly body?: { readonly [x: string]: JsonValue } - readonly capabilities: { - readonly tools: boolean - readonly input: ReadonlyArray - readonly output: ReadonlyArray - } - readonly variants: ReadonlyArray<{ - readonly id: string - readonly settings?: { readonly [x: string]: JsonValue } - readonly headers?: { readonly [x: string]: string } - readonly body?: { readonly [x: string]: JsonValue } + location: { directory: string; workspaceID?: string; project: { id: string; directory: string } } + data: { + id: string + modelID: string + providerID: string + family?: string + name: string + package?: string + settings?: { [x: string]: JsonValue } + headers?: { [x: string]: string } + body?: { [x: string]: JsonValue } + capabilities: { tools: boolean; input: Array; output: Array } + variants: Array<{ + id: string + settings?: { [x: string]: JsonValue } + headers?: { [x: string]: string } + body?: { [x: string]: JsonValue } }> - readonly time: { readonly released: number } - readonly cost: ReadonlyArray<{ - readonly tier?: { readonly type: "context"; readonly size: number } - readonly input: number - readonly output: number - readonly cache: { readonly read: number; readonly write: number } + time: { released: number } + cost: Array<{ + tier?: { type: "context"; size: number } + input: number + output: number + cache: { read: number; write: number } }> - readonly status: "alpha" | "beta" | "deprecated" | "active" - readonly enabled: boolean - readonly limit: { readonly context: number; readonly input?: number; readonly output: number } + status: "alpha" | "beta" | "deprecated" | "active" + enabled: boolean + limit: { context: number; input?: number; output: number } } | null } @@ -2317,7 +2089,7 @@ export type GenerateTextInput = { }["model"] } -export type GenerateTextOutput = { readonly data: { readonly text: string } }["data"] +export type GenerateTextOutput = { data: { text: string } }["data"] export type ProviderListInput = { readonly location?: { @@ -2326,20 +2098,16 @@ export type ProviderListInput = { } export type ProviderListOutput = { - readonly location: { - readonly directory: string - readonly workspaceID?: string - readonly project: { readonly id: string; readonly directory: string } - } - readonly data: ReadonlyArray<{ - readonly id: string - readonly integrationID?: string - readonly name: string - readonly disabled?: boolean - readonly package: string - readonly settings?: { readonly [x: string]: JsonValue } - readonly headers?: { readonly [x: string]: string } - readonly body?: { readonly [x: string]: JsonValue } + location: { directory: string; workspaceID?: string; project: { id: string; directory: string } } + data: Array<{ + id: string + integrationID?: string + name: string + disabled?: boolean + package: string + settings?: { [x: string]: JsonValue } + headers?: { [x: string]: string } + body?: { [x: string]: JsonValue } }> } @@ -2351,20 +2119,16 @@ export type ProviderGetInput = { } export type ProviderGetOutput = { - readonly location: { - readonly directory: string - readonly workspaceID?: string - readonly project: { readonly id: string; readonly directory: string } - } - readonly data: { - readonly id: string - readonly integrationID?: string - readonly name: string - readonly disabled?: boolean - readonly package: string - readonly settings?: { readonly [x: string]: JsonValue } - readonly headers?: { readonly [x: string]: string } - readonly body?: { readonly [x: string]: JsonValue } + location: { directory: string; workspaceID?: string; project: { id: string; directory: string } } + data: { + id: string + integrationID?: string + name: string + disabled?: boolean + package: string + settings?: { [x: string]: JsonValue } + headers?: { [x: string]: string } + body?: { [x: string]: JsonValue } } } @@ -2375,47 +2139,36 @@ export type IntegrationListInput = { } export type IntegrationListOutput = { - readonly location: { - readonly directory: string - readonly workspaceID?: string - readonly project: { readonly id: string; readonly directory: string } - } - readonly data: ReadonlyArray<{ - readonly id: string - readonly name: string - readonly methods: ReadonlyArray< + location: { directory: string; workspaceID?: string; project: { id: string; directory: string } } + data: Array<{ + id: string + name: string + methods: Array< | { - readonly id: string - readonly type: "oauth" - readonly label: string - readonly prompts?: ReadonlyArray< + id: string + type: "oauth" + label: string + prompts?: Array< | { - readonly type: "text" - readonly key: string - readonly message: string - readonly placeholder?: string - readonly when?: { readonly key: string; readonly op: "eq" | "neq"; readonly value: string } + type: "text" + key: string + message: string + placeholder?: string + when?: { key: string; op: "eq" | "neq"; value: string } } | { - readonly type: "select" - readonly key: string - readonly message: string - readonly options: ReadonlyArray<{ - readonly label: string - readonly value: string - readonly hint?: string - }> - readonly when?: { readonly key: string; readonly op: "eq" | "neq"; readonly value: string } + type: "select" + key: string + message: string + options: Array<{ label: string; value: string; hint?: string }> + when?: { key: string; op: "eq" | "neq"; value: string } } > } - | { readonly type: "key"; readonly label?: string } - | { readonly type: "env"; readonly names: ReadonlyArray } - > - readonly connections: ReadonlyArray< - | { readonly type: "credential"; readonly id: string; readonly label: string } - | { readonly type: "env"; readonly name: string } + | { type: "key"; label?: string } + | { type: "env"; names: Array } > + connections: Array<{ type: "credential"; id: string; label: string } | { type: "env"; name: string }> }> } @@ -2427,47 +2180,36 @@ export type IntegrationGetInput = { } export type IntegrationGetOutput = { - readonly location: { - readonly directory: string - readonly workspaceID?: string - readonly project: { readonly id: string; readonly directory: string } - } - readonly data: { - readonly id: string - readonly name: string - readonly methods: ReadonlyArray< + location: { directory: string; workspaceID?: string; project: { id: string; directory: string } } + data: { + id: string + name: string + methods: Array< | { - readonly id: string - readonly type: "oauth" - readonly label: string - readonly prompts?: ReadonlyArray< + id: string + type: "oauth" + label: string + prompts?: Array< | { - readonly type: "text" - readonly key: string - readonly message: string - readonly placeholder?: string - readonly when?: { readonly key: string; readonly op: "eq" | "neq"; readonly value: string } + type: "text" + key: string + message: string + placeholder?: string + when?: { key: string; op: "eq" | "neq"; value: string } } | { - readonly type: "select" - readonly key: string - readonly message: string - readonly options: ReadonlyArray<{ - readonly label: string - readonly value: string - readonly hint?: string - }> - readonly when?: { readonly key: string; readonly op: "eq" | "neq"; readonly value: string } + type: "select" + key: string + message: string + options: Array<{ label: string; value: string; hint?: string }> + when?: { key: string; op: "eq" | "neq"; value: string } } > } - | { readonly type: "key"; readonly label?: string } - | { readonly type: "env"; readonly names: ReadonlyArray } - > - readonly connections: ReadonlyArray< - | { readonly type: "credential"; readonly id: string; readonly label: string } - | { readonly type: "env"; readonly name: string } + | { type: "key"; label?: string } + | { type: "env"; names: Array } > + connections: Array<{ type: "credential"; id: string; label: string } | { type: "env"; name: string }> } | null } @@ -2505,20 +2247,13 @@ export type IntegrationConnectOauthInput = { } export type IntegrationConnectOauthOutput = { - readonly location: { - readonly directory: string - readonly workspaceID?: string - readonly project: { readonly id: string; readonly directory: string } - } - readonly data: { - readonly attemptID: string - readonly url: string - readonly instructions: string - readonly mode: "auto" | "code" - readonly time: { - readonly created: number | "Infinity" | "-Infinity" | "NaN" - readonly expires: number | "Infinity" | "-Infinity" | "NaN" - } + location: { directory: string; workspaceID?: string; project: { id: string; directory: string } } + data: { + attemptID: string + url: string + instructions: string + mode: "auto" | "code" + time: { created: number | "Infinity" | "-Infinity" | "NaN"; expires: number | "Infinity" | "-Infinity" | "NaN" } } } @@ -2530,40 +2265,24 @@ export type IntegrationAttemptStatusInput = { } export type IntegrationAttemptStatusOutput = { - readonly location: { - readonly directory: string - readonly workspaceID?: string - readonly project: { readonly id: string; readonly directory: string } - } - readonly data: + location: { directory: string; workspaceID?: string; project: { id: string; directory: string } } + data: | { - readonly status: "pending" - readonly time: { - readonly created: number | "Infinity" | "-Infinity" | "NaN" - readonly expires: number | "Infinity" | "-Infinity" | "NaN" - } + status: "pending" + time: { created: number | "Infinity" | "-Infinity" | "NaN"; expires: number | "Infinity" | "-Infinity" | "NaN" } } | { - readonly status: "complete" - readonly time: { - readonly created: number | "Infinity" | "-Infinity" | "NaN" - readonly expires: number | "Infinity" | "-Infinity" | "NaN" - } + status: "complete" + time: { created: number | "Infinity" | "-Infinity" | "NaN"; expires: number | "Infinity" | "-Infinity" | "NaN" } } | { - readonly status: "failed" - readonly message: string - readonly time: { - readonly created: number | "Infinity" | "-Infinity" | "NaN" - readonly expires: number | "Infinity" | "-Infinity" | "NaN" - } + status: "failed" + message: string + time: { created: number | "Infinity" | "-Infinity" | "NaN"; expires: number | "Infinity" | "-Infinity" | "NaN" } } | { - readonly status: "expired" - readonly time: { - readonly created: number | "Infinity" | "-Infinity" | "NaN" - readonly expires: number | "Infinity" | "-Infinity" | "NaN" - } + status: "expired" + time: { created: number | "Infinity" | "-Infinity" | "NaN"; expires: number | "Infinity" | "-Infinity" | "NaN" } } } @@ -2593,21 +2312,17 @@ export type ServerMcpListInput = { } export type ServerMcpListOutput = { - readonly location: { - readonly directory: string - readonly workspaceID?: string - readonly project: { readonly id: string; readonly directory: string } - } - readonly data: ReadonlyArray<{ - readonly name: string - readonly status: - | { readonly status: "connected" } - | { readonly status: "pending" } - | { readonly status: "disabled" } - | { readonly status: "failed"; readonly error: string } - | { readonly status: "needs_auth" } - | { readonly status: "needs_client_registration"; readonly error: string } - readonly integrationID?: string + location: { directory: string; workspaceID?: string; project: { id: string; directory: string } } + data: Array<{ + name: string + status: + | { status: "connected" } + | { status: "pending" } + | { status: "disabled" } + | { status: "failed"; error: string } + | { status: "needs_auth" } + | { status: "needs_client_registration"; error: string } + integrationID?: string }> } @@ -2618,26 +2333,10 @@ export type ServerMcpResourceCatalogInput = { } export type ServerMcpResourceCatalogOutput = { - readonly location: { - readonly directory: string - readonly workspaceID?: string - readonly project: { readonly id: string; readonly directory: string } - } - readonly data: { - readonly resources: ReadonlyArray<{ - readonly server: string - readonly name: string - readonly uri: string - readonly description?: string - readonly mimeType?: string - }> - readonly templates: ReadonlyArray<{ - readonly server: string - readonly name: string - readonly uriTemplate: string - readonly description?: string - readonly mimeType?: string - }> + location: { directory: string; workspaceID?: string; project: { id: string; directory: string } } + data: { + resources: Array<{ server: string; name: string; uri: string; description?: string; mimeType?: string }> + templates: Array<{ server: string; name: string; uriTemplate: string; description?: string; mimeType?: string }> } } @@ -2660,15 +2359,15 @@ export type CredentialRemoveInput = { export type CredentialRemoveOutput = void -export type ProjectListOutput = ReadonlyArray<{ - readonly id: string - readonly worktree: string - readonly vcs?: "git" | "hg" - readonly name?: string - readonly icon?: { readonly url?: string; readonly override?: string; readonly color?: string } - readonly commands?: { readonly start?: string } - readonly time: { readonly created: number; readonly updated: number; readonly initialized?: number } - readonly sandboxes: ReadonlyArray +export type ProjectListOutput = Array<{ + id: string + worktree: string + vcs?: "git" | "hg" + name?: string + icon?: { url?: string; override?: string; color?: string } + commands?: { start?: string } + time: { created: number; updated: number; initialized?: number } + sandboxes: Array }> export type ProjectCurrentInput = { @@ -2677,7 +2376,7 @@ export type ProjectCurrentInput = { }["location"] } -export type ProjectCurrentOutput = { readonly id: string; readonly directory: string } +export type ProjectCurrentOutput = { id: string; directory: string } export type ProjectDirectoriesInput = { readonly projectID: { readonly projectID: string }["projectID"] @@ -2686,7 +2385,7 @@ export type ProjectDirectoriesInput = { }["location"] } -export type ProjectDirectoriesOutput = ReadonlyArray<{ readonly directory: string; readonly strategy?: string }> +export type ProjectDirectoriesOutput = Array<{ directory: string; strategy?: string }> export type FormRequestListInput = { readonly location?: { @@ -2695,229 +2394,195 @@ export type FormRequestListInput = { } export type FormRequestListOutput = { - readonly location: { - readonly directory: string - readonly workspaceID?: string - readonly project: { readonly id: string; readonly directory: string } - } - readonly data: ReadonlyArray< + location: { directory: string; workspaceID?: string; project: { id: string; directory: string } } + data: Array< | { - readonly id: string - readonly sessionID: string - readonly title: string - readonly metadata?: { readonly [x: string]: JsonValue } - readonly mode: "form" - readonly fields: ReadonlyArray< + id: string + sessionID: string + title: string + metadata?: { [x: string]: JsonValue } + mode: "form" + fields: Array< | { - readonly key: string - readonly title?: string - readonly description?: string - readonly required?: boolean - readonly when?: ReadonlyArray<{ - readonly key: string - readonly op: "eq" | "neq" - readonly value: string | number | "Infinity" | "-Infinity" | "NaN" | boolean + key: string + title?: string + description?: string + required?: boolean + when?: Array<{ + key: string + op: "eq" | "neq" + value: string | number | "Infinity" | "-Infinity" | "NaN" | boolean }> - readonly type: "string" - readonly format?: "email" | "uri" | "date" | "date-time" - readonly minLength?: number - readonly maxLength?: number - readonly pattern?: string - readonly placeholder?: string - readonly default?: string - readonly options?: ReadonlyArray<{ - readonly value: string - readonly label: string - readonly description?: string - }> - readonly custom?: boolean + type: "string" + format?: "email" | "uri" | "date" | "date-time" + minLength?: number + maxLength?: number + pattern?: string + placeholder?: string + default?: string + options?: Array<{ value: string; label: string; description?: string }> + custom?: boolean } | { - readonly key: string - readonly title?: string - readonly description?: string - readonly required?: boolean - readonly when?: ReadonlyArray<{ - readonly key: string - readonly op: "eq" | "neq" - readonly value: string | number | "Infinity" | "-Infinity" | "NaN" | boolean + key: string + title?: string + description?: string + required?: boolean + when?: Array<{ + key: string + op: "eq" | "neq" + value: string | number | "Infinity" | "-Infinity" | "NaN" | boolean }> - readonly type: "number" - readonly minimum?: number | "Infinity" | "-Infinity" | "NaN" - readonly maximum?: number | "Infinity" | "-Infinity" | "NaN" - readonly default?: number | "Infinity" | "-Infinity" | "NaN" + type: "number" + minimum?: number | "Infinity" | "-Infinity" | "NaN" + maximum?: number | "Infinity" | "-Infinity" | "NaN" + default?: number | "Infinity" | "-Infinity" | "NaN" } | { - readonly key: string - readonly title?: string - readonly description?: string - readonly required?: boolean - readonly when?: ReadonlyArray<{ - readonly key: string - readonly op: "eq" | "neq" - readonly value: string | number | "Infinity" | "-Infinity" | "NaN" | boolean + key: string + title?: string + description?: string + required?: boolean + when?: Array<{ + key: string + op: "eq" | "neq" + value: string | number | "Infinity" | "-Infinity" | "NaN" | boolean }> - readonly type: "integer" - readonly minimum?: number | "Infinity" | "-Infinity" | "NaN" - readonly maximum?: number | "Infinity" | "-Infinity" | "NaN" - readonly default?: number | "Infinity" | "-Infinity" | "NaN" + type: "integer" + minimum?: number | "Infinity" | "-Infinity" | "NaN" + maximum?: number | "Infinity" | "-Infinity" | "NaN" + default?: number | "Infinity" | "-Infinity" | "NaN" } | { - readonly key: string - readonly title?: string - readonly description?: string - readonly required?: boolean - readonly when?: ReadonlyArray<{ - readonly key: string - readonly op: "eq" | "neq" - readonly value: string | number | "Infinity" | "-Infinity" | "NaN" | boolean + key: string + title?: string + description?: string + required?: boolean + when?: Array<{ + key: string + op: "eq" | "neq" + value: string | number | "Infinity" | "-Infinity" | "NaN" | boolean }> - readonly type: "boolean" - readonly default?: boolean + type: "boolean" + default?: boolean } | { - readonly key: string - readonly title?: string - readonly description?: string - readonly required?: boolean - readonly when?: ReadonlyArray<{ - readonly key: string - readonly op: "eq" | "neq" - readonly value: string | number | "Infinity" | "-Infinity" | "NaN" | boolean + key: string + title?: string + description?: string + required?: boolean + when?: Array<{ + key: string + op: "eq" | "neq" + value: string | number | "Infinity" | "-Infinity" | "NaN" | boolean }> - readonly type: "multiselect" - readonly options: ReadonlyArray<{ - readonly value: string - readonly label: string - readonly description?: string - }> - readonly minItems?: number - readonly maxItems?: number - readonly custom?: boolean - readonly default?: ReadonlyArray + type: "multiselect" + options: Array<{ value: string; label: string; description?: string }> + minItems?: number + maxItems?: number + custom?: boolean + default?: Array } > } - | { - readonly id: string - readonly sessionID: string - readonly title: string - readonly metadata?: { readonly [x: string]: JsonValue } - readonly mode: "url" - readonly url: string - } + | { id: string; sessionID: string; title: string; metadata?: { [x: string]: JsonValue }; mode: "url"; url: string } > } export type FormListInput = { readonly sessionID: { readonly sessionID: string }["sessionID"] } export type FormListOutput = { - readonly data: ReadonlyArray< + data: Array< | { - readonly id: string - readonly sessionID: string - readonly title: string - readonly metadata?: { readonly [x: string]: JsonValue } - readonly mode: "form" - readonly fields: ReadonlyArray< + id: string + sessionID: string + title: string + metadata?: { [x: string]: JsonValue } + mode: "form" + fields: Array< | { - readonly key: string - readonly title?: string - readonly description?: string - readonly required?: boolean - readonly when?: ReadonlyArray<{ - readonly key: string - readonly op: "eq" | "neq" - readonly value: string | number | "Infinity" | "-Infinity" | "NaN" | boolean + key: string + title?: string + description?: string + required?: boolean + when?: Array<{ + key: string + op: "eq" | "neq" + value: string | number | "Infinity" | "-Infinity" | "NaN" | boolean }> - readonly type: "string" - readonly format?: "email" | "uri" | "date" | "date-time" - readonly minLength?: number - readonly maxLength?: number - readonly pattern?: string - readonly placeholder?: string - readonly default?: string - readonly options?: ReadonlyArray<{ - readonly value: string - readonly label: string - readonly description?: string - }> - readonly custom?: boolean + type: "string" + format?: "email" | "uri" | "date" | "date-time" + minLength?: number + maxLength?: number + pattern?: string + placeholder?: string + default?: string + options?: Array<{ value: string; label: string; description?: string }> + custom?: boolean } | { - readonly key: string - readonly title?: string - readonly description?: string - readonly required?: boolean - readonly when?: ReadonlyArray<{ - readonly key: string - readonly op: "eq" | "neq" - readonly value: string | number | "Infinity" | "-Infinity" | "NaN" | boolean + key: string + title?: string + description?: string + required?: boolean + when?: Array<{ + key: string + op: "eq" | "neq" + value: string | number | "Infinity" | "-Infinity" | "NaN" | boolean }> - readonly type: "number" - readonly minimum?: number | "Infinity" | "-Infinity" | "NaN" - readonly maximum?: number | "Infinity" | "-Infinity" | "NaN" - readonly default?: number | "Infinity" | "-Infinity" | "NaN" + type: "number" + minimum?: number | "Infinity" | "-Infinity" | "NaN" + maximum?: number | "Infinity" | "-Infinity" | "NaN" + default?: number | "Infinity" | "-Infinity" | "NaN" } | { - readonly key: string - readonly title?: string - readonly description?: string - readonly required?: boolean - readonly when?: ReadonlyArray<{ - readonly key: string - readonly op: "eq" | "neq" - readonly value: string | number | "Infinity" | "-Infinity" | "NaN" | boolean + key: string + title?: string + description?: string + required?: boolean + when?: Array<{ + key: string + op: "eq" | "neq" + value: string | number | "Infinity" | "-Infinity" | "NaN" | boolean }> - readonly type: "integer" - readonly minimum?: number | "Infinity" | "-Infinity" | "NaN" - readonly maximum?: number | "Infinity" | "-Infinity" | "NaN" - readonly default?: number | "Infinity" | "-Infinity" | "NaN" + type: "integer" + minimum?: number | "Infinity" | "-Infinity" | "NaN" + maximum?: number | "Infinity" | "-Infinity" | "NaN" + default?: number | "Infinity" | "-Infinity" | "NaN" } | { - readonly key: string - readonly title?: string - readonly description?: string - readonly required?: boolean - readonly when?: ReadonlyArray<{ - readonly key: string - readonly op: "eq" | "neq" - readonly value: string | number | "Infinity" | "-Infinity" | "NaN" | boolean + key: string + title?: string + description?: string + required?: boolean + when?: Array<{ + key: string + op: "eq" | "neq" + value: string | number | "Infinity" | "-Infinity" | "NaN" | boolean }> - readonly type: "boolean" - readonly default?: boolean + type: "boolean" + default?: boolean } | { - readonly key: string - readonly title?: string - readonly description?: string - readonly required?: boolean - readonly when?: ReadonlyArray<{ - readonly key: string - readonly op: "eq" | "neq" - readonly value: string | number | "Infinity" | "-Infinity" | "NaN" | boolean + key: string + title?: string + description?: string + required?: boolean + when?: Array<{ + key: string + op: "eq" | "neq" + value: string | number | "Infinity" | "-Infinity" | "NaN" | boolean }> - readonly type: "multiselect" - readonly options: ReadonlyArray<{ - readonly value: string - readonly label: string - readonly description?: string - }> - readonly minItems?: number - readonly maxItems?: number - readonly custom?: boolean - readonly default?: ReadonlyArray + type: "multiselect" + options: Array<{ value: string; label: string; description?: string }> + minItems?: number + maxItems?: number + custom?: boolean + default?: Array } > } - | { - readonly id: string - readonly sessionID: string - readonly title: string - readonly metadata?: { readonly [x: string]: JsonValue } - readonly mode: "url" - readonly url: string - } + | { id: string; sessionID: string; title: string; metadata?: { [x: string]: JsonValue }; mode: "url"; url: string } > }["data"] @@ -3508,112 +3173,97 @@ export type FormCreateInput = { } export type FormCreateOutput = { - readonly data: + data: | { - readonly id: string - readonly sessionID: string - readonly title: string - readonly metadata?: { readonly [x: string]: JsonValue } - readonly mode: "form" - readonly fields: ReadonlyArray< + id: string + sessionID: string + title: string + metadata?: { [x: string]: JsonValue } + mode: "form" + fields: Array< | { - readonly key: string - readonly title?: string - readonly description?: string - readonly required?: boolean - readonly when?: ReadonlyArray<{ - readonly key: string - readonly op: "eq" | "neq" - readonly value: string | number | "Infinity" | "-Infinity" | "NaN" | boolean + key: string + title?: string + description?: string + required?: boolean + when?: Array<{ + key: string + op: "eq" | "neq" + value: string | number | "Infinity" | "-Infinity" | "NaN" | boolean }> - readonly type: "string" - readonly format?: "email" | "uri" | "date" | "date-time" - readonly minLength?: number - readonly maxLength?: number - readonly pattern?: string - readonly placeholder?: string - readonly default?: string - readonly options?: ReadonlyArray<{ - readonly value: string - readonly label: string - readonly description?: string - }> - readonly custom?: boolean + type: "string" + format?: "email" | "uri" | "date" | "date-time" + minLength?: number + maxLength?: number + pattern?: string + placeholder?: string + default?: string + options?: Array<{ value: string; label: string; description?: string }> + custom?: boolean } | { - readonly key: string - readonly title?: string - readonly description?: string - readonly required?: boolean - readonly when?: ReadonlyArray<{ - readonly key: string - readonly op: "eq" | "neq" - readonly value: string | number | "Infinity" | "-Infinity" | "NaN" | boolean + key: string + title?: string + description?: string + required?: boolean + when?: Array<{ + key: string + op: "eq" | "neq" + value: string | number | "Infinity" | "-Infinity" | "NaN" | boolean }> - readonly type: "number" - readonly minimum?: number | "Infinity" | "-Infinity" | "NaN" - readonly maximum?: number | "Infinity" | "-Infinity" | "NaN" - readonly default?: number | "Infinity" | "-Infinity" | "NaN" + type: "number" + minimum?: number | "Infinity" | "-Infinity" | "NaN" + maximum?: number | "Infinity" | "-Infinity" | "NaN" + default?: number | "Infinity" | "-Infinity" | "NaN" } | { - readonly key: string - readonly title?: string - readonly description?: string - readonly required?: boolean - readonly when?: ReadonlyArray<{ - readonly key: string - readonly op: "eq" | "neq" - readonly value: string | number | "Infinity" | "-Infinity" | "NaN" | boolean + key: string + title?: string + description?: string + required?: boolean + when?: Array<{ + key: string + op: "eq" | "neq" + value: string | number | "Infinity" | "-Infinity" | "NaN" | boolean }> - readonly type: "integer" - readonly minimum?: number | "Infinity" | "-Infinity" | "NaN" - readonly maximum?: number | "Infinity" | "-Infinity" | "NaN" - readonly default?: number | "Infinity" | "-Infinity" | "NaN" + type: "integer" + minimum?: number | "Infinity" | "-Infinity" | "NaN" + maximum?: number | "Infinity" | "-Infinity" | "NaN" + default?: number | "Infinity" | "-Infinity" | "NaN" } | { - readonly key: string - readonly title?: string - readonly description?: string - readonly required?: boolean - readonly when?: ReadonlyArray<{ - readonly key: string - readonly op: "eq" | "neq" - readonly value: string | number | "Infinity" | "-Infinity" | "NaN" | boolean + key: string + title?: string + description?: string + required?: boolean + when?: Array<{ + key: string + op: "eq" | "neq" + value: string | number | "Infinity" | "-Infinity" | "NaN" | boolean }> - readonly type: "boolean" - readonly default?: boolean + type: "boolean" + default?: boolean } | { - readonly key: string - readonly title?: string - readonly description?: string - readonly required?: boolean - readonly when?: ReadonlyArray<{ - readonly key: string - readonly op: "eq" | "neq" - readonly value: string | number | "Infinity" | "-Infinity" | "NaN" | boolean + key: string + title?: string + description?: string + required?: boolean + when?: Array<{ + key: string + op: "eq" | "neq" + value: string | number | "Infinity" | "-Infinity" | "NaN" | boolean }> - readonly type: "multiselect" - readonly options: ReadonlyArray<{ - readonly value: string - readonly label: string - readonly description?: string - }> - readonly minItems?: number - readonly maxItems?: number - readonly custom?: boolean - readonly default?: ReadonlyArray + type: "multiselect" + options: Array<{ value: string; label: string; description?: string }> + minItems?: number + maxItems?: number + custom?: boolean + default?: Array } > } - | { - readonly id: string - readonly sessionID: string - readonly title: string - readonly metadata?: { readonly [x: string]: JsonValue } - readonly mode: "url" - readonly url: string - } + | { id: string; sessionID: string; title: string; metadata?: { [x: string]: JsonValue }; mode: "url"; url: string } }["data"] export type FormGetInput = { @@ -3622,112 +3272,97 @@ export type FormGetInput = { } export type FormGetOutput = { - readonly data: + data: | { - readonly id: string - readonly sessionID: string - readonly title: string - readonly metadata?: { readonly [x: string]: JsonValue } - readonly mode: "form" - readonly fields: ReadonlyArray< + id: string + sessionID: string + title: string + metadata?: { [x: string]: JsonValue } + mode: "form" + fields: Array< | { - readonly key: string - readonly title?: string - readonly description?: string - readonly required?: boolean - readonly when?: ReadonlyArray<{ - readonly key: string - readonly op: "eq" | "neq" - readonly value: string | number | "Infinity" | "-Infinity" | "NaN" | boolean + key: string + title?: string + description?: string + required?: boolean + when?: Array<{ + key: string + op: "eq" | "neq" + value: string | number | "Infinity" | "-Infinity" | "NaN" | boolean }> - readonly type: "string" - readonly format?: "email" | "uri" | "date" | "date-time" - readonly minLength?: number - readonly maxLength?: number - readonly pattern?: string - readonly placeholder?: string - readonly default?: string - readonly options?: ReadonlyArray<{ - readonly value: string - readonly label: string - readonly description?: string - }> - readonly custom?: boolean + type: "string" + format?: "email" | "uri" | "date" | "date-time" + minLength?: number + maxLength?: number + pattern?: string + placeholder?: string + default?: string + options?: Array<{ value: string; label: string; description?: string }> + custom?: boolean } | { - readonly key: string - readonly title?: string - readonly description?: string - readonly required?: boolean - readonly when?: ReadonlyArray<{ - readonly key: string - readonly op: "eq" | "neq" - readonly value: string | number | "Infinity" | "-Infinity" | "NaN" | boolean + key: string + title?: string + description?: string + required?: boolean + when?: Array<{ + key: string + op: "eq" | "neq" + value: string | number | "Infinity" | "-Infinity" | "NaN" | boolean }> - readonly type: "number" - readonly minimum?: number | "Infinity" | "-Infinity" | "NaN" - readonly maximum?: number | "Infinity" | "-Infinity" | "NaN" - readonly default?: number | "Infinity" | "-Infinity" | "NaN" + type: "number" + minimum?: number | "Infinity" | "-Infinity" | "NaN" + maximum?: number | "Infinity" | "-Infinity" | "NaN" + default?: number | "Infinity" | "-Infinity" | "NaN" } | { - readonly key: string - readonly title?: string - readonly description?: string - readonly required?: boolean - readonly when?: ReadonlyArray<{ - readonly key: string - readonly op: "eq" | "neq" - readonly value: string | number | "Infinity" | "-Infinity" | "NaN" | boolean + key: string + title?: string + description?: string + required?: boolean + when?: Array<{ + key: string + op: "eq" | "neq" + value: string | number | "Infinity" | "-Infinity" | "NaN" | boolean }> - readonly type: "integer" - readonly minimum?: number | "Infinity" | "-Infinity" | "NaN" - readonly maximum?: number | "Infinity" | "-Infinity" | "NaN" - readonly default?: number | "Infinity" | "-Infinity" | "NaN" + type: "integer" + minimum?: number | "Infinity" | "-Infinity" | "NaN" + maximum?: number | "Infinity" | "-Infinity" | "NaN" + default?: number | "Infinity" | "-Infinity" | "NaN" } | { - readonly key: string - readonly title?: string - readonly description?: string - readonly required?: boolean - readonly when?: ReadonlyArray<{ - readonly key: string - readonly op: "eq" | "neq" - readonly value: string | number | "Infinity" | "-Infinity" | "NaN" | boolean + key: string + title?: string + description?: string + required?: boolean + when?: Array<{ + key: string + op: "eq" | "neq" + value: string | number | "Infinity" | "-Infinity" | "NaN" | boolean }> - readonly type: "boolean" - readonly default?: boolean + type: "boolean" + default?: boolean } | { - readonly key: string - readonly title?: string - readonly description?: string - readonly required?: boolean - readonly when?: ReadonlyArray<{ - readonly key: string - readonly op: "eq" | "neq" - readonly value: string | number | "Infinity" | "-Infinity" | "NaN" | boolean + key: string + title?: string + description?: string + required?: boolean + when?: Array<{ + key: string + op: "eq" | "neq" + value: string | number | "Infinity" | "-Infinity" | "NaN" | boolean }> - readonly type: "multiselect" - readonly options: ReadonlyArray<{ - readonly value: string - readonly label: string - readonly description?: string - }> - readonly minItems?: number - readonly maxItems?: number - readonly custom?: boolean - readonly default?: ReadonlyArray + type: "multiselect" + options: Array<{ value: string; label: string; description?: string }> + minItems?: number + maxItems?: number + custom?: boolean + default?: Array } > } - | { - readonly id: string - readonly sessionID: string - readonly title: string - readonly metadata?: { readonly [x: string]: JsonValue } - readonly mode: "url" - readonly url: string - } + | { id: string; sessionID: string; title: string; metadata?: { [x: string]: JsonValue }; mode: "url"; url: string } }["data"] export type FormStateInput = { @@ -3736,13 +3371,10 @@ export type FormStateInput = { } export type FormStateOutput = { - readonly data: - | { readonly status: "pending" } - | { - readonly status: "answered" - readonly answer: { readonly [x: string]: string | number | boolean | ReadonlyArray } - } - | { readonly status: "cancelled" } + data: + | { status: "pending" } + | { status: "answered"; answer: { [x: string]: string | number | boolean | Array } } + | { status: "cancelled" } }["data"] export type FormReplyInput = { @@ -3769,31 +3401,22 @@ export type PermissionRequestListInput = { } export type PermissionRequestListOutput = { - readonly location: { - readonly directory: string - readonly workspaceID?: string - readonly project: { readonly id: string; readonly directory: string } - } - readonly data: ReadonlyArray<{ - readonly id: string - readonly sessionID: string - readonly action: string - readonly resources: ReadonlyArray - readonly save?: ReadonlyArray - readonly metadata?: { readonly [x: string]: JsonValue } - readonly source?: { readonly type: "tool"; readonly messageID: string; readonly callID: string } + location: { directory: string; workspaceID?: string; project: { id: string; directory: string } } + data: Array<{ + id: string + sessionID: string + action: string + resources: Array + save?: Array + metadata?: { [x: string]: JsonValue } + source?: { type: "tool"; messageID: string; callID: string } }> } export type PermissionSavedListInput = { readonly projectID?: { readonly projectID?: string | undefined }["projectID"] } export type PermissionSavedListOutput = { - readonly data: ReadonlyArray<{ - readonly id: string - readonly projectID: string - readonly action: string - readonly resource: string - }> + data: Array<{ id: string; projectID: string; action: string; resource: string }> }["data"] export type PermissionSavedRemoveInput = { readonly id: { readonly id: string }["id"] } @@ -3867,21 +3490,19 @@ export type PermissionCreateInput = { }["agent"] } -export type PermissionCreateOutput = { - readonly data: { readonly id: string; readonly effect: "allow" | "deny" | "ask" } -}["data"] +export type PermissionCreateOutput = { data: { id: string; effect: "allow" | "deny" | "ask" } }["data"] export type PermissionListInput = { readonly sessionID: { readonly sessionID: string }["sessionID"] } export type PermissionListOutput = { - readonly data: ReadonlyArray<{ - readonly id: string - readonly sessionID: string - readonly action: string - readonly resources: ReadonlyArray - readonly save?: ReadonlyArray - readonly metadata?: { readonly [x: string]: JsonValue } - readonly source?: { readonly type: "tool"; readonly messageID: string; readonly callID: string } + data: Array<{ + id: string + sessionID: string + action: string + resources: Array + save?: Array + metadata?: { [x: string]: JsonValue } + source?: { type: "tool"; messageID: string; callID: string } }> }["data"] @@ -3891,14 +3512,14 @@ export type PermissionGetInput = { } export type PermissionGetOutput = { - readonly data: { - readonly id: string - readonly sessionID: string - readonly action: string - readonly resources: ReadonlyArray - readonly save?: ReadonlyArray - readonly metadata?: { readonly [x: string]: JsonValue } - readonly source?: { readonly type: "tool"; readonly messageID: string; readonly callID: string } + data: { + id: string + sessionID: string + action: string + resources: Array + save?: Array + metadata?: { [x: string]: JsonValue } + source?: { type: "tool"; messageID: string; callID: string } } }["data"] @@ -3932,12 +3553,8 @@ export type FileListInput = { } export type FileListOutput = { - readonly location: { - readonly directory: string - readonly workspaceID?: string - readonly project: { readonly id: string; readonly directory: string } - } - readonly data: ReadonlyArray<{ readonly path: string; readonly type: "file" | "directory" }> + location: { directory: string; workspaceID?: string; project: { id: string; directory: string } } + data: Array<{ path: string; type: "file" | "directory" }> } export type FileFindInput = { @@ -3968,12 +3585,8 @@ export type FileFindInput = { } export type FileFindOutput = { - readonly location: { - readonly directory: string - readonly workspaceID?: string - readonly project: { readonly id: string; readonly directory: string } - } - readonly data: ReadonlyArray<{ readonly path: string; readonly type: "file" | "directory" }> + location: { directory: string; workspaceID?: string; project: { id: string; directory: string } } + data: Array<{ path: string; type: "file" | "directory" }> } export type CommandListInput = { @@ -3983,18 +3596,14 @@ export type CommandListInput = { } export type CommandListOutput = { - readonly location: { - readonly directory: string - readonly workspaceID?: string - readonly project: { readonly id: string; readonly directory: string } - } - readonly data: ReadonlyArray<{ - readonly name: string - readonly template: string - readonly description?: string - readonly agent?: string - readonly model?: { readonly id: string; readonly providerID: string; readonly variant?: string } - readonly subtask?: boolean + location: { directory: string; workspaceID?: string; project: { id: string; directory: string } } + data: Array<{ + name: string + template: string + description?: string + agent?: string + model?: { id: string; providerID: string; variant?: string } + subtask?: boolean }> } @@ -4005,510 +3614,402 @@ export type SkillListInput = { } export type SkillListOutput = { - readonly location: { - readonly directory: string - readonly workspaceID?: string - readonly project: { readonly id: string; readonly directory: string } - } - readonly data: ReadonlyArray<{ - readonly id: string - readonly name: string - readonly description?: string - readonly slash?: boolean - readonly autoinvoke?: boolean - readonly location: string - readonly content: string + location: { directory: string; workspaceID?: string; project: { id: string; directory: string } } + data: Array<{ + id: string + name: string + description?: string + slash?: boolean + autoinvoke?: boolean + location: string + content: string }> } export type EventSubscribeOutput = | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "models-dev.refreshed" - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: {} + id: string + created: number + metadata?: { [x: string]: unknown } + type: "models-dev.refreshed" + location?: { directory: string; workspaceID?: string } + data: {} } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "integration.updated" - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: {} + id: string + created: number + metadata?: { [x: string]: unknown } + type: "integration.updated" + location?: { directory: string; workspaceID?: string } + data: {} } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "integration.connection.updated" - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { readonly integrationID: string } + id: string + created: number + metadata?: { [x: string]: unknown } + type: "integration.connection.updated" + location?: { directory: string; workspaceID?: string } + data: { integrationID: string } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "catalog.updated" - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: {} + id: string + created: number + metadata?: { [x: string]: unknown } + type: "catalog.updated" + location?: { directory: string; workspaceID?: string } + data: {} } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "agent.updated" - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: {} + id: string + created: number + metadata?: { [x: string]: unknown } + type: "agent.updated" + location?: { directory: string; workspaceID?: string } + data: {} } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "session.created" - readonly durable: { readonly aggregateID: string; readonly seq: number; readonly version: 1 } - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { - readonly sessionID: string - readonly info: { - readonly id: string - readonly slug: string - readonly projectID: string - readonly workspaceID?: string - readonly directory: string - readonly path?: string - readonly parentID?: string - readonly summary?: { - readonly additions: number - readonly deletions: number - readonly files: number - readonly diffs?: ReadonlyArray<{ - readonly file?: string - readonly patch?: string - readonly additions: number - readonly deletions: number - readonly status?: "added" | "deleted" | "modified" + id: string + created: number + metadata?: { [x: string]: unknown } + type: "session.created" + durable: { aggregateID: string; seq: number; version: 1 } + location?: { directory: string; workspaceID?: string } + data: { + sessionID: string + info: { + id: string + slug: string + projectID: string + workspaceID?: string + directory: string + path?: string + parentID?: string + summary?: { + additions: number + deletions: number + files: number + diffs?: Array<{ + file?: string + patch?: string + additions: number + deletions: number + status?: "added" | "deleted" | "modified" }> } - readonly cost?: number - readonly tokens?: { - readonly input: number - readonly output: number - readonly reasoning: number - readonly cache: { readonly read: number; readonly write: number } - } - readonly share?: { readonly url: string } - readonly title: string - readonly agent?: string - readonly model?: { readonly id: string; readonly providerID: string; readonly variant?: string } - readonly version: string - readonly metadata?: { readonly [x: string]: any } - readonly time: { - readonly created: number - readonly updated: number - readonly compacting?: number - readonly archived?: number - } - readonly permission?: ReadonlyArray<{ - readonly permission: string - readonly pattern: string - readonly action: "allow" | "deny" | "ask" - }> - readonly revert?: { - readonly messageID: string - readonly partID?: string - readonly snapshot?: string - readonly diff?: string - } + cost?: number + tokens?: { input: number; output: number; reasoning: number; cache: { read: number; write: number } } + share?: { url: string } + title: string + agent?: string + model?: { id: string; providerID: string; variant?: string } + version: string + metadata?: { [x: string]: any } + time: { created: number; updated: number; compacting?: number; archived?: number } + permission?: Array<{ permission: string; pattern: string; action: "allow" | "deny" | "ask" }> + revert?: { messageID: string; partID?: string; snapshot?: string; diff?: string } } } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "session.updated" - readonly durable: { readonly aggregateID: string; readonly seq: number; readonly version: 1 } - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { - readonly sessionID: string - readonly info: { - readonly id: string - readonly slug: string - readonly projectID: string - readonly workspaceID?: string - readonly directory: string - readonly path?: string - readonly parentID?: string - readonly summary?: { - readonly additions: number - readonly deletions: number - readonly files: number - readonly diffs?: ReadonlyArray<{ - readonly file?: string - readonly patch?: string - readonly additions: number - readonly deletions: number - readonly status?: "added" | "deleted" | "modified" + id: string + created: number + metadata?: { [x: string]: unknown } + type: "session.updated" + durable: { aggregateID: string; seq: number; version: 1 } + location?: { directory: string; workspaceID?: string } + data: { + sessionID: string + info: { + id: string + slug: string + projectID: string + workspaceID?: string + directory: string + path?: string + parentID?: string + summary?: { + additions: number + deletions: number + files: number + diffs?: Array<{ + file?: string + patch?: string + additions: number + deletions: number + status?: "added" | "deleted" | "modified" }> } - readonly cost?: number - readonly tokens?: { - readonly input: number - readonly output: number - readonly reasoning: number - readonly cache: { readonly read: number; readonly write: number } - } - readonly share?: { readonly url: string } - readonly title: string - readonly agent?: string - readonly model?: { readonly id: string; readonly providerID: string; readonly variant?: string } - readonly version: string - readonly metadata?: { readonly [x: string]: any } - readonly time: { - readonly created: number - readonly updated: number - readonly compacting?: number - readonly archived?: number - } - readonly permission?: ReadonlyArray<{ - readonly permission: string - readonly pattern: string - readonly action: "allow" | "deny" | "ask" - }> - readonly revert?: { - readonly messageID: string - readonly partID?: string - readonly snapshot?: string - readonly diff?: string - } + cost?: number + tokens?: { input: number; output: number; reasoning: number; cache: { read: number; write: number } } + share?: { url: string } + title: string + agent?: string + model?: { id: string; providerID: string; variant?: string } + version: string + metadata?: { [x: string]: any } + time: { created: number; updated: number; compacting?: number; archived?: number } + permission?: Array<{ permission: string; pattern: string; action: "allow" | "deny" | "ask" }> + revert?: { messageID: string; partID?: string; snapshot?: string; diff?: string } } } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "session.deleted" - readonly durable: { readonly aggregateID: string; readonly seq: number; readonly version: 1 } - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { - readonly sessionID: string - readonly info: { - readonly id: string - readonly slug: string - readonly projectID: string - readonly workspaceID?: string - readonly directory: string - readonly path?: string - readonly parentID?: string - readonly summary?: { - readonly additions: number - readonly deletions: number - readonly files: number - readonly diffs?: ReadonlyArray<{ - readonly file?: string - readonly patch?: string - readonly additions: number - readonly deletions: number - readonly status?: "added" | "deleted" | "modified" + id: string + created: number + metadata?: { [x: string]: unknown } + type: "session.deleted" + durable: { aggregateID: string; seq: number; version: 1 } + location?: { directory: string; workspaceID?: string } + data: { + sessionID: string + info: { + id: string + slug: string + projectID: string + workspaceID?: string + directory: string + path?: string + parentID?: string + summary?: { + additions: number + deletions: number + files: number + diffs?: Array<{ + file?: string + patch?: string + additions: number + deletions: number + status?: "added" | "deleted" | "modified" }> } - readonly cost?: number - readonly tokens?: { - readonly input: number - readonly output: number - readonly reasoning: number - readonly cache: { readonly read: number; readonly write: number } - } - readonly share?: { readonly url: string } - readonly title: string - readonly agent?: string - readonly model?: { readonly id: string; readonly providerID: string; readonly variant?: string } - readonly version: string - readonly metadata?: { readonly [x: string]: any } - readonly time: { - readonly created: number - readonly updated: number - readonly compacting?: number - readonly archived?: number - } - readonly permission?: ReadonlyArray<{ - readonly permission: string - readonly pattern: string - readonly action: "allow" | "deny" | "ask" - }> - readonly revert?: { - readonly messageID: string - readonly partID?: string - readonly snapshot?: string - readonly diff?: string - } + cost?: number + tokens?: { input: number; output: number; reasoning: number; cache: { read: number; write: number } } + share?: { url: string } + title: string + agent?: string + model?: { id: string; providerID: string; variant?: string } + version: string + metadata?: { [x: string]: any } + time: { created: number; updated: number; compacting?: number; archived?: number } + permission?: Array<{ permission: string; pattern: string; action: "allow" | "deny" | "ask" }> + revert?: { messageID: string; partID?: string; snapshot?: string; diff?: string } } } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "message.updated" - readonly durable: { readonly aggregateID: string; readonly seq: number; readonly version: 1 } - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { - readonly sessionID: string - readonly info: + id: string + created: number + metadata?: { [x: string]: unknown } + type: "message.updated" + durable: { aggregateID: string; seq: number; version: 1 } + location?: { directory: string; workspaceID?: string } + data: { + sessionID: string + info: | { - readonly id: string - readonly sessionID: string - readonly role: "user" - readonly time: { readonly created: number } - readonly format?: + id: string + sessionID: string + role: "user" + time: { created: number } + format?: | ( - | { readonly type: "text" } - | { - readonly type: "json_schema" - readonly schema: { readonly [x: string]: any } - readonly retryCount?: number | undefined | undefined - } + | { type: "text" } + | { type: "json_schema"; schema: { [x: string]: any }; retryCount?: number | undefined | undefined } ) | undefined - readonly summary?: + summary?: | { - readonly title?: string | undefined - readonly body?: string | undefined - readonly diffs: ReadonlyArray<{ - readonly file?: string - readonly patch?: string - readonly additions: number - readonly deletions: number - readonly status?: "added" | "deleted" | "modified" + title?: string | undefined + body?: string | undefined + diffs: Array<{ + file?: string + patch?: string + additions: number + deletions: number + status?: "added" | "deleted" | "modified" }> } | undefined - readonly agent: string - readonly model: { - readonly providerID: string - readonly modelID: string - readonly variant?: string | undefined - } - readonly system?: string | undefined - readonly tools?: { readonly [x: string]: boolean } | undefined + agent: string + model: { providerID: string; modelID: string; variant?: string | undefined } + system?: string | undefined + tools?: { [x: string]: boolean } | undefined } | { - readonly id: string - readonly sessionID: string - readonly role: "assistant" - readonly time: { readonly created: number; readonly completed?: number | undefined } - readonly error?: + id: string + sessionID: string + role: "assistant" + time: { created: number; completed?: number | undefined } + error?: + | { name: "ProviderAuthError"; data: { providerID: string; message: string } } + | { name: "UnknownError"; data: { message: string; ref?: string | undefined } } + | { name: "MessageOutputLengthError"; data: {} } + | { name: "MessageAbortedError"; data: { message: string } } + | { name: "StructuredOutputError"; data: { message: string; retries: number } } + | { name: "ContextOverflowError"; data: { message: string; responseBody?: string | undefined } } + | { name: "ContentFilterError"; data: { message: string } } | { - readonly name: "ProviderAuthError" - readonly data: { readonly providerID: string; readonly message: string } - } - | { - readonly name: "UnknownError" - readonly data: { readonly message: string; readonly ref?: string | undefined } - } - | { readonly name: "MessageOutputLengthError"; readonly data: {} } - | { readonly name: "MessageAbortedError"; readonly data: { readonly message: string } } - | { - readonly name: "StructuredOutputError" - readonly data: { readonly message: string; readonly retries: number } - } - | { - readonly name: "ContextOverflowError" - readonly data: { readonly message: string; readonly responseBody?: string | undefined } - } - | { readonly name: "ContentFilterError"; readonly data: { readonly message: string } } - | { - readonly name: "APIError" - readonly data: { - readonly message: string - readonly statusCode?: number | undefined - readonly isRetryable: boolean - readonly responseHeaders?: { readonly [x: string]: string } | undefined - readonly responseBody?: string | undefined - readonly metadata?: { readonly [x: string]: string } | undefined + name: "APIError" + data: { + message: string + statusCode?: number | undefined + isRetryable: boolean + responseHeaders?: { [x: string]: string } | undefined + responseBody?: string | undefined + metadata?: { [x: string]: string } | undefined } } | undefined - readonly parentID: string - readonly modelID: string - readonly providerID: string - readonly mode: string - readonly agent: string - readonly path: { readonly cwd: string; readonly root: string } - readonly summary?: boolean | undefined - readonly cost: number - readonly tokens: { - readonly total?: number | undefined - readonly input: number - readonly output: number - readonly reasoning: number - readonly cache: { readonly read: number; readonly write: number } + parentID: string + modelID: string + providerID: string + mode: string + agent: string + path: { cwd: string; root: string } + summary?: boolean | undefined + cost: number + tokens: { + total?: number | undefined + input: number + output: number + reasoning: number + cache: { read: number; write: number } } - readonly structured?: any | undefined - readonly variant?: string | undefined - readonly finish?: string | undefined + structured?: any | undefined + variant?: string | undefined + finish?: string | undefined } } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "message.removed" - readonly durable: { readonly aggregateID: string; readonly seq: number; readonly version: 1 } - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { readonly sessionID: string; readonly messageID: string } + id: string + created: number + metadata?: { [x: string]: unknown } + type: "message.removed" + durable: { aggregateID: string; seq: number; version: 1 } + location?: { directory: string; workspaceID?: string } + data: { sessionID: string; messageID: string } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "message.part.updated" - readonly durable: { readonly aggregateID: string; readonly seq: number; readonly version: 1 } - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { - readonly sessionID: string - readonly part: + id: string + created: number + metadata?: { [x: string]: unknown } + type: "message.part.updated" + durable: { aggregateID: string; seq: number; version: 1 } + location?: { directory: string; workspaceID?: string } + data: { + sessionID: string + part: | { - readonly id: string - readonly sessionID: string - readonly messageID: string - readonly type: "text" - readonly text: string - readonly synthetic?: boolean | undefined - readonly ignored?: boolean | undefined - readonly time?: { readonly start: number; readonly end?: number | undefined } | undefined - readonly metadata?: { readonly [x: string]: any } | undefined + id: string + sessionID: string + messageID: string + type: "text" + text: string + synthetic?: boolean | undefined + ignored?: boolean | undefined + time?: { start: number; end?: number | undefined } | undefined + metadata?: { [x: string]: any } | undefined } | { - readonly id: string - readonly sessionID: string - readonly messageID: string - readonly type: "subtask" - readonly prompt: string - readonly description: string - readonly agent: string - readonly model?: { readonly providerID: string; readonly modelID: string } | undefined - readonly command?: string | undefined + id: string + sessionID: string + messageID: string + type: "subtask" + prompt: string + description: string + agent: string + model?: { providerID: string; modelID: string } | undefined + command?: string | undefined } | { - readonly id: string - readonly sessionID: string - readonly messageID: string - readonly type: "reasoning" - readonly text: string - readonly metadata?: { readonly [x: string]: any } | undefined - readonly time: { readonly start: number; readonly end?: number | undefined } + id: string + sessionID: string + messageID: string + type: "reasoning" + text: string + metadata?: { [x: string]: any } | undefined + time: { start: number; end?: number | undefined } } | { - readonly id: string - readonly sessionID: string - readonly messageID: string - readonly type: "file" - readonly mime: string - readonly filename?: string | undefined - readonly url: string - readonly source?: + id: string + sessionID: string + messageID: string + type: "file" + mime: string + filename?: string | undefined + url: string + source?: | ( + | { text: { value: string; start: number; end: number }; type: "file"; path: string } | { - readonly text: { readonly value: string; readonly start: number; readonly end: number } - readonly type: "file" - readonly path: string + text: { value: string; start: number; end: number } + type: "symbol" + path: string + range: { start: { line: number; character: number }; end: { line: number; character: number } } + name: string + kind: number } | { - readonly text: { readonly value: string; readonly start: number; readonly end: number } - readonly type: "symbol" - readonly path: string - readonly range: { - readonly start: { readonly line: number; readonly character: number } - readonly end: { readonly line: number; readonly character: number } - } - readonly name: string - readonly kind: number - } - | { - readonly text: { readonly value: string; readonly start: number; readonly end: number } - readonly type: "resource" - readonly clientName: string - readonly uri: string + text: { value: string; start: number; end: number } + type: "resource" + clientName: string + uri: string } ) | undefined } | { - readonly id: string - readonly sessionID: string - readonly messageID: string - readonly type: "tool" - readonly callID: string - readonly tool: string - readonly state: - | { readonly status: "pending"; readonly input: { readonly [x: string]: any }; readonly raw: string } + id: string + sessionID: string + messageID: string + type: "tool" + callID: string + tool: string + state: + | { status: "pending"; input: { [x: string]: any }; raw: string } | { - readonly status: "running" - readonly input: { readonly [x: string]: any } - readonly title?: string | undefined - readonly metadata?: { readonly [x: string]: any } | undefined - readonly time: { readonly start: number } + status: "running" + input: { [x: string]: any } + title?: string | undefined + metadata?: { [x: string]: any } | undefined + time: { start: number } } | { - readonly status: "completed" - readonly input: { readonly [x: string]: any } - readonly output: string - readonly title: string - readonly metadata: { readonly [x: string]: any } - readonly time: { - readonly start: number - readonly end: number - readonly compacted?: number | undefined - } - readonly attachments?: - | ReadonlyArray<{ - readonly id: string - readonly sessionID: string - readonly messageID: string - readonly type: "file" - readonly mime: string - readonly filename?: string | undefined - readonly url: string - readonly source?: + status: "completed" + input: { [x: string]: any } + output: string + title: string + metadata: { [x: string]: any } + time: { start: number; end: number; compacted?: number | undefined } + attachments?: + | Array<{ + id: string + sessionID: string + messageID: string + type: "file" + mime: string + filename?: string | undefined + url: string + source?: | ( + | { text: { value: string; start: number; end: number }; type: "file"; path: string } | { - readonly text: { - readonly value: string - readonly start: number - readonly end: number + text: { value: string; start: number; end: number } + type: "symbol" + path: string + range: { + start: { line: number; character: number } + end: { line: number; character: number } } - readonly type: "file" - readonly path: string + name: string + kind: number } | { - readonly text: { - readonly value: string - readonly start: number - readonly end: number - } - readonly type: "symbol" - readonly path: string - readonly range: { - readonly start: { readonly line: number; readonly character: number } - readonly end: { readonly line: number; readonly character: number } - } - readonly name: string - readonly kind: number - } - | { - readonly text: { - readonly value: string - readonly start: number - readonly end: number - } - readonly type: "resource" - readonly clientName: string - readonly uri: string + text: { value: string; start: number; end: number } + type: "resource" + clientName: string + uri: string } ) | undefined @@ -4516,1124 +4017,966 @@ export type EventSubscribeOutput = | undefined } | { - readonly status: "error" - readonly input: { readonly [x: string]: any } - readonly error: string - readonly metadata?: { readonly [x: string]: any } | undefined - readonly time: { readonly start: number; readonly end: number } + status: "error" + input: { [x: string]: any } + error: string + metadata?: { [x: string]: any } | undefined + time: { start: number; end: number } } - readonly metadata?: { readonly [x: string]: any } | undefined + metadata?: { [x: string]: any } | undefined } + | { id: string; sessionID: string; messageID: string; type: "step-start"; snapshot?: string | undefined } | { - readonly id: string - readonly sessionID: string - readonly messageID: string - readonly type: "step-start" - readonly snapshot?: string | undefined - } - | { - readonly id: string - readonly sessionID: string - readonly messageID: string - readonly type: "step-finish" - readonly reason: string - readonly snapshot?: string | undefined - readonly cost: number - readonly tokens: { - readonly total?: number | undefined - readonly input: number - readonly output: number - readonly reasoning: number - readonly cache: { readonly read: number; readonly write: number } + id: string + sessionID: string + messageID: string + type: "step-finish" + reason: string + snapshot?: string | undefined + cost: number + tokens: { + total?: number | undefined + input: number + output: number + reasoning: number + cache: { read: number; write: number } } } + | { id: string; sessionID: string; messageID: string; type: "snapshot"; snapshot: string } + | { id: string; sessionID: string; messageID: string; type: "patch"; hash: string; files: Array } | { - readonly id: string - readonly sessionID: string - readonly messageID: string - readonly type: "snapshot" - readonly snapshot: string + id: string + sessionID: string + messageID: string + type: "agent" + name: string + source?: { value: string; start: number; end: number } | undefined } | { - readonly id: string - readonly sessionID: string - readonly messageID: string - readonly type: "patch" - readonly hash: string - readonly files: ReadonlyArray - } - | { - readonly id: string - readonly sessionID: string - readonly messageID: string - readonly type: "agent" - readonly name: string - readonly source?: { readonly value: string; readonly start: number; readonly end: number } | undefined - } - | { - readonly id: string - readonly sessionID: string - readonly messageID: string - readonly type: "retry" - readonly attempt: number - readonly error: { - readonly name: "APIError" - readonly data: { - readonly message: string - readonly statusCode?: number | undefined - readonly isRetryable: boolean - readonly responseHeaders?: { readonly [x: string]: string } | undefined - readonly responseBody?: string | undefined - readonly metadata?: { readonly [x: string]: string } | undefined + id: string + sessionID: string + messageID: string + type: "retry" + attempt: number + error: { + name: "APIError" + data: { + message: string + statusCode?: number | undefined + isRetryable: boolean + responseHeaders?: { [x: string]: string } | undefined + responseBody?: string | undefined + metadata?: { [x: string]: string } | undefined } } - readonly time: { readonly created: number } + time: { created: number } } | { - readonly id: string - readonly sessionID: string - readonly messageID: string - readonly type: "compaction" - readonly auto: boolean - readonly overflow?: boolean | undefined - readonly tail_start_id?: string | undefined + id: string + sessionID: string + messageID: string + type: "compaction" + auto: boolean + overflow?: boolean | undefined + tail_start_id?: string | undefined } - readonly time: number + time: number } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "message.part.removed" - readonly durable: { readonly aggregateID: string; readonly seq: number; readonly version: 1 } - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { readonly sessionID: string; readonly messageID: string; readonly partID: string } + id: string + created: number + metadata?: { [x: string]: unknown } + type: "message.part.removed" + durable: { aggregateID: string; seq: number; version: 1 } + location?: { directory: string; workspaceID?: string } + data: { sessionID: string; messageID: string; partID: string } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "session.agent.selected" - readonly durable: { readonly aggregateID: string; readonly seq: number; readonly version: 1 } - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { readonly sessionID: string; readonly agent: string } + id: string + created: number + metadata?: { [x: string]: unknown } + type: "session.agent.selected" + durable: { aggregateID: string; seq: number; version: 1 } + location?: { directory: string; workspaceID?: string } + data: { sessionID: string; agent: string } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "session.model.selected" - readonly durable: { readonly aggregateID: string; readonly seq: number; readonly version: 1 } - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { - readonly sessionID: string - readonly model: { readonly id: string; readonly providerID: string; readonly variant?: string } + id: string + created: number + metadata?: { [x: string]: unknown } + type: "session.model.selected" + durable: { aggregateID: string; seq: number; version: 1 } + location?: { directory: string; workspaceID?: string } + data: { sessionID: string; model: { id: string; providerID: string; variant?: string } } + } + | { + id: string + created: number + metadata?: { [x: string]: unknown } + type: "session.moved" + durable: { aggregateID: string; seq: number; version: 1 } + location?: { directory: string; workspaceID?: string } + data: { sessionID: string; location: { directory: string; workspaceID?: string }; subpath?: string } + } + | { + id: string + created: number + metadata?: { [x: string]: unknown } + type: "session.renamed" + durable: { aggregateID: string; seq: number; version: 1 } + location?: { directory: string; workspaceID?: string } + data: { sessionID: string; title: string } + } + | { + id: string + created: number + metadata?: { [x: string]: unknown } + type: "session.usage.updated" + location?: { directory: string; workspaceID?: string } + data: { + sessionID: string + cost: number + tokens: { input: number; output: number; reasoning: number; cache: { read: number; write: number } } } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "session.moved" - readonly durable: { readonly aggregateID: string; readonly seq: number; readonly version: 1 } - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { - readonly sessionID: string - readonly location: { readonly directory: string; readonly workspaceID?: string } - readonly subpath?: string - } + id: string + created: number + metadata?: { [x: string]: unknown } + type: "session.deleted" + durable: { aggregateID: string; seq: number; version: 2 } + location?: { directory: string; workspaceID?: string } + data: { sessionID: string } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "session.renamed" - readonly durable: { readonly aggregateID: string; readonly seq: number; readonly version: 1 } - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { readonly sessionID: string; readonly title: string } + id: string + created: number + metadata?: { [x: string]: unknown } + type: "session.forked" + durable: { aggregateID: string; seq: number; version: 1 } + location?: { directory: string; workspaceID?: string } + data: { sessionID: string; parentID: string; from?: string } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "session.usage.updated" - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { - readonly sessionID: string - readonly cost: number - readonly tokens: { - readonly input: number - readonly output: number - readonly reasoning: number - readonly cache: { readonly read: number; readonly write: number } - } - } + id: string + created: number + metadata?: { [x: string]: unknown } + type: "session.input.promoted" + durable: { aggregateID: string; seq: number; version: 1 } + location?: { directory: string; workspaceID?: string } + data: { sessionID: string; inputID: string } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "session.deleted" - readonly durable: { readonly aggregateID: string; readonly seq: number; readonly version: 2 } - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { readonly sessionID: string } - } - | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "session.forked" - readonly durable: { readonly aggregateID: string; readonly seq: number; readonly version: 1 } - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { readonly sessionID: string; readonly parentID: string; readonly from?: string } - } - | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "session.input.promoted" - readonly durable: { readonly aggregateID: string; readonly seq: number; readonly version: 1 } - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { readonly sessionID: string; readonly inputID: string } - } - | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "session.input.admitted" - readonly durable: { readonly aggregateID: string; readonly seq: number; readonly version: 1 } - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { - readonly sessionID: string - readonly inputID: string - readonly input: + id: string + created: number + metadata?: { [x: string]: unknown } + type: "session.input.admitted" + durable: { aggregateID: string; seq: number; version: 1 } + location?: { directory: string; workspaceID?: string } + data: { + sessionID: string + inputID: string + input: | { - readonly type: "user" - readonly data: { - readonly text: string - readonly files?: ReadonlyArray<{ - readonly data: string - readonly mime: string - readonly source: { readonly type: "inline" } | { readonly type: "uri"; readonly uri: string } - readonly name?: string - readonly description?: string - readonly mention?: { readonly start: number; readonly end: number; readonly text: string } + type: "user" + data: { + text: string + files?: Array<{ + data: string + mime: string + source: { type: "inline" } | { type: "uri"; uri: string } + name?: string + description?: string + mention?: { start: number; end: number; text: string } }> - readonly agents?: ReadonlyArray<{ - readonly name: string - readonly mention?: { readonly start: number; readonly end: number; readonly text: string } - }> - readonly metadata?: { readonly [x: string]: unknown } + agents?: Array<{ name: string; mention?: { start: number; end: number; text: string } }> + metadata?: { [x: string]: unknown } } - readonly delivery: "steer" | "queue" + delivery: "steer" | "queue" } | { - readonly type: "synthetic" - readonly data: { - readonly text: string - readonly description?: string - readonly metadata?: { readonly [x: string]: unknown } - } - readonly delivery: "steer" | "queue" + type: "synthetic" + data: { text: string; description?: string; metadata?: { [x: string]: unknown } } + delivery: "steer" | "queue" } } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "session.execution.started" - readonly durable: { readonly aggregateID: string; readonly seq: number; readonly version: 1 } - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { readonly sessionID: string } + id: string + created: number + metadata?: { [x: string]: unknown } + type: "session.execution.started" + durable: { aggregateID: string; seq: number; version: 1 } + location?: { directory: string; workspaceID?: string } + data: { sessionID: string } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "session.execution.succeeded" - readonly durable: { readonly aggregateID: string; readonly seq: number; readonly version: 1 } - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { readonly sessionID: string } + id: string + created: number + metadata?: { [x: string]: unknown } + type: "session.execution.succeeded" + durable: { aggregateID: string; seq: number; version: 1 } + location?: { directory: string; workspaceID?: string } + data: { sessionID: string } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "session.execution.failed" - readonly durable: { readonly aggregateID: string; readonly seq: number; readonly version: 1 } - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { readonly sessionID: string; readonly error: { readonly type: string; readonly message: string } } + id: string + created: number + metadata?: { [x: string]: unknown } + type: "session.execution.failed" + durable: { aggregateID: string; seq: number; version: 1 } + location?: { directory: string; workspaceID?: string } + data: { sessionID: string; error: { type: string; message: string } } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "session.execution.interrupted" - readonly durable: { readonly aggregateID: string; readonly seq: number; readonly version: 1 } - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { readonly sessionID: string; readonly reason: "user" | "shutdown" | "superseded" } + id: string + created: number + metadata?: { [x: string]: unknown } + type: "session.execution.interrupted" + durable: { aggregateID: string; seq: number; version: 1 } + location?: { directory: string; workspaceID?: string } + data: { sessionID: string; reason: "user" | "shutdown" | "superseded" } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "session.instructions.updated" - readonly durable: { readonly aggregateID: string; readonly seq: number; readonly version: 1 } - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { readonly sessionID: string; readonly text: string } + id: string + created: number + metadata?: { [x: string]: unknown } + type: "session.instructions.updated" + durable: { aggregateID: string; seq: number; version: 1 } + location?: { directory: string; workspaceID?: string } + data: { sessionID: string; text: string } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "session.synthetic" - readonly durable: { readonly aggregateID: string; readonly seq: number; readonly version: 1 } - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { - readonly sessionID: string - readonly text: string - readonly description?: string - readonly metadata?: { readonly [x: string]: unknown } - } + id: string + created: number + metadata?: { [x: string]: unknown } + type: "session.synthetic" + durable: { aggregateID: string; seq: number; version: 1 } + location?: { directory: string; workspaceID?: string } + data: { sessionID: string; text: string; description?: string; metadata?: { [x: string]: unknown } } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "session.skill.activated" - readonly durable: { readonly aggregateID: string; readonly seq: number; readonly version: 1 } - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { readonly sessionID: string; readonly id: string; readonly name: string; readonly text: string } + id: string + created: number + metadata?: { [x: string]: unknown } + type: "session.skill.activated" + durable: { aggregateID: string; seq: number; version: 1 } + location?: { directory: string; workspaceID?: string } + data: { sessionID: string; id: string; name: string; text: string } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "session.shell.started" - readonly durable: { readonly aggregateID: string; readonly seq: number; readonly version: 1 } - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { - readonly sessionID: string - readonly shell: { - readonly id: string - readonly status: "running" | "exited" | "timeout" | "killed" - readonly command: string - readonly cwd: string - readonly shell: string - readonly file: string - readonly pid?: number - readonly exit?: number - readonly metadata: { readonly [x: string]: unknown } - readonly time: { readonly started: number; readonly completed?: number } + id: string + created: number + metadata?: { [x: string]: unknown } + type: "session.shell.started" + durable: { aggregateID: string; seq: number; version: 1 } + location?: { directory: string; workspaceID?: string } + data: { + sessionID: string + shell: { + id: string + status: "running" | "exited" | "timeout" | "killed" + command: string + cwd: string + shell: string + file: string + pid?: number + exit?: number + metadata: { [x: string]: unknown } + time: { started: number; completed?: number } } } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "session.shell.ended" - readonly durable: { readonly aggregateID: string; readonly seq: number; readonly version: 1 } - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { - readonly sessionID: string - readonly shell: { - readonly id: string - readonly status: "running" | "exited" | "timeout" | "killed" - readonly command: string - readonly cwd: string - readonly shell: string - readonly file: string - readonly pid?: number - readonly exit?: number - readonly metadata: { readonly [x: string]: unknown } - readonly time: { readonly started: number; readonly completed?: number } - } - readonly output: { - readonly output: string - readonly cursor: number - readonly size: number - readonly truncated: boolean + id: string + created: number + metadata?: { [x: string]: unknown } + type: "session.shell.ended" + durable: { aggregateID: string; seq: number; version: 1 } + location?: { directory: string; workspaceID?: string } + data: { + sessionID: string + shell: { + id: string + status: "running" | "exited" | "timeout" | "killed" + command: string + cwd: string + shell: string + file: string + pid?: number + exit?: number + metadata: { [x: string]: unknown } + time: { started: number; completed?: number } } + output: { output: string; cursor: number; size: number; truncated: boolean } } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "session.step.started" - readonly durable: { readonly aggregateID: string; readonly seq: number; readonly version: 1 } - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { - readonly sessionID: string - readonly assistantMessageID: string - readonly agent: string - readonly model: { readonly id: string; readonly providerID: string; readonly variant?: string } - readonly snapshot?: string + id: string + created: number + metadata?: { [x: string]: unknown } + type: "session.step.started" + durable: { aggregateID: string; seq: number; version: 1 } + location?: { directory: string; workspaceID?: string } + data: { + sessionID: string + assistantMessageID: string + agent: string + model: { id: string; providerID: string; variant?: string } + snapshot?: string } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "session.step.ended" - readonly durable: { readonly aggregateID: string; readonly seq: number; readonly version: 1 } - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { - readonly sessionID: string - readonly assistantMessageID: string - readonly finish: "stop" | "length" | "tool-calls" | "content-filter" | "error" | "unknown" - readonly cost: number - readonly tokens: { - readonly input: number - readonly output: number - readonly reasoning: number - readonly cache: { readonly read: number; readonly write: number } - } - readonly snapshot?: string - readonly files?: ReadonlyArray + id: string + created: number + metadata?: { [x: string]: unknown } + type: "session.step.ended" + durable: { aggregateID: string; seq: number; version: 1 } + location?: { directory: string; workspaceID?: string } + data: { + sessionID: string + assistantMessageID: string + finish: "stop" | "length" | "tool-calls" | "content-filter" | "error" | "unknown" + cost: number + tokens: { input: number; output: number; reasoning: number; cache: { read: number; write: number } } + snapshot?: string + files?: Array } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "session.step.failed" - readonly durable: { readonly aggregateID: string; readonly seq: number; readonly version: 1 } - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { - readonly sessionID: string - readonly assistantMessageID: string - readonly error: { readonly type: string; readonly message: string } - readonly cost?: number - readonly tokens?: { - readonly input: number - readonly output: number - readonly reasoning: number - readonly cache: { readonly read: number; readonly write: number } - } + id: string + created: number + metadata?: { [x: string]: unknown } + type: "session.step.failed" + durable: { aggregateID: string; seq: number; version: 1 } + location?: { directory: string; workspaceID?: string } + data: { + sessionID: string + assistantMessageID: string + error: { type: string; message: string } + cost?: number + tokens?: { input: number; output: number; reasoning: number; cache: { read: number; write: number } } } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "session.text.started" - readonly durable: { readonly aggregateID: string; readonly seq: number; readonly version: 1 } - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { readonly sessionID: string; readonly assistantMessageID: string; readonly ordinal: number } + id: string + created: number + metadata?: { [x: string]: unknown } + type: "session.text.started" + durable: { aggregateID: string; seq: number; version: 1 } + location?: { directory: string; workspaceID?: string } + data: { sessionID: string; assistantMessageID: string; ordinal: number } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "session.text.delta" - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { - readonly sessionID: string - readonly assistantMessageID: string - readonly ordinal: number - readonly delta: string + id: string + created: number + metadata?: { [x: string]: unknown } + type: "session.text.delta" + location?: { directory: string; workspaceID?: string } + data: { sessionID: string; assistantMessageID: string; ordinal: number; delta: string } + } + | { + id: string + created: number + metadata?: { [x: string]: unknown } + type: "session.text.ended" + durable: { aggregateID: string; seq: number; version: 1 } + location?: { directory: string; workspaceID?: string } + data: { sessionID: string; assistantMessageID: string; ordinal: number; text: string } + } + | { + id: string + created: number + metadata?: { [x: string]: unknown } + type: "session.reasoning.started" + durable: { aggregateID: string; seq: number; version: 1 } + location?: { directory: string; workspaceID?: string } + data: { sessionID: string; assistantMessageID: string; ordinal: number; state?: { [x: string]: unknown } } + } + | { + id: string + created: number + metadata?: { [x: string]: unknown } + type: "session.reasoning.delta" + location?: { directory: string; workspaceID?: string } + data: { sessionID: string; assistantMessageID: string; ordinal: number; delta: string } + } + | { + id: string + created: number + metadata?: { [x: string]: unknown } + type: "session.reasoning.ended" + durable: { aggregateID: string; seq: number; version: 1 } + location?: { directory: string; workspaceID?: string } + data: { + sessionID: string + assistantMessageID: string + ordinal: number + text: string + state?: { [x: string]: unknown } } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "session.text.ended" - readonly durable: { readonly aggregateID: string; readonly seq: number; readonly version: 1 } - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { - readonly sessionID: string - readonly assistantMessageID: string - readonly ordinal: number - readonly text: string + id: string + created: number + metadata?: { [x: string]: unknown } + type: "session.tool.input.started" + durable: { aggregateID: string; seq: number; version: 1 } + location?: { directory: string; workspaceID?: string } + data: { sessionID: string; assistantMessageID: string; callID: string; name: string } + } + | { + id: string + created: number + metadata?: { [x: string]: unknown } + type: "session.tool.input.delta" + location?: { directory: string; workspaceID?: string } + data: { sessionID: string; assistantMessageID: string; callID: string; delta: string } + } + | { + id: string + created: number + metadata?: { [x: string]: unknown } + type: "session.tool.input.ended" + durable: { aggregateID: string; seq: number; version: 1 } + location?: { directory: string; workspaceID?: string } + data: { sessionID: string; assistantMessageID: string; callID: string; text: string } + } + | { + id: string + created: number + metadata?: { [x: string]: unknown } + type: "session.tool.called" + durable: { aggregateID: string; seq: number; version: 1 } + location?: { directory: string; workspaceID?: string } + data: { + sessionID: string + assistantMessageID: string + callID: string + input: { [x: string]: unknown } + executed: boolean + state?: { [x: string]: unknown } } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "session.reasoning.started" - readonly durable: { readonly aggregateID: string; readonly seq: number; readonly version: 1 } - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { - readonly sessionID: string - readonly assistantMessageID: string - readonly ordinal: number - readonly state?: { readonly [x: string]: unknown } + id: string + created: number + metadata?: { [x: string]: unknown } + type: "session.tool.progress" + durable: { aggregateID: string; seq: number; version: 1 } + location?: { directory: string; workspaceID?: string } + data: { + sessionID: string + assistantMessageID: string + callID: string + structured: { [x: string]: unknown } + content: Array<{ type: "text"; text: string } | { type: "file"; uri: string; mime: string; name?: string }> } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "session.reasoning.delta" - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { - readonly sessionID: string - readonly assistantMessageID: string - readonly ordinal: number - readonly delta: string + id: string + created: number + metadata?: { [x: string]: unknown } + type: "session.tool.success" + durable: { aggregateID: string; seq: number; version: 1 } + location?: { directory: string; workspaceID?: string } + data: { + sessionID: string + assistantMessageID: string + callID: string + structured: { [x: string]: unknown } + content: Array<{ type: "text"; text: string } | { type: "file"; uri: string; mime: string; name?: string }> + result?: unknown + executed: boolean + resultState?: { [x: string]: unknown } } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "session.reasoning.ended" - readonly durable: { readonly aggregateID: string; readonly seq: number; readonly version: 1 } - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { - readonly sessionID: string - readonly assistantMessageID: string - readonly ordinal: number - readonly text: string - readonly state?: { readonly [x: string]: unknown } + id: string + created: number + metadata?: { [x: string]: unknown } + type: "session.tool.failed" + durable: { aggregateID: string; seq: number; version: 1 } + location?: { directory: string; workspaceID?: string } + data: { + sessionID: string + assistantMessageID: string + callID: string + error: { type: string; message: string } + result?: unknown + executed: boolean + resultState?: { [x: string]: unknown } } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "session.tool.input.started" - readonly durable: { readonly aggregateID: string; readonly seq: number; readonly version: 1 } - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { - readonly sessionID: string - readonly assistantMessageID: string - readonly callID: string - readonly name: string + id: string + created: number + metadata?: { [x: string]: unknown } + type: "session.retry.scheduled" + durable: { aggregateID: string; seq: number; version: 1 } + location?: { directory: string; workspaceID?: string } + data: { + sessionID: string + assistantMessageID: string + attempt: number + at: number + error: { type: string; message: string } } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "session.tool.input.delta" - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { - readonly sessionID: string - readonly assistantMessageID: string - readonly callID: string - readonly delta: string - } + id: string + created: number + metadata?: { [x: string]: unknown } + type: "session.compaction.admitted" + durable: { aggregateID: string; seq: number; version: 1 } + location?: { directory: string; workspaceID?: string } + data: { sessionID: string; inputID: string } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "session.tool.input.ended" - readonly durable: { readonly aggregateID: string; readonly seq: number; readonly version: 1 } - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { - readonly sessionID: string - readonly assistantMessageID: string - readonly callID: string - readonly text: string - } + id: string + created: number + metadata?: { [x: string]: unknown } + type: "session.compaction.started" + durable: { aggregateID: string; seq: number; version: 1 } + location?: { directory: string; workspaceID?: string } + data: { sessionID: string; reason: "auto" | "manual"; recent: string; inputID?: string } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "session.tool.called" - readonly durable: { readonly aggregateID: string; readonly seq: number; readonly version: 1 } - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { - readonly sessionID: string - readonly assistantMessageID: string - readonly callID: string - readonly input: { readonly [x: string]: unknown } - readonly executed: boolean - readonly state?: { readonly [x: string]: unknown } - } + id: string + created: number + metadata?: { [x: string]: unknown } + type: "session.compaction.delta" + location?: { directory: string; workspaceID?: string } + data: { sessionID: string; text: string } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "session.tool.progress" - readonly durable: { readonly aggregateID: string; readonly seq: number; readonly version: 1 } - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { - readonly sessionID: string - readonly assistantMessageID: string - readonly callID: string - readonly structured: { readonly [x: string]: unknown } - readonly content: ReadonlyArray< - | { readonly type: "text"; readonly text: string } - | { readonly type: "file"; readonly uri: string; readonly mime: string; readonly name?: string } - > - } + id: string + created: number + metadata?: { [x: string]: unknown } + type: "session.compaction.ended" + durable: { aggregateID: string; seq: number; version: 1 } + location?: { directory: string; workspaceID?: string } + data: { sessionID: string; reason: "auto" | "manual"; text: string; recent: string } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "session.tool.success" - readonly durable: { readonly aggregateID: string; readonly seq: number; readonly version: 1 } - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { - readonly sessionID: string - readonly assistantMessageID: string - readonly callID: string - readonly structured: { readonly [x: string]: unknown } - readonly content: ReadonlyArray< - | { readonly type: "text"; readonly text: string } - | { readonly type: "file"; readonly uri: string; readonly mime: string; readonly name?: string } - > - readonly result?: unknown - readonly executed: boolean - readonly resultState?: { readonly [x: string]: unknown } - } + id: string + created: number + metadata?: { [x: string]: unknown } + type: "session.compaction.failed" + durable: { aggregateID: string; seq: number; version: 1 } + location?: { directory: string; workspaceID?: string } + data: { sessionID: string; reason: "auto" | "manual"; error: { type: string; message: string }; inputID?: string } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "session.tool.failed" - readonly durable: { readonly aggregateID: string; readonly seq: number; readonly version: 1 } - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { - readonly sessionID: string - readonly assistantMessageID: string - readonly callID: string - readonly error: { readonly type: string; readonly message: string } - readonly result?: unknown - readonly executed: boolean - readonly resultState?: { readonly [x: string]: unknown } - } - } - | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "session.retry.scheduled" - readonly durable: { readonly aggregateID: string; readonly seq: number; readonly version: 1 } - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { - readonly sessionID: string - readonly assistantMessageID: string - readonly attempt: number - readonly at: number - readonly error: { readonly type: string; readonly message: string } - } - } - | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "session.compaction.admitted" - readonly durable: { readonly aggregateID: string; readonly seq: number; readonly version: 1 } - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { readonly sessionID: string; readonly inputID: string } - } - | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "session.compaction.started" - readonly durable: { readonly aggregateID: string; readonly seq: number; readonly version: 1 } - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { - readonly sessionID: string - readonly reason: "auto" | "manual" - readonly recent: string - readonly inputID?: string - } - } - | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "session.compaction.delta" - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { readonly sessionID: string; readonly text: string } - } - | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "session.compaction.ended" - readonly durable: { readonly aggregateID: string; readonly seq: number; readonly version: 1 } - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { - readonly sessionID: string - readonly reason: "auto" | "manual" - readonly text: string - readonly recent: string - } - } - | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "session.compaction.failed" - readonly durable: { readonly aggregateID: string; readonly seq: number; readonly version: 1 } - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { - readonly sessionID: string - readonly reason: "auto" | "manual" - readonly error: { readonly type: string; readonly message: string } - readonly inputID?: string - } - } - | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "session.revert.staged" - readonly durable: { readonly aggregateID: string; readonly seq: number; readonly version: 1 } - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { - readonly sessionID: string - readonly revert: { - readonly messageID: string - readonly partID?: string - readonly snapshot?: string - readonly files?: ReadonlyArray<{ - readonly file: string - readonly patch: string - readonly additions: number - readonly deletions: number - readonly status: "added" | "deleted" | "modified" + id: string + created: number + metadata?: { [x: string]: unknown } + type: "session.revert.staged" + durable: { aggregateID: string; seq: number; version: 1 } + location?: { directory: string; workspaceID?: string } + data: { + sessionID: string + revert: { + messageID: string + partID?: string + snapshot?: string + files?: Array<{ + file: string + patch: string + additions: number + deletions: number + status: "added" | "deleted" | "modified" }> } } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "session.revert.cleared" - readonly durable: { readonly aggregateID: string; readonly seq: number; readonly version: 1 } - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { readonly sessionID: string } + id: string + created: number + metadata?: { [x: string]: unknown } + type: "session.revert.cleared" + durable: { aggregateID: string; seq: number; version: 1 } + location?: { directory: string; workspaceID?: string } + data: { sessionID: string } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "session.revert.committed" - readonly durable: { readonly aggregateID: string; readonly seq: number; readonly version: 1 } - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { readonly sessionID: string; readonly to: string } + id: string + created: number + metadata?: { [x: string]: unknown } + type: "session.revert.committed" + durable: { aggregateID: string; seq: number; version: 1 } + location?: { directory: string; workspaceID?: string } + data: { sessionID: string; to: string } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "filesystem.changed" - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { readonly file: string; readonly event: "add" | "change" | "unlink" } + id: string + created: number + metadata?: { [x: string]: unknown } + type: "filesystem.changed" + location?: { directory: string; workspaceID?: string } + data: { file: string; event: "add" | "change" | "unlink" } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "reference.updated" - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: {} + id: string + created: number + metadata?: { [x: string]: unknown } + type: "reference.updated" + location?: { directory: string; workspaceID?: string } + data: {} } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "permission.v2.asked" - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { - readonly id: string - readonly sessionID: string - readonly action: string - readonly resources: ReadonlyArray - readonly save?: ReadonlyArray - readonly metadata?: { readonly [x: string]: unknown } - readonly source?: { readonly type: "tool"; readonly messageID: string; readonly callID: string } + id: string + created: number + metadata?: { [x: string]: unknown } + type: "permission.v2.asked" + location?: { directory: string; workspaceID?: string } + data: { + id: string + sessionID: string + action: string + resources: Array + save?: Array + metadata?: { [x: string]: unknown } + source?: { type: "tool"; messageID: string; callID: string } } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "permission.v2.replied" - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { - readonly sessionID: string - readonly requestID: string - readonly reply: "once" | "always" | "reject" - } + id: string + created: number + metadata?: { [x: string]: unknown } + type: "permission.v2.replied" + location?: { directory: string; workspaceID?: string } + data: { sessionID: string; requestID: string; reply: "once" | "always" | "reject" } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "plugin.added" - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { readonly id: string } + id: string + created: number + metadata?: { [x: string]: unknown } + type: "plugin.added" + location?: { directory: string; workspaceID?: string } + data: { id: string } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "plugin.updated" - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: {} + id: string + created: number + metadata?: { [x: string]: unknown } + type: "plugin.updated" + location?: { directory: string; workspaceID?: string } + data: {} } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "project.directories.updated" - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { readonly projectID: string } + id: string + created: number + metadata?: { [x: string]: unknown } + type: "project.directories.updated" + location?: { directory: string; workspaceID?: string } + data: { projectID: string } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "command.updated" - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: {} + id: string + created: number + metadata?: { [x: string]: unknown } + type: "command.updated" + location?: { directory: string; workspaceID?: string } + data: {} } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "config.updated" - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: {} + id: string + created: number + metadata?: { [x: string]: unknown } + type: "config.updated" + location?: { directory: string; workspaceID?: string } + data: {} } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "skill.updated" - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: {} + id: string + created: number + metadata?: { [x: string]: unknown } + type: "skill.updated" + location?: { directory: string; workspaceID?: string } + data: {} } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "pty.created" - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { - readonly info: { - readonly id: string - readonly title: string - readonly command: string - readonly args: ReadonlyArray - readonly cwd: string - readonly status: "running" | "exited" - readonly pid: number - readonly exitCode?: number + id: string + created: number + metadata?: { [x: string]: unknown } + type: "pty.created" + location?: { directory: string; workspaceID?: string } + data: { + info: { + id: string + title: string + command: string + args: Array + cwd: string + status: "running" | "exited" + pid: number + exitCode?: number } } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "pty.updated" - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { - readonly info: { - readonly id: string - readonly title: string - readonly command: string - readonly args: ReadonlyArray - readonly cwd: string - readonly status: "running" | "exited" - readonly pid: number - readonly exitCode?: number + id: string + created: number + metadata?: { [x: string]: unknown } + type: "pty.updated" + location?: { directory: string; workspaceID?: string } + data: { + info: { + id: string + title: string + command: string + args: Array + cwd: string + status: "running" | "exited" + pid: number + exitCode?: number } } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "pty.exited" - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { readonly id: string; readonly exitCode: number } + id: string + created: number + metadata?: { [x: string]: unknown } + type: "pty.exited" + location?: { directory: string; workspaceID?: string } + data: { id: string; exitCode: number } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "pty.deleted" - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { readonly id: string } + id: string + created: number + metadata?: { [x: string]: unknown } + type: "pty.deleted" + location?: { directory: string; workspaceID?: string } + data: { id: string } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "shell.created" - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { - readonly info: { - readonly id: string - readonly status: "running" | "exited" | "timeout" | "killed" - readonly command: string - readonly cwd: string - readonly shell: string - readonly file: string - readonly pid?: number - readonly exit?: number - readonly metadata: { readonly [x: string]: unknown } - readonly time: { readonly started: number; readonly completed?: number } + id: string + created: number + metadata?: { [x: string]: unknown } + type: "shell.created" + location?: { directory: string; workspaceID?: string } + data: { + info: { + id: string + status: "running" | "exited" | "timeout" | "killed" + command: string + cwd: string + shell: string + file: string + pid?: number + exit?: number + metadata: { [x: string]: unknown } + time: { started: number; completed?: number } } } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "shell.exited" - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { - readonly id: string - readonly exit?: number - readonly status: "running" | "exited" | "timeout" | "killed" - } + id: string + created: number + metadata?: { [x: string]: unknown } + type: "shell.exited" + location?: { directory: string; workspaceID?: string } + data: { id: string; exit?: number; status: "running" | "exited" | "timeout" | "killed" } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "shell.deleted" - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { readonly id: string } + id: string + created: number + metadata?: { [x: string]: unknown } + type: "shell.deleted" + location?: { directory: string; workspaceID?: string } + data: { id: string } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "question.v2.asked" - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { - readonly id: string - readonly sessionID: string - readonly questions: ReadonlyArray<{ - readonly question: string - readonly header: string - readonly options: ReadonlyArray<{ readonly label: string; readonly description: string }> - readonly multiple?: boolean - readonly custom?: boolean + id: string + created: number + metadata?: { [x: string]: unknown } + type: "question.v2.asked" + location?: { directory: string; workspaceID?: string } + data: { + id: string + sessionID: string + questions: Array<{ + question: string + header: string + options: Array<{ label: string; description: string }> + multiple?: boolean + custom?: boolean }> - readonly tool?: { readonly messageID: string; readonly callID: string } + tool?: { messageID: string; callID: string } } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "question.v2.replied" - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { - readonly sessionID: string - readonly requestID: string - readonly answers: ReadonlyArray> - } + id: string + created: number + metadata?: { [x: string]: unknown } + type: "question.v2.replied" + location?: { directory: string; workspaceID?: string } + data: { sessionID: string; requestID: string; answers: Array> } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "question.v2.rejected" - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { readonly sessionID: string; readonly requestID: string } + id: string + created: number + metadata?: { [x: string]: unknown } + type: "question.v2.rejected" + location?: { directory: string; workspaceID?: string } + data: { sessionID: string; requestID: string } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "form.created" - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { - readonly form: + id: string + created: number + metadata?: { [x: string]: unknown } + type: "form.created" + location?: { directory: string; workspaceID?: string } + data: { + form: | { - readonly id: string - readonly sessionID: string - readonly title: string - readonly metadata?: { readonly [x: string]: unknown } - readonly mode: "form" - readonly fields: ReadonlyArray< + id: string + sessionID: string + title: string + metadata?: { [x: string]: unknown } + mode: "form" + fields: Array< | { - readonly key: string - readonly title?: string - readonly description?: string - readonly required?: boolean - readonly when?: ReadonlyArray<{ - readonly key: string - readonly op: "eq" | "neq" - readonly value: string | number | boolean - }> - readonly type: "string" - readonly format?: "email" | "uri" | "date" | "date-time" - readonly minLength?: number - readonly maxLength?: number - readonly pattern?: string - readonly placeholder?: string - readonly default?: string - readonly options?: ReadonlyArray<{ - readonly value: string - readonly label: string - readonly description?: string - }> - readonly custom?: boolean + key: string + title?: string + description?: string + required?: boolean + when?: Array<{ key: string; op: "eq" | "neq"; value: string | number | boolean }> + type: "string" + format?: "email" | "uri" | "date" | "date-time" + minLength?: number + maxLength?: number + pattern?: string + placeholder?: string + default?: string + options?: Array<{ value: string; label: string; description?: string }> + custom?: boolean } | { - readonly key: string - readonly title?: string - readonly description?: string - readonly required?: boolean - readonly when?: ReadonlyArray<{ - readonly key: string - readonly op: "eq" | "neq" - readonly value: string | number | boolean - }> - readonly type: "number" - readonly minimum?: number - readonly maximum?: number - readonly default?: number + key: string + title?: string + description?: string + required?: boolean + when?: Array<{ key: string; op: "eq" | "neq"; value: string | number | boolean }> + type: "number" + minimum?: number + maximum?: number + default?: number } | { - readonly key: string - readonly title?: string - readonly description?: string - readonly required?: boolean - readonly when?: ReadonlyArray<{ - readonly key: string - readonly op: "eq" | "neq" - readonly value: string | number | boolean - }> - readonly type: "integer" - readonly minimum?: number - readonly maximum?: number - readonly default?: number + key: string + title?: string + description?: string + required?: boolean + when?: Array<{ key: string; op: "eq" | "neq"; value: string | number | boolean }> + type: "integer" + minimum?: number + maximum?: number + default?: number } | { - readonly key: string - readonly title?: string - readonly description?: string - readonly required?: boolean - readonly when?: ReadonlyArray<{ - readonly key: string - readonly op: "eq" | "neq" - readonly value: string | number | boolean - }> - readonly type: "boolean" - readonly default?: boolean + key: string + title?: string + description?: string + required?: boolean + when?: Array<{ key: string; op: "eq" | "neq"; value: string | number | boolean }> + type: "boolean" + default?: boolean } | { - readonly key: string - readonly title?: string - readonly description?: string - readonly required?: boolean - readonly when?: ReadonlyArray<{ - readonly key: string - readonly op: "eq" | "neq" - readonly value: string | number | boolean - }> - readonly type: "multiselect" - readonly options: ReadonlyArray<{ - readonly value: string - readonly label: string - readonly description?: string - }> - readonly minItems?: number - readonly maxItems?: number - readonly custom?: boolean - readonly default?: ReadonlyArray + key: string + title?: string + description?: string + required?: boolean + when?: Array<{ key: string; op: "eq" | "neq"; value: string | number | boolean }> + type: "multiselect" + options: Array<{ value: string; label: string; description?: string }> + minItems?: number + maxItems?: number + custom?: boolean + default?: Array } > } | { - readonly id: string - readonly sessionID: string - readonly title: string - readonly metadata?: { readonly [x: string]: unknown } - readonly mode: "url" - readonly url: string + id: string + sessionID: string + title: string + metadata?: { [x: string]: unknown } + mode: "url" + url: string } } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "form.replied" - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { - readonly id: string - readonly sessionID: string - readonly answer: { readonly [x: string]: string | number | boolean | ReadonlyArray } - } + id: string + created: number + metadata?: { [x: string]: unknown } + type: "form.replied" + location?: { directory: string; workspaceID?: string } + data: { id: string; sessionID: string; answer: { [x: string]: string | number | boolean | Array } } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "form.cancelled" - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { readonly id: string; readonly sessionID: string } + id: string + created: number + metadata?: { [x: string]: unknown } + type: "form.cancelled" + location?: { directory: string; workspaceID?: string } + data: { id: string; sessionID: string } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "session.status" - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { - readonly sessionID: string - readonly status: - | { readonly type: "idle" } + id: string + created: number + metadata?: { [x: string]: unknown } + type: "session.status" + location?: { directory: string; workspaceID?: string } + data: { + sessionID: string + status: + | { type: "idle" } | { - readonly type: "retry" - readonly attempt: number - readonly message: string - readonly action?: { - readonly reason: string - readonly provider: string - readonly title: string - readonly message: string - readonly label: string - readonly link?: string + type: "retry" + attempt: number + message: string + action?: { + reason: string + provider: string + title: string + message: string + label: string + link?: string } - readonly next: number + next: number } - | { readonly type: "busy" } + | { type: "busy" } } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "session.idle" - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { readonly sessionID: string } + id: string + created: number + metadata?: { [x: string]: unknown } + type: "session.idle" + location?: { directory: string; workspaceID?: string } + data: { sessionID: string } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "tui.prompt.append" - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { readonly text: string } + id: string + created: number + metadata?: { [x: string]: unknown } + type: "tui.prompt.append" + location?: { directory: string; workspaceID?: string } + data: { text: string } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "tui.command.execute" - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { - readonly command: + id: string + created: number + metadata?: { [x: string]: unknown } + type: "tui.command.execute" + location?: { directory: string; workspaceID?: string } + data: { + command: | "session.list" | "session.new" | "session.share" @@ -5655,181 +4998,161 @@ export type EventSubscribeOutput = } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "tui.toast.show" - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { - readonly title?: string - readonly message: string - readonly variant: "info" | "success" | "warning" | "error" - readonly duration?: number | undefined + id: string + created: number + metadata?: { [x: string]: unknown } + type: "tui.toast.show" + location?: { directory: string; workspaceID?: string } + data: { + title?: string + message: string + variant: "info" | "success" | "warning" | "error" + duration?: number | undefined } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "tui.session.select" - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { readonly sessionID: string } + id: string + created: number + metadata?: { [x: string]: unknown } + type: "tui.session.select" + location?: { directory: string; workspaceID?: string } + data: { sessionID: string } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "installation.updated" - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { readonly version: string } + id: string + created: number + metadata?: { [x: string]: unknown } + type: "installation.updated" + location?: { directory: string; workspaceID?: string } + data: { version: string } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "installation.update-available" - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { readonly version: string } + id: string + created: number + metadata?: { [x: string]: unknown } + type: "installation.update-available" + location?: { directory: string; workspaceID?: string } + data: { version: string } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "vcs.branch.updated" - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { readonly branch?: string } + id: string + created: number + metadata?: { [x: string]: unknown } + type: "vcs.branch.updated" + location?: { directory: string; workspaceID?: string } + data: { branch?: string } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "mcp.status.changed" - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { readonly server: string } + id: string + created: number + metadata?: { [x: string]: unknown } + type: "mcp.status.changed" + location?: { directory: string; workspaceID?: string } + data: { server: string } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "mcp.resources.changed" - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { readonly server: string } + id: string + created: number + metadata?: { [x: string]: unknown } + type: "mcp.resources.changed" + location?: { directory: string; workspaceID?: string } + data: { server: string } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "permission.asked" - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { - readonly id: string - readonly sessionID: string - readonly permission: string - readonly patterns: ReadonlyArray - readonly metadata: { readonly [x: string]: unknown } - readonly always: ReadonlyArray - readonly tool?: { readonly messageID: string; readonly callID: string } | undefined + id: string + created: number + metadata?: { [x: string]: unknown } + type: "permission.asked" + location?: { directory: string; workspaceID?: string } + data: { + id: string + sessionID: string + permission: string + patterns: Array + metadata: { [x: string]: unknown } + always: Array + tool?: { messageID: string; callID: string } | undefined } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "permission.replied" - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { - readonly sessionID: string - readonly requestID: string - readonly reply: "once" | "always" | "reject" - } + id: string + created: number + metadata?: { [x: string]: unknown } + type: "permission.replied" + location?: { directory: string; workspaceID?: string } + data: { sessionID: string; requestID: string; reply: "once" | "always" | "reject" } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "question.asked" - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { - readonly id: string - readonly sessionID: string - readonly questions: ReadonlyArray<{ - readonly question: string - readonly header: string - readonly options: ReadonlyArray<{ readonly label: string; readonly description: string }> - readonly multiple?: boolean | undefined - readonly custom?: boolean | undefined + id: string + created: number + metadata?: { [x: string]: unknown } + type: "question.asked" + location?: { directory: string; workspaceID?: string } + data: { + id: string + sessionID: string + questions: Array<{ + question: string + header: string + options: Array<{ label: string; description: string }> + multiple?: boolean | undefined + custom?: boolean | undefined }> - readonly tool?: { readonly messageID: string; readonly callID: string } | undefined + tool?: { messageID: string; callID: string } | undefined } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "question.replied" - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { - readonly sessionID: string - readonly requestID: string - readonly answers: ReadonlyArray> - } + id: string + created: number + metadata?: { [x: string]: unknown } + type: "question.replied" + location?: { directory: string; workspaceID?: string } + data: { sessionID: string; requestID: string; answers: Array> } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "question.rejected" - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { readonly sessionID: string; readonly requestID: string } + id: string + created: number + metadata?: { [x: string]: unknown } + type: "question.rejected" + location?: { directory: string; workspaceID?: string } + data: { sessionID: string; requestID: string } } | { - readonly id: string - readonly created: number - readonly metadata?: { readonly [x: string]: unknown } - readonly type: "session.error" - readonly location?: { readonly directory: string; readonly workspaceID?: string } - readonly data: { - readonly sessionID?: string | undefined - readonly error?: + id: string + created: number + metadata?: { [x: string]: unknown } + type: "session.error" + location?: { directory: string; workspaceID?: string } + data: { + sessionID?: string | undefined + error?: + | { name: "ProviderAuthError"; data: { providerID: string; message: string } } + | { name: "UnknownError"; data: { message: string; ref?: string | undefined } } + | { name: "MessageOutputLengthError"; data: {} } + | { name: "MessageAbortedError"; data: { message: string } } + | { name: "StructuredOutputError"; data: { message: string; retries: number } } + | { name: "ContextOverflowError"; data: { message: string; responseBody?: string | undefined } } + | { name: "ContentFilterError"; data: { message: string } } | { - readonly name: "ProviderAuthError" - readonly data: { readonly providerID: string; readonly message: string } - } - | { - readonly name: "UnknownError" - readonly data: { readonly message: string; readonly ref?: string | undefined } - } - | { readonly name: "MessageOutputLengthError"; readonly data: {} } - | { readonly name: "MessageAbortedError"; readonly data: { readonly message: string } } - | { - readonly name: "StructuredOutputError" - readonly data: { readonly message: string; readonly retries: number } - } - | { - readonly name: "ContextOverflowError" - readonly data: { readonly message: string; readonly responseBody?: string | undefined } - } - | { readonly name: "ContentFilterError"; readonly data: { readonly message: string } } - | { - readonly name: "APIError" - readonly data: { - readonly message: string - readonly statusCode?: number | undefined - readonly isRetryable: boolean - readonly responseHeaders?: { readonly [x: string]: string } | undefined - readonly responseBody?: string | undefined - readonly metadata?: { readonly [x: string]: string } | undefined + name: "APIError" + data: { + message: string + statusCode?: number | undefined + isRetryable: boolean + responseHeaders?: { [x: string]: string } | undefined + responseBody?: string | undefined + metadata?: { [x: string]: string } | undefined } } | undefined } } | { - readonly id: string - readonly metadata?: { readonly [x: string]: unknown } | undefined - readonly location?: { readonly directory: string; readonly workspaceID?: string } | undefined - readonly type: "server.connected" - readonly data: {} + id: string + metadata?: { [x: string]: unknown } | undefined + location?: { directory: string; workspaceID?: string } | undefined + type: "server.connected" + data: {} } export type PtyListInput = { @@ -5839,20 +5162,16 @@ export type PtyListInput = { } export type PtyListOutput = { - readonly location: { - readonly directory: string - readonly workspaceID?: string - readonly project: { readonly id: string; readonly directory: string } - } - readonly data: ReadonlyArray<{ - readonly id: string - readonly title: string - readonly command: string - readonly args: ReadonlyArray - readonly cwd: string - readonly status: "running" | "exited" - readonly pid: number - readonly exitCode?: number + location: { directory: string; workspaceID?: string; project: { id: string; directory: string } } + data: Array<{ + id: string + title: string + command: string + args: Array + cwd: string + status: "running" | "exited" + pid: number + exitCode?: number }> } @@ -5898,20 +5217,16 @@ export type PtyCreateInput = { } export type PtyCreateOutput = { - readonly location: { - readonly directory: string - readonly workspaceID?: string - readonly project: { readonly id: string; readonly directory: string } - } - readonly data: { - readonly id: string - readonly title: string - readonly command: string - readonly args: ReadonlyArray - readonly cwd: string - readonly status: "running" | "exited" - readonly pid: number - readonly exitCode?: number + location: { directory: string; workspaceID?: string; project: { id: string; directory: string } } + data: { + id: string + title: string + command: string + args: Array + cwd: string + status: "running" | "exited" + pid: number + exitCode?: number } } @@ -5923,20 +5238,16 @@ export type PtyGetInput = { } export type PtyGetOutput = { - readonly location: { - readonly directory: string - readonly workspaceID?: string - readonly project: { readonly id: string; readonly directory: string } - } - readonly data: { - readonly id: string - readonly title: string - readonly command: string - readonly args: ReadonlyArray - readonly cwd: string - readonly status: "running" | "exited" - readonly pid: number - readonly exitCode?: number + location: { directory: string; workspaceID?: string; project: { id: string; directory: string } } + data: { + id: string + title: string + command: string + args: Array + cwd: string + status: "running" | "exited" + pid: number + exitCode?: number } } @@ -5953,20 +5264,16 @@ export type PtyUpdateInput = { } export type PtyUpdateOutput = { - readonly location: { - readonly directory: string - readonly workspaceID?: string - readonly project: { readonly id: string; readonly directory: string } - } - readonly data: { - readonly id: string - readonly title: string - readonly command: string - readonly args: ReadonlyArray - readonly cwd: string - readonly status: "running" | "exited" - readonly pid: number - readonly exitCode?: number + location: { directory: string; workspaceID?: string; project: { id: string; directory: string } } + data: { + id: string + title: string + command: string + args: Array + cwd: string + status: "running" | "exited" + pid: number + exitCode?: number } } @@ -5986,25 +5293,18 @@ export type ShellListInput = { } export type ShellListOutput = { - readonly location: { - readonly directory: string - readonly workspaceID?: string - readonly project: { readonly id: string; readonly directory: string } - } - readonly data: ReadonlyArray<{ - readonly id: string - readonly status: "running" | "exited" | "timeout" | "killed" - readonly command: string - readonly cwd: string - readonly shell: string - readonly file: string - readonly pid?: number - readonly exit?: number | "Infinity" | "-Infinity" | "NaN" - readonly metadata: { readonly [x: string]: JsonValue } - readonly time: { - readonly started: number | "Infinity" | "-Infinity" | "NaN" - readonly completed?: number | "Infinity" | "-Infinity" | "NaN" - } + location: { directory: string; workspaceID?: string; project: { id: string; directory: string } } + data: Array<{ + id: string + status: "running" | "exited" | "timeout" | "killed" + command: string + cwd: string + shell: string + file: string + pid?: number + exit?: number | "Infinity" | "-Infinity" | "NaN" + metadata: { [x: string]: JsonValue } + time: { started: number | "Infinity" | "-Infinity" | "NaN"; completed?: number | "Infinity" | "-Infinity" | "NaN" } }> } @@ -6039,25 +5339,18 @@ export type ShellCreateInput = { } export type ShellCreateOutput = { - readonly location: { - readonly directory: string - readonly workspaceID?: string - readonly project: { readonly id: string; readonly directory: string } - } - readonly data: { - readonly id: string - readonly status: "running" | "exited" | "timeout" | "killed" - readonly command: string - readonly cwd: string - readonly shell: string - readonly file: string - readonly pid?: number - readonly exit?: number | "Infinity" | "-Infinity" | "NaN" - readonly metadata: { readonly [x: string]: JsonValue } - readonly time: { - readonly started: number | "Infinity" | "-Infinity" | "NaN" - readonly completed?: number | "Infinity" | "-Infinity" | "NaN" - } + location: { directory: string; workspaceID?: string; project: { id: string; directory: string } } + data: { + id: string + status: "running" | "exited" | "timeout" | "killed" + command: string + cwd: string + shell: string + file: string + pid?: number + exit?: number | "Infinity" | "-Infinity" | "NaN" + metadata: { [x: string]: JsonValue } + time: { started: number | "Infinity" | "-Infinity" | "NaN"; completed?: number | "Infinity" | "-Infinity" | "NaN" } } } @@ -6069,25 +5362,18 @@ export type ShellGetInput = { } export type ShellGetOutput = { - readonly location: { - readonly directory: string - readonly workspaceID?: string - readonly project: { readonly id: string; readonly directory: string } - } - readonly data: { - readonly id: string - readonly status: "running" | "exited" | "timeout" | "killed" - readonly command: string - readonly cwd: string - readonly shell: string - readonly file: string - readonly pid?: number - readonly exit?: number | "Infinity" | "-Infinity" | "NaN" - readonly metadata: { readonly [x: string]: JsonValue } - readonly time: { - readonly started: number | "Infinity" | "-Infinity" | "NaN" - readonly completed?: number | "Infinity" | "-Infinity" | "NaN" - } + location: { directory: string; workspaceID?: string; project: { id: string; directory: string } } + data: { + id: string + status: "running" | "exited" | "timeout" | "killed" + command: string + cwd: string + shell: string + file: string + pid?: number + exit?: number | "Infinity" | "-Infinity" | "NaN" + metadata: { [x: string]: JsonValue } + time: { started: number | "Infinity" | "-Infinity" | "NaN"; completed?: number | "Infinity" | "-Infinity" | "NaN" } } } @@ -6100,25 +5386,18 @@ export type ShellTimeoutInput = { } export type ShellTimeoutOutput = { - readonly location: { - readonly directory: string - readonly workspaceID?: string - readonly project: { readonly id: string; readonly directory: string } - } - readonly data: { - readonly id: string - readonly status: "running" | "exited" | "timeout" | "killed" - readonly command: string - readonly cwd: string - readonly shell: string - readonly file: string - readonly pid?: number - readonly exit?: number | "Infinity" | "-Infinity" | "NaN" - readonly metadata: { readonly [x: string]: JsonValue } - readonly time: { - readonly started: number | "Infinity" | "-Infinity" | "NaN" - readonly completed?: number | "Infinity" | "-Infinity" | "NaN" - } + location: { directory: string; workspaceID?: string; project: { id: string; directory: string } } + data: { + id: string + status: "running" | "exited" | "timeout" | "killed" + command: string + cwd: string + shell: string + file: string + pid?: number + exit?: number | "Infinity" | "-Infinity" | "NaN" + metadata: { [x: string]: JsonValue } + time: { started: number | "Infinity" | "-Infinity" | "NaN"; completed?: number | "Infinity" | "-Infinity" | "NaN" } } } @@ -6142,17 +5421,8 @@ export type ShellOutputInput = { } export type ShellOutputOutput = { - readonly location: { - readonly directory: string - readonly workspaceID?: string - readonly project: { readonly id: string; readonly directory: string } - } - readonly data: { - readonly output: string - readonly cursor: number - readonly size: number - readonly truncated: boolean - } + location: { directory: string; workspaceID?: string; project: { id: string; directory: string } } + data: { output: string; cursor: number; size: number; truncated: boolean } } export type ShellRemoveInput = { @@ -6171,39 +5441,35 @@ export type QuestionRequestListInput = { } export type QuestionRequestListOutput = { - readonly location: { - readonly directory: string - readonly workspaceID?: string - readonly project: { readonly id: string; readonly directory: string } - } - readonly data: ReadonlyArray<{ - readonly id: string - readonly sessionID: string - readonly questions: ReadonlyArray<{ - readonly question: string - readonly header: string - readonly options: ReadonlyArray<{ readonly label: string; readonly description: string }> - readonly multiple?: boolean - readonly custom?: boolean + location: { directory: string; workspaceID?: string; project: { id: string; directory: string } } + data: Array<{ + id: string + sessionID: string + questions: Array<{ + question: string + header: string + options: Array<{ label: string; description: string }> + multiple?: boolean + custom?: boolean }> - readonly tool?: { readonly messageID: string; readonly callID: string } + tool?: { messageID: string; callID: string } }> } export type QuestionListInput = { readonly sessionID: { readonly sessionID: string }["sessionID"] } export type QuestionListOutput = { - readonly data: ReadonlyArray<{ - readonly id: string - readonly sessionID: string - readonly questions: ReadonlyArray<{ - readonly question: string - readonly header: string - readonly options: ReadonlyArray<{ readonly label: string; readonly description: string }> - readonly multiple?: boolean - readonly custom?: boolean + data: Array<{ + id: string + sessionID: string + questions: Array<{ + question: string + header: string + options: Array<{ label: string; description: string }> + multiple?: boolean + custom?: boolean }> - readonly tool?: { readonly messageID: string; readonly callID: string } + tool?: { messageID: string; callID: string } }> }["data"] @@ -6229,25 +5495,15 @@ export type ReferenceListInput = { } export type ReferenceListOutput = { - readonly location: { - readonly directory: string - readonly workspaceID?: string - readonly project: { readonly id: string; readonly directory: string } - } - readonly data: ReadonlyArray<{ - readonly name: string - readonly path: string - readonly description?: string - readonly hidden?: boolean - readonly source: - | { readonly type: "local"; readonly path: string; readonly description?: string; readonly hidden?: boolean } - | { - readonly type: "git" - readonly repository: string - readonly branch?: string - readonly description?: string - readonly hidden?: boolean - } + location: { directory: string; workspaceID?: string; project: { id: string; directory: string } } + data: Array<{ + name: string + path: string + description?: string + hidden?: boolean + source: + | { type: "local"; path: string; description?: string; hidden?: boolean } + | { type: "git"; repository: string; branch?: string; description?: string; hidden?: boolean } }> } @@ -6261,7 +5517,7 @@ export type ProjectCopyCreateInput = { readonly name?: { readonly strategy: string; readonly directory: string; readonly name?: string }["name"] } -export type ProjectCopyCreateOutput = { readonly directory: string } +export type ProjectCopyCreateOutput = { directory: string } export type ProjectCopyRemoveInput = { readonly projectID: { readonly projectID: string }["projectID"] @@ -6290,17 +5546,8 @@ export type VcsStatusInput = { } export type VcsStatusOutput = { - readonly location: { - readonly directory: string - readonly workspaceID?: string - readonly project: { readonly id: string; readonly directory: string } - } - readonly data: ReadonlyArray<{ - readonly file: string - readonly additions: number - readonly deletions: number - readonly status: "added" | "deleted" | "modified" - }> + location: { directory: string; workspaceID?: string; project: { id: string; directory: string } } + data: Array<{ file: string; additions: number; deletions: number; status: "added" | "deleted" | "modified" }> } export type VcsDiffInput = { @@ -6322,21 +5569,17 @@ export type VcsDiffInput = { } export type VcsDiffOutput = { - readonly location: { - readonly directory: string - readonly workspaceID?: string - readonly project: { readonly id: string; readonly directory: string } - } - readonly data: ReadonlyArray<{ - readonly file: string - readonly patch: string - readonly additions: number - readonly deletions: number - readonly status: "added" | "deleted" | "modified" + location: { directory: string; workspaceID?: string; project: { id: string; directory: string } } + data: Array<{ + file: string + patch: string + additions: number + deletions: number + status: "added" | "deleted" | "modified" }> } -export type DebugLocationListOutput = ReadonlyArray<{ readonly directory: string; readonly workspaceID?: string }> +export type DebugLocationListOutput = Array<{ directory: string; workspaceID?: string }> export type DebugLocationEvictInput = { readonly location?: { diff --git a/packages/httpapi-codegen/src/index.ts b/packages/httpapi-codegen/src/index.ts index 30822e57bb..82d894cb23 100644 --- a/packages/httpapi-codegen/src/index.ts +++ b/packages/httpapi-codegen/src/index.ts @@ -296,6 +296,7 @@ export function emitPromise( contract: Contract, options?: { readonly outputTypes?: Readonly> + readonly mutableOutputs?: boolean }, ): Output { const groups = contract.groups @@ -305,7 +306,7 @@ export function emitPromise( return { operations: promiseOperations(groups), files: [ - { path: "types.ts", content: renderPromiseTypes(groups, options?.outputTypes) }, + { path: "types.ts", content: renderPromiseTypes(groups, options?.outputTypes, options?.mutableOutputs ?? false) }, { path: "client-error.ts", content: `export type ClientErrorReason = "Transport" | "UnexpectedStatus" | "UnsupportedContentType" | "MalformedResponse"\n\nexport class ClientError extends Error {\n override readonly name = "ClientError"\n constructor(readonly reason: ClientErrorReason, options?: ErrorOptions) {\n super(reason, options)\n }\n}\n`, @@ -568,6 +569,7 @@ function renderImportedProjection(groups: ReadonlyArray, endpoints: Reado function renderPromiseTypes( groups: ReadonlyArray, outputTypes?: Readonly>, + mutableOutputs = false, ) { const types = new Map() const typeOf = (schema: Schema.Top, decoded = false) => { @@ -623,20 +625,25 @@ function renderPromiseTypes( : successSchema.events : successSchema, ) + const output = mutableOutputs ? mutableType(success) : success return [ ...(promiseInputMode(endpoint) === "none" ? [] : [`export type ${prefix}Input = { ${input} }`]), - `export type ${prefix}Output = ${endpoint.unwrapData ? `(${success})["data"]` : success}`, + `export type ${prefix}Output = ${endpoint.unwrapData ? `(${output})["data"]` : output}`, ] }), ) .join("\n\n") const json = operations.includes("JsonValue") - ? "export type JsonValue = null | boolean | number | string | ReadonlyArray | { readonly [key: string]: JsonValue }" + ? `export type JsonValue = null | boolean | number | string | ${mutableOutputs ? "Array | { [key: string]: JsonValue }" : "ReadonlyArray | { readonly [key: string]: JsonValue }"}` : "" const imports = [...new Set(Object.values(outputTypes ?? {}).map((override) => override.import))] return [...imports, json, ...errorTypes, operations].filter(Boolean).join("\n\n") } +function mutableType(type: string) { + return type.replaceAll("ReadonlyArray<", "Array<").replaceAll(/\breadonly\s+/g, "") +} + function renderPromiseClient(groups: ReadonlyArray) { const imports = groups.flatMap((group) => group.endpoints.flatMap((endpoint) => { diff --git a/packages/httpapi-codegen/test/generate.test.ts b/packages/httpapi-codegen/test/generate.test.ts index f949f70d46..7679c61fa8 100644 --- a/packages/httpapi-codegen/test/generate.test.ts +++ b/packages/httpapi-codegen/test/generate.test.ts @@ -513,6 +513,24 @@ describe("HttpApiCodegen.generate", () => { ) }) + test("emits mutable Promise outputs without restricting inputs", () => { + const output = emitPromise( + compileContract( + api( + HttpApiEndpoint.post("create", "/session", { + payload: Schema.Struct({ values: Schema.Array(Schema.String) }), + success: Schema.Struct({ data: Schema.Array(Schema.Struct({ values: Schema.Array(Schema.String) })) }), + }), + ), + ), + { mutableOutputs: true }, + ) + const types = output.files.find((file) => file.path === "types.ts")?.content + + expect(types).toContain('readonly "values": ReadonlyArray') + expect(types).toContain('export type SessionCreateOutput = ({ "data": Array<{ "values": Array }> })["data"]') + }) + test("expands Promise references only at identifier boundaries", () => { const Session = Schema.Struct({ name: Schema.Literal("Session"), id: Schema.String }).annotate({ identifier: "Session", diff --git a/packages/plugin/src/tui.ts b/packages/plugin/src/tui.ts index 7c1d321edb..101e12a4f1 100644 --- a/packages/plugin/src/tui.ts +++ b/packages/plugin/src/tui.ts @@ -1,6 +1,5 @@ import type { OpencodeClient, - V2Event, LspStatus, McpStatus, Message, @@ -12,6 +11,7 @@ import type { SessionStatus, Config as SdkConfig, } from "@opencode-ai/sdk/v2" +import type { OpenCodeEvent } from "@opencode-ai/client/promise" import type { PromptInput } from "@opencode-ai/schema" import type { Types } from "effect" import type { CliRenderer, KeyEvent, RGBA, Renderable, SlotMode } from "@opentui/core" @@ -507,9 +507,9 @@ export type TuiSlots = { } export type TuiEventBus = { - on: ( + on: ( type: Type, - handler: (event: Extract) => void, + handler: (event: Extract) => void, ) => () => void } diff --git a/packages/tui/src/component/dialog-pair.tsx b/packages/tui/src/component/dialog-pair.tsx index ffa531890f..807cac0abb 100644 --- a/packages/tui/src/component/dialog-pair.tsx +++ b/packages/tui/src/component/dialog-pair.tsx @@ -25,9 +25,8 @@ export function DialogPair(props: { credentials?: DialogPairCredentials }) { dialog.setCentered(true) const [server] = createResource(() => - sdk.client.v2.server - .get({ throwOnError: true }) - .then((result) => result.data) + sdk.api.server + .get() .catch((error) => { setLoadError(error) return undefined diff --git a/packages/tui/src/component/dialog-session-list.tsx b/packages/tui/src/component/dialog-session-list.tsx index c520eb3703..8fae5114ab 100644 --- a/packages/tui/src/component/dialog-session-list.tsx +++ b/packages/tui/src/component/dialog-session-list.tsx @@ -44,8 +44,7 @@ export function DialogSessionList() { directory: location.directory, workspace: location.workspaceID, }) - // oxlint-disable-next-line typescript-eslint/no-unsafe-type-assertion -- generated client output is readonly; session list UI reuses legacy mutable session types. - return { query, sessions: structuredClone(response.data) as SessionInfo[] } + return { query, sessions: response.data } } catch (error) { // A transient transport failure must degrade search, not crash the TUI // through the root ErrorBoundary when the errored resource is read. @@ -141,7 +140,7 @@ export function DialogSessionList() { setToDelete(option.value) return } - void sdk.client.v2.session.remove({ sessionID: option.value }, { throwOnError: true }).catch((error) => { + void sdk.api.session.remove({ sessionID: option.value }).catch((error) => { setToDelete(undefined) toast.show({ message: `Failed to delete session: ${errorMessage(error)}`, diff --git a/packages/tui/src/component/prompt/index.tsx b/packages/tui/src/component/prompt/index.tsx index b256e6ac6b..e0539ba434 100644 --- a/packages/tui/src/component/prompt/index.tsx +++ b/packages/tui/src/component/prompt/index.tsx @@ -37,7 +37,7 @@ import { usePromptStash } from "../../prompt/stash" import { DialogStash } from "../dialog-stash" import { type AutocompleteRef, Autocomplete } from "./autocomplete" import { useRenderer, useTerminalDimensions, type JSX } from "@opentui/solid" -import type { SessionInfo, UserMessage } from "@opencode-ai/sdk/v2" +import type { UserMessage } from "@opencode-ai/sdk/v2" import { Locale } from "../../util/locale" import { errorMessage } from "../../util/error" import { createColors, createFrames } from "../../ui/spinner" @@ -1027,8 +1027,7 @@ export function Prompt(props: PromptProps) { } sessionID = created.id - // oxlint-disable-next-line typescript-eslint/no-unsafe-type-assertion -- generated client output is readonly; prompt state still uses legacy mutable session types. - session = structuredClone(created) as SessionInfo + session = created } const inputText = expandTrackedPastedText( @@ -1064,7 +1063,7 @@ export function Prompt(props: PromptProps) { if (store.mode === "shell") { move.startSubmit() - void sdk.client.v2.session.shell({ + void sdk.api.session.shell({ sessionID, command: inputText, }) diff --git a/packages/tui/src/context/data.tsx b/packages/tui/src/context/data.tsx index 76d24a796d..26ee2f0481 100644 --- a/packages/tui/src/context/data.tsx +++ b/packages/tui/src/context/data.tsx @@ -24,8 +24,8 @@ import type { SessionInfo, Shell, SkillInfo, - V2Event, } from "@opencode-ai/sdk/v2" +import type { OpenCodeEvent } from "@opencode-ai/client/promise" import { createStore, produce, reconcile } from "solid-js/store" import { createSimpleContext } from "./helper" import { useSDK } from "./sdk" @@ -82,14 +82,6 @@ function locationQuery(ref?: LocationRef) { return ref ? { directory: ref.directory, workspace: ref.workspaceID } : undefined } -type Mutable = - T extends ReadonlyArray ? Mutable[] : T extends object ? { -readonly [K in keyof T]: Mutable } : T - -function mutable(value: T): Mutable { - // oxlint-disable-next-line typescript-eslint/no-unsafe-type-assertion -- generated client data is readonly; the TUI store mutates cloned state. - return structuredClone(value) as Mutable -} - export const { use: useData, provider: DataProvider } = createSimpleContext({ name: "Data", init: () => { @@ -241,7 +233,7 @@ export const { use: useData, provider: DataProvider } = createSimpleContext({ ) } - function handleEvent(event: V2Event) { + function handleEvent(event: OpenCodeEvent) { switch (event.type) { case "session.created": void result.session.refresh(event.data.sessionID) @@ -300,8 +292,8 @@ export const { use: useData, provider: DataProvider } = createSimpleContext({ .then((item) => { message.update(event.data.sessionID, (draft, index) => { const position = index.get(item.id) - if (position === undefined) return message.append(draft, index, mutable(item)) - draft[position] = mutable(item) + if (position === undefined) return message.append(draft, index, item) + draft[position] = item }) }) .catch((error) => console.error("Failed to load projected model switch message", error)) @@ -312,7 +304,7 @@ export const { use: useData, provider: DataProvider } = createSimpleContext({ break case "session.moved": if (store.session.info[event.data.sessionID]) { - setStore("session", "info", event.data.sessionID, "location", mutable(event.data.location)) + setStore("session", "info", event.data.sessionID, "location", event.data.location) setStore("session", "info", event.data.sessionID, "subpath", event.data.subpath) } break @@ -745,11 +737,9 @@ export const { use: useData, provider: DataProvider } = createSimpleContext({ if (store.session.form[event.data.form.sessionID]?.some((form) => form.id === event.data.form.id)) break setStore("session", "form", event.data.form.sessionID, [ ...(store.session.form[event.data.form.sessionID] ?? []), - mutable( - event.data.form.sessionID === "global" - ? { ...event.data.form, location: event.location } - : event.data.form, - ), + event.data.form.sessionID === "global" + ? { ...event.data.form, location: event.location } + : event.data.form, ]) break case "form.replied": @@ -830,7 +820,7 @@ export const { use: useData, provider: DataProvider } = createSimpleContext({ }, }, async refresh(sessionID: string) { - setStore("session", "info", sessionID, mutable(await sdk.api.session.get({ sessionID }))) + setStore("session", "info", sessionID, await sdk.api.session.get({ sessionID })) registerSession(sessionID) }, message: { @@ -846,9 +836,7 @@ export const { use: useData, provider: DataProvider } = createSimpleContext({ return position === undefined ? undefined : messages?.[position] }, async refresh(sessionID: string) { - const messages = mutable( - (await sdk.api.message.list({ sessionID, limit: 200, order: "desc" })).data, - ).toReversed() + const messages = (await sdk.api.message.list({ sessionID, limit: 200, order: "desc" })).data.toReversed() messageIndex.set(sessionID, new Map(messages.map((message, index) => [message.id, index]))) setStore("session", "message", sessionID, reconcile(messages)) }, @@ -858,7 +846,7 @@ export const { use: useData, provider: DataProvider } = createSimpleContext({ return store.session.permission[sessionID] }, async refresh(sessionID: string) { - setStore("session", "permission", sessionID, mutable(await sdk.api.permission.list({ sessionID }))) + setStore("session", "permission", sessionID, await sdk.api.permission.list({ sessionID })) }, }, form: { @@ -881,13 +869,11 @@ export const { use: useData, provider: DataProvider } = createSimpleContext({ ...(store.session.form[sessionID] ?? []).filter( (form) => form.location && locationKey(form.location) !== key, ), - ...mutable( - response.data.filter((form) => form.sessionID === "global").map((form) => ({ ...form, location })), - ), + ...response.data.filter((form) => form.sessionID === "global").map((form) => ({ ...form, location })), ]) return } - setStore("session", "form", sessionID, mutable(await sdk.api.form.list({ sessionID }))) + setStore("session", "form", sessionID, await sdk.api.form.list({ sessionID })) }, }, }, @@ -897,7 +883,7 @@ export const { use: useData, provider: DataProvider } = createSimpleContext({ return store.project.permission[projectID] }, async refresh(projectID: string) { - setStore("project", "permission", projectID, mutable(await sdk.api.permission.saved.list({ projectID }))) + setStore("project", "permission", projectID, await sdk.api.permission.saved.list({ projectID })) }, }, }, @@ -915,7 +901,7 @@ export const { use: useData, provider: DataProvider } = createSimpleContext({ const key = locationKey(result.location) setStore("location", key, { ...store.location[key], - shell: Object.fromEntries(mutable(result.data).map((info) => [info.id, info])), + shell: Object.fromEntries(result.data.map((info) => [info.id, info])), }) }, }, @@ -936,7 +922,7 @@ export const { use: useData, provider: DataProvider } = createSimpleContext({ async refresh(ref?: LocationRef) { const result = await sdk.api.agent.list({ location: locationQuery(ref ?? defaultLocation()) }) const key = locationKey(result.location) - setStore("location", key, { ...store.location[key], agent: mutable(result.data) }) + setStore("location", key, { ...store.location[key], agent: result.data }) }, }, command: { @@ -946,7 +932,7 @@ export const { use: useData, provider: DataProvider } = createSimpleContext({ async refresh(ref?: LocationRef) { const result = await sdk.api.command.list({ location: locationQuery(ref ?? defaultLocation()) }) const key = locationKey(result.location) - setStore("location", key, { ...store.location[key], command: mutable(result.data) }) + setStore("location", key, { ...store.location[key], command: result.data }) }, }, integration: { @@ -956,7 +942,7 @@ export const { use: useData, provider: DataProvider } = createSimpleContext({ async refresh(ref?: LocationRef) { const result = await sdk.api.integration.list({ location: locationQuery(ref ?? defaultLocation()) }) const key = locationKey(result.location) - setStore("location", key, { ...store.location[key], integration: mutable(result.data) }) + setStore("location", key, { ...store.location[key], integration: result.data }) }, }, mcp: { @@ -964,9 +950,9 @@ export const { use: useData, provider: DataProvider } = createSimpleContext({ return store.location[locationKey(location ?? defaultLocation())]?.mcp }, async refresh(ref?: LocationRef) { - const result = await sdk.client.v2.mcp.list({ location: locationQuery(ref) }, { throwOnError: true }) - const key = locationKey(result.data.location) - setStore("location", key, { ...store.location[key], mcp: result.data.data }) + const result = await sdk.api["server.mcp"].list({ location: locationQuery(ref) }) + const key = locationKey(result.location) + setStore("location", key, { ...store.location[key], mcp: result.data }) }, }, model: { @@ -976,7 +962,7 @@ export const { use: useData, provider: DataProvider } = createSimpleContext({ async refresh(ref?: LocationRef) { const result = await sdk.api.model.list({ location: locationQuery(ref ?? defaultLocation()) }) const key = locationKey(result.location) - setStore("location", key, { ...store.location[key], model: mutable(result.data) }) + setStore("location", key, { ...store.location[key], model: result.data }) }, }, provider: { @@ -986,7 +972,7 @@ export const { use: useData, provider: DataProvider } = createSimpleContext({ async refresh(ref?: LocationRef) { const result = await sdk.api.provider.list({ location: locationQuery(ref ?? defaultLocation()) }) const key = locationKey(result.location) - setStore("location", key, { ...store.location[key], provider: mutable(result.data) }) + setStore("location", key, { ...store.location[key], provider: result.data }) }, }, reference: { @@ -996,7 +982,7 @@ export const { use: useData, provider: DataProvider } = createSimpleContext({ async refresh(ref?: LocationRef) { const result = await sdk.api.reference.list({ location: locationQuery(ref ?? defaultLocation()) }) const key = locationKey(result.location) - setStore("location", key, { ...store.location[key], reference: mutable(result.data) }) + setStore("location", key, { ...store.location[key], reference: result.data }) }, }, skill: { @@ -1006,7 +992,7 @@ export const { use: useData, provider: DataProvider } = createSimpleContext({ async refresh(ref?: LocationRef) { const result = await sdk.api.skill.list({ location: locationQuery(ref ?? defaultLocation()) }) const key = locationKey(result.location) - setStore("location", key, { ...store.location[key], skill: mutable(result.data) }) + setStore("location", key, { ...store.location[key], skill: result.data }) }, }, }, @@ -1027,13 +1013,13 @@ export const { use: useData, provider: DataProvider } = createSimpleContext({ "session", "info", produce((draft) => { - for (const session of response.data) draft[session.id] = mutable(session) + for (const session of response.data) draft[session.id] = session }), ) for (const session of response.data) registerSession(session.id) }), sdk.api.permission.request.list({ location: locationQuery(defaultLocation()) }).then((response) => { - const permissions = mutable(response.data).reduce>( + const permissions = response.data.reduce>( (result, request) => ({ ...result, [request.sessionID]: [...(result[request.sessionID] ?? []), request], @@ -1047,7 +1033,7 @@ export const { use: useData, provider: DataProvider } = createSimpleContext({ directory: response.location.directory, workspaceID: response.location.workspaceID, } - const forms = mutable(response.data).reduce>( + const forms = response.data.reduce>( (result, form) => ({ ...result, [form.sessionID]: [ diff --git a/packages/tui/src/context/event.ts b/packages/tui/src/context/event.ts index ed4685168c..cf71a01b82 100644 --- a/packages/tui/src/context/event.ts +++ b/packages/tui/src/context/event.ts @@ -1,4 +1,4 @@ -import type { V2Event } from "@opencode-ai/sdk/v2" +import type { OpenCodeEvent } from "@opencode-ai/client/promise" import { useSDK } from "./sdk" type EventMetadata = { @@ -9,16 +9,16 @@ type EventMetadata = { export function useEvent() { const sdk = useSDK() - function subscribe(handler: (event: V2Event, metadata: EventMetadata) => void) { + function subscribe(handler: (event: OpenCodeEvent, metadata: EventMetadata) => void) { return sdk.event.listen(({ details }) => { if (details.type === "server.connected") return handler(details, { directory: details.location?.directory, workspace: details.location?.workspaceID }) }) } - function on( + function on( type: T, - handler: (event: Extract, metadata: EventMetadata) => void, + handler: (event: Extract, metadata: EventMetadata) => void, ) { return sdk.event.on(type, (event) => { handler(event, { directory: event.location?.directory, workspace: event.location?.workspaceID }) diff --git a/packages/tui/src/context/project.tsx b/packages/tui/src/context/project.tsx index 97d5125392..405cec1894 100644 --- a/packages/tui/src/context/project.tsx +++ b/packages/tui/src/context/project.tsx @@ -1,4 +1,4 @@ -import { batch, onCleanup } from "solid-js" +import { batch } from "solid-js" import type { Path, Workspace } from "@opencode-ai/sdk/v2" import { createStore, reconcile } from "solid-js/store" import { createSimpleContext } from "./helper" @@ -66,12 +66,6 @@ export const { use: useProject, provider: ProjectProvider } = createSimpleContex }) } - onCleanup( - sdk.event.on("workspace.status", (event) => { - setStore("workspace", "status", event.data.workspaceID, event.data.status) - }), - ) - return { data: store, project() { diff --git a/packages/tui/src/context/sdk.tsx b/packages/tui/src/context/sdk.tsx index 1e0afb0b61..3c13ec972c 100644 --- a/packages/tui/src/context/sdk.tsx +++ b/packages/tui/src/context/sdk.tsx @@ -1,5 +1,5 @@ -import type { OpenCodeClient } from "@opencode-ai/client/promise" -import type { OpencodeClient, V2Event } from "@opencode-ai/sdk/v2" +import type { OpenCodeClient, OpenCodeEvent } from "@opencode-ai/client/promise" +import type { OpencodeClient } from "@opencode-ai/sdk/v2" import { createGlobalEmitter } from "@solid-primitives/event-bus" import { onCleanup, onMount } from "solid-js" import { createStore } from "solid-js/store" @@ -17,7 +17,7 @@ export type SDKConnectionEvent = { } } -type SDKEventMap = { [Type in V2Event["type"]]: Extract } +type SDKEventMap = { [Type in OpenCodeEvent["type"]]: Extract } const connectTimeout = 2_000 const connectionHistoryLimit = 50 @@ -72,12 +72,7 @@ export const { use: useSDK, provider: SDKProvider } = createSimpleContext({ const error = await (async () => { record(attempt === 0 ? "connecting" : "reconnecting", attempt) log.info("event stream connecting", { attempt }) - const response = await client.v2.event.subscribe({ - signal: connection.signal, - sseMaxRetryAttempts: 0, - throwOnError: true, - }) - const iterator = response.stream[Symbol.asyncIterator]() + const iterator = api.event.subscribe({ signal: connection.signal })[Symbol.asyncIterator]() const first = await iterator.next() if (abort.signal.aborted || controller.signal.aborted) return if (first.done) diff --git a/packages/tui/src/feature-plugins/system/notifications.ts b/packages/tui/src/feature-plugins/system/notifications.ts index 3933b20c54..59aa9c1af3 100644 --- a/packages/tui/src/feature-plugins/system/notifications.ts +++ b/packages/tui/src/feature-plugins/system/notifications.ts @@ -1,10 +1,10 @@ -import type { V2Event } from "@opencode-ai/sdk/v2" +import type { OpenCodeEvent } from "@opencode-ai/client/promise" import type { TuiAttentionSoundName, TuiPlugin, TuiPluginApi } from "@opencode-ai/plugin/tui" import type { BuiltinTuiPlugin } from "../builtins" const id = "internal:notifications" -type SessionError = Extract["data"]["error"] +type SessionError = Extract["data"]["error"] function notify( api: TuiPluginApi, diff --git a/packages/tui/test/cli/cmd/tui/notifications.test.ts b/packages/tui/test/cli/cmd/tui/notifications.test.ts index adacd106b9..ae1dc013c4 100644 --- a/packages/tui/test/cli/cmd/tui/notifications.test.ts +++ b/packages/tui/test/cli/cmd/tui/notifications.test.ts @@ -1,12 +1,13 @@ import { describe, expect, test } from "bun:test" import Notifications from "../../../../src/feature-plugins/system/notifications" -import type { PermissionRequest, QuestionRequest, Session, V2Event } from "@opencode-ai/sdk/v2" +import type { OpenCodeEvent } from "@opencode-ai/client/promise" +import type { PermissionRequest, QuestionRequest, Session } from "@opencode-ai/sdk/v2" import type { TuiAttentionNotifyInput } from "@opencode-ai/plugin/tui" import { createTuiPluginApi } from "../../../fixture/tui-plugin" async function setup() { const notifications: TuiAttentionNotifyInput[] = [] - const handlers = new Map void)[]>() + const handlers = new Map void)[]>() const session = (id: string, title: string, parentID?: string): Session => ({ id, title, @@ -33,9 +34,12 @@ async function setup() { }, }, event: { - on: (type: Type, handler: (event: Extract) => void) => { + on: ( + type: Type, + handler: (event: Extract) => void, + ) => { const list = handlers.get(type) ?? [] - const wrapped = handler as (event: V2Event) => void + const wrapped = handler as (event: OpenCodeEvent) => void list.push(wrapped) handlers.set(type, list) return () => { @@ -59,7 +63,7 @@ async function setup() { return { notifications, - emit(event: V2Event) { + emit(event: OpenCodeEvent) { for (const handler of handlers.get(event.type) ?? []) handler(event) }, } @@ -73,7 +77,10 @@ function question(id: string, sessionID = "session"): QuestionRequest { } } -function form(id: string, sessionID = "session"): Extract["data"]["form"] { +function form( + id: string, + sessionID = "session", +): Extract["data"]["form"] { return { id, sessionID, @@ -98,7 +105,7 @@ function durable(sessionID: string): { aggregateID: string; seq: number; version return { aggregateID: sessionID, seq: 0, version: 1 } } -function executionStarted(id: string, sessionID = "session"): V2Event { +function executionStarted(id: string, sessionID = "session"): OpenCodeEvent { return { id, created: 0, @@ -108,7 +115,7 @@ function executionStarted(id: string, sessionID = "session"): V2Event { } } -function executionSucceeded(id: string, sessionID = "session"): V2Event { +function executionSucceeded(id: string, sessionID = "session"): OpenCodeEvent { return { id, created: 0, @@ -118,7 +125,7 @@ function executionSucceeded(id: string, sessionID = "session"): V2Event { } } -function executionFailed(id: string, sessionID = "session"): V2Event { +function executionFailed(id: string, sessionID = "session"): OpenCodeEvent { return { id, created: 0, diff --git a/packages/tui/test/cli/tui/data.test.tsx b/packages/tui/test/cli/tui/data.test.tsx index 1bcc3a74eb..7f675dd40c 100644 --- a/packages/tui/test/cli/tui/data.test.tsx +++ b/packages/tui/test/cli/tui/data.test.tsx @@ -1,7 +1,7 @@ /** @jsxImportSource @opentui/solid */ import { expect, test } from "bun:test" import { testRender } from "@opentui/solid" -import type { V2Event } from "@opencode-ai/sdk/v2" +import type { OpenCodeEvent } from "@opencode-ai/client/promise" import { SessionMessage } from "@opencode-ai/core/session/message" import { EventV2 } from "@opencode-ai/core/event" import { onMount } from "solid-js" @@ -20,7 +20,7 @@ async function wait(fn: () => boolean, timeout = 2000) { } } -function emitEvent(events: ReturnType, event: V2Event) { +function emitEvent(events: ReturnType, event: OpenCodeEvent) { events.emit({ ...event, location: { directory } }) } diff --git a/packages/tui/test/cli/tui/use-event.test.tsx b/packages/tui/test/cli/tui/use-event.test.tsx index e401d6da67..04ae689b89 100644 --- a/packages/tui/test/cli/tui/use-event.test.tsx +++ b/packages/tui/test/cli/tui/use-event.test.tsx @@ -1,8 +1,8 @@ /** @jsxImportSource @opentui/solid */ import { describe, expect, test } from "bun:test" -import type { OpenCodeClient } from "@opencode-ai/client/promise" +import type { OpenCodeClient, OpenCodeEvent } from "@opencode-ai/client/promise" import { testRender } from "@opentui/solid" -import type { OpencodeClient, V2Event } from "@opencode-ai/sdk/v2" +import type { OpencodeClient } from "@opencode-ai/sdk/v2" import { onMount } from "solid-js" import { ProjectProvider, useProject } from "../../../src/context/project" import { SDKProvider, useSDK } from "../../../src/context/sdk" @@ -21,14 +21,17 @@ async function wait(fn: () => boolean, timeout = 2000) { } } -function event(payload: V2Event, input: { directory: string; project?: string; workspace?: string }): V2Event { +function event( + payload: OpenCodeEvent, + input: { directory: string; project?: string; workspace?: string }, +): OpenCodeEvent { return { ...payload, location: { directory: input.directory, workspaceID: input.workspace }, } } -function vcs(branch: string): V2Event { +function vcs(branch: string): OpenCodeEvent { return { id: `evt_vcs_${branch}`, created: 0, @@ -39,7 +42,7 @@ function vcs(branch: string): V2Event { } } -function update(version: string): V2Event { +function update(version: string): OpenCodeEvent { return { id: `evt_update_${version}`, created: 0, @@ -56,7 +59,7 @@ async function mount( ) { const events = createEventStream() const calls = createFetch(undefined, events) - const seen: V2Event[] = [] + const seen: OpenCodeEvent[] = [] const workspaces: Array = [] let project!: ReturnType let sdk!: ReturnType @@ -89,7 +92,7 @@ async function mount( } function Probe(props: { - seen: V2Event[] + seen: OpenCodeEvent[] workspaces: Array onReady: (ctx: { project: ReturnType; sdk: ReturnType }) => void }) { diff --git a/packages/tui/test/fixture/tui-sdk.ts b/packages/tui/test/fixture/tui-sdk.ts index 8d280cab80..536f1da1a3 100644 --- a/packages/tui/test/fixture/tui-sdk.ts +++ b/packages/tui/test/fixture/tui-sdk.ts @@ -1,6 +1,5 @@ -import { OpenCode } from "@opencode-ai/client/promise" +import { OpenCode, type OpenCodeEvent } from "@opencode-ai/client/promise" import { createOpencodeClient } from "@opencode-ai/sdk/v2" -import type { V2Event } from "@opencode-ai/sdk/v2" export const worktree = "/tmp/opencode" export const directory = `${worktree}/packages/tui` @@ -51,7 +50,7 @@ export function createEventStream() { } return { - emit(event: V2Event) { + emit(event: OpenCodeEvent) { send(v2, pending, event) }, v2() {