agents-relay 1.0.135 → 1.0.136
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
CHANGED
|
@@ -23,6 +23,7 @@ import { resolveExecutionContext } from './execution-context.js';
|
|
|
23
23
|
import { defaultWorkspaceRoot, resolveManagedProjectPath, resolveRepositoryProjectPath } from './workspace.js';
|
|
24
24
|
import { runBlockerCommand } from './cli-blocker.js';
|
|
25
25
|
import { helpText, usage } from './cli-help.js';
|
|
26
|
+
import { parseAgentGraph } from './agent-graph.js';
|
|
26
27
|
export { helpText } from './cli-help.js';
|
|
27
28
|
import { SERVICE_DEFAULTS, ServiceEventBus, arg, hasArg, textOption, integerArg, repository, storeFor, saveLocal, githubStore, eventBus, publishWake, priority, storySize, executionMode, chatGptTabClosePolicy, requestedExecutionMode, continuation, scheduleFromArgs, requestManagedReconciliation, } from './cli-support.js';
|
|
28
29
|
export { SERVICE_DEFAULTS, eventBus, executionMode, chatGptTabClosePolicy } from './cli-support.js';
|
|
@@ -75,6 +76,8 @@ async function workerTaskFromArgs(job, args, now) {
|
|
|
75
76
|
const outputPath = arg(args, '--output-path');
|
|
76
77
|
const input = await textOption(args, '--input', '--input-file');
|
|
77
78
|
const agentGraph = hasArg(args, '--agent-graph') || hasArg(args, '--agent-graph-file') ? await textOption(args, '--agent-graph', '--agent-graph-file') : undefined;
|
|
79
|
+
if (agentGraph)
|
|
80
|
+
parseAgentGraph(agentGraph);
|
|
78
81
|
if (!input.trim())
|
|
79
82
|
throw new Error('task create requires --input-file PATH|- or --input MARKDOWN');
|
|
80
83
|
if (!['codex', 'chatgpt', 'orchestrator'].includes(adapter))
|
|
@@ -225,8 +228,12 @@ async function runTaskCommand(action, args) {
|
|
|
225
228
|
task.projectName = arg(args, '--project') || undefined;
|
|
226
229
|
if (hasArg(args, '--agent'))
|
|
227
230
|
task.agentName = arg(args, '--agent') || undefined;
|
|
228
|
-
if (hasArg(args, '--agent-graph') || hasArg(args, '--agent-graph-file'))
|
|
229
|
-
|
|
231
|
+
if (hasArg(args, '--agent-graph') || hasArg(args, '--agent-graph-file')) {
|
|
232
|
+
const agentGraph = await textOption(args, '--agent-graph', '--agent-graph-file');
|
|
233
|
+
if (agentGraph)
|
|
234
|
+
parseAgentGraph(agentGraph);
|
|
235
|
+
task.agentGraph = agentGraph || undefined;
|
|
236
|
+
}
|
|
230
237
|
if (hasArg(args, '--parent'))
|
|
231
238
|
task.parentTaskId = arg(args, '--parent') || null;
|
|
232
239
|
if (hasArg(args, '--deps'))
|
package/dist/planner.js
CHANGED
|
@@ -4,6 +4,7 @@ import { fileURLToPath } from 'node:url';
|
|
|
4
4
|
import { dirname, join } from 'node:path';
|
|
5
5
|
import { storySizeTimeoutMs, taskOverallTimeoutMs } from './types.js';
|
|
6
6
|
import { executionContextPrompt } from './execution-context.js';
|
|
7
|
+
import { parseAgentGraph } from './agent-graph.js';
|
|
7
8
|
export function plannerRoundNumber(task) {
|
|
8
9
|
if (task.kind !== 'planner')
|
|
9
10
|
return null;
|
|
@@ -183,6 +184,15 @@ export function parsePlannerResult(value) {
|
|
|
183
184
|
const maxAttempts = task.maxAttempts === undefined ? 3 : task.maxAttempts;
|
|
184
185
|
const route = routing(task.routing, 'next_tasks[' + index + '].routing');
|
|
185
186
|
const requirements = workerRequirements(task.workerRequirements ?? task.requirements, 'next_tasks[' + index + '].workerRequirements');
|
|
187
|
+
const agentGraph = optionalString(task.agentGraph, `next_tasks[${index}].agentGraph`);
|
|
188
|
+
if (agentGraph) {
|
|
189
|
+
try {
|
|
190
|
+
parseAgentGraph(agentGraph);
|
|
191
|
+
}
|
|
192
|
+
catch (error) {
|
|
193
|
+
throw new Error(`Planner next_tasks[${index}].agentGraph is invalid: ${error instanceof Error ? error.message : String(error)}`);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
186
196
|
const timeoutMs = task.timeoutMs === undefined ? taskOverallTimeoutMs(storySize, route?.reasoning) : task.timeoutMs;
|
|
187
197
|
if (typeof maxAttempts !== 'number' || !Number.isInteger(maxAttempts) || maxAttempts < 1)
|
|
188
198
|
throw new Error(`Planner next_tasks[${index}].maxAttempts is invalid`);
|
|
@@ -190,7 +200,7 @@ export function parsePlannerResult(value) {
|
|
|
190
200
|
throw new Error(`Planner next_tasks[${index}].timeoutMs is invalid`);
|
|
191
201
|
return {
|
|
192
202
|
id, input: task.input, priority, storySize,
|
|
193
|
-
projectName: optionalString(task.projectName, 'projectName'), agentName: optionalString(task.agentName, 'agentName'), agentGraph
|
|
203
|
+
projectName: optionalString(task.projectName, 'projectName'), agentName: optionalString(task.agentName, 'agentName'), agentGraph,
|
|
194
204
|
dependencies: stringArray(task.dependencies, 'dependencies'), capabilities: stringArray(task.capabilities, 'capabilities'), workerRequirements: requirements,
|
|
195
205
|
adapter: adapter, output: output, routing: route,
|
|
196
206
|
continuation: task.continuation, maxAttempts, timeoutMs
|
package/package.json
CHANGED
|
@@ -96,7 +96,7 @@ Use these exact serialized forms:
|
|
|
96
96
|
- `output` is always an object, never a string:
|
|
97
97
|
- PR-backed work: `{"kind":"task_pr"}`
|
|
98
98
|
- File artifact: `{"kind":"file","path":"runs/2026-09-26/example/output.md"}`
|
|
99
|
-
- `agentGraph`, when present, is one Mermaid
|
|
99
|
+
- `agentGraph`, when present, is one executable Mermaid Agent Graph **string** using `flowchart TD|TB|LR|RL`, for example `"flowchart LR\n build-log-editor --> build-log-producer"`. Do not emit `graph LR`, and do not emit an object with `nodes` or `edges`.
|
|
100
100
|
- `priority`, when present, is exactly `"P0"`, `"P1"`, `"P2"`, or `"P3"`; otherwise omit it.
|
|
101
101
|
- `storySize` is exactly `"S"`, `"M"`, or `"L"`.
|
|
102
102
|
|
|
@@ -115,7 +115,7 @@ A valid non-satisfied response:
|
|
|
115
115
|
"storySize": "L",
|
|
116
116
|
"priority": "P1",
|
|
117
117
|
"agentName": "build-log-editor",
|
|
118
|
-
"agentGraph": "
|
|
118
|
+
"agentGraph": "flowchart LR\n build-log-editor --> build-log-producer"
|
|
119
119
|
}
|
|
120
120
|
]
|
|
121
121
|
}
|