agents-relay 2.0.145 → 2.0.147
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/dist/cli.js +1 -0
- package/dist/single-job-task-control.js +28 -0
- package/dist/workflow/graph-v2.js +20 -1
- package/package.json +1 -1
- package/workflow/authoritative-unblock.mmd +4 -0
- package/workflow/blocker-resolution.mmd +4 -0
- package/workflow/escalation.mmd +4 -0
- package/workflow/interactive-invocation.mmd +4 -0
- package/workflow/job-lifecycle.mmd +4 -0
- package/workflow/main.mmd +12 -4
- package/workflow/orchestrator-rescue.mmd +4 -0
- package/workflow/planner-orchestration.mmd +4 -0
- package/workflow/planner-trigger.mmd +4 -0
- package/workflow/projection-conflict.mmd +4 -0
- package/workflow/review-lifecycle.mmd +4 -0
- package/workflow/schedule-cycle.mmd +4 -0
- package/workflow/scheduled-run.mmd +4 -0
- package/workflow/task-lifecycle.mmd +4 -0
- package/workflow/task-related-action.mmd +4 -0
- package/workflow/task-resolution.mmd +4 -0
- package/workflow/troubleshooter.mmd +4 -0
package/dist/cli.js
CHANGED
|
@@ -618,6 +618,7 @@ export async function createService(args) {
|
|
|
618
618
|
},
|
|
619
619
|
} : undefined;
|
|
620
620
|
const dashboardServer = serveDashboard(loaded.store, Number(arg(args, '--port', String(SERVICE_DEFAULTS.port))), bus, Number(arg(args, '--refresh-ms', String(SERVICE_DEFAULTS.dashboardRefreshMs))), loaded.job.id, usageRegistry, overviewProvider, webhook, undefined, undefined, undefined, {
|
|
621
|
+
control: await (await import('./single-job-task-control.js')).createSingleJobTaskControl(loaded.job.id, loaded.store, reconciler, bus),
|
|
621
622
|
start: dashboardJobAction(loaded.store, reconciler, 'start'),
|
|
622
623
|
reconcile: dashboardJobAction(loaded.store, reconciler, 'reconcile'),
|
|
623
624
|
cancel: dashboardJobAction(loaded.store, reconciler, 'cancel'),
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { dispatchTaskAction } from './task-actions.js';
|
|
2
|
+
export async function createSingleJobTaskControl(jobId, store, reconciler, bus) {
|
|
3
|
+
const { createWorkspaceControl } = await import('./relayd-control.js');
|
|
4
|
+
const unblock = await import('./unblock.js');
|
|
5
|
+
const { publishTaskUnblocked } = await import('./cli-support.js');
|
|
6
|
+
const canonicalControl = createWorkspaceControl({
|
|
7
|
+
requireLocalJobBinding: async (id) => {
|
|
8
|
+
if (id !== jobId)
|
|
9
|
+
throw new Error('Control request outside bound Job');
|
|
10
|
+
return { store };
|
|
11
|
+
},
|
|
12
|
+
pool: { reconcileLocalJob: async (id) => {
|
|
13
|
+
await reconciler.reconcile(id);
|
|
14
|
+
await reconciler.idle();
|
|
15
|
+
} },
|
|
16
|
+
bus, isEffectivelyBlocked: unblock.isEffectivelyBlocked,
|
|
17
|
+
unblockAutonomousTasks: unblock.unblockAutonomousTasks, unblockTask: unblock.unblockTask,
|
|
18
|
+
publishTaskUnblocked, dispatchTaskAction,
|
|
19
|
+
});
|
|
20
|
+
const allowed = new Set(['task.unblock', 'task.recover', 'task.escalate', 'task.resume-troubleshooter']);
|
|
21
|
+
return async (body) => {
|
|
22
|
+
if (!allowed.has(String(body.command ?? '')))
|
|
23
|
+
throw new Error('Single-Job control command not supported');
|
|
24
|
+
if (body.jobId !== jobId)
|
|
25
|
+
throw new Error('Control request outside bound Job');
|
|
26
|
+
return canonicalControl(body);
|
|
27
|
+
};
|
|
28
|
+
}
|
|
@@ -24,11 +24,30 @@ function parseLabel(raw, line) {
|
|
|
24
24
|
}
|
|
25
25
|
export function parseGraphV2(source) {
|
|
26
26
|
const lines = source.split(/\r?\n/);
|
|
27
|
+
// Mermaid YAML frontmatter is metadata only; never execute it as graph policy.
|
|
28
|
+
// Preserve original source line positions for diagnostics and coverage reports.
|
|
29
|
+
let graphStart = 0;
|
|
30
|
+
if (lines[0]?.trim() === '---') {
|
|
31
|
+
let closing = -1;
|
|
32
|
+
for (let i = 1; i < lines.length; i += 1) {
|
|
33
|
+
if (lines[i].trim() === '---') {
|
|
34
|
+
closing = i;
|
|
35
|
+
break;
|
|
36
|
+
}
|
|
37
|
+
if (!/^(title|description):\s+[^\r\n]+$/.test(lines[i]))
|
|
38
|
+
fail(i + 1, 'unsupported graph frontmatter field');
|
|
39
|
+
}
|
|
40
|
+
if (closing < 0)
|
|
41
|
+
fail(1, 'unterminated graph frontmatter');
|
|
42
|
+
if (closing === 1)
|
|
43
|
+
fail(1, 'empty graph frontmatter');
|
|
44
|
+
graphStart = closing + 1;
|
|
45
|
+
}
|
|
27
46
|
let direction = null;
|
|
28
47
|
let initial = null;
|
|
29
48
|
const nodes = new Map();
|
|
30
49
|
const edges = [];
|
|
31
|
-
for (let index =
|
|
50
|
+
for (let index = graphStart; index < lines.length; index += 1) {
|
|
32
51
|
const lineNumber = index + 1;
|
|
33
52
|
const line = lines[index].trim();
|
|
34
53
|
if (!line)
|
package/package.json
CHANGED
package/workflow/escalation.mmd
CHANGED
package/workflow/main.mmd
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Main
|
|
3
|
+
description: Presentation-only entry map linking workflow graphs and explaining contract, graph, code, guard, action, and effect ownership.
|
|
4
|
+
---
|
|
1
5
|
%% dashboard: presentation-only — not registered with GraphRuntime or the executable Graph DSL.
|
|
2
6
|
%% PRINCIPLES (this graph is a readable overview, not an executable policy):
|
|
3
7
|
%% CONTRACT defines typed events, permissions and invariants; GRAPH defines legal transitions,
|
|
@@ -44,10 +48,14 @@ flowchart LR
|
|
|
44
48
|
escalation -->|resolved: reconcile and resume| trouble
|
|
45
49
|
|
|
46
50
|
subgraph principles["Contract / Graph / Code — principal rules"]
|
|
47
|
-
contractNote["contract:
|
|
48
|
-
graphNote["graph: Transitions +
|
|
49
|
-
codeNote["code: Facts + SQLite +
|
|
51
|
+
contractNote["contract: Schemas + owner + permissions"]
|
|
52
|
+
graphNote["graph: Transitions + action ordering"]
|
|
53
|
+
codeNote["code: Facts + SQLite + effect executors"]
|
|
54
|
+
guardNote["guard: Read authoritative facts; no mutation"]
|
|
55
|
+
actionNote["action: Graph-selected operation only"]
|
|
56
|
+
effectNote["effect: Side effect + receipt; never policy"]
|
|
50
57
|
contractNote ~~~ graphNote ~~~ codeNote
|
|
58
|
+
guardNote ~~~ actionNote ~~~ effectNote
|
|
51
59
|
end
|
|
52
60
|
|
|
53
61
|
|
|
@@ -66,7 +74,7 @@ flowchart LR
|
|
|
66
74
|
classDef normal fill:#eff6ff,stroke:#2563eb,color:#1e40af
|
|
67
75
|
class trouble,recover,escalation exception
|
|
68
76
|
class objective,planner,worker,reviewer,delivery,verify,completed,fix normal
|
|
69
|
-
class contractNote,graphNote,codeNote normal
|
|
77
|
+
class contractNote,graphNote,codeNote,guardNote,actionNote,effectNote normal
|
|
70
78
|
|
|
71
79
|
%% Failed/unknown transitions are red; verified retries remain blue.
|
|
72
80
|
linkStyle 8,9,10,11,12,18 stroke:#be3030,stroke-width:2px
|