@llblab/pi-actors 0.23.0 → 0.24.0

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.
Files changed (161) hide show
  1. package/AGENTS.md +125 -60
  2. package/BACKLOG.md +93 -188
  3. package/CHANGELOG.md +22 -0
  4. package/README.md +13 -0
  5. package/dist/fixtures/protocol/actor-message-branch.json +13 -0
  6. package/dist/fixtures/protocol/artifact-manifest.json +9 -0
  7. package/dist/fixtures/protocol/mailbox-contract.json +15 -0
  8. package/dist/fixtures/protocol/recipe-summary.json +16 -0
  9. package/dist/fixtures/protocol/room-message.json +11 -0
  10. package/dist/fixtures/protocol/room-roster.json +11 -0
  11. package/dist/fixtures/protocol/run-inbox-message.json +9 -0
  12. package/dist/fixtures/protocol/run-outbox-event.json +9 -0
  13. package/dist/fixtures/protocol/run-state.json +10 -0
  14. package/dist/index.js +3 -2
  15. package/dist/lib/actor-inspector-tui.js +5 -32
  16. package/dist/lib/actor-rooms.d.ts +8 -0
  17. package/dist/lib/actor-rooms.js +64 -20
  18. package/dist/lib/actor-worker.d.ts +13 -0
  19. package/dist/lib/actor-worker.js +86 -0
  20. package/dist/lib/async-runner.d.ts +5 -0
  21. package/dist/lib/async-runner.js +134 -0
  22. package/dist/lib/async-runs.js +9 -28
  23. package/dist/lib/build-dist.d.ts +5 -0
  24. package/dist/lib/build-dist.js +24 -0
  25. package/dist/lib/conformance.d.ts +12 -0
  26. package/dist/lib/conformance.js +28 -0
  27. package/dist/lib/coordinator.d.ts +5 -0
  28. package/dist/lib/coordinator.js +557 -0
  29. package/dist/lib/locker.d.ts +5 -0
  30. package/dist/lib/locker.js +310 -0
  31. package/dist/lib/mailbox-loop.d.ts +41 -0
  32. package/dist/lib/mailbox-loop.js +62 -0
  33. package/dist/lib/observability.d.ts +2 -2
  34. package/dist/lib/observability.js +51 -53
  35. package/dist/lib/prompts.d.ts +1 -1
  36. package/dist/lib/prompts.js +1 -1
  37. package/dist/lib/recipe-references.js +25 -2
  38. package/dist/lib/recipe-utils.d.ts +5 -0
  39. package/dist/lib/recipe-utils.js +385 -0
  40. package/dist/lib/runtime-notifier.js +3 -7
  41. package/dist/lib/state-readers.d.ts +21 -0
  42. package/dist/lib/state-readers.js +74 -0
  43. package/dist/lib/tools.js +1 -1
  44. package/dist/lib/validate-recipe.d.ts +6 -0
  45. package/dist/lib/validate-recipe.js +104 -0
  46. package/dist/recipes/actor-worker.json +35 -0
  47. package/dist/recipes/coordinator-locker.json +45 -0
  48. package/dist/recipes/lens-swarm.json +66 -0
  49. package/dist/recipes/locker.json +45 -0
  50. package/dist/recipes/music-player.json +38 -0
  51. package/dist/recipes/pipeline-architect-coordinator.json +95 -0
  52. package/dist/recipes/pipeline-artifact-bundle.json +100 -0
  53. package/dist/recipes/pipeline-artifact-report.json +58 -0
  54. package/dist/recipes/pipeline-artifact-write.json +72 -0
  55. package/dist/recipes/pipeline-async-run-ops.json +70 -0
  56. package/dist/recipes/pipeline-checkpoint-continuation.json +67 -0
  57. package/dist/recipes/pipeline-development-tasking.json +81 -0
  58. package/dist/recipes/pipeline-docs-maintenance.json +80 -0
  59. package/dist/recipes/pipeline-media-library.json +59 -0
  60. package/dist/recipes/pipeline-quorum-review.json +79 -0
  61. package/dist/recipes/pipeline-release-readiness.json +110 -0
  62. package/dist/recipes/pipeline-release-summary.json +88 -0
  63. package/dist/recipes/pipeline-repo-health.json +89 -0
  64. package/dist/recipes/pipeline-research-synthesis.json +94 -0
  65. package/dist/recipes/pipeline-review-readiness.json +54 -0
  66. package/dist/recipes/pipeline-room-swarm.json +50 -0
  67. package/dist/recipes/subagent-artifact.json +32 -0
  68. package/dist/recipes/subagent-checkpoint.json +33 -0
  69. package/dist/recipes/subagent-conflict-report.json +32 -0
  70. package/dist/recipes/subagent-contradiction-map.json +33 -0
  71. package/dist/recipes/subagent-critic.json +35 -0
  72. package/dist/recipes/subagent-evidence-map.json +33 -0
  73. package/dist/recipes/subagent-followup.json +33 -0
  74. package/dist/recipes/subagent-judge.json +33 -0
  75. package/dist/recipes/subagent-merge.json +33 -0
  76. package/dist/recipes/subagent-message.json +34 -0
  77. package/dist/recipes/subagent-normalize.json +31 -0
  78. package/dist/recipes/subagent-plan.json +33 -0
  79. package/dist/recipes/subagent-prompt.json +28 -0
  80. package/dist/recipes/subagent-quorum.json +43 -0
  81. package/dist/recipes/subagent-review-coordinator.json +114 -0
  82. package/dist/recipes/subagent-review.json +37 -0
  83. package/dist/recipes/subagent-task-card.json +35 -0
  84. package/dist/recipes/subagent-tools.json +27 -0
  85. package/dist/recipes/subagent-verify.json +34 -0
  86. package/dist/recipes/subagents-prompts.json +51 -0
  87. package/dist/recipes/utility-actor-message.json +23 -0
  88. package/dist/recipes/utility-artifact-manifest.json +16 -0
  89. package/dist/recipes/utility-artifact-write.json +16 -0
  90. package/dist/recipes/utility-changelog-head.json +11 -0
  91. package/dist/recipes/utility-changelog-section.json +13 -0
  92. package/dist/recipes/utility-coordinator-lock-snapshot.json +13 -0
  93. package/dist/recipes/utility-git-log.json +11 -0
  94. package/dist/recipes/utility-git-status.json +9 -0
  95. package/dist/recipes/utility-jsonl-tail.json +10 -0
  96. package/dist/recipes/utility-markdown-index.json +14 -0
  97. package/dist/recipes/utility-package-summary.json +11 -0
  98. package/dist/recipes/utility-playlist-build.json +17 -0
  99. package/dist/recipes/utility-playlist-scan.json +11 -0
  100. package/dist/recipes/utility-run-ops-snapshot.json +17 -0
  101. package/dist/recipes/utility-run-state-files.json +13 -0
  102. package/dist/recipes/utility-run-summary.json +11 -0
  103. package/dist/recipes/utility-skill-summary.json +13 -0
  104. package/dist/recipes/utility-validate-recipe.json +13 -0
  105. package/dist/recipes/utility-validation-wrapper.json +13 -0
  106. package/dist/scripts/actor-worker.mjs +31 -0
  107. package/dist/scripts/async-runner.mjs +31 -0
  108. package/dist/scripts/build-dist.mjs +25 -0
  109. package/dist/scripts/conformance.mjs +33 -0
  110. package/dist/scripts/coordinator.mjs +31 -0
  111. package/dist/scripts/locker.mjs +33 -0
  112. package/dist/scripts/music-player.mjs +964 -0
  113. package/dist/scripts/recipe-utils.mjs +31 -0
  114. package/dist/scripts/validate-recipe.mjs +34 -0
  115. package/dist/skills/actors/SKILL.md +375 -0
  116. package/dist/skills/swarm/SKILL.md +467 -0
  117. package/dist/skills/swarm/references/development-swarm.md +596 -0
  118. package/docs/actor-messages.md +2 -2
  119. package/docs/async-runs.md +11 -0
  120. package/docs/template-recipes.md +1 -1
  121. package/fixtures/protocol/actor-message-branch.json +13 -0
  122. package/fixtures/protocol/artifact-manifest.json +9 -0
  123. package/fixtures/protocol/mailbox-contract.json +15 -0
  124. package/fixtures/protocol/recipe-summary.json +16 -0
  125. package/fixtures/protocol/room-message.json +11 -0
  126. package/fixtures/protocol/room-roster.json +11 -0
  127. package/fixtures/protocol/run-inbox-message.json +9 -0
  128. package/fixtures/protocol/run-outbox-event.json +9 -0
  129. package/fixtures/protocol/run-state.json +10 -0
  130. package/index.ts +3 -0
  131. package/lib/actor-inspector-tui.ts +11 -34
  132. package/lib/actor-rooms.ts +88 -18
  133. package/lib/actor-worker.ts +118 -0
  134. package/lib/async-runner.ts +173 -0
  135. package/lib/async-runs.ts +12 -22
  136. package/lib/build-dist.ts +30 -0
  137. package/lib/conformance.ts +46 -0
  138. package/lib/coordinator.ts +649 -0
  139. package/lib/locker.ts +340 -0
  140. package/lib/mailbox-loop.ts +148 -0
  141. package/lib/observability.ts +24 -19
  142. package/lib/prompts.ts +1 -1
  143. package/lib/recipe-references.ts +37 -2
  144. package/lib/recipe-utils.ts +486 -0
  145. package/lib/runtime-notifier.ts +4 -6
  146. package/lib/state-readers.ts +93 -0
  147. package/lib/tools.ts +1 -1
  148. package/lib/validate-recipe.ts +110 -0
  149. package/package.json +10 -2
  150. package/recipes/actor-worker.json +35 -0
  151. package/recipes/pipeline-quorum-review.json +12 -7
  152. package/scripts/actor-worker.mjs +31 -0
  153. package/scripts/async-runner.mjs +11 -201
  154. package/scripts/build-dist.mjs +25 -0
  155. package/scripts/conformance.mjs +21 -35
  156. package/scripts/coordinator.mjs +15 -625
  157. package/scripts/locker.mjs +20 -332
  158. package/scripts/recipe-utils.mjs +17 -477
  159. package/scripts/validate-recipe.mjs +18 -121
  160. package/skills/actors/SKILL.md +5 -2
  161. package/skills/swarm/SKILL.md +3 -1
