agents-relay 2.0.146 → 2.0.147

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.
@@ -24,11 +24,30 @@ function parseLabel(raw, line) {
24
24
  }
25
25
  export function parseGraphV2(source) {
26
26
  const lines = source.split(/\r?\n/);
27
+ // Mermaid YAML frontmatter is metadata only; never execute it as graph policy.
28
+ // Preserve original source line positions for diagnostics and coverage reports.
29
+ let graphStart = 0;
30
+ if (lines[0]?.trim() === '---') {
31
+ let closing = -1;
32
+ for (let i = 1; i < lines.length; i += 1) {
33
+ if (lines[i].trim() === '---') {
34
+ closing = i;
35
+ break;
36
+ }
37
+ if (!/^(title|description):\s+[^\r\n]+$/.test(lines[i]))
38
+ fail(i + 1, 'unsupported graph frontmatter field');
39
+ }
40
+ if (closing < 0)
41
+ fail(1, 'unterminated graph frontmatter');
42
+ if (closing === 1)
43
+ fail(1, 'empty graph frontmatter');
44
+ graphStart = closing + 1;
45
+ }
27
46
  let direction = null;
28
47
  let initial = null;
29
48
  const nodes = new Map();
30
49
  const edges = [];
31
- for (let index = 0; index < lines.length; index += 1) {
50
+ for (let index = graphStart; index < lines.length; index += 1) {
32
51
  const lineNumber = index + 1;
33
52
  const line = lines[index].trim();
34
53
  if (!line)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agents-relay",
3
- "version": "2.0.146",
3
+ "version": "2.0.147",
4
4
  "description": "Durable async agent jobs coordinated through GitHub pull requests",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1,3 +1,7 @@
1
+ ---
2
+ title: Authoritative Unblock
3
+ description: Validates authoritative unblock requests and safely resumes blocked workflow work.
4
+ ---
1
5
  flowchart LR
2
6
  %% relay: initial blocked
3
7
  blocked["state: blocked"]
@@ -1,3 +1,7 @@
1
+ ---
2
+ title: Blocker Resolution
3
+ description: Resolves blockers through verified recovery evidence and graph-authorized decisions.
4
+ ---
1
5
  flowchart LR
2
6
  %% relay: initial waiting
3
7
  waiting["state: waiting"]
@@ -1,3 +1,7 @@
1
+ ---
2
+ title: Escalation
3
+ description: Routes unresolved recovery to human escalation and records response outcomes.
4
+ ---
1
5
  flowchart LR
2
6
  %% relay: initial suspected
3
7
  suspected["state: suspected_human_blocker"]
@@ -1,3 +1,7 @@
1
+ ---
2
+ title: Interactive Invocation
3
+ description: Controls interactive agent invocation through guarded lifecycle transitions.
4
+ ---
1
5
  flowchart LR
2
6
  %% relay: initial awaiting_decision
3
7
  awaiting_decision["state: awaiting_decision"]
@@ -1,3 +1,7 @@
1
+ ---
2
+ title: Job Lifecycle
3
+ description: Defines canonical Job states, completion gates, and terminal transitions.
4
+ ---
1
5
  flowchart LR
2
6
  %% relay: initial draft
3
7
  draft["state: DRAFT"]
package/workflow/main.mmd CHANGED
@@ -1,3 +1,7 @@
1
+ ---
2
+ title: Main
3
+ description: Presentation-only entry map linking workflow graphs and explaining contract, graph, code, guard, action, and effect ownership.
4
+ ---
1
5
  %% dashboard: presentation-only — not registered with GraphRuntime or the executable Graph DSL.
2
6
  %% PRINCIPLES (this graph is a readable overview, not an executable policy):
3
7
  %% CONTRACT defines typed events, permissions and invariants; GRAPH defines legal transitions,
@@ -1,3 +1,7 @@
1
+ ---
2
+ title: Orchestrator Rescue
3
+ description: Determines when orchestration needs safe intervention or recovery.
4
+ ---
1
5
  flowchart LR
2
6
  %% relay: initial idle
3
7
  idle["state: idle"]
@@ -1,3 +1,7 @@
1
+ ---
2
+ title: Planner Orchestration
3
+ description: Guards autonomous planning rounds, interrupted plans, and planner recovery.
4
+ ---
1
5
  flowchart LR
2
6
  %% relay: initial idle
3
7
  idle["state: idle"]
@@ -1,3 +1,7 @@
1
+ ---
2
+ title: Planner Trigger
3
+ description: Classifies planning requests as manual, unblock, scheduled, initial, or continuation.
4
+ ---
1
5
  flowchart LR
2
6
  %% relay: initial idle
3
7
  idle["state: idle"]
@@ -1,3 +1,7 @@
1
+ ---
2
+ title: Projection Conflict
3
+ description: Detects and resolves conflicting workflow state projections against authoritative facts.
4
+ ---
1
5
  flowchart LR
2
6
  %% relay: initial classify
3
7
  classify["state: classify"]
@@ -1,3 +1,7 @@
1
+ ---
2
+ title: Review Lifecycle
3
+ description: Manages review creation, immutable verdicts, changes-required, and re-review.
4
+ ---
1
5
  flowchart LR
2
6
  %% relay: initial none
3
7
  none["state: NONE"]
@@ -1,3 +1,7 @@
1
+ ---
2
+ title: Schedule Cycle
3
+ description: Reconciles scheduled execution slots and finishes verified completed slots.
4
+ ---
1
5
  flowchart LR
2
6
  %% relay: initial idle
3
7
  idle["state: idle"]
@@ -1,3 +1,7 @@
1
+ ---
2
+ title: Scheduled Run
3
+ description: Controls scheduled-run lifecycle and guarded execution.
4
+ ---
1
5
  flowchart LR
2
6
  %% relay: initial idle
3
7
  idle["state: idle"]
@@ -1,3 +1,7 @@
1
+ ---
2
+ title: Task Lifecycle
3
+ description: Defines canonical Task transitions, dispatch guards, failure, and recovery.
4
+ ---
1
5
  flowchart LR
2
6
  %% relay: initial draft
3
7
  draft["state: DRAFT"]
@@ -1,3 +1,7 @@
1
+ ---
2
+ title: Task Related Action
3
+ description: Authorizes task-related control actions using current workflow state.
4
+ ---
1
5
  flowchart LR
2
6
  %% relay: initial evaluate
3
7
  evaluate["state: evaluate"]
@@ -1,3 +1,7 @@
1
+ ---
2
+ title: Task Resolution
3
+ description: Selects and verifies resolution paths for failed or blocked Tasks.
4
+ ---
1
5
  flowchart LR
2
6
  %% relay: initial unresolved
3
7
  unresolved["state: unresolved"]
@@ -1,3 +1,7 @@
1
+ ---
2
+ title: Troubleshooter
3
+ description: Coordinates diagnosis, recovery, escalation, and resolution of failed Tasks.
4
+ ---
1
5
  flowchart LR
2
6
  %% relay: initial idle
3
7
  idle["state: idle"]