@cotal-ai/cli 0.100.2 → 0.101.1

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 (626) hide show
  1. package/dist/chat/chat-view.d.ts.map +1 -1
  2. package/dist/chat/chat-view.js +5 -1
  3. package/dist/chat/chat-view.js.map +1 -1
  4. package/dist/chat/engine.d.ts +2 -1
  5. package/dist/chat/engine.d.ts.map +1 -1
  6. package/dist/chat/engine.js +2 -1
  7. package/dist/chat/engine.js.map +1 -1
  8. package/dist/chat/frontend.d.ts.map +1 -1
  9. package/dist/chat/frontend.js +13 -7
  10. package/dist/chat/frontend.js.map +1 -1
  11. package/dist/chat/native-session.d.ts +22 -3
  12. package/dist/chat/native-session.d.ts.map +1 -1
  13. package/dist/chat/native-session.js +91 -19
  14. package/dist/chat/native-session.js.map +1 -1
  15. package/dist/chat/open-session.d.ts +1 -0
  16. package/dist/chat/open-session.d.ts.map +1 -1
  17. package/dist/chat/open-session.js +1 -1
  18. package/dist/chat/open-session.js.map +1 -1
  19. package/dist/chat/picker.d.ts +5 -0
  20. package/dist/chat/picker.d.ts.map +1 -1
  21. package/dist/chat/picker.js +23 -10
  22. package/dist/chat/picker.js.map +1 -1
  23. package/dist/chat/plain.d.ts.map +1 -1
  24. package/dist/chat/plain.js +36 -10
  25. package/dist/chat/plain.js.map +1 -1
  26. package/dist/chat/session.d.ts +5 -0
  27. package/dist/chat/session.d.ts.map +1 -1
  28. package/dist/chat/static-session.d.ts +1 -0
  29. package/dist/chat/static-session.d.ts.map +1 -1
  30. package/dist/chat/static-session.js +24 -8
  31. package/dist/chat/static-session.js.map +1 -1
  32. package/dist/chat/stdio-io.d.ts +2 -0
  33. package/dist/chat/stdio-io.d.ts.map +1 -1
  34. package/dist/chat/stdio-io.js +6 -6
  35. package/dist/chat/stdio-io.js.map +1 -1
  36. package/dist/chat/stdio.d.ts +3 -2
  37. package/dist/chat/stdio.d.ts.map +1 -1
  38. package/dist/chat/stdio.js +26 -25
  39. package/dist/chat/stdio.js.map +1 -1
  40. package/dist/chat/user-session.d.ts +1 -0
  41. package/dist/chat/user-session.d.ts.map +1 -1
  42. package/dist/chat/user-session.js +1 -1
  43. package/dist/chat/user-session.js.map +1 -1
  44. package/dist/chat/view.d.ts +5 -4
  45. package/dist/chat/view.d.ts.map +1 -1
  46. package/dist/chat/view.js +10 -8
  47. package/dist/chat/view.js.map +1 -1
  48. package/dist/command.d.ts +5 -0
  49. package/dist/command.d.ts.map +1 -1
  50. package/dist/command.js +295 -82
  51. package/dist/command.js.map +1 -1
  52. package/dist/commands/agents.d.ts +29 -5
  53. package/dist/commands/agents.d.ts.map +1 -1
  54. package/dist/commands/agents.js +100 -35
  55. package/dist/commands/agents.js.map +1 -1
  56. package/dist/commands/backup-maintenance.d.ts.map +1 -1
  57. package/dist/commands/backup-maintenance.js +54 -21
  58. package/dist/commands/backup-maintenance.js.map +1 -1
  59. package/dist/commands/backup-read.d.ts.map +1 -1
  60. package/dist/commands/backup-read.js +12 -15
  61. package/dist/commands/backup-read.js.map +1 -1
  62. package/dist/commands/backup-restore.d.ts.map +1 -1
  63. package/dist/commands/backup-restore.js +20 -4
  64. package/dist/commands/backup-restore.js.map +1 -1
  65. package/dist/commands/backup.d.ts.map +1 -1
  66. package/dist/commands/backup.js +156 -28
  67. package/dist/commands/backup.js.map +1 -1
  68. package/dist/commands/channel-members.d.ts +1 -1
  69. package/dist/commands/channel-members.d.ts.map +1 -1
  70. package/dist/commands/channel-members.js +115 -29
  71. package/dist/commands/channel-members.js.map +1 -1
  72. package/dist/commands/channels.d.ts +11 -1
  73. package/dist/commands/channels.d.ts.map +1 -1
  74. package/dist/commands/channels.js +109 -20
  75. package/dist/commands/channels.js.map +1 -1
  76. package/dist/commands/chat.d.ts +11 -3
  77. package/dist/commands/chat.d.ts.map +1 -1
  78. package/dist/commands/chat.js +50 -22
  79. package/dist/commands/chat.js.map +1 -1
  80. package/dist/commands/clean.d.ts +10 -5
  81. package/dist/commands/clean.d.ts.map +1 -1
  82. package/dist/commands/clean.js +245 -42
  83. package/dist/commands/clean.js.map +1 -1
  84. package/dist/commands/completion.d.ts +15 -2
  85. package/dist/commands/completion.d.ts.map +1 -1
  86. package/dist/commands/completion.js +91 -26
  87. package/dist/commands/completion.js.map +1 -1
  88. package/dist/commands/config.d.ts +24 -1
  89. package/dist/commands/config.d.ts.map +1 -1
  90. package/dist/commands/config.js +65 -13
  91. package/dist/commands/config.js.map +1 -1
  92. package/dist/commands/console.d.ts.map +1 -1
  93. package/dist/commands/console.js +5 -4
  94. package/dist/commands/console.js.map +1 -1
  95. package/dist/commands/describe.d.ts +4 -2
  96. package/dist/commands/describe.d.ts.map +1 -1
  97. package/dist/commands/describe.js +4 -4
  98. package/dist/commands/describe.js.map +1 -1
  99. package/dist/commands/doctor.d.ts +1 -1
  100. package/dist/commands/doctor.d.ts.map +1 -1
  101. package/dist/commands/doctor.js +261 -34
  102. package/dist/commands/doctor.js.map +1 -1
  103. package/dist/commands/down-manifest.d.ts.map +1 -1
  104. package/dist/commands/down-manifest.js +9 -6
  105. package/dist/commands/down-manifest.js.map +1 -1
  106. package/dist/commands/down-services.d.ts +17 -16
  107. package/dist/commands/down-services.d.ts.map +1 -1
  108. package/dist/commands/down-services.js +29 -53
  109. package/dist/commands/down-services.js.map +1 -1
  110. package/dist/commands/down.d.ts +2 -2
  111. package/dist/commands/down.d.ts.map +1 -1
  112. package/dist/commands/down.js +96 -67
  113. package/dist/commands/down.js.map +1 -1
  114. package/dist/commands/endpoint-deregister.d.ts.map +1 -1
  115. package/dist/commands/endpoint-deregister.js +2 -2
  116. package/dist/commands/endpoint-deregister.js.map +1 -1
  117. package/dist/commands/endpoint.d.ts +2 -1
  118. package/dist/commands/endpoint.d.ts.map +1 -1
  119. package/dist/commands/endpoint.js +2 -2
  120. package/dist/commands/endpoint.js.map +1 -1
  121. package/dist/commands/endpoints.d.ts +1 -0
  122. package/dist/commands/endpoints.d.ts.map +1 -1
  123. package/dist/commands/endpoints.js +20 -5
  124. package/dist/commands/endpoints.js.map +1 -1
  125. package/dist/commands/feedback.d.ts.map +1 -1
  126. package/dist/commands/feedback.js +40 -2
  127. package/dist/commands/feedback.js.map +1 -1
  128. package/dist/commands/help.d.ts.map +1 -1
  129. package/dist/commands/help.js +2 -1
  130. package/dist/commands/help.js.map +1 -1
  131. package/dist/commands/history-clear.d.ts.map +1 -1
  132. package/dist/commands/history-clear.js +67 -51
  133. package/dist/commands/history-clear.js.map +1 -1
  134. package/dist/commands/history.d.ts +17 -2
  135. package/dist/commands/history.d.ts.map +1 -1
  136. package/dist/commands/history.js +221 -34
  137. package/dist/commands/history.js.map +1 -1
  138. package/dist/commands/join.d.ts +2 -0
  139. package/dist/commands/join.d.ts.map +1 -1
  140. package/dist/commands/join.js +132 -80
  141. package/dist/commands/join.js.map +1 -1
  142. package/dist/commands/meshes-add.d.ts +19 -4
  143. package/dist/commands/meshes-add.d.ts.map +1 -1
  144. package/dist/commands/meshes-add.js +114 -15
  145. package/dist/commands/meshes-add.js.map +1 -1
  146. package/dist/commands/meshes-wizard.d.ts +1 -0
  147. package/dist/commands/meshes-wizard.d.ts.map +1 -1
  148. package/dist/commands/meshes-wizard.js +45 -13
  149. package/dist/commands/meshes-wizard.js.map +1 -1
  150. package/dist/commands/meshes.d.ts +1 -1
  151. package/dist/commands/meshes.d.ts.map +1 -1
  152. package/dist/commands/meshes.js +76 -47
  153. package/dist/commands/meshes.js.map +1 -1
  154. package/dist/commands/mint.d.ts.map +1 -1
  155. package/dist/commands/mint.js +212 -19
  156. package/dist/commands/mint.js.map +1 -1
  157. package/dist/commands/models.d.ts +5 -1
  158. package/dist/commands/models.d.ts.map +1 -1
  159. package/dist/commands/models.js +21 -13
  160. package/dist/commands/models.js.map +1 -1
  161. package/dist/commands/persona-remote.d.ts.map +1 -1
  162. package/dist/commands/persona-remote.js +24 -13
  163. package/dist/commands/persona-remote.js.map +1 -1
  164. package/dist/commands/persona.d.ts +1 -1
  165. package/dist/commands/persona.d.ts.map +1 -1
  166. package/dist/commands/persona.js +92 -23
  167. package/dist/commands/persona.js.map +1 -1
  168. package/dist/commands/personas.d.ts.map +1 -1
  169. package/dist/commands/personas.js +59 -40
  170. package/dist/commands/personas.js.map +1 -1
  171. package/dist/commands/reset-space-apply.d.ts.map +1 -1
  172. package/dist/commands/reset-space-apply.js +69 -17
  173. package/dist/commands/reset-space-apply.js.map +1 -1
  174. package/dist/commands/reset-store-apply.d.ts +16 -0
  175. package/dist/commands/reset-store-apply.d.ts.map +1 -1
  176. package/dist/commands/reset-store-apply.js +122 -23
  177. package/dist/commands/reset-store-apply.js.map +1 -1
  178. package/dist/commands/reset.d.ts.map +1 -1
  179. package/dist/commands/reset.js +8 -7
  180. package/dist/commands/reset.js.map +1 -1
  181. package/dist/commands/revoke-credential.d.ts +5 -0
  182. package/dist/commands/revoke-credential.d.ts.map +1 -0
  183. package/dist/commands/revoke-credential.js +128 -0
  184. package/dist/commands/revoke-credential.js.map +1 -0
  185. package/dist/commands/send.d.ts +11 -3
  186. package/dist/commands/send.d.ts.map +1 -1
  187. package/dist/commands/send.js +284 -47
  188. package/dist/commands/send.js.map +1 -1
  189. package/dist/commands/service-actions.d.ts +2 -1
  190. package/dist/commands/service-actions.d.ts.map +1 -1
  191. package/dist/commands/service-actions.js +117 -21
  192. package/dist/commands/service-actions.js.map +1 -1
  193. package/dist/commands/service-log-follow.js +1 -1
  194. package/dist/commands/service-log-follow.js.map +1 -1
  195. package/dist/commands/service-registry.d.ts +1 -1
  196. package/dist/commands/service-registry.d.ts.map +1 -1
  197. package/dist/commands/service-registry.js +74 -30
  198. package/dist/commands/service-registry.js.map +1 -1
  199. package/dist/commands/service-set-stop.d.ts.map +1 -1
  200. package/dist/commands/service-set-stop.js +3 -2
  201. package/dist/commands/service-set-stop.js.map +1 -1
  202. package/dist/commands/setup-start.d.ts.map +1 -1
  203. package/dist/commands/setup-start.js +46 -5
  204. package/dist/commands/setup-start.js.map +1 -1
  205. package/dist/commands/setup.d.ts.map +1 -1
  206. package/dist/commands/setup.js +28 -13
  207. package/dist/commands/setup.js.map +1 -1
  208. package/dist/commands/space-delete.d.ts.map +1 -1
  209. package/dist/commands/space-delete.js +130 -41
  210. package/dist/commands/space-delete.js.map +1 -1
  211. package/dist/commands/space-registration.d.ts +13 -6
  212. package/dist/commands/space-registration.d.ts.map +1 -1
  213. package/dist/commands/space-registration.js +167 -46
  214. package/dist/commands/space-registration.js.map +1 -1
  215. package/dist/commands/space.d.ts +15 -1
  216. package/dist/commands/space.d.ts.map +1 -1
  217. package/dist/commands/space.js +66 -24
  218. package/dist/commands/space.js.map +1 -1
  219. package/dist/commands/spawn-preview.d.ts.map +1 -1
  220. package/dist/commands/spawn-preview.js +48 -10
  221. package/dist/commands/spawn-preview.js.map +1 -1
  222. package/dist/commands/spawn.d.ts +36 -13
  223. package/dist/commands/spawn.d.ts.map +1 -1
  224. package/dist/commands/spawn.js +306 -130
  225. package/dist/commands/spawn.js.map +1 -1
  226. package/dist/commands/stack-down.d.ts +9 -3
  227. package/dist/commands/stack-down.d.ts.map +1 -1
  228. package/dist/commands/stack-down.js +348 -64
  229. package/dist/commands/stack-down.js.map +1 -1
  230. package/dist/commands/stack-gone.d.ts +17 -0
  231. package/dist/commands/stack-gone.d.ts.map +1 -0
  232. package/dist/commands/stack-gone.js +218 -0
  233. package/dist/commands/stack-gone.js.map +1 -0
  234. package/dist/commands/stack-up.d.ts +64 -4
  235. package/dist/commands/stack-up.d.ts.map +1 -1
  236. package/dist/commands/stack-up.js +482 -55
  237. package/dist/commands/stack-up.js.map +1 -1
  238. package/dist/commands/status.d.ts +76 -2
  239. package/dist/commands/status.d.ts.map +1 -1
  240. package/dist/commands/status.js +550 -112
  241. package/dist/commands/status.js.map +1 -1
  242. package/dist/commands/team-agent-apply.d.ts.map +1 -1
  243. package/dist/commands/team-agent-apply.js +4 -3
  244. package/dist/commands/team-agent-apply.js.map +1 -1
  245. package/dist/commands/team-agent-remove.d.ts.map +1 -1
  246. package/dist/commands/team-agent-remove.js +4 -4
  247. package/dist/commands/team-agent-remove.js.map +1 -1
  248. package/dist/commands/team-boot-controller.d.ts.map +1 -1
  249. package/dist/commands/team-boot-controller.js +8 -2
  250. package/dist/commands/team-boot-controller.js.map +1 -1
  251. package/dist/commands/team-channel-remove.d.ts.map +1 -1
  252. package/dist/commands/team-channel-remove.js +26 -10
  253. package/dist/commands/team-channel-remove.js.map +1 -1
  254. package/dist/commands/team-deploy-apply.d.ts.map +1 -1
  255. package/dist/commands/team-deploy-apply.js +4 -3
  256. package/dist/commands/team-deploy-apply.js.map +1 -1
  257. package/dist/commands/team-mixed-remove.js +5 -5
  258. package/dist/commands/team-mixed-remove.js.map +1 -1
  259. package/dist/commands/team.d.ts.map +1 -1
  260. package/dist/commands/team.js +94 -32
  261. package/dist/commands/team.js.map +1 -1
  262. package/dist/commands/telemetry.d.ts.map +1 -1
  263. package/dist/commands/telemetry.js +3 -1
  264. package/dist/commands/telemetry.js.map +1 -1
  265. package/dist/commands/topology.d.ts.map +1 -1
  266. package/dist/commands/topology.js +11 -7
  267. package/dist/commands/topology.js.map +1 -1
  268. package/dist/commands/up.d.ts +6 -6
  269. package/dist/commands/up.d.ts.map +1 -1
  270. package/dist/commands/up.js +963 -240
  271. package/dist/commands/up.js.map +1 -1
  272. package/dist/commands/update.d.ts.map +1 -1
  273. package/dist/commands/update.js +9 -3
  274. package/dist/commands/update.js.map +1 -1
  275. package/dist/commands/use.d.ts +5 -1
  276. package/dist/commands/use.d.ts.map +1 -1
  277. package/dist/commands/use.js +55 -12
  278. package/dist/commands/use.js.map +1 -1
  279. package/dist/commands/watch.d.ts +4 -1
  280. package/dist/commands/watch.d.ts.map +1 -1
  281. package/dist/commands/watch.js +15 -3
  282. package/dist/commands/watch.js.map +1 -1
  283. package/dist/commands/who.d.ts +2 -0
  284. package/dist/commands/who.d.ts.map +1 -1
  285. package/dist/commands/who.js +18 -5
  286. package/dist/commands/who.js.map +1 -1
  287. package/dist/commands/whoami.d.ts +44 -5
  288. package/dist/commands/whoami.d.ts.map +1 -1
  289. package/dist/commands/whoami.js +168 -16
  290. package/dist/commands/whoami.js.map +1 -1
  291. package/dist/console/app.d.ts +1 -1
  292. package/dist/console/app.d.ts.map +1 -1
  293. package/dist/console/app.js +15 -9
  294. package/dist/console/app.js.map +1 -1
  295. package/dist/console/launch.d.ts +25 -0
  296. package/dist/console/launch.d.ts.map +1 -0
  297. package/dist/console/launch.js +56 -0
  298. package/dist/console/launch.js.map +1 -0
  299. package/dist/console/ui/CommandPalette.d.ts +5 -4
  300. package/dist/console/ui/CommandPalette.d.ts.map +1 -1
  301. package/dist/console/ui/CommandPalette.js +136 -45
  302. package/dist/console/ui/CommandPalette.js.map +1 -1
  303. package/dist/console/ui/Help.js +1 -1
  304. package/dist/console/ui/Help.js.map +1 -1
  305. package/dist/console/ui/Modal.d.ts +10 -0
  306. package/dist/console/ui/Modal.d.ts.map +1 -0
  307. package/dist/console/ui/Modal.js +8 -0
  308. package/dist/console/ui/Modal.js.map +1 -0
  309. package/dist/console/ui/NewAgent.d.ts +14 -0
  310. package/dist/console/ui/NewAgent.d.ts.map +1 -0
  311. package/dist/console/ui/NewAgent.js +114 -0
  312. package/dist/console/ui/NewAgent.js.map +1 -0
  313. package/dist/console/ui/StatusBar.d.ts +1 -2
  314. package/dist/console/ui/StatusBar.d.ts.map +1 -1
  315. package/dist/console/ui/StatusBar.js +6 -8
  316. package/dist/console/ui/StatusBar.js.map +1 -1
  317. package/dist/console/ui/topo/Map.d.ts.map +1 -1
  318. package/dist/console/ui/topo/Map.js +1 -2
  319. package/dist/console/ui/topo/Map.js.map +1 -1
  320. package/dist/console/ui/topo/Matrix.js +2 -2
  321. package/dist/console/ui/topo/Matrix.js.map +1 -1
  322. package/dist/console/ui/topo/Sequence.d.ts.map +1 -1
  323. package/dist/console/ui/topo/Sequence.js +5 -4
  324. package/dist/console/ui/topo/Sequence.js.map +1 -1
  325. package/dist/console/ui/topo/model.d.ts +2 -1
  326. package/dist/console/ui/topo/model.d.ts.map +1 -1
  327. package/dist/console/ui/topo/model.js +4 -3
  328. package/dist/console/ui/topo/model.js.map +1 -1
  329. package/dist/exec-endpoint/service-adapter.d.ts.map +1 -1
  330. package/dist/exec-endpoint/service-adapter.js +13 -3
  331. package/dist/exec-endpoint/service-adapter.js.map +1 -1
  332. package/dist/ext-loader.d.ts +4 -0
  333. package/dist/ext-loader.d.ts.map +1 -1
  334. package/dist/ext-loader.js +6 -0
  335. package/dist/ext-loader.js.map +1 -1
  336. package/dist/help.d.ts.map +1 -1
  337. package/dist/help.js +44 -23
  338. package/dist/help.js.map +1 -1
  339. package/dist/index.d.ts.map +1 -1
  340. package/dist/index.js +59 -54
  341. package/dist/index.js.map +1 -1
  342. package/dist/lib/agent-skills.d.ts.map +1 -1
  343. package/dist/lib/agent-skills.js +2 -1
  344. package/dist/lib/agent-skills.js.map +1 -1
  345. package/dist/lib/attach-client.js +2 -2
  346. package/dist/lib/attach-client.js.map +1 -1
  347. package/dist/lib/backup-artifact.d.ts +29 -8
  348. package/dist/lib/backup-artifact.d.ts.map +1 -1
  349. package/dist/lib/backup-artifact.js +147 -26
  350. package/dist/lib/backup-artifact.js.map +1 -1
  351. package/dist/lib/broker-service.d.ts +27 -3
  352. package/dist/lib/broker-service.d.ts.map +1 -1
  353. package/dist/lib/broker-service.js +142 -29
  354. package/dist/lib/broker-service.js.map +1 -1
  355. package/dist/lib/broker-store-health.d.ts +89 -0
  356. package/dist/lib/broker-store-health.d.ts.map +1 -0
  357. package/dist/lib/broker-store-health.js +171 -0
  358. package/dist/lib/broker-store-health.js.map +1 -0
  359. package/dist/lib/cancel.d.ts +4 -4
  360. package/dist/lib/cancel.d.ts.map +1 -1
  361. package/dist/lib/cancel.js +5 -5
  362. package/dist/lib/cancel.js.map +1 -1
  363. package/dist/lib/completion-install.d.ts +11 -2
  364. package/dist/lib/completion-install.d.ts.map +1 -1
  365. package/dist/lib/completion-install.js +79 -21
  366. package/dist/lib/completion-install.js.map +1 -1
  367. package/dist/lib/completion-scripts.d.ts.map +1 -1
  368. package/dist/lib/completion-scripts.js +2 -2
  369. package/dist/lib/completion-scripts.js.map +1 -1
  370. package/dist/lib/completion.d.ts +5 -1
  371. package/dist/lib/completion.d.ts.map +1 -1
  372. package/dist/lib/completion.js +10 -0
  373. package/dist/lib/completion.js.map +1 -1
  374. package/dist/lib/concrete-channel.d.ts +6 -0
  375. package/dist/lib/concrete-channel.d.ts.map +1 -0
  376. package/dist/lib/concrete-channel.js +17 -0
  377. package/dist/lib/concrete-channel.js.map +1 -0
  378. package/dist/lib/confirmation-required.d.ts +3 -12
  379. package/dist/lib/confirmation-required.d.ts.map +1 -1
  380. package/dist/lib/confirmation-required.js +9 -8
  381. package/dist/lib/confirmation-required.js.map +1 -1
  382. package/dist/lib/connect.d.ts +9 -0
  383. package/dist/lib/connect.d.ts.map +1 -1
  384. package/dist/lib/connect.js +27 -0
  385. package/dist/lib/connect.js.map +1 -1
  386. package/dist/lib/control.d.ts +42 -12
  387. package/dist/lib/control.d.ts.map +1 -1
  388. package/dist/lib/control.js +148 -34
  389. package/dist/lib/control.js.map +1 -1
  390. package/dist/lib/controller-restore.d.ts.map +1 -1
  391. package/dist/lib/controller-restore.js +12 -7
  392. package/dist/lib/controller-restore.js.map +1 -1
  393. package/dist/lib/credential-authority.d.ts.map +1 -1
  394. package/dist/lib/credential-authority.js +3 -0
  395. package/dist/lib/credential-authority.js.map +1 -1
  396. package/dist/lib/credential-exports.d.ts +17 -0
  397. package/dist/lib/credential-exports.d.ts.map +1 -0
  398. package/dist/lib/credential-exports.js +21 -0
  399. package/dist/lib/credential-exports.js.map +1 -0
  400. package/dist/lib/debug-flag.d.ts +4 -0
  401. package/dist/lib/debug-flag.d.ts.map +1 -0
  402. package/dist/lib/debug-flag.js +7 -0
  403. package/dist/lib/debug-flag.js.map +1 -0
  404. package/dist/lib/default-persona.d.ts +2 -0
  405. package/dist/lib/default-persona.d.ts.map +1 -1
  406. package/dist/lib/default-persona.js +2 -0
  407. package/dist/lib/default-persona.js.map +1 -1
  408. package/dist/lib/delivery-proc.d.ts +1 -1
  409. package/dist/lib/delivery-proc.d.ts.map +1 -1
  410. package/dist/lib/delivery-proc.js +5 -4
  411. package/dist/lib/delivery-proc.js.map +1 -1
  412. package/dist/lib/delivery-responder.d.ts +7 -3
  413. package/dist/lib/delivery-responder.d.ts.map +1 -1
  414. package/dist/lib/delivery-responder.js +8 -4
  415. package/dist/lib/delivery-responder.js.map +1 -1
  416. package/dist/lib/denied-write.d.ts +8 -0
  417. package/dist/lib/denied-write.d.ts.map +1 -0
  418. package/dist/lib/denied-write.js +24 -0
  419. package/dist/lib/denied-write.js.map +1 -0
  420. package/dist/lib/endpoint-capability-gates.js +2 -2
  421. package/dist/lib/endpoint-capability-gates.js.map +1 -1
  422. package/dist/lib/flag-value-refusal.d.ts +8 -0
  423. package/dist/lib/flag-value-refusal.d.ts.map +1 -0
  424. package/dist/lib/flag-value-refusal.js +10 -0
  425. package/dist/lib/flag-value-refusal.js.map +1 -0
  426. package/dist/lib/install-umask.d.ts +5 -0
  427. package/dist/lib/install-umask.d.ts.map +1 -1
  428. package/dist/lib/install-umask.js +25 -0
  429. package/dist/lib/install-umask.js.map +1 -1
  430. package/dist/lib/interrupt-notice.d.ts +23 -1
  431. package/dist/lib/interrupt-notice.d.ts.map +1 -1
  432. package/dist/lib/interrupt-notice.js +27 -6
  433. package/dist/lib/interrupt-notice.js.map +1 -1
  434. package/dist/lib/interrupt-report.d.ts +7 -0
  435. package/dist/lib/interrupt-report.d.ts.map +1 -0
  436. package/dist/lib/interrupt-report.js +24 -0
  437. package/dist/lib/interrupt-report.js.map +1 -0
  438. package/dist/lib/isolated-broker.d.ts +1 -1
  439. package/dist/lib/isolated-broker.d.ts.map +1 -1
  440. package/dist/lib/isolated-broker.js +17 -8
  441. package/dist/lib/isolated-broker.js.map +1 -1
  442. package/dist/lib/legacy-start.d.ts +8 -6
  443. package/dist/lib/legacy-start.d.ts.map +1 -1
  444. package/dist/lib/legacy-start.js +36 -36
  445. package/dist/lib/legacy-start.js.map +1 -1
  446. package/dist/lib/manager-choice.d.ts +92 -4
  447. package/dist/lib/manager-choice.d.ts.map +1 -1
  448. package/dist/lib/manager-choice.js +338 -23
  449. package/dist/lib/manager-choice.js.map +1 -1
  450. package/dist/lib/manager-proc.d.ts.map +1 -1
  451. package/dist/lib/manager-proc.js +7 -6
  452. package/dist/lib/manager-proc.js.map +1 -1
  453. package/dist/lib/manifest/index.d.ts +5 -1
  454. package/dist/lib/manifest/index.d.ts.map +1 -1
  455. package/dist/lib/manifest/index.js +50 -5
  456. package/dist/lib/manifest/index.js.map +1 -1
  457. package/dist/lib/manifest/preflight.d.ts +4 -0
  458. package/dist/lib/manifest/preflight.d.ts.map +1 -1
  459. package/dist/lib/manifest/preflight.js +18 -1
  460. package/dist/lib/manifest/preflight.js.map +1 -1
  461. package/dist/lib/manifest/resolve.d.ts +8 -0
  462. package/dist/lib/manifest/resolve.d.ts.map +1 -1
  463. package/dist/lib/manifest/resolve.js +104 -11
  464. package/dist/lib/manifest/resolve.js.map +1 -1
  465. package/dist/lib/missing-flags.js +1 -1
  466. package/dist/lib/missing-flags.js.map +1 -1
  467. package/dist/lib/nats-bin.d.ts +28 -5
  468. package/dist/lib/nats-bin.d.ts.map +1 -1
  469. package/dist/lib/nats-bin.js +85 -7
  470. package/dist/lib/nats-bin.js.map +1 -1
  471. package/dist/lib/nearest-word.d.ts +14 -0
  472. package/dist/lib/nearest-word.d.ts.map +1 -0
  473. package/dist/lib/nearest-word.js +76 -0
  474. package/dist/lib/nearest-word.js.map +1 -0
  475. package/dist/lib/no-expiry-record.d.ts +8 -0
  476. package/dist/lib/no-expiry-record.d.ts.map +1 -0
  477. package/dist/lib/no-expiry-record.js +27 -0
  478. package/dist/lib/no-expiry-record.js.map +1 -0
  479. package/dist/lib/paths.d.ts +31 -0
  480. package/dist/lib/paths.d.ts.map +1 -1
  481. package/dist/lib/paths.js +92 -2
  482. package/dist/lib/paths.js.map +1 -1
  483. package/dist/lib/persona-files.d.ts +29 -6
  484. package/dist/lib/persona-files.d.ts.map +1 -1
  485. package/dist/lib/persona-files.js +179 -36
  486. package/dist/lib/persona-files.js.map +1 -1
  487. package/dist/lib/personas.d.ts +18 -1
  488. package/dist/lib/personas.d.ts.map +1 -1
  489. package/dist/lib/personas.js +65 -6
  490. package/dist/lib/personas.js.map +1 -1
  491. package/dist/lib/prompts.d.ts +7 -1
  492. package/dist/lib/prompts.d.ts.map +1 -1
  493. package/dist/lib/prompts.js +43 -3
  494. package/dist/lib/prompts.js.map +1 -1
  495. package/dist/lib/registry-errors.d.ts +2 -1
  496. package/dist/lib/registry-errors.d.ts.map +1 -1
  497. package/dist/lib/registry-errors.js +6 -2
  498. package/dist/lib/registry-errors.js.map +1 -1
  499. package/dist/lib/reset-space-plan.d.ts +2 -0
  500. package/dist/lib/reset-space-plan.d.ts.map +1 -1
  501. package/dist/lib/reset-space-plan.js +1 -1
  502. package/dist/lib/reset-space-plan.js.map +1 -1
  503. package/dist/lib/restore.d.ts +45 -3
  504. package/dist/lib/restore.d.ts.map +1 -1
  505. package/dist/lib/restore.js +233 -39
  506. package/dist/lib/restore.js.map +1 -1
  507. package/dist/lib/rolled-back-runs.d.ts +36 -0
  508. package/dist/lib/rolled-back-runs.d.ts.map +1 -0
  509. package/dist/lib/rolled-back-runs.js +96 -0
  510. package/dist/lib/rolled-back-runs.js.map +1 -0
  511. package/dist/lib/service-custody-win32.d.ts +25 -0
  512. package/dist/lib/service-custody-win32.d.ts.map +1 -0
  513. package/dist/lib/service-custody-win32.js +67 -0
  514. package/dist/lib/service-custody-win32.js.map +1 -0
  515. package/dist/lib/service-definitions.d.ts +16 -3
  516. package/dist/lib/service-definitions.d.ts.map +1 -1
  517. package/dist/lib/service-definitions.js +99 -27
  518. package/dist/lib/service-definitions.js.map +1 -1
  519. package/dist/lib/service-instances.d.ts +46 -5
  520. package/dist/lib/service-instances.d.ts.map +1 -1
  521. package/dist/lib/service-instances.js +112 -18
  522. package/dist/lib/service-instances.js.map +1 -1
  523. package/dist/lib/service-journal.js +1 -1
  524. package/dist/lib/service-journal.js.map +1 -1
  525. package/dist/lib/service-presets.d.ts.map +1 -1
  526. package/dist/lib/service-presets.js +16 -0
  527. package/dist/lib/service-presets.js.map +1 -1
  528. package/dist/lib/service-process.d.ts +53 -15
  529. package/dist/lib/service-process.d.ts.map +1 -1
  530. package/dist/lib/service-process.js +533 -86
  531. package/dist/lib/service-process.js.map +1 -1
  532. package/dist/lib/service-systemd-install.js +1 -1
  533. package/dist/lib/service-systemd-install.js.map +1 -1
  534. package/dist/lib/space-streams.d.ts +18 -0
  535. package/dist/lib/space-streams.d.ts.map +1 -0
  536. package/dist/lib/space-streams.js +35 -0
  537. package/dist/lib/space-streams.js.map +1 -0
  538. package/dist/lib/spawn-defaults.d.ts +25 -1
  539. package/dist/lib/spawn-defaults.d.ts.map +1 -1
  540. package/dist/lib/spawn-defaults.js +37 -1
  541. package/dist/lib/spawn-defaults.js.map +1 -1
  542. package/dist/lib/stack-journal.d.ts +157 -14
  543. package/dist/lib/stack-journal.d.ts.map +1 -1
  544. package/dist/lib/stack-journal.js +406 -49
  545. package/dist/lib/stack-journal.js.map +1 -1
  546. package/dist/lib/stack-listeners.d.ts +17 -0
  547. package/dist/lib/stack-listeners.d.ts.map +1 -0
  548. package/dist/lib/stack-listeners.js +54 -0
  549. package/dist/lib/stack-listeners.js.map +1 -0
  550. package/dist/lib/stack-members.d.ts +13 -0
  551. package/dist/lib/stack-members.d.ts.map +1 -0
  552. package/dist/lib/stack-members.js +24 -0
  553. package/dist/lib/stack-members.js.map +1 -0
  554. package/dist/lib/stack-resume.d.ts.map +1 -1
  555. package/dist/lib/stack-resume.js +5 -2
  556. package/dist/lib/stack-resume.js.map +1 -1
  557. package/dist/lib/stack-runs.d.ts +34 -0
  558. package/dist/lib/stack-runs.d.ts.map +1 -0
  559. package/dist/lib/stack-runs.js +75 -0
  560. package/dist/lib/stack-runs.js.map +1 -0
  561. package/dist/lib/status.d.ts +11 -0
  562. package/dist/lib/status.d.ts.map +1 -1
  563. package/dist/lib/status.js +4 -5
  564. package/dist/lib/status.js.map +1 -1
  565. package/dist/lib/stdout-owner.d.ts +12 -3
  566. package/dist/lib/stdout-owner.d.ts.map +1 -1
  567. package/dist/lib/stdout-owner.js +33 -5
  568. package/dist/lib/stdout-owner.js.map +1 -1
  569. package/dist/lib/store-dir.d.ts +68 -4
  570. package/dist/lib/store-dir.d.ts.map +1 -1
  571. package/dist/lib/store-dir.js +253 -17
  572. package/dist/lib/store-dir.js.map +1 -1
  573. package/dist/lib/team-additive-attempt.d.ts +1 -1
  574. package/dist/lib/team-channel-removal.d.ts.map +1 -1
  575. package/dist/lib/team-channel-removal.js +4 -0
  576. package/dist/lib/team-channel-removal.js.map +1 -1
  577. package/dist/lib/team-deploy-inspection.d.ts +13 -0
  578. package/dist/lib/team-deploy-inspection.d.ts.map +1 -1
  579. package/dist/lib/team-deploy-inspection.js +12 -0
  580. package/dist/lib/team-deploy-inspection.js.map +1 -1
  581. package/dist/lib/team-text.d.ts +6 -0
  582. package/dist/lib/team-text.d.ts.map +1 -0
  583. package/dist/lib/team-text.js +36 -0
  584. package/dist/lib/team-text.js.map +1 -0
  585. package/dist/lib/transient.d.ts +14 -8
  586. package/dist/lib/transient.d.ts.map +1 -1
  587. package/dist/lib/transient.js +72 -11
  588. package/dist/lib/transient.js.map +1 -1
  589. package/dist/lib/unusable-file.d.ts +13 -0
  590. package/dist/lib/unusable-file.d.ts.map +1 -0
  591. package/dist/lib/unusable-file.js +12 -0
  592. package/dist/lib/unusable-file.js.map +1 -0
  593. package/dist/lib/up-report.d.ts +6 -0
  594. package/dist/lib/up-report.d.ts.map +1 -1
  595. package/dist/lib/up-report.js +13 -0
  596. package/dist/lib/up-report.js.map +1 -1
  597. package/dist/lib/verdict.d.ts +14 -0
  598. package/dist/lib/verdict.d.ts.map +1 -0
  599. package/dist/lib/verdict.js +15 -0
  600. package/dist/lib/verdict.js.map +1 -0
  601. package/dist/managed-handoff.d.ts +11 -6
  602. package/dist/managed-handoff.d.ts.map +1 -1
  603. package/dist/managed-handoff.js +27 -18
  604. package/dist/managed-handoff.js.map +1 -1
  605. package/dist/render.d.ts +5 -2
  606. package/dist/render.d.ts.map +1 -1
  607. package/dist/render.js +44 -10
  608. package/dist/render.js.map +1 -1
  609. package/dist/telemetry.d.ts +4 -3
  610. package/dist/telemetry.d.ts.map +1 -1
  611. package/dist/telemetry.js +14 -6
  612. package/dist/telemetry.js.map +1 -1
  613. package/dist/ui.d.ts +3 -2
  614. package/dist/ui.d.ts.map +1 -1
  615. package/dist/ui.js +6 -4
  616. package/dist/ui.js.map +1 -1
  617. package/dist/view/mesh-view.d.ts.map +1 -1
  618. package/dist/view/mesh-view.js +4 -1
  619. package/dist/view/mesh-view.js.map +1 -1
  620. package/dist/watch-data.d.ts +9 -1
  621. package/dist/watch-data.d.ts.map +1 -1
  622. package/dist/watch-data.js +17 -3
  623. package/dist/watch-data.js.map +1 -1
  624. package/dist/watch-json.js +4 -3
  625. package/dist/watch-json.js.map +1 -1
  626. package/package.json +5 -5
