agents-relay 2.0.26 → 2.0.27

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.
@@ -146,6 +146,22 @@ export async function publishTaskUnblocked(bus, job, taskId, reason) { if (!bus)
146
146
  catch (error) {
147
147
  process.stderr.write(`warning: unblock event unavailable: ${error instanceof Error ? error.message : String(error)}\n`);
148
148
  } }
149
+ export async function publishOrchestratorTaskCompletion(bus, job, task, summary) {
150
+ if (!bus)
151
+ return;
152
+ const events = [
153
+ eventFor(job.id, task.id, task.parentTaskId, 'task.started', 'running', `Task ${task.id} started by orchestrator`, 'orchestrator', { adapter: 'orchestrator' }, { agent: 'relay', component: 'agents-relay' }),
154
+ eventFor(job.id, task.id, task.parentTaskId, 'task.completed', 'succeeded', `Task ${task.id} completed by orchestrator`, 'orchestrator', { adapter: 'orchestrator', summary }, { agent: 'relay', component: 'agents-relay' }),
155
+ ];
156
+ for (const event of events) {
157
+ try {
158
+ await bus.publish(event);
159
+ }
160
+ catch (error) {
161
+ process.stderr.write(`warning: orchestrator task event unavailable for ${job.id}/${task.id}: ${error instanceof Error ? error.message : String(error)}\n`);
162
+ }
163
+ }
164
+ }
149
165
  export async function publishDependentUnblocked(bus, targets, reason) { if (!bus)
150
166
  return; for (const target of targets) {
151
167
  try {
package/dist/relayd.js CHANGED
@@ -13,7 +13,7 @@ import { ProjectedDurableStore } from './projected-store.js';
13
13
  import { discoverLocalRelayStoreSnapshots, SQLiteRelayStore } from './relay-store.js';
14
14
  import { githubAuthContext } from './github-auth.js';
15
15
  import { dashboardJobAction, isEntrypoint, runtimePlanner, runtimeReviewer, startService, SERVICE_DEFAULTS } from './cli.js';
16
- import { eventBusResolutionMessage, resolveEventBus } from './cli-support.js';
16
+ import { eventBusResolutionMessage, publishOrchestratorTaskCompletion, resolveEventBus } from './cli-support.js';
17
17
  import { applyJobActivateAction } from './job-actions.js';
18
18
  import { applyOrchestratorCompleteAction } from './task-actions.js';
19
19
  import { dashboardJobSetState, dashboardTaskAction, dashboardTaskSetState } from './dashboard-actions.js';
@@ -280,6 +280,7 @@ export async function runDaemon(argv) {
280
280
  throw new Error(`Task ${taskId} not found`);
281
281
  await applyOrchestratorCompleteAction(task, summary);
282
282
  await store.saveTask(task);
283
+ await publishOrchestratorTaskCompletion(bus, job, task, summary);
283
284
  await pool.reconcileTarget(overview.job.repository, overview.job.prNumber, jobId, 'control.task.complete');
284
285
  return await store.load(jobId);
285
286
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agents-relay",
3
- "version": "2.0.26",
3
+ "version": "2.0.27",
4
4
  "description": "Durable async agent jobs coordinated through GitHub pull requests",
5
5
  "type": "module",
6
6
  "bin": {