@openrig/cli 0.6.4 → 0.6.5

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 (986) hide show
  1. package/README.md +384 -0
  2. package/daemon/assets/onboarding/02-self-and-competent-action.md +5 -0
  3. package/daemon/assets/plugins/openrig-core/.claude-plugin/plugin.json +1 -1
  4. package/daemon/assets/plugins/openrig-core/.codex-plugin/plugin.json +1 -1
  5. package/daemon/assets/plugins/openrig-core/hooks/scripts/refocus.cjs +100 -20
  6. package/daemon/assets/plugins/openrig-core/skills/claude-compaction-restore/SKILL.md +201 -132
  7. package/daemon/assets/plugins/openrig-core/skills/claude-compaction-restore/reference/SKILL-v1.md +143 -0
  8. package/daemon/assets/plugins/openrig-core/skills/forming-an-openrig-mental-model/SKILL.md +11 -11
  9. package/daemon/assets/plugins/openrig-core/skills/loading-addressable-markdown/scripts/resolve-markdown.mjs +2 -1
  10. package/daemon/assets/plugins/openrig-core/skills/messaging-the-human/SKILL.md +24 -0
  11. package/daemon/assets/plugins/openrig-core/skills/mission-slice-sop/SKILL.md +2 -2
  12. package/daemon/assets/plugins/openrig-core/skills/openrig-operating-model/SKILL.md +17 -0
  13. package/daemon/assets/plugins/openrig-core/skills/openrig-operating-model/scripts/compose.py +2 -2
  14. package/daemon/assets/plugins/openrig-core/skills/openrig-skills/SKILL.md +6 -0
  15. package/daemon/assets/plugins/openrig-core/skills/openrig-user/SKILL.md +45 -19
  16. package/daemon/assets/plugins/openrig-core/skills/orienting-to-an-inherited-seat/SKILL.md +5 -7
  17. package/daemon/assets/plugins/openrig-core/skills/queue-handoff/SKILL.md +1 -19
  18. package/daemon/assets/plugins/openrig-core/skills/refocusing/SKILL.md +3 -0
  19. package/daemon/assets/plugins/openrig-core/skills/refocusing/scripts/trace-to-root.py +56 -4
  20. package/daemon/assets/plugins/openrig-core/skills/seat-continuity-and-handover/SKILL.md +0 -5
  21. package/daemon/assets/plugins/openrig-core/skills/session-compaction-and-restore/SKILL.md +5 -6
  22. package/daemon/context-packs/help/help.md +9 -4
  23. package/daemon/context-packs/help/manifest.yaml +1 -1
  24. package/daemon/context-packs/onboarding-width/manifest.yaml +1 -1
  25. package/daemon/context-packs/onboarding-width/public-what-you-can-do.md +25 -12
  26. package/daemon/context-packs/reference/getting-started.md +7 -2
  27. package/daemon/context-packs/reference/instance-layout.md +11 -0
  28. package/daemon/context-packs/reference/manifest.yaml +1 -1
  29. package/daemon/context-packs/reference/rig-spec.md +32 -5
  30. package/daemon/context-packs/skills/agent-operated-software/manifest.yaml +1 -1
  31. package/daemon/context-packs/skills/agent-operated-workflows/manifest.yaml +1 -1
  32. package/daemon/context-packs/skills/applying-a-permission-policy/manifest.yaml +1 -1
  33. package/daemon/context-packs/skills/claude-compaction-restore/SKILL.md +201 -132
  34. package/daemon/context-packs/skills/claude-compaction-restore/manifest.yaml +5 -3
  35. package/daemon/context-packs/skills/claude-compaction-restore/reference/SKILL-v1.md +143 -0
  36. package/daemon/context-packs/skills/core/agent-starters/manifest.yaml +1 -1
  37. package/daemon/context-packs/skills/core/agent-startup-and-context-ingestion/manifest.yaml +1 -1
  38. package/daemon/context-packs/skills/core/cross-host-rig-commands/manifest.yaml +1 -1
  39. package/daemon/context-packs/skills/core/human-in-the-loop/manifest.yaml +1 -1
  40. package/daemon/context-packs/skills/core/messaging-the-human/SKILL.md +24 -0
  41. package/daemon/context-packs/skills/core/messaging-the-human/manifest.yaml +1 -1
  42. package/daemon/context-packs/skills/core/openrig-architect/manifest.yaml +1 -1
  43. package/daemon/context-packs/skills/core/openrig-cmux/manifest.yaml +1 -1
  44. package/daemon/context-packs/skills/core/openrig-herdr/manifest.yaml +1 -1
  45. package/daemon/context-packs/skills/core/openrig-skills/SKILL.md +6 -0
  46. package/daemon/context-packs/skills/core/openrig-skills/manifest.yaml +1 -1
  47. package/daemon/context-packs/skills/core/openrig-software-factory/manifest.yaml +1 -1
  48. package/daemon/context-packs/skills/core/openrig-upgrade/manifest.yaml +1 -1
  49. package/daemon/context-packs/skills/core/rig-bundles-and-shareable-artifacts/manifest.yaml +1 -1
  50. package/daemon/context-packs/skills/core/rig-lifecycle/manifest.yaml +1 -1
  51. package/daemon/context-packs/skills/core/session-source-fork/manifest.yaml +1 -1
  52. package/daemon/context-packs/skills/core/specification-system/manifest.yaml +1 -1
  53. package/daemon/context-packs/skills/core/topology-mutation-and-seat-management/SKILL.md +24 -3
  54. package/daemon/context-packs/skills/core/topology-mutation-and-seat-management/manifest.yaml +3 -3
  55. package/daemon/context-packs/skills/core/watchdog/manifest.yaml +1 -1
  56. package/daemon/context-packs/skills/delegating-work/manifest.yaml +1 -1
  57. package/daemon/context-packs/skills/forming-an-openrig-mental-model/SKILL.md +11 -11
  58. package/daemon/context-packs/skills/forming-an-openrig-mental-model/manifest.yaml +1 -1
  59. package/daemon/context-packs/skills/loading-addressable-markdown/manifest.yaml +1 -1
  60. package/daemon/context-packs/skills/loading-addressable-markdown/scripts/resolve-markdown.mjs +2 -1
  61. package/daemon/context-packs/skills/mission-slice-sop/SKILL.md +2 -2
  62. package/daemon/context-packs/skills/mission-slice-sop/manifest.yaml +1 -1
  63. package/daemon/context-packs/skills/openrig-operating-model/SKILL.md +17 -0
  64. package/daemon/context-packs/skills/openrig-operating-model/manifest.yaml +1 -1
  65. package/daemon/context-packs/skills/openrig-operating-model/scripts/compose.py +2 -2
  66. package/daemon/context-packs/skills/openrig-user/SKILL.md +45 -19
  67. package/daemon/context-packs/skills/openrig-user/manifest.yaml +1 -1
  68. package/daemon/context-packs/skills/orienting-to-an-inherited-seat/SKILL.md +5 -7
  69. package/daemon/context-packs/skills/orienting-to-an-inherited-seat/manifest.yaml +1 -1
  70. package/daemon/context-packs/skills/pm/backlog-capture/manifest.yaml +1 -1
  71. package/daemon/context-packs/skills/pm/context-builder/manifest.yaml +1 -1
  72. package/daemon/context-packs/skills/pm/exec-summary/manifest.yaml +1 -1
  73. package/daemon/context-packs/skills/pm/office-hours/manifest.yaml +1 -1
  74. package/daemon/context-packs/skills/pm/plan-review/manifest.yaml +1 -1
  75. package/daemon/context-packs/skills/pm/requirements-writer/manifest.yaml +1 -1
  76. package/daemon/context-packs/skills/pm/ui-mockup/manifest.yaml +1 -1
  77. package/daemon/context-packs/skills/pods/development-team/manifest.yaml +1 -1
  78. package/daemon/context-packs/skills/pods/orchestration-team/manifest.yaml +1 -1
  79. package/daemon/context-packs/skills/pods/oversight-team/manifest.yaml +1 -1
  80. package/daemon/context-packs/skills/pods/review-team/manifest.yaml +1 -1
  81. package/daemon/context-packs/skills/process/agent-browser/manifest.yaml +1 -1
  82. package/daemon/context-packs/skills/process/context-engineering/manifest.yaml +1 -1
  83. package/daemon/context-packs/skills/process/dogfood/manifest.yaml +1 -1
  84. package/daemon/context-packs/skills/process/frontend-design/manifest.yaml +1 -1
  85. package/daemon/context-packs/skills/process/systematic-debugging/manifest.yaml +1 -1
  86. package/daemon/context-packs/skills/process/test-driven-development/manifest.yaml +1 -1
  87. package/daemon/context-packs/skills/process/verification-before-completion/manifest.yaml +1 -1
  88. package/daemon/context-packs/skills/queue-handoff/SKILL.md +1 -19
  89. package/daemon/context-packs/skills/queue-handoff/manifest.yaml +1 -1
  90. package/daemon/context-packs/skills/refocusing/SKILL.md +3 -0
  91. package/daemon/context-packs/skills/refocusing/manifest.yaml +1 -1
  92. package/daemon/context-packs/skills/refocusing/scripts/trace-to-root.py +56 -4
  93. package/daemon/context-packs/skills/retiring-and-inheriting-a-seat/manifest.yaml +1 -1
  94. package/daemon/context-packs/skills/seat-continuity-and-handover/SKILL.md +0 -5
  95. package/daemon/context-packs/skills/seat-continuity-and-handover/manifest.yaml +1 -1
  96. package/daemon/context-packs/skills/session-compaction-and-restore/SKILL.md +5 -6
  97. package/daemon/context-packs/skills/session-compaction-and-restore/manifest.yaml +1 -1
  98. package/daemon/context-packs/skills/software-for-agents/manifest.yaml +1 -1
  99. package/daemon/context-packs/world-example/manifest.yaml +1 -1
  100. package/daemon/context-packs/world-public/manifest.yaml +1 -1
  101. package/daemon/dist/adapters/claude-code-adapter.d.ts +17 -3
  102. package/daemon/dist/adapters/claude-code-adapter.d.ts.map +1 -1
  103. package/daemon/dist/adapters/claude-code-adapter.js +157 -53
  104. package/daemon/dist/adapters/claude-code-adapter.js.map +1 -1
  105. package/daemon/dist/adapters/claude-resume.d.ts +7 -1
  106. package/daemon/dist/adapters/claude-resume.d.ts.map +1 -1
  107. package/daemon/dist/adapters/claude-resume.js +39 -8
  108. package/daemon/dist/adapters/claude-resume.js.map +1 -1
  109. package/daemon/dist/adapters/codex-resume.d.ts +7 -1
  110. package/daemon/dist/adapters/codex-resume.d.ts.map +1 -1
  111. package/daemon/dist/adapters/codex-resume.js +14 -6
  112. package/daemon/dist/adapters/codex-resume.js.map +1 -1
  113. package/daemon/dist/adapters/codex-runtime-adapter.d.ts +8 -0
  114. package/daemon/dist/adapters/codex-runtime-adapter.d.ts.map +1 -1
  115. package/daemon/dist/adapters/codex-runtime-adapter.js +34 -12
  116. package/daemon/dist/adapters/codex-runtime-adapter.js.map +1 -1
  117. package/daemon/dist/adapters/compose-services-adapter.d.ts +2 -1
  118. package/daemon/dist/adapters/compose-services-adapter.d.ts.map +1 -1
  119. package/daemon/dist/adapters/compose-services-adapter.js +5 -2
  120. package/daemon/dist/adapters/compose-services-adapter.js.map +1 -1
  121. package/daemon/dist/adapters/daemon-url.d.ts +7 -0
  122. package/daemon/dist/adapters/daemon-url.d.ts.map +1 -0
  123. package/daemon/dist/adapters/daemon-url.js +12 -0
  124. package/daemon/dist/adapters/daemon-url.js.map +1 -0
  125. package/daemon/dist/adapters/omp-resume.d.ts +6 -0
  126. package/daemon/dist/adapters/omp-resume.d.ts.map +1 -0
  127. package/daemon/dist/adapters/omp-resume.js +6 -0
  128. package/daemon/dist/adapters/omp-resume.js.map +1 -0
  129. package/daemon/dist/adapters/omp-runtime-adapter.d.ts +10 -0
  130. package/daemon/dist/adapters/omp-runtime-adapter.d.ts.map +1 -0
  131. package/daemon/dist/adapters/omp-runtime-adapter.js +16 -0
  132. package/daemon/dist/adapters/omp-runtime-adapter.js.map +1 -0
  133. package/daemon/dist/adapters/pi-resume.d.ts +4 -0
  134. package/daemon/dist/adapters/pi-resume.d.ts.map +1 -1
  135. package/daemon/dist/adapters/pi-resume.js +20 -18
  136. package/daemon/dist/adapters/pi-resume.js.map +1 -1
  137. package/daemon/dist/adapters/pi-runner-protocol.d.ts +14 -2
  138. package/daemon/dist/adapters/pi-runner-protocol.d.ts.map +1 -1
  139. package/daemon/dist/adapters/pi-runner-protocol.js +62 -5
  140. package/daemon/dist/adapters/pi-runner-protocol.js.map +1 -1
  141. package/daemon/dist/adapters/pi-runner.d.ts +49 -5
  142. package/daemon/dist/adapters/pi-runner.d.ts.map +1 -1
  143. package/daemon/dist/adapters/pi-runner.js +362 -67
  144. package/daemon/dist/adapters/pi-runner.js.map +1 -1
  145. package/daemon/dist/adapters/pi-runtime-adapter.d.ts +3 -2
  146. package/daemon/dist/adapters/pi-runtime-adapter.d.ts.map +1 -1
  147. package/daemon/dist/adapters/pi-runtime-adapter.js +49 -32
  148. package/daemon/dist/adapters/pi-runtime-adapter.js.map +1 -1
  149. package/daemon/dist/adapters/preflight-exec.d.ts +11 -0
  150. package/daemon/dist/adapters/preflight-exec.d.ts.map +1 -0
  151. package/daemon/dist/adapters/preflight-exec.js +52 -0
  152. package/daemon/dist/adapters/preflight-exec.js.map +1 -0
  153. package/daemon/dist/adapters/stub-runner.d.ts.map +1 -1
  154. package/daemon/dist/adapters/stub-runner.js +3 -1
  155. package/daemon/dist/adapters/stub-runner.js.map +1 -1
  156. package/daemon/dist/adapters/stub-runtime-adapter.js +1 -1
  157. package/daemon/dist/adapters/stub-runtime-adapter.js.map +1 -1
  158. package/daemon/dist/adapters/tmux.d.ts +47 -5
  159. package/daemon/dist/adapters/tmux.d.ts.map +1 -1
  160. package/daemon/dist/adapters/tmux.js +305 -54
  161. package/daemon/dist/adapters/tmux.js.map +1 -1
  162. package/daemon/dist/build-info.js +3 -3
  163. package/daemon/dist/daemon-shutdown.d.ts +19 -0
  164. package/daemon/dist/daemon-shutdown.d.ts.map +1 -1
  165. package/daemon/dist/daemon-shutdown.js +81 -0
  166. package/daemon/dist/daemon-shutdown.js.map +1 -1
  167. package/daemon/dist/db/all-migrations.d.ts +1 -1
  168. package/daemon/dist/db/all-migrations.d.ts.map +1 -1
  169. package/daemon/dist/db/all-migrations.js +10 -2
  170. package/daemon/dist/db/all-migrations.js.map +1 -1
  171. package/daemon/dist/db/migrations/090_human_reply_to.d.ts +3 -0
  172. package/daemon/dist/db/migrations/090_human_reply_to.d.ts.map +1 -0
  173. package/daemon/dist/db/migrations/090_human_reply_to.js +7 -0
  174. package/daemon/dist/db/migrations/090_human_reply_to.js.map +1 -0
  175. package/daemon/dist/db/migrations/091_human_questions.d.ts +3 -0
  176. package/daemon/dist/db/migrations/091_human_questions.d.ts.map +1 -0
  177. package/daemon/dist/db/migrations/091_human_questions.js +9 -0
  178. package/daemon/dist/db/migrations/091_human_questions.js.map +1 -0
  179. package/daemon/dist/db/migrations/092_node_effort.d.ts +3 -0
  180. package/daemon/dist/db/migrations/092_node_effort.d.ts.map +1 -0
  181. package/daemon/dist/db/migrations/092_node_effort.js +8 -0
  182. package/daemon/dist/db/migrations/092_node_effort.js.map +1 -0
  183. package/daemon/dist/db/migrations/094_usage_samples_latest_indexes.d.ts +3 -0
  184. package/daemon/dist/db/migrations/094_usage_samples_latest_indexes.d.ts.map +1 -0
  185. package/daemon/dist/db/migrations/094_usage_samples_latest_indexes.js +12 -0
  186. package/daemon/dist/db/migrations/094_usage_samples_latest_indexes.js.map +1 -0
  187. package/daemon/dist/domain/activity-endpoint.d.ts.map +1 -1
  188. package/daemon/dist/domain/activity-endpoint.js +3 -1
  189. package/daemon/dist/domain/activity-endpoint.js.map +1 -1
  190. package/daemon/dist/domain/agent-activity-store.d.ts +3 -1
  191. package/daemon/dist/domain/agent-activity-store.d.ts.map +1 -1
  192. package/daemon/dist/domain/agent-activity-store.js +13 -3
  193. package/daemon/dist/domain/agent-activity-store.js.map +1 -1
  194. package/daemon/dist/domain/agent-images/agent-image-library-service.d.ts.map +1 -1
  195. package/daemon/dist/domain/agent-images/agent-image-library-service.js +76 -56
  196. package/daemon/dist/domain/agent-images/agent-image-library-service.js.map +1 -1
  197. package/daemon/dist/domain/agent-manifest.d.ts.map +1 -1
  198. package/daemon/dist/domain/agent-manifest.js +24 -3
  199. package/daemon/dist/domain/agent-manifest.js.map +1 -1
  200. package/daemon/dist/domain/bootstrap-orchestrator.d.ts.map +1 -1
  201. package/daemon/dist/domain/bootstrap-orchestrator.js +3 -2
  202. package/daemon/dist/domain/bootstrap-orchestrator.js.map +1 -1
  203. package/daemon/dist/domain/bundle-archive.d.ts.map +1 -1
  204. package/daemon/dist/domain/bundle-archive.js +25 -5
  205. package/daemon/dist/domain/bundle-archive.js.map +1 -1
  206. package/daemon/dist/domain/chat-repository.d.ts.map +1 -1
  207. package/daemon/dist/domain/chat-repository.js +3 -1
  208. package/daemon/dist/domain/chat-repository.js.map +1 -1
  209. package/daemon/dist/domain/checkpoint-store.d.ts.map +1 -1
  210. package/daemon/dist/domain/checkpoint-store.js +2 -2
  211. package/daemon/dist/domain/checkpoint-store.js.map +1 -1
  212. package/daemon/dist/domain/claim-service.d.ts +7 -0
  213. package/daemon/dist/domain/claim-service.d.ts.map +1 -1
  214. package/daemon/dist/domain/claim-service.js +6 -2
  215. package/daemon/dist/domain/claim-service.js.map +1 -1
  216. package/daemon/dist/domain/claude-compaction-enforcer.d.ts +35 -12
  217. package/daemon/dist/domain/claude-compaction-enforcer.d.ts.map +1 -1
  218. package/daemon/dist/domain/claude-compaction-enforcer.js +256 -128
  219. package/daemon/dist/domain/claude-compaction-enforcer.js.map +1 -1
  220. package/daemon/dist/domain/claude-managed-launch.d.ts +13 -0
  221. package/daemon/dist/domain/claude-managed-launch.d.ts.map +1 -1
  222. package/daemon/dist/domain/claude-managed-launch.js +31 -4
  223. package/daemon/dist/domain/claude-managed-launch.js.map +1 -1
  224. package/daemon/dist/domain/codex-daemon-support.d.ts +1 -1
  225. package/daemon/dist/domain/codex-daemon-support.d.ts.map +1 -1
  226. package/daemon/dist/domain/codex-daemon-support.js +2 -2
  227. package/daemon/dist/domain/codex-daemon-support.js.map +1 -1
  228. package/daemon/dist/domain/codex-network-default.d.ts +42 -0
  229. package/daemon/dist/domain/codex-network-default.d.ts.map +1 -0
  230. package/daemon/dist/domain/codex-network-default.js +230 -0
  231. package/daemon/dist/domain/codex-network-default.js.map +1 -0
  232. package/daemon/dist/domain/codex-profile-preflight.d.ts +1 -1
  233. package/daemon/dist/domain/codex-profile-preflight.d.ts.map +1 -1
  234. package/daemon/dist/domain/codex-profile-preflight.js +3 -3
  235. package/daemon/dist/domain/codex-profile-preflight.js.map +1 -1
  236. package/daemon/dist/domain/codex-thread-id.d.ts +4 -2
  237. package/daemon/dist/domain/codex-thread-id.d.ts.map +1 -1
  238. package/daemon/dist/domain/codex-thread-id.js +10 -6
  239. package/daemon/dist/domain/codex-thread-id.js.map +1 -1
  240. package/daemon/dist/domain/context-monitor.d.ts.map +1 -1
  241. package/daemon/dist/domain/context-monitor.js +2 -1
  242. package/daemon/dist/domain/context-monitor.js.map +1 -1
  243. package/daemon/dist/domain/context-packs/context-pack-library-service.d.ts.map +1 -1
  244. package/daemon/dist/domain/context-packs/context-pack-library-service.js +13 -2
  245. package/daemon/dist/domain/context-packs/context-pack-library-service.js.map +1 -1
  246. package/daemon/dist/domain/context-packs/profile-composer.d.ts +5 -0
  247. package/daemon/dist/domain/context-packs/profile-composer.d.ts.map +1 -1
  248. package/daemon/dist/domain/context-packs/profile-composer.js +30 -15
  249. package/daemon/dist/domain/context-packs/profile-composer.js.map +1 -1
  250. package/daemon/dist/domain/context-packs/profile-source-resolver.d.ts +10 -0
  251. package/daemon/dist/domain/context-packs/profile-source-resolver.d.ts.map +1 -1
  252. package/daemon/dist/domain/context-packs/profile-source-resolver.js +43 -8
  253. package/daemon/dist/domain/context-packs/profile-source-resolver.js.map +1 -1
  254. package/daemon/dist/domain/context-packs/seat-recap-store.d.ts.map +1 -1
  255. package/daemon/dist/domain/context-packs/seat-recap-store.js +73 -16
  256. package/daemon/dist/domain/context-packs/seat-recap-store.js.map +1 -1
  257. package/daemon/dist/domain/context-usage-store.d.ts +3 -0
  258. package/daemon/dist/domain/context-usage-store.d.ts.map +1 -1
  259. package/daemon/dist/domain/context-usage-store.js +4 -2
  260. package/daemon/dist/domain/context-usage-store.js.map +1 -1
  261. package/daemon/dist/domain/crash-cart-detect.d.ts.map +1 -1
  262. package/daemon/dist/domain/crash-cart-detect.js +2 -1
  263. package/daemon/dist/domain/crash-cart-detect.js.map +1 -1
  264. package/daemon/dist/domain/crash-cart-discovery.d.ts.map +1 -1
  265. package/daemon/dist/domain/crash-cart-discovery.js +4 -2
  266. package/daemon/dist/domain/crash-cart-discovery.js.map +1 -1
  267. package/daemon/dist/domain/current-work.d.ts +17 -0
  268. package/daemon/dist/domain/current-work.d.ts.map +1 -1
  269. package/daemon/dist/domain/current-work.js +46 -0
  270. package/daemon/dist/domain/current-work.js.map +1 -1
  271. package/daemon/dist/domain/cwd-resolution.js +1 -1
  272. package/daemon/dist/domain/cwd-resolution.js.map +1 -1
  273. package/daemon/dist/domain/daemon-url.d.ts +7 -0
  274. package/daemon/dist/domain/daemon-url.d.ts.map +1 -0
  275. package/daemon/dist/domain/daemon-url.js +12 -0
  276. package/daemon/dist/domain/daemon-url.js.map +1 -0
  277. package/daemon/dist/domain/discovery-types.d.ts +1 -1
  278. package/daemon/dist/domain/discovery-types.d.ts.map +1 -1
  279. package/daemon/dist/domain/event-bus.d.ts +1 -0
  280. package/daemon/dist/domain/event-bus.d.ts.map +1 -1
  281. package/daemon/dist/domain/event-bus.js +18 -7
  282. package/daemon/dist/domain/event-bus.js.map +1 -1
  283. package/daemon/dist/domain/execution-view.d.ts +3 -3
  284. package/daemon/dist/domain/execution-view.d.ts.map +1 -1
  285. package/daemon/dist/domain/execution-view.js +116 -93
  286. package/daemon/dist/domain/execution-view.js.map +1 -1
  287. package/daemon/dist/domain/gateway/operator-delivery-engine.d.ts +9 -7
  288. package/daemon/dist/domain/gateway/operator-delivery-engine.d.ts.map +1 -1
  289. package/daemon/dist/domain/gateway/operator-delivery-engine.js +38 -16
  290. package/daemon/dist/domain/gateway/operator-delivery-engine.js.map +1 -1
  291. package/daemon/dist/domain/gateway/slack/inbound.d.ts +71 -3
  292. package/daemon/dist/domain/gateway/slack/inbound.d.ts.map +1 -1
  293. package/daemon/dist/domain/gateway/slack/inbound.js +145 -11
  294. package/daemon/dist/domain/gateway/slack/inbound.js.map +1 -1
  295. package/daemon/dist/domain/gateway/slack/manifest.js +1 -1
  296. package/daemon/dist/domain/gateway/slack/manifest.js.map +1 -1
  297. package/daemon/dist/domain/gateway/slack/message.d.ts +17 -0
  298. package/daemon/dist/domain/gateway/slack/message.d.ts.map +1 -1
  299. package/daemon/dist/domain/gateway/slack/message.js +77 -3
  300. package/daemon/dist/domain/gateway/slack/message.js.map +1 -1
  301. package/daemon/dist/domain/gateway/slack/outbound-driver.d.ts +3 -0
  302. package/daemon/dist/domain/gateway/slack/outbound-driver.d.ts.map +1 -1
  303. package/daemon/dist/domain/gateway/slack/outbound-driver.js +2 -0
  304. package/daemon/dist/domain/gateway/slack/outbound-driver.js.map +1 -1
  305. package/daemon/dist/domain/gateway/slack/queue-access.d.ts +3 -0
  306. package/daemon/dist/domain/gateway/slack/queue-access.d.ts.map +1 -1
  307. package/daemon/dist/domain/gateway/slack/queue-access.js +15 -5
  308. package/daemon/dist/domain/gateway/slack/queue-access.js.map +1 -1
  309. package/daemon/dist/domain/gateway/slack/secrets.d.ts.map +1 -1
  310. package/daemon/dist/domain/gateway/slack/secrets.js +5 -4
  311. package/daemon/dist/domain/gateway/slack/secrets.js.map +1 -1
  312. package/daemon/dist/domain/gateway/slack/slack-api.d.ts +16 -10
  313. package/daemon/dist/domain/gateway/slack/slack-api.d.ts.map +1 -1
  314. package/daemon/dist/domain/gateway/slack/slack-api.js +91 -23
  315. package/daemon/dist/domain/gateway/slack/slack-api.js.map +1 -1
  316. package/daemon/dist/domain/gateway/slack/slack-delivery.d.ts +33 -10
  317. package/daemon/dist/domain/gateway/slack/slack-delivery.d.ts.map +1 -1
  318. package/daemon/dist/domain/gateway/slack/slack-delivery.js +107 -26
  319. package/daemon/dist/domain/gateway/slack/slack-delivery.js.map +1 -1
  320. package/daemon/dist/domain/gateway/slack/slack-subsystem.d.ts +1 -1
  321. package/daemon/dist/domain/gateway/slack/slack-subsystem.d.ts.map +1 -1
  322. package/daemon/dist/domain/gateway/slack/slack-subsystem.js +114 -27
  323. package/daemon/dist/domain/gateway/slack/slack-subsystem.js.map +1 -1
  324. package/daemon/dist/domain/gateway/slack/socket-inbound.d.ts.map +1 -1
  325. package/daemon/dist/domain/gateway/slack/socket-inbound.js +3 -0
  326. package/daemon/dist/domain/gateway/slack/socket-inbound.js.map +1 -1
  327. package/daemon/dist/domain/gateway/slack/state-store.d.ts +3 -0
  328. package/daemon/dist/domain/gateway/slack/state-store.d.ts.map +1 -1
  329. package/daemon/dist/domain/gateway/slack/state-store.js +18 -0
  330. package/daemon/dist/domain/gateway/slack/state-store.js.map +1 -1
  331. package/daemon/dist/domain/gateway/slack/thread-routing.d.ts.map +1 -1
  332. package/daemon/dist/domain/gateway/slack/thread-routing.js +7 -2
  333. package/daemon/dist/domain/gateway/slack/thread-routing.js.map +1 -1
  334. package/daemon/dist/domain/gateway/slack/thread-seat-map.d.ts +3 -0
  335. package/daemon/dist/domain/gateway/slack/thread-seat-map.d.ts.map +1 -1
  336. package/daemon/dist/domain/gateway/slack/thread-seat-map.js +14 -2
  337. package/daemon/dist/domain/gateway/slack/thread-seat-map.js.map +1 -1
  338. package/daemon/dist/domain/graph-projection.d.ts.map +1 -1
  339. package/daemon/dist/domain/graph-projection.js +1 -0
  340. package/daemon/dist/domain/graph-projection.js.map +1 -1
  341. package/daemon/dist/domain/health-checkpoints.d.ts +2 -0
  342. package/daemon/dist/domain/health-checkpoints.d.ts.map +1 -1
  343. package/daemon/dist/domain/health-checkpoints.js +2 -0
  344. package/daemon/dist/domain/health-checkpoints.js.map +1 -1
  345. package/daemon/dist/domain/health-detectors.d.ts +32 -1
  346. package/daemon/dist/domain/health-detectors.d.ts.map +1 -1
  347. package/daemon/dist/domain/health-detectors.js +40 -9
  348. package/daemon/dist/domain/health-detectors.js.map +1 -1
  349. package/daemon/dist/domain/health-diagnosis.d.ts +3 -1
  350. package/daemon/dist/domain/health-diagnosis.d.ts.map +1 -1
  351. package/daemon/dist/domain/health-diagnosis.js +6 -3
  352. package/daemon/dist/domain/health-diagnosis.js.map +1 -1
  353. package/daemon/dist/domain/health-passive-ceremony.d.ts +5 -1
  354. package/daemon/dist/domain/health-passive-ceremony.d.ts.map +1 -1
  355. package/daemon/dist/domain/health-passive-ceremony.js +20 -4
  356. package/daemon/dist/domain/health-passive-ceremony.js.map +1 -1
  357. package/daemon/dist/domain/hosts/remote-daemon-http.d.ts +3 -1
  358. package/daemon/dist/domain/hosts/remote-daemon-http.d.ts.map +1 -1
  359. package/daemon/dist/domain/hosts/remote-daemon-http.js +10 -3
  360. package/daemon/dist/domain/hosts/remote-daemon-http.js.map +1 -1
  361. package/daemon/dist/domain/human-questions.d.ts +41 -0
  362. package/daemon/dist/domain/human-questions.d.ts.map +1 -0
  363. package/daemon/dist/domain/human-questions.js +81 -0
  364. package/daemon/dist/domain/human-questions.js.map +1 -0
  365. package/daemon/dist/domain/markdown-address.js +1 -1
  366. package/daemon/dist/domain/markdown-address.js.map +1 -1
  367. package/daemon/dist/domain/mission-control/audit-browse.d.ts +5 -0
  368. package/daemon/dist/domain/mission-control/audit-browse.d.ts.map +1 -1
  369. package/daemon/dist/domain/mission-control/audit-browse.js +11 -1
  370. package/daemon/dist/domain/mission-control/audit-browse.js.map +1 -1
  371. package/daemon/dist/domain/mission-control/mission-control-fleet-cli-capability.d.ts +25 -63
  372. package/daemon/dist/domain/mission-control/mission-control-fleet-cli-capability.d.ts.map +1 -1
  373. package/daemon/dist/domain/mission-control/mission-control-fleet-cli-capability.js +34 -100
  374. package/daemon/dist/domain/mission-control/mission-control-fleet-cli-capability.js.map +1 -1
  375. package/daemon/dist/domain/mission-control/mission-control-read-layer.d.ts +1 -0
  376. package/daemon/dist/domain/mission-control/mission-control-read-layer.d.ts.map +1 -1
  377. package/daemon/dist/domain/mission-control/mission-control-read-layer.js +6 -3
  378. package/daemon/dist/domain/mission-control/mission-control-read-layer.js.map +1 -1
  379. package/daemon/dist/domain/mission-control/notification-adapter-ntfy.d.ts +5 -0
  380. package/daemon/dist/domain/mission-control/notification-adapter-ntfy.d.ts.map +1 -1
  381. package/daemon/dist/domain/mission-control/notification-adapter-ntfy.js +33 -2
  382. package/daemon/dist/domain/mission-control/notification-adapter-ntfy.js.map +1 -1
  383. package/daemon/dist/domain/mission-control/notification-adapter-types.d.ts +2 -0
  384. package/daemon/dist/domain/mission-control/notification-adapter-types.d.ts.map +1 -1
  385. package/daemon/dist/domain/mission-control/notification-adapter-webhook.d.ts +4 -0
  386. package/daemon/dist/domain/mission-control/notification-adapter-webhook.d.ts.map +1 -1
  387. package/daemon/dist/domain/mission-control/notification-adapter-webhook.js +33 -2
  388. package/daemon/dist/domain/mission-control/notification-adapter-webhook.js.map +1 -1
  389. package/daemon/dist/domain/mission-control/outbound-url-validator.d.ts +27 -0
  390. package/daemon/dist/domain/mission-control/outbound-url-validator.d.ts.map +1 -0
  391. package/daemon/dist/domain/mission-control/outbound-url-validator.js +60 -0
  392. package/daemon/dist/domain/mission-control/outbound-url-validator.js.map +1 -0
  393. package/daemon/dist/domain/native-process-lineage.d.ts +9 -2
  394. package/daemon/dist/domain/native-process-lineage.d.ts.map +1 -1
  395. package/daemon/dist/domain/native-process-lineage.js +104 -11
  396. package/daemon/dist/domain/native-process-lineage.js.map +1 -1
  397. package/daemon/dist/domain/native-resume-probe.d.ts +5 -1
  398. package/daemon/dist/domain/native-resume-probe.d.ts.map +1 -1
  399. package/daemon/dist/domain/native-resume-probe.js +17 -4
  400. package/daemon/dist/domain/native-resume-probe.js.map +1 -1
  401. package/daemon/dist/domain/node-inventory.d.ts.map +1 -1
  402. package/daemon/dist/domain/node-inventory.js +91 -44
  403. package/daemon/dist/domain/node-inventory.js.map +1 -1
  404. package/daemon/dist/domain/node-launcher.d.ts +4 -0
  405. package/daemon/dist/domain/node-launcher.d.ts.map +1 -1
  406. package/daemon/dist/domain/node-launcher.js +4 -1
  407. package/daemon/dist/domain/node-launcher.js.map +1 -1
  408. package/daemon/dist/domain/periodic-snapshot-scheduler.d.ts +1 -0
  409. package/daemon/dist/domain/periodic-snapshot-scheduler.d.ts.map +1 -1
  410. package/daemon/dist/domain/periodic-snapshot-scheduler.js +25 -0
  411. package/daemon/dist/domain/periodic-snapshot-scheduler.js.map +1 -1
  412. package/daemon/dist/domain/permission-drift.d.ts +1 -0
  413. package/daemon/dist/domain/permission-drift.d.ts.map +1 -1
  414. package/daemon/dist/domain/permission-drift.js +13 -1
  415. package/daemon/dist/domain/permission-drift.js.map +1 -1
  416. package/daemon/dist/domain/plugin-discovery-service.d.ts +5 -6
  417. package/daemon/dist/domain/plugin-discovery-service.d.ts.map +1 -1
  418. package/daemon/dist/domain/plugin-discovery-service.js +14 -8
  419. package/daemon/dist/domain/plugin-discovery-service.js.map +1 -1
  420. package/daemon/dist/domain/pod-bundle-assembler.d.ts +6 -2
  421. package/daemon/dist/domain/pod-bundle-assembler.d.ts.map +1 -1
  422. package/daemon/dist/domain/pod-bundle-assembler.js +58 -15
  423. package/daemon/dist/domain/pod-bundle-assembler.js.map +1 -1
  424. package/daemon/dist/domain/policies/parked-owner-consumer.d.ts +6 -0
  425. package/daemon/dist/domain/policies/parked-owner-consumer.d.ts.map +1 -1
  426. package/daemon/dist/domain/policies/parked-owner-consumer.js +11 -0
  427. package/daemon/dist/domain/policies/parked-owner-consumer.js.map +1 -1
  428. package/daemon/dist/domain/profile-resolver.d.ts +1 -0
  429. package/daemon/dist/domain/profile-resolver.d.ts.map +1 -1
  430. package/daemon/dist/domain/profile-resolver.js +7 -0
  431. package/daemon/dist/domain/profile-resolver.js.map +1 -1
  432. package/daemon/dist/domain/project-lifecycle-compiler.d.ts.map +1 -1
  433. package/daemon/dist/domain/project-lifecycle-compiler.js +10 -2
  434. package/daemon/dist/domain/project-lifecycle-compiler.js.map +1 -1
  435. package/daemon/dist/domain/projection-planner.d.ts.map +1 -1
  436. package/daemon/dist/domain/projection-planner.js +14 -5
  437. package/daemon/dist/domain/projection-planner.js.map +1 -1
  438. package/daemon/dist/domain/proof/judgments.d.ts +3 -0
  439. package/daemon/dist/domain/proof/judgments.d.ts.map +1 -1
  440. package/daemon/dist/domain/proof/judgments.js +13 -8
  441. package/daemon/dist/domain/proof/judgments.js.map +1 -1
  442. package/daemon/dist/domain/proof/source-watch.d.ts.map +1 -1
  443. package/daemon/dist/domain/proof/source-watch.js +45 -27
  444. package/daemon/dist/domain/proof/source-watch.js.map +1 -1
  445. package/daemon/dist/domain/provider/host-usage-rollup.js +9 -5
  446. package/daemon/dist/domain/provider/host-usage-rollup.js.map +1 -1
  447. package/daemon/dist/domain/ps-projection.d.ts +22 -3
  448. package/daemon/dist/domain/ps-projection.d.ts.map +1 -1
  449. package/daemon/dist/domain/ps-projection.js +50 -11
  450. package/daemon/dist/domain/ps-projection.js.map +1 -1
  451. package/daemon/dist/domain/queue-recovery.d.ts.map +1 -1
  452. package/daemon/dist/domain/queue-recovery.js +7 -1
  453. package/daemon/dist/domain/queue-recovery.js.map +1 -1
  454. package/daemon/dist/domain/queue-repository.d.ts +98 -6
  455. package/daemon/dist/domain/queue-repository.d.ts.map +1 -1
  456. package/daemon/dist/domain/queue-repository.js +301 -33
  457. package/daemon/dist/domain/queue-repository.js.map +1 -1
  458. package/daemon/dist/domain/queue-stuck-sweep.d.ts +3 -0
  459. package/daemon/dist/domain/queue-stuck-sweep.d.ts.map +1 -1
  460. package/daemon/dist/domain/queue-stuck-sweep.js +111 -26
  461. package/daemon/dist/domain/queue-stuck-sweep.js.map +1 -1
  462. package/daemon/dist/domain/queue-wake-ladder.d.ts +8 -7
  463. package/daemon/dist/domain/queue-wake-ladder.d.ts.map +1 -1
  464. package/daemon/dist/domain/queue-wake-ladder.js +278 -19
  465. package/daemon/dist/domain/queue-wake-ladder.js.map +1 -1
  466. package/daemon/dist/domain/queue-wake-repository.d.ts +10 -9
  467. package/daemon/dist/domain/queue-wake-repository.d.ts.map +1 -1
  468. package/daemon/dist/domain/queue-wake-repository.js +31 -11
  469. package/daemon/dist/domain/queue-wake-repository.js.map +1 -1
  470. package/daemon/dist/domain/reply-to-choice.d.ts +26 -0
  471. package/daemon/dist/domain/reply-to-choice.d.ts.map +1 -0
  472. package/daemon/dist/domain/reply-to-choice.js +45 -0
  473. package/daemon/dist/domain/reply-to-choice.js.map +1 -0
  474. package/daemon/dist/domain/restore-check-service.d.ts +27 -8
  475. package/daemon/dist/domain/restore-check-service.d.ts.map +1 -1
  476. package/daemon/dist/domain/restore-check-service.js +202 -126
  477. package/daemon/dist/domain/restore-check-service.js.map +1 -1
  478. package/daemon/dist/domain/restore-orchestrator.d.ts +3 -2
  479. package/daemon/dist/domain/restore-orchestrator.d.ts.map +1 -1
  480. package/daemon/dist/domain/restore-orchestrator.js +65 -208
  481. package/daemon/dist/domain/restore-orchestrator.js.map +1 -1
  482. package/daemon/dist/domain/restore-plan-preview.d.ts.map +1 -1
  483. package/daemon/dist/domain/restore-plan-preview.js +2 -6
  484. package/daemon/dist/domain/restore-plan-preview.js.map +1 -1
  485. package/daemon/dist/domain/restore-preconditions.d.ts +12 -0
  486. package/daemon/dist/domain/restore-preconditions.d.ts.map +1 -0
  487. package/daemon/dist/domain/restore-preconditions.js +202 -0
  488. package/daemon/dist/domain/restore-preconditions.js.map +1 -0
  489. package/daemon/dist/domain/resume-metadata-refresher.d.ts +20 -4
  490. package/daemon/dist/domain/resume-metadata-refresher.d.ts.map +1 -1
  491. package/daemon/dist/domain/resume-metadata-refresher.js +70 -8
  492. package/daemon/dist/domain/resume-metadata-refresher.js.map +1 -1
  493. package/daemon/dist/domain/resume-token-capture.d.ts +22 -1
  494. package/daemon/dist/domain/resume-token-capture.d.ts.map +1 -1
  495. package/daemon/dist/domain/resume-token-capture.js +32 -4
  496. package/daemon/dist/domain/resume-token-capture.js.map +1 -1
  497. package/daemon/dist/domain/resume-token-validation.d.ts +1 -1
  498. package/daemon/dist/domain/resume-token-validation.d.ts.map +1 -1
  499. package/daemon/dist/domain/resume-token-validation.js +24 -24
  500. package/daemon/dist/domain/resume-token-validation.js.map +1 -1
  501. package/daemon/dist/domain/rig-repository.d.ts +3 -0
  502. package/daemon/dist/domain/rig-repository.d.ts.map +1 -1
  503. package/daemon/dist/domain/rig-repository.js +21 -0
  504. package/daemon/dist/domain/rig-repository.js.map +1 -1
  505. package/daemon/dist/domain/rig-teardown.d.ts +3 -0
  506. package/daemon/dist/domain/rig-teardown.d.ts.map +1 -1
  507. package/daemon/dist/domain/rig-teardown.js +96 -19
  508. package/daemon/dist/domain/rig-teardown.js.map +1 -1
  509. package/daemon/dist/domain/rigspec-codec.d.ts.map +1 -1
  510. package/daemon/dist/domain/rigspec-codec.js +6 -0
  511. package/daemon/dist/domain/rigspec-codec.js.map +1 -1
  512. package/daemon/dist/domain/rigspec-exporter.d.ts.map +1 -1
  513. package/daemon/dist/domain/rigspec-exporter.js +4 -0
  514. package/daemon/dist/domain/rigspec-exporter.js.map +1 -1
  515. package/daemon/dist/domain/rigspec-instantiator.d.ts.map +1 -1
  516. package/daemon/dist/domain/rigspec-instantiator.js +37 -8
  517. package/daemon/dist/domain/rigspec-instantiator.js.map +1 -1
  518. package/daemon/dist/domain/rigspec-preflight.d.ts +2 -0
  519. package/daemon/dist/domain/rigspec-preflight.d.ts.map +1 -1
  520. package/daemon/dist/domain/rigspec-preflight.js +20 -5
  521. package/daemon/dist/domain/rigspec-preflight.js.map +1 -1
  522. package/daemon/dist/domain/rigspec-schema.d.ts.map +1 -1
  523. package/daemon/dist/domain/rigspec-schema.js +14 -2
  524. package/daemon/dist/domain/rigspec-schema.js.map +1 -1
  525. package/daemon/dist/domain/runtime-adapter.d.ts +7 -0
  526. package/daemon/dist/domain/runtime-adapter.d.ts.map +1 -1
  527. package/daemon/dist/domain/runtime-adapter.js.map +1 -1
  528. package/daemon/dist/domain/runtime-verifier.d.ts +3 -1
  529. package/daemon/dist/domain/runtime-verifier.d.ts.map +1 -1
  530. package/daemon/dist/domain/runtime-verifier.js +10 -1
  531. package/daemon/dist/domain/runtime-verifier.js.map +1 -1
  532. package/daemon/dist/domain/scope/scaffold-placeholder.d.ts +4 -4
  533. package/daemon/dist/domain/scope/scaffold-placeholder.d.ts.map +1 -1
  534. package/daemon/dist/domain/scope/scaffold-placeholder.js +4 -4
  535. package/daemon/dist/domain/scope/scaffold-placeholder.js.map +1 -1
  536. package/daemon/dist/domain/seat-activity-service.d.ts +9 -4
  537. package/daemon/dist/domain/seat-activity-service.d.ts.map +1 -1
  538. package/daemon/dist/domain/seat-activity-service.js +73 -22
  539. package/daemon/dist/domain/seat-activity-service.js.map +1 -1
  540. package/daemon/dist/domain/seat-attention-reconciler.d.ts +1 -0
  541. package/daemon/dist/domain/seat-attention-reconciler.d.ts.map +1 -1
  542. package/daemon/dist/domain/seat-attention-reconciler.js +32 -9
  543. package/daemon/dist/domain/seat-attention-reconciler.js.map +1 -1
  544. package/daemon/dist/domain/seat-handover-service.d.ts +6 -0
  545. package/daemon/dist/domain/seat-handover-service.d.ts.map +1 -1
  546. package/daemon/dist/domain/seat-handover-service.js +8 -5
  547. package/daemon/dist/domain/seat-handover-service.js.map +1 -1
  548. package/daemon/dist/domain/seat-identity-reconciler.d.ts +1 -1
  549. package/daemon/dist/domain/seat-identity-reconciler.d.ts.map +1 -1
  550. package/daemon/dist/domain/seat-identity-reconciler.js +99 -18
  551. package/daemon/dist/domain/seat-identity-reconciler.js.map +1 -1
  552. package/daemon/dist/domain/seat-launch-environment.d.ts +26 -0
  553. package/daemon/dist/domain/seat-launch-environment.d.ts.map +1 -0
  554. package/daemon/dist/domain/seat-launch-environment.js +178 -0
  555. package/daemon/dist/domain/seat-launch-environment.js.map +1 -0
  556. package/daemon/dist/domain/seat-lifecycle-service.d.ts +7 -0
  557. package/daemon/dist/domain/seat-lifecycle-service.d.ts.map +1 -1
  558. package/daemon/dist/domain/seat-lifecycle-service.js +37 -2
  559. package/daemon/dist/domain/seat-lifecycle-service.js.map +1 -1
  560. package/daemon/dist/domain/seat-status-service.d.ts.map +1 -1
  561. package/daemon/dist/domain/seat-status-service.js +4 -2
  562. package/daemon/dist/domain/seat-status-service.js.map +1 -1
  563. package/daemon/dist/domain/seat-structural-activity-service.d.ts +5 -4
  564. package/daemon/dist/domain/seat-structural-activity-service.d.ts.map +1 -1
  565. package/daemon/dist/domain/seat-structural-activity-service.js +23 -9
  566. package/daemon/dist/domain/seat-structural-activity-service.js.map +1 -1
  567. package/daemon/dist/domain/seat-switch-client-service.d.ts.map +1 -1
  568. package/daemon/dist/domain/seat-switch-client-service.js +3 -2
  569. package/daemon/dist/domain/seat-switch-client-service.js.map +1 -1
  570. package/daemon/dist/domain/services-readiness.d.ts.map +1 -1
  571. package/daemon/dist/domain/services-readiness.js +6 -2
  572. package/daemon/dist/domain/services-readiness.js.map +1 -1
  573. package/daemon/dist/domain/session-fingerprinter.d.ts.map +1 -1
  574. package/daemon/dist/domain/session-fingerprinter.js +16 -1
  575. package/daemon/dist/domain/session-fingerprinter.js.map +1 -1
  576. package/daemon/dist/domain/session-name.d.ts.map +1 -1
  577. package/daemon/dist/domain/session-name.js +6 -0
  578. package/daemon/dist/domain/session-name.js.map +1 -1
  579. package/daemon/dist/domain/session-registry.d.ts +3 -0
  580. package/daemon/dist/domain/session-registry.d.ts.map +1 -1
  581. package/daemon/dist/domain/session-registry.js +7 -0
  582. package/daemon/dist/domain/session-registry.js.map +1 -1
  583. package/daemon/dist/domain/session-transport.d.ts +30 -1
  584. package/daemon/dist/domain/session-transport.d.ts.map +1 -1
  585. package/daemon/dist/domain/session-transport.js +290 -145
  586. package/daemon/dist/domain/session-transport.js.map +1 -1
  587. package/daemon/dist/domain/snapshot-repository.d.ts +2 -1
  588. package/daemon/dist/domain/snapshot-repository.d.ts.map +1 -1
  589. package/daemon/dist/domain/snapshot-repository.js +39 -15
  590. package/daemon/dist/domain/snapshot-repository.js.map +1 -1
  591. package/daemon/dist/domain/spec-library-workflow-scanner.d.ts +1 -1
  592. package/daemon/dist/domain/spec-library-workflow-scanner.d.ts.map +1 -1
  593. package/daemon/dist/domain/spec-library-workflow-scanner.js +70 -11
  594. package/daemon/dist/domain/spec-library-workflow-scanner.js.map +1 -1
  595. package/daemon/dist/domain/spec-validation-service.d.ts +6 -0
  596. package/daemon/dist/domain/spec-validation-service.d.ts.map +1 -1
  597. package/daemon/dist/domain/spec-validation-service.js +16 -1
  598. package/daemon/dist/domain/spec-validation-service.js.map +1 -1
  599. package/daemon/dist/domain/startup-orchestrator.d.ts +8 -0
  600. package/daemon/dist/domain/startup-orchestrator.d.ts.map +1 -1
  601. package/daemon/dist/domain/startup-orchestrator.js +148 -37
  602. package/daemon/dist/domain/startup-orchestrator.js.map +1 -1
  603. package/daemon/dist/domain/startup-submission-evidence.d.ts +41 -0
  604. package/daemon/dist/domain/startup-submission-evidence.d.ts.map +1 -0
  605. package/daemon/dist/domain/startup-submission-evidence.js +67 -0
  606. package/daemon/dist/domain/startup-submission-evidence.js.map +1 -0
  607. package/daemon/dist/domain/startup-validation.d.ts.map +1 -1
  608. package/daemon/dist/domain/startup-validation.js +4 -0
  609. package/daemon/dist/domain/startup-validation.js.map +1 -1
  610. package/daemon/dist/domain/successor-session-launcher.d.ts +5 -0
  611. package/daemon/dist/domain/successor-session-launcher.d.ts.map +1 -1
  612. package/daemon/dist/domain/successor-session-launcher.js +8 -6
  613. package/daemon/dist/domain/successor-session-launcher.js.map +1 -1
  614. package/daemon/dist/domain/terminal/view-composer.d.ts.map +1 -1
  615. package/daemon/dist/domain/terminal/view-composer.js +2 -1
  616. package/daemon/dist/domain/terminal/view-composer.js.map +1 -1
  617. package/daemon/dist/domain/tmux-discovery-scanner.d.ts.map +1 -1
  618. package/daemon/dist/domain/tmux-discovery-scanner.js +7 -2
  619. package/daemon/dist/domain/tmux-discovery-scanner.js.map +1 -1
  620. package/daemon/dist/domain/tmux-option-defaults.d.ts.map +1 -1
  621. package/daemon/dist/domain/tmux-option-defaults.js +5 -0
  622. package/daemon/dist/domain/tmux-option-defaults.js.map +1 -1
  623. package/daemon/dist/domain/transcript-capture.d.ts.map +1 -1
  624. package/daemon/dist/domain/transcript-capture.js +1 -1
  625. package/daemon/dist/domain/transcript-capture.js.map +1 -1
  626. package/daemon/dist/domain/transcript-rotation.d.ts +26 -5
  627. package/daemon/dist/domain/transcript-rotation.d.ts.map +1 -1
  628. package/daemon/dist/domain/transcript-rotation.js +176 -25
  629. package/daemon/dist/domain/transcript-rotation.js.map +1 -1
  630. package/daemon/dist/domain/transcript-store.d.ts +1 -1
  631. package/daemon/dist/domain/transcript-store.d.ts.map +1 -1
  632. package/daemon/dist/domain/transcript-store.js +11 -4
  633. package/daemon/dist/domain/transcript-store.js.map +1 -1
  634. package/daemon/dist/domain/types.d.ts +18 -5
  635. package/daemon/dist/domain/types.d.ts.map +1 -1
  636. package/daemon/dist/domain/types.js.map +1 -1
  637. package/daemon/dist/domain/usage-series.d.ts.map +1 -1
  638. package/daemon/dist/domain/usage-series.js +11 -6
  639. package/daemon/dist/domain/usage-series.js.map +1 -1
  640. package/daemon/dist/domain/user-settings/settings-store.d.ts +2 -0
  641. package/daemon/dist/domain/user-settings/settings-store.d.ts.map +1 -1
  642. package/daemon/dist/domain/user-settings/settings-store.js +88 -6
  643. package/daemon/dist/domain/user-settings/settings-store.js.map +1 -1
  644. package/daemon/dist/domain/view-projector.d.ts +11 -6
  645. package/daemon/dist/domain/view-projector.d.ts.map +1 -1
  646. package/daemon/dist/domain/view-projector.js +2 -6
  647. package/daemon/dist/domain/view-projector.js.map +1 -1
  648. package/daemon/dist/domain/workflow-spec-cache.d.ts +29 -7
  649. package/daemon/dist/domain/workflow-spec-cache.d.ts.map +1 -1
  650. package/daemon/dist/domain/workflow-spec-cache.js +103 -14
  651. package/daemon/dist/domain/workflow-spec-cache.js.map +1 -1
  652. package/daemon/dist/domain/workspace/workspace-doctor.js +1 -1
  653. package/daemon/dist/domain/workspace/workspace-doctor.js.map +1 -1
  654. package/daemon/dist/domain/workspace/workspace-resolver.js +1 -1
  655. package/daemon/dist/domain/workspace/workspace-resolver.js.map +1 -1
  656. package/daemon/dist/health-detectors-surface.d.ts +1 -1
  657. package/daemon/dist/health-detectors-surface.d.ts.map +1 -1
  658. package/daemon/dist/health-detectors-surface.js.map +1 -1
  659. package/daemon/dist/index.d.ts +4 -4
  660. package/daemon/dist/index.d.ts.map +1 -1
  661. package/daemon/dist/index.js +11 -7
  662. package/daemon/dist/index.js.map +1 -1
  663. package/daemon/dist/middleware/json-body-error.d.ts +17 -0
  664. package/daemon/dist/middleware/json-body-error.d.ts.map +1 -0
  665. package/daemon/dist/middleware/json-body-error.js +42 -0
  666. package/daemon/dist/middleware/json-body-error.js.map +1 -0
  667. package/daemon/dist/routes/activity.d.ts.map +1 -1
  668. package/daemon/dist/routes/activity.js +85 -6
  669. package/daemon/dist/routes/activity.js.map +1 -1
  670. package/daemon/dist/routes/attention.d.ts.map +1 -1
  671. package/daemon/dist/routes/attention.js +7 -1
  672. package/daemon/dist/routes/attention.js.map +1 -1
  673. package/daemon/dist/routes/bundles.js +32 -3
  674. package/daemon/dist/routes/bundles.js.map +1 -1
  675. package/daemon/dist/routes/compaction.d.ts.map +1 -1
  676. package/daemon/dist/routes/compaction.js +30 -2
  677. package/daemon/dist/routes/compaction.js.map +1 -1
  678. package/daemon/dist/routes/context-packs.d.ts.map +1 -1
  679. package/daemon/dist/routes/context-packs.js +10 -2
  680. package/daemon/dist/routes/context-packs.js.map +1 -1
  681. package/daemon/dist/routes/files.js +2 -2
  682. package/daemon/dist/routes/files.js.map +1 -1
  683. package/daemon/dist/routes/gateway.d.ts.map +1 -1
  684. package/daemon/dist/routes/gateway.js +6 -1
  685. package/daemon/dist/routes/gateway.js.map +1 -1
  686. package/daemon/dist/routes/hosts.d.ts.map +1 -1
  687. package/daemon/dist/routes/hosts.js +51 -12
  688. package/daemon/dist/routes/hosts.js.map +1 -1
  689. package/daemon/dist/routes/mission-control.d.ts.map +1 -1
  690. package/daemon/dist/routes/mission-control.js +6 -2
  691. package/daemon/dist/routes/mission-control.js.map +1 -1
  692. package/daemon/dist/routes/missions.d.ts.map +1 -1
  693. package/daemon/dist/routes/missions.js +17 -5
  694. package/daemon/dist/routes/missions.js.map +1 -1
  695. package/daemon/dist/routes/plugins.d.ts.map +1 -1
  696. package/daemon/dist/routes/plugins.js +5 -1
  697. package/daemon/dist/routes/plugins.js.map +1 -1
  698. package/daemon/dist/routes/proof.d.ts.map +1 -1
  699. package/daemon/dist/routes/proof.js +9 -2
  700. package/daemon/dist/routes/proof.js.map +1 -1
  701. package/daemon/dist/routes/ps.d.ts.map +1 -1
  702. package/daemon/dist/routes/ps.js +18 -0
  703. package/daemon/dist/routes/ps.js.map +1 -1
  704. package/daemon/dist/routes/queue.d.ts.map +1 -1
  705. package/daemon/dist/routes/queue.js +150 -67
  706. package/daemon/dist/routes/queue.js.map +1 -1
  707. package/daemon/dist/routes/restore-check.d.ts.map +1 -1
  708. package/daemon/dist/routes/restore-check.js +40 -1
  709. package/daemon/dist/routes/restore-check.js.map +1 -1
  710. package/daemon/dist/routes/rigs.js +1 -1
  711. package/daemon/dist/routes/rigs.js.map +1 -1
  712. package/daemon/dist/routes/rigspec.d.ts.map +1 -1
  713. package/daemon/dist/routes/rigspec.js +7 -10
  714. package/daemon/dist/routes/rigspec.js.map +1 -1
  715. package/daemon/dist/routes/seat.d.ts.map +1 -1
  716. package/daemon/dist/routes/seat.js +11 -0
  717. package/daemon/dist/routes/seat.js.map +1 -1
  718. package/daemon/dist/routes/sessions.js +1 -1
  719. package/daemon/dist/routes/sessions.js.map +1 -1
  720. package/daemon/dist/routes/telemetry.d.ts.map +1 -1
  721. package/daemon/dist/routes/telemetry.js +6 -1
  722. package/daemon/dist/routes/telemetry.js.map +1 -1
  723. package/daemon/dist/routes/terminal-ws.d.ts +1 -2
  724. package/daemon/dist/routes/terminal-ws.d.ts.map +1 -1
  725. package/daemon/dist/routes/terminal-ws.js +1 -2
  726. package/daemon/dist/routes/terminal-ws.js.map +1 -1
  727. package/daemon/dist/routes/up.js +2 -1
  728. package/daemon/dist/routes/up.js.map +1 -1
  729. package/daemon/dist/routes/views.js +2 -2
  730. package/daemon/dist/routes/views.js.map +1 -1
  731. package/daemon/dist/server.d.ts +2 -0
  732. package/daemon/dist/server.d.ts.map +1 -1
  733. package/daemon/dist/server.js +7 -2
  734. package/daemon/dist/server.js.map +1 -1
  735. package/daemon/dist/spec-validation-surface.d.ts +2 -0
  736. package/daemon/dist/spec-validation-surface.d.ts.map +1 -0
  737. package/daemon/dist/spec-validation-surface.js +2 -0
  738. package/daemon/dist/spec-validation-surface.js.map +1 -0
  739. package/daemon/dist/startup.d.ts +1 -1
  740. package/daemon/dist/startup.d.ts.map +1 -1
  741. package/daemon/dist/startup.js +137 -50
  742. package/daemon/dist/startup.js.map +1 -1
  743. package/daemon/dist/terminal/TerminalSessionBroker.d.ts +1 -0
  744. package/daemon/dist/terminal/TerminalSessionBroker.d.ts.map +1 -1
  745. package/daemon/dist/terminal/TerminalSessionBroker.js +8 -1
  746. package/daemon/dist/terminal/TerminalSessionBroker.js.map +1 -1
  747. package/daemon/docs/reference/agent-spec.md +36 -1
  748. package/daemon/docs/reference/agent-startup-guide.md +81 -2
  749. package/daemon/docs/reference/browser-access.md +4 -1
  750. package/daemon/docs/reference/developing.md +17 -9
  751. package/daemon/docs/reference/getting-started.md +7 -2
  752. package/daemon/docs/reference/health-diagnosis.md +10 -3
  753. package/daemon/docs/reference/help.md +9 -4
  754. package/daemon/docs/reference/host-resources.md +60 -0
  755. package/daemon/docs/reference/instance-layout.md +11 -0
  756. package/daemon/docs/reference/rig-spec.md +32 -5
  757. package/daemon/docs/reference/sdlc-conventions.md +6 -3
  758. package/daemon/docs/reference/slack-app-setup.md +6 -0
  759. package/daemon/specs/agents/shared/agent.yaml +1 -1
  760. package/daemon/specs/agents/shared/skills/core/messaging-the-human/SKILL.md +24 -0
  761. package/daemon/specs/agents/shared/skills/core/openrig-skills/SKILL.md +6 -0
  762. package/daemon/specs/agents/shared/skills/core/topology-mutation-and-seat-management/SKILL.md +24 -3
  763. package/daemon/specs/rigs/launch/kernel/agents/advisor/lead/agent.yaml +2 -8
  764. package/daemon/specs/rigs/launch/kernel/agents/operator/agent/agent.yaml +2 -8
  765. package/daemon/specs/rigs/launch/kernel/agents/queue/worker/agent.yaml +2 -8
  766. package/daemon/specs/rigs/preview/product-team/topology/rig/ORCHESTRATION-CRAFT.md +1 -1
  767. package/dist/atomic-text-write.d.ts +3 -0
  768. package/dist/atomic-text-write.d.ts.map +1 -0
  769. package/dist/atomic-text-write.js +79 -0
  770. package/dist/atomic-text-write.js.map +1 -0
  771. package/dist/build-info.js +3 -3
  772. package/dist/cli-error.d.ts.map +1 -1
  773. package/dist/cli-error.js +15 -2
  774. package/dist/cli-error.js.map +1 -1
  775. package/dist/client.d.ts +14 -1
  776. package/dist/client.d.ts.map +1 -1
  777. package/dist/client.js +29 -4
  778. package/dist/client.js.map +1 -1
  779. package/dist/commands/agent-image.d.ts.map +1 -1
  780. package/dist/commands/agent-image.js +2 -0
  781. package/dist/commands/agent-image.js.map +1 -1
  782. package/dist/commands/ask.d.ts.map +1 -1
  783. package/dist/commands/ask.js +10 -1
  784. package/dist/commands/ask.js.map +1 -1
  785. package/dist/commands/bootstrap.d.ts.map +1 -1
  786. package/dist/commands/bootstrap.js +4 -6
  787. package/dist/commands/bootstrap.js.map +1 -1
  788. package/dist/commands/broadcast.js +1 -1
  789. package/dist/commands/broadcast.js.map +1 -1
  790. package/dist/commands/chatroom.d.ts.map +1 -1
  791. package/dist/commands/chatroom.js +22 -1
  792. package/dist/commands/chatroom.js.map +1 -1
  793. package/dist/commands/compact-plan.d.ts.map +1 -1
  794. package/dist/commands/compact-plan.js +34 -5
  795. package/dist/commands/compact-plan.js.map +1 -1
  796. package/dist/commands/compact.d.ts.map +1 -1
  797. package/dist/commands/compact.js +24 -4
  798. package/dist/commands/compact.js.map +1 -1
  799. package/dist/commands/config.d.ts.map +1 -1
  800. package/dist/commands/config.js +2 -4
  801. package/dist/commands/config.js.map +1 -1
  802. package/dist/commands/context.d.ts.map +1 -1
  803. package/dist/commands/context.js +19 -14
  804. package/dist/commands/context.js.map +1 -1
  805. package/dist/commands/crash-cart.d.ts.map +1 -1
  806. package/dist/commands/crash-cart.js +2 -1
  807. package/dist/commands/crash-cart.js.map +1 -1
  808. package/dist/commands/daemon.d.ts +13 -1
  809. package/dist/commands/daemon.d.ts.map +1 -1
  810. package/dist/commands/daemon.js +35 -17
  811. package/dist/commands/daemon.js.map +1 -1
  812. package/dist/commands/destroy.d.ts.map +1 -1
  813. package/dist/commands/destroy.js +3 -2
  814. package/dist/commands/destroy.js.map +1 -1
  815. package/dist/commands/discover.d.ts.map +1 -1
  816. package/dist/commands/discover.js +2 -4
  817. package/dist/commands/discover.js.map +1 -1
  818. package/dist/commands/doctor.d.ts.map +1 -1
  819. package/dist/commands/doctor.js +3 -2
  820. package/dist/commands/doctor.js.map +1 -1
  821. package/dist/commands/env.d.ts.map +1 -1
  822. package/dist/commands/env.js +8 -0
  823. package/dist/commands/env.js.map +1 -1
  824. package/dist/commands/export.js +2 -2
  825. package/dist/commands/export.js.map +1 -1
  826. package/dist/commands/gateway.d.ts.map +1 -1
  827. package/dist/commands/gateway.js +23 -3
  828. package/dist/commands/gateway.js.map +1 -1
  829. package/dist/commands/health.d.ts.map +1 -1
  830. package/dist/commands/health.js +9 -0
  831. package/dist/commands/health.js.map +1 -1
  832. package/dist/commands/host.d.ts.map +1 -1
  833. package/dist/commands/host.js +13 -3
  834. package/dist/commands/host.js.map +1 -1
  835. package/dist/commands/plugin.d.ts.map +1 -1
  836. package/dist/commands/plugin.js +12 -2
  837. package/dist/commands/plugin.js.map +1 -1
  838. package/dist/commands/ps.d.ts +1 -0
  839. package/dist/commands/ps.d.ts.map +1 -1
  840. package/dist/commands/ps.js +97 -35
  841. package/dist/commands/ps.js.map +1 -1
  842. package/dist/commands/queue.d.ts +2 -0
  843. package/dist/commands/queue.d.ts.map +1 -1
  844. package/dist/commands/queue.js +129 -17
  845. package/dist/commands/queue.js.map +1 -1
  846. package/dist/commands/requirements.d.ts.map +1 -1
  847. package/dist/commands/requirements.js +6 -3
  848. package/dist/commands/requirements.js.map +1 -1
  849. package/dist/commands/rig-mode.d.ts.map +1 -1
  850. package/dist/commands/rig-mode.js +6 -1
  851. package/dist/commands/rig-mode.js.map +1 -1
  852. package/dist/commands/rig.d.ts.map +1 -1
  853. package/dist/commands/rig.js +20 -20
  854. package/dist/commands/rig.js.map +1 -1
  855. package/dist/commands/scope.d.ts.map +1 -1
  856. package/dist/commands/scope.js +22 -0
  857. package/dist/commands/scope.js.map +1 -1
  858. package/dist/commands/seat.d.ts.map +1 -1
  859. package/dist/commands/seat.js +39 -9
  860. package/dist/commands/seat.js.map +1 -1
  861. package/dist/commands/setup.d.ts.map +1 -1
  862. package/dist/commands/setup.js +6 -5
  863. package/dist/commands/setup.js.map +1 -1
  864. package/dist/commands/slack.d.ts.map +1 -1
  865. package/dist/commands/slack.js +8 -1
  866. package/dist/commands/slack.js.map +1 -1
  867. package/dist/commands/specs.d.ts.map +1 -1
  868. package/dist/commands/specs.js +2 -0
  869. package/dist/commands/specs.js.map +1 -1
  870. package/dist/commands/start.js +6 -5
  871. package/dist/commands/start.js.map +1 -1
  872. package/dist/commands/startup-proof.d.ts.map +1 -1
  873. package/dist/commands/startup-proof.js +2 -1
  874. package/dist/commands/startup-proof.js.map +1 -1
  875. package/dist/commands/status.d.ts.map +1 -1
  876. package/dist/commands/status.js +7 -0
  877. package/dist/commands/status.js.map +1 -1
  878. package/dist/commands/terminal.d.ts.map +1 -1
  879. package/dist/commands/terminal.js +4 -0
  880. package/dist/commands/terminal.js.map +1 -1
  881. package/dist/commands/transcript.js +5 -3
  882. package/dist/commands/transcript.js.map +1 -1
  883. package/dist/commands/up.d.ts +8 -0
  884. package/dist/commands/up.d.ts.map +1 -1
  885. package/dist/commands/up.js +78 -4
  886. package/dist/commands/up.js.map +1 -1
  887. package/dist/commands/walk.d.ts.map +1 -1
  888. package/dist/commands/walk.js +3 -0
  889. package/dist/commands/walk.js.map +1 -1
  890. package/dist/commands/workflow-follow.d.ts +2 -0
  891. package/dist/commands/workflow-follow.d.ts.map +1 -1
  892. package/dist/commands/workflow-follow.js +6 -4
  893. package/dist/commands/workflow-follow.js.map +1 -1
  894. package/dist/commands/workflow.d.ts.map +1 -1
  895. package/dist/commands/workflow.js +2 -4
  896. package/dist/commands/workflow.js.map +1 -1
  897. package/dist/commands/workspace.d.ts.map +1 -1
  898. package/dist/commands/workspace.js +2 -4
  899. package/dist/commands/workspace.js.map +1 -1
  900. package/dist/config-store.d.ts +2 -0
  901. package/dist/config-store.d.ts.map +1 -1
  902. package/dist/config-store.js +24 -6
  903. package/dist/config-store.js.map +1 -1
  904. package/dist/daemon-lifecycle.d.ts +9 -0
  905. package/dist/daemon-lifecycle.d.ts.map +1 -1
  906. package/dist/daemon-lifecycle.js +61 -19
  907. package/dist/daemon-lifecycle.js.map +1 -1
  908. package/dist/daemon-reachability.d.ts +18 -0
  909. package/dist/daemon-reachability.d.ts.map +1 -0
  910. package/dist/daemon-reachability.js +48 -0
  911. package/dist/daemon-reachability.js.map +1 -0
  912. package/dist/lib/file-transfer.d.ts +1 -1
  913. package/dist/lib/file-transfer.d.ts.map +1 -1
  914. package/dist/lib/file-transfer.js +17 -5
  915. package/dist/lib/file-transfer.js.map +1 -1
  916. package/dist/lib/scope/mission-composition.d.ts.map +1 -1
  917. package/dist/lib/scope/mission-composition.js +11 -0
  918. package/dist/lib/scope/mission-composition.js.map +1 -1
  919. package/dist/lib/scope/scaffold-placeholder.d.ts +4 -4
  920. package/dist/lib/scope/scaffold-placeholder.d.ts.map +1 -1
  921. package/dist/lib/scope/scaffold-placeholder.js +4 -4
  922. package/dist/lib/scope/scaffold-placeholder.js.map +1 -1
  923. package/dist/lib/scope/scope-fs.d.ts.map +1 -1
  924. package/dist/lib/scope/scope-fs.js +10 -16
  925. package/dist/lib/scope/scope-fs.js.map +1 -1
  926. package/dist/lib/scope-templates/slice-progress.md +11 -7
  927. package/dist/restore-packet/claude-transcript-parser.d.ts.map +1 -1
  928. package/dist/restore-packet/claude-transcript-parser.js +2 -0
  929. package/dist/restore-packet/claude-transcript-parser.js.map +1 -1
  930. package/dist/restore-packet/codex-jsonl-parser.d.ts.map +1 -1
  931. package/dist/restore-packet/codex-jsonl-parser.js +2 -0
  932. package/dist/restore-packet/codex-jsonl-parser.js.map +1 -1
  933. package/dist/restore-packet/runtime-detect.d.ts.map +1 -1
  934. package/dist/restore-packet/runtime-detect.js +2 -0
  935. package/dist/restore-packet/runtime-detect.js.map +1 -1
  936. package/package.json +4 -3
  937. package/tui/dist/attention/source-continuity.d.ts.map +1 -1
  938. package/tui/dist/attention/source-continuity.js +5 -3
  939. package/tui/dist/attention/source-continuity.js.map +1 -1
  940. package/tui/dist/daemon-client.d.ts +2 -1
  941. package/tui/dist/daemon-client.d.ts.map +1 -1
  942. package/tui/dist/daemon-client.js +13 -4
  943. package/tui/dist/daemon-client.js.map +1 -1
  944. package/tui/dist/execution/execution-model.d.ts.map +1 -1
  945. package/tui/dist/execution/execution-model.js +19 -7
  946. package/tui/dist/execution/execution-model.js.map +1 -1
  947. package/tui/dist/grammar.d.ts.map +1 -1
  948. package/tui/dist/grammar.js +3 -2
  949. package/tui/dist/grammar.js.map +1 -1
  950. package/tui/dist/health/health-model.d.ts.map +1 -1
  951. package/tui/dist/health/health-model.js +17 -5
  952. package/tui/dist/health/health-model.js.map +1 -1
  953. package/tui/dist/hydrate.d.ts.map +1 -1
  954. package/tui/dist/hydrate.js +1 -0
  955. package/tui/dist/hydrate.js.map +1 -1
  956. package/tui/dist/input.d.ts.map +1 -1
  957. package/tui/dist/input.js +5 -0
  958. package/tui/dist/input.js.map +1 -1
  959. package/tui/dist/live-events.d.ts +2 -2
  960. package/tui/dist/live-events.d.ts.map +1 -1
  961. package/tui/dist/live-events.js +65 -27
  962. package/tui/dist/live-events.js.map +1 -1
  963. package/tui/dist/local-reading.d.ts.map +1 -1
  964. package/tui/dist/local-reading.js +2 -0
  965. package/tui/dist/local-reading.js.map +1 -1
  966. package/tui/dist/main.js +16 -3
  967. package/tui/dist/main.js.map +1 -1
  968. package/tui/dist/page-read.d.ts.map +1 -1
  969. package/tui/dist/page-read.js +4 -1
  970. package/tui/dist/page-read.js.map +1 -1
  971. package/tui/dist/render.d.ts +2 -0
  972. package/tui/dist/render.d.ts.map +1 -1
  973. package/tui/dist/render.js +15 -4
  974. package/tui/dist/render.js.map +1 -1
  975. package/tui/dist/scopes/scopes-model.d.ts.map +1 -1
  976. package/tui/dist/scopes/scopes-model.js +36 -31
  977. package/tui/dist/scopes/scopes-model.js.map +1 -1
  978. package/tui/dist/socket-server.d.ts +6 -2
  979. package/tui/dist/socket-server.d.ts.map +1 -1
  980. package/tui/dist/socket-server.js +159 -14
  981. package/tui/dist/socket-server.js.map +1 -1
  982. package/tui/dist/types.d.ts +18 -0
  983. package/tui/dist/types.d.ts.map +1 -1
  984. package/ui/dist/assets/{index-N-SdPj-I.css → index-DNU3XZr_.css} +1 -1
  985. package/ui/dist/assets/{index-BVW54ItO.js → index-HHSvwF97.js} +75 -75
  986. package/ui/dist/index.html +2 -2
