@cotal-ai/cli 0.100.2 → 0.101.0

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 (618) 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 +263 -129
  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 +344 -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 +135 -27
  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 +130 -31
  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 +45 -4
  447. package/dist/lib/manager-choice.d.ts.map +1 -1
  448. package/dist/lib/manager-choice.js +214 -24
  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-definitions.d.ts +16 -3
  512. package/dist/lib/service-definitions.d.ts.map +1 -1
  513. package/dist/lib/service-definitions.js +99 -27
  514. package/dist/lib/service-definitions.js.map +1 -1
  515. package/dist/lib/service-instances.d.ts +13 -1
  516. package/dist/lib/service-instances.d.ts.map +1 -1
  517. package/dist/lib/service-instances.js +56 -12
  518. package/dist/lib/service-instances.js.map +1 -1
  519. package/dist/lib/service-presets.d.ts.map +1 -1
  520. package/dist/lib/service-presets.js +16 -0
  521. package/dist/lib/service-presets.js.map +1 -1
  522. package/dist/lib/service-process.d.ts +51 -8
  523. package/dist/lib/service-process.d.ts.map +1 -1
  524. package/dist/lib/service-process.js +385 -48
  525. package/dist/lib/service-process.js.map +1 -1
  526. package/dist/lib/space-streams.d.ts +18 -0
  527. package/dist/lib/space-streams.d.ts.map +1 -0
  528. package/dist/lib/space-streams.js +35 -0
  529. package/dist/lib/space-streams.js.map +1 -0
  530. package/dist/lib/spawn-defaults.d.ts +25 -1
  531. package/dist/lib/spawn-defaults.d.ts.map +1 -1
  532. package/dist/lib/spawn-defaults.js +37 -1
  533. package/dist/lib/spawn-defaults.js.map +1 -1
  534. package/dist/lib/stack-journal.d.ts +157 -14
  535. package/dist/lib/stack-journal.d.ts.map +1 -1
  536. package/dist/lib/stack-journal.js +406 -49
  537. package/dist/lib/stack-journal.js.map +1 -1
  538. package/dist/lib/stack-listeners.d.ts +17 -0
  539. package/dist/lib/stack-listeners.d.ts.map +1 -0
  540. package/dist/lib/stack-listeners.js +54 -0
  541. package/dist/lib/stack-listeners.js.map +1 -0
  542. package/dist/lib/stack-members.d.ts +13 -0
  543. package/dist/lib/stack-members.d.ts.map +1 -0
  544. package/dist/lib/stack-members.js +24 -0
  545. package/dist/lib/stack-members.js.map +1 -0
  546. package/dist/lib/stack-resume.d.ts.map +1 -1
  547. package/dist/lib/stack-resume.js +5 -2
  548. package/dist/lib/stack-resume.js.map +1 -1
  549. package/dist/lib/stack-runs.d.ts +34 -0
  550. package/dist/lib/stack-runs.d.ts.map +1 -0
  551. package/dist/lib/stack-runs.js +75 -0
  552. package/dist/lib/stack-runs.js.map +1 -0
  553. package/dist/lib/status.d.ts +11 -0
  554. package/dist/lib/status.d.ts.map +1 -1
  555. package/dist/lib/status.js +4 -5
  556. package/dist/lib/status.js.map +1 -1
  557. package/dist/lib/stdout-owner.d.ts +12 -3
  558. package/dist/lib/stdout-owner.d.ts.map +1 -1
  559. package/dist/lib/stdout-owner.js +33 -5
  560. package/dist/lib/stdout-owner.js.map +1 -1
  561. package/dist/lib/store-dir.d.ts +68 -4
  562. package/dist/lib/store-dir.d.ts.map +1 -1
  563. package/dist/lib/store-dir.js +253 -17
  564. package/dist/lib/store-dir.js.map +1 -1
  565. package/dist/lib/team-additive-attempt.d.ts +1 -1
  566. package/dist/lib/team-channel-removal.d.ts.map +1 -1
  567. package/dist/lib/team-channel-removal.js +4 -0
  568. package/dist/lib/team-channel-removal.js.map +1 -1
  569. package/dist/lib/team-deploy-inspection.d.ts +13 -0
  570. package/dist/lib/team-deploy-inspection.d.ts.map +1 -1
  571. package/dist/lib/team-deploy-inspection.js +12 -0
  572. package/dist/lib/team-deploy-inspection.js.map +1 -1
  573. package/dist/lib/team-text.d.ts +6 -0
  574. package/dist/lib/team-text.d.ts.map +1 -0
  575. package/dist/lib/team-text.js +36 -0
  576. package/dist/lib/team-text.js.map +1 -0
  577. package/dist/lib/transient.d.ts +14 -8
  578. package/dist/lib/transient.d.ts.map +1 -1
  579. package/dist/lib/transient.js +72 -11
  580. package/dist/lib/transient.js.map +1 -1
  581. package/dist/lib/unusable-file.d.ts +13 -0
  582. package/dist/lib/unusable-file.d.ts.map +1 -0
  583. package/dist/lib/unusable-file.js +12 -0
  584. package/dist/lib/unusable-file.js.map +1 -0
  585. package/dist/lib/up-report.d.ts +6 -0
  586. package/dist/lib/up-report.d.ts.map +1 -1
  587. package/dist/lib/up-report.js +13 -0
  588. package/dist/lib/up-report.js.map +1 -1
  589. package/dist/lib/verdict.d.ts +14 -0
  590. package/dist/lib/verdict.d.ts.map +1 -0
  591. package/dist/lib/verdict.js +15 -0
  592. package/dist/lib/verdict.js.map +1 -0
  593. package/dist/managed-handoff.d.ts +11 -6
  594. package/dist/managed-handoff.d.ts.map +1 -1
  595. package/dist/managed-handoff.js +27 -18
  596. package/dist/managed-handoff.js.map +1 -1
  597. package/dist/render.d.ts +5 -2
  598. package/dist/render.d.ts.map +1 -1
  599. package/dist/render.js +44 -10
  600. package/dist/render.js.map +1 -1
  601. package/dist/telemetry.d.ts +4 -3
  602. package/dist/telemetry.d.ts.map +1 -1
  603. package/dist/telemetry.js +14 -6
  604. package/dist/telemetry.js.map +1 -1
  605. package/dist/ui.d.ts +3 -2
  606. package/dist/ui.d.ts.map +1 -1
  607. package/dist/ui.js +6 -4
  608. package/dist/ui.js.map +1 -1
  609. package/dist/view/mesh-view.d.ts.map +1 -1
  610. package/dist/view/mesh-view.js +4 -1
  611. package/dist/view/mesh-view.js.map +1 -1
  612. package/dist/watch-data.d.ts +9 -1
  613. package/dist/watch-data.d.ts.map +1 -1
  614. package/dist/watch-data.js +17 -3
  615. package/dist/watch-data.js.map +1 -1
  616. package/dist/watch-json.js +4 -3
  617. package/dist/watch-json.js.map +1 -1
  618. package/package.json +5 -5
