@songsid/agend 2.3.5 → 2.4.0-alpha.2

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 (1545) hide show
  1. package/README.md +3 -1
  2. package/README.zh-TW.md +3 -1
  3. package/THIRD_PARTY_NOTICES.md +71 -0
  4. package/dist/accounts-profiles.d.ts +102 -0
  5. package/dist/accounts-profiles.js +194 -0
  6. package/dist/accounts-profiles.js.map +1 -0
  7. package/dist/accounts-signout.d.ts +59 -0
  8. package/dist/accounts-signout.js +181 -0
  9. package/dist/accounts-signout.js.map +1 -0
  10. package/dist/accounts-view.d.ts +189 -0
  11. package/dist/accounts-view.js +204 -0
  12. package/dist/accounts-view.js.map +1 -0
  13. package/dist/agent-endpoint.d.ts +5 -1
  14. package/dist/agent-endpoint.js +12 -2
  15. package/dist/agent-endpoint.js.map +1 -1
  16. package/dist/agent-export.d.ts +74 -0
  17. package/dist/agent-export.js +362 -0
  18. package/dist/agent-export.js.map +1 -0
  19. package/dist/agent-file-read.js +1 -1
  20. package/dist/agent-file-read.js.map +1 -1
  21. package/dist/agent-runtime-api.d.ts +4 -0
  22. package/dist/agent-runtime-api.js +59 -0
  23. package/dist/agent-runtime-api.js.map +1 -0
  24. package/dist/agent-runtime-change.d.ts +76 -0
  25. package/dist/agent-runtime-change.js +114 -0
  26. package/dist/agent-runtime-change.js.map +1 -0
  27. package/dist/agent-whats-new.js +12 -3
  28. package/dist/agent-whats-new.js.map +1 -1
  29. package/dist/agent-workspace.d.ts +103 -0
  30. package/dist/agent-workspace.js +360 -0
  31. package/dist/agent-workspace.js.map +1 -0
  32. package/dist/apply-job.d.ts +5 -0
  33. package/dist/apply-job.js +10 -3
  34. package/dist/apply-job.js.map +1 -1
  35. package/dist/auth-api.d.ts +78 -0
  36. package/dist/auth-api.js +352 -16
  37. package/dist/auth-api.js.map +1 -1
  38. package/dist/authority/company-join.d.ts +16 -0
  39. package/dist/authority/company-join.js +37 -0
  40. package/dist/authority/company-join.js.map +1 -0
  41. package/dist/authority/hub-initialization.d.ts +13 -0
  42. package/dist/authority/hub-initialization.js +30 -0
  43. package/dist/authority/hub-initialization.js.map +1 -0
  44. package/dist/authority/settings-role.d.ts +56 -0
  45. package/dist/authority/settings-role.js +48 -0
  46. package/dist/authority/settings-role.js.map +1 -0
  47. package/dist/authority/web-authority.d.ts +25 -2
  48. package/dist/authority/web-authority.js +37 -4
  49. package/dist/authority/web-authority.js.map +1 -1
  50. package/dist/backend/claude-code.d.ts +19 -16
  51. package/dist/backend/claude-code.js +183 -144
  52. package/dist/backend/claude-code.js.map +1 -1
  53. package/dist/backend/claude-context.d.ts +17 -0
  54. package/dist/backend/claude-context.js +30 -0
  55. package/dist/backend/claude-context.js.map +1 -0
  56. package/dist/backend/codex-footer-hints.d.ts +3 -0
  57. package/dist/backend/codex-footer-hints.js +14 -0
  58. package/dist/backend/codex-footer-hints.js.map +1 -1
  59. package/dist/backend/codex-package.d.ts +5 -2
  60. package/dist/backend/codex-package.js +1 -5
  61. package/dist/backend/codex-package.js.map +1 -1
  62. package/dist/backend/codex-quota-history.js +4 -19
  63. package/dist/backend/codex-quota-history.js.map +1 -1
  64. package/dist/backend/codex.d.ts +149 -129
  65. package/dist/backend/codex.js +1323 -1233
  66. package/dist/backend/codex.js.map +1 -1
  67. package/dist/backend/credential-profile.d.ts +21 -0
  68. package/dist/backend/credential-profile.js +48 -1
  69. package/dist/backend/credential-profile.js.map +1 -1
  70. package/dist/backend/effort-metadata.d.ts +38 -2
  71. package/dist/backend/effort-metadata.js +145 -8
  72. package/dist/backend/effort-metadata.js.map +1 -1
  73. package/dist/backend/grok-mcp.d.ts +5 -0
  74. package/dist/backend/grok-mcp.js +221 -0
  75. package/dist/backend/grok-mcp.js.map +1 -0
  76. package/dist/backend/grok-model-cache.d.ts +7 -0
  77. package/dist/backend/grok-model-cache.js +65 -0
  78. package/dist/backend/grok-model-cache.js.map +1 -0
  79. package/dist/backend/grok.d.ts +7 -10
  80. package/dist/backend/grok.js +44 -88
  81. package/dist/backend/grok.js.map +1 -1
  82. package/dist/backend/kiro.js +1 -1
  83. package/dist/backend/kiro.js.map +1 -1
  84. package/dist/backend/launch-effort.d.ts +1 -1
  85. package/dist/backend/launch-effort.js +7 -3
  86. package/dist/backend/launch-effort.js.map +1 -1
  87. package/dist/backend/native-pane.d.ts +11 -0
  88. package/dist/backend/native-pane.js +59 -0
  89. package/dist/backend/native-pane.js.map +1 -0
  90. package/dist/backend/types.d.ts +26 -1
  91. package/dist/backend/types.js.map +1 -1
  92. package/dist/backend-availability.d.ts +16 -1
  93. package/dist/backend-availability.js +65 -2
  94. package/dist/backend-availability.js.map +1 -1
  95. package/dist/backend-signin-pending.d.ts +8 -2
  96. package/dist/backend-signin-pending.js +6 -2
  97. package/dist/backend-signin-pending.js.map +1 -1
  98. package/dist/browser-backend-signins.d.ts +9 -2
  99. package/dist/browser-backend-signins.js +9 -5
  100. package/dist/browser-backend-signins.js.map +1 -1
  101. package/dist/build-provenance-cli.d.ts +3 -0
  102. package/dist/build-provenance-cli.js +11 -0
  103. package/dist/build-provenance-cli.js.map +1 -0
  104. package/dist/build-provenance.d.ts +20 -0
  105. package/dist/build-provenance.js +67 -0
  106. package/dist/build-provenance.js.map +1 -0
  107. package/dist/build-provenance.json +1 -0
  108. package/dist/bundled-tmux-guard.d.ts +0 -2
  109. package/dist/bundled-tmux-guard.js +10 -23
  110. package/dist/bundled-tmux-guard.js.map +1 -1
  111. package/dist/channel/ipc-bridge.d.ts +2 -0
  112. package/dist/channel/mcp-tools.js +4 -4
  113. package/dist/channel/mcp-tools.js.map +1 -1
  114. package/dist/classic-bindings.d.ts +13 -0
  115. package/dist/classic-bindings.js +28 -2
  116. package/dist/classic-bindings.js.map +1 -1
  117. package/dist/claude-auth-status.d.ts +60 -0
  118. package/dist/claude-auth-status.js +165 -0
  119. package/dist/claude-auth-status.js.map +1 -0
  120. package/dist/cli-audited.d.ts +60 -0
  121. package/dist/cli-audited.js +84 -0
  122. package/dist/cli-audited.js.map +1 -0
  123. package/dist/cli-capability.d.ts +217 -0
  124. package/dist/cli-capability.js +55 -0
  125. package/dist/cli-capability.js.map +1 -0
  126. package/dist/cli-caps-module.d.ts +33 -0
  127. package/dist/cli-caps-module.js +45 -0
  128. package/dist/cli-caps-module.js.map +1 -0
  129. package/dist/cli-registry-check.d.ts +28 -0
  130. package/dist/cli-registry-check.js +237 -0
  131. package/dist/cli-registry-check.js.map +1 -0
  132. package/dist/cli-registry.d.ts +578 -0
  133. package/dist/cli-registry.js +83 -0
  134. package/dist/cli-registry.js.map +1 -0
  135. package/dist/cli-spec-antigravity.d.ts +71 -0
  136. package/dist/cli-spec-antigravity.js +47 -0
  137. package/dist/cli-spec-antigravity.js.map +1 -0
  138. package/dist/cli-spec-claude-code.d.ts +93 -0
  139. package/dist/cli-spec-claude-code.js +37 -0
  140. package/dist/cli-spec-claude-code.js.map +1 -0
  141. package/dist/cli-spec-codex.d.ts +87 -0
  142. package/dist/cli-spec-codex.js +40 -0
  143. package/dist/cli-spec-codex.js.map +1 -0
  144. package/dist/cli-spec-grok.d.ts +64 -0
  145. package/dist/cli-spec-grok.js +40 -0
  146. package/dist/cli-spec-grok.js.map +1 -0
  147. package/dist/cli-spec-kiro-cli.d.ts +79 -0
  148. package/dist/cli-spec-kiro-cli.js +40 -0
  149. package/dist/cli-spec-kiro-cli.js.map +1 -0
  150. package/dist/cli-spec-muse.d.ts +54 -0
  151. package/dist/cli-spec-muse.js +40 -0
  152. package/dist/cli-spec-muse.js.map +1 -0
  153. package/dist/cli-spec-opencode.d.ts +60 -0
  154. package/dist/cli-spec-opencode.js +42 -0
  155. package/dist/cli-spec-opencode.js.map +1 -0
  156. package/dist/cli.js +311 -54
  157. package/dist/cli.js.map +1 -1
  158. package/dist/codex-pane-ownership.d.ts +13 -0
  159. package/dist/codex-pane-ownership.js +192 -0
  160. package/dist/codex-pane-ownership.js.map +1 -0
  161. package/dist/config-validator.js +140 -9
  162. package/dist/config-validator.js.map +1 -1
  163. package/dist/config.js +16 -0
  164. package/dist/config.js.map +1 -1
  165. package/dist/create-host-account.d.ts +17 -0
  166. package/dist/create-host-account.js +47 -0
  167. package/dist/create-host-account.js.map +1 -0
  168. package/dist/daemon.d.ts +104 -7
  169. package/dist/daemon.js +1062 -282
  170. package/dist/daemon.js.map +1 -1
  171. package/dist/delivery-consumed-watch.d.ts +15 -3
  172. package/dist/delivery-consumed-watch.js +23 -1
  173. package/dist/delivery-consumed-watch.js.map +1 -1
  174. package/dist/delivery-outbox.d.ts +9 -0
  175. package/dist/delivery-outbox.js +43 -4
  176. package/dist/delivery-outbox.js.map +1 -1
  177. package/dist/delivery-reconciliation.d.ts +2 -42
  178. package/dist/delivery-reconciliation.js +2 -164
  179. package/dist/delivery-reconciliation.js.map +1 -1
  180. package/dist/dispatcher-liveness.d.ts +172 -0
  181. package/dist/dispatcher-liveness.js +238 -0
  182. package/dist/dispatcher-liveness.js.map +1 -0
  183. package/dist/doctor.js +19 -9
  184. package/dist/doctor.js.map +1 -1
  185. package/dist/e2e-isolation.js +5 -2
  186. package/dist/e2e-isolation.js.map +1 -1
  187. package/dist/fleet-context.d.ts +7 -3
  188. package/dist/fleet-control-audit.d.ts +1 -1
  189. package/dist/fleet-level-config.d.ts +1 -1
  190. package/dist/fleet-level-config.js +2 -0
  191. package/dist/fleet-level-config.js.map +1 -1
  192. package/dist/fleet-manager.d.ts +1112 -33
  193. package/dist/fleet-manager.js +5754 -528
  194. package/dist/fleet-manager.js.map +1 -1
  195. package/dist/fleet-windows-runtime.d.ts +98 -0
  196. package/dist/fleet-windows-runtime.js +467 -0
  197. package/dist/fleet-windows-runtime.js.map +1 -0
  198. package/dist/general-binding.d.ts +85 -0
  199. package/dist/general-binding.js +298 -0
  200. package/dist/general-binding.js.map +1 -0
  201. package/dist/general-host-owner.d.ts +8 -0
  202. package/dist/general-host-owner.js +26 -0
  203. package/dist/general-host-owner.js.map +1 -0
  204. package/dist/general-instance.d.ts +7 -0
  205. package/dist/general-instance.js +20 -3
  206. package/dist/general-instance.js.map +1 -1
  207. package/dist/general-knowledge/skills/concepts/SKILL.md +75 -23
  208. package/dist/general-knowledge/skills/credential-profiles/SKILL.md +42 -9
  209. package/dist/general-knowledge/skills/fleet-config/SKILL.md +1 -1
  210. package/dist/general-knowledge/skills/fleet-health/SKILL.md +2 -2
  211. package/dist/general-knowledge/skills/fleet-restart/SKILL.md +1 -1
  212. package/dist/general-knowledge/skills/instance-lifecycle/SKILL.md +1 -1
  213. package/dist/general-knowledge/skills/session-management/SKILL.md +1 -1
  214. package/dist/general-knowledge/skills/tui-effort/SKILL.md +10 -10
  215. package/dist/general-knowledge/skills/web-dashboard/SKILL.md +48 -26
  216. package/dist/general-knowledge/steering/core-rules.md +2 -2
  217. package/dist/general-role.d.ts +5 -0
  218. package/dist/general-role.js +27 -0
  219. package/dist/general-role.js.map +1 -0
  220. package/dist/hub/admission.d.ts +28 -0
  221. package/dist/hub/admission.js +62 -0
  222. package/dist/hub/admission.js.map +1 -0
  223. package/dist/hub/attachments/limits.d.ts +20 -0
  224. package/dist/hub/attachments/limits.js +48 -0
  225. package/dist/hub/attachments/limits.js.map +1 -0
  226. package/dist/hub/attachments/store.d.ts +116 -0
  227. package/dist/hub/attachments/store.js +246 -0
  228. package/dist/hub/attachments/store.js.map +1 -0
  229. package/dist/hub/audit/index.d.ts +62 -0
  230. package/dist/hub/audit/index.js +351 -0
  231. package/dist/hub/audit/index.js.map +1 -0
  232. package/dist/hub/browser-certificate.d.ts +38 -0
  233. package/dist/hub/browser-certificate.js +247 -0
  234. package/dist/hub/browser-certificate.js.map +1 -0
  235. package/dist/hub/buttons-model.d.ts +9 -0
  236. package/dist/hub/buttons-model.js +42 -0
  237. package/dist/hub/buttons-model.js.map +1 -0
  238. package/dist/hub/buttons.d.ts +54 -0
  239. package/dist/hub/buttons.js +348 -0
  240. package/dist/hub/buttons.js.map +1 -0
  241. package/dist/hub/catalog.d.ts +80 -0
  242. package/dist/hub/catalog.js +390 -0
  243. package/dist/hub/catalog.js.map +1 -0
  244. package/dist/hub/client.d.ts +71 -0
  245. package/dist/hub/client.js +335 -0
  246. package/dist/hub/client.js.map +1 -0
  247. package/dist/hub/compose/member.d.ts +147 -0
  248. package/dist/hub/compose/member.js +476 -0
  249. package/dist/hub/compose/member.js.map +1 -0
  250. package/dist/hub/compose/server.d.ts +170 -0
  251. package/dist/hub/compose/server.js +495 -0
  252. package/dist/hub/compose/server.js.map +1 -0
  253. package/dist/hub/compose/storage.d.ts +5 -0
  254. package/dist/hub/compose/storage.js +28 -0
  255. package/dist/hub/compose/storage.js.map +1 -0
  256. package/dist/hub/compose/views.d.ts +12 -0
  257. package/dist/hub/compose/views.js +4 -0
  258. package/dist/hub/compose/views.js.map +1 -0
  259. package/dist/hub/db.d.ts +58 -0
  260. package/dist/hub/db.js +215 -0
  261. package/dist/hub/db.js.map +1 -0
  262. package/dist/hub/directory/config.d.ts +39 -0
  263. package/dist/hub/directory/config.js +108 -0
  264. package/dist/hub/directory/config.js.map +1 -0
  265. package/dist/hub/directory/directory.d.ts +25 -0
  266. package/dist/hub/directory/directory.js +588 -0
  267. package/dist/hub/directory/directory.js.map +1 -0
  268. package/dist/hub/directory/groups.d.ts +55 -0
  269. package/dist/hub/directory/groups.js +30 -0
  270. package/dist/hub/directory/groups.js.map +1 -0
  271. package/dist/hub/directory/index.d.ts +8 -0
  272. package/dist/hub/directory/index.js +4 -0
  273. package/dist/hub/directory/index.js.map +1 -0
  274. package/dist/hub/directory/profiles.d.ts +41 -0
  275. package/dist/hub/directory/profiles.js +90 -0
  276. package/dist/hub/directory/profiles.js.map +1 -0
  277. package/dist/hub/directory/types.d.ts +84 -0
  278. package/dist/hub/directory/types.js +14 -0
  279. package/dist/hub/directory/types.js.map +1 -0
  280. package/dist/hub/directory-response-owner.d.ts +38 -0
  281. package/dist/hub/directory-response-owner.js +191 -0
  282. package/dist/hub/directory-response-owner.js.map +1 -0
  283. package/dist/hub/enrollment-budget.d.ts +6 -0
  284. package/dist/hub/enrollment-budget.js +24 -0
  285. package/dist/hub/enrollment-budget.js.map +1 -0
  286. package/dist/hub/enrolment-code.d.ts +126 -0
  287. package/dist/hub/enrolment-code.js +266 -0
  288. package/dist/hub/enrolment-code.js.map +1 -0
  289. package/dist/hub/execution/cli-provider.d.ts +23 -0
  290. package/dist/hub/execution/cli-provider.js +341 -0
  291. package/dist/hub/execution/cli-provider.js.map +1 -0
  292. package/dist/hub/execution/index.d.ts +13 -0
  293. package/dist/hub/execution/index.js +8 -0
  294. package/dist/hub/execution/index.js.map +1 -0
  295. package/dist/hub/execution/model-broker.d.ts +24 -0
  296. package/dist/hub/execution/model-broker.js +208 -0
  297. package/dist/hub/execution/model-broker.js.map +1 -0
  298. package/dist/hub/execution/provider-setup.d.ts +11 -0
  299. package/dist/hub/execution/provider-setup.js +21 -0
  300. package/dist/hub/execution/provider-setup.js.map +1 -0
  301. package/dist/hub/execution/sandbox-runner.d.ts +1 -0
  302. package/dist/hub/execution/sandbox-runner.js +221 -0
  303. package/dist/hub/execution/sandbox-runner.js.map +1 -0
  304. package/dist/hub/execution/service.d.ts +136 -0
  305. package/dist/hub/execution/service.js +459 -0
  306. package/dist/hub/execution/service.js.map +1 -0
  307. package/dist/hub/execution/store.d.ts +61 -0
  308. package/dist/hub/execution/store.js +182 -0
  309. package/dist/hub/execution/store.js.map +1 -0
  310. package/dist/hub/execution/views.d.ts +20 -0
  311. package/dist/hub/execution/views.js +48 -0
  312. package/dist/hub/execution/views.js.map +1 -0
  313. package/dist/hub/fleet-revocation.d.ts +3 -0
  314. package/dist/hub/fleet-revocation.js +7 -0
  315. package/dist/hub/fleet-revocation.js.map +1 -0
  316. package/dist/hub/group-policy/admin-api.d.ts +30 -0
  317. package/dist/hub/group-policy/admin-api.js +92 -0
  318. package/dist/hub/group-policy/admin-api.js.map +1 -0
  319. package/dist/hub/group-policy/admin-context.d.ts +23 -0
  320. package/dist/hub/group-policy/admin-context.js +52 -0
  321. package/dist/hub/group-policy/admin-context.js.map +1 -0
  322. package/dist/hub/group-policy/admin-control.d.ts +35 -0
  323. package/dist/hub/group-policy/admin-control.js +260 -0
  324. package/dist/hub/group-policy/admin-control.js.map +1 -0
  325. package/dist/hub/group-policy/admin-dto.d.ts +259 -0
  326. package/dist/hub/group-policy/admin-dto.js +57 -0
  327. package/dist/hub/group-policy/admin-dto.js.map +1 -0
  328. package/dist/hub/group-policy/admin-facts.d.ts +17 -0
  329. package/dist/hub/group-policy/admin-facts.js +33 -0
  330. package/dist/hub/group-policy/admin-facts.js.map +1 -0
  331. package/dist/hub/group-policy/admin-impact.d.ts +51 -0
  332. package/dist/hub/group-policy/admin-impact.js +90 -0
  333. package/dist/hub/group-policy/admin-impact.js.map +1 -0
  334. package/dist/hub/group-policy/admin-inventory.d.ts +24 -0
  335. package/dist/hub/group-policy/admin-inventory.js +72 -0
  336. package/dist/hub/group-policy/admin-inventory.js.map +1 -0
  337. package/dist/hub/group-policy/admin-read.d.ts +21 -0
  338. package/dist/hub/group-policy/admin-read.js +95 -0
  339. package/dist/hub/group-policy/admin-read.js.map +1 -0
  340. package/dist/hub/group-policy/admin-search.d.ts +14 -0
  341. package/dist/hub/group-policy/admin-search.js +72 -0
  342. package/dist/hub/group-policy/admin-search.js.map +1 -0
  343. package/dist/hub/group-policy/authorization.d.ts +79 -0
  344. package/dist/hub/group-policy/authorization.js +379 -0
  345. package/dist/hub/group-policy/authorization.js.map +1 -0
  346. package/dist/hub/group-policy/impact-inventory.d.ts +21 -0
  347. package/dist/hub/group-policy/impact-inventory.js +75 -0
  348. package/dist/hub/group-policy/impact-inventory.js.map +1 -0
  349. package/dist/hub/group-policy/model.d.ts +56 -0
  350. package/dist/hub/group-policy/model.js +46 -0
  351. package/dist/hub/group-policy/model.js.map +1 -0
  352. package/dist/hub/group-policy/resources.d.ts +111 -0
  353. package/dist/hub/group-policy/resources.js +298 -0
  354. package/dist/hub/group-policy/resources.js.map +1 -0
  355. package/dist/hub/group-policy/store.d.ts +75 -0
  356. package/dist/hub/group-policy/store.js +255 -0
  357. package/dist/hub/group-policy/store.js.map +1 -0
  358. package/dist/hub/group-policy/welcome.d.ts +36 -0
  359. package/dist/hub/group-policy/welcome.js +55 -0
  360. package/dist/hub/group-policy/welcome.js.map +1 -0
  361. package/dist/hub/http/compose.d.ts +24 -0
  362. package/dist/hub/http/compose.js +766 -0
  363. package/dist/hub/http/compose.js.map +1 -0
  364. package/dist/hub/http/core.d.ts +71 -0
  365. package/dist/hub/http/core.js +266 -0
  366. package/dist/hub/http/core.js.map +1 -0
  367. package/dist/hub/http/deps.d.ts +79 -0
  368. package/dist/hub/http/deps.js +2 -0
  369. package/dist/hub/http/deps.js.map +1 -0
  370. package/dist/hub/http/schema.d.ts +14 -0
  371. package/dist/hub/http/schema.js +84 -0
  372. package/dist/hub/http/schema.js.map +1 -0
  373. package/dist/hub/identity.d.ts +32 -0
  374. package/dist/hub/identity.js +80 -0
  375. package/dist/hub/identity.js.map +1 -0
  376. package/dist/hub/init/browser-certificate.d.ts +14 -0
  377. package/dist/hub/init/browser-certificate.js +99 -0
  378. package/dist/hub/init/browser-certificate.js.map +1 -0
  379. package/dist/hub/init/browser-tls.d.ts +18 -0
  380. package/dist/hub/init/browser-tls.js +62 -0
  381. package/dist/hub/init/browser-tls.js.map +1 -0
  382. package/dist/hub/init/cli.d.ts +3 -0
  383. package/dist/hub/init/cli.js +83 -0
  384. package/dist/hub/init/cli.js.map +1 -0
  385. package/dist/hub/init/directory-certificate.d.ts +24 -0
  386. package/dist/hub/init/directory-certificate.js +229 -0
  387. package/dist/hub/init/directory-certificate.js.map +1 -0
  388. package/dist/hub/init/existing-fleet.d.ts +6 -0
  389. package/dist/hub/init/existing-fleet.js +58 -0
  390. package/dist/hub/init/existing-fleet.js.map +1 -0
  391. package/dist/hub/init/handoff.d.ts +8 -0
  392. package/dist/hub/init/handoff.js +36 -0
  393. package/dist/hub/init/handoff.js.map +1 -0
  394. package/dist/hub/init/identity.d.ts +5 -0
  395. package/dist/hub/init/identity.js +24 -0
  396. package/dist/hub/init/identity.js.map +1 -0
  397. package/dist/hub/init/initializer.d.ts +34 -0
  398. package/dist/hub/init/initializer.js +504 -0
  399. package/dist/hub/init/initializer.js.map +1 -0
  400. package/dist/hub/init/inventory.d.ts +17 -0
  401. package/dist/hub/init/inventory.js +33 -0
  402. package/dist/hub/init/inventory.js.map +1 -0
  403. package/dist/hub/init/layout.d.ts +32 -0
  404. package/dist/hub/init/layout.js +53 -0
  405. package/dist/hub/init/layout.js.map +1 -0
  406. package/dist/hub/init/network.d.ts +20 -0
  407. package/dist/hub/init/network.js +108 -0
  408. package/dist/hub/init/network.js.map +1 -0
  409. package/dist/hub/init/plan-digest.d.ts +5 -0
  410. package/dist/hub/init/plan-digest.js +49 -0
  411. package/dist/hub/init/plan-digest.js.map +1 -0
  412. package/dist/hub/init/prompt.d.ts +26 -0
  413. package/dist/hub/init/prompt.js +111 -0
  414. package/dist/hub/init/prompt.js.map +1 -0
  415. package/dist/hub/init/secret-file.d.ts +1 -0
  416. package/dist/hub/init/secret-file.js +59 -0
  417. package/dist/hub/init/secret-file.js.map +1 -0
  418. package/dist/hub/init/text.d.ts +129 -0
  419. package/dist/hub/init/text.js +251 -0
  420. package/dist/hub/init/text.js.map +1 -0
  421. package/dist/hub/init/types.d.ts +142 -0
  422. package/dist/hub/init/types.js +9 -0
  423. package/dist/hub/init/types.js.map +1 -0
  424. package/dist/hub/init/web-audit-import.d.ts +12 -0
  425. package/dist/hub/init/web-audit-import.js +39 -0
  426. package/dist/hub/init/web-audit-import.js.map +1 -0
  427. package/dist/hub/init/web-audit.d.ts +30 -0
  428. package/dist/hub/init/web-audit.js +42 -0
  429. package/dist/hub/init/web-audit.js.map +1 -0
  430. package/dist/hub/init/web-error.d.ts +6 -0
  431. package/dist/hub/init/web-error.js +8 -0
  432. package/dist/hub/init/web-error.js.map +1 -0
  433. package/dist/hub/init/web-http.d.ts +9 -0
  434. package/dist/hub/init/web-http.js +103 -0
  435. package/dist/hub/init/web-http.js.map +1 -0
  436. package/dist/hub/init/web.d.ts +125 -0
  437. package/dist/hub/init/web.js +433 -0
  438. package/dist/hub/init/web.js.map +1 -0
  439. package/dist/hub/init/wizard.d.ts +34 -0
  440. package/dist/hub/init/wizard.js +580 -0
  441. package/dist/hub/init/wizard.js.map +1 -0
  442. package/dist/hub/initialization.d.ts +23 -0
  443. package/dist/hub/initialization.js +28 -0
  444. package/dist/hub/initialization.js.map +1 -0
  445. package/dist/hub/join/client.d.ts +52 -0
  446. package/dist/hub/join/client.js +136 -0
  447. package/dist/hub/join/client.js.map +1 -0
  448. package/dist/hub/join/descriptor.d.ts +52 -0
  449. package/dist/hub/join/descriptor.js +59 -0
  450. package/dist/hub/join/descriptor.js.map +1 -0
  451. package/dist/hub/join/display.d.ts +18 -0
  452. package/dist/hub/join/display.js +53 -0
  453. package/dist/hub/join/display.js.map +1 -0
  454. package/dist/hub/join/fleet-authority.d.ts +2 -0
  455. package/dist/hub/join/fleet-authority.js +3 -0
  456. package/dist/hub/join/fleet-authority.js.map +1 -0
  457. package/dist/hub/join/http.d.ts +8 -0
  458. package/dist/hub/join/http.js +122 -0
  459. package/dist/hub/join/http.js.map +1 -0
  460. package/dist/hub/join/invitation.d.ts +28 -0
  461. package/dist/hub/join/invitation.js +28 -0
  462. package/dist/hub/join/invitation.js.map +1 -0
  463. package/dist/hub/join/local-journal.d.ts +84 -0
  464. package/dist/hub/join/local-journal.js +65 -0
  465. package/dist/hub/join/local-journal.js.map +1 -0
  466. package/dist/hub/join/local.d.ts +255 -0
  467. package/dist/hub/join/local.js +678 -0
  468. package/dist/hub/join/local.js.map +1 -0
  469. package/dist/hub/join/private.d.ts +3 -0
  470. package/dist/hub/join/private.js +46 -0
  471. package/dist/hub/join/private.js.map +1 -0
  472. package/dist/hub/join/protocol.d.ts +69 -0
  473. package/dist/hub/join/protocol.js +96 -0
  474. package/dist/hub/join/protocol.js.map +1 -0
  475. package/dist/hub/join/receipt.d.ts +43 -0
  476. package/dist/hub/join/receipt.js +75 -0
  477. package/dist/hub/join/receipt.js.map +1 -0
  478. package/dist/hub/join/service.d.ts +280 -0
  479. package/dist/hub/join/service.js +802 -0
  480. package/dist/hub/join/service.js.map +1 -0
  481. package/dist/hub/join/store.d.ts +135 -0
  482. package/dist/hub/join/store.js +136 -0
  483. package/dist/hub/join/store.js.map +1 -0
  484. package/dist/hub/join/trust.d.ts +19 -0
  485. package/dist/hub/join/trust.js +94 -0
  486. package/dist/hub/join/trust.js.map +1 -0
  487. package/dist/hub/member/agent-mode.d.ts +6 -0
  488. package/dist/hub/member/agent-mode.js +23 -0
  489. package/dist/hub/member/agent-mode.js.map +1 -0
  490. package/dist/hub/member/attachments.d.ts +29 -0
  491. package/dist/hub/member/attachments.js +107 -0
  492. package/dist/hub/member/attachments.js.map +1 -0
  493. package/dist/hub/member/exposure-api.d.ts +91 -0
  494. package/dist/hub/member/exposure-api.js +67 -0
  495. package/dist/hub/member/exposure-api.js.map +1 -0
  496. package/dist/hub/member/exposures.d.ts +127 -0
  497. package/dist/hub/member/exposures.js +292 -0
  498. package/dist/hub/member/exposures.js.map +1 -0
  499. package/dist/hub/member/pairing-api.d.ts +101 -0
  500. package/dist/hub/member/pairing-api.js +429 -0
  501. package/dist/hub/member/pairing-api.js.map +1 -0
  502. package/dist/hub/member/pairing-notices.d.ts +18 -0
  503. package/dist/hub/member/pairing-notices.js +62 -0
  504. package/dist/hub/member/pairing-notices.js.map +1 -0
  505. package/dist/hub/member/quota.d.ts +20 -0
  506. package/dist/hub/member/quota.js +98 -0
  507. package/dist/hub/member/quota.js.map +1 -0
  508. package/dist/hub/member-journal.d.ts +104 -0
  509. package/dist/hub/member-journal.js +336 -0
  510. package/dist/hub/member-journal.js.map +1 -0
  511. package/dist/hub/member-reconciliation.d.ts +14 -0
  512. package/dist/hub/member-reconciliation.js +97 -0
  513. package/dist/hub/member-reconciliation.js.map +1 -0
  514. package/dist/hub/mount.d.ts +50 -0
  515. package/dist/hub/mount.js +157 -0
  516. package/dist/hub/mount.js.map +1 -0
  517. package/dist/hub/pairing-client.d.ts +17 -0
  518. package/dist/hub/pairing-client.js +108 -0
  519. package/dist/hub/pairing-client.js.map +1 -0
  520. package/dist/hub/pairing-notices.d.ts +50 -0
  521. package/dist/hub/pairing-notices.js +271 -0
  522. package/dist/hub/pairing-notices.js.map +1 -0
  523. package/dist/hub/pairing.d.ts +116 -0
  524. package/dist/hub/pairing.js +526 -0
  525. package/dist/hub/pairing.js.map +1 -0
  526. package/dist/hub/policy.d.ts +65 -0
  527. package/dist/hub/policy.js +154 -0
  528. package/dist/hub/policy.js.map +1 -0
  529. package/dist/hub/preview.d.ts +32 -0
  530. package/dist/hub/preview.js +64 -0
  531. package/dist/hub/preview.js.map +1 -0
  532. package/dist/hub/private-files.d.ts +5 -0
  533. package/dist/hub/private-files.js +44 -0
  534. package/dist/hub/private-files.js.map +1 -0
  535. package/dist/hub/profile.d.ts +59 -0
  536. package/dist/hub/profile.js +73 -0
  537. package/dist/hub/profile.js.map +1 -0
  538. package/dist/hub/protocol.d.ts +895 -0
  539. package/dist/hub/protocol.js +105 -0
  540. package/dist/hub/protocol.js.map +1 -0
  541. package/dist/hub/quota.d.ts +24 -0
  542. package/dist/hub/quota.js +112 -0
  543. package/dist/hub/quota.js.map +1 -0
  544. package/dist/hub/representative.d.ts +141 -0
  545. package/dist/hub/representative.js +528 -0
  546. package/dist/hub/representative.js.map +1 -0
  547. package/dist/hub/retention.d.ts +17 -0
  548. package/dist/hub/retention.js +45 -0
  549. package/dist/hub/retention.js.map +1 -0
  550. package/dist/hub/room-read-pacer.d.ts +14 -0
  551. package/dist/hub/room-read-pacer.js +51 -0
  552. package/dist/hub/room-read-pacer.js.map +1 -0
  553. package/dist/hub/rooms.d.ts +127 -0
  554. package/dist/hub/rooms.js +597 -0
  555. package/dist/hub/rooms.js.map +1 -0
  556. package/dist/hub/runtime.d.ts +163 -0
  557. package/dist/hub/runtime.js +708 -0
  558. package/dist/hub/runtime.js.map +1 -0
  559. package/dist/hub/server.d.ts +61 -0
  560. package/dist/hub/server.js +263 -0
  561. package/dist/hub/server.js.map +1 -0
  562. package/dist/hub/service-start.d.ts +17 -0
  563. package/dist/hub/service-start.js +109 -0
  564. package/dist/hub/service-start.js.map +1 -0
  565. package/dist/hub/session-directory-transition.d.ts +48 -0
  566. package/dist/hub/session-directory-transition.js +118 -0
  567. package/dist/hub/session-directory-transition.js.map +1 -0
  568. package/dist/hub/session-epoch.d.ts +16 -0
  569. package/dist/hub/session-epoch.js +50 -0
  570. package/dist/hub/session-epoch.js.map +1 -0
  571. package/dist/hub/sessions.d.ts +66 -0
  572. package/dist/hub/sessions.js +217 -0
  573. package/dist/hub/sessions.js.map +1 -0
  574. package/dist/hub/settings-api.d.ts +50 -0
  575. package/dist/hub/settings-api.js +92 -0
  576. package/dist/hub/settings-api.js.map +1 -0
  577. package/dist/hub/settings-commit.d.ts +108 -0
  578. package/dist/hub/settings-commit.js +537 -0
  579. package/dist/hub/settings-commit.js.map +1 -0
  580. package/dist/hub/settings-directory-ca.d.ts +31 -0
  581. package/dist/hub/settings-directory-ca.js +115 -0
  582. package/dist/hub/settings-directory-ca.js.map +1 -0
  583. package/dist/hub/settings-directory-control.d.ts +58 -0
  584. package/dist/hub/settings-directory-control.js +117 -0
  585. package/dist/hub/settings-directory-control.js.map +1 -0
  586. package/dist/hub/settings-directory-decision.d.ts +465 -0
  587. package/dist/hub/settings-directory-decision.js +322 -0
  588. package/dist/hub/settings-directory-decision.js.map +1 -0
  589. package/dist/hub/settings-directory-host-http.d.ts +9 -0
  590. package/dist/hub/settings-directory-host-http.js +75 -0
  591. package/dist/hub/settings-directory-host-http.js.map +1 -0
  592. package/dist/hub/settings-directory-host-notice-http.d.ts +9 -0
  593. package/dist/hub/settings-directory-host-notice-http.js +78 -0
  594. package/dist/hub/settings-directory-host-notice-http.js.map +1 -0
  595. package/dist/hub/settings-directory-host-notices.d.ts +11 -0
  596. package/dist/hub/settings-directory-host-notices.js +39 -0
  597. package/dist/hub/settings-directory-host-notices.js.map +1 -0
  598. package/dist/hub/settings-directory-http.d.ts +33 -0
  599. package/dist/hub/settings-directory-http.js +109 -0
  600. package/dist/hub/settings-directory-http.js.map +1 -0
  601. package/dist/hub/settings-directory-mount.d.ts +24 -0
  602. package/dist/hub/settings-directory-mount.js +77 -0
  603. package/dist/hub/settings-directory-mount.js.map +1 -0
  604. package/dist/hub/settings-directory-notices.d.ts +61 -0
  605. package/dist/hub/settings-directory-notices.js +132 -0
  606. package/dist/hub/settings-directory-notices.js.map +1 -0
  607. package/dist/hub/settings-directory-proof.d.ts +77 -0
  608. package/dist/hub/settings-directory-proof.js +313 -0
  609. package/dist/hub/settings-directory-proof.js.map +1 -0
  610. package/dist/hub/settings-directory-recovery-intent.d.ts +13 -0
  611. package/dist/hub/settings-directory-recovery-intent.js +29 -0
  612. package/dist/hub/settings-directory-recovery-intent.js.map +1 -0
  613. package/dist/hub/settings-directory-recovery.d.ts +45 -0
  614. package/dist/hub/settings-directory-recovery.js +178 -0
  615. package/dist/hub/settings-directory-recovery.js.map +1 -0
  616. package/dist/hub/settings-directory-runtime.d.ts +17 -0
  617. package/dist/hub/settings-directory-runtime.js +2 -0
  618. package/dist/hub/settings-directory-runtime.js.map +1 -0
  619. package/dist/hub/settings-directory-save.d.ts +37 -0
  620. package/dist/hub/settings-directory-save.js +175 -0
  621. package/dist/hub/settings-directory-save.js.map +1 -0
  622. package/dist/hub/settings-web-address-control.d.ts +49 -0
  623. package/dist/hub/settings-web-address-control.js +99 -0
  624. package/dist/hub/settings-web-address-control.js.map +1 -0
  625. package/dist/hub/settings-web-address-decision.d.ts +91 -0
  626. package/dist/hub/settings-web-address-decision.js +163 -0
  627. package/dist/hub/settings-web-address-decision.js.map +1 -0
  628. package/dist/hub/settings-web-address-http.d.ts +9 -0
  629. package/dist/hub/settings-web-address-http.js +74 -0
  630. package/dist/hub/settings-web-address-http.js.map +1 -0
  631. package/dist/hub/settings-web-address-network.d.ts +2 -0
  632. package/dist/hub/settings-web-address-network.js +25 -0
  633. package/dist/hub/settings-web-address-network.js.map +1 -0
  634. package/dist/hub/settings-web-address-policy.d.ts +27 -0
  635. package/dist/hub/settings-web-address-policy.js +47 -0
  636. package/dist/hub/settings-web-address-policy.js.map +1 -0
  637. package/dist/hub/settings-web-address.d.ts +64 -0
  638. package/dist/hub/settings-web-address.js +226 -0
  639. package/dist/hub/settings-web-address.js.map +1 -0
  640. package/dist/hub/socket.d.ts +24 -0
  641. package/dist/hub/socket.js +79 -0
  642. package/dist/hub/socket.js.map +1 -0
  643. package/dist/hub/store.d.ts +87 -0
  644. package/dist/hub/store.js +108 -0
  645. package/dist/hub/store.js.map +1 -0
  646. package/dist/hub/tls.d.ts +31 -0
  647. package/dist/hub/tls.js +135 -0
  648. package/dist/hub/tls.js.map +1 -0
  649. package/dist/hub/types.d.ts +429 -0
  650. package/dist/hub/types.js +2 -0
  651. package/dist/hub/types.js.map +1 -0
  652. package/dist/hub/validation.d.ts +33 -0
  653. package/dist/hub/validation.js +136 -0
  654. package/dist/hub/validation.js.map +1 -0
  655. package/dist/hub/version-floor.d.ts +10 -0
  656. package/dist/hub/version-floor.js +45 -0
  657. package/dist/hub/version-floor.js.map +1 -0
  658. package/dist/hub-browser-certificate-policy.d.ts +31 -0
  659. package/dist/hub-browser-certificate-policy.js +25 -0
  660. package/dist/hub-browser-certificate-policy.js.map +1 -0
  661. package/dist/hub-host-settings.d.ts +48 -0
  662. package/dist/hub-host-settings.js +85 -0
  663. package/dist/hub-host-settings.js.map +1 -0
  664. package/dist/hub-membership-settings.d.ts +6 -0
  665. package/dist/hub-membership-settings.js +21 -0
  666. package/dist/hub-membership-settings.js.map +1 -0
  667. package/dist/hub-mode.d.ts +15 -0
  668. package/dist/hub-mode.js +17 -0
  669. package/dist/hub-mode.js.map +1 -0
  670. package/dist/hub-pairing-summary.d.ts +50 -0
  671. package/dist/hub-pairing-summary.js +39 -0
  672. package/dist/hub-pairing-summary.js.map +1 -0
  673. package/dist/hub-report-target.d.ts +32 -0
  674. package/dist/hub-report-target.js +33 -0
  675. package/dist/hub-report-target.js.map +1 -0
  676. package/dist/hub-retention-policy.d.ts +14 -0
  677. package/dist/hub-retention-policy.js +15 -0
  678. package/dist/hub-retention-policy.js.map +1 -0
  679. package/dist/install-user-systemd.d.ts +20 -0
  680. package/dist/install-user-systemd.js +55 -0
  681. package/dist/install-user-systemd.js.map +1 -0
  682. package/dist/instance-config-impact.js +13 -0
  683. package/dist/instance-config-impact.js.map +1 -1
  684. package/dist/instance-lifecycle.d.ts +42 -4
  685. package/dist/instance-lifecycle.js +464 -202
  686. package/dist/instance-lifecycle.js.map +1 -1
  687. package/dist/instructions.d.ts +2 -0
  688. package/dist/instructions.js +6 -0
  689. package/dist/instructions.js.map +1 -1
  690. package/dist/launchd-service-domain.d.ts +5 -0
  691. package/dist/launchd-service-domain.js +21 -0
  692. package/dist/launchd-service-domain.js.map +1 -0
  693. package/dist/linux-launchers.d.ts +88 -0
  694. package/dist/linux-launchers.js +296 -0
  695. package/dist/linux-launchers.js.map +1 -0
  696. package/dist/local-pane-endpoint.d.ts +46 -0
  697. package/dist/local-pane-endpoint.js +189 -0
  698. package/dist/local-pane-endpoint.js.map +1 -0
  699. package/dist/local-pane-launcher.d.ts +2 -0
  700. package/dist/local-pane-launcher.js +38 -0
  701. package/dist/local-pane-launcher.js.map +1 -0
  702. package/dist/local-pane-stage.ps1 +101 -0
  703. package/dist/locale.js +406 -14
  704. package/dist/locale.js.map +1 -1
  705. package/dist/log-service.d.ts +62 -6
  706. package/dist/log-service.js +135 -28
  707. package/dist/log-service.js.map +1 -1
  708. package/dist/log-steps-agy-grok.d.ts +74 -0
  709. package/dist/log-steps-agy-grok.js +440 -0
  710. package/dist/log-steps-agy-grok.js.map +1 -0
  711. package/dist/log-steps.d.ts +62 -3
  712. package/dist/log-steps.js +188 -22
  713. package/dist/log-steps.js.map +1 -1
  714. package/dist/log-transcript-paths.d.ts +29 -0
  715. package/dist/log-transcript-paths.js +109 -0
  716. package/dist/log-transcript-paths.js.map +1 -0
  717. package/dist/login-controller.d.ts +31 -4
  718. package/dist/login-controller.js +88 -6
  719. package/dist/login-controller.js.map +1 -1
  720. package/dist/login-flows.d.ts +12 -8
  721. package/dist/login-flows.js +34 -16
  722. package/dist/login-flows.js.map +1 -1
  723. package/dist/login-manager.d.ts +2 -2
  724. package/dist/login-manager.js +3 -2
  725. package/dist/login-manager.js.map +1 -1
  726. package/dist/login-window-lock.d.ts +20 -7
  727. package/dist/login-window-lock.js +35 -16
  728. package/dist/login-window-lock.js.map +1 -1
  729. package/dist/ls-rows.d.ts +1 -1
  730. package/dist/ls-rows.js +3 -4
  731. package/dist/ls-rows.js.map +1 -1
  732. package/dist/machine-accounts.d.ts +110 -0
  733. package/dist/machine-accounts.js +229 -0
  734. package/dist/machine-accounts.js.map +1 -0
  735. package/dist/machine-signins.d.ts +89 -0
  736. package/dist/machine-signins.js +182 -0
  737. package/dist/machine-signins.js.map +1 -0
  738. package/dist/model-catalog-defaults.d.ts +14 -0
  739. package/dist/model-catalog-defaults.js +20 -0
  740. package/dist/model-catalog-defaults.js.map +1 -0
  741. package/dist/native-agent-admission.d.ts +7 -0
  742. package/dist/native-agent-admission.js +26 -0
  743. package/dist/native-agent-admission.js.map +1 -0
  744. package/dist/native-daemon-client.d.ts +13 -0
  745. package/dist/native-daemon-client.js +28 -0
  746. package/dist/native-daemon-client.js.map +1 -0
  747. package/dist/native-instance-api.d.ts +13 -0
  748. package/dist/native-instance-api.js +217 -0
  749. package/dist/native-instance-api.js.map +1 -0
  750. package/dist/native-instance-input.d.ts +87 -0
  751. package/dist/native-instance-input.js +59 -0
  752. package/dist/native-instance-input.js.map +1 -0
  753. package/dist/native-instance-registry.d.ts +38 -0
  754. package/dist/native-instance-registry.js +129 -0
  755. package/dist/native-instance-registry.js.map +1 -0
  756. package/dist/native-mcp.d.ts +43 -0
  757. package/dist/native-mcp.js +291 -0
  758. package/dist/native-mcp.js.map +1 -0
  759. package/dist/native-model-catalog.d.ts +25 -0
  760. package/dist/native-model-catalog.js +181 -0
  761. package/dist/native-model-catalog.js.map +1 -0
  762. package/dist/native-pane-crash-budget.d.ts +20 -0
  763. package/dist/native-pane-crash-budget.js +60 -0
  764. package/dist/native-pane-crash-budget.js.map +1 -0
  765. package/dist/native-pane-create.d.ts +26 -0
  766. package/dist/native-pane-create.js +53 -0
  767. package/dist/native-pane-create.js.map +1 -0
  768. package/dist/native-pane-lifecycle.d.ts +73 -0
  769. package/dist/native-pane-lifecycle.js +239 -0
  770. package/dist/native-pane-lifecycle.js.map +1 -0
  771. package/dist/native-pane-manager.d.ts +59 -0
  772. package/dist/native-pane-manager.js +592 -0
  773. package/dist/native-pane-manager.js.map +1 -0
  774. package/dist/native-pane-output-log.d.ts +15 -0
  775. package/dist/native-pane-output-log.js +108 -0
  776. package/dist/native-pane-output-log.js.map +1 -0
  777. package/dist/native-pane-reconciliation.d.ts +4 -0
  778. package/dist/native-pane-reconciliation.js +40 -0
  779. package/dist/native-pane-reconciliation.js.map +1 -0
  780. package/dist/native-pane-recovery.d.ts +12 -0
  781. package/dist/native-pane-recovery.js +10 -0
  782. package/dist/native-pane-recovery.js.map +1 -0
  783. package/dist/native-pane-tools.d.ts +2 -0
  784. package/dist/native-pane-tools.js +14 -0
  785. package/dist/native-pane-tools.js.map +1 -0
  786. package/dist/needs-you-hub.d.ts +8 -0
  787. package/dist/needs-you-hub.js +31 -5
  788. package/dist/needs-you-hub.js.map +1 -1
  789. package/dist/needs-you.d.ts +80 -3
  790. package/dist/needs-you.js +46 -3
  791. package/dist/needs-you.js.map +1 -1
  792. package/dist/office-share-page.js +3 -3
  793. package/dist/office-share-page.js.map +1 -1
  794. package/dist/office-share.d.ts +28 -2
  795. package/dist/office-share.js +32 -3
  796. package/dist/office-share.js.map +1 -1
  797. package/dist/office-talk.d.ts +26 -0
  798. package/dist/office-talk.js +50 -0
  799. package/dist/office-talk.js.map +1 -0
  800. package/dist/outbound-handlers.d.ts +44 -2
  801. package/dist/outbound-handlers.js +169 -5
  802. package/dist/outbound-handlers.js.map +1 -1
  803. package/dist/outbound-schemas.d.ts +79 -1
  804. package/dist/outbound-schemas.js +37 -14
  805. package/dist/outbound-schemas.js.map +1 -1
  806. package/dist/pane-port.d.ts +118 -0
  807. package/dist/pane-port.js +2 -0
  808. package/dist/pane-port.js.map +1 -0
  809. package/dist/pane-quota-history.d.ts +2 -0
  810. package/dist/pane-quota-history.js +20 -0
  811. package/dist/pane-quota-history.js.map +1 -1
  812. package/dist/pause-marker.d.ts +1 -1
  813. package/dist/pause-marker.js +1 -1
  814. package/dist/pause-marker.js.map +1 -1
  815. package/dist/profile-signins.d.ts +109 -0
  816. package/dist/profile-signins.js +249 -0
  817. package/dist/profile-signins.js.map +1 -0
  818. package/dist/public-web-gateway.js +17 -1
  819. package/dist/public-web-gateway.js.map +1 -1
  820. package/dist/public-web-link.d.ts +16 -0
  821. package/dist/public-web-link.js +21 -0
  822. package/dist/public-web-link.js.map +1 -1
  823. package/dist/quickstart-api.js +9 -5
  824. package/dist/quickstart-api.js.map +1 -1
  825. package/dist/quickstart.d.ts +6 -0
  826. package/dist/quickstart.js +31 -4
  827. package/dist/quickstart.js.map +1 -1
  828. package/dist/quiet-run.d.ts +31 -0
  829. package/dist/quiet-run.js +50 -0
  830. package/dist/quiet-run.js.map +1 -0
  831. package/dist/runtime-api.d.ts +23 -0
  832. package/dist/runtime-api.js +413 -0
  833. package/dist/runtime-api.js.map +1 -0
  834. package/dist/runtime-assets/@xterm/addon-serialize/LICENSE +21 -0
  835. package/dist/runtime-assets/@xterm/addon-serialize/lib/addon-serialize.js +2 -0
  836. package/dist/runtime-assets/@xterm/addon-serialize/lib/addon-serialize.mjs +19 -0
  837. package/dist/runtime-assets/@xterm/addon-serialize/package.json +29 -0
  838. package/dist/runtime-assets/@xterm/headless/LICENSE +21 -0
  839. package/dist/runtime-assets/@xterm/headless/lib-headless/xterm-headless.js +2 -0
  840. package/dist/runtime-assets/@xterm/headless/lib-headless/xterm-headless.mjs +46 -0
  841. package/dist/runtime-assets/@xterm/headless/package.json +29 -0
  842. package/dist/runtime-assets/node-pty/CONPTY-LICENSE +21 -0
  843. package/dist/runtime-assets/node-pty/CONPTY-NOTICE.md +503 -0
  844. package/dist/runtime-assets/node-pty/LICENSE +69 -0
  845. package/dist/runtime-assets/node-pty/lib/conpty_console_list_agent.js +16 -0
  846. package/dist/runtime-assets/node-pty/lib/eventEmitter2.js +47 -0
  847. package/dist/runtime-assets/node-pty/lib/index.js +52 -0
  848. package/dist/runtime-assets/node-pty/lib/interfaces.js +7 -0
  849. package/dist/runtime-assets/node-pty/lib/shared/conout.js +11 -0
  850. package/dist/runtime-assets/node-pty/lib/terminal.js +190 -0
  851. package/dist/runtime-assets/node-pty/lib/types.js +7 -0
  852. package/dist/runtime-assets/node-pty/lib/unixTerminal.js +346 -0
  853. package/dist/runtime-assets/node-pty/lib/utils.js +39 -0
  854. package/dist/runtime-assets/node-pty/lib/windowsConoutConnection.js +125 -0
  855. package/dist/runtime-assets/node-pty/lib/windowsPtyAgent.js +320 -0
  856. package/dist/runtime-assets/node-pty/lib/windowsTerminal.js +199 -0
  857. package/dist/runtime-assets/node-pty/lib/worker/conoutSocketWorker.js +22 -0
  858. package/dist/runtime-assets/node-pty/package.json +64 -0
  859. package/dist/runtime-assets/node-pty/prebuilds/win32-arm64/conpty/OpenConsole.exe +0 -0
  860. package/dist/runtime-assets/node-pty/prebuilds/win32-arm64/conpty/conpty.dll +0 -0
  861. package/dist/runtime-assets/node-pty/prebuilds/win32-arm64/conpty.node +0 -0
  862. package/dist/runtime-assets/node-pty/prebuilds/win32-arm64/conpty_console_list.node +0 -0
  863. package/dist/runtime-assets/node-pty/prebuilds/win32-x64/conpty/OpenConsole.exe +0 -0
  864. package/dist/runtime-assets/node-pty/prebuilds/win32-x64/conpty/conpty.dll +0 -0
  865. package/dist/runtime-assets/node-pty/prebuilds/win32-x64/conpty.node +0 -0
  866. package/dist/runtime-assets/node-pty/prebuilds/win32-x64/conpty_console_list.node +0 -0
  867. package/dist/runtime-autostart.d.ts +61 -0
  868. package/dist/runtime-autostart.js +161 -0
  869. package/dist/runtime-autostart.js.map +1 -0
  870. package/dist/runtime-background.d.ts +200 -0
  871. package/dist/runtime-background.js +480 -0
  872. package/dist/runtime-background.js.map +1 -0
  873. package/dist/runtime-build-info.d.ts +10 -0
  874. package/dist/runtime-build-info.js +64 -0
  875. package/dist/runtime-build-info.js.map +1 -0
  876. package/dist/runtime-bundle.d.ts +22 -0
  877. package/dist/runtime-bundle.js +158 -0
  878. package/dist/runtime-bundle.js.map +1 -0
  879. package/dist/runtime-cli-background.d.ts +92 -0
  880. package/dist/runtime-cli-background.js +336 -0
  881. package/dist/runtime-cli-background.js.map +1 -0
  882. package/dist/runtime-cli-install.d.ts +295 -0
  883. package/dist/runtime-cli-install.js +869 -0
  884. package/dist/runtime-cli-install.js.map +1 -0
  885. package/dist/runtime-cli.d.ts +21 -0
  886. package/dist/runtime-cli.js +578 -0
  887. package/dist/runtime-cli.js.map +1 -0
  888. package/dist/runtime-client-store.d.ts +86 -0
  889. package/dist/runtime-client-store.js +392 -0
  890. package/dist/runtime-client-store.js.map +1 -0
  891. package/dist/runtime-client.d.ts +258 -0
  892. package/dist/runtime-client.js +1353 -0
  893. package/dist/runtime-client.js.map +1 -0
  894. package/dist/runtime-connection.d.ts +22 -0
  895. package/dist/runtime-connection.js +93 -0
  896. package/dist/runtime-connection.js.map +1 -0
  897. package/dist/runtime-coordinator.d.ts +201 -0
  898. package/dist/runtime-coordinator.js +1514 -0
  899. package/dist/runtime-coordinator.js.map +1 -0
  900. package/dist/runtime-credential-profiles.d.ts +89 -0
  901. package/dist/runtime-credential-profiles.js +304 -0
  902. package/dist/runtime-credential-profiles.js.map +1 -0
  903. package/dist/runtime-enroll-notice.d.ts +4 -0
  904. package/dist/runtime-enroll-notice.js +21 -0
  905. package/dist/runtime-enroll-notice.js.map +1 -0
  906. package/dist/runtime-enrollment.d.ts +21 -0
  907. package/dist/runtime-enrollment.js +52 -0
  908. package/dist/runtime-enrollment.js.map +1 -0
  909. package/dist/runtime-general-protocol.d.ts +22 -0
  910. package/dist/runtime-general-protocol.js +57 -0
  911. package/dist/runtime-general-protocol.js.map +1 -0
  912. package/dist/runtime-general-workspace.d.ts +17 -0
  913. package/dist/runtime-general-workspace.js +213 -0
  914. package/dist/runtime-general-workspace.js.map +1 -0
  915. package/dist/runtime-install.d.ts +50 -0
  916. package/dist/runtime-install.js +189 -0
  917. package/dist/runtime-install.js.map +1 -0
  918. package/dist/runtime-pane-assets.d.ts +17 -0
  919. package/dist/runtime-pane-assets.js +23 -0
  920. package/dist/runtime-pane-assets.js.map +1 -0
  921. package/dist/runtime-pane-boot.d.ts +9 -0
  922. package/dist/runtime-pane-boot.js +47 -0
  923. package/dist/runtime-pane-boot.js.map +1 -0
  924. package/dist/runtime-pane-codex-index.d.ts +10 -0
  925. package/dist/runtime-pane-codex-index.js +151 -0
  926. package/dist/runtime-pane-codex-index.js.map +1 -0
  927. package/dist/runtime-pane-config.d.ts +16 -0
  928. package/dist/runtime-pane-config.js +54 -0
  929. package/dist/runtime-pane-config.js.map +1 -0
  930. package/dist/runtime-pane-host.d.ts +63 -0
  931. package/dist/runtime-pane-host.js +467 -0
  932. package/dist/runtime-pane-host.js.map +1 -0
  933. package/dist/runtime-pane-job-owner.d.ts +1 -0
  934. package/dist/runtime-pane-job-owner.js +29 -0
  935. package/dist/runtime-pane-job-owner.js.map +1 -0
  936. package/dist/runtime-pane-job.ps1 +116 -0
  937. package/dist/runtime-pane-link.d.ts +47 -0
  938. package/dist/runtime-pane-link.js +338 -0
  939. package/dist/runtime-pane-link.js.map +1 -0
  940. package/dist/runtime-pane-mcp-protocol.d.ts +32 -0
  941. package/dist/runtime-pane-mcp-protocol.js +39 -0
  942. package/dist/runtime-pane-mcp-protocol.js.map +1 -0
  943. package/dist/runtime-pane-mcp-relay.d.ts +18 -0
  944. package/dist/runtime-pane-mcp-relay.js +80 -0
  945. package/dist/runtime-pane-mcp-relay.js.map +1 -0
  946. package/dist/runtime-pane-mcp.d.ts +55 -0
  947. package/dist/runtime-pane-mcp.js +153 -0
  948. package/dist/runtime-pane-mcp.js.map +1 -0
  949. package/dist/runtime-pane-native.d.ts +75 -0
  950. package/dist/runtime-pane-native.js +114 -0
  951. package/dist/runtime-pane-native.js.map +1 -0
  952. package/dist/runtime-pane-output.d.ts +19 -0
  953. package/dist/runtime-pane-output.js +53 -0
  954. package/dist/runtime-pane-output.js.map +1 -0
  955. package/dist/runtime-pane-port.d.ts +144 -0
  956. package/dist/runtime-pane-port.js +574 -0
  957. package/dist/runtime-pane-port.js.map +1 -0
  958. package/dist/runtime-pane-private.d.ts +16 -0
  959. package/dist/runtime-pane-private.js +76 -0
  960. package/dist/runtime-pane-private.js.map +1 -0
  961. package/dist/runtime-pane-private.ps1 +81 -0
  962. package/dist/runtime-pane-process.d.ts +4 -0
  963. package/dist/runtime-pane-process.js +117 -0
  964. package/dist/runtime-pane-process.js.map +1 -0
  965. package/dist/runtime-pane-protocol.d.ts +182 -0
  966. package/dist/runtime-pane-protocol.js +217 -0
  967. package/dist/runtime-pane-protocol.js.map +1 -0
  968. package/dist/runtime-pane-quota-history.d.ts +6 -0
  969. package/dist/runtime-pane-quota-history.js +44 -0
  970. package/dist/runtime-pane-quota-history.js.map +1 -0
  971. package/dist/runtime-pane-screen.d.ts +19 -0
  972. package/dist/runtime-pane-screen.js +76 -0
  973. package/dist/runtime-pane-screen.js.map +1 -0
  974. package/dist/runtime-pane-service.d.ts +16 -0
  975. package/dist/runtime-pane-service.js +256 -0
  976. package/dist/runtime-pane-service.js.map +1 -0
  977. package/dist/runtime-pane-stdio-protocol.d.ts +54 -0
  978. package/dist/runtime-pane-stdio-protocol.js +94 -0
  979. package/dist/runtime-pane-stdio-protocol.js.map +1 -0
  980. package/dist/runtime-pane-stdio.d.ts +3 -0
  981. package/dist/runtime-pane-stdio.js +123 -0
  982. package/dist/runtime-pane-stdio.js.map +1 -0
  983. package/dist/runtime-pane-store.d.ts +43 -0
  984. package/dist/runtime-pane-store.js +176 -0
  985. package/dist/runtime-pane-store.js.map +1 -0
  986. package/dist/runtime-pane-transcript-protocol.d.ts +43 -0
  987. package/dist/runtime-pane-transcript-protocol.js +58 -0
  988. package/dist/runtime-pane-transcript-protocol.js.map +1 -0
  989. package/dist/runtime-pane-transcript.d.ts +50 -0
  990. package/dist/runtime-pane-transcript.js +666 -0
  991. package/dist/runtime-pane-transcript.js.map +1 -0
  992. package/dist/runtime-pane-worker.d.ts +1 -0
  993. package/dist/runtime-pane-worker.js +167 -0
  994. package/dist/runtime-pane-worker.js.map +1 -0
  995. package/dist/runtime-profile-ownership.d.ts +66 -0
  996. package/dist/runtime-profile-ownership.js +391 -0
  997. package/dist/runtime-profile-ownership.js.map +1 -0
  998. package/dist/runtime-protocol.d.ts +340 -0
  999. package/dist/runtime-protocol.js +179 -0
  1000. package/dist/runtime-protocol.js.map +1 -0
  1001. package/dist/runtime-remote-accounts.d.ts +209 -0
  1002. package/dist/runtime-remote-accounts.js +714 -0
  1003. package/dist/runtime-remote-accounts.js.map +1 -0
  1004. package/dist/runtime-remote-setup.d.ts +108 -0
  1005. package/dist/runtime-remote-setup.js +532 -0
  1006. package/dist/runtime-remote-setup.js.map +1 -0
  1007. package/dist/runtime-signin-transport.d.ts +39 -0
  1008. package/dist/runtime-signin-transport.js +111 -0
  1009. package/dist/runtime-signin-transport.js.map +1 -0
  1010. package/dist/runtime-signin.d.ts +132 -0
  1011. package/dist/runtime-signin.js +290 -0
  1012. package/dist/runtime-signin.js.map +1 -0
  1013. package/dist/runtime-switches.d.ts +79 -0
  1014. package/dist/runtime-switches.js +90 -0
  1015. package/dist/runtime-switches.js.map +1 -0
  1016. package/dist/runtime-transcript-delta-reader.d.ts +23 -0
  1017. package/dist/runtime-transcript-delta-reader.js +74 -0
  1018. package/dist/runtime-transcript-delta-reader.js.map +1 -0
  1019. package/dist/runtime-transcript-source.d.ts +36 -0
  1020. package/dist/runtime-transcript-source.js +189 -0
  1021. package/dist/runtime-transcript-source.js.map +1 -0
  1022. package/dist/runtime-update-activity.d.ts +21 -0
  1023. package/dist/runtime-update-activity.js +51 -0
  1024. package/dist/runtime-update-activity.js.map +1 -0
  1025. package/dist/runtime-update-artifact.d.ts +31 -0
  1026. package/dist/runtime-update-artifact.js +252 -0
  1027. package/dist/runtime-update-artifact.js.map +1 -0
  1028. package/dist/runtime-update-attention.d.ts +4 -0
  1029. package/dist/runtime-update-attention.js +11 -0
  1030. package/dist/runtime-update-attention.js.map +1 -0
  1031. package/dist/runtime-update-controller.d.ts +86 -0
  1032. package/dist/runtime-update-controller.js +743 -0
  1033. package/dist/runtime-update-controller.js.map +1 -0
  1034. package/dist/runtime-update-install.d.ts +31 -0
  1035. package/dist/runtime-update-install.js +205 -0
  1036. package/dist/runtime-update-install.js.map +1 -0
  1037. package/dist/runtime-update-ipc.d.ts +42 -0
  1038. package/dist/runtime-update-ipc.js +144 -0
  1039. package/dist/runtime-update-ipc.js.map +1 -0
  1040. package/dist/runtime-update-journal.d.ts +49 -0
  1041. package/dist/runtime-update-journal.js +128 -0
  1042. package/dist/runtime-update-journal.js.map +1 -0
  1043. package/dist/runtime-update-lock.d.ts +48 -0
  1044. package/dist/runtime-update-lock.js +232 -0
  1045. package/dist/runtime-update-lock.js.map +1 -0
  1046. package/dist/runtime-update-owners.d.ts +29 -0
  1047. package/dist/runtime-update-owners.js +240 -0
  1048. package/dist/runtime-update-owners.js.map +1 -0
  1049. package/dist/runtime-update-protocol.d.ts +15 -0
  1050. package/dist/runtime-update-protocol.js +13 -0
  1051. package/dist/runtime-update-protocol.js.map +1 -0
  1052. package/dist/runtime-update-status.d.ts +30 -0
  1053. package/dist/runtime-update-status.js +31 -0
  1054. package/dist/runtime-update-status.js.map +1 -0
  1055. package/dist/runtime-windows-bridge.d.ts +42 -0
  1056. package/dist/runtime-windows-bridge.js +167 -0
  1057. package/dist/runtime-windows-bridge.js.map +1 -0
  1058. package/dist/scheduler/db.d.ts +3 -0
  1059. package/dist/scheduler/db.js +4 -0
  1060. package/dist/scheduler/db.js.map +1 -1
  1061. package/dist/scheduler/task-board-text.js +1 -1
  1062. package/dist/scheduler/task-board-text.js.map +1 -1
  1063. package/dist/scheduler/task-board.d.ts +4 -0
  1064. package/dist/scheduler/task-board.js +9 -3
  1065. package/dist/scheduler/task-board.js.map +1 -1
  1066. package/dist/scheduler/task-liveness.d.ts +34 -0
  1067. package/dist/scheduler/task-liveness.js +49 -0
  1068. package/dist/scheduler/task-liveness.js.map +1 -0
  1069. package/dist/selection-card.d.ts +4 -3
  1070. package/dist/selection-card.js +2 -1
  1071. package/dist/selection-card.js.map +1 -1
  1072. package/dist/service-drain.d.ts +19 -0
  1073. package/dist/service-drain.js +64 -0
  1074. package/dist/service-drain.js.map +1 -0
  1075. package/dist/service-installer.d.ts +7 -2
  1076. package/dist/service-installer.js +24 -12
  1077. package/dist/service-installer.js.map +1 -1
  1078. package/dist/settings-api.d.ts +71 -2
  1079. package/dist/settings-api.js +1048 -16
  1080. package/dist/settings-api.js.map +1 -1
  1081. package/dist/settings-baseline.d.ts +7 -0
  1082. package/dist/settings-baseline.js +3 -1
  1083. package/dist/settings-baseline.js.map +1 -1
  1084. package/dist/settings-change.d.ts +7 -3
  1085. package/dist/settings-change.js +166 -31
  1086. package/dist/settings-change.js.map +1 -1
  1087. package/dist/settings-confirmation.d.ts +67 -7
  1088. package/dist/settings-confirmation.js +68 -15
  1089. package/dist/settings-confirmation.js.map +1 -1
  1090. package/dist/settings-effect.d.ts +26 -0
  1091. package/dist/settings-effect.js +331 -5
  1092. package/dist/settings-effect.js.map +1 -1
  1093. package/dist/settings-http-confirmation.d.ts +37 -0
  1094. package/dist/settings-http-confirmation.js +162 -15
  1095. package/dist/settings-http-confirmation.js.map +1 -1
  1096. package/dist/settings-request-capability.d.ts +14 -0
  1097. package/dist/settings-request-capability.js +12 -1
  1098. package/dist/settings-request-capability.js.map +1 -1
  1099. package/dist/settings-route-lifetime.d.ts +14 -0
  1100. package/dist/settings-route-lifetime.js +48 -0
  1101. package/dist/settings-route-lifetime.js.map +1 -0
  1102. package/dist/settings-summary.d.ts +24 -0
  1103. package/dist/settings-summary.js +42 -0
  1104. package/dist/settings-summary.js.map +1 -0
  1105. package/dist/settings-transaction.d.ts +4 -0
  1106. package/dist/settings-transaction.js +9 -0
  1107. package/dist/settings-transaction.js.map +1 -1
  1108. package/dist/setup-form.js +6 -3
  1109. package/dist/setup-form.js.map +1 -1
  1110. package/dist/setup-host.js +1 -1
  1111. package/dist/setup-host.js.map +1 -1
  1112. package/dist/setup-i18n.js +3 -0
  1113. package/dist/setup-i18n.js.map +1 -1
  1114. package/dist/setup-wizard.js +4 -2
  1115. package/dist/setup-wizard.js.map +1 -1
  1116. package/dist/signin-keepalive.d.ts +206 -0
  1117. package/dist/signin-keepalive.js +681 -0
  1118. package/dist/signin-keepalive.js.map +1 -0
  1119. package/dist/structured-signin-transport.d.ts +20 -2
  1120. package/dist/structured-signin-transport.js +57 -2
  1121. package/dist/structured-signin-transport.js.map +1 -1
  1122. package/dist/structured-signin.d.ts +11 -2
  1123. package/dist/structured-signin.js +5 -7
  1124. package/dist/structured-signin.js.map +1 -1
  1125. package/dist/task-board-tool.d.ts +2 -1
  1126. package/dist/task-board-tool.js +76 -7
  1127. package/dist/task-board-tool.js.map +1 -1
  1128. package/dist/tmux-binary.d.ts +59 -0
  1129. package/dist/tmux-binary.js +189 -0
  1130. package/dist/tmux-binary.js.map +1 -0
  1131. package/dist/tmux-control.d.ts +2 -1
  1132. package/dist/tmux-control.js +4 -4
  1133. package/dist/tmux-control.js.map +1 -1
  1134. package/dist/tmux-exec-helper.js +32 -1
  1135. package/dist/tmux-exec-helper.js.map +1 -1
  1136. package/dist/tmux-legacy.d.ts +94 -0
  1137. package/dist/tmux-legacy.js +309 -0
  1138. package/dist/tmux-legacy.js.map +1 -0
  1139. package/dist/tmux-manager.d.ts +11 -4
  1140. package/dist/tmux-manager.js +61 -40
  1141. package/dist/tmux-manager.js.map +1 -1
  1142. package/dist/tmux-pane-host.d.ts +26 -0
  1143. package/dist/tmux-pane-host.js +25 -0
  1144. package/dist/tmux-pane-host.js.map +1 -0
  1145. package/dist/tmux-read.js +4 -3
  1146. package/dist/tmux-read.js.map +1 -1
  1147. package/dist/tmux-rollback.d.ts +42 -0
  1148. package/dist/tmux-rollback.js +78 -0
  1149. package/dist/tmux-rollback.js.map +1 -0
  1150. package/dist/tmux-server.d.ts +102 -0
  1151. package/dist/tmux-server.js +248 -0
  1152. package/dist/tmux-server.js.map +1 -0
  1153. package/dist/tool-permissions.js +2 -1
  1154. package/dist/tool-permissions.js.map +1 -1
  1155. package/dist/tool-progress.d.ts +7 -0
  1156. package/dist/tool-progress.js +21 -9
  1157. package/dist/tool-progress.js.map +1 -1
  1158. package/dist/topic-commands.js +9 -5
  1159. package/dist/topic-commands.js.map +1 -1
  1160. package/dist/transcript-delta-reader.d.ts +10 -2
  1161. package/dist/transcript-delta-reader.js +38 -9
  1162. package/dist/transcript-delta-reader.js.map +1 -1
  1163. package/dist/transcript-monitor.d.ts +3 -0
  1164. package/dist/transcript-monitor.js +68 -54
  1165. package/dist/transcript-monitor.js.map +1 -1
  1166. package/dist/transcript-needles.d.ts +42 -0
  1167. package/dist/transcript-needles.js +166 -0
  1168. package/dist/transcript-needles.js.map +1 -0
  1169. package/dist/transcript-records.d.ts +22 -0
  1170. package/dist/transcript-records.js +144 -0
  1171. package/dist/transcript-records.js.map +1 -0
  1172. package/dist/transcript-sources.d.ts +5 -0
  1173. package/dist/transcript-sources.js +11 -79
  1174. package/dist/transcript-sources.js.map +1 -1
  1175. package/dist/types.d.ts +52 -0
  1176. package/dist/ui/account-identity.js +29 -0
  1177. package/dist/ui/accounts-keepalive.js +111 -0
  1178. package/dist/ui/accounts-manage.js +256 -0
  1179. package/dist/ui/accounts-view.js +491 -0
  1180. package/dist/ui/agent-details-settings.js +326 -0
  1181. package/dist/ui/agent-export-dialog.js +170 -0
  1182. package/dist/ui/agent-export-strings.js +81 -0
  1183. package/dist/ui/agent-instructions-field.js +69 -0
  1184. package/dist/ui/agent-page-strings.js +148 -0
  1185. package/dist/ui/agent-proposals.js +90 -0
  1186. package/dist/ui/agent-runtime-settings.js +70 -0
  1187. package/dist/ui/agent-runtime.js +124 -0
  1188. package/dist/ui/backend-signin.js +153 -48
  1189. package/dist/ui/chat-activity-groups.js +225 -0
  1190. package/dist/ui/chat-activity.js +355 -0
  1191. package/dist/ui/chat-ambient.js +1 -1
  1192. package/dist/ui/chat-md-strings.js +3 -9
  1193. package/dist/ui/chat-popout-header.js +35 -0
  1194. package/dist/ui/chat-popout-transport.js +80 -0
  1195. package/dist/ui/chat-popout.js +63 -0
  1196. package/dist/ui/chat-quote.js +22 -17
  1197. package/dist/ui/chat-render.js +3 -682
  1198. package/dist/ui/chat-store.js +84 -11
  1199. package/dist/ui/chat-strings.js +3 -285
  1200. package/dist/ui/chat-thread.js +3 -969
  1201. package/dist/ui/chat-time.js +3 -80
  1202. package/dist/ui/chat-tour.js +2 -2
  1203. package/dist/ui/chat-workspace-gestures.js +177 -0
  1204. package/dist/ui/chat-workspace-navigation.js +149 -0
  1205. package/dist/ui/chat-workspace.js +319 -0
  1206. package/dist/ui/cli-caps.js +15 -0
  1207. package/dist/ui/cli-picker.js +42 -0
  1208. package/dist/ui/credential-profile-select.js +54 -0
  1209. package/dist/ui/effort-field-strings.js +18 -0
  1210. package/dist/ui/fleet-office-dialogue.d.ts +30 -0
  1211. package/dist/ui/fleet-office-dialogue.js +382 -0
  1212. package/dist/ui/fleet-office-levels.js +17 -1
  1213. package/dist/ui/fleet-office-pack.d.ts +19 -1
  1214. package/dist/ui/fleet-office-pack.js +177 -24
  1215. package/dist/ui/fleet-office-skin.js +23 -5
  1216. package/dist/ui/fleet-office-store.js +13 -3
  1217. package/dist/ui/fleet-office-zones.js +124 -9
  1218. package/dist/ui/fleet-office.js +203 -19
  1219. package/dist/ui/fleet-task-card.js +8 -4
  1220. package/dist/ui/fleet-task-common.js +2 -2
  1221. package/dist/ui/fleet-task-menu.js +188 -0
  1222. package/dist/ui/fleet-task-stats.js +124 -0
  1223. package/dist/ui/fleet-task-view.js +340 -0
  1224. package/dist/ui/fleet-tasks.js +125 -39
  1225. package/dist/ui/general-location.js +85 -0
  1226. package/dist/ui/host-install.js +290 -0
  1227. package/dist/ui/html-attachment.js +3 -40
  1228. package/dist/ui/hub-agent-copy.js +23 -0
  1229. package/dist/ui/hub-attachments.js +90 -0
  1230. package/dist/ui/hub-button-actions.js +65 -0
  1231. package/dist/ui/hub-chat-store.js +168 -0
  1232. package/dist/ui/hub-chat-strings.js +79 -0
  1233. package/dist/ui/hub-client.js +470 -0
  1234. package/dist/ui/hub-company-join-strings.js +79 -0
  1235. package/dist/ui/hub-company-join.js +178 -0
  1236. package/dist/ui/hub-confirm-place.js +44 -0
  1237. package/dist/ui/hub-directory-editor-strings.js +56 -0
  1238. package/dist/ui/hub-directory-editor.js +163 -0
  1239. package/dist/ui/hub-directory-notice-strings.js +28 -0
  1240. package/dist/ui/hub-directory-notices.js +66 -0
  1241. package/dist/ui/hub-enrolment-code-strings.js +44 -0
  1242. package/dist/ui/hub-enrolment-code.js +159 -0
  1243. package/dist/ui/hub-grant-strings.js +13 -0
  1244. package/dist/ui/hub-group-policy.js +183 -0
  1245. package/dist/ui/hub-group-search.js +82 -0
  1246. package/dist/ui/hub-group-strings.js +110 -0
  1247. package/dist/ui/hub-host-security-notices.js +28 -0
  1248. package/dist/ui/hub-join-approval.js +31 -0
  1249. package/dist/ui/hub-join-code-input.js +66 -0
  1250. package/dist/ui/hub-join-one-strings.js +131 -0
  1251. package/dist/ui/hub-join-queue.js +62 -0
  1252. package/dist/ui/hub-join-steps.js +231 -0
  1253. package/dist/ui/hub-joincode-flow-strings.js +22 -0
  1254. package/dist/ui/hub-owner-strings.js +56 -0
  1255. package/dist/ui/hub-pairing-progress-strings.js +15 -0
  1256. package/dist/ui/hub-preview.js +101 -0
  1257. package/dist/ui/hub-provider-guidance.js +31 -0
  1258. package/dist/ui/hub-quick-pairing.js +213 -0
  1259. package/dist/ui/hub-quick-strings.js +43 -0
  1260. package/dist/ui/hub-quota.js +85 -0
  1261. package/dist/ui/hub-read-strings.js +7 -0
  1262. package/dist/ui/hub-share-refused.js +17 -0
  1263. package/dist/ui/hub-strings.js +168 -0
  1264. package/dist/ui/hub-switcher.js +27 -0
  1265. package/dist/ui/hub-this-hub.js +113 -0
  1266. package/dist/ui/hub-welcome.js +123 -0
  1267. package/dist/ui/image-annotate.js +283 -0
  1268. package/dist/ui/image-lightbox.js +36 -8
  1269. package/dist/ui/log-row.js +327 -0
  1270. package/dist/ui/machine-signin.js +56 -0
  1271. package/dist/ui/model-picker.js +18 -14
  1272. package/dist/ui/native-instance-settings.js +81 -0
  1273. package/dist/ui/native-pane-recovery.js +45 -0
  1274. package/dist/ui/office-share-page.js +4 -2
  1275. package/dist/ui/panel-chat.js +391 -123
  1276. package/dist/ui/panel-details.js +55 -18
  1277. package/dist/ui/panel-fleet.js +113 -20
  1278. package/dist/ui/panel-hub.js +1003 -0
  1279. package/dist/ui/panel-log.js +16 -158
  1280. package/dist/ui/panel-needs.js +175 -9
  1281. package/dist/ui/panel-runtimes.js +645 -0
  1282. package/dist/ui/panel-settings.js +366 -217
  1283. package/dist/ui/panel-windows-agent.js +87 -0
  1284. package/dist/ui/panel-windows-cli.js +189 -0
  1285. package/dist/ui/preview-pages.js +3 -41
  1286. package/dist/ui/preview-panel-actions.js +3 -161
  1287. package/dist/ui/preview-panel.js +11 -550
  1288. package/dist/ui/preview-versions.js +3 -155
  1289. package/dist/ui/preview.js +3 -476
  1290. package/dist/ui/provider-marks.js +83 -0
  1291. package/dist/ui/runtime-catalog.js +55 -0
  1292. package/dist/ui/runtime-cli-install.js +214 -0
  1293. package/dist/ui/runtime-commands.d.ts +6 -0
  1294. package/dist/ui/runtime-commands.js +92 -0
  1295. package/dist/ui/runtime-update-commands.d.ts +2 -0
  1296. package/dist/ui/runtime-update-commands.js +11 -0
  1297. package/dist/ui/runtime-update-status.js +53 -0
  1298. package/dist/ui/search-dialog.js +4 -0
  1299. package/dist/ui/settings-access-overview.js +188 -0
  1300. package/dist/ui/settings-access-strings.js +42 -0
  1301. package/dist/ui/settings-agent-filters.js +94 -0
  1302. package/dist/ui/settings-appearance.js +122 -23
  1303. package/dist/ui/settings-apply.js +12 -5
  1304. package/dist/ui/settings-build-version.js +35 -0
  1305. package/dist/ui/settings-catalog.js +68 -16
  1306. package/dist/ui/settings-confirm.js +112 -14
  1307. package/dist/ui/settings-devices.js +283 -0
  1308. package/dist/ui/settings-dialogs.js +360 -140
  1309. package/dist/ui/settings-guests.js +25 -11
  1310. package/dist/ui/settings-hub-browser-certificate.js +76 -0
  1311. package/dist/ui/settings-hub-company-join.js +281 -0
  1312. package/dist/ui/settings-hub-connection.js +175 -0
  1313. package/dist/ui/settings-hub-directory.js +29 -0
  1314. package/dist/ui/settings-hub-membership.js +93 -0
  1315. package/dist/ui/settings-hub-preview.js +74 -0
  1316. package/dist/ui/settings-hub-retention.js +54 -0
  1317. package/dist/ui/settings-hub-run.js +61 -0
  1318. package/dist/ui/settings-hub-section.js +67 -0
  1319. package/dist/ui/settings-hub-setup-strings.js +70 -0
  1320. package/dist/ui/settings-hub-setup.js +233 -0
  1321. package/dist/ui/settings-hub.js +301 -0
  1322. package/dist/ui/settings-layout.js +248 -0
  1323. package/dist/ui/settings-level-titles.js +73 -0
  1324. package/dist/ui/settings-model.js +26 -2
  1325. package/dist/ui/settings-named-test.js +2 -2
  1326. package/dist/ui/settings-outside.js +310 -0
  1327. package/dist/ui/settings-public-session-strings.js +37 -0
  1328. package/dist/ui/settings-quota-notice.js +3 -3
  1329. package/dist/ui/settings-registry.js +30 -5
  1330. package/dist/ui/settings-restart-strings.js +17 -0
  1331. package/dist/ui/settings-revoke-strings.js +28 -0
  1332. package/dist/ui/settings-shared-strings.js +161 -0
  1333. package/dist/ui/settings-shared.js +354 -0
  1334. package/dist/ui/settings-shortcuts.js +65 -0
  1335. package/dist/ui/settings-strings.js +129 -48
  1336. package/dist/ui/settings-web-authority.js +27 -14
  1337. package/dist/ui/shared/access-overview.css +48 -0
  1338. package/dist/ui/shared/accounts-keepalive.css +12 -0
  1339. package/dist/ui/shared/accounts.css +88 -0
  1340. package/dist/ui/shared/agend-auth.js +8 -1
  1341. package/dist/ui/shared/app-ctx.js +22 -1
  1342. package/dist/ui/shared/app-i18n.js +17 -16
  1343. package/dist/ui/shared/app-nav.js +34 -11
  1344. package/dist/ui/shared/app-route.js +12 -3
  1345. package/dist/ui/shared/app-session.js +17 -12
  1346. package/dist/ui/shared/app-shell.js +462 -57
  1347. package/dist/ui/shared/app-store.js +3 -0
  1348. package/dist/ui/shared/app-stream.js +3 -1
  1349. package/dist/ui/shared/app.css +1780 -39
  1350. package/dist/ui/shared/app.js +35 -3
  1351. package/dist/ui/shared/chat-composer.js +74 -0
  1352. package/dist/ui/shared/chat-md-strings.js +9 -0
  1353. package/dist/ui/shared/chat-render.js +703 -0
  1354. package/dist/ui/shared/chat-strings.js +333 -0
  1355. package/dist/ui/shared/chat-thread.js +986 -0
  1356. package/dist/ui/shared/chat-time.js +80 -0
  1357. package/dist/ui/shared/chat-work-bar.css +12 -0
  1358. package/dist/ui/shared/chat-workspace-memory.js +14 -0
  1359. package/dist/ui/shared/chat-workspace-model.js +106 -0
  1360. package/dist/ui/shared/device-roles.js +27 -0
  1361. package/dist/ui/shared/header-tools.js +9 -9
  1362. package/dist/ui/shared/host-install.css +10 -0
  1363. package/dist/ui/shared/html-attachment.js +42 -0
  1364. package/dist/ui/shared/hub-chat.css +98 -0
  1365. package/dist/ui/shared/hub-groups.css +28 -0
  1366. package/dist/ui/shared/hub-owner.css +65 -0
  1367. package/dist/ui/shared/hub-quota.css +8 -0
  1368. package/dist/ui/shared/hub-signin.css +24 -0
  1369. package/dist/ui/shared/hub.css +78 -0
  1370. package/dist/ui/shared/identity-color.js +9 -3
  1371. package/dist/ui/shared/image-annotate.css +45 -0
  1372. package/dist/ui/shared/instance-nav.js +94 -21
  1373. package/dist/ui/shared/instance-switch.js +12 -4
  1374. package/dist/ui/shared/machine-name.js +13 -0
  1375. package/dist/ui/shared/model-picker.css +13 -1
  1376. package/dist/ui/shared/page-head.js +8 -0
  1377. package/dist/ui/shared/pane-geometry.js +29 -0
  1378. package/dist/ui/shared/panel-view.js +39 -26
  1379. package/dist/ui/shared/preview-pages.js +41 -0
  1380. package/dist/ui/shared/preview-panel-actions.js +168 -0
  1381. package/dist/ui/shared/preview-panel.js +576 -0
  1382. package/dist/ui/shared/preview-versions.js +155 -0
  1383. package/dist/ui/shared/preview.js +476 -0
  1384. package/dist/ui/shared/qrcode.module.js +2237 -0
  1385. package/dist/ui/shared/runtime-install.css +55 -0
  1386. package/dist/ui/shared/settings-width.js +31 -0
  1387. package/dist/ui/shared/side-rail.js +15 -0
  1388. package/dist/ui/shared/signin.js +392 -34
  1389. package/dist/ui/shared/task-board.css +95 -0
  1390. package/dist/ui/shared/tokens.css +15 -0
  1391. package/dist/ui/shared/ui-dialog.js +2 -2
  1392. package/dist/ui/shared/ui-menu.js +54 -13
  1393. package/dist/ui/shared/usage-dialog.js +3 -72
  1394. package/dist/ui/shared/usage-meter.js +84 -0
  1395. package/dist/ui/shared/vendor/qrcode-generator.LICENSE +27 -0
  1396. package/dist/ui/shared/vendor/vendor.json +19 -2
  1397. package/dist/ui/shared/view-roster-store.js +8 -0
  1398. package/dist/ui/shared/view-strings.js +14 -4
  1399. package/dist/ui/shared/web-authorize.js +53 -3
  1400. package/dist/ui/shared/workspace-follow.css +19 -0
  1401. package/dist/ui/shared/workspace.css +20 -0
  1402. package/dist/ui/signin.html +41 -8
  1403. package/dist/ui/structured-signin.js +74 -17
  1404. package/dist/ui/windows-agents-nav.js +2 -0
  1405. package/dist/ui/windows-cli-catalog.js +108 -0
  1406. package/dist/ui/workspace-follow-strings.js +28 -0
  1407. package/dist/ui/workspace-panel.js +378 -0
  1408. package/dist/ui/workspace-strings.js +35 -0
  1409. package/dist/unattended-install.js +2 -1
  1410. package/dist/unattended-install.js.map +1 -1
  1411. package/dist/update-dispatch.d.ts +62 -0
  1412. package/dist/update-dispatch.js +69 -2
  1413. package/dist/update-dispatch.js.map +1 -1
  1414. package/dist/update-install.d.ts +7 -0
  1415. package/dist/update-install.js +23 -0
  1416. package/dist/update-install.js.map +1 -1
  1417. package/dist/update-marker.d.ts +2 -0
  1418. package/dist/update-marker.js.map +1 -1
  1419. package/dist/usage/providers.d.ts +2 -0
  1420. package/dist/usage/providers.js +20 -19
  1421. package/dist/usage/providers.js.map +1 -1
  1422. package/dist/usage/usage-api.d.ts +1 -1
  1423. package/dist/usage/usage-api.js +3 -10
  1424. package/dist/usage/usage-api.js.map +1 -1
  1425. package/dist/view-api.js +5 -7
  1426. package/dist/view-api.js.map +1 -1
  1427. package/dist/web-api.d.ts +168 -4
  1428. package/dist/web-api.js +1611 -268
  1429. package/dist/web-api.js.map +1 -1
  1430. package/dist/web-backend-login.d.ts +50 -6
  1431. package/dist/web-backend-login.js +32 -21
  1432. package/dist/web-backend-login.js.map +1 -1
  1433. package/dist/web-chat-history.d.ts +30 -2
  1434. package/dist/web-chat-history.js +81 -4
  1435. package/dist/web-chat-history.js.map +1 -1
  1436. package/dist/web-commands.d.ts +10 -1
  1437. package/dist/web-commands.js +1 -1
  1438. package/dist/web-commands.js.map +1 -1
  1439. package/dist/web-device-login.d.ts +153 -0
  1440. package/dist/web-device-login.js +278 -0
  1441. package/dist/web-device-login.js.map +1 -0
  1442. package/dist/web-guest-access.js +2 -2
  1443. package/dist/web-guest-access.js.map +1 -1
  1444. package/dist/web-host-install.d.ts +127 -0
  1445. package/dist/web-host-install.js +165 -0
  1446. package/dist/web-host-install.js.map +1 -0
  1447. package/dist/web-login.d.ts +35 -1
  1448. package/dist/web-login.js +51 -5
  1449. package/dist/web-login.js.map +1 -1
  1450. package/dist/web-model-groups.d.ts +40 -0
  1451. package/dist/web-model-groups.js +70 -0
  1452. package/dist/web-model-groups.js.map +1 -0
  1453. package/dist/web-notices.d.ts +9 -0
  1454. package/dist/web-notices.js +19 -0
  1455. package/dist/web-notices.js.map +1 -1
  1456. package/dist/web-office-skins.d.ts +9 -0
  1457. package/dist/web-office-skins.js +16 -1
  1458. package/dist/web-office-skins.js.map +1 -1
  1459. package/dist/web-office-store.d.ts +35 -2
  1460. package/dist/web-office-store.js +64 -15
  1461. package/dist/web-office-store.js.map +1 -1
  1462. package/dist/web-only-fleet.d.ts +20 -0
  1463. package/dist/web-only-fleet.js +21 -0
  1464. package/dist/web-only-fleet.js.map +1 -1
  1465. package/dist/web-remote-access.d.ts +341 -0
  1466. package/dist/web-remote-access.js +801 -0
  1467. package/dist/web-remote-access.js.map +1 -0
  1468. package/dist/web-session.d.ts +94 -3
  1469. package/dist/web-session.js +75 -5
  1470. package/dist/web-session.js.map +1 -1
  1471. package/dist/web-settings-patch.d.ts +10 -2
  1472. package/dist/web-settings-patch.js +25 -10
  1473. package/dist/web-settings-patch.js.map +1 -1
  1474. package/dist/web-shell-routes.d.ts +10 -1
  1475. package/dist/web-shell-routes.js +14 -2
  1476. package/dist/web-shell-routes.js.map +1 -1
  1477. package/dist/web-signin-device.d.ts +16 -0
  1478. package/dist/web-signin-device.js +81 -0
  1479. package/dist/web-signin-device.js.map +1 -0
  1480. package/dist/web-signin-link.d.ts +42 -0
  1481. package/dist/web-signin-link.js +110 -0
  1482. package/dist/web-signin-link.js.map +1 -0
  1483. package/dist/web-terminal.d.ts +11 -30
  1484. package/dist/web-terminal.js +23 -8
  1485. package/dist/web-terminal.js.map +1 -1
  1486. package/dist/web-update.d.ts +1 -0
  1487. package/dist/web-update.js +4 -2
  1488. package/dist/web-update.js.map +1 -1
  1489. package/dist/windows-agents.d.ts +127 -0
  1490. package/dist/windows-agents.js +491 -0
  1491. package/dist/windows-agents.js.map +1 -0
  1492. package/dist/windows-cli-api.d.ts +48 -0
  1493. package/dist/windows-cli-api.js +207 -0
  1494. package/dist/windows-cli-api.js.map +1 -0
  1495. package/dist/windows-cli-providers.d.ts +109 -0
  1496. package/dist/windows-cli-providers.js +396 -0
  1497. package/dist/windows-cli-providers.js.map +1 -0
  1498. package/dist/windows-cli-worker.d.ts +99 -0
  1499. package/dist/windows-cli-worker.js +729 -0
  1500. package/dist/windows-cli-worker.js.map +1 -0
  1501. package/dist/windows-cli.d.ts +130 -0
  1502. package/dist/windows-cli.js +424 -0
  1503. package/dist/windows-cli.js.map +1 -0
  1504. package/dist/windows-native-mcp.d.ts +19 -0
  1505. package/dist/windows-native-mcp.js +143 -0
  1506. package/dist/windows-native-mcp.js.map +1 -0
  1507. package/dist/windows-pane-mcp.d.ts +26 -0
  1508. package/dist/windows-pane-mcp.js +187 -0
  1509. package/dist/windows-pane-mcp.js.map +1 -0
  1510. package/dist/windows-shortcuts.d.ts +29 -5
  1511. package/dist/windows-shortcuts.js +52 -9
  1512. package/dist/windows-shortcuts.js.map +1 -1
  1513. package/dist/workspace-file-policy.d.ts +2 -0
  1514. package/dist/workspace-file-policy.js +31 -0
  1515. package/dist/workspace-file-policy.js.map +1 -0
  1516. package/dist/workspace-follow-parse.d.ts +36 -0
  1517. package/dist/workspace-follow-parse.js +208 -0
  1518. package/dist/workspace-follow-parse.js.map +1 -0
  1519. package/dist/workspace-follow-records.d.ts +17 -0
  1520. package/dist/workspace-follow-records.js +88 -0
  1521. package/dist/workspace-follow-records.js.map +1 -0
  1522. package/dist/workspace-follow.d.ts +41 -0
  1523. package/dist/workspace-follow.js +144 -0
  1524. package/dist/workspace-follow.js.map +1 -0
  1525. package/dist/wsl-detect.d.ts +1 -0
  1526. package/dist/wsl-detect.js +20 -0
  1527. package/dist/wsl-detect.js.map +1 -0
  1528. package/dist/yaml-shared-nodes.js +8 -3
  1529. package/dist/yaml-shared-nodes.js.map +1 -1
  1530. package/launcher/agend-install.cjs +15 -2
  1531. package/launcher/launchd-session-type.cjs +14 -0
  1532. package/launcher/postinstall.cjs +27 -2
  1533. package/launcher/tmux-bundle.cjs +263 -0
  1534. package/package.json +16 -5
  1535. package/templates/icons/agend-restart.ico +0 -0
  1536. package/templates/icons/agend.ico +0 -0
  1537. package/templates/launchd.plist.ejs +3 -1
  1538. package/templates/runtime-assets/conpty-LICENSE +21 -0
  1539. package/templates/runtime-assets/conpty-NOTICE.md +503 -0
  1540. package/templates/runtime-assets/local-pane-stage.ps1 +101 -0
  1541. package/templates/runtime-assets/runtime-pane-job.ps1 +116 -0
  1542. package/templates/runtime-assets/runtime-pane-private.ps1 +81 -0
  1543. package/templates/runtime-assets/xterm-LICENSE +21 -0
  1544. package/templates/runtime-install/install.ps1 +618 -0
  1545. package/templates/windows-shortcuts.ps1 +45 -12