@@ -9,12 +9,14 @@ import { lastMeaningfulTransition, readWaitingView } from "./queue-waiting.js";
9
9
  import { wrapPaneEnvelope } from "../lib/pane-envelope.js";
10
10
  import { getSelfHostId } from "./hosts/fanout-contract.js";
11
11
  import { parseSessionName, isHumanSeatSessionRef } from "./session-name.js";
12
+ import { parseReplyToChoice, formatReplyToChoice, describeReplyToFallback, REPLY_TO_CHOICE_ACTOR } from "./reply-to-choice.js";
12
13
  import { classifyDestination } from "./gateway/destination-resolver.js";
13
14
  import { computeClosureRequiredAt, validateClosure, } from "./hot-potato-enforcer.js";
14
15
  import { isHumanSeatSession, validateHumanPark, validateHumanRoute } from "./human-route-enforcer.js";
15
16
  import { QueueWakeRepository, USAGE_LIMIT_BLOCKER_TAG, } from "./queue-wake-repository.js";
16
17
  import { WatchdogJobsRepository } from "./watchdog-jobs-repository.js";
17
18
  import { armQueueWait, backOffQueueWait, refreshQueueWaits, evaluateQueueWait, retargetQueueWait, isQueueWait } from "./queue-wait-backoff.js";
