@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.
- package/dist/chat/chat-view.d.ts.map +1 -1
- package/dist/chat/chat-view.js +5 -1
- package/dist/chat/chat-view.js.map +1 -1
- package/dist/chat/engine.d.ts +2 -1
- package/dist/chat/engine.d.ts.map +1 -1
- package/dist/chat/engine.js +2 -1
- package/dist/chat/engine.js.map +1 -1
- package/dist/chat/frontend.d.ts.map +1 -1
- package/dist/chat/frontend.js +13 -7
- package/dist/chat/frontend.js.map +1 -1
- package/dist/chat/native-session.d.ts +22 -3
- package/dist/chat/native-session.d.ts.map +1 -1
- package/dist/chat/native-session.js +91 -19
- package/dist/chat/native-session.js.map +1 -1
- package/dist/chat/open-session.d.ts +1 -0
- package/dist/chat/open-session.d.ts.map +1 -1
- package/dist/chat/open-session.js +1 -1
- package/dist/chat/open-session.js.map +1 -1
- package/dist/chat/picker.d.ts +5 -0
- package/dist/chat/picker.d.ts.map +1 -1
- package/dist/chat/picker.js +23 -10
- package/dist/chat/picker.js.map +1 -1
- package/dist/chat/plain.d.ts.map +1 -1
- package/dist/chat/plain.js +36 -10
- package/dist/chat/plain.js.map +1 -1
- package/dist/chat/session.d.ts +5 -0
- package/dist/chat/session.d.ts.map +1 -1
- package/dist/chat/static-session.d.ts +1 -0
- package/dist/chat/static-session.d.ts.map +1 -1
- package/dist/chat/static-session.js +24 -8
- package/dist/chat/static-session.js.map +1 -1
- package/dist/chat/stdio-io.d.ts +2 -0
- package/dist/chat/stdio-io.d.ts.map +1 -1
- package/dist/chat/stdio-io.js +6 -6
- package/dist/chat/stdio-io.js.map +1 -1
- package/dist/chat/stdio.d.ts +3 -2
- package/dist/chat/stdio.d.ts.map +1 -1
- package/dist/chat/stdio.js +26 -25
- package/dist/chat/stdio.js.map +1 -1
- package/dist/chat/user-session.d.ts +1 -0
- package/dist/chat/user-session.d.ts.map +1 -1
- package/dist/chat/user-session.js +1 -1
- package/dist/chat/user-session.js.map +1 -1
- package/dist/chat/view.d.ts +5 -4
- package/dist/chat/view.d.ts.map +1 -1
- package/dist/chat/view.js +10 -8
- package/dist/chat/view.js.map +1 -1
- package/dist/command.d.ts +5 -0
- package/dist/command.d.ts.map +1 -1
- package/dist/command.js +295 -82
- package/dist/command.js.map +1 -1
- package/dist/commands/agents.d.ts +29 -5
- package/dist/commands/agents.d.ts.map +1 -1
- package/dist/commands/agents.js +100 -35
- package/dist/commands/agents.js.map +1 -1
- package/dist/commands/backup-maintenance.d.ts.map +1 -1
- package/dist/commands/backup-maintenance.js +54 -21
- package/dist/commands/backup-maintenance.js.map +1 -1
- package/dist/commands/backup-read.d.ts.map +1 -1
- package/dist/commands/backup-read.js +12 -15
- package/dist/commands/backup-read.js.map +1 -1
- package/dist/commands/backup-restore.d.ts.map +1 -1
- package/dist/commands/backup-restore.js +20 -4
- package/dist/commands/backup-restore.js.map +1 -1
- package/dist/commands/backup.d.ts.map +1 -1
- package/dist/commands/backup.js +156 -28
- package/dist/commands/backup.js.map +1 -1
- package/dist/commands/channel-members.d.ts +1 -1
- package/dist/commands/channel-members.d.ts.map +1 -1
- package/dist/commands/channel-members.js +115 -29
- package/dist/commands/channel-members.js.map +1 -1
- package/dist/commands/channels.d.ts +11 -1
- package/dist/commands/channels.d.ts.map +1 -1
- package/dist/commands/channels.js +109 -20
- package/dist/commands/channels.js.map +1 -1
- package/dist/commands/chat.d.ts +11 -3
- package/dist/commands/chat.d.ts.map +1 -1
- package/dist/commands/chat.js +50 -22
- package/dist/commands/chat.js.map +1 -1
- package/dist/commands/clean.d.ts +10 -5
- package/dist/commands/clean.d.ts.map +1 -1
- package/dist/commands/clean.js +245 -42
- package/dist/commands/clean.js.map +1 -1
- package/dist/commands/completion.d.ts +15 -2
- package/dist/commands/completion.d.ts.map +1 -1
- package/dist/commands/completion.js +91 -26
- package/dist/commands/completion.js.map +1 -1
- package/dist/commands/config.d.ts +24 -1
- package/dist/commands/config.d.ts.map +1 -1
- package/dist/commands/config.js +65 -13
- package/dist/commands/config.js.map +1 -1
- package/dist/commands/console.d.ts.map +1 -1
- package/dist/commands/console.js +5 -4
- package/dist/commands/console.js.map +1 -1
- package/dist/commands/describe.d.ts +4 -2
- package/dist/commands/describe.d.ts.map +1 -1
- package/dist/commands/describe.js +4 -4
- package/dist/commands/describe.js.map +1 -1
- package/dist/commands/doctor.d.ts +1 -1
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +261 -34
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/down-manifest.d.ts.map +1 -1
- package/dist/commands/down-manifest.js +9 -6
- package/dist/commands/down-manifest.js.map +1 -1
- package/dist/commands/down-services.d.ts +17 -16
- package/dist/commands/down-services.d.ts.map +1 -1
- package/dist/commands/down-services.js +29 -53
- package/dist/commands/down-services.js.map +1 -1
- package/dist/commands/down.d.ts +2 -2
- package/dist/commands/down.d.ts.map +1 -1
- package/dist/commands/down.js +96 -67
- package/dist/commands/down.js.map +1 -1
- package/dist/commands/endpoint-deregister.d.ts.map +1 -1
- package/dist/commands/endpoint-deregister.js +2 -2
- package/dist/commands/endpoint-deregister.js.map +1 -1
- package/dist/commands/endpoint.d.ts +2 -1
- package/dist/commands/endpoint.d.ts.map +1 -1
- package/dist/commands/endpoint.js +2 -2
- package/dist/commands/endpoint.js.map +1 -1
- package/dist/commands/endpoints.d.ts +1 -0
- package/dist/commands/endpoints.d.ts.map +1 -1
- package/dist/commands/endpoints.js +20 -5
- package/dist/commands/endpoints.js.map +1 -1
- package/dist/commands/feedback.d.ts.map +1 -1
- package/dist/commands/feedback.js +40 -2
- package/dist/commands/feedback.js.map +1 -1
- package/dist/commands/help.d.ts.map +1 -1
- package/dist/commands/help.js +2 -1
- package/dist/commands/help.js.map +1 -1
- package/dist/commands/history-clear.d.ts.map +1 -1
- package/dist/commands/history-clear.js +67 -51
- package/dist/commands/history-clear.js.map +1 -1
- package/dist/commands/history.d.ts +17 -2
- package/dist/commands/history.d.ts.map +1 -1
- package/dist/commands/history.js +221 -34
- package/dist/commands/history.js.map +1 -1
- package/dist/commands/join.d.ts +2 -0
- package/dist/commands/join.d.ts.map +1 -1
- package/dist/commands/join.js +132 -80
- package/dist/commands/join.js.map +1 -1
- package/dist/commands/meshes-add.d.ts +19 -4
- package/dist/commands/meshes-add.d.ts.map +1 -1
- package/dist/commands/meshes-add.js +114 -15
- package/dist/commands/meshes-add.js.map +1 -1
- package/dist/commands/meshes-wizard.d.ts +1 -0
- package/dist/commands/meshes-wizard.d.ts.map +1 -1
- package/dist/commands/meshes-wizard.js +45 -13
- package/dist/commands/meshes-wizard.js.map +1 -1
- package/dist/commands/meshes.d.ts +1 -1
- package/dist/commands/meshes.d.ts.map +1 -1
- package/dist/commands/meshes.js +76 -47
- package/dist/commands/meshes.js.map +1 -1
- package/dist/commands/mint.d.ts.map +1 -1
- package/dist/commands/mint.js +212 -19
- package/dist/commands/mint.js.map +1 -1
- package/dist/commands/models.d.ts +5 -1
- package/dist/commands/models.d.ts.map +1 -1
- package/dist/commands/models.js +21 -13
- package/dist/commands/models.js.map +1 -1
- package/dist/commands/persona-remote.d.ts.map +1 -1
- package/dist/commands/persona-remote.js +24 -13
- package/dist/commands/persona-remote.js.map +1 -1
- package/dist/commands/persona.d.ts +1 -1
- package/dist/commands/persona.d.ts.map +1 -1
- package/dist/commands/persona.js +92 -23
- package/dist/commands/persona.js.map +1 -1
- package/dist/commands/personas.d.ts.map +1 -1
- package/dist/commands/personas.js +59 -40
- package/dist/commands/personas.js.map +1 -1
- package/dist/commands/reset-space-apply.d.ts.map +1 -1
- package/dist/commands/reset-space-apply.js +69 -17
- package/dist/commands/reset-space-apply.js.map +1 -1
- package/dist/commands/reset-store-apply.d.ts +16 -0
- package/dist/commands/reset-store-apply.d.ts.map +1 -1
- package/dist/commands/reset-store-apply.js +122 -23
- package/dist/commands/reset-store-apply.js.map +1 -1
- package/dist/commands/reset.d.ts.map +1 -1
- package/dist/commands/reset.js +8 -7
- package/dist/commands/reset.js.map +1 -1
- package/dist/commands/revoke-credential.d.ts +5 -0
- package/dist/commands/revoke-credential.d.ts.map +1 -0
- package/dist/commands/revoke-credential.js +128 -0
- package/dist/commands/revoke-credential.js.map +1 -0
- package/dist/commands/send.d.ts +11 -3
- package/dist/commands/send.d.ts.map +1 -1
- package/dist/commands/send.js +284 -47
- package/dist/commands/send.js.map +1 -1
- package/dist/commands/service-actions.d.ts +2 -1
- package/dist/commands/service-actions.d.ts.map +1 -1
- package/dist/commands/service-actions.js +117 -21
- package/dist/commands/service-actions.js.map +1 -1
- package/dist/commands/service-log-follow.js +1 -1
- package/dist/commands/service-log-follow.js.map +1 -1
- package/dist/commands/service-registry.d.ts +1 -1
- package/dist/commands/service-registry.d.ts.map +1 -1
- package/dist/commands/service-registry.js +74 -30
- package/dist/commands/service-registry.js.map +1 -1
- package/dist/commands/service-set-stop.d.ts.map +1 -1
- package/dist/commands/service-set-stop.js +3 -2
- package/dist/commands/service-set-stop.js.map +1 -1
- package/dist/commands/setup-start.d.ts.map +1 -1
- package/dist/commands/setup-start.js +46 -5
- package/dist/commands/setup-start.js.map +1 -1
- package/dist/commands/setup.d.ts.map +1 -1
- package/dist/commands/setup.js +28 -13
- package/dist/commands/setup.js.map +1 -1
- package/dist/commands/space-delete.d.ts.map +1 -1
- package/dist/commands/space-delete.js +130 -41
- package/dist/commands/space-delete.js.map +1 -1
- package/dist/commands/space-registration.d.ts +13 -6
- package/dist/commands/space-registration.d.ts.map +1 -1
- package/dist/commands/space-registration.js +167 -46
- package/dist/commands/space-registration.js.map +1 -1
- package/dist/commands/space.d.ts +15 -1
- package/dist/commands/space.d.ts.map +1 -1
- package/dist/commands/space.js +66 -24
- package/dist/commands/space.js.map +1 -1
- package/dist/commands/spawn-preview.d.ts.map +1 -1
- package/dist/commands/spawn-preview.js +48 -10
- package/dist/commands/spawn-preview.js.map +1 -1
- package/dist/commands/spawn.d.ts +36 -13
- package/dist/commands/spawn.d.ts.map +1 -1
- package/dist/commands/spawn.js +263 -129
- package/dist/commands/spawn.js.map +1 -1
- package/dist/commands/stack-down.d.ts +9 -3
- package/dist/commands/stack-down.d.ts.map +1 -1
- package/dist/commands/stack-down.js +344 -64
- package/dist/commands/stack-down.js.map +1 -1
- package/dist/commands/stack-gone.d.ts +17 -0
- package/dist/commands/stack-gone.d.ts.map +1 -0
- package/dist/commands/stack-gone.js +218 -0
- package/dist/commands/stack-gone.js.map +1 -0
- package/dist/commands/stack-up.d.ts +64 -4
- package/dist/commands/stack-up.d.ts.map +1 -1
- package/dist/commands/stack-up.js +482 -55
- package/dist/commands/stack-up.js.map +1 -1
- package/dist/commands/status.d.ts +76 -2
- package/dist/commands/status.d.ts.map +1 -1
- package/dist/commands/status.js +550 -112
- package/dist/commands/status.js.map +1 -1
- package/dist/commands/team-agent-apply.d.ts.map +1 -1
- package/dist/commands/team-agent-apply.js +4 -3
- package/dist/commands/team-agent-apply.js.map +1 -1
- package/dist/commands/team-agent-remove.d.ts.map +1 -1
- package/dist/commands/team-agent-remove.js +4 -4
- package/dist/commands/team-agent-remove.js.map +1 -1
- package/dist/commands/team-boot-controller.d.ts.map +1 -1
- package/dist/commands/team-boot-controller.js +8 -2
- package/dist/commands/team-boot-controller.js.map +1 -1
- package/dist/commands/team-channel-remove.d.ts.map +1 -1
- package/dist/commands/team-channel-remove.js +26 -10
- package/dist/commands/team-channel-remove.js.map +1 -1
- package/dist/commands/team-deploy-apply.d.ts.map +1 -1
- package/dist/commands/team-deploy-apply.js +4 -3
- package/dist/commands/team-deploy-apply.js.map +1 -1
- package/dist/commands/team-mixed-remove.js +5 -5
- package/dist/commands/team-mixed-remove.js.map +1 -1
- package/dist/commands/team.d.ts.map +1 -1
- package/dist/commands/team.js +94 -32
- package/dist/commands/team.js.map +1 -1
- package/dist/commands/telemetry.d.ts.map +1 -1
- package/dist/commands/telemetry.js +3 -1
- package/dist/commands/telemetry.js.map +1 -1
- package/dist/commands/topology.d.ts.map +1 -1
- package/dist/commands/topology.js +11 -7
- package/dist/commands/topology.js.map +1 -1
- package/dist/commands/up.d.ts +6 -6
- package/dist/commands/up.d.ts.map +1 -1
- package/dist/commands/up.js +963 -240
- package/dist/commands/up.js.map +1 -1
- package/dist/commands/update.d.ts.map +1 -1
- package/dist/commands/update.js +9 -3
- package/dist/commands/update.js.map +1 -1
- package/dist/commands/use.d.ts +5 -1
- package/dist/commands/use.d.ts.map +1 -1
- package/dist/commands/use.js +55 -12
- package/dist/commands/use.js.map +1 -1
- package/dist/commands/watch.d.ts +4 -1
- package/dist/commands/watch.d.ts.map +1 -1
- package/dist/commands/watch.js +15 -3
- package/dist/commands/watch.js.map +1 -1
- package/dist/commands/who.d.ts +2 -0
- package/dist/commands/who.d.ts.map +1 -1
- package/dist/commands/who.js +18 -5
- package/dist/commands/who.js.map +1 -1
- package/dist/commands/whoami.d.ts +44 -5
- package/dist/commands/whoami.d.ts.map +1 -1
- package/dist/commands/whoami.js +168 -16
- package/dist/commands/whoami.js.map +1 -1
- package/dist/console/app.d.ts +1 -1
- package/dist/console/app.d.ts.map +1 -1
- package/dist/console/app.js +15 -9
- package/dist/console/app.js.map +1 -1
- package/dist/console/launch.d.ts +25 -0
- package/dist/console/launch.d.ts.map +1 -0
- package/dist/console/launch.js +56 -0
- package/dist/console/launch.js.map +1 -0
- package/dist/console/ui/CommandPalette.d.ts +5 -4
- package/dist/console/ui/CommandPalette.d.ts.map +1 -1
- package/dist/console/ui/CommandPalette.js +136 -45
- package/dist/console/ui/CommandPalette.js.map +1 -1
- package/dist/console/ui/Help.js +1 -1
- package/dist/console/ui/Help.js.map +1 -1
- package/dist/console/ui/Modal.d.ts +10 -0
- package/dist/console/ui/Modal.d.ts.map +1 -0
- package/dist/console/ui/Modal.js +8 -0
- package/dist/console/ui/Modal.js.map +1 -0
- package/dist/console/ui/NewAgent.d.ts +14 -0
- package/dist/console/ui/NewAgent.d.ts.map +1 -0
- package/dist/console/ui/NewAgent.js +114 -0
- package/dist/console/ui/NewAgent.js.map +1 -0
- package/dist/console/ui/StatusBar.d.ts +1 -2
- package/dist/console/ui/StatusBar.d.ts.map +1 -1
- package/dist/console/ui/StatusBar.js +6 -8
- package/dist/console/ui/StatusBar.js.map +1 -1
- package/dist/console/ui/topo/Map.d.ts.map +1 -1
- package/dist/console/ui/topo/Map.js +1 -2
- package/dist/console/ui/topo/Map.js.map +1 -1
- package/dist/console/ui/topo/Matrix.js +2 -2
- package/dist/console/ui/topo/Matrix.js.map +1 -1
- package/dist/console/ui/topo/Sequence.d.ts.map +1 -1
- package/dist/console/ui/topo/Sequence.js +5 -4
- package/dist/console/ui/topo/Sequence.js.map +1 -1
- package/dist/console/ui/topo/model.d.ts +2 -1
- package/dist/console/ui/topo/model.d.ts.map +1 -1
- package/dist/console/ui/topo/model.js +4 -3
- package/dist/console/ui/topo/model.js.map +1 -1
- package/dist/exec-endpoint/service-adapter.d.ts.map +1 -1
- package/dist/exec-endpoint/service-adapter.js +13 -3
- package/dist/exec-endpoint/service-adapter.js.map +1 -1
- package/dist/ext-loader.d.ts +4 -0
- package/dist/ext-loader.d.ts.map +1 -1
- package/dist/ext-loader.js +6 -0
- package/dist/ext-loader.js.map +1 -1
- package/dist/help.d.ts.map +1 -1
- package/dist/help.js +44 -23
- package/dist/help.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +59 -54
- package/dist/index.js.map +1 -1
- package/dist/lib/agent-skills.d.ts.map +1 -1
- package/dist/lib/agent-skills.js +2 -1
- package/dist/lib/agent-skills.js.map +1 -1
- package/dist/lib/attach-client.js +2 -2
- package/dist/lib/attach-client.js.map +1 -1
- package/dist/lib/backup-artifact.d.ts +29 -8
- package/dist/lib/backup-artifact.d.ts.map +1 -1
- package/dist/lib/backup-artifact.js +147 -26
- package/dist/lib/backup-artifact.js.map +1 -1
- package/dist/lib/broker-service.d.ts +27 -3
- package/dist/lib/broker-service.d.ts.map +1 -1
- package/dist/lib/broker-service.js +135 -27
- package/dist/lib/broker-service.js.map +1 -1
- package/dist/lib/broker-store-health.d.ts +89 -0
- package/dist/lib/broker-store-health.d.ts.map +1 -0
- package/dist/lib/broker-store-health.js +171 -0
- package/dist/lib/broker-store-health.js.map +1 -0
- package/dist/lib/cancel.d.ts +4 -4
- package/dist/lib/cancel.d.ts.map +1 -1
- package/dist/lib/cancel.js +5 -5
- package/dist/lib/cancel.js.map +1 -1
- package/dist/lib/completion-install.d.ts +11 -2
- package/dist/lib/completion-install.d.ts.map +1 -1
- package/dist/lib/completion-install.js +79 -21
- package/dist/lib/completion-install.js.map +1 -1
- package/dist/lib/completion-scripts.d.ts.map +1 -1
- package/dist/lib/completion-scripts.js +2 -2
- package/dist/lib/completion-scripts.js.map +1 -1
- package/dist/lib/completion.d.ts +5 -1
- package/dist/lib/completion.d.ts.map +1 -1
- package/dist/lib/completion.js +10 -0
- package/dist/lib/completion.js.map +1 -1
- package/dist/lib/concrete-channel.d.ts +6 -0
- package/dist/lib/concrete-channel.d.ts.map +1 -0
- package/dist/lib/concrete-channel.js +17 -0
- package/dist/lib/concrete-channel.js.map +1 -0
- package/dist/lib/confirmation-required.d.ts +3 -12
- package/dist/lib/confirmation-required.d.ts.map +1 -1
- package/dist/lib/confirmation-required.js +9 -8
- package/dist/lib/confirmation-required.js.map +1 -1
- package/dist/lib/connect.d.ts +9 -0
- package/dist/lib/connect.d.ts.map +1 -1
- package/dist/lib/connect.js +27 -0
- package/dist/lib/connect.js.map +1 -1
- package/dist/lib/control.d.ts +42 -12
- package/dist/lib/control.d.ts.map +1 -1
- package/dist/lib/control.js +130 -31
- package/dist/lib/control.js.map +1 -1
- package/dist/lib/controller-restore.d.ts.map +1 -1
- package/dist/lib/controller-restore.js +12 -7
- package/dist/lib/controller-restore.js.map +1 -1
- package/dist/lib/credential-authority.d.ts.map +1 -1
- package/dist/lib/credential-authority.js +3 -0
- package/dist/lib/credential-authority.js.map +1 -1
- package/dist/lib/credential-exports.d.ts +17 -0
- package/dist/lib/credential-exports.d.ts.map +1 -0
- package/dist/lib/credential-exports.js +21 -0
- package/dist/lib/credential-exports.js.map +1 -0
- package/dist/lib/debug-flag.d.ts +4 -0
- package/dist/lib/debug-flag.d.ts.map +1 -0
- package/dist/lib/debug-flag.js +7 -0
- package/dist/lib/debug-flag.js.map +1 -0
- package/dist/lib/default-persona.d.ts +2 -0
- package/dist/lib/default-persona.d.ts.map +1 -1
- package/dist/lib/default-persona.js +2 -0
- package/dist/lib/default-persona.js.map +1 -1
- package/dist/lib/delivery-proc.d.ts +1 -1
- package/dist/lib/delivery-proc.d.ts.map +1 -1
- package/dist/lib/delivery-proc.js +5 -4
- package/dist/lib/delivery-proc.js.map +1 -1
- package/dist/lib/delivery-responder.d.ts +7 -3
- package/dist/lib/delivery-responder.d.ts.map +1 -1
- package/dist/lib/delivery-responder.js +8 -4
- package/dist/lib/delivery-responder.js.map +1 -1
- package/dist/lib/denied-write.d.ts +8 -0
- package/dist/lib/denied-write.d.ts.map +1 -0
- package/dist/lib/denied-write.js +24 -0
- package/dist/lib/denied-write.js.map +1 -0
- package/dist/lib/endpoint-capability-gates.js +2 -2
- package/dist/lib/endpoint-capability-gates.js.map +1 -1
- package/dist/lib/flag-value-refusal.d.ts +8 -0
- package/dist/lib/flag-value-refusal.d.ts.map +1 -0
- package/dist/lib/flag-value-refusal.js +10 -0
- package/dist/lib/flag-value-refusal.js.map +1 -0
- package/dist/lib/install-umask.d.ts +5 -0
- package/dist/lib/install-umask.d.ts.map +1 -1
- package/dist/lib/install-umask.js +25 -0
- package/dist/lib/install-umask.js.map +1 -1
- package/dist/lib/interrupt-notice.d.ts +23 -1
- package/dist/lib/interrupt-notice.d.ts.map +1 -1
- package/dist/lib/interrupt-notice.js +27 -6
- package/dist/lib/interrupt-notice.js.map +1 -1
- package/dist/lib/interrupt-report.d.ts +7 -0
- package/dist/lib/interrupt-report.d.ts.map +1 -0
- package/dist/lib/interrupt-report.js +24 -0
- package/dist/lib/interrupt-report.js.map +1 -0
- package/dist/lib/isolated-broker.d.ts +1 -1
- package/dist/lib/isolated-broker.d.ts.map +1 -1
- package/dist/lib/isolated-broker.js +17 -8
- package/dist/lib/isolated-broker.js.map +1 -1
- package/dist/lib/legacy-start.d.ts +8 -6
- package/dist/lib/legacy-start.d.ts.map +1 -1
- package/dist/lib/legacy-start.js +36 -36
- package/dist/lib/legacy-start.js.map +1 -1
- package/dist/lib/manager-choice.d.ts +45 -4
- package/dist/lib/manager-choice.d.ts.map +1 -1
- package/dist/lib/manager-choice.js +214 -24
- package/dist/lib/manager-choice.js.map +1 -1
- package/dist/lib/manager-proc.d.ts.map +1 -1
- package/dist/lib/manager-proc.js +7 -6
- package/dist/lib/manager-proc.js.map +1 -1
- package/dist/lib/manifest/index.d.ts +5 -1
- package/dist/lib/manifest/index.d.ts.map +1 -1
- package/dist/lib/manifest/index.js +50 -5
- package/dist/lib/manifest/index.js.map +1 -1
- package/dist/lib/manifest/preflight.d.ts +4 -0
- package/dist/lib/manifest/preflight.d.ts.map +1 -1
- package/dist/lib/manifest/preflight.js +18 -1
- package/dist/lib/manifest/preflight.js.map +1 -1
- package/dist/lib/manifest/resolve.d.ts +8 -0
- package/dist/lib/manifest/resolve.d.ts.map +1 -1
- package/dist/lib/manifest/resolve.js +104 -11
- package/dist/lib/manifest/resolve.js.map +1 -1
- package/dist/lib/missing-flags.js +1 -1
- package/dist/lib/missing-flags.js.map +1 -1
- package/dist/lib/nats-bin.d.ts +28 -5
- package/dist/lib/nats-bin.d.ts.map +1 -1
- package/dist/lib/nats-bin.js +85 -7
- package/dist/lib/nats-bin.js.map +1 -1
- package/dist/lib/nearest-word.d.ts +14 -0
- package/dist/lib/nearest-word.d.ts.map +1 -0
- package/dist/lib/nearest-word.js +76 -0
- package/dist/lib/nearest-word.js.map +1 -0
- package/dist/lib/no-expiry-record.d.ts +8 -0
- package/dist/lib/no-expiry-record.d.ts.map +1 -0
- package/dist/lib/no-expiry-record.js +27 -0
- package/dist/lib/no-expiry-record.js.map +1 -0
- package/dist/lib/paths.d.ts +31 -0
- package/dist/lib/paths.d.ts.map +1 -1
- package/dist/lib/paths.js +92 -2
- package/dist/lib/paths.js.map +1 -1
- package/dist/lib/persona-files.d.ts +29 -6
- package/dist/lib/persona-files.d.ts.map +1 -1
- package/dist/lib/persona-files.js +179 -36
- package/dist/lib/persona-files.js.map +1 -1
- package/dist/lib/personas.d.ts +18 -1
- package/dist/lib/personas.d.ts.map +1 -1
- package/dist/lib/personas.js +65 -6
- package/dist/lib/personas.js.map +1 -1
- package/dist/lib/prompts.d.ts +7 -1
- package/dist/lib/prompts.d.ts.map +1 -1
- package/dist/lib/prompts.js +43 -3
- package/dist/lib/prompts.js.map +1 -1
- package/dist/lib/registry-errors.d.ts +2 -1
- package/dist/lib/registry-errors.d.ts.map +1 -1
- package/dist/lib/registry-errors.js +6 -2
- package/dist/lib/registry-errors.js.map +1 -1
- package/dist/lib/reset-space-plan.d.ts +2 -0
- package/dist/lib/reset-space-plan.d.ts.map +1 -1
- package/dist/lib/reset-space-plan.js +1 -1
- package/dist/lib/reset-space-plan.js.map +1 -1
- package/dist/lib/restore.d.ts +45 -3
- package/dist/lib/restore.d.ts.map +1 -1
- package/dist/lib/restore.js +233 -39
- package/dist/lib/restore.js.map +1 -1
- package/dist/lib/rolled-back-runs.d.ts +36 -0
- package/dist/lib/rolled-back-runs.d.ts.map +1 -0
- package/dist/lib/rolled-back-runs.js +96 -0
- package/dist/lib/rolled-back-runs.js.map +1 -0
- package/dist/lib/service-definitions.d.ts +16 -3
- package/dist/lib/service-definitions.d.ts.map +1 -1
- package/dist/lib/service-definitions.js +99 -27
- package/dist/lib/service-definitions.js.map +1 -1
- package/dist/lib/service-instances.d.ts +13 -1
- package/dist/lib/service-instances.d.ts.map +1 -1
- package/dist/lib/service-instances.js +56 -12
- package/dist/lib/service-instances.js.map +1 -1
- package/dist/lib/service-presets.d.ts.map +1 -1
- package/dist/lib/service-presets.js +16 -0
- package/dist/lib/service-presets.js.map +1 -1
- package/dist/lib/service-process.d.ts +51 -8
- package/dist/lib/service-process.d.ts.map +1 -1
- package/dist/lib/service-process.js +385 -48
- package/dist/lib/service-process.js.map +1 -1
- package/dist/lib/space-streams.d.ts +18 -0
- package/dist/lib/space-streams.d.ts.map +1 -0
- package/dist/lib/space-streams.js +35 -0
- package/dist/lib/space-streams.js.map +1 -0
- package/dist/lib/spawn-defaults.d.ts +25 -1
- package/dist/lib/spawn-defaults.d.ts.map +1 -1
- package/dist/lib/spawn-defaults.js +37 -1
- package/dist/lib/spawn-defaults.js.map +1 -1
- package/dist/lib/stack-journal.d.ts +157 -14
- package/dist/lib/stack-journal.d.ts.map +1 -1
- package/dist/lib/stack-journal.js +406 -49
- package/dist/lib/stack-journal.js.map +1 -1
- package/dist/lib/stack-listeners.d.ts +17 -0
- package/dist/lib/stack-listeners.d.ts.map +1 -0
- package/dist/lib/stack-listeners.js +54 -0
- package/dist/lib/stack-listeners.js.map +1 -0
- package/dist/lib/stack-members.d.ts +13 -0
- package/dist/lib/stack-members.d.ts.map +1 -0
- package/dist/lib/stack-members.js +24 -0
- package/dist/lib/stack-members.js.map +1 -0
- package/dist/lib/stack-resume.d.ts.map +1 -1
- package/dist/lib/stack-resume.js +5 -2
- package/dist/lib/stack-resume.js.map +1 -1
- package/dist/lib/stack-runs.d.ts +34 -0
- package/dist/lib/stack-runs.d.ts.map +1 -0
- package/dist/lib/stack-runs.js +75 -0
- package/dist/lib/stack-runs.js.map +1 -0
- package/dist/lib/status.d.ts +11 -0
- package/dist/lib/status.d.ts.map +1 -1
- package/dist/lib/status.js +4 -5
- package/dist/lib/status.js.map +1 -1
- package/dist/lib/stdout-owner.d.ts +12 -3
- package/dist/lib/stdout-owner.d.ts.map +1 -1
- package/dist/lib/stdout-owner.js +33 -5
- package/dist/lib/stdout-owner.js.map +1 -1
- package/dist/lib/store-dir.d.ts +68 -4
- package/dist/lib/store-dir.d.ts.map +1 -1
- package/dist/lib/store-dir.js +253 -17
- package/dist/lib/store-dir.js.map +1 -1
- package/dist/lib/team-additive-attempt.d.ts +1 -1
- package/dist/lib/team-channel-removal.d.ts.map +1 -1
- package/dist/lib/team-channel-removal.js +4 -0
- package/dist/lib/team-channel-removal.js.map +1 -1
- package/dist/lib/team-deploy-inspection.d.ts +13 -0
- package/dist/lib/team-deploy-inspection.d.ts.map +1 -1
- package/dist/lib/team-deploy-inspection.js +12 -0
- package/dist/lib/team-deploy-inspection.js.map +1 -1
- package/dist/lib/team-text.d.ts +6 -0
- package/dist/lib/team-text.d.ts.map +1 -0
- package/dist/lib/team-text.js +36 -0
- package/dist/lib/team-text.js.map +1 -0
- package/dist/lib/transient.d.ts +14 -8
- package/dist/lib/transient.d.ts.map +1 -1
- package/dist/lib/transient.js +72 -11
- package/dist/lib/transient.js.map +1 -1
- package/dist/lib/unusable-file.d.ts +13 -0
- package/dist/lib/unusable-file.d.ts.map +1 -0
- package/dist/lib/unusable-file.js +12 -0
- package/dist/lib/unusable-file.js.map +1 -0
- package/dist/lib/up-report.d.ts +6 -0
- package/dist/lib/up-report.d.ts.map +1 -1
- package/dist/lib/up-report.js +13 -0
- package/dist/lib/up-report.js.map +1 -1
- package/dist/lib/verdict.d.ts +14 -0
- package/dist/lib/verdict.d.ts.map +1 -0
- package/dist/lib/verdict.js +15 -0
- package/dist/lib/verdict.js.map +1 -0
- package/dist/managed-handoff.d.ts +11 -6
- package/dist/managed-handoff.d.ts.map +1 -1
- package/dist/managed-handoff.js +27 -18
- package/dist/managed-handoff.js.map +1 -1
- package/dist/render.d.ts +5 -2
- package/dist/render.d.ts.map +1 -1
- package/dist/render.js +44 -10
- package/dist/render.js.map +1 -1
- package/dist/telemetry.d.ts +4 -3
- package/dist/telemetry.d.ts.map +1 -1
- package/dist/telemetry.js +14 -6
- package/dist/telemetry.js.map +1 -1
- package/dist/ui.d.ts +3 -2
- package/dist/ui.d.ts.map +1 -1
- package/dist/ui.js +6 -4
- package/dist/ui.js.map +1 -1
- package/dist/view/mesh-view.d.ts.map +1 -1
- package/dist/view/mesh-view.js +4 -1
- package/dist/view/mesh-view.js.map +1 -1
- package/dist/watch-data.d.ts +9 -1
- package/dist/watch-data.d.ts.map +1 -1
- package/dist/watch-data.js +17 -3
- package/dist/watch-data.js.map +1 -1
- package/dist/watch-json.js +4 -3
- package/dist/watch-json.js.map +1 -1
- package/package.json +5 -5
package/dist/commands/down.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { existsSync, lstatSync, readdirSync,
|
|
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 {
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
97
|
-
|
|
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
|
-
|
|
107
|
-
|
|
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,
|
|
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 = () =>
|
|
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
|
-
|
|
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,
|
|
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.
|
|
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 =
|
|
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
|
|
252
|
-
*
|
|
253
|
-
*
|
|
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
|
-
|
|
330
|
-
|
|
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"]
|
|
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.
|
|
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
|
-
|
|
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
|
-
|
|
515
|
+
stderrLine("✗ ", `${e.message}`, c.red);
|
|
475
516
|
}
|
|
476
517
|
}
|
|
477
518
|
if (!allStopped) {
|
|
478
|
-
|
|
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
|
-
|
|
509
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
/**
|
|
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
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
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);
|