@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/spawn.js
CHANGED
|
@@ -3,15 +3,20 @@ import { createHash } from "node:crypto";
|
|
|
3
3
|
import { readFileSync, rmSync, statSync } from "node:fs";
|
|
4
4
|
import { hostname } from "node:os";
|
|
5
5
|
import { join, resolve as resolvePath } from "node:path";
|
|
6
|
-
import { agentFilePath, AgentGrantConflictError, connectorServers, spawnEnvAllow, deprovisionAgent, discardLaunchArtifacts, firstFreeName, isReachable,
|
|
7
|
-
import { agentActorTokenKey, agentCredsKey, agentSecretFilePaths, agentSentinelCredsKey, authDir,
|
|
6
|
+
import { assertValidRole, agentFilePath, AgentGrantConflictError, connectorServers, spawnEnvAllow, deprovisionAgent, discardLaunchArtifacts, firstFreeName, isReachable, reclaimWithChild, loadCotalConfig, modelPolicyRefusal, mintCreds, newIdentity, DEV_OWNER, parseShareSelection, principalKey, mintLifecycleUid, MANAGED_HANDOFF_FILE_ENV, parseManagedLifecycleHandoff, spawnNameError, provisionAgent, provisionAgentDurables, registry, resolveAuthProvider, resolveReadAcl, runAgentBearer, CotalEndpoint, acquireLock, inspectLock, localConsumerClaimPath, transferBucket, writeTransfer, peerLabel, } from "@cotal-ai/core";
|
|
7
|
+
import { CommandFailure, loadLaunchPersonaFile, personaFileReference, PersonaSourceError, inputDisabledByFlag, jsonFlag, plainFlag, presentationOf, renderReport, terminalWidth, writeResult, agentActorTokenKey, agentCredsKey, agentSecretFilePaths, agentSentinelCredsKey, authDir, cachedPreferences, credsFlag, launchFlags, loadMeshes, findMesh, getSpaceAuth, materializeSecretToFile, mergeLaunchOptions, parseLaunchOptions, preflightOrThrow, provenance, resolveAgentType, resolveMeshTarget, resolvePreference, resolveTargetOrThrow, serverFlag, spaceAccountPath, spaceFlag, spaceKey, userAuthStateDir, workspaceSecretStore, refreshRegistrationPolicy, resolveSeatControlTarget, connectUserControlOrExit, userViewAuth, oneLine, recordOperationSpace, } from "@cotal-ai/workspace";
|
|
8
8
|
import { c } from "../ui.js";
|
|
9
9
|
import { liveMeshNames } from "../lib/live-names.js";
|
|
10
|
+
import { displayCmd } from "../lib/self-exec.js";
|
|
10
11
|
import { completedFlagValue, completingFlagValue, hasCompletedFlagValue, positionalsForCompletion } from "../lib/completion.js";
|
|
11
12
|
import { preflightOrExit, resolveTargetOrExit } from "../lib/connect.js";
|
|
12
|
-
import { askManager, failIfNotOk, onInstanceOrExit, resolveControlTarget, START_TIMEOUT_MS, withControlConnection } from "../lib/control.js";
|
|
13
|
+
import { askManager, failIfNotOk, onInstance, onInstanceOrExit, resolveControlTarget, START_TIMEOUT_MS, withControlConnection } from "../lib/control.js";
|
|
13
14
|
import { listDeclaredChannels, listDeclaredRoles, listPersonas } from "../lib/personas.js";
|
|
14
|
-
import {
|
|
15
|
+
import { callerHarness, spawnPersona } from "../lib/spawn-defaults.js";
|
|
16
|
+
import { defaultPersonaFix } from "../lib/default-persona.js";
|
|
17
|
+
import { spawnLaunchPreview } from "./spawn-preview.js";
|
|
18
|
+
import { protectedCredentialReference, readLocalRecordSource } from "../lib/protected-records.js";
|
|
19
|
+
import { attachSeat } from "./agents.js";
|
|
15
20
|
import { extensionNames, materializeExtension } from "../ext-loader.js";
|
|
16
21
|
import { claimManagedHandoff } from "../managed-handoff.js";
|
|
17
22
|
import { checkDialPolicy, checkEnforcement, checkServer, checkUserBundle, persistRemoteUserEntry, probeEnforcement, tlsIntent, userExchangeIssuer, verifyUserExchange, } from "./meshes-add.js";
|
|
@@ -166,7 +171,7 @@ export function spawnComplete(argv) {
|
|
|
166
171
|
const flag = completingFlagValue(argv, spawnFlags);
|
|
167
172
|
if (flag?.name === "space")
|
|
168
173
|
return { items: loadMeshes().map((m) => ({ value: m.space })), directive: "nofiles" };
|
|
169
|
-
if (flag?.name === "agent")
|
|
174
|
+
if (flag?.name === "agent" || flag?.name === "harness")
|
|
170
175
|
return { items: registry.all("connector").map((c) => ({ value: c.name })), directive: "nofiles" };
|
|
171
176
|
if (flag?.name === "role")
|
|
172
177
|
return { items: declaredFrom(argv, listDeclaredRoles).map((value) => ({ value, description: "declared role" })), directive: "nofiles" };
|
|
@@ -183,13 +188,13 @@ export function spawnComplete(argv) {
|
|
|
183
188
|
}
|
|
184
189
|
if (flag && ["subscribe", "allow-subscribe", "allow-publish"].includes(flag.name))
|
|
185
190
|
return { items: declaredFrom(argv, listDeclaredChannels).map((value) => ({ value, description: "declared channel" })), directive: "nofiles" };
|
|
186
|
-
if (flag && ["cwd", "file", "creds"].includes(flag.name))
|
|
191
|
+
if (flag && ["cwd", "file", "creds", "enrollment-file"].includes(flag.name))
|
|
187
192
|
return { items: [], directive: "default" };
|
|
188
193
|
if (flag?.name === "runtime")
|
|
189
194
|
return { items: ["pty", ...extensionNames("runtime")].filter((value, i, all) => all.indexOf(value) === i).map((value) => ({ value })), directive: "nofiles" };
|
|
190
195
|
const positionals = positionalsForCompletion(argv, spawnFlags);
|
|
191
196
|
// Only the first word after `spawn` is the persona positional; once it's typed, defer to the shell.
|
|
192
|
-
if (positionals.length <= 1 && !hasCompletedFlagValue(argv, spawnFlags, "config")) {
|
|
197
|
+
if (positionals.length <= 1 && !hasCompletedFlagValue(argv, spawnFlags, "config") && !hasCompletedFlagValue(argv, spawnFlags, "file")) {
|
|
193
198
|
try {
|
|
194
199
|
return { items: personaItems(argv), directive: "nofiles" };
|
|
195
200
|
}
|
|
@@ -224,10 +229,7 @@ function declaredFrom(argv, list) {
|
|
|
224
229
|
return [];
|
|
225
230
|
}
|
|
226
231
|
}
|
|
227
|
-
|
|
228
|
-
export function spawnPersonaRef(configFlag, positionals, env = process.env) {
|
|
229
|
-
return configFlag ?? positionals[0] ?? defaultPersonaRef("default", env);
|
|
230
|
-
}
|
|
232
|
+
export { spawnPersona } from "../lib/spawn-defaults.js";
|
|
231
233
|
/**
|
|
232
234
|
* Auto-number `requested` past any peer already present on the mesh (foo → foo_2 → foo_3) — the same
|
|
233
235
|
* series the manager's spawn funnel uses (firstFreeName). Foreground `cotal spawn` doesn't go through
|
|
@@ -257,8 +259,8 @@ async function provisionFreshForeground(requested, autoName, provision) {
|
|
|
257
259
|
}
|
|
258
260
|
}
|
|
259
261
|
}
|
|
260
|
-
/** `cotal spawn`'s
|
|
261
|
-
*
|
|
262
|
+
/** `cotal spawn`'s grammar: managed launch/attach by default, explicit native foreground,
|
|
263
|
+
* and one positional persona or explicit persona file. Declared `as const` so the values cast
|
|
262
264
|
* below is compile-checked against exactly these specs. Foreground and detached parse the SAME
|
|
263
265
|
* flags — the old `spawn` vs `start` ability drift is structurally gone. */
|
|
264
266
|
export const spawnFlags = [
|
|
@@ -266,16 +268,88 @@ export const spawnFlags = [
|
|
|
266
268
|
serverFlag,
|
|
267
269
|
{ ...credsFlag, description: "control-caller creds for an off-registry manager (--detach only)" },
|
|
268
270
|
...launchFlags,
|
|
269
|
-
{ name: "
|
|
271
|
+
{ name: "harness", short: "H", type: "string", value: "<connector>", description: "application connector; an explicit flag wins over persona and saved defaults" },
|
|
272
|
+
{ name: "foreground", type: "boolean", description: "run the native application directly; terminal exit may end it" },
|
|
273
|
+
{ name: "restarts", type: "string", value: "<n>", description: "maximum manager-supervised restarts in the selected restart window" },
|
|
274
|
+
{ name: "restart-window", type: "string", value: "<ms>", description: "time window for --restarts; both flags are required together" },
|
|
275
|
+
jsonFlag, plainFlag,
|
|
276
|
+
{ name: "detach", type: "boolean", short: "d", description: "launch through the manager, await readiness and return without attaching" },
|
|
270
277
|
{ name: "live-only", type: "boolean", description: "foreground only: skip the durable backstop (no read-ACL row; messages missed while disconnected are not replayed)" },
|
|
271
|
-
{ name: "file", type: "string", short: "f", value: "<
|
|
272
|
-
{ name: "dry-run", type: "boolean", description: "
|
|
278
|
+
{ name: "file", type: "string", short: "f", value: "<persona-file>", description: "persona file on the execution host; never a manifest deploy or implicit upload" },
|
|
279
|
+
{ name: "dry-run", type: "boolean", description: "preview the launch without allocation, provisioning or starting an application" },
|
|
280
|
+
{ name: "enrollment-file", type: "string", value: "<private-file>", description: "with --foreground: protected file holding this one seat's enrollment URL; never print or forward it" },
|
|
273
281
|
{ name: "allow-stale", type: "string", value: "<a,b>", description: "with -f: waive named stale agents (apply-only)" },
|
|
274
282
|
{ name: "runtime", type: "string", value: "<name>", description: "with -f: override the manifest's runtime" },
|
|
275
|
-
{ name: "on", type: "string", value: "<instance>", description: "with --detach:
|
|
283
|
+
{ name: "on", type: "string", value: "<instance>", description: "with --detach: launch through one manager instance, by the id `ps` prints, in a space with several managers; by default any one takes it" },
|
|
276
284
|
{ name: "expect-owner", type: "string", value: "<u_…>", description: `with ${MANAGED_HANDOFF_FILE_ENV}: the owner the managed handoff must carry` },
|
|
277
285
|
{ name: "expect-lifecycle-uid", type: "string", value: "<uid>", description: `with ${MANAGED_HANDOFF_FILE_ENV}: the lifecycle UID the managed handoff must carry` },
|
|
278
286
|
];
|
|
287
|
+
/** Check the public mode and spelling before catalog preparation or identity allocation. */
|
|
288
|
+
export function validateSpawnArguments(args) {
|
|
289
|
+
const values = args.values;
|
|
290
|
+
presentationOf(values);
|
|
291
|
+
const internal = Boolean(process.env[MANAGED_HANDOFF_FILE_ENV] || process.env[ENROLLMENT_URL_ENV] || process.env[ENROLLMENT_FILE_ENV]);
|
|
292
|
+
const direct = values.foreground === true || internal;
|
|
293
|
+
if (values.file !== undefined && (args.positionals.length || values.config !== undefined))
|
|
294
|
+
throw new CommandFailure("refused", "USAGE_INVALID", "choose one positional persona or --file/-f, not multiple explicit persona sources");
|
|
295
|
+
if (!internal && values.config !== undefined)
|
|
296
|
+
throw new CommandFailure("refused", "USAGE_INVALID", "--config is reserved for persisted internal launch callers; use cotal spawn --file <persona-file>");
|
|
297
|
+
if (values.file !== undefined) {
|
|
298
|
+
try {
|
|
299
|
+
personaFileReference(values.file);
|
|
300
|
+
}
|
|
301
|
+
catch (error) {
|
|
302
|
+
throw new CommandFailure("refused", "SCHEMA_INVALID", error.message);
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
if (values.runtime !== undefined || values["allow-stale"] !== undefined)
|
|
306
|
+
throw new CommandFailure("refused", "USAGE_INVALID", "manifest deployment options belong to cotal team deploy <file>, not spawn");
|
|
307
|
+
if (values["enrollment-file"] !== undefined && !values.space)
|
|
308
|
+
throw new CommandFailure("refused", "USAGE_INVALID", "--enrollment-file requires an explicit --space");
|
|
309
|
+
if (values["enrollment-file"] !== undefined && !values.foreground)
|
|
310
|
+
throw new CommandFailure("refused", "UNSUPPORTED", "this native enrollment path runs one foreground seat; use --foreground explicitly. It does not substitute for managed enrollment authority");
|
|
311
|
+
if (values["enrollment-file"] !== undefined && (internal || values.detach || values.creds !== undefined || values.on !== undefined))
|
|
312
|
+
throw new CommandFailure("refused", "USAGE_INVALID", "choose one foreground enrollment source without a manager pin, credential override or internal handoff");
|
|
313
|
+
if (values.harness !== undefined && values.agent !== undefined)
|
|
314
|
+
throw new CommandFailure("refused", "USAGE_INVALID", "choose --harness/-H or the legacy --agent spelling, not both");
|
|
315
|
+
if (values.detach && direct)
|
|
316
|
+
throw new CommandFailure("refused", "USAGE_INVALID", "--detach and direct foreground execution are different launch modes");
|
|
317
|
+
if (values.foreground && ((!values["dry-run"] && (values.json || values.plain)) || values.creds !== undefined || values.on !== undefined))
|
|
318
|
+
throw new CommandFailure("refused", "USAGE_INVALID", "direct --foreground execution takes no structured receipt, manager credential or manager pin");
|
|
319
|
+
if ((values.restarts === undefined) !== (values["restart-window"] === undefined))
|
|
320
|
+
throw new CommandFailure("refused", "USAGE_INVALID", "--restarts and --restart-window must be supplied together");
|
|
321
|
+
if (values.restarts !== undefined) {
|
|
322
|
+
if (direct)
|
|
323
|
+
throw new CommandFailure("refused", "USAGE_INVALID", "restart supervision belongs to a managed launch, not direct foreground execution");
|
|
324
|
+
for (const field of ["restarts", "restart-window"])
|
|
325
|
+
if (!/^[1-9][0-9]*$/.test(values[field]) || !Number.isSafeInteger(Number(values[field])))
|
|
326
|
+
throw new CommandFailure("refused", "USAGE_INVALID", `--${field} must be a positive safe integer`);
|
|
327
|
+
}
|
|
328
|
+
if (values["live-only"] && !direct)
|
|
329
|
+
throw new CommandFailure("refused", "USAGE_INVALID", "--live-only belongs to direct foreground execution");
|
|
330
|
+
if (!values["dry-run"] && !direct && !values.detach && (values.json || values.plain || inputDisabledByFlag() || !process.stdin.isTTY || !process.stdout.isTTY))
|
|
331
|
+
throw new CommandFailure("refused", "USAGE_INVALID", "managed attachment needs usable input and output terminals before an identity is allocated", { remedy: "use cotal spawn -d to wait for readiness without attaching, or --foreground for direct execution" });
|
|
332
|
+
for (const field of ["harness", "agent", "model", "variant", "name"])
|
|
333
|
+
if (values[field] !== undefined && !values[field].trim())
|
|
334
|
+
throw new CommandFailure("refused", "USAGE_INVALID", `--${field} cannot be empty`);
|
|
335
|
+
if (values.events && values["no-events"])
|
|
336
|
+
throw new CommandFailure("refused", "USAGE_INVALID", "choose --events or --no-events, not both");
|
|
337
|
+
if (values.on !== undefined)
|
|
338
|
+
onInstance(values.on, "cotal spawn");
|
|
339
|
+
try {
|
|
340
|
+
parseLaunchOptions(values.opt);
|
|
341
|
+
if (values.role !== undefined)
|
|
342
|
+
assertValidRole(values.role);
|
|
343
|
+
parseShareSelection(values["share-tools"]);
|
|
344
|
+
}
|
|
345
|
+
catch {
|
|
346
|
+
throw new CommandFailure("refused", "USAGE_INVALID", "invalid launch options, native role or tool-sharing selection; use declared keys and unique key=value option pairs");
|
|
347
|
+
}
|
|
348
|
+
if (!internal && args.positionals.length > 1)
|
|
349
|
+
throw new CommandFailure("refused", "USAGE_INVALID", "spawn takes one persona; pass the kickoff request with --prompt/-p");
|
|
350
|
+
if (!internal && values.config !== undefined && args.positionals.length)
|
|
351
|
+
throw new CommandFailure("refused", "USAGE_INVALID", "choose one persona input, not both a positional name and --config");
|
|
352
|
+
}
|
|
279
353
|
/** Foreground `cotal spawn` resolves its `--agent` connector from the registry (spawn.ts below); on
|
|
280
354
|
* the published binary nothing static-imports connectors, so the resolved one is materialized as a
|
|
281
355
|
* required extension (seeded or `ext add`ed), failing loud if absent. The `-f` manifest launch
|
|
@@ -310,31 +384,54 @@ function refuseUnmintableNameOrExit(name, userMode) {
|
|
|
310
384
|
process.exit(1);
|
|
311
385
|
}
|
|
312
386
|
}
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
387
|
+
function managedLaunchView(r) {
|
|
388
|
+
const concrete = [r.name, r.space, r.managerInstanceId].every((value) => /^[A-Za-z0-9_-]+$/.test(value));
|
|
389
|
+
const target = concrete ? `${r.name} --space ${r.space} --on ${r.managerInstanceId}` : "<name> --space <space> --on <manager-instance>";
|
|
390
|
+
return { sections: [
|
|
391
|
+
{ title: "Agent joined", blocks: [
|
|
392
|
+
{ kind: "fields", rows: [["Agent", r.name], ["Identity", r.id], ["Lifecycle", r.lifecycleUid], ["Space", r.space], ["Manager receipt", r.managerInstanceId], ["Original request", r.intent?.requestId ?? r.request?.requestId ?? "not recorded"], ["Accepted goal", r.request?.goalId ?? "not reported"], ["Application", r.harness], ["Runtime", r.runtime], ["Role", r.role ?? "not recorded"], ["Model request", r.requestedModel ?? "persona/manager precedence; not inspected"], ["View", r.detached ? "not attached" : "attaching to the allocated incarnation"]] },
|
|
393
|
+
{ kind: "lines", lines: [{ text: "The manager confirmed presence readiness. This is not proof that the kickoff task completed.", tone: "hint" }] },
|
|
394
|
+
] },
|
|
395
|
+
...(r.detached ? [{ title: "Next", blocks: [{ kind: "commands", items: [
|
|
396
|
+
{ command: `${displayCmd()} attach ${target}`, description: concrete ? "Return to this allocated incarnation's manager" : "Use the full identities recorded above" },
|
|
397
|
+
{ command: `${displayCmd()} status ${target}`, description: "Read the agent's reported state" },
|
|
398
|
+
] }] }] : []),
|
|
399
|
+
] };
|
|
400
|
+
}
|
|
401
|
+
/** Shared managed launch. The manager resolves its persona and returns real readiness before
|
|
402
|
+
* any view opens. Detach changes terminal attachment, not the launch or caller authority. */
|
|
403
|
+
export async function launchManagedPersona(values, positionals, events, launchOptions, observer) {
|
|
317
404
|
// WHICH file the manager loads — the exact foreground precedence (`--config` > positional >
|
|
318
405
|
// `COTAL_DEFAULT_PERSONA` > `default`). Identity is separate:
|
|
319
406
|
// when `--name` is given it OVERRIDES the file's `name:` (foreground's `requested`), threaded
|
|
320
407
|
// as the op's `identity` so it is never silently dropped in detached mode.
|
|
321
|
-
const
|
|
322
|
-
const ref = spawnPersonaRef(values.config, positionals);
|
|
323
|
-
const managerConfigRef = values.config ?? (!positionals[0] && defaultPersona ? ref : undefined);
|
|
324
|
-
const on = onInstanceOrExit(values.on, "cotal spawn <persona> --detach");
|
|
408
|
+
const on = onInstance(values.on, "cotal spawn <persona>");
|
|
325
409
|
// From a managed seat's own shell the launch is the SEAT's, as its `cotal_spawn` tool is: the
|
|
326
410
|
// manager records the seat as the spawner, so the seat can stop the child it asked for (#718).
|
|
327
411
|
// `--on` keeps the pin on that path too.
|
|
328
412
|
const flags = { space: values.space, server: values.server, creds: values.creds };
|
|
329
|
-
const
|
|
330
|
-
|
|
413
|
+
const seatIntent = Boolean(process.env.COTAL_NAME || process.env.COTAL_ID || process.env.COTAL_LIFECYCLE_UID || process.env.COTAL_ACCEPTED_TOKEN);
|
|
414
|
+
if (seatIntent && values.creds !== undefined)
|
|
415
|
+
throw new CommandFailure("refused", "USAGE_INVALID", "a managed seat's child launch uses that seat's own caller, not a --creds override");
|
|
416
|
+
let seat;
|
|
417
|
+
if (seatIntent) {
|
|
418
|
+
try {
|
|
419
|
+
seat = await resolveSeatControlTarget({ ...flags, space: flags.space ?? process.env.COTAL_SPACE }, on);
|
|
420
|
+
}
|
|
421
|
+
catch {
|
|
422
|
+
throw new CommandFailure("refused", "AUTH_REQUIRED", "the launching seat's own credential could not be verified; no operator identity was substituted");
|
|
423
|
+
}
|
|
424
|
+
if (!seat)
|
|
425
|
+
throw new CommandFailure("refused", "UNSUPPORTED", "the managed seat cannot act as itself through this CLI; missing/mismatched caller context and user-auth self impersonation do not fall back to the operator");
|
|
426
|
+
}
|
|
427
|
+
const t = seat ?? await resolveControlTarget(flags, "control-caller-privileged", on, { onRefusal: "throw" });
|
|
428
|
+
recordOperationSpace(t.space);
|
|
331
429
|
let policy;
|
|
332
430
|
try {
|
|
333
431
|
policy = await refreshRegistrationPolicy(t);
|
|
334
432
|
}
|
|
335
|
-
catch
|
|
336
|
-
|
|
337
|
-
process.exit(1);
|
|
433
|
+
catch {
|
|
434
|
+
throw new CommandFailure("refused", "TARGET_UNAVAILABLE", "the selected registration policy could not be observed; no manager launch was submitted");
|
|
338
435
|
}
|
|
339
436
|
// #867: refuse an unmintable identity BEFORE the round trip. On this path the persona is
|
|
340
437
|
// resolved manager-side, so the effective identity is `--name` alone — when it is absent the
|
|
@@ -343,32 +440,37 @@ async function spawnDetached(values, positionals, events, launchOptions) {
|
|
|
343
440
|
refuseUnmintableNameOrExit(values.name, t.mode === "user");
|
|
344
441
|
const eventsRequired = policy?.events === "required";
|
|
345
442
|
if (eventsRequired && events === false) {
|
|
346
|
-
|
|
347
|
-
process.exit(1);
|
|
443
|
+
throw new CommandFailure("refused", "PERMISSION_DENIED", `space "${t.space}" requires the event plane by registration policy; no launch was submitted`);
|
|
348
444
|
}
|
|
349
445
|
provenance.read("mesh", `${t.space} (${t.server})`);
|
|
446
|
+
const { ref, from: personaFrom } = spawnPersona(values.config, positionals, { space: t.space, preferences: cachedPreferences() });
|
|
447
|
+
const managerConfigRef = values.config ?? (personaFrom !== undefined ? ref : undefined);
|
|
448
|
+
const defaultAgent = callerHarness(t.space);
|
|
350
449
|
let resumeAgent;
|
|
351
450
|
let resumeClaim;
|
|
352
451
|
if (values.resume !== undefined) {
|
|
353
452
|
// Without a flag the harness is the persona pin or a default, which only the target manager
|
|
354
453
|
// can read: ask it, so the carry looks with the connector the launch runs (#2899).
|
|
355
|
-
resumeAgent = values.agent ?? await launchAgentOrExit(t, on, { name: ref, config: managerConfigRef, defaultAgent
|
|
454
|
+
resumeAgent = values.agent ?? await launchAgentOrExit(t, on, { name: ref, config: managerConfigRef, defaultAgent });
|
|
356
455
|
resumeClaim = await carryTranscriptOrExit(flags, on, values.resume, resumeAgent);
|
|
357
456
|
}
|
|
457
|
+
console.error(renderReport({ space: t.space, sections: [{ title: "Managed launch", blocks: [{ kind: "fields", rows: [["Space", t.space], ["Manager selector", on ?? t.auth.managerInstanceId ?? "native class selection"], ["Persona", ref], ["File source", managerConfigRef ? `${managerConfigRef} · manager execution host` : "selected manager's persona catalog"], ["File transfer", "none"]] }, { kind: "lines", lines: [{ text: "The accepting manager validates its own visible file before allocation. No local file is uploaded, and a pin never selects a replacement manager.", tone: "hint" }] }] }] }, presentationOf(values) === "plain" ? "plain" : "rich", terminalWidth(process.stderr)));
|
|
358
458
|
console.error(c.dim("waiting for it to join the mesh (the manager replies on a real outcome - join, exit, or ~30s) …"));
|
|
359
459
|
const reply = await askManager(t.space, t.server, "start", {
|
|
360
460
|
name: ref,
|
|
361
461
|
identity: values.name,
|
|
362
462
|
role: values.role,
|
|
363
|
-
// #869: keep an explicit `--agent` and the invoking operator's COTAL_DEFAULT_AGENT
|
|
364
|
-
// fields. Collapsing them made the
|
|
365
|
-
// persona pin; dropping
|
|
366
|
-
// environment differed. The manager applies flag > file >
|
|
463
|
+
// #869: keep an explicit `--agent` and the invoking operator's default (COTAL_DEFAULT_AGENT or a
|
|
464
|
+
// saved harness preference) in separate fields. Collapsing them made the default
|
|
465
|
+
// indistinguishable from a flag, so it beat the persona pin; dropping it instead changed detached
|
|
466
|
+
// semantics whenever the manager's own environment differed. The manager applies flag > file >
|
|
467
|
+
// caller default > manager default.
|
|
367
468
|
agent: values.agent,
|
|
368
|
-
defaultAgent
|
|
469
|
+
defaultAgent,
|
|
369
470
|
config: managerConfigRef,
|
|
370
471
|
model: values.model,
|
|
371
472
|
variant: values.variant,
|
|
473
|
+
...(values.restarts !== undefined ? { supervise: { restarts: Number(values.restarts), windowMs: Number(values["restart-window"]) } } : {}),
|
|
372
474
|
launchOptions,
|
|
373
475
|
cwd: values.cwd,
|
|
374
476
|
resume: values.resume, // host-local session id; the manager preflights connector resume support
|
|
@@ -386,12 +488,46 @@ async function spawnDetached(values, positionals, events, launchOptions) {
|
|
|
386
488
|
// readiness backstop) — the start request must outlive that window, not the 5s op default.
|
|
387
489
|
// `--on <instance>` pins the spawn to that exact manager instance (P2 item 3 multi-manager).
|
|
388
490
|
}, t.auth, "owner", START_TIMEOUT_MS, { instanceId: on });
|
|
389
|
-
|
|
491
|
+
const target = { space: t.space, managerInstanceId: reply.managerInstanceId ?? on ?? null, managerEpoch: reply.managerEpoch ?? null, ...(reply.intent ? { requestId: reply.intent.requestId, requestedGoalId: reply.intent.requestedGoalId ?? null } : {}), ...(reply.request ? { acceptedGoalId: reply.request.goalId ?? null } : {}) };
|
|
492
|
+
if (!reply.ok) {
|
|
493
|
+
const refusal = { "permission-denied": "PERMISSION_DENIED", "unauthenticated": "AUTH_REQUIRED", "not-found": "TARGET_NOT_FOUND", "unavailable": "TARGET_UNAVAILABLE", "bad-request": "SCHEMA_INVALID", "failed-precondition": "LIFECYCLE_BLOCKED", "already-exists": "CONFLICT", "unimplemented": "UNSUPPORTED" };
|
|
494
|
+
const code = reply.code === undefined ? undefined : refusal[reply.code];
|
|
495
|
+
const native = { code: reply.code, outcome: reply.nativeOutcome, ...(reply.request || reply.intent ? { detail: { request: reply.request ?? null, intent: reply.intent ?? null, observation: reply.observationCause ?? null } } : {}) };
|
|
496
|
+
if (reply.nativeOutcome === "not-executed" && code)
|
|
497
|
+
throw new CommandFailure("refused", code, reply.error ? oneLine(reply.error) : "the manager refused the launch before execution", { target, native, remedy: "nothing was launched; fix what the manager reported, then run the spawn again" });
|
|
498
|
+
const unknown = reply.nativeOutcome !== "executed" || reply.unanswered;
|
|
499
|
+
throw new CommandFailure(unknown ? "unknown" : "failed", unknown ? "OPERATION_UNKNOWN" : "OPERATION_FAILED", reply.error ? oneLine(reply.error) : "the manager did not confirm launch readiness", { target, native, remedy: "inspect cotal ps and the selected manager before retrying; this launch was not submitted again" });
|
|
500
|
+
}
|
|
390
501
|
const d = reply.data;
|
|
391
|
-
if (d.
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
502
|
+
if (!d || typeof d.name !== "string" || typeof d.id !== "string" || typeof d.lifecycleUid !== "string" || typeof d.agent !== "string" || typeof d.mode !== "string" || !reply.managerInstanceId)
|
|
503
|
+
throw new CommandFailure("partial", "OPERATION_PARTIAL", "the manager reported a successful launch but did not supply the identity and manager needed for a safe handoff", { target, changed: [{ kind: "managed-launch", readinessReported: true }], remedy: "inspect cotal ps before doing anything else; do not relaunch" });
|
|
504
|
+
const result = { kind: "managed-launch", name: d.name, id: d.id, lifecycleUid: d.lifecycleUid, space: t.space, managerInstanceId: reply.managerInstanceId, harness: d.agent, runtime: d.mode, role: d.role ?? null, request: reply.request ?? null, intent: reply.intent ?? null, readiness: "joined", requestedModel: values.model ?? null, detached: values.detach === true };
|
|
505
|
+
const presentation = presentationOf(values);
|
|
506
|
+
const warnings = d.eventsNotice ? [{ code: "EVENT_PLANE_NOTICE", target, message: d.eventsNotice }] : [];
|
|
507
|
+
if (observer) {
|
|
508
|
+
try {
|
|
509
|
+
observer.ready(result, warnings);
|
|
510
|
+
}
|
|
511
|
+
catch {
|
|
512
|
+
throw new CommandFailure("partial", "OPERATION_PARTIAL", "the agent joined, but the composite command could not record its native readiness; no replacement was launched", { target, changed: [result], remedy: "inspect the original agent and manager before another launch" });
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
else
|
|
516
|
+
writeResult(presentation, { command: "spawn", target, result, warnings }, managedLaunchView);
|
|
517
|
+
if (values.detach)
|
|
518
|
+
return;
|
|
519
|
+
let verdict;
|
|
520
|
+
try {
|
|
521
|
+
verdict = await attachSeat({ space: t.space, server: t.server, creds: values.creds, name: d.name, expectedTarget: { id: d.id, lifecycleUid: d.lifecycleUid }, asSeat: seat !== undefined }, { on: reply.managerInstanceId, reconnect: true, onRefusal: "throw" });
|
|
522
|
+
}
|
|
523
|
+
catch {
|
|
524
|
+
throw new CommandFailure("partial", "OPERATION_PARTIAL", "the agent joined, but its terminal could not be attached; it was not relaunched", { target, changed: [result], remedy: "use cotal ps and attach to the recorded agent and manager" });
|
|
525
|
+
}
|
|
526
|
+
if (verdict.kind === "failed")
|
|
527
|
+
throw new CommandFailure("partial", "OPERATION_PARTIAL", "the agent joined, but attachment did not complete; no replacement was launched", { target, changed: [result], native: { detail: { message: verdict.message } }, remedy: "inspect the original agent and reattach; do not relaunch" });
|
|
528
|
+
if (verdict.kind === "gone" && observer)
|
|
529
|
+
throw new CommandFailure("partial", "OPERATION_PARTIAL", "the agent joined, but its exact native terminal was unavailable before setup could open the view; no replacement was launched", { target, changed: [result], remedy: "inspect the original lifecycle and manager before another startup" });
|
|
530
|
+
console.error(renderReport({ sections: [{ title: verdict.kind === "gone" ? "Attach target unavailable" : verdict.reason === "detached" ? "Detached" : "Attach session ended", blocks: [{ kind: "fields", rows: [["Agent", d.name], ["Identity", d.id], ["Manager", reply.managerInstanceId]] }, { kind: "lines", lines: [{ text: "Leaving the view sent no stop request. The original lifecycle was not replaced.", tone: "hint" }] }] }] }, "rich", terminalWidth(process.stderr)));
|
|
395
531
|
}
|
|
396
532
|
/** The harness the manager's `spawn` resolves for this persona, read with the same fields `start` sends. */
|
|
397
533
|
async function launchAgentOrExit(t, on, fields) {
|
|
@@ -425,6 +561,7 @@ async function carryTranscriptOrExit(flags, on, id, agent) {
|
|
|
425
561
|
const bytes = readFileSync(found.path);
|
|
426
562
|
const sha256 = createHash("sha256").update(bytes).digest("hex");
|
|
427
563
|
const t = await resolveControlTarget(flags, "control-caller-admin", on);
|
|
564
|
+
recordOperationSpace(t.space);
|
|
428
565
|
const bucket = transferBucket(t.space, on);
|
|
429
566
|
const writer = await transferWriterOrExit(flags, t, on, sha256);
|
|
430
567
|
let sent = 0;
|
|
@@ -469,13 +606,9 @@ async function transferWriterOrExit(flags, t, instanceId, hex) {
|
|
|
469
606
|
return { creds: await mintCreds(t.spaceAuth, newIdentity(), "transfer-writer", { transferWriter: { instanceId, hex } }), tls: t.auth.tls };
|
|
470
607
|
}
|
|
471
608
|
/**
|
|
472
|
-
* `cotal spawn <
|
|
473
|
-
*
|
|
474
|
-
*
|
|
475
|
-
* With `--detach` the manager spawns it into a detached PTY you `cotal attach` to;
|
|
476
|
-
* otherwise `cotal spawn` hands THIS terminal straight to the agent: run it in your
|
|
477
|
-
* shell, or inside a cmux/tmux pane, and the real Claude TUI takes over. One grammar,
|
|
478
|
-
* two run modes.
|
|
609
|
+
* `cotal spawn [<persona>] [--file <persona-file>]` launches through the manager and attaches
|
|
610
|
+
* to its allocated incarnation. `--detach` returns after readiness; `--foreground` explicitly
|
|
611
|
+
* runs the native application in this terminal. File validation belongs to that execution host.
|
|
479
612
|
*
|
|
480
613
|
* The launch recipe is the connector's `buildLaunch` (the single source of truth,
|
|
481
614
|
* shared with the manager); only *how the spec runs* differs — foreground exec
|
|
@@ -488,17 +621,39 @@ async function transferWriterOrExit(flags, t, instanceId, hex) {
|
|
|
488
621
|
*/
|
|
489
622
|
export async function spawn(args) {
|
|
490
623
|
const positionals = args.positionals;
|
|
491
|
-
|
|
624
|
+
validateSpawnArguments(args);
|
|
625
|
+
const values = { ...args.values, ...(typeof args.values.harness === "string" ? { agent: args.values.harness } : {}), ...(typeof args.values.file === "string" ? { config: personaFileReference(args.values.file) } : {}) };
|
|
626
|
+
if (values["dry-run"])
|
|
627
|
+
return spawnLaunchPreview({ ...args, values });
|
|
492
628
|
// Claimed first: custody already removed the file and its variable, so the text lives only here
|
|
493
629
|
// and no refusal below can leave it anywhere.
|
|
494
630
|
const handoffText = claimManagedHandoff();
|
|
495
631
|
let enrollmentUrl;
|
|
496
632
|
try {
|
|
497
|
-
|
|
633
|
+
if (values["enrollment-file"] !== undefined) {
|
|
634
|
+
const path = resolvePath(values["enrollment-file"]);
|
|
635
|
+
protectedCredentialReference(path);
|
|
636
|
+
const bytes = readLocalRecordSource(path, 256 * 1024, true);
|
|
637
|
+
if (!bytes)
|
|
638
|
+
throw new CommandFailure("refused", "TARGET_NOT_FOUND", "the enrollment input file was not found; no enrollment was redeemed");
|
|
639
|
+
let source;
|
|
640
|
+
try {
|
|
641
|
+
source = new TextDecoder("utf-8", { fatal: true }).decode(bytes);
|
|
642
|
+
}
|
|
643
|
+
catch {
|
|
644
|
+
throw new CommandFailure("refused", "SCHEMA_INVALID", "the private enrollment file is not valid UTF-8; its contents were not echoed");
|
|
645
|
+
}
|
|
646
|
+
enrollmentUrl = stripTrailingNewline(source);
|
|
647
|
+
if (!enrollmentUrl)
|
|
648
|
+
throw new CommandFailure("refused", "SCHEMA_INVALID", "the private enrollment file is empty");
|
|
649
|
+
}
|
|
650
|
+
else
|
|
651
|
+
enrollmentUrl = enrollmentInput();
|
|
498
652
|
}
|
|
499
653
|
catch (e) {
|
|
500
|
-
|
|
501
|
-
|
|
654
|
+
if (e instanceof CommandFailure)
|
|
655
|
+
throw e;
|
|
656
|
+
throw new CommandFailure("refused", "SCHEMA_INVALID", "the one-seat enrollment source could not be read; its contents were not echoed and no enrollment was redeemed");
|
|
502
657
|
}
|
|
503
658
|
finally {
|
|
504
659
|
// The URL is the credential. Keep the local value, but remove both input forms before this
|
|
@@ -522,7 +677,7 @@ export async function spawn(args) {
|
|
|
522
677
|
process.exit(1);
|
|
523
678
|
}
|
|
524
679
|
try {
|
|
525
|
-
|
|
680
|
+
loadLaunchPersonaFile(resolvePath(values.config));
|
|
526
681
|
}
|
|
527
682
|
catch (e) {
|
|
528
683
|
console.error(c.red(`✗ cannot load the managed handoff persona: ${e.message}`));
|
|
@@ -555,7 +710,7 @@ export async function spawn(args) {
|
|
|
555
710
|
process.exit(1);
|
|
556
711
|
}
|
|
557
712
|
}
|
|
558
|
-
if (enrollmentUrl &&
|
|
713
|
+
if (enrollmentUrl && values.detach) {
|
|
559
714
|
console.error(c.red(`✗ ${ENROLLMENT_URL_ENV}/${ENROLLMENT_FILE_ENV} apply only to a foreground persona spawn`));
|
|
560
715
|
process.exit(1);
|
|
561
716
|
}
|
|
@@ -563,6 +718,7 @@ export async function spawn(args) {
|
|
|
563
718
|
console.error(c.red(`✗ ${ENROLLMENT_URL_ENV}/${ENROLLMENT_FILE_ENV} require --space <s>`));
|
|
564
719
|
process.exit(1);
|
|
565
720
|
}
|
|
721
|
+
const direct = values.foreground === true || handoffText !== undefined || enrollmentUrl !== undefined;
|
|
566
722
|
const enrollmentBootstrap = Boolean(enrollmentUrl && values.space && !findMesh(values.space));
|
|
567
723
|
if (enrollmentBootstrap) {
|
|
568
724
|
if (!values.config || (!values.config.includes("/") && !values.config.includes("\\") && !values.config.endsWith(".md"))) {
|
|
@@ -570,33 +726,19 @@ export async function spawn(args) {
|
|
|
570
726
|
process.exit(1);
|
|
571
727
|
}
|
|
572
728
|
try {
|
|
573
|
-
|
|
729
|
+
loadLaunchPersonaFile(resolvePath(values.config));
|
|
574
730
|
}
|
|
575
731
|
catch (e) {
|
|
576
732
|
console.error(c.red(`✗ cannot load the enrollment bootstrap persona: ${e.message}`));
|
|
577
733
|
process.exit(1);
|
|
578
734
|
}
|
|
579
735
|
}
|
|
580
|
-
//
|
|
581
|
-
//
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
// manager class queue (`spawnManifest` takes no instance). Both would have to ignore the flag;
|
|
585
|
-
// an ignored pin is a silent fallback, so refuse it where it cannot apply, as `--dry-run` is.
|
|
586
|
-
if (values.on !== undefined && (!values.detach || values.file)) {
|
|
587
|
-
console.error(c.red("✗ --on only applies to a detached imperative spawn (`cotal spawn <persona> --detach --on <instance>`); a foreground spawn has no manager to pin and a manifest deploy (-f) launches through the manager class queue"));
|
|
736
|
+
// Explicit files retain the execution host's path semantics. A manager pin is meaningful for
|
|
737
|
+
// either managed persona spelling; direct execution has no manager placement to select.
|
|
738
|
+
if (values.on !== undefined && direct) {
|
|
739
|
+
console.error(c.red("✗ --on pins a managed imperative launch; direct --foreground does not take that manager selector"));
|
|
588
740
|
process.exit(1);
|
|
589
741
|
}
|
|
590
|
-
if (values.file) {
|
|
591
|
-
await spawnManifest(values.file, {
|
|
592
|
-
dryRun: Boolean(values["dry-run"]),
|
|
593
|
-
server: values.server,
|
|
594
|
-
space: values.space,
|
|
595
|
-
runtime: values.runtime,
|
|
596
|
-
allowStale: splitFlag(values["allow-stale"]),
|
|
597
|
-
});
|
|
598
|
-
return;
|
|
599
|
-
}
|
|
600
742
|
// `--resume ""` / `--resume=` means the operator asked to resume but named no session — fail loud
|
|
601
743
|
// rather than silently spawn a fresh one (no fallbacks). An absent flag (undefined) is fine.
|
|
602
744
|
if (values.resume !== undefined && !values.resume.trim()) {
|
|
@@ -611,12 +753,6 @@ export async function spawn(args) {
|
|
|
611
753
|
console.error("--variant needs a variant name (got an empty value)");
|
|
612
754
|
process.exit(1);
|
|
613
755
|
}
|
|
614
|
-
// `--dry-run` is a manifest-only flag (`-f`): on an imperative spawn it would have to be ignored
|
|
615
|
-
// (and once WAS, silently spawning a real agent) — refuse instead.
|
|
616
|
-
if (values["dry-run"]) {
|
|
617
|
-
console.error(c.red("✗ --dry-run only applies to a manifest deploy (`cotal spawn -f <manifest> --dry-run`)"));
|
|
618
|
-
process.exit(1);
|
|
619
|
-
}
|
|
620
756
|
// Parse `--opt k=v` pairs once, up front — a malformed pair fails loud before either launch path
|
|
621
757
|
// (foreground or detached) does any work. The opaque map is core-agnostic; the connector validates.
|
|
622
758
|
let cliLaunchOptions;
|
|
@@ -640,12 +776,11 @@ export async function spawn(args) {
|
|
|
640
776
|
// an explicit true from a non-admin caller as operator reach and serves an omission unarmed
|
|
641
777
|
// with a notice, so an unconditional default-true would be refused for an ordinary actor.
|
|
642
778
|
const events = values.events ? true : values["no-events"] ? false : undefined;
|
|
643
|
-
//
|
|
644
|
-
//
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
}
|
|
779
|
+
// Managed by default; the persona remains on the manager's execution host. Direct foreground
|
|
780
|
+
// execution keeps its separate native custody path below.
|
|
781
|
+
if (!direct)
|
|
782
|
+
return launchManagedPersona(values, positionals, events, cliLaunchOptions);
|
|
783
|
+
console.error(renderReport({ sections: [{ title: "Direct application", blocks: [{ kind: "lines", lines: ["This is native foreground execution, not a detachable Cotal view.", { text: "Native exit, Ctrl-C or terminal loss may end this process. No crash or reboot survival is promised.", tone: "hint" }] }] }] }, "rich", terminalWidth(process.stderr)));
|
|
649
784
|
// `--creds` names a CONTROL-CALLER credential (reach an off-registry manager) — meaningless for
|
|
650
785
|
// a foreground launch, which provisions the agent's own creds. Fail loud, never ignore.
|
|
651
786
|
if (values.creds) {
|
|
@@ -712,19 +847,20 @@ export async function spawn(args) {
|
|
|
712
847
|
const launchEvents = eventsRequired || events !== false;
|
|
713
848
|
const { space, server, auth } = target;
|
|
714
849
|
const composition = { injected: false, root: target.root };
|
|
715
|
-
|
|
716
|
-
// Where the config lives: --config, else the positional <persona>, else COTAL_DEFAULT_PERSONA
|
|
850
|
+
// Where the config lives: --config, else the positional <persona>, else the persona preference
|
|
717
851
|
// (.cotal/agents/<name>.md under the TARGET mesh's root). With none, fall back to its `default`
|
|
718
852
|
// persona — `cotal spawn` with no args launches `<root>/.cotal/agents/default.md`.
|
|
719
|
-
const ref =
|
|
853
|
+
const { ref, from: personaFrom } = spawnPersona(values.config, positionals, { space, preferences: cachedPreferences() });
|
|
720
854
|
const path = redeemedEnrollment && values.config ? resolvePath(values.config) : agentFilePath(target.root, ref);
|
|
721
855
|
let def;
|
|
722
856
|
try {
|
|
723
|
-
def =
|
|
857
|
+
def = loadLaunchPersonaFile(path);
|
|
724
858
|
}
|
|
725
859
|
catch (e) {
|
|
860
|
+
if (e instanceof PersonaSourceError)
|
|
861
|
+
throw new CommandFailure("refused", "SCHEMA_INVALID", e.message, { target: { space, path }, remedy: "use cotal team deploy <file> for a Mesh manifest; use a native persona file for spawn" });
|
|
726
862
|
const code = e.code;
|
|
727
|
-
const fromEnv =
|
|
863
|
+
const fromEnv = personaFrom === undefined ? "" : ` from ${personaFrom}`;
|
|
728
864
|
// The not-found text names the mesh's space and server, which for a handoff are its values.
|
|
729
865
|
if (handoffText !== undefined) {
|
|
730
866
|
console.error(c.red(`✗ cannot load the managed handoff persona: ${e.message}`));
|
|
@@ -741,8 +877,10 @@ export async function spawn(args) {
|
|
|
741
877
|
// Name the absolute directory checked and the mesh that root came from: the two facts that
|
|
742
878
|
// make the disagreement visible in one read.
|
|
743
879
|
const where = `${target.personaRoot} (mesh "${target.space}" at ${target.server}${target.source === "current" ? ", your current mesh" : target.source === "registry" ? ", the only mesh running" : ""})`;
|
|
744
|
-
|
|
745
|
-
|
|
880
|
+
const fix = defaultPersonaFix(target);
|
|
881
|
+
const write = fix.cwd ? `run \`${fix.command}\` in ${fix.cwd} to write one` : `create one with \`${fix.command}\``;
|
|
882
|
+
console.error(c.red(ref === "default" && personaFrom === undefined
|
|
883
|
+
? `✗ no default persona in ${where} - ${write}, or name a persona: \`cotal spawn <name>\``
|
|
746
884
|
: `✗ no persona "${ref}"${fromEnv} in ${where} - pass a catalog name, or use \`--config <path>\` for a file elsewhere`));
|
|
747
885
|
}
|
|
748
886
|
else {
|
|
@@ -750,7 +888,7 @@ export async function spawn(args) {
|
|
|
750
888
|
}
|
|
751
889
|
process.exit(1);
|
|
752
890
|
}
|
|
753
|
-
// Provenance: say which persona file WON resolution (--config > positional >
|
|
891
|
+
// Provenance: say which persona file WON resolution (--config > positional > preference > default)
|
|
754
892
|
// — the user must never wonder which directory their agent's definition came from.
|
|
755
893
|
provenance.read("persona", path);
|
|
756
894
|
// --name / --role override the file (name defaults from the file's frontmatter).
|
|
@@ -803,7 +941,7 @@ export async function spawn(args) {
|
|
|
803
941
|
// User mode allocates during guarded provisioning below, without a static operator credential.
|
|
804
942
|
// Static/open mode keeps its advisory roster check. Every launch field uses the allocated name.
|
|
805
943
|
let name = target.mode === "user" ? requested : await uniqueMeshName(requested, { space, server, auth });
|
|
806
|
-
const agentType = resolveAgentType({ flag: values.agent, pin: def.agent });
|
|
944
|
+
const agentType = resolveAgentType({ flag: values.agent, pin: def.agent, callerDefault: callerHarness(space) });
|
|
807
945
|
// Materialize the connector HERE, after the authoritative persona load (#869): the harness choice
|
|
808
946
|
// (flag > persona pin > env > default) is only final once the target root has supplied the file.
|
|
809
947
|
// On the published binary nothing static-imports connectors, so this import-from-manifest is what
|
|
@@ -1477,6 +1615,8 @@ async function provisionUserForeground(target, name, ref, opts) {
|
|
|
1477
1615
|
label: ref,
|
|
1478
1616
|
lifecycleUid: opts.lifecycleUid,
|
|
1479
1617
|
fresh: true,
|
|
1618
|
+
// A foreground launch has no manager; its row says so.
|
|
1619
|
+
custody: { kind: "foreground" },
|
|
1480
1620
|
});
|
|
1481
1621
|
ownedToken = grant.actorToken;
|
|
1482
1622
|
const prov = new CotalEndpoint({
|