19
+ import { parseHumanQuestions, unansweredQuestions } from "./human-questions.js";
18
20
  export const QUEUE_STATES = [
19
21
  "pending",
20
22
  "in-progress",
@@ -44,6 +46,19 @@ export const ACTIVE_QUEUE_STATES = ["pending", "in-progress", "blocked"];
44
46
  export function isBlockerLive(state) {
45
47
  return ACTIVE_QUEUE_STATES.includes(state);
46
48
  }
49
+ /** #96 — a Slack reply routes to the item that owns the thread root, so a later update may
50
+ * share that thread only while no reply there could answer a human decision. Deliberately
51
+ * BROADER than what makeHumanReplyResolver resolves today (it errs toward posting top-level): any
52
+ * active human-destined decision, or a row blocked on any human-class seat right now. A
53
+ * resolved park returns to in-progress; blocked_on alone (which the resolve verb documents
54
+ * keeping as provenance) is never a live gate. */
55
+ export function hasLiveHumanGate(item) {
56
+ if (item.humanIntent === "update")
57
+ return false;
58
+ if (item.state === "blocked" && item.blockedOn && isHumanSeatSessionRef(item.blockedOn))
59
+ return true;
60
+ return isBlockerLive(item.state) && isHumanSeatSessionRef(item.destinationSession);
61
+ }
47
62
  const AUTO_UNPARK_WAKE_TAG = "queue:auto-unpark:blocker";
48
63
  const AUTO_UNPARK_BLOCKER_TAG_PREFIX = "queue:auto-unpark:blocker-ref:";
49
64
  /** 0.5.1-53 Atom 1a — typed non-qitem gate blocker prefixes. A park may be gated on a fold / auth /
@@ -284,6 +299,7 @@ export class QueueRepository {
284
299
  db;
285
300
  transitionLog;
286
301
  eventBus;
302
+ destinationAdvisory;
287
303
  validateRig;
288
304
  transport;
289
305
  /** W1 (transactional closure): the durable wake-intent store. A terminal act
@@ -313,10 +329,13 @@ export class QueueRepository {
313
329
  hasTargetRepoColumn;
314
330
  hasSummaryColumn;
315
331
  hasHumanIntentColumn;
332
+ hasReplyToColumn;
333
+ hasHumanQuestionsColumn;
316
334
  hasEvidenceRefColumn;
317
335
  hasMintingGenColumn;
318
336
  hasClaimedGenColumn;
319
337
  hasQueueTransitionsTable;
338
+ hasTransitionProvenanceColumn;
320
339
  hasOwnerNotificationColumns;
321
340
  loadHumanRegistryFn;
322
341
  /** OPR.0.4.6.WF3 FR-6 — injected by startup (never imported): the
@@ -328,6 +347,7 @@ export class QueueRepository {
328
347
  this.transitionLog = new QueueTransitionLog(db);
329
348
  this.wakeRepo = new QueueWakeRepository(db);
330
349
  this.validateRig = opts?.validateRig ?? (() => true);
350
+ this.destinationAdvisory = opts?.destinationAdvisory ?? (() => null);
331
351
  this.transport = opts?.transport;
332
352
  this.workflowFrontierPredicate = opts?.workflowFrontierPredicate;
333
353
  this.resolveOccupantGeneration = opts?.resolveOccupantGeneration;
@@ -335,11 +355,14 @@ export class QueueRepository {
335
355
  this.hasTargetRepoColumn = detectQueueColumn(db, "target_repo");
336
356
  this.hasSummaryColumn = detectQueueColumn(db, "summary");
337
357
  this.hasHumanIntentColumn = detectQueueColumn(db, "human_intent");
358
+ this.hasReplyToColumn = detectQueueColumn(db, "reply_to");
359
+ this.hasHumanQuestionsColumn = detectQueueColumn(db, "human_questions");
338
360
  this.hasEvidenceRefColumn = detectQueueColumn(db, "evidence_ref");
339
361
  this.hasQueueTransitionsTable = detectTable(db, "queue_transitions");
340
362
  const transitionColumns = this.hasQueueTransitionsTable
341
363
  ? new Set(db.prepare("PRAGMA table_info(queue_transitions)").all().map((column) => column.name))
342
364
  : new Set();
365
+ this.hasTransitionProvenanceColumn = transitionColumns.has("identity_provenance");
343
366
  this.hasOwnerNotificationColumns = transitionColumns.has("owner_notification_kind")
344
367
  && transitionColumns.has("owner_notification_level");
345
368
  // GHOST-STAGE (e/Class-B): generation stamps (migration 063). Defensive detect so a pre-063
@@ -945,6 +968,18 @@ export class QueueRepository {
945
968
  if (existing) {
946
969
  if (existing.destinationSession === input.destinationSession &&
947
970
  existing.sourceSession === input.sourceSession) {
971
+ // Keep retry compatibility, but never imply that an absorbed,
972
+ // different body was saved. Decide at the actual PK conflict,
973
+ // rather than comparing a fresh create's post-nudge readback.
974
+ if (existing.body !== input.body) {
975
+ return {
976
+ ...existing,
977
+ createWarning: {
978
+ code: "qitem_body_not_saved",
979
+ message: `qitem ${input.qitemId} already exists with a different body. The supplied body was not saved; the existing row is returned unchanged. No new work or delivery was created.`,
980
+ },
981
+ };
982
+ }
948
983
  return existing;
949
984
  }
950
985
  throw new QueueRepositoryError("qitem_id_reuse", `qitem ${input.qitemId} already exists with a different destination/source — id reuse is a caller bug, not an idempotent retry`, {
@@ -1029,6 +1064,24 @@ export class QueueRepository {
1029
1064
  if (!this.hasHumanIntentColumn)
1030
1065
  throw new QueueRepositoryError("invalid_human_notification", "Human notification fields require the current queue schema; they were not saved.");
1031
1066
  }
1067
+ if (input.replyTo != null)
1068
+ this.validateReplyTo(input.replyTo, input.humanIntent);
1069
+ let humanQuestions = null;
1070
+ if (input.humanQuestions != null) {
1071
+ if (!isHumanSeatSessionRef(input.destinationSession)) {
1072
+ throw new QueueRepositoryError("invalid_human_questions", "humanQuestions require a human destination: only a human can click the options.");
1073
+ }
1074
+ // Omitted intent is a decision (legacy behavior), so it may carry questions too.
1075
+ if (input.humanIntent === "update") {
1076
+ throw new QueueRepositoryError("invalid_human_questions", "humanQuestions are refused on an update: they ask the human to decide. Use humanIntent decision.");
1077
+ }
1078
+ const parsed = parseHumanQuestions(input.humanQuestions);
1079
+ if (!parsed.ok)
1080
+ throw new QueueRepositoryError("invalid_human_questions", parsed.error);
1081
+ if (!this.hasHumanQuestionsColumn)
1082
+ throw new QueueRepositoryError("invalid_human_questions", "humanQuestions require the current queue schema; they were not saved.");
1083
+ humanQuestions = parsed.questions;
1084
+ }
1032
1085
  const id = input.qitemId ?? newQitemId();
1033
1086
  const ts = new Date().toISOString();
1034
1087
  const priority = input.priority ?? "routine";
@@ -1061,6 +1114,12 @@ export class QueueRepository {
1061
1114
  this.db.prepare("UPDATE queue_items SET human_intent = ?, human_detail = ? WHERE qitem_id = ?")
1062
1115
  .run(input.humanIntent ?? null, input.humanDetail ?? null, id);
1063
1116
  }
1117
+ if (input.replyTo != null) {
1118
+ this.db.prepare("UPDATE queue_items SET reply_to = ? WHERE qitem_id = ?").run(input.replyTo, id);
1119
+ }
1120
+ if (humanQuestions) {
1121
+ this.db.prepare("UPDATE queue_items SET human_questions = ? WHERE qitem_id = ?").run(JSON.stringify(humanQuestions), id);
1122
+ }
1064
1123
  this.persistMintingGeneration(id, input.sourceSession);
1065
1124
  const notification = this.classifyOwnerNotification({
1066
1125
  action: "create",
@@ -1088,6 +1147,17 @@ export class QueueRepository {
1088
1147
  });
1089
1148
  return { qitemId: id, persistedEvent };
1090
1149
  }
1150
+ validateReplyTo(replyTo, humanIntent) {
1151
+ if (humanIntent !== "update") {
1152
+ throw new QueueRepositoryError("reply_to_requires_update", "replyTo is accepted only with humanIntent update; a decision keeps its own thread so its reply stays unambiguous.");
1153
+ }
1154
+ if (!this.hasReplyToColumn)
1155
+ throw new QueueRepositoryError("invalid_human_notification", "replyTo requires the current queue schema; it was not saved.");
1156
+ if (!this.getById(replyTo))
1157
+ throw new QueueRepositoryError("reply_to_not_found", `replyTo names no qitem on this host: ${replyTo}.`);
1158
+ // An item with a live human gate or no usable root is not refused here: delivery posts
1159
+ // the update top-level and records why (deriveReplyToChoice in slack-subsystem).
1160
+ }
1091
1161
  /**
1092
1162
  * Transactional handoff: close the source qitem (state=done,
1093
1163
  * closure_reason=handed_off_to) and create a new qitem owned by `toSession`,
@@ -1902,7 +1972,9 @@ export class QueueRepository {
1902
1972
  }
1903
1973
  const oldWake = this.wakeRepo.getStatus(input.qitemId);
1904
1974
  const job = armQueueWait(this.db, jobsRepo, {
1905
- previousJobId: oldWake?.kind === "timer" ? oldWake.ref : undefined,
1975
+ // Reusing a shared job would rewrite the attachment's schedule and packet.
1976
+ previousJobId: oldWake?.kind === "timer" && this.wakeRepo.findLiveQitemsByAttachedWatchdog(oldWake.ref).length === 0
1977
+ ? oldWake.ref : undefined,
1906
1978
  qitemId: input.qitemId, blocker: effectiveBlockedOn,
1907
1979
  evidence: input.wakeProgressEvidence,
1908
1980
  initialSeconds: input.wakeAfterSeconds, maxSeconds: input.wakeMaxSeconds,
@@ -2092,6 +2164,10 @@ export class QueueRepository {
2092
2164
  const armed = this.wakeRepo.getStatus(qitemId);
2093
2165
  if (armed?.kind !== "timer" || !armed.live)
2094
2166
  return;
2167
+ // An explicit --wake-watchdog attachment gives another continuation custody
2168
+ // of this same job. The timer row's exit cannot cancel that attachment.
2169
+ if (this.wakeRepo.findLiveQitemsByAttachedWatchdog(armed.ref).length > 0)
2170
+ return;
2095
2171
  (this.watchdogJobsRepo ?? new WatchdogJobsRepository(this.db)).markTerminal(armed.ref, reason);
2096
2172
  }
2097
2173
  propagateBlockerCompletion(input) {
@@ -2172,23 +2248,13 @@ export class QueueRepository {
2172
2248
  currentParkTimerIds() {
2173
2249
  return this.wakeRepo.currentParkTimerIds();
2174
2250
  }
2175
- /** Refuse a legacy park-generated timer only when every row bound to it is
2176
- * terminal. Current exits retire these timers transactionally; this is the
2177
- * delivery-seam backstop for residue persisted by an older daemon. A timer
2178
- * still bound to any actionable row, and every operator-attached watchdog,
2179
- * remains deliverable. */
2251
+ /** Generated jobs end when neither their original park nor an unfired
2252
+ * attachment still owns them. Standalone operator jobs keep their lifecycle. */
2180
2253
  resolveWatchdogPreDeliveryTerminalReason(jobId) {
2181
2254
  const targets = this.wakeRepo.findQitemsByGeneratedTimer(jobId);
2182
- if (targets.length === 0 || targets.some(({ state }) => !isTerminalState(state)))
2255
+ if (targets.length === 0 || this.wakeRepo.findCurrentQitemsByGeneratedTimer(jobId).length > 0)
2183
2256
  return null;
2184
- // Ownership, not just staleness. This backstop may retire a job only when
2185
- // the job is SOLELY a park-generated timer. `--wake-watchdog` can attach an
2186
- // operator row to the very job another row's `--wake-after` produced, and
2187
- // that is a supported path — so a shared job carries a second, watchdog-kind
2188
- // binding this reason has no authority over. The timer's rows being terminal
2189
- // says nothing about the attachment; claiming the job anyway terminals it
2190
- // before transport and the attachment can never wake.
2191
- if (this.wakeRepo.findQitemsByAttachedWatchdog(jobId).length > 0)
2257
+ if (this.wakeRepo.findLiveQitemsByAttachedWatchdog(jobId).length > 0)
2192
2258
  return null;
2193
2259
  return "park_timer_target_terminal";
2194
2260
  }
@@ -2208,9 +2274,11 @@ export class QueueRepository {
2208
2274
  * audited. The queue transition records that attempt independently of
2209
2275
  * whether the HELD row's owner consumed it. */
2210
2276
  recordWatchdogWakeAttempt(jobId, deliveryStatus) {
2211
- const targets = this.wakeRepo.findBlockedQitemsByWatchdog(jobId);
2212
- if (targets.length === 0)
2277
+ const bindings = this.wakeRepo.findBlockedQitemsByWatchdog(jobId);
2278
+ if (bindings.length === 0)
2213
2279
  return;
2280
+ // Both receipt ownership and timer lifecycle follow the current park.
2281
+ const targets = this.wakeRepo.findBlockedQitemsByWatchdog(jobId, true);
2214
2282
  const recordFired = ({ qitemId, kind }) => {
2215
2283
  const transition = this.transitionLog.append({
2216
2284
  qitemId,
@@ -2248,7 +2316,7 @@ export class QueueRepository {
2248
2316
  // behaviour is UNCHANGED by this repair and pinned as unchanged. This widens
2249
2317
  // the same act to ordinary park timers, without their blocker resolution —
2250
2318
  // resolving the blocker is a provider-limit outcome, not a timer one.
2251
- const parkGeneratedTimer = targets.some(({ kind }) => kind === "timer");
2319
+ const parkGeneratedTimer = this.wakeRepo.findCurrentQitemsByGeneratedTimer(jobId).length > 0;
2252
2320
  const events = this.db.transaction(() => {
2253
2321
  const firedEvents = targets.map(recordFired);
2254
2322
  if (deliveryStatus === "retained")
@@ -2272,6 +2340,38 @@ export class QueueRepository {
2272
2340
  for (const event of events)
2273
2341
  this.eventBus.notifySubscribers(event);
2274
2342
  }
2343
+ /**
2344
+ * #193 — record one clicked answer on a pending decision that carries structured questions.
2345
+ * Only the decision's own human may answer, and only while it is pending. A click may change
2346
+ * an earlier answer until the set is complete; from then on the answers are FINAL, and any
2347
+ * further click returns them unchanged so the caller can retry the continuation (reply row +
2348
+ * resolve) with exactly what the seat will read. Anything else is not-applicable (a forged
2349
+ * id, a stranger, a decision already resolved), never an error the socket must retry.
2350
+ */
2351
+ recordHumanAnswer(input) {
2352
+ if (!this.hasHumanQuestionsColumn)
2353
+ return { status: "not-applicable", reason: "schema" };
2354
+ return this.db.transaction(() => {
2355
+ const item = this.getById(input.qitemId);
2356
+ if (!item?.humanQuestions?.length)
2357
+ return { status: "not-applicable", reason: "no-questions" };
2358
+ if (item.state !== "pending")
2359
+ return { status: "not-applicable", reason: `state-${item.state}` };
2360
+ if (item.destinationSession !== input.actorSession)
2361
+ return { status: "not-applicable", reason: "not-the-asked-human" };
2362
+ const question = item.humanQuestions.find((q) => q.id === input.questionId);
2363
+ if (!question?.options.some((o) => o.id === input.optionId))
2364
+ return { status: "not-applicable", reason: "unknown-option" };
2365
+ const recorded = item.humanAnswers ?? {};
2366
+ if (unansweredQuestions(item.humanQuestions, recorded).length === 0) {
2367
+ return { status: "recorded", answers: recorded, complete: true, questions: item.humanQuestions };
2368
+ }
2369
+ const answers = { ...(item.humanAnswers ?? {}), [input.questionId]: input.optionId };
2370
+ this.db.prepare("UPDATE queue_items SET human_answers = ? WHERE qitem_id = ?").run(JSON.stringify(answers), input.qitemId);
2371
+ const complete = unansweredQuestions(item.humanQuestions, answers).length === 0;
2372
+ return { status: "recorded", answers, complete, questions: item.humanQuestions };
2373
+ })();
2374
+ }
2275
2375
  getById(qitemId) {
2276
2376
  const row = this.db
2277
2377
  .prepare("SELECT * FROM queue_items WHERE qitem_id = ?")
@@ -2286,8 +2386,36 @@ export class QueueRepository {
2286
2386
  ...item,
2287
2387
  deliveryOutcome: ledger?.outcome ?? null,
2288
2388
  ...(ledger && ledger.outcome !== "posted" ? { deliveryFailureDetail: ledger.detail } : {}),
2389
+ ...(item.replyTo ? { replyToFallback: this.replyToFallbackFor(item.qitemId) } : {}),
2289
2390
  };
2290
2391
  }
2392
+ /** #96 — the thread choice the daemon recorded before this replyTo update's first post;
2393
+ * null = not yet chosen. Only an in-process daemon write counts: any HTTP write carries an
2394
+ * identity provenance (and its actor is caller-asserted), so a note from there could forge
2395
+ * a thread and is ignored. */
2396
+ replyToChoiceFor(qitemId) {
2397
+ for (const t of this.transitionLog.listForQitem(qitemId).reverse()) {
2398
+ if (t.actorSession !== REPLY_TO_CHOICE_ACTOR || t.identityProvenance !== null)
2399
+ continue;
2400
+ const choice = parseReplyToChoice(t.transitionNote ?? "");
2401
+ if (choice)
2402
+ return choice;
2403
+ }
2404
+ return null;
2405
+ }
2406
+ /** #96 — whether some update recorded this Slack root as the thread it posts into. Such a
2407
+ * root is shared: its owner's next decision must not reuse it (see slack-subsystem). */
2408
+ isReplyToThread(threadTs) {
2409
+ if (!this.hasQueueTransitionsTable)
2410
+ return false;
2411
+ // Same trust rule as replyToChoiceFor: a pre-provenance schema reads every row as null.
2412
+ const provenance = this.hasTransitionProvenanceColumn ? " AND identity_provenance IS NULL" : "";
2413
+ return this.db.prepare(`SELECT 1 FROM queue_transitions WHERE transition_note = ? AND actor_session = ?${provenance} LIMIT 1`).get(formatReplyToChoice({ kind: "thread", threadTs }), REPLY_TO_CHOICE_ACTOR) !== undefined;
2414
+ }
2415
+ replyToFallbackFor(qitemId) {
2416
+ const choice = this.replyToChoiceFor(qitemId);
2417
+ return choice?.kind === "fallback" ? describeReplyToFallback(choice) : null;
2418
+ }
2291
2419
  list(opts) {
2292
2420
  const limit = opts?.limit ?? 100;
2293
2421
  const conditions = [];
@@ -2479,6 +2607,57 @@ export class QueueRepository {
2479
2607
  const rows = this.db.prepare(sql).all(...params);
2480
2608
  return rows.map((r) => this.rowToItem(r, !opts?.compact));
2481
2609
  }
2610
+ /**
2611
+ * Record that an in-progress queue item has exceeded its closure_required_at
2612
+ * deadline, appending a transition note and emitting `qitem.closure_overdue`.
2613
+ *
2614
+ * Deduplicated: if this obligation has already recorded `closure-overdue`
2615
+ * since it was claimed (or created), no duplicate event or transition is emitted.
2616
+ */
2617
+ recordClosureOverdue(qitemId, opts) {
2618
+ const qitem = this.getById(qitemId);
2619
+ if (!qitem || qitem.state !== "in-progress" || !qitem.closureRequiredAt)
2620
+ return null;
2621
+ const cutoff = opts?.now ?? new Date().toISOString();
2622
+ if (qitem.closureRequiredAt > cutoff)
2623
+ return null;
2624
+ const claimSince = qitem.claimedAt ?? qitem.tsCreated;
2625
+ if (this.hasQueueTransitionsTable) {
2626
+ const alreadyRecorded = this.db.prepare(`SELECT 1 FROM queue_transitions WHERE qitem_id = ? AND transition_note = 'closure-overdue' AND ts >= ? LIMIT 1`).get(qitemId, claimSince);
2627
+ if (alreadyRecorded)
2628
+ return null;
2629
+ if (detectTable(this.db, "queue_transitions_archive")) {
2630
+ const alreadyRecordedArchive = this.db.prepare(`SELECT 1 FROM queue_transitions_archive WHERE qitem_id = ? AND transition_note = 'closure-overdue' AND ts >= ? LIMIT 1`).get(qitemId, claimSince);
2631
+ if (alreadyRecordedArchive)
2632
+ return null;
2633
+ }
2634
+ }
2635
+ else {
2636
+ const alreadyRecorded = this.db.prepare(`SELECT 1 FROM events WHERE type = 'qitem.closure_overdue' AND json_extract(payload, '$.qitemId') = ? AND julianday(created_at) >= julianday(?) LIMIT 1`).get(qitemId, claimSince);
2637
+ if (alreadyRecorded)
2638
+ return null;
2639
+ }
2640
+ const txn = this.db.transaction(() => {
2641
+ if (this.hasQueueTransitionsTable) {
2642
+ this.transitionLog.append({
2643
+ qitemId,
2644
+ state: qitem.state,
2645
+ actorSession: "daemon@system",
2646
+ transitionNote: "closure-overdue",
2647
+ });
2648
+ }
2649
+ return this.eventBus.persistWithinTransaction({
2650
+ type: "qitem.closure_overdue",
2651
+ qitemId,
2652
+ destinationSession: qitem.destinationSession,
2653
+ closureRequiredAt: qitem.closureRequiredAt,
2654
+ overdueSince: qitem.closureRequiredAt,
2655
+ });
2656
+ });
2657
+ const persisted = txn();
2658
+ this.eventBus.notifySubscribers(persisted);
2659
+ return persisted;
2660
+ }
2482
2661
  /**
2483
2662
  * Surface two evidence-backed undelivered classes: the original pending
2484
2663
  * create-path nudge failures, and active human-notification episodes whose
@@ -2588,18 +2767,37 @@ export class QueueRepository {
2588
2767
  }
2589
2768
  /** Null means legacy/no OWNER history; inactive means OWNER history exists
2590
2769
  * but the row no longer projects a current human-notification episode. */
2591
- currentDeliveryEpisode(item) {
2592
- const transition = this.transitionLog.latestOwnerNotificationForQitem(item.qitemId);
2770
+ currentDeliveryEpisode(item, knownOwner) {
2771
+ let transition = knownOwner ?? this.transitionLog.latestOwnerNotificationForQitem(item.qitemId);
2593
2772
  if (!transition)
2594
2773
  return null;
2774
+ // A human-decision-resolved notice written BY the transition that closed the row (a human's direct reply closing
2775
+ // it) is never posted: the Slack outbound lists active rows only (listHumanAlerts), and that human just answered.
2776
+ // It opens no new delivery episode; the delivery that happened is the latest OUTBOUND notice's, to that human.
2777
+ // Judged by the notice's own transition, not the row's current state: a resolved notice written while the row
2778
+ // stayed active is a real delivery and keeps its outcome after an agent later closes the row.
2779
+ let resolvedBy = null;
2780
+ if (transition.ownerNotificationKind === "human-decision-resolved" && !["pending", "in-progress", "blocked"].includes(transition.state)) {
2781
+ const outbound = this.transitionLog.listForQitem(item.qitemId)
2782
+ .filter((t) => t.ownerNotificationLevel != null && t.ownerNotificationKind != null && t.ownerNotificationKind !== "human-decision-resolved")
2783
+ .sort((a, b) => b.transitionId - a.transitionId)[0];
2784
+ if (!outbound)
2785
+ return "inactive";
2786
+ resolvedBy = transition.actorSession;
2787
+ transition = outbound;
2788
+ }
2595
2789
  const registry = this.loadHumanRegistryFn();
2596
2790
  if (!registry.ok)
2597
2791
  return "inactive";
2598
- const humanAddress = transition.ownerNotificationKind === "human-decision-resolved"
2599
- ? resolveRegisteredHumanAddress(transition.actorSession, registry.entities)
2600
- : item.state === "blocked"
2601
- ? resolveRegisteredHumanAddress(item.blockedOn, registry.entities)
2602
- : resolveRegisteredHumanAddress(item.destinationSession, registry.entities);
2792
+ // After that fallback the recipient is the human who answered: the row may be an agent's that was parked on them
2793
+ // (its destination is the agent, and closing cleared blocked_on).
2794
+ const humanAddress = resolvedBy !== null
2795
+ ? resolveRegisteredHumanAddress(resolvedBy, registry.entities)
2796
+ : transition.ownerNotificationKind === "human-decision-resolved"
2797
+ ? resolveRegisteredHumanAddress(transition.actorSession, registry.entities)
2798
+ : item.state === "blocked"
2799
+ ? resolveRegisteredHumanAddress(item.blockedOn, registry.entities)
2800
+ : resolveRegisteredHumanAddress(item.destinationSession, registry.entities);
2603
2801
  return humanAddress
2604
2802
  ? { notificationKey: `${item.qitemId}:${transition.transitionId}`, startedAt: transition.ts }
2605
2803
  : "inactive";
@@ -2609,6 +2807,32 @@ export class QueueRepository {
2609
2807
  * posted receipt cannot mask a later human park. Legacy pre-OWNER or literal
2610
2808
  * external rows retain their row-scoped fallback. */
2611
2809
  deliveryOutcomeFor(qitemId) {
2810
+ const ledger = this.deliveryLedger(qitemId);
2811
+ return ledger ? { outcome: ledger.outcome, detail: ledger.detail } : null;
2812
+ }
2813
+ /** #514 — true only when this row's CURRENT human-notification episode (OWNER history addressed
2814
+ * to a registered human, aliases included) has a POSTED receipt. Legacy rows with no OWNER
2815
+ * history, inactive episodes, never-posted and transport-failed all read false. Same derivation
2816
+ * as deliveryOutcomeFor; it reads row fields, never the waiting view. */
2817
+ humanNotificationPostedThisEpisode(qitemId) {
2818
+ if (!this.hasQueueTransitionsTable)
2819
+ return false;
2820
+ // Only the ask's own notification binds a recipient: create writes it in state pending, to the destination of
2821
+ // that moment. A park notice (its recipient is not retained), a resolution notice, or a later destination change
2822
+ // (routeToFallback opens no new episode) cannot establish that the current destination received this ask.
2823
+ const owner = this.transitionLog.latestOwnerNotificationForQitem(qitemId);
2824
+ if (!owner || owner.state !== "pending")
2825
+ return false;
2826
+ if (owner.ownerNotificationKind !== "human-required" && owner.ownerNotificationKind !== "human-update")
2827
+ return false;
2828
+ const rerouted = this.db.prepare("SELECT 1 FROM queue_transitions WHERE qitem_id = ? AND transition_id > ? AND transition_note LIKE 'fallback-routed:%' LIMIT 1").get(qitemId, owner.transitionId);
2829
+ if (rerouted)
2830
+ return false;
2831
+ // The ledger's episode exists only when the destination resolves to a registered human (aliases included).
2832
+ const ledger = this.deliveryLedger(qitemId, owner);
2833
+ return ledger !== null && ledger.outcome === "posted" && ledger.episode?.notificationKey === `${qitemId}:${owner.transitionId}`;
2834
+ }
2835
+ deliveryLedger(qitemId, knownOwner) {
2612
2836
  // Some repository-only fixtures intentionally model the pre-transition
2613
2837
  // schema. Delivery projection is additive there: absence means no verdict,
2614
2838
  // never a list failure.
@@ -2621,7 +2845,7 @@ export class QueueRepository {
2621
2845
  // The delivery episode uses row fields, not the waiting/backstop view.
2622
2846
  // Keep this read fresh without repeating the caller's recovery-tag scan.
2623
2847
  const item = this.rowToItem(row, false);
2624
- const episodeState = this.currentDeliveryEpisode(item);
2848
+ const episodeState = this.currentDeliveryEpisode(item, knownOwner);
2625
2849
  if (episodeState === "inactive")
2626
2850
  return null;
2627
2851
  const episode = episodeState;
@@ -2634,17 +2858,17 @@ export class QueueRepository {
2634
2858
  : notes;
2635
2859
  const posted = currentNotes.find((note) => note.transition_note.startsWith("slack-owner-notification-posted "));
2636
2860
  if (posted)
2637
- return { outcome: "posted", detail: posted.transition_note };
2861
+ return { outcome: "posted", detail: posted.transition_note, episode };
2638
2862
  const failed = currentNotes.find((note) => note.transition_note.startsWith("slack-owner-notification-transport-failed "));
2639
2863
  if (failed)
2640
- return { outcome: "transport-failed", detail: failed.transition_note };
2864
+ return { outcome: "transport-failed", detail: failed.transition_note, episode };
2641
2865
  const startedAt = episode?.startedAt ?? item.tsCreated;
2642
2866
  const gatewayRouted = episode !== null || item.lastNudgeResult?.startsWith("gateway-owned") === true;
2643
2867
  if (gatewayRouted) {
2644
2868
  const ageMs = Date.now() - new Date(startedAt.includes("T") ? startedAt : startedAt + "Z").getTime();
2645
2869
  if (ageMs > QueueRepository.NEVER_POSTED_WINDOW_MS) {
2646
2870
  const key = episode ? ` for notification_key=${episode.notificationKey}` : "";
2647
- return { outcome: "never-posted", detail: `gateway-routed row with no delivery receipt${key} past the post window` };
2871
+ return { outcome: "never-posted", detail: `gateway-routed row with no delivery receipt${key} past the post window`, episode };
2648
2872
  }
2649
2873
  }
2650
2874
  return null;
@@ -2782,10 +3006,9 @@ export class QueueRepository {
2782
3006
  workflowGuidance;
2783
3007
  attachWorkflowGuidance(reader) { this.workflowGuidance = reader; }
2784
3008
  evaluateWaitReminder(input) {
2785
- if (this.wakeRepo.findQitemsByAttachedWatchdog(input.jobId).length > 0
2786
- && this.wakeRepo.findQitemsByGeneratedTimer(input.jobId).every(row => row.state !== "blocked"))
3009
+ const binding = this.wakeRepo.findCurrentQitemsByGeneratedTimer(input.jobId)[0];
3010
+ if (!binding && this.wakeRepo.findLiveQitemsByAttachedWatchdog(input.jobId).length > 0)
2787
3011
  return null;
2788
- const binding = this.wakeRepo.findBlockedQitemsByWatchdog(input.jobId).find(row => row.kind === "timer");
2789
3012
  const result = evaluateQueueWait(this.watchdogJobsRepo ?? new WatchdogJobsRepository(this.db), input.jobId, binding ? this.waitingView(binding.qitemId) : null);
2790
3013
  // Only an already-admitted send reads prose: healthy silence, receipts and
2791
3014
  // failed-delivery retries remain owned by the existing wait evaluator.
@@ -2810,14 +3033,54 @@ export class QueueRepository {
2810
3033
  waitingView(qitemId) {
2811
3034
  const view = readWaitingView(this.db, qitemId, this.activityReader);
2812
3035
  if (view && ["pending", "in-progress"].includes(view.state)) {
3036
+ // #514 — the unclaimed sweep skips a pending ask already posted to its human in the current
3037
+ // episode (same predicate as runStuckSweep), so the view must not promise that sweep.
3038
+ const awaitingHuman = view.state === "pending" && this.humanNotificationPostedThisEpisode(qitemId);
3039
+ if (awaitingHuman) {
3040
+ view.nextBackstop = { owner: view.owner, mechanism: "none (posted to the human; awaiting their decision)", dueAt: null, intervalSeconds: null };
3041
+ }
2813
3042
  const recovery = readWakeLadderBackstop(this.db, qitemId);
2814
3043
  if (recovery) {
2815
- view.laterBackstop = { ...view.nextBackstop, note: "Conditional safety net; current delivery/recovery ownership is evaluated first." };
3044
+ if (!awaitingHuman)
3045
+ view.laterBackstop = { ...view.nextBackstop, note: "Conditional safety net; current delivery/recovery ownership is evaluated first." };
2816
3046
  view.nextBackstop = recovery;
2817
3047
  }
2818
3048
  }
2819
3049
  return view;
2820
3050
  }
3051
+ handoffAdvisory(row) {
3052
+ // handoff() creates its local successor in the same transaction. Do not
3053
+ // scan successor history again on every projection of those source rows.
3054
+ if (row.state === "handed-off" || !isTerminalState(row.state)
3055
+ || row.closure_reason !== "handed_off_to" || !row.closure_target)
3056
+ return undefined;
3057
+ const target = row.closure_target;
3058
+ try {
3059
+ const successor = this.db.prepare(`SELECT 1 FROM queue_items s
3060
+ WHERE (s.qitem_id = ? OR s.destination_session = ?) AND s.qitem_id != ?
3061
+ AND (s.handed_off_from = ? OR EXISTS (
3062
+ SELECT 1 FROM json_each(s.chain_of_record) WHERE value = ?
3063
+ )) LIMIT 1`).get(target, target, row.qitem_id, row.qitem_id, row.qitem_id);
3064
+ // A linked row may have handed on to another owner. Its current state
3065
+ // does not establish whether later hops still hold the work.
3066
+ if (successor)
3067
+ return undefined;
3068
+ }
3069
+ catch {
3070
+ // Optional reporting must not fail a close that has already committed,
3071
+ // or describe an unavailable lookup as proof of a missing local row.
3072
+ return undefined;
3073
+ }
3074
+ const foreignTarget = /^qitem-[^@]+@[^@]+$/.test(target);
3075
+ return {
3076
+ status: "unverified",
3077
+ target,
3078
+ reason: "no-live-local-successor",
3079
+ message: foreignTarget
3080
+ ? `Successor custody for '${target}' is unverified on this daemon: the successor is named on that host, and this daemon cannot read its custody. This closure records a handoff claim, not proof of transfer or pickup.`
3081
+ : `Successor custody for '${target}' is unverified on this daemon: no local row with this source's lineage was found. A successor may exist on another host. This closure records a handoff claim, not proof of transfer or pickup; reconcile the successor by ID.`,
3082
+ };
3083
+ }
2821
3084
  rowToItem(row, includeWaiting = true) {
2822
3085
  // S04 — derive the pickup receipt at the ONE shared projection point (list/show/overdue
2823
3086
  // all flow through here), so the park-vs-strand question is answered by the row face.
@@ -2833,7 +3096,9 @@ export class QueueRepository {
2833
3096
  lastHeartbeat: row.last_heartbeat,
2834
3097
  postClaimMotionCount: 0, // this reader supplies the current meaningful timestamp
2835
3098
  });
3099
+ const handoffAdvisory = this.handoffAdvisory(row);
2836
3100
  return {
3101
+ ...(handoffAdvisory ? { handoffAdvisory } : {}),
2837
3102
  pickup,
2838
3103
  ...(waiting ? { waiting } : {}),
2839
3104
  qitemId: row.qitem_id,
@@ -2859,6 +3124,9 @@ export class QueueRepository {
2859
3124
  evidenceRef: row.evidence_ref ?? null,
2860
3125
  humanIntent: row.human_intent ?? null,
2861
3126
  humanDetail: row.human_detail ?? null,
3127
+ replyTo: row.reply_to ?? null,
3128
+ humanQuestions: row.human_questions ? JSON.parse(row.human_questions) : null,
3129
+ humanAnswers: row.human_answers ? JSON.parse(row.human_answers) : null,
2862
3130
  closureReason: row.closure_reason,
2863
3131
  closureTarget: row.closure_target,
2864
3132
  closureRequiredAt: row.closure_required_at,