@@ -1,13 +1,13 @@
1
- import { existsSync, lstatSync, readdirSync, readFileSync, rmSync, statSync } from "node:fs";
1
+ import { existsSync, lstatSync, readdirSync, rmSync, statSync } from "node:fs";
2
2
  import { homedir } from "node:os";
3
3
  import { basename, join, relative, resolve as resolvePath } from "node:path";
4
4
  import {} from "@cotal-ai/core";
5
- import { CommandFailure, isCommandFailure, localRecordName, presentationOf, abortMaintenanceCut, acquireMaintenanceLock, assertSingleSpaceBroker, authDir, beginMaintenanceCut, clearPreservationCommitIntent, clearPreservationPrepareIntent, completeMaintenanceCut, loadMeshes, meshesForRoot, localProcessPath, localProcessPathCandidates, canonicalRoot, brokerAddressForDisplay, findMesh, findPreparedSpace, getCurrent, localMeshesForRoot, preparedSpaceAt, soleSpaceOf, writeResult, readMaintenanceJournal, readContainedRecord, readMaintenanceResumeDocument, readPreservationCommitIntent, readPreservationPrepareIntent, readStoreIdentity, recordPreservationManagerCommit, releaseMaintenanceLock, removeMeshesByRoot, sameStoreIdentity, writePreservationCommitIntent, writePreservationPrepareIntent, DELIVERY_PIDFILE, MANAGER_DELIVERY_AWARE_MARKER, MANAGER_PIDFILE, WEB_PIDFILE, MAINTENANCE_RESUME_DOCUMENT_VERSION, writeMaintenanceResumeDocument, loadSeatWriterGeneration, materializeFromManifest, seatCheckpointDir, } from "@cotal-ai/workspace";
5
+ import { CommandFailure, isCommandFailure, localRecordName, presentationOf, renderReport, terminalWidth, abortMaintenanceCut, acquireMaintenanceLock, assertSingleSpaceBroker, authDir, beginMaintenanceCut, clearPreservationCommitIntent, clearPreservationPrepareIntent, completeMaintenanceCut, loadMeshes, meshesForRoot, localProcessPath, localProcessPathCandidates, canonicalRoot, brokerAddressForDisplay, findMesh, findPreparedSpace, getCurrent, localMeshesForRoot, preparedSpaceAt, soleSpaceOf, writeResult, readMaintenanceJournal, readContainedRecord, readMaintenanceResumeDocument, readPreservationCommitIntent, readPreservationPrepareIntent, readStoreIdentity, recordPreservationManagerCommit, keepsRegistration, releaseMaintenanceLock, removeMeshesByRoot, sameStoreIdentity, writePreservationCommitIntent, writePreservationPrepareIntent, DELIVERY_PIDFILE, MANAGER_DELIVERY_AWARE_MARKER, MANAGER_PIDFILE, WEB_PIDFILE, MAINTENANCE_RESUME_DOCUMENT_VERSION, writeMaintenanceResumeDocument, loadSeatWriterGeneration, materializeFromManifest, seatCheckpointDir, restoreLeftOut, } from "@cotal-ai/workspace";
6
6
  import { jetstreamManager } from "@nats-io/jetstream";
