@volter/supercode-orchestrator 0.4.62 → 0.4.64
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/board/cli.mjs +5 -0
- package/board/workflow.mjs +19 -0
- package/package.json +1 -1
package/board/cli.mjs
CHANGED
|
@@ -328,6 +328,11 @@ export async function runWorkflow(argv) {
|
|
|
328
328
|
workflow_status: t.stage ?? t.status,
|
|
329
329
|
parents: b.db.prepare('SELECT parent_id FROM task_links WHERE child_id = ? ORDER BY parent_id').all(t.id).map((r) => r.parent_id),
|
|
330
330
|
run: run ? { id: run.id, status: run.status, started_at: run.started_at, session: session.address ?? session.session_id ?? null } : null,
|
|
331
|
+
// the message whose answer its standing block waits for (`block --waiting-on`)
|
|
332
|
+
waiting_on: (() => {
|
|
333
|
+
const last = b.db.prepare("SELECT kind, payload FROM task_events WHERE task_id = ? AND kind IN ('blocked', 'unblocked', 'dependency_wait') ORDER BY id DESC LIMIT 1").get(t.id);
|
|
334
|
+
return last?.kind === 'blocked' ? json(last.payload, {})?.waiting_on ?? null : null;
|
|
335
|
+
})(),
|
|
331
336
|
}];
|
|
332
337
|
})));
|
|
333
338
|
say(args, '', cards.map((t) => ({ ...cardDict(t), ...extra.get(t.id) })));
|
package/board/workflow.mjs
CHANGED
|
@@ -86,6 +86,23 @@ function answerTo(id) {
|
|
|
86
86
|
try { return JSON.parse(r.stdout)?.[0]?.replies?.[0]?.id ?? null; } catch { return null; }
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
+
const OPEN_OUTCOME = /^(\s*[-*] )\[ \] (.+)$/;
|
|
90
|
+
/** Whether `body` is `was` with only outcomes ticked: each changed line was `- [ ] X` and is now `- [x] X` or
|
|
91
|
+
* `- [x] X: <pointer>`; no other line added, removed or changed. */
|
|
92
|
+
function onlyTicks(was, body) {
|
|
93
|
+
if (typeof body !== 'string') return false;
|
|
94
|
+
const before = String(was ?? '').split('\n');
|
|
95
|
+
const after = body.split('\n');
|
|
96
|
+
if (before.length !== after.length) return false;
|
|
97
|
+
return before.every((line, i) => {
|
|
98
|
+
if (line === after[i]) return true;
|
|
99
|
+
const open = OPEN_OUTCOME.exec(line);
|
|
100
|
+
if (!open) return false;
|
|
101
|
+
const ticked = `${open[1]}[x] ${open[2]}`;
|
|
102
|
+
return after[i] === ticked || (after[i].startsWith(`${ticked}: `) && after[i].length > ticked.length + 2);
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
|
|
89
106
|
/** The session message `id` was filed for (`supercode message show`): who was asked; or null. */
|
|
90
107
|
function askedOf(id) {
|
|
91
108
|
if (!id) return null;
|
|
@@ -130,6 +147,8 @@ export function scopeOf(db, board, task, { params, event = {}, extra = {} } = {}
|
|
|
130
147
|
// the message whose answer the standing block waits for (`block --waiting-on`), and that answer's id once it has landed
|
|
131
148
|
waiting_on: waitingOn,
|
|
132
149
|
answer: () => answerTo(waitingOn),
|
|
150
|
+
// whether an edit of its text only ticks outcome lines (the card's own session's door to its acceptance)
|
|
151
|
+
only_ticks: (body) => onlyTicks(task.body, body),
|
|
133
152
|
asked_of: () => askedOf(waitingOn),
|
|
134
153
|
last_block_event: one(db, "SELECT kind FROM task_events WHERE task_id = ? AND kind IN ('blocked', 'unblocked') ORDER BY id DESC LIMIT 1", task.id)?.kind ?? null,
|
|
135
154
|
// where the latest interruption says the card resumes (any status the workflow declares); none recorded: null
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@volter/supercode-orchestrator",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.64",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "The orchestrator runtime over the Volter Harness ontology: one typed operational model whose folder is its serialization, read and written through the harness orchestration doors (docs/ORCHESTRATOR-IR.md)",
|
|
6
6
|
"exports": {
|