@orion-agents/orion-code 0.2.2 → 0.3.0

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