agents-relay 2.0.163 → 2.0.164

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agents-relay",
3
- "version": "2.0.163",
3
+ "version": "2.0.164",
4
4
  "description": "Durable async agent jobs coordinated through GitHub pull requests",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1,6 +1,9 @@
1
1
  ---
2
2
  name: agents-relay
3
3
  description: Use when work needs durable, multi-agent orchestration across turns or processes: plan and execute Jobs/Tasks, coordinate dependencies and reviews, recover failures, and track authoritative lifecycle events. Also use for content-generation workflows (research, story, production, human review, publication) that need explicit agent roles and handoff boundaries. Not for simple one-shot tasks with no durable coordination.
4
+ requires:
5
+ skills:
6
+ - daemon-service-manage
4
7
  ---
5
8
 
6
9
  # Agents Relay
@@ -124,3 +127,7 @@ Keep secrets, credentials, private prompts, and large private payloads out of du
124
127
  When an ACTIVE Job contains a current-run `FAILED` task, reconciliation may create one P0-priority `troubleshooter` recovery task for that exact failed attempt. `BLOCKED` is resolved only through authoritative unblock, which records evidence and transitions the Task to `UNBLOCKED`. The recovery task is routed to a local Codex-capable worker with repository/tool access and runs under the bundled Troubleshooter agent contract. Autonomous `UNBLOCKED` Tasks are historical and feed the next Planner round instead of being retried or sent through Troubleshooter. Each Planner round is durably represented by an `agents-relay:plan:v1` PR comment created before generated Task comments and updated in place with its assessment and generated Task IDs. Troubleshooter diagnosis is event-first: it must inspect the failed task's task-scoped lifecycle event history (including ordering, duplicate/missing/late events, source and phase data) before classifying root cause or retrying.
125
128
 
126
129
  The Troubleshooter diagnoses before retrying. A task-local or transient blocker is repaired narrowly; a shared worker/runtime/tool defect is repaired through the owning repository's P0/self-job workflow. Only after the blocker is removed does it retry the original task and verify durable progress. Historical failures from older scheduled autonomous runs do not spawn recovery work, and deterministic reconciliation does not duplicate a Troubleshooter task for the same failed attempt.
130
+
131
+ ## Persistent service bootstrap
132
+
133
+ This Skill owns `agents-relay/daemon`, `agents-relay/dashboard-tunnel`. The `daemon-service-manage` Skill is required. Run `node skills/agents-relay/bin/services.mjs setup` for idempotent registration through `serviceman`; run `status` to inspect or `doctor` to fail if a service is not online. Existing process configuration is preserved. Do not create unqualified legacy PM2 names.
@@ -0,0 +1,27 @@
1
+ #!/usr/bin/env node
2
+ import {spawnSync} from 'node:child_process';
3
+ const skill="agents-relay";
4
+ const definitions=[["daemon", "npx", ["-y", "--package", "agents-relay@latest", "agents-relayd", "--workspace", "__HOME__/Workspace", "--port", "8787", "--concurrency", "4", "--interval", "300000", "--refresh-ms", "300000", "--github-webhook-secret-file", "__HOME__/.agents-relay/github-webhook-secret"]], ["dashboard-tunnel", "cloudflared", ["tunnel", "--protocol", "http2", "--no-autoupdate", "run", "--url", "http://127.0.0.1:8787", "agents-relay-dashboard"]]];
5
+ const home=process.env.HOME||'';
6
+ const expand=s=>s.replaceAll('__HOME__',home);
7
+ const action=process.argv[2]||'status';
8
+ if(!['setup','status','doctor'].includes(action)){console.error('usage: node skills/'+skill+'/bin/services.mjs setup|status|doctor');process.exit(2)}
9
+ const run=(cmd,args)=>{const p=spawnSync(cmd,args,{encoding:'utf8'});if(p.error)throw p.error;if(p.status!==0)throw new Error(cmd+' failed: '+String(p.stderr||p.stdout).slice(0,300));return p.stdout};
10
+ try {
11
+ const pm2=JSON.parse(run('npx',['--yes','pm2','jlist']));
12
+ const report=[];
13
+ for(const [service,binary,args] of definitions){
14
+ const id=skill+'/'+service;
15
+ const current=pm2.find(x=>x.name===id);
16
+ if(action==='setup'&&!current){
17
+ if(skill==='family-tutor')throw new Error('family-tutor/orchestrator missing: provision product runtime before setup; serviceman must not infer its working directory');
18
+ const result=spawnSync('serviceman',['define','--skill',skill,'--service',service,'--apply','--',binary,...args.map(expand)],{stdio:'inherit'});
19
+ if(result.error)throw result.error;
20
+ if(result.status!==0)throw new Error('failed to define '+id);
21
+ }
22
+ const live=action==='setup'?JSON.parse(run('npx',['--yes','pm2','jlist'])).find(x=>x.name===id):current;
23
+ report.push({service:id,state:live?.pm2_env?.status||'missing',registered:Boolean(live)});
24
+ }
25
+ console.log(JSON.stringify({skill,services:report},null,2));
26
+ if(report.some(x=>x.state!=='online'))process.exitCode=2;
27
+ } catch(e){console.error(e.message);process.exitCode=2}