@cotal-ai/cli 0.90.1 → 0.91.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 +17 -0
- package/dist/chat/chat-view.d.ts.map +1 -0
- package/dist/chat/chat-view.js +179 -0
- package/dist/chat/chat-view.js.map +1 -0
- package/dist/chat/controller.d.ts +19 -0
- package/dist/chat/controller.d.ts.map +1 -0
- package/dist/chat/controller.js +116 -0
- package/dist/chat/controller.js.map +1 -0
- package/dist/chat/engine.d.ts +108 -0
- package/dist/chat/engine.d.ts.map +1 -0
- package/dist/chat/engine.js +226 -0
- package/dist/chat/engine.js.map +1 -0
- package/dist/chat/frontend.d.ts +35 -0
- package/dist/chat/frontend.d.ts.map +1 -0
- package/dist/chat/frontend.js +151 -0
- package/dist/chat/frontend.js.map +1 -0
- package/dist/chat/native-session.d.ts +71 -0
- package/dist/chat/native-session.d.ts.map +1 -0
- package/dist/chat/native-session.js +348 -0
- package/dist/chat/native-session.js.map +1 -0
- package/dist/chat/open-session.d.ts +8 -0
- package/dist/chat/open-session.d.ts.map +1 -0
- package/dist/chat/open-session.js +120 -0
- package/dist/chat/open-session.js.map +1 -0
- package/dist/chat/picker.d.ts +34 -0
- package/dist/chat/picker.d.ts.map +1 -0
- package/dist/chat/picker.js +97 -0
- package/dist/chat/picker.js.map +1 -0
- package/dist/chat/plain.d.ts +15 -0
- package/dist/chat/plain.d.ts.map +1 -0
- package/dist/chat/plain.js +242 -0
- package/dist/chat/plain.js.map +1 -0
- package/dist/chat/session.d.ts +217 -0
- package/dist/chat/session.d.ts.map +1 -0
- package/dist/chat/session.js +2 -0
- package/dist/chat/session.js.map +1 -0
- package/dist/chat/static-session.d.ts +61 -0
- package/dist/chat/static-session.d.ts.map +1 -0
- package/dist/chat/static-session.js +212 -0
- package/dist/chat/static-session.js.map +1 -0
- package/dist/chat/stdio-io.d.ts +34 -0
- package/dist/chat/stdio-io.d.ts.map +1 -0
- package/dist/chat/stdio-io.js +175 -0
- package/dist/chat/stdio-io.js.map +1 -0
- package/dist/chat/stdio.d.ts +173 -0
- package/dist/chat/stdio.d.ts.map +1 -0
- package/dist/chat/stdio.js +400 -0
- package/dist/chat/stdio.js.map +1 -0
- package/dist/chat/user-session.d.ts +21 -0
- package/dist/chat/user-session.d.ts.map +1 -0
- package/dist/chat/user-session.js +180 -0
- package/dist/chat/user-session.js.map +1 -0
- package/dist/chat/view.d.ts +186 -0
- package/dist/chat/view.d.ts.map +1 -0
- package/dist/chat/view.js +386 -0
- package/dist/chat/view.js.map +1 -0
- package/dist/command.d.ts +11 -3
- package/dist/command.d.ts.map +1 -1
- package/dist/command.js +392 -147
- package/dist/command.js.map +1 -1
- package/dist/commands/agents.d.ts +103 -11
- package/dist/commands/agents.d.ts.map +1 -1
- package/dist/commands/agents.js +501 -251
- package/dist/commands/agents.js.map +1 -1
- package/dist/commands/app-identity.d.ts.map +1 -1
- package/dist/commands/app-identity.js +10 -1
- package/dist/commands/app-identity.js.map +1 -1
- package/dist/commands/backup-maintenance.d.ts +4 -0
- package/dist/commands/backup-maintenance.d.ts.map +1 -0
- package/dist/commands/backup-maintenance.js +92 -0
- package/dist/commands/backup-maintenance.js.map +1 -0
- package/dist/commands/backup-read.d.ts +4 -0
- package/dist/commands/backup-read.d.ts.map +1 -0
- package/dist/commands/backup-read.js +27 -0
- package/dist/commands/backup-read.js.map +1 -0
- package/dist/commands/backup-restore.d.ts +7 -0
- package/dist/commands/backup-restore.d.ts.map +1 -0
- package/dist/commands/backup-restore.js +81 -0
- package/dist/commands/backup-restore.js.map +1 -0
- package/dist/commands/backup.d.ts +2 -1
- package/dist/commands/backup.d.ts.map +1 -1
- package/dist/commands/backup.js +102 -24
- package/dist/commands/backup.js.map +1 -1
- package/dist/commands/channel-members.d.ts +8 -0
- package/dist/commands/channel-members.d.ts.map +1 -0
- package/dist/commands/channel-members.js +144 -0
- package/dist/commands/channel-members.js.map +1 -0
- package/dist/commands/channels.d.ts +75 -22
- package/dist/commands/channels.d.ts.map +1 -1
- package/dist/commands/channels.js +181 -100
- package/dist/commands/channels.js.map +1 -1
- package/dist/commands/chat.d.ts +109 -0
- package/dist/commands/chat.d.ts.map +1 -0
- package/dist/commands/chat.js +227 -0
- package/dist/commands/chat.js.map +1 -0
- package/dist/commands/clean.d.ts +43 -1
- package/dist/commands/clean.d.ts.map +1 -1
- package/dist/commands/clean.js +90 -47
- package/dist/commands/clean.js.map +1 -1
- package/dist/commands/completion.d.ts +39 -1
- package/dist/commands/completion.d.ts.map +1 -1
- package/dist/commands/completion.js +211 -87
- package/dist/commands/completion.js.map +1 -1
- package/dist/commands/config.d.ts +33 -0
- package/dist/commands/config.d.ts.map +1 -0
- package/dist/commands/config.js +159 -0
- package/dist/commands/config.js.map +1 -0
- package/dist/commands/console.d.ts.map +1 -1
- package/dist/commands/console.js +25 -7
- package/dist/commands/console.js.map +1 -1
- package/dist/commands/describe.d.ts +63 -31
- package/dist/commands/describe.d.ts.map +1 -1
- package/dist/commands/describe.js +264 -136
- package/dist/commands/describe.js.map +1 -1
- package/dist/commands/doctor.d.ts +11 -6
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +195 -288
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/down-services.d.ts +29 -0
- package/dist/commands/down-services.d.ts.map +1 -0
- package/dist/commands/down-services.js +129 -0
- package/dist/commands/down-services.js.map +1 -0
- package/dist/commands/down.d.ts +37 -11
- package/dist/commands/down.d.ts.map +1 -1
- package/dist/commands/down.js +276 -115
- package/dist/commands/down.js.map +1 -1
- package/dist/commands/endpoint-authoring.d.ts +4 -0
- package/dist/commands/endpoint-authoring.d.ts.map +1 -0
- package/dist/commands/endpoint-authoring.js +125 -0
- package/dist/commands/endpoint-authoring.js.map +1 -0
- package/dist/commands/endpoint-deregister.d.ts +5 -0
- package/dist/commands/endpoint-deregister.d.ts.map +1 -0
- package/dist/commands/endpoint-deregister.js +70 -0
- package/dist/commands/endpoint-deregister.js.map +1 -0
- package/dist/commands/endpoint.d.ts +118 -0
- package/dist/commands/endpoint.d.ts.map +1 -0
- package/dist/commands/endpoint.js +177 -0
- package/dist/commands/endpoint.js.map +1 -0
- package/dist/commands/endpoints.d.ts +27 -1
- package/dist/commands/endpoints.d.ts.map +1 -1
- package/dist/commands/endpoints.js +42 -30
- package/dist/commands/endpoints.js.map +1 -1
- package/dist/commands/ext.d.ts +38 -1
- package/dist/commands/ext.d.ts.map +1 -1
- package/dist/commands/ext.js +84 -49
- package/dist/commands/ext.js.map +1 -1
- package/dist/commands/feedback.d.ts +58 -1
- package/dist/commands/feedback.d.ts.map +1 -1
- package/dist/commands/feedback.js +119 -47
- package/dist/commands/feedback.js.map +1 -1
- package/dist/commands/help.d.ts +20 -0
- package/dist/commands/help.d.ts.map +1 -0
- package/dist/commands/help.js +52 -0
- package/dist/commands/help.js.map +1 -0
- package/dist/commands/history-clear.d.ts +14 -0
- package/dist/commands/history-clear.d.ts.map +1 -0
- package/dist/commands/history-clear.js +73 -0
- package/dist/commands/history-clear.js.map +1 -0
- package/dist/commands/history.d.ts +146 -4
- package/dist/commands/history.d.ts.map +1 -1
- package/dist/commands/history.js +443 -19
- package/dist/commands/history.js.map +1 -1
- package/dist/commands/join.d.ts.map +1 -1
- package/dist/commands/join.js +7 -3
- package/dist/commands/join.js.map +1 -1
- package/dist/commands/meshes-add.d.ts +3 -0
- package/dist/commands/meshes-add.d.ts.map +1 -1
- package/dist/commands/meshes-add.js +41 -34
- package/dist/commands/meshes-add.js.map +1 -1
- package/dist/commands/meshes-wizard.js +3 -3
- package/dist/commands/meshes-wizard.js.map +1 -1
- package/dist/commands/mint-endpoint-caller.d.ts +5 -0
- package/dist/commands/mint-endpoint-caller.d.ts.map +1 -0
- package/dist/commands/mint-endpoint-caller.js +130 -0
- package/dist/commands/mint-endpoint-caller.js.map +1 -0
- package/dist/commands/mint.d.ts +2 -37
- package/dist/commands/mint.d.ts.map +1 -1
- package/dist/commands/mint.js +142 -325
- package/dist/commands/mint.js.map +1 -1
- package/dist/commands/models.d.ts +30 -8
- package/dist/commands/models.d.ts.map +1 -1
- package/dist/commands/models.js +72 -41
- package/dist/commands/models.js.map +1 -1
- package/dist/commands/persona-remote.d.ts +5 -0
- package/dist/commands/persona-remote.d.ts.map +1 -0
- package/dist/commands/persona-remote.js +237 -0
- package/dist/commands/persona-remote.js.map +1 -0
- package/dist/commands/persona.d.ts +91 -0
- package/dist/commands/persona.d.ts.map +1 -0
- package/dist/commands/persona.js +200 -0
- package/dist/commands/persona.js.map +1 -0
- package/dist/commands/personas.d.ts.map +1 -1
- package/dist/commands/personas.js +16 -59
- package/dist/commands/personas.js.map +1 -1
- package/dist/commands/reset-space-apply.d.ts +5 -0
- package/dist/commands/reset-space-apply.d.ts.map +1 -0
- package/dist/commands/reset-space-apply.js +140 -0
- package/dist/commands/reset-space-apply.js.map +1 -0
- package/dist/commands/reset-store-apply.d.ts +11 -0
- package/dist/commands/reset-store-apply.d.ts.map +1 -0
- package/dist/commands/reset-store-apply.js +154 -0
- package/dist/commands/reset-store-apply.js.map +1 -0
- package/dist/commands/reset.d.ts +26 -0
- package/dist/commands/reset.d.ts.map +1 -0
- package/dist/commands/reset.js +143 -0
- package/dist/commands/reset.js.map +1 -0
- package/dist/commands/runtimes.d.ts +26 -1
- package/dist/commands/runtimes.d.ts.map +1 -1
- package/dist/commands/runtimes.js +68 -32
- package/dist/commands/runtimes.js.map +1 -1
- package/dist/commands/send.d.ts +91 -6
- package/dist/commands/send.d.ts.map +1 -1
- package/dist/commands/send.js +180 -106
- package/dist/commands/send.js.map +1 -1
- package/dist/commands/service-actions.d.ts +6 -0
- package/dist/commands/service-actions.d.ts.map +1 -0
- package/dist/commands/service-actions.js +405 -0
- package/dist/commands/service-actions.js.map +1 -0
- package/dist/commands/service-log-follow.d.ts +5 -0
- package/dist/commands/service-log-follow.d.ts.map +1 -0
- package/dist/commands/service-log-follow.js +106 -0
- package/dist/commands/service-log-follow.js.map +1 -0
- package/dist/commands/service-registry.d.ts +67 -0
- package/dist/commands/service-registry.d.ts.map +1 -0
- package/dist/commands/service-registry.js +275 -0
- package/dist/commands/service-registry.js.map +1 -0
- package/dist/commands/service-set-stop.d.ts +6 -0
- package/dist/commands/service-set-stop.d.ts.map +1 -0
- package/dist/commands/service-set-stop.js +161 -0
- package/dist/commands/service-set-stop.js.map +1 -0
- package/dist/commands/service-unit-entry.d.ts +5 -0
- package/dist/commands/service-unit-entry.d.ts.map +1 -0
- package/dist/commands/service-unit-entry.js +113 -0
- package/dist/commands/service-unit-entry.js.map +1 -0
- package/dist/commands/setup-start.d.ts +21 -0
- package/dist/commands/setup-start.d.ts.map +1 -0
- package/dist/commands/setup-start.js +95 -0
- package/dist/commands/setup-start.js.map +1 -0
- package/dist/commands/setup.d.ts +86 -100
- package/dist/commands/setup.d.ts.map +1 -1
- package/dist/commands/setup.js +766 -487
- package/dist/commands/setup.js.map +1 -1
- package/dist/commands/space-delete.d.ts +3 -0
- package/dist/commands/space-delete.d.ts.map +1 -0
- package/dist/commands/space-delete.js +341 -0
- package/dist/commands/space-delete.js.map +1 -0
- package/dist/commands/space-registration.d.ts +92 -0
- package/dist/commands/space-registration.d.ts.map +1 -0
- package/dist/commands/space-registration.js +388 -0
- package/dist/commands/space-registration.js.map +1 -0
- package/dist/commands/space.d.ts +128 -0
- package/dist/commands/space.d.ts.map +1 -0
- package/dist/commands/space.js +230 -0
- package/dist/commands/space.js.map +1 -0
- package/dist/commands/spawn-manifest.d.ts.map +1 -1
- package/dist/commands/spawn-manifest.js +2 -2
- package/dist/commands/spawn-manifest.js.map +1 -1
- package/dist/commands/spawn-preview.d.ts +9 -0
- package/dist/commands/spawn-preview.d.ts.map +1 -0
- package/dist/commands/spawn-preview.js +68 -0
- package/dist/commands/spawn-preview.js.map +1 -0
- package/dist/commands/spawn.d.ts +78 -18
- package/dist/commands/spawn.d.ts.map +1 -1
- package/dist/commands/spawn.js +236 -96
- package/dist/commands/spawn.js.map +1 -1
- package/dist/commands/stack-down.d.ts +6 -0
- package/dist/commands/stack-down.d.ts.map +1 -0
- package/dist/commands/stack-down.js +206 -0
- package/dist/commands/stack-down.js.map +1 -0
- package/dist/commands/stack-up.d.ts +149 -0
- package/dist/commands/stack-up.d.ts.map +1 -0
- package/dist/commands/stack-up.js +459 -0
- package/dist/commands/stack-up.js.map +1 -0
- package/dist/commands/stack-user-auth.d.ts +52 -0
- package/dist/commands/stack-user-auth.d.ts.map +1 -0
- package/dist/commands/stack-user-auth.js +128 -0
- package/dist/commands/stack-user-auth.js.map +1 -0
- package/dist/commands/status.d.ts +232 -5
- package/dist/commands/status.d.ts.map +1 -1
- package/dist/commands/status.js +989 -406
- package/dist/commands/status.js.map +1 -1
- package/dist/commands/sync.d.ts +23 -0
- package/dist/commands/sync.d.ts.map +1 -1
- package/dist/commands/sync.js +69 -17
- package/dist/commands/sync.js.map +1 -1
- package/dist/commands/team-agent-apply.d.ts +5 -0
- package/dist/commands/team-agent-apply.d.ts.map +1 -0
- package/dist/commands/team-agent-apply.js +204 -0
- package/dist/commands/team-agent-apply.js.map +1 -0
- package/dist/commands/team-agent-remove.d.ts +87 -0
- package/dist/commands/team-agent-remove.d.ts.map +1 -0
- package/dist/commands/team-agent-remove.js +348 -0
- package/dist/commands/team-agent-remove.js.map +1 -0
- package/dist/commands/team-boot-controller.d.ts +11 -0
- package/dist/commands/team-boot-controller.d.ts.map +1 -0
- package/dist/commands/team-boot-controller.js +176 -0
- package/dist/commands/team-boot-controller.js.map +1 -0
- package/dist/commands/team-channel-remove.d.ts +167 -0
- package/dist/commands/team-channel-remove.d.ts.map +1 -0
- package/dist/commands/team-channel-remove.js +486 -0
- package/dist/commands/team-channel-remove.js.map +1 -0
- package/dist/commands/team-deploy-apply.d.ts +11 -0
- package/dist/commands/team-deploy-apply.d.ts.map +1 -0
- package/dist/commands/team-deploy-apply.js +320 -0
- package/dist/commands/team-deploy-apply.js.map +1 -0
- package/dist/commands/team-mixed-remove.d.ts +8 -0
- package/dist/commands/team-mixed-remove.d.ts.map +1 -0
- package/dist/commands/team-mixed-remove.js +207 -0
- package/dist/commands/team-mixed-remove.js.map +1 -0
- package/dist/commands/team.d.ts +51 -0
- package/dist/commands/team.d.ts.map +1 -0
- package/dist/commands/team.js +727 -0
- package/dist/commands/team.js.map +1 -0
- package/dist/commands/topology.d.ts +4 -0
- package/dist/commands/topology.d.ts.map +1 -1
- package/dist/commands/topology.js +8 -0
- package/dist/commands/topology.js.map +1 -1
- package/dist/commands/up.d.ts +144 -5
- package/dist/commands/up.d.ts.map +1 -1
- package/dist/commands/up.js +1015 -124
- package/dist/commands/up.js.map +1 -1
- package/dist/commands/update.d.ts +11 -0
- package/dist/commands/update.d.ts.map +1 -1
- package/dist/commands/update.js +72 -15
- package/dist/commands/update.js.map +1 -1
- package/dist/commands/use.d.ts +16 -3
- package/dist/commands/use.d.ts.map +1 -1
- package/dist/commands/use.js +45 -19
- package/dist/commands/use.js.map +1 -1
- package/dist/commands/watch.d.ts +37 -0
- package/dist/commands/watch.d.ts.map +1 -0
- package/dist/commands/watch.js +106 -0
- package/dist/commands/watch.js.map +1 -0
- package/dist/commands/who.d.ts +79 -0
- package/dist/commands/who.d.ts.map +1 -0
- package/dist/commands/who.js +193 -0
- package/dist/commands/who.js.map +1 -0
- package/dist/commands/whoami.d.ts +56 -0
- package/dist/commands/whoami.d.ts.map +1 -0
- package/dist/commands/whoami.js +106 -0
- package/dist/commands/whoami.js.map +1 -0
- package/dist/console/app.d.ts.map +1 -1
- package/dist/console/app.js +8 -4
- package/dist/console/app.js.map +1 -1
- package/dist/console/commands.d.ts.map +1 -1
- package/dist/console/commands.js +12 -6
- package/dist/console/commands.js.map +1 -1
- package/dist/exec-endpoint/definition.d.ts +15 -0
- package/dist/exec-endpoint/definition.d.ts.map +1 -0
- package/dist/exec-endpoint/definition.js +56 -0
- package/dist/exec-endpoint/definition.js.map +1 -0
- package/dist/exec-endpoint/handler.d.ts +13 -0
- package/dist/exec-endpoint/handler.d.ts.map +1 -0
- package/dist/exec-endpoint/handler.js +155 -0
- package/dist/exec-endpoint/handler.js.map +1 -0
- package/dist/exec-endpoint/registration.d.ts +34 -0
- package/dist/exec-endpoint/registration.d.ts.map +1 -0
- package/dist/exec-endpoint/registration.js +148 -0
- package/dist/exec-endpoint/registration.js.map +1 -0
- package/dist/exec-endpoint/serve.d.ts +8 -0
- package/dist/exec-endpoint/serve.d.ts.map +1 -0
- package/dist/exec-endpoint/serve.js +159 -0
- package/dist/exec-endpoint/serve.js.map +1 -0
- package/dist/exec-endpoint/service-adapter.d.ts +6 -0
- package/dist/exec-endpoint/service-adapter.d.ts.map +1 -0
- package/dist/exec-endpoint/service-adapter.js +110 -0
- package/dist/exec-endpoint/service-adapter.js.map +1 -0
- package/dist/ext-loader.d.ts +10 -0
- package/dist/ext-loader.d.ts.map +1 -1
- package/dist/ext-loader.js +61 -13
- package/dist/ext-loader.js.map +1 -1
- package/dist/help.d.ts +18 -0
- package/dist/help.d.ts.map +1 -0
- package/dist/help.js +256 -0
- package/dist/help.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +444 -118
- package/dist/index.js.map +1 -1
- package/dist/lib/assist.d.ts.map +1 -1
- package/dist/lib/assist.js +3 -2
- package/dist/lib/assist.js.map +1 -1
- package/dist/lib/attach-client.d.ts +7 -6
- package/dist/lib/attach-client.d.ts.map +1 -1
- package/dist/lib/attach-client.js +14 -15
- package/dist/lib/attach-client.js.map +1 -1
- package/dist/lib/auth-proc.d.ts +3 -3
- package/dist/lib/auth-proc.d.ts.map +1 -1
- package/dist/lib/auth-proc.js +8 -8
- package/dist/lib/auth-proc.js.map +1 -1
- package/dist/lib/backup-artifact.d.ts +34 -1
- package/dist/lib/backup-artifact.d.ts.map +1 -1
- package/dist/lib/backup-artifact.js +67 -17
- package/dist/lib/backup-artifact.js.map +1 -1
- package/dist/lib/broker-service.d.ts +10 -0
- package/dist/lib/broker-service.d.ts.map +1 -0
- package/dist/lib/broker-service.js +329 -0
- package/dist/lib/broker-service.js.map +1 -0
- package/dist/lib/cancel.js +1 -1
- package/dist/lib/cancel.js.map +1 -1
- package/dist/lib/choose-target.d.ts +10 -0
- package/dist/lib/choose-target.d.ts.map +1 -0
- package/dist/lib/choose-target.js +42 -0
- package/dist/lib/choose-target.js.map +1 -0
- package/dist/lib/command-path.d.ts +13 -0
- package/dist/lib/command-path.d.ts.map +1 -0
- package/dist/lib/command-path.js +40 -0
- package/dist/lib/command-path.js.map +1 -0
- package/dist/lib/completion-install.d.ts +29 -0
- package/dist/lib/completion-install.d.ts.map +1 -0
- package/dist/lib/completion-install.js +369 -0
- package/dist/lib/completion-install.js.map +1 -0
- package/dist/lib/completion-scripts.d.ts +4 -0
- package/dist/lib/completion-scripts.d.ts.map +1 -0
- package/dist/lib/completion-scripts.js +15 -0
- package/dist/lib/completion-scripts.js.map +1 -0
- package/dist/lib/completion.d.ts.map +1 -1
- package/dist/lib/completion.js +4 -1
- package/dist/lib/completion.js.map +1 -1
- package/dist/lib/control.d.ts +65 -6
- package/dist/lib/control.d.ts.map +1 -1
- package/dist/lib/control.js +121 -27
- package/dist/lib/control.js.map +1 -1
- package/dist/lib/controller-preserve.d.ts +12 -0
- package/dist/lib/controller-preserve.d.ts.map +1 -0
- package/dist/lib/controller-preserve.js +373 -0
- package/dist/lib/controller-preserve.js.map +1 -0
- package/dist/lib/controller-restore.d.ts +38 -0
- package/dist/lib/controller-restore.d.ts.map +1 -0
- package/dist/lib/controller-restore.js +205 -0
- package/dist/lib/controller-restore.js.map +1 -0
- package/dist/lib/controller-resume.d.ts +92 -0
- package/dist/lib/controller-resume.d.ts.map +1 -0
- package/dist/lib/controller-resume.js +300 -0
- package/dist/lib/controller-resume.js.map +1 -0
- package/dist/lib/credential-authority.d.ts +17 -0
- package/dist/lib/credential-authority.d.ts.map +1 -0
- package/dist/lib/credential-authority.js +28 -0
- package/dist/lib/credential-authority.js.map +1 -0
- package/dist/lib/default-persona.d.ts +38 -0
- package/dist/lib/default-persona.d.ts.map +1 -0
- package/dist/lib/default-persona.js +85 -0
- package/dist/lib/default-persona.js.map +1 -0
- package/dist/lib/delivery-proc.d.ts +9 -9
- package/dist/lib/delivery-proc.d.ts.map +1 -1
- package/dist/lib/delivery-proc.js +9 -19
- package/dist/lib/delivery-proc.js.map +1 -1
- package/dist/lib/endpoint-capability-gates.d.ts +10 -0
- package/dist/lib/endpoint-capability-gates.d.ts.map +1 -0
- package/dist/lib/endpoint-capability-gates.js +70 -0
- package/dist/lib/endpoint-capability-gates.js.map +1 -0
- package/dist/lib/endpoint-client.d.ts +20 -0
- package/dist/lib/endpoint-client.d.ts.map +1 -0
- package/dist/lib/endpoint-client.js +42 -0
- package/dist/lib/endpoint-client.js.map +1 -0
- package/dist/lib/endpoint-errors.d.ts +11 -0
- package/dist/lib/endpoint-errors.d.ts.map +1 -0
- package/dist/lib/endpoint-errors.js +30 -0
- package/dist/lib/endpoint-errors.js.map +1 -0
- package/dist/lib/endpoint-goal.d.ts +19 -0
- package/dist/lib/endpoint-goal.d.ts.map +1 -0
- package/dist/lib/endpoint-goal.js +31 -0
- package/dist/lib/endpoint-goal.js.map +1 -0
- package/dist/lib/endpoint-inventory.d.ts +30 -0
- package/dist/lib/endpoint-inventory.d.ts.map +1 -0
- package/dist/lib/endpoint-inventory.js +79 -0
- package/dist/lib/endpoint-inventory.js.map +1 -0
- package/dist/lib/endpoint-references.d.ts +22 -0
- package/dist/lib/endpoint-references.d.ts.map +1 -0
- package/dist/lib/endpoint-references.js +44 -0
- package/dist/lib/endpoint-references.js.map +1 -0
- package/dist/lib/endpoint-scatter.d.ts +57 -0
- package/dist/lib/endpoint-scatter.d.ts.map +1 -0
- package/dist/lib/endpoint-scatter.js +75 -0
- package/dist/lib/endpoint-scatter.js.map +1 -0
- package/dist/lib/endpoint-selection.d.ts +35 -0
- package/dist/lib/endpoint-selection.d.ts.map +1 -0
- package/dist/lib/endpoint-selection.js +80 -0
- package/dist/lib/endpoint-selection.js.map +1 -0
- package/dist/lib/install-umask.d.ts +6 -0
- package/dist/lib/install-umask.d.ts.map +1 -0
- package/dist/lib/install-umask.js +15 -0
- package/dist/lib/install-umask.js.map +1 -0
- package/dist/lib/isolated-broker.d.ts.map +1 -1
- package/dist/lib/isolated-broker.js +9 -5
- package/dist/lib/isolated-broker.js.map +1 -1
- package/dist/lib/local-process-stop.d.ts.map +1 -1
- package/dist/lib/local-process-stop.js +7 -1
- package/dist/lib/local-process-stop.js.map +1 -1
- package/dist/lib/manager-proc.d.ts +11 -5
- package/dist/lib/manager-proc.d.ts.map +1 -1
- package/dist/lib/manager-proc.js +12 -17
- package/dist/lib/manager-proc.js.map +1 -1
- package/dist/lib/manifest/apply.d.ts +4 -1
- package/dist/lib/manifest/apply.d.ts.map +1 -1
- package/dist/lib/manifest/apply.js +1 -1
- package/dist/lib/manifest/apply.js.map +1 -1
- package/dist/lib/manifest/ledger.d.ts +3 -1
- package/dist/lib/manifest/ledger.d.ts.map +1 -1
- package/dist/lib/manifest/ledger.js +16 -3
- package/dist/lib/manifest/ledger.js.map +1 -1
- package/dist/lib/manifest/schema.d.ts +1 -117
- package/dist/lib/manifest/schema.d.ts.map +1 -1
- package/dist/lib/manifest/schema.js +1 -95
- package/dist/lib/manifest/schema.js.map +1 -1
- package/dist/lib/offline-recipient.d.ts +5 -0
- package/dist/lib/offline-recipient.d.ts.map +1 -0
- package/dist/lib/offline-recipient.js +7 -0
- package/dist/lib/offline-recipient.js.map +1 -0
- package/dist/lib/onboard.js +3 -3
- package/dist/lib/onboard.js.map +1 -1
- package/dist/lib/persona-files.d.ts +29 -0
- package/dist/lib/persona-files.d.ts.map +1 -0
- package/dist/lib/persona-files.js +154 -0
- package/dist/lib/persona-files.js.map +1 -0
- package/dist/lib/personas.d.ts +3 -0
- package/dist/lib/personas.d.ts.map +1 -1
- package/dist/lib/personas.js +14 -2
- package/dist/lib/personas.js.map +1 -1
- package/dist/lib/prompts.d.ts +16 -0
- package/dist/lib/prompts.d.ts.map +1 -0
- package/dist/lib/prompts.js +35 -0
- package/dist/lib/prompts.js.map +1 -0
- package/dist/lib/protected-records.d.ts +2 -0
- package/dist/lib/protected-records.d.ts.map +1 -0
- package/dist/lib/protected-records.js +3 -0
- package/dist/lib/protected-records.js.map +1 -0
- package/dist/lib/registry-errors.d.ts +4 -0
- package/dist/lib/registry-errors.d.ts.map +1 -0
- package/dist/lib/registry-errors.js +6 -0
- package/dist/lib/registry-errors.js.map +1 -0
- package/dist/lib/reset-space-plan.d.ts +36 -0
- package/dist/lib/reset-space-plan.d.ts.map +1 -0
- package/dist/lib/reset-space-plan.js +181 -0
- package/dist/lib/reset-space-plan.js.map +1 -0
- package/dist/lib/restore.d.ts +3 -1
- package/dist/lib/restore.d.ts.map +1 -1
- package/dist/lib/restore.js +38 -10
- package/dist/lib/restore.js.map +1 -1
- package/dist/lib/seat-resume.d.ts +4 -1
- package/dist/lib/seat-resume.d.ts.map +1 -1
- package/dist/lib/seat-resume.js +7 -4
- package/dist/lib/seat-resume.js.map +1 -1
- package/dist/lib/service-adapters.d.ts +32 -0
- package/dist/lib/service-adapters.d.ts.map +1 -0
- package/dist/lib/service-adapters.js +55 -0
- package/dist/lib/service-adapters.js.map +1 -0
- package/dist/lib/service-census.d.ts +73 -0
- package/dist/lib/service-census.d.ts.map +1 -0
- package/dist/lib/service-census.js +42 -0
- package/dist/lib/service-census.js.map +1 -0
- package/dist/lib/service-definitions.d.ts +49 -0
- package/dist/lib/service-definitions.d.ts.map +1 -0
- package/dist/lib/service-definitions.js +61 -0
- package/dist/lib/service-definitions.js.map +1 -0
- package/dist/lib/service-install-intent.d.ts +48 -0
- package/dist/lib/service-install-intent.d.ts.map +1 -0
- package/dist/lib/service-install-intent.js +95 -0
- package/dist/lib/service-install-intent.js.map +1 -0
- package/dist/lib/service-instances.d.ts +143 -0
- package/dist/lib/service-instances.d.ts.map +1 -0
- package/dist/lib/service-instances.js +193 -0
- package/dist/lib/service-instances.js.map +1 -0
- package/dist/lib/service-journal.d.ts +38 -0
- package/dist/lib/service-journal.d.ts.map +1 -0
- package/dist/lib/service-journal.js +210 -0
- package/dist/lib/service-journal.js.map +1 -0
- package/dist/lib/service-launchd-plan.d.ts +21 -0
- package/dist/lib/service-launchd-plan.d.ts.map +1 -0
- package/dist/lib/service-launchd-plan.js +69 -0
- package/dist/lib/service-launchd-plan.js.map +1 -0
- package/dist/lib/service-launchd-unit.d.ts +20 -0
- package/dist/lib/service-launchd-unit.d.ts.map +1 -0
- package/dist/lib/service-launchd-unit.js +66 -0
- package/dist/lib/service-launchd-unit.js.map +1 -0
- package/dist/lib/service-presets.d.ts +17 -0
- package/dist/lib/service-presets.d.ts.map +1 -0
- package/dist/lib/service-presets.js +138 -0
- package/dist/lib/service-presets.js.map +1 -0
- package/dist/lib/service-private-seed.d.ts +7 -0
- package/dist/lib/service-private-seed.d.ts.map +1 -0
- package/dist/lib/service-private-seed.js +64 -0
- package/dist/lib/service-private-seed.js.map +1 -0
- package/dist/lib/service-private-tree.d.ts +6 -0
- package/dist/lib/service-private-tree.d.ts.map +1 -0
- package/dist/lib/service-private-tree.js +100 -0
- package/dist/lib/service-private-tree.js.map +1 -0
- package/dist/lib/service-process.d.ts +121 -0
- package/dist/lib/service-process.d.ts.map +1 -0
- package/dist/lib/service-process.js +742 -0
- package/dist/lib/service-process.js.map +1 -0
- package/dist/lib/service-stopped-allocation.d.ts +6 -0
- package/dist/lib/service-stopped-allocation.d.ts.map +1 -0
- package/dist/lib/service-stopped-allocation.js +42 -0
- package/dist/lib/service-stopped-allocation.js.map +1 -0
- package/dist/lib/service-supervision.d.ts +59 -0
- package/dist/lib/service-supervision.d.ts.map +1 -0
- package/dist/lib/service-supervision.js +71 -0
- package/dist/lib/service-supervision.js.map +1 -0
- package/dist/lib/service-systemd-attempt-read.d.ts +40 -0
- package/dist/lib/service-systemd-attempt-read.d.ts.map +1 -0
- package/dist/lib/service-systemd-attempt-read.js +80 -0
- package/dist/lib/service-systemd-attempt-read.js.map +1 -0
- package/dist/lib/service-systemd-control.d.ts +38 -0
- package/dist/lib/service-systemd-control.d.ts.map +1 -0
- package/dist/lib/service-systemd-control.js +141 -0
- package/dist/lib/service-systemd-control.js.map +1 -0
- package/dist/lib/service-systemd-files.d.ts +8 -0
- package/dist/lib/service-systemd-files.d.ts.map +1 -0
- package/dist/lib/service-systemd-files.js +63 -0
- package/dist/lib/service-systemd-files.js.map +1 -0
- package/dist/lib/service-systemd-install.d.ts +17 -0
- package/dist/lib/service-systemd-install.d.ts.map +1 -0
- package/dist/lib/service-systemd-install.js +146 -0
- package/dist/lib/service-systemd-install.js.map +1 -0
- package/dist/lib/service-systemd-plan.d.ts +28 -0
- package/dist/lib/service-systemd-plan.d.ts.map +1 -0
- package/dist/lib/service-systemd-plan.js +56 -0
- package/dist/lib/service-systemd-plan.js.map +1 -0
- package/dist/lib/service-systemd-reseed.d.ts +16 -0
- package/dist/lib/service-systemd-reseed.d.ts.map +1 -0
- package/dist/lib/service-systemd-reseed.js +106 -0
- package/dist/lib/service-systemd-reseed.js.map +1 -0
- package/dist/lib/service-systemd-uninstall-plan.d.ts +29 -0
- package/dist/lib/service-systemd-uninstall-plan.d.ts.map +1 -0
- package/dist/lib/service-systemd-uninstall-plan.js +56 -0
- package/dist/lib/service-systemd-uninstall-plan.js.map +1 -0
- package/dist/lib/service-systemd-uninstall.d.ts +17 -0
- package/dist/lib/service-systemd-uninstall.d.ts.map +1 -0
- package/dist/lib/service-systemd-uninstall.js +106 -0
- package/dist/lib/service-systemd-uninstall.js.map +1 -0
- package/dist/lib/service-systemd-unit.d.ts +28 -0
- package/dist/lib/service-systemd-unit.d.ts.map +1 -0
- package/dist/lib/service-systemd-unit.js +73 -0
- package/dist/lib/service-systemd-unit.js.map +1 -0
- package/dist/lib/service-systemd.d.ts +49 -0
- package/dist/lib/service-systemd.d.ts.map +1 -0
- package/dist/lib/service-systemd.js +134 -0
- package/dist/lib/service-systemd.js.map +1 -0
- package/dist/lib/service-uninstall-intent.d.ts +38 -0
- package/dist/lib/service-uninstall-intent.d.ts.map +1 -0
- package/dist/lib/service-uninstall-intent.js +74 -0
- package/dist/lib/service-uninstall-intent.js.map +1 -0
- package/dist/lib/service-unit-action.d.ts +24 -0
- package/dist/lib/service-unit-action.d.ts.map +1 -0
- package/dist/lib/service-unit-action.js +61 -0
- package/dist/lib/service-unit-action.js.map +1 -0
- package/dist/lib/setup-log.d.ts +5 -4
- package/dist/lib/setup-log.d.ts.map +1 -1
- package/dist/lib/setup-log.js +18 -9
- package/dist/lib/setup-log.js.map +1 -1
- package/dist/lib/space-schema-inspection.d.ts +73 -0
- package/dist/lib/space-schema-inspection.d.ts.map +1 -0
- package/dist/lib/space-schema-inspection.js +118 -0
- package/dist/lib/space-schema-inspection.js.map +1 -0
- package/dist/lib/space-schema-report.d.ts +82 -0
- package/dist/lib/space-schema-report.d.ts.map +1 -0
- package/dist/lib/space-schema-report.js +109 -0
- package/dist/lib/space-schema-report.js.map +1 -0
- package/dist/lib/spawn-defaults.d.ts +14 -0
- package/dist/lib/spawn-defaults.d.ts.map +1 -0
- package/dist/lib/spawn-defaults.js +20 -0
- package/dist/lib/spawn-defaults.js.map +1 -0
- package/dist/lib/stack-journal.d.ts +92 -0
- package/dist/lib/stack-journal.d.ts.map +1 -0
- package/dist/lib/stack-journal.js +199 -0
- package/dist/lib/stack-journal.js.map +1 -0
- package/dist/lib/stack-resume.d.ts +35 -0
- package/dist/lib/stack-resume.d.ts.map +1 -0
- package/dist/lib/stack-resume.js +123 -0
- package/dist/lib/stack-resume.js.map +1 -0
- package/dist/lib/status.d.ts +19 -20
- package/dist/lib/status.d.ts.map +1 -1
- package/dist/lib/status.js +41 -40
- package/dist/lib/status.js.map +1 -1
- package/dist/lib/steps.d.ts.map +1 -1
- package/dist/lib/steps.js +3 -2
- package/dist/lib/steps.js.map +1 -1
- package/dist/lib/systemd-supervision.d.ts +11 -4
- package/dist/lib/systemd-supervision.d.ts.map +1 -1
- package/dist/lib/systemd-supervision.js +19 -8
- package/dist/lib/systemd-supervision.js.map +1 -1
- package/dist/lib/team-additive-attempt.d.ts +286 -0
- package/dist/lib/team-additive-attempt.d.ts.map +1 -0
- package/dist/lib/team-additive-attempt.js +387 -0
- package/dist/lib/team-additive-attempt.js.map +1 -0
- package/dist/lib/team-additive-native.d.ts +17 -0
- package/dist/lib/team-additive-native.d.ts.map +1 -0
- package/dist/lib/team-additive-native.js +29 -0
- package/dist/lib/team-additive-native.js.map +1 -0
- package/dist/lib/team-agent-removal.d.ts +104 -0
- package/dist/lib/team-agent-removal.d.ts.map +1 -0
- package/dist/lib/team-agent-removal.js +121 -0
- package/dist/lib/team-agent-removal.js.map +1 -0
- package/dist/lib/team-channel-removal.d.ts +220 -0
- package/dist/lib/team-channel-removal.d.ts.map +1 -0
- package/dist/lib/team-channel-removal.js +258 -0
- package/dist/lib/team-channel-removal.js.map +1 -0
- package/dist/lib/team-deploy-inspection.d.ts +59 -0
- package/dist/lib/team-deploy-inspection.d.ts.map +1 -0
- package/dist/lib/team-deploy-inspection.js +177 -0
- package/dist/lib/team-deploy-inspection.js.map +1 -0
- package/dist/lib/team-fresh.d.ts +73 -0
- package/dist/lib/team-fresh.d.ts.map +1 -0
- package/dist/lib/team-fresh.js +207 -0
- package/dist/lib/team-fresh.js.map +1 -0
- package/dist/lib/team-removal-reconcile.d.ts +118 -0
- package/dist/lib/team-removal-reconcile.d.ts.map +1 -0
- package/dist/lib/team-removal-reconcile.js +90 -0
- package/dist/lib/team-removal-reconcile.js.map +1 -0
- package/dist/lib/team-removal-record.d.ts +7 -0
- package/dist/lib/team-removal-record.d.ts.map +1 -0
- package/dist/lib/team-removal-record.js +46 -0
- package/dist/lib/team-removal-record.js.map +1 -0
- package/dist/lib/team-retained.d.ts +33 -0
- package/dist/lib/team-retained.d.ts.map +1 -0
- package/dist/lib/team-retained.js +55 -0
- package/dist/lib/team-retained.js.map +1 -0
- package/dist/lib/theme.d.ts.map +1 -1
- package/dist/lib/theme.js +9 -8
- package/dist/lib/theme.js.map +1 -1
- package/dist/lib/transient.d.ts +14 -9
- package/dist/lib/transient.d.ts.map +1 -1
- package/dist/lib/transient.js +25 -18
- package/dist/lib/transient.js.map +1 -1
- package/dist/lib/up-report.d.ts +1 -0
- package/dist/lib/up-report.d.ts.map +1 -1
- package/dist/lib/up-report.js +2 -1
- package/dist/lib/up-report.js.map +1 -1
- package/dist/lib/version.d.ts +8 -2
- package/dist/lib/version.d.ts.map +1 -1
- package/dist/lib/version.js +16 -9
- package/dist/lib/version.js.map +1 -1
- package/dist/seed/paths.d.ts +1 -1
- package/dist/seed/paths.js +1 -1
- package/dist/seed/reconcile.d.ts.map +1 -1
- package/dist/seed/reconcile.js +19 -3
- package/dist/seed/reconcile.js.map +1 -1
- package/dist/ui.d.ts +6 -0
- package/dist/ui.d.ts.map +1 -1
- package/dist/ui.js +12 -1
- package/dist/ui.js.map +1 -1
- package/dist/watch-data.d.ts +15 -0
- package/dist/watch-data.d.ts.map +1 -0
- package/dist/watch-data.js +66 -0
- package/dist/watch-data.js.map +1 -0
- package/dist/watch-json.d.ts +5 -0
- package/dist/watch-json.d.ts.map +1 -0
- package/dist/watch-json.js +131 -0
- package/dist/watch-json.js.map +1 -0
- package/dist/watch-view.d.ts +8 -0
- package/dist/watch-view.d.ts.map +1 -0
- package/dist/watch-view.js +65 -0
- package/dist/watch-view.js.map +1 -0
- package/package.json +8 -5
- package/dist/commands/service.d.ts +0 -17
- package/dist/commands/service.d.ts.map +0 -1
- package/dist/commands/service.js +0 -589
- package/dist/commands/service.js.map +0 -1
package/dist/commands/down.js
CHANGED
|
@@ -1,15 +1,23 @@
|
|
|
1
|
-
import { readFileSync, rmSync, statSync } from "node:fs";
|
|
1
|
+
import { lstatSync, readFileSync, rmSync, statSync } from "node:fs";
|
|
2
|
+
import { homedir } from "node:os";
|
|
2
3
|
import { join, resolve as resolvePath } from "node:path";
|
|
3
4
|
import {} from "@cotal-ai/core";
|
|
4
|
-
import { abortMaintenanceCut, acquireMaintenanceLock, assertSingleSpaceBroker, authDir, beginMaintenanceCut, clearPreservationCommitIntent, clearPreservationPrepareIntent, completeMaintenanceCut, loadMeshes, meshesForRoot, localProcessPath, localProcessPathCandidates, readMaintenanceJournal, readMaintenanceResumeDocument, readPreservationCommitIntent, readPreservationPrepareIntent, readStoreIdentity, recordPreservationManagerCommit, releaseMaintenanceLock, removeMeshesByRoot,
|
|
5
|
+
import { CommandFailure, localRecordName, presentationOf, abortMaintenanceCut, acquireMaintenanceLock, assertSingleSpaceBroker, authDir, beginMaintenanceCut, clearPreservationCommitIntent, clearPreservationPrepareIntent, completeMaintenanceCut, loadMeshes, meshesForRoot, localProcessPath, localProcessPathCandidates, canonicalRoot, brokerAddressForDisplay, findMesh, localMeshesForRoot, writeResult, readMaintenanceJournal, 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
6
|
import { jetstreamManager } from "@nats-io/jetstream";
|
|
6
|
-
import { DEV_OWNER, dialerFor, isReachable, LEASE_TTL_MS, MANAGER_LEASE_KEY, MANAGER_LEASE_TTL_MS, deliveryBucket, managerBucket, presenceBucket, parsePrincipalKey, principalKey, standaloneConnectOpts, } from "@cotal-ai/core";
|
|
7
|
-
import {
|
|
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
|
+
import { localProcessSurface } from "../ext-loader.js";
|
|
8
9
|
import { c } from "../ui.js";
|
|
9
10
|
import { cotalRoot } from "../lib/paths.js";
|
|
10
11
|
import { parsePid, probeLiveness, readPidfile } from "@cotal-ai/workspace";
|
|
11
12
|
import { resolveRuntimeSpace } from "../lib/status.js";
|
|
12
13
|
import { downManifest } from "./down-manifest.js";
|
|
14
|
+
import { listLedgerFiles } from "../lib/manifest/ledger.js";
|
|
15
|
+
import { freshTeamAttemptSettled, listFreshTeamAttempts, listFreshTeamSummaries } from "../lib/team-fresh.js";
|
|
16
|
+
import { additiveTeamRecordedState, listAdditiveTeamAttempts, retainedAdditiveTeamAttempts } from "../lib/team-additive-attempt.js";
|
|
17
|
+
import { service, serviceComplete, validateServiceArguments } from "./service-registry.js";
|
|
18
|
+
import { stopNamedServiceSet } from "./service-set-stop.js";
|
|
19
|
+
import { readLocalServiceCensus } from "../lib/service-census.js";
|
|
20
|
+
import { assertBareDownServicesVerified, bareDownServicesView, planBareDownServices, stopBareDownServices } from "./down-services.js";
|
|
13
21
|
import { askManager, resolveControlTarget } from "../lib/control.js";
|
|
14
22
|
import { connectOrExit, userViewAuthOrExit } from "../lib/connect.js";
|
|
15
23
|
import { waitForEndpointUnreachable } from "../lib/endpoint-cut.js";
|
|
@@ -17,124 +25,277 @@ import { captureSeatCheckpoint } from "../lib/seat-capture.js";
|
|
|
17
25
|
import { processRecorded, stopLocalProcess } from "../lib/local-process-stop.js";
|
|
18
26
|
import { stopManager } from "../lib/manager-proc.js";
|
|
19
27
|
import { removeDeliveryCredentials, stopDelivery } from "../lib/delivery-proc.js";
|
|
28
|
+
import { controllerStackRecorded, stackDown, validateStackDownArguments } from "./stack-down.js";
|
|
20
29
|
/** Complete selective component names without importing installed packages. */
|
|
21
30
|
export function downComplete(argv) {
|
|
22
31
|
if (argv.some((word) => word === "-f" || word === "--file" || word === "--run"))
|
|
23
32
|
return { items: [], directive: "nofiles" };
|
|
24
33
|
if ((argv[argv.length - 1] ?? "").startsWith("-"))
|
|
25
34
|
return { items: [], directive: "nofiles" };
|
|
26
|
-
|
|
27
|
-
return {
|
|
28
|
-
items: extensionNames("local-process").filter((name) => !used.has(name)).map((value) => ({ value })),
|
|
29
|
-
directive: "nofiles",
|
|
30
|
-
};
|
|
35
|
+
return serviceComplete(["stop", ...(argv.length ? argv : [""])]);
|
|
31
36
|
}
|
|
32
|
-
|
|
33
|
-
|
|
37
|
+
function namedStopArguments(args) {
|
|
38
|
+
return { ...args, positionals: ["stop", args.positionals[0]] };
|
|
39
|
+
}
|
|
40
|
+
/** Named stops use only the owned-service controller. Multiple definitions require complete
|
|
41
|
+
* set selection, reservation and impact preflight. Legacy bare-stack integration stays separate. */
|
|
42
|
+
export function validateDownArguments(args) {
|
|
43
|
+
presentationOf(args.values);
|
|
44
|
+
if (args.positionals.length) {
|
|
45
|
+
for (const name of args.positionals)
|
|
46
|
+
localRecordName(name);
|
|
47
|
+
if (args.values["with-agents"] !== undefined)
|
|
48
|
+
throw new CommandFailure("refused", "USAGE_INVALID", "named down does not accept --with-agents; no flag was dropped", { remedy: "use cotal service stop <manager-name> --instance <full-id> --with-agents for the exact owned manager and its native impact review" });
|
|
49
|
+
if (args.values.instance !== undefined && args.positionals.length !== 1)
|
|
50
|
+
throw new CommandFailure("refused", "USAGE_INVALID", "--instance qualifies one service name, never a multi-service set");
|
|
51
|
+
const allowed = new Set(["space", "instance", "yes", "dry-run", "json", "plain"]);
|
|
52
|
+
if (Object.keys(args.values).some((name) => !allowed.has(name)))
|
|
53
|
+
throw new CommandFailure("refused", "USAGE_INVALID", "named down accepts only space, instance, confirmation, preview and presentation flags; no whole-stack or manifest option was ignored");
|
|
54
|
+
if (new Set(args.positionals).size !== args.positionals.length)
|
|
55
|
+
throw new CommandFailure("refused", "USAGE_INVALID", "name each service once; duplicate targets were not silently collapsed");
|
|
56
|
+
for (const name of args.positionals)
|
|
57
|
+
validateServiceArguments({ ...args, positionals: ["stop", name] });
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
if (args.values.instance !== undefined)
|
|
61
|
+
throw new CommandFailure("refused", "USAGE_INVALID", "--instance needs one explicit service definition name");
|
|
62
|
+
if (controllerStackRecorded(cotalRoot()))
|
|
63
|
+
return validateStackDownArguments(cotalRoot(), args.values);
|
|
64
|
+
if (args.values["dry-run"] === true && args.values.yes === true)
|
|
65
|
+
throw new CommandFailure("refused", "USAGE_INVALID", "--yes acknowledges a guarded apply, not a read-only stack preview");
|
|
66
|
+
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)
|
|
67
|
+
return;
|
|
68
|
+
if (args.values.yes !== undefined)
|
|
69
|
+
throw new CommandFailure("refused", "UNSUPPORTED", "--yes applies only to a controller stack, and this root has none; a bare stop here needs no --yes, and nothing was stopped", { remedy: "run `cotal down` from this root without --yes" });
|
|
70
|
+
if (args.values.json !== undefined || args.values.plain !== undefined)
|
|
71
|
+
throw new CommandFailure("refused", "UNSUPPORTED", "--json and --plain apply only to a controller stack or a --dry-run preview; a bare stop here prints its own lines, and nothing was stopped", { remedy: "run `cotal down` from this root without --json or --plain; `cotal down --dry-run --json` reads this root's stack" });
|
|
72
|
+
}
|
|
73
|
+
/** A bare stack preview is a local record census, never an effect plan or stop authority. */
|
|
74
|
+
function previewWholeStack(args) {
|
|
75
|
+
const root = canonicalRoot(cotalRoot());
|
|
76
|
+
const selectedSpace = args.values.space;
|
|
77
|
+
const target = { root, ...(selectedSpace ? { space: selectedSpace } : {}) };
|
|
78
|
+
if (root === canonicalRoot(homedir()))
|
|
79
|
+
throw new CommandFailure("refused", "CONFLICT", "the machine home is not an isolated project root for a whole-stack preview", { target });
|
|
80
|
+
let mesh;
|
|
81
|
+
let maintenance;
|
|
82
|
+
let components;
|
|
83
|
+
let services, serviceStops;
|
|
84
|
+
let additiveRecords, additiveAttempts;
|
|
85
|
+
let bootAttempts, bootSummaries;
|
|
86
|
+
let otherBrokerRegistrations;
|
|
87
|
+
// A root with no control directory, or with no stack registered at it, holds no stack. That is a
|
|
88
|
+
// plain miss, not records that could not be read.
|
|
89
|
+
const noStack = () => new CommandFailure("refused", "TARGET_NOT_FOUND", "there is no stack at this folder's root, so there is nothing to preview", { target, remedy: "run `cotal down --dry-run` from the folder where `cotal up` started the stack" });
|
|
90
|
+
try {
|
|
91
|
+
try {
|
|
92
|
+
lstatSync(join(root, ".cotal"));
|
|
93
|
+
}
|
|
94
|
+
catch (error) {
|
|
95
|
+
if (error.code === "ENOENT")
|
|
96
|
+
throw noStack();
|
|
97
|
+
throw error;
|
|
98
|
+
}
|
|
99
|
+
if (!realDirNoSymlink(root, ".cotal"))
|
|
100
|
+
throw new Error("missing project control directory");
|
|
101
|
+
const local = localMeshesForRoot(root), sole = local[0];
|
|
102
|
+
if (!local.length)
|
|
103
|
+
throw noStack();
|
|
104
|
+
if (local.length !== 1 || sole?.origin !== "up")
|
|
105
|
+
throw new Error("no unique locally started stack at this root");
|
|
106
|
+
const candidate = selectedSpace ? findMesh(selectedSpace) : sole;
|
|
107
|
+
if (!candidate || candidate.origin !== "up" || candidate.space !== sole.space || canonicalRoot(candidate.root) !== root)
|
|
108
|
+
throw new Error("space does not belong to the selected root");
|
|
109
|
+
mesh = candidate;
|
|
110
|
+
assertSingleSpaceBroker(authDir(root), "down preview");
|
|
111
|
+
otherBrokerRegistrations = loadMeshes().filter((row) => row.space !== mesh.space && row.server === mesh.server)
|
|
112
|
+
.map((row) => ({ space: row.space, root: row.root, origin: row.origin ?? "not recorded" }));
|
|
113
|
+
maintenance = readMaintenanceJournal(root);
|
|
114
|
+
const context = { root, space: mesh.space };
|
|
115
|
+
components = localProcessSurface().map((component) => {
|
|
116
|
+
const pidfile = localProcessPath(component.pidFile, context);
|
|
117
|
+
const state = pidfileState(pidfile);
|
|
118
|
+
return { name: component.name, label: component.label, pidfile, recorded: processRecorded(component, context), liveness: state.liveness, pid: state.pid ?? null, note: state.note ?? null };
|
|
119
|
+
});
|
|
120
|
+
services = readLocalServiceCensus(mesh.space);
|
|
121
|
+
serviceStops = planBareDownServices(mesh.space);
|
|
122
|
+
additiveRecords = listLedgerFiles(root, { requireReadable: true });
|
|
123
|
+
additiveAttempts = listAdditiveTeamAttempts(root);
|
|
124
|
+
bootAttempts = listFreshTeamAttempts(root);
|
|
125
|
+
bootSummaries = listFreshTeamSummaries(root);
|
|
126
|
+
}
|
|
127
|
+
catch (error) {
|
|
128
|
+
if (error instanceof CommandFailure)
|
|
129
|
+
throw error;
|
|
130
|
+
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 });
|
|
131
|
+
}
|
|
132
|
+
const byBootId = new Map(bootSummaries.valid.map((summary) => [summary.deploymentId, summary]));
|
|
133
|
+
const unsettledBootAttempts = bootAttempts.valid.filter((attempt) => !freshTeamAttemptSettled(attempt, byBootId.get(attempt.deploymentId)));
|
|
134
|
+
const result = { kind: "whole-stack-local-preview", space: mesh.space, root, recordedBroker: brokerAddressForDisplay(mesh.server) ?? null,
|
|
135
|
+
maintenance: maintenance?.state ?? "none-recorded", withAgentsRequested: args.values["with-agents"] === true,
|
|
136
|
+
components, ...services, serviceStops, otherBrokerRegistrations,
|
|
137
|
+
additiveLedgers: additiveRecords.valid.map(({ ledger }) => ({ deploymentId: ledger.runId, space: ledger.space, agents: ledger.created.agents.length, channels: ledger.created.channels.length })),
|
|
138
|
+
unreadableAdditiveLedgers: additiveRecords.refused.map(({ path }) => path),
|
|
139
|
+
retainedAdditiveAttempts: additiveAttempts.valid.map((attempt) => ({ deploymentId: attempt.deploymentId, space: attempt.space, server: brokerAddressForDisplay(attempt.server) ?? "not displayable", createdAt: attempt.createdAt, recordedState: additiveTeamRecordedState(attempt, additiveAttempts) })),
|
|
140
|
+
unreadableAdditiveAttempts: additiveAttempts.refused.map(({ path }) => path),
|
|
141
|
+
unsettledBootAttempts: unsettledBootAttempts.map((attempt) => ({ deploymentId: attempt.deploymentId, space: attempt.space, server: brokerAddressForDisplay(attempt.server) ?? "not displayable", createdAt: attempt.createdAt })),
|
|
142
|
+
unreadableBootRecords: [...bootAttempts.refused, ...bootSummaries.refused].map(({ path }) => path),
|
|
143
|
+
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",
|
|
144
|
+
dryRun: true, effectAttempted: false, reserved: false };
|
|
145
|
+
writeResult(presentationOf(args.values), { command: "down", target: { root, space: mesh.space }, result,
|
|
146
|
+
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: [
|
|
147
|
+
{ 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" }] }] },
|
|
148
|
+
{ 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."] }] },
|
|
149
|
+
{ title: "Recorded additive deployments", blocks: [data.additiveLedgers.length ? { kind: "table", columns: [{ key: "id", label: "Deployment" }, { key: "space", label: "Recorded space" }, { key: "agents", label: "Agent rows" }, { key: "channels", label: "Channel rows" }], rows: data.additiveLedgers.slice(0, 100).map((row) => ({ id: row.deploymentId, space: row.space, agents: String(row.agents), channels: String(row.channels) })) } : { kind: "lines", lines: ["No readable additive ledgers under this project root."] }, { kind: "lines", lines: [...(data.additiveLedgers.length > 100 ? ["Additional additive ledgers are in JSON."] : []), ...data.unreadableAdditiveLedgers.slice(0, 100).map((path) => `Unreadable ledger: ${path}`), ...(data.unreadableAdditiveLedgers.length > 100 ? ["Additional unreadable paths are in JSON."] : []), "An additive ledger is not whole-stack ownership. A recorded or unreadable one blocks the retained bare apply; this preview changes nothing."] }] },
|
|
150
|
+
{ title: "Retained additive deployments", blocks: [data.retainedAdditiveAttempts.length ? { kind: "table", columns: [{ key: "id", label: "Deployment" }, { key: "space", label: "Space" }, { key: "state", label: "Recorded state" }, { key: "time", label: "Intent recorded" }], rows: data.retainedAdditiveAttempts.slice(0, 100).map((attempt) => ({ id: attempt.deploymentId, space: attempt.space, state: attempt.recordedState, time: attempt.createdAt })) } : { kind: "lines", lines: ["No readable additive attempts under this root."] }, { kind: "lines", lines: [...data.unreadableAdditiveAttempts.slice(0, 100).map((path) => `Unreadable additive attempt: ${path}`), ...(data.retainedAdditiveAttempts.length > 100 || data.unreadableAdditiveAttempts.length > 100 ? ["Additional attempts or paths are in JSON."] : []), "Unsettled or unremoved additive deployments block the legacy bare stop. A full matched static agent-retirement receipt releases only its original deployment's blocker; all other ownership and process guards remain."] }] },
|
|
151
|
+
{ title: "Fresh boot attempts", blocks: [data.unsettledBootAttempts.length ? { kind: "table", columns: [{ key: "deploymentId", label: "Deployment" }, { key: "space", label: "Space" }, { key: "server", label: "Recorded broker" }, { key: "createdAt", label: "Intent recorded" }], rows: data.unsettledBootAttempts.slice(0, 100) } : { kind: "lines", lines: ["No unsettled readable fresh boot attempts under this root."] }, { kind: "lines", lines: [...data.unreadableBootRecords.slice(0, 100).map((path) => `Unreadable fresh record: ${path}`), ...(data.unsettledBootAttempts.length > 100 || data.unreadableBootRecords.length > 100 ? ["Additional attempts or unreadable paths are in JSON."] : []), "An unsettled fresh attempt or unreadable record blocks the retained bare apply; a missing summary does not prove the broker never started."] }] },
|
|
152
|
+
{ 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."] }] },
|
|
153
|
+
{ 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."] }] : [])] },
|
|
154
|
+
{ 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."] }] },
|
|
155
|
+
...(data.serviceStops.length ? bareDownServicesView(data.space, data.serviceStops).sections : [{ title: "Services bare down stops first", blocks: [{ kind: "lines", lines: ["No saved service instance in this space, so bare down stops no service first."] }] }]),
|
|
156
|
+
{ 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."] }] },
|
|
157
|
+
{ 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."] }] },
|
|
158
|
+
] }));
|
|
159
|
+
}
|
|
160
|
+
/** Keep the retained pidfile sweep from crossing an exact recorded broker-sharing boundary, and
|
|
161
|
+
* return the space's service instances it stops first, each one verified. This is not a complete
|
|
162
|
+
* live ownership or agent-impact proof. */
|
|
163
|
+
function guardLegacyBareDown() {
|
|
164
|
+
const root = canonicalRoot(cotalRoot());
|
|
165
|
+
const target = { root };
|
|
166
|
+
if (root === canonicalRoot(homedir()))
|
|
167
|
+
throw new CommandFailure("refused", "CONFLICT", "the machine home is not an isolated whole-stack stop root; no process was signalled", { target });
|
|
168
|
+
let mesh;
|
|
169
|
+
try {
|
|
170
|
+
if (!realDirNoSymlink(root, ".cotal"))
|
|
171
|
+
throw new Error("missing project control directory");
|
|
172
|
+
// A root that hosts several spaces refuses before the registration lookup, naming them.
|
|
173
|
+
try {
|
|
174
|
+
assertSingleSpaceBroker(authDir(root), "bare down");
|
|
175
|
+
}
|
|
176
|
+
catch (error) {
|
|
177
|
+
throw new CommandFailure("refused", "CONFLICT", error.message, { target });
|
|
178
|
+
}
|
|
179
|
+
const local = localMeshesForRoot(root), sole = local[0];
|
|
180
|
+
if (local.length !== 1 || sole?.origin !== "up")
|
|
181
|
+
throw new Error("no unique locally started stack at this root");
|
|
182
|
+
mesh = sole;
|
|
183
|
+
}
|
|
184
|
+
catch (error) {
|
|
185
|
+
if (error instanceof CommandFailure)
|
|
186
|
+
throw error;
|
|
187
|
+
throw 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 });
|
|
188
|
+
}
|
|
189
|
+
const scoped = { root, space: mesh.space };
|
|
190
|
+
const maintenance = readMaintenanceJournal(root);
|
|
191
|
+
// A validated active restore is complete, so its retained journal does not fence ordinary stop.
|
|
192
|
+
// Pending transitions and a journal naming another space still cannot authorize this sweep.
|
|
193
|
+
if (maintenance && (maintenance.state !== "active" || maintenance.space !== mesh.space))
|
|
194
|
+
throw new CommandFailure("refused", "LIFECYCLE_BLOCKED", "this stack retains a maintenance transition; ordinary bare down did not bypass it", { target: { ...scoped, state: maintenance.state } });
|
|
195
|
+
let ledgers;
|
|
196
|
+
try {
|
|
197
|
+
ledgers = listLedgerFiles(root, { requireReadable: true });
|
|
198
|
+
}
|
|
199
|
+
catch {
|
|
200
|
+
throw new CommandFailure("refused", "TARGET_UNAVAILABLE", "the root's additive ledger directory could not be inspected; bare down did not infer that it owns every resource", { target: scoped });
|
|
201
|
+
}
|
|
202
|
+
if (ledgers.valid.length || ledgers.refused.length)
|
|
203
|
+
throw new CommandFailure("refused", "LIFECYCLE_BLOCKED", "additive ownership ledgers or unreadable ledger records remain under this root; bare down did not adopt or stop their resources", { target: { ...scoped, deploymentIds: ledgers.valid.map(({ ledger }) => ledger.runId), unreadable: ledgers.refused.map(({ path }) => path) }, remedy: "finish each additive deployment's own lifecycle before a guarded whole-stack stop" });
|
|
204
|
+
let additiveAttempts;
|
|
205
|
+
try {
|
|
206
|
+
additiveAttempts = listAdditiveTeamAttempts(root);
|
|
207
|
+
}
|
|
208
|
+
catch {
|
|
209
|
+
throw new CommandFailure("refused", "TARGET_UNAVAILABLE", "the additive attempt inventory could not be read; bare down did not infer an empty resource set", { target: scoped });
|
|
210
|
+
}
|
|
211
|
+
if (retainedAdditiveTeamAttempts(additiveAttempts).length || additiveAttempts.refused.length)
|
|
212
|
+
throw new CommandFailure("refused", "LIFECYCLE_BLOCKED", "an additive attempt or returned additive deployment remains under this root; legacy bare down did not adopt its resources", { target: { ...scoped, deploymentIds: retainedAdditiveTeamAttempts(additiveAttempts).map((attempt) => attempt.deploymentId), unreadable: additiveAttempts.refused.map(({ path }) => path) } });
|
|
213
|
+
let attempts, summaries;
|
|
214
|
+
try {
|
|
215
|
+
attempts = listFreshTeamAttempts(root);
|
|
216
|
+
summaries = listFreshTeamSummaries(root);
|
|
217
|
+
}
|
|
218
|
+
catch {
|
|
219
|
+
throw new CommandFailure("refused", "TARGET_UNAVAILABLE", "fresh boot attempt or summary records could not be read; bare down did not infer stop authority", { target: scoped });
|
|
220
|
+
}
|
|
221
|
+
const returned = new Map(summaries.valid.map((summary) => [summary.deploymentId, summary]));
|
|
222
|
+
const unsettled = attempts.valid.filter((attempt) => !freshTeamAttemptSettled(attempt, returned.get(attempt.deploymentId)));
|
|
223
|
+
if (unsettled.length || attempts.refused.length || summaries.refused.length)
|
|
224
|
+
throw new CommandFailure("refused", "LIFECYCLE_BLOCKED", "a fresh boot attempt is unsettled or a boot record unreadable; legacy bare down did not stop a process whose original launch outcome is unknown", { target: { ...scoped, unsettledIds: unsettled.map((row) => row.deploymentId), unreadable: [...attempts.refused, ...summaries.refused].map(({ path }) => path) }, remedy: "inspect the original boot and process custody before any stop; the pidfile sweep is not recovery" });
|
|
225
|
+
const other = loadMeshes().filter((row) => row.space !== mesh.space && row.server === mesh.server);
|
|
226
|
+
if (other.length)
|
|
227
|
+
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" });
|
|
228
|
+
const services = planBareDownServices(mesh.space);
|
|
229
|
+
assertBareDownServicesVerified(mesh.space, services);
|
|
230
|
+
return { space: mesh.space, services };
|
|
231
|
+
}
|
|
232
|
+
/** One named service is a thin native-controller alias. The retained bare-stack and manifest
|
|
233
|
+
* paths below have not yet been replaced by the approved whole-stack controller. */
|
|
34
234
|
export async function down(args) {
|
|
235
|
+
validateDownArguments(args);
|
|
236
|
+
if (args.positionals.length > 1)
|
|
237
|
+
return stopNamedServiceSet(args);
|
|
238
|
+
if (args.positionals.length)
|
|
239
|
+
return service(namedStopArguments(args), "down");
|
|
240
|
+
// A root whose stack the service controller owns stops only through its recorded members.
|
|
241
|
+
if (controllerStackRecorded(cotalRoot()))
|
|
242
|
+
return stackDown(cotalRoot(), args.values);
|
|
35
243
|
const values = args.values;
|
|
36
|
-
|
|
244
|
+
if (values["dry-run"] && !values.file && !values.run && !values["preserve-state"] && !values["store-dir"] && !values["session-store"]?.length)
|
|
245
|
+
return previewWholeStack(args);
|
|
37
246
|
if (values["preserve-state"] && values["with-agents"])
|
|
38
|
-
throw new
|
|
39
|
-
if (values["with-agents"] && (
|
|
40
|
-
throw new
|
|
247
|
+
throw new CommandFailure("refused", "USAGE_INVALID", "--preserve-state cannot be combined with --with-agents");
|
|
248
|
+
if (values["with-agents"] && (values.file || values.run || values.space))
|
|
249
|
+
throw new CommandFailure("refused", "USAGE_INVALID", "--with-agents is bare-whole-stack only and cannot be combined with components, --space, --file, or --run");
|
|
41
250
|
if (values["preserve-state"]) {
|
|
42
|
-
if (
|
|
43
|
-
throw new
|
|
251
|
+
if (values.file || values.run || values["dry-run"] || values.space)
|
|
252
|
+
throw new CommandFailure("refused", "USAGE_INVALID", "--preserve-state is bare-whole-stack only and cannot be combined with components, --space, --file, --run, or --dry-run");
|
|
44
253
|
assertSingleSpaceBroker(authDir(cotalRoot()), "cotal down");
|
|
45
254
|
await preserveStateDown(values["store-dir"], assertSessionStores(values["session-store"] ?? []));
|
|
46
255
|
return;
|
|
47
256
|
}
|
|
48
257
|
if (values["store-dir"])
|
|
49
|
-
throw new
|
|
258
|
+
throw new CommandFailure("refused", "USAGE_INVALID", "--store-dir is only valid with down --preserve-state");
|
|
50
259
|
if (values["session-store"]?.length)
|
|
51
|
-
throw new
|
|
52
|
-
if ((values.file || values.run) &&
|
|
53
|
-
throw new
|
|
260
|
+
throw new CommandFailure("refused", "USAGE_INVALID", "--session-store is only valid with down --preserve-state");
|
|
261
|
+
if ((values.file || values.run) && values.space) {
|
|
262
|
+
throw new CommandFailure("refused", "USAGE_INVALID", "component names and --space cannot be combined with --file or --run");
|
|
54
263
|
}
|
|
55
264
|
if (values.file || values.run) {
|
|
56
265
|
await downManifest(values.file ?? "<run>", { run: values.run, dryRun: Boolean(values["dry-run"]) });
|
|
57
266
|
return;
|
|
58
267
|
}
|
|
59
|
-
if (values.space
|
|
60
|
-
throw new
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
268
|
+
if (values.space)
|
|
269
|
+
throw new CommandFailure("refused", "USAGE_INVALID", "a bare stop takes no --space: `cotal down` stops the stack recorded at this folder's root", {
|
|
270
|
+
target: { root: cotalRoot(), space: values.space },
|
|
271
|
+
remedy: "run `cotal down` without --space from the stack's root; to stop one saved service, run `cotal service stop <service-name> --space <space>`",
|
|
272
|
+
});
|
|
273
|
+
const guarded = guardLegacyBareDown();
|
|
274
|
+
// Every dry run returned or was refused above, so from here on this is the whole-stack stop of
|
|
275
|
+
// this folder's root. Its services stop first, through the service controller.
|
|
276
|
+
await stopBareDownServices(guarded.space, guarded.services, { style: "rich", withAgents: values["with-agents"] === true });
|
|
277
|
+
const selected = localProcessSurface()
|
|
67
278
|
.sort((a, b) => Number(Boolean(a.stopLast)) - Number(Boolean(b.stopLast)) || (a.order ?? 50) - (b.order ?? 50));
|
|
68
|
-
// A component whose START is target-resolved (`rootedAt: "target"` — the web dashboard) records
|
|
69
|
-
// its pidfile under the TARGET mesh's root, so a selective stop resolves the SAME mesh the start
|
|
70
|
-
// side did (registry current mesh first, `--space` to name one) instead of assuming this folder.
|
|
71
|
-
// Bare `cotal down` stays a sweep of this folder's stack: its pidfiles live here, and reaching
|
|
72
|
-
// into another mesh's root mid-sweep would stop a process the folder's broker does not own.
|
|
73
|
-
const targetAddressed = (component) => requested.length > 0 && component.rootedAt === "target";
|
|
74
|
-
if (values.space) {
|
|
75
|
-
const folderRooted = selected.filter((component) => !targetAddressed(component));
|
|
76
|
-
if (folderRooted.length)
|
|
77
|
-
throw new Error(`--space only applies to target-addressed components - ${folderRooted.map((component) => component.name).join(", ")} always stop${folderRooted.length === 1 ? "s" : ""} under this folder's root`);
|
|
78
|
-
}
|
|
79
279
|
// A `down` that touches this folder's stack stops the shared broker and its per-space daemons;
|
|
80
280
|
// none of them can address one space, so a multi-space root is refused up front rather than at
|
|
81
|
-
// the space-blind pidfile lookup below.
|
|
82
|
-
|
|
83
|
-
if (selected.some((component) => !targetAddressed(component)))
|
|
84
|
-
assertSingleSpaceBroker(authDir(cotalRoot()), "cotal down");
|
|
85
|
-
// Both contexts resolve lazily: a purely target-addressed stop must not require a mesh root at
|
|
86
|
-
// the cwd, and a folder sweep must not require a resolvable mesh target.
|
|
281
|
+
// the space-blind pidfile lookup below.
|
|
282
|
+
assertSingleSpaceBroker(authDir(cotalRoot()), "cotal down");
|
|
87
283
|
let folderContext;
|
|
88
284
|
const folderCtx = () => (folderContext ??= { root: cotalRoot(), space: resolveRuntimeSpace(process.cwd()) });
|
|
89
|
-
let targetContext;
|
|
90
|
-
const contextFor = (component) => {
|
|
91
|
-
if (!targetAddressed(component))
|
|
92
|
-
return folderCtx();
|
|
93
|
-
if (!targetContext) {
|
|
94
|
-
const target = resolveMeshTarget(process.cwd(), values.space ? { space: values.space } : {});
|
|
95
|
-
targetContext = { root: target.root, space: target.space };
|
|
96
|
-
}
|
|
97
|
-
return targetContext;
|
|
98
|
-
};
|
|
99
|
-
if (selected.some((component) => component.stopLast)) {
|
|
100
|
-
const selectedNames = new Set(selected.map((component) => component.name));
|
|
101
|
-
// Fail CLOSED: an unselected dependant that MIGHT be running (including one behind an
|
|
102
|
-
// unattributable/unknown pidfile) blocks a stop-last shutdown - stopping the broker out from
|
|
103
|
-
// under a live dependant we could not confirm gone is exactly the signer-orphan the contract
|
|
104
|
-
// forbids. `mayBeRunning`, not `processAlive` (which reads uncertainty as "not running").
|
|
105
|
-
// Folder context: the question is what depends on THIS folder's broker, so a dependant is
|
|
106
|
-
// judged by the record under this root regardless of how it would be addressed selectively.
|
|
107
|
-
const dependants = all.filter((component) => !selectedNames.has(component.name) && mayBeRunning(component, folderCtx()));
|
|
108
|
-
if (dependants.length) {
|
|
109
|
-
throw new Error(`cannot stop ${selected.filter((component) => component.stopLast).map((component) => component.name).join(", ")} while ${dependants.map((component) => component.name).join(", ")} ${dependants.length === 1 ? "is" : "are"} still running (or its liveness cannot be confirmed) - name them too, or run bare \`cotal down\``);
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
if (values["dry-run"]) {
|
|
113
|
-
const recorded = selected.filter((component) => processRecorded(component, contextFor(component)));
|
|
114
|
-
for (const component of recorded)
|
|
115
|
-
console.log(c.dim(`would stop ${component.label}`));
|
|
116
|
-
if (!recorded.length) {
|
|
117
|
-
const target = requested.length ? requested.join(", ") : "the local stack";
|
|
118
|
-
console.error(c.red(`Nothing running for ${target} (no recorded pidfiles).`));
|
|
119
|
-
process.exit(1);
|
|
120
|
-
}
|
|
121
|
-
console.log(c.dim("Dry run - nothing was changed. Re-run without --dry-run to stop these components."));
|
|
122
|
-
return;
|
|
123
|
-
}
|
|
124
285
|
let any = false;
|
|
125
286
|
let allStopped = true;
|
|
126
287
|
for (const component of selected) {
|
|
127
|
-
any = processRecorded(component,
|
|
288
|
+
any = processRecorded(component, folderCtx()) || any;
|
|
128
289
|
if (component.stopLast && !allStopped) {
|
|
129
290
|
console.error(c.red(`✗ not stopping ${component.label} because an earlier component did not stop`));
|
|
130
291
|
continue;
|
|
131
292
|
}
|
|
132
293
|
try {
|
|
133
|
-
const context =
|
|
294
|
+
const context = folderCtx();
|
|
134
295
|
if (component.name === "manager")
|
|
135
296
|
await stopManager(context.space, { withAgents: values["with-agents"] });
|
|
136
297
|
else if (component.name === "delivery")
|
|
137
|
-
await stopDelivery(context.space, { preserveCredentials:
|
|
298
|
+
await stopDelivery(context.space, { preserveCredentials: true });
|
|
138
299
|
else
|
|
139
300
|
await stopLocalProcess(component, context);
|
|
140
301
|
}
|
|
@@ -148,11 +309,11 @@ export async function down(args) {
|
|
|
148
309
|
process.exitCode = 1;
|
|
149
310
|
return;
|
|
150
311
|
}
|
|
151
|
-
if (
|
|
312
|
+
if (selected.some((component) => component.name === "delivery"))
|
|
152
313
|
await removeDeliveryCredentials(folderCtx().space);
|
|
153
314
|
for (const component of selected) {
|
|
154
315
|
for (const artifact of component.artifacts ?? [])
|
|
155
|
-
rmSync(localProcessPath(artifact,
|
|
316
|
+
rmSync(localProcessPath(artifact, folderCtx()), { force: true });
|
|
156
317
|
}
|
|
157
318
|
// Pidfiles are the only thing this stack owns. A registered broker that answers with no pidfile
|
|
158
319
|
// is a different situation: something is running that `down` did not start and must not stop.
|
|
@@ -161,27 +322,24 @@ export async function down(args) {
|
|
|
161
322
|
// Owned components (a detached web, a manager) do not change the question: stopping them is not
|
|
162
323
|
// the same as this stack owning the broker. The probe runs on every bare down that holds no
|
|
163
324
|
// nats pidfile, AFTER their owned artifacts cleared, so those components stop exactly as they
|
|
164
|
-
// do with no broker present.
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
for
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
`Stop that broker with the supervisor that started it, or remove the registration with \`cotal meshes rm ${broker.space}\`.`));
|
|
172
|
-
}
|
|
173
|
-
process.exit(1);
|
|
325
|
+
// do with no broker present.
|
|
326
|
+
const unowned = await liveUnownedBrokers(folderCtx());
|
|
327
|
+
if (unowned.length) {
|
|
328
|
+
for (const broker of unowned) {
|
|
329
|
+
console.error(c.red(`Broker for "${broker.space}" is running at ${broker.server}, but no pidfile records it. ` +
|
|
330
|
+
`cotal down will not stop a process it did not start. ` +
|
|
331
|
+
`Stop that broker with the supervisor that started it, or remove the registration with \`cotal meshes rm ${broker.space}\`.`));
|
|
174
332
|
}
|
|
333
|
+
process.exit(1);
|
|
175
334
|
}
|
|
176
|
-
// The broker owns the mesh registry entry and transient whole-mesh launch material
|
|
177
|
-
//
|
|
335
|
+
// The broker owns the mesh registry entry and transient whole-mesh launch material, so they go
|
|
336
|
+
// with it.
|
|
178
337
|
if (selected.some((component) => component.clearsMesh)) {
|
|
179
338
|
rmSync(join(folderCtx().root, ".cotal", "run"), { recursive: true, force: true });
|
|
180
339
|
removeMeshesByRoot(folderCtx().root);
|
|
181
340
|
}
|
|
182
341
|
if (!any) {
|
|
183
|
-
|
|
184
|
-
console.error(c.red(`Nothing running for ${target} (no recorded pidfiles).`));
|
|
342
|
+
console.error(c.red("Nothing running for the local stack (no recorded pidfiles)."));
|
|
185
343
|
process.exit(1);
|
|
186
344
|
}
|
|
187
345
|
}
|
|
@@ -212,14 +370,14 @@ export function processAlive(component, context) {
|
|
|
212
370
|
const pid = parsePid(raw);
|
|
213
371
|
return pid !== undefined && isAlive(pid);
|
|
214
372
|
}
|
|
215
|
-
/** Whether a component MIGHT still be running
|
|
216
|
-
*
|
|
217
|
-
*
|
|
218
|
-
*
|
|
219
|
-
*
|
|
220
|
-
* "not alive", which is fine for "is it worth
|
|
221
|
-
*
|
|
222
|
-
*
|
|
373
|
+
/** Whether a component MIGHT still be running. It fails CLOSED on uncertainty. A component with NO
|
|
374
|
+
* pidfile, an EMPTY husk, or a valid pid PROVEN dead (ESRCH) is not running. ANY other state - an
|
|
375
|
+
* unparsable/unattributable record, or a valid pid that is alive or whose liveness cannot be
|
|
376
|
+
* confirmed (`unknown`) - MIGHT be running. `down --preserve-state` asks it to fence an uncertain
|
|
377
|
+
* delivery daemon, to treat an uncertain manager as alive, and to refuse to call a cut complete.
|
|
378
|
+
* `processAlive` collapses unparsable and `unknown` to "not alive", which is fine for "is it worth
|
|
379
|
+
* stopping" but WRONG for those questions: it would count a live auth signer behind a torn pidfile
|
|
380
|
+
* as stopped. Only an ESRCH-confirmed death (or no record) clears a component. */
|
|
223
381
|
export function mayBeRunning(component, context) {
|
|
224
382
|
const raw = readPidfile(localProcessPath(component.pidFile, context));
|
|
225
383
|
if (!raw)
|
|
@@ -231,7 +389,7 @@ export function mayBeRunning(component, context) {
|
|
|
231
389
|
}
|
|
232
390
|
/** The principal keys of every retained agent in a preservation inventory — the dot-form ids that
|
|
233
391
|
* appear in the presence roster, so a caller can tell which retained agents are still live. */
|
|
234
|
-
function retainedPrincipalKeys(inventory) {
|
|
392
|
+
export function retainedPrincipalKeys(inventory) {
|
|
235
393
|
const agents = (inventory.agents ?? []);
|
|
236
394
|
return new Set(agents.map((agent) => {
|
|
237
395
|
if (agent.identity?.mode === "user" && agent.identity.owner && agent.identity.actor)
|
|
@@ -258,10 +416,10 @@ function assertSessionStores(paths) {
|
|
|
258
416
|
stat = statSync(resolved);
|
|
259
417
|
}
|
|
260
418
|
catch (error) {
|
|
261
|
-
throw new
|
|
419
|
+
throw new CommandFailure("refused", "USAGE_INVALID", `--session-store ${resolved} cannot be read (${error.code ?? error.message}); name the harness transcript store directory for this host`);
|
|
262
420
|
}
|
|
263
421
|
if (!stat.isDirectory())
|
|
264
|
-
throw new
|
|
422
|
+
throw new CommandFailure("refused", "USAGE_INVALID", `--session-store ${resolved} is not a directory; name the harness transcript store directory for this host`);
|
|
265
423
|
return resolved;
|
|
266
424
|
});
|
|
267
425
|
}
|
|
@@ -269,13 +427,16 @@ async function preserveStateDown(storeOverride, sessionStores = []) {
|
|
|
269
427
|
const root = cotalRoot();
|
|
270
428
|
const matching = loadMeshes().filter((mesh) => mesh.root === root);
|
|
271
429
|
if (matching.length !== 1)
|
|
272
|
-
throw new
|
|
430
|
+
throw new CommandFailure("refused", matching.length ? "TARGET_AMBIGUOUS" : "TARGET_NOT_FOUND", `down --preserve-state requires exactly one recorded mesh for this root; found ${matching.length}, and nothing was stopped`, { target: { root, spaces: matching.map((mesh) => mesh.space) } });
|
|
273
431
|
const mesh = matching[0];
|
|
274
432
|
const storeDir = storeOverride ? resolveStore(storeOverride) : join(root, ".cotal", "nats");
|
|
275
433
|
// The store cap the broker was started with travels with the store, so the resume re-renders it.
|
|
276
434
|
const cap = mesh.maxFileStore !== undefined ? { maxFileStore: mesh.maxFileStore } : {};
|
|
277
435
|
const lock = acquireMaintenanceLock(root);
|
|
278
436
|
try {
|
|
437
|
+
const additiveAttempts = listAdditiveTeamAttempts(root);
|
|
438
|
+
if (retainedAdditiveTeamAttempts(additiveAttempts).length || additiveAttempts.refused.length)
|
|
439
|
+
throw new CommandFailure("refused", "LIFECYCLE_BLOCKED", "an additive attempt or returned additive deployment remains; preserve-state down did not fold its resources into the retained stack", { target: { root, space: mesh.space, deploymentIds: retainedAdditiveTeamAttempts(additiveAttempts).map((attempt) => attempt.deploymentId), unreadable: additiveAttempts.refused.map(({ path }) => path) } });
|
|
279
440
|
const all = localProcessSurface();
|
|
280
441
|
const context = { root, space: mesh.space };
|
|
281
442
|
const existing = readMaintenanceJournal(root);
|
|
@@ -550,7 +711,7 @@ async function preserveStateDown(storeOverride, sessionStores = []) {
|
|
|
550
711
|
* source`, and a checkpoint inherits that refusal rather than writing something that will not
|
|
551
712
|
* reproduce the seat.
|
|
552
713
|
*/
|
|
553
|
-
function assertSeatsCheckpointable(inventory) {
|
|
714
|
+
export function assertSeatsCheckpointable(inventory) {
|
|
554
715
|
for (const entry of (inventory.agents ?? [])) {
|
|
555
716
|
const keys = entry.launch?.unresolvedLaunchOptionKeys ?? [];
|
|
556
717
|
if (keys.length)
|
|
@@ -560,7 +721,7 @@ function assertSeatsCheckpointable(inventory) {
|
|
|
560
721
|
}
|
|
561
722
|
}
|
|
562
723
|
/** Capture one checkpoint per retained seat, after the cut has proven the whole stack down. */
|
|
563
|
-
async function captureSeatCheckpoints(root, space, resume, destination, sessionStores) {
|
|
724
|
+
export async function captureSeatCheckpoints(root, space, resume, destination, sessionStores) {
|
|
564
725
|
const document = readMaintenanceResumeDocument(root, resume);
|
|
565
726
|
const inventory = document.inventory;
|
|
566
727
|
const agents = inventory?.agents ?? [];
|
|
@@ -631,7 +792,7 @@ async function directKvValue(nc, stream, subject, allowEmpty = false) {
|
|
|
631
792
|
* continuously, so the cut publishes `ready` only once BOTH lease buckets hold no live value —
|
|
632
793
|
* a dead daemon's lease expires by TTL, a pidless live one keeps renewing and is refused here.
|
|
633
794
|
* Pidfiles are hints; leases are proof. */
|
|
634
|
-
async function assertControlPlaneQuiesced(space, server) {
|
|
795
|
+
export async function assertControlPlaneQuiesced(space, server) {
|
|
635
796
|
const resolved = await connectOrExit({ space, server }, "deployer");
|
|
636
797
|
const user = resolved.bearer ? await userViewAuthOrExit(resolved, "deployer") : undefined;
|
|
637
798
|
const nc = await dialerFor(server)({
|