code60-transmission-server 0.1.0-staging.20 → 0.1.0-staging.21
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.
- package/README.md +36 -0
- package/dist/src/contract.js +29 -4
- package/dist/src/engine.js +57 -3
- package/dist/src/main.js +13 -9
- package/dist/src/service.js +4 -0
- package/package.json +1 -1
- package/reference/openapi.json +239 -0
package/README.md
CHANGED
|
@@ -63,11 +63,47 @@ Call `resume_workflow` with the same run ID to continue. The first unfinished ta
|
|
|
63
63
|
|
|
64
64
|
The engine stays up when the MCP client disconnects. Approved tasks, questions, verdicts, and attempts are stored in SQLite. On restart, the engine continues with the first unfinished task and retains partial working-tree changes. Explicitly paused workflows stay paused until `resume_workflow`; a restart during `pausing` also leaves the workflow paused. Restarting the engine preserves the task’s retry allowance. A lost harness consumes a fresh-session retry. Completed tasks stay accepted. Cancellation leaves the files available for review.
|
|
65
65
|
|
|
66
|
+
## Revise unfinished work
|
|
67
|
+
|
|
68
|
+
To change tasks or verification criteria within the same run, call `pause_workflow` and wait for `paused`. Read `get_workflow_plan` with `{"runId":"<workflow ID>"}`. It returns `planRevision`, `activeTaskIndex`, and the full task definitions, including instructions, independent verification prompts, and optional check commands. Tasks before the active index are completed and cannot be revised.
|
|
69
|
+
|
|
70
|
+
Present the revised unfinished tasks and criteria to the user and obtain confirmation. Submit the complete replacement for the unfinished portion, including the interrupted current task, to `revise_workflow`:
|
|
71
|
+
|
|
72
|
+
```json
|
|
73
|
+
{
|
|
74
|
+
"runId": "6ef301cf-b89e-4c11-af33-e11b1171a6b8",
|
|
75
|
+
"expectedRevision": 0,
|
|
76
|
+
"idempotencyKey": "duration-parser-revision-1",
|
|
77
|
+
"confirmed": true,
|
|
78
|
+
"remainingTasks": [{
|
|
79
|
+
"name": "Cover scientific notation",
|
|
80
|
+
"instructions": "Extend the existing parser to support scientific notation and add regression tests. Preserve the completed parsing changes.",
|
|
81
|
+
"verify": "Independently test positive, negative, fractional and malformed scientific notation. Check backward compatibility with existing duration inputs.",
|
|
82
|
+
"checks": ["npm test"]
|
|
83
|
+
}]
|
|
84
|
+
}
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Use the revision returned by `get_workflow_plan` as `expectedRevision`. The replacement can add, remove, reorder, or rewrite unfinished tasks. Include at least one task; the completed prefix plus the replacement may contain at most 100 tasks. Each task must include its full instructions and verification prompt. Omitting `checks` removes that task's previous explicit check requirements. Repository settings, permission settings, and repair/retry limits remain fixed.
|
|
88
|
+
|
|
89
|
+
The response is a workflow snapshot with an incremented `planRevision`. The run remains paused until a separate `resume_workflow` call. Resume starts fresh sessions for the first revised unfinished task and verifies against its new criteria. The current task position retains its spent repair and retry allowances, even if its task is replaced; later tasks receive their ordinary allowances when reached.
|
|
90
|
+
|
|
91
|
+
Completed task definitions, results, verdicts, accepted diffs, the original baseline, working files, HEAD, staging, and prior events remain intact. When the current task changes, its old feedback, guidance, messages, and question are archived and cleared from active execution. Add any still-relevant guidance after revision. When only later tasks change, current task context and unanswered questions are retained.
|
|
92
|
+
|
|
93
|
+
Each revision is recorded as a `plan_revised` event with the previous unfinished task list, the normalized revision request, and any archived context. New execution events carry `detail.planRevision`; older events without it belong to revision zero. The revised plan and history survive restart and stay paused until explicit resume.
|
|
94
|
+
|
|
95
|
+
Retry an uncertain revision with the exact same request and key. An accepted retry returns the current snapshot, even after later revisions, resume, restart, or completion. A changed request under the same key is rejected. A new revision with a stale `expectedRevision` is rejected without applying changes; read the current plan and reassess it before making a new request. Replaying the original `start_workflow` request still identifies this run and returns its current snapshot.
|
|
96
|
+
|
|
97
|
+
New revisions require a fully paused run. Running, pausing, input-waiting without explicit pause, stopping, and ended workflows reject them. Use cancellation when there is no remaining work to run.
|
|
98
|
+
|
|
99
|
+
## Observe task progress
|
|
100
|
+
|
|
66
101
|
A client can render the ordered tasks by calling `get_workflow` with only the run ID. For example, during verification the response can look like this:
|
|
67
102
|
|
|
68
103
|
```json
|
|
69
104
|
{
|
|
70
105
|
"runId": "6ef301cf-b89e-4c11-af33-e11b1171a6b8",
|
|
106
|
+
"planRevision": 0,
|
|
71
107
|
"status": "running",
|
|
72
108
|
"task": "Implement the fix",
|
|
73
109
|
"phase": "verifier",
|
package/dist/src/contract.js
CHANGED
|
@@ -17,9 +17,17 @@ export const start = z.strictObject({
|
|
|
17
17
|
});
|
|
18
18
|
export const runId = z.uuid();
|
|
19
19
|
const id = z.strictObject({ runId });
|
|
20
|
+
export const revision = id.extend({
|
|
21
|
+
expectedRevision: z.int().nonnegative(),
|
|
22
|
+
idempotencyKey: z.string().min(1).max(256),
|
|
23
|
+
confirmed: z.literal(true),
|
|
24
|
+
remainingTasks: z.array(task).min(1).max(100),
|
|
25
|
+
});
|
|
20
26
|
export const operations = {
|
|
21
27
|
start_workflow: start,
|
|
22
28
|
get_workflow: id,
|
|
29
|
+
get_workflow_plan: id,
|
|
30
|
+
revise_workflow: revision,
|
|
23
31
|
get_workflow_events: id.extend({
|
|
24
32
|
after: z.number().int().nonnegative().default(0),
|
|
25
33
|
}),
|
|
@@ -35,6 +43,8 @@ export const operations = {
|
|
|
35
43
|
export const descriptions = {
|
|
36
44
|
start_workflow: '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.',
|
|
37
45
|
get_workflow: '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.',
|
|
46
|
+
get_workflow_plan: '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.',
|
|
47
|
+
revise_workflow: '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.',
|
|
38
48
|
get_workflow_events: 'Read the next page of progress, sessions, native tools and verifier feedback. Use the last sequence number as after.',
|
|
39
49
|
get_workflow_diff: 'Read a page of the accepted patch relative to the initial working tree. Offset is in bytes; content is base64.',
|
|
40
50
|
answer_workflow_question: 'Answer the outstanding decision by ID. For a permission question select an offered option ID.',
|
|
@@ -76,6 +86,7 @@ const taskState = z.enum([
|
|
|
76
86
|
const nonnegativeInteger = z.int().nonnegative();
|
|
77
87
|
export const workflowSnapshot = z.object({
|
|
78
88
|
runId,
|
|
89
|
+
planRevision: nonnegativeInteger,
|
|
79
90
|
status,
|
|
80
91
|
tasks: z.array(z.object({ index: nonnegativeInteger, name: z.string(), state: taskState })),
|
|
81
92
|
activeTaskIndex: nonnegativeInteger.nullable(),
|
|
@@ -89,10 +100,24 @@ export const workflowSnapshot = z.object({
|
|
|
89
100
|
result: z.string().optional(),
|
|
90
101
|
verdict: verdict.optional(),
|
|
91
102
|
});
|
|
92
|
-
export const
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
103
|
+
export const workflowPlan = z.object({
|
|
104
|
+
runId,
|
|
105
|
+
planRevision: nonnegativeInteger,
|
|
106
|
+
activeTaskIndex: nonnegativeInteger.nullable(),
|
|
107
|
+
tasks: z.array(task),
|
|
108
|
+
});
|
|
109
|
+
export const responseSchemas = { WorkflowSnapshot: workflowSnapshot, WorkflowPlan: workflowPlan };
|
|
110
|
+
export const operationResponses = {
|
|
111
|
+
start_workflow: 'WorkflowSnapshot',
|
|
112
|
+
get_workflow: 'WorkflowSnapshot',
|
|
113
|
+
get_workflow_plan: 'WorkflowPlan',
|
|
114
|
+
revise_workflow: 'WorkflowSnapshot',
|
|
115
|
+
answer_workflow_question: 'WorkflowSnapshot',
|
|
116
|
+
send_workflow_message: 'WorkflowSnapshot',
|
|
117
|
+
pause_workflow: 'WorkflowSnapshot',
|
|
118
|
+
resume_workflow: 'WorkflowSnapshot',
|
|
119
|
+
cancel_workflow: 'WorkflowSnapshot',
|
|
120
|
+
};
|
|
96
121
|
export const workerReply = z.discriminatedUnion('kind', [
|
|
97
122
|
z.object({ kind: z.literal('result'), summary: text }),
|
|
98
123
|
z.object({ kind: z.literal('question'), question: text }),
|
package/dist/src/engine.js
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { DatabaseSync } from 'node:sqlite';
|
|
2
2
|
import { randomUUID } from 'node:crypto';
|
|
3
|
+
import { isDeepStrictEqual } from 'node:util';
|
|
3
4
|
import { closeSync, mkdirSync, openSync, readSync, realpathSync, renameSync, rmSync, statSync, } from 'node:fs';
|
|
4
5
|
import { join, sep } from 'node:path';
|
|
5
6
|
import { AcpHarness } from './acp.js';
|
|
6
|
-
import { terminal, verifierReply, workerReply, } from './contract.js';
|
|
7
|
+
import { revision, terminal, verifierReply, workerReply, } from './contract.js';
|
|
7
8
|
import { repository, snapshot, writePatch } from './repository.js';
|
|
8
9
|
const diagnostic = (error) => error instanceof Error ? error.message : String(error);
|
|
10
|
+
const jsonCopy = (value) => JSON.parse(JSON.stringify(value));
|
|
9
11
|
function taskState(run, index) {
|
|
10
12
|
if (index < run.index)
|
|
11
13
|
return 'accepted';
|
|
@@ -86,7 +88,7 @@ export class Engine {
|
|
|
86
88
|
event(r, kind, detail) {
|
|
87
89
|
this.db
|
|
88
90
|
.prepare('INSERT INTO events(run,time,kind,detail) VALUES(?,?,?,?)')
|
|
89
|
-
.run(r.id, new Date().toISOString(), kind, JSON.stringify(detail));
|
|
91
|
+
.run(r.id, new Date().toISOString(), kind, JSON.stringify({ ...detail, planRevision: r.planRevision ?? 0 }));
|
|
90
92
|
}
|
|
91
93
|
get(id) {
|
|
92
94
|
const r = this.runs.get(id);
|
|
@@ -100,7 +102,7 @@ export class Engine {
|
|
|
100
102
|
.get(plan.idempotencyKey);
|
|
101
103
|
if (prior) {
|
|
102
104
|
const r = this.get(String(prior.id));
|
|
103
|
-
if (JSON.stringify(r.plan) !==
|
|
105
|
+
if (JSON.stringify(r.initialPlan ?? r.plan) !==
|
|
104
106
|
JSON.stringify({ ...plan, repository: repository(plan.repository) }))
|
|
105
107
|
throw new Error('This key belongs to a different workflow.');
|
|
106
108
|
return this.status(r.id);
|
|
@@ -116,6 +118,7 @@ export class Engine {
|
|
|
116
118
|
const r = {
|
|
117
119
|
id,
|
|
118
120
|
plan: { ...plan, repository: root },
|
|
121
|
+
planRevision: 0,
|
|
119
122
|
baseline: snapshot(root, join(this.state, id)),
|
|
120
123
|
index: 0,
|
|
121
124
|
status: 'running',
|
|
@@ -144,6 +147,7 @@ export class Engine {
|
|
|
144
147
|
const r = JSON.parse(String(row.body));
|
|
145
148
|
return {
|
|
146
149
|
runId: id,
|
|
150
|
+
planRevision: r.planRevision ?? 0,
|
|
147
151
|
status: r.status,
|
|
148
152
|
tasks: r.plan.tasks.map(({ name }, index) => ({ index, name, state: taskState(r, index) })),
|
|
149
153
|
activeTaskIndex: terminal(r.status) ? null : r.index,
|
|
@@ -162,6 +166,56 @@ export class Engine {
|
|
|
162
166
|
: {}),
|
|
163
167
|
};
|
|
164
168
|
}
|
|
169
|
+
plan(id) {
|
|
170
|
+
const row = this.db.prepare('SELECT body FROM runs WHERE id=?').get(id);
|
|
171
|
+
if (!row)
|
|
172
|
+
throw new Error('Unknown workflow.');
|
|
173
|
+
const r = JSON.parse(String(row.body));
|
|
174
|
+
return { runId: id, planRevision: r.planRevision ?? 0,
|
|
175
|
+
activeTaskIndex: terminal(r.status) ? null : r.index, tasks: r.plan.tasks };
|
|
176
|
+
}
|
|
177
|
+
revise(input) {
|
|
178
|
+
// Compare the same JSON values SQLite retains: -0 becomes 0, and absent
|
|
179
|
+
// optional properties do not acquire a different identity after restart.
|
|
180
|
+
const request = jsonCopy(revision.parse(input)), r = this.get(request.runId);
|
|
181
|
+
if (this.closing)
|
|
182
|
+
throw new Error('Engine is stopping.');
|
|
183
|
+
const prior = this.db.prepare(`SELECT detail FROM events WHERE run=? AND kind='plan_revised'
|
|
184
|
+
AND json_extract(detail,'$.request.idempotencyKey')=? LIMIT 1`).get(r.id, request.idempotencyKey);
|
|
185
|
+
if (prior) {
|
|
186
|
+
if (!isDeepStrictEqual(JSON.parse(String(prior.detail)).request, request))
|
|
187
|
+
throw new Error('This revision key belongs to a different request.');
|
|
188
|
+
return this.status(r.id);
|
|
189
|
+
}
|
|
190
|
+
if (r.status !== 'paused')
|
|
191
|
+
throw new Error('Workflow must be fully paused before revision.');
|
|
192
|
+
const currentRevision = r.planRevision ?? 0;
|
|
193
|
+
if (request.expectedRevision !== currentRevision)
|
|
194
|
+
throw new Error('The workflow plan revision has changed.');
|
|
195
|
+
if (r.index + request.remainingTasks.length > 100)
|
|
196
|
+
throw new Error('A workflow may contain at most 100 tasks, including completed tasks.');
|
|
197
|
+
const changed = !isDeepStrictEqual(jsonCopy(r.plan.tasks[r.index]), request.remainingTasks[0]);
|
|
198
|
+
const archivedContext = changed ? { feedback: r.feedback, messages: r.messages, guidance: r.guidance,
|
|
199
|
+
question: r.question, questionKind: r.questionKind, lastAnswer: r.lastAnswer } : undefined;
|
|
200
|
+
const next = { ...r, initialPlan: r.initialPlan ?? r.plan, planRevision: currentRevision + 1,
|
|
201
|
+
plan: { ...r.plan, tasks: [...r.plan.tasks.slice(0, r.index), ...request.remainingTasks] } };
|
|
202
|
+
if (changed) {
|
|
203
|
+
next.feedback = '';
|
|
204
|
+
next.messages = [];
|
|
205
|
+
next.guidance = [];
|
|
206
|
+
delete next.question;
|
|
207
|
+
delete next.questionKind;
|
|
208
|
+
delete next.lastAnswer;
|
|
209
|
+
}
|
|
210
|
+
this.retireSessions(next);
|
|
211
|
+
// Persist the complete transition and its replay identity before replacing
|
|
212
|
+
// the live object. A failed SQL transaction must leave both plans intact.
|
|
213
|
+
this.save(next, 'plan_revised', { fromRevision: currentRevision, activeTaskIndex: r.index,
|
|
214
|
+
remainingTasksBefore: r.plan.tasks.slice(r.index), request,
|
|
215
|
+
...(archivedContext ? { archivedContext } : {}) });
|
|
216
|
+
this.runs.set(r.id, next);
|
|
217
|
+
return this.status(r.id);
|
|
218
|
+
}
|
|
165
219
|
events(id, after) {
|
|
166
220
|
this.get(id);
|
|
167
221
|
return this.db
|
package/dist/src/main.js
CHANGED
|
@@ -3,7 +3,7 @@ import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
|
3
3
|
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
4
4
|
import { CallToolRequestSchema, ListToolsRequestSchema, } from '@modelcontextprotocol/sdk/types.js';
|
|
5
5
|
import { z } from 'zod';
|
|
6
|
-
import { operations, descriptions,
|
|
6
|
+
import { operations, descriptions, operationResponses, responseSchemas } from './contract.js';
|
|
7
7
|
import { call, ensure, serve } from './service.js';
|
|
8
8
|
const cmd = process.argv[2] ?? 'mcp';
|
|
9
9
|
async function main() {
|
|
@@ -32,16 +32,20 @@ async function main() {
|
|
|
32
32
|
await ensure();
|
|
33
33
|
const server = new Server({ name: 'transmission', version: '1' }, {
|
|
34
34
|
capabilities: { tools: {} },
|
|
35
|
-
instructions: 'Design ordered tasks with independent verification criteria from the user’s goal. Present the workflow, obtain confirmation, then submit it once with start_workflow. Follow the same run. Ordinary repairs and retries run autonomously.',
|
|
35
|
+
instructions: 'Design ordered tasks with independent verification criteria from the user’s goal. Present the workflow, obtain confirmation, then submit it once with start_workflow. Follow the same run. Ordinary repairs and retries run autonomously. To change unfinished work, pause the workflow, read get_workflow_plan, present the revised tasks and criteria and obtain confirmation, then call revise_workflow and resume_workflow.',
|
|
36
36
|
});
|
|
37
|
-
const
|
|
37
|
+
const outputSchemas = Object.fromEntries(Object.entries(responseSchemas)
|
|
38
|
+
.map(([name, schema]) => [name, z.toJSONSchema(schema)]));
|
|
38
39
|
server.setRequestHandler(ListToolsRequestSchema, () => ({
|
|
39
|
-
tools: Object.entries(operations).map(([name, schema]) =>
|
|
40
|
-
name
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
40
|
+
tools: Object.entries(operations).map(([name, schema]) => {
|
|
41
|
+
const response = operationResponses[name];
|
|
42
|
+
return {
|
|
43
|
+
name,
|
|
44
|
+
...(response ? { outputSchema: outputSchemas[response] } : {}),
|
|
45
|
+
description: descriptions[name],
|
|
46
|
+
inputSchema: z.toJSONSchema(schema, { io: 'input' }),
|
|
47
|
+
};
|
|
48
|
+
}),
|
|
45
49
|
}));
|
|
46
50
|
server.setRequestHandler(CallToolRequestSchema, async ({ params }) => {
|
|
47
51
|
try {
|
package/dist/src/service.js
CHANGED
|
@@ -39,6 +39,10 @@ export async function dispatch(engine, op, args) {
|
|
|
39
39
|
return engine.start(operations.start_workflow.parse(args));
|
|
40
40
|
case 'get_workflow':
|
|
41
41
|
return engine.status(operations.get_workflow.parse(args).runId);
|
|
42
|
+
case 'get_workflow_plan':
|
|
43
|
+
return engine.plan(operations.get_workflow_plan.parse(args).runId);
|
|
44
|
+
case 'revise_workflow':
|
|
45
|
+
return engine.revise(operations.revise_workflow.parse(args));
|
|
42
46
|
case 'get_workflow_events': {
|
|
43
47
|
const a = operations.get_workflow_events.parse(args);
|
|
44
48
|
return { events: engine.events(a.runId, a.after) };
|
package/package.json
CHANGED
package/reference/openapi.json
CHANGED
|
@@ -175,6 +175,166 @@
|
|
|
175
175
|
}
|
|
176
176
|
}
|
|
177
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
|
+
},
|
|
178
338
|
"/get_workflow_events": {
|
|
179
339
|
"post": {
|
|
180
340
|
"operationId": "get_workflow_events",
|
|
@@ -560,6 +720,11 @@
|
|
|
560
720
|
"format": "uuid",
|
|
561
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)$"
|
|
562
722
|
},
|
|
723
|
+
"planRevision": {
|
|
724
|
+
"type": "integer",
|
|
725
|
+
"minimum": 0,
|
|
726
|
+
"maximum": 9007199254740991
|
|
727
|
+
},
|
|
563
728
|
"status": {
|
|
564
729
|
"type": "string",
|
|
565
730
|
"enum": [
|
|
@@ -814,6 +979,7 @@
|
|
|
814
979
|
},
|
|
815
980
|
"required": [
|
|
816
981
|
"runId",
|
|
982
|
+
"planRevision",
|
|
817
983
|
"status",
|
|
818
984
|
"tasks",
|
|
819
985
|
"activeTaskIndex",
|
|
@@ -822,6 +988,79 @@
|
|
|
822
988
|
"accepted"
|
|
823
989
|
],
|
|
824
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
|
|
825
1064
|
}
|
|
826
1065
|
},
|
|
827
1066
|
"securitySchemes": {
|