@llblab/pi-kit 0.1.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 (523) hide show
  1. package/AGENTS.md +35 -0
  2. package/BACKLOG.md +3 -0
  3. package/CHANGELOG.md +9 -0
  4. package/LICENSE +21 -0
  5. package/README.md +43 -0
  6. package/node_modules/@llblab/pi-actors/AGENTS.md +150 -0
  7. package/node_modules/@llblab/pi-actors/BACKLOG.md +6 -0
  8. package/node_modules/@llblab/pi-actors/CHANGELOG.md +865 -0
  9. package/node_modules/@llblab/pi-actors/README.md +231 -0
  10. package/node_modules/@llblab/pi-actors/banner.jpg +0 -0
  11. package/node_modules/@llblab/pi-actors/dist/fixtures/protocol/artifact-manifest.json +9 -0
  12. package/node_modules/@llblab/pi-actors/dist/fixtures/protocol/control-endpoint.json +6 -0
  13. package/node_modules/@llblab/pi-actors/dist/fixtures/protocol/control-record.json +9 -0
  14. package/node_modules/@llblab/pi-actors/dist/fixtures/protocol/recipe-summary.json +8 -0
  15. package/node_modules/@llblab/pi-actors/dist/fixtures/protocol/run-state.json +10 -0
  16. package/node_modules/@llblab/pi-actors/dist/fixtures/protocol/trace-event.json +9 -0
  17. package/node_modules/@llblab/pi-actors/dist/index.d.ts +7 -0
  18. package/node_modules/@llblab/pi-actors/dist/index.js +17 -0
  19. package/node_modules/@llblab/pi-actors/dist/lib/async-runs.d.ts +146 -0
  20. package/node_modules/@llblab/pi-actors/dist/lib/async-runs.js +800 -0
  21. package/node_modules/@llblab/pi-actors/dist/lib/automatic-review-runtime.d.ts +20 -0
  22. package/node_modules/@llblab/pi-actors/dist/lib/automatic-review-runtime.js +103 -0
  23. package/node_modules/@llblab/pi-actors/dist/lib/command-templates.d.ts +85 -0
  24. package/node_modules/@llblab/pi-actors/dist/lib/command-templates.js +804 -0
  25. package/node_modules/@llblab/pi-actors/dist/lib/config.d.ts +34 -0
  26. package/node_modules/@llblab/pi-actors/dist/lib/config.js +216 -0
  27. package/node_modules/@llblab/pi-actors/dist/lib/control-projection.d.ts +20 -0
  28. package/node_modules/@llblab/pi-actors/dist/lib/control-projection.js +66 -0
  29. package/node_modules/@llblab/pi-actors/dist/lib/control.d.ts +15 -0
  30. package/node_modules/@llblab/pi-actors/dist/lib/control.js +97 -0
  31. package/node_modules/@llblab/pi-actors/dist/lib/draft-consolidation-transaction.d.ts +65 -0
  32. package/node_modules/@llblab/pi-actors/dist/lib/draft-consolidation-transaction.js +610 -0
  33. package/node_modules/@llblab/pi-actors/dist/lib/draft-consolidation.d.ts +35 -0
  34. package/node_modules/@llblab/pi-actors/dist/lib/draft-consolidation.js +126 -0
  35. package/node_modules/@llblab/pi-actors/dist/lib/draft-review.d.ts +56 -0
  36. package/node_modules/@llblab/pi-actors/dist/lib/draft-review.js +254 -0
  37. package/node_modules/@llblab/pi-actors/dist/lib/draft-sleep.d.ts +65 -0
  38. package/node_modules/@llblab/pi-actors/dist/lib/draft-sleep.js +467 -0
  39. package/node_modules/@llblab/pi-actors/dist/lib/execution-output.d.ts +25 -0
  40. package/node_modules/@llblab/pi-actors/dist/lib/execution-output.js +88 -0
  41. package/node_modules/@llblab/pi-actors/dist/lib/execution-sessions.d.ts +17 -0
  42. package/node_modules/@llblab/pi-actors/dist/lib/execution-sessions.js +85 -0
  43. package/node_modules/@llblab/pi-actors/dist/lib/execution.d.ts +99 -0
  44. package/node_modules/@llblab/pi-actors/dist/lib/execution.js +725 -0
  45. package/node_modules/@llblab/pi-actors/dist/lib/extension-runtime.d.ts +21 -0
  46. package/node_modules/@llblab/pi-actors/dist/lib/extension-runtime.js +141 -0
  47. package/node_modules/@llblab/pi-actors/dist/lib/file-state.d.ts +18 -0
  48. package/node_modules/@llblab/pi-actors/dist/lib/file-state.js +310 -0
  49. package/node_modules/@llblab/pi-actors/dist/lib/identity.d.ts +9 -0
  50. package/node_modules/@llblab/pi-actors/dist/lib/identity.js +27 -0
  51. package/node_modules/@llblab/pi-actors/dist/lib/inspector-actions.d.ts +16 -0
  52. package/node_modules/@llblab/pi-actors/dist/lib/inspector-actions.js +57 -0
  53. package/node_modules/@llblab/pi-actors/dist/lib/inspector-command.d.ts +7 -0
  54. package/node_modules/@llblab/pi-actors/dist/lib/inspector-command.js +37 -0
  55. package/node_modules/@llblab/pi-actors/dist/lib/inspector-overlay.d.ts +100 -0
  56. package/node_modules/@llblab/pi-actors/dist/lib/inspector-overlay.js +824 -0
  57. package/node_modules/@llblab/pi-actors/dist/lib/inspector.d.ts +20 -0
  58. package/node_modules/@llblab/pi-actors/dist/lib/inspector.js +136 -0
  59. package/node_modules/@llblab/pi-actors/dist/lib/limits.d.ts +28 -0
  60. package/node_modules/@llblab/pi-actors/dist/lib/limits.js +28 -0
  61. package/node_modules/@llblab/pi-actors/dist/lib/model-context.d.ts +56 -0
  62. package/node_modules/@llblab/pi-actors/dist/lib/model-context.js +220 -0
  63. package/node_modules/@llblab/pi-actors/dist/lib/observability.d.ts +186 -0
  64. package/node_modules/@llblab/pi-actors/dist/lib/observability.js +951 -0
  65. package/node_modules/@llblab/pi-actors/dist/lib/paths.d.ts +27 -0
  66. package/node_modules/@llblab/pi-actors/dist/lib/paths.js +72 -0
  67. package/node_modules/@llblab/pi-actors/dist/lib/pi.d.ts +19 -0
  68. package/node_modules/@llblab/pi-actors/dist/lib/pi.js +21 -0
  69. package/node_modules/@llblab/pi-actors/dist/lib/preflight-diagnostics.d.ts +27 -0
  70. package/node_modules/@llblab/pi-actors/dist/lib/preflight-diagnostics.js +86 -0
  71. package/node_modules/@llblab/pi-actors/dist/lib/prompts.d.ts +24 -0
  72. package/node_modules/@llblab/pi-actors/dist/lib/prompts.js +49 -0
  73. package/node_modules/@llblab/pi-actors/dist/lib/recipe-control.d.ts +7 -0
  74. package/node_modules/@llblab/pi-actors/dist/lib/recipe-control.js +43 -0
  75. package/node_modules/@llblab/pi-actors/dist/lib/recipes-context.d.ts +36 -0
  76. package/node_modules/@llblab/pi-actors/dist/lib/recipes-context.js +197 -0
  77. package/node_modules/@llblab/pi-actors/dist/lib/recipes-discovery.d.ts +77 -0
  78. package/node_modules/@llblab/pi-actors/dist/lib/recipes-discovery.js +783 -0
  79. package/node_modules/@llblab/pi-actors/dist/lib/recipes-references.d.ts +113 -0
  80. package/node_modules/@llblab/pi-actors/dist/lib/recipes-references.js +1108 -0
  81. package/node_modules/@llblab/pi-actors/dist/lib/recipes-usage.d.ts +21 -0
  82. package/node_modules/@llblab/pi-actors/dist/lib/recipes-usage.js +494 -0
  83. package/node_modules/@llblab/pi-actors/dist/lib/registry.d.ts +67 -0
  84. package/node_modules/@llblab/pi-actors/dist/lib/registry.js +504 -0
  85. package/node_modules/@llblab/pi-actors/dist/lib/review-control.d.ts +14 -0
  86. package/node_modules/@llblab/pi-actors/dist/lib/review-control.js +110 -0
  87. package/node_modules/@llblab/pi-actors/dist/lib/review-diagnostics.d.ts +11 -0
  88. package/node_modules/@llblab/pi-actors/dist/lib/review-diagnostics.js +148 -0
  89. package/node_modules/@llblab/pi-actors/dist/lib/review-projection.d.ts +14 -0
  90. package/node_modules/@llblab/pi-actors/dist/lib/review-projection.js +166 -0
  91. package/node_modules/@llblab/pi-actors/dist/lib/run-evidence-policy.d.ts +95 -0
  92. package/node_modules/@llblab/pi-actors/dist/lib/run-evidence-policy.js +177 -0
  93. package/node_modules/@llblab/pi-actors/dist/lib/run-ui-runtime.d.ts +18 -0
  94. package/node_modules/@llblab/pi-actors/dist/lib/run-ui-runtime.js +125 -0
  95. package/node_modules/@llblab/pi-actors/dist/lib/runs-artifacts.d.ts +21 -0
  96. package/node_modules/@llblab/pi-actors/dist/lib/runs-artifacts.js +68 -0
  97. package/node_modules/@llblab/pi-actors/dist/lib/runs-control-delivery.d.ts +28 -0
  98. package/node_modules/@llblab/pi-actors/dist/lib/runs-control-delivery.js +150 -0
  99. package/node_modules/@llblab/pi-actors/dist/lib/runs-control.d.ts +21 -0
  100. package/node_modules/@llblab/pi-actors/dist/lib/runs-control.js +89 -0
  101. package/node_modules/@llblab/pi-actors/dist/lib/runs-controls.d.ts +39 -0
  102. package/node_modules/@llblab/pi-actors/dist/lib/runs-controls.js +283 -0
  103. package/node_modules/@llblab/pi-actors/dist/lib/runs-identity.d.ts +5 -0
  104. package/node_modules/@llblab/pi-actors/dist/lib/runs-identity.js +11 -0
  105. package/node_modules/@llblab/pi-actors/dist/lib/runs-index.d.ts +27 -0
  106. package/node_modules/@llblab/pi-actors/dist/lib/runs-index.js +142 -0
  107. package/node_modules/@llblab/pi-actors/dist/lib/runs-ownership.d.ts +7 -0
  108. package/node_modules/@llblab/pi-actors/dist/lib/runs-ownership.js +96 -0
  109. package/node_modules/@llblab/pi-actors/dist/lib/runs-parent-teardown.d.ts +51 -0
  110. package/node_modules/@llblab/pi-actors/dist/lib/runs-parent-teardown.js +172 -0
  111. package/node_modules/@llblab/pi-actors/dist/lib/runs-process.d.ts +22 -0
  112. package/node_modules/@llblab/pi-actors/dist/lib/runs-process.js +125 -0
  113. package/node_modules/@llblab/pi-actors/dist/lib/runs-retention.d.ts +18 -0
  114. package/node_modules/@llblab/pi-actors/dist/lib/runs-retention.js +108 -0
  115. package/node_modules/@llblab/pi-actors/dist/lib/runs-start.d.ts +12 -0
  116. package/node_modules/@llblab/pi-actors/dist/lib/runs-start.js +68 -0
  117. package/node_modules/@llblab/pi-actors/dist/lib/runs-status.d.ts +10 -0
  118. package/node_modules/@llblab/pi-actors/dist/lib/runs-status.js +68 -0
  119. package/node_modules/@llblab/pi-actors/dist/lib/runs-trace.d.ts +48 -0
  120. package/node_modules/@llblab/pi-actors/dist/lib/runs-trace.js +491 -0
  121. package/node_modules/@llblab/pi-actors/dist/lib/runtime-identity.d.ts +7 -0
  122. package/node_modules/@llblab/pi-actors/dist/lib/runtime-identity.js +35 -0
  123. package/node_modules/@llblab/pi-actors/dist/lib/runtime-triage.d.ts +29 -0
  124. package/node_modules/@llblab/pi-actors/dist/lib/runtime-triage.js +60 -0
  125. package/node_modules/@llblab/pi-actors/dist/lib/runtime.d.ts +69 -0
  126. package/node_modules/@llblab/pi-actors/dist/lib/runtime.js +339 -0
  127. package/node_modules/@llblab/pi-actors/dist/lib/schema.d.ts +60 -0
  128. package/node_modules/@llblab/pi-actors/dist/lib/schema.js +428 -0
  129. package/node_modules/@llblab/pi-actors/dist/lib/session-evidence.d.ts +45 -0
  130. package/node_modules/@llblab/pi-actors/dist/lib/session-evidence.js +204 -0
  131. package/node_modules/@llblab/pi-actors/dist/lib/state-readers.d.ts +21 -0
  132. package/node_modules/@llblab/pi-actors/dist/lib/state-readers.js +74 -0
  133. package/node_modules/@llblab/pi-actors/dist/lib/temp.d.ts +10 -0
  134. package/node_modules/@llblab/pi-actors/dist/lib/temp.js +90 -0
  135. package/node_modules/@llblab/pi-actors/dist/lib/tool-review-lineage-transaction.d.ts +27 -0
  136. package/node_modules/@llblab/pi-actors/dist/lib/tool-review-lineage-transaction.js +597 -0
  137. package/node_modules/@llblab/pi-actors/dist/lib/tool-review-lineage.d.ts +24 -0
  138. package/node_modules/@llblab/pi-actors/dist/lib/tool-review-lineage.js +98 -0
  139. package/node_modules/@llblab/pi-actors/dist/lib/tool-review-scheduler.d.ts +80 -0
  140. package/node_modules/@llblab/pi-actors/dist/lib/tool-review-scheduler.js +494 -0
  141. package/node_modules/@llblab/pi-actors/dist/lib/tool-review-transaction.d.ts +50 -0
  142. package/node_modules/@llblab/pi-actors/dist/lib/tool-review-transaction.js +362 -0
  143. package/node_modules/@llblab/pi-actors/dist/lib/tool-review.d.ts +56 -0
  144. package/node_modules/@llblab/pi-actors/dist/lib/tool-review.js +197 -0
  145. package/node_modules/@llblab/pi-actors/dist/lib/tools-access.d.ts +19 -0
  146. package/node_modules/@llblab/pi-actors/dist/lib/tools-access.js +44 -0
  147. package/node_modules/@llblab/pi-actors/dist/lib/tools-inspect.d.ts +15 -0
  148. package/node_modules/@llblab/pi-actors/dist/lib/tools-inspect.js +532 -0
  149. package/node_modules/@llblab/pi-actors/dist/lib/tools-local.d.ts +17 -0
  150. package/node_modules/@llblab/pi-actors/dist/lib/tools-local.js +191 -0
  151. package/node_modules/@llblab/pi-actors/dist/lib/tools-message.d.ts +9 -0
  152. package/node_modules/@llblab/pi-actors/dist/lib/tools-message.js +139 -0
  153. package/node_modules/@llblab/pi-actors/dist/lib/tools-register.d.ts +18 -0
  154. package/node_modules/@llblab/pi-actors/dist/lib/tools-register.js +41 -0
  155. package/node_modules/@llblab/pi-actors/dist/lib/tools-response.d.ts +20 -0
  156. package/node_modules/@llblab/pi-actors/dist/lib/tools-response.js +243 -0
  157. package/node_modules/@llblab/pi-actors/dist/lib/tools-spawn.d.ts +15 -0
  158. package/node_modules/@llblab/pi-actors/dist/lib/tools-spawn.js +133 -0
  159. package/node_modules/@llblab/pi-actors/dist/lib/tools.d.ts +28 -0
  160. package/node_modules/@llblab/pi-actors/dist/lib/tools.js +49 -0
  161. package/node_modules/@llblab/pi-actors/dist/lib/trace-projection.d.ts +22 -0
  162. package/node_modules/@llblab/pi-actors/dist/lib/trace-projection.js +231 -0
  163. package/node_modules/@llblab/pi-actors/dist/pi-actors/index.js +1 -0
  164. package/node_modules/@llblab/pi-actors/dist/scripts/async-runner.mjs +555 -0
  165. package/node_modules/@llblab/pi-actors/dist/scripts/build-dist.mjs +60 -0
  166. package/node_modules/@llblab/pi-actors/dist/scripts/conformance.mjs +63 -0
  167. package/node_modules/@llblab/pi-actors/dist/skills/actors/SKILL.md +126 -0
  168. package/node_modules/@llblab/pi-actors/dist/skills/actors/recipes/command-validate.json +13 -0
  169. package/node_modules/@llblab/pi-actors/dist/skills/actors/recipes/jsonl-tail.json +10 -0
  170. package/node_modules/@llblab/pi-actors/dist/skills/actors/recipes/recipe-validate.json +11 -0
  171. package/node_modules/@llblab/pi-actors/dist/skills/actors/recipes/resource-locker-snapshot.json +11 -0
  172. package/node_modules/@llblab/pi-actors/dist/skills/actors/recipes/resource-locker.json +25 -0
  173. package/node_modules/@llblab/pi-actors/dist/skills/actors/recipes/run-ops-snapshot.json +15 -0
  174. package/node_modules/@llblab/pi-actors/dist/skills/actors/recipes/run-state-files.json +13 -0
  175. package/node_modules/@llblab/pi-actors/dist/skills/actors/recipes/run-summary.json +9 -0
  176. package/node_modules/@llblab/pi-actors/dist/skills/actors/references/diagnostics.md +44 -0
  177. package/node_modules/@llblab/pi-actors/dist/skills/actors/references/persistent-tools.md +76 -0
  178. package/node_modules/@llblab/pi-actors/dist/skills/actors/references/recipes.md +51 -0
  179. package/node_modules/@llblab/pi-actors/dist/skills/actors/references/runs.md +41 -0
  180. package/node_modules/@llblab/pi-actors/dist/skills/actors/scripts/resource-locker.mjs +425 -0
  181. package/node_modules/@llblab/pi-actors/dist/skills/actors/scripts/run-utils.mjs +164 -0
  182. package/node_modules/@llblab/pi-actors/dist/skills/actors/scripts/validate-recipe.mjs +370 -0
  183. package/node_modules/@llblab/pi-actors/dist/skills/artifacts/SKILL.md +33 -0
  184. package/node_modules/@llblab/pi-actors/dist/skills/artifacts/recipes/bundle.json +77 -0
  185. package/node_modules/@llblab/pi-actors/dist/skills/artifacts/recipes/file-write.json +14 -0
  186. package/node_modules/@llblab/pi-actors/dist/skills/artifacts/recipes/manifest.json +14 -0
  187. package/node_modules/@llblab/pi-actors/dist/skills/artifacts/recipes/report.json +39 -0
  188. package/node_modules/@llblab/pi-actors/dist/skills/artifacts/recipes/write.json +53 -0
  189. package/node_modules/@llblab/pi-actors/dist/skills/artifacts/scripts/artifact-utils.mjs +63 -0
  190. package/node_modules/@llblab/pi-actors/dist/skills/music-player/SKILL.md +57 -0
  191. package/node_modules/@llblab/pi-actors/dist/skills/music-player/genapps/music-player.mjs +360 -0
  192. package/node_modules/@llblab/pi-actors/dist/skills/music-player/recipes/playback.json +29 -0
  193. package/node_modules/@llblab/pi-actors/dist/skills/music-player/scripts/playback-client.mjs +143 -0
  194. package/node_modules/@llblab/pi-actors/dist/skills/music-player/scripts/playback.mjs +1446 -0
  195. package/node_modules/@llblab/pi-actors/dist/skills/project-work/SKILL.md +37 -0
  196. package/node_modules/@llblab/pi-actors/dist/skills/project-work/recipes/changelog-head.json +11 -0
  197. package/node_modules/@llblab/pi-actors/dist/skills/project-work/recipes/changelog-section.json +11 -0
  198. package/node_modules/@llblab/pi-actors/dist/skills/project-work/recipes/docs-maintenance.json +66 -0
  199. package/node_modules/@llblab/pi-actors/dist/skills/project-work/recipes/git-log.json +11 -0
  200. package/node_modules/@llblab/pi-actors/dist/skills/project-work/recipes/git-status.json +9 -0
  201. package/node_modules/@llblab/pi-actors/dist/skills/project-work/recipes/markdown-index.json +14 -0
  202. package/node_modules/@llblab/pi-actors/dist/skills/project-work/recipes/package-summary.json +9 -0
  203. package/node_modules/@llblab/pi-actors/dist/skills/project-work/recipes/release-readiness.json +115 -0
  204. package/node_modules/@llblab/pi-actors/dist/skills/project-work/recipes/release-summary.json +74 -0
  205. package/node_modules/@llblab/pi-actors/dist/skills/project-work/recipes/repo-health.json +75 -0
  206. package/node_modules/@llblab/pi-actors/dist/skills/project-work/recipes/run-ops.json +56 -0
  207. package/node_modules/@llblab/pi-actors/dist/skills/project-work/recipes/skill-summary.json +11 -0
  208. package/node_modules/@llblab/pi-actors/dist/skills/project-work/scripts/project-utils.mjs +89 -0
  209. package/node_modules/@llblab/pi-actors/dist/skills/recipe-memory/SKILL.md +36 -0
  210. package/node_modules/@llblab/pi-actors/dist/skills/recipe-memory/recipes/draft-review.json +14 -0
  211. package/node_modules/@llblab/pi-actors/dist/skills/recipe-memory/recipes/tool-review.json +14 -0
  212. package/node_modules/@llblab/pi-actors/dist/skills/swarm/SKILL.md +84 -0
  213. package/node_modules/@llblab/pi-actors/dist/skills/swarm/recipes/architect.json +82 -0
  214. package/node_modules/@llblab/pi-actors/dist/skills/swarm/recipes/checkpoint-continuation.json +51 -0
  215. package/node_modules/@llblab/pi-actors/dist/skills/swarm/recipes/development-tasking.json +67 -0
  216. package/node_modules/@llblab/pi-actors/dist/skills/swarm/recipes/lens-review.json +63 -0
  217. package/node_modules/@llblab/pi-actors/dist/skills/swarm/recipes/quorum-review.json +65 -0
  218. package/node_modules/@llblab/pi-actors/dist/skills/swarm/recipes/research-synthesis.json +81 -0
  219. package/node_modules/@llblab/pi-actors/dist/skills/swarm/recipes/review-readiness.json +59 -0
  220. package/node_modules/@llblab/pi-actors/dist/skills/swarm/recipes/subagent-artifact.json +21 -0
  221. package/node_modules/@llblab/pi-actors/dist/skills/swarm/recipes/subagent-checkpoint.json +21 -0
  222. package/node_modules/@llblab/pi-actors/dist/skills/swarm/recipes/subagent-conflict-report.json +19 -0
  223. package/node_modules/@llblab/pi-actors/dist/skills/swarm/recipes/subagent-contradiction-map.json +20 -0
  224. package/node_modules/@llblab/pi-actors/dist/skills/swarm/recipes/subagent-critic.json +22 -0
  225. package/node_modules/@llblab/pi-actors/dist/skills/swarm/recipes/subagent-evidence-map.json +20 -0
  226. package/node_modules/@llblab/pi-actors/dist/skills/swarm/recipes/subagent-followup.json +21 -0
  227. package/node_modules/@llblab/pi-actors/dist/skills/swarm/recipes/subagent-judge.json +22 -0
  228. package/node_modules/@llblab/pi-actors/dist/skills/swarm/recipes/subagent-merge.json +24 -0
  229. package/node_modules/@llblab/pi-actors/dist/skills/swarm/recipes/subagent-normalize.json +20 -0
  230. package/node_modules/@llblab/pi-actors/dist/skills/swarm/recipes/subagent-plan.json +20 -0
  231. package/node_modules/@llblab/pi-actors/dist/skills/swarm/recipes/subagent-preflight.json +18 -0
  232. package/node_modules/@llblab/pi-actors/dist/skills/swarm/recipes/subagent-prompt.json +16 -0
  233. package/node_modules/@llblab/pi-actors/dist/skills/swarm/recipes/subagent-prompts.json +39 -0
  234. package/node_modules/@llblab/pi-actors/dist/skills/swarm/recipes/subagent-quorum.json +31 -0
  235. package/node_modules/@llblab/pi-actors/dist/skills/swarm/recipes/subagent-review-coordinator.json +170 -0
  236. package/node_modules/@llblab/pi-actors/dist/skills/swarm/recipes/subagent-review.json +26 -0
  237. package/node_modules/@llblab/pi-actors/dist/skills/swarm/recipes/subagent-task-card.json +22 -0
  238. package/node_modules/@llblab/pi-actors/dist/skills/swarm/recipes/subagent-tools.json +15 -0
  239. package/node_modules/@llblab/pi-actors/dist/skills/swarm/recipes/subagent-verify.json +23 -0
  240. package/node_modules/@llblab/pi-actors/dist/skills/swarm/references/development-swarm.md +189 -0
  241. package/node_modules/@llblab/pi-actors/dist/skills/swarm/references/review-swarms.md +115 -0
  242. package/node_modules/@llblab/pi-actors/docs/README.md +20 -0
  243. package/node_modules/@llblab/pi-actors/docs/actor-inspector.md +50 -0
  244. package/node_modules/@llblab/pi-actors/docs/async-runs.md +141 -0
  245. package/node_modules/@llblab/pi-actors/docs/command-templates.md +321 -0
  246. package/node_modules/@llblab/pi-actors/docs/recipe-library.md +89 -0
  247. package/node_modules/@llblab/pi-actors/docs/releasing.md +28 -0
  248. package/node_modules/@llblab/pi-actors/docs/template-recipes.md +175 -0
  249. package/node_modules/@llblab/pi-actors/docs/tool-registry.md +90 -0
  250. package/node_modules/@llblab/pi-actors/fixtures/protocol/artifact-manifest.json +9 -0
  251. package/node_modules/@llblab/pi-actors/fixtures/protocol/control-endpoint.json +6 -0
  252. package/node_modules/@llblab/pi-actors/fixtures/protocol/control-record.json +9 -0
  253. package/node_modules/@llblab/pi-actors/fixtures/protocol/recipe-summary.json +8 -0
  254. package/node_modules/@llblab/pi-actors/fixtures/protocol/run-state.json +10 -0
  255. package/node_modules/@llblab/pi-actors/fixtures/protocol/trace-event.json +9 -0
  256. package/node_modules/@llblab/pi-actors/index.ts +30 -0
  257. package/node_modules/@llblab/pi-actors/lib/async-runs.ts +1245 -0
  258. package/node_modules/@llblab/pi-actors/lib/automatic-review-runtime.ts +148 -0
  259. package/node_modules/@llblab/pi-actors/lib/command-templates.ts +1116 -0
  260. package/node_modules/@llblab/pi-actors/lib/config.ts +261 -0
  261. package/node_modules/@llblab/pi-actors/lib/control-projection.ts +105 -0
  262. package/node_modules/@llblab/pi-actors/lib/control.ts +117 -0
  263. package/node_modules/@llblab/pi-actors/lib/draft-consolidation-transaction.ts +821 -0
  264. package/node_modules/@llblab/pi-actors/lib/draft-consolidation.ts +181 -0
  265. package/node_modules/@llblab/pi-actors/lib/draft-review.ts +325 -0
  266. package/node_modules/@llblab/pi-actors/lib/draft-sleep.ts +575 -0
  267. package/node_modules/@llblab/pi-actors/lib/execution-output.ts +123 -0
  268. package/node_modules/@llblab/pi-actors/lib/execution-sessions.ts +111 -0
  269. package/node_modules/@llblab/pi-actors/lib/execution.ts +1153 -0
  270. package/node_modules/@llblab/pi-actors/lib/extension-runtime.ts +181 -0
  271. package/node_modules/@llblab/pi-actors/lib/file-state.ts +306 -0
  272. package/node_modules/@llblab/pi-actors/lib/identity.ts +29 -0
  273. package/node_modules/@llblab/pi-actors/lib/inspector-actions.ts +79 -0
  274. package/node_modules/@llblab/pi-actors/lib/inspector-command.ts +54 -0
  275. package/node_modules/@llblab/pi-actors/lib/inspector-overlay.ts +901 -0
  276. package/node_modules/@llblab/pi-actors/lib/inspector.ts +204 -0
  277. package/node_modules/@llblab/pi-actors/lib/limits.ts +29 -0
  278. package/node_modules/@llblab/pi-actors/lib/model-context.ts +359 -0
  279. package/node_modules/@llblab/pi-actors/lib/observability.ts +1337 -0
  280. package/node_modules/@llblab/pi-actors/lib/paths.ts +111 -0
  281. package/node_modules/@llblab/pi-actors/lib/pi.ts +47 -0
  282. package/node_modules/@llblab/pi-actors/lib/preflight-diagnostics.ts +132 -0
  283. package/node_modules/@llblab/pi-actors/lib/prompts.ts +69 -0
  284. package/node_modules/@llblab/pi-actors/lib/recipe-control.ts +52 -0
  285. package/node_modules/@llblab/pi-actors/lib/recipes-context.ts +268 -0
  286. package/node_modules/@llblab/pi-actors/lib/recipes-discovery.ts +1060 -0
  287. package/node_modules/@llblab/pi-actors/lib/recipes-references.ts +1598 -0
  288. package/node_modules/@llblab/pi-actors/lib/recipes-usage.ts +638 -0
  289. package/node_modules/@llblab/pi-actors/lib/registry.ts +806 -0
  290. package/node_modules/@llblab/pi-actors/lib/review-control.ts +136 -0
  291. package/node_modules/@llblab/pi-actors/lib/review-diagnostics.ts +164 -0
  292. package/node_modules/@llblab/pi-actors/lib/review-projection.ts +196 -0
  293. package/node_modules/@llblab/pi-actors/lib/run-evidence-policy.ts +242 -0
  294. package/node_modules/@llblab/pi-actors/lib/run-ui-runtime.ts +155 -0
  295. package/node_modules/@llblab/pi-actors/lib/runs-artifacts.ts +96 -0
  296. package/node_modules/@llblab/pi-actors/lib/runs-control-delivery.ts +209 -0
  297. package/node_modules/@llblab/pi-actors/lib/runs-control.ts +148 -0
  298. package/node_modules/@llblab/pi-actors/lib/runs-controls.ts +282 -0
  299. package/node_modules/@llblab/pi-actors/lib/runs-identity.ts +14 -0
  300. package/node_modules/@llblab/pi-actors/lib/runs-index.ts +192 -0
  301. package/node_modules/@llblab/pi-actors/lib/runs-ownership.ts +136 -0
  302. package/node_modules/@llblab/pi-actors/lib/runs-parent-teardown.ts +257 -0
  303. package/node_modules/@llblab/pi-actors/lib/runs-process.ts +174 -0
  304. package/node_modules/@llblab/pi-actors/lib/runs-retention.ts +140 -0
  305. package/node_modules/@llblab/pi-actors/lib/runs-start.ts +113 -0
  306. package/node_modules/@llblab/pi-actors/lib/runs-status.ts +101 -0
  307. package/node_modules/@llblab/pi-actors/lib/runs-trace.ts +611 -0
  308. package/node_modules/@llblab/pi-actors/lib/runtime-identity.ts +39 -0
  309. package/node_modules/@llblab/pi-actors/lib/runtime-triage.ts +106 -0
  310. package/node_modules/@llblab/pi-actors/lib/runtime.ts +430 -0
  311. package/node_modules/@llblab/pi-actors/lib/schema.ts +525 -0
  312. package/node_modules/@llblab/pi-actors/lib/session-evidence.ts +302 -0
  313. package/node_modules/@llblab/pi-actors/lib/state-readers.ts +93 -0
  314. package/node_modules/@llblab/pi-actors/lib/temp.ts +99 -0
  315. package/node_modules/@llblab/pi-actors/lib/tool-review-lineage-transaction.ts +881 -0
  316. package/node_modules/@llblab/pi-actors/lib/tool-review-lineage.ts +145 -0
  317. package/node_modules/@llblab/pi-actors/lib/tool-review-scheduler.ts +635 -0
  318. package/node_modules/@llblab/pi-actors/lib/tool-review-transaction.ts +563 -0
  319. package/node_modules/@llblab/pi-actors/lib/tool-review.ts +270 -0
  320. package/node_modules/@llblab/pi-actors/lib/tools-access.ts +68 -0
  321. package/node_modules/@llblab/pi-actors/lib/tools-inspect.ts +673 -0
  322. package/node_modules/@llblab/pi-actors/lib/tools-local.ts +303 -0
  323. package/node_modules/@llblab/pi-actors/lib/tools-message.ts +176 -0
  324. package/node_modules/@llblab/pi-actors/lib/tools-register.ts +63 -0
  325. package/node_modules/@llblab/pi-actors/lib/tools-response.ts +285 -0
  326. package/node_modules/@llblab/pi-actors/lib/tools-spawn.ts +212 -0
  327. package/node_modules/@llblab/pi-actors/lib/tools.ts +88 -0
  328. package/node_modules/@llblab/pi-actors/lib/trace-projection.ts +306 -0
  329. package/node_modules/@llblab/pi-actors/package.json +76 -0
  330. package/node_modules/@llblab/pi-actors/scripts/async-runner.mjs +555 -0
  331. package/node_modules/@llblab/pi-actors/scripts/build-dist.mjs +60 -0
  332. package/node_modules/@llblab/pi-actors/scripts/conformance.mjs +63 -0
  333. package/node_modules/@llblab/pi-actors/skills/actors/SKILL.md +126 -0
  334. package/node_modules/@llblab/pi-actors/skills/actors/recipes/command-validate.json +13 -0
  335. package/node_modules/@llblab/pi-actors/skills/actors/recipes/jsonl-tail.json +10 -0
  336. package/node_modules/@llblab/pi-actors/skills/actors/recipes/recipe-validate.json +11 -0
  337. package/node_modules/@llblab/pi-actors/skills/actors/recipes/resource-locker-snapshot.json +11 -0
  338. package/node_modules/@llblab/pi-actors/skills/actors/recipes/resource-locker.json +25 -0
  339. package/node_modules/@llblab/pi-actors/skills/actors/recipes/run-ops-snapshot.json +15 -0
  340. package/node_modules/@llblab/pi-actors/skills/actors/recipes/run-state-files.json +13 -0
  341. package/node_modules/@llblab/pi-actors/skills/actors/recipes/run-summary.json +9 -0
  342. package/node_modules/@llblab/pi-actors/skills/actors/references/diagnostics.md +44 -0
  343. package/node_modules/@llblab/pi-actors/skills/actors/references/persistent-tools.md +76 -0
  344. package/node_modules/@llblab/pi-actors/skills/actors/references/recipes.md +51 -0
  345. package/node_modules/@llblab/pi-actors/skills/actors/references/runs.md +41 -0
  346. package/node_modules/@llblab/pi-actors/skills/actors/scripts/resource-locker.mjs +425 -0
  347. package/node_modules/@llblab/pi-actors/skills/actors/scripts/run-utils.mjs +164 -0
  348. package/node_modules/@llblab/pi-actors/skills/actors/scripts/validate-recipe.mjs +370 -0
  349. package/node_modules/@llblab/pi-actors/skills/artifacts/SKILL.md +33 -0
  350. package/node_modules/@llblab/pi-actors/skills/artifacts/recipes/bundle.json +77 -0
  351. package/node_modules/@llblab/pi-actors/skills/artifacts/recipes/file-write.json +14 -0
  352. package/node_modules/@llblab/pi-actors/skills/artifacts/recipes/manifest.json +14 -0
  353. package/node_modules/@llblab/pi-actors/skills/artifacts/recipes/report.json +39 -0
  354. package/node_modules/@llblab/pi-actors/skills/artifacts/recipes/write.json +53 -0
  355. package/node_modules/@llblab/pi-actors/skills/artifacts/scripts/artifact-utils.mjs +63 -0
  356. package/node_modules/@llblab/pi-actors/skills/music-player/SKILL.md +57 -0
  357. package/node_modules/@llblab/pi-actors/skills/music-player/genapps/music-player.mjs +360 -0
  358. package/node_modules/@llblab/pi-actors/skills/music-player/recipes/playback.json +29 -0
  359. package/node_modules/@llblab/pi-actors/skills/music-player/scripts/playback-client.mjs +143 -0
  360. package/node_modules/@llblab/pi-actors/skills/music-player/scripts/playback.mjs +1446 -0
  361. package/node_modules/@llblab/pi-actors/skills/project-work/SKILL.md +37 -0
  362. package/node_modules/@llblab/pi-actors/skills/project-work/recipes/changelog-head.json +11 -0
  363. package/node_modules/@llblab/pi-actors/skills/project-work/recipes/changelog-section.json +11 -0
  364. package/node_modules/@llblab/pi-actors/skills/project-work/recipes/docs-maintenance.json +66 -0
  365. package/node_modules/@llblab/pi-actors/skills/project-work/recipes/git-log.json +11 -0
  366. package/node_modules/@llblab/pi-actors/skills/project-work/recipes/git-status.json +9 -0
  367. package/node_modules/@llblab/pi-actors/skills/project-work/recipes/markdown-index.json +14 -0
  368. package/node_modules/@llblab/pi-actors/skills/project-work/recipes/package-summary.json +9 -0
  369. package/node_modules/@llblab/pi-actors/skills/project-work/recipes/release-readiness.json +115 -0
  370. package/node_modules/@llblab/pi-actors/skills/project-work/recipes/release-summary.json +74 -0
  371. package/node_modules/@llblab/pi-actors/skills/project-work/recipes/repo-health.json +75 -0
  372. package/node_modules/@llblab/pi-actors/skills/project-work/recipes/run-ops.json +56 -0
  373. package/node_modules/@llblab/pi-actors/skills/project-work/recipes/skill-summary.json +11 -0
  374. package/node_modules/@llblab/pi-actors/skills/project-work/scripts/project-utils.mjs +89 -0
  375. package/node_modules/@llblab/pi-actors/skills/recipe-memory/SKILL.md +36 -0
  376. package/node_modules/@llblab/pi-actors/skills/recipe-memory/recipes/draft-review.json +14 -0
  377. package/node_modules/@llblab/pi-actors/skills/recipe-memory/recipes/tool-review.json +14 -0
  378. package/node_modules/@llblab/pi-actors/skills/swarm/SKILL.md +84 -0
  379. package/node_modules/@llblab/pi-actors/skills/swarm/recipes/architect.json +82 -0
  380. package/node_modules/@llblab/pi-actors/skills/swarm/recipes/checkpoint-continuation.json +51 -0
  381. package/node_modules/@llblab/pi-actors/skills/swarm/recipes/development-tasking.json +67 -0
  382. package/node_modules/@llblab/pi-actors/skills/swarm/recipes/lens-review.json +63 -0
  383. package/node_modules/@llblab/pi-actors/skills/swarm/recipes/quorum-review.json +65 -0
  384. package/node_modules/@llblab/pi-actors/skills/swarm/recipes/research-synthesis.json +81 -0
  385. package/node_modules/@llblab/pi-actors/skills/swarm/recipes/review-readiness.json +59 -0
  386. package/node_modules/@llblab/pi-actors/skills/swarm/recipes/subagent-artifact.json +21 -0
  387. package/node_modules/@llblab/pi-actors/skills/swarm/recipes/subagent-checkpoint.json +21 -0
  388. package/node_modules/@llblab/pi-actors/skills/swarm/recipes/subagent-conflict-report.json +19 -0
  389. package/node_modules/@llblab/pi-actors/skills/swarm/recipes/subagent-contradiction-map.json +20 -0
  390. package/node_modules/@llblab/pi-actors/skills/swarm/recipes/subagent-critic.json +22 -0
  391. package/node_modules/@llblab/pi-actors/skills/swarm/recipes/subagent-evidence-map.json +20 -0
  392. package/node_modules/@llblab/pi-actors/skills/swarm/recipes/subagent-followup.json +21 -0
  393. package/node_modules/@llblab/pi-actors/skills/swarm/recipes/subagent-judge.json +22 -0
  394. package/node_modules/@llblab/pi-actors/skills/swarm/recipes/subagent-merge.json +24 -0
  395. package/node_modules/@llblab/pi-actors/skills/swarm/recipes/subagent-normalize.json +20 -0
  396. package/node_modules/@llblab/pi-actors/skills/swarm/recipes/subagent-plan.json +20 -0
  397. package/node_modules/@llblab/pi-actors/skills/swarm/recipes/subagent-preflight.json +18 -0
  398. package/node_modules/@llblab/pi-actors/skills/swarm/recipes/subagent-prompt.json +16 -0
  399. package/node_modules/@llblab/pi-actors/skills/swarm/recipes/subagent-prompts.json +39 -0
  400. package/node_modules/@llblab/pi-actors/skills/swarm/recipes/subagent-quorum.json +31 -0
  401. package/node_modules/@llblab/pi-actors/skills/swarm/recipes/subagent-review-coordinator.json +170 -0
  402. package/node_modules/@llblab/pi-actors/skills/swarm/recipes/subagent-review.json +26 -0
  403. package/node_modules/@llblab/pi-actors/skills/swarm/recipes/subagent-task-card.json +22 -0
  404. package/node_modules/@llblab/pi-actors/skills/swarm/recipes/subagent-tools.json +15 -0
  405. package/node_modules/@llblab/pi-actors/skills/swarm/recipes/subagent-verify.json +23 -0
  406. package/node_modules/@llblab/pi-actors/skills/swarm/references/development-swarm.md +189 -0
  407. package/node_modules/@llblab/pi-actors/skills/swarm/references/review-swarms.md +115 -0
  408. package/node_modules/@llblab/pi-codex-usage/AGENTS.md +17 -0
  409. package/node_modules/@llblab/pi-codex-usage/BACKLOG.md +8 -0
  410. package/node_modules/@llblab/pi-codex-usage/CHANGELOG.md +80 -0
  411. package/node_modules/@llblab/pi-codex-usage/LICENSE +22 -0
  412. package/node_modules/@llblab/pi-codex-usage/README.md +113 -0
  413. package/node_modules/@llblab/pi-codex-usage/banner.jpg +0 -0
  414. package/node_modules/@llblab/pi-codex-usage/index.ts +1525 -0
  415. package/node_modules/@llblab/pi-codex-usage/package.json +59 -0
  416. package/node_modules/@llblab/pi-grow-loop/AGENTS.md +56 -0
  417. package/node_modules/@llblab/pi-grow-loop/BACKLOG.md +3 -0
  418. package/node_modules/@llblab/pi-grow-loop/CHANGELOG.md +126 -0
  419. package/node_modules/@llblab/pi-grow-loop/README.md +216 -0
  420. package/node_modules/@llblab/pi-grow-loop/banner.jpg +0 -0
  421. package/node_modules/@llblab/pi-grow-loop/index.ts +219 -0
  422. package/node_modules/@llblab/pi-grow-loop/package.json +64 -0
  423. package/node_modules/@llblab/pi-grow-loop/skills/grow-loop/SKILL.md +131 -0
  424. package/node_modules/@llblab/pi-grow-loop/skills/while-true/SKILL.md +233 -0
  425. package/node_modules/@llblab/pi-telegram/AGENTS.md +157 -0
  426. package/node_modules/@llblab/pi-telegram/BACKLOG.md +15 -0
  427. package/node_modules/@llblab/pi-telegram/CHANGELOG.md +886 -0
  428. package/node_modules/@llblab/pi-telegram/README.md +330 -0
  429. package/node_modules/@llblab/pi-telegram/api/activity.ts +15 -0
  430. package/node_modules/@llblab/pi-telegram/api/commands.ts +11 -0
  431. package/node_modules/@llblab/pi-telegram/api/delivery.ts +21 -0
  432. package/node_modules/@llblab/pi-telegram/api/inbound.ts +14 -0
  433. package/node_modules/@llblab/pi-telegram/api/keyboard.ts +11 -0
  434. package/node_modules/@llblab/pi-telegram/api/outbound.ts +11 -0
  435. package/node_modules/@llblab/pi-telegram/api/sections.ts +17 -0
  436. package/node_modules/@llblab/pi-telegram/api/status.ts +12 -0
  437. package/node_modules/@llblab/pi-telegram/api/updates.ts +16 -0
  438. package/node_modules/@llblab/pi-telegram/api/voice.ts +24 -0
  439. package/node_modules/@llblab/pi-telegram/docs/README.md +25 -0
  440. package/node_modules/@llblab/pi-telegram/docs/activity.md +304 -0
  441. package/node_modules/@llblab/pi-telegram/docs/architecture.md +418 -0
  442. package/node_modules/@llblab/pi-telegram/docs/callback-namespaces.md +48 -0
  443. package/node_modules/@llblab/pi-telegram/docs/command-templates.md +365 -0
  444. package/node_modules/@llblab/pi-telegram/docs/compact-matrix-literal.md +176 -0
  445. package/node_modules/@llblab/pi-telegram/docs/delivery.md +225 -0
  446. package/node_modules/@llblab/pi-telegram/docs/generative-apps.md +310 -0
  447. package/node_modules/@llblab/pi-telegram/docs/inbound.md +136 -0
  448. package/node_modules/@llblab/pi-telegram/docs/multi-instance-bus.md +467 -0
  449. package/node_modules/@llblab/pi-telegram/docs/outbound.md +193 -0
  450. package/node_modules/@llblab/pi-telegram/docs/public-api.md +599 -0
  451. package/node_modules/@llblab/pi-telegram/docs/sections.md +452 -0
  452. package/node_modules/@llblab/pi-telegram/docs/ui-style.md +256 -0
  453. package/node_modules/@llblab/pi-telegram/docs/updates.md +171 -0
  454. package/node_modules/@llblab/pi-telegram/docs/voice.md +217 -0
  455. package/node_modules/@llblab/pi-telegram/index.ts +1336 -0
  456. package/node_modules/@llblab/pi-telegram/lib/activity-verbosity.ts +714 -0
  457. package/node_modules/@llblab/pi-telegram/lib/activity.ts +782 -0
  458. package/node_modules/@llblab/pi-telegram/lib/agent-messages.ts +121 -0
  459. package/node_modules/@llblab/pi-telegram/lib/bindings.ts +1129 -0
  460. package/node_modules/@llblab/pi-telegram/lib/bus-api.ts +379 -0
  461. package/node_modules/@llblab/pi-telegram/lib/bus-follower.ts +1941 -0
  462. package/node_modules/@llblab/pi-telegram/lib/bus-leader.ts +2119 -0
  463. package/node_modules/@llblab/pi-telegram/lib/bus-transport.ts +244 -0
  464. package/node_modules/@llblab/pi-telegram/lib/bus.ts +2645 -0
  465. package/node_modules/@llblab/pi-telegram/lib/command-templates.ts +954 -0
  466. package/node_modules/@llblab/pi-telegram/lib/commands.ts +1854 -0
  467. package/node_modules/@llblab/pi-telegram/lib/config.ts +1143 -0
  468. package/node_modules/@llblab/pi-telegram/lib/delivery.ts +891 -0
  469. package/node_modules/@llblab/pi-telegram/lib/generative-app-worker.mjs +104 -0
  470. package/node_modules/@llblab/pi-telegram/lib/generative-apps.ts +958 -0
  471. package/node_modules/@llblab/pi-telegram/lib/inbound.ts +824 -0
  472. package/node_modules/@llblab/pi-telegram/lib/journal.ts +3140 -0
  473. package/node_modules/@llblab/pi-telegram/lib/keyboard.ts +59 -0
  474. package/node_modules/@llblab/pi-telegram/lib/lifecycle.ts +623 -0
  475. package/node_modules/@llblab/pi-telegram/lib/locks.ts +1422 -0
  476. package/node_modules/@llblab/pi-telegram/lib/logs.ts +393 -0
  477. package/node_modules/@llblab/pi-telegram/lib/media.ts +921 -0
  478. package/node_modules/@llblab/pi-telegram/lib/menu-model.ts +1182 -0
  479. package/node_modules/@llblab/pi-telegram/lib/menu-queue.ts +926 -0
  480. package/node_modules/@llblab/pi-telegram/lib/menu-settings.ts +876 -0
  481. package/node_modules/@llblab/pi-telegram/lib/menu-status.ts +274 -0
  482. package/node_modules/@llblab/pi-telegram/lib/menu-thinking.ts +185 -0
  483. package/node_modules/@llblab/pi-telegram/lib/menu.ts +867 -0
  484. package/node_modules/@llblab/pi-telegram/lib/model.ts +672 -0
  485. package/node_modules/@llblab/pi-telegram/lib/outbound-attachments.ts +981 -0
  486. package/node_modules/@llblab/pi-telegram/lib/outbound-buttons.ts +331 -0
  487. package/node_modules/@llblab/pi-telegram/lib/outbound-markup.ts +515 -0
  488. package/node_modules/@llblab/pi-telegram/lib/outbound-voice.ts +285 -0
  489. package/node_modules/@llblab/pi-telegram/lib/outbound.ts +1007 -0
  490. package/node_modules/@llblab/pi-telegram/lib/ownership.ts +298 -0
  491. package/node_modules/@llblab/pi-telegram/lib/paths.ts +127 -0
  492. package/node_modules/@llblab/pi-telegram/lib/pi.ts +197 -0
  493. package/node_modules/@llblab/pi-telegram/lib/polling.ts +1588 -0
  494. package/node_modules/@llblab/pi-telegram/lib/preview.ts +846 -0
  495. package/node_modules/@llblab/pi-telegram/lib/prompt-templates.ts +158 -0
  496. package/node_modules/@llblab/pi-telegram/lib/prompts.ts +218 -0
  497. package/node_modules/@llblab/pi-telegram/lib/queue.ts +3075 -0
  498. package/node_modules/@llblab/pi-telegram/lib/recovery.ts +464 -0
  499. package/node_modules/@llblab/pi-telegram/lib/rendering.ts +1213 -0
  500. package/node_modules/@llblab/pi-telegram/lib/replies.ts +892 -0
  501. package/node_modules/@llblab/pi-telegram/lib/routing.ts +2889 -0
  502. package/node_modules/@llblab/pi-telegram/lib/runtime.ts +628 -0
  503. package/node_modules/@llblab/pi-telegram/lib/sections.ts +710 -0
  504. package/node_modules/@llblab/pi-telegram/lib/setup.ts +220 -0
  505. package/node_modules/@llblab/pi-telegram/lib/skills.ts +21 -0
  506. package/node_modules/@llblab/pi-telegram/lib/status.ts +1550 -0
  507. package/node_modules/@llblab/pi-telegram/lib/sync.ts +883 -0
  508. package/node_modules/@llblab/pi-telegram/lib/target.ts +49 -0
  509. package/node_modules/@llblab/pi-telegram/lib/telegram-api.ts +1747 -0
  510. package/node_modules/@llblab/pi-telegram/lib/text-groups.ts +487 -0
  511. package/node_modules/@llblab/pi-telegram/lib/thread-reconciler.ts +1002 -0
  512. package/node_modules/@llblab/pi-telegram/lib/threads.ts +3183 -0
  513. package/node_modules/@llblab/pi-telegram/lib/time-injection.ts +78 -0
  514. package/node_modules/@llblab/pi-telegram/lib/turns.ts +753 -0
  515. package/node_modules/@llblab/pi-telegram/lib/updates.ts +4950 -0
  516. package/node_modules/@llblab/pi-telegram/lib/voice.ts +340 -0
  517. package/node_modules/@llblab/pi-telegram/package.json +83 -0
  518. package/node_modules/@llblab/pi-telegram/screenshot.png +0 -0
  519. package/node_modules/@llblab/pi-telegram/scripts/check-downgrade.mjs +435 -0
  520. package/node_modules/@llblab/pi-telegram/skills/generated-control-surface/SKILL.md +241 -0
  521. package/node_modules/@llblab/pi-telegram/skills/generative-apps/SKILL.md +114 -0
  522. package/node_modules/@llblab/pi-telegram/skills/telegram-bridge/SKILL.md +149 -0
  523. package/package.json +67 -0
