@llblab/pi-actors 0.22.5 → 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 (180) hide show
  1. package/AGENTS.md +125 -59
  2. package/BACKLOG.md +88 -403
  3. package/CHANGELOG.md +39 -0
  4. package/README.md +14 -1
  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 +18 -2
  15. package/dist/lib/actor-inspector-tui.d.ts +4 -0
  16. package/dist/lib/actor-inspector-tui.js +58 -44
  17. package/dist/lib/actor-rooms.d.ts +16 -0
  18. package/dist/lib/actor-rooms.js +123 -28
  19. package/dist/lib/actor-worker.d.ts +13 -0
  20. package/dist/lib/actor-worker.js +86 -0
  21. package/dist/lib/async-runner.d.ts +5 -0
  22. package/dist/lib/async-runner.js +134 -0
  23. package/dist/lib/async-runs.d.ts +34 -2
  24. package/dist/lib/async-runs.js +224 -50
  25. package/dist/lib/build-dist.d.ts +5 -0
  26. package/dist/lib/build-dist.js +24 -0
  27. package/dist/lib/command-templates.js +5 -5
  28. package/dist/lib/conformance.d.ts +12 -0
  29. package/dist/lib/conformance.js +28 -0
  30. package/dist/lib/coordinator.d.ts +5 -0
  31. package/dist/lib/coordinator.js +557 -0
  32. package/dist/lib/limits.d.ts +11 -0
  33. package/dist/lib/limits.js +11 -0
  34. package/dist/lib/locker.d.ts +5 -0
  35. package/dist/lib/locker.js +310 -0
  36. package/dist/lib/mailbox-loop.d.ts +41 -0
  37. package/dist/lib/mailbox-loop.js +62 -0
  38. package/dist/lib/observability.d.ts +2 -2
  39. package/dist/lib/observability.js +57 -57
  40. package/dist/lib/output.js +4 -5
  41. package/dist/lib/prompts.d.ts +1 -1
  42. package/dist/lib/prompts.js +1 -1
  43. package/dist/lib/recipe-discovery.js +1 -0
  44. package/dist/lib/recipe-references.d.ts +11 -2
  45. package/dist/lib/recipe-references.js +29 -4
  46. package/dist/lib/recipe-usage.d.ts +2 -1
  47. package/dist/lib/recipe-usage.js +15 -3
  48. package/dist/lib/recipe-utils.d.ts +5 -0
  49. package/dist/lib/recipe-utils.js +385 -0
  50. package/dist/lib/runtime-notifier.js +3 -7
  51. package/dist/lib/runtime.js +12 -2
  52. package/dist/lib/state-readers.d.ts +21 -0
  53. package/dist/lib/state-readers.js +74 -0
  54. package/dist/lib/tools.js +198 -39
  55. package/dist/lib/validate-recipe.d.ts +6 -0
  56. package/dist/lib/validate-recipe.js +104 -0
  57. package/dist/recipes/actor-worker.json +35 -0
  58. package/dist/recipes/coordinator-locker.json +45 -0
  59. package/dist/recipes/lens-swarm.json +66 -0
  60. package/dist/recipes/locker.json +45 -0
  61. package/dist/recipes/music-player.json +38 -0
  62. package/dist/recipes/pipeline-architect-coordinator.json +95 -0
  63. package/dist/recipes/pipeline-artifact-bundle.json +100 -0
  64. package/dist/recipes/pipeline-artifact-report.json +58 -0
  65. package/dist/recipes/pipeline-artifact-write.json +72 -0
  66. package/dist/recipes/pipeline-async-run-ops.json +70 -0
  67. package/dist/recipes/pipeline-checkpoint-continuation.json +67 -0
  68. package/dist/recipes/pipeline-development-tasking.json +81 -0
  69. package/dist/recipes/pipeline-docs-maintenance.json +80 -0
  70. package/dist/recipes/pipeline-media-library.json +59 -0
  71. package/dist/recipes/pipeline-quorum-review.json +79 -0
  72. package/dist/recipes/pipeline-release-readiness.json +110 -0
  73. package/dist/recipes/pipeline-release-summary.json +88 -0
  74. package/dist/recipes/pipeline-repo-health.json +89 -0
  75. package/dist/recipes/pipeline-research-synthesis.json +94 -0
  76. package/dist/recipes/pipeline-review-readiness.json +54 -0
  77. package/dist/recipes/pipeline-room-swarm.json +50 -0
  78. package/dist/recipes/subagent-artifact.json +32 -0
  79. package/dist/recipes/subagent-checkpoint.json +33 -0
  80. package/dist/recipes/subagent-conflict-report.json +32 -0
  81. package/dist/recipes/subagent-contradiction-map.json +33 -0
  82. package/dist/recipes/subagent-critic.json +35 -0
  83. package/dist/recipes/subagent-evidence-map.json +33 -0
  84. package/dist/recipes/subagent-followup.json +33 -0
  85. package/dist/recipes/subagent-judge.json +33 -0
  86. package/dist/recipes/subagent-merge.json +33 -0
  87. package/dist/recipes/subagent-message.json +34 -0
  88. package/dist/recipes/subagent-normalize.json +31 -0
  89. package/dist/recipes/subagent-plan.json +33 -0
  90. package/dist/recipes/subagent-prompt.json +28 -0
  91. package/dist/recipes/subagent-quorum.json +43 -0
  92. package/dist/recipes/subagent-review-coordinator.json +114 -0
  93. package/dist/recipes/subagent-review.json +37 -0
  94. package/dist/recipes/subagent-task-card.json +35 -0
  95. package/dist/recipes/subagent-tools.json +27 -0
  96. package/dist/recipes/subagent-verify.json +34 -0
  97. package/dist/recipes/subagents-prompts.json +51 -0
  98. package/dist/recipes/utility-actor-message.json +23 -0
  99. package/dist/recipes/utility-artifact-manifest.json +16 -0
  100. package/dist/recipes/utility-artifact-write.json +16 -0
  101. package/dist/recipes/utility-changelog-head.json +11 -0
  102. package/dist/recipes/utility-changelog-section.json +13 -0
  103. package/dist/recipes/utility-coordinator-lock-snapshot.json +13 -0
  104. package/dist/recipes/utility-git-log.json +11 -0
  105. package/dist/recipes/utility-git-status.json +9 -0
  106. package/dist/recipes/utility-jsonl-tail.json +10 -0
  107. package/dist/recipes/utility-markdown-index.json +14 -0
  108. package/dist/recipes/utility-package-summary.json +11 -0
  109. package/dist/recipes/utility-playlist-build.json +17 -0
  110. package/dist/recipes/utility-playlist-scan.json +11 -0
  111. package/dist/recipes/utility-run-ops-snapshot.json +17 -0
  112. package/dist/recipes/utility-run-state-files.json +13 -0
  113. package/dist/recipes/utility-run-summary.json +11 -0
  114. package/dist/recipes/utility-skill-summary.json +13 -0
  115. package/dist/recipes/utility-validate-recipe.json +13 -0
  116. package/dist/recipes/utility-validation-wrapper.json +13 -0
  117. package/dist/scripts/actor-worker.mjs +31 -0
  118. package/dist/scripts/async-runner.mjs +31 -0
  119. package/dist/scripts/build-dist.mjs +25 -0
  120. package/dist/scripts/conformance.mjs +33 -0
  121. package/dist/scripts/coordinator.mjs +31 -0
  122. package/dist/scripts/locker.mjs +33 -0
  123. package/dist/scripts/music-player.mjs +964 -0
  124. package/dist/scripts/recipe-utils.mjs +31 -0
  125. package/dist/scripts/validate-recipe.mjs +34 -0
  126. package/dist/skills/actors/SKILL.md +375 -0
  127. package/dist/skills/swarm/SKILL.md +467 -0
  128. package/dist/skills/swarm/references/development-swarm.md +596 -0
  129. package/docs/actor-messages.md +2 -2
  130. package/docs/async-runs.md +13 -1
  131. package/docs/template-recipes.md +2 -2
  132. package/docs/tool-registry.md +0 -1
  133. package/fixtures/protocol/actor-message-branch.json +13 -0
  134. package/fixtures/protocol/artifact-manifest.json +9 -0
  135. package/fixtures/protocol/mailbox-contract.json +15 -0
  136. package/fixtures/protocol/recipe-summary.json +16 -0
  137. package/fixtures/protocol/room-message.json +11 -0
  138. package/fixtures/protocol/room-roster.json +11 -0
  139. package/fixtures/protocol/run-inbox-message.json +9 -0
  140. package/fixtures/protocol/run-outbox-event.json +9 -0
  141. package/fixtures/protocol/run-state.json +10 -0
  142. package/index.ts +21 -0
  143. package/lib/actor-inspector-tui.ts +138 -59
  144. package/lib/actor-rooms.ts +241 -60
  145. package/lib/actor-worker.ts +118 -0
  146. package/lib/async-runner.ts +173 -0
  147. package/lib/async-runs.ts +302 -53
  148. package/lib/build-dist.ts +30 -0
  149. package/lib/command-templates.ts +5 -5
  150. package/lib/conformance.ts +46 -0
  151. package/lib/coordinator.ts +649 -0
  152. package/lib/limits.ts +12 -0
  153. package/lib/locker.ts +340 -0
  154. package/lib/mailbox-loop.ts +148 -0
  155. package/lib/observability.ts +34 -23
  156. package/lib/output.ts +4 -6
  157. package/lib/prompts.ts +1 -1
  158. package/lib/recipe-discovery.ts +1 -0
  159. package/lib/recipe-references.ts +57 -6
  160. package/lib/recipe-usage.ts +31 -4
  161. package/lib/recipe-utils.ts +486 -0
  162. package/lib/runtime-notifier.ts +4 -6
  163. package/lib/runtime.ts +31 -7
  164. package/lib/state-readers.ts +93 -0
  165. package/lib/tools.ts +297 -58
  166. package/lib/validate-recipe.ts +110 -0
  167. package/package.json +11 -2
  168. package/recipes/actor-worker.json +35 -0
  169. package/recipes/pipeline-quorum-review.json +12 -7
  170. package/scripts/actor-worker.mjs +31 -0
  171. package/scripts/async-runner.mjs +11 -195
  172. package/scripts/build-dist.mjs +25 -0
  173. package/scripts/conformance.mjs +33 -0
  174. package/scripts/coordinator.mjs +19 -616
  175. package/scripts/locker.mjs +23 -322
  176. package/scripts/music-player.mjs +21 -2
  177. package/scripts/recipe-utils.mjs +20 -467
  178. package/scripts/validate-recipe.mjs +23 -113
  179. package/skills/actors/SKILL.md +7 -4
  180. package/skills/swarm/SKILL.md +3 -1
