agents-relay 2.0.200 → 2.0.201

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-help.js CHANGED
@@ -57,8 +57,10 @@ Example:
57
57
 
58
58
  agents-relay prompt --id JOB --plan-id PLAN --adapter codex|chatgpt|z [--output FILE]
59
59
  agents-relay prompt --id JOB --task-id TASK --adapter codex|chatgpt|z [--output FILE]
60
+ agents-relay prompt --eval-file CASE.json --adapter codex|chatgpt|z [--output FILE]
60
61
 
61
- Raw worker-facing text on stdout, no profile wrapper. --repo selects local SQLite,
62
+ A detached --eval-file returns JSON with productionPrompt and safe evaluationPrompt from the SAME managedWorkerInput Builder; it never creates or changes a Job.
63
+ Raw durable worker-facing text on stdout, no profile wrapper. --repo selects local SQLite,
62
64
  not GitHub. Old completed Plans are reconstructed from recorded IDs and prior
63
65
  Task history; their original historical prompt bytes are not persisted. Only
64
66
  Codex currently has production Planner dispatch. Web Planner variants show the
@@ -1,4 +1,4 @@
1
- import { writeFile } from 'node:fs/promises';
1
+ import { readFile, writeFile } from 'node:fs/promises';
2
2
  import { plannerInput } from './planner.js';
3
3
  import { arg, storeFor } from './cli-support.js';
4
4
  import { resolveExecutionContext } from './execution-context.js';
@@ -7,6 +7,7 @@ import { managedWorkerInput } from './managed-worker-input.js';
7
7
  import { resolveManagedProjectPath, resolveRepositoryProjectPath } from './workspace.js';
8
8
  import { taskExecutionContext } from './task-context.js';
9
9
  import { eventsBusHistoryPage } from './events-bus-runtime.js';
10
+ import { createJobEntity, createTaskEntity } from './workflow/entity-creation.js';
10
11
  /** Print the actual prompt emitted by the same production Builder entry point.
11
12
  * This is read-only: it does not start an adapter, create a Plan or mutate a Task.
12
13
  */
@@ -14,6 +15,42 @@ export async function runPromptCommand(args) {
14
15
  const adapter = arg(args, '--adapter', 'codex');
15
16
  if (!['codex', 'chatgpt', 'z'].includes(adapter))
16
17
  throw new Error('prompt --adapter must be codex|chatgpt|z');
18
+ const evalFile = arg(args, '--eval-file');
19
+ if (evalFile) {
20
+ if (arg(args, '--id') || arg(args, '--repo') || arg(args, '--plan-id') || arg(args, '--task-id'))
21
+ throw new Error('prompt --eval-file cannot bind a durable Job or Task');
22
+ // Isolated, read-only Builder invocation: no persisted Job, Task or Events Bus.
23
+ const scenario = JSON.parse(await readFile(evalFile, 'utf8'));
24
+ if (!scenario.projectPath || !scenario.agentName || !scenario.taskInput?.trim() || !/^[a-z0-9-]+$/.test(scenario.agentName))
25
+ throw new Error('prompt --eval-file requires projectPath, agentName and taskInput');
26
+ const projectPath = scenario.projectPath;
27
+ const context = await resolveExecutionContext(projectPath, 'worker');
28
+ const now = new Date().toISOString();
29
+ const caseId = scenario.caseId && /^[a-zA-Z0-9_-]+$/.test(scenario.caseId) ? scenario.caseId : 'case';
30
+ const job = createJobEntity({
31
+ id: 'EVAL_ONLY', title: 'Isolated prompt quality evaluation', repository: 'eval/isolated', prNumber: 0,
32
+ continuation: null, tasks: [], createdAt: now, updatedAt: now, projectPath,
33
+ });
34
+ const task = createTaskEntity(job, {
35
+ id: `eval-${caseId}`, jobId: 'EVAL_ONLY', title: caseId, agentName: scenario.agentName,
36
+ adapter, input: scenario.taskInput, output: { kind: 'file', path: '.evals/reports/evaluation-only.json' },
37
+ parentTaskId: null, dependencies: [], capabilities: [], attempt: 0, maxAttempts: 1,
38
+ leaseOwner: null, leaseExpiresAt: null, executionId: `eval-${caseId}-isolated`, threadId: null,
39
+ result: null, error: null, timeoutMs: 0, createdAt: now, updatedAt: now,
40
+ }, { defer: true });
41
+ job.tasks.push(task);
42
+ const productionPrompt = await managedWorkerInput(job, task, context);
43
+ const evaluationPrompt = await managedWorkerInput(job, task, context, 'evaluation');
44
+ const result = JSON.stringify({ builder: 'managedWorkerInput', mode: 'isolated-evaluation',
45
+ projectPath: context.project.path, agentName: scenario.agentName, adapter,
46
+ productionPrompt, evaluationPrompt }, null, 2);
47
+ const output = arg(args, '--output');
48
+ if (output)
49
+ await writeFile(output, result + '\n', { mode: 0o600 });
50
+ else
51
+ console.log(result);
52
+ return;
53
+ }
17
54
  const planId = arg(args, '--plan-id'), taskId = arg(args, '--task-id');
18
55
  if (!!planId === !!taskId)
19
56
  throw new Error('prompt requires exactly one of --plan-id or --task-id');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agents-relay",
3
- "version": "2.0.200",
3
+ "version": "2.0.201",
4
4
  "description": "Durable async agent jobs coordinated through GitHub pull requests",
5
5
  "repository": {
6
6
  "type": "git",