@orion-agents/orion-code 0.2.2 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (217) hide show
  1. package/CHANGELOG.md +82 -0
  2. package/README.md +89 -14
  3. package/README.zh-CN.md +77 -14
  4. package/bin/orion +15 -4
  5. package/dist/cli.js +51 -172
  6. package/dist/cli.js.map +1 -1
  7. package/dist/commands/model-command-handlers.d.ts +2 -2
  8. package/dist/commands/model-command-handlers.d.ts.map +1 -1
  9. package/dist/commands/model-command-handlers.js +113 -32
  10. package/dist/commands/model-command-handlers.js.map +1 -1
  11. package/dist/commands/session-command-handlers.d.ts.map +1 -1
  12. package/dist/commands/session-command-handlers.js +106 -15
  13. package/dist/commands/session-command-handlers.js.map +1 -1
  14. package/dist/commands/types.d.ts +13 -3
  15. package/dist/commands/types.d.ts.map +1 -1
  16. package/dist/commands/types.js +1 -1
  17. package/dist/commands/types.js.map +1 -1
  18. package/dist/core/tool-artifacts.d.ts +2 -0
  19. package/dist/core/tool-artifacts.d.ts.map +1 -1
  20. package/dist/core/tool-artifacts.js +27 -1
  21. package/dist/core/tool-artifacts.js.map +1 -1
  22. package/dist/index.d.ts +1 -1
  23. package/dist/index.js +1 -1
  24. package/dist/runtime/agent-loop.d.ts.map +1 -1
  25. package/dist/runtime/agent-loop.js +3 -3
  26. package/dist/runtime/agent-loop.js.map +1 -1
  27. package/dist/runtime/agent-runtime-controller.d.ts +32 -1
  28. package/dist/runtime/agent-runtime-controller.d.ts.map +1 -1
  29. package/dist/runtime/agent-runtime-controller.js +241 -27
  30. package/dist/runtime/agent-runtime-controller.js.map +1 -1
  31. package/dist/runtime/agent-runtime-protocol.d.ts +4 -0
  32. package/dist/runtime/agent-runtime-protocol.d.ts.map +1 -1
  33. package/dist/runtime/agent-runtime-protocol.js.map +1 -1
  34. package/dist/runtime/agent-runtime-runner.d.ts +2 -1
  35. package/dist/runtime/agent-runtime-runner.d.ts.map +1 -1
  36. package/dist/runtime/durable-tool-receipt-reader.d.ts +32 -0
  37. package/dist/runtime/durable-tool-receipt-reader.d.ts.map +1 -0
  38. package/dist/runtime/durable-tool-receipt-reader.js +130 -0
  39. package/dist/runtime/durable-tool-receipt-reader.js.map +1 -0
  40. package/dist/runtime/legacy-thread-materializer.d.ts +31 -0
  41. package/dist/runtime/legacy-thread-materializer.d.ts.map +1 -1
  42. package/dist/runtime/legacy-thread-materializer.js +71 -17
  43. package/dist/runtime/legacy-thread-materializer.js.map +1 -1
  44. package/dist/runtime/orion-runtime-v1.d.ts +2 -0
  45. package/dist/runtime/orion-runtime-v1.d.ts.map +1 -1
  46. package/dist/runtime/orion-runtime-v1.js +7 -1
  47. package/dist/runtime/orion-runtime-v1.js.map +1 -1
  48. package/dist/runtime/orion-session-runner.d.ts +7 -2
  49. package/dist/runtime/orion-session-runner.d.ts.map +1 -1
  50. package/dist/runtime/orion-session-runner.js +16 -6
  51. package/dist/runtime/orion-session-runner.js.map +1 -1
  52. package/dist/runtime/product-bootstrap.d.ts +22 -0
  53. package/dist/runtime/product-bootstrap.d.ts.map +1 -0
  54. package/dist/runtime/product-bootstrap.js +374 -0
  55. package/dist/runtime/product-bootstrap.js.map +1 -0
  56. package/dist/runtime/product-orion-runtime.d.ts +2 -1
  57. package/dist/runtime/product-orion-runtime.d.ts.map +1 -1
  58. package/dist/runtime/product-orion-runtime.js +83 -13
  59. package/dist/runtime/product-orion-runtime.js.map +1 -1
  60. package/dist/runtime/protocol/runtime-protocol-v1.d.ts +1 -1
  61. package/dist/runtime/protocol/runtime-protocol-v1.js +1 -1
  62. package/dist/runtime/protocol/runtime-protocol-v1.js.map +1 -1
  63. package/dist/runtime/release-receipts.d.ts +66 -3
  64. package/dist/runtime/release-receipts.d.ts.map +1 -1
  65. package/dist/runtime/release-receipts.js +340 -7
  66. package/dist/runtime/release-receipts.js.map +1 -1
  67. package/dist/runtime/step-snapshot.d.ts.map +1 -1
  68. package/dist/runtime/step-snapshot.js +22 -2
  69. package/dist/runtime/step-snapshot.js.map +1 -1
  70. package/dist/runtime/subagents/runtime-integration.d.ts +1 -1
  71. package/dist/runtime/subagents/runtime-integration.d.ts.map +1 -1
  72. package/dist/runtime/subagents/runtime-integration.js +5 -2
  73. package/dist/runtime/subagents/runtime-integration.js.map +1 -1
  74. package/dist/runtime/thread-event-store.d.ts +80 -0
  75. package/dist/runtime/thread-event-store.d.ts.map +1 -1
  76. package/dist/runtime/thread-event-store.js +456 -22
  77. package/dist/runtime/thread-event-store.js.map +1 -1
  78. package/dist/runtime/thread-projection.d.ts +10 -0
  79. package/dist/runtime/thread-projection.d.ts.map +1 -1
  80. package/dist/runtime/thread-projection.js +40 -0
  81. package/dist/runtime/thread-projection.js.map +1 -1
  82. package/dist/runtime/thread-runtime.d.ts +3 -1
  83. package/dist/runtime/thread-runtime.d.ts.map +1 -1
  84. package/dist/runtime/thread-runtime.js +6 -0
  85. package/dist/runtime/thread-runtime.js.map +1 -1
  86. package/dist/runtime/thread-session-index.d.ts +84 -0
  87. package/dist/runtime/thread-session-index.d.ts.map +1 -0
  88. package/dist/runtime/thread-session-index.js +503 -0
  89. package/dist/runtime/thread-session-index.js.map +1 -0
  90. package/dist/runtime/thread-session-view.d.ts +70 -9
  91. package/dist/runtime/thread-session-view.d.ts.map +1 -1
  92. package/dist/runtime/thread-session-view.js +200 -82
  93. package/dist/runtime/thread-session-view.js.map +1 -1
  94. package/dist/runtime/thread-ui-adapter.d.ts +2 -0
  95. package/dist/runtime/thread-ui-adapter.d.ts.map +1 -1
  96. package/dist/runtime/thread-ui-adapter.js +86 -4
  97. package/dist/runtime/thread-ui-adapter.js.map +1 -1
  98. package/dist/runtime/tool-detail-repository.d.ts.map +1 -1
  99. package/dist/runtime/tool-detail-repository.js +23 -19
  100. package/dist/runtime/tool-detail-repository.js.map +1 -1
  101. package/dist/runtime/tool-receipt-validator.d.ts +21 -0
  102. package/dist/runtime/tool-receipt-validator.d.ts.map +1 -0
  103. package/dist/runtime/tool-receipt-validator.js +157 -0
  104. package/dist/runtime/tool-receipt-validator.js.map +1 -0
  105. package/dist/runtime/ui-events.d.ts +35 -0
  106. package/dist/runtime/ui-events.d.ts.map +1 -1
  107. package/dist/runtime/ui-events.js +1 -0
  108. package/dist/runtime/ui-events.js.map +1 -1
  109. package/dist/runtime/ui-view-model.d.ts +2 -0
  110. package/dist/runtime/ui-view-model.d.ts.map +1 -1
  111. package/dist/runtime/ui-view-model.js +7 -3
  112. package/dist/runtime/ui-view-model.js.map +1 -1
  113. package/dist/services/global-config.d.ts +25 -0
  114. package/dist/services/global-config.d.ts.map +1 -1
  115. package/dist/services/global-config.js +373 -5
  116. package/dist/services/global-config.js.map +1 -1
  117. package/dist/services/redaction.d.ts +4 -0
  118. package/dist/services/redaction.d.ts.map +1 -1
  119. package/dist/services/redaction.js +63 -0
  120. package/dist/services/redaction.js.map +1 -1
  121. package/dist/services/session-index.d.ts +16 -0
  122. package/dist/services/session-index.d.ts.map +1 -1
  123. package/dist/services/session-index.js +45 -36
  124. package/dist/services/session-index.js.map +1 -1
  125. package/dist/services/session-storage.d.ts +59 -0
  126. package/dist/services/session-storage.d.ts.map +1 -1
  127. package/dist/services/session-storage.js +306 -107
  128. package/dist/services/session-storage.js.map +1 -1
  129. package/dist/services/settings-coordinator.d.ts +174 -0
  130. package/dist/services/settings-coordinator.d.ts.map +1 -0
  131. package/dist/services/settings-coordinator.js +605 -0
  132. package/dist/services/settings-coordinator.js.map +1 -0
  133. package/dist/services/settings-document-repository.d.ts +138 -0
  134. package/dist/services/settings-document-repository.d.ts.map +1 -0
  135. package/dist/services/settings-document-repository.js +551 -0
  136. package/dist/services/settings-document-repository.js.map +1 -0
  137. package/dist/services/workspace-registry.d.ts +42 -0
  138. package/dist/services/workspace-registry.d.ts.map +1 -0
  139. package/dist/services/workspace-registry.js +222 -0
  140. package/dist/services/workspace-registry.js.map +1 -0
  141. package/dist/terminal-ui/launch.d.ts.map +1 -1
  142. package/dist/terminal-ui/launch.js +5 -0
  143. package/dist/terminal-ui/launch.js.map +1 -1
  144. package/dist/tui-ui/state.d.ts.map +1 -1
  145. package/dist/tui-ui/state.js +5 -0
  146. package/dist/tui-ui/state.js.map +1 -1
  147. package/dist/web/errors.d.ts +6 -0
  148. package/dist/web/errors.d.ts.map +1 -0
  149. package/dist/web/errors.js +13 -0
  150. package/dist/web/errors.js.map +1 -0
  151. package/dist/web/event-hub.d.ts +43 -0
  152. package/dist/web/event-hub.d.ts.map +1 -0
  153. package/dist/web/event-hub.js +323 -0
  154. package/dist/web/event-hub.js.map +1 -0
  155. package/dist/web/file-read-service.d.ts +55 -0
  156. package/dist/web/file-read-service.d.ts.map +1 -0
  157. package/dist/web/file-read-service.js +399 -0
  158. package/dist/web/file-read-service.js.map +1 -0
  159. package/dist/web/git-read-model-service.d.ts +77 -0
  160. package/dist/web/git-read-model-service.d.ts.map +1 -0
  161. package/dist/web/git-read-model-service.js +631 -0
  162. package/dist/web/git-read-model-service.js.map +1 -0
  163. package/dist/web/index.d.ts +6 -0
  164. package/dist/web/index.d.ts.map +1 -0
  165. package/dist/web/index.js +28 -0
  166. package/dist/web/index.js.map +1 -0
  167. package/dist/web/launch.d.ts +9 -0
  168. package/dist/web/launch.d.ts.map +1 -0
  169. package/dist/web/launch.js +64 -0
  170. package/dist/web/launch.js.map +1 -0
  171. package/dist/web/protocol.d.ts +408 -0
  172. package/dist/web/protocol.d.ts.map +1 -0
  173. package/dist/web/protocol.js +369 -0
  174. package/dist/web/protocol.js.map +1 -0
  175. package/dist/web/review-service.d.ts +38 -0
  176. package/dist/web/review-service.d.ts.map +1 -0
  177. package/dist/web/review-service.js +74 -0
  178. package/dist/web/review-service.js.map +1 -0
  179. package/dist/web/server.d.ts +20 -0
  180. package/dist/web/server.d.ts.map +1 -0
  181. package/dist/web/server.js +744 -0
  182. package/dist/web/server.js.map +1 -0
  183. package/dist/web/terminal-manager.d.ts +155 -0
  184. package/dist/web/terminal-manager.d.ts.map +1 -0
  185. package/dist/web/terminal-manager.js +728 -0
  186. package/dist/web/terminal-manager.js.map +1 -0
  187. package/dist/web/terminal-server.d.ts +8 -0
  188. package/dist/web/terminal-server.d.ts.map +1 -0
  189. package/dist/web/terminal-server.js +275 -0
  190. package/dist/web/terminal-server.js.map +1 -0
  191. package/dist/web/workbench-controller.d.ts +99 -0
  192. package/dist/web/workbench-controller.d.ts.map +1 -0
  193. package/dist/web/workbench-controller.js +1267 -0
  194. package/dist/web/workbench-controller.js.map +1 -0
  195. package/dist/web-client/assets/DiffViewer-DpKoD07C.js +5 -0
  196. package/dist/web-client/assets/FilesPanel-BkoLmgjR.js +2 -0
  197. package/dist/web-client/assets/GitPanel-D20StcdG.js +1 -0
  198. package/dist/web-client/assets/ReviewPanel-3MVWbMQV.js +1 -0
  199. package/dist/web-client/assets/TerminalPanel-BLQ592Fb.js +21 -0
  200. package/dist/web-client/assets/TerminalPanel-DLuoa74B.css +1 -0
  201. package/dist/web-client/assets/index-BkIDl_xk.js +16 -0
  202. package/dist/web-client/assets/index-DXMpnWE8.css +1 -0
  203. package/dist/web-client/index.html +16 -0
  204. package/docs/architecture/v0.3.0-web-api.yaml +1340 -0
  205. package/docs/architecture/v0.3.1-web-api.yaml +2290 -0
  206. package/docs/migration/v0.2.2-to-v0.3.0-settings.md +114 -0
  207. package/docs/migration/v0.2.2-to-v0.3.0.md +55 -0
  208. package/docs/migration/v0.3.0-to-v0.3.1.md +88 -0
  209. package/docs/orion.example.json +9 -2
  210. package/docs/plan/v0.3.0-node-runtime-compatibility-plan.md +57 -0
  211. package/docs/plan/v0.3.0-settings-integration-plan.md +740 -0
  212. package/docs/plan/v0.3.0-web-workbench-plan.md +376 -0
  213. package/docs/plan/v0.3.1-web-workbench-professional-shell-plan.md +848 -0
  214. package/docs/readme.md +22 -1
  215. package/docs/test/v0.3.1-web-workbench-e2e-plan.md +140 -0
  216. package/npm-shrinkwrap.json +1229 -45
  217. package/package.json +47 -11
