@openrig/cli 0.7.17 → 0.7.19

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 +7 -6
  2. package/daemon/assets/claude-hook-bridge.cjs +146 -0
  3. package/daemon/assets/plugins/openrig/.claude-plugin/plugin.json +1 -1
  4. package/daemon/assets/plugins/openrig/.codex-plugin/plugin.json +1 -1
  5. package/daemon/assets/plugins/openrig/.cursor-plugin/plugin.json +1 -1
  6. package/daemon/assets/plugins/openrig/plugin.json +1 -1
  7. package/daemon/assets/plugins/openrig-core/.claude-plugin/plugin.json +1 -1
  8. package/daemon/assets/plugins/openrig-core/.codex-plugin/plugin.json +1 -1
  9. package/daemon/assets/plugins/openrig-core/README.md +1 -1
  10. package/daemon/assets/plugins/openrig-core/hooks/claude.json +14 -14
  11. package/daemon/assets/plugins/openrig-core/hooks/scripts/activity-relay.cjs +43 -22
  12. package/daemon/assets/plugins/openrig-core/hooks/scripts/refocus.cjs +6 -0
  13. package/daemon/assets/plugins/openrig-core/skills/messaging-the-human/SKILL.md +23 -0
  14. package/daemon/assets/plugins/openrig-core/skills/mission-slice-sop/SKILL.md +1 -1
  15. package/daemon/assets/plugins/openrig-core/skills/openrig-user/SKILL.md +11 -0
  16. package/daemon/assets/plugins/openrig-core/skills/refocusing/scripts/trace-to-root.py +95 -7
  17. package/daemon/assets/skills/rigs/SKILL.md +68 -33
  18. package/daemon/assets/skills/rigs/references/installing-for-someone.md +2 -2
  19. package/daemon/context-packs/help/manifest.yaml +1 -1
  20. package/daemon/context-packs/onboarding-width/manifest.yaml +1 -1
  21. package/daemon/context-packs/onboarding-width/public-what-you-can-do.md +57 -14
  22. package/daemon/context-packs/reference/getting-started.md +9 -4
  23. package/daemon/context-packs/reference/manifest.yaml +1 -1
  24. package/daemon/context-packs/reference/rig-spec.md +197 -1
  25. package/daemon/context-packs/reference/whats-new.md +187 -15
  26. package/daemon/context-packs/skills/agent-operated-software/manifest.yaml +1 -1
  27. package/daemon/context-packs/skills/agent-operated-workflows/manifest.yaml +1 -1
  28. package/daemon/context-packs/skills/applying-a-permission-policy/manifest.yaml +1 -1
  29. package/daemon/context-packs/skills/claude-compaction-restore/manifest.yaml +1 -1
  30. package/daemon/context-packs/skills/core/agent-starters/manifest.yaml +1 -1
  31. package/daemon/context-packs/skills/core/agent-startup-and-context-ingestion/manifest.yaml +1 -1
  32. package/daemon/context-packs/skills/core/cross-host-rig-commands/manifest.yaml +1 -1
  33. package/daemon/context-packs/skills/core/human-in-the-loop/manifest.yaml +1 -1
  34. package/daemon/context-packs/skills/core/messaging-the-human/SKILL.md +23 -0
  35. package/daemon/context-packs/skills/core/messaging-the-human/manifest.yaml +1 -1
  36. package/daemon/context-packs/skills/core/openrig-architect/manifest.yaml +1 -1
  37. package/daemon/context-packs/skills/core/openrig-cmux/manifest.yaml +1 -1
  38. package/daemon/context-packs/skills/core/openrig-herdr/manifest.yaml +1 -1
  39. package/daemon/context-packs/skills/core/openrig-skills/manifest.yaml +1 -1
  40. package/daemon/context-packs/skills/core/openrig-software-factory/manifest.yaml +1 -1
  41. package/daemon/context-packs/skills/core/openrig-upgrade/manifest.yaml +1 -1
  42. package/daemon/context-packs/skills/core/rig-bundles-and-shareable-artifacts/manifest.yaml +1 -1
  43. package/daemon/context-packs/skills/core/rig-lifecycle/manifest.yaml +1 -1
  44. package/daemon/context-packs/skills/core/session-source-fork/manifest.yaml +1 -1
  45. package/daemon/context-packs/skills/core/specification-system/manifest.yaml +1 -1
  46. package/daemon/context-packs/skills/core/topology-mutation-and-seat-management/manifest.yaml +1 -1
  47. package/daemon/context-packs/skills/core/watchdog/manifest.yaml +1 -1
  48. package/daemon/context-packs/skills/core/working-with-an-openrig-team/manifest.yaml +1 -1
  49. package/daemon/context-packs/skills/delegating-work/manifest.yaml +1 -1
  50. package/daemon/context-packs/skills/forming-an-openrig-mental-model/manifest.yaml +1 -1
  51. package/daemon/context-packs/skills/loading-addressable-markdown/manifest.yaml +1 -1
  52. package/daemon/context-packs/skills/mission-slice-sop/SKILL.md +1 -1
  53. package/daemon/context-packs/skills/mission-slice-sop/manifest.yaml +1 -1
  54. package/daemon/context-packs/skills/openrig-operating-model/manifest.yaml +1 -1
  55. package/daemon/context-packs/skills/openrig-user/SKILL.md +11 -0
  56. package/daemon/context-packs/skills/openrig-user/manifest.yaml +1 -1
  57. package/daemon/context-packs/skills/orienting-to-an-inherited-seat/manifest.yaml +1 -1
  58. package/daemon/context-packs/skills/pm/backlog-capture/manifest.yaml +1 -1
  59. package/daemon/context-packs/skills/pm/context-builder/manifest.yaml +1 -1
  60. package/daemon/context-packs/skills/pm/exec-summary/manifest.yaml +1 -1
  61. package/daemon/context-packs/skills/pm/office-hours/manifest.yaml +1 -1
  62. package/daemon/context-packs/skills/pm/plan-review/manifest.yaml +1 -1
  63. package/daemon/context-packs/skills/pm/requirements-writer/manifest.yaml +1 -1
  64. package/daemon/context-packs/skills/pm/ui-mockup/manifest.yaml +1 -1
  65. package/daemon/context-packs/skills/pods/development-team/manifest.yaml +1 -1
  66. package/daemon/context-packs/skills/pods/orchestration-team/manifest.yaml +1 -1
  67. package/daemon/context-packs/skills/pods/oversight-team/manifest.yaml +1 -1
  68. package/daemon/context-packs/skills/pods/review-team/manifest.yaml +1 -1
  69. package/daemon/context-packs/skills/process/agent-browser/manifest.yaml +1 -1
  70. package/daemon/context-packs/skills/process/context-engineering/manifest.yaml +1 -1
  71. package/daemon/context-packs/skills/process/dogfood/manifest.yaml +1 -1
  72. package/daemon/context-packs/skills/process/frontend-design/manifest.yaml +1 -1
  73. package/daemon/context-packs/skills/process/systematic-debugging/manifest.yaml +1 -1
  74. package/daemon/context-packs/skills/process/test-driven-development/manifest.yaml +1 -1
  75. package/daemon/context-packs/skills/process/verification-before-completion/manifest.yaml +1 -1
  76. package/daemon/context-packs/skills/queue-handoff/manifest.yaml +1 -1
  77. package/daemon/context-packs/skills/refocusing/manifest.yaml +1 -1
  78. package/daemon/context-packs/skills/refocusing/scripts/trace-to-root.py +95 -7
  79. package/daemon/context-packs/skills/retiring-and-inheriting-a-seat/manifest.yaml +1 -1
  80. package/daemon/context-packs/skills/seat-continuity-and-handover/manifest.yaml +1 -1
  81. package/daemon/context-packs/skills/session-compaction-and-restore/manifest.yaml +1 -1
  82. package/daemon/context-packs/skills/software-for-agents/manifest.yaml +1 -1
  83. package/daemon/context-packs/world-example/manifest.yaml +1 -1
  84. package/daemon/context-packs/world-public/manifest.yaml +1 -1
  85. package/daemon/dist/adapters/claude-code-adapter.d.ts +9 -0
  86. package/daemon/dist/adapters/claude-code-adapter.d.ts.map +1 -1
  87. package/daemon/dist/adapters/claude-code-adapter.js +57 -9
  88. package/daemon/dist/adapters/claude-code-adapter.js.map +1 -1
  89. package/daemon/dist/adapters/claude-resume.d.ts +4 -1
  90. package/daemon/dist/adapters/claude-resume.d.ts.map +1 -1
  91. package/daemon/dist/adapters/claude-resume.js +15 -5
  92. package/daemon/dist/adapters/claude-resume.js.map +1 -1
  93. package/daemon/dist/adapters/codex-runtime-adapter.d.ts +5 -0
  94. package/daemon/dist/adapters/codex-runtime-adapter.d.ts.map +1 -1
  95. package/daemon/dist/adapters/codex-runtime-adapter.js +45 -10
  96. package/daemon/dist/adapters/codex-runtime-adapter.js.map +1 -1
  97. package/daemon/dist/adapters/kernel-authority.d.ts +8 -1
  98. package/daemon/dist/adapters/kernel-authority.d.ts.map +1 -1
  99. package/daemon/dist/adapters/kernel-authority.js +45 -10
  100. package/daemon/dist/adapters/kernel-authority.js.map +1 -1
  101. package/daemon/dist/adapters/pi-resume.d.ts.map +1 -1
  102. package/daemon/dist/adapters/pi-resume.js +5 -7
  103. package/daemon/dist/adapters/pi-resume.js.map +1 -1
  104. package/daemon/dist/adapters/pi-runner-protocol.d.ts +47 -0
  105. package/daemon/dist/adapters/pi-runner-protocol.d.ts.map +1 -1
  106. package/daemon/dist/adapters/pi-runner-protocol.js.map +1 -1
  107. package/daemon/dist/adapters/pi-runner.d.ts +84 -1
  108. package/daemon/dist/adapters/pi-runner.d.ts.map +1 -1
  109. package/daemon/dist/adapters/pi-runner.js +799 -16
  110. package/daemon/dist/adapters/pi-runner.js.map +1 -1
  111. package/daemon/dist/adapters/pi-runtime-adapter.d.ts +7 -1
  112. package/daemon/dist/adapters/pi-runtime-adapter.d.ts.map +1 -1
  113. package/daemon/dist/adapters/pi-runtime-adapter.js +29 -19
  114. package/daemon/dist/adapters/pi-runtime-adapter.js.map +1 -1
  115. package/daemon/dist/adapters/tmux-credential-env.d.ts +4 -0
  116. package/daemon/dist/adapters/tmux-credential-env.d.ts.map +1 -0
  117. package/daemon/dist/adapters/tmux-credential-env.js +14 -0
  118. package/daemon/dist/adapters/tmux-credential-env.js.map +1 -0
  119. package/daemon/dist/adapters/tmux-exec.d.ts.map +1 -1
  120. package/daemon/dist/adapters/tmux-exec.js +4 -3
  121. package/daemon/dist/adapters/tmux-exec.js.map +1 -1
  122. package/daemon/dist/adapters/tmux-server.d.ts +2 -2
  123. package/daemon/dist/adapters/tmux-server.d.ts.map +1 -1
  124. package/daemon/dist/adapters/tmux-server.js +12 -4
  125. package/daemon/dist/adapters/tmux-server.js.map +1 -1
  126. package/daemon/dist/adapters/tmux.d.ts +242 -14
  127. package/daemon/dist/adapters/tmux.d.ts.map +1 -1
  128. package/daemon/dist/adapters/tmux.js +966 -34
  129. package/daemon/dist/adapters/tmux.js.map +1 -1
  130. package/daemon/dist/attention-surface.d.ts +4 -1
  131. package/daemon/dist/attention-surface.d.ts.map +1 -1
  132. package/daemon/dist/attention-surface.js.map +1 -1
  133. package/daemon/dist/build-info.js +3 -3
  134. package/daemon/dist/db/all-migrations.d.ts.map +1 -1
  135. package/daemon/dist/db/all-migrations.js +14 -0
  136. package/daemon/dist/db/all-migrations.js.map +1 -1
  137. package/daemon/dist/db/migrations/171_claude_auto_mode.d.ts +4 -0
  138. package/daemon/dist/db/migrations/171_claude_auto_mode.d.ts.map +1 -0
  139. package/daemon/dist/db/migrations/171_claude_auto_mode.js +9 -0
  140. package/daemon/dist/db/migrations/171_claude_auto_mode.js.map +1 -0
  141. package/daemon/dist/db/migrations/171_node_input_route.d.ts +4 -0
  142. package/daemon/dist/db/migrations/171_node_input_route.d.ts.map +1 -0
  143. package/daemon/dist/db/migrations/171_node_input_route.js +6 -0
  144. package/daemon/dist/db/migrations/171_node_input_route.js.map +1 -0
  145. package/daemon/dist/db/migrations/171_seat_hook_bridge.d.ts +5 -0
  146. package/daemon/dist/db/migrations/171_seat_hook_bridge.d.ts.map +1 -0
  147. package/daemon/dist/db/migrations/171_seat_hook_bridge.js +25 -0
  148. package/daemon/dist/db/migrations/171_seat_hook_bridge.js.map +1 -0
  149. package/daemon/dist/db/migrations/172_queue_return_route.d.ts +3 -0
  150. package/daemon/dist/db/migrations/172_queue_return_route.d.ts.map +1 -0
  151. package/daemon/dist/db/migrations/172_queue_return_route.js +13 -0
  152. package/daemon/dist/db/migrations/172_queue_return_route.js.map +1 -0
  153. package/daemon/dist/db/migrations/173_node_process_limits.d.ts +4 -0
  154. package/daemon/dist/db/migrations/173_node_process_limits.d.ts.map +1 -0
  155. package/daemon/dist/db/migrations/173_node_process_limits.js +6 -0
  156. package/daemon/dist/db/migrations/173_node_process_limits.js.map +1 -0
  157. package/daemon/dist/db/migrations/174_session_launched_cwd.d.ts +6 -0
  158. package/daemon/dist/db/migrations/174_session_launched_cwd.d.ts.map +1 -0
  159. package/daemon/dist/db/migrations/174_session_launched_cwd.js +8 -0
  160. package/daemon/dist/db/migrations/174_session_launched_cwd.js.map +1 -0
  161. package/daemon/dist/db/migrations/175_core_app_access.d.ts +3 -0
  162. package/daemon/dist/db/migrations/175_core_app_access.d.ts.map +1 -0
  163. package/daemon/dist/db/migrations/175_core_app_access.js +26 -0
  164. package/daemon/dist/db/migrations/175_core_app_access.js.map +1 -0
  165. package/daemon/dist/domain/activity-grants.d.ts.map +1 -1
  166. package/daemon/dist/domain/activity-grants.js +8 -4
  167. package/daemon/dist/domain/activity-grants.js.map +1 -1
  168. package/daemon/dist/domain/agent-activity-store.d.ts +59 -1
  169. package/daemon/dist/domain/agent-activity-store.d.ts.map +1 -1
  170. package/daemon/dist/domain/agent-activity-store.js +250 -4
  171. package/daemon/dist/domain/agent-activity-store.js.map +1 -1
  172. package/daemon/dist/domain/agent-images/resume-token-discovery.d.ts +10 -0
  173. package/daemon/dist/domain/agent-images/resume-token-discovery.d.ts.map +1 -1
  174. package/daemon/dist/domain/agent-images/resume-token-discovery.js +21 -0
  175. package/daemon/dist/domain/agent-images/resume-token-discovery.js.map +1 -1
  176. package/daemon/dist/domain/applied-launch-observation-store.d.ts +5 -0
  177. package/daemon/dist/domain/applied-launch-observation-store.d.ts.map +1 -1
  178. package/daemon/dist/domain/applied-launch-observation-store.js +57 -21
  179. package/daemon/dist/domain/applied-launch-observation-store.js.map +1 -1
  180. package/daemon/dist/domain/builtin-startup-files.d.ts +26 -12
  181. package/daemon/dist/domain/builtin-startup-files.d.ts.map +1 -1
  182. package/daemon/dist/domain/builtin-startup-files.js +73 -34
  183. package/daemon/dist/domain/builtin-startup-files.js.map +1 -1
  184. package/daemon/dist/domain/claude-activity-hooks.d.ts +4 -2
  185. package/daemon/dist/domain/claude-activity-hooks.d.ts.map +1 -1
  186. package/daemon/dist/domain/claude-activity-hooks.js +5 -3
  187. package/daemon/dist/domain/claude-activity-hooks.js.map +1 -1
  188. package/daemon/dist/domain/claude-auto-mode.d.ts +64 -0
  189. package/daemon/dist/domain/claude-auto-mode.d.ts.map +1 -0
  190. package/daemon/dist/domain/claude-auto-mode.js +114 -0
  191. package/daemon/dist/domain/claude-auto-mode.js.map +1 -0
  192. package/daemon/dist/domain/claude-compaction-enforcer.d.ts +66 -3
  193. package/daemon/dist/domain/claude-compaction-enforcer.d.ts.map +1 -1
  194. package/daemon/dist/domain/claude-compaction-enforcer.js +214 -10
  195. package/daemon/dist/domain/claude-compaction-enforcer.js.map +1 -1
  196. package/daemon/dist/domain/claude-continuation-launch.d.ts +5 -1
  197. package/daemon/dist/domain/claude-continuation-launch.d.ts.map +1 -1
  198. package/daemon/dist/domain/claude-continuation-launch.js +51 -2
  199. package/daemon/dist/domain/claude-continuation-launch.js.map +1 -1
  200. package/daemon/dist/domain/claude-core-plugin-env.d.ts +7 -3
  201. package/daemon/dist/domain/claude-core-plugin-env.d.ts.map +1 -1
  202. package/daemon/dist/domain/claude-core-plugin-env.js +11 -8
  203. package/daemon/dist/domain/claude-core-plugin-env.js.map +1 -1
  204. package/daemon/dist/domain/codex-daemon-support.d.ts.map +1 -1
  205. package/daemon/dist/domain/codex-daemon-support.js +6 -1
  206. package/daemon/dist/domain/codex-daemon-support.js.map +1 -1
  207. package/daemon/dist/domain/community-harness-launch-result.d.ts +2 -0
  208. package/daemon/dist/domain/community-harness-launch-result.d.ts.map +1 -1
  209. package/daemon/dist/domain/community-harness-launch-result.js +5 -1
  210. package/daemon/dist/domain/community-harness-launch-result.js.map +1 -1
  211. package/daemon/dist/domain/compaction-restore-notice.d.ts +3 -1
  212. package/daemon/dist/domain/compaction-restore-notice.d.ts.map +1 -1
  213. package/daemon/dist/domain/compaction-restore-notice.js +22 -3
  214. package/daemon/dist/domain/compaction-restore-notice.js.map +1 -1
  215. package/daemon/dist/domain/configured-account.d.ts +3 -0
  216. package/daemon/dist/domain/configured-account.d.ts.map +1 -0
  217. package/daemon/dist/domain/configured-account.js +10 -0
  218. package/daemon/dist/domain/configured-account.js.map +1 -0
  219. package/daemon/dist/domain/connection-contract.d.ts +91 -0
  220. package/daemon/dist/domain/connection-contract.d.ts.map +1 -1
  221. package/daemon/dist/domain/connection-contract.js +73 -0
  222. package/daemon/dist/domain/connection-contract.js.map +1 -1
  223. package/daemon/dist/domain/context-usage-store.d.ts +5 -0
  224. package/daemon/dist/domain/context-usage-store.d.ts.map +1 -1
  225. package/daemon/dist/domain/context-usage-store.js +37 -2
  226. package/daemon/dist/domain/context-usage-store.js.map +1 -1
  227. package/daemon/dist/domain/core-app-access.d.ts +51 -0
  228. package/daemon/dist/domain/core-app-access.d.ts.map +1 -0
  229. package/daemon/dist/domain/core-app-access.js +107 -0
  230. package/daemon/dist/domain/core-app-access.js.map +1 -0
  231. package/daemon/dist/domain/core-app-job.d.ts +411 -0
  232. package/daemon/dist/domain/core-app-job.d.ts.map +1 -0
  233. package/daemon/dist/domain/core-app-job.js +537 -0
  234. package/daemon/dist/domain/core-app-job.js.map +1 -0
  235. package/daemon/dist/domain/current-park-arm.d.ts +4 -0
  236. package/daemon/dist/domain/current-park-arm.d.ts.map +1 -0
  237. package/daemon/dist/domain/current-park-arm.js +14 -0
  238. package/daemon/dist/domain/current-park-arm.js.map +1 -0
  239. package/daemon/dist/domain/current-work.d.ts +6 -1
  240. package/daemon/dist/domain/current-work.d.ts.map +1 -1
  241. package/daemon/dist/domain/current-work.js +41 -8
  242. package/daemon/dist/domain/current-work.js.map +1 -1
  243. package/daemon/dist/domain/cwd-resolution.d.ts +14 -0
  244. package/daemon/dist/domain/cwd-resolution.d.ts.map +1 -1
  245. package/daemon/dist/domain/cwd-resolution.js +28 -3
  246. package/daemon/dist/domain/cwd-resolution.js.map +1 -1
  247. package/daemon/dist/domain/draft-aware-delivery.d.ts.map +1 -1
  248. package/daemon/dist/domain/draft-aware-delivery.js +5 -1
  249. package/daemon/dist/domain/draft-aware-delivery.js.map +1 -1
  250. package/daemon/dist/domain/errors.d.ts +4 -0
  251. package/daemon/dist/domain/errors.d.ts.map +1 -1
  252. package/daemon/dist/domain/errors.js +7 -0
  253. package/daemon/dist/domain/errors.js.map +1 -1
  254. package/daemon/dist/domain/execution-view.d.ts.map +1 -1
  255. package/daemon/dist/domain/execution-view.js +17 -4
  256. package/daemon/dist/domain/execution-view.js.map +1 -1
  257. package/daemon/dist/domain/existing-rig-restore.d.ts +2 -0
  258. package/daemon/dist/domain/existing-rig-restore.d.ts.map +1 -1
  259. package/daemon/dist/domain/existing-rig-restore.js +1 -0
  260. package/daemon/dist/domain/existing-rig-restore.js.map +1 -1
  261. package/daemon/dist/domain/gateway/operator-delivery-engine.d.ts.map +1 -1
  262. package/daemon/dist/domain/gateway/operator-delivery-engine.js +107 -3
  263. package/daemon/dist/domain/gateway/operator-delivery-engine.js.map +1 -1
  264. package/daemon/dist/domain/gateway/participants.d.ts +2 -0
  265. package/daemon/dist/domain/gateway/participants.d.ts.map +1 -1
  266. package/daemon/dist/domain/gateway/participants.js +5 -1
  267. package/daemon/dist/domain/gateway/participants.js.map +1 -1
  268. package/daemon/dist/domain/gateway/slack/capabilities.d.ts +9 -1
  269. package/daemon/dist/domain/gateway/slack/capabilities.d.ts.map +1 -1
  270. package/daemon/dist/domain/gateway/slack/capabilities.js +6 -1
  271. package/daemon/dist/domain/gateway/slack/capabilities.js.map +1 -1
  272. package/daemon/dist/domain/gateway/slack/inbound-admission.js +1 -1
  273. package/daemon/dist/domain/gateway/slack/inbound-admission.js.map +1 -1
  274. package/daemon/dist/domain/gateway/slack/inbound.d.ts +4 -0
  275. package/daemon/dist/domain/gateway/slack/inbound.d.ts.map +1 -1
  276. package/daemon/dist/domain/gateway/slack/inbound.js +15 -1
  277. package/daemon/dist/domain/gateway/slack/inbound.js.map +1 -1
  278. package/daemon/dist/domain/gateway/slack/manifest.d.ts +5 -1
  279. package/daemon/dist/domain/gateway/slack/manifest.d.ts.map +1 -1
  280. package/daemon/dist/domain/gateway/slack/manifest.js +12 -3
  281. package/daemon/dist/domain/gateway/slack/manifest.js.map +1 -1
  282. package/daemon/dist/domain/gateway/slack/message.d.ts +2 -0
  283. package/daemon/dist/domain/gateway/slack/message.d.ts.map +1 -1
  284. package/daemon/dist/domain/gateway/slack/message.js +41 -18
  285. package/daemon/dist/domain/gateway/slack/message.js.map +1 -1
  286. package/daemon/dist/domain/gateway/slack/queue-access.d.ts +2 -0
  287. package/daemon/dist/domain/gateway/slack/queue-access.d.ts.map +1 -1
  288. package/daemon/dist/domain/gateway/slack/queue-access.js +1 -0
  289. package/daemon/dist/domain/gateway/slack/queue-access.js.map +1 -1
  290. package/daemon/dist/domain/gateway/slack/settled-asks.d.ts.map +1 -1
  291. package/daemon/dist/domain/gateway/slack/settled-asks.js +6 -5
  292. package/daemon/dist/domain/gateway/slack/settled-asks.js.map +1 -1
  293. package/daemon/dist/domain/gateway/slack/slack-api.d.ts +1 -0
  294. package/daemon/dist/domain/gateway/slack/slack-api.d.ts.map +1 -1
  295. package/daemon/dist/domain/gateway/slack/slack-api.js +7 -2
  296. package/daemon/dist/domain/gateway/slack/slack-api.js.map +1 -1
  297. package/daemon/dist/domain/gateway/slack/slack-delivery.d.ts +1 -0
  298. package/daemon/dist/domain/gateway/slack/slack-delivery.d.ts.map +1 -1
  299. package/daemon/dist/domain/gateway/slack/slack-delivery.js +2 -0
  300. package/daemon/dist/domain/gateway/slack/slack-delivery.js.map +1 -1
  301. package/daemon/dist/domain/gateway/slack/slack-subsystem.d.ts +4 -0
  302. package/daemon/dist/domain/gateway/slack/slack-subsystem.d.ts.map +1 -1
  303. package/daemon/dist/domain/gateway/slack/slack-subsystem.js +26 -2
  304. package/daemon/dist/domain/gateway/slack/slack-subsystem.js.map +1 -1
  305. package/daemon/dist/domain/harness-not-started-notice.d.ts +36 -0
  306. package/daemon/dist/domain/harness-not-started-notice.d.ts.map +1 -0
  307. package/daemon/dist/domain/harness-not-started-notice.js +81 -0
  308. package/daemon/dist/domain/harness-not-started-notice.js.map +1 -0
  309. package/daemon/dist/domain/hook-bridge.d.ts +345 -0
  310. package/daemon/dist/domain/hook-bridge.d.ts.map +1 -0
  311. package/daemon/dist/domain/hook-bridge.js +547 -0
  312. package/daemon/dist/domain/hook-bridge.js.map +1 -0
  313. package/daemon/dist/domain/hosted-wake.d.ts +9 -0
  314. package/daemon/dist/domain/hosted-wake.d.ts.map +1 -1
  315. package/daemon/dist/domain/hosted-wake.js +45 -6
  316. package/daemon/dist/domain/hosted-wake.js.map +1 -1
  317. package/daemon/dist/domain/hot-potato-enforcer.d.ts +1 -1
  318. package/daemon/dist/domain/human-ask-attention.d.ts +10 -0
  319. package/daemon/dist/domain/human-ask-attention.d.ts.map +1 -0
  320. package/daemon/dist/domain/human-ask-attention.js +22 -0
  321. package/daemon/dist/domain/human-ask-attention.js.map +1 -0
  322. package/daemon/dist/domain/input-read-diagnostic.js +1 -1
  323. package/daemon/dist/domain/input-read-diagnostic.js.map +1 -1
  324. package/daemon/dist/domain/instance-initialization.d.ts +2 -0
  325. package/daemon/dist/domain/instance-initialization.d.ts.map +1 -1
  326. package/daemon/dist/domain/instance-initialization.js +2 -1
  327. package/daemon/dist/domain/instance-initialization.js.map +1 -1
  328. package/daemon/dist/domain/member-connection.d.ts +14 -0
  329. package/daemon/dist/domain/member-connection.d.ts.map +1 -0
  330. package/daemon/dist/domain/member-connection.js +34 -0
  331. package/daemon/dist/domain/member-connection.js.map +1 -0
  332. package/daemon/dist/domain/mission-control/mission-control-action-log.d.ts +4 -0
  333. package/daemon/dist/domain/mission-control/mission-control-action-log.d.ts.map +1 -1
  334. package/daemon/dist/domain/mission-control/mission-control-action-log.js +8 -1
  335. package/daemon/dist/domain/mission-control/mission-control-action-log.js.map +1 -1
  336. package/daemon/dist/domain/mission-control/mission-control-write-contract.d.ts +10 -0
  337. package/daemon/dist/domain/mission-control/mission-control-write-contract.d.ts.map +1 -1
  338. package/daemon/dist/domain/mission-control/mission-control-write-contract.js +64 -12
  339. package/daemon/dist/domain/mission-control/mission-control-write-contract.js.map +1 -1
  340. package/daemon/dist/domain/model-divergence/current-model-reader.d.ts +3 -1
  341. package/daemon/dist/domain/model-divergence/current-model-reader.d.ts.map +1 -1
  342. package/daemon/dist/domain/model-divergence/current-model-reader.js +32 -7
  343. package/daemon/dist/domain/model-divergence/current-model-reader.js.map +1 -1
  344. package/daemon/dist/domain/native-continuation-notice.d.ts +16 -0
  345. package/daemon/dist/domain/native-continuation-notice.d.ts.map +1 -0
  346. package/daemon/dist/domain/native-continuation-notice.js +79 -0
  347. package/daemon/dist/domain/native-continuation-notice.js.map +1 -0
  348. package/daemon/dist/domain/native-permission-store.d.ts +6 -2
  349. package/daemon/dist/domain/native-permission-store.d.ts.map +1 -1
  350. package/daemon/dist/domain/native-permission-store.js +12 -5
  351. package/daemon/dist/domain/native-permission-store.js.map +1 -1
  352. package/daemon/dist/domain/native-process-lineage.d.ts +16 -0
  353. package/daemon/dist/domain/native-process-lineage.d.ts.map +1 -1
  354. package/daemon/dist/domain/native-process-lineage.js +48 -3
  355. package/daemon/dist/domain/native-process-lineage.js.map +1 -1
  356. package/daemon/dist/domain/native-resume-probe.d.ts +5 -0
  357. package/daemon/dist/domain/native-resume-probe.d.ts.map +1 -1
  358. package/daemon/dist/domain/native-resume-probe.js +94 -10
  359. package/daemon/dist/domain/native-resume-probe.js.map +1 -1
  360. package/daemon/dist/domain/network/network-connector.d.ts.map +1 -1
  361. package/daemon/dist/domain/network/network-connector.js +11 -2
  362. package/daemon/dist/domain/network/network-connector.js.map +1 -1
  363. package/daemon/dist/domain/node-inventory.d.ts.map +1 -1
  364. package/daemon/dist/domain/node-inventory.js +55 -6
  365. package/daemon/dist/domain/node-inventory.js.map +1 -1
  366. package/daemon/dist/domain/node-launcher.d.ts +14 -0
  367. package/daemon/dist/domain/node-launcher.d.ts.map +1 -1
  368. package/daemon/dist/domain/node-launcher.js +35 -6
  369. package/daemon/dist/domain/node-launcher.js.map +1 -1
  370. package/daemon/dist/domain/outbox-handler.d.ts +69 -1
  371. package/daemon/dist/domain/outbox-handler.d.ts.map +1 -1
  372. package/daemon/dist/domain/outbox-handler.js +337 -3
  373. package/daemon/dist/domain/outbox-handler.js.map +1 -1
  374. package/daemon/dist/domain/park-wake-text.d.ts +18 -0
  375. package/daemon/dist/domain/park-wake-text.d.ts.map +1 -1
  376. package/daemon/dist/domain/park-wake-text.js +44 -0
  377. package/daemon/dist/domain/park-wake-text.js.map +1 -1
  378. package/daemon/dist/domain/parked-query.d.ts.map +1 -1
  379. package/daemon/dist/domain/parked-query.js +3 -1
  380. package/daemon/dist/domain/parked-query.js.map +1 -1
  381. package/daemon/dist/domain/permission-account.d.ts +28 -1
  382. package/daemon/dist/domain/permission-account.d.ts.map +1 -1
  383. package/daemon/dist/domain/permission-account.js +55 -11
  384. package/daemon/dist/domain/permission-account.js.map +1 -1
  385. package/daemon/dist/domain/permission-drift.d.ts +2 -0
  386. package/daemon/dist/domain/permission-drift.d.ts.map +1 -1
  387. package/daemon/dist/domain/permission-drift.js.map +1 -1
  388. package/daemon/dist/domain/pi-compaction-request-store.d.ts +16 -0
  389. package/daemon/dist/domain/pi-compaction-request-store.d.ts.map +1 -0
  390. package/daemon/dist/domain/pi-compaction-request-store.js +40 -0
  391. package/daemon/dist/domain/pi-compaction-request-store.js.map +1 -0
  392. package/daemon/dist/domain/pi-compaction-service.d.ts +82 -0
  393. package/daemon/dist/domain/pi-compaction-service.d.ts.map +1 -0
  394. package/daemon/dist/domain/pi-compaction-service.js +229 -0
  395. package/daemon/dist/domain/pi-compaction-service.js.map +1 -0
  396. package/daemon/dist/domain/policies/idle-gate-qitem.d.ts +3 -0
  397. package/daemon/dist/domain/policies/idle-gate-qitem.d.ts.map +1 -1
  398. package/daemon/dist/domain/policies/idle-gate-qitem.js +15 -0
  399. package/daemon/dist/domain/policies/idle-gate-qitem.js.map +1 -1
  400. package/daemon/dist/domain/policies/parked-owner-consumer.d.ts +6 -1
  401. package/daemon/dist/domain/policies/parked-owner-consumer.d.ts.map +1 -1
  402. package/daemon/dist/domain/policies/parked-owner-consumer.js +28 -1
  403. package/daemon/dist/domain/policies/parked-owner-consumer.js.map +1 -1
  404. package/daemon/dist/domain/process-limits.d.ts +47 -0
  405. package/daemon/dist/domain/process-limits.d.ts.map +1 -0
  406. package/daemon/dist/domain/process-limits.js +123 -0
  407. package/daemon/dist/domain/process-limits.js.map +1 -0
  408. package/daemon/dist/domain/process-table.d.ts +24 -0
  409. package/daemon/dist/domain/process-table.d.ts.map +1 -1
  410. package/daemon/dist/domain/process-table.js +60 -4
  411. package/daemon/dist/domain/process-table.js.map +1 -1
  412. package/daemon/dist/domain/proof/judgments.d.ts +7 -0
  413. package/daemon/dist/domain/proof/judgments.d.ts.map +1 -1
  414. package/daemon/dist/domain/proof/judgments.js +27 -1
  415. package/daemon/dist/domain/proof/judgments.js.map +1 -1
  416. package/daemon/dist/domain/ps-projection.d.ts +2 -1
  417. package/daemon/dist/domain/ps-projection.d.ts.map +1 -1
  418. package/daemon/dist/domain/ps-projection.js +6 -1
  419. package/daemon/dist/domain/ps-projection.js.map +1 -1
  420. package/daemon/dist/domain/queue-erasure.d.ts +11 -6
  421. package/daemon/dist/domain/queue-erasure.d.ts.map +1 -1
  422. package/daemon/dist/domain/queue-erasure.js +47 -21
  423. package/daemon/dist/domain/queue-erasure.js.map +1 -1
  424. package/daemon/dist/domain/queue-repository.d.ts +122 -21
  425. package/daemon/dist/domain/queue-repository.d.ts.map +1 -1
  426. package/daemon/dist/domain/queue-repository.js +448 -101
  427. package/daemon/dist/domain/queue-repository.js.map +1 -1
  428. package/daemon/dist/domain/queue-stuck-sweep.d.ts +5 -0
  429. package/daemon/dist/domain/queue-stuck-sweep.d.ts.map +1 -1
  430. package/daemon/dist/domain/queue-stuck-sweep.js +74 -13
  431. package/daemon/dist/domain/queue-stuck-sweep.js.map +1 -1
  432. package/daemon/dist/domain/queue-transition-log.d.ts +5 -3
  433. package/daemon/dist/domain/queue-transition-log.d.ts.map +1 -1
  434. package/daemon/dist/domain/queue-transition-log.js +9 -6
  435. package/daemon/dist/domain/queue-transition-log.js.map +1 -1
  436. package/daemon/dist/domain/queue-waiting.d.ts.map +1 -1
  437. package/daemon/dist/domain/queue-waiting.js +28 -3
  438. package/daemon/dist/domain/queue-waiting.js.map +1 -1
  439. package/daemon/dist/domain/queue-wake-ladder.d.ts +20 -0
  440. package/daemon/dist/domain/queue-wake-ladder.d.ts.map +1 -1
  441. package/daemon/dist/domain/queue-wake-ladder.js +264 -25
  442. package/daemon/dist/domain/queue-wake-ladder.js.map +1 -1
  443. package/daemon/dist/domain/queue-wake-repository.d.ts +10 -1
  444. package/daemon/dist/domain/queue-wake-repository.d.ts.map +1 -1
  445. package/daemon/dist/domain/queue-wake-repository.js +79 -12
  446. package/daemon/dist/domain/queue-wake-repository.js.map +1 -1
  447. package/daemon/dist/domain/reconciler.d.ts +18 -2
  448. package/daemon/dist/domain/reconciler.d.ts.map +1 -1
  449. package/daemon/dist/domain/reconciler.js +40 -0
  450. package/daemon/dist/domain/reconciler.js.map +1 -1
  451. package/daemon/dist/domain/restore-attempt-receipt.d.ts.map +1 -1
  452. package/daemon/dist/domain/restore-attempt-receipt.js +3 -2
  453. package/daemon/dist/domain/restore-attempt-receipt.js.map +1 -1
  454. package/daemon/dist/domain/restore-check-service.d.ts +10 -0
  455. package/daemon/dist/domain/restore-check-service.d.ts.map +1 -1
  456. package/daemon/dist/domain/restore-check-service.js +76 -3
  457. package/daemon/dist/domain/restore-check-service.js.map +1 -1
  458. package/daemon/dist/domain/restore-orchestrator.d.ts +65 -3
  459. package/daemon/dist/domain/restore-orchestrator.d.ts.map +1 -1
  460. package/daemon/dist/domain/restore-orchestrator.js +311 -55
  461. package/daemon/dist/domain/restore-orchestrator.js.map +1 -1
  462. package/daemon/dist/domain/restore-plan-preview.d.ts +28 -1
  463. package/daemon/dist/domain/restore-plan-preview.d.ts.map +1 -1
  464. package/daemon/dist/domain/restore-plan-preview.js +17 -5
  465. package/daemon/dist/domain/restore-plan-preview.js.map +1 -1
  466. package/daemon/dist/domain/restore-preconditions.d.ts +24 -0
  467. package/daemon/dist/domain/restore-preconditions.d.ts.map +1 -1
  468. package/daemon/dist/domain/restore-preconditions.js +61 -1
  469. package/daemon/dist/domain/restore-preconditions.js.map +1 -1
  470. package/daemon/dist/domain/restore-topology.d.ts +7 -1
  471. package/daemon/dist/domain/restore-topology.d.ts.map +1 -1
  472. package/daemon/dist/domain/restore-topology.js +21 -0
  473. package/daemon/dist/domain/restore-topology.js.map +1 -1
  474. package/daemon/dist/domain/resume-metadata-refresher.d.ts +2 -3
  475. package/daemon/dist/domain/resume-metadata-refresher.d.ts.map +1 -1
  476. package/daemon/dist/domain/resume-metadata-refresher.js +6 -25
  477. package/daemon/dist/domain/resume-metadata-refresher.js.map +1 -1
  478. package/daemon/dist/domain/resume-token-validation.d.ts +3 -1
  479. package/daemon/dist/domain/resume-token-validation.d.ts.map +1 -1
  480. package/daemon/dist/domain/resume-token-validation.js +6 -3
  481. package/daemon/dist/domain/resume-token-validation.js.map +1 -1
  482. package/daemon/dist/domain/return-route.d.ts +73 -0
  483. package/daemon/dist/domain/return-route.d.ts.map +1 -0
  484. package/daemon/dist/domain/return-route.js +124 -0
  485. package/daemon/dist/domain/return-route.js.map +1 -0
  486. package/daemon/dist/domain/rig-expansion-service.js +1 -1
  487. package/daemon/dist/domain/rig-expansion-service.js.map +1 -1
  488. package/daemon/dist/domain/rig-repository.d.ts +12 -0
  489. package/daemon/dist/domain/rig-repository.d.ts.map +1 -1
  490. package/daemon/dist/domain/rig-repository.js +74 -0
  491. package/daemon/dist/domain/rig-repository.js.map +1 -1
  492. package/daemon/dist/domain/rig-teardown.d.ts +20 -5
  493. package/daemon/dist/domain/rig-teardown.d.ts.map +1 -1
  494. package/daemon/dist/domain/rig-teardown.js +105 -22
  495. package/daemon/dist/domain/rig-teardown.js.map +1 -1
  496. package/daemon/dist/domain/rigspec-codec.d.ts.map +1 -1
  497. package/daemon/dist/domain/rigspec-codec.js +9 -0
  498. package/daemon/dist/domain/rigspec-codec.js.map +1 -1
  499. package/daemon/dist/domain/rigspec-exporter.d.ts +6 -0
  500. package/daemon/dist/domain/rigspec-exporter.d.ts.map +1 -1
  501. package/daemon/dist/domain/rigspec-exporter.js +30 -0
  502. package/daemon/dist/domain/rigspec-exporter.js.map +1 -1
  503. package/daemon/dist/domain/rigspec-instantiator.d.ts +27 -2
  504. package/daemon/dist/domain/rigspec-instantiator.d.ts.map +1 -1
  505. package/daemon/dist/domain/rigspec-instantiator.js +95 -26
  506. package/daemon/dist/domain/rigspec-instantiator.js.map +1 -1
  507. package/daemon/dist/domain/rigspec-schema.d.ts.map +1 -1
  508. package/daemon/dist/domain/rigspec-schema.js +44 -1
  509. package/daemon/dist/domain/rigspec-schema.js.map +1 -1
  510. package/daemon/dist/domain/rosters.d.ts +23 -0
  511. package/daemon/dist/domain/rosters.d.ts.map +1 -1
  512. package/daemon/dist/domain/rosters.js +37 -5
  513. package/daemon/dist/domain/rosters.js.map +1 -1
  514. package/daemon/dist/domain/runner-channel.d.ts +65 -0
  515. package/daemon/dist/domain/runner-channel.d.ts.map +1 -0
  516. package/daemon/dist/domain/runner-channel.js +348 -0
  517. package/daemon/dist/domain/runner-channel.js.map +1 -0
  518. package/daemon/dist/domain/runner-grant-launch.js +2 -2
  519. package/daemon/dist/domain/runner-permissions.d.ts +26 -3
  520. package/daemon/dist/domain/runner-permissions.d.ts.map +1 -1
  521. package/daemon/dist/domain/runner-permissions.js +160 -39
  522. package/daemon/dist/domain/runner-permissions.js.map +1 -1
  523. package/daemon/dist/domain/runtime-adapter.d.ts +2 -0
  524. package/daemon/dist/domain/runtime-adapter.d.ts.map +1 -1
  525. package/daemon/dist/domain/runtime-adapter.js.map +1 -1
  526. package/daemon/dist/domain/runtime-switch-materials.d.ts.map +1 -1
  527. package/daemon/dist/domain/runtime-switch-materials.js +4 -3
  528. package/daemon/dist/domain/runtime-switch-materials.js.map +1 -1
  529. package/daemon/dist/domain/scope/mission-parent.d.ts +19 -0
  530. package/daemon/dist/domain/scope/mission-parent.d.ts.map +1 -0
  531. package/daemon/dist/domain/scope/mission-parent.js +134 -0
  532. package/daemon/dist/domain/scope/mission-parent.js.map +1 -0
  533. package/daemon/dist/domain/scope/scope-audit.d.ts.map +1 -1
  534. package/daemon/dist/domain/scope/scope-audit.js +63 -3
  535. package/daemon/dist/domain/scope/scope-audit.js.map +1 -1
  536. package/daemon/dist/domain/scope/types.d.ts +3 -1
  537. package/daemon/dist/domain/scope/types.d.ts.map +1 -1
  538. package/daemon/dist/domain/scope/types.js +5 -1
  539. package/daemon/dist/domain/scope/types.js.map +1 -1
  540. package/daemon/dist/domain/seat-attention-reconciler.d.ts +6 -4
  541. package/daemon/dist/domain/seat-attention-reconciler.d.ts.map +1 -1
  542. package/daemon/dist/domain/seat-attention-reconciler.js +17 -10
  543. package/daemon/dist/domain/seat-attention-reconciler.js.map +1 -1
  544. package/daemon/dist/domain/seat-delivery-guard.d.ts +14 -2
  545. package/daemon/dist/domain/seat-delivery-guard.d.ts.map +1 -1
  546. package/daemon/dist/domain/seat-delivery-guard.js +55 -15
  547. package/daemon/dist/domain/seat-delivery-guard.js.map +1 -1
  548. package/daemon/dist/domain/seat-handover-service.d.ts +27 -4
  549. package/daemon/dist/domain/seat-handover-service.d.ts.map +1 -1
  550. package/daemon/dist/domain/seat-handover-service.js +210 -65
  551. package/daemon/dist/domain/seat-handover-service.js.map +1 -1
  552. package/daemon/dist/domain/seat-identity-reconciler.d.ts +12 -4
  553. package/daemon/dist/domain/seat-identity-reconciler.d.ts.map +1 -1
  554. package/daemon/dist/domain/seat-identity-reconciler.js +92 -17
  555. package/daemon/dist/domain/seat-identity-reconciler.js.map +1 -1
  556. package/daemon/dist/domain/seat-lifecycle-service.d.ts +31 -6
  557. package/daemon/dist/domain/seat-lifecycle-service.d.ts.map +1 -1
  558. package/daemon/dist/domain/seat-lifecycle-service.js +172 -24
  559. package/daemon/dist/domain/seat-lifecycle-service.js.map +1 -1
  560. package/daemon/dist/domain/seat-restart-in-place.d.ts +9 -2
  561. package/daemon/dist/domain/seat-restart-in-place.d.ts.map +1 -1
  562. package/daemon/dist/domain/seat-restart-in-place.js +38 -3
  563. package/daemon/dist/domain/seat-restart-in-place.js.map +1 -1
  564. package/daemon/dist/domain/seat-runtime-switch-service.d.ts +4 -0
  565. package/daemon/dist/domain/seat-runtime-switch-service.d.ts.map +1 -1
  566. package/daemon/dist/domain/seat-runtime-switch-service.js +11 -3
  567. package/daemon/dist/domain/seat-runtime-switch-service.js.map +1 -1
  568. package/daemon/dist/domain/seat-skill-apply.d.ts +1 -1
  569. package/daemon/dist/domain/seat-skill-apply.d.ts.map +1 -1
  570. package/daemon/dist/domain/seat-skill-apply.js +3 -2
  571. package/daemon/dist/domain/seat-skill-apply.js.map +1 -1
  572. package/daemon/dist/domain/seat-status-service.d.ts +4 -0
  573. package/daemon/dist/domain/seat-status-service.d.ts.map +1 -1
  574. package/daemon/dist/domain/seat-status-service.js +31 -6
  575. package/daemon/dist/domain/seat-status-service.js.map +1 -1
  576. package/daemon/dist/domain/session-registry.d.ts +5 -1
  577. package/daemon/dist/domain/session-registry.d.ts.map +1 -1
  578. package/daemon/dist/domain/session-registry.js +12 -1
  579. package/daemon/dist/domain/session-registry.js.map +1 -1
  580. package/daemon/dist/domain/session-transport.d.ts +56 -4
  581. package/daemon/dist/domain/session-transport.d.ts.map +1 -1
  582. package/daemon/dist/domain/session-transport.js +344 -18
  583. package/daemon/dist/domain/session-transport.js.map +1 -1
  584. package/daemon/dist/domain/shared-conversation.d.ts +58 -0
  585. package/daemon/dist/domain/shared-conversation.d.ts.map +1 -0
  586. package/daemon/dist/domain/shared-conversation.js +98 -0
  587. package/daemon/dist/domain/shared-conversation.js.map +1 -0
  588. package/daemon/dist/domain/shared-history-selection.d.ts.map +1 -1
  589. package/daemon/dist/domain/shared-history-selection.js +9 -5
  590. package/daemon/dist/domain/shared-history-selection.js.map +1 -1
  591. package/daemon/dist/domain/slices/slice-indexer.d.ts +1 -1
  592. package/daemon/dist/domain/slices/slice-indexer.d.ts.map +1 -1
  593. package/daemon/dist/domain/slices/slice-indexer.js +4 -0
  594. package/daemon/dist/domain/slices/slice-indexer.js.map +1 -1
  595. package/daemon/dist/domain/startup-orchestrator.d.ts +1 -0
  596. package/daemon/dist/domain/startup-orchestrator.d.ts.map +1 -1
  597. package/daemon/dist/domain/startup-orchestrator.js +6 -4
  598. package/daemon/dist/domain/startup-orchestrator.js.map +1 -1
  599. package/daemon/dist/domain/startup-phase-timing.d.ts +19 -0
  600. package/daemon/dist/domain/startup-phase-timing.d.ts.map +1 -0
  601. package/daemon/dist/domain/startup-phase-timing.js +23 -0
  602. package/daemon/dist/domain/startup-phase-timing.js.map +1 -0
  603. package/daemon/dist/domain/successor-session-launcher.d.ts +9 -0
  604. package/daemon/dist/domain/successor-session-launcher.d.ts.map +1 -1
  605. package/daemon/dist/domain/successor-session-launcher.js +33 -10
  606. package/daemon/dist/domain/successor-session-launcher.js.map +1 -1
  607. package/daemon/dist/domain/team-operations.d.ts +6 -6
  608. package/daemon/dist/domain/team-operations.d.ts.map +1 -1
  609. package/daemon/dist/domain/team-operations.js +2 -4
  610. package/daemon/dist/domain/team-operations.js.map +1 -1
  611. package/daemon/dist/domain/terminal/herdr-adapter.d.ts +35 -1
  612. package/daemon/dist/domain/terminal/herdr-adapter.d.ts.map +1 -1
  613. package/daemon/dist/domain/terminal/herdr-adapter.js +231 -33
  614. package/daemon/dist/domain/terminal/herdr-adapter.js.map +1 -1
  615. package/daemon/dist/domain/terminal/herdr-app-provider.d.ts +6 -0
  616. package/daemon/dist/domain/terminal/herdr-app-provider.d.ts.map +1 -1
  617. package/daemon/dist/domain/terminal/herdr-app-provider.js +23 -1
  618. package/daemon/dist/domain/terminal/herdr-app-provider.js.map +1 -1
  619. package/daemon/dist/domain/terminal/herdr-sessions.d.ts.map +1 -1
  620. package/daemon/dist/domain/terminal/herdr-sessions.js +2 -1
  621. package/daemon/dist/domain/terminal/herdr-sessions.js.map +1 -1
  622. package/daemon/dist/domain/terminal/rig-viewer-records.d.ts +59 -0
  623. package/daemon/dist/domain/terminal/rig-viewer-records.d.ts.map +1 -0
  624. package/daemon/dist/domain/terminal/rig-viewer-records.js +210 -0
  625. package/daemon/dist/domain/terminal/rig-viewer-records.js.map +1 -0
  626. package/daemon/dist/domain/terminal/terminal-provider.d.ts +2 -0
  627. package/daemon/dist/domain/terminal/terminal-provider.d.ts.map +1 -1
  628. package/daemon/dist/domain/terminal/terminal-service.d.ts +99 -4
  629. package/daemon/dist/domain/terminal/terminal-service.d.ts.map +1 -1
  630. package/daemon/dist/domain/terminal/terminal-service.js +556 -36
  631. package/daemon/dist/domain/terminal/terminal-service.js.map +1 -1
  632. package/daemon/dist/domain/terminal/tile-layout.js +1 -1
  633. package/daemon/dist/domain/terminal/tile-layout.js.map +1 -1
  634. package/daemon/dist/domain/terminal/tmux-viewer-guard.d.ts +25 -0
  635. package/daemon/dist/domain/terminal/tmux-viewer-guard.d.ts.map +1 -0
  636. package/daemon/dist/domain/terminal/tmux-viewer-guard.js +70 -0
  637. package/daemon/dist/domain/terminal/tmux-viewer-guard.js.map +1 -0
  638. package/daemon/dist/domain/terminal-policy.js +1 -1
  639. package/daemon/dist/domain/terminal-policy.js.map +1 -1
  640. package/daemon/dist/domain/transcript-grep-worker.d.ts +2 -0
  641. package/daemon/dist/domain/transcript-grep-worker.d.ts.map +1 -0
  642. package/daemon/dist/domain/transcript-grep-worker.js +108 -0
  643. package/daemon/dist/domain/transcript-grep-worker.js.map +1 -0
  644. package/daemon/dist/domain/transcript-grep.d.ts +26 -0
  645. package/daemon/dist/domain/transcript-grep.d.ts.map +1 -0
  646. package/daemon/dist/domain/transcript-grep.js +90 -0
  647. package/daemon/dist/domain/transcript-grep.js.map +1 -0
  648. package/daemon/dist/domain/transcript-store.d.ts +8 -2
  649. package/daemon/dist/domain/transcript-store.d.ts.map +1 -1
  650. package/daemon/dist/domain/transcript-store.js +10 -60
  651. package/daemon/dist/domain/transcript-store.js.map +1 -1
  652. package/daemon/dist/domain/types.d.ts +149 -5
  653. package/daemon/dist/domain/types.d.ts.map +1 -1
  654. package/daemon/dist/domain/types.js.map +1 -1
  655. package/daemon/dist/domain/watchdog-delivery-receipts.d.ts +4 -0
  656. package/daemon/dist/domain/watchdog-delivery-receipts.d.ts.map +1 -1
  657. package/daemon/dist/domain/watchdog-delivery-receipts.js +35 -2
  658. package/daemon/dist/domain/watchdog-delivery-receipts.js.map +1 -1
  659. package/daemon/dist/domain/watchdog-delivery.d.ts +45 -1
  660. package/daemon/dist/domain/watchdog-delivery.d.ts.map +1 -1
  661. package/daemon/dist/domain/watchdog-delivery.js +66 -5
  662. package/daemon/dist/domain/watchdog-delivery.js.map +1 -1
  663. package/daemon/dist/domain/watchdog-history-log.d.ts +12 -0
  664. package/daemon/dist/domain/watchdog-history-log.d.ts.map +1 -1
  665. package/daemon/dist/domain/watchdog-history-log.js +19 -1
  666. package/daemon/dist/domain/watchdog-history-log.js.map +1 -1
  667. package/daemon/dist/domain/watchdog-jobs-repository.d.ts +32 -0
  668. package/daemon/dist/domain/watchdog-jobs-repository.d.ts.map +1 -1
  669. package/daemon/dist/domain/watchdog-jobs-repository.js +79 -0
  670. package/daemon/dist/domain/watchdog-jobs-repository.js.map +1 -1
  671. package/daemon/dist/domain/watchdog-policy-engine.d.ts +22 -3
  672. package/daemon/dist/domain/watchdog-policy-engine.d.ts.map +1 -1
  673. package/daemon/dist/domain/watchdog-policy-engine.js +33 -9
  674. package/daemon/dist/domain/watchdog-policy-engine.js.map +1 -1
  675. package/daemon/dist/domain/workflow-projector.js +1 -1
  676. package/daemon/dist/domain/workflow-projector.js.map +1 -1
  677. package/daemon/dist/domain/workflow-runtime.d.ts +13 -1
  678. package/daemon/dist/domain/workflow-runtime.d.ts.map +1 -1
  679. package/daemon/dist/domain/workflow-runtime.js +68 -9
  680. package/daemon/dist/domain/workflow-runtime.js.map +1 -1
  681. package/daemon/dist/domain/workflow-step-trail-log.d.ts +2 -2
  682. package/daemon/dist/domain/workflow-step-trail-log.d.ts.map +1 -1
  683. package/daemon/dist/domain/workflow-step-trail-log.js.map +1 -1
  684. package/daemon/dist/domain/workflow-types.d.ts +3 -1
  685. package/daemon/dist/domain/workflow-types.d.ts.map +1 -1
  686. package/daemon/dist/domain/workflow-types.js.map +1 -1
  687. package/daemon/dist/domain/workspace/default-workspace-scaffold.d.ts +7 -1
  688. package/daemon/dist/domain/workspace/default-workspace-scaffold.d.ts.map +1 -1
  689. package/daemon/dist/domain/workspace/default-workspace-scaffold.js +35 -7
  690. package/daemon/dist/domain/workspace/default-workspace-scaffold.js.map +1 -1
  691. package/daemon/dist/gateway-slack-surface.d.ts +2 -2
  692. package/daemon/dist/gateway-slack-surface.d.ts.map +1 -1
  693. package/daemon/dist/gateway-slack-surface.js +1 -1
  694. package/daemon/dist/gateway-slack-surface.js.map +1 -1
  695. package/daemon/dist/index.d.ts.map +1 -1
  696. package/daemon/dist/index.js +17 -2
  697. package/daemon/dist/index.js.map +1 -1
  698. package/daemon/dist/lib/pane-envelope.d.ts +3 -0
  699. package/daemon/dist/lib/pane-envelope.d.ts.map +1 -1
  700. package/daemon/dist/lib/pane-envelope.js +3 -1
  701. package/daemon/dist/lib/pane-envelope.js.map +1 -1
  702. package/daemon/dist/mission-parent-surface.d.ts +2 -0
  703. package/daemon/dist/mission-parent-surface.d.ts.map +1 -0
  704. package/daemon/dist/mission-parent-surface.js +2 -0
  705. package/daemon/dist/mission-parent-surface.js.map +1 -0
  706. package/daemon/dist/routes/activity.d.ts +18 -1
  707. package/daemon/dist/routes/activity.d.ts.map +1 -1
  708. package/daemon/dist/routes/activity.js +150 -9
  709. package/daemon/dist/routes/activity.js.map +1 -1
  710. package/daemon/dist/routes/agent-images.d.ts.map +1 -1
  711. package/daemon/dist/routes/agent-images.js +6 -1
  712. package/daemon/dist/routes/agent-images.js.map +1 -1
  713. package/daemon/dist/routes/attention.d.ts.map +1 -1
  714. package/daemon/dist/routes/attention.js +194 -176
  715. package/daemon/dist/routes/attention.js.map +1 -1
  716. package/daemon/dist/routes/compaction.d.ts.map +1 -1
  717. package/daemon/dist/routes/compaction.js +46 -7
  718. package/daemon/dist/routes/compaction.js.map +1 -1
  719. package/daemon/dist/routes/core-app.d.ts +10 -0
  720. package/daemon/dist/routes/core-app.d.ts.map +1 -0
  721. package/daemon/dist/routes/core-app.js +175 -0
  722. package/daemon/dist/routes/core-app.js.map +1 -0
  723. package/daemon/dist/routes/hook-bridge.d.ts +3 -0
  724. package/daemon/dist/routes/hook-bridge.d.ts.map +1 -0
  725. package/daemon/dist/routes/hook-bridge.js +158 -0
  726. package/daemon/dist/routes/hook-bridge.js.map +1 -0
  727. package/daemon/dist/routes/missions.d.ts.map +1 -1
  728. package/daemon/dist/routes/missions.js +14 -2
  729. package/daemon/dist/routes/missions.js.map +1 -1
  730. package/daemon/dist/routes/queue.d.ts +4 -1
  731. package/daemon/dist/routes/queue.d.ts.map +1 -1
  732. package/daemon/dist/routes/queue.js +239 -38
  733. package/daemon/dist/routes/queue.js.map +1 -1
  734. package/daemon/dist/routes/require-sender-identity.d.ts +4 -3
  735. package/daemon/dist/routes/require-sender-identity.d.ts.map +1 -1
  736. package/daemon/dist/routes/require-sender-identity.js.map +1 -1
  737. package/daemon/dist/routes/restore-check.d.ts.map +1 -1
  738. package/daemon/dist/routes/restore-check.js +1 -0
  739. package/daemon/dist/routes/restore-check.js.map +1 -1
  740. package/daemon/dist/routes/rigspec.d.ts.map +1 -1
  741. package/daemon/dist/routes/rigspec.js +24 -4
  742. package/daemon/dist/routes/rigspec.js.map +1 -1
  743. package/daemon/dist/routes/scope-audit.d.ts.map +1 -1
  744. package/daemon/dist/routes/scope-audit.js +7 -1
  745. package/daemon/dist/routes/scope-audit.js.map +1 -1
  746. package/daemon/dist/routes/seat.d.ts.map +1 -1
  747. package/daemon/dist/routes/seat.js +133 -6
  748. package/daemon/dist/routes/seat.js.map +1 -1
  749. package/daemon/dist/routes/sessions.js +14 -3
  750. package/daemon/dist/routes/sessions.js.map +1 -1
  751. package/daemon/dist/routes/slices.d.ts.map +1 -1
  752. package/daemon/dist/routes/slices.js +21 -2
  753. package/daemon/dist/routes/slices.js.map +1 -1
  754. package/daemon/dist/routes/startup.js +9 -2
  755. package/daemon/dist/routes/startup.js.map +1 -1
  756. package/daemon/dist/routes/terminal.d.ts.map +1 -1
  757. package/daemon/dist/routes/terminal.js +47 -6
  758. package/daemon/dist/routes/terminal.js.map +1 -1
  759. package/daemon/dist/routes/transcripts.d.ts.map +1 -1
  760. package/daemon/dist/routes/transcripts.js +16 -1
  761. package/daemon/dist/routes/transcripts.js.map +1 -1
  762. package/daemon/dist/routes/up.d.ts.map +1 -1
  763. package/daemon/dist/routes/up.js +14 -4
  764. package/daemon/dist/routes/up.js.map +1 -1
  765. package/daemon/dist/routes/watchdog.d.ts.map +1 -1
  766. package/daemon/dist/routes/watchdog.js +21 -3
  767. package/daemon/dist/routes/watchdog.js.map +1 -1
  768. package/daemon/dist/routes/workflow.d.ts.map +1 -1
  769. package/daemon/dist/routes/workflow.js +5 -0
  770. package/daemon/dist/routes/workflow.js.map +1 -1
  771. package/daemon/dist/server.d.ts +5 -0
  772. package/daemon/dist/server.d.ts.map +1 -1
  773. package/daemon/dist/server.js +22 -0
  774. package/daemon/dist/server.js.map +1 -1
  775. package/daemon/dist/startup.d.ts.map +1 -1
  776. package/daemon/dist/startup.js +140 -48
  777. package/daemon/dist/startup.js.map +1 -1
  778. package/daemon/dist/terminal-viewer-guard-surface.d.ts +2 -0
  779. package/daemon/dist/terminal-viewer-guard-surface.d.ts.map +1 -0
  780. package/daemon/dist/terminal-viewer-guard-surface.js +2 -0
  781. package/daemon/dist/terminal-viewer-guard-surface.js.map +1 -0
  782. package/daemon/docs/reference/agent-startup-guide.md +5 -1
  783. package/daemon/docs/reference/claude-status-line.md +3 -2
  784. package/daemon/docs/reference/community-harness-examples/cursor/openrig-cursor-launch +6 -0
  785. package/daemon/docs/reference/community-harness-examples/dsh/README.md +8 -0
  786. package/daemon/docs/reference/community-harness-examples/dsh/openrig-dsh-runner.mjs +310 -20
  787. package/daemon/docs/reference/community-harness-examples/hermes/openrig-hermes-launch +6 -0
  788. package/daemon/docs/reference/community-harness-examples/openclaw/openrig-openclaw-launch +6 -0
  789. package/daemon/docs/reference/community-harness-examples/openshell/README.md +2 -0
  790. package/daemon/docs/reference/community-harness-examples/pi-tui/openrig-pi-tui-launch +6 -0
  791. package/daemon/docs/reference/community-harness-presets.md +7 -4
  792. package/daemon/docs/reference/core-app.md +212 -0
  793. package/daemon/docs/reference/daemon-http-clients.md +67 -12
  794. package/daemon/docs/reference/getting-started.md +9 -4
  795. package/daemon/docs/reference/harness-runner-contract.md +140 -4
  796. package/daemon/docs/reference/herdr-app.md +6 -0
  797. package/daemon/docs/reference/hosted-members.md +21 -1
  798. package/daemon/docs/reference/quickstart.md +4 -3
  799. package/daemon/docs/reference/rig-spec.md +197 -1
  800. package/daemon/docs/reference/rosters.md +17 -0
  801. package/daemon/docs/reference/sdlc-conventions.md +47 -6
  802. package/daemon/docs/reference/seat-delivery.md +87 -6
  803. package/daemon/docs/reference/slack-app-setup.md +39 -21
  804. package/daemon/docs/reference/terminal-sessions.md +99 -1
  805. package/daemon/docs/reference/whats-new.md +187 -15
  806. package/daemon/specs/agents/shared/skills/core/messaging-the-human/SKILL.md +23 -0
  807. package/daemon/specs/rigs/launch/factory/guidance/lead-first-move.md +27 -5
  808. package/daemon/specs/rigs/launch/kernel/agents/operator/agent/guidance/role.md +32 -8
  809. package/daemon/specs/rigs/launch/kernel/agents/operator/agent/startup/context.md +1 -1
  810. package/daemon/specs/rigs/launch/kernel/culture/CULTURE.md +12 -0
  811. package/daemon/specs/rigs/launch/starter/guidance/lead-first-move.md +27 -5
  812. package/dist/acp/connector.js +1 -1
  813. package/dist/acp/connector.js.map +1 -1
  814. package/dist/ask-wake.d.ts.map +1 -1
  815. package/dist/ask-wake.js +8 -1
  816. package/dist/ask-wake.js.map +1 -1
  817. package/dist/build-info.js +3 -3
  818. package/dist/cli-error.d.ts.map +1 -1
  819. package/dist/cli-error.js +7 -1
  820. package/dist/cli-error.js.map +1 -1
  821. package/dist/client.d.ts +2 -1
  822. package/dist/client.d.ts.map +1 -1
  823. package/dist/client.js +3 -2
  824. package/dist/client.js.map +1 -1
  825. package/dist/commands/archive.js +1 -1
  826. package/dist/commands/archive.js.map +1 -1
  827. package/dist/commands/ask.d.ts.map +1 -1
  828. package/dist/commands/ask.js +92 -11
  829. package/dist/commands/ask.js.map +1 -1
  830. package/dist/commands/broadcast.js +9 -5
  831. package/dist/commands/broadcast.js.map +1 -1
  832. package/dist/commands/compact.d.ts +3 -4
  833. package/dist/commands/compact.d.ts.map +1 -1
  834. package/dist/commands/compact.js +76 -16
  835. package/dist/commands/compact.js.map +1 -1
  836. package/dist/commands/config-init-workspace.d.ts.map +1 -1
  837. package/dist/commands/config-init-workspace.js +3 -0
  838. package/dist/commands/config-init-workspace.js.map +1 -1
  839. package/dist/commands/daemon.d.ts.map +1 -1
  840. package/dist/commands/daemon.js +7 -0
  841. package/dist/commands/daemon.js.map +1 -1
  842. package/dist/commands/down.d.ts.map +1 -1
  843. package/dist/commands/down.js +8 -1
  844. package/dist/commands/down.js.map +1 -1
  845. package/dist/commands/export.d.ts.map +1 -1
  846. package/dist/commands/export.js +2 -1
  847. package/dist/commands/export.js.map +1 -1
  848. package/dist/commands/fork.d.ts.map +1 -1
  849. package/dist/commands/fork.js +2 -0
  850. package/dist/commands/fork.js.map +1 -1
  851. package/dist/commands/launch.d.ts.map +1 -1
  852. package/dist/commands/launch.js +11 -3
  853. package/dist/commands/launch.js.map +1 -1
  854. package/dist/commands/ps.d.ts +30 -1
  855. package/dist/commands/ps.d.ts.map +1 -1
  856. package/dist/commands/ps.js +85 -6
  857. package/dist/commands/ps.js.map +1 -1
  858. package/dist/commands/queue.d.ts.map +1 -1
  859. package/dist/commands/queue.js +309 -21
  860. package/dist/commands/queue.js.map +1 -1
  861. package/dist/commands/rig.d.ts +2 -0
  862. package/dist/commands/rig.d.ts.map +1 -1
  863. package/dist/commands/rig.js +36 -2
  864. package/dist/commands/rig.js.map +1 -1
  865. package/dist/commands/roster.d.ts +8 -0
  866. package/dist/commands/roster.d.ts.map +1 -1
  867. package/dist/commands/scope.d.ts.map +1 -1
  868. package/dist/commands/scope.js +346 -9
  869. package/dist/commands/scope.js.map +1 -1
  870. package/dist/commands/seat.d.ts.map +1 -1
  871. package/dist/commands/seat.js +213 -12
  872. package/dist/commands/seat.js.map +1 -1
  873. package/dist/commands/send.d.ts +2 -0
  874. package/dist/commands/send.d.ts.map +1 -1
  875. package/dist/commands/send.js +50 -7
  876. package/dist/commands/send.js.map +1 -1
  877. package/dist/commands/setup.js +2 -2
  878. package/dist/commands/setup.js.map +1 -1
  879. package/dist/commands/slack.d.ts +2 -1
  880. package/dist/commands/slack.d.ts.map +1 -1
  881. package/dist/commands/slack.js +38 -2
  882. package/dist/commands/slack.js.map +1 -1
  883. package/dist/commands/terminal.d.ts +56 -0
  884. package/dist/commands/terminal.d.ts.map +1 -1
  885. package/dist/commands/terminal.js +199 -9
  886. package/dist/commands/terminal.js.map +1 -1
  887. package/dist/commands/transcript.js +1 -1
  888. package/dist/commands/transcript.js.map +1 -1
  889. package/dist/commands/unarchive.js +1 -1
  890. package/dist/commands/unarchive.js.map +1 -1
  891. package/dist/commands/up.d.ts.map +1 -1
  892. package/dist/commands/up.js +3 -0
  893. package/dist/commands/up.js.map +1 -1
  894. package/dist/commands/workflow-follow.d.ts +3 -1
  895. package/dist/commands/workflow-follow.d.ts.map +1 -1
  896. package/dist/commands/workflow-follow.js +25 -6
  897. package/dist/commands/workflow-follow.js.map +1 -1
  898. package/dist/commands/workflow-render.d.ts.map +1 -1
  899. package/dist/commands/workflow-render.js +5 -1
  900. package/dist/commands/workflow-render.js.map +1 -1
  901. package/dist/commands/workflow.d.ts.map +1 -1
  902. package/dist/commands/workflow.js +18 -4
  903. package/dist/commands/workflow.js.map +1 -1
  904. package/dist/daemon-lifecycle.d.ts.map +1 -1
  905. package/dist/daemon-lifecycle.js +12 -0
  906. package/dist/daemon-lifecycle.js.map +1 -1
  907. package/dist/lib/model-observation.d.ts.map +1 -1
  908. package/dist/lib/model-observation.js +9 -3
  909. package/dist/lib/model-observation.js.map +1 -1
  910. package/dist/lib/scope/mission-composition.d.ts +1 -0
  911. package/dist/lib/scope/mission-composition.d.ts.map +1 -1
  912. package/dist/lib/scope/mission-composition.js +14 -0
  913. package/dist/lib/scope/mission-composition.js.map +1 -1
  914. package/dist/lib/scope/scope-audit.d.ts.map +1 -1
  915. package/dist/lib/scope/scope-audit.js +63 -3
  916. package/dist/lib/scope/scope-audit.js.map +1 -1
  917. package/dist/lib/scope/scope-fs.d.ts +10 -0
  918. package/dist/lib/scope/scope-fs.d.ts.map +1 -1
  919. package/dist/lib/scope/scope-fs.js +60 -0
  920. package/dist/lib/scope/scope-fs.js.map +1 -1
  921. package/dist/lib/scope/types.d.ts +3 -1
  922. package/dist/lib/scope/types.d.ts.map +1 -1
  923. package/dist/lib/scope/types.js +5 -1
  924. package/dist/lib/scope/types.js.map +1 -1
  925. package/dist/local-db.d.ts +5 -0
  926. package/dist/local-db.d.ts.map +1 -0
  927. package/dist/local-db.js +23 -0
  928. package/dist/local-db.js.map +1 -0
  929. package/dist/local-origin.d.ts.map +1 -1
  930. package/dist/local-origin.js +2 -17
  931. package/dist/local-origin.js.map +1 -1
  932. package/dist/mcp-server.d.ts.map +1 -1
  933. package/dist/mcp-server.js +138 -24
  934. package/dist/mcp-server.js.map +1 -1
  935. package/dist/restore-packet/packet-writer.d.ts.map +1 -1
  936. package/dist/restore-packet/packet-writer.js +8 -5
  937. package/dist/restore-packet/packet-writer.js.map +1 -1
  938. package/dist/sender-identity.d.ts +18 -6
  939. package/dist/sender-identity.d.ts.map +1 -1
  940. package/dist/sender-identity.js +67 -7
  941. package/dist/sender-identity.js.map +1 -1
  942. package/dist/terminal-window-rex.d.ts +1 -1
  943. package/dist/terminal-window-rex.d.ts.map +1 -1
  944. package/dist/terminal-window-rex.js +3 -2
  945. package/dist/terminal-window-rex.js.map +1 -1
  946. package/dist/terminal-window.d.ts +2 -1
  947. package/dist/terminal-window.d.ts.map +1 -1
  948. package/dist/terminal-window.js +570 -44
  949. package/dist/terminal-window.js.map +1 -1
  950. package/package.json +1 -1
  951. package/tui/dist/daemon-client.d.ts +4 -0
  952. package/tui/dist/daemon-client.d.ts.map +1 -1
  953. package/tui/dist/daemon-client.js +2 -1
  954. package/tui/dist/daemon-client.js.map +1 -1
  955. package/tui/dist/execution/execution-model.d.ts.map +1 -1
  956. package/tui/dist/execution/execution-model.js +22 -5
  957. package/tui/dist/execution/execution-model.js.map +1 -1
  958. package/tui/dist/hydrate.d.ts.map +1 -1
  959. package/tui/dist/hydrate.js +6 -3
  960. package/tui/dist/hydrate.js.map +1 -1
  961. package/tui/dist/navigator.d.ts +1 -1
  962. package/tui/dist/navigator.d.ts.map +1 -1
  963. package/tui/dist/navigator.js +4 -2
  964. package/tui/dist/navigator.js.map +1 -1
  965. package/tui/dist/pulse/render-pulse.d.ts.map +1 -1
  966. package/tui/dist/pulse/render-pulse.js +7 -14
  967. package/tui/dist/pulse/render-pulse.js.map +1 -1
  968. package/tui/dist/render.d.ts.map +1 -1
  969. package/tui/dist/render.js +29 -21
  970. package/tui/dist/render.js.map +1 -1
  971. package/tui/dist/stylize.d.ts.map +1 -1
  972. package/tui/dist/stylize.js +3 -3
  973. package/tui/dist/stylize.js.map +1 -1
  974. package/tui/dist/terminals/terminal-model.d.ts +1 -0
  975. package/tui/dist/terminals/terminal-model.d.ts.map +1 -1
  976. package/tui/dist/terminals/terminal-model.js +4 -2
  977. package/tui/dist/terminals/terminal-model.js.map +1 -1
  978. package/tui/dist/types.d.ts +1 -0
  979. package/tui/dist/types.d.ts.map +1 -1
  980. package/tui/dist/visual-layout.d.ts +3 -0
  981. package/tui/dist/visual-layout.d.ts.map +1 -1
  982. package/tui/dist/visual-layout.js +17 -0
  983. package/tui/dist/visual-layout.js.map +1 -1
  984. package/ui/dist/assets/{index-BvUEh33d.js → index-B-sMy02c.js} +116 -116
  985. package/ui/dist/assets/{index-BX8TUZ0E.css → index-DiN7RwWg.css} +1 -1
  986. package/ui/dist/index.html +2 -2
