@openrig/cli 0.4.6 → 0.4.7

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 (352) hide show
  1. package/daemon/assets/guidance/CULTURE-default.md +19 -0
  2. package/daemon/assets/guidance/openrig-start.md +20 -5
  3. package/daemon/assets/plugins/openrig-core/README.md +1 -1
  4. package/daemon/assets/plugins/openrig-core/skills/claude-compaction-restore/SKILL.md +9 -6
  5. package/daemon/assets/plugins/openrig-core/skills/claude-compaction-restore/scripts/precompact-hook.mjs +11 -72
  6. package/daemon/assets/plugins/openrig-core/skills/forming-an-openrig-mental-model/SKILL.md +34 -22
  7. package/daemon/assets/plugins/openrig-core/skills/messaging-the-human/SKILL.md +108 -0
  8. package/daemon/assets/plugins/openrig-core/skills/mission-slice-sop/SKILL.md +11 -14
  9. package/daemon/assets/plugins/openrig-core/skills/openrig-skills/SKILL.md +95 -0
  10. package/daemon/assets/plugins/openrig-core/skills/openrig-user/SKILL.md +175 -105
  11. package/daemon/assets/plugins/openrig-core/skills/queue-handoff/SKILL.md +26 -9
  12. package/daemon/assets/plugins/openrig-core/skills/seat-continuity-and-handover/SKILL.md +11 -9
  13. package/daemon/assets/plugins/openrig-core/skills/session-compaction-and-restore/SKILL.md +162 -0
  14. package/daemon/assets/plugins/openrig-core/skills/software-for-agents/SKILL.md +165 -0
  15. package/daemon/dist/adapters/cmux-transport.d.ts.map +1 -1
  16. package/daemon/dist/adapters/cmux-transport.js +8 -1
  17. package/daemon/dist/adapters/cmux-transport.js.map +1 -1
  18. package/daemon/dist/adapters/cmux.d.ts +9 -0
  19. package/daemon/dist/adapters/cmux.d.ts.map +1 -1
  20. package/daemon/dist/adapters/cmux.js +21 -0
  21. package/daemon/dist/adapters/cmux.js.map +1 -1
  22. package/daemon/dist/adapters/codex-runtime-adapter.d.ts +3 -0
  23. package/daemon/dist/adapters/codex-runtime-adapter.d.ts.map +1 -1
  24. package/daemon/dist/adapters/codex-runtime-adapter.js +20 -4
  25. package/daemon/dist/adapters/codex-runtime-adapter.js.map +1 -1
  26. package/daemon/dist/build-info.js +3 -3
  27. package/daemon/dist/domain/claude-compaction-enforcer.d.ts +3 -0
  28. package/daemon/dist/domain/claude-compaction-enforcer.d.ts.map +1 -1
  29. package/daemon/dist/domain/claude-compaction-enforcer.js +19 -3
  30. package/daemon/dist/domain/claude-compaction-enforcer.js.map +1 -1
  31. package/daemon/dist/domain/cmux-layout-service.d.ts +36 -0
  32. package/daemon/dist/domain/cmux-layout-service.d.ts.map +1 -1
  33. package/daemon/dist/domain/cmux-layout-service.js +100 -28
  34. package/daemon/dist/domain/cmux-layout-service.js.map +1 -1
  35. package/daemon/dist/domain/context-monitor.d.ts +2 -0
  36. package/daemon/dist/domain/context-monitor.d.ts.map +1 -1
  37. package/daemon/dist/domain/context-monitor.js +14 -0
  38. package/daemon/dist/domain/context-monitor.js.map +1 -1
  39. package/daemon/dist/domain/feed/attention-aggregator.js +1 -1
  40. package/daemon/dist/domain/feed/attention-aggregator.js.map +1 -1
  41. package/daemon/dist/domain/hosts/hosts-registry-reader.d.ts.map +1 -1
  42. package/daemon/dist/domain/hosts/hosts-registry-reader.js +12 -10
  43. package/daemon/dist/domain/hosts/hosts-registry-reader.js.map +1 -1
  44. package/daemon/dist/domain/hosts/hosts-registry-writer.d.ts.map +1 -1
  45. package/daemon/dist/domain/hosts/hosts-registry-writer.js +3 -2
  46. package/daemon/dist/domain/hosts/hosts-registry-writer.js.map +1 -1
  47. package/daemon/dist/domain/hosts/read-through.js +1 -1
  48. package/daemon/dist/domain/hosts/read-through.js.map +1 -1
  49. package/daemon/dist/domain/hosts/remote-daemon-http.d.ts.map +1 -1
  50. package/daemon/dist/domain/hosts/remote-daemon-http.js +8 -5
  51. package/daemon/dist/domain/hosts/remote-daemon-http.js.map +1 -1
  52. package/daemon/dist/domain/node-inventory.d.ts +3 -12
  53. package/daemon/dist/domain/node-inventory.d.ts.map +1 -1
  54. package/daemon/dist/domain/node-inventory.js +55 -13
  55. package/daemon/dist/domain/node-inventory.js.map +1 -1
  56. package/daemon/dist/domain/plugin-vendor-service.d.ts +2 -0
  57. package/daemon/dist/domain/plugin-vendor-service.d.ts.map +1 -1
  58. package/daemon/dist/domain/plugin-vendor-service.js +23 -0
  59. package/daemon/dist/domain/plugin-vendor-service.js.map +1 -1
  60. package/daemon/dist/domain/projection-lane.d.ts +7 -0
  61. package/daemon/dist/domain/projection-lane.d.ts.map +1 -0
  62. package/daemon/dist/domain/projection-lane.js +28 -0
  63. package/daemon/dist/domain/projection-lane.js.map +1 -0
  64. package/daemon/dist/domain/ps-projection.d.ts +19 -0
  65. package/daemon/dist/domain/ps-projection.d.ts.map +1 -1
  66. package/daemon/dist/domain/ps-projection.js +46 -6
  67. package/daemon/dist/domain/ps-projection.js.map +1 -1
  68. package/daemon/dist/domain/queue-repository.d.ts +14 -10
  69. package/daemon/dist/domain/queue-repository.d.ts.map +1 -1
  70. package/daemon/dist/domain/queue-repository.js +33 -12
  71. package/daemon/dist/domain/queue-repository.js.map +1 -1
  72. package/daemon/dist/domain/review/compose.d.ts +77 -4
  73. package/daemon/dist/domain/review/compose.d.ts.map +1 -1
  74. package/daemon/dist/domain/review/compose.js +152 -16
  75. package/daemon/dist/domain/review/compose.js.map +1 -1
  76. package/daemon/dist/domain/review/fleet-compose.js +1 -1
  77. package/daemon/dist/domain/review/fleet-compose.js.map +1 -1
  78. package/daemon/dist/domain/review/gather.d.ts +1 -1
  79. package/daemon/dist/domain/review/gather.d.ts.map +1 -1
  80. package/daemon/dist/domain/review/gather.js +92 -67
  81. package/daemon/dist/domain/review/gather.js.map +1 -1
  82. package/daemon/dist/domain/review/proof-io.d.ts +2 -0
  83. package/daemon/dist/domain/review/proof-io.d.ts.map +1 -0
  84. package/daemon/dist/domain/review/proof-io.js +38 -0
  85. package/daemon/dist/domain/review/proof-io.js.map +1 -0
  86. package/daemon/dist/domain/rigspec-instantiator.d.ts.map +1 -1
  87. package/daemon/dist/domain/rigspec-instantiator.js +15 -2
  88. package/daemon/dist/domain/rigspec-instantiator.js.map +1 -1
  89. package/daemon/dist/domain/scope/plan-lock-artifacts.d.ts +8 -0
  90. package/daemon/dist/domain/scope/plan-lock-artifacts.d.ts.map +1 -0
  91. package/daemon/dist/domain/scope/plan-lock-artifacts.js +57 -0
  92. package/daemon/dist/domain/scope/plan-lock-artifacts.js.map +1 -0
  93. package/daemon/dist/domain/scope/scaffold-placeholder.d.ts +38 -0
  94. package/daemon/dist/domain/scope/scaffold-placeholder.d.ts.map +1 -0
  95. package/daemon/dist/domain/scope/scaffold-placeholder.js +98 -0
  96. package/daemon/dist/domain/scope/scaffold-placeholder.js.map +1 -0
  97. package/daemon/dist/domain/scope/scope-approve.d.ts.map +1 -1
  98. package/daemon/dist/domain/scope/scope-approve.js +22 -1
  99. package/daemon/dist/domain/scope/scope-approve.js.map +1 -1
  100. package/daemon/dist/domain/scope/scope-audit.d.ts.map +1 -1
  101. package/daemon/dist/domain/scope/scope-audit.js +57 -20
  102. package/daemon/dist/domain/scope/scope-audit.js.map +1 -1
  103. package/daemon/dist/domain/session-transport.d.ts +17 -0
  104. package/daemon/dist/domain/session-transport.d.ts.map +1 -1
  105. package/daemon/dist/domain/session-transport.js +44 -0
  106. package/daemon/dist/domain/session-transport.js.map +1 -1
  107. package/daemon/dist/domain/slices/qitem-membership.d.ts +17 -0
  108. package/daemon/dist/domain/slices/qitem-membership.d.ts.map +1 -0
  109. package/daemon/dist/domain/slices/qitem-membership.js +60 -0
  110. package/daemon/dist/domain/slices/qitem-membership.js.map +1 -0
  111. package/daemon/dist/domain/slices/slice-detail-projector.d.ts +5 -0
  112. package/daemon/dist/domain/slices/slice-detail-projector.d.ts.map +1 -1
  113. package/daemon/dist/domain/slices/slice-detail-projector.js +157 -11
  114. package/daemon/dist/domain/slices/slice-detail-projector.js.map +1 -1
  115. package/daemon/dist/domain/slices/slice-indexer.d.ts +86 -0
  116. package/daemon/dist/domain/slices/slice-indexer.d.ts.map +1 -1
  117. package/daemon/dist/domain/slices/slice-indexer.js +422 -45
  118. package/daemon/dist/domain/slices/slice-indexer.js.map +1 -1
  119. package/daemon/dist/domain/startup-orchestrator.d.ts +9 -0
  120. package/daemon/dist/domain/startup-orchestrator.d.ts.map +1 -1
  121. package/daemon/dist/domain/startup-orchestrator.js +71 -3
  122. package/daemon/dist/domain/startup-orchestrator.js.map +1 -1
  123. package/daemon/dist/domain/terminal/cmux-provider-adapter.d.ts +12 -11
  124. package/daemon/dist/domain/terminal/cmux-provider-adapter.d.ts.map +1 -1
  125. package/daemon/dist/domain/terminal/cmux-provider-adapter.js +61 -28
  126. package/daemon/dist/domain/terminal/cmux-provider-adapter.js.map +1 -1
  127. package/daemon/dist/domain/terminal/herdr-adapter.d.ts +27 -10
  128. package/daemon/dist/domain/terminal/herdr-adapter.d.ts.map +1 -1
  129. package/daemon/dist/domain/terminal/herdr-adapter.js +74 -33
  130. package/daemon/dist/domain/terminal/herdr-adapter.js.map +1 -1
  131. package/daemon/dist/domain/transcript-capture.d.ts +3 -0
  132. package/daemon/dist/domain/transcript-capture.d.ts.map +1 -1
  133. package/daemon/dist/domain/transcript-capture.js +28 -0
  134. package/daemon/dist/domain/transcript-capture.js.map +1 -1
  135. package/daemon/dist/domain/transcript-store.d.ts +10 -0
  136. package/daemon/dist/domain/transcript-store.d.ts.map +1 -1
  137. package/daemon/dist/domain/transcript-store.js +26 -0
  138. package/daemon/dist/domain/transcript-store.js.map +1 -1
  139. package/daemon/dist/domain/types.d.ts +4 -0
  140. package/daemon/dist/domain/types.d.ts.map +1 -1
  141. package/daemon/dist/domain/types.js.map +1 -1
  142. package/daemon/dist/domain/workspace/default-workspace-scaffold.d.ts.map +1 -1
  143. package/daemon/dist/domain/workspace/default-workspace-scaffold.js +9 -4
  144. package/daemon/dist/domain/workspace/default-workspace-scaffold.js.map +1 -1
  145. package/daemon/dist/domain/workspace/workspace-doctor.js +1 -1
  146. package/daemon/dist/domain/workspace/workspace-doctor.js.map +1 -1
  147. package/daemon/dist/routes/mission-control.js +1 -1
  148. package/daemon/dist/routes/mission-control.js.map +1 -1
  149. package/daemon/dist/routes/missions.d.ts +7 -0
  150. package/daemon/dist/routes/missions.d.ts.map +1 -1
  151. package/daemon/dist/routes/missions.js +6 -1
  152. package/daemon/dist/routes/missions.js.map +1 -1
  153. package/daemon/dist/routes/ps.d.ts.map +1 -1
  154. package/daemon/dist/routes/ps.js +5 -1
  155. package/daemon/dist/routes/ps.js.map +1 -1
  156. package/daemon/dist/routes/queue.d.ts.map +1 -1
  157. package/daemon/dist/routes/queue.js +9 -2
  158. package/daemon/dist/routes/queue.js.map +1 -1
  159. package/daemon/dist/routes/rigs.d.ts.map +1 -1
  160. package/daemon/dist/routes/rigs.js +21 -10
  161. package/daemon/dist/routes/rigs.js.map +1 -1
  162. package/daemon/dist/routes/scope-audit.d.ts.map +1 -1
  163. package/daemon/dist/routes/scope-audit.js +141 -135
  164. package/daemon/dist/routes/scope-audit.js.map +1 -1
  165. package/daemon/dist/routes/sessions.js +2 -1
  166. package/daemon/dist/routes/sessions.js.map +1 -1
  167. package/daemon/dist/routes/slices.d.ts.map +1 -1
  168. package/daemon/dist/routes/slices.js +48 -38
  169. package/daemon/dist/routes/slices.js.map +1 -1
  170. package/daemon/dist/routes/transcripts.d.ts.map +1 -1
  171. package/daemon/dist/routes/transcripts.js +62 -33
  172. package/daemon/dist/routes/transcripts.js.map +1 -1
  173. package/daemon/dist/startup.d.ts.map +1 -1
  174. package/daemon/dist/startup.js +25 -11
  175. package/daemon/dist/startup.js.map +1 -1
  176. package/daemon/docs/reference/agent-startup-guide.md +1 -0
  177. package/daemon/specs/agents/apps/vault-specialist/agent.yaml +2 -1
  178. package/daemon/specs/agents/conveyor/builder/agent.yaml +2 -1
  179. package/daemon/specs/agents/conveyor/lead/agent.yaml +2 -1
  180. package/daemon/specs/agents/conveyor/planner/agent.yaml +2 -1
  181. package/daemon/specs/agents/conveyor/reviewer/agent.yaml +2 -1
  182. package/daemon/specs/agents/design/product-designer/agent.yaml +12 -2
  183. package/daemon/specs/agents/development/implementer/agent.yaml +12 -2
  184. package/daemon/specs/agents/development/qa/agent.yaml +12 -2
  185. package/daemon/specs/agents/development/qa/guidance/role.md +1 -0
  186. package/daemon/specs/agents/factory-rsi/dogfood/agent.yaml +2 -1
  187. package/daemon/specs/agents/factory-rsi/release-manager/agent.yaml +2 -1
  188. package/daemon/specs/agents/orchestration/orchestrator/agent.yaml +12 -2
  189. package/daemon/specs/agents/product-management/pm/agent.yaml +1 -2
  190. package/daemon/specs/agents/research/analyst/agent.yaml +2 -1
  191. package/daemon/specs/agents/research/synthesizer/agent.yaml +2 -1
  192. package/daemon/specs/agents/review/independent-reviewer/agent.yaml +12 -2
  193. package/daemon/specs/agents/shared/agent.yaml +5 -8
  194. package/daemon/specs/agents/shared/runtime/claude-settings.fragment.json +13 -1
  195. package/daemon/specs/agents/shared/skills/core/agent-starters/SKILL.md +132 -0
  196. package/daemon/{assets/plugins/openrig-core/skills → specs/agents/shared/skills/core}/agent-startup-and-context-ingestion/SKILL.md +27 -19
  197. package/daemon/specs/agents/shared/skills/core/attention-queue/SKILL.md +264 -0
  198. package/daemon/specs/agents/shared/skills/core/cross-host-rig-commands/SKILL.md +190 -0
  199. package/daemon/specs/agents/shared/skills/core/human-in-the-loop/SKILL.md +104 -0
  200. package/daemon/specs/agents/shared/skills/core/openrig-architect/SKILL.md +25 -8
  201. package/daemon/specs/agents/shared/skills/core/openrig-cmux/SKILL.md +0 -5
  202. package/daemon/specs/agents/shared/skills/core/openrig-herdr/SKILL.md +1 -6
  203. package/daemon/specs/agents/shared/skills/core/openrig-upgrade/SKILL.md +460 -0
  204. package/daemon/specs/agents/shared/skills/core/rig-bundles-and-shareable-artifacts/SKILL.md +101 -0
  205. package/daemon/specs/agents/shared/skills/core/rig-lifecycle/SKILL.md +22 -11
  206. package/daemon/specs/agents/shared/skills/core/session-source-fork/SKILL.md +160 -0
  207. package/daemon/specs/agents/shared/skills/core/specification-system/SKILL.md +103 -0
  208. package/daemon/specs/agents/shared/skills/core/topology-mutation-and-seat-management/SKILL.md +118 -0
  209. package/daemon/specs/agents/shared/skills/core/watchdog/SKILL.md +125 -0
  210. package/daemon/specs/agents/shared/skills/pods/orchestration-team/SKILL.md +4 -4
  211. package/daemon/specs/agents/shared/skills/pods/review-team/SKILL.md +3 -0
  212. package/daemon/specs/agents/shared/skills/process/brainstorming/OPENRIG.md +3 -3
  213. package/daemon/specs/agents/shared/skills/process/executing-plans/OPENRIG.md +1 -1
  214. package/daemon/specs/agents/shared/skills/process/frontend-design/SKILL.md +6 -3
  215. package/daemon/specs/agents/shared/skills/process/test-driven-development/SKILL.md +1 -1
  216. package/daemon/specs/agents/shared/skills/process/using-superpowers/OPENRIG.md +1 -1
  217. package/daemon/specs/agents/shared/skills/process/verification-before-completion/SKILL.md +12 -2
  218. package/daemon/specs/agents/shared/skills/process/writing-plans/OPENRIG.md +1 -1
  219. package/daemon/specs/rigs/focused/pm-team/CULTURE.md +1 -1
  220. package/daemon/specs/rigs/launch/kernel/agents/advisor/lead/agent.yaml +2 -2
  221. package/daemon/specs/rigs/launch/kernel/agents/advisor/lead/guidance/role.md +5 -4
  222. package/daemon/specs/rigs/launch/kernel/agents/operator/agent/agent.yaml +2 -2
  223. package/daemon/specs/rigs/launch/kernel/agents/operator/agent/guidance/role.md +3 -5
  224. package/daemon/specs/rigs/launch/kernel/agents/queue/worker/agent.yaml +2 -2
  225. package/daemon/specs/rigs/launch/kernel/culture/CULTURE.md +3 -4
  226. package/daemon/specs/rigs/preview/product-team/CULTURE.md +1 -1
  227. package/dist/bin-wrapper.d.ts.map +1 -1
  228. package/dist/bin-wrapper.js +3 -1
  229. package/dist/bin-wrapper.js.map +1 -1
  230. package/dist/build-info.js +3 -3
  231. package/dist/cli-error.d.ts +33 -0
  232. package/dist/cli-error.d.ts.map +1 -0
  233. package/dist/cli-error.js +94 -0
  234. package/dist/cli-error.js.map +1 -0
  235. package/dist/commands/config-init-workspace.js +1 -1
  236. package/dist/commands/doctor.d.ts +1 -1
  237. package/dist/commands/doctor.d.ts.map +1 -1
  238. package/dist/commands/doctor.js +17 -11
  239. package/dist/commands/doctor.js.map +1 -1
  240. package/dist/commands/host.d.ts.map +1 -1
  241. package/dist/commands/host.js +24 -10
  242. package/dist/commands/host.js.map +1 -1
  243. package/dist/commands/proof.js +1 -1
  244. package/dist/commands/proof.js.map +1 -1
  245. package/dist/commands/ps.d.ts.map +1 -1
  246. package/dist/commands/ps.js +16 -2
  247. package/dist/commands/ps.js.map +1 -1
  248. package/dist/commands/queue.d.ts.map +1 -1
  249. package/dist/commands/queue.js +103 -24
  250. package/dist/commands/queue.js.map +1 -1
  251. package/dist/commands/rig.d.ts.map +1 -1
  252. package/dist/commands/rig.js +122 -0
  253. package/dist/commands/rig.js.map +1 -1
  254. package/dist/commands/scope.js +2 -2
  255. package/dist/commands/scope.js.map +1 -1
  256. package/dist/commands/send.d.ts.map +1 -1
  257. package/dist/commands/send.js +118 -24
  258. package/dist/commands/send.js.map +1 -1
  259. package/dist/commands/slack.d.ts +37 -0
  260. package/dist/commands/slack.d.ts.map +1 -0
  261. package/dist/commands/slack.js +274 -0
  262. package/dist/commands/slack.js.map +1 -0
  263. package/dist/commands/ui.d.ts +1 -0
  264. package/dist/commands/ui.d.ts.map +1 -1
  265. package/dist/commands/ui.js +2 -0
  266. package/dist/commands/ui.js.map +1 -1
  267. package/dist/commands/up.js +1 -1
  268. package/dist/commands/up.js.map +1 -1
  269. package/dist/commands/whoami.d.ts.map +1 -1
  270. package/dist/commands/whoami.js +3 -3
  271. package/dist/commands/whoami.js.map +1 -1
  272. package/dist/daemon-lifecycle.d.ts.map +1 -1
  273. package/dist/daemon-lifecycle.js +45 -14
  274. package/dist/daemon-lifecycle.js.map +1 -1
  275. package/dist/host-registry.d.ts +6 -1
  276. package/dist/host-registry.d.ts.map +1 -1
  277. package/dist/host-registry.js +15 -6
  278. package/dist/host-registry.js.map +1 -1
  279. package/dist/index.d.ts +3 -0
  280. package/dist/index.d.ts.map +1 -1
  281. package/dist/index.js +6 -1
  282. package/dist/index.js.map +1 -1
  283. package/dist/lib/scope/scaffold-placeholder.d.ts +38 -0
  284. package/dist/lib/scope/scaffold-placeholder.d.ts.map +1 -0
  285. package/dist/lib/scope/scaffold-placeholder.js +98 -0
  286. package/dist/lib/scope/scaffold-placeholder.js.map +1 -0
  287. package/dist/lib/scope/scope-audit.d.ts.map +1 -1
  288. package/dist/lib/scope/scope-audit.js +57 -20
  289. package/dist/lib/scope/scope-audit.js.map +1 -1
  290. package/dist/lib/scope-templates/backlog-deprecation.md +1 -1
  291. package/dist/lib/scope-templates/backlog-tech-debt.md +1 -1
  292. package/dist/lib/scope-templates/bug-fix.md +1 -1
  293. package/dist/lib/scope-templates/implementation-prd.md +1 -1
  294. package/dist/lib/scope-templates/mission-notes.md +7 -2
  295. package/dist/lib/scope-templates/mission-placeholder.md +1 -1
  296. package/dist/lib/scope-templates/mission-progress.md +1 -1
  297. package/dist/lib/scope-templates/mission-release.md +1 -1
  298. package/dist/lib/scope-templates/placeholder.md +1 -1
  299. package/dist/lib/scope-templates/proof.md +1 -1
  300. package/dist/lib/scope-templates/release-feature.md +1 -1
  301. package/dist/lib/scope-templates/research.md +1 -1
  302. package/dist/lib/scope-templates/slice-progress.md +1 -1
  303. package/dist/remote-host-ops.d.ts.map +1 -1
  304. package/dist/remote-host-ops.js +2 -2
  305. package/dist/remote-host-ops.js.map +1 -1
  306. package/dist/slack/config.d.ts +41 -0
  307. package/dist/slack/config.d.ts.map +1 -0
  308. package/dist/slack/config.js +60 -0
  309. package/dist/slack/config.js.map +1 -0
  310. package/dist/slack/inbound.d.ts +75 -0
  311. package/dist/slack/inbound.d.ts.map +1 -0
  312. package/dist/slack/inbound.js +133 -0
  313. package/dist/slack/inbound.js.map +1 -0
  314. package/dist/slack/message.d.ts +26 -0
  315. package/dist/slack/message.d.ts.map +1 -0
  316. package/dist/slack/message.js +60 -0
  317. package/dist/slack/message.js.map +1 -0
  318. package/dist/slack/outbound.d.ts +39 -0
  319. package/dist/slack/outbound.d.ts.map +1 -0
  320. package/dist/slack/outbound.js +52 -0
  321. package/dist/slack/outbound.js.map +1 -0
  322. package/dist/slack/queue-bridge.d.ts +56 -0
  323. package/dist/slack/queue-bridge.d.ts.map +1 -0
  324. package/dist/slack/queue-bridge.js +114 -0
  325. package/dist/slack/queue-bridge.js.map +1 -0
  326. package/dist/slack/secrets.d.ts +21 -0
  327. package/dist/slack/secrets.d.ts.map +1 -0
  328. package/dist/slack/secrets.js +73 -0
  329. package/dist/slack/secrets.js.map +1 -0
  330. package/dist/slack/slack-api.d.ts +49 -0
  331. package/dist/slack/slack-api.d.ts.map +1 -0
  332. package/dist/slack/slack-api.js +110 -0
  333. package/dist/slack/slack-api.js.map +1 -0
  334. package/dist/slack/state-store.d.ts +62 -0
  335. package/dist/slack/state-store.d.ts.map +1 -0
  336. package/dist/slack/state-store.js +132 -0
  337. package/dist/slack/state-store.js.map +1 -0
  338. package/package.json +1 -1
  339. package/ui/dist/assets/{index-zrFqS7gL.js → index-DkNi0RT8.js} +184 -184
  340. package/ui/dist/assets/index-N-SdPj-I.css +32 -0
  341. package/ui/dist/index.html +2 -2
  342. package/daemon/assets/plugins/openrig-core/skills/openrig-architect/SKILL.md +0 -361
  343. package/daemon/assets/plugins/openrig-core/skills/openrig-cmux/SKILL.md +0 -86
  344. package/daemon/assets/plugins/openrig-core/skills/openrig-herdr/SKILL.md +0 -158
  345. package/daemon/assets/plugins/openrig-core/skills/openrig-operator/SKILL.md +0 -222
  346. package/daemon/docs/reference/product-factory-vps-runbook.md +0 -132
  347. package/daemon/specs/agents/shared/skills/core/mission-slice-sop/SKILL.md +0 -113
  348. package/daemon/specs/agents/shared/skills/core/openrig-installer/SKILL.md +0 -142
  349. package/daemon/specs/agents/shared/skills/core/openrig-operator/SKILL.md +0 -110
  350. package/daemon/specs/agents/shared/skills/core/openrig-user/SKILL.md +0 -1245
  351. package/daemon/specs/agents/shared/skills/core/openrig-user-settings/SKILL.md +0 -153
  352. package/ui/dist/assets/index-CFqxa0zW.css +0 -32
