agents-relay 2.0.145 → 2.0.146
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/package.json +1 -1
- package/workflow/main.mmd +8 -4
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
|
+
}
|
package/package.json
CHANGED
package/workflow/main.mmd
CHANGED
|
@@ -44,10 +44,14 @@ flowchart LR
|
|
|
44
44
|
escalation -->|resolved: reconcile and resume| trouble
|
|
45
45
|
|
|
46
46
|
subgraph principles["Contract / Graph / Code — principal rules"]
|
|
47
|
-
contractNote["contract:
|
|
48
|
-
graphNote["graph: Transitions +
|
|
49
|
-
codeNote["code: Facts + SQLite +
|
|
47
|
+
contractNote["contract: Schemas + owner + permissions"]
|
|
48
|
+
graphNote["graph: Transitions + action ordering"]
|
|
49
|
+
codeNote["code: Facts + SQLite + effect executors"]
|
|
50
|
+
guardNote["guard: Read authoritative facts; no mutation"]
|
|
51
|
+
actionNote["action: Graph-selected operation only"]
|
|
52
|
+
effectNote["effect: Side effect + receipt; never policy"]
|
|
50
53
|
contractNote ~~~ graphNote ~~~ codeNote
|
|
54
|
+
guardNote ~~~ actionNote ~~~ effectNote
|
|
51
55
|
end
|
|
52
56
|
|
|
53
57
|
|
|
@@ -66,7 +70,7 @@ flowchart LR
|
|
|
66
70
|
classDef normal fill:#eff6ff,stroke:#2563eb,color:#1e40af
|
|
67
71
|
class trouble,recover,escalation exception
|
|
68
72
|
class objective,planner,worker,reviewer,delivery,verify,completed,fix normal
|
|
69
|
-
class contractNote,graphNote,codeNote normal
|
|
73
|
+
class contractNote,graphNote,codeNote,guardNote,actionNote,effectNote normal
|
|
70
74
|
|
|
71
75
|
%% Failed/unknown transitions are red; verified retries remain blue.
|
|
72
76
|
linkStyle 8,9,10,11,12,18 stroke:#be3030,stroke-width:2px
|