code60-transmission-server 0.1.0-staging.6 → 0.1.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 (104) hide show
  1. package/INTENT.md +47 -0
  2. package/README.md +87 -308
  3. package/dist/src/acp.js +130 -0
  4. package/dist/src/contract.js +133 -0
  5. package/dist/src/engine.js +650 -0
  6. package/dist/src/linux.js +84 -0
  7. package/dist/src/main.js +81 -25
  8. package/dist/src/repository.js +94 -0
  9. package/dist/src/service.js +196 -0
  10. package/package.json +19 -35
  11. package/reference/openapi.json +1073 -0
  12. package/README.engine.md +0 -463
  13. package/dist/src/broker/filesystem.js +0 -385
  14. package/dist/src/broker/index.js +0 -734
  15. package/dist/src/broker/native/README.md +0 -207
  16. package/dist/src/broker/native/build.js +0 -46
  17. package/dist/src/broker/native/command-helper.c +0 -93
  18. package/dist/src/broker/native/fs-helper.c +0 -529
  19. package/dist/src/broker/native/git-helper.c +0 -205
  20. package/dist/src/broker/policy.js +0 -149
  21. package/dist/src/broker/startup-lock.js +0 -14
  22. package/dist/src/broker/types.js +0 -11
  23. package/dist/src/cli/configure.js +0 -193
  24. package/dist/src/cli/daemon.js +0 -369
  25. package/dist/src/cli/helpers.js +0 -112
  26. package/dist/src/cli/main.js +0 -189
  27. package/dist/src/cli/runtime-build.js +0 -38
  28. package/dist/src/config/coding-policy.js +0 -4
  29. package/dist/src/config/deployment.js +0 -182
  30. package/dist/src/config/documents.js +0 -29
  31. package/dist/src/config/profile-validation.js +0 -123
  32. package/dist/src/config/schema-graph.js +0 -237
  33. package/dist/src/config/schema-loader.js +0 -185
  34. package/dist/src/config/validation-pool.js +0 -105
  35. package/dist/src/config/validation-protocol.js +0 -1
  36. package/dist/src/config/validation-worker.js +0 -106
  37. package/dist/src/config/workflow-language.js +0 -9
  38. package/dist/src/config/workflow-schema.json +0 -545
  39. package/dist/src/config/workflow-types.js +0 -1
  40. package/dist/src/config/workflow-validation.js +0 -95
  41. package/dist/src/engine/budgets.js +0 -50
  42. package/dist/src/engine/clocks.js +0 -27
  43. package/dist/src/engine/commands.js +0 -472
  44. package/dist/src/engine/contracts.js +0 -11
  45. package/dist/src/engine/drain-state.js +0 -31
  46. package/dist/src/engine/effective-permissions.js +0 -120
  47. package/dist/src/engine/instruction-pins.js +0 -205
  48. package/dist/src/engine/retries.js +0 -50
  49. package/dist/src/engine/state.js +0 -1
  50. package/dist/src/engine/timing.js +0 -23
  51. package/dist/src/engine/tool-observations.js +0 -87
  52. package/dist/src/engine/workflow-engine.js +0 -1862
  53. package/dist/src/mcp/catalog.js +0 -71
  54. package/dist/src/mcp/main.js +0 -26
  55. package/dist/src/mcp/server.js +0 -147
  56. package/dist/src/runtime/codex-app-server.js +0 -91
  57. package/dist/src/runtime/containment.js +0 -82
  58. package/dist/src/runtime/engine-driver.js +0 -221
  59. package/dist/src/runtime/json-line-writer.js +0 -192
  60. package/dist/src/runtime/pinned-instruction-sources.js +0 -24
  61. package/dist/src/runtime/protocol-client.js +0 -264
  62. package/dist/src/runtime/protocol-pool.js +0 -183
  63. package/dist/src/runtime/protocol-projection.js +0 -393
  64. package/dist/src/runtime/protocol-types.js +0 -1
  65. package/dist/src/runtime/protocol-worker.js +0 -18
  66. package/dist/src/runtime/provider-bridge.js +0 -290
  67. package/dist/src/runtime/provider-credentials.js +0 -41
  68. package/dist/src/runtime/provider-transport.js +0 -406
  69. package/dist/src/runtime/runtime-broker.js +0 -213
  70. package/dist/src/runtime/workspace-instructions.js +0 -120
  71. package/dist/src/runtime/workspace-view.js +0 -74
  72. package/dist/src/server/api-contract.json +0 -11614
  73. package/dist/src/server/api-types.js +0 -1
  74. package/dist/src/server/application.js +0 -44
  75. package/dist/src/server/auth.js +0 -67
  76. package/dist/src/server/broker-handlers.js +0 -242
  77. package/dist/src/server/coding.js +0 -254
  78. package/dist/src/server/control-plane.js +0 -50
  79. package/dist/src/server/deployment.js +0 -249
  80. package/dist/src/server/errors.js +0 -22
  81. package/dist/src/server/history-handlers.js +0 -127
  82. package/dist/src/server/http.js +0 -124
  83. package/dist/src/server/paging.js +0 -56
  84. package/dist/src/server/publication.js +0 -119
  85. package/dist/src/server/tool-event-handler.js +0 -77
  86. package/dist/src/server/workspace-handlers.js +0 -34
  87. package/dist/src/storage/coordinator.js +0 -224
  88. package/dist/src/storage/startup-lock.js +0 -71
  89. package/dist/src/storage/store.js +0 -167
  90. package/dist/src/tools/check-worker.js +0 -81
  91. package/dist/src/tools/checks.js +0 -117
  92. package/dist/src/tools/command-check.js +0 -34
  93. package/dist/src/tools/commands.js +0 -310
  94. package/dist/src/tools/developer.js +0 -351
  95. package/dist/src/tools/dns.js +0 -248
  96. package/dist/src/tools/http-contract.js +0 -38
  97. package/dist/src/tools/http.js +0 -358
  98. package/dist/src/tools/index.js +0 -194
  99. package/dist/src/tools/worker-check.js +0 -73
  100. package/dist/src/workspaces/git.js +0 -227
  101. package/dist/src/workspaces/index.js +0 -937
  102. package/dist/src/workspaces/source.js +0 -295
  103. package/examples/deployment.local.json +0 -22
  104. package/scripts/postinstall.mjs +0 -26
