From 80865407e084a20d1e8677ac12ad2cc1d7767a4a Mon Sep 17 00:00:00 2001 From: Dax Raad Date: Sun, 26 Jul 2026 02:47:43 -0400 Subject: [PATCH] refactor(sdk): remove local legacy package --- .changeset/bright-sols-write.md | 5 - .changeset/calm-services-start.md | 7 - .changeset/calm-sessions-header.md | 5 - .changeset/canonical-tool-results.md | 8 - .changeset/clean-sessions-generate.md | 7 - .changeset/fresh-composers-slot.md | 5 - .changeset/quick-caches-roll.md | 5 - bun.lock | 91 +- bunfig.toml | 2 +- github/package.json | 2 +- package.json | 3 +- packages/app/package.json | 2 +- .../console/app/src/routes/openapi.json.ts | 2 +- packages/plugin/package.json | 2 +- packages/protocol/openapi.json | 29592 +++++++++++++ packages/protocol/package.json | 2 + packages/protocol/script/generate-openapi.ts | 16 + packages/sdk/.gitignore | 10 - packages/sdk/js/example/example.ts | 56 - packages/sdk/js/package.json | 35 - packages/sdk/js/script/build.ts | 424 - packages/sdk/js/script/publish.ts | 45 - packages/sdk/js/src/client.ts | 57 - packages/sdk/js/src/error-interceptor.ts | 51 - packages/sdk/js/src/gen/client.gen.ts | 22 - packages/sdk/js/src/gen/client/client.gen.ts | 212 - packages/sdk/js/src/gen/client/index.ts | 25 - packages/sdk/js/src/gen/client/types.gen.ts | 222 - packages/sdk/js/src/gen/client/utils.gen.ts | 287 - packages/sdk/js/src/gen/core/auth.gen.ts | 41 - .../sdk/js/src/gen/core/bodySerializer.gen.ts | 74 - packages/sdk/js/src/gen/core/params.gen.ts | 144 - .../sdk/js/src/gen/core/pathSerializer.gen.ts | 167 - .../js/src/gen/core/queryKeySerializer.gen.ts | 111 - .../js/src/gen/core/serverSentEvents.gen.ts | 210 - packages/sdk/js/src/gen/core/types.gen.ts | 91 - packages/sdk/js/src/gen/core/utils.gen.ts | 109 - packages/sdk/js/src/gen/sdk.gen.ts | 1184 - packages/sdk/js/src/gen/types.gen.ts | 3843 -- packages/sdk/js/src/index.ts | 21 - packages/sdk/js/src/process.ts | 31 - packages/sdk/js/src/server.ts | 134 - packages/sdk/js/src/v2/client.ts | 97 - packages/sdk/js/src/v2/data.ts | 32 - packages/sdk/js/src/v2/gen/client.gen.ts | 18 - .../sdk/js/src/v2/gen/client/client.gen.ts | 285 - packages/sdk/js/src/v2/gen/client/index.ts | 25 - .../sdk/js/src/v2/gen/client/types.gen.ts | 202 - .../sdk/js/src/v2/gen/client/utils.gen.ts | 294 - packages/sdk/js/src/v2/gen/core/auth.gen.ts | 41 - .../js/src/v2/gen/core/bodySerializer.gen.ts | 82 - packages/sdk/js/src/v2/gen/core/params.gen.ts | 169 - .../js/src/v2/gen/core/pathSerializer.gen.ts | 167 - .../src/v2/gen/core/queryKeySerializer.gen.ts | 111 - .../src/v2/gen/core/serverSentEvents.gen.ts | 239 - packages/sdk/js/src/v2/gen/core/types.gen.ts | 86 - packages/sdk/js/src/v2/gen/core/utils.gen.ts | 137 - packages/sdk/js/src/v2/gen/sdk.gen.ts | 8828 ---- packages/sdk/js/src/v2/gen/types.gen.ts | 19353 -------- packages/sdk/js/src/v2/index.ts | 23 - packages/sdk/js/src/v2/server.ts | 134 - packages/sdk/js/sst-env.d.ts | 10 - packages/sdk/js/test/session-history.test.ts | 12 - packages/sdk/js/tsconfig.json | 14 - packages/sdk/openapi.json | 36699 ---------------- packages/session-ui/package.json | 2 +- packages/slack/package.json | 2 +- packages/www/openapi.json | 3991 +- packages/www/package.json | 4 +- packages/www/public/openapi.json | 3991 +- packages/www/script/generate-openapi.ts | 18 + script/generate.ts | 4 +- script/publish.ts | 4 - script/raw-changelog.ts | 4 +- 74 files changed, 36097 insertions(+), 76343 deletions(-) delete mode 100644 .changeset/bright-sols-write.md delete mode 100644 .changeset/calm-services-start.md delete mode 100644 .changeset/calm-sessions-header.md delete mode 100644 .changeset/canonical-tool-results.md delete mode 100644 .changeset/clean-sessions-generate.md delete mode 100644 .changeset/fresh-composers-slot.md delete mode 100644 .changeset/quick-caches-roll.md create mode 100644 packages/protocol/openapi.json create mode 100644 packages/protocol/script/generate-openapi.ts delete mode 100644 packages/sdk/.gitignore delete mode 100644 packages/sdk/js/example/example.ts delete mode 100644 packages/sdk/js/package.json delete mode 100755 packages/sdk/js/script/build.ts delete mode 100755 packages/sdk/js/script/publish.ts delete mode 100644 packages/sdk/js/src/client.ts delete mode 100644 packages/sdk/js/src/error-interceptor.ts delete mode 100644 packages/sdk/js/src/gen/client.gen.ts delete mode 100644 packages/sdk/js/src/gen/client/client.gen.ts delete mode 100644 packages/sdk/js/src/gen/client/index.ts delete mode 100644 packages/sdk/js/src/gen/client/types.gen.ts delete mode 100644 packages/sdk/js/src/gen/client/utils.gen.ts delete mode 100644 packages/sdk/js/src/gen/core/auth.gen.ts delete mode 100644 packages/sdk/js/src/gen/core/bodySerializer.gen.ts delete mode 100644 packages/sdk/js/src/gen/core/params.gen.ts delete mode 100644 packages/sdk/js/src/gen/core/pathSerializer.gen.ts delete mode 100644 packages/sdk/js/src/gen/core/queryKeySerializer.gen.ts delete mode 100644 packages/sdk/js/src/gen/core/serverSentEvents.gen.ts delete mode 100644 packages/sdk/js/src/gen/core/types.gen.ts delete mode 100644 packages/sdk/js/src/gen/core/utils.gen.ts delete mode 100644 packages/sdk/js/src/gen/sdk.gen.ts delete mode 100644 packages/sdk/js/src/gen/types.gen.ts delete mode 100644 packages/sdk/js/src/index.ts delete mode 100644 packages/sdk/js/src/process.ts delete mode 100644 packages/sdk/js/src/server.ts delete mode 100644 packages/sdk/js/src/v2/client.ts delete mode 100644 packages/sdk/js/src/v2/data.ts delete mode 100644 packages/sdk/js/src/v2/gen/client.gen.ts delete mode 100644 packages/sdk/js/src/v2/gen/client/client.gen.ts delete mode 100644 packages/sdk/js/src/v2/gen/client/index.ts delete mode 100644 packages/sdk/js/src/v2/gen/client/types.gen.ts delete mode 100644 packages/sdk/js/src/v2/gen/client/utils.gen.ts delete mode 100644 packages/sdk/js/src/v2/gen/core/auth.gen.ts delete mode 100644 packages/sdk/js/src/v2/gen/core/bodySerializer.gen.ts delete mode 100644 packages/sdk/js/src/v2/gen/core/params.gen.ts delete mode 100644 packages/sdk/js/src/v2/gen/core/pathSerializer.gen.ts delete mode 100644 packages/sdk/js/src/v2/gen/core/queryKeySerializer.gen.ts delete mode 100644 packages/sdk/js/src/v2/gen/core/serverSentEvents.gen.ts delete mode 100644 packages/sdk/js/src/v2/gen/core/types.gen.ts delete mode 100644 packages/sdk/js/src/v2/gen/core/utils.gen.ts delete mode 100644 packages/sdk/js/src/v2/gen/sdk.gen.ts delete mode 100644 packages/sdk/js/src/v2/gen/types.gen.ts delete mode 100644 packages/sdk/js/src/v2/index.ts delete mode 100644 packages/sdk/js/src/v2/server.ts delete mode 100644 packages/sdk/js/sst-env.d.ts delete mode 100644 packages/sdk/js/test/session-history.test.ts delete mode 100644 packages/sdk/js/tsconfig.json delete mode 100644 packages/sdk/openapi.json create mode 100644 packages/www/script/generate-openapi.ts diff --git a/.changeset/bright-sols-write.md b/.changeset/bright-sols-write.md deleted file mode 100644 index b008ad2477..0000000000 --- a/.changeset/bright-sols-write.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@opencode-ai/ai": patch ---- - -Report OpenAI prompt cache write tokens in normalized usage. diff --git a/.changeset/calm-services-start.md b/.changeset/calm-services-start.md deleted file mode 100644 index 94b57738d8..0000000000 --- a/.changeset/calm-services-start.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -"@opencode-ai/client": patch -"@opencode-ai/protocol": patch -"@opencode-ai/cli": patch ---- - -Expose background-service lifecycle status, preserve one process-held owner through startup and failure, reconnect TUIs without activating replacement, and stop exact service instances gracefully. diff --git a/.changeset/calm-sessions-header.md b/.changeset/calm-sessions-header.md deleted file mode 100644 index 666393c22e..0000000000 --- a/.changeset/calm-sessions-header.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@opencode-ai/cli": patch ---- - -Expose a TUI plugin slot at the top of the session view. diff --git a/.changeset/canonical-tool-results.md b/.changeset/canonical-tool-results.md deleted file mode 100644 index b484966033..0000000000 --- a/.changeset/canonical-tool-results.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -"@opencode-ai/plugin": minor -"@opencode-ai/sdk": minor -"@opencode-ai/client": minor -"@opencode-ai/protocol": minor ---- - -Replace the V2 tool result model with one canonical representation per fact. Tools lose `structured`, projection callbacks, the `Structured` generic, and the exported `Tool.settle` interpreter; tool responses carry schema-validated `output`, model-visible `content`, and optional compact JSON `metadata`. Code Mode receives the validated encoded output. Durable tool success stores non-empty model content plus optional metadata; failure stores one error plus the final bounded partial snapshot. Progress carries metadata only, while `execute.after` hooks receive the canonical terminal outcome and managed `outputPaths`. A one-time migration rewrites existing projected tool rows and moves provider-hosted result payloads into provider-owned result state. diff --git a/.changeset/clean-sessions-generate.md b/.changeset/clean-sessions-generate.md deleted file mode 100644 index c7f0d2c909..0000000000 --- a/.changeset/clean-sessions-generate.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -"@opencode-ai/client": patch -"@opencode-ai/plugin": patch -"@opencode-ai/protocol": patch ---- - -Expose transient, read-only session generation through the HTTP API, generated clients, and V2 plugin session context. diff --git a/.changeset/fresh-composers-slot.md b/.changeset/fresh-composers-slot.md deleted file mode 100644 index 9c6c47b3c6..0000000000 --- a/.changeset/fresh-composers-slot.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@opencode-ai/cli": patch ---- - -Expose a TUI plugin slot above the session composer. diff --git a/.changeset/quick-caches-roll.md b/.changeset/quick-caches-roll.md deleted file mode 100644 index 3ab9e9b740..0000000000 --- a/.changeset/quick-caches-roll.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@opencode-ai/ai": patch ---- - -Improve Anthropic and Bedrock prompt reuse with layered cache breakpoints that roll through long tool loops. diff --git a/bun.lock b/bun.lock index 56620c0a20..6b08db9e5c 100644 --- a/bun.lock +++ b/bun.lock @@ -8,7 +8,7 @@ "@aws-sdk/client-s3": "3.933.0", "@opencode-ai/plugin": "workspace:*", "@opencode-ai/script": "workspace:*", - "@opencode-ai/sdk": "workspace:*", + "@opencode-ai/sdk": "1.18.5", "heap-snapshot-toolkit": "1.1.3", "typescript": "catalog:", }, @@ -64,7 +64,7 @@ "@opencode-ai/client": "file:vendor/opencode-ai-client-1.17.13.tgz", "@opencode-ai/core": "workspace:*", "@opencode-ai/schema": "workspace:*", - "@opencode-ai/sdk": "workspace:*", + "@opencode-ai/sdk": "1.18.5", "@opencode-ai/session-ui": "workspace:*", "@opencode-ai/ui": "workspace:*", "@pierre/trees": "1.0.0-beta.4", @@ -582,7 +582,7 @@ "@opencode-ai/ai": "workspace:*", "@opencode-ai/client": "workspace:*", "@opencode-ai/schema": "workspace:*", - "@opencode-ai/sdk": "workspace:*", + "@opencode-ai/sdk": "1.18.5", "@standard-schema/spec": "^1.1.0", "effect": "catalog:", "zod": "catalog:", @@ -663,21 +663,6 @@ "@typescript/native-preview": "catalog:", }, }, - "packages/sdk/js": { - "name": "@opencode-ai/sdk", - "version": "1.18.4", - "dependencies": { - "cross-spawn": "catalog:", - }, - "devDependencies": { - "@hey-api/openapi-ts": "0.90.10", - "@tsconfig/node22": "catalog:", - "@types/cross-spawn": "catalog:", - "@types/node": "catalog:", - "@typescript/native-preview": "catalog:", - "typescript": "catalog:", - }, - }, "packages/server": { "name": "@opencode-ai/server", "version": "1.18.4", @@ -703,7 +688,7 @@ "@kobalte/core": "catalog:", "@opencode-ai/client": "file:../app/vendor/opencode-ai-client-1.17.13.tgz", "@opencode-ai/core": "workspace:*", - "@opencode-ai/sdk": "workspace:*", + "@opencode-ai/sdk": "1.18.5", "@opencode-ai/ui": "workspace:*", "@pierre/diffs": "catalog:", "@shikijs/stream": "catalog:", @@ -767,7 +752,7 @@ "name": "@opencode-ai/slack", "version": "1.18.4", "dependencies": { - "@opencode-ai/sdk": "workspace:*", + "@opencode-ai/sdk": "1.18.5", "@slack/bolt": "^3.17.1", }, "devDependencies": { @@ -1716,14 +1701,6 @@ "@happy-dom/global-registrator": ["@happy-dom/global-registrator@20.0.11", "", { "dependencies": { "@types/node": "^20.0.0", "happy-dom": "^20.0.11" } }, "sha512-GqNqiShBT/lzkHTMC/slKBrvN0DsD4Di8ssBk4aDaVgEn+2WMzE6DXxq701ndSXj7/0cJ8mNT71pM7Bnrr6JRw=="], - "@hey-api/codegen-core": ["@hey-api/codegen-core@0.5.5", "", { "dependencies": { "@hey-api/types": "0.1.2", "ansi-colors": "4.1.3", "c12": "3.3.3", "color-support": "1.1.3" }, "peerDependencies": { "typescript": ">=5.5.3" } }, "sha512-f2ZHucnA2wBGAY8ipB4wn/mrEYW+WUxU2huJmUvfDO6AE2vfILSHeF3wCO39Pz4wUYPoAWZByaauftLrOfC12Q=="], - - "@hey-api/json-schema-ref-parser": ["@hey-api/json-schema-ref-parser@1.2.2", "", { "dependencies": { "@jsdevtools/ono": "^7.1.3", "@types/json-schema": "^7.0.15", "js-yaml": "^4.1.1", "lodash": "^4.17.21" } }, "sha512-oS+5yAdwnK20lSeFO1d53Ku+yaGCsY8PcrmSq2GtSs3bsBfRnHAbpPKSVzQcaxAOrzj5NB+f34WhZglVrNayBA=="], - - "@hey-api/openapi-ts": ["@hey-api/openapi-ts@0.90.10", "", { "dependencies": { "@hey-api/codegen-core": "^0.5.5", "@hey-api/json-schema-ref-parser": "1.2.2", "@hey-api/types": "0.1.2", "ansi-colors": "4.1.3", "color-support": "1.1.3", "commander": "14.0.2", "open": "11.0.0", "semver": "7.7.3" }, "peerDependencies": { "typescript": ">=5.5.3" }, "bin": { "openapi-ts": "bin/run.js" } }, "sha512-o0wlFxuLt1bcyIV/ZH8DQ1wrgODTnUYj/VfCHOOYgXUQlLp9Dm2PjihOz+WYrZLowhqUhSKeJRArOGzvLuOTsg=="], - - "@hey-api/types": ["@hey-api/types@0.1.2", "", {}, "sha512-uNNtiVAWL7XNrV/tFXx7GLY9lwaaDazx1173cGW3+UEaw4RUPsHEmiB4DSpcjNxMIcrctfz2sGKLnVx5PBG2RA=="], - "@hono/node-server": ["@hono/node-server@1.19.14", "", { "peerDependencies": { "hono": "^4" } }, "sha512-GwtvgtXxnWsucXvbQXkRgqksiH2Qed37H9xHZocE5sA3N8O8O8/8FA3uclQXxXVzc9XBZuEOMK7+r02FmSpHtw=="], "@hono/standard-validator": ["@hono/standard-validator@0.2.0", "", { "peerDependencies": { "@standard-schema/spec": "1.0.0", "hono": ">=3.9.0" } }, "sha512-pFq0UVAnjzXcDAgqFpDeVL3MOUPrlIh/kPqBDvbCYoThVhhS+Vf37VcdsakdOFFGiqoiYVxp3LifXFhGhp/rgQ=="], @@ -1814,8 +1791,6 @@ "@js-temporal/polyfill": ["@js-temporal/polyfill@0.5.1", "", { "dependencies": { "jsbi": "^4.3.0" } }, "sha512-hloP58zRVCRSpgDxmqCWJNlizAlUgJFqG2ypq79DCvyv9tHjRYMDOcPFjzfl/A1/YxDvRCZz8wvZvmapQnKwFQ=="], - "@jsdevtools/ono": ["@jsdevtools/ono@7.1.3", "", {}, "sha512-4JQNk+3mVzK3xh2rqd6RB4J46qUR19azEHBneZyTZM+c456qOrbbM/5xcR8huNCCcbVt7+UmizG6GuUvPvKUYg=="], - "@jsx-email/all": ["@jsx-email/all@2.2.3", "", { "dependencies": { "@jsx-email/body": "1.0.2", "@jsx-email/button": "1.0.4", "@jsx-email/column": "1.0.3", "@jsx-email/container": "1.0.2", "@jsx-email/font": "1.0.3", "@jsx-email/head": "1.0.2", "@jsx-email/heading": "1.0.2", "@jsx-email/hr": "1.0.2", "@jsx-email/html": "1.0.2", "@jsx-email/img": "1.0.2", "@jsx-email/link": "1.0.2", "@jsx-email/markdown": "2.0.4", "@jsx-email/preview": "1.0.2", "@jsx-email/render": "1.1.1", "@jsx-email/row": "1.0.2", "@jsx-email/section": "1.0.2", "@jsx-email/tailwind": "2.4.4", "@jsx-email/text": "1.0.2" }, "peerDependencies": { "react": "^18.2.0" } }, "sha512-OBvLe/hVSQc0LlMSTJnkjFoqs3bmxcC4zpy/5pT5agPCSKMvAKQjzmsc2xJ2wO73jSpRV1K/g38GmvdCfrhSoQ=="], "@jsx-email/body": ["@jsx-email/body@1.0.2", "", { "peerDependencies": { "react": "^18.2.0" } }, "sha512-NjR2tgLH4XGfGkm+O8kcVwi9MBqZsXZCLlmk3HlMux3/n/+a5zB+yhJqXWZBJl2i+6cSF+E2O6hK11ekyK9WWQ=="], @@ -2074,7 +2049,7 @@ "@opencode-ai/script": ["@opencode-ai/script@workspace:packages/script"], - "@opencode-ai/sdk": ["@opencode-ai/sdk@workspace:packages/sdk/js"], + "@opencode-ai/sdk": ["@opencode-ai/sdk@1.18.5", "", { "dependencies": { "cross-spawn": "7.0.6" } }, "sha512-7KgMvP5/1oxbhHj6kYBtPSTEdFKYpUeEYOzBTKdzSaRpapUpFFdn6Hkus3rr0rljO0kukWZIgRd3DrVBwTULGA=="], "@opencode-ai/sdk-next": ["@opencode-ai/sdk-next@workspace:packages/sdk-next"], @@ -3308,8 +3283,6 @@ "ansi-align": ["ansi-align@3.0.1", "", { "dependencies": { "string-width": "^4.1.0" } }, "sha512-IOfwwBF5iczOjp/WeY4YxyjqAFMQoZufdQWDd19SEExbVLNXqvpzSJ/M7Za4/sCPmQ0+GRquoA7bGcINcxew6w=="], - "ansi-colors": ["ansi-colors@4.1.3", "", {}, "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw=="], - "ansi-regex": ["ansi-regex@6.2.2", "", {}, "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg=="], "ansi-styles": ["ansi-styles@4.3.0", "", { "dependencies": { "color-convert": "^2.0.1" } }, "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg=="], @@ -3500,8 +3473,6 @@ "bytestreamjs": ["bytestreamjs@2.0.1", "", {}, "sha512-U1Z/ob71V/bXfVABvNr/Kumf5VyeQRBEm6Txb0PQ6S7V5GpBM3w4Cbqz/xPDicR5tN0uvDifng8C+5qECeGwyQ=="], - "c12": ["c12@3.3.3", "", { "dependencies": { "chokidar": "^5.0.0", "confbox": "^0.2.2", "defu": "^6.1.4", "dotenv": "^17.2.3", "exsolve": "^1.0.8", "giget": "^2.0.0", "jiti": "^2.6.1", "ohash": "^2.0.11", "pathe": "^2.0.3", "perfect-debounce": "^2.0.0", "pkg-types": "^2.3.0", "rc9": "^2.1.2" }, "peerDependencies": { "magicast": "*" }, "optionalPeers": ["magicast"] }, "sha512-750hTRvgBy5kcMNPdh95Qo+XUBeGo8C7nsKSmedDmaQI+E0r82DwHeM6vBewDe4rGFbnxoa4V9pw+sPh5+Iz8Q=="], - "cac": ["cac@6.7.14", "", {}, "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ=="], "cacache": ["cacache@20.0.4", "", { "dependencies": { "@npmcli/fs": "^5.0.0", "fs-minipass": "^3.0.0", "glob": "^13.0.0", "lru-cache": "^11.1.0", "minipass": "^7.0.3", "minipass-collect": "^2.0.1", "minipass-flush": "^1.0.5", "minipass-pipeline": "^1.2.4", "p-map": "^7.0.2", "ssri": "^13.0.0" } }, "sha512-M3Lab8NPYlZU2exsL3bMVvMrMqgwCnMWfdZbK28bn3pK6APT/Te/I8hjRPNu1uwORY9a1eEQoifXbKPQMfMTOA=="], @@ -3596,13 +3567,11 @@ "color-string": ["color-string@1.9.1", "", { "dependencies": { "color-name": "^1.0.0", "simple-swizzle": "^0.2.2" } }, "sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg=="], - "color-support": ["color-support@1.1.3", "", { "bin": { "color-support": "bin.js" } }, "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg=="], - "combined-stream": ["combined-stream@1.0.8", "", { "dependencies": { "delayed-stream": "~1.0.0" } }, "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg=="], "comma-separated-tokens": ["comma-separated-tokens@2.0.3", "", {}, "sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg=="], - "commander": ["commander@14.0.2", "", {}, "sha512-TywoWNNRbhoD0BXs1P3ZEScW8W5iKrnbithIl0YH+uCmBd0QpPOA8yc82DS3BIE5Ma6FnBVUsJ7wVUDz4dvOWQ=="], + "commander": ["commander@8.3.0", "", {}, "sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww=="], "common-ancestor-path": ["common-ancestor-path@2.0.0", "", {}, "sha512-dnN3ibLeoRf2HNC+OlCiNc5d2zxbLJXOtiZUudNFSXZrNSydxcCsSpRzXwfu7BBWCIfHPw+xTayeBvJCP/D8Ng=="], @@ -3616,8 +3585,6 @@ "conf": ["conf@15.1.0", "", { "dependencies": { "ajv": "^8.17.1", "ajv-formats": "^3.0.1", "atomically": "^2.0.3", "debounce-fn": "^6.0.0", "dot-prop": "^10.0.0", "env-paths": "^3.0.0", "json-schema-typed": "^8.0.1", "semver": "^7.7.2", "uint8array-extras": "^1.5.0" } }, "sha512-Uy5YN9KEu0WWDaZAVJ5FAmZoaJt9rdK6kH+utItPyGsCqCgaTKkrmZx3zoE0/3q6S3bcp3Ihkk+ZqPxWxFK5og=="], - "confbox": ["confbox@0.2.4", "", {}, "sha512-ysOGlgTFbN2/Y6Cg3Iye8YKulHw+R2fNXHrgSmXISQdMnomY6eNDprVdW9R5xBguEqI954+S6709UyiO7B+6OQ=="], - "config-chain": ["config-chain@1.1.13", "", { "dependencies": { "ini": "^1.3.4", "proto-list": "~1.2.1" } }, "sha512-qj+f8APARXHrM0hraqXYb2/bOVSV4PvJQlNZ/DVj0QrmNM2q2euizkeuVckQ57J+W0mRH6Hvi+k50M4Jul2VRQ=="], "consola": ["consola@3.4.2", "", {}, "sha512-5IKcdX0nnYavi6G7TtOhwkYzyjfJlatbjMjuLSfE2kYT5pMDOilZ4OvMhi637CcDICTmz3wARPoyhqyX1Y+XvA=="], @@ -4006,8 +3973,6 @@ "expressive-code": ["expressive-code@0.41.7", "", { "dependencies": { "@expressive-code/core": "^0.41.7", "@expressive-code/plugin-frames": "^0.41.7", "@expressive-code/plugin-shiki": "^0.41.7", "@expressive-code/plugin-text-markers": "^0.41.7" } }, "sha512-2wZjC8OQ3TaVEMcBtYY4Va3lo6J+Ai9jf3d4dbhURMJcU4Pbqe6EcHe424MIZI0VHUA1bR6xdpoHYi3yxokWqA=="], - "exsolve": ["exsolve@1.1.0", "", {}, "sha512-D+42+T12DdIlJM3uepa55qGiL3sYdLBOxIl2ifQCzCHz4c7eiolaHsi3BIqEr7JxBzxv2pYZQX9kw16ziMcEmw=="], - "ext-list": ["ext-list@2.2.2", "", { "dependencies": { "mime-db": "^1.28.0" } }, "sha512-u+SQgsubraE6zItfVA0tBuCBhfU9ogSRnsvygI7wht9TS510oLkBRXBsqopeUG/GBOIQyKZO9wjTqIu/sf5zFA=="], "ext-name": ["ext-name@5.0.0", "", { "dependencies": { "ext-list": "^2.0.0", "sort-keys-length": "^1.0.0" } }, "sha512-yblEwXAbGv1VQDmow7s38W77hzAgJAO50ztBLMcUyUBfxv1HC+LGwtiEN+Co6LtlqT/5uwVOxsD4TNIilWhwdQ=="], @@ -4140,8 +4105,6 @@ "ghostty-web": ["ghostty-web@github:anomalyco/ghostty-web#83c0a07", {}, "anomalyco-ghostty-web-83c0a07", "sha512-Lf2v1agHkVUpMpHBWWuCZrhOEmcwwin5/Hboc9rZwQ7/CKkIh5rU1r1CvfLlhkMoFv+ed8z52RZ8hkzGZZj3MQ=="], - "giget": ["giget@2.0.0", "", { "dependencies": { "citty": "^0.1.6", "consola": "^3.4.0", "defu": "^6.1.4", "node-fetch-native": "^1.6.6", "nypm": "^0.6.0", "pathe": "^2.0.3" }, "bin": { "giget": "dist/cli.mjs" } }, "sha512-L5bGsVkxJbJgdnwyuheIunkGatUF/zssUoxxjACCseZYAVbaqdh9Tsmmlkl8vYan09H7sbvKt4pS8GqKLBrEzA=="], - "github-slugger": ["github-slugger@2.0.0", "", {}, "sha512-IaOQ9puYtjrkq7Y0Ygl9KDZnrf/aiUJYUpVf89y8kyaxbRG7Y1SrX/jaumrv81vc61+kiMempujsM3Yw7w5qcw=="], "gitlab-ai-provider": ["gitlab-ai-provider@6.11.1", "", { "dependencies": { "@anthropic-ai/sdk": "^0.71.0", "@anycable/core": "^0.9.2", "graphql-request": "^6.1.0", "isomorphic-ws": "^5.0.0", "openai": "^6.16.0", "socket.io-client": "^4.8.1", "vscode-jsonrpc": "^8.2.1", "zod": "^3.25.76" }, "peerDependencies": { "@ai-sdk/provider": ">=3.0.0", "@ai-sdk/provider-utils": ">=4.0.0" } }, "sha512-SJ6f5qa7P8md6lPrserryER3zerLkrezlnqqYQ2AbvDPpHLbwtbyk0FYJ5kNRcmbI80i/VMcsMBP0YIRdc3ucQ=="], @@ -4374,8 +4337,6 @@ "is-hexadecimal": ["is-hexadecimal@2.0.1", "", {}, "sha512-DgZQp241c8oO6cA1SbTEWiXeoxV42vlcJxgH+B3hi1AiqqKruZR3ZGF8In3fj4+/y/7rHvlOZLZtgJ/4ttYGZg=="], - "is-in-ssh": ["is-in-ssh@1.0.0", "", {}, "sha512-jYa6Q9rH90kR1vKB6NM7qqd1mge3Fx4Dhw5TVlK1MUBqhEOuCagrEHMevNuCcbECmXZ0ThXkRm+Ymr51HwEPAw=="], - "is-inside-container": ["is-inside-container@1.0.0", "", { "dependencies": { "is-docker": "^3.0.0" }, "bin": { "is-inside-container": "cli.js" } }, "sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA=="], "is-map": ["is-map@2.0.3", "", {}, "sha512-1Qed0/Hr2m+YqxnM09CjA2d/i6YZNfF6R2oRAOj36eUdS6qIV/huPJNSEpKbupewFs+ZsJlxsjjPbc0/afW6Lw=="], @@ -4886,8 +4847,6 @@ "nth-check": ["nth-check@2.1.1", "", { "dependencies": { "boolbase": "^1.0.0" } }, "sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w=="], - "nypm": ["nypm@0.6.8", "", { "dependencies": { "citty": "^0.2.2", "pathe": "^2.0.3", "tinyexec": "^1.2.4" }, "bin": { "nypm": "./dist/cli.mjs" } }, "sha512-Q9K4Diu6l5u6xJQogeFSs/zKtyMSgFKFtRQV+tHP4kL7KPm2grpBU0dFIwFaXwNxN0MtfKWc43VpCugAa+LPsw=="], - "object-assign": ["object-assign@4.1.1", "", {}, "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg=="], "object-hash": ["object-hash@2.2.0", "", {}, "sha512-gScRMn0bS5fH+IuwyIFgnh9zBdo4DV+6GhygmWM9HyNJSgS0hScp1f5vjtm7oIIOiT9trXrShAkLFSc2IqKNgw=="], @@ -5024,8 +4983,6 @@ "pend": ["pend@1.2.0", "", {}, "sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg=="], - "perfect-debounce": ["perfect-debounce@2.1.0", "", {}, "sha512-LjgdTytVFXeUgtHZr9WYViYSM/g8MkcTPYDlPa3cDqMirHjKiSZPYd6DoL7pK8AJQr+uWkQvCjHNdiMqsrJs+g=="], - "piccolore": ["piccolore@0.1.3", "", {}, "sha512-o8bTeDWjE086iwKrROaDf31K0qC/BENdm15/uH9usSC/uZjJOKb2YGiVHfLY4GhwsERiPI1jmwI2XrA7ACOxVw=="], "picocolors": ["picocolors@1.1.1", "", {}, "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA=="], @@ -5040,8 +4997,6 @@ "pkg-dir": ["pkg-dir@4.2.0", "", { "dependencies": { "find-up": "^4.0.0" } }, "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ=="], - "pkg-types": ["pkg-types@2.3.1", "", { "dependencies": { "confbox": "^0.2.4", "exsolve": "^1.0.8", "pathe": "^2.0.3" } }, "sha512-y+ichcgc2LrADuhLNAx8DFjVfgz91pRxfZdI3UDhxHvcVEZsenLO+7XaU5vOp0u/7V/wZ+plyuQxtrDlZJ+yeg=="], - "pkg-up": ["pkg-up@3.1.0", "", { "dependencies": { "find-up": "^3.0.0" } }, "sha512-nDywThFk1i4BQK4twPQ6TA4RT8bDY96yeuCVBWL3ePARCiEKDRSrNGbFIgUJpLp+XeIR65v8ra7WuJOFUBtkMA=="], "pkijs": ["pkijs@3.4.0", "", { "dependencies": { "@noble/hashes": "1.4.0", "asn1js": "^3.0.6", "bytestreamjs": "^2.0.1", "pvtsutils": "^1.3.6", "pvutils": "^1.1.3", "tslib": "^2.8.1" } }, "sha512-emEcLuomt2j03vxD54giVB4SxTjnsqkU692xZOZXHDVoYyypEm+b3jpiTcc+Cf+myooc+/Ly0z01jqeNHVgJGw=="], @@ -5078,8 +5033,6 @@ "postject": ["postject@1.0.0-alpha.6", "", { "dependencies": { "commander": "^9.4.0" }, "bin": { "postject": "dist/cli.js" } }, "sha512-b9Eb8h2eVqNE8edvKdwqkrY6O7kAwmI8kcnBv1NScolYJbo59XUF0noFq+lxbC1yN20bmC0WBEbDC5H/7ASb0A=="], - "powershell-utils": ["powershell-utils@0.1.0", "", {}, "sha512-dM0jVuXJPsDN6DvRpea484tCUaMiXWjuCn++HGTqUWzGDjv5tZkEZldAJ/UMlqRYGFrD/etByo4/xOuC/snX2A=="], - "preact": ["preact@11.0.0-beta.0", "", {}, "sha512-IcODoASASYwJ9kxz7+MJeiJhvLriwSb4y4mHIyxdgaRZp6kPUud7xytrk/6GZw8U3y6EFJaRb5wi9SrEK+8+lg=="], "preact-render-to-string": ["preact-render-to-string@6.6.5", "", { "peerDependencies": { "preact": ">=10 || >= 11.0.0-0" } }, "sha512-O6MHzYNIKYaiSX3bOw0gGZfEbOmlIDtDfWwN1JJdc/T3ihzRT6tGGSEWE088dWrEDGa1u7101q+6fzQnO9XCPA=="], @@ -5152,8 +5105,6 @@ "raw-body": ["raw-body@3.0.2", "", { "dependencies": { "bytes": "~3.1.2", "http-errors": "~2.0.1", "iconv-lite": "~0.7.0", "unpipe": "~1.0.0" } }, "sha512-K5zQjDllxWkf7Z5xJdV0/B0WTNqx6vxG70zJE4N0kBs4LovmEYWJzQGxC9bS9RAKu3bgM40lrd5zoLJ12MQ5BA=="], - "rc9": ["rc9@2.1.2", "", { "dependencies": { "defu": "^6.1.4", "destr": "^2.0.3" } }, "sha512-btXCnMmRIBINM2LDZoEmOogIZU7Qe7zn4BpomSKZ/ykbLObuBdvG+mFq11DL6fjH1DRwHhrlgtYWG96bJiC7Cg=="], - "react": ["react@18.2.0", "", { "dependencies": { "loose-envify": "^1.1.0" } }, "sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ=="], "react-dom": ["react-dom@18.2.0", "", { "dependencies": { "loose-envify": "^1.1.0", "scheduler": "^0.23.0" }, "peerDependencies": { "react": "^18.2.0" } }, "sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g=="], @@ -5876,7 +5827,7 @@ "ws": ["ws@8.21.0", "", { "peerDependencies": { "bufferutil": "^4.0.1", "utf-8-validate": ">=5.0.2" }, "optionalPeers": ["bufferutil", "utf-8-validate"] }, "sha512-Vsp28b7DRcimFQvrqu2Wek3z1iYxDCWqHYB8Qsnk/S4RfaCQzPGPyBNuVjJV3cd6UiKtUtp6sNM77gWvzcCH+g=="], - "wsl-utils": ["wsl-utils@0.3.1", "", { "dependencies": { "is-wsl": "^3.1.0", "powershell-utils": "^0.1.0" } }, "sha512-g/eziiSUNBSsdDJtCLB8bdYEUMj4jR7AGeUo96p/3dTafgjHhpF4RiCFPiRILwjQoDXx5MqkBr4fwWtR3Ky4Wg=="], + "wsl-utils": ["wsl-utils@0.1.0", "", { "dependencies": { "is-wsl": "^3.1.0" } }, "sha512-h3Fbisa2nKGPxCpm89Hk33lBLsnaGBvctQopaBSOW/uIs6FTe1ATyAnKFJrzVs9vpGdsTe73WF3V4lIsk4Gacw=="], "xdg-app-paths": ["xdg-app-paths@5.5.1", "", { "dependencies": { "os-paths": "^4.0.1", "xdg-portable": "^7.2.0" } }, "sha512-hI3flOB4PLZIy5prbtTpirobtPE2ZtZ52szO+2mM9Efp6ErM398La+C1lIpNWDfNoQk+6Lsi6nMcCwVB7pxeMQ=="], @@ -6224,12 +6175,6 @@ "@expressive-code/plugin-shiki/shiki": ["shiki@3.23.0", "", { "dependencies": { "@shikijs/core": "3.23.0", "@shikijs/engine-javascript": "3.23.0", "@shikijs/engine-oniguruma": "3.23.0", "@shikijs/langs": "3.23.0", "@shikijs/themes": "3.23.0", "@shikijs/types": "3.23.0", "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.4" } }, "sha512-55Dj73uq9ZXL5zyeRPzHQsK7Nbyt6Y10k5s7OjuFZGMhpp4r/rsLBH0o/0fstIzX1Lep9VxefWljK/SKCzygIA=="], - "@hey-api/json-schema-ref-parser/js-yaml": ["js-yaml@4.3.0", "", { "dependencies": { "argparse": "^2.0.1" }, "bin": { "js-yaml": "bin/js-yaml.js" } }, "sha512-1td788aAnnZ5qs7V2QIRl1owjtYpbKt749Y3xauqQgwIIGF/xXWz1wMTEBx5O3LK3lXLVuqXPdPxj2BoFHaW9Q=="], - - "@hey-api/openapi-ts/open": ["open@11.0.0", "", { "dependencies": { "default-browser": "^5.4.0", "define-lazy-prop": "^3.0.0", "is-in-ssh": "^1.0.0", "is-inside-container": "^1.0.0", "powershell-utils": "^0.1.0", "wsl-utils": "^0.3.0" } }, "sha512-smsWv2LzFjP03xmvFoJ331ss6h+jixfA4UUV/Bsiyuu4YJPfN+FIQGOIiv4w9/+MoHkfkJ22UIaQWRVFRfH6Vw=="], - - "@hey-api/openapi-ts/semver": ["semver@7.7.3", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q=="], - "@img/sharp-wasm32/@emnapi/runtime": ["@emnapi/runtime@1.11.2", "", { "dependencies": { "tslib": "^2.4.0" } }, "sha512-kyOl3X0DuTiT1h2ft8r2fYO8JYtU9a9Xis/zBSiGArNaagCOWx90N1k2wxp18czFDH+OgcWGb5ZP/XMt3dcyPA=="], "@jsx-email/cli/chalk": ["chalk@4.1.2", "", { "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" } }, "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA=="], @@ -6604,10 +6549,6 @@ "builder-util/js-yaml": ["js-yaml@4.3.0", "", { "dependencies": { "argparse": "^2.0.1" }, "bin": { "js-yaml": "bin/js-yaml.js" } }, "sha512-1td788aAnnZ5qs7V2QIRl1owjtYpbKt749Y3xauqQgwIIGF/xXWz1wMTEBx5O3LK3lXLVuqXPdPxj2BoFHaW9Q=="], - "c12/chokidar": ["chokidar@5.0.0", "", { "dependencies": { "readdirp": "^5.0.0" } }, "sha512-TQMmc3w+5AxjpL8iIiwebF73dRDF4fBIieAqGn9RGCWaEVwQ6Fb2cGe31Yns0RRIzii5goJ1Y7xbMwo1TxMplw=="], - - "c12/dotenv": ["dotenv@17.4.2", "", {}, "sha512-nI4U3TottKAcAD9LLud4Cb7b2QztQMUEfHbvhTH09bqXTxnSie8WnjPALV/WMCrJZ6UV/qHJ6L03OqO3LcdYZw=="], - "cliui/string-width": ["string-width@4.2.3", "", { "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", "strip-ansi": "^6.0.1" } }, "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g=="], "cliui/strip-ansi": ["strip-ansi@6.0.1", "", { "dependencies": { "ansi-regex": "^5.0.1" } }, "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A=="], @@ -6724,8 +6665,6 @@ "jszip/readable-stream": ["readable-stream@2.3.8", "", { "dependencies": { "core-util-is": "~1.0.0", "inherits": "~2.0.3", "isarray": "~1.0.0", "process-nextick-args": "~2.0.0", "safe-buffer": "~5.1.1", "string_decoder": "~1.1.1", "util-deprecate": "~1.0.1" } }, "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA=="], - "katex/commander": ["commander@8.3.0", "", {}, "sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww=="], - "lazystream/readable-stream": ["readable-stream@2.3.8", "", { "dependencies": { "core-util-is": "~1.0.0", "inherits": "~2.0.3", "isarray": "~1.0.0", "process-nextick-args": "~2.0.0", "safe-buffer": "~5.1.1", "string_decoder": "~1.1.1", "util-deprecate": "~1.0.1" } }, "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA=="], "matcher/escape-string-regexp": ["escape-string-regexp@4.0.0", "", {}, "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA=="], @@ -6764,10 +6703,6 @@ "npm-run-path/path-key": ["path-key@4.0.0", "", {}, "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ=="], - "nypm/citty": ["citty@0.2.2", "", {}, "sha512-+6vJA3L98yv+IdfKGZHBNiGW5KHn22e/JwID0Strsz8h4S/csAu/OuICwxrg44k5MRiZHWIo8XXuJgQTriRP4w=="], - - "nypm/tinyexec": ["tinyexec@1.2.4", "", {}, "sha512-SHf/r48b7vOrjve9PxJo3MN5v5yuyjHvdUcrQffT3WXMUfnGmHDVbC4k3sHJaJTgZCwpUplIaAo5ANtMyp3YHg=="], - "openid-client/jose": ["jose@4.15.9", "", {}, "sha512-1vUQX+IdDMVPj4k8kOxgUqlcK518yluMuGZwqlr44FS1ppZB/5GWh4rZG89erpOBOJjU/OBsnCVFfapsRz6nEA=="], "openid-client/lru-cache": ["lru-cache@6.0.0", "", { "dependencies": { "yallist": "^4.0.0" } }, "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA=="], @@ -7222,8 +7157,6 @@ "@expressive-code/plugin-shiki/shiki/@shikijs/types": ["@shikijs/types@3.23.0", "", { "dependencies": { "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.4" } }, "sha512-3JZ5HXOZfYjsYSk0yPwBrkupyYSLpAE26Qc0HLghhZNGTZg/SKxXIIgoxOpmmeQP0RRSDJTk1/vPfw9tbw+jSQ=="], - "@hey-api/json-schema-ref-parser/js-yaml/argparse": ["argparse@2.0.1", "", {}, "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q=="], - "@jsx-email/cli/esbuild/@esbuild/aix-ppc64": ["@esbuild/aix-ppc64@0.19.12", "", { "os": "aix", "cpu": "ppc64" }, "sha512-bmoCYyWdEL3wDQIVbcyzRyeKLgk2WtWLTWz1ZIAZF/EGbNOwSA6ew3PftJ1PqMiOOGu0OyFMzG53L0zqIpPeNA=="], "@jsx-email/cli/esbuild/@esbuild/android-arm": ["@esbuild/android-arm@0.19.12", "", { "os": "android", "cpu": "arm" }, "sha512-qg/Lj1mu3CdQlDEEiWrlC4eaPZ1KztwGJ9B6J+/6G+/4ewxJg7gqj8eVYWvao1bXrqGiW2rsBZFSX3q2lcW05w=="], @@ -7714,8 +7647,6 @@ "blume/js-yaml/argparse": ["argparse@2.0.1", "", {}, "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q=="], - "blume/katex/commander": ["commander@8.3.0", "", {}, "sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww=="], - "blume/node-html-parser/entities": ["entities@8.0.0", "", {}, "sha512-zwfzJecQ/Uej6tusMqwAqU/6KL2XaB2VZ2Jg54Je6ahNBGNH6Ek6g3jjNCF0fG9EWQKGZNddNjU5F1ZQn/sBnA=="], "blume/react-dom/scheduler": ["scheduler@0.27.0", "", {}, "sha512-eNv+WrVbKu1f3vbYJT/xtiF5syA5HPIMtf9IgY/nKg0sWqzAUEvqY/xm7OcZc/qafLx/iO9FgOmeSAp4v5ti/Q=="], @@ -7734,8 +7665,6 @@ "builder-util/js-yaml/argparse": ["argparse@2.0.1", "", {}, "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q=="], - "c12/chokidar/readdirp": ["readdirp@5.0.0", "", {}, "sha512-9u/XQ1pvrQtYyMpZe7DXKv2p5CNvyVwzUB6uhLAnQwHMSgKMBR62lc7AHljaeteeHXn11XTAaLLUVZYVZyuRBQ=="], - "cliui/string-width/emoji-regex": ["emoji-regex@8.0.0", "", {}, "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A=="], "cliui/strip-ansi/ansi-regex": ["ansi-regex@5.0.1", "", {}, "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ=="], @@ -7802,8 +7731,6 @@ "lazystream/readable-stream/string_decoder": ["string_decoder@1.1.1", "", { "dependencies": { "safe-buffer": "~5.1.0" } }, "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg=="], - "mermaid/katex/commander": ["commander@8.3.0", "", {}, "sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww=="], - "motion/framer-motion/motion-dom": ["motion-dom@12.42.2", "", { "dependencies": { "motion-utils": "^12.39.0" } }, "sha512-5gIMWLp/PycBtJRJWRgjxke5n8dlvkSn2DrYW+tr3XcqAZY1xZh6BJyooJXCM8wdfM7wfMjkBJNLge1CKPUIRA=="], "motion/framer-motion/motion-utils": ["motion-utils@12.39.0", "", {}, "sha512-8nadJAJjTtqRkmRF36FoJTrywK9nnFmnPwnSMyxaOCU7GDjN9RTMJIxx9De8ErM+vpPhMccr/6fo5WciyQLnMQ=="], @@ -7822,8 +7749,6 @@ "rimraf/glob/path-scurry": ["path-scurry@1.11.1", "", { "dependencies": { "lru-cache": "^10.2.0", "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" } }, "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA=="], - "storybook/open/wsl-utils": ["wsl-utils@0.1.0", "", { "dependencies": { "is-wsl": "^3.1.0" } }, "sha512-h3Fbisa2nKGPxCpm89Hk33lBLsnaGBvctQopaBSOW/uIs6FTe1ATyAnKFJrzVs9vpGdsTe73WF3V4lIsk4Gacw=="], - "string-width-cjs/strip-ansi/ansi-regex": ["ansi-regex@5.0.1", "", {}, "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ=="], "temp/rimraf/glob": ["glob@7.2.3", "", { "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", "minimatch": "^3.1.1", "once": "^1.3.0", "path-is-absolute": "^1.0.0" } }, "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q=="], diff --git a/bunfig.toml b/bunfig.toml index c506ff57c4..8393dd5093 100644 --- a/bunfig.toml +++ b/bunfig.toml @@ -2,7 +2,7 @@ exact = true # Only install newly resolved package versions published at least 3 days ago. minimumReleaseAge = 259200 -minimumReleaseAgeExcludes = ["@ai-sdk/amazon-bedrock", "@ai-sdk/anthropic", "@opentui/core", "@opentui/core-darwin-arm64", "@opentui/core-darwin-x64", "@opentui/core-linux-arm64", "@opentui/core-linux-arm64-musl", "@opentui/core-linux-x64", "@opentui/core-linux-x64-musl", "@opentui/core-win32-arm64", "@opentui/core-win32-x64", "@opentui/keymap", "@opentui/solid", "opentui-spinner", "gitlab-ai-provider", "opencode-gitlab-auth", "@ff-labs/fff-node", "@ff-labs/fff-bun", "@ff-labs/fff-bin-darwin-arm64", "@ff-labs/fff-bin-darwin-x64", "@ff-labs/fff-bin-linux-arm64-gnu", "@ff-labs/fff-bin-linux-arm64-musl", "@ff-labs/fff-bin-linux-x64-gnu", "@ff-labs/fff-bin-linux-x64-musl", "@ff-labs/fff-bin-win32-arm64", "@ff-labs/fff-bin-win32-x64", "@pierre/diffs", "@pierre/theming", "app-builder-lib", "dmg-builder", "electron-builder", "electron-publish"] +minimumReleaseAgeExcludes = ["@ai-sdk/amazon-bedrock", "@ai-sdk/anthropic", "@opencode-ai/sdk", "@opentui/core", "@opentui/core-darwin-arm64", "@opentui/core-darwin-x64", "@opentui/core-linux-arm64", "@opentui/core-linux-arm64-musl", "@opentui/core-linux-x64", "@opentui/core-linux-x64-musl", "@opentui/core-win32-arm64", "@opentui/core-win32-x64", "@opentui/keymap", "@opentui/solid", "opentui-spinner", "gitlab-ai-provider", "opencode-gitlab-auth", "@ff-labs/fff-node", "@ff-labs/fff-bun", "@ff-labs/fff-bin-darwin-arm64", "@ff-labs/fff-bin-darwin-x64", "@ff-labs/fff-bin-linux-arm64-gnu", "@ff-labs/fff-bin-linux-arm64-musl", "@ff-labs/fff-bin-linux-x64-gnu", "@ff-labs/fff-bin-linux-x64-musl", "@ff-labs/fff-bin-win32-arm64", "@ff-labs/fff-bin-win32-x64", "@pierre/diffs", "@pierre/theming", "app-builder-lib", "dmg-builder", "electron-builder", "electron-publish"] [test] root = "./do-not-run-tests-from-root" diff --git a/github/package.json b/github/package.json index e1b913abed..a7af1d2532 100644 --- a/github/package.json +++ b/github/package.json @@ -15,6 +15,6 @@ "@actions/github": "6.0.1", "@octokit/graphql": "9.0.1", "@octokit/rest": "catalog:", - "@opencode-ai/sdk": "workspace:*" + "@opencode-ai/sdk": "1.18.5" } } diff --git a/package.json b/package.json index 6332861c91..3ff72db18e 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,6 @@ "packages/*", "packages/console/*", "packages/stats/*", - "packages/sdk/js", "packages/slack" ], "catalog": { @@ -124,7 +123,7 @@ "@aws-sdk/client-s3": "3.933.0", "@opencode-ai/plugin": "workspace:*", "@opencode-ai/script": "workspace:*", - "@opencode-ai/sdk": "workspace:*", + "@opencode-ai/sdk": "1.18.5", "heap-snapshot-toolkit": "1.1.3", "typescript": "catalog:" }, diff --git a/packages/app/package.json b/packages/app/package.json index f6a1bf9d2e..0560690481 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -56,7 +56,7 @@ "@opencode-ai/client": "file:vendor/opencode-ai-client-1.17.13.tgz", "@opencode-ai/core": "workspace:*", "@opencode-ai/schema": "workspace:*", - "@opencode-ai/sdk": "workspace:*", + "@opencode-ai/sdk": "1.18.5", "@opencode-ai/session-ui": "workspace:*", "@opencode-ai/ui": "workspace:*", "@pierre/trees": "1.0.0-beta.4", diff --git a/packages/console/app/src/routes/openapi.json.ts b/packages/console/app/src/routes/openapi.json.ts index 2789e85c49..3de92f74af 100644 --- a/packages/console/app/src/routes/openapi.json.ts +++ b/packages/console/app/src/routes/openapi.json.ts @@ -1,6 +1,6 @@ export async function GET() { const response = await fetch( - "https://raw.githubusercontent.com/anomalyco/opencode/refs/heads/dev/packages/sdk/openapi.json", + "https://raw.githubusercontent.com/anomalyco/opencode/refs/heads/dev/packages/protocol/openapi.json", ) const json = await response.json() return json diff --git a/packages/plugin/package.json b/packages/plugin/package.json index ca64df1357..942de6460a 100644 --- a/packages/plugin/package.json +++ b/packages/plugin/package.json @@ -28,7 +28,7 @@ "@opencode-ai/ai": "workspace:*", "@opencode-ai/client": "workspace:*", "@opencode-ai/schema": "workspace:*", - "@opencode-ai/sdk": "workspace:*", + "@opencode-ai/sdk": "1.18.5", "@standard-schema/spec": "^1.1.0", "effect": "catalog:", "zod": "catalog:" diff --git a/packages/protocol/openapi.json b/packages/protocol/openapi.json new file mode 100644 index 0000000000..1c8b3dc941 --- /dev/null +++ b/packages/protocol/openapi.json @@ -0,0 +1,29592 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "opencode HttpApi", + "version": "0.0.1", + "description": "Experimental HttpApi surface for selected instance routes." + }, + "paths": { + "/api/health": { + "get": { + "tags": [ + "health" + ], + "operationId": "v2.health.get", + "parameters": [], + "security": [], + "responses": { + "200": { + "description": "ServiceHealth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ServiceHealth" + } + } + } + }, + "400": { + "description": "InvalidRequestError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestError" + } + } + } + }, + "401": { + "description": "UnauthorizedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedError" + } + } + } + } + }, + "description": "Report the owning server process and its application status.", + "summary": "Check server health" + } + }, + "/api/service/stop": { + "post": { + "tags": [ + "health" + ], + "operationId": "v2.health.stop", + "parameters": [], + "security": [], + "responses": { + "200": { + "description": "ServiceStopResponse", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ServiceStopResponse" + } + } + } + }, + "400": { + "description": "InvalidRequestError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestError" + } + } + } + }, + "401": { + "description": "UnauthorizedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedError" + } + } + } + } + }, + "description": "Request graceful shutdown of one exact managed server instance.", + "summary": "Stop the managed server", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ServiceStopRequest" + } + } + }, + "required": true + } + } + }, + "/api/server": { + "get": { + "tags": [ + "server" + ], + "operationId": "v2.server.get", + "parameters": [], + "security": [], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "urls": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "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 URLs that can be used to connect to this server.", + "summary": "Get server information" + } + }, + "/api/location": { + "get": { + "tags": [ + "location" + ], + "operationId": "v2.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": "v2.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": "v2.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": "v2.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": "v2.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": "v2.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": "v2.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": "v2.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": "v2.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": "v2.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": "v2.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": "v2.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": "v2.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": { + "$ref": "#/components/schemas/Location.Ref" + } + } + }, + "required": true + } + } + }, + "/api/session/{sessionID}/prompt": { + "post": { + "tags": [ + "session" + ], + "operationId": "v2.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/SessionPending.User" + } + }, + "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" + } + ] + }, + "text": { + "type": "string" + }, + "files": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PromptInput.FileAttachment" + } + }, + "agents": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Prompt.AgentAttachment" + } + }, + "metadata": { + "type": "object" + }, + "delivery": { + "anyOf": [ + { + "type": "string", + "enum": [ + "steer", + "queue" + ] + }, + { + "type": "null" + } + ] + }, + "resume": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "text" + ], + "additionalProperties": false + } + } + }, + "required": true + } + } + }, + "/api/session/{sessionID}/command": { + "post": { + "tags": [ + "session" + ], + "operationId": "v2.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/SessionPending.User" + } + }, + "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": "v2.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": "v2.session.synthetic", + "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/SessionPending.Synthetic" + } + }, + "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": "Durably admit synthetic session input and schedule execution unless resume is false.", + "summary": "Add synthetic message", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "anyOf": [ + { + "type": "string", + "allOf": [ + { + "pattern": "^msg_" + } + ] + }, + { + "type": "null" + } + ] + }, + "text": { + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "metadata": { + "type": "object" + }, + "delivery": { + "anyOf": [ + { + "type": "string", + "enum": [ + "steer", + "queue" + ] + }, + { + "type": "null" + } + ] + }, + "resume": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "text" + ], + "additionalProperties": false + } + } + }, + "required": true + } + } + }, + "/api/session/{sessionID}/shell": { + "post": { + "tags": [ + "session" + ], + "operationId": "v2.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": "v2.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/SessionPending.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": "v2.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": "v2.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": "v2.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": "v2.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": "v2.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}/pending": { + "get": { + "tags": [ + "session" + ], + "operationId": "v2.session.pending.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/SessionPending.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 durable admitted session work not yet visible in projected history, ordered by admission. Includes unpromoted user and synthetic inputs and unhandled compaction barriers. The runner owns consumption; items disappear once promoted or handled.", + "summary": "List pending session work" + } + }, + "/api/session/{sessionID}/instructions/entries": { + "get": { + "tags": [ + "session" + ], + "operationId": "v2.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": "v2.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" + } + ] + } + } + } + }, + "413": { + "description": "InstructionEntryValueTooLargeError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InstructionEntryValueTooLargeError" + } + } + } + } + }, + "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": "v2.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/session/{sessionID}/generate": { + "post": { + "tags": [ + "session" + ], + "operationId": "v2.session.generate", + "parameters": [ + { + "name": "sessionID", + "in": "path", + "schema": { + "type": "string", + "allOf": [ + { + "pattern": "^ses" + } + ] + }, + "required": true + } + ], + "security": [], + "responses": { + "200": { + "description": "SessionGenerateResponse", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SessionGenerateResponse" + } + } + } + }, + "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": "Generate transient text from the current session context without mutating session history.", + "summary": "Generate text from session context", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "prompt": { + "type": "string" + } + }, + "required": [ + "prompt" + ], + "additionalProperties": false + } + } + }, + "required": true + } + } + }, + "/api/experimental/session/{sessionID}/log": { + "get": { + "tags": [ + "session" + ], + "operationId": "v2.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": "v2.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": "v2.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": "v2.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": "v2.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": "v2.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 the current snapshot of available models ordered by release date. The snapshot may precede initial plugin settlement.", + "summary": "List models" + } + }, + "/api/model/default": { + "get": { + "tags": [ + "model" + ], + "operationId": "v2.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": "v2.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": "v2.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": "v2.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": "v2.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": "v2.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/experimental/integration/wellknown": { + "post": { + "tags": [ + "integration" + ], + "operationId": "v2.experimental.integration.wellknown.add", + "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": { + "anyOf": [ + { + "$ref": "#/components/schemas/InvalidRequestError1" + }, + { + "$ref": "#/components/schemas/InvalidRequestError" + } + ] + } + } + } + }, + "401": { + "description": "UnauthorizedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedError" + } + } + } + } + }, + "description": "Discover and persist an experimental wellknown integration source.", + "summary": "Add wellknown integration", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "url": { + "type": "string" + } + }, + "required": [ + "url" + ], + "additionalProperties": false + } + } + }, + "required": true + } + } + }, + "/api/integration/{integrationID}/connect/key": { + "post": { + "tags": [ + "integration" + ], + "operationId": "v2.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": "v2.integration.oauth.connect", + "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/{integrationID}/connect/oauth/{attemptID}": { + "get": { + "tags": [ + "integration" + ], + "operationId": "v2.integration.oauth.status", + "parameters": [ + { + "name": "integrationID", + "in": "path", + "schema": { + "type": "string" + }, + "required": true + }, + { + "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": "v2.integration.oauth.cancel", + "parameters": [ + { + "name": "integrationID", + "in": "path", + "schema": { + "type": "string" + }, + "required": true + }, + { + "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/{integrationID}/connect/oauth/{attemptID}/complete": { + "post": { + "tags": [ + "integration" + ], + "operationId": "v2.integration.oauth.complete", + "parameters": [ + { + "name": "integrationID", + "in": "path", + "schema": { + "type": "string" + }, + "required": true + }, + { + "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/integration/{integrationID}/connect/command": { + "post": { + "tags": [ + "integration" + ], + "operationId": "v2.integration.command.connect", + "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.CommandAttempt" + } + }, + "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 a command authentication attempt.", + "summary": "Begin command connection", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "methodID": { + "type": "string" + }, + "label": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "methodID" + ], + "additionalProperties": false + } + } + }, + "required": true + } + } + }, + "/api/integration/{integrationID}/connect/command/{attemptID}": { + "get": { + "tags": [ + "integration" + ], + "operationId": "v2.integration.command.status", + "parameters": [ + { + "name": "integrationID", + "in": "path", + "schema": { + "type": "string" + }, + "required": true + }, + { + "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.CommandAttemptStatus" + } + }, + "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 and output of a command authentication attempt.", + "summary": "Get command attempt status" + }, + "delete": { + "tags": [ + "integration" + ], + "operationId": "v2.integration.command.cancel", + "parameters": [ + { + "name": "integrationID", + "in": "path", + "schema": { + "type": "string" + }, + "required": true + }, + { + "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 a command authentication attempt and terminate its process.", + "summary": "Cancel command connection" + } + }, + "/api/mcp": { + "get": { + "tags": [ + "mcp" + ], + "operationId": "v2.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/{server}": { + "put": { + "tags": [ + "mcp" + ], + "operationId": "v2.mcp.add", + "parameters": [ + { + "name": "server", + "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": "Add an MCP server at runtime or replace an existing one, connecting it immediately.", + "summary": "Add MCP server", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "config": { + "anyOf": [ + { + "$ref": "#/components/schemas/Mcp.LocalConfig" + }, + { + "$ref": "#/components/schemas/Mcp.RemoteConfig" + } + ] + } + }, + "required": [ + "config" + ], + "additionalProperties": false + } + } + }, + "required": true + } + }, + "delete": { + "tags": [ + "mcp" + ], + "operationId": "v2.mcp.remove", + "parameters": [ + { + "name": "server", + "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" + } + } + } + }, + "404": { + "description": "McpServerNotFoundError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/McpServerNotFoundError" + } + } + } + } + }, + "description": "Stop an MCP server and remove it from the runtime set until restart.", + "summary": "Remove MCP server" + } + }, + "/api/mcp/{server}/connect": { + "post": { + "tags": [ + "mcp" + ], + "operationId": "v2.mcp.connect", + "parameters": [ + { + "name": "server", + "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" + } + } + } + }, + "404": { + "description": "McpServerNotFoundError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/McpServerNotFoundError" + } + } + } + } + }, + "description": "Connect an MCP server at runtime, overriding a disabled configuration until restart.", + "summary": "Connect MCP server" + } + }, + "/api/mcp/{server}/disconnect": { + "post": { + "tags": [ + "mcp" + ], + "operationId": "v2.mcp.disconnect", + "parameters": [ + { + "name": "server", + "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" + } + } + } + }, + "404": { + "description": "McpServerNotFoundError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/McpServerNotFoundError" + } + } + } + } + }, + "description": "Disconnect an MCP server at runtime, removing its tools until reconnected.", + "summary": "Disconnect MCP server" + } + }, + "/api/mcp/resource": { + "get": { + "tags": [ + "mcp" + ], + "operationId": "v2.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": "v2.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": "v2.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": "v2.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/current": { + "get": { + "tags": [ + "project" + ], + "operationId": "v2.project.current", + "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": "Project.Current", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Project.Current" + } + } + } + }, + "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 project for the requested location.", + "summary": "Get current project" + } + }, + "/api/project/{projectID}/directories": { + "get": { + "tags": [ + "project" + ], + "operationId": "v2.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": "v2.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": { + "$ref": "#/components/schemas/Form.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 pending forms for a location.", + "summary": "List pending form requests" + } + }, + "/api/session/{sessionID}/form": { + "get": { + "tags": [ + "form" + ], + "operationId": "v2.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": { + "$ref": "#/components/schemas/Form.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 pending forms for a session.", + "summary": "List session forms" + }, + "post": { + "tags": [ + "form" + ], + "operationId": "v2.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": { + "$ref": "#/components/schemas/Form.Info" + } + }, + "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": "v2.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": { + "$ref": "#/components/schemas/Form.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 | 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": "v2.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": "v2.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": "v2.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": "v2.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": "v2.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": "v2.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": "v2.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": "v2.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": "v2.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": "v2.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": "v2.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": "v2.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": "v2.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": "v2.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": "v2.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": "v2.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": "v2.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": "v2.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": "v2.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": "v2.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": "v2.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": "v2.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": "v2.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": "v2.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/Shell.Info1" + } + } + }, + "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": "v2.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/Shell.Info1" + } + }, + "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": "v2.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/Shell.Info1" + } + }, + "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": "v2.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": "v2.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/Shell.Info1" + } + }, + "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": "v2.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": "v2.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": "v2.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": "v2.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": "v2.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": "v2.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" + } + }, + "/experimental/project/{projectID}/copy": { + "post": { + "tags": [ + "projectCopy" + ], + "operationId": "v2.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": "v2.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 + } + } + }, + "/experimental/project/{projectID}/copy/refresh": { + "post": { + "tags": [ + "projectCopy" + ], + "operationId": "v2.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": "v2.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": "v2.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": "v2.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": "v2.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" + } + }, + "/api/websearch/provider": { + "get": { + "tags": [ + "websearch" + ], + "operationId": "v2.websearch.providers", + "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/WebSearch.Provider" + } + } + }, + "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": "Return the registered web search providers.", + "summary": "List web search providers" + } + }, + "/api/websearch": { + "post": { + "tags": [ + "websearch" + ], + "operationId": "v2.websearch.query", + "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/WebSearch.Response" + } + }, + "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" + } + } + } + }, + "503": { + "description": "ServiceUnavailableError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ServiceUnavailableError" + } + } + } + } + }, + "description": "Run one web search through the selected provider. Specify a provider to override the configured default.", + "summary": "Search the web", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "query": { + "type": "string" + }, + "providerID": { + "type": "string" + } + }, + "required": [ + "query" + ], + "additionalProperties": false + } + } + }, + "required": true + } + } + } + }, + "components": { + "schemas": { + "ServiceHealth": { + "type": "object", + "properties": { + "healthy": { + "type": "boolean", + "enum": [ + true + ] + }, + "version": { + "type": "string" + }, + "pid": { + "type": "integer", + "allOf": [ + { + "exclusiveMinimum": 0 + } + ] + } + }, + "required": [ + "healthy", + "version", + "pid" + ], + "additionalProperties": false + }, + "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 + }, + "ServiceStopRequest": { + "type": "object", + "properties": { + "instanceID": { + "type": "string" + } + }, + "required": [ + "instanceID" + ], + "additionalProperties": false + }, + "ServiceStopResponse": { + "type": "object", + "properties": { + "accepted": { + "type": "boolean" + } + }, + "required": [ + "accepted" + ], + "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" + }, + "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 + }, + "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 + }, + "SessionPending.UserData": { + "type": "object", + "properties": { + "text": { + "type": "string" + }, + "files": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Prompt.FileAttachment" + } + }, + "agents": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Prompt.AgentAttachment" + } + }, + "metadata": { + "type": "object" + } + }, + "required": [ + "text" + ], + "additionalProperties": false + }, + "SessionPending.User": { + "type": "object", + "properties": { + "admittedSeq": { + "type": "integer", + "allOf": [ + { + "minimum": 0 + } + ] + }, + "id": { + "type": "string", + "allOf": [ + { + "pattern": "^msg_" + } + ] + }, + "sessionID": { + "type": "string", + "allOf": [ + { + "pattern": "^ses" + } + ] + }, + "timeCreated": { + "type": "number" + }, + "type": { + "type": "string", + "enum": [ + "user" + ] + }, + "data": { + "$ref": "#/components/schemas/SessionPending.UserData" + }, + "delivery": { + "type": "string", + "enum": [ + "steer", + "queue" + ] + } + }, + "required": [ + "admittedSeq", + "id", + "sessionID", + "timeCreated", + "type", + "data", + "delivery" + ], + "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 + }, + "SessionPending.SyntheticData": { + "type": "object", + "properties": { + "text": { + "type": "string" + }, + "description": { + "type": "string" + }, + "metadata": { + "type": "object" + } + }, + "required": [ + "text" + ], + "additionalProperties": false + }, + "SessionPending.Synthetic": { + "type": "object", + "properties": { + "admittedSeq": { + "type": "integer", + "allOf": [ + { + "minimum": 0 + } + ] + }, + "id": { + "type": "string", + "allOf": [ + { + "pattern": "^msg_" + } + ] + }, + "sessionID": { + "type": "string", + "allOf": [ + { + "pattern": "^ses" + } + ] + }, + "timeCreated": { + "type": "number" + }, + "type": { + "type": "string", + "enum": [ + "synthetic" + ] + }, + "data": { + "$ref": "#/components/schemas/SessionPending.SyntheticData" + }, + "delivery": { + "type": "string", + "enum": [ + "steer", + "queue" + ] + } + }, + "required": [ + "admittedSeq", + "id", + "sessionID", + "timeCreated", + "type", + "data", + "delivery" + ], + "additionalProperties": false + }, + "SessionPending.Compaction": { + "type": "object", + "properties": { + "admittedSeq": { + "type": "integer", + "allOf": [ + { + "minimum": 0 + } + ] + }, + "id": { + "type": "string", + "allOf": [ + { + "pattern": "^msg_" + } + ] + }, + "sessionID": { + "type": "string", + "allOf": [ + { + "pattern": "^ses" + } + ] + }, + "timeCreated": { + "type": "number" + }, + "type": { + "type": "string", + "enum": [ + "compaction" + ] + } + }, + "required": [ + "admittedSeq", + "id", + "sessionID", + "timeCreated", + "type" + ], + "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.ProviderState": { + "type": "object" + }, + "Session.Message.Assistant.Text": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "text" + ] + }, + "text": { + "type": "string" + }, + "state": { + "$ref": "#/components/schemas/Session.Message.ProviderState" + } + }, + "required": [ + "type", + "text" + ], + "additionalProperties": false + }, + "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 + }, + "Session.Message.ToolState.Running": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "running" + ] + }, + "input": { + "type": "object" + }, + "metadata": { + "type": "object" + } + }, + "required": [ + "status", + "input", + "metadata" + ], + "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.Completed": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "completed" + ] + }, + "input": { + "type": "object" + }, + "content": { + "type": "array", + "prefixItems": [ + { + "$ref": "#/components/schemas/LLM.ToolContent" + } + ], + "minItems": 1, + "items": { + "$ref": "#/components/schemas/LLM.ToolContent" + } + }, + "metadata": { + "type": "object" + } + }, + "required": [ + "status", + "input", + "content" + ], + "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" + }, + "error": { + "$ref": "#/components/schemas/Session.StructuredError" + }, + "content": { + "type": "array", + "prefixItems": [ + { + "$ref": "#/components/schemas/LLM.ToolContent" + } + ], + "minItems": 1, + "items": { + "$ref": "#/components/schemas/LLM.ToolContent" + } + }, + "metadata": { + "type": "object" + } + }, + "required": [ + "status", + "input", + "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" + } + ] + }, + "SessionPending.Info": { + "anyOf": [ + { + "$ref": "#/components/schemas/SessionPending.User" + }, + { + "$ref": "#/components/schemas/SessionPending.Synthetic" + }, + { + "$ref": "#/components/schemas/SessionPending.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 + }, + "InstructionEntryValueTooLargeError": { + "type": "object", + "properties": { + "_tag": { + "type": "string", + "enum": [ + "InstructionEntryValueTooLargeError" + ] + }, + "actualBytes": { + "type": "integer" + }, + "maxBytes": { + "type": "integer" + }, + "message": { + "type": "string" + } + }, + "required": [ + "_tag", + "actualBytes", + "maxBytes", + "message" + ], + "additionalProperties": false + }, + "SessionGenerateResponse": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "text": { + "type": "string" + } + }, + "required": [ + "text" + ], + "additionalProperties": false + } + }, + "required": [ + "data" + ], + "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" + }, + "projectID": { + "type": "string" + }, + "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": [ + 2 + ] + } + }, + "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" + } + ] + }, + "parentSeq": { + "type": "integer", + "allOf": [ + { + "minimum": -1 + } + ] + }, + "from": { + "type": "string", + "allOf": [ + { + "pattern": "^msg_" + } + ] + } + }, + "required": [ + "sessionID", + "parentID", + "parentSeq" + ], + "additionalProperties": false + } + }, + "required": [ + "id", + "created", + "type", + "durable", + "data" + ], + "additionalProperties": false + }, + "session.input.promoted": { + "type": "object", + "properties": { + "id": { + "type": "string", + "allOf": [ + { + "pattern": "^evt_" + } + ] + }, + "created": { + "type": "number" + }, + "metadata": { + "type": "object" + }, + "type": { + "type": "string", + "enum": [ + "session.input.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 + }, + "SessionPending.UserData1": { + "type": "object", + "properties": { + "text": { + "type": "string" + }, + "files": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Prompt.FileAttachment" + } + }, + "agents": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Prompt.AgentAttachment" + } + }, + "metadata": { + "type": "object" + } + }, + "required": [ + "text" + ], + "additionalProperties": false + }, + "SessionPending.UserMessage": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "user" + ] + }, + "data": { + "$ref": "#/components/schemas/SessionPending.UserData1" + }, + "delivery": { + "type": "string", + "enum": [ + "steer", + "queue" + ] + } + }, + "required": [ + "type", + "data", + "delivery" + ], + "additionalProperties": false + }, + "SessionPending.SyntheticData1": { + "type": "object", + "properties": { + "text": { + "type": "string" + }, + "description": { + "type": "string" + }, + "metadata": { + "type": "object" + } + }, + "required": [ + "text" + ], + "additionalProperties": false + }, + "SessionPending.SyntheticMessage": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "synthetic" + ] + }, + "data": { + "$ref": "#/components/schemas/SessionPending.SyntheticData1" + }, + "delivery": { + "type": "string", + "enum": [ + "steer", + "queue" + ] + } + }, + "required": [ + "type", + "data", + "delivery" + ], + "additionalProperties": false + }, + "SessionPending.Message": { + "anyOf": [ + { + "$ref": "#/components/schemas/SessionPending.UserMessage" + }, + { + "$ref": "#/components/schemas/SessionPending.SyntheticMessage" + } + ] + }, + "session.input.admitted": { + "type": "object", + "properties": { + "id": { + "type": "string", + "allOf": [ + { + "pattern": "^evt_" + } + ] + }, + "created": { + "type": "number" + }, + "metadata": { + "type": "object" + }, + "type": { + "type": "string", + "enum": [ + "session.input.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_" + } + ] + }, + "input": { + "$ref": "#/components/schemas/SessionPending.Message" + } + }, + "required": [ + "sessionID", + "inputID", + "input" + ], + "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": [ + 2 + ] + } + }, + "required": [ + "aggregateID", + "seq", + "version" + ], + "additionalProperties": false + }, + "location": { + "$ref": "#/components/schemas/Location.Ref" + }, + "data": { + "type": "object", + "properties": { + "sessionID": { + "type": "string", + "allOf": [ + { + "pattern": "^ses" + } + ] + }, + "delta": { + "type": "object", + "additionalProperties": { + "anyOf": [ + { + "type": "string", + "allOf": [ + { + "pattern": "^[a-f0-9]{64}$" + } + ] + }, + { + "type": "string", + "enum": [ + "removed" + ] + } + ] + } + } + }, + "required": [ + "sessionID", + "delta" + ], + "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.Info": { + "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": { + "type": "number" + }, + "metadata": { + "type": "object" + }, + "time": { + "type": "object", + "properties": { + "started": { + "type": "number" + }, + "completed": { + "type": "number" + } + }, + "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.Info" + } + }, + "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.Info" + }, + "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" + }, + "snapshot": { + "type": "string" + }, + "files": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "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.Message.ProviderState4": { + "type": "object" + }, + "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" + }, + "state": { + "$ref": "#/components/schemas/Session.Message.ProviderState4" + } + }, + "required": [ + "sessionID", + "assistantMessageID", + "ordinal", + "text" + ], + "additionalProperties": false + } + }, + "required": [ + "id", + "created", + "type", + "durable", + "data" + ], + "additionalProperties": false + }, + "Session.Message.ProviderState5": { + "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.ProviderState5" + } + }, + "required": [ + "sessionID", + "assistantMessageID", + "ordinal" + ], + "additionalProperties": false + } + }, + "required": [ + "id", + "created", + "type", + "durable", + "data" + ], + "additionalProperties": false + }, + "Session.Message.ProviderState6": { + "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.ProviderState6" + } + }, + "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.ProviderState7": { + "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.ProviderState7" + } + }, + "required": [ + "sessionID", + "assistantMessageID", + "callID", + "input", + "executed" + ], + "additionalProperties": false + } + }, + "required": [ + "id", + "created", + "type", + "durable", + "data" + ], + "additionalProperties": false + }, + "Session.Message.ProviderState8": { + "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": [ + 2 + ] + } + }, + "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" + }, + "content": { + "type": "array", + "prefixItems": [ + { + "$ref": "#/components/schemas/LLM.ToolContent" + } + ], + "minItems": 1, + "items": { + "$ref": "#/components/schemas/LLM.ToolContent" + } + }, + "metadata": { + "type": "object" + }, + "executed": { + "type": "boolean" + }, + "resultState": { + "$ref": "#/components/schemas/Session.Message.ProviderState8" + } + }, + "required": [ + "sessionID", + "assistantMessageID", + "callID", + "content", + "executed" + ], + "additionalProperties": false + } + }, + "required": [ + "id", + "created", + "type", + "durable", + "data" + ], + "additionalProperties": false + }, + "Session.Message.ProviderState9": { + "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": [ + 2 + ] + } + }, + "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" + }, + "content": { + "type": "array", + "prefixItems": [ + { + "$ref": "#/components/schemas/LLM.ToolContent" + } + ], + "minItems": 1, + "items": { + "$ref": "#/components/schemas/LLM.ToolContent" + } + }, + "metadata": { + "type": "object" + }, + "executed": { + "type": "boolean" + }, + "resultState": { + "$ref": "#/components/schemas/Session.Message.ProviderState9" + } + }, + "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.usage.recorded": { + "type": "object", + "properties": { + "id": { + "type": "string", + "allOf": [ + { + "pattern": "^evt_" + } + ] + }, + "created": { + "type": "number" + }, + "metadata": { + "type": "object" + }, + "type": { + "type": "string", + "enum": [ + "session.usage.recorded" + ] + }, + "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" + } + ] + }, + "source": { + "type": "string", + "enum": [ + "title", + "compaction" + ] + }, + "cost": { + "$ref": "#/components/schemas/Money.USD" + }, + "tokens": { + "$ref": "#/components/schemas/TokenUsage.Info" + } + }, + "required": [ + "sessionID", + "source", + "cost", + "tokens" + ], + "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.input.promoted" + }, + { + "$ref": "#/components/schemas/session.input.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.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" + }, + { + "$ref": "#/components/schemas/session.usage.recorded" + } + ] + }, + "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.ReasoningField": { + "anyOf": [ + { + "type": "string", + "enum": [ + "reasoning", + "reasoning_content", + "reasoning_text" + ] + }, + { + "type": "string" + } + ] + }, + "Model.Compatibility": { + "type": "object", + "properties": { + "reasoningField": { + "$ref": "#/components/schemas/Model.ReasoningField" + } + }, + "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" + }, + "compatibility": { + "$ref": "#/components/schemas/Model.Compatibility" + }, + "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.CommandMethod": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "command" + ] + }, + "label": { + "type": "string" + }, + "command": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "id", + "type", + "label", + "command" + ], + "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.CommandMethod" + }, + { + "$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 + } + ] + }, + "Integration.CommandAttempt": { + "type": "object", + "properties": { + "attemptID": { + "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": [ + "attemptID", + "time" + ], + "additionalProperties": false + }, + "Integration.CommandAttemptStatus": { + "anyOf": [ + { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "pending" + ] + }, + "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", + "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.TimeoutConfig": { + "type": "object", + "properties": { + "startup": { + "anyOf": [ + { + "type": "integer", + "allOf": [ + { + "exclusiveMinimum": 0 + } + ] + }, + { + "type": "null" + } + ], + "description": "Maximum time in milliseconds to establish and initialize the MCP server." + }, + "catalog": { + "anyOf": [ + { + "type": "integer", + "allOf": [ + { + "exclusiveMinimum": 0 + } + ] + }, + { + "type": "null" + } + ], + "description": "Maximum time in milliseconds to wait for MCP discovery requests such as tools/list and prompts/list." + }, + "execution": { + "anyOf": [ + { + "type": "integer", + "allOf": [ + { + "exclusiveMinimum": 0 + } + ] + }, + { + "type": "null" + } + ], + "description": "Maximum time in milliseconds to wait for MCP tool and prompt execution." + } + }, + "additionalProperties": false + }, + "Mcp.LocalConfig": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "local" + ] + }, + "command": { + "type": "array", + "items": { + "type": "string" + } + }, + "cwd": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Working directory for the MCP server process. Relative paths resolve from the workspace directory." + }, + "environment": { + "anyOf": [ + { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + { + "type": "null" + } + ] + }, + "disabled": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + }, + "codemode": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "description": "Expose this server's tools through Code Mode. Defaults to true." + }, + "timeout": { + "anyOf": [ + { + "$ref": "#/components/schemas/Mcp.TimeoutConfig" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "type", + "command" + ], + "additionalProperties": false + }, + "Mcp.OAuthConfig": { + "type": "object", + "properties": { + "client_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "client_secret": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "scope": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "callback_port": { + "anyOf": [ + { + "type": "integer", + "allOf": [ + { + "minimum": 1, + "maximum": 65535 + } + ] + }, + { + "type": "null" + } + ] + }, + "redirect_uri": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false + }, + "Mcp.RemoteConfig": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "remote" + ] + }, + "url": { + "type": "string" + }, + "headers": { + "anyOf": [ + { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + { + "type": "null" + } + ] + }, + "oauth": { + "anyOf": [ + { + "anyOf": [ + { + "$ref": "#/components/schemas/Mcp.OAuthConfig" + }, + { + "type": "boolean", + "enum": [ + false + ] + } + ] + }, + { + "type": "null" + } + ] + }, + "disabled": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + }, + "codemode": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "description": "Expose this server's tools through Code Mode. Defaults to true." + }, + "timeout": { + "anyOf": [ + { + "$ref": "#/components/schemas/Mcp.TimeoutConfig" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "type", + "url" + ], + "additionalProperties": false + }, + "McpServerNotFoundError": { + "type": "object", + "properties": { + "_tag": { + "type": "string", + "enum": [ + "McpServerNotFoundError" + ] + }, + "server": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "required": [ + "_tag", + "server", + "message" + ], + "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.ExternalField": { + "type": "object", + "properties": { + "key": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "external" + ] + }, + "url": { + "type": "string" + }, + "title": { + "type": "string" + }, + "description": { + "type": "string" + } + }, + "required": [ + "key", + "type", + "url" + ], + "additionalProperties": false + }, + "Form.Field": { + "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" + }, + { + "$ref": "#/components/schemas/Form.ExternalField" + } + ] + }, + "Form.Fields": { + "type": "array", + "prefixItems": [ + { + "$ref": "#/components/schemas/Form.Field" + } + ], + "minItems": 1, + "items": { + "$ref": "#/components/schemas/Form.Field" + } + }, + "Form.Info": { + "type": "object", + "properties": { + "id": { + "type": "string", + "allOf": [ + { + "pattern": "^frm_" + } + ] + }, + "sessionID": { + "type": "string" + }, + "title": { + "type": "string" + }, + "metadata": { + "$ref": "#/components/schemas/Form.Metadata" + }, + "fields": { + "$ref": "#/components/schemas/Form.Fields" + } + }, + "required": [ + "id", + "sessionID", + "title", + "fields" + ], + "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" + }, + "fields": { + "$ref": "#/components/schemas/Form.Fields" + } + }, + "required": [ + "title", + "fields" + ], + "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.tool.progress": { + "type": "object", + "properties": { + "id": { + "type": "string", + "allOf": [ + { + "pattern": "^evt_" + } + ] + }, + "created": { + "type": "number" + }, + "metadata": { + "type": "object" + }, + "type": { + "type": "string", + "enum": [ + "session.tool.progress" + ] + }, + "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" + }, + "metadata": { + "type": "object" + } + }, + "required": [ + "sessionID", + "assistantMessageID", + "callID", + "metadata" + ], + "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.added": { + "type": "object", + "properties": { + "id": { + "type": "string", + "allOf": [ + { + "pattern": "^evt_" + } + ] + }, + "created": { + "type": "number" + }, + "metadata": { + "type": "object" + }, + "type": { + "type": "string", + "enum": [ + "plugin.added" + ] + }, + "location": { + "$ref": "#/components/schemas/Location.Ref" + }, + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + } + }, + "required": [ + "id" + ], + "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.Info" + } + }, + "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": { + "type": "number" + }, + "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.Field1": { + "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" + }, + { + "$ref": "#/components/schemas/Form.ExternalField" + } + ] + }, + "Form.Fields1": { + "type": "array", + "prefixItems": [ + { + "$ref": "#/components/schemas/Form.Field1" + } + ], + "minItems": 1, + "items": { + "$ref": "#/components/schemas/Form.Field1" + } + }, + "Form.Info1": { + "type": "object", + "properties": { + "id": { + "type": "string", + "allOf": [ + { + "pattern": "^frm_" + } + ] + }, + "sessionID": { + "type": "string" + }, + "title": { + "type": "string" + }, + "metadata": { + "$ref": "#/components/schemas/Form.Metadata1" + }, + "fields": { + "$ref": "#/components/schemas/Form.Fields1" + } + }, + "required": [ + "id", + "sessionID", + "title", + "fields" + ], + "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": { + "$ref": "#/components/schemas/Form.Info1" + } + }, + "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 + }, + "websearch.updated": { + "type": "object", + "properties": { + "id": { + "type": "string", + "allOf": [ + { + "pattern": "^evt_" + } + ] + }, + "created": { + "type": "number" + }, + "metadata": { + "type": "object" + }, + "type": { + "type": "string", + "enum": [ + "websearch.updated" + ] + }, + "location": { + "$ref": "#/components/schemas/Location.Ref" + }, + "data": { + "anyOf": [ + { + "type": "object" + }, + { + "type": "array" + } + ] + } + }, + "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.input.promoted" + }, + { + "$ref": "#/components/schemas/session.input.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.added" + }, + { + "$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/websearch.updated" + }, + { + "$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 + }, + "Shell.Info1": { + "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": { + "type": "number" + }, + "metadata": { + "type": "object" + }, + "time": { + "type": "object", + "properties": { + "started": { + "type": "number" + }, + "completed": { + "type": "number" + } + }, + "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" + ] + }, + "WebSearch.Provider": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "required": [ + "id", + "name" + ], + "additionalProperties": false + }, + "WebSearch.Result": { + "type": "object", + "properties": { + "url": { + "type": "string" + }, + "title": { + "type": "string" + }, + "content": { + "type": "string" + }, + "time": { + "type": "object", + "properties": { + "published": { + "type": "number" + } + }, + "additionalProperties": false + } + }, + "required": [ + "url", + "time" + ], + "additionalProperties": false + }, + "WebSearch.Response": { + "type": "object", + "properties": { + "providerID": { + "type": "string" + }, + "results": { + "type": "array", + "items": { + "$ref": "#/components/schemas/WebSearch.Result" + } + } + }, + "required": [ + "providerID", + "results" + ], + "additionalProperties": false + } + }, + "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" + }, + { + "name": "websearch", + "description": "Location-scoped web search routes." + } + ] +} diff --git a/packages/protocol/package.json b/packages/protocol/package.json index c79d9dbdf7..8d6ae38b0d 100644 --- a/packages/protocol/package.json +++ b/packages/protocol/package.json @@ -20,6 +20,8 @@ }, "scripts": { "build": "bun run script/build.ts", + "generate": "bun run script/generate-openapi.ts", + "check:generated": "bun run script/generate-openapi.ts --check", "typecheck": "tsgo --noEmit" }, "dependencies": { diff --git a/packages/protocol/script/generate-openapi.ts b/packages/protocol/script/generate-openapi.ts new file mode 100644 index 0000000000..9d799a261d --- /dev/null +++ b/packages/protocol/script/generate-openapi.ts @@ -0,0 +1,16 @@ +import { OpenApi } from "effect/unstable/httpapi" +import { fileURLToPath } from "url" +import { ClientApi } from "../src/client.js" + +const document = JSON.stringify(OpenApi.fromApi(ClientApi), null, 2) + "\n" +const target = fileURLToPath(new URL("../openapi.json", import.meta.url)) + +if (process.argv.includes("--check")) { + if ((await Bun.file(target).text()) !== document) { + console.error("Generated OpenAPI document is stale. Run `bun run generate` from packages/protocol.") + process.exit(1) + } + process.exit(0) +} + +await Bun.write(target, document) diff --git a/packages/sdk/.gitignore b/packages/sdk/.gitignore deleted file mode 100644 index d98d51a880..0000000000 --- a/packages/sdk/.gitignore +++ /dev/null @@ -1,10 +0,0 @@ -.prism.log -node_modules -yarn-error.log -codegen.log -Brewfile.lock.json -dist -dist-deno -/*.tgz -.idea/ - diff --git a/packages/sdk/js/example/example.ts b/packages/sdk/js/example/example.ts deleted file mode 100644 index 42838a82a7..0000000000 --- a/packages/sdk/js/example/example.ts +++ /dev/null @@ -1,56 +0,0 @@ -import { createOpencodeClient, createOpencodeServer } from "@opencode-ai/sdk" -import { pathToFileURL } from "bun" - -const server = await createOpencodeServer() -const client = createOpencodeClient({ baseUrl: server.url }) - -const input = await Array.fromAsync(new Bun.Glob("packages/core/*.ts").scan()) - -const tasks: Promise[] = [] -for await (const file of input) { - console.log("processing", file) - const session = await client.session.create() - tasks.push( - client.session.prompt({ - path: { id: session.data.id }, - body: { - parts: [ - { - type: "file", - mime: "text/plain", - url: pathToFileURL(file).href, - }, - { - type: "text", - text: `Write tests for every public function in this file.`, - }, - ], - }, - }), - ) - console.log("done", file) -} - -await Promise.all( - input.map(async (file) => { - const session = await client.session.create() - console.log("processing", file) - await client.session.prompt({ - path: { id: session.data.id }, - body: { - parts: [ - { - type: "file", - mime: "text/plain", - url: pathToFileURL(file).href, - }, - { - type: "text", - text: `Write tests for every public function in this file.`, - }, - ], - }, - }) - console.log("done", file) - }), -) diff --git a/packages/sdk/js/package.json b/packages/sdk/js/package.json deleted file mode 100644 index d16ee0f054..0000000000 --- a/packages/sdk/js/package.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "$schema": "https://json.schemastore.org/package.json", - "name": "@opencode-ai/sdk", - "version": "1.18.4", - "type": "module", - "license": "MIT", - "scripts": { - "test": "bun test", - "typecheck": "tsgo --noEmit" - }, - "exports": { - ".": "./src/index.ts", - "./client": "./src/client.ts", - "./server": "./src/server.ts", - "./v2": "./src/v2/index.ts", - "./v2/client": "./src/v2/client.ts", - "./v2/gen/client": "./src/v2/gen/client/index.ts", - "./v2/server": "./src/v2/server.ts", - "./v2/types": "./src/v2/gen/types.gen.ts" - }, - "files": [ - "dist" - ], - "devDependencies": { - "@hey-api/openapi-ts": "0.90.10", - "@tsconfig/node22": "catalog:", - "@types/cross-spawn": "catalog:", - "@types/node": "catalog:", - "@typescript/native-preview": "catalog:", - "typescript": "catalog:" - }, - "dependencies": { - "cross-spawn": "catalog:" - } -} diff --git a/packages/sdk/js/script/build.ts b/packages/sdk/js/script/build.ts deleted file mode 100755 index c8fef5b1a7..0000000000 --- a/packages/sdk/js/script/build.ts +++ /dev/null @@ -1,424 +0,0 @@ -#!/usr/bin/env bun -import { fileURLToPath } from "url" - -const dir = fileURLToPath(new URL("..", import.meta.url)) -process.chdir(dir) - -import { $ } from "bun" -import path from "path" - -import { createClient } from "@hey-api/openapi-ts" - -const opencode = path.resolve(dir, "../../opencode") -const client = path.resolve(dir, "../../client") - -if (!(await Bun.file(path.join(opencode, "package.json")).exists())) { - await $`rm -rf dist` - await $`bun tsc` - process.exit(0) -} - -await $`bun dev generate > ${dir}/openapi.json`.cwd(opencode) -await $`bun -e ${` - import { OpenApi } from "effect/unstable/httpapi" - import { ClientApi } from "@opencode-ai/protocol/client" - - const output = process.argv.at(-1) - if (!output) throw new Error("Missing OpenAPI output path") - await Bun.write(output, JSON.stringify(OpenApi.fromApi(ClientApi))) -`} ${path.join(dir, "openapi-v2.json")}`.cwd(client) - -type OpenApiDocument = { - components?: { schemas?: Record } - paths?: Record - [key: string]: unknown -} - -const document = (await Bun.file("./openapi.json").json()) as OpenApiDocument -const v2Document = (await Bun.file("./openapi-v2.json").json()) as OpenApiDocument -normalizeComponentNames(v2Document) -deduplicateEquivalentComponent(v2Document, "Shell", "Shell1") -renameCollidingComponents(document, v2Document) -document.paths = { ...document.paths, ...v2Document.paths } -document.components = { - ...document.components, - schemas: { ...document.components?.schemas, ...v2Document.components?.schemas }, -} -inlineTypedAllOfConstraints(document) -const schemas = document.components?.schemas -if (schemas) { - const reachable = new Set() - const visit = (value: unknown) => { - if (Array.isArray(value)) { - value.forEach(visit) - return - } - if (typeof value !== "object" || value === null) return - for (const [key, child] of Object.entries(value)) { - if (key === "$ref" && typeof child === "string" && child.startsWith("#/components/schemas/")) { - const name = child.slice("#/components/schemas/".length) - if (reachable.has(name)) continue - reachable.add(name) - visit(schemas[name]) - } else { - visit(child) - } - } - } - visit({ ...document, components: { ...document.components, schemas: undefined } }) - for (const name of Object.keys(schemas)) { - if ( - /^(SessionAgentSelected|SessionModelSelected|SessionMoved|SessionRenamed|SessionForked|SessionInputPromoted|SessionInputAdmitted|SessionExecutionStarted|SessionExecutionSucceeded|SessionExecutionFailed|SessionExecutionInterrupted|SessionInstructionsUpdated|SessionSynthetic|SessionSkillActivated|SessionShellStarted|SessionShellEnded|SessionStepStarted|SessionStepEnded|SessionStepFailed|SessionTextStarted|SessionTextDelta|SessionTextEnded|SessionToolInputStarted|SessionToolInputDelta|SessionToolInputEnded|SessionToolCalled|SessionToolProgress|SessionToolSuccess|SessionToolFailed|SessionRetryScheduled|SessionCompactionStarted|SessionCompactionDelta|SessionCompactionEnded|SessionRevertStaged|SessionRevertCleared|SessionRevertCommitted)\d+$/.test( - name, - ) && - !reachable.has(name) - ) - delete schemas[name] - } - await Bun.write("./openapi.json", JSON.stringify(document)) -} - -await createClient({ - input: "./openapi.json", - output: { - path: "./src/v2/gen", - tsConfigPath: path.join(dir, "tsconfig.json"), - clean: true, - }, - plugins: [ - { - name: "@hey-api/typescript", - exportFromIndex: false, - }, - { - name: "@hey-api/sdk", - instance: "OpencodeClient", - exportFromIndex: false, - auth: false, - paramsStructure: "flat", - }, - { - name: "@hey-api/client-fetch", - exportFromIndex: false, - baseUrl: "http://localhost:4096", - }, - ], -}) - -const generatedTypesPath = "./src/v2/gen/types.gen.ts" -const generatedTypes = await Bun.file(generatedTypesPath).text() -if ( - /export type (SessionAgentSelected|SessionModelSelected|SessionMoved|SessionRenamed|SessionForked|SessionInputPromoted|SessionInputAdmitted|SessionExecutionStarted|SessionExecutionSucceeded|SessionExecutionFailed|SessionExecutionInterrupted|SessionInstructionsUpdated|SessionSynthetic|SessionSkillActivated|SessionShellStarted|SessionShellEnded|SessionStepStarted|SessionStepEnded|SessionStepFailed|SessionTextStarted|SessionTextDelta|SessionTextEnded|SessionToolInputStarted|SessionToolInputDelta|SessionToolInputEnded|SessionToolCalled|SessionToolProgress|SessionToolSuccess|SessionToolFailed|SessionRetryScheduled|SessionCompactionStarted|SessionCompactionDelta|SessionCompactionEnded|SessionRevertStaged|SessionRevertCleared|SessionRevertCommitted)\d+ =/.test( - generatedTypes, - ) -) { - throw new Error("Session history generated duplicate Session event variants") -} -const sessionErrorTypesPatched = deduplicateEquivalentGeneratedTypes( - generatedTypes, - "SessionStructuredError", - /^SessionStructuredError\d+$/, -) -const obsoleteSessionNext = [...sessionErrorTypesPatched.matchAll(/export type (SessionNext\w*) =/g)].map( - (match) => match[1], -) -if (obsoleteSessionNext.length > 0) { - throw new Error(`Obsolete SessionNext generated type noise reintroduced: ${obsoleteSessionNext.join(", ")}`) -} -const logTypesPatched = sessionErrorTypesPatched.replace( - /(export type V2SessionLogData = \{[\s\S]*?query\?: \{\s*after\?: )string/, - "$1number", -) -if (logTypesPatched === sessionErrorTypesPatched) { - throw new Error("Session log numeric query patch did not apply") -} -const sessionListTypesPatched = logTypesPatched.replace( - /(export type V2SessionListData = \{[\s\S]*?query\?: \{[\s\S]*?limit\?: )string( \| null)/, - "$1number$2", -) -if (sessionListTypesPatched === logTypesPatched) { - throw new Error("Session list numeric query patch did not apply") -} -const sessionMessagesTypesPatched = sessionListTypesPatched.replace( - /(export type V2MessageListData = \{[\s\S]*?query\?: \{[\s\S]*?limit\?: )string( \| null)/, - "$1number$2", -) -if (sessionMessagesTypesPatched === sessionListTypesPatched) { - throw new Error("Session messages numeric query patch did not apply") -} -const eventSubscribeTypesPatched = sessionMessagesTypesPatched.replace( - /(export type V2EventSubscribeResponses = \{\s*\/\*\*[\s\S]*?\*\/\s*200: )\{\s*id: string \| null;?\s*event: string;?\s*data: (?:V2EventStream(?:V2)?|V2EventJsonString);?\s*\};?/, - "$1V2Event", -) -if (eventSubscribeTypesPatched === sessionMessagesTypesPatched) { - throw new Error("Event subscribe response patch did not apply") -} -if (/SessionStructuredError\d/.test(eventSubscribeTypesPatched)) { - throw new Error("Session structured error generated a name-mangled duplicate") -} -if (/\bSessionNext\w*\b/.test(eventSubscribeTypesPatched)) { - throw new Error("Obsolete SessionNext generated type noise reintroduced") -} -if (/export type Shell\d+V2 =/.test(eventSubscribeTypesPatched)) { - throw new Error("Shell generated a name-mangled duplicate") -} -await Bun.write(generatedTypesPath, eventSubscribeTypesPatched) - -const querySerializerPath = "./src/v2/gen/client/utils.gen.ts" -const querySerializerSource = await Bun.file(querySerializerPath).text() -const querySerializerPatched = querySerializerSource.replace( - /if \(value === undefined \|\| value === null\) \{\s*continue;?\s*\}/, - "if (value === undefined) {\n continue;\n }\n\n if (value === null) {\n search.push(`${name}=null`);\n continue;\n }", -) -if (querySerializerPatched === querySerializerSource) { - throw new Error( - `Query serializer null patch did not apply; @hey-api/openapi-ts output may have changed (${querySerializerPath})`, - ) -} -await Bun.write(querySerializerPath, querySerializerPatched) - -const generatedSdkPath = "./src/v2/gen/sdk.gen.ts" -const generatedSdk = await Bun.file(generatedSdkPath).text() -const logSdkPatched = generatedSdk.replace( - /(Read the session log[\s\S]*?parameters: \{[\s\S]*?after\?: )string(\s*\|\s*null)?/, - "$1number$2", -) -if (logSdkPatched === generatedSdk) { - throw new Error("Session log numeric SDK patch did not apply") -} -const sessionListSdkPatched = logSdkPatched.replace( - /(List sessions[\s\S]*?parameters\?: \{[\s\S]*?limit\?: )string( \| null)/, - "$1number$2", -) -if (sessionListSdkPatched === logSdkPatched) { - throw new Error("Session list numeric SDK patch did not apply") -} -const sessionMessagesSdkPatched = sessionListSdkPatched.replace( - /(Get session messages[\s\S]*?parameters: \{[\s\S]*?limit\?: )string( \| null)/, - "$1number$2", -) -if (sessionMessagesSdkPatched === sessionListSdkPatched) { - throw new Error("Session messages numeric SDK patch did not apply") -} -await Bun.write(generatedSdkPath, sessionMessagesSdkPatched) - -// Patch a @hey-api/openapi-ts codegen bug: SseFn incorrectly passes the -// endpoint's TError into the second generic of ServerSentEventsResult, which -// is the AsyncGenerator's TReturn slot. Iterator return values have nothing -// to do with HTTP errors, and any consumer that calls `.return()` or returns -// from a mock generator gets type-checked against the wrong shape. Drop the -// arg so TReturn defaults to void. -const sseTypesPath = "./src/v2/gen/client/types.gen.ts" -const sseTypesFile = Bun.file(sseTypesPath) -const sseTypesSource = await sseTypesFile.text() -const sseTypesPatched = sseTypesSource.replace( - "=> Promise>", - "=> Promise>", -) -if (sseTypesPatched === sseTypesSource) { - throw new Error(`SseFn patch did not apply; @hey-api/openapi-ts output may have changed (${sseTypesPath})`) -} -await Bun.write(sseTypesPath, sseTypesPatched) - -await $`bun prettier --write src/gen` -await $`bun prettier --write src/v2` -await $`rm -rf dist` -await $`bun tsc` -await $`rm openapi.json openapi-v2.json` - -function renameCollidingComponents(target: OpenApiDocument, source: OpenApiDocument) { - const targetSchemas = target.components?.schemas - const sourceSchemas = source.components?.schemas - if (!targetSchemas || !sourceSchemas) return - - const renames = new Map() - for (const name of Object.keys(sourceSchemas)) { - if (!Object.hasOwn(targetSchemas, name)) continue - if (JSON.stringify(normalizeSchema(sourceSchemas[name])) === JSON.stringify(normalizeSchema(targetSchemas[name]))) { - delete sourceSchemas[name] - continue - } - let renamed = `${name}V2` - let index = 2 - while (Object.hasOwn(targetSchemas, renamed) || Object.hasOwn(sourceSchemas, renamed)) { - renamed = `${name}V2${index}` - index++ - } - renames.set(name, renamed) - } - if (renames.size === 0) return - - source.components = { - ...source.components, - schemas: Object.fromEntries( - Object.entries(sourceSchemas).map(([name, schema]) => [renames.get(name) ?? name, rewriteRefs(schema, renames)]), - ), - } - source.paths = rewriteRefs(source.paths, renames) as Record | undefined -} - -function normalizeComponentNames(document: OpenApiDocument) { - const schemas = document.components?.schemas - if (!schemas) return - - const canonical = new Map(Object.entries(schemas)) - const renames = new Map() - for (const name of Object.keys(schemas)) { - const next = componentTypeName(name) - if (next === name) continue - const existing = canonical.get(next) - if (existing !== undefined) { - if (JSON.stringify(normalizeSchema(schemas[name])) !== JSON.stringify(normalizeSchema(existing))) continue - renames.set(name, next) - continue - } - renames.set(name, next) - canonical.set(next, schemas[name]) - } - if (renames.size === 0) return - - const renamed = new Set() - document.components = { - ...document.components, - schemas: Object.fromEntries( - [ - ...Object.entries(schemas).filter(([name]) => !renames.has(name)), - ...Object.entries(schemas).flatMap(([name, schema]) => { - const next = renames.get(name) - if (!next || Object.hasOwn(schemas, next) || renamed.has(next)) return [] - renamed.add(next) - return [[next, schema] as const] - }), - ].map(([name, schema]) => [name, rewriteRefs(schema, renames)]), - ), - } - document.paths = rewriteRefs(document.paths, renames) as Record | undefined -} - -function componentTypeName(name: string) { - if (!name.includes(".")) return name - return name - .split(".") - .filter((part) => !/^\d+$/.test(part)) - .map((part) => part.slice(0, 1).toUpperCase() + part.slice(1)) - .join("") -} - -function deduplicateEquivalentComponent(document: OpenApiDocument, canonical: string, duplicate: string) { - const schemas = document.components?.schemas - if (!schemas?.[canonical] || !schemas[duplicate]) return - if (JSON.stringify(normalizeSchema(schemas[canonical])) !== JSON.stringify(normalizeSchema(schemas[duplicate]))) { - throw new Error(`${duplicate} no longer has the same wire shape as ${canonical}`) - } - - const renames = new Map([[duplicate, canonical]]) - const rewritten = rewriteRefs(schemas, renames) as Record - delete rewritten[duplicate] - document.components = { ...document.components, schemas: rewritten } - document.paths = rewriteRefs(document.paths, renames) as Record | undefined -} - -function deduplicateEquivalentGeneratedTypes(source: string, canonical: string, duplicates: RegExp) { - const canonicalType = generatedType(source, canonical) - if (!canonicalType) throw new Error(`Generated canonical type missing: ${canonical}`) - const names = [...source.matchAll(/export type (\w+) =/g)] - .map((match) => match[1]) - .filter((name): name is string => name !== undefined && duplicates.test(name)) - - return names.reduce((patched, name) => { - const duplicate = generatedType(patched, name) - const currentCanonical = generatedType(patched, canonical) - if (!duplicate || !currentCanonical) throw new Error(`Generated type declaration missing while comparing ${name}`) - if (normalizeGeneratedType(currentCanonical.shape) !== normalizeGeneratedType(duplicate.shape)) { - throw new Error(`${name} no longer has the same generated type shape as ${canonical}`) - } - return (patched.slice(0, duplicate.start) + patched.slice(duplicate.end)).replaceAll(name, canonical) - }, source) -} - -function generatedType(source: string, name: string) { - const start = source.indexOf(`export type ${name} =`) - if (start === -1) return undefined - const next = source.indexOf("\n\nexport type ", start + 1) - const shapeEnd = next === -1 ? source.length : next - return { - start, - end: next === -1 ? source.length : next + 2, - shape: source.slice(source.indexOf("=", start) + 1, shapeEnd), - } -} - -function normalizeGeneratedType(shape: string) { - return shape.replaceAll(/\s/g, "") -} - -function normalizeSchema(value: unknown, key?: string): unknown { - if (Array.isArray(value)) { - const flattened = - key === "anyOf" - ? value.flatMap((item) => - typeof item === "object" && item !== null && Object.keys(item).length === 1 && "anyOf" in item - ? Array.isArray(item.anyOf) - ? item.anyOf - : [item] - : [item], - ) - : value - const expanded = - key === "anyOf" - ? flattened.flatMap((item) => { - if (typeof item !== "object" || item === null || !("type" in item) || !("enum" in item)) return [item] - if (Object.keys(item).some((property) => property !== "type" && property !== "enum")) return [item] - if (!Array.isArray(item.enum)) return [item] - return item.enum.map((member) => ({ type: item.type, enum: [member] })) - }) - : flattened - const normalized = expanded.map((item) => normalizeSchema(item)) - if (key !== "anyOf" && key !== "required" && key !== "enum") return normalized - return [...new Map(normalized.map((item) => [JSON.stringify(item), item])).values()].sort((a, b) => - JSON.stringify(a).localeCompare(JSON.stringify(b)), - ) - } - if (typeof value !== "object" || value === null) return value - return Object.fromEntries( - Object.entries(value) - .sort(([left], [right]) => left.localeCompare(right)) - .map(([property, child]) => [property, normalizeSchema(child, property)]), - ) -} - -function rewriteRefs(value: unknown, renames: Map): unknown { - if (Array.isArray(value)) return value.map((item) => rewriteRefs(item, renames)) - if (typeof value !== "object" || value === null) return value - - return Object.fromEntries( - Object.entries(value).map(([key, child]) => { - if (key !== "$ref" || typeof child !== "string") return [key, rewriteRefs(child, renames)] - const prefix = "#/components/schemas/" - if (!child.startsWith(prefix)) return [key, child] - return [key, `${prefix}${renames.get(child.slice(prefix.length)) ?? child.slice(prefix.length)}`] - }), - ) -} - -function inlineTypedAllOfConstraints(value: unknown): void { - if (Array.isArray(value)) { - value.forEach(inlineTypedAllOfConstraints) - return - } - if (typeof value !== "object" || value === null) return - - const schema = value as { allOf?: unknown; type?: unknown; [key: string]: unknown } - if (typeof schema.type === "string" && Array.isArray(schema.allOf) && schema.allOf.every(isConstraintSchema)) { - for (const item of schema.allOf) Object.assign(schema, item) - delete schema.allOf - } - Object.values(schema).forEach(inlineTypedAllOfConstraints) -} - -function isConstraintSchema(value: unknown): value is Record { - if (typeof value !== "object" || value === null || Array.isArray(value)) return false - return !Object.keys(value).some( - (key) => key === "$ref" || key === "type" || key === "allOf" || key === "anyOf" || key === "oneOf", - ) -} diff --git a/packages/sdk/js/script/publish.ts b/packages/sdk/js/script/publish.ts deleted file mode 100755 index 29426a41b7..0000000000 --- a/packages/sdk/js/script/publish.ts +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/env bun - -import { Script } from "@opencode-ai/script" -import { $ } from "bun" -import { fileURLToPath } from "url" - -const dir = fileURLToPath(new URL("..", import.meta.url)) -process.chdir(dir) - -async function published(name: string, version: string) { - return (await $`npm view ${name}@${version} version`.nothrow()).exitCode === 0 -} - -const originalText = await Bun.file("package.json").text() -const pkg = JSON.parse(originalText) as { - name: string - version: string - exports: Record -} -function transformExports(exports: Record) { - return Object.fromEntries( - Object.entries(exports).map(([key, value]) => { - if (typeof value === "string") { - const file = value.replace("./src/", "./dist/").replace(".ts", "") - return [key, { import: file + ".js", types: file + ".d.ts" }] - } - if (typeof value === "object" && value !== null && !Array.isArray(value)) { - return [key, transformExports(value)] - } - return [key, value] - }), - ) -} -if (await published(pkg.name, pkg.version)) { - console.log(`already published ${pkg.name}@${pkg.version}`) -} else { - pkg.exports = transformExports(pkg.exports) - await Bun.write("package.json", JSON.stringify(pkg, null, 2)) - try { - await $`bun pm pack` - await $`npm publish *.tgz --tag ${Script.channel} --access public` - } finally { - await Bun.write("package.json", originalText) - } -} diff --git a/packages/sdk/js/src/client.ts b/packages/sdk/js/src/client.ts deleted file mode 100644 index 5cf071e7b7..0000000000 --- a/packages/sdk/js/src/client.ts +++ /dev/null @@ -1,57 +0,0 @@ -export * from "./gen/types.gen.js" - -import { createClient } from "./gen/client/client.gen.js" -import { type Config } from "./gen/client/types.gen.js" -import { OpencodeClient } from "./gen/sdk.gen.js" -import { wrapClientError } from "./error-interceptor.js" -export { type Config as OpencodeClientConfig, OpencodeClient } - -function pick(value: string | null, fallback?: string) { - if (!value) return - if (!fallback) return value - if (value === fallback) return fallback - if (value === encodeURIComponent(fallback)) return fallback - return value -} - -function rewrite(request: Request, directory?: string) { - if (request.method !== "GET" && request.method !== "HEAD") return request - - const value = pick(request.headers.get("x-opencode-directory"), directory) - if (!value) return request - - const url = new URL(request.url) - if (!url.searchParams.has("directory")) { - url.searchParams.set("directory", value) - } - - const next = new Request(url, request) - next.headers.delete("x-opencode-directory") - return next -} - -export function createOpencodeClient(config?: Config & { directory?: string }) { - if (!config?.fetch) { - const customFetch: any = (req: any) => { - // @ts-ignore - req.timeout = false - return fetch(req) - } - config = { - ...config, - fetch: customFetch, - } - } - - if (config?.directory) { - config.headers = { - ...config.headers, - "x-opencode-directory": encodeURIComponent(config.directory), - } - } - - const client = createClient(config) - client.interceptors.request.use((request) => rewrite(request, config?.directory)) - client.interceptors.error.use(wrapClientError) - return new OpencodeClient({ client }) -} diff --git a/packages/sdk/js/src/error-interceptor.ts b/packages/sdk/js/src/error-interceptor.ts deleted file mode 100644 index 26407ecfc9..0000000000 --- a/packages/sdk/js/src/error-interceptor.ts +++ /dev/null @@ -1,51 +0,0 @@ -/** - * Wrap whatever the generated client decoded from a non-2xx error body - * into a real `Error` so downstream formatters (TUI, plugins) get a - * useful `.message` instead of `[object Object]` or blank. The original - * parsed body and status live under `.cause` for callers that need - * structured fields. - * - * Only fires when the caller used `{ throwOnError: true }`. Callers that - * read `result.error` directly (the result-tuple path) get the parsed - * body unchanged so existing field-level reads (`.error.name`, - * `JSON.stringify(error)`, etc.) are byte-for-byte identical to before. - */ -export function wrapClientError( - error: unknown, - response: Response | undefined, - request: Request | undefined, - opts: { throwOnError?: boolean } | undefined, -): unknown { - if (!opts?.throwOnError) return error - if (error instanceof Error) return error - - // NamedError-shaped responses (the common case for opencode 4xx) come - // through as POJOs — extract a useful message first, then wrap. - if (typeof error === "object" && error !== null && Object.keys(error).length > 0) { - const obj = error as { data?: { message?: unknown }; message?: unknown; name?: unknown } - const message = - (typeof obj.data?.message === "string" && obj.data.message) || - (typeof obj.message === "string" && obj.message) || - (typeof obj.name === "string" && obj.name) || - describe(request, response) - return new Error(message, { cause: { body: error, status: response?.status } }) - } - - if (typeof error === "string" && error.length > 0) { - return new Error(error, { cause: { body: error, status: response?.status } }) - } - - // Empty body / network failure / undefined / null / empty object. - const reason = response ? "(empty response body)" : "network error (no response)" - return new Error(`opencode server ${describe(request, response)}: ${reason}`, { - cause: { body: error, status: response?.status }, - }) -} - -function describe(request: Request | undefined, response: Response | undefined) { - const method = request?.method ?? "?" - const url = request?.url ?? "?" - const status = response?.status - const statusText = response?.statusText - return `${method} ${url}${status ? " → " + status : ""}${statusText ? " " + statusText : ""}` -} diff --git a/packages/sdk/js/src/gen/client.gen.ts b/packages/sdk/js/src/gen/client.gen.ts deleted file mode 100644 index e7cdb292c6..0000000000 --- a/packages/sdk/js/src/gen/client.gen.ts +++ /dev/null @@ -1,22 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ClientOptions } from "./types.gen.js" -import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from "./client/index.js" - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = ( - override?: Config, -) => Config & T> - -export const client = createClient( - createConfig({ - baseUrl: "http://localhost:4096", - }), -) diff --git a/packages/sdk/js/src/gen/client/client.gen.ts b/packages/sdk/js/src/gen/client/client.gen.ts deleted file mode 100644 index 34a8d0bece..0000000000 --- a/packages/sdk/js/src/gen/client/client.gen.ts +++ /dev/null @@ -1,212 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { createSseClient } from "../core/serverSentEvents.gen.js" -import type { Client, Config, RequestOptions, ResolvedRequestOptions } from "./types.gen.js" -import { - buildUrl, - createConfig, - createInterceptors, - getParseAs, - mergeConfigs, - mergeHeaders, - setAuthParams, -} from "./utils.gen.js" - -type ReqInit = Omit & { - body?: any - headers: ReturnType -} - -export const createClient = (config: Config = {}): Client => { - let _config = mergeConfigs(createConfig(), config) - - const getConfig = (): Config => ({ ..._config }) - - const setConfig = (config: Config): Config => { - _config = mergeConfigs(_config, config) - return getConfig() - } - - const interceptors = createInterceptors() - - const beforeRequest = async (options: RequestOptions) => { - const opts = { - ..._config, - ...options, - fetch: options.fetch ?? _config.fetch ?? globalThis.fetch, - headers: mergeHeaders(_config.headers, options.headers), - serializedBody: undefined, - } - - if (opts.security) { - await setAuthParams({ - ...opts, - security: opts.security, - }) - } - - if (opts.requestValidator) { - await opts.requestValidator(opts) - } - - if (opts.body && opts.bodySerializer) { - opts.serializedBody = opts.bodySerializer(opts.body) - } - - // remove Content-Type header if body is empty to avoid sending invalid requests - if (opts.serializedBody === undefined || opts.serializedBody === "") { - opts.headers.delete("Content-Type") - } - - const url = buildUrl(opts) - - return { opts, url } - } - - const request: Client["request"] = async (options) => { - // @ts-expect-error - const { opts, url } = await beforeRequest(options) - const requestInit: ReqInit = { - redirect: "follow", - ...opts, - body: opts.serializedBody, - } - - let request = new Request(url, requestInit) - - for (const fn of interceptors.request._fns) { - if (fn) { - request = await fn(request, opts) - } - } - - // fetch must be assigned here, otherwise it would throw the error: - // TypeError: Failed to execute 'fetch' on 'Window': Illegal invocation - const _fetch = opts.fetch! - let response = await _fetch(request) - - for (const fn of interceptors.response._fns) { - if (fn) { - response = await fn(response, request, opts) - } - } - - const result = { - request, - response, - } - - if (response.ok) { - if (response.status === 204 || response.headers.get("Content-Length") === "0") { - return opts.responseStyle === "data" - ? {} - : { - data: {}, - ...result, - } - } - - const parseAs = - (opts.parseAs === "auto" ? getParseAs(response.headers.get("Content-Type")) : opts.parseAs) ?? "json" - - let data: any - switch (parseAs) { - case "arrayBuffer": - case "blob": - case "formData": - case "json": - case "text": - data = await response[parseAs]() - break - case "stream": - return opts.responseStyle === "data" - ? response.body - : { - data: response.body, - ...result, - } - } - - if (parseAs === "json") { - if (opts.responseValidator) { - await opts.responseValidator(data) - } - - if (opts.responseTransformer) { - data = await opts.responseTransformer(data) - } - } - - return opts.responseStyle === "data" - ? data - : { - data, - ...result, - } - } - - const textError = await response.text() - let jsonError: unknown - - try { - jsonError = JSON.parse(textError) - } catch { - // noop - } - - const error = jsonError ?? textError - let finalError = error - - for (const fn of interceptors.error._fns) { - if (fn) { - finalError = (await fn(error, response, request, opts)) as string - } - } - - finalError = finalError || ({} as string) - - if (opts.throwOnError) { - throw finalError - } - - // TODO: we probably want to return error and improve types - return opts.responseStyle === "data" - ? undefined - : { - error: finalError, - ...result, - } - } - - const makeMethod = (method: Required["method"]) => { - const fn = (options: RequestOptions) => request({ ...options, method }) - fn.sse = async (options: RequestOptions) => { - const { opts, url } = await beforeRequest(options) - return createSseClient({ - ...opts, - body: opts.body as BodyInit | null | undefined, - headers: opts.headers as unknown as Record, - method, - url, - }) - } - return fn - } - - return { - buildUrl, - connect: makeMethod("CONNECT"), - delete: makeMethod("DELETE"), - get: makeMethod("GET"), - getConfig, - head: makeMethod("HEAD"), - interceptors, - options: makeMethod("OPTIONS"), - patch: makeMethod("PATCH"), - post: makeMethod("POST"), - put: makeMethod("PUT"), - request, - setConfig, - trace: makeMethod("TRACE"), - } as Client -} diff --git a/packages/sdk/js/src/gen/client/index.ts b/packages/sdk/js/src/gen/client/index.ts deleted file mode 100644 index 06f21e3d80..0000000000 --- a/packages/sdk/js/src/gen/client/index.ts +++ /dev/null @@ -1,25 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type { Auth } from "../core/auth.gen.js" -export type { QuerySerializerOptions } from "../core/bodySerializer.gen.js" -export { - formDataBodySerializer, - jsonBodySerializer, - urlSearchParamsBodySerializer, -} from "../core/bodySerializer.gen.js" -export { buildClientParams } from "../core/params.gen.js" -export { createClient } from "./client.gen.js" -export type { - Client, - ClientOptions, - Config, - CreateClientConfig, - Options, - OptionsLegacyParser, - RequestOptions, - RequestResult, - ResolvedRequestOptions, - ResponseStyle, - TDataShape, -} from "./types.gen.js" -export { createConfig, mergeHeaders } from "./utils.gen.js" diff --git a/packages/sdk/js/src/gen/client/types.gen.ts b/packages/sdk/js/src/gen/client/types.gen.ts deleted file mode 100644 index db8e544cfd..0000000000 --- a/packages/sdk/js/src/gen/client/types.gen.ts +++ /dev/null @@ -1,222 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { Auth } from "../core/auth.gen.js" -import type { ServerSentEventsOptions, ServerSentEventsResult } from "../core/serverSentEvents.gen.js" -import type { Client as CoreClient, Config as CoreConfig } from "../core/types.gen.js" -import type { Middleware } from "./utils.gen.js" - -export type ResponseStyle = "data" | "fields" - -export interface Config - extends Omit, - CoreConfig { - /** - * Base URL for all requests made by this client. - */ - baseUrl?: T["baseUrl"] - /** - * Fetch API implementation. You can use this option to provide a custom - * fetch instance. - * - * @default globalThis.fetch - */ - fetch?: (request: Request) => ReturnType - /** - * Please don't use the Fetch client for Next.js applications. The `next` - * options won't have any effect. - * - * Install {@link https://www.npmjs.com/package/@hey-api/client-next `@hey-api/client-next`} instead. - */ - next?: never - /** - * Return the response data parsed in a specified format. By default, `auto` - * will infer the appropriate method from the `Content-Type` response header. - * You can override this behavior with any of the {@link Body} methods. - * Select `stream` if you don't want to parse response data at all. - * - * @default 'auto' - */ - parseAs?: "arrayBuffer" | "auto" | "blob" | "formData" | "json" | "stream" | "text" - /** - * Should we return only data or multiple fields (data, error, response, etc.)? - * - * @default 'fields' - */ - responseStyle?: ResponseStyle - /** - * Throw an error instead of returning it in the response? - * - * @default false - */ - throwOnError?: T["throwOnError"] -} - -export interface RequestOptions< - TData = unknown, - TResponseStyle extends ResponseStyle = "fields", - ThrowOnError extends boolean = boolean, - Url extends string = string, -> extends Config<{ - responseStyle: TResponseStyle - throwOnError: ThrowOnError - }>, - Pick< - ServerSentEventsOptions, - "onSseError" | "onSseEvent" | "sseDefaultRetryDelay" | "sseMaxRetryAttempts" | "sseMaxRetryDelay" - > { - /** - * Any body that you want to add to your request. - * - * {@link https://developer.mozilla.org/docs/Web/API/fetch#body} - */ - body?: unknown - path?: Record - query?: Record - /** - * Security mechanism(s) to use for the request. - */ - security?: ReadonlyArray - url: Url -} - -export interface ResolvedRequestOptions< - TResponseStyle extends ResponseStyle = "fields", - ThrowOnError extends boolean = boolean, - Url extends string = string, -> extends RequestOptions { - serializedBody?: string -} - -export type RequestResult< - TData = unknown, - TError = unknown, - ThrowOnError extends boolean = boolean, - TResponseStyle extends ResponseStyle = "fields", -> = ThrowOnError extends true - ? Promise< - TResponseStyle extends "data" - ? TData extends Record - ? TData[keyof TData] - : TData - : { - data: TData extends Record ? TData[keyof TData] : TData - request: Request - response: Response - } - > - : Promise< - TResponseStyle extends "data" - ? (TData extends Record ? TData[keyof TData] : TData) | undefined - : ( - | { - data: TData extends Record ? TData[keyof TData] : TData - error: undefined - } - | { - data: undefined - error: TError extends Record ? TError[keyof TError] : TError - } - ) & { - request: Request - response: Response - } - > - -export interface ClientOptions { - baseUrl?: string - responseStyle?: ResponseStyle - throwOnError?: boolean -} - -type MethodFnBase = < - TData = unknown, - TError = unknown, - ThrowOnError extends boolean = false, - TResponseStyle extends ResponseStyle = "fields", ->( - options: Omit, "method">, -) => RequestResult - -type MethodFnServerSentEvents = < - TData = unknown, - TError = unknown, - ThrowOnError extends boolean = false, - TResponseStyle extends ResponseStyle = "fields", ->( - options: Omit, "method">, -) => Promise> - -type MethodFn = MethodFnBase & { - sse: MethodFnServerSentEvents -} - -type RequestFn = < - TData = unknown, - TError = unknown, - ThrowOnError extends boolean = false, - TResponseStyle extends ResponseStyle = "fields", ->( - options: Omit, "method"> & - Pick>, "method">, -) => RequestResult - -type BuildUrlFn = < - TData extends { - body?: unknown - path?: Record - query?: Record - url: string - }, ->( - options: Pick & Options, -) => string - -export type Client = CoreClient & { - interceptors: Middleware -} - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = ( - override?: Config, -) => Config & T> - -export interface TDataShape { - body?: unknown - headers?: unknown - path?: unknown - query?: unknown - url: string -} - -type OmitKeys = Pick> - -export type Options< - TData extends TDataShape = TDataShape, - ThrowOnError extends boolean = boolean, - TResponse = unknown, - TResponseStyle extends ResponseStyle = "fields", -> = OmitKeys, "body" | "path" | "query" | "url"> & - Omit - -export type OptionsLegacyParser< - TData = unknown, - ThrowOnError extends boolean = boolean, - TResponseStyle extends ResponseStyle = "fields", -> = TData extends { body?: any } - ? TData extends { headers?: any } - ? OmitKeys, "body" | "headers" | "url"> & TData - : OmitKeys, "body" | "url"> & - TData & - Pick, "headers"> - : TData extends { headers?: any } - ? OmitKeys, "headers" | "url"> & - TData & - Pick, "body"> - : OmitKeys, "url"> & TData diff --git a/packages/sdk/js/src/gen/client/utils.gen.ts b/packages/sdk/js/src/gen/client/utils.gen.ts deleted file mode 100644 index 209bfbe8e6..0000000000 --- a/packages/sdk/js/src/gen/client/utils.gen.ts +++ /dev/null @@ -1,287 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { getAuthToken } from "../core/auth.gen.js" -import type { QuerySerializerOptions } from "../core/bodySerializer.gen.js" -import { jsonBodySerializer } from "../core/bodySerializer.gen.js" -import { serializeArrayParam, serializeObjectParam, serializePrimitiveParam } from "../core/pathSerializer.gen.js" -import { getUrl } from "../core/utils.gen.js" -import type { Client, ClientOptions, Config, RequestOptions } from "./types.gen.js" - -export const createQuerySerializer = ({ allowReserved, array, object }: QuerySerializerOptions = {}) => { - const querySerializer = (queryParams: T) => { - const search: string[] = [] - if (queryParams && typeof queryParams === "object") { - for (const name in queryParams) { - const value = queryParams[name] - - if (value === undefined || value === null) { - continue - } - - if (Array.isArray(value)) { - const serializedArray = serializeArrayParam({ - allowReserved, - explode: true, - name, - style: "form", - value, - ...array, - }) - if (serializedArray) search.push(serializedArray) - } else if (typeof value === "object") { - const serializedObject = serializeObjectParam({ - allowReserved, - explode: true, - name, - style: "deepObject", - value: value as Record, - ...object, - }) - if (serializedObject) search.push(serializedObject) - } else { - const serializedPrimitive = serializePrimitiveParam({ - allowReserved, - name, - value: value as string, - }) - if (serializedPrimitive) search.push(serializedPrimitive) - } - } - } - return search.join("&") - } - return querySerializer -} - -/** - * Infers parseAs value from provided Content-Type header. - */ -export const getParseAs = (contentType: string | null): Exclude => { - if (!contentType) { - // If no Content-Type header is provided, the best we can do is return the raw response body, - // which is effectively the same as the 'stream' option. - return "stream" - } - - const cleanContent = contentType.split(";")[0]?.trim() - - if (!cleanContent) { - return - } - - if (cleanContent.startsWith("application/json") || cleanContent.endsWith("+json")) { - return "json" - } - - if (cleanContent === "multipart/form-data") { - return "formData" - } - - if (["application/", "audio/", "image/", "video/"].some((type) => cleanContent.startsWith(type))) { - return "blob" - } - - if (cleanContent.startsWith("text/")) { - return "text" - } - - return -} - -const checkForExistence = ( - options: Pick & { - headers: Headers - }, - name?: string, -): boolean => { - if (!name) { - return false - } - if (options.headers.has(name) || options.query?.[name] || options.headers.get("Cookie")?.includes(`${name}=`)) { - return true - } - return false -} - -export const setAuthParams = async ({ - security, - ...options -}: Pick, "security"> & - Pick & { - headers: Headers - }) => { - for (const auth of security) { - if (checkForExistence(options, auth.name)) { - continue - } - - const token = await getAuthToken(auth, options.auth) - - if (!token) { - continue - } - - const name = auth.name ?? "Authorization" - - switch (auth.in) { - case "query": - if (!options.query) { - options.query = {} - } - options.query[name] = token - break - case "cookie": - options.headers.append("Cookie", `${name}=${token}`) - break - case "header": - default: - options.headers.set(name, token) - break - } - } -} - -export const buildUrl: Client["buildUrl"] = (options) => - getUrl({ - baseUrl: options.baseUrl as string, - path: options.path, - query: options.query, - querySerializer: - typeof options.querySerializer === "function" - ? options.querySerializer - : createQuerySerializer(options.querySerializer), - url: options.url, - }) - -export const mergeConfigs = (a: Config, b: Config): Config => { - const config = { ...a, ...b } - if (config.baseUrl?.endsWith("/")) { - config.baseUrl = config.baseUrl.substring(0, config.baseUrl.length - 1) - } - config.headers = mergeHeaders(a.headers, b.headers) - return config -} - -export const mergeHeaders = (...headers: Array["headers"] | undefined>): Headers => { - const mergedHeaders = new Headers() - for (const header of headers) { - if (!header || typeof header !== "object") { - continue - } - - const iterator = header instanceof Headers ? header.entries() : Object.entries(header) - - for (const [key, value] of iterator) { - if (value === null) { - mergedHeaders.delete(key) - } else if (Array.isArray(value)) { - for (const v of value) { - mergedHeaders.append(key, v as string) - } - } else if (value !== undefined) { - // assume object headers are meant to be JSON stringified, i.e. their - // content value in OpenAPI specification is 'application/json' - mergedHeaders.set(key, typeof value === "object" ? JSON.stringify(value) : (value as string)) - } - } - } - return mergedHeaders -} - -type ErrInterceptor = ( - error: Err, - response: Res, - request: Req, - options: Options, -) => Err | Promise - -type ReqInterceptor = (request: Req, options: Options) => Req | Promise - -type ResInterceptor = (response: Res, request: Req, options: Options) => Res | Promise - -class Interceptors { - _fns: (Interceptor | null)[] - - constructor() { - this._fns = [] - } - - clear() { - this._fns = [] - } - - getInterceptorIndex(id: number | Interceptor): number { - if (typeof id === "number") { - return this._fns[id] ? id : -1 - } else { - return this._fns.indexOf(id) - } - } - exists(id: number | Interceptor) { - const index = this.getInterceptorIndex(id) - return !!this._fns[index] - } - - eject(id: number | Interceptor) { - const index = this.getInterceptorIndex(id) - if (this._fns[index]) { - this._fns[index] = null - } - } - - update(id: number | Interceptor, fn: Interceptor) { - const index = this.getInterceptorIndex(id) - if (this._fns[index]) { - this._fns[index] = fn - return id - } else { - return false - } - } - - use(fn: Interceptor) { - this._fns = [...this._fns, fn] - return this._fns.length - 1 - } -} - -// `createInterceptors()` response, meant for external use as it does not -// expose internals -export interface Middleware { - error: Pick>, "eject" | "use"> - request: Pick>, "eject" | "use"> - response: Pick>, "eject" | "use"> -} - -// do not add `Middleware` as return type so we can use _fns internally -export const createInterceptors = () => ({ - error: new Interceptors>(), - request: new Interceptors>(), - response: new Interceptors>(), -}) - -const defaultQuerySerializer = createQuerySerializer({ - allowReserved: false, - array: { - explode: true, - style: "form", - }, - object: { - explode: true, - style: "deepObject", - }, -}) - -const defaultHeaders = { - "Content-Type": "application/json", -} - -export const createConfig = ( - override: Config & T> = {}, -): Config & T> => ({ - ...jsonBodySerializer, - headers: defaultHeaders, - parseAs: "auto", - querySerializer: defaultQuerySerializer, - ...override, -}) diff --git a/packages/sdk/js/src/gen/core/auth.gen.ts b/packages/sdk/js/src/gen/core/auth.gen.ts deleted file mode 100644 index bc7b230f44..0000000000 --- a/packages/sdk/js/src/gen/core/auth.gen.ts +++ /dev/null @@ -1,41 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type AuthToken = string | undefined - -export interface Auth { - /** - * Which part of the request do we use to send the auth? - * - * @default 'header' - */ - in?: "header" | "query" | "cookie" - /** - * Header or query parameter name. - * - * @default 'Authorization' - */ - name?: string - scheme?: "basic" | "bearer" - type: "apiKey" | "http" -} - -export const getAuthToken = async ( - auth: Auth, - callback: ((auth: Auth) => Promise | AuthToken) | AuthToken, -): Promise => { - const token = typeof callback === "function" ? await callback(auth) : callback - - if (!token) { - return - } - - if (auth.scheme === "bearer") { - return `Bearer ${token}` - } - - if (auth.scheme === "basic") { - return `Basic ${btoa(token)}` - } - - return token -} diff --git a/packages/sdk/js/src/gen/core/bodySerializer.gen.ts b/packages/sdk/js/src/gen/core/bodySerializer.gen.ts deleted file mode 100644 index 0660616052..0000000000 --- a/packages/sdk/js/src/gen/core/bodySerializer.gen.ts +++ /dev/null @@ -1,74 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ArrayStyle, ObjectStyle, SerializerOptions } from "./pathSerializer.gen.js" - -export type QuerySerializer = (query: Record) => string - -export type BodySerializer = (body: any) => any - -export interface QuerySerializerOptions { - allowReserved?: boolean - array?: SerializerOptions - object?: SerializerOptions -} - -const serializeFormDataPair = (data: FormData, key: string, value: unknown): void => { - if (typeof value === "string" || value instanceof Blob) { - data.append(key, value) - } else if (value instanceof Date) { - data.append(key, value.toISOString()) - } else { - data.append(key, JSON.stringify(value)) - } -} - -const serializeUrlSearchParamsPair = (data: URLSearchParams, key: string, value: unknown): void => { - if (typeof value === "string") { - data.append(key, value) - } else { - data.append(key, JSON.stringify(value)) - } -} - -export const formDataBodySerializer = { - bodySerializer: | Array>>(body: T): FormData => { - const data = new FormData() - - Object.entries(body).forEach(([key, value]) => { - if (value === undefined || value === null) { - return - } - if (Array.isArray(value)) { - value.forEach((v) => serializeFormDataPair(data, key, v)) - } else { - serializeFormDataPair(data, key, value) - } - }) - - return data - }, -} - -export const jsonBodySerializer = { - bodySerializer: (body: T): string => - JSON.stringify(body, (_key, value) => (typeof value === "bigint" ? value.toString() : value)), -} - -export const urlSearchParamsBodySerializer = { - bodySerializer: | Array>>(body: T): string => { - const data = new URLSearchParams() - - Object.entries(body).forEach(([key, value]) => { - if (value === undefined || value === null) { - return - } - if (Array.isArray(value)) { - value.forEach((v) => serializeUrlSearchParamsPair(data, key, v)) - } else { - serializeUrlSearchParamsPair(data, key, value) - } - }) - - return data.toString() - }, -} diff --git a/packages/sdk/js/src/gen/core/params.gen.ts b/packages/sdk/js/src/gen/core/params.gen.ts deleted file mode 100644 index 68ad1a778e..0000000000 --- a/packages/sdk/js/src/gen/core/params.gen.ts +++ /dev/null @@ -1,144 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -type Slot = "body" | "headers" | "path" | "query" - -export type Field = - | { - in: Exclude - /** - * Field name. This is the name we want the user to see and use. - */ - key: string - /** - * Field mapped name. This is the name we want to use in the request. - * If omitted, we use the same value as `key`. - */ - map?: string - } - | { - in: Extract - /** - * Key isn't required for bodies. - */ - key?: string - map?: string - } - -export interface Fields { - allowExtra?: Partial> - args?: ReadonlyArray -} - -export type FieldsConfig = ReadonlyArray - -const extraPrefixesMap: Record = { - $body_: "body", - $headers_: "headers", - $path_: "path", - $query_: "query", -} -const extraPrefixes = Object.entries(extraPrefixesMap) - -type KeyMap = Map< - string, - { - in: Slot - map?: string - } -> - -const buildKeyMap = (fields: FieldsConfig, map?: KeyMap): KeyMap => { - if (!map) { - map = new Map() - } - - for (const config of fields) { - if ("in" in config) { - if (config.key) { - map.set(config.key, { - in: config.in, - map: config.map, - }) - } - } else if (config.args) { - buildKeyMap(config.args, map) - } - } - - return map -} - -interface Params { - body: unknown - headers: Record - path: Record - query: Record -} - -const stripEmptySlots = (params: Params) => { - for (const [slot, value] of Object.entries(params)) { - if (value && typeof value === "object" && !Object.keys(value).length) { - delete params[slot as Slot] - } - } -} - -export const buildClientParams = (args: ReadonlyArray, fields: FieldsConfig) => { - const params: Params = { - body: {}, - headers: {}, - path: {}, - query: {}, - } - - const map = buildKeyMap(fields) - - let config: FieldsConfig[number] | undefined - - for (const [index, arg] of args.entries()) { - if (fields[index]) { - config = fields[index] - } - - if (!config) { - continue - } - - if ("in" in config) { - if (config.key) { - const field = map.get(config.key)! - const name = field.map || config.key - ;(params[field.in] as Record)[name] = arg - } else { - params.body = arg - } - } else { - for (const [key, value] of Object.entries(arg ?? {})) { - const field = map.get(key) - - if (field) { - const name = field.map || key - ;(params[field.in] as Record)[name] = value - } else { - const extra = extraPrefixes.find(([prefix]) => key.startsWith(prefix)) - - if (extra) { - const [prefix, slot] = extra - ;(params[slot] as Record)[key.slice(prefix.length)] = value - } else { - for (const [slot, allowed] of Object.entries(config.allowExtra ?? {})) { - if (allowed) { - ;(params[slot as Slot] as Record)[key] = value - break - } - } - } - } - } - } - } - - stripEmptySlots(params) - - return params -} diff --git a/packages/sdk/js/src/gen/core/pathSerializer.gen.ts b/packages/sdk/js/src/gen/core/pathSerializer.gen.ts deleted file mode 100644 index 96be3bc5a3..0000000000 --- a/packages/sdk/js/src/gen/core/pathSerializer.gen.ts +++ /dev/null @@ -1,167 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -interface SerializeOptions extends SerializePrimitiveOptions, SerializerOptions {} - -interface SerializePrimitiveOptions { - allowReserved?: boolean - name: string -} - -export interface SerializerOptions { - /** - * @default true - */ - explode: boolean - style: T -} - -export type ArrayStyle = "form" | "spaceDelimited" | "pipeDelimited" -export type ArraySeparatorStyle = ArrayStyle | MatrixStyle -type MatrixStyle = "label" | "matrix" | "simple" -export type ObjectStyle = "form" | "deepObject" -type ObjectSeparatorStyle = ObjectStyle | MatrixStyle - -interface SerializePrimitiveParam extends SerializePrimitiveOptions { - value: string -} - -export const separatorArrayExplode = (style: ArraySeparatorStyle) => { - switch (style) { - case "label": - return "." - case "matrix": - return ";" - case "simple": - return "," - default: - return "&" - } -} - -export const separatorArrayNoExplode = (style: ArraySeparatorStyle) => { - switch (style) { - case "form": - return "," - case "pipeDelimited": - return "|" - case "spaceDelimited": - return "%20" - default: - return "," - } -} - -export const separatorObjectExplode = (style: ObjectSeparatorStyle) => { - switch (style) { - case "label": - return "." - case "matrix": - return ";" - case "simple": - return "," - default: - return "&" - } -} - -export const serializeArrayParam = ({ - allowReserved, - explode, - name, - style, - value, -}: SerializeOptions & { - value: unknown[] -}) => { - if (!explode) { - const joinedValues = (allowReserved ? value : value.map((v) => encodeURIComponent(v as string))).join( - separatorArrayNoExplode(style), - ) - switch (style) { - case "label": - return `.${joinedValues}` - case "matrix": - return `;${name}=${joinedValues}` - case "simple": - return joinedValues - default: - return `${name}=${joinedValues}` - } - } - - const separator = separatorArrayExplode(style) - const joinedValues = value - .map((v) => { - if (style === "label" || style === "simple") { - return allowReserved ? v : encodeURIComponent(v as string) - } - - return serializePrimitiveParam({ - allowReserved, - name, - value: v as string, - }) - }) - .join(separator) - return style === "label" || style === "matrix" ? separator + joinedValues : joinedValues -} - -export const serializePrimitiveParam = ({ allowReserved, name, value }: SerializePrimitiveParam) => { - if (value === undefined || value === null) { - return "" - } - - if (typeof value === "object") { - throw new Error( - "Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.", - ) - } - - return `${name}=${allowReserved ? value : encodeURIComponent(value)}` -} - -export const serializeObjectParam = ({ - allowReserved, - explode, - name, - style, - value, - valueOnly, -}: SerializeOptions & { - value: Record | Date - valueOnly?: boolean -}) => { - if (value instanceof Date) { - return valueOnly ? value.toISOString() : `${name}=${value.toISOString()}` - } - - if (style !== "deepObject" && !explode) { - let values: string[] = [] - Object.entries(value).forEach(([key, v]) => { - values = [...values, key, allowReserved ? (v as string) : encodeURIComponent(v as string)] - }) - const joinedValues = values.join(",") - switch (style) { - case "form": - return `${name}=${joinedValues}` - case "label": - return `.${joinedValues}` - case "matrix": - return `;${name}=${joinedValues}` - default: - return joinedValues - } - } - - const separator = separatorObjectExplode(style) - const joinedValues = Object.entries(value) - .map(([key, v]) => - serializePrimitiveParam({ - allowReserved, - name: style === "deepObject" ? `${name}[${key}]` : key, - value: v as string, - }), - ) - .join(separator) - return style === "label" || style === "matrix" ? separator + joinedValues : joinedValues -} diff --git a/packages/sdk/js/src/gen/core/queryKeySerializer.gen.ts b/packages/sdk/js/src/gen/core/queryKeySerializer.gen.ts deleted file mode 100644 index 320204aef1..0000000000 --- a/packages/sdk/js/src/gen/core/queryKeySerializer.gen.ts +++ /dev/null @@ -1,111 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * JSON-friendly union that mirrors what Pinia Colada can hash. - */ -export type JsonValue = null | string | number | boolean | JsonValue[] | { [key: string]: JsonValue } - -/** - * Replacer that converts non-JSON values (bigint, Date, etc.) to safe substitutes. - */ -export const queryKeyJsonReplacer = (_key: string, value: unknown) => { - if (value === undefined || typeof value === "function" || typeof value === "symbol") { - return undefined - } - if (typeof value === "bigint") { - return value.toString() - } - if (value instanceof Date) { - return value.toISOString() - } - return value -} - -/** - * Safely stringifies a value and parses it back into a JsonValue. - */ -export const stringifyToJsonValue = (input: unknown): JsonValue | undefined => { - try { - const json = JSON.stringify(input, queryKeyJsonReplacer) - if (json === undefined) { - return undefined - } - return JSON.parse(json) as JsonValue - } catch { - return undefined - } -} - -/** - * Detects plain objects (including objects with a null prototype). - */ -const isPlainObject = (value: unknown): value is Record => { - if (value === null || typeof value !== "object") { - return false - } - const prototype = Object.getPrototypeOf(value as object) - return prototype === Object.prototype || prototype === null -} - -/** - * Turns URLSearchParams into a sorted JSON object for deterministic keys. - */ -const serializeSearchParams = (params: URLSearchParams): JsonValue => { - const entries = Array.from(params.entries()).sort(([a], [b]) => a.localeCompare(b)) - const result: Record = {} - - for (const [key, value] of entries) { - const existing = result[key] - if (existing === undefined) { - result[key] = value - continue - } - - if (Array.isArray(existing)) { - ;(existing as string[]).push(value) - } else { - result[key] = [existing, value] - } - } - - return result -} - -/** - * Normalizes any accepted value into a JSON-friendly shape for query keys. - */ -export const serializeQueryKeyValue = (value: unknown): JsonValue | undefined => { - if (value === null) { - return null - } - - if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") { - return value - } - - if (value === undefined || typeof value === "function" || typeof value === "symbol") { - return undefined - } - - if (typeof value === "bigint") { - return value.toString() - } - - if (value instanceof Date) { - return value.toISOString() - } - - if (Array.isArray(value)) { - return stringifyToJsonValue(value) - } - - if (typeof URLSearchParams !== "undefined" && value instanceof URLSearchParams) { - return serializeSearchParams(value) - } - - if (isPlainObject(value)) { - return stringifyToJsonValue(value) - } - - return undefined -} diff --git a/packages/sdk/js/src/gen/core/serverSentEvents.gen.ts b/packages/sdk/js/src/gen/core/serverSentEvents.gen.ts deleted file mode 100644 index ffc4f16dc1..0000000000 --- a/packages/sdk/js/src/gen/core/serverSentEvents.gen.ts +++ /dev/null @@ -1,210 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { Config } from "./types.gen.js" - -export type ServerSentEventsOptions = Omit & - Pick & { - /** - * Callback invoked when a network or parsing error occurs during streaming. - * - * This option applies only if the endpoint returns a stream of events. - * - * @param error The error that occurred. - */ - onSseError?: (error: unknown) => void - /** - * Callback invoked when an event is streamed from the server. - * - * This option applies only if the endpoint returns a stream of events. - * - * @param event Event streamed from the server. - * @returns Nothing (void). - */ - onSseEvent?: (event: StreamEvent) => void - /** - * Default retry delay in milliseconds. - * - * This option applies only if the endpoint returns a stream of events. - * - * @default 3000 - */ - sseDefaultRetryDelay?: number - /** - * Maximum number of retry attempts before giving up. - */ - sseMaxRetryAttempts?: number - /** - * Maximum retry delay in milliseconds. - * - * Applies only when exponential backoff is used. - * - * This option applies only if the endpoint returns a stream of events. - * - * @default 30000 - */ - sseMaxRetryDelay?: number - /** - * Optional sleep function for retry backoff. - * - * Defaults to using `setTimeout`. - */ - sseSleepFn?: (ms: number) => Promise - url: string - } - -export interface StreamEvent { - data: TData - event?: string - id?: string - retry?: number -} - -export type ServerSentEventsResult = { - stream: AsyncGenerator ? TData[keyof TData] : TData, TReturn, TNext> -} - -export const createSseClient = ({ - onSseError, - onSseEvent, - responseTransformer, - responseValidator, - sseDefaultRetryDelay, - sseMaxRetryAttempts, - sseMaxRetryDelay, - sseSleepFn, - url, - ...options -}: ServerSentEventsOptions): ServerSentEventsResult => { - let lastEventId: string | undefined - - const sleep = sseSleepFn ?? ((ms: number) => new Promise((resolve) => setTimeout(resolve, ms))) - - const createStream = async function* () { - let retryDelay: number = sseDefaultRetryDelay ?? 3000 - let attempt = 0 - const signal = options.signal ?? new AbortController().signal - - while (true) { - if (signal.aborted) break - - attempt++ - - const headers = - options.headers instanceof Headers - ? options.headers - : new Headers(options.headers as Record | undefined) - - if (lastEventId !== undefined) { - headers.set("Last-Event-ID", lastEventId) - } - - try { - const response = await fetch(url, { ...options, headers, signal }) - - if (!response.ok) throw new Error(`SSE failed: ${response.status} ${response.statusText}`) - - if (!response.body) throw new Error("No body in SSE response") - - const reader = response.body.pipeThrough(new TextDecoderStream()).getReader() - - let buffer = "" - - const abortHandler = () => { - try { - void reader.cancel() - } catch { - // noop - } - } - - signal.addEventListener("abort", abortHandler) - - try { - while (true) { - const { done, value } = await reader.read() - if (done) break - buffer += value - - const chunks = buffer.split("\n\n") - buffer = chunks.pop() ?? "" - - for (const chunk of chunks) { - const lines = chunk.split("\n") - const dataLines: Array = [] - let eventName: string | undefined - - for (const line of lines) { - if (line.startsWith("data:")) { - dataLines.push(line.replace(/^data:\s*/, "")) - } else if (line.startsWith("event:")) { - eventName = line.replace(/^event:\s*/, "") - } else if (line.startsWith("id:")) { - lastEventId = line.replace(/^id:\s*/, "") - } else if (line.startsWith("retry:")) { - const parsed = Number.parseInt(line.replace(/^retry:\s*/, ""), 10) - if (!Number.isNaN(parsed)) { - retryDelay = parsed - } - } - } - - let data: unknown - let parsedJson = false - - if (dataLines.length) { - const rawData = dataLines.join("\n") - try { - data = JSON.parse(rawData) - parsedJson = true - } catch { - data = rawData - } - } - - if (parsedJson) { - if (responseValidator) { - await responseValidator(data) - } - - if (responseTransformer) { - data = await responseTransformer(data) - } - } - - onSseEvent?.({ - data, - event: eventName, - id: lastEventId, - retry: retryDelay, - }) - - if (dataLines.length) { - yield data as any - } - } - } - } finally { - signal.removeEventListener("abort", abortHandler) - reader.releaseLock() - } - - break // exit loop on normal completion - } catch (error) { - // connection failed or aborted; retry after delay - onSseError?.(error) - - if (sseMaxRetryAttempts !== undefined && attempt >= sseMaxRetryAttempts) { - break // stop after firing error - } - - // exponential backoff: double retry each attempt, cap at 30s - const backoff = Math.min(retryDelay * 2 ** (attempt - 1), sseMaxRetryDelay ?? 30000) - await sleep(backoff) - } - } - } - - const stream = createStream() - - return { stream } -} diff --git a/packages/sdk/js/src/gen/core/types.gen.ts b/packages/sdk/js/src/gen/core/types.gen.ts deleted file mode 100644 index 16408b2d09..0000000000 --- a/packages/sdk/js/src/gen/core/types.gen.ts +++ /dev/null @@ -1,91 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { Auth, AuthToken } from "./auth.gen.js" -import type { BodySerializer, QuerySerializer, QuerySerializerOptions } from "./bodySerializer.gen.js" - -export interface Client { - /** - * Returns the final request URL. - */ - buildUrl: BuildUrlFn - connect: MethodFn - delete: MethodFn - get: MethodFn - getConfig: () => Config - head: MethodFn - options: MethodFn - patch: MethodFn - post: MethodFn - put: MethodFn - request: RequestFn - setConfig: (config: Config) => Config - trace: MethodFn -} - -export interface Config { - /** - * Auth token or a function returning auth token. The resolved value will be - * added to the request payload as defined by its `security` array. - */ - auth?: ((auth: Auth) => Promise | AuthToken) | AuthToken - /** - * A function for serializing request body parameter. By default, - * {@link JSON.stringify()} will be used. - */ - bodySerializer?: BodySerializer | null - /** - * An object containing any HTTP headers that you want to pre-populate your - * `Headers` object with. - * - * {@link https://developer.mozilla.org/docs/Web/API/Headers/Headers#init See more} - */ - headers?: - | RequestInit["headers"] - | Record - /** - * The request method. - * - * {@link https://developer.mozilla.org/docs/Web/API/fetch#method See more} - */ - method?: "CONNECT" | "DELETE" | "GET" | "HEAD" | "OPTIONS" | "PATCH" | "POST" | "PUT" | "TRACE" - /** - * A function for serializing request query parameters. By default, arrays - * will be exploded in form style, objects will be exploded in deepObject - * style, and reserved characters are percent-encoded. - * - * This method will have no effect if the native `paramsSerializer()` Axios - * API function is used. - * - * {@link https://swagger.io/docs/specification/serialization/#query View examples} - */ - querySerializer?: QuerySerializer | QuerySerializerOptions - /** - * A function validating request data. This is useful if you want to ensure - * the request conforms to the desired shape, so it can be safely sent to - * the server. - */ - requestValidator?: (data: unknown) => Promise - /** - * A function transforming response data before it's returned. This is useful - * for post-processing data, e.g. converting ISO strings into Date objects. - */ - responseTransformer?: (data: unknown) => Promise - /** - * A function validating response data. This is useful if you want to ensure - * the response conforms to the desired shape, so it can be safely passed to - * the transformers and returned to the user. - */ - responseValidator?: (data: unknown) => Promise -} - -type IsExactlyNeverOrNeverUndefined = [T] extends [never] - ? true - : [T] extends [never | undefined] - ? [undefined] extends [T] - ? false - : true - : false - -export type OmitNever> = { - [K in keyof T as IsExactlyNeverOrNeverUndefined extends true ? never : K]: T[K] -} diff --git a/packages/sdk/js/src/gen/core/utils.gen.ts b/packages/sdk/js/src/gen/core/utils.gen.ts deleted file mode 100644 index be18c608a5..0000000000 --- a/packages/sdk/js/src/gen/core/utils.gen.ts +++ /dev/null @@ -1,109 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { QuerySerializer } from "./bodySerializer.gen.js" -import { - type ArraySeparatorStyle, - serializeArrayParam, - serializeObjectParam, - serializePrimitiveParam, -} from "./pathSerializer.gen.js" - -export interface PathSerializer { - path: Record - url: string -} - -export const PATH_PARAM_RE = /\{[^{}]+\}/g - -export const defaultPathSerializer = ({ path, url: _url }: PathSerializer) => { - let url = _url - const matches = _url.match(PATH_PARAM_RE) - if (matches) { - for (const match of matches) { - let explode = false - let name = match.substring(1, match.length - 1) - let style: ArraySeparatorStyle = "simple" - - if (name.endsWith("*")) { - explode = true - name = name.substring(0, name.length - 1) - } - - if (name.startsWith(".")) { - name = name.substring(1) - style = "label" - } else if (name.startsWith(";")) { - name = name.substring(1) - style = "matrix" - } - - const value = path[name] - - if (value === undefined || value === null) { - continue - } - - if (Array.isArray(value)) { - url = url.replace(match, serializeArrayParam({ explode, name, style, value })) - continue - } - - if (typeof value === "object") { - url = url.replace( - match, - serializeObjectParam({ - explode, - name, - style, - value: value as Record, - valueOnly: true, - }), - ) - continue - } - - if (style === "matrix") { - url = url.replace( - match, - `;${serializePrimitiveParam({ - name, - value: value as string, - })}`, - ) - continue - } - - const replaceValue = encodeURIComponent(style === "label" ? `.${value as string}` : (value as string)) - url = url.replace(match, replaceValue) - } - } - return url -} - -export const getUrl = ({ - baseUrl, - path, - query, - querySerializer, - url: _url, -}: { - baseUrl?: string - path?: Record - query?: Record - querySerializer: QuerySerializer - url: string -}) => { - const pathUrl = _url.startsWith("/") ? _url : `/${_url}` - let url = (baseUrl ?? "") + pathUrl - if (path) { - url = defaultPathSerializer({ path, url }) - } - let search = query ? querySerializer(query) : "" - if (search.startsWith("?")) { - search = search.substring(1) - } - if (search) { - url += `?${search}` - } - return url -} diff --git a/packages/sdk/js/src/gen/sdk.gen.ts b/packages/sdk/js/src/gen/sdk.gen.ts deleted file mode 100644 index 4b5d9284c6..0000000000 --- a/packages/sdk/js/src/gen/sdk.gen.ts +++ /dev/null @@ -1,1184 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { Options as ClientOptions, TDataShape, Client } from "./client/index.js" -import type { - GlobalEventData, - GlobalEventResponses, - ProjectListData, - ProjectListResponses, - ProjectCurrentData, - ProjectCurrentResponses, - PtyListData, - PtyListResponses, - PtyCreateData, - PtyCreateResponses, - PtyCreateErrors, - PtyRemoveData, - PtyRemoveResponses, - PtyRemoveErrors, - PtyGetData, - PtyGetResponses, - PtyGetErrors, - PtyUpdateData, - PtyUpdateResponses, - PtyUpdateErrors, - PtyConnectData, - PtyConnectResponses, - PtyConnectErrors, - ConfigGetData, - ConfigGetResponses, - ConfigUpdateData, - ConfigUpdateResponses, - ConfigUpdateErrors, - ToolIdsData, - ToolIdsResponses, - ToolIdsErrors, - ToolListData, - ToolListResponses, - ToolListErrors, - InstanceDisposeData, - InstanceDisposeResponses, - PathGetData, - PathGetResponses, - VcsGetData, - VcsGetResponses, - SessionListData, - SessionListResponses, - SessionCreateData, - SessionCreateResponses, - SessionCreateErrors, - SessionStatusData, - SessionStatusResponses, - SessionStatusErrors, - SessionDeleteData, - SessionDeleteResponses, - SessionDeleteErrors, - SessionGetData, - SessionGetResponses, - SessionGetErrors, - SessionUpdateData, - SessionUpdateResponses, - SessionUpdateErrors, - SessionChildrenData, - SessionChildrenResponses, - SessionChildrenErrors, - SessionInitData, - SessionInitResponses, - SessionInitErrors, - SessionForkData, - SessionForkResponses, - SessionAbortData, - SessionAbortResponses, - SessionAbortErrors, - SessionUnshareData, - SessionUnshareResponses, - SessionUnshareErrors, - SessionShareData, - SessionShareResponses, - SessionShareErrors, - SessionDiffData, - SessionDiffResponses, - SessionDiffErrors, - SessionSummarizeData, - SessionSummarizeResponses, - SessionSummarizeErrors, - SessionMessagesData, - SessionMessagesResponses, - SessionMessagesErrors, - SessionPromptData, - SessionPromptResponses, - SessionPromptErrors, - SessionMessageData, - SessionMessageResponses, - SessionMessageErrors, - SessionPromptAsyncData, - SessionPromptAsyncResponses, - SessionPromptAsyncErrors, - SessionCommandData, - SessionCommandResponses, - SessionCommandErrors, - SessionShellData, - SessionShellResponses, - SessionShellErrors, - SessionRevertData, - SessionRevertResponses, - SessionRevertErrors, - SessionUnrevertData, - SessionUnrevertResponses, - SessionUnrevertErrors, - PostSessionIdPermissionsPermissionIdData, - PostSessionIdPermissionsPermissionIdResponses, - PostSessionIdPermissionsPermissionIdErrors, - CommandListData, - CommandListResponses, - ConfigProvidersData, - ConfigProvidersResponses, - ProviderListData, - ProviderListResponses, - ProviderAuthData, - ProviderAuthResponses, - ProviderOauthAuthorizeData, - ProviderOauthAuthorizeResponses, - ProviderOauthAuthorizeErrors, - ProviderOauthCallbackData, - ProviderOauthCallbackResponses, - ProviderOauthCallbackErrors, - FindTextData, - FindTextResponses, - FindFilesData, - FindFilesResponses, - FindSymbolsData, - FindSymbolsResponses, - FileListData, - FileListResponses, - FileReadData, - FileReadResponses, - FileStatusData, - FileStatusResponses, - AppLogData, - AppLogResponses, - AppLogErrors, - AppAgentsData, - AppAgentsResponses, - McpStatusData, - McpStatusResponses, - McpAddData, - McpAddResponses, - McpAddErrors, - McpAuthRemoveData, - McpAuthRemoveResponses, - McpAuthRemoveErrors, - McpAuthStartData, - McpAuthStartResponses, - McpAuthStartErrors, - McpAuthCallbackData, - McpAuthCallbackResponses, - McpAuthCallbackErrors, - McpAuthAuthenticateData, - McpAuthAuthenticateResponses, - McpAuthAuthenticateErrors, - McpConnectData, - McpConnectResponses, - McpDisconnectData, - McpDisconnectResponses, - LspStatusData, - LspStatusResponses, - FormatterStatusData, - FormatterStatusResponses, - TuiAppendPromptData, - TuiAppendPromptResponses, - TuiAppendPromptErrors, - TuiOpenHelpData, - TuiOpenHelpResponses, - TuiOpenSessionsData, - TuiOpenSessionsResponses, - TuiOpenThemesData, - TuiOpenThemesResponses, - TuiOpenModelsData, - TuiOpenModelsResponses, - TuiSubmitPromptData, - TuiSubmitPromptResponses, - TuiClearPromptData, - TuiClearPromptResponses, - TuiExecuteCommandData, - TuiExecuteCommandResponses, - TuiExecuteCommandErrors, - TuiShowToastData, - TuiShowToastResponses, - TuiPublishData, - TuiPublishResponses, - TuiPublishErrors, - TuiControlNextData, - TuiControlNextResponses, - TuiControlResponseData, - TuiControlResponseResponses, - AuthSetData, - AuthSetResponses, - AuthSetErrors, - EventSubscribeData, - EventSubscribeResponses, -} from "./types.gen.js" -import { client as _heyApiClient } from "./client.gen.js" - -export type Options = ClientOptions< - TData, - ThrowOnError -> & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record -} - -class _HeyApiClient { - protected _client: Client = _heyApiClient - - constructor(args?: { client?: Client }) { - if (args?.client) { - this._client = args.client - } - } -} - -class Global extends _HeyApiClient { - /** - * Get events - */ - public event(options?: Options) { - return (options?.client ?? this._client).get.sse({ - url: "/global/event", - ...options, - }) - } -} - -class Project extends _HeyApiClient { - /** - * List all projects - */ - public list(options?: Options) { - return (options?.client ?? this._client).get({ - url: "/project", - ...options, - }) - } - - /** - * Get the current project - */ - public current(options?: Options) { - return (options?.client ?? this._client).get({ - url: "/project/current", - ...options, - }) - } -} - -class Pty extends _HeyApiClient { - /** - * List all PTY sessions - */ - public list(options?: Options) { - return (options?.client ?? this._client).get({ - url: "/pty", - ...options, - }) - } - - /** - * Create a new PTY session - */ - public create(options?: Options) { - return (options?.client ?? this._client).post({ - url: "/pty", - ...options, - headers: { - "Content-Type": "application/json", - ...options?.headers, - }, - }) - } - - /** - * Remove a PTY session - */ - public remove(options: Options) { - return (options.client ?? this._client).delete({ - url: "/pty/{id}", - ...options, - }) - } - - /** - * Get PTY session info - */ - public get(options: Options) { - return (options.client ?? this._client).get({ - url: "/pty/{id}", - ...options, - }) - } - - /** - * Update PTY session - */ - public update(options: Options) { - return (options.client ?? this._client).put({ - url: "/pty/{id}", - ...options, - headers: { - "Content-Type": "application/json", - ...options.headers, - }, - }) - } - - /** - * Connect to a PTY session - */ - public connect(options: Options) { - return (options.client ?? this._client).get({ - url: "/pty/{id}/connect", - ...options, - }) - } -} - -class Config extends _HeyApiClient { - /** - * Get config info - */ - public get(options?: Options) { - return (options?.client ?? this._client).get({ - url: "/config", - ...options, - }) - } - - /** - * Update config - */ - public update(options?: Options) { - return (options?.client ?? this._client).patch({ - url: "/config", - ...options, - headers: { - "Content-Type": "application/json", - ...options?.headers, - }, - }) - } - - /** - * List all providers - */ - public providers(options?: Options) { - return (options?.client ?? this._client).get({ - url: "/config/providers", - ...options, - }) - } -} - -class Tool extends _HeyApiClient { - /** - * List all tool IDs (including built-in and dynamically registered) - */ - public ids(options?: Options) { - return (options?.client ?? this._client).get({ - url: "/experimental/tool/ids", - ...options, - }) - } - - /** - * List tools with JSON schema parameters for a provider/model - */ - public list(options: Options) { - return (options.client ?? this._client).get({ - url: "/experimental/tool", - ...options, - }) - } -} - -class Instance extends _HeyApiClient { - /** - * Dispose the current instance - */ - public dispose(options?: Options) { - return (options?.client ?? this._client).post({ - url: "/instance/dispose", - ...options, - }) - } -} - -class Path extends _HeyApiClient { - /** - * Get the current path - */ - public get(options?: Options) { - return (options?.client ?? this._client).get({ - url: "/path", - ...options, - }) - } -} - -class Vcs extends _HeyApiClient { - /** - * Get VCS info for the current instance - */ - public get(options?: Options) { - return (options?.client ?? this._client).get({ - url: "/vcs", - ...options, - }) - } -} - -class Session extends _HeyApiClient { - /** - * List all sessions - */ - public list(options?: Options) { - return (options?.client ?? this._client).get({ - url: "/session", - ...options, - }) - } - - /** - * Create a new session - */ - public create(options?: Options) { - return (options?.client ?? this._client).post({ - url: "/session", - ...options, - headers: { - "Content-Type": "application/json", - ...options?.headers, - }, - }) - } - - /** - * Get session status - */ - public status(options?: Options) { - return (options?.client ?? this._client).get({ - url: "/session/status", - ...options, - }) - } - - /** - * Delete a session and all its data - */ - public delete(options: Options) { - return (options.client ?? this._client).delete({ - url: "/session/{id}", - ...options, - }) - } - - /** - * Get session - */ - public get(options: Options) { - return (options.client ?? this._client).get({ - url: "/session/{id}", - ...options, - }) - } - - /** - * Update session properties - */ - public update(options: Options) { - return (options.client ?? this._client).patch({ - url: "/session/{id}", - ...options, - headers: { - "Content-Type": "application/json", - ...options.headers, - }, - }) - } - - /** - * Get a session's children - */ - public children(options: Options) { - return (options.client ?? this._client).get({ - url: "/session/{id}/children", - ...options, - }) - } - - /** - * Analyze the app and create an AGENTS.md file - */ - public init(options: Options) { - return (options.client ?? this._client).post({ - url: "/session/{id}/init", - ...options, - headers: { - "Content-Type": "application/json", - ...options.headers, - }, - }) - } - - /** - * Fork an existing session at a specific message - */ - public fork(options: Options) { - return (options.client ?? this._client).post({ - url: "/session/{id}/fork", - ...options, - headers: { - "Content-Type": "application/json", - ...options.headers, - }, - }) - } - - /** - * Abort a session - */ - public abort(options: Options) { - return (options.client ?? this._client).post({ - url: "/session/{id}/abort", - ...options, - }) - } - - /** - * Unshare the session - */ - public unshare(options: Options) { - return (options.client ?? this._client).delete({ - url: "/session/{id}/share", - ...options, - }) - } - - /** - * Share a session - */ - public share(options: Options) { - return (options.client ?? this._client).post({ - url: "/session/{id}/share", - ...options, - }) - } - - /** - * Get the diff for this session - */ - public diff(options: Options) { - return (options.client ?? this._client).get({ - url: "/session/{id}/diff", - ...options, - }) - } - - /** - * Summarize the session - */ - public summarize(options: Options) { - return (options.client ?? this._client).post({ - url: "/session/{id}/summarize", - ...options, - headers: { - "Content-Type": "application/json", - ...options.headers, - }, - }) - } - - /** - * List messages for a session - */ - public messages(options: Options) { - return (options.client ?? this._client).get({ - url: "/session/{id}/message", - ...options, - }) - } - - /** - * Create and send a new message to a session - */ - public prompt(options: Options) { - return (options.client ?? this._client).post({ - url: "/session/{id}/message", - ...options, - headers: { - "Content-Type": "application/json", - ...options.headers, - }, - }) - } - - /** - * Get a message from a session - */ - public message(options: Options) { - return (options.client ?? this._client).get({ - url: "/session/{id}/message/{messageID}", - ...options, - }) - } - - /** - * Create and send a new message to a session, start if needed and return immediately - */ - public promptAsync(options: Options) { - return (options.client ?? this._client).post({ - url: "/session/{id}/prompt_async", - ...options, - headers: { - "Content-Type": "application/json", - ...options.headers, - }, - }) - } - - /** - * Send a new command to a session - */ - public command(options: Options) { - return (options.client ?? this._client).post({ - url: "/session/{id}/command", - ...options, - headers: { - "Content-Type": "application/json", - ...options.headers, - }, - }) - } - - /** - * Run a shell command - */ - public shell(options: Options) { - return (options.client ?? this._client).post({ - url: "/session/{id}/shell", - ...options, - headers: { - "Content-Type": "application/json", - ...options.headers, - }, - }) - } - - /** - * Revert a message - */ - public revert(options: Options) { - return (options.client ?? this._client).post({ - url: "/session/{id}/revert", - ...options, - headers: { - "Content-Type": "application/json", - ...options.headers, - }, - }) - } - - /** - * Restore all reverted messages - */ - public unrevert(options: Options) { - return (options.client ?? this._client).post({ - url: "/session/{id}/unrevert", - ...options, - }) - } -} - -class Command extends _HeyApiClient { - /** - * List all commands - */ - public list(options?: Options) { - return (options?.client ?? this._client).get({ - url: "/command", - ...options, - }) - } -} - -class Oauth extends _HeyApiClient { - /** - * Authorize a provider using OAuth - */ - public authorize(options: Options) { - return (options.client ?? this._client).post< - ProviderOauthAuthorizeResponses, - ProviderOauthAuthorizeErrors, - ThrowOnError - >({ - url: "/provider/{id}/oauth/authorize", - ...options, - headers: { - "Content-Type": "application/json", - ...options.headers, - }, - }) - } - - /** - * Handle OAuth callback for a provider - */ - public callback(options: Options) { - return (options.client ?? this._client).post< - ProviderOauthCallbackResponses, - ProviderOauthCallbackErrors, - ThrowOnError - >({ - url: "/provider/{id}/oauth/callback", - ...options, - headers: { - "Content-Type": "application/json", - ...options.headers, - }, - }) - } -} - -class Provider extends _HeyApiClient { - /** - * List all providers - */ - public list(options?: Options) { - return (options?.client ?? this._client).get({ - url: "/provider", - ...options, - }) - } - - /** - * Get provider authentication methods - */ - public auth(options?: Options) { - return (options?.client ?? this._client).get({ - url: "/provider/auth", - ...options, - }) - } - oauth = new Oauth({ client: this._client }) -} - -class Find extends _HeyApiClient { - /** - * Find text in files - */ - public text(options: Options) { - return (options.client ?? this._client).get({ - url: "/find", - ...options, - }) - } - - /** - * Find files - */ - public files(options: Options) { - return (options.client ?? this._client).get({ - url: "/find/file", - ...options, - }) - } - - /** - * Find workspace symbols - */ - public symbols(options: Options) { - return (options.client ?? this._client).get({ - url: "/find/symbol", - ...options, - }) - } -} - -class File extends _HeyApiClient { - /** - * List files and directories - */ - public list(options: Options) { - return (options.client ?? this._client).get({ - url: "/file", - ...options, - }) - } - - /** - * Read a file - */ - public read(options: Options) { - return (options.client ?? this._client).get({ - url: "/file/content", - ...options, - }) - } - - /** - * Get file status - */ - public status(options?: Options) { - return (options?.client ?? this._client).get({ - url: "/file/status", - ...options, - }) - } -} - -class App extends _HeyApiClient { - /** - * Write a log entry to the server logs - */ - public log(options?: Options) { - return (options?.client ?? this._client).post({ - url: "/log", - ...options, - headers: { - "Content-Type": "application/json", - ...options?.headers, - }, - }) - } - - /** - * List all agents - */ - public agents(options?: Options) { - return (options?.client ?? this._client).get({ - url: "/agent", - ...options, - }) - } -} - -class Auth extends _HeyApiClient { - /** - * Remove OAuth credentials for an MCP server - */ - public remove(options: Options) { - return (options.client ?? this._client).delete({ - url: "/mcp/{name}/auth", - ...options, - }) - } - - /** - * Start OAuth authentication flow for an MCP server - */ - public start(options: Options) { - return (options.client ?? this._client).post({ - url: "/mcp/{name}/auth", - ...options, - }) - } - - /** - * Complete OAuth authentication with authorization code - */ - public callback(options: Options) { - return (options.client ?? this._client).post({ - url: "/mcp/{name}/auth/callback", - ...options, - headers: { - "Content-Type": "application/json", - ...options.headers, - }, - }) - } - - /** - * Start OAuth flow and wait for callback (opens browser) - */ - public authenticate(options: Options) { - return (options.client ?? this._client).post( - { - url: "/mcp/{name}/auth/authenticate", - ...options, - }, - ) - } - - /** - * Set authentication credentials - */ - public set(options: Options) { - return (options.client ?? this._client).put({ - url: "/auth/{id}", - ...options, - headers: { - "Content-Type": "application/json", - ...options.headers, - }, - }) - } -} - -class Mcp extends _HeyApiClient { - /** - * Get MCP server status - */ - public status(options?: Options) { - return (options?.client ?? this._client).get({ - url: "/mcp", - ...options, - }) - } - - /** - * Add MCP server dynamically - */ - public add(options?: Options) { - return (options?.client ?? this._client).post({ - url: "/mcp", - ...options, - headers: { - "Content-Type": "application/json", - ...options?.headers, - }, - }) - } - - /** - * Connect an MCP server - */ - public connect(options: Options) { - return (options.client ?? this._client).post({ - url: "/mcp/{name}/connect", - ...options, - }) - } - - /** - * Disconnect an MCP server - */ - public disconnect(options: Options) { - return (options.client ?? this._client).post({ - url: "/mcp/{name}/disconnect", - ...options, - }) - } - - auth = new Auth({ client: this._client }) -} - -class Lsp extends _HeyApiClient { - /** - * Get LSP server status - */ - public status(options?: Options) { - return (options?.client ?? this._client).get({ - url: "/lsp", - ...options, - }) - } -} - -class Formatter extends _HeyApiClient { - /** - * Get formatter status - */ - public status(options?: Options) { - return (options?.client ?? this._client).get({ - url: "/formatter", - ...options, - }) - } -} - -class Control extends _HeyApiClient { - /** - * Get the next TUI request from the queue - */ - public next(options?: Options) { - return (options?.client ?? this._client).get({ - url: "/tui/control/next", - ...options, - }) - } - - /** - * Submit a response to the TUI request queue - */ - public response(options?: Options) { - return (options?.client ?? this._client).post({ - url: "/tui/control/response", - ...options, - headers: { - "Content-Type": "application/json", - ...options?.headers, - }, - }) - } -} - -class Tui extends _HeyApiClient { - /** - * Append prompt to the TUI - */ - public appendPrompt(options?: Options) { - return (options?.client ?? this._client).post({ - url: "/tui/append-prompt", - ...options, - headers: { - "Content-Type": "application/json", - ...options?.headers, - }, - }) - } - - /** - * Open the help dialog - */ - public openHelp(options?: Options) { - return (options?.client ?? this._client).post({ - url: "/tui/open-help", - ...options, - }) - } - - /** - * Open the session dialog - */ - public openSessions(options?: Options) { - return (options?.client ?? this._client).post({ - url: "/tui/open-sessions", - ...options, - }) - } - - /** - * Open the theme dialog - */ - public openThemes(options?: Options) { - return (options?.client ?? this._client).post({ - url: "/tui/open-themes", - ...options, - }) - } - - /** - * Open the model dialog - */ - public openModels(options?: Options) { - return (options?.client ?? this._client).post({ - url: "/tui/open-models", - ...options, - }) - } - - /** - * Submit the prompt - */ - public submitPrompt(options?: Options) { - return (options?.client ?? this._client).post({ - url: "/tui/submit-prompt", - ...options, - }) - } - - /** - * Clear the prompt - */ - public clearPrompt(options?: Options) { - return (options?.client ?? this._client).post({ - url: "/tui/clear-prompt", - ...options, - }) - } - - /** - * Execute a TUI command (e.g. agent_cycle) - */ - public executeCommand(options?: Options) { - return (options?.client ?? this._client).post({ - url: "/tui/execute-command", - ...options, - headers: { - "Content-Type": "application/json", - ...options?.headers, - }, - }) - } - - /** - * Show a toast notification in the TUI - */ - public showToast(options?: Options) { - return (options?.client ?? this._client).post({ - url: "/tui/show-toast", - ...options, - headers: { - "Content-Type": "application/json", - ...options?.headers, - }, - }) - } - - /** - * Publish a TUI event - */ - public publish(options?: Options) { - return (options?.client ?? this._client).post({ - url: "/tui/publish", - ...options, - headers: { - "Content-Type": "application/json", - ...options?.headers, - }, - }) - } - control = new Control({ client: this._client }) -} - -class Event extends _HeyApiClient { - /** - * Get events - */ - public subscribe(options?: Options) { - return (options?.client ?? this._client).get.sse({ - url: "/event", - ...options, - }) - } -} - -export class OpencodeClient extends _HeyApiClient { - /** - * Respond to a permission request - */ - public postSessionIdPermissionsPermissionId( - options: Options, - ) { - return (options.client ?? this._client).post< - PostSessionIdPermissionsPermissionIdResponses, - PostSessionIdPermissionsPermissionIdErrors, - ThrowOnError - >({ - url: "/session/{id}/permissions/{permissionID}", - ...options, - headers: { - "Content-Type": "application/json", - ...options.headers, - }, - }) - } - global = new Global({ client: this._client }) - project = new Project({ client: this._client }) - pty = new Pty({ client: this._client }) - config = new Config({ client: this._client }) - tool = new Tool({ client: this._client }) - instance = new Instance({ client: this._client }) - path = new Path({ client: this._client }) - vcs = new Vcs({ client: this._client }) - session = new Session({ client: this._client }) - command = new Command({ client: this._client }) - provider = new Provider({ client: this._client }) - find = new Find({ client: this._client }) - file = new File({ client: this._client }) - app = new App({ client: this._client }) - mcp = new Mcp({ client: this._client }) - lsp = new Lsp({ client: this._client }) - formatter = new Formatter({ client: this._client }) - tui = new Tui({ client: this._client }) - auth = new Auth({ client: this._client }) - event = new Event({ client: this._client }) -} diff --git a/packages/sdk/js/src/gen/types.gen.ts b/packages/sdk/js/src/gen/types.gen.ts deleted file mode 100644 index e9b704b468..0000000000 --- a/packages/sdk/js/src/gen/types.gen.ts +++ /dev/null @@ -1,3843 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type EventServerInstanceDisposed = { - type: "server.instance.disposed" - properties: { - directory: string - } -} - -export type EventInstallationUpdated = { - type: "installation.updated" - properties: { - version: string - } -} - -export type EventInstallationUpdateAvailable = { - type: "installation.update-available" - properties: { - version: string - } -} - -export type EventLspClientDiagnostics = { - type: "lsp.client.diagnostics" - properties: { - serverID: string - path: string - } -} - -export type EventLspUpdated = { - type: "lsp.updated" - properties: { - [key: string]: unknown - } -} - -export type FileDiff = { - file: string - before: string - after: string - additions: number - deletions: number -} - -export type UserMessage = { - id: string - sessionID: string - role: "user" - time: { - created: number - } - summary?: { - title?: string - body?: string - diffs: Array - } - agent: string - model: { - providerID: string - modelID: string - } - system?: string - tools?: { - [key: string]: boolean - } -} - -export type ProviderAuthError = { - name: "ProviderAuthError" - data: { - providerID: string - message: string - } -} - -export type UnknownError = { - name: "UnknownError" - data: { - message: string - } -} - -export type MessageOutputLengthError = { - name: "MessageOutputLengthError" - data: { - [key: string]: unknown - } -} - -export type MessageAbortedError = { - name: "MessageAbortedError" - data: { - message: string - } -} - -export type ApiError = { - name: "APIError" - data: { - message: string - statusCode?: number - isRetryable: boolean - responseHeaders?: { - [key: string]: string - } - responseBody?: string - } -} - -export type AssistantMessage = { - id: string - sessionID: string - role: "assistant" - time: { - created: number - completed?: number - } - error?: ProviderAuthError | UnknownError | MessageOutputLengthError | MessageAbortedError | ApiError - parentID: string - modelID: string - providerID: string - mode: string - path: { - cwd: string - root: string - } - summary?: boolean - cost: number - tokens: { - input: number - output: number - reasoning: number - cache: { - read: number - write: number - } - } - finish?: string -} - -export type Message = UserMessage | AssistantMessage - -export type EventMessageUpdated = { - type: "message.updated" - properties: { - info: Message - } -} - -export type EventMessageRemoved = { - type: "message.removed" - properties: { - sessionID: string - messageID: string - } -} - -export type TextPart = { - id: string - sessionID: string - messageID: string - type: "text" - text: string - synthetic?: boolean - ignored?: boolean - time?: { - start: number - end?: number - } - metadata?: { - [key: string]: unknown - } -} - -export type ReasoningPart = { - id: string - sessionID: string - messageID: string - type: "reasoning" - text: string - metadata?: { - [key: string]: unknown - } - time: { - start: number - end?: number - } -} - -export type FilePartSourceText = { - value: string - start: number - end: number -} - -export type FileSource = { - text: FilePartSourceText - type: "file" - path: string -} - -export type Range = { - start: { - line: number - character: number - } - end: { - line: number - character: number - } -} - -export type SymbolSource = { - text: FilePartSourceText - type: "symbol" - path: string - range: Range - name: string - kind: number -} - -export type FilePartSource = FileSource | SymbolSource - -export type FilePart = { - id: string - sessionID: string - messageID: string - type: "file" - mime: string - filename?: string - url: string - source?: FilePartSource -} - -export type ToolStatePending = { - status: "pending" - input: { - [key: string]: unknown - } - raw: string -} - -export type ToolStateRunning = { - status: "running" - input: { - [key: string]: unknown - } - title?: string - metadata?: { - [key: string]: unknown - } - time: { - start: number - } -} - -export type ToolStateCompleted = { - status: "completed" - input: { - [key: string]: unknown - } - output: string - title: string - metadata: { - [key: string]: unknown - } - time: { - start: number - end: number - compacted?: number - } - attachments?: Array -} - -export type ToolStateError = { - status: "error" - input: { - [key: string]: unknown - } - error: string - metadata?: { - [key: string]: unknown - } - time: { - start: number - end: number - } -} - -export type ToolState = ToolStatePending | ToolStateRunning | ToolStateCompleted | ToolStateError - -export type ToolPart = { - id: string - sessionID: string - messageID: string - type: "tool" - callID: string - tool: string - state: ToolState - metadata?: { - [key: string]: unknown - } -} - -export type StepStartPart = { - id: string - sessionID: string - messageID: string - type: "step-start" - snapshot?: string -} - -export type StepFinishPart = { - id: string - sessionID: string - messageID: string - type: "step-finish" - reason: string - snapshot?: string - cost: number - tokens: { - input: number - output: number - reasoning: number - cache: { - read: number - write: number - } - } -} - -export type SnapshotPart = { - id: string - sessionID: string - messageID: string - type: "snapshot" - snapshot: string -} - -export type PatchPart = { - id: string - sessionID: string - messageID: string - type: "patch" - hash: string - files: Array -} - -export type AgentPart = { - id: string - sessionID: string - messageID: string - type: "agent" - name: string - source?: { - value: string - start: number - end: number - } -} - -export type RetryPart = { - id: string - sessionID: string - messageID: string - type: "retry" - attempt: number - error: ApiError - time: { - created: number - } -} - -export type CompactionPart = { - id: string - sessionID: string - messageID: string - type: "compaction" - auto: boolean -} - -export type Part = - | TextPart - | { - id: string - sessionID: string - messageID: string - type: "subtask" - prompt: string - description: string - agent: string - } - | ReasoningPart - | FilePart - | ToolPart - | StepStartPart - | StepFinishPart - | SnapshotPart - | PatchPart - | AgentPart - | RetryPart - | CompactionPart - -export type EventMessagePartUpdated = { - type: "message.part.updated" - properties: { - part: Part - delta?: string - } -} - -export type EventMessagePartRemoved = { - type: "message.part.removed" - properties: { - sessionID: string - messageID: string - partID: string - } -} - -export type Permission = { - id: string - type: string - pattern?: string | Array - sessionID: string - messageID: string - callID?: string - title: string - metadata: { - [key: string]: unknown - } - time: { - created: number - } -} - -export type EventPermissionUpdated = { - type: "permission.updated" - properties: Permission -} - -export type EventPermissionReplied = { - type: "permission.replied" - properties: { - sessionID: string - permissionID: string - response: string - } -} - -export type SessionStatus = - | { - type: "idle" - } - | { - type: "retry" - attempt: number - message: string - next: number - } - | { - type: "busy" - } - -export type EventSessionStatus = { - type: "session.status" - properties: { - sessionID: string - status: SessionStatus - } -} - -export type EventSessionIdle = { - type: "session.idle" - properties: { - sessionID: string - } -} - -export type EventSessionCompacted = { - type: "session.compacted" - properties: { - sessionID: string - } -} - -export type EventFileEdited = { - type: "file.edited" - properties: { - file: string - } -} - -export type EventCommandExecuted = { - type: "command.executed" - properties: { - name: string - sessionID: string - arguments: string - messageID: string - } -} - -export type Session = { - id: string - projectID: string - directory: string - parentID?: string - summary?: { - additions: number - deletions: number - files: number - diffs?: Array - } - share?: { - url: string - } - title: string - version: string - time: { - created: number - updated: number - compacting?: number - } - revert?: { - messageID: string - partID?: string - snapshot?: string - diff?: string - } -} - -export type EventSessionCreated = { - type: "session.created" - properties: { - info: Session - } -} - -export type EventSessionUpdated = { - type: "session.updated" - properties: { - info: Session - } -} - -export type EventSessionDeleted = { - type: "session.deleted" - properties: { - info: Session - } -} - -export type EventSessionDiff = { - type: "session.diff" - properties: { - sessionID: string - diff: Array - } -} - -export type EventSessionError = { - type: "session.error" - properties: { - sessionID?: string - error?: ProviderAuthError | UnknownError | MessageOutputLengthError | MessageAbortedError | ApiError - } -} - -export type EventFileWatcherUpdated = { - type: "file.watcher.updated" - properties: { - file: string - event: "add" | "change" | "unlink" - } -} - -export type EventVcsBranchUpdated = { - type: "vcs.branch.updated" - properties: { - branch?: string - } -} - -export type EventTuiPromptAppend = { - type: "tui.prompt.append" - properties: { - text: string - } -} - -export type EventTuiCommandExecute = { - type: "tui.command.execute" - properties: { - command: - | ( - | "session.list" - | "session.new" - | "session.share" - | "session.interrupt" - | "session.compact" - | "session.page.up" - | "session.page.down" - | "session.half.page.up" - | "session.half.page.down" - | "session.first" - | "session.last" - | "prompt.clear" - | "prompt.submit" - | "agent.cycle" - ) - | string - } -} - -export type EventTuiToastShow = { - type: "tui.toast.show" - properties: { - title?: string - message: string - variant: "info" | "success" | "warning" | "error" - /** - * Duration in milliseconds - */ - duration?: number - } -} - -export type Pty = { - id: string - title: string - command: string - args: Array - cwd: string - status: "running" | "exited" - pid: number -} - -export type EventPtyCreated = { - type: "pty.created" - properties: { - info: Pty - } -} - -export type EventPtyUpdated = { - type: "pty.updated" - properties: { - info: Pty - } -} - -export type EventPtyExited = { - type: "pty.exited" - properties: { - id: string - exitCode: number - } -} - -export type EventPtyDeleted = { - type: "pty.deleted" - properties: { - id: string - } -} - -export type EventServerConnected = { - type: "server.connected" - properties: { - [key: string]: unknown - } -} - -export type Event = - | EventServerInstanceDisposed - | EventInstallationUpdated - | EventInstallationUpdateAvailable - | EventLspClientDiagnostics - | EventLspUpdated - | EventMessageUpdated - | EventMessageRemoved - | EventMessagePartUpdated - | EventMessagePartRemoved - | EventPermissionUpdated - | EventPermissionReplied - | EventSessionStatus - | EventSessionIdle - | EventSessionCompacted - | EventFileEdited - | EventCommandExecuted - | EventSessionCreated - | EventSessionUpdated - | EventSessionDeleted - | EventSessionDiff - | EventSessionError - | EventFileWatcherUpdated - | EventVcsBranchUpdated - | EventTuiPromptAppend - | EventTuiCommandExecute - | EventTuiToastShow - | EventPtyCreated - | EventPtyUpdated - | EventPtyExited - | EventPtyDeleted - | EventServerConnected - -export type GlobalEvent = { - directory: string - payload: Event -} - -export type Project = { - id: string - worktree: string - vcsDir?: string - vcs?: "git" | "hg" - time: { - created: number - initialized?: number - } -} - -export type BadRequestError = { - name: "BadRequest" - data: { - message: string - kind?: "Params" | "Headers" | "Query" | "Body" | "Payload" - } -} - -export type NotFoundError = { - name: "NotFoundError" - data: { - message: string - } -} - -/** - * Custom keybind configurations - */ -export type KeybindsConfig = { - /** - * Leader key for keybind combinations - */ - leader?: string - /** - * Exit the application - */ - app_exit?: string - /** - * Open external editor - */ - editor_open?: string - /** - * List available themes - */ - theme_list?: string - /** - * Toggle sidebar - */ - sidebar_toggle?: string - /** - * Toggle session scrollbar - */ - scrollbar_toggle?: string - /** - * Toggle username visibility - */ - username_toggle?: string - /** - * View status - */ - status_view?: string - /** - * Export session to editor - */ - session_export?: string - /** - * Create a new session - */ - session_new?: string - /** - * List all sessions - */ - session_list?: string - /** - * Show session timeline - */ - session_timeline?: string - /** - * Share current session - */ - session_share?: string - /** - * Unshare current session - */ - session_unshare?: string - /** - * Interrupt current session - */ - session_interrupt?: string - /** - * Compact the session - */ - session_compact?: string - /** - * Scroll messages up by one page - */ - messages_page_up?: string - /** - * Scroll messages down by one page - */ - messages_page_down?: string - /** - * Scroll messages up by one line - */ - messages_line_up?: string - /** - * Scroll messages down by one line - */ - messages_line_down?: string - /** - * Scroll messages up by half page - */ - messages_half_page_up?: string - /** - * Scroll messages down by half page - */ - messages_half_page_down?: string - /** - * Navigate to first message - */ - messages_first?: string - /** - * Navigate to last message - */ - messages_last?: string - /** - * Navigate to next message - */ - messages_next?: string - /** - * Navigate to previous message - */ - messages_previous?: string - /** - * Navigate to last user message - */ - messages_last_user?: string - /** - * Copy message - */ - messages_copy?: string - /** - * Undo message - */ - messages_undo?: string - /** - * Redo message - */ - messages_redo?: string - /** - * Toggle code block concealment in messages - */ - messages_toggle_conceal?: string - /** - * Toggle tool details visibility - */ - tool_details?: string - /** - * List available models - */ - model_list?: string - /** - * Next recently used model - */ - model_cycle_recent?: string - /** - * Previous recently used model - */ - model_cycle_recent_reverse?: string - /** - * List available commands - */ - command_list?: string - /** - * List agents - */ - agent_list?: string - /** - * Next agent - */ - agent_cycle?: string - /** - * Previous agent - */ - agent_cycle_reverse?: string - /** - * Clear input field - */ - input_clear?: string - /** - * Forward delete - */ - input_forward_delete?: string - /** - * Paste from clipboard - */ - input_paste?: string - /** - * Submit input - */ - input_submit?: string - /** - * Insert newline in input - */ - input_newline?: string - /** - * Previous history item - */ - history_previous?: string - /** - * Next history item - */ - history_next?: string - /** - * Next child session - */ - session_child_cycle?: string - /** - * Previous child session - */ - session_child_cycle_reverse?: string - /** - * Suspend terminal - */ - terminal_suspend?: string - /** - * Toggle terminal title - */ - terminal_title_toggle?: string -} - -export type AgentConfig = { - model?: string - temperature?: number - top_p?: number - prompt?: string - tools?: { - [key: string]: boolean - } - disable?: boolean - /** - * Description of when to use the agent - */ - description?: string - mode?: "subagent" | "primary" | "all" - /** - * Hex color code for the agent (e.g., #FF5733) - */ - color?: string - /** - * Maximum number of agentic iterations before forcing text-only response - */ - maxSteps?: number - permission?: { - edit?: "ask" | "allow" | "deny" - bash?: - | ("ask" | "allow" | "deny") - | { - [key: string]: "ask" | "allow" | "deny" - } - webfetch?: "ask" | "allow" | "deny" - doom_loop?: "ask" | "allow" | "deny" - external_directory?: "ask" | "allow" | "deny" - } - [key: string]: - | unknown - | string - | number - | { - [key: string]: boolean - } - | boolean - | ("subagent" | "primary" | "all") - | number - | { - edit?: "ask" | "allow" | "deny" - bash?: - | ("ask" | "allow" | "deny") - | { - [key: string]: "ask" | "allow" | "deny" - } - webfetch?: "ask" | "allow" | "deny" - doom_loop?: "ask" | "allow" | "deny" - external_directory?: "ask" | "allow" | "deny" - } - | undefined -} - -export type ProviderConfig = { - api?: string - name?: string - env?: Array - id?: string - npm?: string - models?: { - [key: string]: { - id?: string - name?: string - release_date?: string - attachment?: boolean - reasoning?: boolean - temperature?: boolean - tool_call?: boolean - cost?: { - input: number - output: number - cache_read?: number - cache_write?: number - context_over_200k?: { - input: number - output: number - cache_read?: number - cache_write?: number - } - } - limit?: { - context: number - output: number - } - modalities?: { - input: Array<"text" | "audio" | "image" | "video" | "pdf"> - output: Array<"text" | "audio" | "image" | "video" | "pdf"> - } - experimental?: boolean - status?: "alpha" | "beta" | "deprecated" | "active" - options?: { - [key: string]: unknown - } - headers?: { - [key: string]: string - } - provider?: { - npm: string - } - } - } - whitelist?: Array - blacklist?: Array - options?: { - apiKey?: string - baseURL?: string - /** - * GitHub Enterprise URL for copilot authentication - */ - enterpriseUrl?: string - /** - * Enable promptCacheKey for this provider (default false) - */ - setCacheKey?: boolean - /** - * Timeout in milliseconds for requests to this provider. Default is 300000 (5 minutes). Set to false to disable timeout. - */ - timeout?: number | false - [key: string]: unknown | string | boolean | (number | false) | undefined - } -} - -export type McpLocalConfig = { - /** - * Type of MCP server connection - */ - type: "local" - /** - * Command and arguments to run the MCP server - */ - command: Array - /** - * Environment variables to set when running the MCP server - */ - environment?: { - [key: string]: string - } - /** - * Enable or disable the MCP server on startup - */ - enabled?: boolean - /** - * Timeout in ms for fetching tools from the MCP server. Defaults to 5000 (5 seconds) if not specified. - */ - timeout?: number -} - -export type McpOAuthConfig = { - /** - * OAuth client ID. If not provided, dynamic client registration (RFC 7591) will be attempted. - */ - clientId?: string - /** - * OAuth client secret (if required by the authorization server) - */ - clientSecret?: string - /** - * OAuth scopes to request during authorization - */ - scope?: string -} - -export type McpRemoteConfig = { - /** - * Type of MCP server connection - */ - type: "remote" - /** - * URL of the remote MCP server - */ - url: string - /** - * Enable or disable the MCP server on startup - */ - enabled?: boolean - /** - * Headers to send with the request - */ - headers?: { - [key: string]: string - } - /** - * OAuth authentication configuration for the MCP server. Set to false to disable OAuth auto-detection. - */ - oauth?: McpOAuthConfig | false - /** - * Timeout in ms for fetching tools from the MCP server. Defaults to 5000 (5 seconds) if not specified. - */ - timeout?: number -} - -/** - * @deprecated Always uses stretch layout. - */ -export type LayoutConfig = "auto" | "stretch" - -export type Config = { - /** - * JSON schema reference for configuration validation - */ - $schema?: string - /** - * Theme name to use for the interface - */ - theme?: string - keybinds?: KeybindsConfig - /** - * Log level - */ - logLevel?: "DEBUG" | "INFO" | "WARN" | "ERROR" - /** - * TUI specific settings - */ - tui?: { - /** - * TUI scroll speed - */ - scroll_speed?: number - /** - * Scroll acceleration settings - */ - scroll_acceleration?: { - /** - * Enable scroll acceleration - */ - enabled: boolean - } - /** - * Control diff rendering style: 'auto' adapts to terminal width, 'stacked' always shows single column - */ - diff_style?: "auto" | "stacked" - } - /** - * Command configuration, see https://opencode.ai/docs/commands - */ - command?: { - [key: string]: { - template: string - description?: string - agent?: string - model?: string - subtask?: boolean - } - } - watcher?: { - ignore?: Array - } - plugin?: Array - snapshot?: boolean - /** - * Control sharing behavior:'manual' allows manual sharing via commands, 'auto' enables automatic sharing, 'disabled' disables all sharing - */ - share?: "manual" | "auto" | "disabled" - /** - * @deprecated Use 'share' field instead. Share newly created sessions automatically - */ - autoshare?: boolean - /** - * Automatically update to the latest version. Set to true to auto-update, false to disable, or 'notify' to show update notifications - */ - autoupdate?: boolean | "notify" - /** - * Disable providers that are loaded automatically - */ - disabled_providers?: Array - /** - * When set, ONLY these providers will be enabled. All other providers will be ignored - */ - enabled_providers?: Array - /** - * Model to use in the format of provider/model, eg anthropic/claude-2 - */ - model?: string - /** - * Small model to use for tasks like title generation in the format of provider/model - */ - small_model?: string - /** - * Custom username to display in conversations instead of system username - */ - username?: string - /** - * @deprecated Use `agent` field instead. - */ - mode?: { - build?: AgentConfig - plan?: AgentConfig - [key: string]: AgentConfig | undefined - } - /** - * Agent configuration, see https://opencode.ai/docs/agent - */ - agent?: { - plan?: AgentConfig - build?: AgentConfig - general?: AgentConfig - explore?: AgentConfig - [key: string]: AgentConfig | undefined - } - /** - * Custom provider configurations and model overrides - */ - provider?: { - [key: string]: ProviderConfig - } - /** - * MCP (Model Context Protocol) server configurations - */ - mcp?: { - [key: string]: McpLocalConfig | McpRemoteConfig - } - formatter?: - | false - | { - [key: string]: { - disabled?: boolean - command?: Array - environment?: { - [key: string]: string - } - extensions?: Array - } - } - lsp?: - | false - | { - [key: string]: - | { - disabled: true - } - | { - command: Array - extensions?: Array - disabled?: boolean - env?: { - [key: string]: string - } - initialization?: { - [key: string]: unknown - } - } - } - /** - * Additional instruction files or patterns to include - */ - instructions?: Array - layout?: LayoutConfig - permission?: { - edit?: "ask" | "allow" | "deny" - bash?: - | ("ask" | "allow" | "deny") - | { - [key: string]: "ask" | "allow" | "deny" - } - webfetch?: "ask" | "allow" | "deny" - doom_loop?: "ask" | "allow" | "deny" - external_directory?: "ask" | "allow" | "deny" - } - tools?: { - [key: string]: boolean - } - enterprise?: { - /** - * Enterprise URL - */ - url?: string - } - experimental?: { - hook?: { - file_edited?: { - [key: string]: Array<{ - command: Array - environment?: { - [key: string]: string - } - }> - } - session_completed?: Array<{ - command: Array - environment?: { - [key: string]: string - } - }> - } - /** - * Number of retries for chat completions on failure - */ - chatMaxRetries?: number - disable_paste_summary?: boolean - /** - * Enable the batch tool - */ - batch_tool?: boolean - /** - * Enable OpenTelemetry spans for AI SDK calls (using the 'experimental_telemetry' flag) - */ - openTelemetry?: boolean - /** - * Tools that should only be available to primary agents. - */ - primary_tools?: Array - } -} - -export type ToolIds = Array - -export type ToolListItem = { - id: string - description: string - parameters: unknown -} - -export type ToolList = Array - -export type Path = { - state: string - config: string - worktree: string - directory: string -} - -export type VcsInfo = { - branch: string -} - -export type TextPartInput = { - id?: string - type: "text" - text: string - synthetic?: boolean - ignored?: boolean - time?: { - start: number - end?: number - } - metadata?: { - [key: string]: unknown - } -} - -export type FilePartInput = { - id?: string - type: "file" - mime: string - filename?: string - url: string - source?: FilePartSource -} - -export type AgentPartInput = { - id?: string - type: "agent" - name: string - source?: { - value: string - start: number - end: number - } -} - -export type SubtaskPartInput = { - id?: string - type: "subtask" - prompt: string - description: string - agent: string -} - -export type Command = { - name: string - description?: string - agent?: string - model?: string - template: string - subtask?: boolean -} - -export type Model = { - id: string - providerID: string - api: { - id: string - url: string - npm: string - } - name: string - capabilities: { - temperature: boolean - reasoning: boolean - attachment: boolean - toolcall: boolean - input: { - text: boolean - audio: boolean - image: boolean - video: boolean - pdf: boolean - } - output: { - text: boolean - audio: boolean - image: boolean - video: boolean - pdf: boolean - } - } - cost: { - input: number - output: number - cache: { - read: number - write: number - } - experimentalOver200K?: { - input: number - output: number - cache: { - read: number - write: number - } - } - } - limit: { - context: number - output: number - } - status: "alpha" | "beta" | "deprecated" | "active" - options: { - [key: string]: unknown - } - headers: { - [key: string]: string - } -} - -export type Provider = { - id: string - name: string - source: "env" | "config" | "custom" | "api" - env: Array - key?: string - options: { - [key: string]: unknown - } - models: { - [key: string]: Model - } -} - -export type ProviderAuthMethod = { - type: "oauth" | "api" - label: string -} - -export type ProviderAuthAuthorization = { - url: string - method: "auto" | "code" - instructions: string -} - -export type Symbol = { - name: string - kind: number - location: { - uri: string - range: Range - } -} - -export type FileNode = { - name: string - path: string - absolute: string - type: "file" | "directory" - ignored: boolean -} - -export type FileContent = { - type: "text" | "binary" - content: string - diff?: string - patch?: { - oldFileName: string - newFileName: string - oldHeader?: string - newHeader?: string - hunks: Array<{ - oldStart: number - oldLines: number - newStart: number - newLines: number - lines: Array - }> - index?: string - } - encoding?: "base64" - mimeType?: string -} - -export type File = { - path: string - added: number - removed: number - status: "added" | "deleted" | "modified" -} - -export type Agent = { - name: string - description?: string - mode: "subagent" | "primary" | "all" - builtIn: boolean - topP?: number - temperature?: number - color?: string - permission: { - edit: "ask" | "allow" | "deny" - bash: { - [key: string]: "ask" | "allow" | "deny" - } - webfetch?: "ask" | "allow" | "deny" - doom_loop?: "ask" | "allow" | "deny" - external_directory?: "ask" | "allow" | "deny" - } - model?: { - modelID: string - providerID: string - } - prompt?: string - tools: { - [key: string]: boolean - } - options: { - [key: string]: unknown - } - maxSteps?: number -} - -export type McpStatusConnected = { - status: "connected" -} - -export type McpStatusDisabled = { - status: "disabled" -} - -export type McpStatusFailed = { - status: "failed" - error: string -} - -export type McpStatusNeedsAuth = { - status: "needs_auth" -} - -export type McpStatusNeedsClientRegistration = { - status: "needs_client_registration" - error: string -} - -export type McpStatus = - | McpStatusConnected - | McpStatusDisabled - | McpStatusFailed - | McpStatusNeedsAuth - | McpStatusNeedsClientRegistration - -export type LspStatus = { - id: string - name: string - root: string - status: "connected" | "error" -} - -export type FormatterStatus = { - name: string - extensions: Array - enabled: boolean -} - -export type OAuth = { - type: "oauth" - refresh: string - access: string - expires: number - enterpriseUrl?: string -} - -export type ApiAuth = { - type: "api" - key: string - metadata?: { - [key: string]: string - } -} - -export type WellKnownAuth = { - type: "wellknown" - key: string - token: string -} - -export type Auth = OAuth | ApiAuth | WellKnownAuth - -export type GlobalEventData = { - body?: never - path?: never - query?: never - url: "/global/event" -} - -export type GlobalEventResponses = { - /** - * Event stream - */ - 200: GlobalEvent -} - -export type GlobalEventResponse = GlobalEventResponses[keyof GlobalEventResponses] - -export type ProjectListData = { - body?: never - path?: never - query?: { - directory?: string - } - url: "/project" -} - -export type ProjectListResponses = { - /** - * List of projects - */ - 200: Array -} - -export type ProjectListResponse = ProjectListResponses[keyof ProjectListResponses] - -export type ProjectCurrentData = { - body?: never - path?: never - query?: { - directory?: string - } - url: "/project/current" -} - -export type ProjectCurrentResponses = { - /** - * Current project - */ - 200: Project -} - -export type ProjectCurrentResponse = ProjectCurrentResponses[keyof ProjectCurrentResponses] - -export type PtyListData = { - body?: never - path?: never - query?: { - directory?: string - } - url: "/pty" -} - -export type PtyListResponses = { - /** - * List of sessions - */ - 200: Array -} - -export type PtyListResponse = PtyListResponses[keyof PtyListResponses] - -export type PtyCreateData = { - body?: { - command?: string - args?: Array - cwd?: string - title?: string - env?: { - [key: string]: string - } - } - path?: never - query?: { - directory?: string - } - url: "/pty" -} - -export type PtyCreateErrors = { - /** - * Bad request - */ - 400: BadRequestError -} - -export type PtyCreateError = PtyCreateErrors[keyof PtyCreateErrors] - -export type PtyCreateResponses = { - /** - * Created session - */ - 200: Pty -} - -export type PtyCreateResponse = PtyCreateResponses[keyof PtyCreateResponses] - -export type PtyRemoveData = { - body?: never - path: { - id: string - } - query?: { - directory?: string - } - url: "/pty/{id}" -} - -export type PtyRemoveErrors = { - /** - * Not found - */ - 404: NotFoundError -} - -export type PtyRemoveError = PtyRemoveErrors[keyof PtyRemoveErrors] - -export type PtyRemoveResponses = { - /** - * Session removed - */ - 200: boolean -} - -export type PtyRemoveResponse = PtyRemoveResponses[keyof PtyRemoveResponses] - -export type PtyGetData = { - body?: never - path: { - id: string - } - query?: { - directory?: string - } - url: "/pty/{id}" -} - -export type PtyGetErrors = { - /** - * Not found - */ - 404: NotFoundError -} - -export type PtyGetError = PtyGetErrors[keyof PtyGetErrors] - -export type PtyGetResponses = { - /** - * Session info - */ - 200: Pty -} - -export type PtyGetResponse = PtyGetResponses[keyof PtyGetResponses] - -export type PtyUpdateData = { - body?: { - title?: string - size?: { - rows: number - cols: number - } - } - path: { - id: string - } - query?: { - directory?: string - } - url: "/pty/{id}" -} - -export type PtyUpdateErrors = { - /** - * Bad request - */ - 400: BadRequestError -} - -export type PtyUpdateError = PtyUpdateErrors[keyof PtyUpdateErrors] - -export type PtyUpdateResponses = { - /** - * Updated session - */ - 200: Pty -} - -export type PtyUpdateResponse = PtyUpdateResponses[keyof PtyUpdateResponses] - -export type PtyConnectData = { - body?: never - path: { - id: string - } - query?: { - directory?: string - } - url: "/pty/{id}/connect" -} - -export type PtyConnectErrors = { - /** - * Not found - */ - 404: NotFoundError -} - -export type PtyConnectError = PtyConnectErrors[keyof PtyConnectErrors] - -export type PtyConnectResponses = { - /** - * Connected session - */ - 200: boolean -} - -export type PtyConnectResponse = PtyConnectResponses[keyof PtyConnectResponses] - -export type ConfigGetData = { - body?: never - path?: never - query?: { - directory?: string - } - url: "/config" -} - -export type ConfigGetResponses = { - /** - * Get config info - */ - 200: Config -} - -export type ConfigGetResponse = ConfigGetResponses[keyof ConfigGetResponses] - -export type ConfigUpdateData = { - body?: Config - path?: never - query?: { - directory?: string - } - url: "/config" -} - -export type ConfigUpdateErrors = { - /** - * Bad request - */ - 400: BadRequestError -} - -export type ConfigUpdateError = ConfigUpdateErrors[keyof ConfigUpdateErrors] - -export type ConfigUpdateResponses = { - /** - * Successfully updated config - */ - 200: Config -} - -export type ConfigUpdateResponse = ConfigUpdateResponses[keyof ConfigUpdateResponses] - -export type ToolIdsData = { - body?: never - path?: never - query?: { - directory?: string - } - url: "/experimental/tool/ids" -} - -export type ToolIdsErrors = { - /** - * Bad request - */ - 400: BadRequestError -} - -export type ToolIdsError = ToolIdsErrors[keyof ToolIdsErrors] - -export type ToolIdsResponses = { - /** - * Tool IDs - */ - 200: ToolIds -} - -export type ToolIdsResponse = ToolIdsResponses[keyof ToolIdsResponses] - -export type ToolListData = { - body?: never - path?: never - query: { - directory?: string - provider: string - model: string - } - url: "/experimental/tool" -} - -export type ToolListErrors = { - /** - * Bad request - */ - 400: BadRequestError -} - -export type ToolListError = ToolListErrors[keyof ToolListErrors] - -export type ToolListResponses = { - /** - * Tools - */ - 200: ToolList -} - -export type ToolListResponse = ToolListResponses[keyof ToolListResponses] - -export type InstanceDisposeData = { - body?: never - path?: never - query?: { - directory?: string - } - url: "/instance/dispose" -} - -export type InstanceDisposeResponses = { - /** - * Instance disposed - */ - 200: boolean -} - -export type InstanceDisposeResponse = InstanceDisposeResponses[keyof InstanceDisposeResponses] - -export type PathGetData = { - body?: never - path?: never - query?: { - directory?: string - } - url: "/path" -} - -export type PathGetResponses = { - /** - * Path - */ - 200: Path -} - -export type PathGetResponse = PathGetResponses[keyof PathGetResponses] - -export type VcsGetData = { - body?: never - path?: never - query?: { - directory?: string - } - url: "/vcs" -} - -export type VcsGetResponses = { - /** - * VCS info - */ - 200: VcsInfo -} - -export type VcsGetResponse = VcsGetResponses[keyof VcsGetResponses] - -export type SessionListData = { - body?: never - path?: never - query?: { - directory?: string - } - url: "/session" -} - -export type SessionListResponses = { - /** - * List of sessions - */ - 200: Array -} - -export type SessionListResponse = SessionListResponses[keyof SessionListResponses] - -export type SessionCreateData = { - body?: { - parentID?: string - title?: string - } - path?: never - query?: { - directory?: string - } - url: "/session" -} - -export type SessionCreateErrors = { - /** - * Bad request - */ - 400: BadRequestError -} - -export type SessionCreateError = SessionCreateErrors[keyof SessionCreateErrors] - -export type SessionCreateResponses = { - /** - * Successfully created session - */ - 200: Session -} - -export type SessionCreateResponse = SessionCreateResponses[keyof SessionCreateResponses] - -export type SessionStatusData = { - body?: never - path?: never - query?: { - directory?: string - } - url: "/session/status" -} - -export type SessionStatusErrors = { - /** - * Bad request - */ - 400: BadRequestError -} - -export type SessionStatusError = SessionStatusErrors[keyof SessionStatusErrors] - -export type SessionStatusResponses = { - /** - * Get session status - */ - 200: { - [key: string]: SessionStatus - } -} - -export type SessionStatusResponse = SessionStatusResponses[keyof SessionStatusResponses] - -export type SessionDeleteData = { - body?: never - path: { - id: string - } - query?: { - directory?: string - } - url: "/session/{id}" -} - -export type SessionDeleteErrors = { - /** - * Bad request - */ - 400: BadRequestError - /** - * Not found - */ - 404: NotFoundError -} - -export type SessionDeleteError = SessionDeleteErrors[keyof SessionDeleteErrors] - -export type SessionDeleteResponses = { - /** - * Successfully deleted session - */ - 200: boolean -} - -export type SessionDeleteResponse = SessionDeleteResponses[keyof SessionDeleteResponses] - -export type SessionGetData = { - body?: never - path: { - id: string - } - query?: { - directory?: string - } - url: "/session/{id}" -} - -export type SessionGetErrors = { - /** - * Bad request - */ - 400: BadRequestError - /** - * Not found - */ - 404: NotFoundError -} - -export type SessionGetError = SessionGetErrors[keyof SessionGetErrors] - -export type SessionGetResponses = { - /** - * Get session - */ - 200: Session -} - -export type SessionGetResponse = SessionGetResponses[keyof SessionGetResponses] - -export type SessionUpdateData = { - body?: { - title?: string - } - path: { - id: string - } - query?: { - directory?: string - } - url: "/session/{id}" -} - -export type SessionUpdateErrors = { - /** - * Bad request - */ - 400: BadRequestError - /** - * Not found - */ - 404: NotFoundError -} - -export type SessionUpdateError = SessionUpdateErrors[keyof SessionUpdateErrors] - -export type SessionUpdateResponses = { - /** - * Successfully updated session - */ - 200: Session -} - -export type SessionUpdateResponse = SessionUpdateResponses[keyof SessionUpdateResponses] - -export type SessionChildrenData = { - body?: never - path: { - id: string - } - query?: { - directory?: string - } - url: "/session/{id}/children" -} - -export type SessionChildrenErrors = { - /** - * Bad request - */ - 400: BadRequestError - /** - * Not found - */ - 404: NotFoundError -} - -export type SessionChildrenError = SessionChildrenErrors[keyof SessionChildrenErrors] - -export type SessionChildrenResponses = { - /** - * List of children - */ - 200: Array -} - -export type SessionChildrenResponse = SessionChildrenResponses[keyof SessionChildrenResponses] - -export type SessionInitData = { - body?: { - modelID: string - providerID: string - messageID: string - } - path: { - /** - * Session ID - */ - id: string - } - query?: { - directory?: string - } - url: "/session/{id}/init" -} - -export type SessionInitErrors = { - /** - * Bad request - */ - 400: BadRequestError - /** - * Not found - */ - 404: NotFoundError -} - -export type SessionInitError = SessionInitErrors[keyof SessionInitErrors] - -export type SessionInitResponses = { - /** - * 200 - */ - 200: boolean -} - -export type SessionInitResponse = SessionInitResponses[keyof SessionInitResponses] - -export type SessionForkData = { - body?: { - messageID?: string - } - path: { - id: string - } - query?: { - directory?: string - } - url: "/session/{id}/fork" -} - -export type SessionForkResponses = { - /** - * 200 - */ - 200: Session -} - -export type SessionForkResponse = SessionForkResponses[keyof SessionForkResponses] - -export type SessionAbortData = { - body?: never - path: { - id: string - } - query?: { - directory?: string - } - url: "/session/{id}/abort" -} - -export type SessionAbortErrors = { - /** - * Bad request - */ - 400: BadRequestError - /** - * Not found - */ - 404: NotFoundError -} - -export type SessionAbortError = SessionAbortErrors[keyof SessionAbortErrors] - -export type SessionAbortResponses = { - /** - * Aborted session - */ - 200: boolean -} - -export type SessionAbortResponse = SessionAbortResponses[keyof SessionAbortResponses] - -export type SessionUnshareData = { - body?: never - path: { - id: string - } - query?: { - directory?: string - } - url: "/session/{id}/share" -} - -export type SessionUnshareErrors = { - /** - * Bad request - */ - 400: BadRequestError - /** - * Not found - */ - 404: NotFoundError -} - -export type SessionUnshareError = SessionUnshareErrors[keyof SessionUnshareErrors] - -export type SessionUnshareResponses = { - /** - * Successfully unshared session - */ - 200: Session -} - -export type SessionUnshareResponse = SessionUnshareResponses[keyof SessionUnshareResponses] - -export type SessionShareData = { - body?: never - path: { - id: string - } - query?: { - directory?: string - } - url: "/session/{id}/share" -} - -export type SessionShareErrors = { - /** - * Bad request - */ - 400: BadRequestError - /** - * Not found - */ - 404: NotFoundError -} - -export type SessionShareError = SessionShareErrors[keyof SessionShareErrors] - -export type SessionShareResponses = { - /** - * Successfully shared session - */ - 200: Session -} - -export type SessionShareResponse = SessionShareResponses[keyof SessionShareResponses] - -export type SessionDiffData = { - body?: never - path: { - /** - * Session ID - */ - id: string - } - query?: { - directory?: string - messageID?: string - } - url: "/session/{id}/diff" -} - -export type SessionDiffErrors = { - /** - * Bad request - */ - 400: BadRequestError - /** - * Not found - */ - 404: NotFoundError -} - -export type SessionDiffError = SessionDiffErrors[keyof SessionDiffErrors] - -export type SessionDiffResponses = { - /** - * List of diffs - */ - 200: Array -} - -export type SessionDiffResponse = SessionDiffResponses[keyof SessionDiffResponses] - -export type SessionSummarizeData = { - body?: { - providerID: string - modelID: string - } - path: { - /** - * Session ID - */ - id: string - } - query?: { - directory?: string - } - url: "/session/{id}/summarize" -} - -export type SessionSummarizeErrors = { - /** - * Bad request - */ - 400: BadRequestError - /** - * Not found - */ - 404: NotFoundError -} - -export type SessionSummarizeError = SessionSummarizeErrors[keyof SessionSummarizeErrors] - -export type SessionSummarizeResponses = { - /** - * Summarized session - */ - 200: boolean -} - -export type SessionSummarizeResponse = SessionSummarizeResponses[keyof SessionSummarizeResponses] - -export type SessionMessagesData = { - body?: never - path: { - /** - * Session ID - */ - id: string - } - query?: { - directory?: string - limit?: number - } - url: "/session/{id}/message" -} - -export type SessionMessagesErrors = { - /** - * Bad request - */ - 400: BadRequestError - /** - * Not found - */ - 404: NotFoundError -} - -export type SessionMessagesError = SessionMessagesErrors[keyof SessionMessagesErrors] - -export type SessionMessagesResponses = { - /** - * List of messages - */ - 200: Array<{ - info: Message - parts: Array - }> -} - -export type SessionMessagesResponse = SessionMessagesResponses[keyof SessionMessagesResponses] - -export type SessionPromptData = { - body?: { - messageID?: string - model?: { - providerID: string - modelID: string - } - agent?: string - noReply?: boolean - system?: string - tools?: { - [key: string]: boolean - } - parts: Array - } - path: { - /** - * Session ID - */ - id: string - } - query?: { - directory?: string - } - url: "/session/{id}/message" -} - -export type SessionPromptErrors = { - /** - * Bad request - */ - 400: BadRequestError - /** - * Not found - */ - 404: NotFoundError -} - -export type SessionPromptError = SessionPromptErrors[keyof SessionPromptErrors] - -export type SessionPromptResponses = { - /** - * Created message - */ - 200: { - info: AssistantMessage - parts: Array - } -} - -export type SessionPromptResponse = SessionPromptResponses[keyof SessionPromptResponses] - -export type SessionMessageData = { - body?: never - path: { - /** - * Session ID - */ - id: string - /** - * Message ID - */ - messageID: string - } - query?: { - directory?: string - } - url: "/session/{id}/message/{messageID}" -} - -export type SessionMessageErrors = { - /** - * Bad request - */ - 400: BadRequestError - /** - * Not found - */ - 404: NotFoundError -} - -export type SessionMessageError = SessionMessageErrors[keyof SessionMessageErrors] - -export type SessionMessageResponses = { - /** - * Message - */ - 200: { - info: Message - parts: Array - } -} - -export type SessionMessageResponse = SessionMessageResponses[keyof SessionMessageResponses] - -export type SessionPromptAsyncData = { - body?: { - messageID?: string - model?: { - providerID: string - modelID: string - } - agent?: string - noReply?: boolean - system?: string - tools?: { - [key: string]: boolean - } - parts: Array - } - path: { - /** - * Session ID - */ - id: string - } - query?: { - directory?: string - } - url: "/session/{id}/prompt_async" -} - -export type SessionPromptAsyncErrors = { - /** - * Bad request - */ - 400: BadRequestError - /** - * Not found - */ - 404: NotFoundError -} - -export type SessionPromptAsyncError = SessionPromptAsyncErrors[keyof SessionPromptAsyncErrors] - -export type SessionPromptAsyncResponses = { - /** - * Prompt accepted - */ - 204: void -} - -export type SessionPromptAsyncResponse = SessionPromptAsyncResponses[keyof SessionPromptAsyncResponses] - -export type SessionCommandData = { - body?: { - messageID?: string - agent?: string - model?: string - arguments: string - command: string - } - path: { - /** - * Session ID - */ - id: string - } - query?: { - directory?: string - } - url: "/session/{id}/command" -} - -export type SessionCommandErrors = { - /** - * Bad request - */ - 400: BadRequestError - /** - * Not found - */ - 404: NotFoundError -} - -export type SessionCommandError = SessionCommandErrors[keyof SessionCommandErrors] - -export type SessionCommandResponses = { - /** - * Created message - */ - 200: { - info: AssistantMessage - parts: Array - } -} - -export type SessionCommandResponse = SessionCommandResponses[keyof SessionCommandResponses] - -export type SessionShellData = { - body?: { - agent: string - model?: { - providerID: string - modelID: string - } - command: string - } - path: { - /** - * Session ID - */ - id: string - } - query?: { - directory?: string - } - url: "/session/{id}/shell" -} - -export type SessionShellErrors = { - /** - * Bad request - */ - 400: BadRequestError - /** - * Not found - */ - 404: NotFoundError -} - -export type SessionShellError = SessionShellErrors[keyof SessionShellErrors] - -export type SessionShellResponses = { - /** - * Created message - */ - 200: AssistantMessage -} - -export type SessionShellResponse = SessionShellResponses[keyof SessionShellResponses] - -export type SessionRevertData = { - body?: { - messageID: string - partID?: string - } - path: { - id: string - } - query?: { - directory?: string - } - url: "/session/{id}/revert" -} - -export type SessionRevertErrors = { - /** - * Bad request - */ - 400: BadRequestError - /** - * Not found - */ - 404: NotFoundError -} - -export type SessionRevertError = SessionRevertErrors[keyof SessionRevertErrors] - -export type SessionRevertResponses = { - /** - * Updated session - */ - 200: Session -} - -export type SessionRevertResponse = SessionRevertResponses[keyof SessionRevertResponses] - -export type SessionUnrevertData = { - body?: never - path: { - id: string - } - query?: { - directory?: string - } - url: "/session/{id}/unrevert" -} - -export type SessionUnrevertErrors = { - /** - * Bad request - */ - 400: BadRequestError - /** - * Not found - */ - 404: NotFoundError -} - -export type SessionUnrevertError = SessionUnrevertErrors[keyof SessionUnrevertErrors] - -export type SessionUnrevertResponses = { - /** - * Updated session - */ - 200: Session -} - -export type SessionUnrevertResponse = SessionUnrevertResponses[keyof SessionUnrevertResponses] - -export type PostSessionIdPermissionsPermissionIdData = { - body?: { - response: "once" | "always" | "reject" - } - path: { - id: string - permissionID: string - } - query?: { - directory?: string - } - url: "/session/{id}/permissions/{permissionID}" -} - -export type PostSessionIdPermissionsPermissionIdErrors = { - /** - * Bad request - */ - 400: BadRequestError - /** - * Not found - */ - 404: NotFoundError -} - -export type PostSessionIdPermissionsPermissionIdError = - PostSessionIdPermissionsPermissionIdErrors[keyof PostSessionIdPermissionsPermissionIdErrors] - -export type PostSessionIdPermissionsPermissionIdResponses = { - /** - * Permission processed successfully - */ - 200: boolean -} - -export type PostSessionIdPermissionsPermissionIdResponse = - PostSessionIdPermissionsPermissionIdResponses[keyof PostSessionIdPermissionsPermissionIdResponses] - -export type CommandListData = { - body?: never - path?: never - query?: { - directory?: string - } - url: "/command" -} - -export type CommandListResponses = { - /** - * List of commands - */ - 200: Array -} - -export type CommandListResponse = CommandListResponses[keyof CommandListResponses] - -export type ConfigProvidersData = { - body?: never - path?: never - query?: { - directory?: string - } - url: "/config/providers" -} - -export type ConfigProvidersResponses = { - /** - * List of providers - */ - 200: { - providers: Array - default: { - [key: string]: string - } - } -} - -export type ConfigProvidersResponse = ConfigProvidersResponses[keyof ConfigProvidersResponses] - -export type ProviderListData = { - body?: never - path?: never - query?: { - directory?: string - } - url: "/provider" -} - -export type ProviderListResponses = { - /** - * List of providers - */ - 200: { - all: Array<{ - api?: string - name: string - env: Array - id: string - npm?: string - models: { - [key: string]: { - id: string - name: string - release_date: string - attachment: boolean - reasoning: boolean - temperature: boolean - tool_call: boolean - cost?: { - input: number - output: number - cache_read?: number - cache_write?: number - context_over_200k?: { - input: number - output: number - cache_read?: number - cache_write?: number - } - } - limit: { - context: number - output: number - } - modalities?: { - input: Array<"text" | "audio" | "image" | "video" | "pdf"> - output: Array<"text" | "audio" | "image" | "video" | "pdf"> - } - experimental?: boolean - status?: "alpha" | "beta" | "deprecated" | "active" - options: { - [key: string]: unknown - } - headers?: { - [key: string]: string - } - provider?: { - npm: string - } - } - } - }> - default: { - [key: string]: string - } - connected: Array - } -} - -export type ProviderListResponse = ProviderListResponses[keyof ProviderListResponses] - -export type ProviderAuthData = { - body?: never - path?: never - query?: { - directory?: string - } - url: "/provider/auth" -} - -export type ProviderAuthResponses = { - /** - * Provider auth methods - */ - 200: { - [key: string]: Array - } -} - -export type ProviderAuthResponse = ProviderAuthResponses[keyof ProviderAuthResponses] - -export type ProviderOauthAuthorizeData = { - body?: { - /** - * Auth method index - */ - method: number - } - path: { - /** - * Provider ID - */ - id: string - } - query?: { - directory?: string - } - url: "/provider/{id}/oauth/authorize" -} - -export type ProviderOauthAuthorizeErrors = { - /** - * Bad request - */ - 400: BadRequestError -} - -export type ProviderOauthAuthorizeError = ProviderOauthAuthorizeErrors[keyof ProviderOauthAuthorizeErrors] - -export type ProviderOauthAuthorizeResponses = { - /** - * Authorization URL and method - */ - 200: ProviderAuthAuthorization -} - -export type ProviderOauthAuthorizeResponse = ProviderOauthAuthorizeResponses[keyof ProviderOauthAuthorizeResponses] - -export type ProviderOauthCallbackData = { - body?: { - /** - * Auth method index - */ - method: number - /** - * OAuth authorization code - */ - code?: string - } - path: { - /** - * Provider ID - */ - id: string - } - query?: { - directory?: string - } - url: "/provider/{id}/oauth/callback" -} - -export type ProviderOauthCallbackErrors = { - /** - * Bad request - */ - 400: BadRequestError -} - -export type ProviderOauthCallbackError = ProviderOauthCallbackErrors[keyof ProviderOauthCallbackErrors] - -export type ProviderOauthCallbackResponses = { - /** - * OAuth callback processed successfully - */ - 200: boolean -} - -export type ProviderOauthCallbackResponse = ProviderOauthCallbackResponses[keyof ProviderOauthCallbackResponses] - -export type FindTextData = { - body?: never - path?: never - query: { - directory?: string - pattern: string - } - url: "/find" -} - -export type FindTextResponses = { - /** - * Matches - */ - 200: Array<{ - path: { - text: string - } - lines: { - text: string - } - line_number: number - absolute_offset: number - submatches: Array<{ - match: { - text: string - } - start: number - end: number - }> - }> -} - -export type FindTextResponse = FindTextResponses[keyof FindTextResponses] - -export type FindFilesData = { - body?: never - path?: never - query: { - directory?: string - query: string - dirs?: "true" | "false" - } - url: "/find/file" -} - -export type FindFilesResponses = { - /** - * File paths - */ - 200: Array -} - -export type FindFilesResponse = FindFilesResponses[keyof FindFilesResponses] - -export type FindSymbolsData = { - body?: never - path?: never - query: { - directory?: string - query: string - } - url: "/find/symbol" -} - -export type FindSymbolsResponses = { - /** - * Symbols - */ - 200: Array -} - -export type FindSymbolsResponse = FindSymbolsResponses[keyof FindSymbolsResponses] - -export type FileListData = { - body?: never - path?: never - query: { - directory?: string - path: string - } - url: "/file" -} - -export type FileListResponses = { - /** - * Files and directories - */ - 200: Array -} - -export type FileListResponse = FileListResponses[keyof FileListResponses] - -export type FileReadData = { - body?: never - path?: never - query: { - directory?: string - path: string - } - url: "/file/content" -} - -export type FileReadResponses = { - /** - * File content - */ - 200: FileContent -} - -export type FileReadResponse = FileReadResponses[keyof FileReadResponses] - -export type FileStatusData = { - body?: never - path?: never - query?: { - directory?: string - } - url: "/file/status" -} - -export type FileStatusResponses = { - /** - * File status - */ - 200: Array -} - -export type FileStatusResponse = FileStatusResponses[keyof FileStatusResponses] - -export type AppLogData = { - body?: { - /** - * Service name for the log entry - */ - service: string - /** - * Log level - */ - level: "debug" | "info" | "error" | "warn" - /** - * Log message - */ - message: string - /** - * Additional metadata for the log entry - */ - extra?: { - [key: string]: unknown - } - } - path?: never - query?: { - directory?: string - } - url: "/log" -} - -export type AppLogErrors = { - /** - * Bad request - */ - 400: BadRequestError -} - -export type AppLogError = AppLogErrors[keyof AppLogErrors] - -export type AppLogResponses = { - /** - * Log entry written successfully - */ - 200: boolean -} - -export type AppLogResponse = AppLogResponses[keyof AppLogResponses] - -export type AppAgentsData = { - body?: never - path?: never - query?: { - directory?: string - } - url: "/agent" -} - -export type AppAgentsResponses = { - /** - * List of agents - */ - 200: Array -} - -export type AppAgentsResponse = AppAgentsResponses[keyof AppAgentsResponses] - -export type McpStatusData = { - body?: never - path?: never - query?: { - directory?: string - } - url: "/mcp" -} - -export type McpStatusResponses = { - /** - * MCP server status - */ - 200: { - [key: string]: McpStatus - } -} - -export type McpStatusResponse = McpStatusResponses[keyof McpStatusResponses] - -export type McpAddData = { - body?: { - name: string - config: McpLocalConfig | McpRemoteConfig - } - path?: never - query?: { - directory?: string - } - url: "/mcp" -} - -export type McpAddErrors = { - /** - * Bad request - */ - 400: BadRequestError -} - -export type McpAddError = McpAddErrors[keyof McpAddErrors] - -export type McpAddResponses = { - /** - * MCP server added successfully - */ - 200: { - [key: string]: McpStatus - } -} - -export type McpAddResponse = McpAddResponses[keyof McpAddResponses] - -export type McpAuthRemoveData = { - body?: never - path: { - name: string - } - query?: { - directory?: string - } - url: "/mcp/{name}/auth" -} - -export type McpAuthRemoveErrors = { - /** - * Not found - */ - 404: NotFoundError -} - -export type McpAuthRemoveError = McpAuthRemoveErrors[keyof McpAuthRemoveErrors] - -export type McpAuthRemoveResponses = { - /** - * OAuth credentials removed - */ - 200: { - success: true - } -} - -export type McpAuthRemoveResponse = McpAuthRemoveResponses[keyof McpAuthRemoveResponses] - -export type McpAuthStartData = { - body?: never - path: { - name: string - } - query?: { - directory?: string - } - url: "/mcp/{name}/auth" -} - -export type McpAuthStartErrors = { - /** - * Bad request - */ - 400: BadRequestError - /** - * Not found - */ - 404: NotFoundError -} - -export type McpAuthStartError = McpAuthStartErrors[keyof McpAuthStartErrors] - -export type McpAuthStartResponses = { - /** - * OAuth flow started - */ - 200: { - /** - * URL to open in browser for authorization - */ - authorizationUrl: string - } -} - -export type McpAuthStartResponse = McpAuthStartResponses[keyof McpAuthStartResponses] - -export type McpAuthCallbackData = { - body?: { - /** - * Authorization code from OAuth callback - */ - code: string - } - path: { - name: string - } - query?: { - directory?: string - } - url: "/mcp/{name}/auth/callback" -} - -export type McpAuthCallbackErrors = { - /** - * Bad request - */ - 400: BadRequestError - /** - * Not found - */ - 404: NotFoundError -} - -export type McpAuthCallbackError = McpAuthCallbackErrors[keyof McpAuthCallbackErrors] - -export type McpAuthCallbackResponses = { - /** - * OAuth authentication completed - */ - 200: McpStatus -} - -export type McpAuthCallbackResponse = McpAuthCallbackResponses[keyof McpAuthCallbackResponses] - -export type McpAuthAuthenticateData = { - body?: never - path: { - name: string - } - query?: { - directory?: string - } - url: "/mcp/{name}/auth/authenticate" -} - -export type McpAuthAuthenticateErrors = { - /** - * Bad request - */ - 400: BadRequestError - /** - * Not found - */ - 404: NotFoundError -} - -export type McpAuthAuthenticateError = McpAuthAuthenticateErrors[keyof McpAuthAuthenticateErrors] - -export type McpAuthAuthenticateResponses = { - /** - * OAuth authentication completed - */ - 200: McpStatus -} - -export type McpAuthAuthenticateResponse = McpAuthAuthenticateResponses[keyof McpAuthAuthenticateResponses] - -export type McpConnectData = { - body?: never - path: { - name: string - } - query?: { - directory?: string - } - url: "/mcp/{name}/connect" -} - -export type McpConnectResponses = { - /** - * MCP server connected successfully - */ - 200: boolean -} - -export type McpConnectResponse = McpConnectResponses[keyof McpConnectResponses] - -export type McpDisconnectData = { - body?: never - path: { - name: string - } - query?: { - directory?: string - } - url: "/mcp/{name}/disconnect" -} - -export type McpDisconnectResponses = { - /** - * MCP server disconnected successfully - */ - 200: boolean -} - -export type McpDisconnectResponse = McpDisconnectResponses[keyof McpDisconnectResponses] - -export type LspStatusData = { - body?: never - path?: never - query?: { - directory?: string - } - url: "/lsp" -} - -export type LspStatusResponses = { - /** - * LSP server status - */ - 200: Array -} - -export type LspStatusResponse = LspStatusResponses[keyof LspStatusResponses] - -export type FormatterStatusData = { - body?: never - path?: never - query?: { - directory?: string - } - url: "/formatter" -} - -export type FormatterStatusResponses = { - /** - * Formatter status - */ - 200: Array -} - -export type FormatterStatusResponse = FormatterStatusResponses[keyof FormatterStatusResponses] - -export type TuiAppendPromptData = { - body?: { - text: string - } - path?: never - query?: { - directory?: string - } - url: "/tui/append-prompt" -} - -export type TuiAppendPromptErrors = { - /** - * Bad request - */ - 400: BadRequestError -} - -export type TuiAppendPromptError = TuiAppendPromptErrors[keyof TuiAppendPromptErrors] - -export type TuiAppendPromptResponses = { - /** - * Prompt processed successfully - */ - 200: boolean -} - -export type TuiAppendPromptResponse = TuiAppendPromptResponses[keyof TuiAppendPromptResponses] - -export type TuiOpenHelpData = { - body?: never - path?: never - query?: { - directory?: string - } - url: "/tui/open-help" -} - -export type TuiOpenHelpResponses = { - /** - * Help dialog opened successfully - */ - 200: boolean -} - -export type TuiOpenHelpResponse = TuiOpenHelpResponses[keyof TuiOpenHelpResponses] - -export type TuiOpenSessionsData = { - body?: never - path?: never - query?: { - directory?: string - } - url: "/tui/open-sessions" -} - -export type TuiOpenSessionsResponses = { - /** - * Session dialog opened successfully - */ - 200: boolean -} - -export type TuiOpenSessionsResponse = TuiOpenSessionsResponses[keyof TuiOpenSessionsResponses] - -export type TuiOpenThemesData = { - body?: never - path?: never - query?: { - directory?: string - } - url: "/tui/open-themes" -} - -export type TuiOpenThemesResponses = { - /** - * Theme dialog opened successfully - */ - 200: boolean -} - -export type TuiOpenThemesResponse = TuiOpenThemesResponses[keyof TuiOpenThemesResponses] - -export type TuiOpenModelsData = { - body?: never - path?: never - query?: { - directory?: string - } - url: "/tui/open-models" -} - -export type TuiOpenModelsResponses = { - /** - * Model dialog opened successfully - */ - 200: boolean -} - -export type TuiOpenModelsResponse = TuiOpenModelsResponses[keyof TuiOpenModelsResponses] - -export type TuiSubmitPromptData = { - body?: never - path?: never - query?: { - directory?: string - } - url: "/tui/submit-prompt" -} - -export type TuiSubmitPromptResponses = { - /** - * Prompt submitted successfully - */ - 200: boolean -} - -export type TuiSubmitPromptResponse = TuiSubmitPromptResponses[keyof TuiSubmitPromptResponses] - -export type TuiClearPromptData = { - body?: never - path?: never - query?: { - directory?: string - } - url: "/tui/clear-prompt" -} - -export type TuiClearPromptResponses = { - /** - * Prompt cleared successfully - */ - 200: boolean -} - -export type TuiClearPromptResponse = TuiClearPromptResponses[keyof TuiClearPromptResponses] - -export type TuiExecuteCommandData = { - body?: { - command: string - } - path?: never - query?: { - directory?: string - } - url: "/tui/execute-command" -} - -export type TuiExecuteCommandErrors = { - /** - * Bad request - */ - 400: BadRequestError -} - -export type TuiExecuteCommandError = TuiExecuteCommandErrors[keyof TuiExecuteCommandErrors] - -export type TuiExecuteCommandResponses = { - /** - * Command executed successfully - */ - 200: boolean -} - -export type TuiExecuteCommandResponse = TuiExecuteCommandResponses[keyof TuiExecuteCommandResponses] - -export type TuiShowToastData = { - body?: { - title?: string - message: string - variant: "info" | "success" | "warning" | "error" - /** - * Duration in milliseconds - */ - duration?: number - } - path?: never - query?: { - directory?: string - } - url: "/tui/show-toast" -} - -export type TuiShowToastResponses = { - /** - * Toast notification shown successfully - */ - 200: boolean -} - -export type TuiShowToastResponse = TuiShowToastResponses[keyof TuiShowToastResponses] - -export type TuiPublishData = { - body?: EventTuiPromptAppend | EventTuiCommandExecute | EventTuiToastShow - path?: never - query?: { - directory?: string - } - url: "/tui/publish" -} - -export type TuiPublishErrors = { - /** - * Bad request - */ - 400: BadRequestError -} - -export type TuiPublishError = TuiPublishErrors[keyof TuiPublishErrors] - -export type TuiPublishResponses = { - /** - * Event published successfully - */ - 200: boolean -} - -export type TuiPublishResponse = TuiPublishResponses[keyof TuiPublishResponses] - -export type TuiControlNextData = { - body?: never - path?: never - query?: { - directory?: string - } - url: "/tui/control/next" -} - -export type TuiControlNextResponses = { - /** - * Next TUI request - */ - 200: { - path: string - body: unknown - } -} - -export type TuiControlNextResponse = TuiControlNextResponses[keyof TuiControlNextResponses] - -export type TuiControlResponseData = { - body?: unknown - path?: never - query?: { - directory?: string - } - url: "/tui/control/response" -} - -export type TuiControlResponseResponses = { - /** - * Response submitted successfully - */ - 200: boolean -} - -export type TuiControlResponseResponse = TuiControlResponseResponses[keyof TuiControlResponseResponses] - -export type AuthSetData = { - body?: Auth - path: { - id: string - } - query?: { - directory?: string - } - url: "/auth/{id}" -} - -export type AuthSetErrors = { - /** - * Bad request - */ - 400: BadRequestError -} - -export type AuthSetError = AuthSetErrors[keyof AuthSetErrors] - -export type AuthSetResponses = { - /** - * Successfully set authentication credentials - */ - 200: boolean -} - -export type AuthSetResponse = AuthSetResponses[keyof AuthSetResponses] - -export type EventSubscribeData = { - body?: never - path?: never - query?: { - directory?: string - } - url: "/event" -} - -export type EventSubscribeResponses = { - /** - * Event stream - */ - 200: Event -} - -export type EventSubscribeResponse = EventSubscribeResponses[keyof EventSubscribeResponses] - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}) -} diff --git a/packages/sdk/js/src/index.ts b/packages/sdk/js/src/index.ts deleted file mode 100644 index d044f5ad66..0000000000 --- a/packages/sdk/js/src/index.ts +++ /dev/null @@ -1,21 +0,0 @@ -export * from "./client.js" -export * from "./server.js" - -import { createOpencodeClient } from "./client.js" -import { createOpencodeServer } from "./server.js" -import type { ServerOptions } from "./server.js" - -export async function createOpencode(options?: ServerOptions) { - const server = await createOpencodeServer({ - ...options, - }) - - const client = createOpencodeClient({ - baseUrl: server.url, - }) - - return { - client, - server, - } -} diff --git a/packages/sdk/js/src/process.ts b/packages/sdk/js/src/process.ts deleted file mode 100644 index 3111b424aa..0000000000 --- a/packages/sdk/js/src/process.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { type ChildProcess, spawnSync } from "node:child_process" - -// Duplicated from `packages/opencode/src/util/process.ts` because the SDK cannot -// import `opencode` without creating a cycle (`opencode` depends on `@opencode-ai/sdk`). -export function stop(proc: ChildProcess) { - if (proc.exitCode !== null || proc.signalCode !== null) return - if (process.platform === "win32" && proc.pid) { - const out = spawnSync("taskkill", ["/pid", String(proc.pid), "/T", "/F"], { windowsHide: true }) - if (!out.error && out.status === 0) return - } - proc.kill() -} - -export function bindAbort(proc: ChildProcess, signal?: AbortSignal, onAbort?: () => void) { - if (!signal) return () => {} - const abort = () => { - clear() - stop(proc) - onAbort?.() - } - const clear = () => { - signal.removeEventListener("abort", abort) - proc.off("exit", clear) - proc.off("error", clear) - } - signal.addEventListener("abort", abort, { once: true }) - proc.on("exit", clear) - proc.on("error", clear) - if (signal.aborted) abort() - return clear -} diff --git a/packages/sdk/js/src/server.ts b/packages/sdk/js/src/server.ts deleted file mode 100644 index 2d1ab29fc9..0000000000 --- a/packages/sdk/js/src/server.ts +++ /dev/null @@ -1,134 +0,0 @@ -import launch from "cross-spawn" -import { type Config } from "./gen/types.gen.js" -import { stop, bindAbort } from "./process.js" - -export type ServerOptions = { - hostname?: string - port?: number - signal?: AbortSignal - timeout?: number - config?: Config -} - -export type TuiOptions = { - project?: string - model?: string - session?: string - agent?: string - signal?: AbortSignal - config?: Config -} - -export async function createOpencodeServer(options?: ServerOptions) { - options = Object.assign( - { - hostname: "127.0.0.1", - port: 4096, - timeout: 5000, - }, - options ?? {}, - ) - - const args = [`serve`, `--hostname=${options.hostname}`, `--port=${options.port}`] - if (options.config?.logLevel) args.push(`--log-level=${options.config.logLevel}`) - - const proc = launch(`opencode`, args, { - env: { - ...process.env, - OPENCODE_CONFIG_CONTENT: JSON.stringify(options.config ?? {}), - }, - }) - let clear = () => {} - - const url = await new Promise((resolve, reject) => { - const id = setTimeout(() => { - clear() - stop(proc) - reject(new Error(`Timeout waiting for server to start after ${options.timeout}ms`)) - }, options.timeout) - let output = "" - let resolved = false - proc.stdout?.on("data", (chunk) => { - if (resolved) return - output += chunk.toString() - const lines = output.split("\n") - for (const line of lines) { - if (line.startsWith("opencode server listening")) { - const match = line.match(/on\s+(https?:\/\/[^\s]+)/) - if (!match) { - clear() - stop(proc) - clearTimeout(id) - reject(new Error(`Failed to parse server url from output: ${line}`)) - return - } - clearTimeout(id) - resolved = true - resolve(match[1]!) - return - } - } - }) - proc.stderr?.on("data", (chunk) => { - output += chunk.toString() - }) - proc.on("exit", (code) => { - clearTimeout(id) - let msg = `Server exited with code ${code}` - if (output.trim()) { - msg += `\nServer output: ${output}` - } - reject(new Error(msg)) - }) - proc.on("error", (error) => { - clearTimeout(id) - reject(error) - }) - clear = bindAbort(proc, options.signal, () => { - clearTimeout(id) - reject(options.signal?.reason) - }) - }) - - return { - url, - close() { - clear() - stop(proc) - }, - } -} - -export function createOpencodeTui(options?: TuiOptions) { - const args = [] - - if (options?.project) { - args.push(`--project=${options.project}`) - } - if (options?.model) { - args.push(`--model=${options.model}`) - } - if (options?.session) { - args.push(`--session=${options.session}`) - } - if (options?.agent) { - args.push(`--agent=${options.agent}`) - } - - const proc = launch(`opencode`, args, { - stdio: "inherit", - env: { - ...process.env, - OPENCODE_CONFIG_CONTENT: JSON.stringify(options?.config ?? {}), - }, - }) - - const clear = bindAbort(proc, options?.signal) - - return { - close() { - clear() - stop(proc) - }, - } -} diff --git a/packages/sdk/js/src/v2/client.ts b/packages/sdk/js/src/v2/client.ts deleted file mode 100644 index bd8f984d7f..0000000000 --- a/packages/sdk/js/src/v2/client.ts +++ /dev/null @@ -1,97 +0,0 @@ -export * from "./gen/types.gen.js" -export type { FileSystemEntry as LocationFileSystemEntry } from "./gen/types.gen.js" -import type { UserMessage } from "./gen/types.gen.js" - -/** @deprecated V1 snapshot compatibility. Use FileDiffInfo for current API responses. */ -export type SnapshotFileDiff = NonNullable["diffs"]>[number] - -import { createClient } from "./gen/client/client.gen.js" -import { type Config } from "./gen/client/types.gen.js" -import { OpencodeClient } from "./gen/sdk.gen.js" -import { wrapClientError } from "../error-interceptor.js" -export { type Config as OpencodeClientConfig, OpencodeClient } - -function pick(value: string | null, fallback?: string, encode?: (value: string) => string) { - if (!value) return - if (!fallback) return value - if (value === fallback) return fallback - if (encode && value === encode(fallback)) return fallback - return value -} - -function rewrite(request: Request, values: { directory?: string; workspace?: string }) { - if (request.method !== "GET" && request.method !== "HEAD") return request - - const url = new URL(request.url) - let changed = false - - for (const [name, key] of [ - ["x-opencode-directory", "directory"], - ["x-opencode-workspace", "workspace"], - ] as const) { - const value = pick( - request.headers.get(name), - key === "directory" ? values.directory : values.workspace, - key === "directory" ? encodeURIComponent : undefined, - ) - if (!value) continue - for (const query of url.pathname.startsWith("/api/") ? [key, `location[${key}]`] : [key]) { - if (!url.searchParams.has(query)) { - url.searchParams.set(query, value) - } - } - changed = true - } - - if (!changed) return request - - const next = new Request(url, request) - next.headers.delete("x-opencode-directory") - next.headers.delete("x-opencode-workspace") - return next -} - -export function createOpencodeClient(config?: Config & { directory?: string; experimental_workspaceID?: string }) { - if (!config?.fetch) { - const customFetch: any = (req: any) => { - // @ts-ignore - req.timeout = false - return fetch(req) - } - config = { - ...config, - fetch: customFetch, - } - } - - if (config?.directory) { - config.headers = { - ...config.headers, - "x-opencode-directory": encodeURIComponent(config.directory), - } - } - - if (config?.experimental_workspaceID) { - config.headers = { - ...config.headers, - "x-opencode-workspace": config.experimental_workspaceID, - } - } - - const client = createClient(config) - client.interceptors.request.use((request) => - rewrite(request, { - directory: config?.directory, - workspace: config?.experimental_workspaceID, - }), - ) - client.interceptors.response.use((response) => { - const contentType = response.headers.get("content-type") - if (contentType === "text/html") - throw new Error("Request is not supported by this version of OpenCode Server (Server responded with text/html)") - - return response - }) - client.interceptors.error.use(wrapClientError) - return new OpencodeClient({ client }) -} diff --git a/packages/sdk/js/src/v2/data.ts b/packages/sdk/js/src/v2/data.ts deleted file mode 100644 index 776b168ad9..0000000000 --- a/packages/sdk/js/src/v2/data.ts +++ /dev/null @@ -1,32 +0,0 @@ -import type { Part, UserMessage } from "./client.js" - -export const message = { - user(input: Omit & { parts: Omit[] }): { - info: UserMessage - parts: Part[] - } { - const { parts: _parts, ...rest } = input - - const info: UserMessage = { - ...rest, - id: "asdasd", - time: { - created: Date.now(), - }, - role: "user", - } - - return { - info, - parts: input.parts.map( - (part) => - ({ - ...part, - id: "asdasd", - messageID: info.id, - sessionID: info.sessionID, - }) as Part, - ), - } - }, -} diff --git a/packages/sdk/js/src/v2/gen/client.gen.ts b/packages/sdk/js/src/v2/gen/client.gen.ts deleted file mode 100644 index 0c110eca39..0000000000 --- a/packages/sdk/js/src/v2/gen/client.gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { type ClientOptions, type Config, createClient, createConfig } from "./client/index.js" -import type { ClientOptions as ClientOptions2 } from "./types.gen.js" - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = ( - override?: Config, -) => Config & T> - -export const client = createClient(createConfig({ baseUrl: "http://localhost:4096" })) diff --git a/packages/sdk/js/src/v2/gen/client/client.gen.ts b/packages/sdk/js/src/v2/gen/client/client.gen.ts deleted file mode 100644 index 627e98ec42..0000000000 --- a/packages/sdk/js/src/v2/gen/client/client.gen.ts +++ /dev/null @@ -1,285 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { createSseClient } from "../core/serverSentEvents.gen.js" -import type { HttpMethod } from "../core/types.gen.js" -import { getValidRequestBody } from "../core/utils.gen.js" -import type { Client, Config, RequestOptions, ResolvedRequestOptions } from "./types.gen.js" -import { - buildUrl, - createConfig, - createInterceptors, - getParseAs, - mergeConfigs, - mergeHeaders, - setAuthParams, -} from "./utils.gen.js" - -type ReqInit = Omit & { - body?: any - headers: ReturnType -} - -export const createClient = (config: Config = {}): Client => { - let _config = mergeConfigs(createConfig(), config) - - const getConfig = (): Config => ({ ..._config }) - - const setConfig = (config: Config): Config => { - _config = mergeConfigs(_config, config) - return getConfig() - } - - const interceptors = createInterceptors() - - const beforeRequest = async (options: RequestOptions) => { - const opts = { - ..._config, - ...options, - fetch: options.fetch ?? _config.fetch ?? globalThis.fetch, - headers: mergeHeaders(_config.headers, options.headers), - serializedBody: undefined, - } - - if (opts.security) { - await setAuthParams({ - ...opts, - security: opts.security, - }) - } - - if (opts.requestValidator) { - await opts.requestValidator(opts) - } - - if (opts.body !== undefined && opts.bodySerializer) { - opts.serializedBody = opts.bodySerializer(opts.body) - } - - // remove Content-Type header if body is empty to avoid sending invalid requests - if (opts.body === undefined || opts.serializedBody === "") { - opts.headers.delete("Content-Type") - } - - const url = buildUrl(opts) - - return { opts, url } - } - - const request: Client["request"] = async (options) => { - // @ts-expect-error - const { opts, url } = await beforeRequest(options) - const requestInit: ReqInit = { - redirect: "follow", - ...opts, - body: getValidRequestBody(opts), - } - - let request = new Request(url, requestInit) - - for (const fn of interceptors.request.fns) { - if (fn) { - request = await fn(request, opts) - } - } - - // fetch must be assigned here, otherwise it would throw the error: - // TypeError: Failed to execute 'fetch' on 'Window': Illegal invocation - const _fetch = opts.fetch! - let response: Response - - try { - response = await _fetch(request) - } catch (error) { - // Handle fetch exceptions (AbortError, network errors, etc.) - let finalError = error - - for (const fn of interceptors.error.fns) { - if (fn) { - finalError = (await fn(error, undefined as any, request, opts)) as unknown - } - } - - finalError = finalError || ({} as unknown) - - if (opts.throwOnError) { - throw finalError - } - - // Return error response - return opts.responseStyle === "data" - ? undefined - : { - error: finalError, - request, - response: undefined as any, - } - } - - for (const fn of interceptors.response.fns) { - if (fn) { - response = await fn(response, request, opts) - } - } - - const result = { - request, - response, - } - - if (response.ok) { - const parseAs = - (opts.parseAs === "auto" ? getParseAs(response.headers.get("Content-Type")) : opts.parseAs) ?? "json" - - if (response.status === 204 || response.headers.get("Content-Length") === "0") { - let emptyData: any - switch (parseAs) { - case "arrayBuffer": - case "blob": - case "text": - emptyData = await response[parseAs]() - break - case "formData": - emptyData = new FormData() - break - case "stream": - emptyData = response.body - break - case "json": - default: - emptyData = {} - break - } - return opts.responseStyle === "data" - ? emptyData - : { - data: emptyData, - ...result, - } - } - - let data: any - switch (parseAs) { - case "arrayBuffer": - case "blob": - case "formData": - case "text": - data = await response[parseAs]() - break - case "json": { - // Some servers return 200 with no Content-Length and empty body. - // response.json() would throw; read as text and parse if non-empty. - const text = await response.text() - data = text ? JSON.parse(text) : {} - break - } - case "stream": - return opts.responseStyle === "data" - ? response.body - : { - data: response.body, - ...result, - } - } - - if (parseAs === "json") { - if (opts.responseValidator) { - await opts.responseValidator(data) - } - - if (opts.responseTransformer) { - data = await opts.responseTransformer(data) - } - } - - return opts.responseStyle === "data" - ? data - : { - data, - ...result, - } - } - - const textError = await response.text() - let jsonError: unknown - - try { - jsonError = JSON.parse(textError) - } catch { - // noop - } - - const error = jsonError ?? textError - let finalError = error - - for (const fn of interceptors.error.fns) { - if (fn) { - finalError = (await fn(error, response, request, opts)) as string - } - } - - finalError = finalError || ({} as string) - - if (opts.throwOnError) { - throw finalError - } - - // TODO: we probably want to return error and improve types - return opts.responseStyle === "data" - ? undefined - : { - error: finalError, - ...result, - } - } - - const makeMethodFn = (method: Uppercase) => (options: RequestOptions) => request({ ...options, method }) - - const makeSseFn = (method: Uppercase) => async (options: RequestOptions) => { - const { opts, url } = await beforeRequest(options) - return createSseClient({ - ...opts, - body: opts.body as BodyInit | null | undefined, - headers: opts.headers as unknown as Record, - method, - onRequest: async (url, init) => { - let request = new Request(url, init) - for (const fn of interceptors.request.fns) { - if (fn) { - request = await fn(request, opts) - } - } - return request - }, - serializedBody: getValidRequestBody(opts) as BodyInit | null | undefined, - url, - }) - } - - return { - buildUrl, - connect: makeMethodFn("CONNECT"), - delete: makeMethodFn("DELETE"), - get: makeMethodFn("GET"), - getConfig, - head: makeMethodFn("HEAD"), - interceptors, - options: makeMethodFn("OPTIONS"), - patch: makeMethodFn("PATCH"), - post: makeMethodFn("POST"), - put: makeMethodFn("PUT"), - request, - setConfig, - sse: { - connect: makeSseFn("CONNECT"), - delete: makeSseFn("DELETE"), - get: makeSseFn("GET"), - head: makeSseFn("HEAD"), - options: makeSseFn("OPTIONS"), - patch: makeSseFn("PATCH"), - post: makeSseFn("POST"), - put: makeSseFn("PUT"), - trace: makeSseFn("TRACE"), - }, - trace: makeMethodFn("TRACE"), - } as Client -} diff --git a/packages/sdk/js/src/v2/gen/client/index.ts b/packages/sdk/js/src/v2/gen/client/index.ts deleted file mode 100644 index 0af63f3300..0000000000 --- a/packages/sdk/js/src/v2/gen/client/index.ts +++ /dev/null @@ -1,25 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type { Auth } from "../core/auth.gen.js" -export type { QuerySerializerOptions } from "../core/bodySerializer.gen.js" -export { - formDataBodySerializer, - jsonBodySerializer, - urlSearchParamsBodySerializer, -} from "../core/bodySerializer.gen.js" -export { buildClientParams } from "../core/params.gen.js" -export { serializeQueryKeyValue } from "../core/queryKeySerializer.gen.js" -export { createClient } from "./client.gen.js" -export type { - Client, - ClientOptions, - Config, - CreateClientConfig, - Options, - RequestOptions, - RequestResult, - ResolvedRequestOptions, - ResponseStyle, - TDataShape, -} from "./types.gen.js" -export { createConfig, mergeHeaders } from "./utils.gen.js" diff --git a/packages/sdk/js/src/v2/gen/client/types.gen.ts b/packages/sdk/js/src/v2/gen/client/types.gen.ts deleted file mode 100644 index 99d7e7f8f2..0000000000 --- a/packages/sdk/js/src/v2/gen/client/types.gen.ts +++ /dev/null @@ -1,202 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { Auth } from "../core/auth.gen.js" -import type { ServerSentEventsOptions, ServerSentEventsResult } from "../core/serverSentEvents.gen.js" -import type { Client as CoreClient, Config as CoreConfig } from "../core/types.gen.js" -import type { Middleware } from "./utils.gen.js" - -export type ResponseStyle = "data" | "fields" - -export interface Config - extends Omit, - CoreConfig { - /** - * Base URL for all requests made by this client. - */ - baseUrl?: T["baseUrl"] - /** - * Fetch API implementation. You can use this option to provide a custom - * fetch instance. - * - * @default globalThis.fetch - */ - fetch?: typeof fetch - /** - * Please don't use the Fetch client for Next.js applications. The `next` - * options won't have any effect. - * - * Install {@link https://www.npmjs.com/package/@hey-api/client-next `@hey-api/client-next`} instead. - */ - next?: never - /** - * Return the response data parsed in a specified format. By default, `auto` - * will infer the appropriate method from the `Content-Type` response header. - * You can override this behavior with any of the {@link Body} methods. - * Select `stream` if you don't want to parse response data at all. - * - * @default 'auto' - */ - parseAs?: "arrayBuffer" | "auto" | "blob" | "formData" | "json" | "stream" | "text" - /** - * Should we return only data or multiple fields (data, error, response, etc.)? - * - * @default 'fields' - */ - responseStyle?: ResponseStyle - /** - * Throw an error instead of returning it in the response? - * - * @default false - */ - throwOnError?: T["throwOnError"] -} - -export interface RequestOptions< - TData = unknown, - TResponseStyle extends ResponseStyle = "fields", - ThrowOnError extends boolean = boolean, - Url extends string = string, -> extends Config<{ - responseStyle: TResponseStyle - throwOnError: ThrowOnError - }>, - Pick< - ServerSentEventsOptions, - "onSseError" | "onSseEvent" | "sseDefaultRetryDelay" | "sseMaxRetryAttempts" | "sseMaxRetryDelay" - > { - /** - * Any body that you want to add to your request. - * - * {@link https://developer.mozilla.org/docs/Web/API/fetch#body} - */ - body?: unknown - path?: Record - query?: Record - /** - * Security mechanism(s) to use for the request. - */ - security?: ReadonlyArray - url: Url -} - -export interface ResolvedRequestOptions< - TResponseStyle extends ResponseStyle = "fields", - ThrowOnError extends boolean = boolean, - Url extends string = string, -> extends RequestOptions { - serializedBody?: string -} - -export type RequestResult< - TData = unknown, - TError = unknown, - ThrowOnError extends boolean = boolean, - TResponseStyle extends ResponseStyle = "fields", -> = ThrowOnError extends true - ? Promise< - TResponseStyle extends "data" - ? TData extends Record - ? TData[keyof TData] - : TData - : { - data: TData extends Record ? TData[keyof TData] : TData - request: Request - response: Response - } - > - : Promise< - TResponseStyle extends "data" - ? (TData extends Record ? TData[keyof TData] : TData) | undefined - : ( - | { - data: TData extends Record ? TData[keyof TData] : TData - error: undefined - } - | { - data: undefined - error: TError extends Record ? TError[keyof TError] : TError - } - ) & { - request: Request - response: Response - } - > - -export interface ClientOptions { - baseUrl?: string - responseStyle?: ResponseStyle - throwOnError?: boolean -} - -type MethodFn = < - TData = unknown, - TError = unknown, - ThrowOnError extends boolean = false, - TResponseStyle extends ResponseStyle = "fields", ->( - options: Omit, "method">, -) => RequestResult - -type SseFn = < - TData = unknown, - TError = unknown, - ThrowOnError extends boolean = false, - TResponseStyle extends ResponseStyle = "fields", ->( - options: Omit, "method">, -) => Promise> - -type RequestFn = < - TData = unknown, - TError = unknown, - ThrowOnError extends boolean = false, - TResponseStyle extends ResponseStyle = "fields", ->( - options: Omit, "method"> & - Pick>, "method">, -) => RequestResult - -type BuildUrlFn = < - TData extends { - body?: unknown - path?: Record - query?: Record - url: string - }, ->( - options: TData & Options, -) => string - -export type Client = CoreClient & { - interceptors: Middleware -} - -/** - * The `createClientConfig()` function will be called on client initialization - * and the returned object will become the client's initial configuration. - * - * You may want to initialize your client this way instead of calling - * `setConfig()`. This is useful for example if you're using Next.js - * to ensure your client always has the correct values. - */ -export type CreateClientConfig = ( - override?: Config, -) => Config & T> - -export interface TDataShape { - body?: unknown - headers?: unknown - path?: unknown - query?: unknown - url: string -} - -type OmitKeys = Pick> - -export type Options< - TData extends TDataShape = TDataShape, - ThrowOnError extends boolean = boolean, - TResponse = unknown, - TResponseStyle extends ResponseStyle = "fields", -> = OmitKeys, "body" | "path" | "query" | "url"> & - ([TData] extends [never] ? unknown : Omit) diff --git a/packages/sdk/js/src/v2/gen/client/utils.gen.ts b/packages/sdk/js/src/v2/gen/client/utils.gen.ts deleted file mode 100644 index 49c07010ba..0000000000 --- a/packages/sdk/js/src/v2/gen/client/utils.gen.ts +++ /dev/null @@ -1,294 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { getAuthToken } from "../core/auth.gen.js" -import type { QuerySerializerOptions } from "../core/bodySerializer.gen.js" -import { jsonBodySerializer } from "../core/bodySerializer.gen.js" -import { serializeArrayParam, serializeObjectParam, serializePrimitiveParam } from "../core/pathSerializer.gen.js" -import { getUrl } from "../core/utils.gen.js" -import type { Client, ClientOptions, Config, RequestOptions } from "./types.gen.js" - -export const createQuerySerializer = ({ parameters = {}, ...args }: QuerySerializerOptions = {}) => { - const querySerializer = (queryParams: T) => { - const search: string[] = [] - if (queryParams && typeof queryParams === "object") { - for (const name in queryParams) { - const value = queryParams[name] - - if (value === undefined) { - continue - } - - if (value === null) { - search.push(`${name}=null`) - continue - } - - const options = parameters[name] || args - - if (Array.isArray(value)) { - const serializedArray = serializeArrayParam({ - allowReserved: options.allowReserved, - explode: true, - name, - style: "form", - value, - ...options.array, - }) - if (serializedArray) search.push(serializedArray) - } else if (typeof value === "object") { - const serializedObject = serializeObjectParam({ - allowReserved: options.allowReserved, - explode: true, - name, - style: "deepObject", - value: value as Record, - ...options.object, - }) - if (serializedObject) search.push(serializedObject) - } else { - const serializedPrimitive = serializePrimitiveParam({ - allowReserved: options.allowReserved, - name, - value: value as string, - }) - if (serializedPrimitive) search.push(serializedPrimitive) - } - } - } - return search.join("&") - } - return querySerializer -} - -/** - * Infers parseAs value from provided Content-Type header. - */ -export const getParseAs = (contentType: string | null): Exclude => { - if (!contentType) { - // If no Content-Type header is provided, the best we can do is return the raw response body, - // which is effectively the same as the 'stream' option. - return "stream" - } - - const cleanContent = contentType.split(";")[0]?.trim() - - if (!cleanContent) { - return - } - - if (cleanContent.startsWith("application/json") || cleanContent.endsWith("+json")) { - return "json" - } - - if (cleanContent === "multipart/form-data") { - return "formData" - } - - if (["application/", "audio/", "image/", "video/"].some((type) => cleanContent.startsWith(type))) { - return "blob" - } - - if (cleanContent.startsWith("text/")) { - return "text" - } - - return -} - -const checkForExistence = ( - options: Pick & { - headers: Headers - }, - name?: string, -): boolean => { - if (!name) { - return false - } - if (options.headers.has(name) || options.query?.[name] || options.headers.get("Cookie")?.includes(`${name}=`)) { - return true - } - return false -} - -export const setAuthParams = async ({ - security, - ...options -}: Pick, "security"> & - Pick & { - headers: Headers - }) => { - for (const auth of security) { - if (checkForExistence(options, auth.name)) { - continue - } - - const token = await getAuthToken(auth, options.auth) - - if (!token) { - continue - } - - const name = auth.name ?? "Authorization" - - switch (auth.in) { - case "query": - if (!options.query) { - options.query = {} - } - options.query[name] = token - break - case "cookie": - options.headers.append("Cookie", `${name}=${token}`) - break - case "header": - default: - options.headers.set(name, token) - break - } - } -} - -export const buildUrl: Client["buildUrl"] = (options) => - getUrl({ - baseUrl: options.baseUrl as string, - path: options.path, - query: options.query, - querySerializer: - typeof options.querySerializer === "function" - ? options.querySerializer - : createQuerySerializer(options.querySerializer), - url: options.url, - }) - -export const mergeConfigs = (a: Config, b: Config): Config => { - const config = { ...a, ...b } - if (config.baseUrl?.endsWith("/")) { - config.baseUrl = config.baseUrl.substring(0, config.baseUrl.length - 1) - } - config.headers = mergeHeaders(a.headers, b.headers) - return config -} - -const headersEntries = (headers: Headers): Array<[string, string]> => { - const entries: Array<[string, string]> = [] - headers.forEach((value, key) => { - entries.push([key, value]) - }) - return entries -} - -export const mergeHeaders = (...headers: Array["headers"] | undefined>): Headers => { - const mergedHeaders = new Headers() - for (const header of headers) { - if (!header) { - continue - } - - const iterator = header instanceof Headers ? headersEntries(header) : Object.entries(header) - - for (const [key, value] of iterator) { - if (value === null) { - mergedHeaders.delete(key) - } else if (Array.isArray(value)) { - for (const v of value) { - mergedHeaders.append(key, v as string) - } - } else if (value !== undefined) { - // assume object headers are meant to be JSON stringified, i.e. their - // content value in OpenAPI specification is 'application/json' - mergedHeaders.set(key, typeof value === "object" ? JSON.stringify(value) : (value as string)) - } - } - } - return mergedHeaders -} - -type ErrInterceptor = ( - error: Err, - response: Res, - request: Req, - options: Options, -) => Err | Promise - -type ReqInterceptor = (request: Req, options: Options) => Req | Promise - -type ResInterceptor = (response: Res, request: Req, options: Options) => Res | Promise - -class Interceptors { - fns: Array = [] - - clear(): void { - this.fns = [] - } - - eject(id: number | Interceptor): void { - const index = this.getInterceptorIndex(id) - if (this.fns[index]) { - this.fns[index] = null - } - } - - exists(id: number | Interceptor): boolean { - const index = this.getInterceptorIndex(id) - return Boolean(this.fns[index]) - } - - getInterceptorIndex(id: number | Interceptor): number { - if (typeof id === "number") { - return this.fns[id] ? id : -1 - } - return this.fns.indexOf(id) - } - - update(id: number | Interceptor, fn: Interceptor): number | Interceptor | false { - const index = this.getInterceptorIndex(id) - if (this.fns[index]) { - this.fns[index] = fn - return id - } - return false - } - - use(fn: Interceptor): number { - this.fns.push(fn) - return this.fns.length - 1 - } -} - -export interface Middleware { - error: Interceptors> - request: Interceptors> - response: Interceptors> -} - -export const createInterceptors = (): Middleware => ({ - error: new Interceptors>(), - request: new Interceptors>(), - response: new Interceptors>(), -}) - -const defaultQuerySerializer = createQuerySerializer({ - allowReserved: false, - array: { - explode: true, - style: "form", - }, - object: { - explode: true, - style: "deepObject", - }, -}) - -const defaultHeaders = { - "Content-Type": "application/json", -} - -export const createConfig = ( - override: Config & T> = {}, -): Config & T> => ({ - ...jsonBodySerializer, - headers: defaultHeaders, - parseAs: "auto", - querySerializer: defaultQuerySerializer, - ...override, -}) diff --git a/packages/sdk/js/src/v2/gen/core/auth.gen.ts b/packages/sdk/js/src/v2/gen/core/auth.gen.ts deleted file mode 100644 index bc7b230f44..0000000000 --- a/packages/sdk/js/src/v2/gen/core/auth.gen.ts +++ /dev/null @@ -1,41 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type AuthToken = string | undefined - -export interface Auth { - /** - * Which part of the request do we use to send the auth? - * - * @default 'header' - */ - in?: "header" | "query" | "cookie" - /** - * Header or query parameter name. - * - * @default 'Authorization' - */ - name?: string - scheme?: "basic" | "bearer" - type: "apiKey" | "http" -} - -export const getAuthToken = async ( - auth: Auth, - callback: ((auth: Auth) => Promise | AuthToken) | AuthToken, -): Promise => { - const token = typeof callback === "function" ? await callback(auth) : callback - - if (!token) { - return - } - - if (auth.scheme === "bearer") { - return `Bearer ${token}` - } - - if (auth.scheme === "basic") { - return `Basic ${btoa(token)}` - } - - return token -} diff --git a/packages/sdk/js/src/v2/gen/core/bodySerializer.gen.ts b/packages/sdk/js/src/v2/gen/core/bodySerializer.gen.ts deleted file mode 100644 index 9678fb08ec..0000000000 --- a/packages/sdk/js/src/v2/gen/core/bodySerializer.gen.ts +++ /dev/null @@ -1,82 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { ArrayStyle, ObjectStyle, SerializerOptions } from "./pathSerializer.gen.js" - -export type QuerySerializer = (query: Record) => string - -export type BodySerializer = (body: any) => any - -type QuerySerializerOptionsObject = { - allowReserved?: boolean - array?: Partial> - object?: Partial> -} - -export type QuerySerializerOptions = QuerySerializerOptionsObject & { - /** - * Per-parameter serialization overrides. When provided, these settings - * override the global array/object settings for specific parameter names. - */ - parameters?: Record -} - -const serializeFormDataPair = (data: FormData, key: string, value: unknown): void => { - if (typeof value === "string" || value instanceof Blob) { - data.append(key, value) - } else if (value instanceof Date) { - data.append(key, value.toISOString()) - } else { - data.append(key, JSON.stringify(value)) - } -} - -const serializeUrlSearchParamsPair = (data: URLSearchParams, key: string, value: unknown): void => { - if (typeof value === "string") { - data.append(key, value) - } else { - data.append(key, JSON.stringify(value)) - } -} - -export const formDataBodySerializer = { - bodySerializer: | Array>>(body: T): FormData => { - const data = new FormData() - - Object.entries(body).forEach(([key, value]) => { - if (value === undefined || value === null) { - return - } - if (Array.isArray(value)) { - value.forEach((v) => serializeFormDataPair(data, key, v)) - } else { - serializeFormDataPair(data, key, value) - } - }) - - return data - }, -} - -export const jsonBodySerializer = { - bodySerializer: (body: T): string => - JSON.stringify(body, (_key, value) => (typeof value === "bigint" ? value.toString() : value)), -} - -export const urlSearchParamsBodySerializer = { - bodySerializer: | Array>>(body: T): string => { - const data = new URLSearchParams() - - Object.entries(body).forEach(([key, value]) => { - if (value === undefined || value === null) { - return - } - if (Array.isArray(value)) { - value.forEach((v) => serializeUrlSearchParamsPair(data, key, v)) - } else { - serializeUrlSearchParamsPair(data, key, value) - } - }) - - return data.toString() - }, -} diff --git a/packages/sdk/js/src/v2/gen/core/params.gen.ts b/packages/sdk/js/src/v2/gen/core/params.gen.ts deleted file mode 100644 index 6e9d0b9add..0000000000 --- a/packages/sdk/js/src/v2/gen/core/params.gen.ts +++ /dev/null @@ -1,169 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -type Slot = "body" | "headers" | "path" | "query" - -export type Field = - | { - in: Exclude - /** - * Field name. This is the name we want the user to see and use. - */ - key: string - /** - * Field mapped name. This is the name we want to use in the request. - * If omitted, we use the same value as `key`. - */ - map?: string - } - | { - in: Extract - /** - * Key isn't required for bodies. - */ - key?: string - map?: string - } - | { - /** - * Field name. This is the name we want the user to see and use. - */ - key: string - /** - * Field mapped name. This is the name we want to use in the request. - * If `in` is omitted, `map` aliases `key` to the transport layer. - */ - map: Slot - } - -export interface Fields { - allowExtra?: Partial> - args?: ReadonlyArray -} - -export type FieldsConfig = ReadonlyArray - -const extraPrefixesMap: Record = { - $body_: "body", - $headers_: "headers", - $path_: "path", - $query_: "query", -} -const extraPrefixes = Object.entries(extraPrefixesMap) - -type KeyMap = Map< - string, - | { - in: Slot - map?: string - } - | { - in?: never - map: Slot - } -> - -const buildKeyMap = (fields: FieldsConfig, map?: KeyMap): KeyMap => { - if (!map) { - map = new Map() - } - - for (const config of fields) { - if ("in" in config) { - if (config.key) { - map.set(config.key, { - in: config.in, - map: config.map, - }) - } - } else if ("key" in config) { - map.set(config.key, { - map: config.map, - }) - } else if (config.args) { - buildKeyMap(config.args, map) - } - } - - return map -} - -interface Params { - body: unknown - headers: Record - path: Record - query: Record -} - -const stripEmptySlots = (params: Params) => { - for (const [slot, value] of Object.entries(params)) { - if (value && typeof value === "object" && !Object.keys(value).length) { - delete params[slot as Slot] - } - } -} - -export const buildClientParams = (args: ReadonlyArray, fields: FieldsConfig) => { - const params: Params = { - body: {}, - headers: {}, - path: {}, - query: {}, - } - - const map = buildKeyMap(fields) - - let config: FieldsConfig[number] | undefined - - for (const [index, arg] of args.entries()) { - if (fields[index]) { - config = fields[index] - } - - if (!config) { - continue - } - - if ("in" in config) { - if (config.key) { - const field = map.get(config.key)! - const name = field.map || config.key - if (field.in) { - ;(params[field.in] as Record)[name] = arg - } - } else { - params.body = arg - } - } else { - for (const [key, value] of Object.entries(arg ?? {})) { - const field = map.get(key) - - if (field) { - if (field.in) { - const name = field.map || key - ;(params[field.in] as Record)[name] = value - } else { - params[field.map] = value - } - } else { - const extra = extraPrefixes.find(([prefix]) => key.startsWith(prefix)) - - if (extra) { - const [prefix, slot] = extra - ;(params[slot] as Record)[key.slice(prefix.length)] = value - } else if ("allowExtra" in config && config.allowExtra) { - for (const [slot, allowed] of Object.entries(config.allowExtra)) { - if (allowed) { - ;(params[slot as Slot] as Record)[key] = value - break - } - } - } - } - } - } - } - - stripEmptySlots(params) - - return params -} diff --git a/packages/sdk/js/src/v2/gen/core/pathSerializer.gen.ts b/packages/sdk/js/src/v2/gen/core/pathSerializer.gen.ts deleted file mode 100644 index 96be3bc5a3..0000000000 --- a/packages/sdk/js/src/v2/gen/core/pathSerializer.gen.ts +++ /dev/null @@ -1,167 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -interface SerializeOptions extends SerializePrimitiveOptions, SerializerOptions {} - -interface SerializePrimitiveOptions { - allowReserved?: boolean - name: string -} - -export interface SerializerOptions { - /** - * @default true - */ - explode: boolean - style: T -} - -export type ArrayStyle = "form" | "spaceDelimited" | "pipeDelimited" -export type ArraySeparatorStyle = ArrayStyle | MatrixStyle -type MatrixStyle = "label" | "matrix" | "simple" -export type ObjectStyle = "form" | "deepObject" -type ObjectSeparatorStyle = ObjectStyle | MatrixStyle - -interface SerializePrimitiveParam extends SerializePrimitiveOptions { - value: string -} - -export const separatorArrayExplode = (style: ArraySeparatorStyle) => { - switch (style) { - case "label": - return "." - case "matrix": - return ";" - case "simple": - return "," - default: - return "&" - } -} - -export const separatorArrayNoExplode = (style: ArraySeparatorStyle) => { - switch (style) { - case "form": - return "," - case "pipeDelimited": - return "|" - case "spaceDelimited": - return "%20" - default: - return "," - } -} - -export const separatorObjectExplode = (style: ObjectSeparatorStyle) => { - switch (style) { - case "label": - return "." - case "matrix": - return ";" - case "simple": - return "," - default: - return "&" - } -} - -export const serializeArrayParam = ({ - allowReserved, - explode, - name, - style, - value, -}: SerializeOptions & { - value: unknown[] -}) => { - if (!explode) { - const joinedValues = (allowReserved ? value : value.map((v) => encodeURIComponent(v as string))).join( - separatorArrayNoExplode(style), - ) - switch (style) { - case "label": - return `.${joinedValues}` - case "matrix": - return `;${name}=${joinedValues}` - case "simple": - return joinedValues - default: - return `${name}=${joinedValues}` - } - } - - const separator = separatorArrayExplode(style) - const joinedValues = value - .map((v) => { - if (style === "label" || style === "simple") { - return allowReserved ? v : encodeURIComponent(v as string) - } - - return serializePrimitiveParam({ - allowReserved, - name, - value: v as string, - }) - }) - .join(separator) - return style === "label" || style === "matrix" ? separator + joinedValues : joinedValues -} - -export const serializePrimitiveParam = ({ allowReserved, name, value }: SerializePrimitiveParam) => { - if (value === undefined || value === null) { - return "" - } - - if (typeof value === "object") { - throw new Error( - "Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.", - ) - } - - return `${name}=${allowReserved ? value : encodeURIComponent(value)}` -} - -export const serializeObjectParam = ({ - allowReserved, - explode, - name, - style, - value, - valueOnly, -}: SerializeOptions & { - value: Record | Date - valueOnly?: boolean -}) => { - if (value instanceof Date) { - return valueOnly ? value.toISOString() : `${name}=${value.toISOString()}` - } - - if (style !== "deepObject" && !explode) { - let values: string[] = [] - Object.entries(value).forEach(([key, v]) => { - values = [...values, key, allowReserved ? (v as string) : encodeURIComponent(v as string)] - }) - const joinedValues = values.join(",") - switch (style) { - case "form": - return `${name}=${joinedValues}` - case "label": - return `.${joinedValues}` - case "matrix": - return `;${name}=${joinedValues}` - default: - return joinedValues - } - } - - const separator = separatorObjectExplode(style) - const joinedValues = Object.entries(value) - .map(([key, v]) => - serializePrimitiveParam({ - allowReserved, - name: style === "deepObject" ? `${name}[${key}]` : key, - value: v as string, - }), - ) - .join(separator) - return style === "label" || style === "matrix" ? separator + joinedValues : joinedValues -} diff --git a/packages/sdk/js/src/v2/gen/core/queryKeySerializer.gen.ts b/packages/sdk/js/src/v2/gen/core/queryKeySerializer.gen.ts deleted file mode 100644 index 320204aef1..0000000000 --- a/packages/sdk/js/src/v2/gen/core/queryKeySerializer.gen.ts +++ /dev/null @@ -1,111 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -/** - * JSON-friendly union that mirrors what Pinia Colada can hash. - */ -export type JsonValue = null | string | number | boolean | JsonValue[] | { [key: string]: JsonValue } - -/** - * Replacer that converts non-JSON values (bigint, Date, etc.) to safe substitutes. - */ -export const queryKeyJsonReplacer = (_key: string, value: unknown) => { - if (value === undefined || typeof value === "function" || typeof value === "symbol") { - return undefined - } - if (typeof value === "bigint") { - return value.toString() - } - if (value instanceof Date) { - return value.toISOString() - } - return value -} - -/** - * Safely stringifies a value and parses it back into a JsonValue. - */ -export const stringifyToJsonValue = (input: unknown): JsonValue | undefined => { - try { - const json = JSON.stringify(input, queryKeyJsonReplacer) - if (json === undefined) { - return undefined - } - return JSON.parse(json) as JsonValue - } catch { - return undefined - } -} - -/** - * Detects plain objects (including objects with a null prototype). - */ -const isPlainObject = (value: unknown): value is Record => { - if (value === null || typeof value !== "object") { - return false - } - const prototype = Object.getPrototypeOf(value as object) - return prototype === Object.prototype || prototype === null -} - -/** - * Turns URLSearchParams into a sorted JSON object for deterministic keys. - */ -const serializeSearchParams = (params: URLSearchParams): JsonValue => { - const entries = Array.from(params.entries()).sort(([a], [b]) => a.localeCompare(b)) - const result: Record = {} - - for (const [key, value] of entries) { - const existing = result[key] - if (existing === undefined) { - result[key] = value - continue - } - - if (Array.isArray(existing)) { - ;(existing as string[]).push(value) - } else { - result[key] = [existing, value] - } - } - - return result -} - -/** - * Normalizes any accepted value into a JSON-friendly shape for query keys. - */ -export const serializeQueryKeyValue = (value: unknown): JsonValue | undefined => { - if (value === null) { - return null - } - - if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") { - return value - } - - if (value === undefined || typeof value === "function" || typeof value === "symbol") { - return undefined - } - - if (typeof value === "bigint") { - return value.toString() - } - - if (value instanceof Date) { - return value.toISOString() - } - - if (Array.isArray(value)) { - return stringifyToJsonValue(value) - } - - if (typeof URLSearchParams !== "undefined" && value instanceof URLSearchParams) { - return serializeSearchParams(value) - } - - if (isPlainObject(value)) { - return stringifyToJsonValue(value) - } - - return undefined -} diff --git a/packages/sdk/js/src/v2/gen/core/serverSentEvents.gen.ts b/packages/sdk/js/src/v2/gen/core/serverSentEvents.gen.ts deleted file mode 100644 index 056a812593..0000000000 --- a/packages/sdk/js/src/v2/gen/core/serverSentEvents.gen.ts +++ /dev/null @@ -1,239 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { Config } from "./types.gen.js" - -export type ServerSentEventsOptions = Omit & - Pick & { - /** - * Fetch API implementation. You can use this option to provide a custom - * fetch instance. - * - * @default globalThis.fetch - */ - fetch?: typeof fetch - /** - * Implementing clients can call request interceptors inside this hook. - */ - onRequest?: (url: string, init: RequestInit) => Promise - /** - * Callback invoked when a network or parsing error occurs during streaming. - * - * This option applies only if the endpoint returns a stream of events. - * - * @param error The error that occurred. - */ - onSseError?: (error: unknown) => void - /** - * Callback invoked when an event is streamed from the server. - * - * This option applies only if the endpoint returns a stream of events. - * - * @param event Event streamed from the server. - * @returns Nothing (void). - */ - onSseEvent?: (event: StreamEvent) => void - serializedBody?: RequestInit["body"] - /** - * Default retry delay in milliseconds. - * - * This option applies only if the endpoint returns a stream of events. - * - * @default 3000 - */ - sseDefaultRetryDelay?: number - /** - * Maximum number of retry attempts before giving up. - */ - sseMaxRetryAttempts?: number - /** - * Maximum retry delay in milliseconds. - * - * Applies only when exponential backoff is used. - * - * This option applies only if the endpoint returns a stream of events. - * - * @default 30000 - */ - sseMaxRetryDelay?: number - /** - * Optional sleep function for retry backoff. - * - * Defaults to using `setTimeout`. - */ - sseSleepFn?: (ms: number) => Promise - url: string - } - -export interface StreamEvent { - data: TData - event?: string - id?: string - retry?: number -} - -export type ServerSentEventsResult = { - stream: AsyncGenerator ? TData[keyof TData] : TData, TReturn, TNext> -} - -export const createSseClient = ({ - onRequest, - onSseError, - onSseEvent, - responseTransformer, - responseValidator, - sseDefaultRetryDelay, - sseMaxRetryAttempts, - sseMaxRetryDelay, - sseSleepFn, - url, - ...options -}: ServerSentEventsOptions): ServerSentEventsResult => { - let lastEventId: string | undefined - - const sleep = sseSleepFn ?? ((ms: number) => new Promise((resolve) => setTimeout(resolve, ms))) - - const createStream = async function* () { - let retryDelay: number = sseDefaultRetryDelay ?? 3000 - let attempt = 0 - const signal = options.signal ?? new AbortController().signal - - while (true) { - if (signal.aborted) break - - attempt++ - - const headers = - options.headers instanceof Headers - ? options.headers - : new Headers(options.headers as Record | undefined) - - if (lastEventId !== undefined) { - headers.set("Last-Event-ID", lastEventId) - } - - try { - const requestInit: RequestInit = { - redirect: "follow", - ...options, - body: options.serializedBody, - headers, - signal, - } - let request = new Request(url, requestInit) - if (onRequest) { - request = await onRequest(url, requestInit) - } - // fetch must be assigned here, otherwise it would throw the error: - // TypeError: Failed to execute 'fetch' on 'Window': Illegal invocation - const _fetch = options.fetch ?? globalThis.fetch - const response = await _fetch(request) - - if (!response.ok) throw new Error(`SSE failed: ${response.status} ${response.statusText}`) - - if (!response.body) throw new Error("No body in SSE response") - - const reader = response.body.pipeThrough(new TextDecoderStream()).getReader() - - let buffer = "" - - const abortHandler = () => { - try { - reader.cancel() - } catch { - // noop - } - } - - signal.addEventListener("abort", abortHandler) - - try { - while (true) { - const { done, value } = await reader.read() - if (done) break - buffer += value - // Normalize line endings: CRLF -> LF, then CR -> LF - buffer = buffer.replace(/\r\n/g, "\n").replace(/\r/g, "\n") - - const chunks = buffer.split("\n\n") - buffer = chunks.pop() ?? "" - - for (const chunk of chunks) { - const lines = chunk.split("\n") - const dataLines: Array = [] - let eventName: string | undefined - - for (const line of lines) { - if (line.startsWith("data:")) { - dataLines.push(line.replace(/^data:\s*/, "")) - } else if (line.startsWith("event:")) { - eventName = line.replace(/^event:\s*/, "") - } else if (line.startsWith("id:")) { - lastEventId = line.replace(/^id:\s*/, "") - } else if (line.startsWith("retry:")) { - const parsed = Number.parseInt(line.replace(/^retry:\s*/, ""), 10) - if (!Number.isNaN(parsed)) { - retryDelay = parsed - } - } - } - - let data: unknown - let parsedJson = false - - if (dataLines.length) { - const rawData = dataLines.join("\n") - try { - data = JSON.parse(rawData) - parsedJson = true - } catch { - data = rawData - } - } - - if (parsedJson) { - if (responseValidator) { - await responseValidator(data) - } - - if (responseTransformer) { - data = await responseTransformer(data) - } - } - - onSseEvent?.({ - data, - event: eventName, - id: lastEventId, - retry: retryDelay, - }) - - if (dataLines.length) { - yield data as any - } - } - } - } finally { - signal.removeEventListener("abort", abortHandler) - reader.releaseLock() - } - - break // exit loop on normal completion - } catch (error) { - // connection failed or aborted; retry after delay - onSseError?.(error) - - if (sseMaxRetryAttempts !== undefined && attempt >= sseMaxRetryAttempts) { - break // stop after firing error - } - - // exponential backoff: double retry each attempt, cap at 30s - const backoff = Math.min(retryDelay * 2 ** (attempt - 1), sseMaxRetryDelay ?? 30000) - await sleep(backoff) - } - } - } - - const stream = createStream() - - return { stream } -} diff --git a/packages/sdk/js/src/v2/gen/core/types.gen.ts b/packages/sdk/js/src/v2/gen/core/types.gen.ts deleted file mode 100644 index bfa77b8acd..0000000000 --- a/packages/sdk/js/src/v2/gen/core/types.gen.ts +++ /dev/null @@ -1,86 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { Auth, AuthToken } from "./auth.gen.js" -import type { BodySerializer, QuerySerializer, QuerySerializerOptions } from "./bodySerializer.gen.js" - -export type HttpMethod = "connect" | "delete" | "get" | "head" | "options" | "patch" | "post" | "put" | "trace" - -export type Client = { - /** - * Returns the final request URL. - */ - buildUrl: BuildUrlFn - getConfig: () => Config - request: RequestFn - setConfig: (config: Config) => Config -} & { - [K in HttpMethod]: MethodFn -} & ([SseFn] extends [never] ? { sse?: never } : { sse: { [K in HttpMethod]: SseFn } }) - -export interface Config { - /** - * Auth token or a function returning auth token. The resolved value will be - * added to the request payload as defined by its `security` array. - */ - auth?: ((auth: Auth) => Promise | AuthToken) | AuthToken - /** - * A function for serializing request body parameter. By default, - * {@link JSON.stringify()} will be used. - */ - bodySerializer?: BodySerializer | null - /** - * An object containing any HTTP headers that you want to pre-populate your - * `Headers` object with. - * - * {@link https://developer.mozilla.org/docs/Web/API/Headers/Headers#init See more} - */ - headers?: - | RequestInit["headers"] - | Record - /** - * The request method. - * - * {@link https://developer.mozilla.org/docs/Web/API/fetch#method See more} - */ - method?: Uppercase - /** - * A function for serializing request query parameters. By default, arrays - * will be exploded in form style, objects will be exploded in deepObject - * style, and reserved characters are percent-encoded. - * - * This method will have no effect if the native `paramsSerializer()` Axios - * API function is used. - * - * {@link https://swagger.io/docs/specification/serialization/#query View examples} - */ - querySerializer?: QuerySerializer | QuerySerializerOptions - /** - * A function validating request data. This is useful if you want to ensure - * the request conforms to the desired shape, so it can be safely sent to - * the server. - */ - requestValidator?: (data: unknown) => Promise - /** - * A function transforming response data before it's returned. This is useful - * for post-processing data, e.g. converting ISO strings into Date objects. - */ - responseTransformer?: (data: unknown) => Promise - /** - * A function validating response data. This is useful if you want to ensure - * the response conforms to the desired shape, so it can be safely passed to - * the transformers and returned to the user. - */ - responseValidator?: (data: unknown) => Promise -} - -type IsExactlyNeverOrNeverUndefined = [T] extends [never] - ? true - : [T] extends [never | undefined] - ? [undefined] extends [T] - ? false - : true - : false - -export type OmitNever> = { - [K in keyof T as IsExactlyNeverOrNeverUndefined extends true ? never : K]: T[K] -} diff --git a/packages/sdk/js/src/v2/gen/core/utils.gen.ts b/packages/sdk/js/src/v2/gen/core/utils.gen.ts deleted file mode 100644 index 8a45f72698..0000000000 --- a/packages/sdk/js/src/v2/gen/core/utils.gen.ts +++ /dev/null @@ -1,137 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { BodySerializer, QuerySerializer } from "./bodySerializer.gen.js" -import { - type ArraySeparatorStyle, - serializeArrayParam, - serializeObjectParam, - serializePrimitiveParam, -} from "./pathSerializer.gen.js" - -export interface PathSerializer { - path: Record - url: string -} - -export const PATH_PARAM_RE = /\{[^{}]+\}/g - -export const defaultPathSerializer = ({ path, url: _url }: PathSerializer) => { - let url = _url - const matches = _url.match(PATH_PARAM_RE) - if (matches) { - for (const match of matches) { - let explode = false - let name = match.substring(1, match.length - 1) - let style: ArraySeparatorStyle = "simple" - - if (name.endsWith("*")) { - explode = true - name = name.substring(0, name.length - 1) - } - - if (name.startsWith(".")) { - name = name.substring(1) - style = "label" - } else if (name.startsWith(";")) { - name = name.substring(1) - style = "matrix" - } - - const value = path[name] - - if (value === undefined || value === null) { - continue - } - - if (Array.isArray(value)) { - url = url.replace(match, serializeArrayParam({ explode, name, style, value })) - continue - } - - if (typeof value === "object") { - url = url.replace( - match, - serializeObjectParam({ - explode, - name, - style, - value: value as Record, - valueOnly: true, - }), - ) - continue - } - - if (style === "matrix") { - url = url.replace( - match, - `;${serializePrimitiveParam({ - name, - value: value as string, - })}`, - ) - continue - } - - const replaceValue = encodeURIComponent(style === "label" ? `.${value as string}` : (value as string)) - url = url.replace(match, replaceValue) - } - } - return url -} - -export const getUrl = ({ - baseUrl, - path, - query, - querySerializer, - url: _url, -}: { - baseUrl?: string - path?: Record - query?: Record - querySerializer: QuerySerializer - url: string -}) => { - const pathUrl = _url.startsWith("/") ? _url : `/${_url}` - let url = (baseUrl ?? "") + pathUrl - if (path) { - url = defaultPathSerializer({ path, url }) - } - let search = query ? querySerializer(query) : "" - if (search.startsWith("?")) { - search = search.substring(1) - } - if (search) { - url += `?${search}` - } - return url -} - -export function getValidRequestBody(options: { - body?: unknown - bodySerializer?: BodySerializer | null - serializedBody?: unknown -}) { - const hasBody = options.body !== undefined - const isSerializedBody = hasBody && options.bodySerializer - - if (isSerializedBody) { - if ("serializedBody" in options) { - const hasSerializedBody = options.serializedBody !== undefined && options.serializedBody !== "" - - return hasSerializedBody ? options.serializedBody : null - } - - // not all clients implement a serializedBody property (i.e. client-axios) - return options.body !== "" ? options.body : null - } - - // plain/text body - if (hasBody) { - return options.body - } - - // no body was provided - return undefined -} diff --git a/packages/sdk/js/src/v2/gen/sdk.gen.ts b/packages/sdk/js/src/v2/gen/sdk.gen.ts deleted file mode 100644 index 35dc600e5d..0000000000 --- a/packages/sdk/js/src/v2/gen/sdk.gen.ts +++ /dev/null @@ -1,8828 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import { client } from "./client.gen.js" -import { buildClientParams, type Client, type Options as Options2, type TDataShape } from "./client/index.js" -import type { - AgentPartInput, - AppAgentsErrors, - AppAgentsResponses, - AppLogErrors, - AppLogResponses, - AppSkillsErrors, - AppSkillsResponses, - Auth as Auth3, - AuthRemoveErrors, - AuthRemoveResponses, - AuthSetErrors, - AuthSetResponses, - CommandListErrors, - CommandListResponses, - Config as Config3, - ConfigGetErrors, - ConfigGetResponses, - ConfigProvidersErrors, - ConfigProvidersResponses, - ConfigUpdateErrors, - ConfigUpdateResponses, - EventSubscribeResponses, - EventTuiCommandExecute, - EventTuiPromptAppend, - EventTuiSessionSelect, - EventTuiToastShow, - ExperimentalCapabilitiesGetErrors, - ExperimentalCapabilitiesGetResponses, - ExperimentalConsoleGetErrors, - ExperimentalConsoleGetResponses, - ExperimentalConsoleListOrgsErrors, - ExperimentalConsoleListOrgsResponses, - ExperimentalConsoleSwitchOrgResponses, - ExperimentalControlPlaneMoveSessionErrors, - ExperimentalControlPlaneMoveSessionResponses, - ExperimentalProjectCopyGenerateNameErrors, - ExperimentalProjectCopyGenerateNameResponses, - ExperimentalResourceListErrors, - ExperimentalResourceListResponses, - ExperimentalSessionBackgroundErrors, - ExperimentalSessionBackgroundResponses, - ExperimentalSessionListErrors, - ExperimentalSessionListResponses, - ExperimentalWorkspaceAdapterListErrors, - ExperimentalWorkspaceAdapterListResponses, - ExperimentalWorkspaceCreateErrors, - ExperimentalWorkspaceCreateResponses, - ExperimentalWorkspaceListErrors, - ExperimentalWorkspaceListResponses, - ExperimentalWorkspaceRemoveErrors, - ExperimentalWorkspaceRemoveResponses, - ExperimentalWorkspaceStatusErrors, - ExperimentalWorkspaceStatusResponses, - ExperimentalWorkspaceSyncListErrors, - ExperimentalWorkspaceSyncListResponses, - ExperimentalWorkspaceWarpErrors, - ExperimentalWorkspaceWarpResponses, - FileListErrors, - FileListResponses, - FilePartInput, - FilePartSource, - FileReadErrors, - FileReadResponses, - FileStatusErrors, - FileStatusResponses, - FindFilesErrors, - FindFilesResponses, - FindSymbolsErrors, - FindSymbolsResponses, - FindTextErrors, - FindTextResponses, - FormatterStatusErrors, - FormatterStatusResponses, - FormCreatePayloadV2, - FormReply, - GlobalConfigGetErrors, - GlobalConfigGetResponses, - GlobalConfigUpdateErrors, - GlobalConfigUpdateResponses, - GlobalDisposeErrors, - GlobalDisposeResponses, - GlobalEventErrors, - GlobalEventResponses, - GlobalHealthErrors, - GlobalHealthResponses, - GlobalUpgradeErrors, - GlobalUpgradeResponses, - InstanceDisposeErrors, - InstanceDisposeResponses, - InstructionEntryKeyV2, - LocationRefV2, - LspStatusErrors, - LspStatusResponses, - McpAddErrors, - McpAddResponses, - McpAuthAuthenticateErrors, - McpAuthAuthenticateResponses, - McpAuthCallbackErrors, - McpAuthCallbackResponses, - McpAuthRemoveErrors, - McpAuthRemoveResponses, - McpAuthStartErrors, - McpAuthStartResponses, - McpConnectErrors, - McpConnectResponses, - McpDisconnectErrors, - McpDisconnectResponses, - McpLocalConfig, - McpRemoteConfig, - McpStatusErrors, - McpStatusResponses, - ModelRef, - MoveSessionDestination, - OutputFormat, - Part as Part2, - PartDeleteErrors, - PartDeleteResponses, - PartUpdateErrors, - PartUpdateResponses, - PathGetErrors, - PathGetResponses, - PermissionListErrors, - PermissionListResponses, - PermissionReplyErrors, - PermissionReplyResponses, - PermissionRespondErrors, - PermissionRespondResponses, - PermissionRuleset, - PermissionV2Reply, - PermissionV2SourceV2, - ProjectCommands, - ProjectCurrentErrors, - ProjectCurrentResponses, - ProjectDirectoriesErrors, - ProjectDirectoriesResponses, - ProjectIcon, - ProjectInitGitErrors, - ProjectInitGitResponses, - ProjectListErrors, - ProjectListResponses, - ProjectUpdateErrors, - ProjectUpdateResponses, - PromptAgentAttachment, - PromptInputFileAttachment, - ProviderAuthErrors, - ProviderAuthResponses, - ProviderListErrors, - ProviderListResponses, - ProviderOauthAuthorizeErrors, - ProviderOauthAuthorizeResponses, - ProviderOauthCallbackErrors, - ProviderOauthCallbackResponses, - PtyConnectErrors, - PtyConnectResponses, - PtyConnectTokenErrors, - PtyConnectTokenResponses, - PtyCreateErrors, - PtyCreateResponses, - PtyGetErrors, - PtyGetResponses, - PtyListErrors, - PtyListResponses, - PtyRemoveErrors, - PtyRemoveResponses, - PtyShellsErrors, - PtyShellsResponses, - PtyUpdateErrors, - PtyUpdateResponses, - QuestionAnswer, - QuestionListErrors, - QuestionListResponses, - QuestionRejectErrors, - QuestionRejectResponses, - QuestionReplyErrors, - QuestionReplyResponses, - QuestionV2Reply, - ServiceStopRequest, - SessionAbortErrors, - SessionAbortResponses, - SessionChildrenErrors, - SessionChildrenResponses, - SessionCommandErrors, - SessionCommandResponses, - SessionCreateErrors, - SessionCreateResponses, - SessionDeleteErrors, - SessionDeleteMessageErrors, - SessionDeleteMessageResponses, - SessionDeleteResponses, - SessionDiffErrors, - SessionDiffResponses, - SessionForkErrors, - SessionForkResponses, - SessionGetErrors, - SessionGetResponses, - SessionInitErrors, - SessionInitResponses, - SessionListErrors, - SessionListResponses, - SessionMessageErrors, - SessionMessageResponses, - SessionMessagesErrors, - SessionMessagesResponses, - SessionPromptAsyncErrors, - SessionPromptAsyncResponses, - SessionPromptErrors, - SessionPromptResponses, - SessionRevertErrors, - SessionRevertResponses, - SessionShareErrors, - SessionShareResponses, - SessionShellErrors, - SessionShellResponses, - SessionStatusErrors, - SessionStatusResponses, - SessionSummarizeErrors, - SessionSummarizeResponses, - SessionUnrevertErrors, - SessionUnrevertResponses, - SessionUnshareErrors, - SessionUnshareResponses, - SessionUpdateErrors, - SessionUpdateResponses, - SubtaskPartInput, - SyncHistoryListErrors, - SyncHistoryListResponses, - SyncReplayErrors, - SyncReplayResponses, - SyncStartErrors, - SyncStartResponses, - SyncStealErrors, - SyncStealResponses, - TextPartInput, - ToolIdsErrors, - ToolIdsResponses, - ToolListErrors, - ToolListResponses, - TuiAppendPromptErrors, - TuiAppendPromptResponses, - TuiClearPromptErrors, - TuiClearPromptResponses, - TuiControlNextErrors, - TuiControlNextResponses, - TuiControlResponseErrors, - TuiControlResponseResponses, - TuiExecuteCommandErrors, - TuiExecuteCommandResponses, - TuiOpenHelpErrors, - TuiOpenHelpResponses, - TuiOpenModelsErrors, - TuiOpenModelsResponses, - TuiOpenSessionsErrors, - TuiOpenSessionsResponses, - TuiOpenThemesErrors, - TuiOpenThemesResponses, - TuiPublishErrors, - TuiPublishResponses, - TuiSelectSessionErrors, - TuiSelectSessionResponses, - TuiShowToastErrors, - TuiShowToastResponses, - TuiSubmitPromptErrors, - TuiSubmitPromptResponses, - V2AgentListErrors, - V2AgentListResponses, - V2CommandListErrors, - V2CommandListResponses, - V2CredentialRemoveErrors, - V2CredentialRemoveResponses, - V2CredentialUpdateErrors, - V2CredentialUpdateResponses, - V2DebugLocationEvictErrors, - V2DebugLocationEvictResponses, - V2DebugLocationListErrors, - V2DebugLocationListResponses, - V2EventSubscribeErrors, - V2EventSubscribeResponses, - V2ExperimentalIntegrationWellknownAddErrors, - V2ExperimentalIntegrationWellknownAddResponses, - V2FormRequestListErrors, - V2FormRequestListResponses, - V2FsFindErrors, - V2FsFindResponses, - V2FsListErrors, - V2FsListResponses, - V2FsReadErrors, - V2FsReadResponses, - V2GenerateTextErrors, - V2GenerateTextResponses, - V2HealthGetErrors, - V2HealthGetResponses, - V2HealthStopErrors, - V2HealthStopResponses, - V2IntegrationCommandCancelErrors, - V2IntegrationCommandCancelResponses, - V2IntegrationCommandConnectErrors, - V2IntegrationCommandConnectResponses, - V2IntegrationCommandStatusErrors, - V2IntegrationCommandStatusResponses, - V2IntegrationConnectKeyErrors, - V2IntegrationConnectKeyResponses, - V2IntegrationGetErrors, - V2IntegrationGetResponses, - V2IntegrationListErrors, - V2IntegrationListResponses, - V2IntegrationOauthCancelErrors, - V2IntegrationOauthCancelResponses, - V2IntegrationOauthCompleteErrors, - V2IntegrationOauthCompleteResponses, - V2IntegrationOauthConnectErrors, - V2IntegrationOauthConnectResponses, - V2IntegrationOauthStatusErrors, - V2IntegrationOauthStatusResponses, - V2LocationGetErrors, - V2LocationGetResponses, - V2McpListErrors, - V2McpListResponses, - V2McpResourceCatalogErrors, - V2McpResourceCatalogResponses, - V2MessageListErrors, - V2MessageListResponses, - V2ModelDefaultErrors, - V2ModelDefaultResponses, - V2ModelListErrors, - V2ModelListResponses, - V2PermissionRequestListErrors, - V2PermissionRequestListResponses, - V2PermissionSavedListErrors, - V2PermissionSavedListResponses, - V2PermissionSavedRemoveErrors, - V2PermissionSavedRemoveResponses, - V2PluginListErrors, - V2PluginListResponses, - V2ProjectCopyCreateErrors, - V2ProjectCopyCreateResponses, - V2ProjectCopyRefreshErrors, - V2ProjectCopyRefreshResponses, - V2ProjectCopyRemoveErrors, - V2ProjectCopyRemoveResponses, - V2ProjectCurrentErrors, - V2ProjectCurrentResponses, - V2ProjectDirectoriesErrors, - V2ProjectDirectoriesResponses, - V2ProjectListErrors, - V2ProjectListResponses, - V2ProviderGetErrors, - V2ProviderGetResponses, - V2ProviderListErrors, - V2ProviderListResponses, - V2PtyConnectErrors, - V2PtyConnectResponses, - V2PtyConnectTokenErrors, - V2PtyConnectTokenResponses, - V2PtyCreateErrors, - V2PtyCreateResponses, - V2PtyGetErrors, - V2PtyGetResponses, - V2PtyListErrors, - V2PtyListResponses, - V2PtyRemoveErrors, - V2PtyRemoveResponses, - V2PtyUpdateErrors, - V2PtyUpdateResponses, - V2QuestionRequestListErrors, - V2QuestionRequestListResponses, - V2ReferenceListErrors, - V2ReferenceListResponses, - V2ServerGetErrors, - V2ServerGetResponses, - V2SessionActiveErrors, - V2SessionActiveResponses, - V2SessionBackgroundErrors, - V2SessionBackgroundResponses, - V2SessionCommandErrors, - V2SessionCommandResponses, - V2SessionCompactErrors, - V2SessionCompactResponses, - V2SessionContextErrors, - V2SessionContextResponses, - V2SessionCreateErrors, - V2SessionCreateResponses, - V2SessionForkErrors, - V2SessionForkResponses, - V2SessionFormCancelErrors, - V2SessionFormCancelResponses, - V2SessionFormCreateErrors, - V2SessionFormCreateResponses, - V2SessionFormGetErrors, - V2SessionFormGetResponses, - V2SessionFormListErrors, - V2SessionFormListResponses, - V2SessionFormReplyErrors, - V2SessionFormReplyResponses, - V2SessionFormStateErrors, - V2SessionFormStateResponses, - V2SessionGenerateErrors, - V2SessionGenerateResponses, - V2SessionGetErrors, - V2SessionGetResponses, - V2SessionInstructionsEntryListErrors, - V2SessionInstructionsEntryListResponses, - V2SessionInstructionsEntryPutErrors, - V2SessionInstructionsEntryPutResponses, - V2SessionInstructionsEntryRemoveErrors, - V2SessionInstructionsEntryRemoveResponses, - V2SessionInterruptErrors, - V2SessionInterruptResponses, - V2SessionListErrors, - V2SessionListResponses, - V2SessionLogErrors, - V2SessionLogResponses, - V2SessionMessageErrors, - V2SessionMessageResponses, - V2SessionMoveErrors, - V2SessionMoveResponses, - V2SessionPendingListErrors, - V2SessionPendingListResponses, - V2SessionPermissionCreateErrors, - V2SessionPermissionCreateResponses, - V2SessionPermissionGetErrors, - V2SessionPermissionGetResponses, - V2SessionPermissionListErrors, - V2SessionPermissionListResponses, - V2SessionPermissionReplyErrors, - V2SessionPermissionReplyResponses, - V2SessionPromptErrors, - V2SessionPromptResponses, - V2SessionQuestionListErrors, - V2SessionQuestionListResponses, - V2SessionQuestionRejectErrors, - V2SessionQuestionRejectResponses, - V2SessionQuestionReplyErrors, - V2SessionQuestionReplyResponses, - V2SessionRemoveErrors, - V2SessionRemoveResponses, - V2SessionRenameErrors, - V2SessionRenameResponses, - V2SessionRevertClearErrors, - V2SessionRevertClearResponses, - V2SessionRevertCommitErrors, - V2SessionRevertCommitResponses, - V2SessionRevertStageErrors, - V2SessionRevertStageResponses, - V2SessionShellErrors, - V2SessionShellResponses, - V2SessionSkillErrors, - V2SessionSkillResponses, - V2SessionSwitchAgentErrors, - V2SessionSwitchAgentResponses, - V2SessionSwitchModelErrors, - V2SessionSwitchModelResponses, - V2SessionSyntheticErrors, - V2SessionSyntheticResponses, - V2SessionWaitErrors, - V2SessionWaitResponses, - V2ShellCreateErrors, - V2ShellCreateResponses, - V2ShellGetErrors, - V2ShellGetResponses, - V2ShellListErrors, - V2ShellListResponses, - V2ShellOutputErrors, - V2ShellOutputResponses, - V2ShellRemoveErrors, - V2ShellRemoveResponses, - V2ShellTimeoutErrors, - V2ShellTimeoutResponses, - V2SkillListErrors, - V2SkillListResponses, - V2VcsDiffErrors, - V2VcsDiffResponses, - V2VcsStatusErrors, - V2VcsStatusResponses, - VcsApplyErrors, - VcsApplyResponses, - VcsDiffErrors, - VcsDiffRawErrors, - VcsDiffRawResponses, - VcsDiffResponses, - VcsGetErrors, - VcsGetResponses, - VcsMode, - VcsStatusErrors, - VcsStatusResponses, - WorktreeCreateErrors, - WorktreeCreateInput, - WorktreeCreateResponses, - WorktreeListErrors, - WorktreeListResponses, - WorktreeRemoveErrors, - WorktreeRemoveInput, - WorktreeRemoveResponses, - WorktreeResetErrors, - WorktreeResetInput, - WorktreeResetResponses, -} from "./types.gen.js" - -export type Options = Options2< - TData, - ThrowOnError -> & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record -} - -class HeyApiClient { - protected client: Client - - constructor(args?: { client?: Client }) { - this.client = args?.client ?? client - } -} - -class HeyApiRegistry { - private readonly defaultKey = "default" - - private readonly instances: Map = new Map() - - get(key?: string): T { - const instance = this.instances.get(key ?? this.defaultKey) - if (!instance) { - throw new Error(`No SDK client found. Create one with "new OpencodeClient()" to fix this error.`) - } - return instance - } - - set(value: T, key?: string): void { - this.instances.set(key ?? this.defaultKey, value) - } -} - -export class Auth extends HeyApiClient { - /** - * Remove auth credentials - * - * Remove authentication credentials - */ - public remove( - parameters: { - providerID: string - }, - options?: Options, - ) { - const params = buildClientParams([parameters], [{ args: [{ in: "path", key: "providerID" }] }]) - return (options?.client ?? this.client).delete({ - url: "/auth/{providerID}", - ...options, - ...params, - }) - } - - /** - * Set auth credentials - * - * Set authentication credentials - */ - public set( - parameters: { - providerID: string - auth?: Auth3 - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "providerID" }, - { key: "auth", map: "body" }, - ], - }, - ], - ) - return (options?.client ?? this.client).put({ - url: "/auth/{providerID}", - ...options, - ...params, - headers: { - "Content-Type": "application/json", - ...options?.headers, - ...params.headers, - }, - }) - } -} - -export class App extends HeyApiClient { - /** - * Write log - * - * Write a log entry to the server logs with specified level and metadata. - */ - public log( - parameters?: { - directory?: string - workspace?: string - service?: string - level?: "debug" | "info" | "error" | "warn" - message?: string - extra?: { - [key: string]: unknown - } - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - { in: "body", key: "service" }, - { in: "body", key: "level" }, - { in: "body", key: "message" }, - { in: "body", key: "extra" }, - ], - }, - ], - ) - return (options?.client ?? this.client).post({ - url: "/log", - ...options, - ...params, - headers: { - "Content-Type": "application/json", - ...options?.headers, - ...params.headers, - }, - }) - } - - /** - * List agents - * - * Get a list of all available AI agents in the OpenCode system. - */ - public agents( - parameters?: { - directory?: string - workspace?: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - ], - }, - ], - ) - return (options?.client ?? this.client).get({ - url: "/agent", - ...options, - ...params, - }) - } - - /** - * List skills - * - * Get a list of all available skills in the OpenCode system. - */ - public skills( - parameters?: { - directory?: string - workspace?: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - ], - }, - ], - ) - return (options?.client ?? this.client).get({ - url: "/skill", - ...options, - ...params, - }) - } -} - -export class ControlPlane extends HeyApiClient { - /** - * Move session - * - * Move a session to another project directory, optionally transferring local changes. - */ - public moveSession( - parameters?: { - sessionID?: string - destination?: MoveSessionDestination - moveChanges?: boolean - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "body", key: "sessionID" }, - { in: "body", key: "destination" }, - { in: "body", key: "moveChanges" }, - ], - }, - ], - ) - return (options?.client ?? this.client).post< - ExperimentalControlPlaneMoveSessionResponses, - ExperimentalControlPlaneMoveSessionErrors, - ThrowOnError - >({ - url: "/experimental/control-plane/move-session", - ...options, - ...params, - headers: { - "Content-Type": "application/json", - ...options?.headers, - ...params.headers, - }, - }) - } -} - -export class Capabilities extends HeyApiClient { - /** - * Get experimental capabilities - * - * Get experimental features enabled on the OpenCode server. - */ - public get( - parameters?: { - directory?: string - workspace?: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - ], - }, - ], - ) - return (options?.client ?? this.client).get< - ExperimentalCapabilitiesGetResponses, - ExperimentalCapabilitiesGetErrors, - ThrowOnError - >({ - url: "/experimental/capabilities", - ...options, - ...params, - }) - } -} - -export class Console extends HeyApiClient { - /** - * Get active Console provider metadata - * - * Get the active Console org name and the set of provider IDs managed by that Console org. - */ - public get( - parameters?: { - directory?: string - workspace?: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - ], - }, - ], - ) - return (options?.client ?? this.client).get< - ExperimentalConsoleGetResponses, - ExperimentalConsoleGetErrors, - ThrowOnError - >({ - url: "/experimental/console", - ...options, - ...params, - }) - } - - /** - * List switchable Console orgs - * - * Get the available Console orgs across logged-in accounts, including the current active org. - */ - public listOrgs( - parameters?: { - directory?: string - workspace?: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - ], - }, - ], - ) - return (options?.client ?? this.client).get< - ExperimentalConsoleListOrgsResponses, - ExperimentalConsoleListOrgsErrors, - ThrowOnError - >({ - url: "/experimental/console/orgs", - ...options, - ...params, - }) - } - - /** - * Switch active Console org - * - * Persist a new active Console account/org selection for the current local OpenCode state. - */ - public switchOrg( - parameters?: { - directory?: string - workspace?: string - accountID?: string - orgID?: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - { in: "body", key: "accountID" }, - { in: "body", key: "orgID" }, - ], - }, - ], - ) - return (options?.client ?? this.client).post({ - url: "/experimental/console/switch", - ...options, - ...params, - headers: { - "Content-Type": "application/json", - ...options?.headers, - ...params.headers, - }, - }) - } -} - -export class Session extends HeyApiClient { - /** - * List sessions - * - * Get a list of all OpenCode sessions across projects, sorted by most recently updated. Archived sessions are excluded by default. - */ - public list( - parameters?: { - directory?: string - workspace?: string - roots?: boolean | "true" | "false" - start?: number - cursor?: number - search?: string - limit?: number - archived?: boolean | "true" | "false" - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - { in: "query", key: "roots" }, - { in: "query", key: "start" }, - { in: "query", key: "cursor" }, - { in: "query", key: "search" }, - { in: "query", key: "limit" }, - { in: "query", key: "archived" }, - ], - }, - ], - ) - return (options?.client ?? this.client).get< - ExperimentalSessionListResponses, - ExperimentalSessionListErrors, - ThrowOnError - >({ - url: "/experimental/session", - ...options, - ...params, - }) - } - - /** - * Background subagents - * - * Detach any synchronous subagents currently blocking the session and continue them in the background. - */ - public background( - parameters: { - sessionID: string - directory?: string - workspace?: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "sessionID" }, - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - ], - }, - ], - ) - return (options?.client ?? this.client).post< - ExperimentalSessionBackgroundResponses, - ExperimentalSessionBackgroundErrors, - ThrowOnError - >({ - url: "/experimental/session/{sessionID}/background", - ...options, - ...params, - }) - } -} - -export class Resource extends HeyApiClient { - /** - * Get MCP resources - * - * Get all available MCP resources from connected servers. Optionally filter by name. - */ - public list( - parameters?: { - directory?: string - workspace?: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - ], - }, - ], - ) - return (options?.client ?? this.client).get< - ExperimentalResourceListResponses, - ExperimentalResourceListErrors, - ThrowOnError - >({ - url: "/experimental/resource", - ...options, - ...params, - }) - } -} - -export class ProjectCopy extends HeyApiClient { - /** - * Generate project copy name - * - * Generate a short name for a project copy from task context. - */ - public generateName( - parameters: { - projectID: string - directory?: string - workspace?: string - context?: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "projectID" }, - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - { in: "body", key: "context" }, - ], - }, - ], - ) - return (options?.client ?? this.client).post< - ExperimentalProjectCopyGenerateNameResponses, - ExperimentalProjectCopyGenerateNameErrors, - ThrowOnError - >({ - url: "/experimental/project/{projectID}/copy/generate-name", - ...options, - ...params, - headers: { - "Content-Type": "application/json", - ...options?.headers, - ...params.headers, - }, - }) - } -} - -export class Adapter extends HeyApiClient { - /** - * List workspace adapters - * - * List all available workspace adapters for the current project. - */ - public list( - parameters?: { - directory?: string - workspace?: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - ], - }, - ], - ) - return (options?.client ?? this.client).get< - ExperimentalWorkspaceAdapterListResponses, - ExperimentalWorkspaceAdapterListErrors, - ThrowOnError - >({ - url: "/experimental/workspace/adapter", - ...options, - ...params, - }) - } -} - -export class Workspace extends HeyApiClient { - /** - * List workspaces - * - * List all workspaces. - */ - public list( - parameters?: { - directory?: string - workspace?: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - ], - }, - ], - ) - return (options?.client ?? this.client).get< - ExperimentalWorkspaceListResponses, - ExperimentalWorkspaceListErrors, - ThrowOnError - >({ - url: "/experimental/workspace", - ...options, - ...params, - }) - } - - /** - * Create workspace - * - * Create a workspace for the current project. - */ - public create( - parameters?: { - directory?: string - workspace?: string - id?: string - type?: string - branch?: string | null - extra?: unknown | null - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - { in: "body", key: "id" }, - { in: "body", key: "type" }, - { in: "body", key: "branch" }, - { in: "body", key: "extra" }, - ], - }, - ], - ) - return (options?.client ?? this.client).post< - ExperimentalWorkspaceCreateResponses, - ExperimentalWorkspaceCreateErrors, - ThrowOnError - >({ - url: "/experimental/workspace", - ...options, - ...params, - headers: { - "Content-Type": "application/json", - ...options?.headers, - ...params.headers, - }, - }) - } - - /** - * Sync workspace list - * - * Register missing workspaces returned by workspace adapters. - */ - public syncList( - parameters?: { - directory?: string - workspace?: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - ], - }, - ], - ) - return (options?.client ?? this.client).post< - ExperimentalWorkspaceSyncListResponses, - ExperimentalWorkspaceSyncListErrors, - ThrowOnError - >({ - url: "/experimental/workspace/sync-list", - ...options, - ...params, - }) - } - - /** - * Workspace status - * - * Get connection status for workspaces in the current project. - */ - public status( - parameters?: { - directory?: string - workspace?: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - ], - }, - ], - ) - return (options?.client ?? this.client).get< - ExperimentalWorkspaceStatusResponses, - ExperimentalWorkspaceStatusErrors, - ThrowOnError - >({ - url: "/experimental/workspace/status", - ...options, - ...params, - }) - } - - /** - * Remove workspace - * - * Remove an existing workspace. - */ - public remove( - parameters: { - id: string - directory?: string - workspace?: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "id" }, - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - ], - }, - ], - ) - return (options?.client ?? this.client).delete< - ExperimentalWorkspaceRemoveResponses, - ExperimentalWorkspaceRemoveErrors, - ThrowOnError - >({ - url: "/experimental/workspace/{id}", - ...options, - ...params, - }) - } - - /** - * Warp session into workspace - * - * Move a session's sync history into the target workspace, or detach it to the local project. - */ - public warp( - parameters?: { - directory?: string - workspace?: string - id?: string | null - sessionID?: string - copyChanges?: boolean - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - { in: "body", key: "id" }, - { in: "body", key: "sessionID" }, - { in: "body", key: "copyChanges" }, - ], - }, - ], - ) - return (options?.client ?? this.client).post< - ExperimentalWorkspaceWarpResponses, - ExperimentalWorkspaceWarpErrors, - ThrowOnError - >({ - url: "/experimental/workspace/warp", - ...options, - ...params, - headers: { - "Content-Type": "application/json", - ...options?.headers, - ...params.headers, - }, - }) - } - - private _adapter?: Adapter - get adapter(): Adapter { - return (this._adapter ??= new Adapter({ client: this.client })) - } -} - -export class Experimental extends HeyApiClient { - private _controlPlane?: ControlPlane - get controlPlane(): ControlPlane { - return (this._controlPlane ??= new ControlPlane({ client: this.client })) - } - - private _capabilities?: Capabilities - get capabilities(): Capabilities { - return (this._capabilities ??= new Capabilities({ client: this.client })) - } - - private _console?: Console - get console(): Console { - return (this._console ??= new Console({ client: this.client })) - } - - private _session?: Session - get session(): Session { - return (this._session ??= new Session({ client: this.client })) - } - - private _resource?: Resource - get resource(): Resource { - return (this._resource ??= new Resource({ client: this.client })) - } - - private _projectCopy?: ProjectCopy - get projectCopy(): ProjectCopy { - return (this._projectCopy ??= new ProjectCopy({ client: this.client })) - } - - private _workspace?: Workspace - get workspace(): Workspace { - return (this._workspace ??= new Workspace({ client: this.client })) - } -} - -export class Config extends HeyApiClient { - /** - * Get global configuration - * - * Retrieve the current global OpenCode configuration settings and preferences. - */ - public get(options?: Options) { - return (options?.client ?? this.client).get({ - url: "/global/config", - ...options, - }) - } - - /** - * Update global configuration - * - * Update global OpenCode configuration settings and preferences. - */ - public update( - parameters?: { - config?: Config3 - }, - options?: Options, - ) { - const params = buildClientParams([parameters], [{ args: [{ key: "config", map: "body" }] }]) - return (options?.client ?? this.client).patch({ - url: "/global/config", - ...options, - ...params, - headers: { - "Content-Type": "application/json", - ...options?.headers, - ...params.headers, - }, - }) - } -} - -export class Global extends HeyApiClient { - /** - * Get health - * - * Get health information about the OpenCode server. - */ - public health(options?: Options) { - return (options?.client ?? this.client).get({ - url: "/global/health", - ...options, - }) - } - - /** - * Get global events - * - * Subscribe to global events from the OpenCode system using server-sent events. - */ - public event(options?: Options) { - return (options?.client ?? this.client).sse.get({ - url: "/global/event", - ...options, - }) - } - - /** - * Dispose instance - * - * Clean up and dispose all OpenCode instances, releasing all resources. - */ - public dispose(options?: Options) { - return (options?.client ?? this.client).post({ - url: "/global/dispose", - ...options, - }) - } - - /** - * Upgrade opencode - * - * Upgrade opencode to the specified version or latest if not specified. - */ - public upgrade( - parameters?: { - target?: string - }, - options?: Options, - ) { - const params = buildClientParams([parameters], [{ args: [{ in: "body", key: "target" }] }]) - return (options?.client ?? this.client).post({ - url: "/global/upgrade", - ...options, - ...params, - headers: { - "Content-Type": "application/json", - ...options?.headers, - ...params.headers, - }, - }) - } - - private _config?: Config - get config(): Config { - return (this._config ??= new Config({ client: this.client })) - } -} - -export class Event extends HeyApiClient { - /** - * Subscribe to events - * - * Get events - */ - public subscribe( - parameters?: { - directory?: string - workspace?: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - ], - }, - ], - ) - return (options?.client ?? this.client).sse.get({ - url: "/event", - ...options, - ...params, - }) - } -} - -export class Config2 extends HeyApiClient { - /** - * Get configuration - * - * Retrieve the current OpenCode configuration settings and preferences. - */ - public get( - parameters?: { - directory?: string - workspace?: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - ], - }, - ], - ) - return (options?.client ?? this.client).get({ - url: "/config", - ...options, - ...params, - }) - } - - /** - * Update configuration - * - * Update OpenCode configuration settings and preferences. - */ - public update( - parameters?: { - directory?: string - workspace?: string - config?: Config3 - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - { key: "config", map: "body" }, - ], - }, - ], - ) - return (options?.client ?? this.client).patch({ - url: "/config", - ...options, - ...params, - headers: { - "Content-Type": "application/json", - ...options?.headers, - ...params.headers, - }, - }) - } - - /** - * List config providers - * - * Get a list of all configured AI providers and their default models. - */ - public providers( - parameters?: { - directory?: string - workspace?: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - ], - }, - ], - ) - return (options?.client ?? this.client).get({ - url: "/config/providers", - ...options, - ...params, - }) - } -} - -export class Tool extends HeyApiClient { - /** - * List tools - * - * Get a list of available tools with their JSON schema parameters for a specific provider and model combination. - */ - public list( - parameters: { - directory?: string - workspace?: string - provider: string - model: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - { in: "query", key: "provider" }, - { in: "query", key: "model" }, - ], - }, - ], - ) - return (options?.client ?? this.client).get({ - url: "/experimental/tool", - ...options, - ...params, - }) - } - - /** - * List tool IDs - * - * Get a list of all available tool IDs, including both built-in tools and dynamically registered tools. - */ - public ids( - parameters?: { - directory?: string - workspace?: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - ], - }, - ], - ) - return (options?.client ?? this.client).get({ - url: "/experimental/tool/ids", - ...options, - ...params, - }) - } -} - -export class Worktree extends HeyApiClient { - /** - * Remove worktree - * - * Remove a git worktree and delete its branch. - */ - public remove( - parameters?: { - directory?: string - workspace?: string - worktreeRemoveInput?: WorktreeRemoveInput - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - { key: "worktreeRemoveInput", map: "body" }, - ], - }, - ], - ) - return (options?.client ?? this.client).delete({ - url: "/experimental/worktree", - ...options, - ...params, - headers: { - "Content-Type": "application/json", - ...options?.headers, - ...params.headers, - }, - }) - } - - /** - * List worktrees - * - * List all sandbox worktrees for the current project. - */ - public list( - parameters?: { - directory?: string - workspace?: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - ], - }, - ], - ) - return (options?.client ?? this.client).get({ - url: "/experimental/worktree", - ...options, - ...params, - }) - } - - /** - * Create worktree - * - * Create a new git worktree for the current project and run any configured startup scripts. - */ - public create( - parameters?: { - directory?: string - workspace?: string - worktreeCreateInput?: WorktreeCreateInput - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - { key: "worktreeCreateInput", map: "body" }, - ], - }, - ], - ) - return (options?.client ?? this.client).post({ - url: "/experimental/worktree", - ...options, - ...params, - headers: { - "Content-Type": "application/json", - ...options?.headers, - ...params.headers, - }, - }) - } - - /** - * Reset worktree - * - * Reset a worktree branch to the primary default branch. - */ - public reset( - parameters?: { - directory?: string - workspace?: string - worktreeResetInput?: WorktreeResetInput - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - { key: "worktreeResetInput", map: "body" }, - ], - }, - ], - ) - return (options?.client ?? this.client).post({ - url: "/experimental/worktree/reset", - ...options, - ...params, - headers: { - "Content-Type": "application/json", - ...options?.headers, - ...params.headers, - }, - }) - } -} - -export class Find extends HeyApiClient { - /** - * Find text - * - * Search for text patterns across files in the project using ripgrep. - */ - public text( - parameters: { - directory?: string - workspace?: string - pattern: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - { in: "query", key: "pattern" }, - ], - }, - ], - ) - return (options?.client ?? this.client).get({ - url: "/find", - ...options, - ...params, - }) - } - - /** - * Find files - * - * Search for files or directories by name or pattern in the project directory. - */ - public files( - parameters: { - directory?: string - workspace?: string - query: string - dirs?: "true" | "false" - type?: "file" | "directory" - limit?: number - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - { in: "query", key: "query" }, - { in: "query", key: "dirs" }, - { in: "query", key: "type" }, - { in: "query", key: "limit" }, - ], - }, - ], - ) - return (options?.client ?? this.client).get({ - url: "/find/file", - ...options, - ...params, - }) - } - - /** - * Find symbols - * - * Search for workspace symbols like functions, classes, and variables using LSP. - */ - public symbols( - parameters: { - directory?: string - workspace?: string - query: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - { in: "query", key: "query" }, - ], - }, - ], - ) - return (options?.client ?? this.client).get({ - url: "/find/symbol", - ...options, - ...params, - }) - } -} - -export class File extends HeyApiClient { - /** - * List files - * - * List files and directories in a specified path. - */ - public list( - parameters: { - directory?: string - workspace?: string - path: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - { in: "query", key: "path" }, - ], - }, - ], - ) - return (options?.client ?? this.client).get({ - url: "/file", - ...options, - ...params, - }) - } - - /** - * Read file - * - * Read the content of a specified file. - */ - public read( - parameters: { - directory?: string - workspace?: string - path: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - { in: "query", key: "path" }, - ], - }, - ], - ) - return (options?.client ?? this.client).get({ - url: "/file/content", - ...options, - ...params, - }) - } - - /** - * Get file status - * - * Get the git status of all files in the project. - */ - public status( - parameters?: { - directory?: string - workspace?: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - ], - }, - ], - ) - return (options?.client ?? this.client).get({ - url: "/file/status", - ...options, - ...params, - }) - } -} - -export class Instance extends HeyApiClient { - /** - * Dispose instance - * - * Clean up and dispose the current OpenCode instance, releasing all resources. - */ - public dispose( - parameters?: { - directory?: string - workspace?: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - ], - }, - ], - ) - return (options?.client ?? this.client).post({ - url: "/instance/dispose", - ...options, - ...params, - }) - } -} - -export class Path extends HeyApiClient { - /** - * Get paths - * - * Retrieve the current working directory and related path information for the OpenCode instance. - */ - public get( - parameters?: { - directory?: string - workspace?: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - ], - }, - ], - ) - return (options?.client ?? this.client).get({ - url: "/path", - ...options, - ...params, - }) - } -} - -export class Diff extends HeyApiClient { - /** - * Get raw VCS diff - * - * Retrieve a raw patch for current uncommitted changes. - */ - public raw( - parameters?: { - directory?: string - workspace?: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - ], - }, - ], - ) - return (options?.client ?? this.client).get({ - url: "/vcs/diff/raw", - ...options, - ...params, - }) - } -} - -export class Vcs extends HeyApiClient { - /** - * Get VCS info - * - * Retrieve version control system (VCS) information for the current project, such as git branch. - */ - public get( - parameters?: { - directory?: string - workspace?: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - ], - }, - ], - ) - return (options?.client ?? this.client).get({ - url: "/vcs", - ...options, - ...params, - }) - } - - /** - * Get VCS status - * - * Retrieve changed files in the current working tree without patches. - */ - public status( - parameters?: { - directory?: string - workspace?: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - ], - }, - ], - ) - return (options?.client ?? this.client).get({ - url: "/vcs/status", - ...options, - ...params, - }) - } - - /** - * Get VCS diff - * - * Retrieve the current git diff for the working tree or against the default branch. - */ - public diff( - parameters: { - directory?: string - workspace?: string - mode: "git" | "branch" - context?: number - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - { in: "query", key: "mode" }, - { in: "query", key: "context" }, - ], - }, - ], - ) - return (options?.client ?? this.client).get({ - url: "/vcs/diff", - ...options, - ...params, - }) - } - - /** - * Apply VCS patch - * - * Apply a raw patch to the current working tree. - */ - public apply( - parameters?: { - directory?: string - workspace?: string - patch?: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - { in: "body", key: "patch" }, - ], - }, - ], - ) - return (options?.client ?? this.client).post({ - url: "/vcs/apply", - ...options, - ...params, - headers: { - "Content-Type": "application/json", - ...options?.headers, - ...params.headers, - }, - }) - } - - private _diff?: Diff - get diff2(): Diff { - return (this._diff ??= new Diff({ client: this.client })) - } -} - -export class Command extends HeyApiClient { - /** - * List commands - * - * Get a list of all available commands in the OpenCode system. - */ - public list( - parameters?: { - directory?: string - workspace?: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - ], - }, - ], - ) - return (options?.client ?? this.client).get({ - url: "/command", - ...options, - ...params, - }) - } -} - -export class Lsp extends HeyApiClient { - /** - * Get LSP status - * - * Get LSP server status - */ - public status( - parameters?: { - directory?: string - workspace?: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - ], - }, - ], - ) - return (options?.client ?? this.client).get({ - url: "/lsp", - ...options, - ...params, - }) - } -} - -export class Formatter extends HeyApiClient { - /** - * Get formatter status - * - * Get formatter status - */ - public status( - parameters?: { - directory?: string - workspace?: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - ], - }, - ], - ) - return (options?.client ?? this.client).get({ - url: "/formatter", - ...options, - ...params, - }) - } -} - -export class Auth2 extends HeyApiClient { - /** - * Remove MCP OAuth - * - * Remove OAuth credentials for an MCP server. - */ - public remove( - parameters: { - name: string - directory?: string - workspace?: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "name" }, - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - ], - }, - ], - ) - return (options?.client ?? this.client).delete({ - url: "/mcp/{name}/auth", - ...options, - ...params, - }) - } - - /** - * Start MCP OAuth - * - * Start OAuth authentication flow for a Model Context Protocol (MCP) server. - */ - public start( - parameters: { - name: string - directory?: string - workspace?: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "name" }, - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - ], - }, - ], - ) - return (options?.client ?? this.client).post({ - url: "/mcp/{name}/auth", - ...options, - ...params, - }) - } - - /** - * Complete MCP OAuth - * - * Complete OAuth authentication for a Model Context Protocol (MCP) server using the authorization code. - */ - public callback( - parameters: { - name: string - directory?: string - workspace?: string - code?: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "name" }, - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - { in: "body", key: "code" }, - ], - }, - ], - ) - return (options?.client ?? this.client).post({ - url: "/mcp/{name}/auth/callback", - ...options, - ...params, - headers: { - "Content-Type": "application/json", - ...options?.headers, - ...params.headers, - }, - }) - } - - /** - * Authenticate MCP OAuth - * - * Start OAuth flow and wait for callback (opens browser). - */ - public authenticate( - parameters: { - name: string - directory?: string - workspace?: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "name" }, - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - ], - }, - ], - ) - return (options?.client ?? this.client).post( - { - url: "/mcp/{name}/auth/authenticate", - ...options, - ...params, - }, - ) - } -} - -export class Mcp extends HeyApiClient { - /** - * Get MCP status - * - * Get the status of all Model Context Protocol (MCP) servers. - */ - public status( - parameters?: { - directory?: string - workspace?: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - ], - }, - ], - ) - return (options?.client ?? this.client).get({ - url: "/mcp", - ...options, - ...params, - }) - } - - /** - * Add MCP server - * - * Dynamically add a new Model Context Protocol (MCP) server to the system. - */ - public add( - parameters?: { - directory?: string - workspace?: string - name?: string - config?: McpLocalConfig | McpRemoteConfig - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - { in: "body", key: "name" }, - { in: "body", key: "config" }, - ], - }, - ], - ) - return (options?.client ?? this.client).post({ - url: "/mcp", - ...options, - ...params, - headers: { - "Content-Type": "application/json", - ...options?.headers, - ...params.headers, - }, - }) - } - - /** - * Connect an MCP server. - */ - public connect( - parameters: { - name: string - directory?: string - workspace?: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "name" }, - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - ], - }, - ], - ) - return (options?.client ?? this.client).post({ - url: "/mcp/{name}/connect", - ...options, - ...params, - }) - } - - /** - * Disconnect an MCP server. - */ - public disconnect( - parameters: { - name: string - directory?: string - workspace?: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "name" }, - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - ], - }, - ], - ) - return (options?.client ?? this.client).post({ - url: "/mcp/{name}/disconnect", - ...options, - ...params, - }) - } - - private _auth?: Auth2 - get auth(): Auth2 { - return (this._auth ??= new Auth2({ client: this.client })) - } -} - -export class Project extends HeyApiClient { - /** - * List all projects - * - * Get a list of projects that have been opened with OpenCode. - */ - public list( - parameters?: { - directory?: string - workspace?: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - ], - }, - ], - ) - return (options?.client ?? this.client).get({ - url: "/project", - ...options, - ...params, - }) - } - - /** - * Get current project - * - * Retrieve the currently active project that OpenCode is working with. - */ - public current( - parameters?: { - directory?: string - workspace?: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - ], - }, - ], - ) - return (options?.client ?? this.client).get({ - url: "/project/current", - ...options, - ...params, - }) - } - - /** - * Initialize git repository - * - * Create a git repository for the current project and return the refreshed project info. - */ - public initGit( - parameters?: { - directory?: string - workspace?: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - ], - }, - ], - ) - return (options?.client ?? this.client).post({ - url: "/project/git/init", - ...options, - ...params, - }) - } - - /** - * Update project - * - * Update project properties such as name, icon, and commands. - */ - public update( - parameters: { - projectID: string - directory?: string - workspace?: string - name?: string - icon?: ProjectIcon - commands?: ProjectCommands - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "projectID" }, - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - { in: "body", key: "name" }, - { in: "body", key: "icon" }, - { in: "body", key: "commands" }, - ], - }, - ], - ) - return (options?.client ?? this.client).patch({ - url: "/project/{projectID}", - ...options, - ...params, - headers: { - "Content-Type": "application/json", - ...options?.headers, - ...params.headers, - }, - }) - } - - /** - * List project directories - * - * List known local absolute directories for a project. - */ - public directories( - parameters: { - projectID: string - directory?: string - workspace?: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "projectID" }, - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - ], - }, - ], - ) - return (options?.client ?? this.client).get({ - url: "/project/{projectID}/directories", - ...options, - ...params, - }) - } -} - -export class Pty extends HeyApiClient { - /** - * List available shells - * - * Get a list of available shells on the system. - */ - public shells( - parameters?: { - directory?: string - workspace?: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - ], - }, - ], - ) - return (options?.client ?? this.client).get({ - url: "/pty/shells", - ...options, - ...params, - }) - } - - /** - * List PTY sessions - * - * Get a list of all active pseudo-terminal (PTY) sessions managed by OpenCode. - */ - public list( - parameters?: { - directory?: string - workspace?: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - ], - }, - ], - ) - return (options?.client ?? this.client).get({ - url: "/pty", - ...options, - ...params, - }) - } - - /** - * Create PTY session - * - * Create a new pseudo-terminal (PTY) session for running shell commands and processes. - */ - public create( - parameters?: { - directory?: string - workspace?: string - command?: string - args?: Array - cwd?: string - title?: string - env?: { - [key: string]: string - } - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - { in: "body", key: "command" }, - { in: "body", key: "args" }, - { in: "body", key: "cwd" }, - { in: "body", key: "title" }, - { in: "body", key: "env" }, - ], - }, - ], - ) - return (options?.client ?? this.client).post({ - url: "/pty", - ...options, - ...params, - headers: { - "Content-Type": "application/json", - ...options?.headers, - ...params.headers, - }, - }) - } - - /** - * Remove PTY session - * - * Remove and terminate a specific pseudo-terminal (PTY) session. - */ - public remove( - parameters: { - ptyID: string - directory?: string - workspace?: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "ptyID" }, - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - ], - }, - ], - ) - return (options?.client ?? this.client).delete({ - url: "/pty/{ptyID}", - ...options, - ...params, - }) - } - - /** - * Get PTY session - * - * Retrieve detailed information about a specific pseudo-terminal (PTY) session. - */ - public get( - parameters: { - ptyID: string - directory?: string - workspace?: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "ptyID" }, - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - ], - }, - ], - ) - return (options?.client ?? this.client).get({ - url: "/pty/{ptyID}", - ...options, - ...params, - }) - } - - /** - * Update PTY session - * - * Update properties of an existing pseudo-terminal (PTY) session. - */ - public update( - parameters: { - ptyID: string - directory?: string - workspace?: string - title?: string - size?: { - rows: number - cols: number - } - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "ptyID" }, - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - { in: "body", key: "title" }, - { in: "body", key: "size" }, - ], - }, - ], - ) - return (options?.client ?? this.client).put({ - url: "/pty/{ptyID}", - ...options, - ...params, - headers: { - "Content-Type": "application/json", - ...options?.headers, - ...params.headers, - }, - }) - } - - /** - * Create PTY WebSocket token - * - * Create a short-lived ticket for opening a PTY WebSocket connection. - */ - public connectToken( - parameters: { - ptyID: string - directory?: string - workspace?: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "ptyID" }, - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - ], - }, - ], - ) - return (options?.client ?? this.client).post({ - url: "/pty/{ptyID}/connect-token", - ...options, - ...params, - }) - } - - /** - * Connect to PTY session - * - * Establish a WebSocket connection to interact with a pseudo-terminal (PTY) session in real-time. - */ - public connect( - parameters: { - ptyID: string - directory?: string - workspace?: string - cursor?: string - ticket?: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "ptyID" }, - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - { in: "query", key: "cursor" }, - { in: "query", key: "ticket" }, - ], - }, - ], - ) - return (options?.client ?? this.client).get({ - url: "/pty/{ptyID}/connect", - ...options, - ...params, - }) - } -} - -export class Question extends HeyApiClient { - /** - * List pending questions - * - * Get all pending question requests across all sessions. - */ - public list( - parameters?: { - directory?: string - workspace?: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - ], - }, - ], - ) - return (options?.client ?? this.client).get({ - url: "/question", - ...options, - ...params, - }) - } - - /** - * Reply to question request - * - * Provide answers to a question request from the AI assistant. - */ - public reply( - parameters: { - requestID: string - directory?: string - workspace?: string - answers?: Array - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "requestID" }, - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - { in: "body", key: "answers" }, - ], - }, - ], - ) - return (options?.client ?? this.client).post({ - url: "/question/{requestID}/reply", - ...options, - ...params, - headers: { - "Content-Type": "application/json", - ...options?.headers, - ...params.headers, - }, - }) - } - - /** - * Reject question request - * - * Reject a question request from the AI assistant. - */ - public reject( - parameters: { - requestID: string - directory?: string - workspace?: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "requestID" }, - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - ], - }, - ], - ) - return (options?.client ?? this.client).post({ - url: "/question/{requestID}/reject", - ...options, - ...params, - }) - } -} - -export class Permission extends HeyApiClient { - /** - * List pending permissions - * - * Get all pending permission requests across all sessions. - */ - public list( - parameters?: { - directory?: string - workspace?: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - ], - }, - ], - ) - return (options?.client ?? this.client).get({ - url: "/permission", - ...options, - ...params, - }) - } - - /** - * Respond to permission request - * - * Approve or deny a permission request from the AI assistant. - */ - public reply( - parameters: { - requestID: string - directory?: string - workspace?: string - reply?: "once" | "always" | "reject" - message?: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "requestID" }, - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - { in: "body", key: "reply" }, - { in: "body", key: "message" }, - ], - }, - ], - ) - return (options?.client ?? this.client).post({ - url: "/permission/{requestID}/reply", - ...options, - ...params, - headers: { - "Content-Type": "application/json", - ...options?.headers, - ...params.headers, - }, - }) - } - - /** - * Respond to permission - * - * Approve or deny a permission request from the AI assistant. - * - * @deprecated - */ - public respond( - parameters: { - sessionID: string - permissionID: string - directory?: string - workspace?: string - response?: "once" | "always" | "reject" - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "sessionID" }, - { in: "path", key: "permissionID" }, - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - { in: "body", key: "response" }, - ], - }, - ], - ) - return (options?.client ?? this.client).post({ - url: "/session/{sessionID}/permissions/{permissionID}", - ...options, - ...params, - headers: { - "Content-Type": "application/json", - ...options?.headers, - ...params.headers, - }, - }) - } -} - -export class Oauth extends HeyApiClient { - /** - * Start OAuth authorization - * - * Start the OAuth authorization flow for a provider. - */ - public authorize( - parameters: { - providerID: string - directory?: string - workspace?: string - method?: number - inputs?: { - [key: string]: string - } - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "providerID" }, - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - { in: "body", key: "method" }, - { in: "body", key: "inputs" }, - ], - }, - ], - ) - return (options?.client ?? this.client).post< - ProviderOauthAuthorizeResponses, - ProviderOauthAuthorizeErrors, - ThrowOnError - >({ - url: "/provider/{providerID}/oauth/authorize", - ...options, - ...params, - headers: { - "Content-Type": "application/json", - ...options?.headers, - ...params.headers, - }, - }) - } - - /** - * Handle OAuth callback - * - * Handle the OAuth callback from a provider after user authorization. - */ - public callback( - parameters: { - providerID: string - directory?: string - workspace?: string - method?: number - code?: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "providerID" }, - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - { in: "body", key: "method" }, - { in: "body", key: "code" }, - ], - }, - ], - ) - return (options?.client ?? this.client).post< - ProviderOauthCallbackResponses, - ProviderOauthCallbackErrors, - ThrowOnError - >({ - url: "/provider/{providerID}/oauth/callback", - ...options, - ...params, - headers: { - "Content-Type": "application/json", - ...options?.headers, - ...params.headers, - }, - }) - } -} - -export class Provider extends HeyApiClient { - /** - * List providers - * - * Get a list of all available AI providers, including both available and connected ones. - */ - public list( - parameters?: { - directory?: string - workspace?: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - ], - }, - ], - ) - return (options?.client ?? this.client).get({ - url: "/provider", - ...options, - ...params, - }) - } - - /** - * Get provider auth methods - * - * Retrieve available authentication methods for all AI providers. - */ - public auth( - parameters?: { - directory?: string - workspace?: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - ], - }, - ], - ) - return (options?.client ?? this.client).get({ - url: "/provider/auth", - ...options, - ...params, - }) - } - - private _oauth?: Oauth - get oauth(): Oauth { - return (this._oauth ??= new Oauth({ client: this.client })) - } -} - -export class Session2 extends HeyApiClient { - /** - * List sessions - * - * Get a list of all OpenCode sessions, sorted by most recently updated. - */ - public list( - parameters?: { - directory?: string - workspace?: string - scope?: "project" - path?: string - roots?: boolean | "true" | "false" - start?: number - search?: string - limit?: number - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - { in: "query", key: "scope" }, - { in: "query", key: "path" }, - { in: "query", key: "roots" }, - { in: "query", key: "start" }, - { in: "query", key: "search" }, - { in: "query", key: "limit" }, - ], - }, - ], - ) - return (options?.client ?? this.client).get({ - url: "/session", - ...options, - ...params, - }) - } - - /** - * Create session - * - * Create a new OpenCode session for interacting with AI assistants and managing conversations. - */ - public create( - parameters?: { - directory?: string - workspace?: string - parentID?: string - title?: string - agent?: string - model?: { - id: string - providerID: string - variant?: string - } - metadata?: { - [key: string]: unknown - } - permission?: PermissionRuleset - workspaceID?: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - { in: "body", key: "parentID" }, - { in: "body", key: "title" }, - { in: "body", key: "agent" }, - { in: "body", key: "model" }, - { in: "body", key: "metadata" }, - { in: "body", key: "permission" }, - { in: "body", key: "workspaceID" }, - ], - }, - ], - ) - return (options?.client ?? this.client).post({ - url: "/session", - ...options, - ...params, - headers: { - "Content-Type": "application/json", - ...options?.headers, - ...params.headers, - }, - }) - } - - /** - * Get session status - * - * Retrieve the current status of all sessions, including active, idle, and completed states. - */ - public status( - parameters?: { - directory?: string - workspace?: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - ], - }, - ], - ) - return (options?.client ?? this.client).get({ - url: "/session/status", - ...options, - ...params, - }) - } - - /** - * Delete session - * - * Delete a session and permanently remove all associated data, including messages and history. - */ - public delete( - parameters: { - sessionID: string - directory?: string - workspace?: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "sessionID" }, - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - ], - }, - ], - ) - return (options?.client ?? this.client).delete({ - url: "/session/{sessionID}", - ...options, - ...params, - }) - } - - /** - * Get session - * - * Retrieve detailed information about a specific OpenCode session. - */ - public get( - parameters: { - sessionID: string - directory?: string - workspace?: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "sessionID" }, - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - ], - }, - ], - ) - return (options?.client ?? this.client).get({ - url: "/session/{sessionID}", - ...options, - ...params, - }) - } - - /** - * Update session - * - * Update properties of an existing session, such as title or other metadata. - */ - public update( - parameters: { - sessionID: string - directory?: string - workspace?: string - title?: string - metadata?: { - [key: string]: unknown - } - permission?: PermissionRuleset - time?: { - archived?: number - } - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "sessionID" }, - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - { in: "body", key: "title" }, - { in: "body", key: "metadata" }, - { in: "body", key: "permission" }, - { in: "body", key: "time" }, - ], - }, - ], - ) - return (options?.client ?? this.client).patch({ - url: "/session/{sessionID}", - ...options, - ...params, - headers: { - "Content-Type": "application/json", - ...options?.headers, - ...params.headers, - }, - }) - } - - /** - * Get session children - * - * Retrieve all child sessions that were forked from the specified parent session. - */ - public children( - parameters: { - sessionID: string - directory?: string - workspace?: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "sessionID" }, - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - ], - }, - ], - ) - return (options?.client ?? this.client).get({ - url: "/session/{sessionID}/children", - ...options, - ...params, - }) - } - - /** - * Get message diff - * - * Get the file changes (diff) that resulted from a specific user message in the session. - */ - public diff( - parameters: { - sessionID: string - directory?: string - workspace?: string - messageID?: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "sessionID" }, - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - { in: "query", key: "messageID" }, - ], - }, - ], - ) - return (options?.client ?? this.client).get({ - url: "/session/{sessionID}/diff", - ...options, - ...params, - }) - } - - /** - * Get session messages - * - * Retrieve all messages in a session, including user prompts and AI responses. - */ - public messages( - parameters: { - sessionID: string - directory?: string - workspace?: string - limit?: number - before?: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "sessionID" }, - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - { in: "query", key: "limit" }, - { in: "query", key: "before" }, - ], - }, - ], - ) - return (options?.client ?? this.client).get({ - url: "/session/{sessionID}/message", - ...options, - ...params, - }) - } - - /** - * Send message - * - * Create and send a new message to a session, streaming the AI response. - */ - public prompt( - parameters: { - sessionID: string - directory?: string - workspace?: string - messageID?: string - model?: { - providerID: string - modelID: string - } - agent?: string - noReply?: boolean - tools?: { - [key: string]: boolean - } - format?: OutputFormat - system?: string - variant?: string - parts?: Array - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "sessionID" }, - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - { in: "body", key: "messageID" }, - { in: "body", key: "model" }, - { in: "body", key: "agent" }, - { in: "body", key: "noReply" }, - { in: "body", key: "tools" }, - { in: "body", key: "format" }, - { in: "body", key: "system" }, - { in: "body", key: "variant" }, - { in: "body", key: "parts" }, - ], - }, - ], - ) - return (options?.client ?? this.client).post({ - url: "/session/{sessionID}/message", - ...options, - ...params, - headers: { - "Content-Type": "application/json", - ...options?.headers, - ...params.headers, - }, - }) - } - - /** - * Delete message - * - * Permanently delete a specific message and all of its parts from a session without reverting file changes. - */ - public deleteMessage( - parameters: { - sessionID: string - messageID: string - directory?: string - workspace?: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "sessionID" }, - { in: "path", key: "messageID" }, - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - ], - }, - ], - ) - return (options?.client ?? this.client).delete< - SessionDeleteMessageResponses, - SessionDeleteMessageErrors, - ThrowOnError - >({ - url: "/session/{sessionID}/message/{messageID}", - ...options, - ...params, - }) - } - - /** - * Get message - * - * Retrieve a specific message from a session by its message ID. - */ - public message( - parameters: { - sessionID: string - messageID: string - directory?: string - workspace?: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "sessionID" }, - { in: "path", key: "messageID" }, - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - ], - }, - ], - ) - return (options?.client ?? this.client).get({ - url: "/session/{sessionID}/message/{messageID}", - ...options, - ...params, - }) - } - - /** - * Fork session - * - * Create a new session by forking an existing session at a specific message point. - */ - public fork( - parameters: { - sessionID: string - directory?: string - workspace?: string - messageID?: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "sessionID" }, - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - { in: "body", key: "messageID" }, - ], - }, - ], - ) - return (options?.client ?? this.client).post({ - url: "/session/{sessionID}/fork", - ...options, - ...params, - headers: { - "Content-Type": "application/json", - ...options?.headers, - ...params.headers, - }, - }) - } - - /** - * Abort session - * - * Abort an active session and stop any ongoing AI processing or command execution. - */ - public abort( - parameters: { - sessionID: string - directory?: string - workspace?: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "sessionID" }, - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - ], - }, - ], - ) - return (options?.client ?? this.client).post({ - url: "/session/{sessionID}/abort", - ...options, - ...params, - }) - } - - /** - * Initialize session - * - * Analyze the current application and create an AGENTS.md file with project-specific agent configurations. - */ - public init( - parameters: { - sessionID: string - directory?: string - workspace?: string - modelID?: string - providerID?: string - messageID?: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "sessionID" }, - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - { in: "body", key: "modelID" }, - { in: "body", key: "providerID" }, - { in: "body", key: "messageID" }, - ], - }, - ], - ) - return (options?.client ?? this.client).post({ - url: "/session/{sessionID}/init", - ...options, - ...params, - headers: { - "Content-Type": "application/json", - ...options?.headers, - ...params.headers, - }, - }) - } - - /** - * Unshare session - * - * Remove the shareable link for a session, making it private again. - */ - public unshare( - parameters: { - sessionID: string - directory?: string - workspace?: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "sessionID" }, - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - ], - }, - ], - ) - return (options?.client ?? this.client).delete({ - url: "/session/{sessionID}/share", - ...options, - ...params, - }) - } - - /** - * Share session - * - * Create a shareable link for a session, allowing others to view the conversation. - */ - public share( - parameters: { - sessionID: string - directory?: string - workspace?: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "sessionID" }, - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - ], - }, - ], - ) - return (options?.client ?? this.client).post({ - url: "/session/{sessionID}/share", - ...options, - ...params, - }) - } - - /** - * Summarize session - * - * Generate a concise summary of the session using AI compaction to preserve key information. - */ - public summarize( - parameters: { - sessionID: string - directory?: string - workspace?: string - providerID?: string - modelID?: string - auto?: boolean - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "sessionID" }, - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - { in: "body", key: "providerID" }, - { in: "body", key: "modelID" }, - { in: "body", key: "auto" }, - ], - }, - ], - ) - return (options?.client ?? this.client).post({ - url: "/session/{sessionID}/summarize", - ...options, - ...params, - headers: { - "Content-Type": "application/json", - ...options?.headers, - ...params.headers, - }, - }) - } - - /** - * Send async message - * - * Create and send a new message to a session asynchronously, starting the session if needed and returning immediately. - */ - public promptAsync( - parameters: { - sessionID: string - directory?: string - workspace?: string - messageID?: string - model?: { - providerID: string - modelID: string - } - agent?: string - noReply?: boolean - tools?: { - [key: string]: boolean - } - format?: OutputFormat - system?: string - variant?: string - parts?: Array - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "sessionID" }, - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - { in: "body", key: "messageID" }, - { in: "body", key: "model" }, - { in: "body", key: "agent" }, - { in: "body", key: "noReply" }, - { in: "body", key: "tools" }, - { in: "body", key: "format" }, - { in: "body", key: "system" }, - { in: "body", key: "variant" }, - { in: "body", key: "parts" }, - ], - }, - ], - ) - return (options?.client ?? this.client).post({ - url: "/session/{sessionID}/prompt_async", - ...options, - ...params, - headers: { - "Content-Type": "application/json", - ...options?.headers, - ...params.headers, - }, - }) - } - - /** - * Send command - * - * Send a new command to a session for execution by the AI assistant. - */ - public command( - parameters: { - sessionID: string - directory?: string - workspace?: string - messageID?: string - agent?: string - model?: string - arguments?: string - command?: string - variant?: string - parts?: Array<{ - id?: string - type: "file" - mime: string - filename?: string - url: string - source?: FilePartSource - }> - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "sessionID" }, - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - { in: "body", key: "messageID" }, - { in: "body", key: "agent" }, - { in: "body", key: "model" }, - { in: "body", key: "arguments" }, - { in: "body", key: "command" }, - { in: "body", key: "variant" }, - { in: "body", key: "parts" }, - ], - }, - ], - ) - return (options?.client ?? this.client).post({ - url: "/session/{sessionID}/command", - ...options, - ...params, - headers: { - "Content-Type": "application/json", - ...options?.headers, - ...params.headers, - }, - }) - } - - /** - * Run shell command - * - * Execute a shell command within the session context and return the AI's response. - */ - public shell( - parameters: { - sessionID: string - directory?: string - workspace?: string - messageID?: string - agent?: string - model?: { - providerID: string - modelID: string - } - command?: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "sessionID" }, - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - { in: "body", key: "messageID" }, - { in: "body", key: "agent" }, - { in: "body", key: "model" }, - { in: "body", key: "command" }, - ], - }, - ], - ) - return (options?.client ?? this.client).post({ - url: "/session/{sessionID}/shell", - ...options, - ...params, - headers: { - "Content-Type": "application/json", - ...options?.headers, - ...params.headers, - }, - }) - } - - /** - * Revert message - * - * Revert a specific message in a session, undoing its effects and restoring the previous state. - */ - public revert( - parameters: { - sessionID: string - directory?: string - workspace?: string - messageID?: string - partID?: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "sessionID" }, - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - { in: "body", key: "messageID" }, - { in: "body", key: "partID" }, - ], - }, - ], - ) - return (options?.client ?? this.client).post({ - url: "/session/{sessionID}/revert", - ...options, - ...params, - headers: { - "Content-Type": "application/json", - ...options?.headers, - ...params.headers, - }, - }) - } - - /** - * Restore reverted messages - * - * Restore all previously reverted messages in a session. - */ - public unrevert( - parameters: { - sessionID: string - directory?: string - workspace?: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "sessionID" }, - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - ], - }, - ], - ) - return (options?.client ?? this.client).post({ - url: "/session/{sessionID}/unrevert", - ...options, - ...params, - }) - } -} - -export class Part extends HeyApiClient { - /** - * Delete a part from a message. - */ - public delete( - parameters: { - sessionID: string - messageID: string - partID: string - directory?: string - workspace?: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "sessionID" }, - { in: "path", key: "messageID" }, - { in: "path", key: "partID" }, - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - ], - }, - ], - ) - return (options?.client ?? this.client).delete({ - url: "/session/{sessionID}/message/{messageID}/part/{partID}", - ...options, - ...params, - }) - } - - /** - * Update a part in a message. - */ - public update( - parameters: { - sessionID: string - messageID: string - partID: string - directory?: string - workspace?: string - part?: Part2 - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "sessionID" }, - { in: "path", key: "messageID" }, - { in: "path", key: "partID" }, - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - { key: "part", map: "body" }, - ], - }, - ], - ) - return (options?.client ?? this.client).patch({ - url: "/session/{sessionID}/message/{messageID}/part/{partID}", - ...options, - ...params, - headers: { - "Content-Type": "application/json", - ...options?.headers, - ...params.headers, - }, - }) - } -} - -export class History extends HeyApiClient { - /** - * List sync events - * - * List sync events for all aggregates. Keys are aggregate IDs the client already knows about, values are the last known sequence ID. Events with seq > value are returned for those aggregates. Aggregates not listed in the input get their full history. - */ - public list( - parameters?: { - directory?: string - workspace?: string - body?: { - [key: string]: number - } - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - { key: "body", map: "body" }, - ], - }, - ], - ) - return (options?.client ?? this.client).post({ - url: "/sync/history", - ...options, - ...params, - headers: { - "Content-Type": "application/json", - ...options?.headers, - ...params.headers, - }, - }) - } -} - -export class Sync extends HeyApiClient { - /** - * Start workspace sync - * - * Start sync loops for workspaces in the current project that have active sessions. - */ - public start( - parameters?: { - directory?: string - workspace?: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - ], - }, - ], - ) - return (options?.client ?? this.client).post({ - url: "/sync/start", - ...options, - ...params, - }) - } - - /** - * Replay sync events - * - * Validate and replay a complete sync event history. - */ - public replay( - parameters?: { - query_directory?: string - workspace?: string - body_directory?: string - events?: Array<{ - id: string - aggregateID: string - seq: number - type: string - data: { - [key: string]: unknown - } - }> - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { - in: "query", - key: "query_directory", - map: "directory", - }, - { in: "query", key: "workspace" }, - { - in: "body", - key: "body_directory", - map: "directory", - }, - { in: "body", key: "events" }, - ], - }, - ], - ) - return (options?.client ?? this.client).post({ - url: "/sync/replay", - ...options, - ...params, - headers: { - "Content-Type": "application/json", - ...options?.headers, - ...params.headers, - }, - }) - } - - /** - * Steal session into workspace - * - * Update a session to belong to the current workspace through the sync event system. - */ - public steal( - parameters?: { - directory?: string - workspace?: string - sessionID?: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - { in: "body", key: "sessionID" }, - ], - }, - ], - ) - return (options?.client ?? this.client).post({ - url: "/sync/steal", - ...options, - ...params, - headers: { - "Content-Type": "application/json", - ...options?.headers, - ...params.headers, - }, - }) - } - - private _history?: History - get history(): History { - return (this._history ??= new History({ client: this.client })) - } -} - -export class Control extends HeyApiClient { - /** - * Get next TUI request - * - * Retrieve the next TUI request from the queue for processing. - */ - public next( - parameters?: { - directory?: string - workspace?: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - ], - }, - ], - ) - return (options?.client ?? this.client).get({ - url: "/tui/control/next", - ...options, - ...params, - }) - } - - /** - * Submit TUI response - * - * Submit a response to the TUI request queue to complete a pending request. - */ - public response( - parameters?: { - directory?: string - workspace?: string - body?: unknown - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - { key: "body", map: "body" }, - ], - }, - ], - ) - return (options?.client ?? this.client).post({ - url: "/tui/control/response", - ...options, - ...params, - headers: { - "Content-Type": "application/json", - ...options?.headers, - ...params.headers, - }, - }) - } -} - -export class Tui extends HeyApiClient { - /** - * Append TUI prompt - * - * Append prompt to the TUI. - */ - public appendPrompt( - parameters?: { - directory?: string - workspace?: string - text?: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - { in: "body", key: "text" }, - ], - }, - ], - ) - return (options?.client ?? this.client).post({ - url: "/tui/append-prompt", - ...options, - ...params, - headers: { - "Content-Type": "application/json", - ...options?.headers, - ...params.headers, - }, - }) - } - - /** - * Open help dialog - * - * Open the help dialog in the TUI to display user assistance information. - */ - public openHelp( - parameters?: { - directory?: string - workspace?: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - ], - }, - ], - ) - return (options?.client ?? this.client).post({ - url: "/tui/open-help", - ...options, - ...params, - }) - } - - /** - * Open sessions dialog - * - * Open the session dialog. - */ - public openSessions( - parameters?: { - directory?: string - workspace?: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - ], - }, - ], - ) - return (options?.client ?? this.client).post({ - url: "/tui/open-sessions", - ...options, - ...params, - }) - } - - /** - * Open themes dialog - * - * Open the theme dialog. - */ - public openThemes( - parameters?: { - directory?: string - workspace?: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - ], - }, - ], - ) - return (options?.client ?? this.client).post({ - url: "/tui/open-themes", - ...options, - ...params, - }) - } - - /** - * Open models dialog - * - * Open the model dialog. - */ - public openModels( - parameters?: { - directory?: string - workspace?: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - ], - }, - ], - ) - return (options?.client ?? this.client).post({ - url: "/tui/open-models", - ...options, - ...params, - }) - } - - /** - * Submit TUI prompt - * - * Submit the prompt. - */ - public submitPrompt( - parameters?: { - directory?: string - workspace?: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - ], - }, - ], - ) - return (options?.client ?? this.client).post({ - url: "/tui/submit-prompt", - ...options, - ...params, - }) - } - - /** - * Clear TUI prompt - * - * Clear the prompt. - */ - public clearPrompt( - parameters?: { - directory?: string - workspace?: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - ], - }, - ], - ) - return (options?.client ?? this.client).post({ - url: "/tui/clear-prompt", - ...options, - ...params, - }) - } - - /** - * Execute TUI command - * - * Execute a TUI command. - */ - public executeCommand( - parameters?: { - directory?: string - workspace?: string - command?: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - { in: "body", key: "command" }, - ], - }, - ], - ) - return (options?.client ?? this.client).post({ - url: "/tui/execute-command", - ...options, - ...params, - headers: { - "Content-Type": "application/json", - ...options?.headers, - ...params.headers, - }, - }) - } - - /** - * Show TUI toast - * - * Show a toast notification in the TUI. - */ - public showToast( - parameters?: { - directory?: string - workspace?: string - title?: string - message?: string - variant?: "info" | "success" | "warning" | "error" - duration?: number - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - { in: "body", key: "title" }, - { in: "body", key: "message" }, - { in: "body", key: "variant" }, - { in: "body", key: "duration" }, - ], - }, - ], - ) - return (options?.client ?? this.client).post({ - url: "/tui/show-toast", - ...options, - ...params, - headers: { - "Content-Type": "application/json", - ...options?.headers, - ...params.headers, - }, - }) - } - - /** - * Publish TUI event - * - * Publish a TUI event. - */ - public publish( - parameters?: { - directory?: string - workspace?: string - body?: EventTuiPromptAppend | EventTuiCommandExecute | EventTuiToastShow | EventTuiSessionSelect - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - { key: "body", map: "body" }, - ], - }, - ], - ) - return (options?.client ?? this.client).post({ - url: "/tui/publish", - ...options, - ...params, - headers: { - "Content-Type": "application/json", - ...options?.headers, - ...params.headers, - }, - }) - } - - /** - * Select session - * - * Navigate the TUI to display the specified session. - */ - public selectSession( - parameters?: { - directory?: string - workspace?: string - sessionID?: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "query", key: "directory" }, - { in: "query", key: "workspace" }, - { in: "body", key: "sessionID" }, - ], - }, - ], - ) - return (options?.client ?? this.client).post({ - url: "/tui/select-session", - ...options, - ...params, - headers: { - "Content-Type": "application/json", - ...options?.headers, - ...params.headers, - }, - }) - } - - private _control?: Control - get control(): Control { - return (this._control ??= new Control({ client: this.client })) - } -} - -export class Health extends HeyApiClient { - /** - * Check server health - * - * Report the owning server process and its application status. - */ - public get(options?: Options) { - return (options?.client ?? this.client).get({ - url: "/api/health", - ...options, - }) - } - - /** - * Stop the managed server - * - * Request graceful shutdown of one exact managed server instance. - */ - public stop( - parameters: { - serviceStopRequest: ServiceStopRequest - }, - options?: Options, - ) { - const params = buildClientParams([parameters], [{ args: [{ key: "serviceStopRequest", map: "body" }] }]) - return (options?.client ?? this.client).post({ - url: "/api/service/stop", - ...options, - ...params, - headers: { - "Content-Type": "application/json", - ...options?.headers, - ...params.headers, - }, - }) - } -} - -export class Server extends HeyApiClient { - /** - * Get server information - * - * Return the URLs that can be used to connect to this server. - */ - public get(options?: Options) { - return (options?.client ?? this.client).get({ - url: "/api/server", - ...options, - }) - } -} - -export class Location extends HeyApiClient { - /** - * Get location - * - * Resolve the requested location or the server default location. - */ - public get( - parameters?: { - location?: { - directory?: string | null - workspace?: string | null - } | null - }, - options?: Options, - ) { - const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "location" }] }]) - return (options?.client ?? this.client).get({ - url: "/api/location", - ...options, - ...params, - }) - } -} - -export class Agent extends HeyApiClient { - /** - * List agents - * - * Retrieve currently registered agents. - */ - public list( - parameters?: { - location?: { - directory?: string | null - workspace?: string | null - } | null - }, - options?: Options, - ) { - const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "location" }] }]) - return (options?.client ?? this.client).get({ - url: "/api/agent", - ...options, - ...params, - }) - } -} - -export class Plugin extends HeyApiClient { - /** - * List plugins - * - * Retrieve currently loaded plugins. - */ - public list( - parameters?: { - location?: { - directory?: string | null - workspace?: string | null - } | null - }, - options?: Options, - ) { - const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "location" }] }]) - return (options?.client ?? this.client).get({ - url: "/api/plugin", - ...options, - ...params, - }) - } -} - -export class Revert extends HeyApiClient { - /** - * Stage session revert - * - * Stage or move a reversible session boundary and optionally apply its file changes. - */ - public stage( - parameters: { - sessionID: string - messageID?: string - files?: boolean | null - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "sessionID" }, - { in: "body", key: "messageID" }, - { in: "body", key: "files" }, - ], - }, - ], - ) - return (options?.client ?? this.client).post< - V2SessionRevertStageResponses, - V2SessionRevertStageErrors, - ThrowOnError - >({ - url: "/api/session/{sessionID}/revert/stage", - ...options, - ...params, - headers: { - "Content-Type": "application/json", - ...options?.headers, - ...params.headers, - }, - }) - } - - /** - * Clear staged revert - */ - public clear( - parameters: { - sessionID: string - }, - options?: Options, - ) { - const params = buildClientParams([parameters], [{ args: [{ in: "path", key: "sessionID" }] }]) - return (options?.client ?? this.client).post< - V2SessionRevertClearResponses, - V2SessionRevertClearErrors, - ThrowOnError - >({ - url: "/api/session/{sessionID}/revert/clear", - ...options, - ...params, - }) - } - - /** - * Commit staged revert - */ - public commit( - parameters: { - sessionID: string - }, - options?: Options, - ) { - const params = buildClientParams([parameters], [{ args: [{ in: "path", key: "sessionID" }] }]) - return (options?.client ?? this.client).post< - V2SessionRevertCommitResponses, - V2SessionRevertCommitErrors, - ThrowOnError - >({ - url: "/api/session/{sessionID}/revert/commit", - ...options, - ...params, - }) - } -} - -export class Pending extends HeyApiClient { - /** - * List pending session work - * - * List durable admitted session work not yet visible in projected history, ordered by admission. Includes unpromoted user and synthetic inputs and unhandled compaction barriers. The runner owns consumption; items disappear once promoted or handled. - */ - public list( - parameters: { - sessionID: string - }, - options?: Options, - ) { - const params = buildClientParams([parameters], [{ args: [{ in: "path", key: "sessionID" }] }]) - return (options?.client ?? this.client).get< - V2SessionPendingListResponses, - V2SessionPendingListErrors, - ThrowOnError - >({ - url: "/api/session/{sessionID}/pending", - ...options, - ...params, - }) - } -} - -export class Entry extends HeyApiClient { - /** - * List instruction entries - * - * List API-managed instruction entries attached to the session. - */ - public list( - parameters: { - sessionID: string - }, - options?: Options, - ) { - const params = buildClientParams([parameters], [{ args: [{ in: "path", key: "sessionID" }] }]) - return (options?.client ?? this.client).get< - V2SessionInstructionsEntryListResponses, - V2SessionInstructionsEntryListErrors, - ThrowOnError - >({ - url: "/api/session/{sessionID}/instructions/entries", - ...options, - ...params, - }) - } - - /** - * Remove instruction entry - * - * Remove one instruction entry; the removal is announced to the model at the next step boundary. - */ - public remove( - parameters: { - sessionID: string - key: InstructionEntryKeyV2 - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "sessionID" }, - { in: "path", key: "key" }, - ], - }, - ], - ) - return (options?.client ?? this.client).delete< - V2SessionInstructionsEntryRemoveResponses, - V2SessionInstructionsEntryRemoveErrors, - ThrowOnError - >({ - url: "/api/session/{sessionID}/instructions/entries/{key}", - ...options, - ...params, - }) - } - - /** - * Put instruction entry - * - * Attach or replace one durable instruction entry. Changes announce as updates at the next step boundary. - */ - public put( - parameters: { - sessionID: string - key: InstructionEntryKeyV2 - value?: unknown - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "sessionID" }, - { in: "path", key: "key" }, - { in: "body", key: "value" }, - ], - }, - ], - ) - return (options?.client ?? this.client).put< - V2SessionInstructionsEntryPutResponses, - V2SessionInstructionsEntryPutErrors, - ThrowOnError - >({ - url: "/api/session/{sessionID}/instructions/entries/{key}", - ...options, - ...params, - headers: { - "Content-Type": "application/json", - ...options?.headers, - ...params.headers, - }, - }) - } -} - -export class Instructions extends HeyApiClient { - private _entry?: Entry - get entry(): Entry { - return (this._entry ??= new Entry({ client: this.client })) - } -} - -export class Form extends HeyApiClient { - /** - * List session forms - * - * Retrieve pending forms for a session. - */ - public list( - parameters: { - sessionID: string - }, - options?: Options, - ) { - const params = buildClientParams([parameters], [{ args: [{ in: "path", key: "sessionID" }] }]) - return (options?.client ?? this.client).get({ - url: "/api/session/{sessionID}/form", - ...options, - ...params, - }) - } - - /** - * Create session form - * - * Create a form for a session. - */ - public create( - parameters: { - sessionID: string - formCreatePayloadV2: FormCreatePayloadV2 - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "sessionID" }, - { key: "formCreatePayloadV2", map: "body" }, - ], - }, - ], - ) - return (options?.client ?? this.client).post( - { - url: "/api/session/{sessionID}/form", - ...options, - ...params, - headers: { - "Content-Type": "application/json", - ...options?.headers, - ...params.headers, - }, - }, - ) - } - - /** - * Get session form - * - * Retrieve a form for a session. - */ - public get( - parameters: { - sessionID: string - formID: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "sessionID" }, - { in: "path", key: "formID" }, - ], - }, - ], - ) - return (options?.client ?? this.client).get({ - url: "/api/session/{sessionID}/form/{formID}", - ...options, - ...params, - }) - } - - /** - * Get form state - * - * Retrieve the current state for a form. - */ - public state( - parameters: { - sessionID: string - formID: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "sessionID" }, - { in: "path", key: "formID" }, - ], - }, - ], - ) - return (options?.client ?? this.client).get({ - url: "/api/session/{sessionID}/form/{formID}/state", - ...options, - ...params, - }) - } - - /** - * Reply to form - * - * Submit an answer to a pending form. - */ - public reply( - parameters: { - sessionID: string - formID: string - formReply: FormReply - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "sessionID" }, - { in: "path", key: "formID" }, - { key: "formReply", map: "body" }, - ], - }, - ], - ) - return (options?.client ?? this.client).post({ - url: "/api/session/{sessionID}/form/{formID}/reply", - ...options, - ...params, - headers: { - "Content-Type": "application/json", - ...options?.headers, - ...params.headers, - }, - }) - } - - /** - * Cancel form - * - * Cancel a pending form. - */ - public cancel( - parameters: { - sessionID: string - formID: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "sessionID" }, - { in: "path", key: "formID" }, - ], - }, - ], - ) - return (options?.client ?? this.client).post( - { - url: "/api/session/{sessionID}/form/{formID}/cancel", - ...options, - ...params, - }, - ) - } -} - -export class Permission2 extends HeyApiClient { - /** - * List session permission requests - * - * Retrieve pending permission requests owned by a session. - */ - public list( - parameters: { - sessionID: string - }, - options?: Options, - ) { - const params = buildClientParams([parameters], [{ args: [{ in: "path", key: "sessionID" }] }]) - return (options?.client ?? this.client).get< - V2SessionPermissionListResponses, - V2SessionPermissionListErrors, - ThrowOnError - >({ - url: "/api/session/{sessionID}/permission", - ...options, - ...params, - }) - } - - /** - * Create permission request - * - * Evaluate and, when approval is required, create a permission request for a session. - */ - public create( - parameters: { - sessionID: string - id?: string | null - action?: string - resources?: Array - save?: Array - metadata?: { - [key: string]: unknown - } - source?: PermissionV2SourceV2 - agent?: string | null - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "sessionID" }, - { in: "body", key: "id" }, - { in: "body", key: "action" }, - { in: "body", key: "resources" }, - { in: "body", key: "save" }, - { in: "body", key: "metadata" }, - { in: "body", key: "source" }, - { in: "body", key: "agent" }, - ], - }, - ], - ) - return (options?.client ?? this.client).post< - V2SessionPermissionCreateResponses, - V2SessionPermissionCreateErrors, - ThrowOnError - >({ - url: "/api/session/{sessionID}/permission", - ...options, - ...params, - headers: { - "Content-Type": "application/json", - ...options?.headers, - ...params.headers, - }, - }) - } - - /** - * Get permission request - * - * Retrieve a pending permission request owned by a session. - */ - public get( - parameters: { - sessionID: string - requestID: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "sessionID" }, - { in: "path", key: "requestID" }, - ], - }, - ], - ) - return (options?.client ?? this.client).get< - V2SessionPermissionGetResponses, - V2SessionPermissionGetErrors, - ThrowOnError - >({ - url: "/api/session/{sessionID}/permission/{requestID}", - ...options, - ...params, - }) - } - - /** - * Reply to pending permission request - * - * Respond to a pending permission request owned by a session. - */ - public reply( - parameters: { - sessionID: string - requestID: string - reply?: PermissionV2Reply - message?: string | null - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "sessionID" }, - { in: "path", key: "requestID" }, - { in: "body", key: "reply" }, - { in: "body", key: "message" }, - ], - }, - ], - ) - return (options?.client ?? this.client).post< - V2SessionPermissionReplyResponses, - V2SessionPermissionReplyErrors, - ThrowOnError - >({ - url: "/api/session/{sessionID}/permission/{requestID}/reply", - ...options, - ...params, - headers: { - "Content-Type": "application/json", - ...options?.headers, - ...params.headers, - }, - }) - } -} - -export class Question2 extends HeyApiClient { - /** - * List session question requests - * - * Retrieve pending question requests owned by a session. - */ - public list( - parameters: { - sessionID: string - }, - options?: Options, - ) { - const params = buildClientParams([parameters], [{ args: [{ in: "path", key: "sessionID" }] }]) - return (options?.client ?? this.client).get< - V2SessionQuestionListResponses, - V2SessionQuestionListErrors, - ThrowOnError - >({ - url: "/api/session/{sessionID}/question", - ...options, - ...params, - }) - } - - /** - * Reply to pending question request - * - * Answer a pending question request owned by a session. - */ - public reply( - parameters: { - sessionID: string - requestID: string - questionV2Reply: QuestionV2Reply - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "sessionID" }, - { in: "path", key: "requestID" }, - { key: "questionV2Reply", map: "body" }, - ], - }, - ], - ) - return (options?.client ?? this.client).post< - V2SessionQuestionReplyResponses, - V2SessionQuestionReplyErrors, - ThrowOnError - >({ - url: "/api/session/{sessionID}/question/{requestID}/reply", - ...options, - ...params, - headers: { - "Content-Type": "application/json", - ...options?.headers, - ...params.headers, - }, - }) - } - - /** - * Reject pending question request - * - * Reject a pending question request owned by a session. - */ - public reject( - parameters: { - sessionID: string - requestID: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "sessionID" }, - { in: "path", key: "requestID" }, - ], - }, - ], - ) - return (options?.client ?? this.client).post< - V2SessionQuestionRejectResponses, - V2SessionQuestionRejectErrors, - ThrowOnError - >({ - url: "/api/session/{sessionID}/question/{requestID}/reject", - ...options, - ...params, - }) - } -} - -export class Session3 extends HeyApiClient { - /** - * List sessions - * - * Retrieve sessions in the requested order. Items keep that order across pages; use cursor.next or cursor.previous to move through the ordered list. - */ - public list( - parameters?: { - workspace?: string | null - limit?: number | null - order?: "asc" | "desc" | null - search?: string | null - parentID?: string | "null" | null - directory?: string | null - project?: string | null - subpath?: string | null - cursor?: string | null - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "query", key: "workspace" }, - { in: "query", key: "limit" }, - { in: "query", key: "order" }, - { in: "query", key: "search" }, - { in: "query", key: "parentID" }, - { in: "query", key: "directory" }, - { in: "query", key: "project" }, - { in: "query", key: "subpath" }, - { in: "query", key: "cursor" }, - ], - }, - ], - ) - return (options?.client ?? this.client).get({ - url: "/api/session", - ...options, - ...params, - }) - } - - /** - * Create session - * - * Create a session at the requested location. - */ - public create( - parameters?: { - id?: string | null - agent?: string | null - model?: ModelRef | null - location?: LocationRefV2 | null - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "body", key: "id" }, - { in: "body", key: "agent" }, - { in: "body", key: "model" }, - { in: "body", key: "location" }, - ], - }, - ], - ) - return (options?.client ?? this.client).post({ - url: "/api/session", - ...options, - ...params, - headers: { - "Content-Type": "application/json", - ...options?.headers, - ...params.headers, - }, - }) - } - - /** - * List active sessions - * - * Retrieve foreground Session drains currently owned by this OpenCode process. Sessions absent from the result are inactive. - */ - public active(options?: Options) { - return (options?.client ?? this.client).get({ - url: "/api/session/active", - ...options, - }) - } - - /** - * Delete session - * - * Delete a session and its child sessions. - */ - public remove( - parameters: { - sessionID: string - }, - options?: Options, - ) { - const params = buildClientParams([parameters], [{ args: [{ in: "path", key: "sessionID" }] }]) - return (options?.client ?? this.client).delete({ - url: "/api/session/{sessionID}", - ...options, - ...params, - }) - } - - /** - * Get session - * - * Retrieve a session by ID. - */ - public get( - parameters: { - sessionID: string - }, - options?: Options, - ) { - const params = buildClientParams([parameters], [{ args: [{ in: "path", key: "sessionID" }] }]) - return (options?.client ?? this.client).get({ - url: "/api/session/{sessionID}", - ...options, - ...params, - }) - } - - /** - * Fork session - * - * Create a child session by copying projected history from the parent. When messageID is supplied, copy messages before that boundary. - */ - public fork( - parameters: { - sessionID: string - messageID?: string | null - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "sessionID" }, - { in: "body", key: "messageID" }, - ], - }, - ], - ) - return (options?.client ?? this.client).post({ - url: "/api/session/{sessionID}/fork", - ...options, - ...params, - headers: { - "Content-Type": "application/json", - ...options?.headers, - ...params.headers, - }, - }) - } - - /** - * Switch session agent - * - * Switch the agent used by subsequent provider turns. - */ - public switchAgent( - parameters: { - sessionID: string - agent?: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "sessionID" }, - { in: "body", key: "agent" }, - ], - }, - ], - ) - return (options?.client ?? this.client).post< - V2SessionSwitchAgentResponses, - V2SessionSwitchAgentErrors, - ThrowOnError - >({ - url: "/api/session/{sessionID}/agent", - ...options, - ...params, - headers: { - "Content-Type": "application/json", - ...options?.headers, - ...params.headers, - }, - }) - } - - /** - * Switch session model - * - * Switch the model used by subsequent provider turns. - */ - public switchModel( - parameters: { - sessionID: string - model?: ModelRef - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "sessionID" }, - { in: "body", key: "model" }, - ], - }, - ], - ) - return (options?.client ?? this.client).post< - V2SessionSwitchModelResponses, - V2SessionSwitchModelErrors, - ThrowOnError - >({ - url: "/api/session/{sessionID}/model", - ...options, - ...params, - headers: { - "Content-Type": "application/json", - ...options?.headers, - ...params.headers, - }, - }) - } - - /** - * Rename session - * - * Update the session title. - */ - public rename( - parameters: { - sessionID: string - title?: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "sessionID" }, - { in: "body", key: "title" }, - ], - }, - ], - ) - return (options?.client ?? this.client).post({ - url: "/api/session/{sessionID}/rename", - ...options, - ...params, - headers: { - "Content-Type": "application/json", - ...options?.headers, - ...params.headers, - }, - }) - } - - /** - * Move session - * - * Move a session to another project directory, optionally transferring local changes. - */ - public move( - parameters: { - sessionID: string - locationRefV2: LocationRefV2 - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "sessionID" }, - { key: "locationRefV2", map: "body" }, - ], - }, - ], - ) - return (options?.client ?? this.client).post({ - url: "/api/session/{sessionID}/move", - ...options, - ...params, - headers: { - "Content-Type": "application/json", - ...options?.headers, - ...params.headers, - }, - }) - } - - /** - * Send message - * - * Durably admit one session input and schedule agent-loop execution unless resume is false. - */ - public prompt( - parameters: { - sessionID: string - id?: string | null - text?: string - files?: Array - agents?: Array - metadata?: { - [key: string]: unknown - } - delivery?: "steer" | "queue" | null - resume?: boolean | null - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "sessionID" }, - { in: "body", key: "id" }, - { in: "body", key: "text" }, - { in: "body", key: "files" }, - { in: "body", key: "agents" }, - { in: "body", key: "metadata" }, - { in: "body", key: "delivery" }, - { in: "body", key: "resume" }, - ], - }, - ], - ) - return (options?.client ?? this.client).post({ - url: "/api/session/{sessionID}/prompt", - ...options, - ...params, - headers: { - "Content-Type": "application/json", - ...options?.headers, - ...params.headers, - }, - }) - } - - /** - * Run command - * - * Resolve a slash command into prompt input, admit it durably, and schedule execution unless resume is false. - */ - public command( - parameters: { - sessionID: string - id?: string | null - command?: string - arguments?: string | null - agent?: string | null - model?: ModelRef | null - files?: Array - agents?: Array - delivery?: "steer" | "queue" | null - resume?: boolean | null - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "sessionID" }, - { in: "body", key: "id" }, - { in: "body", key: "command" }, - { in: "body", key: "arguments" }, - { in: "body", key: "agent" }, - { in: "body", key: "model" }, - { in: "body", key: "files" }, - { in: "body", key: "agents" }, - { in: "body", key: "delivery" }, - { in: "body", key: "resume" }, - ], - }, - ], - ) - return (options?.client ?? this.client).post({ - url: "/api/session/{sessionID}/command", - ...options, - ...params, - headers: { - "Content-Type": "application/json", - ...options?.headers, - ...params.headers, - }, - }) - } - - /** - * Activate skill - * - * Activate a skill for a session by appending a skill message and resuming execution. - */ - public skill( - parameters: { - sessionID: string - id?: string | null - skill?: string - resume?: boolean | null - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "sessionID" }, - { in: "body", key: "id" }, - { in: "body", key: "skill" }, - { in: "body", key: "resume" }, - ], - }, - ], - ) - return (options?.client ?? this.client).post({ - url: "/api/session/{sessionID}/skill", - ...options, - ...params, - headers: { - "Content-Type": "application/json", - ...options?.headers, - ...params.headers, - }, - }) - } - - /** - * Add synthetic message - * - * Durably admit synthetic session input and schedule execution unless resume is false. - */ - public synthetic( - parameters: { - sessionID: string - id?: string | null - text?: string - description?: string | null - metadata?: { - [key: string]: unknown - } - delivery?: "steer" | "queue" | null - resume?: boolean | null - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "sessionID" }, - { in: "body", key: "id" }, - { in: "body", key: "text" }, - { in: "body", key: "description" }, - { in: "body", key: "metadata" }, - { in: "body", key: "delivery" }, - { in: "body", key: "resume" }, - ], - }, - ], - ) - return (options?.client ?? this.client).post({ - url: "/api/session/{sessionID}/synthetic", - ...options, - ...params, - headers: { - "Content-Type": "application/json", - ...options?.headers, - ...params.headers, - }, - }) - } - - /** - * Run shell command - * - * 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. - */ - public shell( - parameters: { - sessionID: string - id?: string | null - command?: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "sessionID" }, - { in: "body", key: "id" }, - { in: "body", key: "command" }, - ], - }, - ], - ) - return (options?.client ?? this.client).post({ - url: "/api/session/{sessionID}/shell", - ...options, - ...params, - headers: { - "Content-Type": "application/json", - ...options?.headers, - ...params.headers, - }, - }) - } - - /** - * Compact session - * - * Queue a durable session compaction request. - */ - public compact( - parameters: { - sessionID: string - id?: string | null - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "sessionID" }, - { in: "body", key: "id" }, - ], - }, - ], - ) - return (options?.client ?? this.client).post({ - url: "/api/session/{sessionID}/compact", - ...options, - ...params, - headers: { - "Content-Type": "application/json", - ...options?.headers, - ...params.headers, - }, - }) - } - - /** - * Wait for session - * - * Wait for a session agent loop to become idle. - */ - public wait( - parameters: { - sessionID: string - }, - options?: Options, - ) { - const params = buildClientParams([parameters], [{ args: [{ in: "path", key: "sessionID" }] }]) - return (options?.client ?? this.client).post({ - url: "/api/session/{sessionID}/wait", - ...options, - ...params, - }) - } - - /** - * Get session context - * - * Retrieve the active context messages for a session (all messages after the last compaction). - */ - public context( - parameters: { - sessionID: string - }, - options?: Options, - ) { - const params = buildClientParams([parameters], [{ args: [{ in: "path", key: "sessionID" }] }]) - return (options?.client ?? this.client).get({ - url: "/api/session/{sessionID}/context", - ...options, - ...params, - }) - } - - /** - * Generate text from session context - * - * Generate transient text from the current session context without mutating session history. - */ - public generate( - parameters: { - sessionID: string - prompt?: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "sessionID" }, - { in: "body", key: "prompt" }, - ], - }, - ], - ) - return (options?.client ?? this.client).post({ - url: "/api/session/{sessionID}/generate", - ...options, - ...params, - headers: { - "Content-Type": "application/json", - ...options?.headers, - ...params.headers, - }, - }) - } - - /** - * Read the session log - * - * Experimental durable session event log. Reads events after an exclusive aggregate sequence and continues with live events when follow=true. - */ - public log( - parameters: { - sessionID: string - after?: number | null - follow?: "true" | "false" | null - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "sessionID" }, - { in: "query", key: "after" }, - { in: "query", key: "follow" }, - ], - }, - ], - ) - return (options?.client ?? this.client).sse.get({ - url: "/api/experimental/session/{sessionID}/log", - ...options, - ...params, - }) - } - - /** - * Interrupt session execution - * - * Interrupt active execution owned by this OpenCode process. Idle interruption is a no-op. - */ - public interrupt( - parameters: { - sessionID: string - }, - options?: Options, - ) { - const params = buildClientParams([parameters], [{ args: [{ in: "path", key: "sessionID" }] }]) - return (options?.client ?? this.client).post({ - url: "/api/session/{sessionID}/interrupt", - ...options, - ...params, - }) - } - - /** - * Background blocking session tools - * - * Move active foreground backgroundable tools for this session into background observation. Idle requests are a no-op. - */ - public background( - parameters: { - sessionID: string - }, - options?: Options, - ) { - const params = buildClientParams([parameters], [{ args: [{ in: "path", key: "sessionID" }] }]) - return (options?.client ?? this.client).post( - { - url: "/api/session/{sessionID}/background", - ...options, - ...params, - }, - ) - } - - /** - * Get session message - * - * Retrieve one projected message owned by the Session. - */ - public message( - parameters: { - sessionID: string - messageID: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "sessionID" }, - { in: "path", key: "messageID" }, - ], - }, - ], - ) - return (options?.client ?? this.client).get({ - url: "/api/session/{sessionID}/message/{messageID}", - ...options, - ...params, - }) - } - - private _revert?: Revert - get revert(): Revert { - return (this._revert ??= new Revert({ client: this.client })) - } - - private _pending?: Pending - get pending(): Pending { - return (this._pending ??= new Pending({ client: this.client })) - } - - private _instructions?: Instructions - get instructions(): Instructions { - return (this._instructions ??= new Instructions({ client: this.client })) - } - - private _form?: Form - get form(): Form { - return (this._form ??= new Form({ client: this.client })) - } - - private _permission?: Permission2 - get permission(): Permission2 { - return (this._permission ??= new Permission2({ client: this.client })) - } - - private _question?: Question2 - get question(): Question2 { - return (this._question ??= new Question2({ client: this.client })) - } -} - -export class Message extends HeyApiClient { - /** - * Get session messages - * - * 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. - */ - public list( - parameters: { - sessionID: string - limit?: number | null - order?: "asc" | "desc" | null - cursor?: string | null - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "sessionID" }, - { in: "query", key: "limit" }, - { in: "query", key: "order" }, - { in: "query", key: "cursor" }, - ], - }, - ], - ) - return (options?.client ?? this.client).get({ - url: "/api/session/{sessionID}/message", - ...options, - ...params, - }) - } -} - -export class Model extends HeyApiClient { - /** - * List models - * - * Retrieve available models ordered by release date. - */ - public list( - parameters?: { - location?: { - directory?: string | null - workspace?: string | null - } | null - }, - options?: Options, - ) { - const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "location" }] }]) - return (options?.client ?? this.client).get({ - url: "/api/model", - ...options, - ...params, - }) - } - - /** - * Get default model - * - * Retrieve the model used when a session has no explicit model selection. - */ - public default( - parameters?: { - location?: { - directory?: string | null - workspace?: string | null - } | null - }, - options?: Options, - ) { - const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "location" }] }]) - return (options?.client ?? this.client).get({ - url: "/api/model/default", - ...options, - ...params, - }) - } -} - -export class Generate extends HeyApiClient { - /** - * Generate text - * - * Run one stateless model generation at the requested location and return the assistant text. Uses the location's default model when none is specified. - */ - public text( - parameters?: { - location?: { - directory?: string | null - workspace?: string | null - } | null - prompt?: string - model?: ModelRef | null - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "query", key: "location" }, - { in: "body", key: "prompt" }, - { in: "body", key: "model" }, - ], - }, - ], - ) - return (options?.client ?? this.client).post({ - url: "/api/generate", - ...options, - ...params, - headers: { - "Content-Type": "application/json", - ...options?.headers, - ...params.headers, - }, - }) - } -} - -export class Provider2 extends HeyApiClient { - /** - * List providers - * - * Retrieve active AI providers so clients can show provider availability and configuration. - */ - public list( - parameters?: { - location?: { - directory?: string | null - workspace?: string | null - } | null - }, - options?: Options, - ) { - const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "location" }] }]) - return (options?.client ?? this.client).get({ - url: "/api/provider", - ...options, - ...params, - }) - } - - /** - * Get provider - * - * Retrieve a single AI provider so clients can inspect its availability and endpoint settings. - */ - public get( - parameters: { - providerID: string - location?: { - directory?: string | null - workspace?: string | null - } | null - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "providerID" }, - { in: "query", key: "location" }, - ], - }, - ], - ) - return (options?.client ?? this.client).get({ - url: "/api/provider/{providerID}", - ...options, - ...params, - }) - } -} - -export class Connect extends HeyApiClient { - /** - * Connect with key - * - * Run a key authentication method and store the resulting credential. - */ - public key( - parameters: { - integrationID: string - location?: { - directory?: string | null - workspace?: string | null - } | null - key?: string - label?: string | null - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "integrationID" }, - { in: "query", key: "location" }, - { in: "body", key: "key" }, - { in: "body", key: "label" }, - ], - }, - ], - ) - return (options?.client ?? this.client).post< - V2IntegrationConnectKeyResponses, - V2IntegrationConnectKeyErrors, - ThrowOnError - >({ - url: "/api/integration/{integrationID}/connect/key", - ...options, - ...params, - headers: { - "Content-Type": "application/json", - ...options?.headers, - ...params.headers, - }, - }) - } -} - -export class Oauth2 extends HeyApiClient { - /** - * Begin OAuth connection - * - * Start an OAuth attempt and return the authorization details. - */ - public connect( - parameters: { - integrationID: string - location?: { - directory?: string | null - workspace?: string | null - } | null - methodID?: string - inputs?: { - [key: string]: string - } - label?: string | null - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "integrationID" }, - { in: "query", key: "location" }, - { in: "body", key: "methodID" }, - { in: "body", key: "inputs" }, - { in: "body", key: "label" }, - ], - }, - ], - ) - return (options?.client ?? this.client).post< - V2IntegrationOauthConnectResponses, - V2IntegrationOauthConnectErrors, - ThrowOnError - >({ - url: "/api/integration/{integrationID}/connect/oauth", - ...options, - ...params, - headers: { - "Content-Type": "application/json", - ...options?.headers, - ...params.headers, - }, - }) - } - - /** - * Cancel OAuth connection - * - * Cancel an OAuth attempt and release its resources. - */ - public cancel( - parameters: { - integrationID: string - attemptID: string - location?: { - directory?: string | null - workspace?: string | null - } | null - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "integrationID" }, - { in: "path", key: "attemptID" }, - { in: "query", key: "location" }, - ], - }, - ], - ) - return (options?.client ?? this.client).delete< - V2IntegrationOauthCancelResponses, - V2IntegrationOauthCancelErrors, - ThrowOnError - >({ - url: "/api/integration/{integrationID}/connect/oauth/{attemptID}", - ...options, - ...params, - }) - } - - /** - * Get OAuth attempt status - * - * Poll the current status of an OAuth attempt. - */ - public status( - parameters: { - integrationID: string - attemptID: string - location?: { - directory?: string | null - workspace?: string | null - } | null - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "integrationID" }, - { in: "path", key: "attemptID" }, - { in: "query", key: "location" }, - ], - }, - ], - ) - return (options?.client ?? this.client).get< - V2IntegrationOauthStatusResponses, - V2IntegrationOauthStatusErrors, - ThrowOnError - >({ - url: "/api/integration/{integrationID}/connect/oauth/{attemptID}", - ...options, - ...params, - }) - } - - /** - * Complete OAuth connection - * - * Complete a code-based OAuth attempt and store the resulting credential. - */ - public complete( - parameters: { - integrationID: string - attemptID: string - location?: { - directory?: string | null - workspace?: string | null - } | null - code?: string | null - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "integrationID" }, - { in: "path", key: "attemptID" }, - { in: "query", key: "location" }, - { in: "body", key: "code" }, - ], - }, - ], - ) - return (options?.client ?? this.client).post< - V2IntegrationOauthCompleteResponses, - V2IntegrationOauthCompleteErrors, - ThrowOnError - >({ - url: "/api/integration/{integrationID}/connect/oauth/{attemptID}/complete", - ...options, - ...params, - headers: { - "Content-Type": "application/json", - ...options?.headers, - ...params.headers, - }, - }) - } -} - -export class Command2 extends HeyApiClient { - /** - * Begin command connection - * - * Start a command authentication attempt. - */ - public connect( - parameters: { - integrationID: string - location?: { - directory?: string | null - workspace?: string | null - } | null - methodID?: string - label?: string | null - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "integrationID" }, - { in: "query", key: "location" }, - { in: "body", key: "methodID" }, - { in: "body", key: "label" }, - ], - }, - ], - ) - return (options?.client ?? this.client).post< - V2IntegrationCommandConnectResponses, - V2IntegrationCommandConnectErrors, - ThrowOnError - >({ - url: "/api/integration/{integrationID}/connect/command", - ...options, - ...params, - headers: { - "Content-Type": "application/json", - ...options?.headers, - ...params.headers, - }, - }) - } - - /** - * Cancel command connection - * - * Cancel a command authentication attempt and terminate its process. - */ - public cancel( - parameters: { - integrationID: string - attemptID: string - location?: { - directory?: string | null - workspace?: string | null - } | null - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "integrationID" }, - { in: "path", key: "attemptID" }, - { in: "query", key: "location" }, - ], - }, - ], - ) - return (options?.client ?? this.client).delete< - V2IntegrationCommandCancelResponses, - V2IntegrationCommandCancelErrors, - ThrowOnError - >({ - url: "/api/integration/{integrationID}/connect/command/{attemptID}", - ...options, - ...params, - }) - } - - /** - * Get command attempt status - * - * Poll the current status and output of a command authentication attempt. - */ - public status( - parameters: { - integrationID: string - attemptID: string - location?: { - directory?: string | null - workspace?: string | null - } | null - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "integrationID" }, - { in: "path", key: "attemptID" }, - { in: "query", key: "location" }, - ], - }, - ], - ) - return (options?.client ?? this.client).get< - V2IntegrationCommandStatusResponses, - V2IntegrationCommandStatusErrors, - ThrowOnError - >({ - url: "/api/integration/{integrationID}/connect/command/{attemptID}", - ...options, - ...params, - }) - } -} - -export class Integration extends HeyApiClient { - /** - * List integrations - * - * Retrieve available integrations and their authentication methods. - */ - public list( - parameters?: { - location?: { - directory?: string | null - workspace?: string | null - } | null - }, - options?: Options, - ) { - const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "location" }] }]) - return (options?.client ?? this.client).get({ - url: "/api/integration", - ...options, - ...params, - }) - } - - /** - * Get integration - * - * Retrieve one integration and its authentication methods. - */ - public get( - parameters: { - integrationID: string - location?: { - directory?: string | null - workspace?: string | null - } | null - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "integrationID" }, - { in: "query", key: "location" }, - ], - }, - ], - ) - return (options?.client ?? this.client).get({ - url: "/api/integration/{integrationID}", - ...options, - ...params, - }) - } - - private _connect?: Connect - get connect(): Connect { - return (this._connect ??= new Connect({ client: this.client })) - } - - private _oauth?: Oauth2 - get oauth(): Oauth2 { - return (this._oauth ??= new Oauth2({ client: this.client })) - } - - private _command?: Command2 - get command(): Command2 { - return (this._command ??= new Command2({ client: this.client })) - } -} - -export class Wellknown extends HeyApiClient { - /** - * Add wellknown integration - * - * Discover and persist an experimental wellknown integration source. - */ - public add( - parameters?: { - location?: { - directory?: string | null - workspace?: string | null - } | null - url?: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "query", key: "location" }, - { in: "body", key: "url" }, - ], - }, - ], - ) - return (options?.client ?? this.client).post< - V2ExperimentalIntegrationWellknownAddResponses, - V2ExperimentalIntegrationWellknownAddErrors, - ThrowOnError - >({ - url: "/api/experimental/integration/wellknown", - ...options, - ...params, - headers: { - "Content-Type": "application/json", - ...options?.headers, - ...params.headers, - }, - }) - } -} - -export class Integration2 extends HeyApiClient { - private _wellknown?: Wellknown - get wellknown(): Wellknown { - return (this._wellknown ??= new Wellknown({ client: this.client })) - } -} - -export class Experimental2 extends HeyApiClient { - private _integration?: Integration2 - get integration(): Integration2 { - return (this._integration ??= new Integration2({ client: this.client })) - } -} - -export class Resource2 extends HeyApiClient { - /** - * List MCP resources - * - * Retrieve resources and resource templates from connected MCP servers. - */ - public catalog( - parameters?: { - location?: { - directory?: string | null - workspace?: string | null - } | null - }, - options?: Options, - ) { - const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "location" }] }]) - return (options?.client ?? this.client).get< - V2McpResourceCatalogResponses, - V2McpResourceCatalogErrors, - ThrowOnError - >({ - url: "/api/mcp/resource", - ...options, - ...params, - }) - } -} - -export class Mcp2 extends HeyApiClient { - /** - * List MCP servers - * - * Retrieve configured MCP servers and their connection status. - */ - public list( - parameters?: { - location?: { - directory?: string | null - workspace?: string | null - } | null - }, - options?: Options, - ) { - const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "location" }] }]) - return (options?.client ?? this.client).get({ - url: "/api/mcp", - ...options, - ...params, - }) - } - - private _resource?: Resource2 - get resource(): Resource2 { - return (this._resource ??= new Resource2({ client: this.client })) - } -} - -export class Credential extends HeyApiClient { - /** - * Remove credential - * - * Remove a stored integration credential. - */ - public remove( - parameters: { - credentialID: string - location?: { - directory?: string | null - workspace?: string | null - } | null - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "credentialID" }, - { in: "query", key: "location" }, - ], - }, - ], - ) - return (options?.client ?? this.client).delete( - { - url: "/api/credential/{credentialID}", - ...options, - ...params, - }, - ) - } - - /** - * Update credential - * - * Update a stored credential label. - */ - public update( - parameters: { - credentialID: string - location?: { - directory?: string | null - workspace?: string | null - } | null - label?: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "credentialID" }, - { in: "query", key: "location" }, - { in: "body", key: "label" }, - ], - }, - ], - ) - return (options?.client ?? this.client).patch({ - url: "/api/credential/{credentialID}", - ...options, - ...params, - headers: { - "Content-Type": "application/json", - ...options?.headers, - ...params.headers, - }, - }) - } -} - -export class Project2 extends HeyApiClient { - /** - * List projects - * - * List known projects. - */ - public list(options?: Options) { - return (options?.client ?? this.client).get({ - url: "/api/project", - ...options, - }) - } - - /** - * Get current project - * - * Resolve the project for the requested location. - */ - public current( - parameters?: { - location?: { - directory?: string | null - workspace?: string | null - } | null - }, - options?: Options, - ) { - const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "location" }] }]) - return (options?.client ?? this.client).get({ - url: "/api/project/current", - ...options, - ...params, - }) - } - - /** - * List project directories - * - * List known local absolute directories for a project. - */ - public directories( - parameters: { - projectID: string - location?: { - directory?: string | null - workspace?: string | null - } | null - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "projectID" }, - { in: "query", key: "location" }, - ], - }, - ], - ) - return (options?.client ?? this.client).get< - V2ProjectDirectoriesResponses, - V2ProjectDirectoriesErrors, - ThrowOnError - >({ - url: "/api/project/{projectID}/directories", - ...options, - ...params, - }) - } -} - -export class Request extends HeyApiClient { - /** - * List pending form requests - * - * Retrieve pending forms for a location. - */ - public list( - parameters?: { - location?: { - directory?: string | null - workspace?: string | null - } | null - }, - options?: Options, - ) { - const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "location" }] }]) - return (options?.client ?? this.client).get({ - url: "/api/form/request", - ...options, - ...params, - }) - } -} - -export class Form2 extends HeyApiClient { - private _request?: Request - get request(): Request { - return (this._request ??= new Request({ client: this.client })) - } -} - -export class Request2 extends HeyApiClient { - /** - * List pending permission requests - * - * Retrieve pending permission requests for a location. - */ - public list( - parameters?: { - location?: { - directory?: string | null - workspace?: string | null - } | null - }, - options?: Options, - ) { - const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "location" }] }]) - return (options?.client ?? this.client).get< - V2PermissionRequestListResponses, - V2PermissionRequestListErrors, - ThrowOnError - >({ - url: "/api/permission/request", - ...options, - ...params, - }) - } -} - -export class Saved extends HeyApiClient { - /** - * List saved permissions - * - * Retrieve saved permissions, optionally filtered by project. - */ - public list( - parameters?: { - projectID?: string | null - }, - options?: Options, - ) { - const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "projectID" }] }]) - return (options?.client ?? this.client).get< - V2PermissionSavedListResponses, - V2PermissionSavedListErrors, - ThrowOnError - >({ - url: "/api/permission/saved", - ...options, - ...params, - }) - } - - /** - * Remove saved permission - * - * Remove a saved permission by ID. - */ - public remove( - parameters: { - id: string - }, - options?: Options, - ) { - const params = buildClientParams([parameters], [{ args: [{ in: "path", key: "id" }] }]) - return (options?.client ?? this.client).delete< - V2PermissionSavedRemoveResponses, - V2PermissionSavedRemoveErrors, - ThrowOnError - >({ - url: "/api/permission/saved/{id}", - ...options, - ...params, - }) - } -} - -export class Permission3 extends HeyApiClient { - private _request?: Request2 - get request(): Request2 { - return (this._request ??= new Request2({ client: this.client })) - } - - private _saved?: Saved - get saved(): Saved { - return (this._saved ??= new Saved({ client: this.client })) - } -} - -export class Fs extends HeyApiClient { - /** - * Read file - * - * Serve one file relative to the requested location. - */ - public read( - parameters?: { - location?: { - directory?: string | null - workspace?: string | null - } | null - }, - options?: Options, - ) { - const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "location" }] }]) - return (options?.client ?? this.client).get({ - url: "/api/fs/read/*", - ...options, - ...params, - }) - } - - /** - * List directory - * - * List direct children of one directory relative to the requested location. - */ - public list( - parameters?: { - location?: { - directory?: string | null - workspace?: string | null - } | null - path?: string | null - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "query", key: "location" }, - { in: "query", key: "path" }, - ], - }, - ], - ) - return (options?.client ?? this.client).get({ - url: "/api/fs/list", - ...options, - ...params, - }) - } - - /** - * Find files - * - * Find recursively ranked filesystem entries relative to the requested location. - */ - public find( - parameters: { - location?: { - directory?: string | null - workspace?: string | null - } | null - query: string - type?: "file" | "directory" - limit?: string | null - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "query", key: "location" }, - { in: "query", key: "query" }, - { in: "query", key: "type" }, - { in: "query", key: "limit" }, - ], - }, - ], - ) - return (options?.client ?? this.client).get({ - url: "/api/fs/find", - ...options, - ...params, - }) - } -} - -export class Command3 extends HeyApiClient { - /** - * List commands - * - * Retrieve currently registered commands. - */ - public list( - parameters?: { - location?: { - directory?: string | null - workspace?: string | null - } | null - }, - options?: Options, - ) { - const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "location" }] }]) - return (options?.client ?? this.client).get({ - url: "/api/command", - ...options, - ...params, - }) - } -} - -export class Skill extends HeyApiClient { - /** - * List skills - * - * Retrieve currently registered skills. - */ - public list( - parameters?: { - location?: { - directory?: string | null - workspace?: string | null - } | null - }, - options?: Options, - ) { - const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "location" }] }]) - return (options?.client ?? this.client).get({ - url: "/api/skill", - ...options, - ...params, - }) - } -} - -export class Event2 extends HeyApiClient { - /** - * Subscribe to events - * - * 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. - */ - public subscribe(options?: Options) { - return (options?.client ?? this.client).sse.get({ - url: "/api/event", - ...options, - }) - } -} - -export class Connect2 extends HeyApiClient { - /** - * Create PTY WebSocket token - * - * Create a short-lived single-use ticket for opening a PTY WebSocket connection. - */ - public token( - parameters: { - ptyID: string - location?: { - directory?: string | null - workspace?: string | null - } | null - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "ptyID" }, - { in: "query", key: "location" }, - ], - }, - ], - ) - return (options?.client ?? this.client).post({ - url: "/api/pty/{ptyID}/connect-token", - ...options, - ...params, - }) - } -} - -export class Pty2 extends HeyApiClient { - /** - * List PTY sessions - * - * List PTY sessions for a location, including exited sessions retained until removal. - */ - public list( - parameters?: { - location?: { - directory?: string | null - workspace?: string | null - } | null - }, - options?: Options, - ) { - const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "location" }] }]) - return (options?.client ?? this.client).get({ - url: "/api/pty", - ...options, - ...params, - }) - } - - /** - * Create PTY session - * - * Create a pseudo-terminal session for a location. - */ - public create( - parameters?: { - location?: { - directory?: string | null - workspace?: string | null - } | null - command?: string - args?: Array - cwd?: string - title?: string - env?: { - [key: string]: string - } - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "query", key: "location" }, - { in: "body", key: "command" }, - { in: "body", key: "args" }, - { in: "body", key: "cwd" }, - { in: "body", key: "title" }, - { in: "body", key: "env" }, - ], - }, - ], - ) - return (options?.client ?? this.client).post({ - url: "/api/pty", - ...options, - ...params, - headers: { - "Content-Type": "application/json", - ...options?.headers, - ...params.headers, - }, - }) - } - - /** - * Remove PTY session - * - * Terminate and remove one PTY session. - */ - public remove( - parameters: { - ptyID: string - location?: { - directory?: string | null - workspace?: string | null - } | null - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "ptyID" }, - { in: "query", key: "location" }, - ], - }, - ], - ) - return (options?.client ?? this.client).delete({ - url: "/api/pty/{ptyID}", - ...options, - ...params, - }) - } - - /** - * Get PTY session - * - * Get one PTY session, including its exit code once exited. - */ - public get( - parameters: { - ptyID: string - location?: { - directory?: string | null - workspace?: string | null - } | null - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "ptyID" }, - { in: "query", key: "location" }, - ], - }, - ], - ) - return (options?.client ?? this.client).get({ - url: "/api/pty/{ptyID}", - ...options, - ...params, - }) - } - - /** - * Update PTY session - * - * Update the title or viewport size of one PTY session. - */ - public update( - parameters: { - ptyID: string - location?: { - directory?: string | null - workspace?: string | null - } | null - title?: string - size?: { - rows: number - cols: number - } - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "ptyID" }, - { in: "query", key: "location" }, - { in: "body", key: "title" }, - { in: "body", key: "size" }, - ], - }, - ], - ) - return (options?.client ?? this.client).put({ - url: "/api/pty/{ptyID}", - ...options, - ...params, - headers: { - "Content-Type": "application/json", - ...options?.headers, - ...params.headers, - }, - }) - } - - /** - * Connect to PTY session - * - * Establish a WebSocket connection streaming PTY output and accepting terminal input. - */ - public connect( - parameters: { - ptyID: string - "location[directory]"?: string - "location[workspace]"?: string - cursor?: string - ticket?: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "ptyID" }, - { in: "query", key: "location[directory]" }, - { in: "query", key: "location[workspace]" }, - { in: "query", key: "cursor" }, - { in: "query", key: "ticket" }, - ], - }, - ], - ) - return (options?.client ?? this.client).get({ - url: "/api/pty/{ptyID}/connect", - ...options, - ...params, - }) - } - - private _connect?: Connect2 - get connect2(): Connect2 { - return (this._connect ??= new Connect2({ client: this.client })) - } -} - -export class Shell extends HeyApiClient { - /** - * List running shell commands - * - * List currently running shell commands for a location. Exited commands are not included. - */ - public list( - parameters?: { - location?: { - directory?: string | null - workspace?: string | null - } | null - }, - options?: Options, - ) { - const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "location" }] }]) - return (options?.client ?? this.client).get({ - url: "/api/shell", - ...options, - ...params, - }) - } - - /** - * Run shell command - * - * Spawn one non-interactive shell command for a location. Combined stdout/stderr is captured to a file pageable via output. - */ - public create( - parameters?: { - location?: { - directory?: string | null - workspace?: string | null - } | null - command?: string - cwd?: string - timeout?: number - metadata?: { - [key: string]: unknown - } - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "query", key: "location" }, - { in: "body", key: "command" }, - { in: "body", key: "cwd" }, - { in: "body", key: "timeout" }, - { in: "body", key: "metadata" }, - ], - }, - ], - ) - return (options?.client ?? this.client).post({ - url: "/api/shell", - ...options, - ...params, - headers: { - "Content-Type": "application/json", - ...options?.headers, - ...params.headers, - }, - }) - } - - /** - * Remove shell command - * - * Terminate and remove one shell command and its retained output. - */ - public remove( - parameters: { - id: string - location?: { - directory?: string | null - workspace?: string | null - } | null - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "id" }, - { in: "query", key: "location" }, - ], - }, - ], - ) - return (options?.client ?? this.client).delete({ - url: "/api/shell/{id}", - ...options, - ...params, - }) - } - - /** - * Get shell command - * - * Get one shell command, including its status and exit code once exited. - */ - public get( - parameters: { - id: string - location?: { - directory?: string | null - workspace?: string | null - } | null - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "id" }, - { in: "query", key: "location" }, - ], - }, - ], - ) - return (options?.client ?? this.client).get({ - url: "/api/shell/{id}", - ...options, - ...params, - }) - } - - /** - * Update shell timeout - * - * Replace a running shell command's timeout from now, or clear it with zero. - */ - public timeout( - parameters: { - id: string - location?: { - directory?: string | null - workspace?: string | null - } | null - timeout?: number - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "id" }, - { in: "query", key: "location" }, - { in: "body", key: "timeout" }, - ], - }, - ], - ) - return (options?.client ?? this.client).patch({ - url: "/api/shell/{id}/timeout", - ...options, - ...params, - headers: { - "Content-Type": "application/json", - ...options?.headers, - ...params.headers, - }, - }) - } - - /** - * Read shell output - * - * Page through captured combined output by absolute byte cursor. - */ - public output( - parameters: { - id: string - location?: { - directory?: string | null - workspace?: string | null - } | null - cursor?: string - limit?: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "id" }, - { in: "query", key: "location" }, - { in: "query", key: "cursor" }, - { in: "query", key: "limit" }, - ], - }, - ], - ) - return (options?.client ?? this.client).get({ - url: "/api/shell/{id}/output", - ...options, - ...params, - }) - } -} - -export class Request3 extends HeyApiClient { - /** - * List pending question requests - * - * Retrieve pending question requests for a location. - */ - public list( - parameters?: { - location?: { - directory?: string | null - workspace?: string | null - } | null - }, - options?: Options, - ) { - const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "location" }] }]) - return (options?.client ?? this.client).get< - V2QuestionRequestListResponses, - V2QuestionRequestListErrors, - ThrowOnError - >({ - url: "/api/question/request", - ...options, - ...params, - }) - } -} - -export class Question3 extends HeyApiClient { - private _request?: Request3 - get request(): Request3 { - return (this._request ??= new Request3({ client: this.client })) - } -} - -export class Reference extends HeyApiClient { - /** - * List references - * - * List references available in the requested location. - */ - public list( - parameters?: { - location?: { - directory?: string | null - workspace?: string | null - } | null - }, - options?: Options, - ) { - const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "location" }] }]) - return (options?.client ?? this.client).get({ - url: "/api/reference", - ...options, - ...params, - }) - } -} - -export class ProjectCopy2 extends HeyApiClient { - public remove( - parameters: { - projectID: string - location?: { - directory?: string | null - workspace?: string | null - } | null - directory?: string - force?: boolean - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "projectID" }, - { in: "query", key: "location" }, - { in: "body", key: "directory" }, - { in: "body", key: "force" }, - ], - }, - ], - ) - return (options?.client ?? this.client).delete< - V2ProjectCopyRemoveResponses, - V2ProjectCopyRemoveErrors, - ThrowOnError - >({ - url: "/experimental/project/{projectID}/copy", - ...options, - ...params, - headers: { - "Content-Type": "application/json", - ...options?.headers, - ...params.headers, - }, - }) - } - - public create( - parameters: { - projectID: string - location?: { - directory?: string | null - workspace?: string | null - } | null - strategy?: string - directory?: string - name?: string - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "projectID" }, - { in: "query", key: "location" }, - { in: "body", key: "strategy" }, - { in: "body", key: "directory" }, - { in: "body", key: "name" }, - ], - }, - ], - ) - return (options?.client ?? this.client).post( - { - url: "/experimental/project/{projectID}/copy", - ...options, - ...params, - headers: { - "Content-Type": "application/json", - ...options?.headers, - ...params.headers, - }, - }, - ) - } - - public refresh( - parameters: { - projectID: string - location?: { - directory?: string | null - workspace?: string | null - } | null - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "path", key: "projectID" }, - { in: "query", key: "location" }, - ], - }, - ], - ) - return (options?.client ?? this.client).post< - V2ProjectCopyRefreshResponses, - V2ProjectCopyRefreshErrors, - ThrowOnError - >({ - url: "/experimental/project/{projectID}/copy/refresh", - ...options, - ...params, - }) - } -} - -export class Vcs2 extends HeyApiClient { - /** - * VCS status - * - * List uncommitted working-copy changes relative to the requested location. - */ - public status( - parameters?: { - location?: { - directory?: string | null - workspace?: string | null - } | null - }, - options?: Options, - ) { - const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "location" }] }]) - return (options?.client ?? this.client).get({ - url: "/api/vcs/status", - ...options, - ...params, - }) - } - - /** - * VCS diff - * - * Diff the working copy against HEAD (mode git) or the default-branch merge base (mode branch) for the requested location. - */ - public diff( - parameters: { - location?: { - directory?: string | null - workspace?: string | null - } | null - mode: VcsMode - context?: string | null - }, - options?: Options, - ) { - const params = buildClientParams( - [parameters], - [ - { - args: [ - { in: "query", key: "location" }, - { in: "query", key: "mode" }, - { in: "query", key: "context" }, - ], - }, - ], - ) - return (options?.client ?? this.client).get({ - url: "/api/vcs/diff", - ...options, - ...params, - }) - } -} - -export class Location2 extends HeyApiClient { - /** - * Evict a loaded location - * - * Dispose the requested location's cached services so its next use boots them fresh. - */ - public evict( - parameters?: { - location?: { - directory?: string | null - workspace?: string | null - } | null - }, - options?: Options, - ) { - const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "location" }] }]) - return (options?.client ?? this.client).delete< - V2DebugLocationEvictResponses, - V2DebugLocationEvictErrors, - ThrowOnError - >({ - url: "/api/debug/location", - ...options, - ...params, - }) - } - - /** - * List loaded locations - * - * List locations currently loaded by the server. - */ - public list(options?: Options) { - return (options?.client ?? this.client).get({ - url: "/api/debug/location", - ...options, - }) - } -} - -export class Debug extends HeyApiClient { - private _location?: Location2 - get location(): Location2 { - return (this._location ??= new Location2({ client: this.client })) - } -} - -export class V2 extends HeyApiClient { - private _health?: Health - get health(): Health { - return (this._health ??= new Health({ client: this.client })) - } - - private _server?: Server - get server(): Server { - return (this._server ??= new Server({ client: this.client })) - } - - private _location?: Location - get location(): Location { - return (this._location ??= new Location({ client: this.client })) - } - - private _agent?: Agent - get agent(): Agent { - return (this._agent ??= new Agent({ client: this.client })) - } - - private _plugin?: Plugin - get plugin(): Plugin { - return (this._plugin ??= new Plugin({ client: this.client })) - } - - private _session?: Session3 - get session(): Session3 { - return (this._session ??= new Session3({ client: this.client })) - } - - private _message?: Message - get message(): Message { - return (this._message ??= new Message({ client: this.client })) - } - - private _model?: Model - get model(): Model { - return (this._model ??= new Model({ client: this.client })) - } - - private _generate?: Generate - get generate(): Generate { - return (this._generate ??= new Generate({ client: this.client })) - } - - private _provider?: Provider2 - get provider(): Provider2 { - return (this._provider ??= new Provider2({ client: this.client })) - } - - private _integration?: Integration - get integration(): Integration { - return (this._integration ??= new Integration({ client: this.client })) - } - - private _experimental?: Experimental2 - get experimental(): Experimental2 { - return (this._experimental ??= new Experimental2({ client: this.client })) - } - - private _mcp?: Mcp2 - get mcp(): Mcp2 { - return (this._mcp ??= new Mcp2({ client: this.client })) - } - - private _credential?: Credential - get credential(): Credential { - return (this._credential ??= new Credential({ client: this.client })) - } - - private _project?: Project2 - get project(): Project2 { - return (this._project ??= new Project2({ client: this.client })) - } - - private _form?: Form2 - get form(): Form2 { - return (this._form ??= new Form2({ client: this.client })) - } - - private _permission?: Permission3 - get permission(): Permission3 { - return (this._permission ??= new Permission3({ client: this.client })) - } - - private _fs?: Fs - get fs(): Fs { - return (this._fs ??= new Fs({ client: this.client })) - } - - private _command?: Command3 - get command(): Command3 { - return (this._command ??= new Command3({ client: this.client })) - } - - private _skill?: Skill - get skill(): Skill { - return (this._skill ??= new Skill({ client: this.client })) - } - - private _event?: Event2 - get event(): Event2 { - return (this._event ??= new Event2({ client: this.client })) - } - - private _pty?: Pty2 - get pty(): Pty2 { - return (this._pty ??= new Pty2({ client: this.client })) - } - - private _shell?: Shell - get shell(): Shell { - return (this._shell ??= new Shell({ client: this.client })) - } - - private _question?: Question3 - get question(): Question3 { - return (this._question ??= new Question3({ client: this.client })) - } - - private _reference?: Reference - get reference(): Reference { - return (this._reference ??= new Reference({ client: this.client })) - } - - private _projectCopy?: ProjectCopy2 - get projectCopy(): ProjectCopy2 { - return (this._projectCopy ??= new ProjectCopy2({ client: this.client })) - } - - private _vcs?: Vcs2 - get vcs(): Vcs2 { - return (this._vcs ??= new Vcs2({ client: this.client })) - } - - private _debug?: Debug - get debug(): Debug { - return (this._debug ??= new Debug({ client: this.client })) - } -} - -export class OpencodeClient extends HeyApiClient { - public static readonly __registry = new HeyApiRegistry() - - constructor(args?: { client?: Client; key?: string }) { - super(args) - OpencodeClient.__registry.set(this, args?.key) - } - - private _auth?: Auth - get auth(): Auth { - return (this._auth ??= new Auth({ client: this.client })) - } - - private _app?: App - get app(): App { - return (this._app ??= new App({ client: this.client })) - } - - private _experimental?: Experimental - get experimental(): Experimental { - return (this._experimental ??= new Experimental({ client: this.client })) - } - - private _global?: Global - get global(): Global { - return (this._global ??= new Global({ client: this.client })) - } - - private _event?: Event - get event(): Event { - return (this._event ??= new Event({ client: this.client })) - } - - private _config?: Config2 - get config(): Config2 { - return (this._config ??= new Config2({ client: this.client })) - } - - private _tool?: Tool - get tool(): Tool { - return (this._tool ??= new Tool({ client: this.client })) - } - - private _worktree?: Worktree - get worktree(): Worktree { - return (this._worktree ??= new Worktree({ client: this.client })) - } - - private _find?: Find - get find(): Find { - return (this._find ??= new Find({ client: this.client })) - } - - private _file?: File - get file(): File { - return (this._file ??= new File({ client: this.client })) - } - - private _instance?: Instance - get instance(): Instance { - return (this._instance ??= new Instance({ client: this.client })) - } - - private _path?: Path - get path(): Path { - return (this._path ??= new Path({ client: this.client })) - } - - private _vcs?: Vcs - get vcs(): Vcs { - return (this._vcs ??= new Vcs({ client: this.client })) - } - - private _command?: Command - get command(): Command { - return (this._command ??= new Command({ client: this.client })) - } - - private _lsp?: Lsp - get lsp(): Lsp { - return (this._lsp ??= new Lsp({ client: this.client })) - } - - private _formatter?: Formatter - get formatter(): Formatter { - return (this._formatter ??= new Formatter({ client: this.client })) - } - - private _mcp?: Mcp - get mcp(): Mcp { - return (this._mcp ??= new Mcp({ client: this.client })) - } - - private _project?: Project - get project(): Project { - return (this._project ??= new Project({ client: this.client })) - } - - private _pty?: Pty - get pty(): Pty { - return (this._pty ??= new Pty({ client: this.client })) - } - - private _question?: Question - get question(): Question { - return (this._question ??= new Question({ client: this.client })) - } - - private _permission?: Permission - get permission(): Permission { - return (this._permission ??= new Permission({ client: this.client })) - } - - private _provider?: Provider - get provider(): Provider { - return (this._provider ??= new Provider({ client: this.client })) - } - - private _session?: Session2 - get session(): Session2 { - return (this._session ??= new Session2({ client: this.client })) - } - - private _part?: Part - get part(): Part { - return (this._part ??= new Part({ client: this.client })) - } - - private _sync?: Sync - get sync(): Sync { - return (this._sync ??= new Sync({ client: this.client })) - } - - private _tui?: Tui - get tui(): Tui { - return (this._tui ??= new Tui({ client: this.client })) - } - - private _v2?: V2 - get v2(): V2 { - return (this._v2 ??= new V2({ client: this.client })) - } -} diff --git a/packages/sdk/js/src/v2/gen/types.gen.ts b/packages/sdk/js/src/v2/gen/types.gen.ts deleted file mode 100644 index b742ed2f40..0000000000 --- a/packages/sdk/js/src/v2/gen/types.gen.ts +++ /dev/null @@ -1,19353 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type ClientOptions = { - baseUrl: `${string}://${string}` | (string & {}) -} - -export type Event = - | EventModelsDevRefreshed - | EventIntegrationUpdated - | EventIntegrationConnectionUpdated - | EventCatalogUpdated - | EventAgentUpdated - | EventSessionCreated - | EventSessionUpdated - | EventSessionDeleted - | EventMessageUpdated - | EventMessageRemoved - | EventMessagePartUpdated - | EventMessagePartRemoved - | EventSessionAgentSelected - | EventSessionModelSelected - | EventSessionMoved - | EventSessionRenamed - | EventSessionUsageUpdated - | EventSessionForked - | EventSessionInputPromoted - | EventSessionInputAdmitted - | EventSessionExecutionStarted - | EventSessionExecutionSucceeded - | EventSessionExecutionFailed - | EventSessionExecutionInterrupted - | EventSessionInstructionsUpdated - | EventSessionSynthetic - | EventSessionSkillActivated - | EventSessionShellStarted - | EventSessionShellEnded - | EventSessionStepStarted - | EventSessionStepEnded - | EventSessionStepFailed - | EventSessionTextStarted - | EventSessionTextDelta - | EventSessionTextEnded - | EventSessionReasoningStarted - | EventSessionReasoningDelta - | EventSessionReasoningEnded - | EventSessionToolInputStarted - | EventSessionToolInputDelta - | EventSessionToolInputEnded - | EventSessionToolCalled - | EventSessionToolProgress - | EventSessionToolSuccess - | EventSessionToolFailed - | EventSessionRetryScheduled - | EventSessionCompactionAdmitted - | EventSessionCompactionStarted - | EventSessionCompactionDelta - | EventSessionCompactionEnded - | EventSessionCompactionFailed - | EventSessionRevertStaged - | EventSessionRevertCleared - | EventSessionRevertCommitted - | EventMessagePartDelta - | EventSessionDiff - | EventSessionError - | EventInstallationUpdated - | EventInstallationUpdateAvailable - | EventFilesystemChanged - | EventReferenceUpdated - | EventPermissionV2Asked - | EventPermissionV2Replied - | EventPluginAdded - | EventPluginUpdated - | EventProjectDirectoriesUpdated - | EventCommandUpdated - | EventConfigUpdated - | EventSkillUpdated - | EventPtyCreated - | EventPtyUpdated - | EventPtyExited - | EventPtyDeleted - | EventShellCreated - | EventShellExited - | EventShellDeleted - | EventQuestionV2Asked - | EventQuestionV2Replied - | EventQuestionV2Rejected - | EventFormCreated - | EventFormReplied - | EventFormCancelled - | EventLspUpdated - | EventPermissionAsked - | EventPermissionReplied - | EventTuiPromptAppend2 - | EventTuiCommandExecute2 - | EventTuiToastShow2 - | EventTuiSessionSelect2 - | EventMcpToolsChanged - | EventMcpResourcesChanged - | EventMcpStatusChanged - | EventCommandExecuted - | EventFileEdited - | EventProjectUpdated - | EventSessionStatus - | EventSessionIdle - | EventQuestionAsked - | EventQuestionReplied - | EventQuestionRejected - | EventSessionCompacted - | EventVcsBranchUpdated - | EventWorkspaceReady - | EventWorkspaceFailed - | EventWorkspaceStatus - | EventWorktreeReady - | EventWorktreeFailed - | EventServerConnected - | EventGlobalDisposed - | EventServerInstanceDisposed - -export type QuestionReplied = { - sessionID: string - requestID: string - answers: Array -} - -export type QuestionRejected = { - sessionID: string - requestID: string -} - -export type OAuth = { - type: "oauth" - refresh: string - access: string - expires: number - accountId?: string - enterpriseUrl?: string -} - -export type ApiAuth = { - type: "api" - key: string - metadata?: { - [key: string]: string - } -} - -export type WellKnownAuth = { - type: "wellknown" - key: string - token: string -} - -export type Auth = OAuth | ApiAuth | WellKnownAuth - -export type EffectHttpApiErrorBadRequest = { - _tag: "BadRequest" -} - -export type InvalidRequestError = { - _tag: "InvalidRequestError" - message: string - kind?: string - field?: string -} - -export type MoveSessionError = { - name: "MoveSessionError" - data: { - message: string - } -} - -export type PermissionAction = "allow" | "deny" | "ask" - -export type PermissionRule = { - permission: string - pattern: string - action: PermissionAction -} - -export type PermissionRuleset = Array - -export type OutputFormatText = { - type: "text" -} - -export type JsonSchema = { - [key: string]: unknown -} - -export type OutputFormatJsonSchema = { - type: "json_schema" - schema: JsonSchema - retryCount?: number -} - -export type OutputFormat = OutputFormatText | OutputFormatJsonSchema - -export type UserMessage = { - id: string - sessionID: string - role: "user" - time: { - created: number - } - format?: OutputFormat - summary?: { - title?: string - body?: string - diffs: Array - } - agent: string - model: { - providerID: string - modelID: string - variant?: string - } - system?: string - tools?: { - [key: string]: boolean - } -} - -export type ProviderAuthError = { - name: "ProviderAuthError" - data: { - providerID: string - message: string - } -} - -export type UnknownError = { - name: "UnknownError" - data: { - message: string - ref?: string - } -} - -export type MessageOutputLengthError = { - name: "MessageOutputLengthError" - data: { - [key: string]: unknown - } -} - -export type MessageAbortedError = { - name: "MessageAbortedError" - data: { - message: string - } -} - -export type StructuredOutputError = { - name: "StructuredOutputError" - data: { - message: string - retries: number - } -} - -export type ContextOverflowError = { - name: "ContextOverflowError" - data: { - message: string - responseBody?: string - } -} - -export type ContentFilterError = { - name: "ContentFilterError" - data: { - message: string - } -} - -export type ApiError = { - name: "APIError" - data: { - message: string - statusCode?: number - isRetryable: boolean - responseHeaders?: { - [key: string]: string - } - responseBody?: string - metadata?: { - [key: string]: string - } - } -} - -export type AssistantMessage = { - id: string - sessionID: string - role: "assistant" - time: { - created: number - completed?: number - } - error?: - | ProviderAuthError - | UnknownError - | MessageOutputLengthError - | MessageAbortedError - | StructuredOutputError - | ContextOverflowError - | ContentFilterError - | ApiError - parentID: string - modelID: string - providerID: string - mode: string - agent: string - path: { - cwd: string - root: string - } - summary?: boolean - cost: number - tokens: { - total?: number - input: number - output: number - reasoning: number - cache: { - read: number - write: number - } - } - structured?: unknown - variant?: string - finish?: string -} - -export type Message = UserMessage | AssistantMessage - -export type TextPart = { - id: string - sessionID: string - messageID: string - type: "text" - text: string - synthetic?: boolean - ignored?: boolean - time?: { - start: number - end?: number - } - metadata?: { - [key: string]: unknown - } -} - -export type SubtaskPart = { - id: string - sessionID: string - messageID: string - type: "subtask" - prompt: string - description: string - agent: string - model?: { - providerID: string - modelID: string - } - command?: string -} - -export type ReasoningPart = { - id: string - sessionID: string - messageID: string - type: "reasoning" - text: string - metadata?: { - [key: string]: unknown - } - time: { - start: number - end?: number - } -} - -export type FilePartSourceText = { - value: string - start: number - end: number -} - -export type FileSource = { - text: FilePartSourceText - type: "file" - path: string -} - -export type Range = { - start: { - line: number - character: number - } - end: { - line: number - character: number - } -} - -export type SymbolSource = { - text: FilePartSourceText - type: "symbol" - path: string - range: Range - name: string - kind: number -} - -export type ResourceSource = { - text: FilePartSourceText - type: "resource" - clientName: string - uri: string -} - -export type FilePartSource = FileSource | SymbolSource | ResourceSource - -export type FilePart = { - id: string - sessionID: string - messageID: string - type: "file" - mime: string - filename?: string - url: string - source?: FilePartSource -} - -export type ToolStatePending = { - status: "pending" - input: { - [key: string]: unknown - } - raw: string -} - -export type ToolStateRunning = { - status: "running" - input: { - [key: string]: unknown - } - title?: string - metadata?: { - [key: string]: unknown - } - time: { - start: number - } -} - -export type ToolStateCompleted = { - status: "completed" - input: { - [key: string]: unknown - } - output: string - title: string - metadata: { - [key: string]: unknown - } - time: { - start: number - end: number - compacted?: number - } - attachments?: Array -} - -export type ToolStateError = { - status: "error" - input: { - [key: string]: unknown - } - error: string - metadata?: { - [key: string]: unknown - } - time: { - start: number - end: number - } -} - -export type ToolState = ToolStatePending | ToolStateRunning | ToolStateCompleted | ToolStateError - -export type ToolPart = { - id: string - sessionID: string - messageID: string - type: "tool" - callID: string - tool: string - state: ToolState - metadata?: { - [key: string]: unknown - } -} - -export type StepStartPart = { - id: string - sessionID: string - messageID: string - type: "step-start" - snapshot?: string -} - -export type StepFinishPart = { - id: string - sessionID: string - messageID: string - type: "step-finish" - reason: string - snapshot?: string - cost: number - tokens: { - total?: number - input: number - output: number - reasoning: number - cache: { - read: number - write: number - } - } -} - -export type SnapshotPart = { - id: string - sessionID: string - messageID: string - type: "snapshot" - snapshot: string -} - -export type PatchPart = { - id: string - sessionID: string - messageID: string - type: "patch" - hash: string - files: Array -} - -export type AgentPart = { - id: string - sessionID: string - messageID: string - type: "agent" - name: string - source?: { - value: string - start: number - end: number - } -} - -export type RetryPart = { - id: string - sessionID: string - messageID: string - type: "retry" - attempt: number - error: ApiError - time: { - created: number - } -} - -export type CompactionPart = { - id: string - sessionID: string - messageID: string - type: "compaction" - auto: boolean - overflow?: boolean - tail_start_id?: string -} - -export type Part = - | TextPart - | SubtaskPart - | ReasoningPart - | FilePart - | ToolPart - | StepStartPart - | StepFinishPart - | SnapshotPart - | PatchPart - | AgentPart - | RetryPart - | CompactionPart - -export type Pty = { - id: string - title: string - command: string - args: Array - cwd: string - status: "running" | "exited" - pid: number - exitCode?: number -} - -export type SessionStatus = - | { - type: "idle" - } - | { - type: "retry" - attempt: number - message: string - action?: { - reason: string - provider: string - title: string - message: string - label: string - link?: string - } - next: number - } - | { - type: "busy" - } - -export type QuestionOption = { - /** - * Display text (1-5 words, concise) - */ - label: string - /** - * Explanation of choice - */ - description: string -} - -export type QuestionInfo = { - /** - * Complete question - */ - question: string - /** - * Very short label (max 30 chars) - */ - header: string - /** - * Available choices - */ - options: Array - multiple?: boolean - custom?: boolean -} - -export type QuestionTool = { - messageID: string - callID: string -} - -export type QuestionAnswer = Array - -export type GlobalEvent = { - directory: string - project?: string - workspace?: string - payload: - | { - id: string - type: "models-dev.refreshed" - properties: { - [key: string]: unknown - } - } - | { - id: string - type: "integration.updated" - properties: { - [key: string]: unknown - } - } - | { - id: string - type: "integration.connection.updated" - properties: { - integrationID: string - } - } - | { - id: string - type: "catalog.updated" - properties: { - [key: string]: unknown - } - } - | { - id: string - type: "agent.updated" - properties: { - [key: string]: unknown - } - } - | { - id: string - type: "session.created" - properties: { - sessionID: string - info: SessionV1Info - } - } - | { - id: string - type: "session.updated" - properties: { - sessionID: string - info: SessionV1Info - } - } - | { - id: string - type: "session.deleted" - properties: { - sessionID: string - } - } - | { - id: string - type: "message.updated" - properties: { - sessionID: string - info: Message - } - } - | { - id: string - type: "message.removed" - properties: { - sessionID: string - messageID: string - } - } - | { - id: string - type: "message.part.updated" - properties: { - sessionID: string - part: Part - time: number - } - } - | { - id: string - type: "message.part.removed" - properties: { - sessionID: string - messageID: string - partID: string - } - } - | { - id: string - type: "session.agent.selected" - properties: { - sessionID: string - agent: string - } - } - | { - id: string - type: "session.model.selected" - properties: { - sessionID: string - model: ModelRef - } - } - | { - id: string - type: "session.moved" - properties: { - sessionID: string - location: LocationRef - projectID?: string - subpath?: string - } - } - | { - id: string - type: "session.renamed" - properties: { - sessionID: string - title: string - } - } - | { - id: string - type: "session.usage.updated" - properties: { - sessionID: string - cost: MoneyUsd - tokens: TokenUsageInfo - } - } - | { - id: string - type: "session.forked" - properties: { - sessionID: string - parentID: string - parentSeq: number - from?: string - } - } - | { - id: string - type: "session.input.promoted" - properties: { - sessionID: string - inputID: string - } - } - | { - id: string - type: "session.input.admitted" - properties: { - sessionID: string - inputID: string - input: SessionPendingMessage - } - } - | { - id: string - type: "session.execution.started" - properties: { - sessionID: string - } - } - | { - id: string - type: "session.execution.succeeded" - properties: { - sessionID: string - } - } - | { - id: string - type: "session.execution.failed" - properties: { - sessionID: string - error: SessionStructuredError - } - } - | { - id: string - type: "session.execution.interrupted" - properties: { - sessionID: string - reason: "user" | "shutdown" | "superseded" - } - } - | { - id: string - type: "session.instructions.updated" - properties: { - sessionID: string - delta: { - [key: string]: string | "removed" - } - } - } - | { - id: string - type: "session.synthetic" - properties: { - sessionID: string - text: string - description?: string - metadata?: { - [key: string]: unknown - } - } - } - | { - id: string - type: "session.skill.activated" - properties: { - sessionID: string - id: string - name: string - text: string - } - } - | { - id: string - type: "session.shell.started" - properties: { - sessionID: string - shell: ShellInfo - } - } - | { - id: string - type: "session.shell.ended" - properties: { - sessionID: string - shell: ShellInfo - output: { - output: string - cursor: number - size: number - truncated: boolean - } - } - } - | { - id: string - type: "session.step.started" - properties: { - sessionID: string - assistantMessageID: string - agent: string - model: ModelRef - snapshot?: string - } - } - | { - id: string - type: "session.step.ended" - properties: { - sessionID: string - assistantMessageID: string - finish: "stop" | "length" | "tool-calls" | "content-filter" | "error" | "unknown" - cost: MoneyUsd - tokens: TokenUsageInfo - snapshot?: string - files?: Array - } - } - | { - id: string - type: "session.step.failed" - properties: { - sessionID: string - assistantMessageID: string - error: SessionStructuredError - cost?: MoneyUsd - tokens?: TokenUsageInfo - } - } - | { - id: string - type: "session.text.started" - properties: { - sessionID: string - assistantMessageID: string - ordinal: number - } - } - | { - id: string - type: "session.text.delta" - properties: { - sessionID: string - assistantMessageID: string - ordinal: number - delta: string - } - } - | { - id: string - type: "session.text.ended" - properties: { - sessionID: string - assistantMessageID: string - ordinal: number - text: string - } - } - | { - id: string - type: "session.reasoning.started" - properties: { - sessionID: string - assistantMessageID: string - ordinal: number - state?: SessionMessageProviderState - } - } - | { - id: string - type: "session.reasoning.delta" - properties: { - sessionID: string - assistantMessageID: string - ordinal: number - delta: string - } - } - | { - id: string - type: "session.reasoning.ended" - properties: { - sessionID: string - assistantMessageID: string - ordinal: number - text: string - state?: SessionMessageProviderState - } - } - | { - id: string - type: "session.tool.input.started" - properties: { - sessionID: string - assistantMessageID: string - callID: string - name: string - } - } - | { - id: string - type: "session.tool.input.delta" - properties: { - sessionID: string - assistantMessageID: string - callID: string - delta: string - } - } - | { - id: string - type: "session.tool.input.ended" - properties: { - sessionID: string - assistantMessageID: string - callID: string - text: string - } - } - | { - id: string - type: "session.tool.called" - properties: { - sessionID: string - assistantMessageID: string - callID: string - input: { - [key: string]: unknown - } - executed: boolean - state?: SessionMessageProviderState - } - } - | { - id: string - type: "session.tool.progress" - properties: { - sessionID: string - assistantMessageID: string - callID: string - structured: { - [key: string]: unknown - } - content: Array - } - } - | { - id: string - type: "session.tool.success" - properties: { - sessionID: string - assistantMessageID: string - callID: string - structured: { - [key: string]: unknown - } - content: Array - result?: unknown - executed: boolean - resultState?: SessionMessageProviderState - } - } - | { - id: string - type: "session.tool.failed" - properties: { - sessionID: string - assistantMessageID: string - callID: string - error: SessionStructuredError - result?: unknown - executed: boolean - resultState?: SessionMessageProviderState - } - } - | { - id: string - type: "session.retry.scheduled" - properties: { - sessionID: string - assistantMessageID: string - attempt: number - at: number - error: SessionStructuredError - } - } - | { - id: string - type: "session.compaction.admitted" - properties: { - sessionID: string - inputID: string - } - } - | { - id: string - type: "session.compaction.started" - properties: { - sessionID: string - reason: "auto" | "manual" - recent: string - inputID?: string - } - } - | { - id: string - type: "session.compaction.delta" - properties: { - sessionID: string - text: string - } - } - | { - id: string - type: "session.compaction.ended" - properties: { - sessionID: string - reason: "auto" | "manual" - text: string - recent: string - } - } - | { - id: string - type: "session.compaction.failed" - properties: { - sessionID: string - reason: "auto" | "manual" - error: SessionStructuredError - inputID?: string - } - } - | { - id: string - type: "session.revert.staged" - properties: { - sessionID: string - revert: SessionRevert - } - } - | { - id: string - type: "session.revert.cleared" - properties: { - sessionID: string - } - } - | { - id: string - type: "session.revert.committed" - properties: { - sessionID: string - to: string - } - } - | { - id: string - type: "message.part.delta" - properties: { - sessionID: string - messageID: string - partID: string - field: string - delta: string - } - } - | { - id: string - type: "session.diff" - properties: { - sessionID: string - diff: Array - } - } - | { - id: string - type: "session.error" - properties: { - sessionID?: string - error?: - | ProviderAuthError - | UnknownError - | MessageOutputLengthError - | MessageAbortedError - | StructuredOutputError - | ContextOverflowError - | ContentFilterError - | ApiError - } - } - | { - id: string - type: "installation.updated" - properties: { - version: string - } - } - | { - id: string - type: "installation.update-available" - properties: { - version: string - } - } - | { - id: string - type: "filesystem.changed" - properties: { - file: string - event: "add" | "change" | "unlink" - } - } - | { - id: string - type: "reference.updated" - properties: { - [key: string]: unknown - } - } - | { - id: string - type: "permission.v2.asked" - properties: { - id: string - sessionID: string - action: string - resources: Array - save?: Array - metadata?: { - [key: string]: unknown - } - source?: PermissionV2Source - } - } - | { - id: string - type: "permission.v2.replied" - properties: { - sessionID: string - requestID: string - reply: PermissionV2Reply - } - } - | { - id: string - type: "plugin.added" - properties: { - id: string - } - } - | { - id: string - type: "plugin.updated" - properties: { - [key: string]: unknown - } - } - | { - id: string - type: "project.directories.updated" - properties: { - projectID: string - } - } - | { - id: string - type: "command.updated" - properties: { - [key: string]: unknown - } - } - | { - id: string - type: "config.updated" - properties: { - [key: string]: unknown - } - } - | { - id: string - type: "skill.updated" - properties: { - [key: string]: unknown - } - } - | { - id: string - type: "pty.created" - properties: { - info: Pty - } - } - | { - id: string - type: "pty.updated" - properties: { - info: Pty - } - } - | { - id: string - type: "pty.exited" - properties: { - id: string - exitCode: number - } - } - | { - id: string - type: "pty.deleted" - properties: { - id: string - } - } - | { - id: string - type: "shell.created" - properties: { - info: ShellInfo - } - } - | { - id: string - type: "shell.exited" - properties: { - id: string - exit?: number - status: "running" | "exited" | "timeout" | "killed" - } - } - | { - id: string - type: "shell.deleted" - properties: { - id: string - } - } - | { - id: string - type: "question.v2.asked" - properties: { - id: string - sessionID: string - /** - * Questions to ask - */ - questions: Array - tool?: QuestionV2Tool - } - } - | { - id: string - type: "question.v2.replied" - properties: { - sessionID: string - requestID: string - answers: Array - } - } - | { - id: string - type: "question.v2.rejected" - properties: { - sessionID: string - requestID: string - } - } - | { - id: string - type: "form.created" - properties: { - form: FormInfo - } - } - | { - id: string - type: "form.replied" - properties: { - id: string - sessionID: string - answer: FormAnswer - } - } - | { - id: string - type: "form.cancelled" - properties: { - id: string - sessionID: string - } - } - | { - id: string - type: "lsp.updated" - properties: { - [key: string]: unknown - } - } - | { - id: string - type: "permission.asked" - properties: { - id: string - sessionID: string - permission: string - patterns: Array - metadata: { - [key: string]: unknown - } - always: Array - tool?: { - messageID: string - callID: string - } - } - } - | { - id: string - type: "permission.replied" - properties: { - sessionID: string - requestID: string - reply: "once" | "always" | "reject" - } - } - | { - id: string - type: "tui.prompt.append" - properties: { - text: string - } - } - | { - id: string - type: "tui.command.execute" - properties: { - command: - | "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" - | string - } - } - | { - id: string - type: "tui.toast.show" - properties: { - title?: string - message: string - variant: "info" | "success" | "warning" | "error" - duration?: number - } - } - | { - id: string - type: "tui.session.select" - properties: { - /** - * Session ID to navigate to - */ - sessionID: string - } - } - | { - id: string - type: "mcp.tools.changed" - properties: { - server: string - } - } - | { - id: string - type: "mcp.resources.changed" - properties: { - server: string - } - } - | { - id: string - type: "mcp.status.changed" - properties: { - server: string - } - } - | { - id: string - type: "command.executed" - properties: { - name: string - sessionID: string - arguments: string - messageID: string - } - } - | { - id: string - type: "file.edited" - properties: { - file: string - } - } - | { - id: string - type: "project.updated" - properties: { - id: string - worktree: string - vcs?: ProjectVcs - name?: string - icon?: ProjectIcon - commands?: ProjectCommands - time: ProjectTime - sandboxes: Array - } - } - | { - id: string - type: "session.status" - properties: { - sessionID: string - status: SessionStatus - } - } - | { - id: string - type: "session.idle" - properties: { - sessionID: string - } - } - | { - id: string - type: "question.asked" - properties: { - id: string - sessionID: string - /** - * Questions to ask - */ - questions: Array - tool?: QuestionTool - } - } - | { - id: string - type: "question.replied" - properties: { - sessionID: string - requestID: string - answers: Array - } - } - | { - id: string - type: "question.rejected" - properties: { - sessionID: string - requestID: string - } - } - | { - id: string - type: "session.compacted" - properties: { - sessionID: string - } - } - | { - id: string - type: "vcs.branch.updated" - properties: { - branch?: string - } - } - | { - id: string - type: "workspace.ready" - properties: { - name: string - } - } - | { - id: string - type: "workspace.failed" - properties: { - message: string - } - } - | { - id: string - type: "workspace.status" - properties: { - workspaceID: string - status: "connected" | "connecting" | "disconnected" | "error" - } - } - | { - id: string - type: "worktree.ready" - properties: { - name: string - branch?: string - } - } - | { - id: string - type: "worktree.failed" - properties: { - message: string - } - } - | { - id: string - type: "server.connected" - properties: { - [key: string]: unknown - } - } - | { - id: string - type: "global.disposed" - properties: { - [key: string]: unknown - } - } - | EventServerInstanceDisposed - | SyncEventSessionCreated - | SyncEventSessionUpdated - | SyncEventSessionDeleted - | SyncEventMessageUpdated - | SyncEventMessageRemoved - | SyncEventMessagePartUpdated - | SyncEventMessagePartRemoved - | SyncEventSessionAgentSelected - | SyncEventSessionModelSelected - | SyncEventSessionMoved - | SyncEventSessionRenamed - | SyncEventSessionForked - | SyncEventSessionInputPromoted - | SyncEventSessionInputAdmitted - | SyncEventSessionExecutionStarted - | SyncEventSessionExecutionSucceeded - | SyncEventSessionExecutionFailed - | SyncEventSessionExecutionInterrupted - | SyncEventSessionInstructionsUpdated - | SyncEventSessionSynthetic - | SyncEventSessionSkillActivated - | SyncEventSessionShellStarted - | SyncEventSessionShellEnded - | SyncEventSessionStepStarted - | SyncEventSessionStepEnded - | SyncEventSessionStepFailed - | SyncEventSessionTextStarted - | SyncEventSessionTextEnded - | SyncEventSessionReasoningStarted - | SyncEventSessionReasoningEnded - | SyncEventSessionToolInputStarted - | SyncEventSessionToolInputEnded - | SyncEventSessionToolCalled - | SyncEventSessionToolProgress - | SyncEventSessionToolSuccess - | SyncEventSessionToolFailed - | SyncEventSessionRetryScheduled - | SyncEventSessionCompactionAdmitted - | SyncEventSessionCompactionStarted - | SyncEventSessionCompactionEnded - | SyncEventSessionCompactionFailed - | SyncEventSessionRevertStaged - | SyncEventSessionRevertCleared - | SyncEventSessionRevertCommitted -} - -/** - * Log level - */ -export type LogLevel = "DEBUG" | "INFO" | "WARN" | "ERROR" - -/** - * Server configuration for opencode serve and web commands - */ -export type ServerConfig = { - port?: number - hostname?: string - mdns?: boolean - mdnsDomain?: string - cors?: Array -} - -export type PermissionActionConfig = "ask" | "allow" | "deny" - -export type PermissionObjectConfig = { - [key: string]: PermissionActionConfig -} - -export type PermissionRuleConfig = PermissionActionConfig | PermissionObjectConfig - -export type PermissionConfig = - | PermissionActionConfig - | { - read?: PermissionRuleConfig - edit?: PermissionRuleConfig - glob?: PermissionRuleConfig - grep?: PermissionRuleConfig - list?: PermissionRuleConfig - bash?: PermissionRuleConfig - task?: PermissionRuleConfig - external_directory?: PermissionRuleConfig - question?: PermissionActionConfig - webfetch?: PermissionActionConfig - websearch?: PermissionActionConfig - lsp?: PermissionRuleConfig - doom_loop?: PermissionActionConfig - skill?: PermissionRuleConfig - [key: string]: PermissionRuleConfig | PermissionActionConfig | undefined - } - -export type AgentConfig = { - model?: string - variant?: string - temperature?: number - top_p?: number - prompt?: string - tools?: { - [key: string]: boolean - } - disable?: boolean - description?: string - mode?: "subagent" | "primary" | "all" - hidden?: boolean - options?: { - [key: string]: unknown - } - /** - * Hex color code (e.g., #FF5733) or theme color (e.g., primary) - */ - color?: string | "primary" | "secondary" | "accent" | "success" | "warning" | "error" | "info" - steps?: number - maxSteps?: number - permission?: PermissionConfig - [key: string]: - | unknown - | string - | number - | { - [key: string]: boolean - } - | boolean - | "subagent" - | "primary" - | "all" - | { - [key: string]: unknown - } - | string - | "primary" - | "secondary" - | "accent" - | "success" - | "warning" - | "error" - | "info" - | number - | PermissionConfig - | undefined -} - -export type ProviderConfig = { - api?: string - name?: string - env?: Array - id?: string - npm?: string - whitelist?: Array - blacklist?: Array - options?: { - apiKey?: string - baseURL?: string - enterpriseUrl?: string - setCacheKey?: boolean - /** - * Timeout in milliseconds for full requests to this provider. Set to false to disable timeout. - */ - timeout?: number | false - /** - * Timeout in milliseconds to wait for response headers. Provider integrations may set defaults. Set to false to disable timeout. - */ - headerTimeout?: number | false - chunkTimeout?: number - [key: string]: unknown | string | boolean | number | false | number | false | number | undefined - } - models?: { - [key: string]: { - id?: string - name?: string - family?: string - release_date?: string - attachment?: boolean - reasoning?: boolean - temperature?: boolean - tool_call?: boolean - interleaved?: - | true - | { - field: "reasoning" | "reasoning_content" | "reasoning_details" - } - cost?: { - input: number - output: number - cache_read?: number - cache_write?: number - context_over_200k?: { - input: number - output: number - cache_read?: number - cache_write?: number - } - } - limit?: { - context: number - input?: number - output: number - } - modalities?: { - input?: Array<"text" | "audio" | "image" | "video" | "pdf"> - output?: Array<"text" | "audio" | "image" | "video" | "pdf"> - } - experimental?: boolean - status?: "alpha" | "beta" | "deprecated" | "active" - provider?: { - npm?: string - api?: string - } - options?: { - [key: string]: unknown - } - headers?: { - [key: string]: string - } - /** - * Variant-specific configuration - */ - variants?: { - [key: string]: { - disabled?: boolean - [key: string]: unknown | boolean | undefined - } - } - } - } -} - -export type McpLocalConfig = { - /** - * Type of MCP server connection - */ - type: "local" - /** - * Command and arguments to run the MCP server - */ - command: Array - cwd?: string - environment?: { - [key: string]: string - } - enabled?: boolean - timeout?: number -} - -export type McpOAuthConfig = { - clientId?: string - clientSecret?: string - scope?: string - callbackPort?: number - redirectUri?: string -} - -export type McpRemoteConfig = { - /** - * Type of MCP server connection - */ - type: "remote" - /** - * URL of the remote MCP server - */ - url: string - enabled?: boolean - headers?: { - [key: string]: string - } - /** - * OAuth authentication configuration for the MCP server. Set to false to disable OAuth auto-detection. - */ - oauth?: McpOAuthConfig | false - timeout?: number -} - -/** - * @deprecated Always uses stretch layout. - */ -export type LayoutConfig = "auto" | "stretch" - -export type ImageAttachmentConfig = { - auto_resize?: boolean - max_width?: number - max_height?: number - max_base64_bytes?: number -} - -export type AttachmentConfig = { - image?: ImageAttachmentConfig -} - -export type Config = { - $schema?: string - shell?: string - logLevel?: LogLevel - server?: ServerConfig - command?: { - [key: string]: { - template: string - description?: string - agent?: string - model?: string - variant?: string - subtask?: boolean - } - } - skills?: { - paths?: Array - urls?: Array - } - references?: { - [key: string]: string | ConfigV2ReferenceGit | ConfigV2ReferenceLocal - } - reference?: { - [key: string]: string | ConfigV2ReferenceGit | ConfigV2ReferenceLocal - } - watcher?: { - ignore?: Array - } - snapshot?: boolean - plugin?: Array< - | string - | [ - string, - { - [key: string]: unknown - }, - ] - > - share?: "manual" | "auto" | "disabled" - autoshare?: boolean - /** - * Automatically update to the latest version. Set to true to auto-update, false to disable, or 'notify' to show update notifications - */ - autoupdate?: boolean | "notify" - disabled_providers?: Array - enabled_providers?: Array - model?: string - small_model?: string - default_agent?: string - subagent_depth?: number - username?: string - mode?: { - build?: AgentConfig - plan?: AgentConfig - [key: string]: AgentConfig | undefined - } - agent?: { - plan?: AgentConfig - build?: AgentConfig - general?: AgentConfig - explore?: AgentConfig - title?: AgentConfig - summary?: AgentConfig - compaction?: AgentConfig - [key: string]: AgentConfig | undefined - } - provider?: { - [key: string]: ProviderConfig - } - mcp?: { - [key: string]: - | McpLocalConfig - | McpRemoteConfig - | { - enabled: boolean - } - } - /** - * Enable or configure formatters. Omit or set to false to disable, true to enable built-ins, or an object to enable built-ins with overrides. - */ - formatter?: - | boolean - | { - [key: string]: { - disabled?: boolean - command?: Array - environment?: { - [key: string]: string - } - extensions?: Array - } - } - /** - * Enable or configure LSP servers. Omit or set to false to disable, true to enable built-ins, or an object to enable built-ins with overrides. - */ - lsp?: - | boolean - | { - [key: string]: - | { - disabled: true - } - | { - command: Array - extensions?: Array - disabled?: boolean - env?: { - [key: string]: string - } - initialization?: { - [key: string]: unknown - } - } - } - instructions?: Array - layout?: LayoutConfig - permission?: PermissionConfig - tools?: { - [key: string]: boolean - } - attachment?: AttachmentConfig - enterprise?: { - url?: string - } - tool_output?: { - max_lines?: number - max_bytes?: number - } - compaction?: { - auto?: boolean - prune?: boolean - tail_turns?: number - preserve_recent_tokens?: number - reserved?: number - } - experimental?: { - disable_paste_summary?: boolean - batch_tool?: boolean - openTelemetry?: boolean - primary_tools?: Array - subagent_depth?: number - continue_loop_on_deny?: boolean - mcp_timeout?: number - } -} - -export type Model = { - id: string - providerID: string - api: { - id: string - url: string - npm: string - } - name: string - family?: string - capabilities: { - temperature: boolean - reasoning: boolean - attachment: boolean - toolcall: boolean - input: { - text: boolean - audio: boolean - image: boolean - video: boolean - pdf: boolean - } - output: { - text: boolean - audio: boolean - image: boolean - video: boolean - pdf: boolean - } - interleaved: - | boolean - | { - field: "reasoning" | "reasoning_content" | "reasoning_details" - } - } - cost: { - input: number - output: number - cache: { - read: number - write: number - } - tiers?: Array<{ - input: number - output: number - cache: { - read: number - write: number - } - tier: { - type: "context" - size: number - } - }> - experimentalOver200K?: { - input: number - output: number - cache: { - read: number - write: number - } - } - } - limit: { - context: number - input?: number - output: number - } - status: "alpha" | "beta" | "deprecated" | "active" - options: { - [key: string]: unknown - } - headers: { - [key: string]: string - } - release_date: string - variants?: { - [key: string]: { - [key: string]: unknown - } - } -} - -export type Provider = { - id: string - name: string - source: "env" | "config" | "custom" | "api" - env: Array - key?: string - options: { - [key: string]: unknown - } - models: { - [key: string]: Model - } -} - -export type ExperimentalCapabilities = { - backgroundSubagents: boolean -} - -export type ConsoleState = { - consoleManagedProviders: Array - activeOrgName?: string - switchableOrgCount: number -} - -export type EffectHttpApiErrorInternalServerError = { - _tag: "InternalServerError" -} - -export type ToolListItem = { - id: string - description: string - parameters: unknown -} - -export type ToolList = Array - -export type ToolIds = Array - -export type WorktreeError = { - name: - | "WorktreeNotGitError" - | "WorktreeNameGenerationFailedError" - | "WorktreeCreateFailedError" - | "WorktreeStartCommandFailedError" - | "WorktreeRemoveFailedError" - | "WorktreeResetFailedError" - | "WorktreeListFailedError" - data: { - message: string - } -} - -export type WorktreeCreateInput = { - name?: string - /** - * Additional startup script to run after the project's start command - */ - startCommand?: string -} - -export type Worktree = { - name: string - branch?: string - directory: string -} - -export type WorktreeRemoveInput = { - directory: string -} - -export type WorktreeResetInput = { - directory: string -} - -export type ProjectSummary = { - id: string - name?: string - worktree: string -} - -export type GlobalSession = { - id: string - slug: string - projectID: string - workspaceID?: string - directory: string - path?: string - parentID?: string - summary?: { - additions: number - deletions: number - files: number - diffs?: Array - } - cost?: number - tokens?: { - input: number - output: number - reasoning: number - cache: { - read: number - write: number - } - } - share?: { - url: string - } - title: string - agent?: string - model?: { - id: string - providerID: string - variant?: string - } - version: string - metadata?: { - [key: string]: unknown - } - time: { - created: number - updated: number - compacting?: number - archived?: number - } - permission?: PermissionRuleset - revert?: { - messageID: string - partID?: string - snapshot?: string - diff?: string - } - project: ProjectSummary | null -} - -export type McpResource = { - name: string - uri: string - description?: string - mimeType?: string - client: string -} - -export type Symbol = { - name: string - kind: number - location: { - uri: string - range: Range - } -} - -export type FileNode = { - name: string - path: string - absolute: string - type: "file" | "directory" - ignored: boolean -} - -export type FileContent = { - type: "text" | "binary" - content: string - diff?: string - patch?: { - oldFileName: string - newFileName: string - oldHeader?: string - newHeader?: string - hunks: Array<{ - oldStart: number - oldLines: number - newStart: number - newLines: number - lines: Array - }> - index?: string - } - encoding?: "base64" - mimeType?: string -} - -export type File = { - path: string - added: number - removed: number - status: "added" | "deleted" | "modified" -} - -export type Path = { - home: string - state: string - config: string - worktree: string - directory: string -} - -export type VcsInfo = { - branch?: string - default_branch?: string -} - -export type VcsFileStatus = { - file: string - additions: number - deletions: number - status: "added" | "deleted" | "modified" -} - -export type VcsFileDiff = { - file: string - patch?: string - additions: number - deletions: number - status?: "added" | "deleted" | "modified" -} - -export type VcsApplyError = { - name: "VcsApplyError" - data: { - message: string - reason: "non-git" | "not-clean" - } -} - -export type Command = { - name: string - description?: string - agent?: string - model?: string - source?: "command" | "mcp" | "skill" - template: string - subtask?: boolean - hints: Array -} - -export type Agent = { - name: string - description?: string - mode: "subagent" | "primary" | "all" - native?: boolean - hidden?: boolean - topP?: number - temperature?: number - color?: string - permission: PermissionRuleset - model?: { - modelID: string - providerID: string - } - variant?: string - prompt?: string - options: { - [key: string]: unknown - } - steps?: number -} - -export type LspStatus = { - id: string - name: string - root: string - status: "connected" | "error" -} - -export type FormatterStatus = { - name: string - extensions: Array - enabled: boolean -} - -export type McpStatusConnected = { - status: "connected" -} - -export type McpStatusDisabled = { - status: "disabled" -} - -export type McpStatusFailed = { - status: "failed" - error: string -} - -export type McpStatusNeedsAuth = { - status: "needs_auth" -} - -export type McpStatusNeedsClientRegistration = { - status: "needs_client_registration" - error: string -} - -export type McpStatus = - | McpStatusConnected - | McpStatusDisabled - | McpStatusFailed - | McpStatusNeedsAuth - | McpStatusNeedsClientRegistration - -export type McpUnsupportedOAuthError = { - error: string -} - -export type McpServerNotFoundError = { - _tag: "McpServerNotFoundError" - name: string - message: string -} - -export type Project = { - id: string - worktree: string - vcs?: ProjectVcs - name?: string - icon?: ProjectIcon - commands?: ProjectCommands - time: ProjectTime - sandboxes: Array -} - -export type ProjectNotFoundError = { - _tag: "ProjectNotFoundError" - projectID: string - message: string -} - -export type PtyNotFoundError = { - _tag: "PtyNotFoundError" - ptyID: string - message: string -} - -export type PtyForbiddenError = { - _tag: "PtyForbiddenError" - message: string -} - -export type QuestionRequest = { - id: string - sessionID: string - /** - * Questions to ask - */ - questions: Array - tool?: QuestionTool -} - -export type QuestionNotFoundError = { - _tag: "QuestionNotFoundError" - requestID: string - message: string -} - -export type PermissionRequest = { - id: string - sessionID: string - permission: string - patterns: Array - metadata: { - [key: string]: unknown - } - always: Array - tool?: { - messageID: string - callID: string - } -} - -export type PermissionNotFoundError = { - _tag: "PermissionNotFoundError" - requestID: string - message: string -} - -export type ProviderAuthMethod = { - type: "oauth" | "api" - label: string - prompts?: Array< - | { - type: "text" - key: string - message: string - placeholder?: string - when?: { - key: string - op: "eq" | "neq" - value: string - } - } - | { - type: "select" - key: string - message: string - options: Array<{ - label: string - value: string - hint?: string - }> - when?: { - key: string - op: "eq" | "neq" - value: string - } - } - > -} - -export type ProviderAuthAuthorization = { - url: string - method: "auto" | "code" - instructions: string -} - -export type ProviderAuthError1 = { - name: - | "BadRequest" - | "ProviderAuthOauthMissing" - | "ProviderAuthOauthCodeMissing" - | "ProviderAuthOauthCallbackFailed" - | "ProviderAuthValidationFailed" - data: { - providerID?: string - field?: string - message?: string - kind?: string - } -} - -export type Session = { - id: string - slug: string - projectID: string - workspaceID?: string - directory: string - path?: string - parentID?: string - summary?: { - additions: number - deletions: number - files: number - diffs?: Array - } - cost?: number - tokens?: { - input: number - output: number - reasoning: number - cache: { - read: number - write: number - } - } - share?: { - url: string - } - title: string - agent?: string - model?: { - id: string - providerID: string - variant?: string - } - version: string - metadata?: { - [key: string]: unknown - } - time: { - created: number - updated: number - compacting?: number - archived?: number - } - permission?: PermissionRuleset - revert?: { - messageID: string - partID?: string - snapshot?: string - diff?: string - } -} - -export type NotFoundError = { - name: "NotFoundError" - data: { - message: string - } -} - -export type TextPartInput = { - id?: string - type: "text" - text: string - synthetic?: boolean - ignored?: boolean - time?: { - start: number - end?: number - } - metadata?: { - [key: string]: unknown - } -} - -export type FilePartInput = { - id?: string - type: "file" - mime: string - filename?: string - url: string - source?: FilePartSource -} - -export type AgentPartInput = { - id?: string - type: "agent" - name: string - source?: { - value: string - start: number - end: number - } -} - -export type SubtaskPartInput = { - id?: string - type: "subtask" - prompt: string - description: string - agent: string - model?: { - providerID: string - modelID: string - } - command?: string -} - -export type SessionBusyError = { - _tag: "SessionBusyError" - sessionID: string - message: string -} - -export type EventTuiPromptAppend = { - type: "tui.prompt.append" - properties: { - text: string - } -} - -export type EventTuiCommandExecute = { - type: "tui.command.execute" - properties: { - command: - | "session.list" - | "session.new" - | "session.share" - | "session.interrupt" - | "session.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" - | string - } -} - -export type EventTuiToastShow = { - type: "tui.toast.show" - properties: { - title?: string - message: string - variant: "info" | "success" | "warning" | "error" - duration?: number - } -} - -export type EventTuiSessionSelect = { - type: "tui.session.select" - properties: { - /** - * Session ID to navigate to - */ - sessionID: string - } -} - -export type Workspace = { - id: string - type: string - name: string - branch?: string | null - directory?: string | null - extra?: unknown | null - projectID: string - timeUsed: number | "NaN" | "Infinity" | "-Infinity" | "Infinity" | "-Infinity" | "NaN" -} - -export type WorkspaceCreateError = { - name: "WorkspaceCreateError" - data: { - message: string - } -} - -export type WorkspaceWarpError = { - name: "WorkspaceWarpError" - data: { - message: string - } -} - -export type ServiceHealth = { - healthy: true - version: string - pid: number -} - -export type UnauthorizedError = { - _tag: "UnauthorizedError" - message: string -} - -export type ServiceStopRequest = { - instanceID: string -} - -export type ServiceStopResponse = { - accepted: boolean -} - -export type SessionsResponse = { - data: Array - cursor: { - previous?: string - next?: string - } -} - -export type InvalidCursorError = { - _tag: "InvalidCursorError" - message: string -} - -export type SessionActive = { - type: "running" -} - -export type SessionNotFoundError = { - _tag: "SessionNotFoundError" - sessionID: string - message: string -} - -export type MessageNotFoundError = { - _tag: "MessageNotFoundError" - sessionID: string - messageID: string - message: string -} - -export type ConflictError = { - _tag: "ConflictError" - message: string - resource?: string -} - -export type CommandNotFoundError = { - _tag: "CommandNotFoundError" - command: string - message: string -} - -export type CommandEvaluationError = { - _tag: "CommandEvaluationError" - command: string - message: string -} - -export type SkillNotFoundError = { - _tag: "SkillNotFoundError" - skill: string - message: string -} - -export type ServiceUnavailableError = { - _tag: "ServiceUnavailableError" - message: string - service?: string -} - -export type UnknownError1 = { - _tag: "UnknownError" - message: string - ref?: string -} - -export type InstructionEntryValueTooLargeError = { - _tag: "InstructionEntryValueTooLargeError" - actualBytes: number - maxBytes: number - message: string -} - -export type SessionGenerateResponse = { - data: { - text: string - } -} - -export type SessionLogItem = SessionEventDurable | EventLogSynced - -export type SessionLogItemJsonString = string - -export type SessionMessagesResponse = { - data: Array - cursor: { - previous?: string - next?: string - } -} - -export type GenerateTextResponse = { - data: { - text: string - } -} - -export type ProviderNotFoundError = { - _tag: "ProviderNotFoundError" - providerID: string - message: string -} - -export type McpResource2 = { - server: string - name: string - uri: string - description?: string - mimeType?: string -} - -export type FormNotFoundError = { - _tag: "FormNotFoundError" - id: string - message: string -} - -export type FormAlreadySettledError = { - _tag: "FormAlreadySettledError" - id: string - message: string -} - -export type FormInvalidAnswerError = { - _tag: "FormInvalidAnswerError" - id: string - message: string -} - -export type OutputFormat1 = - | { - type: "text" - } - | { - type: "json_schema" - schema: JsonSchema - retryCount?: number - } - -export type SessionStatus2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.status" - location?: LocationRef - data: { - sessionID: string - status: SessionStatus - } -} - -export type QuestionReplied2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "question.replied" - location?: LocationRef - data: { - sessionID: string - requestID: string - answers: Array - } -} - -export type QuestionRejected2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "question.rejected" - location?: LocationRef - data: { - sessionID: string - requestID: string - } -} - -export type V2Event = - | ModelsDevRefreshed - | IntegrationUpdated - | IntegrationConnectionUpdated - | CatalogUpdated - | AgentUpdated - | SessionCreated - | SessionUpdated - | SessionDeleted - | MessageUpdated - | MessageRemoved - | MessagePartUpdated - | MessagePartRemoved - | SessionAgentSelected - | SessionModelSelected - | SessionMoved - | SessionRenamed - | SessionUsageUpdated - | SessionForked - | SessionInputPromoted - | SessionInputAdmitted - | SessionExecutionStarted - | SessionExecutionSucceeded - | SessionExecutionFailed - | SessionExecutionInterrupted - | SessionInstructionsUpdated - | SessionSynthetic - | SessionSkillActivated - | SessionShellStarted - | SessionShellEnded - | SessionStepStarted - | SessionStepEnded - | SessionStepFailed - | SessionTextStarted - | SessionTextDelta - | SessionTextEnded - | SessionReasoningStarted - | SessionReasoningDelta - | SessionReasoningEnded - | SessionToolInputStarted - | SessionToolInputDelta - | SessionToolInputEnded - | SessionToolCalled - | SessionToolProgress - | SessionToolSuccess - | SessionToolFailed - | SessionRetryScheduled - | SessionCompactionAdmitted - | SessionCompactionStarted - | SessionCompactionDelta - | SessionCompactionEnded - | SessionCompactionFailed - | SessionRevertStaged - | SessionRevertCleared - | SessionRevertCommitted - | MessagePartDelta - | SessionDiff - | SessionError - | InstallationUpdated - | InstallationUpdateAvailable - | FilesystemChanged - | ReferenceUpdated - | PermissionV2Asked - | PermissionV2Replied - | PluginAdded - | PluginUpdated - | ProjectDirectoriesUpdated - | CommandUpdated - | ConfigUpdated - | SkillUpdated - | PtyCreated - | PtyUpdated - | PtyExited - | PtyDeleted - | ShellCreated - | ShellExited - | ShellDeleted - | QuestionV2Asked - | QuestionV2Replied - | QuestionV2Rejected - | FormCreated - | FormReplied - | FormCancelled - | LspUpdated - | PermissionAsked - | PermissionReplied - | TuiPromptAppend - | TuiCommandExecute - | TuiToastShow - | TuiSessionSelect - | McpToolsChanged - | McpResourcesChanged - | McpStatusChanged - | CommandExecuted - | FileEdited - | ProjectUpdated - | SessionStatus2 - | SessionIdle - | QuestionAsked - | QuestionReplied2 - | QuestionRejected2 - | SessionCompacted - | VcsBranchUpdated - | WorkspaceReady - | WorkspaceFailed - | WorkspaceStatus - | WorktreeReady - | WorktreeFailed - | ServerConnected - | GlobalDisposed - -export type V2EventJsonString = string - -export type ForbiddenError = { - _tag: "ForbiddenError" - message: string -} - -export type ShellNotFoundError = { - _tag: "ShellNotFoundError" - id: string - message: string -} - -export type ProjectCopyError = { - name: "ProjectCopyError" - data: { - message: string - forceRequired?: boolean - } -} - -export type VcsFileStatus2 = { - file: string - additions: number - deletions: number - status: "added" | "deleted" | "modified" -} - -export type EffectHttpApiErrorForbidden = { - _tag: "Forbidden" -} - -export type EventTuiPromptAppend2 = { - id: string - type: "tui.prompt.append" - properties: { - text: string - } -} - -export type EventTuiCommandExecute2 = { - id: string - type: "tui.command.execute" - properties: { - command: - | "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" - | string - } -} - -export type EventTuiToastShow2 = { - id: string - type: "tui.toast.show" - properties: { - title?: string - message: string - variant: "info" | "success" | "warning" | "error" - duration?: number - } -} - -export type EventTuiSessionSelect2 = { - id: string - type: "tui.session.select" - properties: { - /** - * Session ID to navigate to - */ - sessionID: string - } -} - -export type CredentialValue = CredentialOAuth | CredentialKey - -export type IntegrationInputs = { - [key: string]: string -} - -export type IntegrationMethod = - | IntegrationOAuthMethod - | IntegrationCommandMethod - | IntegrationKeyMethod - | IntegrationEnvMethod - -export type IntegrationRef = { - id: string - name: string -} - -export type SkillSource = SkillDirectorySource | SkillUrlSource | SkillEmbeddedSource - -export type MoveSessionDestination = { - directory: string -} - -export type FileDiffLegacyInfo = { - file?: string - patch?: string - additions: number - deletions: number - status?: "added" | "deleted" | "modified" -} - -export type SessionV1Info = { - id: string - slug: string - projectID: string - workspaceID?: string - directory: string - path?: string - parentID?: string - summary?: { - additions: number - deletions: number - files: number - diffs?: Array - } - cost?: number - tokens?: { - input: number - output: number - reasoning: number - cache: { - read: number - write: number - } - } - share?: { - url: string - } - title: string - agent?: string - model?: { - id: string - providerID: string - variant?: string - } - version: string - metadata?: { - [key: string]: unknown - } - time: { - created: number - updated: number - compacting?: number - archived?: number - } - permission?: PermissionRuleset - revert?: { - messageID: string - partID?: string - snapshot?: string - diff?: string - } -} - -export type ModelRef = { - id: string - providerID: string - variant?: string -} - -export type LocationRef = { - directory: string - workspaceID?: string -} - -export type MoneyUsd = number - -export type TokenUsageInfo = { - input: number - output: number - reasoning: number - cache: { - read: number - write: number - } -} - -export type PromptBase64 = string - -export type PromptFileSource = - | { - type: "inline" - } - | { - type: "uri" - uri: string - } - -export type PromptMention = { - start: number - end: number - text: string -} - -export type PromptFileAttachment = { - data: PromptBase64 - mime: string - source: PromptFileSource - name?: string - description?: string - mention?: PromptMention -} - -export type PromptAgentAttachment = { - name: string - mention?: PromptMention -} - -export type SessionPendingUserData = { - text: string - files?: Array - agents?: Array - metadata?: { - [key: string]: unknown - } -} - -export type SessionPendingUserMessage = { - type: "user" - data: SessionPendingUserData - delivery: "steer" | "queue" -} - -export type SessionPendingSyntheticData = { - text: string - description?: string - metadata?: { - [key: string]: unknown - } -} - -export type SessionPendingSyntheticMessage = { - type: "synthetic" - data: SessionPendingSyntheticData - delivery: "steer" | "queue" -} - -export type SessionPendingMessage = SessionPendingUserMessage | SessionPendingSyntheticMessage - -export type SessionStructuredError = { - type: string - message: string -} - -export type ShellInfo = { - id: string - status: "running" | "exited" | "timeout" | "killed" - command: string - cwd: string - shell: string - file: string - pid?: number - exit?: number - metadata: { - [key: string]: unknown - } - time: { - started: number - completed?: number - } -} - -export type SessionMessageProviderState = { - [key: string]: unknown -} - -export type ToolTextContent = { - type: "text" - text: string -} - -export type ToolFileContent = { - type: "file" - uri: string - mime: string - name?: string -} - -export type LlmToolContent = ToolTextContent | ToolFileContent - -export type FileDiffInfo = { - file: string - patch: string - additions: number - deletions: number - status: "added" | "deleted" | "modified" -} - -export type SessionRevert = { - messageID: string - partID?: string - snapshot?: string - files?: Array -} - -export type PermissionV2Source = { - type: "tool" - messageID: string - callID: string -} - -export type PermissionV2Reply = "once" | "always" | "reject" - -export type QuestionV2Option = { - /** - * Display text (1-5 words, concise) - */ - label: string - /** - * Explanation of choice - */ - description: string -} - -export type QuestionV2Info = { - /** - * Complete question - */ - question: string - /** - * Very short label (max 30 chars) - */ - header: string - /** - * Available choices - */ - options: Array - multiple?: boolean - custom?: boolean -} - -export type QuestionV2Tool = { - messageID: string - callID: string -} - -export type QuestionV2Answer = Array - -export type FormMetadata = { - [key: string]: unknown -} - -export type FormWhen = { - key: string - op: "eq" | "neq" - value: string | number | "NaN" | "Infinity" | "-Infinity" | "Infinity" | "-Infinity" | "NaN" | boolean -} - -export type FormOption = { - value: string - label: string - description?: string -} - -export type FormStringField = { - key: string - title?: string - description?: string - required?: boolean - when?: Array - type: "string" - format?: "email" | "uri" | "date" | "date-time" - minLength?: number - maxLength?: number - pattern?: string - placeholder?: string - default?: string - options?: Array - custom?: boolean -} - -export type FormNumberField = { - key: string - title?: string - description?: string - required?: boolean - when?: Array - type: "number" - minimum?: number | "NaN" | "Infinity" | "-Infinity" | "Infinity" | "-Infinity" | "NaN" - maximum?: number | "NaN" | "Infinity" | "-Infinity" | "Infinity" | "-Infinity" | "NaN" - default?: number | "NaN" | "Infinity" | "-Infinity" | "Infinity" | "-Infinity" | "NaN" -} - -export type FormIntegerField = { - key: string - title?: string - description?: string - required?: boolean - when?: Array - type: "integer" - minimum?: number | "NaN" | "Infinity" | "-Infinity" | "Infinity" | "-Infinity" | "NaN" - maximum?: number | "NaN" | "Infinity" | "-Infinity" | "Infinity" | "-Infinity" | "NaN" - default?: number | "NaN" | "Infinity" | "-Infinity" | "Infinity" | "-Infinity" | "NaN" -} - -export type FormBooleanField = { - key: string - title?: string - description?: string - required?: boolean - when?: Array - type: "boolean" - default?: boolean -} - -export type FormMultiselectField = { - key: string - title?: string - description?: string - required?: boolean - when?: Array - type: "multiselect" - options: Array - minItems?: number - maxItems?: number - custom?: boolean - default?: Array -} - -export type FormExternalField = { - key: string - type: "external" - url: string - title?: string - description?: string -} - -export type FormField = - | FormStringField - | FormNumberField - | FormIntegerField - | FormBooleanField - | FormMultiselectField - | FormExternalField - -export type FormFields = Array - -export type FormInfo = { - id: string - sessionID: string - title: string - metadata?: FormMetadata - fields: FormFields -} - -export type FormValue = - | string - | number - | "NaN" - | "Infinity" - | "-Infinity" - | "Infinity" - | "-Infinity" - | "NaN" - | boolean - | Array - -export type FormAnswer = { - [key: string]: FormValue -} - -export type ProjectVcs = "git" | "hg" - -export type ProjectIcon = { - url?: string - override?: string - color?: string -} - -export type ProjectCommands = { - /** - * Startup script to run when creating a new workspace (worktree) - */ - start?: string -} - -export type ProjectTime = { - created: number - updated: number - initialized?: number -} - -export type EventServerInstanceDisposed = { - id: string - type: "server.instance.disposed" - properties: { - directory: string - } -} - -export type SyncEventSessionCreated = { - type: "sync" - id: string - syncEvent: { - type: "session.created.1" - id: string - seq: number - aggregateID: string - data: { - sessionID: string - info: SessionV1Info - } - } -} - -export type SyncEventSessionUpdated = { - type: "sync" - id: string - syncEvent: { - type: "session.updated.1" - id: string - seq: number - aggregateID: string - data: { - sessionID: string - info: SessionV1Info - } - } -} - -export type SyncEventSessionDeleted = { - type: "sync" - id: string - syncEvent: { - type: "session.deleted.2" - id: string - seq: number - aggregateID: string - data: { - sessionID: string - } - } -} - -export type SyncEventMessageUpdated = { - type: "sync" - id: string - syncEvent: { - type: "message.updated.1" - id: string - seq: number - aggregateID: string - data: { - sessionID: string - info: Message - } - } -} - -export type SyncEventMessageRemoved = { - type: "sync" - id: string - syncEvent: { - type: "message.removed.1" - id: string - seq: number - aggregateID: string - data: { - sessionID: string - messageID: string - } - } -} - -export type SyncEventMessagePartUpdated = { - type: "sync" - id: string - syncEvent: { - type: "message.part.updated.1" - id: string - seq: number - aggregateID: string - data: { - sessionID: string - part: Part - time: number - } - } -} - -export type SyncEventMessagePartRemoved = { - type: "sync" - id: string - syncEvent: { - type: "message.part.removed.1" - id: string - seq: number - aggregateID: string - data: { - sessionID: string - messageID: string - partID: string - } - } -} - -export type SyncEventSessionAgentSelected = { - type: "sync" - id: string - syncEvent: { - type: "session.agent.selected.1" - id: string - seq: number - aggregateID: string - data: { - sessionID: string - agent: string - } - } -} - -export type SyncEventSessionModelSelected = { - type: "sync" - id: string - syncEvent: { - type: "session.model.selected.1" - id: string - seq: number - aggregateID: string - data: { - sessionID: string - model: ModelRef - } - } -} - -export type SyncEventSessionMoved = { - type: "sync" - id: string - syncEvent: { - type: "session.moved.1" - id: string - seq: number - aggregateID: string - data: { - sessionID: string - location: LocationRef - projectID?: string - subpath?: string - } - } -} - -export type SyncEventSessionRenamed = { - type: "sync" - id: string - syncEvent: { - type: "session.renamed.1" - id: string - seq: number - aggregateID: string - data: { - sessionID: string - title: string - } - } -} - -export type SyncEventSessionForked = { - type: "sync" - id: string - syncEvent: { - type: "session.forked.2" - id: string - seq: number - aggregateID: string - data: { - sessionID: string - parentID: string - parentSeq: number - from?: string - } - } -} - -export type SyncEventSessionInputPromoted = { - type: "sync" - id: string - syncEvent: { - type: "session.input.promoted.1" - id: string - seq: number - aggregateID: string - data: { - sessionID: string - inputID: string - } - } -} - -export type SyncEventSessionInputAdmitted = { - type: "sync" - id: string - syncEvent: { - type: "session.input.admitted.1" - id: string - seq: number - aggregateID: string - data: { - sessionID: string - inputID: string - input: SessionPendingMessage - } - } -} - -export type SyncEventSessionExecutionStarted = { - type: "sync" - id: string - syncEvent: { - type: "session.execution.started.1" - id: string - seq: number - aggregateID: string - data: { - sessionID: string - } - } -} - -export type SyncEventSessionExecutionSucceeded = { - type: "sync" - id: string - syncEvent: { - type: "session.execution.succeeded.1" - id: string - seq: number - aggregateID: string - data: { - sessionID: string - } - } -} - -export type SyncEventSessionExecutionFailed = { - type: "sync" - id: string - syncEvent: { - type: "session.execution.failed.1" - id: string - seq: number - aggregateID: string - data: { - sessionID: string - error: SessionStructuredError - } - } -} - -export type SyncEventSessionExecutionInterrupted = { - type: "sync" - id: string - syncEvent: { - type: "session.execution.interrupted.1" - id: string - seq: number - aggregateID: string - data: { - sessionID: string - reason: "user" | "shutdown" | "superseded" - } - } -} - -export type SyncEventSessionInstructionsUpdated = { - type: "sync" - id: string - syncEvent: { - type: "session.instructions.updated.2" - id: string - seq: number - aggregateID: string - data: { - sessionID: string - delta: { - [key: string]: string | "removed" - } - } - } -} - -export type SyncEventSessionSynthetic = { - type: "sync" - id: string - syncEvent: { - type: "session.synthetic.1" - id: string - seq: number - aggregateID: string - data: { - sessionID: string - text: string - description?: string - metadata?: { - [key: string]: unknown - } - } - } -} - -export type SyncEventSessionSkillActivated = { - type: "sync" - id: string - syncEvent: { - type: "session.skill.activated.1" - id: string - seq: number - aggregateID: string - data: { - sessionID: string - id: string - name: string - text: string - } - } -} - -export type SyncEventSessionShellStarted = { - type: "sync" - id: string - syncEvent: { - type: "session.shell.started.1" - id: string - seq: number - aggregateID: string - data: { - sessionID: string - shell: ShellInfo - } - } -} - -export type SyncEventSessionShellEnded = { - type: "sync" - id: string - syncEvent: { - type: "session.shell.ended.1" - id: string - seq: number - aggregateID: string - data: { - sessionID: string - shell: ShellInfo - output: { - output: string - cursor: number - size: number - truncated: boolean - } - } - } -} - -export type SyncEventSessionStepStarted = { - type: "sync" - id: string - syncEvent: { - type: "session.step.started.1" - id: string - seq: number - aggregateID: string - data: { - sessionID: string - assistantMessageID: string - agent: string - model: ModelRef - snapshot?: string - } - } -} - -export type SyncEventSessionStepEnded = { - type: "sync" - id: string - syncEvent: { - type: "session.step.ended.1" - id: string - seq: number - aggregateID: string - data: { - sessionID: string - assistantMessageID: string - finish: "stop" | "length" | "tool-calls" | "content-filter" | "error" | "unknown" - cost: MoneyUsd - tokens: TokenUsageInfo - snapshot?: string - files?: Array - } - } -} - -export type SyncEventSessionStepFailed = { - type: "sync" - id: string - syncEvent: { - type: "session.step.failed.1" - id: string - seq: number - aggregateID: string - data: { - sessionID: string - assistantMessageID: string - error: SessionStructuredError - cost?: MoneyUsd - tokens?: TokenUsageInfo - } - } -} - -export type SyncEventSessionTextStarted = { - type: "sync" - id: string - syncEvent: { - type: "session.text.started.1" - id: string - seq: number - aggregateID: string - data: { - sessionID: string - assistantMessageID: string - ordinal: number - } - } -} - -export type SyncEventSessionTextEnded = { - type: "sync" - id: string - syncEvent: { - type: "session.text.ended.1" - id: string - seq: number - aggregateID: string - data: { - sessionID: string - assistantMessageID: string - ordinal: number - text: string - } - } -} - -export type SyncEventSessionReasoningStarted = { - type: "sync" - id: string - syncEvent: { - type: "session.reasoning.started.1" - id: string - seq: number - aggregateID: string - data: { - sessionID: string - assistantMessageID: string - ordinal: number - state?: SessionMessageProviderState - } - } -} - -export type SyncEventSessionReasoningEnded = { - type: "sync" - id: string - syncEvent: { - type: "session.reasoning.ended.1" - id: string - seq: number - aggregateID: string - data: { - sessionID: string - assistantMessageID: string - ordinal: number - text: string - state?: SessionMessageProviderState - } - } -} - -export type SyncEventSessionToolInputStarted = { - type: "sync" - id: string - syncEvent: { - type: "session.tool.input.started.1" - id: string - seq: number - aggregateID: string - data: { - sessionID: string - assistantMessageID: string - callID: string - name: string - } - } -} - -export type SyncEventSessionToolInputEnded = { - type: "sync" - id: string - syncEvent: { - type: "session.tool.input.ended.1" - id: string - seq: number - aggregateID: string - data: { - sessionID: string - assistantMessageID: string - callID: string - text: string - } - } -} - -export type SyncEventSessionToolCalled = { - type: "sync" - id: string - syncEvent: { - type: "session.tool.called.1" - id: string - seq: number - aggregateID: string - data: { - sessionID: string - assistantMessageID: string - callID: string - input: { - [key: string]: unknown - } - executed: boolean - state?: SessionMessageProviderState - } - } -} - -export type SyncEventSessionToolProgress = { - type: "sync" - id: string - syncEvent: { - type: "session.tool.progress.1" - id: string - seq: number - aggregateID: string - data: { - sessionID: string - assistantMessageID: string - callID: string - structured: { - [key: string]: unknown - } - content: Array - } - } -} - -export type SyncEventSessionToolSuccess = { - type: "sync" - id: string - syncEvent: { - type: "session.tool.success.1" - id: string - seq: number - aggregateID: string - data: { - sessionID: string - assistantMessageID: string - callID: string - structured: { - [key: string]: unknown - } - content: Array - result?: unknown - executed: boolean - resultState?: SessionMessageProviderState - } - } -} - -export type SyncEventSessionToolFailed = { - type: "sync" - id: string - syncEvent: { - type: "session.tool.failed.1" - id: string - seq: number - aggregateID: string - data: { - sessionID: string - assistantMessageID: string - callID: string - error: SessionStructuredError - result?: unknown - executed: boolean - resultState?: SessionMessageProviderState - } - } -} - -export type SyncEventSessionRetryScheduled = { - type: "sync" - id: string - syncEvent: { - type: "session.retry.scheduled.1" - id: string - seq: number - aggregateID: string - data: { - sessionID: string - assistantMessageID: string - attempt: number - at: number - error: SessionStructuredError - } - } -} - -export type SyncEventSessionCompactionAdmitted = { - type: "sync" - id: string - syncEvent: { - type: "session.compaction.admitted.1" - id: string - seq: number - aggregateID: string - data: { - sessionID: string - inputID: string - } - } -} - -export type SyncEventSessionCompactionStarted = { - type: "sync" - id: string - syncEvent: { - type: "session.compaction.started.1" - id: string - seq: number - aggregateID: string - data: { - sessionID: string - reason: "auto" | "manual" - recent: string - inputID?: string - } - } -} - -export type SyncEventSessionCompactionEnded = { - type: "sync" - id: string - syncEvent: { - type: "session.compaction.ended.1" - id: string - seq: number - aggregateID: string - data: { - sessionID: string - reason: "auto" | "manual" - text: string - recent: string - } - } -} - -export type SyncEventSessionCompactionFailed = { - type: "sync" - id: string - syncEvent: { - type: "session.compaction.failed.1" - id: string - seq: number - aggregateID: string - data: { - sessionID: string - reason: "auto" | "manual" - error: SessionStructuredError - inputID?: string - } - } -} - -export type SyncEventSessionRevertStaged = { - type: "sync" - id: string - syncEvent: { - type: "session.revert.staged.1" - id: string - seq: number - aggregateID: string - data: { - sessionID: string - revert: SessionRevert - } - } -} - -export type SyncEventSessionRevertCleared = { - type: "sync" - id: string - syncEvent: { - type: "session.revert.cleared.1" - id: string - seq: number - aggregateID: string - data: { - sessionID: string - } - } -} - -export type SyncEventSessionRevertCommitted = { - type: "sync" - id: string - syncEvent: { - type: "session.revert.committed.1" - id: string - seq: number - aggregateID: string - data: { - sessionID: string - to: string - } - } -} - -export type ConfigV2ReferenceGit = { - repository: string - branch?: string - description?: string - hidden?: boolean -} - -export type ConfigV2ReferenceLocal = { - path: string - description?: string - hidden?: boolean -} - -export type ProjectDirectory = { - directory: string - strategy?: string -} - -export type ProjectDirectories = Array - -export type PtyTicketConnectToken = { - ticket: string - expires_in: number -} - -export type WorkspaceEventConnectionStatus = { - workspaceID: string - status: "connected" | "connecting" | "disconnected" | "error" -} - -export type LocationInfo = { - directory: string - workspaceID?: string - project: { - id: string - directory: string - } -} - -export type ProviderSettings = { - [key: string]: unknown -} - -export type ProviderRequest = { - settings: ProviderSettings - headers: { - [key: string]: string - } - body: { - [key: string]: unknown - } -} - -export type AgentColor = string | "primary" | "secondary" | "accent" | "success" | "warning" | "error" | "info" - -export type PermissionV2Effect = "allow" | "deny" | "ask" - -export type PermissionV2Rule = { - action: string - resource: string - effect: PermissionV2Effect -} - -export type PermissionV2Ruleset = Array - -export type AgentInfo = { - id: string - name: string - model?: ModelRef - request: ProviderRequest - system?: string - description?: string - mode: "subagent" | "primary" | "all" - hidden: boolean - color?: AgentColor - steps?: number - permissions: PermissionV2Ruleset -} - -export type PluginInfo = { - id: string -} - -export type SessionInfo = { - id: string - parentID?: string - fork?: { - sessionID: string - messageID?: string - } - projectID: string - agent?: string - model?: ModelRef - cost: MoneyUsd - tokens: TokenUsageInfo - time: { - created: number - updated: number - archived?: number - } - title: string - location: LocationRef - subpath?: string - revert?: SessionRevert -} - -export type PromptInputFileAttachment = { - uri: string - name?: string - description?: string - mention?: PromptMention -} - -export type SessionPendingUser = { - admittedSeq: number - id: string - sessionID: string - timeCreated: number - type: "user" - data: SessionPendingUserData - delivery: "steer" | "queue" -} - -export type SessionPendingSynthetic = { - admittedSeq: number - id: string - sessionID: string - timeCreated: number - type: "synthetic" - data: SessionPendingSyntheticData - delivery: "steer" | "queue" -} - -export type SessionPendingCompaction = { - admittedSeq: number - id: string - sessionID: string - timeCreated: number - type: "compaction" -} - -export type SessionMessageAgentSelected = { - id: string - metadata?: { - [key: string]: unknown - } - time: { - created: number - } - type: "agent-switched" - agent: string -} - -export type SessionMessageModelSelected = { - id: string - metadata?: { - [key: string]: unknown - } - time: { - created: number - } - type: "model-switched" - model: ModelRef - previous?: ModelRef -} - -export type SessionMessageUser = { - id: string - metadata?: { - [key: string]: unknown - } - time: { - created: number - } - text: string - files?: Array - agents?: Array - type: "user" -} - -export type SessionMessageSynthetic = { - id: string - metadata?: { - [key: string]: unknown - } - time: { - created: number - } - text: string - description?: string - type: "synthetic" -} - -export type SessionMessageSystem = { - id: string - metadata?: { - [key: string]: unknown - } - time: { - created: number - } - type: "system" - text: string -} - -export type SessionMessageSkill = { - id: string - metadata?: { - [key: string]: unknown - } - time: { - created: number - } - type: "skill" - skill: string - name: string - text: string -} - -export type SessionMessageShell = { - id: string - metadata?: { - [key: string]: unknown - } - time: { - created: number - completed?: number - } - type: "shell" - shellID: string - command: string - status: "running" | "exited" | "timeout" | "killed" - exit?: number | "NaN" | "Infinity" | "-Infinity" | "Infinity" | "-Infinity" | "NaN" - output?: { - output: string - cursor: number - size: number - truncated: boolean - } -} - -export type SessionMessageAssistantText = { - type: "text" - text: string -} - -export type SessionMessageAssistantReasoning = { - type: "reasoning" - text: string - state?: SessionMessageProviderState - time?: { - created: number - completed?: number - } -} - -export type SessionMessageToolStateStreaming = { - status: "streaming" - input: string -} - -export type SessionMessageToolStateRunning = { - status: "running" - input: { - [key: string]: unknown - } - structured: { - [key: string]: unknown - } - content: Array -} - -export type SessionMessageToolStateCompleted = { - status: "completed" - input: { - [key: string]: unknown - } - content: Array - structured: { - [key: string]: unknown - } - result?: unknown -} - -export type SessionMessageToolStateError = { - status: "error" - input: { - [key: string]: unknown - } - content: Array - structured: { - [key: string]: unknown - } - error: SessionStructuredError - result?: unknown -} - -export type SessionMessageAssistantTool = { - type: "tool" - id: string - name: string - executed?: boolean - providerState?: SessionMessageProviderState - providerResultState?: SessionMessageProviderState - state: - | SessionMessageToolStateStreaming - | SessionMessageToolStateRunning - | SessionMessageToolStateCompleted - | SessionMessageToolStateError - time: { - created: number - ran?: number - completed?: number - } -} - -export type SessionMessageAssistantRetry = { - attempt: number - at: number - error: SessionStructuredError -} - -export type SessionMessageAssistant = { - id: string - metadata?: { - [key: string]: unknown - } - time: { - created: number - completed?: number - } - type: "assistant" - agent: string - model: ModelRef - content: Array - snapshot?: { - start?: string - end?: string - files?: Array - } - finish?: "stop" | "length" | "tool-calls" | "content-filter" | "error" | "unknown" - cost?: MoneyUsd - tokens?: TokenUsageInfo - error?: SessionStructuredError - retry?: SessionMessageAssistantRetry -} - -export type SessionMessageCompactionRunning = { - type: "compaction" - id: string - metadata?: { - [key: string]: unknown - } - time: { - created: number - } - status: "running" - reason: "auto" | "manual" - summary: string - recent: string -} - -export type SessionMessageCompactionCompleted = { - type: "compaction" - id: string - metadata?: { - [key: string]: unknown - } - time: { - created: number - } - status: "completed" - reason: "auto" | "manual" - summary: string - recent: string -} - -export type SessionMessageCompactionFailed = { - type: "compaction" - id: string - metadata?: { - [key: string]: unknown - } - time: { - created: number - } - status: "failed" - reason: "auto" | "manual" - error: SessionStructuredError -} - -export type SessionMessageCompaction = - | SessionMessageCompactionRunning - | SessionMessageCompactionCompleted - | SessionMessageCompactionFailed - -export type SessionMessageInfo = - | SessionMessageAgentSelected - | SessionMessageModelSelected - | SessionMessageUser - | SessionMessageSynthetic - | SessionMessageSystem - | SessionMessageSkill - | SessionMessageShell - | SessionMessageAssistant - | SessionMessageCompaction - -export type SessionPendingInfo = SessionPendingUser | SessionPendingSynthetic | SessionPendingCompaction - -export type InstructionEntryKey = string - -export type InstructionEntryInfo = { - key: InstructionEntryKey - value: unknown -} - -export type SessionAgentSelected = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.agent.selected" - durable: { - aggregateID: string - seq: number - version: 1 - } - location?: LocationRef - data: { - sessionID: string - agent: string - } -} - -export type SessionModelSelected = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.model.selected" - durable: { - aggregateID: string - seq: number - version: 1 - } - location?: LocationRef - data: { - sessionID: string - model: ModelRef - } -} - -export type SessionMoved = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - 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 - metadata?: { - [key: string]: unknown - } - type: "session.renamed" - durable: { - aggregateID: string - seq: number - version: 1 - } - location?: LocationRef - data: { - sessionID: string - title: string - } -} - -export type SessionDeleted = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.deleted" - durable: { - aggregateID: string - seq: number - version: 2 - } - location?: LocationRef - data: { - sessionID: string - } -} - -export type SessionForked = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.forked" - durable: { - aggregateID: string - seq: number - version: 2 - } - location?: LocationRef - data: { - sessionID: string - parentID: string - parentSeq: number - from?: string - } -} - -export type SessionInputPromoted = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.input.promoted" - durable: { - aggregateID: string - seq: number - version: 1 - } - location?: LocationRef - data: { - sessionID: string - inputID: string - } -} - -export type SessionInputAdmitted = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.input.admitted" - durable: { - aggregateID: string - seq: number - version: 1 - } - location?: LocationRef - data: { - sessionID: string - inputID: string - input: SessionPendingMessage - } -} - -export type SessionExecutionStarted = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.execution.started" - durable: { - aggregateID: string - seq: number - version: 1 - } - location?: LocationRef - data: { - sessionID: string - } -} - -export type SessionExecutionSucceeded = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.execution.succeeded" - durable: { - aggregateID: string - seq: number - version: 1 - } - location?: LocationRef - data: { - sessionID: string - } -} - -export type SessionExecutionFailed = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.execution.failed" - durable: { - aggregateID: string - seq: number - version: 1 - } - location?: LocationRef - data: { - sessionID: string - error: SessionStructuredError - } -} - -export type SessionExecutionInterrupted = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.execution.interrupted" - durable: { - aggregateID: string - seq: number - version: 1 - } - location?: LocationRef - data: { - sessionID: string - reason: "user" | "shutdown" | "superseded" - } -} - -export type SessionInstructionsUpdated = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.instructions.updated" - durable: { - aggregateID: string - seq: number - version: 2 - } - location?: LocationRef - data: { - sessionID: string - delta: { - [key: string]: string | "removed" - } - } -} - -export type SessionSynthetic = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.synthetic" - durable: { - aggregateID: string - seq: number - version: 1 - } - location?: LocationRef - data: { - sessionID: string - text: string - description?: string - metadata?: { - [key: string]: unknown - } - } -} - -export type SessionSkillActivated = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.skill.activated" - durable: { - aggregateID: string - seq: number - version: 1 - } - location?: LocationRef - data: { - sessionID: string - id: string - name: string - text: string - } -} - -export type SessionShellStarted = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.shell.started" - durable: { - aggregateID: string - seq: number - version: 1 - } - location?: LocationRef - data: { - sessionID: string - shell: ShellInfo - } -} - -export type SessionShellEnded = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.shell.ended" - durable: { - aggregateID: string - seq: number - version: 1 - } - location?: LocationRef - data: { - sessionID: string - shell: ShellInfo - output: { - output: string - cursor: number - size: number - truncated: boolean - } - } -} - -export type SessionStepStarted = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.step.started" - durable: { - aggregateID: string - seq: number - version: 1 - } - location?: LocationRef - data: { - sessionID: string - assistantMessageID: string - agent: string - model: ModelRef - snapshot?: string - } -} - -export type SessionStepEnded = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.step.ended" - durable: { - aggregateID: string - seq: number - version: 1 - } - location?: LocationRef - data: { - sessionID: string - assistantMessageID: string - finish: "stop" | "length" | "tool-calls" | "content-filter" | "error" | "unknown" - cost: MoneyUsd - tokens: TokenUsageInfo - snapshot?: string - files?: Array - } -} - -export type SessionStepFailed = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.step.failed" - durable: { - aggregateID: string - seq: number - version: 1 - } - location?: LocationRef - data: { - sessionID: string - assistantMessageID: string - error: SessionStructuredError - cost?: MoneyUsd - tokens?: TokenUsageInfo - } -} - -export type SessionTextStarted = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.text.started" - durable: { - aggregateID: string - seq: number - version: 1 - } - location?: LocationRef - data: { - sessionID: string - assistantMessageID: string - ordinal: number - } -} - -export type SessionTextEnded = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.text.ended" - durable: { - aggregateID: string - seq: number - version: 1 - } - location?: LocationRef - data: { - sessionID: string - assistantMessageID: string - ordinal: number - text: string - } -} - -export type SessionReasoningStarted = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.reasoning.started" - durable: { - aggregateID: string - seq: number - version: 1 - } - location?: LocationRef - data: { - sessionID: string - assistantMessageID: string - ordinal: number - state?: SessionMessageProviderState - } -} - -export type SessionReasoningEnded = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.reasoning.ended" - durable: { - aggregateID: string - seq: number - version: 1 - } - location?: LocationRef - data: { - sessionID: string - assistantMessageID: string - ordinal: number - text: string - state?: SessionMessageProviderState - } -} - -export type SessionToolInputStarted = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.tool.input.started" - durable: { - aggregateID: string - seq: number - version: 1 - } - location?: LocationRef - data: { - sessionID: string - assistantMessageID: string - callID: string - name: string - } -} - -export type SessionToolInputEnded = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.tool.input.ended" - durable: { - aggregateID: string - seq: number - version: 1 - } - location?: LocationRef - data: { - sessionID: string - assistantMessageID: string - callID: string - text: string - } -} - -export type SessionToolCalled = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.tool.called" - durable: { - aggregateID: string - seq: number - version: 1 - } - location?: LocationRef - data: { - sessionID: string - assistantMessageID: string - callID: string - input: { - [key: string]: unknown - } - executed: boolean - state?: SessionMessageProviderState - } -} - -export type SessionToolProgress = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.tool.progress" - durable: { - aggregateID: string - seq: number - version: 1 - } - location?: LocationRef - data: { - sessionID: string - assistantMessageID: string - callID: string - structured: { - [key: string]: unknown - } - content: Array - } -} - -export type SessionToolSuccess = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.tool.success" - durable: { - aggregateID: string - seq: number - version: 1 - } - location?: LocationRef - data: { - sessionID: string - assistantMessageID: string - callID: string - structured: { - [key: string]: unknown - } - content: Array - result?: unknown - executed: boolean - resultState?: SessionMessageProviderState - } -} - -export type SessionToolFailed = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.tool.failed" - durable: { - aggregateID: string - seq: number - version: 1 - } - location?: LocationRef - data: { - sessionID: string - assistantMessageID: string - callID: string - error: SessionStructuredError - result?: unknown - executed: boolean - resultState?: SessionMessageProviderState - } -} - -export type SessionRetryScheduled = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.retry.scheduled" - durable: { - aggregateID: string - seq: number - version: 1 - } - location?: LocationRef - data: { - sessionID: string - assistantMessageID: string - attempt: number - at: number - error: SessionStructuredError - } -} - -export type SessionCompactionAdmitted = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.compaction.admitted" - durable: { - aggregateID: string - seq: number - version: 1 - } - location?: LocationRef - data: { - sessionID: string - inputID: string - } -} - -export type SessionCompactionStarted = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.compaction.started" - durable: { - aggregateID: string - seq: number - version: 1 - } - location?: LocationRef - data: { - sessionID: string - reason: "auto" | "manual" - recent: string - inputID?: string - } -} - -export type SessionCompactionEnded = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.compaction.ended" - durable: { - aggregateID: string - seq: number - version: 1 - } - location?: LocationRef - data: { - sessionID: string - reason: "auto" | "manual" - text: string - recent: string - } -} - -export type SessionCompactionFailed = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.compaction.failed" - durable: { - aggregateID: string - seq: number - version: 1 - } - location?: LocationRef - data: { - sessionID: string - reason: "auto" | "manual" - error: SessionStructuredError - inputID?: string - } -} - -export type SessionRevertStaged = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.revert.staged" - durable: { - aggregateID: string - seq: number - version: 1 - } - location?: LocationRef - data: { - sessionID: string - revert: SessionRevert - } -} - -export type SessionRevertCleared = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.revert.cleared" - durable: { - aggregateID: string - seq: number - version: 1 - } - location?: LocationRef - data: { - sessionID: string - } -} - -export type SessionRevertCommitted = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.revert.committed" - durable: { - aggregateID: string - seq: number - version: 1 - } - location?: LocationRef - data: { - sessionID: string - to: string - } -} - -export type SessionUsageRecorded = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.usage.recorded" - durable: { - aggregateID: string - seq: number - version: 1 - } - location?: LocationRef - data: { - sessionID: string - source: "title" | "compaction" - cost: MoneyUsd - tokens: TokenUsageInfo - } -} - -export type SessionEventDurable = - | SessionAgentSelected - | SessionModelSelected - | SessionMoved - | SessionRenamed - | SessionDeleted - | SessionForked - | SessionInputPromoted - | SessionInputAdmitted - | SessionExecutionStarted - | SessionExecutionSucceeded - | SessionExecutionFailed - | SessionExecutionInterrupted - | SessionInstructionsUpdated - | SessionSynthetic - | SessionSkillActivated - | SessionShellStarted - | SessionShellEnded - | SessionStepStarted - | SessionStepEnded - | SessionStepFailed - | SessionTextStarted - | SessionTextEnded - | SessionReasoningStarted - | SessionReasoningEnded - | SessionToolInputStarted - | SessionToolInputEnded - | SessionToolCalled - | SessionToolProgress - | SessionToolSuccess - | SessionToolFailed - | SessionRetryScheduled - | SessionCompactionAdmitted - | SessionCompactionStarted - | SessionCompactionEnded - | SessionCompactionFailed - | SessionRevertStaged - | SessionRevertCleared - | SessionRevertCommitted - | SessionUsageRecorded - -export type EventLogSynced = { - type: "log.synced" - aggregateID: string - seq?: number -} - -export type ModelCapabilities = { - tools: boolean - input: Array - output: Array -} - -export type ModelVariant = { - id: string - settings?: { - [key: string]: unknown - } - headers?: { - [key: string]: string - } - body?: { - [key: string]: unknown - } -} - -export type MoneyUsdPerMillionTokens = number - -export type ModelCost = { - tier?: { - type: "context" - size: number - } - input: MoneyUsdPerMillionTokens - output: MoneyUsdPerMillionTokens - cache: { - read: MoneyUsdPerMillionTokens - write: MoneyUsdPerMillionTokens - } -} - -export type ModelInfo = { - id: string - modelID: string - providerID: string - family?: string - name: string - package?: string - settings?: { - [key: string]: unknown - } - headers?: { - [key: string]: string - } - body?: { - [key: string]: unknown - } - capabilities: ModelCapabilities - variants: Array - time: { - released: number - } - cost: Array - status: "alpha" | "beta" | "deprecated" | "active" - enabled: boolean - limit: { - context: number - input?: number - output: number - } -} - -export type ProviderV2Info = { - id: string - integrationID?: string - name: string - disabled?: boolean - package: string - settings?: { - [key: string]: unknown - } - headers?: { - [key: string]: string - } - body?: { - [key: string]: unknown - } -} - -export type IntegrationWhen = { - key: string - op: "eq" | "neq" - value: string -} - -export type IntegrationTextPrompt = { - type: "text" - key: string - message: string - placeholder?: string - when?: IntegrationWhen -} - -export type IntegrationSelectPrompt = { - type: "select" - key: string - message: string - options: Array<{ - label: string - value: string - hint?: string - }> - when?: IntegrationWhen -} - -export type IntegrationOAuthMethod = { - id: string - type: "oauth" - label: string - prompts?: Array -} - -export type IntegrationCommandMethod = { - id: string - type: "command" - label: string - command: Array -} - -export type IntegrationKeyMethod = { - type: "key" - label?: string -} - -export type IntegrationEnvMethod = { - type: "env" - names: Array -} - -export type ConnectionCredentialInfo = { - type: "credential" - id: string - label: string -} - -export type ConnectionEnvInfo = { - type: "env" - name: string -} - -export type ConnectionInfo = ConnectionCredentialInfo | ConnectionEnvInfo - -export type IntegrationInfo = { - id: string - name: string - methods: Array - connections: Array -} - -export type IntegrationAttempt = { - attemptID: string - url: string - instructions: string - mode: "auto" | "code" - time: { - created: number | "NaN" | "Infinity" | "-Infinity" | "Infinity" | "-Infinity" | "NaN" - expires: number | "NaN" | "Infinity" | "-Infinity" | "Infinity" | "-Infinity" | "NaN" - } -} - -export type IntegrationAttemptStatus = - | { - status: "pending" - time: { - created: number | "NaN" | "Infinity" | "-Infinity" | "Infinity" | "-Infinity" | "NaN" - expires: number | "NaN" | "Infinity" | "-Infinity" | "Infinity" | "-Infinity" | "NaN" - } - } - | { - status: "complete" - time: { - created: number | "NaN" | "Infinity" | "-Infinity" | "Infinity" | "-Infinity" | "NaN" - expires: number | "NaN" | "Infinity" | "-Infinity" | "Infinity" | "-Infinity" | "NaN" - } - } - | { - status: "failed" - message: string - time: { - created: number | "NaN" | "Infinity" | "-Infinity" | "Infinity" | "-Infinity" | "NaN" - expires: number | "NaN" | "Infinity" | "-Infinity" | "Infinity" | "-Infinity" | "NaN" - } - } - | { - status: "expired" - time: { - created: number | "NaN" | "Infinity" | "-Infinity" | "Infinity" | "-Infinity" | "NaN" - expires: number | "NaN" | "Infinity" | "-Infinity" | "Infinity" | "-Infinity" | "NaN" - } - } - -export type IntegrationCommandAttempt = { - attemptID: string - time: { - created: number | "NaN" | "Infinity" | "-Infinity" | "Infinity" | "-Infinity" | "NaN" - expires: number | "NaN" | "Infinity" | "-Infinity" | "Infinity" | "-Infinity" | "NaN" - } -} - -export type IntegrationCommandAttemptStatus = - | { - status: "pending" - message?: string - time: { - created: number | "NaN" | "Infinity" | "-Infinity" | "Infinity" | "-Infinity" | "NaN" - expires: number | "NaN" | "Infinity" | "-Infinity" | "Infinity" | "-Infinity" | "NaN" - } - } - | { - status: "complete" - time: { - created: number | "NaN" | "Infinity" | "-Infinity" | "Infinity" | "-Infinity" | "NaN" - expires: number | "NaN" | "Infinity" | "-Infinity" | "Infinity" | "-Infinity" | "NaN" - } - } - | { - status: "failed" - message: string - time: { - created: number | "NaN" | "Infinity" | "-Infinity" | "Infinity" | "-Infinity" | "NaN" - expires: number | "NaN" | "Infinity" | "-Infinity" | "Infinity" | "-Infinity" | "NaN" - } - } - | { - status: "expired" - time: { - created: number | "NaN" | "Infinity" | "-Infinity" | "Infinity" | "-Infinity" | "NaN" - expires: number | "NaN" | "Infinity" | "-Infinity" | "Infinity" | "-Infinity" | "NaN" - } - } - -export type McpStatusConnected2 = { - status: "connected" -} - -export type McpStatusPending = { - status: "pending" -} - -export type McpStatusDisabled2 = { - status: "disabled" -} - -export type McpStatusFailed2 = { - status: "failed" - error: string -} - -export type McpStatusNeedsAuth2 = { - status: "needs_auth" -} - -export type McpStatusNeedsClientRegistration2 = { - status: "needs_client_registration" - error: string -} - -export type McpServer = { - name: string - status: - | McpStatusConnected2 - | McpStatusPending - | McpStatusDisabled2 - | McpStatusFailed2 - | McpStatusNeedsAuth2 - | McpStatusNeedsClientRegistration2 - integrationID?: string -} - -export type McpResourceTemplate = { - server: string - name: string - uriTemplate: string - description?: string - mimeType?: string -} - -export type McpResourceCatalog = { - resources: Array - templates: Array -} - -export type ProjectCurrent = { - id: string - directory: string -} - -export type FormCreatePayload = { - id?: string - title: string - metadata?: FormMetadata - fields: FormFields -} - -export type FormState = - | { - status: "pending" - } - | { - status: "answered" - answer: FormAnswer - } - | { - status: "cancelled" - } - -export type FormReply = { - answer: FormAnswer -} - -export type PermissionV2Request = { - id: string - sessionID: string - action: string - resources: Array - save?: Array - metadata?: { - [key: string]: unknown - } - source?: PermissionV2Source -} - -export type PermissionSavedInfo = { - id: string - projectID: string - action: string - resource: string -} - -export type FileSystemEntry = { - path: string - type: "file" | "directory" -} - -export type CommandInfo = { - name: string - template: string - description?: string - agent?: string - model?: ModelRef - subtask?: boolean -} - -export type SkillInfo = { - id: string - name: string - description?: string - slash?: boolean - autoinvoke?: boolean - location: string - content: string -} - -export type ModelsDevRefreshed = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "models-dev.refreshed" - location?: LocationRef - data: { - [key: string]: unknown - } -} - -export type IntegrationUpdated = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "integration.updated" - location?: LocationRef - data: { - [key: string]: unknown - } -} - -export type IntegrationConnectionUpdated = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "integration.connection.updated" - location?: LocationRef - data: { - integrationID: string - } -} - -export type CatalogUpdated = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "catalog.updated" - location?: LocationRef - data: { - [key: string]: unknown - } -} - -export type AgentUpdated = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "agent.updated" - location?: LocationRef - data: { - [key: string]: unknown - } -} - -export type SessionCreated = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.created" - durable: { - aggregateID: string - seq: number - version: 1 - } - location?: LocationRef - data: { - sessionID: string - info: SessionV1Info - } -} - -export type SessionUpdated = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.updated" - durable: { - aggregateID: string - seq: number - version: 1 - } - location?: LocationRef - data: { - sessionID: string - info: SessionV1Info - } -} - -export type MessageUpdated = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "message.updated" - durable: { - aggregateID: string - seq: number - version: 1 - } - location?: LocationRef - data: { - sessionID: string - info: Message - } -} - -export type MessageRemoved = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "message.removed" - durable: { - aggregateID: string - seq: number - version: 1 - } - location?: LocationRef - data: { - sessionID: string - messageID: string - } -} - -export type MessagePartUpdated = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "message.part.updated" - durable: { - aggregateID: string - seq: number - version: 1 - } - location?: LocationRef - data: { - sessionID: string - part: Part - time: number - } -} - -export type MessagePartRemoved = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "message.part.removed" - durable: { - aggregateID: string - seq: number - version: 1 - } - location?: LocationRef - data: { - sessionID: string - messageID: string - partID: string - } -} - -export type SessionUsageUpdated = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.usage.updated" - location?: LocationRef - data: { - sessionID: string - cost: MoneyUsd - tokens: TokenUsageInfo - } -} - -export type SessionTextDelta = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.text.delta" - location?: LocationRef - data: { - sessionID: string - assistantMessageID: string - ordinal: number - delta: string - } -} - -export type SessionReasoningDelta = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.reasoning.delta" - location?: LocationRef - data: { - sessionID: string - assistantMessageID: string - ordinal: number - delta: string - } -} - -export type SessionToolInputDelta = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.tool.input.delta" - location?: LocationRef - data: { - sessionID: string - assistantMessageID: string - callID: string - delta: string - } -} - -export type SessionCompactionDelta = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.compaction.delta" - location?: LocationRef - data: { - sessionID: string - text: string - } -} - -export type MessagePartDelta = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "message.part.delta" - location?: LocationRef - data: { - sessionID: string - messageID: string - partID: string - field: string - delta: string - } -} - -export type SessionDiff = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.diff" - location?: LocationRef - data: { - sessionID: string - diff: Array - } -} - -export type SessionError = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.error" - location?: LocationRef - data: { - sessionID?: string - error?: - | ProviderAuthError - | UnknownError - | MessageOutputLengthError - | MessageAbortedError - | StructuredOutputError - | ContextOverflowError - | ContentFilterError - | ApiError - } -} - -export type InstallationUpdated = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "installation.updated" - location?: LocationRef - data: { - version: string - } -} - -export type InstallationUpdateAvailable = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "installation.update-available" - location?: LocationRef - data: { - version: string - } -} - -export type FilesystemChanged = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "filesystem.changed" - location?: LocationRef - data: { - file: string - event: "add" | "change" | "unlink" - } -} - -export type ReferenceUpdated = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "reference.updated" - location?: LocationRef - data: { - [key: string]: unknown - } -} - -export type PermissionV2Asked = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "permission.v2.asked" - location?: LocationRef - data: { - id: string - sessionID: string - action: string - resources: Array - save?: Array - metadata?: { - [key: string]: unknown - } - source?: PermissionV2Source - } -} - -export type PermissionV2Replied = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "permission.v2.replied" - location?: LocationRef - data: { - sessionID: string - requestID: string - reply: PermissionV2Reply - } -} - -export type PluginAdded = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "plugin.added" - location?: LocationRef - data: { - id: string - } -} - -export type PluginUpdated = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "plugin.updated" - location?: LocationRef - data: { - [key: string]: unknown - } -} - -export type ProjectDirectoriesUpdated = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "project.directories.updated" - location?: LocationRef - data: { - projectID: string - } -} - -export type CommandUpdated = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "command.updated" - location?: LocationRef - data: { - [key: string]: unknown - } -} - -export type ConfigUpdated = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "config.updated" - location?: LocationRef - data: { - [key: string]: unknown - } -} - -export type SkillUpdated = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "skill.updated" - location?: LocationRef - data: { - [key: string]: unknown - } -} - -export type PtyCreated = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "pty.created" - location?: LocationRef - data: { - info: Pty - } -} - -export type PtyUpdated = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "pty.updated" - location?: LocationRef - data: { - info: Pty - } -} - -export type PtyExited = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "pty.exited" - location?: LocationRef - data: { - id: string - exitCode: number - } -} - -export type PtyDeleted = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "pty.deleted" - location?: LocationRef - data: { - id: string - } -} - -export type ShellCreated = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "shell.created" - location?: LocationRef - data: { - info: ShellInfo - } -} - -export type ShellExited = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "shell.exited" - location?: LocationRef - data: { - id: string - exit?: number - status: "running" | "exited" | "timeout" | "killed" - } -} - -export type ShellDeleted = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "shell.deleted" - location?: LocationRef - data: { - id: string - } -} - -export type QuestionV2Asked = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "question.v2.asked" - location?: LocationRef - data: { - id: string - sessionID: string - /** - * Questions to ask - */ - questions: Array - tool?: QuestionV2Tool - } -} - -export type QuestionV2Replied = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "question.v2.replied" - location?: LocationRef - data: { - sessionID: string - requestID: string - answers: Array - } -} - -export type QuestionV2Rejected = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "question.v2.rejected" - location?: LocationRef - data: { - sessionID: string - requestID: string - } -} - -export type FormWhen1 = { - key: string - op: "eq" | "neq" - value: string | number | "NaN" | "Infinity" | "-Infinity" | boolean -} - -export type FormNumberField1 = { - key: string - title?: string - description?: string - required?: boolean - when?: Array - type: "number" - minimum?: number | "NaN" | "Infinity" | "-Infinity" - maximum?: number | "NaN" | "Infinity" | "-Infinity" - default?: number | "NaN" | "Infinity" | "-Infinity" -} - -export type FormIntegerField1 = { - key: string - title?: string - description?: string - required?: boolean - when?: Array - type: "integer" - minimum?: number | "NaN" | "Infinity" | "-Infinity" - maximum?: number | "NaN" | "Infinity" | "-Infinity" - default?: number | "NaN" | "Infinity" | "-Infinity" -} - -export type FormCreated = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "form.created" - location?: LocationRef - data: { - form: FormInfo - } -} - -export type FormValue1 = string | number | "NaN" | "Infinity" | "-Infinity" | boolean | Array - -export type FormReplied = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "form.replied" - location?: LocationRef - data: { - id: string - sessionID: string - answer: FormAnswer - } -} - -export type FormCancelled = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "form.cancelled" - location?: LocationRef - data: { - id: string - sessionID: string - } -} - -export type LspUpdated = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "lsp.updated" - location?: LocationRef - data: { - [key: string]: unknown - } -} - -export type PermissionAsked = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "permission.asked" - location?: LocationRef - data: { - id: string - sessionID: string - permission: string - patterns: Array - metadata: { - [key: string]: unknown - } - always: Array - tool?: { - messageID: string - callID: string - } - } -} - -export type PermissionReplied = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "permission.replied" - location?: LocationRef - data: { - sessionID: string - requestID: string - reply: "once" | "always" | "reject" - } -} - -export type TuiPromptAppend = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "tui.prompt.append" - location?: LocationRef - data: { - text: string - } -} - -export type TuiCommandExecute = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "tui.command.execute" - location?: LocationRef - data: { - command: - | "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" - | string - } -} - -export type TuiToastShow = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "tui.toast.show" - location?: LocationRef - data: { - title?: string - message: string - variant: "info" | "success" | "warning" | "error" - duration?: number - } -} - -export type TuiSessionSelect = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "tui.session.select" - location?: LocationRef - data: { - /** - * Session ID to navigate to - */ - sessionID: string - } -} - -export type McpToolsChanged = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "mcp.tools.changed" - location?: LocationRef - data: { - server: string - } -} - -export type McpResourcesChanged = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "mcp.resources.changed" - location?: LocationRef - data: { - server: string - } -} - -export type McpStatusChanged = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "mcp.status.changed" - location?: LocationRef - data: { - server: string - } -} - -export type CommandExecuted = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "command.executed" - location?: LocationRef - data: { - name: string - sessionID: string - arguments: string - messageID: string - } -} - -export type FileEdited = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "file.edited" - location?: LocationRef - data: { - file: string - } -} - -export type ProjectUpdated = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "project.updated" - location?: LocationRef - data: { - id: string - worktree: string - vcs?: ProjectVcs - name?: string - icon?: ProjectIcon - commands?: ProjectCommands - time: ProjectTime - sandboxes: Array - } -} - -export type SessionIdle = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.idle" - location?: LocationRef - data: { - sessionID: string - } -} - -export type QuestionAsked = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "question.asked" - location?: LocationRef - data: { - id: string - sessionID: string - /** - * Questions to ask - */ - questions: Array - tool?: QuestionTool - } -} - -export type SessionCompacted = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.compacted" - location?: LocationRef - data: { - sessionID: string - } -} - -export type VcsBranchUpdated = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "vcs.branch.updated" - location?: LocationRef - data: { - branch?: string - } -} - -export type WorkspaceReady = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "workspace.ready" - location?: LocationRef - data: { - name: string - } -} - -export type WorkspaceFailed = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "workspace.failed" - location?: LocationRef - data: { - message: string - } -} - -export type WorkspaceStatus = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "workspace.status" - location?: LocationRef - data: { - workspaceID: string - status: "connected" | "connecting" | "disconnected" | "error" - } -} - -export type WorktreeReady = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "worktree.ready" - location?: LocationRef - data: { - name: string - branch?: string - } -} - -export type WorktreeFailed = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "worktree.failed" - location?: LocationRef - data: { - message: string - } -} - -export type ServerConnected = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "server.connected" - location?: LocationRef - data: { - [key: string]: unknown - } -} - -export type GlobalDisposed = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "global.disposed" - location?: LocationRef - data: { - [key: string]: unknown - } -} - -export type QuestionV2Request = { - id: string - sessionID: string - /** - * Questions to ask - */ - questions: Array - tool?: QuestionV2Tool -} - -export type QuestionV2Reply = { - /** - * User answers in order of questions (each answer is an array of selected labels) - */ - answers: Array -} - -export type ReferenceLocalSource = { - type: "local" - path: string - description?: string - hidden?: boolean -} - -export type ReferenceGitSource = { - type: "git" - repository: string - branch?: string - description?: string - hidden?: boolean -} - -export type ReferenceSource = ReferenceLocalSource | ReferenceGitSource - -export type ReferenceInfo = { - name: string - path: string - description?: string - hidden?: boolean - source: ReferenceSource -} - -export type ProjectCopyCopy = { - directory: string -} - -export type VcsMode = "working" | "branch" - -export type EventModelsDevRefreshed = { - id: string - type: "models-dev.refreshed" - properties: { - [key: string]: unknown - } -} - -export type EventIntegrationUpdated = { - id: string - type: "integration.updated" - properties: { - [key: string]: unknown - } -} - -export type EventIntegrationConnectionUpdated = { - id: string - type: "integration.connection.updated" - properties: { - integrationID: string - } -} - -export type EventCatalogUpdated = { - id: string - type: "catalog.updated" - properties: { - [key: string]: unknown - } -} - -export type EventAgentUpdated = { - id: string - type: "agent.updated" - properties: { - [key: string]: unknown - } -} - -export type EventSessionCreated = { - id: string - type: "session.created" - properties: { - sessionID: string - info: SessionV1Info - } -} - -export type EventSessionUpdated = { - id: string - type: "session.updated" - properties: { - sessionID: string - info: SessionV1Info - } -} - -export type EventSessionDeleted = { - id: string - type: "session.deleted" - properties: { - sessionID: string - } -} - -export type EventMessageUpdated = { - id: string - type: "message.updated" - properties: { - sessionID: string - info: Message - } -} - -export type EventMessageRemoved = { - id: string - type: "message.removed" - properties: { - sessionID: string - messageID: string - } -} - -export type EventMessagePartUpdated = { - id: string - type: "message.part.updated" - properties: { - sessionID: string - part: Part - time: number - } -} - -export type EventMessagePartRemoved = { - id: string - type: "message.part.removed" - properties: { - sessionID: string - messageID: string - partID: string - } -} - -export type EventSessionAgentSelected = { - id: string - type: "session.agent.selected" - properties: { - sessionID: string - agent: string - } -} - -export type EventSessionModelSelected = { - id: string - type: "session.model.selected" - properties: { - sessionID: string - model: ModelRef - } -} - -export type EventSessionMoved = { - id: string - type: "session.moved" - properties: { - sessionID: string - location: LocationRef - projectID?: string - subpath?: string - } -} - -export type EventSessionRenamed = { - id: string - type: "session.renamed" - properties: { - sessionID: string - title: string - } -} - -export type EventSessionUsageUpdated = { - id: string - type: "session.usage.updated" - properties: { - sessionID: string - cost: MoneyUsd - tokens: TokenUsageInfo - } -} - -export type EventSessionForked = { - id: string - type: "session.forked" - properties: { - sessionID: string - parentID: string - parentSeq: number - from?: string - } -} - -export type EventSessionInputPromoted = { - id: string - type: "session.input.promoted" - properties: { - sessionID: string - inputID: string - } -} - -export type EventSessionInputAdmitted = { - id: string - type: "session.input.admitted" - properties: { - sessionID: string - inputID: string - input: SessionPendingMessage - } -} - -export type EventSessionExecutionStarted = { - id: string - type: "session.execution.started" - properties: { - sessionID: string - } -} - -export type EventSessionExecutionSucceeded = { - id: string - type: "session.execution.succeeded" - properties: { - sessionID: string - } -} - -export type EventSessionExecutionFailed = { - id: string - type: "session.execution.failed" - properties: { - sessionID: string - error: SessionStructuredError - } -} - -export type EventSessionExecutionInterrupted = { - id: string - type: "session.execution.interrupted" - properties: { - sessionID: string - reason: "user" | "shutdown" | "superseded" - } -} - -export type EventSessionInstructionsUpdated = { - id: string - type: "session.instructions.updated" - properties: { - sessionID: string - delta: { - [key: string]: string | "removed" - } - } -} - -export type EventSessionSynthetic = { - id: string - type: "session.synthetic" - properties: { - sessionID: string - text: string - description?: string - metadata?: { - [key: string]: unknown - } - } -} - -export type EventSessionSkillActivated = { - id: string - type: "session.skill.activated" - properties: { - sessionID: string - id: string - name: string - text: string - } -} - -export type EventSessionShellStarted = { - id: string - type: "session.shell.started" - properties: { - sessionID: string - shell: ShellInfo - } -} - -export type EventSessionShellEnded = { - id: string - type: "session.shell.ended" - properties: { - sessionID: string - shell: ShellInfo - output: { - output: string - cursor: number - size: number - truncated: boolean - } - } -} - -export type EventSessionStepStarted = { - id: string - type: "session.step.started" - properties: { - sessionID: string - assistantMessageID: string - agent: string - model: ModelRef - snapshot?: string - } -} - -export type EventSessionStepEnded = { - id: string - type: "session.step.ended" - properties: { - sessionID: string - assistantMessageID: string - finish: "stop" | "length" | "tool-calls" | "content-filter" | "error" | "unknown" - cost: MoneyUsd - tokens: TokenUsageInfo - snapshot?: string - files?: Array - } -} - -export type EventSessionStepFailed = { - id: string - type: "session.step.failed" - properties: { - sessionID: string - assistantMessageID: string - error: SessionStructuredError - cost?: MoneyUsd - tokens?: TokenUsageInfo - } -} - -export type EventSessionTextStarted = { - id: string - type: "session.text.started" - properties: { - sessionID: string - assistantMessageID: string - ordinal: number - } -} - -export type EventSessionTextDelta = { - id: string - type: "session.text.delta" - properties: { - sessionID: string - assistantMessageID: string - ordinal: number - delta: string - } -} - -export type EventSessionTextEnded = { - id: string - type: "session.text.ended" - properties: { - sessionID: string - assistantMessageID: string - ordinal: number - text: string - } -} - -export type EventSessionReasoningStarted = { - id: string - type: "session.reasoning.started" - properties: { - sessionID: string - assistantMessageID: string - ordinal: number - state?: SessionMessageProviderState - } -} - -export type EventSessionReasoningDelta = { - id: string - type: "session.reasoning.delta" - properties: { - sessionID: string - assistantMessageID: string - ordinal: number - delta: string - } -} - -export type EventSessionReasoningEnded = { - id: string - type: "session.reasoning.ended" - properties: { - sessionID: string - assistantMessageID: string - ordinal: number - text: string - state?: SessionMessageProviderState - } -} - -export type EventSessionToolInputStarted = { - id: string - type: "session.tool.input.started" - properties: { - sessionID: string - assistantMessageID: string - callID: string - name: string - } -} - -export type EventSessionToolInputDelta = { - id: string - type: "session.tool.input.delta" - properties: { - sessionID: string - assistantMessageID: string - callID: string - delta: string - } -} - -export type EventSessionToolInputEnded = { - id: string - type: "session.tool.input.ended" - properties: { - sessionID: string - assistantMessageID: string - callID: string - text: string - } -} - -export type EventSessionToolCalled = { - id: string - type: "session.tool.called" - properties: { - sessionID: string - assistantMessageID: string - callID: string - input: { - [key: string]: unknown - } - executed: boolean - state?: SessionMessageProviderState - } -} - -export type EventSessionToolProgress = { - id: string - type: "session.tool.progress" - properties: { - sessionID: string - assistantMessageID: string - callID: string - structured: { - [key: string]: unknown - } - content: Array - } -} - -export type EventSessionToolSuccess = { - id: string - type: "session.tool.success" - properties: { - sessionID: string - assistantMessageID: string - callID: string - structured: { - [key: string]: unknown - } - content: Array - result?: unknown - executed: boolean - resultState?: SessionMessageProviderState - } -} - -export type EventSessionToolFailed = { - id: string - type: "session.tool.failed" - properties: { - sessionID: string - assistantMessageID: string - callID: string - error: SessionStructuredError - result?: unknown - executed: boolean - resultState?: SessionMessageProviderState - } -} - -export type EventSessionRetryScheduled = { - id: string - type: "session.retry.scheduled" - properties: { - sessionID: string - assistantMessageID: string - attempt: number - at: number - error: SessionStructuredError - } -} - -export type EventSessionCompactionAdmitted = { - id: string - type: "session.compaction.admitted" - properties: { - sessionID: string - inputID: string - } -} - -export type EventSessionCompactionStarted = { - id: string - type: "session.compaction.started" - properties: { - sessionID: string - reason: "auto" | "manual" - recent: string - inputID?: string - } -} - -export type EventSessionCompactionDelta = { - id: string - type: "session.compaction.delta" - properties: { - sessionID: string - text: string - } -} - -export type EventSessionCompactionEnded = { - id: string - type: "session.compaction.ended" - properties: { - sessionID: string - reason: "auto" | "manual" - text: string - recent: string - } -} - -export type EventSessionCompactionFailed = { - id: string - type: "session.compaction.failed" - properties: { - sessionID: string - reason: "auto" | "manual" - error: SessionStructuredError - inputID?: string - } -} - -export type EventSessionRevertStaged = { - id: string - type: "session.revert.staged" - properties: { - sessionID: string - revert: SessionRevert - } -} - -export type EventSessionRevertCleared = { - id: string - type: "session.revert.cleared" - properties: { - sessionID: string - } -} - -export type EventSessionRevertCommitted = { - id: string - type: "session.revert.committed" - properties: { - sessionID: string - to: string - } -} - -export type EventMessagePartDelta = { - id: string - type: "message.part.delta" - properties: { - sessionID: string - messageID: string - partID: string - field: string - delta: string - } -} - -export type EventSessionDiff = { - id: string - type: "session.diff" - properties: { - sessionID: string - diff: Array - } -} - -export type EventSessionError = { - id: string - type: "session.error" - properties: { - sessionID?: string - error?: - | ProviderAuthError - | UnknownError - | MessageOutputLengthError - | MessageAbortedError - | StructuredOutputError - | ContextOverflowError - | ContentFilterError - | ApiError - } -} - -export type EventInstallationUpdated = { - id: string - type: "installation.updated" - properties: { - version: string - } -} - -export type EventInstallationUpdateAvailable = { - id: string - type: "installation.update-available" - properties: { - version: string - } -} - -export type EventFilesystemChanged = { - id: string - type: "filesystem.changed" - properties: { - file: string - event: "add" | "change" | "unlink" - } -} - -export type EventReferenceUpdated = { - id: string - type: "reference.updated" - properties: { - [key: string]: unknown - } -} - -export type EventPermissionV2Asked = { - id: string - type: "permission.v2.asked" - properties: { - id: string - sessionID: string - action: string - resources: Array - save?: Array - metadata?: { - [key: string]: unknown - } - source?: PermissionV2Source - } -} - -export type EventPermissionV2Replied = { - id: string - type: "permission.v2.replied" - properties: { - sessionID: string - requestID: string - reply: PermissionV2Reply - } -} - -export type EventPluginAdded = { - id: string - type: "plugin.added" - properties: { - id: string - } -} - -export type EventPluginUpdated = { - id: string - type: "plugin.updated" - properties: { - [key: string]: unknown - } -} - -export type EventProjectDirectoriesUpdated = { - id: string - type: "project.directories.updated" - properties: { - projectID: string - } -} - -export type EventCommandUpdated = { - id: string - type: "command.updated" - properties: { - [key: string]: unknown - } -} - -export type EventConfigUpdated = { - id: string - type: "config.updated" - properties: { - [key: string]: unknown - } -} - -export type EventSkillUpdated = { - id: string - type: "skill.updated" - properties: { - [key: string]: unknown - } -} - -export type EventPtyCreated = { - id: string - type: "pty.created" - properties: { - info: Pty - } -} - -export type EventPtyUpdated = { - id: string - type: "pty.updated" - properties: { - info: Pty - } -} - -export type EventPtyExited = { - id: string - type: "pty.exited" - properties: { - id: string - exitCode: number - } -} - -export type EventPtyDeleted = { - id: string - type: "pty.deleted" - properties: { - id: string - } -} - -export type EventShellCreated = { - id: string - type: "shell.created" - properties: { - info: ShellInfo - } -} - -export type EventShellExited = { - id: string - type: "shell.exited" - properties: { - id: string - exit?: number - status: "running" | "exited" | "timeout" | "killed" - } -} - -export type EventShellDeleted = { - id: string - type: "shell.deleted" - properties: { - id: string - } -} - -export type EventQuestionV2Asked = { - id: string - type: "question.v2.asked" - properties: { - id: string - sessionID: string - /** - * Questions to ask - */ - questions: Array - tool?: QuestionV2Tool - } -} - -export type EventQuestionV2Replied = { - id: string - type: "question.v2.replied" - properties: { - sessionID: string - requestID: string - answers: Array - } -} - -export type EventQuestionV2Rejected = { - id: string - type: "question.v2.rejected" - properties: { - sessionID: string - requestID: string - } -} - -export type FormNumberField2 = { - key: string - title?: string - description?: string - required?: boolean - when?: Array - type: "number" - minimum?: number | "NaN" | "Infinity" | "-Infinity" - maximum?: number | "NaN" | "Infinity" | "-Infinity" - default?: number | "NaN" | "Infinity" | "-Infinity" -} - -export type FormIntegerField2 = { - key: string - title?: string - description?: string - required?: boolean - when?: Array - type: "integer" - minimum?: number | "NaN" | "Infinity" | "-Infinity" - maximum?: number | "NaN" | "Infinity" | "-Infinity" - default?: number | "NaN" | "Infinity" | "-Infinity" -} - -export type EventFormCreated = { - id: string - type: "form.created" - properties: { - form: FormInfo - } -} - -export type EventFormReplied = { - id: string - type: "form.replied" - properties: { - id: string - sessionID: string - answer: FormAnswer - } -} - -export type EventFormCancelled = { - id: string - type: "form.cancelled" - properties: { - id: string - sessionID: string - } -} - -export type EventLspUpdated = { - id: string - type: "lsp.updated" - properties: { - [key: string]: unknown - } -} - -export type EventPermissionAsked = { - id: string - type: "permission.asked" - properties: { - id: string - sessionID: string - permission: string - patterns: Array - metadata: { - [key: string]: unknown - } - always: Array - tool?: { - messageID: string - callID: string - } - } -} - -export type EventPermissionReplied = { - id: string - type: "permission.replied" - properties: { - sessionID: string - requestID: string - reply: "once" | "always" | "reject" - } -} - -export type EventMcpToolsChanged = { - id: string - type: "mcp.tools.changed" - properties: { - server: string - } -} - -export type EventMcpResourcesChanged = { - id: string - type: "mcp.resources.changed" - properties: { - server: string - } -} - -export type EventMcpStatusChanged = { - id: string - type: "mcp.status.changed" - properties: { - server: string - } -} - -export type EventCommandExecuted = { - id: string - type: "command.executed" - properties: { - name: string - sessionID: string - arguments: string - messageID: string - } -} - -export type EventFileEdited = { - id: string - type: "file.edited" - properties: { - file: string - } -} - -export type EventProjectUpdated = { - id: string - type: "project.updated" - properties: { - id: string - worktree: string - vcs?: ProjectVcs - name?: string - icon?: ProjectIcon - commands?: ProjectCommands - time: ProjectTime - sandboxes: Array - } -} - -export type EventSessionStatus = { - id: string - type: "session.status" - properties: { - sessionID: string - status: SessionStatus - } -} - -export type EventSessionIdle = { - id: string - type: "session.idle" - properties: { - sessionID: string - } -} - -export type EventQuestionAsked = { - id: string - type: "question.asked" - properties: { - id: string - sessionID: string - /** - * Questions to ask - */ - questions: Array - tool?: QuestionTool - } -} - -export type EventQuestionReplied = { - id: string - type: "question.replied" - properties: { - sessionID: string - requestID: string - answers: Array - } -} - -export type EventQuestionRejected = { - id: string - type: "question.rejected" - properties: { - sessionID: string - requestID: string - } -} - -export type EventSessionCompacted = { - id: string - type: "session.compacted" - properties: { - sessionID: string - } -} - -export type EventVcsBranchUpdated = { - id: string - type: "vcs.branch.updated" - properties: { - branch?: string - } -} - -export type EventWorkspaceReady = { - id: string - type: "workspace.ready" - properties: { - name: string - } -} - -export type EventWorkspaceFailed = { - id: string - type: "workspace.failed" - properties: { - message: string - } -} - -export type EventWorkspaceStatus = { - id: string - type: "workspace.status" - properties: { - workspaceID: string - status: "connected" | "connecting" | "disconnected" | "error" - } -} - -export type EventWorktreeReady = { - id: string - type: "worktree.ready" - properties: { - name: string - branch?: string - } -} - -export type EventWorktreeFailed = { - id: string - type: "worktree.failed" - properties: { - message: string - } -} - -export type EventServerConnected = { - id: string - type: "server.connected" - properties: { - [key: string]: unknown - } -} - -export type EventGlobalDisposed = { - id: string - type: "global.disposed" - properties: { - [key: string]: unknown - } -} - -export type CredentialOAuth = { - type: "oauth" - methodID: string - refresh: string - access: string - expires: number - metadata?: { - [key: string]: unknown - } -} - -export type CredentialKey = { - type: "key" - key: string - metadata?: { - [key: string]: unknown - } -} - -export type SkillDirectorySource = { - type: "directory" - path: string -} - -export type SkillUrlSource = { - type: "url" - url: string -} - -export type SkillEmbeddedSource = { - type: "embedded" - skill: SkillInfo -} - -export type BadRequestError = { - name: "BadRequest" - data: { - message: string - kind?: "Params" | "Headers" | "Query" | "Body" | "Payload" - } -} - -export type ServiceHealthV2 = { - healthy: true - version: string - pid: number -} - -export type InvalidRequestErrorV2 = { - _tag: "InvalidRequestError" - message: string - kind?: string | null - field?: string | null -} - -export type SessionsResponseV2 = { - data: Array - cursor: { - previous?: string | null - next?: string | null - } -} - -export type InvalidRequestError1 = { - _tag: "InvalidRequestError" - message: string - kind?: string | null - field?: string | null -} - -export type ConflictErrorV2 = { - _tag: "ConflictError" - message: string - resource?: string | null -} - -export type ServiceUnavailableErrorV2 = { - _tag: "ServiceUnavailableError" - message: string - service?: string | null -} - -export type UnknownErrorV2 = { - _tag: "UnknownError" - message: string - ref?: string | null -} - -export type SessionMessagesResponseV2 = { - data: Array - cursor: { - previous?: string | null - next?: string | null - } -} - -export type OutputFormatV2 = - | { - type: "text" - } - | { - type: "json_schema" - schema: JsonSchema - retryCount?: number | null | null - } - -export type UserMessageV2 = { - id: string - sessionID: string - role: "user" - time: { - created: number - } - format?: OutputFormatV2 | null - summary?: { - title?: string | null - body?: string | null - diffs: Array - } | null - agent: string - model: { - providerID: string - modelID: string - variant?: string | null - } - system?: string | null - tools?: { - [key: string]: boolean - } | null -} - -export type UnknownError1V2 = { - name: "UnknownError" - data: { - message: string - ref?: string | null - } -} - -export type MessageOutputLengthErrorV2 = { - name: "MessageOutputLengthError" - data: - | { - [key: string]: unknown - } - | Array -} - -export type StructuredOutputErrorV2 = { - name: "StructuredOutputError" - data: { - message: string - retries: number - } -} - -export type ContextOverflowErrorV2 = { - name: "ContextOverflowError" - data: { - message: string - responseBody?: string | null - } -} - -export type ApiErrorV2 = { - name: "APIError" - data: { - message: string - statusCode?: number | null - isRetryable: boolean - responseHeaders?: { - [key: string]: string - } | null - responseBody?: string | null - metadata?: { - [key: string]: string - } | null - } -} - -export type AssistantMessageV2 = { - id: string - sessionID: string - role: "assistant" - time: { - created: number - completed?: number | null - } - error?: - | ProviderAuthError - | UnknownError1V2 - | MessageOutputLengthErrorV2 - | MessageAbortedError - | StructuredOutputErrorV2 - | ContextOverflowErrorV2 - | ContentFilterError - | ApiErrorV2 - | null - parentID: string - modelID: string - providerID: string - mode: string - agent: string - path: { - cwd: string - root: string - } - summary?: boolean | null - cost: number - tokens: { - total?: number | null - input: number - output: number - reasoning: number - cache: { - read: number - write: number - } - } - structured?: unknown | null - variant?: string | null - finish?: string | null -} - -export type TextPartV2 = { - id: string - sessionID: string - messageID: string - type: "text" - text: string - synthetic?: boolean | null - ignored?: boolean | null - time?: { - start: number - end?: number | null - } | null - metadata?: { - [key: string]: unknown - } | null -} - -export type SubtaskPartV2 = { - id: string - sessionID: string - messageID: string - type: "subtask" - prompt: string - description: string - agent: string - model?: { - providerID: string - modelID: string - } | null - command?: string | null -} - -export type ReasoningPartV2 = { - id: string - sessionID: string - messageID: string - type: "reasoning" - text: string - metadata?: { - [key: string]: unknown - } | null - time: { - start: number - end?: number | null - } -} - -export type RangeV2 = { - start: { - line: number - character: number - } - end: { - line: number - character: number - } -} - -export type SymbolSourceV2 = { - text: FilePartSourceText - type: "symbol" - path: string - range: RangeV2 - name: string - kind: number -} - -export type FilePartV2 = { - id: string - sessionID: string - messageID: string - type: "file" - mime: string - filename?: string | null - url: string - source?: FilePartSource | null -} - -export type ToolStateRunningV2 = { - status: "running" - input: { - [key: string]: unknown - } - title?: string | null - metadata?: { - [key: string]: unknown - } | null - time: { - start: number - } -} - -export type ToolStateCompletedV2 = { - status: "completed" - input: { - [key: string]: unknown - } - output: string - title: string - metadata: { - [key: string]: unknown - } - time: { - start: number - end: number - compacted?: number | null - } - attachments?: Array | null -} - -export type ToolStateErrorV2 = { - status: "error" - input: { - [key: string]: unknown - } - error: string - metadata?: { - [key: string]: unknown - } | null - time: { - start: number - end: number - } -} - -export type ToolPartV2 = { - id: string - sessionID: string - messageID: string - type: "tool" - callID: string - tool: string - state: ToolState - metadata?: { - [key: string]: unknown - } | null -} - -export type StepStartPartV2 = { - id: string - sessionID: string - messageID: string - type: "step-start" - snapshot?: string | null -} - -export type StepFinishPartV2 = { - id: string - sessionID: string - messageID: string - type: "step-finish" - reason: string - snapshot?: string | null - cost: number - tokens: { - total?: number | null - input: number - output: number - reasoning: number - cache: { - read: number - write: number - } - } -} - -export type SnapshotPartV2 = { - id: string - sessionID: string - messageID: string - type: "snapshot" - snapshot: string -} - -export type PatchPartV2 = { - id: string - sessionID: string - messageID: string - type: "patch" - hash: string - files: Array -} - -export type AgentPartV2 = { - id: string - sessionID: string - messageID: string - type: "agent" - name: string - source?: { - value: string - start: number - end: number - } | null -} - -export type RetryPartV2 = { - id: string - sessionID: string - messageID: string - type: "retry" - attempt: number - error: ApiErrorV2 - time: { - created: number - } -} - -export type CompactionPartV2 = { - id: string - sessionID: string - messageID: string - type: "compaction" - auto: boolean - overflow?: boolean | null - tail_start_id?: string | null -} - -export type PtyV2 = { - id: string - title: string - command: string - args: Array - cwd: string - status: "running" | "exited" - pid: number - exitCode?: number -} - -export type SessionStatusV2 = - | { - type: "idle" - } - | { - type: "retry" - attempt: number - message: string - action?: { - reason: string - provider: string - title: string - message: string - label: string - link?: string - } - next: number - } - | { - type: "busy" - } - -export type SessionStatusV22 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.status" - location?: LocationRefV2 - data: { - sessionID: string - status: SessionStatusV2 - } -} - -export type QuestionInfoV2 = { - /** - * Complete question - */ - question: string - /** - * Very short label (max 30 chars) - */ - header: string - /** - * Available choices - */ - options: Array - /** - * Allow selecting multiple choices - */ - multiple?: boolean | null - /** - * Allow typing a custom answer (default: true) - */ - custom?: boolean | null -} - -export type QuestionToolV2 = { - messageID: string - callID: string -} - -export type V2EventV2 = - | ModelsDevRefreshedV2 - | IntegrationUpdatedV2 - | IntegrationConnectionUpdatedV2 - | CatalogUpdatedV2 - | AgentUpdatedV2 - | SessionCreatedV2 - | SessionUpdatedV2 - | SessionDeleted1 - | MessageUpdatedV2 - | MessageRemovedV2 - | MessagePartUpdatedV2 - | MessagePartRemovedV2 - | SessionAgentSelectedV2 - | SessionModelSelectedV2 - | SessionMovedV2 - | SessionRenamedV2 - | SessionUsageUpdatedV2 - | SessionDeletedV2 - | SessionForkedV2 - | SessionInputPromotedV2 - | SessionInputAdmittedV2 - | SessionExecutionStartedV2 - | SessionExecutionSucceededV2 - | SessionExecutionFailedV2 - | SessionExecutionInterruptedV2 - | SessionInstructionsUpdatedV2 - | SessionSyntheticV2 - | SessionSkillActivatedV2 - | SessionShellStartedV2 - | SessionShellEndedV2 - | SessionStepStartedV2 - | SessionStepEndedV2 - | SessionStepFailedV2 - | SessionTextStartedV2 - | SessionTextDeltaV2 - | SessionTextEndedV2 - | SessionReasoningStartedV2 - | SessionReasoningDeltaV2 - | SessionReasoningEndedV2 - | SessionToolInputStartedV2 - | SessionToolInputDeltaV2 - | SessionToolInputEndedV2 - | SessionToolCalledV2 - | SessionToolProgressV2 - | SessionToolSuccessV2 - | SessionToolFailedV2 - | SessionRetryScheduledV2 - | SessionCompactionAdmittedV2 - | SessionCompactionStartedV2 - | SessionCompactionDeltaV2 - | SessionCompactionEndedV2 - | SessionCompactionFailedV2 - | SessionRevertStagedV2 - | SessionRevertClearedV2 - | SessionRevertCommittedV2 - | FilesystemChangedV2 - | ReferenceUpdatedV2 - | PermissionV2AskedV2 - | PermissionV2RepliedV2 - | PluginAddedV2 - | PluginUpdatedV2 - | ProjectDirectoriesUpdatedV2 - | CommandUpdatedV2 - | ConfigUpdatedV2 - | SkillUpdatedV2 - | PtyCreatedV2 - | PtyUpdatedV2 - | PtyExitedV2 - | PtyDeletedV2 - | ShellCreatedV2 - | ShellExitedV2 - | ShellDeletedV2 - | QuestionV2AskedV2 - | QuestionV2RepliedV2 - | QuestionV2RejectedV2 - | FormCreatedV2 - | FormRepliedV2 - | FormCancelledV2 - | SessionStatusV22 - | SessionIdleV2 - | TuiPromptAppendV2 - | TuiCommandExecuteV2 - | TuiToastShowV2 - | TuiSessionSelectV2 - | InstallationUpdatedV2 - | InstallationUpdateAvailableV2 - | VcsBranchUpdatedV2 - | McpStatusChangedV2 - | McpResourcesChangedV2 - | PermissionAskedV2 - | PermissionRepliedV2 - | QuestionAskedV2 - | QuestionRepliedV2 - | QuestionRejectedV2 - | SessionErrorV2 - | V2EventServerConnected - -export type ProjectCopyErrorV2 = { - name: "ProjectCopyError" - data: { - message: string - forceRequired?: boolean | null - } -} - -export type LocationInfoV2 = { - directory: string - workspaceID?: string - project: { - id: string - directory: string - } -} - -export type AgentColorV2 = string | "primary" | "secondary" | "accent" | "success" | "warning" | "error" | "info" - -export type AgentInfoV2 = { - id: string - name: string - model?: ModelRef - request: ProviderRequest - system?: string - description?: string - mode: "subagent" | "primary" | "all" - hidden: boolean - color?: AgentColorV2 - steps?: number - permissions: PermissionV2Ruleset -} - -export type LocationRefV2 = { - directory: string - workspaceID?: string -} - -export type FileDiffInfoV2 = { - file: string - patch: string - additions: number - deletions: number - status: "added" | "deleted" | "modified" -} - -export type SessionRevertV2 = { - messageID: string - partID?: string - snapshot?: string - files?: Array -} - -export type SessionInfoV2 = { - id: string - parentID?: string - fork?: { - sessionID: string - messageID?: string - } - projectID: string - agent?: string - model?: ModelRef - cost: MoneyUsd - tokens: TokenUsageInfo - time: { - created: number - updated: number - archived?: number - } - title: string - location: LocationRefV2 - subpath?: string - revert?: SessionRevertV2 -} - -export type PromptBase64V2 = string - -export type SessionPendingUserV2 = { - admittedSeq: number - id: string - sessionID: string - timeCreated: number - type: "user" - data: SessionPendingUserData - delivery: "steer" | "queue" -} - -export type SessionPendingSyntheticV2 = { - admittedSeq: number - id: string - sessionID: string - timeCreated: number - type: "synthetic" - data: SessionPendingSyntheticData - delivery: "steer" | "queue" -} - -export type SessionPendingCompactionV2 = { - admittedSeq: number - id: string - sessionID: string - timeCreated: number - type: "compaction" -} - -export type SessionMessageAgentSelectedV2 = { - id: string - metadata?: { - [key: string]: unknown - } - time: { - created: number - } - type: "agent-switched" - agent: string -} - -export type SessionMessageModelSelectedV2 = { - id: string - metadata?: { - [key: string]: unknown - } - time: { - created: number - } - type: "model-switched" - model: ModelRef - previous?: ModelRef -} - -export type SessionMessageUserV2 = { - id: string - metadata?: { - [key: string]: unknown - } - time: { - created: number - } - text: string - files?: Array - agents?: Array - type: "user" -} - -export type SessionMessageSyntheticV2 = { - id: string - metadata?: { - [key: string]: unknown - } - time: { - created: number - } - text: string - description?: string - type: "synthetic" -} - -export type SessionMessageSystemV2 = { - id: string - metadata?: { - [key: string]: unknown - } - time: { - created: number - } - type: "system" - text: string -} - -export type SessionMessageSkillV2 = { - id: string - metadata?: { - [key: string]: unknown - } - time: { - created: number - } - type: "skill" - skill: string - name: string - text: string -} - -export type SessionMessageShellV2 = { - id: string - metadata?: { - [key: string]: unknown - } - time: { - created: number - completed?: number - } - type: "shell" - shellID: string - command: string - status: "running" | "exited" | "timeout" | "killed" - exit?: number | "NaN" | "Infinity" | "-Infinity" | "Infinity" | "-Infinity" | "NaN" - output?: { - output: string - cursor: number - size: number - truncated: boolean - } -} - -export type SessionMessageAssistantRetryV2 = { - attempt: number - at: number - error: SessionStructuredError -} - -export type SessionMessageAssistantV2 = { - id: string - metadata?: { - [key: string]: unknown - } - time: { - created: number - completed?: number - } - type: "assistant" - agent: string - model: ModelRef - content: Array - snapshot?: { - start?: string - end?: string - files?: Array - } - finish?: "stop" | "length" | "tool-calls" | "content-filter" | "error" | "unknown" - cost?: MoneyUsd - tokens?: TokenUsageInfo - error?: SessionStructuredError - retry?: SessionMessageAssistantRetryV2 -} - -export type SessionMessageCompactionRunningV2 = { - type: "compaction" - id: string - metadata?: { - [key: string]: unknown - } - time: { - created: number - } - status: "running" - reason: "auto" | "manual" - summary: string - recent: string -} - -export type SessionMessageCompactionCompletedV2 = { - type: "compaction" - id: string - metadata?: { - [key: string]: unknown - } - time: { - created: number - } - status: "completed" - reason: "auto" | "manual" - summary: string - recent: string -} - -export type SessionMessageCompactionFailedV2 = { - type: "compaction" - id: string - metadata?: { - [key: string]: unknown - } - time: { - created: number - } - status: "failed" - reason: "auto" | "manual" - error: SessionStructuredError -} - -/** - * Instruction entry key (lowercase alphanumerics plus . _ -) - */ -export type InstructionEntryKeyV2 = string - -export type SessionAgentSelectedV2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.agent.selected" - durable: { - aggregateID: string - seq: number - version: 1 - } - location?: LocationRefV2 - data: { - sessionID: string - agent: string - } -} - -export type SessionModelSelectedV2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.model.selected" - durable: { - aggregateID: string - seq: number - version: 1 - } - location?: LocationRefV2 - data: { - sessionID: string - model: ModelRef - } -} - -export type SessionMovedV2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.moved" - durable: { - aggregateID: string - seq: number - version: 1 - } - location?: LocationRefV2 - data: { - sessionID: string - location: LocationRefV2 - projectID?: string - subpath?: string - } -} - -export type SessionRenamedV2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.renamed" - durable: { - aggregateID: string - seq: number - version: 1 - } - location?: LocationRefV2 - data: { - sessionID: string - title: string - } -} - -export type SessionDeletedV2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.deleted" - durable: { - aggregateID: string - seq: number - version: 2 - } - location?: LocationRefV2 - data: { - sessionID: string - } -} - -export type SessionForkedV2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.forked" - durable: { - aggregateID: string - seq: number - version: 2 - } - location?: LocationRefV2 - data: { - sessionID: string - parentID: string - parentSeq: number - from?: string - } -} - -export type SessionInputPromotedV2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.input.promoted" - durable: { - aggregateID: string - seq: number - version: 1 - } - location?: LocationRefV2 - data: { - sessionID: string - inputID: string - } -} - -export type SessionPendingUserData1 = { - text: string - files?: Array - agents?: Array - metadata?: { - [key: string]: unknown - } -} - -export type SessionPendingUserMessageV2 = { - type: "user" - data: SessionPendingUserData1 - delivery: "steer" | "queue" -} - -export type SessionPendingSyntheticData1 = { - text: string - description?: string - metadata?: { - [key: string]: unknown - } -} - -export type SessionPendingSyntheticMessageV2 = { - type: "synthetic" - data: SessionPendingSyntheticData1 - delivery: "steer" | "queue" -} - -export type SessionInputAdmittedV2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.input.admitted" - durable: { - aggregateID: string - seq: number - version: 1 - } - location?: LocationRefV2 - data: { - sessionID: string - inputID: string - input: SessionPendingMessage - } -} - -export type SessionExecutionStartedV2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.execution.started" - durable: { - aggregateID: string - seq: number - version: 1 - } - location?: LocationRefV2 - data: { - sessionID: string - } -} - -export type SessionExecutionSucceededV2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.execution.succeeded" - durable: { - aggregateID: string - seq: number - version: 1 - } - location?: LocationRefV2 - data: { - sessionID: string - } -} - -export type SessionExecutionFailedV2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.execution.failed" - durable: { - aggregateID: string - seq: number - version: 1 - } - location?: LocationRefV2 - data: { - sessionID: string - error: SessionStructuredError - } -} - -export type SessionExecutionInterruptedV2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.execution.interrupted" - durable: { - aggregateID: string - seq: number - version: 1 - } - location?: LocationRefV2 - data: { - sessionID: string - reason: "user" | "shutdown" | "superseded" - } -} - -export type SessionInstructionsUpdatedV2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.instructions.updated" - durable: { - aggregateID: string - seq: number - version: 2 - } - location?: LocationRefV2 - data: { - sessionID: string - delta: { - [key: string]: string | "removed" - } - } -} - -export type SessionSyntheticV2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.synthetic" - durable: { - aggregateID: string - seq: number - version: 1 - } - location?: LocationRefV2 - data: { - sessionID: string - text: string - description?: string - metadata?: { - [key: string]: unknown - } - } -} - -export type SessionSkillActivatedV2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.skill.activated" - durable: { - aggregateID: string - seq: number - version: 1 - } - location?: LocationRefV2 - data: { - sessionID: string - id: string - name: string - text: string - } -} - -export type ShellInfoV2 = { - id: string - status: "running" | "exited" | "timeout" | "killed" - command: string - cwd: string - shell: string - file: string - pid?: number - exit?: number - metadata: { - [key: string]: unknown - } - time: { - started: number - completed?: number - } -} - -export type SessionShellStartedV2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.shell.started" - durable: { - aggregateID: string - seq: number - version: 1 - } - location?: LocationRefV2 - data: { - sessionID: string - shell: ShellInfoV2 - } -} - -export type SessionShellEndedV2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.shell.ended" - durable: { - aggregateID: string - seq: number - version: 1 - } - location?: LocationRefV2 - data: { - sessionID: string - shell: ShellInfoV2 - output: { - output: string - cursor: number - size: number - truncated: boolean - } - } -} - -export type SessionStepStartedV2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.step.started" - durable: { - aggregateID: string - seq: number - version: 1 - } - location?: LocationRefV2 - data: { - sessionID: string - assistantMessageID: string - agent: string - model: ModelRef - snapshot?: string - } -} - -export type SessionStepEndedV2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.step.ended" - durable: { - aggregateID: string - seq: number - version: 1 - } - location?: LocationRefV2 - data: { - sessionID: string - assistantMessageID: string - finish: "stop" | "length" | "tool-calls" | "content-filter" | "error" | "unknown" - cost: MoneyUsd - tokens: TokenUsageInfo - snapshot?: string - files?: Array - } -} - -export type SessionStepFailedV2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.step.failed" - durable: { - aggregateID: string - seq: number - version: 1 - } - location?: LocationRefV2 - data: { - sessionID: string - assistantMessageID: string - error: SessionStructuredError - cost?: MoneyUsd - tokens?: TokenUsageInfo - } -} - -export type SessionTextStartedV2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.text.started" - durable: { - aggregateID: string - seq: number - version: 1 - } - location?: LocationRefV2 - data: { - sessionID: string - assistantMessageID: string - ordinal: number - } -} - -export type SessionTextEndedV2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.text.ended" - durable: { - aggregateID: string - seq: number - version: 1 - } - location?: LocationRefV2 - data: { - sessionID: string - assistantMessageID: string - ordinal: number - text: string - } -} - -export type SessionMessageProviderState3 = { - [key: string]: unknown -} - -export type SessionReasoningStartedV2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.reasoning.started" - durable: { - aggregateID: string - seq: number - version: 1 - } - location?: LocationRefV2 - data: { - sessionID: string - assistantMessageID: string - ordinal: number - state?: SessionMessageProviderState3 - } -} - -export type SessionMessageProviderState4 = { - [key: string]: unknown -} - -export type SessionReasoningEndedV2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.reasoning.ended" - durable: { - aggregateID: string - seq: number - version: 1 - } - location?: LocationRefV2 - data: { - sessionID: string - assistantMessageID: string - ordinal: number - text: string - state?: SessionMessageProviderState4 - } -} - -export type SessionToolInputStartedV2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.tool.input.started" - durable: { - aggregateID: string - seq: number - version: 1 - } - location?: LocationRefV2 - data: { - sessionID: string - assistantMessageID: string - callID: string - name: string - } -} - -export type SessionToolInputEndedV2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.tool.input.ended" - durable: { - aggregateID: string - seq: number - version: 1 - } - location?: LocationRefV2 - data: { - sessionID: string - assistantMessageID: string - callID: string - text: string - } -} - -export type SessionMessageProviderState5 = { - [key: string]: unknown -} - -export type SessionToolCalledV2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.tool.called" - durable: { - aggregateID: string - seq: number - version: 1 - } - location?: LocationRefV2 - data: { - sessionID: string - assistantMessageID: string - callID: string - input: { - [key: string]: unknown - } - executed: boolean - state?: SessionMessageProviderState5 - } -} - -export type SessionToolProgressV2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.tool.progress" - durable: { - aggregateID: string - seq: number - version: 1 - } - location?: LocationRefV2 - data: { - sessionID: string - assistantMessageID: string - callID: string - structured: { - [key: string]: unknown - } - content: Array - } -} - -export type SessionMessageProviderState6 = { - [key: string]: unknown -} - -export type SessionToolSuccessV2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.tool.success" - durable: { - aggregateID: string - seq: number - version: 1 - } - location?: LocationRefV2 - data: { - sessionID: string - assistantMessageID: string - callID: string - structured: { - [key: string]: unknown - } - content: Array - result?: unknown - executed: boolean - resultState?: SessionMessageProviderState6 - } -} - -export type SessionMessageProviderState7 = { - [key: string]: unknown -} - -export type SessionToolFailedV2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.tool.failed" - durable: { - aggregateID: string - seq: number - version: 1 - } - location?: LocationRefV2 - data: { - sessionID: string - assistantMessageID: string - callID: string - error: SessionStructuredError - result?: unknown - executed: boolean - resultState?: SessionMessageProviderState7 - } -} - -export type SessionRetryScheduledV2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.retry.scheduled" - durable: { - aggregateID: string - seq: number - version: 1 - } - location?: LocationRefV2 - data: { - sessionID: string - assistantMessageID: string - attempt: number - at: number - error: SessionStructuredError - } -} - -export type SessionCompactionAdmittedV2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.compaction.admitted" - durable: { - aggregateID: string - seq: number - version: 1 - } - location?: LocationRefV2 - data: { - sessionID: string - inputID: string - } -} - -export type SessionCompactionStartedV2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.compaction.started" - durable: { - aggregateID: string - seq: number - version: 1 - } - location?: LocationRefV2 - data: { - sessionID: string - reason: "auto" | "manual" - recent: string - inputID?: string - } -} - -export type SessionCompactionEndedV2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.compaction.ended" - durable: { - aggregateID: string - seq: number - version: 1 - } - location?: LocationRefV2 - data: { - sessionID: string - reason: "auto" | "manual" - text: string - recent: string - } -} - -export type SessionCompactionFailedV2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.compaction.failed" - durable: { - aggregateID: string - seq: number - version: 1 - } - location?: LocationRefV2 - data: { - sessionID: string - reason: "auto" | "manual" - error: SessionStructuredError - inputID?: string - } -} - -export type SessionRevertStagedV2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.revert.staged" - durable: { - aggregateID: string - seq: number - version: 1 - } - location?: LocationRefV2 - data: { - sessionID: string - revert: SessionRevertV2 - } -} - -export type SessionRevertClearedV2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.revert.cleared" - durable: { - aggregateID: string - seq: number - version: 1 - } - location?: LocationRefV2 - data: { - sessionID: string - } -} - -export type SessionRevertCommittedV2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.revert.committed" - durable: { - aggregateID: string - seq: number - version: 1 - } - location?: LocationRefV2 - data: { - sessionID: string - to: string - } -} - -export type SessionUsageRecordedV2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.usage.recorded" - durable: { - aggregateID: string - seq: number - version: 1 - } - location?: LocationRefV2 - data: { - sessionID: string - source: "title" | "compaction" - cost: MoneyUsd - tokens: TokenUsageInfo - } -} - -/** - * Marker emitted once when a log read reaches its captured watermark. The reader holds every event committed at or below seq. - */ -export type EventLogSyncedV2 = { - type: "log.synced" - aggregateID: string - seq?: number -} - -export type McpResourceV2 = { - server: string - name: string - uri: string - description?: string - mimeType?: string -} - -export type McpResourceCatalogV2 = { - resources: Array - templates: Array -} - -export type ProjectTimeV2 = { - created: number - updated: number - initialized?: number -} - -export type FormWhenV2 = { - key: string - op: "eq" | "neq" - value: string | number | "NaN" | "Infinity" | "-Infinity" | "Infinity" | "-Infinity" | "NaN" | boolean -} - -export type FormStringFieldV2 = { - key: string - title?: string - description?: string - required?: boolean - when?: Array - type: "string" - format?: "email" | "uri" | "date" | "date-time" - minLength?: number - maxLength?: number - pattern?: string - placeholder?: string - default?: string - options?: Array - custom?: boolean -} - -export type FormMultiselectFieldV2 = { - key: string - title?: string - description?: string - required?: boolean - when?: Array - type: "multiselect" - options: Array - minItems?: number - maxItems?: number - custom?: boolean - default?: Array -} - -export type FormFieldsV2 = [FormField, FormField] - -export type FormInfoV2 = { - id: string - sessionID: string - title: string - metadata?: FormMetadata - fields: FormFieldsV2 -} - -export type FormCreatePayloadV2 = { - id?: string | null - title: string - metadata?: FormMetadata - fields: FormFieldsV2 -} - -export type FormValueV2 = - | string - | number - | "NaN" - | "Infinity" - | "-Infinity" - | "Infinity" - | "-Infinity" - | "NaN" - | boolean - | Array - -export type PermissionV2SourceV2 = { - type: "tool" - messageID: string - callID: string -} - -export type PermissionV2RequestV2 = { - id: string - sessionID: string - action: string - resources: Array - save?: Array - metadata?: { - [key: string]: unknown - } - source?: PermissionV2SourceV2 -} - -export type ModelsDevRefreshedV2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "models-dev.refreshed" - location?: LocationRefV2 - data: - | { - [key: string]: unknown - } - | Array -} - -export type IntegrationUpdatedV2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "integration.updated" - location?: LocationRefV2 - data: - | { - [key: string]: unknown - } - | Array -} - -export type IntegrationConnectionUpdatedV2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "integration.connection.updated" - location?: LocationRefV2 - data: { - integrationID: string - } -} - -export type CatalogUpdatedV2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "catalog.updated" - location?: LocationRefV2 - data: - | { - [key: string]: unknown - } - | Array -} - -export type AgentUpdatedV2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "agent.updated" - location?: LocationRefV2 - data: - | { - [key: string]: unknown - } - | Array -} - -export type SessionV1InfoV2 = { - id: string - slug: string - projectID: string - workspaceID?: string - directory: string - path?: string - parentID?: string - summary?: { - additions: number - deletions: number - files: number - diffs?: Array - } - cost?: number - tokens?: { - input: number - output: number - reasoning: number - cache: { - read: number - write: number - } - } - share?: { - url: string - } - title: string - agent?: string - model?: { - id: string - providerID: string - variant?: string - } - version: string - metadata?: { - [key: string]: unknown - } - time: { - created: number - updated: number - compacting?: number - archived?: number - } - permission?: PermissionRuleset - revert?: { - messageID: string - partID?: string - snapshot?: string - diff?: string - } -} - -export type SessionCreatedV2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.created" - durable: { - aggregateID: string - seq: number - version: 1 - } - location?: LocationRefV2 - data: { - sessionID: string - info: SessionV1InfoV2 - } -} - -export type SessionUpdatedV2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.updated" - durable: { - aggregateID: string - seq: number - version: 1 - } - location?: LocationRefV2 - data: { - sessionID: string - info: SessionV1InfoV2 - } -} - -export type SessionDeleted1 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.deleted" - durable: { - aggregateID: string - seq: number - version: 1 - } - location?: LocationRefV2 - data: { - sessionID: string - info: SessionV1InfoV2 - } -} - -export type MessageUpdatedV2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "message.updated" - durable: { - aggregateID: string - seq: number - version: 1 - } - location?: LocationRefV2 - data: { - sessionID: string - info: Message - } -} - -export type MessageRemovedV2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "message.removed" - durable: { - aggregateID: string - seq: number - version: 1 - } - location?: LocationRefV2 - data: { - sessionID: string - messageID: string - } -} - -export type MessagePartUpdatedV2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "message.part.updated" - durable: { - aggregateID: string - seq: number - version: 1 - } - location?: LocationRefV2 - data: { - sessionID: string - part: Part - time: number - } -} - -export type MessagePartRemovedV2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "message.part.removed" - durable: { - aggregateID: string - seq: number - version: 1 - } - location?: LocationRefV2 - data: { - sessionID: string - messageID: string - partID: string - } -} - -export type SessionUsageUpdatedV2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.usage.updated" - location?: LocationRefV2 - data: { - sessionID: string - cost: MoneyUsd - tokens: TokenUsageInfo - } -} - -export type SessionTextDeltaV2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.text.delta" - location?: LocationRefV2 - data: { - sessionID: string - assistantMessageID: string - ordinal: number - delta: string - } -} - -export type SessionReasoningDeltaV2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.reasoning.delta" - location?: LocationRefV2 - data: { - sessionID: string - assistantMessageID: string - ordinal: number - delta: string - } -} - -export type SessionToolInputDeltaV2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.tool.input.delta" - location?: LocationRefV2 - data: { - sessionID: string - assistantMessageID: string - callID: string - delta: string - } -} - -export type SessionCompactionDeltaV2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.compaction.delta" - location?: LocationRefV2 - data: { - sessionID: string - text: string - } -} - -export type FilesystemChangedV2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "filesystem.changed" - location?: LocationRefV2 - data: { - file: string - event: "add" | "change" | "unlink" - } -} - -export type ReferenceUpdatedV2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "reference.updated" - location?: LocationRefV2 - data: - | { - [key: string]: unknown - } - | Array -} - -export type PermissionV2AskedV2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "permission.v2.asked" - location?: LocationRefV2 - data: { - id: string - sessionID: string - action: string - resources: Array - save?: Array - metadata?: { - [key: string]: unknown - } - source?: PermissionV2SourceV2 - } -} - -export type PermissionV2RepliedV2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "permission.v2.replied" - location?: LocationRefV2 - data: { - sessionID: string - requestID: string - reply: PermissionV2Reply - } -} - -export type PluginAddedV2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "plugin.added" - location?: LocationRefV2 - data: { - id: string - } -} - -export type PluginUpdatedV2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "plugin.updated" - location?: LocationRefV2 - data: - | { - [key: string]: unknown - } - | Array -} - -export type ProjectDirectoriesUpdatedV2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "project.directories.updated" - location?: LocationRefV2 - data: { - projectID: string - } -} - -export type CommandUpdatedV2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "command.updated" - location?: LocationRefV2 - data: - | { - [key: string]: unknown - } - | Array -} - -export type ConfigUpdatedV2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "config.updated" - location?: LocationRefV2 - data: - | { - [key: string]: unknown - } - | Array -} - -export type SkillUpdatedV2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "skill.updated" - location?: LocationRefV2 - data: - | { - [key: string]: unknown - } - | Array -} - -export type PtyCreatedV2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "pty.created" - location?: LocationRefV2 - data: { - info: PtyV2 - } -} - -export type PtyUpdatedV2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "pty.updated" - location?: LocationRefV2 - data: { - info: PtyV2 - } -} - -export type PtyExitedV2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "pty.exited" - location?: LocationRefV2 - data: { - id: string - exitCode: number - } -} - -export type PtyDeletedV2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "pty.deleted" - location?: LocationRefV2 - data: { - id: string - } -} - -export type ShellCreatedV2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "shell.created" - location?: LocationRefV2 - data: { - info: ShellInfoV2 - } -} - -export type ShellExitedV2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "shell.exited" - location?: LocationRefV2 - data: { - id: string - exit?: number - status: "running" | "exited" | "timeout" | "killed" - } -} - -export type ShellDeletedV2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "shell.deleted" - location?: LocationRefV2 - data: { - id: string - } -} - -export type QuestionV2AskedV2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "question.v2.asked" - location?: LocationRefV2 - data: { - id: string - sessionID: string - /** - * Questions to ask - */ - questions: Array - tool?: QuestionV2Tool - } -} - -export type QuestionV2RepliedV2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "question.v2.replied" - location?: LocationRefV2 - data: { - sessionID: string - requestID: string - answers: Array - } -} - -export type QuestionV2RejectedV2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "question.v2.rejected" - location?: LocationRefV2 - data: { - sessionID: string - requestID: string - } -} - -export type FormMetadata1 = { - [key: string]: unknown -} - -export type FormStringField1 = { - key: string - title?: string - description?: string - required?: boolean - when?: Array - type: "string" - format?: "email" | "uri" | "date" | "date-time" - minLength?: number - maxLength?: number - pattern?: string - placeholder?: string - default?: string - options?: Array - custom?: boolean -} - -export type FormBooleanField1 = { - key: string - title?: string - description?: string - required?: boolean - when?: Array - type: "boolean" - default?: boolean -} - -export type FormMultiselectField1 = { - key: string - title?: string - description?: string - required?: boolean - when?: Array - type: "multiselect" - options: Array - minItems?: number - maxItems?: number - custom?: boolean - default?: Array -} - -export type FormField1 = - | FormStringField1 - | FormNumberField1 - | FormIntegerField1 - | FormBooleanField1 - | FormMultiselectField1 - | FormExternalField - -export type FormFields1 = [FormField1, FormField1] - -export type FormInfo1 = { - id: string - sessionID: string - title: string - metadata?: FormMetadata1 - fields: FormFields1 -} - -export type FormCreatedV2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "form.created" - location?: LocationRefV2 - data: { - form: FormInfo1 - } -} - -export type FormAnswer1 = { - [key: string]: FormValue1 -} - -export type FormRepliedV2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "form.replied" - location?: LocationRefV2 - data: { - id: string - sessionID: string - answer: FormAnswer1 - } -} - -export type FormCancelledV2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "form.cancelled" - location?: LocationRefV2 - data: { - id: string - sessionID: string - } -} - -export type SessionIdleV2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.idle" - location?: LocationRefV2 - data: { - sessionID: string - } -} - -export type TuiPromptAppendV2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "tui.prompt.append" - location?: LocationRefV2 - data: { - text: string - } -} - -export type TuiCommandExecuteV2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "tui.command.execute" - location?: LocationRefV2 - data: { - command: - | "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" - | string - } -} - -export type TuiToastShowV2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "tui.toast.show" - location?: LocationRefV2 - data: { - title?: string - message: string - variant: "info" | "success" | "warning" | "error" - duration?: number | null - } -} - -export type TuiSessionSelectV2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "tui.session.select" - location?: LocationRefV2 - data: { - /** - * Session ID to navigate to - */ - sessionID: string - } -} - -export type InstallationUpdatedV2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "installation.updated" - location?: LocationRefV2 - data: { - version: string - } -} - -export type InstallationUpdateAvailableV2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "installation.update-available" - location?: LocationRefV2 - data: { - version: string - } -} - -export type VcsBranchUpdatedV2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "vcs.branch.updated" - location?: LocationRefV2 - data: { - branch?: string - } -} - -export type McpStatusChangedV2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "mcp.status.changed" - location?: LocationRefV2 - data: { - server: string - } -} - -export type McpResourcesChangedV2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "mcp.resources.changed" - location?: LocationRefV2 - data: { - server: string - } -} - -export type PermissionAskedV2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "permission.asked" - location?: LocationRefV2 - data: { - id: string - sessionID: string - permission: string - patterns: Array - metadata: { - [key: string]: unknown - } - always: Array - tool?: { - messageID: string - callID: string - } | null - } -} - -export type PermissionRepliedV2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "permission.replied" - location?: LocationRefV2 - data: { - sessionID: string - requestID: string - reply: "once" | "always" | "reject" - } -} - -export type QuestionAskedV2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "question.asked" - location?: LocationRefV2 - data: { - id: string - sessionID: string - /** - * Questions to ask - */ - questions: Array - tool?: QuestionToolV2 | null - } -} - -export type QuestionRepliedV2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "question.replied" - location?: LocationRefV2 - data: { - sessionID: string - requestID: string - answers: Array - } -} - -export type QuestionRejectedV2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "question.rejected" - location?: LocationRefV2 - data: { - sessionID: string - requestID: string - } -} - -export type SessionErrorV2 = { - id: string - created: number - metadata?: { - [key: string]: unknown - } - type: "session.error" - location?: LocationRefV2 - data: { - sessionID?: string | null - error?: - | ProviderAuthError - | UnknownError1V2 - | MessageOutputLengthErrorV2 - | MessageAbortedError - | StructuredOutputErrorV2 - | ContextOverflowErrorV2 - | ContentFilterError - | ApiErrorV2 - | null - } -} - -export type V2EventServerConnected = { - id: string - metadata?: { - [key: string]: unknown - } | null - location?: LocationRefV2 | null - type: "server.connected" - data: - | { - [key: string]: unknown - } - | Array -} - -export type PtyTicketConnectTokenV2 = { - ticket: string - expires_in: number -} - -export type ShellInfo1 = { - id: string - status: "running" | "exited" | "timeout" | "killed" - command: string - cwd: string - shell: string - file: string - pid?: number - exit?: number - metadata: { - [key: string]: unknown - } - time: { - started: number - completed?: number - } -} - -export type QuestionV2RequestV2 = { - id: string - sessionID: string - /** - * Questions to ask - */ - questions: Array - tool?: QuestionV2Tool -} - -export type VcsFileStatusV2 = { - file: string - additions: number - deletions: number - status: "added" | "deleted" | "modified" -} - -export type AuthRemoveData = { - body?: never - path: { - providerID: string - } - query?: never - url: "/auth/{providerID}" -} - -export type AuthRemoveErrors = { - /** - * BadRequest | InvalidRequestError - */ - 400: EffectHttpApiErrorBadRequest | InvalidRequestError -} - -export type AuthRemoveError = AuthRemoveErrors[keyof AuthRemoveErrors] - -export type AuthRemoveResponses = { - /** - * Successfully removed authentication credentials - */ - 200: boolean -} - -export type AuthRemoveResponse = AuthRemoveResponses[keyof AuthRemoveResponses] - -export type AuthSetData = { - body?: Auth - path: { - providerID: string - } - query?: never - url: "/auth/{providerID}" -} - -export type AuthSetErrors = { - /** - * BadRequest | InvalidRequestError - */ - 400: EffectHttpApiErrorBadRequest | InvalidRequestError -} - -export type AuthSetError = AuthSetErrors[keyof AuthSetErrors] - -export type AuthSetResponses = { - /** - * Successfully set authentication credentials - */ - 200: boolean -} - -export type AuthSetResponse = AuthSetResponses[keyof AuthSetResponses] - -export type AppLogData = { - body?: { - /** - * Service name for the log entry - */ - service: string - /** - * Log level - */ - level: "debug" | "info" | "error" | "warn" - /** - * Log message - */ - message: string - extra?: { - [key: string]: unknown - } - } - path?: never - query?: { - directory?: string - workspace?: string - } - url: "/log" -} - -export type AppLogErrors = { - /** - * BadRequest | InvalidRequestError - */ - 400: EffectHttpApiErrorBadRequest | InvalidRequestError -} - -export type AppLogError = AppLogErrors[keyof AppLogErrors] - -export type AppLogResponses = { - /** - * Log entry written successfully - */ - 200: boolean -} - -export type AppLogResponse = AppLogResponses[keyof AppLogResponses] - -export type ExperimentalControlPlaneMoveSessionData = { - body?: { - sessionID: string - destination: MoveSessionDestination - moveChanges?: boolean - } - path?: never - query?: never - url: "/experimental/control-plane/move-session" -} - -export type ExperimentalControlPlaneMoveSessionErrors = { - /** - * MoveSessionError | InvalidRequestError - */ - 400: MoveSessionError | InvalidRequestError -} - -export type ExperimentalControlPlaneMoveSessionError = - ExperimentalControlPlaneMoveSessionErrors[keyof ExperimentalControlPlaneMoveSessionErrors] - -export type ExperimentalControlPlaneMoveSessionResponses = { - /** - * Session moved - */ - 204: void -} - -export type ExperimentalControlPlaneMoveSessionResponse = - ExperimentalControlPlaneMoveSessionResponses[keyof ExperimentalControlPlaneMoveSessionResponses] - -export type GlobalHealthData = { - body?: never - path?: never - query?: never - url: "/global/health" -} - -export type GlobalHealthErrors = { - /** - * Bad request - */ - 400: BadRequestError -} - -export type GlobalHealthError = GlobalHealthErrors[keyof GlobalHealthErrors] - -export type GlobalHealthResponses = { - /** - * Health information - */ - 200: { - healthy: true - version: string - } -} - -export type GlobalHealthResponse = GlobalHealthResponses[keyof GlobalHealthResponses] - -export type GlobalEventData = { - body?: never - path?: never - query?: never - url: "/global/event" -} - -export type GlobalEventErrors = { - /** - * Bad request - */ - 400: BadRequestError -} - -export type GlobalEventError = GlobalEventErrors[keyof GlobalEventErrors] - -export type GlobalEventResponses = { - /** - * Event stream - */ - 200: GlobalEvent -} - -export type GlobalEventResponse = GlobalEventResponses[keyof GlobalEventResponses] - -export type GlobalConfigGetData = { - body?: never - path?: never - query?: never - url: "/global/config" -} - -export type GlobalConfigGetErrors = { - /** - * Bad request - */ - 400: BadRequestError -} - -export type GlobalConfigGetError = GlobalConfigGetErrors[keyof GlobalConfigGetErrors] - -export type GlobalConfigGetResponses = { - /** - * Get global config info - */ - 200: Config -} - -export type GlobalConfigGetResponse = GlobalConfigGetResponses[keyof GlobalConfigGetResponses] - -export type GlobalConfigUpdateData = { - body?: Config - path?: never - query?: never - url: "/global/config" -} - -export type GlobalConfigUpdateErrors = { - /** - * BadRequest | InvalidRequestError - */ - 400: EffectHttpApiErrorBadRequest | InvalidRequestError -} - -export type GlobalConfigUpdateError = GlobalConfigUpdateErrors[keyof GlobalConfigUpdateErrors] - -export type GlobalConfigUpdateResponses = { - /** - * Successfully updated global config - */ - 200: Config -} - -export type GlobalConfigUpdateResponse = GlobalConfigUpdateResponses[keyof GlobalConfigUpdateResponses] - -export type GlobalDisposeData = { - body?: never - path?: never - query?: never - url: "/global/dispose" -} - -export type GlobalDisposeErrors = { - /** - * Bad request - */ - 400: BadRequestError -} - -export type GlobalDisposeError = GlobalDisposeErrors[keyof GlobalDisposeErrors] - -export type GlobalDisposeResponses = { - /** - * Global disposed - */ - 200: boolean -} - -export type GlobalDisposeResponse = GlobalDisposeResponses[keyof GlobalDisposeResponses] - -export type GlobalUpgradeData = { - body?: { - target?: string - } - path?: never - query?: never - url: "/global/upgrade" -} - -export type GlobalUpgradeErrors = { - /** - * BadRequest | InvalidRequestError - */ - 400: EffectHttpApiErrorBadRequest | InvalidRequestError -} - -export type GlobalUpgradeError = GlobalUpgradeErrors[keyof GlobalUpgradeErrors] - -export type GlobalUpgradeResponses = { - /** - * Upgrade result - */ - 200: - | { - success: true - version: string - } - | { - success: false - error: string - } -} - -export type GlobalUpgradeResponse = GlobalUpgradeResponses[keyof GlobalUpgradeResponses] - -export type EventSubscribeData = { - body?: never - path?: never - query?: { - directory?: string - workspace?: string - } - url: "/event" -} - -export type EventSubscribeResponses = { - /** - * Event stream - */ - 200: Event -} - -export type EventSubscribeResponse = EventSubscribeResponses[keyof EventSubscribeResponses] - -export type ConfigGetData = { - body?: never - path?: never - query?: { - directory?: string - workspace?: string - } - url: "/config" -} - -export type ConfigGetErrors = { - /** - * Bad request - */ - 400: BadRequestError -} - -export type ConfigGetError = ConfigGetErrors[keyof ConfigGetErrors] - -export type ConfigGetResponses = { - /** - * Get config info - */ - 200: Config -} - -export type ConfigGetResponse = ConfigGetResponses[keyof ConfigGetResponses] - -export type ConfigUpdateData = { - body?: Config - path?: never - query?: { - directory?: string - workspace?: string - } - url: "/config" -} - -export type ConfigUpdateErrors = { - /** - * BadRequest | InvalidRequestError - */ - 400: EffectHttpApiErrorBadRequest | InvalidRequestError -} - -export type ConfigUpdateError = ConfigUpdateErrors[keyof ConfigUpdateErrors] - -export type ConfigUpdateResponses = { - /** - * Successfully updated config - */ - 200: Config -} - -export type ConfigUpdateResponse = ConfigUpdateResponses[keyof ConfigUpdateResponses] - -export type ConfigProvidersData = { - body?: never - path?: never - query?: { - directory?: string - workspace?: string - } - url: "/config/providers" -} - -export type ConfigProvidersErrors = { - /** - * Bad request - */ - 400: BadRequestError -} - -export type ConfigProvidersError = ConfigProvidersErrors[keyof ConfigProvidersErrors] - -export type ConfigProvidersResponses = { - /** - * List of providers - */ - 200: { - providers: Array - default: { - [key: string]: string - } - } -} - -export type ConfigProvidersResponse = ConfigProvidersResponses[keyof ConfigProvidersResponses] - -export type ExperimentalCapabilitiesGetData = { - body?: never - path?: never - query?: { - directory?: string - workspace?: string - } - url: "/experimental/capabilities" -} - -export type ExperimentalCapabilitiesGetErrors = { - /** - * Bad request - */ - 400: BadRequestError -} - -export type ExperimentalCapabilitiesGetError = - ExperimentalCapabilitiesGetErrors[keyof ExperimentalCapabilitiesGetErrors] - -export type ExperimentalCapabilitiesGetResponses = { - /** - * Experimental capabilities - */ - 200: ExperimentalCapabilities -} - -export type ExperimentalCapabilitiesGetResponse = - ExperimentalCapabilitiesGetResponses[keyof ExperimentalCapabilitiesGetResponses] - -export type ExperimentalConsoleGetData = { - body?: never - path?: never - query?: { - directory?: string - workspace?: string - } - url: "/experimental/console" -} - -export type ExperimentalConsoleGetErrors = { - /** - * Bad request - */ - 400: BadRequestError - /** - * InternalServerError - */ - 500: EffectHttpApiErrorInternalServerError -} - -export type ExperimentalConsoleGetError = ExperimentalConsoleGetErrors[keyof ExperimentalConsoleGetErrors] - -export type ExperimentalConsoleGetResponses = { - /** - * Active Console provider metadata - */ - 200: ConsoleState -} - -export type ExperimentalConsoleGetResponse = ExperimentalConsoleGetResponses[keyof ExperimentalConsoleGetResponses] - -export type ExperimentalConsoleListOrgsData = { - body?: never - path?: never - query?: { - directory?: string - workspace?: string - } - url: "/experimental/console/orgs" -} - -export type ExperimentalConsoleListOrgsErrors = { - /** - * Bad request - */ - 400: BadRequestError - /** - * InternalServerError - */ - 500: EffectHttpApiErrorInternalServerError -} - -export type ExperimentalConsoleListOrgsError = - ExperimentalConsoleListOrgsErrors[keyof ExperimentalConsoleListOrgsErrors] - -export type ExperimentalConsoleListOrgsResponses = { - /** - * Switchable Console orgs - */ - 200: { - orgs: Array<{ - accountID: string - accountEmail: string - accountUrl: string - orgID: string - orgName: string - active: boolean - }> - } -} - -export type ExperimentalConsoleListOrgsResponse = - ExperimentalConsoleListOrgsResponses[keyof ExperimentalConsoleListOrgsResponses] - -export type ExperimentalConsoleSwitchOrgData = { - body?: { - accountID: string - orgID: string - } - path?: never - query?: { - directory?: string - workspace?: string - } - url: "/experimental/console/switch" -} - -export type ExperimentalConsoleSwitchOrgResponses = { - /** - * Switch success - */ - 200: boolean -} - -export type ExperimentalConsoleSwitchOrgResponse = - ExperimentalConsoleSwitchOrgResponses[keyof ExperimentalConsoleSwitchOrgResponses] - -export type ToolListData = { - body?: never - path?: never - query: { - directory?: string - workspace?: string - provider: string - model: string - } - url: "/experimental/tool" -} - -export type ToolListErrors = { - /** - * BadRequest | InvalidRequestError - */ - 400: EffectHttpApiErrorBadRequest | InvalidRequestError -} - -export type ToolListError = ToolListErrors[keyof ToolListErrors] - -export type ToolListResponses = { - /** - * Tools - */ - 200: ToolList -} - -export type ToolListResponse = ToolListResponses[keyof ToolListResponses] - -export type ToolIdsData = { - body?: never - path?: never - query?: { - directory?: string - workspace?: string - } - url: "/experimental/tool/ids" -} - -export type ToolIdsErrors = { - /** - * BadRequest | InvalidRequestError - */ - 400: EffectHttpApiErrorBadRequest | InvalidRequestError -} - -export type ToolIdsError = ToolIdsErrors[keyof ToolIdsErrors] - -export type ToolIdsResponses = { - /** - * Tool IDs - */ - 200: ToolIds -} - -export type ToolIdsResponse = ToolIdsResponses[keyof ToolIdsResponses] - -export type WorktreeRemoveData = { - body?: WorktreeRemoveInput - path?: never - query?: { - directory?: string - workspace?: string - } - url: "/experimental/worktree" -} - -export type WorktreeRemoveErrors = { - /** - * WorktreeError | InvalidRequestError - */ - 400: WorktreeError | InvalidRequestError -} - -export type WorktreeRemoveError = WorktreeRemoveErrors[keyof WorktreeRemoveErrors] - -export type WorktreeRemoveResponses = { - /** - * Worktree removed - */ - 200: boolean -} - -export type WorktreeRemoveResponse = WorktreeRemoveResponses[keyof WorktreeRemoveResponses] - -export type WorktreeListData = { - body?: never - path?: never - query?: { - directory?: string - workspace?: string - } - url: "/experimental/worktree" -} - -export type WorktreeListErrors = { - /** - * WorktreeError | InvalidRequestError - */ - 400: WorktreeError | InvalidRequestError -} - -export type WorktreeListError = WorktreeListErrors[keyof WorktreeListErrors] - -export type WorktreeListResponses = { - /** - * List of worktree directories - */ - 200: Array -} - -export type WorktreeListResponse = WorktreeListResponses[keyof WorktreeListResponses] - -export type WorktreeCreateData = { - body?: WorktreeCreateInput - path?: never - query?: { - directory?: string - workspace?: string - } - url: "/experimental/worktree" -} - -export type WorktreeCreateErrors = { - /** - * WorktreeError | InvalidRequestError - */ - 400: WorktreeError | InvalidRequestError -} - -export type WorktreeCreateError = WorktreeCreateErrors[keyof WorktreeCreateErrors] - -export type WorktreeCreateResponses = { - /** - * Worktree created - */ - 200: Worktree -} - -export type WorktreeCreateResponse = WorktreeCreateResponses[keyof WorktreeCreateResponses] - -export type WorktreeResetData = { - body?: WorktreeResetInput - path?: never - query?: { - directory?: string - workspace?: string - } - url: "/experimental/worktree/reset" -} - -export type WorktreeResetErrors = { - /** - * WorktreeError | InvalidRequestError - */ - 400: WorktreeError | InvalidRequestError -} - -export type WorktreeResetError = WorktreeResetErrors[keyof WorktreeResetErrors] - -export type WorktreeResetResponses = { - /** - * Worktree reset - */ - 200: boolean -} - -export type WorktreeResetResponse = WorktreeResetResponses[keyof WorktreeResetResponses] - -export type ExperimentalSessionListData = { - body?: never - path?: never - query?: { - directory?: string - workspace?: string - roots?: boolean | "true" | "false" - start?: number - cursor?: number - search?: string - limit?: number - archived?: boolean | "true" | "false" - } - url: "/experimental/session" -} - -export type ExperimentalSessionListErrors = { - /** - * Bad request - */ - 400: BadRequestError -} - -export type ExperimentalSessionListError = ExperimentalSessionListErrors[keyof ExperimentalSessionListErrors] - -export type ExperimentalSessionListResponses = { - /** - * List of sessions - */ - 200: Array -} - -export type ExperimentalSessionListResponse = ExperimentalSessionListResponses[keyof ExperimentalSessionListResponses] - -export type ExperimentalSessionBackgroundData = { - body?: never - path: { - sessionID: string - } - query?: { - directory?: string - workspace?: string - } - url: "/experimental/session/{sessionID}/background" -} - -export type ExperimentalSessionBackgroundErrors = { - /** - * BadRequest | InvalidRequestError - */ - 400: EffectHttpApiErrorBadRequest | InvalidRequestError -} - -export type ExperimentalSessionBackgroundError = - ExperimentalSessionBackgroundErrors[keyof ExperimentalSessionBackgroundErrors] - -export type ExperimentalSessionBackgroundResponses = { - /** - * Backgrounded subagents - */ - 200: boolean -} - -export type ExperimentalSessionBackgroundResponse = - ExperimentalSessionBackgroundResponses[keyof ExperimentalSessionBackgroundResponses] - -export type ExperimentalResourceListData = { - body?: never - path?: never - query?: { - directory?: string - workspace?: string - } - url: "/experimental/resource" -} - -export type ExperimentalResourceListErrors = { - /** - * Bad request - */ - 400: BadRequestError -} - -export type ExperimentalResourceListError = ExperimentalResourceListErrors[keyof ExperimentalResourceListErrors] - -export type ExperimentalResourceListResponses = { - /** - * MCP resources - */ - 200: { - [key: string]: McpResource - } -} - -export type ExperimentalResourceListResponse = - ExperimentalResourceListResponses[keyof ExperimentalResourceListResponses] - -export type FindTextData = { - body?: never - path?: never - query: { - directory?: string - workspace?: string - pattern: string - } - url: "/find" -} - -export type FindTextErrors = { - /** - * Bad request - */ - 400: BadRequestError -} - -export type FindTextError = FindTextErrors[keyof FindTextErrors] - -export type FindTextResponses = { - /** - * Matches - */ - 200: Array<{ - path: { - text: string - } - lines: { - text: string - } - line_number: number - absolute_offset: number - submatches: Array<{ - match: { - text: string - } - start: number - end: number - }> - }> -} - -export type FindTextResponse = FindTextResponses[keyof FindTextResponses] - -export type FindFilesData = { - body?: never - path?: never - query: { - directory?: string - workspace?: string - query: string - dirs?: "true" | "false" - type?: "file" | "directory" - limit?: number - } - url: "/find/file" -} - -export type FindFilesErrors = { - /** - * Bad request - */ - 400: BadRequestError -} - -export type FindFilesError = FindFilesErrors[keyof FindFilesErrors] - -export type FindFilesResponses = { - /** - * File paths - */ - 200: Array -} - -export type FindFilesResponse = FindFilesResponses[keyof FindFilesResponses] - -export type FindSymbolsData = { - body?: never - path?: never - query: { - directory?: string - workspace?: string - query: string - } - url: "/find/symbol" -} - -export type FindSymbolsErrors = { - /** - * Bad request - */ - 400: BadRequestError -} - -export type FindSymbolsError = FindSymbolsErrors[keyof FindSymbolsErrors] - -export type FindSymbolsResponses = { - /** - * Symbols - */ - 200: Array -} - -export type FindSymbolsResponse = FindSymbolsResponses[keyof FindSymbolsResponses] - -export type FileListData = { - body?: never - path?: never - query: { - directory?: string - workspace?: string - path: string - } - url: "/file" -} - -export type FileListErrors = { - /** - * Bad request - */ - 400: BadRequestError -} - -export type FileListError = FileListErrors[keyof FileListErrors] - -export type FileListResponses = { - /** - * Files and directories - */ - 200: Array -} - -export type FileListResponse = FileListResponses[keyof FileListResponses] - -export type FileReadData = { - body?: never - path?: never - query: { - directory?: string - workspace?: string - path: string - } - url: "/file/content" -} - -export type FileReadErrors = { - /** - * Bad request - */ - 400: BadRequestError -} - -export type FileReadError = FileReadErrors[keyof FileReadErrors] - -export type FileReadResponses = { - /** - * File content - */ - 200: FileContent -} - -export type FileReadResponse = FileReadResponses[keyof FileReadResponses] - -export type FileStatusData = { - body?: never - path?: never - query?: { - directory?: string - workspace?: string - } - url: "/file/status" -} - -export type FileStatusErrors = { - /** - * Bad request - */ - 400: BadRequestError -} - -export type FileStatusError = FileStatusErrors[keyof FileStatusErrors] - -export type FileStatusResponses = { - /** - * File status - */ - 200: Array -} - -export type FileStatusResponse = FileStatusResponses[keyof FileStatusResponses] - -export type InstanceDisposeData = { - body?: never - path?: never - query?: { - directory?: string - workspace?: string - } - url: "/instance/dispose" -} - -export type InstanceDisposeErrors = { - /** - * Bad request - */ - 400: BadRequestError -} - -export type InstanceDisposeError = InstanceDisposeErrors[keyof InstanceDisposeErrors] - -export type InstanceDisposeResponses = { - /** - * Instance disposed - */ - 200: boolean -} - -export type InstanceDisposeResponse = InstanceDisposeResponses[keyof InstanceDisposeResponses] - -export type PathGetData = { - body?: never - path?: never - query?: { - directory?: string - workspace?: string - } - url: "/path" -} - -export type PathGetErrors = { - /** - * Bad request - */ - 400: BadRequestError -} - -export type PathGetError = PathGetErrors[keyof PathGetErrors] - -export type PathGetResponses = { - /** - * Path - */ - 200: Path -} - -export type PathGetResponse = PathGetResponses[keyof PathGetResponses] - -export type VcsGetData = { - body?: never - path?: never - query?: { - directory?: string - workspace?: string - } - url: "/vcs" -} - -export type VcsGetErrors = { - /** - * Bad request - */ - 400: BadRequestError -} - -export type VcsGetError = VcsGetErrors[keyof VcsGetErrors] - -export type VcsGetResponses = { - /** - * VCS info - */ - 200: VcsInfo -} - -export type VcsGetResponse = VcsGetResponses[keyof VcsGetResponses] - -export type VcsStatusData = { - body?: never - path?: never - query?: { - directory?: string - workspace?: string - } - url: "/vcs/status" -} - -export type VcsStatusErrors = { - /** - * Bad request - */ - 400: BadRequestError -} - -export type VcsStatusError = VcsStatusErrors[keyof VcsStatusErrors] - -export type VcsStatusResponses = { - /** - * VCS status - */ - 200: Array -} - -export type VcsStatusResponse = VcsStatusResponses[keyof VcsStatusResponses] - -export type VcsDiffData = { - body?: never - path?: never - query: { - directory?: string - workspace?: string - mode: "git" | "branch" - context?: number - } - url: "/vcs/diff" -} - -export type VcsDiffErrors = { - /** - * Bad request - */ - 400: BadRequestError -} - -export type VcsDiffError = VcsDiffErrors[keyof VcsDiffErrors] - -export type VcsDiffResponses = { - /** - * VCS diff - */ - 200: Array -} - -export type VcsDiffResponse = VcsDiffResponses[keyof VcsDiffResponses] - -export type VcsDiffRawData = { - body?: never - path?: never - query?: { - directory?: string - workspace?: string - } - url: "/vcs/diff/raw" -} - -export type VcsDiffRawErrors = { - /** - * Bad request - */ - 400: BadRequestError -} - -export type VcsDiffRawError = VcsDiffRawErrors[keyof VcsDiffRawErrors] - -export type VcsDiffRawResponses = { - /** - * Raw VCS diff - */ - 200: string -} - -export type VcsDiffRawResponse = VcsDiffRawResponses[keyof VcsDiffRawResponses] - -export type VcsApplyData = { - body?: { - patch: string - } - path?: never - query?: { - directory?: string - workspace?: string - } - url: "/vcs/apply" -} - -export type VcsApplyErrors = { - /** - * VcsApplyError | InvalidRequestError - */ - 400: VcsApplyError | InvalidRequestError -} - -export type VcsApplyError2 = VcsApplyErrors[keyof VcsApplyErrors] - -export type VcsApplyResponses = { - /** - * VCS patch applied - */ - 200: { - applied: boolean - } -} - -export type VcsApplyResponse = VcsApplyResponses[keyof VcsApplyResponses] - -export type CommandListData = { - body?: never - path?: never - query?: { - directory?: string - workspace?: string - } - url: "/command" -} - -export type CommandListErrors = { - /** - * Bad request - */ - 400: BadRequestError -} - -export type CommandListError = CommandListErrors[keyof CommandListErrors] - -export type CommandListResponses = { - /** - * List of commands - */ - 200: Array -} - -export type CommandListResponse = CommandListResponses[keyof CommandListResponses] - -export type AppAgentsData = { - body?: never - path?: never - query?: { - directory?: string - workspace?: string - } - url: "/agent" -} - -export type AppAgentsErrors = { - /** - * Bad request - */ - 400: BadRequestError -} - -export type AppAgentsError = AppAgentsErrors[keyof AppAgentsErrors] - -export type AppAgentsResponses = { - /** - * List of agents - */ - 200: Array -} - -export type AppAgentsResponse = AppAgentsResponses[keyof AppAgentsResponses] - -export type AppSkillsData = { - body?: never - path?: never - query?: { - directory?: string - workspace?: string - } - url: "/skill" -} - -export type AppSkillsErrors = { - /** - * Bad request - */ - 400: BadRequestError -} - -export type AppSkillsError = AppSkillsErrors[keyof AppSkillsErrors] - -export type AppSkillsResponses = { - /** - * List of skills - */ - 200: Array<{ - name: string - description?: string - location: string - content: string - }> -} - -export type AppSkillsResponse = AppSkillsResponses[keyof AppSkillsResponses] - -export type LspStatusData = { - body?: never - path?: never - query?: { - directory?: string - workspace?: string - } - url: "/lsp" -} - -export type LspStatusErrors = { - /** - * Bad request - */ - 400: BadRequestError -} - -export type LspStatusError = LspStatusErrors[keyof LspStatusErrors] - -export type LspStatusResponses = { - /** - * LSP server status - */ - 200: Array -} - -export type LspStatusResponse = LspStatusResponses[keyof LspStatusResponses] - -export type FormatterStatusData = { - body?: never - path?: never - query?: { - directory?: string - workspace?: string - } - url: "/formatter" -} - -export type FormatterStatusErrors = { - /** - * Bad request - */ - 400: BadRequestError -} - -export type FormatterStatusError = FormatterStatusErrors[keyof FormatterStatusErrors] - -export type FormatterStatusResponses = { - /** - * Formatter status - */ - 200: Array -} - -export type FormatterStatusResponse = FormatterStatusResponses[keyof FormatterStatusResponses] - -export type McpStatusData = { - body?: never - path?: never - query?: { - directory?: string - workspace?: string - } - url: "/mcp" -} - -export type McpStatusErrors = { - /** - * Bad request - */ - 400: BadRequestError -} - -export type McpStatusError = McpStatusErrors[keyof McpStatusErrors] - -export type McpStatusResponses = { - /** - * MCP server status - */ - 200: { - [key: string]: McpStatus - } -} - -export type McpStatusResponse = McpStatusResponses[keyof McpStatusResponses] - -export type McpAddData = { - body?: { - name: string - config: McpLocalConfig | McpRemoteConfig - } - path?: never - query?: { - directory?: string - workspace?: string - } - url: "/mcp" -} - -export type McpAddErrors = { - /** - * BadRequest | InvalidRequestError - */ - 400: EffectHttpApiErrorBadRequest | InvalidRequestError -} - -export type McpAddError = McpAddErrors[keyof McpAddErrors] - -export type McpAddResponses = { - /** - * MCP server added successfully - */ - 200: { - [key: string]: McpStatus - } -} - -export type McpAddResponse = McpAddResponses[keyof McpAddResponses] - -export type McpAuthRemoveData = { - body?: never - path: { - name: string - } - query?: { - directory?: string - workspace?: string - } - url: "/mcp/{name}/auth" -} - -export type McpAuthRemoveErrors = { - /** - * Bad request - */ - 400: BadRequestError - /** - * McpServerNotFoundError - */ - 404: McpServerNotFoundError -} - -export type McpAuthRemoveError = McpAuthRemoveErrors[keyof McpAuthRemoveErrors] - -export type McpAuthRemoveResponses = { - /** - * OAuth credentials removed - */ - 200: { - success: true - } -} - -export type McpAuthRemoveResponse = McpAuthRemoveResponses[keyof McpAuthRemoveResponses] - -export type McpAuthStartData = { - body?: never - path: { - name: string - } - query?: { - directory?: string - workspace?: string - } - url: "/mcp/{name}/auth" -} - -export type McpAuthStartErrors = { - /** - * McpUnsupportedOAuthError | InvalidRequestError - */ - 400: McpUnsupportedOAuthError | InvalidRequestError - /** - * McpServerNotFoundError - */ - 404: McpServerNotFoundError -} - -export type McpAuthStartError = McpAuthStartErrors[keyof McpAuthStartErrors] - -export type McpAuthStartResponses = { - /** - * OAuth flow started - */ - 200: { - authorizationUrl: string - oauthState: string - } -} - -export type McpAuthStartResponse = McpAuthStartResponses[keyof McpAuthStartResponses] - -export type McpAuthCallbackData = { - body?: { - code: string - } - path: { - name: string - } - query?: { - directory?: string - workspace?: string - } - url: "/mcp/{name}/auth/callback" -} - -export type McpAuthCallbackErrors = { - /** - * BadRequest | InvalidRequestError - */ - 400: EffectHttpApiErrorBadRequest | InvalidRequestError - /** - * McpServerNotFoundError - */ - 404: McpServerNotFoundError -} - -export type McpAuthCallbackError = McpAuthCallbackErrors[keyof McpAuthCallbackErrors] - -export type McpAuthCallbackResponses = { - /** - * OAuth authentication completed - */ - 200: McpStatus -} - -export type McpAuthCallbackResponse = McpAuthCallbackResponses[keyof McpAuthCallbackResponses] - -export type McpAuthAuthenticateData = { - body?: never - path: { - name: string - } - query?: { - directory?: string - workspace?: string - } - url: "/mcp/{name}/auth/authenticate" -} - -export type McpAuthAuthenticateErrors = { - /** - * McpUnsupportedOAuthError | InvalidRequestError - */ - 400: McpUnsupportedOAuthError | InvalidRequestError - /** - * McpServerNotFoundError - */ - 404: McpServerNotFoundError -} - -export type McpAuthAuthenticateError = McpAuthAuthenticateErrors[keyof McpAuthAuthenticateErrors] - -export type McpAuthAuthenticateResponses = { - /** - * OAuth authentication completed - */ - 200: McpStatus -} - -export type McpAuthAuthenticateResponse = McpAuthAuthenticateResponses[keyof McpAuthAuthenticateResponses] - -export type McpConnectData = { - body?: never - path: { - name: string - } - query?: { - directory?: string - workspace?: string - } - url: "/mcp/{name}/connect" -} - -export type McpConnectErrors = { - /** - * Bad request - */ - 400: BadRequestError - /** - * McpServerNotFoundError - */ - 404: McpServerNotFoundError -} - -export type McpConnectError = McpConnectErrors[keyof McpConnectErrors] - -export type McpConnectResponses = { - /** - * MCP server connected successfully - */ - 200: boolean -} - -export type McpConnectResponse = McpConnectResponses[keyof McpConnectResponses] - -export type McpDisconnectData = { - body?: never - path: { - name: string - } - query?: { - directory?: string - workspace?: string - } - url: "/mcp/{name}/disconnect" -} - -export type McpDisconnectErrors = { - /** - * Bad request - */ - 400: BadRequestError - /** - * McpServerNotFoundError - */ - 404: McpServerNotFoundError -} - -export type McpDisconnectError = McpDisconnectErrors[keyof McpDisconnectErrors] - -export type McpDisconnectResponses = { - /** - * MCP server disconnected successfully - */ - 200: boolean -} - -export type McpDisconnectResponse = McpDisconnectResponses[keyof McpDisconnectResponses] - -export type ProjectListData = { - body?: never - path?: never - query?: { - directory?: string - workspace?: string - } - url: "/project" -} - -export type ProjectListErrors = { - /** - * Bad request - */ - 400: BadRequestError -} - -export type ProjectListError = ProjectListErrors[keyof ProjectListErrors] - -export type ProjectListResponses = { - /** - * List of projects - */ - 200: Array -} - -export type ProjectListResponse = ProjectListResponses[keyof ProjectListResponses] - -export type ProjectCurrentData = { - body?: never - path?: never - query?: { - directory?: string - workspace?: string - } - url: "/project/current" -} - -export type ProjectCurrentErrors = { - /** - * Bad request - */ - 400: BadRequestError -} - -export type ProjectCurrentError = ProjectCurrentErrors[keyof ProjectCurrentErrors] - -export type ProjectCurrentResponses = { - /** - * Current project information - */ - 200: Project -} - -export type ProjectCurrentResponse = ProjectCurrentResponses[keyof ProjectCurrentResponses] - -export type ProjectInitGitData = { - body?: never - path?: never - query?: { - directory?: string - workspace?: string - } - url: "/project/git/init" -} - -export type ProjectInitGitErrors = { - /** - * Bad request - */ - 400: BadRequestError -} - -export type ProjectInitGitError = ProjectInitGitErrors[keyof ProjectInitGitErrors] - -export type ProjectInitGitResponses = { - /** - * Project information after git initialization - */ - 200: Project -} - -export type ProjectInitGitResponse = ProjectInitGitResponses[keyof ProjectInitGitResponses] - -export type ProjectUpdateData = { - body?: { - name?: string - icon?: ProjectIcon - commands?: ProjectCommands - } - path: { - projectID: string - } - query?: { - directory?: string - workspace?: string - } - url: "/project/{projectID}" -} - -export type ProjectUpdateErrors = { - /** - * BadRequest | InvalidRequestError - */ - 400: EffectHttpApiErrorBadRequest | InvalidRequestError - /** - * ProjectNotFoundError - */ - 404: ProjectNotFoundError -} - -export type ProjectUpdateError = ProjectUpdateErrors[keyof ProjectUpdateErrors] - -export type ProjectUpdateResponses = { - /** - * Updated project information - */ - 200: Project -} - -export type ProjectUpdateResponse = ProjectUpdateResponses[keyof ProjectUpdateResponses] - -export type ProjectDirectoriesData = { - body?: never - path: { - projectID: string - } - query?: { - directory?: string - workspace?: string - } - url: "/project/{projectID}/directories" -} - -export type ProjectDirectoriesErrors = { - /** - * Bad request - */ - 400: BadRequestError -} - -export type ProjectDirectoriesError = ProjectDirectoriesErrors[keyof ProjectDirectoriesErrors] - -export type ProjectDirectoriesResponses = { - /** - * Project directories - */ - 200: ProjectDirectories -} - -export type ProjectDirectoriesResponse = ProjectDirectoriesResponses[keyof ProjectDirectoriesResponses] - -export type ExperimentalProjectCopyGenerateNameData = { - body?: { - context?: string - } - path: { - projectID: string - } - query?: { - directory?: string - workspace?: string - } - url: "/experimental/project/{projectID}/copy/generate-name" -} - -export type ExperimentalProjectCopyGenerateNameErrors = { - /** - * Bad request - */ - 400: BadRequestError -} - -export type ExperimentalProjectCopyGenerateNameError = - ExperimentalProjectCopyGenerateNameErrors[keyof ExperimentalProjectCopyGenerateNameErrors] - -export type ExperimentalProjectCopyGenerateNameResponses = { - /** - * Success - */ - 200: { - name: string - } -} - -export type ExperimentalProjectCopyGenerateNameResponse = - ExperimentalProjectCopyGenerateNameResponses[keyof ExperimentalProjectCopyGenerateNameResponses] - -export type PtyShellsData = { - body?: never - path?: never - query?: { - directory?: string - workspace?: string - } - url: "/pty/shells" -} - -export type PtyShellsErrors = { - /** - * Bad request - */ - 400: BadRequestError -} - -export type PtyShellsError = PtyShellsErrors[keyof PtyShellsErrors] - -export type PtyShellsResponses = { - /** - * List of shells - */ - 200: Array<{ - path: string - name: string - acceptable: boolean - }> -} - -export type PtyShellsResponse = PtyShellsResponses[keyof PtyShellsResponses] - -export type PtyListData = { - body?: never - path?: never - query?: { - directory?: string - workspace?: string - } - url: "/pty" -} - -export type PtyListErrors = { - /** - * Bad request - */ - 400: BadRequestError -} - -export type PtyListError = PtyListErrors[keyof PtyListErrors] - -export type PtyListResponses = { - /** - * List of sessions - */ - 200: Array -} - -export type PtyListResponse = PtyListResponses[keyof PtyListResponses] - -export type PtyCreateData = { - body?: { - command?: string - args?: Array - cwd?: string - title?: string - env?: { - [key: string]: string - } - } - path?: never - query?: { - directory?: string - workspace?: string - } - url: "/pty" -} - -export type PtyCreateErrors = { - /** - * BadRequest | InvalidRequestError - */ - 400: EffectHttpApiErrorBadRequest | InvalidRequestError -} - -export type PtyCreateError = PtyCreateErrors[keyof PtyCreateErrors] - -export type PtyCreateResponses = { - /** - * Created session - */ - 200: Pty -} - -export type PtyCreateResponse = PtyCreateResponses[keyof PtyCreateResponses] - -export type PtyRemoveData = { - body?: never - path: { - ptyID: string - } - query?: { - directory?: string - workspace?: string - } - url: "/pty/{ptyID}" -} - -export type PtyRemoveErrors = { - /** - * Bad request - */ - 400: BadRequestError - /** - * PtyNotFoundError - */ - 404: PtyNotFoundError -} - -export type PtyRemoveError = PtyRemoveErrors[keyof PtyRemoveErrors] - -export type PtyRemoveResponses = { - /** - * Session removed - */ - 200: boolean -} - -export type PtyRemoveResponse = PtyRemoveResponses[keyof PtyRemoveResponses] - -export type PtyGetData = { - body?: never - path: { - ptyID: string - } - query?: { - directory?: string - workspace?: string - } - url: "/pty/{ptyID}" -} - -export type PtyGetErrors = { - /** - * Bad request - */ - 400: BadRequestError - /** - * PtyNotFoundError - */ - 404: PtyNotFoundError -} - -export type PtyGetError = PtyGetErrors[keyof PtyGetErrors] - -export type PtyGetResponses = { - /** - * Session info - */ - 200: Pty -} - -export type PtyGetResponse = PtyGetResponses[keyof PtyGetResponses] - -export type PtyUpdateData = { - body?: { - title?: string - size?: { - rows: number - cols: number - } - } - path: { - ptyID: string - } - query?: { - directory?: string - workspace?: string - } - url: "/pty/{ptyID}" -} - -export type PtyUpdateErrors = { - /** - * BadRequest | InvalidRequestError - */ - 400: EffectHttpApiErrorBadRequest | InvalidRequestError - /** - * PtyNotFoundError - */ - 404: PtyNotFoundError -} - -export type PtyUpdateError = PtyUpdateErrors[keyof PtyUpdateErrors] - -export type PtyUpdateResponses = { - /** - * Updated session - */ - 200: Pty -} - -export type PtyUpdateResponse = PtyUpdateResponses[keyof PtyUpdateResponses] - -export type PtyConnectTokenData = { - body?: never - path: { - ptyID: string - } - query?: { - directory?: string - workspace?: string - } - url: "/pty/{ptyID}/connect-token" -} - -export type PtyConnectTokenErrors = { - /** - * Bad request - */ - 400: BadRequestError - /** - * PtyForbiddenError - */ - 403: PtyForbiddenError - /** - * PtyNotFoundError - */ - 404: PtyNotFoundError -} - -export type PtyConnectTokenError = PtyConnectTokenErrors[keyof PtyConnectTokenErrors] - -export type PtyConnectTokenResponses = { - /** - * WebSocket connect token - */ - 200: PtyTicketConnectToken -} - -export type PtyConnectTokenResponse = PtyConnectTokenResponses[keyof PtyConnectTokenResponses] - -export type QuestionListData = { - body?: never - path?: never - query?: { - directory?: string - workspace?: string - } - url: "/question" -} - -export type QuestionListErrors = { - /** - * Bad request - */ - 400: BadRequestError -} - -export type QuestionListError = QuestionListErrors[keyof QuestionListErrors] - -export type QuestionListResponses = { - /** - * List of pending questions - */ - 200: Array -} - -export type QuestionListResponse = QuestionListResponses[keyof QuestionListResponses] - -export type QuestionReplyData = { - body?: { - /** - * User answers in order of questions (each answer is an array of selected labels) - */ - answers: Array - } - path: { - requestID: string - } - query?: { - directory?: string - workspace?: string - } - url: "/question/{requestID}/reply" -} - -export type QuestionReplyErrors = { - /** - * BadRequest | InvalidRequestError - */ - 400: EffectHttpApiErrorBadRequest | InvalidRequestError - /** - * QuestionNotFoundError - */ - 404: QuestionNotFoundError -} - -export type QuestionReplyError = QuestionReplyErrors[keyof QuestionReplyErrors] - -export type QuestionReplyResponses = { - /** - * Question answered successfully - */ - 200: boolean -} - -export type QuestionReplyResponse = QuestionReplyResponses[keyof QuestionReplyResponses] - -export type QuestionRejectData = { - body?: never - path: { - requestID: string - } - query?: { - directory?: string - workspace?: string - } - url: "/question/{requestID}/reject" -} - -export type QuestionRejectErrors = { - /** - * BadRequest | InvalidRequestError - */ - 400: EffectHttpApiErrorBadRequest | InvalidRequestError - /** - * QuestionNotFoundError - */ - 404: QuestionNotFoundError -} - -export type QuestionRejectError = QuestionRejectErrors[keyof QuestionRejectErrors] - -export type QuestionRejectResponses = { - /** - * Question rejected successfully - */ - 200: boolean -} - -export type QuestionRejectResponse = QuestionRejectResponses[keyof QuestionRejectResponses] - -export type PermissionListData = { - body?: never - path?: never - query?: { - directory?: string - workspace?: string - } - url: "/permission" -} - -export type PermissionListErrors = { - /** - * Bad request - */ - 400: BadRequestError -} - -export type PermissionListError = PermissionListErrors[keyof PermissionListErrors] - -export type PermissionListResponses = { - /** - * List of pending permissions - */ - 200: Array -} - -export type PermissionListResponse = PermissionListResponses[keyof PermissionListResponses] - -export type PermissionReplyData = { - body?: { - reply: "once" | "always" | "reject" - message?: string - } - path: { - requestID: string - } - query?: { - directory?: string - workspace?: string - } - url: "/permission/{requestID}/reply" -} - -export type PermissionReplyErrors = { - /** - * BadRequest | InvalidRequestError - */ - 400: EffectHttpApiErrorBadRequest | InvalidRequestError - /** - * PermissionNotFoundError - */ - 404: PermissionNotFoundError -} - -export type PermissionReplyError = PermissionReplyErrors[keyof PermissionReplyErrors] - -export type PermissionReplyResponses = { - /** - * Permission processed successfully - */ - 200: boolean -} - -export type PermissionReplyResponse = PermissionReplyResponses[keyof PermissionReplyResponses] - -export type ProviderListData = { - body?: never - path?: never - query?: { - directory?: string - workspace?: string - } - url: "/provider" -} - -export type ProviderListErrors = { - /** - * Bad request - */ - 400: BadRequestError -} - -export type ProviderListError = ProviderListErrors[keyof ProviderListErrors] - -export type ProviderListResponses = { - /** - * List of providers - */ - 200: { - all: Array - default: { - [key: string]: string - } - connected: Array - } -} - -export type ProviderListResponse = ProviderListResponses[keyof ProviderListResponses] - -export type ProviderAuthData = { - body?: never - path?: never - query?: { - directory?: string - workspace?: string - } - url: "/provider/auth" -} - -export type ProviderAuthErrors = { - /** - * Bad request - */ - 400: BadRequestError -} - -export type ProviderAuthError2 = ProviderAuthErrors[keyof ProviderAuthErrors] - -export type ProviderAuthResponses = { - /** - * Provider auth methods - */ - 200: { - [key: string]: Array - } -} - -export type ProviderAuthResponse = ProviderAuthResponses[keyof ProviderAuthResponses] - -export type ProviderOauthAuthorizeData = { - body?: { - /** - * Auth method index - */ - method: number - inputs?: { - [key: string]: string - } - } - path: { - providerID: string - } - query?: { - directory?: string - workspace?: string - } - url: "/provider/{providerID}/oauth/authorize" -} - -export type ProviderOauthAuthorizeErrors = { - /** - * ProviderAuthError | InvalidRequestError - */ - 400: ProviderAuthError1 | InvalidRequestError -} - -export type ProviderOauthAuthorizeError = ProviderOauthAuthorizeErrors[keyof ProviderOauthAuthorizeErrors] - -export type ProviderOauthAuthorizeResponses = { - /** - * Authorization URL and method - */ - 200: ProviderAuthAuthorization -} - -export type ProviderOauthAuthorizeResponse = ProviderOauthAuthorizeResponses[keyof ProviderOauthAuthorizeResponses] - -export type ProviderOauthCallbackData = { - body?: { - /** - * Auth method index - */ - method: number - code?: string - } - path: { - providerID: string - } - query?: { - directory?: string - workspace?: string - } - url: "/provider/{providerID}/oauth/callback" -} - -export type ProviderOauthCallbackErrors = { - /** - * ProviderAuthError | InvalidRequestError - */ - 400: ProviderAuthError1 | InvalidRequestError -} - -export type ProviderOauthCallbackError = ProviderOauthCallbackErrors[keyof ProviderOauthCallbackErrors] - -export type ProviderOauthCallbackResponses = { - /** - * OAuth callback processed successfully - */ - 200: boolean -} - -export type ProviderOauthCallbackResponse = ProviderOauthCallbackResponses[keyof ProviderOauthCallbackResponses] - -export type SessionListData = { - body?: never - path?: never - query?: { - directory?: string - workspace?: string - scope?: "project" - path?: string - roots?: boolean | "true" | "false" - start?: number - search?: string - limit?: number - } - url: "/session" -} - -export type SessionListErrors = { - /** - * Bad request - */ - 400: BadRequestError -} - -export type SessionListError = SessionListErrors[keyof SessionListErrors] - -export type SessionListResponses = { - /** - * List of sessions - */ - 200: Array -} - -export type SessionListResponse = SessionListResponses[keyof SessionListResponses] - -export type SessionCreateData = { - body?: { - parentID?: string - title?: string - agent?: string - model?: { - id: string - providerID: string - variant?: string - } - metadata?: { - [key: string]: unknown - } - permission?: PermissionRuleset - workspaceID?: string - } - path?: never - query?: { - directory?: string - workspace?: string - } - url: "/session" -} - -export type SessionCreateErrors = { - /** - * BadRequest | InvalidRequestError - */ - 400: EffectHttpApiErrorBadRequest | InvalidRequestError -} - -export type SessionCreateError = SessionCreateErrors[keyof SessionCreateErrors] - -export type SessionCreateResponses = { - /** - * Successfully created session - */ - 200: Session -} - -export type SessionCreateResponse = SessionCreateResponses[keyof SessionCreateResponses] - -export type SessionStatusData = { - body?: never - path?: never - query?: { - directory?: string - workspace?: string - } - url: "/session/status" -} - -export type SessionStatusErrors = { - /** - * BadRequest | InvalidRequestError - */ - 400: EffectHttpApiErrorBadRequest | InvalidRequestError -} - -export type SessionStatusError = SessionStatusErrors[keyof SessionStatusErrors] - -export type SessionStatusResponses = { - /** - * Get session status - */ - 200: { - [key: string]: SessionStatus - } -} - -export type SessionStatusResponse = SessionStatusResponses[keyof SessionStatusResponses] - -export type SessionDeleteData = { - body?: never - path: { - sessionID: string - } - query?: { - directory?: string - workspace?: string - } - url: "/session/{sessionID}" -} - -export type SessionDeleteErrors = { - /** - * BadRequest | InvalidRequestError - */ - 400: EffectHttpApiErrorBadRequest | InvalidRequestError - /** - * NotFoundError - */ - 404: NotFoundError -} - -export type SessionDeleteError = SessionDeleteErrors[keyof SessionDeleteErrors] - -export type SessionDeleteResponses = { - /** - * Successfully deleted session - */ - 200: boolean -} - -export type SessionDeleteResponse = SessionDeleteResponses[keyof SessionDeleteResponses] - -export type SessionGetData = { - body?: never - path: { - sessionID: string - } - query?: { - directory?: string - workspace?: string - } - url: "/session/{sessionID}" -} - -export type SessionGetErrors = { - /** - * BadRequest | InvalidRequestError - */ - 400: EffectHttpApiErrorBadRequest | InvalidRequestError - /** - * NotFoundError - */ - 404: NotFoundError -} - -export type SessionGetError = SessionGetErrors[keyof SessionGetErrors] - -export type SessionGetResponses = { - /** - * Get session - */ - 200: Session -} - -export type SessionGetResponse = SessionGetResponses[keyof SessionGetResponses] - -export type SessionUpdateData = { - body?: { - title?: string - metadata?: { - [key: string]: unknown - } - permission?: PermissionRuleset - time?: { - archived?: number - } - } - path: { - sessionID: string - } - query?: { - directory?: string - workspace?: string - } - url: "/session/{sessionID}" -} - -export type SessionUpdateErrors = { - /** - * BadRequest | InvalidRequestError - */ - 400: EffectHttpApiErrorBadRequest | InvalidRequestError - /** - * NotFoundError - */ - 404: NotFoundError -} - -export type SessionUpdateError = SessionUpdateErrors[keyof SessionUpdateErrors] - -export type SessionUpdateResponses = { - /** - * Successfully updated session - */ - 200: Session -} - -export type SessionUpdateResponse = SessionUpdateResponses[keyof SessionUpdateResponses] - -export type SessionChildrenData = { - body?: never - path: { - sessionID: string - } - query?: { - directory?: string - workspace?: string - } - url: "/session/{sessionID}/children" -} - -export type SessionChildrenErrors = { - /** - * BadRequest | InvalidRequestError - */ - 400: EffectHttpApiErrorBadRequest | InvalidRequestError - /** - * NotFoundError - */ - 404: NotFoundError -} - -export type SessionChildrenError = SessionChildrenErrors[keyof SessionChildrenErrors] - -export type SessionChildrenResponses = { - /** - * List of children - */ - 200: Array -} - -export type SessionChildrenResponse = SessionChildrenResponses[keyof SessionChildrenResponses] - -export type SessionDiffData = { - body?: never - path: { - sessionID: string - } - query?: { - directory?: string - workspace?: string - messageID?: string - } - url: "/session/{sessionID}/diff" -} - -export type SessionDiffErrors = { - /** - * Bad request - */ - 400: BadRequestError -} - -export type SessionDiffError = SessionDiffErrors[keyof SessionDiffErrors] - -export type SessionDiffResponses = { - /** - * Successfully retrieved diff - */ - 200: Array -} - -export type SessionDiffResponse = SessionDiffResponses[keyof SessionDiffResponses] - -export type SessionMessagesData = { - body?: never - path: { - sessionID: string - } - query?: { - directory?: string - workspace?: string - limit?: number - before?: string - } - url: "/session/{sessionID}/message" -} - -export type SessionMessagesErrors = { - /** - * BadRequest | InvalidRequestError - */ - 400: EffectHttpApiErrorBadRequest | InvalidRequestError - /** - * NotFoundError - */ - 404: NotFoundError -} - -export type SessionMessagesError = SessionMessagesErrors[keyof SessionMessagesErrors] - -export type SessionMessagesResponses = { - /** - * List of messages - */ - 200: Array<{ - info: Message - parts: Array - }> -} - -export type SessionMessagesResponse2 = SessionMessagesResponses[keyof SessionMessagesResponses] - -export type SessionPromptData = { - body?: { - messageID?: string - model?: { - providerID: string - modelID: string - } - agent?: string - noReply?: boolean - tools?: { - [key: string]: boolean - } - format?: OutputFormat - system?: string - variant?: string - parts: Array - } - path: { - sessionID: string - } - query?: { - directory?: string - workspace?: string - } - url: "/session/{sessionID}/message" -} - -export type SessionPromptErrors = { - /** - * BadRequest | InvalidRequestError - */ - 400: EffectHttpApiErrorBadRequest | InvalidRequestError - /** - * NotFoundError - */ - 404: NotFoundError -} - -export type SessionPromptError = SessionPromptErrors[keyof SessionPromptErrors] - -export type SessionPromptResponses = { - /** - * Created message - */ - 200: { - info: AssistantMessage - parts: Array - } -} - -export type SessionPromptResponse = SessionPromptResponses[keyof SessionPromptResponses] - -export type SessionDeleteMessageData = { - body?: never - path: { - sessionID: string - messageID: string - } - query?: { - directory?: string - workspace?: string - } - url: "/session/{sessionID}/message/{messageID}" -} - -export type SessionDeleteMessageErrors = { - /** - * BadRequest | InvalidRequestError - */ - 400: EffectHttpApiErrorBadRequest | InvalidRequestError - /** - * NotFoundError - */ - 404: NotFoundError - /** - * SessionBusyError - */ - 409: SessionBusyError -} - -export type SessionDeleteMessageError = SessionDeleteMessageErrors[keyof SessionDeleteMessageErrors] - -export type SessionDeleteMessageResponses = { - /** - * Successfully deleted message - */ - 200: boolean -} - -export type SessionDeleteMessageResponse = SessionDeleteMessageResponses[keyof SessionDeleteMessageResponses] - -export type SessionMessageData = { - body?: never - path: { - sessionID: string - messageID: string - } - query?: { - directory?: string - workspace?: string - } - url: "/session/{sessionID}/message/{messageID}" -} - -export type SessionMessageErrors = { - /** - * BadRequest | InvalidRequestError - */ - 400: EffectHttpApiErrorBadRequest | InvalidRequestError - /** - * NotFoundError - */ - 404: NotFoundError -} - -export type SessionMessageError = SessionMessageErrors[keyof SessionMessageErrors] - -export type SessionMessageResponses = { - /** - * Message - */ - 200: { - info: Message - parts: Array - } -} - -export type SessionMessageResponse = SessionMessageResponses[keyof SessionMessageResponses] - -export type SessionForkData = { - body?: { - messageID?: string - } - path: { - sessionID: string - } - query?: { - directory?: string - workspace?: string - } - url: "/session/{sessionID}/fork" -} - -export type SessionForkErrors = { - /** - * BadRequest | InvalidRequestError - */ - 400: EffectHttpApiErrorBadRequest | InvalidRequestError - /** - * NotFoundError - */ - 404: NotFoundError -} - -export type SessionForkError = SessionForkErrors[keyof SessionForkErrors] - -export type SessionForkResponses = { - /** - * 200 - */ - 200: Session -} - -export type SessionForkResponse = SessionForkResponses[keyof SessionForkResponses] - -export type SessionAbortData = { - body?: never - path: { - sessionID: string - } - query?: { - directory?: string - workspace?: string - } - url: "/session/{sessionID}/abort" -} - -export type SessionAbortErrors = { - /** - * BadRequest | InvalidRequestError - */ - 400: EffectHttpApiErrorBadRequest | InvalidRequestError -} - -export type SessionAbortError = SessionAbortErrors[keyof SessionAbortErrors] - -export type SessionAbortResponses = { - /** - * Aborted session - */ - 200: boolean -} - -export type SessionAbortResponse = SessionAbortResponses[keyof SessionAbortResponses] - -export type SessionInitData = { - body?: { - modelID: string - providerID: string - messageID: string - } - path: { - sessionID: string - } - query?: { - directory?: string - workspace?: string - } - url: "/session/{sessionID}/init" -} - -export type SessionInitErrors = { - /** - * BadRequest | InvalidRequestError - */ - 400: EffectHttpApiErrorBadRequest | InvalidRequestError - /** - * NotFoundError - */ - 404: NotFoundError -} - -export type SessionInitError = SessionInitErrors[keyof SessionInitErrors] - -export type SessionInitResponses = { - /** - * 200 - */ - 200: boolean -} - -export type SessionInitResponse = SessionInitResponses[keyof SessionInitResponses] - -export type SessionUnshareData = { - body?: never - path: { - sessionID: string - } - query?: { - directory?: string - workspace?: string - } - url: "/session/{sessionID}/share" -} - -export type SessionUnshareErrors = { - /** - * Bad request - */ - 400: BadRequestError - /** - * NotFoundError - */ - 404: NotFoundError - /** - * InternalServerError - */ - 500: EffectHttpApiErrorInternalServerError -} - -export type SessionUnshareError = SessionUnshareErrors[keyof SessionUnshareErrors] - -export type SessionUnshareResponses = { - /** - * Successfully unshared session - */ - 200: Session -} - -export type SessionUnshareResponse = SessionUnshareResponses[keyof SessionUnshareResponses] - -export type SessionShareData = { - body?: never - path: { - sessionID: string - } - query?: { - directory?: string - workspace?: string - } - url: "/session/{sessionID}/share" -} - -export type SessionShareErrors = { - /** - * Bad request - */ - 400: BadRequestError - /** - * NotFoundError - */ - 404: NotFoundError - /** - * InternalServerError - */ - 500: EffectHttpApiErrorInternalServerError -} - -export type SessionShareError = SessionShareErrors[keyof SessionShareErrors] - -export type SessionShareResponses = { - /** - * Successfully shared session - */ - 200: Session -} - -export type SessionShareResponse = SessionShareResponses[keyof SessionShareResponses] - -export type SessionSummarizeData = { - body?: { - providerID: string - modelID: string - auto?: boolean - } - path: { - sessionID: string - } - query?: { - directory?: string - workspace?: string - } - url: "/session/{sessionID}/summarize" -} - -export type SessionSummarizeErrors = { - /** - * BadRequest | InvalidRequestError - */ - 400: EffectHttpApiErrorBadRequest | InvalidRequestError - /** - * NotFoundError - */ - 404: NotFoundError -} - -export type SessionSummarizeError = SessionSummarizeErrors[keyof SessionSummarizeErrors] - -export type SessionSummarizeResponses = { - /** - * Summarized session - */ - 200: boolean -} - -export type SessionSummarizeResponse = SessionSummarizeResponses[keyof SessionSummarizeResponses] - -export type SessionPromptAsyncData = { - body?: { - messageID?: string - model?: { - providerID: string - modelID: string - } - agent?: string - noReply?: boolean - tools?: { - [key: string]: boolean - } - format?: OutputFormat - system?: string - variant?: string - parts: Array - } - path: { - sessionID: string - } - query?: { - directory?: string - workspace?: string - } - url: "/session/{sessionID}/prompt_async" -} - -export type SessionPromptAsyncErrors = { - /** - * BadRequest | InvalidRequestError - */ - 400: EffectHttpApiErrorBadRequest | InvalidRequestError - /** - * NotFoundError - */ - 404: NotFoundError -} - -export type SessionPromptAsyncError = SessionPromptAsyncErrors[keyof SessionPromptAsyncErrors] - -export type SessionPromptAsyncResponses = { - /** - * Prompt accepted - */ - 204: void -} - -export type SessionPromptAsyncResponse = SessionPromptAsyncResponses[keyof SessionPromptAsyncResponses] - -export type SessionCommandData = { - body?: { - messageID?: string - agent?: string - model?: string - arguments: string - command: string - variant?: string - parts?: Array<{ - id?: string - type: "file" - mime: string - filename?: string - url: string - source?: FilePartSource - }> - } - path: { - sessionID: string - } - query?: { - directory?: string - workspace?: string - } - url: "/session/{sessionID}/command" -} - -export type SessionCommandErrors = { - /** - * BadRequest | InvalidRequestError - */ - 400: EffectHttpApiErrorBadRequest | InvalidRequestError - /** - * NotFoundError - */ - 404: NotFoundError -} - -export type SessionCommandError = SessionCommandErrors[keyof SessionCommandErrors] - -export type SessionCommandResponses = { - /** - * Created message - */ - 200: { - info: AssistantMessage - parts: Array - } -} - -export type SessionCommandResponse = SessionCommandResponses[keyof SessionCommandResponses] - -export type SessionShellData = { - body?: { - messageID?: string - agent: string - model?: { - providerID: string - modelID: string - } - command: string - } - path: { - sessionID: string - } - query?: { - directory?: string - workspace?: string - } - url: "/session/{sessionID}/shell" -} - -export type SessionShellErrors = { - /** - * BadRequest | InvalidRequestError - */ - 400: EffectHttpApiErrorBadRequest | InvalidRequestError - /** - * NotFoundError - */ - 404: NotFoundError - /** - * SessionBusyError - */ - 409: SessionBusyError -} - -export type SessionShellError = SessionShellErrors[keyof SessionShellErrors] - -export type SessionShellResponses = { - /** - * Created message - */ - 200: { - info: Message - parts: Array - } -} - -export type SessionShellResponse = SessionShellResponses[keyof SessionShellResponses] - -export type SessionRevertData = { - body?: { - messageID: string - partID?: string - } - path: { - sessionID: string - } - query?: { - directory?: string - workspace?: string - } - url: "/session/{sessionID}/revert" -} - -export type SessionRevertErrors = { - /** - * BadRequest | InvalidRequestError - */ - 400: EffectHttpApiErrorBadRequest | InvalidRequestError - /** - * NotFoundError - */ - 404: NotFoundError - /** - * SessionBusyError - */ - 409: SessionBusyError -} - -export type SessionRevertError = SessionRevertErrors[keyof SessionRevertErrors] - -export type SessionRevertResponses = { - /** - * Updated session - */ - 200: Session -} - -export type SessionRevertResponse = SessionRevertResponses[keyof SessionRevertResponses] - -export type SessionUnrevertData = { - body?: never - path: { - sessionID: string - } - query?: { - directory?: string - workspace?: string - } - url: "/session/{sessionID}/unrevert" -} - -export type SessionUnrevertErrors = { - /** - * BadRequest | InvalidRequestError - */ - 400: EffectHttpApiErrorBadRequest | InvalidRequestError - /** - * NotFoundError - */ - 404: NotFoundError - /** - * SessionBusyError - */ - 409: SessionBusyError -} - -export type SessionUnrevertError = SessionUnrevertErrors[keyof SessionUnrevertErrors] - -export type SessionUnrevertResponses = { - /** - * Updated session - */ - 200: Session -} - -export type SessionUnrevertResponse = SessionUnrevertResponses[keyof SessionUnrevertResponses] - -export type PermissionRespondData = { - body?: { - response: "once" | "always" | "reject" - } - path: { - sessionID: string - permissionID: string - } - query?: { - directory?: string - workspace?: string - } - url: "/session/{sessionID}/permissions/{permissionID}" -} - -export type PermissionRespondErrors = { - /** - * BadRequest | InvalidRequestError - */ - 400: EffectHttpApiErrorBadRequest | InvalidRequestError - /** - * NotFoundError | PermissionNotFoundError - */ - 404: NotFoundError | PermissionNotFoundError -} - -export type PermissionRespondError = PermissionRespondErrors[keyof PermissionRespondErrors] - -export type PermissionRespondResponses = { - /** - * Permission processed successfully - */ - 200: boolean -} - -export type PermissionRespondResponse = PermissionRespondResponses[keyof PermissionRespondResponses] - -export type PartDeleteData = { - body?: never - path: { - sessionID: string - messageID: string - partID: string - } - query?: { - directory?: string - workspace?: string - } - url: "/session/{sessionID}/message/{messageID}/part/{partID}" -} - -export type PartDeleteErrors = { - /** - * BadRequest | InvalidRequestError - */ - 400: EffectHttpApiErrorBadRequest | InvalidRequestError - /** - * NotFoundError - */ - 404: NotFoundError -} - -export type PartDeleteError = PartDeleteErrors[keyof PartDeleteErrors] - -export type PartDeleteResponses = { - /** - * Successfully deleted part - */ - 200: boolean -} - -export type PartDeleteResponse = PartDeleteResponses[keyof PartDeleteResponses] - -export type PartUpdateData = { - body?: Part - path: { - sessionID: string - messageID: string - partID: string - } - query?: { - directory?: string - workspace?: string - } - url: "/session/{sessionID}/message/{messageID}/part/{partID}" -} - -export type PartUpdateErrors = { - /** - * BadRequest | InvalidRequestError - */ - 400: EffectHttpApiErrorBadRequest | InvalidRequestError - /** - * NotFoundError - */ - 404: NotFoundError -} - -export type PartUpdateError = PartUpdateErrors[keyof PartUpdateErrors] - -export type PartUpdateResponses = { - /** - * Successfully updated part - */ - 200: Part -} - -export type PartUpdateResponse = PartUpdateResponses[keyof PartUpdateResponses] - -export type SyncStartData = { - body?: never - path?: never - query?: { - directory?: string - workspace?: string - } - url: "/sync/start" -} - -export type SyncStartErrors = { - /** - * Bad request - */ - 400: BadRequestError -} - -export type SyncStartError = SyncStartErrors[keyof SyncStartErrors] - -export type SyncStartResponses = { - /** - * Workspace sync started - */ - 200: boolean -} - -export type SyncStartResponse = SyncStartResponses[keyof SyncStartResponses] - -export type SyncReplayData = { - body?: { - directory: string - events: Array<{ - id: string - aggregateID: string - seq: number - type: string - data: { - [key: string]: unknown - } - }> - } - path?: never - query?: { - directory?: string - workspace?: string - } - url: "/sync/replay" -} - -export type SyncReplayErrors = { - /** - * BadRequest | InvalidRequestError - */ - 400: EffectHttpApiErrorBadRequest | InvalidRequestError -} - -export type SyncReplayError = SyncReplayErrors[keyof SyncReplayErrors] - -export type SyncReplayResponses = { - /** - * Replayed sync events - */ - 200: { - sessionID: string - } -} - -export type SyncReplayResponse = SyncReplayResponses[keyof SyncReplayResponses] - -export type SyncStealData = { - body?: { - sessionID: string - } - path?: never - query?: { - directory?: string - workspace?: string - } - url: "/sync/steal" -} - -export type SyncStealErrors = { - /** - * BadRequest | InvalidRequestError - */ - 400: EffectHttpApiErrorBadRequest | InvalidRequestError -} - -export type SyncStealError = SyncStealErrors[keyof SyncStealErrors] - -export type SyncStealResponses = { - /** - * Session stolen into workspace - */ - 200: { - sessionID: string - } -} - -export type SyncStealResponse = SyncStealResponses[keyof SyncStealResponses] - -export type SyncHistoryListData = { - body?: { - [key: string]: number - } - path?: never - query?: { - directory?: string - workspace?: string - } - url: "/sync/history" -} - -export type SyncHistoryListErrors = { - /** - * BadRequest | InvalidRequestError - */ - 400: EffectHttpApiErrorBadRequest | InvalidRequestError -} - -export type SyncHistoryListError = SyncHistoryListErrors[keyof SyncHistoryListErrors] - -export type SyncHistoryListResponses = { - /** - * Sync events - */ - 200: Array<{ - id: string - aggregate_id: string - seq: number - type: string - data: { - [key: string]: unknown - } - }> -} - -export type SyncHistoryListResponse = SyncHistoryListResponses[keyof SyncHistoryListResponses] - -export type TuiAppendPromptData = { - body?: { - text: string - } - path?: never - query?: { - directory?: string - workspace?: string - } - url: "/tui/append-prompt" -} - -export type TuiAppendPromptErrors = { - /** - * BadRequest | InvalidRequestError - */ - 400: EffectHttpApiErrorBadRequest | InvalidRequestError -} - -export type TuiAppendPromptError = TuiAppendPromptErrors[keyof TuiAppendPromptErrors] - -export type TuiAppendPromptResponses = { - /** - * Prompt processed successfully - */ - 200: boolean -} - -export type TuiAppendPromptResponse = TuiAppendPromptResponses[keyof TuiAppendPromptResponses] - -export type TuiOpenHelpData = { - body?: never - path?: never - query?: { - directory?: string - workspace?: string - } - url: "/tui/open-help" -} - -export type TuiOpenHelpErrors = { - /** - * Bad request - */ - 400: BadRequestError -} - -export type TuiOpenHelpError = TuiOpenHelpErrors[keyof TuiOpenHelpErrors] - -export type TuiOpenHelpResponses = { - /** - * Help dialog opened successfully - */ - 200: boolean -} - -export type TuiOpenHelpResponse = TuiOpenHelpResponses[keyof TuiOpenHelpResponses] - -export type TuiOpenSessionsData = { - body?: never - path?: never - query?: { - directory?: string - workspace?: string - } - url: "/tui/open-sessions" -} - -export type TuiOpenSessionsErrors = { - /** - * Bad request - */ - 400: BadRequestError -} - -export type TuiOpenSessionsError = TuiOpenSessionsErrors[keyof TuiOpenSessionsErrors] - -export type TuiOpenSessionsResponses = { - /** - * Session dialog opened successfully - */ - 200: boolean -} - -export type TuiOpenSessionsResponse = TuiOpenSessionsResponses[keyof TuiOpenSessionsResponses] - -export type TuiOpenThemesData = { - body?: never - path?: never - query?: { - directory?: string - workspace?: string - } - url: "/tui/open-themes" -} - -export type TuiOpenThemesErrors = { - /** - * Bad request - */ - 400: BadRequestError -} - -export type TuiOpenThemesError = TuiOpenThemesErrors[keyof TuiOpenThemesErrors] - -export type TuiOpenThemesResponses = { - /** - * Theme dialog opened successfully - */ - 200: boolean -} - -export type TuiOpenThemesResponse = TuiOpenThemesResponses[keyof TuiOpenThemesResponses] - -export type TuiOpenModelsData = { - body?: never - path?: never - query?: { - directory?: string - workspace?: string - } - url: "/tui/open-models" -} - -export type TuiOpenModelsErrors = { - /** - * Bad request - */ - 400: BadRequestError -} - -export type TuiOpenModelsError = TuiOpenModelsErrors[keyof TuiOpenModelsErrors] - -export type TuiOpenModelsResponses = { - /** - * Model dialog opened successfully - */ - 200: boolean -} - -export type TuiOpenModelsResponse = TuiOpenModelsResponses[keyof TuiOpenModelsResponses] - -export type TuiSubmitPromptData = { - body?: never - path?: never - query?: { - directory?: string - workspace?: string - } - url: "/tui/submit-prompt" -} - -export type TuiSubmitPromptErrors = { - /** - * Bad request - */ - 400: BadRequestError -} - -export type TuiSubmitPromptError = TuiSubmitPromptErrors[keyof TuiSubmitPromptErrors] - -export type TuiSubmitPromptResponses = { - /** - * Prompt submitted successfully - */ - 200: boolean -} - -export type TuiSubmitPromptResponse = TuiSubmitPromptResponses[keyof TuiSubmitPromptResponses] - -export type TuiClearPromptData = { - body?: never - path?: never - query?: { - directory?: string - workspace?: string - } - url: "/tui/clear-prompt" -} - -export type TuiClearPromptErrors = { - /** - * Bad request - */ - 400: BadRequestError -} - -export type TuiClearPromptError = TuiClearPromptErrors[keyof TuiClearPromptErrors] - -export type TuiClearPromptResponses = { - /** - * Prompt cleared successfully - */ - 200: boolean -} - -export type TuiClearPromptResponse = TuiClearPromptResponses[keyof TuiClearPromptResponses] - -export type TuiExecuteCommandData = { - body?: { - command: string - } - path?: never - query?: { - directory?: string - workspace?: string - } - url: "/tui/execute-command" -} - -export type TuiExecuteCommandErrors = { - /** - * BadRequest | InvalidRequestError - */ - 400: EffectHttpApiErrorBadRequest | InvalidRequestError -} - -export type TuiExecuteCommandError = TuiExecuteCommandErrors[keyof TuiExecuteCommandErrors] - -export type TuiExecuteCommandResponses = { - /** - * Command executed successfully - */ - 200: boolean -} - -export type TuiExecuteCommandResponse = TuiExecuteCommandResponses[keyof TuiExecuteCommandResponses] - -export type TuiShowToastData = { - body?: { - title?: string - message: string - variant: "info" | "success" | "warning" | "error" - duration?: number - } - path?: never - query?: { - directory?: string - workspace?: string - } - url: "/tui/show-toast" -} - -export type TuiShowToastErrors = { - /** - * Bad request - */ - 400: BadRequestError -} - -export type TuiShowToastError = TuiShowToastErrors[keyof TuiShowToastErrors] - -export type TuiShowToastResponses = { - /** - * Toast notification shown successfully - */ - 200: boolean -} - -export type TuiShowToastResponse = TuiShowToastResponses[keyof TuiShowToastResponses] - -export type TuiPublishData = { - body?: EventTuiPromptAppend | EventTuiCommandExecute | EventTuiToastShow | EventTuiSessionSelect - path?: never - query?: { - directory?: string - workspace?: string - } - url: "/tui/publish" -} - -export type TuiPublishErrors = { - /** - * BadRequest | InvalidRequestError - */ - 400: EffectHttpApiErrorBadRequest | InvalidRequestError -} - -export type TuiPublishError = TuiPublishErrors[keyof TuiPublishErrors] - -export type TuiPublishResponses = { - /** - * Event published successfully - */ - 200: boolean -} - -export type TuiPublishResponse = TuiPublishResponses[keyof TuiPublishResponses] - -export type TuiSelectSessionData = { - body?: { - /** - * Session ID to navigate to - */ - sessionID: string - } - path?: never - query?: { - directory?: string - workspace?: string - } - url: "/tui/select-session" -} - -export type TuiSelectSessionErrors = { - /** - * BadRequest | InvalidRequestError - */ - 400: EffectHttpApiErrorBadRequest | InvalidRequestError - /** - * NotFoundError - */ - 404: NotFoundError -} - -export type TuiSelectSessionError = TuiSelectSessionErrors[keyof TuiSelectSessionErrors] - -export type TuiSelectSessionResponses = { - /** - * Session selected successfully - */ - 200: boolean -} - -export type TuiSelectSessionResponse = TuiSelectSessionResponses[keyof TuiSelectSessionResponses] - -export type TuiControlNextData = { - body?: never - path?: never - query?: { - directory?: string - workspace?: string - } - url: "/tui/control/next" -} - -export type TuiControlNextErrors = { - /** - * Bad request - */ - 400: BadRequestError -} - -export type TuiControlNextError = TuiControlNextErrors[keyof TuiControlNextErrors] - -export type TuiControlNextResponses = { - /** - * Next TUI request - */ - 200: { - path: string - body: unknown - } -} - -export type TuiControlNextResponse = TuiControlNextResponses[keyof TuiControlNextResponses] - -export type TuiControlResponseData = { - body?: unknown - path?: never - query?: { - directory?: string - workspace?: string - } - url: "/tui/control/response" -} - -export type TuiControlResponseErrors = { - /** - * Bad request - */ - 400: BadRequestError -} - -export type TuiControlResponseError = TuiControlResponseErrors[keyof TuiControlResponseErrors] - -export type TuiControlResponseResponses = { - /** - * Response submitted successfully - */ - 200: boolean -} - -export type TuiControlResponseResponse = TuiControlResponseResponses[keyof TuiControlResponseResponses] - -export type ExperimentalWorkspaceAdapterListData = { - body?: never - path?: never - query?: { - directory?: string - workspace?: string - } - url: "/experimental/workspace/adapter" -} - -export type ExperimentalWorkspaceAdapterListErrors = { - /** - * Bad request - */ - 400: BadRequestError -} - -export type ExperimentalWorkspaceAdapterListError = - ExperimentalWorkspaceAdapterListErrors[keyof ExperimentalWorkspaceAdapterListErrors] - -export type ExperimentalWorkspaceAdapterListResponses = { - /** - * Workspace adapters - */ - 200: Array<{ - type: string - name: string - description: string - }> -} - -export type ExperimentalWorkspaceAdapterListResponse = - ExperimentalWorkspaceAdapterListResponses[keyof ExperimentalWorkspaceAdapterListResponses] - -export type ExperimentalWorkspaceListData = { - body?: never - path?: never - query?: { - directory?: string - workspace?: string - } - url: "/experimental/workspace" -} - -export type ExperimentalWorkspaceListErrors = { - /** - * Bad request - */ - 400: BadRequestError -} - -export type ExperimentalWorkspaceListError = ExperimentalWorkspaceListErrors[keyof ExperimentalWorkspaceListErrors] - -export type ExperimentalWorkspaceListResponses = { - /** - * Workspaces - */ - 200: Array -} - -export type ExperimentalWorkspaceListResponse = - ExperimentalWorkspaceListResponses[keyof ExperimentalWorkspaceListResponses] - -export type ExperimentalWorkspaceCreateData = { - body?: { - id?: string - type: string - branch?: string | null - extra?: unknown | null - } - path?: never - query?: { - directory?: string - workspace?: string - } - url: "/experimental/workspace" -} - -export type ExperimentalWorkspaceCreateErrors = { - /** - * WorkspaceCreateError | BadRequest | InvalidRequestError - */ - 400: WorkspaceCreateError | EffectHttpApiErrorBadRequest | InvalidRequestError -} - -export type ExperimentalWorkspaceCreateError = - ExperimentalWorkspaceCreateErrors[keyof ExperimentalWorkspaceCreateErrors] - -export type ExperimentalWorkspaceCreateResponses = { - /** - * Workspace created - */ - 200: Workspace -} - -export type ExperimentalWorkspaceCreateResponse = - ExperimentalWorkspaceCreateResponses[keyof ExperimentalWorkspaceCreateResponses] - -export type ExperimentalWorkspaceSyncListData = { - body?: never - path?: never - query?: { - directory?: string - workspace?: string - } - url: "/experimental/workspace/sync-list" -} - -export type ExperimentalWorkspaceSyncListErrors = { - /** - * Bad request - */ - 400: BadRequestError -} - -export type ExperimentalWorkspaceSyncListError = - ExperimentalWorkspaceSyncListErrors[keyof ExperimentalWorkspaceSyncListErrors] - -export type ExperimentalWorkspaceSyncListResponses = { - /** - * Workspace list synced - */ - 204: void -} - -export type ExperimentalWorkspaceSyncListResponse = - ExperimentalWorkspaceSyncListResponses[keyof ExperimentalWorkspaceSyncListResponses] - -export type ExperimentalWorkspaceStatusData = { - body?: never - path?: never - query?: { - directory?: string - workspace?: string - } - url: "/experimental/workspace/status" -} - -export type ExperimentalWorkspaceStatusErrors = { - /** - * Bad request - */ - 400: BadRequestError -} - -export type ExperimentalWorkspaceStatusError = - ExperimentalWorkspaceStatusErrors[keyof ExperimentalWorkspaceStatusErrors] - -export type ExperimentalWorkspaceStatusResponses = { - /** - * Workspace status - */ - 200: Array -} - -export type ExperimentalWorkspaceStatusResponse = - ExperimentalWorkspaceStatusResponses[keyof ExperimentalWorkspaceStatusResponses] - -export type ExperimentalWorkspaceRemoveData = { - body?: never - path: { - id: string - } - query?: { - directory?: string - workspace?: string - } - url: "/experimental/workspace/{id}" -} - -export type ExperimentalWorkspaceRemoveErrors = { - /** - * BadRequest | InvalidRequestError - */ - 400: EffectHttpApiErrorBadRequest | InvalidRequestError -} - -export type ExperimentalWorkspaceRemoveError = - ExperimentalWorkspaceRemoveErrors[keyof ExperimentalWorkspaceRemoveErrors] - -export type ExperimentalWorkspaceRemoveResponses = { - /** - * Workspace removed - */ - 200: Workspace -} - -export type ExperimentalWorkspaceRemoveResponse = - ExperimentalWorkspaceRemoveResponses[keyof ExperimentalWorkspaceRemoveResponses] - -export type ExperimentalWorkspaceWarpData = { - body?: { - id: string | null - sessionID: string - copyChanges?: boolean - } - path?: never - query?: { - directory?: string - workspace?: string - } - url: "/experimental/workspace/warp" -} - -export type ExperimentalWorkspaceWarpErrors = { - /** - * WorkspaceWarpError | VcsApplyError | InvalidRequestError - */ - 400: WorkspaceWarpError | VcsApplyError | InvalidRequestError - /** - * NotFoundError - */ - 404: NotFoundError -} - -export type ExperimentalWorkspaceWarpError = ExperimentalWorkspaceWarpErrors[keyof ExperimentalWorkspaceWarpErrors] - -export type ExperimentalWorkspaceWarpResponses = { - /** - * Session warped - */ - 204: void -} - -export type ExperimentalWorkspaceWarpResponse = - ExperimentalWorkspaceWarpResponses[keyof ExperimentalWorkspaceWarpResponses] - -export type V2HealthGetData = { - body?: never - path?: never - query?: never - url: "/api/health" -} - -export type V2HealthGetErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError -} - -export type V2HealthGetError = V2HealthGetErrors[keyof V2HealthGetErrors] - -export type V2HealthGetResponses = { - /** - * ServiceHealth - */ - 200: ServiceHealthV2 -} - -export type V2HealthGetResponse = V2HealthGetResponses[keyof V2HealthGetResponses] - -export type V2HealthStopData = { - body: ServiceStopRequest - path?: never - query?: never - url: "/api/service/stop" -} - -export type V2HealthStopErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError -} - -export type V2HealthStopError = V2HealthStopErrors[keyof V2HealthStopErrors] - -export type V2HealthStopResponses = { - /** - * ServiceStopResponse - */ - 200: ServiceStopResponse -} - -export type V2HealthStopResponse = V2HealthStopResponses[keyof V2HealthStopResponses] - -export type V2ServerGetData = { - body?: never - path?: never - query?: never - url: "/api/server" -} - -export type V2ServerGetErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError -} - -export type V2ServerGetError = V2ServerGetErrors[keyof V2ServerGetErrors] - -export type V2ServerGetResponses = { - /** - * Success - */ - 200: { - urls: Array - } -} - -export type V2ServerGetResponse = V2ServerGetResponses[keyof V2ServerGetResponses] - -export type V2LocationGetData = { - body?: never - path?: never - query?: { - location?: { - directory?: string | null - workspace?: string | null - } | null - } - url: "/api/location" -} - -export type V2LocationGetErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError -} - -export type V2LocationGetError = V2LocationGetErrors[keyof V2LocationGetErrors] - -export type V2LocationGetResponses = { - /** - * Location.Info - */ - 200: LocationInfoV2 -} - -export type V2LocationGetResponse = V2LocationGetResponses[keyof V2LocationGetResponses] - -export type V2AgentListData = { - body?: never - path?: never - query?: { - location?: { - directory?: string | null - workspace?: string | null - } | null - } - url: "/api/agent" -} - -export type V2AgentListErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError -} - -export type V2AgentListError = V2AgentListErrors[keyof V2AgentListErrors] - -export type V2AgentListResponses = { - /** - * Success - */ - 200: { - location: LocationInfoV2 - data: Array - } -} - -export type V2AgentListResponse = V2AgentListResponses[keyof V2AgentListResponses] - -export type V2PluginListData = { - body?: never - path?: never - query?: { - location?: { - directory?: string | null - workspace?: string | null - } | null - } - url: "/api/plugin" -} - -export type V2PluginListErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError -} - -export type V2PluginListError = V2PluginListErrors[keyof V2PluginListErrors] - -export type V2PluginListResponses = { - /** - * Success - */ - 200: { - location: LocationInfoV2 - data: Array - } -} - -export type V2PluginListResponse = V2PluginListResponses[keyof V2PluginListResponses] - -export type V2SessionListData = { - body?: never - path?: never - query?: { - workspace?: string | null - /** - * Maximum number of sessions to return. Defaults to the newest 50 sessions. - */ - limit?: number | null - /** - * Session order for the first page. Use desc for newest first or asc for oldest first. - */ - order?: "asc" | "desc" | null - search?: string | null - parentID?: string | "null" | null - directory?: string | null - project?: string | null - subpath?: string | null - cursor?: string | null - } - url: "/api/session" -} - -export type V2SessionListErrors = { - /** - * InvalidCursorError | InvalidRequestError - */ - 400: InvalidCursorError | InvalidRequestError1 | InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError -} - -export type V2SessionListError = V2SessionListErrors[keyof V2SessionListErrors] - -export type V2SessionListResponses = { - /** - * SessionsResponse - */ - 200: SessionsResponseV2 -} - -export type V2SessionListResponse = V2SessionListResponses[keyof V2SessionListResponses] - -export type V2SessionCreateData = { - body: { - id?: string | null - agent?: string | null - model?: ModelRef | null - location?: LocationRefV2 | null - } - path?: never - query?: never - url: "/api/session" -} - -export type V2SessionCreateErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError -} - -export type V2SessionCreateError = V2SessionCreateErrors[keyof V2SessionCreateErrors] - -export type V2SessionCreateResponses = { - /** - * Success - */ - 200: { - data: SessionInfoV2 - } -} - -export type V2SessionCreateResponse = V2SessionCreateResponses[keyof V2SessionCreateResponses] - -export type V2SessionActiveData = { - body?: never - path?: never - query?: never - url: "/api/session/active" -} - -export type V2SessionActiveErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError -} - -export type V2SessionActiveError = V2SessionActiveErrors[keyof V2SessionActiveErrors] - -export type V2SessionActiveResponses = { - /** - * Success - */ - 200: { - data: { - [key: string]: unknown | SessionActive - } - } -} - -export type V2SessionActiveResponse = V2SessionActiveResponses[keyof V2SessionActiveResponses] - -export type V2SessionRemoveData = { - body?: never - path: { - sessionID: string - } - query?: never - url: "/api/session/{sessionID}" -} - -export type V2SessionRemoveErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError - /** - * SessionNotFoundError - */ - 404: SessionNotFoundError -} - -export type V2SessionRemoveError = V2SessionRemoveErrors[keyof V2SessionRemoveErrors] - -export type V2SessionRemoveResponses = { - /** - * - */ - 204: void -} - -export type V2SessionRemoveResponse = V2SessionRemoveResponses[keyof V2SessionRemoveResponses] - -export type V2SessionGetData = { - body?: never - path: { - sessionID: string - } - query?: never - url: "/api/session/{sessionID}" -} - -export type V2SessionGetErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError - /** - * SessionNotFoundError - */ - 404: SessionNotFoundError -} - -export type V2SessionGetError = V2SessionGetErrors[keyof V2SessionGetErrors] - -export type V2SessionGetResponses = { - /** - * Success - */ - 200: { - data: SessionInfoV2 - } -} - -export type V2SessionGetResponse = V2SessionGetResponses[keyof V2SessionGetResponses] - -export type V2SessionForkData = { - body: { - messageID?: string | null - } - path: { - sessionID: string - } - query?: never - url: "/api/session/{sessionID}/fork" -} - -export type V2SessionForkErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError - /** - * SessionNotFoundError | MessageNotFoundError - */ - 404: MessageNotFoundError | SessionNotFoundError -} - -export type V2SessionForkError = V2SessionForkErrors[keyof V2SessionForkErrors] - -export type V2SessionForkResponses = { - /** - * Success - */ - 200: { - data: SessionInfoV2 - } -} - -export type V2SessionForkResponse = V2SessionForkResponses[keyof V2SessionForkResponses] - -export type V2SessionSwitchAgentData = { - body: { - agent: string - } - path: { - sessionID: string - } - query?: never - url: "/api/session/{sessionID}/agent" -} - -export type V2SessionSwitchAgentErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError - /** - * SessionNotFoundError - */ - 404: SessionNotFoundError -} - -export type V2SessionSwitchAgentError = V2SessionSwitchAgentErrors[keyof V2SessionSwitchAgentErrors] - -export type V2SessionSwitchAgentResponses = { - /** - * - */ - 204: void -} - -export type V2SessionSwitchAgentResponse = V2SessionSwitchAgentResponses[keyof V2SessionSwitchAgentResponses] - -export type V2SessionSwitchModelData = { - body: { - model: ModelRef - } - path: { - sessionID: string - } - query?: never - url: "/api/session/{sessionID}/model" -} - -export type V2SessionSwitchModelErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError - /** - * SessionNotFoundError - */ - 404: SessionNotFoundError -} - -export type V2SessionSwitchModelError = V2SessionSwitchModelErrors[keyof V2SessionSwitchModelErrors] - -export type V2SessionSwitchModelResponses = { - /** - * - */ - 204: void -} - -export type V2SessionSwitchModelResponse = V2SessionSwitchModelResponses[keyof V2SessionSwitchModelResponses] - -export type V2SessionRenameData = { - body: { - title: string - } - path: { - sessionID: string - } - query?: never - url: "/api/session/{sessionID}/rename" -} - -export type V2SessionRenameErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError - /** - * SessionNotFoundError - */ - 404: SessionNotFoundError -} - -export type V2SessionRenameError = V2SessionRenameErrors[keyof V2SessionRenameErrors] - -export type V2SessionRenameResponses = { - /** - * - */ - 204: void -} - -export type V2SessionRenameResponse = V2SessionRenameResponses[keyof V2SessionRenameResponses] - -export type V2SessionMoveData = { - body: LocationRefV2 - path: { - sessionID: string - } - query?: never - url: "/api/session/{sessionID}/move" -} - -export type V2SessionMoveErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestError1 | InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError - /** - * SessionNotFoundError - */ - 404: SessionNotFoundError -} - -export type V2SessionMoveError = V2SessionMoveErrors[keyof V2SessionMoveErrors] - -export type V2SessionMoveResponses = { - /** - * - */ - 204: void -} - -export type V2SessionMoveResponse = V2SessionMoveResponses[keyof V2SessionMoveResponses] - -export type V2SessionPromptData = { - body: { - id?: string | null - text: string - files?: Array - agents?: Array - metadata?: { - [key: string]: unknown - } - delivery?: "steer" | "queue" | null - resume?: boolean | null - } - path: { - sessionID: string - } - query?: never - url: "/api/session/{sessionID}/prompt" -} - -export type V2SessionPromptErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestError1 | InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError - /** - * SessionNotFoundError - */ - 404: SessionNotFoundError - /** - * ConflictError - */ - 409: ConflictErrorV2 -} - -export type V2SessionPromptError = V2SessionPromptErrors[keyof V2SessionPromptErrors] - -export type V2SessionPromptResponses = { - /** - * Success - */ - 200: { - data: SessionPendingUserV2 - } -} - -export type V2SessionPromptResponse = V2SessionPromptResponses[keyof V2SessionPromptResponses] - -export type V2SessionCommandData = { - body: { - id?: string | null - command: string - arguments?: string | null - agent?: string | null - model?: ModelRef | null - files?: Array - agents?: Array - delivery?: "steer" | "queue" | null - resume?: boolean | null - } - path: { - sessionID: string - } - query?: never - url: "/api/session/{sessionID}/command" -} - -export type V2SessionCommandErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestError1 | InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError - /** - * SessionNotFoundError | CommandNotFoundError - */ - 404: CommandNotFoundError | SessionNotFoundError - /** - * ConflictError - */ - 409: ConflictErrorV2 - /** - * CommandEvaluationError - */ - 500: CommandEvaluationError -} - -export type V2SessionCommandError = V2SessionCommandErrors[keyof V2SessionCommandErrors] - -export type V2SessionCommandResponses = { - /** - * Success - */ - 200: { - data: SessionPendingUserV2 - } -} - -export type V2SessionCommandResponse = V2SessionCommandResponses[keyof V2SessionCommandResponses] - -export type V2SessionSkillData = { - body: { - id?: string | null - skill: string - resume?: boolean | null - } - path: { - sessionID: string - } - query?: never - url: "/api/session/{sessionID}/skill" -} - -export type V2SessionSkillErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError - /** - * SessionNotFoundError | SkillNotFoundError - */ - 404: SkillNotFoundError | SessionNotFoundError -} - -export type V2SessionSkillError = V2SessionSkillErrors[keyof V2SessionSkillErrors] - -export type V2SessionSkillResponses = { - /** - * - */ - 204: void -} - -export type V2SessionSkillResponse = V2SessionSkillResponses[keyof V2SessionSkillResponses] - -export type V2SessionSyntheticData = { - body: { - id?: string | null - text: string - description?: string | null - metadata?: { - [key: string]: unknown - } - delivery?: "steer" | "queue" | null - resume?: boolean | null - } - path: { - sessionID: string - } - query?: never - url: "/api/session/{sessionID}/synthetic" -} - -export type V2SessionSyntheticErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError - /** - * SessionNotFoundError - */ - 404: SessionNotFoundError - /** - * ConflictError - */ - 409: ConflictErrorV2 -} - -export type V2SessionSyntheticError = V2SessionSyntheticErrors[keyof V2SessionSyntheticErrors] - -export type V2SessionSyntheticResponses = { - /** - * Success - */ - 200: { - data: SessionPendingSyntheticV2 - } -} - -export type V2SessionSyntheticResponse = V2SessionSyntheticResponses[keyof V2SessionSyntheticResponses] - -export type V2SessionShellData = { - body: { - id?: string | null - command: string - } - path: { - sessionID: string - } - query?: never - url: "/api/session/{sessionID}/shell" -} - -export type V2SessionShellErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError - /** - * SessionNotFoundError - */ - 404: SessionNotFoundError -} - -export type V2SessionShellError = V2SessionShellErrors[keyof V2SessionShellErrors] - -export type V2SessionShellResponses = { - /** - * - */ - 204: void -} - -export type V2SessionShellResponse = V2SessionShellResponses[keyof V2SessionShellResponses] - -export type V2SessionCompactData = { - body: { - id?: string | null - } - path: { - sessionID: string - } - query?: never - url: "/api/session/{sessionID}/compact" -} - -export type V2SessionCompactErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError - /** - * SessionNotFoundError - */ - 404: SessionNotFoundError - /** - * ConflictError - */ - 409: ConflictErrorV2 -} - -export type V2SessionCompactError = V2SessionCompactErrors[keyof V2SessionCompactErrors] - -export type V2SessionCompactResponses = { - /** - * Success - */ - 200: { - data: SessionPendingCompactionV2 - } -} - -export type V2SessionCompactResponse = V2SessionCompactResponses[keyof V2SessionCompactResponses] - -export type V2SessionWaitData = { - body?: never - path: { - sessionID: string - } - query?: never - url: "/api/session/{sessionID}/wait" -} - -export type V2SessionWaitErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError - /** - * SessionNotFoundError - */ - 404: SessionNotFoundError - /** - * ServiceUnavailableError - */ - 503: ServiceUnavailableErrorV2 -} - -export type V2SessionWaitError = V2SessionWaitErrors[keyof V2SessionWaitErrors] - -export type V2SessionWaitResponses = { - /** - * - */ - 204: void -} - -export type V2SessionWaitResponse = V2SessionWaitResponses[keyof V2SessionWaitResponses] - -export type V2SessionRevertStageData = { - body: { - messageID: string - files?: boolean | null - } - path: { - sessionID: string - } - query?: never - url: "/api/session/{sessionID}/revert/stage" -} - -export type V2SessionRevertStageErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError - /** - * MessageNotFoundError | SessionNotFoundError - */ - 404: MessageNotFoundError | SessionNotFoundError - /** - * SessionBusyError - */ - 409: SessionBusyError - /** - * UnknownError - */ - 500: UnknownErrorV2 -} - -export type V2SessionRevertStageError = V2SessionRevertStageErrors[keyof V2SessionRevertStageErrors] - -export type V2SessionRevertStageResponses = { - /** - * Success - */ - 200: { - data: SessionRevertV2 - } -} - -export type V2SessionRevertStageResponse = V2SessionRevertStageResponses[keyof V2SessionRevertStageResponses] - -export type V2SessionRevertClearData = { - body?: never - path: { - sessionID: string - } - query?: never - url: "/api/session/{sessionID}/revert/clear" -} - -export type V2SessionRevertClearErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError - /** - * SessionNotFoundError - */ - 404: SessionNotFoundError - /** - * SessionBusyError - */ - 409: SessionBusyError - /** - * UnknownError - */ - 500: UnknownErrorV2 -} - -export type V2SessionRevertClearError = V2SessionRevertClearErrors[keyof V2SessionRevertClearErrors] - -export type V2SessionRevertClearResponses = { - /** - * - */ - 204: void -} - -export type V2SessionRevertClearResponse = V2SessionRevertClearResponses[keyof V2SessionRevertClearResponses] - -export type V2SessionRevertCommitData = { - body?: never - path: { - sessionID: string - } - query?: never - url: "/api/session/{sessionID}/revert/commit" -} - -export type V2SessionRevertCommitErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError - /** - * SessionNotFoundError - */ - 404: SessionNotFoundError - /** - * SessionBusyError - */ - 409: SessionBusyError -} - -export type V2SessionRevertCommitError = V2SessionRevertCommitErrors[keyof V2SessionRevertCommitErrors] - -export type V2SessionRevertCommitResponses = { - /** - * - */ - 204: void -} - -export type V2SessionRevertCommitResponse = V2SessionRevertCommitResponses[keyof V2SessionRevertCommitResponses] - -export type V2SessionContextData = { - body?: never - path: { - sessionID: string - } - query?: never - url: "/api/session/{sessionID}/context" -} - -export type V2SessionContextErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError - /** - * SessionNotFoundError - */ - 404: SessionNotFoundError - /** - * UnknownError - */ - 500: UnknownErrorV2 -} - -export type V2SessionContextError = V2SessionContextErrors[keyof V2SessionContextErrors] - -export type V2SessionContextResponses = { - /** - * Success - */ - 200: { - data: Array - } -} - -export type V2SessionContextResponse = V2SessionContextResponses[keyof V2SessionContextResponses] - -export type V2SessionPendingListData = { - body?: never - path: { - sessionID: string - } - query?: never - url: "/api/session/{sessionID}/pending" -} - -export type V2SessionPendingListErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError - /** - * SessionNotFoundError - */ - 404: SessionNotFoundError -} - -export type V2SessionPendingListError = V2SessionPendingListErrors[keyof V2SessionPendingListErrors] - -export type V2SessionPendingListResponses = { - /** - * Success - */ - 200: { - data: Array - } -} - -export type V2SessionPendingListResponse = V2SessionPendingListResponses[keyof V2SessionPendingListResponses] - -export type V2SessionInstructionsEntryListData = { - body?: never - path: { - sessionID: string - } - query?: never - url: "/api/session/{sessionID}/instructions/entries" -} - -export type V2SessionInstructionsEntryListErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError - /** - * SessionNotFoundError - */ - 404: SessionNotFoundError -} - -export type V2SessionInstructionsEntryListError = - V2SessionInstructionsEntryListErrors[keyof V2SessionInstructionsEntryListErrors] - -export type V2SessionInstructionsEntryListResponses = { - /** - * Success - */ - 200: { - data: Array - } -} - -export type V2SessionInstructionsEntryListResponse = - V2SessionInstructionsEntryListResponses[keyof V2SessionInstructionsEntryListResponses] - -export type V2SessionInstructionsEntryRemoveData = { - body?: never - path: { - sessionID: string - key: InstructionEntryKeyV2 - } - query?: never - url: "/api/session/{sessionID}/instructions/entries/{key}" -} - -export type V2SessionInstructionsEntryRemoveErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError - /** - * SessionNotFoundError - */ - 404: SessionNotFoundError -} - -export type V2SessionInstructionsEntryRemoveError = - V2SessionInstructionsEntryRemoveErrors[keyof V2SessionInstructionsEntryRemoveErrors] - -export type V2SessionInstructionsEntryRemoveResponses = { - /** - * - */ - 204: void -} - -export type V2SessionInstructionsEntryRemoveResponse = - V2SessionInstructionsEntryRemoveResponses[keyof V2SessionInstructionsEntryRemoveResponses] - -export type V2SessionInstructionsEntryPutData = { - body: { - value: unknown - } - path: { - sessionID: string - key: InstructionEntryKeyV2 - } - query?: never - url: "/api/session/{sessionID}/instructions/entries/{key}" -} - -export type V2SessionInstructionsEntryPutErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError - /** - * SessionNotFoundError - */ - 404: SessionNotFoundError - /** - * InstructionEntryValueTooLargeError - */ - 413: InstructionEntryValueTooLargeError -} - -export type V2SessionInstructionsEntryPutError = - V2SessionInstructionsEntryPutErrors[keyof V2SessionInstructionsEntryPutErrors] - -export type V2SessionInstructionsEntryPutResponses = { - /** - * - */ - 204: void -} - -export type V2SessionInstructionsEntryPutResponse = - V2SessionInstructionsEntryPutResponses[keyof V2SessionInstructionsEntryPutResponses] - -export type V2SessionGenerateData = { - body: { - prompt: string - } - path: { - sessionID: string - } - query?: never - url: "/api/session/{sessionID}/generate" -} - -export type V2SessionGenerateErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError - /** - * SessionNotFoundError - */ - 404: SessionNotFoundError - /** - * ServiceUnavailableError - */ - 503: ServiceUnavailableErrorV2 -} - -export type V2SessionGenerateError = V2SessionGenerateErrors[keyof V2SessionGenerateErrors] - -export type V2SessionGenerateResponses = { - /** - * SessionGenerateResponse - */ - 200: SessionGenerateResponse -} - -export type V2SessionGenerateResponse = V2SessionGenerateResponses[keyof V2SessionGenerateResponses] - -export type V2SessionLogData = { - body?: never - path: { - sessionID: string - } - query?: { - after?: number | null - follow?: "true" | "false" | null - } - url: "/api/experimental/session/{sessionID}/log" -} - -export type V2SessionLogErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError - /** - * SessionNotFoundError - */ - 404: SessionNotFoundError -} - -export type V2SessionLogError = V2SessionLogErrors[keyof V2SessionLogErrors] - -export type V2SessionLogResponses = { - /** - * Success - */ - 200: { - id: string | null - event: string - data: SessionLogItemJsonString - } -} - -export type V2SessionLogResponse = V2SessionLogResponses[keyof V2SessionLogResponses] - -export type V2SessionInterruptData = { - body?: never - path: { - sessionID: string - } - query?: never - url: "/api/session/{sessionID}/interrupt" -} - -export type V2SessionInterruptErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError - /** - * SessionNotFoundError - */ - 404: SessionNotFoundError -} - -export type V2SessionInterruptError = V2SessionInterruptErrors[keyof V2SessionInterruptErrors] - -export type V2SessionInterruptResponses = { - /** - * - */ - 204: void -} - -export type V2SessionInterruptResponse = V2SessionInterruptResponses[keyof V2SessionInterruptResponses] - -export type V2SessionBackgroundData = { - body?: never - path: { - sessionID: string - } - query?: never - url: "/api/session/{sessionID}/background" -} - -export type V2SessionBackgroundErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError - /** - * SessionNotFoundError - */ - 404: SessionNotFoundError -} - -export type V2SessionBackgroundError = V2SessionBackgroundErrors[keyof V2SessionBackgroundErrors] - -export type V2SessionBackgroundResponses = { - /** - * - */ - 204: void -} - -export type V2SessionBackgroundResponse = V2SessionBackgroundResponses[keyof V2SessionBackgroundResponses] - -export type V2SessionMessageData = { - body?: never - path: { - sessionID: string - messageID: string - } - query?: never - url: "/api/session/{sessionID}/message/{messageID}" -} - -export type V2SessionMessageErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError - /** - * SessionNotFoundError | MessageNotFoundError - */ - 404: MessageNotFoundError | SessionNotFoundError -} - -export type V2SessionMessageError = V2SessionMessageErrors[keyof V2SessionMessageErrors] - -export type V2SessionMessageResponses = { - /** - * Success - */ - 200: { - data: SessionMessageInfo - } -} - -export type V2SessionMessageResponse = V2SessionMessageResponses[keyof V2SessionMessageResponses] - -export type V2MessageListData = { - body?: never - path: { - sessionID: string - } - query?: { - /** - * Maximum number of messages to return. When omitted, the endpoint returns its default page size. - */ - limit?: number | null - /** - * Message order for the first page. Use desc for newest first or asc for oldest first. - */ - order?: "asc" | "desc" | null - cursor?: string | null - } - url: "/api/session/{sessionID}/message" -} - -export type V2MessageListErrors = { - /** - * InvalidCursorError | InvalidRequestError - */ - 400: InvalidCursorError | InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError - /** - * SessionNotFoundError - */ - 404: SessionNotFoundError - /** - * UnknownError - */ - 500: UnknownErrorV2 -} - -export type V2MessageListError = V2MessageListErrors[keyof V2MessageListErrors] - -export type V2MessageListResponses = { - /** - * SessionMessagesResponse - */ - 200: SessionMessagesResponseV2 -} - -export type V2MessageListResponse = V2MessageListResponses[keyof V2MessageListResponses] - -export type V2ModelListData = { - body?: never - path?: never - query?: { - location?: { - directory?: string | null - workspace?: string | null - } | null - } - url: "/api/model" -} - -export type V2ModelListErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError - /** - * ServiceUnavailableError - */ - 503: ServiceUnavailableErrorV2 -} - -export type V2ModelListError = V2ModelListErrors[keyof V2ModelListErrors] - -export type V2ModelListResponses = { - /** - * Success - */ - 200: { - location: LocationInfoV2 - data: Array - } -} - -export type V2ModelListResponse = V2ModelListResponses[keyof V2ModelListResponses] - -export type V2ModelDefaultData = { - body?: never - path?: never - query?: { - location?: { - directory?: string | null - workspace?: string | null - } | null - } - url: "/api/model/default" -} - -export type V2ModelDefaultErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError - /** - * ServiceUnavailableError - */ - 503: ServiceUnavailableErrorV2 -} - -export type V2ModelDefaultError = V2ModelDefaultErrors[keyof V2ModelDefaultErrors] - -export type V2ModelDefaultResponses = { - /** - * Success - */ - 200: { - location: LocationInfoV2 - data: ModelInfo | null - } -} - -export type V2ModelDefaultResponse = V2ModelDefaultResponses[keyof V2ModelDefaultResponses] - -export type V2GenerateTextData = { - body: { - prompt: string - model?: ModelRef | null - } - path?: never - query?: { - location?: { - directory?: string | null - workspace?: string | null - } | null - } - url: "/api/generate" -} - -export type V2GenerateTextErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestError1 | InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError - /** - * ServiceUnavailableError - */ - 503: ServiceUnavailableErrorV2 -} - -export type V2GenerateTextError = V2GenerateTextErrors[keyof V2GenerateTextErrors] - -export type V2GenerateTextResponses = { - /** - * GenerateTextResponse - */ - 200: GenerateTextResponse -} - -export type V2GenerateTextResponse = V2GenerateTextResponses[keyof V2GenerateTextResponses] - -export type V2ProviderListData = { - body?: never - path?: never - query?: { - location?: { - directory?: string | null - workspace?: string | null - } | null - } - url: "/api/provider" -} - -export type V2ProviderListErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError - /** - * ServiceUnavailableError - */ - 503: ServiceUnavailableErrorV2 -} - -export type V2ProviderListError = V2ProviderListErrors[keyof V2ProviderListErrors] - -export type V2ProviderListResponses = { - /** - * Success - */ - 200: { - location: LocationInfoV2 - data: Array - } -} - -export type V2ProviderListResponse = V2ProviderListResponses[keyof V2ProviderListResponses] - -export type V2ProviderGetData = { - body?: never - path: { - providerID: string - } - query?: { - location?: { - directory?: string | null - workspace?: string | null - } | null - } - url: "/api/provider/{providerID}" -} - -export type V2ProviderGetErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError - /** - * ProviderNotFoundError - */ - 404: ProviderNotFoundError - /** - * ServiceUnavailableError - */ - 503: ServiceUnavailableErrorV2 -} - -export type V2ProviderGetError = V2ProviderGetErrors[keyof V2ProviderGetErrors] - -export type V2ProviderGetResponses = { - /** - * Success - */ - 200: { - location: LocationInfoV2 - data: ProviderV2Info - } -} - -export type V2ProviderGetResponse = V2ProviderGetResponses[keyof V2ProviderGetResponses] - -export type V2IntegrationListData = { - body?: never - path?: never - query?: { - location?: { - directory?: string | null - workspace?: string | null - } | null - } - url: "/api/integration" -} - -export type V2IntegrationListErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError -} - -export type V2IntegrationListError = V2IntegrationListErrors[keyof V2IntegrationListErrors] - -export type V2IntegrationListResponses = { - /** - * Success - */ - 200: { - location: LocationInfoV2 - data: Array - } -} - -export type V2IntegrationListResponse = V2IntegrationListResponses[keyof V2IntegrationListResponses] - -export type V2IntegrationGetData = { - body?: never - path: { - integrationID: string - } - query?: { - location?: { - directory?: string | null - workspace?: string | null - } | null - } - url: "/api/integration/{integrationID}" -} - -export type V2IntegrationGetErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError -} - -export type V2IntegrationGetError = V2IntegrationGetErrors[keyof V2IntegrationGetErrors] - -export type V2IntegrationGetResponses = { - /** - * Success - */ - 200: { - location: LocationInfoV2 - data: IntegrationInfo | null - } -} - -export type V2IntegrationGetResponse = V2IntegrationGetResponses[keyof V2IntegrationGetResponses] - -export type V2ExperimentalIntegrationWellknownAddData = { - body: { - url: string - } - path?: never - query?: { - location?: { - directory?: string | null - workspace?: string | null - } | null - } - url: "/api/experimental/integration/wellknown" -} - -export type V2ExperimentalIntegrationWellknownAddErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestError1 | InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError -} - -export type V2ExperimentalIntegrationWellknownAddError = - V2ExperimentalIntegrationWellknownAddErrors[keyof V2ExperimentalIntegrationWellknownAddErrors] - -export type V2ExperimentalIntegrationWellknownAddResponses = { - /** - * - */ - 204: void -} - -export type V2ExperimentalIntegrationWellknownAddResponse = - V2ExperimentalIntegrationWellknownAddResponses[keyof V2ExperimentalIntegrationWellknownAddResponses] - -export type V2IntegrationConnectKeyData = { - body: { - key: string - label?: string | null - } - path: { - integrationID: string - } - query?: { - location?: { - directory?: string | null - workspace?: string | null - } | null - } - url: "/api/integration/{integrationID}/connect/key" -} - -export type V2IntegrationConnectKeyErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestError1 | InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError -} - -export type V2IntegrationConnectKeyError = V2IntegrationConnectKeyErrors[keyof V2IntegrationConnectKeyErrors] - -export type V2IntegrationConnectKeyResponses = { - /** - * - */ - 204: void -} - -export type V2IntegrationConnectKeyResponse = V2IntegrationConnectKeyResponses[keyof V2IntegrationConnectKeyResponses] - -export type V2IntegrationOauthConnectData = { - body: { - methodID: string - inputs: { - [key: string]: string - } - label?: string | null - } - path: { - integrationID: string - } - query?: { - location?: { - directory?: string | null - workspace?: string | null - } | null - } - url: "/api/integration/{integrationID}/connect/oauth" -} - -export type V2IntegrationOauthConnectErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestError1 | InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError -} - -export type V2IntegrationOauthConnectError = V2IntegrationOauthConnectErrors[keyof V2IntegrationOauthConnectErrors] - -export type V2IntegrationOauthConnectResponses = { - /** - * Success - */ - 200: { - location: LocationInfoV2 - data: IntegrationAttempt - } -} - -export type V2IntegrationOauthConnectResponse = - V2IntegrationOauthConnectResponses[keyof V2IntegrationOauthConnectResponses] - -export type V2IntegrationOauthCancelData = { - body?: never - path: { - integrationID: string - attemptID: string - } - query?: { - location?: { - directory?: string | null - workspace?: string | null - } | null - } - url: "/api/integration/{integrationID}/connect/oauth/{attemptID}" -} - -export type V2IntegrationOauthCancelErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError -} - -export type V2IntegrationOauthCancelError = V2IntegrationOauthCancelErrors[keyof V2IntegrationOauthCancelErrors] - -export type V2IntegrationOauthCancelResponses = { - /** - * - */ - 204: void -} - -export type V2IntegrationOauthCancelResponse = - V2IntegrationOauthCancelResponses[keyof V2IntegrationOauthCancelResponses] - -export type V2IntegrationOauthStatusData = { - body?: never - path: { - integrationID: string - attemptID: string - } - query?: { - location?: { - directory?: string | null - workspace?: string | null - } | null - } - url: "/api/integration/{integrationID}/connect/oauth/{attemptID}" -} - -export type V2IntegrationOauthStatusErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError -} - -export type V2IntegrationOauthStatusError = V2IntegrationOauthStatusErrors[keyof V2IntegrationOauthStatusErrors] - -export type V2IntegrationOauthStatusResponses = { - /** - * Success - */ - 200: { - location: LocationInfoV2 - data: IntegrationAttemptStatus - } -} - -export type V2IntegrationOauthStatusResponse = - V2IntegrationOauthStatusResponses[keyof V2IntegrationOauthStatusResponses] - -export type V2IntegrationOauthCompleteData = { - body: { - code?: string | null - } - path: { - integrationID: string - attemptID: string - } - query?: { - location?: { - directory?: string | null - workspace?: string | null - } | null - } - url: "/api/integration/{integrationID}/connect/oauth/{attemptID}/complete" -} - -export type V2IntegrationOauthCompleteErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestError1 | InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError -} - -export type V2IntegrationOauthCompleteError = V2IntegrationOauthCompleteErrors[keyof V2IntegrationOauthCompleteErrors] - -export type V2IntegrationOauthCompleteResponses = { - /** - * - */ - 204: void -} - -export type V2IntegrationOauthCompleteResponse = - V2IntegrationOauthCompleteResponses[keyof V2IntegrationOauthCompleteResponses] - -export type V2IntegrationCommandConnectData = { - body: { - methodID: string - label?: string | null - } - path: { - integrationID: string - } - query?: { - location?: { - directory?: string | null - workspace?: string | null - } | null - } - url: "/api/integration/{integrationID}/connect/command" -} - -export type V2IntegrationCommandConnectErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestError1 | InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError -} - -export type V2IntegrationCommandConnectError = - V2IntegrationCommandConnectErrors[keyof V2IntegrationCommandConnectErrors] - -export type V2IntegrationCommandConnectResponses = { - /** - * Success - */ - 200: { - location: LocationInfoV2 - data: IntegrationCommandAttempt - } -} - -export type V2IntegrationCommandConnectResponse = - V2IntegrationCommandConnectResponses[keyof V2IntegrationCommandConnectResponses] - -export type V2IntegrationCommandCancelData = { - body?: never - path: { - integrationID: string - attemptID: string - } - query?: { - location?: { - directory?: string | null - workspace?: string | null - } | null - } - url: "/api/integration/{integrationID}/connect/command/{attemptID}" -} - -export type V2IntegrationCommandCancelErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError -} - -export type V2IntegrationCommandCancelError = V2IntegrationCommandCancelErrors[keyof V2IntegrationCommandCancelErrors] - -export type V2IntegrationCommandCancelResponses = { - /** - * - */ - 204: void -} - -export type V2IntegrationCommandCancelResponse = - V2IntegrationCommandCancelResponses[keyof V2IntegrationCommandCancelResponses] - -export type V2IntegrationCommandStatusData = { - body?: never - path: { - integrationID: string - attemptID: string - } - query?: { - location?: { - directory?: string | null - workspace?: string | null - } | null - } - url: "/api/integration/{integrationID}/connect/command/{attemptID}" -} - -export type V2IntegrationCommandStatusErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError -} - -export type V2IntegrationCommandStatusError = V2IntegrationCommandStatusErrors[keyof V2IntegrationCommandStatusErrors] - -export type V2IntegrationCommandStatusResponses = { - /** - * Success - */ - 200: { - location: LocationInfoV2 - data: IntegrationCommandAttemptStatus - } -} - -export type V2IntegrationCommandStatusResponse = - V2IntegrationCommandStatusResponses[keyof V2IntegrationCommandStatusResponses] - -export type V2McpListData = { - body?: never - path?: never - query?: { - location?: { - directory?: string | null - workspace?: string | null - } | null - } - url: "/api/mcp" -} - -export type V2McpListErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError -} - -export type V2McpListError = V2McpListErrors[keyof V2McpListErrors] - -export type V2McpListResponses = { - /** - * Success - */ - 200: { - location: LocationInfoV2 - data: Array - } -} - -export type V2McpListResponse = V2McpListResponses[keyof V2McpListResponses] - -export type V2McpResourceCatalogData = { - body?: never - path?: never - query?: { - location?: { - directory?: string | null - workspace?: string | null - } | null - } - url: "/api/mcp/resource" -} - -export type V2McpResourceCatalogErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError -} - -export type V2McpResourceCatalogError = V2McpResourceCatalogErrors[keyof V2McpResourceCatalogErrors] - -export type V2McpResourceCatalogResponses = { - /** - * Success - */ - 200: { - location: LocationInfoV2 - data: McpResourceCatalogV2 - } -} - -export type V2McpResourceCatalogResponse = V2McpResourceCatalogResponses[keyof V2McpResourceCatalogResponses] - -export type V2CredentialRemoveData = { - body?: never - path: { - credentialID: string - } - query?: { - location?: { - directory?: string | null - workspace?: string | null - } | null - } - url: "/api/credential/{credentialID}" -} - -export type V2CredentialRemoveErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError -} - -export type V2CredentialRemoveError = V2CredentialRemoveErrors[keyof V2CredentialRemoveErrors] - -export type V2CredentialRemoveResponses = { - /** - * - */ - 204: void -} - -export type V2CredentialRemoveResponse = V2CredentialRemoveResponses[keyof V2CredentialRemoveResponses] - -export type V2CredentialUpdateData = { - body: { - label: string - } - path: { - credentialID: string - } - query?: { - location?: { - directory?: string | null - workspace?: string | null - } | null - } - url: "/api/credential/{credentialID}" -} - -export type V2CredentialUpdateErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError -} - -export type V2CredentialUpdateError = V2CredentialUpdateErrors[keyof V2CredentialUpdateErrors] - -export type V2CredentialUpdateResponses = { - /** - * - */ - 204: void -} - -export type V2CredentialUpdateResponse = V2CredentialUpdateResponses[keyof V2CredentialUpdateResponses] - -export type V2ProjectListData = { - body?: never - path?: never - query?: never - url: "/api/project" -} - -export type V2ProjectListErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError -} - -export type V2ProjectListError = V2ProjectListErrors[keyof V2ProjectListErrors] - -export type V2ProjectListResponses = { - /** - * Success - */ - 200: Array -} - -export type V2ProjectListResponse = V2ProjectListResponses[keyof V2ProjectListResponses] - -export type V2ProjectCurrentData = { - body?: never - path?: never - query?: { - location?: { - directory?: string | null - workspace?: string | null - } | null - } - url: "/api/project/current" -} - -export type V2ProjectCurrentErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError -} - -export type V2ProjectCurrentError = V2ProjectCurrentErrors[keyof V2ProjectCurrentErrors] - -export type V2ProjectCurrentResponses = { - /** - * Project.Current - */ - 200: ProjectCurrent -} - -export type V2ProjectCurrentResponse = V2ProjectCurrentResponses[keyof V2ProjectCurrentResponses] - -export type V2ProjectDirectoriesData = { - body?: never - path: { - projectID: string - } - query?: { - location?: { - directory?: string | null - workspace?: string | null - } | null - } - url: "/api/project/{projectID}/directories" -} - -export type V2ProjectDirectoriesErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError -} - -export type V2ProjectDirectoriesError = V2ProjectDirectoriesErrors[keyof V2ProjectDirectoriesErrors] - -export type V2ProjectDirectoriesResponses = { - /** - * Project.Directories - */ - 200: ProjectDirectories -} - -export type V2ProjectDirectoriesResponse = V2ProjectDirectoriesResponses[keyof V2ProjectDirectoriesResponses] - -export type V2FormRequestListData = { - body?: never - path?: never - query?: { - location?: { - directory?: string | null - workspace?: string | null - } | null - } - url: "/api/form/request" -} - -export type V2FormRequestListErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError -} - -export type V2FormRequestListError = V2FormRequestListErrors[keyof V2FormRequestListErrors] - -export type V2FormRequestListResponses = { - /** - * Success - */ - 200: { - location: LocationInfoV2 - data: Array - } -} - -export type V2FormRequestListResponse = V2FormRequestListResponses[keyof V2FormRequestListResponses] - -export type V2SessionFormListData = { - body?: never - path: { - sessionID: string - } - query?: never - url: "/api/session/{sessionID}/form" -} - -export type V2SessionFormListErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError - /** - * SessionNotFoundError - */ - 404: SessionNotFoundError -} - -export type V2SessionFormListError = V2SessionFormListErrors[keyof V2SessionFormListErrors] - -export type V2SessionFormListResponses = { - /** - * Success - */ - 200: { - data: Array - } -} - -export type V2SessionFormListResponse = V2SessionFormListResponses[keyof V2SessionFormListResponses] - -export type V2SessionFormCreateData = { - body: FormCreatePayloadV2 - path: { - sessionID: string - } - query?: never - url: "/api/session/{sessionID}/form" -} - -export type V2SessionFormCreateErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestError1 | InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError - /** - * SessionNotFoundError - */ - 404: SessionNotFoundError - /** - * ConflictError - */ - 409: ConflictErrorV2 -} - -export type V2SessionFormCreateError = V2SessionFormCreateErrors[keyof V2SessionFormCreateErrors] - -export type V2SessionFormCreateResponses = { - /** - * Success - */ - 200: { - data: FormInfoV2 - } -} - -export type V2SessionFormCreateResponse = V2SessionFormCreateResponses[keyof V2SessionFormCreateResponses] - -export type V2SessionFormGetData = { - body?: never - path: { - sessionID: string - formID: string - } - query?: never - url: "/api/session/{sessionID}/form/{formID}" -} - -export type V2SessionFormGetErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError - /** - * SessionNotFoundError | FormNotFoundError - */ - 404: FormNotFoundError | SessionNotFoundError -} - -export type V2SessionFormGetError = V2SessionFormGetErrors[keyof V2SessionFormGetErrors] - -export type V2SessionFormGetResponses = { - /** - * Success - */ - 200: { - data: FormInfoV2 - } -} - -export type V2SessionFormGetResponse = V2SessionFormGetResponses[keyof V2SessionFormGetResponses] - -export type V2SessionFormStateData = { - body?: never - path: { - sessionID: string - formID: string - } - query?: never - url: "/api/session/{sessionID}/form/{formID}/state" -} - -export type V2SessionFormStateErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError - /** - * SessionNotFoundError | FormNotFoundError - */ - 404: FormNotFoundError | SessionNotFoundError -} - -export type V2SessionFormStateError = V2SessionFormStateErrors[keyof V2SessionFormStateErrors] - -export type V2SessionFormStateResponses = { - /** - * Success - */ - 200: { - data: FormState - } -} - -export type V2SessionFormStateResponse = V2SessionFormStateResponses[keyof V2SessionFormStateResponses] - -export type V2SessionFormReplyData = { - body: FormReply - path: { - sessionID: string - formID: string - } - query?: never - url: "/api/session/{sessionID}/form/{formID}/reply" -} - -export type V2SessionFormReplyErrors = { - /** - * FormInvalidAnswerError | InvalidRequestError - */ - 400: FormInvalidAnswerError | InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError - /** - * SessionNotFoundError | FormNotFoundError - */ - 404: FormNotFoundError | SessionNotFoundError - /** - * FormAlreadySettledError - */ - 409: FormAlreadySettledError -} - -export type V2SessionFormReplyError = V2SessionFormReplyErrors[keyof V2SessionFormReplyErrors] - -export type V2SessionFormReplyResponses = { - /** - * - */ - 204: void -} - -export type V2SessionFormReplyResponse = V2SessionFormReplyResponses[keyof V2SessionFormReplyResponses] - -export type V2SessionFormCancelData = { - body?: never - path: { - sessionID: string - formID: string - } - query?: never - url: "/api/session/{sessionID}/form/{formID}/cancel" -} - -export type V2SessionFormCancelErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError - /** - * SessionNotFoundError | FormNotFoundError - */ - 404: FormNotFoundError | SessionNotFoundError - /** - * FormAlreadySettledError - */ - 409: FormAlreadySettledError -} - -export type V2SessionFormCancelError = V2SessionFormCancelErrors[keyof V2SessionFormCancelErrors] - -export type V2SessionFormCancelResponses = { - /** - * - */ - 204: void -} - -export type V2SessionFormCancelResponse = V2SessionFormCancelResponses[keyof V2SessionFormCancelResponses] - -export type V2PermissionRequestListData = { - body?: never - path?: never - query?: { - location?: { - directory?: string | null - workspace?: string | null - } | null - } - url: "/api/permission/request" -} - -export type V2PermissionRequestListErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError -} - -export type V2PermissionRequestListError = V2PermissionRequestListErrors[keyof V2PermissionRequestListErrors] - -export type V2PermissionRequestListResponses = { - /** - * Success - */ - 200: { - location: LocationInfoV2 - data: Array - } -} - -export type V2PermissionRequestListResponse = V2PermissionRequestListResponses[keyof V2PermissionRequestListResponses] - -export type V2PermissionSavedListData = { - body?: never - path?: never - query?: { - projectID?: string | null - } - url: "/api/permission/saved" -} - -export type V2PermissionSavedListErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError -} - -export type V2PermissionSavedListError = V2PermissionSavedListErrors[keyof V2PermissionSavedListErrors] - -export type V2PermissionSavedListResponses = { - /** - * Success - */ - 200: { - data: Array - } -} - -export type V2PermissionSavedListResponse = V2PermissionSavedListResponses[keyof V2PermissionSavedListResponses] - -export type V2PermissionSavedRemoveData = { - body?: never - path: { - id: string - } - query?: never - url: "/api/permission/saved/{id}" -} - -export type V2PermissionSavedRemoveErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError -} - -export type V2PermissionSavedRemoveError = V2PermissionSavedRemoveErrors[keyof V2PermissionSavedRemoveErrors] - -export type V2PermissionSavedRemoveResponses = { - /** - * - */ - 204: void -} - -export type V2PermissionSavedRemoveResponse = V2PermissionSavedRemoveResponses[keyof V2PermissionSavedRemoveResponses] - -export type V2SessionPermissionListData = { - body?: never - path: { - sessionID: string - } - query?: never - url: "/api/session/{sessionID}/permission" -} - -export type V2SessionPermissionListErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError - /** - * SessionNotFoundError - */ - 404: SessionNotFoundError -} - -export type V2SessionPermissionListError = V2SessionPermissionListErrors[keyof V2SessionPermissionListErrors] - -export type V2SessionPermissionListResponses = { - /** - * Success - */ - 200: { - data: Array - } -} - -export type V2SessionPermissionListResponse = V2SessionPermissionListResponses[keyof V2SessionPermissionListResponses] - -export type V2SessionPermissionCreateData = { - body: { - id?: string | null - action: string - resources: Array - save?: Array - metadata?: { - [key: string]: unknown - } - source?: PermissionV2SourceV2 - agent?: string | null - } - path: { - sessionID: string - } - query?: never - url: "/api/session/{sessionID}/permission" -} - -export type V2SessionPermissionCreateErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError - /** - * SessionNotFoundError - */ - 404: SessionNotFoundError -} - -export type V2SessionPermissionCreateError = V2SessionPermissionCreateErrors[keyof V2SessionPermissionCreateErrors] - -export type V2SessionPermissionCreateResponses = { - /** - * Success - */ - 200: { - data: { - id: string - effect: PermissionV2Effect - } - } -} - -export type V2SessionPermissionCreateResponse = - V2SessionPermissionCreateResponses[keyof V2SessionPermissionCreateResponses] - -export type V2SessionPermissionGetData = { - body?: never - path: { - sessionID: string - requestID: string - } - query?: never - url: "/api/session/{sessionID}/permission/{requestID}" -} - -export type V2SessionPermissionGetErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError - /** - * SessionNotFoundError | PermissionNotFoundError - */ - 404: PermissionNotFoundError | SessionNotFoundError -} - -export type V2SessionPermissionGetError = V2SessionPermissionGetErrors[keyof V2SessionPermissionGetErrors] - -export type V2SessionPermissionGetResponses = { - /** - * Success - */ - 200: { - data: PermissionV2RequestV2 - } -} - -export type V2SessionPermissionGetResponse = V2SessionPermissionGetResponses[keyof V2SessionPermissionGetResponses] - -export type V2SessionPermissionReplyData = { - body: { - reply: PermissionV2Reply - message?: string | null - } - path: { - sessionID: string - requestID: string - } - query?: never - url: "/api/session/{sessionID}/permission/{requestID}/reply" -} - -export type V2SessionPermissionReplyErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError - /** - * SessionNotFoundError | PermissionNotFoundError - */ - 404: PermissionNotFoundError | SessionNotFoundError -} - -export type V2SessionPermissionReplyError = V2SessionPermissionReplyErrors[keyof V2SessionPermissionReplyErrors] - -export type V2SessionPermissionReplyResponses = { - /** - * - */ - 204: void -} - -export type V2SessionPermissionReplyResponse = - V2SessionPermissionReplyResponses[keyof V2SessionPermissionReplyResponses] - -export type V2FsReadData = { - body?: never - path?: never - query?: { - location?: { - directory?: string | null - workspace?: string | null - } | null - } - url: "/api/fs/read/*" -} - -export type V2FsReadErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError -} - -export type V2FsReadError = V2FsReadErrors[keyof V2FsReadErrors] - -export type V2FsReadResponses = { - /** - * Success - */ - 200: Blob | File -} - -export type V2FsReadResponse = V2FsReadResponses[keyof V2FsReadResponses] - -export type V2FsListData = { - body?: never - path?: never - query?: { - location?: { - directory?: string | null - workspace?: string | null - } | null - path?: string | null - } - url: "/api/fs/list" -} - -export type V2FsListErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError -} - -export type V2FsListError = V2FsListErrors[keyof V2FsListErrors] - -export type V2FsListResponses = { - /** - * Success - */ - 200: { - location: LocationInfoV2 - data: Array - } -} - -export type V2FsListResponse = V2FsListResponses[keyof V2FsListResponses] - -export type V2FsFindData = { - body?: never - path?: never - query: { - location?: { - directory?: string | null - workspace?: string | null - } | null - query: string - type?: "file" | "directory" - limit?: string | null - } - url: "/api/fs/find" -} - -export type V2FsFindErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError -} - -export type V2FsFindError = V2FsFindErrors[keyof V2FsFindErrors] - -export type V2FsFindResponses = { - /** - * Success - */ - 200: { - location: LocationInfoV2 - data: Array - } -} - -export type V2FsFindResponse = V2FsFindResponses[keyof V2FsFindResponses] - -export type V2CommandListData = { - body?: never - path?: never - query?: { - location?: { - directory?: string | null - workspace?: string | null - } | null - } - url: "/api/command" -} - -export type V2CommandListErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError -} - -export type V2CommandListError = V2CommandListErrors[keyof V2CommandListErrors] - -export type V2CommandListResponses = { - /** - * Success - */ - 200: { - location: LocationInfoV2 - data: Array - } -} - -export type V2CommandListResponse = V2CommandListResponses[keyof V2CommandListResponses] - -export type V2SkillListData = { - body?: never - path?: never - query?: { - location?: { - directory?: string | null - workspace?: string | null - } | null - } - url: "/api/skill" -} - -export type V2SkillListErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError -} - -export type V2SkillListError = V2SkillListErrors[keyof V2SkillListErrors] - -export type V2SkillListResponses = { - /** - * Success - */ - 200: { - location: LocationInfoV2 - data: Array - } -} - -export type V2SkillListResponse = V2SkillListResponses[keyof V2SkillListResponses] - -export type V2EventSubscribeData = { - body?: never - path?: never - query?: never - url: "/api/event" -} - -export type V2EventSubscribeErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError -} - -export type V2EventSubscribeError = V2EventSubscribeErrors[keyof V2EventSubscribeErrors] - -export type V2EventSubscribeResponses = { - /** - * Success - */ - 200: V2Event -} - -export type V2EventSubscribeResponse = V2EventSubscribeResponses[keyof V2EventSubscribeResponses] - -export type V2PtyListData = { - body?: never - path?: never - query?: { - location?: { - directory?: string | null - workspace?: string | null - } | null - } - url: "/api/pty" -} - -export type V2PtyListErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError -} - -export type V2PtyListError = V2PtyListErrors[keyof V2PtyListErrors] - -export type V2PtyListResponses = { - /** - * Success - */ - 200: { - location: LocationInfoV2 - data: Array - } -} - -export type V2PtyListResponse = V2PtyListResponses[keyof V2PtyListResponses] - -export type V2PtyCreateData = { - body: { - command?: string - args?: Array - cwd?: string - title?: string - env?: { - [key: string]: string - } - } - path?: never - query?: { - location?: { - directory?: string | null - workspace?: string | null - } | null - } - url: "/api/pty" -} - -export type V2PtyCreateErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError -} - -export type V2PtyCreateError = V2PtyCreateErrors[keyof V2PtyCreateErrors] - -export type V2PtyCreateResponses = { - /** - * Success - */ - 200: { - location: LocationInfoV2 - data: PtyV2 - } -} - -export type V2PtyCreateResponse = V2PtyCreateResponses[keyof V2PtyCreateResponses] - -export type V2PtyRemoveData = { - body?: never - path: { - ptyID: string - } - query?: { - location?: { - directory?: string | null - workspace?: string | null - } | null - } - url: "/api/pty/{ptyID}" -} - -export type V2PtyRemoveErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError - /** - * PtyNotFoundError - */ - 404: PtyNotFoundError -} - -export type V2PtyRemoveError = V2PtyRemoveErrors[keyof V2PtyRemoveErrors] - -export type V2PtyRemoveResponses = { - /** - * - */ - 204: void -} - -export type V2PtyRemoveResponse = V2PtyRemoveResponses[keyof V2PtyRemoveResponses] - -export type V2PtyGetData = { - body?: never - path: { - ptyID: string - } - query?: { - location?: { - directory?: string | null - workspace?: string | null - } | null - } - url: "/api/pty/{ptyID}" -} - -export type V2PtyGetErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError - /** - * PtyNotFoundError - */ - 404: PtyNotFoundError -} - -export type V2PtyGetError = V2PtyGetErrors[keyof V2PtyGetErrors] - -export type V2PtyGetResponses = { - /** - * Success - */ - 200: { - location: LocationInfoV2 - data: PtyV2 - } -} - -export type V2PtyGetResponse = V2PtyGetResponses[keyof V2PtyGetResponses] - -export type V2PtyUpdateData = { - body: { - title?: string - size?: { - rows: number - cols: number - } - } - path: { - ptyID: string - } - query?: { - location?: { - directory?: string | null - workspace?: string | null - } | null - } - url: "/api/pty/{ptyID}" -} - -export type V2PtyUpdateErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError - /** - * PtyNotFoundError - */ - 404: PtyNotFoundError -} - -export type V2PtyUpdateError = V2PtyUpdateErrors[keyof V2PtyUpdateErrors] - -export type V2PtyUpdateResponses = { - /** - * Success - */ - 200: { - location: LocationInfoV2 - data: PtyV2 - } -} - -export type V2PtyUpdateResponse = V2PtyUpdateResponses[keyof V2PtyUpdateResponses] - -export type V2PtyConnectTokenData = { - body?: never - path: { - ptyID: string - } - query?: { - location?: { - directory?: string | null - workspace?: string | null - } | null - } - url: "/api/pty/{ptyID}/connect-token" -} - -export type V2PtyConnectTokenErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError - /** - * ForbiddenError - */ - 403: ForbiddenError - /** - * PtyNotFoundError - */ - 404: PtyNotFoundError -} - -export type V2PtyConnectTokenError = V2PtyConnectTokenErrors[keyof V2PtyConnectTokenErrors] - -export type V2PtyConnectTokenResponses = { - /** - * Success - */ - 200: { - location: LocationInfoV2 - data: PtyTicketConnectTokenV2 - } -} - -export type V2PtyConnectTokenResponse = V2PtyConnectTokenResponses[keyof V2PtyConnectTokenResponses] - -export type V2PtyConnectData = { - body?: never - path: { - ptyID: string - } - query?: { - "location[directory]"?: string - "location[workspace]"?: string - cursor?: string - ticket?: string - } - url: "/api/pty/{ptyID}/connect" -} - -export type V2PtyConnectErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError - /** - * ForbiddenError - */ - 403: ForbiddenError - /** - * PtyNotFoundError - */ - 404: PtyNotFoundError -} - -export type V2PtyConnectError = V2PtyConnectErrors[keyof V2PtyConnectErrors] - -export type V2PtyConnectResponses = { - /** - * Success - */ - 200: boolean -} - -export type V2PtyConnectResponse = V2PtyConnectResponses[keyof V2PtyConnectResponses] - -export type V2ShellListData = { - body?: never - path?: never - query?: { - location?: { - directory?: string | null - workspace?: string | null - } | null - } - url: "/api/shell" -} - -export type V2ShellListErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError -} - -export type V2ShellListError = V2ShellListErrors[keyof V2ShellListErrors] - -export type V2ShellListResponses = { - /** - * Success - */ - 200: { - location: LocationInfoV2 - data: Array - } -} - -export type V2ShellListResponse = V2ShellListResponses[keyof V2ShellListResponses] - -export type V2ShellCreateData = { - body: { - command: string - cwd?: string - timeout: number - metadata?: { - [key: string]: unknown - } - } - path?: never - query?: { - location?: { - directory?: string | null - workspace?: string | null - } | null - } - url: "/api/shell" -} - -export type V2ShellCreateErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError -} - -export type V2ShellCreateError = V2ShellCreateErrors[keyof V2ShellCreateErrors] - -export type V2ShellCreateResponses = { - /** - * Success - */ - 200: { - location: LocationInfoV2 - data: ShellInfo1 - } -} - -export type V2ShellCreateResponse = V2ShellCreateResponses[keyof V2ShellCreateResponses] - -export type V2ShellRemoveData = { - body?: never - path: { - id: string - } - query?: { - location?: { - directory?: string | null - workspace?: string | null - } | null - } - url: "/api/shell/{id}" -} - -export type V2ShellRemoveErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError - /** - * ShellNotFoundError - */ - 404: ShellNotFoundError -} - -export type V2ShellRemoveError = V2ShellRemoveErrors[keyof V2ShellRemoveErrors] - -export type V2ShellRemoveResponses = { - /** - * - */ - 204: void -} - -export type V2ShellRemoveResponse = V2ShellRemoveResponses[keyof V2ShellRemoveResponses] - -export type V2ShellGetData = { - body?: never - path: { - id: string - } - query?: { - location?: { - directory?: string | null - workspace?: string | null - } | null - } - url: "/api/shell/{id}" -} - -export type V2ShellGetErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError - /** - * ShellNotFoundError - */ - 404: ShellNotFoundError -} - -export type V2ShellGetError = V2ShellGetErrors[keyof V2ShellGetErrors] - -export type V2ShellGetResponses = { - /** - * Success - */ - 200: { - location: LocationInfoV2 - data: ShellInfo1 - } -} - -export type V2ShellGetResponse = V2ShellGetResponses[keyof V2ShellGetResponses] - -export type V2ShellTimeoutData = { - body: { - timeout: number - } - path: { - id: string - } - query?: { - location?: { - directory?: string | null - workspace?: string | null - } | null - } - url: "/api/shell/{id}/timeout" -} - -export type V2ShellTimeoutErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError - /** - * ShellNotFoundError - */ - 404: ShellNotFoundError -} - -export type V2ShellTimeoutError = V2ShellTimeoutErrors[keyof V2ShellTimeoutErrors] - -export type V2ShellTimeoutResponses = { - /** - * Success - */ - 200: { - location: LocationInfoV2 - data: ShellInfo1 - } -} - -export type V2ShellTimeoutResponse = V2ShellTimeoutResponses[keyof V2ShellTimeoutResponses] - -export type V2ShellOutputData = { - body?: never - path: { - id: string - } - query?: { - location?: { - directory?: string | null - workspace?: string | null - } | null - cursor?: string - limit?: string - } - url: "/api/shell/{id}/output" -} - -export type V2ShellOutputErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError - /** - * ShellNotFoundError - */ - 404: ShellNotFoundError -} - -export type V2ShellOutputError = V2ShellOutputErrors[keyof V2ShellOutputErrors] - -export type V2ShellOutputResponses = { - /** - * Success - */ - 200: { - location: LocationInfoV2 - data: { - output: string - cursor: number - size: number - truncated: boolean - } - } -} - -export type V2ShellOutputResponse = V2ShellOutputResponses[keyof V2ShellOutputResponses] - -export type V2QuestionRequestListData = { - body?: never - path?: never - query?: { - location?: { - directory?: string | null - workspace?: string | null - } | null - } - url: "/api/question/request" -} - -export type V2QuestionRequestListErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError -} - -export type V2QuestionRequestListError = V2QuestionRequestListErrors[keyof V2QuestionRequestListErrors] - -export type V2QuestionRequestListResponses = { - /** - * Success - */ - 200: { - location: LocationInfoV2 - data: Array - } -} - -export type V2QuestionRequestListResponse = V2QuestionRequestListResponses[keyof V2QuestionRequestListResponses] - -export type V2SessionQuestionListData = { - body?: never - path: { - sessionID: string - } - query?: never - url: "/api/session/{sessionID}/question" -} - -export type V2SessionQuestionListErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError - /** - * SessionNotFoundError - */ - 404: SessionNotFoundError -} - -export type V2SessionQuestionListError = V2SessionQuestionListErrors[keyof V2SessionQuestionListErrors] - -export type V2SessionQuestionListResponses = { - /** - * Success - */ - 200: { - data: Array - } -} - -export type V2SessionQuestionListResponse = V2SessionQuestionListResponses[keyof V2SessionQuestionListResponses] - -export type V2SessionQuestionReplyData = { - body: QuestionV2Reply - path: { - sessionID: string - requestID: string - } - query?: never - url: "/api/session/{sessionID}/question/{requestID}/reply" -} - -export type V2SessionQuestionReplyErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError - /** - * SessionNotFoundError | QuestionNotFoundError - */ - 404: QuestionNotFoundError | SessionNotFoundError -} - -export type V2SessionQuestionReplyError = V2SessionQuestionReplyErrors[keyof V2SessionQuestionReplyErrors] - -export type V2SessionQuestionReplyResponses = { - /** - * - */ - 204: void -} - -export type V2SessionQuestionReplyResponse = V2SessionQuestionReplyResponses[keyof V2SessionQuestionReplyResponses] - -export type V2SessionQuestionRejectData = { - body?: never - path: { - sessionID: string - requestID: string - } - query?: never - url: "/api/session/{sessionID}/question/{requestID}/reject" -} - -export type V2SessionQuestionRejectErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError - /** - * SessionNotFoundError | QuestionNotFoundError - */ - 404: QuestionNotFoundError | SessionNotFoundError -} - -export type V2SessionQuestionRejectError = V2SessionQuestionRejectErrors[keyof V2SessionQuestionRejectErrors] - -export type V2SessionQuestionRejectResponses = { - /** - * - */ - 204: void -} - -export type V2SessionQuestionRejectResponse = V2SessionQuestionRejectResponses[keyof V2SessionQuestionRejectResponses] - -export type V2ReferenceListData = { - body?: never - path?: never - query?: { - location?: { - directory?: string | null - workspace?: string | null - } | null - } - url: "/api/reference" -} - -export type V2ReferenceListErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError -} - -export type V2ReferenceListError = V2ReferenceListErrors[keyof V2ReferenceListErrors] - -export type V2ReferenceListResponses = { - /** - * Success - */ - 200: { - location: LocationInfoV2 - data: Array - } -} - -export type V2ReferenceListResponse = V2ReferenceListResponses[keyof V2ReferenceListResponses] - -export type V2ProjectCopyRemoveData = { - body: { - directory: string - force: boolean - } - path: { - projectID: string - } - query?: { - location?: { - directory?: string | null - workspace?: string | null - } | null - } - url: "/experimental/project/{projectID}/copy" -} - -export type V2ProjectCopyRemoveErrors = { - /** - * ProjectCopyError | InvalidRequestError - */ - 400: ProjectCopyErrorV2 | InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError -} - -export type V2ProjectCopyRemoveError = V2ProjectCopyRemoveErrors[keyof V2ProjectCopyRemoveErrors] - -export type V2ProjectCopyRemoveResponses = { - /** - * - */ - 204: void -} - -export type V2ProjectCopyRemoveResponse = V2ProjectCopyRemoveResponses[keyof V2ProjectCopyRemoveResponses] - -export type V2ProjectCopyCreateData = { - body: { - strategy: string - directory: string - name?: string - } - path: { - projectID: string - } - query?: { - location?: { - directory?: string | null - workspace?: string | null - } | null - } - url: "/experimental/project/{projectID}/copy" -} - -export type V2ProjectCopyCreateErrors = { - /** - * ProjectCopyError | InvalidRequestError - */ - 400: ProjectCopyErrorV2 | InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError -} - -export type V2ProjectCopyCreateError = V2ProjectCopyCreateErrors[keyof V2ProjectCopyCreateErrors] - -export type V2ProjectCopyCreateResponses = { - /** - * ProjectCopy.Copy - */ - 200: ProjectCopyCopy -} - -export type V2ProjectCopyCreateResponse = V2ProjectCopyCreateResponses[keyof V2ProjectCopyCreateResponses] - -export type V2ProjectCopyRefreshData = { - body?: never - path: { - projectID: string - } - query?: { - location?: { - directory?: string | null - workspace?: string | null - } | null - } - url: "/experimental/project/{projectID}/copy/refresh" -} - -export type V2ProjectCopyRefreshErrors = { - /** - * ProjectCopyError | InvalidRequestError - */ - 400: ProjectCopyErrorV2 | InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError -} - -export type V2ProjectCopyRefreshError = V2ProjectCopyRefreshErrors[keyof V2ProjectCopyRefreshErrors] - -export type V2ProjectCopyRefreshResponses = { - /** - * - */ - 204: void -} - -export type V2ProjectCopyRefreshResponse = V2ProjectCopyRefreshResponses[keyof V2ProjectCopyRefreshResponses] - -export type V2VcsStatusData = { - body?: never - path?: never - query?: { - location?: { - directory?: string | null - workspace?: string | null - } | null - } - url: "/api/vcs/status" -} - -export type V2VcsStatusErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError -} - -export type V2VcsStatusError = V2VcsStatusErrors[keyof V2VcsStatusErrors] - -export type V2VcsStatusResponses = { - /** - * Success - */ - 200: { - location: LocationInfoV2 - data: Array - } -} - -export type V2VcsStatusResponse = V2VcsStatusResponses[keyof V2VcsStatusResponses] - -export type V2VcsDiffData = { - body?: never - path?: never - query: { - location?: { - directory?: string | null - workspace?: string | null - } | null - mode: VcsMode - context?: string | null - } - url: "/api/vcs/diff" -} - -export type V2VcsDiffErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError -} - -export type V2VcsDiffError = V2VcsDiffErrors[keyof V2VcsDiffErrors] - -export type V2VcsDiffResponses = { - /** - * Success - */ - 200: { - location: LocationInfoV2 - data: Array - } -} - -export type V2VcsDiffResponse = V2VcsDiffResponses[keyof V2VcsDiffResponses] - -export type V2DebugLocationEvictData = { - body?: never - path?: never - query?: { - location?: { - directory?: string | null - workspace?: string | null - } | null - } - url: "/api/debug/location" -} - -export type V2DebugLocationEvictErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError -} - -export type V2DebugLocationEvictError = V2DebugLocationEvictErrors[keyof V2DebugLocationEvictErrors] - -export type V2DebugLocationEvictResponses = { - /** - * - */ - 204: void -} - -export type V2DebugLocationEvictResponse = V2DebugLocationEvictResponses[keyof V2DebugLocationEvictResponses] - -export type V2DebugLocationListData = { - body?: never - path?: never - query?: never - url: "/api/debug/location" -} - -export type V2DebugLocationListErrors = { - /** - * InvalidRequestError - */ - 400: InvalidRequestErrorV2 - /** - * UnauthorizedError - */ - 401: UnauthorizedError -} - -export type V2DebugLocationListError = V2DebugLocationListErrors[keyof V2DebugLocationListErrors] - -export type V2DebugLocationListResponses = { - /** - * Success - */ - 200: Array -} - -export type V2DebugLocationListResponse = V2DebugLocationListResponses[keyof V2DebugLocationListResponses] - -export type PtyConnectData = { - body?: never - path: { - ptyID: string - } - query?: { - directory?: string - workspace?: string - cursor?: string - ticket?: string - } - url: "/pty/{ptyID}/connect" -} - -export type PtyConnectErrors = { - /** - * Forbidden - */ - 403: EffectHttpApiErrorForbidden - /** - * Not found - */ - 404: NotFoundError -} - -export type PtyConnectError = PtyConnectErrors[keyof PtyConnectErrors] - -export type PtyConnectResponses = { - /** - * Connected session - */ - 200: boolean -} - -export type PtyConnectResponse = PtyConnectResponses[keyof PtyConnectResponses] diff --git a/packages/sdk/js/src/v2/index.ts b/packages/sdk/js/src/v2/index.ts deleted file mode 100644 index 9615eacc7a..0000000000 --- a/packages/sdk/js/src/v2/index.ts +++ /dev/null @@ -1,23 +0,0 @@ -export * from "./client.js" -export * from "./server.js" - -import { createOpencodeClient } from "./client.js" -import { createOpencodeServer } from "./server.js" -import type { ServerOptions } from "./server.js" - -export * as data from "./data.js" - -export async function createOpencode(options?: ServerOptions) { - const server = await createOpencodeServer({ - ...options, - }) - - const client = createOpencodeClient({ - baseUrl: server.url, - }) - - return { - client, - server, - } -} diff --git a/packages/sdk/js/src/v2/server.ts b/packages/sdk/js/src/v2/server.ts deleted file mode 100644 index 48f1a253da..0000000000 --- a/packages/sdk/js/src/v2/server.ts +++ /dev/null @@ -1,134 +0,0 @@ -import launch from "cross-spawn" -import { type Config } from "./gen/types.gen.js" -import { stop, bindAbort } from "../process.js" - -export type ServerOptions = { - hostname?: string - port?: number - signal?: AbortSignal - timeout?: number - config?: Config -} - -export type TuiOptions = { - project?: string - model?: string - session?: string - agent?: string - signal?: AbortSignal - config?: Config -} - -export async function createOpencodeServer(options?: ServerOptions) { - options = Object.assign( - { - hostname: "127.0.0.1", - port: 4096, - timeout: 5000, - }, - options ?? {}, - ) - - const args = [`serve`, `--hostname=${options.hostname}`, `--port=${options.port}`] - if (options.config?.logLevel) args.push(`--log-level=${options.config.logLevel}`) - - const proc = launch(`opencode`, args, { - env: { - ...process.env, - OPENCODE_CONFIG_CONTENT: JSON.stringify(options.config ?? {}), - }, - }) - let clear = () => {} - - const url = await new Promise((resolve, reject) => { - const id = setTimeout(() => { - clear() - stop(proc) - reject(new Error(`Timeout waiting for server to start after ${options.timeout}ms`)) - }, options.timeout) - let output = "" - let resolved = false - proc.stdout?.on("data", (chunk) => { - if (resolved) return - output += chunk.toString() - const lines = output.split("\n") - for (const line of lines) { - if (line.startsWith("opencode server listening")) { - const match = line.match(/on\s+(https?:\/\/[^\s]+)/) - if (!match) { - clear() - stop(proc) - clearTimeout(id) - reject(new Error(`Failed to parse server url from output: ${line}`)) - return - } - clearTimeout(id) - resolved = true - resolve(match[1]!) - return - } - } - }) - proc.stderr?.on("data", (chunk) => { - output += chunk.toString() - }) - proc.on("exit", (code) => { - clearTimeout(id) - let msg = `Server exited with code ${code}` - if (output.trim()) { - msg += `\nServer output: ${output}` - } - reject(new Error(msg)) - }) - proc.on("error", (error) => { - clearTimeout(id) - reject(error) - }) - clear = bindAbort(proc, options.signal, () => { - clearTimeout(id) - reject(options.signal?.reason) - }) - }) - - return { - url, - close() { - clear() - stop(proc) - }, - } -} - -export function createOpencodeTui(options?: TuiOptions) { - const args = [] - - if (options?.project) { - args.push(`--project=${options.project}`) - } - if (options?.model) { - args.push(`--model=${options.model}`) - } - if (options?.session) { - args.push(`--session=${options.session}`) - } - if (options?.agent) { - args.push(`--agent=${options.agent}`) - } - - const proc = launch(`opencode`, args, { - stdio: "inherit", - env: { - ...process.env, - OPENCODE_CONFIG_CONTENT: JSON.stringify(options?.config ?? {}), - }, - }) - - const clear = bindAbort(proc, options?.signal) - - return { - close() { - clear() - stop(proc) - }, - } -} diff --git a/packages/sdk/js/sst-env.d.ts b/packages/sdk/js/sst-env.d.ts deleted file mode 100644 index 301538ccb2..0000000000 --- a/packages/sdk/js/sst-env.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -/* This file is auto-generated by SST. Do not edit. */ -/* tslint:disable */ -/* eslint-disable */ -/* deno-fmt-ignore-file */ -/* biome-ignore-all lint: auto-generated */ - -/// - -import "sst" -export {} \ No newline at end of file diff --git a/packages/sdk/js/test/session-history.test.ts b/packages/sdk/js/test/session-history.test.ts deleted file mode 100644 index 44a9743331..0000000000 --- a/packages/sdk/js/test/session-history.test.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { expect, test } from "bun:test" -import type { V2SessionHistoryData } from "../src/v2/gen/types.gen" - -test("uses numeric Session history positions", () => { - const input = { - path: { sessionID: "ses_test" }, - query: { after: 1, limit: 50 }, - url: "/api/session/{sessionID}/history", - } satisfies V2SessionHistoryData - - expect(input.query.after).toBe(1) -}) diff --git a/packages/sdk/js/tsconfig.json b/packages/sdk/js/tsconfig.json deleted file mode 100644 index 3ab5fcb768..0000000000 --- a/packages/sdk/js/tsconfig.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "$schema": "https://json.schemastore.org/tsconfig.json", - "extends": "@tsconfig/node22/tsconfig.json", - "compilerOptions": { - "outDir": "dist", - "module": "nodenext", - "declaration": true, - "moduleResolution": "nodenext", - "lib": ["es2022", "dom", "dom.iterable"], - "composite": true, - "rootDir": "src" - }, - "include": ["src"] -} diff --git a/packages/sdk/openapi.json b/packages/sdk/openapi.json deleted file mode 100644 index 04ff287bf8..0000000000 --- a/packages/sdk/openapi.json +++ /dev/null @@ -1,36699 +0,0 @@ -{ - "openapi": "3.1.0", - "info": { - "title": "opencode", - "version": "1.0.0", - "description": "opencode api" - }, - "paths": { - "/auth/{providerID}": { - "put": { - "tags": ["control"], - "operationId": "auth.set", - "parameters": [ - { - "name": "providerID", - "in": "path", - "schema": { - "type": "string" - }, - "required": true - } - ], - "responses": { - "200": { - "description": "Successfully set authentication credentials", - "content": { - "application/json": { - "schema": { - "type": "boolean", - "description": "Successfully set authentication credentials" - } - } - } - }, - "400": { - "description": "BadRequest | InvalidRequestError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/effect_HttpApiError_BadRequest" - }, - { - "$ref": "#/components/schemas/InvalidRequestError" - } - ] - } - } - } - } - }, - "description": "Set authentication credentials", - "summary": "Set auth credentials", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Auth" - } - } - } - }, - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.auth.set({\n ...\n})" - } - ] - }, - "delete": { - "tags": ["control"], - "operationId": "auth.remove", - "parameters": [ - { - "name": "providerID", - "in": "path", - "schema": { - "type": "string" - }, - "required": true - } - ], - "responses": { - "200": { - "description": "Successfully removed authentication credentials", - "content": { - "application/json": { - "schema": { - "type": "boolean", - "description": "Successfully removed authentication credentials" - } - } - } - }, - "400": { - "description": "BadRequest | InvalidRequestError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/effect_HttpApiError_BadRequest" - }, - { - "$ref": "#/components/schemas/InvalidRequestError" - } - ] - } - } - } - } - }, - "description": "Remove authentication credentials", - "summary": "Remove auth credentials", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.auth.remove({\n ...\n})" - } - ] - } - }, - "/log": { - "post": { - "tags": ["control"], - "operationId": "app.log", - "parameters": [ - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "Log entry written successfully", - "content": { - "application/json": { - "schema": { - "type": "boolean", - "description": "Log entry written successfully" - } - } - } - }, - "400": { - "description": "BadRequest | InvalidRequestError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/effect_HttpApiError_BadRequest" - }, - { - "$ref": "#/components/schemas/InvalidRequestError" - } - ] - } - } - } - } - }, - "description": "Write a log entry to the server logs with specified level and metadata.", - "summary": "Write log", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "service": { - "type": "string", - "description": "Service name for the log entry" - }, - "level": { - "type": "string", - "enum": ["debug", "info", "error", "warn"], - "description": "Log level" - }, - "message": { - "type": "string", - "description": "Log message" - }, - "extra": { - "type": "object" - } - }, - "required": ["service", "level", "message"], - "additionalProperties": false - } - } - } - }, - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.app.log({\n ...\n})" - } - ] - } - }, - "/experimental/control-plane/move-session": { - "post": { - "tags": ["controlPlane"], - "operationId": "experimental.controlPlane.moveSession", - "parameters": [], - "responses": { - "204": { - "description": "Session moved" - }, - "400": { - "description": "MoveSessionError | InvalidRequestError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/MoveSessionError" - }, - { - "$ref": "#/components/schemas/InvalidRequestError" - } - ] - } - } - } - } - }, - "description": "Move a session to another project directory, optionally transferring local changes.", - "summary": "Move session", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "destination": { - "$ref": "#/components/schemas/MoveSessionDestination" - }, - "moveChanges": { - "type": "boolean" - } - }, - "required": ["sessionID", "destination"], - "additionalProperties": false - } - } - } - }, - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.controlPlane.moveSession({\n ...\n})" - } - ] - } - }, - "/global/health": { - "get": { - "tags": ["global"], - "operationId": "global.health", - "parameters": [], - "responses": { - "200": { - "description": "Health information", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "healthy": { - "type": "boolean", - "enum": [true] - }, - "version": { - "type": "string" - } - }, - "required": ["healthy", "version"], - "additionalProperties": false, - "description": "Health information" - } - } - } - }, - "400": { - "description": "Bad request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BadRequestError" - } - } - } - } - }, - "description": "Get health information about the OpenCode server.", - "summary": "Get health", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.health({\n ...\n})" - } - ] - } - }, - "/global/event": { - "get": { - "tags": ["global"], - "operationId": "global.event", - "parameters": [], - "responses": { - "200": { - "description": "Event stream", - "content": { - "text/event-stream": { - "schema": { - "$ref": "#/components/schemas/GlobalEvent" - } - } - } - }, - "400": { - "description": "Bad request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BadRequestError" - } - } - } - } - }, - "description": "Subscribe to global events from the OpenCode system using server-sent events.", - "summary": "Get global events", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.event({\n ...\n})" - } - ] - } - }, - "/global/config": { - "get": { - "tags": ["global"], - "operationId": "global.config.get", - "parameters": [], - "responses": { - "200": { - "description": "Get global config info", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Config" - } - } - } - }, - "400": { - "description": "Bad request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BadRequestError" - } - } - } - } - }, - "description": "Retrieve the current global OpenCode configuration settings and preferences.", - "summary": "Get global configuration", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.config.get({\n ...\n})" - } - ] - }, - "patch": { - "tags": ["global"], - "operationId": "global.config.update", - "parameters": [], - "responses": { - "200": { - "description": "Successfully updated global config", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Config" - } - } - } - }, - "400": { - "description": "BadRequest | InvalidRequestError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/effect_HttpApiError_BadRequest" - }, - { - "$ref": "#/components/schemas/InvalidRequestError" - } - ] - } - } - } - } - }, - "description": "Update global OpenCode configuration settings and preferences.", - "summary": "Update global configuration", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Config" - } - } - } - }, - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.config.update({\n ...\n})" - } - ] - } - }, - "/global/dispose": { - "post": { - "tags": ["global"], - "operationId": "global.dispose", - "parameters": [], - "responses": { - "200": { - "description": "Global disposed", - "content": { - "application/json": { - "schema": { - "type": "boolean", - "description": "Global disposed" - } - } - } - }, - "400": { - "description": "Bad request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BadRequestError" - } - } - } - } - }, - "description": "Clean up and dispose all OpenCode instances, releasing all resources.", - "summary": "Dispose instance", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.dispose({\n ...\n})" - } - ] - } - }, - "/global/upgrade": { - "post": { - "tags": ["global"], - "operationId": "global.upgrade", - "parameters": [], - "responses": { - "200": { - "description": "Upgrade result", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "enum": [true] - }, - "version": { - "type": "string" - } - }, - "required": ["success", "version"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "enum": [false] - }, - "error": { - "type": "string" - } - }, - "required": ["success", "error"], - "additionalProperties": false - } - ], - "description": "Upgrade result" - } - } - } - }, - "400": { - "description": "BadRequest | InvalidRequestError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/effect_HttpApiError_BadRequest" - }, - { - "$ref": "#/components/schemas/InvalidRequestError" - } - ] - } - } - } - } - }, - "description": "Upgrade opencode to the specified version or latest if not specified.", - "summary": "Upgrade opencode", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "target": { - "type": "string" - } - }, - "additionalProperties": false - } - } - } - }, - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.global.upgrade({\n ...\n})" - } - ] - } - }, - "/event": { - "get": { - "tags": ["event"], - "operationId": "event.subscribe", - "parameters": [ - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "Event stream", - "content": { - "text/event-stream": { - "schema": { - "$ref": "#/components/schemas/Event" - } - } - } - } - }, - "description": "Get events", - "summary": "Subscribe to events", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.event.subscribe({\n ...\n})" - } - ] - } - }, - "/config": { - "get": { - "tags": ["config"], - "operationId": "config.get", - "parameters": [ - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "Get config info", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Config" - } - } - } - }, - "400": { - "description": "Bad request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BadRequestError" - } - } - } - } - }, - "description": "Retrieve the current OpenCode configuration settings and preferences.", - "summary": "Get configuration", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.config.get({\n ...\n})" - } - ] - }, - "patch": { - "tags": ["config"], - "operationId": "config.update", - "parameters": [ - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "Successfully updated config", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Config" - } - } - } - }, - "400": { - "description": "BadRequest | InvalidRequestError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/effect_HttpApiError_BadRequest" - }, - { - "$ref": "#/components/schemas/InvalidRequestError" - } - ] - } - } - } - } - }, - "description": "Update OpenCode configuration settings and preferences.", - "summary": "Update configuration", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Config" - } - } - } - }, - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.config.update({\n ...\n})" - } - ] - } - }, - "/config/providers": { - "get": { - "tags": ["config"], - "operationId": "config.providers", - "parameters": [ - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "List of providers", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "providers": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Provider" - } - }, - "default": { - "type": "object", - "additionalProperties": { - "type": "string" - } - } - }, - "required": ["providers", "default"], - "additionalProperties": false, - "description": "List of providers" - } - } - } - }, - "400": { - "description": "Bad request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BadRequestError" - } - } - } - } - }, - "description": "Get a list of all configured AI providers and their default models.", - "summary": "List config providers", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.config.providers({\n ...\n})" - } - ] - } - }, - "/experimental/capabilities": { - "get": { - "tags": ["experimental"], - "operationId": "experimental.capabilities.get", - "parameters": [ - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "Experimental capabilities", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ExperimentalCapabilities" - } - } - } - }, - "400": { - "description": "Bad request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BadRequestError" - } - } - } - } - }, - "description": "Get experimental features enabled on the OpenCode server.", - "summary": "Get experimental capabilities", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.capabilities.get({\n ...\n})" - } - ] - } - }, - "/experimental/console": { - "get": { - "tags": ["experimental"], - "operationId": "experimental.console.get", - "parameters": [ - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "Active Console provider metadata", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ConsoleState" - } - } - } - }, - "400": { - "description": "Bad request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BadRequestError" - } - } - } - }, - "500": { - "description": "InternalServerError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/effect_HttpApiError_InternalServerError" - } - } - } - } - }, - "description": "Get the active Console org name and the set of provider IDs managed by that Console org.", - "summary": "Get active Console provider metadata", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.console.get({\n ...\n})" - } - ] - } - }, - "/experimental/console/orgs": { - "get": { - "tags": ["experimental"], - "operationId": "experimental.console.listOrgs", - "parameters": [ - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "Switchable Console orgs", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "orgs": { - "type": "array", - "items": { - "type": "object", - "properties": { - "accountID": { - "type": "string" - }, - "accountEmail": { - "type": "string" - }, - "accountUrl": { - "type": "string" - }, - "orgID": { - "type": "string" - }, - "orgName": { - "type": "string" - }, - "active": { - "type": "boolean" - } - }, - "required": ["accountID", "accountEmail", "accountUrl", "orgID", "orgName", "active"], - "additionalProperties": false - } - } - }, - "required": ["orgs"], - "additionalProperties": false, - "description": "Switchable Console orgs" - } - } - } - }, - "400": { - "description": "Bad request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BadRequestError" - } - } - } - }, - "500": { - "description": "InternalServerError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/effect_HttpApiError_InternalServerError" - } - } - } - } - }, - "description": "Get the available Console orgs across logged-in accounts, including the current active org.", - "summary": "List switchable Console orgs", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.console.listOrgs({\n ...\n})" - } - ] - } - }, - "/experimental/console/switch": { - "post": { - "tags": ["experimental"], - "operationId": "experimental.console.switchOrg", - "parameters": [ - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "Switch success", - "content": { - "application/json": { - "schema": { - "type": "boolean", - "description": "Switch success" - } - } - } - } - }, - "description": "Persist a new active Console account/org selection for the current local OpenCode state.", - "summary": "Switch active Console org", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "accountID": { - "type": "string" - }, - "orgID": { - "type": "string" - } - }, - "required": ["accountID", "orgID"], - "additionalProperties": false - } - } - } - }, - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.console.switchOrg({\n ...\n})" - } - ] - } - }, - "/experimental/tool": { - "get": { - "tags": ["experimental"], - "operationId": "tool.list", - "parameters": [ - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "provider", - "in": "query", - "schema": { - "type": "string" - }, - "required": true - }, - { - "name": "model", - "in": "query", - "schema": { - "type": "string" - }, - "required": true - } - ], - "responses": { - "200": { - "description": "Tools", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ToolList" - } - } - } - }, - "400": { - "description": "BadRequest | InvalidRequestError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/effect_HttpApiError_BadRequest" - }, - { - "$ref": "#/components/schemas/InvalidRequestError" - } - ] - } - } - } - } - }, - "description": "Get a list of available tools with their JSON schema parameters for a specific provider and model combination.", - "summary": "List tools", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tool.list({\n ...\n})" - } - ] - } - }, - "/experimental/tool/ids": { - "get": { - "tags": ["experimental"], - "operationId": "tool.ids", - "parameters": [ - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "Tool IDs", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ToolIDs" - } - } - } - }, - "400": { - "description": "BadRequest | InvalidRequestError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/effect_HttpApiError_BadRequest" - }, - { - "$ref": "#/components/schemas/InvalidRequestError" - } - ] - } - } - } - } - }, - "description": "Get a list of all available tool IDs, including both built-in tools and dynamically registered tools.", - "summary": "List tool IDs", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tool.ids({\n ...\n})" - } - ] - } - }, - "/experimental/worktree": { - "get": { - "tags": ["experimental"], - "operationId": "worktree.list", - "parameters": [ - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "List of worktree directories", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "type": "string" - }, - "description": "List of worktree directories" - } - } - } - }, - "400": { - "description": "WorktreeError | InvalidRequestError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/WorktreeError" - }, - { - "$ref": "#/components/schemas/InvalidRequestError" - } - ] - } - } - } - } - }, - "description": "List all sandbox worktrees for the current project.", - "summary": "List worktrees", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.worktree.list({\n ...\n})" - } - ] - }, - "post": { - "tags": ["experimental"], - "operationId": "worktree.create", - "parameters": [ - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "Worktree created", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Worktree" - } - } - } - }, - "400": { - "description": "WorktreeError | InvalidRequestError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/WorktreeError" - }, - { - "$ref": "#/components/schemas/InvalidRequestError" - } - ] - } - } - } - } - }, - "description": "Create a new git worktree for the current project and run any configured startup scripts.", - "summary": "Create worktree", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/WorktreeCreateInput" - } - } - } - }, - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.worktree.create({\n ...\n})" - } - ] - }, - "delete": { - "tags": ["experimental"], - "operationId": "worktree.remove", - "parameters": [ - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "Worktree removed", - "content": { - "application/json": { - "schema": { - "type": "boolean", - "description": "Worktree removed" - } - } - } - }, - "400": { - "description": "WorktreeError | InvalidRequestError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/WorktreeError" - }, - { - "$ref": "#/components/schemas/InvalidRequestError" - } - ] - } - } - } - } - }, - "description": "Remove a git worktree and delete its branch.", - "summary": "Remove worktree", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/WorktreeRemoveInput" - } - } - } - }, - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.worktree.remove({\n ...\n})" - } - ] - } - }, - "/experimental/worktree/reset": { - "post": { - "tags": ["experimental"], - "operationId": "worktree.reset", - "parameters": [ - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "Worktree reset", - "content": { - "application/json": { - "schema": { - "type": "boolean", - "description": "Worktree reset" - } - } - } - }, - "400": { - "description": "WorktreeError | InvalidRequestError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/WorktreeError" - }, - { - "$ref": "#/components/schemas/InvalidRequestError" - } - ] - } - } - } - } - }, - "description": "Reset a worktree branch to the primary default branch.", - "summary": "Reset worktree", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/WorktreeResetInput" - } - } - } - }, - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.worktree.reset({\n ...\n})" - } - ] - } - }, - "/experimental/session": { - "get": { - "tags": ["experimental"], - "operationId": "experimental.session.list", - "parameters": [ - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "roots", - "in": "query", - "schema": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "string", - "enum": ["true", "false"] - } - ] - }, - "required": false - }, - { - "name": "start", - "in": "query", - "schema": { - "type": "number" - }, - "required": false - }, - { - "name": "cursor", - "in": "query", - "schema": { - "type": "number" - }, - "required": false - }, - { - "name": "search", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "limit", - "in": "query", - "schema": { - "type": "number" - }, - "required": false - }, - { - "name": "archived", - "in": "query", - "schema": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "string", - "enum": ["true", "false"] - } - ] - }, - "required": false - } - ], - "responses": { - "200": { - "description": "List of sessions", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/GlobalSession" - }, - "description": "List of sessions" - } - } - } - }, - "400": { - "description": "Bad request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BadRequestError" - } - } - } - } - }, - "description": "Get a list of all OpenCode sessions across projects, sorted by most recently updated. Archived sessions are excluded by default.", - "summary": "List sessions", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.session.list({\n ...\n})" - } - ] - } - }, - "/experimental/session/{sessionID}/background": { - "post": { - "tags": ["experimental"], - "operationId": "experimental.session.background", - "parameters": [ - { - "name": "sessionID", - "in": "path", - "schema": { - "type": "string", - "pattern": "^ses" - }, - "required": true - }, - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "Backgrounded subagents", - "content": { - "application/json": { - "schema": { - "type": "boolean", - "description": "Backgrounded subagents" - } - } - } - }, - "400": { - "description": "BadRequest | InvalidRequestError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/effect_HttpApiError_BadRequest" - }, - { - "$ref": "#/components/schemas/InvalidRequestError" - } - ] - } - } - } - } - }, - "description": "Detach any synchronous subagents currently blocking the session and continue them in the background.", - "summary": "Background subagents", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.session.background({\n ...\n})" - } - ] - } - }, - "/experimental/resource": { - "get": { - "tags": ["experimental"], - "operationId": "experimental.resource.list", - "parameters": [ - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "MCP resources", - "content": { - "application/json": { - "schema": { - "type": "object", - "additionalProperties": { - "$ref": "#/components/schemas/McpResource" - }, - "description": "MCP resources" - } - } - } - }, - "400": { - "description": "Bad request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BadRequestError" - } - } - } - } - }, - "description": "Get all available MCP resources from connected servers. Optionally filter by name.", - "summary": "Get MCP resources", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.resource.list({\n ...\n})" - } - ] - } - }, - "/find": { - "get": { - "tags": ["file"], - "operationId": "find.text", - "parameters": [ - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "pattern", - "in": "query", - "schema": { - "type": "string" - }, - "required": true - } - ], - "responses": { - "200": { - "description": "Matches", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "type": "object", - "properties": { - "path": { - "type": "object", - "properties": { - "text": { - "type": "string" - } - }, - "required": ["text"], - "additionalProperties": false - }, - "lines": { - "type": "object", - "properties": { - "text": { - "type": "string" - } - }, - "required": ["text"], - "additionalProperties": false - }, - "line_number": { - "type": "integer", - "minimum": 0 - }, - "absolute_offset": { - "type": "integer", - "minimum": 0 - }, - "submatches": { - "type": "array", - "items": { - "type": "object", - "properties": { - "match": { - "type": "object", - "properties": { - "text": { - "type": "string" - } - }, - "required": ["text"], - "additionalProperties": false - }, - "start": { - "type": "integer", - "minimum": 0 - }, - "end": { - "type": "integer", - "minimum": 0 - } - }, - "required": ["match", "start", "end"], - "additionalProperties": false - } - } - }, - "required": ["path", "lines", "line_number", "absolute_offset", "submatches"], - "additionalProperties": false - }, - "description": "Matches" - } - } - } - }, - "400": { - "description": "Bad request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BadRequestError" - } - } - } - } - }, - "description": "Search for text patterns across files in the project using ripgrep.", - "summary": "Find text", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.find.text({\n ...\n})" - } - ] - } - }, - "/find/file": { - "get": { - "tags": ["file"], - "operationId": "find.files", - "parameters": [ - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "query", - "in": "query", - "schema": { - "type": "string" - }, - "required": true - }, - { - "name": "dirs", - "in": "query", - "schema": { - "type": "string", - "enum": ["true", "false"] - }, - "required": false - }, - { - "name": "type", - "in": "query", - "schema": { - "type": "string", - "enum": ["file", "directory"] - }, - "required": false - }, - { - "name": "limit", - "in": "query", - "schema": { - "type": "integer", - "minimum": 1, - "maximum": 200 - }, - "required": false - } - ], - "responses": { - "200": { - "description": "File paths", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "type": "string" - }, - "description": "File paths" - } - } - } - }, - "400": { - "description": "Bad request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BadRequestError" - } - } - } - } - }, - "description": "Search for files or directories by name or pattern in the project directory.", - "summary": "Find files", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.find.files({\n ...\n})" - } - ] - } - }, - "/find/symbol": { - "get": { - "tags": ["file"], - "operationId": "find.symbols", - "parameters": [ - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "query", - "in": "query", - "schema": { - "type": "string" - }, - "required": true - } - ], - "responses": { - "200": { - "description": "Symbols", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Symbol" - }, - "description": "Symbols" - } - } - } - }, - "400": { - "description": "Bad request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BadRequestError" - } - } - } - } - }, - "description": "Search for workspace symbols like functions, classes, and variables using LSP.", - "summary": "Find symbols", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.find.symbols({\n ...\n})" - } - ] - } - }, - "/file": { - "get": { - "tags": ["file"], - "operationId": "file.list", - "parameters": [ - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "path", - "in": "query", - "schema": { - "type": "string" - }, - "required": true - } - ], - "responses": { - "200": { - "description": "Files and directories", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/FileNode" - }, - "description": "Files and directories" - } - } - } - }, - "400": { - "description": "Bad request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BadRequestError" - } - } - } - } - }, - "description": "List files and directories in a specified path.", - "summary": "List files", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.file.list({\n ...\n})" - } - ] - } - }, - "/file/content": { - "get": { - "tags": ["file"], - "operationId": "file.read", - "parameters": [ - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "path", - "in": "query", - "schema": { - "type": "string" - }, - "required": true - } - ], - "responses": { - "200": { - "description": "File content", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/FileContent" - } - } - } - }, - "400": { - "description": "Bad request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BadRequestError" - } - } - } - } - }, - "description": "Read the content of a specified file.", - "summary": "Read file", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.file.read({\n ...\n})" - } - ] - } - }, - "/file/status": { - "get": { - "tags": ["file"], - "operationId": "file.status", - "parameters": [ - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "File status", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/File" - }, - "description": "File status" - } - } - } - }, - "400": { - "description": "Bad request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BadRequestError" - } - } - } - } - }, - "description": "Get the git status of all files in the project.", - "summary": "Get file status", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.file.status({\n ...\n})" - } - ] - } - }, - "/instance/dispose": { - "post": { - "tags": ["instance"], - "operationId": "instance.dispose", - "parameters": [ - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "Instance disposed", - "content": { - "application/json": { - "schema": { - "type": "boolean", - "description": "Instance disposed" - } - } - } - }, - "400": { - "description": "Bad request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BadRequestError" - } - } - } - } - }, - "description": "Clean up and dispose the current OpenCode instance, releasing all resources.", - "summary": "Dispose instance", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.instance.dispose({\n ...\n})" - } - ] - } - }, - "/path": { - "get": { - "tags": ["instance"], - "operationId": "path.get", - "parameters": [ - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "Path", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Path" - } - } - } - }, - "400": { - "description": "Bad request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BadRequestError" - } - } - } - } - }, - "description": "Retrieve the current working directory and related path information for the OpenCode instance.", - "summary": "Get paths", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.path.get({\n ...\n})" - } - ] - } - }, - "/vcs": { - "get": { - "tags": ["instance"], - "operationId": "vcs.get", - "parameters": [ - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "VCS info", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/VcsInfo" - } - } - } - }, - "400": { - "description": "Bad request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BadRequestError" - } - } - } - } - }, - "description": "Retrieve version control system (VCS) information for the current project, such as git branch.", - "summary": "Get VCS info", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.vcs.get({\n ...\n})" - } - ] - } - }, - "/vcs/status": { - "get": { - "tags": ["instance"], - "operationId": "vcs.status", - "parameters": [ - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "VCS status", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/VcsFileStatus" - }, - "description": "VCS status" - } - } - } - }, - "400": { - "description": "Bad request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BadRequestError" - } - } - } - } - }, - "description": "Retrieve changed files in the current working tree without patches.", - "summary": "Get VCS status", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.vcs.status({\n ...\n})" - } - ] - } - }, - "/vcs/diff": { - "get": { - "tags": ["instance"], - "operationId": "vcs.diff", - "parameters": [ - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "mode", - "in": "query", - "schema": { - "type": "string", - "enum": ["git", "branch"] - }, - "required": true - }, - { - "name": "context", - "in": "query", - "schema": { - "type": "integer", - "minimum": 0 - }, - "required": false - } - ], - "responses": { - "200": { - "description": "VCS diff", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/VcsFileDiff" - }, - "description": "VCS diff" - } - } - } - }, - "400": { - "description": "Bad request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BadRequestError" - } - } - } - } - }, - "description": "Retrieve the current git diff for the working tree or against the default branch.", - "summary": "Get VCS diff", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.vcs.diff({\n ...\n})" - } - ] - } - }, - "/vcs/diff/raw": { - "get": { - "tags": ["instance"], - "operationId": "vcs.diff.raw", - "parameters": [ - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "Raw VCS diff", - "content": { - "text/x-diff; charset=utf-8": { - "schema": { - "type": "string" - } - } - } - }, - "400": { - "description": "Bad request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BadRequestError" - } - } - } - } - }, - "description": "Retrieve a raw patch for current uncommitted changes.", - "summary": "Get raw VCS diff", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.vcs.diff.raw({\n ...\n})" - } - ] - } - }, - "/vcs/apply": { - "post": { - "tags": ["instance"], - "operationId": "vcs.apply", - "parameters": [ - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "VCS patch applied", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "applied": { - "type": "boolean" - } - }, - "required": ["applied"], - "additionalProperties": false, - "description": "VCS patch applied" - } - } - } - }, - "400": { - "description": "VcsApplyError | InvalidRequestError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/VcsApplyError" - }, - { - "$ref": "#/components/schemas/InvalidRequestError" - } - ] - } - } - } - } - }, - "description": "Apply a raw patch to the current working tree.", - "summary": "Apply VCS patch", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "patch": { - "type": "string" - } - }, - "required": ["patch"], - "additionalProperties": false - } - } - } - }, - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.vcs.apply({\n ...\n})" - } - ] - } - }, - "/command": { - "get": { - "tags": ["instance"], - "operationId": "command.list", - "parameters": [ - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "List of commands", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Command" - }, - "description": "List of commands" - } - } - } - }, - "400": { - "description": "Bad request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BadRequestError" - } - } - } - } - }, - "description": "Get a list of all available commands in the OpenCode system.", - "summary": "List commands", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.command.list({\n ...\n})" - } - ] - } - }, - "/agent": { - "get": { - "tags": ["instance"], - "operationId": "app.agents", - "parameters": [ - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "List of agents", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Agent" - }, - "description": "List of agents" - } - } - } - }, - "400": { - "description": "Bad request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BadRequestError" - } - } - } - } - }, - "description": "Get a list of all available AI agents in the OpenCode system.", - "summary": "List agents", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.app.agents({\n ...\n})" - } - ] - } - }, - "/skill": { - "get": { - "tags": ["instance"], - "operationId": "app.skills", - "parameters": [ - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "List of skills", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "location": { - "type": "string" - }, - "content": { - "type": "string" - } - }, - "required": ["name", "location", "content"], - "additionalProperties": false - }, - "description": "List of skills" - } - } - } - }, - "400": { - "description": "Bad request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BadRequestError" - } - } - } - } - }, - "description": "Get a list of all available skills in the OpenCode system.", - "summary": "List skills", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.app.skills({\n ...\n})" - } - ] - } - }, - "/lsp": { - "get": { - "tags": ["instance"], - "operationId": "lsp.status", - "parameters": [ - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "LSP server status", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/LSPStatus" - }, - "description": "LSP server status" - } - } - } - }, - "400": { - "description": "Bad request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BadRequestError" - } - } - } - } - }, - "description": "Get LSP server status", - "summary": "Get LSP status", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.lsp.status({\n ...\n})" - } - ] - } - }, - "/formatter": { - "get": { - "tags": ["instance"], - "operationId": "formatter.status", - "parameters": [ - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "Formatter status", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/FormatterStatus" - }, - "description": "Formatter status" - } - } - } - }, - "400": { - "description": "Bad request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BadRequestError" - } - } - } - } - }, - "description": "Get formatter status", - "summary": "Get formatter status", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.formatter.status({\n ...\n})" - } - ] - } - }, - "/mcp": { - "get": { - "tags": ["mcp"], - "operationId": "mcp.status", - "parameters": [ - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "MCP server status", - "content": { - "application/json": { - "schema": { - "type": "object", - "additionalProperties": { - "$ref": "#/components/schemas/MCPStatus" - }, - "description": "MCP server status" - } - } - } - }, - "400": { - "description": "Bad request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BadRequestError" - } - } - } - } - }, - "description": "Get the status of all Model Context Protocol (MCP) servers.", - "summary": "Get MCP status", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.status({\n ...\n})" - } - ] - }, - "post": { - "tags": ["mcp"], - "operationId": "mcp.add", - "parameters": [ - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "MCP server added successfully", - "content": { - "application/json": { - "schema": { - "type": "object", - "additionalProperties": { - "$ref": "#/components/schemas/MCPStatus" - }, - "description": "MCP server added successfully" - } - } - } - }, - "400": { - "description": "BadRequest | InvalidRequestError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/effect_HttpApiError_BadRequest" - }, - { - "$ref": "#/components/schemas/InvalidRequestError" - } - ] - } - } - } - } - }, - "description": "Dynamically add a new Model Context Protocol (MCP) server to the system.", - "summary": "Add MCP server", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "config": { - "anyOf": [ - { - "$ref": "#/components/schemas/McpLocalConfig" - }, - { - "$ref": "#/components/schemas/McpRemoteConfig" - } - ] - } - }, - "required": ["name", "config"], - "additionalProperties": false - } - } - } - }, - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.add({\n ...\n})" - } - ] - } - }, - "/mcp/{name}/auth": { - "post": { - "tags": ["mcp"], - "operationId": "mcp.auth.start", - "parameters": [ - { - "name": "name", - "in": "path", - "schema": { - "type": "string" - }, - "required": true - }, - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "OAuth flow started", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "authorizationUrl": { - "type": "string" - }, - "oauthState": { - "type": "string" - } - }, - "required": ["authorizationUrl", "oauthState"], - "additionalProperties": false, - "description": "OAuth flow started" - } - } - } - }, - "400": { - "description": "McpUnsupportedOAuthError | InvalidRequestError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/McpUnsupportedOAuthError" - }, - { - "$ref": "#/components/schemas/InvalidRequestError" - } - ] - } - } - } - }, - "404": { - "description": "McpServerNotFoundError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/McpServerNotFoundError" - } - } - } - } - }, - "description": "Start OAuth authentication flow for a Model Context Protocol (MCP) server.", - "summary": "Start MCP OAuth", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.start({\n ...\n})" - } - ] - }, - "delete": { - "tags": ["mcp"], - "operationId": "mcp.auth.remove", - "parameters": [ - { - "name": "name", - "in": "path", - "schema": { - "type": "string" - }, - "required": true - }, - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "OAuth credentials removed", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "enum": [true] - } - }, - "required": ["success"], - "additionalProperties": false, - "description": "OAuth credentials removed" - } - } - } - }, - "400": { - "description": "Bad request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BadRequestError" - } - } - } - }, - "404": { - "description": "McpServerNotFoundError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/McpServerNotFoundError" - } - } - } - } - }, - "description": "Remove OAuth credentials for an MCP server.", - "summary": "Remove MCP OAuth", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.remove({\n ...\n})" - } - ] - } - }, - "/mcp/{name}/auth/callback": { - "post": { - "tags": ["mcp"], - "operationId": "mcp.auth.callback", - "parameters": [ - { - "name": "name", - "in": "path", - "schema": { - "type": "string" - }, - "required": true - }, - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "OAuth authentication completed", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/MCPStatus" - } - } - } - }, - "400": { - "description": "BadRequest | InvalidRequestError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/effect_HttpApiError_BadRequest" - }, - { - "$ref": "#/components/schemas/InvalidRequestError" - } - ] - } - } - } - }, - "404": { - "description": "McpServerNotFoundError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/McpServerNotFoundError" - } - } - } - } - }, - "description": "Complete OAuth authentication for a Model Context Protocol (MCP) server using the authorization code.", - "summary": "Complete MCP OAuth", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - } - }, - "required": ["code"], - "additionalProperties": false - } - } - } - }, - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.callback({\n ...\n})" - } - ] - } - }, - "/mcp/{name}/auth/authenticate": { - "post": { - "tags": ["mcp"], - "operationId": "mcp.auth.authenticate", - "parameters": [ - { - "name": "name", - "in": "path", - "schema": { - "type": "string" - }, - "required": true - }, - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "OAuth authentication completed", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/MCPStatus" - } - } - } - }, - "400": { - "description": "McpUnsupportedOAuthError | InvalidRequestError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/McpUnsupportedOAuthError" - }, - { - "$ref": "#/components/schemas/InvalidRequestError" - } - ] - } - } - } - }, - "404": { - "description": "McpServerNotFoundError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/McpServerNotFoundError" - } - } - } - } - }, - "description": "Start OAuth flow and wait for callback (opens browser).", - "summary": "Authenticate MCP OAuth", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.auth.authenticate({\n ...\n})" - } - ] - } - }, - "/mcp/{name}/connect": { - "post": { - "tags": ["mcp"], - "operationId": "mcp.connect", - "parameters": [ - { - "name": "name", - "in": "path", - "schema": { - "type": "string" - }, - "required": true - }, - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "MCP server connected successfully", - "content": { - "application/json": { - "schema": { - "type": "boolean", - "description": "MCP server connected successfully" - } - } - } - }, - "400": { - "description": "Bad request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BadRequestError" - } - } - } - }, - "404": { - "description": "McpServerNotFoundError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/McpServerNotFoundError" - } - } - } - } - }, - "description": "Connect an MCP server.", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.connect({\n ...\n})" - } - ] - } - }, - "/mcp/{name}/disconnect": { - "post": { - "tags": ["mcp"], - "operationId": "mcp.disconnect", - "parameters": [ - { - "name": "name", - "in": "path", - "schema": { - "type": "string" - }, - "required": true - }, - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "MCP server disconnected successfully", - "content": { - "application/json": { - "schema": { - "type": "boolean", - "description": "MCP server disconnected successfully" - } - } - } - }, - "400": { - "description": "Bad request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BadRequestError" - } - } - } - }, - "404": { - "description": "McpServerNotFoundError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/McpServerNotFoundError" - } - } - } - } - }, - "description": "Disconnect an MCP server.", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.mcp.disconnect({\n ...\n})" - } - ] - } - }, - "/project": { - "get": { - "tags": ["project"], - "operationId": "project.list", - "parameters": [ - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "List of projects", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Project" - }, - "description": "List of projects" - } - } - } - }, - "400": { - "description": "Bad request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BadRequestError" - } - } - } - } - }, - "description": "Get a list of projects that have been opened with OpenCode.", - "summary": "List all projects", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.list({\n ...\n})" - } - ] - } - }, - "/project/current": { - "get": { - "tags": ["project"], - "operationId": "project.current", - "parameters": [ - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "Current project information", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Project" - } - } - } - }, - "400": { - "description": "Bad request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BadRequestError" - } - } - } - } - }, - "description": "Retrieve the currently active project that OpenCode is working with.", - "summary": "Get current project", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.current({\n ...\n})" - } - ] - } - }, - "/project/git/init": { - "post": { - "tags": ["project"], - "operationId": "project.initGit", - "parameters": [ - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "Project information after git initialization", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Project" - } - } - } - }, - "400": { - "description": "Bad request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BadRequestError" - } - } - } - } - }, - "description": "Create a git repository for the current project and return the refreshed project info.", - "summary": "Initialize git repository", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.initGit({\n ...\n})" - } - ] - } - }, - "/project/{projectID}": { - "patch": { - "tags": ["project"], - "operationId": "project.update", - "parameters": [ - { - "name": "projectID", - "in": "path", - "schema": { - "type": "string" - }, - "required": true - }, - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "Updated project information", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Project" - } - } - } - }, - "400": { - "description": "BadRequest | InvalidRequestError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/effect_HttpApiError_BadRequest" - }, - { - "$ref": "#/components/schemas/InvalidRequestError" - } - ] - } - } - } - }, - "404": { - "description": "ProjectNotFoundError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProjectNotFoundError" - } - } - } - } - }, - "description": "Update project properties such as name, icon, and commands.", - "summary": "Update project", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "icon": { - "$ref": "#/components/schemas/ProjectIcon" - }, - "commands": { - "$ref": "#/components/schemas/ProjectCommands" - } - }, - "additionalProperties": false - } - } - } - }, - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.update({\n ...\n})" - } - ] - } - }, - "/project/{projectID}/directories": { - "get": { - "tags": ["project"], - "operationId": "project.directories", - "parameters": [ - { - "name": "projectID", - "in": "path", - "schema": { - "type": "string" - }, - "required": true - }, - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "Project directories", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProjectDirectories" - } - } - } - }, - "400": { - "description": "Bad request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BadRequestError" - } - } - } - } - }, - "description": "List known local absolute directories for a project.", - "summary": "List project directories", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.project.directories({\n ...\n})" - } - ] - } - }, - "/experimental/project/{projectID}/copy/generate-name": { - "post": { - "tags": ["projectCopy"], - "operationId": "experimental.projectCopy.generateName", - "parameters": [ - { - "name": "projectID", - "in": "path", - "schema": { - "type": "string" - }, - "required": true - }, - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "name": { - "type": "string" - } - }, - "required": ["name"], - "additionalProperties": false - } - } - } - }, - "400": { - "description": "Bad request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BadRequestError" - } - } - } - } - }, - "description": "Generate a short name for a project copy from task context.", - "summary": "Generate project copy name", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "context": { - "type": "string" - } - }, - "additionalProperties": false - } - } - } - }, - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.projectCopy.generateName({\n ...\n})" - } - ] - } - }, - "/pty/shells": { - "get": { - "tags": ["pty"], - "operationId": "pty.shells", - "parameters": [ - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "List of shells", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "type": "object", - "properties": { - "path": { - "type": "string" - }, - "name": { - "type": "string" - }, - "acceptable": { - "type": "boolean" - } - }, - "required": ["path", "name", "acceptable"], - "additionalProperties": false - }, - "description": "List of shells" - } - } - } - }, - "400": { - "description": "Bad request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BadRequestError" - } - } - } - } - }, - "description": "Get a list of available shells on the system.", - "summary": "List available shells", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.shells({\n ...\n})" - } - ] - } - }, - "/pty": { - "get": { - "tags": ["pty"], - "operationId": "pty.list", - "parameters": [ - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "List of sessions", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Pty" - }, - "description": "List of sessions" - } - } - } - }, - "400": { - "description": "Bad request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BadRequestError" - } - } - } - } - }, - "description": "Get a list of all active pseudo-terminal (PTY) sessions managed by OpenCode.", - "summary": "List PTY sessions", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.list({\n ...\n})" - } - ] - }, - "post": { - "tags": ["pty"], - "operationId": "pty.create", - "parameters": [ - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "Created session", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Pty" - } - } - } - }, - "400": { - "description": "BadRequest | InvalidRequestError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/effect_HttpApiError_BadRequest" - }, - { - "$ref": "#/components/schemas/InvalidRequestError" - } - ] - } - } - } - } - }, - "description": "Create a new pseudo-terminal (PTY) session for running shell commands and processes.", - "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 - } - } - } - }, - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.create({\n ...\n})" - } - ] - } - }, - "/pty/{ptyID}": { - "get": { - "tags": ["pty"], - "operationId": "pty.get", - "parameters": [ - { - "name": "ptyID", - "in": "path", - "schema": { - "type": "string", - "pattern": "^pty" - }, - "required": true - }, - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "Session info", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Pty" - } - } - } - }, - "400": { - "description": "Bad request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BadRequestError" - } - } - } - }, - "404": { - "description": "PtyNotFoundError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PtyNotFoundError" - } - } - } - } - }, - "description": "Retrieve detailed information about a specific pseudo-terminal (PTY) session.", - "summary": "Get PTY session", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.get({\n ...\n})" - } - ] - }, - "put": { - "tags": ["pty"], - "operationId": "pty.update", - "parameters": [ - { - "name": "ptyID", - "in": "path", - "schema": { - "type": "string", - "pattern": "^pty" - }, - "required": true - }, - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "Updated session", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Pty" - } - } - } - }, - "400": { - "description": "BadRequest | InvalidRequestError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/effect_HttpApiError_BadRequest" - }, - { - "$ref": "#/components/schemas/InvalidRequestError" - } - ] - } - } - } - }, - "404": { - "description": "PtyNotFoundError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PtyNotFoundError" - } - } - } - } - }, - "description": "Update properties of an existing pseudo-terminal (PTY) session.", - "summary": "Update PTY session", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "title": { - "type": "string" - }, - "size": { - "type": "object", - "properties": { - "rows": { - "type": "integer", - "exclusiveMinimum": 0 - }, - "cols": { - "type": "integer", - "exclusiveMinimum": 0 - } - }, - "required": ["rows", "cols"], - "additionalProperties": false - } - }, - "additionalProperties": false - } - } - } - }, - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.update({\n ...\n})" - } - ] - }, - "delete": { - "tags": ["pty"], - "operationId": "pty.remove", - "parameters": [ - { - "name": "ptyID", - "in": "path", - "schema": { - "type": "string", - "pattern": "^pty" - }, - "required": true - }, - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "Session removed", - "content": { - "application/json": { - "schema": { - "type": "boolean", - "description": "Session removed" - } - } - } - }, - "400": { - "description": "Bad request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BadRequestError" - } - } - } - }, - "404": { - "description": "PtyNotFoundError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PtyNotFoundError" - } - } - } - } - }, - "description": "Remove and terminate a specific pseudo-terminal (PTY) session.", - "summary": "Remove PTY session", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.remove({\n ...\n})" - } - ] - } - }, - "/pty/{ptyID}/connect-token": { - "post": { - "tags": ["pty"], - "operationId": "pty.connectToken", - "parameters": [ - { - "name": "ptyID", - "in": "path", - "schema": { - "type": "string", - "pattern": "^pty" - }, - "required": true - }, - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "WebSocket connect token", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PtyTicketConnectToken" - } - } - } - }, - "400": { - "description": "Bad request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BadRequestError" - } - } - } - }, - "403": { - "description": "PtyForbiddenError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PtyForbiddenError" - } - } - } - }, - "404": { - "description": "PtyNotFoundError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PtyNotFoundError" - } - } - } - } - }, - "description": "Create a short-lived ticket for opening a PTY WebSocket connection.", - "summary": "Create PTY WebSocket token", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.connectToken({\n ...\n})" - } - ] - } - }, - "/question": { - "get": { - "tags": ["question"], - "operationId": "question.list", - "parameters": [ - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "List of pending questions", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/QuestionRequest" - }, - "description": "List of pending questions" - } - } - } - }, - "400": { - "description": "Bad request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BadRequestError" - } - } - } - } - }, - "description": "Get all pending question requests across all sessions.", - "summary": "List pending questions", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.question.list({\n ...\n})" - } - ] - } - }, - "/question/{requestID}/reply": { - "post": { - "tags": ["question"], - "operationId": "question.reply", - "parameters": [ - { - "name": "requestID", - "in": "path", - "schema": { - "type": "string", - "pattern": "^que" - }, - "required": true - }, - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "Question answered successfully", - "content": { - "application/json": { - "schema": { - "type": "boolean", - "description": "Question answered successfully" - } - } - } - }, - "400": { - "description": "BadRequest | InvalidRequestError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/effect_HttpApiError_BadRequest" - }, - { - "$ref": "#/components/schemas/InvalidRequestError" - } - ] - } - } - } - }, - "404": { - "description": "QuestionNotFoundError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/QuestionNotFoundError" - } - } - } - } - }, - "description": "Provide answers to a question request from the AI assistant.", - "summary": "Reply to question request", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "answers": { - "type": "array", - "items": { - "$ref": "#/components/schemas/QuestionAnswer" - }, - "description": "User answers in order of questions (each answer is an array of selected labels)" - } - }, - "required": ["answers"], - "additionalProperties": false - } - } - } - }, - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.question.reply({\n ...\n})" - } - ] - } - }, - "/question/{requestID}/reject": { - "post": { - "tags": ["question"], - "operationId": "question.reject", - "parameters": [ - { - "name": "requestID", - "in": "path", - "schema": { - "type": "string", - "pattern": "^que" - }, - "required": true - }, - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "Question rejected successfully", - "content": { - "application/json": { - "schema": { - "type": "boolean", - "description": "Question rejected successfully" - } - } - } - }, - "400": { - "description": "BadRequest | InvalidRequestError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/effect_HttpApiError_BadRequest" - }, - { - "$ref": "#/components/schemas/InvalidRequestError" - } - ] - } - } - } - }, - "404": { - "description": "QuestionNotFoundError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/QuestionNotFoundError" - } - } - } - } - }, - "description": "Reject a question request from the AI assistant.", - "summary": "Reject question request", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.question.reject({\n ...\n})" - } - ] - } - }, - "/permission": { - "get": { - "tags": ["permission"], - "operationId": "permission.list", - "parameters": [ - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "List of pending permissions", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/PermissionRequest" - }, - "description": "List of pending permissions" - } - } - } - }, - "400": { - "description": "Bad request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BadRequestError" - } - } - } - } - }, - "description": "Get all pending permission requests across all sessions.", - "summary": "List pending permissions", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.permission.list({\n ...\n})" - } - ] - } - }, - "/permission/{requestID}/reply": { - "post": { - "tags": ["permission"], - "operationId": "permission.reply", - "parameters": [ - { - "name": "requestID", - "in": "path", - "schema": { - "type": "string", - "pattern": "^per" - }, - "required": true - }, - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "Permission processed successfully", - "content": { - "application/json": { - "schema": { - "type": "boolean", - "description": "Permission processed successfully" - } - } - } - }, - "400": { - "description": "BadRequest | InvalidRequestError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/effect_HttpApiError_BadRequest" - }, - { - "$ref": "#/components/schemas/InvalidRequestError" - } - ] - } - } - } - }, - "404": { - "description": "PermissionNotFoundError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PermissionNotFoundError" - } - } - } - } - }, - "description": "Approve or deny a permission request from the AI assistant.", - "summary": "Respond to permission request", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "reply": { - "type": "string", - "enum": ["once", "always", "reject"] - }, - "message": { - "type": "string" - } - }, - "required": ["reply"], - "additionalProperties": false - } - } - } - }, - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.permission.reply({\n ...\n})" - } - ] - } - }, - "/provider": { - "get": { - "tags": ["provider"], - "operationId": "provider.list", - "parameters": [ - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "List of providers", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "all": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Provider" - } - }, - "default": { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "connected": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": ["all", "default", "connected"], - "additionalProperties": false, - "description": "List of providers" - } - } - } - }, - "400": { - "description": "Bad request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BadRequestError" - } - } - } - } - }, - "description": "Get a list of all available AI providers, including both available and connected ones.", - "summary": "List providers", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.list({\n ...\n})" - } - ] - } - }, - "/provider/auth": { - "get": { - "tags": ["provider"], - "operationId": "provider.auth", - "parameters": [ - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "Provider auth methods", - "content": { - "application/json": { - "schema": { - "type": "object", - "additionalProperties": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ProviderAuthMethod" - } - }, - "description": "Provider auth methods" - } - } - } - }, - "400": { - "description": "Bad request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BadRequestError" - } - } - } - } - }, - "description": "Retrieve available authentication methods for all AI providers.", - "summary": "Get provider auth methods", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.auth({\n ...\n})" - } - ] - } - }, - "/provider/{providerID}/oauth/authorize": { - "post": { - "tags": ["provider"], - "operationId": "provider.oauth.authorize", - "parameters": [ - { - "name": "providerID", - "in": "path", - "schema": { - "type": "string" - }, - "required": true - }, - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "Authorization URL and method", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProviderAuthAuthorization" - } - } - } - }, - "400": { - "description": "ProviderAuthError | InvalidRequestError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/ProviderAuthError1" - }, - { - "$ref": "#/components/schemas/InvalidRequestError" - } - ] - } - } - } - } - }, - "description": "Start the OAuth authorization flow for a provider.", - "summary": "Start OAuth authorization", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "method": { - "type": "number", - "description": "Auth method index" - }, - "inputs": { - "type": "object", - "additionalProperties": { - "type": "string" - } - } - }, - "required": ["method"], - "additionalProperties": false - } - } - } - }, - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.oauth.authorize({\n ...\n})" - } - ] - } - }, - "/provider/{providerID}/oauth/callback": { - "post": { - "tags": ["provider"], - "operationId": "provider.oauth.callback", - "parameters": [ - { - "name": "providerID", - "in": "path", - "schema": { - "type": "string" - }, - "required": true - }, - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "OAuth callback processed successfully", - "content": { - "application/json": { - "schema": { - "type": "boolean", - "description": "OAuth callback processed successfully" - } - } - } - }, - "400": { - "description": "ProviderAuthError | InvalidRequestError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/ProviderAuthError1" - }, - { - "$ref": "#/components/schemas/InvalidRequestError" - } - ] - } - } - } - } - }, - "description": "Handle the OAuth callback from a provider after user authorization.", - "summary": "Handle OAuth callback", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "method": { - "type": "number", - "description": "Auth method index" - }, - "code": { - "type": "string" - } - }, - "required": ["method"], - "additionalProperties": false - } - } - } - }, - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.provider.oauth.callback({\n ...\n})" - } - ] - } - }, - "/session": { - "get": { - "tags": ["session"], - "operationId": "session.list", - "parameters": [ - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "scope", - "in": "query", - "schema": { - "type": "string", - "enum": ["project"] - }, - "required": false - }, - { - "name": "path", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "roots", - "in": "query", - "schema": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "string", - "enum": ["true", "false"] - } - ] - }, - "required": false - }, - { - "name": "start", - "in": "query", - "schema": { - "type": "number" - }, - "required": false - }, - { - "name": "search", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "limit", - "in": "query", - "schema": { - "type": "number" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "List of sessions", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Session" - }, - "description": "List of sessions" - } - } - } - }, - "400": { - "description": "Bad request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BadRequestError" - } - } - } - } - }, - "description": "Get a list of all OpenCode sessions, sorted by most recently updated.", - "summary": "List sessions", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.list({\n ...\n})" - } - ] - }, - "post": { - "tags": ["session"], - "operationId": "session.create", - "parameters": [ - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "Successfully created session", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Session" - } - } - } - }, - "400": { - "description": "BadRequest | InvalidRequestError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/effect_HttpApiError_BadRequest" - }, - { - "$ref": "#/components/schemas/InvalidRequestError" - } - ] - } - } - } - } - }, - "description": "Create a new OpenCode session for interacting with AI assistants and managing conversations.", - "summary": "Create session", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "parentID": { - "type": "string", - "pattern": "^ses" - }, - "title": { - "type": "string" - }, - "agent": { - "type": "string" - }, - "model": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "providerID": { - "type": "string" - }, - "variant": { - "type": "string" - } - }, - "required": ["id", "providerID"], - "additionalProperties": false - }, - "metadata": { - "type": "object" - }, - "permission": { - "$ref": "#/components/schemas/PermissionRuleset" - }, - "workspaceID": { - "type": "string", - "pattern": "^wrk" - } - }, - "additionalProperties": false - } - } - } - }, - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.create({\n ...\n})" - } - ] - } - }, - "/session/status": { - "get": { - "tags": ["session"], - "operationId": "session.status", - "parameters": [ - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "Get session status", - "content": { - "application/json": { - "schema": { - "type": "object", - "additionalProperties": { - "$ref": "#/components/schemas/SessionStatus" - }, - "description": "Get session status" - } - } - } - }, - "400": { - "description": "BadRequest | InvalidRequestError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/effect_HttpApiError_BadRequest" - }, - { - "$ref": "#/components/schemas/InvalidRequestError" - } - ] - } - } - } - } - }, - "description": "Retrieve the current status of all sessions, including active, idle, and completed states.", - "summary": "Get session status", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.status({\n ...\n})" - } - ] - } - }, - "/session/{sessionID}": { - "get": { - "tags": ["session"], - "operationId": "session.get", - "parameters": [ - { - "name": "sessionID", - "in": "path", - "schema": { - "type": "string", - "pattern": "^ses" - }, - "required": true - }, - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "Get session", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Session" - } - } - } - }, - "400": { - "description": "BadRequest | InvalidRequestError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/effect_HttpApiError_BadRequest" - }, - { - "$ref": "#/components/schemas/InvalidRequestError" - } - ] - } - } - } - }, - "404": { - "description": "NotFoundError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/NotFoundError" - } - } - } - } - }, - "description": "Retrieve detailed information about a specific OpenCode session.", - "summary": "Get session", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.get({\n ...\n})" - } - ] - }, - "delete": { - "tags": ["session"], - "operationId": "session.delete", - "parameters": [ - { - "name": "sessionID", - "in": "path", - "schema": { - "type": "string", - "pattern": "^ses" - }, - "required": true - }, - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "Successfully deleted session", - "content": { - "application/json": { - "schema": { - "type": "boolean", - "description": "Successfully deleted session" - } - } - } - }, - "400": { - "description": "BadRequest | InvalidRequestError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/effect_HttpApiError_BadRequest" - }, - { - "$ref": "#/components/schemas/InvalidRequestError" - } - ] - } - } - } - }, - "404": { - "description": "NotFoundError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/NotFoundError" - } - } - } - } - }, - "description": "Delete a session and permanently remove all associated data, including messages and history.", - "summary": "Delete session", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.delete({\n ...\n})" - } - ] - }, - "patch": { - "tags": ["session"], - "operationId": "session.update", - "parameters": [ - { - "name": "sessionID", - "in": "path", - "schema": { - "type": "string", - "pattern": "^ses" - }, - "required": true - }, - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "Successfully updated session", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Session" - } - } - } - }, - "400": { - "description": "BadRequest | InvalidRequestError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/effect_HttpApiError_BadRequest" - }, - { - "$ref": "#/components/schemas/InvalidRequestError" - } - ] - } - } - } - }, - "404": { - "description": "NotFoundError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/NotFoundError" - } - } - } - } - }, - "description": "Update properties of an existing session, such as title or other metadata.", - "summary": "Update session", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "title": { - "type": "string" - }, - "metadata": { - "type": "object" - }, - "permission": { - "$ref": "#/components/schemas/PermissionRuleset" - }, - "time": { - "type": "object", - "properties": { - "archived": { - "type": "number" - } - }, - "additionalProperties": false - } - }, - "additionalProperties": false - } - } - } - }, - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.update({\n ...\n})" - } - ] - } - }, - "/session/{sessionID}/children": { - "get": { - "tags": ["session"], - "operationId": "session.children", - "parameters": [ - { - "name": "sessionID", - "in": "path", - "schema": { - "type": "string", - "pattern": "^ses" - }, - "required": true - }, - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "List of children", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Session" - }, - "description": "List of children" - } - } - } - }, - "400": { - "description": "BadRequest | InvalidRequestError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/effect_HttpApiError_BadRequest" - }, - { - "$ref": "#/components/schemas/InvalidRequestError" - } - ] - } - } - } - }, - "404": { - "description": "NotFoundError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/NotFoundError" - } - } - } - } - }, - "description": "Retrieve all child sessions that were forked from the specified parent session.", - "summary": "Get session children", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.children({\n ...\n})" - } - ] - } - }, - "/session/{sessionID}/diff": { - "get": { - "tags": ["session"], - "operationId": "session.diff", - "parameters": [ - { - "name": "sessionID", - "in": "path", - "schema": { - "type": "string", - "pattern": "^ses" - }, - "required": true - }, - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "messageID", - "in": "query", - "schema": { - "type": "string", - "pattern": "^msg" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "Successfully retrieved diff", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/SnapshotFileDiff" - }, - "description": "Successfully retrieved diff" - } - } - } - }, - "400": { - "description": "Bad request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BadRequestError" - } - } - } - } - }, - "description": "Get the file changes (diff) that resulted from a specific user message in the session.", - "summary": "Get message diff", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.diff({\n ...\n})" - } - ] - } - }, - "/session/{sessionID}/message": { - "get": { - "tags": ["session"], - "operationId": "session.messages", - "parameters": [ - { - "name": "sessionID", - "in": "path", - "schema": { - "type": "string", - "pattern": "^ses" - }, - "required": true - }, - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "limit", - "in": "query", - "schema": { - "type": "integer", - "minimum": 0, - "maximum": 9007199254740991 - }, - "required": false - }, - { - "name": "before", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "List of messages", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "type": "object", - "properties": { - "info": { - "$ref": "#/components/schemas/Message" - }, - "parts": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Part" - } - } - }, - "required": ["info", "parts"], - "additionalProperties": false - }, - "description": "List of messages" - } - } - } - }, - "400": { - "description": "BadRequest | InvalidRequestError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/effect_HttpApiError_BadRequest" - }, - { - "$ref": "#/components/schemas/InvalidRequestError" - } - ] - } - } - } - }, - "404": { - "description": "NotFoundError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/NotFoundError" - } - } - } - } - }, - "description": "Retrieve all messages in a session, including user prompts and AI responses.", - "summary": "Get session messages", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.messages({\n ...\n})" - } - ] - }, - "post": { - "tags": ["session"], - "operationId": "session.prompt", - "parameters": [ - { - "name": "sessionID", - "in": "path", - "schema": { - "type": "string", - "pattern": "^ses" - }, - "required": true - }, - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "Created message", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": ["info", "parts"], - "properties": { - "info": { - "$ref": "#/components/schemas/AssistantMessage" - }, - "parts": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Part" - } - } - } - } - } - } - }, - "400": { - "description": "BadRequest | InvalidRequestError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/effect_HttpApiError_BadRequest" - }, - { - "$ref": "#/components/schemas/InvalidRequestError" - } - ] - } - } - } - }, - "404": { - "description": "NotFoundError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/NotFoundError" - } - } - } - } - }, - "description": "Create and send a new message to a session, streaming the AI response.", - "summary": "Send message", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "messageID": { - "type": "string", - "pattern": "^msg" - }, - "model": { - "type": "object", - "properties": { - "providerID": { - "type": "string" - }, - "modelID": { - "type": "string" - } - }, - "required": ["providerID", "modelID"], - "additionalProperties": false - }, - "agent": { - "type": "string" - }, - "noReply": { - "type": "boolean" - }, - "tools": { - "type": "object", - "additionalProperties": { - "type": "boolean" - } - }, - "format": { - "$ref": "#/components/schemas/OutputFormat" - }, - "system": { - "type": "string" - }, - "variant": { - "type": "string" - }, - "parts": { - "type": "array", - "items": { - "anyOf": [ - { - "$ref": "#/components/schemas/TextPartInput" - }, - { - "$ref": "#/components/schemas/FilePartInput" - }, - { - "$ref": "#/components/schemas/AgentPartInput" - }, - { - "$ref": "#/components/schemas/SubtaskPartInput" - } - ] - } - } - }, - "required": ["parts"], - "additionalProperties": false - } - } - } - }, - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.prompt({\n ...\n})" - } - ] - } - }, - "/session/{sessionID}/message/{messageID}": { - "get": { - "tags": ["session"], - "operationId": "session.message", - "parameters": [ - { - "name": "sessionID", - "in": "path", - "schema": { - "type": "string", - "pattern": "^ses" - }, - "required": true - }, - { - "name": "messageID", - "in": "path", - "schema": { - "type": "string", - "pattern": "^msg" - }, - "required": true - }, - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "Message", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "info": { - "$ref": "#/components/schemas/Message" - }, - "parts": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Part" - } - } - }, - "required": ["info", "parts"], - "additionalProperties": false, - "description": "Message" - } - } - } - }, - "400": { - "description": "BadRequest | InvalidRequestError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/effect_HttpApiError_BadRequest" - }, - { - "$ref": "#/components/schemas/InvalidRequestError" - } - ] - } - } - } - }, - "404": { - "description": "NotFoundError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/NotFoundError" - } - } - } - } - }, - "description": "Retrieve a specific message from a session by its message ID.", - "summary": "Get message", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.message({\n ...\n})" - } - ] - }, - "delete": { - "tags": ["session"], - "operationId": "session.deleteMessage", - "parameters": [ - { - "name": "sessionID", - "in": "path", - "schema": { - "type": "string", - "pattern": "^ses" - }, - "required": true - }, - { - "name": "messageID", - "in": "path", - "schema": { - "type": "string", - "pattern": "^msg" - }, - "required": true - }, - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "Successfully deleted message", - "content": { - "application/json": { - "schema": { - "type": "boolean", - "description": "Successfully deleted message" - } - } - } - }, - "400": { - "description": "BadRequest | InvalidRequestError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/effect_HttpApiError_BadRequest" - }, - { - "$ref": "#/components/schemas/InvalidRequestError" - } - ] - } - } - } - }, - "404": { - "description": "NotFoundError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/NotFoundError" - } - } - } - }, - "409": { - "description": "SessionBusyError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SessionBusyError" - } - } - } - } - }, - "description": "Permanently delete a specific message and all of its parts from a session without reverting file changes.", - "summary": "Delete message", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.deleteMessage({\n ...\n})" - } - ] - } - }, - "/session/{sessionID}/fork": { - "post": { - "tags": ["session"], - "operationId": "session.fork", - "parameters": [ - { - "name": "sessionID", - "in": "path", - "schema": { - "type": "string", - "pattern": "^ses" - }, - "required": true - }, - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "200", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Session" - } - } - } - }, - "400": { - "description": "BadRequest | InvalidRequestError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/effect_HttpApiError_BadRequest" - }, - { - "$ref": "#/components/schemas/InvalidRequestError" - } - ] - } - } - } - }, - "404": { - "description": "NotFoundError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/NotFoundError" - } - } - } - } - }, - "description": "Create a new session by forking an existing session at a specific message point.", - "summary": "Fork session", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "messageID": { - "type": "string", - "pattern": "^msg" - } - }, - "additionalProperties": false - } - } - } - }, - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.fork({\n ...\n})" - } - ] - } - }, - "/session/{sessionID}/abort": { - "post": { - "tags": ["session"], - "operationId": "session.abort", - "parameters": [ - { - "name": "sessionID", - "in": "path", - "schema": { - "type": "string", - "pattern": "^ses" - }, - "required": true - }, - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "Aborted session", - "content": { - "application/json": { - "schema": { - "type": "boolean", - "description": "Aborted session" - } - } - } - }, - "400": { - "description": "BadRequest | InvalidRequestError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/effect_HttpApiError_BadRequest" - }, - { - "$ref": "#/components/schemas/InvalidRequestError" - } - ] - } - } - } - } - }, - "description": "Abort an active session and stop any ongoing AI processing or command execution.", - "summary": "Abort session", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.abort({\n ...\n})" - } - ] - } - }, - "/session/{sessionID}/init": { - "post": { - "tags": ["session"], - "operationId": "session.init", - "parameters": [ - { - "name": "sessionID", - "in": "path", - "schema": { - "type": "string", - "pattern": "^ses" - }, - "required": true - }, - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "200", - "content": { - "application/json": { - "schema": { - "type": "boolean", - "description": "200" - } - } - } - }, - "400": { - "description": "BadRequest | InvalidRequestError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/effect_HttpApiError_BadRequest" - }, - { - "$ref": "#/components/schemas/InvalidRequestError" - } - ] - } - } - } - }, - "404": { - "description": "NotFoundError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/NotFoundError" - } - } - } - } - }, - "description": "Analyze the current application and create an AGENTS.md file with project-specific agent configurations.", - "summary": "Initialize session", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "modelID": { - "type": "string" - }, - "providerID": { - "type": "string" - }, - "messageID": { - "type": "string", - "pattern": "^msg" - } - }, - "required": ["modelID", "providerID", "messageID"], - "additionalProperties": false - } - } - } - }, - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.init({\n ...\n})" - } - ] - } - }, - "/session/{sessionID}/share": { - "post": { - "tags": ["session"], - "operationId": "session.share", - "parameters": [ - { - "name": "sessionID", - "in": "path", - "schema": { - "type": "string", - "pattern": "^ses" - }, - "required": true - }, - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "Successfully shared session", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Session" - } - } - } - }, - "400": { - "description": "Bad request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BadRequestError" - } - } - } - }, - "404": { - "description": "NotFoundError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/NotFoundError" - } - } - } - }, - "500": { - "description": "InternalServerError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/effect_HttpApiError_InternalServerError" - } - } - } - } - }, - "description": "Create a shareable link for a session, allowing others to view the conversation.", - "summary": "Share session", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.share({\n ...\n})" - } - ] - }, - "delete": { - "tags": ["session"], - "operationId": "session.unshare", - "parameters": [ - { - "name": "sessionID", - "in": "path", - "schema": { - "type": "string", - "pattern": "^ses" - }, - "required": true - }, - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "Successfully unshared session", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Session" - } - } - } - }, - "400": { - "description": "Bad request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BadRequestError" - } - } - } - }, - "404": { - "description": "NotFoundError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/NotFoundError" - } - } - } - }, - "500": { - "description": "InternalServerError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/effect_HttpApiError_InternalServerError" - } - } - } - } - }, - "description": "Remove the shareable link for a session, making it private again.", - "summary": "Unshare session", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.unshare({\n ...\n})" - } - ] - } - }, - "/session/{sessionID}/summarize": { - "post": { - "tags": ["session"], - "operationId": "session.summarize", - "parameters": [ - { - "name": "sessionID", - "in": "path", - "schema": { - "type": "string", - "pattern": "^ses" - }, - "required": true - }, - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "Summarized session", - "content": { - "application/json": { - "schema": { - "type": "boolean", - "description": "Summarized session" - } - } - } - }, - "400": { - "description": "BadRequest | InvalidRequestError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/effect_HttpApiError_BadRequest" - }, - { - "$ref": "#/components/schemas/InvalidRequestError" - } - ] - } - } - } - }, - "404": { - "description": "NotFoundError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/NotFoundError" - } - } - } - } - }, - "description": "Generate a concise summary of the session using AI compaction to preserve key information.", - "summary": "Summarize session", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "providerID": { - "type": "string" - }, - "modelID": { - "type": "string" - }, - "auto": { - "type": "boolean" - } - }, - "required": ["providerID", "modelID"], - "additionalProperties": false - } - } - } - }, - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.summarize({\n ...\n})" - } - ] - } - }, - "/session/{sessionID}/prompt_async": { - "post": { - "tags": ["session"], - "operationId": "session.prompt_async", - "parameters": [ - { - "name": "sessionID", - "in": "path", - "schema": { - "type": "string", - "pattern": "^ses" - }, - "required": true - }, - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "204": { - "description": "Prompt accepted" - }, - "400": { - "description": "BadRequest | InvalidRequestError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/effect_HttpApiError_BadRequest" - }, - { - "$ref": "#/components/schemas/InvalidRequestError" - } - ] - } - } - } - }, - "404": { - "description": "NotFoundError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/NotFoundError" - } - } - } - } - }, - "description": "Create and send a new message to a session asynchronously, starting the session if needed and returning immediately.", - "summary": "Send async message", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "messageID": { - "type": "string", - "pattern": "^msg" - }, - "model": { - "type": "object", - "properties": { - "providerID": { - "type": "string" - }, - "modelID": { - "type": "string" - } - }, - "required": ["providerID", "modelID"], - "additionalProperties": false - }, - "agent": { - "type": "string" - }, - "noReply": { - "type": "boolean" - }, - "tools": { - "type": "object", - "additionalProperties": { - "type": "boolean" - } - }, - "format": { - "$ref": "#/components/schemas/OutputFormat" - }, - "system": { - "type": "string" - }, - "variant": { - "type": "string" - }, - "parts": { - "type": "array", - "items": { - "anyOf": [ - { - "$ref": "#/components/schemas/TextPartInput" - }, - { - "$ref": "#/components/schemas/FilePartInput" - }, - { - "$ref": "#/components/schemas/AgentPartInput" - }, - { - "$ref": "#/components/schemas/SubtaskPartInput" - } - ] - } - } - }, - "required": ["parts"], - "additionalProperties": false - } - } - } - }, - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.prompt_async({\n ...\n})" - } - ] - } - }, - "/session/{sessionID}/command": { - "post": { - "tags": ["session"], - "operationId": "session.command", - "parameters": [ - { - "name": "sessionID", - "in": "path", - "schema": { - "type": "string", - "pattern": "^ses" - }, - "required": true - }, - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "Created message", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": ["info", "parts"], - "properties": { - "info": { - "$ref": "#/components/schemas/AssistantMessage" - }, - "parts": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Part" - } - } - } - } - } - } - }, - "400": { - "description": "BadRequest | InvalidRequestError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/effect_HttpApiError_BadRequest" - }, - { - "$ref": "#/components/schemas/InvalidRequestError" - } - ] - } - } - } - }, - "404": { - "description": "NotFoundError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/NotFoundError" - } - } - } - } - }, - "description": "Send a new command to a session for execution by the AI assistant.", - "summary": "Send command", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "messageID": { - "type": "string", - "pattern": "^msg" - }, - "agent": { - "type": "string" - }, - "model": { - "type": "string" - }, - "arguments": { - "type": "string" - }, - "command": { - "type": "string" - }, - "variant": { - "type": "string" - }, - "parts": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^prt" - }, - "type": { - "type": "string", - "enum": ["file"] - }, - "mime": { - "type": "string" - }, - "filename": { - "type": "string" - }, - "url": { - "type": "string" - }, - "source": { - "$ref": "#/components/schemas/FilePartSource" - } - }, - "required": ["type", "mime", "url"], - "additionalProperties": false - } - } - }, - "required": ["arguments", "command"], - "additionalProperties": false - } - } - } - }, - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.command({\n ...\n})" - } - ] - } - }, - "/session/{sessionID}/shell": { - "post": { - "tags": ["session"], - "operationId": "session.shell", - "parameters": [ - { - "name": "sessionID", - "in": "path", - "schema": { - "type": "string", - "pattern": "^ses" - }, - "required": true - }, - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "Created message", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "info": { - "$ref": "#/components/schemas/Message" - }, - "parts": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Part" - } - } - }, - "required": ["info", "parts"], - "additionalProperties": false, - "description": "Created message" - } - } - } - }, - "400": { - "description": "BadRequest | InvalidRequestError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/effect_HttpApiError_BadRequest" - }, - { - "$ref": "#/components/schemas/InvalidRequestError" - } - ] - } - } - } - }, - "404": { - "description": "NotFoundError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/NotFoundError" - } - } - } - }, - "409": { - "description": "SessionBusyError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SessionBusyError" - } - } - } - } - }, - "description": "Execute a shell command within the session context and return the AI's response.", - "summary": "Run shell command", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "messageID": { - "type": "string", - "pattern": "^msg" - }, - "agent": { - "type": "string" - }, - "model": { - "type": "object", - "properties": { - "providerID": { - "type": "string" - }, - "modelID": { - "type": "string" - } - }, - "required": ["providerID", "modelID"], - "additionalProperties": false - }, - "command": { - "type": "string" - } - }, - "required": ["agent", "command"], - "additionalProperties": false - } - } - } - }, - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.shell({\n ...\n})" - } - ] - } - }, - "/session/{sessionID}/revert": { - "post": { - "tags": ["session"], - "operationId": "session.revert", - "parameters": [ - { - "name": "sessionID", - "in": "path", - "schema": { - "type": "string", - "pattern": "^ses" - }, - "required": true - }, - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "Updated session", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Session" - } - } - } - }, - "400": { - "description": "BadRequest | InvalidRequestError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/effect_HttpApiError_BadRequest" - }, - { - "$ref": "#/components/schemas/InvalidRequestError" - } - ] - } - } - } - }, - "404": { - "description": "NotFoundError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/NotFoundError" - } - } - } - }, - "409": { - "description": "SessionBusyError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SessionBusyError" - } - } - } - } - }, - "description": "Revert a specific message in a session, undoing its effects and restoring the previous state.", - "summary": "Revert message", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "messageID": { - "type": "string", - "pattern": "^msg" - }, - "partID": { - "type": "string", - "pattern": "^prt" - } - }, - "required": ["messageID"], - "additionalProperties": false - } - } - } - }, - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.revert({\n ...\n})" - } - ] - } - }, - "/session/{sessionID}/unrevert": { - "post": { - "tags": ["session"], - "operationId": "session.unrevert", - "parameters": [ - { - "name": "sessionID", - "in": "path", - "schema": { - "type": "string", - "pattern": "^ses" - }, - "required": true - }, - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "Updated session", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Session" - } - } - } - }, - "400": { - "description": "BadRequest | InvalidRequestError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/effect_HttpApiError_BadRequest" - }, - { - "$ref": "#/components/schemas/InvalidRequestError" - } - ] - } - } - } - }, - "404": { - "description": "NotFoundError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/NotFoundError" - } - } - } - }, - "409": { - "description": "SessionBusyError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SessionBusyError" - } - } - } - } - }, - "description": "Restore all previously reverted messages in a session.", - "summary": "Restore reverted messages", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.unrevert({\n ...\n})" - } - ] - } - }, - "/session/{sessionID}/permissions/{permissionID}": { - "post": { - "tags": ["session"], - "operationId": "permission.respond", - "parameters": [ - { - "name": "sessionID", - "in": "path", - "schema": { - "type": "string", - "pattern": "^ses" - }, - "required": true - }, - { - "name": "permissionID", - "in": "path", - "schema": { - "type": "string", - "pattern": "^per" - }, - "required": true - }, - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "Permission processed successfully", - "content": { - "application/json": { - "schema": { - "type": "boolean", - "description": "Permission processed successfully" - } - } - } - }, - "400": { - "description": "BadRequest | InvalidRequestError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/effect_HttpApiError_BadRequest" - }, - { - "$ref": "#/components/schemas/InvalidRequestError" - } - ] - } - } - } - }, - "404": { - "description": "NotFoundError | PermissionNotFoundError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/NotFoundError" - }, - { - "$ref": "#/components/schemas/PermissionNotFoundError" - } - ] - } - } - } - } - }, - "description": "Approve or deny a permission request from the AI assistant.", - "summary": "Respond to permission", - "deprecated": true, - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "response": { - "type": "string", - "enum": ["once", "always", "reject"] - } - }, - "required": ["response"], - "additionalProperties": false - } - } - } - }, - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.permission.respond({\n ...\n})" - } - ] - } - }, - "/session/{sessionID}/message/{messageID}/part/{partID}": { - "delete": { - "tags": ["session"], - "operationId": "part.delete", - "parameters": [ - { - "name": "sessionID", - "in": "path", - "schema": { - "type": "string", - "pattern": "^ses" - }, - "required": true - }, - { - "name": "messageID", - "in": "path", - "schema": { - "type": "string", - "pattern": "^msg" - }, - "required": true - }, - { - "name": "partID", - "in": "path", - "schema": { - "type": "string", - "pattern": "^prt" - }, - "required": true - }, - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "Successfully deleted part", - "content": { - "application/json": { - "schema": { - "type": "boolean", - "description": "Successfully deleted part" - } - } - } - }, - "400": { - "description": "BadRequest | InvalidRequestError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/effect_HttpApiError_BadRequest" - }, - { - "$ref": "#/components/schemas/InvalidRequestError" - } - ] - } - } - } - }, - "404": { - "description": "NotFoundError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/NotFoundError" - } - } - } - } - }, - "description": "Delete a part from a message.", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.part.delete({\n ...\n})" - } - ] - }, - "patch": { - "tags": ["session"], - "operationId": "part.update", - "parameters": [ - { - "name": "sessionID", - "in": "path", - "schema": { - "type": "string", - "pattern": "^ses" - }, - "required": true - }, - { - "name": "messageID", - "in": "path", - "schema": { - "type": "string", - "pattern": "^msg" - }, - "required": true - }, - { - "name": "partID", - "in": "path", - "schema": { - "type": "string", - "pattern": "^prt" - }, - "required": true - }, - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "Successfully updated part", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Part" - } - } - } - }, - "400": { - "description": "BadRequest | InvalidRequestError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/effect_HttpApiError_BadRequest" - }, - { - "$ref": "#/components/schemas/InvalidRequestError" - } - ] - } - } - } - }, - "404": { - "description": "NotFoundError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/NotFoundError" - } - } - } - } - }, - "description": "Update a part in a message.", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Part" - } - } - } - }, - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.part.update({\n ...\n})" - } - ] - } - }, - "/sync/start": { - "post": { - "tags": ["sync"], - "operationId": "sync.start", - "parameters": [ - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "Workspace sync started", - "content": { - "application/json": { - "schema": { - "type": "boolean", - "description": "Workspace sync started" - } - } - } - }, - "400": { - "description": "Bad request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BadRequestError" - } - } - } - } - }, - "description": "Start sync loops for workspaces in the current project that have active sessions.", - "summary": "Start workspace sync", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.sync.start({\n ...\n})" - } - ] - } - }, - "/sync/replay": { - "post": { - "tags": ["sync"], - "operationId": "sync.replay", - "parameters": [ - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "Replayed sync events", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "sessionID": { - "type": "string" - } - }, - "required": ["sessionID"], - "additionalProperties": false, - "description": "Replayed sync events" - } - } - } - }, - "400": { - "description": "BadRequest | InvalidRequestError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/effect_HttpApiError_BadRequest" - }, - { - "$ref": "#/components/schemas/InvalidRequestError" - } - ] - } - } - } - } - }, - "description": "Validate and replay a complete sync event history.", - "summary": "Replay sync events", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "directory": { - "type": "string" - }, - "events": { - "type": "array", - "minItems": 1, - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer", - "minimum": 0 - }, - "type": { - "type": "string" - }, - "data": { - "type": "object" - } - }, - "required": ["id", "aggregateID", "seq", "type", "data"], - "additionalProperties": false - } - } - }, - "required": ["directory", "events"], - "additionalProperties": false - } - } - } - }, - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.sync.replay({\n ...\n})" - } - ] - } - }, - "/sync/steal": { - "post": { - "tags": ["sync"], - "operationId": "sync.steal", - "parameters": [ - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "Session stolen into workspace", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "pattern": "^ses" - } - }, - "required": ["sessionID"], - "additionalProperties": false, - "description": "Session stolen into workspace" - } - } - } - }, - "400": { - "description": "BadRequest | InvalidRequestError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/effect_HttpApiError_BadRequest" - }, - { - "$ref": "#/components/schemas/InvalidRequestError" - } - ] - } - } - } - } - }, - "description": "Update a session to belong to the current workspace through the sync event system.", - "summary": "Steal session into workspace", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "pattern": "^ses" - } - }, - "required": ["sessionID"], - "additionalProperties": false - } - } - } - }, - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.sync.steal({\n ...\n})" - } - ] - } - }, - "/sync/history": { - "post": { - "tags": ["sync"], - "operationId": "sync.history.list", - "parameters": [ - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "Sync events", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "aggregate_id": { - "type": "string" - }, - "seq": { - "type": "integer", - "minimum": 0 - }, - "type": { - "type": "string" - }, - "data": { - "type": "object" - } - }, - "required": ["id", "aggregate_id", "seq", "type", "data"], - "additionalProperties": false - }, - "description": "Sync events" - } - } - } - }, - "400": { - "description": "BadRequest | InvalidRequestError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/effect_HttpApiError_BadRequest" - }, - { - "$ref": "#/components/schemas/InvalidRequestError" - } - ] - } - } - } - } - }, - "description": "List sync events for all aggregates. Keys are aggregate IDs the client already knows about, values are the last known sequence ID. Events with seq > value are returned for those aggregates. Aggregates not listed in the input get their full history.", - "summary": "List sync events", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "additionalProperties": { - "type": "integer", - "minimum": 0 - } - } - } - } - }, - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.sync.history.list({\n ...\n})" - } - ] - } - }, - "/tui/append-prompt": { - "post": { - "tags": ["tui"], - "operationId": "tui.appendPrompt", - "parameters": [ - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "Prompt processed successfully", - "content": { - "application/json": { - "schema": { - "type": "boolean", - "description": "Prompt processed successfully" - } - } - } - }, - "400": { - "description": "BadRequest | InvalidRequestError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/effect_HttpApiError_BadRequest" - }, - { - "$ref": "#/components/schemas/InvalidRequestError" - } - ] - } - } - } - } - }, - "description": "Append prompt to the TUI.", - "summary": "Append TUI prompt", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "text": { - "type": "string" - } - }, - "required": ["text"], - "additionalProperties": false - } - } - } - }, - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.appendPrompt({\n ...\n})" - } - ] - } - }, - "/tui/open-help": { - "post": { - "tags": ["tui"], - "operationId": "tui.openHelp", - "parameters": [ - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "Help dialog opened successfully", - "content": { - "application/json": { - "schema": { - "type": "boolean", - "description": "Help dialog opened successfully" - } - } - } - }, - "400": { - "description": "Bad request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BadRequestError" - } - } - } - } - }, - "description": "Open the help dialog in the TUI to display user assistance information.", - "summary": "Open help dialog", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openHelp({\n ...\n})" - } - ] - } - }, - "/tui/open-sessions": { - "post": { - "tags": ["tui"], - "operationId": "tui.openSessions", - "parameters": [ - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "Session dialog opened successfully", - "content": { - "application/json": { - "schema": { - "type": "boolean", - "description": "Session dialog opened successfully" - } - } - } - }, - "400": { - "description": "Bad request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BadRequestError" - } - } - } - } - }, - "description": "Open the session dialog.", - "summary": "Open sessions dialog", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openSessions({\n ...\n})" - } - ] - } - }, - "/tui/open-themes": { - "post": { - "tags": ["tui"], - "operationId": "tui.openThemes", - "parameters": [ - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "Theme dialog opened successfully", - "content": { - "application/json": { - "schema": { - "type": "boolean", - "description": "Theme dialog opened successfully" - } - } - } - }, - "400": { - "description": "Bad request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BadRequestError" - } - } - } - } - }, - "description": "Open the theme dialog.", - "summary": "Open themes dialog", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openThemes({\n ...\n})" - } - ] - } - }, - "/tui/open-models": { - "post": { - "tags": ["tui"], - "operationId": "tui.openModels", - "parameters": [ - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "Model dialog opened successfully", - "content": { - "application/json": { - "schema": { - "type": "boolean", - "description": "Model dialog opened successfully" - } - } - } - }, - "400": { - "description": "Bad request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BadRequestError" - } - } - } - } - }, - "description": "Open the model dialog.", - "summary": "Open models dialog", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.openModels({\n ...\n})" - } - ] - } - }, - "/tui/submit-prompt": { - "post": { - "tags": ["tui"], - "operationId": "tui.submitPrompt", - "parameters": [ - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "Prompt submitted successfully", - "content": { - "application/json": { - "schema": { - "type": "boolean", - "description": "Prompt submitted successfully" - } - } - } - }, - "400": { - "description": "Bad request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BadRequestError" - } - } - } - } - }, - "description": "Submit the prompt.", - "summary": "Submit TUI prompt", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.submitPrompt({\n ...\n})" - } - ] - } - }, - "/tui/clear-prompt": { - "post": { - "tags": ["tui"], - "operationId": "tui.clearPrompt", - "parameters": [ - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "Prompt cleared successfully", - "content": { - "application/json": { - "schema": { - "type": "boolean", - "description": "Prompt cleared successfully" - } - } - } - }, - "400": { - "description": "Bad request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BadRequestError" - } - } - } - } - }, - "description": "Clear the prompt.", - "summary": "Clear TUI prompt", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.clearPrompt({\n ...\n})" - } - ] - } - }, - "/tui/execute-command": { - "post": { - "tags": ["tui"], - "operationId": "tui.executeCommand", - "parameters": [ - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "Command executed successfully", - "content": { - "application/json": { - "schema": { - "type": "boolean", - "description": "Command executed successfully" - } - } - } - }, - "400": { - "description": "BadRequest | InvalidRequestError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/effect_HttpApiError_BadRequest" - }, - { - "$ref": "#/components/schemas/InvalidRequestError" - } - ] - } - } - } - } - }, - "description": "Execute a TUI command.", - "summary": "Execute TUI command", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "command": { - "type": "string" - } - }, - "required": ["command"], - "additionalProperties": false - } - } - } - }, - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.executeCommand({\n ...\n})" - } - ] - } - }, - "/tui/show-toast": { - "post": { - "tags": ["tui"], - "operationId": "tui.showToast", - "parameters": [ - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "Toast notification shown successfully", - "content": { - "application/json": { - "schema": { - "type": "boolean", - "description": "Toast notification shown successfully" - } - } - } - }, - "400": { - "description": "Bad request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BadRequestError" - } - } - } - } - }, - "description": "Show a toast notification in the TUI.", - "summary": "Show TUI toast", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "title": { - "type": "string" - }, - "message": { - "type": "string" - }, - "variant": { - "type": "string", - "enum": ["info", "success", "warning", "error"] - }, - "duration": { - "type": "integer", - "exclusiveMinimum": 0 - } - }, - "required": ["message", "variant"], - "additionalProperties": false - } - } - } - }, - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.showToast({\n ...\n})" - } - ] - } - }, - "/tui/publish": { - "post": { - "tags": ["tui"], - "operationId": "tui.publish", - "parameters": [ - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "Event published successfully", - "content": { - "application/json": { - "schema": { - "type": "boolean", - "description": "Event published successfully" - } - } - } - }, - "400": { - "description": "BadRequest | InvalidRequestError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/effect_HttpApiError_BadRequest" - }, - { - "$ref": "#/components/schemas/InvalidRequestError" - } - ] - } - } - } - } - }, - "description": "Publish a TUI event.", - "summary": "Publish TUI event", - "requestBody": { - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/EventTuiPromptAppend" - }, - { - "$ref": "#/components/schemas/EventTuiCommandExecute" - }, - { - "$ref": "#/components/schemas/EventTuiToastShow" - }, - { - "$ref": "#/components/schemas/EventTuiSessionSelect" - } - ] - } - } - } - }, - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.publish({\n ...\n})" - } - ] - } - }, - "/tui/select-session": { - "post": { - "tags": ["tui"], - "operationId": "tui.selectSession", - "parameters": [ - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "Session selected successfully", - "content": { - "application/json": { - "schema": { - "type": "boolean", - "description": "Session selected successfully" - } - } - } - }, - "400": { - "description": "BadRequest | InvalidRequestError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/effect_HttpApiError_BadRequest" - }, - { - "$ref": "#/components/schemas/InvalidRequestError" - } - ] - } - } - } - }, - "404": { - "description": "NotFoundError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/NotFoundError" - } - } - } - } - }, - "description": "Navigate the TUI to display the specified session.", - "summary": "Select session", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "pattern": "^ses", - "description": "Session ID to navigate to" - } - }, - "required": ["sessionID"], - "additionalProperties": false - } - } - } - }, - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.selectSession({\n ...\n})" - } - ] - } - }, - "/tui/control/next": { - "get": { - "tags": ["tui"], - "operationId": "tui.control.next", - "parameters": [ - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "Next TUI request", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "path": { - "type": "string" - }, - "body": {} - }, - "required": ["path", "body"], - "additionalProperties": false, - "description": "Next TUI request" - } - } - } - }, - "400": { - "description": "Bad request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BadRequestError" - } - } - } - } - }, - "description": "Retrieve the next TUI request from the queue for processing.", - "summary": "Get next TUI request", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.control.next({\n ...\n})" - } - ] - } - }, - "/tui/control/response": { - "post": { - "tags": ["tui"], - "operationId": "tui.control.response", - "parameters": [ - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "Response submitted successfully", - "content": { - "application/json": { - "schema": { - "type": "boolean", - "description": "Response submitted successfully" - } - } - } - }, - "400": { - "description": "Bad request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BadRequestError" - } - } - } - } - }, - "description": "Submit a response to the TUI request queue to complete a pending request.", - "summary": "Submit TUI response", - "requestBody": { - "content": { - "application/json": { - "schema": {} - } - } - }, - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.tui.control.response({\n ...\n})" - } - ] - } - }, - "/experimental/workspace/adapter": { - "get": { - "tags": ["workspace"], - "operationId": "experimental.workspace.adapter.list", - "parameters": [ - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "Workspace adapters", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type": { - "type": "string" - }, - "name": { - "type": "string" - }, - "description": { - "type": "string" - } - }, - "required": ["type", "name", "description"], - "additionalProperties": false - }, - "description": "Workspace adapters" - } - } - } - }, - "400": { - "description": "Bad request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BadRequestError" - } - } - } - } - }, - "description": "List all available workspace adapters for the current project.", - "summary": "List workspace adapters", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.adapter.list({\n ...\n})" - } - ] - } - }, - "/experimental/workspace": { - "get": { - "tags": ["workspace"], - "operationId": "experimental.workspace.list", - "parameters": [ - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "Workspaces", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Workspace" - }, - "description": "Workspaces" - } - } - } - }, - "400": { - "description": "Bad request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BadRequestError" - } - } - } - } - }, - "description": "List all workspaces.", - "summary": "List workspaces", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.list({\n ...\n})" - } - ] - }, - "post": { - "tags": ["workspace"], - "operationId": "experimental.workspace.create", - "parameters": [ - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "Workspace created", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Workspace" - } - } - } - }, - "400": { - "description": "WorkspaceCreateError | BadRequest | InvalidRequestError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/WorkspaceCreateError" - }, - { - "$ref": "#/components/schemas/effect_HttpApiError_BadRequest" - }, - { - "$ref": "#/components/schemas/InvalidRequestError" - } - ] - } - } - } - } - }, - "description": "Create a workspace for the current project.", - "summary": "Create workspace", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^wrk" - }, - "type": { - "type": "string" - }, - "branch": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "extra": { - "anyOf": [ - {}, - { - "type": "null" - } - ] - } - }, - "required": ["type"], - "additionalProperties": false - } - } - } - }, - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.create({\n ...\n})" - } - ] - } - }, - "/experimental/workspace/sync-list": { - "post": { - "tags": ["workspace"], - "operationId": "experimental.workspace.syncList", - "parameters": [ - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "204": { - "description": "Workspace list synced" - }, - "400": { - "description": "Bad request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BadRequestError" - } - } - } - } - }, - "description": "Register missing workspaces returned by workspace adapters.", - "summary": "Sync workspace list", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.syncList({\n ...\n})" - } - ] - } - }, - "/experimental/workspace/status": { - "get": { - "tags": ["workspace"], - "operationId": "experimental.workspace.status", - "parameters": [ - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "Workspace status", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/WorkspaceEventConnectionStatus" - }, - "description": "Workspace status" - } - } - } - }, - "400": { - "description": "Bad request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BadRequestError" - } - } - } - } - }, - "description": "Get connection status for workspaces in the current project.", - "summary": "Workspace status", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.status({\n ...\n})" - } - ] - } - }, - "/experimental/workspace/{id}": { - "delete": { - "tags": ["workspace"], - "operationId": "experimental.workspace.remove", - "parameters": [ - { - "name": "id", - "in": "path", - "schema": { - "type": "string", - "pattern": "^wrk" - }, - "required": true - }, - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "200": { - "description": "Workspace removed", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Workspace" - } - } - } - }, - "400": { - "description": "BadRequest | InvalidRequestError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/effect_HttpApiError_BadRequest" - }, - { - "$ref": "#/components/schemas/InvalidRequestError" - } - ] - } - } - } - } - }, - "description": "Remove an existing workspace.", - "summary": "Remove workspace", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.remove({\n ...\n})" - } - ] - } - }, - "/experimental/workspace/warp": { - "post": { - "tags": ["workspace"], - "operationId": "experimental.workspace.warp", - "parameters": [ - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "responses": { - "204": { - "description": "Session warped" - }, - "400": { - "description": "WorkspaceWarpError | VcsApplyError | InvalidRequestError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/WorkspaceWarpError" - }, - { - "$ref": "#/components/schemas/VcsApplyError" - }, - { - "$ref": "#/components/schemas/InvalidRequestError" - } - ] - } - } - } - }, - "404": { - "description": "NotFoundError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/NotFoundError" - } - } - } - } - }, - "description": "Move a session's sync history into the target workspace, or detach it to the local project.", - "summary": "Warp session into workspace", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "id": { - "anyOf": [ - { - "type": "string", - "pattern": "^wrk" - }, - { - "type": "null" - } - ] - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "copyChanges": { - "type": "boolean" - } - }, - "required": ["id", "sessionID"], - "additionalProperties": false - } - } - } - }, - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.experimental.workspace.warp({\n ...\n})" - } - ] - } - }, - "/api/health": { - "get": { - "tags": ["opencode HttpApi"], - "operationId": "v2.health.get", - "parameters": [], - "security": [], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "healthy": { - "type": "boolean", - "enum": [true] - } - }, - "required": ["healthy"], - "additionalProperties": false - } - } - } - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - } - }, - "description": "Check whether the API server is ready to accept requests.", - "summary": "Check server health", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.health.get({\n ...\n})" - } - ] - } - }, - "/api/location": { - "get": { - "tags": ["opencode HttpApi"], - "operationId": "v2.location.get", - "parameters": [ - { - "name": "location", - "in": "query", - "schema": { - "type": "object", - "properties": { - "directory": { - "type": "string" - }, - "workspace": { - "type": "string" - } - }, - "additionalProperties": false - }, - "required": false, - "style": "deepObject", - "explode": true - } - ], - "security": [], - "responses": { - "200": { - "description": "Location.Info", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/LocationInfo" - } - } - } - }, - "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", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.location.get({\n ...\n})" - } - ] - } - }, - "/api/agent": { - "get": { - "tags": ["opencode HttpApi"], - "operationId": "v2.agent.list", - "parameters": [ - { - "name": "location", - "in": "query", - "schema": { - "type": "object", - "properties": { - "directory": { - "type": "string" - }, - "workspace": { - "type": "string" - } - }, - "additionalProperties": false - }, - "required": false, - "style": "deepObject", - "explode": true - } - ], - "security": [], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "location": { - "$ref": "#/components/schemas/LocationInfo" - }, - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/AgentV2Info" - } - } - }, - "required": ["location", "data"], - "additionalProperties": false - } - } - } - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - } - }, - "description": "Retrieve currently registered agents.", - "summary": "List agents", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.agent.list({\n ...\n})" - } - ] - } - }, - "/api/session": { - "get": { - "tags": ["sessions"], - "operationId": "v2.session.list", - "parameters": [ - { - "name": "workspace", - "in": "query", - "schema": { - "type": "string", - "pattern": "^wrk" - }, - "required": false - }, - { - "name": "limit", - "in": "query", - "schema": { - "type": "number" - }, - "required": false - }, - { - "name": "order", - "in": "query", - "schema": { - "type": "string", - "enum": ["asc", "desc"] - }, - "required": false - }, - { - "name": "search", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "directory", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "project", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "subpath", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "cursor", - "in": "query", - "schema": { - "type": "string", - "description": "Opaque pagination cursor returned as cursor.previous or cursor.next in the previous response." - }, - "required": false - } - ], - "security": [], - "responses": { - "200": { - "description": "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/InvalidRequestError" - }, - { - "$ref": "#/components/schemas/InvalidRequestError" - } - ] - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - } - }, - "description": "Retrieve sessions in the requested order. Items keep that order across pages; use cursor.next or cursor.previous to move through the ordered list.", - "summary": "List sessions", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.list({\n ...\n})" - } - ] - }, - "post": { - "tags": ["sessions"], - "operationId": "v2.session.create", - "parameters": [], - "security": [], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "data": { - "$ref": "#/components/schemas/SessionV2Info" - } - }, - "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": { - "type": "string", - "pattern": "^ses" - }, - "agent": { - "type": "string" - }, - "model": { - "$ref": "#/components/schemas/ModelRef" - }, - "location": { - "$ref": "#/components/schemas/LocationRef" - } - }, - "additionalProperties": false - } - } - }, - "required": true - }, - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.create({\n ...\n})" - } - ] - } - }, - "/api/session/active": { - "get": { - "tags": ["sessions"], - "operationId": "v2.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", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.active({\n ...\n})" - } - ] - } - }, - "/api/session/{sessionID}": { - "get": { - "tags": ["sessions"], - "operationId": "v2.session.get", - "parameters": [ - { - "name": "sessionID", - "in": "path", - "schema": { - "type": "string", - "pattern": "^ses" - }, - "required": true - } - ], - "security": [], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "data": { - "$ref": "#/components/schemas/SessionV2Info" - } - }, - "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", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.get({\n ...\n})" - } - ] - } - }, - "/api/session/{sessionID}/agent": { - "post": { - "tags": ["sessions"], - "operationId": "v2.session.switchAgent", - "parameters": [ - { - "name": "sessionID", - "in": "path", - "schema": { - "type": "string", - "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 - }, - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.switchAgent({\n ...\n})" - } - ] - } - }, - "/api/session/{sessionID}/model": { - "post": { - "tags": ["sessions"], - "operationId": "v2.session.switchModel", - "parameters": [ - { - "name": "sessionID", - "in": "path", - "schema": { - "type": "string", - "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/ModelRef" - } - }, - "required": ["model"], - "additionalProperties": false - } - } - }, - "required": true - }, - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.switchModel({\n ...\n})" - } - ] - } - }, - "/api/session/{sessionID}/prompt": { - "post": { - "tags": ["sessions"], - "operationId": "v2.session.prompt", - "parameters": [ - { - "name": "sessionID", - "in": "path", - "schema": { - "type": "string", - "pattern": "^ses" - }, - "required": true - } - ], - "security": [], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "data": { - "$ref": "#/components/schemas/SessionInputAdmitted" - } - }, - "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": "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": { - "type": "string", - "pattern": "^msg_" - }, - "prompt": { - "$ref": "#/components/schemas/PromptInput" - }, - "delivery": { - "type": "string", - "enum": ["steer", "queue"] - }, - "resume": { - "type": "boolean" - } - }, - "required": ["prompt"], - "additionalProperties": false - } - } - }, - "required": true - }, - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.prompt({\n ...\n})" - } - ] - } - }, - "/api/session/{sessionID}/compact": { - "post": { - "tags": ["sessions"], - "operationId": "v2.session.compact", - "parameters": [ - { - "name": "sessionID", - "in": "path", - "schema": { - "type": "string", - "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": "Compact a session conversation.", - "summary": "Compact session", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.compact({\n ...\n})" - } - ] - } - }, - "/api/session/{sessionID}/wait": { - "post": { - "tags": ["sessions"], - "operationId": "v2.session.wait", - "parameters": [ - { - "name": "sessionID", - "in": "path", - "schema": { - "type": "string", - "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", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.wait({\n ...\n})" - } - ] - } - }, - "/api/session/{sessionID}/revert/stage": { - "post": { - "tags": ["sessions"], - "operationId": "v2.session.revert.stage", - "parameters": [ - { - "name": "sessionID", - "in": "path", - "schema": { - "type": "string", - "pattern": "^ses" - }, - "required": true - } - ], - "security": [], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "data": { - "$ref": "#/components/schemas/RevertState" - } - }, - "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" - } - ] - } - } - } - }, - "500": { - "description": "UnknownError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnknownError1" - } - } - } - } - }, - "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", - "pattern": "^msg_" - }, - "files": { - "type": "boolean" - } - }, - "required": ["messageID"], - "additionalProperties": false - } - } - }, - "required": true - }, - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.revert.stage({\n ...\n})" - } - ] - } - }, - "/api/session/{sessionID}/revert/clear": { - "post": { - "tags": ["sessions"], - "operationId": "v2.session.revert.clear", - "parameters": [ - { - "name": "sessionID", - "in": "path", - "schema": { - "type": "string", - "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" - } - ] - } - } - } - }, - "500": { - "description": "UnknownError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnknownError1" - } - } - } - } - }, - "summary": "Clear staged revert", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.revert.clear({\n ...\n})" - } - ] - } - }, - "/api/session/{sessionID}/revert/commit": { - "post": { - "tags": ["sessions"], - "operationId": "v2.session.revert.commit", - "parameters": [ - { - "name": "sessionID", - "in": "path", - "schema": { - "type": "string", - "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" - } - ] - } - } - } - } - }, - "summary": "Commit staged revert", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.revert.commit({\n ...\n})" - } - ] - } - }, - "/api/session/{sessionID}/context": { - "get": { - "tags": ["sessions"], - "operationId": "v2.session.context", - "parameters": [ - { - "name": "sessionID", - "in": "path", - "schema": { - "type": "string", - "pattern": "^ses" - }, - "required": true - } - ], - "security": [], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/SessionMessage" - } - } - }, - "required": ["data"], - "additionalProperties": false - } - } - } - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - }, - "404": { - "description": "SessionNotFoundError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/SessionNotFoundError" - }, - { - "$ref": "#/components/schemas/SessionNotFoundError" - } - ] - } - } - } - }, - "500": { - "description": "UnknownError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnknownError1" - } - } - } - } - }, - "description": "Retrieve the active context messages for a session (all messages after the last compaction).", - "summary": "Get session context", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.context({\n ...\n})" - } - ] - } - }, - "/api/session/{sessionID}/history": { - "get": { - "tags": ["sessions"], - "operationId": "v2.session.history", - "parameters": [ - { - "name": "sessionID", - "in": "path", - "schema": { - "type": "string", - "pattern": "^ses" - }, - "required": true - }, - { - "name": "limit", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - }, - { - "name": "after", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "security": [], - "responses": { - "200": { - "description": "SessionHistory", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SessionHistory" - } - } - } - }, - "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": "Read one finite page of public durable Session events after an exclusive aggregate sequence. Newly committed events may appear on later pages.", - "summary": "Get session history", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.history({\n ...\n})" - } - ] - } - }, - "/api/session/{sessionID}/event": { - "get": { - "tags": ["sessions"], - "operationId": "v2.session.events", - "parameters": [ - { - "name": "sessionID", - "in": "path", - "schema": { - "type": "string", - "pattern": "^ses" - }, - "required": true - }, - { - "name": "after", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "security": [], - "responses": { - "200": { - "description": "Success", - "content": { - "text/event-stream": { - "schema": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "event": { - "type": "string" - }, - "data": { - "$ref": "#/components/schemas/SessionDurableEventStream" - } - }, - "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": "Replay durable events after an aggregate sequence, then continue with new durable events.", - "summary": "Subscribe to session events", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.events({\n ...\n})" - } - ] - } - }, - "/api/session/{sessionID}/interrupt": { - "post": { - "tags": ["sessions"], - "operationId": "v2.session.interrupt", - "parameters": [ - { - "name": "sessionID", - "in": "path", - "schema": { - "type": "string", - "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", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.interrupt({\n ...\n})" - } - ] - } - }, - "/api/session/{sessionID}/message/{messageID}": { - "get": { - "tags": ["sessions"], - "operationId": "v2.session.message", - "parameters": [ - { - "name": "sessionID", - "in": "path", - "schema": { - "type": "string", - "pattern": "^ses" - }, - "required": true - }, - { - "name": "messageID", - "in": "path", - "schema": { - "type": "string", - "pattern": "^msg_" - }, - "required": true - } - ], - "security": [], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "data": { - "$ref": "#/components/schemas/SessionMessage" - } - }, - "required": ["data"], - "additionalProperties": false - } - } - } - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - }, - "404": { - "description": "SessionNotFoundError | 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", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.message({\n ...\n})" - } - ] - } - }, - "/api/session/{sessionID}/message": { - "get": { - "tags": ["messages"], - "operationId": "v2.session.messages", - "parameters": [ - { - "name": "sessionID", - "in": "path", - "schema": { - "type": "string", - "pattern": "^ses" - }, - "required": true - }, - { - "name": "limit", - "in": "query", - "schema": { - "type": "number" - }, - "required": false - }, - { - "name": "order", - "in": "query", - "schema": { - "type": "string", - "enum": ["asc", "desc"] - }, - "required": false - }, - { - "name": "cursor", - "in": "query", - "schema": { - "type": "string", - "description": "Opaque pagination cursor returned as cursor.previous or cursor.next in the previous response. Do not combine with order." - }, - "required": false - } - ], - "security": [], - "responses": { - "200": { - "description": "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/UnknownError1" - } - } - } - } - }, - "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", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.messages({\n ...\n})" - } - ] - } - }, - "/api/model": { - "get": { - "tags": ["models"], - "operationId": "v2.model.list", - "parameters": [ - { - "name": "location", - "in": "query", - "schema": { - "type": "object", - "properties": { - "directory": { - "type": "string" - }, - "workspace": { - "type": "string" - } - }, - "additionalProperties": false - }, - "required": false, - "style": "deepObject", - "explode": true - } - ], - "security": [], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "location": { - "$ref": "#/components/schemas/LocationInfo" - }, - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ModelV2Info" - } - } - }, - "required": ["location", "data"], - "additionalProperties": false - } - } - } - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - }, - "503": { - "description": "ServiceUnavailableError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - } - } - }, - "description": "Retrieve available models ordered by release date.", - "summary": "List models", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.model.list({\n ...\n})" - } - ] - } - }, - "/api/provider": { - "get": { - "tags": ["providers"], - "operationId": "v2.provider.list", - "parameters": [ - { - "name": "location", - "in": "query", - "schema": { - "type": "object", - "properties": { - "directory": { - "type": "string" - }, - "workspace": { - "type": "string" - } - }, - "additionalProperties": false - }, - "required": false, - "style": "deepObject", - "explode": true - } - ], - "security": [], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "location": { - "$ref": "#/components/schemas/LocationInfo" - }, - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ProviderV2Info" - } - } - }, - "required": ["location", "data"], - "additionalProperties": false - } - } - } - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - }, - "503": { - "description": "ServiceUnavailableError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - } - } - }, - "description": "Retrieve active AI providers so clients can show provider availability and configuration.", - "summary": "List providers", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.provider.list({\n ...\n})" - } - ] - } - }, - "/api/provider/{providerID}": { - "get": { - "tags": ["providers"], - "operationId": "v2.provider.get", - "parameters": [ - { - "name": "providerID", - "in": "path", - "schema": { - "type": "string" - }, - "required": true - }, - { - "name": "location", - "in": "query", - "schema": { - "type": "object", - "properties": { - "directory": { - "type": "string" - }, - "workspace": { - "type": "string" - } - }, - "additionalProperties": false - }, - "required": false, - "style": "deepObject", - "explode": true - } - ], - "security": [], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "location": { - "$ref": "#/components/schemas/LocationInfo" - }, - "data": { - "$ref": "#/components/schemas/ProviderV2Info" - } - }, - "required": ["location", "data"], - "additionalProperties": false - } - } - } - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - }, - "404": { - "description": "ProviderNotFoundError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProviderNotFoundError" - } - } - } - }, - "503": { - "description": "ServiceUnavailableError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServiceUnavailableError" - } - } - } - } - }, - "description": "Retrieve a single AI provider so clients can inspect its availability and endpoint settings.", - "summary": "Get provider", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.provider.get({\n ...\n})" - } - ] - } - }, - "/api/integration": { - "get": { - "tags": ["integrations"], - "operationId": "v2.integration.list", - "parameters": [ - { - "name": "location", - "in": "query", - "schema": { - "type": "object", - "properties": { - "directory": { - "type": "string" - }, - "workspace": { - "type": "string" - } - }, - "additionalProperties": false - }, - "required": false, - "style": "deepObject", - "explode": true - } - ], - "security": [], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "location": { - "$ref": "#/components/schemas/LocationInfo" - }, - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/IntegrationInfo" - } - } - }, - "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", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.integration.list({\n ...\n})" - } - ] - } - }, - "/api/integration/{integrationID}": { - "get": { - "tags": ["integrations"], - "operationId": "v2.integration.get", - "parameters": [ - { - "name": "integrationID", - "in": "path", - "schema": { - "type": "string" - }, - "required": true - }, - { - "name": "location", - "in": "query", - "schema": { - "type": "object", - "properties": { - "directory": { - "type": "string" - }, - "workspace": { - "type": "string" - } - }, - "additionalProperties": false - }, - "required": false, - "style": "deepObject", - "explode": true - } - ], - "security": [], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "location": { - "$ref": "#/components/schemas/LocationInfo" - }, - "data": { - "$ref": "#/components/schemas/IntegrationInfo" - } - }, - "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", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.integration.get({\n ...\n})" - } - ] - } - }, - "/api/integration/{integrationID}/connect/key": { - "post": { - "tags": ["integrations"], - "operationId": "v2.integration.connect.key", - "parameters": [ - { - "name": "integrationID", - "in": "path", - "schema": { - "type": "string" - }, - "required": true - }, - { - "name": "location", - "in": "query", - "schema": { - "type": "object", - "properties": { - "directory": { - "type": "string" - }, - "workspace": { - "type": "string" - } - }, - "additionalProperties": false - }, - "required": false, - "style": "deepObject", - "explode": true - } - ], - "security": [], - "responses": { - "204": { - "description": "" - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/InvalidRequestError" - }, - { - "$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": { - "type": "string" - } - }, - "required": ["key"], - "additionalProperties": false - } - } - }, - "required": true - }, - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.integration.connect.key({\n ...\n})" - } - ] - } - }, - "/api/integration/{integrationID}/connect/oauth": { - "post": { - "tags": ["integrations"], - "operationId": "v2.integration.connect.oauth", - "parameters": [ - { - "name": "integrationID", - "in": "path", - "schema": { - "type": "string" - }, - "required": true - }, - { - "name": "location", - "in": "query", - "schema": { - "type": "object", - "properties": { - "directory": { - "type": "string" - }, - "workspace": { - "type": "string" - } - }, - "additionalProperties": false - }, - "required": false, - "style": "deepObject", - "explode": true - } - ], - "security": [], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "location": { - "$ref": "#/components/schemas/LocationInfo" - }, - "data": { - "$ref": "#/components/schemas/IntegrationAttempt" - } - }, - "required": ["location", "data"], - "additionalProperties": false - } - } - } - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/InvalidRequestError" - }, - { - "$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": { - "type": "string" - } - }, - "required": ["methodID", "inputs"], - "additionalProperties": false - } - } - }, - "required": true - }, - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.integration.connect.oauth({\n ...\n})" - } - ] - } - }, - "/api/integration/attempt/{attemptID}": { - "get": { - "tags": ["integrations"], - "operationId": "v2.integration.attempt.status", - "parameters": [ - { - "name": "attemptID", - "in": "path", - "schema": { - "type": "string" - }, - "required": true - }, - { - "name": "location", - "in": "query", - "schema": { - "type": "object", - "properties": { - "directory": { - "type": "string" - }, - "workspace": { - "type": "string" - } - }, - "additionalProperties": false - }, - "required": false, - "style": "deepObject", - "explode": true - } - ], - "security": [], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "location": { - "$ref": "#/components/schemas/LocationInfo" - }, - "data": { - "$ref": "#/components/schemas/IntegrationAttemptStatus" - } - }, - "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", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.integration.attempt.status({\n ...\n})" - } - ] - }, - "delete": { - "tags": ["integrations"], - "operationId": "v2.integration.attempt.cancel", - "parameters": [ - { - "name": "attemptID", - "in": "path", - "schema": { - "type": "string" - }, - "required": true - }, - { - "name": "location", - "in": "query", - "schema": { - "type": "object", - "properties": { - "directory": { - "type": "string" - }, - "workspace": { - "type": "string" - } - }, - "additionalProperties": false - }, - "required": false, - "style": "deepObject", - "explode": true - } - ], - "security": [], - "responses": { - "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", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.integration.attempt.cancel({\n ...\n})" - } - ] - } - }, - "/api/integration/attempt/{attemptID}/complete": { - "post": { - "tags": ["integrations"], - "operationId": "v2.integration.attempt.complete", - "parameters": [ - { - "name": "attemptID", - "in": "path", - "schema": { - "type": "string" - }, - "required": true - }, - { - "name": "location", - "in": "query", - "schema": { - "type": "object", - "properties": { - "directory": { - "type": "string" - }, - "workspace": { - "type": "string" - } - }, - "additionalProperties": false - }, - "required": false, - "style": "deepObject", - "explode": true - } - ], - "security": [], - "responses": { - "204": { - "description": "" - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/InvalidRequestError" - }, - { - "$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": { - "type": "string" - } - }, - "additionalProperties": false - } - } - }, - "required": true - }, - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.integration.attempt.complete({\n ...\n})" - } - ] - } - }, - "/api/credential/{credentialID}": { - "patch": { - "tags": ["opencode HttpApi"], - "operationId": "v2.credential.update", - "parameters": [ - { - "name": "credentialID", - "in": "path", - "schema": { - "type": "string" - }, - "required": true - }, - { - "name": "location", - "in": "query", - "schema": { - "type": "object", - "properties": { - "directory": { - "type": "string" - }, - "workspace": { - "type": "string" - } - }, - "additionalProperties": false - }, - "required": false, - "style": "deepObject", - "explode": true - } - ], - "security": [], - "responses": { - "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 - }, - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.credential.update({\n ...\n})" - } - ] - }, - "delete": { - "tags": ["opencode HttpApi"], - "operationId": "v2.credential.remove", - "parameters": [ - { - "name": "credentialID", - "in": "path", - "schema": { - "type": "string" - }, - "required": true - }, - { - "name": "location", - "in": "query", - "schema": { - "type": "object", - "properties": { - "directory": { - "type": "string" - }, - "workspace": { - "type": "string" - } - }, - "additionalProperties": false - }, - "required": false, - "style": "deepObject", - "explode": true - } - ], - "security": [], - "responses": { - "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", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.credential.remove({\n ...\n})" - } - ] - } - }, - "/api/permission/request": { - "get": { - "tags": ["permissions"], - "operationId": "v2.permission.request.list", - "parameters": [ - { - "name": "location", - "in": "query", - "schema": { - "type": "object", - "properties": { - "directory": { - "type": "string" - }, - "workspace": { - "type": "string" - } - }, - "additionalProperties": false - }, - "required": false, - "style": "deepObject", - "explode": true - } - ], - "security": [], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "location": { - "$ref": "#/components/schemas/LocationInfo" - }, - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/PermissionV2Request" - } - } - }, - "required": ["location", "data"], - "additionalProperties": false - } - } - } - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - } - }, - "description": "Retrieve pending permission requests for a location.", - "summary": "List pending permission requests", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.permission.request.list({\n ...\n})" - } - ] - } - }, - "/api/permission/saved": { - "get": { - "tags": ["permissions"], - "operationId": "v2.permission.saved.list", - "parameters": [ - { - "name": "projectID", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "security": [], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/PermissionSavedInfo" - } - } - }, - "required": ["data"], - "additionalProperties": false - } - } - } - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - } - }, - "description": "Retrieve saved permissions, optionally filtered by project.", - "summary": "List saved permissions", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.permission.saved.list({\n ...\n})" - } - ] - } - }, - "/api/permission/saved/{id}": { - "delete": { - "tags": ["permissions"], - "operationId": "v2.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", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.permission.saved.remove({\n ...\n})" - } - ] - } - }, - "/api/session/{sessionID}/permission": { - "post": { - "tags": ["permissions"], - "operationId": "v2.session.permission.create", - "parameters": [ - { - "name": "sessionID", - "in": "path", - "schema": { - "type": "string", - "pattern": "^ses" - }, - "required": true - } - ], - "security": [], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^per" - }, - "effect": { - "$ref": "#/components/schemas/PermissionV2Effect" - } - }, - "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": { - "type": "string", - "pattern": "^per" - }, - "action": { - "type": "string" - }, - "resources": { - "type": "array", - "items": { - "type": "string" - } - }, - "save": { - "type": "array", - "items": { - "type": "string" - } - }, - "metadata": { - "type": "object" - }, - "source": { - "$ref": "#/components/schemas/PermissionV2Source" - }, - "agent": { - "type": "string" - } - }, - "required": ["action", "resources"], - "additionalProperties": false - } - } - }, - "required": true - }, - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.permission.create({\n ...\n})" - } - ] - }, - "get": { - "tags": ["permissions"], - "operationId": "v2.session.permission.list", - "parameters": [ - { - "name": "sessionID", - "in": "path", - "schema": { - "type": "string", - "pattern": "^ses" - }, - "required": true - } - ], - "security": [], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/PermissionV2Request" - } - } - }, - "required": ["data"], - "additionalProperties": false - } - } - } - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - }, - "404": { - "description": "SessionNotFoundError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/SessionNotFoundError" - }, - { - "$ref": "#/components/schemas/SessionNotFoundError" - } - ] - } - } - } - } - }, - "description": "Retrieve pending permission requests owned by a session.", - "summary": "List session permission requests", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.permission.list({\n ...\n})" - } - ] - } - }, - "/api/session/{sessionID}/permission/{requestID}": { - "get": { - "tags": ["permissions"], - "operationId": "v2.session.permission.get", - "parameters": [ - { - "name": "sessionID", - "in": "path", - "schema": { - "type": "string", - "pattern": "^ses" - }, - "required": true - }, - { - "name": "requestID", - "in": "path", - "schema": { - "type": "string", - "pattern": "^per" - }, - "required": true - } - ], - "security": [], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "data": { - "$ref": "#/components/schemas/PermissionV2Request" - } - }, - "required": ["data"], - "additionalProperties": false - } - } - } - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - }, - "404": { - "description": "SessionNotFoundError | 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", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.permission.get({\n ...\n})" - } - ] - } - }, - "/api/session/{sessionID}/permission/{requestID}/reply": { - "post": { - "tags": ["permissions"], - "operationId": "v2.session.permission.reply", - "parameters": [ - { - "name": "sessionID", - "in": "path", - "schema": { - "type": "string", - "pattern": "^ses" - }, - "required": true - }, - { - "name": "requestID", - "in": "path", - "schema": { - "type": "string", - "pattern": "^per" - }, - "required": true - } - ], - "security": [], - "responses": { - "204": { - "description": "" - }, - "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/PermissionV2Reply" - }, - "message": { - "type": "string" - } - }, - "required": ["reply"], - "additionalProperties": false - } - } - }, - "required": true - }, - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.permission.reply({\n ...\n})" - } - ] - } - }, - "/api/fs/read/*": { - "get": { - "tags": ["filesystem"], - "operationId": "v2.fs.read", - "parameters": [ - { - "name": "location", - "in": "query", - "schema": { - "type": "object", - "properties": { - "directory": { - "type": "string" - }, - "workspace": { - "type": "string" - } - }, - "additionalProperties": false - }, - "required": false, - "style": "deepObject", - "explode": true - } - ], - "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", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.fs.read({\n ...\n})" - } - ] - } - }, - "/api/fs/list": { - "get": { - "tags": ["filesystem"], - "operationId": "v2.fs.list", - "parameters": [ - { - "name": "location", - "in": "query", - "schema": { - "type": "object", - "properties": { - "directory": { - "type": "string" - }, - "workspace": { - "type": "string" - } - }, - "additionalProperties": false - }, - "required": false, - "style": "deepObject", - "explode": true - }, - { - "name": "path", - "in": "query", - "schema": { - "type": "string" - }, - "required": false - } - ], - "security": [], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "location": { - "$ref": "#/components/schemas/LocationInfo" - }, - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/FileSystemEntry" - } - } - }, - "required": ["location", "data"], - "additionalProperties": false - } - } - } - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - } - }, - "description": "List direct children of one directory relative to the requested location.", - "summary": "List directory", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.fs.list({\n ...\n})" - } - ] - } - }, - "/api/fs/find": { - "get": { - "tags": ["filesystem"], - "operationId": "v2.fs.find", - "parameters": [ - { - "name": "location", - "in": "query", - "schema": { - "type": "object", - "properties": { - "directory": { - "type": "string" - }, - "workspace": { - "type": "string" - } - }, - "additionalProperties": false - }, - "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": { - "type": "string" - }, - "required": false - } - ], - "security": [], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "location": { - "$ref": "#/components/schemas/LocationInfo" - }, - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/FileSystemEntry" - } - } - }, - "required": ["location", "data"], - "additionalProperties": false - } - } - } - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - } - }, - "description": "Find recursively ranked filesystem entries relative to the requested location.", - "summary": "Find files", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.fs.find({\n ...\n})" - } - ] - } - }, - "/api/command": { - "get": { - "tags": ["commands"], - "operationId": "v2.command.list", - "parameters": [ - { - "name": "location", - "in": "query", - "schema": { - "type": "object", - "properties": { - "directory": { - "type": "string" - }, - "workspace": { - "type": "string" - } - }, - "additionalProperties": false - }, - "required": false, - "style": "deepObject", - "explode": true - } - ], - "security": [], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "location": { - "$ref": "#/components/schemas/LocationInfo" - }, - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/CommandV2Info" - } - } - }, - "required": ["location", "data"], - "additionalProperties": false - } - } - } - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - } - }, - "description": "Retrieve currently registered commands.", - "summary": "List commands", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.command.list({\n ...\n})" - } - ] - } - }, - "/api/skill": { - "get": { - "tags": ["skills"], - "operationId": "v2.skill.list", - "parameters": [ - { - "name": "location", - "in": "query", - "schema": { - "type": "object", - "properties": { - "directory": { - "type": "string" - }, - "workspace": { - "type": "string" - } - }, - "additionalProperties": false - }, - "required": false, - "style": "deepObject", - "explode": true - } - ], - "security": [], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "location": { - "$ref": "#/components/schemas/LocationInfo" - }, - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/SkillV2Info" - } - } - }, - "required": ["location", "data"], - "additionalProperties": false - } - } - } - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - } - }, - "description": "Retrieve currently registered skills.", - "summary": "List skills", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.skill.list({\n ...\n})" - } - ] - } - }, - "/api/event": { - "get": { - "tags": ["events"], - "operationId": "v2.event.subscribe", - "parameters": [], - "security": [], - "responses": { - "200": { - "description": "Event stream", - "content": { - "text/event-stream": { - "schema": { - "$ref": "#/components/schemas/V2Event" - } - } - } - }, - "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.", - "summary": "Subscribe to events", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.event.subscribe({\n ...\n})" - } - ] - } - }, - "/api/pty": { - "get": { - "tags": ["pty"], - "operationId": "v2.pty.list", - "parameters": [ - { - "name": "location", - "in": "query", - "schema": { - "type": "object", - "properties": { - "directory": { - "type": "string" - }, - "workspace": { - "type": "string" - } - }, - "additionalProperties": false - }, - "required": false, - "style": "deepObject", - "explode": true - } - ], - "security": [], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "location": { - "$ref": "#/components/schemas/LocationInfo" - }, - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/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", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.pty.list({\n ...\n})" - } - ] - }, - "post": { - "tags": ["pty"], - "operationId": "v2.pty.create", - "parameters": [ - { - "name": "location", - "in": "query", - "schema": { - "type": "object", - "properties": { - "directory": { - "type": "string" - }, - "workspace": { - "type": "string" - } - }, - "additionalProperties": false - }, - "required": false, - "style": "deepObject", - "explode": true - } - ], - "security": [], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "location": { - "$ref": "#/components/schemas/LocationInfo" - }, - "data": { - "$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 - }, - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.pty.create({\n ...\n})" - } - ] - } - }, - "/api/pty/{ptyID}": { - "get": { - "tags": ["pty"], - "operationId": "v2.pty.get", - "parameters": [ - { - "name": "ptyID", - "in": "path", - "schema": { - "type": "string", - "pattern": "^pty" - }, - "required": true - }, - { - "name": "location", - "in": "query", - "schema": { - "type": "object", - "properties": { - "directory": { - "type": "string" - }, - "workspace": { - "type": "string" - } - }, - "additionalProperties": false - }, - "required": false, - "style": "deepObject", - "explode": true - } - ], - "security": [], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "location": { - "$ref": "#/components/schemas/LocationInfo" - }, - "data": { - "$ref": "#/components/schemas/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", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.pty.get({\n ...\n})" - } - ] - }, - "put": { - "tags": ["pty"], - "operationId": "v2.pty.update", - "parameters": [ - { - "name": "ptyID", - "in": "path", - "schema": { - "type": "string", - "pattern": "^pty" - }, - "required": true - }, - { - "name": "location", - "in": "query", - "schema": { - "type": "object", - "properties": { - "directory": { - "type": "string" - }, - "workspace": { - "type": "string" - } - }, - "additionalProperties": false - }, - "required": false, - "style": "deepObject", - "explode": true - } - ], - "security": [], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "location": { - "$ref": "#/components/schemas/LocationInfo" - }, - "data": { - "$ref": "#/components/schemas/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", - "exclusiveMinimum": 0 - }, - "cols": { - "type": "integer", - "exclusiveMinimum": 0 - } - }, - "required": ["rows", "cols"], - "additionalProperties": false - } - }, - "additionalProperties": false - } - } - }, - "required": true - }, - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.pty.update({\n ...\n})" - } - ] - }, - "delete": { - "tags": ["pty"], - "operationId": "v2.pty.remove", - "parameters": [ - { - "name": "ptyID", - "in": "path", - "schema": { - "type": "string", - "pattern": "^pty" - }, - "required": true - }, - { - "name": "location", - "in": "query", - "schema": { - "type": "object", - "properties": { - "directory": { - "type": "string" - }, - "workspace": { - "type": "string" - } - }, - "additionalProperties": false - }, - "required": false, - "style": "deepObject", - "explode": true - } - ], - "security": [], - "responses": { - "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", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.pty.remove({\n ...\n})" - } - ] - } - }, - "/api/pty/{ptyID}/connect-token": { - "post": { - "tags": ["pty"], - "operationId": "v2.pty.connectToken", - "parameters": [ - { - "name": "ptyID", - "in": "path", - "schema": { - "type": "string", - "pattern": "^pty" - }, - "required": true - }, - { - "name": "location", - "in": "query", - "schema": { - "type": "object", - "properties": { - "directory": { - "type": "string" - }, - "workspace": { - "type": "string" - } - }, - "additionalProperties": false - }, - "required": false, - "style": "deepObject", - "explode": true - } - ], - "security": [], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "location": { - "$ref": "#/components/schemas/LocationInfo" - }, - "data": { - "$ref": "#/components/schemas/PtyTicketConnectToken" - } - }, - "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", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.pty.connectToken({\n ...\n})" - } - ] - } - }, - "/api/pty/{ptyID}/connect": { - "get": { - "tags": ["pty"], - "operationId": "v2.pty.connect", - "parameters": [ - { - "name": "ptyID", - "in": "path", - "schema": { - "type": "string", - "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, - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.pty.connect({\n ...\n})" - } - ] - } - }, - "/api/question/request": { - "get": { - "tags": ["session questions"], - "operationId": "v2.question.request.list", - "parameters": [ - { - "name": "location", - "in": "query", - "schema": { - "type": "object", - "properties": { - "directory": { - "type": "string" - }, - "workspace": { - "type": "string" - } - }, - "additionalProperties": false - }, - "required": false, - "style": "deepObject", - "explode": true - } - ], - "security": [], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "location": { - "$ref": "#/components/schemas/LocationInfo" - }, - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/QuestionV2Request" - } - } - }, - "required": ["location", "data"], - "additionalProperties": false - } - } - } - }, - "400": { - "description": "InvalidRequestError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequestError" - } - } - } - }, - "401": { - "description": "UnauthorizedError", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedError" - } - } - } - } - }, - "description": "Retrieve pending question requests for a location.", - "summary": "List pending question requests", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.question.request.list({\n ...\n})" - } - ] - } - }, - "/api/session/{sessionID}/question": { - "get": { - "tags": ["session questions"], - "operationId": "v2.session.question.list", - "parameters": [ - { - "name": "sessionID", - "in": "path", - "schema": { - "type": "string", - "pattern": "^ses" - }, - "required": true - } - ], - "security": [], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/QuestionV2Request" - } - } - }, - "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", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.question.list({\n ...\n})" - } - ] - } - }, - "/api/session/{sessionID}/question/{requestID}/reply": { - "post": { - "tags": ["session questions"], - "operationId": "v2.session.question.reply", - "parameters": [ - { - "name": "sessionID", - "in": "path", - "schema": { - "type": "string", - "pattern": "^ses" - }, - "required": true - }, - { - "name": "requestID", - "in": "path", - "schema": { - "type": "string", - "pattern": "^que" - }, - "required": true - } - ], - "security": [], - "responses": { - "204": { - "description": "" - }, - "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/QuestionV2Reply" - } - } - }, - "required": true - }, - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.question.reply({\n ...\n})" - } - ] - } - }, - "/api/session/{sessionID}/question/{requestID}/reject": { - "post": { - "tags": ["session questions"], - "operationId": "v2.session.question.reject", - "parameters": [ - { - "name": "sessionID", - "in": "path", - "schema": { - "type": "string", - "pattern": "^ses" - }, - "required": true - }, - { - "name": "requestID", - "in": "path", - "schema": { - "type": "string", - "pattern": "^que" - }, - "required": true - } - ], - "security": [], - "responses": { - "204": { - "description": "" - }, - "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", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.session.question.reject({\n ...\n})" - } - ] - } - }, - "/api/reference": { - "get": { - "tags": ["reference"], - "operationId": "v2.reference.list", - "parameters": [ - { - "name": "location", - "in": "query", - "schema": { - "type": "object", - "properties": { - "directory": { - "type": "string" - }, - "workspace": { - "type": "string" - } - }, - "additionalProperties": false - }, - "required": false, - "style": "deepObject", - "explode": true - } - ], - "security": [], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "location": { - "$ref": "#/components/schemas/LocationInfo" - }, - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ReferenceInfo" - } - } - }, - "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", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.reference.list({\n ...\n})" - } - ] - } - }, - "/experimental/project/{projectID}/copy": { - "post": { - "tags": ["projectCopy"], - "operationId": "v2.projectCopy.create", - "parameters": [ - { - "name": "projectID", - "in": "path", - "schema": { - "type": "string" - }, - "required": true - }, - { - "name": "location", - "in": "query", - "schema": { - "type": "object", - "properties": { - "directory": { - "type": "string" - }, - "workspace": { - "type": "string" - } - }, - "additionalProperties": false - }, - "required": false, - "style": "deepObject", - "explode": true - } - ], - "responses": { - "200": { - "description": "ProjectCopy.Copy", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProjectCopyCopy" - } - } - } - }, - "400": { - "description": "ProjectCopyError | InvalidRequestError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/ProjectCopyError" - }, - { - "$ref": "#/components/schemas/InvalidRequestError" - } - ] - } - } - } - } - }, - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "strategy": { - "type": "string" - }, - "directory": { - "type": "string" - }, - "name": { - "type": "string" - } - }, - "required": ["strategy", "directory"], - "additionalProperties": false - } - } - } - }, - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.projectCopy.create({\n ...\n})" - } - ] - }, - "delete": { - "tags": ["projectCopy"], - "operationId": "v2.projectCopy.remove", - "parameters": [ - { - "name": "projectID", - "in": "path", - "schema": { - "type": "string" - }, - "required": true - }, - { - "name": "location", - "in": "query", - "schema": { - "type": "object", - "properties": { - "directory": { - "type": "string" - }, - "workspace": { - "type": "string" - } - }, - "additionalProperties": false - }, - "required": false, - "style": "deepObject", - "explode": true - } - ], - "responses": { - "204": { - "description": "" - }, - "400": { - "description": "ProjectCopyError | InvalidRequestError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/ProjectCopyError" - }, - { - "$ref": "#/components/schemas/InvalidRequestError" - } - ] - } - } - } - } - }, - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "directory": { - "type": "string" - }, - "force": { - "type": "boolean" - } - }, - "required": ["directory", "force"], - "additionalProperties": false - } - } - } - }, - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.projectCopy.remove({\n ...\n})" - } - ] - } - }, - "/experimental/project/{projectID}/copy/refresh": { - "post": { - "tags": ["projectCopy"], - "operationId": "v2.projectCopy.refresh", - "parameters": [ - { - "name": "projectID", - "in": "path", - "schema": { - "type": "string" - }, - "required": true - }, - { - "name": "location", - "in": "query", - "schema": { - "type": "object", - "properties": { - "directory": { - "type": "string" - }, - "workspace": { - "type": "string" - } - }, - "additionalProperties": false - }, - "required": false, - "style": "deepObject", - "explode": true - } - ], - "responses": { - "204": { - "description": "" - }, - "400": { - "description": "ProjectCopyError | InvalidRequestError", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/ProjectCopyError" - }, - { - "$ref": "#/components/schemas/InvalidRequestError" - } - ] - } - } - } - } - }, - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.v2.projectCopy.refresh({\n ...\n})" - } - ] - } - }, - "/pty/{ptyID}/connect": { - "get": { - "tags": ["pty"], - "operationId": "pty.connect", - "parameters": [ - { - "name": "ptyID", - "in": "path", - "schema": { - "type": "string", - "pattern": "^pty" - }, - "required": true - }, - { - "in": "query", - "name": "directory", - "schema": { - "type": "string" - } - }, - { - "in": "query", - "name": "workspace", - "schema": { - "type": "string" - } - }, - { - "in": "query", - "name": "cursor", - "schema": { - "type": "string" - } - }, - { - "in": "query", - "name": "ticket", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Connected session", - "content": { - "application/json": { - "schema": { - "type": "boolean", - "description": "Connected session" - } - } - } - }, - "403": { - "description": "Forbidden", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/effect_HttpApiError_Forbidden" - } - } - } - }, - "404": { - "description": "Not found", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/NotFoundError" - } - } - } - } - }, - "description": "Establish a WebSocket connection to interact with a pseudo-terminal (PTY) session in real-time.", - "summary": "Connect to PTY session", - "x-codeSamples": [ - { - "lang": "js", - "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.pty.connect({\n ...\n})" - } - ] - } - } - }, - "components": { - "schemas": { - "Event": { - "anyOf": [ - { - "$ref": "#/components/schemas/EventModels-devRefreshed" - }, - { - "$ref": "#/components/schemas/EventIntegrationUpdated" - }, - { - "$ref": "#/components/schemas/EventIntegrationConnectionUpdated" - }, - { - "$ref": "#/components/schemas/EventCatalogUpdated" - }, - { - "$ref": "#/components/schemas/EventSessionCreated" - }, - { - "$ref": "#/components/schemas/EventSessionUpdated" - }, - { - "$ref": "#/components/schemas/EventSessionDeleted" - }, - { - "$ref": "#/components/schemas/EventMessageUpdated" - }, - { - "$ref": "#/components/schemas/EventMessageRemoved" - }, - { - "$ref": "#/components/schemas/EventMessagePartUpdated" - }, - { - "$ref": "#/components/schemas/EventMessagePartRemoved" - }, - { - "$ref": "#/components/schemas/EventSessionNextAgentSwitched" - }, - { - "$ref": "#/components/schemas/EventSessionNextModelSwitched" - }, - { - "$ref": "#/components/schemas/EventSessionNextMoved" - }, - { - "$ref": "#/components/schemas/EventSessionNextPrompted" - }, - { - "$ref": "#/components/schemas/EventSessionNextPromptAdmitted" - }, - { - "$ref": "#/components/schemas/EventSessionNextContextUpdated" - }, - { - "$ref": "#/components/schemas/EventSessionNextSynthetic" - }, - { - "$ref": "#/components/schemas/EventSessionNextShellStarted" - }, - { - "$ref": "#/components/schemas/EventSessionNextShellEnded" - }, - { - "$ref": "#/components/schemas/EventSessionNextStepStarted" - }, - { - "$ref": "#/components/schemas/EventSessionNextStepEnded" - }, - { - "$ref": "#/components/schemas/EventSessionNextStepFailed" - }, - { - "$ref": "#/components/schemas/EventSessionNextTextStarted" - }, - { - "$ref": "#/components/schemas/EventSessionNextTextDelta" - }, - { - "$ref": "#/components/schemas/EventSessionNextTextEnded" - }, - { - "$ref": "#/components/schemas/EventSessionNextReasoningStarted" - }, - { - "$ref": "#/components/schemas/EventSessionNextReasoningDelta" - }, - { - "$ref": "#/components/schemas/EventSessionNextReasoningEnded" - }, - { - "$ref": "#/components/schemas/EventSessionNextToolInputStarted" - }, - { - "$ref": "#/components/schemas/EventSessionNextToolInputDelta" - }, - { - "$ref": "#/components/schemas/EventSessionNextToolInputEnded" - }, - { - "$ref": "#/components/schemas/EventSessionNextToolCalled" - }, - { - "$ref": "#/components/schemas/EventSessionNextToolProgress" - }, - { - "$ref": "#/components/schemas/EventSessionNextToolSuccess" - }, - { - "$ref": "#/components/schemas/EventSessionNextToolFailed" - }, - { - "$ref": "#/components/schemas/EventSessionNextRetried" - }, - { - "$ref": "#/components/schemas/EventSessionNextCompactionStarted" - }, - { - "$ref": "#/components/schemas/EventSessionNextCompactionDelta" - }, - { - "$ref": "#/components/schemas/EventSessionNextCompactionEnded" - }, - { - "$ref": "#/components/schemas/EventSessionNextRevertStaged" - }, - { - "$ref": "#/components/schemas/EventSessionNextRevertCleared" - }, - { - "$ref": "#/components/schemas/EventSessionNextRevertCommitted" - }, - { - "$ref": "#/components/schemas/EventMessagePartDelta" - }, - { - "$ref": "#/components/schemas/EventSessionDiff" - }, - { - "$ref": "#/components/schemas/EventSessionError" - }, - { - "$ref": "#/components/schemas/EventInstallationUpdated" - }, - { - "$ref": "#/components/schemas/EventInstallationUpdate-available" - }, - { - "$ref": "#/components/schemas/EventFileEdited" - }, - { - "$ref": "#/components/schemas/EventReferenceUpdated" - }, - { - "$ref": "#/components/schemas/EventPermissionV2Asked" - }, - { - "$ref": "#/components/schemas/EventPermissionV2Replied" - }, - { - "$ref": "#/components/schemas/EventPluginAdded" - }, - { - "$ref": "#/components/schemas/EventProjectDirectoriesUpdated" - }, - { - "$ref": "#/components/schemas/EventFileWatcherUpdated" - }, - { - "$ref": "#/components/schemas/EventPtyCreated" - }, - { - "$ref": "#/components/schemas/EventPtyUpdated" - }, - { - "$ref": "#/components/schemas/EventPtyExited" - }, - { - "$ref": "#/components/schemas/EventPtyDeleted" - }, - { - "$ref": "#/components/schemas/EventQuestionV2Asked" - }, - { - "$ref": "#/components/schemas/EventQuestionV2Replied" - }, - { - "$ref": "#/components/schemas/EventQuestionV2Rejected" - }, - { - "$ref": "#/components/schemas/EventLspUpdated" - }, - { - "$ref": "#/components/schemas/EventPermissionAsked" - }, - { - "$ref": "#/components/schemas/EventPermissionReplied" - }, - { - "$ref": "#/components/schemas/Event.tui.prompt.append" - }, - { - "$ref": "#/components/schemas/Event.tui.command.execute" - }, - { - "$ref": "#/components/schemas/Event.tui.toast.show" - }, - { - "$ref": "#/components/schemas/Event.tui.session.select" - }, - { - "$ref": "#/components/schemas/EventMcpToolsChanged" - }, - { - "$ref": "#/components/schemas/EventMcpBrowserOpenFailed" - }, - { - "$ref": "#/components/schemas/EventCommandExecuted" - }, - { - "$ref": "#/components/schemas/EventProjectUpdated" - }, - { - "$ref": "#/components/schemas/EventSessionStatus" - }, - { - "$ref": "#/components/schemas/EventSessionIdle" - }, - { - "$ref": "#/components/schemas/EventQuestionAsked" - }, - { - "$ref": "#/components/schemas/EventQuestionReplied" - }, - { - "$ref": "#/components/schemas/EventQuestionRejected" - }, - { - "$ref": "#/components/schemas/EventSessionCompacted" - }, - { - "$ref": "#/components/schemas/EventVcsBranchUpdated" - }, - { - "$ref": "#/components/schemas/EventWorkspaceReady" - }, - { - "$ref": "#/components/schemas/EventWorkspaceFailed" - }, - { - "$ref": "#/components/schemas/EventWorkspaceStatus" - }, - { - "$ref": "#/components/schemas/EventWorktreeReady" - }, - { - "$ref": "#/components/schemas/EventWorktreeFailed" - }, - { - "$ref": "#/components/schemas/EventServerConnected" - }, - { - "$ref": "#/components/schemas/EventGlobalDisposed" - }, - { - "$ref": "#/components/schemas/EventServerInstanceDisposed" - } - ] - }, - "QuestionReplied": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "requestID": { - "type": "string", - "pattern": "^que" - }, - "answers": { - "type": "array", - "items": { - "$ref": "#/components/schemas/QuestionAnswer" - } - } - }, - "required": ["sessionID", "requestID", "answers"], - "additionalProperties": false - }, - "QuestionRejected": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "requestID": { - "type": "string", - "pattern": "^que" - } - }, - "required": ["sessionID", "requestID"], - "additionalProperties": false - }, - "OAuth": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["oauth"] - }, - "refresh": { - "type": "string" - }, - "access": { - "type": "string" - }, - "expires": { - "type": "integer", - "minimum": 0 - }, - "accountId": { - "type": "string" - }, - "enterpriseUrl": { - "type": "string" - } - }, - "required": ["type", "refresh", "access", "expires"], - "additionalProperties": false - }, - "ApiAuth": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["api"] - }, - "key": { - "type": "string" - }, - "metadata": { - "type": "object", - "additionalProperties": { - "type": "string" - } - } - }, - "required": ["type", "key"], - "additionalProperties": false - }, - "WellKnownAuth": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["wellknown"] - }, - "key": { - "type": "string" - }, - "token": { - "type": "string" - } - }, - "required": ["type", "key", "token"], - "additionalProperties": false - }, - "Auth": { - "anyOf": [ - { - "$ref": "#/components/schemas/OAuth" - }, - { - "$ref": "#/components/schemas/ApiAuth" - }, - { - "$ref": "#/components/schemas/WellKnownAuth" - } - ] - }, - "effect_HttpApiError_BadRequest": { - "type": "object", - "properties": { - "_tag": { - "type": "string", - "enum": ["BadRequest"] - } - }, - "required": ["_tag"], - "additionalProperties": false - }, - "InvalidRequestError": { - "type": "object", - "properties": { - "_tag": { - "type": "string", - "enum": ["InvalidRequestError"] - }, - "message": { - "type": "string" - }, - "kind": { - "type": "string" - }, - "field": { - "type": "string" - } - }, - "required": ["_tag", "message"], - "additionalProperties": false - }, - "MoveSessionError": { - "type": "object", - "properties": { - "name": { - "type": "string", - "enum": ["MoveSessionError"] - }, - "data": { - "type": "object", - "properties": { - "message": { - "type": "string" - } - }, - "required": ["message"], - "additionalProperties": false - } - }, - "required": ["name", "data"], - "additionalProperties": false - }, - "SnapshotFileDiff": { - "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" - } - }, - "Session": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^ses" - }, - "slug": { - "type": "string" - }, - "projectID": { - "type": "string" - }, - "workspaceID": { - "type": "string", - "pattern": "^wrk" - }, - "directory": { - "type": "string" - }, - "path": { - "type": "string" - }, - "parentID": { - "type": "string", - "pattern": "^ses" - }, - "summary": { - "type": "object", - "properties": { - "additions": { - "type": "number" - }, - "deletions": { - "type": "number" - }, - "files": { - "type": "number" - }, - "diffs": { - "type": "array", - "items": { - "$ref": "#/components/schemas/SnapshotFileDiff" - } - } - }, - "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", - "minimum": 0 - }, - "updated": { - "type": "integer", - "minimum": 0 - }, - "compacting": { - "type": "integer", - "minimum": 0 - }, - "archived": { - "type": "number" - } - }, - "required": ["created", "updated"], - "additionalProperties": false - }, - "permission": { - "$ref": "#/components/schemas/PermissionRuleset" - }, - "revert": { - "type": "object", - "properties": { - "messageID": { - "type": "string", - "pattern": "^msg" - }, - "partID": { - "type": "string", - "pattern": "^prt" - }, - "snapshot": { - "type": "string" - }, - "diff": { - "type": "string" - } - }, - "required": ["messageID"], - "additionalProperties": false - } - }, - "required": ["id", "slug", "projectID", "directory", "title", "version", "time"], - "additionalProperties": false - }, - "OutputFormatText": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["text"] - } - }, - "required": ["type"], - "additionalProperties": false - }, - "JSONSchema": { - "type": "object" - }, - "OutputFormatJsonSchema": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["json_schema"] - }, - "schema": { - "$ref": "#/components/schemas/JSONSchema" - }, - "retryCount": { - "type": "integer", - "minimum": 0 - } - }, - "required": ["type", "schema"], - "additionalProperties": false - }, - "OutputFormat": { - "anyOf": [ - { - "$ref": "#/components/schemas/OutputFormatText" - }, - { - "$ref": "#/components/schemas/OutputFormatJsonSchema" - } - ] - }, - "UserMessage": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^msg" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "role": { - "type": "string", - "enum": ["user"] - }, - "time": { - "type": "object", - "properties": { - "created": { - "type": "number", - "minimum": 0 - } - }, - "required": ["created"], - "additionalProperties": false - }, - "format": { - "$ref": "#/components/schemas/OutputFormat" - }, - "summary": { - "type": "object", - "properties": { - "title": { - "type": "string" - }, - "body": { - "type": "string" - }, - "diffs": { - "type": "array", - "items": { - "$ref": "#/components/schemas/SnapshotFileDiff" - } - } - }, - "required": ["diffs"], - "additionalProperties": false - }, - "agent": { - "type": "string" - }, - "model": { - "type": "object", - "properties": { - "providerID": { - "type": "string" - }, - "modelID": { - "type": "string" - }, - "variant": { - "type": "string" - } - }, - "required": ["providerID", "modelID"], - "additionalProperties": false - }, - "system": { - "type": "string" - }, - "tools": { - "type": "object", - "additionalProperties": { - "type": "boolean" - } - } - }, - "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 - }, - "UnknownError": { - "type": "object", - "properties": { - "name": { - "type": "string", - "enum": ["UnknownError"] - }, - "data": { - "type": "object", - "properties": { - "message": { - "type": "string" - }, - "ref": { - "type": "string" - } - }, - "required": ["message"], - "additionalProperties": false - } - }, - "required": ["name", "data"], - "additionalProperties": false - }, - "MessageOutputLengthError": { - "type": "object", - "properties": { - "name": { - "type": "string", - "enum": ["MessageOutputLengthError"] - }, - "data": { - "type": "object", - "properties": {} - } - }, - "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", - "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": { - "type": "string" - } - }, - "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": { - "type": "integer", - "minimum": 0 - }, - "isRetryable": { - "type": "boolean" - }, - "responseHeaders": { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "responseBody": { - "type": "string" - }, - "metadata": { - "type": "object", - "additionalProperties": { - "type": "string" - } - } - }, - "required": ["message", "isRetryable"], - "additionalProperties": false - } - }, - "required": ["name", "data"], - "additionalProperties": false - }, - "AssistantMessage": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^msg" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "role": { - "type": "string", - "enum": ["assistant"] - }, - "time": { - "type": "object", - "properties": { - "created": { - "type": "integer", - "minimum": 0 - }, - "completed": { - "type": "integer", - "minimum": 0 - } - }, - "required": ["created"], - "additionalProperties": false - }, - "error": { - "anyOf": [ - { - "$ref": "#/components/schemas/ProviderAuthError" - }, - { - "$ref": "#/components/schemas/UnknownError" - }, - { - "$ref": "#/components/schemas/MessageOutputLengthError" - }, - { - "$ref": "#/components/schemas/MessageAbortedError" - }, - { - "$ref": "#/components/schemas/StructuredOutputError" - }, - { - "$ref": "#/components/schemas/ContextOverflowError" - }, - { - "$ref": "#/components/schemas/ContentFilterError" - }, - { - "$ref": "#/components/schemas/APIError" - } - ] - }, - "parentID": { - "type": "string", - "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": { - "type": "boolean" - }, - "cost": { - "type": "number" - }, - "tokens": { - "type": "object", - "properties": { - "total": { - "type": "number" - }, - "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": {}, - "variant": { - "type": "string" - }, - "finish": { - "type": "string" - } - }, - "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" - } - ] - }, - "TextPart": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^prt" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "messageID": { - "type": "string", - "pattern": "^msg" - }, - "type": { - "type": "string", - "enum": ["text"] - }, - "text": { - "type": "string" - }, - "session.synthetic": { - "type": "boolean" - }, - "ignored": { - "type": "boolean" - }, - "time": { - "type": "object", - "properties": { - "start": { - "type": "integer", - "minimum": 0 - }, - "end": { - "type": "integer", - "minimum": 0 - } - }, - "required": ["start"], - "additionalProperties": false - }, - "metadata": { - "type": "object" - } - }, - "required": ["id", "sessionID", "messageID", "type", "text"], - "additionalProperties": false - }, - "SubtaskPart": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^prt" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "messageID": { - "type": "string", - "pattern": "^msg" - }, - "type": { - "type": "string", - "enum": ["subtask"] - }, - "prompt": { - "type": "string" - }, - "description": { - "type": "string" - }, - "agent": { - "type": "string" - }, - "model": { - "type": "object", - "properties": { - "providerID": { - "type": "string" - }, - "modelID": { - "type": "string" - } - }, - "required": ["providerID", "modelID"], - "additionalProperties": false - }, - "command": { - "type": "string" - } - }, - "required": ["id", "sessionID", "messageID", "type", "prompt", "description", "agent"], - "additionalProperties": false - }, - "ReasoningPart": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^prt" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "messageID": { - "type": "string", - "pattern": "^msg" - }, - "type": { - "type": "string", - "enum": ["reasoning"] - }, - "text": { - "type": "string" - }, - "metadata": { - "type": "object" - }, - "time": { - "type": "object", - "properties": { - "start": { - "type": "integer", - "minimum": 0 - }, - "end": { - "type": "integer", - "minimum": 0 - } - }, - "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", - "minimum": 0 - }, - "character": { - "type": "integer", - "minimum": 0 - } - }, - "required": ["line", "character"], - "additionalProperties": false - }, - "end": { - "type": "object", - "properties": { - "line": { - "type": "integer", - "minimum": 0 - }, - "character": { - "type": "integer", - "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", - "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", - "pattern": "^prt" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "messageID": { - "type": "string", - "pattern": "^msg" - }, - "type": { - "type": "string", - "enum": ["file"] - }, - "mime": { - "type": "string" - }, - "filename": { - "type": "string" - }, - "url": { - "type": "string" - }, - "source": { - "$ref": "#/components/schemas/FilePartSource" - } - }, - "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": { - "type": "string" - }, - "metadata": { - "type": "object" - }, - "time": { - "type": "object", - "properties": { - "start": { - "type": "integer", - "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", - "minimum": 0 - }, - "end": { - "type": "integer", - "minimum": 0 - }, - "compacted": { - "type": "integer", - "minimum": 0 - } - }, - "required": ["start", "end"], - "additionalProperties": false - }, - "attachments": { - "type": "array", - "items": { - "$ref": "#/components/schemas/FilePart" - } - } - }, - "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": { - "type": "object" - }, - "time": { - "type": "object", - "properties": { - "start": { - "type": "integer", - "minimum": 0 - }, - "end": { - "type": "integer", - "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", - "pattern": "^prt" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "messageID": { - "type": "string", - "pattern": "^msg" - }, - "type": { - "type": "string", - "enum": ["tool"] - }, - "callID": { - "type": "string" - }, - "tool": { - "type": "string" - }, - "state": { - "$ref": "#/components/schemas/ToolState" - }, - "metadata": { - "type": "object" - } - }, - "required": ["id", "sessionID", "messageID", "type", "callID", "tool", "state"], - "additionalProperties": false - }, - "StepStartPart": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^prt" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "messageID": { - "type": "string", - "pattern": "^msg" - }, - "type": { - "type": "string", - "enum": ["step-start"] - }, - "snapshot": { - "type": "string" - } - }, - "required": ["id", "sessionID", "messageID", "type"], - "additionalProperties": false - }, - "StepFinishPart": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^prt" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "messageID": { - "type": "string", - "pattern": "^msg" - }, - "type": { - "type": "string", - "enum": ["step-finish"] - }, - "reason": { - "type": "string" - }, - "snapshot": { - "type": "string" - }, - "cost": { - "type": "number" - }, - "tokens": { - "type": "object", - "properties": { - "total": { - "type": "number" - }, - "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", - "pattern": "^prt" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "messageID": { - "type": "string", - "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", - "pattern": "^prt" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "messageID": { - "type": "string", - "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", - "pattern": "^prt" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "messageID": { - "type": "string", - "pattern": "^msg" - }, - "type": { - "type": "string", - "enum": ["agent"] - }, - "name": { - "type": "string" - }, - "source": { - "type": "object", - "properties": { - "value": { - "type": "string" - }, - "start": { - "type": "integer", - "minimum": 0 - }, - "end": { - "type": "integer", - "minimum": 0 - } - }, - "required": ["value", "start", "end"], - "additionalProperties": false - } - }, - "required": ["id", "sessionID", "messageID", "type", "name"], - "additionalProperties": false - }, - "RetryPart": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^prt" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "messageID": { - "type": "string", - "pattern": "^msg" - }, - "type": { - "type": "string", - "enum": ["retry"] - }, - "attempt": { - "type": "integer", - "minimum": 0 - }, - "error": { - "$ref": "#/components/schemas/APIError" - }, - "time": { - "type": "object", - "properties": { - "created": { - "type": "integer", - "minimum": 0 - } - }, - "required": ["created"], - "additionalProperties": false - } - }, - "required": ["id", "sessionID", "messageID", "type", "attempt", "error", "time"], - "additionalProperties": false - }, - "CompactionPart": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^prt" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "messageID": { - "type": "string", - "pattern": "^msg" - }, - "type": { - "type": "string", - "enum": ["compaction"] - }, - "auto": { - "type": "boolean" - }, - "overflow": { - "type": "boolean" - }, - "tail_start_id": { - "type": "string", - "pattern": "^msg" - } - }, - "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" - } - ] - }, - "Prompt": { - "type": "object", - "properties": { - "text": { - "type": "string" - }, - "files": { - "type": "array", - "items": { - "$ref": "#/components/schemas/PromptFileAttachment" - } - }, - "agents": { - "type": "array", - "items": { - "$ref": "#/components/schemas/PromptAgentAttachment" - } - } - }, - "required": ["text"], - "additionalProperties": false - }, - "Pty": { - "type": "object", - "properties": { - "id": { - "type": "string", - "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", - "minimum": 0 - }, - "exitCode": { - "type": "integer", - "minimum": 0 - } - }, - "required": ["id", "title", "command", "args", "cwd", "status", "pid"], - "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", - "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", - "minimum": 0 - } - }, - "required": ["type", "attempt", "message", "next"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["busy"] - } - }, - "required": ["type"], - "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": { - "type": "boolean" - }, - "custom": { - "type": "boolean" - } - }, - "required": ["question", "header", "options"], - "additionalProperties": false - }, - "QuestionTool": { - "type": "object", - "properties": { - "messageID": { - "type": "string", - "pattern": "^msg" - }, - "callID": { - "type": "string" - } - }, - "required": ["messageID", "callID"], - "additionalProperties": false - }, - "QuestionAnswer": { - "type": "array", - "items": { - "type": "string" - } - }, - "GlobalEvent": { - "type": "object", - "properties": { - "directory": { - "type": "string" - }, - "project": { - "type": "string" - }, - "workspace": { - "type": "string" - }, - "payload": { - "anyOf": [ - { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["models-dev.refreshed"] - }, - "properties": { - "type": "object", - "properties": {} - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["integration.updated"] - }, - "properties": { - "type": "object", - "properties": {} - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["integration.connection.updated"] - }, - "properties": { - "type": "object", - "properties": { - "integrationID": { - "type": "string" - } - }, - "required": ["integrationID"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["catalog.updated"] - }, - "properties": { - "type": "object", - "properties": {} - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["session.created"] - }, - "properties": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "info": { - "$ref": "#/components/schemas/Session" - } - }, - "required": ["sessionID", "info"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["session.updated"] - }, - "properties": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "info": { - "$ref": "#/components/schemas/Session" - } - }, - "required": ["sessionID", "info"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["session.deleted"] - }, - "properties": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "info": { - "$ref": "#/components/schemas/Session" - } - }, - "required": ["sessionID", "info"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["message.updated"] - }, - "properties": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "info": { - "$ref": "#/components/schemas/Message" - } - }, - "required": ["sessionID", "info"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["message.removed"] - }, - "properties": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "messageID": { - "type": "string", - "pattern": "^msg" - } - }, - "required": ["sessionID", "messageID"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["message.part.updated"] - }, - "properties": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "part": { - "$ref": "#/components/schemas/Part" - }, - "time": { - "type": "number" - } - }, - "required": ["sessionID", "part", "time"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["message.part.removed"] - }, - "properties": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "messageID": { - "type": "string", - "pattern": "^msg" - }, - "partID": { - "type": "string", - "pattern": "^prt" - } - }, - "required": ["sessionID", "messageID", "partID"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["session.next.agent.switched"] - }, - "properties": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "messageID": { - "type": "string", - "pattern": "^msg_" - }, - "agent": { - "type": "string" - } - }, - "required": ["timestamp", "sessionID", "messageID", "agent"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["session.next.model.switched"] - }, - "properties": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "messageID": { - "type": "string", - "pattern": "^msg_" - }, - "model": { - "$ref": "#/components/schemas/ModelRef" - } - }, - "required": ["timestamp", "sessionID", "messageID", "model"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["session.next.moved"] - }, - "properties": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "location": { - "$ref": "#/components/schemas/LocationRef" - }, - "subdirectory": { - "type": "string" - } - }, - "required": ["timestamp", "sessionID", "location"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["session.next.prompted"] - }, - "properties": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "messageID": { - "type": "string", - "pattern": "^msg_" - }, - "prompt": { - "$ref": "#/components/schemas/Prompt" - }, - "delivery": { - "type": "string", - "enum": ["steer", "queue"] - } - }, - "required": ["timestamp", "sessionID", "messageID", "prompt", "delivery"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["session.next.prompt.admitted"] - }, - "properties": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "messageID": { - "type": "string", - "pattern": "^msg_" - }, - "prompt": { - "$ref": "#/components/schemas/Prompt" - }, - "delivery": { - "type": "string", - "enum": ["steer", "queue"] - } - }, - "required": ["timestamp", "sessionID", "messageID", "prompt", "delivery"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["session.next.context.updated"] - }, - "properties": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "messageID": { - "type": "string", - "pattern": "^msg_" - }, - "text": { - "type": "string" - } - }, - "required": ["timestamp", "sessionID", "messageID", "text"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["session.next.synthetic"] - }, - "properties": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "messageID": { - "type": "string", - "pattern": "^msg_" - }, - "text": { - "type": "string" - } - }, - "required": ["timestamp", "sessionID", "messageID", "text"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["session.next.shell.started"] - }, - "properties": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "messageID": { - "type": "string", - "pattern": "^msg_" - }, - "callID": { - "type": "string" - }, - "command": { - "type": "string" - } - }, - "required": ["timestamp", "sessionID", "messageID", "callID", "command"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["session.next.shell.ended"] - }, - "properties": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "callID": { - "type": "string" - }, - "output": { - "type": "string" - } - }, - "required": ["timestamp", "sessionID", "callID", "output"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["session.next.step.started"] - }, - "properties": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "assistantMessageID": { - "type": "string", - "pattern": "^msg_" - }, - "agent": { - "type": "string" - }, - "model": { - "$ref": "#/components/schemas/ModelRef" - }, - "snapshot": { - "type": "string" - } - }, - "required": ["timestamp", "sessionID", "assistantMessageID", "agent", "model"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["session.next.step.ended"] - }, - "properties": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "assistantMessageID": { - "type": "string", - "pattern": "^msg_" - }, - "finish": { - "type": "string" - }, - "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 - }, - "snapshot": { - "type": "string" - }, - "files": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": ["timestamp", "sessionID", "assistantMessageID", "finish", "cost", "tokens"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["session.next.step.failed"] - }, - "properties": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "assistantMessageID": { - "type": "string", - "pattern": "^msg_" - }, - "error": { - "$ref": "#/components/schemas/SessionErrorUnknown" - } - }, - "required": ["timestamp", "sessionID", "assistantMessageID", "error"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["session.next.text.started"] - }, - "properties": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "assistantMessageID": { - "type": "string", - "pattern": "^msg_" - }, - "textID": { - "type": "string" - } - }, - "required": ["timestamp", "sessionID", "assistantMessageID", "textID"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["session.next.text.delta"] - }, - "properties": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "assistantMessageID": { - "type": "string", - "pattern": "^msg_" - }, - "textID": { - "type": "string" - }, - "delta": { - "type": "string" - } - }, - "required": ["timestamp", "sessionID", "assistantMessageID", "textID", "delta"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["session.next.text.ended"] - }, - "properties": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "assistantMessageID": { - "type": "string", - "pattern": "^msg_" - }, - "textID": { - "type": "string" - }, - "text": { - "type": "string" - } - }, - "required": ["timestamp", "sessionID", "assistantMessageID", "textID", "text"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["session.next.reasoning.started"] - }, - "properties": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "assistantMessageID": { - "type": "string", - "pattern": "^msg_" - }, - "reasoningID": { - "type": "string" - }, - "providerMetadata": { - "$ref": "#/components/schemas/LLMProviderMetadata" - } - }, - "required": ["timestamp", "sessionID", "assistantMessageID", "reasoningID"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["session.next.reasoning.delta"] - }, - "properties": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "assistantMessageID": { - "type": "string", - "pattern": "^msg_" - }, - "reasoningID": { - "type": "string" - }, - "delta": { - "type": "string" - } - }, - "required": ["timestamp", "sessionID", "assistantMessageID", "reasoningID", "delta"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["session.next.reasoning.ended"] - }, - "properties": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "assistantMessageID": { - "type": "string", - "pattern": "^msg_" - }, - "reasoningID": { - "type": "string" - }, - "text": { - "type": "string" - }, - "providerMetadata": { - "$ref": "#/components/schemas/LLMProviderMetadata" - } - }, - "required": ["timestamp", "sessionID", "assistantMessageID", "reasoningID", "text"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["session.next.tool.input.started"] - }, - "properties": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "assistantMessageID": { - "type": "string", - "pattern": "^msg_" - }, - "callID": { - "type": "string" - }, - "name": { - "type": "string" - } - }, - "required": ["timestamp", "sessionID", "assistantMessageID", "callID", "name"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["session.next.tool.input.delta"] - }, - "properties": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "assistantMessageID": { - "type": "string", - "pattern": "^msg_" - }, - "callID": { - "type": "string" - }, - "delta": { - "type": "string" - } - }, - "required": ["timestamp", "sessionID", "assistantMessageID", "callID", "delta"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["session.next.tool.input.ended"] - }, - "properties": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "assistantMessageID": { - "type": "string", - "pattern": "^msg_" - }, - "callID": { - "type": "string" - }, - "text": { - "type": "string" - } - }, - "required": ["timestamp", "sessionID", "assistantMessageID", "callID", "text"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["session.next.tool.called"] - }, - "properties": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "assistantMessageID": { - "type": "string", - "pattern": "^msg_" - }, - "callID": { - "type": "string" - }, - "tool": { - "type": "string" - }, - "input": { - "type": "object" - }, - "provider": { - "type": "object", - "properties": { - "executed": { - "type": "boolean" - }, - "metadata": { - "$ref": "#/components/schemas/LLMProviderMetadata" - } - }, - "required": ["executed"], - "additionalProperties": false - } - }, - "required": ["timestamp", "sessionID", "assistantMessageID", "callID", "tool", "input", "provider"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["session.next.tool.progress"] - }, - "properties": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "assistantMessageID": { - "type": "string", - "pattern": "^msg_" - }, - "callID": { - "type": "string" - }, - "structured": { - "type": "object" - }, - "content": { - "type": "array", - "items": { - "$ref": "#/components/schemas/LLMToolContent" - } - } - }, - "required": ["timestamp", "sessionID", "assistantMessageID", "callID", "structured", "content"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["session.next.tool.success"] - }, - "properties": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "assistantMessageID": { - "type": "string", - "pattern": "^msg_" - }, - "callID": { - "type": "string" - }, - "structured": { - "type": "object" - }, - "content": { - "type": "array", - "items": { - "$ref": "#/components/schemas/LLMToolContent" - } - }, - "outputPaths": { - "type": "array", - "items": { - "type": "string" - } - }, - "result": {}, - "provider": { - "type": "object", - "properties": { - "executed": { - "type": "boolean" - }, - "metadata": { - "$ref": "#/components/schemas/LLMProviderMetadata" - } - }, - "required": ["executed"], - "additionalProperties": false - } - }, - "required": [ - "timestamp", - "sessionID", - "assistantMessageID", - "callID", - "structured", - "content", - "provider" - ], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["session.next.tool.failed"] - }, - "properties": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "assistantMessageID": { - "type": "string", - "pattern": "^msg_" - }, - "callID": { - "type": "string" - }, - "error": { - "$ref": "#/components/schemas/SessionErrorUnknown" - }, - "result": {}, - "provider": { - "type": "object", - "properties": { - "executed": { - "type": "boolean" - }, - "metadata": { - "$ref": "#/components/schemas/LLMProviderMetadata" - } - }, - "required": ["executed"], - "additionalProperties": false - } - }, - "required": ["timestamp", "sessionID", "assistantMessageID", "callID", "error", "provider"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["session.next.retried"] - }, - "properties": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "attempt": { - "type": "number" - }, - "error": { - "$ref": "#/components/schemas/SessionNextRetry_error" - } - }, - "required": ["timestamp", "sessionID", "attempt", "error"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["session.next.compaction.started"] - }, - "properties": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "messageID": { - "type": "string", - "pattern": "^msg_" - }, - "reason": { - "type": "string", - "enum": ["auto", "manual"] - } - }, - "required": ["timestamp", "sessionID", "messageID", "reason"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["session.next.compaction.delta"] - }, - "properties": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "messageID": { - "type": "string", - "pattern": "^msg_" - }, - "text": { - "type": "string" - } - }, - "required": ["timestamp", "sessionID", "messageID", "text"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["session.next.compaction.ended"] - }, - "properties": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "messageID": { - "type": "string", - "pattern": "^msg_" - }, - "reason": { - "type": "string", - "enum": ["auto", "manual"] - }, - "text": { - "type": "string" - }, - "recent": { - "type": "string" - } - }, - "required": ["timestamp", "sessionID", "messageID", "reason", "text", "recent"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["session.next.revert.staged"] - }, - "properties": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "revert": { - "$ref": "#/components/schemas/RevertState" - } - }, - "required": ["timestamp", "sessionID", "revert"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["session.next.revert.cleared"] - }, - "properties": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - } - }, - "required": ["timestamp", "sessionID"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["session.next.revert.committed"] - }, - "properties": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "messageID": { - "type": "string", - "pattern": "^msg_" - } - }, - "required": ["timestamp", "sessionID", "messageID"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["message.part.delta"] - }, - "properties": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "messageID": { - "type": "string", - "pattern": "^msg" - }, - "partID": { - "type": "string", - "pattern": "^prt" - }, - "field": { - "type": "string" - }, - "delta": { - "type": "string" - } - }, - "required": ["sessionID", "messageID", "partID", "field", "delta"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["session.diff"] - }, - "properties": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "diff": { - "type": "array", - "items": { - "$ref": "#/components/schemas/SnapshotFileDiff" - } - } - }, - "required": ["sessionID", "diff"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["session.error"] - }, - "properties": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "error": { - "anyOf": [ - { - "$ref": "#/components/schemas/ProviderAuthError" - }, - { - "$ref": "#/components/schemas/UnknownError" - }, - { - "$ref": "#/components/schemas/MessageOutputLengthError" - }, - { - "$ref": "#/components/schemas/MessageAbortedError" - }, - { - "$ref": "#/components/schemas/StructuredOutputError" - }, - { - "$ref": "#/components/schemas/ContextOverflowError" - }, - { - "$ref": "#/components/schemas/ContentFilterError" - }, - { - "$ref": "#/components/schemas/APIError" - } - ] - } - }, - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["installation.updated"] - }, - "properties": { - "type": "object", - "properties": { - "version": { - "type": "string" - } - }, - "required": ["version"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["installation.update-available"] - }, - "properties": { - "type": "object", - "properties": { - "version": { - "type": "string" - } - }, - "required": ["version"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["file.edited"] - }, - "properties": { - "type": "object", - "properties": { - "file": { - "type": "string" - } - }, - "required": ["file"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["reference.updated"] - }, - "properties": { - "type": "object", - "properties": {} - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["permission.v2.asked"] - }, - "properties": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^per" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "action": { - "type": "string" - }, - "resources": { - "type": "array", - "items": { - "type": "string" - } - }, - "save": { - "type": "array", - "items": { - "type": "string" - } - }, - "metadata": { - "type": "object" - }, - "source": { - "$ref": "#/components/schemas/PermissionV2Source" - } - }, - "required": ["id", "sessionID", "action", "resources"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["permission.v2.replied"] - }, - "properties": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "requestID": { - "type": "string", - "pattern": "^per" - }, - "reply": { - "$ref": "#/components/schemas/PermissionV2Reply" - } - }, - "required": ["sessionID", "requestID", "reply"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["plugin.added"] - }, - "properties": { - "type": "object", - "properties": { - "id": { - "type": "string" - } - }, - "required": ["id"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["project.directories.updated"] - }, - "properties": { - "type": "object", - "properties": { - "projectID": { - "type": "string" - } - }, - "required": ["projectID"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["file.watcher.updated"] - }, - "properties": { - "type": "object", - "properties": { - "file": { - "type": "string" - }, - "event": { - "type": "string", - "enum": ["add", "change", "unlink"] - } - }, - "required": ["file", "event"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["pty.created"] - }, - "properties": { - "type": "object", - "properties": { - "info": { - "$ref": "#/components/schemas/Pty" - } - }, - "required": ["info"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["pty.updated"] - }, - "properties": { - "type": "object", - "properties": { - "info": { - "$ref": "#/components/schemas/Pty" - } - }, - "required": ["info"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["pty.exited"] - }, - "properties": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^pty" - }, - "exitCode": { - "type": "integer", - "minimum": 0 - } - }, - "required": ["id", "exitCode"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["pty.deleted"] - }, - "properties": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^pty" - } - }, - "required": ["id"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["question.v2.asked"] - }, - "properties": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^que" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "questions": { - "type": "array", - "items": { - "$ref": "#/components/schemas/QuestionV2Info" - }, - "description": "Questions to ask" - }, - "tool": { - "$ref": "#/components/schemas/QuestionV2Tool" - } - }, - "required": ["id", "sessionID", "questions"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["question.v2.replied"] - }, - "properties": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "requestID": { - "type": "string", - "pattern": "^que" - }, - "answers": { - "type": "array", - "items": { - "$ref": "#/components/schemas/QuestionV2Answer" - } - } - }, - "required": ["sessionID", "requestID", "answers"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["question.v2.rejected"] - }, - "properties": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "requestID": { - "type": "string", - "pattern": "^que" - } - }, - "required": ["sessionID", "requestID"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["lsp.updated"] - }, - "properties": { - "type": "object", - "properties": {} - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["permission.asked"] - }, - "properties": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^per" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "permission": { - "type": "string" - }, - "patterns": { - "type": "array", - "items": { - "type": "string" - } - }, - "metadata": { - "type": "object" - }, - "always": { - "type": "array", - "items": { - "type": "string" - } - }, - "tool": { - "type": "object", - "properties": { - "messageID": { - "type": "string" - }, - "callID": { - "type": "string" - } - }, - "required": ["messageID", "callID"], - "additionalProperties": false - } - }, - "required": ["id", "sessionID", "permission", "patterns", "metadata", "always"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["permission.replied"] - }, - "properties": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "requestID": { - "type": "string", - "pattern": "^per" - }, - "reply": { - "type": "string", - "enum": ["once", "always", "reject"] - } - }, - "required": ["sessionID", "requestID", "reply"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["tui.prompt.append"] - }, - "properties": { - "type": "object", - "properties": { - "text": { - "type": "string" - } - }, - "required": ["text"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["tui.command.execute"] - }, - "properties": { - "type": "object", - "properties": { - "command": { - "anyOf": [ - { - "type": "string", - "enum": [ - "session.list", - "session.new", - "session.share", - "session.interrupt", - "session.compact", - "session.page.up", - "session.page.down", - "session.line.up", - "session.line.down", - "session.half.page.up", - "session.half.page.down", - "session.first", - "session.last", - "prompt.clear", - "prompt.submit", - "agent.cycle" - ] - }, - { - "type": "string" - } - ] - } - }, - "required": ["command"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["tui.toast.show"] - }, - "properties": { - "type": "object", - "properties": { - "title": { - "type": "string" - }, - "message": { - "type": "string" - }, - "variant": { - "type": "string", - "enum": ["info", "success", "warning", "error"] - }, - "duration": { - "type": "integer", - "exclusiveMinimum": 0 - } - }, - "required": ["message", "variant"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["tui.session.select"] - }, - "properties": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "pattern": "^ses", - "description": "Session ID to navigate to" - } - }, - "required": ["sessionID"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["mcp.tools.changed"] - }, - "properties": { - "type": "object", - "properties": { - "server": { - "type": "string" - } - }, - "required": ["server"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["mcp.browser.open.failed"] - }, - "properties": { - "type": "object", - "properties": { - "mcpName": { - "type": "string" - }, - "url": { - "type": "string" - } - }, - "required": ["mcpName", "url"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["command.executed"] - }, - "properties": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "arguments": { - "type": "string" - }, - "messageID": { - "type": "string", - "pattern": "^msg" - } - }, - "required": ["name", "sessionID", "arguments", "messageID"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["project.updated"] - }, - "properties": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "worktree": { - "type": "string" - }, - "vcs": { - "$ref": "#/components/schemas/ProjectVcs" - }, - "name": { - "type": "string" - }, - "icon": { - "$ref": "#/components/schemas/ProjectIcon" - }, - "commands": { - "$ref": "#/components/schemas/ProjectCommands" - }, - "time": { - "$ref": "#/components/schemas/ProjectTime" - }, - "sandboxes": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": ["id", "worktree", "time", "sandboxes"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["session.status"] - }, - "properties": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "status": { - "$ref": "#/components/schemas/SessionStatus" - } - }, - "required": ["sessionID", "status"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["session.idle"] - }, - "properties": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "pattern": "^ses" - } - }, - "required": ["sessionID"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["question.asked"] - }, - "properties": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^que" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "questions": { - "type": "array", - "items": { - "$ref": "#/components/schemas/QuestionInfo" - }, - "description": "Questions to ask" - }, - "tool": { - "$ref": "#/components/schemas/QuestionTool" - } - }, - "required": ["id", "sessionID", "questions"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["question.replied"] - }, - "properties": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "requestID": { - "type": "string", - "pattern": "^que" - }, - "answers": { - "type": "array", - "items": { - "$ref": "#/components/schemas/QuestionAnswer" - } - } - }, - "required": ["sessionID", "requestID", "answers"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["question.rejected"] - }, - "properties": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "requestID": { - "type": "string", - "pattern": "^que" - } - }, - "required": ["sessionID", "requestID"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["session.compacted"] - }, - "properties": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "pattern": "^ses" - } - }, - "required": ["sessionID"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["vcs.branch.updated"] - }, - "properties": { - "type": "object", - "properties": { - "branch": { - "type": "string" - } - }, - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["workspace.ready"] - }, - "properties": { - "type": "object", - "properties": { - "name": { - "type": "string" - } - }, - "required": ["name"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["workspace.failed"] - }, - "properties": { - "type": "object", - "properties": { - "message": { - "type": "string" - } - }, - "required": ["message"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["workspace.status"] - }, - "properties": { - "type": "object", - "properties": { - "workspaceID": { - "type": "string", - "pattern": "^wrk" - }, - "status": { - "type": "string", - "enum": ["connected", "connecting", "disconnected", "error"] - } - }, - "required": ["workspaceID", "status"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["worktree.ready"] - }, - "properties": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "branch": { - "type": "string" - } - }, - "required": ["name"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["worktree.failed"] - }, - "properties": { - "type": "object", - "properties": { - "message": { - "type": "string" - } - }, - "required": ["message"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["server.connected"] - }, - "properties": { - "type": "object", - "properties": {} - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["global.disposed"] - }, - "properties": { - "type": "object", - "properties": {} - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - { - "$ref": "#/components/schemas/EventServerInstanceDisposed" - }, - { - "$ref": "#/components/schemas/SyncEventSessionCreated" - }, - { - "$ref": "#/components/schemas/SyncEventSessionUpdated" - }, - { - "$ref": "#/components/schemas/SyncEventSessionDeleted" - }, - { - "$ref": "#/components/schemas/SyncEventMessageUpdated" - }, - { - "$ref": "#/components/schemas/SyncEventMessageRemoved" - }, - { - "$ref": "#/components/schemas/SyncEventMessagePartUpdated" - }, - { - "$ref": "#/components/schemas/SyncEventMessagePartRemoved" - }, - { - "$ref": "#/components/schemas/SyncEventSessionNextAgentSwitched" - }, - { - "$ref": "#/components/schemas/SyncEventSessionNextModelSwitched" - }, - { - "$ref": "#/components/schemas/SyncEventSessionNextMoved" - }, - { - "$ref": "#/components/schemas/SyncEventSessionNextPrompted" - }, - { - "$ref": "#/components/schemas/SyncEventSessionNextPromptAdmitted" - }, - { - "$ref": "#/components/schemas/SyncEventSessionNextContextUpdated" - }, - { - "$ref": "#/components/schemas/SyncEventSessionNextSynthetic" - }, - { - "$ref": "#/components/schemas/SyncEventSessionNextShellStarted" - }, - { - "$ref": "#/components/schemas/SyncEventSessionNextShellEnded" - }, - { - "$ref": "#/components/schemas/SyncEventSessionNextStepStarted" - }, - { - "$ref": "#/components/schemas/SyncEventSessionNextStepEnded" - }, - { - "$ref": "#/components/schemas/SyncEventSessionNextStepFailed" - }, - { - "$ref": "#/components/schemas/SyncEventSessionNextTextStarted" - }, - { - "$ref": "#/components/schemas/SyncEventSessionNextTextEnded" - }, - { - "$ref": "#/components/schemas/SyncEventSessionNextReasoningStarted" - }, - { - "$ref": "#/components/schemas/SyncEventSessionNextReasoningEnded" - }, - { - "$ref": "#/components/schemas/SyncEventSessionNextToolInputStarted" - }, - { - "$ref": "#/components/schemas/SyncEventSessionNextToolInputEnded" - }, - { - "$ref": "#/components/schemas/SyncEventSessionNextToolCalled" - }, - { - "$ref": "#/components/schemas/SyncEventSessionNextToolProgress" - }, - { - "$ref": "#/components/schemas/SyncEventSessionNextToolSuccess" - }, - { - "$ref": "#/components/schemas/SyncEventSessionNextToolFailed" - }, - { - "$ref": "#/components/schemas/SyncEventSessionNextRetried" - }, - { - "$ref": "#/components/schemas/SyncEventSessionNextCompactionStarted" - }, - { - "$ref": "#/components/schemas/SyncEventSessionNextCompactionEnded" - }, - { - "$ref": "#/components/schemas/SyncEventSessionNextRevertStaged" - }, - { - "$ref": "#/components/schemas/SyncEventSessionNextRevertCleared" - }, - { - "$ref": "#/components/schemas/SyncEventSessionNextRevertCommitted" - } - ] - } - }, - "required": ["directory", "payload"], - "additionalProperties": false - }, - "LogLevel": { - "type": "string", - "enum": ["DEBUG", "INFO", "WARN", "ERROR"], - "description": "Log level" - }, - "ServerConfig": { - "type": "object", - "properties": { - "port": { - "type": "integer", - "exclusiveMinimum": 0 - }, - "hostname": { - "type": "string" - }, - "mdns": { - "type": "boolean" - }, - "mdnsDomain": { - "type": "string" - }, - "cors": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "additionalProperties": false, - "description": "Server configuration for opencode serve and web commands" - }, - "PermissionActionConfig": { - "type": "string", - "enum": ["ask", "allow", "deny"] - }, - "PermissionObjectConfig": { - "type": "object", - "additionalProperties": { - "$ref": "#/components/schemas/PermissionActionConfig" - } - }, - "PermissionRuleConfig": { - "anyOf": [ - { - "$ref": "#/components/schemas/PermissionActionConfig" - }, - { - "$ref": "#/components/schemas/PermissionObjectConfig" - } - ] - }, - "PermissionConfig": { - "anyOf": [ - { - "$ref": "#/components/schemas/PermissionActionConfig" - }, - { - "type": "object", - "properties": { - "read": { - "$ref": "#/components/schemas/PermissionRuleConfig" - }, - "edit": { - "$ref": "#/components/schemas/PermissionRuleConfig" - }, - "glob": { - "$ref": "#/components/schemas/PermissionRuleConfig" - }, - "grep": { - "$ref": "#/components/schemas/PermissionRuleConfig" - }, - "list": { - "$ref": "#/components/schemas/PermissionRuleConfig" - }, - "bash": { - "$ref": "#/components/schemas/PermissionRuleConfig" - }, - "task": { - "$ref": "#/components/schemas/PermissionRuleConfig" - }, - "external_directory": { - "$ref": "#/components/schemas/PermissionRuleConfig" - }, - "question": { - "$ref": "#/components/schemas/PermissionActionConfig" - }, - "webfetch": { - "$ref": "#/components/schemas/PermissionActionConfig" - }, - "websearch": { - "$ref": "#/components/schemas/PermissionActionConfig" - }, - "lsp": { - "$ref": "#/components/schemas/PermissionRuleConfig" - }, - "doom_loop": { - "$ref": "#/components/schemas/PermissionActionConfig" - }, - "skill": { - "$ref": "#/components/schemas/PermissionRuleConfig" - } - }, - "additionalProperties": { - "$ref": "#/components/schemas/PermissionRuleConfig" - } - } - ] - }, - "AgentConfig": { - "type": "object", - "properties": { - "model": { - "type": "string" - }, - "variant": { - "type": "string" - }, - "temperature": { - "type": "number" - }, - "top_p": { - "type": "number" - }, - "prompt": { - "type": "string" - }, - "tools": { - "type": "object", - "additionalProperties": { - "type": "boolean" - } - }, - "disable": { - "type": "boolean" - }, - "description": { - "type": "string" - }, - "mode": { - "type": "string", - "enum": ["subagent", "primary", "all"] - }, - "hidden": { - "type": "boolean" - }, - "options": { - "type": "object" - }, - "color": { - "anyOf": [ - { - "type": "string", - "pattern": "^#[0-9a-fA-F]{6}$" - }, - { - "type": "string", - "enum": ["primary", "secondary", "accent", "success", "warning", "error", "info"] - } - ], - "description": "Hex color code (e.g., #FF5733) or theme color (e.g., primary)" - }, - "steps": { - "type": "integer", - "exclusiveMinimum": 0 - }, - "maxSteps": { - "type": "integer", - "exclusiveMinimum": 0 - }, - "permission": { - "$ref": "#/components/schemas/PermissionConfig" - } - }, - "additionalProperties": {} - }, - "ProviderConfig": { - "type": "object", - "properties": { - "api": { - "type": "string" - }, - "name": { - "type": "string" - }, - "env": { - "type": "array", - "items": { - "type": "string" - } - }, - "id": { - "type": "string" - }, - "npm": { - "type": "string" - }, - "whitelist": { - "type": "array", - "items": { - "type": "string" - } - }, - "blacklist": { - "type": "array", - "items": { - "type": "string" - } - }, - "options": { - "type": "object", - "properties": { - "apiKey": { - "type": "string" - }, - "baseURL": { - "type": "string" - }, - "enterpriseUrl": { - "type": "string" - }, - "setCacheKey": { - "type": "boolean" - }, - "timeout": { - "anyOf": [ - { - "type": "integer", - "exclusiveMinimum": 0 - }, - { - "type": "boolean", - "enum": [false] - } - ], - "description": "Timeout in milliseconds for full requests to this provider. Set to false to disable timeout." - }, - "headerTimeout": { - "anyOf": [ - { - "type": "integer", - "exclusiveMinimum": 0 - }, - { - "type": "boolean", - "enum": [false] - } - ], - "description": "Timeout in milliseconds to wait for response headers. Provider integrations may set defaults. Set to false to disable timeout." - }, - "chunkTimeout": { - "type": "integer", - "exclusiveMinimum": 0 - } - }, - "additionalProperties": {} - }, - "models": { - "type": "object", - "additionalProperties": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "family": { - "type": "string" - }, - "release_date": { - "type": "string" - }, - "attachment": { - "type": "boolean" - }, - "reasoning": { - "type": "boolean" - }, - "temperature": { - "type": "boolean" - }, - "tool_call": { - "type": "boolean" - }, - "interleaved": { - "anyOf": [ - { - "type": "boolean", - "enum": [true] - }, - { - "type": "object", - "properties": { - "field": { - "type": "string", - "enum": ["reasoning", "reasoning_content", "reasoning_details"] - } - }, - "required": ["field"], - "additionalProperties": false - } - ] - }, - "cost": { - "type": "object", - "properties": { - "input": { - "type": "number" - }, - "output": { - "type": "number" - }, - "cache_read": { - "type": "number" - }, - "cache_write": { - "type": "number" - }, - "context_over_200k": { - "type": "object", - "properties": { - "input": { - "type": "number" - }, - "output": { - "type": "number" - }, - "cache_read": { - "type": "number" - }, - "cache_write": { - "type": "number" - } - }, - "required": ["input", "output"], - "additionalProperties": false - } - }, - "required": ["input", "output"], - "additionalProperties": false - }, - "limit": { - "type": "object", - "properties": { - "context": { - "type": "number" - }, - "input": { - "type": "number" - }, - "output": { - "type": "number" - } - }, - "required": ["context", "output"], - "additionalProperties": false - }, - "modalities": { - "type": "object", - "properties": { - "input": { - "type": "array", - "items": { - "type": "string", - "enum": ["text", "audio", "image", "video", "pdf"] - } - }, - "output": { - "type": "array", - "items": { - "type": "string", - "enum": ["text", "audio", "image", "video", "pdf"] - } - } - }, - "additionalProperties": false - }, - "experimental": { - "type": "boolean" - }, - "status": { - "type": "string", - "enum": ["alpha", "beta", "deprecated", "active"] - }, - "provider": { - "type": "object", - "properties": { - "npm": { - "type": "string" - }, - "api": { - "type": "string" - } - }, - "additionalProperties": false - }, - "options": { - "type": "object" - }, - "headers": { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "variants": { - "type": "object", - "additionalProperties": { - "type": "object", - "properties": { - "disabled": { - "type": "boolean" - } - }, - "additionalProperties": {} - }, - "description": "Variant-specific configuration" - } - }, - "additionalProperties": false - } - } - }, - "additionalProperties": false - }, - "McpLocalConfig": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["local"], - "description": "Type of MCP server connection" - }, - "command": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Command and arguments to run the MCP server" - }, - "cwd": { - "type": "string" - }, - "environment": { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "enabled": { - "type": "boolean" - }, - "timeout": { - "type": "integer", - "exclusiveMinimum": 0 - } - }, - "required": ["type", "command"], - "additionalProperties": false - }, - "McpOAuthConfig": { - "type": "object", - "properties": { - "clientId": { - "type": "string" - }, - "clientSecret": { - "type": "string" - }, - "scope": { - "type": "string" - }, - "callbackPort": { - "type": "integer", - "minimum": 1, - "maximum": 65535 - }, - "redirectUri": { - "type": "string" - } - }, - "additionalProperties": false - }, - "McpRemoteConfig": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["remote"], - "description": "Type of MCP server connection" - }, - "url": { - "type": "string", - "description": "URL of the remote MCP server" - }, - "enabled": { - "type": "boolean" - }, - "headers": { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "oauth": { - "anyOf": [ - { - "$ref": "#/components/schemas/McpOAuthConfig" - }, - { - "type": "boolean", - "enum": [false] - } - ], - "description": "OAuth authentication configuration for the MCP server. Set to false to disable OAuth auto-detection." - }, - "timeout": { - "type": "integer", - "exclusiveMinimum": 0 - } - }, - "required": ["type", "url"], - "additionalProperties": false - }, - "LayoutConfig": { - "type": "string", - "enum": ["auto", "stretch"], - "description": "@deprecated Always uses stretch layout." - }, - "ImageAttachmentConfig": { - "type": "object", - "properties": { - "auto_resize": { - "type": "boolean" - }, - "max_width": { - "type": "integer", - "exclusiveMinimum": 0 - }, - "max_height": { - "type": "integer", - "exclusiveMinimum": 0 - }, - "max_base64_bytes": { - "type": "integer", - "exclusiveMinimum": 0 - } - }, - "additionalProperties": false - }, - "AttachmentConfig": { - "type": "object", - "properties": { - "image": { - "$ref": "#/components/schemas/ImageAttachmentConfig" - } - }, - "additionalProperties": false - }, - "Config": { - "type": "object", - "properties": { - "$schema": { - "type": "string" - }, - "shell": { - "type": "string" - }, - "logLevel": { - "$ref": "#/components/schemas/LogLevel" - }, - "server": { - "$ref": "#/components/schemas/ServerConfig" - }, - "command": { - "type": "object", - "additionalProperties": { - "type": "object", - "properties": { - "template": { - "type": "string" - }, - "description": { - "type": "string" - }, - "agent": { - "type": "string" - }, - "model": { - "type": "string" - }, - "variant": { - "type": "string" - }, - "subtask": { - "type": "boolean" - } - }, - "required": ["template"], - "additionalProperties": false - } - }, - "skills": { - "type": "object", - "properties": { - "paths": { - "type": "array", - "items": { - "type": "string" - } - }, - "urls": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "additionalProperties": false - }, - "references": { - "type": "object", - "additionalProperties": { - "anyOf": [ - { - "type": "string" - }, - { - "$ref": "#/components/schemas/ConfigV2ReferenceGit" - }, - { - "$ref": "#/components/schemas/ConfigV2ReferenceLocal" - } - ] - } - }, - "reference": { - "type": "object", - "additionalProperties": { - "anyOf": [ - { - "type": "string" - }, - { - "$ref": "#/components/schemas/ConfigV2ReferenceGit" - }, - { - "$ref": "#/components/schemas/ConfigV2ReferenceLocal" - } - ] - } - }, - "watcher": { - "type": "object", - "properties": { - "ignore": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "additionalProperties": false - }, - "snapshot": { - "type": "boolean" - }, - "plugin": { - "type": "array", - "items": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "prefixItems": [ - { - "type": "string" - }, - { - "type": "object" - } - ], - "maxItems": 2, - "minItems": 2 - } - ] - } - }, - "share": { - "type": "string", - "enum": ["manual", "auto", "disabled"] - }, - "autoshare": { - "type": "boolean" - }, - "autoupdate": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "string", - "enum": ["notify"] - } - ], - "description": "Automatically update to the latest version. Set to true to auto-update, false to disable, or 'notify' to show update notifications" - }, - "disabled_providers": { - "type": "array", - "items": { - "type": "string" - } - }, - "enabled_providers": { - "type": "array", - "items": { - "type": "string" - } - }, - "model": { - "type": "string" - }, - "small_model": { - "type": "string" - }, - "default_agent": { - "type": "string" - }, - "subagent_depth": { - "type": "integer", - "minimum": 0 - }, - "username": { - "type": "string" - }, - "mode": { - "type": "object", - "properties": { - "build": { - "$ref": "#/components/schemas/AgentConfig" - }, - "plan": { - "$ref": "#/components/schemas/AgentConfig" - } - }, - "additionalProperties": { - "$ref": "#/components/schemas/AgentConfig" - } - }, - "agent": { - "type": "object", - "properties": { - "plan": { - "$ref": "#/components/schemas/AgentConfig" - }, - "build": { - "$ref": "#/components/schemas/AgentConfig" - }, - "general": { - "$ref": "#/components/schemas/AgentConfig" - }, - "explore": { - "$ref": "#/components/schemas/AgentConfig" - }, - "title": { - "$ref": "#/components/schemas/AgentConfig" - }, - "summary": { - "$ref": "#/components/schemas/AgentConfig" - }, - "compaction": { - "$ref": "#/components/schemas/AgentConfig" - } - }, - "additionalProperties": { - "$ref": "#/components/schemas/AgentConfig" - } - }, - "provider": { - "type": "object", - "additionalProperties": { - "$ref": "#/components/schemas/ProviderConfig" - } - }, - "mcp": { - "type": "object", - "additionalProperties": { - "anyOf": [ - { - "$ref": "#/components/schemas/McpLocalConfig" - }, - { - "$ref": "#/components/schemas/McpRemoteConfig" - }, - { - "type": "object", - "properties": { - "enabled": { - "type": "boolean" - } - }, - "required": ["enabled"], - "additionalProperties": false - } - ] - } - }, - "formatter": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "object", - "additionalProperties": { - "type": "object", - "properties": { - "disabled": { - "type": "boolean" - }, - "command": { - "type": "array", - "items": { - "type": "string" - } - }, - "environment": { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "extensions": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "additionalProperties": false - } - } - ], - "description": "Enable or configure formatters. Omit or set to false to disable, true to enable built-ins, or an object to enable built-ins with overrides." - }, - "lsp": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "object", - "additionalProperties": { - "anyOf": [ - { - "type": "object", - "properties": { - "disabled": { - "type": "boolean", - "enum": [true] - } - }, - "required": ["disabled"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "command": { - "type": "array", - "items": { - "type": "string" - } - }, - "extensions": { - "type": "array", - "items": { - "type": "string" - } - }, - "disabled": { - "type": "boolean" - }, - "env": { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "initialization": { - "type": "object" - } - }, - "required": ["command"], - "additionalProperties": false - } - ] - } - } - ], - "description": "Enable or configure LSP servers. Omit or set to false to disable, true to enable built-ins, or an object to enable built-ins with overrides." - }, - "instructions": { - "type": "array", - "items": { - "type": "string" - } - }, - "layout": { - "$ref": "#/components/schemas/LayoutConfig" - }, - "permission": { - "$ref": "#/components/schemas/PermissionConfig" - }, - "tools": { - "type": "object", - "additionalProperties": { - "type": "boolean" - } - }, - "attachment": { - "$ref": "#/components/schemas/AttachmentConfig" - }, - "enterprise": { - "type": "object", - "properties": { - "url": { - "type": "string" - } - }, - "additionalProperties": false - }, - "tool_output": { - "type": "object", - "properties": { - "max_lines": { - "type": "integer", - "exclusiveMinimum": 0 - }, - "max_bytes": { - "type": "integer", - "exclusiveMinimum": 0 - } - }, - "additionalProperties": false - }, - "compaction": { - "type": "object", - "properties": { - "auto": { - "type": "boolean" - }, - "prune": { - "type": "boolean" - }, - "tail_turns": { - "type": "integer", - "minimum": 0 - }, - "preserve_recent_tokens": { - "type": "integer", - "minimum": 0 - }, - "reserved": { - "type": "integer", - "minimum": 0 - } - }, - "additionalProperties": false - }, - "experimental": { - "type": "object", - "properties": { - "disable_paste_summary": { - "type": "boolean" - }, - "batch_tool": { - "type": "boolean" - }, - "openTelemetry": { - "type": "boolean" - }, - "primary_tools": { - "type": "array", - "items": { - "type": "string" - } - }, - "continue_loop_on_deny": { - "type": "boolean" - }, - "mcp_timeout": { - "type": "integer", - "exclusiveMinimum": 0 - }, - "policies": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ConfigV2ExperimentalPolicy" - } - } - }, - "additionalProperties": false - } - }, - "additionalProperties": false - }, - "Model": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "providerID": { - "type": "string" - }, - "api": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "url": { - "type": "string" - }, - "npm": { - "type": "string" - } - }, - "required": ["id", "url", "npm"], - "additionalProperties": false - }, - "name": { - "type": "string" - }, - "family": { - "type": "string" - }, - "capabilities": { - "type": "object", - "properties": { - "temperature": { - "type": "boolean" - }, - "reasoning": { - "type": "boolean" - }, - "attachment": { - "type": "boolean" - }, - "toolcall": { - "type": "boolean" - }, - "input": { - "type": "object", - "properties": { - "text": { - "type": "boolean" - }, - "audio": { - "type": "boolean" - }, - "image": { - "type": "boolean" - }, - "video": { - "type": "boolean" - }, - "pdf": { - "type": "boolean" - } - }, - "required": ["text", "audio", "image", "video", "pdf"], - "additionalProperties": false - }, - "output": { - "type": "object", - "properties": { - "text": { - "type": "boolean" - }, - "audio": { - "type": "boolean" - }, - "image": { - "type": "boolean" - }, - "video": { - "type": "boolean" - }, - "pdf": { - "type": "boolean" - } - }, - "required": ["text", "audio", "image", "video", "pdf"], - "additionalProperties": false - }, - "interleaved": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "object", - "properties": { - "field": { - "type": "string", - "enum": ["reasoning", "reasoning_content", "reasoning_details"] - } - }, - "required": ["field"], - "additionalProperties": false - } - ] - } - }, - "required": ["temperature", "reasoning", "attachment", "toolcall", "input", "output", "interleaved"], - "additionalProperties": false - }, - "cost": { - "type": "object", - "properties": { - "input": { - "type": "number" - }, - "output": { - "type": "number" - }, - "cache": { - "type": "object", - "properties": { - "read": { - "type": "number" - }, - "write": { - "type": "number" - } - }, - "required": ["read", "write"], - "additionalProperties": false - }, - "tiers": { - "type": "array", - "items": { - "type": "object", - "properties": { - "input": { - "type": "number" - }, - "output": { - "type": "number" - }, - "cache": { - "type": "object", - "properties": { - "read": { - "type": "number" - }, - "write": { - "type": "number" - } - }, - "required": ["read", "write"], - "additionalProperties": false - }, - "tier": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["context"] - }, - "size": { - "type": "number" - } - }, - "required": ["type", "size"], - "additionalProperties": false - } - }, - "required": ["input", "output", "cache", "tier"], - "additionalProperties": false - } - }, - "experimentalOver200K": { - "type": "object", - "properties": { - "input": { - "type": "number" - }, - "output": { - "type": "number" - }, - "cache": { - "type": "object", - "properties": { - "read": { - "type": "number" - }, - "write": { - "type": "number" - } - }, - "required": ["read", "write"], - "additionalProperties": false - } - }, - "required": ["input", "output", "cache"], - "additionalProperties": false - } - }, - "required": ["input", "output", "cache"], - "additionalProperties": false - }, - "limit": { - "type": "object", - "properties": { - "context": { - "type": "number" - }, - "input": { - "type": "number" - }, - "output": { - "type": "number" - } - }, - "required": ["context", "output"], - "additionalProperties": false - }, - "status": { - "type": "string", - "enum": ["alpha", "beta", "deprecated", "active"] - }, - "options": { - "type": "object" - }, - "headers": { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "release_date": { - "type": "string" - }, - "variants": { - "type": "object", - "additionalProperties": { - "type": "object" - } - } - }, - "required": [ - "id", - "providerID", - "api", - "name", - "capabilities", - "cost", - "limit", - "status", - "options", - "headers", - "release_date" - ], - "additionalProperties": false - }, - "Provider": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "source": { - "type": "string", - "enum": ["env", "config", "custom", "api"] - }, - "env": { - "type": "array", - "items": { - "type": "string" - } - }, - "key": { - "type": "string" - }, - "options": { - "type": "object" - }, - "models": { - "type": "object", - "additionalProperties": { - "$ref": "#/components/schemas/Model" - } - } - }, - "required": ["id", "name", "source", "env", "options", "models"], - "additionalProperties": false - }, - "ExperimentalCapabilities": { - "type": "object", - "properties": { - "backgroundSubagents": { - "type": "boolean" - } - }, - "required": ["backgroundSubagents"], - "additionalProperties": false - }, - "ConsoleState": { - "type": "object", - "properties": { - "consoleManagedProviders": { - "type": "array", - "items": { - "type": "string" - } - }, - "activeOrgName": { - "type": "string" - }, - "switchableOrgCount": { - "type": "integer", - "minimum": 0 - } - }, - "required": ["consoleManagedProviders", "switchableOrgCount"], - "additionalProperties": false - }, - "effect_HttpApiError_InternalServerError": { - "type": "object", - "properties": { - "_tag": { - "type": "string", - "enum": ["InternalServerError"] - } - }, - "required": ["_tag"], - "additionalProperties": false - }, - "ToolListItem": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "description": { - "type": "string" - }, - "parameters": {} - }, - "required": ["id", "description", "parameters"], - "additionalProperties": false - }, - "ToolList": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ToolListItem" - } - }, - "ToolIDs": { - "type": "array", - "items": { - "type": "string" - } - }, - "WorktreeError": { - "type": "object", - "properties": { - "name": { - "type": "string", - "enum": [ - "WorktreeNotGitError", - "WorktreeNameGenerationFailedError", - "WorktreeCreateFailedError", - "WorktreeStartCommandFailedError", - "WorktreeRemoveFailedError", - "WorktreeResetFailedError", - "WorktreeListFailedError" - ] - }, - "data": { - "type": "object", - "properties": { - "message": { - "type": "string" - } - }, - "required": ["message"], - "additionalProperties": false - } - }, - "required": ["name", "data"], - "additionalProperties": false - }, - "WorktreeCreateInput": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "startCommand": { - "type": "string", - "description": "Additional startup script to run after the project's start command" - } - }, - "additionalProperties": false - }, - "Worktree": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "branch": { - "type": "string" - }, - "directory": { - "type": "string" - } - }, - "required": ["name", "directory"], - "additionalProperties": false - }, - "WorktreeRemoveInput": { - "type": "object", - "properties": { - "directory": { - "type": "string" - } - }, - "required": ["directory"], - "additionalProperties": false - }, - "WorktreeResetInput": { - "type": "object", - "properties": { - "directory": { - "type": "string" - } - }, - "required": ["directory"], - "additionalProperties": false - }, - "ProjectSummary": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "worktree": { - "type": "string" - } - }, - "required": ["id", "worktree"], - "additionalProperties": false - }, - "GlobalSession": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^ses" - }, - "slug": { - "type": "string" - }, - "projectID": { - "type": "string" - }, - "workspaceID": { - "type": "string", - "pattern": "^wrk" - }, - "directory": { - "type": "string" - }, - "path": { - "type": "string" - }, - "parentID": { - "type": "string", - "pattern": "^ses" - }, - "summary": { - "type": "object", - "properties": { - "additions": { - "type": "number" - }, - "deletions": { - "type": "number" - }, - "files": { - "type": "number" - }, - "diffs": { - "type": "array", - "items": { - "$ref": "#/components/schemas/SnapshotFileDiff" - } - } - }, - "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", - "minimum": 0 - }, - "updated": { - "type": "integer", - "minimum": 0 - }, - "compacting": { - "type": "integer", - "minimum": 0 - }, - "archived": { - "type": "number" - } - }, - "required": ["created", "updated"], - "additionalProperties": false - }, - "permission": { - "$ref": "#/components/schemas/PermissionRuleset" - }, - "revert": { - "type": "object", - "properties": { - "messageID": { - "type": "string", - "pattern": "^msg" - }, - "partID": { - "type": "string", - "pattern": "^prt" - }, - "snapshot": { - "type": "string" - }, - "diff": { - "type": "string" - } - }, - "required": ["messageID"], - "additionalProperties": false - }, - "project": { - "anyOf": [ - { - "$ref": "#/components/schemas/ProjectSummary" - }, - { - "type": "null" - } - ] - } - }, - "required": ["id", "slug", "projectID", "directory", "title", "version", "time", "project"], - "additionalProperties": false - }, - "McpResource": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "uri": { - "type": "string" - }, - "description": { - "type": "string" - }, - "mimeType": { - "type": "string" - }, - "client": { - "type": "string" - } - }, - "required": ["name", "uri", "client"], - "additionalProperties": false - }, - "Symbol": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "kind": { - "type": "integer", - "minimum": 0 - }, - "location": { - "type": "object", - "properties": { - "uri": { - "type": "string" - }, - "range": { - "$ref": "#/components/schemas/Range" - } - }, - "required": ["uri", "range"], - "additionalProperties": false - } - }, - "required": ["name", "kind", "location"], - "additionalProperties": false - }, - "FileNode": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "path": { - "type": "string" - }, - "absolute": { - "type": "string" - }, - "type": { - "type": "string", - "enum": ["file", "directory"] - }, - "ignored": { - "type": "boolean" - } - }, - "required": ["name", "path", "absolute", "type", "ignored"], - "additionalProperties": false - }, - "FileContent": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["text", "binary"] - }, - "content": { - "type": "string" - }, - "diff": { - "type": "string" - }, - "patch": { - "type": "object", - "properties": { - "oldFileName": { - "type": "string" - }, - "newFileName": { - "type": "string" - }, - "oldHeader": { - "type": "string" - }, - "newHeader": { - "type": "string" - }, - "hunks": { - "type": "array", - "items": { - "type": "object", - "properties": { - "oldStart": { - "type": "integer", - "minimum": 0 - }, - "oldLines": { - "type": "integer", - "minimum": 0 - }, - "newStart": { - "type": "integer", - "minimum": 0 - }, - "newLines": { - "type": "integer", - "minimum": 0 - }, - "lines": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": ["oldStart", "oldLines", "newStart", "newLines", "lines"], - "additionalProperties": false - } - }, - "index": { - "type": "string" - } - }, - "required": ["oldFileName", "newFileName", "hunks"], - "additionalProperties": false - }, - "encoding": { - "type": "string", - "enum": ["base64"] - }, - "mimeType": { - "type": "string" - } - }, - "required": ["type", "content"], - "additionalProperties": false - }, - "File": { - "type": "object", - "properties": { - "path": { - "type": "string" - }, - "added": { - "type": "integer", - "minimum": 0 - }, - "removed": { - "type": "integer", - "minimum": 0 - }, - "status": { - "type": "string", - "enum": ["added", "deleted", "modified"] - } - }, - "required": ["path", "added", "removed", "status"], - "additionalProperties": false - }, - "Path": { - "type": "object", - "properties": { - "home": { - "type": "string" - }, - "state": { - "type": "string" - }, - "config": { - "type": "string" - }, - "worktree": { - "type": "string" - }, - "directory": { - "type": "string" - } - }, - "required": ["home", "state", "config", "worktree", "directory"], - "additionalProperties": false - }, - "VcsInfo": { - "type": "object", - "properties": { - "branch": { - "type": "string" - }, - "default_branch": { - "type": "string" - } - }, - "additionalProperties": false - }, - "VcsFileStatus": { - "type": "object", - "properties": { - "file": { - "type": "string" - }, - "additions": { - "type": "number" - }, - "deletions": { - "type": "number" - }, - "status": { - "type": "string", - "enum": ["added", "deleted", "modified"] - } - }, - "required": ["file", "additions", "deletions", "status"], - "additionalProperties": false - }, - "VcsFileDiff": { - "type": "object", - "properties": { - "file": { - "type": "string" - }, - "patch": { - "type": "string" - }, - "additions": { - "type": "number" - }, - "deletions": { - "type": "number" - }, - "status": { - "type": "string", - "enum": ["added", "deleted", "modified"] - } - }, - "required": ["file", "additions", "deletions"], - "additionalProperties": false - }, - "VcsApplyError": { - "type": "object", - "properties": { - "name": { - "type": "string", - "enum": ["VcsApplyError"] - }, - "data": { - "type": "object", - "properties": { - "message": { - "type": "string" - }, - "reason": { - "type": "string", - "enum": ["non-git", "not-clean"] - } - }, - "required": ["message", "reason"], - "additionalProperties": false - } - }, - "required": ["name", "data"], - "additionalProperties": false - }, - "Command": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "agent": { - "type": "string" - }, - "model": { - "type": "string" - }, - "source": { - "type": "string", - "enum": ["command", "mcp", "skill"] - }, - "template": { - "type": "string" - }, - "subtask": { - "type": "boolean" - }, - "hints": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": ["name", "template", "hints"], - "additionalProperties": false - }, - "Agent": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "mode": { - "type": "string", - "enum": ["subagent", "primary", "all"] - }, - "native": { - "type": "boolean" - }, - "hidden": { - "type": "boolean" - }, - "topP": { - "type": "number" - }, - "temperature": { - "type": "number" - }, - "color": { - "type": "string" - }, - "permission": { - "$ref": "#/components/schemas/PermissionRuleset" - }, - "model": { - "type": "object", - "properties": { - "modelID": { - "type": "string" - }, - "providerID": { - "type": "string" - } - }, - "required": ["modelID", "providerID"], - "additionalProperties": false - }, - "variant": { - "type": "string" - }, - "prompt": { - "type": "string" - }, - "options": { - "type": "object" - }, - "steps": { - "type": "number" - } - }, - "required": ["name", "mode", "permission", "options"], - "additionalProperties": false - }, - "LSPStatus": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "root": { - "type": "string" - }, - "status": { - "type": "string", - "enum": ["connected", "error"] - } - }, - "required": ["id", "name", "root", "status"], - "additionalProperties": false - }, - "FormatterStatus": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "extensions": { - "type": "array", - "items": { - "type": "string" - } - }, - "enabled": { - "type": "boolean" - } - }, - "required": ["name", "extensions", "enabled"], - "additionalProperties": false - }, - "MCPStatusConnected": { - "type": "object", - "properties": { - "status": { - "type": "string", - "enum": ["connected"] - } - }, - "required": ["status"], - "additionalProperties": false - }, - "MCPStatusDisabled": { - "type": "object", - "properties": { - "status": { - "type": "string", - "enum": ["disabled"] - } - }, - "required": ["status"], - "additionalProperties": false - }, - "MCPStatusFailed": { - "type": "object", - "properties": { - "status": { - "type": "string", - "enum": ["failed"] - }, - "error": { - "type": "string" - } - }, - "required": ["status", "error"], - "additionalProperties": false - }, - "MCPStatusNeedsAuth": { - "type": "object", - "properties": { - "status": { - "type": "string", - "enum": ["needs_auth"] - } - }, - "required": ["status"], - "additionalProperties": false - }, - "MCPStatusNeedsClientRegistration": { - "type": "object", - "properties": { - "status": { - "type": "string", - "enum": ["needs_client_registration"] - }, - "error": { - "type": "string" - } - }, - "required": ["status", "error"], - "additionalProperties": false - }, - "MCPStatus": { - "anyOf": [ - { - "$ref": "#/components/schemas/MCPStatusConnected" - }, - { - "$ref": "#/components/schemas/MCPStatusDisabled" - }, - { - "$ref": "#/components/schemas/MCPStatusFailed" - }, - { - "$ref": "#/components/schemas/MCPStatusNeedsAuth" - }, - { - "$ref": "#/components/schemas/MCPStatusNeedsClientRegistration" - } - ] - }, - "McpUnsupportedOAuthError": { - "type": "object", - "properties": { - "error": { - "type": "string" - } - }, - "required": ["error"], - "additionalProperties": false - }, - "McpServerNotFoundError": { - "type": "object", - "properties": { - "_tag": { - "type": "string", - "enum": ["McpServerNotFoundError"] - }, - "name": { - "type": "string" - }, - "message": { - "type": "string" - } - }, - "required": ["_tag", "name", "message"], - "additionalProperties": false - }, - "Project": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "worktree": { - "type": "string" - }, - "vcs": { - "$ref": "#/components/schemas/ProjectVcs" - }, - "name": { - "type": "string" - }, - "icon": { - "$ref": "#/components/schemas/ProjectIcon" - }, - "commands": { - "$ref": "#/components/schemas/ProjectCommands" - }, - "time": { - "$ref": "#/components/schemas/ProjectTime" - }, - "sandboxes": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": ["id", "worktree", "time", "sandboxes"], - "additionalProperties": false - }, - "ProjectNotFoundError": { - "type": "object", - "properties": { - "_tag": { - "type": "string", - "enum": ["ProjectNotFoundError"] - }, - "projectID": { - "type": "string" - }, - "message": { - "type": "string" - } - }, - "required": ["_tag", "projectID", "message"], - "additionalProperties": false - }, - "PtyNotFoundError": { - "type": "object", - "properties": { - "_tag": { - "type": "string", - "enum": ["PtyNotFoundError"] - }, - "ptyID": { - "type": "string" - }, - "message": { - "type": "string" - } - }, - "required": ["_tag", "ptyID", "message"], - "additionalProperties": false - }, - "PtyForbiddenError": { - "type": "object", - "properties": { - "_tag": { - "type": "string", - "enum": ["PtyForbiddenError"] - }, - "message": { - "type": "string" - } - }, - "required": ["_tag", "message"], - "additionalProperties": false - }, - "QuestionRequest": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^que" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "questions": { - "type": "array", - "items": { - "$ref": "#/components/schemas/QuestionInfo" - }, - "description": "Questions to ask" - }, - "tool": { - "$ref": "#/components/schemas/QuestionTool" - } - }, - "required": ["id", "sessionID", "questions"], - "additionalProperties": false - }, - "QuestionNotFoundError": { - "type": "object", - "properties": { - "_tag": { - "type": "string", - "enum": ["QuestionNotFoundError"] - }, - "requestID": { - "type": "string" - }, - "message": { - "type": "string" - } - }, - "required": ["_tag", "requestID", "message"], - "additionalProperties": false - }, - "PermissionRequest": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^per" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "permission": { - "type": "string" - }, - "patterns": { - "type": "array", - "items": { - "type": "string" - } - }, - "metadata": { - "type": "object" - }, - "always": { - "type": "array", - "items": { - "type": "string" - } - }, - "tool": { - "type": "object", - "properties": { - "messageID": { - "type": "string" - }, - "callID": { - "type": "string" - } - }, - "required": ["messageID", "callID"], - "additionalProperties": false - } - }, - "required": ["id", "sessionID", "permission", "patterns", "metadata", "always"], - "additionalProperties": false - }, - "PermissionNotFoundError": { - "type": "object", - "properties": { - "_tag": { - "type": "string", - "enum": ["PermissionNotFoundError"] - }, - "requestID": { - "type": "string" - }, - "message": { - "type": "string" - } - }, - "required": ["_tag", "requestID", "message"], - "additionalProperties": false - }, - "ProviderAuthMethod": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["oauth", "api"] - }, - "label": { - "type": "string" - }, - "prompts": { - "type": "array", - "items": { - "anyOf": [ - { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["text"] - }, - "key": { - "type": "string" - }, - "message": { - "type": "string" - }, - "placeholder": { - "type": "string" - }, - "when": { - "type": "object", - "properties": { - "key": { - "type": "string" - }, - "op": { - "type": "string", - "enum": ["eq", "neq"] - }, - "value": { - "type": "string" - } - }, - "required": ["key", "op", "value"], - "additionalProperties": false - } - }, - "required": ["type", "key", "message"], - "additionalProperties": false - }, - { - "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": { - "type": "object", - "properties": { - "key": { - "type": "string" - }, - "op": { - "type": "string", - "enum": ["eq", "neq"] - }, - "value": { - "type": "string" - } - }, - "required": ["key", "op", "value"], - "additionalProperties": false - } - }, - "required": ["type", "key", "message", "options"], - "additionalProperties": false - } - ] - } - } - }, - "required": ["type", "label"], - "additionalProperties": false - }, - "ProviderAuthAuthorization": { - "type": "object", - "properties": { - "url": { - "type": "string" - }, - "method": { - "type": "string", - "enum": ["auto", "code"] - }, - "instructions": { - "type": "string" - } - }, - "required": ["url", "method", "instructions"], - "additionalProperties": false - }, - "ProviderAuthError1": { - "type": "object", - "properties": { - "name": { - "type": "string", - "enum": [ - "BadRequest", - "ProviderAuthOauthMissing", - "ProviderAuthOauthCodeMissing", - "ProviderAuthOauthCallbackFailed", - "ProviderAuthValidationFailed" - ] - }, - "data": { - "type": "object", - "properties": { - "providerID": { - "type": "string" - }, - "field": { - "type": "string" - }, - "message": { - "type": "string" - }, - "kind": { - "type": "string" - } - }, - "additionalProperties": false - } - }, - "required": ["name", "data"], - "additionalProperties": false - }, - "NotFoundError": { - "type": "object", - "required": ["name", "data"], - "properties": { - "name": { - "type": "string", - "enum": ["NotFoundError"] - }, - "data": { - "type": "object", - "required": ["message"], - "properties": { - "message": { - "type": "string" - } - } - } - } - }, - "TextPartInput": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^prt" - }, - "type": { - "type": "string", - "enum": ["text"] - }, - "text": { - "type": "string" - }, - "session.synthetic": { - "type": "boolean" - }, - "ignored": { - "type": "boolean" - }, - "time": { - "type": "object", - "properties": { - "start": { - "type": "integer", - "minimum": 0 - }, - "end": { - "type": "integer", - "minimum": 0 - } - }, - "required": ["start"], - "additionalProperties": false - }, - "metadata": { - "type": "object" - } - }, - "required": ["type", "text"], - "additionalProperties": false - }, - "FilePartInput": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^prt" - }, - "type": { - "type": "string", - "enum": ["file"] - }, - "mime": { - "type": "string" - }, - "filename": { - "type": "string" - }, - "url": { - "type": "string" - }, - "source": { - "$ref": "#/components/schemas/FilePartSource" - } - }, - "required": ["type", "mime", "url"], - "additionalProperties": false - }, - "AgentPartInput": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^prt" - }, - "type": { - "type": "string", - "enum": ["agent"] - }, - "name": { - "type": "string" - }, - "source": { - "type": "object", - "properties": { - "value": { - "type": "string" - }, - "start": { - "type": "integer", - "minimum": 0 - }, - "end": { - "type": "integer", - "minimum": 0 - } - }, - "required": ["value", "start", "end"], - "additionalProperties": false - } - }, - "required": ["type", "name"], - "additionalProperties": false - }, - "SubtaskPartInput": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^prt" - }, - "type": { - "type": "string", - "enum": ["subtask"] - }, - "prompt": { - "type": "string" - }, - "description": { - "type": "string" - }, - "agent": { - "type": "string" - }, - "model": { - "type": "object", - "properties": { - "providerID": { - "type": "string" - }, - "modelID": { - "type": "string" - } - }, - "required": ["providerID", "modelID"], - "additionalProperties": false - }, - "command": { - "type": "string" - } - }, - "required": ["type", "prompt", "description", "agent"], - "additionalProperties": false - }, - "SessionBusyError": { - "type": "object", - "properties": { - "_tag": { - "type": "string", - "enum": ["SessionBusyError"] - }, - "sessionID": { - "type": "string" - }, - "message": { - "type": "string" - } - }, - "required": ["_tag", "sessionID", "message"], - "additionalProperties": false - }, - "EventTuiPromptAppend": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["tui.prompt.append"] - }, - "properties": { - "type": "object", - "properties": { - "text": { - "type": "string" - } - }, - "required": ["text"], - "additionalProperties": false - } - }, - "required": ["type", "properties"], - "additionalProperties": false - }, - "EventTuiCommandExecute": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["tui.command.execute"] - }, - "properties": { - "type": "object", - "properties": { - "command": { - "anyOf": [ - { - "type": "string", - "enum": [ - "session.list", - "session.new", - "session.share", - "session.interrupt", - "session.compact", - "session.page.up", - "session.page.down", - "session.line.up", - "session.line.down", - "session.half.page.up", - "session.half.page.down", - "session.first", - "session.last", - "prompt.clear", - "prompt.submit", - "agent.cycle" - ] - }, - { - "type": "string" - } - ] - } - }, - "required": ["command"], - "additionalProperties": false - } - }, - "required": ["type", "properties"], - "additionalProperties": false - }, - "EventTuiToastShow": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["tui.toast.show"] - }, - "properties": { - "type": "object", - "properties": { - "title": { - "type": "string" - }, - "message": { - "type": "string" - }, - "variant": { - "type": "string", - "enum": ["info", "success", "warning", "error"] - }, - "duration": { - "type": "integer", - "exclusiveMinimum": 0 - } - }, - "required": ["message", "variant"], - "additionalProperties": false - } - }, - "required": ["type", "properties"], - "additionalProperties": false - }, - "EventTuiSessionSelect": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["tui.session.select"] - }, - "properties": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "pattern": "^ses", - "description": "Session ID to navigate to" - } - }, - "required": ["sessionID"], - "additionalProperties": false - } - }, - "required": ["type", "properties"], - "additionalProperties": false - }, - "Workspace": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^wrk" - }, - "type": { - "type": "string" - }, - "name": { - "type": "string" - }, - "branch": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "directory": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "extra": { - "anyOf": [ - {}, - { - "type": "null" - } - ] - }, - "projectID": { - "type": "string" - }, - "timeUsed": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "string", - "enum": ["NaN"] - }, - { - "type": "string", - "enum": ["Infinity"] - }, - { - "type": "string", - "enum": ["-Infinity"] - }, - { - "type": "string", - "enum": ["Infinity", "-Infinity", "NaN"] - } - ] - } - }, - "required": ["id", "type", "name", "projectID", "timeUsed"], - "additionalProperties": false - }, - "WorkspaceCreateError": { - "type": "object", - "properties": { - "name": { - "type": "string", - "enum": ["WorkspaceCreateError"] - }, - "data": { - "type": "object", - "properties": { - "message": { - "type": "string" - } - }, - "required": ["message"], - "additionalProperties": false - } - }, - "required": ["name", "data"], - "additionalProperties": false - }, - "WorkspaceWarpError": { - "type": "object", - "properties": { - "name": { - "type": "string", - "enum": ["WorkspaceWarpError"] - }, - "data": { - "type": "object", - "properties": { - "message": { - "type": "string" - } - }, - "required": ["message"], - "additionalProperties": false - } - }, - "required": ["name", "data"], - "additionalProperties": false - }, - "UnauthorizedError": { - "type": "object", - "properties": { - "_tag": { - "type": "string", - "enum": ["UnauthorizedError"] - }, - "message": { - "type": "string" - } - }, - "required": ["_tag", "message"], - "additionalProperties": false - }, - "SessionsResponse": { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/SessionV2Info" - } - }, - "cursor": { - "type": "object", - "properties": { - "previous": { - "type": "string" - }, - "next": { - "type": "string" - } - }, - "additionalProperties": false - } - }, - "required": ["data", "cursor"], - "additionalProperties": false - }, - "InvalidCursorError": { - "type": "object", - "properties": { - "_tag": { - "type": "string", - "enum": ["InvalidCursorError"] - }, - "message": { - "type": "string" - } - }, - "required": ["_tag", "message"], - "additionalProperties": false - }, - "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 - }, - "PromptInput": { - "type": "object", - "properties": { - "text": { - "type": "string" - }, - "files": { - "type": "array", - "items": { - "$ref": "#/components/schemas/PromptInputFileAttachment" - } - }, - "agents": { - "type": "array", - "items": { - "$ref": "#/components/schemas/PromptAgentAttachment" - } - } - }, - "required": ["text"], - "additionalProperties": false - }, - "ConflictError": { - "type": "object", - "properties": { - "_tag": { - "type": "string", - "enum": ["ConflictError"] - }, - "message": { - "type": "string" - }, - "resource": { - "type": "string" - } - }, - "required": ["_tag", "message"], - "additionalProperties": false - }, - "ServiceUnavailableError": { - "type": "object", - "properties": { - "_tag": { - "type": "string", - "enum": ["ServiceUnavailableError"] - }, - "message": { - "type": "string" - }, - "service": { - "type": "string" - } - }, - "required": ["_tag", "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 - }, - "UnknownError1": { - "type": "object", - "properties": { - "_tag": { - "type": "string", - "enum": ["UnknownError"] - }, - "message": { - "type": "string" - }, - "ref": { - "type": "string" - } - }, - "required": ["_tag", "message"], - "additionalProperties": false - }, - "SessionDurableEvent": { - "oneOf": [ - { - "$ref": "#/components/schemas/SessionNextAgentSwitched" - }, - { - "$ref": "#/components/schemas/SessionNextModelSwitched" - }, - { - "$ref": "#/components/schemas/SessionNextMoved" - }, - { - "$ref": "#/components/schemas/SessionNextPrompted" - }, - { - "$ref": "#/components/schemas/SessionNextPromptAdmitted" - }, - { - "$ref": "#/components/schemas/SessionNextContextUpdated" - }, - { - "$ref": "#/components/schemas/SessionNextSynthetic" - }, - { - "$ref": "#/components/schemas/SessionNextShellStarted" - }, - { - "$ref": "#/components/schemas/SessionNextShellEnded" - }, - { - "$ref": "#/components/schemas/SessionNextStepStarted" - }, - { - "$ref": "#/components/schemas/SessionNextStepEnded" - }, - { - "$ref": "#/components/schemas/SessionNextStepFailed" - }, - { - "$ref": "#/components/schemas/SessionNextTextStarted" - }, - { - "$ref": "#/components/schemas/SessionNextTextEnded" - }, - { - "$ref": "#/components/schemas/SessionNextToolInputStarted" - }, - { - "$ref": "#/components/schemas/SessionNextToolInputEnded" - }, - { - "$ref": "#/components/schemas/SessionNextToolCalled" - }, - { - "$ref": "#/components/schemas/SessionNextToolProgress" - }, - { - "$ref": "#/components/schemas/SessionNextToolSuccess" - }, - { - "$ref": "#/components/schemas/SessionNextToolFailed" - }, - { - "$ref": "#/components/schemas/SessionNextReasoningStarted" - }, - { - "$ref": "#/components/schemas/SessionNextReasoningEnded" - }, - { - "$ref": "#/components/schemas/SessionNextRetried" - }, - { - "$ref": "#/components/schemas/SessionNextCompactionStarted" - }, - { - "$ref": "#/components/schemas/SessionNextCompactionEnded" - }, - { - "$ref": "#/components/schemas/SessionNextRevertStaged" - }, - { - "$ref": "#/components/schemas/SessionNextRevertCleared" - }, - { - "$ref": "#/components/schemas/SessionNextRevertCommitted" - } - ] - }, - "SessionHistory": { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/SessionDurableEvent" - } - }, - "hasMore": { - "type": "boolean" - } - }, - "required": ["data", "hasMore"], - "additionalProperties": false - }, - "SessionDurableEventStream": { - "type": "string", - "contentSchema": { - "$ref": "#/components/schemas/SessionDurableEvent" - }, - "contentMediaType": "application/json" - }, - "SessionMessagesResponse": { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/SessionMessage" - } - }, - "cursor": { - "type": "object", - "properties": { - "previous": { - "type": "string" - }, - "next": { - "type": "string" - } - }, - "additionalProperties": false - } - }, - "required": ["data", "cursor"], - "additionalProperties": false - }, - "ProviderNotFoundError": { - "type": "object", - "properties": { - "_tag": { - "type": "string", - "enum": ["ProviderNotFoundError"] - }, - "providerID": { - "type": "string" - }, - "message": { - "type": "string" - } - }, - "required": ["_tag", "providerID", "message"], - "additionalProperties": false - }, - "OutputFormat1": { - "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": { - "type": "integer", - "minimum": 0 - } - }, - "required": ["type", "schema"], - "additionalProperties": false - } - ] - }, - "session.status": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["session.status"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer" - }, - "version": { - "type": "integer" - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/LocationRef" - }, - "data": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "status": { - "$ref": "#/components/schemas/SessionStatus" - } - }, - "required": ["sessionID", "status"], - "additionalProperties": false - } - }, - "required": ["id", "type", "data"], - "additionalProperties": false - }, - "question.replied": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["question.replied"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer" - }, - "version": { - "type": "integer" - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/LocationRef" - }, - "data": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "requestID": { - "type": "string", - "pattern": "^que" - }, - "answers": { - "type": "array", - "items": { - "$ref": "#/components/schemas/QuestionAnswer" - } - } - }, - "required": ["sessionID", "requestID", "answers"], - "additionalProperties": false - } - }, - "required": ["id", "type", "data"], - "additionalProperties": false - }, - "question.rejected": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["question.rejected"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer" - }, - "version": { - "type": "integer" - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/LocationRef" - }, - "data": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "requestID": { - "type": "string", - "pattern": "^que" - } - }, - "required": ["sessionID", "requestID"], - "additionalProperties": false - } - }, - "required": ["id", "type", "data"], - "additionalProperties": false - }, - "V2Event": { - "anyOf": [ - { - "$ref": "#/components/schemas/Models-devRefreshed" - }, - { - "$ref": "#/components/schemas/IntegrationUpdated" - }, - { - "$ref": "#/components/schemas/IntegrationConnectionUpdated" - }, - { - "$ref": "#/components/schemas/CatalogUpdated" - }, - { - "$ref": "#/components/schemas/SessionCreated" - }, - { - "$ref": "#/components/schemas/SessionUpdated" - }, - { - "$ref": "#/components/schemas/SessionDeleted" - }, - { - "$ref": "#/components/schemas/MessageUpdated" - }, - { - "$ref": "#/components/schemas/MessageRemoved" - }, - { - "$ref": "#/components/schemas/MessagePartUpdated" - }, - { - "$ref": "#/components/schemas/MessagePartRemoved" - }, - { - "$ref": "#/components/schemas/SessionNextAgentSwitched" - }, - { - "$ref": "#/components/schemas/SessionNextModelSwitched" - }, - { - "$ref": "#/components/schemas/SessionNextMoved" - }, - { - "$ref": "#/components/schemas/SessionNextPrompted" - }, - { - "$ref": "#/components/schemas/SessionNextPromptAdmitted" - }, - { - "$ref": "#/components/schemas/SessionNextContextUpdated" - }, - { - "$ref": "#/components/schemas/SessionNextSynthetic" - }, - { - "$ref": "#/components/schemas/SessionNextShellStarted" - }, - { - "$ref": "#/components/schemas/SessionNextShellEnded" - }, - { - "$ref": "#/components/schemas/SessionNextStepStarted" - }, - { - "$ref": "#/components/schemas/SessionNextStepEnded" - }, - { - "$ref": "#/components/schemas/SessionNextStepFailed" - }, - { - "$ref": "#/components/schemas/SessionNextTextStarted" - }, - { - "$ref": "#/components/schemas/SessionNextTextDelta" - }, - { - "$ref": "#/components/schemas/SessionNextTextEnded" - }, - { - "$ref": "#/components/schemas/SessionNextReasoningStarted" - }, - { - "$ref": "#/components/schemas/SessionNextReasoningDelta" - }, - { - "$ref": "#/components/schemas/SessionNextReasoningEnded" - }, - { - "$ref": "#/components/schemas/SessionNextToolInputStarted" - }, - { - "$ref": "#/components/schemas/SessionNextToolInputDelta" - }, - { - "$ref": "#/components/schemas/SessionNextToolInputEnded" - }, - { - "$ref": "#/components/schemas/SessionNextToolCalled" - }, - { - "$ref": "#/components/schemas/SessionNextToolProgress" - }, - { - "$ref": "#/components/schemas/SessionNextToolSuccess" - }, - { - "$ref": "#/components/schemas/SessionNextToolFailed" - }, - { - "$ref": "#/components/schemas/SessionNextRetried" - }, - { - "$ref": "#/components/schemas/SessionNextCompactionStarted" - }, - { - "$ref": "#/components/schemas/SessionNextCompactionDelta" - }, - { - "$ref": "#/components/schemas/SessionNextCompactionEnded" - }, - { - "$ref": "#/components/schemas/SessionNextRevertStaged" - }, - { - "$ref": "#/components/schemas/SessionNextRevertCleared" - }, - { - "$ref": "#/components/schemas/SessionNextRevertCommitted" - }, - { - "$ref": "#/components/schemas/MessagePartDelta" - }, - { - "$ref": "#/components/schemas/SessionDiff" - }, - { - "$ref": "#/components/schemas/SessionError" - }, - { - "$ref": "#/components/schemas/InstallationUpdated" - }, - { - "$ref": "#/components/schemas/InstallationUpdate-available" - }, - { - "$ref": "#/components/schemas/FileEdited" - }, - { - "$ref": "#/components/schemas/ReferenceUpdated" - }, - { - "$ref": "#/components/schemas/PermissionV2Asked" - }, - { - "$ref": "#/components/schemas/PermissionV2Replied" - }, - { - "$ref": "#/components/schemas/PluginAdded" - }, - { - "$ref": "#/components/schemas/ProjectDirectoriesUpdated" - }, - { - "$ref": "#/components/schemas/FileWatcherUpdated" - }, - { - "$ref": "#/components/schemas/PtyCreated" - }, - { - "$ref": "#/components/schemas/PtyUpdated" - }, - { - "$ref": "#/components/schemas/PtyExited" - }, - { - "$ref": "#/components/schemas/PtyDeleted" - }, - { - "$ref": "#/components/schemas/QuestionV2Asked" - }, - { - "$ref": "#/components/schemas/QuestionV2Replied" - }, - { - "$ref": "#/components/schemas/QuestionV2Rejected" - }, - { - "$ref": "#/components/schemas/LspUpdated" - }, - { - "$ref": "#/components/schemas/PermissionAsked" - }, - { - "$ref": "#/components/schemas/PermissionReplied" - }, - { - "$ref": "#/components/schemas/TuiPromptAppend" - }, - { - "$ref": "#/components/schemas/TuiCommandExecute" - }, - { - "$ref": "#/components/schemas/TuiToastShow" - }, - { - "$ref": "#/components/schemas/TuiSessionSelect" - }, - { - "$ref": "#/components/schemas/McpToolsChanged" - }, - { - "$ref": "#/components/schemas/McpBrowserOpenFailed" - }, - { - "$ref": "#/components/schemas/CommandExecuted" - }, - { - "$ref": "#/components/schemas/ProjectUpdated" - }, - { - "$ref": "#/components/schemas/session.status" - }, - { - "$ref": "#/components/schemas/SessionIdle" - }, - { - "$ref": "#/components/schemas/QuestionAsked" - }, - { - "$ref": "#/components/schemas/question.replied" - }, - { - "$ref": "#/components/schemas/question.rejected" - }, - { - "$ref": "#/components/schemas/SessionCompacted" - }, - { - "$ref": "#/components/schemas/VcsBranchUpdated" - }, - { - "$ref": "#/components/schemas/WorkspaceReady" - }, - { - "$ref": "#/components/schemas/WorkspaceFailed" - }, - { - "$ref": "#/components/schemas/WorkspaceStatus" - }, - { - "$ref": "#/components/schemas/WorktreeReady" - }, - { - "$ref": "#/components/schemas/WorktreeFailed" - }, - { - "$ref": "#/components/schemas/ServerConnected" - }, - { - "$ref": "#/components/schemas/GlobalDisposed" - } - ] - }, - "V2EventStream": { - "type": "string", - "contentSchema": { - "$ref": "#/components/schemas/V2Event" - }, - "contentMediaType": "application/json" - }, - "ForbiddenError": { - "type": "object", - "properties": { - "_tag": { - "type": "string", - "enum": ["ForbiddenError"] - }, - "message": { - "type": "string" - } - }, - "required": ["_tag", "message"], - "additionalProperties": false - }, - "ProjectCopyError": { - "type": "object", - "properties": { - "name": { - "type": "string", - "enum": ["ProjectCopyError"] - }, - "data": { - "type": "object", - "properties": { - "message": { - "type": "string" - }, - "forceRequired": { - "type": "boolean" - } - }, - "required": ["message"], - "additionalProperties": false - } - }, - "required": ["name", "data"], - "additionalProperties": false - }, - "effect_HttpApiError_Forbidden": { - "type": "object", - "properties": { - "_tag": { - "type": "string", - "enum": ["Forbidden"] - } - }, - "required": ["_tag"], - "additionalProperties": false - }, - "Event.tui.prompt.append": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["tui.prompt.append"] - }, - "properties": { - "type": "object", - "properties": { - "text": { - "type": "string" - } - }, - "required": ["text"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - "Event.tui.command.execute": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["tui.command.execute"] - }, - "properties": { - "type": "object", - "properties": { - "command": { - "anyOf": [ - { - "type": "string", - "enum": [ - "session.list", - "session.new", - "session.share", - "session.interrupt", - "session.compact", - "session.page.up", - "session.page.down", - "session.line.up", - "session.line.down", - "session.half.page.up", - "session.half.page.down", - "session.first", - "session.last", - "prompt.clear", - "prompt.submit", - "agent.cycle" - ] - }, - { - "type": "string" - } - ] - } - }, - "required": ["command"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - "Event.tui.toast.show": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["tui.toast.show"] - }, - "properties": { - "type": "object", - "properties": { - "title": { - "type": "string" - }, - "message": { - "type": "string" - }, - "variant": { - "type": "string", - "enum": ["info", "success", "warning", "error"] - }, - "duration": { - "type": "integer", - "exclusiveMinimum": 0 - } - }, - "required": ["message", "variant"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - "Event.tui.session.select": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["tui.session.select"] - }, - "properties": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "pattern": "^ses", - "description": "Session ID to navigate to" - } - }, - "required": ["sessionID"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - "CredentialValue": { - "anyOf": [ - { - "$ref": "#/components/schemas/CredentialOAuth" - }, - { - "$ref": "#/components/schemas/CredentialKey" - } - ] - }, - "IntegrationInputs": { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "IntegrationMethod": { - "anyOf": [ - { - "$ref": "#/components/schemas/IntegrationOAuthMethod" - }, - { - "$ref": "#/components/schemas/IntegrationKeyMethod" - }, - { - "$ref": "#/components/schemas/IntegrationEnvMethod" - } - ] - }, - "IntegrationRef": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "name": { - "type": "string" - } - }, - "required": ["id", "name"], - "additionalProperties": false - }, - "SkillV2Source": { - "anyOf": [ - { - "$ref": "#/components/schemas/SkillV2DirectorySource" - }, - { - "$ref": "#/components/schemas/SkillV2UrlSource" - }, - { - "$ref": "#/components/schemas/SkillV2EmbeddedSource" - } - ] - }, - "MoveSessionDestination": { - "type": "object", - "properties": { - "directory": { - "type": "string" - } - }, - "required": ["directory"], - "additionalProperties": false - }, - "ModelRef": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "providerID": { - "type": "string" - }, - "variant": { - "type": "string" - } - }, - "required": ["id", "providerID"], - "additionalProperties": false - }, - "LocationRef": { - "type": "object", - "properties": { - "directory": { - "type": "string" - }, - "workspaceID": { - "type": "string", - "pattern": "^wrk" - } - }, - "required": ["directory"], - "additionalProperties": false - }, - "PromptSource": { - "type": "object", - "properties": { - "start": { - "type": "number" - }, - "end": { - "type": "number" - }, - "text": { - "type": "string" - } - }, - "required": ["start", "end", "text"], - "additionalProperties": false - }, - "PromptFileAttachment": { - "type": "object", - "properties": { - "uri": { - "type": "string" - }, - "mime": { - "type": "string" - }, - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "source": { - "$ref": "#/components/schemas/PromptSource" - } - }, - "required": ["uri", "mime"], - "additionalProperties": false - }, - "PromptAgentAttachment": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "source": { - "$ref": "#/components/schemas/PromptSource" - } - }, - "required": ["name"], - "additionalProperties": false - }, - "SessionErrorUnknown": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["unknown"] - }, - "message": { - "type": "string" - } - }, - "required": ["type", "message"], - "additionalProperties": false - }, - "LLMProviderMetadata": { - "type": "object", - "additionalProperties": { - "type": "object" - } - }, - "ToolTextContent": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["text"] - }, - "text": { - "type": "string" - } - }, - "required": ["type", "text"], - "additionalProperties": false - }, - "ToolFileContent": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["file"] - }, - "uri": { - "type": "string" - }, - "mime": { - "type": "string" - }, - "name": { - "type": "string" - } - }, - "required": ["type", "uri", "mime"], - "additionalProperties": false - }, - "LLMToolContent": { - "anyOf": [ - { - "$ref": "#/components/schemas/ToolTextContent" - }, - { - "$ref": "#/components/schemas/ToolFileContent" - } - ] - }, - "SessionNextRetry_error": { - "type": "object", - "properties": { - "message": { - "type": "string" - }, - "statusCode": { - "type": "number" - }, - "isRetryable": { - "type": "boolean" - }, - "responseHeaders": { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "responseBody": { - "type": "string" - }, - "metadata": { - "type": "object", - "additionalProperties": { - "type": "string" - } - } - }, - "required": ["message", "isRetryable"], - "additionalProperties": false - }, - "FileDiff": { - "type": "object", - "properties": { - "path": { - "type": "string" - }, - "status": { - "type": "string", - "enum": ["added", "modified", "deleted"] - }, - "additions": { - "type": "integer", - "minimum": 0 - }, - "deletions": { - "type": "integer", - "minimum": 0 - }, - "patch": { - "type": "string" - } - }, - "required": ["path", "status", "additions", "deletions", "patch"], - "additionalProperties": false - }, - "RevertState": { - "type": "object", - "properties": { - "messageID": { - "type": "string", - "pattern": "^msg_" - }, - "partID": { - "type": "string" - }, - "snapshot": { - "type": "string" - }, - "diff": { - "type": "string" - }, - "files": { - "type": "array", - "items": { - "$ref": "#/components/schemas/FileDiff" - } - } - }, - "required": ["messageID"], - "additionalProperties": false - }, - "PermissionV2Source": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["tool"] - }, - "messageID": { - "type": "string" - }, - "callID": { - "type": "string" - } - }, - "required": ["type", "messageID", "callID"], - "additionalProperties": false - }, - "PermissionV2Reply": { - "type": "string", - "enum": ["once", "always", "reject"] - }, - "QuestionV2Option": { - "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 - }, - "QuestionV2Info": { - "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/QuestionV2Option" - }, - "description": "Available choices" - }, - "multiple": { - "type": "boolean" - }, - "custom": { - "type": "boolean" - } - }, - "required": ["question", "header", "options"], - "additionalProperties": false - }, - "QuestionV2Tool": { - "type": "object", - "properties": { - "messageID": { - "type": "string" - }, - "callID": { - "type": "string" - } - }, - "required": ["messageID", "callID"], - "additionalProperties": false - }, - "QuestionV2Answer": { - "type": "array", - "items": { - "type": "string" - } - }, - "ProjectVcs": { - "type": "string", - "enum": ["git"] - }, - "ProjectIcon": { - "type": "object", - "properties": { - "url": { - "type": "string" - }, - "override": { - "type": "string" - }, - "color": { - "type": "string" - } - }, - "additionalProperties": false - }, - "ProjectCommands": { - "type": "object", - "properties": { - "start": { - "type": "string", - "description": "Startup script to run when creating a new workspace (worktree)" - } - }, - "additionalProperties": false - }, - "ProjectTime": { - "type": "object", - "properties": { - "created": { - "type": "integer", - "minimum": 0 - }, - "updated": { - "type": "integer", - "minimum": 0 - }, - "initialized": { - "type": "integer", - "minimum": 0 - } - }, - "required": ["created", "updated"], - "additionalProperties": false - }, - "EventServerInstanceDisposed": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "type": { - "type": "string", - "enum": ["server.instance.disposed"] - }, - "properties": { - "type": "object", - "properties": { - "directory": { - "type": "string" - } - }, - "required": ["directory"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - "SyncEventSessionCreated": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["sync"] - }, - "id": { - "type": "string", - "pattern": "^evt_" - }, - "syncEvent": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["session.created.1"] - }, - "id": { - "type": "string", - "pattern": "^evt_" - }, - "seq": { - "type": "number" - }, - "aggregateID": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "info": { - "$ref": "#/components/schemas/Session" - } - }, - "required": ["sessionID", "info"], - "additionalProperties": false - } - }, - "required": ["type", "id", "seq", "aggregateID", "data"], - "additionalProperties": false - } - }, - "required": ["type", "id", "syncEvent"], - "additionalProperties": false - }, - "SyncEventSessionUpdated": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["sync"] - }, - "id": { - "type": "string", - "pattern": "^evt_" - }, - "syncEvent": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["session.updated.1"] - }, - "id": { - "type": "string", - "pattern": "^evt_" - }, - "seq": { - "type": "number" - }, - "aggregateID": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "info": { - "$ref": "#/components/schemas/Session" - } - }, - "required": ["sessionID", "info"], - "additionalProperties": false - } - }, - "required": ["type", "id", "seq", "aggregateID", "data"], - "additionalProperties": false - } - }, - "required": ["type", "id", "syncEvent"], - "additionalProperties": false - }, - "SyncEventSessionDeleted": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["sync"] - }, - "id": { - "type": "string", - "pattern": "^evt_" - }, - "syncEvent": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["session.deleted.1"] - }, - "id": { - "type": "string", - "pattern": "^evt_" - }, - "seq": { - "type": "number" - }, - "aggregateID": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "info": { - "$ref": "#/components/schemas/Session" - } - }, - "required": ["sessionID", "info"], - "additionalProperties": false - } - }, - "required": ["type", "id", "seq", "aggregateID", "data"], - "additionalProperties": false - } - }, - "required": ["type", "id", "syncEvent"], - "additionalProperties": false - }, - "SyncEventMessageUpdated": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["sync"] - }, - "id": { - "type": "string", - "pattern": "^evt_" - }, - "syncEvent": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["message.updated.1"] - }, - "id": { - "type": "string", - "pattern": "^evt_" - }, - "seq": { - "type": "number" - }, - "aggregateID": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "info": { - "$ref": "#/components/schemas/Message" - } - }, - "required": ["sessionID", "info"], - "additionalProperties": false - } - }, - "required": ["type", "id", "seq", "aggregateID", "data"], - "additionalProperties": false - } - }, - "required": ["type", "id", "syncEvent"], - "additionalProperties": false - }, - "SyncEventMessageRemoved": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["sync"] - }, - "id": { - "type": "string", - "pattern": "^evt_" - }, - "syncEvent": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["message.removed.1"] - }, - "id": { - "type": "string", - "pattern": "^evt_" - }, - "seq": { - "type": "number" - }, - "aggregateID": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "messageID": { - "type": "string", - "pattern": "^msg" - } - }, - "required": ["sessionID", "messageID"], - "additionalProperties": false - } - }, - "required": ["type", "id", "seq", "aggregateID", "data"], - "additionalProperties": false - } - }, - "required": ["type", "id", "syncEvent"], - "additionalProperties": false - }, - "SyncEventMessagePartUpdated": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["sync"] - }, - "id": { - "type": "string", - "pattern": "^evt_" - }, - "syncEvent": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["message.part.updated.1"] - }, - "id": { - "type": "string", - "pattern": "^evt_" - }, - "seq": { - "type": "number" - }, - "aggregateID": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "part": { - "$ref": "#/components/schemas/Part" - }, - "time": { - "type": "number" - } - }, - "required": ["sessionID", "part", "time"], - "additionalProperties": false - } - }, - "required": ["type", "id", "seq", "aggregateID", "data"], - "additionalProperties": false - } - }, - "required": ["type", "id", "syncEvent"], - "additionalProperties": false - }, - "SyncEventMessagePartRemoved": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["sync"] - }, - "id": { - "type": "string", - "pattern": "^evt_" - }, - "syncEvent": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["message.part.removed.1"] - }, - "id": { - "type": "string", - "pattern": "^evt_" - }, - "seq": { - "type": "number" - }, - "aggregateID": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "messageID": { - "type": "string", - "pattern": "^msg" - }, - "partID": { - "type": "string", - "pattern": "^prt" - } - }, - "required": ["sessionID", "messageID", "partID"], - "additionalProperties": false - } - }, - "required": ["type", "id", "seq", "aggregateID", "data"], - "additionalProperties": false - } - }, - "required": ["type", "id", "syncEvent"], - "additionalProperties": false - }, - "SyncEventSessionNextAgentSwitched": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["sync"] - }, - "id": { - "type": "string", - "pattern": "^evt_" - }, - "syncEvent": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["session.next.agent.switched.1"] - }, - "id": { - "type": "string", - "pattern": "^evt_" - }, - "seq": { - "type": "number" - }, - "aggregateID": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "messageID": { - "type": "string", - "pattern": "^msg_" - }, - "agent": { - "type": "string" - } - }, - "required": ["timestamp", "sessionID", "messageID", "agent"], - "additionalProperties": false - } - }, - "required": ["type", "id", "seq", "aggregateID", "data"], - "additionalProperties": false - } - }, - "required": ["type", "id", "syncEvent"], - "additionalProperties": false - }, - "SyncEventSessionNextModelSwitched": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["sync"] - }, - "id": { - "type": "string", - "pattern": "^evt_" - }, - "syncEvent": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["session.next.model.switched.1"] - }, - "id": { - "type": "string", - "pattern": "^evt_" - }, - "seq": { - "type": "number" - }, - "aggregateID": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "messageID": { - "type": "string", - "pattern": "^msg_" - }, - "model": { - "$ref": "#/components/schemas/ModelRef" - } - }, - "required": ["timestamp", "sessionID", "messageID", "model"], - "additionalProperties": false - } - }, - "required": ["type", "id", "seq", "aggregateID", "data"], - "additionalProperties": false - } - }, - "required": ["type", "id", "syncEvent"], - "additionalProperties": false - }, - "SyncEventSessionNextMoved": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["sync"] - }, - "id": { - "type": "string", - "pattern": "^evt_" - }, - "syncEvent": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["session.next.moved.1"] - }, - "id": { - "type": "string", - "pattern": "^evt_" - }, - "seq": { - "type": "number" - }, - "aggregateID": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "location": { - "$ref": "#/components/schemas/LocationRef" - }, - "subdirectory": { - "type": "string" - } - }, - "required": ["timestamp", "sessionID", "location"], - "additionalProperties": false - } - }, - "required": ["type", "id", "seq", "aggregateID", "data"], - "additionalProperties": false - } - }, - "required": ["type", "id", "syncEvent"], - "additionalProperties": false - }, - "SyncEventSessionNextPrompted": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["sync"] - }, - "id": { - "type": "string", - "pattern": "^evt_" - }, - "syncEvent": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["session.next.prompted.1"] - }, - "id": { - "type": "string", - "pattern": "^evt_" - }, - "seq": { - "type": "number" - }, - "aggregateID": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "messageID": { - "type": "string", - "pattern": "^msg_" - }, - "prompt": { - "$ref": "#/components/schemas/Prompt" - }, - "delivery": { - "type": "string", - "enum": ["steer", "queue"] - } - }, - "required": ["timestamp", "sessionID", "messageID", "prompt", "delivery"], - "additionalProperties": false - } - }, - "required": ["type", "id", "seq", "aggregateID", "data"], - "additionalProperties": false - } - }, - "required": ["type", "id", "syncEvent"], - "additionalProperties": false - }, - "SyncEventSessionNextPromptAdmitted": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["sync"] - }, - "id": { - "type": "string", - "pattern": "^evt_" - }, - "syncEvent": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["session.next.prompt.admitted.1"] - }, - "id": { - "type": "string", - "pattern": "^evt_" - }, - "seq": { - "type": "number" - }, - "aggregateID": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "messageID": { - "type": "string", - "pattern": "^msg_" - }, - "prompt": { - "$ref": "#/components/schemas/Prompt" - }, - "delivery": { - "type": "string", - "enum": ["steer", "queue"] - } - }, - "required": ["timestamp", "sessionID", "messageID", "prompt", "delivery"], - "additionalProperties": false - } - }, - "required": ["type", "id", "seq", "aggregateID", "data"], - "additionalProperties": false - } - }, - "required": ["type", "id", "syncEvent"], - "additionalProperties": false - }, - "SyncEventSessionNextContextUpdated": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["sync"] - }, - "id": { - "type": "string", - "pattern": "^evt_" - }, - "syncEvent": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["session.next.context.updated.1"] - }, - "id": { - "type": "string", - "pattern": "^evt_" - }, - "seq": { - "type": "number" - }, - "aggregateID": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "messageID": { - "type": "string", - "pattern": "^msg_" - }, - "text": { - "type": "string" - } - }, - "required": ["timestamp", "sessionID", "messageID", "text"], - "additionalProperties": false - } - }, - "required": ["type", "id", "seq", "aggregateID", "data"], - "additionalProperties": false - } - }, - "required": ["type", "id", "syncEvent"], - "additionalProperties": false - }, - "SyncEventSessionNextSynthetic": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["sync"] - }, - "id": { - "type": "string", - "pattern": "^evt_" - }, - "syncEvent": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["session.next.synthetic.1"] - }, - "id": { - "type": "string", - "pattern": "^evt_" - }, - "seq": { - "type": "number" - }, - "aggregateID": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "messageID": { - "type": "string", - "pattern": "^msg_" - }, - "text": { - "type": "string" - } - }, - "required": ["timestamp", "sessionID", "messageID", "text"], - "additionalProperties": false - } - }, - "required": ["type", "id", "seq", "aggregateID", "data"], - "additionalProperties": false - } - }, - "required": ["type", "id", "syncEvent"], - "additionalProperties": false - }, - "SyncEventSessionNextShellStarted": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["sync"] - }, - "id": { - "type": "string", - "pattern": "^evt_" - }, - "syncEvent": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["session.next.shell.started.1"] - }, - "id": { - "type": "string", - "pattern": "^evt_" - }, - "seq": { - "type": "number" - }, - "aggregateID": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "messageID": { - "type": "string", - "pattern": "^msg_" - }, - "callID": { - "type": "string" - }, - "command": { - "type": "string" - } - }, - "required": ["timestamp", "sessionID", "messageID", "callID", "command"], - "additionalProperties": false - } - }, - "required": ["type", "id", "seq", "aggregateID", "data"], - "additionalProperties": false - } - }, - "required": ["type", "id", "syncEvent"], - "additionalProperties": false - }, - "SyncEventSessionNextShellEnded": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["sync"] - }, - "id": { - "type": "string", - "pattern": "^evt_" - }, - "syncEvent": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["session.next.shell.ended.1"] - }, - "id": { - "type": "string", - "pattern": "^evt_" - }, - "seq": { - "type": "number" - }, - "aggregateID": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "callID": { - "type": "string" - }, - "output": { - "type": "string" - } - }, - "required": ["timestamp", "sessionID", "callID", "output"], - "additionalProperties": false - } - }, - "required": ["type", "id", "seq", "aggregateID", "data"], - "additionalProperties": false - } - }, - "required": ["type", "id", "syncEvent"], - "additionalProperties": false - }, - "SyncEventSessionNextStepStarted": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["sync"] - }, - "id": { - "type": "string", - "pattern": "^evt_" - }, - "syncEvent": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["session.next.step.started.1"] - }, - "id": { - "type": "string", - "pattern": "^evt_" - }, - "seq": { - "type": "number" - }, - "aggregateID": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "assistantMessageID": { - "type": "string", - "pattern": "^msg_" - }, - "agent": { - "type": "string" - }, - "model": { - "$ref": "#/components/schemas/ModelRef" - }, - "snapshot": { - "type": "string" - } - }, - "required": ["timestamp", "sessionID", "assistantMessageID", "agent", "model"], - "additionalProperties": false - } - }, - "required": ["type", "id", "seq", "aggregateID", "data"], - "additionalProperties": false - } - }, - "required": ["type", "id", "syncEvent"], - "additionalProperties": false - }, - "SyncEventSessionNextStepEnded": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["sync"] - }, - "id": { - "type": "string", - "pattern": "^evt_" - }, - "syncEvent": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["session.next.step.ended.2"] - }, - "id": { - "type": "string", - "pattern": "^evt_" - }, - "seq": { - "type": "number" - }, - "aggregateID": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "assistantMessageID": { - "type": "string", - "pattern": "^msg_" - }, - "finish": { - "type": "string" - }, - "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 - }, - "snapshot": { - "type": "string" - }, - "files": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": ["timestamp", "sessionID", "assistantMessageID", "finish", "cost", "tokens"], - "additionalProperties": false - } - }, - "required": ["type", "id", "seq", "aggregateID", "data"], - "additionalProperties": false - } - }, - "required": ["type", "id", "syncEvent"], - "additionalProperties": false - }, - "SyncEventSessionNextStepFailed": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["sync"] - }, - "id": { - "type": "string", - "pattern": "^evt_" - }, - "syncEvent": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["session.next.step.failed.2"] - }, - "id": { - "type": "string", - "pattern": "^evt_" - }, - "seq": { - "type": "number" - }, - "aggregateID": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "assistantMessageID": { - "type": "string", - "pattern": "^msg_" - }, - "error": { - "$ref": "#/components/schemas/SessionErrorUnknown" - } - }, - "required": ["timestamp", "sessionID", "assistantMessageID", "error"], - "additionalProperties": false - } - }, - "required": ["type", "id", "seq", "aggregateID", "data"], - "additionalProperties": false - } - }, - "required": ["type", "id", "syncEvent"], - "additionalProperties": false - }, - "SyncEventSessionNextTextStarted": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["sync"] - }, - "id": { - "type": "string", - "pattern": "^evt_" - }, - "syncEvent": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["session.next.text.started.1"] - }, - "id": { - "type": "string", - "pattern": "^evt_" - }, - "seq": { - "type": "number" - }, - "aggregateID": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "assistantMessageID": { - "type": "string", - "pattern": "^msg_" - }, - "textID": { - "type": "string" - } - }, - "required": ["timestamp", "sessionID", "assistantMessageID", "textID"], - "additionalProperties": false - } - }, - "required": ["type", "id", "seq", "aggregateID", "data"], - "additionalProperties": false - } - }, - "required": ["type", "id", "syncEvent"], - "additionalProperties": false - }, - "SyncEventSessionNextTextEnded": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["sync"] - }, - "id": { - "type": "string", - "pattern": "^evt_" - }, - "syncEvent": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["session.next.text.ended.1"] - }, - "id": { - "type": "string", - "pattern": "^evt_" - }, - "seq": { - "type": "number" - }, - "aggregateID": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "assistantMessageID": { - "type": "string", - "pattern": "^msg_" - }, - "textID": { - "type": "string" - }, - "text": { - "type": "string" - } - }, - "required": ["timestamp", "sessionID", "assistantMessageID", "textID", "text"], - "additionalProperties": false - } - }, - "required": ["type", "id", "seq", "aggregateID", "data"], - "additionalProperties": false - } - }, - "required": ["type", "id", "syncEvent"], - "additionalProperties": false - }, - "SyncEventSessionNextReasoningStarted": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["sync"] - }, - "id": { - "type": "string", - "pattern": "^evt_" - }, - "syncEvent": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["session.next.reasoning.started.1"] - }, - "id": { - "type": "string", - "pattern": "^evt_" - }, - "seq": { - "type": "number" - }, - "aggregateID": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "assistantMessageID": { - "type": "string", - "pattern": "^msg_" - }, - "reasoningID": { - "type": "string" - }, - "providerMetadata": { - "$ref": "#/components/schemas/LLMProviderMetadata" - } - }, - "required": ["timestamp", "sessionID", "assistantMessageID", "reasoningID"], - "additionalProperties": false - } - }, - "required": ["type", "id", "seq", "aggregateID", "data"], - "additionalProperties": false - } - }, - "required": ["type", "id", "syncEvent"], - "additionalProperties": false - }, - "SyncEventSessionNextReasoningEnded": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["sync"] - }, - "id": { - "type": "string", - "pattern": "^evt_" - }, - "syncEvent": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["session.next.reasoning.ended.1"] - }, - "id": { - "type": "string", - "pattern": "^evt_" - }, - "seq": { - "type": "number" - }, - "aggregateID": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "assistantMessageID": { - "type": "string", - "pattern": "^msg_" - }, - "reasoningID": { - "type": "string" - }, - "text": { - "type": "string" - }, - "providerMetadata": { - "$ref": "#/components/schemas/LLMProviderMetadata" - } - }, - "required": ["timestamp", "sessionID", "assistantMessageID", "reasoningID", "text"], - "additionalProperties": false - } - }, - "required": ["type", "id", "seq", "aggregateID", "data"], - "additionalProperties": false - } - }, - "required": ["type", "id", "syncEvent"], - "additionalProperties": false - }, - "SyncEventSessionNextToolInputStarted": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["sync"] - }, - "id": { - "type": "string", - "pattern": "^evt_" - }, - "syncEvent": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["session.next.tool.input.started.1"] - }, - "id": { - "type": "string", - "pattern": "^evt_" - }, - "seq": { - "type": "number" - }, - "aggregateID": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "assistantMessageID": { - "type": "string", - "pattern": "^msg_" - }, - "callID": { - "type": "string" - }, - "name": { - "type": "string" - } - }, - "required": ["timestamp", "sessionID", "assistantMessageID", "callID", "name"], - "additionalProperties": false - } - }, - "required": ["type", "id", "seq", "aggregateID", "data"], - "additionalProperties": false - } - }, - "required": ["type", "id", "syncEvent"], - "additionalProperties": false - }, - "SyncEventSessionNextToolInputEnded": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["sync"] - }, - "id": { - "type": "string", - "pattern": "^evt_" - }, - "syncEvent": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["session.next.tool.input.ended.1"] - }, - "id": { - "type": "string", - "pattern": "^evt_" - }, - "seq": { - "type": "number" - }, - "aggregateID": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "assistantMessageID": { - "type": "string", - "pattern": "^msg_" - }, - "callID": { - "type": "string" - }, - "text": { - "type": "string" - } - }, - "required": ["timestamp", "sessionID", "assistantMessageID", "callID", "text"], - "additionalProperties": false - } - }, - "required": ["type", "id", "seq", "aggregateID", "data"], - "additionalProperties": false - } - }, - "required": ["type", "id", "syncEvent"], - "additionalProperties": false - }, - "SyncEventSessionNextToolCalled": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["sync"] - }, - "id": { - "type": "string", - "pattern": "^evt_" - }, - "syncEvent": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["session.next.tool.called.1"] - }, - "id": { - "type": "string", - "pattern": "^evt_" - }, - "seq": { - "type": "number" - }, - "aggregateID": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "assistantMessageID": { - "type": "string", - "pattern": "^msg_" - }, - "callID": { - "type": "string" - }, - "tool": { - "type": "string" - }, - "input": { - "type": "object" - }, - "provider": { - "type": "object", - "properties": { - "executed": { - "type": "boolean" - }, - "metadata": { - "$ref": "#/components/schemas/LLMProviderMetadata" - } - }, - "required": ["executed"], - "additionalProperties": false - } - }, - "required": ["timestamp", "sessionID", "assistantMessageID", "callID", "tool", "input", "provider"], - "additionalProperties": false - } - }, - "required": ["type", "id", "seq", "aggregateID", "data"], - "additionalProperties": false - } - }, - "required": ["type", "id", "syncEvent"], - "additionalProperties": false - }, - "SyncEventSessionNextToolProgress": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["sync"] - }, - "id": { - "type": "string", - "pattern": "^evt_" - }, - "syncEvent": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["session.next.tool.progress.1"] - }, - "id": { - "type": "string", - "pattern": "^evt_" - }, - "seq": { - "type": "number" - }, - "aggregateID": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "assistantMessageID": { - "type": "string", - "pattern": "^msg_" - }, - "callID": { - "type": "string" - }, - "structured": { - "type": "object" - }, - "content": { - "type": "array", - "items": { - "$ref": "#/components/schemas/LLMToolContent" - } - } - }, - "required": ["timestamp", "sessionID", "assistantMessageID", "callID", "structured", "content"], - "additionalProperties": false - } - }, - "required": ["type", "id", "seq", "aggregateID", "data"], - "additionalProperties": false - } - }, - "required": ["type", "id", "syncEvent"], - "additionalProperties": false - }, - "SyncEventSessionNextToolSuccess": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["sync"] - }, - "id": { - "type": "string", - "pattern": "^evt_" - }, - "syncEvent": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["session.next.tool.success.1"] - }, - "id": { - "type": "string", - "pattern": "^evt_" - }, - "seq": { - "type": "number" - }, - "aggregateID": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "assistantMessageID": { - "type": "string", - "pattern": "^msg_" - }, - "callID": { - "type": "string" - }, - "structured": { - "type": "object" - }, - "content": { - "type": "array", - "items": { - "$ref": "#/components/schemas/LLMToolContent" - } - }, - "outputPaths": { - "type": "array", - "items": { - "type": "string" - } - }, - "result": {}, - "provider": { - "type": "object", - "properties": { - "executed": { - "type": "boolean" - }, - "metadata": { - "$ref": "#/components/schemas/LLMProviderMetadata" - } - }, - "required": ["executed"], - "additionalProperties": false - } - }, - "required": [ - "timestamp", - "sessionID", - "assistantMessageID", - "callID", - "structured", - "content", - "provider" - ], - "additionalProperties": false - } - }, - "required": ["type", "id", "seq", "aggregateID", "data"], - "additionalProperties": false - } - }, - "required": ["type", "id", "syncEvent"], - "additionalProperties": false - }, - "SyncEventSessionNextToolFailed": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["sync"] - }, - "id": { - "type": "string", - "pattern": "^evt_" - }, - "syncEvent": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["session.next.tool.failed.1"] - }, - "id": { - "type": "string", - "pattern": "^evt_" - }, - "seq": { - "type": "number" - }, - "aggregateID": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "assistantMessageID": { - "type": "string", - "pattern": "^msg_" - }, - "callID": { - "type": "string" - }, - "error": { - "$ref": "#/components/schemas/SessionErrorUnknown" - }, - "result": {}, - "provider": { - "type": "object", - "properties": { - "executed": { - "type": "boolean" - }, - "metadata": { - "$ref": "#/components/schemas/LLMProviderMetadata" - } - }, - "required": ["executed"], - "additionalProperties": false - } - }, - "required": ["timestamp", "sessionID", "assistantMessageID", "callID", "error", "provider"], - "additionalProperties": false - } - }, - "required": ["type", "id", "seq", "aggregateID", "data"], - "additionalProperties": false - } - }, - "required": ["type", "id", "syncEvent"], - "additionalProperties": false - }, - "SyncEventSessionNextRetried": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["sync"] - }, - "id": { - "type": "string", - "pattern": "^evt_" - }, - "syncEvent": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["session.next.retried.1"] - }, - "id": { - "type": "string", - "pattern": "^evt_" - }, - "seq": { - "type": "number" - }, - "aggregateID": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "attempt": { - "type": "number" - }, - "error": { - "$ref": "#/components/schemas/SessionNextRetry_error" - } - }, - "required": ["timestamp", "sessionID", "attempt", "error"], - "additionalProperties": false - } - }, - "required": ["type", "id", "seq", "aggregateID", "data"], - "additionalProperties": false - } - }, - "required": ["type", "id", "syncEvent"], - "additionalProperties": false - }, - "SyncEventSessionNextCompactionStarted": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["sync"] - }, - "id": { - "type": "string", - "pattern": "^evt_" - }, - "syncEvent": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["session.next.compaction.started.1"] - }, - "id": { - "type": "string", - "pattern": "^evt_" - }, - "seq": { - "type": "number" - }, - "aggregateID": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "messageID": { - "type": "string", - "pattern": "^msg_" - }, - "reason": { - "type": "string", - "enum": ["auto", "manual"] - } - }, - "required": ["timestamp", "sessionID", "messageID", "reason"], - "additionalProperties": false - } - }, - "required": ["type", "id", "seq", "aggregateID", "data"], - "additionalProperties": false - } - }, - "required": ["type", "id", "syncEvent"], - "additionalProperties": false - }, - "SyncEventSessionNextCompactionEnded": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["sync"] - }, - "id": { - "type": "string", - "pattern": "^evt_" - }, - "syncEvent": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["session.next.compaction.ended.1"] - }, - "id": { - "type": "string", - "pattern": "^evt_" - }, - "seq": { - "type": "number" - }, - "aggregateID": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "messageID": { - "type": "string", - "pattern": "^msg_" - }, - "reason": { - "type": "string", - "enum": ["auto", "manual"] - }, - "text": { - "type": "string" - }, - "recent": { - "type": "string" - } - }, - "required": ["timestamp", "sessionID", "messageID", "reason", "text", "recent"], - "additionalProperties": false - } - }, - "required": ["type", "id", "seq", "aggregateID", "data"], - "additionalProperties": false - } - }, - "required": ["type", "id", "syncEvent"], - "additionalProperties": false - }, - "SyncEventSessionNextRevertStaged": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["sync"] - }, - "id": { - "type": "string", - "pattern": "^evt_" - }, - "syncEvent": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["session.next.revert.staged.1"] - }, - "id": { - "type": "string", - "pattern": "^evt_" - }, - "seq": { - "type": "number" - }, - "aggregateID": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "revert": { - "$ref": "#/components/schemas/RevertState" - } - }, - "required": ["timestamp", "sessionID", "revert"], - "additionalProperties": false - } - }, - "required": ["type", "id", "seq", "aggregateID", "data"], - "additionalProperties": false - } - }, - "required": ["type", "id", "syncEvent"], - "additionalProperties": false - }, - "SyncEventSessionNextRevertCleared": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["sync"] - }, - "id": { - "type": "string", - "pattern": "^evt_" - }, - "syncEvent": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["session.next.revert.cleared.1"] - }, - "id": { - "type": "string", - "pattern": "^evt_" - }, - "seq": { - "type": "number" - }, - "aggregateID": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - } - }, - "required": ["timestamp", "sessionID"], - "additionalProperties": false - } - }, - "required": ["type", "id", "seq", "aggregateID", "data"], - "additionalProperties": false - } - }, - "required": ["type", "id", "syncEvent"], - "additionalProperties": false - }, - "SyncEventSessionNextRevertCommitted": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["sync"] - }, - "id": { - "type": "string", - "pattern": "^evt_" - }, - "syncEvent": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["session.next.revert.committed.1"] - }, - "id": { - "type": "string", - "pattern": "^evt_" - }, - "seq": { - "type": "number" - }, - "aggregateID": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "messageID": { - "type": "string", - "pattern": "^msg_" - } - }, - "required": ["timestamp", "sessionID", "messageID"], - "additionalProperties": false - } - }, - "required": ["type", "id", "seq", "aggregateID", "data"], - "additionalProperties": false - } - }, - "required": ["type", "id", "syncEvent"], - "additionalProperties": false - }, - "ConfigV2ReferenceGit": { - "type": "object", - "properties": { - "repository": { - "type": "string" - }, - "branch": { - "type": "string" - }, - "description": { - "type": "string" - }, - "hidden": { - "type": "boolean" - } - }, - "required": ["repository"], - "additionalProperties": false - }, - "ConfigV2ReferenceLocal": { - "type": "object", - "properties": { - "path": { - "type": "string" - }, - "description": { - "type": "string" - }, - "hidden": { - "type": "boolean" - } - }, - "required": ["path"], - "additionalProperties": false - }, - "PolicyEffect": { - "type": "string", - "enum": ["allow", "deny"] - }, - "ConfigV2ExperimentalPolicy": { - "type": "object", - "properties": { - "action": { - "type": "string", - "enum": ["provider.use"] - }, - "effect": { - "$ref": "#/components/schemas/PolicyEffect" - }, - "resource": { - "type": "string" - } - }, - "required": ["action", "effect", "resource"], - "additionalProperties": false - }, - "ProjectDirectories": { - "type": "array", - "items": { - "type": "object", - "properties": { - "directory": { - "type": "string" - }, - "strategy": { - "type": "string" - } - }, - "required": ["directory"], - "additionalProperties": false - } - }, - "PtyTicketConnectToken": { - "type": "object", - "properties": { - "ticket": { - "type": "string" - }, - "expires_in": { - "type": "integer", - "exclusiveMinimum": 0 - } - }, - "required": ["ticket", "expires_in"], - "additionalProperties": false - }, - "WorkspaceEventConnectionStatus": { - "type": "object", - "properties": { - "workspaceID": { - "type": "string", - "pattern": "^wrk" - }, - "status": { - "type": "string", - "enum": ["connected", "connecting", "disconnected", "error"] - } - }, - "required": ["workspaceID", "status"], - "additionalProperties": false - }, - "LocationInfo": { - "type": "object", - "properties": { - "directory": { - "type": "string" - }, - "workspaceID": { - "type": "string", - "pattern": "^wrk" - }, - "project": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "directory": { - "type": "string" - } - }, - "required": ["id", "directory"], - "additionalProperties": false - } - }, - "required": ["directory", "project"], - "additionalProperties": false - }, - "ProviderRequest": { - "type": "object", - "properties": { - "headers": { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "body": { - "type": "object" - } - }, - "required": ["headers", "body"], - "additionalProperties": false - }, - "AgentColor": { - "anyOf": [ - { - "type": "string", - "pattern": "^#[0-9a-fA-F]{6}$" - }, - { - "type": "string", - "enum": ["primary", "secondary", "accent", "success", "warning", "error", "info"] - } - ] - }, - "PermissionV2Effect": { - "type": "string", - "enum": ["allow", "deny", "ask"] - }, - "PermissionV2Rule": { - "type": "object", - "properties": { - "action": { - "type": "string" - }, - "resource": { - "type": "string" - }, - "effect": { - "$ref": "#/components/schemas/PermissionV2Effect" - } - }, - "required": ["action", "resource", "effect"], - "additionalProperties": false - }, - "PermissionV2Ruleset": { - "type": "array", - "items": { - "$ref": "#/components/schemas/PermissionV2Rule" - } - }, - "AgentV2Info": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "model": { - "$ref": "#/components/schemas/ModelRef" - }, - "request": { - "$ref": "#/components/schemas/ProviderRequest" - }, - "system": { - "type": "string" - }, - "description": { - "type": "string" - }, - "mode": { - "type": "string", - "enum": ["subagent", "primary", "all"] - }, - "hidden": { - "type": "boolean" - }, - "color": { - "$ref": "#/components/schemas/AgentColor" - }, - "steps": { - "type": "integer", - "exclusiveMinimum": 0 - }, - "permissions": { - "$ref": "#/components/schemas/PermissionV2Ruleset" - } - }, - "required": ["id", "request", "mode", "hidden", "permissions"], - "additionalProperties": false - }, - "SessionV2Info": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^ses" - }, - "parentID": { - "type": "string", - "pattern": "^ses" - }, - "projectID": { - "type": "string" - }, - "agent": { - "type": "string" - }, - "model": { - "$ref": "#/components/schemas/ModelRef" - }, - "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 - }, - "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/LocationRef" - }, - "subpath": { - "type": "string" - }, - "revert": { - "$ref": "#/components/schemas/RevertState" - } - }, - "required": ["id", "projectID", "cost", "tokens", "time", "title", "location"], - "additionalProperties": false - }, - "PromptInputFileAttachment": { - "type": "object", - "properties": { - "uri": { - "type": "string" - }, - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "source": { - "$ref": "#/components/schemas/PromptSource" - } - }, - "required": ["uri"], - "additionalProperties": false - }, - "SessionInputAdmitted": { - "type": "object", - "properties": { - "admittedSeq": { - "type": "integer", - "minimum": 0 - }, - "id": { - "type": "string", - "pattern": "^msg_" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "prompt": { - "$ref": "#/components/schemas/Prompt" - }, - "delivery": { - "type": "string", - "enum": ["steer", "queue"] - }, - "timeCreated": { - "type": "number" - }, - "promotedSeq": { - "type": "integer", - "minimum": 0 - } - }, - "required": ["admittedSeq", "id", "sessionID", "prompt", "delivery", "timeCreated"], - "additionalProperties": false - }, - "SessionMessageAgentSwitched": { - "type": "object", - "properties": { - "id": { - "type": "string", - "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 - }, - "SessionMessageModelSwitched": { - "type": "object", - "properties": { - "id": { - "type": "string", - "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/ModelRef" - } - }, - "required": ["id", "time", "type", "model"], - "additionalProperties": false - }, - "SessionMessageUser": { - "type": "object", - "properties": { - "id": { - "type": "string", - "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/PromptFileAttachment" - } - }, - "agents": { - "type": "array", - "items": { - "$ref": "#/components/schemas/PromptAgentAttachment" - } - }, - "type": { - "type": "string", - "enum": ["user"] - } - }, - "required": ["id", "time", "text", "type"], - "additionalProperties": false - }, - "SessionMessageSynthetic": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^msg_" - }, - "metadata": { - "type": "object" - }, - "time": { - "type": "object", - "properties": { - "created": { - "type": "number" - } - }, - "required": ["created"], - "additionalProperties": false - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "text": { - "type": "string" - }, - "type": { - "type": "string", - "enum": ["session.synthetic"] - } - }, - "required": ["id", "time", "sessionID", "text", "type"], - "additionalProperties": false - }, - "SessionMessageSystem": { - "type": "object", - "properties": { - "id": { - "type": "string", - "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 - }, - "SessionMessageShell": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^msg_" - }, - "metadata": { - "type": "object" - }, - "time": { - "type": "object", - "properties": { - "created": { - "type": "number" - }, - "completed": { - "type": "number" - } - }, - "required": ["created"], - "additionalProperties": false - }, - "type": { - "type": "string", - "enum": ["shell"] - }, - "callID": { - "type": "string" - }, - "command": { - "type": "string" - }, - "output": { - "type": "string" - } - }, - "required": ["id", "time", "type", "callID", "command", "output"], - "additionalProperties": false - }, - "SessionMessageAssistantText": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["text"] - }, - "id": { - "type": "string" - }, - "text": { - "type": "string" - } - }, - "required": ["type", "id", "text"], - "additionalProperties": false - }, - "SessionMessageAssistantReasoning": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["reasoning"] - }, - "id": { - "type": "string" - }, - "text": { - "type": "string" - }, - "providerMetadata": { - "$ref": "#/components/schemas/LLMProviderMetadata" - }, - "time": { - "type": "object", - "properties": { - "created": { - "type": "number" - }, - "completed": { - "type": "number" - } - }, - "required": ["created"], - "additionalProperties": false - } - }, - "required": ["type", "id", "text"], - "additionalProperties": false - }, - "SessionMessageToolStatePending": { - "type": "object", - "properties": { - "status": { - "type": "string", - "enum": ["pending"] - }, - "input": { - "type": "string" - } - }, - "required": ["status", "input"], - "additionalProperties": false - }, - "SessionMessageToolStateRunning": { - "type": "object", - "properties": { - "status": { - "type": "string", - "enum": ["running"] - }, - "input": { - "type": "object" - }, - "structured": { - "type": "object" - }, - "content": { - "type": "array", - "items": { - "$ref": "#/components/schemas/LLMToolContent" - } - } - }, - "required": ["status", "input", "structured", "content"], - "additionalProperties": false - }, - "SessionMessageToolStateCompleted": { - "type": "object", - "properties": { - "status": { - "type": "string", - "enum": ["completed"] - }, - "input": { - "type": "object" - }, - "attachments": { - "type": "array", - "items": { - "$ref": "#/components/schemas/PromptFileAttachment" - } - }, - "content": { - "type": "array", - "items": { - "$ref": "#/components/schemas/LLMToolContent" - } - }, - "outputPaths": { - "type": "array", - "items": { - "type": "string" - } - }, - "structured": { - "type": "object" - }, - "result": {} - }, - "required": ["status", "input", "content", "structured"], - "additionalProperties": false - }, - "SessionMessageToolStateError": { - "type": "object", - "properties": { - "status": { - "type": "string", - "enum": ["error"] - }, - "input": { - "type": "object" - }, - "content": { - "type": "array", - "items": { - "$ref": "#/components/schemas/LLMToolContent" - } - }, - "structured": { - "type": "object" - }, - "error": { - "$ref": "#/components/schemas/SessionErrorUnknown" - }, - "result": {} - }, - "required": ["status", "input", "content", "structured", "error"], - "additionalProperties": false - }, - "SessionMessageAssistantTool": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["tool"] - }, - "id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "provider": { - "type": "object", - "properties": { - "executed": { - "type": "boolean" - }, - "metadata": { - "$ref": "#/components/schemas/LLMProviderMetadata" - }, - "resultMetadata": { - "$ref": "#/components/schemas/LLMProviderMetadata" - } - }, - "required": ["executed"], - "additionalProperties": false - }, - "state": { - "anyOf": [ - { - "$ref": "#/components/schemas/SessionMessageToolStatePending" - }, - { - "$ref": "#/components/schemas/SessionMessageToolStateRunning" - }, - { - "$ref": "#/components/schemas/SessionMessageToolStateCompleted" - }, - { - "$ref": "#/components/schemas/SessionMessageToolStateError" - } - ] - }, - "time": { - "type": "object", - "properties": { - "created": { - "type": "number" - }, - "ran": { - "type": "number" - }, - "completed": { - "type": "number" - }, - "pruned": { - "type": "number" - } - }, - "required": ["created"], - "additionalProperties": false - } - }, - "required": ["type", "id", "name", "state", "time"], - "additionalProperties": false - }, - "SessionMessageAssistant": { - "type": "object", - "properties": { - "id": { - "type": "string", - "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/ModelRef" - }, - "content": { - "type": "array", - "items": { - "anyOf": [ - { - "$ref": "#/components/schemas/SessionMessageAssistantText" - }, - { - "$ref": "#/components/schemas/SessionMessageAssistantReasoning" - }, - { - "$ref": "#/components/schemas/SessionMessageAssistantTool" - } - ] - } - }, - "snapshot": { - "type": "object", - "properties": { - "start": { - "type": "string" - }, - "end": { - "type": "string" - }, - "files": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "additionalProperties": false - }, - "finish": { - "type": "string" - }, - "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 - }, - "error": { - "$ref": "#/components/schemas/SessionErrorUnknown" - } - }, - "required": ["id", "time", "type", "agent", "model", "content"], - "additionalProperties": false - }, - "SessionMessageCompaction": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["compaction"] - }, - "reason": { - "type": "string", - "enum": ["auto", "manual"] - }, - "summary": { - "type": "string" - }, - "recent": { - "type": "string" - }, - "id": { - "type": "string", - "pattern": "^msg_" - }, - "metadata": { - "type": "object" - }, - "time": { - "type": "object", - "properties": { - "created": { - "type": "number" - } - }, - "required": ["created"], - "additionalProperties": false - } - }, - "required": ["type", "reason", "summary", "recent", "id", "time"], - "additionalProperties": false - }, - "SessionMessage": { - "anyOf": [ - { - "$ref": "#/components/schemas/SessionMessageAgentSwitched" - }, - { - "$ref": "#/components/schemas/SessionMessageModelSwitched" - }, - { - "$ref": "#/components/schemas/SessionMessageUser" - }, - { - "$ref": "#/components/schemas/SessionMessageSynthetic" - }, - { - "$ref": "#/components/schemas/SessionMessageSystem" - }, - { - "$ref": "#/components/schemas/SessionMessageShell" - }, - { - "$ref": "#/components/schemas/SessionMessageAssistant" - }, - { - "$ref": "#/components/schemas/SessionMessageCompaction" - } - ] - }, - "SessionNextAgentSwitched": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["session.next.agent.switched"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer" - }, - "version": { - "type": "integer" - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/LocationRef" - }, - "data": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "messageID": { - "type": "string", - "pattern": "^msg_" - }, - "agent": { - "type": "string" - } - }, - "required": ["timestamp", "sessionID", "messageID", "agent"], - "additionalProperties": false - } - }, - "required": ["id", "type", "data"], - "additionalProperties": false - }, - "SessionNextModelSwitched": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["session.next.model.switched"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer" - }, - "version": { - "type": "integer" - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/LocationRef" - }, - "data": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "messageID": { - "type": "string", - "pattern": "^msg_" - }, - "model": { - "$ref": "#/components/schemas/ModelRef" - } - }, - "required": ["timestamp", "sessionID", "messageID", "model"], - "additionalProperties": false - } - }, - "required": ["id", "type", "data"], - "additionalProperties": false - }, - "SessionNextMoved": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["session.next.moved"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer" - }, - "version": { - "type": "integer" - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/LocationRef" - }, - "data": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "location": { - "$ref": "#/components/schemas/LocationRef" - }, - "subdirectory": { - "type": "string" - } - }, - "required": ["timestamp", "sessionID", "location"], - "additionalProperties": false - } - }, - "required": ["id", "type", "data"], - "additionalProperties": false - }, - "SessionNextPrompted": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["session.next.prompted"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer" - }, - "version": { - "type": "integer" - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/LocationRef" - }, - "data": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "messageID": { - "type": "string", - "pattern": "^msg_" - }, - "prompt": { - "$ref": "#/components/schemas/Prompt" - }, - "delivery": { - "type": "string", - "enum": ["steer", "queue"] - } - }, - "required": ["timestamp", "sessionID", "messageID", "prompt", "delivery"], - "additionalProperties": false - } - }, - "required": ["id", "type", "data"], - "additionalProperties": false - }, - "SessionNextPromptAdmitted": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["session.next.prompt.admitted"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer" - }, - "version": { - "type": "integer" - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/LocationRef" - }, - "data": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "messageID": { - "type": "string", - "pattern": "^msg_" - }, - "prompt": { - "$ref": "#/components/schemas/Prompt" - }, - "delivery": { - "type": "string", - "enum": ["steer", "queue"] - } - }, - "required": ["timestamp", "sessionID", "messageID", "prompt", "delivery"], - "additionalProperties": false - } - }, - "required": ["id", "type", "data"], - "additionalProperties": false - }, - "SessionNextContextUpdated": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["session.next.context.updated"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer" - }, - "version": { - "type": "integer" - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/LocationRef" - }, - "data": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "messageID": { - "type": "string", - "pattern": "^msg_" - }, - "text": { - "type": "string" - } - }, - "required": ["timestamp", "sessionID", "messageID", "text"], - "additionalProperties": false - } - }, - "required": ["id", "type", "data"], - "additionalProperties": false - }, - "SessionNextSynthetic": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["session.next.synthetic"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer" - }, - "version": { - "type": "integer" - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/LocationRef" - }, - "data": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "messageID": { - "type": "string", - "pattern": "^msg_" - }, - "text": { - "type": "string" - } - }, - "required": ["timestamp", "sessionID", "messageID", "text"], - "additionalProperties": false - } - }, - "required": ["id", "type", "data"], - "additionalProperties": false - }, - "SessionNextShellStarted": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["session.next.shell.started"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer" - }, - "version": { - "type": "integer" - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/LocationRef" - }, - "data": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "messageID": { - "type": "string", - "pattern": "^msg_" - }, - "callID": { - "type": "string" - }, - "command": { - "type": "string" - } - }, - "required": ["timestamp", "sessionID", "messageID", "callID", "command"], - "additionalProperties": false - } - }, - "required": ["id", "type", "data"], - "additionalProperties": false - }, - "SessionNextShellEnded": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["session.next.shell.ended"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer" - }, - "version": { - "type": "integer" - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/LocationRef" - }, - "data": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "callID": { - "type": "string" - }, - "output": { - "type": "string" - } - }, - "required": ["timestamp", "sessionID", "callID", "output"], - "additionalProperties": false - } - }, - "required": ["id", "type", "data"], - "additionalProperties": false - }, - "SessionNextStepStarted": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["session.next.step.started"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer" - }, - "version": { - "type": "integer" - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/LocationRef" - }, - "data": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "assistantMessageID": { - "type": "string", - "pattern": "^msg_" - }, - "agent": { - "type": "string" - }, - "model": { - "$ref": "#/components/schemas/ModelRef" - }, - "snapshot": { - "type": "string" - } - }, - "required": ["timestamp", "sessionID", "assistantMessageID", "agent", "model"], - "additionalProperties": false - } - }, - "required": ["id", "type", "data"], - "additionalProperties": false - }, - "SessionNextStepEnded": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["session.next.step.ended"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer" - }, - "version": { - "type": "integer" - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/LocationRef" - }, - "data": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "assistantMessageID": { - "type": "string", - "pattern": "^msg_" - }, - "finish": { - "type": "string" - }, - "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 - }, - "snapshot": { - "type": "string" - }, - "files": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": ["timestamp", "sessionID", "assistantMessageID", "finish", "cost", "tokens"], - "additionalProperties": false - } - }, - "required": ["id", "type", "data"], - "additionalProperties": false - }, - "SessionNextStepFailed": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["session.next.step.failed"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer" - }, - "version": { - "type": "integer" - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/LocationRef" - }, - "data": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "assistantMessageID": { - "type": "string", - "pattern": "^msg_" - }, - "error": { - "$ref": "#/components/schemas/SessionErrorUnknown" - } - }, - "required": ["timestamp", "sessionID", "assistantMessageID", "error"], - "additionalProperties": false - } - }, - "required": ["id", "type", "data"], - "additionalProperties": false - }, - "SessionNextTextStarted": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["session.next.text.started"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer" - }, - "version": { - "type": "integer" - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/LocationRef" - }, - "data": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "assistantMessageID": { - "type": "string", - "pattern": "^msg_" - }, - "textID": { - "type": "string" - } - }, - "required": ["timestamp", "sessionID", "assistantMessageID", "textID"], - "additionalProperties": false - } - }, - "required": ["id", "type", "data"], - "additionalProperties": false - }, - "SessionNextTextEnded": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["session.next.text.ended"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer" - }, - "version": { - "type": "integer" - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/LocationRef" - }, - "data": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "assistantMessageID": { - "type": "string", - "pattern": "^msg_" - }, - "textID": { - "type": "string" - }, - "text": { - "type": "string" - } - }, - "required": ["timestamp", "sessionID", "assistantMessageID", "textID", "text"], - "additionalProperties": false - } - }, - "required": ["id", "type", "data"], - "additionalProperties": false - }, - "SessionNextToolInputStarted": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["session.next.tool.input.started"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer" - }, - "version": { - "type": "integer" - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/LocationRef" - }, - "data": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "assistantMessageID": { - "type": "string", - "pattern": "^msg_" - }, - "callID": { - "type": "string" - }, - "name": { - "type": "string" - } - }, - "required": ["timestamp", "sessionID", "assistantMessageID", "callID", "name"], - "additionalProperties": false - } - }, - "required": ["id", "type", "data"], - "additionalProperties": false - }, - "SessionNextToolInputEnded": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["session.next.tool.input.ended"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer" - }, - "version": { - "type": "integer" - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/LocationRef" - }, - "data": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "assistantMessageID": { - "type": "string", - "pattern": "^msg_" - }, - "callID": { - "type": "string" - }, - "text": { - "type": "string" - } - }, - "required": ["timestamp", "sessionID", "assistantMessageID", "callID", "text"], - "additionalProperties": false - } - }, - "required": ["id", "type", "data"], - "additionalProperties": false - }, - "SessionNextToolCalled": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["session.next.tool.called"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer" - }, - "version": { - "type": "integer" - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/LocationRef" - }, - "data": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "assistantMessageID": { - "type": "string", - "pattern": "^msg_" - }, - "callID": { - "type": "string" - }, - "tool": { - "type": "string" - }, - "input": { - "type": "object" - }, - "provider": { - "type": "object", - "properties": { - "executed": { - "type": "boolean" - }, - "metadata": { - "$ref": "#/components/schemas/LLMProviderMetadata" - } - }, - "required": ["executed"], - "additionalProperties": false - } - }, - "required": ["timestamp", "sessionID", "assistantMessageID", "callID", "tool", "input", "provider"], - "additionalProperties": false - } - }, - "required": ["id", "type", "data"], - "additionalProperties": false - }, - "SessionNextToolProgress": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["session.next.tool.progress"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer" - }, - "version": { - "type": "integer" - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/LocationRef" - }, - "data": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "assistantMessageID": { - "type": "string", - "pattern": "^msg_" - }, - "callID": { - "type": "string" - }, - "structured": { - "type": "object" - }, - "content": { - "type": "array", - "items": { - "$ref": "#/components/schemas/LLMToolContent" - } - } - }, - "required": ["timestamp", "sessionID", "assistantMessageID", "callID", "structured", "content"], - "additionalProperties": false - } - }, - "required": ["id", "type", "data"], - "additionalProperties": false - }, - "SessionNextToolSuccess": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["session.next.tool.success"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer" - }, - "version": { - "type": "integer" - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/LocationRef" - }, - "data": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "assistantMessageID": { - "type": "string", - "pattern": "^msg_" - }, - "callID": { - "type": "string" - }, - "structured": { - "type": "object" - }, - "content": { - "type": "array", - "items": { - "$ref": "#/components/schemas/LLMToolContent" - } - }, - "outputPaths": { - "type": "array", - "items": { - "type": "string" - } - }, - "result": {}, - "provider": { - "type": "object", - "properties": { - "executed": { - "type": "boolean" - }, - "metadata": { - "$ref": "#/components/schemas/LLMProviderMetadata" - } - }, - "required": ["executed"], - "additionalProperties": false - } - }, - "required": ["timestamp", "sessionID", "assistantMessageID", "callID", "structured", "content", "provider"], - "additionalProperties": false - } - }, - "required": ["id", "type", "data"], - "additionalProperties": false - }, - "SessionNextToolFailed": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["session.next.tool.failed"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer" - }, - "version": { - "type": "integer" - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/LocationRef" - }, - "data": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "assistantMessageID": { - "type": "string", - "pattern": "^msg_" - }, - "callID": { - "type": "string" - }, - "error": { - "$ref": "#/components/schemas/SessionErrorUnknown" - }, - "result": {}, - "provider": { - "type": "object", - "properties": { - "executed": { - "type": "boolean" - }, - "metadata": { - "$ref": "#/components/schemas/LLMProviderMetadata" - } - }, - "required": ["executed"], - "additionalProperties": false - } - }, - "required": ["timestamp", "sessionID", "assistantMessageID", "callID", "error", "provider"], - "additionalProperties": false - } - }, - "required": ["id", "type", "data"], - "additionalProperties": false - }, - "SessionNextReasoningStarted": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["session.next.reasoning.started"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer" - }, - "version": { - "type": "integer" - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/LocationRef" - }, - "data": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "assistantMessageID": { - "type": "string", - "pattern": "^msg_" - }, - "reasoningID": { - "type": "string" - }, - "providerMetadata": { - "$ref": "#/components/schemas/LLMProviderMetadata" - } - }, - "required": ["timestamp", "sessionID", "assistantMessageID", "reasoningID"], - "additionalProperties": false - } - }, - "required": ["id", "type", "data"], - "additionalProperties": false - }, - "SessionNextReasoningEnded": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["session.next.reasoning.ended"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer" - }, - "version": { - "type": "integer" - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/LocationRef" - }, - "data": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "assistantMessageID": { - "type": "string", - "pattern": "^msg_" - }, - "reasoningID": { - "type": "string" - }, - "text": { - "type": "string" - }, - "providerMetadata": { - "$ref": "#/components/schemas/LLMProviderMetadata" - } - }, - "required": ["timestamp", "sessionID", "assistantMessageID", "reasoningID", "text"], - "additionalProperties": false - } - }, - "required": ["id", "type", "data"], - "additionalProperties": false - }, - "SessionNextRetried": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["session.next.retried"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer" - }, - "version": { - "type": "integer" - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/LocationRef" - }, - "data": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "attempt": { - "type": "number" - }, - "error": { - "$ref": "#/components/schemas/SessionNextRetry_error" - } - }, - "required": ["timestamp", "sessionID", "attempt", "error"], - "additionalProperties": false - } - }, - "required": ["id", "type", "data"], - "additionalProperties": false - }, - "SessionNextCompactionStarted": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["session.next.compaction.started"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer" - }, - "version": { - "type": "integer" - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/LocationRef" - }, - "data": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "messageID": { - "type": "string", - "pattern": "^msg_" - }, - "reason": { - "type": "string", - "enum": ["auto", "manual"] - } - }, - "required": ["timestamp", "sessionID", "messageID", "reason"], - "additionalProperties": false - } - }, - "required": ["id", "type", "data"], - "additionalProperties": false - }, - "SessionNextCompactionEnded": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["session.next.compaction.ended"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer" - }, - "version": { - "type": "integer" - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/LocationRef" - }, - "data": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "messageID": { - "type": "string", - "pattern": "^msg_" - }, - "reason": { - "type": "string", - "enum": ["auto", "manual"] - }, - "text": { - "type": "string" - }, - "recent": { - "type": "string" - } - }, - "required": ["timestamp", "sessionID", "messageID", "reason", "text", "recent"], - "additionalProperties": false - } - }, - "required": ["id", "type", "data"], - "additionalProperties": false - }, - "SessionNextRevertStaged": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["session.next.revert.staged"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer" - }, - "version": { - "type": "integer" - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/LocationRef" - }, - "data": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "revert": { - "$ref": "#/components/schemas/RevertState" - } - }, - "required": ["timestamp", "sessionID", "revert"], - "additionalProperties": false - } - }, - "required": ["id", "type", "data"], - "additionalProperties": false - }, - "SessionNextRevertCleared": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["session.next.revert.cleared"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer" - }, - "version": { - "type": "integer" - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/LocationRef" - }, - "data": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - } - }, - "required": ["timestamp", "sessionID"], - "additionalProperties": false - } - }, - "required": ["id", "type", "data"], - "additionalProperties": false - }, - "SessionNextRevertCommitted": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["session.next.revert.committed"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer" - }, - "version": { - "type": "integer" - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/LocationRef" - }, - "data": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "messageID": { - "type": "string", - "pattern": "^msg_" - } - }, - "required": ["timestamp", "sessionID", "messageID"], - "additionalProperties": false - } - }, - "required": ["id", "type", "data"], - "additionalProperties": false - }, - "ModelApi": { - "anyOf": [ - { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "type": { - "type": "string", - "enum": ["aisdk"] - }, - "package": { - "type": "string" - }, - "url": { - "type": "string" - }, - "settings": { - "type": "object" - } - }, - "required": ["id", "type", "package"], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "type": { - "type": "string", - "enum": ["native"] - }, - "url": { - "type": "string" - }, - "settings": { - "type": "object" - } - }, - "required": ["id", "type", "settings"], - "additionalProperties": false - } - ] - }, - "ModelCapabilities": { - "type": "object", - "properties": { - "tools": { - "type": "boolean" - }, - "input": { - "type": "array", - "items": { - "type": "string" - } - }, - "output": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": ["tools", "input", "output"], - "additionalProperties": false - }, - "ModelCost": { - "type": "object", - "properties": { - "tier": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["context"] - }, - "size": { - "type": "integer" - } - }, - "required": ["type", "size"], - "additionalProperties": false - }, - "input": { - "type": "number" - }, - "output": { - "type": "number" - }, - "cache": { - "type": "object", - "properties": { - "read": { - "type": "number" - }, - "write": { - "type": "number" - } - }, - "required": ["read", "write"], - "additionalProperties": false - } - }, - "required": ["input", "output", "cache"], - "additionalProperties": false - }, - "ModelV2Info": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "providerID": { - "type": "string" - }, - "family": { - "type": "string" - }, - "name": { - "type": "string" - }, - "api": { - "$ref": "#/components/schemas/ModelApi" - }, - "capabilities": { - "$ref": "#/components/schemas/ModelCapabilities" - }, - "request": { - "type": "object", - "properties": { - "headers": { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "body": { - "type": "object" - }, - "variant": { - "type": "string" - } - }, - "required": ["headers", "body"], - "additionalProperties": false - }, - "variants": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "headers": { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "body": { - "type": "object" - } - }, - "required": ["id", "headers", "body"], - "additionalProperties": false - } - }, - "time": { - "type": "object", - "properties": { - "released": { - "type": "number" - } - }, - "required": ["released"], - "additionalProperties": false - }, - "cost": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ModelCost" - } - }, - "status": { - "type": "string", - "enum": ["alpha", "beta", "deprecated", "active"] - }, - "enabled": { - "type": "boolean" - }, - "limit": { - "type": "object", - "properties": { - "context": { - "type": "integer" - }, - "input": { - "type": "integer" - }, - "output": { - "type": "integer" - } - }, - "required": ["context", "output"], - "additionalProperties": false - } - }, - "required": [ - "id", - "providerID", - "name", - "api", - "capabilities", - "request", - "variants", - "time", - "cost", - "status", - "enabled", - "limit" - ], - "additionalProperties": false - }, - "ProviderAISDK": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["aisdk"] - }, - "package": { - "type": "string" - }, - "url": { - "type": "string" - }, - "settings": { - "type": "object" - } - }, - "required": ["type", "package"], - "additionalProperties": false - }, - "ProviderNative": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["native"] - }, - "url": { - "type": "string" - }, - "settings": { - "type": "object" - } - }, - "required": ["type", "settings"], - "additionalProperties": false - }, - "ProviderApi": { - "anyOf": [ - { - "$ref": "#/components/schemas/ProviderAISDK" - }, - { - "$ref": "#/components/schemas/ProviderNative" - } - ] - }, - "ProviderV2Info": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "integrationID": { - "type": "string" - }, - "name": { - "type": "string" - }, - "disabled": { - "type": "boolean" - }, - "api": { - "$ref": "#/components/schemas/ProviderApi" - }, - "request": { - "$ref": "#/components/schemas/ProviderRequest" - } - }, - "required": ["id", "name", "api", "request"], - "additionalProperties": false - }, - "IntegrationWhen": { - "type": "object", - "properties": { - "key": { - "type": "string" - }, - "op": { - "type": "string", - "enum": ["eq", "neq"] - }, - "value": { - "type": "string" - } - }, - "required": ["key", "op", "value"], - "additionalProperties": false - }, - "IntegrationTextPrompt": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["text"] - }, - "key": { - "type": "string" - }, - "message": { - "type": "string" - }, - "placeholder": { - "type": "string" - }, - "when": { - "$ref": "#/components/schemas/IntegrationWhen" - } - }, - "required": ["type", "key", "message"], - "additionalProperties": false - }, - "IntegrationSelectPrompt": { - "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/IntegrationWhen" - } - }, - "required": ["type", "key", "message", "options"], - "additionalProperties": false - }, - "IntegrationOAuthMethod": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "type": { - "type": "string", - "enum": ["oauth"] - }, - "label": { - "type": "string" - }, - "prompts": { - "type": "array", - "items": { - "anyOf": [ - { - "$ref": "#/components/schemas/IntegrationTextPrompt" - }, - { - "$ref": "#/components/schemas/IntegrationSelectPrompt" - } - ] - } - } - }, - "required": ["id", "type", "label"], - "additionalProperties": false - }, - "IntegrationKeyMethod": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["key"] - }, - "label": { - "type": "string" - } - }, - "required": ["type"], - "additionalProperties": false - }, - "IntegrationEnvMethod": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["env"] - }, - "names": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": ["type", "names"], - "additionalProperties": false - }, - "ConnectionCredentialInfo": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["credential"] - }, - "id": { - "type": "string" - }, - "label": { - "type": "string" - } - }, - "required": ["type", "id", "label"], - "additionalProperties": false - }, - "ConnectionEnvInfo": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["env"] - }, - "name": { - "type": "string" - } - }, - "required": ["type", "name"], - "additionalProperties": false - }, - "ConnectionInfo": { - "anyOf": [ - { - "$ref": "#/components/schemas/ConnectionCredentialInfo" - }, - { - "$ref": "#/components/schemas/ConnectionEnvInfo" - } - ] - }, - "IntegrationInfo": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "methods": { - "type": "array", - "items": { - "$ref": "#/components/schemas/IntegrationMethod" - } - }, - "connections": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ConnectionInfo" - } - } - }, - "required": ["id", "name", "methods", "connections"], - "additionalProperties": false - }, - "IntegrationAttempt": { - "type": "object", - "properties": { - "attemptID": { - "type": "string" - }, - "url": { - "type": "string" - }, - "instructions": { - "type": "string" - }, - "mode": { - "type": "string", - "enum": ["auto", "code"] - }, - "time": { - "type": "object", - "properties": { - "created": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "string", - "enum": ["NaN"] - }, - { - "type": "string", - "enum": ["Infinity"] - }, - { - "type": "string", - "enum": ["-Infinity"] - }, - { - "type": "string", - "enum": ["Infinity", "-Infinity", "NaN"] - } - ] - }, - "expires": { - "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 - }, - "IntegrationAttemptStatus": { - "anyOf": [ - { - "type": "object", - "properties": { - "status": { - "type": "string", - "enum": ["pending"] - }, - "time": { - "type": "object", - "properties": { - "created": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "string", - "enum": ["NaN"] - }, - { - "type": "string", - "enum": ["Infinity"] - }, - { - "type": "string", - "enum": ["-Infinity"] - }, - { - "type": "string", - "enum": ["Infinity", "-Infinity", "NaN"] - } - ] - }, - "expires": { - "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": [ - { - "type": "number" - }, - { - "type": "string", - "enum": ["NaN"] - }, - { - "type": "string", - "enum": ["Infinity"] - }, - { - "type": "string", - "enum": ["-Infinity"] - }, - { - "type": "string", - "enum": ["Infinity", "-Infinity", "NaN"] - } - ] - }, - "expires": { - "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": [ - { - "type": "number" - }, - { - "type": "string", - "enum": ["NaN"] - }, - { - "type": "string", - "enum": ["Infinity"] - }, - { - "type": "string", - "enum": ["-Infinity"] - }, - { - "type": "string", - "enum": ["Infinity", "-Infinity", "NaN"] - } - ] - }, - "expires": { - "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": [ - { - "type": "number" - }, - { - "type": "string", - "enum": ["NaN"] - }, - { - "type": "string", - "enum": ["Infinity"] - }, - { - "type": "string", - "enum": ["-Infinity"] - }, - { - "type": "string", - "enum": ["Infinity", "-Infinity", "NaN"] - } - ] - }, - "expires": { - "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 - } - ] - }, - "PermissionV2Request": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^per" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "action": { - "type": "string" - }, - "resources": { - "type": "array", - "items": { - "type": "string" - } - }, - "save": { - "type": "array", - "items": { - "type": "string" - } - }, - "metadata": { - "type": "object" - }, - "source": { - "$ref": "#/components/schemas/PermissionV2Source" - } - }, - "required": ["id", "sessionID", "action", "resources"], - "additionalProperties": false - }, - "PermissionSavedInfo": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "projectID": { - "type": "string" - }, - "action": { - "type": "string" - }, - "resource": { - "type": "string" - } - }, - "required": ["id", "projectID", "action", "resource"], - "additionalProperties": false - }, - "FileSystemEntry": { - "type": "object", - "properties": { - "path": { - "type": "string" - }, - "type": { - "type": "string", - "enum": ["file", "directory"] - } - }, - "required": ["path", "type"], - "additionalProperties": false - }, - "CommandV2Info": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "template": { - "type": "string" - }, - "description": { - "type": "string" - }, - "agent": { - "type": "string" - }, - "model": { - "$ref": "#/components/schemas/ModelRef" - }, - "subtask": { - "type": "boolean" - } - }, - "required": ["name", "template"], - "additionalProperties": false - }, - "SkillV2Info": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "slash": { - "type": "boolean" - }, - "location": { - "type": "string" - }, - "content": { - "type": "string" - } - }, - "required": ["name", "location", "content"], - "additionalProperties": false - }, - "Models-devRefreshed": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["models-dev.refreshed"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer" - }, - "version": { - "type": "integer" - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/LocationRef" - }, - "data": { - "type": "object", - "properties": {} - } - }, - "required": ["id", "type", "data"], - "additionalProperties": false - }, - "IntegrationUpdated": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["integration.updated"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer" - }, - "version": { - "type": "integer" - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/LocationRef" - }, - "data": { - "type": "object", - "properties": {} - } - }, - "required": ["id", "type", "data"], - "additionalProperties": false - }, - "IntegrationConnectionUpdated": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["integration.connection.updated"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer" - }, - "version": { - "type": "integer" - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/LocationRef" - }, - "data": { - "type": "object", - "properties": { - "integrationID": { - "type": "string" - } - }, - "required": ["integrationID"], - "additionalProperties": false - } - }, - "required": ["id", "type", "data"], - "additionalProperties": false - }, - "CatalogUpdated": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["catalog.updated"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer" - }, - "version": { - "type": "integer" - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/LocationRef" - }, - "data": { - "type": "object", - "properties": {} - } - }, - "required": ["id", "type", "data"], - "additionalProperties": false - }, - "SessionCreated": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["session.created"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer" - }, - "version": { - "type": "integer" - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/LocationRef" - }, - "data": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "info": { - "$ref": "#/components/schemas/Session" - } - }, - "required": ["sessionID", "info"], - "additionalProperties": false - } - }, - "required": ["id", "type", "data"], - "additionalProperties": false - }, - "SessionUpdated": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["session.updated"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer" - }, - "version": { - "type": "integer" - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/LocationRef" - }, - "data": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "info": { - "$ref": "#/components/schemas/Session" - } - }, - "required": ["sessionID", "info"], - "additionalProperties": false - } - }, - "required": ["id", "type", "data"], - "additionalProperties": false - }, - "SessionDeleted": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["session.deleted"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer" - }, - "version": { - "type": "integer" - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/LocationRef" - }, - "data": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "info": { - "$ref": "#/components/schemas/Session" - } - }, - "required": ["sessionID", "info"], - "additionalProperties": false - } - }, - "required": ["id", "type", "data"], - "additionalProperties": false - }, - "MessageUpdated": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["message.updated"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer" - }, - "version": { - "type": "integer" - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/LocationRef" - }, - "data": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "info": { - "$ref": "#/components/schemas/Message" - } - }, - "required": ["sessionID", "info"], - "additionalProperties": false - } - }, - "required": ["id", "type", "data"], - "additionalProperties": false - }, - "MessageRemoved": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["message.removed"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer" - }, - "version": { - "type": "integer" - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/LocationRef" - }, - "data": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "messageID": { - "type": "string", - "pattern": "^msg" - } - }, - "required": ["sessionID", "messageID"], - "additionalProperties": false - } - }, - "required": ["id", "type", "data"], - "additionalProperties": false - }, - "MessagePartUpdated": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["message.part.updated"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer" - }, - "version": { - "type": "integer" - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/LocationRef" - }, - "data": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "part": { - "$ref": "#/components/schemas/Part" - }, - "time": { - "type": "number" - } - }, - "required": ["sessionID", "part", "time"], - "additionalProperties": false - } - }, - "required": ["id", "type", "data"], - "additionalProperties": false - }, - "MessagePartRemoved": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["message.part.removed"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer" - }, - "version": { - "type": "integer" - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/LocationRef" - }, - "data": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "messageID": { - "type": "string", - "pattern": "^msg" - }, - "partID": { - "type": "string", - "pattern": "^prt" - } - }, - "required": ["sessionID", "messageID", "partID"], - "additionalProperties": false - } - }, - "required": ["id", "type", "data"], - "additionalProperties": false - }, - "SessionNextTextDelta": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["session.next.text.delta"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer" - }, - "version": { - "type": "integer" - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/LocationRef" - }, - "data": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "assistantMessageID": { - "type": "string", - "pattern": "^msg_" - }, - "textID": { - "type": "string" - }, - "delta": { - "type": "string" - } - }, - "required": ["timestamp", "sessionID", "assistantMessageID", "textID", "delta"], - "additionalProperties": false - } - }, - "required": ["id", "type", "data"], - "additionalProperties": false - }, - "SessionNextReasoningDelta": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["session.next.reasoning.delta"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer" - }, - "version": { - "type": "integer" - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/LocationRef" - }, - "data": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "assistantMessageID": { - "type": "string", - "pattern": "^msg_" - }, - "reasoningID": { - "type": "string" - }, - "delta": { - "type": "string" - } - }, - "required": ["timestamp", "sessionID", "assistantMessageID", "reasoningID", "delta"], - "additionalProperties": false - } - }, - "required": ["id", "type", "data"], - "additionalProperties": false - }, - "SessionNextToolInputDelta": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["session.next.tool.input.delta"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer" - }, - "version": { - "type": "integer" - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/LocationRef" - }, - "data": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "assistantMessageID": { - "type": "string", - "pattern": "^msg_" - }, - "callID": { - "type": "string" - }, - "delta": { - "type": "string" - } - }, - "required": ["timestamp", "sessionID", "assistantMessageID", "callID", "delta"], - "additionalProperties": false - } - }, - "required": ["id", "type", "data"], - "additionalProperties": false - }, - "SessionNextCompactionDelta": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["session.next.compaction.delta"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer" - }, - "version": { - "type": "integer" - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/LocationRef" - }, - "data": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "messageID": { - "type": "string", - "pattern": "^msg_" - }, - "text": { - "type": "string" - } - }, - "required": ["timestamp", "sessionID", "messageID", "text"], - "additionalProperties": false - } - }, - "required": ["id", "type", "data"], - "additionalProperties": false - }, - "MessagePartDelta": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["message.part.delta"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer" - }, - "version": { - "type": "integer" - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/LocationRef" - }, - "data": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "messageID": { - "type": "string", - "pattern": "^msg" - }, - "partID": { - "type": "string", - "pattern": "^prt" - }, - "field": { - "type": "string" - }, - "delta": { - "type": "string" - } - }, - "required": ["sessionID", "messageID", "partID", "field", "delta"], - "additionalProperties": false - } - }, - "required": ["id", "type", "data"], - "additionalProperties": false - }, - "SessionDiff": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["session.diff"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer" - }, - "version": { - "type": "integer" - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/LocationRef" - }, - "data": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "diff": { - "type": "array", - "items": { - "$ref": "#/components/schemas/SnapshotFileDiff" - } - } - }, - "required": ["sessionID", "diff"], - "additionalProperties": false - } - }, - "required": ["id", "type", "data"], - "additionalProperties": false - }, - "SessionError": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["session.error"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer" - }, - "version": { - "type": "integer" - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/LocationRef" - }, - "data": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "error": { - "anyOf": [ - { - "$ref": "#/components/schemas/ProviderAuthError" - }, - { - "$ref": "#/components/schemas/UnknownError" - }, - { - "$ref": "#/components/schemas/MessageOutputLengthError" - }, - { - "$ref": "#/components/schemas/MessageAbortedError" - }, - { - "$ref": "#/components/schemas/StructuredOutputError" - }, - { - "$ref": "#/components/schemas/ContextOverflowError" - }, - { - "$ref": "#/components/schemas/ContentFilterError" - }, - { - "$ref": "#/components/schemas/APIError" - } - ] - } - }, - "additionalProperties": false - } - }, - "required": ["id", "type", "data"], - "additionalProperties": false - }, - "InstallationUpdated": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["installation.updated"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer" - }, - "version": { - "type": "integer" - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/LocationRef" - }, - "data": { - "type": "object", - "properties": { - "version": { - "type": "string" - } - }, - "required": ["version"], - "additionalProperties": false - } - }, - "required": ["id", "type", "data"], - "additionalProperties": false - }, - "InstallationUpdate-available": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["installation.update-available"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer" - }, - "version": { - "type": "integer" - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/LocationRef" - }, - "data": { - "type": "object", - "properties": { - "version": { - "type": "string" - } - }, - "required": ["version"], - "additionalProperties": false - } - }, - "required": ["id", "type", "data"], - "additionalProperties": false - }, - "FileEdited": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["file.edited"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer" - }, - "version": { - "type": "integer" - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/LocationRef" - }, - "data": { - "type": "object", - "properties": { - "file": { - "type": "string" - } - }, - "required": ["file"], - "additionalProperties": false - } - }, - "required": ["id", "type", "data"], - "additionalProperties": false - }, - "ReferenceUpdated": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["reference.updated"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer" - }, - "version": { - "type": "integer" - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/LocationRef" - }, - "data": { - "type": "object", - "properties": {} - } - }, - "required": ["id", "type", "data"], - "additionalProperties": false - }, - "PermissionV2Asked": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["permission.v2.asked"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer" - }, - "version": { - "type": "integer" - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/LocationRef" - }, - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^per" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "action": { - "type": "string" - }, - "resources": { - "type": "array", - "items": { - "type": "string" - } - }, - "save": { - "type": "array", - "items": { - "type": "string" - } - }, - "metadata": { - "type": "object" - }, - "source": { - "$ref": "#/components/schemas/PermissionV2Source" - } - }, - "required": ["id", "sessionID", "action", "resources"], - "additionalProperties": false - } - }, - "required": ["id", "type", "data"], - "additionalProperties": false - }, - "PermissionV2Replied": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["permission.v2.replied"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer" - }, - "version": { - "type": "integer" - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/LocationRef" - }, - "data": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "requestID": { - "type": "string", - "pattern": "^per" - }, - "reply": { - "$ref": "#/components/schemas/PermissionV2Reply" - } - }, - "required": ["sessionID", "requestID", "reply"], - "additionalProperties": false - } - }, - "required": ["id", "type", "data"], - "additionalProperties": false - }, - "PluginAdded": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["plugin.added"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer" - }, - "version": { - "type": "integer" - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/LocationRef" - }, - "data": { - "type": "object", - "properties": { - "id": { - "type": "string" - } - }, - "required": ["id"], - "additionalProperties": false - } - }, - "required": ["id", "type", "data"], - "additionalProperties": false - }, - "ProjectDirectoriesUpdated": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["project.directories.updated"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer" - }, - "version": { - "type": "integer" - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/LocationRef" - }, - "data": { - "type": "object", - "properties": { - "projectID": { - "type": "string" - } - }, - "required": ["projectID"], - "additionalProperties": false - } - }, - "required": ["id", "type", "data"], - "additionalProperties": false - }, - "FileWatcherUpdated": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["file.watcher.updated"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer" - }, - "version": { - "type": "integer" - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/LocationRef" - }, - "data": { - "type": "object", - "properties": { - "file": { - "type": "string" - }, - "event": { - "type": "string", - "enum": ["add", "change", "unlink"] - } - }, - "required": ["file", "event"], - "additionalProperties": false - } - }, - "required": ["id", "type", "data"], - "additionalProperties": false - }, - "PtyCreated": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["pty.created"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer" - }, - "version": { - "type": "integer" - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/LocationRef" - }, - "data": { - "type": "object", - "properties": { - "info": { - "$ref": "#/components/schemas/Pty" - } - }, - "required": ["info"], - "additionalProperties": false - } - }, - "required": ["id", "type", "data"], - "additionalProperties": false - }, - "PtyUpdated": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["pty.updated"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer" - }, - "version": { - "type": "integer" - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/LocationRef" - }, - "data": { - "type": "object", - "properties": { - "info": { - "$ref": "#/components/schemas/Pty" - } - }, - "required": ["info"], - "additionalProperties": false - } - }, - "required": ["id", "type", "data"], - "additionalProperties": false - }, - "PtyExited": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["pty.exited"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer" - }, - "version": { - "type": "integer" - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/LocationRef" - }, - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^pty" - }, - "exitCode": { - "type": "integer", - "minimum": 0 - } - }, - "required": ["id", "exitCode"], - "additionalProperties": false - } - }, - "required": ["id", "type", "data"], - "additionalProperties": false - }, - "PtyDeleted": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["pty.deleted"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer" - }, - "version": { - "type": "integer" - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/LocationRef" - }, - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^pty" - } - }, - "required": ["id"], - "additionalProperties": false - } - }, - "required": ["id", "type", "data"], - "additionalProperties": false - }, - "QuestionV2Asked": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["question.v2.asked"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer" - }, - "version": { - "type": "integer" - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/LocationRef" - }, - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^que" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "questions": { - "type": "array", - "items": { - "$ref": "#/components/schemas/QuestionV2Info" - }, - "description": "Questions to ask" - }, - "tool": { - "$ref": "#/components/schemas/QuestionV2Tool" - } - }, - "required": ["id", "sessionID", "questions"], - "additionalProperties": false - } - }, - "required": ["id", "type", "data"], - "additionalProperties": false - }, - "QuestionV2Replied": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["question.v2.replied"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer" - }, - "version": { - "type": "integer" - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/LocationRef" - }, - "data": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "requestID": { - "type": "string", - "pattern": "^que" - }, - "answers": { - "type": "array", - "items": { - "$ref": "#/components/schemas/QuestionV2Answer" - } - } - }, - "required": ["sessionID", "requestID", "answers"], - "additionalProperties": false - } - }, - "required": ["id", "type", "data"], - "additionalProperties": false - }, - "QuestionV2Rejected": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["question.v2.rejected"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer" - }, - "version": { - "type": "integer" - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/LocationRef" - }, - "data": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "requestID": { - "type": "string", - "pattern": "^que" - } - }, - "required": ["sessionID", "requestID"], - "additionalProperties": false - } - }, - "required": ["id", "type", "data"], - "additionalProperties": false - }, - "LspUpdated": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["lsp.updated"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer" - }, - "version": { - "type": "integer" - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/LocationRef" - }, - "data": { - "type": "object", - "properties": {} - } - }, - "required": ["id", "type", "data"], - "additionalProperties": false - }, - "PermissionAsked": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["permission.asked"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer" - }, - "version": { - "type": "integer" - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/LocationRef" - }, - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^per" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "permission": { - "type": "string" - }, - "patterns": { - "type": "array", - "items": { - "type": "string" - } - }, - "metadata": { - "type": "object" - }, - "always": { - "type": "array", - "items": { - "type": "string" - } - }, - "tool": { - "type": "object", - "properties": { - "messageID": { - "type": "string" - }, - "callID": { - "type": "string" - } - }, - "required": ["messageID", "callID"], - "additionalProperties": false - } - }, - "required": ["id", "sessionID", "permission", "patterns", "metadata", "always"], - "additionalProperties": false - } - }, - "required": ["id", "type", "data"], - "additionalProperties": false - }, - "PermissionReplied": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["permission.replied"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer" - }, - "version": { - "type": "integer" - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/LocationRef" - }, - "data": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "requestID": { - "type": "string", - "pattern": "^per" - }, - "reply": { - "type": "string", - "enum": ["once", "always", "reject"] - } - }, - "required": ["sessionID", "requestID", "reply"], - "additionalProperties": false - } - }, - "required": ["id", "type", "data"], - "additionalProperties": false - }, - "TuiPromptAppend": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["tui.prompt.append"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer" - }, - "version": { - "type": "integer" - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/LocationRef" - }, - "data": { - "type": "object", - "properties": { - "text": { - "type": "string" - } - }, - "required": ["text"], - "additionalProperties": false - } - }, - "required": ["id", "type", "data"], - "additionalProperties": false - }, - "TuiCommandExecute": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["tui.command.execute"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer" - }, - "version": { - "type": "integer" - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/LocationRef" - }, - "data": { - "type": "object", - "properties": { - "command": { - "anyOf": [ - { - "type": "string", - "enum": [ - "session.list", - "session.new", - "session.share", - "session.interrupt", - "session.compact", - "session.page.up", - "session.page.down", - "session.line.up", - "session.line.down", - "session.half.page.up", - "session.half.page.down", - "session.first", - "session.last", - "prompt.clear", - "prompt.submit", - "agent.cycle" - ] - }, - { - "type": "string" - } - ] - } - }, - "required": ["command"], - "additionalProperties": false - } - }, - "required": ["id", "type", "data"], - "additionalProperties": false - }, - "TuiToastShow": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["tui.toast.show"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer" - }, - "version": { - "type": "integer" - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/LocationRef" - }, - "data": { - "type": "object", - "properties": { - "title": { - "type": "string" - }, - "message": { - "type": "string" - }, - "variant": { - "type": "string", - "enum": ["info", "success", "warning", "error"] - }, - "duration": { - "type": "integer", - "exclusiveMinimum": 0 - } - }, - "required": ["message", "variant"], - "additionalProperties": false - } - }, - "required": ["id", "type", "data"], - "additionalProperties": false - }, - "TuiSessionSelect": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["tui.session.select"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer" - }, - "version": { - "type": "integer" - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/LocationRef" - }, - "data": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "pattern": "^ses", - "description": "Session ID to navigate to" - } - }, - "required": ["sessionID"], - "additionalProperties": false - } - }, - "required": ["id", "type", "data"], - "additionalProperties": false - }, - "McpToolsChanged": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["mcp.tools.changed"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer" - }, - "version": { - "type": "integer" - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/LocationRef" - }, - "data": { - "type": "object", - "properties": { - "server": { - "type": "string" - } - }, - "required": ["server"], - "additionalProperties": false - } - }, - "required": ["id", "type", "data"], - "additionalProperties": false - }, - "McpBrowserOpenFailed": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["mcp.browser.open.failed"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer" - }, - "version": { - "type": "integer" - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/LocationRef" - }, - "data": { - "type": "object", - "properties": { - "mcpName": { - "type": "string" - }, - "url": { - "type": "string" - } - }, - "required": ["mcpName", "url"], - "additionalProperties": false - } - }, - "required": ["id", "type", "data"], - "additionalProperties": false - }, - "CommandExecuted": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["command.executed"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer" - }, - "version": { - "type": "integer" - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/LocationRef" - }, - "data": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "arguments": { - "type": "string" - }, - "messageID": { - "type": "string", - "pattern": "^msg" - } - }, - "required": ["name", "sessionID", "arguments", "messageID"], - "additionalProperties": false - } - }, - "required": ["id", "type", "data"], - "additionalProperties": false - }, - "ProjectUpdated": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["project.updated"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer" - }, - "version": { - "type": "integer" - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/LocationRef" - }, - "data": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "worktree": { - "type": "string" - }, - "vcs": { - "$ref": "#/components/schemas/ProjectVcs" - }, - "name": { - "type": "string" - }, - "icon": { - "$ref": "#/components/schemas/ProjectIcon" - }, - "commands": { - "$ref": "#/components/schemas/ProjectCommands" - }, - "time": { - "$ref": "#/components/schemas/ProjectTime" - }, - "sandboxes": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": ["id", "worktree", "time", "sandboxes"], - "additionalProperties": false - } - }, - "required": ["id", "type", "data"], - "additionalProperties": false - }, - "SessionIdle": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["session.idle"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer" - }, - "version": { - "type": "integer" - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/LocationRef" - }, - "data": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "pattern": "^ses" - } - }, - "required": ["sessionID"], - "additionalProperties": false - } - }, - "required": ["id", "type", "data"], - "additionalProperties": false - }, - "QuestionAsked": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["question.asked"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer" - }, - "version": { - "type": "integer" - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/LocationRef" - }, - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^que" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "questions": { - "type": "array", - "items": { - "$ref": "#/components/schemas/QuestionInfo" - }, - "description": "Questions to ask" - }, - "tool": { - "$ref": "#/components/schemas/QuestionTool" - } - }, - "required": ["id", "sessionID", "questions"], - "additionalProperties": false - } - }, - "required": ["id", "type", "data"], - "additionalProperties": false - }, - "SessionCompacted": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["session.compacted"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer" - }, - "version": { - "type": "integer" - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/LocationRef" - }, - "data": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "pattern": "^ses" - } - }, - "required": ["sessionID"], - "additionalProperties": false - } - }, - "required": ["id", "type", "data"], - "additionalProperties": false - }, - "VcsBranchUpdated": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["vcs.branch.updated"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer" - }, - "version": { - "type": "integer" - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/LocationRef" - }, - "data": { - "type": "object", - "properties": { - "branch": { - "type": "string" - } - }, - "additionalProperties": false - } - }, - "required": ["id", "type", "data"], - "additionalProperties": false - }, - "WorkspaceReady": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["workspace.ready"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer" - }, - "version": { - "type": "integer" - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/LocationRef" - }, - "data": { - "type": "object", - "properties": { - "name": { - "type": "string" - } - }, - "required": ["name"], - "additionalProperties": false - } - }, - "required": ["id", "type", "data"], - "additionalProperties": false - }, - "WorkspaceFailed": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["workspace.failed"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer" - }, - "version": { - "type": "integer" - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/LocationRef" - }, - "data": { - "type": "object", - "properties": { - "message": { - "type": "string" - } - }, - "required": ["message"], - "additionalProperties": false - } - }, - "required": ["id", "type", "data"], - "additionalProperties": false - }, - "WorkspaceStatus": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["workspace.status"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer" - }, - "version": { - "type": "integer" - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/LocationRef" - }, - "data": { - "type": "object", - "properties": { - "workspaceID": { - "type": "string", - "pattern": "^wrk" - }, - "status": { - "type": "string", - "enum": ["connected", "connecting", "disconnected", "error"] - } - }, - "required": ["workspaceID", "status"], - "additionalProperties": false - } - }, - "required": ["id", "type", "data"], - "additionalProperties": false - }, - "WorktreeReady": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["worktree.ready"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer" - }, - "version": { - "type": "integer" - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/LocationRef" - }, - "data": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "branch": { - "type": "string" - } - }, - "required": ["name"], - "additionalProperties": false - } - }, - "required": ["id", "type", "data"], - "additionalProperties": false - }, - "WorktreeFailed": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["worktree.failed"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer" - }, - "version": { - "type": "integer" - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/LocationRef" - }, - "data": { - "type": "object", - "properties": { - "message": { - "type": "string" - } - }, - "required": ["message"], - "additionalProperties": false - } - }, - "required": ["id", "type", "data"], - "additionalProperties": false - }, - "ServerConnected": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["server.connected"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer" - }, - "version": { - "type": "integer" - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/LocationRef" - }, - "data": { - "type": "object", - "properties": {} - } - }, - "required": ["id", "type", "data"], - "additionalProperties": false - }, - "GlobalDisposed": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "metadata": { - "type": "object" - }, - "type": { - "type": "string", - "enum": ["global.disposed"] - }, - "durable": { - "type": "object", - "properties": { - "aggregateID": { - "type": "string" - }, - "seq": { - "type": "integer" - }, - "version": { - "type": "integer" - } - }, - "required": ["aggregateID", "seq", "version"], - "additionalProperties": false - }, - "location": { - "$ref": "#/components/schemas/LocationRef" - }, - "data": { - "type": "object", - "properties": {} - } - }, - "required": ["id", "type", "data"], - "additionalProperties": false - }, - "QuestionV2Request": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^que" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "questions": { - "type": "array", - "items": { - "$ref": "#/components/schemas/QuestionV2Info" - }, - "description": "Questions to ask" - }, - "tool": { - "$ref": "#/components/schemas/QuestionV2Tool" - } - }, - "required": ["id", "sessionID", "questions"], - "additionalProperties": false - }, - "QuestionV2Reply": { - "type": "object", - "properties": { - "answers": { - "type": "array", - "items": { - "$ref": "#/components/schemas/QuestionV2Answer" - }, - "description": "User answers in order of questions (each answer is an array of selected labels)" - } - }, - "required": ["answers"], - "additionalProperties": false - }, - "ReferenceLocalSource": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["local"] - }, - "path": { - "type": "string" - }, - "description": { - "type": "string" - }, - "hidden": { - "type": "boolean" - } - }, - "required": ["type", "path"], - "additionalProperties": false - }, - "ReferenceGitSource": { - "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 - }, - "ReferenceSource": { - "anyOf": [ - { - "$ref": "#/components/schemas/ReferenceLocalSource" - }, - { - "$ref": "#/components/schemas/ReferenceGitSource" - } - ] - }, - "ReferenceInfo": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "path": { - "type": "string" - }, - "description": { - "type": "string" - }, - "hidden": { - "type": "boolean" - }, - "source": { - "$ref": "#/components/schemas/ReferenceSource" - } - }, - "required": ["name", "path", "source"], - "additionalProperties": false - }, - "ProjectCopyCopy": { - "type": "object", - "properties": { - "directory": { - "type": "string" - } - }, - "required": ["directory"], - "additionalProperties": false - }, - "EventModels-devRefreshed": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["models-dev.refreshed"] - }, - "properties": { - "type": "object", - "properties": {} - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - "EventIntegrationUpdated": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["integration.updated"] - }, - "properties": { - "type": "object", - "properties": {} - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - "EventIntegrationConnectionUpdated": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["integration.connection.updated"] - }, - "properties": { - "type": "object", - "properties": { - "integrationID": { - "type": "string" - } - }, - "required": ["integrationID"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - "EventCatalogUpdated": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["catalog.updated"] - }, - "properties": { - "type": "object", - "properties": {} - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - "EventSessionCreated": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["session.created"] - }, - "properties": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "info": { - "$ref": "#/components/schemas/Session" - } - }, - "required": ["sessionID", "info"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - "EventSessionUpdated": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["session.updated"] - }, - "properties": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "info": { - "$ref": "#/components/schemas/Session" - } - }, - "required": ["sessionID", "info"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - "EventSessionDeleted": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["session.deleted"] - }, - "properties": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "info": { - "$ref": "#/components/schemas/Session" - } - }, - "required": ["sessionID", "info"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - "EventMessageUpdated": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["message.updated"] - }, - "properties": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "info": { - "$ref": "#/components/schemas/Message" - } - }, - "required": ["sessionID", "info"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - "EventMessageRemoved": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["message.removed"] - }, - "properties": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "messageID": { - "type": "string", - "pattern": "^msg" - } - }, - "required": ["sessionID", "messageID"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - "EventMessagePartUpdated": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["message.part.updated"] - }, - "properties": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "part": { - "$ref": "#/components/schemas/Part" - }, - "time": { - "type": "number" - } - }, - "required": ["sessionID", "part", "time"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - "EventMessagePartRemoved": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["message.part.removed"] - }, - "properties": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "messageID": { - "type": "string", - "pattern": "^msg" - }, - "partID": { - "type": "string", - "pattern": "^prt" - } - }, - "required": ["sessionID", "messageID", "partID"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - "EventSessionNextAgentSwitched": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["session.next.agent.switched"] - }, - "properties": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "messageID": { - "type": "string", - "pattern": "^msg_" - }, - "agent": { - "type": "string" - } - }, - "required": ["timestamp", "sessionID", "messageID", "agent"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - "EventSessionNextModelSwitched": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["session.next.model.switched"] - }, - "properties": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "messageID": { - "type": "string", - "pattern": "^msg_" - }, - "model": { - "$ref": "#/components/schemas/ModelRef" - } - }, - "required": ["timestamp", "sessionID", "messageID", "model"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - "EventSessionNextMoved": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["session.next.moved"] - }, - "properties": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "location": { - "$ref": "#/components/schemas/LocationRef" - }, - "subdirectory": { - "type": "string" - } - }, - "required": ["timestamp", "sessionID", "location"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - "EventSessionNextPrompted": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["session.next.prompted"] - }, - "properties": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "messageID": { - "type": "string", - "pattern": "^msg_" - }, - "prompt": { - "$ref": "#/components/schemas/Prompt" - }, - "delivery": { - "type": "string", - "enum": ["steer", "queue"] - } - }, - "required": ["timestamp", "sessionID", "messageID", "prompt", "delivery"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - "EventSessionNextPromptAdmitted": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["session.next.prompt.admitted"] - }, - "properties": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "messageID": { - "type": "string", - "pattern": "^msg_" - }, - "prompt": { - "$ref": "#/components/schemas/Prompt" - }, - "delivery": { - "type": "string", - "enum": ["steer", "queue"] - } - }, - "required": ["timestamp", "sessionID", "messageID", "prompt", "delivery"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - "EventSessionNextContextUpdated": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["session.next.context.updated"] - }, - "properties": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "messageID": { - "type": "string", - "pattern": "^msg_" - }, - "text": { - "type": "string" - } - }, - "required": ["timestamp", "sessionID", "messageID", "text"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - "EventSessionNextSynthetic": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["session.next.synthetic"] - }, - "properties": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "messageID": { - "type": "string", - "pattern": "^msg_" - }, - "text": { - "type": "string" - } - }, - "required": ["timestamp", "sessionID", "messageID", "text"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - "EventSessionNextShellStarted": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["session.next.shell.started"] - }, - "properties": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "messageID": { - "type": "string", - "pattern": "^msg_" - }, - "callID": { - "type": "string" - }, - "command": { - "type": "string" - } - }, - "required": ["timestamp", "sessionID", "messageID", "callID", "command"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - "EventSessionNextShellEnded": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["session.next.shell.ended"] - }, - "properties": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "callID": { - "type": "string" - }, - "output": { - "type": "string" - } - }, - "required": ["timestamp", "sessionID", "callID", "output"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - "EventSessionNextStepStarted": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["session.next.step.started"] - }, - "properties": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "assistantMessageID": { - "type": "string", - "pattern": "^msg_" - }, - "agent": { - "type": "string" - }, - "model": { - "$ref": "#/components/schemas/ModelRef" - }, - "snapshot": { - "type": "string" - } - }, - "required": ["timestamp", "sessionID", "assistantMessageID", "agent", "model"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - "EventSessionNextStepEnded": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["session.next.step.ended"] - }, - "properties": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "assistantMessageID": { - "type": "string", - "pattern": "^msg_" - }, - "finish": { - "type": "string" - }, - "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 - }, - "snapshot": { - "type": "string" - }, - "files": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": ["timestamp", "sessionID", "assistantMessageID", "finish", "cost", "tokens"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - "EventSessionNextStepFailed": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["session.next.step.failed"] - }, - "properties": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "assistantMessageID": { - "type": "string", - "pattern": "^msg_" - }, - "error": { - "$ref": "#/components/schemas/SessionErrorUnknown" - } - }, - "required": ["timestamp", "sessionID", "assistantMessageID", "error"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - "EventSessionNextTextStarted": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["session.next.text.started"] - }, - "properties": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "assistantMessageID": { - "type": "string", - "pattern": "^msg_" - }, - "textID": { - "type": "string" - } - }, - "required": ["timestamp", "sessionID", "assistantMessageID", "textID"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - "EventSessionNextTextDelta": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["session.next.text.delta"] - }, - "properties": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "assistantMessageID": { - "type": "string", - "pattern": "^msg_" - }, - "textID": { - "type": "string" - }, - "delta": { - "type": "string" - } - }, - "required": ["timestamp", "sessionID", "assistantMessageID", "textID", "delta"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - "EventSessionNextTextEnded": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["session.next.text.ended"] - }, - "properties": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "assistantMessageID": { - "type": "string", - "pattern": "^msg_" - }, - "textID": { - "type": "string" - }, - "text": { - "type": "string" - } - }, - "required": ["timestamp", "sessionID", "assistantMessageID", "textID", "text"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - "EventSessionNextReasoningStarted": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["session.next.reasoning.started"] - }, - "properties": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "assistantMessageID": { - "type": "string", - "pattern": "^msg_" - }, - "reasoningID": { - "type": "string" - }, - "providerMetadata": { - "$ref": "#/components/schemas/LLMProviderMetadata" - } - }, - "required": ["timestamp", "sessionID", "assistantMessageID", "reasoningID"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - "EventSessionNextReasoningDelta": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["session.next.reasoning.delta"] - }, - "properties": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "assistantMessageID": { - "type": "string", - "pattern": "^msg_" - }, - "reasoningID": { - "type": "string" - }, - "delta": { - "type": "string" - } - }, - "required": ["timestamp", "sessionID", "assistantMessageID", "reasoningID", "delta"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - "EventSessionNextReasoningEnded": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["session.next.reasoning.ended"] - }, - "properties": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "assistantMessageID": { - "type": "string", - "pattern": "^msg_" - }, - "reasoningID": { - "type": "string" - }, - "text": { - "type": "string" - }, - "providerMetadata": { - "$ref": "#/components/schemas/LLMProviderMetadata" - } - }, - "required": ["timestamp", "sessionID", "assistantMessageID", "reasoningID", "text"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - "EventSessionNextToolInputStarted": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["session.next.tool.input.started"] - }, - "properties": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "assistantMessageID": { - "type": "string", - "pattern": "^msg_" - }, - "callID": { - "type": "string" - }, - "name": { - "type": "string" - } - }, - "required": ["timestamp", "sessionID", "assistantMessageID", "callID", "name"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - "EventSessionNextToolInputDelta": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["session.next.tool.input.delta"] - }, - "properties": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "assistantMessageID": { - "type": "string", - "pattern": "^msg_" - }, - "callID": { - "type": "string" - }, - "delta": { - "type": "string" - } - }, - "required": ["timestamp", "sessionID", "assistantMessageID", "callID", "delta"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - "EventSessionNextToolInputEnded": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["session.next.tool.input.ended"] - }, - "properties": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "assistantMessageID": { - "type": "string", - "pattern": "^msg_" - }, - "callID": { - "type": "string" - }, - "text": { - "type": "string" - } - }, - "required": ["timestamp", "sessionID", "assistantMessageID", "callID", "text"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - "EventSessionNextToolCalled": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["session.next.tool.called"] - }, - "properties": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "assistantMessageID": { - "type": "string", - "pattern": "^msg_" - }, - "callID": { - "type": "string" - }, - "tool": { - "type": "string" - }, - "input": { - "type": "object" - }, - "provider": { - "type": "object", - "properties": { - "executed": { - "type": "boolean" - }, - "metadata": { - "$ref": "#/components/schemas/LLMProviderMetadata" - } - }, - "required": ["executed"], - "additionalProperties": false - } - }, - "required": ["timestamp", "sessionID", "assistantMessageID", "callID", "tool", "input", "provider"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - "EventSessionNextToolProgress": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["session.next.tool.progress"] - }, - "properties": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "assistantMessageID": { - "type": "string", - "pattern": "^msg_" - }, - "callID": { - "type": "string" - }, - "structured": { - "type": "object" - }, - "content": { - "type": "array", - "items": { - "$ref": "#/components/schemas/LLMToolContent" - } - } - }, - "required": ["timestamp", "sessionID", "assistantMessageID", "callID", "structured", "content"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - "EventSessionNextToolSuccess": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["session.next.tool.success"] - }, - "properties": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "assistantMessageID": { - "type": "string", - "pattern": "^msg_" - }, - "callID": { - "type": "string" - }, - "structured": { - "type": "object" - }, - "content": { - "type": "array", - "items": { - "$ref": "#/components/schemas/LLMToolContent" - } - }, - "outputPaths": { - "type": "array", - "items": { - "type": "string" - } - }, - "result": {}, - "provider": { - "type": "object", - "properties": { - "executed": { - "type": "boolean" - }, - "metadata": { - "$ref": "#/components/schemas/LLMProviderMetadata" - } - }, - "required": ["executed"], - "additionalProperties": false - } - }, - "required": ["timestamp", "sessionID", "assistantMessageID", "callID", "structured", "content", "provider"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - "EventSessionNextToolFailed": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["session.next.tool.failed"] - }, - "properties": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "assistantMessageID": { - "type": "string", - "pattern": "^msg_" - }, - "callID": { - "type": "string" - }, - "error": { - "$ref": "#/components/schemas/SessionErrorUnknown" - }, - "result": {}, - "provider": { - "type": "object", - "properties": { - "executed": { - "type": "boolean" - }, - "metadata": { - "$ref": "#/components/schemas/LLMProviderMetadata" - } - }, - "required": ["executed"], - "additionalProperties": false - } - }, - "required": ["timestamp", "sessionID", "assistantMessageID", "callID", "error", "provider"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - "EventSessionNextRetried": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["session.next.retried"] - }, - "properties": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "attempt": { - "type": "number" - }, - "error": { - "$ref": "#/components/schemas/SessionNextRetry_error" - } - }, - "required": ["timestamp", "sessionID", "attempt", "error"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - "EventSessionNextCompactionStarted": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["session.next.compaction.started"] - }, - "properties": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "messageID": { - "type": "string", - "pattern": "^msg_" - }, - "reason": { - "type": "string", - "enum": ["auto", "manual"] - } - }, - "required": ["timestamp", "sessionID", "messageID", "reason"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - "EventSessionNextCompactionDelta": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["session.next.compaction.delta"] - }, - "properties": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "messageID": { - "type": "string", - "pattern": "^msg_" - }, - "text": { - "type": "string" - } - }, - "required": ["timestamp", "sessionID", "messageID", "text"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - "EventSessionNextCompactionEnded": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["session.next.compaction.ended"] - }, - "properties": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "messageID": { - "type": "string", - "pattern": "^msg_" - }, - "reason": { - "type": "string", - "enum": ["auto", "manual"] - }, - "text": { - "type": "string" - }, - "recent": { - "type": "string" - } - }, - "required": ["timestamp", "sessionID", "messageID", "reason", "text", "recent"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - "EventSessionNextRevertStaged": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["session.next.revert.staged"] - }, - "properties": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "revert": { - "$ref": "#/components/schemas/RevertState" - } - }, - "required": ["timestamp", "sessionID", "revert"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - "EventSessionNextRevertCleared": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["session.next.revert.cleared"] - }, - "properties": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - } - }, - "required": ["timestamp", "sessionID"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - "EventSessionNextRevertCommitted": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["session.next.revert.committed"] - }, - "properties": { - "type": "object", - "properties": { - "timestamp": { - "type": "number" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "messageID": { - "type": "string", - "pattern": "^msg_" - } - }, - "required": ["timestamp", "sessionID", "messageID"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - "EventMessagePartDelta": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["message.part.delta"] - }, - "properties": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "messageID": { - "type": "string", - "pattern": "^msg" - }, - "partID": { - "type": "string", - "pattern": "^prt" - }, - "field": { - "type": "string" - }, - "delta": { - "type": "string" - } - }, - "required": ["sessionID", "messageID", "partID", "field", "delta"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - "EventSessionDiff": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["session.diff"] - }, - "properties": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "diff": { - "type": "array", - "items": { - "$ref": "#/components/schemas/SnapshotFileDiff" - } - } - }, - "required": ["sessionID", "diff"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - "EventSessionError": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["session.error"] - }, - "properties": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "error": { - "anyOf": [ - { - "$ref": "#/components/schemas/ProviderAuthError" - }, - { - "$ref": "#/components/schemas/UnknownError" - }, - { - "$ref": "#/components/schemas/MessageOutputLengthError" - }, - { - "$ref": "#/components/schemas/MessageAbortedError" - }, - { - "$ref": "#/components/schemas/StructuredOutputError" - }, - { - "$ref": "#/components/schemas/ContextOverflowError" - }, - { - "$ref": "#/components/schemas/ContentFilterError" - }, - { - "$ref": "#/components/schemas/APIError" - } - ] - } - }, - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - "EventInstallationUpdated": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["installation.updated"] - }, - "properties": { - "type": "object", - "properties": { - "version": { - "type": "string" - } - }, - "required": ["version"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - "EventInstallationUpdate-available": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["installation.update-available"] - }, - "properties": { - "type": "object", - "properties": { - "version": { - "type": "string" - } - }, - "required": ["version"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - "EventFileEdited": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["file.edited"] - }, - "properties": { - "type": "object", - "properties": { - "file": { - "type": "string" - } - }, - "required": ["file"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - "EventReferenceUpdated": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["reference.updated"] - }, - "properties": { - "type": "object", - "properties": {} - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - "EventPermissionV2Asked": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["permission.v2.asked"] - }, - "properties": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^per" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "action": { - "type": "string" - }, - "resources": { - "type": "array", - "items": { - "type": "string" - } - }, - "save": { - "type": "array", - "items": { - "type": "string" - } - }, - "metadata": { - "type": "object" - }, - "source": { - "$ref": "#/components/schemas/PermissionV2Source" - } - }, - "required": ["id", "sessionID", "action", "resources"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - "EventPermissionV2Replied": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["permission.v2.replied"] - }, - "properties": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "requestID": { - "type": "string", - "pattern": "^per" - }, - "reply": { - "$ref": "#/components/schemas/PermissionV2Reply" - } - }, - "required": ["sessionID", "requestID", "reply"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - "EventPluginAdded": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["plugin.added"] - }, - "properties": { - "type": "object", - "properties": { - "id": { - "type": "string" - } - }, - "required": ["id"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - "EventProjectDirectoriesUpdated": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["project.directories.updated"] - }, - "properties": { - "type": "object", - "properties": { - "projectID": { - "type": "string" - } - }, - "required": ["projectID"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - "EventFileWatcherUpdated": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["file.watcher.updated"] - }, - "properties": { - "type": "object", - "properties": { - "file": { - "type": "string" - }, - "event": { - "type": "string", - "enum": ["add", "change", "unlink"] - } - }, - "required": ["file", "event"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - "EventPtyCreated": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["pty.created"] - }, - "properties": { - "type": "object", - "properties": { - "info": { - "$ref": "#/components/schemas/Pty" - } - }, - "required": ["info"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - "EventPtyUpdated": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["pty.updated"] - }, - "properties": { - "type": "object", - "properties": { - "info": { - "$ref": "#/components/schemas/Pty" - } - }, - "required": ["info"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - "EventPtyExited": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["pty.exited"] - }, - "properties": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^pty" - }, - "exitCode": { - "type": "integer", - "minimum": 0 - } - }, - "required": ["id", "exitCode"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - "EventPtyDeleted": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["pty.deleted"] - }, - "properties": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^pty" - } - }, - "required": ["id"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - "EventQuestionV2Asked": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["question.v2.asked"] - }, - "properties": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^que" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "questions": { - "type": "array", - "items": { - "$ref": "#/components/schemas/QuestionV2Info" - }, - "description": "Questions to ask" - }, - "tool": { - "$ref": "#/components/schemas/QuestionV2Tool" - } - }, - "required": ["id", "sessionID", "questions"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - "EventQuestionV2Replied": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["question.v2.replied"] - }, - "properties": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "requestID": { - "type": "string", - "pattern": "^que" - }, - "answers": { - "type": "array", - "items": { - "$ref": "#/components/schemas/QuestionV2Answer" - } - } - }, - "required": ["sessionID", "requestID", "answers"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - "EventQuestionV2Rejected": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["question.v2.rejected"] - }, - "properties": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "requestID": { - "type": "string", - "pattern": "^que" - } - }, - "required": ["sessionID", "requestID"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - "EventLspUpdated": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["lsp.updated"] - }, - "properties": { - "type": "object", - "properties": {} - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - "EventPermissionAsked": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["permission.asked"] - }, - "properties": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^per" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "permission": { - "type": "string" - }, - "patterns": { - "type": "array", - "items": { - "type": "string" - } - }, - "metadata": { - "type": "object" - }, - "always": { - "type": "array", - "items": { - "type": "string" - } - }, - "tool": { - "type": "object", - "properties": { - "messageID": { - "type": "string" - }, - "callID": { - "type": "string" - } - }, - "required": ["messageID", "callID"], - "additionalProperties": false - } - }, - "required": ["id", "sessionID", "permission", "patterns", "metadata", "always"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - "EventPermissionReplied": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["permission.replied"] - }, - "properties": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "requestID": { - "type": "string", - "pattern": "^per" - }, - "reply": { - "type": "string", - "enum": ["once", "always", "reject"] - } - }, - "required": ["sessionID", "requestID", "reply"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - "EventMcpToolsChanged": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["mcp.tools.changed"] - }, - "properties": { - "type": "object", - "properties": { - "server": { - "type": "string" - } - }, - "required": ["server"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - "EventMcpBrowserOpenFailed": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["mcp.browser.open.failed"] - }, - "properties": { - "type": "object", - "properties": { - "mcpName": { - "type": "string" - }, - "url": { - "type": "string" - } - }, - "required": ["mcpName", "url"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - "EventCommandExecuted": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["command.executed"] - }, - "properties": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "arguments": { - "type": "string" - }, - "messageID": { - "type": "string", - "pattern": "^msg" - } - }, - "required": ["name", "sessionID", "arguments", "messageID"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - "EventProjectUpdated": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["project.updated"] - }, - "properties": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "worktree": { - "type": "string" - }, - "vcs": { - "$ref": "#/components/schemas/ProjectVcs" - }, - "name": { - "type": "string" - }, - "icon": { - "$ref": "#/components/schemas/ProjectIcon" - }, - "commands": { - "$ref": "#/components/schemas/ProjectCommands" - }, - "time": { - "$ref": "#/components/schemas/ProjectTime" - }, - "sandboxes": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": ["id", "worktree", "time", "sandboxes"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - "EventSessionStatus": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["session.status"] - }, - "properties": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "status": { - "$ref": "#/components/schemas/SessionStatus" - } - }, - "required": ["sessionID", "status"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - "EventSessionIdle": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["session.idle"] - }, - "properties": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "pattern": "^ses" - } - }, - "required": ["sessionID"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - "EventQuestionAsked": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["question.asked"] - }, - "properties": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^que" - }, - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "questions": { - "type": "array", - "items": { - "$ref": "#/components/schemas/QuestionInfo" - }, - "description": "Questions to ask" - }, - "tool": { - "$ref": "#/components/schemas/QuestionTool" - } - }, - "required": ["id", "sessionID", "questions"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - "EventQuestionReplied": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["question.replied"] - }, - "properties": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "requestID": { - "type": "string", - "pattern": "^que" - }, - "answers": { - "type": "array", - "items": { - "$ref": "#/components/schemas/QuestionAnswer" - } - } - }, - "required": ["sessionID", "requestID", "answers"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - "EventQuestionRejected": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["question.rejected"] - }, - "properties": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "pattern": "^ses" - }, - "requestID": { - "type": "string", - "pattern": "^que" - } - }, - "required": ["sessionID", "requestID"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - "EventSessionCompacted": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["session.compacted"] - }, - "properties": { - "type": "object", - "properties": { - "sessionID": { - "type": "string", - "pattern": "^ses" - } - }, - "required": ["sessionID"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - "EventVcsBranchUpdated": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["vcs.branch.updated"] - }, - "properties": { - "type": "object", - "properties": { - "branch": { - "type": "string" - } - }, - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - "EventWorkspaceReady": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["workspace.ready"] - }, - "properties": { - "type": "object", - "properties": { - "name": { - "type": "string" - } - }, - "required": ["name"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - "EventWorkspaceFailed": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["workspace.failed"] - }, - "properties": { - "type": "object", - "properties": { - "message": { - "type": "string" - } - }, - "required": ["message"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - "EventWorkspaceStatus": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["workspace.status"] - }, - "properties": { - "type": "object", - "properties": { - "workspaceID": { - "type": "string", - "pattern": "^wrk" - }, - "status": { - "type": "string", - "enum": ["connected", "connecting", "disconnected", "error"] - } - }, - "required": ["workspaceID", "status"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - "EventWorktreeReady": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["worktree.ready"] - }, - "properties": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "branch": { - "type": "string" - } - }, - "required": ["name"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - "EventWorktreeFailed": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["worktree.failed"] - }, - "properties": { - "type": "object", - "properties": { - "message": { - "type": "string" - } - }, - "required": ["message"], - "additionalProperties": false - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - "EventServerConnected": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["server.connected"] - }, - "properties": { - "type": "object", - "properties": {} - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - "EventGlobalDisposed": { - "type": "object", - "properties": { - "id": { - "type": "string", - "pattern": "^evt_" - }, - "type": { - "type": "string", - "enum": ["global.disposed"] - }, - "properties": { - "type": "object", - "properties": {} - } - }, - "required": ["id", "type", "properties"], - "additionalProperties": false - }, - "CredentialOAuth": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["oauth"] - }, - "methodID": { - "type": "string" - }, - "refresh": { - "type": "string" - }, - "access": { - "type": "string" - }, - "expires": { - "type": "integer", - "minimum": 0 - }, - "metadata": { - "type": "object" - } - }, - "required": ["type", "methodID", "refresh", "access", "expires"], - "additionalProperties": false - }, - "CredentialKey": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["key"] - }, - "key": { - "type": "string" - }, - "metadata": { - "type": "object" - } - }, - "required": ["type", "key"], - "additionalProperties": false - }, - "SkillV2DirectorySource": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["directory"] - }, - "path": { - "type": "string" - } - }, - "required": ["type", "path"], - "additionalProperties": false - }, - "SkillV2UrlSource": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["url"] - }, - "url": { - "type": "string" - } - }, - "required": ["type", "url"], - "additionalProperties": false - }, - "SkillV2EmbeddedSource": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": ["embedded"] - }, - "skill": { - "$ref": "#/components/schemas/SkillV2Info" - } - }, - "required": ["type", "skill"], - "additionalProperties": false - }, - "BadRequestError": { - "type": "object", - "required": ["name", "data"], - "properties": { - "name": { - "type": "string", - "enum": ["BadRequest"] - }, - "data": { - "type": "object", - "required": ["message"], - "properties": { - "message": { - "type": "string" - }, - "kind": { - "type": "string", - "enum": ["Params", "Headers", "Query", "Body", "Payload"] - } - } - } - } - } - } - }, - "security": [], - "tags": [ - { - "name": "control", - "description": "Control plane routes." - }, - { - "name": "controlPlane", - "description": "Control-plane orchestration routes." - }, - { - "name": "global", - "description": "Global server routes." - }, - { - "name": "event", - "description": "Instance event stream route." - }, - { - "name": "config", - "description": "Experimental HttpApi config routes." - }, - { - "name": "experimental", - "description": "Experimental HttpApi read-only routes." - }, - { - "name": "file", - "description": "Experimental HttpApi file routes." - }, - { - "name": "instance", - "description": "Experimental HttpApi instance read routes." - }, - { - "name": "mcp", - "description": "Experimental HttpApi MCP routes." - }, - { - "name": "project", - "description": "Experimental HttpApi project routes." - }, - { - "name": "projectCopy", - "description": "Project copy naming routes." - }, - { - "name": "pty", - "description": "Experimental HttpApi PTY routes." - }, - { - "name": "question", - "description": "Question routes." - }, - { - "name": "permission", - "description": "Experimental HttpApi permission routes." - }, - { - "name": "provider", - "description": "Experimental HttpApi provider routes." - }, - { - "name": "session", - "description": "Experimental HttpApi session routes." - }, - { - "name": "sync", - "description": "Experimental HttpApi sync routes." - }, - { - "name": "tui", - "description": "Experimental HttpApi TUI routes." - }, - { - "name": "workspace", - "description": "Experimental HttpApi workspace routes." - }, - { - "name": "opencode HttpApi", - "description": "Experimental HttpApi surface for selected instance routes." - }, - { - "name": "opencode HttpApi", - "description": "Experimental HttpApi surface for selected instance routes." - }, - { - "name": "opencode HttpApi", - "description": "Experimental HttpApi surface for selected instance routes." - }, - { - "name": "sessions", - "description": "Experimental session routes." - }, - { - "name": "messages", - "description": "Experimental message routes." - }, - { - "name": "models", - "description": "Experimental model routes." - }, - { - "name": "providers", - "description": "Experimental provider routes." - }, - { - "name": "integrations", - "description": "Integration discovery and authentication routes." - }, - { - "name": "opencode HttpApi", - "description": "Experimental HttpApi surface for selected instance routes." - }, - { - "name": "permissions", - "description": "Experimental permission routes." - }, - { - "name": "filesystem", - "description": "Experimental location-scoped filesystem routes." - }, - { - "name": "commands", - "description": "Experimental command routes." - }, - { - "name": "skills", - "description": "Experimental skill routes." - }, - { - "name": "events", - "description": "Experimental event stream route." - }, - { - "name": "pty", - "description": "Experimental location-scoped PTY routes." - }, - { - "name": "session questions", - "description": "Experimental session question routes." - }, - { - "name": "reference", - "description": "Location-scoped project references." - }, - { - "name": "projectCopy", - "description": "Project copy management routes." - }, - { - "name": "pty", - "description": "PTY websocket route." - } - ] -} diff --git a/packages/session-ui/package.json b/packages/session-ui/package.json index 3cf74b043b..d1dc8ef35b 100644 --- a/packages/session-ui/package.json +++ b/packages/session-ui/package.json @@ -41,7 +41,7 @@ "@kobalte/core": "catalog:", "@opencode-ai/client": "file:../app/vendor/opencode-ai-client-1.17.13.tgz", "@opencode-ai/core": "workspace:*", - "@opencode-ai/sdk": "workspace:*", + "@opencode-ai/sdk": "1.18.5", "@opencode-ai/ui": "workspace:*", "@pierre/diffs": "catalog:", "@shikijs/stream": "catalog:", diff --git a/packages/slack/package.json b/packages/slack/package.json index 3dd5746db5..525401a53d 100644 --- a/packages/slack/package.json +++ b/packages/slack/package.json @@ -8,7 +8,7 @@ "typecheck": "tsgo --noEmit" }, "dependencies": { - "@opencode-ai/sdk": "workspace:*", + "@opencode-ai/sdk": "1.18.5", "@slack/bolt": "^3.17.1" }, "devDependencies": { diff --git a/packages/www/openapi.json b/packages/www/openapi.json index d430f5d21d..1c8b3dc941 100644 --- a/packages/www/openapi.json +++ b/packages/www/openapi.json @@ -16,36 +16,11 @@ "security": [], "responses": { "200": { - "description": "Success", + "description": "ServiceHealth", "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "healthy": { - "type": "boolean", - "enum": [ - true - ] - }, - "version": { - "type": "string" - }, - "pid": { - "type": "integer", - "allOf": [ - { - "exclusiveMinimum": 0 - } - ] - } - }, - "required": [ - "healthy", - "version", - "pid" - ], - "additionalProperties": false + "$ref": "#/components/schemas/ServiceHealth" } } } @@ -71,10 +46,64 @@ } } }, - "description": "Check whether the API server is ready to accept requests.", + "description": "Report the owning server process and its application status.", "summary": "Check server health" } }, + "/api/service/stop": { + "post": { + "tags": [ + "health" + ], + "operationId": "v2.health.stop", + "parameters": [], + "security": [], + "responses": { + "200": { + "description": "ServiceStopResponse", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ServiceStopResponse" + } + } + } + }, + "400": { + "description": "InvalidRequestError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestError" + } + } + } + }, + "401": { + "description": "UnauthorizedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedError" + } + } + } + } + }, + "description": "Request graceful shutdown of one exact managed server instance.", + "summary": "Stop the managed server", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ServiceStopRequest" + } + } + }, + "required": true + } + } + }, "/api/server": { "get": { "tags": [ @@ -1406,35 +1435,7 @@ "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 + "$ref": "#/components/schemas/Location.Ref" } } }, @@ -1473,7 +1474,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/SessionInput.Admitted" + "$ref": "#/components/schemas/SessionPending.User" } }, "required": [ @@ -1562,8 +1563,23 @@ } ] }, - "prompt": { - "$ref": "#/components/schemas/PromptInput" + "text": { + "type": "string" + }, + "files": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PromptInput.FileAttachment" + } + }, + "agents": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Prompt.AgentAttachment" + } + }, + "metadata": { + "type": "object" }, "delivery": { "anyOf": [ @@ -1591,7 +1607,7 @@ } }, "required": [ - "prompt" + "text" ], "additionalProperties": false } @@ -1632,7 +1648,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/SessionInput.Admitted" + "$ref": "#/components/schemas/SessionPending.User" } }, "required": [ @@ -1953,8 +1969,24 @@ ], "security": [], "responses": { - "204": { - "description": "" + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/SessionPending.Synthetic" + } + }, + "required": [ + "data" + ], + "additionalProperties": false + } + } + } }, "400": { "description": "InvalidRequestError", @@ -1992,9 +2024,19 @@ } } } + }, + "409": { + "description": "ConflictError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConflictError" + } + } + } } }, - "description": "Append a synthetic message to a session and resume execution.", + "description": "Durably admit synthetic session input and schedule execution unless resume is false.", "summary": "Add synthetic message", "requestBody": { "content": { @@ -2002,6 +2044,21 @@ "schema": { "type": "object", "properties": { + "id": { + "anyOf": [ + { + "type": "string", + "allOf": [ + { + "pattern": "^msg_" + } + ] + }, + { + "type": "null" + } + ] + }, "text": { "type": "string" }, @@ -2018,6 +2075,20 @@ "metadata": { "type": "object" }, + "delivery": { + "anyOf": [ + { + "type": "string", + "enum": [ + "steer", + "queue" + ] + }, + { + "type": "null" + } + ] + }, "resume": { "anyOf": [ { @@ -2173,7 +2244,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/SessionInput.Compaction" + "$ref": "#/components/schemas/SessionPending.Compaction" } }, "required": [ @@ -2744,6 +2815,93 @@ "summary": "Get session context" } }, + "/api/session/{sessionID}/pending": { + "get": { + "tags": [ + "session" + ], + "operationId": "v2.session.pending.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/SessionPending.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 durable admitted session work not yet visible in projected history, ordered by admission. Includes unpromoted user and synthetic inputs and unhandled compaction barriers. The runner owns consumption; items disappear once promoted or handled.", + "summary": "List pending session work" + } + }, "/api/session/{sessionID}/instructions/entries": { "get": { "tags": [ @@ -2901,6 +3059,16 @@ } } } + }, + "413": { + "description": "InstructionEntryValueTooLargeError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InstructionEntryValueTooLargeError" + } + } + } } }, "description": "Attach or replace one durable instruction entry. Changes announce as updates at the next step boundary.", @@ -2998,6 +3166,110 @@ "summary": "Remove instruction entry" } }, + "/api/session/{sessionID}/generate": { + "post": { + "tags": [ + "session" + ], + "operationId": "v2.session.generate", + "parameters": [ + { + "name": "sessionID", + "in": "path", + "schema": { + "type": "string", + "allOf": [ + { + "pattern": "^ses" + } + ] + }, + "required": true + } + ], + "security": [], + "responses": { + "200": { + "description": "SessionGenerateResponse", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SessionGenerateResponse" + } + } + } + }, + "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": "Generate transient text from the current session context without mutating session history.", + "summary": "Generate text from session context", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "prompt": { + "type": "string" + } + }, + "required": [ + "prompt" + ], + "additionalProperties": false + } + } + }, + "required": true + } + } + }, "/api/experimental/session/{sessionID}/log": { "get": { "tags": [ @@ -3076,7 +3348,7 @@ "type": "string" }, "data": { - "$ref": "#/components/schemas/SessionLogItemStream" + "$ref": "#/components/schemas/SessionLogItemJsonString" } }, "required": [ @@ -3694,7 +3966,7 @@ } } }, - "description": "Retrieve available models ordered by release date.", + "description": "Retrieve the current snapshot of available models ordered by release date. The snapshot may precede initial plugin settlement.", "summary": "List models" } }, @@ -4395,6 +4667,110 @@ "summary": "Get integration" } }, + "/api/experimental/integration/wellknown": { + "post": { + "tags": [ + "integration" + ], + "operationId": "v2.experimental.integration.wellknown.add", + "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": { + "anyOf": [ + { + "$ref": "#/components/schemas/InvalidRequestError1" + }, + { + "$ref": "#/components/schemas/InvalidRequestError" + } + ] + } + } + } + }, + "401": { + "description": "UnauthorizedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedError" + } + } + } + } + }, + "description": "Discover and persist an experimental wellknown integration source.", + "summary": "Add wellknown integration", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "url": { + "type": "string" + } + }, + "required": [ + "url" + ], + "additionalProperties": false + } + } + }, + "required": true + } + } + }, "/api/integration/{integrationID}/connect/key": { "post": { "tags": [ @@ -4522,7 +4898,7 @@ "tags": [ "integration" ], - "operationId": "v2.integration.connect.oauth", + "operationId": "v2.integration.oauth.connect", "parameters": [ { "name": "integrationID", @@ -4666,13 +5042,21 @@ } } }, - "/api/integration/attempt/{attemptID}": { + "/api/integration/{integrationID}/connect/oauth/{attemptID}": { "get": { "tags": [ "integration" ], - "operationId": "v2.integration.attempt.status", + "operationId": "v2.integration.oauth.status", "parameters": [ + { + "name": "integrationID", + "in": "path", + "schema": { + "type": "string" + }, + "required": true + }, { "name": "attemptID", "in": "path", @@ -4775,8 +5159,16 @@ "tags": [ "integration" ], - "operationId": "v2.integration.attempt.cancel", + "operationId": "v2.integration.oauth.cancel", "parameters": [ + { + "name": "integrationID", + "in": "path", + "schema": { + "type": "string" + }, + "required": true + }, { "name": "attemptID", "in": "path", @@ -4856,13 +5248,21 @@ "summary": "Cancel OAuth connection" } }, - "/api/integration/attempt/{attemptID}/complete": { + "/api/integration/{integrationID}/connect/oauth/{attemptID}/complete": { "post": { "tags": [ "integration" ], - "operationId": "v2.integration.attempt.complete", + "operationId": "v2.integration.oauth.complete", "parameters": [ + { + "name": "integrationID", + "in": "path", + "schema": { + "type": "string" + }, + "required": true + }, { "name": "attemptID", "in": "path", @@ -4972,6 +5372,354 @@ } } }, + "/api/integration/{integrationID}/connect/command": { + "post": { + "tags": [ + "integration" + ], + "operationId": "v2.integration.command.connect", + "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.CommandAttempt" + } + }, + "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 a command authentication attempt.", + "summary": "Begin command connection", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "methodID": { + "type": "string" + }, + "label": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "methodID" + ], + "additionalProperties": false + } + } + }, + "required": true + } + } + }, + "/api/integration/{integrationID}/connect/command/{attemptID}": { + "get": { + "tags": [ + "integration" + ], + "operationId": "v2.integration.command.status", + "parameters": [ + { + "name": "integrationID", + "in": "path", + "schema": { + "type": "string" + }, + "required": true + }, + { + "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.CommandAttemptStatus" + } + }, + "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 and output of a command authentication attempt.", + "summary": "Get command attempt status" + }, + "delete": { + "tags": [ + "integration" + ], + "operationId": "v2.integration.command.cancel", + "parameters": [ + { + "name": "integrationID", + "in": "path", + "schema": { + "type": "string" + }, + "required": true + }, + { + "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 a command authentication attempt and terminate its process.", + "summary": "Cancel command connection" + } + }, "/api/mcp": { "get": { "tags": [ @@ -5073,6 +5821,404 @@ "summary": "List MCP servers" } }, + "/api/mcp/{server}": { + "put": { + "tags": [ + "mcp" + ], + "operationId": "v2.mcp.add", + "parameters": [ + { + "name": "server", + "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": "Add an MCP server at runtime or replace an existing one, connecting it immediately.", + "summary": "Add MCP server", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "config": { + "anyOf": [ + { + "$ref": "#/components/schemas/Mcp.LocalConfig" + }, + { + "$ref": "#/components/schemas/Mcp.RemoteConfig" + } + ] + } + }, + "required": [ + "config" + ], + "additionalProperties": false + } + } + }, + "required": true + } + }, + "delete": { + "tags": [ + "mcp" + ], + "operationId": "v2.mcp.remove", + "parameters": [ + { + "name": "server", + "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" + } + } + } + }, + "404": { + "description": "McpServerNotFoundError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/McpServerNotFoundError" + } + } + } + } + }, + "description": "Stop an MCP server and remove it from the runtime set until restart.", + "summary": "Remove MCP server" + } + }, + "/api/mcp/{server}/connect": { + "post": { + "tags": [ + "mcp" + ], + "operationId": "v2.mcp.connect", + "parameters": [ + { + "name": "server", + "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" + } + } + } + }, + "404": { + "description": "McpServerNotFoundError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/McpServerNotFoundError" + } + } + } + } + }, + "description": "Connect an MCP server at runtime, overriding a disabled configuration until restart.", + "summary": "Connect MCP server" + } + }, + "/api/mcp/{server}/disconnect": { + "post": { + "tags": [ + "mcp" + ], + "operationId": "v2.mcp.disconnect", + "parameters": [ + { + "name": "server", + "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" + } + } + } + }, + "404": { + "description": "McpServerNotFoundError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/McpServerNotFoundError" + } + } + } + } + }, + "description": "Disconnect an MCP server at runtime, removing its tools until reconnected.", + "summary": "Disconnect MCP server" + } + }, "/api/mcp/resource": { "get": { "tags": [ @@ -5648,14 +6794,7 @@ "data": { "type": "array", "items": { - "anyOf": [ - { - "$ref": "#/components/schemas/Form.FormInfo" - }, - { - "$ref": "#/components/schemas/Form.UrlInfo" - } - ] + "$ref": "#/components/schemas/Form.Info" } } }, @@ -5721,14 +6860,7 @@ "data": { "type": "array", "items": { - "anyOf": [ - { - "$ref": "#/components/schemas/Form.FormInfo" - }, - { - "$ref": "#/components/schemas/Form.UrlInfo" - } - ] + "$ref": "#/components/schemas/Form.Info" } } }, @@ -5806,14 +6938,7 @@ "type": "object", "properties": { "data": { - "anyOf": [ - { - "$ref": "#/components/schemas/Form.FormInfo" - }, - { - "$ref": "#/components/schemas/Form.UrlInfo" - } - ] + "$ref": "#/components/schemas/Form.Info" } }, "required": [ @@ -5932,14 +7057,7 @@ "type": "object", "properties": { "data": { - "anyOf": [ - { - "$ref": "#/components/schemas/Form.FormInfo" - }, - { - "$ref": "#/components/schemas/Form.UrlInfo" - } - ] + "$ref": "#/components/schemas/Form.Info" } }, "required": [ @@ -7537,7 +8655,7 @@ "type": "string" }, "data": { - "$ref": "#/components/schemas/V2EventStream" + "$ref": "#/components/schemas/V2EventJsonString" } }, "required": [ @@ -8564,7 +9682,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/Shell1" + "$ref": "#/components/schemas/Shell.Info1" } } }, @@ -8661,7 +9779,7 @@ "$ref": "#/components/schemas/Location.Info" }, "data": { - "$ref": "#/components/schemas/Shell1" + "$ref": "#/components/schemas/Shell.Info1" } }, "required": [ @@ -8806,7 +9924,7 @@ "$ref": "#/components/schemas/Location.Info" }, "data": { - "$ref": "#/components/schemas/Shell1" + "$ref": "#/components/schemas/Shell.Info1" } }, "required": [ @@ -9026,7 +10144,7 @@ "$ref": "#/components/schemas/Location.Info" }, "data": { - "$ref": "#/components/schemas/Shell1" + "$ref": "#/components/schemas/Shell.Info1" } }, "required": [ @@ -10416,10 +11534,286 @@ "description": "Dispose the requested location's cached services so its next use boots them fresh.", "summary": "Evict a loaded location" } + }, + "/api/websearch/provider": { + "get": { + "tags": [ + "websearch" + ], + "operationId": "v2.websearch.providers", + "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/WebSearch.Provider" + } + } + }, + "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": "Return the registered web search providers.", + "summary": "List web search providers" + } + }, + "/api/websearch": { + "post": { + "tags": [ + "websearch" + ], + "operationId": "v2.websearch.query", + "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/WebSearch.Response" + } + }, + "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" + } + } + } + }, + "503": { + "description": "ServiceUnavailableError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ServiceUnavailableError" + } + } + } + } + }, + "description": "Run one web search through the selected provider. Specify a provider to override the configured default.", + "summary": "Search the web", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "query": { + "type": "string" + }, + "providerID": { + "type": "string" + } + }, + "required": [ + "query" + ], + "additionalProperties": false + } + } + }, + "required": true + } + } } }, "components": { "schemas": { + "ServiceHealth": { + "type": "object", + "properties": { + "healthy": { + "type": "boolean", + "enum": [ + true + ] + }, + "version": { + "type": "string" + }, + "pid": { + "type": "integer", + "allOf": [ + { + "exclusiveMinimum": 0 + } + ] + } + }, + "required": [ + "healthy", + "version", + "pid" + ], + "additionalProperties": false + }, "UnauthorizedError": { "type": "object", "properties": { @@ -10478,6 +11872,30 @@ ], "additionalProperties": false }, + "ServiceStopRequest": { + "type": "object", + "properties": { + "instanceID": { + "type": "string" + } + }, + "required": [ + "instanceID" + ], + "additionalProperties": false + }, + "ServiceStopResponse": { + "type": "object", + "properties": { + "accepted": { + "type": "boolean" + } + }, + "required": [ + "accepted" + ], + "additionalProperties": false + }, "Location.Info": { "type": "object", "properties": { @@ -10561,12 +11979,7 @@ "additionalProperties": false }, "Agent.Color": { - "type": "string", - "allOf": [ - { - "pattern": "^#[0-9a-fA-F]{6}$" - } - ] + "type": "string" }, "PermissionV2.Effect": { "type": "string", @@ -11126,30 +12539,6 @@ ], "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": [ @@ -11225,7 +12614,7 @@ ], "additionalProperties": false }, - "Prompt": { + "SessionPending.UserData": { "type": "object", "properties": { "text": { @@ -11242,6 +12631,9 @@ "items": { "$ref": "#/components/schemas/Prompt.AgentAttachment" } + }, + "metadata": { + "type": "object" } }, "required": [ @@ -11249,7 +12641,7 @@ ], "additionalProperties": false }, - "SessionInput.Admitted": { + "SessionPending.User": { "type": "object", "properties": { "admittedSeq": { @@ -11276,8 +12668,17 @@ } ] }, - "prompt": { - "$ref": "#/components/schemas/Prompt" + "timeCreated": { + "type": "number" + }, + "type": { + "type": "string", + "enum": [ + "user" + ] + }, + "data": { + "$ref": "#/components/schemas/SessionPending.UserData" }, "delivery": { "type": "string", @@ -11285,26 +12686,16 @@ "steer", "queue" ] - }, - "timeCreated": { - "type": "number" - }, - "promotedSeq": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] } }, "required": [ "admittedSeq", "id", "sessionID", - "prompt", - "delivery", - "timeCreated" + "timeCreated", + "type", + "data", + "delivery" ], "additionalProperties": false }, @@ -11406,15 +12797,27 @@ ], "additionalProperties": false }, - "SessionInput.Compaction": { + "SessionPending.SyntheticData": { "type": "object", "properties": { - "type": { - "type": "string", - "enum": [ - "compaction" - ] + "text": { + "type": "string" }, + "description": { + "type": "string" + }, + "metadata": { + "type": "object" + } + }, + "required": [ + "text" + ], + "additionalProperties": false + }, + "SessionPending.Synthetic": { + "type": "object", + "properties": { "admittedSeq": { "type": "integer", "allOf": [ @@ -11442,21 +12845,77 @@ "timeCreated": { "type": "number" }, - "handledSeq": { + "type": { + "type": "string", + "enum": [ + "synthetic" + ] + }, + "data": { + "$ref": "#/components/schemas/SessionPending.SyntheticData" + }, + "delivery": { + "type": "string", + "enum": [ + "steer", + "queue" + ] + } + }, + "required": [ + "admittedSeq", + "id", + "sessionID", + "timeCreated", + "type", + "data", + "delivery" + ], + "additionalProperties": false + }, + "SessionPending.Compaction": { + "type": "object", + "properties": { + "admittedSeq": { "type": "integer", "allOf": [ { "minimum": 0 } ] + }, + "id": { + "type": "string", + "allOf": [ + { + "pattern": "^msg_" + } + ] + }, + "sessionID": { + "type": "string", + "allOf": [ + { + "pattern": "^ses" + } + ] + }, + "timeCreated": { + "type": "number" + }, + "type": { + "type": "string", + "enum": [ + "compaction" + ] } }, "required": [ - "type", "admittedSeq", "id", "sessionID", - "timeCreated" + "timeCreated", + "type" ], "additionalProperties": false }, @@ -11968,6 +13427,9 @@ ], "additionalProperties": false }, + "Session.Message.ProviderState": { + "type": "object" + }, "Session.Message.Assistant.Text": { "type": "object", "properties": { @@ -11979,6 +13441,9 @@ }, "text": { "type": "string" + }, + "state": { + "$ref": "#/components/schemas/Session.Message.ProviderState" } }, "required": [ @@ -11987,9 +13452,6 @@ ], "additionalProperties": false }, - "Session.Message.ProviderState": { - "type": "object" - }, "Session.Message.Assistant.Reasoning": { "type": "object", "properties": { @@ -12046,6 +13508,29 @@ ], "additionalProperties": false }, + "Session.Message.ToolState.Running": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "running" + ] + }, + "input": { + "type": "object" + }, + "metadata": { + "type": "object" + } + }, + "required": [ + "status", + "input", + "metadata" + ], + "additionalProperties": false + }, "Tool.TextContent": { "type": "object", "properties": { @@ -12101,36 +13586,6 @@ } ] }, - "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": { @@ -12145,20 +13600,24 @@ }, "content": { "type": "array", + "prefixItems": [ + { + "$ref": "#/components/schemas/LLM.ToolContent" + } + ], + "minItems": 1, "items": { "$ref": "#/components/schemas/LLM.ToolContent" } }, - "structured": { + "metadata": { "type": "object" - }, - "result": {} + } }, "required": [ "status", "input", - "content", - "structured" + "content" ], "additionalProperties": false }, @@ -12190,25 +13649,28 @@ "input": { "type": "object" }, + "error": { + "$ref": "#/components/schemas/Session.StructuredError" + }, "content": { "type": "array", + "prefixItems": [ + { + "$ref": "#/components/schemas/LLM.ToolContent" + } + ], + "minItems": 1, "items": { "$ref": "#/components/schemas/LLM.ToolContent" } }, - "structured": { + "metadata": { "type": "object" - }, - "error": { - "$ref": "#/components/schemas/Session.StructuredError" - }, - "result": {} + } }, "required": [ "status", "input", - "content", - "structured", "error" ], "additionalProperties": false @@ -12644,6 +14106,19 @@ } ] }, + "SessionPending.Info": { + "anyOf": [ + { + "$ref": "#/components/schemas/SessionPending.User" + }, + { + "$ref": "#/components/schemas/SessionPending.Synthetic" + }, + { + "$ref": "#/components/schemas/SessionPending.Compaction" + } + ] + }, "InstructionEntry.Key": { "type": "string", "allOf": [ @@ -12667,6 +14142,54 @@ ], "additionalProperties": false }, + "InstructionEntryValueTooLargeError": { + "type": "object", + "properties": { + "_tag": { + "type": "string", + "enum": [ + "InstructionEntryValueTooLargeError" + ] + }, + "actualBytes": { + "type": "integer" + }, + "maxBytes": { + "type": "integer" + }, + "message": { + "type": "string" + } + }, + "required": [ + "_tag", + "actualBytes", + "maxBytes", + "message" + ], + "additionalProperties": false + }, + "SessionGenerateResponse": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "text": { + "type": "string" + } + }, + "required": [ + "text" + ], + "additionalProperties": false + } + }, + "required": [ + "data" + ], + "additionalProperties": false + }, "session.agent.selected": { "type": "object", "properties": { @@ -12905,6 +14428,9 @@ "location": { "$ref": "#/components/schemas/Location.Ref" }, + "projectID": { + "type": "string" + }, "subpath": { "type": "string" } @@ -13131,7 +14657,7 @@ "version": { "type": "number", "enum": [ - 1 + 2 ] } }, @@ -13164,6 +14690,14 @@ } ] }, + "parentSeq": { + "type": "integer", + "allOf": [ + { + "minimum": -1 + } + ] + }, "from": { "type": "string", "allOf": [ @@ -13175,7 +14709,8 @@ }, "required": [ "sessionID", - "parentID" + "parentID", + "parentSeq" ], "additionalProperties": false } @@ -13189,7 +14724,7 @@ ], "additionalProperties": false }, - "session.prompt.promoted": { + "session.input.promoted": { "type": "object", "properties": { "id": { @@ -13209,7 +14744,7 @@ "type": { "type": "string", "enum": [ - "session.prompt.promoted" + "session.input.promoted" ] }, "durable": { @@ -13279,7 +14814,116 @@ ], "additionalProperties": false }, - "session.prompt.admitted": { + "SessionPending.UserData1": { + "type": "object", + "properties": { + "text": { + "type": "string" + }, + "files": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Prompt.FileAttachment" + } + }, + "agents": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Prompt.AgentAttachment" + } + }, + "metadata": { + "type": "object" + } + }, + "required": [ + "text" + ], + "additionalProperties": false + }, + "SessionPending.UserMessage": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "user" + ] + }, + "data": { + "$ref": "#/components/schemas/SessionPending.UserData1" + }, + "delivery": { + "type": "string", + "enum": [ + "steer", + "queue" + ] + } + }, + "required": [ + "type", + "data", + "delivery" + ], + "additionalProperties": false + }, + "SessionPending.SyntheticData1": { + "type": "object", + "properties": { + "text": { + "type": "string" + }, + "description": { + "type": "string" + }, + "metadata": { + "type": "object" + } + }, + "required": [ + "text" + ], + "additionalProperties": false + }, + "SessionPending.SyntheticMessage": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "synthetic" + ] + }, + "data": { + "$ref": "#/components/schemas/SessionPending.SyntheticData1" + }, + "delivery": { + "type": "string", + "enum": [ + "steer", + "queue" + ] + } + }, + "required": [ + "type", + "data", + "delivery" + ], + "additionalProperties": false + }, + "SessionPending.Message": { + "anyOf": [ + { + "$ref": "#/components/schemas/SessionPending.UserMessage" + }, + { + "$ref": "#/components/schemas/SessionPending.SyntheticMessage" + } + ] + }, + "session.input.admitted": { "type": "object", "properties": { "id": { @@ -13299,7 +14943,7 @@ "type": { "type": "string", "enum": [ - "session.prompt.admitted" + "session.input.admitted" ] }, "durable": { @@ -13352,22 +14996,14 @@ } ] }, - "prompt": { - "$ref": "#/components/schemas/Prompt" - }, - "delivery": { - "type": "string", - "enum": [ - "steer", - "queue" - ] + "input": { + "$ref": "#/components/schemas/SessionPending.Message" } }, "required": [ "sessionID", "inputID", - "prompt", - "delivery" + "input" ], "additionalProperties": false } @@ -13758,7 +15394,7 @@ "version": { "type": "number", "enum": [ - 1 + 2 ] } }, @@ -13783,13 +15419,31 @@ } ] }, - "text": { - "type": "string" + "delta": { + "type": "object", + "additionalProperties": { + "anyOf": [ + { + "type": "string", + "allOf": [ + { + "pattern": "^[a-f0-9]{64}$" + } + ] + }, + { + "type": "string", + "enum": [ + "removed" + ] + } + ] + } } }, "required": [ "sessionID", - "text" + "delta" ], "additionalProperties": false } @@ -13987,7 +15641,7 @@ ], "additionalProperties": false }, - "Shell": { + "Shell.Info": { "type": "object", "properties": { "id": { @@ -14028,29 +15682,7 @@ ] }, "exit": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "string", - "enum": [ - "NaN" - ] - }, - { - "type": "string", - "enum": [ - "Infinity" - ] - }, - { - "type": "string", - "enum": [ - "-Infinity" - ] - } - ] + "type": "number" }, "metadata": { "type": "object" @@ -14059,54 +15691,10 @@ "type": "object", "properties": { "started": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "string", - "enum": [ - "NaN" - ] - }, - { - "type": "string", - "enum": [ - "Infinity" - ] - }, - { - "type": "string", - "enum": [ - "-Infinity" - ] - } - ] + "type": "number" }, "completed": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "string", - "enum": [ - "NaN" - ] - }, - { - "type": "string", - "enum": [ - "Infinity" - ] - }, - { - "type": "string", - "enum": [ - "-Infinity" - ] - } - ] + "type": "number" } }, "required": [ @@ -14193,7 +15781,7 @@ ] }, "shell": { - "$ref": "#/components/schemas/Shell" + "$ref": "#/components/schemas/Shell.Info" } }, "required": [ @@ -14278,7 +15866,7 @@ ] }, "shell": { - "$ref": "#/components/schemas/Shell" + "$ref": "#/components/schemas/Shell.Info" }, "output": { "type": "object", @@ -14633,6 +16221,15 @@ }, "tokens": { "$ref": "#/components/schemas/TokenUsage.Info" + }, + "snapshot": { + "type": "string" + }, + "files": { + "type": "array", + "items": { + "type": "string" + } } }, "required": [ @@ -14751,6 +16348,9 @@ ], "additionalProperties": false }, + "Session.Message.ProviderState4": { + "type": "object" + }, "session.text.ended": { "type": "object", "properties": { @@ -14834,6 +16434,9 @@ }, "text": { "type": "string" + }, + "state": { + "$ref": "#/components/schemas/Session.Message.ProviderState4" } }, "required": [ @@ -14854,7 +16457,7 @@ ], "additionalProperties": false }, - "Session.Message.ProviderState3": { + "Session.Message.ProviderState5": { "type": "object" }, "session.reasoning.started": { @@ -14939,7 +16542,7 @@ ] }, "state": { - "$ref": "#/components/schemas/Session.Message.ProviderState3" + "$ref": "#/components/schemas/Session.Message.ProviderState5" } }, "required": [ @@ -14959,7 +16562,7 @@ ], "additionalProperties": false }, - "Session.Message.ProviderState4": { + "Session.Message.ProviderState6": { "type": "object" }, "session.reasoning.ended": { @@ -15047,7 +16650,7 @@ "type": "string" }, "state": { - "$ref": "#/components/schemas/Session.Message.ProviderState4" + "$ref": "#/components/schemas/Session.Message.ProviderState6" } }, "required": [ @@ -15264,7 +16867,7 @@ ], "additionalProperties": false }, - "Session.Message.ProviderState5": { + "Session.Message.ProviderState7": { "type": "object" }, "session.tool.called": { @@ -15350,7 +16953,7 @@ "type": "boolean" }, "state": { - "$ref": "#/components/schemas/Session.Message.ProviderState5" + "$ref": "#/components/schemas/Session.Message.ProviderState7" } }, "required": [ @@ -15372,112 +16975,7 @@ ], "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": { + "Session.Message.ProviderState8": { "type": "object" }, "session.tool.success": { @@ -15520,7 +17018,7 @@ "version": { "type": "number", "enum": [ - 1 + 2 ] } }, @@ -15556,28 +17054,32 @@ "callID": { "type": "string" }, - "structured": { - "type": "object" - }, "content": { "type": "array", + "prefixItems": [ + { + "$ref": "#/components/schemas/LLM.ToolContent" + } + ], + "minItems": 1, "items": { "$ref": "#/components/schemas/LLM.ToolContent" } }, - "result": {}, + "metadata": { + "type": "object" + }, "executed": { "type": "boolean" }, "resultState": { - "$ref": "#/components/schemas/Session.Message.ProviderState6" + "$ref": "#/components/schemas/Session.Message.ProviderState8" } }, "required": [ "sessionID", "assistantMessageID", "callID", - "structured", "content", "executed" ], @@ -15593,7 +17095,7 @@ ], "additionalProperties": false }, - "Session.Message.ProviderState7": { + "Session.Message.ProviderState9": { "type": "object" }, "session.tool.failed": { @@ -15636,7 +17138,7 @@ "version": { "type": "number", "enum": [ - 1 + 2 ] } }, @@ -15675,12 +17177,26 @@ "error": { "$ref": "#/components/schemas/Session.StructuredError" }, - "result": {}, + "content": { + "type": "array", + "prefixItems": [ + { + "$ref": "#/components/schemas/LLM.ToolContent" + } + ], + "minItems": 1, + "items": { + "$ref": "#/components/schemas/LLM.ToolContent" + } + }, + "metadata": { + "type": "object" + }, "executed": { "type": "boolean" }, "resultState": { - "$ref": "#/components/schemas/Session.Message.ProviderState7" + "$ref": "#/components/schemas/Session.Message.ProviderState9" } }, "required": [ @@ -16459,6 +17975,103 @@ ], "additionalProperties": false }, + "session.usage.recorded": { + "type": "object", + "properties": { + "id": { + "type": "string", + "allOf": [ + { + "pattern": "^evt_" + } + ] + }, + "created": { + "type": "number" + }, + "metadata": { + "type": "object" + }, + "type": { + "type": "string", + "enum": [ + "session.usage.recorded" + ] + }, + "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" + } + ] + }, + "source": { + "type": "string", + "enum": [ + "title", + "compaction" + ] + }, + "cost": { + "$ref": "#/components/schemas/Money.USD" + }, + "tokens": { + "$ref": "#/components/schemas/TokenUsage.Info" + } + }, + "required": [ + "sessionID", + "source", + "cost", + "tokens" + ], + "additionalProperties": false + } + }, + "required": [ + "id", + "created", + "type", + "durable", + "data" + ], + "additionalProperties": false + }, "Session.Event.Durable": { "oneOf": [ { @@ -16480,10 +18093,10 @@ "$ref": "#/components/schemas/session.forked" }, { - "$ref": "#/components/schemas/session.prompt.promoted" + "$ref": "#/components/schemas/session.input.promoted" }, { - "$ref": "#/components/schemas/session.prompt.admitted" + "$ref": "#/components/schemas/session.input.admitted" }, { "$ref": "#/components/schemas/session.execution.started" @@ -16542,9 +18155,6 @@ { "$ref": "#/components/schemas/session.tool.called" }, - { - "$ref": "#/components/schemas/session.tool.progress" - }, { "$ref": "#/components/schemas/session.tool.success" }, @@ -16574,6 +18184,9 @@ }, { "$ref": "#/components/schemas/session.revert.committed" + }, + { + "$ref": "#/components/schemas/session.usage.recorded" } ] }, @@ -16615,7 +18228,7 @@ } ] }, - "SessionLogItemStream": { + "SessionLogItemJsonString": { "type": "string", "contentSchema": { "$ref": "#/components/schemas/SessionLogItem" @@ -16664,6 +18277,30 @@ ], "additionalProperties": false }, + "Model.ReasoningField": { + "anyOf": [ + { + "type": "string", + "enum": [ + "reasoning", + "reasoning_content", + "reasoning_text" + ] + }, + { + "type": "string" + } + ] + }, + "Model.Compatibility": { + "type": "object", + "properties": { + "reasoningField": { + "$ref": "#/components/schemas/Model.ReasoningField" + } + }, + "additionalProperties": false + }, "Model.Capabilities": { "type": "object", "properties": { @@ -16787,6 +18424,9 @@ "name": { "type": "string" }, + "compatibility": { + "$ref": "#/components/schemas/Model.Compatibility" + }, "package": { "type": "string" }, @@ -17096,6 +18736,36 @@ ], "additionalProperties": false }, + "Integration.CommandMethod": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "command" + ] + }, + "label": { + "type": "string" + }, + "command": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "id", + "type", + "label", + "command" + ], + "additionalProperties": false + }, "Integration.KeyMethod": { "type": "object", "properties": { @@ -17141,6 +18811,9 @@ { "$ref": "#/components/schemas/Integration.OAuthMethod" }, + { + "$ref": "#/components/schemas/Integration.CommandMethod" + }, { "$ref": "#/components/schemas/Integration.KeyMethod" }, @@ -17752,6 +19425,514 @@ } ] }, + "Integration.CommandAttempt": { + "type": "object", + "properties": { + "attemptID": { + "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": [ + "attemptID", + "time" + ], + "additionalProperties": false + }, + "Integration.CommandAttemptStatus": { + "anyOf": [ + { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "pending" + ] + }, + "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", + "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": { @@ -17888,6 +20069,305 @@ ], "additionalProperties": false }, + "Mcp.TimeoutConfig": { + "type": "object", + "properties": { + "startup": { + "anyOf": [ + { + "type": "integer", + "allOf": [ + { + "exclusiveMinimum": 0 + } + ] + }, + { + "type": "null" + } + ], + "description": "Maximum time in milliseconds to establish and initialize the MCP server." + }, + "catalog": { + "anyOf": [ + { + "type": "integer", + "allOf": [ + { + "exclusiveMinimum": 0 + } + ] + }, + { + "type": "null" + } + ], + "description": "Maximum time in milliseconds to wait for MCP discovery requests such as tools/list and prompts/list." + }, + "execution": { + "anyOf": [ + { + "type": "integer", + "allOf": [ + { + "exclusiveMinimum": 0 + } + ] + }, + { + "type": "null" + } + ], + "description": "Maximum time in milliseconds to wait for MCP tool and prompt execution." + } + }, + "additionalProperties": false + }, + "Mcp.LocalConfig": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "local" + ] + }, + "command": { + "type": "array", + "items": { + "type": "string" + } + }, + "cwd": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Working directory for the MCP server process. Relative paths resolve from the workspace directory." + }, + "environment": { + "anyOf": [ + { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + { + "type": "null" + } + ] + }, + "disabled": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + }, + "codemode": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "description": "Expose this server's tools through Code Mode. Defaults to true." + }, + "timeout": { + "anyOf": [ + { + "$ref": "#/components/schemas/Mcp.TimeoutConfig" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "type", + "command" + ], + "additionalProperties": false + }, + "Mcp.OAuthConfig": { + "type": "object", + "properties": { + "client_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "client_secret": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "scope": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "callback_port": { + "anyOf": [ + { + "type": "integer", + "allOf": [ + { + "minimum": 1, + "maximum": 65535 + } + ] + }, + { + "type": "null" + } + ] + }, + "redirect_uri": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false + }, + "Mcp.RemoteConfig": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "remote" + ] + }, + "url": { + "type": "string" + }, + "headers": { + "anyOf": [ + { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + { + "type": "null" + } + ] + }, + "oauth": { + "anyOf": [ + { + "anyOf": [ + { + "$ref": "#/components/schemas/Mcp.OAuthConfig" + }, + { + "type": "boolean", + "enum": [ + false + ] + } + ] + }, + { + "type": "null" + } + ] + }, + "disabled": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + }, + "codemode": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "description": "Expose this server's tools through Code Mode. Defaults to true." + }, + "timeout": { + "anyOf": [ + { + "$ref": "#/components/schemas/Mcp.TimeoutConfig" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "type", + "url" + ], + "additionalProperties": false + }, + "McpServerNotFoundError": { + "type": "object", + "properties": { + "_tag": { + "type": "string", + "enum": [ + "McpServerNotFoundError" + ] + }, + "server": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "required": [ + "_tag", + "server", + "message" + ], + "additionalProperties": false + }, "Mcp.Resource": { "type": "object", "properties": { @@ -18664,100 +21144,98 @@ ], "additionalProperties": false }, - "Form.FormInfo": { + "Form.ExternalField": { "type": "object", "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^frm_" - } - ] - }, - "sessionID": { + "key": { "type": "string" }, - "title": { - "type": "string" - }, - "metadata": { - "$ref": "#/components/schemas/Form.Metadata" - }, - "mode": { + "type": { "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" + "external" ] }, "url": { "type": "string" + }, + "title": { + "type": "string" + }, + "description": { + "type": "string" + } + }, + "required": [ + "key", + "type", + "url" + ], + "additionalProperties": false + }, + "Form.Field": { + "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" + }, + { + "$ref": "#/components/schemas/Form.ExternalField" + } + ] + }, + "Form.Fields": { + "type": "array", + "prefixItems": [ + { + "$ref": "#/components/schemas/Form.Field" + } + ], + "minItems": 1, + "items": { + "$ref": "#/components/schemas/Form.Field" + } + }, + "Form.Info": { + "type": "object", + "properties": { + "id": { + "type": "string", + "allOf": [ + { + "pattern": "^frm_" + } + ] + }, + "sessionID": { + "type": "string" + }, + "title": { + "type": "string" + }, + "metadata": { + "$ref": "#/components/schemas/Form.Metadata" + }, + "fields": { + "$ref": "#/components/schemas/Form.Fields" } }, "required": [ "id", "sessionID", "title", - "mode", - "url" + "fields" ], "additionalProperties": false }, @@ -18785,56 +21263,13 @@ "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" - } - ] + "$ref": "#/components/schemas/Form.Fields" } }, "required": [ "title", - "mode" + "fields" ], "additionalProperties": false }, @@ -22811,6 +25246,75 @@ ], "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" + ] + }, + "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" + }, + "metadata": { + "type": "object" + } + }, + "required": [ + "sessionID", + "assistantMessageID", + "callID", + "metadata" + ], + "additionalProperties": false + } + }, + "required": [ + "id", + "created", + "type", + "data" + ], + "additionalProperties": false + }, "session.compaction.delta": { "type": "object", "properties": { @@ -23689,7 +26193,7 @@ "type": "object", "properties": { "info": { - "$ref": "#/components/schemas/Shell" + "$ref": "#/components/schemas/Shell.Info" } }, "required": [ @@ -23744,29 +26248,7 @@ ] }, "exit": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "string", - "enum": [ - "NaN" - ] - }, - { - "type": "string", - "enum": [ - "Infinity" - ] - }, - { - "type": "string", - "enum": [ - "-Infinity" - ] - } - ] + "type": "number" }, "status": { "type": "string", @@ -24575,7 +27057,41 @@ ], "additionalProperties": false }, - "Form.FormInfo1": { + "Form.Field1": { + "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" + }, + { + "$ref": "#/components/schemas/Form.ExternalField" + } + ] + }, + "Form.Fields1": { + "type": "array", + "prefixItems": [ + { + "$ref": "#/components/schemas/Form.Field1" + } + ], + "minItems": 1, + "items": { + "$ref": "#/components/schemas/Form.Field1" + } + }, + "Form.Info1": { "type": "object", "properties": { "id": { @@ -24595,83 +27111,18 @@ "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" - } - ] - } + "$ref": "#/components/schemas/Form.Fields1" } }, "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": { @@ -24702,14 +27153,7 @@ "type": "object", "properties": { "form": { - "anyOf": [ - { - "$ref": "#/components/schemas/Form.FormInfo1" - }, - { - "$ref": "#/components/schemas/Form.UrlInfo1" - } - ] + "$ref": "#/components/schemas/Form.Info1" } }, "required": [ @@ -24889,6 +27333,51 @@ ], "additionalProperties": false }, + "websearch.updated": { + "type": "object", + "properties": { + "id": { + "type": "string", + "allOf": [ + { + "pattern": "^evt_" + } + ] + }, + "created": { + "type": "number" + }, + "metadata": { + "type": "object" + }, + "type": { + "type": "string", + "enum": [ + "websearch.updated" + ] + }, + "location": { + "$ref": "#/components/schemas/Location.Ref" + }, + "data": { + "anyOf": [ + { + "type": "object" + }, + { + "type": "array" + } + ] + } + }, + "required": [ + "id", + "created", + "type", + "data" + ], + "additionalProperties": false + }, "SessionStatus": { "anyOf": [ { @@ -26262,10 +28751,10 @@ "$ref": "#/components/schemas/session.forked" }, { - "$ref": "#/components/schemas/session.prompt.promoted" + "$ref": "#/components/schemas/session.input.promoted" }, { - "$ref": "#/components/schemas/session.prompt.admitted" + "$ref": "#/components/schemas/session.input.admitted" }, { "$ref": "#/components/schemas/session.execution.started" @@ -26438,6 +28927,9 @@ { "$ref": "#/components/schemas/form.cancelled" }, + { + "$ref": "#/components/schemas/websearch.updated" + }, { "$ref": "#/components/schemas/session.status" }, @@ -26494,7 +28986,7 @@ } ] }, - "V2EventStream": { + "V2EventJsonString": { "type": "string", "contentSchema": { "$ref": "#/components/schemas/V2Event" @@ -26564,7 +29056,7 @@ ], "additionalProperties": false }, - "Shell1": { + "Shell.Info1": { "type": "object", "properties": { "id": { @@ -26605,41 +29097,7 @@ ] }, "exit": { - "anyOf": [ - { - "anyOf": [ - { - "type": "number" - }, - { - "type": "string", - "enum": [ - "NaN" - ] - }, - { - "type": "string", - "enum": [ - "Infinity" - ] - }, - { - "type": "string", - "enum": [ - "-Infinity" - ] - } - ] - }, - { - "type": "string", - "enum": [ - "Infinity", - "-Infinity", - "NaN" - ] - } - ] + "type": "number" }, "metadata": { "type": "object" @@ -26648,78 +29106,10 @@ "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" - ] - } - ] + "type": "number" }, "completed": { - "anyOf": [ - { - "anyOf": [ - { - "type": "number" - }, - { - "type": "string", - "enum": [ - "NaN" - ] - }, - { - "type": "string", - "enum": [ - "Infinity" - ] - }, - { - "type": "string", - "enum": [ - "-Infinity" - ] - } - ] - }, - { - "type": "string", - "enum": [ - "Infinity", - "-Infinity", - "NaN" - ] - } - ] + "type": "number" } }, "required": [ @@ -27023,6 +29413,69 @@ "working", "branch" ] + }, + "WebSearch.Provider": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "required": [ + "id", + "name" + ], + "additionalProperties": false + }, + "WebSearch.Result": { + "type": "object", + "properties": { + "url": { + "type": "string" + }, + "title": { + "type": "string" + }, + "content": { + "type": "string" + }, + "time": { + "type": "object", + "properties": { + "published": { + "type": "number" + } + }, + "additionalProperties": false + } + }, + "required": [ + "url", + "time" + ], + "additionalProperties": false + }, + "WebSearch.Response": { + "type": "object", + "properties": { + "providerID": { + "type": "string" + }, + "results": { + "type": "array", + "items": { + "$ref": "#/components/schemas/WebSearch.Result" + } + } + }, + "required": [ + "providerID", + "results" + ], + "additionalProperties": false } }, "securitySchemes": {} @@ -27130,6 +29583,10 @@ }, { "name": "debug" + }, + { + "name": "websearch", + "description": "Location-scoped web search routes." } ] } diff --git a/packages/www/package.json b/packages/www/package.json index e55370a9eb..1774df1035 100644 --- a/packages/www/package.json +++ b/packages/www/package.json @@ -7,8 +7,8 @@ "dev": "bun run generate && blume dev --host --port 3000", "build": "bun run generate && blume build && bun script/prepare-cloudflare.ts", "deploy": "wrangler deploy --config dist/server/wrangler.json", - "generate": "bun script/generate-theme-tokens.ts", - "check:generated": "bun script/generate-theme-tokens.ts --check", + "generate": "bun script/generate-theme-tokens.ts && bun script/generate-openapi.ts", + "check:generated": "bun script/generate-theme-tokens.ts --check && bun script/generate-openapi.ts --check", "typecheck": "blume check", "validate": "blume validate", "doctor": "blume doctor" diff --git a/packages/www/public/openapi.json b/packages/www/public/openapi.json index d430f5d21d..1c8b3dc941 100644 --- a/packages/www/public/openapi.json +++ b/packages/www/public/openapi.json @@ -16,36 +16,11 @@ "security": [], "responses": { "200": { - "description": "Success", + "description": "ServiceHealth", "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "healthy": { - "type": "boolean", - "enum": [ - true - ] - }, - "version": { - "type": "string" - }, - "pid": { - "type": "integer", - "allOf": [ - { - "exclusiveMinimum": 0 - } - ] - } - }, - "required": [ - "healthy", - "version", - "pid" - ], - "additionalProperties": false + "$ref": "#/components/schemas/ServiceHealth" } } } @@ -71,10 +46,64 @@ } } }, - "description": "Check whether the API server is ready to accept requests.", + "description": "Report the owning server process and its application status.", "summary": "Check server health" } }, + "/api/service/stop": { + "post": { + "tags": [ + "health" + ], + "operationId": "v2.health.stop", + "parameters": [], + "security": [], + "responses": { + "200": { + "description": "ServiceStopResponse", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ServiceStopResponse" + } + } + } + }, + "400": { + "description": "InvalidRequestError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequestError" + } + } + } + }, + "401": { + "description": "UnauthorizedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedError" + } + } + } + } + }, + "description": "Request graceful shutdown of one exact managed server instance.", + "summary": "Stop the managed server", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ServiceStopRequest" + } + } + }, + "required": true + } + } + }, "/api/server": { "get": { "tags": [ @@ -1406,35 +1435,7 @@ "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 + "$ref": "#/components/schemas/Location.Ref" } } }, @@ -1473,7 +1474,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/SessionInput.Admitted" + "$ref": "#/components/schemas/SessionPending.User" } }, "required": [ @@ -1562,8 +1563,23 @@ } ] }, - "prompt": { - "$ref": "#/components/schemas/PromptInput" + "text": { + "type": "string" + }, + "files": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PromptInput.FileAttachment" + } + }, + "agents": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Prompt.AgentAttachment" + } + }, + "metadata": { + "type": "object" }, "delivery": { "anyOf": [ @@ -1591,7 +1607,7 @@ } }, "required": [ - "prompt" + "text" ], "additionalProperties": false } @@ -1632,7 +1648,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/SessionInput.Admitted" + "$ref": "#/components/schemas/SessionPending.User" } }, "required": [ @@ -1953,8 +1969,24 @@ ], "security": [], "responses": { - "204": { - "description": "" + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/SessionPending.Synthetic" + } + }, + "required": [ + "data" + ], + "additionalProperties": false + } + } + } }, "400": { "description": "InvalidRequestError", @@ -1992,9 +2024,19 @@ } } } + }, + "409": { + "description": "ConflictError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConflictError" + } + } + } } }, - "description": "Append a synthetic message to a session and resume execution.", + "description": "Durably admit synthetic session input and schedule execution unless resume is false.", "summary": "Add synthetic message", "requestBody": { "content": { @@ -2002,6 +2044,21 @@ "schema": { "type": "object", "properties": { + "id": { + "anyOf": [ + { + "type": "string", + "allOf": [ + { + "pattern": "^msg_" + } + ] + }, + { + "type": "null" + } + ] + }, "text": { "type": "string" }, @@ -2018,6 +2075,20 @@ "metadata": { "type": "object" }, + "delivery": { + "anyOf": [ + { + "type": "string", + "enum": [ + "steer", + "queue" + ] + }, + { + "type": "null" + } + ] + }, "resume": { "anyOf": [ { @@ -2173,7 +2244,7 @@ "type": "object", "properties": { "data": { - "$ref": "#/components/schemas/SessionInput.Compaction" + "$ref": "#/components/schemas/SessionPending.Compaction" } }, "required": [ @@ -2744,6 +2815,93 @@ "summary": "Get session context" } }, + "/api/session/{sessionID}/pending": { + "get": { + "tags": [ + "session" + ], + "operationId": "v2.session.pending.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/SessionPending.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 durable admitted session work not yet visible in projected history, ordered by admission. Includes unpromoted user and synthetic inputs and unhandled compaction barriers. The runner owns consumption; items disappear once promoted or handled.", + "summary": "List pending session work" + } + }, "/api/session/{sessionID}/instructions/entries": { "get": { "tags": [ @@ -2901,6 +3059,16 @@ } } } + }, + "413": { + "description": "InstructionEntryValueTooLargeError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InstructionEntryValueTooLargeError" + } + } + } } }, "description": "Attach or replace one durable instruction entry. Changes announce as updates at the next step boundary.", @@ -2998,6 +3166,110 @@ "summary": "Remove instruction entry" } }, + "/api/session/{sessionID}/generate": { + "post": { + "tags": [ + "session" + ], + "operationId": "v2.session.generate", + "parameters": [ + { + "name": "sessionID", + "in": "path", + "schema": { + "type": "string", + "allOf": [ + { + "pattern": "^ses" + } + ] + }, + "required": true + } + ], + "security": [], + "responses": { + "200": { + "description": "SessionGenerateResponse", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SessionGenerateResponse" + } + } + } + }, + "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": "Generate transient text from the current session context without mutating session history.", + "summary": "Generate text from session context", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "prompt": { + "type": "string" + } + }, + "required": [ + "prompt" + ], + "additionalProperties": false + } + } + }, + "required": true + } + } + }, "/api/experimental/session/{sessionID}/log": { "get": { "tags": [ @@ -3076,7 +3348,7 @@ "type": "string" }, "data": { - "$ref": "#/components/schemas/SessionLogItemStream" + "$ref": "#/components/schemas/SessionLogItemJsonString" } }, "required": [ @@ -3694,7 +3966,7 @@ } } }, - "description": "Retrieve available models ordered by release date.", + "description": "Retrieve the current snapshot of available models ordered by release date. The snapshot may precede initial plugin settlement.", "summary": "List models" } }, @@ -4395,6 +4667,110 @@ "summary": "Get integration" } }, + "/api/experimental/integration/wellknown": { + "post": { + "tags": [ + "integration" + ], + "operationId": "v2.experimental.integration.wellknown.add", + "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": { + "anyOf": [ + { + "$ref": "#/components/schemas/InvalidRequestError1" + }, + { + "$ref": "#/components/schemas/InvalidRequestError" + } + ] + } + } + } + }, + "401": { + "description": "UnauthorizedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedError" + } + } + } + } + }, + "description": "Discover and persist an experimental wellknown integration source.", + "summary": "Add wellknown integration", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "url": { + "type": "string" + } + }, + "required": [ + "url" + ], + "additionalProperties": false + } + } + }, + "required": true + } + } + }, "/api/integration/{integrationID}/connect/key": { "post": { "tags": [ @@ -4522,7 +4898,7 @@ "tags": [ "integration" ], - "operationId": "v2.integration.connect.oauth", + "operationId": "v2.integration.oauth.connect", "parameters": [ { "name": "integrationID", @@ -4666,13 +5042,21 @@ } } }, - "/api/integration/attempt/{attemptID}": { + "/api/integration/{integrationID}/connect/oauth/{attemptID}": { "get": { "tags": [ "integration" ], - "operationId": "v2.integration.attempt.status", + "operationId": "v2.integration.oauth.status", "parameters": [ + { + "name": "integrationID", + "in": "path", + "schema": { + "type": "string" + }, + "required": true + }, { "name": "attemptID", "in": "path", @@ -4775,8 +5159,16 @@ "tags": [ "integration" ], - "operationId": "v2.integration.attempt.cancel", + "operationId": "v2.integration.oauth.cancel", "parameters": [ + { + "name": "integrationID", + "in": "path", + "schema": { + "type": "string" + }, + "required": true + }, { "name": "attemptID", "in": "path", @@ -4856,13 +5248,21 @@ "summary": "Cancel OAuth connection" } }, - "/api/integration/attempt/{attemptID}/complete": { + "/api/integration/{integrationID}/connect/oauth/{attemptID}/complete": { "post": { "tags": [ "integration" ], - "operationId": "v2.integration.attempt.complete", + "operationId": "v2.integration.oauth.complete", "parameters": [ + { + "name": "integrationID", + "in": "path", + "schema": { + "type": "string" + }, + "required": true + }, { "name": "attemptID", "in": "path", @@ -4972,6 +5372,354 @@ } } }, + "/api/integration/{integrationID}/connect/command": { + "post": { + "tags": [ + "integration" + ], + "operationId": "v2.integration.command.connect", + "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.CommandAttempt" + } + }, + "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 a command authentication attempt.", + "summary": "Begin command connection", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "methodID": { + "type": "string" + }, + "label": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "methodID" + ], + "additionalProperties": false + } + } + }, + "required": true + } + } + }, + "/api/integration/{integrationID}/connect/command/{attemptID}": { + "get": { + "tags": [ + "integration" + ], + "operationId": "v2.integration.command.status", + "parameters": [ + { + "name": "integrationID", + "in": "path", + "schema": { + "type": "string" + }, + "required": true + }, + { + "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.CommandAttemptStatus" + } + }, + "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 and output of a command authentication attempt.", + "summary": "Get command attempt status" + }, + "delete": { + "tags": [ + "integration" + ], + "operationId": "v2.integration.command.cancel", + "parameters": [ + { + "name": "integrationID", + "in": "path", + "schema": { + "type": "string" + }, + "required": true + }, + { + "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 a command authentication attempt and terminate its process.", + "summary": "Cancel command connection" + } + }, "/api/mcp": { "get": { "tags": [ @@ -5073,6 +5821,404 @@ "summary": "List MCP servers" } }, + "/api/mcp/{server}": { + "put": { + "tags": [ + "mcp" + ], + "operationId": "v2.mcp.add", + "parameters": [ + { + "name": "server", + "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": "Add an MCP server at runtime or replace an existing one, connecting it immediately.", + "summary": "Add MCP server", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "config": { + "anyOf": [ + { + "$ref": "#/components/schemas/Mcp.LocalConfig" + }, + { + "$ref": "#/components/schemas/Mcp.RemoteConfig" + } + ] + } + }, + "required": [ + "config" + ], + "additionalProperties": false + } + } + }, + "required": true + } + }, + "delete": { + "tags": [ + "mcp" + ], + "operationId": "v2.mcp.remove", + "parameters": [ + { + "name": "server", + "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" + } + } + } + }, + "404": { + "description": "McpServerNotFoundError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/McpServerNotFoundError" + } + } + } + } + }, + "description": "Stop an MCP server and remove it from the runtime set until restart.", + "summary": "Remove MCP server" + } + }, + "/api/mcp/{server}/connect": { + "post": { + "tags": [ + "mcp" + ], + "operationId": "v2.mcp.connect", + "parameters": [ + { + "name": "server", + "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" + } + } + } + }, + "404": { + "description": "McpServerNotFoundError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/McpServerNotFoundError" + } + } + } + } + }, + "description": "Connect an MCP server at runtime, overriding a disabled configuration until restart.", + "summary": "Connect MCP server" + } + }, + "/api/mcp/{server}/disconnect": { + "post": { + "tags": [ + "mcp" + ], + "operationId": "v2.mcp.disconnect", + "parameters": [ + { + "name": "server", + "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" + } + } + } + }, + "404": { + "description": "McpServerNotFoundError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/McpServerNotFoundError" + } + } + } + } + }, + "description": "Disconnect an MCP server at runtime, removing its tools until reconnected.", + "summary": "Disconnect MCP server" + } + }, "/api/mcp/resource": { "get": { "tags": [ @@ -5648,14 +6794,7 @@ "data": { "type": "array", "items": { - "anyOf": [ - { - "$ref": "#/components/schemas/Form.FormInfo" - }, - { - "$ref": "#/components/schemas/Form.UrlInfo" - } - ] + "$ref": "#/components/schemas/Form.Info" } } }, @@ -5721,14 +6860,7 @@ "data": { "type": "array", "items": { - "anyOf": [ - { - "$ref": "#/components/schemas/Form.FormInfo" - }, - { - "$ref": "#/components/schemas/Form.UrlInfo" - } - ] + "$ref": "#/components/schemas/Form.Info" } } }, @@ -5806,14 +6938,7 @@ "type": "object", "properties": { "data": { - "anyOf": [ - { - "$ref": "#/components/schemas/Form.FormInfo" - }, - { - "$ref": "#/components/schemas/Form.UrlInfo" - } - ] + "$ref": "#/components/schemas/Form.Info" } }, "required": [ @@ -5932,14 +7057,7 @@ "type": "object", "properties": { "data": { - "anyOf": [ - { - "$ref": "#/components/schemas/Form.FormInfo" - }, - { - "$ref": "#/components/schemas/Form.UrlInfo" - } - ] + "$ref": "#/components/schemas/Form.Info" } }, "required": [ @@ -7537,7 +8655,7 @@ "type": "string" }, "data": { - "$ref": "#/components/schemas/V2EventStream" + "$ref": "#/components/schemas/V2EventJsonString" } }, "required": [ @@ -8564,7 +9682,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/Shell1" + "$ref": "#/components/schemas/Shell.Info1" } } }, @@ -8661,7 +9779,7 @@ "$ref": "#/components/schemas/Location.Info" }, "data": { - "$ref": "#/components/schemas/Shell1" + "$ref": "#/components/schemas/Shell.Info1" } }, "required": [ @@ -8806,7 +9924,7 @@ "$ref": "#/components/schemas/Location.Info" }, "data": { - "$ref": "#/components/schemas/Shell1" + "$ref": "#/components/schemas/Shell.Info1" } }, "required": [ @@ -9026,7 +10144,7 @@ "$ref": "#/components/schemas/Location.Info" }, "data": { - "$ref": "#/components/schemas/Shell1" + "$ref": "#/components/schemas/Shell.Info1" } }, "required": [ @@ -10416,10 +11534,286 @@ "description": "Dispose the requested location's cached services so its next use boots them fresh.", "summary": "Evict a loaded location" } + }, + "/api/websearch/provider": { + "get": { + "tags": [ + "websearch" + ], + "operationId": "v2.websearch.providers", + "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/WebSearch.Provider" + } + } + }, + "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": "Return the registered web search providers.", + "summary": "List web search providers" + } + }, + "/api/websearch": { + "post": { + "tags": [ + "websearch" + ], + "operationId": "v2.websearch.query", + "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/WebSearch.Response" + } + }, + "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" + } + } + } + }, + "503": { + "description": "ServiceUnavailableError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ServiceUnavailableError" + } + } + } + } + }, + "description": "Run one web search through the selected provider. Specify a provider to override the configured default.", + "summary": "Search the web", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "query": { + "type": "string" + }, + "providerID": { + "type": "string" + } + }, + "required": [ + "query" + ], + "additionalProperties": false + } + } + }, + "required": true + } + } } }, "components": { "schemas": { + "ServiceHealth": { + "type": "object", + "properties": { + "healthy": { + "type": "boolean", + "enum": [ + true + ] + }, + "version": { + "type": "string" + }, + "pid": { + "type": "integer", + "allOf": [ + { + "exclusiveMinimum": 0 + } + ] + } + }, + "required": [ + "healthy", + "version", + "pid" + ], + "additionalProperties": false + }, "UnauthorizedError": { "type": "object", "properties": { @@ -10478,6 +11872,30 @@ ], "additionalProperties": false }, + "ServiceStopRequest": { + "type": "object", + "properties": { + "instanceID": { + "type": "string" + } + }, + "required": [ + "instanceID" + ], + "additionalProperties": false + }, + "ServiceStopResponse": { + "type": "object", + "properties": { + "accepted": { + "type": "boolean" + } + }, + "required": [ + "accepted" + ], + "additionalProperties": false + }, "Location.Info": { "type": "object", "properties": { @@ -10561,12 +11979,7 @@ "additionalProperties": false }, "Agent.Color": { - "type": "string", - "allOf": [ - { - "pattern": "^#[0-9a-fA-F]{6}$" - } - ] + "type": "string" }, "PermissionV2.Effect": { "type": "string", @@ -11126,30 +12539,6 @@ ], "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": [ @@ -11225,7 +12614,7 @@ ], "additionalProperties": false }, - "Prompt": { + "SessionPending.UserData": { "type": "object", "properties": { "text": { @@ -11242,6 +12631,9 @@ "items": { "$ref": "#/components/schemas/Prompt.AgentAttachment" } + }, + "metadata": { + "type": "object" } }, "required": [ @@ -11249,7 +12641,7 @@ ], "additionalProperties": false }, - "SessionInput.Admitted": { + "SessionPending.User": { "type": "object", "properties": { "admittedSeq": { @@ -11276,8 +12668,17 @@ } ] }, - "prompt": { - "$ref": "#/components/schemas/Prompt" + "timeCreated": { + "type": "number" + }, + "type": { + "type": "string", + "enum": [ + "user" + ] + }, + "data": { + "$ref": "#/components/schemas/SessionPending.UserData" }, "delivery": { "type": "string", @@ -11285,26 +12686,16 @@ "steer", "queue" ] - }, - "timeCreated": { - "type": "number" - }, - "promotedSeq": { - "type": "integer", - "allOf": [ - { - "minimum": 0 - } - ] } }, "required": [ "admittedSeq", "id", "sessionID", - "prompt", - "delivery", - "timeCreated" + "timeCreated", + "type", + "data", + "delivery" ], "additionalProperties": false }, @@ -11406,15 +12797,27 @@ ], "additionalProperties": false }, - "SessionInput.Compaction": { + "SessionPending.SyntheticData": { "type": "object", "properties": { - "type": { - "type": "string", - "enum": [ - "compaction" - ] + "text": { + "type": "string" }, + "description": { + "type": "string" + }, + "metadata": { + "type": "object" + } + }, + "required": [ + "text" + ], + "additionalProperties": false + }, + "SessionPending.Synthetic": { + "type": "object", + "properties": { "admittedSeq": { "type": "integer", "allOf": [ @@ -11442,21 +12845,77 @@ "timeCreated": { "type": "number" }, - "handledSeq": { + "type": { + "type": "string", + "enum": [ + "synthetic" + ] + }, + "data": { + "$ref": "#/components/schemas/SessionPending.SyntheticData" + }, + "delivery": { + "type": "string", + "enum": [ + "steer", + "queue" + ] + } + }, + "required": [ + "admittedSeq", + "id", + "sessionID", + "timeCreated", + "type", + "data", + "delivery" + ], + "additionalProperties": false + }, + "SessionPending.Compaction": { + "type": "object", + "properties": { + "admittedSeq": { "type": "integer", "allOf": [ { "minimum": 0 } ] + }, + "id": { + "type": "string", + "allOf": [ + { + "pattern": "^msg_" + } + ] + }, + "sessionID": { + "type": "string", + "allOf": [ + { + "pattern": "^ses" + } + ] + }, + "timeCreated": { + "type": "number" + }, + "type": { + "type": "string", + "enum": [ + "compaction" + ] } }, "required": [ - "type", "admittedSeq", "id", "sessionID", - "timeCreated" + "timeCreated", + "type" ], "additionalProperties": false }, @@ -11968,6 +13427,9 @@ ], "additionalProperties": false }, + "Session.Message.ProviderState": { + "type": "object" + }, "Session.Message.Assistant.Text": { "type": "object", "properties": { @@ -11979,6 +13441,9 @@ }, "text": { "type": "string" + }, + "state": { + "$ref": "#/components/schemas/Session.Message.ProviderState" } }, "required": [ @@ -11987,9 +13452,6 @@ ], "additionalProperties": false }, - "Session.Message.ProviderState": { - "type": "object" - }, "Session.Message.Assistant.Reasoning": { "type": "object", "properties": { @@ -12046,6 +13508,29 @@ ], "additionalProperties": false }, + "Session.Message.ToolState.Running": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "running" + ] + }, + "input": { + "type": "object" + }, + "metadata": { + "type": "object" + } + }, + "required": [ + "status", + "input", + "metadata" + ], + "additionalProperties": false + }, "Tool.TextContent": { "type": "object", "properties": { @@ -12101,36 +13586,6 @@ } ] }, - "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": { @@ -12145,20 +13600,24 @@ }, "content": { "type": "array", + "prefixItems": [ + { + "$ref": "#/components/schemas/LLM.ToolContent" + } + ], + "minItems": 1, "items": { "$ref": "#/components/schemas/LLM.ToolContent" } }, - "structured": { + "metadata": { "type": "object" - }, - "result": {} + } }, "required": [ "status", "input", - "content", - "structured" + "content" ], "additionalProperties": false }, @@ -12190,25 +13649,28 @@ "input": { "type": "object" }, + "error": { + "$ref": "#/components/schemas/Session.StructuredError" + }, "content": { "type": "array", + "prefixItems": [ + { + "$ref": "#/components/schemas/LLM.ToolContent" + } + ], + "minItems": 1, "items": { "$ref": "#/components/schemas/LLM.ToolContent" } }, - "structured": { + "metadata": { "type": "object" - }, - "error": { - "$ref": "#/components/schemas/Session.StructuredError" - }, - "result": {} + } }, "required": [ "status", "input", - "content", - "structured", "error" ], "additionalProperties": false @@ -12644,6 +14106,19 @@ } ] }, + "SessionPending.Info": { + "anyOf": [ + { + "$ref": "#/components/schemas/SessionPending.User" + }, + { + "$ref": "#/components/schemas/SessionPending.Synthetic" + }, + { + "$ref": "#/components/schemas/SessionPending.Compaction" + } + ] + }, "InstructionEntry.Key": { "type": "string", "allOf": [ @@ -12667,6 +14142,54 @@ ], "additionalProperties": false }, + "InstructionEntryValueTooLargeError": { + "type": "object", + "properties": { + "_tag": { + "type": "string", + "enum": [ + "InstructionEntryValueTooLargeError" + ] + }, + "actualBytes": { + "type": "integer" + }, + "maxBytes": { + "type": "integer" + }, + "message": { + "type": "string" + } + }, + "required": [ + "_tag", + "actualBytes", + "maxBytes", + "message" + ], + "additionalProperties": false + }, + "SessionGenerateResponse": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "text": { + "type": "string" + } + }, + "required": [ + "text" + ], + "additionalProperties": false + } + }, + "required": [ + "data" + ], + "additionalProperties": false + }, "session.agent.selected": { "type": "object", "properties": { @@ -12905,6 +14428,9 @@ "location": { "$ref": "#/components/schemas/Location.Ref" }, + "projectID": { + "type": "string" + }, "subpath": { "type": "string" } @@ -13131,7 +14657,7 @@ "version": { "type": "number", "enum": [ - 1 + 2 ] } }, @@ -13164,6 +14690,14 @@ } ] }, + "parentSeq": { + "type": "integer", + "allOf": [ + { + "minimum": -1 + } + ] + }, "from": { "type": "string", "allOf": [ @@ -13175,7 +14709,8 @@ }, "required": [ "sessionID", - "parentID" + "parentID", + "parentSeq" ], "additionalProperties": false } @@ -13189,7 +14724,7 @@ ], "additionalProperties": false }, - "session.prompt.promoted": { + "session.input.promoted": { "type": "object", "properties": { "id": { @@ -13209,7 +14744,7 @@ "type": { "type": "string", "enum": [ - "session.prompt.promoted" + "session.input.promoted" ] }, "durable": { @@ -13279,7 +14814,116 @@ ], "additionalProperties": false }, - "session.prompt.admitted": { + "SessionPending.UserData1": { + "type": "object", + "properties": { + "text": { + "type": "string" + }, + "files": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Prompt.FileAttachment" + } + }, + "agents": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Prompt.AgentAttachment" + } + }, + "metadata": { + "type": "object" + } + }, + "required": [ + "text" + ], + "additionalProperties": false + }, + "SessionPending.UserMessage": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "user" + ] + }, + "data": { + "$ref": "#/components/schemas/SessionPending.UserData1" + }, + "delivery": { + "type": "string", + "enum": [ + "steer", + "queue" + ] + } + }, + "required": [ + "type", + "data", + "delivery" + ], + "additionalProperties": false + }, + "SessionPending.SyntheticData1": { + "type": "object", + "properties": { + "text": { + "type": "string" + }, + "description": { + "type": "string" + }, + "metadata": { + "type": "object" + } + }, + "required": [ + "text" + ], + "additionalProperties": false + }, + "SessionPending.SyntheticMessage": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "synthetic" + ] + }, + "data": { + "$ref": "#/components/schemas/SessionPending.SyntheticData1" + }, + "delivery": { + "type": "string", + "enum": [ + "steer", + "queue" + ] + } + }, + "required": [ + "type", + "data", + "delivery" + ], + "additionalProperties": false + }, + "SessionPending.Message": { + "anyOf": [ + { + "$ref": "#/components/schemas/SessionPending.UserMessage" + }, + { + "$ref": "#/components/schemas/SessionPending.SyntheticMessage" + } + ] + }, + "session.input.admitted": { "type": "object", "properties": { "id": { @@ -13299,7 +14943,7 @@ "type": { "type": "string", "enum": [ - "session.prompt.admitted" + "session.input.admitted" ] }, "durable": { @@ -13352,22 +14996,14 @@ } ] }, - "prompt": { - "$ref": "#/components/schemas/Prompt" - }, - "delivery": { - "type": "string", - "enum": [ - "steer", - "queue" - ] + "input": { + "$ref": "#/components/schemas/SessionPending.Message" } }, "required": [ "sessionID", "inputID", - "prompt", - "delivery" + "input" ], "additionalProperties": false } @@ -13758,7 +15394,7 @@ "version": { "type": "number", "enum": [ - 1 + 2 ] } }, @@ -13783,13 +15419,31 @@ } ] }, - "text": { - "type": "string" + "delta": { + "type": "object", + "additionalProperties": { + "anyOf": [ + { + "type": "string", + "allOf": [ + { + "pattern": "^[a-f0-9]{64}$" + } + ] + }, + { + "type": "string", + "enum": [ + "removed" + ] + } + ] + } } }, "required": [ "sessionID", - "text" + "delta" ], "additionalProperties": false } @@ -13987,7 +15641,7 @@ ], "additionalProperties": false }, - "Shell": { + "Shell.Info": { "type": "object", "properties": { "id": { @@ -14028,29 +15682,7 @@ ] }, "exit": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "string", - "enum": [ - "NaN" - ] - }, - { - "type": "string", - "enum": [ - "Infinity" - ] - }, - { - "type": "string", - "enum": [ - "-Infinity" - ] - } - ] + "type": "number" }, "metadata": { "type": "object" @@ -14059,54 +15691,10 @@ "type": "object", "properties": { "started": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "string", - "enum": [ - "NaN" - ] - }, - { - "type": "string", - "enum": [ - "Infinity" - ] - }, - { - "type": "string", - "enum": [ - "-Infinity" - ] - } - ] + "type": "number" }, "completed": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "string", - "enum": [ - "NaN" - ] - }, - { - "type": "string", - "enum": [ - "Infinity" - ] - }, - { - "type": "string", - "enum": [ - "-Infinity" - ] - } - ] + "type": "number" } }, "required": [ @@ -14193,7 +15781,7 @@ ] }, "shell": { - "$ref": "#/components/schemas/Shell" + "$ref": "#/components/schemas/Shell.Info" } }, "required": [ @@ -14278,7 +15866,7 @@ ] }, "shell": { - "$ref": "#/components/schemas/Shell" + "$ref": "#/components/schemas/Shell.Info" }, "output": { "type": "object", @@ -14633,6 +16221,15 @@ }, "tokens": { "$ref": "#/components/schemas/TokenUsage.Info" + }, + "snapshot": { + "type": "string" + }, + "files": { + "type": "array", + "items": { + "type": "string" + } } }, "required": [ @@ -14751,6 +16348,9 @@ ], "additionalProperties": false }, + "Session.Message.ProviderState4": { + "type": "object" + }, "session.text.ended": { "type": "object", "properties": { @@ -14834,6 +16434,9 @@ }, "text": { "type": "string" + }, + "state": { + "$ref": "#/components/schemas/Session.Message.ProviderState4" } }, "required": [ @@ -14854,7 +16457,7 @@ ], "additionalProperties": false }, - "Session.Message.ProviderState3": { + "Session.Message.ProviderState5": { "type": "object" }, "session.reasoning.started": { @@ -14939,7 +16542,7 @@ ] }, "state": { - "$ref": "#/components/schemas/Session.Message.ProviderState3" + "$ref": "#/components/schemas/Session.Message.ProviderState5" } }, "required": [ @@ -14959,7 +16562,7 @@ ], "additionalProperties": false }, - "Session.Message.ProviderState4": { + "Session.Message.ProviderState6": { "type": "object" }, "session.reasoning.ended": { @@ -15047,7 +16650,7 @@ "type": "string" }, "state": { - "$ref": "#/components/schemas/Session.Message.ProviderState4" + "$ref": "#/components/schemas/Session.Message.ProviderState6" } }, "required": [ @@ -15264,7 +16867,7 @@ ], "additionalProperties": false }, - "Session.Message.ProviderState5": { + "Session.Message.ProviderState7": { "type": "object" }, "session.tool.called": { @@ -15350,7 +16953,7 @@ "type": "boolean" }, "state": { - "$ref": "#/components/schemas/Session.Message.ProviderState5" + "$ref": "#/components/schemas/Session.Message.ProviderState7" } }, "required": [ @@ -15372,112 +16975,7 @@ ], "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": { + "Session.Message.ProviderState8": { "type": "object" }, "session.tool.success": { @@ -15520,7 +17018,7 @@ "version": { "type": "number", "enum": [ - 1 + 2 ] } }, @@ -15556,28 +17054,32 @@ "callID": { "type": "string" }, - "structured": { - "type": "object" - }, "content": { "type": "array", + "prefixItems": [ + { + "$ref": "#/components/schemas/LLM.ToolContent" + } + ], + "minItems": 1, "items": { "$ref": "#/components/schemas/LLM.ToolContent" } }, - "result": {}, + "metadata": { + "type": "object" + }, "executed": { "type": "boolean" }, "resultState": { - "$ref": "#/components/schemas/Session.Message.ProviderState6" + "$ref": "#/components/schemas/Session.Message.ProviderState8" } }, "required": [ "sessionID", "assistantMessageID", "callID", - "structured", "content", "executed" ], @@ -15593,7 +17095,7 @@ ], "additionalProperties": false }, - "Session.Message.ProviderState7": { + "Session.Message.ProviderState9": { "type": "object" }, "session.tool.failed": { @@ -15636,7 +17138,7 @@ "version": { "type": "number", "enum": [ - 1 + 2 ] } }, @@ -15675,12 +17177,26 @@ "error": { "$ref": "#/components/schemas/Session.StructuredError" }, - "result": {}, + "content": { + "type": "array", + "prefixItems": [ + { + "$ref": "#/components/schemas/LLM.ToolContent" + } + ], + "minItems": 1, + "items": { + "$ref": "#/components/schemas/LLM.ToolContent" + } + }, + "metadata": { + "type": "object" + }, "executed": { "type": "boolean" }, "resultState": { - "$ref": "#/components/schemas/Session.Message.ProviderState7" + "$ref": "#/components/schemas/Session.Message.ProviderState9" } }, "required": [ @@ -16459,6 +17975,103 @@ ], "additionalProperties": false }, + "session.usage.recorded": { + "type": "object", + "properties": { + "id": { + "type": "string", + "allOf": [ + { + "pattern": "^evt_" + } + ] + }, + "created": { + "type": "number" + }, + "metadata": { + "type": "object" + }, + "type": { + "type": "string", + "enum": [ + "session.usage.recorded" + ] + }, + "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" + } + ] + }, + "source": { + "type": "string", + "enum": [ + "title", + "compaction" + ] + }, + "cost": { + "$ref": "#/components/schemas/Money.USD" + }, + "tokens": { + "$ref": "#/components/schemas/TokenUsage.Info" + } + }, + "required": [ + "sessionID", + "source", + "cost", + "tokens" + ], + "additionalProperties": false + } + }, + "required": [ + "id", + "created", + "type", + "durable", + "data" + ], + "additionalProperties": false + }, "Session.Event.Durable": { "oneOf": [ { @@ -16480,10 +18093,10 @@ "$ref": "#/components/schemas/session.forked" }, { - "$ref": "#/components/schemas/session.prompt.promoted" + "$ref": "#/components/schemas/session.input.promoted" }, { - "$ref": "#/components/schemas/session.prompt.admitted" + "$ref": "#/components/schemas/session.input.admitted" }, { "$ref": "#/components/schemas/session.execution.started" @@ -16542,9 +18155,6 @@ { "$ref": "#/components/schemas/session.tool.called" }, - { - "$ref": "#/components/schemas/session.tool.progress" - }, { "$ref": "#/components/schemas/session.tool.success" }, @@ -16574,6 +18184,9 @@ }, { "$ref": "#/components/schemas/session.revert.committed" + }, + { + "$ref": "#/components/schemas/session.usage.recorded" } ] }, @@ -16615,7 +18228,7 @@ } ] }, - "SessionLogItemStream": { + "SessionLogItemJsonString": { "type": "string", "contentSchema": { "$ref": "#/components/schemas/SessionLogItem" @@ -16664,6 +18277,30 @@ ], "additionalProperties": false }, + "Model.ReasoningField": { + "anyOf": [ + { + "type": "string", + "enum": [ + "reasoning", + "reasoning_content", + "reasoning_text" + ] + }, + { + "type": "string" + } + ] + }, + "Model.Compatibility": { + "type": "object", + "properties": { + "reasoningField": { + "$ref": "#/components/schemas/Model.ReasoningField" + } + }, + "additionalProperties": false + }, "Model.Capabilities": { "type": "object", "properties": { @@ -16787,6 +18424,9 @@ "name": { "type": "string" }, + "compatibility": { + "$ref": "#/components/schemas/Model.Compatibility" + }, "package": { "type": "string" }, @@ -17096,6 +18736,36 @@ ], "additionalProperties": false }, + "Integration.CommandMethod": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "command" + ] + }, + "label": { + "type": "string" + }, + "command": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "id", + "type", + "label", + "command" + ], + "additionalProperties": false + }, "Integration.KeyMethod": { "type": "object", "properties": { @@ -17141,6 +18811,9 @@ { "$ref": "#/components/schemas/Integration.OAuthMethod" }, + { + "$ref": "#/components/schemas/Integration.CommandMethod" + }, { "$ref": "#/components/schemas/Integration.KeyMethod" }, @@ -17752,6 +19425,514 @@ } ] }, + "Integration.CommandAttempt": { + "type": "object", + "properties": { + "attemptID": { + "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": [ + "attemptID", + "time" + ], + "additionalProperties": false + }, + "Integration.CommandAttemptStatus": { + "anyOf": [ + { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "pending" + ] + }, + "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", + "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": { @@ -17888,6 +20069,305 @@ ], "additionalProperties": false }, + "Mcp.TimeoutConfig": { + "type": "object", + "properties": { + "startup": { + "anyOf": [ + { + "type": "integer", + "allOf": [ + { + "exclusiveMinimum": 0 + } + ] + }, + { + "type": "null" + } + ], + "description": "Maximum time in milliseconds to establish and initialize the MCP server." + }, + "catalog": { + "anyOf": [ + { + "type": "integer", + "allOf": [ + { + "exclusiveMinimum": 0 + } + ] + }, + { + "type": "null" + } + ], + "description": "Maximum time in milliseconds to wait for MCP discovery requests such as tools/list and prompts/list." + }, + "execution": { + "anyOf": [ + { + "type": "integer", + "allOf": [ + { + "exclusiveMinimum": 0 + } + ] + }, + { + "type": "null" + } + ], + "description": "Maximum time in milliseconds to wait for MCP tool and prompt execution." + } + }, + "additionalProperties": false + }, + "Mcp.LocalConfig": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "local" + ] + }, + "command": { + "type": "array", + "items": { + "type": "string" + } + }, + "cwd": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Working directory for the MCP server process. Relative paths resolve from the workspace directory." + }, + "environment": { + "anyOf": [ + { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + { + "type": "null" + } + ] + }, + "disabled": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + }, + "codemode": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "description": "Expose this server's tools through Code Mode. Defaults to true." + }, + "timeout": { + "anyOf": [ + { + "$ref": "#/components/schemas/Mcp.TimeoutConfig" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "type", + "command" + ], + "additionalProperties": false + }, + "Mcp.OAuthConfig": { + "type": "object", + "properties": { + "client_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "client_secret": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "scope": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "callback_port": { + "anyOf": [ + { + "type": "integer", + "allOf": [ + { + "minimum": 1, + "maximum": 65535 + } + ] + }, + { + "type": "null" + } + ] + }, + "redirect_uri": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false + }, + "Mcp.RemoteConfig": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "remote" + ] + }, + "url": { + "type": "string" + }, + "headers": { + "anyOf": [ + { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + { + "type": "null" + } + ] + }, + "oauth": { + "anyOf": [ + { + "anyOf": [ + { + "$ref": "#/components/schemas/Mcp.OAuthConfig" + }, + { + "type": "boolean", + "enum": [ + false + ] + } + ] + }, + { + "type": "null" + } + ] + }, + "disabled": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + }, + "codemode": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "description": "Expose this server's tools through Code Mode. Defaults to true." + }, + "timeout": { + "anyOf": [ + { + "$ref": "#/components/schemas/Mcp.TimeoutConfig" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "type", + "url" + ], + "additionalProperties": false + }, + "McpServerNotFoundError": { + "type": "object", + "properties": { + "_tag": { + "type": "string", + "enum": [ + "McpServerNotFoundError" + ] + }, + "server": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "required": [ + "_tag", + "server", + "message" + ], + "additionalProperties": false + }, "Mcp.Resource": { "type": "object", "properties": { @@ -18664,100 +21144,98 @@ ], "additionalProperties": false }, - "Form.FormInfo": { + "Form.ExternalField": { "type": "object", "properties": { - "id": { - "type": "string", - "allOf": [ - { - "pattern": "^frm_" - } - ] - }, - "sessionID": { + "key": { "type": "string" }, - "title": { - "type": "string" - }, - "metadata": { - "$ref": "#/components/schemas/Form.Metadata" - }, - "mode": { + "type": { "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" + "external" ] }, "url": { "type": "string" + }, + "title": { + "type": "string" + }, + "description": { + "type": "string" + } + }, + "required": [ + "key", + "type", + "url" + ], + "additionalProperties": false + }, + "Form.Field": { + "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" + }, + { + "$ref": "#/components/schemas/Form.ExternalField" + } + ] + }, + "Form.Fields": { + "type": "array", + "prefixItems": [ + { + "$ref": "#/components/schemas/Form.Field" + } + ], + "minItems": 1, + "items": { + "$ref": "#/components/schemas/Form.Field" + } + }, + "Form.Info": { + "type": "object", + "properties": { + "id": { + "type": "string", + "allOf": [ + { + "pattern": "^frm_" + } + ] + }, + "sessionID": { + "type": "string" + }, + "title": { + "type": "string" + }, + "metadata": { + "$ref": "#/components/schemas/Form.Metadata" + }, + "fields": { + "$ref": "#/components/schemas/Form.Fields" } }, "required": [ "id", "sessionID", "title", - "mode", - "url" + "fields" ], "additionalProperties": false }, @@ -18785,56 +21263,13 @@ "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" - } - ] + "$ref": "#/components/schemas/Form.Fields" } }, "required": [ "title", - "mode" + "fields" ], "additionalProperties": false }, @@ -22811,6 +25246,75 @@ ], "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" + ] + }, + "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" + }, + "metadata": { + "type": "object" + } + }, + "required": [ + "sessionID", + "assistantMessageID", + "callID", + "metadata" + ], + "additionalProperties": false + } + }, + "required": [ + "id", + "created", + "type", + "data" + ], + "additionalProperties": false + }, "session.compaction.delta": { "type": "object", "properties": { @@ -23689,7 +26193,7 @@ "type": "object", "properties": { "info": { - "$ref": "#/components/schemas/Shell" + "$ref": "#/components/schemas/Shell.Info" } }, "required": [ @@ -23744,29 +26248,7 @@ ] }, "exit": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "string", - "enum": [ - "NaN" - ] - }, - { - "type": "string", - "enum": [ - "Infinity" - ] - }, - { - "type": "string", - "enum": [ - "-Infinity" - ] - } - ] + "type": "number" }, "status": { "type": "string", @@ -24575,7 +27057,41 @@ ], "additionalProperties": false }, - "Form.FormInfo1": { + "Form.Field1": { + "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" + }, + { + "$ref": "#/components/schemas/Form.ExternalField" + } + ] + }, + "Form.Fields1": { + "type": "array", + "prefixItems": [ + { + "$ref": "#/components/schemas/Form.Field1" + } + ], + "minItems": 1, + "items": { + "$ref": "#/components/schemas/Form.Field1" + } + }, + "Form.Info1": { "type": "object", "properties": { "id": { @@ -24595,83 +27111,18 @@ "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" - } - ] - } + "$ref": "#/components/schemas/Form.Fields1" } }, "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": { @@ -24702,14 +27153,7 @@ "type": "object", "properties": { "form": { - "anyOf": [ - { - "$ref": "#/components/schemas/Form.FormInfo1" - }, - { - "$ref": "#/components/schemas/Form.UrlInfo1" - } - ] + "$ref": "#/components/schemas/Form.Info1" } }, "required": [ @@ -24889,6 +27333,51 @@ ], "additionalProperties": false }, + "websearch.updated": { + "type": "object", + "properties": { + "id": { + "type": "string", + "allOf": [ + { + "pattern": "^evt_" + } + ] + }, + "created": { + "type": "number" + }, + "metadata": { + "type": "object" + }, + "type": { + "type": "string", + "enum": [ + "websearch.updated" + ] + }, + "location": { + "$ref": "#/components/schemas/Location.Ref" + }, + "data": { + "anyOf": [ + { + "type": "object" + }, + { + "type": "array" + } + ] + } + }, + "required": [ + "id", + "created", + "type", + "data" + ], + "additionalProperties": false + }, "SessionStatus": { "anyOf": [ { @@ -26262,10 +28751,10 @@ "$ref": "#/components/schemas/session.forked" }, { - "$ref": "#/components/schemas/session.prompt.promoted" + "$ref": "#/components/schemas/session.input.promoted" }, { - "$ref": "#/components/schemas/session.prompt.admitted" + "$ref": "#/components/schemas/session.input.admitted" }, { "$ref": "#/components/schemas/session.execution.started" @@ -26438,6 +28927,9 @@ { "$ref": "#/components/schemas/form.cancelled" }, + { + "$ref": "#/components/schemas/websearch.updated" + }, { "$ref": "#/components/schemas/session.status" }, @@ -26494,7 +28986,7 @@ } ] }, - "V2EventStream": { + "V2EventJsonString": { "type": "string", "contentSchema": { "$ref": "#/components/schemas/V2Event" @@ -26564,7 +29056,7 @@ ], "additionalProperties": false }, - "Shell1": { + "Shell.Info1": { "type": "object", "properties": { "id": { @@ -26605,41 +29097,7 @@ ] }, "exit": { - "anyOf": [ - { - "anyOf": [ - { - "type": "number" - }, - { - "type": "string", - "enum": [ - "NaN" - ] - }, - { - "type": "string", - "enum": [ - "Infinity" - ] - }, - { - "type": "string", - "enum": [ - "-Infinity" - ] - } - ] - }, - { - "type": "string", - "enum": [ - "Infinity", - "-Infinity", - "NaN" - ] - } - ] + "type": "number" }, "metadata": { "type": "object" @@ -26648,78 +29106,10 @@ "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" - ] - } - ] + "type": "number" }, "completed": { - "anyOf": [ - { - "anyOf": [ - { - "type": "number" - }, - { - "type": "string", - "enum": [ - "NaN" - ] - }, - { - "type": "string", - "enum": [ - "Infinity" - ] - }, - { - "type": "string", - "enum": [ - "-Infinity" - ] - } - ] - }, - { - "type": "string", - "enum": [ - "Infinity", - "-Infinity", - "NaN" - ] - } - ] + "type": "number" } }, "required": [ @@ -27023,6 +29413,69 @@ "working", "branch" ] + }, + "WebSearch.Provider": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "required": [ + "id", + "name" + ], + "additionalProperties": false + }, + "WebSearch.Result": { + "type": "object", + "properties": { + "url": { + "type": "string" + }, + "title": { + "type": "string" + }, + "content": { + "type": "string" + }, + "time": { + "type": "object", + "properties": { + "published": { + "type": "number" + } + }, + "additionalProperties": false + } + }, + "required": [ + "url", + "time" + ], + "additionalProperties": false + }, + "WebSearch.Response": { + "type": "object", + "properties": { + "providerID": { + "type": "string" + }, + "results": { + "type": "array", + "items": { + "$ref": "#/components/schemas/WebSearch.Result" + } + } + }, + "required": [ + "providerID", + "results" + ], + "additionalProperties": false } }, "securitySchemes": {} @@ -27130,6 +29583,10 @@ }, { "name": "debug" + }, + { + "name": "websearch", + "description": "Location-scoped web search routes." } ] } diff --git a/packages/www/script/generate-openapi.ts b/packages/www/script/generate-openapi.ts new file mode 100644 index 0000000000..80b9c72ca3 --- /dev/null +++ b/packages/www/script/generate-openapi.ts @@ -0,0 +1,18 @@ +import { fileURLToPath } from "url" + +const source = fileURLToPath(new URL("../../protocol/openapi.json", import.meta.url)) +const targets = ["../openapi.json", "../public/openapi.json"].map((path) => + fileURLToPath(new URL(path, import.meta.url)), +) +const document = await Bun.file(source).text() + +if (process.argv.includes("--check")) { + const stale = (await Promise.all(targets.map((path) => Bun.file(path).text()))).some((value) => value !== document) + if (stale) { + console.error("Generated OpenAPI documents are stale. Run `bun run generate` from packages/www.") + process.exit(1) + } + process.exit(0) +} + +await Promise.all(targets.map((path) => Bun.write(path, document))) diff --git a/script/generate.ts b/script/generate.ts index e51808342f..ff4f29e6d5 100755 --- a/script/generate.ts +++ b/script/generate.ts @@ -2,9 +2,7 @@ import { $ } from "bun" -await $`bun ./packages/sdk/js/script/build.ts` - -await $`bun dev generate > ../sdk/openapi.json`.cwd("packages/opencode") +await $`bun run generate`.cwd("packages/protocol") await $`bun run generate`.cwd("packages/www") diff --git a/script/publish.ts b/script/publish.ts index 3d74fd6812..3623eeb777 100755 --- a/script/publish.ts +++ b/script/publish.ts @@ -26,7 +26,6 @@ async function prepareReleaseFiles() { } await $`bun install` - await $`./packages/sdk/js/script/build.ts` } if (Script.release && !Script.preview) { @@ -54,9 +53,6 @@ await $`bun ./packages/client/script/publish.ts` console.log("\n=== cli ===\n") await $`bun ./packages/cli/script/publish.ts` -console.log("\n=== sdk ===\n") -await $`bun ./packages/sdk/js/script/publish.ts` - console.log("\n=== plugin ===\n") await $`bun ./packages/plugin/script/publish.ts` diff --git a/script/raw-changelog.ts b/script/raw-changelog.ts index 2ea76247d5..effa0f1d47 100644 --- a/script/raw-changelog.ts +++ b/script/raw-changelog.ts @@ -120,7 +120,7 @@ async function commits(from: string, to: string) { } const log = - await $`git log ${base}..${head} --format=%H -- packages/opencode packages/sdk packages/plugin packages/desktop packages/app sdks/vscode packages/extensions github`.text() + await $`git log ${base}..${head} --format=%H -- packages/opencode packages/plugin packages/desktop packages/app sdks/vscode packages/extensions github`.text() const list: Commit[] = [] for (const hash of log.split("\n").filter(Boolean)) { @@ -136,7 +136,7 @@ async function commits(from: string, to: string) { else if (file.startsWith("packages/opencode/")) areas.add("core") else if (file.startsWith("packages/desktop/src-tauri/")) areas.add("tauri") else if (file.startsWith("packages/desktop/") || file.startsWith("packages/app/")) areas.add("app") - else if (file.startsWith("packages/sdk/") || file.startsWith("packages/plugin/")) areas.add("sdk") + else if (file.startsWith("packages/plugin/")) areas.add("sdk") else if (file.startsWith("sdks/vscode/") || file.startsWith("github/")) areas.add("extensions/vscode") }