From 487e1bd76e97d8fd2c717c5e1b77375c328dc327 Mon Sep 17 00:00:00 2001 From: Dax Raad Date: Sun, 13 Sep 2026 17:39:10 -0400 Subject: [PATCH] refactor(protocol): remove workspace API --- V2_HTTP_API_AUDIT.md | 15 +- packages/app/e2e/utils/mock-server.ts | 5 - .../app/src/session/requests/auto-approve.ts | 4 +- packages/app/src/session/requests/model.ts | 2 +- packages/app/src/session/route.tsx | 2 +- .../app/src/workspaces/selection/dialog.tsx | 2 +- .../src/commands/handlers/session/export.ts | 1 - .../src/commands/handlers/session/import.ts | 2 +- packages/cli/src/mini.ts | 4 +- packages/cli/src/run/noninteractive.ts | 5 +- packages/cli/src/run/run.ts | 2 +- packages/cli/src/session-target.ts | 16 +- packages/cli/test/run/noninteractive.test.ts | 3 +- packages/cli/test/session-target.test.ts | 26 +- packages/client/script/build.ts | 5 +- packages/client/src/effect/api/api.ts | 613 +- .../client/src/effect/generated/client.ts | 26 +- .../client/src/promise/generated/client.ts | 32 +- .../client/src/promise/generated/types.ts | 673 +- packages/client/src/solid/data.ts | 12 +- packages/client/src/solid/pty.ts | 1 - packages/client/test/promise.test.ts | 16 - packages/client/test/solid-data.test.ts | 45 +- packages/client/test/solid-pty.test.ts | 6 +- .../test/fixtures/opencode-v2-openapi.json | 23590 ---------------- packages/codemode/test/openapi.test.ts | 9 +- packages/plugin-browser/src/connection.ts | 5 +- packages/protocol/openapi.json | 1014 +- packages/protocol/src/api.ts | 3 - packages/protocol/src/client.ts | 1 - packages/protocol/src/groups/debug.ts | 2 +- packages/protocol/src/groups/event.ts | 4 +- packages/protocol/src/groups/location.ts | 3 +- packages/protocol/src/groups/message.ts | 29 +- packages/protocol/src/groups/pty.ts | 2 +- packages/protocol/src/groups/session.ts | 57 +- packages/protocol/src/groups/workspace.ts | 38 - packages/schema/src/location.ts | 14 +- packages/sdk/src/effect/opencode.ts | 14 +- packages/sdk/src/internal/host.ts | 2 + packages/server/src/handlers.ts | 2 - packages/server/src/handlers/location.ts | 1 - packages/server/src/handlers/session.ts | 2 - packages/server/src/handlers/workspace.ts | 43 - packages/server/src/location.ts | 4 - packages/server/test/fetch.test.ts | 68 - packages/tui/src/app.tsx | 15 +- packages/tui/src/component/devtools-bar.tsx | 2 +- .../tui/src/component/dialog-integration.tsx | 2 +- packages/tui/src/component/dialog-mcp.tsx | 2 +- packages/tui/src/component/dialog-open.tsx | 29 +- .../tui/src/component/dialog-shell-output.tsx | 2 +- .../tui/src/component/dialog-workspaces.tsx | 3 +- .../tui/src/component/prompt/autocomplete.tsx | 1 - packages/tui/src/component/prompt/index.tsx | 6 +- packages/tui/src/component/prompt/move.tsx | 4 +- packages/tui/src/context/event.ts | 5 +- .../feature-plugins/system/diff-viewer.tsx | 2 +- packages/tui/src/mini/catalog.shared.ts | 1 - packages/tui/src/mini/runtime.ts | 4 +- packages/tui/src/mini/stream-v2.transport.ts | 14 +- .../tui/src/prompt/directory-completion.ts | 2 +- .../src/routes/session/composer/shell-tab.tsx | 2 +- packages/tui/src/routes/session/index.tsx | 5 +- packages/tui/src/routes/session/sidebar.tsx | 3 - packages/tui/test/cli/tui/data.test.tsx | 33 +- .../test/cli/tui/dialog-integration.test.tsx | 6 +- .../tui/test/cli/tui/dialog-open.test.tsx | 56 +- .../tui/test/cli/tui/prompt-move.test.tsx | 9 +- packages/tui/test/cli/tui/use-event.test.tsx | 37 +- .../component/dialog-shell-output.test.tsx | 6 +- packages/tui/test/mini/runtime.test.ts | 7 +- .../tui/test/mini/stream-v2.transport.test.ts | 28 +- packages/tui/test/prompt/autocomplete.test.ts | 16 +- services/www/openapi.json | 1014 +- services/www/public/openapi.json | 1014 +- 76 files changed, 1096 insertions(+), 27659 deletions(-) delete mode 100644 packages/codemode/test/fixtures/opencode-v2-openapi.json delete mode 100644 packages/protocol/src/groups/workspace.ts delete mode 100644 packages/server/src/handlers/workspace.ts diff --git a/V2_HTTP_API_AUDIT.md b/V2_HTTP_API_AUDIT.md index e6def474d48..4c9779eb67a 100644 --- a/V2_HTTP_API_AUDIT.md +++ b/V2_HTTP_API_AUDIT.md @@ -1,7 +1,7 @@ # V2 HTTP API audit checklist **Source:** `packages/protocol/openapi.json` -**Current endpoint count:** 142 +**Current endpoint count:** 140 **Last regenerated:** 2026-09-13 ## How to use this checklist @@ -28,7 +28,7 @@ Review endpoints in document order. For each endpoint, select one disposition an ## Progress -- [ ] Group 1: Foundation and placement (6) +- [ ] Group 1: Foundation and placement (4) - [ ] Group 2: Configuration and capability catalogs (17) - [ ] Group 3: Credentials, integrations, MCP, and web search (22) - [ ] Group 4: Session lifecycle (12) @@ -53,18 +53,21 @@ Review endpoints in document order. For each endpoint, select one disposition an - **Replacement:** `GET /api/location`, using `project` from the response. - **Notes:** The endpoint duplicated `Location.Info.project`; production callers were migrated. +### [x] `POST /api/workspace` and `DELETE /api/workspace/{workspaceID}` + +- **Decision:** Remove +- **Notes:** Provider-backed workspaces are not part of the V2 HTTP contract and can be introduced later. Core and the embedded SDK retain internal workspace support. + ## Group 1: Foundation and placement -**Endpoints:** 6 +**Endpoints:** 4 | Done | Method | Path | Operation ID | Decision | Notes | |---|---|---|---|---|---| | [x] 001–002 | `GET` | `/api/status` | `server.status` | Keep | Replaces the former health and server endpoints. | -| [ ] 003 | `GET` | `/api/location` | `location.get` | | | +| [x] 003 | `GET` | `/api/location` | `location.get` | Keep | Workspace selectors and response fields removed until workspace support ships. | | [ ] 004 | `GET` | `/api/project` | `project.list` | | | | [ ] 005 | `PATCH` | `/api/project/{projectID}` | `project.update` | | | -| [ ] 006 | `POST` | `/api/workspace` | `workspace.create` | Proposed remove | Awaiting feedback in `#core`. | -| [ ] 007 | `DELETE` | `/api/workspace/{workspaceID}` | `workspace.destroy` | Proposed remove | Awaiting feedback in `#core`. | ## Group 2: Configuration and capability catalogs diff --git a/packages/app/e2e/utils/mock-server.ts b/packages/app/e2e/utils/mock-server.ts index ec085f3c738..b844fd550c8 100644 --- a/packages/app/e2e/utils/mock-server.ts +++ b/packages/app/e2e/utils/mock-server.ts @@ -652,11 +652,6 @@ export function currentSession(session: { id: string } & Record : typeof session.directory === "string" ? session.directory : fallbackDirectory, - ...(typeof session.workspaceID === "string" - ? { workspaceID: session.workspaceID } - : "workspaceID" in location && typeof location.workspaceID === "string" - ? { workspaceID: location.workspaceID } - : {}), }, subpath: session.subpath ?? session.path, revert: session.revert, diff --git a/packages/app/src/session/requests/auto-approve.ts b/packages/app/src/session/requests/auto-approve.ts index 7efa1b2820d..88a725e67ad 100644 --- a/packages/app/src/session/requests/auto-approve.ts +++ b/packages/app/src/session/requests/auto-approve.ts @@ -60,7 +60,7 @@ export function createPermissionAutoApprover(input: { sdk: ServerSDK; data: Data const listed = await Promise.all( inventory.locations.map((location) => input.sdk.api.permission.request - .list({ location: { directory: location.directory, workspace: location.workspaceID } }) + .list({ location: { directory: location.directory } }) .then((pending) => { if (!state.disposed) pending.data.forEach((request) => approve(request)) return true @@ -103,7 +103,7 @@ export function createPermissionAutoApprover(input: { sdk: ServerSDK; data: Data ] return { locations: [ - ...new Map(locations.map((item) => [`${item.directory}\u0000${item.workspaceID ?? ""}`, item])).values(), + ...new Map(locations.map((item) => [item.directory, item])).values(), ], complete: active !== undefined && synced.every(Boolean), } diff --git a/packages/app/src/session/requests/model.ts b/packages/app/src/session/requests/model.ts index 98db702113d..2f5c4cebda8 100644 --- a/packages/app/src/session/requests/model.ts +++ b/packages/app/src/session/requests/model.ts @@ -48,7 +48,7 @@ export function createSessionRequestModel() { providers: async (sessionID) => { const session = data.session.get(sessionID) ?? (await serverSDK.api.session.get({ sessionID })) const result = await serverSDK.api.websearch.providers({ - location: { directory: session.location.directory, workspace: session.location.workspaceID }, + location: { directory: session.location.directory }, }) return result.data.map((provider) => ({ value: provider.id, label: provider.name })) }, diff --git a/packages/app/src/session/route.tsx b/packages/app/src/session/route.tsx index 26c1d4c13e9..0900b868de3 100644 --- a/packages/app/src/session/route.tsx +++ b/packages/app/src/session/route.tsx @@ -136,7 +136,7 @@ function ResolvedTargetSessionRoute() { > }> {(value) => ( - current()?.location.workspaceID}> + diff --git a/packages/app/src/workspaces/selection/dialog.tsx b/packages/app/src/workspaces/selection/dialog.tsx index d3c3c3fb67a..0185cac40b3 100644 --- a/packages/app/src/workspaces/selection/dialog.tsx +++ b/packages/app/src/workspaces/selection/dialog.tsx @@ -77,7 +77,7 @@ export function DirectoryPickerDialog(props: DirectoryPickerDialogProps) { const home = createMemo(() => sync.data.path.home || "") const location = createMemo(() => { const current = props.location ?? fallbackPath() - return current ? { directory: current.directory, workspace: current.workspaceID } : undefined + return current ? { directory: current.directory } : undefined }) const start = createMemo( () => diff --git a/packages/cli/src/commands/handlers/session/export.ts b/packages/cli/src/commands/handlers/session/export.ts index 27840b787a4..4cf2be2a760 100644 --- a/packages/cli/src/commands/handlers/session/export.ts +++ b/packages/cli/src/commands/handlers/session/export.ts @@ -36,7 +36,6 @@ export default Runtime.handler( try: () => client.session.list({ directory: location.directory, - workspace: location.workspaceID, parentID: null, order: "desc", limit: 50, diff --git a/packages/cli/src/commands/handlers/session/import.ts b/packages/cli/src/commands/handlers/session/import.ts index 970eb510f0e..d1d5cc5f25c 100644 --- a/packages/cli/src/commands/handlers/session/import.ts +++ b/packages/cli/src/commands/handlers/session/import.ts @@ -44,7 +44,7 @@ export default Runtime.handler( headers: { ...Service.headers(server.endpoint), "content-type": "application/json" }, body: JSON.stringify({ ...encoded, - location: { directory: location.directory, workspaceID: location.workspaceID }, + location: { directory: location.directory }, }), }), ) diff --git a/packages/cli/src/mini.ts b/packages/cli/src/mini.ts index aeeda5570d4..f8235e332c9 100644 --- a/packages/cli/src/mini.ts +++ b/packages/cli/src/mini.ts @@ -81,7 +81,7 @@ export async function runMini(input: MiniCommandInput) { const create = ( client: OpenCodeClient, next: { - location: { directory: string; workspaceID?: string } + location: { directory: string } agent: string | undefined model: Model variant: string | undefined @@ -90,7 +90,7 @@ export async function runMini(input: MiniCommandInput) { ) => resolveSessionTarget({ client, - location: { directory: next.location.directory, workspace: next.location.workspaceID }, + location: { directory: next.location.directory }, agent: next.agent, environment, model: next.model diff --git a/packages/cli/src/run/noninteractive.ts b/packages/cli/src/run/noninteractive.ts index ac21f21d1ab..c4a89e483d9 100644 --- a/packages/cli/src/run/noninteractive.ts +++ b/packages/cli/src/run/noninteractive.ts @@ -700,7 +700,7 @@ export async function runNonInteractivePrompt(input: Input) { ? Promise.resolve(undefined) : input.client.form.request .list({ - location: { directory: input.location.directory, workspace: input.location.workspaceID }, + location: { directory: input.location.directory }, }) .catch(() => undefined), ]) @@ -745,7 +745,7 @@ export async function runNonInteractivePrompt(input: Input) { } function sameLocation(left: LocationRef | undefined, right: LocationRef) { - return !!left && left.directory === right.directory && left.workspaceID === right.workspaceID + return !!left && left.directory === right.directory } function formRequestOptions(location: LocationRef | undefined): [] | [{ headers: Record }] { @@ -754,7 +754,6 @@ function formRequestOptions(location: LocationRef | undefined): [] | [{ headers: { headers: { "x-opencode-directory": encodeURIComponent(location.directory), - ...(location.workspaceID ? { "x-opencode-workspace": location.workspaceID } : {}), }, }, ] diff --git a/packages/cli/src/run/run.ts b/packages/cli/src/run/run.ts index 41e0b1b795b..db70d209abc 100644 --- a/packages/cli/src/run/run.ts +++ b/packages/cli/src/run/run.ts @@ -105,7 +105,7 @@ async function execute(input: RunCommandInput, prepared: Prepared, endpoint: End next.model ?? (options.variant ? await client.model - .default({ location: { directory: next.location.directory, workspace: next.location.workspaceID } }) + .default({ location: { directory: next.location.directory } }) .then((result) => result.data) : undefined) const model = selected diff --git a/packages/cli/src/session-target.ts b/packages/cli/src/session-target.ts index 2896492b3eb..2438a4a8557 100644 --- a/packages/cli/src/session-target.ts +++ b/packages/cli/src/session-target.ts @@ -46,7 +46,7 @@ export async function resolveSessionTarget(input: { selection.location ?? (await resolveLocation( input.client, - selected ? { directory: selected.location.directory, workspace: selected.location.workspaceID } : input.location, + selected ? { directory: selected.location.directory } : input.location, input.signal, )) const prepared = await input.prepare({ @@ -64,14 +64,14 @@ export async function resolveSessionTarget(input: { { agent: prepared.agent, model: prepared.model, - location: { directory: location.directory, workspaceID: location.workspaceID }, + location: { directory: location.directory }, }, ...requestOptions(input.signal), ) .catch((error) => { throw new SessionTargetMutationError(error) })) - if (input.environment !== undefined && location.workspaceID === undefined) + if (input.environment !== undefined) await input.client.session .environment({ sessionID: session.id, variables: input.environment }, ...requestOptions(input.signal)) .catch((error) => { @@ -94,7 +94,7 @@ export function parseSessionTargetModel(value?: string): ModelRef | undefined { async function selectSession(input: { client: OpenCodeClient - location?: { directory?: string; workspace?: string } + location?: { directory?: string } continue?: boolean session?: string fork?: boolean @@ -143,7 +143,6 @@ async function latestSession( const page = await client.session.list( { directory: location.directory, - workspace: location.workspaceID, parentID: null, limit: SESSION_PAGE_LIMIT, order: "desc", @@ -151,10 +150,7 @@ async function latestSession( }, ...requestOptions(signal), ) - const selected = page.data.find( - (session) => - session.location.directory === location.directory && session.location.workspaceID === location.workspaceID, - ) + const selected = page.data.find((session) => session.location.directory === location.directory) if (selected) return selected if (!page.cursor.next || page.data.length === 0) return return latestSession(client, location, page.cursor.next, signal) @@ -162,7 +158,7 @@ async function latestSession( function resolveLocation( client: OpenCodeClient, - location?: { directory?: string; workspace?: string }, + location?: { directory?: string }, signal?: AbortSignal, ) { if (!location && !signal) return client.location.get() diff --git a/packages/cli/test/run/noninteractive.test.ts b/packages/cli/test/run/noninteractive.test.ts index a9399e293b6..4b0a4da3bf1 100644 --- a/packages/cli/test/run/noninteractive.test.ts +++ b/packages/cli/test/run/noninteractive.test.ts @@ -424,14 +424,13 @@ describe("runNonInteractivePrompt", () => { const globalOptions = { headers: { "x-opencode-directory": "%2Fwork%20tree", - "x-opencode-workspace": "wrk_1", }, } expect(sdk.form.cancel).toHaveBeenCalledWith({ sessionID: "global", formID: "frm_live" }, globalOptions) expect(sdk.form.cancel).toHaveBeenCalledWith({ sessionID: "ses_1", formID: "frm_pending" }) expect(sdk.form.cancel).toHaveBeenCalledWith({ sessionID: "global", formID: "frm_pending_global" }, globalOptions) expect(sdk.form.request.list).toHaveBeenCalledWith({ - location: { directory: "/work tree", workspace: "wrk_1" }, + location: { directory: "/work tree" }, }) }) diff --git a/packages/cli/test/session-target.test.ts b/packages/cli/test/session-target.test.ts index 301de51cb26..00a5b30e670 100644 --- a/packages/cli/test/session-target.test.ts +++ b/packages/cli/test/session-target.test.ts @@ -2,16 +2,16 @@ import { afterEach, describe, expect, mock, spyOn, test } from "bun:test" import { OpenCode, type LocationGetOutput, type ModelRef, type SessionInfo } from "@opencode/client/promise" import { resolveSessionTarget, SessionTargetMutationError } from "../src/session-target" -function location(directory: string, workspaceID?: string): LocationGetOutput { - return { directory, workspaceID, project: { id: "project", directory, canonical: directory } } +function location(directory: string): LocationGetOutput { + return { directory, project: { id: "project", directory, canonical: directory } } } -function session(id: string, directory: string, workspaceID?: string, model?: ModelRef): SessionInfo { +function session(id: string, directory: string, model?: ModelRef): SessionInfo { return { id, projectID: "project", title: id, - location: { directory, workspaceID }, + location: { directory }, model, cost: 0, tokens: { input: 0, output: 0, reasoning: 0, cache: { read: 0, write: 0 } }, @@ -29,23 +29,23 @@ afterEach(() => mock.restore()) describe("session target resolver", () => { test("adopts an explicit Session location and model", async () => { const client = OpenCode.make({ baseUrl: "https://opencode.test" }) - const selected = session("ses_resume", "/session", "work_1", { providerID: "openai", id: "gpt-5" }) + const selected = session("ses_resume", "/session", { providerID: "openai", id: "gpt-5" }) spyOn(client.session, "get").mockResolvedValue(selected) - spyOn(client.location, "get").mockResolvedValue(location("/session", "work_1")) + spyOn(client.location, "get").mockResolvedValue(location("/session")) const target = await resolveSessionTarget({ client, session: selected.id, prepare }) expect(target).toMatchObject({ session: { id: "ses_resume" }, - location: { directory: "/session", workspaceID: "work_1" }, + location: { directory: "/session" }, model: { providerID: "openai", id: "gpt-5" }, resume: true, }) }) - test("paginates to continue the exact implicit workspace", async () => { + test("paginates to continue the exact directory", async () => { const client = OpenCode.make({ baseUrl: "https://opencode.test" }) spyOn(client.location, "get").mockResolvedValue(location("/project")) - const explicit = Array.from({ length: 50 }, (_, index) => session(`ses_${index}`, "/project", `work_${index}`)) + const explicit = Array.from({ length: 50 }, (_, index) => session(`ses_${index}`, `/other/${index}`)) const list = spyOn(client.session, "list") .mockResolvedValueOnce({ data: explicit, cursor: { next: "page_2" } }) .mockResolvedValueOnce({ data: [session("ses_implicit", "/project")], cursor: {} }) @@ -78,11 +78,11 @@ describe("session target resolver", () => { test("prepares a fresh Session at the server Location before creation", async () => { const client = OpenCode.make({ baseUrl: "https://opencode.test" }) const order: string[] = [] - spyOn(client.location, "get").mockResolvedValue(location("/server", "work_1")) + spyOn(client.location, "get").mockResolvedValue(location("/server")) const create = spyOn(client.session, "create").mockImplementation(async (input) => { order.push("create") - expect(input).toMatchObject({ agent: "prepared", location: { directory: "/server", workspaceID: "work_1" } }) - return session("ses_fresh", "/server", "work_1") + expect(input).toMatchObject({ agent: "prepared", location: { directory: "/server" } }) + return session("ses_fresh", "/server") }) await resolveSessionTarget({ @@ -90,7 +90,7 @@ describe("session target resolver", () => { agent: "requested", prepare: async (input) => { order.push("prepare") - expect(input.location.workspaceID).toBe("work_1") + expect(input.location.directory).toBe("/server") return { model: input.model, agent: "prepared" } }, }) diff --git a/packages/client/script/build.ts b/packages/client/script/build.ts index e5e11e16b64..16121a1d1ce 100644 --- a/packages/client/script/build.ts +++ b/packages/client/script/build.ts @@ -35,7 +35,6 @@ import { Shell } from "@opencode/schema/shell" import { Skill } from "@opencode/schema/skill" import { Vcs } from "@opencode/schema/vcs" import { WebSearch } from "@opencode/schema/websearch" -import { Workspace } from "@opencode/schema/workspace" import { Effect, Schema } from "effect" import { fileURLToPath } from "url" @@ -53,7 +52,8 @@ const effectTypeReferences = [ ...namespaceTypes("Form", "@opencode/schema/form", Form), ...namespaceTypes("InstructionEntry", "@opencode/schema/instruction-entry", InstructionEntry), ...namespaceTypes("Integration", "@opencode/schema/integration", Integration), - ...namespaceTypes("Location", "@opencode/schema/location", Location), + typeReference("Location.PublicRef", "@opencode/schema/location", Location.PublicRef), + typeReference("Location.PublicInfo", "@opencode/schema/location", Location.PublicInfo), ...namespaceTypes("Mcp", "@opencode/schema/mcp", Mcp), ...namespaceTypes("Model", "@opencode/schema/model", Model), ...namespaceTypes("Permission", "@opencode/schema/permission", Permission), @@ -74,7 +74,6 @@ const effectTypeReferences = [ ...namespaceTypes("Skill", "@opencode/schema/skill", Skill), ...namespaceTypes("Vcs", "@opencode/schema/vcs", Vcs), ...namespaceTypes("WebSearch", "@opencode/schema/websearch", WebSearch), - ...namespaceTypes("Workspace", "@opencode/schema/workspace", Workspace), typeReference("Prompt", "@opencode/schema/prompt", Prompt), typeReference("PromptMention", "@opencode/schema/prompt", PromptMention), typeReference("FileAttachment", "@opencode/schema/prompt", FileAttachment), diff --git a/packages/client/src/effect/api/api.ts b/packages/client/src/effect/api/api.ts index 018daf3e79f..90fcdef232e 100644 --- a/packages/client/src/effect/api/api.ts +++ b/packages/client/src/effect/api/api.ts @@ -3,7 +3,6 @@ import type { Effect, Stream } from "effect" import type { Location } from "@opencode/schema/location" import type { Agent } from "@opencode/schema/agent" import type { Plugin } from "@opencode/schema/plugin" -import type { Workspace } from "@opencode/schema/workspace" import type { Session } from "@opencode/schema/session" import type { AbsolutePath } from "@opencode/schema/schema" import type { Project } from "@opencode/schema/project" @@ -51,27 +50,23 @@ export interface ServerApi { readonly status: ServerStatusOperation } -export type LocationGetInput = { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined -} -export type LocationGetOutput = Location.Info +export type LocationGetInput = { readonly location?: { readonly directory?: string | undefined } | undefined } +export type LocationGetOutput = Location.PublicInfo export type LocationGetOperation = (input?: LocationGetInput) => Effect.Effect export interface LocationApi { readonly get: LocationGetOperation } -export type AgentListInput = { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined -} -export type AgentListOutput = { readonly location: Location.Info; readonly data: ReadonlyArray } +export type AgentListInput = { readonly location?: { readonly directory?: string | undefined } | undefined } +export type AgentListOutput = { readonly location: Location.PublicInfo; readonly data: ReadonlyArray } export type AgentListOperation = (input?: AgentListInput) => Effect.Effect export type AgentGetInput = { readonly agentID: Agent.ID - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined + readonly location?: { readonly directory?: string | undefined } | undefined } -export type AgentGetOutput = { readonly location: Location.Info; readonly data: Agent.Info } +export type AgentGetOutput = { readonly location: Location.PublicInfo; readonly data: Agent.Info } export type AgentGetOperation = (input: AgentGetInput) => Effect.Effect export interface AgentApi { @@ -79,29 +74,25 @@ export interface AgentApi { readonly get: AgentGetOperation } -export type PluginListInput = { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined -} -export type PluginListOutput = { readonly location: Location.Info; readonly data: ReadonlyArray } +export type PluginListInput = { readonly location?: { readonly directory?: string | undefined } | undefined } +export type PluginListOutput = { readonly location: Location.PublicInfo; readonly data: ReadonlyArray } export type PluginListOperation = (input?: PluginListInput) => Effect.Effect -export type PluginAwaitActivationInput = { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined -} +export type PluginAwaitActivationInput = { readonly location?: { readonly directory?: string | undefined } | undefined } export type PluginAwaitActivationOutput = void export type PluginAwaitActivationOperation = ( input?: PluginAwaitActivationInput, ) => Effect.Effect export type PluginCheckInput = { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined + readonly location?: { readonly directory?: string | undefined } | undefined readonly target?: string | undefined } -export type PluginCheckOutput = { readonly location: Location.Info; readonly data: ReadonlyArray } +export type PluginCheckOutput = { readonly location: Location.PublicInfo; readonly data: ReadonlyArray } export type PluginCheckOperation = (input?: PluginCheckInput) => Effect.Effect export type PluginUpdateInput = { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined + readonly location?: { readonly directory?: string | undefined } | undefined readonly targets: ReadonlyArray } export type PluginUpdateOutput = void @@ -115,7 +106,6 @@ export interface PluginApi { } export type SessionListInput = { - readonly workspace?: Workspace.ID | undefined readonly limit?: number | undefined readonly order?: "asc" | "desc" | undefined readonly search?: string | undefined @@ -204,7 +194,7 @@ export type SessionCreateInput = { readonly title?: string | undefined readonly agent?: Agent.ID | undefined readonly model?: Model.Ref | undefined - readonly location?: Location.Ref | undefined + readonly location?: Location.PublicRef | undefined readonly metadata?: Session.Metadata | undefined readonly permissions?: Permission.Ruleset | undefined } @@ -214,7 +204,7 @@ export type SessionCreateOperation = (input?: SessionCreateInput) => export type SessionImportInput = { readonly info: Session.Info readonly messages: ReadonlyArray - readonly location?: Location.Ref | undefined + readonly location?: Location.PublicRef | undefined } export type SessionImportOutput = Session.Info export type SessionImportOperation = (input: SessionImportInput) => Effect.Effect @@ -257,7 +247,6 @@ export type SessionRenameOperation = (input: SessionRenameInput) => E export type SessionMoveInput = { readonly sessionID: Session.ID readonly directory: AbsolutePath - readonly workspaceID?: Workspace.ID | undefined readonly delivery?: SessionInbox.Delivery | undefined } export type SessionMoveOutput = void @@ -432,11 +421,19 @@ export type SessionLogOutput = readonly metadata?: { readonly [x: string]: unknown } | undefined readonly type: "session.created" readonly durable: { readonly aggregateID: string; readonly seq: Event.Seq; readonly version: Event.Version } - readonly location?: Location.Ref | undefined + readonly location?: + | { + readonly directory: AbsolutePath + readonly workspaceID?: (string & Brand.Brand<"Workspace.ID">) | undefined + } + | undefined readonly data: { readonly sessionID: Session.ID readonly projectID: Project.ID - readonly location: Location.Ref + readonly location: { + readonly directory: AbsolutePath + readonly workspaceID?: (string & Brand.Brand<"Workspace.ID">) | undefined + } readonly subpath?: RelativePath | undefined readonly parentID?: Session.ID | undefined readonly slug: string @@ -454,7 +451,12 @@ export type SessionLogOutput = readonly metadata?: { readonly [x: string]: unknown } | undefined readonly type: "session.agent.selected" readonly durable: { readonly aggregateID: string; readonly seq: Event.Seq; readonly version: Event.Version } - readonly location?: Location.Ref | undefined + readonly location?: + | { + readonly directory: AbsolutePath + readonly workspaceID?: (string & Brand.Brand<"Workspace.ID">) | undefined + } + | undefined readonly data: { readonly sessionID: Session.ID readonly agent: Agent.ID @@ -467,7 +469,12 @@ export type SessionLogOutput = readonly metadata?: { readonly [x: string]: unknown } | undefined readonly type: "session.model.selected" readonly durable: { readonly aggregateID: string; readonly seq: Event.Seq; readonly version: Event.Version } - readonly location?: Location.Ref | undefined + readonly location?: + | { + readonly directory: AbsolutePath + readonly workspaceID?: (string & Brand.Brand<"Workspace.ID">) | undefined + } + | undefined readonly data: { readonly sessionID: Session.ID readonly model: Model.Ref @@ -480,10 +487,18 @@ export type SessionLogOutput = readonly metadata?: { readonly [x: string]: unknown } | undefined readonly type: "session.moved" readonly durable: { readonly aggregateID: string; readonly seq: Event.Seq; readonly version: Event.Version } - readonly location?: Location.Ref | undefined + readonly location?: + | { + readonly directory: AbsolutePath + readonly workspaceID?: (string & Brand.Brand<"Workspace.ID">) | undefined + } + | undefined readonly data: { readonly sessionID: Session.ID - readonly location: Location.Ref + readonly location: { + readonly directory: AbsolutePath + readonly workspaceID?: (string & Brand.Brand<"Workspace.ID">) | undefined + } readonly projectID: Project.ID readonly subpath?: RelativePath | undefined } @@ -494,7 +509,12 @@ export type SessionLogOutput = readonly metadata?: { readonly [x: string]: unknown } | undefined readonly type: "session.renamed" readonly durable: { readonly aggregateID: string; readonly seq: Event.Seq; readonly version: Event.Version } - readonly location?: Location.Ref | undefined + readonly location?: + | { + readonly directory: AbsolutePath + readonly workspaceID?: (string & Brand.Brand<"Workspace.ID">) | undefined + } + | undefined readonly data: { readonly sessionID: Session.ID; readonly title: string } } | { @@ -503,7 +523,12 @@ export type SessionLogOutput = readonly metadata?: { readonly [x: string]: unknown } | undefined readonly type: "session.permissions.updated" readonly durable: { readonly aggregateID: string; readonly seq: Event.Seq; readonly version: Event.Version } - readonly location?: Location.Ref | undefined + readonly location?: + | { + readonly directory: AbsolutePath + readonly workspaceID?: (string & Brand.Brand<"Workspace.ID">) | undefined + } + | undefined readonly data: { readonly sessionID: Session.ID; readonly permissions: Permission.Ruleset } } | { @@ -512,7 +537,12 @@ export type SessionLogOutput = readonly metadata?: { readonly [x: string]: unknown } | undefined readonly type: "session.viewed" readonly durable: { readonly aggregateID: string; readonly seq: Event.Seq; readonly version: Event.Version } - readonly location?: Location.Ref | undefined + readonly location?: + | { + readonly directory: AbsolutePath + readonly workspaceID?: (string & Brand.Brand<"Workspace.ID">) | undefined + } + | undefined readonly data: { readonly sessionID: Session.ID; readonly idle: number } } | { @@ -521,7 +551,12 @@ export type SessionLogOutput = readonly metadata?: { readonly [x: string]: unknown } | undefined readonly type: "session.deleted" readonly durable: { readonly aggregateID: string; readonly seq: Event.Seq; readonly version: Event.Version } - readonly location?: Location.Ref | undefined + readonly location?: + | { + readonly directory: AbsolutePath + readonly workspaceID?: (string & Brand.Brand<"Workspace.ID">) | undefined + } + | undefined readonly data: { readonly sessionID: Session.ID } } | { @@ -530,7 +565,12 @@ export type SessionLogOutput = readonly metadata?: { readonly [x: string]: unknown } | undefined readonly type: "session.forked" readonly durable: { readonly aggregateID: string; readonly seq: Event.Seq; readonly version: Event.Version } - readonly location?: Location.Ref | undefined + readonly location?: + | { + readonly directory: AbsolutePath + readonly workspaceID?: (string & Brand.Brand<"Workspace.ID">) | undefined + } + | undefined readonly data: { readonly sessionID: Session.ID readonly parentID: Session.ID @@ -547,7 +587,12 @@ export type SessionLogOutput = readonly metadata?: { readonly [x: string]: unknown } | undefined readonly type: "session.inbox.delivered" readonly durable: { readonly aggregateID: string; readonly seq: Event.Seq; readonly version: Event.Version } - readonly location?: Location.Ref | undefined + readonly location?: + | { + readonly directory: AbsolutePath + readonly workspaceID?: (string & Brand.Brand<"Workspace.ID">) | undefined + } + | undefined readonly data: { readonly sessionID: Session.ID; readonly inboxID: SessionMessage.ID } } | { @@ -556,7 +601,12 @@ export type SessionLogOutput = readonly metadata?: { readonly [x: string]: unknown } | undefined readonly type: "session.inbox.enqueued" readonly durable: { readonly aggregateID: string; readonly seq: Event.Seq; readonly version: Event.Version } - readonly location?: Location.Ref | undefined + readonly location?: + | { + readonly directory: AbsolutePath + readonly workspaceID?: (string & Brand.Brand<"Workspace.ID">) | undefined + } + | undefined readonly data: { readonly sessionID: Session.ID readonly inboxID: SessionMessage.ID @@ -569,7 +619,12 @@ export type SessionLogOutput = readonly metadata?: { readonly [x: string]: unknown } | undefined readonly type: "session.inbox.cancelled" readonly durable: { readonly aggregateID: string; readonly seq: Event.Seq; readonly version: Event.Version } - readonly location?: Location.Ref | undefined + readonly location?: + | { + readonly directory: AbsolutePath + readonly workspaceID?: (string & Brand.Brand<"Workspace.ID">) | undefined + } + | undefined readonly data: { readonly sessionID: Session.ID; readonly inboxID: SessionMessage.ID } } | { @@ -578,7 +633,12 @@ export type SessionLogOutput = readonly metadata?: { readonly [x: string]: unknown } | undefined readonly type: "session.inbox.delivery.changed" readonly durable: { readonly aggregateID: string; readonly seq: Event.Seq; readonly version: Event.Version } - readonly location?: Location.Ref | undefined + readonly location?: + | { + readonly directory: AbsolutePath + readonly workspaceID?: (string & Brand.Brand<"Workspace.ID">) | undefined + } + | undefined readonly data: { readonly sessionID: Session.ID readonly inboxID: SessionMessage.ID @@ -591,7 +651,12 @@ export type SessionLogOutput = readonly metadata?: { readonly [x: string]: unknown } | undefined readonly type: "session.execution.started" readonly durable: { readonly aggregateID: string; readonly seq: Event.Seq; readonly version: Event.Version } - readonly location?: Location.Ref | undefined + readonly location?: + | { + readonly directory: AbsolutePath + readonly workspaceID?: (string & Brand.Brand<"Workspace.ID">) | undefined + } + | undefined readonly data: { readonly sessionID: Session.ID } } | { @@ -600,7 +665,12 @@ export type SessionLogOutput = readonly metadata?: { readonly [x: string]: unknown } | undefined readonly type: "session.execution.succeeded" readonly durable: { readonly aggregateID: string; readonly seq: Event.Seq; readonly version: Event.Version } - readonly location?: Location.Ref | undefined + readonly location?: + | { + readonly directory: AbsolutePath + readonly workspaceID?: (string & Brand.Brand<"Workspace.ID">) | undefined + } + | undefined readonly data: { readonly sessionID: Session.ID } } | { @@ -609,7 +679,12 @@ export type SessionLogOutput = readonly metadata?: { readonly [x: string]: unknown } | undefined readonly type: "session.execution.failed" readonly durable: { readonly aggregateID: string; readonly seq: Event.Seq; readonly version: Event.Version } - readonly location?: Location.Ref | undefined + readonly location?: + | { + readonly directory: AbsolutePath + readonly workspaceID?: (string & Brand.Brand<"Workspace.ID">) | undefined + } + | undefined readonly data: { readonly sessionID: Session.ID readonly error: { readonly type: string; readonly message: string; readonly status?: number | undefined } @@ -621,7 +696,12 @@ export type SessionLogOutput = readonly metadata?: { readonly [x: string]: unknown } | undefined readonly type: "session.execution.interrupted" readonly durable: { readonly aggregateID: string; readonly seq: Event.Seq; readonly version: Event.Version } - readonly location?: Location.Ref | undefined + readonly location?: + | { + readonly directory: AbsolutePath + readonly workspaceID?: (string & Brand.Brand<"Workspace.ID">) | undefined + } + | undefined readonly data: { readonly sessionID: Session.ID readonly reason: "user" | "shutdown" | "superseded" | "inactivity" @@ -633,7 +713,12 @@ export type SessionLogOutput = readonly metadata?: { readonly [x: string]: unknown } | undefined readonly type: "session.instructions.updated" readonly durable: { readonly aggregateID: string; readonly seq: Event.Seq; readonly version: Event.Version } - readonly location?: Location.Ref | undefined + readonly location?: + | { + readonly directory: AbsolutePath + readonly workspaceID?: (string & Brand.Brand<"Workspace.ID">) | undefined + } + | undefined readonly data: { readonly sessionID: Session.ID readonly delta: { readonly [x: string]: (string & Brand.Brand<"Instruction.Hash">) | "removed" } @@ -646,7 +731,12 @@ export type SessionLogOutput = readonly metadata?: { readonly [x: string]: unknown } | undefined readonly type: "session.synthetic" readonly durable: { readonly aggregateID: string; readonly seq: Event.Seq; readonly version: Event.Version } - readonly location?: Location.Ref | undefined + readonly location?: + | { + readonly directory: AbsolutePath + readonly workspaceID?: (string & Brand.Brand<"Workspace.ID">) | undefined + } + | undefined readonly data: { readonly sessionID: Session.ID readonly text: string @@ -660,7 +750,12 @@ export type SessionLogOutput = readonly metadata?: { readonly [x: string]: unknown } | undefined readonly type: "session.skill.activated" readonly durable: { readonly aggregateID: string; readonly seq: Event.Seq; readonly version: Event.Version } - readonly location?: Location.Ref | undefined + readonly location?: + | { + readonly directory: AbsolutePath + readonly workspaceID?: (string & Brand.Brand<"Workspace.ID">) | undefined + } + | undefined readonly data: { readonly sessionID: Session.ID readonly id: Skill.ID @@ -674,7 +769,12 @@ export type SessionLogOutput = readonly metadata?: { readonly [x: string]: unknown } | undefined readonly type: "session.shell.started" readonly durable: { readonly aggregateID: string; readonly seq: Event.Seq; readonly version: Event.Version } - readonly location?: Location.Ref | undefined + readonly location?: + | { + readonly directory: AbsolutePath + readonly workspaceID?: (string & Brand.Brand<"Workspace.ID">) | undefined + } + | undefined readonly data: { readonly sessionID: Session.ID; readonly shell: Shell.Info } } | { @@ -683,7 +783,12 @@ export type SessionLogOutput = readonly metadata?: { readonly [x: string]: unknown } | undefined readonly type: "session.shell.ended" readonly durable: { readonly aggregateID: string; readonly seq: Event.Seq; readonly version: Event.Version } - readonly location?: Location.Ref | undefined + readonly location?: + | { + readonly directory: AbsolutePath + readonly workspaceID?: (string & Brand.Brand<"Workspace.ID">) | undefined + } + | undefined readonly data: { readonly sessionID: Session.ID readonly shell: Shell.Info @@ -701,7 +806,12 @@ export type SessionLogOutput = readonly metadata?: { readonly [x: string]: unknown } | undefined readonly type: "session.step.started" readonly durable: { readonly aggregateID: string; readonly seq: Event.Seq; readonly version: Event.Version } - readonly location?: Location.Ref | undefined + readonly location?: + | { + readonly directory: AbsolutePath + readonly workspaceID?: (string & Brand.Brand<"Workspace.ID">) | undefined + } + | undefined readonly data: { readonly sessionID: Session.ID readonly assistantMessageID: SessionMessage.ID @@ -716,7 +826,12 @@ export type SessionLogOutput = readonly metadata?: { readonly [x: string]: unknown } | undefined readonly type: "session.step.streamed" readonly durable: { readonly aggregateID: string; readonly seq: Event.Seq; readonly version: Event.Version } - readonly location?: Location.Ref | undefined + readonly location?: + | { + readonly directory: AbsolutePath + readonly workspaceID?: (string & Brand.Brand<"Workspace.ID">) | undefined + } + | undefined readonly data: { readonly sessionID: Session.ID; readonly assistantMessageID: SessionMessage.ID } } | { @@ -725,7 +840,12 @@ export type SessionLogOutput = readonly metadata?: { readonly [x: string]: unknown } | undefined readonly type: "session.step.ended" readonly durable: { readonly aggregateID: string; readonly seq: Event.Seq; readonly version: Event.Version } - readonly location?: Location.Ref | undefined + readonly location?: + | { + readonly directory: AbsolutePath + readonly workspaceID?: (string & Brand.Brand<"Workspace.ID">) | undefined + } + | undefined readonly data: { readonly sessionID: Session.ID readonly assistantMessageID: SessionMessage.ID @@ -749,7 +869,12 @@ export type SessionLogOutput = readonly metadata?: { readonly [x: string]: unknown } | undefined readonly type: "session.step.failed" readonly durable: { readonly aggregateID: string; readonly seq: Event.Seq; readonly version: Event.Version } - readonly location?: Location.Ref | undefined + readonly location?: + | { + readonly directory: AbsolutePath + readonly workspaceID?: (string & Brand.Brand<"Workspace.ID">) | undefined + } + | undefined readonly data: { readonly sessionID: Session.ID readonly assistantMessageID: SessionMessage.ID @@ -776,7 +901,12 @@ export type SessionLogOutput = readonly metadata?: { readonly [x: string]: unknown } | undefined readonly type: "session.text.started" readonly durable: { readonly aggregateID: string; readonly seq: Event.Seq; readonly version: Event.Version } - readonly location?: Location.Ref | undefined + readonly location?: + | { + readonly directory: AbsolutePath + readonly workspaceID?: (string & Brand.Brand<"Workspace.ID">) | undefined + } + | undefined readonly data: { readonly sessionID: Session.ID readonly assistantMessageID: SessionMessage.ID @@ -789,7 +919,12 @@ export type SessionLogOutput = readonly metadata?: { readonly [x: string]: unknown } | undefined readonly type: "session.text.ended" readonly durable: { readonly aggregateID: string; readonly seq: Event.Seq; readonly version: Event.Version } - readonly location?: Location.Ref | undefined + readonly location?: + | { + readonly directory: AbsolutePath + readonly workspaceID?: (string & Brand.Brand<"Workspace.ID">) | undefined + } + | undefined readonly data: { readonly sessionID: Session.ID readonly assistantMessageID: SessionMessage.ID @@ -804,7 +939,12 @@ export type SessionLogOutput = readonly metadata?: { readonly [x: string]: unknown } | undefined readonly type: "session.reasoning.started" readonly durable: { readonly aggregateID: string; readonly seq: Event.Seq; readonly version: Event.Version } - readonly location?: Location.Ref | undefined + readonly location?: + | { + readonly directory: AbsolutePath + readonly workspaceID?: (string & Brand.Brand<"Workspace.ID">) | undefined + } + | undefined readonly data: { readonly sessionID: Session.ID readonly assistantMessageID: SessionMessage.ID @@ -818,7 +958,12 @@ export type SessionLogOutput = readonly metadata?: { readonly [x: string]: unknown } | undefined readonly type: "session.reasoning.ended" readonly durable: { readonly aggregateID: string; readonly seq: Event.Seq; readonly version: Event.Version } - readonly location?: Location.Ref | undefined + readonly location?: + | { + readonly directory: AbsolutePath + readonly workspaceID?: (string & Brand.Brand<"Workspace.ID">) | undefined + } + | undefined readonly data: { readonly sessionID: Session.ID readonly assistantMessageID: SessionMessage.ID @@ -833,7 +978,12 @@ export type SessionLogOutput = readonly metadata?: { readonly [x: string]: unknown } | undefined readonly type: "session.tool.input.started" readonly durable: { readonly aggregateID: string; readonly seq: Event.Seq; readonly version: Event.Version } - readonly location?: Location.Ref | undefined + readonly location?: + | { + readonly directory: AbsolutePath + readonly workspaceID?: (string & Brand.Brand<"Workspace.ID">) | undefined + } + | undefined readonly data: { readonly sessionID: Session.ID readonly assistantMessageID: SessionMessage.ID @@ -847,7 +997,12 @@ export type SessionLogOutput = readonly metadata?: { readonly [x: string]: unknown } | undefined readonly type: "session.tool.input.ended" readonly durable: { readonly aggregateID: string; readonly seq: Event.Seq; readonly version: Event.Version } - readonly location?: Location.Ref | undefined + readonly location?: + | { + readonly directory: AbsolutePath + readonly workspaceID?: (string & Brand.Brand<"Workspace.ID">) | undefined + } + | undefined readonly data: { readonly sessionID: Session.ID readonly assistantMessageID: SessionMessage.ID @@ -861,7 +1016,12 @@ export type SessionLogOutput = readonly metadata?: { readonly [x: string]: unknown } | undefined readonly type: "session.tool.called" readonly durable: { readonly aggregateID: string; readonly seq: Event.Seq; readonly version: Event.Version } - readonly location?: Location.Ref | undefined + readonly location?: + | { + readonly directory: AbsolutePath + readonly workspaceID?: (string & Brand.Brand<"Workspace.ID">) | undefined + } + | undefined readonly data: { readonly sessionID: Session.ID readonly assistantMessageID: SessionMessage.ID @@ -877,7 +1037,12 @@ export type SessionLogOutput = readonly metadata?: { readonly [x: string]: unknown } | undefined readonly type: "session.tool.success" readonly durable: { readonly aggregateID: string; readonly seq: Event.Seq; readonly version: Event.Version } - readonly location?: Location.Ref | undefined + readonly location?: + | { + readonly directory: AbsolutePath + readonly workspaceID?: (string & Brand.Brand<"Workspace.ID">) | undefined + } + | undefined readonly data: { readonly sessionID: Session.ID readonly assistantMessageID: SessionMessage.ID @@ -913,7 +1078,12 @@ export type SessionLogOutput = readonly metadata?: { readonly [x: string]: unknown } | undefined readonly type: "session.tool.failed" readonly durable: { readonly aggregateID: string; readonly seq: Event.Seq; readonly version: Event.Version } - readonly location?: Location.Ref | undefined + readonly location?: + | { + readonly directory: AbsolutePath + readonly workspaceID?: (string & Brand.Brand<"Workspace.ID">) | undefined + } + | undefined readonly data: { readonly sessionID: Session.ID readonly assistantMessageID: SessionMessage.ID @@ -952,7 +1122,12 @@ export type SessionLogOutput = readonly metadata?: { readonly [x: string]: unknown } | undefined readonly type: "session.retry.scheduled" readonly durable: { readonly aggregateID: string; readonly seq: Event.Seq; readonly version: Event.Version } - readonly location?: Location.Ref | undefined + readonly location?: + | { + readonly directory: AbsolutePath + readonly workspaceID?: (string & Brand.Brand<"Workspace.ID">) | undefined + } + | undefined readonly data: { readonly sessionID: Session.ID readonly assistantMessageID: SessionMessage.ID @@ -967,7 +1142,12 @@ export type SessionLogOutput = readonly metadata?: { readonly [x: string]: unknown } | undefined readonly type: "session.compaction.started" readonly durable: { readonly aggregateID: string; readonly seq: Event.Seq; readonly version: Event.Version } - readonly location?: Location.Ref | undefined + readonly location?: + | { + readonly directory: AbsolutePath + readonly workspaceID?: (string & Brand.Brand<"Workspace.ID">) | undefined + } + | undefined readonly data: { readonly sessionID: Session.ID readonly reason: "auto" | "manual" @@ -981,7 +1161,12 @@ export type SessionLogOutput = readonly metadata?: { readonly [x: string]: unknown } | undefined readonly type: "session.compaction.ended" readonly durable: { readonly aggregateID: string; readonly seq: Event.Seq; readonly version: Event.Version } - readonly location?: Location.Ref | undefined + readonly location?: + | { + readonly directory: AbsolutePath + readonly workspaceID?: (string & Brand.Brand<"Workspace.ID">) | undefined + } + | undefined readonly data: { readonly sessionID: Session.ID readonly reason: "auto" | "manual" @@ -1020,7 +1205,12 @@ export type SessionLogOutput = readonly metadata?: { readonly [x: string]: unknown } | undefined readonly type: "session.compaction.failed" readonly durable: { readonly aggregateID: string; readonly seq: Event.Seq; readonly version: Event.Version } - readonly location?: Location.Ref | undefined + readonly location?: + | { + readonly directory: AbsolutePath + readonly workspaceID?: (string & Brand.Brand<"Workspace.ID">) | undefined + } + | undefined readonly data: { readonly sessionID: Session.ID readonly reason: "auto" | "manual" @@ -1043,7 +1233,12 @@ export type SessionLogOutput = readonly metadata?: { readonly [x: string]: unknown } | undefined readonly type: "session.revert.staged" readonly durable: { readonly aggregateID: string; readonly seq: Event.Seq; readonly version: Event.Version } - readonly location?: Location.Ref | undefined + readonly location?: + | { + readonly directory: AbsolutePath + readonly workspaceID?: (string & Brand.Brand<"Workspace.ID">) | undefined + } + | undefined readonly data: { readonly sessionID: Session.ID; readonly revert: Session.Revert } } | { @@ -1052,7 +1247,12 @@ export type SessionLogOutput = readonly metadata?: { readonly [x: string]: unknown } | undefined readonly type: "session.revert.cleared" readonly durable: { readonly aggregateID: string; readonly seq: Event.Seq; readonly version: Event.Version } - readonly location?: Location.Ref | undefined + readonly location?: + | { + readonly directory: AbsolutePath + readonly workspaceID?: (string & Brand.Brand<"Workspace.ID">) | undefined + } + | undefined readonly data: { readonly sessionID: Session.ID } } | { @@ -1061,7 +1261,12 @@ export type SessionLogOutput = readonly metadata?: { readonly [x: string]: unknown } | undefined readonly type: "session.revert.committed" readonly durable: { readonly aggregateID: string; readonly seq: Event.Seq; readonly version: Event.Version } - readonly location?: Location.Ref | undefined + readonly location?: + | { + readonly directory: AbsolutePath + readonly workspaceID?: (string & Brand.Brand<"Workspace.ID">) | undefined + } + | undefined readonly data: { readonly sessionID: Session.ID; readonly to: SessionMessage.ID } } | { @@ -1070,7 +1275,12 @@ export type SessionLogOutput = readonly metadata?: { readonly [x: string]: unknown } | undefined readonly type: "session.usage.recorded" readonly durable: { readonly aggregateID: string; readonly seq: Event.Seq; readonly version: Event.Version } - readonly location?: Location.Ref | undefined + readonly location?: + | { + readonly directory: AbsolutePath + readonly workspaceID?: (string & Brand.Brand<"Workspace.ID">) | undefined + } + | undefined readonly data: { readonly sessionID: Session.ID readonly source: "title" | "compaction" @@ -1089,7 +1299,12 @@ export type SessionLogOutput = readonly metadata?: { readonly [x: string]: unknown } | undefined readonly type: "session.message.content.updated" readonly durable: { readonly aggregateID: string; readonly seq: Event.Seq; readonly version: Event.Version } - readonly location?: Location.Ref | undefined + readonly location?: + | { + readonly directory: AbsolutePath + readonly workspaceID?: (string & Brand.Brand<"Workspace.ID">) | undefined + } + | undefined readonly data: { readonly sessionID: Session.ID readonly messageID: SessionMessage.ID @@ -1207,16 +1422,12 @@ export interface MessageApi { readonly list: MessageListOperation } -export type ModelListInput = { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined -} -export type ModelListOutput = { readonly location: Location.Info; readonly data: ReadonlyArray } +export type ModelListInput = { readonly location?: { readonly directory?: string | undefined } | undefined } +export type ModelListOutput = { readonly location: Location.PublicInfo; readonly data: ReadonlyArray } export type ModelListOperation = (input?: ModelListInput) => Effect.Effect -export type ModelDefaultInput = { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined -} -export type ModelDefaultOutput = { readonly location: Location.Info; readonly data: Model.Info | undefined } +export type ModelDefaultInput = { readonly location?: { readonly directory?: string | undefined } | undefined } +export type ModelDefaultOutput = { readonly location: Location.PublicInfo; readonly data: Model.Info | undefined } export type ModelDefaultOperation = (input?: ModelDefaultInput) => Effect.Effect export interface ModelApi { @@ -1232,17 +1443,15 @@ export interface GenerateApi { readonly text: GenerateTextOperation } -export type ProviderListInput = { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined -} -export type ProviderListOutput = { readonly location: Location.Info; readonly data: ReadonlyArray } +export type ProviderListInput = { readonly location?: { readonly directory?: string | undefined } | undefined } +export type ProviderListOutput = { readonly location: Location.PublicInfo; readonly data: ReadonlyArray } export type ProviderListOperation = (input?: ProviderListInput) => Effect.Effect export type ProviderGetInput = { readonly providerID: Provider.ID - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined + readonly location?: { readonly directory?: string | undefined } | undefined } -export type ProviderGetOutput = { readonly location: Location.Info; readonly data: Provider.Info } +export type ProviderGetOutput = { readonly location: Location.PublicInfo; readonly data: Provider.Info } export type ProviderGetOperation = (input: ProviderGetInput) => Effect.Effect export interface ProviderApi { @@ -1250,23 +1459,27 @@ export interface ProviderApi { readonly get: ProviderGetOperation } -export type IntegrationListInput = { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined +export type IntegrationListInput = { readonly location?: { readonly directory?: string | undefined } | undefined } +export type IntegrationListOutput = { + readonly location: Location.PublicInfo + readonly data: ReadonlyArray } -export type IntegrationListOutput = { readonly location: Location.Info; readonly data: ReadonlyArray } export type IntegrationListOperation = ( input?: IntegrationListInput, ) => Effect.Effect export type IntegrationGetInput = { readonly integrationID: Integration.ID - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined + readonly location?: { readonly directory?: string | undefined } | undefined +} +export type IntegrationGetOutput = { + readonly location: Location.PublicInfo + readonly data: Integration.Info | undefined } -export type IntegrationGetOutput = { readonly location: Location.Info; readonly data: Integration.Info | undefined } export type IntegrationGetOperation = (input: IntegrationGetInput) => Effect.Effect export type IntegrationWellknownAddInput = { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined + readonly location?: { readonly directory?: string | undefined } | undefined readonly url: string } export type IntegrationWellknownAddOutput = void @@ -1276,7 +1489,7 @@ export type IntegrationWellknownAddOperation = ( export type IntegrationConnectKeyInput = { readonly integrationID: Integration.ID - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined + readonly location?: { readonly directory?: string | undefined } | undefined readonly key: string readonly answer?: Form.Answer | undefined readonly label?: string | undefined @@ -1288,12 +1501,15 @@ export type IntegrationConnectKeyOperation = ( export type IntegrationOauthConnectInput = { readonly integrationID: Integration.ID - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined + readonly location?: { readonly directory?: string | undefined } | undefined readonly methodID: Integration.MethodID readonly answer?: Form.Answer | undefined readonly label?: string | undefined } -export type IntegrationOauthConnectOutput = { readonly location: Location.Info; readonly data: Integration.Attempt } +export type IntegrationOauthConnectOutput = { + readonly location: Location.PublicInfo + readonly data: Integration.Attempt +} export type IntegrationOauthConnectOperation = ( input: IntegrationOauthConnectInput, ) => Effect.Effect @@ -1301,10 +1517,10 @@ export type IntegrationOauthConnectOperation = ( export type IntegrationOauthStatusInput = { readonly integrationID: Integration.ID readonly attemptID: Integration.AttemptID - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined + readonly location?: { readonly directory?: string | undefined } | undefined } export type IntegrationOauthStatusOutput = { - readonly location: Location.Info + readonly location: Location.PublicInfo readonly data: Integration.AttemptStatus } export type IntegrationOauthStatusOperation = ( @@ -1314,7 +1530,7 @@ export type IntegrationOauthStatusOperation = ( export type IntegrationOauthCompleteInput = { readonly integrationID: Integration.ID readonly attemptID: Integration.AttemptID - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined + readonly location?: { readonly directory?: string | undefined } | undefined readonly code?: string | undefined } export type IntegrationOauthCompleteOutput = void @@ -1325,7 +1541,7 @@ export type IntegrationOauthCompleteOperation = ( export type IntegrationOauthCancelInput = { readonly integrationID: Integration.ID readonly attemptID: Integration.AttemptID - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined + readonly location?: { readonly directory?: string | undefined } | undefined } export type IntegrationOauthCancelOutput = void export type IntegrationOauthCancelOperation = ( @@ -1334,12 +1550,12 @@ export type IntegrationOauthCancelOperation = ( export type IntegrationCommandConnectInput = { readonly integrationID: Integration.ID - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined + readonly location?: { readonly directory?: string | undefined } | undefined readonly methodID: Integration.MethodID readonly label?: string | undefined } export type IntegrationCommandConnectOutput = { - readonly location: Location.Info + readonly location: Location.PublicInfo readonly data: Integration.CommandAttempt } export type IntegrationCommandConnectOperation = ( @@ -1349,10 +1565,10 @@ export type IntegrationCommandConnectOperation = ( export type IntegrationCommandStatusInput = { readonly integrationID: Integration.ID readonly attemptID: Integration.AttemptID - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined + readonly location?: { readonly directory?: string | undefined } | undefined } export type IntegrationCommandStatusOutput = { - readonly location: Location.Info + readonly location: Location.PublicInfo readonly data: Integration.CommandAttemptStatus } export type IntegrationCommandStatusOperation = ( @@ -1362,7 +1578,7 @@ export type IntegrationCommandStatusOperation = ( export type IntegrationCommandCancelInput = { readonly integrationID: Integration.ID readonly attemptID: Integration.AttemptID - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined + readonly location?: { readonly directory?: string | undefined } | undefined } export type IntegrationCommandCancelOutput = void export type IntegrationCommandCancelOperation = ( @@ -1387,15 +1603,13 @@ export interface IntegrationApi { } } -export type McpListInput = { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined -} -export type McpListOutput = { readonly location: Location.Info; readonly data: ReadonlyArray } +export type McpListInput = { readonly location?: { readonly directory?: string | undefined } | undefined } +export type McpListOutput = { readonly location: Location.PublicInfo; readonly data: ReadonlyArray } export type McpListOperation = (input?: McpListInput) => Effect.Effect export type McpAddInput = { readonly server: string - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined + readonly location?: { readonly directory?: string | undefined } | undefined readonly config: Mcp.LocalConfig | Mcp.RemoteConfig } export type McpAddOutput = void @@ -1403,29 +1617,27 @@ export type McpAddOperation = (input: McpAddInput) => Effect.Effect = (input: McpRemoveInput) => Effect.Effect export type McpConnectInput = { readonly server: string - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined + readonly location?: { readonly directory?: string | undefined } | undefined } export type McpConnectOutput = void export type McpConnectOperation = (input: McpConnectInput) => Effect.Effect export type McpDisconnectInput = { readonly server: string - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined + readonly location?: { readonly directory?: string | undefined } | undefined } export type McpDisconnectOutput = void export type McpDisconnectOperation = (input: McpDisconnectInput) => Effect.Effect -export type McpResourceCatalogInput = { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined -} -export type McpResourceCatalogOutput = { readonly location: Location.Info; readonly data: Mcp.ResourceCatalog } +export type McpResourceCatalogInput = { readonly location?: { readonly directory?: string | undefined } | undefined } +export type McpResourceCatalogOutput = { readonly location: Location.PublicInfo; readonly data: Mcp.ResourceCatalog } export type McpResourceCatalogOperation = ( input?: McpResourceCatalogInput, ) => Effect.Effect @@ -1441,7 +1653,7 @@ export interface McpApi { export type CredentialUpdateInput = { readonly credentialID: Credential.ID - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined + readonly location?: { readonly directory?: string | undefined } | undefined readonly label: string } export type CredentialUpdateOutput = void @@ -1451,7 +1663,7 @@ export type CredentialUpdateOperation = ( export type CredentialActivateInput = { readonly credentialID: Credential.ID - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined + readonly location?: { readonly directory?: string | undefined } | undefined } export type CredentialActivateOutput = void export type CredentialActivateOperation = ( @@ -1460,7 +1672,7 @@ export type CredentialActivateOperation = ( export type CredentialRemoveInput = { readonly credentialID: Credential.ID - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined + readonly location?: { readonly directory?: string | undefined } | undefined } export type CredentialRemoveOutput = void export type CredentialRemoveOperation = ( @@ -1491,10 +1703,8 @@ export interface ProjectApi { readonly update: ProjectUpdateOperation } -export type FormRequestListInput = { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined -} -export type FormRequestListOutput = { readonly location: Location.Info; readonly data: ReadonlyArray } +export type FormRequestListInput = { readonly location?: { readonly directory?: string | undefined } | undefined } +export type FormRequestListOutput = { readonly location: Location.PublicInfo; readonly data: ReadonlyArray } export type FormRequestListOperation = ( input?: FormRequestListInput, ) => Effect.Effect @@ -1539,11 +1749,9 @@ export interface FormApi { readonly cancel: FormCancelOperation } -export type PermissionRequestListInput = { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined -} +export type PermissionRequestListInput = { readonly location?: { readonly directory?: string | undefined } | undefined } export type PermissionRequestListOutput = { - readonly location: Location.Info + readonly location: Location.PublicInfo readonly data: ReadonlyArray } export type PermissionRequestListOperation = ( @@ -1613,19 +1821,19 @@ export interface PermissionApi { } export type FileListInput = { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined + readonly location?: { readonly directory?: string | undefined } | undefined readonly path?: string | undefined } -export type FileListOutput = { readonly location: Location.Info; readonly data: ReadonlyArray } +export type FileListOutput = { readonly location: Location.PublicInfo; readonly data: ReadonlyArray } export type FileListOperation = (input?: FileListInput) => Effect.Effect export type FileFindInput = { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined + readonly location?: { readonly directory?: string | undefined } | undefined readonly query: string readonly type?: "file" | "directory" | undefined readonly limit?: number | undefined } -export type FileFindOutput = { readonly location: Location.Info; readonly data: ReadonlyArray } +export type FileFindOutput = { readonly location: Location.PublicInfo; readonly data: ReadonlyArray } export type FileFindOperation = (input: FileFindInput) => Effect.Effect export interface FileApi { @@ -1633,20 +1841,16 @@ export interface FileApi { readonly find: FileFindOperation } -export type CommandListInput = { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined -} -export type CommandListOutput = { readonly location: Location.Info; readonly data: ReadonlyArray } +export type CommandListInput = { readonly location?: { readonly directory?: string | undefined } | undefined } +export type CommandListOutput = { readonly location: Location.PublicInfo; readonly data: ReadonlyArray } export type CommandListOperation = (input?: CommandListInput) => Effect.Effect export interface CommandApi { readonly list: CommandListOperation } -export type SkillListInput = { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined -} -export type SkillListOutput = { readonly location: Location.Info; readonly data: ReadonlyArray } +export type SkillListInput = { readonly location?: { readonly directory?: string | undefined } | undefined } +export type SkillListOutput = { readonly location: Location.PublicInfo; readonly data: ReadonlyArray } export type SkillListOperation = (input?: SkillListInput) => Effect.Effect export interface SkillApi { @@ -1656,7 +1860,7 @@ export interface SkillApi { export type RpcCallInput = { readonly rpcID: string readonly method: string - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined + readonly location?: { readonly directory?: string | undefined } | undefined readonly input?: unknown | undefined } export type RpcCallOutput = { readonly output?: unknown } @@ -1673,52 +1877,50 @@ export interface EventApi { readonly subscribe: EventSubscribeOperation } -export type PtyListInput = { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined -} -export type PtyListOutput = { readonly location: Location.Info; readonly data: ReadonlyArray } +export type PtyListInput = { readonly location?: { readonly directory?: string | undefined } | undefined } +export type PtyListOutput = { readonly location: Location.PublicInfo; readonly data: ReadonlyArray } export type PtyListOperation = (input?: PtyListInput) => Effect.Effect export type PtyCreateInput = { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined + readonly location?: { readonly directory?: string | undefined } | undefined readonly command?: string | undefined readonly args?: ReadonlyArray | undefined readonly cwd?: string | undefined readonly title?: string | undefined readonly env?: { readonly [x: string]: string } | undefined } -export type PtyCreateOutput = { readonly location: Location.Info; readonly data: Pty.Info } +export type PtyCreateOutput = { readonly location: Location.PublicInfo; readonly data: Pty.Info } export type PtyCreateOperation = (input?: PtyCreateInput) => Effect.Effect export type PtyGetInput = { readonly ptyID: Pty.ID - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined + readonly location?: { readonly directory?: string | undefined } | undefined } -export type PtyGetOutput = { readonly location: Location.Info; readonly data: Pty.Info } +export type PtyGetOutput = { readonly location: Location.PublicInfo; readonly data: Pty.Info } export type PtyGetOperation = (input: PtyGetInput) => Effect.Effect export type PtyUpdateInput = { readonly ptyID: Pty.ID - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined + readonly location?: { readonly directory?: string | undefined } | undefined readonly title?: string | undefined readonly size?: { readonly rows: number; readonly cols: number } | undefined } -export type PtyUpdateOutput = { readonly location: Location.Info; readonly data: Pty.Info } +export type PtyUpdateOutput = { readonly location: Location.PublicInfo; readonly data: Pty.Info } export type PtyUpdateOperation = (input: PtyUpdateInput) => Effect.Effect export type PtyRemoveInput = { readonly ptyID: Pty.ID - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined + readonly location?: { readonly directory?: string | undefined } | undefined } export type PtyRemoveOutput = void export type PtyRemoveOperation = (input: PtyRemoveInput) => Effect.Effect export type PtyConnectTokenInput = { readonly ptyID: Pty.ID - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined + readonly location?: { readonly directory?: string | undefined } | undefined readonly "x-opencode-ticket"?: string | undefined } -export type PtyConnectTokenOutput = { readonly location: Location.Info; readonly data: PtyTicket.ConnectToken } +export type PtyConnectTokenOutput = { readonly location: Location.PublicInfo; readonly data: PtyTicket.ConnectToken } export type PtyConnectTokenOperation = ( input: PtyConnectTokenInput, ) => Effect.Effect @@ -1910,45 +2112,43 @@ export interface ExperimentalApi { } } -export type ShellListInput = { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined -} -export type ShellListOutput = { readonly location: Location.Info; readonly data: ReadonlyArray } +export type ShellListInput = { readonly location?: { readonly directory?: string | undefined } | undefined } +export type ShellListOutput = { readonly location: Location.PublicInfo; readonly data: ReadonlyArray } export type ShellListOperation = (input?: ShellListInput) => Effect.Effect export type ShellCreateInput = { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined + readonly location?: { readonly directory?: string | undefined } | undefined readonly command: string readonly cwd?: string | undefined readonly timeout: number readonly metadata?: { readonly [x: string]: unknown } | undefined } -export type ShellCreateOutput = { readonly location: Location.Info; readonly data: Shell.Info } +export type ShellCreateOutput = { readonly location: Location.PublicInfo; readonly data: Shell.Info } export type ShellCreateOperation = (input: ShellCreateInput) => Effect.Effect export type ShellGetInput = { readonly id: Shell.ID - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined + readonly location?: { readonly directory?: string | undefined } | undefined } -export type ShellGetOutput = { readonly location: Location.Info; readonly data: Shell.Info } +export type ShellGetOutput = { readonly location: Location.PublicInfo; readonly data: Shell.Info } export type ShellGetOperation = (input: ShellGetInput) => Effect.Effect export type ShellTimeoutInput = { readonly id: Shell.ID - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined + readonly location?: { readonly directory?: string | undefined } | undefined readonly timeout: number } -export type ShellTimeoutOutput = { readonly location: Location.Info; readonly data: Shell.Info } +export type ShellTimeoutOutput = { readonly location: Location.PublicInfo; readonly data: Shell.Info } export type ShellTimeoutOperation = (input: ShellTimeoutInput) => Effect.Effect export type ShellOutputInput = { readonly id: Shell.ID - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined + readonly location?: { readonly directory?: string | undefined } | undefined readonly cursor?: number | undefined readonly limit?: number | undefined } export type ShellOutputOutput = { - readonly location: Location.Info + readonly location: Location.PublicInfo readonly data: { readonly output: string readonly cursor: number @@ -1960,7 +2160,7 @@ export type ShellOutputOperation = (input: ShellOutputInput) => Effec export type ShellRemoveInput = { readonly id: Shell.ID - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined + readonly location?: { readonly directory?: string | undefined } | undefined } export type ShellRemoveOutput = void export type ShellRemoveOperation = (input: ShellRemoveInput) => Effect.Effect @@ -1974,24 +2174,23 @@ export interface ShellApi { readonly remove: ShellRemoveOperation } -export type ReferenceListInput = { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined +export type ReferenceListInput = { readonly location?: { readonly directory?: string | undefined } | undefined } +export type ReferenceListOutput = { + readonly location: Location.PublicInfo + readonly data: ReadonlyArray } -export type ReferenceListOutput = { readonly location: Location.Info; readonly data: ReadonlyArray } export type ReferenceListOperation = (input?: ReferenceListInput) => Effect.Effect export interface ReferenceApi { readonly list: ReferenceListOperation } -export type WorktreeListInput = { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined -} +export type WorktreeListInput = { readonly location?: { readonly directory?: string | undefined } | undefined } export type WorktreeListOutput = Worktree.List export type WorktreeListOperation = (input?: WorktreeListInput) => Effect.Effect export type WorktreeCreateInput = { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined + readonly location?: { readonly directory?: string | undefined } | undefined readonly strategy?: Worktree.StrategyID | undefined readonly from?: AbsolutePath | undefined readonly branch?: string | undefined @@ -2002,16 +2201,14 @@ export type WorktreeCreateOutput = Worktree.Info export type WorktreeCreateOperation = (input?: WorktreeCreateInput) => Effect.Effect export type WorktreeRemoveInput = { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined + readonly location?: { readonly directory?: string | undefined } | undefined readonly directory: AbsolutePath readonly force: boolean } export type WorktreeRemoveOutput = void export type WorktreeRemoveOperation = (input: WorktreeRemoveInput) => Effect.Effect -export type WorktreeRefreshInput = { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined -} +export type WorktreeRefreshInput = { readonly location?: { readonly directory?: string | undefined } | undefined } export type WorktreeRefreshOutput = void export type WorktreeRefreshOperation = ( input?: WorktreeRefreshInput, @@ -2024,56 +2221,33 @@ export interface WorktreeApi { readonly refresh: WorktreeRefreshOperation } -export type WorkspaceCreateInput = { readonly id?: Workspace.ID | undefined; readonly provider: string } -export type WorkspaceCreateOutput = Workspace.ID -export type WorkspaceCreateOperation = ( - input: WorkspaceCreateInput, -) => Effect.Effect - -export type WorkspaceDestroyInput = { readonly workspaceID: Workspace.ID } -export type WorkspaceDestroyOutput = Workspace.DestroyResult -export type WorkspaceDestroyOperation = ( - input: WorkspaceDestroyInput, -) => Effect.Effect - -export interface WorkspaceApi { - readonly create: WorkspaceCreateOperation - readonly destroy: WorkspaceDestroyOperation -} - -export type VcsGetInput = { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined -} -export type VcsGetOutput = { readonly location: Location.Info; readonly data: Vcs.Info } +export type VcsGetInput = { readonly location?: { readonly directory?: string | undefined } | undefined } +export type VcsGetOutput = { readonly location: Location.PublicInfo; readonly data: Vcs.Info } export type VcsGetOperation = (input?: VcsGetInput) => Effect.Effect -export type VcsBaseInput = { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined -} -export type VcsBaseOutput = { readonly location: Location.Info; readonly data: Vcs.Base | null } +export type VcsBaseInput = { readonly location?: { readonly directory?: string | undefined } | undefined } +export type VcsBaseOutput = { readonly location: Location.PublicInfo; readonly data: Vcs.Base | null } export type VcsBaseOperation = (input?: VcsBaseInput) => Effect.Effect -export type VcsStatusInput = { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined -} -export type VcsStatusOutput = { readonly location: Location.Info; readonly data: ReadonlyArray } +export type VcsStatusInput = { readonly location?: { readonly directory?: string | undefined } | undefined } +export type VcsStatusOutput = { readonly location: Location.PublicInfo; readonly data: ReadonlyArray } export type VcsStatusOperation = (input?: VcsStatusInput) => Effect.Effect export type VcsBranchesInput = { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined + readonly location?: { readonly directory?: string | undefined } | undefined readonly search?: string | undefined readonly limit?: number | undefined } -export type VcsBranchesOutput = { readonly location: Location.Info; readonly data: Vcs.BranchList } +export type VcsBranchesOutput = { readonly location: Location.PublicInfo; readonly data: Vcs.BranchList } export type VcsBranchesOperation = (input?: VcsBranchesInput) => Effect.Effect export type VcsDiffInput = { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined + readonly location?: { readonly directory?: string | undefined } | undefined readonly mode: Vcs.Mode readonly base?: string | undefined readonly context?: number | undefined } -export type VcsDiffOutput = { readonly location: Location.Info; readonly data: ReadonlyArray } +export type VcsDiffOutput = { readonly location: Location.PublicInfo; readonly data: ReadonlyArray } export type VcsDiffOperation = (input: VcsDiffInput) => Effect.Effect export interface VcsApi { @@ -2084,12 +2258,10 @@ export interface VcsApi { readonly diff: VcsDiffOperation } -export type DebugLocationListOutput = ReadonlyArray +export type DebugLocationListOutput = ReadonlyArray export type DebugLocationListOperation = () => Effect.Effect -export type DebugLocationEvictInput = { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined -} +export type DebugLocationEvictInput = { readonly location?: { readonly directory?: string | undefined } | undefined } export type DebugLocationEvictOutput = void export type DebugLocationEvictOperation = ( input?: DebugLocationEvictInput, @@ -2116,11 +2288,9 @@ export interface MigrationApi { readonly v1: { readonly status: MigrationV1StatusOperation } } -export type WebsearchProvidersInput = { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined -} +export type WebsearchProvidersInput = { readonly location?: { readonly directory?: string | undefined } | undefined } export type WebsearchProvidersOutput = { - readonly location: Location.Info + readonly location: Location.PublicInfo readonly data: ReadonlyArray } export type WebsearchProvidersOperation = ( @@ -2128,11 +2298,11 @@ export type WebsearchProvidersOperation = ( ) => Effect.Effect export type WebsearchQueryInput = { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined + readonly location?: { readonly directory?: string | undefined } | undefined readonly query: string readonly providerID?: WebSearch.ID | undefined } -export type WebsearchQueryOutput = { readonly location: Location.Info; readonly data: WebSearch.Response } +export type WebsearchQueryOutput = { readonly location: Location.PublicInfo; readonly data: WebSearch.Response } export type WebsearchQueryOperation = (input: WebsearchQueryInput) => Effect.Effect export interface WebsearchApi { @@ -2140,9 +2310,7 @@ export interface WebsearchApi { readonly query: WebsearchQueryOperation } -export type ConfigGetInput = { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined -} +export type ConfigGetInput = { readonly location?: { readonly directory?: string | undefined } | undefined } export type ConfigGetOutput = ReadonlyArray export type ConfigGetOperation = (input?: ConfigGetInput) => Effect.Effect @@ -2198,7 +2366,6 @@ export interface AppApi { readonly shell: ShellApi readonly reference: ReferenceApi readonly worktree: WorktreeApi - readonly workspace: WorkspaceApi readonly vcs: VcsApi readonly debug: DebugApi readonly migration: MigrationApi diff --git a/packages/client/src/effect/generated/client.ts b/packages/client/src/effect/generated/client.ts index d5da62d8904..655c45d7885 100644 --- a/packages/client/src/effect/generated/client.ts +++ b/packages/client/src/effect/generated/client.ts @@ -245,10 +245,6 @@ import type { WorktreeRemoveOutput, WorktreeRefreshInput, WorktreeRefreshOutput, - WorkspaceCreateInput, - WorkspaceCreateOutput, - WorkspaceDestroyInput, - WorkspaceDestroyOutput, VcsGetInput, VcsGetOutput, VcsBaseInput, @@ -356,7 +352,6 @@ const EndpointSessionList = (raw: RawClient["server.session"]) => (input?: Sessi preserveEffect()( raw["session.list"]({ query: { - workspace: input?.["workspace"], limit: input?.["limit"], order: input?.["order"], search: input?.["search"], @@ -475,7 +470,7 @@ const EndpointSessionMove = (raw: RawClient["server.session"]) => (input: Sessio preserveEffect()( raw["session.move"]({ params: { sessionID: input["sessionID"] }, - payload: { directory: input["directory"], workspaceID: input["workspaceID"], delivery: input["delivery"] }, + payload: { directory: input["directory"], delivery: input["delivery"] }, }).pipe(Effect.mapError(mapClientError)), ) @@ -1492,24 +1487,6 @@ const adaptGroupWorktree = (raw: RawClient["server.worktree"]) => ({ refresh: EndpointWorktreeRefresh(raw), }) -const EndpointWorkspaceCreate = (raw: RawClient["server.workspace"]) => (input: WorkspaceCreateInput) => - preserveEffect()( - raw["workspace.create"]({ payload: { id: input["id"], provider: input["provider"] } }).pipe( - Effect.mapError(mapClientError), - Effect.map((value) => value.data), - ), - ) - -const EndpointWorkspaceDestroy = (raw: RawClient["server.workspace"]) => (input: WorkspaceDestroyInput) => - preserveEffect()( - raw["workspace.destroy"]({ params: { workspaceID: input["workspaceID"] } }).pipe(Effect.mapError(mapClientError)), - ) - -const adaptGroupWorkspace = (raw: RawClient["server.workspace"]) => ({ - create: EndpointWorkspaceCreate(raw), - destroy: EndpointWorkspaceDestroy(raw), -}) - const EndpointVcsGet = (raw: RawClient["server.vcs"]) => (input?: VcsGetInput) => preserveEffect()( raw["vcs.get"]({ query: { location: input?.["location"] } }).pipe(Effect.mapError(mapClientError)), @@ -1633,7 +1610,6 @@ const adaptClient = (raw: RawClient) => ({ shell: adaptGroupShell(raw["server.shell"]), reference: adaptGroupReference(raw["server.reference"]), worktree: adaptGroupWorktree(raw["server.worktree"]), - workspace: adaptGroupWorkspace(raw["server.workspace"]), vcs: adaptGroupVcs(raw["server.vcs"]), debug: adaptGroupDebug(raw["server.debug"]), migration: adaptGroupMigration(raw["server.migration"]), diff --git a/packages/client/src/promise/generated/client.ts b/packages/client/src/promise/generated/client.ts index 1d443ee6736..0ed55398b14 100644 --- a/packages/client/src/promise/generated/client.ts +++ b/packages/client/src/promise/generated/client.ts @@ -241,10 +241,6 @@ import type { WorktreeRemoveOutput, WorktreeRefreshInput, WorktreeRefreshOutput, - WorkspaceCreateInput, - WorkspaceCreateOutput, - WorkspaceDestroyInput, - WorkspaceDestroyOutput, VcsGetInput, VcsGetOutput, VcsBaseInput, @@ -517,7 +513,6 @@ export function make(options: ClientOptions) { method: "GET", path: `/api/session`, query: { - workspace: input?.["workspace"], limit: input?.["limit"], order: input?.["order"], search: input?.["search"], @@ -681,7 +676,7 @@ export function make(options: ClientOptions) { { method: "POST", path: `/api/session/${encodeURIComponent(input.sessionID)}/move`, - body: { directory: input["directory"], workspaceID: input["workspaceID"], delivery: input["delivery"] }, + body: { directory: input["directory"], delivery: input["delivery"] }, successStatus: 204, declaredStatuses: [400, 401, 404], empty: true, @@ -2030,31 +2025,6 @@ export function make(options: ClientOptions) { requestOptions, ), }, - workspace: { - create: (input: WorkspaceCreateInput, requestOptions?: RequestOptions) => - request<{ readonly data: WorkspaceCreateOutput }>( - { - method: "POST", - path: `/api/workspace`, - body: { id: input["id"], provider: input["provider"] }, - successStatus: 200, - declaredStatuses: [400, 401, 404, 409], - empty: false, - }, - requestOptions, - ).then((value) => value.data), - destroy: (input: WorkspaceDestroyInput, requestOptions?: RequestOptions) => - request( - { - method: "DELETE", - path: `/api/workspace/${encodeURIComponent(input.workspaceID)}`, - successStatus: 200, - declaredStatuses: [400, 401, 500], - empty: false, - }, - requestOptions, - ), - }, vcs: { get: (input?: VcsGetInput, requestOptions?: RequestOptions) => request( diff --git a/packages/client/src/promise/generated/types.ts b/packages/client/src/promise/generated/types.ts index af914d0cbd8..218f023c526 100644 --- a/packages/client/src/promise/generated/types.ts +++ b/packages/client/src/promise/generated/types.ts @@ -2,6 +2,8 @@ export type JsonValue = null | boolean | number | string | Array | { export type ServerStatus = { version: string; pid: number; urls: Array } +export type LocationPublicInfo = { directory: string; project: { id: string; directory: string; canonical: string } } + export type ModelRef = { id: string; providerID: string; variant?: string } export type ProviderSettings = { [x: string]: any } @@ -31,8 +33,6 @@ export type TokenUsageInfo = { cache: { read: number; write: number } } -export type LocationRef = { directory: string; workspaceID?: string } - export type SessionMetadata = { [x: string]: JsonValue } export type FileDiffInfo = { @@ -43,6 +43,8 @@ export type FileDiffInfo = { status: "added" | "deleted" | "modified" } +export type LocationPublicRef = { directory: string } + export type SessionStatsToolTotals = { calls: number; succeeded: number; failed: number; unfinished: number } export type SessionStatsToolUsage = { @@ -167,6 +169,8 @@ export type InstructionEntryKey = string export type SessionGenerateResponse = { data: { text: string } } +export type LocationRef = { directory: string; workspaceID?: string } + export type SessionInboxSyntheticPayload1 = { text: string; description?: string; metadata?: { [x: string]: any } } export type ShellInfo = { @@ -238,30 +242,22 @@ export type ConnectionCredentialInfo = { type: "credential"; id: string; label: export type ConnectionEnvInfo = { type: "env"; name: string } -export type IntegrationAttemptStatus = - | { - status: "pending" - time: { created: number | "Infinity" | "-Infinity" | "NaN"; expires: number | "Infinity" | "-Infinity" | "NaN" } - } - | { - status: "complete" - time: { created: number | "Infinity" | "-Infinity" | "NaN"; expires: number | "Infinity" | "-Infinity" | "NaN" } - } - | { - status: "failed" - message: string - time: { created: number | "Infinity" | "-Infinity" | "NaN"; expires: number | "Infinity" | "-Infinity" | "NaN" } - } - | { - status: "expired" - time: { created: number | "Infinity" | "-Infinity" | "NaN"; expires: number | "Infinity" | "-Infinity" | "NaN" } - } - -export type IntegrationCommandAttempt = { +export type IntegrationAttempt = { attemptID: string - time: { created: number | "Infinity" | "-Infinity" | "NaN"; expires: number | "Infinity" | "-Infinity" | "NaN" } + url: string + instructions: string + mode: "auto" | "code" + time: { created: number; expires: number } } +export type IntegrationAttemptStatus = + | { status: "pending"; time: { created: number; expires: number } } + | { status: "complete"; time: { created: number; expires: number } } + | { status: "failed"; message: string; time: { created: number; expires: number } } + | { status: "expired"; time: { created: number; expires: number } } + +export type IntegrationCommandAttempt = { attemptID: string; time: { created: number; expires: number } } + export type IntegrationCommandAttemptStatus = | { status: "pending" @@ -416,8 +412,6 @@ export type WorktreeDirectory = { directory: string; strategy?: string } export type WorktreeInfo = { directory: string } -export type WorkspaceDestroyResult = { destroyed: boolean } - export type VcsBranch = { current?: string; default?: string } export type VcsBase = { name: string; ref: string; source: "reflog" | "default" } @@ -451,38 +445,38 @@ export type PermissionRule = { action: string; resource: string; effect: Permiss export type PluginInfo = { id?: string; source: PluginSource; features: PluginFeatures; state: PluginState } +export type SessionRevert = { messageID: string; partID?: string; snapshot?: string; files?: Array } + export type SessionMessageLocationSwitched = { id: string metadata?: { [x: string]: JsonValue } time: { created: number } type: "location-switched" - location: LocationRef projectID?: string subpath?: string - previous?: { location: LocationRef; projectID?: string; subpath?: string } + location: LocationPublicRef + previous?: { location: LocationPublicRef; projectID?: string; subpath?: string } | null } -export type SessionInboxMovePayload = { location: LocationRef; projectID: string; subpath?: string } +export type SessionInboxMovePayload = { projectID: string; subpath?: string; location: LocationPublicRef } export type V2EventRpc = { id: string created: number metadata?: { [x: string]: any } | undefined type: `${"rpc."}${string}` - location: LocationRef + location: LocationPublicRef data: { [x: string]: any } } export type V2EventServerConnected = { id: string metadata?: { [x: string]: any } | undefined - location?: LocationRef | undefined + location?: LocationPublicRef | undefined type: "server.connected" data: {} } -export type SessionRevert = { messageID: string; partID?: string; snapshot?: string; files?: Array } - export type SessionStatsTools = | { mode: "none" } | { mode: "summary"; totals: SessionStatsToolTotals } @@ -581,16 +575,6 @@ export type SessionModelSelected = { data: { sessionID: string; model: ModelRef; previous?: ModelRef } } -export type SessionMoved = { - id: string - created: number - metadata?: { [x: string]: any } - type: "session.moved" - durable: { aggregateID: string; seq: number; version: 1 } - location?: LocationRef - data: { sessionID: string; location: LocationRef; projectID: string; subpath?: string } -} - export type SessionRenamed = { id: string created: number @@ -1197,6 +1181,18 @@ export type McpResourcesChanged = { data: { server: string } } +export type SessionMoved = { + id: string + created: number + metadata?: { [x: string]: any } + type: "session.moved" + durable: { aggregateID: string; seq: number; version: 1 } + location?: LocationRef + data: { sessionID: string; location: LocationRef; projectID: string; subpath?: string } +} + +export type SessionInboxMovePayload1 = { location: LocationRef; projectID: string; subpath?: string } + export type SessionShellStarted = { id: string created: number @@ -1630,15 +1626,6 @@ export type VcsInfo = { branch: VcsBranch } export type PermissionRuleset = Array -export type SessionInboxMove = { - id: string - sessionID: string - timeCreated: number - type: "move" - payload: SessionInboxMovePayload - delivery: SessionInboxDelivery -} - export type SessionRevertStaged = { id: string created: number @@ -1649,6 +1636,15 @@ export type SessionRevertStaged = { data: { sessionID: string; revert: SessionRevert } } +export type SessionInboxMove = { + id: string + sessionID: string + timeCreated: number + type: "move" + delivery: SessionInboxDelivery + payload: SessionInboxMovePayload +} + export type SessionStatsInfo = { range: { from: number; to: number } sessions: number @@ -1904,11 +1900,11 @@ export type SessionInfo = { outcome?: "succeeded" | "failed" | "interrupted" time: { created: number; updated: number; idle?: number; viewed?: number; archived?: number } title?: string - location: LocationRef subpath?: string metadata?: SessionMetadata permissions?: PermissionRuleset revert?: SessionRevert + location: LocationPublicRef } export type SessionCreated = { @@ -2119,7 +2115,7 @@ export type SessionInboxItem = | { type: "user"; payload: SessionInboxUserPayload1; delivery: SessionInboxDelivery } | { type: "synthetic"; payload: SessionInboxSyntheticPayload1; delivery: SessionInboxDelivery } | { type: "compaction"; payload: SessionInboxCompactionPayload; delivery: SessionInboxDelivery } - | { type: "move"; payload: SessionInboxMovePayload; delivery: SessionInboxDelivery } + | { type: "move"; payload: SessionInboxMovePayload1; delivery: SessionInboxDelivery } export type SessionMessageAssistantTool = { type: "tool" @@ -2605,94 +2601,52 @@ export const isWorktreeError = (value: unknown): value is WorktreeError => export type ServerStatusOutput = ServerStatus export type LocationGetInput = { - readonly location?: { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined - }["location"] + readonly location?: { readonly location?: { readonly directory?: string | undefined } | undefined }["location"] } -export type LocationGetOutput = { - directory: string - workspaceID?: string - project: { id: string; directory: string; canonical: string } -} +export type LocationGetOutput = LocationPublicInfo export type AgentListInput = { - readonly location?: { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined - }["location"] + readonly location?: { readonly location?: { readonly directory?: string | undefined } | undefined }["location"] } -export type AgentListOutput = { - location: { directory: string; workspaceID?: string; project: { id: string; directory: string; canonical: string } } - data: Array -} +export type AgentListOutput = { location: LocationPublicInfo; data: Array } export type AgentGetInput = { readonly agentID: { readonly agentID: string }["agentID"] - readonly location?: { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined - }["location"] + readonly location?: { readonly location?: { readonly directory?: string | undefined } | undefined }["location"] } -export type AgentGetOutput = { - location: { directory: string; workspaceID?: string; project: { id: string; directory: string; canonical: string } } - data: AgentInfo -} +export type AgentGetOutput = { location: LocationPublicInfo; data: AgentInfo } export type PluginListInput = { - readonly location?: { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined - }["location"] + readonly location?: { readonly location?: { readonly directory?: string | undefined } | undefined }["location"] } -export type PluginListOutput = { - location: { directory: string; workspaceID?: string; project: { id: string; directory: string; canonical: string } } - data: Array -} +export type PluginListOutput = { location: LocationPublicInfo; data: Array } export type PluginAwaitActivationInput = { - readonly location?: { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined - }["location"] + readonly location?: { readonly location?: { readonly directory?: string | undefined } | undefined }["location"] } export type PluginAwaitActivationOutput = void export type PluginCheckInput = { - readonly location?: { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined - }["location"] + readonly location?: { readonly location?: { readonly directory?: string | undefined } | undefined }["location"] readonly target?: { readonly target?: string | undefined }["target"] } -export type PluginCheckOutput = { - location: { directory: string; workspaceID?: string; project: { id: string; directory: string; canonical: string } } - data: Array -} +export type PluginCheckOutput = { location: LocationPublicInfo; data: Array } export type PluginUpdateInput = { - readonly location?: { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined - }["location"] + readonly location?: { readonly location?: { readonly directory?: string | undefined } | undefined }["location"] readonly targets: { readonly targets: ReadonlyArray }["targets"] } export type PluginUpdateOutput = void export type SessionListInput = { - readonly workspace?: { - readonly workspace?: string | undefined - readonly limit?: number | undefined - readonly order?: "asc" | "desc" | undefined - readonly search?: string | undefined - readonly parentID?: string | null | undefined - readonly directory?: string | undefined - readonly project?: string | undefined - readonly subpath?: string | undefined - readonly cursor?: string | undefined - }["workspace"] readonly limit?: { - readonly workspace?: string | undefined readonly limit?: number | undefined readonly order?: "asc" | "desc" | undefined readonly search?: string | undefined @@ -2703,7 +2657,6 @@ export type SessionListInput = { readonly cursor?: string | undefined }["limit"] readonly order?: { - readonly workspace?: string | undefined readonly limit?: number | undefined readonly order?: "asc" | "desc" | undefined readonly search?: string | undefined @@ -2714,7 +2667,6 @@ export type SessionListInput = { readonly cursor?: string | undefined }["order"] readonly search?: { - readonly workspace?: string | undefined readonly limit?: number | undefined readonly order?: "asc" | "desc" | undefined readonly search?: string | undefined @@ -2725,7 +2677,6 @@ export type SessionListInput = { readonly cursor?: string | undefined }["search"] readonly parentID?: { - readonly workspace?: string | undefined readonly limit?: number | undefined readonly order?: "asc" | "desc" | undefined readonly search?: string | undefined @@ -2736,7 +2687,6 @@ export type SessionListInput = { readonly cursor?: string | undefined }["parentID"] readonly directory?: { - readonly workspace?: string | undefined readonly limit?: number | undefined readonly order?: "asc" | "desc" | undefined readonly search?: string | undefined @@ -2747,7 +2697,6 @@ export type SessionListInput = { readonly cursor?: string | undefined }["directory"] readonly project?: { - readonly workspace?: string | undefined readonly limit?: number | undefined readonly order?: "asc" | "desc" | undefined readonly search?: string | undefined @@ -2758,7 +2707,6 @@ export type SessionListInput = { readonly cursor?: string | undefined }["project"] readonly subpath?: { - readonly workspace?: string | undefined readonly limit?: number | undefined readonly order?: "asc" | "desc" | undefined readonly search?: string | undefined @@ -2769,7 +2717,6 @@ export type SessionListInput = { readonly cursor?: string | undefined }["subpath"] readonly cursor?: { - readonly workspace?: string | undefined readonly limit?: number | undefined readonly order?: "asc" | "desc" | undefined readonly search?: string | undefined @@ -2829,7 +2776,7 @@ export type SessionCreateInput = { readonly title?: string | null readonly agent?: string | null readonly model?: { readonly id: string; readonly providerID: string; readonly variant?: string } | null - readonly location?: { readonly directory: string; readonly workspaceID?: string } | null + readonly location?: { readonly directory: string } | null readonly metadata?: { readonly [x: string]: JsonValue } | null readonly permissions?: ReadonlyArray<{ readonly action: string @@ -2842,7 +2789,7 @@ export type SessionCreateInput = { readonly title?: string | null readonly agent?: string | null readonly model?: { readonly id: string; readonly providerID: string; readonly variant?: string } | null - readonly location?: { readonly directory: string; readonly workspaceID?: string } | null + readonly location?: { readonly directory: string } | null readonly metadata?: { readonly [x: string]: JsonValue } | null readonly permissions?: ReadonlyArray<{ readonly action: string @@ -2855,7 +2802,7 @@ export type SessionCreateInput = { readonly title?: string | null readonly agent?: string | null readonly model?: { readonly id: string; readonly providerID: string; readonly variant?: string } | null - readonly location?: { readonly directory: string; readonly workspaceID?: string } | null + readonly location?: { readonly directory: string } | null readonly metadata?: { readonly [x: string]: JsonValue } | null readonly permissions?: ReadonlyArray<{ readonly action: string @@ -2868,7 +2815,7 @@ export type SessionCreateInput = { readonly title?: string | null readonly agent?: string | null readonly model?: { readonly id: string; readonly providerID: string; readonly variant?: string } | null - readonly location?: { readonly directory: string; readonly workspaceID?: string } | null + readonly location?: { readonly directory: string } | null readonly metadata?: { readonly [x: string]: JsonValue } | null readonly permissions?: ReadonlyArray<{ readonly action: string @@ -2881,7 +2828,7 @@ export type SessionCreateInput = { readonly title?: string | null readonly agent?: string | null readonly model?: { readonly id: string; readonly providerID: string; readonly variant?: string } | null - readonly location?: { readonly directory: string; readonly workspaceID?: string } | null + readonly location?: { readonly directory: string } | null readonly metadata?: { readonly [x: string]: JsonValue } | null readonly permissions?: ReadonlyArray<{ readonly action: string @@ -2894,7 +2841,7 @@ export type SessionCreateInput = { readonly title?: string | null readonly agent?: string | null readonly model?: { readonly id: string; readonly providerID: string; readonly variant?: string } | null - readonly location?: { readonly directory: string; readonly workspaceID?: string } | null + readonly location?: { readonly directory: string } | null readonly metadata?: { readonly [x: string]: JsonValue } | null readonly permissions?: ReadonlyArray<{ readonly action: string @@ -2907,7 +2854,7 @@ export type SessionCreateInput = { readonly title?: string | null readonly agent?: string | null readonly model?: { readonly id: string; readonly providerID: string; readonly variant?: string } | null - readonly location?: { readonly directory: string; readonly workspaceID?: string } | null + readonly location?: { readonly directory: string } | null readonly metadata?: { readonly [x: string]: JsonValue } | null readonly permissions?: ReadonlyArray<{ readonly action: string @@ -2949,7 +2896,6 @@ export type SessionImportInput = { readonly archived?: number } readonly title?: string - readonly location: { readonly directory: string; readonly workspaceID?: string } readonly subpath?: string readonly metadata?: { readonly [x: string]: JsonValue } readonly permissions?: ReadonlyArray<{ @@ -2969,6 +2915,7 @@ export type SessionImportInput = { readonly status: "added" | "deleted" | "modified" }> } + readonly location: { readonly directory: string } } readonly messages: ReadonlyArray< | { @@ -2992,14 +2939,14 @@ export type SessionImportInput = { readonly metadata?: { readonly [x: string]: JsonValue } readonly time: { readonly created: number } readonly type: "location-switched" - readonly location: { readonly directory: string; readonly workspaceID?: string } readonly projectID?: string readonly subpath?: string + readonly location: { readonly directory: string } readonly previous?: { - readonly location: { readonly directory: string; readonly workspaceID?: string } + readonly location: { readonly directory: string } readonly projectID?: string readonly subpath?: string - } + } | null } | { readonly id: string @@ -3235,7 +3182,7 @@ export type SessionImportInput = { readonly outcome: "succeeded" | "failed" | "interrupted" } > - readonly location?: { readonly directory: string; readonly workspaceID?: string } | null + readonly location?: { readonly directory: string } | null }["info"] readonly messages: { readonly info: { @@ -3266,7 +3213,6 @@ export type SessionImportInput = { readonly archived?: number } readonly title?: string - readonly location: { readonly directory: string; readonly workspaceID?: string } readonly subpath?: string readonly metadata?: { readonly [x: string]: JsonValue } readonly permissions?: ReadonlyArray<{ @@ -3286,6 +3232,7 @@ export type SessionImportInput = { readonly status: "added" | "deleted" | "modified" }> } + readonly location: { readonly directory: string } } readonly messages: ReadonlyArray< | { @@ -3309,14 +3256,14 @@ export type SessionImportInput = { readonly metadata?: { readonly [x: string]: JsonValue } readonly time: { readonly created: number } readonly type: "location-switched" - readonly location: { readonly directory: string; readonly workspaceID?: string } readonly projectID?: string readonly subpath?: string + readonly location: { readonly directory: string } readonly previous?: { - readonly location: { readonly directory: string; readonly workspaceID?: string } + readonly location: { readonly directory: string } readonly projectID?: string readonly subpath?: string - } + } | null } | { readonly id: string @@ -3552,7 +3499,7 @@ export type SessionImportInput = { readonly outcome: "succeeded" | "failed" | "interrupted" } > - readonly location?: { readonly directory: string; readonly workspaceID?: string } | null + readonly location?: { readonly directory: string } | null }["messages"] readonly location?: { readonly info: { @@ -3583,7 +3530,6 @@ export type SessionImportInput = { readonly archived?: number } readonly title?: string - readonly location: { readonly directory: string; readonly workspaceID?: string } readonly subpath?: string readonly metadata?: { readonly [x: string]: JsonValue } readonly permissions?: ReadonlyArray<{ @@ -3603,6 +3549,7 @@ export type SessionImportInput = { readonly status: "added" | "deleted" | "modified" }> } + readonly location: { readonly directory: string } } readonly messages: ReadonlyArray< | { @@ -3626,14 +3573,14 @@ export type SessionImportInput = { readonly metadata?: { readonly [x: string]: JsonValue } readonly time: { readonly created: number } readonly type: "location-switched" - readonly location: { readonly directory: string; readonly workspaceID?: string } readonly projectID?: string readonly subpath?: string + readonly location: { readonly directory: string } readonly previous?: { - readonly location: { readonly directory: string; readonly workspaceID?: string } + readonly location: { readonly directory: string } readonly projectID?: string readonly subpath?: string - } + } | null } | { readonly id: string @@ -3869,7 +3816,7 @@ export type SessionImportInput = { readonly outcome: "succeeded" | "failed" | "interrupted" } > - readonly location?: { readonly directory: string; readonly workspaceID?: string } | null + readonly location?: { readonly directory: string } | null }["location"] } @@ -3926,21 +3873,8 @@ export type SessionRenameOutput = void export type SessionMoveInput = { readonly sessionID: { readonly sessionID: string }["sessionID"] - readonly directory: { - readonly directory: string - readonly workspaceID?: string - readonly delivery?: ("steer" | "queue") | null - }["directory"] - readonly workspaceID?: { - readonly directory: string - readonly workspaceID?: string - readonly delivery?: ("steer" | "queue") | null - }["workspaceID"] - readonly delivery?: { - readonly directory: string - readonly workspaceID?: string - readonly delivery?: ("steer" | "queue") | null - }["delivery"] + readonly directory: { readonly directory: string; readonly delivery?: ("steer" | "queue") | undefined }["directory"] + readonly delivery?: { readonly directory: string; readonly delivery?: ("steer" | "queue") | undefined }["delivery"] } export type SessionMoveOutput = void @@ -4544,26 +4478,16 @@ export type MessageListInput = { export type MessageListOutput = SessionMessagesResponse export type ModelListInput = { - readonly location?: { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined - }["location"] + readonly location?: { readonly location?: { readonly directory?: string | undefined } | undefined }["location"] } -export type ModelListOutput = { - location: { directory: string; workspaceID?: string; project: { id: string; directory: string; canonical: string } } - data: Array -} +export type ModelListOutput = { location: LocationPublicInfo; data: Array } export type ModelDefaultInput = { - readonly location?: { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined - }["location"] + readonly location?: { readonly location?: { readonly directory?: string | undefined } | undefined }["location"] } -export type ModelDefaultOutput = { - location: { directory: string; workspaceID?: string; project: { id: string; directory: string; canonical: string } } - data: ModelInfo | null -} +export type ModelDefaultOutput = { location: LocationPublicInfo; data: ModelInfo | null } export type GenerateTextInput = { readonly prompt: { @@ -4579,55 +4503,33 @@ export type GenerateTextInput = { export type GenerateTextOutput = GenerateTextResponse["data"] export type ProviderListInput = { - readonly location?: { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined - }["location"] + readonly location?: { readonly location?: { readonly directory?: string | undefined } | undefined }["location"] } -export type ProviderListOutput = { - location: { directory: string; workspaceID?: string; project: { id: string; directory: string; canonical: string } } - data: Array -} +export type ProviderListOutput = { location: LocationPublicInfo; data: Array } export type ProviderGetInput = { readonly providerID: { readonly providerID: string }["providerID"] - readonly location?: { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined - }["location"] + readonly location?: { readonly location?: { readonly directory?: string | undefined } | undefined }["location"] } -export type ProviderGetOutput = { - location: { directory: string; workspaceID?: string; project: { id: string; directory: string; canonical: string } } - data: ProviderInfo -} +export type ProviderGetOutput = { location: LocationPublicInfo; data: ProviderInfo } export type IntegrationListInput = { - readonly location?: { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined - }["location"] + readonly location?: { readonly location?: { readonly directory?: string | undefined } | undefined }["location"] } -export type IntegrationListOutput = { - location: { directory: string; workspaceID?: string; project: { id: string; directory: string; canonical: string } } - data: Array -} +export type IntegrationListOutput = { location: LocationPublicInfo; data: Array } export type IntegrationGetInput = { readonly integrationID: { readonly integrationID: string }["integrationID"] - readonly location?: { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined - }["location"] + readonly location?: { readonly location?: { readonly directory?: string | undefined } | undefined }["location"] } -export type IntegrationGetOutput = { - location: { directory: string; workspaceID?: string; project: { id: string; directory: string; canonical: string } } - data: IntegrationInfo | null -} +export type IntegrationGetOutput = { location: LocationPublicInfo; data: IntegrationInfo | null } export type IntegrationWellknownAddInput = { - readonly location?: { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined - }["location"] + readonly location?: { readonly location?: { readonly directory?: string | undefined } | undefined }["location"] readonly url: { readonly url: string }["url"] } @@ -4635,9 +4537,7 @@ export type IntegrationWellknownAddOutput = void export type IntegrationConnectKeyInput = { readonly integrationID: { readonly integrationID: string }["integrationID"] - readonly location?: { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined - }["location"] + readonly location?: { readonly location?: { readonly directory?: string | undefined } | undefined }["location"] readonly key: { readonly key: string readonly answer?: { readonly [x: string]: string | number | boolean | ReadonlyArray } | undefined @@ -4659,9 +4559,7 @@ export type IntegrationConnectKeyOutput = void export type IntegrationOauthConnectInput = { readonly integrationID: { readonly integrationID: string }["integrationID"] - readonly location?: { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined - }["location"] + readonly location?: { readonly location?: { readonly directory?: string | undefined } | undefined }["location"] readonly methodID: { readonly methodID: string readonly answer?: { readonly [x: string]: string | number | boolean | ReadonlyArray } | undefined @@ -4679,36 +4577,20 @@ export type IntegrationOauthConnectInput = { }["label"] } -export type IntegrationOauthConnectOutput = { - location: { directory: string; workspaceID?: string; project: { id: string; directory: string; canonical: string } } - data: { - attemptID: string - url: string - instructions: string - mode: "auto" | "code" - time: { created: number | "Infinity" | "-Infinity" | "NaN"; expires: number | "Infinity" | "-Infinity" | "NaN" } - } -} +export type IntegrationOauthConnectOutput = { location: LocationPublicInfo; data: IntegrationAttempt } export type IntegrationOauthStatusInput = { readonly integrationID: { readonly integrationID: string; readonly attemptID: string }["integrationID"] readonly attemptID: { readonly integrationID: string; readonly attemptID: string }["attemptID"] - readonly location?: { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined - }["location"] + readonly location?: { readonly location?: { readonly directory?: string | undefined } | undefined }["location"] } -export type IntegrationOauthStatusOutput = { - location: { directory: string; workspaceID?: string; project: { id: string; directory: string; canonical: string } } - data: IntegrationAttemptStatus -} +export type IntegrationOauthStatusOutput = { location: LocationPublicInfo; data: IntegrationAttemptStatus } export type IntegrationOauthCompleteInput = { readonly integrationID: { readonly integrationID: string; readonly attemptID: string }["integrationID"] readonly attemptID: { readonly integrationID: string; readonly attemptID: string }["attemptID"] - readonly location?: { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined - }["location"] + readonly location?: { readonly location?: { readonly directory?: string | undefined } | undefined }["location"] readonly code?: { readonly code?: string | undefined }["code"] } @@ -4717,66 +4599,45 @@ export type IntegrationOauthCompleteOutput = void export type IntegrationOauthCancelInput = { readonly integrationID: { readonly integrationID: string; readonly attemptID: string }["integrationID"] readonly attemptID: { readonly integrationID: string; readonly attemptID: string }["attemptID"] - readonly location?: { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined - }["location"] + readonly location?: { readonly location?: { readonly directory?: string | undefined } | undefined }["location"] } export type IntegrationOauthCancelOutput = void export type IntegrationCommandConnectInput = { readonly integrationID: { readonly integrationID: string }["integrationID"] - readonly location?: { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined - }["location"] + readonly location?: { readonly location?: { readonly directory?: string | undefined } | undefined }["location"] readonly methodID: { readonly methodID: string; readonly label?: string | undefined }["methodID"] readonly label?: { readonly methodID: string; readonly label?: string | undefined }["label"] } -export type IntegrationCommandConnectOutput = { - location: { directory: string; workspaceID?: string; project: { id: string; directory: string; canonical: string } } - data: IntegrationCommandAttempt -} +export type IntegrationCommandConnectOutput = { location: LocationPublicInfo; data: IntegrationCommandAttempt } export type IntegrationCommandStatusInput = { readonly integrationID: { readonly integrationID: string; readonly attemptID: string }["integrationID"] readonly attemptID: { readonly integrationID: string; readonly attemptID: string }["attemptID"] - readonly location?: { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined - }["location"] + readonly location?: { readonly location?: { readonly directory?: string | undefined } | undefined }["location"] } -export type IntegrationCommandStatusOutput = { - location: { directory: string; workspaceID?: string; project: { id: string; directory: string; canonical: string } } - data: IntegrationCommandAttemptStatus -} +export type IntegrationCommandStatusOutput = { location: LocationPublicInfo; data: IntegrationCommandAttemptStatus } export type IntegrationCommandCancelInput = { readonly integrationID: { readonly integrationID: string; readonly attemptID: string }["integrationID"] readonly attemptID: { readonly integrationID: string; readonly attemptID: string }["attemptID"] - readonly location?: { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined - }["location"] + readonly location?: { readonly location?: { readonly directory?: string | undefined } | undefined }["location"] } export type IntegrationCommandCancelOutput = void export type McpListInput = { - readonly location?: { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined - }["location"] + readonly location?: { readonly location?: { readonly directory?: string | undefined } | undefined }["location"] } -export type McpListOutput = { - location: { directory: string; workspaceID?: string; project: { id: string; directory: string; canonical: string } } - data: Array -} +export type McpListOutput = { location: LocationPublicInfo; data: Array } export type McpAddInput = { readonly server: { readonly server: string }["server"] - readonly location?: { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined - }["location"] + readonly location?: { readonly location?: { readonly directory?: string | undefined } | undefined }["location"] readonly config: { readonly config: | { @@ -4812,47 +4673,34 @@ export type McpAddOutput = void export type McpRemoveInput = { readonly server: { readonly server: string }["server"] - readonly location?: { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined - }["location"] + readonly location?: { readonly location?: { readonly directory?: string | undefined } | undefined }["location"] } export type McpRemoveOutput = void export type McpConnectInput = { readonly server: { readonly server: string }["server"] - readonly location?: { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined - }["location"] + readonly location?: { readonly location?: { readonly directory?: string | undefined } | undefined }["location"] } export type McpConnectOutput = void export type McpDisconnectInput = { readonly server: { readonly server: string }["server"] - readonly location?: { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined - }["location"] + readonly location?: { readonly location?: { readonly directory?: string | undefined } | undefined }["location"] } export type McpDisconnectOutput = void export type McpResourceCatalogInput = { - readonly location?: { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined - }["location"] + readonly location?: { readonly location?: { readonly directory?: string | undefined } | undefined }["location"] } -export type McpResourceCatalogOutput = { - location: { directory: string; workspaceID?: string; project: { id: string; directory: string; canonical: string } } - data: McpResourceCatalog -} +export type McpResourceCatalogOutput = { location: LocationPublicInfo; data: McpResourceCatalog } export type CredentialUpdateInput = { readonly credentialID: { readonly credentialID: string }["credentialID"] - readonly location?: { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined - }["location"] + readonly location?: { readonly location?: { readonly directory?: string | undefined } | undefined }["location"] readonly label: { readonly label: string }["label"] } @@ -4860,18 +4708,14 @@ export type CredentialUpdateOutput = void export type CredentialActivateInput = { readonly credentialID: { readonly credentialID: string }["credentialID"] - readonly location?: { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined - }["location"] + readonly location?: { readonly location?: { readonly directory?: string | undefined } | undefined }["location"] } export type CredentialActivateOutput = void export type CredentialRemoveInput = { readonly credentialID: { readonly credentialID: string }["credentialID"] - readonly location?: { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined - }["location"] + readonly location?: { readonly location?: { readonly directory?: string | undefined } | undefined }["location"] } export type CredentialRemoveOutput = void @@ -4909,15 +4753,10 @@ export type ProjectUpdateInput = { export type ProjectUpdateOutput = Project export type FormRequestListInput = { - readonly location?: { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined - }["location"] + readonly location?: { readonly location?: { readonly directory?: string | undefined } | undefined }["location"] } -export type FormRequestListOutput = { - location: { directory: string; workspaceID?: string; project: { id: string; directory: string; canonical: string } } - data: Array -} +export type FormRequestListOutput = { location: LocationPublicInfo; data: Array } export type FormListInput = { readonly sessionID: { readonly sessionID: string }["sessionID"] } @@ -5765,15 +5604,10 @@ export type FormCancelInput = { export type FormCancelOutput = void export type PermissionRequestListInput = { - readonly location?: { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined - }["location"] + readonly location?: { readonly location?: { readonly directory?: string | undefined } | undefined }["location"] } -export type PermissionRequestListOutput = { - location: { directory: string; workspaceID?: string; project: { id: string; directory: string; canonical: string } } - data: Array -} +export type PermissionRequestListOutput = { location: LocationPublicInfo; data: Array } export type PermissionSavedListInput = { readonly projectID?: { readonly projectID?: string | undefined }["projectID"] } @@ -5886,9 +5720,7 @@ export type PermissionRulesInput = { export type PermissionRulesOutput = void export type FileReadInput = { - readonly location?: { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined - }["location"] + readonly location?: { readonly location?: { readonly directory?: string | undefined } | undefined }["location"] readonly path: string } @@ -5896,80 +5728,62 @@ export type FileReadOutput = globalThis.Uint8Array export type FileListInput = { readonly location?: { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined + readonly location?: { readonly directory?: string | undefined } | undefined readonly path?: string | undefined }["location"] readonly path?: { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined + readonly location?: { readonly directory?: string | undefined } | undefined readonly path?: string | undefined }["path"] } -export type FileListOutput = { - location: { directory: string; workspaceID?: string; project: { id: string; directory: string; canonical: string } } - data: Array -} +export type FileListOutput = { location: LocationPublicInfo; data: Array } export type FileFindInput = { readonly location?: { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined + readonly location?: { readonly directory?: string | undefined } | undefined readonly query: string readonly type?: "file" | "directory" | undefined readonly limit?: number | undefined }["location"] readonly query: { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined + readonly location?: { readonly directory?: string | undefined } | undefined readonly query: string readonly type?: "file" | "directory" | undefined readonly limit?: number | undefined }["query"] readonly type?: { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined + readonly location?: { readonly directory?: string | undefined } | undefined readonly query: string readonly type?: "file" | "directory" | undefined readonly limit?: number | undefined }["type"] readonly limit?: { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined + readonly location?: { readonly directory?: string | undefined } | undefined readonly query: string readonly type?: "file" | "directory" | undefined readonly limit?: number | undefined }["limit"] } -export type FileFindOutput = { - location: { directory: string; workspaceID?: string; project: { id: string; directory: string; canonical: string } } - data: Array -} +export type FileFindOutput = { location: LocationPublicInfo; data: Array } export type CommandListInput = { - readonly location?: { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined - }["location"] + readonly location?: { readonly location?: { readonly directory?: string | undefined } | undefined }["location"] } -export type CommandListOutput = { - location: { directory: string; workspaceID?: string; project: { id: string; directory: string; canonical: string } } - data: Array -} +export type CommandListOutput = { location: LocationPublicInfo; data: Array } export type SkillListInput = { - readonly location?: { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined - }["location"] + readonly location?: { readonly location?: { readonly directory?: string | undefined } | undefined }["location"] } -export type SkillListOutput = { - location: { directory: string; workspaceID?: string; project: { id: string; directory: string; canonical: string } } - data: Array -} +export type SkillListOutput = { location: LocationPublicInfo; data: Array } export type RpcCallInput = { readonly rpcID: { readonly rpcID: string; readonly method: string }["rpcID"] readonly method: { readonly rpcID: string; readonly method: string }["method"] - readonly location?: { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined - }["location"] + readonly location?: { readonly location?: { readonly directory?: string | undefined } | undefined }["location"] readonly input?: { readonly input: JsonValue }["input"] } @@ -5978,20 +5792,13 @@ export type RpcCallOutput = RpcOutput export type EventSubscribeOutput = V2Event export type PtyListInput = { - readonly location?: { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined - }["location"] + readonly location?: { readonly location?: { readonly directory?: string | undefined } | undefined }["location"] } -export type PtyListOutput = { - location: { directory: string; workspaceID?: string; project: { id: string; directory: string; canonical: string } } - data: Array -} +export type PtyListOutput = { location: LocationPublicInfo; data: Array } export type PtyCreateInput = { - readonly location?: { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined - }["location"] + readonly location?: { readonly location?: { readonly directory?: string | undefined } | undefined }["location"] readonly command?: { readonly command?: string readonly args?: ReadonlyArray @@ -6029,28 +5836,18 @@ export type PtyCreateInput = { }["env"] } -export type PtyCreateOutput = { - location: { directory: string; workspaceID?: string; project: { id: string; directory: string; canonical: string } } - data: Pty -} +export type PtyCreateOutput = { location: LocationPublicInfo; data: Pty } export type PtyGetInput = { readonly ptyID: { readonly ptyID: string }["ptyID"] - readonly location?: { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined - }["location"] + readonly location?: { readonly location?: { readonly directory?: string | undefined } | undefined }["location"] } -export type PtyGetOutput = { - location: { directory: string; workspaceID?: string; project: { id: string; directory: string; canonical: string } } - data: Pty -} +export type PtyGetOutput = { location: LocationPublicInfo; data: Pty } export type PtyUpdateInput = { readonly ptyID: { readonly ptyID: string }["ptyID"] - readonly location?: { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined - }["location"] + readonly location?: { readonly location?: { readonly directory?: string | undefined } | undefined }["location"] readonly title?: { readonly title?: string readonly size?: { readonly rows: number; readonly cols: number } @@ -6058,32 +5855,22 @@ export type PtyUpdateInput = { readonly size?: { readonly title?: string; readonly size?: { readonly rows: number; readonly cols: number } }["size"] } -export type PtyUpdateOutput = { - location: { directory: string; workspaceID?: string; project: { id: string; directory: string; canonical: string } } - data: Pty -} +export type PtyUpdateOutput = { location: LocationPublicInfo; data: Pty } export type PtyRemoveInput = { readonly ptyID: { readonly ptyID: string }["ptyID"] - readonly location?: { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined - }["location"] + readonly location?: { readonly location?: { readonly directory?: string | undefined } | undefined }["location"] } export type PtyRemoveOutput = void export type PtyConnectTokenInput = { readonly ptyID: { readonly ptyID: string }["ptyID"] - readonly location?: { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined - }["location"] + readonly location?: { readonly location?: { readonly directory?: string | undefined } | undefined }["location"] readonly "x-opencode-ticket"?: { readonly "x-opencode-ticket"?: string | undefined }["x-opencode-ticket"] } -export type PtyConnectTokenOutput = { - location: { directory: string; workspaceID?: string; project: { id: string; directory: string; canonical: string } } - data: PtyTicketConnectToken -} +export type PtyConnectTokenOutput = { location: LocationPublicInfo; data: PtyTicketConnectToken } export type ExperimentalPersistentPtyReadInput = { readonly sessionID: { readonly sessionID: string }["sessionID"] @@ -6188,20 +5975,13 @@ export type ExperimentalPersistentPtyConnectTokenInput = { export type ExperimentalPersistentPtyConnectTokenOutput = { data: PtyTicketConnectToken }["data"] export type ShellListInput = { - readonly location?: { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined - }["location"] + readonly location?: { readonly location?: { readonly directory?: string | undefined } | undefined }["location"] } -export type ShellListOutput = { - location: { directory: string; workspaceID?: string; project: { id: string; directory: string; canonical: string } } - data: Array -} +export type ShellListOutput = { location: LocationPublicInfo; data: Array } export type ShellCreateInput = { - readonly location?: { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined - }["location"] + readonly location?: { readonly location?: { readonly directory?: string | undefined } | undefined }["location"] readonly command: { readonly command: string readonly cwd?: string @@ -6228,92 +6008,68 @@ export type ShellCreateInput = { }["metadata"] } -export type ShellCreateOutput = { - location: { directory: string; workspaceID?: string; project: { id: string; directory: string; canonical: string } } - data: ShellInfo1 -} +export type ShellCreateOutput = { location: LocationPublicInfo; data: ShellInfo1 } export type ShellGetInput = { readonly id: { readonly id: string }["id"] - readonly location?: { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined - }["location"] + readonly location?: { readonly location?: { readonly directory?: string | undefined } | undefined }["location"] } -export type ShellGetOutput = { - location: { directory: string; workspaceID?: string; project: { id: string; directory: string; canonical: string } } - data: ShellInfo1 -} +export type ShellGetOutput = { location: LocationPublicInfo; data: ShellInfo1 } export type ShellTimeoutInput = { readonly id: { readonly id: string }["id"] - readonly location?: { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined - }["location"] + readonly location?: { readonly location?: { readonly directory?: string | undefined } | undefined }["location"] readonly timeout: { readonly timeout: number }["timeout"] } -export type ShellTimeoutOutput = { - location: { directory: string; workspaceID?: string; project: { id: string; directory: string; canonical: string } } - data: ShellInfo1 -} +export type ShellTimeoutOutput = { location: LocationPublicInfo; data: ShellInfo1 } export type ShellOutputInput = { readonly id: { readonly id: string }["id"] readonly location?: { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined + readonly location?: { readonly directory?: string | undefined } | undefined readonly cursor?: number | undefined readonly limit?: number | undefined }["location"] readonly cursor?: { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined + readonly location?: { readonly directory?: string | undefined } | undefined readonly cursor?: number | undefined readonly limit?: number | undefined }["cursor"] readonly limit?: { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined + readonly location?: { readonly directory?: string | undefined } | undefined readonly cursor?: number | undefined readonly limit?: number | undefined }["limit"] } export type ShellOutputOutput = { - location: { directory: string; workspaceID?: string; project: { id: string; directory: string; canonical: string } } + location: LocationPublicInfo data: { output: string; cursor: number; size: number; truncated: boolean } } export type ShellRemoveInput = { readonly id: { readonly id: string }["id"] - readonly location?: { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined - }["location"] + readonly location?: { readonly location?: { readonly directory?: string | undefined } | undefined }["location"] } export type ShellRemoveOutput = void export type ReferenceListInput = { - readonly location?: { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined - }["location"] + readonly location?: { readonly location?: { readonly directory?: string | undefined } | undefined }["location"] } -export type ReferenceListOutput = { - location: { directory: string; workspaceID?: string; project: { id: string; directory: string; canonical: string } } - data: Array -} +export type ReferenceListOutput = { location: LocationPublicInfo; data: Array } export type WorktreeListInput = { - readonly location?: { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined - }["location"] + readonly location?: { readonly location?: { readonly directory?: string | undefined } | undefined }["location"] } export type WorktreeListOutput = WorktreeList export type WorktreeCreateInput = { - readonly location?: { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined - }["location"] + readonly location?: { readonly location?: { readonly directory?: string | undefined } | undefined }["location"] readonly strategy?: { readonly strategy?: string readonly from?: string @@ -6354,9 +6110,7 @@ export type WorktreeCreateInput = { export type WorktreeCreateOutput = WorktreeInfo export type WorktreeRemoveInput = { - readonly location?: { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined - }["location"] + readonly location?: { readonly location?: { readonly directory?: string | undefined } | undefined }["location"] readonly directory: { readonly directory: string; readonly force: boolean }["directory"] readonly force: { readonly directory: string; readonly force: boolean }["force"] } @@ -6364,118 +6118,82 @@ export type WorktreeRemoveInput = { export type WorktreeRemoveOutput = void export type WorktreeRefreshInput = { - readonly location?: { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined - }["location"] + readonly location?: { readonly location?: { readonly directory?: string | undefined } | undefined }["location"] } export type WorktreeRefreshOutput = void -export type WorkspaceCreateInput = { - readonly id?: { readonly id?: string | undefined; readonly provider: string }["id"] - readonly provider: { readonly id?: string | undefined; readonly provider: string }["provider"] -} - -export type WorkspaceCreateOutput = { data: string }["data"] - -export type WorkspaceDestroyInput = { readonly workspaceID: { readonly workspaceID: string }["workspaceID"] } - -export type WorkspaceDestroyOutput = WorkspaceDestroyResult - export type VcsGetInput = { - readonly location?: { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined - }["location"] + readonly location?: { readonly location?: { readonly directory?: string | undefined } | undefined }["location"] } -export type VcsGetOutput = { - location: { directory: string; workspaceID?: string; project: { id: string; directory: string; canonical: string } } - data: VcsInfo -} +export type VcsGetOutput = { location: LocationPublicInfo; data: VcsInfo } export type VcsBaseInput = { - readonly location?: { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined - }["location"] + readonly location?: { readonly location?: { readonly directory?: string | undefined } | undefined }["location"] } -export type VcsBaseOutput = { - location: { directory: string; workspaceID?: string; project: { id: string; directory: string; canonical: string } } - data: VcsBase | null -} +export type VcsBaseOutput = { location: LocationPublicInfo; data: VcsBase | null } export type VcsStatusInput = { - readonly location?: { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined - }["location"] + readonly location?: { readonly location?: { readonly directory?: string | undefined } | undefined }["location"] } -export type VcsStatusOutput = { - location: { directory: string; workspaceID?: string; project: { id: string; directory: string; canonical: string } } - data: Array -} +export type VcsStatusOutput = { location: LocationPublicInfo; data: Array } export type VcsBranchesInput = { readonly location?: { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined + readonly location?: { readonly directory?: string | undefined } | undefined readonly search?: string | undefined readonly limit?: number | undefined }["location"] readonly search?: { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined + readonly location?: { readonly directory?: string | undefined } | undefined readonly search?: string | undefined readonly limit?: number | undefined }["search"] readonly limit?: { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined + readonly location?: { readonly directory?: string | undefined } | undefined readonly search?: string | undefined readonly limit?: number | undefined }["limit"] } -export type VcsBranchesOutput = { - location: { directory: string; workspaceID?: string; project: { id: string; directory: string; canonical: string } } - data: VcsBranchList -} +export type VcsBranchesOutput = { location: LocationPublicInfo; data: VcsBranchList } export type VcsDiffInput = { readonly location?: { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined + readonly location?: { readonly directory?: string | undefined } | undefined readonly mode: "working" | "branch" | "committed" readonly base?: string | undefined readonly context?: number | undefined }["location"] readonly mode: { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined + readonly location?: { readonly directory?: string | undefined } | undefined readonly mode: "working" | "branch" | "committed" readonly base?: string | undefined readonly context?: number | undefined }["mode"] readonly base?: { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined + readonly location?: { readonly directory?: string | undefined } | undefined readonly mode: "working" | "branch" | "committed" readonly base?: string | undefined readonly context?: number | undefined }["base"] readonly context?: { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined + readonly location?: { readonly directory?: string | undefined } | undefined readonly mode: "working" | "branch" | "committed" readonly base?: string | undefined readonly context?: number | undefined }["context"] } -export type VcsDiffOutput = { - location: { directory: string; workspaceID?: string; project: { id: string; directory: string; canonical: string } } - data: Array -} +export type VcsDiffOutput = { location: LocationPublicInfo; data: Array } -export type DebugLocationListOutput = Array +export type DebugLocationListOutput = Array export type DebugLocationEvictInput = { - readonly location?: { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined - }["location"] + readonly location?: { readonly location?: { readonly directory?: string | undefined } | undefined }["location"] } export type DebugLocationEvictOutput = void @@ -6486,33 +6204,24 @@ export type MigrationV1StatusOutput = | { status: "error"; error: string } export type WebsearchProvidersInput = { - readonly location?: { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined - }["location"] + readonly location?: { readonly location?: { readonly directory?: string | undefined } | undefined }["location"] } -export type WebsearchProvidersOutput = { - location: { directory: string; workspaceID?: string; project: { id: string; directory: string; canonical: string } } - data: Array -} +export type WebsearchProvidersOutput = { location: LocationPublicInfo; data: Array } export type WebsearchQueryInput = { - readonly location?: { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined - }["location"] + readonly location?: { readonly location?: { readonly directory?: string | undefined } | undefined }["location"] readonly query: { readonly query: string; readonly providerID?: string }["query"] readonly providerID?: { readonly query: string; readonly providerID?: string }["providerID"] } export type WebsearchQueryOutput = { - location: { directory: string; workspaceID?: string; project: { id: string; directory: string; canonical: string } } + location: LocationPublicInfo data: { providerID: string; results: Array } } export type ConfigGetInput = { - readonly location?: { - readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined - }["location"] + readonly location?: { readonly location?: { readonly directory?: string | undefined } | undefined }["location"] } export type ConfigGetOutput = Array diff --git a/packages/client/src/solid/data.ts b/packages/client/src/solid/data.ts index 4ad3a1f0610..a1e6217d9a4 100644 --- a/packages/client/src/solid/data.ts +++ b/packages/client/src/solid/data.ts @@ -131,7 +131,7 @@ export function locationKey(location: LocationRef) { } function locationQuery(ref: LocationRef) { - return { directory: ref.directory, workspace: ref.workspaceID } + return { directory: ref.directory } } function formRequestOptions(sessionID: string, ref?: LocationRef) { @@ -139,7 +139,6 @@ function formRequestOptions(sessionID: string, ref?: LocationRef) { return { headers: { "x-opencode-directory": encodeURIComponent(ref.directory), - ...(ref.workspaceID ? { "x-opencode-workspace": ref.workspaceID } : {}), }, } } @@ -727,7 +726,6 @@ export function createData(config: CreateDataInput) { const explicit = event.data.adopted?.includes(info.projectID) const directory = explicit ? store.project.info[info.projectID]?.canonical : info.location.directory if (!directory) { - if (info.location.workspaceID) continue result.session.invalidate(sessionID) refresh(() => result.session.sync(sessionID)) continue @@ -736,7 +734,6 @@ export function createData(config: CreateDataInput) { { projectID: info.projectID, directory, - workspaceID: info.location.workspaceID, }, event.data, ) @@ -1305,7 +1302,7 @@ export function createData(config: CreateDataInput) { const vcs = locationResource("vcs", (location) => api().vcs.get({ location })) const shells = locationResource("shell", async (location) => { const response = await api().shell.list({ location }) - const ref = { directory: response.location.directory, workspaceID: response.location.workspaceID } + const ref = { directory: response.location.directory } return { location: response.location, data: Object.fromEntries(response.data.map((info) => [info.id, { ...info, location: ref }])), @@ -1725,7 +1722,6 @@ export function createData(config: CreateDataInput) { }) const location = { directory: response.location.directory, - workspaceID: response.location.workspaceID, } const locationID = locationKey(location) setStore("session", "form", sessionID, [ @@ -1814,7 +1810,7 @@ export function createData(config: CreateDataInput) { if (!store.location[key]) setStore("location", key, {}) setStore("location", key, "info", location) if (!ref) { - setDefaultLocation({ directory: location.directory, workspaceID: location.workspaceID }) + setDefaultLocation({ directory: location.directory }) } }) }, @@ -1857,7 +1853,7 @@ export function createData(config: CreateDataInput) { agent: locationResource("agent", (location) => api().agent.list({ location })), command: locationResource("command", (location) => api().command.list({ location })), config: locationResource("config", async (location) => ({ - location: { directory: location.directory, workspaceID: location.workspace }, + location: { directory: location.directory }, data: await api().config.get({ location }), })), integration: locationResource("integration", (location) => api().integration.list({ location })), diff --git a/packages/client/src/solid/pty.ts b/packages/client/src/solid/pty.ts index 04ac30d76cd..47c87827755 100644 --- a/packages/client/src/solid/pty.ts +++ b/packages/client/src/solid/pty.ts @@ -28,7 +28,6 @@ export function createPtyClient(api: OpenCodeClient, options: PtyClientOptions) }) const url = new URL(`/api/pty/${encodeURIComponent(input.ptyID)}/connect`, options.url) if (input.location?.directory) url.searchParams.set("location[directory]", input.location.directory) - if (input.location?.workspace) url.searchParams.set("location[workspace]", input.location.workspace) if (input.cursor !== undefined) url.searchParams.set("cursor", String(input.cursor)) url.searchParams.set("ticket", result.data.ticket) url.protocol = url.protocol === "https:" ? "wss:" : "ws:" diff --git a/packages/client/test/promise.test.ts b/packages/client/test/promise.test.ts index 9c182ca880d..74acfbeac34 100644 --- a/packages/client/test/promise.test.ts +++ b/packages/client/test/promise.test.ts @@ -30,7 +30,6 @@ test("exposes every standard HTTP API group", () => { "shell", "reference", "worktree", - "workspace", "vcs", "debug", "migration", @@ -410,21 +409,6 @@ test("worktree operations send the configuration location separately from their expect(requests[3]?.url).toBe("http://localhost:3000/api/worktree?location%5Bdirectory%5D=%2Frepo%2Fnested") }) -test("workspace.destroy returns the transition result", async () => { - let request: Request | undefined - const client = OpenCode.make({ - baseUrl: "http://localhost:3000", - fetch: async (input, init) => { - request = input instanceof Request ? input : new Request(input, init) - return Response.json({ destroyed: false }) - }, - }) - - expect(await client.workspace.destroy({ workspaceID: "wrk_missing" })).toEqual({ destroyed: false }) - expect(request?.method).toBe("DELETE") - expect(request?.url).toBe("http://localhost:3000/api/workspace/wrk_missing") -}) - test("shell list and remove use the public HTTP contract", async () => { const requests: Array<{ method: string; url: string }> = [] const shell = { diff --git a/packages/client/test/solid-data.test.ts b/packages/client/test/solid-data.test.ts index 4260aa18ac6..54ab265b2a7 100644 --- a/packages/client/test/solid-data.test.ts +++ b/packages/client/test/solid-data.test.ts @@ -302,7 +302,7 @@ test("adopts cached directory-project sessions when their repository is resolved ...session(0), id: "ses_remote", projectID: "directory-root", - location: { directory: "/repo", workspaceID: "workspace-remote" }, + location: { directory: "/repo" }, }, ] sessions.forEach((item) => setup.data.session.remember(item)) @@ -342,7 +342,7 @@ test("adopts cached directory-project sessions when their repository is resolved expect(setup.data.session.get("ses_escaped")?.projectID).toBe("global") expect(setup.data.session.get("ses_other")?.projectID).toBe("other-repository") expect(setup.data.session.get("ses_sibling")?.projectID).toBe("global") - expect(setup.data.session.get("ses_remote")?.projectID).toBe("directory-root") + expect(setup.data.session.get("ses_remote")?.projectID).toBe("repository") await wait(() => setup.data.session.get("ses_uncached")?.projectID === "repository") expect(setup.data.session.get("ses_uncached")?.subpath).toBe("app") } finally { @@ -350,7 +350,7 @@ test("adopts cached directory-project sessions when their repository is resolved } }) -test("refreshes global credential events across every loaded location and workspace", async () => { +test("refreshes global credential events across every loaded location", async () => { const listeners = new Set[0]>() const requests: URL[] = [] const api = OpenCode.make({ @@ -363,7 +363,6 @@ test("refreshes global credential events across every loaded location and worksp return Response.json({ location: { directory, - workspaceID: url.searchParams.get("location[workspace]") ?? undefined, project: { id: "project", directory, canonical: directory }, }, data: [], @@ -385,7 +384,7 @@ test("refreshes global credential events across every loaded location and worksp }), dispose, })) - const locations = [{ directory: "/project" }, { directory: "/other", workspaceID: "workspace-other" }] + const locations = [{ directory: "/project" }, { directory: "/other" }] try { await Promise.all( @@ -408,14 +407,10 @@ test("refreshes global credential events across every loaded location and worksp listeners.forEach((listener) => listener({ name: updated.type, details: updated })) await wait(() => requests.length === 2) expect( - requests.map((url) => [ - url.pathname, - url.searchParams.get("location[directory]"), - url.searchParams.get("location[workspace]"), - ]), + requests.map((url) => [url.pathname, url.searchParams.get("location[directory]")]), ).toEqual([ - ["/api/integration", "/project", null], - ["/api/integration", "/other", "workspace-other"], + ["/api/integration", "/project"], + ["/api/integration", "/other"], ]) requests.length = 0 @@ -429,17 +424,13 @@ test("refreshes global credential events across every loaded location and worksp listeners.forEach((listener) => listener({ name: switched.type, details: switched })) await wait(() => requests.length === 4) expect( - requests.map((url) => [ - url.pathname, - url.searchParams.get("location[directory]"), - url.searchParams.get("location[workspace]"), - ]), + requests.map((url) => [url.pathname, url.searchParams.get("location[directory]")]), ).toEqual( expect.arrayContaining([ - ["/api/model", "/project", null], - ["/api/provider", "/project", null], - ["/api/model", "/other", "workspace-other"], - ["/api/provider", "/other", "workspace-other"], + ["/api/model", "/project"], + ["/api/provider", "/project"], + ["/api/model", "/other"], + ["/api/provider", "/other"], ]), ) locations.forEach((location, index) => @@ -465,7 +456,6 @@ test("refreshes references for the location an update names", async () => { return Response.json({ location: { directory, - workspaceID: url.searchParams.get("location[workspace]") ?? undefined, project: { id: "project", directory, canonical: directory }, }, data: [], @@ -487,7 +477,7 @@ test("refreshes references for the location an update names", async () => { }), dispose, })) - const other = { directory: "/other", workspaceID: "workspace-other" } + const other = { directory: "/other" } try { await Promise.all([setup.data.location.reference.sync(), setup.data.location.reference.sync(other)]) @@ -502,11 +492,10 @@ test("refreshes references for the location an update names", async () => { } listeners.forEach((listener) => listener({ name: updated.type, details: updated })) await wait(() => requests.length === 1) - expect([ - requests[0]!.pathname, - requests[0]!.searchParams.get("location[directory]"), - requests[0]!.searchParams.get("location[workspace]"), - ]).toEqual(["/api/reference", "/other", "workspace-other"]) + expect([requests[0]!.pathname, requests[0]!.searchParams.get("location[directory]")]).toEqual([ + "/api/reference", + "/other", + ]) } finally { setup.dispose() } diff --git a/packages/client/test/solid-pty.test.ts b/packages/client/test/solid-pty.test.ts index eb63ccbbf03..a02681c0c33 100644 --- a/packages/client/test/solid-pty.test.ts +++ b/packages/client/test/solid-pty.test.ts @@ -32,18 +32,18 @@ describe("createPtyClient", () => { expect( await pty.connect({ ptyID: "pty_1", - location: { directory: "/repo/worktree", workspace: "workspace_1" }, + location: { directory: "/repo/worktree" }, cursor: 42, }), ).toBe(socket) expect(request?.method).toBe("POST") expect(request?.url).toBe( - "https://server.example/api/pty/pty_1/connect-token?location%5Bdirectory%5D=%2Frepo%2Fworktree&location%5Bworkspace%5D=workspace_1", + "https://server.example/api/pty/pty_1/connect-token?location%5Bdirectory%5D=%2Frepo%2Fworktree", ) expect(request?.headers.get("authorization")).toBe("Basic credential") expect(request?.headers.get("x-opencode-ticket")).toBe("1") expect(socketURL?.toString()).toBe( - "wss://server.example/api/pty/pty_1/connect?location%5Bdirectory%5D=%2Frepo%2Fworktree&location%5Bworkspace%5D=workspace_1&cursor=42&ticket=ticket-1", + "wss://server.example/api/pty/pty_1/connect?location%5Bdirectory%5D=%2Frepo%2Fworktree&cursor=42&ticket=ticket-1", ) expect(socket.binaryType).toBe("arraybuffer") }) diff --git a/packages/codemode/test/fixtures/opencode-v2-openapi.json b/packages/codemode/test/fixtures/opencode-v2-openapi.json deleted file mode 100644 index 203b8f66974..00000000000 --- a/packages/codemode/test/fixtures/opencode-v2-openapi.json +++ /dev/null @@ -1,23590 +0,0 @@ -{ - "openapi": "3.1.0", - "info": { - "title": "opencode HttpApi", - "version": "0.0.1", - "description": "Experimental HttpApi surface for selected instance routes." - }, - "paths": { - "/api/status": { - "get": { - "tags": ["server"], - "operationId": "server.status", - "parameters": [], - "security": [], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "version": { - "type": "string" - }, - "pid": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - "urls": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": ["version", "pid", "urls"], - "additionalProperties": false - } - } - } - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - } - }, - "description": "Return the server identity, connection URLs, and readiness status.", - "summary": "Get server status" - } - }, - "/api/location": { - "get": { - "tags": ["location"], - "operationId": "location.get", - "parameters": [ - { - "name": "location", - "in": "query", - "schema": { - "anyOf": [ - { - "type": "object", - "properties": { - "directory": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - }, - "additionalProperties": false - }, - { - "type": "null" - } - ] - }, - "required": false, - "style": "deepObject", - "explode": true - } - ], - "security": [], - "responses": { - "200": { - "description": "Location.Info", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Location.Info" - } - } - } - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - } - }, - "description": "Resolve the requested location or the server default location.", - "summary": "Get location" - } - }, - "/api/agent": { - "get": { - "tags": ["agent"], - "operationId": "agent.list", - "parameters": [ - { - "name": "location", - "in": "query", - "schema": { - "anyOf": [ - { - "type": "object", - "properties": { - "directory": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - }, - "additionalProperties": false - }, - { - "type": "null" - } - ] - }, - "required": false, - "style": "deepObject", - "explode": true - } - ], - "security": [], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "location": { - "$ref": "#/components/schemas/Location.Info" - }, - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Agent.Info" - } - } - }, - "required": ["location", "data"], - "additionalProperties": false - } - } - } - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - } - }, - "description": "Retrieve currently registered agents.", - "summary": "List agents" - } - }, - "/api/plugin": { - "get": { - "tags": ["plugin"], - "operationId": "plugin.list", - "parameters": [ - { - "name": "location", - "in": "query", - "schema": { - "anyOf": [ - { - "type": "object", - "properties": { - "directory": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - }, - "additionalProperties": false - }, - { - "type": "null" - } - ] - }, - "required": false, - "style": "deepObject", - "explode": true - } - ], - "security": [], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "location": { - "$ref": "#/components/schemas/Location.Info" - }, - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Plugin.Info" - } - } - }, - "required": ["location", "data"], - "additionalProperties": false - } - } - } - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - } - }, - "description": "Retrieve currently loaded plugins.", - "summary": "List plugins" - } - }, - "/api/session": { - "get": { - "tags": ["session"], - "operationId": "session.list", - "parameters": [ - { - "name": "workspace", - "in": "query", - "schema": { - "anyOf": [ - { - "type": "string", - "allOf": [ - { - "pattern": "^wrk" - } - ] - }, - { - "type": "null" - } - ] - }, - "required": false - }, - { - "name": "limit", - "in": "query", - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Maximum number of sessions to return. Defaults to the newest 50 sessions." - }, - "required": false - }, - { - "name": "order", - "in": "query", - "schema": { - "anyOf": [ - { - "type": "string", - "enum": ["asc", "desc"] - }, - { - "type": "null" - } - ], - "description": "Session order for the first page. Use desc for newest first or asc for oldest first." - }, - "required": false - }, - { - "name": "search", - "in": "query", - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "required": false - }, - { - "name": "parentID", - "in": "query", - "schema": { - "anyOf": [ - { - "anyOf": [ - { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - { - "type": "string", - "enum": ["null"] - } - ], - "description": "Filter by parent session. Use null to return only root sessions." - }, - { - "type": "null" - } - ] - }, - "required": false - }, - { - "name": "directory", - "in": "query", - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "required": false - }, - { - "name": "project", - "in": "query", - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "required": false - }, - { - "name": "subpath", - "in": "query", - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "required": false - }, - { - "name": "cursor", - "in": "query", - "schema": { - "anyOf": [ - { - "type": "string", - "description": "Opaque pagination cursor returned as cursor.previous or cursor.next in the previous response." - }, - { - "type": "null" - } - ] - }, - "required": false - } - ], - "security": [], - "responses": { - "200": { - "description": "SessionsResponse", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SessionsResponse" - } - } - } - }, - "400": { - "description": "InvalidCursorError | InvalidRequestError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/InvalidCursorError" - }, - { - "$ref": "#/components/schemas/InvalidRequestError1" - }, - { - "$ref": "#/components/schemas/InvalidRequestError" - } - ] - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - } - }, - "description": "Retrieve sessions in the requested order. Items keep that order across pages; use cursor.next or cursor.previous to move through the ordered list.", - "summary": "List sessions" - }, - "post": { - "tags": ["session"], - "operationId": "session.create", - "parameters": [], - "security": [], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "data": { - "$ref": "#/components/schemas/Session.Info" - } - }, - "required": ["data"], - "additionalProperties": false - } - } - } - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - } - }, - "description": "Create a session at the requested location.", - "summary": "Create session", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "id": { - "anyOf": [ - { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - { - "type": "null" - } - ] - }, - "agent": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "model": { - "anyOf": [ - { - "$ref": "#/components/schemas/Model.Ref" - }, - { - "type": "null" - } - ] - }, - "location": { - "anyOf": [ - { - "$ref": "#/components/schemas/Location.Ref" - }, - { - "type": "null" - } - ] - } - }, - "additionalProperties": false - } - } - }, - "required": true - } - } - }, - "/api/session/active": { - "get": { - "tags": ["session"], - "operationId": "session.active", - "parameters": [], - "security": [], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "data": { - "type": "object", - "patternProperties": { - "^ses": { - "$ref": "#/components/schemas/SessionActive" - } - } - } - }, - "required": ["data"], - "additionalProperties": false - } - } - } - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - } - }, - "description": "Retrieve foreground Session drains currently owned by this OpenCode process. Sessions absent from the result are inactive.", - "summary": "List active sessions" - } - }, - "/api/session/{sessionID}": { - "get": { - "tags": ["session"], - "operationId": "session.get", - "parameters": [ - { - "name": "sessionID", - "in": "path", - "schema": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "required": true - } - ], - "security": [], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "data": { - "$ref": "#/components/schemas/Session.Info" - } - }, - "required": ["data"], - "additionalProperties": false - } - } - } - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - }, - "404": { - "description": "SessionNotFoundError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/SessionNotFoundError" - }, - { - "$ref": "#/components/schemas/SessionNotFoundError" - } - ] - } - } - } - } - }, - "description": "Retrieve a session by ID.", - "summary": "Get session" - }, - "delete": { - "tags": ["session"], - "operationId": "session.remove", - "parameters": [ - { - "name": "sessionID", - "in": "path", - "schema": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "required": true - } - ], - "security": [], - "responses": { - "204": { - "description": "" - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - }, - "404": { - "description": "SessionNotFoundError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/SessionNotFoundError" - }, - { - "$ref": "#/components/schemas/SessionNotFoundError" - } - ] - } - } - } - } - }, - "description": "Delete a session and its child sessions.", - "summary": "Delete session" - } - }, - "/api/session/{sessionID}/fork": { - "post": { - "tags": ["session"], - "operationId": "session.fork", - "parameters": [ - { - "name": "sessionID", - "in": "path", - "schema": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "required": true - } - ], - "security": [], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "data": { - "$ref": "#/components/schemas/Session.Info" - } - }, - "required": ["data"], - "additionalProperties": false - } - } - } - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - }, - "404": { - "description": "SessionNotFoundError | MessageNotFoundError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/MessageNotFoundError" - }, - { - "$ref": "#/components/schemas/SessionNotFoundError" - }, - { - "$ref": "#/components/schemas/SessionNotFoundError" - } - ] - } - } - } - } - }, - "description": "Create a child session by copying projected history from the parent. When messageID is supplied, copy messages before that boundary.", - "summary": "Fork session", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "messageID": { - "anyOf": [ - { - "type": "string", - "allOf": [ - { - "pattern": "^msg_" - } - ] - }, - { - "type": "null" - } - ] - } - }, - "additionalProperties": false - } - } - }, - "required": true - } - } - }, - "/api/session/{sessionID}/agent": { - "post": { - "tags": ["session"], - "operationId": "session.switchAgent", - "parameters": [ - { - "name": "sessionID", - "in": "path", - "schema": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "required": true - } - ], - "security": [], - "responses": { - "204": { - "description": "" - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - }, - "404": { - "description": "SessionNotFoundError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/SessionNotFoundError" - }, - { - "$ref": "#/components/schemas/SessionNotFoundError" - } - ] - } - } - } - } - }, - "description": "Switch the agent used by subsequent provider turns.", - "summary": "Switch session agent", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "agent": { - "type": "string" - } - }, - "required": ["agent"], - "additionalProperties": false - } - } - }, - "required": true - } - } - }, - "/api/session/{sessionID}/model": { - "post": { - "tags": ["session"], - "operationId": "session.switchModel", - "parameters": [ - { - "name": "sessionID", - "in": "path", - "schema": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "required": true - } - ], - "security": [], - "responses": { - "204": { - "description": "" - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - }, - "404": { - "description": "SessionNotFoundError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/SessionNotFoundError" - }, - { - "$ref": "#/components/schemas/SessionNotFoundError" - } - ] - } - } - } - } - }, - "description": "Switch the model used by subsequent provider turns.", - "summary": "Switch session model", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "model": { - "$ref": "#/components/schemas/Model.Ref" - } - }, - "required": ["model"], - "additionalProperties": false - } - } - }, - "required": true - } - } - }, - "/api/session/{sessionID}/rename": { - "post": { - "tags": ["session"], - "operationId": "session.rename", - "parameters": [ - { - "name": "sessionID", - "in": "path", - "schema": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "required": true - } - ], - "security": [], - "responses": { - "204": { - "description": "" - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - }, - "404": { - "description": "SessionNotFoundError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/SessionNotFoundError" - }, - { - "$ref": "#/components/schemas/SessionNotFoundError" - } - ] - } - } - } - } - }, - "description": "Update the session title.", - "summary": "Rename session", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "title": { - "type": "string" - } - }, - "required": ["title"], - "additionalProperties": false - } - } - }, - "required": true - } - } - }, - "/api/session/{sessionID}/move": { - "post": { - "tags": ["session"], - "operationId": "session.move", - "parameters": [ - { - "name": "sessionID", - "in": "path", - "schema": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "required": true - } - ], - "security": [], - "responses": { - "204": { - "description": "" - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/InvalidRequestError1" - }, - { - "$ref": "#/components/schemas/InvalidRequestError" - } - ] - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - }, - "404": { - "description": "SessionNotFoundError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/SessionNotFoundError" - }, - { - "$ref": "#/components/schemas/SessionNotFoundError" - } - ] - } - } - } - } - }, - "description": "Move a session to another project directory, optionally transferring local changes.", - "summary": "Move session", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "destination": { - "type": "object", - "properties": { - "directory": { - "type": "string" - } - }, - "required": ["directory"], - "additionalProperties": false - }, - "moveChanges": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ] - } - }, - "required": ["destination"], - "additionalProperties": false - } - } - }, - "required": true - } - } - }, - "/api/session/{sessionID}/prompt": { - "post": { - "tags": ["session"], - "operationId": "session.prompt", - "parameters": [ - { - "name": "sessionID", - "in": "path", - "schema": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "required": true - } - ], - "security": [], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "data": { - "$ref": "#/components/schemas/SessionInput.Admitted" - } - }, - "required": ["data"], - "additionalProperties": false - } - } - } - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/InvalidRequestError1" - }, - { - "$ref": "#/components/schemas/InvalidRequestError" - } - ] - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - }, - "404": { - "description": "SessionNotFoundError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/SessionNotFoundError" - }, - { - "$ref": "#/components/schemas/SessionNotFoundError" - } - ] - } - } - } - }, - "409": { - "description": "ConflictError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ConflictError" - } - } - } - } - }, - "description": "Durably admit one session input and schedule agent-loop execution unless resume is false.", - "summary": "Send message", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "id": { - "anyOf": [ - { - "type": "string", - "allOf": [ - { - "pattern": "^msg_" - } - ] - }, - { - "type": "null" - } - ] - }, - "prompt": { - "$ref": "#/components/schemas/PromptInput" - }, - "delivery": { - "anyOf": [ - { - "type": "string", - "enum": ["steer", "queue"] - }, - { - "type": "null" - } - ] - }, - "resume": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ] - } - }, - "required": ["prompt"], - "additionalProperties": false - } - } - }, - "required": true - } - } - }, - "/api/session/{sessionID}/command": { - "post": { - "tags": ["session"], - "operationId": "session.command", - "parameters": [ - { - "name": "sessionID", - "in": "path", - "schema": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "required": true - } - ], - "security": [], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "data": { - "$ref": "#/components/schemas/SessionInput.Admitted" - } - }, - "required": ["data"], - "additionalProperties": false - } - } - } - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/InvalidRequestError1" - }, - { - "$ref": "#/components/schemas/InvalidRequestError" - } - ] - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - }, - "404": { - "description": "SessionNotFoundError | CommandNotFoundError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/CommandNotFoundError" - }, - { - "$ref": "#/components/schemas/SessionNotFoundError" - }, - { - "$ref": "#/components/schemas/SessionNotFoundError" - } - ] - } - } - } - }, - "409": { - "description": "ConflictError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ConflictError" - } - } - } - }, - "500": { - "description": "CommandEvaluationError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CommandEvaluationError" - } - } - } - } - }, - "description": "Resolve a slash command into prompt input, admit it durably, and schedule execution unless resume is false.", - "summary": "Run command", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "id": { - "anyOf": [ - { - "type": "string", - "allOf": [ - { - "pattern": "^msg_" - } - ] - }, - { - "type": "null" - } - ] - }, - "command": { - "type": "string" - }, - "arguments": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "agent": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "model": { - "anyOf": [ - { - "$ref": "#/components/schemas/Model.Ref" - }, - { - "type": "null" - } - ] - }, - "files": { - "type": "array", - "items": { - "$ref": "#/components/schemas/PromptInput.FileAttachment" - } - }, - "agents": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Prompt.AgentAttachment" - } - }, - "delivery": { - "anyOf": [ - { - "type": "string", - "enum": ["steer", "queue"] - }, - { - "type": "null" - } - ] - }, - "resume": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ] - } - }, - "required": ["command"], - "additionalProperties": false - } - } - }, - "required": true - } - } - }, - "/api/session/{sessionID}/skill": { - "post": { - "tags": ["session"], - "operationId": "session.skill", - "parameters": [ - { - "name": "sessionID", - "in": "path", - "schema": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "required": true - } - ], - "security": [], - "responses": { - "204": { - "description": "" - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - }, - "404": { - "description": "SessionNotFoundError | SkillNotFoundError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/SkillNotFoundError" - }, - { - "$ref": "#/components/schemas/SessionNotFoundError" - }, - { - "$ref": "#/components/schemas/SessionNotFoundError" - } - ] - } - } - } - } - }, - "description": "Activate a skill for a session by appending a skill message and resuming execution.", - "summary": "Activate skill", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "id": { - "anyOf": [ - { - "type": "string", - "allOf": [ - { - "pattern": "^msg_" - } - ] - }, - { - "type": "null" - } - ] - }, - "skill": { - "type": "string" - }, - "resume": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ] - } - }, - "required": ["skill"], - "additionalProperties": false - } - } - }, - "required": true - } - } - }, - "/api/session/{sessionID}/synthetic": { - "post": { - "tags": ["session"], - "operationId": "session.synthetic", - "parameters": [ - { - "name": "sessionID", - "in": "path", - "schema": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "required": true - } - ], - "security": [], - "responses": { - "204": { - "description": "" - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - }, - "404": { - "description": "SessionNotFoundError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/SessionNotFoundError" - }, - { - "$ref": "#/components/schemas/SessionNotFoundError" - } - ] - } - } - } - } - }, - "description": "Append a synthetic message to a session and resume execution.", - "summary": "Add synthetic message", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "text": { - "type": "string" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "metadata": { - "type": "object" - }, - "resume": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ] - } - }, - "required": ["text"], - "additionalProperties": false - } - } - }, - "required": true - } - } - }, - "/api/session/{sessionID}/shell": { - "post": { - "tags": ["session"], - "operationId": "session.shell", - "parameters": [ - { - "name": "sessionID", - "in": "path", - "schema": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "required": true - } - ], - "security": [], - "responses": { - "204": { - "description": "" - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - }, - "404": { - "description": "SessionNotFoundError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/SessionNotFoundError" - }, - { - "$ref": "#/components/schemas/SessionNotFoundError" - } - ] - } - } - } - } - }, - "description": "Execute one shell command in the session's working directory. Emits a shell.started event before execution and a shell.ended event with the merged output after.", - "summary": "Run shell command", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "id": { - "anyOf": [ - { - "type": "string", - "allOf": [ - { - "pattern": "^evt_" - } - ] - }, - { - "type": "null" - } - ] - }, - "command": { - "type": "string" - } - }, - "required": ["command"], - "additionalProperties": false - } - } - }, - "required": true - } - } - }, - "/api/session/{sessionID}/compact": { - "post": { - "tags": ["session"], - "operationId": "session.compact", - "parameters": [ - { - "name": "sessionID", - "in": "path", - "schema": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "required": true - } - ], - "security": [], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "data": { - "$ref": "#/components/schemas/SessionInput.Compaction" - } - }, - "required": ["data"], - "additionalProperties": false - } - } - } - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - }, - "404": { - "description": "SessionNotFoundError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/SessionNotFoundError" - }, - { - "$ref": "#/components/schemas/SessionNotFoundError" - } - ] - } - } - } - }, - "409": { - "description": "ConflictError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ConflictError" - } - } - } - } - }, - "description": "Queue a durable session compaction request.", - "summary": "Compact session", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "id": { - "anyOf": [ - { - "type": "string", - "allOf": [ - { - "pattern": "^msg_" - } - ] - }, - { - "type": "null" - } - ] - } - }, - "additionalProperties": false - } - } - }, - "required": true - } - } - }, - "/api/session/{sessionID}/wait": { - "post": { - "tags": ["session"], - "operationId": "session.wait", - "parameters": [ - { - "name": "sessionID", - "in": "path", - "schema": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "required": true - } - ], - "security": [], - "responses": { - "204": { - "description": "" - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - }, - "404": { - "description": "SessionNotFoundError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/SessionNotFoundError" - }, - { - "$ref": "#/components/schemas/SessionNotFoundError" - } - ] - } - } - } - }, - "503": { - "description": "ServiceUnavailableError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - } - } - }, - "description": "Wait for a session agent loop to become idle.", - "summary": "Wait for session" - } - }, - "/api/session/{sessionID}/revert/stage": { - "post": { - "tags": ["session"], - "operationId": "session.revert.stage", - "parameters": [ - { - "name": "sessionID", - "in": "path", - "schema": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "required": true - } - ], - "security": [], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "data": { - "$ref": "#/components/schemas/Session.Revert" - } - }, - "required": ["data"], - "additionalProperties": false - } - } - } - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - }, - "404": { - "description": "MessageNotFoundError | SessionNotFoundError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/MessageNotFoundError" - }, - { - "$ref": "#/components/schemas/SessionNotFoundError" - }, - { - "$ref": "#/components/schemas/SessionNotFoundError" - } - ] - } - } - } - }, - "409": { - "description": "SessionBusyError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SessionBusyError" - } - } - } - }, - "500": { - "description": "UnknownError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnknownError" - } - } - } - } - }, - "description": "Stage or move a reversible session boundary and optionally apply its file changes.", - "summary": "Stage session revert", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "messageID": { - "type": "string", - "allOf": [ - { - "pattern": "^msg_" - } - ] - }, - "files": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ] - } - }, - "required": ["messageID"], - "additionalProperties": false - } - } - }, - "required": true - } - } - }, - "/api/session/{sessionID}/revert/clear": { - "post": { - "tags": ["session"], - "operationId": "session.revert.clear", - "parameters": [ - { - "name": "sessionID", - "in": "path", - "schema": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "required": true - } - ], - "security": [], - "responses": { - "204": { - "description": "" - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - }, - "404": { - "description": "SessionNotFoundError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/SessionNotFoundError" - }, - { - "$ref": "#/components/schemas/SessionNotFoundError" - } - ] - } - } - } - }, - "409": { - "description": "SessionBusyError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SessionBusyError" - } - } - } - }, - "500": { - "description": "UnknownError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnknownError" - } - } - } - } - }, - "summary": "Clear staged revert" - } - }, - "/api/session/{sessionID}/revert/commit": { - "post": { - "tags": ["session"], - "operationId": "session.revert.commit", - "parameters": [ - { - "name": "sessionID", - "in": "path", - "schema": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "required": true - } - ], - "security": [], - "responses": { - "204": { - "description": "" - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - }, - "404": { - "description": "SessionNotFoundError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/SessionNotFoundError" - }, - { - "$ref": "#/components/schemas/SessionNotFoundError" - } - ] - } - } - } - }, - "409": { - "description": "SessionBusyError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SessionBusyError" - } - } - } - } - }, - "summary": "Commit staged revert" - } - }, - "/api/session/{sessionID}/context": { - "get": { - "tags": ["session"], - "operationId": "session.context", - "parameters": [ - { - "name": "sessionID", - "in": "path", - "schema": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "required": true - } - ], - "security": [], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Session.Message.Info" - } - } - }, - "required": ["data"], - "additionalProperties": false - } - } - } - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - }, - "404": { - "description": "SessionNotFoundError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/SessionNotFoundError" - }, - { - "$ref": "#/components/schemas/SessionNotFoundError" - } - ] - } - } - } - }, - "500": { - "description": "UnknownError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnknownError" - } - } - } - } - }, - "description": "Retrieve the active context messages for a session (all messages after the last compaction).", - "summary": "Get session context" - } - }, - "/api/session/{sessionID}/instructions/entries": { - "get": { - "tags": ["session"], - "operationId": "session.instructions.entry.list", - "parameters": [ - { - "name": "sessionID", - "in": "path", - "schema": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "required": true - } - ], - "security": [], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/InstructionEntry.Info" - } - } - }, - "required": ["data"], - "additionalProperties": false - } - } - } - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - }, - "404": { - "description": "SessionNotFoundError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/SessionNotFoundError" - }, - { - "$ref": "#/components/schemas/SessionNotFoundError" - } - ] - } - } - } - } - }, - "description": "List API-managed instruction entries attached to the session.", - "summary": "List instruction entries" - } - }, - "/api/session/{sessionID}/instructions/entries/{key}": { - "put": { - "tags": ["session"], - "operationId": "session.instructions.entry.put", - "parameters": [ - { - "name": "sessionID", - "in": "path", - "schema": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "required": true - }, - { - "name": "key", - "in": "path", - "schema": { - "$ref": "#/components/schemas/InstructionEntry.Key" - }, - "required": true - } - ], - "security": [], - "responses": { - "204": { - "description": "" - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - }, - "404": { - "description": "SessionNotFoundError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/SessionNotFoundError" - }, - { - "$ref": "#/components/schemas/SessionNotFoundError" - } - ] - } - } - } - } - }, - "description": "Attach or replace one durable instruction entry. Changes announce as updates at the next step boundary.", - "summary": "Put instruction entry", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "value": {} - }, - "required": ["value"], - "additionalProperties": false - } - } - }, - "required": true - } - }, - "delete": { - "tags": ["session"], - "operationId": "session.instructions.entry.remove", - "parameters": [ - { - "name": "sessionID", - "in": "path", - "schema": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "required": true - }, - { - "name": "key", - "in": "path", - "schema": { - "$ref": "#/components/schemas/InstructionEntry.Key" - }, - "required": true - } - ], - "security": [], - "responses": { - "204": { - "description": "" - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - }, - "404": { - "description": "SessionNotFoundError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/SessionNotFoundError" - }, - { - "$ref": "#/components/schemas/SessionNotFoundError" - } - ] - } - } - } - } - }, - "description": "Remove one instruction entry; the removal is announced to the model at the next step boundary.", - "summary": "Remove instruction entry" - } - }, - "/api/experimental/session/{sessionID}/log": { - "get": { - "tags": ["session"], - "operationId": "session.log", - "parameters": [ - { - "name": "sessionID", - "in": "path", - "schema": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "required": true - }, - { - "name": "after", - "in": "query", - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "required": false - }, - { - "name": "follow", - "in": "query", - "schema": { - "anyOf": [ - { - "type": "string", - "enum": ["true", "false"] - }, - { - "type": "null" - } - ] - }, - "required": false - } - ], - "security": [], - "responses": { - "200": { - "description": "Success", - "content": { - "text/event-stream": { - "schema": { - "type": "object", - "properties": { - "id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "event": { - "type": "string" - }, - "data": { - "$ref": "#/components/schemas/SessionLogItemJsonString" - } - }, - "required": ["id", "event", "data"], - "additionalProperties": false - }, - "x-effect-stream": { - "encoding": "sse", - "causeSchema": { - "type": "array", - "items": { - "anyOf": [ - { - "type": "object", - "properties": { - "_tag": { - "type": "string", - "enum": ["Fail"] - }, - "error": { - "not": {} - } - }, - "required": ["_tag", "error"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "_tag": { - "type": "string", - "enum": ["Die"] - }, - "defect": {} - }, - "required": ["_tag", "defect"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "_tag": { - "type": "string", - "enum": ["Interrupt"] - }, - "fiberId": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ] - } - }, - "required": ["_tag", "fiberId"], - "additionalProperties": false - } - ] - } - }, - "errorSchema": { - "not": {} - }, - "failureEvent": "effect/httpapi/stream/failure" - } - } - } - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - }, - "404": { - "description": "SessionNotFoundError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/SessionNotFoundError" - }, - { - "$ref": "#/components/schemas/SessionNotFoundError" - } - ] - } - } - } - } - }, - "description": "Experimental durable session event log. Reads events after an exclusive aggregate sequence and continues with live events when follow=true.", - "summary": "Read the session log" - } - }, - "/api/session/{sessionID}/interrupt": { - "post": { - "tags": ["session"], - "operationId": "session.interrupt", - "parameters": [ - { - "name": "sessionID", - "in": "path", - "schema": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "required": true - } - ], - "security": [], - "responses": { - "204": { - "description": "" - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - }, - "404": { - "description": "SessionNotFoundError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/SessionNotFoundError" - }, - { - "$ref": "#/components/schemas/SessionNotFoundError" - } - ] - } - } - } - } - }, - "description": "Interrupt active execution owned by this OpenCode process. Idle interruption is a no-op.", - "summary": "Interrupt session execution" - } - }, - "/api/session/{sessionID}/background": { - "post": { - "tags": ["session"], - "operationId": "session.background", - "parameters": [ - { - "name": "sessionID", - "in": "path", - "schema": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "required": true - } - ], - "security": [], - "responses": { - "204": { - "description": "" - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - }, - "404": { - "description": "SessionNotFoundError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/SessionNotFoundError" - }, - { - "$ref": "#/components/schemas/SessionNotFoundError" - } - ] - } - } - } - } - }, - "description": "Move active foreground backgroundable tools for this session into background observation. Idle requests are a no-op.", - "summary": "Background blocking session tools" - } - }, - "/api/session/{sessionID}/message/{messageID}": { - "get": { - "tags": ["session"], - "operationId": "session.message", - "parameters": [ - { - "name": "sessionID", - "in": "path", - "schema": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "required": true - }, - { - "name": "messageID", - "in": "path", - "schema": { - "type": "string", - "allOf": [ - { - "pattern": "^msg_" - } - ] - }, - "required": true - } - ], - "security": [], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "data": { - "$ref": "#/components/schemas/Session.Message.Info" - } - }, - "required": ["data"], - "additionalProperties": false - } - } - } - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - }, - "404": { - "description": "SessionNotFoundError | MessageNotFoundError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/MessageNotFoundError" - }, - { - "$ref": "#/components/schemas/SessionNotFoundError" - }, - { - "$ref": "#/components/schemas/SessionNotFoundError" - } - ] - } - } - } - } - }, - "description": "Retrieve one projected message owned by the Session.", - "summary": "Get session message" - } - }, - "/api/session/{sessionID}/message": { - "get": { - "tags": ["session"], - "operationId": "message.list", - "parameters": [ - { - "name": "sessionID", - "in": "path", - "schema": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "required": true - }, - { - "name": "limit", - "in": "query", - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Maximum number of messages to return. When omitted, the endpoint returns its default page size." - }, - "required": false - }, - { - "name": "order", - "in": "query", - "schema": { - "anyOf": [ - { - "type": "string", - "enum": ["asc", "desc"] - }, - { - "type": "null" - } - ], - "description": "Message order for the first page. Use desc for newest first or asc for oldest first." - }, - "required": false - }, - { - "name": "cursor", - "in": "query", - "schema": { - "anyOf": [ - { - "type": "string", - "description": "Opaque pagination cursor returned as cursor.previous or cursor.next in the previous response. Do not combine with order." - }, - { - "type": "null" - } - ] - }, - "required": false - } - ], - "security": [], - "responses": { - "200": { - "description": "SessionMessagesResponse", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SessionMessagesResponse" - } - } - } - }, - "400": { - "description": "InvalidCursorError | InvalidRequestError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/InvalidCursorError" - }, - { - "$ref": "#/components/schemas/InvalidRequestError" - } - ] - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - }, - "404": { - "description": "SessionNotFoundError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/SessionNotFoundError" - }, - { - "$ref": "#/components/schemas/SessionNotFoundError" - } - ] - } - } - } - }, - "500": { - "description": "UnknownError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnknownError" - } - } - } - } - }, - "description": "Retrieve projected messages for a session. Items keep the requested order across pages; use cursor.next or cursor.previous to move through the ordered timeline.", - "summary": "Get session messages" - } - }, - "/api/model": { - "get": { - "tags": ["model"], - "operationId": "model.list", - "parameters": [ - { - "name": "location", - "in": "query", - "schema": { - "anyOf": [ - { - "type": "object", - "properties": { - "directory": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - }, - "additionalProperties": false - }, - { - "type": "null" - } - ] - }, - "required": false, - "style": "deepObject", - "explode": true - } - ], - "security": [], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "location": { - "$ref": "#/components/schemas/Location.Info" - }, - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Model.Info" - } - } - }, - "required": ["location", "data"], - "additionalProperties": false - } - } - } - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - }, - "503": { - "description": "ServiceUnavailableError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - } - } - }, - "description": "Retrieve available models ordered by release date.", - "summary": "List models" - } - }, - "/api/model/default": { - "get": { - "tags": ["model"], - "operationId": "model.default", - "parameters": [ - { - "name": "location", - "in": "query", - "schema": { - "anyOf": [ - { - "type": "object", - "properties": { - "directory": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - }, - "additionalProperties": false - }, - { - "type": "null" - } - ] - }, - "required": false, - "style": "deepObject", - "explode": true - } - ], - "security": [], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "location": { - "$ref": "#/components/schemas/Location.Info" - }, - "data": { - "anyOf": [ - { - "$ref": "#/components/schemas/Model.Info" - }, - { - "type": "null" - } - ] - } - }, - "required": ["location", "data"], - "additionalProperties": false - } - } - } - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - }, - "503": { - "description": "ServiceUnavailableError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - } - } - }, - "description": "Retrieve the model used when a session has no explicit model selection.", - "summary": "Get default model" - } - }, - "/api/generate": { - "post": { - "tags": ["generate"], - "operationId": "generate.text", - "parameters": [ - { - "name": "location", - "in": "query", - "schema": { - "anyOf": [ - { - "type": "object", - "properties": { - "directory": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - }, - "additionalProperties": false - }, - { - "type": "null" - } - ] - }, - "required": false, - "style": "deepObject", - "explode": true - } - ], - "security": [], - "responses": { - "200": { - "description": "GenerateTextResponse", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateTextResponse" - } - } - } - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/InvalidRequestError1" - }, - { - "$ref": "#/components/schemas/InvalidRequestError" - } - ] - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - }, - "503": { - "description": "ServiceUnavailableError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - } - } - }, - "description": "Run one stateless model generation at the requested location and return the assistant text. Uses the location's default model when none is specified.", - "summary": "Generate text", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "prompt": { - "type": "string" - }, - "model": { - "anyOf": [ - { - "$ref": "#/components/schemas/Model.Ref" - }, - { - "type": "null" - } - ] - } - }, - "required": ["prompt"], - "additionalProperties": false - } - } - }, - "required": true - } - } - }, - "/api/provider": { - "get": { - "tags": ["provider"], - "operationId": "provider.list", - "parameters": [ - { - "name": "location", - "in": "query", - "schema": { - "anyOf": [ - { - "type": "object", - "properties": { - "directory": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - }, - "additionalProperties": false - }, - { - "type": "null" - } - ] - }, - "required": false, - "style": "deepObject", - "explode": true - } - ], - "security": [], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "location": { - "$ref": "#/components/schemas/Location.Info" - }, - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ProviderV2.Info" - } - } - }, - "required": ["location", "data"], - "additionalProperties": false - } - } - } - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - }, - "503": { - "description": "ServiceUnavailableError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - } - } - }, - "description": "Retrieve active AI providers so clients can show provider availability and configuration.", - "summary": "List providers" - } - }, - "/api/provider/{providerID}": { - "get": { - "tags": ["provider"], - "operationId": "provider.get", - "parameters": [ - { - "name": "providerID", - "in": "path", - "schema": { - "type": "string" - }, - "required": true - }, - { - "name": "location", - "in": "query", - "schema": { - "anyOf": [ - { - "type": "object", - "properties": { - "directory": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - }, - "additionalProperties": false - }, - { - "type": "null" - } - ] - }, - "required": false, - "style": "deepObject", - "explode": true - } - ], - "security": [], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "location": { - "$ref": "#/components/schemas/Location.Info" - }, - "data": { - "$ref": "#/components/schemas/ProviderV2.Info" - } - }, - "required": ["location", "data"], - "additionalProperties": false - } - } - } - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - }, - "404": { - "description": "ProviderNotFoundError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProviderNotFoundError" - } - } - } - }, - "503": { - "description": "ServiceUnavailableError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - } - } - }, - "description": "Retrieve a single AI provider so clients can inspect its availability and endpoint settings.", - "summary": "Get provider" - } - }, - "/api/integration": { - "get": { - "tags": ["integration"], - "operationId": "integration.list", - "parameters": [ - { - "name": "location", - "in": "query", - "schema": { - "anyOf": [ - { - "type": "object", - "properties": { - "directory": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - }, - "additionalProperties": false - }, - { - "type": "null" - } - ] - }, - "required": false, - "style": "deepObject", - "explode": true - } - ], - "security": [], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "location": { - "$ref": "#/components/schemas/Location.Info" - }, - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Integration.Info" - } - } - }, - "required": ["location", "data"], - "additionalProperties": false - } - } - } - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - } - }, - "description": "Retrieve available integrations and their authentication methods.", - "summary": "List integrations" - } - }, - "/api/integration/{integrationID}": { - "get": { - "tags": ["integration"], - "operationId": "integration.get", - "parameters": [ - { - "name": "integrationID", - "in": "path", - "schema": { - "type": "string" - }, - "required": true - }, - { - "name": "location", - "in": "query", - "schema": { - "anyOf": [ - { - "type": "object", - "properties": { - "directory": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - }, - "additionalProperties": false - }, - { - "type": "null" - } - ] - }, - "required": false, - "style": "deepObject", - "explode": true - } - ], - "security": [], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "location": { - "$ref": "#/components/schemas/Location.Info" - }, - "data": { - "anyOf": [ - { - "$ref": "#/components/schemas/Integration.Info" - }, - { - "type": "null" - } - ] - } - }, - "required": ["location", "data"], - "additionalProperties": false - } - } - } - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - } - }, - "description": "Retrieve one integration and its authentication methods.", - "summary": "Get integration" - } - }, - "/api/integration/{integrationID}/connect/key": { - "post": { - "tags": ["integration"], - "operationId": "integration.connect.key", - "parameters": [ - { - "name": "integrationID", - "in": "path", - "schema": { - "type": "string" - }, - "required": true - }, - { - "name": "location", - "in": "query", - "schema": { - "anyOf": [ - { - "type": "object", - "properties": { - "directory": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - }, - "additionalProperties": false - }, - { - "type": "null" - } - ] - }, - "required": false, - "style": "deepObject", - "explode": true - } - ], - "security": [], - "responses": { - "204": { - "description": "" - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/InvalidRequestError1" - }, - { - "$ref": "#/components/schemas/InvalidRequestError" - } - ] - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - } - }, - "description": "Run a key authentication method and store the resulting credential.", - "summary": "Connect with key", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "key": { - "type": "string" - }, - "label": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - }, - "required": ["key"], - "additionalProperties": false - } - } - }, - "required": true - } - } - }, - "/api/integration/{integrationID}/connect/oauth": { - "post": { - "tags": ["integration"], - "operationId": "integration.connect.oauth", - "parameters": [ - { - "name": "integrationID", - "in": "path", - "schema": { - "type": "string" - }, - "required": true - }, - { - "name": "location", - "in": "query", - "schema": { - "anyOf": [ - { - "type": "object", - "properties": { - "directory": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - }, - "additionalProperties": false - }, - { - "type": "null" - } - ] - }, - "required": false, - "style": "deepObject", - "explode": true - } - ], - "security": [], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "location": { - "$ref": "#/components/schemas/Location.Info" - }, - "data": { - "$ref": "#/components/schemas/Integration.Attempt" - } - }, - "required": ["location", "data"], - "additionalProperties": false - } - } - } - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/InvalidRequestError1" - }, - { - "$ref": "#/components/schemas/InvalidRequestError" - } - ] - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - } - }, - "description": "Start an OAuth attempt and return the authorization details.", - "summary": "Begin OAuth connection", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "methodID": { - "type": "string" - }, - "inputs": { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "label": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - }, - "required": ["methodID", "inputs"], - "additionalProperties": false - } - } - }, - "required": true - } - } - }, - "/api/integration/attempt/{attemptID}": { - "get": { - "tags": ["integration"], - "operationId": "integration.attempt.status", - "parameters": [ - { - "name": "attemptID", - "in": "path", - "schema": { - "type": "string" - }, - "required": true - }, - { - "name": "location", - "in": "query", - "schema": { - "anyOf": [ - { - "type": "object", - "properties": { - "directory": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - }, - "additionalProperties": false - }, - { - "type": "null" - } - ] - }, - "required": false, - "style": "deepObject", - "explode": true - } - ], - "security": [], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "location": { - "$ref": "#/components/schemas/Location.Info" - }, - "data": { - "$ref": "#/components/schemas/Integration.AttemptStatus" - } - }, - "required": ["location", "data"], - "additionalProperties": false - } - } - } - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - } - }, - "description": "Poll the current status of an OAuth attempt.", - "summary": "Get OAuth attempt status" - }, - "delete": { - "tags": ["integration"], - "operationId": "integration.attempt.cancel", - "parameters": [ - { - "name": "attemptID", - "in": "path", - "schema": { - "type": "string" - }, - "required": true - }, - { - "name": "location", - "in": "query", - "schema": { - "anyOf": [ - { - "type": "object", - "properties": { - "directory": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - }, - "additionalProperties": false - }, - { - "type": "null" - } - ] - }, - "required": false, - "style": "deepObject", - "explode": true - } - ], - "security": [], - "responses": { - "204": { - "description": "" - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - } - }, - "description": "Cancel an OAuth attempt and release its resources.", - "summary": "Cancel OAuth connection" - } - }, - "/api/integration/attempt/{attemptID}/complete": { - "post": { - "tags": ["integration"], - "operationId": "integration.attempt.complete", - "parameters": [ - { - "name": "attemptID", - "in": "path", - "schema": { - "type": "string" - }, - "required": true - }, - { - "name": "location", - "in": "query", - "schema": { - "anyOf": [ - { - "type": "object", - "properties": { - "directory": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - }, - "additionalProperties": false - }, - { - "type": "null" - } - ] - }, - "required": false, - "style": "deepObject", - "explode": true - } - ], - "security": [], - "responses": { - "204": { - "description": "" - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/InvalidRequestError1" - }, - { - "$ref": "#/components/schemas/InvalidRequestError" - } - ] - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - } - }, - "description": "Complete a code-based OAuth attempt and store the resulting credential.", - "summary": "Complete OAuth connection", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - }, - "additionalProperties": false - } - } - }, - "required": true - } - } - }, - "/api/mcp": { - "get": { - "tags": ["mcp"], - "operationId": "mcp.list", - "parameters": [ - { - "name": "location", - "in": "query", - "schema": { - "anyOf": [ - { - "type": "object", - "properties": { - "directory": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - }, - "additionalProperties": false - }, - { - "type": "null" - } - ] - }, - "required": false, - "style": "deepObject", - "explode": true - } - ], - "security": [], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "location": { - "$ref": "#/components/schemas/Location.Info" - }, - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Mcp.Server" - } - } - }, - "required": ["location", "data"], - "additionalProperties": false - } - } - } - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - } - }, - "description": "Retrieve configured MCP servers and their connection status.", - "summary": "List MCP servers" - } - }, - "/api/mcp/resource": { - "get": { - "tags": ["mcp"], - "operationId": "mcp.resource.catalog", - "parameters": [ - { - "name": "location", - "in": "query", - "schema": { - "anyOf": [ - { - "type": "object", - "properties": { - "directory": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - }, - "additionalProperties": false - }, - { - "type": "null" - } - ] - }, - "required": false, - "style": "deepObject", - "explode": true - } - ], - "security": [], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "location": { - "$ref": "#/components/schemas/Location.Info" - }, - "data": { - "$ref": "#/components/schemas/Mcp.ResourceCatalog" - } - }, - "required": ["location", "data"], - "additionalProperties": false - } - } - } - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - } - }, - "description": "Retrieve resources and resource templates from connected MCP servers.", - "summary": "List MCP resources" - } - }, - "/api/credential/{credentialID}": { - "patch": { - "tags": ["credential"], - "operationId": "credential.update", - "parameters": [ - { - "name": "credentialID", - "in": "path", - "schema": { - "type": "string" - }, - "required": true - }, - { - "name": "location", - "in": "query", - "schema": { - "anyOf": [ - { - "type": "object", - "properties": { - "directory": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - }, - "additionalProperties": false - }, - { - "type": "null" - } - ] - }, - "required": false, - "style": "deepObject", - "explode": true - } - ], - "security": [], - "responses": { - "204": { - "description": "" - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - } - }, - "description": "Update a stored credential label.", - "summary": "Update credential", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "label": { - "type": "string" - } - }, - "required": ["label"], - "additionalProperties": false - } - } - }, - "required": true - } - }, - "delete": { - "tags": ["credential"], - "operationId": "credential.remove", - "parameters": [ - { - "name": "credentialID", - "in": "path", - "schema": { - "type": "string" - }, - "required": true - }, - { - "name": "location", - "in": "query", - "schema": { - "anyOf": [ - { - "type": "object", - "properties": { - "directory": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - }, - "additionalProperties": false - }, - { - "type": "null" - } - ] - }, - "required": false, - "style": "deepObject", - "explode": true - } - ], - "security": [], - "responses": { - "204": { - "description": "" - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - } - }, - "description": "Remove a stored integration credential.", - "summary": "Remove credential" - } - }, - "/api/project": { - "get": { - "tags": ["project"], - "operationId": "project.list", - "parameters": [], - "security": [], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Project" - } - } - } - } - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - } - }, - "description": "List known projects.", - "summary": "List projects" - } - }, - "/api/project/{projectID}/directories": { - "get": { - "tags": ["project"], - "operationId": "project.directories", - "parameters": [ - { - "name": "projectID", - "in": "path", - "schema": { - "type": "string" - }, - "required": true - }, - { - "name": "location", - "in": "query", - "schema": { - "anyOf": [ - { - "type": "object", - "properties": { - "directory": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - }, - "additionalProperties": false - }, - { - "type": "null" - } - ] - }, - "required": false, - "style": "deepObject", - "explode": true - } - ], - "security": [], - "responses": { - "200": { - "description": "Project.Directories", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Project.Directories" - } - } - } - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - } - }, - "description": "List known local absolute directories for a project.", - "summary": "List project directories" - } - }, - "/api/form/request": { - "get": { - "tags": ["form"], - "operationId": "form.request.list", - "parameters": [ - { - "name": "location", - "in": "query", - "schema": { - "anyOf": [ - { - "type": "object", - "properties": { - "directory": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - }, - "additionalProperties": false - }, - { - "type": "null" - } - ] - }, - "required": false, - "style": "deepObject", - "explode": true - } - ], - "security": [], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "location": { - "$ref": "#/components/schemas/Location.Info" - }, - "data": { - "type": "array", - "items": { - "anyOf": [ - { - "$ref": "#/components/schemas/Form.FormInfo" - }, - { - "$ref": "#/components/schemas/Form.UrlInfo" - } - ] - } - } - }, - "required": ["location", "data"], - "additionalProperties": false - } - } - } - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - } - }, - "description": "Retrieve pending forms for a location.", - "summary": "List pending form requests" - } - }, - "/api/session/{sessionID}/form": { - "get": { - "tags": ["form"], - "operationId": "session.form.list", - "parameters": [ - { - "name": "sessionID", - "in": "path", - "schema": { - "type": "string" - }, - "required": true - } - ], - "security": [], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "anyOf": [ - { - "$ref": "#/components/schemas/Form.FormInfo" - }, - { - "$ref": "#/components/schemas/Form.UrlInfo" - } - ] - } - } - }, - "required": ["data"], - "additionalProperties": false - } - } - } - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - }, - "404": { - "description": "SessionNotFoundError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/SessionNotFoundError" - }, - { - "$ref": "#/components/schemas/SessionNotFoundError" - } - ] - } - } - } - } - }, - "description": "Retrieve pending forms for a session.", - "summary": "List session forms" - }, - "post": { - "tags": ["form"], - "operationId": "session.form.create", - "parameters": [ - { - "name": "sessionID", - "in": "path", - "schema": { - "type": "string" - }, - "required": true - } - ], - "security": [], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "data": { - "anyOf": [ - { - "$ref": "#/components/schemas/Form.FormInfo" - }, - { - "$ref": "#/components/schemas/Form.UrlInfo" - } - ] - } - }, - "required": ["data"], - "additionalProperties": false - } - } - } - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/InvalidRequestError1" - }, - { - "$ref": "#/components/schemas/InvalidRequestError" - } - ] - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - }, - "404": { - "description": "SessionNotFoundError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/SessionNotFoundError" - }, - { - "$ref": "#/components/schemas/SessionNotFoundError" - } - ] - } - } - } - }, - "409": { - "description": "ConflictError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ConflictError" - } - } - } - } - }, - "description": "Create a form for a session.", - "summary": "Create session form", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Form.CreatePayload" - } - } - }, - "required": true - } - } - }, - "/api/session/{sessionID}/form/{formID}": { - "get": { - "tags": ["form"], - "operationId": "session.form.get", - "parameters": [ - { - "name": "sessionID", - "in": "path", - "schema": { - "type": "string" - }, - "required": true - }, - { - "name": "formID", - "in": "path", - "schema": { - "type": "string", - "allOf": [ - { - "pattern": "^frm_" - } - ] - }, - "required": true - } - ], - "security": [], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "data": { - "anyOf": [ - { - "$ref": "#/components/schemas/Form.FormInfo" - }, - { - "$ref": "#/components/schemas/Form.UrlInfo" - } - ] - } - }, - "required": ["data"], - "additionalProperties": false - } - } - } - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - }, - "404": { - "description": "SessionNotFoundError | FormNotFoundError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/FormNotFoundError" - }, - { - "$ref": "#/components/schemas/SessionNotFoundError" - }, - { - "$ref": "#/components/schemas/SessionNotFoundError" - } - ] - } - } - } - } - }, - "description": "Retrieve a form for a session.", - "summary": "Get session form" - } - }, - "/api/session/{sessionID}/form/{formID}/state": { - "get": { - "tags": ["form"], - "operationId": "session.form.state", - "parameters": [ - { - "name": "sessionID", - "in": "path", - "schema": { - "type": "string" - }, - "required": true - }, - { - "name": "formID", - "in": "path", - "schema": { - "type": "string", - "allOf": [ - { - "pattern": "^frm_" - } - ] - }, - "required": true - } - ], - "security": [], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "data": { - "$ref": "#/components/schemas/Form.State" - } - }, - "required": ["data"], - "additionalProperties": false - } - } - } - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - }, - "404": { - "description": "SessionNotFoundError | FormNotFoundError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/FormNotFoundError" - }, - { - "$ref": "#/components/schemas/SessionNotFoundError" - }, - { - "$ref": "#/components/schemas/SessionNotFoundError" - } - ] - } - } - } - } - }, - "description": "Retrieve the current state for a form.", - "summary": "Get form state" - } - }, - "/api/session/{sessionID}/form/{formID}/reply": { - "post": { - "tags": ["form"], - "operationId": "session.form.reply", - "parameters": [ - { - "name": "sessionID", - "in": "path", - "schema": { - "type": "string" - }, - "required": true - }, - { - "name": "formID", - "in": "path", - "schema": { - "type": "string", - "allOf": [ - { - "pattern": "^frm_" - } - ] - }, - "required": true - } - ], - "security": [], - "responses": { - "204": { - "description": "" - }, - "400": { - "description": "FormInvalidAnswerError | InvalidRequestError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/FormInvalidAnswerError" - }, - { - "$ref": "#/components/schemas/InvalidRequestError" - } - ] - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - }, - "404": { - "description": "SessionNotFoundError | FormNotFoundError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/FormNotFoundError" - }, - { - "$ref": "#/components/schemas/SessionNotFoundError" - }, - { - "$ref": "#/components/schemas/SessionNotFoundError" - } - ] - } - } - } - }, - "409": { - "description": "FormAlreadySettledError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/FormAlreadySettledError" - } - } - } - } - }, - "description": "Submit an answer to a pending form.", - "summary": "Reply to form", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Form.Reply" - } - } - }, - "required": true - } - } - }, - "/api/session/{sessionID}/form/{formID}/cancel": { - "post": { - "tags": ["form"], - "operationId": "session.form.cancel", - "parameters": [ - { - "name": "sessionID", - "in": "path", - "schema": { - "type": "string" - }, - "required": true - }, - { - "name": "formID", - "in": "path", - "schema": { - "type": "string", - "allOf": [ - { - "pattern": "^frm_" - } - ] - }, - "required": true - } - ], - "security": [], - "responses": { - "204": { - "description": "" - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - }, - "404": { - "description": "SessionNotFoundError | FormNotFoundError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/FormNotFoundError" - }, - { - "$ref": "#/components/schemas/SessionNotFoundError" - }, - { - "$ref": "#/components/schemas/SessionNotFoundError" - } - ] - } - } - } - }, - "409": { - "description": "FormAlreadySettledError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/FormAlreadySettledError" - } - } - } - } - }, - "description": "Cancel a pending form.", - "summary": "Cancel form" - } - }, - "/api/permission/request": { - "get": { - "tags": ["permission"], - "operationId": "permission.request.list", - "parameters": [ - { - "name": "location", - "in": "query", - "schema": { - "anyOf": [ - { - "type": "object", - "properties": { - "directory": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - }, - "additionalProperties": false - }, - { - "type": "null" - } - ] - }, - "required": false, - "style": "deepObject", - "explode": true - } - ], - "security": [], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "location": { - "$ref": "#/components/schemas/Location.Info" - }, - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/PermissionV2.Request" - } - } - }, - "required": ["location", "data"], - "additionalProperties": false - } - } - } - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - } - }, - "description": "Retrieve pending permission requests for a location.", - "summary": "List pending permission requests" - } - }, - "/api/permission/saved": { - "get": { - "tags": ["permission"], - "operationId": "permission.saved.list", - "parameters": [ - { - "name": "projectID", - "in": "query", - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "required": false - } - ], - "security": [], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/PermissionSaved.Info" - } - } - }, - "required": ["data"], - "additionalProperties": false - } - } - } - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - } - }, - "description": "Retrieve saved permissions, optionally filtered by project.", - "summary": "List saved permissions" - } - }, - "/api/permission/saved/{id}": { - "delete": { - "tags": ["permission"], - "operationId": "permission.saved.remove", - "parameters": [ - { - "name": "id", - "in": "path", - "schema": { - "type": "string" - }, - "required": true - } - ], - "security": [], - "responses": { - "204": { - "description": "" - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - } - }, - "description": "Remove a saved permission by ID.", - "summary": "Remove saved permission" - } - }, - "/api/session/{sessionID}/permission": { - "post": { - "tags": ["permission"], - "operationId": "session.permission.create", - "parameters": [ - { - "name": "sessionID", - "in": "path", - "schema": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "required": true - } - ], - "security": [], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^per" - } - ] - }, - "effect": { - "$ref": "#/components/schemas/PermissionV2.Effect" - } - }, - "required": ["id", "effect"], - "additionalProperties": false - } - }, - "required": ["data"], - "additionalProperties": false - } - } - } - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - }, - "404": { - "description": "SessionNotFoundError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/SessionNotFoundError" - }, - { - "$ref": "#/components/schemas/SessionNotFoundError" - } - ] - } - } - } - } - }, - "description": "Evaluate and, when approval is required, create a permission request for a session.", - "summary": "Create permission request", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "id": { - "anyOf": [ - { - "type": "string", - "allOf": [ - { - "pattern": "^per" - } - ] - }, - { - "type": "null" - } - ] - }, - "action": { - "type": "string" - }, - "resources": { - "type": "array", - "items": { - "type": "string" - } - }, - "save": { - "type": "array", - "items": { - "type": "string" - } - }, - "metadata": { - "type": "object" - }, - "source": { - "$ref": "#/components/schemas/PermissionV2.Source" - }, - "agent": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - }, - "required": ["action", "resources"], - "additionalProperties": false - } - } - }, - "required": true - } - }, - "get": { - "tags": ["permission"], - "operationId": "session.permission.list", - "parameters": [ - { - "name": "sessionID", - "in": "path", - "schema": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "required": true - } - ], - "security": [], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/PermissionV2.Request" - } - } - }, - "required": ["data"], - "additionalProperties": false - } - } - } - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - }, - "404": { - "description": "SessionNotFoundError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/SessionNotFoundError" - }, - { - "$ref": "#/components/schemas/SessionNotFoundError" - } - ] - } - } - } - } - }, - "description": "Retrieve pending permission requests owned by a session.", - "summary": "List session permission requests" - } - }, - "/api/session/{sessionID}/permission/{requestID}": { - "get": { - "tags": ["permission"], - "operationId": "session.permission.get", - "parameters": [ - { - "name": "sessionID", - "in": "path", - "schema": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "required": true - }, - { - "name": "requestID", - "in": "path", - "schema": { - "type": "string", - "allOf": [ - { - "pattern": "^per" - } - ] - }, - "required": true - } - ], - "security": [], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "data": { - "$ref": "#/components/schemas/PermissionV2.Request" - } - }, - "required": ["data"], - "additionalProperties": false - } - } - } - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - }, - "404": { - "description": "SessionNotFoundError | PermissionNotFoundError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/PermissionNotFoundError" - }, - { - "$ref": "#/components/schemas/SessionNotFoundError" - }, - { - "$ref": "#/components/schemas/SessionNotFoundError" - } - ] - } - } - } - } - }, - "description": "Retrieve a pending permission request owned by a session.", - "summary": "Get permission request" - } - }, - "/api/session/{sessionID}/permission/{requestID}/reply": { - "post": { - "tags": ["permission"], - "operationId": "session.permission.reply", - "parameters": [ - { - "name": "sessionID", - "in": "path", - "schema": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "required": true - }, - { - "name": "requestID", - "in": "path", - "schema": { - "type": "string", - "allOf": [ - { - "pattern": "^per" - } - ] - }, - "required": true - } - ], - "security": [], - "responses": { - "204": { - "description": "" - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - }, - "404": { - "description": "SessionNotFoundError | PermissionNotFoundError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/PermissionNotFoundError" - }, - { - "$ref": "#/components/schemas/SessionNotFoundError" - }, - { - "$ref": "#/components/schemas/SessionNotFoundError" - } - ] - } - } - } - } - }, - "description": "Respond to a pending permission request owned by a session.", - "summary": "Reply to pending permission request", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "reply": { - "$ref": "#/components/schemas/PermissionV2.Reply" - }, - "message": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - }, - "required": ["reply"], - "additionalProperties": false - } - } - }, - "required": true - } - } - }, - "/api/fs/read/*": { - "get": { - "tags": ["filesystem"], - "operationId": "fs.read", - "parameters": [ - { - "name": "location", - "in": "query", - "schema": { - "anyOf": [ - { - "type": "object", - "properties": { - "directory": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - }, - "additionalProperties": false - }, - { - "type": "null" - } - ] - }, - "required": false, - "style": "deepObject", - "explode": true - } - ], - "security": [], - "responses": { - "200": { - "description": "Success", - "content": { - "application/octet-stream": { - "schema": { - "type": "string", - "format": "binary" - } - } - } - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - } - }, - "description": "Serve one file relative to the requested location.", - "summary": "Read file" - } - }, - "/api/fs/list": { - "get": { - "tags": ["filesystem"], - "operationId": "fs.list", - "parameters": [ - { - "name": "location", - "in": "query", - "schema": { - "anyOf": [ - { - "type": "object", - "properties": { - "directory": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - }, - "additionalProperties": false - }, - { - "type": "null" - } - ] - }, - "required": false, - "style": "deepObject", - "explode": true - }, - { - "name": "path", - "in": "query", - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "required": false - } - ], - "security": [], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "location": { - "$ref": "#/components/schemas/Location.Info" - }, - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/FileSystem.Entry" - } - } - }, - "required": ["location", "data"], - "additionalProperties": false - } - } - } - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - } - }, - "description": "List direct children of one directory relative to the requested location.", - "summary": "List directory" - } - }, - "/api/fs/find": { - "get": { - "tags": ["filesystem"], - "operationId": "fs.find", - "parameters": [ - { - "name": "location", - "in": "query", - "schema": { - "anyOf": [ - { - "type": "object", - "properties": { - "directory": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - }, - "additionalProperties": false - }, - { - "type": "null" - } - ] - }, - "required": false, - "style": "deepObject", - "explode": true - }, - { - "name": "query", - "in": "query", - "schema": { - "type": "string" - }, - "required": true - }, - { - "name": "type", - "in": "query", - "schema": { - "type": "string", - "enum": ["file", "directory"] - }, - "required": false - }, - { - "name": "limit", - "in": "query", - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "required": false - } - ], - "security": [], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "location": { - "$ref": "#/components/schemas/Location.Info" - }, - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/FileSystem.Entry" - } - } - }, - "required": ["location", "data"], - "additionalProperties": false - } - } - } - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - } - }, - "description": "Find recursively ranked filesystem entries relative to the requested location.", - "summary": "Find files" - } - }, - "/api/command": { - "get": { - "tags": ["command"], - "operationId": "command.list", - "parameters": [ - { - "name": "location", - "in": "query", - "schema": { - "anyOf": [ - { - "type": "object", - "properties": { - "directory": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - }, - "additionalProperties": false - }, - { - "type": "null" - } - ] - }, - "required": false, - "style": "deepObject", - "explode": true - } - ], - "security": [], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "location": { - "$ref": "#/components/schemas/Location.Info" - }, - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Command.Info" - } - } - }, - "required": ["location", "data"], - "additionalProperties": false - } - } - } - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - } - }, - "description": "Retrieve currently registered commands.", - "summary": "List commands" - } - }, - "/api/skill": { - "get": { - "tags": ["skill"], - "operationId": "skill.list", - "parameters": [ - { - "name": "location", - "in": "query", - "schema": { - "anyOf": [ - { - "type": "object", - "properties": { - "directory": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - }, - "additionalProperties": false - }, - { - "type": "null" - } - ] - }, - "required": false, - "style": "deepObject", - "explode": true - } - ], - "security": [], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "location": { - "$ref": "#/components/schemas/Location.Info" - }, - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Skill.Info" - } - } - }, - "required": ["location", "data"], - "additionalProperties": false - } - } - } - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - } - }, - "description": "Retrieve currently registered skills.", - "summary": "List skills" - } - }, - "/api/event": { - "get": { - "tags": ["event"], - "operationId": "event.subscribe", - "parameters": [], - "security": [], - "responses": { - "200": { - "description": "Success", - "content": { - "text/event-stream": { - "schema": { - "type": "object", - "properties": { - "id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "event": { - "type": "string" - }, - "data": { - "$ref": "#/components/schemas/V2EventJsonString" - } - }, - "required": ["id", "event", "data"], - "additionalProperties": false - }, - "x-effect-stream": { - "encoding": "sse", - "causeSchema": { - "type": "array", - "items": { - "anyOf": [ - { - "type": "object", - "properties": { - "_tag": { - "type": "string", - "enum": ["Fail"] - }, - "error": { - "not": {} - } - }, - "required": ["_tag", "error"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "_tag": { - "type": "string", - "enum": ["Die"] - }, - "defect": {} - }, - "required": ["_tag", "defect"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "_tag": { - "type": "string", - "enum": ["Interrupt"] - }, - "fiberId": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ] - } - }, - "required": ["_tag", "fiberId"], - "additionalProperties": false - } - ] - } - }, - "errorSchema": { - "not": {} - }, - "failureEvent": "effect/httpapi/stream/failure" - } - } - } - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - } - }, - "description": "Subscribe to native event payloads for the server. Volatile by contract: a slow consumer overflows and fails the stream, and events during disconnection are missed.", - "summary": "Subscribe to events" - } - }, - "/api/pty": { - "get": { - "tags": ["pty"], - "operationId": "pty.list", - "parameters": [ - { - "name": "location", - "in": "query", - "schema": { - "anyOf": [ - { - "type": "object", - "properties": { - "directory": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - }, - "additionalProperties": false - }, - { - "type": "null" - } - ] - }, - "required": false, - "style": "deepObject", - "explode": true - } - ], - "security": [], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "location": { - "$ref": "#/components/schemas/Location.Info" - }, - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Pty" - } - } - }, - "required": ["location", "data"], - "additionalProperties": false - } - } - } - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - } - }, - "description": "List PTY sessions for a location, including exited sessions retained until removal.", - "summary": "List PTY sessions" - }, - "post": { - "tags": ["pty"], - "operationId": "pty.create", - "parameters": [ - { - "name": "location", - "in": "query", - "schema": { - "anyOf": [ - { - "type": "object", - "properties": { - "directory": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - }, - "additionalProperties": false - }, - { - "type": "null" - } - ] - }, - "required": false, - "style": "deepObject", - "explode": true - } - ], - "security": [], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "location": { - "$ref": "#/components/schemas/Location.Info" - }, - "data": { - "$ref": "#/components/schemas/Pty" - } - }, - "required": ["location", "data"], - "additionalProperties": false - } - } - } - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - } - }, - "description": "Create a pseudo-terminal session for a location.", - "summary": "Create PTY session", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "command": { - "type": "string" - }, - "args": { - "type": "array", - "items": { - "type": "string" - } - }, - "cwd": { - "type": "string" - }, - "title": { - "type": "string" - }, - "env": { - "type": "object", - "additionalProperties": { - "type": "string" - } - } - }, - "additionalProperties": false - } - } - }, - "required": true - } - } - }, - "/api/pty/{ptyID}": { - "get": { - "tags": ["pty"], - "operationId": "pty.get", - "parameters": [ - { - "name": "ptyID", - "in": "path", - "schema": { - "type": "string", - "allOf": [ - { - "pattern": "^pty" - } - ] - }, - "required": true - }, - { - "name": "location", - "in": "query", - "schema": { - "anyOf": [ - { - "type": "object", - "properties": { - "directory": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - }, - "additionalProperties": false - }, - { - "type": "null" - } - ] - }, - "required": false, - "style": "deepObject", - "explode": true - } - ], - "security": [], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "location": { - "$ref": "#/components/schemas/Location.Info" - }, - "data": { - "$ref": "#/components/schemas/Pty" - } - }, - "required": ["location", "data"], - "additionalProperties": false - } - } - } - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - }, - "404": { - "description": "PtyNotFoundError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PtyNotFoundError" - } - } - } - } - }, - "description": "Get one PTY session, including its exit code once exited.", - "summary": "Get PTY session" - }, - "put": { - "tags": ["pty"], - "operationId": "pty.update", - "parameters": [ - { - "name": "ptyID", - "in": "path", - "schema": { - "type": "string", - "allOf": [ - { - "pattern": "^pty" - } - ] - }, - "required": true - }, - { - "name": "location", - "in": "query", - "schema": { - "anyOf": [ - { - "type": "object", - "properties": { - "directory": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - }, - "additionalProperties": false - }, - { - "type": "null" - } - ] - }, - "required": false, - "style": "deepObject", - "explode": true - } - ], - "security": [], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "location": { - "$ref": "#/components/schemas/Location.Info" - }, - "data": { - "$ref": "#/components/schemas/Pty" - } - }, - "required": ["location", "data"], - "additionalProperties": false - } - } - } - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - }, - "404": { - "description": "PtyNotFoundError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PtyNotFoundError" - } - } - } - } - }, - "description": "Update the title or viewport size of one PTY session.", - "summary": "Update PTY session", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "title": { - "type": "string" - }, - "size": { - "type": "object", - "properties": { - "rows": { - "type": "integer", - "allOf": [ - { - "exclusiveMinimum": 0 - } - ] - }, - "cols": { - "type": "integer", - "allOf": [ - { - "exclusiveMinimum": 0 - } - ] - } - }, - "required": ["rows", "cols"], - "additionalProperties": false - } - }, - "additionalProperties": false - } - } - }, - "required": true - } - }, - "delete": { - "tags": ["pty"], - "operationId": "pty.remove", - "parameters": [ - { - "name": "ptyID", - "in": "path", - "schema": { - "type": "string", - "allOf": [ - { - "pattern": "^pty" - } - ] - }, - "required": true - }, - { - "name": "location", - "in": "query", - "schema": { - "anyOf": [ - { - "type": "object", - "properties": { - "directory": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - }, - "additionalProperties": false - }, - { - "type": "null" - } - ] - }, - "required": false, - "style": "deepObject", - "explode": true - } - ], - "security": [], - "responses": { - "204": { - "description": "" - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - }, - "404": { - "description": "PtyNotFoundError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PtyNotFoundError" - } - } - } - } - }, - "description": "Terminate and remove one PTY session.", - "summary": "Remove PTY session" - } - }, - "/api/pty/{ptyID}/connect-token": { - "post": { - "tags": ["pty"], - "operationId": "pty.connect.token", - "parameters": [ - { - "name": "ptyID", - "in": "path", - "schema": { - "type": "string", - "allOf": [ - { - "pattern": "^pty" - } - ] - }, - "required": true - }, - { - "name": "location", - "in": "query", - "schema": { - "anyOf": [ - { - "type": "object", - "properties": { - "directory": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - }, - "additionalProperties": false - }, - { - "type": "null" - } - ] - }, - "required": false, - "style": "deepObject", - "explode": true - } - ], - "security": [], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "location": { - "$ref": "#/components/schemas/Location.Info" - }, - "data": { - "$ref": "#/components/schemas/PtyTicket.ConnectToken" - } - }, - "required": ["location", "data"], - "additionalProperties": false - } - } - } - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - }, - "403": { - "description": "ForbiddenError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ForbiddenError" - } - } - } - }, - "404": { - "description": "PtyNotFoundError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PtyNotFoundError" - } - } - } - } - }, - "description": "Create a short-lived single-use ticket for opening a PTY WebSocket connection.", - "summary": "Create PTY WebSocket token" - } - }, - "/api/pty/{ptyID}/connect": { - "get": { - "tags": ["pty"], - "operationId": "pty.connect", - "parameters": [ - { - "name": "ptyID", - "in": "path", - "schema": { - "type": "string", - "allOf": [ - { - "pattern": "^pty" - } - ] - }, - "required": true - }, - { - "in": "query", - "name": "location[directory]", - "schema": { - "type": "string" - } - }, - { - "in": "query", - "name": "location[workspace]", - "schema": { - "type": "string" - } - }, - { - "in": "query", - "name": "cursor", - "schema": { - "type": "string" - } - }, - { - "in": "query", - "name": "ticket", - "schema": { - "type": "string" - } - } - ], - "security": [], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "boolean" - } - } - } - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - }, - "403": { - "description": "ForbiddenError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ForbiddenError" - } - } - } - }, - "404": { - "description": "PtyNotFoundError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PtyNotFoundError" - } - } - } - } - }, - "description": "Establish a WebSocket connection streaming PTY output and accepting terminal input.", - "summary": "Connect to PTY session", - "x-websocket": true - } - }, - "/api/shell": { - "get": { - "tags": ["shell"], - "operationId": "shell.list", - "parameters": [ - { - "name": "location", - "in": "query", - "schema": { - "anyOf": [ - { - "type": "object", - "properties": { - "directory": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - }, - "additionalProperties": false - }, - { - "type": "null" - } - ] - }, - "required": false, - "style": "deepObject", - "explode": true - } - ], - "security": [], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "location": { - "$ref": "#/components/schemas/Location.Info" - }, - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Shell1" - } - } - }, - "required": ["location", "data"], - "additionalProperties": false - } - } - } - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - } - }, - "description": "List currently running shell commands for a location. Exited commands are not included.", - "summary": "List running shell commands" - }, - "post": { - "tags": ["shell"], - "operationId": "shell.create", - "parameters": [ - { - "name": "location", - "in": "query", - "schema": { - "anyOf": [ - { - "type": "object", - "properties": { - "directory": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - }, - "additionalProperties": false - }, - { - "type": "null" - } - ] - }, - "required": false, - "style": "deepObject", - "explode": true - } - ], - "security": [], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "location": { - "$ref": "#/components/schemas/Location.Info" - }, - "data": { - "$ref": "#/components/schemas/Shell1" - } - }, - "required": ["location", "data"], - "additionalProperties": false - } - } - } - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - } - }, - "description": "Spawn one non-interactive shell command for a location. Combined stdout/stderr is captured to a file pageable via output.", - "summary": "Run shell command", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "command": { - "type": "string" - }, - "cwd": { - "type": "string" - }, - "timeout": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - "metadata": { - "type": "object" - } - }, - "required": ["command", "timeout"], - "additionalProperties": false - } - } - }, - "required": true - } - } - }, - "/api/shell/{id}": { - "get": { - "tags": ["shell"], - "operationId": "shell.get", - "parameters": [ - { - "name": "id", - "in": "path", - "schema": { - "type": "string", - "allOf": [ - { - "pattern": "^sh_" - } - ] - }, - "required": true - }, - { - "name": "location", - "in": "query", - "schema": { - "anyOf": [ - { - "type": "object", - "properties": { - "directory": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - }, - "additionalProperties": false - }, - { - "type": "null" - } - ] - }, - "required": false, - "style": "deepObject", - "explode": true - } - ], - "security": [], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "location": { - "$ref": "#/components/schemas/Location.Info" - }, - "data": { - "$ref": "#/components/schemas/Shell1" - } - }, - "required": ["location", "data"], - "additionalProperties": false - } - } - } - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - }, - "404": { - "description": "ShellNotFoundError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ShellNotFoundError" - } - } - } - } - }, - "description": "Get one shell command, including its status and exit code once exited.", - "summary": "Get shell command" - }, - "delete": { - "tags": ["shell"], - "operationId": "shell.remove", - "parameters": [ - { - "name": "id", - "in": "path", - "schema": { - "type": "string", - "allOf": [ - { - "pattern": "^sh_" - } - ] - }, - "required": true - }, - { - "name": "location", - "in": "query", - "schema": { - "anyOf": [ - { - "type": "object", - "properties": { - "directory": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - }, - "additionalProperties": false - }, - { - "type": "null" - } - ] - }, - "required": false, - "style": "deepObject", - "explode": true - } - ], - "security": [], - "responses": { - "204": { - "description": "" - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - }, - "404": { - "description": "ShellNotFoundError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ShellNotFoundError" - } - } - } - } - }, - "description": "Terminate and remove one shell command and its retained output.", - "summary": "Remove shell command" - } - }, - "/api/shell/{id}/timeout": { - "patch": { - "tags": ["shell"], - "operationId": "shell.timeout", - "parameters": [ - { - "name": "id", - "in": "path", - "schema": { - "type": "string", - "allOf": [ - { - "pattern": "^sh_" - } - ] - }, - "required": true - }, - { - "name": "location", - "in": "query", - "schema": { - "anyOf": [ - { - "type": "object", - "properties": { - "directory": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - }, - "additionalProperties": false - }, - { - "type": "null" - } - ] - }, - "required": false, - "style": "deepObject", - "explode": true - } - ], - "security": [], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "location": { - "$ref": "#/components/schemas/Location.Info" - }, - "data": { - "$ref": "#/components/schemas/Shell1" - } - }, - "required": ["location", "data"], - "additionalProperties": false - } - } - } - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - }, - "404": { - "description": "ShellNotFoundError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ShellNotFoundError" - } - } - } - } - }, - "description": "Replace a running shell command's timeout from now, or clear it with zero.", - "summary": "Update shell timeout", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "timeout": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - } - }, - "required": ["timeout"], - "additionalProperties": false - } - } - }, - "required": true - } - } - }, - "/api/shell/{id}/output": { - "get": { - "tags": ["shell"], - "operationId": "shell.output", - "parameters": [ - { - "name": "id", - "in": "path", - "schema": { - "type": "string", - "allOf": [ - { - "pattern": "^sh_" - } - ] - }, - "required": true - }, - { - "name": "location", - "in": "query", - "schema": { - "anyOf": [ - { - "type": "object", - "properties": { - "directory": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - }, - "additionalProperties": false - }, - { - "type": "null" - } - ] - }, - "required": false, - "style": "deepObject", - "explode": true - }, - { - "name": "cursor", - "in": "query", - "schema": { - "type": "string", - "allOf": [ - { - "pattern": "^[+-]?\\d*\\.?\\d+(?:[Ee][+-]?\\d+)?$" - } - ] - }, - "required": false - }, - { - "name": "limit", - "in": "query", - "schema": { - "type": "string", - "allOf": [ - { - "pattern": "^[+-]?\\d*\\.?\\d+(?:[Ee][+-]?\\d+)?$" - } - ] - }, - "required": false - } - ], - "security": [], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "location": { - "$ref": "#/components/schemas/Location.Info" - }, - "data": { - "type": "object", - "properties": { - "output": { - "type": "string" - }, - "cursor": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - "size": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - "truncated": { - "type": "boolean" - } - }, - "required": ["output", "cursor", "size", "truncated"], - "additionalProperties": false - } - }, - "required": ["location", "data"], - "additionalProperties": false - } - } - } - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - }, - "404": { - "description": "ShellNotFoundError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ShellNotFoundError" - } - } - } - } - }, - "description": "Page through captured combined output by absolute byte cursor.", - "summary": "Read shell output" - } - }, - "/api/question/request": { - "get": { - "tags": ["question"], - "operationId": "question.request.list", - "parameters": [ - { - "name": "location", - "in": "query", - "schema": { - "anyOf": [ - { - "type": "object", - "properties": { - "directory": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - }, - "additionalProperties": false - }, - { - "type": "null" - } - ] - }, - "required": false, - "style": "deepObject", - "explode": true - } - ], - "security": [], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "location": { - "$ref": "#/components/schemas/Location.Info" - }, - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/QuestionV2.Request" - } - } - }, - "required": ["location", "data"], - "additionalProperties": false - } - } - } - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - } - }, - "description": "Retrieve pending question requests for a location.", - "summary": "List pending question requests" - } - }, - "/api/session/{sessionID}/question": { - "get": { - "tags": ["question"], - "operationId": "session.question.list", - "parameters": [ - { - "name": "sessionID", - "in": "path", - "schema": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "required": true - } - ], - "security": [], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/QuestionV2.Request" - } - } - }, - "required": ["data"], - "additionalProperties": false - } - } - } - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - }, - "404": { - "description": "SessionNotFoundError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/SessionNotFoundError" - }, - { - "$ref": "#/components/schemas/SessionNotFoundError" - } - ] - } - } - } - } - }, - "description": "Retrieve pending question requests owned by a session.", - "summary": "List session question requests" - } - }, - "/api/session/{sessionID}/question/{requestID}/reply": { - "post": { - "tags": ["question"], - "operationId": "session.question.reply", - "parameters": [ - { - "name": "sessionID", - "in": "path", - "schema": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "required": true - }, - { - "name": "requestID", - "in": "path", - "schema": { - "type": "string", - "allOf": [ - { - "pattern": "^que" - } - ] - }, - "required": true - } - ], - "security": [], - "responses": { - "204": { - "description": "" - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - }, - "404": { - "description": "SessionNotFoundError | QuestionNotFoundError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/QuestionNotFoundError" - }, - { - "$ref": "#/components/schemas/SessionNotFoundError" - }, - { - "$ref": "#/components/schemas/SessionNotFoundError" - } - ] - } - } - } - } - }, - "description": "Answer a pending question request owned by a session.", - "summary": "Reply to pending question request", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/QuestionV2.Reply" - } - } - }, - "required": true - } - } - }, - "/api/session/{sessionID}/question/{requestID}/reject": { - "post": { - "tags": ["question"], - "operationId": "session.question.reject", - "parameters": [ - { - "name": "sessionID", - "in": "path", - "schema": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "required": true - }, - { - "name": "requestID", - "in": "path", - "schema": { - "type": "string", - "allOf": [ - { - "pattern": "^que" - } - ] - }, - "required": true - } - ], - "security": [], - "responses": { - "204": { - "description": "" - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - }, - "404": { - "description": "SessionNotFoundError | QuestionNotFoundError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/QuestionNotFoundError" - }, - { - "$ref": "#/components/schemas/SessionNotFoundError" - }, - { - "$ref": "#/components/schemas/SessionNotFoundError" - } - ] - } - } - } - } - }, - "description": "Reject a pending question request owned by a session.", - "summary": "Reject pending question request" - } - }, - "/api/reference": { - "get": { - "tags": ["reference"], - "operationId": "reference.list", - "parameters": [ - { - "name": "location", - "in": "query", - "schema": { - "anyOf": [ - { - "type": "object", - "properties": { - "directory": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - }, - "additionalProperties": false - }, - { - "type": "null" - } - ] - }, - "required": false, - "style": "deepObject", - "explode": true - } - ], - "security": [], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "location": { - "$ref": "#/components/schemas/Location.Info" - }, - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Reference.Info" - } - } - }, - "required": ["location", "data"], - "additionalProperties": false - } - } - } - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - } - }, - "description": "List references available in the requested location.", - "summary": "List references" - } - }, - "/api/experimental/project/{projectID}/copy": { - "post": { - "tags": ["projectCopy"], - "operationId": "projectCopy.create", - "parameters": [ - { - "name": "projectID", - "in": "path", - "schema": { - "type": "string" - }, - "required": true - }, - { - "name": "location", - "in": "query", - "schema": { - "anyOf": [ - { - "type": "object", - "properties": { - "directory": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - }, - "additionalProperties": false - }, - { - "type": "null" - } - ] - }, - "required": false, - "style": "deepObject", - "explode": true - } - ], - "security": [], - "responses": { - "200": { - "description": "ProjectCopy.Copy", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProjectCopy.Copy" - } - } - } - }, - "400": { - "description": "ProjectCopyError | InvalidRequestError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/ProjectCopyError" - }, - { - "$ref": "#/components/schemas/InvalidRequestError" - } - ] - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - } - }, - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "strategy": { - "type": "string" - }, - "directory": { - "type": "string" - }, - "name": { - "type": "string" - } - }, - "required": ["strategy", "directory"], - "additionalProperties": false - } - } - }, - "required": true - } - }, - "delete": { - "tags": ["projectCopy"], - "operationId": "projectCopy.remove", - "parameters": [ - { - "name": "projectID", - "in": "path", - "schema": { - "type": "string" - }, - "required": true - }, - { - "name": "location", - "in": "query", - "schema": { - "anyOf": [ - { - "type": "object", - "properties": { - "directory": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - }, - "additionalProperties": false - }, - { - "type": "null" - } - ] - }, - "required": false, - "style": "deepObject", - "explode": true - } - ], - "security": [], - "responses": { - "204": { - "description": "" - }, - "400": { - "description": "ProjectCopyError | InvalidRequestError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/ProjectCopyError" - }, - { - "$ref": "#/components/schemas/InvalidRequestError" - } - ] - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - } - }, - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "directory": { - "type": "string" - }, - "force": { - "type": "boolean" - } - }, - "required": ["directory", "force"], - "additionalProperties": false - } - } - }, - "required": true - } - } - }, - "/api/experimental/project/{projectID}/copy/refresh": { - "post": { - "tags": ["projectCopy"], - "operationId": "projectCopy.refresh", - "parameters": [ - { - "name": "projectID", - "in": "path", - "schema": { - "type": "string" - }, - "required": true - }, - { - "name": "location", - "in": "query", - "schema": { - "anyOf": [ - { - "type": "object", - "properties": { - "directory": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - }, - "additionalProperties": false - }, - { - "type": "null" - } - ] - }, - "required": false, - "style": "deepObject", - "explode": true - } - ], - "security": [], - "responses": { - "204": { - "description": "" - }, - "400": { - "description": "ProjectCopyError | InvalidRequestError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/ProjectCopyError" - }, - { - "$ref": "#/components/schemas/InvalidRequestError" - } - ] - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - } - } - } - }, - "/api/vcs/status": { - "get": { - "tags": ["vcs"], - "operationId": "vcs.status", - "parameters": [ - { - "name": "location", - "in": "query", - "schema": { - "anyOf": [ - { - "type": "object", - "properties": { - "directory": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - }, - "additionalProperties": false - }, - { - "type": "null" - } - ] - }, - "required": false, - "style": "deepObject", - "explode": true - } - ], - "security": [], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "location": { - "$ref": "#/components/schemas/Location.Info" - }, - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Vcs.FileStatus" - } - } - }, - "required": ["location", "data"], - "additionalProperties": false - } - } - } - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - } - }, - "description": "List uncommitted working-copy changes relative to the requested location.", - "summary": "VCS status" - } - }, - "/api/vcs/diff": { - "get": { - "tags": ["vcs"], - "operationId": "vcs.diff", - "parameters": [ - { - "name": "location", - "in": "query", - "schema": { - "anyOf": [ - { - "type": "object", - "properties": { - "directory": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - }, - "additionalProperties": false - }, - { - "type": "null" - } - ] - }, - "required": false, - "style": "deepObject", - "explode": true - }, - { - "name": "mode", - "in": "query", - "schema": { - "$ref": "#/components/schemas/Vcs.Mode" - }, - "required": true - }, - { - "name": "context", - "in": "query", - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "required": false - } - ], - "security": [], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "location": { - "$ref": "#/components/schemas/Location.Info" - }, - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/FileDiff.Info" - } - } - }, - "required": ["location", "data"], - "additionalProperties": false - } - } - } - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - } - }, - "description": "Diff the working copy against HEAD (mode git) or the default-branch merge base (mode branch) for the requested location.", - "summary": "VCS diff" - } - }, - "/api/debug/location": { - "get": { - "tags": ["debug"], - "operationId": "debug.location.list", - "parameters": [], - "security": [], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Location.Ref" - } - } - } - } - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - } - }, - "description": "List locations currently loaded by the server.", - "summary": "List loaded locations" - }, - "delete": { - "tags": ["debug"], - "operationId": "debug.location.evict", - "parameters": [ - { - "name": "location", - "in": "query", - "schema": { - "anyOf": [ - { - "type": "object", - "properties": { - "directory": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - }, - "additionalProperties": false - }, - { - "type": "null" - } - ] - }, - "required": false, - "style": "deepObject", - "explode": true - } - ], - "security": [], - "responses": { - "204": { - "description": "" - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - } - }, - "description": "Dispose the requested location's cached services so its next use boots them fresh.", - "summary": "Evict a loaded location" - } - } - }, - "components": { - "schemas": { - "UnauthorizedError": { - "type": "object", - "properties": { - "_tag": { - "type": "string", - "enum": ["UnauthorizedError"] - }, - "message": { - "type": "string" - } - }, - "required": ["_tag", "message"], - "additionalProperties": false - }, - "InvalidRequestError": { - "type": "object", - "properties": { - "_tag": { - "type": "string", - "enum": ["InvalidRequestError"] - }, - "message": { - "type": "string" - }, - "kind": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "field": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - }, - "required": ["_tag", "message"], - "additionalProperties": false - }, - "Location.Info": { - "type": "object", - "properties": { - "directory": { - "type": "string" - }, - "workspaceID": { - "type": "string", - "allOf": [ - { - "pattern": "^wrk" - } - ] - }, - "project": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "directory": { - "type": "string" - } - }, - "required": ["id", "directory"], - "additionalProperties": false - } - }, - "required": ["directory", "project"], - "additionalProperties": false - }, - "Model.Ref": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "providerID": { - "type": "string" - }, - "variant": { - "type": "string" - } - }, - "required": ["id", "providerID"], - "additionalProperties": false - }, - "Provider.Settings": { - "type": "object" - }, - "Provider.Request": { - "type": "object", - "properties": { - "settings": { - "$ref": "#/components/schemas/Provider.Settings" - }, - "headers": { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "body": { - "type": "object" - } - }, - "required": ["settings", "headers", "body"], - "additionalProperties": false - }, - "Agent.Color": { - "type": "string", - "allOf": [ - { - "pattern": "^#[0-9a-fA-F]{6}$" - } - ] - }, - "PermissionV2.Effect": { - "type": "string", - "enum": ["allow", "deny", "ask"] - }, - "PermissionV2.Rule": { - "type": "object", - "properties": { - "action": { - "type": "string" - }, - "resource": { - "type": "string" - }, - "effect": { - "$ref": "#/components/schemas/PermissionV2.Effect" - } - }, - "required": ["action", "resource", "effect"], - "additionalProperties": false - }, - "PermissionV2.Ruleset": { - "type": "array", - "items": { - "$ref": "#/components/schemas/PermissionV2.Rule" - } - }, - "Agent.Info": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "model": { - "$ref": "#/components/schemas/Model.Ref" - }, - "request": { - "$ref": "#/components/schemas/Provider.Request" - }, - "system": { - "type": "string" - }, - "description": { - "type": "string" - }, - "mode": { - "type": "string", - "enum": ["subagent", "primary", "all"] - }, - "hidden": { - "type": "boolean" - }, - "color": { - "$ref": "#/components/schemas/Agent.Color" - }, - "steps": { - "type": "integer", - "allOf": [ - { - "exclusiveMinimum": 0 - } - ] - }, - "permissions": { - "$ref": "#/components/schemas/PermissionV2.Ruleset" - } - }, - "required": ["id", "name", "request", "mode", "hidden", "permissions"], - "additionalProperties": false - }, - "Plugin.Info": { - "type": "object", - "properties": { - "id": { - "type": "string" - } - }, - "required": ["id"], - "additionalProperties": false - }, - "Money.USD": { - "type": "number" - }, - "TokenUsage.Info": { - "type": "object", - "properties": { - "input": { - "type": "number" - }, - "output": { - "type": "number" - }, - "reasoning": { - "type": "number" - }, - "cache": { - "type": "object", - "properties": { - "read": { - "type": "number" - }, - "write": { - "type": "number" - } - }, - "required": ["read", "write"], - "additionalProperties": false - } - }, - "required": ["input", "output", "reasoning", "cache"], - "additionalProperties": false - }, - "Location.Ref": { - "type": "object", - "properties": { - "directory": { - "type": "string" - }, - "workspaceID": { - "type": "string", - "allOf": [ - { - "pattern": "^wrk" - } - ] - } - }, - "required": ["directory"], - "additionalProperties": false - }, - "FileDiff.Info": { - "type": "object", - "properties": { - "file": { - "type": "string" - }, - "patch": { - "type": "string" - }, - "additions": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - "deletions": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - "status": { - "type": "string", - "enum": ["added", "deleted", "modified"] - } - }, - "required": ["file", "patch", "additions", "deletions", "status"], - "additionalProperties": false - }, - "Session.Revert": { - "type": "object", - "properties": { - "messageID": { - "type": "string", - "allOf": [ - { - "pattern": "^msg_" - } - ] - }, - "partID": { - "type": "string" - }, - "snapshot": { - "type": "string" - }, - "files": { - "type": "array", - "items": { - "$ref": "#/components/schemas/FileDiff.Info" - } - } - }, - "required": ["messageID"], - "additionalProperties": false - }, - "Session.Info": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "parentID": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "fork": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "messageID": { - "type": "string", - "allOf": [ - { - "pattern": "^msg_" - } - ] - } - }, - "required": ["sessionID"], - "additionalProperties": false - }, - "projectID": { - "type": "string" - }, - "agent": { - "type": "string" - }, - "model": { - "$ref": "#/components/schemas/Model.Ref" - }, - "cost": { - "$ref": "#/components/schemas/Money.USD" - }, - "tokens": { - "$ref": "#/components/schemas/TokenUsage.Info" - }, - "time": { - "type": "object", - "properties": { - "created": { - "type": "number" - }, - "updated": { - "type": "number" - }, - "archived": { - "type": "number" - } - }, - "required": ["created", "updated"], - "additionalProperties": false - }, - "title": { - "type": "string" - }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, - "subpath": { - "type": "string" - }, - "revert": { - "$ref": "#/components/schemas/Session.Revert" - } - }, - "required": ["id", "projectID", "cost", "tokens", "time", "title", "location"], - "additionalProperties": false - }, - "SessionsResponse": { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Session.Info" - } - }, - "cursor": { - "type": "object", - "properties": { - "previous": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "next": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - }, - "additionalProperties": false - } - }, - "required": ["data", "cursor"], - "additionalProperties": false - }, - "InvalidCursorError": { - "type": "object", - "properties": { - "_tag": { - "type": "string", - "enum": ["InvalidCursorError"] - }, - "message": { - "type": "string" - } - }, - "required": ["_tag", "message"], - "additionalProperties": false - }, - "InvalidRequestError1": { - "type": "object", - "properties": { - "_tag": { - "type": "string", - "enum": ["InvalidRequestError"] - }, - "message": { - "type": "string" - }, - "kind": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "field": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - }, - "required": ["_tag", "message"], - "additionalProperties": false - }, - "SessionActive": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["running"] - } - }, - "required": ["type"], - "additionalProperties": false - }, - "SessionNotFoundError": { - "type": "object", - "properties": { - "_tag": { - "type": "string", - "enum": ["SessionNotFoundError"] - }, - "sessionID": { - "type": "string" - }, - "message": { - "type": "string" - } - }, - "required": ["_tag", "sessionID", "message"], - "additionalProperties": false - }, - "MessageNotFoundError": { - "type": "object", - "properties": { - "_tag": { - "type": "string", - "enum": ["MessageNotFoundError"] - }, - "sessionID": { - "type": "string" - }, - "messageID": { - "type": "string" - }, - "message": { - "type": "string" - } - }, - "required": ["_tag", "sessionID", "messageID", "message"], - "additionalProperties": false - }, - "Prompt.Mention": { - "type": "object", - "properties": { - "start": { - "type": "number" - }, - "end": { - "type": "number" - }, - "text": { - "type": "string" - } - }, - "required": ["start", "end", "text"], - "additionalProperties": false - }, - "PromptInput.FileAttachment": { - "type": "object", - "properties": { - "uri": { - "type": "string" - }, - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "mention": { - "$ref": "#/components/schemas/Prompt.Mention" - } - }, - "required": ["uri"], - "additionalProperties": false - }, - "Prompt.AgentAttachment": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "mention": { - "$ref": "#/components/schemas/Prompt.Mention" - } - }, - "required": ["name"], - "additionalProperties": false - }, - "PromptInput": { - "type": "object", - "properties": { - "text": { - "type": "string" - }, - "files": { - "type": "array", - "items": { - "$ref": "#/components/schemas/PromptInput.FileAttachment" - } - }, - "agents": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Prompt.AgentAttachment" - } - } - }, - "required": ["text"], - "additionalProperties": false - }, - "Prompt.Base64": { - "type": "string", - "allOf": [ - { - "pattern": "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" - } - ] - }, - "Prompt.FileSource": { - "anyOf": [ - { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["inline"] - } - }, - "required": ["type"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["uri"] - }, - "uri": { - "type": "string" - } - }, - "required": ["type", "uri"], - "additionalProperties": false - } - ] - }, - "Prompt.FileAttachment": { - "type": "object", - "properties": { - "data": { - "$ref": "#/components/schemas/Prompt.Base64" - }, - "mime": { - "type": "string" - }, - "source": { - "$ref": "#/components/schemas/Prompt.FileSource" - }, - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "mention": { - "$ref": "#/components/schemas/Prompt.Mention" - } - }, - "required": ["data", "mime", "source"], - "additionalProperties": false - }, - "Prompt": { - "type": "object", - "properties": { - "text": { - "type": "string" - }, - "files": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Prompt.FileAttachment" - } - }, - "agents": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Prompt.AgentAttachment" - } - } - }, - "required": ["text"], - "additionalProperties": false - }, - "SessionInput.Admitted": { - "type": "object", - "properties": { - "admittedSeq": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^msg_" - } - ] - }, - "sessionID": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "prompt": { - "$ref": "#/components/schemas/Prompt" - }, - "delivery": { - "type": "string", - "enum": ["steer", "queue"] - }, - "timeCreated": { - "type": "number" - }, - "promotedSeq": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - } - }, - "required": ["admittedSeq", "id", "sessionID", "prompt", "delivery", "timeCreated"], - "additionalProperties": false - }, - "ConflictError": { - "type": "object", - "properties": { - "_tag": { - "type": "string", - "enum": ["ConflictError"] - }, - "message": { - "type": "string" - }, - "resource": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - }, - "required": ["_tag", "message"], - "additionalProperties": false - }, - "CommandNotFoundError": { - "type": "object", - "properties": { - "_tag": { - "type": "string", - "enum": ["CommandNotFoundError"] - }, - "command": { - "type": "string" - }, - "message": { - "type": "string" - } - }, - "required": ["_tag", "command", "message"], - "additionalProperties": false - }, - "CommandEvaluationError": { - "type": "object", - "properties": { - "_tag": { - "type": "string", - "enum": ["CommandEvaluationError"] - }, - "command": { - "type": "string" - }, - "message": { - "type": "string" - } - }, - "required": ["_tag", "command", "message"], - "additionalProperties": false - }, - "SkillNotFoundError": { - "type": "object", - "properties": { - "_tag": { - "type": "string", - "enum": ["SkillNotFoundError"] - }, - "skill": { - "type": "string" - }, - "message": { - "type": "string" - } - }, - "required": ["_tag", "skill", "message"], - "additionalProperties": false - }, - "SessionInput.Compaction": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["compaction"] - }, - "admittedSeq": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^msg_" - } - ] - }, - "sessionID": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "timeCreated": { - "type": "number" - }, - "handledSeq": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - } - }, - "required": ["type", "admittedSeq", "id", "sessionID", "timeCreated"], - "additionalProperties": false - }, - "ServiceUnavailableError": { - "type": "object", - "properties": { - "_tag": { - "type": "string", - "enum": ["ServiceUnavailableError"] - }, - "message": { - "type": "string" - }, - "service": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - }, - "required": ["_tag", "message"], - "additionalProperties": false - }, - "SessionBusyError": { - "type": "object", - "properties": { - "_tag": { - "type": "string", - "enum": ["SessionBusyError"] - }, - "sessionID": { - "type": "string" - }, - "message": { - "type": "string" - } - }, - "required": ["_tag", "sessionID", "message"], - "additionalProperties": false - }, - "UnknownError": { - "type": "object", - "properties": { - "_tag": { - "type": "string", - "enum": ["UnknownError"] - }, - "message": { - "type": "string" - }, - "ref": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - }, - "required": ["_tag", "message"], - "additionalProperties": false - }, - "Session.Message.AgentSelected": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^msg_" - } - ] - }, - "metadata": { - "type": "object" - }, - "time": { - "type": "object", - "properties": { - "created": { - "type": "number" - } - }, - "required": ["created"], - "additionalProperties": false - }, - "type": { - "type": "string", - "enum": ["agent-switched"] - }, - "agent": { - "type": "string" - } - }, - "required": ["id", "time", "type", "agent"], - "additionalProperties": false - }, - "Session.Message.ModelSelected": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^msg_" - } - ] - }, - "metadata": { - "type": "object" - }, - "time": { - "type": "object", - "properties": { - "created": { - "type": "number" - } - }, - "required": ["created"], - "additionalProperties": false - }, - "type": { - "type": "string", - "enum": ["model-switched"] - }, - "model": { - "$ref": "#/components/schemas/Model.Ref" - }, - "previous": { - "$ref": "#/components/schemas/Model.Ref" - } - }, - "required": ["id", "time", "type", "model"], - "additionalProperties": false - }, - "Session.Message.User": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^msg_" - } - ] - }, - "metadata": { - "type": "object" - }, - "time": { - "type": "object", - "properties": { - "created": { - "type": "number" - } - }, - "required": ["created"], - "additionalProperties": false - }, - "text": { - "type": "string" - }, - "files": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Prompt.FileAttachment" - } - }, - "agents": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Prompt.AgentAttachment" - } - }, - "type": { - "type": "string", - "enum": ["user"] - } - }, - "required": ["id", "time", "text", "type"], - "additionalProperties": false - }, - "Session.Message.Synthetic": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^msg_" - } - ] - }, - "metadata": { - "type": "object" - }, - "time": { - "type": "object", - "properties": { - "created": { - "type": "number" - } - }, - "required": ["created"], - "additionalProperties": false - }, - "text": { - "type": "string" - }, - "description": { - "type": "string" - }, - "type": { - "type": "string", - "enum": ["synthetic"] - } - }, - "required": ["id", "time", "text", "type"], - "additionalProperties": false - }, - "Session.Message.System": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^msg_" - } - ] - }, - "metadata": { - "type": "object" - }, - "time": { - "type": "object", - "properties": { - "created": { - "type": "number" - } - }, - "required": ["created"], - "additionalProperties": false - }, - "type": { - "type": "string", - "enum": ["system"] - }, - "text": { - "type": "string" - } - }, - "required": ["id", "time", "type", "text"], - "additionalProperties": false - }, - "Session.Message.Skill": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^msg_" - } - ] - }, - "metadata": { - "type": "object" - }, - "time": { - "type": "object", - "properties": { - "created": { - "type": "number" - } - }, - "required": ["created"], - "additionalProperties": false - }, - "type": { - "type": "string", - "enum": ["skill"] - }, - "skill": { - "type": "string" - }, - "name": { - "type": "string" - }, - "text": { - "type": "string" - } - }, - "required": ["id", "time", "type", "skill", "name", "text"], - "additionalProperties": false - }, - "Session.Message.Shell": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^msg_" - } - ] - }, - "metadata": { - "type": "object" - }, - "time": { - "type": "object", - "properties": { - "created": { - "type": "number" - }, - "completed": { - "type": "number" - } - }, - "required": ["created"], - "additionalProperties": false - }, - "type": { - "type": "string", - "enum": ["shell"] - }, - "shellID": { - "type": "string", - "allOf": [ - { - "pattern": "^sh_" - } - ] - }, - "command": { - "type": "string" - }, - "status": { - "type": "string", - "enum": ["running", "exited", "timeout", "killed"] - }, - "exit": { - "anyOf": [ - { - "anyOf": [ - { - "type": "number" - }, - { - "type": "string", - "enum": ["NaN"] - }, - { - "type": "string", - "enum": ["Infinity"] - }, - { - "type": "string", - "enum": ["-Infinity"] - } - ] - }, - { - "type": "string", - "enum": ["Infinity", "-Infinity", "NaN"] - } - ] - }, - "output": { - "type": "object", - "properties": { - "output": { - "type": "string" - }, - "cursor": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - "size": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - "truncated": { - "type": "boolean" - } - }, - "required": ["output", "cursor", "size", "truncated"], - "additionalProperties": false - } - }, - "required": ["id", "time", "type", "shellID", "command", "status"], - "additionalProperties": false - }, - "Session.Message.Assistant.Text": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["text"] - }, - "text": { - "type": "string" - } - }, - "required": ["type", "text"], - "additionalProperties": false - }, - "Session.Message.ProviderState": { - "type": "object" - }, - "Session.Message.Assistant.Reasoning": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["reasoning"] - }, - "text": { - "type": "string" - }, - "state": { - "$ref": "#/components/schemas/Session.Message.ProviderState" - }, - "time": { - "type": "object", - "properties": { - "created": { - "type": "number" - }, - "completed": { - "type": "number" - } - }, - "required": ["created"], - "additionalProperties": false - } - }, - "required": ["type", "text"], - "additionalProperties": false - }, - "Session.Message.ToolState.Streaming": { - "type": "object", - "properties": { - "status": { - "type": "string", - "enum": ["streaming"] - }, - "input": { - "type": "string" - } - }, - "required": ["status", "input"], - "additionalProperties": false - }, - "Tool.TextContent": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["text"] - }, - "text": { - "type": "string" - } - }, - "required": ["type", "text"], - "additionalProperties": false - }, - "Tool.FileContent": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["file"] - }, - "uri": { - "type": "string" - }, - "mime": { - "type": "string" - }, - "name": { - "type": "string" - } - }, - "required": ["type", "uri", "mime"], - "additionalProperties": false - }, - "LLM.ToolContent": { - "anyOf": [ - { - "$ref": "#/components/schemas/Tool.TextContent" - }, - { - "$ref": "#/components/schemas/Tool.FileContent" - } - ] - }, - "Session.Message.ToolState.Running": { - "type": "object", - "properties": { - "status": { - "type": "string", - "enum": ["running"] - }, - "input": { - "type": "object" - }, - "structured": { - "type": "object" - }, - "content": { - "type": "array", - "items": { - "$ref": "#/components/schemas/LLM.ToolContent" - } - } - }, - "required": ["status", "input", "structured", "content"], - "additionalProperties": false - }, - "Session.Message.ToolState.Completed": { - "type": "object", - "properties": { - "status": { - "type": "string", - "enum": ["completed"] - }, - "input": { - "type": "object" - }, - "content": { - "type": "array", - "items": { - "$ref": "#/components/schemas/LLM.ToolContent" - } - }, - "structured": { - "type": "object" - }, - "result": {} - }, - "required": ["status", "input", "content", "structured"], - "additionalProperties": false - }, - "Session.StructuredError": { - "type": "object", - "properties": { - "type": { - "type": "string" - }, - "message": { - "type": "string" - } - }, - "required": ["type", "message"], - "additionalProperties": false - }, - "Session.Message.ToolState.Error": { - "type": "object", - "properties": { - "status": { - "type": "string", - "enum": ["error"] - }, - "input": { - "type": "object" - }, - "content": { - "type": "array", - "items": { - "$ref": "#/components/schemas/LLM.ToolContent" - } - }, - "structured": { - "type": "object" - }, - "error": { - "$ref": "#/components/schemas/Session.StructuredError" - }, - "result": {} - }, - "required": ["status", "input", "content", "structured", "error"], - "additionalProperties": false - }, - "Session.Message.Assistant.Tool": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["tool"] - }, - "id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "executed": { - "type": "boolean" - }, - "providerState": { - "$ref": "#/components/schemas/Session.Message.ProviderState" - }, - "providerResultState": { - "$ref": "#/components/schemas/Session.Message.ProviderState" - }, - "state": { - "anyOf": [ - { - "$ref": "#/components/schemas/Session.Message.ToolState.Streaming" - }, - { - "$ref": "#/components/schemas/Session.Message.ToolState.Running" - }, - { - "$ref": "#/components/schemas/Session.Message.ToolState.Completed" - }, - { - "$ref": "#/components/schemas/Session.Message.ToolState.Error" - } - ] - }, - "time": { - "type": "object", - "properties": { - "created": { - "type": "number" - }, - "ran": { - "type": "number" - }, - "completed": { - "type": "number" - } - }, - "required": ["created"], - "additionalProperties": false - } - }, - "required": ["type", "id", "name", "state", "time"], - "additionalProperties": false - }, - "Session.Message.Assistant.Retry": { - "type": "object", - "properties": { - "attempt": { - "type": "integer", - "allOf": [ - { - "exclusiveMinimum": 0 - } - ] - }, - "at": { - "type": "number" - }, - "error": { - "$ref": "#/components/schemas/Session.StructuredError" - } - }, - "required": ["attempt", "at", "error"], - "additionalProperties": false - }, - "Session.Message.Assistant": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^msg_" - } - ] - }, - "metadata": { - "type": "object" - }, - "time": { - "type": "object", - "properties": { - "created": { - "type": "number" - }, - "completed": { - "type": "number" - } - }, - "required": ["created"], - "additionalProperties": false - }, - "type": { - "type": "string", - "enum": ["assistant"] - }, - "agent": { - "type": "string" - }, - "model": { - "$ref": "#/components/schemas/Model.Ref" - }, - "content": { - "type": "array", - "items": { - "anyOf": [ - { - "$ref": "#/components/schemas/Session.Message.Assistant.Text" - }, - { - "$ref": "#/components/schemas/Session.Message.Assistant.Reasoning" - }, - { - "$ref": "#/components/schemas/Session.Message.Assistant.Tool" - } - ] - } - }, - "snapshot": { - "type": "object", - "properties": { - "start": { - "type": "string" - }, - "end": { - "type": "string" - }, - "files": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "additionalProperties": false - }, - "finish": { - "type": "string", - "enum": ["stop", "length", "tool-calls", "content-filter", "error", "unknown"] - }, - "cost": { - "$ref": "#/components/schemas/Money.USD" - }, - "tokens": { - "$ref": "#/components/schemas/TokenUsage.Info" - }, - "error": { - "$ref": "#/components/schemas/Session.StructuredError" - }, - "retry": { - "$ref": "#/components/schemas/Session.Message.Assistant.Retry" - } - }, - "required": ["id", "time", "type", "agent", "model", "content"], - "additionalProperties": false - }, - "Session.Message.Compaction.Running": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["compaction"] - }, - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^msg_" - } - ] - }, - "metadata": { - "type": "object" - }, - "time": { - "type": "object", - "properties": { - "created": { - "type": "number" - } - }, - "required": ["created"], - "additionalProperties": false - }, - "status": { - "type": "string", - "enum": ["running"] - }, - "reason": { - "type": "string", - "enum": ["auto", "manual"] - }, - "summary": { - "type": "string" - }, - "recent": { - "type": "string" - } - }, - "required": ["type", "id", "time", "status", "reason", "summary", "recent"], - "additionalProperties": false - }, - "Session.Message.Compaction.Completed": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["compaction"] - }, - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^msg_" - } - ] - }, - "metadata": { - "type": "object" - }, - "time": { - "type": "object", - "properties": { - "created": { - "type": "number" - } - }, - "required": ["created"], - "additionalProperties": false - }, - "status": { - "type": "string", - "enum": ["completed"] - }, - "reason": { - "type": "string", - "enum": ["auto", "manual"] - }, - "summary": { - "type": "string" - }, - "recent": { - "type": "string" - } - }, - "required": ["type", "id", "time", "status", "reason", "summary", "recent"], - "additionalProperties": false - }, - "Session.Message.Compaction.Failed": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["compaction"] - }, - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^msg_" - } - ] - }, - "metadata": { - "type": "object" - }, - "time": { - "type": "object", - "properties": { - "created": { - "type": "number" - } - }, - "required": ["created"], - "additionalProperties": false - }, - "status": { - "type": "string", - "enum": ["failed"] - }, - "reason": { - "type": "string", - "enum": ["auto", "manual"] - }, - "error": { - "$ref": "#/components/schemas/Session.StructuredError" - } - }, - "required": ["type", "id", "time", "status", "reason", "error"], - "additionalProperties": false - }, - "Session.Message.Compaction": { - "anyOf": [ - { - "$ref": "#/components/schemas/Session.Message.Compaction.Running" - }, - { - "$ref": "#/components/schemas/Session.Message.Compaction.Completed" - }, - { - "$ref": "#/components/schemas/Session.Message.Compaction.Failed" - } - ] - }, - "Session.Message.Info": { - "anyOf": [ - { - "$ref": "#/components/schemas/Session.Message.AgentSelected" - }, - { - "$ref": "#/components/schemas/Session.Message.ModelSelected" - }, - { - "$ref": "#/components/schemas/Session.Message.User" - }, - { - "$ref": "#/components/schemas/Session.Message.Synthetic" - }, - { - "$ref": "#/components/schemas/Session.Message.System" - }, - { - "$ref": "#/components/schemas/Session.Message.Skill" - }, - { - "$ref": "#/components/schemas/Session.Message.Shell" - }, - { - "$ref": "#/components/schemas/Session.Message.Assistant" - }, - { - "$ref": "#/components/schemas/Session.Message.Compaction" - } - ] - }, - "InstructionEntry.Key": { - "type": "string", - "allOf": [ - { - "pattern": "^[a-z0-9][a-z0-9._-]*$", - "description": "Instruction entry key (lowercase alphanumerics plus . _ -)" - } - ] - }, - "InstructionEntry.Info": { - "type": "object", - "properties": { - "key": { - "$ref": "#/components/schemas/InstructionEntry.Key" - }, - "value": {} - }, - "required": ["key", "value"], - "additionalProperties": false - }, - "session.agent.selected": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^evt_" - } - ] - }, - "created": { - "type": "number" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["session.agent.selected"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - "version": { - "type": "number", - "enum": [1] - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, - "data": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "agent": { - "type": "string" - } - }, - "required": ["sessionID", "agent"], - "additionalProperties": false - } - }, - "required": ["id", "created", "type", "durable", "data"], - "additionalProperties": false - }, - "session.model.selected": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^evt_" - } - ] - }, - "created": { - "type": "number" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["session.model.selected"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - "version": { - "type": "number", - "enum": [1] - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, - "data": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "model": { - "$ref": "#/components/schemas/Model.Ref" - } - }, - "required": ["sessionID", "model"], - "additionalProperties": false - } - }, - "required": ["id", "created", "type", "durable", "data"], - "additionalProperties": false - }, - "session.moved": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^evt_" - } - ] - }, - "created": { - "type": "number" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["session.moved"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - "version": { - "type": "number", - "enum": [1] - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, - "data": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, - "subpath": { - "type": "string" - } - }, - "required": ["sessionID", "location"], - "additionalProperties": false - } - }, - "required": ["id", "created", "type", "durable", "data"], - "additionalProperties": false - }, - "session.renamed": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^evt_" - } - ] - }, - "created": { - "type": "number" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["session.renamed"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - "version": { - "type": "number", - "enum": [1] - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, - "data": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "title": { - "type": "string" - } - }, - "required": ["sessionID", "title"], - "additionalProperties": false - } - }, - "required": ["id", "created", "type", "durable", "data"], - "additionalProperties": false - }, - "session.deleted": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^evt_" - } - ] - }, - "created": { - "type": "number" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["session.deleted"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - "version": { - "type": "number", - "enum": [2] - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, - "data": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - } - }, - "required": ["sessionID"], - "additionalProperties": false - } - }, - "required": ["id", "created", "type", "durable", "data"], - "additionalProperties": false - }, - "session.forked": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^evt_" - } - ] - }, - "created": { - "type": "number" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["session.forked"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - "version": { - "type": "number", - "enum": [1] - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, - "data": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "parentID": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "from": { - "type": "string", - "allOf": [ - { - "pattern": "^msg_" - } - ] - } - }, - "required": ["sessionID", "parentID"], - "additionalProperties": false - } - }, - "required": ["id", "created", "type", "durable", "data"], - "additionalProperties": false - }, - "session.prompt.promoted": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^evt_" - } - ] - }, - "created": { - "type": "number" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["session.prompt.promoted"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - "version": { - "type": "number", - "enum": [1] - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, - "data": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "inputID": { - "type": "string", - "allOf": [ - { - "pattern": "^msg_" - } - ] - } - }, - "required": ["sessionID", "inputID"], - "additionalProperties": false - } - }, - "required": ["id", "created", "type", "durable", "data"], - "additionalProperties": false - }, - "session.prompt.admitted": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^evt_" - } - ] - }, - "created": { - "type": "number" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["session.prompt.admitted"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - "version": { - "type": "number", - "enum": [1] - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, - "data": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "inputID": { - "type": "string", - "allOf": [ - { - "pattern": "^msg_" - } - ] - }, - "prompt": { - "$ref": "#/components/schemas/Prompt" - }, - "delivery": { - "type": "string", - "enum": ["steer", "queue"] - } - }, - "required": ["sessionID", "inputID", "prompt", "delivery"], - "additionalProperties": false - } - }, - "required": ["id", "created", "type", "durable", "data"], - "additionalProperties": false - }, - "session.execution.started": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^evt_" - } - ] - }, - "created": { - "type": "number" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["session.execution.started"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - "version": { - "type": "number", - "enum": [1] - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, - "data": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - } - }, - "required": ["sessionID"], - "additionalProperties": false - } - }, - "required": ["id", "created", "type", "durable", "data"], - "additionalProperties": false - }, - "session.execution.succeeded": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^evt_" - } - ] - }, - "created": { - "type": "number" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["session.execution.succeeded"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - "version": { - "type": "number", - "enum": [1] - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, - "data": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - } - }, - "required": ["sessionID"], - "additionalProperties": false - } - }, - "required": ["id", "created", "type", "durable", "data"], - "additionalProperties": false - }, - "session.execution.failed": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^evt_" - } - ] - }, - "created": { - "type": "number" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["session.execution.failed"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - "version": { - "type": "number", - "enum": [1] - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, - "data": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "error": { - "$ref": "#/components/schemas/Session.StructuredError" - } - }, - "required": ["sessionID", "error"], - "additionalProperties": false - } - }, - "required": ["id", "created", "type", "durable", "data"], - "additionalProperties": false - }, - "session.execution.interrupted": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^evt_" - } - ] - }, - "created": { - "type": "number" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["session.execution.interrupted"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - "version": { - "type": "number", - "enum": [1] - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, - "data": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "reason": { - "type": "string", - "enum": ["user", "shutdown", "superseded"] - } - }, - "required": ["sessionID", "reason"], - "additionalProperties": false - } - }, - "required": ["id", "created", "type", "durable", "data"], - "additionalProperties": false - }, - "session.instructions.updated": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^evt_" - } - ] - }, - "created": { - "type": "number" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["session.instructions.updated"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - "version": { - "type": "number", - "enum": [1] - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, - "data": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "text": { - "type": "string" - } - }, - "required": ["sessionID", "text"], - "additionalProperties": false - } - }, - "required": ["id", "created", "type", "durable", "data"], - "additionalProperties": false - }, - "session.synthetic": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^evt_" - } - ] - }, - "created": { - "type": "number" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["session.synthetic"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - "version": { - "type": "number", - "enum": [1] - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, - "data": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "text": { - "type": "string" - }, - "description": { - "type": "string" - }, - "metadata": { - "type": "object" - } - }, - "required": ["sessionID", "text"], - "additionalProperties": false - } - }, - "required": ["id", "created", "type", "durable", "data"], - "additionalProperties": false - }, - "session.skill.activated": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^evt_" - } - ] - }, - "created": { - "type": "number" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["session.skill.activated"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - "version": { - "type": "number", - "enum": [1] - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, - "data": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "text": { - "type": "string" - } - }, - "required": ["sessionID", "id", "name", "text"], - "additionalProperties": false - } - }, - "required": ["id", "created", "type", "durable", "data"], - "additionalProperties": false - }, - "Shell": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^sh_" - } - ] - }, - "status": { - "type": "string", - "enum": ["running", "exited", "timeout", "killed"] - }, - "command": { - "type": "string" - }, - "cwd": { - "type": "string" - }, - "shell": { - "type": "string" - }, - "file": { - "type": "string" - }, - "pid": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - "exit": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "string", - "enum": ["NaN"] - }, - { - "type": "string", - "enum": ["Infinity"] - }, - { - "type": "string", - "enum": ["-Infinity"] - } - ] - }, - "metadata": { - "type": "object" - }, - "time": { - "type": "object", - "properties": { - "started": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "string", - "enum": ["NaN"] - }, - { - "type": "string", - "enum": ["Infinity"] - }, - { - "type": "string", - "enum": ["-Infinity"] - } - ] - }, - "completed": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "string", - "enum": ["NaN"] - }, - { - "type": "string", - "enum": ["Infinity"] - }, - { - "type": "string", - "enum": ["-Infinity"] - } - ] - } - }, - "required": ["started"], - "additionalProperties": false - } - }, - "required": ["id", "status", "command", "cwd", "shell", "file", "metadata", "time"], - "additionalProperties": false - }, - "session.shell.started": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^evt_" - } - ] - }, - "created": { - "type": "number" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["session.shell.started"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - "version": { - "type": "number", - "enum": [1] - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, - "data": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "shell": { - "$ref": "#/components/schemas/Shell" - } - }, - "required": ["sessionID", "shell"], - "additionalProperties": false - } - }, - "required": ["id", "created", "type", "durable", "data"], - "additionalProperties": false - }, - "session.shell.ended": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^evt_" - } - ] - }, - "created": { - "type": "number" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["session.shell.ended"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - "version": { - "type": "number", - "enum": [1] - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, - "data": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "shell": { - "$ref": "#/components/schemas/Shell" - }, - "output": { - "type": "object", - "properties": { - "output": { - "type": "string" - }, - "cursor": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - "size": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - "truncated": { - "type": "boolean" - } - }, - "required": ["output", "cursor", "size", "truncated"], - "additionalProperties": false - } - }, - "required": ["sessionID", "shell", "output"], - "additionalProperties": false - } - }, - "required": ["id", "created", "type", "durable", "data"], - "additionalProperties": false - }, - "session.step.started": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^evt_" - } - ] - }, - "created": { - "type": "number" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["session.step.started"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - "version": { - "type": "number", - "enum": [1] - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, - "data": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "assistantMessageID": { - "type": "string", - "allOf": [ - { - "pattern": "^msg_" - } - ] - }, - "agent": { - "type": "string" - }, - "model": { - "$ref": "#/components/schemas/Model.Ref" - }, - "snapshot": { - "type": "string" - } - }, - "required": ["sessionID", "assistantMessageID", "agent", "model"], - "additionalProperties": false - } - }, - "required": ["id", "created", "type", "durable", "data"], - "additionalProperties": false - }, - "session.step.ended": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^evt_" - } - ] - }, - "created": { - "type": "number" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["session.step.ended"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - "version": { - "type": "number", - "enum": [1] - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, - "data": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "assistantMessageID": { - "type": "string", - "allOf": [ - { - "pattern": "^msg_" - } - ] - }, - "finish": { - "type": "string", - "enum": ["stop", "length", "tool-calls", "content-filter", "error", "unknown"] - }, - "cost": { - "$ref": "#/components/schemas/Money.USD" - }, - "tokens": { - "$ref": "#/components/schemas/TokenUsage.Info" - }, - "snapshot": { - "type": "string" - }, - "files": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": ["sessionID", "assistantMessageID", "finish", "cost", "tokens"], - "additionalProperties": false - } - }, - "required": ["id", "created", "type", "durable", "data"], - "additionalProperties": false - }, - "session.step.failed": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^evt_" - } - ] - }, - "created": { - "type": "number" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["session.step.failed"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - "version": { - "type": "number", - "enum": [1] - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, - "data": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "assistantMessageID": { - "type": "string", - "allOf": [ - { - "pattern": "^msg_" - } - ] - }, - "error": { - "$ref": "#/components/schemas/Session.StructuredError" - }, - "cost": { - "$ref": "#/components/schemas/Money.USD" - }, - "tokens": { - "$ref": "#/components/schemas/TokenUsage.Info" - } - }, - "required": ["sessionID", "assistantMessageID", "error"], - "additionalProperties": false - } - }, - "required": ["id", "created", "type", "durable", "data"], - "additionalProperties": false - }, - "session.text.started": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^evt_" - } - ] - }, - "created": { - "type": "number" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["session.text.started"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - "version": { - "type": "number", - "enum": [1] - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, - "data": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "assistantMessageID": { - "type": "string", - "allOf": [ - { - "pattern": "^msg_" - } - ] - }, - "ordinal": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - } - }, - "required": ["sessionID", "assistantMessageID", "ordinal"], - "additionalProperties": false - } - }, - "required": ["id", "created", "type", "durable", "data"], - "additionalProperties": false - }, - "session.text.ended": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^evt_" - } - ] - }, - "created": { - "type": "number" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["session.text.ended"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - "version": { - "type": "number", - "enum": [1] - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, - "data": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "assistantMessageID": { - "type": "string", - "allOf": [ - { - "pattern": "^msg_" - } - ] - }, - "ordinal": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - "text": { - "type": "string" - } - }, - "required": ["sessionID", "assistantMessageID", "ordinal", "text"], - "additionalProperties": false - } - }, - "required": ["id", "created", "type", "durable", "data"], - "additionalProperties": false - }, - "Session.Message.ProviderState3": { - "type": "object" - }, - "session.reasoning.started": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^evt_" - } - ] - }, - "created": { - "type": "number" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["session.reasoning.started"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - "version": { - "type": "number", - "enum": [1] - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, - "data": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "assistantMessageID": { - "type": "string", - "allOf": [ - { - "pattern": "^msg_" - } - ] - }, - "ordinal": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - "state": { - "$ref": "#/components/schemas/Session.Message.ProviderState3" - } - }, - "required": ["sessionID", "assistantMessageID", "ordinal"], - "additionalProperties": false - } - }, - "required": ["id", "created", "type", "durable", "data"], - "additionalProperties": false - }, - "Session.Message.ProviderState4": { - "type": "object" - }, - "session.reasoning.ended": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^evt_" - } - ] - }, - "created": { - "type": "number" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["session.reasoning.ended"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - "version": { - "type": "number", - "enum": [1] - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, - "data": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "assistantMessageID": { - "type": "string", - "allOf": [ - { - "pattern": "^msg_" - } - ] - }, - "ordinal": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - "text": { - "type": "string" - }, - "state": { - "$ref": "#/components/schemas/Session.Message.ProviderState4" - } - }, - "required": ["sessionID", "assistantMessageID", "ordinal", "text"], - "additionalProperties": false - } - }, - "required": ["id", "created", "type", "durable", "data"], - "additionalProperties": false - }, - "session.tool.input.started": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^evt_" - } - ] - }, - "created": { - "type": "number" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["session.tool.input.started"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - "version": { - "type": "number", - "enum": [1] - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, - "data": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "assistantMessageID": { - "type": "string", - "allOf": [ - { - "pattern": "^msg_" - } - ] - }, - "callID": { - "type": "string" - }, - "name": { - "type": "string" - } - }, - "required": ["sessionID", "assistantMessageID", "callID", "name"], - "additionalProperties": false - } - }, - "required": ["id", "created", "type", "durable", "data"], - "additionalProperties": false - }, - "session.tool.input.ended": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^evt_" - } - ] - }, - "created": { - "type": "number" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["session.tool.input.ended"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - "version": { - "type": "number", - "enum": [1] - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, - "data": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "assistantMessageID": { - "type": "string", - "allOf": [ - { - "pattern": "^msg_" - } - ] - }, - "callID": { - "type": "string" - }, - "text": { - "type": "string" - } - }, - "required": ["sessionID", "assistantMessageID", "callID", "text"], - "additionalProperties": false - } - }, - "required": ["id", "created", "type", "durable", "data"], - "additionalProperties": false - }, - "Session.Message.ProviderState5": { - "type": "object" - }, - "session.tool.called": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^evt_" - } - ] - }, - "created": { - "type": "number" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["session.tool.called"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - "version": { - "type": "number", - "enum": [1] - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, - "data": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "assistantMessageID": { - "type": "string", - "allOf": [ - { - "pattern": "^msg_" - } - ] - }, - "callID": { - "type": "string" - }, - "input": { - "type": "object" - }, - "executed": { - "type": "boolean" - }, - "state": { - "$ref": "#/components/schemas/Session.Message.ProviderState5" - } - }, - "required": ["sessionID", "assistantMessageID", "callID", "input", "executed"], - "additionalProperties": false - } - }, - "required": ["id", "created", "type", "durable", "data"], - "additionalProperties": false - }, - "session.tool.progress": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^evt_" - } - ] - }, - "created": { - "type": "number" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["session.tool.progress"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - "version": { - "type": "number", - "enum": [1] - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, - "data": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "assistantMessageID": { - "type": "string", - "allOf": [ - { - "pattern": "^msg_" - } - ] - }, - "callID": { - "type": "string" - }, - "structured": { - "type": "object" - }, - "content": { - "type": "array", - "items": { - "$ref": "#/components/schemas/LLM.ToolContent" - } - } - }, - "required": ["sessionID", "assistantMessageID", "callID", "structured", "content"], - "additionalProperties": false - } - }, - "required": ["id", "created", "type", "durable", "data"], - "additionalProperties": false - }, - "Session.Message.ProviderState6": { - "type": "object" - }, - "session.tool.success": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^evt_" - } - ] - }, - "created": { - "type": "number" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["session.tool.success"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - "version": { - "type": "number", - "enum": [1] - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, - "data": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "assistantMessageID": { - "type": "string", - "allOf": [ - { - "pattern": "^msg_" - } - ] - }, - "callID": { - "type": "string" - }, - "structured": { - "type": "object" - }, - "content": { - "type": "array", - "items": { - "$ref": "#/components/schemas/LLM.ToolContent" - } - }, - "result": {}, - "executed": { - "type": "boolean" - }, - "resultState": { - "$ref": "#/components/schemas/Session.Message.ProviderState6" - } - }, - "required": ["sessionID", "assistantMessageID", "callID", "structured", "content", "executed"], - "additionalProperties": false - } - }, - "required": ["id", "created", "type", "durable", "data"], - "additionalProperties": false - }, - "Session.Message.ProviderState7": { - "type": "object" - }, - "session.tool.failed": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^evt_" - } - ] - }, - "created": { - "type": "number" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["session.tool.failed"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - "version": { - "type": "number", - "enum": [1] - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, - "data": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "assistantMessageID": { - "type": "string", - "allOf": [ - { - "pattern": "^msg_" - } - ] - }, - "callID": { - "type": "string" - }, - "error": { - "$ref": "#/components/schemas/Session.StructuredError" - }, - "result": {}, - "executed": { - "type": "boolean" - }, - "resultState": { - "$ref": "#/components/schemas/Session.Message.ProviderState7" - } - }, - "required": ["sessionID", "assistantMessageID", "callID", "error", "executed"], - "additionalProperties": false - } - }, - "required": ["id", "created", "type", "durable", "data"], - "additionalProperties": false - }, - "session.retry.scheduled": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^evt_" - } - ] - }, - "created": { - "type": "number" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["session.retry.scheduled"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - "version": { - "type": "number", - "enum": [1] - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, - "data": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "assistantMessageID": { - "type": "string", - "allOf": [ - { - "pattern": "^msg_" - } - ] - }, - "attempt": { - "type": "integer", - "allOf": [ - { - "exclusiveMinimum": 0 - } - ] - }, - "at": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - "error": { - "$ref": "#/components/schemas/Session.StructuredError" - } - }, - "required": ["sessionID", "assistantMessageID", "attempt", "at", "error"], - "additionalProperties": false - } - }, - "required": ["id", "created", "type", "durable", "data"], - "additionalProperties": false - }, - "session.compaction.admitted": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^evt_" - } - ] - }, - "created": { - "type": "number" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["session.compaction.admitted"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - "version": { - "type": "number", - "enum": [1] - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, - "data": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "inputID": { - "type": "string", - "allOf": [ - { - "pattern": "^msg_" - } - ] - } - }, - "required": ["sessionID", "inputID"], - "additionalProperties": false - } - }, - "required": ["id", "created", "type", "durable", "data"], - "additionalProperties": false - }, - "session.compaction.started": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^evt_" - } - ] - }, - "created": { - "type": "number" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["session.compaction.started"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - "version": { - "type": "number", - "enum": [1] - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, - "data": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "reason": { - "type": "string", - "enum": ["auto", "manual"] - }, - "recent": { - "type": "string" - }, - "inputID": { - "type": "string", - "allOf": [ - { - "pattern": "^msg_" - } - ] - } - }, - "required": ["sessionID", "reason", "recent"], - "additionalProperties": false - } - }, - "required": ["id", "created", "type", "durable", "data"], - "additionalProperties": false - }, - "session.compaction.ended": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^evt_" - } - ] - }, - "created": { - "type": "number" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["session.compaction.ended"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - "version": { - "type": "number", - "enum": [1] - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, - "data": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "reason": { - "type": "string", - "enum": ["auto", "manual"] - }, - "text": { - "type": "string" - }, - "recent": { - "type": "string" - } - }, - "required": ["sessionID", "reason", "text", "recent"], - "additionalProperties": false - } - }, - "required": ["id", "created", "type", "durable", "data"], - "additionalProperties": false - }, - "session.compaction.failed": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^evt_" - } - ] - }, - "created": { - "type": "number" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["session.compaction.failed"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - "version": { - "type": "number", - "enum": [1] - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, - "data": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "reason": { - "type": "string", - "enum": ["auto", "manual"] - }, - "error": { - "$ref": "#/components/schemas/Session.StructuredError" - }, - "inputID": { - "type": "string", - "allOf": [ - { - "pattern": "^msg_" - } - ] - } - }, - "required": ["sessionID", "reason", "error"], - "additionalProperties": false - } - }, - "required": ["id", "created", "type", "durable", "data"], - "additionalProperties": false - }, - "session.revert.staged": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^evt_" - } - ] - }, - "created": { - "type": "number" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["session.revert.staged"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - "version": { - "type": "number", - "enum": [1] - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, - "data": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "revert": { - "$ref": "#/components/schemas/Session.Revert" - } - }, - "required": ["sessionID", "revert"], - "additionalProperties": false - } - }, - "required": ["id", "created", "type", "durable", "data"], - "additionalProperties": false - }, - "session.revert.cleared": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^evt_" - } - ] - }, - "created": { - "type": "number" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["session.revert.cleared"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - "version": { - "type": "number", - "enum": [1] - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, - "data": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - } - }, - "required": ["sessionID"], - "additionalProperties": false - } - }, - "required": ["id", "created", "type", "durable", "data"], - "additionalProperties": false - }, - "session.revert.committed": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^evt_" - } - ] - }, - "created": { - "type": "number" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["session.revert.committed"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - "version": { - "type": "number", - "enum": [1] - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, - "data": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "to": { - "type": "string", - "allOf": [ - { - "pattern": "^msg_" - } - ] - } - }, - "required": ["sessionID", "to"], - "additionalProperties": false - } - }, - "required": ["id", "created", "type", "durable", "data"], - "additionalProperties": false - }, - "Session.Event.Durable": { - "oneOf": [ - { - "$ref": "#/components/schemas/session.agent.selected" - }, - { - "$ref": "#/components/schemas/session.model.selected" - }, - { - "$ref": "#/components/schemas/session.moved" - }, - { - "$ref": "#/components/schemas/session.renamed" - }, - { - "$ref": "#/components/schemas/session.deleted" - }, - { - "$ref": "#/components/schemas/session.forked" - }, - { - "$ref": "#/components/schemas/session.prompt.promoted" - }, - { - "$ref": "#/components/schemas/session.prompt.admitted" - }, - { - "$ref": "#/components/schemas/session.execution.started" - }, - { - "$ref": "#/components/schemas/session.execution.succeeded" - }, - { - "$ref": "#/components/schemas/session.execution.failed" - }, - { - "$ref": "#/components/schemas/session.execution.interrupted" - }, - { - "$ref": "#/components/schemas/session.instructions.updated" - }, - { - "$ref": "#/components/schemas/session.synthetic" - }, - { - "$ref": "#/components/schemas/session.skill.activated" - }, - { - "$ref": "#/components/schemas/session.shell.started" - }, - { - "$ref": "#/components/schemas/session.shell.ended" - }, - { - "$ref": "#/components/schemas/session.step.started" - }, - { - "$ref": "#/components/schemas/session.step.ended" - }, - { - "$ref": "#/components/schemas/session.step.failed" - }, - { - "$ref": "#/components/schemas/session.text.started" - }, - { - "$ref": "#/components/schemas/session.text.ended" - }, - { - "$ref": "#/components/schemas/session.reasoning.started" - }, - { - "$ref": "#/components/schemas/session.reasoning.ended" - }, - { - "$ref": "#/components/schemas/session.tool.input.started" - }, - { - "$ref": "#/components/schemas/session.tool.input.ended" - }, - { - "$ref": "#/components/schemas/session.tool.called" - }, - { - "$ref": "#/components/schemas/session.tool.progress" - }, - { - "$ref": "#/components/schemas/session.tool.success" - }, - { - "$ref": "#/components/schemas/session.tool.failed" - }, - { - "$ref": "#/components/schemas/session.retry.scheduled" - }, - { - "$ref": "#/components/schemas/session.compaction.admitted" - }, - { - "$ref": "#/components/schemas/session.compaction.started" - }, - { - "$ref": "#/components/schemas/session.compaction.ended" - }, - { - "$ref": "#/components/schemas/session.compaction.failed" - }, - { - "$ref": "#/components/schemas/session.revert.staged" - }, - { - "$ref": "#/components/schemas/session.revert.cleared" - }, - { - "$ref": "#/components/schemas/session.revert.committed" - } - ] - }, - "EventLog.Synced": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["log.synced"] - }, - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - } - }, - "required": ["type", "aggregateID"], - "additionalProperties": false, - "description": "Marker emitted once when a log read reaches its captured watermark. The reader holds every event committed at or below seq." - }, - "SessionLogItem": { - "anyOf": [ - { - "$ref": "#/components/schemas/Session.Event.Durable" - }, - { - "$ref": "#/components/schemas/EventLog.Synced" - } - ] - }, - "SessionLogItemJsonString": { - "type": "string", - "contentSchema": { - "$ref": "#/components/schemas/SessionLogItem" - }, - "contentMediaType": "application/json" - }, - "SessionMessagesResponse": { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Session.Message.Info" - } - }, - "cursor": { - "type": "object", - "properties": { - "previous": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "next": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - }, - "additionalProperties": false - } - }, - "required": ["data", "cursor"], - "additionalProperties": false - }, - "Model.Capabilities": { - "type": "object", - "properties": { - "tools": { - "type": "boolean" - }, - "input": { - "type": "array", - "items": { - "type": "string" - } - }, - "output": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": ["tools", "input", "output"], - "additionalProperties": false - }, - "Model.Variant": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "settings": { - "type": "object" - }, - "headers": { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "body": { - "type": "object" - } - }, - "required": ["id"], - "additionalProperties": false - }, - "Money.USDPerMillionTokens": { - "type": "number" - }, - "Model.Cost": { - "type": "object", - "properties": { - "tier": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["context"] - }, - "size": { - "type": "integer" - } - }, - "required": ["type", "size"], - "additionalProperties": false - }, - "input": { - "$ref": "#/components/schemas/Money.USDPerMillionTokens" - }, - "output": { - "$ref": "#/components/schemas/Money.USDPerMillionTokens" - }, - "cache": { - "type": "object", - "properties": { - "read": { - "$ref": "#/components/schemas/Money.USDPerMillionTokens" - }, - "write": { - "$ref": "#/components/schemas/Money.USDPerMillionTokens" - } - }, - "required": ["read", "write"], - "additionalProperties": false - } - }, - "required": ["input", "output", "cache"], - "additionalProperties": false - }, - "Model.Info": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "modelID": { - "type": "string" - }, - "providerID": { - "type": "string" - }, - "family": { - "type": "string" - }, - "name": { - "type": "string" - }, - "package": { - "type": "string" - }, - "settings": { - "type": "object" - }, - "headers": { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "body": { - "type": "object" - }, - "capabilities": { - "$ref": "#/components/schemas/Model.Capabilities" - }, - "variants": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Model.Variant" - } - }, - "time": { - "type": "object", - "properties": { - "released": { - "type": "number" - } - }, - "required": ["released"], - "additionalProperties": false - }, - "cost": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Model.Cost" - } - }, - "status": { - "type": "string", - "enum": ["alpha", "beta", "deprecated", "active"] - }, - "enabled": { - "type": "boolean" - }, - "limit": { - "type": "object", - "properties": { - "context": { - "type": "integer" - }, - "input": { - "type": "integer" - }, - "output": { - "type": "integer" - } - }, - "required": ["context", "output"], - "additionalProperties": false - } - }, - "required": [ - "id", - "modelID", - "providerID", - "name", - "capabilities", - "variants", - "time", - "cost", - "status", - "enabled", - "limit" - ], - "additionalProperties": false - }, - "GenerateTextResponse": { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "text": { - "type": "string" - } - }, - "required": ["text"], - "additionalProperties": false - } - }, - "required": ["data"], - "additionalProperties": false - }, - "ProviderV2.Info": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "integrationID": { - "type": "string" - }, - "name": { - "type": "string" - }, - "disabled": { - "type": "boolean" - }, - "package": { - "type": "string" - }, - "settings": { - "type": "object" - }, - "headers": { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "body": { - "type": "object" - } - }, - "required": ["id", "name", "package"], - "additionalProperties": false - }, - "ProviderNotFoundError": { - "type": "object", - "properties": { - "_tag": { - "type": "string", - "enum": ["ProviderNotFoundError"] - }, - "providerID": { - "type": "string" - }, - "message": { - "type": "string" - } - }, - "required": ["_tag", "providerID", "message"], - "additionalProperties": false - }, - "Integration.When": { - "type": "object", - "properties": { - "key": { - "type": "string" - }, - "op": { - "type": "string", - "enum": ["eq", "neq"] - }, - "value": { - "type": "string" - } - }, - "required": ["key", "op", "value"], - "additionalProperties": false - }, - "Integration.TextPrompt": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["text"] - }, - "key": { - "type": "string" - }, - "message": { - "type": "string" - }, - "placeholder": { - "type": "string" - }, - "when": { - "$ref": "#/components/schemas/Integration.When" - } - }, - "required": ["type", "key", "message"], - "additionalProperties": false - }, - "Integration.SelectPrompt": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["select"] - }, - "key": { - "type": "string" - }, - "message": { - "type": "string" - }, - "options": { - "type": "array", - "items": { - "type": "object", - "properties": { - "label": { - "type": "string" - }, - "value": { - "type": "string" - }, - "hint": { - "type": "string" - } - }, - "required": ["label", "value"], - "additionalProperties": false - } - }, - "when": { - "$ref": "#/components/schemas/Integration.When" - } - }, - "required": ["type", "key", "message", "options"], - "additionalProperties": false - }, - "Integration.OAuthMethod": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "type": { - "type": "string", - "enum": ["oauth"] - }, - "label": { - "type": "string" - }, - "prompts": { - "type": "array", - "items": { - "anyOf": [ - { - "$ref": "#/components/schemas/Integration.TextPrompt" - }, - { - "$ref": "#/components/schemas/Integration.SelectPrompt" - } - ] - } - } - }, - "required": ["id", "type", "label"], - "additionalProperties": false - }, - "Integration.KeyMethod": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["key"] - }, - "label": { - "type": "string" - } - }, - "required": ["type"], - "additionalProperties": false - }, - "Integration.EnvMethod": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["env"] - }, - "names": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": ["type", "names"], - "additionalProperties": false - }, - "Integration.Method": { - "anyOf": [ - { - "$ref": "#/components/schemas/Integration.OAuthMethod" - }, - { - "$ref": "#/components/schemas/Integration.KeyMethod" - }, - { - "$ref": "#/components/schemas/Integration.EnvMethod" - } - ] - }, - "Connection.CredentialInfo": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["credential"] - }, - "id": { - "type": "string" - }, - "label": { - "type": "string" - } - }, - "required": ["type", "id", "label"], - "additionalProperties": false - }, - "Connection.EnvInfo": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["env"] - }, - "name": { - "type": "string" - } - }, - "required": ["type", "name"], - "additionalProperties": false - }, - "Connection.Info": { - "anyOf": [ - { - "$ref": "#/components/schemas/Connection.CredentialInfo" - }, - { - "$ref": "#/components/schemas/Connection.EnvInfo" - } - ] - }, - "Integration.Info": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "methods": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Integration.Method" - } - }, - "connections": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Connection.Info" - } - } - }, - "required": ["id", "name", "methods", "connections"], - "additionalProperties": false - }, - "Integration.Attempt": { - "type": "object", - "properties": { - "attemptID": { - "type": "string" - }, - "url": { - "type": "string" - }, - "instructions": { - "type": "string" - }, - "mode": { - "type": "string", - "enum": ["auto", "code"] - }, - "time": { - "type": "object", - "properties": { - "created": { - "anyOf": [ - { - "anyOf": [ - { - "type": "number" - }, - { - "type": "string", - "enum": ["NaN"] - }, - { - "type": "string", - "enum": ["Infinity"] - }, - { - "type": "string", - "enum": ["-Infinity"] - } - ] - }, - { - "type": "string", - "enum": ["Infinity", "-Infinity", "NaN"] - } - ] - }, - "expires": { - "anyOf": [ - { - "anyOf": [ - { - "type": "number" - }, - { - "type": "string", - "enum": ["NaN"] - }, - { - "type": "string", - "enum": ["Infinity"] - }, - { - "type": "string", - "enum": ["-Infinity"] - } - ] - }, - { - "type": "string", - "enum": ["Infinity", "-Infinity", "NaN"] - } - ] - } - }, - "required": ["created", "expires"], - "additionalProperties": false - } - }, - "required": ["attemptID", "url", "instructions", "mode", "time"], - "additionalProperties": false - }, - "Integration.AttemptStatus": { - "anyOf": [ - { - "type": "object", - "properties": { - "status": { - "type": "string", - "enum": ["pending"] - }, - "time": { - "type": "object", - "properties": { - "created": { - "anyOf": [ - { - "anyOf": [ - { - "type": "number" - }, - { - "type": "string", - "enum": ["NaN"] - }, - { - "type": "string", - "enum": ["Infinity"] - }, - { - "type": "string", - "enum": ["-Infinity"] - } - ] - }, - { - "type": "string", - "enum": ["Infinity", "-Infinity", "NaN"] - } - ] - }, - "expires": { - "anyOf": [ - { - "anyOf": [ - { - "type": "number" - }, - { - "type": "string", - "enum": ["NaN"] - }, - { - "type": "string", - "enum": ["Infinity"] - }, - { - "type": "string", - "enum": ["-Infinity"] - } - ] - }, - { - "type": "string", - "enum": ["Infinity", "-Infinity", "NaN"] - } - ] - } - }, - "required": ["created", "expires"], - "additionalProperties": false - } - }, - "required": ["status", "time"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "status": { - "type": "string", - "enum": ["complete"] - }, - "time": { - "type": "object", - "properties": { - "created": { - "anyOf": [ - { - "anyOf": [ - { - "type": "number" - }, - { - "type": "string", - "enum": ["NaN"] - }, - { - "type": "string", - "enum": ["Infinity"] - }, - { - "type": "string", - "enum": ["-Infinity"] - } - ] - }, - { - "type": "string", - "enum": ["Infinity", "-Infinity", "NaN"] - } - ] - }, - "expires": { - "anyOf": [ - { - "anyOf": [ - { - "type": "number" - }, - { - "type": "string", - "enum": ["NaN"] - }, - { - "type": "string", - "enum": ["Infinity"] - }, - { - "type": "string", - "enum": ["-Infinity"] - } - ] - }, - { - "type": "string", - "enum": ["Infinity", "-Infinity", "NaN"] - } - ] - } - }, - "required": ["created", "expires"], - "additionalProperties": false - } - }, - "required": ["status", "time"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "status": { - "type": "string", - "enum": ["failed"] - }, - "message": { - "type": "string" - }, - "time": { - "type": "object", - "properties": { - "created": { - "anyOf": [ - { - "anyOf": [ - { - "type": "number" - }, - { - "type": "string", - "enum": ["NaN"] - }, - { - "type": "string", - "enum": ["Infinity"] - }, - { - "type": "string", - "enum": ["-Infinity"] - } - ] - }, - { - "type": "string", - "enum": ["Infinity", "-Infinity", "NaN"] - } - ] - }, - "expires": { - "anyOf": [ - { - "anyOf": [ - { - "type": "number" - }, - { - "type": "string", - "enum": ["NaN"] - }, - { - "type": "string", - "enum": ["Infinity"] - }, - { - "type": "string", - "enum": ["-Infinity"] - } - ] - }, - { - "type": "string", - "enum": ["Infinity", "-Infinity", "NaN"] - } - ] - } - }, - "required": ["created", "expires"], - "additionalProperties": false - } - }, - "required": ["status", "message", "time"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "status": { - "type": "string", - "enum": ["expired"] - }, - "time": { - "type": "object", - "properties": { - "created": { - "anyOf": [ - { - "anyOf": [ - { - "type": "number" - }, - { - "type": "string", - "enum": ["NaN"] - }, - { - "type": "string", - "enum": ["Infinity"] - }, - { - "type": "string", - "enum": ["-Infinity"] - } - ] - }, - { - "type": "string", - "enum": ["Infinity", "-Infinity", "NaN"] - } - ] - }, - "expires": { - "anyOf": [ - { - "anyOf": [ - { - "type": "number" - }, - { - "type": "string", - "enum": ["NaN"] - }, - { - "type": "string", - "enum": ["Infinity"] - }, - { - "type": "string", - "enum": ["-Infinity"] - } - ] - }, - { - "type": "string", - "enum": ["Infinity", "-Infinity", "NaN"] - } - ] - } - }, - "required": ["created", "expires"], - "additionalProperties": false - } - }, - "required": ["status", "time"], - "additionalProperties": false - } - ] - }, - "Mcp.Status.Connected": { - "type": "object", - "properties": { - "status": { - "type": "string", - "enum": ["connected"] - } - }, - "required": ["status"], - "additionalProperties": false - }, - "Mcp.Status.Pending": { - "type": "object", - "properties": { - "status": { - "type": "string", - "enum": ["pending"] - } - }, - "required": ["status"], - "additionalProperties": false - }, - "Mcp.Status.Disabled": { - "type": "object", - "properties": { - "status": { - "type": "string", - "enum": ["disabled"] - } - }, - "required": ["status"], - "additionalProperties": false - }, - "Mcp.Status.Failed": { - "type": "object", - "properties": { - "status": { - "type": "string", - "enum": ["failed"] - }, - "error": { - "type": "string" - } - }, - "required": ["status", "error"], - "additionalProperties": false - }, - "Mcp.Status.NeedsAuth": { - "type": "object", - "properties": { - "status": { - "type": "string", - "enum": ["needs_auth"] - } - }, - "required": ["status"], - "additionalProperties": false - }, - "Mcp.Status.NeedsClientRegistration": { - "type": "object", - "properties": { - "status": { - "type": "string", - "enum": ["needs_client_registration"] - }, - "error": { - "type": "string" - } - }, - "required": ["status", "error"], - "additionalProperties": false - }, - "Mcp.Server": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "status": { - "anyOf": [ - { - "$ref": "#/components/schemas/Mcp.Status.Connected" - }, - { - "$ref": "#/components/schemas/Mcp.Status.Pending" - }, - { - "$ref": "#/components/schemas/Mcp.Status.Disabled" - }, - { - "$ref": "#/components/schemas/Mcp.Status.Failed" - }, - { - "$ref": "#/components/schemas/Mcp.Status.NeedsAuth" - }, - { - "$ref": "#/components/schemas/Mcp.Status.NeedsClientRegistration" - } - ] - }, - "integrationID": { - "type": "string" - } - }, - "required": ["name", "status"], - "additionalProperties": false - }, - "Mcp.Resource": { - "type": "object", - "properties": { - "server": { - "type": "string" - }, - "name": { - "type": "string" - }, - "uri": { - "type": "string" - }, - "description": { - "type": "string" - }, - "mimeType": { - "type": "string" - } - }, - "required": ["server", "name", "uri"], - "additionalProperties": false - }, - "Mcp.ResourceTemplate": { - "type": "object", - "properties": { - "server": { - "type": "string" - }, - "name": { - "type": "string" - }, - "uriTemplate": { - "type": "string" - }, - "description": { - "type": "string" - }, - "mimeType": { - "type": "string" - } - }, - "required": ["server", "name", "uriTemplate"], - "additionalProperties": false - }, - "Mcp.ResourceCatalog": { - "type": "object", - "properties": { - "resources": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Mcp.Resource" - } - }, - "templates": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Mcp.ResourceTemplate" - } - } - }, - "required": ["resources", "templates"], - "additionalProperties": false - }, - "Project.Vcs": { - "type": "string", - "enum": ["git", "hg"] - }, - "Project.Icon": { - "type": "object", - "properties": { - "url": { - "type": "string" - }, - "override": { - "type": "string" - }, - "color": { - "type": "string" - } - }, - "additionalProperties": false - }, - "Project.Commands": { - "type": "object", - "properties": { - "start": { - "type": "string", - "description": "Startup script to run when creating a new workspace (worktree)" - } - }, - "additionalProperties": false - }, - "Project.Time": { - "type": "object", - "properties": { - "created": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - "updated": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - "initialized": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - } - }, - "required": ["created", "updated"], - "additionalProperties": false - }, - "Project": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "worktree": { - "type": "string" - }, - "vcs": { - "$ref": "#/components/schemas/Project.Vcs" - }, - "name": { - "type": "string" - }, - "icon": { - "$ref": "#/components/schemas/Project.Icon" - }, - "commands": { - "$ref": "#/components/schemas/Project.Commands" - }, - "time": { - "$ref": "#/components/schemas/Project.Time" - }, - "sandboxes": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": ["id", "worktree", "time", "sandboxes"], - "additionalProperties": false - }, - "Project.Current": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "directory": { - "type": "string" - } - }, - "required": ["id", "directory"], - "additionalProperties": false - }, - "Project.Directory": { - "type": "object", - "properties": { - "directory": { - "type": "string" - }, - "strategy": { - "type": "string" - } - }, - "required": ["directory"], - "additionalProperties": false - }, - "Project.Directories": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Project.Directory" - } - }, - "Form.Metadata": { - "type": "object" - }, - "Form.When": { - "type": "object", - "properties": { - "key": { - "type": "string" - }, - "op": { - "type": "string", - "enum": ["eq", "neq"] - }, - "value": { - "anyOf": [ - { - "type": "string" - }, - { - "anyOf": [ - { - "anyOf": [ - { - "type": "number" - }, - { - "type": "string", - "enum": ["NaN"] - }, - { - "type": "string", - "enum": ["Infinity"] - }, - { - "type": "string", - "enum": ["-Infinity"] - } - ] - }, - { - "type": "string", - "enum": ["Infinity", "-Infinity", "NaN"] - } - ] - }, - { - "type": "boolean" - } - ] - } - }, - "required": ["key", "op", "value"], - "additionalProperties": false - }, - "Form.Option": { - "type": "object", - "properties": { - "value": { - "type": "string" - }, - "label": { - "type": "string" - }, - "description": { - "type": "string" - } - }, - "required": ["value", "label"], - "additionalProperties": false - }, - "Form.StringField": { - "type": "object", - "properties": { - "key": { - "type": "string" - }, - "title": { - "type": "string" - }, - "description": { - "type": "string" - }, - "required": { - "type": "boolean" - }, - "when": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Form.When" - } - }, - "type": { - "type": "string", - "enum": ["string"] - }, - "format": { - "type": "string", - "enum": ["email", "uri", "date", "date-time"] - }, - "minLength": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - "maxLength": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - "pattern": { - "type": "string" - }, - "placeholder": { - "type": "string" - }, - "default": { - "type": "string" - }, - "options": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Form.Option" - } - }, - "custom": { - "type": "boolean" - } - }, - "required": ["key", "type"], - "additionalProperties": false - }, - "Form.NumberField": { - "type": "object", - "properties": { - "key": { - "type": "string" - }, - "title": { - "type": "string" - }, - "description": { - "type": "string" - }, - "required": { - "type": "boolean" - }, - "when": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Form.When" - } - }, - "type": { - "type": "string", - "enum": ["number"] - }, - "minimum": { - "anyOf": [ - { - "anyOf": [ - { - "type": "number" - }, - { - "type": "string", - "enum": ["NaN"] - }, - { - "type": "string", - "enum": ["Infinity"] - }, - { - "type": "string", - "enum": ["-Infinity"] - } - ] - }, - { - "type": "string", - "enum": ["Infinity", "-Infinity", "NaN"] - } - ] - }, - "maximum": { - "anyOf": [ - { - "anyOf": [ - { - "type": "number" - }, - { - "type": "string", - "enum": ["NaN"] - }, - { - "type": "string", - "enum": ["Infinity"] - }, - { - "type": "string", - "enum": ["-Infinity"] - } - ] - }, - { - "type": "string", - "enum": ["Infinity", "-Infinity", "NaN"] - } - ] - }, - "default": { - "anyOf": [ - { - "anyOf": [ - { - "type": "number" - }, - { - "type": "string", - "enum": ["NaN"] - }, - { - "type": "string", - "enum": ["Infinity"] - }, - { - "type": "string", - "enum": ["-Infinity"] - } - ] - }, - { - "type": "string", - "enum": ["Infinity", "-Infinity", "NaN"] - } - ] - } - }, - "required": ["key", "type"], - "additionalProperties": false - }, - "Form.IntegerField": { - "type": "object", - "properties": { - "key": { - "type": "string" - }, - "title": { - "type": "string" - }, - "description": { - "type": "string" - }, - "required": { - "type": "boolean" - }, - "when": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Form.When" - } - }, - "type": { - "type": "string", - "enum": ["integer"] - }, - "minimum": { - "anyOf": [ - { - "anyOf": [ - { - "type": "number" - }, - { - "type": "string", - "enum": ["NaN"] - }, - { - "type": "string", - "enum": ["Infinity"] - }, - { - "type": "string", - "enum": ["-Infinity"] - } - ] - }, - { - "type": "string", - "enum": ["Infinity", "-Infinity", "NaN"] - } - ] - }, - "maximum": { - "anyOf": [ - { - "anyOf": [ - { - "type": "number" - }, - { - "type": "string", - "enum": ["NaN"] - }, - { - "type": "string", - "enum": ["Infinity"] - }, - { - "type": "string", - "enum": ["-Infinity"] - } - ] - }, - { - "type": "string", - "enum": ["Infinity", "-Infinity", "NaN"] - } - ] - }, - "default": { - "anyOf": [ - { - "anyOf": [ - { - "type": "number" - }, - { - "type": "string", - "enum": ["NaN"] - }, - { - "type": "string", - "enum": ["Infinity"] - }, - { - "type": "string", - "enum": ["-Infinity"] - } - ] - }, - { - "type": "string", - "enum": ["Infinity", "-Infinity", "NaN"] - } - ] - } - }, - "required": ["key", "type"], - "additionalProperties": false - }, - "Form.BooleanField": { - "type": "object", - "properties": { - "key": { - "type": "string" - }, - "title": { - "type": "string" - }, - "description": { - "type": "string" - }, - "required": { - "type": "boolean" - }, - "when": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Form.When" - } - }, - "type": { - "type": "string", - "enum": ["boolean"] - }, - "default": { - "type": "boolean" - } - }, - "required": ["key", "type"], - "additionalProperties": false - }, - "Form.MultiselectField": { - "type": "object", - "properties": { - "key": { - "type": "string" - }, - "title": { - "type": "string" - }, - "description": { - "type": "string" - }, - "required": { - "type": "boolean" - }, - "when": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Form.When" - } - }, - "type": { - "type": "string", - "enum": ["multiselect"] - }, - "options": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Form.Option" - } - }, - "minItems": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - "maxItems": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - "custom": { - "type": "boolean" - }, - "default": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": ["key", "type", "options"], - "additionalProperties": false - }, - "Form.FormInfo": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^frm_" - } - ] - }, - "sessionID": { - "type": "string" - }, - "title": { - "type": "string" - }, - "metadata": { - "$ref": "#/components/schemas/Form.Metadata" - }, - "mode": { - "type": "string", - "enum": ["form"] - }, - "fields": { - "type": "array", - "items": { - "anyOf": [ - { - "$ref": "#/components/schemas/Form.StringField" - }, - { - "$ref": "#/components/schemas/Form.NumberField" - }, - { - "$ref": "#/components/schemas/Form.IntegerField" - }, - { - "$ref": "#/components/schemas/Form.BooleanField" - }, - { - "$ref": "#/components/schemas/Form.MultiselectField" - } - ] - } - } - }, - "required": ["id", "sessionID", "title", "mode", "fields"], - "additionalProperties": false - }, - "Form.UrlInfo": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^frm_" - } - ] - }, - "sessionID": { - "type": "string" - }, - "title": { - "type": "string" - }, - "metadata": { - "$ref": "#/components/schemas/Form.Metadata" - }, - "mode": { - "type": "string", - "enum": ["url"] - }, - "url": { - "type": "string" - } - }, - "required": ["id", "sessionID", "title", "mode", "url"], - "additionalProperties": false - }, - "Form.CreatePayload": { - "type": "object", - "properties": { - "id": { - "anyOf": [ - { - "type": "string", - "allOf": [ - { - "pattern": "^frm_" - } - ] - }, - { - "type": "null" - } - ] - }, - "title": { - "type": "string" - }, - "metadata": { - "$ref": "#/components/schemas/Form.Metadata" - }, - "mode": { - "type": "string", - "enum": ["form", "url"] - }, - "fields": { - "anyOf": [ - { - "type": "array", - "items": { - "anyOf": [ - { - "$ref": "#/components/schemas/Form.StringField" - }, - { - "$ref": "#/components/schemas/Form.NumberField" - }, - { - "$ref": "#/components/schemas/Form.IntegerField" - }, - { - "$ref": "#/components/schemas/Form.BooleanField" - }, - { - "$ref": "#/components/schemas/Form.MultiselectField" - } - ] - } - }, - { - "type": "null" - } - ] - }, - "url": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - }, - "required": ["title", "mode"], - "additionalProperties": false - }, - "FormNotFoundError": { - "type": "object", - "properties": { - "_tag": { - "type": "string", - "enum": ["FormNotFoundError"] - }, - "id": { - "type": "string" - }, - "message": { - "type": "string" - } - }, - "required": ["_tag", "id", "message"], - "additionalProperties": false - }, - "Form.Value": { - "anyOf": [ - { - "type": "string" - }, - { - "anyOf": [ - { - "anyOf": [ - { - "type": "number" - }, - { - "type": "string", - "enum": ["NaN"] - }, - { - "type": "string", - "enum": ["Infinity"] - }, - { - "type": "string", - "enum": ["-Infinity"] - } - ] - }, - { - "type": "string", - "enum": ["Infinity", "-Infinity", "NaN"] - } - ] - }, - { - "type": "boolean" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - }, - "Form.Answer": { - "type": "object", - "additionalProperties": { - "$ref": "#/components/schemas/Form.Value" - } - }, - "Form.State": { - "anyOf": [ - { - "type": "object", - "properties": { - "status": { - "type": "string", - "enum": ["pending"] - } - }, - "required": ["status"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "status": { - "type": "string", - "enum": ["answered"] - }, - "answer": { - "$ref": "#/components/schemas/Form.Answer" - } - }, - "required": ["status", "answer"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "status": { - "type": "string", - "enum": ["cancelled"] - } - }, - "required": ["status"], - "additionalProperties": false - } - ] - }, - "Form.Reply": { - "type": "object", - "properties": { - "answer": { - "$ref": "#/components/schemas/Form.Answer" - } - }, - "required": ["answer"], - "additionalProperties": false - }, - "FormAlreadySettledError": { - "type": "object", - "properties": { - "_tag": { - "type": "string", - "enum": ["FormAlreadySettledError"] - }, - "id": { - "type": "string" - }, - "message": { - "type": "string" - } - }, - "required": ["_tag", "id", "message"], - "additionalProperties": false - }, - "FormInvalidAnswerError": { - "type": "object", - "properties": { - "_tag": { - "type": "string", - "enum": ["FormInvalidAnswerError"] - }, - "id": { - "type": "string" - }, - "message": { - "type": "string" - } - }, - "required": ["_tag", "id", "message"], - "additionalProperties": false - }, - "PermissionV2.Source": { - "anyOf": [ - { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["tool"] - }, - "messageID": { - "type": "string" - }, - "callID": { - "type": "string" - } - }, - "required": ["type", "messageID", "callID"], - "additionalProperties": false - } - ] - }, - "PermissionV2.Request": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^per" - } - ] - }, - "sessionID": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "action": { - "type": "string" - }, - "resources": { - "type": "array", - "items": { - "type": "string" - } - }, - "save": { - "type": "array", - "items": { - "type": "string" - } - }, - "metadata": { - "type": "object" - }, - "source": { - "$ref": "#/components/schemas/PermissionV2.Source" - } - }, - "required": ["id", "sessionID", "action", "resources"], - "additionalProperties": false - }, - "PermissionSaved.Info": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "projectID": { - "type": "string" - }, - "action": { - "type": "string" - }, - "resource": { - "type": "string" - } - }, - "required": ["id", "projectID", "action", "resource"], - "additionalProperties": false - }, - "PermissionNotFoundError": { - "type": "object", - "properties": { - "_tag": { - "type": "string", - "enum": ["PermissionNotFoundError"] - }, - "requestID": { - "type": "string" - }, - "message": { - "type": "string" - } - }, - "required": ["_tag", "requestID", "message"], - "additionalProperties": false - }, - "PermissionV2.Reply": { - "type": "string", - "enum": ["once", "always", "reject"] - }, - "FileSystem.Entry": { - "type": "object", - "properties": { - "path": { - "type": "string" - }, - "type": { - "type": "string", - "enum": ["file", "directory"] - } - }, - "required": ["path", "type"], - "additionalProperties": false - }, - "Command.Info": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "template": { - "type": "string" - }, - "description": { - "type": "string" - }, - "agent": { - "type": "string" - }, - "model": { - "$ref": "#/components/schemas/Model.Ref" - }, - "subtask": { - "type": "boolean" - } - }, - "required": ["name", "template"], - "additionalProperties": false - }, - "Skill.Info": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "slash": { - "type": "boolean" - }, - "autoinvoke": { - "type": "boolean" - }, - "location": { - "type": "string" - }, - "content": { - "type": "string" - } - }, - "required": ["id", "name", "location", "content"], - "additionalProperties": false - }, - "models-dev.refreshed": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^evt_" - } - ] - }, - "created": { - "type": "number" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["models-dev.refreshed"] - }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, - "data": { - "anyOf": [ - { - "type": "object" - }, - { - "type": "array" - } - ] - } - }, - "required": ["id", "created", "type", "data"], - "additionalProperties": false - }, - "integration.updated": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^evt_" - } - ] - }, - "created": { - "type": "number" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["integration.updated"] - }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, - "data": { - "anyOf": [ - { - "type": "object" - }, - { - "type": "array" - } - ] - } - }, - "required": ["id", "created", "type", "data"], - "additionalProperties": false - }, - "integration.connection.updated": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^evt_" - } - ] - }, - "created": { - "type": "number" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["integration.connection.updated"] - }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, - "data": { - "type": "object", - "properties": { - "integrationID": { - "type": "string" - } - }, - "required": ["integrationID"], - "additionalProperties": false - } - }, - "required": ["id", "created", "type", "data"], - "additionalProperties": false - }, - "catalog.updated": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^evt_" - } - ] - }, - "created": { - "type": "number" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["catalog.updated"] - }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, - "data": { - "anyOf": [ - { - "type": "object" - }, - { - "type": "array" - } - ] - } - }, - "required": ["id", "created", "type", "data"], - "additionalProperties": false - }, - "agent.updated": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^evt_" - } - ] - }, - "created": { - "type": "number" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["agent.updated"] - }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, - "data": { - "anyOf": [ - { - "type": "object" - }, - { - "type": "array" - } - ] - } - }, - "required": ["id", "created", "type", "data"], - "additionalProperties": false - }, - "FileDiff.LegacyInfo": { - "type": "object", - "properties": { - "file": { - "type": "string" - }, - "patch": { - "type": "string" - }, - "additions": { - "type": "number" - }, - "deletions": { - "type": "number" - }, - "status": { - "type": "string", - "enum": ["added", "deleted", "modified"] - } - }, - "required": ["additions", "deletions"], - "additionalProperties": false - }, - "PermissionAction": { - "type": "string", - "enum": ["allow", "deny", "ask"] - }, - "PermissionRule": { - "type": "object", - "properties": { - "permission": { - "type": "string" - }, - "pattern": { - "type": "string" - }, - "action": { - "$ref": "#/components/schemas/PermissionAction" - } - }, - "required": ["permission", "pattern", "action"], - "additionalProperties": false - }, - "PermissionRuleset": { - "type": "array", - "items": { - "$ref": "#/components/schemas/PermissionRule" - } - }, - "SessionV1.Info": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "slug": { - "type": "string" - }, - "projectID": { - "type": "string" - }, - "workspaceID": { - "type": "string", - "allOf": [ - { - "pattern": "^wrk" - } - ] - }, - "directory": { - "type": "string" - }, - "path": { - "type": "string" - }, - "parentID": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "summary": { - "type": "object", - "properties": { - "additions": { - "type": "number" - }, - "deletions": { - "type": "number" - }, - "files": { - "type": "number" - }, - "diffs": { - "type": "array", - "items": { - "$ref": "#/components/schemas/FileDiff.LegacyInfo" - } - } - }, - "required": ["additions", "deletions", "files"], - "additionalProperties": false - }, - "cost": { - "type": "number" - }, - "tokens": { - "type": "object", - "properties": { - "input": { - "type": "number" - }, - "output": { - "type": "number" - }, - "reasoning": { - "type": "number" - }, - "cache": { - "type": "object", - "properties": { - "read": { - "type": "number" - }, - "write": { - "type": "number" - } - }, - "required": ["read", "write"], - "additionalProperties": false - } - }, - "required": ["input", "output", "reasoning", "cache"], - "additionalProperties": false - }, - "share": { - "type": "object", - "properties": { - "url": { - "type": "string" - } - }, - "required": ["url"], - "additionalProperties": false - }, - "title": { - "type": "string" - }, - "agent": { - "type": "string" - }, - "model": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "providerID": { - "type": "string" - }, - "variant": { - "type": "string" - } - }, - "required": ["id", "providerID"], - "additionalProperties": false - }, - "version": { - "type": "string" - }, - "metadata": { - "type": "object" - }, - "time": { - "type": "object", - "properties": { - "created": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - "updated": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - "compacting": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - "archived": { - "type": "number" - } - }, - "required": ["created", "updated"], - "additionalProperties": false - }, - "permission": { - "$ref": "#/components/schemas/PermissionRuleset" - }, - "revert": { - "type": "object", - "properties": { - "messageID": { - "type": "string", - "allOf": [ - { - "pattern": "^msg" - } - ] - }, - "partID": { - "type": "string", - "allOf": [ - { - "pattern": "^prt" - } - ] - }, - "snapshot": { - "type": "string" - }, - "diff": { - "type": "string" - } - }, - "required": ["messageID"], - "additionalProperties": false - } - }, - "required": ["id", "slug", "projectID", "directory", "title", "version", "time"], - "additionalProperties": false - }, - "session.created": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^evt_" - } - ] - }, - "created": { - "type": "number" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["session.created"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - "version": { - "type": "number", - "enum": [1] - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, - "data": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "info": { - "$ref": "#/components/schemas/SessionV1.Info" - } - }, - "required": ["sessionID", "info"], - "additionalProperties": false - } - }, - "required": ["id", "created", "type", "durable", "data"], - "additionalProperties": false - }, - "session.updated": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^evt_" - } - ] - }, - "created": { - "type": "number" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["session.updated"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - "version": { - "type": "number", - "enum": [1] - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, - "data": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "info": { - "$ref": "#/components/schemas/SessionV1.Info" - } - }, - "required": ["sessionID", "info"], - "additionalProperties": false - } - }, - "required": ["id", "created", "type", "durable", "data"], - "additionalProperties": false - }, - "session.deleted1": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^evt_" - } - ] - }, - "created": { - "type": "number" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["session.deleted"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - "version": { - "type": "number", - "enum": [1] - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, - "data": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "info": { - "$ref": "#/components/schemas/SessionV1.Info" - } - }, - "required": ["sessionID", "info"], - "additionalProperties": false - } - }, - "required": ["id", "created", "type", "durable", "data"], - "additionalProperties": false - }, - "JSONSchema": { - "type": "object" - }, - "OutputFormat": { - "anyOf": [ - { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["text"] - } - }, - "required": ["type"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["json_schema"] - }, - "schema": { - "$ref": "#/components/schemas/JSONSchema" - }, - "retryCount": { - "anyOf": [ - { - "anyOf": [ - { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - { - "type": "null" - } - ] - }, - { - "type": "null" - } - ] - } - }, - "required": ["type", "schema"], - "additionalProperties": false - } - ] - }, - "UserMessage": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^msg" - } - ] - }, - "sessionID": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "role": { - "type": "string", - "enum": ["user"] - }, - "time": { - "type": "object", - "properties": { - "created": { - "type": "number", - "allOf": [ - { - "minimum": 0 - } - ] - } - }, - "required": ["created"], - "additionalProperties": false - }, - "format": { - "anyOf": [ - { - "$ref": "#/components/schemas/OutputFormat" - }, - { - "type": "null" - } - ] - }, - "summary": { - "anyOf": [ - { - "type": "object", - "properties": { - "title": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "body": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "diffs": { - "type": "array", - "items": { - "$ref": "#/components/schemas/FileDiff.LegacyInfo" - } - } - }, - "required": ["diffs"], - "additionalProperties": false - }, - { - "type": "null" - } - ] - }, - "agent": { - "type": "string" - }, - "model": { - "type": "object", - "properties": { - "providerID": { - "type": "string" - }, - "modelID": { - "type": "string" - }, - "variant": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - }, - "required": ["providerID", "modelID"], - "additionalProperties": false - }, - "system": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "tools": { - "anyOf": [ - { - "type": "object", - "additionalProperties": { - "type": "boolean" - } - }, - { - "type": "null" - } - ] - } - }, - "required": ["id", "sessionID", "role", "time", "agent", "model"], - "additionalProperties": false - }, - "ProviderAuthError": { - "type": "object", - "properties": { - "name": { - "type": "string", - "enum": ["ProviderAuthError"] - }, - "data": { - "type": "object", - "properties": { - "providerID": { - "type": "string" - }, - "message": { - "type": "string" - } - }, - "required": ["providerID", "message"], - "additionalProperties": false - } - }, - "required": ["name", "data"], - "additionalProperties": false - }, - "UnknownError1": { - "type": "object", - "properties": { - "name": { - "type": "string", - "enum": ["UnknownError"] - }, - "data": { - "type": "object", - "properties": { - "message": { - "type": "string" - }, - "ref": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - }, - "required": ["message"], - "additionalProperties": false - } - }, - "required": ["name", "data"], - "additionalProperties": false - }, - "MessageOutputLengthError": { - "type": "object", - "properties": { - "name": { - "type": "string", - "enum": ["MessageOutputLengthError"] - }, - "data": { - "anyOf": [ - { - "type": "object" - }, - { - "type": "array" - } - ] - } - }, - "required": ["name", "data"], - "additionalProperties": false - }, - "MessageAbortedError": { - "type": "object", - "properties": { - "name": { - "type": "string", - "enum": ["MessageAbortedError"] - }, - "data": { - "type": "object", - "properties": { - "message": { - "type": "string" - } - }, - "required": ["message"], - "additionalProperties": false - } - }, - "required": ["name", "data"], - "additionalProperties": false - }, - "StructuredOutputError": { - "type": "object", - "properties": { - "name": { - "type": "string", - "enum": ["StructuredOutputError"] - }, - "data": { - "type": "object", - "properties": { - "message": { - "type": "string" - }, - "retries": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - } - }, - "required": ["message", "retries"], - "additionalProperties": false - } - }, - "required": ["name", "data"], - "additionalProperties": false - }, - "ContextOverflowError": { - "type": "object", - "properties": { - "name": { - "type": "string", - "enum": ["ContextOverflowError"] - }, - "data": { - "type": "object", - "properties": { - "message": { - "type": "string" - }, - "responseBody": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - }, - "required": ["message"], - "additionalProperties": false - } - }, - "required": ["name", "data"], - "additionalProperties": false - }, - "ContentFilterError": { - "type": "object", - "properties": { - "name": { - "type": "string", - "enum": ["ContentFilterError"] - }, - "data": { - "type": "object", - "properties": { - "message": { - "type": "string" - } - }, - "required": ["message"], - "additionalProperties": false - } - }, - "required": ["name", "data"], - "additionalProperties": false - }, - "APIError": { - "type": "object", - "properties": { - "name": { - "type": "string", - "enum": ["APIError"] - }, - "data": { - "type": "object", - "properties": { - "message": { - "type": "string" - }, - "statusCode": { - "anyOf": [ - { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - { - "type": "null" - } - ] - }, - "isRetryable": { - "type": "boolean" - }, - "responseHeaders": { - "anyOf": [ - { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - { - "type": "null" - } - ] - }, - "responseBody": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "metadata": { - "anyOf": [ - { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - { - "type": "null" - } - ] - } - }, - "required": ["message", "isRetryable"], - "additionalProperties": false - } - }, - "required": ["name", "data"], - "additionalProperties": false - }, - "AssistantMessage": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^msg" - } - ] - }, - "sessionID": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "role": { - "type": "string", - "enum": ["assistant"] - }, - "time": { - "type": "object", - "properties": { - "created": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - "completed": { - "anyOf": [ - { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - { - "type": "null" - } - ] - } - }, - "required": ["created"], - "additionalProperties": false - }, - "error": { - "anyOf": [ - { - "anyOf": [ - { - "$ref": "#/components/schemas/ProviderAuthError" - }, - { - "$ref": "#/components/schemas/UnknownError1" - }, - { - "$ref": "#/components/schemas/MessageOutputLengthError" - }, - { - "$ref": "#/components/schemas/MessageAbortedError" - }, - { - "$ref": "#/components/schemas/StructuredOutputError" - }, - { - "$ref": "#/components/schemas/ContextOverflowError" - }, - { - "$ref": "#/components/schemas/ContentFilterError" - }, - { - "$ref": "#/components/schemas/APIError" - } - ] - }, - { - "type": "null" - } - ] - }, - "parentID": { - "type": "string", - "allOf": [ - { - "pattern": "^msg" - } - ] - }, - "modelID": { - "type": "string" - }, - "providerID": { - "type": "string" - }, - "mode": { - "type": "string" - }, - "agent": { - "type": "string" - }, - "path": { - "type": "object", - "properties": { - "cwd": { - "type": "string" - }, - "root": { - "type": "string" - } - }, - "required": ["cwd", "root"], - "additionalProperties": false - }, - "summary": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ] - }, - "cost": { - "type": "number" - }, - "tokens": { - "type": "object", - "properties": { - "total": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ] - }, - "input": { - "type": "number" - }, - "output": { - "type": "number" - }, - "reasoning": { - "type": "number" - }, - "cache": { - "type": "object", - "properties": { - "read": { - "type": "number" - }, - "write": { - "type": "number" - } - }, - "required": ["read", "write"], - "additionalProperties": false - } - }, - "required": ["input", "output", "reasoning", "cache"], - "additionalProperties": false - }, - "structured": { - "anyOf": [ - {}, - { - "type": "null" - } - ] - }, - "variant": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "finish": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - }, - "required": [ - "id", - "sessionID", - "role", - "time", - "parentID", - "modelID", - "providerID", - "mode", - "agent", - "path", - "cost", - "tokens" - ], - "additionalProperties": false - }, - "Message": { - "anyOf": [ - { - "$ref": "#/components/schemas/UserMessage" - }, - { - "$ref": "#/components/schemas/AssistantMessage" - } - ] - }, - "message.updated": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^evt_" - } - ] - }, - "created": { - "type": "number" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["message.updated"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - "version": { - "type": "number", - "enum": [1] - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, - "data": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "info": { - "$ref": "#/components/schemas/Message" - } - }, - "required": ["sessionID", "info"], - "additionalProperties": false - } - }, - "required": ["id", "created", "type", "durable", "data"], - "additionalProperties": false - }, - "message.removed": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^evt_" - } - ] - }, - "created": { - "type": "number" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["message.removed"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - "version": { - "type": "number", - "enum": [1] - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, - "data": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "messageID": { - "type": "string", - "allOf": [ - { - "pattern": "^msg" - } - ] - } - }, - "required": ["sessionID", "messageID"], - "additionalProperties": false - } - }, - "required": ["id", "created", "type", "durable", "data"], - "additionalProperties": false - }, - "TextPart": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^prt" - } - ] - }, - "sessionID": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "messageID": { - "type": "string", - "allOf": [ - { - "pattern": "^msg" - } - ] - }, - "type": { - "type": "string", - "enum": ["text"] - }, - "text": { - "type": "string" - }, - "synthetic": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ] - }, - "ignored": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ] - }, - "time": { - "anyOf": [ - { - "type": "object", - "properties": { - "start": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - "end": { - "anyOf": [ - { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - { - "type": "null" - } - ] - } - }, - "required": ["start"], - "additionalProperties": false - }, - { - "type": "null" - } - ] - }, - "metadata": { - "anyOf": [ - { - "type": "object" - }, - { - "type": "null" - } - ] - } - }, - "required": ["id", "sessionID", "messageID", "type", "text"], - "additionalProperties": false - }, - "SubtaskPart": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^prt" - } - ] - }, - "sessionID": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "messageID": { - "type": "string", - "allOf": [ - { - "pattern": "^msg" - } - ] - }, - "type": { - "type": "string", - "enum": ["subtask"] - }, - "prompt": { - "type": "string" - }, - "description": { - "type": "string" - }, - "agent": { - "type": "string" - }, - "model": { - "anyOf": [ - { - "type": "object", - "properties": { - "providerID": { - "type": "string" - }, - "modelID": { - "type": "string" - } - }, - "required": ["providerID", "modelID"], - "additionalProperties": false - }, - { - "type": "null" - } - ] - }, - "command": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - }, - "required": ["id", "sessionID", "messageID", "type", "prompt", "description", "agent"], - "additionalProperties": false - }, - "ReasoningPart": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^prt" - } - ] - }, - "sessionID": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "messageID": { - "type": "string", - "allOf": [ - { - "pattern": "^msg" - } - ] - }, - "type": { - "type": "string", - "enum": ["reasoning"] - }, - "text": { - "type": "string" - }, - "metadata": { - "anyOf": [ - { - "type": "object" - }, - { - "type": "null" - } - ] - }, - "time": { - "type": "object", - "properties": { - "start": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - "end": { - "anyOf": [ - { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - { - "type": "null" - } - ] - } - }, - "required": ["start"], - "additionalProperties": false - } - }, - "required": ["id", "sessionID", "messageID", "type", "text", "time"], - "additionalProperties": false - }, - "FilePartSourceText": { - "type": "object", - "properties": { - "value": { - "type": "string" - }, - "start": { - "type": "number" - }, - "end": { - "type": "number" - } - }, - "required": ["value", "start", "end"], - "additionalProperties": false - }, - "FileSource": { - "type": "object", - "properties": { - "text": { - "$ref": "#/components/schemas/FilePartSourceText" - }, - "type": { - "type": "string", - "enum": ["file"] - }, - "path": { - "type": "string" - } - }, - "required": ["text", "type", "path"], - "additionalProperties": false - }, - "Range": { - "type": "object", - "properties": { - "start": { - "type": "object", - "properties": { - "line": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - "character": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - } - }, - "required": ["line", "character"], - "additionalProperties": false - }, - "end": { - "type": "object", - "properties": { - "line": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - "character": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - } - }, - "required": ["line", "character"], - "additionalProperties": false - } - }, - "required": ["start", "end"], - "additionalProperties": false - }, - "SymbolSource": { - "type": "object", - "properties": { - "text": { - "$ref": "#/components/schemas/FilePartSourceText" - }, - "type": { - "type": "string", - "enum": ["symbol"] - }, - "path": { - "type": "string" - }, - "range": { - "$ref": "#/components/schemas/Range" - }, - "name": { - "type": "string" - }, - "kind": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - } - }, - "required": ["text", "type", "path", "range", "name", "kind"], - "additionalProperties": false - }, - "ResourceSource": { - "type": "object", - "properties": { - "text": { - "$ref": "#/components/schemas/FilePartSourceText" - }, - "type": { - "type": "string", - "enum": ["resource"] - }, - "clientName": { - "type": "string" - }, - "uri": { - "type": "string" - } - }, - "required": ["text", "type", "clientName", "uri"], - "additionalProperties": false - }, - "FilePartSource": { - "anyOf": [ - { - "$ref": "#/components/schemas/FileSource" - }, - { - "$ref": "#/components/schemas/SymbolSource" - }, - { - "$ref": "#/components/schemas/ResourceSource" - } - ] - }, - "FilePart": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^prt" - } - ] - }, - "sessionID": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "messageID": { - "type": "string", - "allOf": [ - { - "pattern": "^msg" - } - ] - }, - "type": { - "type": "string", - "enum": ["file"] - }, - "mime": { - "type": "string" - }, - "filename": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "url": { - "type": "string" - }, - "source": { - "anyOf": [ - { - "$ref": "#/components/schemas/FilePartSource" - }, - { - "type": "null" - } - ] - } - }, - "required": ["id", "sessionID", "messageID", "type", "mime", "url"], - "additionalProperties": false - }, - "ToolStatePending": { - "type": "object", - "properties": { - "status": { - "type": "string", - "enum": ["pending"] - }, - "input": { - "type": "object" - }, - "raw": { - "type": "string" - } - }, - "required": ["status", "input", "raw"], - "additionalProperties": false - }, - "ToolStateRunning": { - "type": "object", - "properties": { - "status": { - "type": "string", - "enum": ["running"] - }, - "input": { - "type": "object" - }, - "title": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "metadata": { - "anyOf": [ - { - "type": "object" - }, - { - "type": "null" - } - ] - }, - "time": { - "type": "object", - "properties": { - "start": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - } - }, - "required": ["start"], - "additionalProperties": false - } - }, - "required": ["status", "input", "time"], - "additionalProperties": false - }, - "ToolStateCompleted": { - "type": "object", - "properties": { - "status": { - "type": "string", - "enum": ["completed"] - }, - "input": { - "type": "object" - }, - "output": { - "type": "string" - }, - "title": { - "type": "string" - }, - "metadata": { - "type": "object" - }, - "time": { - "type": "object", - "properties": { - "start": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - "end": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - "compacted": { - "anyOf": [ - { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - { - "type": "null" - } - ] - } - }, - "required": ["start", "end"], - "additionalProperties": false - }, - "attachments": { - "anyOf": [ - { - "type": "array", - "items": { - "$ref": "#/components/schemas/FilePart" - } - }, - { - "type": "null" - } - ] - } - }, - "required": ["status", "input", "output", "title", "metadata", "time"], - "additionalProperties": false - }, - "ToolStateError": { - "type": "object", - "properties": { - "status": { - "type": "string", - "enum": ["error"] - }, - "input": { - "type": "object" - }, - "error": { - "type": "string" - }, - "metadata": { - "anyOf": [ - { - "type": "object" - }, - { - "type": "null" - } - ] - }, - "time": { - "type": "object", - "properties": { - "start": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - "end": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - } - }, - "required": ["start", "end"], - "additionalProperties": false - } - }, - "required": ["status", "input", "error", "time"], - "additionalProperties": false - }, - "ToolState": { - "anyOf": [ - { - "$ref": "#/components/schemas/ToolStatePending" - }, - { - "$ref": "#/components/schemas/ToolStateRunning" - }, - { - "$ref": "#/components/schemas/ToolStateCompleted" - }, - { - "$ref": "#/components/schemas/ToolStateError" - } - ] - }, - "ToolPart": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^prt" - } - ] - }, - "sessionID": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "messageID": { - "type": "string", - "allOf": [ - { - "pattern": "^msg" - } - ] - }, - "type": { - "type": "string", - "enum": ["tool"] - }, - "callID": { - "type": "string" - }, - "tool": { - "type": "string" - }, - "state": { - "$ref": "#/components/schemas/ToolState" - }, - "metadata": { - "anyOf": [ - { - "type": "object" - }, - { - "type": "null" - } - ] - } - }, - "required": ["id", "sessionID", "messageID", "type", "callID", "tool", "state"], - "additionalProperties": false - }, - "StepStartPart": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^prt" - } - ] - }, - "sessionID": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "messageID": { - "type": "string", - "allOf": [ - { - "pattern": "^msg" - } - ] - }, - "type": { - "type": "string", - "enum": ["step-start"] - }, - "snapshot": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - }, - "required": ["id", "sessionID", "messageID", "type"], - "additionalProperties": false - }, - "StepFinishPart": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^prt" - } - ] - }, - "sessionID": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "messageID": { - "type": "string", - "allOf": [ - { - "pattern": "^msg" - } - ] - }, - "type": { - "type": "string", - "enum": ["step-finish"] - }, - "reason": { - "type": "string" - }, - "snapshot": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "cost": { - "type": "number" - }, - "tokens": { - "type": "object", - "properties": { - "total": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ] - }, - "input": { - "type": "number" - }, - "output": { - "type": "number" - }, - "reasoning": { - "type": "number" - }, - "cache": { - "type": "object", - "properties": { - "read": { - "type": "number" - }, - "write": { - "type": "number" - } - }, - "required": ["read", "write"], - "additionalProperties": false - } - }, - "required": ["input", "output", "reasoning", "cache"], - "additionalProperties": false - } - }, - "required": ["id", "sessionID", "messageID", "type", "reason", "cost", "tokens"], - "additionalProperties": false - }, - "SnapshotPart": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^prt" - } - ] - }, - "sessionID": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "messageID": { - "type": "string", - "allOf": [ - { - "pattern": "^msg" - } - ] - }, - "type": { - "type": "string", - "enum": ["snapshot"] - }, - "snapshot": { - "type": "string" - } - }, - "required": ["id", "sessionID", "messageID", "type", "snapshot"], - "additionalProperties": false - }, - "PatchPart": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^prt" - } - ] - }, - "sessionID": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "messageID": { - "type": "string", - "allOf": [ - { - "pattern": "^msg" - } - ] - }, - "type": { - "type": "string", - "enum": ["patch"] - }, - "hash": { - "type": "string" - }, - "files": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": ["id", "sessionID", "messageID", "type", "hash", "files"], - "additionalProperties": false - }, - "AgentPart": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^prt" - } - ] - }, - "sessionID": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "messageID": { - "type": "string", - "allOf": [ - { - "pattern": "^msg" - } - ] - }, - "type": { - "type": "string", - "enum": ["agent"] - }, - "name": { - "type": "string" - }, - "source": { - "anyOf": [ - { - "type": "object", - "properties": { - "value": { - "type": "string" - }, - "start": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - "end": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - } - }, - "required": ["value", "start", "end"], - "additionalProperties": false - }, - { - "type": "null" - } - ] - } - }, - "required": ["id", "sessionID", "messageID", "type", "name"], - "additionalProperties": false - }, - "RetryPart": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^prt" - } - ] - }, - "sessionID": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "messageID": { - "type": "string", - "allOf": [ - { - "pattern": "^msg" - } - ] - }, - "type": { - "type": "string", - "enum": ["retry"] - }, - "attempt": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - "error": { - "$ref": "#/components/schemas/APIError" - }, - "time": { - "type": "object", - "properties": { - "created": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - } - }, - "required": ["created"], - "additionalProperties": false - } - }, - "required": ["id", "sessionID", "messageID", "type", "attempt", "error", "time"], - "additionalProperties": false - }, - "CompactionPart": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^prt" - } - ] - }, - "sessionID": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "messageID": { - "type": "string", - "allOf": [ - { - "pattern": "^msg" - } - ] - }, - "type": { - "type": "string", - "enum": ["compaction"] - }, - "auto": { - "type": "boolean" - }, - "overflow": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ] - }, - "tail_start_id": { - "anyOf": [ - { - "type": "string", - "allOf": [ - { - "pattern": "^msg" - } - ] - }, - { - "type": "null" - } - ] - } - }, - "required": ["id", "sessionID", "messageID", "type", "auto"], - "additionalProperties": false - }, - "Part": { - "anyOf": [ - { - "$ref": "#/components/schemas/TextPart" - }, - { - "$ref": "#/components/schemas/SubtaskPart" - }, - { - "$ref": "#/components/schemas/ReasoningPart" - }, - { - "$ref": "#/components/schemas/FilePart" - }, - { - "$ref": "#/components/schemas/ToolPart" - }, - { - "$ref": "#/components/schemas/StepStartPart" - }, - { - "$ref": "#/components/schemas/StepFinishPart" - }, - { - "$ref": "#/components/schemas/SnapshotPart" - }, - { - "$ref": "#/components/schemas/PatchPart" - }, - { - "$ref": "#/components/schemas/AgentPart" - }, - { - "$ref": "#/components/schemas/RetryPart" - }, - { - "$ref": "#/components/schemas/CompactionPart" - } - ] - }, - "message.part.updated": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^evt_" - } - ] - }, - "created": { - "type": "number" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["message.part.updated"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - "version": { - "type": "number", - "enum": [1] - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, - "data": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "part": { - "$ref": "#/components/schemas/Part" - }, - "time": { - "type": "number" - } - }, - "required": ["sessionID", "part", "time"], - "additionalProperties": false - } - }, - "required": ["id", "created", "type", "durable", "data"], - "additionalProperties": false - }, - "message.part.removed": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^evt_" - } - ] - }, - "created": { - "type": "number" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["message.part.removed"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - "version": { - "type": "number", - "enum": [1] - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, - "data": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "messageID": { - "type": "string", - "allOf": [ - { - "pattern": "^msg" - } - ] - }, - "partID": { - "type": "string", - "allOf": [ - { - "pattern": "^prt" - } - ] - } - }, - "required": ["sessionID", "messageID", "partID"], - "additionalProperties": false - } - }, - "required": ["id", "created", "type", "durable", "data"], - "additionalProperties": false - }, - "session.usage.updated": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^evt_" - } - ] - }, - "created": { - "type": "number" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["session.usage.updated"] - }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, - "data": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "cost": { - "$ref": "#/components/schemas/Money.USD" - }, - "tokens": { - "$ref": "#/components/schemas/TokenUsage.Info" - } - }, - "required": ["sessionID", "cost", "tokens"], - "additionalProperties": false - } - }, - "required": ["id", "created", "type", "data"], - "additionalProperties": false - }, - "session.text.delta": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^evt_" - } - ] - }, - "created": { - "type": "number" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["session.text.delta"] - }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, - "data": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "assistantMessageID": { - "type": "string", - "allOf": [ - { - "pattern": "^msg_" - } - ] - }, - "ordinal": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - "delta": { - "type": "string" - } - }, - "required": ["sessionID", "assistantMessageID", "ordinal", "delta"], - "additionalProperties": false - } - }, - "required": ["id", "created", "type", "data"], - "additionalProperties": false - }, - "session.reasoning.delta": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^evt_" - } - ] - }, - "created": { - "type": "number" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["session.reasoning.delta"] - }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, - "data": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "assistantMessageID": { - "type": "string", - "allOf": [ - { - "pattern": "^msg_" - } - ] - }, - "ordinal": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - "delta": { - "type": "string" - } - }, - "required": ["sessionID", "assistantMessageID", "ordinal", "delta"], - "additionalProperties": false - } - }, - "required": ["id", "created", "type", "data"], - "additionalProperties": false - }, - "session.tool.input.delta": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^evt_" - } - ] - }, - "created": { - "type": "number" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["session.tool.input.delta"] - }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, - "data": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "assistantMessageID": { - "type": "string", - "allOf": [ - { - "pattern": "^msg_" - } - ] - }, - "callID": { - "type": "string" - }, - "delta": { - "type": "string" - } - }, - "required": ["sessionID", "assistantMessageID", "callID", "delta"], - "additionalProperties": false - } - }, - "required": ["id", "created", "type", "data"], - "additionalProperties": false - }, - "session.compaction.delta": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^evt_" - } - ] - }, - "created": { - "type": "number" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["session.compaction.delta"] - }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, - "data": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "text": { - "type": "string" - } - }, - "required": ["sessionID", "text"], - "additionalProperties": false - } - }, - "required": ["id", "created", "type", "data"], - "additionalProperties": false - }, - "filesystem.changed": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^evt_" - } - ] - }, - "created": { - "type": "number" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["filesystem.changed"] - }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, - "data": { - "type": "object", - "properties": { - "file": { - "type": "string" - }, - "event": { - "type": "string", - "enum": ["add", "change", "unlink"] - } - }, - "required": ["file", "event"], - "additionalProperties": false - } - }, - "required": ["id", "created", "type", "data"], - "additionalProperties": false - }, - "reference.updated": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^evt_" - } - ] - }, - "created": { - "type": "number" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["reference.updated"] - }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, - "data": { - "anyOf": [ - { - "type": "object" - }, - { - "type": "array" - } - ] - } - }, - "required": ["id", "created", "type", "data"], - "additionalProperties": false - }, - "permission.v2.asked": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^evt_" - } - ] - }, - "created": { - "type": "number" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["permission.v2.asked"] - }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^per" - } - ] - }, - "sessionID": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "action": { - "type": "string" - }, - "resources": { - "type": "array", - "items": { - "type": "string" - } - }, - "save": { - "type": "array", - "items": { - "type": "string" - } - }, - "metadata": { - "type": "object" - }, - "source": { - "$ref": "#/components/schemas/PermissionV2.Source" - } - }, - "required": ["id", "sessionID", "action", "resources"], - "additionalProperties": false - } - }, - "required": ["id", "created", "type", "data"], - "additionalProperties": false - }, - "permission.v2.replied": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^evt_" - } - ] - }, - "created": { - "type": "number" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["permission.v2.replied"] - }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, - "data": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "requestID": { - "type": "string", - "allOf": [ - { - "pattern": "^per" - } - ] - }, - "reply": { - "$ref": "#/components/schemas/PermissionV2.Reply" - } - }, - "required": ["sessionID", "requestID", "reply"], - "additionalProperties": false - } - }, - "required": ["id", "created", "type", "data"], - "additionalProperties": false - }, - "plugin.updated": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^evt_" - } - ] - }, - "created": { - "type": "number" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["plugin.updated"] - }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, - "data": { - "anyOf": [ - { - "type": "object" - }, - { - "type": "array" - } - ] - } - }, - "required": ["id", "created", "type", "data"], - "additionalProperties": false - }, - "project.directories.updated": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^evt_" - } - ] - }, - "created": { - "type": "number" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["project.directories.updated"] - }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, - "data": { - "type": "object", - "properties": { - "projectID": { - "type": "string" - } - }, - "required": ["projectID"], - "additionalProperties": false - } - }, - "required": ["id", "created", "type", "data"], - "additionalProperties": false - }, - "command.updated": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^evt_" - } - ] - }, - "created": { - "type": "number" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["command.updated"] - }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, - "data": { - "anyOf": [ - { - "type": "object" - }, - { - "type": "array" - } - ] - } - }, - "required": ["id", "created", "type", "data"], - "additionalProperties": false - }, - "config.updated": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^evt_" - } - ] - }, - "created": { - "type": "number" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["config.updated"] - }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, - "data": { - "anyOf": [ - { - "type": "object" - }, - { - "type": "array" - } - ] - } - }, - "required": ["id", "created", "type", "data"], - "additionalProperties": false - }, - "skill.updated": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^evt_" - } - ] - }, - "created": { - "type": "number" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["skill.updated"] - }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, - "data": { - "anyOf": [ - { - "type": "object" - }, - { - "type": "array" - } - ] - } - }, - "required": ["id", "created", "type", "data"], - "additionalProperties": false - }, - "Pty": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^pty" - } - ] - }, - "title": { - "type": "string" - }, - "command": { - "type": "string" - }, - "args": { - "type": "array", - "items": { - "type": "string" - } - }, - "cwd": { - "type": "string" - }, - "status": { - "type": "string", - "enum": ["running", "exited"] - }, - "pid": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - "exitCode": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - } - }, - "required": ["id", "title", "command", "args", "cwd", "status", "pid"], - "additionalProperties": false - }, - "pty.created": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^evt_" - } - ] - }, - "created": { - "type": "number" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["pty.created"] - }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, - "data": { - "type": "object", - "properties": { - "info": { - "$ref": "#/components/schemas/Pty" - } - }, - "required": ["info"], - "additionalProperties": false - } - }, - "required": ["id", "created", "type", "data"], - "additionalProperties": false - }, - "pty.updated": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^evt_" - } - ] - }, - "created": { - "type": "number" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["pty.updated"] - }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, - "data": { - "type": "object", - "properties": { - "info": { - "$ref": "#/components/schemas/Pty" - } - }, - "required": ["info"], - "additionalProperties": false - } - }, - "required": ["id", "created", "type", "data"], - "additionalProperties": false - }, - "pty.exited": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^evt_" - } - ] - }, - "created": { - "type": "number" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["pty.exited"] - }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^pty" - } - ] - }, - "exitCode": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - } - }, - "required": ["id", "exitCode"], - "additionalProperties": false - } - }, - "required": ["id", "created", "type", "data"], - "additionalProperties": false - }, - "pty.deleted": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^evt_" - } - ] - }, - "created": { - "type": "number" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["pty.deleted"] - }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^pty" - } - ] - } - }, - "required": ["id"], - "additionalProperties": false - } - }, - "required": ["id", "created", "type", "data"], - "additionalProperties": false - }, - "shell.created": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^evt_" - } - ] - }, - "created": { - "type": "number" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["shell.created"] - }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, - "data": { - "type": "object", - "properties": { - "info": { - "$ref": "#/components/schemas/Shell" - } - }, - "required": ["info"], - "additionalProperties": false - } - }, - "required": ["id", "created", "type", "data"], - "additionalProperties": false - }, - "shell.exited": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^evt_" - } - ] - }, - "created": { - "type": "number" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["shell.exited"] - }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^sh_" - } - ] - }, - "exit": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "string", - "enum": ["NaN"] - }, - { - "type": "string", - "enum": ["Infinity"] - }, - { - "type": "string", - "enum": ["-Infinity"] - } - ] - }, - "status": { - "type": "string", - "enum": ["running", "exited", "timeout", "killed"] - } - }, - "required": ["id", "status"], - "additionalProperties": false - } - }, - "required": ["id", "created", "type", "data"], - "additionalProperties": false - }, - "shell.deleted": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^evt_" - } - ] - }, - "created": { - "type": "number" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["shell.deleted"] - }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^sh_" - } - ] - } - }, - "required": ["id"], - "additionalProperties": false - } - }, - "required": ["id", "created", "type", "data"], - "additionalProperties": false - }, - "QuestionV2.Option": { - "type": "object", - "properties": { - "label": { - "type": "string", - "description": "Display text (1-5 words, concise)" - }, - "description": { - "type": "string", - "description": "Explanation of choice" - } - }, - "required": ["label", "description"], - "additionalProperties": false - }, - "QuestionV2.Info": { - "type": "object", - "properties": { - "question": { - "type": "string", - "description": "Complete question" - }, - "header": { - "type": "string", - "description": "Very short label (max 30 chars)" - }, - "options": { - "type": "array", - "items": { - "$ref": "#/components/schemas/QuestionV2.Option" - }, - "description": "Available choices" - }, - "multiple": { - "type": "boolean" - }, - "custom": { - "type": "boolean" - } - }, - "required": ["question", "header", "options"], - "additionalProperties": false - }, - "QuestionV2.Tool": { - "type": "object", - "properties": { - "messageID": { - "type": "string" - }, - "callID": { - "type": "string" - } - }, - "required": ["messageID", "callID"], - "additionalProperties": false - }, - "question.v2.asked": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^evt_" - } - ] - }, - "created": { - "type": "number" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["question.v2.asked"] - }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^que" - } - ] - }, - "sessionID": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "questions": { - "type": "array", - "items": { - "$ref": "#/components/schemas/QuestionV2.Info" - }, - "description": "Questions to ask" - }, - "tool": { - "$ref": "#/components/schemas/QuestionV2.Tool" - } - }, - "required": ["id", "sessionID", "questions"], - "additionalProperties": false - } - }, - "required": ["id", "created", "type", "data"], - "additionalProperties": false - }, - "QuestionV2.Answer": { - "type": "array", - "items": { - "type": "string" - } - }, - "question.v2.replied": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^evt_" - } - ] - }, - "created": { - "type": "number" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["question.v2.replied"] - }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, - "data": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "requestID": { - "type": "string", - "allOf": [ - { - "pattern": "^que" - } - ] - }, - "answers": { - "type": "array", - "items": { - "$ref": "#/components/schemas/QuestionV2.Answer" - } - } - }, - "required": ["sessionID", "requestID", "answers"], - "additionalProperties": false - } - }, - "required": ["id", "created", "type", "data"], - "additionalProperties": false - }, - "question.v2.rejected": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^evt_" - } - ] - }, - "created": { - "type": "number" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["question.v2.rejected"] - }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, - "data": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "requestID": { - "type": "string", - "allOf": [ - { - "pattern": "^que" - } - ] - } - }, - "required": ["sessionID", "requestID"], - "additionalProperties": false - } - }, - "required": ["id", "created", "type", "data"], - "additionalProperties": false - }, - "Form.Metadata1": { - "type": "object" - }, - "Form.When1": { - "type": "object", - "properties": { - "key": { - "type": "string" - }, - "op": { - "type": "string", - "enum": ["eq", "neq"] - }, - "value": { - "anyOf": [ - { - "type": "string" - }, - { - "anyOf": [ - { - "type": "number" - }, - { - "type": "string", - "enum": ["NaN"] - }, - { - "type": "string", - "enum": ["Infinity"] - }, - { - "type": "string", - "enum": ["-Infinity"] - } - ] - }, - { - "type": "boolean" - } - ] - } - }, - "required": ["key", "op", "value"], - "additionalProperties": false - }, - "Form.StringField1": { - "type": "object", - "properties": { - "key": { - "type": "string" - }, - "title": { - "type": "string" - }, - "description": { - "type": "string" - }, - "required": { - "type": "boolean" - }, - "when": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Form.When1" - } - }, - "type": { - "type": "string", - "enum": ["string"] - }, - "format": { - "type": "string", - "enum": ["email", "uri", "date", "date-time"] - }, - "minLength": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - "maxLength": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - "pattern": { - "type": "string" - }, - "placeholder": { - "type": "string" - }, - "default": { - "type": "string" - }, - "options": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Form.Option" - } - }, - "custom": { - "type": "boolean" - } - }, - "required": ["key", "type"], - "additionalProperties": false - }, - "Form.NumberField1": { - "type": "object", - "properties": { - "key": { - "type": "string" - }, - "title": { - "type": "string" - }, - "description": { - "type": "string" - }, - "required": { - "type": "boolean" - }, - "when": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Form.When1" - } - }, - "type": { - "type": "string", - "enum": ["number"] - }, - "minimum": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "string", - "enum": ["NaN"] - }, - { - "type": "string", - "enum": ["Infinity"] - }, - { - "type": "string", - "enum": ["-Infinity"] - } - ] - }, - "maximum": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "string", - "enum": ["NaN"] - }, - { - "type": "string", - "enum": ["Infinity"] - }, - { - "type": "string", - "enum": ["-Infinity"] - } - ] - }, - "default": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "string", - "enum": ["NaN"] - }, - { - "type": "string", - "enum": ["Infinity"] - }, - { - "type": "string", - "enum": ["-Infinity"] - } - ] - } - }, - "required": ["key", "type"], - "additionalProperties": false - }, - "Form.IntegerField1": { - "type": "object", - "properties": { - "key": { - "type": "string" - }, - "title": { - "type": "string" - }, - "description": { - "type": "string" - }, - "required": { - "type": "boolean" - }, - "when": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Form.When1" - } - }, - "type": { - "type": "string", - "enum": ["integer"] - }, - "minimum": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "string", - "enum": ["NaN"] - }, - { - "type": "string", - "enum": ["Infinity"] - }, - { - "type": "string", - "enum": ["-Infinity"] - } - ] - }, - "maximum": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "string", - "enum": ["NaN"] - }, - { - "type": "string", - "enum": ["Infinity"] - }, - { - "type": "string", - "enum": ["-Infinity"] - } - ] - }, - "default": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "string", - "enum": ["NaN"] - }, - { - "type": "string", - "enum": ["Infinity"] - }, - { - "type": "string", - "enum": ["-Infinity"] - } - ] - } - }, - "required": ["key", "type"], - "additionalProperties": false - }, - "Form.BooleanField1": { - "type": "object", - "properties": { - "key": { - "type": "string" - }, - "title": { - "type": "string" - }, - "description": { - "type": "string" - }, - "required": { - "type": "boolean" - }, - "when": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Form.When1" - } - }, - "type": { - "type": "string", - "enum": ["boolean"] - }, - "default": { - "type": "boolean" - } - }, - "required": ["key", "type"], - "additionalProperties": false - }, - "Form.MultiselectField1": { - "type": "object", - "properties": { - "key": { - "type": "string" - }, - "title": { - "type": "string" - }, - "description": { - "type": "string" - }, - "required": { - "type": "boolean" - }, - "when": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Form.When1" - } - }, - "type": { - "type": "string", - "enum": ["multiselect"] - }, - "options": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Form.Option" - } - }, - "minItems": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - "maxItems": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - "custom": { - "type": "boolean" - }, - "default": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": ["key", "type", "options"], - "additionalProperties": false - }, - "Form.FormInfo1": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^frm_" - } - ] - }, - "sessionID": { - "type": "string" - }, - "title": { - "type": "string" - }, - "metadata": { - "$ref": "#/components/schemas/Form.Metadata1" - }, - "mode": { - "type": "string", - "enum": ["form"] - }, - "fields": { - "type": "array", - "items": { - "anyOf": [ - { - "$ref": "#/components/schemas/Form.StringField1" - }, - { - "$ref": "#/components/schemas/Form.NumberField1" - }, - { - "$ref": "#/components/schemas/Form.IntegerField1" - }, - { - "$ref": "#/components/schemas/Form.BooleanField1" - }, - { - "$ref": "#/components/schemas/Form.MultiselectField1" - } - ] - } - } - }, - "required": ["id", "sessionID", "title", "mode", "fields"], - "additionalProperties": false - }, - "Form.UrlInfo1": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^frm_" - } - ] - }, - "sessionID": { - "type": "string" - }, - "title": { - "type": "string" - }, - "metadata": { - "$ref": "#/components/schemas/Form.Metadata1" - }, - "mode": { - "type": "string", - "enum": ["url"] - }, - "url": { - "type": "string" - } - }, - "required": ["id", "sessionID", "title", "mode", "url"], - "additionalProperties": false - }, - "form.created": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^evt_" - } - ] - }, - "created": { - "type": "number" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["form.created"] - }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, - "data": { - "type": "object", - "properties": { - "form": { - "anyOf": [ - { - "$ref": "#/components/schemas/Form.FormInfo1" - }, - { - "$ref": "#/components/schemas/Form.UrlInfo1" - } - ] - } - }, - "required": ["form"], - "additionalProperties": false - } - }, - "required": ["id", "created", "type", "data"], - "additionalProperties": false - }, - "Form.Value1": { - "anyOf": [ - { - "type": "string" - }, - { - "anyOf": [ - { - "type": "number" - }, - { - "type": "string", - "enum": ["NaN"] - }, - { - "type": "string", - "enum": ["Infinity"] - }, - { - "type": "string", - "enum": ["-Infinity"] - } - ] - }, - { - "type": "boolean" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - }, - "Form.Answer1": { - "type": "object", - "additionalProperties": { - "$ref": "#/components/schemas/Form.Value1" - } - }, - "form.replied": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^evt_" - } - ] - }, - "created": { - "type": "number" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["form.replied"] - }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^frm_" - } - ] - }, - "sessionID": { - "type": "string" - }, - "answer": { - "$ref": "#/components/schemas/Form.Answer1" - } - }, - "required": ["id", "sessionID", "answer"], - "additionalProperties": false - } - }, - "required": ["id", "created", "type", "data"], - "additionalProperties": false - }, - "form.cancelled": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^evt_" - } - ] - }, - "created": { - "type": "number" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["form.cancelled"] - }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^frm_" - } - ] - }, - "sessionID": { - "type": "string" - } - }, - "required": ["id", "sessionID"], - "additionalProperties": false - } - }, - "required": ["id", "created", "type", "data"], - "additionalProperties": false - }, - "SessionStatus": { - "anyOf": [ - { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["idle"] - } - }, - "required": ["type"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["retry"] - }, - "attempt": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - "message": { - "type": "string" - }, - "action": { - "type": "object", - "properties": { - "reason": { - "type": "string" - }, - "provider": { - "type": "string" - }, - "title": { - "type": "string" - }, - "message": { - "type": "string" - }, - "label": { - "type": "string" - }, - "link": { - "type": "string" - } - }, - "required": ["reason", "provider", "title", "message", "label"], - "additionalProperties": false - }, - "next": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - } - }, - "required": ["type", "attempt", "message", "next"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["busy"] - } - }, - "required": ["type"], - "additionalProperties": false - } - ] - }, - "session.status": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^evt_" - } - ] - }, - "created": { - "type": "number" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["session.status"] - }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, - "data": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "status": { - "$ref": "#/components/schemas/SessionStatus" - } - }, - "required": ["sessionID", "status"], - "additionalProperties": false - } - }, - "required": ["id", "created", "type", "data"], - "additionalProperties": false - }, - "session.idle": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^evt_" - } - ] - }, - "created": { - "type": "number" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["session.idle"] - }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, - "data": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - } - }, - "required": ["sessionID"], - "additionalProperties": false - } - }, - "required": ["id", "created", "type", "data"], - "additionalProperties": false - }, - "tui.prompt.append": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^evt_" - } - ] - }, - "created": { - "type": "number" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["tui.prompt.append"] - }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, - "data": { - "type": "object", - "properties": { - "text": { - "type": "string" - } - }, - "required": ["text"], - "additionalProperties": false - } - }, - "required": ["id", "created", "type", "data"], - "additionalProperties": false - }, - "tui.command.execute": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^evt_" - } - ] - }, - "created": { - "type": "number" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["tui.command.execute"] - }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, - "data": { - "type": "object", - "properties": { - "command": { - "anyOf": [ - { - "type": "string", - "enum": [ - "session.list", - "session.new", - "session.share", - "session.interrupt", - "session.background", - "session.compact", - "session.page.up", - "session.page.down", - "session.line.up", - "session.line.down", - "session.half.page.up", - "session.half.page.down", - "session.first", - "session.last", - "prompt.clear", - "prompt.submit", - "agent.cycle" - ] - }, - { - "type": "string" - } - ] - } - }, - "required": ["command"], - "additionalProperties": false - } - }, - "required": ["id", "created", "type", "data"], - "additionalProperties": false - }, - "tui.toast.show": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^evt_" - } - ] - }, - "created": { - "type": "number" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["tui.toast.show"] - }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, - "data": { - "type": "object", - "properties": { - "title": { - "type": "string" - }, - "message": { - "type": "string" - }, - "variant": { - "type": "string", - "enum": ["info", "success", "warning", "error"] - }, - "duration": { - "anyOf": [ - { - "type": "integer", - "allOf": [ - { - "exclusiveMinimum": 0 - } - ] - }, - { - "type": "null" - } - ] - } - }, - "required": ["message", "variant"], - "additionalProperties": false - } - }, - "required": ["id", "created", "type", "data"], - "additionalProperties": false - }, - "tui.session.select": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^evt_" - } - ] - }, - "created": { - "type": "number" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["tui.session.select"] - }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, - "data": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "allOf": [ - { - "pattern": "^ses", - "description": "Session ID to navigate to" - } - ] - } - }, - "required": ["sessionID"], - "additionalProperties": false - } - }, - "required": ["id", "created", "type", "data"], - "additionalProperties": false - }, - "installation.updated": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^evt_" - } - ] - }, - "created": { - "type": "number" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["installation.updated"] - }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, - "data": { - "type": "object", - "properties": { - "version": { - "type": "string" - } - }, - "required": ["version"], - "additionalProperties": false - } - }, - "required": ["id", "created", "type", "data"], - "additionalProperties": false - }, - "installation.update-available": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^evt_" - } - ] - }, - "created": { - "type": "number" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["installation.update-available"] - }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, - "data": { - "type": "object", - "properties": { - "version": { - "type": "string" - } - }, - "required": ["version"], - "additionalProperties": false - } - }, - "required": ["id", "created", "type", "data"], - "additionalProperties": false - }, - "vcs.branch.updated": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^evt_" - } - ] - }, - "created": { - "type": "number" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["vcs.branch.updated"] - }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, - "data": { - "type": "object", - "properties": { - "branch": { - "type": "string" - } - }, - "additionalProperties": false - } - }, - "required": ["id", "created", "type", "data"], - "additionalProperties": false - }, - "mcp.status.changed": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^evt_" - } - ] - }, - "created": { - "type": "number" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["mcp.status.changed"] - }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, - "data": { - "type": "object", - "properties": { - "server": { - "type": "string" - } - }, - "required": ["server"], - "additionalProperties": false - } - }, - "required": ["id", "created", "type", "data"], - "additionalProperties": false - }, - "mcp.resources.changed": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^evt_" - } - ] - }, - "created": { - "type": "number" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["mcp.resources.changed"] - }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, - "data": { - "type": "object", - "properties": { - "server": { - "type": "string" - } - }, - "required": ["server"], - "additionalProperties": false - } - }, - "required": ["id", "created", "type", "data"], - "additionalProperties": false - }, - "permission.asked": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^evt_" - } - ] - }, - "created": { - "type": "number" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["permission.asked"] - }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^per" - } - ] - }, - "sessionID": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "permission": { - "type": "string" - }, - "patterns": { - "type": "array", - "items": { - "type": "string" - } - }, - "metadata": { - "type": "object" - }, - "always": { - "type": "array", - "items": { - "type": "string" - } - }, - "tool": { - "anyOf": [ - { - "type": "object", - "properties": { - "messageID": { - "type": "string" - }, - "callID": { - "type": "string" - } - }, - "required": ["messageID", "callID"], - "additionalProperties": false - }, - { - "type": "null" - } - ] - } - }, - "required": ["id", "sessionID", "permission", "patterns", "metadata", "always"], - "additionalProperties": false - } - }, - "required": ["id", "created", "type", "data"], - "additionalProperties": false - }, - "permission.replied": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^evt_" - } - ] - }, - "created": { - "type": "number" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["permission.replied"] - }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, - "data": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "requestID": { - "type": "string", - "allOf": [ - { - "pattern": "^per" - } - ] - }, - "reply": { - "type": "string", - "enum": ["once", "always", "reject"] - } - }, - "required": ["sessionID", "requestID", "reply"], - "additionalProperties": false - } - }, - "required": ["id", "created", "type", "data"], - "additionalProperties": false - }, - "QuestionOption": { - "type": "object", - "properties": { - "label": { - "type": "string", - "description": "Display text (1-5 words, concise)" - }, - "description": { - "type": "string", - "description": "Explanation of choice" - } - }, - "required": ["label", "description"], - "additionalProperties": false - }, - "QuestionInfo": { - "type": "object", - "properties": { - "question": { - "type": "string", - "description": "Complete question" - }, - "header": { - "type": "string", - "description": "Very short label (max 30 chars)" - }, - "options": { - "type": "array", - "items": { - "$ref": "#/components/schemas/QuestionOption" - }, - "description": "Available choices" - }, - "multiple": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "description": "Allow selecting multiple choices" - }, - "custom": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "description": "Allow typing a custom answer (default: true)" - } - }, - "required": ["question", "header", "options"], - "additionalProperties": false - }, - "QuestionTool": { - "type": "object", - "properties": { - "messageID": { - "type": "string", - "allOf": [ - { - "pattern": "^msg" - } - ] - }, - "callID": { - "type": "string" - } - }, - "required": ["messageID", "callID"], - "additionalProperties": false - }, - "question.asked": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^evt_" - } - ] - }, - "created": { - "type": "number" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["question.asked"] - }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^que" - } - ] - }, - "sessionID": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "questions": { - "type": "array", - "items": { - "$ref": "#/components/schemas/QuestionInfo" - }, - "description": "Questions to ask" - }, - "tool": { - "anyOf": [ - { - "$ref": "#/components/schemas/QuestionTool" - }, - { - "type": "null" - } - ] - } - }, - "required": ["id", "sessionID", "questions"], - "additionalProperties": false - } - }, - "required": ["id", "created", "type", "data"], - "additionalProperties": false - }, - "QuestionAnswer": { - "type": "array", - "items": { - "type": "string" - } - }, - "question.replied": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^evt_" - } - ] - }, - "created": { - "type": "number" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["question.replied"] - }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, - "data": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "requestID": { - "type": "string", - "allOf": [ - { - "pattern": "^que" - } - ] - }, - "answers": { - "type": "array", - "items": { - "$ref": "#/components/schemas/QuestionAnswer" - } - } - }, - "required": ["sessionID", "requestID", "answers"], - "additionalProperties": false - } - }, - "required": ["id", "created", "type", "data"], - "additionalProperties": false - }, - "question.rejected": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^evt_" - } - ] - }, - "created": { - "type": "number" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["question.rejected"] - }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, - "data": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "requestID": { - "type": "string", - "allOf": [ - { - "pattern": "^que" - } - ] - } - }, - "required": ["sessionID", "requestID"], - "additionalProperties": false - } - }, - "required": ["id", "created", "type", "data"], - "additionalProperties": false - }, - "session.error": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^evt_" - } - ] - }, - "created": { - "type": "number" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["session.error"] - }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, - "data": { - "type": "object", - "properties": { - "sessionID": { - "anyOf": [ - { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - { - "type": "null" - } - ] - }, - "error": { - "anyOf": [ - { - "anyOf": [ - { - "$ref": "#/components/schemas/ProviderAuthError" - }, - { - "$ref": "#/components/schemas/UnknownError1" - }, - { - "$ref": "#/components/schemas/MessageOutputLengthError" - }, - { - "$ref": "#/components/schemas/MessageAbortedError" - }, - { - "$ref": "#/components/schemas/StructuredOutputError" - }, - { - "$ref": "#/components/schemas/ContextOverflowError" - }, - { - "$ref": "#/components/schemas/ContentFilterError" - }, - { - "$ref": "#/components/schemas/APIError" - } - ] - }, - { - "type": "null" - } - ] - } - }, - "additionalProperties": false - } - }, - "required": ["id", "created", "type", "data"], - "additionalProperties": false - }, - "V2Event.server.connected": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^evt_" - } - ] - }, - "metadata": { - "anyOf": [ - { - "type": "object" - }, - { - "type": "null" - } - ] - }, - "location": { - "anyOf": [ - { - "$ref": "#/components/schemas/Location.Ref" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string", - "enum": ["server.connected"] - }, - "data": { - "anyOf": [ - { - "type": "object" - }, - { - "type": "array" - } - ] - } - }, - "required": ["id", "type", "data"], - "additionalProperties": false - }, - "V2Event": { - "anyOf": [ - { - "$ref": "#/components/schemas/models-dev.refreshed" - }, - { - "$ref": "#/components/schemas/integration.updated" - }, - { - "$ref": "#/components/schemas/integration.connection.updated" - }, - { - "$ref": "#/components/schemas/catalog.updated" - }, - { - "$ref": "#/components/schemas/agent.updated" - }, - { - "$ref": "#/components/schemas/session.created" - }, - { - "$ref": "#/components/schemas/session.updated" - }, - { - "$ref": "#/components/schemas/session.deleted1" - }, - { - "$ref": "#/components/schemas/message.updated" - }, - { - "$ref": "#/components/schemas/message.removed" - }, - { - "$ref": "#/components/schemas/message.part.updated" - }, - { - "$ref": "#/components/schemas/message.part.removed" - }, - { - "$ref": "#/components/schemas/session.agent.selected" - }, - { - "$ref": "#/components/schemas/session.model.selected" - }, - { - "$ref": "#/components/schemas/session.moved" - }, - { - "$ref": "#/components/schemas/session.renamed" - }, - { - "$ref": "#/components/schemas/session.usage.updated" - }, - { - "$ref": "#/components/schemas/session.deleted" - }, - { - "$ref": "#/components/schemas/session.forked" - }, - { - "$ref": "#/components/schemas/session.prompt.promoted" - }, - { - "$ref": "#/components/schemas/session.prompt.admitted" - }, - { - "$ref": "#/components/schemas/session.execution.started" - }, - { - "$ref": "#/components/schemas/session.execution.succeeded" - }, - { - "$ref": "#/components/schemas/session.execution.failed" - }, - { - "$ref": "#/components/schemas/session.execution.interrupted" - }, - { - "$ref": "#/components/schemas/session.instructions.updated" - }, - { - "$ref": "#/components/schemas/session.synthetic" - }, - { - "$ref": "#/components/schemas/session.skill.activated" - }, - { - "$ref": "#/components/schemas/session.shell.started" - }, - { - "$ref": "#/components/schemas/session.shell.ended" - }, - { - "$ref": "#/components/schemas/session.step.started" - }, - { - "$ref": "#/components/schemas/session.step.ended" - }, - { - "$ref": "#/components/schemas/session.step.failed" - }, - { - "$ref": "#/components/schemas/session.text.started" - }, - { - "$ref": "#/components/schemas/session.text.delta" - }, - { - "$ref": "#/components/schemas/session.text.ended" - }, - { - "$ref": "#/components/schemas/session.reasoning.started" - }, - { - "$ref": "#/components/schemas/session.reasoning.delta" - }, - { - "$ref": "#/components/schemas/session.reasoning.ended" - }, - { - "$ref": "#/components/schemas/session.tool.input.started" - }, - { - "$ref": "#/components/schemas/session.tool.input.delta" - }, - { - "$ref": "#/components/schemas/session.tool.input.ended" - }, - { - "$ref": "#/components/schemas/session.tool.called" - }, - { - "$ref": "#/components/schemas/session.tool.progress" - }, - { - "$ref": "#/components/schemas/session.tool.success" - }, - { - "$ref": "#/components/schemas/session.tool.failed" - }, - { - "$ref": "#/components/schemas/session.retry.scheduled" - }, - { - "$ref": "#/components/schemas/session.compaction.admitted" - }, - { - "$ref": "#/components/schemas/session.compaction.started" - }, - { - "$ref": "#/components/schemas/session.compaction.delta" - }, - { - "$ref": "#/components/schemas/session.compaction.ended" - }, - { - "$ref": "#/components/schemas/session.compaction.failed" - }, - { - "$ref": "#/components/schemas/session.revert.staged" - }, - { - "$ref": "#/components/schemas/session.revert.cleared" - }, - { - "$ref": "#/components/schemas/session.revert.committed" - }, - { - "$ref": "#/components/schemas/filesystem.changed" - }, - { - "$ref": "#/components/schemas/reference.updated" - }, - { - "$ref": "#/components/schemas/permission.v2.asked" - }, - { - "$ref": "#/components/schemas/permission.v2.replied" - }, - { - "$ref": "#/components/schemas/plugin.updated" - }, - { - "$ref": "#/components/schemas/project.directories.updated" - }, - { - "$ref": "#/components/schemas/command.updated" - }, - { - "$ref": "#/components/schemas/config.updated" - }, - { - "$ref": "#/components/schemas/skill.updated" - }, - { - "$ref": "#/components/schemas/pty.created" - }, - { - "$ref": "#/components/schemas/pty.updated" - }, - { - "$ref": "#/components/schemas/pty.exited" - }, - { - "$ref": "#/components/schemas/pty.deleted" - }, - { - "$ref": "#/components/schemas/shell.created" - }, - { - "$ref": "#/components/schemas/shell.exited" - }, - { - "$ref": "#/components/schemas/shell.deleted" - }, - { - "$ref": "#/components/schemas/question.v2.asked" - }, - { - "$ref": "#/components/schemas/question.v2.replied" - }, - { - "$ref": "#/components/schemas/question.v2.rejected" - }, - { - "$ref": "#/components/schemas/form.created" - }, - { - "$ref": "#/components/schemas/form.replied" - }, - { - "$ref": "#/components/schemas/form.cancelled" - }, - { - "$ref": "#/components/schemas/session.status" - }, - { - "$ref": "#/components/schemas/session.idle" - }, - { - "$ref": "#/components/schemas/tui.prompt.append" - }, - { - "$ref": "#/components/schemas/tui.command.execute" - }, - { - "$ref": "#/components/schemas/tui.toast.show" - }, - { - "$ref": "#/components/schemas/tui.session.select" - }, - { - "$ref": "#/components/schemas/installation.updated" - }, - { - "$ref": "#/components/schemas/installation.update-available" - }, - { - "$ref": "#/components/schemas/vcs.branch.updated" - }, - { - "$ref": "#/components/schemas/mcp.status.changed" - }, - { - "$ref": "#/components/schemas/mcp.resources.changed" - }, - { - "$ref": "#/components/schemas/permission.asked" - }, - { - "$ref": "#/components/schemas/permission.replied" - }, - { - "$ref": "#/components/schemas/question.asked" - }, - { - "$ref": "#/components/schemas/question.replied" - }, - { - "$ref": "#/components/schemas/question.rejected" - }, - { - "$ref": "#/components/schemas/session.error" - }, - { - "$ref": "#/components/schemas/V2Event.server.connected" - } - ] - }, - "V2EventJsonString": { - "type": "string", - "contentSchema": { - "$ref": "#/components/schemas/V2Event" - }, - "contentMediaType": "application/json" - }, - "PtyNotFoundError": { - "type": "object", - "properties": { - "_tag": { - "type": "string", - "enum": ["PtyNotFoundError"] - }, - "ptyID": { - "type": "string" - }, - "message": { - "type": "string" - } - }, - "required": ["_tag", "ptyID", "message"], - "additionalProperties": false - }, - "PtyTicket.ConnectToken": { - "type": "object", - "properties": { - "ticket": { - "type": "string" - }, - "expires_in": { - "type": "integer", - "allOf": [ - { - "exclusiveMinimum": 0 - } - ] - } - }, - "required": ["ticket", "expires_in"], - "additionalProperties": false - }, - "ForbiddenError": { - "type": "object", - "properties": { - "_tag": { - "type": "string", - "enum": ["ForbiddenError"] - }, - "message": { - "type": "string" - } - }, - "required": ["_tag", "message"], - "additionalProperties": false - }, - "Shell1": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^sh_" - } - ] - }, - "status": { - "type": "string", - "enum": ["running", "exited", "timeout", "killed"] - }, - "command": { - "type": "string" - }, - "cwd": { - "type": "string" - }, - "shell": { - "type": "string" - }, - "file": { - "type": "string" - }, - "pid": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - "exit": { - "anyOf": [ - { - "anyOf": [ - { - "type": "number" - }, - { - "type": "string", - "enum": ["NaN"] - }, - { - "type": "string", - "enum": ["Infinity"] - }, - { - "type": "string", - "enum": ["-Infinity"] - } - ] - }, - { - "type": "string", - "enum": ["Infinity", "-Infinity", "NaN"] - } - ] - }, - "metadata": { - "type": "object" - }, - "time": { - "type": "object", - "properties": { - "started": { - "anyOf": [ - { - "anyOf": [ - { - "type": "number" - }, - { - "type": "string", - "enum": ["NaN"] - }, - { - "type": "string", - "enum": ["Infinity"] - }, - { - "type": "string", - "enum": ["-Infinity"] - } - ] - }, - { - "type": "string", - "enum": ["Infinity", "-Infinity", "NaN"] - } - ] - }, - "completed": { - "anyOf": [ - { - "anyOf": [ - { - "type": "number" - }, - { - "type": "string", - "enum": ["NaN"] - }, - { - "type": "string", - "enum": ["Infinity"] - }, - { - "type": "string", - "enum": ["-Infinity"] - } - ] - }, - { - "type": "string", - "enum": ["Infinity", "-Infinity", "NaN"] - } - ] - } - }, - "required": ["started"], - "additionalProperties": false - } - }, - "required": ["id", "status", "command", "cwd", "shell", "file", "metadata", "time"], - "additionalProperties": false - }, - "ShellNotFoundError": { - "type": "object", - "properties": { - "_tag": { - "type": "string", - "enum": ["ShellNotFoundError"] - }, - "id": { - "type": "string" - }, - "message": { - "type": "string" - } - }, - "required": ["_tag", "id", "message"], - "additionalProperties": false - }, - "QuestionV2.Request": { - "type": "object", - "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^que" - } - ] - }, - "sessionID": { - "type": "string", - "allOf": [ - { - "pattern": "^ses" - } - ] - }, - "questions": { - "type": "array", - "items": { - "$ref": "#/components/schemas/QuestionV2.Info" - }, - "description": "Questions to ask" - }, - "tool": { - "$ref": "#/components/schemas/QuestionV2.Tool" - } - }, - "required": ["id", "sessionID", "questions"], - "additionalProperties": false - }, - "QuestionV2.Reply": { - "type": "object", - "properties": { - "answers": { - "type": "array", - "items": { - "$ref": "#/components/schemas/QuestionV2.Answer" - }, - "description": "User answers in order of questions (each answer is an array of selected labels)" - } - }, - "required": ["answers"], - "additionalProperties": false - }, - "QuestionNotFoundError": { - "type": "object", - "properties": { - "_tag": { - "type": "string", - "enum": ["QuestionNotFoundError"] - }, - "requestID": { - "type": "string" - }, - "message": { - "type": "string" - } - }, - "required": ["_tag", "requestID", "message"], - "additionalProperties": false - }, - "Reference.LocalSource": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["local"] - }, - "path": { - "type": "string" - }, - "description": { - "type": "string" - }, - "hidden": { - "type": "boolean" - } - }, - "required": ["type", "path"], - "additionalProperties": false - }, - "Reference.GitSource": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["git"] - }, - "repository": { - "type": "string" - }, - "branch": { - "type": "string" - }, - "description": { - "type": "string" - }, - "hidden": { - "type": "boolean" - } - }, - "required": ["type", "repository"], - "additionalProperties": false - }, - "Reference.Source": { - "anyOf": [ - { - "$ref": "#/components/schemas/Reference.LocalSource" - }, - { - "$ref": "#/components/schemas/Reference.GitSource" - } - ] - }, - "Reference.Info": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "path": { - "type": "string" - }, - "description": { - "type": "string" - }, - "hidden": { - "type": "boolean" - }, - "source": { - "$ref": "#/components/schemas/Reference.Source" - } - }, - "required": ["name", "path", "source"], - "additionalProperties": false - }, - "ProjectCopy.Copy": { - "type": "object", - "properties": { - "directory": { - "type": "string" - } - }, - "required": ["directory"], - "additionalProperties": false - }, - "ProjectCopyError": { - "type": "object", - "properties": { - "name": { - "type": "string", - "enum": ["ProjectCopyError"] - }, - "data": { - "type": "object", - "properties": { - "message": { - "type": "string" - }, - "forceRequired": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ] - } - }, - "required": ["message"], - "additionalProperties": false - } - }, - "required": ["name", "data"], - "additionalProperties": false - }, - "Vcs.FileStatus": { - "type": "object", - "properties": { - "file": { - "type": "string" - }, - "additions": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - "deletions": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] - }, - "status": { - "type": "string", - "enum": ["added", "deleted", "modified"] - } - }, - "required": ["file", "additions", "deletions", "status"], - "additionalProperties": false - }, - "Vcs.Mode": { - "type": "string", - "enum": ["working", "branch"] - } - }, - "securitySchemes": {} - }, - "security": [], - "tags": [ - { - "name": "health" - }, - { - "name": "server" - }, - { - "name": "location" - }, - { - "name": "agent" - }, - { - "name": "plugin", - "description": "Experimental plugin routes." - }, - { - "name": "session", - "description": "Experimental session routes." - }, - { - "name": "session", - "description": "Experimental message routes." - }, - { - "name": "model", - "description": "Experimental model routes." - }, - { - "name": "generate", - "description": "Experimental one-shot generation routes." - }, - { - "name": "provider", - "description": "Experimental provider routes." - }, - { - "name": "integration", - "description": "Integration discovery and authentication routes." - }, - { - "name": "mcp", - "description": "MCP server and resource routes." - }, - { - "name": "credential" - }, - { - "name": "project", - "description": "Location-scoped project routes." - }, - { - "name": "form", - "description": "Session form routes." - }, - { - "name": "permission", - "description": "Experimental permission routes." - }, - { - "name": "filesystem", - "description": "Experimental location-scoped filesystem routes." - }, - { - "name": "command", - "description": "Experimental command routes." - }, - { - "name": "skill", - "description": "Experimental skill routes." - }, - { - "name": "event", - "description": "Experimental event stream routes." - }, - { - "name": "pty", - "description": "Experimental location-scoped PTY routes." - }, - { - "name": "shell", - "description": "Experimental location-scoped shell command routes." - }, - { - "name": "question", - "description": "Experimental session question routes." - }, - { - "name": "reference", - "description": "Location-scoped project references." - }, - { - "name": "projectCopy", - "description": "Project copy management routes." - }, - { - "name": "vcs", - "description": "Location-scoped version control routes." - }, - { - "name": "debug" - } - ] -} diff --git a/packages/codemode/test/openapi.test.ts b/packages/codemode/test/openapi.test.ts index 85d4111401f..b5711f603b4 100644 --- a/packages/codemode/test/openapi.test.ts +++ b/packages/codemode/test/openapi.test.ts @@ -15,7 +15,7 @@ type Recorded = { } const opencodeSpec = async (): Promise => { - return Bun.file(new URL("./fixtures/opencode-v2-openapi.json", import.meta.url)).json() as Promise + return Bun.file(new URL("../../protocol/openapi.json", import.meta.url)).json() as Promise } const happyPathSpec = async (): Promise => { @@ -223,7 +223,7 @@ describe("OpenAPI.fromSpec", () => { const spec = await opencodeSpec() const result = OpenAPI.fromSpec({ spec, baseUrl }) - expect(result.skipped).toHaveLength(4) + expect(result.skipped).toHaveLength(5) expect(result.skipped).toContainEqual({ method: "GET", path: "/api/pty/{ptyID}/connect", @@ -1051,14 +1051,11 @@ describe("OpenAPI.fromSpec", () => { if (!Tool.isTool(location)) throw new Error("location.get was not generated") await Effect.runPromise( - location - .execute({ location: { directory: "/tmp", workspace: "workspace-1" } }) - .pipe(Effect.provide(client.layer)), + location.execute({ location: { directory: "/tmp" } }).pipe(Effect.provide(client.layer)), ) const url = new URL(client.requests[0]!.url) expect(url.searchParams.get("location[directory]")).toBe("/tmp") - expect(url.searchParams.get("location[workspace]")).toBe("workspace-1") }) test("serializes supported simple and form parameter shapes", async () => { diff --git a/packages/plugin-browser/src/connection.ts b/packages/plugin-browser/src/connection.ts index 5842e223450..5e0d1a1ae10 100644 --- a/packages/plugin-browser/src/connection.ts +++ b/packages/plugin-browser/src/connection.ts @@ -51,10 +51,7 @@ export const make = Effect.fn("BrowserConnection.make")(function* ( const session = yield* ctx.session .get({ sessionID: input.sessionID }) .pipe(Effect.mapError(() => call.error("unavailable", "Session not found.", {}))) - if ( - session.location.directory !== ctx.location.directory || - session.location.workspaceID !== ctx.location.workspaceID - ) + if (session.location.directory !== ctx.location.directory) return yield* Effect.fail(call.error("unavailable", "Session belongs to another location.", {})) const browser = yield* Effect.acquireRelease( Effect.gen(function* () { diff --git a/packages/protocol/openapi.json b/packages/protocol/openapi.json index 365ba527475..72f0a331176 100644 --- a/packages/protocol/openapi.json +++ b/packages/protocol/openapi.json @@ -70,16 +70,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -97,11 +87,11 @@ "security": [], "responses": { "200": { - "description": "Location.Info", + "description": "Location.PublicInfo", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" } } } @@ -153,16 +143,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -187,7 +167,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "type": "array", @@ -257,16 +237,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -291,7 +261,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "$ref": "#/components/schemas/Agent.Info" @@ -360,16 +330,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -394,7 +354,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "type": "array", @@ -456,16 +416,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -532,16 +482,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -566,7 +506,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "type": "array", @@ -658,16 +598,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -754,22 +684,6 @@ "tags": ["session"], "operationId": "session.list", "parameters": [ - { - "name": "workspace", - "in": "query", - "schema": { - "anyOf": [ - { - "type": "string", - "pattern": "^wrk" - }, - { - "type": "null" - } - ] - }, - "required": false - }, { "name": "limit", "in": "query", @@ -1047,7 +961,7 @@ "location": { "anyOf": [ { - "$ref": "#/components/schemas/Location.Ref" + "$ref": "#/components/schemas/Location.PublicRef" }, { "type": "null" @@ -1301,7 +1215,7 @@ "location": { "anyOf": [ { - "$ref": "#/components/schemas/Location.Ref" + "$ref": "#/components/schemas/Location.PublicRef" }, { "type": "null" @@ -1998,10 +1912,6 @@ "directory": { "type": "string" }, - "workspaceID": { - "type": "string", - "pattern": "^wrk" - }, "delivery": { "anyOf": [ { @@ -4710,16 +4620,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -4744,7 +4644,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "type": "array", @@ -4816,16 +4716,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -4850,7 +4740,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "anyOf": [ @@ -5012,16 +4902,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -5046,7 +4926,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "type": "array", @@ -5126,16 +5006,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -5160,7 +5030,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "$ref": "#/components/schemas/Provider.Info" @@ -5239,16 +5109,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -5273,7 +5133,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "type": "array", @@ -5343,16 +5203,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -5377,7 +5227,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "anyOf": [ @@ -5443,16 +5293,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -5551,16 +5391,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -5679,16 +5509,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -5713,7 +5533,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "$ref": "#/components/schemas/Integration.AttemptEncoded" @@ -5832,16 +5652,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -5866,7 +5676,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "$ref": "#/components/schemas/Integration.AttemptStatus" @@ -5939,16 +5749,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -6031,16 +5831,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -6145,16 +5935,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -6179,7 +5959,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "$ref": "#/components/schemas/Integration.CommandAttempt" @@ -6288,16 +6068,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -6322,7 +6092,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "$ref": "#/components/schemas/Integration.CommandAttemptStatus" @@ -6395,16 +6165,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -6471,16 +6231,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -6505,7 +6255,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "type": "array", @@ -6575,16 +6325,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -6681,16 +6421,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -6775,16 +6505,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -6869,16 +6589,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -6955,16 +6665,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -6989,7 +6689,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "$ref": "#/components/schemas/Mcp.ResourceCatalog" @@ -7056,16 +6756,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -7155,16 +6845,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -7239,16 +6919,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -7446,16 +7116,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -7480,7 +7140,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "type": "array", @@ -8070,16 +7730,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -8104,7 +7754,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "type": "array", @@ -8759,16 +8409,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -8853,16 +8493,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -8903,7 +8533,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "type": "array", @@ -8965,16 +8595,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -9031,7 +8651,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "type": "array", @@ -9093,16 +8713,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -9127,7 +8737,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "type": "array", @@ -9189,16 +8799,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -9223,7 +8823,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "type": "array", @@ -9301,16 +8901,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -9534,16 +9124,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -9568,7 +9148,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "type": "array", @@ -9628,16 +9208,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -9662,7 +9232,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "$ref": "#/components/schemas/Pty" @@ -9764,16 +9334,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -9798,7 +9358,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "$ref": "#/components/schemas/Pty" @@ -9874,16 +9434,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -9908,7 +9458,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "$ref": "#/components/schemas/Pty" @@ -10015,16 +9565,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -10125,16 +9665,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -10159,7 +9689,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "$ref": "#/components/schemas/PtyTicket.ConnectToken" @@ -10237,13 +9767,6 @@ "type": "string" } }, - { - "in": "query", - "name": "location[workspace]", - "schema": { - "type": "string" - } - }, { "in": "query", "name": "cursor", @@ -11223,16 +10746,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -11257,7 +10770,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "type": "array", @@ -11317,16 +10830,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -11351,7 +10854,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "$ref": "#/components/schemas/Shell.Info" @@ -11446,16 +10949,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -11480,7 +10973,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "$ref": "#/components/schemas/Shell.Info" @@ -11556,16 +11049,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -11651,16 +11134,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -11685,7 +11158,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "$ref": "#/components/schemas/Shell.Info" @@ -11781,16 +11254,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -11833,7 +11296,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "type": "object", @@ -11920,16 +11383,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -11954,7 +11407,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "type": "array", @@ -12016,16 +11469,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -12104,16 +11547,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -12202,16 +11635,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -12295,16 +11718,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -12356,166 +11769,6 @@ "summary": "Refresh worktrees" } }, - "/api/workspace": { - "post": { - "tags": ["workspace"], - "operationId": "workspace.create", - "parameters": [], - "security": [], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "data": { - "type": "string", - "pattern": "^wrk" - } - }, - "required": ["data"], - "additionalProperties": false - } - } - } - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestErrorEncoded" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedErrorEncoded" - } - } - } - }, - "404": { - "description": "ProviderNotFoundError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProviderNotFoundErrorEncoded" - } - } - } - }, - "409": { - "description": "ConflictError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ConflictErrorEncoded" - } - } - } - } - }, - "description": "Create a logical workspace. A caller-supplied ID is idempotent when retried with the same provider; reusing it with another provider returns a conflict.", - "summary": "Create workspace", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "id": { - "anyOf": [ - { - "type": "string", - "pattern": "^wrk" - }, - { - "type": "null" - } - ] - }, - "provider": { - "type": "string" - } - }, - "required": ["provider"], - "additionalProperties": false - } - } - }, - "required": true - } - } - }, - "/api/workspace/{workspaceID}": { - "delete": { - "tags": ["workspace"], - "operationId": "workspace.destroy", - "parameters": [ - { - "name": "workspaceID", - "in": "path", - "schema": { - "type": "string", - "pattern": "^wrk" - }, - "required": true - } - ], - "security": [], - "responses": { - "200": { - "description": "Reports whether this request destroyed an existing workspace.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/WorkspaceDestroyResult" - } - } - } - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestErrorEncoded" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedErrorEncoded" - } - } - } - }, - "500": { - "description": "UnknownError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnknownErrorEncoded" - } - } - } - } - }, - "description": "Make a workspace not exist. This operation is idempotent: an already-missing workspace succeeds with `destroyed: false`, while a workspace removed by this request returns `destroyed: true`.", - "summary": "Destroy workspace" - } - }, "/api/vcs": { "get": { "tags": ["vcs"], @@ -12538,16 +11791,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -12572,7 +11815,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "$ref": "#/components/schemas/Vcs.Info" @@ -12631,16 +11874,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -12665,7 +11898,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "anyOf": [ @@ -12741,16 +11974,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -12775,7 +11998,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "type": "array", @@ -12837,16 +12060,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -12901,7 +12114,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "$ref": "#/components/schemas/Vcs.BranchList" @@ -12960,16 +12173,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -13025,7 +12228,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "type": "array", @@ -13089,7 +12292,7 @@ "schema": { "type": "array", "items": { - "$ref": "#/components/schemas/Location.Ref" + "$ref": "#/components/schemas/Location.PublicRef" } } } @@ -13140,16 +12343,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -13327,16 +12520,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -13361,7 +12544,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "type": "array", @@ -13433,16 +12616,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -13467,7 +12640,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "$ref": "#/components/schemas/WebSearch.ResponseEncoded" @@ -13563,16 +12736,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -16187,16 +15350,12 @@ "required": ["_tag", "message"], "additionalProperties": false }, - "Location.InfoEncoded": { + "Location.PublicInfo": { "type": "object", "properties": { "directory": { "type": "string" }, - "workspaceID": { - "type": "string", - "pattern": "^wrk" - }, "project": { "type": "object", "properties": { @@ -16217,15 +15376,11 @@ "required": ["directory", "project"], "additionalProperties": false }, - "Location.Ref": { + "Location.PublicRef": { "type": "object", "properties": { "directory": { "type": "string" - }, - "workspaceID": { - "type": "string", - "pattern": "^wrk" } }, "required": ["directory"], @@ -18091,30 +17246,30 @@ "type": "string", "enum": ["move"] }, - "payload": { - "$ref": "#/components/schemas/Session.Inbox.MovePayload" - }, "delivery": { "$ref": "#/components/schemas/Session.Inbox.Delivery" + }, + "payload": { + "$ref": "#/components/schemas/Session.Inbox.MovePayload" } }, - "required": ["id", "sessionID", "timeCreated", "type", "payload", "delivery"], + "required": ["id", "sessionID", "timeCreated", "type", "delivery", "payload"], "additionalProperties": false }, "Session.Inbox.MovePayload": { "type": "object", "properties": { - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, "projectID": { "type": "string" }, "subpath": { "type": "string" + }, + "location": { + "$ref": "#/components/schemas/Location.PublicRef" } }, - "required": ["location", "projectID"], + "required": ["projectID", "location"], "additionalProperties": false }, "Session.Inbox.Synthetic": { @@ -18289,9 +17444,6 @@ "title": { "type": "string" }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, "subpath": { "type": "string" }, @@ -18303,6 +17455,9 @@ }, "revert": { "$ref": "#/components/schemas/Session.Revert" + }, + "location": { + "$ref": "#/components/schemas/Location.PublicRef" } }, "required": ["id", "projectID", "cost", "tokens", "time", "location"], @@ -18810,30 +17965,37 @@ "type": "string", "enum": ["location-switched"] }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, "projectID": { "type": "string" }, "subpath": { "type": "string" }, + "location": { + "$ref": "#/components/schemas/Location.PublicRef" + }, "previous": { - "type": "object", - "properties": { - "location": { - "$ref": "#/components/schemas/Location.Ref" + "anyOf": [ + { + "type": "object", + "properties": { + "location": { + "$ref": "#/components/schemas/Location.PublicRef" + }, + "projectID": { + "type": "string" + }, + "subpath": { + "type": "string" + } + }, + "required": ["location"], + "additionalProperties": false }, - "projectID": { - "type": "string" - }, - "subpath": { - "type": "string" + { + "type": "null" } - }, - "required": ["location"], - "additionalProperties": false + ] } }, "required": ["id", "time", "type", "location"], @@ -20038,18 +19200,6 @@ "required": ["url", "time"], "additionalProperties": false }, - "WorkspaceDestroyResult": { - "type": "object", - "properties": { - "destroyed": { - "type": "boolean", - "description": "True when this request transitioned the workspace from existing to destroyed." - } - }, - "required": ["destroyed"], - "additionalProperties": false, - "description": "Reports whether this request destroyed an existing workspace." - }, "Worktree.CreateInput": { "type": "object", "properties": { @@ -20245,10 +19395,6 @@ "name": "worktree", "description": "Location-scoped worktree management routes." }, - { - "name": "workspace", - "description": "Workspace lifecycle routes." - }, { "name": "vcs", "description": "Location-scoped version control routes." diff --git a/packages/protocol/src/api.ts b/packages/protocol/src/api.ts index 1d388ce05d0..aa0ce388c48 100644 --- a/packages/protocol/src/api.ts +++ b/packages/protocol/src/api.ts @@ -33,7 +33,6 @@ import { WorktreeGroup } from "./groups/worktree.js" import { VcsGroup } from "./groups/vcs.js" import { MigrationGroup } from "./groups/migration.js" import { ConfigGroup } from "./groups/config.js" -import { WorkspaceGroup } from "./groups/workspace.js" type LocationGroups = | HttpApiGroup.AddMiddleware @@ -87,7 +86,6 @@ type ApiGroups< | typeof ServerGroup | typeof DebugGroup | typeof MigrationGroup - | typeof WorkspaceGroup | typeof GenerateGroup | typeof PersistentPtyGroup | LocationGroups @@ -174,7 +172,6 @@ const makeApiFromGroup = < .add(ShellGroup.middleware(locationMiddleware)) .add(ReferenceGroup.middleware(locationMiddleware)) .add(WorktreeGroup.middleware(locationMiddleware)) - .add(WorkspaceGroup) .add(VcsGroup.middleware(locationMiddleware)) .add(DebugGroup) .add(MigrationGroup) diff --git a/packages/protocol/src/client.ts b/packages/protocol/src/client.ts index 30c9ea131c0..ee287b5d6a0 100644 --- a/packages/protocol/src/client.ts +++ b/packages/protocol/src/client.ts @@ -61,7 +61,6 @@ export const groupNames = { "server.reference": "reference", "server.project": "project", "server.worktree": "worktree", - "server.workspace": "workspace", "server.vcs": "vcs", "server.config": "config", } as const diff --git a/packages/protocol/src/groups/debug.ts b/packages/protocol/src/groups/debug.ts index a620ca7ff94..8b986007665 100644 --- a/packages/protocol/src/groups/debug.ts +++ b/packages/protocol/src/groups/debug.ts @@ -6,7 +6,7 @@ import { LocationQuery, locationQueryOpenApi } from "./location.js" export const DebugGroup = HttpApiGroup.make("server.debug") .add( HttpApiEndpoint.get("debug.location", "/api/debug/location", { - success: Schema.Array(Location.Ref), + success: Schema.Array(Location.PublicRef), }).annotateMerge( OpenApi.annotations({ identifier: "debug.location.list", diff --git a/packages/protocol/src/groups/event.ts b/packages/protocol/src/groups/event.ts index 80a93801105..f067ecfe396 100644 --- a/packages/protocol/src/groups/event.ts +++ b/packages/protocol/src/groups/event.ts @@ -8,7 +8,7 @@ import { HttpApiEndpoint, HttpApiGroup, HttpApiSchema, OpenApi } from "effect/un const fields = { id: Event.ID, metadata: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)), - location: Schema.optional(Location.Ref), + location: Schema.optional(Location.PublicRef), } const rpcEvent = Schema.Struct({ @@ -16,7 +16,7 @@ const rpcEvent = Schema.Struct({ created: Schema.Finite, metadata: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)), type: Schema.TemplateLiteral(["rpc.", Schema.String]), - location: Location.Ref, + location: Location.PublicRef, data: Schema.Record(Schema.String, Schema.Unknown), }).annotate({ identifier: "V2Event.rpc" }) diff --git a/packages/protocol/src/groups/location.ts b/packages/protocol/src/groups/location.ts index aa6b4ca66f9..b83b8d6b97a 100644 --- a/packages/protocol/src/groups/location.ts +++ b/packages/protocol/src/groups/location.ts @@ -6,7 +6,6 @@ export const LocationQuery = Schema.Struct({ location: Schema.optional( Schema.Struct({ directory: Schema.optional(Schema.String), - workspace: Schema.optional(Schema.String), }), ), }).annotate({ identifier: "LocationQuery" }) @@ -30,7 +29,7 @@ export const LocationGroup = HttpApiGroup.make("server.location") .add( HttpApiEndpoint.get("location.get", "/api/location", { query: LocationQuery, - success: Location.Info, + success: Location.PublicInfo, }) .annotateMerge(locationQueryOpenApi) .annotateMerge( diff --git a/packages/protocol/src/groups/message.ts b/packages/protocol/src/groups/message.ts index ff763a7608b..6e501b93164 100644 --- a/packages/protocol/src/groups/message.ts +++ b/packages/protocol/src/groups/message.ts @@ -1,6 +1,7 @@ import { Session } from "@opencode/schema/session" import { SessionMessage } from "@opencode/schema/session-message" -import { Schema } from "effect" +import { Location } from "@opencode/schema/location" +import { Schema, Struct } from "effect" import { HttpApiEndpoint, HttpApiGroup, OpenApi } from "effect/unstable/httpapi" import { InvalidCursorError, SessionNotFoundError, UnknownError } from "../errors.js" @@ -38,13 +39,37 @@ export const SessionMessagesQuery = Schema.Struct({ }), }).annotate({ identifier: "SessionMessagesQuery" }) +const PublicLocationSwitched = Schema.Struct({ + ...Struct.omit(SessionMessage.LocationSwitched.fields, ["location", "previous"]), + location: Location.PublicRef, + previous: Schema.Struct({ + location: Location.PublicRef, + projectID: SessionMessage.LocationSwitched.fields.projectID, + subpath: SessionMessage.LocationSwitched.fields.subpath, + }).pipe(Schema.optional), +}).annotate({ identifier: "Session.Message.LocationSwitched" }) + +export const PublicSessionMessage = Schema.Union([ + SessionMessage.AgentSelected, + SessionMessage.ModelSelected, + PublicLocationSwitched, + SessionMessage.User, + SessionMessage.Synthetic, + SessionMessage.System, + SessionMessage.Skill, + SessionMessage.Shell, + SessionMessage.Assistant, + SessionMessage.Compaction, + SessionMessage.Idle, +]).annotate({ identifier: "Session.Message.Info" }) + export const MessageGroup = HttpApiGroup.make("server.message") .add( HttpApiEndpoint.get("session.messages", "/api/session/:sessionID/message", { params: { sessionID: Session.ID }, query: SessionMessagesQuery, success: Schema.Struct({ - data: Schema.Array(SessionMessage.Info), + data: Schema.Array(PublicSessionMessage), cursor: Schema.Struct({ previous: Schema.String.pipe(Schema.optional), next: Schema.String.pipe(Schema.optional), diff --git a/packages/protocol/src/groups/pty.ts b/packages/protocol/src/groups/pty.ts index c0ade370e85..00efe91a939 100644 --- a/packages/protocol/src/groups/pty.ts +++ b/packages/protocol/src/groups/pty.ts @@ -131,7 +131,7 @@ export const PtyGroup = HttpApiGroup.make("server.pty") "x-websocket": true, parameters: [ ...(operation.parameters ?? []), - ...["location[directory]", "location[workspace]", "cursor", PTY_CONNECT_TICKET_QUERY].map((name) => ({ + ...["location[directory]", "cursor", PTY_CONNECT_TICKET_QUERY].map((name) => ({ in: "query", name, schema: { type: "string" }, diff --git a/packages/protocol/src/groups/session.ts b/packages/protocol/src/groups/session.ts index de14feeda94..ec881b2f068 100644 --- a/packages/protocol/src/groups/session.ts +++ b/packages/protocol/src/groups/session.ts @@ -1,5 +1,4 @@ import { SessionMessage } from "@opencode/schema/session-message" -import { SessionTransfer } from "@opencode/schema/session-transfer" import { SessionInbox } from "@opencode/schema/session-inbox" import { PromptInput } from "@opencode/schema/prompt-input" import { Session } from "@opencode/schema/session" @@ -8,7 +7,6 @@ import { InstructionEntry } from "@opencode/schema/instruction-entry" import { Project } from "@opencode/schema/project" import { AbsolutePath, NonNegativeInt, PositiveInt, RelativePath, statics } from "@opencode/schema/schema" import { Event } from "@opencode/schema/event" -import { Workspace } from "@opencode/schema/workspace" import { Context, Effect, Encoding, Result, Schema, SchemaGetter, Struct } from "effect" import { HttpApiEndpoint, HttpApiGroup, HttpApiMiddleware, HttpApiSchema, OpenApi } from "effect/unstable/httpapi" import { @@ -32,6 +30,7 @@ import { Location } from "@opencode/schema/location" import { SessionEvent } from "@opencode/schema/session-event" import { EventLog } from "@opencode/schema/event-log" import { FileDiff } from "@opencode/schema/file-diff" +import { PublicSessionMessage } from "./message.js" const ParentIDFilter = Schema.Union([ Session.ID, @@ -46,7 +45,6 @@ const ParentIDFilter = Schema.Union([ }) const SessionsQueryFields = { - workspace: Workspace.ID.pipe(Schema.optional), limit: Schema.NumberFromString.pipe(Schema.decodeTo(PositiveInt), Schema.optional).annotate({ description: "Maximum number of sessions to return. Defaults to the newest 50 sessions.", }), @@ -108,6 +106,33 @@ const SessionActive = Schema.Struct({ type: Schema.Literal("running"), }).annotate({ identifier: "SessionActive" }) +const PublicSessionInfo = Schema.Struct({ + ...Struct.omit(Session.Info.fields, ["location"]), + location: Location.PublicRef, +}).annotate({ identifier: "Session.Info" }) + +const PublicSessionTransfer = Schema.Struct({ + info: PublicSessionInfo, + messages: Schema.Array(PublicSessionMessage), +}).annotate({ identifier: "SessionTransfer.Data" }) + +const PublicMovePayload = Schema.Struct({ + ...Struct.omit(SessionInbox.MovePayload.fields, ["location"]), + location: Location.PublicRef, +}).annotate({ identifier: "Session.Inbox.MovePayload" }) + +const PublicMove = Schema.Struct({ + ...Struct.omit(SessionInbox.Move.fields, ["payload"]), + payload: PublicMovePayload, +}).annotate({ identifier: "Session.Inbox.Move" }) + +const PublicInboxInfo = Schema.Union([ + SessionInbox.User, + SessionInbox.Synthetic, + SessionInbox.Compaction, + PublicMove, +]).annotate({ identifier: "Session.Inbox.Info" }) + const BooleanFromString = Schema.Literals(["true", "false"]).pipe( Schema.decodeTo(Schema.Boolean, { decode: SchemaGetter.transform((value) => value === "true"), @@ -133,7 +158,7 @@ export const makeSessionGroup = (sessionLo HttpApiEndpoint.get("session.list", "/api/session", { query: SessionsQuery, success: Schema.Struct({ - data: Schema.Array(Session.Info), + data: Schema.Array(PublicSessionInfo), cursor: Schema.Struct({ previous: SessionsCursor.pipe(Schema.optional), next: SessionsCursor.pipe(Schema.optional), @@ -175,11 +200,11 @@ export const makeSessionGroup = (sessionLo title: Schema.String.pipe(Schema.optional), agent: Agent.ID.pipe(Schema.optional), model: Model.Ref.pipe(Schema.optional), - location: Location.Ref.pipe(Schema.optional), + location: Location.PublicRef.pipe(Schema.optional), metadata: Session.Metadata.pipe(Schema.optional), permissions: Permission.Ruleset.pipe(Schema.optional), }), - success: Schema.Struct({ data: Session.Info }), + success: Schema.Struct({ data: PublicSessionInfo }), }).annotateMerge( OpenApi.annotations({ identifier: "session.create", @@ -191,10 +216,10 @@ export const makeSessionGroup = (sessionLo .add( HttpApiEndpoint.post("session.import", "/api/session/import", { payload: Schema.Struct({ - ...SessionTransfer.Data.fields, - location: Location.Ref.pipe(Schema.optional), + ...PublicSessionTransfer.fields, + location: Location.PublicRef.pipe(Schema.optional), }), - success: Schema.Struct({ data: Session.Info }), + success: Schema.Struct({ data: PublicSessionInfo }), error: [ConflictError, SessionNotFoundError], }).annotateMerge( OpenApi.annotations({ @@ -209,7 +234,7 @@ export const makeSessionGroup = (sessionLo HttpApiEndpoint.get("session.export", "/api/session/:sessionID/export", { params: { sessionID: Session.ID }, query: Schema.Struct({ sanitize: BooleanFromString.pipe(Schema.optional) }), - success: Schema.Struct({ data: SessionTransfer.Data }), + success: Schema.Struct({ data: PublicSessionTransfer }), error: [SessionNotFoundError, UnknownError], }).annotateMerge( OpenApi.annotations({ @@ -234,7 +259,7 @@ export const makeSessionGroup = (sessionLo .add( HttpApiEndpoint.get("session.get", "/api/session/:sessionID", { params: { sessionID: Session.ID }, - success: Schema.Struct({ data: Session.Info }), + success: Schema.Struct({ data: PublicSessionInfo }), error: SessionNotFoundError, }).annotateMerge( OpenApi.annotations({ @@ -261,7 +286,7 @@ export const makeSessionGroup = (sessionLo HttpApiEndpoint.post("session.fork", "/api/session/:sessionID/fork", { params: { sessionID: Session.ID }, payload: Schema.Struct({ boundary: Session.ForkRequestBoundary }), - success: Schema.Struct({ data: Session.Info }), + success: Schema.Struct({ data: PublicSessionInfo }), error: [SessionNotFoundError, MessageNotFoundError, InvalidRequestError], }) .middleware(sessionLocationMiddleware) @@ -324,7 +349,7 @@ export const makeSessionGroup = (sessionLo .add( HttpApiEndpoint.post("session.move", "/api/session/:sessionID/move", { params: { sessionID: Session.ID }, - payload: Schema.Struct({ ...Location.Ref.fields, delivery: SessionInbox.Delivery.pipe(Schema.optional) }), + payload: Schema.Struct({ ...Location.PublicRef.fields, delivery: SessionInbox.Delivery.pipe(Schema.optional) }), success: HttpApiSchema.NoContent, error: [SessionNotFoundError, InvalidRequestError], }).annotateMerge( @@ -514,7 +539,7 @@ export const makeSessionGroup = (sessionLo .add( HttpApiEndpoint.get("session.context", "/api/session/:sessionID/context", { params: { sessionID: Session.ID }, - success: Schema.Struct({ data: Schema.Array(SessionMessage.Info) }), + success: Schema.Struct({ data: Schema.Array(PublicSessionMessage) }), error: [SessionNotFoundError, UnknownError], }).annotateMerge( OpenApi.annotations({ @@ -552,7 +577,7 @@ export const makeSessionGroup = (sessionLo .add( HttpApiEndpoint.get("session.inbox.list", "/api/session/:sessionID/inbox", { params: { sessionID: Session.ID }, - success: Schema.Struct({ data: Schema.Array(SessionInbox.Info) }), + success: Schema.Struct({ data: Schema.Array(PublicInboxInfo) }), error: SessionNotFoundError, }).annotateMerge( OpenApi.annotations({ @@ -728,7 +753,7 @@ export const makeSessionGroup = (sessionLo .add( HttpApiEndpoint.get("session.message", "/api/session/:sessionID/message/:messageID", { params: { sessionID: Session.ID, messageID: SessionMessage.ID }, - success: Schema.Struct({ data: SessionMessage.Info }), + success: Schema.Struct({ data: PublicSessionMessage }), error: [SessionNotFoundError, MessageNotFoundError], }).annotateMerge( OpenApi.annotations({ diff --git a/packages/protocol/src/groups/workspace.ts b/packages/protocol/src/groups/workspace.ts deleted file mode 100644 index 3e553a450d0..00000000000 --- a/packages/protocol/src/groups/workspace.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { Workspace } from "@opencode/schema/workspace" -import { Schema } from "effect" -import { HttpApiEndpoint, HttpApiGroup, OpenApi } from "effect/unstable/httpapi" -import { ConflictError, ProviderNotFoundError, UnknownError } from "../errors.js" - -export const WorkspaceGroup = HttpApiGroup.make("server.workspace") - .add( - HttpApiEndpoint.post("workspace.create", "/api/workspace", { - payload: Schema.Struct({ - id: Workspace.ID.pipe(Schema.optional), - provider: Schema.String, - }), - success: Schema.Struct({ data: Workspace.ID }), - error: [ConflictError, ProviderNotFoundError], - }).annotateMerge( - OpenApi.annotations({ - identifier: "workspace.create", - summary: "Create workspace", - description: - "Create a logical workspace. A caller-supplied ID is idempotent when retried with the same provider; reusing it with another provider returns a conflict.", - }), - ), - ) - .add( - HttpApiEndpoint.delete("workspace.destroy", "/api/workspace/:workspaceID", { - params: { workspaceID: Workspace.ID }, - success: Workspace.DestroyResult, - error: UnknownError, - }).annotateMerge( - OpenApi.annotations({ - identifier: "workspace.destroy", - summary: "Destroy workspace", - description: - "Make a workspace not exist. This operation is idempotent: an already-missing workspace succeeds with `destroyed: false`, while a workspace removed by this request returns `destroyed: true`.", - }), - ), - ) - .annotateMerge(OpenApi.annotations({ title: "workspace", description: "Workspace lifecycle routes." })) diff --git a/packages/schema/src/location.ts b/packages/schema/src/location.ts index d9104435c62..d84a6bfa30d 100644 --- a/packages/schema/src/location.ts +++ b/packages/schema/src/location.ts @@ -1,6 +1,6 @@ export * as Location from "./location.js" -import { Schema } from "effect" +import { Schema, Struct } from "effect" import { AbsolutePath, optional } from "./schema.js" import { ProjectID } from "./project-id.js" import { WorkspaceID } from "./workspace-id.js" @@ -11,6 +11,11 @@ export const Ref = Schema.Struct({ workspaceID: optional(WorkspaceID), }).annotate({ identifier: "Location.Ref" }) +export const PublicRef = Schema.Struct(Struct.omit(Ref.fields, ["workspaceID"])).annotate({ + identifier: "Location.PublicRef", +}) +export interface PublicRef extends Schema.Schema.Type {} + export class Info extends Schema.Class("Location.Info")({ directory: AbsolutePath, workspaceID: optional(WorkspaceID), @@ -21,6 +26,11 @@ export class Info extends Schema.Class("Location.Info")({ }), }) {} +export const PublicInfo = Schema.Struct(Struct.omit(Info.fields, ["workspaceID"])).annotate({ + identifier: "Location.PublicInfo", +}) +export interface PublicInfo extends Schema.Schema.Type {} + export function response(data: S) { - return Schema.Struct({ location: Info, data }) + return Schema.Struct({ location: PublicInfo, data }) } diff --git a/packages/sdk/src/effect/opencode.ts b/packages/sdk/src/effect/opencode.ts index 5898eefba87..f4c88089132 100644 --- a/packages/sdk/src/effect/opencode.ts +++ b/packages/sdk/src/effect/opencode.ts @@ -1,6 +1,7 @@ export * as OpenCode from "./opencode" import { OpenCode, type OpenCodeClient } from "@opencode/client/effect" +import type { Session } from "@opencode/core/session" import type { Workspace } from "@opencode/core/workspace" import { Context, Effect, Layer } from "effect" import type { Config, Scope } from "effect" @@ -16,7 +17,11 @@ export type InstanceOptions = SdkInstances.Options export type InstanceConfiguration = SdkInstances.Configuration export type Interface = Omit & { - readonly sessions: OpenCodeClient["session"] + readonly sessions: Omit & { + readonly create: Session.Interface["create"] + readonly get: (input: { readonly sessionID: Session.ID }) => ReturnType + readonly move: Session.Interface["move"] + } readonly events: OpenCodeClient["event"] readonly workspace: { readonly create: Workspace.Interface["create"] @@ -46,7 +51,12 @@ export const create: ( return { ...client, - sessions: client.session, + sessions: { + ...client.session, + create: host.sessions.create, + get: (input: { readonly sessionID: Session.ID }) => host.sessions.get(input.sessionID), + move: host.sessions.move, + }, events: client.event, workspace: { create: host.workspace.create, diff --git a/packages/sdk/src/internal/host.ts b/packages/sdk/src/internal/host.ts index 6682346b03c..5e1dd60404a 100644 --- a/packages/sdk/src/internal/host.ts +++ b/packages/sdk/src/internal/host.ts @@ -2,6 +2,7 @@ export * as EmbeddedHost from "./host" import { SdkPlugins } from "@opencode/core/plugin/sdk" import { SessionRestart } from "@opencode/core/session/execution/restart" +import { Session } from "@opencode/core/session" import { Workspace } from "@opencode/core/workspace" import { WorkspaceDriver } from "@opencode/core/workspace/driver" import { createEmbeddedRoutes } from "@opencode/server/routes" @@ -58,6 +59,7 @@ export const create = Effect.fn("EmbeddedHost.create")(function* ( runtime, fetch: transport.fetch, plugins: Context.get(services, SdkPlugins.Service), + sessions: Context.get(services, Session.Service), workspace: Context.get(services, Workspace.Service), close: transport.close, } diff --git a/packages/server/src/handlers.ts b/packages/server/src/handlers.ts index 4c9f4def3c7..5dccd1d847a 100644 --- a/packages/server/src/handlers.ts +++ b/packages/server/src/handlers.ts @@ -30,7 +30,6 @@ import { VcsHandler } from "./handlers/vcs" import { EventFeed } from "./event-feed" import { MigrationHandler } from "./handlers/migration" import { ConfigHandler } from "./handlers/config" -import { WorkspaceHandler } from "./handlers/workspace" export const handlers = Layer.mergeAll( ServerHandler, @@ -61,7 +60,6 @@ export const handlers = Layer.mergeAll( ShellHandler, ReferenceHandler, WorktreeHandler, - WorkspaceHandler, VcsHandler, ConfigHandler, ) diff --git a/packages/server/src/handlers/location.ts b/packages/server/src/handlers/location.ts index 24732444ac0..5ff93d29aee 100644 --- a/packages/server/src/handlers/location.ts +++ b/packages/server/src/handlers/location.ts @@ -10,7 +10,6 @@ export const LocationHandler = HttpApiBuilder.group(Api, "server.location", (han const location = yield* Location.Service return new Location.Info({ directory: location.directory, - workspaceID: location.workspaceID, project: location.project, }) }), diff --git a/packages/server/src/handlers/session.ts b/packages/server/src/handlers/session.ts index 795d5d20c58..50009173f87 100644 --- a/packages/server/src/handlers/session.ts +++ b/packages/server/src/handlers/session.ts @@ -54,7 +54,6 @@ export const SessionHandler = HttpApiBuilder.group(Api, "server.session", (handl : ctx.query const page = yield* session.list({ ...query, - workspaceID: query.workspace, limit: ctx.query.limit ?? DefaultSessionsLimit, }) const sessions = page.data @@ -260,7 +259,6 @@ export const SessionHandler = HttpApiBuilder.group(Api, "server.session", (handl .move({ sessionID: ctx.params.sessionID, directory: ctx.payload.directory, - workspaceID: ctx.payload.workspaceID, delivery: ctx.payload.delivery, }) .pipe( diff --git a/packages/server/src/handlers/workspace.ts b/packages/server/src/handlers/workspace.ts deleted file mode 100644 index ff25059f6ce..00000000000 --- a/packages/server/src/handlers/workspace.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { Workspace } from "@opencode/core/workspace" -import { ConflictError, ProviderNotFoundError, UnknownError } from "@opencode/protocol/errors" -import { Effect } from "effect" -import { HttpApiBuilder } from "effect/unstable/httpapi" -import { Api } from "../api" - -export const WorkspaceHandler = HttpApiBuilder.group(Api, "server.workspace", (handlers) => - Effect.gen(function* () { - const workspace = yield* Workspace.Service - - return handlers - .handle("workspace.create", (ctx) => - workspace.create(ctx.payload).pipe( - Effect.map((workspaceID) => ({ data: workspaceID })), - Effect.catchTags({ - "Workspace.CreateConflict": (error) => - new ConflictError({ - resource: error.workspaceID, - message: `Workspace ${error.workspaceID} already uses provider ${error.existingProvider}, not ${error.provider}`, - }), - "WorkspaceDriver.ProviderNotFound": (error) => - new ProviderNotFoundError({ - providerID: error.provider, - message: `Workspace provider not found: ${error.provider}`, - }), - }), - ), - ) - .handle("workspace.destroy", (ctx) => - workspace.destroy(ctx.params.workspaceID).pipe( - Effect.mapError( - (error) => - new UnknownError({ - message: - error._tag === "WorkspaceDriver.ProviderNotFound" - ? `Workspace provider not found: ${error.provider}` - : (error.message ?? "Workspace provider failed to destroy the workspace"), - }), - ), - ), - ) - }), -) diff --git a/packages/server/src/location.ts b/packages/server/src/location.ts index 2222e7a127e..83e66df301d 100644 --- a/packages/server/src/location.ts +++ b/packages/server/src/location.ts @@ -2,7 +2,6 @@ import { Location } from "@opencode/core/location" import { LocationServiceMap } from "@opencode/core/location-services" import { AbsolutePath } from "@opencode/core/schema" import { Session } from "@opencode/core/session" -import { Workspace } from "@opencode/core/workspace" import { InvalidRequestError } from "@opencode/protocol/errors" import { Effect, Layer, Schema } from "effect" import { HttpServerRequest } from "effect/unstable/http" @@ -21,7 +20,6 @@ export function response(data: Effect.Effect) { return { location: new Location.Info({ directory: location.directory, - workspaceID: location.workspaceID, project: location.project, }), data: yield* data, @@ -40,13 +38,11 @@ export const sessionInfo = Effect.fnUntraced(function* (sessions: Session.Interf export function requestRef(request: HttpServerRequest.HttpServerRequest): Location.Ref { const query = new URL(request.url, "http://localhost").searchParams - const workspaceID = query.get("location[workspace]") || request.headers["x-opencode-workspace"] const directory = query.get("location[directory]") || (request.headers["x-opencode-directory"] ? decode(request.headers["x-opencode-directory"]) : process.cwd()) return Location.Ref.make({ directory: AbsolutePath.make(directory), - workspaceID: workspaceID ? Workspace.ID.make(workspaceID) : undefined, }) } diff --git a/packages/server/test/fetch.test.ts b/packages/server/test/fetch.test.ts index 44dba2ffac2..459aebe28ce 100644 --- a/packages/server/test/fetch.test.ts +++ b/packages/server/test/fetch.test.ts @@ -2,9 +2,6 @@ import { expect } from "bun:test" import fs from "node:fs/promises" import { createServer } from "node:http" import path from "node:path" -import { makeMemoryDriver } from "@opencode/core/environment/index" -import { Workspace } from "@opencode/core/workspace" -import { WorkspaceDriver } from "@opencode/core/workspace/driver" import { Agent } from "@opencode/schema/agent" import { Integration } from "@opencode/schema/integration" import { ServerStatus } from "@opencode/protocol/groups/server" @@ -93,13 +90,6 @@ const connectOpenAI = (handler: Handler) => ) }) -const workspaceDriver = WorkspaceDriver.make({ - create: ({ workspaceID }) => Effect.succeed({ binding: { workspaceID } }), - connect: () => Effect.succeed(makeMemoryDriver()), - suspendForIdle: () => Effect.void, - destroy: () => Effect.void, -}) - it.live("serves the HttpApi and enforces Basic auth like the Node server", () => Effect.gen(function* () { const handler = yield* ServerFetch.make({ ...options, password: "secret" }) @@ -279,64 +269,6 @@ it.live( { timeout: 10_000 }, ) -it.live("treats destroying a missing workspace as success", () => - Effect.gen(function* () { - const handler = yield* ServerFetch.make(options) - const response = yield* Effect.promise(() => - handler( - new Request(`http://opencode.local/api/workspace/${Workspace.ID.create()}`, { - method: "DELETE", - }), - ), - ) - - expect(response.status).toBe(200) - expect(yield* Effect.promise(() => response.json())).toEqual({ destroyed: false }) - }), -) - -it.live("creates idempotent caller-identified workspaces through the HttpApi", () => - Effect.gen(function* () { - const handler = yield* ServerFetch.make(options, { - overrides: [ - WorkspaceDriver.node.replace(WorkspaceDriver.registryNode({ fake: workspaceDriver, other: workspaceDriver })), - ], - }) - const id = Workspace.ID.create() - const create = (body: unknown) => - Effect.promise(() => - handler( - new Request("http://opencode.local/api/workspace", { - method: "POST", - headers: { "content-type": "application/json" }, - body: JSON.stringify(body), - }), - ), - ) - - const supplied = yield* create({ id, provider: "fake" }) - expect(supplied.status).toBe(200) - expect(yield* Effect.promise(() => supplied.json())).toEqual({ data: id }) - - const repeated = yield* create({ id, provider: "fake" }) - expect(repeated.status).toBe(200) - expect(yield* Effect.promise(() => repeated.json())).toEqual({ data: id }) - - const conflict = yield* create({ id, provider: "other" }) - expect(conflict.status).toBe(409) - expect(yield* Effect.promise(() => conflict.json())).toMatchObject({ - _tag: "ConflictError", - resource: id, - }) - - expect((yield* create({ id: "invalid", provider: "fake" })).status).toBe(400) - - const minted = yield* create({ provider: "fake" }) - expect(minted.status).toBe(200) - expect(yield* Effect.promise(() => minted.json())).toMatchObject({ data: expect.stringMatching(/^wrk_/) }) - }), -) - it.live("serves the session view operation and missing-session error", () => Effect.gen(function* () { const handler = yield* ServerFetch.make(options) diff --git a/packages/tui/src/app.tsx b/packages/tui/src/app.tsx index cb8dfd3a3b2..21c16262b6b 100644 --- a/packages/tui/src/app.tsx +++ b/packages/tui/src/app.tsx @@ -506,7 +506,7 @@ function App(props: { pair?: DialogPairCredentials }) { const session = data.session.get(route.data.sessionID) if (!session) return if (data.session.creating(session.id)) return - if (session.location.workspaceID !== undefined || terminalEnvironment.variables === undefined) return + if (terminalEnvironment.variables === undefined) return void client.api.session .environment({ sessionID: session.id, variables: terminalEnvironment.variables }) .catch(toast.error) @@ -671,7 +671,6 @@ function App(props: { pair?: DialogPairCredentials }) { order: "desc", parentID: null, directory: location.directory, - workspace: location.workspaceID, }) .then((response) => { const match = response.data[0]?.id @@ -1222,13 +1221,13 @@ function App(props: { pair?: DialogPairCredentials }) { bindings: ["app.exit"], })) - event.on("tui.command.execute", (evt, { workspace }) => { - if (workspace !== (location.current?.workspaceID ?? data.location.default().workspaceID)) return + event.on("tui.command.execute", (evt, { directory }) => { + if (directory !== (location.current?.directory ?? data.location.default().directory)) return keymap.dispatch(evt.data.command) }) - event.on("tui.toast.show", (evt, { workspace }) => { - if (workspace !== (location.current?.workspaceID ?? data.location.default().workspaceID)) return + event.on("tui.toast.show", (evt, { directory }) => { + if (directory !== (location.current?.directory ?? data.location.default().directory)) return toast.show({ title: evt.data.title, message: evt.data.message, @@ -1237,8 +1236,8 @@ function App(props: { pair?: DialogPairCredentials }) { }) }) - event.on("tui.session.select", (evt, { workspace }) => { - if (workspace !== (location.current?.workspaceID ?? data.location.default().workspaceID)) return + event.on("tui.session.select", (evt, { directory }) => { + if (directory !== (location.current?.directory ?? data.location.default().directory)) return route.navigate({ type: "session", sessionID: evt.data.sessionID, diff --git a/packages/tui/src/component/devtools-bar.tsx b/packages/tui/src/component/devtools-bar.tsx index 251d64ebcc8..538044397b8 100644 --- a/packages/tui/src/component/devtools-bar.tsx +++ b/packages/tui/src/component/devtools-bar.tsx @@ -150,7 +150,7 @@ export function DevToolsBar() { const sessionLocation = info?.location ?? (location.current - ? { directory: location.current.directory, workspaceID: location.current.workspaceID } + ? { directory: location.current.directory } : undefined) const details = server() const backend = { diff --git a/packages/tui/src/component/dialog-integration.tsx b/packages/tui/src/component/dialog-integration.tsx index 681111fe4bf..4d6fd1c1afa 100644 --- a/packages/tui/src/component/dialog-integration.tsx +++ b/packages/tui/src/component/dialog-integration.tsx @@ -1033,7 +1033,7 @@ function providerID(data: ReturnType, location: LocationRef, int } function locationQuery(location: LocationRef) { - return { directory: location.directory, workspace: location.workspaceID } + return { directory: location.directory } } function message(cause: unknown) { diff --git a/packages/tui/src/component/dialog-mcp.tsx b/packages/tui/src/component/dialog-mcp.tsx index e2c32baceb9..a85c2704767 100644 --- a/packages/tui/src/component/dialog-mcp.tsx +++ b/packages/tui/src/component/dialog-mcp.tsx @@ -119,7 +119,7 @@ export function DialogMcp(props: { initialServer?: string; details?: boolean } = } setLoading(name) const target = current() - const input = { server: name, location: { directory: target.directory, workspace: target.workspaceID } } + const input = { server: name, location: { directory: target.directory } } const call = server.status.status === "connected" ? client.api.mcp.disconnect(input) : client.api.mcp.connect(input) void call.catch(toast.error).finally(() => setLoading(null)) } diff --git a/packages/tui/src/component/dialog-open.tsx b/packages/tui/src/component/dialog-open.tsx index 4f4a3a888e9..c073ec25346 100644 --- a/packages/tui/src/component/dialog-open.tsx +++ b/packages/tui/src/component/dialog-open.tsx @@ -29,9 +29,9 @@ export const DialogOpenKey = Symbol("DialogOpen") type OpenTarget = | { type: "session"; sessionID: string } - | { type: "project"; directory: string; workspaceID?: string; projectID?: string } + | { type: "project"; directory: string; projectID?: string } -type OpenView = { type: "projects" } | { type: "worktrees"; projectID: string; workspaceID?: string } +type OpenView = { type: "projects" } | { type: "worktrees"; projectID: string } type OpenSelection = { view: OpenView; filter: string; selected?: OpenTarget } @@ -120,10 +120,6 @@ export function DialogOpen(props: { sessions: SessionInfo[]; onLoad: (sessions: pending = creation() setCreation(undefined) } - const workspaceID = () => { - const current = view() - return current.type === "worktrees" ? current.workspaceID : undefined - } const [worktrees] = createResource( () => (view().type === "worktrees" ? view() : undefined), () => @@ -131,7 +127,6 @@ export function DialogOpen(props: { sessions: SessionInfo[]; onLoad: (sessions: .list({ location: { directory: data.project.get(projectID()!)!.canonical, - workspace: workspaceID(), }, }) .catch((error: unknown) => { @@ -212,13 +207,11 @@ export function DialogOpen(props: { sessions: SessionInfo[]; onLoad: (sessions: ...data.project.list().flatMap((project) => [project.canonical, ...project.sandboxes].map((directory) => ({ directory, - workspaceID: current.workspaceID, project, })), ), ...sessions().map((session) => ({ directory: session.location.directory, - workspaceID: session.location.workspaceID, project: data.project.get(session.projectID), })), ] @@ -246,14 +239,12 @@ export function DialogOpen(props: { sessions: SessionInfo[]; onLoad: (sessions: value: { type: "project", directory: item.directory, - ...(item.workspaceID ? { workspaceID: item.workspaceID } : {}), ...(git ? { projectID: item.project!.id } : {}), } as OpenTarget, category: "Projects", gutter: - item.workspaceID === current.workspaceID && - (item.directory === current.directory || - (item.directory === location.current?.project.canonical && !seen.has(locationKey(current)))) + item.directory === current.directory || + (item.directory === location.current?.project.canonical && !seen.has(locationKey(current))) ? () => ● : undefined, } @@ -303,11 +294,9 @@ export function DialogOpen(props: { sessions: SessionInfo[]; onLoad: (sessions: return { title, footer: footer + " ".repeat(Math.max(0, width - stringWidth(footer))), - value: { type: "project", directory, ...(workspaceID() ? { workspaceID: workspaceID() } : {}) } as OpenTarget, + value: { type: "project", directory } as OpenTarget, gutter: - directory === current.directory && workspaceID() === current.workspaceID - ? () => ● - : undefined, + directory === current.directory ? () => ● : undefined, } }) }) @@ -384,12 +373,11 @@ export function DialogOpen(props: { sessions: SessionInfo[]; onLoad: (sessions: if (target?.type !== "project" || !target.projectID) return projectsSelection = snapshot() restore({ - view: { type: "worktrees", projectID: target.projectID, workspaceID: target.workspaceID }, + view: { type: "worktrees", projectID: target.projectID }, filter: "", selected: { type: "project", directory: target.directory, - ...(target.workspaceID ? { workspaceID: target.workspaceID } : {}), }, }) }, @@ -432,7 +420,6 @@ export function DialogOpen(props: { sessions: SessionInfo[]; onLoad: (sessions: } const target = { directory: option.value.directory, - ...(option.value.workspaceID ? { workspaceID: option.value.workspaceID } : {}), } route.navigate({ type: "home", location: target }) location.set(target) @@ -456,7 +443,6 @@ export function DialogOpen(props: { sessions: SessionInfo[]; onLoad: (sessions: .create({ location: { directory: data.project.get(id)!.canonical, - workspace: workspaceID(), }, ...(value.trim() ? { name: value.trim() } : {}), }) @@ -464,7 +450,6 @@ export function DialogOpen(props: { sessions: SessionInfo[]; onLoad: (sessions: if (closed || creation() !== previous) return const target = { directory: created.directory, - ...(workspaceID() ? { workspaceID: workspaceID() } : {}), } dialog.clear() route.navigate({ type: "home", location: target }) diff --git a/packages/tui/src/component/dialog-shell-output.tsx b/packages/tui/src/component/dialog-shell-output.tsx index 6e65c64e7b9..52e9e5a9a32 100644 --- a/packages/tui/src/component/dialog-shell-output.tsx +++ b/packages/tui/src/component/dialog-shell-output.tsx @@ -30,7 +30,7 @@ export function DialogShellOutput(props: { shell: ShellInfo; location: LocationR // The running-shell inventory drops exited commands. Keep this view tied to // the opened ID and its original Location, not the list's current selection. const id = props.shell.id - const location = { directory: props.location.directory, workspace: props.location.workspaceID } + const location = { directory: props.location.directory } let cursor: number | undefined let disposed = false let missing = false diff --git a/packages/tui/src/component/dialog-workspaces.tsx b/packages/tui/src/component/dialog-workspaces.tsx index 8298dad46f7..5761854191e 100644 --- a/packages/tui/src/component/dialog-workspaces.tsx +++ b/packages/tui/src/component/dialog-workspaces.tsx @@ -27,7 +27,7 @@ type ProjectDirectory = WorktreeListOutput[number] type DialogWorkspacesProps = { projectID: string - location?: { directory: string; workspaceID?: string } + location?: { directory: string } current?: WorkspaceSelection onSelect: (selection: WorkspaceSelection) => void onCurrentChange?: (selection: WorkspaceSelection) => void @@ -49,7 +49,6 @@ export function DialogWorkspaces(props: DialogWorkspacesProps) { const location = createMemo(() => sessionData.location.info(props.location)) const worktreeLocation = () => ({ directory: props.location?.directory ?? location()?.directory ?? paths.cwd, - workspace: props.location?.workspaceID ?? location()?.workspaceID, }) const [working, setWorking] = createSignal(Boolean(props.initialRemoving)) const [toDelete, setToDelete] = createSignal() diff --git a/packages/tui/src/component/prompt/autocomplete.tsx b/packages/tui/src/component/prompt/autocomplete.tsx index 1a7c7b2dc42..fe67dd635a7 100644 --- a/packages/tui/src/component/prompt/autocomplete.tsx +++ b/packages/tui/src/component/prompt/autocomplete.tsx @@ -330,7 +330,6 @@ export function Autocomplete(props: { const { lineRange, base } = parseFileLineRange(input.query ?? "") const requestLocation = { directory: input.location?.directory, - workspace: input.location?.workspaceID ?? data.location.default().workspaceID, } const width = props.anchor().width - 4 if (input.visible === "directory") { diff --git a/packages/tui/src/component/prompt/index.tsx b/packages/tui/src/component/prompt/index.tsx index 06a20b435a1..fb2f7fb95cc 100644 --- a/packages/tui/src/component/prompt/index.tsx +++ b/packages/tui/src/component/prompt/index.tsx @@ -335,8 +335,8 @@ export function Prompt(props: PromptProps) { let promptPartTypeId = 0 const event = useEvent() - event.on("tui.prompt.append", (evt, { workspace }) => { - if (workspace !== (currentLocation.current?.workspaceID ?? data.location.default().workspaceID)) return + event.on("tui.prompt.append", (evt, { directory }) => { + if (directory !== (currentLocation.current?.directory ?? data.location.default().directory)) return if (!input || input.isDestroyed) return input.insertText(evt.data.text) setTimeout(() => { @@ -1234,7 +1234,7 @@ export function Prompt(props: PromptProps) { session = data.session.get(created.id) newSession = { gate: created.request.then(async (info) => { - if (info.location.workspaceID === undefined && terminalEnvironment.variables !== undefined) { + if (terminalEnvironment.variables !== undefined) { await client.api.session.environment({ sessionID: created.id, variables: terminalEnvironment.variables }) } }), diff --git a/packages/tui/src/component/prompt/move.tsx b/packages/tui/src/component/prompt/move.tsx index 0ae9efa6bfb..5af11e1d749 100644 --- a/packages/tui/src/component/prompt/move.tsx +++ b/packages/tui/src/component/prompt/move.tsx @@ -39,7 +39,7 @@ export function usePromptMove(input: { projectID: () => string | undefined; sess const project = data.location.info(location)?.project if (!project) throw new Error("Unable to determine current project") const result = await client.api.worktree.create({ - location: { directory: location.directory, workspace: location.workspaceID }, + location: { directory: location.directory }, name, }) const directory = result.directory @@ -119,7 +119,7 @@ export function usePromptMove(input: { projectID: () => string | undefined; sess const current = data.location.info(location) if (current) return current.project.id return client.api.location - .get({ location: { directory: location.directory, workspace: location.workspaceID } }) + .get({ location: { directory: location.directory } }) .then((result) => result.project.id) .catch(() => undefined) } diff --git a/packages/tui/src/context/event.ts b/packages/tui/src/context/event.ts index 40519ea7bf5..f1740a6ebe5 100644 --- a/packages/tui/src/context/event.ts +++ b/packages/tui/src/context/event.ts @@ -3,7 +3,6 @@ import { useClient } from "./client" type EventMetadata = { directory: string | undefined - workspace: string | undefined } type OpenCodeEventMap = { [Type in OpenCodeEvent["type"]]: Extract } @@ -13,7 +12,7 @@ export function useEvent() { function subscribe(handler: (event: OpenCodeEvent, metadata: EventMetadata) => void) { return client.event.listen(({ details }) => { if (details.type === "server.connected") return - handler(details, { directory: details.location?.directory, workspace: details.location?.workspaceID }) + handler(details, { directory: details.location?.directory }) }) } @@ -22,7 +21,7 @@ export function useEvent() { handler: (event: OpenCodeEventMap[T], metadata: EventMetadata) => void, ) { return client.event.on(type, (event) => { - handler(event, { directory: event.location?.directory, workspace: event.location?.workspaceID }) + handler(event, { directory: event.location?.directory }) }) } diff --git a/packages/tui/src/feature-plugins/system/diff-viewer.tsx b/packages/tui/src/feature-plugins/system/diff-viewer.tsx index ce0e568dd8d..3ba35761ee2 100644 --- a/packages/tui/src/feature-plugins/system/diff-viewer.tsx +++ b/packages/tui/src/feature-plugins/system/diff-viewer.tsx @@ -102,7 +102,7 @@ function DiffViewer(props: { context: Plugin.Context }) { : props.context.data.location.default() }, undefined, - { equals: (a, b) => a.directory === b.directory && a.workspaceID === b.workspaceID }, + { equals: (a, b) => a.directory === b.directory }, ) const baseKey = createMemo(() => JSON.stringify([locationKey(location()), props.context.data.location.vcs.info(location())?.branch.current]), diff --git a/packages/tui/src/mini/catalog.shared.ts b/packages/tui/src/mini/catalog.shared.ts index 79edf22b370..28e6ef0a6e0 100644 --- a/packages/tui/src/mini/catalog.shared.ts +++ b/packages/tui/src/mini/catalog.shared.ts @@ -19,7 +19,6 @@ function location(ref: LocationRef) { return { location: { directory: ref.directory, - workspace: ref.workspaceID, }, } } diff --git a/packages/tui/src/mini/runtime.ts b/packages/tui/src/mini/runtime.ts index 3d3a200deaf..dbb0cf3fd18 100644 --- a/packages/tui/src/mini/runtime.ts +++ b/packages/tui/src/mini/runtime.ts @@ -153,7 +153,6 @@ function formRequestOptions(location: LocationRef | undefined) { return { headers: { "x-opencode-directory": encodeURIComponent(location.directory), - ...(location.workspaceID ? { "x-opencode-workspace": location.workspaceID } : {}), }, } } @@ -237,7 +236,7 @@ async function runInteractiveRuntime(input: RunRuntimeInput, deps: RunRuntimeDep .find({ query, type: "file", - location: { directory: state.location.directory, workspace: state.location.workspaceID }, + location: { directory: state.location.directory }, }) .then((result) => result.data.map((file) => file.path)) .catch(() => []), @@ -657,7 +656,6 @@ async function runInteractiveRuntime(input: RunRuntimeInput, deps: RunRuntimeDep { location: { directory: state.location.directory, - workspace: state.location.workspaceID, }, }, { signal: attempt.signal }, diff --git a/packages/tui/src/mini/stream-v2.transport.ts b/packages/tui/src/mini/stream-v2.transport.ts index e5937e32443..85606d2c8f4 100644 --- a/packages/tui/src/mini/stream-v2.transport.ts +++ b/packages/tui/src/mini/stream-v2.transport.ts @@ -182,11 +182,11 @@ function sessionID(event: RunV2Event) { } function sameLocation(left: LocationRef | undefined, right: LocationRef | undefined) { - return !!left && !!right && left.directory === right.directory && left.workspaceID === right.workspaceID + return !!left && !!right && left.directory === right.directory } function globalForm(form: FormInfo, location: LocationRef): MiniFormRequest { - return { ...form, location: { directory: location.directory, workspaceID: location.workspaceID } } + return { ...form, location: { directory: location.directory } } } function errorMessage(error: { message?: string; _tag?: string }) { @@ -461,7 +461,6 @@ async function resolveSelectedModel( ? { location: { directory: input.location.directory, - workspace: input.location.workspaceID, }, } : undefined, @@ -948,7 +947,7 @@ export async function createSessionTransport(input: StreamInput): Promise, - location: { directory: string; workspace?: string }, + location: { directory: string }, query: string, home: string, ) { diff --git a/packages/tui/src/routes/session/composer/shell-tab.tsx b/packages/tui/src/routes/session/composer/shell-tab.tsx index aca8089c37b..52c9d604bf9 100644 --- a/packages/tui/src/routes/session/composer/shell-tab.tsx +++ b/packages/tui/src/routes/session/composer/shell-tab.tsx @@ -103,7 +103,7 @@ export function ShellTab(props: { sessionID: string }) { if (!entry) return void client.api.shell.remove({ id: entry.id, - location: { directory: entry.location.directory, workspace: entry.location.workspaceID }, + location: { directory: entry.location.directory }, }) }, }, diff --git a/packages/tui/src/routes/session/index.tsx b/packages/tui/src/routes/session/index.tsx index d7c89621e95..6ba561d843b 100644 --- a/packages/tui/src/routes/session/index.tsx +++ b/packages/tui/src/routes/session/index.tsx @@ -1382,8 +1382,7 @@ export function Session(props: { undefined) if (!response) break diff --git a/packages/tui/src/routes/session/sidebar.tsx b/packages/tui/src/routes/session/sidebar.tsx index b4b0f67c4ef..03b04cb5a0c 100644 --- a/packages/tui/src/routes/session/sidebar.tsx +++ b/packages/tui/src/routes/session/sidebar.tsx @@ -46,9 +46,6 @@ export function Sidebar(props: { sessionID: string; overlay?: boolean }) { > {withTimestampedFallback(session())} - - {session().location.workspaceID} - { test("keeps shell state scoped to location", async () => { const events = createEventStream() const other = "/tmp/opencode/other" - const workspace = "ws_other" let removed: URL | undefined const calls = createFetch((url, request) => { if (url.pathname === "/api/shell/sh_other" && request.method === "DELETE") { @@ -2080,7 +2079,6 @@ test("keeps shell state scoped to location", async () => { return json({ location: { directory: requestDirectory ?? directory, - workspaceID: url.searchParams.get("location[workspace]") ?? undefined, project: { id: "proj_test", directory: requestDirectory ?? directory }, }, data: [ @@ -2131,10 +2129,10 @@ test("keeps shell state scoped to location", async () => { try { await wait(() => data.shell.list().some((shell) => shell.id === "sh_default")) - await data.shell.sync({ directory: other, workspaceID: workspace }) + await data.shell.sync({ directory: other }) expect(data.shell.list().map((shell) => shell.id)).toEqual(["sh_default"]) - expect(data.shell.list({ directory: other, workspaceID: workspace }).map((shell) => shell.id)).toEqual(["sh_other"]) + expect(data.shell.list({ directory: other }).map((shell) => shell.id)).toEqual(["sh_other"]) expect(data.shell.listBySession("ses_shared").map((shell) => [shell.id, shell.location.directory])).toEqual([ ["sh_default", directory], ["sh_other", other], @@ -2145,13 +2143,13 @@ test("keeps shell state scoped to location", async () => { app.mockInput.pressKey("d", { ctrl: true }) await wait(() => removed !== undefined) expect(removed?.searchParams.get("location[directory]")).toBe(other) - expect(removed?.searchParams.get("location[workspace]")).toBe(workspace) + expect(removed?.searchParams.has("location[workspace]")).toBe(false) events.emit({ id: "evt_shell_created", created: 0, type: "shell.created", - location: { directory: other, workspaceID: workspace }, + location: { directory: other }, data: { info: { id: "sh_live_other", @@ -2166,7 +2164,7 @@ test("keeps shell state scoped to location", async () => { }, }) await wait(() => - data.shell.list({ directory: other, workspaceID: workspace }).some((shell) => shell.id === "sh_live_other"), + data.shell.list({ directory: other }).some((shell) => shell.id === "sh_live_other"), ) expect(data.shell.list().map((shell) => shell.id)).toEqual(["sh_default"]) expect( @@ -2431,7 +2429,7 @@ test("adds, dismisses, and refreshes form requests", async () => { test("tracks global forms by location", async () => { const events = createEventStream() const calls = createFetch(undefined, events) - const other = { directory: "/tmp/opencode-other", workspaceID: "wrk_other" } + const other = { directory: "/tmp/opencode-other" } let data!: ReturnType let client!: ReturnType @@ -2496,16 +2494,14 @@ test("tracks global forms by location", async () => { test("syncs global forms once for each requested location", async () => { const events = createEventStream() const requests: URL[] = [] - const other = { directory: "/tmp/opencode-other", workspaceID: "wrk_other" } + const other = { directory: "/tmp/opencode-other" } const calls = createFetch((url) => { if (url.pathname !== "/api/form/request") return requests.push(url) const requestedDirectory = url.searchParams.get("location[directory]") ?? directory - const requestedWorkspace = url.searchParams.get("location[workspace]") ?? undefined return json({ location: { directory: requestedDirectory, - workspaceID: requestedWorkspace, project: { id: "proj_test", directory: requestedDirectory }, }, data: [ @@ -2548,7 +2544,7 @@ test("syncs global forms once for each requested location", async () => { expect(requests).toHaveLength(1) expect(requests[0]?.searchParams.get("location[directory]")).toBe(other.directory) - expect(requests[0]?.searchParams.get("location[workspace]")).toBe(other.workspaceID) + expect(requests[0]?.searchParams.has("location[workspace]")).toBe(false) expect(data.session.form.list("global", other)?.map((form) => form.id)).toEqual(["frm_other"]) expect(data.session.form.list("global", { directory })?.map((form) => form.id)).toEqual(["frm_default"]) @@ -2565,7 +2561,7 @@ test("resyncs global forms only for the active location after reconnect", async const requests: URL[] = [] const counts = new Map() const home = { directory: process.cwd() } - const other = { directory: "/tmp/opencode-other", workspaceID: "wrk_other" } + const other = { directory: "/tmp/opencode-other" } const calls = createFetch((url) => { if (url.pathname === "/api/location") return json({ ...home, project: { id: "proj_test", directory: home.directory } }) @@ -2581,13 +2577,11 @@ test("resyncs global forms only for the active location after reconnect", async if (url.pathname !== "/api/form/request") return requests.push(url) const requestedDirectory = url.searchParams.get("location[directory]") ?? home.directory - const requestedWorkspace = url.searchParams.get("location[workspace]") ?? undefined const count = (counts.get(requestedDirectory) ?? 0) + 1 counts.set(requestedDirectory, count) return json({ location: { directory: requestedDirectory, - workspaceID: requestedWorkspace, project: { id: "proj_test", directory: requestedDirectory }, }, data: [ @@ -2631,12 +2625,9 @@ test("resyncs global forms only for the active location after reconnect", async await wait(() => data.session.form.list("global", home)?.[0]?.id === "frm_default_2", 4000) expect(data.session.form.list("global", other)?.[0]?.id).toBe("frm_other_1") expect(requests).toHaveLength(1) - expect( - requests.map((url) => [ - url.searchParams.get("location[directory]") ?? directory, - url.searchParams.get("location[workspace]") ?? undefined, - ]), - ).toEqual([[home.directory, undefined]]) + expect(requests.map((url) => url.searchParams.get("location[directory]") ?? directory)).toEqual([ + home.directory, + ]) } finally { app.renderer.destroy() } diff --git a/packages/tui/test/cli/tui/dialog-integration.test.tsx b/packages/tui/test/cli/tui/dialog-integration.test.tsx index c2f73d89d57..331d8c7c68c 100644 --- a/packages/tui/test/cli/tui/dialog-integration.test.tsx +++ b/packages/tui/test/cli/tui/dialog-integration.test.tsx @@ -205,7 +205,7 @@ test("hides account rename and delete actions while the add account row is selec }) test("uses the active location for integration data and credential requests", async () => { - const location = { directory: "/remote/project", workspaceID: "workspace_test" } + const location = { directory: "/remote/project" } const fixture = await renderIntegration(location) try { @@ -235,9 +235,7 @@ async function renderIntegration(activeLocation?: LocationRef) { const directory = url.searchParams.get("location[directory]") ?? decodeURIComponent(request.headers.get("x-opencode-directory") ?? process.cwd()) - const workspaceID = - url.searchParams.get("location[workspace]") ?? request.headers.get("x-opencode-workspace") ?? undefined - const requestedLocation = { directory, ...(workspaceID ? { workspaceID } : {}) } + const requestedLocation = { directory } const location = { ...requestedLocation, project: { id: "proj_test", directory, canonical: directory }, diff --git a/packages/tui/test/cli/tui/dialog-open.test.tsx b/packages/tui/test/cli/tui/dialog-open.test.tsx index 07609c34a12..014d27e6f9f 100644 --- a/packages/tui/test/cli/tui/dialog-open.test.tsx +++ b/packages/tui/test/cli/tui/dialog-open.test.tsx @@ -242,7 +242,6 @@ test("loads Git worktrees only when drilling into a project or its associated di const root = path.resolve("/tmp/opencode/project") const current = path.resolve("/tmp/opencode/current-branch") const other = path.resolve("/tmp/opencode/other-branch") - const workspaceID = "ws_worktree" let requests = 0 const fixture = await renderOpen( (url) => { @@ -260,18 +259,16 @@ test("loads Git worktrees only when drilling into a project or its associated di if (url.pathname === "/api/location") return json({ directory: current, - workspaceID, project: { id: "proj_git", directory: current, canonical: root }, }) if (url.pathname !== "/api/worktree") return undefined expect(url.searchParams.get("location[directory]")).toBe(root) - expect(url.searchParams.get("location[workspace]")).toBe(workspaceID) requests++ return json([{ directory: other, strategy: "git" }, { directory: root }, { directory: current, strategy: "git" }]) }, async ({ data, location }) => { - await data.location.sync({ directory: current, workspaceID }) - location.set({ directory: current, workspaceID }) + await data.location.sync({ directory: current }) + location.set({ directory: current }) }, ) @@ -311,7 +308,7 @@ test("loads Git worktrees only when drilling into a project or its associated di await fixture.app.mockInput.typeText("other-branch") fixture.app.mockInput.pressEnter() await fixture.app.waitFor(() => fixture.route.data.type === "home") - expect(fixture.route.data).toEqual({ type: "home", location: { directory: other, workspaceID } }) + expect(fixture.route.data).toEqual({ type: "home", location: { directory: other } }) } finally { await fixture.dispose() } @@ -364,39 +361,6 @@ test("does not show or trigger worktree navigation for non-Git and global direct } }) -test("keeps session directory targets distinct across workspaces", async () => { - const directory = "/tmp/opencode/archive" - const fixture = await renderOpen((url) => { - if (url.pathname === "/api/project") return json([]) - if (url.pathname !== "/api/session") return undefined - return json({ - data: ["ws_first", "ws_second"].map((workspaceID, index) => ({ - id: `ses_${workspaceID}`, - projectID: "proj_archive", - title: `Archived session ${index}`, - location: { directory, workspaceID }, - cost: 0, - tokens: { input: 0, output: 0, reasoning: 0, cache: { read: 0, write: 0 } }, - time: { created: 1, updated: 2 - index }, - })), - cursor: {}, - }) - }) - try { - await fixture.app.waitForFrame((frame) => frame.includes("Archived session")) - await fixture.app.mockInput.typeText("archive") - const frame = await fixture.app.waitForFrame((frame) => frame.includes(directory)) - expect(frame.split("\n").filter((line) => line.includes(directory))).toHaveLength(2) - fixture.app.mockInput.pressArrow("down") - fixture.app.mockInput.pressEnter() - await fixture.app.waitFor(() => fixture.route.data.type === "home") - expect(fixture.route.data).toEqual({ type: "home", location: { directory, workspaceID: "ws_second" } }) - expect(fixture.location.ref).toEqual({ directory, workspaceID: "ws_second" }) - } finally { - await fixture.dispose() - } -}) - test("does not show the previous project's worktrees while loading another project", async () => { const pending = Promise.withResolvers() const fixture = await renderOpen((url) => { @@ -442,11 +406,10 @@ test("does not show the previous project's worktrees while loading another proje } }) -test.each(["", "search-ui"])("creates a worktree named '%s' and opens it in the current workspace", async (name) => { +test.each(["", "search-ui"])("creates a worktree named '%s' and opens it", async (name) => { const projectID = "proj_git_create" const root = path.resolve("/tmp/opencode/project") const created = path.resolve("/tmp/opencode/created-branch") - const workspaceID = "ws_create" let payload: unknown const fixture = await renderOpen( async (url, request) => { @@ -462,17 +425,16 @@ test.each(["", "search-ui"])("creates a worktree named '%s' and opens it in the }, ]) if (url.pathname === "/api/location") - return json({ directory: root, workspaceID, project: { id: projectID, directory: root, canonical: root } }) + return json({ directory: root, project: { id: projectID, directory: root, canonical: root } }) if (url.pathname !== "/api/worktree") return undefined expect(url.searchParams.get("location[directory]")).toBe(root) - expect(url.searchParams.get("location[workspace]")).toBe(workspaceID) if (request.method === "GET") return json([{ directory: root }]) payload = await request.json() return json({ directory: created }) }, async ({ data, location }) => { - await data.location.sync({ directory: root, workspaceID }) - location.set({ directory: root, workspaceID }) + await data.location.sync({ directory: root }) + location.set({ directory: root }) }, ) @@ -510,8 +472,8 @@ test.each(["", "search-ui"])("creates a worktree named '%s' and opens it in the await fixture.app.waitFor(() => fixture.route.data.type === "home") expect(payload).toEqual(name ? { name } : {}) - expect(fixture.route.data).toEqual({ type: "home", location: { directory: created, workspaceID } }) - expect(fixture.location.ref).toEqual({ directory: created, workspaceID }) + expect(fixture.route.data).toEqual({ type: "home", location: { directory: created } }) + expect(fixture.location.ref).toEqual({ directory: created }) } finally { await fixture.dispose() } diff --git a/packages/tui/test/cli/tui/prompt-move.test.tsx b/packages/tui/test/cli/tui/prompt-move.test.tsx index 133012f0212..aebeaf68f98 100644 --- a/packages/tui/test/cli/tui/prompt-move.test.tsx +++ b/packages/tui/test/cli/tui/prompt-move.test.tsx @@ -45,7 +45,7 @@ test.each([ await fixture.create() - expect(fixture.requests).toEqual([{ payload: { name: "fresh" }, directory: input.directory, workspace: null }]) + expect(fixture.requests).toEqual([{ payload: { name: "fresh" }, directory: input.directory }]) expect(fixture.data.location.info({ directory: created })?.project.canonical).toBe(clone) expect(fixture.reads.locations.filter((directory) => directory === input.directory)).toHaveLength(input.home ? 3 : 1) expect(fixture.reads.session).toBe(input.home ? 0 : 1) @@ -59,12 +59,11 @@ test.each([ test.each([ { name: "another clone", launch: main }, { name: "another project", launch: "/tmp/opencode/elsewhere", launchProjectID: "proj_launch" }, - { name: "another workspace", launch: main, workspaceID: "wrk_clone" }, ])("uses Home's selected location instead of launch in $name", async (input) => { const fixture = await renderMove({ ...input, directory: `${clone}/packages/tui`, home: true }) try { await fixture.data.location.syncInfo() - const selected = { directory: `${clone}/packages/tui`, workspaceID: input.workspaceID } + const selected = { directory: `${clone}/packages/tui` } fixture.location.set(selected) expect(fixture.data.location.default().directory).toBe(input.launch) expect(fixture.data.location.info(selected)).toBeUndefined() @@ -75,7 +74,7 @@ test.each([ expect(frame).toContain(clone) expect(frame.indexOf(clone)).toBeLessThan(frame.indexOf(main)) expect(fixture.requests).toEqual([ - { payload: { name: "fresh" }, directory: `${clone}/packages/tui`, workspace: input.workspaceID ?? null }, + { payload: { name: "fresh" }, directory: `${clone}/packages/tui` }, ]) expect(fixture.data.location.info(selected)?.project.canonical).toBe(clone) expect(fixture.moves).toEqual([]) @@ -215,7 +214,6 @@ async function renderMove(input: { return json({ message: "Location unavailable" }, { status: 503 }) return json({ directory, - workspaceID: url.searchParams.get("location[workspace]") ?? undefined, project, }) } @@ -249,7 +247,6 @@ async function renderMove(input: { requests.push({ payload: await request.json(), directory: url.searchParams.get("location[directory]"), - workspace: url.searchParams.get("location[workspace]"), }) return json({ directory: created }) } diff --git a/packages/tui/test/cli/tui/use-event.test.tsx b/packages/tui/test/cli/tui/use-event.test.tsx index 740f090b51b..34c5fe6fd03 100644 --- a/packages/tui/test/cli/tui/use-event.test.tsx +++ b/packages/tui/test/cli/tui/use-event.test.tsx @@ -9,8 +9,6 @@ import { createApi, createEventStream, createFetch } from "../../fixture/tui-cli import { TestTuiContexts } from "../../fixture/tui-environment" import type { LogLevel, LogSink } from "../../../src/context/log" -const projectID = "proj_test" - async function wait(fn: () => boolean, timeout = 2000) { const start = Date.now() while (!fn()) { @@ -19,13 +17,10 @@ async function wait(fn: () => boolean, timeout = 2000) { } } -function event( - payload: OpenCodeEvent, - input: { directory: string; project?: string; workspace?: string }, -): OpenCodeEvent { +function event(payload: OpenCodeEvent, input: { directory: string }): OpenCodeEvent { return { ...payload, - location: { directory: input.directory, workspaceID: input.workspace }, + location: { directory: input.directory }, } } @@ -55,7 +50,7 @@ async function mount(reconnect?: (signal: AbortSignal) => Promise<{ api: OpenCod const events = createEventStream() const calls = createFetch(undefined, events) const seen: OpenCodeEvent[] = [] - const workspaces: Array = [] + const directories: Array = [] let client!: ReturnType let done!: () => void const ready = new Promise((resolve) => { @@ -72,28 +67,28 @@ async function mount(reconnect?: (signal: AbortSignal) => Promise<{ api: OpenCod done() }} seen={seen} - workspaces={workspaces} + directories={directories} /> )) await ready - return { app, events, emit: events.emit, client, seen, workspaces } + return { app, events, emit: events.emit, client, seen, directories } } function Probe(props: { seen: OpenCodeEvent[] - workspaces: Array + directories: Array onReady: (ctx: { client: ReturnType }) => void }) { const client = useClient() const event = useEvent() onMount(() => { - event.subscribe((evt, { workspace }) => { + event.subscribe((evt, { directory }) => { props.seen.push(evt) - props.workspaces.push(workspace) + props.directories.push(directory) }) props.onReady({ client }) }) @@ -136,35 +131,35 @@ describe("useEvent", () => { }) test("delivers events for the current project", async () => { - const { app, emit, seen, workspaces } = await mount() + const { app, emit, seen, directories } = await mount() try { - emit(event(vcs("main"), { directory: "/tmp/other", project: projectID, workspace: "ws_a" })) + emit(event(vcs("main"), { directory: "/tmp/other" })) await wait(() => seen.length === 1) - expect(seen).toEqual([event(vcs("main"), { directory: "/tmp/other", workspace: "ws_a" })]) - expect(workspaces).toEqual(["ws_a"]) + expect(seen).toEqual([event(vcs("main"), { directory: "/tmp/other" })]) + expect(directories).toEqual(["/tmp/other"]) } finally { app.renderer.destroy() } }) - test("delivers current project events regardless of active workspace", async () => { + test("delivers current project events regardless of active directory", async () => { const { app, emit, seen } = await mount() try { - emit(event(vcs("ws"), { directory: "/tmp/other", project: projectID, workspace: "ws_b" })) + emit(event(vcs("ws"), { directory: "/tmp/other" })) await wait(() => seen.length === 1) - expect(seen).toEqual([event(vcs("ws"), { directory: "/tmp/other", workspace: "ws_b" })]) + expect(seen).toEqual([event(vcs("ws"), { directory: "/tmp/other" })]) } finally { app.renderer.destroy() } }) - test("delivers truly global events even when a workspace is active", async () => { + test("delivers truly global events", async () => { const { app, emit, seen } = await mount() try { diff --git a/packages/tui/test/component/dialog-shell-output.test.tsx b/packages/tui/test/component/dialog-shell-output.test.tsx index 14a133eae83..0da5e3fc84a 100644 --- a/packages/tui/test/component/dialog-shell-output.test.tsx +++ b/packages/tui/test/component/dialog-shell-output.test.tsx @@ -20,7 +20,7 @@ import { createTuiResolvedConfig } from "../fixture/tui-runtime" async function setup(width: number, output = "") { const temporary = await tmpdir() - const location = { directory: `${temporary.path}/original`, workspaceID: "workspace_fixture" } + const location = { directory: `${temporary.path}/original` } const shell: ShellInfo = { id: "sh_fixture", command: "render-scene --quality high", @@ -149,9 +149,7 @@ test.each([40, 100])("shell output opens, follows, scrolls, and survives exit at expect(reads.every((request) => request.url.searchParams.get("location[directory]") === app.location.directory)).toBe( true, ) - expect( - reads.every((request) => request.url.searchParams.get("location[workspace]") === app.location.workspaceID), - ).toBe(true) + expect(reads.every((request) => request.url.searchParams.has("location[workspace]") === false)).toBe(true) app.mockInput.pressEscape() await app.waitForFrame((frame) => !frame.includes("Shell output") && frame.includes("No shell commands")) diff --git a/packages/tui/test/mini/runtime.test.ts b/packages/tui/test/mini/runtime.test.ts index c26935e7fe6..98c2682fe85 100644 --- a/packages/tui/test/mini/runtime.test.ts +++ b/packages/tui/test/mini/runtime.test.ts @@ -230,19 +230,18 @@ describe("run interactive runtime", () => { sessionID: "global", formID: "frm_global", answer: { value: "yes" }, - location: { directory: "/remote work", workspaceID: "wrk_1" }, + location: { directory: "/remote work" }, }) expect(reply).toHaveBeenCalledWith( { sessionID: "global", formID: "frm_global", answer: { value: "yes" }, - location: { directory: "/remote work", workspaceID: "wrk_1" }, + location: { directory: "/remote work" }, }, { headers: { "x-opencode-directory": "%2Fremote%20work", - "x-opencode-workspace": "wrk_1", }, }, ) @@ -581,7 +580,7 @@ describe("run interactive runtime", () => { painted.resolve() await task - const query = { location: { directory: "/session", workspace: "work-1" } } + const query = { location: { directory: "/session" } } expect(getDirectory?.()).toBe("/session") if (!runtimeConfig) throw new Error("runtime lifecycle did not receive TUI config") expect(await runtimeConfig).toBe(tuiConfig) diff --git a/packages/tui/test/mini/stream-v2.transport.test.ts b/packages/tui/test/mini/stream-v2.transport.test.ts index b1a0f215c53..96dd3603152 100644 --- a/packages/tui/test/mini/stream-v2.transport.test.ts +++ b/packages/tui/test/mini/stream-v2.transport.test.ts @@ -900,18 +900,18 @@ describe("V2 mini transport", () => { await transport.close() }) - test("reduces nested form owners idempotently and filters global events by complete location", async () => { + test("reduces nested form owners idempotently and filters global events by directory", async () => { const events = feed() events.push(connected()) const client = sdk({ streams: [events], sessions: [{ id: "ses_child", parentID: "ses_1", title: "Child", time: { updated: 1 } }], - globalLocation: { directory: "/work", workspaceID: "wrk_1" }, + globalLocation: { directory: "/work" }, }) const ui = footer() const transport = await createSessionTransport({ sdk: client, - location: { directory: "/work", workspaceID: "wrk_1" }, + location: { directory: "/work" }, sessionID: "ses_1", thinking: false, footer: ui.api, @@ -939,7 +939,7 @@ describe("V2 mini transport", () => { id: "evt_global_wrong", created: 4, type: "form.created", - location: { directory: "/work", workspaceID: "wrk_other" }, + location: { directory: "/other" }, data: { form: eventForm(global) }, }) await Bun.sleep(0) @@ -952,7 +952,7 @@ describe("V2 mini transport", () => { id: "evt_global_right", created: 5, type: "form.created", - location: { directory: "/work", workspaceID: "wrk_1" }, + location: { directory: "/work" }, data: { form: eventForm(global) }, }) while ( @@ -965,7 +965,7 @@ describe("V2 mini transport", () => { type: "stream.view", view: { type: "form", - request: { id: "frm_global_live", location: { directory: "/work", workspaceID: "wrk_1" } }, + request: { id: "frm_global_live", location: { directory: "/work" } }, }, }) const beforeCancel = ui.events.filter((event) => event.type === "stream.view").length @@ -973,7 +973,7 @@ describe("V2 mini transport", () => { id: "evt_global_done", created: 6, type: "form.cancelled", - location: { directory: "/work", workspaceID: "wrk_1" }, + location: { directory: "/work" }, data: { id: global.id, sessionID: "global" }, }) while (ui.events.filter((event) => event.type === "stream.view").length === beforeCancel) await Bun.sleep(0) @@ -2833,7 +2833,7 @@ describe("V2 mini transport", () => { const ui = footer() const transport = await createSessionTransport({ sdk: client, - location: { directory: "/project", workspaceID: "wrk_1" }, + location: { directory: "/project" }, sessionID: "ses_1", thinking: false, footer: ui.api, @@ -2888,7 +2888,7 @@ describe("V2 mini transport", () => { { signal: undefined }, ) expect(defaultModel).toHaveBeenCalledWith( - { location: { directory: "/project", workspace: "wrk_1" } }, + { location: { directory: "/project" } }, { signal: undefined }, ) await transport.close() @@ -3556,7 +3556,6 @@ describe("V2 mini transport", () => { sdk: client, location: { directory: "/project", - workspaceID: "work-1", }, sessionID: "ses_1", thinking: false, @@ -3577,7 +3576,7 @@ describe("V2 mini transport", () => { id: `evt_${type}`, created: 0, type, - location: { directory: "/project", workspaceID: "work-1" }, + location: { directory: "/project" }, data: {}, }) events.push({ @@ -3600,13 +3599,6 @@ describe("V2 mini transport", () => { location: { directory: "/other" }, data: {}, }) - events.push({ - id: "evt_foreign_workspace_catalog", - created: 0, - type: "catalog.updated", - location: { directory: "/project", workspaceID: "work-2" }, - data: {}, - }) while (refreshes < 9) await Bun.sleep(0) await Bun.sleep(0) diff --git a/packages/tui/test/prompt/autocomplete.test.ts b/packages/tui/test/prompt/autocomplete.test.ts index 5e9bf6bd0b0..2871a850b82 100644 --- a/packages/tui/test/prompt/autocomplete.test.ts +++ b/packages/tui/test/prompt/autocomplete.test.ts @@ -12,14 +12,17 @@ import { } from "../../src/prompt/directory-completion" describe("directoryAutocomplete", () => { - test("lists parents and siblings through the current workspace without changing location", async () => { - const location = { directory: "/project/current", workspace: "workspace_1" } + test("lists parents and siblings without changing location", async () => { + const location = { directory: "/project/current" } const calls: unknown[] = [] const file = { list: async (input: unknown) => { calls.push(input) return { - location: { directory: location.directory, workspaceID: location.workspace }, + location: { + directory: location.directory, + project: { id: "proj_test", directory: "/project", canonical: "/project" }, + }, data: [ { path: "./", type: "directory" }, { path: "../sibling/", type: "directory" }, @@ -44,13 +47,16 @@ describe("directoryAutocomplete", () => { }) test("resolves home and nested sibling completions against the current location", async () => { - const location = { directory: "/project/current", workspace: "workspace_1" } + const location = { directory: "/project/current" } const calls: unknown[] = [] const file = { list: async (input: unknown) => { calls.push(input) return { - location: { directory: location.directory }, + location: { + directory: location.directory, + project: { id: "proj_test", directory: "/project", canonical: "/project" }, + }, data: [{ path: "../sibling/src/", type: "directory" }], } }, diff --git a/services/www/openapi.json b/services/www/openapi.json index 365ba527475..72f0a331176 100644 --- a/services/www/openapi.json +++ b/services/www/openapi.json @@ -70,16 +70,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -97,11 +87,11 @@ "security": [], "responses": { "200": { - "description": "Location.Info", + "description": "Location.PublicInfo", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" } } } @@ -153,16 +143,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -187,7 +167,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "type": "array", @@ -257,16 +237,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -291,7 +261,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "$ref": "#/components/schemas/Agent.Info" @@ -360,16 +330,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -394,7 +354,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "type": "array", @@ -456,16 +416,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -532,16 +482,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -566,7 +506,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "type": "array", @@ -658,16 +598,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -754,22 +684,6 @@ "tags": ["session"], "operationId": "session.list", "parameters": [ - { - "name": "workspace", - "in": "query", - "schema": { - "anyOf": [ - { - "type": "string", - "pattern": "^wrk" - }, - { - "type": "null" - } - ] - }, - "required": false - }, { "name": "limit", "in": "query", @@ -1047,7 +961,7 @@ "location": { "anyOf": [ { - "$ref": "#/components/schemas/Location.Ref" + "$ref": "#/components/schemas/Location.PublicRef" }, { "type": "null" @@ -1301,7 +1215,7 @@ "location": { "anyOf": [ { - "$ref": "#/components/schemas/Location.Ref" + "$ref": "#/components/schemas/Location.PublicRef" }, { "type": "null" @@ -1998,10 +1912,6 @@ "directory": { "type": "string" }, - "workspaceID": { - "type": "string", - "pattern": "^wrk" - }, "delivery": { "anyOf": [ { @@ -4710,16 +4620,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -4744,7 +4644,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "type": "array", @@ -4816,16 +4716,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -4850,7 +4740,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "anyOf": [ @@ -5012,16 +4902,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -5046,7 +4926,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "type": "array", @@ -5126,16 +5006,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -5160,7 +5030,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "$ref": "#/components/schemas/Provider.Info" @@ -5239,16 +5109,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -5273,7 +5133,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "type": "array", @@ -5343,16 +5203,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -5377,7 +5227,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "anyOf": [ @@ -5443,16 +5293,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -5551,16 +5391,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -5679,16 +5509,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -5713,7 +5533,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "$ref": "#/components/schemas/Integration.AttemptEncoded" @@ -5832,16 +5652,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -5866,7 +5676,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "$ref": "#/components/schemas/Integration.AttemptStatus" @@ -5939,16 +5749,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -6031,16 +5831,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -6145,16 +5935,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -6179,7 +5959,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "$ref": "#/components/schemas/Integration.CommandAttempt" @@ -6288,16 +6068,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -6322,7 +6092,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "$ref": "#/components/schemas/Integration.CommandAttemptStatus" @@ -6395,16 +6165,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -6471,16 +6231,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -6505,7 +6255,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "type": "array", @@ -6575,16 +6325,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -6681,16 +6421,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -6775,16 +6505,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -6869,16 +6589,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -6955,16 +6665,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -6989,7 +6689,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "$ref": "#/components/schemas/Mcp.ResourceCatalog" @@ -7056,16 +6756,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -7155,16 +6845,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -7239,16 +6919,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -7446,16 +7116,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -7480,7 +7140,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "type": "array", @@ -8070,16 +7730,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -8104,7 +7754,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "type": "array", @@ -8759,16 +8409,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -8853,16 +8493,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -8903,7 +8533,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "type": "array", @@ -8965,16 +8595,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -9031,7 +8651,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "type": "array", @@ -9093,16 +8713,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -9127,7 +8737,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "type": "array", @@ -9189,16 +8799,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -9223,7 +8823,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "type": "array", @@ -9301,16 +8901,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -9534,16 +9124,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -9568,7 +9148,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "type": "array", @@ -9628,16 +9208,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -9662,7 +9232,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "$ref": "#/components/schemas/Pty" @@ -9764,16 +9334,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -9798,7 +9358,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "$ref": "#/components/schemas/Pty" @@ -9874,16 +9434,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -9908,7 +9458,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "$ref": "#/components/schemas/Pty" @@ -10015,16 +9565,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -10125,16 +9665,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -10159,7 +9689,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "$ref": "#/components/schemas/PtyTicket.ConnectToken" @@ -10237,13 +9767,6 @@ "type": "string" } }, - { - "in": "query", - "name": "location[workspace]", - "schema": { - "type": "string" - } - }, { "in": "query", "name": "cursor", @@ -11223,16 +10746,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -11257,7 +10770,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "type": "array", @@ -11317,16 +10830,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -11351,7 +10854,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "$ref": "#/components/schemas/Shell.Info" @@ -11446,16 +10949,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -11480,7 +10973,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "$ref": "#/components/schemas/Shell.Info" @@ -11556,16 +11049,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -11651,16 +11134,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -11685,7 +11158,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "$ref": "#/components/schemas/Shell.Info" @@ -11781,16 +11254,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -11833,7 +11296,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "type": "object", @@ -11920,16 +11383,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -11954,7 +11407,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "type": "array", @@ -12016,16 +11469,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -12104,16 +11547,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -12202,16 +11635,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -12295,16 +11718,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -12356,166 +11769,6 @@ "summary": "Refresh worktrees" } }, - "/api/workspace": { - "post": { - "tags": ["workspace"], - "operationId": "workspace.create", - "parameters": [], - "security": [], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "data": { - "type": "string", - "pattern": "^wrk" - } - }, - "required": ["data"], - "additionalProperties": false - } - } - } - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestErrorEncoded" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedErrorEncoded" - } - } - } - }, - "404": { - "description": "ProviderNotFoundError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProviderNotFoundErrorEncoded" - } - } - } - }, - "409": { - "description": "ConflictError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ConflictErrorEncoded" - } - } - } - } - }, - "description": "Create a logical workspace. A caller-supplied ID is idempotent when retried with the same provider; reusing it with another provider returns a conflict.", - "summary": "Create workspace", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "id": { - "anyOf": [ - { - "type": "string", - "pattern": "^wrk" - }, - { - "type": "null" - } - ] - }, - "provider": { - "type": "string" - } - }, - "required": ["provider"], - "additionalProperties": false - } - } - }, - "required": true - } - } - }, - "/api/workspace/{workspaceID}": { - "delete": { - "tags": ["workspace"], - "operationId": "workspace.destroy", - "parameters": [ - { - "name": "workspaceID", - "in": "path", - "schema": { - "type": "string", - "pattern": "^wrk" - }, - "required": true - } - ], - "security": [], - "responses": { - "200": { - "description": "Reports whether this request destroyed an existing workspace.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/WorkspaceDestroyResult" - } - } - } - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestErrorEncoded" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedErrorEncoded" - } - } - } - }, - "500": { - "description": "UnknownError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnknownErrorEncoded" - } - } - } - } - }, - "description": "Make a workspace not exist. This operation is idempotent: an already-missing workspace succeeds with `destroyed: false`, while a workspace removed by this request returns `destroyed: true`.", - "summary": "Destroy workspace" - } - }, "/api/vcs": { "get": { "tags": ["vcs"], @@ -12538,16 +11791,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -12572,7 +11815,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "$ref": "#/components/schemas/Vcs.Info" @@ -12631,16 +11874,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -12665,7 +11898,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "anyOf": [ @@ -12741,16 +11974,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -12775,7 +11998,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "type": "array", @@ -12837,16 +12060,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -12901,7 +12114,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "$ref": "#/components/schemas/Vcs.BranchList" @@ -12960,16 +12173,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -13025,7 +12228,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "type": "array", @@ -13089,7 +12292,7 @@ "schema": { "type": "array", "items": { - "$ref": "#/components/schemas/Location.Ref" + "$ref": "#/components/schemas/Location.PublicRef" } } } @@ -13140,16 +12343,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -13327,16 +12520,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -13361,7 +12544,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "type": "array", @@ -13433,16 +12616,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -13467,7 +12640,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "$ref": "#/components/schemas/WebSearch.ResponseEncoded" @@ -13563,16 +12736,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -16187,16 +15350,12 @@ "required": ["_tag", "message"], "additionalProperties": false }, - "Location.InfoEncoded": { + "Location.PublicInfo": { "type": "object", "properties": { "directory": { "type": "string" }, - "workspaceID": { - "type": "string", - "pattern": "^wrk" - }, "project": { "type": "object", "properties": { @@ -16217,15 +15376,11 @@ "required": ["directory", "project"], "additionalProperties": false }, - "Location.Ref": { + "Location.PublicRef": { "type": "object", "properties": { "directory": { "type": "string" - }, - "workspaceID": { - "type": "string", - "pattern": "^wrk" } }, "required": ["directory"], @@ -18091,30 +17246,30 @@ "type": "string", "enum": ["move"] }, - "payload": { - "$ref": "#/components/schemas/Session.Inbox.MovePayload" - }, "delivery": { "$ref": "#/components/schemas/Session.Inbox.Delivery" + }, + "payload": { + "$ref": "#/components/schemas/Session.Inbox.MovePayload" } }, - "required": ["id", "sessionID", "timeCreated", "type", "payload", "delivery"], + "required": ["id", "sessionID", "timeCreated", "type", "delivery", "payload"], "additionalProperties": false }, "Session.Inbox.MovePayload": { "type": "object", "properties": { - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, "projectID": { "type": "string" }, "subpath": { "type": "string" + }, + "location": { + "$ref": "#/components/schemas/Location.PublicRef" } }, - "required": ["location", "projectID"], + "required": ["projectID", "location"], "additionalProperties": false }, "Session.Inbox.Synthetic": { @@ -18289,9 +17444,6 @@ "title": { "type": "string" }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, "subpath": { "type": "string" }, @@ -18303,6 +17455,9 @@ }, "revert": { "$ref": "#/components/schemas/Session.Revert" + }, + "location": { + "$ref": "#/components/schemas/Location.PublicRef" } }, "required": ["id", "projectID", "cost", "tokens", "time", "location"], @@ -18810,30 +17965,37 @@ "type": "string", "enum": ["location-switched"] }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, "projectID": { "type": "string" }, "subpath": { "type": "string" }, + "location": { + "$ref": "#/components/schemas/Location.PublicRef" + }, "previous": { - "type": "object", - "properties": { - "location": { - "$ref": "#/components/schemas/Location.Ref" + "anyOf": [ + { + "type": "object", + "properties": { + "location": { + "$ref": "#/components/schemas/Location.PublicRef" + }, + "projectID": { + "type": "string" + }, + "subpath": { + "type": "string" + } + }, + "required": ["location"], + "additionalProperties": false }, - "projectID": { - "type": "string" - }, - "subpath": { - "type": "string" + { + "type": "null" } - }, - "required": ["location"], - "additionalProperties": false + ] } }, "required": ["id", "time", "type", "location"], @@ -20038,18 +19200,6 @@ "required": ["url", "time"], "additionalProperties": false }, - "WorkspaceDestroyResult": { - "type": "object", - "properties": { - "destroyed": { - "type": "boolean", - "description": "True when this request transitioned the workspace from existing to destroyed." - } - }, - "required": ["destroyed"], - "additionalProperties": false, - "description": "Reports whether this request destroyed an existing workspace." - }, "Worktree.CreateInput": { "type": "object", "properties": { @@ -20245,10 +19395,6 @@ "name": "worktree", "description": "Location-scoped worktree management routes." }, - { - "name": "workspace", - "description": "Workspace lifecycle routes." - }, { "name": "vcs", "description": "Location-scoped version control routes." diff --git a/services/www/public/openapi.json b/services/www/public/openapi.json index 365ba527475..72f0a331176 100644 --- a/services/www/public/openapi.json +++ b/services/www/public/openapi.json @@ -70,16 +70,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -97,11 +87,11 @@ "security": [], "responses": { "200": { - "description": "Location.Info", + "description": "Location.PublicInfo", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" } } } @@ -153,16 +143,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -187,7 +167,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "type": "array", @@ -257,16 +237,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -291,7 +261,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "$ref": "#/components/schemas/Agent.Info" @@ -360,16 +330,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -394,7 +354,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "type": "array", @@ -456,16 +416,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -532,16 +482,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -566,7 +506,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "type": "array", @@ -658,16 +598,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -754,22 +684,6 @@ "tags": ["session"], "operationId": "session.list", "parameters": [ - { - "name": "workspace", - "in": "query", - "schema": { - "anyOf": [ - { - "type": "string", - "pattern": "^wrk" - }, - { - "type": "null" - } - ] - }, - "required": false - }, { "name": "limit", "in": "query", @@ -1047,7 +961,7 @@ "location": { "anyOf": [ { - "$ref": "#/components/schemas/Location.Ref" + "$ref": "#/components/schemas/Location.PublicRef" }, { "type": "null" @@ -1301,7 +1215,7 @@ "location": { "anyOf": [ { - "$ref": "#/components/schemas/Location.Ref" + "$ref": "#/components/schemas/Location.PublicRef" }, { "type": "null" @@ -1998,10 +1912,6 @@ "directory": { "type": "string" }, - "workspaceID": { - "type": "string", - "pattern": "^wrk" - }, "delivery": { "anyOf": [ { @@ -4710,16 +4620,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -4744,7 +4644,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "type": "array", @@ -4816,16 +4716,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -4850,7 +4740,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "anyOf": [ @@ -5012,16 +4902,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -5046,7 +4926,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "type": "array", @@ -5126,16 +5006,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -5160,7 +5030,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "$ref": "#/components/schemas/Provider.Info" @@ -5239,16 +5109,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -5273,7 +5133,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "type": "array", @@ -5343,16 +5203,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -5377,7 +5227,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "anyOf": [ @@ -5443,16 +5293,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -5551,16 +5391,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -5679,16 +5509,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -5713,7 +5533,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "$ref": "#/components/schemas/Integration.AttemptEncoded" @@ -5832,16 +5652,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -5866,7 +5676,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "$ref": "#/components/schemas/Integration.AttemptStatus" @@ -5939,16 +5749,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -6031,16 +5831,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -6145,16 +5935,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -6179,7 +5959,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "$ref": "#/components/schemas/Integration.CommandAttempt" @@ -6288,16 +6068,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -6322,7 +6092,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "$ref": "#/components/schemas/Integration.CommandAttemptStatus" @@ -6395,16 +6165,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -6471,16 +6231,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -6505,7 +6255,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "type": "array", @@ -6575,16 +6325,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -6681,16 +6421,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -6775,16 +6505,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -6869,16 +6589,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -6955,16 +6665,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -6989,7 +6689,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "$ref": "#/components/schemas/Mcp.ResourceCatalog" @@ -7056,16 +6756,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -7155,16 +6845,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -7239,16 +6919,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -7446,16 +7116,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -7480,7 +7140,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "type": "array", @@ -8070,16 +7730,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -8104,7 +7754,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "type": "array", @@ -8759,16 +8409,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -8853,16 +8493,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -8903,7 +8533,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "type": "array", @@ -8965,16 +8595,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -9031,7 +8651,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "type": "array", @@ -9093,16 +8713,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -9127,7 +8737,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "type": "array", @@ -9189,16 +8799,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -9223,7 +8823,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "type": "array", @@ -9301,16 +8901,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -9534,16 +9124,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -9568,7 +9148,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "type": "array", @@ -9628,16 +9208,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -9662,7 +9232,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "$ref": "#/components/schemas/Pty" @@ -9764,16 +9334,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -9798,7 +9358,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "$ref": "#/components/schemas/Pty" @@ -9874,16 +9434,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -9908,7 +9458,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "$ref": "#/components/schemas/Pty" @@ -10015,16 +9565,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -10125,16 +9665,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -10159,7 +9689,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "$ref": "#/components/schemas/PtyTicket.ConnectToken" @@ -10237,13 +9767,6 @@ "type": "string" } }, - { - "in": "query", - "name": "location[workspace]", - "schema": { - "type": "string" - } - }, { "in": "query", "name": "cursor", @@ -11223,16 +10746,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -11257,7 +10770,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "type": "array", @@ -11317,16 +10830,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -11351,7 +10854,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "$ref": "#/components/schemas/Shell.Info" @@ -11446,16 +10949,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -11480,7 +10973,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "$ref": "#/components/schemas/Shell.Info" @@ -11556,16 +11049,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -11651,16 +11134,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -11685,7 +11158,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "$ref": "#/components/schemas/Shell.Info" @@ -11781,16 +11254,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -11833,7 +11296,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "type": "object", @@ -11920,16 +11383,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -11954,7 +11407,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "type": "array", @@ -12016,16 +11469,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -12104,16 +11547,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -12202,16 +11635,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -12295,16 +11718,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -12356,166 +11769,6 @@ "summary": "Refresh worktrees" } }, - "/api/workspace": { - "post": { - "tags": ["workspace"], - "operationId": "workspace.create", - "parameters": [], - "security": [], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "data": { - "type": "string", - "pattern": "^wrk" - } - }, - "required": ["data"], - "additionalProperties": false - } - } - } - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestErrorEncoded" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedErrorEncoded" - } - } - } - }, - "404": { - "description": "ProviderNotFoundError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProviderNotFoundErrorEncoded" - } - } - } - }, - "409": { - "description": "ConflictError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ConflictErrorEncoded" - } - } - } - } - }, - "description": "Create a logical workspace. A caller-supplied ID is idempotent when retried with the same provider; reusing it with another provider returns a conflict.", - "summary": "Create workspace", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "id": { - "anyOf": [ - { - "type": "string", - "pattern": "^wrk" - }, - { - "type": "null" - } - ] - }, - "provider": { - "type": "string" - } - }, - "required": ["provider"], - "additionalProperties": false - } - } - }, - "required": true - } - } - }, - "/api/workspace/{workspaceID}": { - "delete": { - "tags": ["workspace"], - "operationId": "workspace.destroy", - "parameters": [ - { - "name": "workspaceID", - "in": "path", - "schema": { - "type": "string", - "pattern": "^wrk" - }, - "required": true - } - ], - "security": [], - "responses": { - "200": { - "description": "Reports whether this request destroyed an existing workspace.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/WorkspaceDestroyResult" - } - } - } - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestErrorEncoded" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedErrorEncoded" - } - } - } - }, - "500": { - "description": "UnknownError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnknownErrorEncoded" - } - } - } - } - }, - "description": "Make a workspace not exist. This operation is idempotent: an already-missing workspace succeeds with `destroyed: false`, while a workspace removed by this request returns `destroyed: true`.", - "summary": "Destroy workspace" - } - }, "/api/vcs": { "get": { "tags": ["vcs"], @@ -12538,16 +11791,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -12572,7 +11815,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "$ref": "#/components/schemas/Vcs.Info" @@ -12631,16 +11874,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -12665,7 +11898,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "anyOf": [ @@ -12741,16 +11974,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -12775,7 +11998,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "type": "array", @@ -12837,16 +12060,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -12901,7 +12114,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "$ref": "#/components/schemas/Vcs.BranchList" @@ -12960,16 +12173,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -13025,7 +12228,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "type": "array", @@ -13089,7 +12292,7 @@ "schema": { "type": "array", "items": { - "$ref": "#/components/schemas/Location.Ref" + "$ref": "#/components/schemas/Location.PublicRef" } } } @@ -13140,16 +12343,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -13327,16 +12520,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -13361,7 +12544,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "type": "array", @@ -13433,16 +12616,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -13467,7 +12640,7 @@ "type": "object", "properties": { "location": { - "$ref": "#/components/schemas/Location.InfoEncoded" + "$ref": "#/components/schemas/Location.PublicInfo" }, "data": { "$ref": "#/components/schemas/WebSearch.ResponseEncoded" @@ -13563,16 +12736,6 @@ "type": "null" } ] - }, - "workspace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] } }, "additionalProperties": false @@ -16187,16 +15350,12 @@ "required": ["_tag", "message"], "additionalProperties": false }, - "Location.InfoEncoded": { + "Location.PublicInfo": { "type": "object", "properties": { "directory": { "type": "string" }, - "workspaceID": { - "type": "string", - "pattern": "^wrk" - }, "project": { "type": "object", "properties": { @@ -16217,15 +15376,11 @@ "required": ["directory", "project"], "additionalProperties": false }, - "Location.Ref": { + "Location.PublicRef": { "type": "object", "properties": { "directory": { "type": "string" - }, - "workspaceID": { - "type": "string", - "pattern": "^wrk" } }, "required": ["directory"], @@ -18091,30 +17246,30 @@ "type": "string", "enum": ["move"] }, - "payload": { - "$ref": "#/components/schemas/Session.Inbox.MovePayload" - }, "delivery": { "$ref": "#/components/schemas/Session.Inbox.Delivery" + }, + "payload": { + "$ref": "#/components/schemas/Session.Inbox.MovePayload" } }, - "required": ["id", "sessionID", "timeCreated", "type", "payload", "delivery"], + "required": ["id", "sessionID", "timeCreated", "type", "delivery", "payload"], "additionalProperties": false }, "Session.Inbox.MovePayload": { "type": "object", "properties": { - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, "projectID": { "type": "string" }, "subpath": { "type": "string" + }, + "location": { + "$ref": "#/components/schemas/Location.PublicRef" } }, - "required": ["location", "projectID"], + "required": ["projectID", "location"], "additionalProperties": false }, "Session.Inbox.Synthetic": { @@ -18289,9 +17444,6 @@ "title": { "type": "string" }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, "subpath": { "type": "string" }, @@ -18303,6 +17455,9 @@ }, "revert": { "$ref": "#/components/schemas/Session.Revert" + }, + "location": { + "$ref": "#/components/schemas/Location.PublicRef" } }, "required": ["id", "projectID", "cost", "tokens", "time", "location"], @@ -18810,30 +17965,37 @@ "type": "string", "enum": ["location-switched"] }, - "location": { - "$ref": "#/components/schemas/Location.Ref" - }, "projectID": { "type": "string" }, "subpath": { "type": "string" }, + "location": { + "$ref": "#/components/schemas/Location.PublicRef" + }, "previous": { - "type": "object", - "properties": { - "location": { - "$ref": "#/components/schemas/Location.Ref" + "anyOf": [ + { + "type": "object", + "properties": { + "location": { + "$ref": "#/components/schemas/Location.PublicRef" + }, + "projectID": { + "type": "string" + }, + "subpath": { + "type": "string" + } + }, + "required": ["location"], + "additionalProperties": false }, - "projectID": { - "type": "string" - }, - "subpath": { - "type": "string" + { + "type": "null" } - }, - "required": ["location"], - "additionalProperties": false + ] } }, "required": ["id", "time", "type", "location"], @@ -20038,18 +19200,6 @@ "required": ["url", "time"], "additionalProperties": false }, - "WorkspaceDestroyResult": { - "type": "object", - "properties": { - "destroyed": { - "type": "boolean", - "description": "True when this request transitioned the workspace from existing to destroyed." - } - }, - "required": ["destroyed"], - "additionalProperties": false, - "description": "Reports whether this request destroyed an existing workspace." - }, "Worktree.CreateInput": { "type": "object", "properties": { @@ -20245,10 +19395,6 @@ "name": "worktree", "description": "Location-scoped worktree management routes." }, - { - "name": "workspace", - "description": "Workspace lifecycle routes." - }, { "name": "vcs", "description": "Location-scoped version control routes."