7
7
  import { DEV_OWNER, dialerFor, isReachable, realDirNoSymlink, LEASE_TTL_MS, MANAGER_LEASE_KEY, MANAGER_LEASE_TTL_MS, deliveryBucket, managerBucket, presenceBucket, parsePrincipalKey, principalKey, standaloneConnectOpts, } from "@cotal-ai/core";
8
8
  import { localProcessSurface } from "../ext-loader.js";
9
- import { c } from "../ui.js";
10
- import { cotalRoot } from "../lib/paths.js";
9
+ import { c, stderrLine } from "../ui.js";
10
+ import { cotalRoot, linkedCotalRefusal } from "../lib/paths.js";
11
11
  import { parsePid, probeLiveness, readPidfile } from "@cotal-ai/workspace";
12
12
  import { resolveRuntimeSpace } from "../lib/status.js";
13
13
  import { downManifest } from "./down-manifest.js";
@@ -17,7 +17,7 @@ import { additiveTeamRecordedState, listAdditiveTeamAttempts, retainedAdditiveTe
17
17
  import { service, serviceComplete, validateServiceArguments } from "./service-registry.js";
18
18
  import { stopNamedServiceSet } from "./service-set-stop.js";
19
19
  import { readLocalServiceCensus } from "../lib/service-census.js";
20
- import { assertBareDownServicesVerified, bareDownServicesView, planBareDownServices, stopBareDownServices } from "./down-services.js";
20
+ import { assertNoLiveServices, bareDownServicesView, liveServicesRefusal, planBareDownServices } from "./down-services.js";
21
21
  import { askManager, resolveControlTarget } from "../lib/control.js";
22
22
  import { connectOrExit, userViewAuthOrExit } from "../lib/connect.js";
23
23
  import { waitForEndpointUnreachable } from "../lib/endpoint-cut.js";
@@ -25,8 +25,10 @@ import { captureSeatCheckpoint } from "../lib/seat-capture.js";
25
25
  import { processRecorded, stopLocalProcess } from "../lib/local-process-stop.js";
26
26
  import { stopManager } from "../lib/manager-proc.js";
27
27
  import { removeDeliveryCredentials, stopDelivery } from "../lib/delivery-proc.js";
28
- import { controllerStackRecorded, nothingRunning, stackDown, validateStackDownArguments } from "./stack-down.js";
28
+ import { controllerStackRecorded, nothingRunning, sameDown, stackDown, stackRootElsewhere, validateStackDownArguments } from "./stack-down.js";
29
+ import { goneRootDown, goneRootStackDown, validateGoneRootDownArguments } from "./stack-gone.js";
29
30
  import { readStackJournal, recordedProcessLine } from "../lib/stack-journal.js";
31
+ import { restoreNextStep } from "../lib/restore.js";
30
32
  import { ownStdoutErrors } from "../lib/stdout-owner.js";
31
33
  /** Complete selective component names without importing installed packages. */
32
34
  export function downComplete(argv) {
@@ -59,13 +61,21 @@ export function validateDownArguments(args) {
59
61
  validateServiceArguments({ ...args, positionals: ["stop", name] });
60
62
  return;
61
63
  }
64
+ // A `.cotal` that is a link, or leads nowhere, is refused before anything reads through it.
65
+ const linked = linkedCotalRefusal("down");
66
+ if (linked)
67
+ throw linked;
62
68
  if (args.values.instance !== undefined)
63
69
  throw new CommandFailure("refused", "USAGE_INVALID", "--instance needs one explicit service definition name");
70
+ if (goneRootDown(args.values))
71
+ return validateGoneRootDownArguments(args.values);
64
72
  if (controllerStackRecorded(cotalRoot()))
65
73
  return validateStackDownArguments(cotalRoot(), args.values);
66
74
  refuseStackElsewhere(args.values);
67
75
  if (args.values["abandon-stop"] !== undefined)
68
76
  throw new CommandFailure("refused", "UNSUPPORTED", "--abandon-stop applies only to a controller stack's member stop, and this root has none; nothing was abandoned");
77
+ if (args.values["abandon-launch"] !== undefined)
78
+ throw new CommandFailure("refused", "UNSUPPORTED", "--abandon-launch applies only to a controller stack's member launch, and this root has none; nothing was abandoned");
69
79
  if (args.values["dry-run"] === true && args.values.yes === true)
70
80
  throw new CommandFailure("refused", "USAGE_INVALID", "--yes acknowledges a guarded apply, not a read-only stack preview");
71
81
  if ((args.values.json !== undefined || args.values.plain !== undefined) && args.values["dry-run"] === true && args.values.file === undefined && args.values.run === undefined && args.values["preserve-state"] === undefined && args.values["store-dir"] === undefined && args.values["session-store"] === undefined)
@@ -75,26 +85,27 @@ export function validateDownArguments(args) {
75
85
  }
76
86
  /** A bare `down` stops only the stack of the folder it runs in. When this folder's root holds no
77
87
  * stack and the space named by `--space`, or else the selected one, is a controller stack rooted at
78
- * another folder, refuse with that space and its root, so the remedy is a `down` that stops it. */
88
+ * another folder, refuse with that space and its root, so the remedy is a `down` that stops it. A
89
+ * folder with its own `.cotal` keeps the selected space from applying; a `--space` it holds no
90
+ * registration for still names that root. */
79
91
  function refuseStackElsewhere(values) {
80
92
  if (values.file !== undefined || values.run !== undefined)
81
93
  return;
82
94
  const here = canonicalRoot(cotalRoot());
83
95
  let space, root;
84
96
  try {
85
- if (localMeshesForRoot(here).length || existsSync(join(here, ".cotal")) && here !== canonicalRoot(homedir()))
97
+ const local = localMeshesForRoot(here);
98
+ if (typeof values.space === "string" ? local.some((mesh) => mesh.space === values.space) : local.length || existsSync(join(here, ".cotal")) && here !== canonicalRoot(homedir()))
86
99
  return;
87
100
  space = typeof values.space === "string" ? values.space : getCurrent();
88
- const mesh = space === undefined ? undefined : findMesh(space);
89
- if (!mesh || mesh.origin !== "up" || canonicalRoot(mesh.root) === here || !controllerStackRecorded(mesh.root))
90
- return;
91
- root = mesh.root;
101
+ root = space === undefined ? undefined : stackRootElsewhere(space, here);
92
102
  }
93
103
  catch {
94
104
  return;
95
105
  }
96
- const again = ["cotal down", ...["dry-run", "with-agents", "preserve-state", "yes"].filter((flag) => values[flag] === true).map((flag) => `--${flag}`)].join(" ");
97
- throw new CommandFailure("refused", "TARGET_NOT_FOUND", `${values.space === undefined ? `the selected space "${space}" is` : `--space ${space} names`} a controller stack rooted at ${root}, and \`cotal down\` stops only the stack of the folder it runs in; this folder has none, so nothing was stopped`, { target: { root: here, space, stackRoot: root }, remedy: `run \`${again}\` from ${root}` });
106
+ if (root === undefined)
107
+ return;
108
+ throw new CommandFailure("refused", "TARGET_NOT_FOUND", `${values.space === undefined ? `the selected space "${space}" is` : `--space ${space} names`} a controller stack rooted at ${root}, and \`cotal down\` stops only the stack of the folder it runs in; this folder has none, so nothing was stopped`, { target: { root: here, space, stackRoot: root }, remedy: `run \`${sameDown(values)}\` from ${root}` });
98
109
  }
99
110
  /** The one route that stops the stack `up` starts from the machine home. */
100
111
  const MACHINE_HOME_STOP = "stop the machine-home stack with cotal down --preserve-state, which keeps its state for the next cotal up";
@@ -103,18 +114,18 @@ function previewWholeStack(args) {
103
114
  const root = canonicalRoot(cotalRoot());
104
115
  const selectedSpace = args.values.space;
105
116
  const target = { root, ...(selectedSpace ? { space: selectedSpace } : {}) };
106
- if (root === canonicalRoot(homedir()))
107
- throw new CommandFailure("refused", "CONFLICT", "the machine home is not an isolated project root for a whole-stack preview", { target, remedy: MACHINE_HOME_STOP });
117
+ // A stack an earlier release started in the machine home is read like any other; only its stop differs.
118
+ const home = root === canonicalRoot(homedir());
108
119
  let mesh;
109
120
  let maintenance;
110
121
  let components;
111
- let services, serviceStops;
122
+ let services, serviceChecks;
112
123
  let additiveRecords, additiveAttempts;
113
124
  let bootAttempts, bootSummaries;
114
125
  let otherBrokerRegistrations;
115
126
  // A root with no control directory, or with no stack registered at it, holds no stack. That is a
116
127
  // plain miss, not records that could not be read.
117
- const noStack = () => new CommandFailure("refused", "TARGET_NOT_FOUND", "there is no stack at this folder's root, so there is nothing to preview", { target, remedy: "run `cotal down --dry-run` from the folder where `cotal up` started the stack" });
128
+ const noStack = () => noStackHere(target, "preview");
118
129
  try {
119
130
  try {
120
131
  lstatSync(join(root, ".cotal"));
@@ -146,7 +157,7 @@ function previewWholeStack(args) {
146
157
  return { name: component.name, label: component.label, pidfile, recorded: processRecorded(component, context), liveness: state.liveness, pid: state.pid ?? null, note: state.note ?? null };
147
158
  });
148
159
  services = readLocalServiceCensus(mesh.space);
149
- serviceStops = planBareDownServices(mesh.space);
160
+ serviceChecks = planBareDownServices(mesh.space);
150
161
  additiveRecords = listLedgerFiles(root, { requireReadable: true });
151
162
  additiveAttempts = listAdditiveTeamAttempts(root);
152
163
  bootAttempts = listFreshTeamAttempts(root);
@@ -157,11 +168,14 @@ function previewWholeStack(args) {
157
168
  throw error;
158
169
  throw new CommandFailure("refused", "CONFLICT", "the local stack, process or service records, or maintenance state could not be inspected consistently; no stop target was inferred", { target });
159
170
  }
171
+ const homeRuns = home && components.some((row) => row.liveness !== "dead");
160
172
  const byBootId = new Map(bootSummaries.valid.map((summary) => [summary.deploymentId, summary]));
161
173
  const unsettledBootAttempts = bootAttempts.valid.filter((attempt) => !freshTeamAttemptSettled(attempt, byBootId.get(attempt.deploymentId)));
174
+ // A preview reports the service refusal the real stop would give instead of refusing itself.
175
+ const refusal = liveServicesRefusal(mesh.space, serviceChecks, "down");
162
176
  const result = { kind: "whole-stack-local-preview", space: mesh.space, root, recordedBroker: brokerAddressForDisplay(mesh.server) ?? null,
163
177
  maintenance: maintenance?.state ?? "none-recorded", withAgentsRequested: args.values["with-agents"] === true,
164
- components, ...services, serviceStops, otherBrokerRegistrations,
178
+ components, ...services, serviceChecks, otherBrokerRegistrations,
165
179
  additiveLedgers: additiveRecords.valid.map(({ ledger }) => ({ deploymentId: ledger.runId, space: ledger.space, agents: ledger.created.agents.length, channels: ledger.created.channels.length })),
166
180
  unreadableAdditiveLedgers: additiveRecords.refused.map(({ path }) => path),
167
181
  retainedAdditiveAttempts: additiveAttempts.valid.map((attempt) => ({ deploymentId: attempt.deploymentId, space: attempt.space, server: brokerAddressForDisplay(attempt.server) ?? "not displayable", createdAt: attempt.createdAt, recordedState: additiveTeamRecordedState(attempt, additiveAttempts) })),
@@ -171,6 +185,7 @@ function previewWholeStack(args) {
171
185
  brokerSharing: "exact recorded address matches only; aliases and live tenants not checked", agentImpact: "not-established", serviceInstanceScope: "selected-space workstation records only; root ownership and live state not established",
172
186
  dryRun: true, effectAttempted: false, reserved: false };
173
187
  writeResult(presentationOf(args.values), { command: "down", target: { root, space: mesh.space }, result,
188
+ ...(refusal ? { warnings: [{ code: refusal.code, target: refusal.target, message: `the real stop would refuse: ${refusal.message}${refusal.remedy ? `; ${refusal.remedy}` : ""}` }] } : {}),
174
189
  completeness: "partial", partial: { message: "Pidfiles, additive ledgers, service records, supervisor receipts and retained attempts are not a complete owned stack or native agent-impact plan. No process identity, service root ownership, broker sharing or stop authority was established." } }, (data) => ({ sections: [
175
190
  { title: "Whole-stack local inspection", blocks: [{ kind: "fields", rows: [["Space", data.space], ["Root", data.root], ["Maintenance", data.maintenance], ["Saved service definitions", String(data.serviceDefinitions.length)], ["Saved service instances", String(data.serviceRecords.length)], ["Supervisor receipts", String(data.supervisors.length)], ["Retained native attempts", String(data.nativeAttempts.length)], ["Other exact-address registrations", String(data.otherBrokerRegistrations.length)], ["Additive ledgers", String(data.additiveLedgers.length)], ["Unreadable additive ledgers", String(data.unreadableAdditiveLedgers.length)], ["Retained additive deployments", String(data.retainedAdditiveAttempts.length)], ["Unreadable additive attempts", String(data.unreadableAdditiveAttempts.length)], ["Unsettled fresh attempts", String(data.unsettledBootAttempts.length)], ["Unreadable fresh records", String(data.unreadableBootRecords.length)], ["Deprovision agents", data.withAgentsRequested ? "requested; impact unknown" : "not requested; process impact unknown"], ["Stop authority", "not established"]] }, { kind: "lines", lines: [{ text: "This is a read of local records, not a stop plan. Liveness does not prove identity, and service, broker-sharing and agent consequences are not checked. No process was signalled.", tone: "waiting" }] }] },
176
191
  { title: "Recorded broker address matches", blocks: [data.otherBrokerRegistrations.length ? { kind: "table", columns: [{ key: "space", label: "Other space" }, { key: "root", label: "Recorded root" }, { key: "origin", label: "Registration" }], rows: data.otherBrokerRegistrations.slice(0, 100) } : { kind: "lines", lines: ["No other registration uses this exact broker address in the local workstation registry."] }, { kind: "lines", lines: [...(data.otherBrokerRegistrations.length > 100 ? ["Additional exact-address matches are in JSON."] : []), "An exact-address match is a sharing warning. No match is not proof of an exclusive broker: aliases, remote tenants and live attachments were not checked."] }] },
@@ -180,9 +195,12 @@ function previewWholeStack(args) {
180
195
  { title: "Local process records", blocks: [data.components.length ? { kind: "table", columns: [{ key: "name", label: "Component" }, { key: "state", label: "Pidfile probe" }, { key: "record", label: "Recorded" }, { key: "pid", label: "PID" }], rows: data.components.map((row) => ({ name: row.label, state: row.liveness, record: row.recorded ? "yes" : "no", pid: row.pid === null ? "not pinned" : String(row.pid) })) } : { kind: "lines", lines: ["No local process descriptors were found."] }] },
181
196
  { title: "Selected-space service definitions", blocks: [data.serviceDefinitions.length ? { kind: "table", columns: [{ key: "name", label: "Definition" }, { key: "launch", label: "Launch type" }, { key: "instances", label: "Instance records" }], rows: data.serviceDefinitions.slice(0, 100).map((row) => ({ name: row.name, launch: row.launch, instances: String(row.instanceRecords) })) } : { kind: "lines", lines: ["No saved service definitions in this space's workstation store."] }, ...(data.serviceDefinitions.length > 100 ? [{ kind: "lines", lines: ["Additional definitions are in JSON."] }] : [])] },
182
197
  { title: "Selected-space service instances", blocks: [data.serviceRecords.length ? { kind: "table", columns: [{ key: "definition", label: "Definition" }, { key: "instance", label: "Full instance" }, { key: "state", label: "Recorded state" }, { key: "host", label: "Recorded host" }], rows: data.serviceRecords.slice(0, 100).map((row) => ({ definition: row.definition, instance: row.instanceId, state: row.recordedState, host: row.host })) } : { kind: "lines", lines: ["No saved service instances in this space's workstation store."] }, { kind: "lines", lines: [...(data.serviceRecords.length > 100 ? ["Additional service records are in JSON."] : []), "These records are scoped by space, not proven owned by this project root. Their recorded state is not live process or supervisor status; the next section observes each process on this host."] }] },
183
- ...(data.serviceStops.length ? bareDownServicesView(data.space, data.serviceStops).sections : [{ title: "Services bare down stops first", blocks: [{ kind: "lines", lines: ["No saved service instance in this space, so bare down stops no service first."] }] }]),
198
+ ...(data.serviceChecks.length ? bareDownServicesView(data.space, data.serviceChecks).sections : [{ title: "Services bare down checks first", blocks: [{ kind: "lines", lines: ["No saved service instance in this space, so none blocks bare down."] }] }]),
184
199
  { title: "Recorded native supervisors", blocks: [data.supervisors.length ? { kind: "table", columns: [{ key: "definition", label: "Definition" }, { key: "instance", label: "Full instance" }, { key: "mechanism", label: "Mechanism" }, { key: "unit", label: "Recorded unit" }], rows: data.supervisors.slice(0, 100).map((row) => ({ definition: row.definition, instance: row.instanceId, mechanism: row.mechanism, unit: row.unit })) } : { kind: "lines", lines: ["No supervisor receipts in this space's workstation store."] }, { kind: "lines", lines: [...(data.supervisors.length > 100 ? ["Additional supervisor receipts are in JSON."] : []), "A receipt is not a live unit observation or authority to stop it. No native service status request was made."] }] },
185
200
  { title: "Retained native attempts", blocks: [data.nativeAttempts.length ? { kind: "table", columns: [{ key: "kind", label: "Action" }, { key: "definition", label: "Definition" }, { key: "instance", label: "Full instance" }, { key: "step", label: "Step" }, { key: "position", label: "Position" }], rows: data.nativeAttempts.slice(0, 100).map((row) => ({ kind: row.kind, definition: row.definition, instance: row.instanceId, step: row.step, position: row.position })) } : { kind: "lines", lines: ["No retained install, uninstall or unit-action attempts in this space's workstation store."] }, { kind: "lines", lines: [...(data.nativeAttempts.length > 100 ? ["Additional attempts and their full IDs are in JSON."] : []), "A submitted or unknown step may already have changed native state. This preview neither reconciles nor retries it."] }] },
201
+ ...(!home ? [] : homeRuns
202
+ ? [{ title: "Next", blocks: [{ kind: "commands", items: [{ command: "cotal down --preserve-state", description: "Stop the machine-home stack and keep its state for the next cotal up" }] }] }]
203
+ : [{ title: "Next", blocks: [{ kind: "lines", lines: ["No process of the machine-home stack is running, so there is nothing to stop."] }] }]),
186
204
  ] }));
187
205
  }
188
206
  /** A bare stop, its preview included: no flag beyond --dry-run, --with-agents, --yes and the
@@ -220,10 +238,25 @@ function stoppedLegacyStack() {
220
238
  return undefined;
221
239
  return { root, ...(space === undefined ? {} : { space }), started };
222
240
  }
241
+ /** The refusal for a folder with no stack. Its next step is the folder that holds one, or, when this
242
+ * machine has started or registered no stack at all, starting one, as `cotal status` says. A
243
+ * registry this cannot read may hold one. */
244
+ function noStackHere(target, action) {
245
+ let elsewhere;
246
+ try {
247
+ elsewhere = loadMeshes().some((mesh) => mesh.origin !== "manual" && mesh.origin !== "catalog");
248
+ }
249
+ catch {
250
+ elsewhere = true;
251
+ }
252
+ if (!elsewhere)
253
+ return new CommandFailure("refused", "TARGET_NOT_FOUND", `there is no stack at this folder's root, and this machine has no stack started or registered, so there is nothing to ${action}`, { target, remedy: "run `cotal up` in a project" });
254
+ return new CommandFailure("refused", "TARGET_NOT_FOUND", `there is no stack at this folder's root, so there is nothing to ${action}`, { target, remedy: `run \`cotal down${action === "preview" ? " --dry-run" : ""}\` from the folder where \`cotal up\` started the stack` });
255
+ }
223
256
  /** Why bare down found no stack of its own at this root, with the one step that moves it on. */
224
257
  function noOwnedStack(root) {
225
258
  const target = { root };
226
- const absent = new CommandFailure("refused", "TARGET_NOT_FOUND", "there is no stack at this folder's root, so there is nothing to stop", { target, remedy: "run `cotal down` from the folder where `cotal up` started the stack" });
259
+ const absent = noStackHere(target, "stop");
227
260
  const unclassified = new CommandFailure("refused", "CONFLICT", "the local root has no unique owned stack registration and real control directory; no whole-stack stop target was inferred", { target, remedy: "run `cotal status` here to see what this folder records" });
228
261
  if (!existsSync(join(root, ".cotal")))
229
262
  return absent;
@@ -248,14 +281,18 @@ function noOwnedStack(root) {
248
281
  return unclassified;
249
282
  return absent;
250
283
  }
251
- /** Keep the retained pidfile sweep from crossing an exact recorded broker-sharing boundary, and
252
- * return the space's service instances it stops first, each one verified. This is not a complete
253
- * live ownership or agent-impact proof. */
284
+ /** Keep the retained pidfile sweep from crossing an exact recorded broker-sharing boundary or
285
+ * stopping the broker under a saved service that still runs. This is not a complete live ownership
286
+ * or agent-impact proof. */
254
287
  function guardLegacyBareDown() {
255
288
  const root = canonicalRoot(cotalRoot());
256
289
  const target = { root };
257
- if (root === canonicalRoot(homedir()))
290
+ if (root === canonicalRoot(homedir())) {
291
+ // `up` starts no stack in the home, so one that records none has nothing to stop.
292
+ if (!existsSync(join(root, ".cotal")) || !localMeshesForRoot(root).length && !pidRecordsUnder(root))
293
+ throw noOwnedStack(root);
258
294
  throw new CommandFailure("refused", "CONFLICT", "the machine home is not an isolated whole-stack stop root; no process was signalled", { target, remedy: MACHINE_HOME_STOP });
295
+ }
259
296
  let mesh;
260
297
  try {
261
298
  if (!realDirNoSymlink(root, ".cotal"))
@@ -326,9 +363,8 @@ function guardLegacyBareDown() {
326
363
  const other = loadMeshes().filter((row) => row.space !== mesh.space && row.server === mesh.server);
327
364
  if (other.length)
328
365
  throw new CommandFailure("refused", "LIFECYCLE_BLOCKED", "another registered space names this exact broker address; bare down did not stop its shared listener", { target: { ...scoped, otherSpaces: other.map((row) => row.space) }, remedy: "inspect both registrations and their native ownership; an exact-address match is a blocker, while no match does not prove exclusivity" });
329
- const services = planBareDownServices(mesh.space);
330
- assertBareDownServicesVerified(mesh.space, services);
331
- return { space: mesh.space, services };
366
+ assertNoLiveServices(mesh.space, "down");
367
+ return { space: mesh.space };
332
368
  }
333
369
  /** Bare down reads each process record it stops where the record lies, as the stopped-stack census
334
370
  * does. A record that read leaves unread (a link on its path, a record that is not a regular file,
@@ -392,6 +428,10 @@ async function downCommand(args) {
392
428
  return stopNamedServiceSet(args);
393
429
  if (args.positionals.length)
394
430
  return service(namedStopArguments(args), "down");
431
+ // A stack whose folder is gone stops from this machine's records, wherever down runs.
432
+ const gone = goneRootDown(args.values);
433
+ if (gone)
434
+ return goneRootStackDown(gone.space, gone.root, args.values);
395
435
  // A root whose stack the service controller owns stops only through its recorded members.
396
436
  if (controllerStackRecorded(cotalRoot()))
397
437
  return stackDown(cotalRoot(), args.values);
@@ -402,7 +442,7 @@ async function downCommand(args) {
402
442
  // A root that never started a stack never ran a manager, so it has no agents to stop.
403
443
  if (stopped) {
404
444
  const { started, ...target } = stopped;
405
- return nothingRunning(presentationOf(args.values), target, values["with-agents"] === true && values["dry-run"] !== true && started);
445
+ return nothingRunning(presentationOf(args.values), target, values["with-agents"] === true && started, [], values["dry-run"] === true);
406
446
  }
407
447
  }
408
448
  if (values["dry-run"] && !values.file && !values.run && !values["preserve-state"] && !values["store-dir"] && !values["session-store"]?.length) {
@@ -449,15 +489,16 @@ async function downCommand(args) {
449
489
  let folderContext;
450
490
  const folderCtx = () => (folderContext ??= { root: cotalRoot(), space: resolveRuntimeSpace(process.cwd()) });
451
491
  refuseUncontainedRecords(selected, folderCtx());
492
+ // The stop's lines follow the space they stop, as every other report of down begins.
493
+ console.log(`${renderReport({ space: guarded.space, sections: [] }, "rich", terminalWidth(process.stdout))}\n`);
452
494
  // Every dry run returned or was refused above, so from here on this is the whole-stack stop of
453
- // this folder's root. Its services stop first, through the service controller.
454
- await stopBareDownServices(guarded.space, guarded.services, { style: "rich", withAgents: values["with-agents"] === true });
495
+ // this folder's root.
455
496
  let any = false;
456
497
  let allStopped = true;
457
498
  for (const component of selected) {
458
499
  any = processRecorded(component, folderCtx()) || any;
459
500
  if (component.stopLast && !allStopped) {
460
- console.error(c.red(`✗ not stopping ${component.label} because an earlier component did not stop`));
501
+ stderrLine("✗ ", `not stopping ${component.label} because an earlier component did not stop`, c.red);
461
502
  continue;
462
503
  }
463
504
  try {
@@ -471,11 +512,11 @@ async function downCommand(args) {
471
512
  }
472
513
  catch (e) {
473
514
  allStopped = false;
474
- console.error(c.red(`✗ ${e.message}`));
515
+ stderrLine("✗ ", `${e.message}`, c.red);
475
516
  }
476
517
  }
477
518
  if (!allStopped) {
478
- console.error(c.red("✗ not cleanly stopped - keeping artifacts and the registry entry"));
519
+ stderrLine("✗ ", "not cleanly stopped - keeping artifacts and the registry entry", c.red);
479
520
  process.exitCode = 1;
480
521
  return;
481
522
  }
@@ -503,23 +544,21 @@ async function downCommand(args) {
503
544
  process.exit(1);
504
545
  }
505
546
  // The broker owns the mesh registry entry and transient whole-mesh launch material, so they go
506
- // with it.
547
+ // with it. A space named after its own folder keeps its registration, as a controller stack keeps
548
+ // its prepared record, so the name stays this folder's while it is stopped and another folder's
549
+ // bare `up` cannot take it. `space forget` frees it.
507
550
  if (selected.some((component) => component.clearsMesh)) {
508
- rmSync(join(folderCtx().root, ".cotal", "run"), { recursive: true, force: true });
509
- removeMeshesByRoot(folderCtx().root);
551
+ const root = folderCtx().root;
552
+ rmSync(join(root, ".cotal", "run"), { recursive: true, force: true });
553
+ removeMeshesByRoot(root, undefined, localMeshesForRoot(root).find(keepsRegistration)?.space);
510
554
  }
511
555
  if (!any) {
512
556
  console.error(c.red("Nothing running for the local stack (no recorded pidfiles)."));
513
557
  process.exit(1);
514
558
  }
559
+ console.log(`\n${renderReport({ sections: [{ title: "Next", blocks: [{ kind: "commands", items: [{ command: "cotal up", description: "Start it again" }] }] }] }, "rich", terminalWidth(process.stdout))}`);
515
560
  }
516
561
  const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
517
- // The pid parser + liveness probe are the SHARED pid-attribution contract (`lib/pid.ts`), the same
518
- // one `auth-proc` uses - so `cotal down`'s stop of the auth-service (a callout SIGNER) attributes a
519
- // torn pidfile exactly as the direct helper does, instead of the old unbounded parser + two-state
520
- // probe that mapped a kernel-unsignalable value to "dead" and orphaned the process under a clean
521
- // stop. `isAlive` = the probe says the process EXISTS; every caller below feeds it a parsed pid.
522
- export const isAlive = (pid) => probeLiveness(pid) === "alive";
523
562
  /** Registered brokers for this root that answer and have no nats pidfile. Never a kill list. */
524
563
  async function liveUnownedBrokers(context) {
525
564
  const nats = localProcessSurface().find((component) => component.name === "nats");
@@ -534,11 +573,7 @@ async function liveUnownedBrokers(context) {
534
573
  return live;
535
574
  }
536
575
  export function processAlive(component, context) {
537
- const raw = readPidfile(localProcessPath(component.pidFile, context));
538
- if (raw === undefined)
539
- return false;
540
- const pid = parsePid(raw);
541
- return pid !== undefined && isAlive(pid);
576
+ return pidfileState(localProcessPath(component.pidFile, context)).liveness === "alive";
542
577
  }
543
578
  /** Whether a component MIGHT still be running. It fails CLOSED on uncertainty. A component with NO
544
579
  * pidfile, an EMPTY husk, or a valid pid PROVEN dead (ESRCH) is not running. ANY other state - an
@@ -549,13 +584,7 @@ export function processAlive(component, context) {
549
584
  * stopping" but WRONG for those questions: it would count a live auth signer behind a torn pidfile
550
585
  * as stopped. Only an ESRCH-confirmed death (or no record) clears a component. */
551
586
  export function mayBeRunning(component, context) {
552
- const raw = readPidfile(localProcessPath(component.pidFile, context));
553
- if (!raw)
554
- return false; // no record, or an empty pre-protocol husk: no process behind it
555
- const pid = parsePid(raw);
556
- if (pid === undefined)
557
- return true; // unattributable content: cannot prove it gone → may be running
558
- return probeLiveness(pid) !== "dead"; // alive OR unknown → may be running; only ESRCH clears it
587
+ return pidfileState(localProcessPath(component.pidFile, context)).liveness !== "dead";
559
588
  }
560
589
  /** The principal keys of every retained agent in a preservation inventory — the dot-form ids that
561
590
  * appear in the presence roster, so a caller can tell which retained agents are still live. */
@@ -614,6 +643,9 @@ async function preserveStateDown(storeOverride, sessionStores = []) {
614
643
  const all = localProcessSurface();
615
644
  const context = { root, space: mesh.space };
616
645
  const existing = readMaintenanceJournal(root);
646
+ // A completed restore keeps its journal, and a new cut begins only after that journal is retired.
647
+ if (existing && "restore" in existing && existing.state === "active")
648
+ throw new CommandFailure("refused", "LIFECYCLE_BLOCKED", "a completed restore still holds this root's maintenance journal; a new preserve begins only after it is retired, so nothing was stopped", { target: { root, space: mesh.space, attemptId: existing.restore.attemptId }, remedy: restoreNextStep(existing.state, existing.restore.attemptId, restoreLeftOut(existing)) });
617
649
  if (existing && existing.state !== "cut-intent" && existing.state !== "cut-committed" && existing.state !== "ready")
618
650
  throw new Error(`cannot preserve while maintenance state is ${existing.state}`);
619
651
  if (existing && (existing.space !== mesh.space || existing.mode !== mesh.mode ||
@@ -624,6 +656,9 @@ async function preserveStateDown(storeOverride, sessionStores = []) {
624
656
  console.log(c.dim(`state for "${mesh.space}" is already preserved and offline`));
625
657
  return;
626
658
  }
659
+ // A saved service depends on the broker, so the cut does not stop the broker under one. It
660
+ // refuses and stops nothing, as bare down does.
661
+ assertNoLiveServices(mesh.space, "down --preserve-state");
627
662
  let attemptId;
628
663
  let resume;
629
664
  // Set when recovery force-commits a cut whose manager died AFTER stopping children (commit-intent
@@ -1123,18 +1158,12 @@ export function pidfileTargets(space, root) {
1123
1158
  ...every("nats.pid", "nats-server"),
1124
1159
  ];
1125
1160
  }
1126
- /** Shared hardened pid probe: positive integers only, and EPERM means the process exists. */
1161
+ /** The one classifier of a pidfile, read through the shared `readPidfile`: positive integers only,
1162
+ * and EPERM means the process exists. `processAlive` and `mayBeRunning` are its two directions. */
1127
1163
  export function pidfileState(path) {
1128
- let raw;
1129
- try {
1130
- raw = readFileSync(path, "utf8").trim();
1131
- }
1132
- catch (e) {
1133
- // A process removes its own record on exit, so the file can be gone by the time it is read.
1134
- if (e.code === "ENOENT")
1135
- return { liveness: "dead", note: "no pidfile" };
1136
- throw e;
1137
- }
1164
+ const raw = readPidfile(path);
1165
+ if (raw === undefined)
1166
+ return { liveness: "dead", note: "no pidfile" };
1138
1167
  if (raw.startsWith("removing:"))
1139
1168
  return { liveness: "unknown", note: "extension removal in progress" };
1140
1169
  const pid = parsePid(raw);