@@ -0,0 +1,1340 @@
1
+ openapi: 3.1.0
2
+ info:
3
+ title: Orion Code Local Web API
4
+ version: 0.3.0
5
+ description: >-
6
+ Same-origin loopback API for the Orion Code Web Workbench. DSH's pinned browser carrier uses
7
+ HTTP POST for unary calls plus two downlink-only WebSockets (`/api/events.mux` and
8
+ `/api/events.host`). Orion v0.3.0 deliberately uses `POST /commands` as its control carrier plus
9
+ one replayable `GET /events` Server-Sent Events downlink; resource updates such as settings CAS
10
+ retain their explicit REST methods.
11
+ servers:
12
+ - url: /api/v1
13
+ paths:
14
+ /health:
15
+ get:
16
+ operationId: getHealth
17
+ responses:
18
+ '200':
19
+ description: Process health without secret or workspace data.
20
+ content:
21
+ application/json:
22
+ schema:
23
+ $ref: '#/components/schemas/HealthResponse'
24
+ /bootstrap:
25
+ get:
26
+ operationId: getBootstrap
27
+ responses:
28
+ '200':
29
+ description: Secret-free workbench bootstrap state.
30
+ content:
31
+ application/json:
32
+ schema:
33
+ $ref: '#/components/schemas/BootstrapResponse'
34
+ /workspaces:
35
+ get:
36
+ operationId: listWorkspaces
37
+ description: Cursor-paged canonical workspaces known to the local Orion installation.
38
+ parameters:
39
+ - $ref: '#/components/parameters/CollectionCursor'
40
+ - $ref: '#/components/parameters/PageSize'
41
+ responses:
42
+ '200':
43
+ description: One bounded workspace page.
44
+ content:
45
+ application/json:
46
+ schema:
47
+ $ref: '#/components/schemas/WorkspacePage'
48
+ '400': { $ref: '#/components/responses/Problem' }
49
+ '409': { $ref: '#/components/responses/Problem' }
50
+ /workspaces/activate:
51
+ post:
52
+ operationId: activateWorkspace
53
+ description: Select a canonical workspace after draining the previous runtime owner.
54
+ security: [{ webNonce: [] }]
55
+ requestBody:
56
+ required: true
57
+ content:
58
+ application/json:
59
+ schema:
60
+ $ref: '#/components/schemas/ActivateWorkspaceRequest'
61
+ responses:
62
+ '200':
63
+ description: Workspace selected, or an exact requestId retry replayed.
64
+ content:
65
+ application/json:
66
+ schema:
67
+ $ref: '#/components/schemas/WorkspaceMutationResult'
68
+ '400': { $ref: '#/components/responses/Problem' }
69
+ '403': { $ref: '#/components/responses/Problem' }
70
+ '409': { $ref: '#/components/responses/Problem' }
71
+ /sessions:
72
+ get:
73
+ operationId: listSessions
74
+ description: Cursor-paged sessions whose canonical project is the active workspace.
75
+ parameters:
76
+ - $ref: '#/components/parameters/CollectionCursor'
77
+ - $ref: '#/components/parameters/PageSize'
78
+ responses:
79
+ '200':
80
+ description: One bounded session page.
81
+ content:
82
+ application/json:
83
+ schema:
84
+ $ref: '#/components/schemas/SessionPage'
85
+ '400': { $ref: '#/components/responses/Problem' }
86
+ '409': { $ref: '#/components/responses/Problem' }
87
+ post:
88
+ operationId: createSession
89
+ security: [{ webNonce: [] }]
90
+ requestBody:
91
+ required: true
92
+ content:
93
+ application/json:
94
+ schema:
95
+ $ref: '#/components/schemas/CreateSessionRequest'
96
+ responses:
97
+ '201':
98
+ description: New active session, or an exact requestId retry replayed.
99
+ content:
100
+ application/json:
101
+ schema:
102
+ $ref: '#/components/schemas/SessionMutationResult'
103
+ '400': { $ref: '#/components/responses/Problem' }
104
+ '403': { $ref: '#/components/responses/Problem' }
105
+ '409': { $ref: '#/components/responses/Problem' }
106
+ /sessions/{sessionId}:
107
+ patch:
108
+ operationId: renameSession
109
+ security: [{ webNonce: [] }]
110
+ parameters:
111
+ - $ref: '#/components/parameters/SessionId'
112
+ requestBody:
113
+ required: true
114
+ content:
115
+ application/json:
116
+ schema:
117
+ $ref: '#/components/schemas/RenameSessionRequest'
118
+ responses:
119
+ '200':
120
+ description: Updated session, or an exact requestId retry replayed.
121
+ content:
122
+ application/json:
123
+ schema:
124
+ $ref: '#/components/schemas/SessionMutationResult'
125
+ '400': { $ref: '#/components/responses/Problem' }
126
+ '403': { $ref: '#/components/responses/Problem' }
127
+ '404': { $ref: '#/components/responses/Problem' }
128
+ '409': { $ref: '#/components/responses/Problem' }
129
+ /sessions/{sessionId}/activate:
130
+ post:
131
+ operationId: activateSession
132
+ description: Select and restore a session after draining the previous runtime owner.
133
+ security: [{ webNonce: [] }]
134
+ parameters:
135
+ - $ref: '#/components/parameters/SessionId'
136
+ requestBody:
137
+ required: true
138
+ content:
139
+ application/json:
140
+ schema:
141
+ $ref: '#/components/schemas/MutationRequest'
142
+ responses:
143
+ '200':
144
+ description: Session selected, or an exact requestId retry replayed.
145
+ content:
146
+ application/json:
147
+ schema:
148
+ $ref: '#/components/schemas/CommandResult'
149
+ '400': { $ref: '#/components/responses/Problem' }
150
+ '403': { $ref: '#/components/responses/Problem' }
151
+ '404': { $ref: '#/components/responses/Problem' }
152
+ '409': { $ref: '#/components/responses/Problem' }
153
+ /sessions/{sessionId}/snapshot:
154
+ get:
155
+ operationId: getSessionSnapshot
156
+ description: >-
157
+ Recovery snapshot for one session. Transcript items are cursor-paged; `threadCursor`
158
+ identifies the durable Thread projection edge and the independent `eventCursor` resumes
159
+ `/events`. Pending approvals are projected here and remain pending across refresh, network
160
+ loss and tab closure.
161
+ parameters:
162
+ - $ref: '#/components/parameters/SessionId'
163
+ - $ref: '#/components/parameters/TranscriptCursor'
164
+ - $ref: '#/components/parameters/PageSize'
165
+ responses:
166
+ '200':
167
+ description: Sanitized recovery state from durable runtime sources.
168
+ content:
169
+ application/json:
170
+ schema:
171
+ $ref: '#/components/schemas/SessionSnapshot'
172
+ '400': { $ref: '#/components/responses/Problem' }
173
+ '404': { $ref: '#/components/responses/Problem' }
174
+ '409': { $ref: '#/components/responses/Problem' }
175
+ /tool-details:
176
+ get:
177
+ operationId: listToolDetails
178
+ description: >-
179
+ Cursor-paged safe summaries from the active workspace's project artifact repository.
180
+ Current artifact metadata has no session identity, so this route is deliberately
181
+ workspace/project-scoped and must not be presented as proof that an artifact belongs to a
182
+ particular session.
183
+ parameters:
184
+ - $ref: '#/components/parameters/CollectionCursor'
185
+ - $ref: '#/components/parameters/PageSize'
186
+ responses:
187
+ '200':
188
+ description: One bounded tool-detail summary page.
189
+ content:
190
+ application/json:
191
+ schema:
192
+ $ref: '#/components/schemas/ToolDetailSummaryPage'
193
+ '400': { $ref: '#/components/responses/Problem' }
194
+ '404': { $ref: '#/components/responses/Problem' }
195
+ '409': { $ref: '#/components/responses/Problem' }
196
+ /tool-details/{callId}:
197
+ get:
198
+ operationId: getToolDetail
199
+ description: >-
200
+ Byte-paged output from a pre-sanitized derivative resolved only from the active workspace's
201
+ artifact list. `offsetBytes` addresses derivative bytes, never raw tool-output bytes, so a
202
+ caller cannot bypass redaction by choosing a sensitive-field boundary. The current artifact
203
+ metadata cannot prove session ownership; the host returns no artifact filesystem path and
204
+ makes no session-attribution claim.
205
+ parameters:
206
+ - $ref: '#/components/parameters/CallId'
207
+ - $ref: '#/components/parameters/OffsetBytes'
208
+ - $ref: '#/components/parameters/LimitBytes'
209
+ responses:
210
+ '200':
211
+ description: One UTF-8-safe redacted output page.
212
+ content:
213
+ application/json:
214
+ schema:
215
+ $ref: '#/components/schemas/ToolDetailPage'
216
+ '400': { $ref: '#/components/responses/Problem' }
217
+ '404': { $ref: '#/components/responses/Problem' }
218
+ /skills:
219
+ get:
220
+ operationId: listSkills
221
+ description: >-
222
+ Cursor-paged safe Skill descriptors. Bodies, resource paths and trigger implementations are
223
+ excluded.
224
+ parameters:
225
+ - $ref: '#/components/parameters/CollectionCursor'
226
+ - $ref: '#/components/parameters/PageSize'
227
+ responses:
228
+ '200':
229
+ description: One bounded Skill descriptor page.
230
+ content:
231
+ application/json:
232
+ schema:
233
+ $ref: '#/components/schemas/SkillPage'
234
+ '400': { $ref: '#/components/responses/Problem' }
235
+ '409': { $ref: '#/components/responses/Problem' }
236
+ /mcp:
237
+ get:
238
+ operationId: listMcpServers
239
+ description: >-
240
+ Cursor-paged safe MCP catalog/runtime summaries. Commands, endpoints, headers and
241
+ credentials are excluded and this read never activates a dormant server.
242
+ parameters:
243
+ - $ref: '#/components/parameters/CollectionCursor'
244
+ - $ref: '#/components/parameters/PageSize'
245
+ responses:
246
+ '200':
247
+ description: One bounded MCP summary page.
248
+ content:
249
+ application/json:
250
+ schema:
251
+ $ref: '#/components/schemas/McpPage'
252
+ '400': { $ref: '#/components/responses/Problem' }
253
+ '409': { $ref: '#/components/responses/Problem' }
254
+ /commands:
255
+ post:
256
+ operationId: dispatchCommand
257
+ description: >-
258
+ Dispatch a renderer-neutral runtime mutation. Approval decisions allow only once, project
259
+ or global scope. Interrupt and shutdown paths deny affected unresolved approvals and fail
260
+ their waiting tool calls closed.
261
+ security: [{ webNonce: [] }]
262
+ requestBody:
263
+ required: true
264
+ content:
265
+ application/json:
266
+ schema:
267
+ $ref: '#/components/schemas/WebCommand'
268
+ responses:
269
+ '202':
270
+ description: Accepted command, or an exact requestId retry replayed.
271
+ content:
272
+ application/json:
273
+ schema:
274
+ $ref: '#/components/schemas/CommandResult'
275
+ '400': { $ref: '#/components/responses/Problem' }
276
+ '403': { $ref: '#/components/responses/Problem' }
277
+ '409': { $ref: '#/components/responses/Problem' }
278
+ /events:
279
+ get:
280
+ operationId: streamEvents
281
+ description: >-
282
+ One Server-Sent Events downlink. `cursor` or `Last-Event-ID` is the last delivered durable
283
+ sequence; the query value wins when both are present. Each SSE `id` is the decimal cursor,
284
+ while the JSON envelope also carries a UUID `eventId`. Disconnecting this stream does not
285
+ resolve or deny pending approvals.
286
+ parameters:
287
+ - $ref: '#/components/parameters/EventCursor'
288
+ - $ref: '#/components/parameters/LastEventId'
289
+ responses:
290
+ '200':
291
+ description: text/event-stream of discriminated WebEventEnvelope values.
292
+ content:
293
+ text/event-stream:
294
+ schema:
295
+ $ref: '#/components/schemas/WebEventEnvelope'
296
+ '400': { $ref: '#/components/responses/Problem' }
297
+ '409': { $ref: '#/components/responses/Problem' }
298
+ /diagnostics:
299
+ get:
300
+ operationId: getDiagnostics
301
+ responses:
302
+ '200':
303
+ description: Sanitized runtime and harness diagnostics.
304
+ content:
305
+ application/json:
306
+ schema:
307
+ type: object
308
+ additionalProperties: true
309
+ /settings:
310
+ get:
311
+ operationId: getSettings
312
+ responses:
313
+ '200':
314
+ description: Current secret-free, source-aware Settings document and durable revision.
315
+ content:
316
+ application/json:
317
+ schema:
318
+ $ref: '#/components/schemas/SettingsDocument'
319
+ patch:
320
+ operationId: updateSettings
321
+ description: >-
322
+ Atomically apply one bounded batch only when `expectedRevision` equals the keyed revision of
323
+ the exact current orion.json bytes. Duplicate keys and partial commits are rejected.
324
+ security: [{ webNonce: [] }]
325
+ requestBody:
326
+ required: true
327
+ content:
328
+ application/json:
329
+ schema:
330
+ $ref: '#/components/schemas/UpdateSettingsRequest'
331
+ responses:
332
+ '200':
333
+ description: Updated settings, or an exact requestId retry replayed.
334
+ content:
335
+ application/json:
336
+ schema:
337
+ $ref: '#/components/schemas/SettingsMutationResult'
338
+ '400': { $ref: '#/components/responses/Problem' }
339
+ '403': { $ref: '#/components/responses/Problem' }
340
+ '409':
341
+ description: requestId/body conflict, stale expectedRevision, or busy Runtime; no field was applied.
342
+ content:
343
+ application/problem+json:
344
+ schema:
345
+ $ref: '#/components/schemas/Problem'
346
+ '422': { $ref: '#/components/responses/Problem' }
347
+ '503': { $ref: '#/components/responses/Problem' }
348
+ /settings/open-document:
349
+ post:
350
+ operationId: openSettingsDocument
351
+ description: >-
352
+ Open the Host-resolved orion.json in the native text editor. This loopback-only action accepts
353
+ no path and never returns the resolved filesystem path.
354
+ security: [{ webNonce: [] }]
355
+ requestBody:
356
+ required: true
357
+ content:
358
+ application/json:
359
+ schema:
360
+ type: object
361
+ additionalProperties: false
362
+ required: [requestId]
363
+ properties:
364
+ requestId: { $ref: '#/components/schemas/RequestId' }
365
+ responses:
366
+ '200':
367
+ description: The pathless open request was accepted or replayed idempotently.
368
+ content:
369
+ application/json:
370
+ schema:
371
+ type: object
372
+ additionalProperties: false
373
+ required: [requestId, opened]
374
+ properties:
375
+ requestId: { $ref: '#/components/schemas/RequestId' }
376
+ opened: { type: boolean, const: true }
377
+ '400': { $ref: '#/components/responses/Problem' }
378
+ '403': { $ref: '#/components/responses/Problem' }
379
+ '409': { $ref: '#/components/responses/Problem' }
380
+ '503': { $ref: '#/components/responses/Problem' }
381
+ components:
382
+ securitySchemes:
383
+ webNonce:
384
+ type: apiKey
385
+ in: header
386
+ name: X-Orion-Web-Nonce
387
+ parameters:
388
+ SessionId:
389
+ in: path
390
+ name: sessionId
391
+ required: true
392
+ schema: { type: string, minLength: 1, maxLength: 256 }
393
+ CallId:
394
+ in: path
395
+ name: callId
396
+ required: true
397
+ description: >-
398
+ Opaque identifier returned by the active workspace's tool-detail summary. The current file
399
+ repository aliases callId to its project artifact identifier.
400
+ schema: { type: string, minLength: 1, maxLength: 256 }
401
+ CollectionCursor:
402
+ in: query
403
+ name: cursor
404
+ required: false
405
+ description: >-
406
+ Opaque continuation returned by the preceding page. It binds the route scope, the complete
407
+ ordered collection revision and the last stable item key. Any insertion, deletion or
408
+ reorder makes it stale; the Host returns 409 collection_cursor_stale and the client restarts
409
+ from the first page.
410
+ schema: { type: string, minLength: 1, maxLength: 512 }
411
+ TranscriptCursor:
412
+ in: query
413
+ name: cursor
414
+ required: false
415
+ description: >-
416
+ Opaque backward-page continuation bound to the Session's Thread identity, immutable
417
+ transcript-manifest revision and page boundary. A newer Thread revision returns 409
418
+ transcript_cursor_stale; the client must recover a fresh tail snapshot before paging again.
419
+ schema: { type: string, minLength: 1, maxLength: 512 }
420
+ PageSize:
421
+ in: query
422
+ name: pageSize
423
+ required: false
424
+ schema: { type: integer, minimum: 1, maximum: 100, default: 50 }
425
+ OffsetBytes:
426
+ in: query
427
+ name: offsetBytes
428
+ required: false
429
+ schema: { type: integer, minimum: 0, default: 0 }
430
+ LimitBytes:
431
+ in: query
432
+ name: limitBytes
433
+ required: false
434
+ schema: { type: integer, minimum: 1, maximum: 1048576, default: 65536 }
435
+ EventCursor:
436
+ in: query
437
+ name: cursor
438
+ required: false
439
+ description: Last durable Web event cursor accepted by the client.
440
+ schema: { type: integer, minimum: 0, default: 0 }
441
+ LastEventId:
442
+ in: header
443
+ name: Last-Event-ID
444
+ required: false
445
+ description: Browser-provided fallback for the last durable Web event cursor.
446
+ schema: { type: string, pattern: '^[0-9]+$' }
447
+ responses:
448
+ Problem:
449
+ description: Safe structured error with no secret-bearing data.
450
+ content:
451
+ application/problem+json:
452
+ schema:
453
+ $ref: '#/components/schemas/Problem'
454
+ schemas:
455
+ HealthResponse:
456
+ type: object
457
+ additionalProperties: false
458
+ required: [ok, version]
459
+ properties:
460
+ ok: { type: boolean, const: true }
461
+ version: { type: string }
462
+ BootstrapResponse:
463
+ type: object
464
+ additionalProperties: false
465
+ required: [apiVersion, productVersion, nonce, workspace, configured, settings, capabilities]
466
+ properties:
467
+ apiVersion: { type: integer, const: 1 }
468
+ productVersion: { type: string }
469
+ nonce: { type: string, minLength: 32 }
470
+ workspace: { type: string }
471
+ configured: { type: boolean }
472
+ activeSessionId: { type: [string, 'null'] }
473
+ settings: { $ref: '#/components/schemas/SettingsDocument' }
474
+ capabilities:
475
+ type: object
476
+ additionalProperties: false
477
+ required: [goal, plan, skills, mcp, diagnostics]
478
+ properties:
479
+ goal: { type: boolean }
480
+ plan: { type: boolean }
481
+ skills: { type: boolean }
482
+ mcp: { type: boolean }
483
+ diagnostics: { type: boolean }
484
+ MutationRequest:
485
+ type: object
486
+ additionalProperties: false
487
+ required: [requestId]
488
+ properties:
489
+ requestId: { $ref: '#/components/schemas/RequestId' }
490
+ RequestId:
491
+ type: string
492
+ minLength: 1
493
+ maxLength: 128
494
+ description: >-
495
+ Client-generated idempotency key. Reuse is valid only for a byte-equivalent normalized
496
+ mutation body.
497
+ ActivateWorkspaceRequest:
498
+ type: object
499
+ additionalProperties: false
500
+ required: [requestId, path]
501
+ properties:
502
+ requestId: { $ref: '#/components/schemas/RequestId' }
503
+ path: { type: string, minLength: 1, maxLength: 4096 }
504
+ CreateSessionRequest:
505
+ type: object
506
+ additionalProperties: false
507
+ required: [requestId]
508
+ properties:
509
+ requestId: { $ref: '#/components/schemas/RequestId' }
510
+ name: { type: string, minLength: 1, maxLength: 120 }
511
+ RenameSessionRequest:
512
+ type: object
513
+ additionalProperties: false
514
+ required: [requestId, name]
515
+ properties:
516
+ requestId: { $ref: '#/components/schemas/RequestId' }
517
+ name: { type: string, minLength: 1, maxLength: 120 }
518
+ WorkspaceSummary:
519
+ type: object
520
+ additionalProperties: false
521
+ required: [path, label, active, sessionCount]
522
+ properties:
523
+ path: { type: string }
524
+ label: { type: string }
525
+ active: { type: boolean }
526
+ sessionCount: { type: integer, minimum: 0 }
527
+ WorkspacePage:
528
+ type: object
529
+ additionalProperties: false
530
+ required: [items, nextCursor]
531
+ properties:
532
+ items:
533
+ type: array
534
+ maxItems: 100
535
+ items: { $ref: '#/components/schemas/WorkspaceSummary' }
536
+ nextCursor: { type: [string, 'null'] }
537
+ WorkspaceMutationResult:
538
+ type: object
539
+ additionalProperties: false
540
+ required: [requestId, active, page]
541
+ properties:
542
+ requestId: { $ref: '#/components/schemas/RequestId' }
543
+ active: { type: string }
544
+ page: { $ref: '#/components/schemas/WorkspacePage' }
545
+ SessionSummary:
546
+ type: object
547
+ additionalProperties: false
548
+ required: [id, projectPath, model, createdAt, updatedAt, messageCount]
549
+ properties:
550
+ id: { type: string }
551
+ projectPath: { type: string }
552
+ name: { type: string }
553
+ model: { type: string }
554
+ createdAt: { type: string, format: date-time }
555
+ updatedAt: { type: string, format: date-time }
556
+ messageCount: { type: integer, minimum: 0 }
557
+ taskSummary: { type: string }
558
+ activeGoalId: { type: string }
559
+ activeGoalObjective: { type: string }
560
+ SessionPage:
561
+ type: object
562
+ additionalProperties: false
563
+ required: [items, nextCursor]
564
+ properties:
565
+ items:
566
+ type: array
567
+ maxItems: 100
568
+ items: { $ref: '#/components/schemas/SessionSummary' }
569
+ nextCursor: { type: [string, 'null'] }
570
+ SessionMutationResult:
571
+ type: object
572
+ additionalProperties: false
573
+ required: [requestId, session]
574
+ properties:
575
+ requestId: { $ref: '#/components/schemas/RequestId' }
576
+ session: { $ref: '#/components/schemas/SessionSummary' }
577
+ TranscriptMessage:
578
+ type: object
579
+ additionalProperties: false
580
+ required: [id, role, content, timestamp]
581
+ properties:
582
+ id: { type: string }
583
+ role:
584
+ type: string
585
+ enum: [system, user, assistant, tool]
586
+ content: { type: string }
587
+ timestamp: { type: number, minimum: 0 }
588
+ modelVisibleContent: { type: string }
589
+ toolCallId: { type: string }
590
+ tool_calls:
591
+ type: array
592
+ items: {}
593
+ appliedSkills:
594
+ type: array
595
+ items: { type: string }
596
+ TranscriptPage:
597
+ type: object
598
+ additionalProperties: false
599
+ required: [items, nextCursor]
600
+ properties:
601
+ items:
602
+ type: array
603
+ maxItems: 100
604
+ items: { $ref: '#/components/schemas/TranscriptMessage' }
605
+ nextCursor: { type: [string, 'null'] }
606
+ GoalView:
607
+ type: object
608
+ additionalProperties: false
609
+ description: >-
610
+ Goal projection from the latest valid TurnCommitV1. A legacy Goal sidecar is eligible only
611
+ as a one-time migration seed and is never a competing read authority.
612
+ required: [authority, digest, state]
613
+ properties:
614
+ authority: { type: string, const: turn_commit }
615
+ digest: { type: string, minLength: 1 }
616
+ state:
617
+ description: >-
618
+ Opaque JSON value parsed from TurnCommitV1.goalState. The v0.3.0 wire type is unknown;
619
+ this contract does not invent required Goal fields or status/revision enums.
620
+ PlanView:
621
+ type: object
622
+ additionalProperties: false
623
+ description: >-
624
+ Exact safe projection of the PlanReceipt bound into TurnCommitV1. There is no Web review,
625
+ approval, status or step model. After the planning turn commits, Orion restores returnMode
626
+ and automatically schedules a separate execution request.
627
+ required: [body, returnMode, digest]
628
+ properties:
629
+ body: { type: string, minLength: 1 }
630
+ returnMode: { type: string, enum: [build, auto] }
631
+ digest: { type: string, minLength: 1 }
632
+ PendingApproval:
633
+ type: object
634
+ additionalProperties: false
635
+ description: Runtime-owned approval that survives browser disconnect and tab closure.
636
+ required: [id, toolName, sanitizedArguments, allowedScopes]
637
+ properties:
638
+ id: { type: string }
639
+ toolName: { type: string }
640
+ reason: { type: string }
641
+ sanitizedArguments: { type: object, additionalProperties: true }
642
+ allowedScopes:
643
+ type: array
644
+ const: [once, project, global]
645
+ items: { type: string, enum: [once, project, global] }
646
+ FollowupItem:
647
+ type: object
648
+ additionalProperties: false
649
+ required: [id, text, queuedAt]
650
+ properties:
651
+ id: { type: string }
652
+ text: { type: string }
653
+ queuedAt: { type: number, minimum: 0 }
654
+ SessionRuntimeSnapshot:
655
+ type: object
656
+ additionalProperties: false
657
+ required:
658
+ - active
659
+ - processing
660
+ - agentMode
661
+ - permissionMode
662
+ - status
663
+ - followups
664
+ - followupLimit
665
+ - contextUsage
666
+ - tokenUsage
667
+ properties:
668
+ active: { type: boolean }
669
+ processing: { type: boolean }
670
+ agentMode: { type: string }
671
+ permissionMode: { type: string }
672
+ status: { type: string }
673
+ followups:
674
+ type: array
675
+ items: { $ref: '#/components/schemas/FollowupItem' }
676
+ followupLimit: { type: integer, minimum: 0 }
677
+ contextUsage:
678
+ description: Runtime context-usage projection or null; the wire type is currently unknown.
679
+ tokenUsage:
680
+ description: Runtime token-usage projection or null; the wire type is currently unknown.
681
+ SessionSnapshot:
682
+ type: object
683
+ additionalProperties: false
684
+ required:
685
+ - apiVersion
686
+ - session
687
+ - threadId
688
+ - threadCursor
689
+ - eventCursor
690
+ - threadStatus
691
+ - transcript
692
+ - runtime
693
+ - pendingApprovals
694
+ - goal
695
+ - plan
696
+ - recoveryDiagnostics
697
+ properties:
698
+ apiVersion: { type: integer, const: 1 }
699
+ session: { $ref: '#/components/schemas/SessionSummary' }
700
+ threadId:
701
+ type: [string, 'null']
702
+ description: Null for a legacy session that has no materialized Thread identity.
703
+ threadCursor:
704
+ type: integer
705
+ minimum: 0
706
+ description: Latest projected durable Thread sequence; independent of eventCursor.
707
+ eventCursor: { type: integer, minimum: 0 }
708
+ projectionDigest: { type: string }
709
+ threadStatus: { type: string, enum: [new, active, idle, legacy] }
710
+ activeTurnId: { type: string }
711
+ transcript: { $ref: '#/components/schemas/TranscriptPage' }
712
+ runtime: { $ref: '#/components/schemas/SessionRuntimeSnapshot' }
713
+ pendingApprovals:
714
+ type: array
715
+ items: { $ref: '#/components/schemas/PendingApproval' }
716
+ goal:
717
+ oneOf:
718
+ - $ref: '#/components/schemas/GoalView'
719
+ - type: 'null'
720
+ plan:
721
+ oneOf:
722
+ - $ref: '#/components/schemas/PlanView'
723
+ - type: 'null'
724
+ recoveryDiagnostics:
725
+ type: array
726
+ items: {}
727
+ SkillSummary:
728
+ type: object
729
+ additionalProperties: false
730
+ required:
731
+ - id
732
+ - name
733
+ - description
734
+ - providerId
735
+ - sourceScope
736
+ - modelInvocable
737
+ - userInvocable
738
+ - requestedCapabilities
739
+ - digest
740
+ properties:
741
+ id: { type: string }
742
+ name: { type: string }
743
+ description: { type: string }
744
+ providerId: { type: string }
745
+ sourceScope: { type: string, enum: [builtin, user, configured, project, remote] }
746
+ modelInvocable: { type: boolean }
747
+ userInvocable: { type: boolean }
748
+ requestedCapabilities:
749
+ type: array
750
+ items: { type: string }
751
+ digest: { type: string }
752
+ SkillPage:
753
+ type: object
754
+ additionalProperties: false
755
+ required: [items, nextCursor]
756
+ properties:
757
+ items:
758
+ type: array
759
+ maxItems: 100
760
+ items: { $ref: '#/components/schemas/SkillSummary' }
761
+ nextCursor: { type: [string, 'null'] }
762
+ McpServerSummary:
763
+ type: object
764
+ additionalProperties: false
765
+ required:
766
+ - id
767
+ - name
768
+ - transport
769
+ - tags
770
+ - disabled
771
+ - state
772
+ - generation
773
+ - toolCount
774
+ - activeCallCount
775
+ properties:
776
+ id: { type: string }
777
+ name: { type: string }
778
+ description: { type: string }
779
+ transport:
780
+ type: string
781
+ enum: [stdio, sse, http, streamable-http, websocket]
782
+ tags:
783
+ type: array
784
+ items: { type: string }
785
+ disabled: { type: boolean }
786
+ state:
787
+ type: string
788
+ enum: [dormant, activating, connected, idle, draining, failed]
789
+ generation: { type: integer, minimum: 0 }
790
+ toolCount: { type: integer, minimum: 0 }
791
+ activeCallCount: { type: integer, minimum: 0 }
792
+ failure: { type: string }
793
+ McpPage:
794
+ type: object
795
+ additionalProperties: false
796
+ required: [items, nextCursor]
797
+ properties:
798
+ items:
799
+ type: array
800
+ maxItems: 100
801
+ items: { $ref: '#/components/schemas/McpServerSummary' }
802
+ nextCursor: { type: [string, 'null'] }
803
+ ToolDetailSummary:
804
+ type: object
805
+ additionalProperties: false
806
+ required: [callId, sequence, toolName, state, outputBytes, hasArtifact]
807
+ properties:
808
+ callId: { type: string }
809
+ sequence: { type: integer, minimum: 0 }
810
+ turnId: { type: string }
811
+ toolName: { type: string }
812
+ state: { type: string, enum: [success, error, skipped] }
813
+ outputBytes: { type: integer, minimum: 0 }
814
+ artifactId:
815
+ type: string
816
+ description: Opaque project artifact identifier; it is not a filesystem path.
817
+ hasArtifact: { type: boolean }
818
+ ToolDetailSummaryPage:
819
+ type: object
820
+ additionalProperties: false
821
+ required: [items, nextCursor]
822
+ properties:
823
+ items:
824
+ type: array
825
+ maxItems: 100
826
+ items: { $ref: '#/components/schemas/ToolDetailSummary' }
827
+ nextCursor: { type: [string, 'null'] }
828
+ ToolDetailPage:
829
+ type: object
830
+ additionalProperties: false
831
+ required: [content, offsetBytes, totalBytes, redacted]
832
+ properties:
833
+ content: { type: string }
834
+ offsetBytes: { type: integer, minimum: 0 }
835
+ nextOffsetBytes:
836
+ type: [integer, 'null']
837
+ minimum: 0
838
+ description: Omitted or null when the page reaches the end of the artifact.
839
+ totalBytes: { type: integer, minimum: 0 }
840
+ redacted:
841
+ type: boolean
842
+ description: >-
843
+ True when content is served from the browser-safe, pre-sanitized derivative. It does
844
+ not imply that this particular page contained a secret replacement.
845
+ SettingsRevision:
846
+ type: string
847
+ pattern: '^hmac-sha256:[a-f0-9]{64}$'
848
+ description: >-
849
+ Opaque HMAC over the exact current config bytes. The local HMAC key is never exposed.
850
+ SettingsFieldCommon:
851
+ type: object
852
+ required: [source, scope, applies, overridden, writable]
853
+ properties:
854
+ source: { type: string, enum: [internal, model, global, project, session] }
855
+ scope: { type: string, enum: [global, project, session] }
856
+ applies:
857
+ type: string
858
+ enum: [live, next-logical-request, new-session, restart]
859
+ overridden: { type: boolean }
860
+ writable: { type: boolean }
861
+ blockedReason:
862
+ type: string
863
+ enum: [runtime_busy, read_only, invalid_document]
864
+ ThemeSettingsField:
865
+ allOf:
866
+ - $ref: '#/components/schemas/SettingsFieldCommon'
867
+ - type: object
868
+ required: [effectiveValue]
869
+ properties:
870
+ effectiveValue: { type: string, enum: [system, light, dark] }
871
+ explicitValue: { type: string, enum: [system, light, dark] }
872
+ inheritedValue: { type: string, enum: [system, light, dark] }
873
+ MotionSettingsField:
874
+ allOf:
875
+ - $ref: '#/components/schemas/SettingsFieldCommon'
876
+ - type: object
877
+ required: [effectiveValue]
878
+ properties:
879
+ effectiveValue: { type: string, enum: [system, reduced] }
880
+ explicitValue: { type: string, enum: [system, reduced] }
881
+ inheritedValue: { type: string, enum: [system, reduced] }
882
+ ModelSettingsField:
883
+ allOf:
884
+ - $ref: '#/components/schemas/SettingsFieldCommon'
885
+ - type: object
886
+ required: [effectiveValue]
887
+ properties:
888
+ effectiveValue: { type: string, minLength: 1 }
889
+ explicitValue: { type: string, minLength: 1 }
890
+ inheritedValue: { type: string, minLength: 1 }
891
+ EffortSettingsField:
892
+ allOf:
893
+ - $ref: '#/components/schemas/SettingsFieldCommon'
894
+ - type: object
895
+ required: [effectiveValue]
896
+ properties:
897
+ effectiveValue: { $ref: '#/components/schemas/EffortPreference' }
898
+ explicitValue: { $ref: '#/components/schemas/EffortPreference' }
899
+ inheritedValue: { $ref: '#/components/schemas/EffortPreference' }
900
+ ToolConfirmationSettingsField:
901
+ allOf:
902
+ - $ref: '#/components/schemas/SettingsFieldCommon'
903
+ - type: object
904
+ required: [effectiveValue]
905
+ properties:
906
+ effectiveValue: { type: string, enum: [allow, ask, deny] }
907
+ explicitValue: { type: string, enum: [allow, ask, deny] }
908
+ inheritedValue: { type: string, enum: [allow, ask, deny] }
909
+ EffortPreference:
910
+ type: string
911
+ enum: [auto, none, minimal, low, medium, high, xhigh, max]
912
+ ModelSummary:
913
+ type: object
914
+ additionalProperties: false
915
+ required: [id, label]
916
+ properties:
917
+ id: { type: string, minLength: 1 }
918
+ label: { type: string, minLength: 1 }
919
+ provider: { type: string }
920
+ CredentialSlot:
921
+ type: object
922
+ additionalProperties: false
923
+ required: [providerId, state, source, writable]
924
+ properties:
925
+ providerId: { type: string, minLength: 1 }
926
+ state: { type: string, enum: [ready, missing, unavailable] }
927
+ source: { type: string, enum: [environment, legacy, none] }
928
+ writable: { type: boolean, const: false }
929
+ SettingsDocument:
930
+ type: object
931
+ additionalProperties: false
932
+ required:
933
+ - schemaVersion
934
+ - revision
935
+ - state
936
+ - writable
937
+ - hasDocument
938
+ - workspace
939
+ - sections
940
+ - models
941
+ - credentials
942
+ properties:
943
+ schemaVersion: { type: integer, const: 1 }
944
+ revision: { $ref: '#/components/schemas/SettingsRevision' }
945
+ state: { type: string, enum: [ready, invalid, read-only, unavailable] }
946
+ writable: { type: boolean }
947
+ hasDocument: { type: boolean }
948
+ workspace: { type: string }
949
+ sections:
950
+ type: object
951
+ additionalProperties: false
952
+ required: [appearance, defaults, permissions]
953
+ properties:
954
+ appearance:
955
+ type: object
956
+ additionalProperties: false
957
+ required: [theme, motion]
958
+ properties:
959
+ theme: { $ref: '#/components/schemas/ThemeSettingsField' }
960
+ motion: { $ref: '#/components/schemas/MotionSettingsField' }
961
+ defaults:
962
+ type: object
963
+ additionalProperties: false
964
+ required: [model, effort]
965
+ properties:
966
+ model: { $ref: '#/components/schemas/ModelSettingsField' }
967
+ effort: { $ref: '#/components/schemas/EffortSettingsField' }
968
+ permissions:
969
+ type: object
970
+ additionalProperties: false
971
+ required: [toolConfirmation]
972
+ properties:
973
+ toolConfirmation:
974
+ $ref: '#/components/schemas/ToolConfirmationSettingsField'
975
+ models:
976
+ type: array
977
+ items: { $ref: '#/components/schemas/ModelSummary' }
978
+ credentials:
979
+ type: array
980
+ items: { $ref: '#/components/schemas/CredentialSlot' }
981
+ currentSession:
982
+ type: object
983
+ additionalProperties: false
984
+ required: [model, effort, overridesProjectEffort]
985
+ properties:
986
+ model: { type: string }
987
+ effort: { $ref: '#/components/schemas/EffortPreference' }
988
+ overridesProjectEffort: { type: boolean }
989
+ diagnostic:
990
+ type: object
991
+ additionalProperties: false
992
+ required: [code, message]
993
+ properties:
994
+ code: { type: string }
995
+ message: { type: string }
996
+ SettingsOperation:
997
+ oneOf:
998
+ - $ref: '#/components/schemas/SetThemeSetting'
999
+ - $ref: '#/components/schemas/UnsetThemeSetting'
1000
+ - $ref: '#/components/schemas/SetMotionSetting'
1001
+ - $ref: '#/components/schemas/UnsetMotionSetting'
1002
+ - $ref: '#/components/schemas/SetModelSetting'
1003
+ - $ref: '#/components/schemas/UnsetModelSetting'
1004
+ - $ref: '#/components/schemas/SetEffortSetting'
1005
+ - $ref: '#/components/schemas/UnsetEffortSetting'
1006
+ - $ref: '#/components/schemas/SetToolConfirmationSetting'
1007
+ - $ref: '#/components/schemas/UnsetToolConfirmationSetting'
1008
+ SetThemeSetting:
1009
+ type: object
1010
+ additionalProperties: false
1011
+ required: [op, key, value]
1012
+ properties:
1013
+ op: { type: string, const: set }
1014
+ key: { type: string, const: appearance.theme }
1015
+ value: { type: string, enum: [system, light, dark] }
1016
+ UnsetThemeSetting:
1017
+ type: object
1018
+ additionalProperties: false
1019
+ required: [op, key]
1020
+ properties:
1021
+ op: { type: string, const: unset }
1022
+ key: { type: string, const: appearance.theme }
1023
+ SetMotionSetting:
1024
+ type: object
1025
+ additionalProperties: false
1026
+ required: [op, key, value]
1027
+ properties:
1028
+ op: { type: string, const: set }
1029
+ key: { type: string, const: appearance.motion }
1030
+ value: { type: string, enum: [system, reduced] }
1031
+ UnsetMotionSetting:
1032
+ type: object
1033
+ additionalProperties: false
1034
+ required: [op, key]
1035
+ properties:
1036
+ op: { type: string, const: unset }
1037
+ key: { type: string, const: appearance.motion }
1038
+ SetModelSetting:
1039
+ type: object
1040
+ additionalProperties: false
1041
+ required: [op, key, value]
1042
+ properties:
1043
+ op: { type: string, const: set }
1044
+ key: { type: string, const: defaults.model }
1045
+ value: { type: string, minLength: 1, maxLength: 200 }
1046
+ UnsetModelSetting:
1047
+ type: object
1048
+ additionalProperties: false
1049
+ required: [op, key]
1050
+ properties:
1051
+ op: { type: string, const: unset }
1052
+ key: { type: string, const: defaults.model }
1053
+ SetEffortSetting:
1054
+ type: object
1055
+ additionalProperties: false
1056
+ required: [op, key, value]
1057
+ properties:
1058
+ op: { type: string, const: set }
1059
+ key: { type: string, const: defaults.effort }
1060
+ value: { $ref: '#/components/schemas/EffortPreference' }
1061
+ UnsetEffortSetting:
1062
+ type: object
1063
+ additionalProperties: false
1064
+ required: [op, key]
1065
+ properties:
1066
+ op: { type: string, const: unset }
1067
+ key: { type: string, const: defaults.effort }
1068
+ SetToolConfirmationSetting:
1069
+ type: object
1070
+ additionalProperties: false
1071
+ required: [op, key, value]
1072
+ properties:
1073
+ op: { type: string, const: set }
1074
+ key: { type: string, const: permissions.toolConfirmation }
1075
+ value: { type: string, enum: [allow, ask, deny] }
1076
+ UnsetToolConfirmationSetting:
1077
+ type: object
1078
+ additionalProperties: false
1079
+ required: [op, key]
1080
+ properties:
1081
+ op: { type: string, const: unset }
1082
+ key: { type: string, const: permissions.toolConfirmation }
1083
+ UpdateSettingsRequest:
1084
+ type: object
1085
+ additionalProperties: false
1086
+ required: [requestId, expectedRevision, operations]
1087
+ properties:
1088
+ requestId: { $ref: '#/components/schemas/RequestId' }
1089
+ expectedRevision: { $ref: '#/components/schemas/SettingsRevision' }
1090
+ operations:
1091
+ type: array
1092
+ minItems: 1
1093
+ maxItems: 20
1094
+ items: { $ref: '#/components/schemas/SettingsOperation' }
1095
+ SettingsMutationResult:
1096
+ type: object
1097
+ additionalProperties: false
1098
+ required: [requestId, revision, appliedKeys, settings]
1099
+ properties:
1100
+ requestId: { $ref: '#/components/schemas/RequestId' }
1101
+ revision: { $ref: '#/components/schemas/SettingsRevision' }
1102
+ appliedKeys:
1103
+ type: array
1104
+ minItems: 1
1105
+ maxItems: 20
1106
+ items:
1107
+ type: string
1108
+ enum:
1109
+ - appearance.theme
1110
+ - appearance.motion
1111
+ - defaults.model
1112
+ - defaults.effort
1113
+ - permissions.toolConfirmation
1114
+ settings: { $ref: '#/components/schemas/SettingsDocument' }
1115
+ WebCommand:
1116
+ type: object
1117
+ additionalProperties: false
1118
+ required: [requestId, expectedSessionId, type]
1119
+ allOf:
1120
+ - if:
1121
+ properties:
1122
+ type: { const: set_agent_mode }
1123
+ required: [type]
1124
+ then:
1125
+ required: [agentMode]
1126
+ properties:
1127
+ requestId: { $ref: '#/components/schemas/RequestId' }
1128
+ expectedSessionId:
1129
+ type: string
1130
+ minLength: 1
1131
+ maxLength: 256
1132
+ description: >-
1133
+ Compare-and-swap guard for the active Session. The Host returns 409
1134
+ active_session_changed without dispatching when the selection no longer matches.
1135
+ type:
1136
+ type: string
1137
+ enum:
1138
+ - submit
1139
+ - queue_followup
1140
+ - remove_followup
1141
+ - clear_followups
1142
+ - interrupt
1143
+ - permission_decision
1144
+ - goal_control
1145
+ - permission_mode_change
1146
+ - cycle_agent_mode
1147
+ - set_agent_mode
1148
+ text: { type: string, maxLength: 1048576 }
1149
+ itemId: { type: string }
1150
+ requestPermissionId: { type: string }
1151
+ approved: { type: boolean }
1152
+ scope: { type: string, enum: [once, project, global] }
1153
+ goalAction: { type: string, enum: [create, status, pause, resume, clear] }
1154
+ objective: { type: string }
1155
+ toolConfirmation: { type: string, enum: [allow, ask, deny] }
1156
+ agentMode: { type: string, enum: [interactive, plan, auto] }
1157
+ CommandResult:
1158
+ type: object
1159
+ additionalProperties: false
1160
+ required: [requestId, result]
1161
+ properties:
1162
+ requestId: { $ref: '#/components/schemas/RequestId' }
1163
+ result: { type: string }
1164
+ detail: { type: string }
1165
+ WebEventEnvelope:
1166
+ description: >-
1167
+ Versioned, cursor-ordered event union. `type` is the discriminator; every branch carries
1168
+ explicit `sessionId` and `threadId` keys. Runtime events allow null identities before a
1169
+ session or Thread exists; committed Thread events require both values to be non-null.
1170
+ oneOf:
1171
+ - $ref: '#/components/schemas/RuntimeEventEnvelope'
1172
+ - $ref: '#/components/schemas/ThreadEventEnvelope'
1173
+ - $ref: '#/components/schemas/WorkbenchStateEnvelope'
1174
+ - $ref: '#/components/schemas/SettingsInvalidatedEnvelope'
1175
+ - $ref: '#/components/schemas/ReplayResetEnvelope'
1176
+ discriminator:
1177
+ propertyName: type
1178
+ mapping:
1179
+ runtime_event: '#/components/schemas/RuntimeEventEnvelope'
1180
+ thread_event: '#/components/schemas/ThreadEventEnvelope'
1181
+ workbench_state: '#/components/schemas/WorkbenchStateEnvelope'
1182
+ settings_invalidated: '#/components/schemas/SettingsInvalidatedEnvelope'
1183
+ replay_reset: '#/components/schemas/ReplayResetEnvelope'
1184
+ RuntimeEventEnvelope:
1185
+ type: object
1186
+ additionalProperties: false
1187
+ required:
1188
+ - apiVersion
1189
+ - eventId
1190
+ - cursor
1191
+ - sessionId
1192
+ - threadId
1193
+ - type
1194
+ - durable
1195
+ - timestamp
1196
+ - payload
1197
+ properties:
1198
+ apiVersion: { type: integer, const: 1 }
1199
+ eventId: { type: string, format: uuid }
1200
+ cursor: { type: integer, minimum: 1 }
1201
+ sessionId: { type: [string, 'null'] }
1202
+ threadId: { type: [string, 'null'] }
1203
+ type: { type: string, const: runtime_event }
1204
+ durable: { type: boolean }
1205
+ timestamp: { type: string, format: date-time }
1206
+ payload:
1207
+ type: object
1208
+ additionalProperties: false
1209
+ required: [eventType, value]
1210
+ properties:
1211
+ eventType: { type: string, minLength: 1 }
1212
+ value: { type: object, additionalProperties: true }
1213
+ ThreadEventEnvelope:
1214
+ type: object
1215
+ additionalProperties: false
1216
+ required:
1217
+ - apiVersion
1218
+ - eventId
1219
+ - cursor
1220
+ - sessionId
1221
+ - threadId
1222
+ - type
1223
+ - durable
1224
+ - timestamp
1225
+ - payload
1226
+ properties:
1227
+ apiVersion: { type: integer, const: 1 }
1228
+ eventId: { type: string, format: uuid }
1229
+ cursor: { type: integer, minimum: 1 }
1230
+ sessionId: { type: string, minLength: 1 }
1231
+ threadId: { type: string, minLength: 1 }
1232
+ type: { type: string, const: thread_event }
1233
+ durable: { type: boolean, const: true }
1234
+ timestamp: { type: string, format: date-time }
1235
+ payload:
1236
+ type: object
1237
+ additionalProperties: false
1238
+ required: [sequence, eventType, value]
1239
+ properties:
1240
+ sequence: { type: integer, minimum: 1 }
1241
+ eventType: { type: string, minLength: 1 }
1242
+ value: { type: object, additionalProperties: true }
1243
+ WorkbenchStateEnvelope:
1244
+ type: object
1245
+ additionalProperties: false
1246
+ required:
1247
+ - apiVersion
1248
+ - eventId
1249
+ - cursor
1250
+ - sessionId
1251
+ - threadId
1252
+ - type
1253
+ - durable
1254
+ - timestamp
1255
+ - payload
1256
+ properties:
1257
+ apiVersion: { type: integer, const: 1 }
1258
+ eventId: { type: string, format: uuid }
1259
+ cursor: { type: integer, minimum: 1 }
1260
+ sessionId: { type: [string, 'null'] }
1261
+ threadId: { type: [string, 'null'] }
1262
+ type: { type: string, const: workbench_state }
1263
+ durable: { type: boolean }
1264
+ timestamp: { type: string, format: date-time }
1265
+ payload:
1266
+ type: object
1267
+ additionalProperties: false
1268
+ required: [workspace, activeSessionId]
1269
+ properties:
1270
+ workspace: { type: string }
1271
+ activeSessionId: { type: [string, 'null'] }
1272
+ SettingsInvalidatedEnvelope:
1273
+ type: object
1274
+ additionalProperties: false
1275
+ required:
1276
+ - apiVersion
1277
+ - eventId
1278
+ - cursor
1279
+ - sessionId
1280
+ - threadId
1281
+ - type
1282
+ - durable
1283
+ - timestamp
1284
+ - payload
1285
+ properties:
1286
+ apiVersion: { type: integer, const: 1 }
1287
+ eventId: { type: string, format: uuid }
1288
+ cursor: { type: integer, minimum: 1 }
1289
+ sessionId: { type: [string, 'null'] }
1290
+ threadId: { type: [string, 'null'] }
1291
+ type: { type: string, const: settings_invalidated }
1292
+ durable: { type: boolean, const: false }
1293
+ timestamp: { type: string, format: date-time }
1294
+ payload:
1295
+ type: object
1296
+ additionalProperties: false
1297
+ required: [revision, reason, state]
1298
+ properties:
1299
+ revision: { $ref: '#/components/schemas/SettingsRevision' }
1300
+ reason: { type: string, enum: [local-write, external-edit, workspace-change] }
1301
+ state: { type: string, enum: [ready, invalid] }
1302
+ ReplayResetEnvelope:
1303
+ type: object
1304
+ additionalProperties: false
1305
+ required:
1306
+ - apiVersion
1307
+ - eventId
1308
+ - cursor
1309
+ - sessionId
1310
+ - threadId
1311
+ - type
1312
+ - durable
1313
+ - timestamp
1314
+ - payload
1315
+ properties:
1316
+ apiVersion: { type: integer, const: 1 }
1317
+ eventId: { type: string, format: uuid }
1318
+ cursor: { type: integer, minimum: 1 }
1319
+ sessionId: { type: [string, 'null'] }
1320
+ threadId: { type: [string, 'null'] }
1321
+ type: { type: string, const: replay_reset }
1322
+ durable: { type: boolean, const: true }
1323
+ timestamp: { type: string, format: date-time }
1324
+ payload:
1325
+ type: object
1326
+ additionalProperties: false
1327
+ required: [reason, snapshotRequired]
1328
+ properties:
1329
+ reason: { type: string }
1330
+ snapshotRequired: { type: boolean, const: true }
1331
+ Problem:
1332
+ type: object
1333
+ additionalProperties: false
1334
+ required: [type, title, status, code]
1335
+ properties:
1336
+ type: { type: string }
1337
+ title: { type: string }
1338
+ status: { type: integer }
1339
+ code: { type: string, minLength: 1 }
1340
+ detail: { type: string }