@openrig/cli 0.7.22 → 0.7.23

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 (821) hide show
  1. package/README.md +7 -7
  2. package/daemon/assets/onboarding/01-world-and-purpose.md +2 -1
  3. package/daemon/assets/onboarding/02-self-and-competent-action.md +6 -0
  4. package/daemon/assets/plugins/openrig/.claude-plugin/plugin.json +1 -1
  5. package/daemon/assets/plugins/openrig/.codex-plugin/plugin.json +1 -1
  6. package/daemon/assets/plugins/openrig/.cursor-plugin/plugin.json +1 -1
  7. package/daemon/assets/plugins/openrig/plugin.json +1 -1
  8. package/daemon/assets/plugins/openrig-core/.claude-plugin/plugin.json +1 -1
  9. package/daemon/assets/plugins/openrig-core/.codex-plugin/plugin.json +1 -1
  10. package/daemon/assets/plugins/openrig-core/hooks/scripts/activity-relay.cjs +13 -0
  11. package/daemon/assets/plugins/openrig-core/skills/claude-compaction-restore/scripts/precompact-hook.mjs +4 -0
  12. package/daemon/assets/plugins/openrig-core/skills/claude-compaction-restore/scripts/restore-from-jsonl.mjs +31 -5
  13. package/daemon/assets/plugins/openrig-core/skills/messaging-the-human/SKILL.md +1 -1
  14. package/daemon/assets/plugins/openrig-core/skills/refocusing/scripts/trace-to-root.py +32 -6
  15. package/daemon/assets/skills/rigs/SKILL.md +14 -5
  16. package/daemon/context-packs/help/manifest.yaml +1 -1
  17. package/daemon/context-packs/onboarding-width/manifest.yaml +1 -1
  18. package/daemon/context-packs/onboarding-width/public-what-you-can-do.md +15 -6
  19. package/daemon/context-packs/reference/acp-agents.md +2 -1
  20. package/daemon/context-packs/reference/getting-started.md +119 -12
  21. package/daemon/context-packs/reference/manifest.yaml +1 -1
  22. package/daemon/context-packs/reference/rig-spec.md +193 -3
  23. package/daemon/context-packs/reference/tmux-servers.md +27 -2
  24. package/daemon/context-packs/reference/whats-new.md +92 -12
  25. package/daemon/context-packs/skills/agent-operated-software/manifest.yaml +1 -1
  26. package/daemon/context-packs/skills/agent-operated-workflows/manifest.yaml +1 -1
  27. package/daemon/context-packs/skills/applying-a-permission-policy/manifest.yaml +1 -1
  28. package/daemon/context-packs/skills/claude-compaction-restore/manifest.yaml +1 -1
  29. package/daemon/context-packs/skills/claude-compaction-restore/scripts/precompact-hook.mjs +4 -0
  30. package/daemon/context-packs/skills/claude-compaction-restore/scripts/restore-from-jsonl.mjs +31 -5
  31. package/daemon/context-packs/skills/core/agent-starters/manifest.yaml +1 -1
  32. package/daemon/context-packs/skills/core/agent-startup-and-context-ingestion/manifest.yaml +1 -1
  33. package/daemon/context-packs/skills/core/cross-host-rig-commands/manifest.yaml +1 -1
  34. package/daemon/context-packs/skills/core/human-in-the-loop/manifest.yaml +1 -1
  35. package/daemon/context-packs/skills/core/messaging-the-human/SKILL.md +1 -1
  36. package/daemon/context-packs/skills/core/messaging-the-human/manifest.yaml +3 -3
  37. package/daemon/context-packs/skills/core/openrig-architect/manifest.yaml +1 -1
  38. package/daemon/context-packs/skills/core/openrig-cmux/manifest.yaml +1 -1
  39. package/daemon/context-packs/skills/core/openrig-herdr/manifest.yaml +1 -1
  40. package/daemon/context-packs/skills/core/openrig-skills/manifest.yaml +1 -1
  41. package/daemon/context-packs/skills/core/openrig-software-factory/manifest.yaml +1 -1
  42. package/daemon/context-packs/skills/core/openrig-upgrade/manifest.yaml +1 -1
  43. package/daemon/context-packs/skills/core/rig-bundles-and-shareable-artifacts/manifest.yaml +1 -1
  44. package/daemon/context-packs/skills/core/rig-lifecycle/manifest.yaml +1 -1
  45. package/daemon/context-packs/skills/core/session-source-fork/manifest.yaml +1 -1
  46. package/daemon/context-packs/skills/core/specification-system/manifest.yaml +1 -1
  47. package/daemon/context-packs/skills/core/topology-mutation-and-seat-management/manifest.yaml +1 -1
  48. package/daemon/context-packs/skills/core/watchdog/manifest.yaml +1 -1
  49. package/daemon/context-packs/skills/core/working-with-an-openrig-team/manifest.yaml +1 -1
  50. package/daemon/context-packs/skills/delegating-work/manifest.yaml +1 -1
  51. package/daemon/context-packs/skills/forming-an-openrig-mental-model/manifest.yaml +1 -1
  52. package/daemon/context-packs/skills/loading-addressable-markdown/manifest.yaml +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/manifest.yaml +1 -1
  56. package/daemon/context-packs/skills/orienting-to-an-inherited-seat/manifest.yaml +1 -1
  57. package/daemon/context-packs/skills/pm/backlog-capture/manifest.yaml +1 -1
  58. package/daemon/context-packs/skills/pm/context-builder/manifest.yaml +1 -1
  59. package/daemon/context-packs/skills/pm/exec-summary/manifest.yaml +1 -1
  60. package/daemon/context-packs/skills/pm/office-hours/manifest.yaml +1 -1
  61. package/daemon/context-packs/skills/pm/plan-review/manifest.yaml +1 -1
  62. package/daemon/context-packs/skills/pm/requirements-writer/manifest.yaml +1 -1
  63. package/daemon/context-packs/skills/pm/ui-mockup/manifest.yaml +1 -1
  64. package/daemon/context-packs/skills/pods/development-team/manifest.yaml +1 -1
  65. package/daemon/context-packs/skills/pods/orchestration-team/manifest.yaml +1 -1
  66. package/daemon/context-packs/skills/pods/oversight-team/manifest.yaml +1 -1
  67. package/daemon/context-packs/skills/pods/review-team/manifest.yaml +1 -1
  68. package/daemon/context-packs/skills/process/agent-browser/manifest.yaml +1 -1
  69. package/daemon/context-packs/skills/process/context-engineering/manifest.yaml +1 -1
  70. package/daemon/context-packs/skills/process/dogfood/manifest.yaml +1 -1
  71. package/daemon/context-packs/skills/process/frontend-design/manifest.yaml +1 -1
  72. package/daemon/context-packs/skills/process/systematic-debugging/manifest.yaml +1 -1
  73. package/daemon/context-packs/skills/process/test-driven-development/manifest.yaml +1 -1
  74. package/daemon/context-packs/skills/process/verification-before-completion/manifest.yaml +1 -1
  75. package/daemon/context-packs/skills/queue-handoff/manifest.yaml +1 -1
  76. package/daemon/context-packs/skills/refocusing/manifest.yaml +1 -1
  77. package/daemon/context-packs/skills/refocusing/scripts/trace-to-root.py +32 -6
  78. package/daemon/context-packs/skills/retiring-and-inheriting-a-seat/manifest.yaml +1 -1
  79. package/daemon/context-packs/skills/seat-continuity-and-handover/manifest.yaml +1 -1
  80. package/daemon/context-packs/skills/session-compaction-and-restore/manifest.yaml +1 -1
  81. package/daemon/context-packs/skills/software-for-agents/manifest.yaml +1 -1
  82. package/daemon/context-packs/world-example/manifest.yaml +1 -1
  83. package/daemon/context-packs/world-public/manifest.yaml +1 -1
  84. package/daemon/dist/adapters/claude-code-adapter.d.ts +14 -1
  85. package/daemon/dist/adapters/claude-code-adapter.d.ts.map +1 -1
  86. package/daemon/dist/adapters/claude-code-adapter.js +86 -17
  87. package/daemon/dist/adapters/claude-code-adapter.js.map +1 -1
  88. package/daemon/dist/adapters/claude-resume.d.ts.map +1 -1
  89. package/daemon/dist/adapters/claude-resume.js +8 -4
  90. package/daemon/dist/adapters/claude-resume.js.map +1 -1
  91. package/daemon/dist/adapters/community-harness-runtime-adapter.d.ts.map +1 -1
  92. package/daemon/dist/adapters/community-harness-runtime-adapter.js +19 -4
  93. package/daemon/dist/adapters/community-harness-runtime-adapter.js.map +1 -1
  94. package/daemon/dist/adapters/seat-slice.d.ts +19 -0
  95. package/daemon/dist/adapters/seat-slice.d.ts.map +1 -0
  96. package/daemon/dist/adapters/seat-slice.js +29 -0
  97. package/daemon/dist/adapters/seat-slice.js.map +1 -0
  98. package/daemon/dist/adapters/shell-quote.d.ts +1 -0
  99. package/daemon/dist/adapters/shell-quote.d.ts.map +1 -1
  100. package/daemon/dist/adapters/shell-quote.js +6 -0
  101. package/daemon/dist/adapters/shell-quote.js.map +1 -1
  102. package/daemon/dist/adapters/tmux.d.ts +32 -8
  103. package/daemon/dist/adapters/tmux.d.ts.map +1 -1
  104. package/daemon/dist/adapters/tmux.js +253 -59
  105. package/daemon/dist/adapters/tmux.js.map +1 -1
  106. package/daemon/dist/build-info.js +3 -3
  107. package/daemon/dist/daemon-shutdown.d.ts +5 -0
  108. package/daemon/dist/daemon-shutdown.d.ts.map +1 -1
  109. package/daemon/dist/daemon-shutdown.js +10 -2
  110. package/daemon/dist/daemon-shutdown.js.map +1 -1
  111. package/daemon/dist/db/all-migrations.d.ts.map +1 -1
  112. package/daemon/dist/db/all-migrations.js +24 -0
  113. package/daemon/dist/db/all-migrations.js.map +1 -1
  114. package/daemon/dist/db/migrate.d.ts +15 -1
  115. package/daemon/dist/db/migrate.d.ts.map +1 -1
  116. package/daemon/dist/db/migrate.js +41 -6
  117. package/daemon/dist/db/migrate.js.map +1 -1
  118. package/daemon/dist/db/migrations/179_remote_control_observations.d.ts +10 -0
  119. package/daemon/dist/db/migrations/179_remote_control_observations.d.ts.map +1 -0
  120. package/daemon/dist/db/migrations/179_remote_control_observations.js +20 -0
  121. package/daemon/dist/db/migrations/179_remote_control_observations.js.map +1 -0
  122. package/daemon/dist/db/migrations/180_session_stop_attempt.d.ts +5 -0
  123. package/daemon/dist/db/migrations/180_session_stop_attempt.d.ts.map +1 -0
  124. package/daemon/dist/db/migrations/180_session_stop_attempt.js +7 -0
  125. package/daemon/dist/db/migrations/180_session_stop_attempt.js.map +1 -0
  126. package/daemon/dist/db/migrations/181_node_keep_alive.d.ts +8 -0
  127. package/daemon/dist/db/migrations/181_node_keep_alive.d.ts.map +1 -0
  128. package/daemon/dist/db/migrations/181_node_keep_alive.js +26 -0
  129. package/daemon/dist/db/migrations/181_node_keep_alive.js.map +1 -0
  130. package/daemon/dist/db/migrations/182_queue_items_blocked_on_index.d.ts +7 -0
  131. package/daemon/dist/db/migrations/182_queue_items_blocked_on_index.d.ts.map +1 -0
  132. package/daemon/dist/db/migrations/182_queue_items_blocked_on_index.js +11 -0
  133. package/daemon/dist/db/migrations/182_queue_items_blocked_on_index.js.map +1 -0
  134. package/daemon/dist/db/migrations/183_queue_items_scan_indexes.d.ts +8 -0
  135. package/daemon/dist/db/migrations/183_queue_items_scan_indexes.d.ts.map +1 -0
  136. package/daemon/dist/db/migrations/183_queue_items_scan_indexes.js +13 -0
  137. package/daemon/dist/db/migrations/183_queue_items_scan_indexes.js.map +1 -0
  138. package/daemon/dist/db/migrations/184_network_requests.d.ts +11 -0
  139. package/daemon/dist/db/migrations/184_network_requests.d.ts.map +1 -0
  140. package/daemon/dist/db/migrations/184_network_requests.js +32 -0
  141. package/daemon/dist/db/migrations/184_network_requests.js.map +1 -0
  142. package/daemon/dist/db/migrations/185_seat_cold_starts.d.ts +9 -0
  143. package/daemon/dist/db/migrations/185_seat_cold_starts.d.ts.map +1 -0
  144. package/daemon/dist/db/migrations/185_seat_cold_starts.js +19 -0
  145. package/daemon/dist/db/migrations/185_seat_cold_starts.js.map +1 -0
  146. package/daemon/dist/db/migrations/186_queue_relayed_answers.d.ts +3 -0
  147. package/daemon/dist/db/migrations/186_queue_relayed_answers.d.ts.map +1 -0
  148. package/daemon/dist/db/migrations/186_queue_relayed_answers.js +5 -0
  149. package/daemon/dist/db/migrations/186_queue_relayed_answers.js.map +1 -0
  150. package/daemon/dist/db/migrations/189_rig_seat_slice.d.ts +5 -0
  151. package/daemon/dist/db/migrations/189_rig_seat_slice.d.ts.map +1 -0
  152. package/daemon/dist/db/migrations/189_rig_seat_slice.js +7 -0
  153. package/daemon/dist/db/migrations/189_rig_seat_slice.js.map +1 -0
  154. package/daemon/dist/db/migrations/190_queue_transfer_staging.d.ts +3 -0
  155. package/daemon/dist/db/migrations/190_queue_transfer_staging.d.ts.map +1 -0
  156. package/daemon/dist/db/migrations/190_queue_transfer_staging.js +20 -0
  157. package/daemon/dist/db/migrations/190_queue_transfer_staging.js.map +1 -0
  158. package/daemon/dist/db/migrations/191_network_binding_providers.d.ts +3 -0
  159. package/daemon/dist/db/migrations/191_network_binding_providers.d.ts.map +1 -0
  160. package/daemon/dist/db/migrations/191_network_binding_providers.js +27 -0
  161. package/daemon/dist/db/migrations/191_network_binding_providers.js.map +1 -0
  162. package/daemon/dist/db/migrations/194_workflow_run_title.d.ts +4 -0
  163. package/daemon/dist/db/migrations/194_workflow_run_title.d.ts.map +1 -0
  164. package/daemon/dist/db/migrations/194_workflow_run_title.js +6 -0
  165. package/daemon/dist/db/migrations/194_workflow_run_title.js.map +1 -0
  166. package/daemon/dist/domain/activity-taxonomy.d.ts +3 -0
  167. package/daemon/dist/domain/activity-taxonomy.d.ts.map +1 -1
  168. package/daemon/dist/domain/activity-taxonomy.js.map +1 -1
  169. package/daemon/dist/domain/agent-activity-store.d.ts +17 -0
  170. package/daemon/dist/domain/agent-activity-store.d.ts.map +1 -1
  171. package/daemon/dist/domain/agent-activity-store.js +101 -45
  172. package/daemon/dist/domain/agent-activity-store.js.map +1 -1
  173. package/daemon/dist/domain/agent-manifest.d.ts.map +1 -1
  174. package/daemon/dist/domain/agent-manifest.js +6 -0
  175. package/daemon/dist/domain/agent-manifest.js.map +1 -1
  176. package/daemon/dist/domain/claude-compaction-enforcer.d.ts +30 -2
  177. package/daemon/dist/domain/claude-compaction-enforcer.d.ts.map +1 -1
  178. package/daemon/dist/domain/claude-compaction-enforcer.js +53 -12
  179. package/daemon/dist/domain/claude-compaction-enforcer.js.map +1 -1
  180. package/daemon/dist/domain/compaction-restore-notice.d.ts +12 -1
  181. package/daemon/dist/domain/compaction-restore-notice.d.ts.map +1 -1
  182. package/daemon/dist/domain/compaction-restore-notice.js +130 -2
  183. package/daemon/dist/domain/compaction-restore-notice.js.map +1 -1
  184. package/daemon/dist/domain/continuity-policy-materializer.d.ts.map +1 -1
  185. package/daemon/dist/domain/continuity-policy-materializer.js +11 -3
  186. package/daemon/dist/domain/continuity-policy-materializer.js.map +1 -1
  187. package/daemon/dist/domain/core-app-job.d.ts +4 -4
  188. package/daemon/dist/domain/core-app-job.d.ts.map +1 -1
  189. package/daemon/dist/domain/core-app-job.js +4 -59
  190. package/daemon/dist/domain/core-app-job.js.map +1 -1
  191. package/daemon/dist/domain/current-work.d.ts +12 -0
  192. package/daemon/dist/domain/current-work.d.ts.map +1 -1
  193. package/daemon/dist/domain/current-work.js +4 -0
  194. package/daemon/dist/domain/current-work.js.map +1 -1
  195. package/daemon/dist/domain/escalation-owner.d.ts +3 -0
  196. package/daemon/dist/domain/escalation-owner.d.ts.map +1 -1
  197. package/daemon/dist/domain/escalation-owner.js +9 -3
  198. package/daemon/dist/domain/escalation-owner.js.map +1 -1
  199. package/daemon/dist/domain/execution-candidate-reader.d.ts +3 -0
  200. package/daemon/dist/domain/execution-candidate-reader.d.ts.map +1 -1
  201. package/daemon/dist/domain/execution-candidate-reader.js +8 -2
  202. package/daemon/dist/domain/execution-candidate-reader.js.map +1 -1
  203. package/daemon/dist/domain/existing-rig-restore.d.ts +2 -0
  204. package/daemon/dist/domain/existing-rig-restore.d.ts.map +1 -1
  205. package/daemon/dist/domain/existing-rig-restore.js +11 -1
  206. package/daemon/dist/domain/existing-rig-restore.js.map +1 -1
  207. package/daemon/dist/domain/gateway/slack/inbound.d.ts.map +1 -1
  208. package/daemon/dist/domain/gateway/slack/inbound.js +49 -8
  209. package/daemon/dist/domain/gateway/slack/inbound.js.map +1 -1
  210. package/daemon/dist/domain/gateway/slack/message.d.ts +1 -4
  211. package/daemon/dist/domain/gateway/slack/message.d.ts.map +1 -1
  212. package/daemon/dist/domain/gateway/slack/message.js +17 -5
  213. package/daemon/dist/domain/gateway/slack/message.js.map +1 -1
  214. package/daemon/dist/domain/gateway/slack/queue-access.d.ts +7 -1
  215. package/daemon/dist/domain/gateway/slack/queue-access.d.ts.map +1 -1
  216. package/daemon/dist/domain/gateway/slack/queue-access.js +1 -0
  217. package/daemon/dist/domain/gateway/slack/queue-access.js.map +1 -1
  218. package/daemon/dist/domain/gateway/slack/settled-asks.d.ts.map +1 -1
  219. package/daemon/dist/domain/gateway/slack/settled-asks.js +15 -2
  220. package/daemon/dist/domain/gateway/slack/settled-asks.js.map +1 -1
  221. package/daemon/dist/domain/gateway/slack/slack-delivery.d.ts +0 -17
  222. package/daemon/dist/domain/gateway/slack/slack-delivery.d.ts.map +1 -1
  223. package/daemon/dist/domain/gateway/slack/slack-delivery.js +10 -40
  224. package/daemon/dist/domain/gateway/slack/slack-delivery.js.map +1 -1
  225. package/daemon/dist/domain/harness-not-started-notice.d.ts +5 -2
  226. package/daemon/dist/domain/harness-not-started-notice.d.ts.map +1 -1
  227. package/daemon/dist/domain/harness-not-started-notice.js +46 -15
  228. package/daemon/dist/domain/harness-not-started-notice.js.map +1 -1
  229. package/daemon/dist/domain/hosts/read-through.d.ts +1 -1
  230. package/daemon/dist/domain/hosts/read-through.d.ts.map +1 -1
  231. package/daemon/dist/domain/hosts/read-through.js +3 -2
  232. package/daemon/dist/domain/hosts/read-through.js.map +1 -1
  233. package/daemon/dist/domain/hot-potato-enforcer.d.ts +3 -3
  234. package/daemon/dist/domain/hot-potato-enforcer.d.ts.map +1 -1
  235. package/daemon/dist/domain/hot-potato-enforcer.js +2 -2
  236. package/daemon/dist/domain/hot-potato-enforcer.js.map +1 -1
  237. package/daemon/dist/domain/human-questions.d.ts +1 -1
  238. package/daemon/dist/domain/human-questions.d.ts.map +1 -1
  239. package/daemon/dist/domain/human-questions.js +2 -0
  240. package/daemon/dist/domain/human-questions.js.map +1 -1
  241. package/daemon/dist/domain/input-read-diagnostic.js +1 -1
  242. package/daemon/dist/domain/input-read-diagnostic.js.map +1 -1
  243. package/daemon/dist/domain/keep-alive-supervisor.d.ts +178 -0
  244. package/daemon/dist/domain/keep-alive-supervisor.d.ts.map +1 -0
  245. package/daemon/dist/domain/keep-alive-supervisor.js +523 -0
  246. package/daemon/dist/domain/keep-alive-supervisor.js.map +1 -0
  247. package/daemon/dist/domain/mission-control/mission-control-fleet-cli-capability.d.ts +6 -0
  248. package/daemon/dist/domain/mission-control/mission-control-fleet-cli-capability.d.ts.map +1 -1
  249. package/daemon/dist/domain/mission-control/mission-control-fleet-cli-capability.js +38 -9
  250. package/daemon/dist/domain/mission-control/mission-control-fleet-cli-capability.js.map +1 -1
  251. package/daemon/dist/domain/mission-control/mission-control-write-contract.d.ts.map +1 -1
  252. package/daemon/dist/domain/mission-control/mission-control-write-contract.js +29 -1
  253. package/daemon/dist/domain/mission-control/mission-control-write-contract.js.map +1 -1
  254. package/daemon/dist/domain/mutation-trace.d.ts +28 -0
  255. package/daemon/dist/domain/mutation-trace.d.ts.map +1 -0
  256. package/daemon/dist/domain/mutation-trace.js +38 -0
  257. package/daemon/dist/domain/mutation-trace.js.map +1 -0
  258. package/daemon/dist/domain/native-resume-probe.d.ts +13 -3
  259. package/daemon/dist/domain/native-resume-probe.d.ts.map +1 -1
  260. package/daemon/dist/domain/native-resume-probe.js +54 -17
  261. package/daemon/dist/domain/native-resume-probe.js.map +1 -1
  262. package/daemon/dist/domain/network/hub-client.d.ts +30 -1
  263. package/daemon/dist/domain/network/hub-client.d.ts.map +1 -1
  264. package/daemon/dist/domain/network/hub-client.js +62 -9
  265. package/daemon/dist/domain/network/hub-client.js.map +1 -1
  266. package/daemon/dist/domain/network/network-bindings.d.ts +52 -2
  267. package/daemon/dist/domain/network/network-bindings.d.ts.map +1 -1
  268. package/daemon/dist/domain/network/network-bindings.js +217 -23
  269. package/daemon/dist/domain/network/network-bindings.js.map +1 -1
  270. package/daemon/dist/domain/network/network-connector.d.ts +9 -1
  271. package/daemon/dist/domain/network/network-connector.d.ts.map +1 -1
  272. package/daemon/dist/domain/network/network-connector.js +95 -7
  273. package/daemon/dist/domain/network/network-connector.js.map +1 -1
  274. package/daemon/dist/domain/network/network-installations.d.ts.map +1 -1
  275. package/daemon/dist/domain/network/network-installations.js +22 -7
  276. package/daemon/dist/domain/network/network-installations.js.map +1 -1
  277. package/daemon/dist/domain/network/network-provider-removal.d.ts +9 -0
  278. package/daemon/dist/domain/network/network-provider-removal.d.ts.map +1 -0
  279. package/daemon/dist/domain/network/network-provider-removal.js +75 -0
  280. package/daemon/dist/domain/network/network-provider-removal.js.map +1 -0
  281. package/daemon/dist/domain/network/network-requests.d.ts +59 -0
  282. package/daemon/dist/domain/network/network-requests.d.ts.map +1 -0
  283. package/daemon/dist/domain/network/network-requests.js +476 -0
  284. package/daemon/dist/domain/network/network-requests.js.map +1 -0
  285. package/daemon/dist/domain/node-inventory.d.ts +26 -0
  286. package/daemon/dist/domain/node-inventory.d.ts.map +1 -1
  287. package/daemon/dist/domain/node-inventory.js +87 -7
  288. package/daemon/dist/domain/node-inventory.js.map +1 -1
  289. package/daemon/dist/domain/occupant-invalidator.d.ts +1 -1
  290. package/daemon/dist/domain/occupant-invalidator.d.ts.map +1 -1
  291. package/daemon/dist/domain/occupant-invalidator.js +1 -1
  292. package/daemon/dist/domain/occupant-invalidator.js.map +1 -1
  293. package/daemon/dist/domain/outbox-handler.d.ts +11 -0
  294. package/daemon/dist/domain/outbox-handler.d.ts.map +1 -1
  295. package/daemon/dist/domain/outbox-handler.js +20 -0
  296. package/daemon/dist/domain/outbox-handler.js.map +1 -1
  297. package/daemon/dist/domain/parked-query.d.ts +6 -0
  298. package/daemon/dist/domain/parked-query.d.ts.map +1 -1
  299. package/daemon/dist/domain/parked-query.js +14 -4
  300. package/daemon/dist/domain/parked-query.js.map +1 -1
  301. package/daemon/dist/domain/policies/seat-pool.d.ts +13 -0
  302. package/daemon/dist/domain/policies/seat-pool.d.ts.map +1 -1
  303. package/daemon/dist/domain/policies/seat-pool.js +18 -3
  304. package/daemon/dist/domain/policies/seat-pool.js.map +1 -1
  305. package/daemon/dist/domain/profile-resolver.d.ts +7 -1
  306. package/daemon/dist/domain/profile-resolver.d.ts.map +1 -1
  307. package/daemon/dist/domain/profile-resolver.js +7 -0
  308. package/daemon/dist/domain/profile-resolver.js.map +1 -1
  309. package/daemon/dist/domain/progress/progress-indexer.d.ts.map +1 -1
  310. package/daemon/dist/domain/progress/progress-indexer.js +11 -0
  311. package/daemon/dist/domain/progress/progress-indexer.js.map +1 -1
  312. package/daemon/dist/domain/project-lifecycle-compiler.d.ts.map +1 -1
  313. package/daemon/dist/domain/project-lifecycle-compiler.js +4 -1
  314. package/daemon/dist/domain/project-lifecycle-compiler.js.map +1 -1
  315. package/daemon/dist/domain/proof/judgments.d.ts +3 -0
  316. package/daemon/dist/domain/proof/judgments.d.ts.map +1 -1
  317. package/daemon/dist/domain/proof/judgments.js +13 -3
  318. package/daemon/dist/domain/proof/judgments.js.map +1 -1
  319. package/daemon/dist/domain/proof/source-watch.js +4 -4
  320. package/daemon/dist/domain/proof/source-watch.js.map +1 -1
  321. package/daemon/dist/domain/provider/claude-interruption.d.ts +6 -0
  322. package/daemon/dist/domain/provider/claude-interruption.d.ts.map +1 -1
  323. package/daemon/dist/domain/provider/claude-interruption.js +18 -0
  324. package/daemon/dist/domain/provider/claude-interruption.js.map +1 -1
  325. package/daemon/dist/domain/ps-projection.d.ts +8 -1
  326. package/daemon/dist/domain/ps-projection.d.ts.map +1 -1
  327. package/daemon/dist/domain/ps-projection.js +11 -3
  328. package/daemon/dist/domain/ps-projection.js.map +1 -1
  329. package/daemon/dist/domain/queue-erasure.d.ts +3 -0
  330. package/daemon/dist/domain/queue-erasure.d.ts.map +1 -1
  331. package/daemon/dist/domain/queue-erasure.js +2 -2
  332. package/daemon/dist/domain/queue-erasure.js.map +1 -1
  333. package/daemon/dist/domain/queue-owner.d.ts +5 -0
  334. package/daemon/dist/domain/queue-owner.d.ts.map +1 -1
  335. package/daemon/dist/domain/queue-owner.js +16 -8
  336. package/daemon/dist/domain/queue-owner.js.map +1 -1
  337. package/daemon/dist/domain/queue-recorded-graph.d.ts +32 -0
  338. package/daemon/dist/domain/queue-recorded-graph.d.ts.map +1 -0
  339. package/daemon/dist/domain/queue-recorded-graph.js +84 -0
  340. package/daemon/dist/domain/queue-recorded-graph.js.map +1 -0
  341. package/daemon/dist/domain/queue-repository.d.ts +74 -4
  342. package/daemon/dist/domain/queue-repository.d.ts.map +1 -1
  343. package/daemon/dist/domain/queue-repository.js +398 -25
  344. package/daemon/dist/domain/queue-repository.js.map +1 -1
  345. package/daemon/dist/domain/queue-retention.d.ts +1 -1
  346. package/daemon/dist/domain/queue-retention.d.ts.map +1 -1
  347. package/daemon/dist/domain/queue-retention.js +4 -0
  348. package/daemon/dist/domain/queue-retention.js.map +1 -1
  349. package/daemon/dist/domain/queue-stuck-sweep.d.ts.map +1 -1
  350. package/daemon/dist/domain/queue-stuck-sweep.js +43 -9
  351. package/daemon/dist/domain/queue-stuck-sweep.js.map +1 -1
  352. package/daemon/dist/domain/queue-transfer-export.d.ts +75 -0
  353. package/daemon/dist/domain/queue-transfer-export.d.ts.map +1 -0
  354. package/daemon/dist/domain/queue-transfer-export.js +156 -0
  355. package/daemon/dist/domain/queue-transfer-export.js.map +1 -0
  356. package/daemon/dist/domain/queue-transfer-format.d.ts +15 -0
  357. package/daemon/dist/domain/queue-transfer-format.d.ts.map +1 -0
  358. package/daemon/dist/domain/queue-transfer-format.js +32 -0
  359. package/daemon/dist/domain/queue-transfer-format.js.map +1 -0
  360. package/daemon/dist/domain/queue-transfer-parse.d.ts +40 -0
  361. package/daemon/dist/domain/queue-transfer-parse.d.ts.map +1 -0
  362. package/daemon/dist/domain/queue-transfer-parse.js +131 -0
  363. package/daemon/dist/domain/queue-transfer-parse.js.map +1 -0
  364. package/daemon/dist/domain/queue-transfer-review.d.ts +22 -0
  365. package/daemon/dist/domain/queue-transfer-review.d.ts.map +1 -0
  366. package/daemon/dist/domain/queue-transfer-review.js +81 -0
  367. package/daemon/dist/domain/queue-transfer-review.js.map +1 -0
  368. package/daemon/dist/domain/queue-transfer-staging.d.ts +79 -0
  369. package/daemon/dist/domain/queue-transfer-staging.d.ts.map +1 -0
  370. package/daemon/dist/domain/queue-transfer-staging.js +67 -0
  371. package/daemon/dist/domain/queue-transfer-staging.js.map +1 -0
  372. package/daemon/dist/domain/queue-wake-ladder.d.ts +4 -0
  373. package/daemon/dist/domain/queue-wake-ladder.d.ts.map +1 -1
  374. package/daemon/dist/domain/queue-wake-ladder.js +161 -20
  375. package/daemon/dist/domain/queue-wake-ladder.js.map +1 -1
  376. package/daemon/dist/domain/reconciler.d.ts +27 -2
  377. package/daemon/dist/domain/reconciler.d.ts.map +1 -1
  378. package/daemon/dist/domain/reconciler.js +184 -16
  379. package/daemon/dist/domain/reconciler.js.map +1 -1
  380. package/daemon/dist/domain/refusal-trace.d.ts +15 -0
  381. package/daemon/dist/domain/refusal-trace.d.ts.map +1 -0
  382. package/daemon/dist/domain/refusal-trace.js +23 -0
  383. package/daemon/dist/domain/refusal-trace.js.map +1 -0
  384. package/daemon/dist/domain/relayed-answers.d.ts +80 -0
  385. package/daemon/dist/domain/relayed-answers.d.ts.map +1 -0
  386. package/daemon/dist/domain/relayed-answers.js +8 -0
  387. package/daemon/dist/domain/relayed-answers.js.map +1 -0
  388. package/daemon/dist/domain/remote-control-observations.d.ts +50 -0
  389. package/daemon/dist/domain/remote-control-observations.d.ts.map +1 -0
  390. package/daemon/dist/domain/remote-control-observations.js +72 -0
  391. package/daemon/dist/domain/remote-control-observations.js.map +1 -0
  392. package/daemon/dist/domain/restore-attempt-receipt.d.ts.map +1 -1
  393. package/daemon/dist/domain/restore-attempt-receipt.js +8 -2
  394. package/daemon/dist/domain/restore-attempt-receipt.js.map +1 -1
  395. package/daemon/dist/domain/restore-orchestrator.d.ts +67 -6
  396. package/daemon/dist/domain/restore-orchestrator.d.ts.map +1 -1
  397. package/daemon/dist/domain/restore-orchestrator.js +345 -51
  398. package/daemon/dist/domain/restore-orchestrator.js.map +1 -1
  399. package/daemon/dist/domain/rig-lifecycle-service.d.ts.map +1 -1
  400. package/daemon/dist/domain/rig-lifecycle-service.js +4 -1
  401. package/daemon/dist/domain/rig-lifecycle-service.js.map +1 -1
  402. package/daemon/dist/domain/rig-repository.d.ts +21 -3
  403. package/daemon/dist/domain/rig-repository.d.ts.map +1 -1
  404. package/daemon/dist/domain/rig-repository.js +67 -2
  405. package/daemon/dist/domain/rig-repository.js.map +1 -1
  406. package/daemon/dist/domain/rig-teardown.d.ts +22 -7
  407. package/daemon/dist/domain/rig-teardown.d.ts.map +1 -1
  408. package/daemon/dist/domain/rig-teardown.js +108 -24
  409. package/daemon/dist/domain/rig-teardown.js.map +1 -1
  410. package/daemon/dist/domain/rigspec-codec.d.ts.map +1 -1
  411. package/daemon/dist/domain/rigspec-codec.js +12 -0
  412. package/daemon/dist/domain/rigspec-codec.js.map +1 -1
  413. package/daemon/dist/domain/rigspec-exporter.d.ts +14 -0
  414. package/daemon/dist/domain/rigspec-exporter.d.ts.map +1 -1
  415. package/daemon/dist/domain/rigspec-exporter.js +56 -14
  416. package/daemon/dist/domain/rigspec-exporter.js.map +1 -1
  417. package/daemon/dist/domain/rigspec-instantiator.d.ts +32 -3
  418. package/daemon/dist/domain/rigspec-instantiator.d.ts.map +1 -1
  419. package/daemon/dist/domain/rigspec-instantiator.js +121 -23
  420. package/daemon/dist/domain/rigspec-instantiator.js.map +1 -1
  421. package/daemon/dist/domain/rigspec-schema.d.ts.map +1 -1
  422. package/daemon/dist/domain/rigspec-schema.js +30 -4
  423. package/daemon/dist/domain/rigspec-schema.js.map +1 -1
  424. package/daemon/dist/domain/rosters.d.ts +1 -0
  425. package/daemon/dist/domain/rosters.d.ts.map +1 -1
  426. package/daemon/dist/domain/rosters.js +5 -4
  427. package/daemon/dist/domain/rosters.js.map +1 -1
  428. package/daemon/dist/domain/seat-activity-service.d.ts +4 -0
  429. package/daemon/dist/domain/seat-activity-service.d.ts.map +1 -1
  430. package/daemon/dist/domain/seat-activity-service.js +24 -5
  431. package/daemon/dist/domain/seat-activity-service.js.map +1 -1
  432. package/daemon/dist/domain/seat-attention-reconciler.d.ts +7 -0
  433. package/daemon/dist/domain/seat-attention-reconciler.d.ts.map +1 -1
  434. package/daemon/dist/domain/seat-attention-reconciler.js +149 -65
  435. package/daemon/dist/domain/seat-attention-reconciler.js.map +1 -1
  436. package/daemon/dist/domain/seat-cold-start.d.ts +150 -0
  437. package/daemon/dist/domain/seat-cold-start.d.ts.map +1 -0
  438. package/daemon/dist/domain/seat-cold-start.js +371 -0
  439. package/daemon/dist/domain/seat-cold-start.js.map +1 -0
  440. package/daemon/dist/domain/seat-delivery-guard.d.ts +11 -2
  441. package/daemon/dist/domain/seat-delivery-guard.d.ts.map +1 -1
  442. package/daemon/dist/domain/seat-delivery-guard.js +34 -6
  443. package/daemon/dist/domain/seat-delivery-guard.js.map +1 -1
  444. package/daemon/dist/domain/seat-identity-reconciler.d.ts +13 -0
  445. package/daemon/dist/domain/seat-identity-reconciler.d.ts.map +1 -1
  446. package/daemon/dist/domain/seat-identity-reconciler.js +63 -23
  447. package/daemon/dist/domain/seat-identity-reconciler.js.map +1 -1
  448. package/daemon/dist/domain/seat-identity-store.d.ts +5 -3
  449. package/daemon/dist/domain/seat-identity-store.d.ts.map +1 -1
  450. package/daemon/dist/domain/seat-identity-store.js +7 -3
  451. package/daemon/dist/domain/seat-identity-store.js.map +1 -1
  452. package/daemon/dist/domain/seat-launch-environment.d.ts +2 -0
  453. package/daemon/dist/domain/seat-launch-environment.d.ts.map +1 -1
  454. package/daemon/dist/domain/seat-launch-environment.js +9 -1
  455. package/daemon/dist/domain/seat-launch-environment.js.map +1 -1
  456. package/daemon/dist/domain/seat-lifecycle-service.d.ts +17 -0
  457. package/daemon/dist/domain/seat-lifecycle-service.d.ts.map +1 -1
  458. package/daemon/dist/domain/seat-lifecycle-service.js +176 -22
  459. package/daemon/dist/domain/seat-lifecycle-service.js.map +1 -1
  460. package/daemon/dist/domain/seat-pool-executor.d.ts +116 -0
  461. package/daemon/dist/domain/seat-pool-executor.d.ts.map +1 -0
  462. package/daemon/dist/domain/seat-pool-executor.js +565 -0
  463. package/daemon/dist/domain/seat-pool-executor.js.map +1 -0
  464. package/daemon/dist/domain/seat-pool-registration.d.ts +93 -0
  465. package/daemon/dist/domain/seat-pool-registration.d.ts.map +1 -0
  466. package/daemon/dist/domain/seat-pool-registration.js +149 -0
  467. package/daemon/dist/domain/seat-pool-registration.js.map +1 -0
  468. package/daemon/dist/domain/seat-pool-slots.d.ts +42 -0
  469. package/daemon/dist/domain/seat-pool-slots.d.ts.map +1 -1
  470. package/daemon/dist/domain/seat-pool-slots.js +51 -0
  471. package/daemon/dist/domain/seat-pool-slots.js.map +1 -1
  472. package/daemon/dist/domain/seat-restart-in-place.d.ts +15 -0
  473. package/daemon/dist/domain/seat-restart-in-place.d.ts.map +1 -1
  474. package/daemon/dist/domain/seat-restart-in-place.js +54 -2
  475. package/daemon/dist/domain/seat-restart-in-place.js.map +1 -1
  476. package/daemon/dist/domain/seat-runtime-home-record.d.ts +8 -0
  477. package/daemon/dist/domain/seat-runtime-home-record.d.ts.map +1 -1
  478. package/daemon/dist/domain/seat-runtime-home-record.js +1 -1
  479. package/daemon/dist/domain/seat-runtime-home-record.js.map +1 -1
  480. package/daemon/dist/domain/session-registry.d.ts +22 -3
  481. package/daemon/dist/domain/session-registry.d.ts.map +1 -1
  482. package/daemon/dist/domain/session-registry.js +38 -6
  483. package/daemon/dist/domain/session-registry.js.map +1 -1
  484. package/daemon/dist/domain/session-transport.d.ts +18 -2
  485. package/daemon/dist/domain/session-transport.d.ts.map +1 -1
  486. package/daemon/dist/domain/session-transport.js +65 -38
  487. package/daemon/dist/domain/session-transport.js.map +1 -1
  488. package/daemon/dist/domain/slices/slice-indexer.d.ts +55 -0
  489. package/daemon/dist/domain/slices/slice-indexer.d.ts.map +1 -1
  490. package/daemon/dist/domain/slices/slice-indexer.js +259 -50
  491. package/daemon/dist/domain/slices/slice-indexer.js.map +1 -1
  492. package/daemon/dist/domain/startup-orchestrator.d.ts +1 -1
  493. package/daemon/dist/domain/startup-orchestrator.d.ts.map +1 -1
  494. package/daemon/dist/domain/startup-orchestrator.js +75 -23
  495. package/daemon/dist/domain/startup-orchestrator.js.map +1 -1
  496. package/daemon/dist/domain/startup-proof.d.ts +6 -0
  497. package/daemon/dist/domain/startup-proof.d.ts.map +1 -1
  498. package/daemon/dist/domain/startup-proof.js +11 -0
  499. package/daemon/dist/domain/startup-proof.js.map +1 -1
  500. package/daemon/dist/domain/startup-submission-evidence.d.ts +2 -0
  501. package/daemon/dist/domain/startup-submission-evidence.d.ts.map +1 -1
  502. package/daemon/dist/domain/startup-submission-evidence.js +31 -3
  503. package/daemon/dist/domain/startup-submission-evidence.js.map +1 -1
  504. package/daemon/dist/domain/terminal/herdr-adapter.d.ts +2 -0
  505. package/daemon/dist/domain/terminal/herdr-adapter.d.ts.map +1 -1
  506. package/daemon/dist/domain/terminal/herdr-adapter.js +2 -0
  507. package/daemon/dist/domain/terminal/herdr-adapter.js.map +1 -1
  508. package/daemon/dist/domain/terminal/scope-task-terminal-view.d.ts +2 -1
  509. package/daemon/dist/domain/terminal/scope-task-terminal-view.d.ts.map +1 -1
  510. package/daemon/dist/domain/terminal/scope-task-terminal-view.js +80 -38
  511. package/daemon/dist/domain/terminal/scope-task-terminal-view.js.map +1 -1
  512. package/daemon/dist/domain/terminal/terminal-provider.d.ts +2 -0
  513. package/daemon/dist/domain/terminal/terminal-provider.d.ts.map +1 -1
  514. package/daemon/dist/domain/terminal/terminal-service.d.ts +3 -0
  515. package/daemon/dist/domain/terminal/terminal-service.d.ts.map +1 -1
  516. package/daemon/dist/domain/terminal/terminal-service.js +30 -26
  517. package/daemon/dist/domain/terminal/terminal-service.js.map +1 -1
  518. package/daemon/dist/domain/terminal/tile-attach.d.ts +22 -0
  519. package/daemon/dist/domain/terminal/tile-attach.d.ts.map +1 -1
  520. package/daemon/dist/domain/terminal/tile-attach.js +71 -0
  521. package/daemon/dist/domain/terminal/tile-attach.js.map +1 -1
  522. package/daemon/dist/domain/terminal/view-composer.d.ts +2 -0
  523. package/daemon/dist/domain/terminal/view-composer.d.ts.map +1 -1
  524. package/daemon/dist/domain/terminal/view-composer.js +4 -2
  525. package/daemon/dist/domain/terminal/view-composer.js.map +1 -1
  526. package/daemon/dist/domain/topology-trace.d.ts +40 -0
  527. package/daemon/dist/domain/topology-trace.d.ts.map +1 -0
  528. package/daemon/dist/domain/topology-trace.js +106 -0
  529. package/daemon/dist/domain/topology-trace.js.map +1 -0
  530. package/daemon/dist/domain/transcript-store.d.ts.map +1 -1
  531. package/daemon/dist/domain/transcript-store.js +12 -1
  532. package/daemon/dist/domain/transcript-store.js.map +1 -1
  533. package/daemon/dist/domain/types.d.ts +104 -8
  534. package/daemon/dist/domain/types.d.ts.map +1 -1
  535. package/daemon/dist/domain/types.js +3 -2
  536. package/daemon/dist/domain/types.js.map +1 -1
  537. package/daemon/dist/domain/user-settings/settings-browser.d.ts.map +1 -1
  538. package/daemon/dist/domain/user-settings/settings-browser.js +2 -0
  539. package/daemon/dist/domain/user-settings/settings-browser.js.map +1 -1
  540. package/daemon/dist/domain/user-settings/settings-store.d.ts +1 -1
  541. package/daemon/dist/domain/user-settings/settings-store.d.ts.map +1 -1
  542. package/daemon/dist/domain/user-settings/settings-store.js +13 -0
  543. package/daemon/dist/domain/user-settings/settings-store.js.map +1 -1
  544. package/daemon/dist/domain/watchdog-jobs-repository.d.ts +5 -3
  545. package/daemon/dist/domain/watchdog-jobs-repository.d.ts.map +1 -1
  546. package/daemon/dist/domain/watchdog-jobs-repository.js +6 -1
  547. package/daemon/dist/domain/watchdog-jobs-repository.js.map +1 -1
  548. package/daemon/dist/domain/watchdog-policy-engine.d.ts +8 -1
  549. package/daemon/dist/domain/watchdog-policy-engine.d.ts.map +1 -1
  550. package/daemon/dist/domain/watchdog-policy-engine.js +6 -2
  551. package/daemon/dist/domain/watchdog-policy-engine.js.map +1 -1
  552. package/daemon/dist/domain/workflow-instance-store.d.ts +2 -0
  553. package/daemon/dist/domain/workflow-instance-store.d.ts.map +1 -1
  554. package/daemon/dist/domain/workflow-instance-store.js +11 -2
  555. package/daemon/dist/domain/workflow-instance-store.js.map +1 -1
  556. package/daemon/dist/domain/workflow-projector.d.ts +3 -1
  557. package/daemon/dist/domain/workflow-projector.d.ts.map +1 -1
  558. package/daemon/dist/domain/workflow-projector.js +58 -10
  559. package/daemon/dist/domain/workflow-projector.js.map +1 -1
  560. package/daemon/dist/domain/workflow-run-title.d.ts +4 -0
  561. package/daemon/dist/domain/workflow-run-title.d.ts.map +1 -0
  562. package/daemon/dist/domain/workflow-run-title.js +5 -0
  563. package/daemon/dist/domain/workflow-run-title.js.map +1 -0
  564. package/daemon/dist/domain/workflow-runtime.d.ts +1 -0
  565. package/daemon/dist/domain/workflow-runtime.d.ts.map +1 -1
  566. package/daemon/dist/domain/workflow-runtime.js +3 -1
  567. package/daemon/dist/domain/workflow-runtime.js.map +1 -1
  568. package/daemon/dist/domain/workflow-spec-cache.d.ts +2 -2
  569. package/daemon/dist/domain/workflow-spec-cache.d.ts.map +1 -1
  570. package/daemon/dist/domain/workflow-spec-cache.js +20 -1
  571. package/daemon/dist/domain/workflow-spec-cache.js.map +1 -1
  572. package/daemon/dist/domain/workflow-types.d.ts +15 -0
  573. package/daemon/dist/domain/workflow-types.d.ts.map +1 -1
  574. package/daemon/dist/domain/workflow-types.js +4 -0
  575. package/daemon/dist/domain/workflow-types.js.map +1 -1
  576. package/daemon/dist/domain/workspace/project-read.d.ts +10 -0
  577. package/daemon/dist/domain/workspace/project-read.d.ts.map +1 -1
  578. package/daemon/dist/domain/workspace/project-read.js +34 -2
  579. package/daemon/dist/domain/workspace/project-read.js.map +1 -1
  580. package/daemon/dist/index.d.ts.map +1 -1
  581. package/daemon/dist/index.js +7 -1
  582. package/daemon/dist/index.js.map +1 -1
  583. package/daemon/dist/queue-transfer-export-surface.d.ts +33 -0
  584. package/daemon/dist/queue-transfer-export-surface.d.ts.map +1 -0
  585. package/daemon/dist/queue-transfer-export-surface.js +13 -0
  586. package/daemon/dist/queue-transfer-export-surface.js.map +1 -0
  587. package/daemon/dist/queue-transfer-staging-surface.d.ts +86 -0
  588. package/daemon/dist/queue-transfer-staging-surface.d.ts.map +1 -0
  589. package/daemon/dist/queue-transfer-staging-surface.js +91 -0
  590. package/daemon/dist/queue-transfer-staging-surface.js.map +1 -0
  591. package/daemon/dist/routes/activity.d.ts.map +1 -1
  592. package/daemon/dist/routes/activity.js +46 -0
  593. package/daemon/dist/routes/activity.js.map +1 -1
  594. package/daemon/dist/routes/compaction.d.ts.map +1 -1
  595. package/daemon/dist/routes/compaction.js +7 -2
  596. package/daemon/dist/routes/compaction.js.map +1 -1
  597. package/daemon/dist/routes/context-packs.d.ts.map +1 -1
  598. package/daemon/dist/routes/context-packs.js +23 -1
  599. package/daemon/dist/routes/context-packs.js.map +1 -1
  600. package/daemon/dist/routes/events.js +7 -4
  601. package/daemon/dist/routes/events.js.map +1 -1
  602. package/daemon/dist/routes/network.d.ts +2 -0
  603. package/daemon/dist/routes/network.d.ts.map +1 -1
  604. package/daemon/dist/routes/network.js +62 -1
  605. package/daemon/dist/routes/network.js.map +1 -1
  606. package/daemon/dist/routes/ps.js +12 -1
  607. package/daemon/dist/routes/ps.js.map +1 -1
  608. package/daemon/dist/routes/queue.d.ts.map +1 -1
  609. package/daemon/dist/routes/queue.js +155 -52
  610. package/daemon/dist/routes/queue.js.map +1 -1
  611. package/daemon/dist/routes/require-sender-identity.d.ts.map +1 -1
  612. package/daemon/dist/routes/require-sender-identity.js +6 -3
  613. package/daemon/dist/routes/require-sender-identity.js.map +1 -1
  614. package/daemon/dist/routes/rigs.js +2 -0
  615. package/daemon/dist/routes/rigs.js.map +1 -1
  616. package/daemon/dist/routes/seat.d.ts.map +1 -1
  617. package/daemon/dist/routes/seat.js +12 -5
  618. package/daemon/dist/routes/seat.js.map +1 -1
  619. package/daemon/dist/routes/sessions.d.ts.map +1 -1
  620. package/daemon/dist/routes/sessions.js +14 -0
  621. package/daemon/dist/routes/sessions.js.map +1 -1
  622. package/daemon/dist/routes/slices.d.ts.map +1 -1
  623. package/daemon/dist/routes/slices.js +16 -7
  624. package/daemon/dist/routes/slices.js.map +1 -1
  625. package/daemon/dist/routes/startup.d.ts.map +1 -1
  626. package/daemon/dist/routes/startup.js +49 -4
  627. package/daemon/dist/routes/startup.js.map +1 -1
  628. package/daemon/dist/routes/terminal-ws.js +28 -2
  629. package/daemon/dist/routes/terminal-ws.js.map +1 -1
  630. package/daemon/dist/routes/terminal.d.ts.map +1 -1
  631. package/daemon/dist/routes/terminal.js +3 -2
  632. package/daemon/dist/routes/terminal.js.map +1 -1
  633. package/daemon/dist/routes/transport.d.ts.map +1 -1
  634. package/daemon/dist/routes/transport.js +14 -2
  635. package/daemon/dist/routes/transport.js.map +1 -1
  636. package/daemon/dist/routes/up.js +2 -0
  637. package/daemon/dist/routes/up.js.map +1 -1
  638. package/daemon/dist/routes/workflow.d.ts.map +1 -1
  639. package/daemon/dist/routes/workflow.js +9 -3
  640. package/daemon/dist/routes/workflow.js.map +1 -1
  641. package/daemon/dist/server.d.ts +7 -0
  642. package/daemon/dist/server.d.ts.map +1 -1
  643. package/daemon/dist/server.js +8 -0
  644. package/daemon/dist/server.js.map +1 -1
  645. package/daemon/dist/startup.d.ts +3 -0
  646. package/daemon/dist/startup.d.ts.map +1 -1
  647. package/daemon/dist/startup.js +133 -7
  648. package/daemon/dist/startup.js.map +1 -1
  649. package/daemon/dist/terminal/TerminalSessionBroker.d.ts +10 -0
  650. package/daemon/dist/terminal/TerminalSessionBroker.d.ts.map +1 -1
  651. package/daemon/dist/terminal/TerminalSessionBroker.js +63 -4
  652. package/daemon/dist/terminal/TerminalSessionBroker.js.map +1 -1
  653. package/daemon/dist/topology-trace-surface.d.ts +2 -0
  654. package/daemon/dist/topology-trace-surface.d.ts.map +1 -0
  655. package/daemon/dist/topology-trace-surface.js +2 -0
  656. package/daemon/dist/topology-trace-surface.js.map +1 -0
  657. package/daemon/docs/reference/acp-agents.md +2 -1
  658. package/daemon/docs/reference/agent-spec.md +3 -1
  659. package/daemon/docs/reference/agent-startup-guide.md +3 -1
  660. package/daemon/docs/reference/agent-state-taxonomy.md +35 -1
  661. package/daemon/docs/reference/checked-seat-stop.md +11 -1
  662. package/daemon/docs/reference/claude-status-line.md +7 -0
  663. package/daemon/docs/reference/daemon-http-clients.md +120 -18
  664. package/daemon/docs/reference/gateway-participants.md +6 -0
  665. package/daemon/docs/reference/getting-started.md +119 -12
  666. package/daemon/docs/reference/hosted-members.md +114 -0
  667. package/daemon/docs/reference/inventory-request-diagnostics.md +22 -0
  668. package/daemon/docs/reference/network-connector.md +112 -4
  669. package/daemon/docs/reference/project-workspace.md +11 -2
  670. package/daemon/docs/reference/queue-erasure.md +1 -1
  671. package/daemon/docs/reference/queue-transfer-export.md +38 -0
  672. package/daemon/docs/reference/queue-transfer-staging.md +39 -0
  673. package/daemon/docs/reference/quickstart.md +4 -4
  674. package/daemon/docs/reference/refocus-channel.md +5 -2
  675. package/daemon/docs/reference/rig-spec.md +193 -3
  676. package/daemon/docs/reference/rosters.md +18 -3
  677. package/daemon/docs/reference/sdlc-conventions.md +1 -1
  678. package/daemon/docs/reference/seat-delivery.md +21 -4
  679. package/daemon/docs/reference/seat-pools.md +116 -0
  680. package/daemon/docs/reference/terminal-sessions.md +57 -11
  681. package/daemon/docs/reference/tmux-servers.md +27 -2
  682. package/daemon/docs/reference/whats-new.md +92 -12
  683. package/daemon/specs/agents/shared/skills/core/messaging-the-human/SKILL.md +1 -1
  684. package/dist/build-info.js +3 -3
  685. package/dist/client.d.ts +2 -1
  686. package/dist/client.d.ts.map +1 -1
  687. package/dist/commands/broadcast.d.ts.map +1 -1
  688. package/dist/commands/broadcast.js +87 -8
  689. package/dist/commands/broadcast.js.map +1 -1
  690. package/dist/commands/chatroom.d.ts +3 -0
  691. package/dist/commands/chatroom.d.ts.map +1 -1
  692. package/dist/commands/chatroom.js +7 -1
  693. package/dist/commands/chatroom.js.map +1 -1
  694. package/dist/commands/config.d.ts.map +1 -1
  695. package/dist/commands/config.js +2 -1
  696. package/dist/commands/config.js.map +1 -1
  697. package/dist/commands/daemon.d.ts.map +1 -1
  698. package/dist/commands/daemon.js +18 -15
  699. package/dist/commands/daemon.js.map +1 -1
  700. package/dist/commands/exec.d.ts.map +1 -1
  701. package/dist/commands/exec.js +22 -13
  702. package/dist/commands/exec.js.map +1 -1
  703. package/dist/commands/export.d.ts.map +1 -1
  704. package/dist/commands/export.js +5 -1
  705. package/dist/commands/export.js.map +1 -1
  706. package/dist/commands/gateway.d.ts +4 -0
  707. package/dist/commands/gateway.d.ts.map +1 -1
  708. package/dist/commands/gateway.js +37 -0
  709. package/dist/commands/gateway.js.map +1 -1
  710. package/dist/commands/network.d.ts.map +1 -1
  711. package/dist/commands/network.js +54 -1
  712. package/dist/commands/network.js.map +1 -1
  713. package/dist/commands/parked.d.ts.map +1 -1
  714. package/dist/commands/parked.js +12 -6
  715. package/dist/commands/parked.js.map +1 -1
  716. package/dist/commands/provider.d.ts.map +1 -1
  717. package/dist/commands/provider.js +3 -2
  718. package/dist/commands/provider.js.map +1 -1
  719. package/dist/commands/ps.d.ts +12 -1
  720. package/dist/commands/ps.d.ts.map +1 -1
  721. package/dist/commands/ps.js +43 -10
  722. package/dist/commands/ps.js.map +1 -1
  723. package/dist/commands/queue-export.d.ts +3 -0
  724. package/dist/commands/queue-export.d.ts.map +1 -0
  725. package/dist/commands/queue-export.js +67 -0
  726. package/dist/commands/queue-export.js.map +1 -0
  727. package/dist/commands/queue-import.d.ts +4 -0
  728. package/dist/commands/queue-import.d.ts.map +1 -0
  729. package/dist/commands/queue-import.js +47 -0
  730. package/dist/commands/queue-import.js.map +1 -0
  731. package/dist/commands/queue.d.ts +1 -1
  732. package/dist/commands/queue.d.ts.map +1 -1
  733. package/dist/commands/queue.js +50 -1
  734. package/dist/commands/queue.js.map +1 -1
  735. package/dist/commands/roster.js +1 -1
  736. package/dist/commands/roster.js.map +1 -1
  737. package/dist/commands/scope.d.ts.map +1 -1
  738. package/dist/commands/scope.js +30 -18
  739. package/dist/commands/scope.js.map +1 -1
  740. package/dist/commands/seat.d.ts.map +1 -1
  741. package/dist/commands/seat.js +20 -2
  742. package/dist/commands/seat.js.map +1 -1
  743. package/dist/commands/send.d.ts.map +1 -1
  744. package/dist/commands/send.js +15 -3
  745. package/dist/commands/send.js.map +1 -1
  746. package/dist/commands/start.d.ts +14 -0
  747. package/dist/commands/start.d.ts.map +1 -1
  748. package/dist/commands/start.js +54 -5
  749. package/dist/commands/start.js.map +1 -1
  750. package/dist/commands/workflow.d.ts.map +1 -1
  751. package/dist/commands/workflow.js +4 -0
  752. package/dist/commands/workflow.js.map +1 -1
  753. package/dist/config-store.d.ts +2 -1
  754. package/dist/config-store.d.ts.map +1 -1
  755. package/dist/config-store.js +14 -1
  756. package/dist/config-store.js.map +1 -1
  757. package/dist/cross-host-executor.d.ts +3 -0
  758. package/dist/cross-host-executor.d.ts.map +1 -1
  759. package/dist/cross-host-executor.js +5 -0
  760. package/dist/cross-host-executor.js.map +1 -1
  761. package/dist/daemon-auto-start.d.ts.map +1 -1
  762. package/dist/daemon-auto-start.js +1 -0
  763. package/dist/daemon-auto-start.js.map +1 -1
  764. package/dist/daemon-lifecycle.d.ts +6 -1
  765. package/dist/daemon-lifecycle.d.ts.map +1 -1
  766. package/dist/daemon-lifecycle.js +90 -30
  767. package/dist/daemon-lifecycle.js.map +1 -1
  768. package/dist/daemon-start-lock.d.ts +38 -3
  769. package/dist/daemon-start-lock.d.ts.map +1 -1
  770. package/dist/daemon-start-lock.js +201 -48
  771. package/dist/daemon-start-lock.js.map +1 -1
  772. package/dist/lib/scope/progress-edit.d.ts.map +1 -1
  773. package/dist/lib/scope/progress-edit.js +10 -0
  774. package/dist/lib/scope/progress-edit.js.map +1 -1
  775. package/dist/lib/topology-trace.d.ts +3 -34
  776. package/dist/lib/topology-trace.d.ts.map +1 -1
  777. package/dist/lib/topology-trace.js +3 -97
  778. package/dist/lib/topology-trace.js.map +1 -1
  779. package/dist/local-db.d.ts +2 -0
  780. package/dist/local-db.d.ts.map +1 -1
  781. package/dist/local-db.js +14 -11
  782. package/dist/local-db.js.map +1 -1
  783. package/dist/mcp-caller-resolver.d.ts +36 -0
  784. package/dist/mcp-caller-resolver.d.ts.map +1 -0
  785. package/dist/mcp-caller-resolver.js +82 -0
  786. package/dist/mcp-caller-resolver.js.map +1 -0
  787. package/dist/mcp-http.d.ts +43 -2
  788. package/dist/mcp-http.d.ts.map +1 -1
  789. package/dist/mcp-http.js +223 -46
  790. package/dist/mcp-http.js.map +1 -1
  791. package/dist/mcp-server.d.ts +23 -0
  792. package/dist/mcp-server.d.ts.map +1 -1
  793. package/dist/mcp-server.js +108 -39
  794. package/dist/mcp-server.js.map +1 -1
  795. package/dist/mcp-surface.d.ts +3 -2
  796. package/dist/mcp-surface.d.ts.map +1 -1
  797. package/dist/node-support.d.ts.map +1 -1
  798. package/dist/node-support.js +10 -0
  799. package/dist/node-support.js.map +1 -1
  800. package/dist/remote-host-ops.d.ts +3 -0
  801. package/dist/remote-host-ops.d.ts.map +1 -1
  802. package/dist/remote-host-ops.js +15 -1
  803. package/dist/remote-host-ops.js.map +1 -1
  804. package/package.json +3 -3
  805. package/scripts/check-abi.mjs +15 -0
  806. package/tui/dist/attention/attention-model.d.ts.map +1 -1
  807. package/tui/dist/attention/attention-model.js +8 -4
  808. package/tui/dist/attention/attention-model.js.map +1 -1
  809. package/tui/dist/crash-cart/start-daemon.d.ts +20 -0
  810. package/tui/dist/crash-cart/start-daemon.d.ts.map +1 -1
  811. package/tui/dist/crash-cart/start-daemon.js +56 -0
  812. package/tui/dist/crash-cart/start-daemon.js.map +1 -1
  813. package/tui/dist/hydrate.d.ts.map +1 -1
  814. package/tui/dist/hydrate.js +4 -2
  815. package/tui/dist/hydrate.js.map +1 -1
  816. package/tui/dist/main.js +24 -8
  817. package/tui/dist/main.js.map +1 -1
  818. package/tui/dist/render.d.ts +2 -0
  819. package/tui/dist/render.d.ts.map +1 -1
  820. package/tui/dist/render.js +41 -9
  821. package/tui/dist/render.js.map +1 -1