@@ -0,0 +1,45 @@
1
+ {
2
+ "async": true,
3
+ "args": [
4
+ "repo:path",
5
+ "lease_ms:int"
6
+ ],
7
+ "defaults": {
8
+ "repo": "~/.pi/agent/extensions/pi-actors",
9
+ "lease_ms": "600000"
10
+ },
11
+ "mailbox": {
12
+ "accepts": [
13
+ "coord.enqueue",
14
+ "coord.claim",
15
+ "coord.complete",
16
+ "coord.fail",
17
+ "lock.acquire",
18
+ "lock.renew",
19
+ "lock.release",
20
+ "control.stop",
21
+ "control.cancel",
22
+ "control.kill"
23
+ ],
24
+ "emits": [
25
+ "coord.started",
26
+ "coord.enqueued",
27
+ "coord.assigned",
28
+ "coord.empty",
29
+ "coord.completed",
30
+ "coord.failed",
31
+ "lock.granted",
32
+ "lock.denied",
33
+ "lock.renewed",
34
+ "lock.released",
35
+ "run.done",
36
+ "run.failed"
37
+ ]
38
+ },
39
+ "artifacts": {
40
+ "queue": "{state_dir}/queue.json",
41
+ "locks": "{state_dir}/locks.json",
42
+ "journal": "{state_dir}/journal.jsonl"
43
+ },
44
+ "template": "{repo}/scripts/locker.mjs serve --state-dir {state_dir} --lease-ms {lease_ms}"
45
+ }
@@ -0,0 +1,66 @@
1
+ {
2
+ "description": "General-purpose multi-lens review swarm. Launches independent reviewers by lens, then verifies, merges, judges, and normalizes the result.",
3
+ "async": true,
4
+ "imports": {
5
+ "coordinator": "subagent-review-coordinator.json"
6
+ },
7
+ "args": [
8
+ "scope:string",
9
+ "lenses:array",
10
+ "model:string",
11
+ "thinking:string",
12
+ "tools:string",
13
+ "claim:string",
14
+ "evidence_policy:string",
15
+ "risk_policy:string",
16
+ "output_format:string"
17
+ ],
18
+ "defaults": {
19
+ "lenses": [
20
+ "correctness",
21
+ "architecture",
22
+ "operator UX"
23
+ ],
24
+ "thinking": "off",
25
+ "tools": "",
26
+ "claim": "The reviewed scope has clear, evidence-based findings, risks, and recommended next actions.",
27
+ "evidence_policy": "Cite inspected files, command outputs, or explicit uncertainty for every material claim.",
28
+ "risk_policy": "Preserve minority high-impact risks and ideas; separate confirmed issues from hypotheses.",
29
+ "output_format": "Markdown sections: Summary, Consensus Findings, Minority Findings, Verification, Judge Notes, Risks, Next Actions."
30
+ },
31
+ "mailbox": {
32
+ "accepts": [
33
+ "control.stop",
34
+ "control.cancel",
35
+ "control.kill"
36
+ ],
37
+ "emits": [
38
+ "review.completed",
39
+ "verification.completed",
40
+ "merge.completed",
41
+ "judge.completed",
42
+ "command.done",
43
+ "run.done",
44
+ "run.failed"
45
+ ]
46
+ },
47
+ "template": [
48
+ {
49
+ "name": "coordinator",
50
+ "values": {
51
+ "scope": "{scope}",
52
+ "lenses": "{lenses}",
53
+ "claim": "{claim}",
54
+ "reviewer_model": "{model}",
55
+ "verifier_model": "{model}",
56
+ "merger_model": "{model}",
57
+ "judge_model": "{model}",
58
+ "thinking": "{thinking}",
59
+ "tools": "{tools}",
60
+ "evidence_policy": "{evidence_policy}",
61
+ "risk_policy": "{risk_policy}",
62
+ "output_format": "{output_format}"
63
+ }
64
+ }
65
+ ]
66
+ }
@@ -0,0 +1,45 @@
1
+ {
2
+ "async": true,
3
+ "args": [
4
+ "repo:path",
5
+ "lease_ms:int"
6
+ ],
7
+ "defaults": {
8
+ "repo": "~/.pi/agent/extensions/pi-actors",
9
+ "lease_ms": "600000"
10
+ },
11
+ "mailbox": {
12
+ "accepts": [
13
+ "lock.enqueue",
14
+ "lock.claim",
15
+ "lock.complete",
16
+ "lock.fail",
17
+ "lock.acquire",
18
+ "lock.renew",
19
+ "lock.release",
20
+ "control.stop",
21
+ "control.cancel",
22
+ "control.kill"
23
+ ],
24
+ "emits": [
25
+ "lock.started",
26
+ "lock.enqueued",
27
+ "lock.assigned",
28
+ "lock.empty",
29
+ "lock.completed",
30
+ "lock.failed",
31
+ "lock.granted",
32
+ "lock.denied",
33
+ "lock.renewed",
34
+ "lock.released",
35
+ "run.done",
36
+ "run.failed"
37
+ ]
38
+ },
39
+ "artifacts": {
40
+ "queue": "{state_dir}/queue.json",
41
+ "locks": "{state_dir}/locks.json",
42
+ "journal": "{state_dir}/journal.jsonl"
43
+ },
44
+ "template": "{repo}/scripts/locker.mjs serve --state-dir {state_dir} --lease-ms {lease_ms}"
45
+ }
@@ -0,0 +1,38 @@
1
+ {
2
+ "async": true,
3
+ "args": [
4
+ "repo:path",
5
+ "command:enum(play,pause,resume,toggle,next,previous,stop,status)",
6
+ "source:string",
7
+ "loop:bool",
8
+ "volume:int",
9
+ "player:enum(auto,mpv,afplay,ffplay,cvlc,play,wmp)",
10
+ "state_dir:path"
11
+ ],
12
+ "defaults": {
13
+ "repo": "~/.pi/agent/extensions/pi-actors",
14
+ "command": "play",
15
+ "loop": "true",
16
+ "volume": "70",
17
+ "player": "auto"
18
+ },
19
+ "mailbox": {
20
+ "accepts": [
21
+ "control.stop",
22
+ "control.cancel",
23
+ "control.kill",
24
+ "player.play",
25
+ "player.pause",
26
+ "player.resume",
27
+ "player.toggle",
28
+ "player.next",
29
+ "player.previous",
30
+ "player.stop",
31
+ "player.status"
32
+ ],
33
+ "emits": [
34
+ "player.track"
35
+ ]
36
+ },
37
+ "template": "{repo}/scripts/music-player.mjs {command} {source} {loop} {volume} {player} {state_dir}"
38
+ }
@@ -0,0 +1,95 @@
1
+ {
2
+ "async": true,
3
+ "imports": {
4
+ "reviewer": "subagent-review.json",
5
+ "critic": "subagent-critic.json",
6
+ "verifier": "subagent-verify.json",
7
+ "merger": "subagent-merge.json",
8
+ "normalizer": "subagent-normalize.json"
9
+ },
10
+ "args": [
11
+ "problem:string",
12
+ "lenses:array",
13
+ "constraints:string",
14
+ "model:string",
15
+ "tools:string"
16
+ ],
17
+ "defaults": {
18
+ "lenses": [
19
+ "architecture",
20
+ "implementation pragmatism",
21
+ "operator UX",
22
+ "failure modes"
23
+ ],
24
+ "constraints": "Prefer small composable pieces, explicit contracts, and no broad workflow DSL.",
25
+ "tools": ""
26
+ },
27
+ "mailbox": {
28
+ "accepts": [
29
+ "control.stop",
30
+ "control.cancel",
31
+ "control.kill"
32
+ ],
33
+ "emits": [
34
+ "pipeline.completed",
35
+ "command.done",
36
+ "run.done",
37
+ "run.failed"
38
+ ]
39
+ },
40
+ "template": [
41
+ {
42
+ "parallel": true,
43
+ "repeat": "{lenses.length}",
44
+ "failure": "branch",
45
+ "template": {
46
+ "name": "reviewer",
47
+ "values": {
48
+ "scope": "{problem}",
49
+ "lens": "{lenses[index]}",
50
+ "instructions": "Propose one architecture direction and one smallest next slice within constraints: {constraints}",
51
+ "model": "{model}",
52
+ "thinking": "medium",
53
+ "tools": "{tools}"
54
+ }
55
+ }
56
+ },
57
+ {
58
+ "name": "critic",
59
+ "values": {
60
+ "target": "Use proposed directions from stdin for problem: {problem}",
61
+ "constraints": "{constraints}",
62
+ "model": "{model}",
63
+ "tools": "{tools}"
64
+ }
65
+ },
66
+ {
67
+ "name": "verifier",
68
+ "values": {
69
+ "claim": "The proposed architecture can be advanced by a small validated next slice.",
70
+ "evidence": "Use proposed directions and critique from stdin.",
71
+ "model": "{model}",
72
+ "tools": "{tools}"
73
+ }
74
+ },
75
+ {
76
+ "name": "merger",
77
+ "values": {
78
+ "inputs": "Use brainstorm, critique, and verification outputs from stdin.",
79
+ "mode": "risk-first",
80
+ "risk_policy": "Prefer a feasible smallest next slice over ambitious completeness.",
81
+ "model": "{model}",
82
+ "tools": "{tools}"
83
+ }
84
+ },
85
+ {
86
+ "name": "normalizer",
87
+ "values": {
88
+ "input": "Use architecture synthesis from stdin.",
89
+ "format": "Markdown sections: Direction, Rejected Alternatives, Risks, Component Contracts, Next Slice, Validation Gates.",
90
+ "model": "{model}",
91
+ "tools": "{tools}"
92
+ }
93
+ }
94
+ ]
95
+ }
@@ -0,0 +1,100 @@
1
+ {
2
+ "async": true,
3
+ "imports": {
4
+ "artifactWrite": "pipeline-artifact-write.json",
5
+ "manifest": "utility-artifact-manifest.json",
6
+ "manifestWrite": "utility-artifact-write.json",
7
+ "validation": "utility-validation-wrapper.json",
8
+ "message": "utility-actor-message.json"
9
+ },
10
+ "args": [
11
+ "input:string",
12
+ "artifact_path:path",
13
+ "manifest_path:path",
14
+ "artifact_title:string",
15
+ "artifact_format:string",
16
+ "artifact_status:enum(draft,ready,blocked,accepted)",
17
+ "write_mode:enum(create,overwrite,append)",
18
+ "run_validation:bool",
19
+ "validation_command:string",
20
+ "validation_scope:string",
21
+ "validation_timeout_ms:int",
22
+ "model:string",
23
+ "tools:string"
24
+ ],
25
+ "defaults": {
26
+ "artifact_title": "Artifact Bundle",
27
+ "artifact_format": "Markdown sections: Summary, Findings, Evidence, Risks, Next Actions.",
28
+ "artifact_status": "ready",
29
+ "write_mode": "create",
30
+ "run_validation": "false",
31
+ "validation_command": "true",
32
+ "validation_scope": ".",
33
+ "validation_timeout_ms": "300000",
34
+ "tools": ""
35
+ },
36
+ "mailbox": {
37
+ "accepts": [
38
+ "control.stop",
39
+ "control.cancel",
40
+ "control.kill"
41
+ ],
42
+ "emits": [
43
+ "artifact.bundle_ready",
44
+ "artifact.written",
45
+ "artifact.blocked",
46
+ "run.done",
47
+ "run.failed"
48
+ ]
49
+ },
50
+ "artifacts": {
51
+ "artifact": "{artifact_path}",
52
+ "manifest": "{manifest_path}"
53
+ },
54
+ "template": [
55
+ {
56
+ "when": "run_validation",
57
+ "name": "validation",
58
+ "values": {
59
+ "command": "{validation_command}",
60
+ "scope": "{validation_scope}",
61
+ "timeout_ms": "{validation_timeout_ms}"
62
+ }
63
+ },
64
+ {
65
+ "name": "artifactWrite",
66
+ "values": {
67
+ "input": "{input}",
68
+ "artifact_path": "{artifact_path}",
69
+ "artifact_format": "{artifact_format}",
70
+ "write_mode": "{write_mode}",
71
+ "model": "{model}",
72
+ "tools": "{tools}"
73
+ }
74
+ },
75
+ {
76
+ "name": "manifest",
77
+ "values": {
78
+ "artifact_path": "{artifact_path}",
79
+ "title": "{artifact_title}",
80
+ "status": "{artifact_status}",
81
+ "summary": "Artifact bundle manifest for {artifact_path}."
82
+ }
83
+ },
84
+ {
85
+ "name": "manifestWrite",
86
+ "values": {
87
+ "artifact_path": "{manifest_path}",
88
+ "mode": "{write_mode}"
89
+ }
90
+ },
91
+ {
92
+ "name": "message",
93
+ "values": {
94
+ "type": "artifact.bundle_ready",
95
+ "summary": "Artifact bundle ready: {artifact_path} with manifest {manifest_path}.",
96
+ "metadata": "{\"artifact\":\"{artifact_path}\",\"manifest\":\"{manifest_path}\"}"
97
+ }
98
+ }
99
+ ]
100
+ }
@@ -0,0 +1,58 @@
1
+ {
2
+ "async": true,
3
+ "imports": {
4
+ "normalizer": "subagent-normalize.json",
5
+ "artifact": "subagent-artifact.json",
6
+ "message": "utility-actor-message.json"
7
+ },
8
+ "args": [
9
+ "input:string",
10
+ "artifact_path:path",
11
+ "artifact_format:string",
12
+ "model:string",
13
+ "tools:string"
14
+ ],
15
+ "defaults": {
16
+ "artifact_format": "Markdown sections: Summary, Findings, Evidence, Risks, Next Actions.",
17
+ "tools": ""
18
+ },
19
+ "mailbox": {
20
+ "accepts": [
21
+ "control.stop",
22
+ "control.cancel",
23
+ "control.kill"
24
+ ],
25
+ "emits": [
26
+ "artifact.prepared",
27
+ "artifact.blocked"
28
+ ]
29
+ },
30
+ "template": [
31
+ {
32
+ "name": "normalizer",
33
+ "values": {
34
+ "input": "{input}",
35
+ "format": "{artifact_format}",
36
+ "model": "{model}",
37
+ "tools": "{tools}"
38
+ }
39
+ },
40
+ {
41
+ "name": "artifact",
42
+ "values": {
43
+ "input": "Use normalized report from stdin.",
44
+ "artifact_path": "{artifact_path}",
45
+ "artifact_format": "{artifact_format}",
46
+ "model": "{model}",
47
+ "tools": "{tools}"
48
+ }
49
+ },
50
+ {
51
+ "name": "message",
52
+ "values": {
53
+ "type": "artifact.prepared",
54
+ "summary": "Artifact prepared for path {artifact_path}."
55
+ }
56
+ }
57
+ ]
58
+ }
@@ -0,0 +1,72 @@
1
+ {
2
+ "async": true,
3
+ "imports": {
4
+ "normalizer": "subagent-normalize.json",
5
+ "artifact": "subagent-artifact.json",
6
+ "writer": "utility-artifact-write.json",
7
+ "message": "utility-actor-message.json"
8
+ },
9
+ "args": [
10
+ "input:string",
11
+ "artifact_path:path",
12
+ "artifact_format:string",
13
+ "write_mode:enum(create,overwrite,append)",
14
+ "model:string",
15
+ "tools:string"
16
+ ],
17
+ "defaults": {
18
+ "artifact_format": "Markdown sections: Summary, Findings, Evidence, Risks, Next Actions.",
19
+ "write_mode": "create",
20
+ "tools": ""
21
+ },
22
+ "mailbox": {
23
+ "accepts": [
24
+ "control.stop",
25
+ "control.cancel",
26
+ "control.kill"
27
+ ],
28
+ "emits": [
29
+ "artifact.written",
30
+ "artifact.blocked"
31
+ ]
32
+ },
33
+ "artifacts": {
34
+ "artifact": "{artifact_path}"
35
+ },
36
+ "template": [
37
+ {
38
+ "name": "normalizer",
39
+ "values": {
40
+ "input": "{input}",
41
+ "format": "{artifact_format}",
42
+ "model": "{model}",
43
+ "tools": "{tools}"
44
+ }
45
+ },
46
+ {
47
+ "name": "artifact",
48
+ "values": {
49
+ "input": "Use normalized report from stdin.",
50
+ "artifact_path": "{artifact_path}",
51
+ "artifact_format": "{artifact_format}",
52
+ "write_policy": "The caller selected deterministic write mode {write_mode}; produce only the artifact content that should be written, with no surrounding commentary outside the artifact body.",
53
+ "model": "{model}",
54
+ "tools": "{tools}"
55
+ }
56
+ },
57
+ {
58
+ "name": "writer",
59
+ "values": {
60
+ "artifact_path": "{artifact_path}",
61
+ "mode": "{write_mode}"
62
+ }
63
+ },
64
+ {
65
+ "name": "message",
66
+ "values": {
67
+ "type": "artifact.written",
68
+ "summary": "Artifact written to path {artifact_path} using mode {write_mode}."
69
+ }
70
+ }
71
+ ]
72
+ }
@@ -0,0 +1,70 @@
1
+ {
2
+ "async": true,
3
+ "imports": {
4
+ "snapshot": "utility-run-ops-snapshot.json",
5
+ "normalizer": "subagent-normalize.json",
6
+ "artifact": "pipeline-artifact-report.json"
7
+ },
8
+ "args": [
9
+ "state_root:path",
10
+ "run_id:string",
11
+ "lines:int",
12
+ "stale_minutes:int",
13
+ "artifact_path:path",
14
+ "model:string",
15
+ "tools:string"
16
+ ],
17
+ "defaults": {
18
+ "state_root": "~/.pi/agent/tmp/pi-actors/runs",
19
+ "run_id": "music",
20
+ "lines": "80",
21
+ "stale_minutes": "60",
22
+ "artifact_path": "./async-run-ops.md",
23
+ "tools": ""
24
+ },
25
+ "mailbox": {
26
+ "accepts": [
27
+ "control.stop",
28
+ "control.cancel",
29
+ "control.kill"
30
+ ],
31
+ "emits": [
32
+ "operations.completed",
33
+ "artifact.prepared",
34
+ "command.done",
35
+ "run.done",
36
+ "run.failed"
37
+ ]
38
+ },
39
+ "template": [
40
+ {
41
+ "name": "snapshot",
42
+ "values": {
43
+ "state_root": "{state_root}",
44
+ "run_id": "{run_id}",
45
+ "lines": "{lines}",
46
+ "stale_minutes": "{stale_minutes}"
47
+ }
48
+ },
49
+ {
50
+ "name": "normalizer",
51
+ "values": {
52
+ "input": "Use actor run operations snapshot JSON from stdin. State root: {state_root}. Inspected run: {run_id}.",
53
+ "format": "Markdown sections: Active Runs, Terminal Runs, Recent Actor Messages, Stale/Risky Runs, Recommended Controls, Follow-up Needed.",
54
+ "model": "{model}",
55
+ "thinking": "off",
56
+ "tools": "{tools}"
57
+ }
58
+ },
59
+ {
60
+ "name": "artifact",
61
+ "values": {
62
+ "input": "Use normalized async-run operations report from stdin.",
63
+ "artifact_path": "{artifact_path}",
64
+ "artifact_format": "Markdown sections: Status, Actor Messages, Risks, Recommended Actions.",
65
+ "model": "{model}",
66
+ "tools": "{tools}"
67
+ }
68
+ }
69
+ ]
70
+ }
@@ -0,0 +1,67 @@
1
+ {
2
+ "async": true,
3
+ "imports": {
4
+ "checkpoint": "subagent-checkpoint.json",
5
+ "followup": "subagent-followup.json",
6
+ "normalizer": "subagent-normalize.json"
7
+ },
8
+ "args": [
9
+ "state:string",
10
+ "question:string",
11
+ "reply:string",
12
+ "mode:enum(same-context,degraded-new-branch)",
13
+ "model:string",
14
+ "tools:string"
15
+ ],
16
+ "defaults": {
17
+ "reply": "No coordinator reply provided yet; produce a checkpoint artifact only.",
18
+ "mode": "degraded-new-branch",
19
+ "tools": ""
20
+ },
21
+ "mailbox": {
22
+ "accepts": [
23
+ "control.reply",
24
+ "control.revise",
25
+ "control.stop",
26
+ "control.cancel",
27
+ "control.kill"
28
+ ],
29
+ "emits": [
30
+ "checkpoint.needs_input",
31
+ "checkpoint.continued",
32
+ "command.done",
33
+ "run.done",
34
+ "run.failed"
35
+ ]
36
+ },
37
+ "template": [
38
+ {
39
+ "name": "checkpoint",
40
+ "values": {
41
+ "state": "{state}",
42
+ "question": "{question}",
43
+ "model": "{model}",
44
+ "tools": "{tools}"
45
+ }
46
+ },
47
+ {
48
+ "name": "followup",
49
+ "values": {
50
+ "checkpoint": "Use checkpoint output from stdin.",
51
+ "reply": "{reply}",
52
+ "mode": "{mode}",
53
+ "model": "{model}",
54
+ "tools": "{tools}"
55
+ }
56
+ },
57
+ {
58
+ "name": "normalizer",
59
+ "values": {
60
+ "input": "Use checkpoint and follow-up outputs from stdin.",
61
+ "format": "Markdown sections: Checkpoint, Coordinator Reply, Continuation Mode, Lost Context, Next Actions.",
62
+ "model": "{model}",
63
+ "tools": "{tools}"
64
+ }
65
+ }
66
+ ]
67
+ }