@@ -0,0 +1,1073 @@
1
+ {
2
+ "openapi": "3.1.0",
3
+ "info": {
4
+ "title": "Transmission workflow service",
5
+ "version": "1"
6
+ },
7
+ "paths": {
8
+ "/start_workflow": {
9
+ "post": {
10
+ "operationId": "start_workflow",
11
+ "description": "Run the exact workflow confirmed by the user. Design ordered tasks, each with implementation instructions and an independent verification prompt. Show the project, tasks and criteria to the user and obtain confirmation before calling. Reuse the same key on reconnect.",
12
+ "security": [
13
+ {
14
+ "localToken": []
15
+ }
16
+ ],
17
+ "requestBody": {
18
+ "required": true,
19
+ "content": {
20
+ "application/json": {
21
+ "schema": {
22
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
23
+ "type": "object",
24
+ "properties": {
25
+ "repository": {
26
+ "type": "string",
27
+ "minLength": 1,
28
+ "maxLength": 65536
29
+ },
30
+ "tasks": {
31
+ "minItems": 1,
32
+ "maxItems": 100,
33
+ "type": "array",
34
+ "items": {
35
+ "type": "object",
36
+ "properties": {
37
+ "name": {
38
+ "type": "string",
39
+ "minLength": 1,
40
+ "maxLength": 65536
41
+ },
42
+ "instructions": {
43
+ "type": "string",
44
+ "minLength": 1,
45
+ "maxLength": 65536
46
+ },
47
+ "verify": {
48
+ "type": "string",
49
+ "minLength": 1,
50
+ "maxLength": 65536
51
+ },
52
+ "checks": {
53
+ "maxItems": 30,
54
+ "type": "array",
55
+ "items": {
56
+ "type": "string",
57
+ "minLength": 1,
58
+ "maxLength": 65536
59
+ }
60
+ }
61
+ },
62
+ "required": [
63
+ "name",
64
+ "instructions",
65
+ "verify"
66
+ ],
67
+ "additionalProperties": false
68
+ }
69
+ },
70
+ "confirmed": {
71
+ "type": "boolean",
72
+ "const": true
73
+ },
74
+ "idempotencyKey": {
75
+ "type": "string",
76
+ "minLength": 1,
77
+ "maxLength": 256
78
+ },
79
+ "repairs": {
80
+ "default": 2,
81
+ "type": "integer",
82
+ "minimum": 0,
83
+ "maximum": 30
84
+ },
85
+ "retries": {
86
+ "default": 2,
87
+ "type": "integer",
88
+ "minimum": 0,
89
+ "maximum": 30
90
+ },
91
+ "autoApprove": {
92
+ "default": true,
93
+ "type": "boolean"
94
+ }
95
+ },
96
+ "required": [
97
+ "repository",
98
+ "tasks",
99
+ "confirmed",
100
+ "idempotencyKey"
101
+ ],
102
+ "additionalProperties": false
103
+ }
104
+ }
105
+ }
106
+ },
107
+ "responses": {
108
+ "200": {
109
+ "description": "Workflow snapshot",
110
+ "content": {
111
+ "application/json": {
112
+ "schema": {
113
+ "$ref": "#/components/schemas/WorkflowSnapshot"
114
+ }
115
+ }
116
+ }
117
+ },
118
+ "400": {
119
+ "description": "Invalid input or workflow state"
120
+ },
121
+ "403": {
122
+ "description": "Invalid engine token"
123
+ }
124
+ }
125
+ }
126
+ },
127
+ "/get_workflow": {
128
+ "post": {
129
+ "operationId": "get_workflow",
130
+ "description": "Read an ordered task snapshot by run ID, including the active task index, decision, accepted results, and event cursor. Pass eventCursor as after to get_workflow_events for subsequent activity.",
131
+ "security": [
132
+ {
133
+ "localToken": []
134
+ }
135
+ ],
136
+ "requestBody": {
137
+ "required": true,
138
+ "content": {
139
+ "application/json": {
140
+ "schema": {
141
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
142
+ "type": "object",
143
+ "properties": {
144
+ "runId": {
145
+ "type": "string",
146
+ "format": "uuid",
147
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
148
+ }
149
+ },
150
+ "required": [
151
+ "runId"
152
+ ],
153
+ "additionalProperties": false
154
+ }
155
+ }
156
+ }
157
+ },
158
+ "responses": {
159
+ "200": {
160
+ "description": "Workflow snapshot",
161
+ "content": {
162
+ "application/json": {
163
+ "schema": {
164
+ "$ref": "#/components/schemas/WorkflowSnapshot"
165
+ }
166
+ }
167
+ }
168
+ },
169
+ "400": {
170
+ "description": "Invalid input or workflow state"
171
+ },
172
+ "403": {
173
+ "description": "Invalid engine token"
174
+ }
175
+ }
176
+ }
177
+ },
178
+ "/get_workflow_plan": {
179
+ "post": {
180
+ "operationId": "get_workflow_plan",
181
+ "description": "Read the complete effective task definitions and planRevision. Tasks before activeTaskIndex are completed and immutable. Use the current revision as expectedRevision when revising a paused workflow.",
182
+ "security": [
183
+ {
184
+ "localToken": []
185
+ }
186
+ ],
187
+ "requestBody": {
188
+ "required": true,
189
+ "content": {
190
+ "application/json": {
191
+ "schema": {
192
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
193
+ "type": "object",
194
+ "properties": {
195
+ "runId": {
196
+ "type": "string",
197
+ "format": "uuid",
198
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
199
+ }
200
+ },
201
+ "required": [
202
+ "runId"
203
+ ],
204
+ "additionalProperties": false
205
+ }
206
+ }
207
+ }
208
+ },
209
+ "responses": {
210
+ "200": {
211
+ "description": "Workflow plan",
212
+ "content": {
213
+ "application/json": {
214
+ "schema": {
215
+ "$ref": "#/components/schemas/WorkflowPlan"
216
+ }
217
+ }
218
+ }
219
+ },
220
+ "400": {
221
+ "description": "Invalid input or workflow state"
222
+ },
223
+ "403": {
224
+ "description": "Invalid engine token"
225
+ }
226
+ }
227
+ }
228
+ },
229
+ "/revise_workflow": {
230
+ "post": {
231
+ "operationId": "revise_workflow",
232
+ "description": "Replace all unfinished tasks of a fully paused workflow, including the interrupted task and its verification criteria. Present the revised tasks and criteria to the user and obtain confirmation before calling with confirmed:true. Supply expectedRevision from get_workflow_plan and a new idempotencyKey; retry uncertain outcomes with the exact same request. Completed work, history and spent allowances are preserved. The run stays paused; call resume_workflow separately.",
233
+ "security": [
234
+ {
235
+ "localToken": []
236
+ }
237
+ ],
238
+ "requestBody": {
239
+ "required": true,
240
+ "content": {
241
+ "application/json": {
242
+ "schema": {
243
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
244
+ "type": "object",
245
+ "properties": {
246
+ "runId": {
247
+ "type": "string",
248
+ "format": "uuid",
249
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
250
+ },
251
+ "expectedRevision": {
252
+ "type": "integer",
253
+ "minimum": 0,
254
+ "maximum": 9007199254740991
255
+ },
256
+ "idempotencyKey": {
257
+ "type": "string",
258
+ "minLength": 1,
259
+ "maxLength": 256
260
+ },
261
+ "confirmed": {
262
+ "type": "boolean",
263
+ "const": true
264
+ },
265
+ "remainingTasks": {
266
+ "minItems": 1,
267
+ "maxItems": 100,
268
+ "type": "array",
269
+ "items": {
270
+ "type": "object",
271
+ "properties": {
272
+ "name": {
273
+ "type": "string",
274
+ "minLength": 1,
275
+ "maxLength": 65536
276
+ },
277
+ "instructions": {
278
+ "type": "string",
279
+ "minLength": 1,
280
+ "maxLength": 65536
281
+ },
282
+ "verify": {
283
+ "type": "string",
284
+ "minLength": 1,
285
+ "maxLength": 65536
286
+ },
287
+ "checks": {
288
+ "maxItems": 30,
289
+ "type": "array",
290
+ "items": {
291
+ "type": "string",
292
+ "minLength": 1,
293
+ "maxLength": 65536
294
+ }
295
+ }
296
+ },
297
+ "required": [
298
+ "name",
299
+ "instructions",
300
+ "verify"
301
+ ],
302
+ "additionalProperties": false
303
+ }
304
+ }
305
+ },
306
+ "required": [
307
+ "runId",
308
+ "expectedRevision",
309
+ "idempotencyKey",
310
+ "confirmed",
311
+ "remainingTasks"
312
+ ],
313
+ "additionalProperties": false
314
+ }
315
+ }
316
+ }
317
+ },
318
+ "responses": {
319
+ "200": {
320
+ "description": "Workflow snapshot",
321
+ "content": {
322
+ "application/json": {
323
+ "schema": {
324
+ "$ref": "#/components/schemas/WorkflowSnapshot"
325
+ }
326
+ }
327
+ }
328
+ },
329
+ "400": {
330
+ "description": "Invalid input or workflow state"
331
+ },
332
+ "403": {
333
+ "description": "Invalid engine token"
334
+ }
335
+ }
336
+ }
337
+ },
338
+ "/get_workflow_events": {
339
+ "post": {
340
+ "operationId": "get_workflow_events",
341
+ "description": "Read the next page of progress, sessions, native tools and verifier feedback. Use the last sequence number as after.",
342
+ "security": [
343
+ {
344
+ "localToken": []
345
+ }
346
+ ],
347
+ "requestBody": {
348
+ "required": true,
349
+ "content": {
350
+ "application/json": {
351
+ "schema": {
352
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
353
+ "type": "object",
354
+ "properties": {
355
+ "runId": {
356
+ "type": "string",
357
+ "format": "uuid",
358
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
359
+ },
360
+ "after": {
361
+ "default": 0,
362
+ "type": "integer",
363
+ "minimum": 0,
364
+ "maximum": 9007199254740991
365
+ }
366
+ },
367
+ "required": [
368
+ "runId"
369
+ ],
370
+ "additionalProperties": false
371
+ }
372
+ }
373
+ }
374
+ },
375
+ "responses": {
376
+ "200": {
377
+ "description": "Workflow receipt"
378
+ },
379
+ "400": {
380
+ "description": "Invalid input or workflow state"
381
+ },
382
+ "403": {
383
+ "description": "Invalid engine token"
384
+ }
385
+ }
386
+ }
387
+ },
388
+ "/get_workflow_diff": {
389
+ "post": {
390
+ "operationId": "get_workflow_diff",
391
+ "description": "Read a page of the accepted patch relative to the initial working tree. Offset is in bytes; content is base64.",
392
+ "security": [
393
+ {
394
+ "localToken": []
395
+ }
396
+ ],
397
+ "requestBody": {
398
+ "required": true,
399
+ "content": {
400
+ "application/json": {
401
+ "schema": {
402
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
403
+ "type": "object",
404
+ "properties": {
405
+ "runId": {
406
+ "type": "string",
407
+ "format": "uuid",
408
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
409
+ },
410
+ "offset": {
411
+ "default": 0,
412
+ "type": "integer",
413
+ "minimum": 0,
414
+ "maximum": 9007199254740991
415
+ }
416
+ },
417
+ "required": [
418
+ "runId"
419
+ ],
420
+ "additionalProperties": false
421
+ }
422
+ }
423
+ }
424
+ },
425
+ "responses": {
426
+ "200": {
427
+ "description": "Workflow receipt"
428
+ },
429
+ "400": {
430
+ "description": "Invalid input or workflow state"
431
+ },
432
+ "403": {
433
+ "description": "Invalid engine token"
434
+ }
435
+ }
436
+ }
437
+ },
438
+ "/answer_workflow_question": {
439
+ "post": {
440
+ "operationId": "answer_workflow_question",
441
+ "description": "Answer the outstanding decision by ID. For a permission question select an offered option ID.",
442
+ "security": [
443
+ {
444
+ "localToken": []
445
+ }
446
+ ],
447
+ "requestBody": {
448
+ "required": true,
449
+ "content": {
450
+ "application/json": {
451
+ "schema": {
452
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
453
+ "type": "object",
454
+ "properties": {
455
+ "runId": {
456
+ "type": "string",
457
+ "format": "uuid",
458
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
459
+ },
460
+ "questionId": {
461
+ "type": "string",
462
+ "format": "uuid",
463
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
464
+ },
465
+ "answer": {
466
+ "type": "string",
467
+ "minLength": 1,
468
+ "maxLength": 65536
469
+ }
470
+ },
471
+ "required": [
472
+ "runId",
473
+ "questionId",
474
+ "answer"
475
+ ],
476
+ "additionalProperties": false
477
+ }
478
+ }
479
+ }
480
+ },
481
+ "responses": {
482
+ "200": {
483
+ "description": "Workflow snapshot",
484
+ "content": {
485
+ "application/json": {
486
+ "schema": {
487
+ "$ref": "#/components/schemas/WorkflowSnapshot"
488
+ }
489
+ }
490
+ }
491
+ },
492
+ "400": {
493
+ "description": "Invalid input or workflow state"
494
+ },
495
+ "403": {
496
+ "description": "Invalid engine token"
497
+ }
498
+ }
499
+ }
500
+ },
501
+ "/send_workflow_message": {
502
+ "post": {
503
+ "operationId": "send_workflow_message",
504
+ "description": "Deliver new guidance before the current task is accepted.",
505
+ "security": [
506
+ {
507
+ "localToken": []
508
+ }
509
+ ],
510
+ "requestBody": {
511
+ "required": true,
512
+ "content": {
513
+ "application/json": {
514
+ "schema": {
515
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
516
+ "type": "object",
517
+ "properties": {
518
+ "runId": {
519
+ "type": "string",
520
+ "format": "uuid",
521
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
522
+ },
523
+ "message": {
524
+ "type": "string",
525
+ "minLength": 1,
526
+ "maxLength": 65536
527
+ }
528
+ },
529
+ "required": [
530
+ "runId",
531
+ "message"
532
+ ],
533
+ "additionalProperties": false
534
+ }
535
+ }
536
+ }
537
+ },
538
+ "responses": {
539
+ "200": {
540
+ "description": "Workflow snapshot",
541
+ "content": {
542
+ "application/json": {
543
+ "schema": {
544
+ "$ref": "#/components/schemas/WorkflowSnapshot"
545
+ }
546
+ }
547
+ }
548
+ },
549
+ "400": {
550
+ "description": "Invalid input or workflow state"
551
+ },
552
+ "403": {
553
+ "description": "Invalid engine token"
554
+ }
555
+ }
556
+ }
557
+ },
558
+ "/pause_workflow": {
559
+ "post": {
560
+ "operationId": "pause_workflow",
561
+ "description": "Interrupt active agents and pause the workflow, preserving files and accepted tasks. Returns paused after agents stop. Pause survives engine restart.",
562
+ "security": [
563
+ {
564
+ "localToken": []
565
+ }
566
+ ],
567
+ "requestBody": {
568
+ "required": true,
569
+ "content": {
570
+ "application/json": {
571
+ "schema": {
572
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
573
+ "type": "object",
574
+ "properties": {
575
+ "runId": {
576
+ "type": "string",
577
+ "format": "uuid",
578
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
579
+ }
580
+ },
581
+ "required": [
582
+ "runId"
583
+ ],
584
+ "additionalProperties": false
585
+ }
586
+ }
587
+ }
588
+ },
589
+ "responses": {
590
+ "200": {
591
+ "description": "Workflow snapshot",
592
+ "content": {
593
+ "application/json": {
594
+ "schema": {
595
+ "$ref": "#/components/schemas/WorkflowSnapshot"
596
+ }
597
+ }
598
+ }
599
+ },
600
+ "400": {
601
+ "description": "Invalid input or workflow state"
602
+ },
603
+ "403": {
604
+ "description": "Invalid engine token"
605
+ }
606
+ }
607
+ }
608
+ },
609
+ "/resume_workflow": {
610
+ "post": {
611
+ "operationId": "resume_workflow",
612
+ "description": "Resume a paused workflow with fresh sessions for the first unfinished task without spending a retry. An unanswered scope question still requires an answer.",
613
+ "security": [
614
+ {
615
+ "localToken": []
616
+ }
617
+ ],
618
+ "requestBody": {
619
+ "required": true,
620
+ "content": {
621
+ "application/json": {
622
+ "schema": {
623
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
624
+ "type": "object",
625
+ "properties": {
626
+ "runId": {
627
+ "type": "string",
628
+ "format": "uuid",
629
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
630
+ }
631
+ },
632
+ "required": [
633
+ "runId"
634
+ ],
635
+ "additionalProperties": false
636
+ }
637
+ }
638
+ }
639
+ },
640
+ "responses": {
641
+ "200": {
642
+ "description": "Workflow snapshot",
643
+ "content": {
644
+ "application/json": {
645
+ "schema": {
646
+ "$ref": "#/components/schemas/WorkflowSnapshot"
647
+ }
648
+ }
649
+ }
650
+ },
651
+ "400": {
652
+ "description": "Invalid input or workflow state"
653
+ },
654
+ "403": {
655
+ "description": "Invalid engine token"
656
+ }
657
+ }
658
+ }
659
+ },
660
+ "/cancel_workflow": {
661
+ "post": {
662
+ "operationId": "cancel_workflow",
663
+ "description": "Stop the workflow and its active agent sessions. Leave working files available for review.",
664
+ "security": [
665
+ {
666
+ "localToken": []
667
+ }
668
+ ],
669
+ "requestBody": {
670
+ "required": true,
671
+ "content": {
672
+ "application/json": {
673
+ "schema": {
674
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
675
+ "type": "object",
676
+ "properties": {
677
+ "runId": {
678
+ "type": "string",
679
+ "format": "uuid",
680
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
681
+ }
682
+ },
683
+ "required": [
684
+ "runId"
685
+ ],
686
+ "additionalProperties": false
687
+ }
688
+ }
689
+ }
690
+ },
691
+ "responses": {
692
+ "200": {
693
+ "description": "Workflow snapshot",
694
+ "content": {
695
+ "application/json": {
696
+ "schema": {
697
+ "$ref": "#/components/schemas/WorkflowSnapshot"
698
+ }
699
+ }
700
+ }
701
+ },
702
+ "400": {
703
+ "description": "Invalid input or workflow state"
704
+ },
705
+ "403": {
706
+ "description": "Invalid engine token"
707
+ }
708
+ }
709
+ }
710
+ }
711
+ },
712
+ "components": {
713
+ "schemas": {
714
+ "WorkflowSnapshot": {
715
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
716
+ "type": "object",
717
+ "properties": {
718
+ "runId": {
719
+ "type": "string",
720
+ "format": "uuid",
721
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
722
+ },
723
+ "planRevision": {
724
+ "type": "integer",
725
+ "minimum": 0,
726
+ "maximum": 9007199254740991
727
+ },
728
+ "status": {
729
+ "type": "string",
730
+ "enum": [
731
+ "running",
732
+ "pausing",
733
+ "paused",
734
+ "completed",
735
+ "needs_input",
736
+ "failed",
737
+ "cancelled"
738
+ ]
739
+ },
740
+ "tasks": {
741
+ "type": "array",
742
+ "items": {
743
+ "type": "object",
744
+ "properties": {
745
+ "index": {
746
+ "type": "integer",
747
+ "minimum": 0,
748
+ "maximum": 9007199254740991
749
+ },
750
+ "name": {
751
+ "type": "string"
752
+ },
753
+ "state": {
754
+ "type": "string",
755
+ "enum": [
756
+ "pending",
757
+ "implementing",
758
+ "verifying",
759
+ "repairing",
760
+ "needs_input",
761
+ "accepted",
762
+ "failed",
763
+ "cancelled",
764
+ "pausing",
765
+ "paused"
766
+ ]
767
+ }
768
+ },
769
+ "required": [
770
+ "index",
771
+ "name",
772
+ "state"
773
+ ],
774
+ "additionalProperties": false
775
+ }
776
+ },
777
+ "activeTaskIndex": {
778
+ "anyOf": [
779
+ {
780
+ "type": "integer",
781
+ "minimum": 0,
782
+ "maximum": 9007199254740991
783
+ },
784
+ {
785
+ "type": "null"
786
+ }
787
+ ]
788
+ },
789
+ "eventCursor": {
790
+ "type": "integer",
791
+ "minimum": 0,
792
+ "maximum": 9007199254740991
793
+ },
794
+ "task": {
795
+ "type": "string"
796
+ },
797
+ "phase": {
798
+ "type": "string",
799
+ "enum": [
800
+ "worker",
801
+ "verifier"
802
+ ]
803
+ },
804
+ "decision": {
805
+ "type": "object",
806
+ "properties": {
807
+ "id": {
808
+ "type": "string",
809
+ "format": "uuid",
810
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
811
+ },
812
+ "text": {
813
+ "type": "string"
814
+ },
815
+ "options": {
816
+ "type": "array",
817
+ "items": {
818
+ "type": "object",
819
+ "properties": {
820
+ "id": {
821
+ "type": "string"
822
+ },
823
+ "name": {
824
+ "type": "string"
825
+ }
826
+ },
827
+ "required": [
828
+ "id",
829
+ "name"
830
+ ],
831
+ "additionalProperties": false
832
+ }
833
+ }
834
+ },
835
+ "required": [
836
+ "id",
837
+ "text"
838
+ ],
839
+ "additionalProperties": false
840
+ },
841
+ "reason": {
842
+ "type": "string"
843
+ },
844
+ "attempts": {
845
+ "type": "array",
846
+ "items": {
847
+ "type": "string"
848
+ }
849
+ },
850
+ "accepted": {
851
+ "type": "array",
852
+ "items": {
853
+ "type": "object",
854
+ "properties": {
855
+ "name": {
856
+ "type": "string"
857
+ },
858
+ "result": {
859
+ "type": "string"
860
+ },
861
+ "verdict": {
862
+ "type": "object",
863
+ "properties": {
864
+ "decision": {
865
+ "type": "string",
866
+ "enum": [
867
+ "accept",
868
+ "reject"
869
+ ]
870
+ },
871
+ "reason": {
872
+ "type": "string"
873
+ },
874
+ "checks": {
875
+ "type": "array",
876
+ "items": {
877
+ "type": "object",
878
+ "properties": {
879
+ "command": {
880
+ "type": "string",
881
+ "minLength": 1,
882
+ "maxLength": 65536
883
+ },
884
+ "passed": {
885
+ "type": "boolean"
886
+ },
887
+ "evidence": {
888
+ "type": "string",
889
+ "minLength": 1,
890
+ "maxLength": 65536
891
+ }
892
+ },
893
+ "required": [
894
+ "command",
895
+ "passed",
896
+ "evidence"
897
+ ],
898
+ "additionalProperties": false
899
+ }
900
+ }
901
+ },
902
+ "required": [
903
+ "decision",
904
+ "reason"
905
+ ],
906
+ "additionalProperties": false
907
+ },
908
+ "worker": {
909
+ "type": "string"
910
+ },
911
+ "verifier": {
912
+ "type": "string"
913
+ },
914
+ "revision": {
915
+ "type": "string"
916
+ }
917
+ },
918
+ "required": [
919
+ "name",
920
+ "result",
921
+ "verdict",
922
+ "worker",
923
+ "verifier",
924
+ "revision"
925
+ ],
926
+ "additionalProperties": false
927
+ }
928
+ },
929
+ "result": {
930
+ "type": "string"
931
+ },
932
+ "verdict": {
933
+ "type": "object",
934
+ "properties": {
935
+ "decision": {
936
+ "type": "string",
937
+ "enum": [
938
+ "accept",
939
+ "reject"
940
+ ]
941
+ },
942
+ "reason": {
943
+ "type": "string"
944
+ },
945
+ "checks": {
946
+ "type": "array",
947
+ "items": {
948
+ "type": "object",
949
+ "properties": {
950
+ "command": {
951
+ "type": "string",
952
+ "minLength": 1,
953
+ "maxLength": 65536
954
+ },
955
+ "passed": {
956
+ "type": "boolean"
957
+ },
958
+ "evidence": {
959
+ "type": "string",
960
+ "minLength": 1,
961
+ "maxLength": 65536
962
+ }
963
+ },
964
+ "required": [
965
+ "command",
966
+ "passed",
967
+ "evidence"
968
+ ],
969
+ "additionalProperties": false
970
+ }
971
+ }
972
+ },
973
+ "required": [
974
+ "decision",
975
+ "reason"
976
+ ],
977
+ "additionalProperties": false
978
+ }
979
+ },
980
+ "required": [
981
+ "runId",
982
+ "planRevision",
983
+ "status",
984
+ "tasks",
985
+ "activeTaskIndex",
986
+ "eventCursor",
987
+ "attempts",
988
+ "accepted"
989
+ ],
990
+ "additionalProperties": false
991
+ },
992
+ "WorkflowPlan": {
993
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
994
+ "type": "object",
995
+ "properties": {
996
+ "runId": {
997
+ "type": "string",
998
+ "format": "uuid",
999
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
1000
+ },
1001
+ "planRevision": {
1002
+ "type": "integer",
1003
+ "minimum": 0,
1004
+ "maximum": 9007199254740991
1005
+ },
1006
+ "activeTaskIndex": {
1007
+ "anyOf": [
1008
+ {
1009
+ "type": "integer",
1010
+ "minimum": 0,
1011
+ "maximum": 9007199254740991
1012
+ },
1013
+ {
1014
+ "type": "null"
1015
+ }
1016
+ ]
1017
+ },
1018
+ "tasks": {
1019
+ "type": "array",
1020
+ "items": {
1021
+ "type": "object",
1022
+ "properties": {
1023
+ "name": {
1024
+ "type": "string",
1025
+ "minLength": 1,
1026
+ "maxLength": 65536
1027
+ },
1028
+ "instructions": {
1029
+ "type": "string",
1030
+ "minLength": 1,
1031
+ "maxLength": 65536
1032
+ },
1033
+ "verify": {
1034
+ "type": "string",
1035
+ "minLength": 1,
1036
+ "maxLength": 65536
1037
+ },
1038
+ "checks": {
1039
+ "maxItems": 30,
1040
+ "type": "array",
1041
+ "items": {
1042
+ "type": "string",
1043
+ "minLength": 1,
1044
+ "maxLength": 65536
1045
+ }
1046
+ }
1047
+ },
1048
+ "required": [
1049
+ "name",
1050
+ "instructions",
1051
+ "verify"
1052
+ ],
1053
+ "additionalProperties": false
1054
+ }
1055
+ }
1056
+ },
1057
+ "required": [
1058
+ "runId",
1059
+ "planRevision",
1060
+ "activeTaskIndex",
1061
+ "tasks"
1062
+ ],
1063
+ "additionalProperties": false
1064
+ }
1065
+ },
1066
+ "securitySchemes": {
1067
+ "localToken": {
1068
+ "type": "http",
1069
+ "scheme": "bearer"
1070
+ }
1071
+ }
1072
+ }
1073
+ }