@@ -0,0 +1,370 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * Template recipe validator CLI.
5
+ *
6
+ * Owns CLI parsing and report formatting directly. Recipe parsing remains in
7
+ * the reusable recipe-reference domain.
8
+ */
9
+
10
+ import { existsSync, readdirSync, statSync } from "node:fs";
11
+ import { homedir } from "node:os";
12
+ import { basename, dirname, extname, isAbsolute, join, relative, resolve, sep } from "node:path";
13
+ import { fileURLToPath, pathToFileURL } from "node:url";
14
+
15
+ function packageRoot() {
16
+ return dirname(dirname(dirname(dirname(fileURLToPath(import.meta.url)))));
17
+ }
18
+
19
+ async function importRuntimeModule(name) {
20
+ const root = packageRoot();
21
+ const localCompiled = join(root, "lib", `${name}.js`);
22
+ const installedCompiled = join(root, "dist", "lib", `${name}.js`);
23
+ const source = join(root, "lib", `${name}.ts`);
24
+ const module = existsSync(localCompiled)
25
+ ? localCompiled
26
+ : root.includes(`${sep}node_modules${sep}`) && existsSync(installedCompiled)
27
+ ? installedCompiled
28
+ : source;
29
+ return await import(pathToFileURL(module).href);
30
+ }
31
+
32
+ const {
33
+ createActiveSkillRecipeContext,
34
+ readRawRecipeConfig,
35
+ readResolvedRecipeConfig,
36
+ } = await importRuntimeModule("recipes-references");
37
+
38
+ const skillsDir = join(packageRoot(), "skills");
39
+ const packageSkillContext = createActiveSkillRecipeContext(
40
+ existsSync(skillsDir)
41
+ ? readdirSync(skillsDir, { withFileTypes: true })
42
+ .filter((entry) => entry.isDirectory())
43
+ .map((entry) => ({
44
+ name: entry.name,
45
+ baseDir: join(skillsDir, entry.name),
46
+ }))
47
+ : [],
48
+ );
49
+
50
+ export function validateRecipeUsage() {
51
+ return `Usage:
52
+ validate-recipe.mjs <recipe-file-or-dir> [--all] [--skills] [--qa] [--summary]
53
+
54
+ Validates one template Recipe file or all direct *.json/*.md files in a directory with --all. Use --skills on a Skills root to validate every direct <skill>/recipes component and reject nested files or duplicate stems. Add --qa for shipped-component capability checks, where diagnostics and warnings fail validation. Add --summary for compact CLI output.`;
55
+ }
56
+
57
+ function expandPath(value) {
58
+ return resolve(String(value).replace(/^~(?=\/|$)/, process.env.HOME ?? homedir()));
59
+ }
60
+
61
+ function templateKind(template) {
62
+ if (typeof template === "string") return "leaf";
63
+ if (Array.isArray(template)) return "sequence";
64
+ if (template && typeof template === "object") {
65
+ const node = template;
66
+ if (typeof node.template === "string") return "leaf";
67
+ if (Array.isArray(node.template))
68
+ return node.parallel === true ? "parallel" : "sequence";
69
+ if (node.parallel === true) return "parallel";
70
+ return "object";
71
+ }
72
+ return "unknown";
73
+ }
74
+
75
+ function recipeFiles(target, all) {
76
+ if (!existsSync(target)) throw new Error(`Recipe path not found: ${target}`);
77
+ const stat = statSync(target);
78
+ if (stat.isFile()) return [target];
79
+ if (!stat.isDirectory())
80
+ throw new Error(`Recipe path is not a file or directory: ${target}`);
81
+ if (!all) throw new Error("Directory validation requires --all.");
82
+ return readdirSync(target)
83
+ .filter((file) => file.endsWith(".json") || file.endsWith(".md"))
84
+ .sort((a, b) => a.localeCompare(b))
85
+ .map((file) => resolve(target, file));
86
+ }
87
+
88
+ function nestedRecipeFiles(root) {
89
+ return readdirSync(root, { withFileTypes: true }).flatMap((entry) => {
90
+ const path = join(root, entry.name);
91
+ if (entry.isDirectory()) return nestedRecipeFiles(path);
92
+ return entry.isFile() && /\.(?:json|md)$/.test(entry.name) ? [path] : [];
93
+ });
94
+ }
95
+
96
+ function scanSkillRecipes(target) {
97
+ if (!existsSync(target) || !statSync(target).isDirectory())
98
+ throw new Error(`Skills root is not a directory: ${target}`);
99
+ const skills = readdirSync(target, { withFileTypes: true })
100
+ .filter((entry) => entry.isDirectory())
101
+ .sort((a, b) => a.name.localeCompare(b.name));
102
+ const files = [];
103
+ const failures = [];
104
+ for (const skill of skills) {
105
+ const recipeDir = join(target, skill.name, "recipes");
106
+ if (!existsSync(recipeDir)) continue;
107
+ const direct = readdirSync(recipeDir, { withFileTypes: true });
108
+ const byStem = new Map();
109
+ const singletonFiles = [];
110
+ for (const entry of direct) {
111
+ const path = join(recipeDir, entry.name);
112
+ if (entry.isDirectory()) {
113
+ for (const nested of nestedRecipeFiles(path)) {
114
+ failures.push({
115
+ file: nested,
116
+ ok: false,
117
+ error: `Nested Skill Recipe files are not allowed: ${relative(recipeDir, nested)}`,
118
+ });
119
+ }
120
+ continue;
121
+ }
122
+ if (!entry.isFile() || !/\.(?:json|md)$/.test(entry.name)) continue;
123
+ files.push(path);
124
+ if (readRawRecipeConfig(path)?.singleton === true) singletonFiles.push(path);
125
+ const stem = basename(entry.name, extname(entry.name));
126
+ const previous = byStem.get(stem);
127
+ if (previous) {
128
+ failures.push({
129
+ file: path,
130
+ ok: false,
131
+ error: `Skill Recipe stem collision: ${skill.name}/${stem} has both ${extname(previous)} and ${extname(path)} files`,
132
+ });
133
+ } else byStem.set(stem, path);
134
+ }
135
+ if (singletonFiles.length > 1) {
136
+ failures.push({
137
+ file: recipeDir,
138
+ ok: false,
139
+ error: `Skill ${skill.name} declares more than one singleton Recipe: ${singletonFiles.map((file) => basename(file)).join(", ")}`,
140
+ });
141
+ }
142
+ }
143
+ let skillContext = packageSkillContext;
144
+ try {
145
+ skillContext = createActiveSkillRecipeContext(
146
+ skills.map((entry) => ({ name: entry.name, baseDir: join(target, entry.name) })),
147
+ );
148
+ } catch (error) {
149
+ failures.push({
150
+ file: target,
151
+ ok: false,
152
+ error: error instanceof Error ? error.message : String(error),
153
+ });
154
+ }
155
+ return {
156
+ files: files.sort((a, b) => a.localeCompare(b)),
157
+ failures,
158
+ skillContext,
159
+ };
160
+ }
161
+
162
+ function collectStrings(value, out = []) {
163
+ if (typeof value === "string") out.push(value);
164
+ else if (Array.isArray(value)) value.forEach((item) => collectStrings(item, out));
165
+ else if (value && typeof value === "object")
166
+ Object.values(value).forEach((item) => collectStrings(item, out));
167
+ return out;
168
+ }
169
+
170
+ function collectTemplateStrings(value, out = []) {
171
+ if (typeof value === "string") out.push(value);
172
+ else if (Array.isArray(value)) value.forEach((item) => collectTemplateStrings(item, out));
173
+ else if (value && typeof value === "object") {
174
+ collectTemplateStrings(value.template, out);
175
+ collectTemplateStrings(value.recover, out);
176
+ }
177
+ return out;
178
+ }
179
+
180
+ function hasPlatformNote(config) {
181
+ const text = [
182
+ config.description,
183
+ config.platforms,
184
+ config.platform_notes,
185
+ config.requirements,
186
+ ]
187
+ .filter(Boolean)
188
+ .join(" ");
189
+ return /linux|macos|darwin|windows|win32|unix|wsl|cross-platform|portable/i.test(text);
190
+ }
191
+
192
+ function validateArtifactDeclarations(config) {
193
+ const diagnostics = [];
194
+ const artifacts = config.artifacts;
195
+ if (artifacts === undefined) return diagnostics;
196
+ if (!artifacts || typeof artifacts !== "object" || Array.isArray(artifacts)) {
197
+ diagnostics.push("artifacts: must be an object of named artifact paths");
198
+ return diagnostics;
199
+ }
200
+ for (const [name, value] of Object.entries(artifacts)) {
201
+ const path = typeof value === "string" ? value : value?.path;
202
+ if (typeof path !== "string" || !path.trim())
203
+ diagnostics.push(`artifacts.${name}: must declare a non-empty path`);
204
+ if (typeof path === "string" && /^\/home\//.test(path))
205
+ diagnostics.push(`artifacts.${name}: must not use a machine-local absolute path`);
206
+ }
207
+ return diagnostics;
208
+ }
209
+
210
+ function validateHelperPaths(file, config) {
211
+ const diagnostics = [];
212
+ const skillDir = dirname(dirname(file));
213
+ for (const template of collectTemplateStrings(config.template)) {
214
+ if (/(^|\s)(?:node\s+)?scripts\/[\w.-]+\.mjs/.test(template))
215
+ diagnostics.push("template: Skill helper scripts must be referenced through {skill_dir}/scripts");
216
+ for (const match of template.matchAll(/\{skill_dir\}\/([^\s"']+)/g)) {
217
+ const target = match[1].replace(/[),;]+$/, "");
218
+ if (!existsSync(join(skillDir, target)))
219
+ diagnostics.push(`template: referenced Skill helper not found: ${target}`);
220
+ }
221
+ }
222
+ return diagnostics;
223
+ }
224
+
225
+ function validatePortablePaths(config) {
226
+ const diagnostics = [];
227
+ for (const value of collectStrings(config)) {
228
+ if (/^(?:\/home\/|\/Users\/|[A-Za-z]:[\\/])/.test(value))
229
+ diagnostics.push(`recipe: must not use a machine-local absolute path: ${value}`);
230
+ }
231
+ return diagnostics;
232
+ }
233
+
234
+ function qaDiagnostics(file, config) {
235
+ const diagnostics = [];
236
+ const warnings = [];
237
+ if (config.mailbox !== undefined)
238
+ diagnostics.push("recipe.mailbox was removed; use control actions and Trace events");
239
+ if (config.singleton === true && config.async !== true)
240
+ diagnostics.push("singleton: requires async: true");
241
+ diagnostics.push(...validateArtifactDeclarations(config));
242
+ diagnostics.push(...validatePortablePaths(config));
243
+ diagnostics.push(...validateHelperPaths(file, config));
244
+ const platformSpecificTemplate = collectTemplateStrings(config.template).some(
245
+ (template) =>
246
+ /(^|\s)(?:systemctl|launchctl|osascript|powershell|pwsh|cmd\.exe|apt|apt-get|dnf|yum|brew|pacman|apk)(\s|$)/i.test(
247
+ template,
248
+ ),
249
+ );
250
+ if (platformSpecificTemplate && !hasPlatformNote(config))
251
+ diagnostics.push("platform: platform-specific templates must document platform scope");
252
+ return { diagnostics, warnings };
253
+ }
254
+
255
+ function qaOk(qaReport) {
256
+ return qaReport.diagnostics.length === 0 && qaReport.warnings.length === 0;
257
+ }
258
+
259
+ function validateFile(file, qa = false, skillContext = packageSkillContext) {
260
+ try {
261
+ const rawConfig = readRawRecipeConfig(file);
262
+ const config = readResolvedRecipeConfig(file, [], { skillContext });
263
+ if (!config?.template)
264
+ throw new Error("Recipe must define a non-empty template.");
265
+ const expectedName = basename(file, extname(file));
266
+ if (config.name !== expectedName)
267
+ throw new Error(`Recipe identity mismatch: expected ${expectedName}, received ${config.name ?? "<none>"}`);
268
+ const qaReport = qa ? qaDiagnostics(file, rawConfig) : { diagnostics: [], warnings: [] };
269
+ return {
270
+ file,
271
+ ok: qaOk(qaReport),
272
+ name: config.name ?? "",
273
+ async: Boolean(config.async),
274
+ singleton: Boolean(config.singleton),
275
+ args: Array.isArray(config.args) ? config.args : [],
276
+ defaults:
277
+ config.defaults && typeof config.defaults === "object"
278
+ ? Object.keys(config.defaults).sort()
279
+ : [],
280
+ imports:
281
+ config.imports && typeof config.imports === "object"
282
+ ? Object.keys(config.imports).sort()
283
+ : [],
284
+ control: Array.isArray(config.control) ? config.control : undefined,
285
+ ...(qa
286
+ ? {
287
+ qa: {
288
+ ok: qaOk(qaReport),
289
+ diagnostics: qaReport.diagnostics,
290
+ warnings: qaReport.warnings,
291
+ },
292
+ }
293
+ : {}),
294
+ template: templateKind(config.template),
295
+ };
296
+ } catch (error) {
297
+ return {
298
+ file,
299
+ ok: false,
300
+ error: error instanceof Error ? error.message : String(error),
301
+ };
302
+ }
303
+ }
304
+
305
+ export function validateRecipes(argv) {
306
+ const targetArg = argv.find((arg) => !arg.startsWith("-"));
307
+ const all = argv.includes("--all");
308
+ const skills = argv.includes("--skills");
309
+ const qa = argv.includes("--qa");
310
+ if (!targetArg || argv.includes("--help") || argv.includes("-h")) {
311
+ return { help: true, ok: Boolean(targetArg), usage: validateRecipeUsage() };
312
+ }
313
+ const target = expandPath(targetArg);
314
+ const scan = skills
315
+ ? scanSkillRecipes(target)
316
+ : { files: recipeFiles(target, all), failures: [], skillContext: packageSkillContext };
317
+ const results = [
318
+ ...scan.failures,
319
+ ...scan.files.map((file) => validateFile(file, qa, scan.skillContext)),
320
+ ];
321
+ const failed = results.filter((result) => !result.ok).length;
322
+ return {
323
+ ok: failed === 0,
324
+ total: results.length,
325
+ passed: results.length - failed,
326
+ failed,
327
+ results,
328
+ };
329
+ }
330
+
331
+ function summarizeReport(report) {
332
+ const results = Array.isArray(report.results) ? report.results : [];
333
+ return {
334
+ ok: report.ok,
335
+ total: report.total,
336
+ passed: report.passed,
337
+ failed: report.failed,
338
+ diagnostics: results.reduce(
339
+ (total, result) => total + (result.qa?.diagnostics?.length ?? 0),
340
+ 0,
341
+ ),
342
+ warnings: results.reduce(
343
+ (total, result) => total + (result.qa?.warnings?.length ?? 0),
344
+ 0,
345
+ ),
346
+ failed_files: results
347
+ .filter((result) => !result.ok)
348
+ .map((result) => ({
349
+ file: result.file,
350
+ ...(result.error ? { error: result.error } : {}),
351
+ ...(result.qa?.diagnostics?.length
352
+ ? { diagnostics: result.qa.diagnostics }
353
+ : {}),
354
+ ...(result.qa?.warnings?.length
355
+ ? { warnings: result.qa.warnings }
356
+ : {}),
357
+ })),
358
+ };
359
+ }
360
+
361
+ try {
362
+ const argv = process.argv.slice(2);
363
+ const report = validateRecipes(argv);
364
+ if (report.help) console.error(report.usage);
365
+ else console.log(JSON.stringify(argv.includes("--summary") ? summarizeReport(report) : report, null, 2));
366
+ process.exit(report.ok ? 0 : 1);
367
+ } catch (error) {
368
+ console.error(error instanceof Error ? error.message : String(error));
369
+ process.exit(1);
370
+ }
@@ -0,0 +1,33 @@
1
+ ---
2
+ name: artifacts
3
+ description: Use when an actor workflow must write reusable files, reports, manifests, or bundles with deterministic paths and declared outputs.
4
+ ---
5
+
6
+ # Artifacts
7
+
8
+ Use this Skill after the desired durable-output outcome is known. For generic Recipe execution, Runs, persistence, or diagnosis, follow `actors`; this Skill only selects artifact behavior.
9
+
10
+ ## Choose the outcome
11
+
12
+ | Desired outcome | Recipe | Result |
13
+ | --- | --- | --- |
14
+ | Write one generated artifact and a machine-readable manifest, with optional validation first | `artifacts/bundle` | Primary artifact plus manifest |
15
+ | Generate bounded normalized report content without committing a filesystem write | `artifacts/report` | Report content for review or later composition |
16
+ | Generate and write one artifact | `artifacts/write` | Declared artifact path written with explicit mode |
17
+ | Describe one existing or intended artifact | `artifacts/manifest` | Manifest JSON on stdout; no write |
18
+ | Write prior pipeline output exactly | `artifacts/file-write` | Supporting stdin-to-file write; normally use inside composition |
19
+
20
+ Prefer `bundle` when both durable content and inventory evidence are required. Prefer `write` for one accepted file. Use `report` while content still needs review. Do not use `file-write` as a content generator. If one selected outcome should become a recurring named tool, use the persistent-capability workflow in `actors`; do not copy its graph.
21
+
22
+ ## Inputs and boundaries
23
+
24
+ - Keep `input` bounded and evidence-based; choose the current model explicitly where the Recipe requires `model`.
25
+ - Supply caller-owned `artifact_path` and, for `bundle`, a distinct `manifest_path`.
26
+ - `write_mode=create` is the safe default and stops if the target exists. Use `overwrite` or `append` only when the requested mutation is explicit.
27
+ - Parent directories are created by the writer. `~` is resolved for artifact paths.
28
+ - `manifest` reports existence, size, and modification evidence; it does not validate artifact meaning.
29
+ - Validation in `bundle` runs only when `run_validation=true` and uses the caller-supplied trusted command and scope.
30
+
31
+ ## Stop rules
32
+
33
+ Stop rather than guessing when the target path, overwrite policy, accepted content, model, or validation command is unclear. Do not claim a durable artifact from `report` or `manifest` alone. After a Run starts, use the `actors` evidence and lifecycle protocol; this Skill does not redefine it.
@@ -0,0 +1,77 @@
1
+ {
2
+ "async": true,
3
+ "imports": {
4
+ "artifactWrite": "artifacts/write",
5
+ "manifest": "artifacts/manifest",
6
+ "manifestWrite": "artifacts/file-write",
7
+ "validation": "actors/command-validate"
8
+ },
9
+ "args": [
10
+ "input:string",
11
+ "artifact_path:path",
12
+ "manifest_path:path",
13
+ "artifact_title:string",
14
+ "artifact_format:string",
15
+ "artifact_status:enum(draft,ready,blocked,accepted)",
16
+ "write_mode:enum(create,overwrite,append)",
17
+ "run_validation:bool",
18
+ "validation_command:string",
19
+ "validation_scope:string",
20
+ "validation_timeout_ms:int",
21
+ "model:string",
22
+ "tools:string"
23
+ ],
24
+ "defaults": {
25
+ "artifact_title": "Artifact Bundle",
26
+ "artifact_format": "Markdown sections: Summary, Findings, Evidence, Risks, Next Actions.",
27
+ "artifact_status": "ready",
28
+ "write_mode": "create",
29
+ "run_validation": "false",
30
+ "validation_command": "true",
31
+ "validation_scope": ".",
32
+ "validation_timeout_ms": "300000",
33
+ "tools": ""
34
+ },
35
+ "artifacts": {
36
+ "artifact": "{artifact_path}",
37
+ "manifest": "{manifest_path}"
38
+ },
39
+ "template": [
40
+ {
41
+ "when": "run_validation",
42
+ "name": "validation",
43
+ "values": {
44
+ "command": "{validation_command}",
45
+ "scope": "{validation_scope}",
46
+ "timeout_ms": "{validation_timeout_ms}"
47
+ }
48
+ },
49
+ {
50
+ "name": "artifactWrite",
51
+ "values": {
52
+ "input": "{input}",
53
+ "artifact_path": "{artifact_path}",
54
+ "artifact_format": "{artifact_format}",
55
+ "write_mode": "{write_mode}",
56
+ "model": "{model}",
57
+ "tools": "{tools}"
58
+ }
59
+ },
60
+ {
61
+ "name": "manifest",
62
+ "values": {
63
+ "artifact_path": "{artifact_path}",
64
+ "title": "{artifact_title}",
65
+ "status": "{artifact_status}",
66
+ "summary": "Artifact bundle manifest for {artifact_path}."
67
+ }
68
+ },
69
+ {
70
+ "name": "manifestWrite",
71
+ "values": {
72
+ "artifact_path": "{manifest_path}",
73
+ "mode": "{write_mode}"
74
+ }
75
+ }
76
+ ]
77
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "async": false,
3
+ "args": [
4
+ "artifact_path:path",
5
+ "mode:enum(create,overwrite,append)"
6
+ ],
7
+ "defaults": {
8
+ "mode": "create"
9
+ },
10
+ "template": {
11
+ "template": "{skill_dir}/scripts/artifact-utils.mjs write {artifact_path} {mode}",
12
+ "output": "stdout"
13
+ }
14
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "args": [
3
+ "artifact_path:path",
4
+ "title:string",
5
+ "status:enum(draft,ready,blocked,accepted)",
6
+ "summary:string"
7
+ ],
8
+ "defaults": {
9
+ "title": "Artifact",
10
+ "status": "draft",
11
+ "summary": "Machine-readable artifact manifest."
12
+ },
13
+ "template": "{skill_dir}/scripts/artifact-utils.mjs manifest {artifact_path} {title} {status} {summary}"
14
+ }
@@ -0,0 +1,39 @@
1
+ {
2
+ "async": true,
3
+ "imports": {
4
+ "normalizer": "swarm/subagent-normalize",
5
+ "artifact": "swarm/subagent-artifact"
6
+ },
7
+ "args": [
8
+ "input:string",
9
+ "artifact_path:path",
10
+ "artifact_format:string",
11
+ "model:string",
12
+ "tools:string"
13
+ ],
14
+ "defaults": {
15
+ "artifact_format": "Markdown sections: Summary, Findings, Evidence, Risks, Next Actions.",
16
+ "tools": ""
17
+ },
18
+ "template": [
19
+ {
20
+ "name": "normalizer",
21
+ "values": {
22
+ "input": "{input}",
23
+ "format": "{artifact_format}",
24
+ "model": "{model}",
25
+ "tools": "{tools}"
26
+ }
27
+ },
28
+ {
29
+ "name": "artifact",
30
+ "values": {
31
+ "input": "Use normalized report from stdin.",
32
+ "artifact_path": "{artifact_path}",
33
+ "artifact_format": "{artifact_format}",
34
+ "model": "{model}",
35
+ "tools": "{tools}"
36
+ }
37
+ }
38
+ ]
39
+ }
@@ -0,0 +1,53 @@
1
+ {
2
+ "async": true,
3
+ "imports": {
4
+ "normalizer": "swarm/subagent-normalize",
5
+ "artifact": "swarm/subagent-artifact",
6
+ "writer": "artifacts/file-write"
7
+ },
8
+ "args": [
9
+ "input:string",
10
+ "artifact_path:path",
11
+ "artifact_format:string",
12
+ "write_mode:enum(create,overwrite,append)",
13
+ "model:string",
14
+ "tools:string"
15
+ ],
16
+ "defaults": {
17
+ "artifact_format": "Markdown sections: Summary, Findings, Evidence, Risks, Next Actions.",
18
+ "write_mode": "create",
19
+ "tools": ""
20
+ },
21
+ "artifacts": {
22
+ "artifact": "{artifact_path}"
23
+ },
24
+ "template": [
25
+ {
26
+ "name": "normalizer",
27
+ "values": {
28
+ "input": "{input}",
29
+ "format": "{artifact_format}",
30
+ "model": "{model}",
31
+ "tools": "{tools}"
32
+ }
33
+ },
34
+ {
35
+ "name": "artifact",
36
+ "values": {
37
+ "input": "Use normalized report from stdin.",
38
+ "artifact_path": "{artifact_path}",
39
+ "artifact_format": "{artifact_format}",
40
+ "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.",
41
+ "model": "{model}",
42
+ "tools": "{tools}"
43
+ }
44
+ },
45
+ {
46
+ "name": "writer",
47
+ "values": {
48
+ "artifact_path": "{artifact_path}",
49
+ "mode": "{write_mode}"
50
+ }
51
+ }
52
+ ]
53
+ }
@@ -0,0 +1,63 @@
1
+ #!/usr/bin/env node
2
+
3
+ /** Artifact-owned deterministic manifest and write helpers. */
4
+
5
+ import {
6
+ appendFileSync,
7
+ existsSync,
8
+ mkdirSync,
9
+ readFileSync,
10
+ statSync,
11
+ writeFileSync,
12
+ } from "node:fs";
13
+ import { dirname, resolve } from "node:path";
14
+
15
+ function fail(message) {
16
+ console.error(message);
17
+ process.exit(1);
18
+ }
19
+
20
+ function pathOf(value) {
21
+ return resolve(String(value).replace(/^~(?=\/|$)/, process.env.HOME ?? "~"));
22
+ }
23
+
24
+ function manifest(pathValue, title = "Artifact", status = "draft", summary = "") {
25
+ const path = pathOf(pathValue);
26
+ const exists = existsSync(path);
27
+ const stat = exists ? statSync(path) : undefined;
28
+ console.log(JSON.stringify({
29
+ title,
30
+ status,
31
+ path,
32
+ exists,
33
+ bytes: stat?.size ?? 0,
34
+ modified: stat?.mtime?.toISOString?.() ?? null,
35
+ summary,
36
+ }, null, 2));
37
+ }
38
+
39
+ function write(pathValue, mode = "create") {
40
+ const path = pathOf(pathValue);
41
+ if (!["create", "overwrite", "append"].includes(mode))
42
+ fail(`Invalid artifact write mode: ${mode}`);
43
+ if (mode === "create" && existsSync(path)) fail(`Artifact already exists: ${path}`);
44
+ const content = readFileSync(0, "utf8");
45
+ mkdirSync(dirname(path), { recursive: true });
46
+ if (mode === "append") appendFileSync(path, content);
47
+ else writeFileSync(path, content, "utf8");
48
+ console.log(JSON.stringify({
49
+ path,
50
+ mode,
51
+ bytes: statSync(path).size,
52
+ written: true,
53
+ }, null, 2));
54
+ }
55
+
56
+ const [command, ...args] = process.argv.slice(2);
57
+ try {
58
+ if (command === "manifest") manifest(args[0] ?? "artifact.md", args[1], args[2], args[3]);
59
+ else if (command === "write") write(args[0] ?? "artifact.md", args[1]);
60
+ else fail(`Unknown artifact command: ${command ?? ""}`);
61
+ } catch (error) {
62
+ fail(error instanceof Error ? error.message : String(error));
63
+ }