@@ -0,0 +1,79 @@
1
+ import type Database from "better-sqlite3";
2
+ import { type ParsedQueueTransfer } from "./queue-transfer-parse.js";
3
+ import { type TransferRefusal, type TransferWarning } from "./queue-transfer-review.js";
4
+ type StoredManifest = {
5
+ readonly importId: string;
6
+ readonly originHostId: string;
7
+ readonly originMintedAt: string;
8
+ readonly digest: string;
9
+ readonly rowCount: number;
10
+ readonly selectionJson: string;
11
+ readonly status: "staged" | "activated" | "discarded" | "rejected";
12
+ readonly stagedAt: string;
13
+ readonly updatedAt: string;
14
+ };
15
+ declare function manifest({ selectionJson, originHostId, originMintedAt, ...row }: StoredManifest): {
16
+ origin: {
17
+ hostId: string;
18
+ mintedAt: string;
19
+ };
20
+ selection: unknown;
21
+ importId: string;
22
+ digest: string;
23
+ rowCount: number;
24
+ status: "staged" | "activated" | "discarded" | "rejected";
25
+ stagedAt: string;
26
+ updatedAt: string;
27
+ };
28
+ type Report = {
29
+ readonly status: "not_ready_for_activation" | "rejected";
30
+ readonly dryRun: boolean;
31
+ readonly replayed: boolean;
32
+ readonly stage: ReturnType<typeof manifest> | null;
33
+ readonly archive: Pick<ParsedQueueTransfer, "origin" | "selection" | "digest" | "transferId"> | null;
34
+ readonly counts: {
35
+ readonly open: number;
36
+ readonly terminal: number;
37
+ readonly erased: number;
38
+ } | null;
39
+ readonly warnings: readonly TransferWarning[];
40
+ readonly refusals: readonly TransferRefusal[];
41
+ readonly wouldBecomeRunnable: readonly string[];
42
+ };
43
+ export declare class QueueTransferStaging {
44
+ private readonly db;
45
+ private readonly evidenceExists;
46
+ constructor(db: Database.Database, evidenceExists?: (ref: string) => boolean | undefined);
47
+ list(): {
48
+ origin: {
49
+ hostId: string;
50
+ mintedAt: string;
51
+ };
52
+ selection: unknown;
53
+ importId: string;
54
+ digest: string;
55
+ rowCount: number;
56
+ status: "staged" | "activated" | "discarded" | "rejected";
57
+ stagedAt: string;
58
+ updatedAt: string;
59
+ }[];
60
+ discard(importId: string): {
61
+ origin: {
62
+ hostId: string;
63
+ mintedAt: string;
64
+ };
65
+ selection: unknown;
66
+ importId: string;
67
+ digest: string;
68
+ rowCount: number;
69
+ status: "staged" | "activated" | "discarded" | "rejected";
70
+ stagedAt: string;
71
+ updatedAt: string;
72
+ } | null;
73
+ import(text: string, { dryRun, maxBytes }?: {
74
+ readonly dryRun?: boolean;
75
+ readonly maxBytes?: number;
76
+ }): Report;
77
+ }
78
+ export {};
79
+ //# sourceMappingURL=queue-transfer-staging.d.ts.map
@@ -0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
+ import { randomUUID } from "node:crypto";
2
+ import { QueueTransferError } from "./queue-transfer-format.js";
3
+ import { parseQueueTransfer, QueueTransferParseError } from "./queue-transfer-parse.js";
4
+ import { reviewQueueTransfer } from "./queue-transfer-review.js";
5
+ const columns = `import_id AS importId, origin_host_id AS originHostId, origin_minted_at AS originMintedAt,
6
+ digest, row_count AS rowCount, selection_json AS selectionJson, status, staged_at AS stagedAt, updated_at AS updatedAt`;
7
+ function manifest({ selectionJson, originHostId, originMintedAt, ...row }) {
8
+ const selection = JSON.parse(selectionJson);
9
+ return { ...row, origin: { hostId: originHostId, mintedAt: originMintedAt }, selection };
10
+ }
11
+ export class QueueTransferStaging {
12
+ db;
13
+ evidenceExists;
14
+ constructor(db, evidenceExists = () => undefined) {
15
+ this.db = db;
16
+ this.evidenceExists = evidenceExists;
17
+ }
18
+ list() {
19
+ return this.db.prepare(`SELECT ${columns} FROM queue_transfer_staging ORDER BY staged_at, import_id`).all().map(manifest);
20
+ }
21
+ discard(importId) {
22
+ const record = this.db.prepare(`UPDATE queue_transfer_staging
23
+ SET envelope = NULL, status = 'discarded', updated_at = ? WHERE import_id = ? AND status = 'staged'
24
+ RETURNING ${columns}`).get(new Date().toISOString(), importId);
25
+ return record ? manifest(record) : null;
26
+ }
27
+ import(text, { dryRun = false, maxBytes } = {}) {
28
+ let parsed;
29
+ try {
30
+ parsed = parseQueueTransfer(text, maxBytes);
31
+ }
32
+ catch (error) {
33
+ if (!(error instanceof QueueTransferParseError) && !(error instanceof QueueTransferError && error.code === "archive_too_large"))
34
+ throw error;
35
+ const code = error instanceof QueueTransferParseError ? error.code : "archive_too_large";
36
+ return { status: "rejected", dryRun, replayed: false, stage: null, archive: null, counts: null,
37
+ wouldBecomeRunnable: [], warnings: [], refusals: [{ code, message: error.message }] };
38
+ }
39
+ const { rows, erasedIds: _erasedIds, ...archive } = parsed;
40
+ const evidence = new Map(rows.flatMap(row => row.evidenceRef ? [[row.qitemId, this.evidenceExists(row.evidenceRef)]] : []));
41
+ const envelope = dryRun ? null : Buffer.from(text);
42
+ const operation = this.db.transaction(() => {
43
+ const content = { hostId: archive.origin.hostId, mintedAt: archive.origin.mintedAt, digest: archive.digest };
44
+ const existing = this.db.prepare(`SELECT ${columns} FROM queue_transfer_staging
45
+ WHERE origin_host_id = @hostId AND origin_minted_at = @mintedAt AND digest = @digest`).get(content);
46
+ const { counts, warnings, refusals, projectedRunnable } = reviewQueueTransfer(this.db, parsed, evidence);
47
+ if (existing?.status === "activated")
48
+ refusals.push({ code: "already_activated" });
49
+ const summary = { archive, dryRun, counts, warnings, refusals, wouldBecomeRunnable: refusals.length ? [] : projectedRunnable };
50
+ if (refusals.length)
51
+ return { ...summary, status: "rejected", replayed: !!existing, stage: existing ? manifest(existing) : null };
52
+ if (existing || envelope === null)
53
+ return { ...summary, status: "not_ready_for_activation", replayed: !!existing,
54
+ stage: existing ? manifest(existing) : null };
55
+ const record = { ...content, importId: `import-${randomUUID()}`, rowCount: rows.length,
56
+ selectionJson: JSON.stringify(archive.selection), stagedAt: new Date().toISOString(), envelope };
57
+ this.db.prepare(`INSERT INTO queue_transfer_staging (import_id, origin_host_id, origin_minted_at, digest,
58
+ envelope, selection_json, row_count, status, staged_at, updated_at)
59
+ VALUES (@importId, @hostId, @mintedAt, @digest, @envelope, @selectionJson, @rowCount, 'staged', @stagedAt, @stagedAt)`).run(record);
60
+ return { ...summary, status: "not_ready_for_activation", replayed: false, stage: { importId: record.importId,
61
+ origin: archive.origin, digest: archive.digest, rowCount: record.rowCount, selection: archive.selection,
62
+ status: "staged", stagedAt: record.stagedAt, updatedAt: record.stagedAt } };
63
+ });
64
+ return dryRun ? operation() : operation.immediate();
65
+ }
66
+ }
67
+ //# sourceMappingURL=queue-transfer-staging.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"queue-transfer-staging.js","sourceRoot":"","sources":["../../src/domain/queue-transfer-staging.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CA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CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;YAChD,MAAM,MAAM,GAAG,EAAE,GAAG,OAAO,EAAE,QAAQ,EAAE,UAAU,UAAU,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,CAAC,MAAM;gBACpF,aAAa,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,QAAQ,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,EAAE,QAAQ,EAAE,CAAC;YACnG,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC;;8HAEwG,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;YACtI,OAAO,EAAE,GAAG,OAAO,EAAE,MAAM,EAAE,0BAA0B,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ;oBAC1G,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,SAAS,EAAE,OAAO,CAAC,SAAS;oBACvG,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,SAAS,EAAE,MAAM,CAAC,QAAQ,EAAE,EAAE,CAAC;QAChF,CAAC,CAAC,CAAC;QACH,OAAO,MAAM,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,SAAS,EAAE,CAAC;IACtD,CAAC;CACF"}
@@ -37,6 +37,8 @@ export declare const WAKE_ESCALATION_TAG = "wake-escalation";
37
37
  export declare function escalationDedupTag(destination: string): string;