@@ -0,0 +1,49 @@
1
+ export type FetchImpl = (url: string, init?: RequestInit) => Promise<Response>;
2
+ export interface HttpResult {
3
+ ok: boolean;
4
+ status: number;
5
+ error?: string;
6
+ }
7
+ /**
8
+ * Post to a Slack incoming webhook. Fail-VISIBLE (item 3): any non-2xx or
9
+ * transport error returns ok:false with a bounded error string — the caller
10
+ * logs loudly and does NOT mark the alert seen (so it retries, never a silent drop).
11
+ */
12
+ export declare function postWebhook(url: string, payload: unknown, fetchImpl?: FetchImpl, timeoutMs?: number): Promise<HttpResult>;
13
+ export interface WebApiResult {
14
+ ok: boolean;
15
+ status: number;
16
+ grantedScopes: string[];
17
+ json: Record<string, unknown>;
18
+ error?: string;
19
+ }
20
+ /** Call a Slack Web API method (Bearer token) and surface the granted-scope header. */
21
+ export declare function callWebApi(method: string, token: string, body: Record<string, unknown>, fetchImpl?: FetchImpl, timeoutMs?: number): Promise<WebApiResult>;
22
+ /** Item 5: read the ACTUAL granted scopes from the response header (configured != granted). */
23
+ export declare function getGrantedScopes(token: string, fetchImpl?: FetchImpl, timeoutMs?: number): Promise<{
24
+ ok: boolean;
25
+ granted: string[];
26
+ error?: string;
27
+ }>;
28
+ export interface ScopeVerdict {
29
+ ok: boolean;
30
+ granted: string[];
31
+ missing: string[];
32
+ error?: string;
33
+ }
34
+ /** Item 5: verify the token actually HAS the required scopes (from the header, not config). */
35
+ export declare function verifyScopes(token: string, required: string[], fetchImpl?: FetchImpl, timeoutMs?: number): Promise<ScopeVerdict>;
36
+ /** Item 5: verify the bot is actually a MEMBER of the channel before inbound-ready. */
37
+ export declare function verifyChannelMembership(token: string, channel: string, fetchImpl?: FetchImpl, timeoutMs?: number): Promise<{
38
+ ok: boolean;
39
+ isMember: boolean;
40
+ name?: string;
41
+ error?: string;
42
+ }>;
43
+ /** Inbound Socket Mode: open a WebSocket URL via apps.connections.open (app-level xapp token). */
44
+ export declare function openSocketConnection(appToken: string, fetchImpl?: FetchImpl, timeoutMs?: number): Promise<{
45
+ ok: boolean;
46
+ url?: string;
47
+ error?: string;
48
+ }>;
49
+ //# sourceMappingURL=slack-api.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"slack-api.d.ts","sourceRoot":"","sources":["../../src/slack/slack-api.ts"],"names":[],"mappings":"AAcA,MAAM,MAAM,SAAS,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;AAK/E,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,OAAO,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAYD;;;;GAIG;AACH,wBAAsB,WAAW,CAC/B,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,OAAO,EAChB,SAAS,GAAE,SAAwB,EACnC,SAAS,SAAqB,GAC7B,OAAO,CAAC,UAAU,CAAC,CAkBrB;AAED,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,OAAO,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,uFAAuF;AACvF,wBAAsB,UAAU,CAC9B,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,SAAS,GAAE,SAAwB,EACnC,SAAS,SAAqB,GAC7B,OAAO,CAAC,YAAY,CAAC,CA0BvB;AAED,+FAA+F;AAC/F,wBAAsB,gBAAgB,CACpC,KAAK,EAAE,MAAM,EACb,SAAS,GAAE,SAAwB,EACnC,SAAS,SAAqB,GAC7B,OAAO,CAAC;IAAE,EAAE,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,EAAE,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAG7D;AAED,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,OAAO,CAAC;IACZ,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,+FAA+F;AAC/F,wBAAsB,YAAY,CAChC,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,MAAM,EAAE,EAClB,SAAS,GAAE,SAAwB,EACnC,SAAS,SAAqB,GAC7B,OAAO,CAAC,YAAY,CAAC,CAMvB;AAED,uFAAuF;AACvF,wBAAsB,uBAAuB,CAC3C,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,EACf,SAAS,GAAE,SAAwB,EACnC,SAAS,SAAqB,GAC7B,OAAO,CAAC;IAAE,EAAE,EAAE,OAAO,CAAC;IAAC,QAAQ,EAAE,OAAO,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAK5E;AAED,kGAAkG;AAClG,wBAAsB,oBAAoB,CACxC,QAAQ,EAAE,MAAM,EAChB,SAAS,GAAE,SAAwB,EACnC,SAAS,SAAqB,GAC7B,OAAO,CAAC;IAAE,EAAE,EAAE,OAAO,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAIxD"}
@@ -0,0 +1,110 @@
1
+ // Slice-11 slack-connector — Slack HTTP client.
2
+ //
3
+ // `fetch`-based (http/https agnostic + injectable) matching the daemon's
4
+ // WebhookNotificationAdapter + its fake-fetch test pattern; every call is
5
+ // bounded by an explicit timeout with a structured failure result (never
6
+ // throws past the boundary, never hangs) — the remote-daemon-http discipline.
7
+ //
8
+ // Item 5 (the setup-scope trap): Slack's "Add New Webhook" grants ONLY the
9
+ // webhook scope; configured bot scopes are NOT granted until a full reinstall,
10
+ // with no warning. The ONLY proof of granted scopes is the `x-oauth-scopes`
11
+ // RESPONSE HEADER on a real API call — configured != granted. getGrantedScopes()
12
+ // reads exactly that header. Channel membership is likewise verified live
13
+ // (conversations.info.is_member) before declaring inbound ready.
14
+ const defaultFetch = (url, init) => fetch(url, init);
15
+ const DEFAULT_TIMEOUT_MS = 15000;
16
+ async function withTimeout(timeoutMs, run) {
17
+ const ctrl = new AbortController();
18
+ const timer = setTimeout(() => ctrl.abort(new Error(`timeout after ${timeoutMs}ms`)), timeoutMs);
19
+ try {
20
+ return await run(ctrl.signal);
21
+ }
22
+ finally {
23
+ clearTimeout(timer);
24
+ }
25
+ }
26
+ /**
27
+ * Post to a Slack incoming webhook. Fail-VISIBLE (item 3): any non-2xx or
28
+ * transport error returns ok:false with a bounded error string — the caller
29
+ * logs loudly and does NOT mark the alert seen (so it retries, never a silent drop).
30
+ */
31
+ export async function postWebhook(url, payload, fetchImpl = defaultFetch, timeoutMs = DEFAULT_TIMEOUT_MS) {
32
+ try {
33
+ return await withTimeout(timeoutMs, async (signal) => {
34
+ const res = await fetchImpl(url, {
35
+ method: "POST",
36
+ headers: { "content-type": "application/json" },
37
+ body: JSON.stringify(payload),
38
+ signal,
39
+ });
40
+ if (!res.ok) {
41
+ const text = await res.text().catch(() => "");
42
+ return { ok: false, status: res.status, error: `slack ${res.status}: ${text.slice(0, 160)}` };
43
+ }
44
+ return { ok: true, status: res.status };
45
+ });
46
+ }
47
+ catch (e) {
48
+ return { ok: false, status: 0, error: `webhook transport: ${e.message}` };
49
+ }
50
+ }
51
+ /** Call a Slack Web API method (Bearer token) and surface the granted-scope header. */
52
+ export async function callWebApi(method, token, body, fetchImpl = defaultFetch, timeoutMs = DEFAULT_TIMEOUT_MS) {
53
+ try {
54
+ return await withTimeout(timeoutMs, async (signal) => {
55
+ const res = await fetchImpl(`https://slack.com/api/${method}`, {
56
+ method: "POST",
57
+ headers: { authorization: `Bearer ${token}`, "content-type": "application/json; charset=utf-8" },
58
+ body: JSON.stringify(body),
59
+ signal,
60
+ });
61
+ const scopeHeader = res.headers.get("x-oauth-scopes") ?? "";
62
+ const grantedScopes = scopeHeader
63
+ .split(",")
64
+ .map((s) => s.trim())
65
+ .filter(Boolean);
66
+ let json = {};
67
+ try {
68
+ json = (await res.json());
69
+ }
70
+ catch {
71
+ /* non-JSON */
72
+ }
73
+ const ok = res.ok && json.ok === true;
74
+ return { ok, status: res.status, grantedScopes, json, error: ok ? undefined : String(json.error ?? `http ${res.status}`) };
75
+ });
76
+ }
77
+ catch (e) {
78
+ return { ok: false, status: 0, grantedScopes: [], json: {}, error: `web-api transport: ${e.message}` };
79
+ }
80
+ }
81
+ /** Item 5: read the ACTUAL granted scopes from the response header (configured != granted). */
82
+ export async function getGrantedScopes(token, fetchImpl = defaultFetch, timeoutMs = DEFAULT_TIMEOUT_MS) {
83
+ const r = await callWebApi("auth.test", token, {}, fetchImpl, timeoutMs);
84
+ return { ok: r.ok, granted: r.grantedScopes, error: r.error };
85
+ }
86
+ /** Item 5: verify the token actually HAS the required scopes (from the header, not config). */
87
+ export async function verifyScopes(token, required, fetchImpl = defaultFetch, timeoutMs = DEFAULT_TIMEOUT_MS) {
88
+ const g = await getGrantedScopes(token, fetchImpl, timeoutMs);
89
+ if (!g.ok)
90
+ return { ok: false, granted: g.granted, missing: required, error: g.error };
91
+ const grantedSet = new Set(g.granted);
92
+ const missing = required.filter((s) => !grantedSet.has(s));
93
+ return { ok: missing.length === 0, granted: g.granted, missing };
94
+ }
95
+ /** Item 5: verify the bot is actually a MEMBER of the channel before inbound-ready. */
96
+ export async function verifyChannelMembership(token, channel, fetchImpl = defaultFetch, timeoutMs = DEFAULT_TIMEOUT_MS) {
97
+ const r = await callWebApi("conversations.info", token, { channel }, fetchImpl, timeoutMs);
98
+ if (!r.ok)
99
+ return { ok: false, isMember: false, error: r.error };
100
+ const ch = (r.json.channel ?? {});
101
+ return { ok: true, isMember: ch.is_member === true, name: ch.name };
102
+ }
103
+ /** Inbound Socket Mode: open a WebSocket URL via apps.connections.open (app-level xapp token). */
104
+ export async function openSocketConnection(appToken, fetchImpl = defaultFetch, timeoutMs = DEFAULT_TIMEOUT_MS) {
105
+ const r = await callWebApi("apps.connections.open", appToken, {}, fetchImpl, timeoutMs);
106
+ if (!r.ok)
107
+ return { ok: false, error: r.error };
108
+ return { ok: true, url: r.json.url };
109
+ }
110
+ //# sourceMappingURL=slack-api.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"slack-api.js","sourceRoot":"","sources":["../../src/slack/slack-api.ts"],"names":[],"mappings":"AAAA,gDAAgD;AAChD,EAAE;AACF,yEAAyE;AACzE,0EAA0E;AAC1E,yEAAyE;AACzE,8EAA8E;AAC9E,EAAE;AACF,2EAA2E;AAC3E,+EAA+E;AAC/E,4EAA4E;AAC5E,iFAAiF;AACjF,0EAA0E;AAC1E,iEAAiE;AAIjE,MAAM,YAAY,GAAc,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;AAChE,MAAM,kBAAkB,GAAG,KAAK,CAAC;AAQjC,KAAK,UAAU,WAAW,CAAI,SAAiB,EAAE,GAAwC;IACvF,MAAM,IAAI,GAAG,IAAI,eAAe,EAAE,CAAC;IACnC,MAAM,KAAK,GAAG,UAAU,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,iBAAiB,SAAS,IAAI,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC;IACjG,IAAI,CAAC;QACH,OAAO,MAAM,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAChC,CAAC;YAAS,CAAC;QACT,YAAY,CAAC,KAAK,CAAC,CAAC;IACtB,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CA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C,KAAa,EACb,OAAe,EACf,YAAuB,YAAY,EACnC,SAAS,GAAG,kBAAkB;IAE9B,MAAM,CAAC,GAAG,MAAM,UAAU,CAAC,oBAAoB,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC;IAC3F,IAAI,CAAC,CAAC,CAAC,EAAE;QAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC;IACjE,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,IAAI,EAAE,CAA2C,CAAC;IAC5E,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,CAAC,SAAS,KAAK,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,CAAC;AACtE,CAAC;AAED,kGAAkG;AAClG,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,QAAgB,EAChB,YAAuB,YAAY,EACnC,SAAS,GAAG,kBAAkB;IAE9B,MAAM,CAAC,GAAG,MAAM,UAAU,CAAC,uBAAuB,EAAE,QAAQ,EAAE,EAAE,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC;IACxF,IAAI,CAAC,CAAC,CAAC,EAAE;QAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC;IAChD,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,GAAa,EAAE,CAAC;AACjD,CAAC"}
@@ -0,0 +1,62 @@
1
+ export interface StateFsOps {
2
+ readFileSync(p: string): string;
3
+ appendFileSync(p: string, data: string): void;
4
+ writeFileSync(p: string, data: string): void;
5
+ rename(from: string, to: string): void;
6
+ mkdirp(dir: string): void;
7
+ }
8
+ export declare const nodeStateFs: StateFsOps;
9
+ export interface SeenRecord {
10
+ id: string;
11
+ ts: string;
12
+ status: string;
13
+ }
14
+ /**
15
+ * Delivery-dedup log. `load()` reads the durable set from disk; `mark()` appends
16
+ * AFTER the guarded side effect. Idempotent on id: a repeated id collapses in
17
+ * `load()`'s Set, and callers gate the side effect on `!seen.has(id)` so a
18
+ * duplicate is never re-delivered within a run.
19
+ */
20
+ export declare class SeenStore {
21
+ private readonly file;
22
+ private readonly fsops;
23
+ private readonly now;
24
+ constructor(file: string, fsops?: StateFsOps, now?: () => Date);
25
+ load(): Set<string>;
26
+ /** Append a seen record. MUST be called only after the guarded side effect succeeds. */
27
+ mark(id: string, status: string): void;
28
+ /**
29
+ * Seed existing ids as already-seen WITHOUT triggering the side effect
30
+ * (locked item 9: enable-time backlog seeds as history, zero replay storm).
31
+ */
32
+ seed(ids: string[], status?: string): number;
33
+ }
34
+ export interface DeadLetterEntry<T = unknown> {
35
+ ev: T;
36
+ at: string;
37
+ attempts: number;
38
+ }
39
+ /**
40
+ * Inbound never-drop net. Every event that fails to land is appended
41
+ * (attempt-counted) BEFORE the error path returns.
42
+ *
43
+ * INTERRUPTION-SAFE retry (the B2 fix): retry does NOT truncate first. The
44
+ * caller `readAll()`s (non-destructive), attempts each, then `replaceAll()`s the
45
+ * file with ONLY the still-failing entries via an atomic temp-write + rename. So
46
+ * the durable file always reflects the unrecovered set: a crash at ANY point
47
+ * before the rename leaves the ORIGINAL file fully intact (at-least-once — a
48
+ * since-landed event is skipped on re-read via the seen-set, so not even a dup).
49
+ * There is no truncate-before-success window.
50
+ */
51
+ export declare class DeadLetterStore<T = unknown> {
52
+ private readonly file;
53
+ private readonly fsops;
54
+ private readonly now;
55
+ constructor(file: string, fsops?: StateFsOps, now?: () => Date);
56
+ append(ev: T, attempts: number): void;
57
+ /** Non-destructive read of all durable entries. */
58
+ readAll(): DeadLetterEntry<T>[];
59
+ /** Atomically replace the durable set (temp-write + rename). Used after a retry pass. */
60
+ replaceAll(entries: DeadLetterEntry<T>[]): void;
61
+ }
62
+ //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AE,MAAM,CAAC;CAClB;AAED;;;;;;;;;;;GAWG;AACH,qBAAa,eAAe,CAAC,CAAC,GAAG,OAAO;IAEpC,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,GAAG;gBAFH,IAAI,EAAE,MAAM,EACZ,KAAK,GAAE,UAAwB,EAC/B,GAAG,GAAE,MAAM,IAAuB;IAGrD,MAAM,CAAC,EAAE,EAAE,CAAC,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI;IAQrC,mDAAmD;IACnD,OAAO,IAAI,eAAe,CAAC,CAAC,CAAC,EAAE;IAU/B,yFAAyF;IACzF,UAAU,CAAC,OAAO,EAAE,eAAe,CAAC,CAAC,CAAC,EAAE,GAAG,IAAI;CAOhD"}
@@ -0,0 +1,132 @@
1
+ // Slice-11 slack-connector — durable, restart-surviving state.
2
+ //
3
+ // Two append-only JSONL stores, both written to disk so they survive BOTH a
4
+ // connector restart AND a queue-daemon restart (locked item 2 + item 8):
5
+ // - SeenStore : delivery-dedup by id; a line is appended ONLY AFTER the
6
+ // side effect succeeds (outbound: after a 200 from Slack;
7
+ // inbound: after the durable qitem exists). At-least-once —
8
+ // a crash between success and append re-delivers a
9
+ // BYTE-IDENTICAL duplicate next run, never a drop.
10
+ // - DeadLetterStore : the inbound never-drop net. An event that fails to land
11
+ // in the queue is appended (attempt-counted) BEFORE the
12
+ // failure path returns; drain() truncates and hands the
13
+ // lines back so the caller re-appends any that fail again
14
+ // ("zero-drop means zero, not zero-until-the-second-failure").
15
+ //
16
+ // FS + clock are injected so the whole thing is unit-testable with no real disk.
17
+ import fs from "node:fs";
18
+ import path from "node:path";
19
+ export const nodeStateFs = {
20
+ readFileSync: (p) => fs.readFileSync(p, "utf8"),
21
+ appendFileSync: (p, d) => fs.appendFileSync(p, d),
22
+ writeFileSync: (p, d) => fs.writeFileSync(p, d),
23
+ rename: (from, to) => fs.renameSync(from, to),
24
+ mkdirp: (dir) => {
25
+ fs.mkdirSync(dir, { recursive: true });
26
+ },
27
+ };
28
+ function parseLines(raw) {
29
+ return raw
30
+ .trim()
31
+ .split("\n")
32
+ .filter(Boolean)
33
+ .map((l) => {
34
+ try {
35
+ return JSON.parse(l);
36
+ }
37
+ catch {
38
+ return null; // tolerate a torn final line from a crash mid-append
39
+ }
40
+ })
41
+ .filter((x) => x !== null);
42
+ }
43
+ /**
44
+ * Delivery-dedup log. `load()` reads the durable set from disk; `mark()` appends
45
+ * AFTER the guarded side effect. Idempotent on id: a repeated id collapses in
46
+ * `load()`'s Set, and callers gate the side effect on `!seen.has(id)` so a
47
+ * duplicate is never re-delivered within a run.
48
+ */
49
+ export class SeenStore {
50
+ file;
51
+ fsops;
52
+ now;
53
+ constructor(file, fsops = nodeStateFs, now = () => new Date()) {
54
+ this.file = file;
55
+ this.fsops = fsops;
56
+ this.now = now;
57
+ }
58
+ load() {
59
+ let raw;
60
+ try {
61
+ raw = this.fsops.readFileSync(this.file);
62
+ }
63
+ catch {
64
+ return new Set();
65
+ }
66
+ return new Set(parseLines(raw).map((r) => r.id).filter((id) => typeof id === "string"));
67
+ }
68
+ /** Append a seen record. MUST be called only after the guarded side effect succeeds. */
69
+ mark(id, status) {
70
+ this.fsops.mkdirp(path.dirname(this.file));
71
+ this.fsops.appendFileSync(this.file, JSON.stringify({ id, ts: this.now().toISOString(), status }) + "\n");
72
+ }
73
+ /**
74
+ * Seed existing ids as already-seen WITHOUT triggering the side effect
75
+ * (locked item 9: enable-time backlog seeds as history, zero replay storm).
76
+ */
77
+ seed(ids, status = "seeded") {
78
+ if (ids.length === 0)
79
+ return 0;
80
+ this.fsops.mkdirp(path.dirname(this.file));
81
+ const at = this.now().toISOString();
82
+ const chunk = ids.map((id) => JSON.stringify({ id, ts: at, status })).join("\n") + "\n";
83
+ this.fsops.appendFileSync(this.file, chunk);
84
+ return ids.length;
85
+ }
86
+ }
87
+ /**
88
+ * Inbound never-drop net. Every event that fails to land is appended
89
+ * (attempt-counted) BEFORE the error path returns.
90
+ *
91
+ * INTERRUPTION-SAFE retry (the B2 fix): retry does NOT truncate first. The
92
+ * caller `readAll()`s (non-destructive), attempts each, then `replaceAll()`s the
93
+ * file with ONLY the still-failing entries via an atomic temp-write + rename. So
94
+ * the durable file always reflects the unrecovered set: a crash at ANY point
95
+ * before the rename leaves the ORIGINAL file fully intact (at-least-once — a
96
+ * since-landed event is skipped on re-read via the seen-set, so not even a dup).
97
+ * There is no truncate-before-success window.
98
+ */
99
+ export class DeadLetterStore {
100
+ file;
101
+ fsops;
102
+ now;
103
+ constructor(file, fsops = nodeStateFs, now = () => new Date()) {
104
+ this.file = file;
105
+ this.fsops = fsops;
106
+ this.now = now;
107
+ }
108
+ append(ev, attempts) {
109
+ this.fsops.mkdirp(path.dirname(this.file));
110
+ this.fsops.appendFileSync(this.file, JSON.stringify({ ev, at: this.now().toISOString(), attempts }) + "\n");
111
+ }
112
+ /** Non-destructive read of all durable entries. */
113
+ readAll() {
114
+ let raw;
115
+ try {
116
+ raw = this.fsops.readFileSync(this.file);
117
+ }
118
+ catch {
119
+ return [];
120
+ }
121
+ return parseLines(raw);
122
+ }
123
+ /** Atomically replace the durable set (temp-write + rename). Used after a retry pass. */
124
+ replaceAll(entries) {
125
+ this.fsops.mkdirp(path.dirname(this.file));
126
+ const body = entries.map((e) => JSON.stringify(e)).join("\n") + (entries.length ? "\n" : "");
127
+ const tmp = `${this.file}.tmp`;
128
+ this.fsops.writeFileSync(tmp, body);
129
+ this.fsops.rename(tmp, this.file); // atomic: original intact until this instant
130
+ }
131
+ }
132
+ //# sourceMappingURL=state-store.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"state-store.js","sourceRoot":"","sources":["../../src/slack/state-store.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,EAAE;AACF,4EAA4E;AAC5E,yEAAyE;AACzE,8EAA8E;AAC9E,8EAA8E;AAC9E,gFAAgF;AAChF,uEAAuE;AACvE,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,IAAI,CAAC,IAAI,CAAC,CAAC;QAC3C,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,EAAE,CAAC;QACZ,CAAC;QACD,OAAO,UAAU,CAAC,GAAG,CAAyB,CAAC;IACjD,CAAC;IAED,yFAAyF;IACzF,UAAU,CAAC,OAA6B;QACtC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QAC3C,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QAC7F,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,IAAI,MAAM,CAAC;QAC/B,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QACpC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,6CAA6C;IAClF,CAAC;CACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openrig/cli",
3
- "version": "0.4.6",
3
+ "version": "0.4.7",
4
4
  "type": "module",
5
5
  "description": "Local control plane for multi-agent coding topologies",
6
6
  "keywords": [