@cotal-ai/cli 0.100.2 → 0.101.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +306 -130
- 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 +348 -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 +142 -29
- 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 +148 -34
- 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 +92 -4
- package/dist/lib/manager-choice.d.ts.map +1 -1
- package/dist/lib/manager-choice.js +338 -23
- 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-custody-win32.d.ts +25 -0
- package/dist/lib/service-custody-win32.d.ts.map +1 -0
- package/dist/lib/service-custody-win32.js +67 -0
- package/dist/lib/service-custody-win32.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 +46 -5
- package/dist/lib/service-instances.d.ts.map +1 -1
- package/dist/lib/service-instances.js +112 -18
- package/dist/lib/service-instances.js.map +1 -1
- package/dist/lib/service-journal.js +1 -1
- package/dist/lib/service-journal.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 +53 -15
- package/dist/lib/service-process.d.ts.map +1 -1
- package/dist/lib/service-process.js +533 -86
- package/dist/lib/service-process.js.map +1 -1
- package/dist/lib/service-systemd-install.js +1 -1
- package/dist/lib/service-systemd-install.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/agents.js
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { DEV_OWNER, assertLifecycleToken, dialerFor, mintCreds, newIdentity, openSessionRail, peerLabel, standaloneConnectOpts } from "@cotal-ai/core";
|
|
2
|
-
import { CommandFailure, ConnectRefusal, divergentCwdAnchor, isWorkspaceTargetError, jsonFlag,
|
|
2
|
+
import { CommandFailure, ConnectRefusal, divergentCwdAnchor, isWorkspaceTargetError, jsonFlag, oneLine, renderReport, terminalWidth, plainFlag, presentationOf, resolveSeatControlTarget, renderWorkspaceError, targetFlags, userSessionAuth, writeResult, recordOperationSpace, } from "@cotal-ai/workspace";
|
|
3
3
|
import * as prompts from "../lib/prompts.js";
|
|
4
4
|
import { canPrompt } from "./meshes-wizard.js";
|
|
5
5
|
import {} from "@nats-io/transport-node";
|
|
6
6
|
import { c, presenceFacts } from "../ui.js";
|
|
7
|
-
import { askManager, scatterManager, failIfNotOk, managerFailure, readFailure, resolveControlTarget, onInstance,
|
|
7
|
+
import { askManager, scatterManager, failIfNotOk, managerFailure, readFailure, refuseUnregisteredManager, unansweredDescribeRefusal, resolveControlTarget, onInstance, onFlag } from "../lib/control.js";
|
|
8
|
+
import { managerPin } from "../lib/manager-choice.js";
|
|
8
9
|
import { attachClient, detachKey, holdTerminal, isDetachPress, isTransportEnd, meshSessionTransport } from "../lib/attach-client.js";
|
|
9
10
|
import { completingFlagValue } from "../lib/completion.js";
|
|
10
|
-
import { stackManagerAbsent } from "../lib/stack-journal.js";
|
|
11
|
+
import { runningStackManagerPid, stackManagerAbsent, stackManagerStarting } from "../lib/stack-journal.js";
|
|
12
|
+
import { connectorHarnesses } from "../lib/status.js";
|
|
11
13
|
/**
|
|
12
14
|
* The manager's operator clients — thin control-plane request/reply commands (`stop`/`ps`/
|
|
13
15
|
* `attach`) that drive a RUNNING manager. Moved from `@cotal-ai/manager` in stage 2a of the CLI
|
|
@@ -45,10 +47,6 @@ export const inputFlags = [
|
|
|
45
47
|
];
|
|
46
48
|
export function managedAgentComplete(argv) {
|
|
47
49
|
const flag = completingFlagValue(argv, attachFlags);
|
|
48
|
-
if (flag?.name === "space")
|
|
49
|
-
return { items: loadMeshes().map((m) => ({ value: m.space })), directive: "nofiles" };
|
|
50
|
-
if (flag?.name === "creds")
|
|
51
|
-
return { items: [], directive: "default" };
|
|
52
50
|
if (flag?.name === "name")
|
|
53
51
|
return { items: [], directive: "nofiles" };
|
|
54
52
|
if (argv.length <= 1)
|
|
@@ -65,7 +63,7 @@ export function managedTarget(args, operation, allowPicker = false) {
|
|
|
65
63
|
onInstance(args.values.on, `cotal ${operation}`);
|
|
66
64
|
if (name === undefined && operation === "attach" && allowPicker) {
|
|
67
65
|
if (!canPrompt())
|
|
68
|
-
throw new CommandFailure("refused", "USAGE_INVALID", "name the agent to attach without an interactive terminal", { remedy: "run cotal ps, then cotal attach <name>" });
|
|
66
|
+
throw new CommandFailure("refused", "USAGE_INVALID", "name the agent to attach without an interactive terminal", { remedy: "run cotal ps, then cotal attach <name>", selfContained: true });
|
|
69
67
|
return undefined;
|
|
70
68
|
}
|
|
71
69
|
if (name !== undefined && /[\u0000-\u001f\u007f]/u.test(name))
|
|
@@ -114,13 +112,20 @@ export async function stop(args) {
|
|
|
114
112
|
else {
|
|
115
113
|
name = managedTarget(args, "stop");
|
|
116
114
|
on = await pinForTarget({ ...v, name }, "cotal stop");
|
|
115
|
+
// A typed pin the registry does not list is refused at once, as spawn refuses it. Stop's admin
|
|
116
|
+
// instrument holds no registry read, so the check uses the one ps reads the registry with.
|
|
117
|
+
if (v.on !== undefined && on !== undefined) {
|
|
118
|
+
const reader = await resolveControlTarget(v, "control-caller-privileged", on);
|
|
119
|
+
if (!reader.auth.bearer)
|
|
120
|
+
await refuseUnregisteredManager(reader.space, reader.server, reader.auth, on);
|
|
121
|
+
}
|
|
117
122
|
t = await resolveControlTarget(v, "control-caller-admin", on);
|
|
118
123
|
}
|
|
119
124
|
recordOperationSpace(t.space);
|
|
120
125
|
const reply = await askManager(t.space, t.server, v.self ? "stopSelf" : "stop", { ...(name ? { name } : {}), graceful: v.force !== true }, t.auth, t.auth.bearer ? "owner" : "any", undefined, { instanceId: on });
|
|
121
126
|
const target = { space: t.space, managerInstanceId: reply.managerInstanceId ?? on ?? null, selection: v.self ? "verified-self" : "named", ...(name ? { agent: name } : {}) };
|
|
122
127
|
if (!reply.ok)
|
|
123
|
-
throw managerFailure(reply, "agent stop", target);
|
|
128
|
+
throw unansweredDescribeRefusal(reply, "agent stop", target) ?? managerFailure(reply, "agent stop", target);
|
|
124
129
|
const data = reply.data;
|
|
125
130
|
if (!data || typeof data.name !== "string" || typeof data.stopped !== "boolean" || typeof data.graceful !== "boolean")
|
|
126
131
|
throw new CommandFailure("unknown", "OPERATION_UNKNOWN", "the manager answered, but the stop receipt could not be read; the request was not repeated", { target, ...(reply.request ? { native: { detail: { request: reply.request } } } : {}) });
|
|
@@ -203,9 +208,12 @@ export async function locateSeat(v, name, opts = {}) {
|
|
|
203
208
|
if (probe.auth.bearer)
|
|
204
209
|
return { kind: "unpinned" };
|
|
205
210
|
const scatter = await scatterManager(probe.space, probe.server, "ps", probe.auth, probe.spaceAuth);
|
|
211
|
+
if (!scatter.ok && scatter.noLiveManager)
|
|
212
|
+
return { kind: "no-manager", space: probe.space, native: { code: scatter.code, detail: scatter.error } };
|
|
206
213
|
if (!scatter.ok)
|
|
207
214
|
return { kind: "unpinned" }; // cannot locate ⇒ behave exactly as before, never worse
|
|
208
|
-
|
|
215
|
+
const loc = locateSeatIn(scatter.instances, name);
|
|
216
|
+
return loc.kind === "absent" || loc.kind === "unknown" ? { ...loc, space: probe.space } : loc;
|
|
209
217
|
}
|
|
210
218
|
/**
|
|
211
219
|
* WHAT THE SCATTER ESTABLISHED about one seat name — the whole decision, as a function of the rows
|
|
@@ -231,12 +239,12 @@ export function locateSeatIn(instances, name) {
|
|
|
231
239
|
return { kind: "pin", instanceId: host.instanceId };
|
|
232
240
|
if (silent.length || refused.length)
|
|
233
241
|
return { kind: "unknown", answered: answered.length, silent, refused };
|
|
234
|
-
return { kind: "absent", checked: answered.length };
|
|
242
|
+
return { kind: "absent", checked: answered.length, instances: answered.map((i) => i.instanceId).sort() };
|
|
235
243
|
}
|
|
236
244
|
/** Resolve `--on` for a targeted verb: an explicit pin wins; otherwise locate the seat. Returns the
|
|
237
245
|
* instance to address, or exits with an error that says WHICH case the miss was. */
|
|
238
246
|
async function pinForTarget(v, verb) {
|
|
239
|
-
const on =
|
|
247
|
+
const on = await managerPin(v, verb);
|
|
240
248
|
if (on !== undefined)
|
|
241
249
|
return on;
|
|
242
250
|
const loc = await locateSeat(v, String(v.name));
|
|
@@ -244,8 +252,19 @@ async function pinForTarget(v, verb) {
|
|
|
244
252
|
return loc.instanceId;
|
|
245
253
|
if (loc.kind === "unpinned")
|
|
246
254
|
return undefined;
|
|
247
|
-
|
|
248
|
-
|
|
255
|
+
// Refused before anything is sent, as `ps` refuses, rather than after a describe no manager can answer.
|
|
256
|
+
if (loc.kind === "no-manager") {
|
|
257
|
+
recordOperationSpace(loc.space);
|
|
258
|
+
throw new CommandFailure("refused", "TARGET_UNAVAILABLE", `no manager is running for this space to reach agent "${oneLine(String(v.name))}"`, { target: { space: loc.space, managerInstanceId: null, agent: String(v.name) }, native: loc.native, remedy: "start the stack's manager with bare cotal up; a stack started with --no-manager has none" });
|
|
259
|
+
}
|
|
260
|
+
// Refused before anything is sent, as the same miss with `--on` refuses: a whole space that answered
|
|
261
|
+
// proves the name absent; one that did not cannot say where it is.
|
|
262
|
+
if (loc.space !== undefined)
|
|
263
|
+
recordOperationSpace(loc.space);
|
|
264
|
+
const agent = String(v.name), message = seatMissRefusal(agent, verb, loc);
|
|
265
|
+
if (loc.kind === "absent")
|
|
266
|
+
throw new CommandFailure("refused", "TARGET_NOT_FOUND", message, { target: { space: loc.space ?? null, agent, managerInstanceIds: loc.instances }, remedy: "run cotal ps to see the agents each manager runs" });
|
|
267
|
+
throw new CommandFailure("refused", "TARGET_UNAVAILABLE", message, { target: { space: loc.space ?? null, agent, answered: loc.answered, silent: loc.silent, refused: loc.refused }, remedy: "run cotal ps to see which managers answer and the agents they run" });
|
|
249
268
|
}
|
|
250
269
|
/** The console's wording for a seat the whole space proved absent. Main's richer `seatMissRefusal`
|
|
251
270
|
* needs the `unknown` variant too; the console (and `attachSeat`'s returned verdict) only ever
|
|
@@ -274,7 +293,7 @@ export function seatNotFoundMessage(loc, name, verb) {
|
|
|
274
293
|
export function seatMissRefusal(name, verb, loc) {
|
|
275
294
|
const address = `To address one directly: \`${verb} --on <instance>\` (the whole id, as printed).`;
|
|
276
295
|
if (loc.kind === "absent")
|
|
277
|
-
return `no managed agent "${name}" on any of the ${loc.checked} reachable manager instance(s) in this space.`;
|
|
296
|
+
return `no managed agent "${name}" on any of the ${loc.checked} reachable manager instance(s) in this space (${loc.instances.join(", ")}).`;
|
|
278
297
|
const silent = loc.silent.length
|
|
279
298
|
? ` ${loc.silent.length} registered manager instance(s) gave no answer within the deadline (${loc.silent.join(", ")}). Either that host is alive but slow, or it died and its registration was never removed; if it is dead, deregister it.`
|
|
280
299
|
: "";
|
|
@@ -300,11 +319,15 @@ export function seatMissRefusal(name, verb, loc) {
|
|
|
300
319
|
* - `not-probed` / `probe-refused`: this command could not ask. That is a fact about the command,
|
|
301
320
|
* not the instance, and saying so is what keeps a local gap from reading as a remote fault.
|
|
302
321
|
*/
|
|
303
|
-
function silentManager(liveness, instanceId) {
|
|
322
|
+
function silentManager(liveness, instanceId, mode) {
|
|
323
|
+
// A static space's own root holds the authority that removes the record. Any other space has none,
|
|
324
|
+
// so only the manager's own clean stop removes it, and that needs its host.
|
|
304
325
|
if (liveness === "gone")
|
|
305
326
|
return {
|
|
306
327
|
state: { text: "registration is stale (the broker reports nothing subscribed on its rail; its host is gone and never deregistered)", tone: "failed" },
|
|
307
|
-
remedy:
|
|
328
|
+
remedy: mode === "auth"
|
|
329
|
+
? `remove the record from this space's own root: cotal endpoint deregister manager ${instanceId} --yes`
|
|
330
|
+
: "if its host is still available, start that manager there again and stop it cleanly, as with cotal service start <name> then cotal service stop <name> --yes; if the host is gone, no supported command removes this record",
|
|
308
331
|
};
|
|
309
332
|
const why = liveness === "probe-refused"
|
|
310
333
|
? " (its liveness could not be probed: the broker refused this command's probe, named above)"
|
|
@@ -441,29 +464,33 @@ function slotBlocks(rows) {
|
|
|
441
464
|
];
|
|
442
465
|
}
|
|
443
466
|
/** `rowsOf` is each answered instance's rows as the census received them, so a row that names no
|
|
444
|
-
* instance of its own is still listed under the manager that returned it.
|
|
445
|
-
|
|
467
|
+
* instance of its own is still listed under the manager that returned it. `noApplication` is
|
|
468
|
+
* `status`'s reading that no agent application is set up here, so an empty list's Next agrees with
|
|
469
|
+
* the one `status` gives. */
|
|
470
|
+
function psView(result, wide, rowsOf = new Map(), noApplication = false, mode) {
|
|
446
471
|
const empty = result.kind === "slots" ? "No active static slots." : "No managed agents.";
|
|
447
472
|
const blocksFor = (rows) => !rows.length ? [{ kind: "lines", lines: [{ text: empty, tone: "hint" }] }]
|
|
448
473
|
: result.kind === "slots" ? slotBlocks(rows)
|
|
449
474
|
: seatBlocks(rows, wide);
|
|
450
475
|
// A single manager that answered is the common case: a flat list, no per-manager grouping noise.
|
|
476
|
+
// Its instance id is still shown, with or without agents, because it is what `--on` takes.
|
|
451
477
|
if (result.managers.length <= 1 && result.managers.every((m) => m.state === "answered"))
|
|
452
478
|
return { sections: [
|
|
453
479
|
{ title: result.kind === "slots" ? "Static slots" : "Agents", blocks: blocksFor(result.items) },
|
|
480
|
+
...result.managers.map((m) => ({ title: "Manager", blocks: [{ kind: "fields", rows: [["instance", m.instanceId], ...(m.reportedHost ? [["reported host", m.reportedHost]] : [])] }] })),
|
|
454
481
|
{ title: "Next", blocks: [{ kind: "commands", items: result.items.length ? [
|
|
455
482
|
{ command: "cotal attach <name>", description: "Return to an agent's terminal" },
|
|
456
483
|
{ command: "cotal stop <name>", description: "Stop one agent" },
|
|
457
|
-
] : [{ command: "cotal spawn", description: "Launch your default agent" }] }] },
|
|
484
|
+
] : [noApplication ? { command: "cotal setup", description: "Set up an agent application" } : { command: "cotal spawn", description: "Launch your default agent" }] }] },
|
|
458
485
|
] };
|
|
459
486
|
// Several managers: one section each, named by the FULL instance id, since `--on` takes nothing
|
|
460
487
|
// shorter and this is precisely where it becomes the one way to address a manager. Silent and
|
|
461
488
|
// refused instances are shown, never dropped.
|
|
462
489
|
return {
|
|
463
490
|
sections: result.managers.map((m) => {
|
|
464
|
-
const title = `manager ${m.instanceId}`;
|
|
491
|
+
const title = `manager ${m.instanceId}${m.reportedHost ? ` · reports host ${m.reportedHost}` : ""}`;
|
|
465
492
|
if (m.state === "silent") {
|
|
466
|
-
const silent = silentManager(m.liveness, m.instanceId);
|
|
493
|
+
const silent = silentManager(m.liveness, m.instanceId, mode);
|
|
467
494
|
return { title, blocks: [{ kind: "lines", lines: [silent.state, ...(silent.remedy ? [{ text: `↳ ${silent.remedy}`, tone: "hint" }] : [])] }] };
|
|
468
495
|
}
|
|
469
496
|
if (m.state === "contract-mismatch")
|
|
@@ -476,6 +503,16 @@ function psView(result, wide, rowsOf = new Map()) {
|
|
|
476
503
|
}),
|
|
477
504
|
};
|
|
478
505
|
}
|
|
506
|
+
/** Whether no connector is installed here, as `status` reports "Agent applications: not set up".
|
|
507
|
+
* An inventory that cannot be read says nothing, so the Next stays the launch. */
|
|
508
|
+
function noApplicationHere() {
|
|
509
|
+
try {
|
|
510
|
+
return connectorHarnesses().length === 0;
|
|
511
|
+
}
|
|
512
|
+
catch {
|
|
513
|
+
return false;
|
|
514
|
+
}
|
|
515
|
+
}
|
|
479
516
|
export async function ps(args) {
|
|
480
517
|
const v = args.values;
|
|
481
518
|
// #651 presentations: --wide is a human layout and --json the document that already carries every
|
|
@@ -490,8 +527,8 @@ export async function ps(args) {
|
|
|
490
527
|
throw new CommandFailure("refused", "USAGE_INVALID", "--slots and --wide are mutually exclusive: --slots lists durable static slot rows, --wide the live seat facts", { remedy: "pass one of them" });
|
|
491
528
|
const command = slots ? "slots" : "ps";
|
|
492
529
|
const kind = slots ? "slots" : "seats";
|
|
493
|
-
const census = await readSeats(v, command,
|
|
494
|
-
const view = (result) => psView(result, wide, census.rowsOf);
|
|
530
|
+
const census = await readSeats(v, command, await managerPin(v, "cotal ps"));
|
|
531
|
+
const view = (result) => psView(result, wide, census.rowsOf, !result.items.length && noApplicationHere(), census.mode);
|
|
495
532
|
writeResult(presentation, {
|
|
496
533
|
command: "ps",
|
|
497
534
|
target: census.target,
|
|
@@ -505,7 +542,7 @@ export async function ps(args) {
|
|
|
505
542
|
export async function agentStatus(args) {
|
|
506
543
|
const name = args.positionals[0];
|
|
507
544
|
const values = args.values;
|
|
508
|
-
const census = await readSeats(values, "ps",
|
|
545
|
+
const census = await readSeats(values, "ps", await managerPin(values, "cotal status"));
|
|
509
546
|
const rows = census.items.map((value) => {
|
|
510
547
|
if (!value || typeof value !== "object")
|
|
511
548
|
throw new CommandFailure("failed", "OPERATION_FAILED", "a manager returned an invalid agent record", { target: census.target });
|
|
@@ -517,8 +554,11 @@ export async function agentStatus(args) {
|
|
|
517
554
|
const matches = rows.filter((row) => row.name === name || row.id === name);
|
|
518
555
|
if (matches.length > 1)
|
|
519
556
|
throw new CommandFailure("refused", "TARGET_AMBIGUOUS", "more than one manager reports this agent; select a manager with --on", { target: { ...census.target, name, candidates: matches.map((row) => ({ name: row.name, id: row.id, instanceId: row.instanceId ?? null })) } });
|
|
557
|
+
// `manager` and an answering manager's instance id name the manager itself, which runs no row of
|
|
558
|
+
// its own, so the refusal says where its state is read.
|
|
559
|
+
const managerItself = name === "manager" || census.managers.some((manager) => manager.state === "answered" && manager.instanceId === name);
|
|
520
560
|
if (!matches.length && !census.partial)
|
|
521
|
-
throw new CommandFailure("refused", "TARGET_NOT_FOUND", "the answering managers report no agent with that name or identity", { target: { ...census.target, name } });
|
|
561
|
+
throw new CommandFailure("refused", "TARGET_NOT_FOUND", "the answering managers report no agent with that name or identity", { target: { ...census.target, name }, ...(managerItself ? { remedy: `${name} is this space's manager, which is answering, not an agent it runs; cotal status shows the manager's state, and cotal endpoint describe manager reads its commands` } : {}) });
|
|
522
562
|
const item = matches[0] ?? null;
|
|
523
563
|
const managerInstanceId = item ? [...census.rowsOf].find(([, rows]) => rows.includes(item))?.[0] ?? census.target.managerInstanceId ?? item.instanceId ?? null : null;
|
|
524
564
|
let managerHint = "";
|
|
@@ -576,6 +616,9 @@ export async function readSeats(v, command, on) {
|
|
|
576
616
|
// this resolve, and a credential cannot gain an instance rail after it is minted.
|
|
577
617
|
const t = await resolveControlTarget(v, "control-caller-privileged", on, { onRefusal: "throw" });
|
|
578
618
|
recordOperationSpace(t.space);
|
|
619
|
+
// A pin the registry does not list is refused at once, as spawn refuses it; only a registered manager is waited on.
|
|
620
|
+
if (on !== undefined && !t.auth.bearer)
|
|
621
|
+
await refuseUnregisteredManager(t.space, t.server, t.auth, on);
|
|
579
622
|
// One manager instance: `--on <instance>` pins ps to its `inst` route on a multi-manager mesh,
|
|
580
623
|
// and in USER MODE (bearer present) the borrowed manager view pins one authorized instance and
|
|
581
624
|
// keeps the actor's existing command scopes. That view has no registry freeze rows and never
|
|
@@ -610,12 +653,21 @@ export async function readSeats(v, command, on) {
|
|
|
610
653
|
// freeze rows; every registered instance is attributed, and a non-answering one is labeled with
|
|
611
654
|
// what this command established about it (pin 3).
|
|
612
655
|
const target = { space: t.space, scope: "all-managers" };
|
|
613
|
-
const scatter = await scatterManager(t.space, t.server, command, t.auth, t.spaceAuth);
|
|
656
|
+
const scatter = await scatterManager(t.space, t.server, command, t.auth, t.spaceAuth, undefined, { reportHosts: true });
|
|
614
657
|
// An empty manager registry on this root's own controller stack, whose manager does not run, is
|
|
615
658
|
// a known boundary with a remedy; the registry's own failure stays the cause. So is a registry
|
|
616
|
-
// that still lists that manager after its process died: no manager answered the read.
|
|
617
|
-
|
|
618
|
-
|
|
659
|
+
// that still lists that manager after its process died: no manager answered the read. While an
|
|
660
|
+
// `up` is still starting that manager, the answer is to wait for it, not to start another.
|
|
661
|
+
if (!scatter.ok && (scatter.code === "failed-precondition" || scatter.unanswered === true) && t.root !== undefined) {
|
|
662
|
+
const native = { code: scatter.code, ...(scatter.error ? { detail: scatter.error } : {}) };
|
|
663
|
+
if (stackManagerStarting(t.root, t.space))
|
|
664
|
+
throw new CommandFailure("refused", "TARGET_UNAVAILABLE", "the stack's manager is starting, so it has no managed agents to list yet", { target, native, remedy: "run cotal ps again once cotal up reports the manager started" });
|
|
665
|
+
if (stackManagerAbsent(t.root, t.space))
|
|
666
|
+
throw new CommandFailure("refused", "TARGET_UNAVAILABLE", "no manager is running for this space, so it has no managed agents to list", { target, native, remedy: "start the stack's manager with bare cotal up; a stack started with --no-manager has none" });
|
|
667
|
+
}
|
|
668
|
+
const silentPid = !scatter.ok && scatter.unanswered === true && t.root !== undefined ? runningStackManagerPid(t.root, t.space) : undefined;
|
|
669
|
+
if (!scatter.ok && silentPid !== undefined)
|
|
670
|
+
throw new CommandFailure("refused", "TARGET_UNAVAILABLE", `this space's stack manager (pid ${silentPid}) is running but did not answer, so no agents were listed`, { target, native: { code: scatter.code, ...(scatter.error ? { detail: scatter.error } : {}) }, remedy: `if it stays unresponsive, end that process with kill -KILL ${silentPid}; then bare cotal up starts the manager again` });
|
|
619
671
|
if (!scatter.ok)
|
|
620
672
|
throw readFailure(scatter, target);
|
|
621
673
|
// Stable ordering: reachable instances first, then by instance id.
|
|
@@ -650,7 +702,7 @@ export async function readSeats(v, command, on) {
|
|
|
650
702
|
continue;
|
|
651
703
|
}
|
|
652
704
|
const rows = inst.data ?? [];
|
|
653
|
-
managers.push({ instanceId: inst.instanceId, state: "answered" });
|
|
705
|
+
managers.push({ instanceId: inst.instanceId, state: "answered", ...(inst.reportedHost ? { reportedHost: inst.reportedHost } : {}) });
|
|
654
706
|
rowsOf.set(inst.instanceId, rows);
|
|
655
707
|
items.push(...rows);
|
|
656
708
|
}
|
|
@@ -664,7 +716,7 @@ export async function readSeats(v, command, on) {
|
|
|
664
716
|
: "retry, or read one manager with `cotal ps --on <instance>`",
|
|
665
717
|
}
|
|
666
718
|
: undefined;
|
|
667
|
-
return { target, items, managers, warnings, rowsOf, ...(partial ? { partial } : {}) };
|
|
719
|
+
return { target, items, managers, warnings, rowsOf, mode: t.mode, ...(partial ? { partial } : {}) };
|
|
668
720
|
}
|
|
669
721
|
/** Re-establishment backoff, in order; the last value is the cap and repeats forever. A seat that
|
|
670
722
|
* exists is worth waiting for — the operator asked to be attached to it, and the alternative is
|
|
@@ -823,8 +875,9 @@ async function establishAttachSession(v, on, reconnect, firstAttempt) {
|
|
|
823
875
|
const t = seat ?? await resolveControlTarget(v, "control-caller-admin", on, first ? {} : { onRefusal: "throw" });
|
|
824
876
|
recordOperationSpace(t.space);
|
|
825
877
|
const reach = t.auth.bearer ? "owner" : "any";
|
|
878
|
+
// A refusal's report names the mesh in its heading, so this block names it once, in a field.
|
|
826
879
|
if (first)
|
|
827
|
-
console.error(renderReport({
|
|
880
|
+
console.error(renderReport({ sections: [{ title: "Attach", blocks: [{ kind: "fields", rows: [["Space", t.space], ["Agent", v.name], ["Manager", on ?? t.auth.managerInstanceId ?? "native selection"]] }] }] }, "rich", terminalWidth(process.stderr)));
|
|
828
881
|
const reply = await askManager(t.space, t.server, "attach", { name: v.name }, t.auth, reach, undefined, { instanceId: on, expectedTarget: v.expectedTarget });
|
|
829
882
|
if (!reply.ok) {
|
|
830
883
|
if (first && (reply.preSubmitRefusal || reply.nativeOutcome === "not-executed"))
|
|
@@ -1366,7 +1419,7 @@ export async function attachSeat(v, opts) {
|
|
|
1366
1419
|
}
|
|
1367
1420
|
}
|
|
1368
1421
|
async function pickAttach(values) {
|
|
1369
|
-
const census = await readSeats(values, "ps",
|
|
1422
|
+
const census = await readSeats(values, "ps", await managerPin(values, "cotal attach"));
|
|
1370
1423
|
const choices = census.items.map((value) => {
|
|
1371
1424
|
const row = value;
|
|
1372
1425
|
if (!row || typeof row.name !== "string" || typeof row.id !== "string" || typeof row.lifecycleUid !== "string")
|
|
@@ -1400,6 +1453,12 @@ export async function attach(args) {
|
|
|
1400
1453
|
const v = { ...args.values, name: name ?? selection.name, ...(selection ? { on: selection.on } : {}) };
|
|
1401
1454
|
const reconnecting = v["no-reconnect"] !== true;
|
|
1402
1455
|
const on = v.on !== undefined ? await pinForTarget(v, "cotal attach") : undefined;
|
|
1456
|
+
// A typed pin the registry does not list is refused at once, as stop refuses it.
|
|
1457
|
+
if (selection === undefined && on !== undefined) {
|
|
1458
|
+
const reader = await resolveControlTarget(v, "control-caller-privileged", on);
|
|
1459
|
+
if (!reader.auth.bearer)
|
|
1460
|
+
await refuseUnregisteredManager(reader.space, reader.server, reader.auth, on);
|
|
1461
|
+
}
|
|
1403
1462
|
const verdict = await attachSeat({ space: v.space, server: v.server, creds: v.creds, name: v.name, ...(selection ? { expectedTarget: selection.expectedTarget } : {}) }, { reconnect: reconnecting, onRefusal: "exit", on });
|
|
1404
1463
|
if (verdict.kind === "failed")
|
|
1405
1464
|
throw new CommandFailure("failed", "OPERATION_FAILED", verdict.message);
|
|
@@ -1440,13 +1499,19 @@ export async function input(args) {
|
|
|
1440
1499
|
const parsed = inputArguments(args);
|
|
1441
1500
|
const v = { ...args.values, ...parsed };
|
|
1442
1501
|
const on = await pinForTarget(v, "cotal input");
|
|
1502
|
+
// A typed pin the registry does not list is refused at once, as stop refuses it.
|
|
1503
|
+
if (v.on !== undefined && on !== undefined) {
|
|
1504
|
+
const reader = await resolveControlTarget(v, "control-caller-privileged", on);
|
|
1505
|
+
if (!reader.auth.bearer)
|
|
1506
|
+
await refuseUnregisteredManager(reader.space, reader.server, reader.auth, on);
|
|
1507
|
+
}
|
|
1443
1508
|
const t = await resolveControlTarget(v, "control-caller-admin", on);
|
|
1444
1509
|
recordOperationSpace(t.space);
|
|
1445
1510
|
const reach = t.auth.bearer ? "owner" : "any";
|
|
1446
1511
|
const reply = await askManager(t.space, t.server, "input", { name: v.name, text: v.text, enter: v["no-enter"] !== true }, t.auth, reach, undefined, { instanceId: on });
|
|
1447
1512
|
const target = { space: t.space, managerInstanceId: reply.managerInstanceId ?? on ?? null, agent: v.name };
|
|
1448
1513
|
if (!reply.ok)
|
|
1449
|
-
throw managerFailure(reply, "terminal input", target);
|
|
1514
|
+
throw unansweredDescribeRefusal(reply, "terminal input", target) ?? managerFailure(reply, "terminal input", target);
|
|
1450
1515
|
const data = reply.data;
|
|
1451
1516
|
if (!data || typeof data.name !== "string" || typeof data.bytes !== "number" || !Number.isSafeInteger(data.bytes) || data.bytes < 0)
|
|
1452
1517
|
throw new CommandFailure("unknown", "OPERATION_UNKNOWN", "the manager answered, but the terminal-input receipt was unreadable; the text was not sent again", { target, ...(reply.request ? { native: { detail: { request: reply.request } } } : {}) });
|