38
38
  export declare const LADDER_SUSPEND_PREFIX = "ladder-suspend:";
39
39
  export declare const LADDER_RESUME_PREFIX = "ladder-resume:";
40
+ /** #48: the one notice a held row's sender gets per held episode, beside its owner's escalation. */
41
+ export declare const LADDER_SENDER_NOTICE_PREFIX = "held-sender-notice:";
40
42
  export interface WakeLadderStatusSnapshot {
41
43
  lastTickAt: string | null;
42
44
  lastOutcome: "clean" | "actions" | "failed" | null;
@@ -164,6 +166,8 @@ export declare function makePermissionPromptReader(deps: {
164
166
  getPromptStart?: (destination: string, generation: string) => string | null | undefined;
165
167
  /** The oracle's pane check of a Codex seat's permission requests, read as the refusal path reads it. */
166
168
  getCodexPermissionState?: CodexPermissionStateRead;
169
+ /** The oracle's arbitrated seat state, which answers a Codex request it doesn't track, as on the refusal path. */
170
+ getSeatState?: (nodeId: string) => Pick<ArbitratedSeatState, "activity" | "needsInput" | "needsInputEvidence"> | null | undefined;
167
171
  log?: (line: string) => void;
168
172
  }): (destination?: string) => PermissionPromptObservation[];
169
173
  /** Marks the row that asks a person to resolve a seat stuck at a permission or approval prompt. */
@@ -1 +1 @@
1
- {"version":3,"file":"queue-wake-ladder.d.ts","sourceRoot":"","sources":["../../src/domain/queue-wake-ladder.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAMlE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAGpF,OAAO,EACgE,KAAK,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAElH,OAAO,EAA4B,KAAK,WAAW,EAAE,MAAM,oBAAoB,CAAC;AA4ChF,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAC3C,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAOvE,OAAO,EAAoD,KAAK,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAchH,eAAO,MAAM,uBAAuB,sCAAsC,CAAC;AAC3E,eAAO,MAAM,mCAAmC,MAAM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1
  import { resolveEscalationOwner, ESCALATION_HOP_TAG, hasConsumedEscalationHop } from "./escalation-owner.js";
2
2
  import { tmuxAttachCommand } from "../adapters/tmux-server.js";
3
3
  import { seatRuntimeHomeBySession } from "./seat-runtime-home.js";
4
- import { OPENRIG_SENDER } from "../lib/pane-envelope.js";
4
+ import { isOpenRigSender, OPENRIG_SENDER } from "../lib/pane-envelope.js";
5
5
  import { renderQueueHandoffNudge } from "./queue-nudge-text.js";
6
6
  import { quietHoldCustody } from "./quiet-hold-custody.js";
7
7
  import { latestHookState, latestHookMovedOn, latestHookPermissionPending, latestHookWaitsOnPerson } from "./agent-activity-store.js";
8
+ import { PERMISSION_REQUEST_GRACE_MS } from "./seat-activity-service.js";
8
9
  import { openPromptRefusals, CLOSE_PREFIX, PARKED_OWNER_POLICY_NAME, REFUSED_PREFIX } from "./policies/parked-owner-consumer.js";
9
10
  import { findQueueRecovery, recoveryTag } from "./queue-recovery.js";
10
11
  import { PROMPT_ROUTED_WORK_PREFIX, RELAY_CLAIMED_PREFIX, RELAY_FOR_PREFIX, RELAY_KEY_PREFIX, RETURN_ROUTE_NOTE_PREFIX, isEpisodeRelay, promptKindFromReason, resolveEscalationReturnRoute, routeOnThisHost } from "./return-route.js";
11
12
  import { isTypedGateBlocker } from "./queue-blocker.js";
12
13
  import { lastMeaningfulTransition } from "./queue-waiting.js";
14
+ import { HELD_SENDER_NOTICE_PREFIX } from "./outbox-handler.js";
13
15
  import { readWakeOutcome } from "./connection-contract.js";
14
16
  import { runSyncSite } from "./sync-site-wrap.js";
15
17
  import { deriveUsageLimitPools } from "./provider/provider-signals.js";
@@ -18,7 +20,7 @@ import { SettingsStore } from "./user-settings/settings-store.js";
18
20
  import { resolveDefaultReceiver } from "./default-receiver.js";
19
21
  import { loadHumanRegistry, resolveRegisteredHumanAddress } from "./gateway/human-registry.js";
20
22
  import { parseSessionName } from "./session-name.js";
21
- import { LADDER_ATTEMPT_PREFIX, LADDER_RUNG_PREFIX, LADDER_EXHAUSTED_PREFIX, resolveOperatorSeat, resolveSessionNodeId, } from "./queue-stuck-sweep.js";
23
+ import { LADDER_ATTEMPT_PREFIX, LADDER_RUNG_PREFIX, LADDER_EXHAUSTED_PREFIX, STUCK_SWEEP_FINDING_TAG, resolveOperatorSeat, resolveSessionNodeId, resolveStuckSweepIntervalSeconds, } from "./queue-stuck-sweep.js";
22
24
  import { RELAY_OWNER_NOTIFICATION_ACCEPTED_PREFIX, RELAY_OWNER_NOTIFICATION_TRANSPORT_FAILED_PREFIX, } from "./queue-transition-log.js";
23
25
  export const WAKE_RETRY_INTERVAL_KEY = "queue.wake_retry_interval_seconds";
24
26
  export const DEFAULT_WAKE_RETRY_INTERVAL_SECONDS = 300;
@@ -56,6 +58,8 @@ export function escalationDedupTag(destination) {
56
58
  // Suspension markers (attempt/rung/exhausted come from the S02 seam vocabulary).
57
59
  export const LADDER_SUSPEND_PREFIX = "ladder-suspend:";
58
60
  export const LADDER_RESUME_PREFIX = "ladder-resume:";
61
+ /** #48: the one notice a held row's sender gets per held episode, beside its owner's escalation. */
62
+ export const LADDER_SENDER_NOTICE_PREFIX = "held-sender-notice:";
59
63
  const LADDER_ACTOR = "wake-ladder@system";
60
64
  const UNACCEPTED_CARRIER_REROUTE = "unaccepted wake escalation uses a local carrier; human dispatch still requires readiness";
61
65
  /** The loop's observable heartbeat — rides /healthz beside the S02 sweep's. */
@@ -128,6 +132,7 @@ function readLadder(db, qitemId, after = lastMeaningfulTransition(db, qitemId)?.
128
132
  exhaustedNote: null,
129
133
  suspendEpisodeOpen: false,
130
134
  firstMarkerTs: null,
135
+ senderNoticed: false,
131
136
  };
132
137
  let suspends = 0;
133
138
  let resumes = 0;
@@ -187,6 +192,8 @@ function readLadder(db, qitemId, after = lastMeaningfulTransition(db, qitemId)?.
187
192
  suspends += 1;
188
193
  if (note.startsWith(LADDER_RESUME_PREFIX))
189
194
  resumes += 1;
195
+ if (note.startsWith(LADDER_SENDER_NOTICE_PREFIX))
196
+ view.senderNoticed = true;
190
197
  if (isAttempt || isRung) {
191
198
  const t = Date.parse(r.ts);
192
199
  if (!Number.isNaN(t)) {
@@ -221,6 +228,7 @@ function hasPickupEvidence(db, row) {
221
228
  note.startsWith(LADDER_EXHAUSTED_PREFIX) ||
222
229
  note.startsWith(LADDER_SUSPEND_PREFIX) ||
223
230
  note.startsWith(LADDER_RESUME_PREFIX) ||
231
+ note.startsWith(LADDER_SENDER_NOTICE_PREFIX) ||
224
232
  // OPR.0.5.6.1: delivery-leg records are ladder machinery, not pickup —
225
233
  // a receipt/termination/deferral stamp must not pull the row out of the
226
234
  // ladder before the resolution pass reads it.
@@ -285,17 +293,25 @@ function classifyWakeResult(lastNudgeResult) {
285
293
  * ladder's claimed-row retry query selects `failed:%` only, so a claimed row whose
286
294
  * last result is `retained:` would be owned without ever being retried — the
287
295
  * parked-owner watchdog would then skip it. Keep the retained class scoped to the
288
- * unclaimed baton path the PR is about; every other state keeps the pre-change
296
+ * unclaimed baton path the PR is about, and to a held created row (#48); every other state keeps the pre-change
289
297
  * `null` classification. */
290
298
  function unclaimedWakeMode(row) {
291
299
  const mode = classifyWakeResult(row.lastNudgeResult);
292
300
  if (mode === null)
293
301
  return null;
294
302
  const retained = readWakeOutcome(row.lastNudgeResult)?.fact === "held";
295
- if (retained && !(row.state === "pending" && !row.claimedAt && row.handedOffFrom))
303
+ if (retained && !(row.state === "pending" && !row.claimedAt && (row.handedOffFrom || heldCreatedRow(row))))
296
304
  return null;
297
305
  return mode;
298
306
  }
307
+ /** #48: a created row (no handoff) whose wake the seat's guard held. The stuck sweep leaves a hold-mode row alone, so
308
+ * the ladder gives it the one held escalation batons get, and a draft-aware one once its idle retries reach the cap.
309
+ * Rows OpenRig raised itself (escalations, sweep findings, reminders) keep their own paths. */
310
+ function heldCreatedRow(row) {
311
+ return row.state === "pending" && !row.claimedAt && !row.handedOffFrom && readWakeOutcome(row.lastNudgeResult)?.fact === "held"
312
+ && !isOpenRigSender(row.sourceSession) && !row.sourceSession.endsWith("@system")
313
+ && !(row.tags ?? []).some(tag => tag === WAKE_ESCALATION_TAG || tag === PROMPT_ALERT_TAG || tag === STUCK_SWEEP_FINDING_TAG);
314
+ }
299
315
  /** A producer-retired prompt alert no longer owns wake continuation. Keep this
300
316
  * exception identical for the consumer, executing ladder and waiting readback;
301
317
  * other terminal dispositions (including manual closure) retain ownership. */
@@ -316,8 +332,19 @@ function findWakeRecovery(db, qitemId) {
316
332
  export function queueRecoveryOwnsWake(db, row) {
317
333
  if (!row || !["pending", "in-progress", "blocked"].includes(row.state))
318
334
  return false;
319
- if (findWakeRecovery(db, row.qitemId))
320
- return true;
335
+ const recovery = findWakeRecovery(db, row.qitemId);
336
+ if (recovery) {
337
+ if (["pending", "in-progress", "blocked"].includes(recovery.state))
338
+ return true;
339
+ // The ladder keeps a lead's closed disposition. Only the consumer's duplicate-wake
340
+ // suppression expires, so an idle owner can receive its ordinary reminder again.
341
+ const closed = db.prepare(`SELECT ts FROM queue_transitions WHERE qitem_id = ?
342
+ AND state NOT IN ('pending', 'in-progress', 'blocked') AND closure_reason IS NOT NULL
343
+ ORDER BY transition_id DESC LIMIT 1`).get(recovery.qitemId);
344
+ const ageMs = Date.now() - Date.parse(closed?.ts ?? "");
345
+ // Missing, invalid or future closure times cannot justify suppressing a wake.
346
+ return ageMs >= 0 && ageMs < resolveStuckSweepIntervalSeconds() * 1000;
347
+ }
321
348
  const mode = unclaimedWakeMode(row);
322
349
  if (!mode)
323
350
  return false;
@@ -390,7 +417,9 @@ export function readWakeLadderBackstop(db, qitemId, acceptsDestination) {
390
417
  return recoveryBackstop();
391
418
  if (recovery && disposition && JSON.parse(disposition.tags ?? "[]").includes(PROMPT_ALERT_TAG))
392
419
  return recoveryBackstop();
393
- const mode = unclaimedWakeMode(row);
420
+ // A held created row (#48) isn't eligible here: until the ladder's one notice it reads as held, and after it the
421
+ // recovery row it raised is its next step.
422
+ const mode = unclaimedWakeMode({ ...row, tags: JSON.parse(row.tagsJson ?? "[]") });
394
423
  const eligible = (row.state === "pending" && !row.claimedAt && row.handedOffFrom)
395
424
  || (row.state === "in-progress" && row.claimedAt && mode === "failed" && db.prepare("SELECT 1 FROM queue_transitions WHERE qitem_id = ? AND transition_note LIKE 'parked-owner wake delivery failed:%' LIMIT 1").get(qitemId));
396
425
  if (!eligible || !mode || ((mode === "unconfirmed" || mode === "held") && hasPickupEvidence(db, row)))
@@ -452,6 +481,86 @@ function appendMarker(repo, row, note, admittedOutcome = false) {
452
481
  closureTarget: row.state === "in-progress" ? repo.retainedClaimBlocker(row.qitemId) : undefined,
453
482
  });
454
483
  }
484
+ /** #48: a held row's sender is told once per held episode, beside the recovery row to its owner, that the row is held
485
+ * and not lost. Nothing is typed into the held seat. A sender that is OpenRig, a person (or one the human registry can't
486
+ * classify) or the destination itself is skipped. The notice is recorded in the outbox here, before the owner's rung is
487
+ * marked, and sent after it (sendHeldSenderNotice): a restart in between, or a send that definitely wrote nothing,
488
+ * leaves it owed for the next tick's owed-notice pass, never lost and never marked told. */
489
+ function stageHeldSenderNotice(deps, m, owner, now) {
490
+ const { row } = m, dest = row.destinationSession, sender = row.sourceSession;
491
+ const held = readWakeOutcome(row.lastNudgeResult);
492
+ if (m.view.senderNoticed || held?.fact !== "held" || !sender || sender === dest || isOpenRigSender(sender)
493
+ || /@(system|external)$/.test(sender))
494
+ return null;
495
+ try {
496
+ if (deps.queueRepo.isHumanDestination(sender))
497
+ return null;
498
+ }
499
+ catch {
500
+ return null;
501
+ }
502
+ const body = held.heldBy === "typing-guard"
503
+ ? `Your queue row ${row.qitemId} to ${dest} is held, not lost: ${dest}'s typing guard holds its wakes, so nothing was typed there. It's readable with rig seat held-messages ${dest}, and a recovery row went to ${owner}.`
504
+ : `Your queue row ${row.qitemId} to ${dest} is still held after ${minutesSince(row.tsCreated, now)} min (${m.view.attempts} retries): ${dest}'s draft-aware guard stopped each try before typing anything (a draft, a prompt, a seat that wasn't ready, or input it couldn't read or reach). The row stays pending, not lost, and a recovery row went to ${owner}.`;
505
+ const episode = lastMeaningfulTransition(deps.db, row.qitemId)?.id ?? 0;
506
+ return { sender, body, outboxId: deps.queueRepo.stageHeldSenderNotice(row.qitemId, episode, sender, body) };
507
+ }
508
+ /** #48: send a staged notice and record its actual outcome on the row. With no outbox it's sent at once, as before. */
509
+ async function sendHeldSenderNotice(deps, row, notice) {
510
+ if (!notice)
511
+ return;
512
+ const outcome = notice.outboxId ? await deps.queueRepo.deliverHeldSenderNotice(notice.outboxId)
513
+ : await deps.queueRepo.noticeHeldSender(notice.sender, notice.body);
514
+ // A recorded notice that wasn't sent now (no transport yet, or already settled) gets no marker: it's owed or done.
515
+ if (notice.outboxId && outcome.startsWith("skipped:"))
516
+ return;
517
+ appendMarker(deps.queueRepo, row, `${LADDER_SENDER_NOTICE_PREFIX} ${notice.sender} outcome=${outcome}`, true);
518
+ }
519
+ /** #48: sender notices recorded but not sent (a restart came between the owner's rung and the send) or definitely not
520
+ * written, while their row is still pending and held in the same episode. A failed one goes again after the retry
521
+ * interval, up to the retry cap; delivered, uncertain or held ones are never sent again, and one whose sender's rig is
522
+ * draining waits. A notice whose row moved on is retired with why. */
523
+ async function deliverOwedSenderNotices(deps, now, intervalS, cap) {
524
+ for (const owed of nextOwedNoticePage(deps)) {
525
+ const row = owed.qitemId ? deps.queueRepo.getById(owed.qitemId) : null;
526
+ const episode = row ? lastMeaningfulTransition(deps.db, row.qitemId)?.id ?? 0 : 0;
527
+ if (!row || row.state !== "pending" || readWakeOutcome(row.lastNudgeResult)?.fact !== "held"
528
+ || owed.outboxId !== `${HELD_SENDER_NOTICE_PREFIX}${row.qitemId}-${episode}`) {
529
+ if (deps.queueRepo.retireHeldSenderNotice(owed.outboxId, LADDER_ACTOR, "its row is no longer held in that episode") && row) {
530
+ appendMarker(deps.queueRepo, row, `${LADDER_SENDER_NOTICE_PREFIX} ${owed.sender} outcome=retired:no longer held`, true);
531
+ }
532
+ continue;
533
+ }
534
+ if (deps.queueRepo.deliveryDrains.holds(owed.sender))
535
+ continue;
536
+ if (owed.state === "failed") {
537
+ const prefix = `${LADDER_SENDER_NOTICE_PREFIX} ${owed.sender} outcome=`;
538
+ const tried = deps.db.prepare(`SELECT COUNT(*) AS n, MAX(ts) AS last FROM queue_transitions WHERE qitem_id = ? AND transition_id > ?
539
+ AND substr(transition_note, 1, ?) = ?`).get(row.qitemId, episode, prefix.length, prefix);
540
+ if (tried.n >= cap || (tried.last !== null && now.getTime() - Date.parse(tried.last) < intervalS * 1000))
541
+ continue;
542
+ }
543
+ const outcome = await deps.queueRepo.deliverHeldSenderNotice(owed.outboxId);
544
+ if (!outcome.startsWith("skipped:"))
545
+ appendMarker(deps.queueRepo, row, `${LADDER_SENDER_NOTICE_PREFIX} ${owed.sender} outcome=${outcome}`, true);
546
+ }
547
+ }
548
+ /** #48: the owed-notice pass looks at one bounded page per tick, starting where the last tick's page ended and going back
549
+ * to the oldest after a short page. Notices that can't go now (capped, a draining sender) keep their place and their
550
+ * evidence, and the notices after them are still reached. */
551
+ const OWED_NOTICE_PAGE = 50;
552
+ const owedNoticeCursors = new WeakMap();
553
+ function nextOwedNoticePage(deps) {
554
+ const after = owedNoticeCursors.get(deps.db);
555
+ let page = deps.queueRepo.listOwedHeldSenderNotices(OWED_NOTICE_PAGE, after);
556
+ if (after && page.length === 0)
557
+ page = deps.queueRepo.listOwedHeldSenderNotices(OWED_NOTICE_PAGE);
558
+ if (page.length < OWED_NOTICE_PAGE)
559
+ owedNoticeCursors.delete(deps.db);
560
+ else
561
+ owedNoticeCursors.set(deps.db, page[page.length - 1].cursor);
562
+ return page;
563
+ }
455
564
  function minutesSince(ts, now) {
456
565
  if (ts === null || ts === undefined)
457
566
  return 0;
@@ -559,6 +668,12 @@ export async function runWakeLadderTick(deps) {
559
668
  catch (err) {
560
669
  log(`[wake-ladder] prompt refusal pass failed; continuing existing ladder: ${err instanceof Error ? err.message : String(err)}`);
561
670
  }
671
+ try {
672
+ await deliverOwedSenderNotices(deps, now, intervalS, cap);
673
+ }
674
+ catch (err) {
675
+ log(`[wake-ladder] held sender notice pass failed; continuing existing ladder: ${err instanceof Error ? err.message : String(err)}`);
676
+ }
562
677
  let exhaustedThisTick = 0;
563
678
  const usagePoolBySeat = new Map();
564
679
  if (deps.getProviderReadModel) {
@@ -582,10 +697,11 @@ export async function runWakeLadderTick(deps) {
582
697
  }
583
698
  const blockerByPool = new Map();
584
699
  // Batons: handed-off rows still pending and unclaimed. Created-with-destination rows
585
- // are explicitly NOT here — that hole is S02's net (F5).
700
+ // are explicitly NOT here — that hole is S02's net (F5) — except one whose wake the seat's guard held (#48;
701
+ // heldCreatedRow decides which).
586
702
  const batonRows = deps.db
587
703
  .prepare(`SELECT qitem_id FROM queue_items
588
- WHERE state = 'pending' AND claimed_at IS NULL AND handed_off_from IS NOT NULL`)
704
+ WHERE state = 'pending' AND claimed_at IS NULL AND (handed_off_from IS NOT NULL OR last_nudge_result LIKE 'retained:%')`)
589
705
  .all();
590
706
  // OPR.0.5.6.24 B2 (advisor-ruled one-engine arm): claimed in-progress rows
591
707
  // that a parked-owner consumer wake FAILED into join the SAME ladder flow.
@@ -625,6 +741,12 @@ export async function runWakeLadderTick(deps) {
625
741
  const row = deps.queueRepo.getById(qitem_id);
626
742
  if (!row || deliveryHeld(deps.queueRepo, row) || recoversEscalationNotice(deps, row))
627
743
  continue;
744
+ // #48: a created row is here only for its held escalation, so anything else, and correspondence or a decision for a
745
+ // person (as in the stuck sweep), keeps its own path before any park or wake.
746
+ const createdHeld = heldCreatedRow(row);
747
+ if (row.state === "pending" && !row.handedOffFrom && (!createdHeld
748
+ || deps.queueRepo.isRegisteredHumanUpdate(row) || deps.queueRepo.isLocalHumanDecisionWithoutGateway(row)))
749
+ continue;
628
750
  const usagePool = usagePoolBySeat.get(row.destinationSession);
629
751
  // OPR.0.5.6.24: the usage-limit PARK mutation applies only to pending
630
752
  // batons — a claimed in-progress row is someone's live work and is never
@@ -656,6 +778,11 @@ export async function runWakeLadderTick(deps) {
656
778
  const view = readLadder(deps.db, row.qitemId);
657
779
  if (view.exhausted)
658
780
  continue; // finite: an exhausted ladder never re-fires
781
+ // #48: a created row's draft-aware hold is retried on its seat's idle report (retryDraftHeldWakesOnIdle), never on
782
+ // this timer. The ladder takes it once those tries reach the cap, or once the unconfirmed window passes, since a
783
+ // draft left in the box gives no idle report.
784
+ if (createdHeld && mode === "failed" && view.attempts < cap && minutesSince(row.tsCreated, now) < windowMin)
785
+ continue;
659
786
  // F1 gates for the unconfirmed class: never re-nudge; enter only past the window
660
787
  // with zero pickup evidence.
661
788
  if (mode === "unconfirmed" || mode === "held") {
@@ -688,8 +815,9 @@ export async function runWakeLadderTick(deps) {
688
815
  if (recoveryRow?.tags?.includes(PROMPT_ALERT_TAG)
689
816
  && ["pending", "in-progress", "blocked"].includes(recoveryRow.state))
690
817
  continue;
691
- // Retry rung — failed outcomes only, under the cap, inside the destination budget.
692
- if (mode === "failed" && view.attempts < cap) {
818
+ // Retry rung — failed outcomes only, under the cap, inside the destination budget. A held created row's retries
819
+ // are its idle report's (#48).
820
+ if (mode === "failed" && view.attempts < cap && !createdHeld) {
693
821
  if (!due)
694
822
  continue;
695
823
  // F2 — derived suspension, checked only when the ladder would otherwise act.
@@ -720,13 +848,15 @@ export async function runWakeLadderTick(deps) {
720
848
  }
721
849
  // Escalation phase (past the cap, or the F1 direct path). Grouped per destination
722
850
  // regardless of due-ness so the aggregate refresh rides every detection pass.
723
- const reason = mode === "failed"
724
- ? `wake failed ${view.attempts} times over ${minutesSince(view.firstMarkerTs ?? row.tsCreated, now)} min`
725
- : mode === "held"
726
- ? `held by ${row.destinationSession}'s typing guard for ${minutesSince(row.tsCreated, now)} min: nothing was typed, and it isn't retried`
727
- : readWakeOutcome(row.lastNudgeResult)?.route === null
728
- ? `wake outcome unknown (unrecognised result "${row.lastNudgeResult.slice(0, 80)}") with no pickup evidence over ${minutesSince(row.tsCreated, now)} min`
729
- : `unconfirmed delivery with no pickup evidence over ${minutesSince(row.tsCreated, now)} min`;
851
+ const reason = createdHeld && mode === "failed"
852
+ ? `held by ${row.destinationSession}'s draft-aware guard for ${minutesSince(row.tsCreated, now)} min (${view.attempts} retries): each try stopped before typing anything (a draft, a prompt, a seat that wasn't ready, or input it couldn't read or reach)`
853
+ : mode === "failed"
854
+ ? `wake failed ${view.attempts} times over ${minutesSince(view.firstMarkerTs ?? row.tsCreated, now)} min`
855
+ : mode === "held"
856
+ ? `held by ${row.destinationSession}'s typing guard for ${minutesSince(row.tsCreated, now)} min: nothing was typed, and it isn't retried; read it with rig seat held-messages ${row.destinationSession}`
857
+ : readWakeOutcome(row.lastNudgeResult)?.route === null
858
+ ? `wake outcome unknown (unrecognised result "${row.lastNudgeResult.slice(0, 80)}") with no pickup evidence over ${minutesSince(row.tsCreated, now)} min`
859
+ : `unconfirmed delivery with no pickup evidence over ${minutesSince(row.tsCreated, now)} min`;
730
860
  if (hasConsumedEscalationHop(deps.db, row.qitemId)) {
731
861
  if (!due || suspended)
732
862
  continue;
@@ -793,7 +923,9 @@ export async function runWakeLadderTick(deps) {
793
923
  if (members.some(m => deliveryHeld(deps.queueRepo, m.row)) || carrierDeferred())
794
924
  continue;
795
925
  for (const m of needsOrchRung) {
926
+ const notice = stageHeldSenderNotice(deps, m, floorDest, now);
796
927
  appendMarker(deps.queueRepo, m.row, `${LADDER_RUNG_PREFIX} orchestrator self-skip (resolves to ${orch === null ? "no orchestrator" : "destination"}) reason=${m.reason}`);
928
+ await sendHeldSenderNotice(deps, m.row, notice);
797
929
  if (await operatorRung(deps, m.row, m.reason, actions, m.view, true, carrierDeferred)) {
798
930
  appendExhausted(deps.queueRepo, m.row, "operator rung resolved");
799
931
  exhaustedThisTick += 1;
@@ -810,8 +942,10 @@ export async function runWakeLadderTick(deps) {
810
942
  if (outcome === "deferred:rig_delivery_drain")
811
943
  continue;
812
944
  for (const m of needsOrchRung) {
945
+ const notice = stageHeldSenderNotice(deps, m, recoveryOwner, now);
813
946
  appendMarker(deps.queueRepo, m.row, `${LADDER_RUNG_PREFIX} orchestrator -> ${recoveryOwner} outcome=${outcome} reason=${m.reason}`, true);
814
947
  actions.push({ qitemId: m.row.qitemId, action: "escalate-orchestrator", target: recoveryOwner });
948
+ await sendHeldSenderNotice(deps, m.row, notice);
815
949
  if (!outcome.startsWith("failed:")) {
816
950
  // Delivered (or durable-unconfirmed — the aggregate row itself is now the
817
951
  // orchestrator's durable obligation; S02 nets it if it sits unclaimed).
@@ -940,10 +1074,17 @@ export function makePermissionPromptReader(deps) {
940
1074
  || runtime === "claude-code" && hook?.rawEvent === "PermissionRequest";
941
1075
  const permissionPending = current && latestHookPermissionPending(hook, runtime);
942
1076
  const checked = permissionPending ? deps.getCodexPermissionState?.(nodeId, hook.eventAt) : null;
1077
+ // A request the oracle doesn't track (it was rebuilt after the request): its own pane read, past the request's grace,
1078
+ // answers before the bare hook does. A pane it can't read leaves the hook's "blocked".
1079
+ const raisedMs = Date.parse(hook?.eventAt ?? "");
1080
+ const paneRead = permissionPending && !checked && Number.isFinite(raisedMs)
1081
+ ? classifyPromptAfterRefusal(deps.getSeatState?.(nodeId), new Date(raisedMs + PERMISSION_REQUEST_GRACE_MS).toISOString())
1082
+ : "unknown";
943
1083
  const state = !current ? "unknown"
944
1084
  : checked ? checked
945
- : retainedState === "needs_input" && permission || permissionPending ? "blocked"
946
- : hook?.rawEvent === "PermissionPromptCleared" || retainedState === "running" || retainedState === "idle" ? "clear" : "unknown";
1085
+ : paneRead !== "unknown" ? paneRead
1086
+ : retainedState === "needs_input" && permission || permissionPending ? "blocked"
1087
+ : hook?.rawEvent === "PermissionPromptCleared" || retainedState === "running" || retainedState === "idle" ? "clear" : "unknown";
947
1088
  let prompt;
948
1089
  if (state === "blocked" && hook?.generation) {
949
1090
  try {