@cotal-ai/cli 0.90.1 → 0.92.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 +20 -0
- package/dist/chat/controller.d.ts.map +1 -0
- package/dist/chat/controller.js +132 -0
- package/dist/chat/controller.js.map +1 -0
- package/dist/chat/engine.d.ts +110 -0
- package/dist/chat/engine.d.ts.map +1 -0
- package/dist/chat/engine.js +224 -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 +166 -0
- package/dist/chat/frontend.js.map +1 -0
- package/dist/chat/native-session.d.ts +93 -0
- package/dist/chat/native-session.d.ts.map +1 -0
- package/dist/chat/native-session.js +389 -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 +35 -0
- package/dist/chat/picker.d.ts.map +1 -0
- package/dist/chat/picker.js +99 -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 +249 -0
- package/dist/chat/plain.js.map +1 -0
- package/dist/chat/session.d.ts +222 -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 +35 -0
- package/dist/chat/stdio-io.d.ts.map +1 -0
- package/dist/chat/stdio-io.js +176 -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 +401 -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 +217 -0
- package/dist/chat/view.d.ts.map +1 -0
- package/dist/chat/view.js +433 -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 +395 -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 +506 -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 +93 -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 +30 -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 +78 -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 +123 -32
- 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 +270 -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 +384 -117
- package/dist/commands/down.js.map +1 -1
- package/dist/commands/endpoint-authoring.d.ts +6 -0
- package/dist/commands/endpoint-authoring.d.ts.map +1 -0
- package/dist/commands/endpoint-authoring.js +130 -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 +74 -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 +437 -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 +127 -0
- package/dist/commands/reset-space-apply.js.map +1 -0
- package/dist/commands/reset-store-apply.d.ts +35 -0
- package/dist/commands/reset-store-apply.d.ts.map +1 -0
- package/dist/commands/reset-store-apply.js +216 -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 +155 -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 +413 -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 +107 -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 +164 -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 +386 -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 +394 -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 +81 -21
- package/dist/commands/spawn.d.ts.map +1 -1
- package/dist/commands/spawn.js +254 -107
- package/dist/commands/spawn.js.map +1 -1
- package/dist/commands/stack-down.d.ts +20 -0
- package/dist/commands/stack-down.d.ts.map +1 -0
- package/dist/commands/stack-down.js +313 -0
- package/dist/commands/stack-down.js.map +1 -0
- package/dist/commands/stack-up.d.ts +154 -0
- package/dist/commands/stack-up.d.ts.map +1 -0
- package/dist/commands/stack-up.js +498 -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 +244 -5
- package/dist/commands/status.d.ts.map +1 -1
- package/dist/commands/status.js +1044 -407
- 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 +728 -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 +146 -6
- package/dist/commands/up.d.ts.map +1 -1
- package/dist/commands/up.js +1123 -131
- package/dist/commands/up.js.map +1 -1
- package/dist/commands/update.d.ts +13 -0
- package/dist/commands/update.d.ts.map +1 -1
- package/dist/commands/update.js +90 -22
- 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 +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +446 -119
- 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 +41 -1
- package/dist/lib/backup-artifact.d.ts.map +1 -1
- package/dist/lib/backup-artifact.js +96 -22
- package/dist/lib/backup-artifact.js.map +1 -1
- package/dist/lib/broker-service.d.ts +19 -0
- package/dist/lib/broker-service.d.ts.map +1 -0
- package/dist/lib/broker-service.js +369 -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/confirmation-required.d.ts +13 -0
- package/dist/lib/confirmation-required.d.ts.map +1 -0
- package/dist/lib/confirmation-required.js +10 -0
- package/dist/lib/confirmation-required.js.map +1 -0
- 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 +29 -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 +44 -23
- 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 +23 -0
- package/dist/lib/endpoint-client.d.ts.map +1 -0
- package/dist/lib/endpoint-client.js +46 -0
- package/dist/lib/endpoint-client.js.map +1 -0
- package/dist/lib/endpoint-errors.d.ts +20 -0
- package/dist/lib/endpoint-errors.d.ts.map +1 -0
- package/dist/lib/endpoint-errors.js +46 -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 +202 -0
- package/dist/lib/reset-space-plan.js.map +1 -0
- package/dist/lib/restore.d.ts +13 -1
- package/dist/lib/restore.d.ts.map +1 -1
- package/dist/lib/restore.js +73 -11
- 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 +139 -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 +146 -0
- package/dist/lib/service-process.d.ts.map +1 -0
- package/dist/lib/service-process.js +862 -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/shown-time.d.ts +5 -0
- package/dist/lib/shown-time.d.ts.map +1 -0
- package/dist/lib/shown-time.js +9 -0
- package/dist/lib/shown-time.js.map +1 -0
- 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 +166 -0
- package/dist/lib/stack-journal.d.ts.map +1 -0
- package/dist/lib/stack-journal.js +421 -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/stdout-owner.d.ts +17 -0
- package/dist/lib/stdout-owner.d.ts.map +1 -0
- package/dist/lib/stdout-owner.js +44 -0
- package/dist/lib/stdout-owner.js.map +1 -0
- 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 +3 -0
- package/dist/lib/up-report.d.ts.map +1 -1
- package/dist/lib/up-report.js +4 -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/managed-handoff.d.ts +3 -0
- package/dist/managed-handoff.d.ts.map +1 -1
- package/dist/managed-handoff.js +5 -0
- package/dist/managed-handoff.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 +10 -2
- package/dist/ui.d.ts.map +1 -1
- package/dist/ui.js +28 -6
- 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 +132 -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
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { registry } from "@cotal-ai/core";
|
|
2
|
-
import { extensionProvides, loadExtensionsManifest } from "@cotal-ai/workspace";
|
|
3
|
-
import { c } from "../ui.js";
|
|
2
|
+
import { extensionProvides, jsonFlag, loadExtensionsManifest, plainFlag, presentationOf, writeResult } from "@cotal-ai/workspace";
|
|
4
3
|
import { OFFICIAL_RUNTIMES, materializeExtension } from "../ext-loader.js";
|
|
4
|
+
export const runtimesFlags = [jsonFlag, plainFlag];
|
|
5
5
|
/**
|
|
6
6
|
* `cotal runtimes` — the agent runtimes the manager can spawn agents through: the built-in `pty`,
|
|
7
7
|
* the official providers (installed, or one `cotal ext add` away), and any custom installed provider.
|
|
@@ -9,44 +9,80 @@ import { OFFICIAL_RUNTIMES, materializeExtension } from "../ext-loader.js";
|
|
|
9
9
|
* actually reachable on this machine BEFORE selecting one with `up`/`spawn --runtime <name>` — no
|
|
10
10
|
* silent fallback: an unreachable runtime is shown as such, and requesting it later fails loud.
|
|
11
11
|
*/
|
|
12
|
-
export async function runtimes() {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
const providers = new Map();
|
|
17
|
-
for (const ext of loadExtensionsManifest().extensions)
|
|
18
|
-
for (const ref of extensionProvides(ext))
|
|
19
|
-
if (ref.kind === "runtime")
|
|
20
|
-
providers.set(ref.name, ext.pkg);
|
|
21
|
-
for (const ext of registry.all())
|
|
22
|
-
if (ext.kind === "runtime" && !providers.has(ext.name))
|
|
23
|
-
providers.set(ext.name, undefined);
|
|
24
|
-
const rows = [{ name: "pty", state: c.dim("built in") }];
|
|
12
|
+
export async function runtimes(args) {
|
|
13
|
+
const presentation = presentationOf(args.values);
|
|
14
|
+
const providers = runtimeProviders();
|
|
15
|
+
const items = [{ name: "pty", state: "built-in", package: null, reachable: null, error: null }];
|
|
25
16
|
// Officials first in a stable order, then any custom (non-official) installed/registered provider.
|
|
26
17
|
// `pty` is the built-in row above; a stray extension advertising `runtime:pty` must not add a second,
|
|
27
18
|
// unusable row (both preflightRuntime and the manager's createRuntime special-case pty and never
|
|
28
19
|
// resolve such a provider).
|
|
29
20
|
const names = [...Object.keys(OFFICIAL_RUNTIMES), ...[...providers.keys()].filter((name) => name !== "pty" && !(name in OFFICIAL_RUNTIMES))];
|
|
30
21
|
for (const name of names) {
|
|
31
|
-
if (providers.has(name)) {
|
|
32
|
-
const pkg = providers.get(name) ?? OFFICIAL_RUNTIMES[name];
|
|
33
|
-
let reach;
|
|
34
|
-
try {
|
|
35
|
-
const provider = await materializeExtension({ kind: "runtime", name });
|
|
36
|
-
reach = provider.available() ? c.green("reachable") : c.yellow("unreachable");
|
|
37
|
-
}
|
|
38
|
-
catch (e) {
|
|
39
|
-
reach = c.red(`load failed: ${e.message}`);
|
|
40
|
-
}
|
|
41
|
-
rows.push({ name, state: `${c.dim("installed ·")} ${reach}${pkg ? c.dim(` ${pkg}`) : ""}` });
|
|
42
|
-
}
|
|
43
|
-
else {
|
|
22
|
+
if (!providers.has(name)) {
|
|
44
23
|
// Official but not installed: one `cotal ext add` away.
|
|
45
|
-
|
|
24
|
+
items.push({ name, state: "not-installed", package: OFFICIAL_RUNTIMES[name] ?? null, reachable: null, error: null });
|
|
25
|
+
continue;
|
|
26
|
+
}
|
|
27
|
+
const pkg = providers.get(name) ?? OFFICIAL_RUNTIMES[name] ?? null;
|
|
28
|
+
try {
|
|
29
|
+
const provider = await materializeExtension({ kind: "runtime", name });
|
|
30
|
+
items.push({ name, state: "installed", package: pkg, reachable: provider.available(), error: null });
|
|
31
|
+
}
|
|
32
|
+
catch (e) {
|
|
33
|
+
items.push({ name, state: "installed", package: pkg, reachable: null, error: e.message });
|
|
46
34
|
}
|
|
47
35
|
}
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
|
|
36
|
+
const failed = items.filter((row) => row.error !== null);
|
|
37
|
+
writeResult(presentation, {
|
|
38
|
+
command: "runtimes",
|
|
39
|
+
target: null,
|
|
40
|
+
result: { items },
|
|
41
|
+
completeness: failed.length ? "partial" : "complete",
|
|
42
|
+
warnings: failed.map((row) => ({ code: "RUNTIME_LOAD_FAILED", target: { runtime: row.name }, message: `${row.name}: load failed: ${row.error}` })),
|
|
43
|
+
...(failed.length ? { partial: { message: `${failed.length} installed runtime provider${failed.length === 1 ? "" : "s"} could not be loaded`, remedy: "reinstall it with `cotal ext add <package>`" } } : {}),
|
|
44
|
+
}, runtimesView);
|
|
45
|
+
}
|
|
46
|
+
/** Name → owning package, for every runtime provider an installed extension advertises (read from
|
|
47
|
+
* the manifest; no import yet). A provider already registered in core (a library build) has no
|
|
48
|
+
* package name. */
|
|
49
|
+
export function runtimeProviders() {
|
|
50
|
+
const providers = new Map();
|
|
51
|
+
for (const ext of loadExtensionsManifest().extensions)
|
|
52
|
+
for (const ref of extensionProvides(ext))
|
|
53
|
+
if (ref.kind === "runtime")
|
|
54
|
+
providers.set(ref.name, ext.pkg);
|
|
55
|
+
for (const ext of registry.all())
|
|
56
|
+
if (ext.kind === "runtime" && !providers.has(ext.name))
|
|
57
|
+
providers.set(ext.name, undefined);
|
|
58
|
+
return providers;
|
|
59
|
+
}
|
|
60
|
+
function stateCell(row) {
|
|
61
|
+
if (row.state === "built-in")
|
|
62
|
+
return { text: "built in", tone: "hint", mark: "●" };
|
|
63
|
+
if (row.state === "not-installed")
|
|
64
|
+
return { text: "not installed", tone: "hint", mark: "○" };
|
|
65
|
+
// The load error itself follows the report as a warning, so the row keeps to the state.
|
|
66
|
+
if (row.error !== null)
|
|
67
|
+
return { text: "installed · load failed", tone: "failed", mark: "●" };
|
|
68
|
+
return row.reachable ? { text: "installed · reachable", tone: "ok", mark: "●" } : { text: "installed · unreachable", tone: "waiting", mark: "●" };
|
|
69
|
+
}
|
|
70
|
+
function runtimesView(result) {
|
|
71
|
+
return {
|
|
72
|
+
sections: [
|
|
73
|
+
{
|
|
74
|
+
title: "Agent runtimes",
|
|
75
|
+
blocks: [{
|
|
76
|
+
kind: "table",
|
|
77
|
+
columns: [{ key: "name", label: "Runtime" }, { key: "state", label: "State" }, { key: "package", label: "Extension" }],
|
|
78
|
+
rows: result.items.map((row) => ({ name: row.name, state: stateCell(row), package: { text: row.package ?? "included with Cotal", tone: "hint" } })),
|
|
79
|
+
}],
|
|
80
|
+
},
|
|
81
|
+
{ title: "Next", blocks: [{ kind: "commands", items: [
|
|
82
|
+
{ command: "cotal setup", description: "Choose the runtimes you want to set up" },
|
|
83
|
+
...(result.items.some((item) => item.state === "not-installed") ? [{ command: "cotal ext add <package>", description: "Install a runtime extension directly" }] : []),
|
|
84
|
+
] }] },
|
|
85
|
+
],
|
|
86
|
+
};
|
|
51
87
|
}
|
|
52
88
|
//# sourceMappingURL=runtimes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtimes.js","sourceRoot":"","sources":["../../src/commands/runtimes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"runtimes.js","sourceRoot":"","sources":["../../src/commands/runtimes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAyE,MAAM,gBAAgB,CAAC;AACjH,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,sBAAsB,EAAE,SAAS,EAAE,cAAc,EAAE,WAAW,EAA4B,MAAM,qBAAqB,CAAC;AAC5J,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAE3E,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,QAAQ,EAAE,SAAS,CAAwC,CAAC;AAa1F;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,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.d.ts
CHANGED
|
@@ -1,10 +1,95 @@
|
|
|
1
1
|
import { type CompletionResult, type ParsedArgs } from "@cotal-ai/core";
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
* One explicit --to, --channel or --role chooses the native delivery mode. The command
|
|
4
|
+
* publishes one body and exits; a stored message is not proof of delivery or completion.
|
|
5
|
+
*/
|
|
6
|
+
export declare const sendFlags: readonly [{
|
|
7
|
+
readonly name: "space";
|
|
8
|
+
readonly short: "s";
|
|
9
|
+
readonly type: "string";
|
|
10
|
+
readonly value: "<s>";
|
|
11
|
+
readonly description: "target space (default: the resolved mesh)";
|
|
12
|
+
}, {
|
|
13
|
+
readonly name: "server";
|
|
14
|
+
readonly type: "string";
|
|
15
|
+
readonly value: "<url>";
|
|
16
|
+
readonly description: "broker URL (overrides the mesh registry entry)";
|
|
17
|
+
}, {
|
|
18
|
+
readonly name: "creds";
|
|
19
|
+
readonly type: "string";
|
|
20
|
+
readonly value: "<path>";
|
|
21
|
+
readonly description: "creds file for an off-registry connection";
|
|
22
|
+
}, {
|
|
23
|
+
readonly name: "json";
|
|
24
|
+
readonly short: "j";
|
|
25
|
+
readonly type: "boolean";
|
|
26
|
+
readonly description: "structured output on stdout";
|
|
27
|
+
}, {
|
|
28
|
+
readonly name: "plain";
|
|
29
|
+
readonly type: "boolean";
|
|
30
|
+
readonly description: "plain line-oriented output";
|
|
31
|
+
}, {
|
|
32
|
+
readonly name: "to";
|
|
33
|
+
readonly short: "t";
|
|
34
|
+
readonly type: "string";
|
|
35
|
+
readonly value: "<agent>";
|
|
36
|
+
readonly description: "send directly to one agent";
|
|
37
|
+
}, {
|
|
38
|
+
readonly name: "channel";
|
|
39
|
+
readonly short: "c";
|
|
40
|
+
readonly type: "string";
|
|
41
|
+
readonly value: "<channel>";
|
|
42
|
+
readonly description: "publish to one channel";
|
|
43
|
+
}, {
|
|
44
|
+
readonly name: "role";
|
|
45
|
+
readonly short: "r";
|
|
46
|
+
readonly type: "string";
|
|
47
|
+
readonly value: "<role>";
|
|
48
|
+
readonly description: "queue for one agent with this role";
|
|
49
|
+
}, {
|
|
50
|
+
readonly name: "file";
|
|
51
|
+
readonly short: "f";
|
|
52
|
+
readonly type: "string";
|
|
53
|
+
readonly value: "<path>";
|
|
54
|
+
readonly description: "read the message body from this UTF-8 file, instead of a positional body";
|
|
55
|
+
}, {
|
|
56
|
+
readonly name: "stdin";
|
|
57
|
+
readonly type: "boolean";
|
|
58
|
+
readonly description: "read the message body from explicit stdin, instead of a positional body";
|
|
59
|
+
}, {
|
|
60
|
+
readonly name: "mention";
|
|
61
|
+
readonly type: "string";
|
|
62
|
+
readonly multiple: true;
|
|
63
|
+
readonly value: "<agent>";
|
|
64
|
+
readonly description: "channel: wake this authorized peer; repeat for several peers";
|
|
65
|
+
}, {
|
|
66
|
+
readonly name: "reply-to";
|
|
67
|
+
readonly type: "string";
|
|
68
|
+
readonly value: "<message-id>";
|
|
69
|
+
readonly description: "direct send: name the message this body answers";
|
|
70
|
+
}, {
|
|
71
|
+
readonly name: "verbose";
|
|
72
|
+
readonly short: "v";
|
|
73
|
+
readonly type: "boolean";
|
|
74
|
+
readonly description: "include the actual sending principal in the receipt";
|
|
75
|
+
}];
|
|
76
|
+
interface SendInput {
|
|
77
|
+
mode: "dm" | "msg" | "ask";
|
|
78
|
+
target: string;
|
|
79
|
+
source: "argument" | "file" | "stdin";
|
|
80
|
+
text?: string;
|
|
81
|
+
}
|
|
82
|
+
/** Resolve the recipient and body-source grammar without reading stdin or opening a connection. */
|
|
83
|
+
export declare function sendArguments(args: ParsedArgs): SendInput;
|
|
84
|
+
/** Read the explicit body once, send once, close the transient sender, then print one receipt. */
|
|
3
85
|
export declare function send(args: ParsedArgs): Promise<void>;
|
|
4
|
-
/** Complete
|
|
5
|
-
* their target from the channels/roles the local persona files declare — never the live broker (a
|
|
6
|
-
* <TAB> stays offline by contract), and fail-closed (a malformed agent file makes the completer
|
|
7
|
-
* decline rather than offer a silently-partial set; see {@link listDeclaredChannels}). `dm` offers
|
|
8
|
-
* nothing: peer presence is live, so it can't be completed offline. */
|
|
86
|
+
/** Complete the declared destination flags from local records only. */
|
|
9
87
|
export declare function sendComplete(argv: string[]): CompletionResult;
|
|
88
|
+
/** Channels/roles declared by the TARGET mesh's personas — `cotal send` and `cotal chat` act on the
|
|
89
|
+
* mesh `--space`/`--server` resolve to, so their completions must come from that mesh's catalog and
|
|
90
|
+
* not from whatever project the operator happens to be standing in. Offline (no probe: a <TAB> never
|
|
91
|
+
* opens the network) and FAIL CLOSED — with no single resolvable target, or a malformed persona
|
|
92
|
+
* file (see `declaredValues`), offer nothing rather than throw into the operator's shell. */
|
|
93
|
+
export declare function declaredFrom(argv: string[], list: (root: string) => string[]): string[];
|
|
94
|
+
export {};
|
|
10
95
|
//# sourceMappingURL=send.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"send.d.ts","sourceRoot":"","sources":["../../src/commands/send.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"send.d.ts","sourceRoot":"","sources":["../../src/commands/send.ts"],"names":[],"mappings":"AAEA,OAAO,EAYL,KAAK,gBAAgB,EACrB,KAAK,UAAU,EAChB,MAAM,gBAAgB,CAAC;AAQxB;;;GAGG;AAEH,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUkB,CAAC;AAmBzC,UAAU,SAAS;IACjB,IAAI,EAAE,IAAI,GAAG,KAAK,GAAG,KAAK,CAAC;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,UAAU,GAAG,MAAM,GAAG,OAAO,CAAC;IACtC,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,mGAAmG;AACnG,wBAAgB,aAAa,CAAC,IAAI,EAAE,UAAU,GAAG,SAAS,CA6BzD;AAkCD,kGAAkG;AAClG,wBAAsB,IAAI,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CA+D1D;AAED,uEAAuE;AACvE,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,gBAAgB,CAO7D;AAED;;;;8FAI8F;AAC9F,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,EAAE,GAAG,MAAM,EAAE,CAWvF"}
|
package/dist/commands/send.js
CHANGED
|
@@ -1,15 +1,27 @@
|
|
|
1
1
|
import { hostname, userInfo } from "node:os";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { completedFlagValue, completingFlagValue
|
|
2
|
+
import { readFileSync } from "node:fs";
|
|
3
|
+
import { resolvePeer, assertValidChannel, assertValidRole, isConcreteChannel, effectiveDeliveryClass, effectiveReplay, readChannelRegistry, AmbiguousPeerError, } from "@cotal-ai/core";
|
|
4
|
+
import { CommandFailure, recordOperationSpace, jsonFlag, plainFlag, presentationOf, writeResult, loadMeshes, resolveMeshTarget, targetFlags } from "@cotal-ai/workspace";
|
|
5
|
+
import { completedFlagValue, completingFlagValue } from "../lib/completion.js";
|
|
6
6
|
import { openTransient } from "../lib/transient.js";
|
|
7
7
|
import { listDeclaredChannels, listDeclaredRoles } from "../lib/personas.js";
|
|
8
8
|
import { mentionsIn } from "../lib/mentions.js";
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
import { offlineRecipientNotice } from "../lib/offline-recipient.js";
|
|
10
|
+
/**
|
|
11
|
+
* One explicit --to, --channel or --role chooses the native delivery mode. The command
|
|
12
|
+
* publishes one body and exits; a stored message is not proof of delivery or completion.
|
|
13
|
+
*/
|
|
14
|
+
export const sendFlags = [
|
|
15
|
+
...targetFlags, jsonFlag, plainFlag,
|
|
16
|
+
{ name: "to", short: "t", type: "string", value: "<agent>", description: "send directly to one agent" },
|
|
17
|
+
{ name: "channel", short: "c", type: "string", value: "<channel>", description: "publish to one channel" },
|
|
18
|
+
{ name: "role", short: "r", type: "string", value: "<role>", description: "queue for one agent with this role" },
|
|
19
|
+
{ name: "file", short: "f", type: "string", value: "<path>", description: "read the message body from this UTF-8 file, instead of a positional body" },
|
|
20
|
+
{ name: "stdin", type: "boolean", description: "read the message body from explicit stdin, instead of a positional body" },
|
|
21
|
+
{ name: "mention", type: "string", multiple: true, value: "<agent>", description: "channel: wake this authorized peer; repeat for several peers" },
|
|
22
|
+
{ name: "reply-to", type: "string", value: "<message-id>", description: "direct send: name the message this body answers" },
|
|
23
|
+
{ name: "verbose", short: "v", type: "boolean", description: "include the actual sending principal in the receipt" },
|
|
24
|
+
];
|
|
13
25
|
/** Derive the one-shot send's display name from the OS login and host, `<login>@<host>` — never
|
|
14
26
|
* from `COTAL_NAME` (#680). `userInfo()` throws on a system with no passwd entry for the uid;
|
|
15
27
|
* let it propagate. No fallback to a fixed literal (per AGENTS.md). */
|
|
@@ -25,122 +37,184 @@ function senderName() {
|
|
|
25
37
|
throw new Error(`cotal send cannot derive a sender name: "${name}" contains a reserved character`);
|
|
26
38
|
return name;
|
|
27
39
|
}
|
|
28
|
-
/**
|
|
29
|
-
export
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
40
|
+
/** Resolve the recipient and body-source grammar without reading stdin or opening a connection. */
|
|
41
|
+
export function sendArguments(args) {
|
|
42
|
+
const values = args.values;
|
|
43
|
+
presentationOf(values);
|
|
44
|
+
const destinations = [];
|
|
45
|
+
if (values.to !== undefined)
|
|
46
|
+
destinations.push({ mode: "dm", target: values.to });
|
|
47
|
+
if (values.channel !== undefined)
|
|
48
|
+
destinations.push({ mode: "msg", target: values.channel });
|
|
49
|
+
if (values.role !== undefined)
|
|
50
|
+
destinations.push({ mode: "ask", target: values.role });
|
|
51
|
+
if (destinations.length !== 1)
|
|
52
|
+
throw new CommandFailure("refused", "USAGE_INVALID", "choose one destination: --to/-t, --channel/-c, or --role/-r");
|
|
53
|
+
const destination = destinations[0];
|
|
54
|
+
destination.target = destination.target.replace(destination.mode === "msg" ? /^#/ : /^@/, "");
|
|
55
|
+
const bodies = Number(args.positionals.length === 1) + Number(values.file !== undefined) + Number(values.stdin === true);
|
|
56
|
+
if (!destination.target.trim() || args.positionals.length > 1 || bodies !== 1 || (args.positionals.length === 1 && !args.positionals[0]?.trim()) || values.file === "")
|
|
57
|
+
throw new CommandFailure("refused", "USAGE_INVALID", "choose exactly one body: a quoted message, --file/-f <path>, or --stdin", { remedy: 'run cotal send -t <agent> "<message>"' });
|
|
58
|
+
try {
|
|
59
|
+
if (destination.mode === "msg") {
|
|
60
|
+
assertValidChannel(destination.target);
|
|
61
|
+
if (!isConcreteChannel(destination.target))
|
|
62
|
+
throw new Error("wildcard publication");
|
|
63
|
+
}
|
|
64
|
+
else if (destination.mode === "ask")
|
|
65
|
+
assertValidRole(destination.target);
|
|
66
|
+
else if (/[\/\u0000-\u001f\u007f]/u.test(destination.target))
|
|
67
|
+
throw new Error("not an agent address");
|
|
35
68
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
const opened = await openTransient(values, senderName());
|
|
39
|
-
if (mode === "dm")
|
|
40
|
-
return dm(opened, rest);
|
|
41
|
-
if (mode === "msg")
|
|
42
|
-
return msg(opened, rest);
|
|
43
|
-
return ask(opened, rest);
|
|
44
|
-
}
|
|
45
|
-
/** `cotal send dm <agent> "<text>"` — one unicast to a peer by name, then exit. */
|
|
46
|
-
async function dm(opened, positionals) {
|
|
47
|
-
const { target, text } = targetAndText(positionals, /^@/);
|
|
48
|
-
if (!target || !text) {
|
|
49
|
-
console.error('usage: cotal send dm <agent> "<text>" [--space <s>] [--server <url>] [--creds <path>]');
|
|
50
|
-
process.exit(1);
|
|
69
|
+
catch {
|
|
70
|
+
throw new CommandFailure("refused", "USAGE_INVALID", destination.mode === "msg" ? "name one concrete channel, without wildcards" : destination.mode === "ask" ? "name one native role token" : "use an agent name or full instance id, not a roster label");
|
|
51
71
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
72
|
+
if (values["reply-to"] !== undefined && (destination.mode !== "dm" || !values["reply-to"].trim() || /[\u0000-\u001f\u007f]/u.test(values["reply-to"])))
|
|
73
|
+
throw new CommandFailure("refused", "USAGE_INVALID", "--reply-to takes a message identifier and requires --to");
|
|
74
|
+
if (values.mention?.length && destination.mode !== "msg")
|
|
75
|
+
throw new CommandFailure("refused", "UNSUPPORTED", "native mention hints belong to channel publications; they do not change a direct or role destination");
|
|
76
|
+
if (values.mention?.some((name) => !name.replace(/^@/, "").trim() || /[\/\u0000-\u001f\u007f]/u.test(name)))
|
|
77
|
+
throw new CommandFailure("refused", "USAGE_INVALID", "each --mention names one agent or full instance id");
|
|
78
|
+
return { ...destination, source: values.file !== undefined ? "file" : values.stdin ? "stdin" : "argument", ...(args.positionals[0] === undefined ? {} : { text: args.positionals[0] }) };
|
|
79
|
+
}
|
|
80
|
+
function bodyOf(input, values) {
|
|
81
|
+
if (input.source === "argument")
|
|
82
|
+
return input.text;
|
|
83
|
+
if (input.source === "stdin" && process.stdin.isTTY)
|
|
84
|
+
throw new CommandFailure("refused", "USAGE_INVALID", "pipe the message to --stdin, or use a quoted body or --file");
|
|
85
|
+
let bytes;
|
|
56
86
|
try {
|
|
57
|
-
|
|
87
|
+
bytes = readFileSync(input.source === "file" ? values.file : 0);
|
|
58
88
|
}
|
|
59
|
-
catch (
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
console.error(c.red(`"${target}" is ambiguous - DM by instance id instead:`));
|
|
63
|
-
for (const cand of e.candidates)
|
|
64
|
-
console.error(c.dim(` ${cand.name} (${cand.status}) ${cand.id}`));
|
|
65
|
-
await ep.stop();
|
|
66
|
-
process.exit(1);
|
|
89
|
+
catch (error) {
|
|
90
|
+
const code = error.code;
|
|
91
|
+
throw new CommandFailure("refused", code === "EACCES" || code === "EPERM" ? "PERMISSION_DENIED" : code === "ENOENT" ? "TARGET_NOT_FOUND" : "USAGE_INVALID", "the explicit message input could not be read");
|
|
67
92
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
process.exit(1);
|
|
93
|
+
let text;
|
|
94
|
+
try {
|
|
95
|
+
text = new TextDecoder("utf-8", { fatal: true, ignoreBOM: true }).decode(bytes);
|
|
72
96
|
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
97
|
+
catch {
|
|
98
|
+
throw new CommandFailure("refused", "USAGE_INVALID", "the message input is not valid UTF-8");
|
|
99
|
+
}
|
|
100
|
+
if (!text.trim())
|
|
101
|
+
throw new CommandFailure("refused", "USAGE_INVALID", "the explicit message input is empty");
|
|
102
|
+
return text;
|
|
77
103
|
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
104
|
+
async function directPeer(ep, space, name) {
|
|
105
|
+
// Presence arrives asynchronously. Never turn a partial name into a fuzzy target.
|
|
106
|
+
for (let attempt = 0; attempt < 20; attempt++) {
|
|
107
|
+
try {
|
|
108
|
+
const peer = resolvePeer(ep.getRoster(), name);
|
|
109
|
+
if (peer)
|
|
110
|
+
return peer;
|
|
111
|
+
}
|
|
112
|
+
catch (error) {
|
|
113
|
+
if (!(error instanceof AmbiguousPeerError))
|
|
114
|
+
throw error;
|
|
115
|
+
throw new CommandFailure("refused", "TARGET_AMBIGUOUS", "several participants have this name; use a full identity", { target: { space, name, candidates: error.candidates } });
|
|
116
|
+
}
|
|
117
|
+
await new Promise((resolve) => setTimeout(resolve, 100));
|
|
84
118
|
}
|
|
85
|
-
|
|
86
|
-
await ep.multicast(text, { channel, mentions: mentionsIn(text) });
|
|
87
|
-
console.log(c.green(`→ #${channel}`) + c.dim(` ${text}`));
|
|
88
|
-
await ep.stop();
|
|
119
|
+
throw new CommandFailure("refused", "TARGET_NOT_FOUND", "no matching participant was found in the authorized presence view", { target: { space, name } });
|
|
89
120
|
}
|
|
90
|
-
/**
|
|
91
|
-
async function
|
|
92
|
-
const
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
121
|
+
/** Read the explicit body once, send once, close the transient sender, then print one receipt. */
|
|
122
|
+
export async function send(args) {
|
|
123
|
+
const input = sendArguments(args);
|
|
124
|
+
const values = args.values;
|
|
125
|
+
const presentation = presentationOf(values);
|
|
126
|
+
const text = bodyOf(input, values);
|
|
127
|
+
const warnings = [];
|
|
128
|
+
const opened = await openTransient(values, senderName(), { throwOnRefusal: true, report: (level) => {
|
|
129
|
+
warnings.push({ code: level === "error" ? "SENDER_CONNECTION_WARNING" : "SENDER_WARNING", target: { destination: input.target }, message: "The transient sender reported a connection or delivery warning; its receipt confirms only the stated storage outcome." });
|
|
130
|
+
} });
|
|
131
|
+
const { ep, space, connection } = opened;
|
|
132
|
+
recordOperationSpace(space);
|
|
133
|
+
const target = { space, mode: input.mode, destination: input.target };
|
|
134
|
+
let receipt;
|
|
135
|
+
let failure;
|
|
136
|
+
try {
|
|
137
|
+
let policy = null;
|
|
138
|
+
if (input.mode === "msg") {
|
|
139
|
+
try {
|
|
140
|
+
// One Direct Get with a static or open credential, as the transient endpoint reads: the
|
|
141
|
+
// default scan's consumer outlives the send by five minutes (#4091). A user bearer has no
|
|
142
|
+
// Direct Get row, so it keeps the scan.
|
|
143
|
+
const registry = await readChannelRegistry({ servers: connection.server, space, ...(connection.bearer ? { bearer: connection.bearer, sentinelCreds: connection.sentinelCreds } : { creds: connection.creds }), directGet: !connection.bearer });
|
|
144
|
+
const config = Object.hasOwn(registry.channels ?? {}, input.target) ? registry.channels[input.target] : undefined;
|
|
145
|
+
policy = { registered: config !== undefined, replay: effectiveReplay(config, registry.defaults), window: config?.replayWindow ?? registry.defaults?.replayWindow ?? null, delivery: effectiveDeliveryClass(config, registry.defaults) };
|
|
146
|
+
if (!policy.registered)
|
|
147
|
+
warnings.push({ code: "CHANNEL_UNREGISTERED", target, message: "Unregistered channel: publication uses the native space policy and does not create channel metadata." });
|
|
148
|
+
}
|
|
149
|
+
catch {
|
|
150
|
+
warnings.push({ code: "CHANNEL_METADATA_NOT_CHECKED", target, message: "Channel metadata could not be read. Only the native publish result establishes whether the post was accepted for storage." });
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
const mentions = input.mode === "msg" ? [...mentionsIn(text)] : [];
|
|
154
|
+
for (const name of values.mention ?? [])
|
|
155
|
+
mentions.push((await directPeer(ep, space, name.replace(/^@/, ""))).card.id);
|
|
156
|
+
const peer = input.mode === "dm" ? await directPeer(ep, space, input.target) : undefined;
|
|
157
|
+
let messageId;
|
|
158
|
+
let sequence = null;
|
|
159
|
+
try {
|
|
160
|
+
if (peer) {
|
|
161
|
+
const { msg, ack } = await ep.unicastAttributed(peer.card.id, text, { replyTo: values["reply-to"] });
|
|
162
|
+
messageId = msg.id;
|
|
163
|
+
sequence = ack.seq;
|
|
164
|
+
if (peer.status === "offline")
|
|
165
|
+
warnings.push({ code: "RECIPIENT_OFFLINE", target, message: offlineRecipientNotice(peer.card.name) });
|
|
166
|
+
}
|
|
167
|
+
else if (input.mode === "ask") {
|
|
168
|
+
const { msg, ack } = await ep.anycastAttributed(input.target, text);
|
|
169
|
+
messageId = msg.id;
|
|
170
|
+
sequence = ack.seq;
|
|
171
|
+
}
|
|
172
|
+
else
|
|
173
|
+
messageId = (await ep.multicast(text, { channel: input.target, mentions })).id;
|
|
174
|
+
}
|
|
175
|
+
catch {
|
|
176
|
+
throw new CommandFailure("unknown", "OPERATION_UNKNOWN", "No storage acknowledgement was established. The message may have been stored; it was not retried.", { target, remedy: "Inspect the destination before sending again. The native publisher did not return a message identifier." });
|
|
177
|
+
}
|
|
178
|
+
receipt = { kind: "send", messageId, sequence, destination: peer?.card.id ?? input.target, sender: { principal: ep.card.id, kind: ep.card.kind }, stored: true, delivery: null, acceptance: null, completion: null, replyListener: false, replyTo: values["reply-to"] ?? null, bodySource: input.source, mentions: [...new Set(mentions)], channelPolicy: policy };
|
|
179
|
+
}
|
|
180
|
+
catch (error) {
|
|
181
|
+
failure = error;
|
|
182
|
+
}
|
|
183
|
+
try {
|
|
184
|
+
await ep.stop();
|
|
185
|
+
}
|
|
186
|
+
catch {
|
|
187
|
+
warnings.push({ code: "SENDER_CLEANUP_NOT_CONFIRMED", target, message: "Transient observer cleanup was not confirmed. This does not change the storage acknowledgement." });
|
|
96
188
|
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
189
|
+
if (failure !== undefined)
|
|
190
|
+
throw failure;
|
|
191
|
+
writeResult(presentation, { command: "send", target, result: receipt, warnings }, (result) => ({ sections: [
|
|
192
|
+
{ title: "Message stored", blocks: [{ kind: "fields", rows: [
|
|
193
|
+
["Space", space], ["To", input.mode === "msg" ? `#${input.target}` : input.mode === "ask" ? `role ${input.target}` : input.target],
|
|
194
|
+
["Message", result.messageId], ...(result.sequence === null ? [] : [["Stored sequence", String(result.sequence)]]),
|
|
195
|
+
["Delivery", "not confirmed"], ...(values.verbose ? [["Sending principal", result.sender.principal], ["Sender kind", result.sender.kind]] : []),
|
|
196
|
+
] }, { kind: "lines", lines: [{ text: "No active reply listener. Storage is not delivery, acceptance or completion.", tone: "hint" }] }] },
|
|
197
|
+
] }));
|
|
101
198
|
}
|
|
102
|
-
/** Complete
|
|
103
|
-
* their target from the channels/roles the local persona files declare — never the live broker (a
|
|
104
|
-
* <TAB> stays offline by contract), and fail-closed (a malformed agent file makes the completer
|
|
105
|
-
* decline rather than offer a silently-partial set; see {@link listDeclaredChannels}). `dm` offers
|
|
106
|
-
* nothing: peer presence is live, so it can't be completed offline. */
|
|
199
|
+
/** Complete the declared destination flags from local records only. */
|
|
107
200
|
export function sendComplete(argv) {
|
|
108
|
-
const flag = completingFlagValue(argv,
|
|
109
|
-
if (flag?.name === "creds")
|
|
201
|
+
const flag = completingFlagValue(argv, sendFlags);
|
|
202
|
+
if (flag?.name === "creds" || flag?.name === "file")
|
|
110
203
|
return { items: [], directive: "default" };
|
|
111
204
|
if (flag?.name === "space")
|
|
112
|
-
return { items: loadMeshes().map((
|
|
113
|
-
if (flag)
|
|
114
|
-
return { items:
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
return {
|
|
118
|
-
items: [
|
|
119
|
-
{ value: "dm", description: "unicast to a peer" },
|
|
120
|
-
{ value: "msg", description: "broadcast to a channel" },
|
|
121
|
-
{ value: "ask", description: "anycast to a role" },
|
|
122
|
-
],
|
|
123
|
-
directive: "nofiles",
|
|
124
|
-
};
|
|
125
|
-
const [mode, ...rest] = positionals;
|
|
126
|
-
if (mode === "msg" && rest.length <= 1)
|
|
127
|
-
return {
|
|
128
|
-
items: declaredFrom(argv, listDeclaredChannels).map((value) => ({ value, description: "declared channel" })),
|
|
129
|
-
directive: "nofiles",
|
|
130
|
-
};
|
|
131
|
-
if (mode === "ask" && rest.length <= 1)
|
|
132
|
-
return {
|
|
133
|
-
items: declaredFrom(argv, listDeclaredRoles).map((value) => ({ value, description: "declared role" })),
|
|
134
|
-
directive: "nofiles",
|
|
135
|
-
};
|
|
205
|
+
return { items: loadMeshes().map((mesh) => ({ value: mesh.space })), directive: "nofiles" };
|
|
206
|
+
if (flag?.name === "channel")
|
|
207
|
+
return { items: declaredFrom(argv, listDeclaredChannels).map((value) => ({ value })), directive: "nofiles" };
|
|
208
|
+
if (flag?.name === "role")
|
|
209
|
+
return { items: declaredFrom(argv, listDeclaredRoles).map((value) => ({ value })), directive: "nofiles" };
|
|
136
210
|
return { items: [], directive: "nofiles" };
|
|
137
211
|
}
|
|
138
|
-
/** Channels/roles declared by the TARGET mesh's personas — `cotal send`
|
|
139
|
-
* `--space`/`--server` resolve to, so
|
|
140
|
-
* from whatever project the operator happens to be standing in. Offline (no probe: a <TAB> never
|
|
212
|
+
/** Channels/roles declared by the TARGET mesh's personas — `cotal send` and `cotal chat` act on the
|
|
213
|
+
* mesh `--space`/`--server` resolve to, so their completions must come from that mesh's catalog and
|
|
214
|
+
* not from whatever project the operator happens to be standing in. Offline (no probe: a <TAB> never
|
|
141
215
|
* opens the network) and FAIL CLOSED — with no single resolvable target, or a malformed persona
|
|
142
216
|
* file (see `declaredValues`), offer nothing rather than throw into the operator's shell. */
|
|
143
|
-
function declaredFrom(argv, list) {
|
|
217
|
+
export function declaredFrom(argv, list) {
|
|
144
218
|
try {
|
|
145
219
|
return list(resolveMeshTarget(process.cwd(), {
|
|
146
220
|
space: completedFlagValue(argv, targetFlags, "space"),
|