@@ -0,0 +1,537 @@
1
+ import { runnerPermissionOrigin } from "./runner-permissions.js";
2
+ import { randomUUID } from "node:crypto";
3
+ import { CoreAppError, appObject, exactKeys, appHash } from "./core-app-access.js";
4
+ import { humanAskAttention, appAskUnsupported } from "./human-ask-attention.js";
5
+ import { feedPerspective } from "./feed-perspective.js";
6
+ import { unansweredQuestions } from "./human-questions.js";
7
+ import { mcOperationTag } from "./queue-repository.js";
8
+ import { MissionControlWriteContractError, operationFingerprint } from "./mission-control/mission-control-write-contract.js";
9
+ const parse = (value) => value ? JSON.parse(value) : null;
10
+ /** Composition only: the existing write contract owns answer validation, return, close, audit and permission handoff. */
11
+ export class CoreAppJob {
12
+ access;
13
+ queue;
14
+ bus;
15
+ writes;
16
+ log;
17
+ epoch = randomUUID();
18
+ inFlight = new Map();
19
+ constructor(access, queue, bus, writes, log) {
20
+ this.access = access;
21
+ this.queue = queue;
22
+ this.bus = bus;
23
+ this.writes = writes;
24
+ this.log = log;
25
+ }
26
+ cursor(seq = this.bus.maxSeq()) { return Buffer.from(`${this.epoch}:${seq}`).toString("base64url"); }
27
+ cursorSequence(cursor) {
28
+ const decoded = Buffer.from(cursor, "base64url").toString();
29
+ const [epoch, raw, extra] = decoded.split(":");
30
+ return epoch === this.epoch && extra === undefined && /^\d+$/.test(raw ?? "") && Number.isSafeInteger(Number(raw)) ? Number(raw) : null;
31
+ }
32
+ /** Conservative continuity proof: filtered sequence jumps are fine; deleted log rows or a retention sweep reset. */
33
+ eventReplay(cursor) {
34
+ return this.access.db.transaction(() => {
35
+ const head = this.bus.maxSeq(), after = cursor === undefined ? head : this.cursorSequence(cursor);
36
+ const floor = this.access.db.prepare("SELECT low_water_seq n FROM events_retention_marks WHERE id = 1").get()?.n ?? 0;
37
+ if (after === null || after > head || after < floor)
38
+ return null;
39
+ const count = this.access.db.prepare("SELECT COUNT(*) n FROM events WHERE seq > ? AND seq <= ?").get(after, head).n;
40
+ if (count !== head - after)
41
+ return null;
42
+ // Notifications are prunable history. Filter retained pages in memory only after proving continuity.
43
+ const sequences = [];
44
+ let replayAfter = after;
45
+ while (replayAfter < head) {
46
+ const page = this.bus.replayPage(replayAfter, head, 500);
47
+ for (const event of page) {
48
+ if (event.type === "queue.created" || event.type === "queue.updated" || event.type === "queue.answer_recorded" || event.type === "mission_control.action_executed") {
49
+ sequences.push(event.seq);
50
+ if (sequences.length > 500)
51
+ return null;
52
+ }
53
+ }
54
+ replayAfter = page[page.length - 1].seq;
55
+ }
56
+ return { head, sequences };
57
+ })();
58
+ }
59
+ snapshot(read) {
60
+ return this.access.db.transaction(() => ({ ...read(), readAt: new Date().toISOString(), cursor: this.cursor() }))();
61
+ }
62
+ actor(credential, value) { return this.access.authorizeActor(credential, value); }
63
+ episodeKey(requestId) {
64
+ // A direct ask's creation notification is not a re-park episode. Preserve genuine parked episodes only.
65
+ return this.queue.listTransitions(requestId).some(t => t.state === "blocked") ? this.queue.currentHumanRequiredEpisode(requestId)?.key ?? null : null;
66
+ }
67
+ links(requestId, actor) {
68
+ const path = `/api/apps/v1/requests/${encodeURIComponent(requestId)}`, query = `?actor=${encodeURIComponent(actor)}`;
69
+ return { self: path + query, result: `${path}/result${query}` };
70
+ }
71
+ /** One authority probe per item: why it can't be answered, and whether its agent's authority is unknown. Only positive
72
+ * replacement or absence (the queue owner's `replaced`/`absent`) makes a permission ask stale; a seat with no readable tenure
73
+ * is unknown, which keeps the ask, its facts and its answer forms. */
74
+ assess(item) {
75
+ const reason = appAskUnsupported(this.queue, item);
76
+ if (reason)
77
+ return { reason, unknown: false };
78
+ const origin = runnerPermissionOrigin(item);
79
+ if (!origin)
80
+ return { reason: null, unknown: false };
81
+ const authority = this.queue.runnerPermissionAuthority(origin);
82
+ if (authority === "replaced" || authority === "absent")
83
+ return { reason: "request_stale", unknown: false };
84
+ return { reason: null, unknown: authority !== "current" };
85
+ }
86
+ unsupported(item) { return this.assess(item).reason; }
87
+ request(credential, requestId, actor) {
88
+ const item = this.queue.getById(requestId);
89
+ if (!item)
90
+ throw new CoreAppError("request_not_found", 404);
91
+ const { reason, unknown } = this.assess(item);
92
+ return this.project(credential, item, reason, actor, unknown);
93
+ }
94
+ project(credential, item, unsupportedReason, actor, unknown = false) {
95
+ const requestId = item.qitemId;
96
+ if (unsupportedReason === "unsupported_request_kind" || unsupportedReason === "source_unavailable")
97
+ return { requestId, answer: null, unsupportedReason, links: this.links(requestId, actor) };
98
+ return { requestId, asker: item.sourceSession, askedPerson: item.destinationSession,
99
+ actor: { address: actor, assurance: "app-attributed", appId: credential.appId }, state: item.state,
100
+ decisionRevision: this.queue.decisionRevision(item), episodeKey: this.episodeKey(requestId),
101
+ body: item.body, humanDetail: item.humanDetail ?? null, questions: item.humanQuestions ?? [], humanAnswers: item.humanAnswers ?? {},
102
+ answer: unsupportedReason ? null : { job: "human-answer", forms: ["option", "typed-reply"] },
103
+ ...(unsupportedReason ? { unsupportedReason } : {}),
104
+ ...(unknown ? { occupantAuthority: "unknown", occupantAuthorityDetail: "The asking agent's seat can't be confirmed current right now. The question and answer stay open; no native effect is implied." } : {}),
105
+ links: this.links(requestId, actor) };
106
+ }
107
+ needsMe(credential, actor) {
108
+ return this.snapshot(() => {
109
+ try {
110
+ const { current, partial } = humanAskAttention(this.queue);
111
+ const view = feedPerspective(this.queue, actor);
112
+ const requests = current.flatMap(item => {
113
+ if (!view.inView(item.destinationSession))
114
+ return [];
115
+ const { reason, unknown } = this.assess(item); // one authority probe per item, projected in the same boundary
116
+ return reason ? [] : [this.project(credential, item, null, actor, unknown)];
117
+ });
118
+ return { version: 1, sources: [{ source: "queue", state: partial ? "partial" : "available" }], requests };
119
+ }
120
+ catch {
121
+ return { version: 1, sources: [{ source: "queue", state: "unavailable", detail: "Queue source unavailable; absence does not establish resolution." }], requests: [] };
122
+ }
123
+ });
124
+ }
125
+ submissions(appId, requestId) {
126
+ return this.access.db.prepare("SELECT * FROM core_app_submissions WHERE app_id = ? AND request_id = ? ORDER BY rowid").all(appId, requestId);
127
+ }
128
+ workLink(qitemId, requestId, actor) {
129
+ return `/api/apps/v1/work/${encodeURIComponent(qitemId)}?requestId=${encodeURIComponent(requestId)}&actor=${encodeURIComponent(actor)}`;
130
+ }
131
+ workRecord(item, requestId, actor) {
132
+ return { qitemId: item.qitemId, state: item.state, body: item.body, summary: item.summary, source: item.sourceSession,
133
+ actor: this.queue.listTransitions(item.qitemId).at(-1)?.actorSession ?? null, replyTo: item.replyTo ?? null,
134
+ handedOffFrom: item.handedOffFrom, handedOffTo: item.handedOffTo, blockedOn: item.blockedOn,
135
+ closureReason: item.closureReason, evidenceRef: item.evidenceRef,
136
+ completion: { status: ["done", "canceled", "denied", "failed", "handed-off"].includes(item.state) ? "closed-as-recorded" : "open",
137
+ sourceQitemId: item.qitemId, closureReason: item.closureReason, evidenceRef: item.evidenceRef },
138
+ links: { self: this.workLink(item.qitemId, requestId, actor), request: this.links(requestId, actor).self, result: this.links(requestId, actor).result } };
139
+ }
140
+ graph(appId, requestId) {
141
+ const root = this.queue.getById(requestId);
142
+ const nodes = new Map();
143
+ const edges = [];
144
+ let partial = false;
145
+ if (!root || root.contentErasedAt)
146
+ return { nodes, edges, partial: true };
147
+ const pending = [{ id: requestId, hops: 0 }];
148
+ const addEdge = (from, to, relation, captured = false) => {
149
+ if (!edges.some(edge => edge.from === from && edge.to === to && edge.relation === relation)) {
150
+ edges.push({ from, to, relation, sourceQitemId: to, ...(captured ? { captured: true } : {}) });
151
+ }
152
+ };
153
+ for (const row of this.submissions(appId, requestId)) {
154
+ for (const id of parse(row.checkpoint_json)?.workIds ?? []) {
155
+ addEdge(requestId, id, "blocked-on", true);
156
+ pending.push({ id, hops: 0 });
157
+ }
158
+ }
159
+ while (pending.length) {
160
+ const next = pending.shift();
161
+ if (nodes.has(next.id))
162
+ continue;
163
+ if (nodes.size >= 100 || next.hops > 20) {
164
+ partial = true;
165
+ continue;
166
+ }
167
+ const item = this.queue.getById(next.id);
168
+ if (!item || item.contentErasedAt) {
169
+ partial = true;
170
+ continue;
171
+ }
172
+ nodes.set(item.qitemId, item);
173
+ const related = this.queue.relatedTo(item.qitemId);
174
+ if (related.length >= 101)
175
+ partial = true;
176
+ for (const edge of related.slice(0, 100)) {
177
+ addEdge(item.qitemId, edge.item.qitemId, edge.relation);
178
+ pending.push({ id: edge.item.qitemId, hops: next.hops + (edge.relation === "handed-off-from" ? 1 : 0) });
179
+ }
180
+ // A handed-to session address isn't an item ID. Only the actual successor's handedOffFrom is followable.
181
+ if (item.handedOffTo && !related.some(edge => edge.relation === "handed-off-from" && edge.item.destinationSession === item.handedOffTo))
182
+ partial = true;
183
+ }
184
+ // A directed cycle is real but can't establish a complete handoff/dependency outcome.
185
+ const active = new Set(), visited = new Set();
186
+ const cycle = (id) => {
187
+ if (active.has(id))
188
+ return true;
189
+ if (visited.has(id))
190
+ return false;
191
+ visited.add(id);
192
+ active.add(id);
193
+ const found = edges.some(edge => edge.from === id && cycle(edge.to));
194
+ active.delete(id);
195
+ return found;
196
+ };
197
+ if (cycle(requestId))
198
+ partial = true;
199
+ return { nodes, edges, partial };
200
+ }
201
+ permission(item, nodes) {
202
+ const origin = runnerPermissionOrigin(item);
203
+ if (!origin)
204
+ return { status: "not-applicable", nativeEffect: "unknown" };
205
+ const authority = this.queue.runnerPermissionAuthority(origin);
206
+ let live = item;
207
+ const seen = new Set();
208
+ for (let hops = 0; live && (live.state === "handed-off" || live.state === "done" && live.closureReason === "handed_off_to"); hops++) {
209
+ if (hops >= 20 || seen.has(live.qitemId)) {
210
+ live = undefined;
211
+ break;
212
+ }
213
+ seen.add(live.qitemId);
214
+ const prior = live;
215
+ live = [...nodes.values()].filter(row => row.handedOffFrom === prior.qitemId && row.destinationSession === prior.handedOffTo).at(-1);
216
+ }
217
+ if (!live)
218
+ return { status: "unknown", nativeEffect: "unknown", reason: "handoff_unavailable" };
219
+ const transitions = this.queue.listTransitions(live.qitemId);
220
+ const withdrawal = [...transitions].reverse().find(t => t.transitionNote?.startsWith("runner-permission-withdrawn"));
221
+ const stale = [...transitions].reverse().find(t => t.transitionNote?.startsWith("runner-permission-stale"));
222
+ const source = (t) => ({ sourceQitemId: live.qitemId, sourceTransitionId: t.transitionId, decider: t.actorSession, reason: t.transitionNote });
223
+ if (withdrawal)
224
+ return { status: "withdrawn", nativeEffect: "unknown", ...source(withdrawal) };
225
+ if (stale || authority === "replaced" || authority === "absent")
226
+ return { status: "stale", nativeEffect: "unknown", ...(stale ? source(stale) : { sourceQitemId: item.qitemId }) };
227
+ if (authority !== "current")
228
+ return { status: "unknown", nativeEffect: "unknown", reason: "occupant_unavailable" };
229
+ // Only transitions in the current final state establish a decision, as the receiving-agent owner requires.
230
+ let decision;
231
+ for (let i = transitions.length - 1; i >= 0 && transitions[i].state === live.state; i--) {
232
+ const transition = transitions[i];
233
+ if (transition.transitionNote?.startsWith("runner-permission-decided") || transition.ownerNotificationKind === "human-decision-resolved") {
234
+ decision = transition;
235
+ break;
236
+ }
237
+ }
238
+ if (decision && !["pending", "in-progress", "blocked"].includes(live.state))
239
+ return { status: "decided", nativeEffect: "unknown", ...source(decision), option: typeof live.humanAnswers?.permission === "string" ? live.humanAnswers.permission : null };
240
+ return { status: Object.keys(item.humanAnswers ?? {}).length ? "awaiting-agent" : "unknown", nativeEffect: "unknown", sourceQitemId: live.qitemId };
241
+ }
242
+ result(credential, requestId, actor) {
243
+ return this.snapshot(() => {
244
+ const request = this.queue.getById(requestId);
245
+ if (!request || request.contentErasedAt)
246
+ throw new CoreAppError("source_unavailable", 404);
247
+ if (appAskUnsupported(this.queue, request) === "unsupported_request_kind")
248
+ throw new CoreAppError("unsupported_request_kind", 422);
249
+ const graph = this.graph(credential.appId, requestId), permission = this.permission(request, graph.nodes);
250
+ const answers = new Set(this.queue.answersForAsk(requestId).map(answer => answer.qitemId));
251
+ const reply = [...graph.nodes.values()].find(item => item.replyTo === requestId && answers.has(item.qitemId));
252
+ const isPermission = !!runnerPermissionOrigin(request);
253
+ const answerReturn = reply ? { status: "returned", replyQitemId: reply.qitemId, source: reply.sourceSession, target: reply.destinationSession,
254
+ body: reply.body, replyTo: reply.replyTo, links: { self: this.workLink(reply.qitemId, requestId, actor) } }
255
+ : isPermission && Object.keys(request.humanAnswers ?? {}).length ? { status: permission.status === "decided" ? "returned" : "kept-for-agent", replyQitemId: null, sourceQitemId: requestId }
256
+ : { status: graph.partial ? "unknown" : "not-returned", replyQitemId: null };
257
+ const records = [...graph.nodes.values()].filter(item => item.qitemId !== requestId).map(item => this.workRecord(item, requestId, actor));
258
+ return { request: this.request(credential, requestId, actor), submissions: this.submissions(credential.appId, requestId)
259
+ .filter(row => !row.erased_at && parse(row.binding_json)?.actor === actor).map(row => this.readAnswer(credential, row.answer_id, actor)),
260
+ answerReturn, permissionDecision: permission, work: { status: graph.partial ? "partial" : "available", records, edges: graph.edges,
261
+ completion: { status: "unknown", sourceQitemId: null, reason: "Inspect each recorded work closure; no product outcome is inferred." } },
262
+ links: this.links(requestId, actor), sources: [{ source: "queue", state: graph.partial ? "partial" : "available" }] };
263
+ });
264
+ }
265
+ work(credential, qitemId, requestId, actor) {
266
+ return this.snapshot(() => {
267
+ if (!requestId)
268
+ throw new CoreAppError("request_id_required", 400);
269
+ const request = this.queue.getById(requestId);
270
+ if (!request || appAskUnsupported(this.queue, request) === "unsupported_request_kind")
271
+ throw new CoreAppError("work_not_found", 404);
272
+ const item = this.graph(credential.appId, requestId).nodes.get(qitemId);
273
+ if (!item || item.qitemId === requestId)
274
+ throw new CoreAppError("work_not_found", 404);
275
+ return this.workRecord(item, requestId, actor);
276
+ });
277
+ }
278
+ row(appId, answerId) {
279
+ return this.access.db.prepare("SELECT * FROM core_app_submissions WHERE app_id = ? AND answer_id = ?").get(appId, answerId);
280
+ }
281
+ input(binding, appId, answerId) {
282
+ return { verb: "answer", qitemId: binding.requestId, actorSession: binding.actor, identityProvenance: "claimed:v1", expectedRevision: binding.expectedRevision,
283
+ ...(binding.answer.kind === "option" ? { questionId: binding.questionId, optionId: binding.answer.optionId } : { decision: binding.answer.text }),
284
+ auditNotes: { operationId: `core-app:${appId}:${answerId}`, app: { appId, actorAssurance: "app-attributed", answerId } } };
285
+ }
286
+ binding(credential, value) {
287
+ const body = appObject(value);
288
+ exactKeys(body, ["job", "actor", "requestId", "questionId", "episodeKey", "expectedRevision", "answer"]);
289
+ if (body.job !== "human-answer")
290
+ throw new CoreAppError("unsupported_job", 422);
291
+ const actor = this.actor(credential, body.actor);
292
+ for (const key of ["requestId", "questionId", "expectedRevision"])
293
+ if (typeof body[key] !== "string" || !body[key])
294
+ throw new CoreAppError("invalid_answer_binding", 422);
295
+ if (body.episodeKey !== null && typeof body.episodeKey !== "string")
296
+ throw new CoreAppError("invalid_answer_binding", 422);
297
+ const answer = appObject(body.answer);
298
+ if (answer.kind === "option") {
299
+ exactKeys(answer, ["kind", "optionId"]);
300
+ if (typeof answer.optionId !== "string" || !answer.optionId)
301
+ throw new CoreAppError("invalid_option", 422);
302
+ }
303
+ else if (answer.kind === "typed-reply") {
304
+ exactKeys(answer, ["kind", "text"]);
305
+ if (typeof answer.text !== "string" || !answer.text.trim() || answer.text.includes("\0") || Buffer.byteLength(answer.text, "utf8") > 16384)
306
+ throw new CoreAppError("invalid_answer_text", 422);
307
+ answer.text = answer.text.trim();
308
+ }
309
+ else
310
+ throw new CoreAppError("unsupported_answer_form", 422);
311
+ return { job: "human-answer", actor, requestId: body.requestId, questionId: body.questionId,
312
+ episodeKey: body.episodeKey, expectedRevision: body.expectedRevision,
313
+ answer: answer.kind === "option" ? { kind: "option", optionId: answer.optionId } : { kind: "typed-reply", text: answer.text } };
314
+ }
315
+ answerLinks(answerId, binding) {
316
+ const links = this.links(binding.requestId, binding.actor);
317
+ return { self: `/api/apps/v1/answers/${encodeURIComponent(answerId)}?actor=${encodeURIComponent(binding.actor)}`, request: links.self, result: links.result };
318
+ }
319
+ receipt(appId, answerId, binding, result) {
320
+ return { answerId, appId, actor: { address: binding.actor, assurance: "app-attributed" }, requestId: binding.requestId,
321
+ questionId: binding.questionId, episodeKey: binding.episodeKey, expectedRevision: binding.expectedRevision, answer: binding.answer, replayed: false,
322
+ submission: { state: "committed", actionId: result.actionId, recordedAt: result.auditedAt,
323
+ outcome: result.answer.outcome, decisionRevisionAfter: result.decisionRevision, unanswered: result.answer.unanswered,
324
+ ...(result.answer.message ? { message: result.answer.message } : {}),
325
+ replyQitemId: result.createdQitemId === binding.requestId ? null : result.createdQitemId },
326
+ links: this.answerLinks(answerId, binding) };
327
+ }
328
+ /** Read-only: only proven own effects with an unchanged decision can be repaired. */
329
+ recovery(row, binding) {
330
+ const item = this.queue.getById(binding.requestId), checkpoint = parse(row.checkpoint_json);
331
+ const input = this.input(binding, row.app_id, row.answer_id), operation = operationFingerprint(input);
332
+ const reply = this.queue.getHumanAnswer(binding.requestId, binding.actor);
333
+ const ownReply = reply?.tags?.includes(mcOperationTag(operation)) ? reply : null;
334
+ const action = this.log.findOperation(binding.requestId, operation);
335
+ if (action?.auditNotes?.appReceipt)
336
+ return { receipt: action.auditNotes.appReceipt, revision: null, retry: false };
337
+ if (!item || item.contentErasedAt)
338
+ return { code: "source_unavailable", revision: null, retry: false };
339
+ const current = this.queue.decisionRevision(item);
340
+ // Occupant authority can end without changing dr1. Reuse the pure live-support check before any unfinished
341
+ // repair/write; immutable completed action evidence above still wins, and own closes keep their existing repair.
342
+ if (this.unsupported(item) === "request_stale")
343
+ return { code: "request_stale", revision: current, retry: false };
344
+ const withoutOwnReply = this.queue.decisionRevision(item, { excludeOperationReply: operation });
345
+ const original = checkpoint?.before;
346
+ // Another surface may have finished closing this exact original return. Its own close/answer fields are excluded
347
+ // only after checking the original question/recipient/episode and the operation-tagged durable return.
348
+ const sameQuestion = original && JSON.stringify([item.body, item.humanIntent, item.humanQuestions, item.destinationSession, item.blockedOn,
349
+ this.episodeKey(item.qitemId), item.evidenceRef ?? null]) === JSON.stringify([original.body, original.humanIntent, original.humanQuestions,
350
+ original.destinationSession, original.blockedOn, binding.episodeKey, original.evidenceRef ?? null]);
351
+ if (ownReply && item.state === "done" && sameQuestion)
352
+ return { revision: current, retry: true };
353
+ const expected = checkpoint?.revision ?? binding.expectedRevision;
354
+ if (item.state === "pending" && withoutOwnReply === expected)
355
+ return { revision: current, retry: true };
356
+ return { code: ownReply || checkpoint?.revision !== binding.expectedRevision ? "recovery_conflict" : "decision_revision_changed", revision: current, retry: false };
357
+ }
358
+ readAnswer(credential, answerId, actor) {
359
+ return this.snapshot(() => this.answerStatus(credential, answerId, actor));
360
+ }
361
+ answerStatus(credential, answerId, actor) {
362
+ const row = this.row(credential.appId, answerId);
363
+ if (!row)
364
+ throw new CoreAppError("answer_not_found", 404);
365
+ if (row.erased_at)
366
+ return { answerId, submission: { state: "source_unavailable" }, retrySameSubmission: false };
367
+ const binding = parse(row.binding_json);
368
+ if (binding.actor !== actor)
369
+ throw new CoreAppError("answer_not_found", 404);
370
+ const saved = parse(row.receipt_json);
371
+ if (saved)
372
+ return { ...saved, replayed: true };
373
+ const recovery = this.recovery(row, binding);
374
+ if (recovery.receipt)
375
+ return { ...recovery.receipt, replayed: true };
376
+ return { answerId, appId: credential.appId, requestId: binding.requestId, actor: { address: actor, assurance: "app-attributed" },
377
+ submission: { state: recovery.retry ? "incomplete" : "conflict", ...(recovery.code ? { conflictCode: recovery.code } : {}) },
378
+ retrySameSubmission: recovery.retry, currentRevision: recovery.revision, links: this.answerLinks(answerId, binding) };
379
+ }
380
+ /** 503 for a submission whose persistence this call could not settle: `unsaved` only on confirmed absence, else `unknown`. */
381
+ persistenceUnavailable(answerId, state) {
382
+ return new CoreAppError("app_job_unavailable", 503, { answerId, submission: { state }, retrySameSubmission: true });
383
+ }
384
+ async submit(credential, answerId, value) {
385
+ if (!/^[A-Za-z0-9_-]{8,128}$/.test(answerId))
386
+ throw new CoreAppError("invalid_answer_id", 422);
387
+ let binding;
388
+ try {
389
+ binding = this.binding(credential, value);
390
+ }
391
+ catch (error) {
392
+ // No verified actor means no look at any earlier attempt with this ID: its persistence is unknown, never "unsaved".
393
+ if (error instanceof CoreAppError && error.code === "app_job_unavailable")
394
+ throw this.persistenceUnavailable(answerId, "unknown");
395
+ throw error;
396
+ }
397
+ const hash = appHash(JSON.stringify(binding));
398
+ const key = `${credential.appId}:${answerId}`;
399
+ let existing;
400
+ try {
401
+ existing = this.row(credential.appId, answerId);
402
+ }
403
+ catch {
404
+ throw this.persistenceUnavailable(answerId, "unknown");
405
+ }
406
+ // An erased tombstone answers the same for any payload: the kept hash must not confirm a guessed answer.
407
+ if (existing?.erased_at)
408
+ throw new CoreAppError("source_unavailable", 409, { answerId, retrySameSubmission: false });
409
+ if (existing && existing.binding_hash !== hash)
410
+ throw new CoreAppError("answer_id_conflict", 409);
411
+ if (this.inFlight.has(key))
412
+ return { ...await this.inFlight.get(key), replayed: true };
413
+ const promise = this.perform(credential, answerId, binding, hash);
414
+ this.inFlight.set(key, promise);
415
+ try {
416
+ return await promise;
417
+ }
418
+ finally {
419
+ this.inFlight.delete(key);
420
+ }
421
+ }
422
+ async perform(credential, answerId, binding, hash) {
423
+ const db = this.access.db;
424
+ let row = this.row(credential.appId, answerId);
425
+ let expectedRevision = binding.expectedRevision;
426
+ if (row) {
427
+ const saved = parse(row.receipt_json);
428
+ if (saved)
429
+ return { ...saved, replayed: true };
430
+ const recovery = this.recovery(row, binding);
431
+ if (recovery.receipt)
432
+ return { ...recovery.receipt, replayed: true };
433
+ if (!recovery.retry)
434
+ throw new CoreAppError(recovery.code, 409, { answerId, currentRevision: recovery.revision, links: this.answerLinks(answerId, binding), retrySameSubmission: false });
435
+ expectedRevision = recovery.revision;
436
+ }
437
+ else {
438
+ // Synchronous validation/reservation before the existing owner reaches any delivery await.
439
+ try {
440
+ db.transaction(() => {
441
+ const item = this.queue.getById(binding.requestId);
442
+ if (!item)
443
+ throw new CoreAppError("request_not_found", 404);
444
+ const reason = this.unsupported(item);
445
+ if (reason)
446
+ throw new CoreAppError(reason, 422);
447
+ if (this.queue.decisionRevision(item) !== binding.expectedRevision)
448
+ throw new CoreAppError("decision_revision_changed", 409);
449
+ if ((this.episodeKey(item.qitemId)) !== binding.episodeKey)
450
+ throw new CoreAppError("episode_changed", 409);
451
+ const question = item.humanQuestions.find(q => q.id === binding.questionId);
452
+ const answer = binding.answer;
453
+ if (!question || answer.kind === "option" && !question.options.some(o => o.id === answer.optionId))
454
+ throw new CoreAppError("invalid_question_option", 422);
455
+ const returned = this.queue.getHumanAnswer(binding.requestId, binding.actor);
456
+ const finalized = unansweredQuestions(item.humanQuestions, item.humanAnswers ?? {}).length === 0;
457
+ // The existing owner keeps the first committed return / finalized set. A new ID must never claim a
458
+ // conflicting payload was applied when that original answer wins. The original ID remains repairable.
459
+ if ((returned || finalized) && (answer.kind !== "option" || item.humanAnswers?.[binding.questionId] !== answer.optionId)) {
460
+ throw new CoreAppError(returned ? "answer_already_returned" : "answer_already_finalized", 409, {
461
+ retrySameSubmission: false, replyQitemId: returned?.qitemId ?? null,
462
+ currentRevision: this.queue.decisionRevision(item), links: this.links(binding.requestId, binding.actor),
463
+ });
464
+ }
465
+ if (binding.answer.kind === "typed-reply" && unansweredQuestions(item.humanQuestions, item.humanAnswers ?? {})[0]?.id !== binding.questionId)
466
+ throw new CoreAppError("typed_reply_question_mismatch", 409);
467
+ const workIds = db.prepare("SELECT qitem_id FROM queue_items WHERE blocked_on = ? ORDER BY rowid LIMIT 101").all(binding.requestId).map(row => row.qitem_id);
468
+ const checkpoint = { before: item, revision: binding.expectedRevision, workIds };
469
+ db.prepare("INSERT INTO core_app_submissions (app_id, answer_id, request_id, binding_hash, binding_json, checkpoint_json) VALUES (?, ?, ?, ?, ?, ?)")
470
+ .run(credential.appId, answerId, binding.requestId, hash, JSON.stringify(binding), JSON.stringify(checkpoint));
471
+ })();
472
+ }
473
+ catch (error) {
474
+ if (error instanceof CoreAppError)
475
+ throw error;
476
+ // The transaction rolled back, so this attempt stored nothing, but an earlier or concurrent attempt with this ID may have:
477
+ // only the authoritative row says. A saved receipt wins, an incomplete row stays incomplete, absence is unsaved.
478
+ let stored, readable = true;
479
+ try {
480
+ stored = this.row(credential.appId, answerId);
481
+ }
482
+ catch {
483
+ readable = false;
484
+ }
485
+ if (stored?.erased_at)
486
+ throw new CoreAppError("source_unavailable", 409, { answerId, retrySameSubmission: false });
487
+ if (stored && stored.binding_hash !== hash)
488
+ throw new CoreAppError("answer_id_conflict", 409);
489
+ if (stored)
490
+ return this.perform(credential, answerId, binding, hash);
491
+ throw this.persistenceUnavailable(answerId, readable ? "unsaved" : "unknown");
492
+ }
493
+ row = this.row(credential.appId, answerId);
494
+ }
495
+ const checkpoint = parse(row.checkpoint_json);
496
+ const input = this.input(binding, credential.appId, answerId), operation = operationFingerprint(input);
497
+ let receipt = null;
498
+ try {
499
+ await this.writes.act({ ...input, expectedRevision, appSubmission: {
500
+ checkpoint: item => {
501
+ checkpoint.revision = this.queue.decisionRevision(item, { excludeOperationReply: operation });
502
+ db.prepare("UPDATE core_app_submissions SET checkpoint_json = ? WHERE app_id = ? AND answer_id = ? AND erased_at IS NULL")
503
+ .run(JSON.stringify(checkpoint), credential.appId, answerId);
504
+ },
505
+ verify: () => {
506
+ const recovery = this.recovery(this.row(credential.appId, answerId), binding);
507
+ if (!recovery.retry)
508
+ throw new CoreAppError("recovery_conflict", 409, { retrySameSubmission: false });
509
+ },
510
+ finalize: result => {
511
+ receipt = this.receipt(credential.appId, answerId, binding, result);
512
+ db.prepare("UPDATE core_app_submissions SET receipt_json = ? WHERE app_id = ? AND answer_id = ? AND erased_at IS NULL")
513
+ .run(JSON.stringify(receipt), credential.appId, answerId);
514
+ return receipt;
515
+ },
516
+ } });
517
+ }
518
+ catch (error) {
519
+ let recovery;
520
+ try {
521
+ const fresh = this.row(credential.appId, answerId);
522
+ recovery = this.recovery(fresh, binding);
523
+ }
524
+ catch {
525
+ throw this.persistenceUnavailable(answerId, "unknown");
526
+ }
527
+ if (recovery.receipt)
528
+ return { ...recovery.receipt, replayed: true };
529
+ const retry = recovery.retry;
530
+ if (error instanceof MissionControlWriteContractError || retry || recovery.code)
531
+ throw new CoreAppError(retry ? "submission_incomplete" : recovery.code ?? "submission_conflict", retry ? 503 : 409, { answerId, ...(retry ? { submission: { state: "incomplete" } } : {}), retrySameSubmission: retry, currentRevision: recovery.revision, links: this.answerLinks(answerId, binding) });
532
+ throw error;
533
+ }
534
+ return receipt;
535
+ }
536
+ }
537
+ //# sourceMappingURL=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G,CAAC,CAAC,CAAC,GAAG,EACjM,EAAE,QAAQ,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,mBAAmB,EAAE,KAAK,EAAE,eAAe,EAAE,QAAQ,CAAC,QAAQ,EAAE,KAAK,EAAE,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC;YACvL,MAAM,KAAK,CAAC;QACd,CAAC;QACD,OAAO,OAAQ,CAAC;IAClB,CAAC;CACF"}
@@ -0,0 +1,4 @@
1
+ /** Missing new history evidence keeps the prior wake selection. If that
2
+ * selection also fails, its original failure still reaches the caller. */
3
+ export declare function readWithCurrentParkBoundary<T>(read: (boundary: string) => T): T;
4
+ //# sourceMappingURL=current-park-arm.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"current-park-arm.d.ts","sourceRoot":"","sources":["../../src/domain/current-park-arm.ts"],"names":[],"mappings":"AAAA;0EAC0E;AAC1E,wBAAgB,2BAA2B,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,CAAC,GAAG,CAAC,CAS/E"}
@@ -0,0 +1,14 @@
1
+ /** Missing new history evidence keeps the prior wake selection. If that
2
+ * selection also fails, its original failure still reaches the caller. */
3
+ export function readWithCurrentParkBoundary(read) {
4
+ try {
5
+ return read(`AND NOT EXISTS (
6
+ SELECT 1 FROM queue_transitions t
7
+ WHERE t.qitem_id = w.qitem_id AND t.transition_id > w.transition_id AND t.state <> 'blocked'
8
+ )`);
9
+ }
10
+ catch {
11
+ return read("");
12
+ }
13
+ }
14
+ //# sourceMappingURL=current-park-arm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"current-park-arm.js","sourceRoot":"","sources":["../../src/domain/current-park-arm.ts"],"names":[],"mappings":"AAAA;0EAC0E;AAC1E,MAAM,UAAU,2BAA2B,CAAI,IAA6B;IAC1E,IAAI,CAAC;QACH,OAAO,IAAI,CAAC;;;MAGV,CAAC,CAAC;IACN,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC,EAAE,CAAC,CAAC;IAClB,CAAC;AACH,CAAC"}