package/dist/daemon.js CHANGED
@@ -1,3 +1,5 @@
1
+ import { nativePaneToolRefusal } from "./native-pane-tools.js";
2
+ import { generalByName } from "./general-instance.js";
1
3
  import { codexMetadataHomes } from "./backend/codex-metadata.js";
2
4
  import { claudeMinimumError, cliVersionBelow } from "./claude-model-minimum.js";
3
5
  import { quotaNoticeProblem } from "./quota-notice-config.js";
@@ -24,8 +26,9 @@ import { assertNoSessionOomStop, readSessionOomStop, writeSessionOomStop, Sessio
24
26
  import { mcpServerState } from "./mcp-liveness.js";
25
27
  import { clearPausedMarker, writePausedMarker } from "./pause-marker.js";
26
28
  import { writeBackgroundWorkEndedMarker } from "./background-work-ended.js";
27
- import { TmuxManager, resolveTmuxLogicalSize } from "./tmux-manager.js";
29
+ import { resolveTmuxLogicalSize, TmuxManager } from "./tmux-manager.js";
28
30
  import { TranscriptMonitor } from "./transcript-monitor.js";
31
+ import { FollowLog } from "./workspace-follow.js";
29
32
  import { createTranscriptSource } from "./transcript-sources.js";
30
33
  import { TranscriptTurnLedger } from "./transcript-turns.js";
31
34
  import { credentialProfileStoreHome, resolveCredentialProfile } from "./backend/credential-profile.js";
@@ -33,6 +36,8 @@ import { resolveToolSet, toolsFor } from "./tool-permissions.js";
33
36
  import { TOOLS } from "./channel/mcp-tools.js";
34
37
  import { dashboardAccessProblem, dashboardFeaturesOff, withoutFeatures } from "./dashboard-permissions.js";
35
38
  import { getAgendHome } from "./paths.js";
39
+ import { legacyTmuxSocket, tmuxSocket } from "./tmux-binary.js";
40
+ import { migrateLegacyWindow, tagWindowId } from "./tmux-legacy.js";
36
41
  import { scopedFleetConfigEnvironment } from "./web-experimental.js";
37
42
  import { readAgentFile } from "./agent-file-read.js";
38
43
  import { ASSET_UPLOAD_MAX_BYTES, receivePreview, sendAssetInParts, writePreview } from "./web-asset-parts.js";
@@ -52,6 +57,7 @@ import { HangDetector } from "./hang-detector.js";
52
57
  import { writeSecretFile } from "./secret-file.js";
53
58
  import { PaneWriteLock } from "./pane-write-lock.js";
54
59
  import { answerRemoteCard } from "./remote-card-answer.js";
60
+ import { tmuxPaneHost } from "./tmux-pane-host.js";
55
61
  import { buildFleetInstructions } from "./instructions.js";
56
62
  import { formatHumanInboundMessage, prepareDeliveryWire, steerInboundEnvelope, BTW_INBOUND_PREFIX, humanBodyHash, humanOwnerObjectId } from "./human-delivery-receipts.js";
57
63
  import { formatCrossInstanceInboundMessage, renderCrossInstanceHandoffMetadata, } from "./cross-instance-envelope.js";
@@ -61,6 +67,7 @@ import { CLAUDE_CREDIT_BALANCE_LOW, CLAUDE_MODEL_USAGE_LIMIT, CLAUDE_USAGE_LIMIT
61
67
  import { t } from "./locale.js";
62
68
  import { claudeResetInstant, claudeResetTime, quotaPausedLine } from "./quota-notice.js";
63
69
  import { MuseUsageRelay, clearMuseUsageSnapshot } from "./muse-usage-relay.js";
70
+ import { reconcileNativePaneTarget } from "./native-pane-reconciliation.js";
64
71
  import { deliveryContentDigest } from "./delivery-outbox.js";
65
72
  import { consumedWatches } from "./delivery-consumed-watch.js";
66
73
  import { queueResumePolicyForAttempt } from "./delivery-queue-evidence.js";
@@ -68,6 +75,7 @@ import { markerConsumed, scanTranscriptForDeliveryMarker } from "./delivery-reco
68
75
  import { QUEUED_HANDOFF_MAX_REDELIVERIES, QueuedHandoffStore } from "./queued-handoffs.js";
69
76
  import { measureSyncWork, noteSyncWork } from "./sync-work-attribution.js";
70
77
  import { TranscriptDeltaReader } from "./transcript-delta-reader.js";
78
+ import { checkpointCodexPane } from "./codex-pane-ownership.js";
71
79
  import { buildResumeContinuation, clearInFlightTurnMarker, consumeInFlightTurnMarker, decideTurnResume, normalizeResumeBackend, readResumeFingerprint, RESUME_BLOCKING_DELIVERY_STATES, writeInFlightTurnMarker, } from "./turn-resume.js";
72
80
  import { codexLiveRowMatches } from "./backend/codex.js";
73
81
  import { codexPackageProblemMessage } from "./backend/codex-package.js";
@@ -1120,6 +1128,7 @@ export class Daemon extends EventEmitter {
1120
1128
  spawnGate;
1121
1129
  stormWindow;
1122
1130
  backendOutage;
1131
+ paneTransport;
1123
1132
  /** #1314: fleet-directory fallbacks already reported to the topic (once per daemon, per field and path). */
1124
1133
  promptFileFallbackNoticed = new Set();
1125
1134
  /** Identity of this live Daemon object; changes on object stop/restart. */
@@ -1136,7 +1145,7 @@ export class Daemon extends EventEmitter {
1136
1145
  /** Optional read-only child lane: only a current owned tmux launch, never stopped/native/cwd discovery. */
1137
1146
  subagentSource() {
1138
1147
  const backend = this.config.backend ?? "claude-code", path = this.logTranscriptPath();
1139
- if ((backend !== "claude-code" && backend !== "codex") || !path || !this.tmux || this.processStatus !== "running"
1148
+ if (this.nativePaneLifecycle || (backend !== "claude-code" && backend !== "codex") || !path || !this.tmux || this.processStatus !== "running"
1140
1149
  || this.spawning || this.runtimeMonitorsFrozen)
1141
1150
  return null;
1142
1151
  const cwd = this.config.working_directory || process.cwd();
@@ -1822,6 +1831,7 @@ export class Daemon extends EventEmitter {
1822
1831
  // still booting. Its new tmux window starts empty before resume restores the
1823
1832
  // old transcript, so pre-ready scans must not lower this seeded baseline.
1824
1833
  seededErrorCountBaselines = new Map();
1834
+ nativeQuotaReplayTaken = false;
1825
1835
  quotaReplay = null;
1826
1836
  paneQuotaPatterns() {
1827
1837
  if (!["codex", "grok"].includes(this.backend?.binaryName ?? ""))
@@ -1857,7 +1867,11 @@ export class Daemon extends EventEmitter {
1857
1867
  }
1858
1868
  /** Before admission, this launch may absorb ONLY rows positively known before its resume. */
1859
1869
  takeQuotaReplayBaseline(pane) {
1860
- const history = this.quotaReplay;
1870
+ // Native captures carry only a runner-frozen pre-launch proof, revalidated with this capture's owner and seq.
1871
+ const native = !this.nativeQuotaReplayTaken ? this.nativePaneLifecycle?.quotaReplayHistory?.() : null;
1872
+ if (this.nativePaneLifecycle)
1873
+ this.nativeQuotaReplayTaken = true;
1874
+ const history = this.quotaReplay ?? (native ? { ...native, spawn: this.spawnGeneration, fence: this.launchFenceEpoch, attempt: this.launchAttempt } : null);
1861
1875
  if (!history)
1862
1876
  return;
1863
1877
  this.quotaReplay = null;
@@ -1923,14 +1937,23 @@ export class Daemon extends EventEmitter {
1923
1937
  static USAGE_PAUSE_NOTICE_WINDOW_MS = 30 * 60_000;
1924
1938
  /** The usage-pause notice told last: when (monotonic), Claude's words for the reset, and that reset (wall clock). */
1925
1939
  usagePauseNotice = null;
1940
+ /** Coarse status for the representative quota hint; never exports model names or transcript text. */
1941
+ quotaPaused() {
1942
+ if (this.usageLimitHold)
1943
+ return true;
1944
+ const pause = this.usagePauseNotice;
1945
+ return !!pause && (pause.resetAt === null
1946
+ ? performance.now() - pause.at < Daemon.USAGE_PAUSE_NOTICE_WINDOW_MS
1947
+ : Date.now() < pause.resetAt);
1948
+ }
1949
+ /** #3186 review: the lifecycle's second opinion dropped the notice (usage has capacity): nothing was told. */
1950
+ clearUsagePauseNotice() { this.usagePauseNotice = null; }
1926
1951
  /**
1927
1952
  * #2834 (#816): Claude paused itself until its usage window opens — the same notice the screen pattern gave. `at`: when
1928
1953
  * Claude wrote it (its record's timestamp). One notice per pause: a reset time already past is not this pause (an old
1929
1954
  * note), and its repeats ("reached again") within the window — or naming the same reset, until it comes — say nothing
1930
1955
  * more. Claude's own "Usage limit reset" ends it.
1931
1956
  */
1932
- /** #3186 review: the lifecycle's second opinion dropped the notice (usage has capacity): nothing was told. */
1933
- clearUsagePauseNotice() { this.usagePauseNotice = null; }
1934
1957
  noteClaudeInformational(text, at = null) {
1935
1958
  const line = text.trim();
1936
1959
  if (Daemon.USAGE_LIMIT_RESET.test(line)) {
@@ -2089,9 +2112,94 @@ export class Daemon extends EventEmitter {
2089
2112
  this.errorRecoveryDeadlineAt = 0;
2090
2113
  this.activeErrorPatternKey = null;
2091
2114
  }
2115
+ /** Lazy default also preserves bare-prototype diagnostic/test construction. */
2116
+ get paneHost() { return this.paneTransport ?? tmuxPaneHost; }
2117
+ nativePaneLifecycle;
2118
+ nativeFleetBridge;
2119
+ nativeTranscriptSource;
2120
+ usesNativePane() { return !!this.nativePaneLifecycle; }
2121
+ /** cc3ce4fe: the CLI version this pane's launch actually ran, as its helper recorded it (undefined: not known). */
2122
+ nativePaneCliVersion() { try {
2123
+ return this.nativePaneLifecycle?.snapshot?.()?.cliVersion;
2124
+ }
2125
+ catch {
2126
+ return undefined;
2127
+ } }
2128
+ logNativeInputRefusal(details) {
2129
+ this.logger.warn({ component: "runtime-pane-host", reason: "expected_seq_changed", ...details }, "Native pane input refused before write");
2130
+ }
2131
+ logNativeToolFailure(details) {
2132
+ const turn = this.turnReplyGuard.snapshot();
2133
+ this.logger.warn({ ...details, currentMessageId: turn?.target.messageId ?? null,
2134
+ guardGeneration: turn?.generation ?? null, guardPhase: turn?.phase ?? null }, "Native pane tool operation failed");
2135
+ }
2136
+ nativePaneCurrent() { return this.nativePaneLifecycle?.current() ?? false; }
2137
+ nativeEnterHold = null;
2138
+ /** Per-launch attention for a native delivery whose bounded input attempts were refused or uncertain, including non-outbox input. */
2139
+ nativeDeliveryHold() {
2140
+ const hold = this.nativeEnterHold;
2141
+ return hold && this.nativePaneLifecycle && !this.deliveryWritesStopping && hold.spawn === this.spawnGeneration && hold.fence === this.launchFenceEpoch
2142
+ ? { key: hold.key, since: hold.since } : null;
2143
+ }
2144
+ nativePaneHasExited() {
2145
+ const snapshot = this.nativePaneLifecycle?.snapshot?.();
2146
+ return snapshot?.state === "exited" && snapshot.instance === this.name && this.tmux?.getWindowId() === snapshot.paneId;
2147
+ }
2148
+ /** Positive native exit evidence only, fenced to this exact launch and Daemon owner. */
2149
+ nativePaneExitCurrent(snapshot, owner) {
2150
+ const actual = this.nativePaneLifecycle?.snapshot?.();
2151
+ return !!actual && actual.state === "exited" && snapshot.state === "exited"
2152
+ && sameInteractionOwner(owner, this.interactionOwner()) && !this.runtimeMonitorsFrozen && !this.startupAborted
2153
+ && ["hostBootId", "paneId", "launchId", "agentId", "instance", "sessionId", "commandSequence", "exitCode"].every(key => actual[key] === snapshot[key])
2154
+ && this.tmux?.getWindowId() === snapshot.paneId;
2155
+ }
2156
+ async reconcileNativeDeliveries(outbox, current) {
2157
+ if (!this.nativePaneLifecycle)
2158
+ return false;
2159
+ return reconcileNativePaneTarget(outbox, this.name, this.nativePaneLifecycle, current);
2160
+ }
2161
+ /** Same-process transport for the owned native daemon; never exposed as a runner RPC. */
2162
+ setNativeFleetBridge(bridge) {
2163
+ if (!this.nativePaneLifecycle || this.nativeFleetBridge?.current())
2164
+ throw Error("Native Fleet bridge requires one bound pane owner");
2165
+ this.nativeFleetBridge = bridge;
2166
+ }
2167
+ /** Fleet admission and generation checks happen before this synchronous handoff. */
2168
+ acceptNativeFleetMessage(message) {
2169
+ if (!this.nativePaneLifecycle || !this.nativeFleetBridge?.current() || this.deliveryWritesStopping || this.runtimeMonitorsFrozen)
2170
+ return false;
2171
+ if (typeof message.type === "string" && FLEET_RESPONSE_TYPES.has(message.type)) {
2172
+ this.routeFleetResponse(message);
2173
+ return true;
2174
+ }
2175
+ const bridge = this.nativeFleetBridge;
2176
+ const current = () => this.nativeFleetBridge === bridge && bridge.current() && !this.deliveryWritesStopping && !this.runtimeMonitorsFrozen;
2177
+ return this.handleFleetMessage(message, reply => { if (current())
2178
+ this.broadcastFleetMessage(reply); }, current);
2179
+ }
2180
+ broadcastFleetMessage(message) {
2181
+ if (this.nativePaneLifecycle) {
2182
+ if (this.nativeFleetBridge?.current() && !this.runtimeMonitorsFrozen && !this.deliveryWritesStopping)
2183
+ this.nativeFleetBridge.send(message);
2184
+ }
2185
+ else
2186
+ this.ipcServer?.broadcast(message);
2187
+ }
2188
+ fleetTransportAvailable() {
2189
+ return this.nativePaneLifecycle ? !!this.nativeFleetBridge?.current() && !this.runtimeMonitorsFrozen : !!this.ipcServer;
2190
+ }
2191
+ /** Internal lifecycle injection, before start. Native paths and provider files stay on their runner. */
2192
+ setNativePaneLifecycle(native) {
2193
+ if (this.tmux || this.ipcServer || this.nativePaneLifecycle)
2194
+ throw Error("Native pane adapter must be bound before daemon startup");
2195
+ this.nativePaneLifecycle = native;
2196
+ this.backend = native.backend;
2197
+ this.paneTransport = native.host;
2198
+ this.controlClient = native.observation;
2199
+ }
2092
2200
  constructor(name, config, instanceDir, topicMode = false, backend, controlClient, rootLogger, runtimeIdentity, spawnGate, stormWindow,
2093
2201
  /** Fleet-level "is this CLI's backend down?" memory — see backend-outage.ts. */
2094
- backendOutage) {
2202
+ backendOutage, paneTransport) {
2095
2203
  super();
2096
2204
  this.name = name;
2097
2205
  this.config = config;
@@ -2103,6 +2211,7 @@ export class Daemon extends EventEmitter {
2103
2211
  this.spawnGate = spawnGate;
2104
2212
  this.stormWindow = stormWindow;
2105
2213
  this.backendOutage = backendOutage;
2214
+ this.paneTransport = paneTransport;
2106
2215
  // The live process owns its adopted configuration. Fleet defaults may be re-resolved in place after a save;
2107
2216
  // sharing that object would activate cold changes before the normal restart/apply boundary.
2108
2217
  this.config = structuredClone(config);
@@ -2125,7 +2234,8 @@ export class Daemon extends EventEmitter {
2125
2234
  this.messageBus.setLogger(this.logger);
2126
2235
  // General is the dispatcher — it must stay warm to route messages, so it is
2127
2236
  // never auto-paused regardless of auto_pause_after.
2128
- const isGeneral = config.general_topic === true || name === "general";
2237
+ // #3035 review: the one rule (an agent named general unticked — general_topic: false — is a worker).
2238
+ const isGeneral = config.general_topic === true || generalByName(name, config);
2129
2239
  const autoPauseMinutes = isGeneral ? 0 : (typeof config.auto_pause_after === "number" ? config.auto_pause_after : 0); // default: disabled
2130
2240
  this.autoPauseController = new AutoPauseController(Math.max(0, autoPauseMinutes) * 60_000, readLastInboundAt(instanceDir) ?? Date.now());
2131
2241
  // #1209: every real completion clears the in-flight marker, so a
@@ -2155,6 +2265,9 @@ export class Daemon extends EventEmitter {
2155
2265
  setPeerWorkingDirectories(peers) {
2156
2266
  this.peerWorkingDirectories = peers;
2157
2267
  }
2268
+ /** AGEND-181/197: whether the next launch asks for thinking summaries (web.log_thinking, off by default), read at each spawn. */
2269
+ thinkingSummaries;
2270
+ setThinkingSummaries(on) { this.thinkingSummaries = on; }
2158
2271
  /** #1005: read at each spawn so an edited status_emojis reaches the next instructions. */
2159
2272
  statusEmojiAvoidList;
2160
2273
  setStatusEmojiAvoidList(list) {
@@ -2193,17 +2306,25 @@ export class Daemon extends EventEmitter {
2193
2306
  return outcome === "begun";
2194
2307
  }
2195
2308
  async durableAttemptEvidence(windowId, handingOffToNativeQueue, steer, rawPaste = false) {
2196
- let checkpoint = null;
2197
- try {
2198
- checkpoint = await this.transcriptMonitor?.reconciliationCheckpoint() ?? null;
2199
- }
2200
- catch (err) {
2201
- this.logger.debug({ err }, "Could not checkpoint transcript before durable delivery");
2309
+ const backend = this.config.backend ?? this.backend?.binaryName ?? "unknown";
2310
+ let checkpoint = null, runtimeTranscript = null;
2311
+ if (this.nativePaneLifecycle) {
2312
+ runtimeTranscript = await this.transcriptMonitor?.reconciliationRuntimeCheckpoint() ?? null;
2313
+ if (!runtimeTranscript || !this.nativePaneLifecycle.current(runtimeTranscript))
2314
+ throw Error("Native transcript checkpoint is not current; no delivery was written");
2315
+ }
2316
+ else if (!(rawPaste && backend === "codex")) {
2317
+ // Local raw Codex uses only the bounded exact-UUID checkpoint acquired below.
2318
+ try {
2319
+ checkpoint = await this.transcriptMonitor?.reconciliationCheckpoint() ?? null;
2320
+ }
2321
+ catch (err) {
2322
+ this.logger.debug({ err }, "Could not checkpoint transcript before durable delivery");
2323
+ }
2202
2324
  }
2203
2325
  const submissionMode = rawPaste ? "raw_paste" : steer
2204
2326
  ? "steer"
2205
2327
  : handingOffToNativeQueue ? "native_queue_handoff" : "idle_submit";
2206
- const backend = this.config.backend ?? this.backend?.binaryName ?? "unknown";
2207
2328
  // The daemon does not synchronously probe CLI versions on the delivery
2208
2329
  // path. Until lifecycle supplies a version tied to this exact process,
2209
2330
  // queue handoffs persist an unknown resume contract and reconciliation
@@ -2214,8 +2335,9 @@ export class Daemon extends EventEmitter {
2214
2335
  backendVersion,
2215
2336
  windowId: windowId ?? this.tmux?.getWindowId() ?? null,
2216
2337
  transcriptPath: checkpoint?.path ?? null,
2217
- transcriptOffset: checkpoint?.offset ?? null,
2218
- transcriptSessionId: checkpoint?.sessionId ?? null,
2338
+ transcriptOffset: runtimeTranscript?.cursor.offset ?? checkpoint?.offset ?? null,
2339
+ transcriptSessionId: runtimeTranscript?.cursor.sessionId ?? checkpoint?.sessionId ?? null,
2340
+ ...(runtimeTranscript ? { runtimeTranscript } : {}),
2219
2341
  submissionMode,
2220
2342
  queueResumePolicy: queueResumePolicyForAttempt(backend, backendVersion, submissionMode),
2221
2343
  };
@@ -2258,17 +2380,25 @@ export class Daemon extends EventEmitter {
2258
2380
  const outbox = this.deliveryOutbox;
2259
2381
  if (!checkpoint || !outbox?.markConsumed)
2260
2382
  return;
2383
+ if (this.nativePaneLifecycle && !checkpoint.runtime)
2384
+ return;
2261
2385
  if (verdict.submissionMode !== "steer" && verdict.submissionMode !== "native_queue_handoff")
2262
2386
  return;
2263
2387
  if (!["claude-code", "codex"].includes(checkpoint.backend))
2264
2388
  return;
2265
2389
  const spawn = this.spawnGeneration, fence = this.launchFenceEpoch, boot = this.bootId;
2390
+ let location;
2391
+ try {
2392
+ location = checkpoint.runtime ? { reader: this.nativeTranscriptReader(checkpoint.runtime, delivery.deliveryId) } : { path: checkpoint.path, offset: checkpoint.offset };
2393
+ }
2394
+ catch {
2395
+ return;
2396
+ } // The owner changed; an unavailable consumed watch proves nothing.
2266
2397
  consumedWatches.start({
2267
2398
  deliveryId: delivery.deliveryId,
2268
2399
  attemptNo: delivery.attemptNo,
2269
2400
  backend: checkpoint.backend,
2270
- path: checkpoint.path,
2271
- offset: checkpoint.offset,
2401
+ ...location,
2272
2402
  current: () => !this.deliveryWritesStopping && spawn === this.spawnGeneration && fence === this.launchFenceEpoch,
2273
2403
  consumed: (via, evidence) => {
2274
2404
  try {
@@ -2310,15 +2440,18 @@ export class Daemon extends EventEmitter {
2310
2440
  : humanVerificationId ? `[agend-human-id:${humanVerificationId}]` : null;
2311
2441
  if (!marker || !formatted.startsWith(marker))
2312
2442
  return;
2313
- let checkpoint = verdict.transcriptCheckpoint ?? null;
2314
- if (!checkpoint) {
2443
+ let found = verdict.transcriptCheckpoint ?? null;
2444
+ if (!found) {
2315
2445
  try {
2316
- checkpoint = await this.transcriptMonitor?.reconciliationCheckpoint() ?? null;
2446
+ found = await this.transcriptMonitor?.reconciliationCheckpoint() ?? null;
2317
2447
  }
2318
2448
  catch (err) {
2319
2449
  this.logger.debug({ err }, "Could not checkpoint the transcript before a queued hand-off");
2320
2450
  }
2321
2451
  }
2452
+ // main→alpha sync: a hand-off record is judged against a local transcript file. A native or remote runtime's
2453
+ // transcript (no local path) has none: it runs as before (✅ at the hand-off), as with no checkpoint at all.
2454
+ const checkpoint = found && typeof found.path === "string" && typeof found.offset === "number" ? { path: found.path, offset: found.offset } : null;
2322
2455
  if (!checkpoint)
2323
2456
  return; // nothing could judge it later: it runs as before (✅ at the hand-off)
2324
2457
  const entry = {
@@ -2586,24 +2719,41 @@ export class Daemon extends EventEmitter {
2586
2719
  const spawn = this.spawnGeneration;
2587
2720
  const fence = this.launchFenceEpoch;
2588
2721
  let last = "unavailable";
2589
- let outcome = "delivered";
2590
- let evidence = OUTPUT_EDGE_ONLY_EVIDENCE;
2722
+ const native = !!checkpoint.runtime || !!this.nativePaneLifecycle;
2723
+ let outcome = native ? "uncertain" : "delivered";
2724
+ let evidence = native ? "runtime-transcript-unconfirmed" : OUTPUT_EDGE_ONLY_EVIDENCE;
2591
2725
  // #1647: a raw paste has no marker; its text is the needle, and its pane proof already failed — so without the turn
2592
2726
  // in the transcript it stays uncertain (with the pane's reason), never the output-edge outcome.
2593
2727
  const needle = rawPaste ? { rawText: rawPaste.text } : delivery.deliveryId;
2728
+ const bound = checkpoint.ownedCodex;
2729
+ const reader = !checkpoint.runtime && bound ? new TranscriptDeltaReader(checkpoint.path, checkpoint.offset, checkpoint.backend, needle, bound.identity, bound.retire) : null;
2594
2730
  let found = false;
2595
2731
  try {
2732
+ if (this.nativePaneLifecycle && !checkpoint.runtime)
2733
+ throw Error("Native proof cannot read a coordinator-local transcript path");
2734
+ const nativeReader = checkpoint.runtime ? this.nativeTranscriptReader(checkpoint.runtime, needle) : null;
2596
2735
  for (let polls = 0; polls <= TRANSCRIPT_PROOF_WINDOW_MS / TRANSCRIPT_PROOF_POLL_MS; polls++) {
2597
2736
  if (this.deliveryWritesStopping)
2598
2737
  return; // reconciliation owns the row now
2599
- const look = await scanTranscriptForDeliveryMarker(checkpoint.path, checkpoint.offset, checkpoint.backend, needle);
2738
+ if (bound && (!bound.current() || !await bound.validate()))
2739
+ break;
2740
+ const look = nativeReader ? await nativeReader.look() : reader ? await reader.look()
2741
+ : await scanTranscriptForDeliveryMarker(checkpoint.path, checkpoint.offset, checkpoint.backend, needle);
2742
+ if (this.deliveryWritesStopping)
2743
+ return;
2744
+ if (spawn !== this.spawnGeneration || fence !== this.launchFenceEpoch) {
2745
+ last = "unavailable";
2746
+ break;
2747
+ }
2748
+ if (bound && (!await bound.validate() || !bound.current()))
2749
+ break;
2600
2750
  if (look === "user" || look === "absorbed" || look === "queued") {
2601
2751
  found = true;
2602
2752
  outcome = "delivered";
2603
2753
  evidence = transcriptMarkerEvidence(look, !!rawPaste);
2604
2754
  break;
2605
2755
  }
2606
- last = look;
2756
+ last = look === "pending" ? "unavailable" : look;
2607
2757
  if (spawn !== this.spawnGeneration || fence !== this.launchFenceEpoch) {
2608
2758
  last = "unavailable";
2609
2759
  break;
@@ -2615,13 +2765,13 @@ export class Daemon extends EventEmitter {
2615
2765
  // `uncertain`: re-check the same fixed epochs after the last await, before settling (#1207 P2).
2616
2766
  if (spawn !== this.spawnGeneration || fence !== this.launchFenceEpoch)
2617
2767
  last = "unavailable";
2618
- if (last === "no-match" && evidence === OUTPUT_EDGE_ONLY_EVIDENCE) {
2768
+ if (last === "no-match" && !found) {
2619
2769
  outcome = "uncertain";
2620
2770
  evidence = "unverifiable-no-transcript-marker";
2621
2771
  }
2622
2772
  }
2623
2773
  catch (err) {
2624
- this.logger.debug({ err }, "Transcript proof of a delivery failed — keeping the output-edge outcome");
2774
+ this.logger.debug({ err }, "Transcript proof unavailable — preserving the conservative outcome");
2625
2775
  }
2626
2776
  if (rawPaste && !found) {
2627
2777
  outcome = "uncertain";
@@ -2634,6 +2784,10 @@ export class Daemon extends EventEmitter {
2634
2784
  try {
2635
2785
  if (this.deliveryWritesStopping)
2636
2786
  return;
2787
+ if (bound && (!await bound.validate() || !bound.current())) {
2788
+ outcome = "uncertain";
2789
+ evidence = "raw-paste-submit-proof:codex-session-binding-lost; not re-pasted";
2790
+ }
2637
2791
  this.finishDurableDelivery(delivery, outcome, evidence);
2638
2792
  }
2639
2793
  catch (err) {
@@ -2808,128 +2962,150 @@ export class Daemon extends EventEmitter {
2808
2962
  }
2809
2963
  }
2810
2964
  catch { /* corrupt/missing — ignore */ }
2811
- // 1. IPC server — bridge between MCP server (Claude's child) and daemon
2812
- const sockPath = join(this.instanceDir, "channel.sock");
2813
- this.ipcServer = new IpcServer(sockPath, this.logger);
2814
- // Forward IPC server errors as daemon events (prevents unhandled 'error' crash).
2815
- // Guard: only forward post-listen errors — startup errors are handled by listen() rejection.
2816
- let ipcListening = false;
2817
- this.ipcServer.on("error", (err) => {
2818
- if (!ipcListening)
2819
- return; // startup errors handled by listen() rejection
2820
- this.logger.error({ err, name: this.name }, "IPC server error");
2821
- this.emit("error", err);
2822
- });
2823
- await this.ipcServer.listen();
2824
- this.startupAdmission?.();
2825
- ipcListening = true;
2826
- // Permanent IPC dispatcher: routes responses to pending requests by type+id key
2827
- this.ipcServer.on("message", (msg) => this.routeFleetResponse(msg));
2828
- // IPC message relay: when daemon wants to push a channel message to Claude,
2829
- // it broadcasts to all IPC clients (the MCP server is one of them).
2830
- // When MCP server sends a tool_call, daemon handles it via the messageBus.
2831
- this.ipcServer.on("message", (msg, socket) => {
2832
- if (msg.type === "tool_call") {
2833
- // MCP server forwarding a Claude tool call (reply, react, edit, download)
2834
- this.handleToolCall(msg, socket);
2835
- }
2836
- else if (msg.type === "mcp_ready") {
2837
- this.handleMcpReady(msg, socket);
2838
- }
2839
- else if (msg.type === "pong") {
2840
- this.handleMcpPong(msg, socket);
2841
- }
2842
- else if (msg.type === "query_sessions") {
2843
- // Fleet manager asks for all registered session names (catches sessions
2844
- // that sent mcp_ready before fleet manager connected).
2845
- const sessions = [];
2846
- for (const [s, sessionName] of this.socketSessionNames) {
2847
- if (!s.destroyed && sessionName !== this.name) {
2848
- // Individual mcp_ready for initial registration path
2849
- this.ipcServer?.send(socket, { type: "mcp_ready", sessionName });
2850
- sessions.push(sessionName);
2965
+ if (!this.nativePaneLifecycle) {
2966
+ // 1. IPC server — bridge between MCP server (Claude's child) and daemon
2967
+ const sockPath = join(this.instanceDir, "channel.sock");
2968
+ this.ipcServer = new IpcServer(sockPath, this.logger);
2969
+ // Forward IPC server errors as daemon events (prevents unhandled 'error' crash).
2970
+ // Guard: only forward post-listen errors — startup errors are handled by listen() rejection.
2971
+ let ipcListening = false;
2972
+ this.ipcServer.on("error", (err) => {
2973
+ if (!ipcListening)
2974
+ return; // startup errors handled by listen() rejection
2975
+ this.logger.error({ err, name: this.name }, "IPC server error");
2976
+ this.emit("error", err);
2977
+ });
2978
+ await this.ipcServer.listen();
2979
+ this.startupAdmission?.();
2980
+ ipcListening = true;
2981
+ // Permanent IPC dispatcher: routes responses to pending requests by type+id key
2982
+ this.ipcServer.on("message", (msg) => this.routeFleetResponse(msg));
2983
+ // IPC message relay: when daemon wants to push a channel message to Claude,
2984
+ // it broadcasts to all IPC clients (the MCP server is one of them).
2985
+ // When MCP server sends a tool_call, daemon handles it via the messageBus.
2986
+ this.ipcServer.on("message", (msg, socket) => {
2987
+ if (msg.type === "tool_call") {
2988
+ // MCP server forwarding a Claude tool call (reply, react, edit, download)
2989
+ this.handleToolCall(msg, socket);
2990
+ }
2991
+ else if (msg.type === "mcp_ready") {
2992
+ this.handleMcpReady(msg, socket);
2993
+ }
2994
+ else if (msg.type === "pong") {
2995
+ this.handleMcpPong(msg, socket);
2996
+ }
2997
+ else if (msg.type === "query_sessions") {
2998
+ // Fleet manager asks for all registered session names (catches sessions
2999
+ // that sent mcp_ready before fleet manager connected).
3000
+ const sessions = [];
3001
+ for (const [s, sessionName] of this.socketSessionNames) {
3002
+ if (!s.destroyed && sessionName !== this.name) {
3003
+ // Individual mcp_ready for initial registration path
3004
+ this.ipcServer?.send(socket, { type: "mcp_ready", sessionName });
3005
+ sessions.push(sessionName);
3006
+ }
2851
3007
  }
3008
+ // Batch response for prune path
3009
+ this.ipcServer?.send(socket, { type: "query_sessions_response", sessions });
2852
3010
  }
2853
- // Batch response for prune path
2854
- this.ipcServer?.send(socket, { type: "query_sessions_response", sessions });
2855
- }
2856
- else if (msg.type === "fleet_inbound") {
2857
- // Fleet manager routed a message to us (topic mode)
2858
- const meta = msg.meta;
2859
- const targetSession = msg.targetSession;
2860
- const deliveryEpoch = this.captureDeliveryEpoch(msg.delivery_epoch);
2861
- void this.wake().then(() => {
2862
- this.pushChannelMessage(msg.content, meta, targetSession, deliveryEpoch);
2863
- }).catch(err => {
2864
- this.deferDurableDelivery(meta, `target wake failed before pane submission: ${err.message}`);
2865
- this.logger.error({ err: err.message }, "Wake failed for inbound delivery");
2866
- });
2867
- }
2868
- else if (msg.type === "raw_paste") {
2869
- this.handleRawPasteIpcMessage(msg);
2870
- }
2871
- else if (msg.type === "config_update") {
2872
- this.applyConfigUpdate(msg.config);
2873
- }
2874
- else if (msg.type === "steer") {
2875
- const meta = (msg.meta ?? {});
2876
- this.steerMessage(msg.content, meta, this.captureDeliveryEpoch(msg.delivery_epoch));
2877
- }
2878
- else if (msg.type === "btw") {
2879
- const meta = (msg.meta ?? {});
2880
- this.btwMessage(msg.content, meta, this.captureDeliveryEpoch(msg.delivery_epoch));
2881
- }
2882
- else if (msg.type === "fleet_schedule_trigger") {
2883
- const payload = msg.payload;
2884
- const meta = msg.meta;
2885
- const deliveryEpoch = this.captureDeliveryEpoch(msg.delivery_epoch);
2886
- void this.wake().then(() => this.pushChannelMessage(payload.message, meta, undefined, deliveryEpoch)).catch(err => {
2887
- this.logger.error({ err: err.message }, "Wake failed for scheduled delivery");
2888
- });
2889
- }
2890
- else if (msg.type === "query_instance_state") {
2891
- void this.respondToInstanceStateQuery(msg, socket);
2892
- }
2893
- });
2894
- // 2. Tmux — ensure session, create window if not alive
2895
- await TmuxManager.ensureSession(this.tmuxSessionName);
2896
- this.startupAdmission?.();
2897
- this.tmux = new TmuxManager(this.tmuxSessionName, "", resolveTmuxLogicalSize(this.config.terminal), this.controlClient);
2898
- // Strategy A: always start fresh Claude window (MCP server has no reconnection)
2899
- // Kill any existing window from previous run
2900
- const windowIdFile = join(this.instanceDir, "window-id");
2901
- if (existsSync(windowIdFile)) {
2902
- const savedId = readFileSync(windowIdFile, "utf-8").trim();
2903
- if (savedId) {
2904
- const oldTmux = new TmuxManager(this.tmuxSessionName, savedId);
2905
- if (await oldTmux.isWindowAlive()) {
2906
- this.startupAdmission?.();
2907
- await this.checkpointSessionId();
3011
+ else
3012
+ this.handleFleetMessage(msg, reply => { this.ipcServer?.send(socket, reply); });
3013
+ });
3014
+ }
3015
+ let nativeDisposition;
3016
+ if (this.nativePaneLifecycle) {
3017
+ this.beginSpawn();
3018
+ try {
3019
+ const acquired = await this.nativePaneLifecycle.acquire(() => {
2908
3020
  this.startupAdmission?.();
2909
- await oldTmux.killWindow();
3021
+ if (this.startupAborted)
3022
+ throw Error("Native launch was superseded");
3023
+ });
3024
+ this.tmux = acquired.pane;
3025
+ this.nativeTranscriptSource = acquired.source;
3026
+ nativeDisposition = acquired.disposition;
3027
+ this.lastSpawnAt = Date.now();
3028
+ this.setProcessStatus("running");
3029
+ this.bindInstanceStateOutputListener(this.tmux.getWindowId());
3030
+ this.saveSessionId();
3031
+ // New/resumed native processes can still be painting their first frame. Keep deliveries behind the same
3032
+ // bounded dialog/readiness scan as local startup. An already-running reattachment may be busy: do not
3033
+ // wait for that work to finish or inject a startup key into it.
3034
+ if (acquired.disposition === "reattached") {
3035
+ if (this.backend?.binaryName === "codex") {
3036
+ const native = this.nativePaneLifecycle, spawn = this.spawnGeneration, fence = this.launchFenceEpoch, attempt = this.launchAttempt;
3037
+ try {
3038
+ const pane = await acquired.pane.capturePane();
3039
+ this.startupAdmission?.();
3040
+ if (!this.startupAborted && !this.deliveryWritesStopping && this.nativePaneLifecycle === native && this.tmux === acquired.pane
3041
+ && spawn === this.spawnGeneration && fence === this.launchFenceEpoch && attempt === this.launchAttempt && native.current())
3042
+ this.takeQuotaReplayBaseline(pane);
3043
+ }
3044
+ catch { /* An old runner or unavailable proof keeps the existing fail-closed scanner. */ }
3045
+ }
3046
+ }
3047
+ else {
3048
+ if (!await this.finishStartupScan(120_000))
3049
+ throw Error("Native CLI exited during startup; retained session was not replaced");
2910
3050
  this.startupAdmission?.();
2911
- this.logger.info({ savedId }, "Killed old tmux window for fresh start");
3051
+ if (this.startupAborted || this.deliveryWritesStopping || !this.nativePaneLifecycle.current())
3052
+ throw Error("Native launch was superseded");
2912
3053
  }
2913
3054
  }
2914
- }
2915
- const resumed = await this.spawnClaudeWindow();
2916
- this.startupAdmission?.();
2917
- this.isNewSession = !resumed;
2918
- if (!resumed) {
2919
- await this.injectSnapshotMessage(this.startupAdmission);
2920
- this.startupAdmission?.();
3055
+ finally {
3056
+ this.endSpawn();
3057
+ }
2921
3058
  }
2922
3059
  else {
2923
- // Clean up stale snapshot file — resume restored full context, snapshot not needed
2924
- try {
2925
- unlinkSync(join(this.instanceDir, "rotation-state.json"));
3060
+ // 2. Tmux — ensure session, create window if not alive
3061
+ await this.paneHost.ensureSession(this.tmuxSessionName);
3062
+ this.startupAdmission?.();
3063
+ this.tmux = this.paneHost.bind(this.tmuxSessionName, "", resolveTmuxLogicalSize(this.config.terminal), this.controlClient);
3064
+ // M-2457 §6 rule 3: a window-id 2.3 wrote names a window of the SYSTEM tmux's default server.
3065
+ // That window is proven ours, checkpointed and closed (or this instance is held) — and the id is dropped, as it
3066
+ // means nothing on AgEnD's own server — before the fresh-start below can look at it.
3067
+ await migrateLegacyWindow({ agendHome: getAgendHome(), instance: this.name, instanceDir: this.instanceDir, session: this.tmuxSessionName, legacySocket: legacyTmuxSocket(), currentSocket: tmuxSocket(),
3068
+ backendBinary: this.backend?.binaryName ?? "", checkpoint: () => this.checkpointSessionId(),
3069
+ log: (msg, data) => this.logger.info(data ?? {}, msg) });
3070
+ this.startupAdmission?.();
3071
+ // Strategy A: always start fresh Claude window (MCP server has no reconnection)
3072
+ // Kill any existing window from previous run
3073
+ const windowIdFile = join(this.instanceDir, "window-id");
3074
+ if (existsSync(windowIdFile)) {
3075
+ const savedId = readFileSync(windowIdFile, "utf-8").trim();
3076
+ if (savedId) {
3077
+ const oldTmux = this.paneHost.bind(this.tmuxSessionName, savedId);
3078
+ if (await oldTmux.isWindowAlive()) {
3079
+ this.startupAdmission?.();
3080
+ await this.checkpointSessionId();
3081
+ this.startupAdmission?.();
3082
+ await oldTmux.killWindow();
3083
+ this.startupAdmission?.();
3084
+ this.logger.info({ savedId }, "Killed old tmux window for fresh start");
3085
+ }
3086
+ }
3087
+ }
3088
+ const resumed = await this.spawnClaudeWindow();
3089
+ this.startupAdmission?.();
3090
+ this.isNewSession = !resumed;
3091
+ if (!resumed) {
3092
+ await this.injectSnapshotMessage(this.startupAdmission);
3093
+ this.startupAdmission?.();
3094
+ }
3095
+ else {
3096
+ // Clean up stale snapshot file — resume restored full context, snapshot not needed
3097
+ try {
3098
+ unlinkSync(join(this.instanceDir, "rotation-state.json"));
3099
+ }
3100
+ catch { /* may not exist */ }
2926
3101
  }
2927
- catch { /* may not exist */ }
2928
3102
  }
3103
+ if (nativeDisposition)
3104
+ this.isNewSession = nativeDisposition === "fresh";
2929
3105
  // #1209: conditional continuation for the turn interrupted by the last
2930
3106
  // restart, if the gates allow. Detached; the gate
2931
3107
  // consumes its one-shot marker first and never throws into boot.
2932
- const legacyResume = this.maybeResumeInterruptedTurn().catch(() => "unknown");
3108
+ const legacyResume = this.nativePaneLifecycle ? Promise.resolve("unknown") : this.maybeResumeInterruptedTurn().catch(() => "unknown");
2933
3109
  const recoveryOwner = JSON.stringify(this.interactionOwner());
2934
3110
  void Promise.allSettled([legacyResume]).then(() => {
2935
3111
  if (JSON.stringify(this.interactionOwner()) === recoveryOwner) {
@@ -2948,7 +3124,7 @@ export class Daemon extends EventEmitter {
2948
3124
  // (statusline transcript); codex/kiro/opencode read their CLI's own
2949
3125
  // conversation store via a pluggable source. Backends with no known
2950
3126
  // source stay inert exactly as before.
2951
- this.transcriptMonitor = this.buildTranscriptMonitor(createTranscriptSource(this.config.backend ?? "claude-code", this.config.working_directory, this.credentialProfileStore(), () => this.backend?.transcriptLaunch?.() ?? null));
3127
+ this.transcriptMonitor = this.buildTranscriptMonitor(this.nativeTranscriptSource ?? createTranscriptSource(this.config.backend ?? "claude-code", this.config.working_directory, this.credentialProfileStore(), () => this.backend?.transcriptLaunch?.() ?? null));
2952
3128
  const transcriptMonitor = this.transcriptMonitor;
2953
3129
  const transcriptFence = this.launchFenceEpoch;
2954
3130
  // Baseline in the isolate before this daemon accepts new work. A
@@ -3004,13 +3180,15 @@ export class Daemon extends EventEmitter {
3004
3180
  if (hangConfig?.enabled !== false) {
3005
3181
  this.hangDetector = new HangDetector();
3006
3182
  }
3007
- // 8. Context guardian
3008
- const statusFile = join(this.instanceDir, "statusline.json");
3009
- this.guardian = new ContextGuardian(this.config.context_guardian ?? {}, this.logger, statusFile);
3010
- this.guardian.startWatching();
3011
- this.guardian.on("status_update", () => {
3012
- this.saveSessionId();
3013
- });
3183
+ if (!this.nativePaneLifecycle) {
3184
+ // 8. Context guardian
3185
+ const statusFile = join(this.instanceDir, "statusline.json");
3186
+ this.guardian = new ContextGuardian(this.config.context_guardian ?? {}, this.logger, statusFile);
3187
+ this.guardian.startWatching();
3188
+ this.guardian.on("status_update", () => {
3189
+ this.saveSessionId();
3190
+ });
3191
+ }
3014
3192
  // Context rotation removed: all CLI backends have built-in auto-compact.
3015
3193
  // Crash recovery (health check + respawn with snapshot) is retained below.
3016
3194
  }
@@ -3063,7 +3241,7 @@ export class Daemon extends EventEmitter {
3063
3241
  this.socketPids.delete(socket);
3064
3242
  // Notify fleet manager so it can clean up sessionRegistry
3065
3243
  if (sessionName !== this.name) {
3066
- this.ipcServer?.broadcast({ type: "session_disconnected", sessionName });
3244
+ this.broadcastFleetMessage({ type: "session_disconnected", sessionName });
3067
3245
  }
3068
3246
  });
3069
3247
  }
@@ -3079,11 +3257,16 @@ export class Daemon extends EventEmitter {
3079
3257
  // sub-agent's server may have left a dead pid in the slot).
3080
3258
  this.noteMcpProofOfLife("mcp_ready", typeof msg.pid === "number" ? msg.pid : undefined);
3081
3259
  }
3082
- this.ipcServer?.broadcast({ type: "mcp_ready", sessionName });
3260
+ this.broadcastFleetMessage({ type: "mcp_ready", sessionName });
3083
3261
  }
3084
3262
  checkMcpServerAlive() {
3085
3263
  if (this.isPaused)
3086
3264
  return;
3265
+ if (this.nativePaneLifecycle) {
3266
+ if (this.nativePaneLifecycle.mcpProof() === "alive")
3267
+ this.noteMcpProofOfLife("connection");
3268
+ return; // No native PID/socket guessing or restart from an unknown helper observation.
3269
+ }
3087
3270
  const status = mcpServerState(this.instanceDir);
3088
3271
  if (status.state === "alive") {
3089
3272
  this.mcpServedGeneration = this.spawnGeneration;
@@ -3167,6 +3350,8 @@ export class Daemon extends EventEmitter {
3167
3350
  * server from a third-party one, and failed the whole launch for either.
3168
3351
  */
3169
3352
  checkFleetMcpNeverConnected() {
3353
+ if (this.nativePaneLifecycle)
3354
+ return; // Native helper presence owns this observation.
3170
3355
  if (this.config.agent_mode === "cli")
3171
3356
  return; // no MCP server by design
3172
3357
  if (this.lastSpawnAt === 0 || this.mcpServedGeneration === this.spawnGeneration)
@@ -3377,6 +3562,8 @@ export class Daemon extends EventEmitter {
3377
3562
  * proof that tools are being served, whatever channel.mcp.pid says.
3378
3563
  */
3379
3564
  mcpServerAlive() {
3565
+ if (this.nativePaneLifecycle)
3566
+ return this.nativePaneLifecycle.mcpProof() === "alive" ? { alive: true, source: "connection" } : { alive: false, source: "none" };
3380
3567
  const status = mcpServerState(this.instanceDir);
3381
3568
  if (status.state === "alive")
3382
3569
  return { alive: true, source: "pid", pid: status.pid };
@@ -3441,7 +3628,7 @@ export class Daemon extends EventEmitter {
3441
3628
  this.mcpDeathNotifiedForPid = null;
3442
3629
  this.mcpDeathDeferredForPid = null;
3443
3630
  this.clearMcpRestartRequest();
3444
- if (pid && mcpServerState(this.instanceDir).state !== "alive")
3631
+ if (!this.nativePaneLifecycle && pid && mcpServerState(this.instanceDir).state !== "alive")
3445
3632
  this.repairMcpPidSlot(pid, source);
3446
3633
  }
3447
3634
  emitMcpRecovered(source, pid) {
@@ -3488,6 +3675,26 @@ export class Daemon extends EventEmitter {
3488
3675
  // ended this instance's health loop because scheduleNext() sat after the
3489
3676
  // throwing code. Catch, log, and keep checking.
3490
3677
  try {
3678
+ if (this.nativePaneLifecycle) {
3679
+ if (this.healthCheckPaused) {
3680
+ scheduleNext();
3681
+ return;
3682
+ }
3683
+ const native = this.nativePaneLifecycle, pane = this.tmux;
3684
+ const status = await pane?.getPaneStatus();
3685
+ if (this.runtimeMonitorsFrozen || native !== this.nativePaneLifecycle || pane !== this.tmux)
3686
+ return;
3687
+ const snapshot = native.snapshot?.();
3688
+ if (status?.alive === false && snapshot?.state === "exited") {
3689
+ this.healthCheckPaused = true;
3690
+ this.setProcessStatus(snapshot.exitCode === 0 ? "stopped" : "crashed");
3691
+ this.emit("native_pane_exited", { name: this.name, snapshot, owner: this.interactionOwner() });
3692
+ }
3693
+ else if (status?.alive)
3694
+ this.checkMcpServerAlive();
3695
+ scheduleNext();
3696
+ return;
3697
+ }
3491
3698
  // Instance directory removed externally (e.g. `rm -rf ~/.agend/instances/<name>`).
3492
3699
  // Stop the loop permanently — otherwise every tick triggers a respawn, whose
3493
3700
  // writeRotationSnapshot fails with ENOENT and gets caught as "Failed to respawn",
@@ -3623,13 +3830,13 @@ export class Daemon extends EventEmitter {
3623
3830
  let inWindowLossBurst = false;
3624
3831
  let nullReason;
3625
3832
  if (!paneStatus) {
3626
- const serverAlive = await TmuxManager.sessionExists(this.tmuxSessionName);
3833
+ const serverAlive = await this.paneHost.sessionExists(this.tmuxSessionName);
3627
3834
  if (discardStaleHealth())
3628
3835
  return;
3629
3836
  // A server may have already restarted before this daemon's health
3630
3837
  // tick. The new PID is the durable generation boundary: treat it as
3631
3838
  // a fleet storm even though `has-session` is true again.
3632
- const serverPid = serverAlive ? await TmuxManager.getServerPid(this.tmuxSessionName) : null;
3839
+ const serverPid = serverAlive ? await this.paneHost.getServerPid(this.tmuxSessionName) : null;
3633
3840
  if (discardStaleHealth())
3634
3841
  return;
3635
3842
  const generationChanged = serverAlive && this.stormWindow?.observeServerAlive(serverPid) === true;
@@ -3658,7 +3865,7 @@ export class Daemon extends EventEmitter {
3658
3865
  // the window truly no longer exists vs a transient query glitch.
3659
3866
  nullReason = "no_window";
3660
3867
  try {
3661
- const windows = await TmuxManager.listWindowsStrict(this.tmuxSessionName, this.controlClient);
3868
+ const windows = await this.paneHost.listWindowsStrict(this.tmuxSessionName, this.controlClient);
3662
3869
  if (discardStaleHealth())
3663
3870
  return;
3664
3871
  this.windowQueryFailureTicks = 0;
@@ -3905,10 +4112,10 @@ export class Daemon extends EventEmitter {
3905
4112
  // Wrapped in try-catch: if tmux server is dead, listWindows throws —
3906
4113
  // must not block spawnClaudeWindow (which calls ensureSession).
3907
4114
  try {
3908
- const windows = await TmuxManager.listWindows(this.tmuxSessionName);
4115
+ const windows = await this.paneHost.listWindows(this.tmuxSessionName);
3909
4116
  for (const w of windows) {
3910
4117
  if (w.name === this.name) {
3911
- const tm = new TmuxManager(this.tmuxSessionName, w.id);
4118
+ const tm = this.paneHost.bind(this.tmuxSessionName, w.id);
3912
4119
  await tm.killWindow();
3913
4120
  }
3914
4121
  }
@@ -4053,7 +4260,7 @@ export class Daemon extends EventEmitter {
4053
4260
  // Force the next ready capture to emit a fresh transition after respawn.
4054
4261
  this.instanceState = "working";
4055
4262
  }
4056
- this.ipcServer?.broadcast({
4263
+ this.broadcastFleetMessage({
4057
4264
  type: "instance_process_state",
4058
4265
  instanceName: this.name,
4059
4266
  status,
@@ -4253,12 +4460,15 @@ export class Daemon extends EventEmitter {
4253
4460
  for (const key of dialog.keys) {
4254
4461
  if (stale())
4255
4462
  return;
4463
+ const keyScreen = this.nativePaneLifecycle ? await pollTmux.capturePane() : currentPane;
4464
+ if (stale() || !Daemon.dialogMatches(dialog, keyScreen))
4465
+ return;
4256
4466
  let sent = false;
4257
4467
  if (SPECIAL_KEYS.has(key)) {
4258
- sent = await pollTmux.sendSpecialKey(key);
4468
+ sent = await (this.nativePaneLifecycle ? pollTmux.sendSpecialKey(key, undefined, { kind: "dialog", screen: keyScreen }) : pollTmux.sendSpecialKey(key));
4259
4469
  }
4260
4470
  else if (dialog.literalKeys) {
4261
- sent = await pollTmux.sendKeys(key); // typed, no Enter (#2872)
4471
+ sent = await (this.nativePaneLifecycle ? pollTmux.sendKeys(key, { kind: "dialog", screen: keyScreen }) : pollTmux.sendKeys(key)); // typed, no Enter (#2872)
4262
4472
  }
4263
4473
  else {
4264
4474
  sent = await pollTmux.pasteText(key, this.systemPasteOptions());
@@ -4561,7 +4771,7 @@ export class Daemon extends EventEmitter {
4561
4771
  }
4562
4772
  /** Arm the recovery gates and emit one detected error pattern. */
4563
4773
  emitErrorPattern(ep, key, pane, now) {
4564
- const minimum = this.backend?.binaryName === "claude" && ep.type === "outdated_cli" ? claudeMinimumError(pane) : null;
4774
+ const minimum = !this.nativePaneLifecycle && this.backend?.binaryName === "claude" && ep.type === "outdated_cli" ? claudeMinimumError(pane) : null;
4565
4775
  if (minimum) {
4566
4776
  this.lastErrorNotifiedAt.set(key, now);
4567
4777
  void this.handleClaudeModelMinimum(minimum).catch(err => {
@@ -4637,7 +4847,20 @@ export class Daemon extends EventEmitter {
4637
4847
  */
4638
4848
  async sendEscape() {
4639
4849
  const cancelKey = this.backend?.getCancelKey() ?? "Escape";
4640
- await this.tmux?.sendSpecialKey(cancelKey);
4850
+ const tmux = this.tmux;
4851
+ if (!tmux)
4852
+ return;
4853
+ if (this.nativePaneLifecycle) {
4854
+ // A native pane's composer proof cannot see a permission dialog, so an unproved key is withheld there. The cancel
4855
+ // is the person's own interrupt, keyed on the screen read just before (as the dialog answer path is): what Esc
4856
+ // does on Linux's tmux pane, on the same screen, with the same key.
4857
+ const screen = await tmux.capturePane().catch(() => null);
4858
+ if (screen === null)
4859
+ return;
4860
+ await tmux.sendSpecialKey(cancelKey, undefined, { kind: "dialog", screen });
4861
+ return;
4862
+ }
4863
+ await tmux.sendSpecialKey(cancelKey);
4641
4864
  }
4642
4865
  /**
4643
4866
  * Drop every not-yet-started pane delivery which predates a user cancel.
@@ -4703,7 +4926,7 @@ export class Daemon extends EventEmitter {
4703
4926
  return;
4704
4927
  const outcome = follower.look(pane);
4705
4928
  if (outcome) {
4706
- this.ipcServer?.broadcast({ type: "compact_pane_result", id, owner, outcome });
4929
+ this.broadcastFleetMessage({ type: "compact_pane_result", id, owner, outcome });
4707
4930
  return;
4708
4931
  }
4709
4932
  }
@@ -4723,7 +4946,7 @@ export class Daemon extends EventEmitter {
4723
4946
  const reportSwitch = (result) => {
4724
4947
  if (!ownSwitch)
4725
4948
  return;
4726
- this.ipcServer?.broadcast({ type: "runtime_switch_result", id: ownSwitch.id, ...result });
4949
+ this.broadcastFleetMessage({ type: "runtime_switch_result", id: ownSwitch.id, ...result });
4727
4950
  };
4728
4951
  // Board 003648ac: the fleet follows a web /compact from just before its paste is written: the transcript's end then
4729
4952
  // (taken here, under this launch, before the write) and the launch it was written under ride with the notice — once.
@@ -4738,7 +4961,7 @@ export class Daemon extends EventEmitter {
4738
4961
  if (!notifyWritten || told)
4739
4962
  return;
4740
4963
  told = true;
4741
- this.ipcServer?.broadcast({ type: "raw_paste_written", id: notifyWritten, outcome: written ? "written" : "not_written",
4964
+ this.broadcastFleetMessage({ type: "raw_paste_written", id: notifyWritten, outcome: written ? "written" : "not_written",
4742
4965
  ...(written ? { owner, checkpoint, ...(paneFollower ? { pane: true } : {}) } : {}) });
4743
4966
  if (written && paneFollower)
4744
4967
  void this.followCompactPane(notifyWritten, owner, paneFollower);
@@ -4807,7 +5030,7 @@ export class Daemon extends EventEmitter {
4807
5030
  else if (durableAttempt && verdict.paneWriteStarted) {
4808
5031
  const unproven = `${verdict.phase ?? "raw-paste"}:${verdict.proof ?? "unverified"}`;
4809
5032
  const checkpoint = verdict.transcriptCheckpoint;
4810
- if (checkpoint && RAW_TEXT_TRANSCRIPT_BACKENDS.includes(checkpoint.backend)) {
5033
+ if (checkpoint && (checkpoint.ownedCodex || RAW_TEXT_TRANSCRIPT_BACKENDS.includes(checkpoint.backend))) {
4811
5034
  // #1647: the pane could not show it, but the CLI's transcript records the turn the paste started — later
4812
5035
  // than the pane window sometimes. Wait for it there (bounded), off the paste lock.
4813
5036
  this.logger.info({ deliveryId: durableAttempt.deliveryId, unproven }, "Raw paste not proven on the pane — asking the CLI's transcript for the turn it started");
@@ -4900,10 +5123,11 @@ export class Daemon extends EventEmitter {
4900
5123
  const press = (target, cursor, key) => this.paneWriteLock.run(async () => {
4901
5124
  if (this.tmux !== tmux)
4902
5125
  return false;
4903
- const now = claudeSwitchDialog(await read());
5126
+ const screen = await read();
5127
+ const now = claudeSwitchDialog(screen);
4904
5128
  if (!now || now.kind !== "model" || now.target !== target || (cursor !== null && now.cursor !== cursor))
4905
5129
  return false;
4906
- return tmux.sendSpecialKey(key);
5130
+ return this.nativePaneLifecycle ? tmux.sendSpecialKey(key, undefined, { kind: "dialog", screen }) : tmux.sendSpecialKey(key);
4907
5131
  });
4908
5132
  const gone = async () => {
4909
5133
  const until = performance.now() + OWN_SWITCH_SETTLE_MS;
@@ -4992,9 +5216,12 @@ export class Daemon extends EventEmitter {
4992
5216
  return false;
4993
5217
  const specialKeys = new Set(["Up", "Down", "Enter", "Escape", "Right", "Left"]);
4994
5218
  for (const key of dialog.keys) {
5219
+ const keyScreen = this.nativePaneLifecycle ? await this.tmux.capturePane() : currentPane;
5220
+ if (!matches(keyScreen))
5221
+ return false;
4995
5222
  const ok = specialKeys.has(key)
4996
- ? await this.tmux.sendSpecialKey(key)
4997
- : await this.tmux.sendKeys(key);
5223
+ ? await (this.nativePaneLifecycle ? this.tmux.sendSpecialKey(key, undefined, { kind: "dialog", screen: keyScreen }) : this.tmux.sendSpecialKey(key))
5224
+ : await (this.nativePaneLifecycle ? this.tmux.sendKeys(key, { kind: "dialog", screen: keyScreen }) : this.tmux.sendKeys(key));
4998
5225
  if (!ok)
4999
5226
  return false;
5000
5227
  await new Promise(resolve => setTimeout(resolve, 100));
@@ -5237,7 +5464,7 @@ export class Daemon extends EventEmitter {
5237
5464
  await this.tmux.sendSpecialKey("Escape").catch(() => false);
5238
5465
  return true;
5239
5466
  }
5240
- async stop() {
5467
+ async stop(options = {}) {
5241
5468
  this.publishWorkingState("before_stop");
5242
5469
  this.logger.info("Stopping daemon instance");
5243
5470
  this.clearQuitRelaunchWatch();
@@ -5259,8 +5486,18 @@ export class Daemon extends EventEmitter {
5259
5486
  }
5260
5487
  if (this.adapter)
5261
5488
  await this.adapter.stop();
5489
+ if (this.nativePaneLifecycle) {
5490
+ this.healthCheckPaused = true;
5491
+ this.saveSessionId();
5492
+ await this.nativePaneLifecycle.release(options.nativePane ?? "detach");
5493
+ try {
5494
+ unlinkSync(join(this.instanceDir, "daemon.pid"));
5495
+ }
5496
+ catch { /* metadata only */ }
5497
+ return;
5498
+ }
5262
5499
  // Notify MCP servers of graceful shutdown (prevents reconnect attempts)
5263
- this.ipcServer?.broadcast({ type: "shutdown" });
5500
+ this.broadcastFleetMessage({ type: "shutdown" });
5264
5501
  // Quit CLI FIRST — this kills MCP server child processes cleanly.
5265
5502
  // IPC must stay open during quit so MCP servers receive the shutdown message.
5266
5503
  if (this.tmux) {
@@ -5406,6 +5643,24 @@ export class Daemon extends EventEmitter {
5406
5643
  freshChoice: this.recoveryFreshChoice || this.isNewSession && !this.bootSkippedResume, crashLoopFresh: this.recoveryCrashLoopFresh,
5407
5644
  cancelled: this.recoveryCancelled, background: this.workingBackgroundObservation };
5408
5645
  }
5646
+ /** Observe this host General before its approved switch. No keys, process signals or provider writes. */
5647
+ async generalHostOwner() {
5648
+ const pane = this.tmux, owner = JSON.stringify(this.interactionOwner());
5649
+ if (!this.config.general_topic || this.nativePaneLifecycle || !pane || !/^@\d+$/.test(pane.getWindowId()))
5650
+ throw Error("General host owner is unavailable");
5651
+ const status = await pane.getPaneStatus();
5652
+ if (!status?.alive || !status.pid || status.pid <= 1)
5653
+ throw Error("General host process cannot be proven");
5654
+ const checkpoint = await this.transcriptMonitor?.reconciliationCheckpoint();
5655
+ if (this.tmux !== pane || owner !== JSON.stringify(this.interactionOwner()))
5656
+ throw Error("General host owner changed during observation");
5657
+ const backend = this.config.backend ?? "claude-code";
5658
+ let sessionId = this.backend?.getSessionId() ?? undefined;
5659
+ if (backend === "codex" && checkpoint)
5660
+ sessionId = /([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\.jsonl$/i.exec(checkpoint.path)?.[1];
5661
+ return { kind: "tmux", windowId: pane.getWindowId(), pid: status.pid,
5662
+ ...(typeof sessionId === "string" && sessionId.length > 0 && sessionId.length <= 256 && !/[\p{Cc}\p{Cf}]/u.test(sessionId) ? { pin: { backend, sessionId } } : {}) };
5663
+ }
5409
5664
  /** Local system work: no user turn, channel reply target, wake or replay of an original request. */
5410
5665
  async deliverWorkingRecovery(content, delivery, admitted) {
5411
5666
  const tmux = this.tmux, owner = JSON.stringify(this.interactionOwner()), epoch = this.deliveryEpoch;
@@ -5426,7 +5681,11 @@ export class Daemon extends EventEmitter {
5426
5681
  || !this.paneAuthoritativelyIdle(pane) || this.inputTransientInPane(pane)
5427
5682
  || this.backend?.backgroundWorkRunning?.(pane) === true)
5428
5683
  return;
5429
- if (await tmux.getPaneInputMode?.() !== "raw" || !current())
5684
+ if (this.nativePaneLifecycle ? !this.nativePaneLifecycle.current() || this.nativePaneLifecycle.mcpProof() !== "alive"
5685
+ || !!this.backend?.isDeliveryInputReadyPane && !this.backend.isDeliveryInputReadyPane(pane)
5686
+ : await tmux.getPaneInputMode?.() !== "raw")
5687
+ return;
5688
+ if (!current())
5430
5689
  return;
5431
5690
  const evidence = await this.durableAttemptEvidence(tmux.getWindowId(), false, false);
5432
5691
  if (!current())
@@ -5517,7 +5776,7 @@ export class Daemon extends EventEmitter {
5517
5776
  this.logger.debug({ err }, "Interaction listener failed");
5518
5777
  }
5519
5778
  try {
5520
- this.ipcServer?.broadcast({ type: "instance_interaction", instanceName: this.name, interaction });
5779
+ this.broadcastFleetMessage({ type: "instance_interaction", instanceName: this.name, interaction });
5521
5780
  }
5522
5781
  catch (err) {
5523
5782
  this.logger.debug({ err }, "Interaction broadcast failed");
@@ -5605,6 +5864,56 @@ export class Daemon extends EventEmitter {
5605
5864
  }
5606
5865
  return true;
5607
5866
  }
5867
+ /** Shared Fleet inputs: socket and native transports retain the same wake, epoch and raw-paste semantics. */
5868
+ handleFleetMessage(msg, send, current = () => true) {
5869
+ if (msg.type === "query_sessions") {
5870
+ send({ type: "query_sessions_response", sessions: [] });
5871
+ }
5872
+ else if (msg.type === "fleet_inbound") {
5873
+ const meta = msg.meta;
5874
+ const targetSession = msg.targetSession;
5875
+ const deliveryEpoch = this.captureDeliveryEpoch(msg.delivery_epoch);
5876
+ void this.wake().then(() => {
5877
+ if (!current()) {
5878
+ this.deferDurableDelivery(meta, "native channel owner changed before pane submission");
5879
+ return;
5880
+ }
5881
+ this.pushChannelMessage(msg.content, meta, targetSession, deliveryEpoch);
5882
+ }).catch(err => {
5883
+ this.deferDurableDelivery(meta, `target wake failed before pane submission: ${err.message}`);
5884
+ this.logger.error({ err: err.message }, "Wake failed for inbound delivery");
5885
+ });
5886
+ }
5887
+ else if (msg.type === "raw_paste") {
5888
+ this.handleRawPasteIpcMessage(msg);
5889
+ }
5890
+ else if (msg.type === "config_update") {
5891
+ this.applyConfigUpdate(msg.config);
5892
+ }
5893
+ else if (msg.type === "steer") {
5894
+ const meta = (msg.meta ?? {});
5895
+ this.steerMessage(msg.content, meta, this.captureDeliveryEpoch(msg.delivery_epoch));
5896
+ }
5897
+ else if (msg.type === "btw") {
5898
+ const meta = (msg.meta ?? {});
5899
+ this.btwMessage(msg.content, meta, this.captureDeliveryEpoch(msg.delivery_epoch));
5900
+ }
5901
+ else if (msg.type === "fleet_schedule_trigger") {
5902
+ const payload = msg.payload;
5903
+ const meta = msg.meta;
5904
+ const deliveryEpoch = this.captureDeliveryEpoch(msg.delivery_epoch);
5905
+ void this.wake().then(() => { if (current())
5906
+ this.pushChannelMessage(payload.message, meta, undefined, deliveryEpoch); }).catch(err => {
5907
+ this.logger.error({ err: err.message }, "Wake failed for scheduled delivery");
5908
+ });
5909
+ }
5910
+ else if (msg.type === "query_instance_state") {
5911
+ void this.respondToInstanceStateQuery(msg, undefined, send);
5912
+ }
5913
+ else
5914
+ return false;
5915
+ return true;
5916
+ }
5608
5917
  /**
5609
5918
  * Answer a FleetManager state query. Most callers only need the cached state,
5610
5919
  * but lifecycle decisions such as post-reply Cancel retirement need an
@@ -5612,7 +5921,7 @@ export class Daemon extends EventEmitter {
5612
5921
  * the last transition can stay "working" even though the CLI has since
5613
5922
  * settled without emitting another control-mode output record.
5614
5923
  */
5615
- async respondToInstanceStateQuery(msg, socket) {
5924
+ async respondToInstanceStateQuery(msg, socket, send) {
5616
5925
  try {
5617
5926
  if (msg.deliveryIdle === true) {
5618
5927
  await this.captureAndEvaluateInstanceState("delivery_idle_gate");
@@ -5621,7 +5930,7 @@ export class Daemon extends EventEmitter {
5621
5930
  await this.captureAndEvaluateInstanceState("state_query");
5622
5931
  }
5623
5932
  const snapshot = this.getInstanceStateSnapshot();
5624
- this.ipcServer?.send(socket, {
5933
+ const reply = {
5625
5934
  type: "instance_state_response",
5626
5935
  requestId: msg.requestId,
5627
5936
  instanceName: this.name,
@@ -5629,7 +5938,11 @@ export class Daemon extends EventEmitter {
5629
5938
  state: this.isPaused ? "paused" : snapshot.state,
5630
5939
  processStatus: this.processStatus,
5631
5940
  pausedAt: this.lastPausedAt,
5632
- });
5941
+ };
5942
+ if (send)
5943
+ send(reply);
5944
+ else if (socket)
5945
+ this.ipcServer?.send(socket, reply);
5633
5946
  }
5634
5947
  catch (err) {
5635
5948
  this.logger.debug({ err: err.message }, "Instance state query failed");
@@ -5669,7 +5982,49 @@ export class Daemon extends EventEmitter {
5669
5982
  static AUTH_RECONFIRM_ROWS = 15;
5670
5983
  /** Why the deferred pause was requested; what its marker records (Phase 2a). */
5671
5984
  pendingPauseReason = "auth";
5985
+ nativePauseProof = null;
5986
+ /** Consume the exact idle proof synchronously after the lifecycle's await, before fencing and closing. */
5987
+ nativePauseStillReady() {
5988
+ const proof = this.nativePauseProof;
5989
+ this.nativePauseProof = null;
5990
+ if (proof?.())
5991
+ return true;
5992
+ this.pauseRequested = false;
5993
+ return false;
5994
+ }
5995
+ /** Native lifecycle pause uses the ordinary idle/background/admission proof before closing its owned Job. */
5996
+ async nativePauseReady(admission) {
5997
+ this.nativePauseProof = null;
5998
+ const native = this.nativePaneLifecycle, pane = this.tmux, owner = this.interactionOwner();
5999
+ const allowStuck = this.pauseAllowStuck;
6000
+ this.pauseAllowStuck = false;
6001
+ const ready = () => !!native && native === this.nativePaneLifecycle && native.current() && this.tmux === pane
6002
+ && sameInteractionOwner(owner, this.interactionOwner()) && !this.runtimeMonitorsFrozen && !this.spawning
6003
+ && this.processStatus === "running" && this.pasteQueueDepth === 0
6004
+ && (this.instanceState === "idle" || allowStuck && this.instanceState === "stuck") && (!admission || admission.current());
6005
+ if (!pane || !ready()) {
6006
+ this.pauseRequested = false;
6007
+ return false;
6008
+ }
6009
+ let text;
6010
+ try {
6011
+ text = await pane.capturePane();
6012
+ }
6013
+ catch {
6014
+ this.pauseRequested = false;
6015
+ return false;
6016
+ }
6017
+ if (!ready() || admission && !admission.accepts(text) || this.backend?.backgroundWorkRunning?.(text)
6018
+ || !allowStuck && !this.paneAuthoritativelyIdle(text)) {
6019
+ this.pauseRequested = false;
6020
+ return false;
6021
+ }
6022
+ this.nativePauseProof = ready;
6023
+ return true;
6024
+ }
5672
6025
  async pause(reason = "operator", admission) {
6026
+ if (this.nativePaneLifecycle)
6027
+ throw Error("Native pause is owned by its Fleet lifecycle transition");
5673
6028
  const flight = this.pauseInner(reason, admission);
5674
6029
  const admissions = this.pauseAdmissions ??= new Set();
5675
6030
  admissions.add(flight);
@@ -5777,7 +6132,7 @@ export class Daemon extends EventEmitter {
5777
6132
  writePausedMarker(this.instanceDir, this.lastPausedAt ?? Date.now(), reason);
5778
6133
  this.publishWorkingState("execution");
5779
6134
  this.logger.info({ pausedAt: this.lastPausedAt }, "Instance auto-paused");
5780
- this.ipcServer?.broadcast({
6135
+ this.broadcastFleetMessage({
5781
6136
  type: "instance_state", instanceName: this.name, state: "paused", pausedAt: this.lastPausedAt,
5782
6137
  });
5783
6138
  this.emit("auto_paused", { name: this.name, pausedAt: this.lastPausedAt });
@@ -5883,7 +6238,7 @@ export class Daemon extends EventEmitter {
5883
6238
  this.resumeRuntimeMonitors();
5884
6239
  this.publishWorkingState("execution");
5885
6240
  this.logger.info("Instance auto-woke");
5886
- this.ipcServer?.broadcast({
6241
+ this.broadcastFleetMessage({
5887
6242
  type: "instance_state", instanceName: this.name, state: this.instanceState, pausedAt: null,
5888
6243
  });
5889
6244
  this.emit("auto_woke", { name: this.name });
@@ -6047,7 +6402,7 @@ export class Daemon extends EventEmitter {
6047
6402
  this.logStateEdge(previous, snapshot);
6048
6403
  this.publishWorkingState("execution");
6049
6404
  this.emit("instance_state", { name: this.name, ...snapshot });
6050
- this.ipcServer?.broadcast({ type: "instance_state", instanceName: this.name, ...snapshot });
6405
+ this.broadcastFleetMessage({ type: "instance_state", instanceName: this.name, ...snapshot });
6051
6406
  if (snapshot.state === "stuck" && pane && this.instanceStateReadyPattern) {
6052
6407
  this.handleStuckTransition(pane, snapshot, this.instanceStateReadyPattern);
6053
6408
  }
@@ -6149,7 +6504,7 @@ export class Daemon extends EventEmitter {
6149
6504
  // writing a marker would re-inject a continuation for a finished turn.
6150
6505
  // #3030: a message only queued in the busy CLI has not started a turn: the interrupted turn is still the running one,
6151
6506
  // and a queued message lost to a restart is the hand-off record's to redeliver, not a continuation's.
6152
- if (!meta.resumedContinuationOf && !armed.completionDelivered && !queuedHandoff) {
6507
+ if (!this.nativePaneLifecycle && !meta.resumedContinuationOf && !armed.completionDelivered && !queuedHandoff) {
6153
6508
  const resumeBackend = this.config.backend ?? this.backend?.binaryName ?? this.runtimeIdentity?.backend;
6154
6509
  const resumeCwd = this.config.working_directory ?? "";
6155
6510
  writeInFlightTurnMarker(this.instanceDir, {
@@ -6381,7 +6736,7 @@ export class Daemon extends EventEmitter {
6381
6736
  // outbound action suppresses a duplicate proxy; only a delivered
6382
6737
  // human-facing channel action satisfies the completion guard below.
6383
6738
  if (!turn.outboundDelivered && this.config.mcp_proxy_reply === true
6384
- && mcpServerState(this.instanceDir).state === "dead") {
6739
+ && (this.nativePaneLifecycle ? this.nativePaneLifecycle.mcpProof() === "dead" : mcpServerState(this.instanceDir).state === "dead")) {
6385
6740
  this.turnReplyGuard.complete(turn.generation);
6386
6741
  void this.sendProxyReply(pane, turn.target);
6387
6742
  return;
@@ -6481,21 +6836,37 @@ export class Daemon extends EventEmitter {
6481
6836
  || this.config.backend === "claude-code"
6482
6837
  || this.backend?.binaryName === "claude";
6483
6838
  }
6839
+ /** #3160: this agent's file steps in its current turn (the CLI's own record), for the Files & changes panel. */
6840
+ followLog = new FollowLog();
6841
+ workspaceFollow(after = 0, turn, scope) { return this.followLog.snapshot(after, turn, scope); }
6484
6842
  /**
6485
6843
  * This launch's transcript monitor. #1510: its turn boundaries feed the reply guard's ledger, which starts empty
6486
6844
  * with it — a new monitor re-baselines at the transcript's end, so nothing the old one read can be attributed.
6487
6845
  */
6488
6846
  buildTranscriptMonitor(source) {
6847
+ this.followLog.reset();
6489
6848
  const monitor = new TranscriptMonitor(this.instanceDir, this.logger, source);
6490
6849
  this.transcriptTurns.reset();
6491
6850
  this.transcriptActivityAt = 0;
6492
6851
  // Monotonic: a wall-clock correction must neither end nor extend the open-turn hold (#1641 R1).
6493
6852
  const touch = () => { this.transcriptActivityAt = performance.now(); };
6494
- monitor.on("turns", (turns) => { this.transcriptTurns.observe(turns, performance.now()); touch(); });
6853
+ monitor.on("turns", (turns) => {
6854
+ this.transcriptTurns.observe(turns, performance.now());
6855
+ touch();
6856
+ });
6857
+ // #3160: the files this turn reads, edits and searches, for the Files & changes panel's Follow (a few string checks;
6858
+ // nothing is read from disk until someone asks). Claude's turn boundary is its next prompt.
6859
+ const canFollow = () => this.transcriptMonitor === monitor && this.config.runtime !== "windows"
6860
+ && (this.backend?.binaryName === "claude" || this.backend?.binaryName === "codex");
6861
+ monitor.on("workspace_follow", (event) => { if (canFollow())
6862
+ this.followLog.observe(event); });
6863
+ monitor.on("workspace_reset", () => { if (this.transcriptMonitor === monitor)
6864
+ this.followLog.reset(); });
6495
6865
  // #1641 R2: a re-baselined source starts over, and so does what it said (an open turn read before is withdrawn).
6496
6866
  monitor.on("reset", () => { if (this.transcriptMonitor === monitor) {
6497
6867
  this.transcriptTurns.reset();
6498
6868
  this.transcriptActivityAt = 0;
6869
+ this.followLog.reset();
6499
6870
  } });
6500
6871
  for (const event of ["tool_use", "tool_result", "assistant_text"])
6501
6872
  monitor.on(event, touch);
@@ -6758,7 +7129,7 @@ export class Daemon extends EventEmitter {
6758
7129
  }
6759
7130
  });
6760
7131
  }
6761
- if (!this.ipcServer) {
7132
+ if (!this.fleetTransportAvailable()) {
6762
7133
  this.logger.error(`${logLabel} failed — no adapter or fleet IPC route`);
6763
7134
  return Promise.resolve(false);
6764
7135
  }
@@ -6782,7 +7153,7 @@ export class Daemon extends EventEmitter {
6782
7153
  resolve(delivered);
6783
7154
  });
6784
7155
  try {
6785
- this.ipcServer.broadcast({
7156
+ this.broadcastFleetMessage({
6786
7157
  type: "fleet_outbound",
6787
7158
  tool: "reply",
6788
7159
  args,
@@ -7353,7 +7724,7 @@ export class Daemon extends EventEmitter {
7353
7724
  if (next === this.currentActivity)
7354
7725
  return;
7355
7726
  this.currentActivity = next;
7356
- this.ipcServer?.broadcast({
7727
+ this.broadcastFleetMessage({
7357
7728
  type: "instance_activity",
7358
7729
  instanceName: this.name,
7359
7730
  activity: next,
@@ -7434,7 +7805,7 @@ export class Daemon extends EventEmitter {
7434
7805
  else
7435
7806
  this.config.auto_pause_after = nextAutoPause;
7436
7807
  if (nextAutoPause !== previousAutoPause) {
7437
- const isGeneral = this.config.general_topic === true || this.name === "general";
7808
+ const isGeneral = this.config.general_topic === true || generalByName(this.name, this.config);
7438
7809
  this.autoPauseController.reconfigure((isGeneral ? 0 : nextAutoPause) * 60_000);
7439
7810
  }
7440
7811
  }
@@ -7514,7 +7885,7 @@ export class Daemon extends EventEmitter {
7514
7885
  return;
7515
7886
  this.lastProgressBroadcast = rendered;
7516
7887
  this.lastProgressBroadcastAt = Date.now();
7517
- this.ipcServer?.broadcast({
7888
+ this.broadcastFleetMessage({
7518
7889
  type: "instance_progress",
7519
7890
  instanceName: this.name,
7520
7891
  progress: rendered,
@@ -7530,7 +7901,7 @@ export class Daemon extends EventEmitter {
7530
7901
  if (this.lastProgressBroadcast !== "") {
7531
7902
  this.lastProgressBroadcast = "";
7532
7903
  this.lastProgressBroadcastAt = Date.now();
7533
- this.ipcServer?.broadcast({ type: "instance_progress", instanceName: this.name, progress: "" });
7904
+ this.broadcastFleetMessage({ type: "instance_progress", instanceName: this.name, progress: "" });
7534
7905
  }
7535
7906
  }
7536
7907
  /**
@@ -7697,7 +8068,7 @@ export class Daemon extends EventEmitter {
7697
8068
  reportCrossInstanceDeliveryFailure(meta, verdict, error) {
7698
8069
  if (!meta.from_instance)
7699
8070
  return;
7700
- this.ipcServer?.broadcast({
8071
+ this.broadcastFleetMessage({
7701
8072
  type: "cross_instance_delivery_failed",
7702
8073
  senderSession: meta.from_instance,
7703
8074
  targetInstance: this.name,
@@ -9115,13 +9486,14 @@ export class Daemon extends EventEmitter {
9115
9486
  if (this.remoteCardAnswering)
9116
9487
  return { outcome: "refused", reason: "another answer to this card is being keyed in" };
9117
9488
  this.remoteCardAnswering = true;
9489
+ let answerScreen = null;
9118
9490
  try {
9119
9491
  const outcome = await answerRemoteCard({
9120
9492
  locked: fn => this.paneWriteLock.run(fn),
9121
9493
  // An unreadable screen (a failed capture, another spawn's pane) is unknown — never "the card closed".
9122
- read: () => this.tmux === tmux ? tmux.capturePane().catch(() => null) : Promise.resolve(null),
9123
- key: key => this.tmux !== tmux ? Promise.resolve(false) : key === "Space" ? tmux.sendKeys(" ") : tmux.sendSpecialKey(key),
9124
- paste: text => this.tmux !== tmux ? Promise.resolve(false) : tmux.pasteBuffer(text),
9494
+ read: async () => answerScreen = this.tmux === tmux ? await tmux.capturePane().catch(() => null) : null,
9495
+ key: key => this.tmux !== tmux || answerScreen === null ? Promise.resolve(false) : key === "Space" ? (this.nativePaneLifecycle ? tmux.sendKeys(" ", { kind: "dialog", screen: answerScreen }) : tmux.sendKeys(" ")) : (this.nativePaneLifecycle ? tmux.sendSpecialKey(key, undefined, { kind: "dialog", screen: answerScreen }) : tmux.sendSpecialKey(key)),
9496
+ paste: text => this.tmux !== tmux || answerScreen === null ? Promise.resolve(false) : this.nativePaneLifecycle ? tmux.pasteBuffer(text, { proof: { kind: "dialog", screen: answerScreen } }) : tmux.pasteBuffer(text),
9125
9497
  sleep: ms => new Promise(resolve => setTimeout(resolve, ms)),
9126
9498
  now: () => performance.now(),
9127
9499
  }, pane => {
@@ -9392,12 +9764,19 @@ export class Daemon extends EventEmitter {
9392
9764
  if (!check || !this.tmux)
9393
9765
  return !check;
9394
9766
  try {
9395
- const mode = await this.tmux.getPaneInputMode?.();
9396
- if (mode !== "raw") {
9767
+ const inputActive = this.nativePaneLifecycle
9768
+ ? this.nativePaneLifecycle.current() && this.nativePaneLifecycle.mcpProof() === "alive"
9769
+ : await this.tmux.getPaneInputMode?.() === "raw";
9770
+ // ConPTY has no POSIX termios mode. Its closed launch plus current helper handshake is the input barrier;
9771
+ // the same strict composer detector below is still required. Never grant native unknown-layout fallback.
9772
+ if (!inputActive) {
9397
9773
  this.resetFooterFallback();
9398
9774
  return false;
9399
9775
  }
9400
- return this.deliveryInputReadyPane(await this.tmux.capturePane());
9776
+ const pane = await this.tmux.capturePane();
9777
+ if (this.nativePaneLifecycle && (!this.nativePaneLifecycle.current() || this.nativePaneLifecycle.mcpProof() !== "alive"))
9778
+ return false;
9779
+ return this.deliveryInputReadyPane(pane);
9401
9780
  }
9402
9781
  catch {
9403
9782
  this.resetFooterFallback();
@@ -10171,34 +10550,86 @@ export class Daemon extends EventEmitter {
10171
10550
  // tmux object and window — so the spawn generation and launch fence are part of the fence too: an Enter meant for
10172
10551
  // the CLI this paste went to is never sent to its successor.
10173
10552
  const tmux = this.tmux;
10553
+ const backend = this.backend;
10554
+ const native = !!this.nativePaneLifecycle;
10174
10555
  const generation = this.spawnGeneration;
10175
10556
  const fence = this.launchFenceEpoch;
10557
+ const windowId = native ? tmux?.getWindowId() : undefined;
10558
+ // M-2290 (#2985 review, Fable): the mode wait can last up to 10 minutes, and a respawn or relaunch reuses the same
10559
+ // tmux object and window — so the spawn generation and launch fence are part of every pane's fence: an Enter meant
10560
+ // for the CLI this paste went to is never sent to its successor. A native Windows pane keeps #2958's full fence too
10561
+ // (its launch can be replaced under the same handle).
10176
10562
  const current = () => this.tmux === tmux && this.spawnGeneration === generation && this.launchFenceEpoch === fence
10177
- && !this.deliveryWritesStopping && (!stillCurrent || stillCurrent());
10563
+ && !this.deliveryWritesStopping && (!stillCurrent || stillCurrent())
10564
+ && (!native || (!!windowId && !!backend && this.backend === backend && tmux.getWindowId() === windowId));
10178
10565
  if (!current())
10179
10566
  return false;
10180
10567
  // The pasted text may still be in the box: the caller keeps it uncertain (no false failure, no second paste).
10181
- const hold = () => {
10182
- onInputHeld?.("pane-in-mode");
10183
- this.logger.warn({ phase }, "The pane stayed in a tmux mode; Enter withheld");
10568
+ // S-35: say which check withheld Enter.
10569
+ const hold = (reason) => {
10570
+ onInputHeld?.(reason);
10571
+ if (reason === "output_changed" && current() && !this.nativeDeliveryHold())
10572
+ this.nativeEnterHold = {
10573
+ key: `${this.bootId}:${generation}:${fence}`, since: Date.now(), spawn: generation, fence,
10574
+ };
10575
+ if (reason === "pane-in-mode")
10576
+ this.logger.warn({ phase, reason }, "The pane stayed in a tmux mode; Enter withheld");
10577
+ else
10578
+ this.logger.warn({ ...tmux?.getLastInputDiagnostic?.(), phase, reason, retryCount: positiveRefusals }, "Native delivery Enter withheld by its safety check");
10184
10579
  return false;
10185
10580
  };
10186
10581
  // M-2267 (#2971): a pane in a tmux mode (a person left it in copy-mode) would take this Enter. Wait for the mode to
10187
10582
  // end, then look once more within the same deadline — a pane flickering back into a mode is waited out again, never
10188
- // past the bound. (beta.5: #2958's composer proof that used to sit between the two looks is reverted, decision
10189
- // f57474aa: it rejected Codex's footer after a resume and while busy. #2957 is open again.)
10583
+ // past the bound.
10584
+ // Native delivery follows main #2990: only this backend's recognised runtime dialog vetoes Enter.
10585
+ // The fresh capture still binds the native host output sequence; ownership and positive-ACK-only retries remain.
10190
10586
  const modeDeadline = performance.now() + PANE_MODE_ENTER_WAIT_MS;
10587
+ let pane;
10588
+ let positiveRefusals = 0, enterMarked = false, positiveRetryDeadline = Infinity, linuxDialogRead = false;
10191
10589
  for (;;) {
10192
- const mode = await this.waitWhilePaneInMode(phase, current, modeDeadline);
10590
+ const mode = await this.waitWhilePaneInMode(phase, current, Math.min(modeDeadline, positiveRetryDeadline));
10193
10591
  if (mode === "stale")
10194
10592
  return false;
10195
10593
  if (mode === "held")
10196
- return hold();
10594
+ return hold("pane-in-mode");
10595
+ if (native) {
10596
+ // S-35: a native pane's capture refuses while output is still arriving ("Pane changed during capture; observe it
10597
+ // again"). Right after a turn the CLI repaints for a moment; one refused read left the message unsent for ever.
10598
+ // Read again a few times — reading types nothing — and still hold if it never settles.
10599
+ let captured;
10600
+ for (let attempt = 0; captured === undefined; attempt++) {
10601
+ try {
10602
+ captured = await tmux.capturePane();
10603
+ }
10604
+ catch {
10605
+ if (!current())
10606
+ return false;
10607
+ if (attempt >= 4)
10608
+ return hold("capture_failed");
10609
+ await new Promise(done => setTimeout(done, 150 * (attempt + 1)));
10610
+ if (!current())
10611
+ return false;
10612
+ }
10613
+ }
10614
+ const screen = captured;
10615
+ pane = screen;
10616
+ if (!current())
10617
+ return false;
10618
+ try {
10619
+ if (backend?.getRuntimeDialogs?.().some(dialog => Daemon.dialogMatches(dialog, screen)))
10620
+ return hold("dialog");
10621
+ }
10622
+ catch {
10623
+ return hold("check_failed");
10624
+ }
10625
+ if (!current())
10626
+ return false;
10627
+ }
10197
10628
  if (await this.paneInTmuxMode(phase)) {
10198
10629
  if (!current())
10199
10630
  return false;
10200
10631
  if (performance.now() >= modeDeadline)
10201
- return hold();
10632
+ return hold("pane-in-mode");
10202
10633
  await new Promise(r => setTimeout(r, PANE_MODE_POLL_MS));
10203
10634
  if (!current())
10204
10635
  return false;
@@ -10206,54 +10637,143 @@ export class Daemon extends EventEmitter {
10206
10637
  }
10207
10638
  if (!current())
10208
10639
  return false;
10209
- break;
10210
- }
10211
- // M-2290 (the simple half of the #2957 redesign, leader xmsg-1793712561468): a dialog the backend RECOGNISES
10212
- // (runtimeDialogs: a permission card, the dangerous-command card, …) that painted between the paste and this Enter
10213
- // would take the key as its answer. Read the pane once more: such a dialog withholds the Enter, the caller keeps the
10214
- // delivery uncertain (Needs-you), and the dialog scanner parks the dialog for a person. Nothing else is judged here
10215
- // — an unknown or unreadable screen sends, exactly as before: #2958's composer proof (decision f57474aa) is NOT back.
10216
- // Only a caller that can hold (onInputHeld: the delivery's initial submit, settled uncertain → Needs-you) asks: one
10217
- // that cannot would read `false` as a failure and paste again. Only the backend's OWN dialogs count — not AgEnD's
10218
- // unrecognised-prompt guess — so an unknown screen still sends.
10219
- if (onInputHeld) {
10220
- let finalPane = null;
10640
+ // M-2290 (the simple half of the #2957 redesign, leader xmsg-1793712561468; main): on a Linux pane, a dialog the
10641
+ // backend RECOGNISES (runtimeDialogs: a permission card, the dangerous-command card, …) that painted between the
10642
+ // paste and this Enter would take the key as its answer. Read the pane once more: such a dialog withholds the
10643
+ // Enter (the caller keeps the delivery uncertain → Needs-you; the dialog scanner parks it for a person). Nothing
10644
+ // else is judged — an unknown or unreadable screen sends: #2958's composer proof (decision f57474aa) is NOT back.
10645
+ // Only a caller that can hold asks (onInputHeld); a native pane read its own screen above, every round.
10646
+ if (!native && onInputHeld && !linuxDialogRead) {
10647
+ linuxDialogRead = true;
10648
+ let finalPane = null;
10649
+ try {
10650
+ finalPane = await tmux.capturePane();
10651
+ }
10652
+ catch {
10653
+ finalPane = null;
10654
+ }
10655
+ if (!current())
10656
+ return false;
10657
+ let dialog;
10658
+ try {
10659
+ dialog = finalPane === null ? undefined : (this.backend?.getRuntimeDialogs?.() ?? []).find(d => Daemon.dialogMatches(d, finalPane))?.description;
10660
+ }
10661
+ catch {
10662
+ dialog = undefined;
10663
+ }
10664
+ if (dialog !== undefined) {
10665
+ onInputHeld("dialog");
10666
+ this.logger.warn({ phase, dialog }, "A dialog is on the pane; the delivery's Enter is withheld (it would answer it)");
10667
+ return false;
10668
+ }
10669
+ }
10670
+ if (positiveRefusals && performance.now() >= positiveRetryDeadline)
10671
+ return hold("output_changed");
10672
+ // W1: persist the "Enter may have happened" boundary before tmux receives
10673
+ // the key. A crash after this commit is never auto-replayed without a
10674
+ // positive transcript marker, even if the stale pane still shows composer.
10675
+ if (!enterMarked && durableAttempt && !this.deliveryOutbox?.markEnterStarted(durableAttempt.deliveryId, this.bootId, durableAttempt.attemptNo)) {
10676
+ this.logger.error({ phase, deliveryId: durableAttempt.deliveryId }, "Could not commit durable Enter write-ahead fence");
10677
+ return false;
10678
+ }
10679
+ enterMarked = true;
10680
+ const sent = await (native && pane !== undefined ? tmux.sendSpecialKey("Enter", undefined, { kind: "delivery", screen: pane, retryCount: positiveRefusals }) : tmux.sendSpecialKey("Enter"));
10681
+ // A busy renderer can change seq after our capture. Only a positive zero-input ACK admits a NEW proof/key;
10682
+ // An Enter retry never re-pastes, retries an uncertain write, reuses stale proof or re-commits the durable boundary.
10683
+ if (!sent && native && tmux.lastInputWasNotSent?.() === true
10684
+ && tmux.getLastSendSpecialKeyError() === "Pane changed after observation; input was not sent"
10685
+ && current()) {
10686
+ if (!positiveRefusals)
10687
+ positiveRetryDeadline = Math.min(modeDeadline, performance.now() + 2000);
10688
+ if (positiveRefusals >= 4 || performance.now() >= positiveRetryDeadline)
10689
+ return hold("output_changed");
10690
+ positiveRefusals++;
10691
+ await new Promise(done => setTimeout(done, 100));
10692
+ if (!current())
10693
+ return false;
10694
+ if (performance.now() >= positiveRetryDeadline)
10695
+ return hold("output_changed");
10696
+ continue;
10697
+ }
10698
+ if (!sent) {
10699
+ const details = { phase, tmuxError: this.tmux.getLastSendSpecialKeyError() ?? "unknown tmux send-keys failure" };
10700
+ if (native)
10701
+ this.logger.warn({ ...tmux?.getLastInputDiagnostic?.(), ...details, retryCount: positiveRefusals }, "Native delivery Enter gave up");
10702
+ else
10703
+ this.logger.error(details, "tmux send-keys Enter failed during message delivery");
10704
+ }
10705
+ if (sent && native && current())
10706
+ this.nativeEnterHold = null;
10707
+ return sent;
10708
+ }
10709
+ }
10710
+ /** A pre-existing native busy-paste race: retry bytes only after an exact, owned zero-input acknowledgement. */
10711
+ async sendDeliveryPaste(text, stillCurrent) {
10712
+ const pane = this.tmux, native = this.nativePaneLifecycle;
10713
+ if (!native)
10714
+ return pane.pasteBuffer(text);
10715
+ const backend = this.backend, generation = this.spawnGeneration, fence = this.launchFenceEpoch, windowId = pane.getWindowId();
10716
+ const current = () => !!windowId && this.tmux === pane && this.nativePaneLifecycle === native && this.backend === backend
10717
+ && this.spawnGeneration === generation && this.launchFenceEpoch === fence && pane.getWindowId() === windowId
10718
+ && !this.deliveryWritesStopping && (!stillCurrent || stillCurrent());
10719
+ let retryCount = 0;
10720
+ const hold = (reason) => {
10721
+ if (current() && !this.nativeDeliveryHold())
10722
+ this.nativeEnterHold = { key: `${this.bootId}:${generation}:${fence}`, since: Date.now(), spawn: generation, fence };
10723
+ this.logger.warn({ ...pane.getLastInputDiagnostic?.(), reason, retryCount }, "Native delivery paste held by its safety check");
10724
+ return false;
10725
+ };
10726
+ const deadline = performance.now() + 2000;
10727
+ for (let attempt = 0; attempt < 5; attempt++) {
10728
+ retryCount = attempt;
10729
+ if (!current())
10730
+ return false;
10731
+ if (performance.now() >= deadline)
10732
+ return hold("output_changed");
10733
+ let screen;
10734
+ for (let read = 0; read < 5 && screen === undefined; read++) {
10735
+ try {
10736
+ screen = await pane.capturePane();
10737
+ }
10738
+ catch { /* Reads do not construct an input operation. */ }
10739
+ if (!current())
10740
+ return false;
10741
+ if (performance.now() >= deadline)
10742
+ return hold("capture_failed");
10743
+ if (screen === undefined && read < 4)
10744
+ await new Promise(done => setTimeout(done, 100));
10745
+ }
10746
+ if (screen === undefined)
10747
+ return hold("capture_failed");
10221
10748
  try {
10222
- finalPane = await tmux.capturePane();
10749
+ if (backend?.getRuntimeDialogs?.().some(dialog => Daemon.dialogMatches(dialog, screen)))
10750
+ return hold("dialog");
10223
10751
  }
10224
10752
  catch {
10225
- finalPane = null;
10753
+ return hold("check_failed");
10226
10754
  }
10227
10755
  if (!current())
10228
10756
  return false;
10229
- let dialog;
10757
+ if (performance.now() >= deadline)
10758
+ return hold("output_changed");
10759
+ let sent;
10230
10760
  try {
10231
- dialog = finalPane === null ? undefined : (this.backend?.getRuntimeDialogs?.() ?? []).find(d => Daemon.dialogMatches(d, finalPane))?.description;
10761
+ sent = await pane.pasteBuffer(text, { guard: current, proof: { kind: "composer", screen, retryCount: attempt } });
10232
10762
  }
10233
10763
  catch {
10234
- dialog = undefined;
10764
+ return hold("unconfirmed");
10235
10765
  }
10236
- if (dialog !== undefined) {
10237
- onInputHeld?.("dialog");
10238
- this.logger.warn({ phase, dialog }, "A dialog is on the pane; the delivery's Enter is withheld (it would answer it)");
10766
+ if (sent)
10767
+ return true; // Exactly one successful paste ends the loop, before any Enter.
10768
+ if (!current())
10239
10769
  return false;
10240
- }
10241
- }
10242
- // W1: persist the "Enter may have happened" boundary before tmux receives
10243
- // the key. A crash after this commit is never auto-replayed without a
10244
- // positive transcript marker, even if the stale pane still shows composer.
10245
- if (durableAttempt && !this.deliveryOutbox?.markEnterStarted(durableAttempt.deliveryId, this.bootId, durableAttempt.attemptNo)) {
10246
- this.logger.error({ phase, deliveryId: durableAttempt.deliveryId }, "Could not commit durable Enter write-ahead fence");
10247
- return false;
10770
+ if (pane.lastInputWasNotSent?.() !== true || pane.getLastPasteError?.() !== "Pane changed after observation; input was not sent")
10771
+ return hold("unconfirmed");
10772
+ if (attempt >= 4 || performance.now() >= deadline)
10773
+ return hold("output_changed");
10774
+ await new Promise(done => setTimeout(done, 100));
10248
10775
  }
10249
- const sent = await tmux.sendSpecialKey("Enter");
10250
- if (!sent) {
10251
- this.logger.error({
10252
- phase,
10253
- tmuxError: this.tmux.getLastSendSpecialKeyError() ?? "unknown tmux send-keys failure",
10254
- }, "tmux send-keys Enter failed during message delivery");
10255
- }
10256
- return sent;
10776
+ return hold("output_changed");
10257
10777
  }
10258
10778
  async writeMessageToPane(formatted, initialWindowId, handingOffToNativeQueue, status, submissionId,
10259
10779
  // Last and defaulted so the positional callers that ignore the outcome stay
@@ -10291,6 +10811,9 @@ export class Daemon extends EventEmitter {
10291
10811
  const tmuxAtWrite = this.tmux;
10292
10812
  const steerCurrent = () => (!stillCurrent || stillCurrent()) && !this.deliveryWritesStopping
10293
10813
  && this.tmux === tmuxAtWrite && this.spawnGeneration === spawnAtWrite;
10814
+ // Alpha (S-36, Prism #2989 P2): a NATIVE pane keeps #2958's pre-paste owner fence through the initial Enter and every
10815
+ // retry Enter (a pane replaced while the paste awaits never takes this delivery's Enter); a tmux pane follows main.
10816
+ const nativeOwner = this.nativePaneLifecycle ? steerCurrent : undefined;
10294
10817
  // Bug A: paste with backoff. Transient failures are usually a stale window id
10295
10818
  // after a crash/respawn — recover by name and retry (max 3 attempts, 2s apart).
10296
10819
  const maxAttempts = 3;
@@ -10339,6 +10862,7 @@ export class Daemon extends EventEmitter {
10339
10862
  // first side effect; a crash during those waits remains safely replayable.
10340
10863
  if (durableAttempt && !beginChecked) {
10341
10864
  beginChecked = true;
10865
+ const proofOwner = this.interactionOwner();
10342
10866
  const attemptEvidence = {
10343
10867
  ...await this.durableAttemptEvidence(windowId, handingOffToNativeQueue, steer, durableAttempt.submissionMode === "raw_paste"),
10344
10868
  // #856: what arrived vs what is about to be written, taken at the
@@ -10346,7 +10870,15 @@ export class Daemon extends EventEmitter {
10346
10870
  pastedContentSha256: durableAttempt.contentSha256 ?? null,
10347
10871
  pastedBytesSha256: deliveryContentDigest(formatted),
10348
10872
  };
10349
- if (stillCurrent && !stillCurrent()) {
10873
+ const codexCheckpoint = !this.nativePaneLifecycle && rawPaste && attemptEvidence.backend === "codex" && windowId
10874
+ ? await this.bindCodexRawPaste(windowId, steerCurrent) : null;
10875
+ if (codexCheckpoint) {
10876
+ attemptEvidence.transcriptPath = codexCheckpoint.path;
10877
+ attemptEvidence.transcriptOffset = codexCheckpoint.offset;
10878
+ attemptEvidence.transcriptSessionId = codexCheckpoint.sessionId;
10879
+ }
10880
+ if ((stillCurrent && !stillCurrent()) || (!this.nativePaneLifecycle && rawPaste && attemptEvidence.backend === "codex"
10881
+ && (!sameInteractionOwner(proofOwner, this.interactionOwner()) || !steerCurrent()))) {
10350
10882
  verdict.fenced = true;
10351
10883
  return false;
10352
10884
  }
@@ -10358,17 +10890,18 @@ export class Daemon extends EventEmitter {
10358
10890
  }
10359
10891
  verdict.durableBeginCommitted = true;
10360
10892
  verdict.submissionMode = attemptEvidence.submissionMode;
10361
- if (attemptEvidence.transcriptPath && attemptEvidence.transcriptOffset !== null) {
10362
- verdict.transcriptCheckpoint = {
10893
+ if (attemptEvidence.runtimeTranscript || attemptEvidence.transcriptPath && attemptEvidence.transcriptOffset !== null) {
10894
+ verdict.transcriptCheckpoint = attemptEvidence.runtimeTranscript ? { backend: attemptEvidence.backend, runtime: attemptEvidence.runtimeTranscript } : {
10363
10895
  backend: attemptEvidence.backend,
10364
10896
  path: attemptEvidence.transcriptPath,
10365
10897
  offset: attemptEvidence.transcriptOffset,
10898
+ ...(codexCheckpoint ? { ownedCodex: codexCheckpoint.ownedCodex } : {}),
10366
10899
  };
10367
10900
  // From here every proof of this write may also ask the CLI's transcript (the pane can lose the echo to the
10368
10901
  // reply, or still be painting the paste) — this delivery's exact marker only, or a raw paste's exact text (#1647).
10369
10902
  // A raw paste's text only where the transcript is this instance's alone (RAW_TEXT_TRANSCRIPT_BACKENDS).
10370
10903
  if (["claude-code", "codex"].includes(attemptEvidence.backend)
10371
- && (!rawPaste || RAW_TEXT_TRANSCRIPT_BACKENDS.includes(attemptEvidence.backend))) {
10904
+ && (!rawPaste || codexCheckpoint || RAW_TEXT_TRANSCRIPT_BACKENDS.includes(attemptEvidence.backend))) {
10372
10905
  signature.transcript = this.transcriptProofFor(verdict.transcriptCheckpoint, rawPaste ? { rawText: formatted } : durableAttempt.deliveryId, spawnAtWrite, stillCurrent, kind => { verdict.transcriptProof = kind; });
10373
10906
  }
10374
10907
  }
@@ -10435,7 +10968,15 @@ export class Daemon extends EventEmitter {
10435
10968
  }
10436
10969
  const pasteGeneration = this.spawnGeneration;
10437
10970
  beforePaste?.();
10438
- const pasted = await this.tmux.pasteBuffer(formatted);
10971
+ const pasted = await this.sendDeliveryPaste(formatted, nativeOwner);
10972
+ if (!pasted && this.nativePaneLifecycle) {
10973
+ // The native write attempt is retained as uncertain, including exhausted positive refusals. Never route an
10974
+ // unknown/partial write through legacy window recovery or abort it back to an automatically replayable row.
10975
+ verdict.paneWriteStarted = true;
10976
+ verdict.phase = "paste";
10977
+ verdict.proof = "native-paste-held";
10978
+ return false;
10979
+ }
10439
10980
  if (pasted)
10440
10981
  this.rememberPaste(formatted, pasteGeneration);
10441
10982
  if (!pasted) {
@@ -10522,15 +11063,18 @@ export class Daemon extends EventEmitter {
10522
11063
  const enterMono = performance.now();
10523
11064
  const steerEnterCurrent = () => steerCurrent() && performance.now() <= steerEnterDeadline;
10524
11065
  let inputHeld = null;
10525
- if (!(await this.sendDeliveryEnter("initial-submit", steerComposerProof ? steerEnterCurrent : undefined, durableAttempt, (why) => { inputHeld = why; }))) {
11066
+ if (!(await this.sendDeliveryEnter("initial-submit", steerComposerProof || nativeOwner ? steerEnterCurrent : undefined, durableAttempt, (why) => { inputHeld = why; }))) {
10526
11067
  if (inputHeld) {
10527
11068
  // #2971: held in a tmux mode past the bound; M-2290: a recognised dialog on the pane. The paste may still be in
10528
11069
  // the CLI: keep it uncertain (Needs-you), never re-paste, never answer the dialog.
10529
11070
  verdict.phase = "submit-enter";
10530
- verdict.proof = inputHeld === "dialog" ? "dialog-on-pane" : "pane-in-mode-held";
11071
+ // The merge of #2957/M-2290 (main) and the alpha's native holds: a tmux mode, a recognised dialog on a Linux pane,
11072
+ // and each native safety check say which.
11073
+ verdict.proof = inputHeld === "pane-in-mode" ? "pane-in-mode-held" : nativeOwner ? `native-input-${inputHeld}`
11074
+ : inputHeld === "dialog" ? "dialog-on-pane" : `input-held-${inputHeld}`;
10531
11075
  return false;
10532
11076
  }
10533
- if (steerComposerProof && !steerCurrent()) {
11077
+ if ((steerComposerProof || nativeOwner) && !steerCurrent()) {
10534
11078
  verdict.phase = "submit-enter";
10535
11079
  verdict.proof = "fenced-before-enter";
10536
11080
  return false;
@@ -10560,7 +11104,7 @@ export class Daemon extends EventEmitter {
10560
11104
  if (!rawPaste && !steerComposerProof && this.backend?.requiresDeliveryEnterRetry?.() === true) {
10561
11105
  await new Promise(r => setTimeout(r, 1_000));
10562
11106
  const retryAt = Date.now();
10563
- if (await this.sendDeliveryEnter("queue-less-defensive-retry")) {
11107
+ if (await this.sendDeliveryEnter("queue-less-defensive-retry", nativeOwner)) {
10564
11108
  enterAt = retryAt;
10565
11109
  enterRetry = true;
10566
11110
  this.logger.debug("Sent defensive Enter retry (queue-less TUI can swallow the first)");
@@ -10698,7 +11242,7 @@ export class Daemon extends EventEmitter {
10698
11242
  // again. The prompt is back now, so an Enter can land.
10699
11243
  this.logger.warn("Message still in the input row after idle — submitting the existing text instead of pasting it again");
10700
11244
  const strandedAt = Date.now();
10701
- if (!(await this.sendDeliveryEnter("native-queue-stranded-submit"))) {
11245
+ if (!(await this.sendDeliveryEnter("native-queue-stranded-submit", nativeOwner))) {
10702
11246
  return this.failDelivery(verdict, status, "native-queue-submit", "tmux-send-keys-failed");
10703
11247
  }
10704
11248
  // The recovery Enter can be accepted before Codex paints its new
@@ -10751,7 +11295,7 @@ export class Daemon extends EventEmitter {
10751
11295
  }
10752
11296
  await new Promise(r => setTimeout(r, NORMAL_ENTER_SETTLE_MS));
10753
11297
  const retryAt = Date.now();
10754
- if (!(await this.sendDeliveryEnter("native-queue-idle-redelivery"))) {
11298
+ if (!(await this.sendDeliveryEnter("native-queue-idle-redelivery", nativeOwner))) {
10755
11299
  return this.failDelivery(verdict, status, "native-queue-redelivery", "tmux-send-keys-failed");
10756
11300
  }
10757
11301
  if (windowId && this.controlClient) {
@@ -10803,7 +11347,7 @@ export class Daemon extends EventEmitter {
10803
11347
  this.logger.warn("Message not submitted after Enter — waiting for the prompt, then re-sending Enter once");
10804
11348
  const promptBack = await this.waitForPaneReadyForDelivery(windowId, STRANDED_RETRY_READY_WAIT_MS);
10805
11349
  const retryAt = Date.now();
10806
- if (promptBack && !(await this.sendDeliveryEnter("stranded-text-retry"))) {
11350
+ if (promptBack && !(await this.sendDeliveryEnter("stranded-text-retry", nativeOwner))) {
10807
11351
  return this.failDelivery(verdict, status, "stranded-text-retry", "tmux-send-keys-failed");
10808
11352
  }
10809
11353
  submitted = promptBack && await this.confirmSubmittedAfterEnter(windowId, retryAt, formatted);
@@ -10891,7 +11435,7 @@ export class Daemon extends EventEmitter {
10891
11435
  }
10892
11436
  // No control client to observe output: fall back to the legacy double-Enter.
10893
11437
  await new Promise(r => setTimeout(r, 1000));
10894
- await this.sendDeliveryEnter("unobserved-defensive-retry");
11438
+ await this.sendDeliveryEnter("unobserved-defensive-retry", nativeOwner);
10895
11439
  if (status)
10896
11440
  this.emit("message_confirmed", status); // ✅ (best-effort)
10897
11441
  }
@@ -11098,6 +11642,10 @@ export class Daemon extends EventEmitter {
11098
11642
  pane = await this.tmux.capturePane();
11099
11643
  }
11100
11644
  catch { /* the transcript may still say */ }
11645
+ if (owned && !owned())
11646
+ return "unproven";
11647
+ if (signature.transcript?.validate && !await signature.transcript.validate())
11648
+ return "unproven";
11101
11649
  if (owned && !owned())
11102
11650
  return "unproven";
11103
11651
  const onPane = pane === null ? "unproven" : this.judgeSubmission(pane, signature, baseline);
@@ -11105,6 +11653,8 @@ export class Daemon extends EventEmitter {
11105
11653
  return onPane;
11106
11654
  const t = signature.transcript;
11107
11655
  const found = await this.transcriptLook(signature);
11656
+ if (t?.validate && !await t.validate())
11657
+ return "unproven";
11108
11658
  // One synchronous stretch from here: the fence is asked after the last await, and only then is the hit kept and the
11109
11659
  // spawn's guard retired — a stop or respawn that lands between the look and this line leaves both untouched.
11110
11660
  if (!found || !t?.current() || (owned && !owned()))
@@ -11136,14 +11686,74 @@ export class Daemon extends EventEmitter {
11136
11686
  * and the caller's own fence — so a look that lands after any of them is never used (#1380 review).
11137
11687
  */
11138
11688
  transcriptProofFor(checkpoint, needle, spawnAtWrite, stillCurrent, onProof) {
11689
+ if (this.nativePaneLifecycle && !checkpoint.runtime)
11690
+ throw Error("Native proof cannot read a coordinator-local transcript path");
11139
11691
  const launchAtWrite = this.launchFenceEpoch;
11140
11692
  return {
11141
- reader: new TranscriptDeltaReader(checkpoint.path, checkpoint.offset, checkpoint.backend, needle),
11693
+ reader: checkpoint.runtime ? this.nativeTranscriptReader(checkpoint.runtime, needle)
11694
+ : new TranscriptDeltaReader(checkpoint.path, checkpoint.offset, checkpoint.backend, needle, checkpoint.ownedCodex?.identity, checkpoint.ownedCodex?.retire),
11142
11695
  current: () => !this.deliveryWritesStopping && this.spawnGeneration === spawnAtWrite
11143
- && this.launchFenceEpoch === launchAtWrite && (stillCurrent?.() ?? true),
11696
+ && this.launchFenceEpoch === launchAtWrite && (stillCurrent?.() ?? true)
11697
+ && (!checkpoint.runtime || this.nativePaneLifecycle?.current(checkpoint.runtime) === true)
11698
+ && (checkpoint.ownedCodex?.current() ?? true),
11699
+ validate: checkpoint.ownedCodex?.validate,
11144
11700
  onProof,
11145
11701
  };
11146
11702
  }
11703
+ nativeTranscriptReader(reference, needle) {
11704
+ if (!this.nativePaneLifecycle || !this.nativePaneLifecycle.current(reference))
11705
+ throw Error("Native delivery transcript owner is unavailable");
11706
+ return this.nativePaneLifecycle.proofReader(reference, needle);
11707
+ }
11708
+ /** A footer observation authorizes only this pre-write delta under this exact pane/launch. No persisted lease. */
11709
+ async bindCodexRawPaste(windowId, stillCurrent) {
11710
+ const tmux = this.tmux, backend = this.backend, owner = this.interactionOwner();
11711
+ if (this.nativePaneLifecycle || !tmux || !backend?.readRawPasteSession)
11712
+ return null;
11713
+ let retired = false;
11714
+ const current = () => {
11715
+ if (!retired && stillCurrent() && this.tmux === tmux && this.backend === backend && tmux.getWindowId() === windowId
11716
+ && sameInteractionOwner(owner, this.interactionOwner()) && !this.deliveryWritesStopping)
11717
+ return true;
11718
+ retired = true;
11719
+ return false;
11720
+ };
11721
+ const observe = async () => {
11722
+ if (!current() || await tmux.paneInMode?.() === true || !current())
11723
+ return null;
11724
+ const pane = await tmux.capturePane().catch(() => null);
11725
+ if (!current() || pane === null || this.ownSwitch
11726
+ || this.deliveryBlockingDialogs().some(dialog => Daemon.dialogMatches(dialog, pane)))
11727
+ return null;
11728
+ return backend.readRawPasteSession(pane);
11729
+ };
11730
+ const before = await observe();
11731
+ if (!before || !current())
11732
+ return null;
11733
+ const file = await checkpointCodexPane(before.sessionsDir, before.sessionId, this.config.working_directory || process.cwd());
11734
+ if (!file || !current())
11735
+ return null;
11736
+ const validate = async () => {
11737
+ if (!current())
11738
+ return false;
11739
+ const first = await observe();
11740
+ if (!first || first.sessionId !== before.sessionId || first.sessionsDir !== before.sessionsDir || !current()
11741
+ || !await file.validateFile() || !current()) {
11742
+ retired = true;
11743
+ return false;
11744
+ }
11745
+ const last = await observe();
11746
+ if (!last || last.sessionId !== before.sessionId || last.sessionsDir !== before.sessionsDir || !current()) {
11747
+ retired = true;
11748
+ return false;
11749
+ }
11750
+ return true;
11751
+ };
11752
+ if (!await validate())
11753
+ return null;
11754
+ return { backend: "codex", path: file.path, offset: file.offset, sessionId: file.sessionId,
11755
+ ownedCodex: { identity: file.identity, current, validate, retire: () => { retired = true; } } };
11756
+ }
11147
11757
  /** The CLI this daemon drives, for log lines shared by every backend ("claude-code", "codex", …). */
11148
11758
  cliLabel() {
11149
11759
  return this.config.backend ?? this.backend?.binaryName ?? "CLI";
@@ -11393,7 +12003,14 @@ export class Daemon extends EventEmitter {
11393
12003
  * (the retries included). Without a guard it is exactly the old unconditional path.
11394
12004
  */
11395
12005
  async submitSystemPaste(text, label, guard, admission) {
11396
- const current = guard || admission ? () => { admission?.(); return guard?.current() ?? true; } : undefined;
12006
+ // Alpha (S-36, Prism #2989 P2): a NATIVE pane's system paste keeps the pane owner from before its first await
12007
+ // (#2958's fence, reverted on main for tmux panes) — a pane replaced while the paste awaits never takes its Enter.
12008
+ const native = !!this.nativePaneLifecycle;
12009
+ const ownerTmux = this.tmux, ownerGeneration = this.spawnGeneration, ownerFence = this.launchFenceEpoch;
12010
+ const ownerWindow = native ? ownerTmux?.getWindowId() : undefined;
12011
+ const owner = () => !native || (!!ownerTmux && !!ownerWindow && this.tmux === ownerTmux && ownerTmux.getWindowId() === ownerWindow
12012
+ && this.spawnGeneration === ownerGeneration && this.launchFenceEpoch === ownerFence && !this.deliveryWritesStopping);
12013
+ const current = guard || admission || native ? () => { admission?.(); return owner() && (guard?.current() ?? true); } : undefined;
11397
12014
  if (current && !current())
11398
12015
  return false;
11399
12016
  if (!this.tmux)
@@ -11411,6 +12028,10 @@ export class Daemon extends EventEmitter {
11411
12028
  if (!current() || !guard.accept(pane))
11412
12029
  return false;
11413
12030
  baseline = this.paneEvidence(pane, signature);
12031
+ if (native && this.backend?.binaryName === "codex") {
12032
+ const counts = this.paneQuotaPatterns().map(ep => ({ key: Daemon.errorPatternKey(ep), count: Daemon.countOccurrences(ep.pattern, pane) }));
12033
+ baseline.quotaHistory = { spawn: ownerGeneration, fence: ownerFence, attempt: this.launchAttempt, tmux: ownerTmux, window: ownerWindow, counts, marker: signature.value, occurrences: baseline.payload };
12034
+ }
11414
12035
  }
11415
12036
  else {
11416
12037
  baseline = await this.capturePaneEvidence(signature);
@@ -11514,15 +12135,15 @@ export class Daemon extends EventEmitter {
11514
12135
  && sameInteractionOwner(recoveryOwner, this.interactionOwner());
11515
12136
  const previousWindowId = this.tmux?.getWindowId();
11516
12137
  try {
11517
- const windows = await TmuxManager.listWindows(this.tmuxSessionName, this.controlClient);
12138
+ const windows = await this.paneHost.listWindows(this.tmuxSessionName, this.controlClient);
11518
12139
  if (!recoveryCurrent() || this.tmux !== previousTmux)
11519
12140
  return undefined;
11520
12141
  const match = windows.find(w => w.name === this.name);
11521
12142
  if (!match)
11522
12143
  return undefined;
11523
- this.tmux = new TmuxManager(this.tmuxSessionName, match.id, resolveTmuxLogicalSize(this.config.terminal), this.controlClient);
12144
+ this.tmux = this.paneHost.bind(this.tmuxSessionName, match.id, resolveTmuxLogicalSize(this.config.terminal), this.controlClient);
11524
12145
  const recoveredTmux = this.tmux;
11525
- writeFileSync(join(this.instanceDir, "window-id"), match.id);
12146
+ this.writeWindowId(match.id);
11526
12147
  // The window we were talking to is gone; leaving it registered means the
11527
12148
  // control client re-resolves a dead id — one bounded read — on every
11528
12149
  // reconnect, for the life of the fleet process.
@@ -11583,6 +12204,8 @@ export class Daemon extends EventEmitter {
11583
12204
  return false;
11584
12205
  }
11585
12206
  getWindowId() {
12207
+ if (this.nativePaneLifecycle)
12208
+ return this.nativePaneLifecycle.current() ? this.tmux?.getWindowId() : undefined;
11586
12209
  try {
11587
12210
  return readFileSync(join(this.instanceDir, "window-id"), "utf-8").trim() || undefined;
11588
12211
  }
@@ -11614,7 +12237,55 @@ export class Daemon extends EventEmitter {
11614
12237
  * Handle a tool call from the MCP server (forwarded by Claude).
11615
12238
  * Routes to the channel adapter via MessageBus.
11616
12239
  */
11617
- handleToolCall(msg, socket) {
12240
+ /** Internal native-MCP admission. The pane/machine/launch owner supplies a current, dynamically checked tool lease. */
12241
+ handlePaneToolCall(input, lease) {
12242
+ const refusal = nativePaneToolRefusal(input.tool, input.args);
12243
+ if (refusal)
12244
+ return Promise.resolve({ result: null, error: refusal });
12245
+ if (!lease.current() || !lease.allowed(input.tool, input.args) || this.deliveryWritesStopping)
12246
+ return Promise.resolve({ result: null, error: "Pane tool permission is no longer current" });
12247
+ const fence = this.launchFenceEpoch;
12248
+ const current = () => lease.current() && lease.allowed(input.tool, input.args) && !this.deliveryWritesStopping && fence === this.launchFenceEpoch;
12249
+ return new Promise(resolve => {
12250
+ let settled = false;
12251
+ const finish = (value) => { if (settled)
12252
+ return; settled = true; clearTimeout(timer); resolve(value); };
12253
+ const timer = setTimeout(() => finish({ result: null, error: "Pane tool result is unconfirmed; inspect its operation before retrying" }), daemonBudgetMs(input.tool) + 1000);
12254
+ timer.unref?.();
12255
+ try {
12256
+ this.handleToolCall({ ...input, requestId: ++this.fleetRequestSeq }, undefined, {
12257
+ current,
12258
+ dispatch: (tool, args, respond) => {
12259
+ if (!current()) {
12260
+ respond(null, "Pane tool permission was revoked before dispatch");
12261
+ return true;
12262
+ }
12263
+ const dispatched = lease.dispatch?.(tool, args);
12264
+ if (!dispatched)
12265
+ return false;
12266
+ void dispatched.then(result => respond(result), () => respond(null, "Pane tool operation was refused"));
12267
+ return true;
12268
+ },
12269
+ // Resolving the relay is not proof that its HTTP response reached the provider. No response-written receipt yet.
12270
+ send: value => {
12271
+ finish({ result: value.result, ...(typeof value.error === "string" ? { error: value.error } : {}),
12272
+ ...(typeof value.errorCode === "string" || typeof value.errorCode === "number" ? { errorCode: value.errorCode } : {}) });
12273
+ return false;
12274
+ },
12275
+ });
12276
+ }
12277
+ catch {
12278
+ finish({ result: null, error: "Pane tool operation failed" });
12279
+ }
12280
+ });
12281
+ }
12282
+ /** Only the authority lease with a verified helper stdout ACK calls this internal barrier. */
12283
+ paneToolResponseWritten(operationId, current) {
12284
+ if (!current() || this.deliveryWritesStopping || !/^[a-f0-9-]{36}$/i.test(operationId))
12285
+ return;
12286
+ this.emit("mcp_tool_response_written", { operationId, daemonBootId: this.bootId });
12287
+ }
12288
+ handleToolCall(msg, socket, peer) {
11618
12289
  const tool = msg.tool;
11619
12290
  const args = (msg.args ?? {});
11620
12291
  const requestId = msg.requestId;
@@ -11622,20 +12293,20 @@ export class Daemon extends EventEmitter {
11622
12293
  this.logger.debug({ tool, requestId }, "Tool call from MCP server");
11623
12294
  // A tool call can only come from a live MCP server of ours — proof of life
11624
12295
  // that outranks whatever the pid slot says.
11625
- if (this.socketSessionNames.get(socket) === this.name) {
11626
- this.noteMcpProofOfLife("tool_call", this.socketPids.get(socket));
12296
+ if (peer?.current() || socket && this.socketSessionNames.get(socket) === this.name) {
12297
+ this.noteMcpProofOfLife("tool_call", socket ? this.socketPids.get(socket) : undefined);
11627
12298
  }
11628
12299
  // A tool invocation is not delivery evidence. Capture which obligation it
11629
12300
  // belongs to now, then settle it only after the adapter/fleet responds.
11630
12301
  // Explicitly mapped sibling sessions must not satisfy this instance's turn;
11631
12302
  // an unmapped socket is retained for legacy/tests where mcp_ready was not
11632
12303
  // observed before the first tool call.
11633
- const sourceSession = this.socketSessionNames.get(socket);
12304
+ const sourceSession = peer ? this.name : socket ? this.socketSessionNames.get(socket) : undefined;
11634
12305
  const replyAttempt = TURN_OUTBOUND_TOOLS.has(tool) && (!sourceSession || sourceSession === this.name)
11635
12306
  ? this.turnReplyGuard.beginToolAttempt(tool === "reply", TURN_COMPLETION_TOOLS.has(tool))
11636
12307
  : null;
11637
12308
  // For now, log and respond. Full adapter routing will be wired in fleet manager.
11638
- const respond = (result, error) => {
12309
+ const respond = (result, error, errorCode) => {
11639
12310
  // A message that verifiably went out stands down the dead-MCP proxy reply
11640
12311
  // for this turn: the agent proved it can still speak for itself.
11641
12312
  if (!error && result != null && TURN_OUTBOUND_TOOLS.has(tool)) {
@@ -11676,14 +12347,21 @@ export class Daemon extends EventEmitter {
11676
12347
  // failed" and report unknown immediately rather than starting recovery.
11677
12348
  this.turnReplyGuard.settleToolAttempt(replyAttempt, false);
11678
12349
  }
11679
- const sent = this.ipcServer?.send(socket, { requestId, result, error, operationId }) ?? false;
12350
+ const packet = { requestId, result, error, operationId, ...(errorCode !== undefined ? { errorCode } : {}) };
12351
+ const sent = peer ? peer.current() && peer.send(packet) : socket ? this.ipcServer?.send(socket, packet) ?? false : false;
11680
12352
  if (!sent) {
11681
- this.logger.warn({ tool, requestId }, "Tool result could not be returned — originating MCP socket is closed");
12353
+ if (peer)
12354
+ this.logger.debug({ tool, requestId }, "Native MCP result awaits transport-written confirmation");
12355
+ else
12356
+ this.logger.warn({ tool, requestId }, "Tool result could not be returned — originating MCP socket is closed");
11682
12357
  }
11683
12358
  else if (operationId) {
11684
12359
  this.emit("mcp_tool_response_written", { operationId, daemonBootId: this.bootId });
11685
12360
  }
11686
12361
  };
12362
+ // Native Fleet/task operations carry their lease to the existing dispatcher mutation admission points.
12363
+ if (peer?.dispatch?.(tool, args, respond))
12364
+ return;
11687
12365
  // Repo checkout — handled locally in daemon (no fleet-manager)
11688
12366
  if (tool === "checkout_repo") {
11689
12367
  this.handleCheckoutRepo(args, respond);
@@ -11712,7 +12390,7 @@ export class Daemon extends EventEmitter {
11712
12390
  clearTimeout(timeout);
11713
12391
  respond(respMsg.result, respMsg.error);
11714
12392
  });
11715
- this.ipcServer?.broadcast({
12393
+ this.broadcastFleetMessage({
11716
12394
  type,
11717
12395
  payload: args,
11718
12396
  meta: { instance_name: this.name },
@@ -11738,7 +12416,7 @@ export class Daemon extends EventEmitter {
11738
12416
  clearTimeout(timeout);
11739
12417
  resolve({ result: respMsg.result, error: respMsg.error });
11740
12418
  });
11741
- this.ipcServer?.broadcast({ type: WEB_THEME_IPC[tool], payload, meta: { instance_name: this.name }, fleetRequestId: fleetReqId });
12419
+ this.broadcastFleetMessage({ type: WEB_THEME_IPC[tool], payload, meta: { instance_name: this.name }, fleetRequestId: fleetReqId });
11742
12420
  });
11743
12421
  void (async () => {
11744
12422
  if (tool === "preview_web_appearance") {
@@ -11815,7 +12493,7 @@ export class Daemon extends EventEmitter {
11815
12493
  clearTimeout(timeout);
11816
12494
  respond(respMsg.result, respMsg.error);
11817
12495
  });
11818
- this.ipcServer?.broadcast({
12496
+ this.broadcastFleetMessage({
11819
12497
  type: "fleet_task",
11820
12498
  payload: args,
11821
12499
  meta: { instance_name: this.name },
@@ -11838,7 +12516,7 @@ export class Daemon extends EventEmitter {
11838
12516
  clearTimeout(timeout);
11839
12517
  respond(respMsg.result, respMsg.error);
11840
12518
  });
11841
- this.ipcServer?.broadcast({
12519
+ this.broadcastFleetMessage({
11842
12520
  type: typeMap[tool],
11843
12521
  payload: args,
11844
12522
  meta: { instance_name: this.name, working_directory: this.config.working_directory },
@@ -11865,7 +12543,7 @@ export class Daemon extends EventEmitter {
11865
12543
  clearTimeout(timeout);
11866
12544
  respond(respMsg.result, respMsg.error);
11867
12545
  });
11868
- this.ipcServer?.broadcast({
12546
+ this.broadcastFleetMessage({
11869
12547
  type: typeMap[tool],
11870
12548
  payload: args,
11871
12549
  meta: {
@@ -11880,11 +12558,11 @@ export class Daemon extends EventEmitter {
11880
12558
  }
11881
12559
  if (CROSS_INSTANCE_TOOLS.has(tool)) {
11882
12560
  // Route to fleet manager via IPC (topic mode only)
11883
- if (this.topicMode && this.ipcServer) {
12561
+ if (this.topicMode && this.fleetTransportAvailable()) {
11884
12562
  // Use fleetRequestId (not requestId) to avoid MCP server resolving the
11885
12563
  // pending tool call prematurely when it receives the broadcast.
11886
12564
  const fleetReqId = `xmsg_${++this.fleetRequestSeq}_${requestId}`;
11887
- const senderSessionName = this.socketSessionNames.get(socket);
12565
+ const senderSessionName = sourceSession;
11888
12566
  // Shared table, so delete_instance and the deployment tools get the same
11889
12567
  // budget here as the MCP client expects (the ad-hoc list omitted them).
11890
12568
  const crossTimeoutMs = daemonBudgetMs(tool);
@@ -11896,7 +12574,7 @@ export class Daemon extends EventEmitter {
11896
12574
  clearTimeout(timeout);
11897
12575
  respond(respMsg.result, respMsg.error);
11898
12576
  });
11899
- this.ipcServer.broadcast({
12577
+ this.broadcastFleetMessage({
11900
12578
  type: "fleet_outbound",
11901
12579
  tool,
11902
12580
  args,
@@ -11950,12 +12628,12 @@ export class Daemon extends EventEmitter {
11950
12628
  }, daemonBudgetMs(tool));
11951
12629
  this.pendingIpcRequests.set(outboundKey, (respMsg) => {
11952
12630
  clearTimeout(timeout);
11953
- respond(respMsg.result, respMsg.error);
12631
+ respond(respMsg.result, respMsg.error, respMsg.errorCode);
11954
12632
  });
11955
12633
  // Register the waiter before broadcasting. A fast/mock adapter can settle
11956
12634
  // immediately; broadcasting first left a response-before-registration
11957
12635
  // window that degraded into a timeout despite a completed POST.
11958
- this.ipcServer?.broadcast({
12636
+ this.broadcastFleetMessage({
11959
12637
  type: "fleet_outbound",
11960
12638
  tool,
11961
12639
  args,
@@ -12092,7 +12770,7 @@ export class Daemon extends EventEmitter {
12092
12770
  // The daemon used to read `general_topic` alone while `isGeneralInstance`
12093
12771
  // also accepted the name, so an instance called `general` without the flag
12094
12772
  // was a worker here and a general everywhere else.
12095
- const isGeneral = this.config.general_topic === true || this.name === "general";
12773
+ const isGeneral = this.config.general_topic === true || generalByName(this.name, this.config);
12096
12774
  // No third argument for an ordinary instance: the default is `worker` now,
12097
12775
  // and naming it here would be a second place to change it.
12098
12776
  const toolSet = isGeneral
@@ -12188,6 +12866,7 @@ export class Daemon extends EventEmitter {
12188
12866
  agentPort: isCliMode ? agentPort : undefined,
12189
12867
  backendOptions,
12190
12868
  peerWorkingDirectories: this.peerWorkingDirectories,
12869
+ ...(this.thinkingSummaries?.() === true ? { thinkingSummaries: true } : {}),
12191
12870
  };
12192
12871
  }
12193
12872
  /**
@@ -12256,6 +12935,7 @@ export class Daemon extends EventEmitter {
12256
12935
  this.cancelCapacityNudge("the instance was stopped, paused or respawned");
12257
12936
  this.lastErrorEpisode = null;
12258
12937
  this.quotaReplay = null;
12938
+ this.nativeQuotaReplayTaken = false;
12259
12939
  this.quotaInput = null;
12260
12940
  this.nudgeBaselines = null;
12261
12941
  // A relaunch settles any outstanding quit watch: the CLI came back.
@@ -12471,6 +13151,8 @@ export class Daemon extends EventEmitter {
12471
13151
  catch { /* best effort */ }
12472
13152
  }
12473
13153
  async spawnClaudeWindow() {
13154
+ if (this.nativePaneLifecycle)
13155
+ throw Error("Native panes never enter local resume/fresh fallback");
12474
13156
  this.assertSessionOomAdmission();
12475
13157
  this.beginSpawn();
12476
13158
  let resumedSuccessfully = false;
@@ -13047,6 +13729,71 @@ export class Daemon extends EventEmitter {
13047
13729
  * retries. Idempotent, and fast: no graceful CLI quit, the CLI never reached
13048
13730
  * its prompt.
13049
13731
  */
13732
+ /**
13733
+ * #3313 review r2: after a failed start (abortStartup), whether this start's CLI is positively gone — no window was ever
13734
+ * asked for, or its window (by id, or by name while its creation was pending) is positively absent after another kill.
13735
+ * False when that cannot be told (tmux could not list). The failed start's OWN cleanup: called once, by that start,
13736
+ * while the window is still its own. When it cannot tell, the window and its pane process are remembered for
13737
+ * `startupIncarnationEnded()`.
13738
+ */
13739
+ async startupCliEnded() {
13740
+ if (this.nativePaneLifecycle)
13741
+ return true;
13742
+ if (!this.tmux)
13743
+ return true;
13744
+ const windowId = this.tmux.getWindowId();
13745
+ let pid = null;
13746
+ if (windowId?.trim()) {
13747
+ try {
13748
+ pid = await this.paneHost.getPanePid(this.tmuxSessionName, windowId);
13749
+ }
13750
+ catch {
13751
+ pid = null;
13752
+ }
13753
+ }
13754
+ let gone = false;
13755
+ try {
13756
+ gone = await this.tmux.killWindowConfirmed();
13757
+ }
13758
+ catch {
13759
+ gone = false;
13760
+ }
13761
+ if (!gone)
13762
+ this.failedStartupIncarnation = windowId?.trim() ? { windowId, pid } : { windowId: null, pid: null };
13763
+ return gone;
13764
+ }
13765
+ failedStartupIncarnation = null;
13766
+ /**
13767
+ * #3313 review r3: the later re-checks of a failed start whose end was not proven — READ-ONLY (never kills: a retry of
13768
+ * the same agent may already run in a window with the same id). Ended when that window is gone, or when it now runs a
13769
+ * different pane process (it was respawned: the one this start left has been replaced). False when it cannot be told.
13770
+ */
13771
+ async startupIncarnationEnded() {
13772
+ const inc = this.failedStartupIncarnation;
13773
+ if (!inc)
13774
+ return true;
13775
+ if (!inc.windowId)
13776
+ return false; // its window was never learned: nothing proves it gone
13777
+ let windows;
13778
+ try {
13779
+ windows = await TmuxManager.listWindowsStrict(this.tmuxSessionName);
13780
+ }
13781
+ catch {
13782
+ return false;
13783
+ }
13784
+ if (!windows.some(w => w.id === inc.windowId))
13785
+ return true;
13786
+ if (inc.pid === null)
13787
+ return false;
13788
+ let now;
13789
+ try {
13790
+ now = await this.paneHost.getPanePid(this.tmuxSessionName, inc.windowId);
13791
+ }
13792
+ catch {
13793
+ return false;
13794
+ }
13795
+ return now !== null && now !== inc.pid;
13796
+ }
13050
13797
  async abortStartup() {
13051
13798
  if (this.startupAborted)
13052
13799
  return;
@@ -13057,6 +13804,14 @@ export class Daemon extends EventEmitter {
13057
13804
  await this.museUsageRelay.stop().catch(() => { });
13058
13805
  this.museUsageRelay = null;
13059
13806
  }
13807
+ if (this.nativePaneLifecycle) {
13808
+ await this.nativePaneLifecycle.release("detach");
13809
+ try {
13810
+ unlinkSync(join(this.instanceDir, "daemon.pid"));
13811
+ }
13812
+ catch { /* metadata only */ }
13813
+ return;
13814
+ }
13060
13815
  try {
13061
13816
  await this.killProcessTree("SIGTERM", "startup aborted");
13062
13817
  }
@@ -13086,13 +13841,15 @@ export class Daemon extends EventEmitter {
13086
13841
  }
13087
13842
  /** Kill the entire process tree of the current tmux pane (CLI + MCP server). */
13088
13843
  async killProcessTree(signal = "SIGTERM", reason = "unspecified") {
13844
+ if (this.nativePaneLifecycle)
13845
+ throw Error("Native processes can only be closed through their owned runtime pane");
13089
13846
  const windowId = this.tmux?.getWindowId();
13090
13847
  // Before createWindow succeeds there is no pane owned by this daemon.
13091
13848
  // tmux interprets an empty selector as the session's active window.
13092
13849
  if (!windowId?.trim())
13093
13850
  return;
13094
13851
  try {
13095
- const pid = await TmuxManager.getPanePid(this.tmuxSessionName, windowId);
13852
+ const pid = await this.paneHost.getPanePid(this.tmuxSessionName, windowId);
13096
13853
  if (pid) {
13097
13854
  this.noteStopRequest(signal, reason);
13098
13855
  process.kill(-pid, signal);
@@ -13427,7 +14184,7 @@ export class Daemon extends EventEmitter {
13427
14184
  whatsNewRoles() {
13428
14185
  if (this.runtimeIdentity?.kind === "classic")
13429
14186
  return ["classic"];
13430
- if (this.config.general_topic === true || this.name === "general")
14187
+ if (this.config.general_topic === true || generalByName(this.name, this.config))
13431
14188
  return ["general"];
13432
14189
  const set = resolveToolSet(this.config, this.name);
13433
14190
  return set === "coordinator" || set === "full" ? ["worker", "coordinator"] : ["worker"];
@@ -13454,6 +14211,8 @@ export class Daemon extends EventEmitter {
13454
14211
  }
13455
14212
  }
13456
14213
  async trySpawnInsideGate(reuseWindow = false, startupTimeoutMs, repairAdmission) {
14214
+ if (this.nativePaneLifecycle)
14215
+ throw Error("Native relaunch requires its owned exit and a new lifecycle reservation");
13457
14216
  let expectedAttempt = this.launchAttempt;
13458
14217
  const admit = () => { this.startupAdmission?.(); if (repairAdmission && !repairAdmission(expectedAttempt))
13459
14218
  throw new Error("CLI repair superseded by another launch, pause or stop"); };
@@ -13570,8 +14329,8 @@ export class Daemon extends EventEmitter {
13570
14329
  this.emit("backend_launch_warning", { name: this.name, message: note, quiet: true });
13571
14330
  }
13572
14331
  // Ensure tmux session exists (may have been destroyed if all windows died)
13573
- await TmuxManager.ensureSession(this.tmuxSessionName);
13574
- if (this.stormWindow?.observeServerAlive(await TmuxManager.getServerPid(this.tmuxSessionName))) {
14332
+ await this.paneHost.ensureSession(this.tmuxSessionName);
14333
+ if (this.stormWindow?.observeServerAlive(await this.paneHost.getServerPid(this.tmuxSessionName))) {
13575
14334
  this.emit("tmux_server_crash", this.name);
13576
14335
  }
13577
14336
  admit();
@@ -13591,7 +14350,7 @@ export class Daemon extends EventEmitter {
13591
14350
  this.controlClient?.unregisterWindow(retired);
13592
14351
  }
13593
14352
  admit();
13594
- writeFileSync(join(this.instanceDir, "window-id"), windowId);
14353
+ this.writeWindowId(windowId);
13595
14354
  // Enable remain-on-exit to capture exit codes on crash
13596
14355
  await this.tmux.setRemainOnExit().catch(err => {
13597
14356
  this.logger.warn({ err }, "Failed to set remain-on-exit — exit codes will not be captured");
@@ -13855,12 +14614,15 @@ export class Daemon extends EventEmitter {
13855
14614
  // each have seen a respawn, pause or stop.
13856
14615
  if (!owned())
13857
14616
  return false;
14617
+ const keyScreen = this.nativePaneLifecycle ? await this.tmux.capturePane() : answeredPane;
14618
+ if (!owned() || !Daemon.dialogMatches(dialog, keyScreen))
14619
+ return false;
13858
14620
  if (key === "Up" || key === "Down" || key === "Enter" || key === "Escape") {
13859
- if (!await this.tmux.sendSpecialKey(key))
14621
+ if (!await (this.nativePaneLifecycle ? this.tmux.sendSpecialKey(key, undefined, { kind: "dialog", screen: keyScreen }) : this.tmux.sendSpecialKey(key)))
13860
14622
  return false;
13861
14623
  }
13862
14624
  else {
13863
- if (!await this.tmux.sendKeys(key))
14625
+ if (!await (this.nativePaneLifecycle ? this.tmux.sendKeys(key, { kind: "dialog", screen: keyScreen }) : this.tmux.sendKeys(key)))
13864
14626
  return false;
13865
14627
  }
13866
14628
  await new Promise(r => setTimeout(r, 200));
@@ -13874,7 +14636,8 @@ export class Daemon extends EventEmitter {
13874
14636
  // Wait for next screen to render — bounded by what is left of the budget.
13875
14637
  const renderWait = Math.max(0, Math.min(10_000, remaining()));
13876
14638
  if (this.controlClient) {
13877
- const wid = readFileSync(join(this.instanceDir, "window-id"), "utf-8").trim();
14639
+ const wid = this.nativePaneLifecycle ? ownerTmux.getWindowId()
14640
+ : readFileSync(join(this.instanceDir, "window-id"), "utf-8").trim();
13878
14641
  await this.controlClient.waitForIdle(wid, renderWait);
13879
14642
  }
13880
14643
  else {
@@ -13917,7 +14680,9 @@ export class Daemon extends EventEmitter {
13917
14680
  // scan parked on the old limit text.
13918
14681
  const codexReady = this.backend.binaryName !== "codex"
13919
14682
  || this.isCodexLivePaneSnapshot(pane);
13920
- if (readyPatternMatches && codexReady) {
14683
+ const nativeComposerReady = !this.nativePaneLifecycle || (this.backend?.readInputRow
14684
+ ? this.backend.readInputRow(pane) !== null : this.backend?.isDeliveryInputReadyPane?.(pane) === true);
14685
+ if (readyPatternMatches && codexReady && nativeComposerReady) {
13921
14686
  cleanReadyPolls++;
13922
14687
  if (cleanReadyPolls >= 2 || remaining() <= 0) {
13923
14688
  // A real ready prompt (with no fatal dialog on screen — those are
@@ -14013,6 +14778,11 @@ export class Daemon extends EventEmitter {
14013
14778
  * lookup is the backend's own single-flight one: an idle observation already running it is joined,
14014
14779
  * not repeated. Never rejects.
14015
14780
  */
14781
+ /** The window-id file and its socket tag: a window-id without it is 2.3's (tmux-legacy.ts). */
14782
+ writeWindowId(windowId) {
14783
+ writeFileSync(join(this.instanceDir, "window-id"), windowId);
14784
+ tagWindowId(this.instanceDir, tmuxSocket(), windowId);
14785
+ }
14016
14786
  checkpointSessionId() {
14017
14787
  const refresh = this.backend?.refreshSessionId;
14018
14788
  if (this.skipResume || !refresh) {
@@ -14046,6 +14816,16 @@ export class Daemon extends EventEmitter {
14046
14816
  void refresh.call(this.backend).then(() => this.saveSessionId(), () => { });
14047
14817
  }
14048
14818
  saveSessionId() {
14819
+ if (this.nativePaneLifecycle) {
14820
+ try {
14821
+ this.nativePaneLifecycle.checkpointSession();
14822
+ this.ownedWorkingSession = this.backend?.getSessionId() ?? null;
14823
+ }
14824
+ catch (err) {
14825
+ this.logger.warn({ err }, "Native conversation checkpoint is unconfirmed");
14826
+ }
14827
+ return;
14828
+ }
14049
14829
  // When a resume failure has forced a fresh start, don't persist the stale id
14050
14830
  // back from statusline.json — that would re-arm --continue and re-loop.
14051
14831
  if (this.skipResume)