@@ -1,10 +1,11 @@
1
- import { CommandFailure } from "@cotal-ai/workspace";
2
- /** A usage refusal for a missing `--yes` outside an interactive terminal. Its remedy is the whole
3
- * fix, so the dispatcher prints its line and remedy without the command's help. It keeps that
4
- * only while its target names a space, which `inOperationSpace` passes through unchanged. */
5
- export class ConfirmationRequired extends CommandFailure {
6
- constructor(message, opts) {
7
- super("refused", "USAGE_INVALID", message, opts);
8
- }
1
+ import { inputDisabledByFlag } from "@cotal-ai/workspace";
2
+ /** The refusal sentence for a missing `--yes` when a command cannot ask, naming what kept it from
3
+ * asking: `--json`, `--no-input`, `COTAL_NO_PROMPT=1`, or no interactive terminal. */
4
+ export function yesRequired(action, json) {
5
+ const reason = json ? "--json takes no prompt"
6
+ : inputDisabledByFlag() ? "--no-input forbids the prompt"
7
+ : process.env.COTAL_NO_PROMPT === "1" ? "COTAL_NO_PROMPT=1 forbids the prompt"
8
+ : "there is no interactive terminal to ask in";
9
+ return `${action} requires --yes because ${reason}`;
9
10
  }
10
11
  //# sourceMappingURL=confirmation-required.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"confirmation-required.js","sourceRoot":"","sources":["../../src/lib/confirmation-required.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD;;8FAE8F;AAC9F,MAAM,OAAO,oBAAqB,SAAQ,cAAc;IACtD,YAAY,OAAe,EAAE,IAA6E;QACxG,KAAK,CAAC,SAAS,EAAE,eAAe,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;IACnD,CAAC;CACF"}
1
+ {"version":3,"file":"confirmation-required.js","sourceRoot":"","sources":["../../src/lib/confirmation-required.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAE1D;uFACuF;AACvF,MAAM,UAAU,WAAW,CAAC,MAAc,EAAE,IAAa;IACvD,MAAM,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,wBAAwB;QAC5C,CAAC,CAAC,mBAAmB,EAAE,CAAC,CAAC,CAAC,+BAA+B;YACzD,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,KAAK,GAAG,CAAC,CAAC,CAAC,sCAAsC;gBAC9E,CAAC,CAAC,4CAA4C,CAAC;IACjD,OAAO,GAAG,MAAM,2BAA2B,MAAM,EAAE,CAAC;AACtD,CAAC"}
@@ -1,2 +1,11 @@
1
+ import { ConnectRefusal, type Connection } from "@cotal-ai/workspace";
1
2
  export { connectOrExit, connectOrThrow, ConnectRefusal, connectUserControlOrExit, endpointAuth, reachableOrExit, refuseStaticCredsForKnownUserAuthOrExit, resolveTargetOrExit, preflightOrExit, classifyPreflightFailure, userViewAuth, userViewAuthOrExit, type UserViewAuth, type ConnectFlags, type Connection, type RawAuth, type PreflightFailure, } from "@cotal-ai/workspace";
3
+ /** The refusal a live view ends with once its connection has dropped and its credential can no
4
+ * longer connect: the one a one-shot command presenting that credential gets now, such as
5
+ * `credential EXPIRED` or `credentials rejected`. Undefined while the broker cannot be reached or
6
+ * the credential still connects, because the endpoint's own re-establishing recovers both. A
7
+ * user-auth bearer and an open mesh present no fixed credential, so they keep re-establishing. A
8
+ * credential the command minted from the space's trust says to run the command again when it is
9
+ * rejected, because a new run mints one from the trust the space has now. */
10
+ export declare function credentialEnded(conn: Connection): Promise<ConnectRefusal | undefined>;
2
11
  //# sourceMappingURL=connect.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"connect.d.ts","sourceRoot":"","sources":["../../src/lib/connect.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,aAAa,EACb,cAAc,EACd,cAAc,EACd,wBAAwB,EACxB,YAAY,EACZ,eAAe,EACf,uCAAuC,EACvC,mBAAmB,EACnB,eAAe,EACf,wBAAwB,EACxB,YAAY,EACZ,kBAAkB,EAClB,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,OAAO,EACZ,KAAK,gBAAgB,GACtB,MAAM,qBAAqB,CAAC"}
1
+ {"version":3,"file":"connect.d.ts","sourceRoot":"","sources":["../../src/lib/connect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAsC,KAAK,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAK1G,OAAO,EACL,aAAa,EACb,cAAc,EACd,cAAc,EACd,wBAAwB,EACxB,YAAY,EACZ,eAAe,EACf,uCAAuC,EACvC,mBAAmB,EACnB,eAAe,EACf,wBAAwB,EACxB,YAAY,EACZ,kBAAkB,EAClB,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,OAAO,EACZ,KAAK,gBAAgB,GACtB,MAAM,qBAAqB,CAAC;AAE7B;;;;;;8EAM8E;AAC9E,wBAAsB,eAAe,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC,CAa3F"}
@@ -1,5 +1,32 @@
1
+ import { ConnectRefusal, isConnectRefusal, reachableOrThrow } from "@cotal-ai/workspace";
1
2
  // The connect-or-exit wrappers moved into `@cotal-ai/workspace` (stage 4) so every command
2
3
  // surface — this CLI and @cotal-ai/web — resolves meshes identically. Re-exported here
3
4
  // so existing importers keep resolving them from this module unchanged.
4
5
  export { connectOrExit, connectOrThrow, ConnectRefusal, connectUserControlOrExit, endpointAuth, reachableOrExit, refuseStaticCredsForKnownUserAuthOrExit, resolveTargetOrExit, preflightOrExit, classifyPreflightFailure, userViewAuth, userViewAuthOrExit, } from "@cotal-ai/workspace";
6
+ /** The refusal a live view ends with once its connection has dropped and its credential can no
7
+ * longer connect: the one a one-shot command presenting that credential gets now, such as
8
+ * `credential EXPIRED` or `credentials rejected`. Undefined while the broker cannot be reached or
9
+ * the credential still connects, because the endpoint's own re-establishing recovers both. A
10
+ * user-auth bearer and an open mesh present no fixed credential, so they keep re-establishing. A
11
+ * credential the command minted from the space's trust says to run the command again when it is
12
+ * rejected, because a new run mints one from the trust the space has now. */
13
+ export async function credentialEnded(conn) {
14
+ if (conn.creds === undefined)
15
+ return undefined;
16
+ try {
17
+ await reachableOrThrow(conn.server, { creds: conn.creds, ...(conn.tls ? { tls: true } : {}) });
18
+ }
19
+ catch (e) {
20
+ if (!isConnectRefusal(e))
21
+ throw e;
22
+ if (e.kind !== "permanent")
23
+ return undefined;
24
+ if (conn.auth === undefined || e.code !== "PERMISSION_DENIED")
25
+ return e;
26
+ const message = e.parts?.message ?? e.rendered.replace(/^✗ /, "");
27
+ const remedy = "the space's trust changed after this command started; run it again to connect with its current trust";
28
+ return new ConnectRefusal(`✗ ${message} - ${remedy}`, undefined, { cause: e, code: e.code, parts: { message, remedy }, ...(e.target ? { target: e.target } : {}) });
29
+ }
30
+ return undefined;
31
+ }
5
32
  //# sourceMappingURL=connect.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"connect.js","sourceRoot":"","sources":["../../src/lib/connect.ts"],"names":[],"mappings":"AAAA,2FAA2F;AAC3F,uFAAuF;AACvF,wEAAwE;AACxE,OAAO,EACL,aAAa,EACb,cAAc,EACd,cAAc,EACd,wBAAwB,EACxB,YAAY,EACZ,eAAe,EACf,uCAAuC,EACvC,mBAAmB,EACnB,eAAe,EACf,wBAAwB,EACxB,YAAY,EACZ,kBAAkB,GAMnB,MA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,OAAO,IAAI,cAAc,CAAC,KAAK,OAAO,MAAM,MAAM,EAAE,EAAE,SAAS,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;IACtK,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
@@ -58,6 +58,11 @@ export type ManagerReply = ControlReply & {
58
58
  * Every message names the agent when the target carries one and ends with the manager's own
59
59
  * reason, kept to one line. */
60
60
  export declare function managerFailure(reply: ManagerReply, operation: string, target: unknown): CommandFailure;
61
+ /** A describe that drew no answer means the command after it was never sent, so it is refused, as
62
+ * `chat` and the run verbs refuse it, and not an unknown outcome. Undefined for any other failure. */
63
+ export declare function unansweredDescribeRefusal(reply: ManagerReply, operation: string, target: unknown): CommandFailure | undefined;
64
+ /** Whether the describe before a command drew no answer, so the command itself was never sent. */
65
+ export declare function describeUnanswered(reply: ManagerReply): boolean;
61
66
  /** What the calling command declares about pinning. Passed ONLY by a command that offers `--on`
62
67
  * (`ps`, `models`, `stop`, `attach`, `spawn --detach`), with `instanceId` set to what the operator
63
68
  * typed, if anything. Its presence is what lets the renderer offer `--on` as a remedy: a command
@@ -76,30 +81,33 @@ export interface ManagerPin {
76
81
  beforeSubmit(intent: ManagerRequestIntent): void | Promise<void>;
77
82
  accepted(receipt: ManagerRequestReceipt): void | Promise<void>;
78
83
  };
84
+ /** Stops the resolve and the request waiting, for a caller that no longer needs the answer. */
85
+ signal?: AbortSignal;
79
86
  }
80
87
  /** `--on <instance>`: address ONE manager instance instead of the class queue. Shared by
81
88
  * ps/stop/attach/input/describe/models so they cannot drift. For stop and attach it is the seat-locality
82
89
  * escape hatch: the manager that can act on a seat is the one HOSTING it, which is not necessarily
83
- * the one that wins the class queue. */
90
+ * the one that wins the class queue. On a user-auth mesh it also takes a manager's name or host
91
+ * ({@link managerPin}). */
84
92
  export declare const onFlag: {
85
93
  readonly name: "on";
86
94
  readonly type: "string";
87
95
  readonly value: "<instance>";
88
- readonly description: "ask only this manager instance, by the id `ps` prints, in a space with several managers";
96
+ readonly description: "ask only this manager, by the instance id `ps` prints or, on a user-auth mesh, by its name or host";
89
97
  };
90
98
  /** Read `--on` at the site that declares it. Absent stays absent (class rails). An EMPTY value
91
99
  * (`--on=`, `--on ""`, or `--on "$INSTANCE"` with the variable unset) is refused here, up front:
92
100
  * it is falsy, so every `if (on)` branch would treat it as absent and drop the pin (a `stop` would
93
101
  * fall through to seat locality, an open-mesh `ps` to the scatter), while the mint and core's
94
102
  * route builder treat it as PRESENT and refuse it as an invalid token. Two answers for one input;
95
- * a dropped pin is a silent fallback, so neither branch gets to see it. A non-empty value is also
96
- * shape-checked here now, against core's own lifecycle-token grammar: the mint's bare grammar
97
- * error named neither the identifier `--on` wants nor where to read it, which cost operators
98
- * spawn attempts on a format mismatch (#423). */
103
+ * a dropped pin is a silent fallback, so neither branch gets to see it. A roster principal id
104
+ * (`local.…`) is refused here too, naming the identifier `--on` wants (#423). Any other value is an
105
+ * instance id, name or host, which {@link managerPin} resolves to an instance id before use. */
99
106
  export declare function onInstance(on: string | undefined, verb: string): string | undefined;
100
- /** {@link onInstance} for a command that reports no structured output: the refusal is printed and
101
- * ends the process with exit 1. */
102
- export declare function onInstanceOrExit(on: string | undefined, verb: string): string | undefined;
107
+ /** {@link onInstance} for an `--on` that takes only an instance id: an endpoint's instance, or a
108
+ * step that runs before the mesh can be read. The value is shape-checked against core's
109
+ * lifecycle-token grammar, so a malformed id is refused naming the identifier `--on` wants. */
110
+ export declare function onInstanceId(on: string | undefined, verb: string): string | undefined;
103
111
  /** Render an ep-rail failure for the operator. Three outcomes, told apart by core's markers and never
104
112
  * by the catalog code: a responder's own `ok:false` describe reply is rethrown under ITS code
105
113
  * (`unavailable` included), and a store read after an answered describe raises the same code, so
@@ -160,7 +168,11 @@ export interface ScatterInstanceReply {
160
168
  code?: string;
161
169
  /** Set on unreachable slots only: a slot that ANSWERED needs no liveness verdict. */
162
170
  liveness?: ScatterInstanceLiveness;
171
+ /** The host name this instance gave in its own `status` reply, when the caller asked for it.
172
+ * Display metadata the manager reports about itself: never checked and never a route. */
173
+ reportedHost?: string;
163
174
  }
175
+ /** A failed scatter's `noLiveManager` says the registry was read and lists no live manager. */
164
176
  export type ScatterReply = {
165
177
  ok: true;
166
178
  instances: ScatterInstanceReply[];
@@ -169,6 +181,7 @@ export type ScatterReply = {
169
181
  error: string;
170
182
  code?: string;
171
183
  unanswered?: boolean;
184
+ noLiveManager?: true;
172
185
  };
173
186
  /** Open one short-lived control connection under whichever of the three auth shapes this command
174
187
  * holds (static creds / user bearer + sentinel / bare open mesh) and hand it to `fn`. Extracted so
@@ -243,13 +256,30 @@ export declare function scatterProbeMaterial(auth: ControlAuth, spaceAuth: Space
243
256
  * resolved mesh's trust material from {@link resolveControlTarget}: present ⇒ the scatter re-mints
244
257
  * its instrument pinned to the frozen instance ids and can probe their liveness; absent ⇒ it runs
245
258
  * exactly as it did before and every silent slot is reported `not-probed`. */
246
- export declare function scatterManager(space: string, server: string, op: string, auth?: ControlAuth, spaceAuth?: SpaceAuth, timeoutMs?: number): Promise<ScatterReply>;
259
+ export declare function scatterManager(space: string, server: string, op: string, auth?: ControlAuth, spaceAuth?: SpaceAuth, timeoutMs?: number, opts?: {
260
+ reportHosts?: boolean;
261
+ }): Promise<ScatterReply>;
247
262
  /** The refusal `ps` gives, raised before an unpinned operator read when the registry lists no live
248
263
  * manager, rather than after the read's describe has waited out its whole deadline. Only the
249
264
  * operator instrument holds the registry rows, so a caller passes a user's manager view or a pinned
250
265
  * call straight to the read. Any other registry outcome, an unreadable registry included, leaves
251
- * the read to decide. `purpose` completes "no manager is running for this space to …". */
252
- export declare function refuseWithoutLiveManager(space: string, server: string, auth: ControlAuth, target: unknown, purpose: string): Promise<void>;
266
+ * the read to decide. `purpose` completes "no manager is running for this space to …". Returns the
267
+ * live instance ids the registry listed, or undefined when it could not be read. */
268
+ export declare function refuseWithoutLiveManager(space: string, server: string, auth: ControlAuth, target: unknown, purpose: string): Promise<string[] | undefined>;
269
+ /** A pinned instance the space's registry does not list has nothing behind it to answer, so the
270
+ * command is refused before it waits out the reply deadline, naming the managers that are running.
271
+ * A registry this side cannot read leaves the request to settle it. */
272
+ export declare function refuseUnregisteredManager(space: string, server: string, auth: ControlAuth, on: string): Promise<void>;
273
+ /** Whether the broker affirms that nothing is subscribed on manager `instanceId`'s own rail, so its
274
+ * registration outlived its host. The probe settles on the broker's no-responders answer, so a gone
275
+ * manager costs no reply deadline. A live manager never answers the probe, which then runs its whole
276
+ * budget, so a caller that also asks the manager itself passes `signal` and fires it once that
277
+ * answer arrives. Any other outcome, an aborted probe or one this credential cannot send included,
278
+ * is `false`. */
279
+ export declare function managerRailGone(space: string, server: string, auth: ControlAuth, instanceId: string, signal?: AbortSignal): Promise<boolean>;
280
+ /** The manager instances the space's registry lists as live, frozen as a scatter freezes them. An
281
+ * empty registry throws the registry's own refusal. */
282
+ export declare function liveManagerIds(space: string, server: string, auth: ControlAuth): Promise<string[]>;
253
283
  /** A manager read that did not answer, as the classified failure a structured command reports: the
254
284
  * same sentence, the endpoint's own code under `error.cause`, and the stale-store hint as its remedy
255
285
  * when one applies. A request nobody answered carries `deadline-exceeded`, an unavailable target. */
@@ -1 +1 @@
1
- {"version":3,"file":"control.d.ts","sourceRoot":"","sources":["../../src/lib/control.ts"],"names":[],"mappings":"AACA,OAAO,EA4BL,KAAK,YAAY,EACjB,KAAK,QAAQ,EACb,KAAK,kBAAkB,EAKxB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAA4B,KAAK,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAExF,OAAO,EAAE,cAAc,EAA+D,KAAK,WAAW,EAAoB,MAAM,q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C,EAAE,OAAO,CAAA;CAAE,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,cAAc,CAOzH;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI,CAUrD"}
@@ -1,9 +1,9 @@
1
1
  import { randomUUID } from "node:crypto";
2
- import { BASELINE_LIFECYCLE_ENDPOINT, EpEnvelopeError, assertLifecycleToken, GOAL_BEARING_COMMANDS, goalFollowRefusal, epProbeInstanceInterest, freezeExpectedSet, instancePinnedInstrumentCapabilities, invokeRepairingSplit, issuedUserCaller, mintCreds, parseEpSubject, respondedButUnbound, unansweredRequest, unansweredRail, registryReadFailed, noLiveInstances, undeclaredArg, controlReplyFrom, controlReplyFromThrown, submitAndFollowGoal, scatterCommand, mintLifecycleUid, newIdentity, dialerFor, resolveService, standaloneConnectOpts, } from "@cotal-ai/core";
2
+ import { assertLifecycleToken, BASELINE_LIFECYCLE_ENDPOINT, EpEnvelopeError, GOAL_BEARING_COMMANDS, goalFollowRefusal, epProbeInstanceInterest, freezeExpectedSet, instancePinnedInstrumentCapabilities, invokeCommand, invokeRepairingSplit, issuedUserCaller, mintCreds, parseEpSubject, respondedButUnbound, unansweredRequest, unansweredRail, registryReadFailed, noLiveInstances, undeclaredArg, controlReplyFrom, controlReplyFromThrown, submitAndFollowGoal, scatterCommand, mintLifecycleUid, newIdentity, dialerFor, resolveService, standaloneConnectOpts, } from "@cotal-ai/core";
3
3
  import { PermissionViolationError } from "@nats-io/transport-node";
4
4
  import { jetstreamManager } from "@nats-io/jetstream";
5
5
  import { CommandFailure, controlCaller, loadSpaceAuth, oneLine, renderWorkspaceError } from "@cotal-ai/workspace";
6
- import { DEV_OWNER } from "@cotal-ai/core";
6
+ import { DEV_OWNER, EP_UNANSWERED } from "@cotal-ai/core";
7
7
  import { c, staleStoreHint, stderrLine } from "../ui.js";
8
8
  import { cliVersion } from "./version.js";
9
9
  import { nativeEndpointRefusal } from "./endpoint-errors.js";
@@ -37,6 +37,7 @@ const EP_COMMANDS = {
37
37
  ps: { command: "ps" },
38
38
  slots: { command: "slots" },
39
39
  models: { command: "models" },
40
+ listPersonas: { command: "list-personas" },
40
41
  launch: { command: "launch" },
41
42
  purge: { command: "purge" },
42
43
  resumePreserved: { command: "resume-preserved" },
@@ -48,6 +49,8 @@ const EP_COMMANDS = {
48
49
  transcriptReceive: { command: "transcript-receive" },
49
50
  chatSessionOpen: { command: "chat-session-open" },
50
51
  chatSessionRetire: { command: "chat-session-retire" },
52
+ runPs: { command: "run-ps" },
53
+ runStatus: { command: "run-status" },
51
54
  };
52
55
  /** The ep-rail control call — since 1d {@link askManager}'s ONLY path: one short-lived raw
53
56
  * connection, a fresh `resolveService` (describe → §13.7 store fetch → digest-verified recompile
@@ -79,7 +82,7 @@ async function askManagerEp(space, server, op, args, auth, reach, timeoutMs, pin
79
82
  : auth.epCaller;
80
83
  // P2 item 3 `--on <instance>`: pin the resolve to the exact manager instance's `inst` route so a
81
84
  // multi-manager space addresses the intended manager, never whichever wins the class anycast.
82
- const service = await resolveService(nc, space, BASELINE_LIFECYCLE_ENDPOINT, caller, { deadlineMs: 10_000, ...(instanceId !== undefined ? { instanceId } : {}) });
85
+ const service = await resolveService(nc, space, BASELINE_LIFECYCLE_ENDPOINT, caller, { deadlineMs: 10_000, ...(instanceId !== undefined ? { instanceId } : {}), ...(pin?.signal ? { signal: pin.signal } : {}) });
83
86
  let target;
84
87
  let sendArgs = args;
85
88
  if (mapped.self)
@@ -134,7 +137,7 @@ async function askManagerEp(space, server, op, args, auth, reach, timeoutMs, pin
134
137
  intent = { requestId: id, ...(followsGoal ? { requestedGoalId: id } : {}) };
135
138
  if (pin?.journal)
136
139
  await pin.journal.beforeSubmit(intent);
137
- const invokeOpts = { ...(target ? { target } : {}), deadlineMs: timeoutMs ?? 10_000, id };
140
+ const invokeOpts = { ...(target ? { target } : {}), deadlineMs: timeoutMs ?? 10_000, id, ...(pin?.signal ? { signal: pin.signal } : {}) };
138
141
  const submit = async (signal) => {
139
142
  const answer = await invokeRepairingSplit(nc, space, service, mapped.command, sendArgs, { ...invokeOpts, ...(signal ? { signal } : {}) });
140
143
  const data = answer.reply.data;
@@ -207,44 +210,56 @@ export function managerFailure(reply, operation, target) {
207
210
  return new CommandFailure("failed", "OPERATION_FAILED", `the manager reported that ${what} failed${reason}`, { target, native });
208
211
  return new CommandFailure("unknown", "OPERATION_UNKNOWN", `the manager did not confirm the outcome of ${what}; it was not submitted again${reason}`, { target, native, remedy: "inspect the recorded manager, request and target before retrying" });
209
212
  }
213
+ /** A describe that drew no answer means the command after it was never sent, so it is refused, as
214
+ * `chat` and the run verbs refuse it, and not an unknown outcome. Undefined for any other failure. */
215
+ export function unansweredDescribeRefusal(reply, operation, target) {
216
+ if (!describeUnanswered(reply))
217
+ return undefined;
218
+ const agent = target?.agent;
219
+ const what = typeof agent === "string" ? `${operation} for agent "${oneLine(agent)}"` : operation;
220
+ return new CommandFailure("refused", "TARGET_UNAVAILABLE", `the manager registered for this space did not answer, so ${what} was not sent: ${oneLine(reply.error ?? "no reply")}`, { target, native: { code: reply.code }, remedy: "cotal status shows whether this space's manager answers; a stack manager that runs but does not answer is named there with its pid and the way to end it" });
221
+ }
222
+ /** Whether the describe before a command drew no answer, so the command itself was never sent. */
223
+ export function describeUnanswered(reply) {
224
+ return reply.details?.some((detail) => detail.kind === EP_UNANSWERED && detail.command === "describe") === true;
225
+ }
210
226
  /** `--on <instance>`: address ONE manager instance instead of the class queue. Shared by
211
227
  * ps/stop/attach/input/describe/models so they cannot drift. For stop and attach it is the seat-locality
212
228
  * escape hatch: the manager that can act on a seat is the one HOSTING it, which is not necessarily
213
- * the one that wins the class queue. */
214
- export const onFlag = { name: "on", type: "string", value: "<instance>", description: "ask only this manager instance, by the id `ps` prints, in a space with several managers" };
229
+ * the one that wins the class queue. On a user-auth mesh it also takes a manager's name or host
230
+ * ({@link managerPin}). */
231
+ export const onFlag = { name: "on", type: "string", value: "<instance>", description: "ask only this manager, by the instance id `ps` prints or, on a user-auth mesh, by its name or host" };
215
232
  /** Read `--on` at the site that declares it. Absent stays absent (class rails). An EMPTY value
216
233
  * (`--on=`, `--on ""`, or `--on "$INSTANCE"` with the variable unset) is refused here, up front:
217
234
  * it is falsy, so every `if (on)` branch would treat it as absent and drop the pin (a `stop` would
218
235
  * fall through to seat locality, an open-mesh `ps` to the scatter), while the mint and core's
219
236
  * route builder treat it as PRESENT and refuse it as an invalid token. Two answers for one input;
220
- * a dropped pin is a silent fallback, so neither branch gets to see it. A non-empty value is also
221
- * shape-checked here now, against core's own lifecycle-token grammar: the mint's bare grammar
222
- * error named neither the identifier `--on` wants nor where to read it, which cost operators
223
- * spawn attempts on a format mismatch (#423). */
237
+ * a dropped pin is a silent fallback, so neither branch gets to see it. A roster principal id
238
+ * (`local.…`) is refused here too, naming the identifier `--on` wants (#423). Any other value is an
239
+ * instance id, name or host, which {@link managerPin} resolves to an instance id before use. */
224
240
  export function onInstance(on, verb) {
225
241
  if (on === undefined)
226
242
  return undefined;
227
243
  if (on === "")
228
- throw new CommandFailure("refused", "USAGE_INVALID", `--on requires a manager instance id (the whole id, as \`cotal ps\` prints it): \`${verb} --on <instance>\`. An empty value is refused, not dropped`);
229
- try {
230
- assertLifecycleToken(on, "instanceId");
231
- }
232
- catch (e) {
233
- const principalClause = on.startsWith("local.") ? `; "${on}" is a principal id` : "";
234
- throw new CommandFailure("refused", "USAGE_INVALID", `${e.message}. --on wants the manager INSTANCE id as \`cotal ps\` prints it (the \`manager <id>\` header in a multi-manager space, the \`instance\` field of \`cotal ps --wide\`), not the roster's principal id (\`local.U…\`, as \`cotal endpoints\` shows it)${principalClause}: \`${verb} --on <instance>\``);
235
- }
244
+ throw new CommandFailure("refused", "USAGE_INVALID", `--on requires a manager instance id (the whole id, as \`cotal ps\` prints it), or on a user-auth mesh a manager's name or host: \`${verb} --on <instance>\`. An empty value is refused, not dropped`, { selfContained: true });
245
+ if (on.startsWith("local."))
246
+ throw new CommandFailure("refused", "USAGE_INVALID", `"${on}" is a principal id. --on wants the manager INSTANCE id as \`cotal ps\` prints it (the \`instance\` it lists for a manager that answered, or the \`manager <id>\` header when several did), not the roster's principal id (\`local.U…\`, as \`cotal endpoints\` shows it): \`${verb} --on <instance>\``, { selfContained: true });
236
247
  return on;
237
248
  }
238
- /** {@link onInstance} for a command that reports no structured output: the refusal is printed and
239
- * ends the process with exit 1. */
240
- export function onInstanceOrExit(on, verb) {
249
+ /** {@link onInstance} for an `--on` that takes only an instance id: an endpoint's instance, or a
250
+ * step that runs before the mesh can be read. The value is shape-checked against core's
251
+ * lifecycle-token grammar, so a malformed id is refused naming the identifier `--on` wants. */
252
+ export function onInstanceId(on, verb) {
253
+ const value = onInstance(on, verb);
254
+ if (value === undefined)
255
+ return undefined;
241
256
  try {
242
- return onInstance(on, verb);
257
+ assertLifecycleToken(value, "instanceId");
243
258
  }
244
259
  catch (e) {
245
- stderrLine("✗ ", e.message, c.red);
246
- process.exit(1);
260
+ throw new CommandFailure("refused", "USAGE_INVALID", `${e.message}. --on wants the INSTANCE id as \`cotal ps\` prints it (the \`instance\` it lists for a manager that answered, or the \`manager <id>\` header when several did): \`${verb} --on <instance>\``, { selfContained: true });
247
261
  }
262
+ return value;
248
263
  }
249
264
  /** Render an ep-rail failure for the operator. Three outcomes, told apart by core's markers and never
250
265
  * by the catalog code: a responder's own `ok:false` describe reply is rethrown under ITS code
@@ -470,6 +485,36 @@ const SCATTER_PROFILE = "control-caller-privileged";
470
485
  * did before the probe existed. Sized to be generous against a busy broker while still expiring
471
486
  * well inside the gather. */
472
487
  const PROBE_DEADLINE_MS = 5_000;
488
+ /** How long the host names a census shows may take, all together. They are display metadata, so an
489
+ * instance that has not answered by then is listed without one. */
490
+ const REPORTED_HOST_BUDGET_MS = 2_000;
491
+ const HOST_NAME = /^[A-Za-z0-9_](?:[A-Za-z0-9_.-]{0,251}[A-Za-z0-9_])?$/;
492
+ /** Ask each instance that answered the census for its own `status`, on its `inst` route at the
493
+ * epoch it answered with, where this credential's pinned rails reach it. One bound covers every
494
+ * ask and aborts what is still out. Only a well-formed host name from that exact instance is kept;
495
+ * anything else leaves the instance without one, and nothing here changes what the census found. */
496
+ async function askReportedHosts(nc, space, service, answered, instances, reachable) {
497
+ const abort = new AbortController();
498
+ const timer = setTimeout(() => abort.abort(), REPORTED_HOST_BUDGET_MS);
499
+ try {
500
+ await Promise.all(instances.filter((slot) => slot.error === undefined && reachable.has(slot.instanceId)).map(async (slot) => {
501
+ const epoch = answered.get(slot.instanceId)?.responder.epoch;
502
+ if (epoch === undefined)
503
+ return;
504
+ try {
505
+ const pinned = { ...service, responder: { instanceId: slot.instanceId, epoch }, pinnedInstanceId: slot.instanceId };
506
+ const answer = await invokeCommand(nc, space, pinned, "status", undefined, { deadlineMs: REPORTED_HOST_BUDGET_MS, signal: abort.signal });
507
+ const host = answer.reply.ok === true ? answer.reply.data?.host : undefined;
508
+ if (answer.responder.instanceId === slot.instanceId && typeof host === "string" && HOST_NAME.test(host))
509
+ slot.reportedHost = host;
510
+ }
511
+ catch { /* display metadata only: the instance is listed without a host */ }
512
+ }));
513
+ }
514
+ finally {
515
+ clearTimeout(timer);
516
+ }
517
+ }
473
518
  /**
474
519
  * Whether the scatter's liveness probe rides a BARE connection, a freshly minted pinned instrument,
475
520
  * or nothing at all. The sixth seed reach on the attach path, made explicit.
@@ -520,7 +565,7 @@ export function scatterProbeMaterial(auth, spaceAuth) {
520
565
  * off-registry cred cannot re-mint, so their frozen slots are `not-probed` and say so. This is not
521
566
  * a silent degrade: it is the pre-existing behaviour, and the row prints which of the two it is.
522
567
  */
523
- async function askManagerScatterEp(space, server, op, auth, spaceAuth, timeoutMs) {
568
+ async function askManagerScatterEp(space, server, op, auth, spaceAuth, timeoutMs, reportHosts = false) {
524
569
  const mapped = EP_COMMANDS[op];
525
570
  if (!mapped)
526
571
  return { ok: false, error: `unknown manager op "${op}" (no v0.4 command mapping)` };
@@ -539,7 +584,7 @@ async function askManagerScatterEp(space, server, op, auth, spaceAuth, timeoutMs
539
584
  }
540
585
  catch (e) {
541
586
  const { error, code, unanswered } = epRailFailure(e);
542
- return { ok: false, error: error ?? "error", ...(code === undefined ? {} : { code }), ...(unanswered ? { unanswered } : {}) };
587
+ return { ok: false, error: error ?? "error", ...(code === undefined ? {} : { code }), ...(unanswered ? { unanswered } : {}), ...(noLiveInstances(e) ? { noLiveManager: true } : {}) };
543
588
  }
544
589
  // ---- the LOCAL pinned re-mint, decided by {@link scatterProbeMaterial} rather than inline.
545
590
  // This is the SIXTH place the attach path reaches for a seed (attach → pinForTarget → locateSeat
@@ -587,6 +632,8 @@ async function askManagerScatterEp(space, server, op, auth, spaceAuth, timeoutMs
587
632
  // (pin 3) — and now carries WHY it is silent, as far as this command could establish it.
588
633
  for (const instanceId of result.missing)
589
634
  instances.push({ instanceId, reachable: false, liveness: livenessOf(instanceId) });
635
+ if (reportHosts)
636
+ await askReportedHosts(nc, space, service, result.replies, instances, probed);
590
637
  return { ok: true, instances };
591
638
  });
592
639
  }
@@ -603,27 +650,79 @@ async function askManagerScatterEp(space, server, op, auth, spaceAuth, timeoutMs
603
650
  * resolved mesh's trust material from {@link resolveControlTarget}: present ⇒ the scatter re-mints
604
651
  * its instrument pinned to the frozen instance ids and can probe their liveness; absent ⇒ it runs
605
652
  * exactly as it did before and every silent slot is reported `not-probed`. */
606
- export async function scatterManager(space, server, op, auth = {}, spaceAuth, timeoutMs) {
653
+ export async function scatterManager(space, server, op, auth = {}, spaceAuth, timeoutMs, opts = {}) {
607
654
  const who = controlCaller(auth);
608
655
  if ("refusal" in who)
609
656
  return { ok: false, error: who.refusal };
610
- return askManagerScatterEp(space, server, op, { ...auth, epCaller: who.caller }, spaceAuth, timeoutMs);
657
+ return askManagerScatterEp(space, server, op, { ...auth, epCaller: who.caller }, spaceAuth, timeoutMs, opts.reportHosts === true);
611
658
  }
612
659
  /** The refusal `ps` gives, raised before an unpinned operator read when the registry lists no live
613
660
  * manager, rather than after the read's describe has waited out its whole deadline. Only the
614
661
  * operator instrument holds the registry rows, so a caller passes a user's manager view or a pinned
615
662
  * call straight to the read. Any other registry outcome, an unreadable registry included, leaves
616
- * the read to decide. `purpose` completes "no manager is running for this space to …". */
663
+ * the read to decide. `purpose` completes "no manager is running for this space to …". Returns the
664
+ * live instance ids the registry listed, or undefined when it could not be read. */
617
665
  export async function refuseWithoutLiveManager(space, server, auth, target, purpose) {
618
666
  try {
619
- await withControlConnection(server, auth, async (nc) => freezeExpectedSet(await jetstreamManager(nc, { checkAPI: false }), space, BASELINE_LIFECYCLE_ENDPOINT));
667
+ return await liveManagerIds(space, server, auth);
620
668
  }
621
669
  catch (e) {
622
670
  if (!(e instanceof EpEnvelopeError) || !noLiveInstances(e))
623
- return;
671
+ return undefined;
624
672
  throw new CommandFailure("refused", "TARGET_UNAVAILABLE", `no manager is running for this space to ${purpose}`, { target, native: { code: e.code, detail: `${e.code}: ${e.message}` }, remedy: "start the stack's manager with bare cotal up; a stack started with --no-manager has none" });
625
673
  }
626
674
  }
675
+ /** A pinned instance the space's registry does not list has nothing behind it to answer, so the
676
+ * command is refused before it waits out the reply deadline, naming the managers that are running.
677
+ * A registry this side cannot read leaves the request to settle it. */
678
+ export async function refuseUnregisteredManager(space, server, auth, on) {
679
+ let running;
680
+ try {
681
+ running = await liveManagerIds(space, server, auth);
682
+ }
683
+ catch (e) {
684
+ if (!(e instanceof EpEnvelopeError) || !noLiveInstances(e))
685
+ return;
686
+ running = [];
687
+ }
688
+ if (running.includes(on))
689
+ return;
690
+ const target = { space, requestedManagerInstance: on };
691
+ // With none running this is the unpinned refusal, which names the same way out.
692
+ if (running.length === 0)
693
+ throw new CommandFailure("refused", "TARGET_UNAVAILABLE", `no manager is running for this space, so --on ${on} names none. Nothing was sent`, { target, remedy: "start the stack's manager with bare cotal up; a stack started with --no-manager has none" });
694
+ const which = running.length === 1 ? `the one running is ${running[0]}` : `the ones running are ${running.join(", ")}`;
695
+ throw new CommandFailure("refused", "TARGET_NOT_FOUND", `--on ${on} names no manager running for space ${space}; ${which}. Nothing was sent`, {
696
+ target,
697
+ remedy: running.length === 1 ? `run it again with --on ${running[0]}, or without --on` : "run it again with --on naming one of them",
698
+ });
699
+ }
700
+ /** Whether the broker affirms that nothing is subscribed on manager `instanceId`'s own rail, so its
701
+ * registration outlived its host. The probe settles on the broker's no-responders answer, so a gone
702
+ * manager costs no reply deadline. A live manager never answers the probe, which then runs its whole
703
+ * budget, so a caller that also asks the manager itself passes `signal` and fires it once that
704
+ * answer arrives. Any other outcome, an aborted probe or one this credential cannot send included,
705
+ * is `false`. */
706
+ export async function managerRailGone(space, server, auth, instanceId, signal) {
707
+ const who = controlCaller(auth);
708
+ if ("refusal" in who || signal?.aborted)
709
+ return false;
710
+ const aborted = new Promise((resolve) => signal?.addEventListener("abort", () => resolve(false), { once: true }));
711
+ try {
712
+ return await withControlConnection(server, auth, (nc) => Promise.race([
713
+ epProbeInstanceInterest(nc, space, BASELINE_LIFECYCLE_ENDPOINT, instanceId, who.caller, { deadlineMs: PROBE_DEADLINE_MS }).then((verdict) => verdict === "gone"),
714
+ aborted,
715
+ ]));
716
+ }
717
+ catch {
718
+ return false;
719
+ }
720
+ }
721
+ /** The manager instances the space's registry lists as live, frozen as a scatter freezes them. An
722
+ * empty registry throws the registry's own refusal. */
723
+ export async function liveManagerIds(space, server, auth) {
724
+ return withControlConnection(server, auth, async (nc) => (await freezeExpectedSet(await jetstreamManager(nc, { checkAPI: false }), space, BASELINE_LIFECYCLE_ENDPOINT)).map((f) => f.instanceId));
725
+ }
627
726
  /** The stable code a refused manager READ reports, by the endpoint's catalog code. A read has no
628
727
  * effect, so an outcome the catalog does not classify is a failed read, never an unknown one. */
629
728
  const READ_REFUSALS = {