@@ -0,0 +1,54 @@
1
+ {
2
+ "async": true,
3
+ "imports": {
4
+ "coordinator": "subagent-review-coordinator.json"
5
+ },
6
+ "args": [
7
+ "scope:string",
8
+ "lenses:array",
9
+ "release_gate:string",
10
+ "reviewer_model:string",
11
+ "verifier_model:string",
12
+ "merger_model:string",
13
+ "judge_model:string",
14
+ "tools:string"
15
+ ],
16
+ "defaults": {
17
+ "lenses": [
18
+ "correctness",
19
+ "tests",
20
+ "release",
21
+ "operator UX"
22
+ ],
23
+ "release_gate": "The scope is safe to ship or hand to the next release step.",
24
+ "tools": ""
25
+ },
26
+ "mailbox": {
27
+ "accepts": [
28
+ "control.stop",
29
+ "control.cancel",
30
+ "control.kill"
31
+ ],
32
+ "emits": [
33
+ "review.completed",
34
+ "pipeline.completed",
35
+ "command.done",
36
+ "run.done",
37
+ "run.failed"
38
+ ]
39
+ },
40
+ "template": {
41
+ "name": "coordinator",
42
+ "values": {
43
+ "scope": "{scope}",
44
+ "lenses": "{lenses}",
45
+ "claim": "{release_gate}",
46
+ "reviewer_model": "{reviewer_model}",
47
+ "verifier_model": "{verifier_model}",
48
+ "merger_model": "{merger_model}",
49
+ "judge_model": "{judge_model}",
50
+ "tools": "{tools}",
51
+ "output_format": "Markdown sections: Ship Verdict, Blocking Findings, Nonblocking Risks, Evidence, Required Follow-up."
52
+ }
53
+ }
54
+ }
@@ -0,0 +1,50 @@
1
+ {
2
+ "async": true,
3
+ "args": [
4
+ "mode:enum(consensus,pipeline,fanout,pool)",
5
+ "mission:string",
6
+ "model:string",
7
+ "thinking:string",
8
+ "roles:string",
9
+ "roles_path:path",
10
+ "rounds:int",
11
+ "delay:int",
12
+ "locker:bool",
13
+ "locker_lease_ms:int",
14
+ "artifact_path:path",
15
+ "repo:path"
16
+ ],
17
+ "defaults": {
18
+ "mode": "consensus",
19
+ "thinking": "off",
20
+ "roles": "",
21
+ "roles_path": "",
22
+ "rounds": "4",
23
+ "delay": "10",
24
+ "locker": "false",
25
+ "locker_lease_ms": "600000",
26
+ "artifact_path": "{state_dir}/room-swarm-artifact.md",
27
+ "repo": "~/.pi/agent/extensions/pi-actors"
28
+ },
29
+ "artifacts": {
30
+ "artifact": "{artifact_path}",
31
+ "locker_journal": "{state_dir}/locker/journal.jsonl",
32
+ "locker_locks": "{state_dir}/locker/locks.json",
33
+ "locker_queue": "{state_dir}/locker/queue.json"
34
+ },
35
+ "mailbox": {
36
+ "accepts": [
37
+ "control.stop",
38
+ "control.cancel",
39
+ "control.kill"
40
+ ],
41
+ "emits": [
42
+ "chat.message",
43
+ "actor.join",
44
+ "actor.leave",
45
+ "run.done",
46
+ "run.failed"
47
+ ]
48
+ },
49
+ "template": "{repo}/scripts/coordinator.mjs --run-id={run_id} --mode={mode} --mission={mission} --model={model} --thinking={thinking} --roles={roles} --roles-path={roles_path} --rounds={rounds} --delay={delay} --locker={locker} --locker-lease-ms={locker_lease_ms} --artifact-path={artifact_path}"
50
+ }
@@ -0,0 +1,32 @@
1
+ {
2
+ "async": true,
3
+ "args": [
4
+ "input:string",
5
+ "artifact_path:path",
6
+ "artifact_format:string",
7
+ "write_policy:string",
8
+ "validation_policy:string",
9
+ "model:string",
10
+ "thinking:string",
11
+ "tools:string"
12
+ ],
13
+ "defaults": {
14
+ "artifact_format": "Markdown with stable headings and preserved evidence.",
15
+ "write_policy": "Prepare content for the artifact path and state whether the caller should write, append, or review before writing.",
16
+ "validation_policy": "List checks the caller should run before accepting the artifact; distinguish required checks from optional review.",
17
+ "thinking": "off",
18
+ "tools": ""
19
+ },
20
+ "mailbox": {
21
+ "accepts": [
22
+ "control.stop",
23
+ "control.cancel",
24
+ "control.kill"
25
+ ],
26
+ "emits": [
27
+ "artifact.prepared",
28
+ "artifact.blocked"
29
+ ]
30
+ },
31
+ "template": "pi -p --model {model} --thinking {thinking} {tools?--tools:--no-tools} {tools} Prepare a durable artifact. Target path: {artifact_path}. Format: {artifact_format}. Write policy: {write_policy}. Validation policy: {validation_policy}. Input: {input}"
32
+ }
@@ -0,0 +1,33 @@
1
+ {
2
+ "async": true,
3
+ "args": [
4
+ "state:string",
5
+ "question:string",
6
+ "options:string",
7
+ "resume_policy:string",
8
+ "output_format:string",
9
+ "model:string",
10
+ "thinking:string",
11
+ "tools:string"
12
+ ],
13
+ "defaults": {
14
+ "options": "List options considered, recommendation, and risk if the coordinator does not answer.",
15
+ "resume_policy": "Do not claim same-context resume unless the adapter provides a resumable session id; otherwise emit degraded artifact state.",
16
+ "output_format": "Markdown sections: Preserved State, Question, Options, Recommendation, Risk If Guessed, Resume Mode.",
17
+ "thinking": "off",
18
+ "tools": ""
19
+ },
20
+ "mailbox": {
21
+ "accepts": [
22
+ "control.continue",
23
+ "control.revise",
24
+ "control.stop",
25
+ "control.cancel",
26
+ "control.kill"
27
+ ],
28
+ "emits": [
29
+ "checkpoint.needs_input"
30
+ ]
31
+ },
32
+ "template": "pi -p --model {model} --thinking {thinking} {tools?--tools:--no-tools} {tools} Create a bounded coordinator checkpoint. State to preserve: {state}. Question: {question}. Options/risk format: {options}. Resume policy: {resume_policy}. Output format: {output_format}"
33
+ }
@@ -0,0 +1,32 @@
1
+ {
2
+ "async": true,
3
+ "args": [
4
+ "change:string",
5
+ "conflict:string",
6
+ "preserve_policy:string",
7
+ "output_format:string",
8
+ "model:string",
9
+ "thinking:string",
10
+ "tools:string"
11
+ ],
12
+ "defaults": {
13
+ "preserve_policy": "Describe what must be preserved, what can be discarded, and suggested resolver action.",
14
+ "output_format": "Markdown sections: Conflict, My Changes, Other Changes, Preserve, Discard, Suggested Resolution, Risks.",
15
+ "thinking": "off",
16
+ "tools": ""
17
+ },
18
+ "mailbox": {
19
+ "accepts": [
20
+ "control.stop",
21
+ "control.cancel",
22
+ "control.kill"
23
+ ],
24
+ "emits": [
25
+ "conflict_report.completed",
26
+ "command.done",
27
+ "run.done",
28
+ "run.failed"
29
+ ]
30
+ },
31
+ "template": "pi -p --model {model} --thinking {thinking} {tools?--tools:--no-tools} {tools} Write a bounded conflict report. My change: {change}. Conflict: {conflict}. Preserve policy: {preserve_policy}. Output format: {output_format}"
32
+ }
@@ -0,0 +1,33 @@
1
+ {
2
+ "async": true,
3
+ "args": [
4
+ "inputs:string",
5
+ "focus:string",
6
+ "resolution_policy:string",
7
+ "output_format:string",
8
+ "model:string",
9
+ "thinking:string",
10
+ "tools:string"
11
+ ],
12
+ "defaults": {
13
+ "focus": "Find contradictions, unresolved assumptions, incompatible recommendations, and evidence gaps.",
14
+ "resolution_policy": "Do not force consensus; preserve unresolved conflicts and name what evidence would resolve them.",
15
+ "output_format": "Markdown sections: Contradictions, Affected Claims, Resolution Evidence, Unresolved Risks.",
16
+ "thinking": "medium",
17
+ "tools": ""
18
+ },
19
+ "mailbox": {
20
+ "accepts": [
21
+ "control.stop",
22
+ "control.cancel",
23
+ "control.kill"
24
+ ],
25
+ "emits": [
26
+ "contradiction.completed",
27
+ "command.done",
28
+ "run.done",
29
+ "run.failed"
30
+ ]
31
+ },
32
+ "template": "pi -p --model {model} --thinking {thinking} {tools?--tools:--no-tools} {tools} Map contradictions in these inputs: {inputs}. Focus: {focus}. Resolution policy: {resolution_policy}. Output format: {output_format}"
33
+ }
@@ -0,0 +1,35 @@
1
+ {
2
+ "async": true,
3
+ "args": [
4
+ "target:string",
5
+ "lens:string",
6
+ "constraints:string",
7
+ "risk_policy:string",
8
+ "output_format:string",
9
+ "model:string",
10
+ "thinking:string",
11
+ "tools:string"
12
+ ],
13
+ "defaults": {
14
+ "lens": "assumption and failure-mode critic",
15
+ "constraints": "Stay bounded to the target; do not redesign unrelated systems.",
16
+ "risk_policy": "Prefer falsifiable objections and separate blockers from caveats.",
17
+ "output_format": "Markdown sections: Assumptions, Failure Modes, Counterarguments, Tests, Recommendation.",
18
+ "thinking": "medium",
19
+ "tools": ""
20
+ },
21
+ "mailbox": {
22
+ "accepts": [
23
+ "control.stop",
24
+ "control.cancel",
25
+ "control.kill"
26
+ ],
27
+ "emits": [
28
+ "critique.completed",
29
+ "command.done",
30
+ "run.done",
31
+ "run.failed"
32
+ ]
33
+ },
34
+ "template": "pi -p --model {model} --thinking {thinking} {tools?--tools:--no-tools} {tools} Critique this target through lens {lens}: {target}. Constraints: {constraints}. Risk policy: {risk_policy}. Output format: {output_format}"
35
+ }
@@ -0,0 +1,33 @@
1
+ {
2
+ "async": true,
3
+ "args": [
4
+ "question:string",
5
+ "sources:string",
6
+ "source_policy:string",
7
+ "output_format:string",
8
+ "model:string",
9
+ "thinking:string",
10
+ "tools:string"
11
+ ],
12
+ "defaults": {
13
+ "sources": "Use only provided source notes, inspected artifacts, or explicit uncertainty.",
14
+ "source_policy": "Separate direct evidence, weak evidence, contradictions, and missing evidence.",
15
+ "output_format": "Markdown sections: Question, Evidence Map, Contradictions, Missing Evidence, Confidence.",
16
+ "thinking": "medium",
17
+ "tools": ""
18
+ },
19
+ "mailbox": {
20
+ "accepts": [
21
+ "control.stop",
22
+ "control.cancel",
23
+ "control.kill"
24
+ ],
25
+ "emits": [
26
+ "evidence.completed",
27
+ "command.done",
28
+ "run.done",
29
+ "run.failed"
30
+ ]
31
+ },
32
+ "template": "pi -p --model {model} --thinking {thinking} {tools?--tools:--no-tools} {tools} Build an evidence map for question: {question}. Sources: {sources}. Source policy: {source_policy}. Output format: {output_format}"
33
+ }
@@ -0,0 +1,33 @@
1
+ {
2
+ "async": true,
3
+ "args": [
4
+ "checkpoint:string",
5
+ "reply:string",
6
+ "mode:enum(same-context,degraded-new-branch)",
7
+ "continuity_policy:string",
8
+ "output_format:string",
9
+ "model:string",
10
+ "thinking:string",
11
+ "tools:string"
12
+ ],
13
+ "defaults": {
14
+ "mode": "degraded-new-branch",
15
+ "continuity_policy": "If mode is degraded-new-branch, explicitly state what context continuity was lost and what was reconstructed from the checkpoint.",
16
+ "output_format": "Markdown sections: Continuation Mode, Applied Reply, Lost Context, Continued Work, Next Actions.",
17
+ "thinking": "off",
18
+ "tools": ""
19
+ },
20
+ "mailbox": {
21
+ "accepts": [
22
+ "control.reply",
23
+ "control.revise",
24
+ "control.stop",
25
+ "control.cancel",
26
+ "control.kill"
27
+ ],
28
+ "emits": [
29
+ "checkpoint.continued"
30
+ ]
31
+ },
32
+ "template": "pi -p --model {model} --thinking {thinking} {tools?--tools:--no-tools} {tools} Continue from checkpoint using mode {mode}. Checkpoint: {checkpoint}. Coordinator reply: {reply}. Continuity policy: {continuity_policy}. Output format: {output_format}"
33
+ }
@@ -0,0 +1,33 @@
1
+ {
2
+ "async": true,
3
+ "args": [
4
+ "report:string",
5
+ "rubric:string",
6
+ "evidence:string",
7
+ "output_format:string",
8
+ "model:string",
9
+ "thinking:string",
10
+ "tools:string"
11
+ ],
12
+ "defaults": {
13
+ "rubric": "Judge evidence preservation, severity calibration, consensus purity, internal consistency, and merge bias.",
14
+ "evidence": "Use the provided raw outputs or artifact paths; mark any missing evidence.",
15
+ "output_format": "Markdown sections: Verdict, Issues, Evidence Preservation, Bias Risks, Required Fixes.",
16
+ "thinking": "medium",
17
+ "tools": ""
18
+ },
19
+ "mailbox": {
20
+ "accepts": [
21
+ "control.stop",
22
+ "control.cancel",
23
+ "control.kill"
24
+ ],
25
+ "emits": [
26
+ "judge.completed",
27
+ "command.done",
28
+ "run.done",
29
+ "run.failed"
30
+ ]
31
+ },
32
+ "template": "pi -p --model {model} --thinking {thinking} {tools?--tools:--no-tools} {tools} Judge this report: {report}. Rubric: {rubric}. Evidence: {evidence}. Output format: {output_format}"
33
+ }
@@ -0,0 +1,33 @@
1
+ {
2
+ "async": true,
3
+ "args": [
4
+ "inputs:string",
5
+ "mode:enum(consensus-first,risk-first)",
6
+ "risk_policy:string",
7
+ "output_format:string",
8
+ "model:string",
9
+ "thinking:string",
10
+ "tools:string"
11
+ ],
12
+ "defaults": {
13
+ "mode": "consensus-first",
14
+ "risk_policy": "Preserve minority severe findings and mark merger-added claims explicitly.",
15
+ "output_format": "Markdown sections: Summary, Consensus, Minority Findings, Contradictions, Next Actions.",
16
+ "thinking": "medium",
17
+ "tools": ""
18
+ },
19
+ "mailbox": {
20
+ "accepts": [
21
+ "control.stop",
22
+ "control.cancel",
23
+ "control.kill"
24
+ ],
25
+ "emits": [
26
+ "merge.completed",
27
+ "command.done",
28
+ "run.done",
29
+ "run.failed"
30
+ ]
31
+ },
32
+ "template": "pi -p --model {model} --thinking {thinking} {tools?--tools:--no-tools} {tools} Merge these subagent outputs using mode {mode}: {inputs}. Risk policy: {risk_policy}. Output format: {output_format}"
33
+ }
@@ -0,0 +1,34 @@
1
+ {
2
+ "async": true,
3
+ "args": [
4
+ "type:string",
5
+ "payload:string",
6
+ "to:string",
7
+ "from:string",
8
+ "message_policy:string",
9
+ "output_format:string",
10
+ "model:string",
11
+ "thinking:string",
12
+ "tools:string"
13
+ ],
14
+ "defaults": {
15
+ "type": "component.update",
16
+ "to": "coordinator",
17
+ "from": "run:{run_id}",
18
+ "message_policy": "Emit an actor-message envelope-shaped JSON object for the coordinator; do not call transport tools directly.",
19
+ "output_format": "JSON object with to, from, type, summary, body, metadata, confidence, and next_action.",
20
+ "thinking": "off",
21
+ "tools": ""
22
+ },
23
+ "mailbox": {
24
+ "accepts": [
25
+ "control.stop",
26
+ "control.cancel",
27
+ "control.kill"
28
+ ],
29
+ "emits": [
30
+ "component.*"
31
+ ]
32
+ },
33
+ "template": "pi -p --model {model} --thinking {thinking} {tools?--tools:--no-tools} {tools} Create an actor-message envelope-shaped record. To: {to}. From: {from}. Type: {type}. Message policy: {message_policy}. Payload/body: {payload}. Output format: {output_format}"
34
+ }
@@ -0,0 +1,31 @@
1
+ {
2
+ "async": true,
3
+ "args": [
4
+ "input:string",
5
+ "format:string",
6
+ "preservation_policy:string",
7
+ "model:string",
8
+ "thinking:string",
9
+ "tools:string"
10
+ ],
11
+ "defaults": {
12
+ "format": "Markdown sections: Summary, Findings, Evidence, Risks, Next Actions.",
13
+ "preservation_policy": "Do not change meaning, severity, evidence, or uncertainty while normalizing.",
14
+ "thinking": "off",
15
+ "tools": ""
16
+ },
17
+ "mailbox": {
18
+ "accepts": [
19
+ "control.stop",
20
+ "control.cancel",
21
+ "control.kill"
22
+ ],
23
+ "emits": [
24
+ "normalize.completed",
25
+ "command.done",
26
+ "run.done",
27
+ "run.failed"
28
+ ]
29
+ },
30
+ "template": "pi -p --model {model} --thinking {thinking} {tools?--tools:--no-tools} {tools} Normalize this subagent output. Target format: {format}. Preservation policy: {preservation_policy}. Input: {input}"
31
+ }
@@ -0,0 +1,33 @@
1
+ {
2
+ "async": true,
3
+ "args": [
4
+ "goal:string",
5
+ "constraints:string",
6
+ "scope:string",
7
+ "output_format:string",
8
+ "model:string",
9
+ "thinking:string",
10
+ "tools:string"
11
+ ],
12
+ "defaults": {
13
+ "constraints": "Prefer small reversible slices, explicit validation gates, and no broad speculative rewrites.",
14
+ "scope": "Use the provided problem statement and any named artifact paths.",
15
+ "output_format": "Markdown sections: Goal, Constraints, Plan Slices, Risks, Validation Gates, Stop Conditions.",
16
+ "thinking": "medium",
17
+ "tools": ""
18
+ },
19
+ "mailbox": {
20
+ "accepts": [
21
+ "control.stop",
22
+ "control.cancel",
23
+ "control.kill"
24
+ ],
25
+ "emits": [
26
+ "plan.completed",
27
+ "command.done",
28
+ "run.done",
29
+ "run.failed"
30
+ ]
31
+ },
32
+ "template": "pi -p --model {model} --thinking {thinking} {tools?--tools:--no-tools} {tools} Plan how to reach this goal: {goal}. Scope: {scope}. Constraints: {constraints}. Output format: {output_format}"
33
+ }
@@ -0,0 +1,28 @@
1
+ {
2
+ "async": true,
3
+ "args": [
4
+ "prompt:string",
5
+ "model:string",
6
+ "thinking:string",
7
+ "tools:string",
8
+ "output_format:string"
9
+ ],
10
+ "defaults": {
11
+ "thinking": "off",
12
+ "tools": "",
13
+ "output_format": "Concise Markdown with assumptions and next actions."
14
+ },
15
+ "mailbox": {
16
+ "accepts": [
17
+ "control.stop",
18
+ "control.cancel",
19
+ "control.kill"
20
+ ],
21
+ "emits": [
22
+ "command.done",
23
+ "run.done",
24
+ "run.failed"
25
+ ]
26
+ },
27
+ "template": "pi -p --model {model} --thinking {thinking} {tools?--tools:--no-tools} {tools} {prompt}. Output format: {output_format}"
28
+ }
@@ -0,0 +1,43 @@
1
+ {
2
+ "async": true,
3
+ "imports": {
4
+ "subagent": "subagent-prompt.json"
5
+ },
6
+ "args": [
7
+ "prompt:string",
8
+ "models:array",
9
+ "thinking:string",
10
+ "tools:string",
11
+ "output_format:string"
12
+ ],
13
+ "defaults": {
14
+ "thinking": "off",
15
+ "tools": "",
16
+ "output_format": "Vote-style Markdown: Verdict, Rationale, Evidence, Confidence."
17
+ },
18
+ "mailbox": {
19
+ "accepts": [
20
+ "control.stop",
21
+ "control.cancel",
22
+ "control.kill"
23
+ ],
24
+ "emits": [
25
+ "command.done",
26
+ "run.done",
27
+ "run.failed"
28
+ ]
29
+ },
30
+ "repeat": "{models.length}",
31
+ "parallel": true,
32
+ "failure": "branch",
33
+ "template": {
34
+ "name": "subagent",
35
+ "values": {
36
+ "prompt": "{prompt}",
37
+ "model": "{models[index]}",
38
+ "thinking": "{thinking}",
39
+ "tools": "{tools}",
40
+ "output_format": "{output_format}"
41
+ }
42
+ }
43
+ }