@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
package/dist/commands/doctor.js
CHANGED
|
@@ -1,232 +1,200 @@
|
|
|
1
|
-
import { existsSync,
|
|
1
|
+
import { existsSync, readdirSync } from "node:fs";
|
|
2
2
|
import { hostname } from "node:os";
|
|
3
3
|
import { basename, join } from "node:path";
|
|
4
4
|
import { credentialLifetime, CotalEndpoint, inspectCredHealth, mintCreds, mintLifecycleUid, newIdentity, probeConnect, } from "@cotal-ai/core";
|
|
5
|
-
import { agentCredsDir, authDir, CONNECTION_EVICTOR_CREDS_KIND, DELIVERY_CREDS_KIND, findCotalRoot, getSoleSpaceAuth, getSpaceAuth, hasUserAuthState, legacyRenewalRecord, MEMBERSHIP_OBSERVER_CREDS_KIND, MEMBERSHIP_RW_CREDS_KIND, MeshTargetError, migrateLegacyCotalMaterial, preflightTarget,
|
|
5
|
+
import { CommandFailure, accountInventory, canonicalRoot, isCommandFailure, jsonFlag, plainFlag, presentationOf, readLocalRecordSource, renewalRecordPath, writeResult, agentCredsDir, authDir, CONNECTION_EVICTOR_CREDS_KIND, DELIVERY_CREDS_KIND, findCotalRoot, getSoleSpaceAuth, getSpaceAuth, hasUserAuthState, legacyRenewalRecord, MEMBERSHIP_OBSERVER_CREDS_KIND, MEMBERSHIP_RW_CREDS_KIND, MeshTargetError, migrateLegacyCotalMaterial, preflightTarget, remintDaemonCreds, resolveMeshTarget, spaceAccountPath, staleSystemCreds, workspaceSecretStore, writeRenewalRecord, recordOperationSpace, } from "@cotal-ai/workspace";
|
|
6
6
|
import { displayCmd } from "../lib/self-exec.js";
|
|
7
7
|
import { RESPONDER_UNBOUND_CONSEQUENCE } from "../lib/delivery-responder.js";
|
|
8
|
-
|
|
9
|
-
export const doctorFlags = [
|
|
8
|
+
export const doctorFlags = [jsonFlag, plainFlag,
|
|
10
9
|
{ name: "fix", type: "boolean", description: "execute the safe repairs (re-sign the manager-remintable daemon creds; needs the local signer)" },
|
|
11
10
|
{ name: "space", type: "string", description: "target space on a multi-space root (default: the sole space)" },
|
|
12
11
|
];
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
12
|
+
export function validateDoctorArguments(args) {
|
|
13
|
+
presentationOf(args.values);
|
|
14
|
+
if (args.positionals.length !== 1 || args.positionals[0] !== "auth")
|
|
15
|
+
throw new CommandFailure("refused", "USAGE_INVALID", "use doctor auth [--fix] [--space <space>] [--json|--plain]");
|
|
16
|
+
}
|
|
17
|
+
/** Local credential observations only; native repair remains an explicit, separately labeled phase. */
|
|
19
18
|
export async function doctor(args) {
|
|
20
|
-
|
|
21
|
-
if (sub !== "auth") {
|
|
22
|
-
console.error(`usage: ${displayCmd()} doctor auth [--fix] [--space <s>] - credential-health diagnosis + repair for this folder's mesh`);
|
|
23
|
-
process.exitCode = 1;
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
19
|
+
validateDoctorArguments(args);
|
|
26
20
|
const values = args.values;
|
|
27
21
|
const root = findCotalRoot(process.cwd());
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
return;
|
|
22
|
+
const repair = { requested: values.fix === true, attempted: false, authority: null, results: [], migrationAttempted: false, migrations: [], coordinationCleanup: "not-opened" };
|
|
23
|
+
if (!values.space) {
|
|
24
|
+
// Several valid accounts are a target the caller picks with --space, not an inventory that failed
|
|
25
|
+
// validation. An unreadable or corrupt inventory still refuses as SCHEMA_INVALID below.
|
|
26
|
+
let spaces = [];
|
|
27
|
+
try {
|
|
28
|
+
const inventory = accountInventory(authDir(root));
|
|
29
|
+
if (!inventory.corrupt.length)
|
|
30
|
+
spaces = inventory.spaces;
|
|
38
31
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
32
|
+
catch { /* refused by the read below */ }
|
|
33
|
+
if (spaces.length > 1)
|
|
34
|
+
throw new CommandFailure("refused", "TARGET_AMBIGUOUS", `this root holds accounts for ${spaces.length} spaces (${spaces.join(", ")}); doctor auth diagnoses one space`, { target: { root, space: null, candidates: spaces }, remedy: `pass --space with one of ${spaces.join(", ")}` });
|
|
35
|
+
}
|
|
36
|
+
let auth;
|
|
37
|
+
try {
|
|
38
|
+
auth = values.space ? await getSpaceAuth(workspaceSecretStore(root), values.space) : await getSoleSpaceAuth(workspaceSecretStore(root), authDir(root));
|
|
39
|
+
}
|
|
40
|
+
catch {
|
|
41
|
+
throw new CommandFailure("refused", "SCHEMA_INVALID", "the local authority inventory could not be validated; no repair was attempted", { target: { root, space: values.space ?? null } });
|
|
42
|
+
}
|
|
43
|
+
if (!auth) {
|
|
44
|
+
if (values.fix || values.space)
|
|
45
|
+
throw new CommandFailure("refused", "AUTH_REQUIRED", "no validated signing trust for the named local diagnostic scope is present; no open mode or broader authority was inferred", { target: { root, space: values.space ?? null } });
|
|
46
|
+
writeResult(presentationOf(values), { command: "doctor auth", target: { root }, result: { kind: "credential-health", root, space: null, localFindings: null, credentialScope: "not-established", brokerAuthorization: "not-checked", repair }, completeness: "not-checked", partial: { message: "No local static authority was established. This is not proof of an open or healthy mesh.", remedy: "run `cotal doctor auth` in a space's root folder; `cotal space` lists each space's root" } }, () => ({ sections: [{ title: "Local credential scope not established", blocks: [{ kind: "fields", rows: [["Root", root], ["Space", "not established"], ["Live authorization", "not checked"], ["Repair", "not requested"]] }] }] }));
|
|
42
47
|
return;
|
|
43
48
|
}
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
49
|
+
const target = { root, space: auth.space };
|
|
50
|
+
let reports;
|
|
51
|
+
let userMode;
|
|
52
|
+
try {
|
|
53
|
+
userMode = hasUserAuthState(root, auth.space, { readOnly: true });
|
|
54
|
+
if (values.fix && userMode)
|
|
55
|
+
throw new CommandFailure("refused", "UNSUPPORTED", "this static daemon repair cannot replace a user-auth space's supported issuer authority", { target });
|
|
56
|
+
repair.migrationAttempted = values.fix === true;
|
|
57
|
+
reports = inventory(root, auth.space, auth.sys.pub, !values.fix, (receipt) => repair.migrations.push(receipt));
|
|
58
|
+
if (values.fix && reports.some((row) => row.problem && isRemintable(row.kind)))
|
|
59
|
+
await repairDoctorCredentials(root, auth, repair);
|
|
60
|
+
if (repair.attempted)
|
|
61
|
+
reports = inventory(root, auth.space, auth.sys.pub, true);
|
|
62
|
+
}
|
|
63
|
+
catch (error) {
|
|
64
|
+
const changed = [...repair.migrations.map((receipt) => ({ kind: "credential-material-migrated", materialKind: receipt.kind, from: receipt.from, to: receipt.to, space: receipt.space })), ...repair.results.filter((row) => row.ok).map((row) => ({ kind: "daemon-credential-resigned", file: row.file, space: auth.space }))];
|
|
65
|
+
if (isCommandFailure(error) && !repair.attempted && !repair.migrations.length)
|
|
66
|
+
throw error;
|
|
67
|
+
if (changed.length)
|
|
68
|
+
throw new CommandFailure("partial", "OPERATION_PARTIAL", "native local credential material changed, but the final diagnostic/audit or coordination cleanup was not confirmed", { target, changed, remedy: "inspect the original local files and renewal owner; do not respawn agents or rotate the system account as an automatic substitute" });
|
|
69
|
+
throw new CommandFailure(repair.attempted || repair.migrationAttempted ? "unknown" : "failed", repair.attempted || repair.migrationAttempted ? "OPERATION_UNKNOWN" : "OPERATION_FAILED", repair.attempted || repair.migrationAttempted ? "the native daemon repair outcome is unconfirmed; no re-sign was retried" : "local credential observations could not be completed; raw credential and parser diagnostics were not printed", { target });
|
|
70
|
+
}
|
|
71
|
+
const renewal = renewalObservation(root, auth.space);
|
|
72
|
+
const items = reports.map((row) => ({
|
|
73
|
+
label: row.label, kind: row.kind, path: row.path, state: row.superseded ? "superseded-local-file" : row.health?.state ?? "not-provisioned-here",
|
|
74
|
+
issuedAt: Number.isFinite(row.health?.iat) ? row.health.iat : null,
|
|
75
|
+
expiresAt: Number.isFinite(row.health?.exp) ? row.health.exp : null,
|
|
76
|
+
renewAt: Number.isFinite(row.health?.renewAt) ? row.health.renewAt : null,
|
|
77
|
+
problem: row.health?.state === "unreadable" ? "credential parsing failed; raw diagnostic omitted" : row.problem ?? null,
|
|
78
|
+
repair: row.repair ?? null, superseded: row.superseded === true,
|
|
79
|
+
}));
|
|
80
|
+
const findings = items.filter((row) => row.problem !== null).length;
|
|
81
|
+
const refused = renewal.state === "present" && renewal.brokerAcceptance === "recorded-refusal";
|
|
82
|
+
const incomplete = renewal.state === "unreadable";
|
|
83
|
+
const result = { kind: "credential-health", root, space: auth.space, mode: userMode ? "user" : "static", scope: "local credential claims and recorded renewal only", items, findings, renewal, repair, brokerAuthorization: "not-checked", liveAgentHealth: "not-checked", systemAccountRotated: false, agentCredentialsReminted: false };
|
|
84
|
+
// A recorded refusal names the renewal owner to repair, so the finding keeps its next step.
|
|
85
|
+
const failure = incomplete ? new CommandFailure("partial", "OPERATION_PARTIAL", "credential observations were collected but the renewal record is unreadable; a complete healthy verdict was not inferred", { target }) : findings || refused ? new CommandFailure(repair.results.some((row) => row.ok) || repair.migrations.length ? "partial" : "failed", repair.results.some((row) => row.ok) || repair.migrations.length ? "OPERATION_PARTIAL" : "OPERATION_FAILED", refused ? "the recorded renewal was not broker-accepted; local re-signing alone cannot clear that finding" : "local credential findings remain; per-file native repair guidance is retained", { target, ...(refused ? { remedy: "start or repair this space's manager, the renewal owner, so it re-signs the daemon credentials and the broker accepts them; do not respawn agents for this finding" } : {}) }) : undefined;
|
|
86
|
+
writeResult(presentationOf(values), { command: "doctor auth", target, result, completeness: incomplete ? "partial" : "complete", failure, noOp: failure === undefined && values.fix === true && !repair.attempted && !repair.migrations.length }, (data) => ({ sections: [
|
|
87
|
+
{ title: data.findings || refused || incomplete ? "Credential findings" : "No local credential findings", blocks: [
|
|
88
|
+
{ kind: "fields", rows: [["Root", data.root], ["Space", data.space], ["Mode", data.mode], ["Scope", data.scope], ["Current broker authorization", { text: "not checked", tone: "waiting" }], ["Live agent health", { text: "not checked", tone: "waiting" }], ["Repair requested", data.repair.requested ? "yes" : "no"], ["Acknowledged local migrations", String(data.repair.migrations.length)], ["Repair coordination", data.repair.authority ?? "not used"]] },
|
|
89
|
+
{ kind: "lines", lines: [{ text: "Credential expiry/claim inspection is not live broker acceptance, daemon adoption, process health or task progress. Locally ordered superseded files are not proof that their successor is connected. No agent was respawned and no system account was rotated.", tone: "hint" }] },
|
|
90
|
+
] },
|
|
91
|
+
{ title: "Local credential files", blocks: [
|
|
92
|
+
{ kind: "table", columns: [{ key: "name", label: "Credential" }, { key: "state", label: "Local state" }, { key: "issued", label: "Issued" }, { key: "expiry", label: "Expiry" }], rows: data.items.slice(0, 200).map((row) => ({ name: row.label, state: row.state, issued: at(row.issuedAt ?? undefined), expiry: at(row.expiresAt ?? undefined) })) },
|
|
93
|
+
...(data.items.length > 200 ? [{ kind: "lines", lines: [`${data.items.length - 200} credential rows are not shown; JSON retains every public diagnostic row.`] }] : []),
|
|
94
|
+
] },
|
|
95
|
+
{ title: "Recorded renewal", blocks: [{ kind: "fields", rows: [["Record", data.renewal.state], ["Recorded time", data.renewal.recordedAt ?? "not established"], ["Recorded owner", data.renewal.recordedOwner ?? "not established"], ["Broker acceptance at that pass", data.renewal.brokerAcceptance], ["Recorded coordination", data.renewal.authority ?? "not recorded"], ["Delivery responder at that pass", data.renewal.deliveryResponderUnbound ? "reported unbound" : "not established by this view"]] }, ...(data.renewal.deliveryResponderUnbound ? [{ kind: "lines", lines: [RESPONDER_UNBOUND_CONSEQUENCE, "Repair the original delivery responder and inspect status; do not respawn agents merely because a responder was absent at that recorded pass."] }] : []),
|
|
96
|
+
// The leftover root-scoped record is named, never read as this space's verdict.
|
|
97
|
+
...("legacyRecordPresent" in data.renewal && data.renewal.legacyRecordPresent ? [{ kind: "lines", lines: [`This root also holds .cotal/renewal.json, a pre-per-space renewal record. It names no space, so it is not read as this space's verdict. ${displayCmd()} clean all --force removes it when this root is reset.`] }] : [])] },
|
|
98
|
+
...(data.items.some((row) => row.problem !== null || row.superseded) ? [{ title: "Inspect before changing identities", blocks: [{ kind: "table", columns: [{ key: "name", label: "Credential" }, { key: "finding", label: "Finding" }, { key: "next", label: "Native guidance" }], rows: data.items.filter((row) => row.problem !== null || row.superseded).slice(0, 200).map((row) => ({ name: row.label, finding: row.problem ?? "superseded in local credential family; not a broken-agent verdict", next: row.repair ?? "inspect the original file and authority" })) }] }] : []),
|
|
99
|
+
] }));
|
|
100
|
+
}
|
|
101
|
+
async function repairDoctorCredentials(root, auth, observed) {
|
|
102
|
+
let target;
|
|
103
|
+
try {
|
|
104
|
+
target = resolveMeshTarget(root, { space: auth.space, readOnly: true });
|
|
105
|
+
recordOperationSpace(target.space);
|
|
106
|
+
if (target.mode !== "auth" || canonicalRoot(target.root) !== canonicalRoot(root) || target.auth?.account.pub !== auth.account.pub)
|
|
107
|
+
throw new CommandFailure("refused", "CONFLICT", "the resolved repair target differs from this local static authority; no broader root or auth mode was substituted");
|
|
108
|
+
const preflight = await preflightTarget(target);
|
|
109
|
+
if (!preflight.ok) {
|
|
110
|
+
if (preflight.kind.includes("creds") || preflight.kind === "stale-auth")
|
|
111
|
+
throw new CommandFailure("refused", "AUTH_REQUIRED", "the selected broker's authenticated preflight failed; it was not called an offline repair target");
|
|
112
|
+
target = undefined;
|
|
75
113
|
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
registerPresence: false,
|
|
95
|
-
watchPresence: false,
|
|
96
|
-
watchChannels: false,
|
|
97
|
-
card: { id: id.id, name: "doctor-auth-fix", kind: "endpoint" },
|
|
98
|
-
});
|
|
99
|
-
ep.on("error", () => { });
|
|
114
|
+
}
|
|
115
|
+
catch (error) {
|
|
116
|
+
if (error instanceof MeshTargetError && ["unknown-space", "no-meshes", "not-started"].includes(error.code))
|
|
117
|
+
target = undefined;
|
|
118
|
+
else
|
|
119
|
+
throw error;
|
|
120
|
+
}
|
|
121
|
+
const prior = renewalObservation(root, auth.space);
|
|
122
|
+
if (prior.state === "unreadable")
|
|
123
|
+
throw new CommandFailure("refused", "SCHEMA_INVALID", "the prior renewal record is unreadable; a possible broker refusal was not overwritten");
|
|
124
|
+
let results;
|
|
125
|
+
const retain = (rows) => { observed.results = rows.map((row) => ({ file: row.file, ok: row.ok === true, skipped: row.skipped !== undefined })); };
|
|
126
|
+
if (target) {
|
|
127
|
+
const uid = mintLifecycleUid(), identity = newIdentity();
|
|
128
|
+
const ep = new CotalEndpoint({ space: target.space, servers: target.server, tls: target.tlsRequired, creds: await mintCreds(auth, identity, "supervisor", { lifecycleUid: uid }), lifecycleUid: uid, channels: [], consume: false, registerPresence: false, watchPresence: false, watchChannels: false, card: { id: identity.id, name: "doctor-auth-fix", kind: "endpoint" } });
|
|
129
|
+
ep.on("error", () => { });
|
|
130
|
+
let held = false;
|
|
131
|
+
try {
|
|
100
132
|
await ep.start();
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
133
|
+
held = await ep.holdDaemonRenewalLease(`doctor:${hostname()}:${process.pid}`);
|
|
134
|
+
if (!held)
|
|
135
|
+
throw new CommandFailure("refused", "LIFECYCLE_BLOCKED", "another native renewal owner holds the lease; no daemon credential was re-signed");
|
|
136
|
+
observed.authority = "lease";
|
|
137
|
+
observed.attempted = true;
|
|
138
|
+
results = await remintDaemonCreds(root, auth.space, undefined, { preflight: async (creds) => (await probeConnect(target.server, { creds, tls: target.tlsRequired })).ok === true });
|
|
139
|
+
retain(results);
|
|
140
|
+
}
|
|
141
|
+
finally {
|
|
142
|
+
let cleanupError;
|
|
143
|
+
if (held)
|
|
144
|
+
try {
|
|
145
|
+
await ep.releaseDaemonRenewalLease();
|
|
113
146
|
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
147
|
+
catch (error) {
|
|
148
|
+
cleanupError = error;
|
|
149
|
+
}
|
|
150
|
+
try {
|
|
151
|
+
await ep.stop();
|
|
119
152
|
}
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
await ep.stop().catch(() => { });
|
|
153
|
+
catch (error) {
|
|
154
|
+
cleanupError ??= error;
|
|
123
155
|
}
|
|
156
|
+
observed.coordinationCleanup = cleanupError === undefined ? "confirmed" : "unconfirmed";
|
|
157
|
+
if (cleanupError)
|
|
158
|
+
throw cleanupError;
|
|
124
159
|
}
|
|
125
|
-
else {
|
|
126
|
-
// Offline stays an explicit offline repair (#1063 fix step 4): continuity proof, no lease, and
|
|
127
|
-
// it never claims coordination. A stale lease row cannot block it - with no broker there is no
|
|
128
|
-
// row to read.
|
|
129
|
-
console.log(c.dim("\n--fix: broker not reachable - re-signing the remintable daemon creds OFFLINE (uncoordinated; the daemon adopts on its own renewal timer)…"));
|
|
130
|
-
results = await remintDaemonCreds(root, auth.space);
|
|
131
|
-
authority = "offline";
|
|
132
|
-
}
|
|
133
|
-
// A local re-sign is NOT a broker proof: `--fix` has no live admin rail to adopt through, it
|
|
134
|
-
// relies on the daemon's 75% renewal timer. So it must NEVER erase a KNOWN broker refusal to
|
|
135
|
-
// green — if the last renewal was refused (e.g. the signer the broker rejects), the re-signed
|
|
136
|
-
// generation is still unproven and may be broker-dead. Carry the refusal forward as an explicit
|
|
137
|
-
// unproven state until a REAL proof (the manager's/daemon's reloadCreds) supersedes it, so the
|
|
138
|
-
// verdict below stays exit 1 with an actionable next step. A prior non-refusal is left absent
|
|
139
|
-
// (the "backstop will adopt" state), unchanged from before.
|
|
140
|
-
const adoption = prior?.adoption?.ok === false
|
|
141
|
-
? { ok: false, error: "re-signed locally by `doctor auth --fix`, but the previous renewal was refused by the broker and the re-signed generation is not yet broker-proven - start the mesh's manager (the renewal owner) so it proves and adopts it" }
|
|
142
|
-
: undefined;
|
|
143
|
-
writeRenewalRecord(root, auth.space, { ts: new Date().toISOString(), owner: "doctor --fix", results, adoption, authority });
|
|
144
|
-
for (const r of results.filter((x) => !x.ok && !x.skipped))
|
|
145
|
-
console.error(c.red(` ✗ ${r.file}: ${r.error}`));
|
|
146
|
-
reports = inventory(root, auth.space, auth.sys.pub);
|
|
147
|
-
problems = reports.filter((r) => r.problem);
|
|
148
160
|
}
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
// warning line. Cred-file health alone is not enough: a structurally-valid JWT the broker rejected
|
|
155
|
-
// must never let `auth: healthy` / exit 0 stand (the whole point of the renewal-honesty slice).
|
|
156
|
-
const rec = readRenewalRecord(root, auth.space);
|
|
157
|
-
const adoptionRefused = rec?.adoption?.ok === false;
|
|
158
|
-
// Superseded leftovers are reported but never block `healthy` (#1576). An operator whose fleet is
|
|
159
|
-
// fine must be told so in one word; the leftovers are a tidy-up, and burying that in an `auth: 15
|
|
160
|
-
// cred problems` line is what sent one operator toward respawning 18 working agents.
|
|
161
|
-
//
|
|
162
|
-
// REPORTED ON BOTH PATHS, and that is not symmetry for its own sake. During the reported incident
|
|
163
|
-
// there WERE genuine problems alongside the 15 husks, so a note printed only on the healthy path
|
|
164
|
-
// would have been absent exactly when the operator needed it — and the one thing they must not
|
|
165
|
-
// conclude, while reading real failures, is that the husks are more of the same.
|
|
166
|
-
const superseded = reports.filter((r) => r.superseded);
|
|
167
|
-
const leftovers = superseded.length
|
|
168
|
-
? ` (${superseded.length} superseded credential file${superseded.length === 1 ? "" : "s"} left on disk from earlier incarnations - safe to delete, the agents using their successors are unaffected)`
|
|
169
|
-
: "";
|
|
170
|
-
if (!problems.length && !adoptionRefused) {
|
|
171
|
-
console.log(c.green("\nauth: healthy") + c.dim(leftovers));
|
|
172
|
-
if (superseded.length)
|
|
173
|
-
printSuperseded(superseded);
|
|
174
|
-
return;
|
|
161
|
+
else {
|
|
162
|
+
observed.authority = "offline";
|
|
163
|
+
observed.attempted = true;
|
|
164
|
+
results = await remintDaemonCreds(root, auth.space);
|
|
165
|
+
retain(results);
|
|
175
166
|
}
|
|
176
|
-
const
|
|
177
|
-
|
|
178
|
-
parts.push(`${problems.length} cred problem${problems.length === 1 ? "" : "s"}`);
|
|
179
|
-
if (adoptionRefused)
|
|
180
|
-
parts.push("last renewal not broker-accepted");
|
|
181
|
-
console.log(c.red(`\nauth: ${parts.join(", ")}`) + c.dim(leftovers));
|
|
182
|
-
for (const p of problems)
|
|
183
|
-
console.log(` ${c.red("✗")} ${p.label}: ${p.problem}\n next: ${p.repair}`);
|
|
184
|
-
if (adoptionRefused)
|
|
185
|
-
console.log(` ${c.red("✗")} the last renewal pass was refused by the broker: ${rec?.adoption?.error ?? "unknown"}\n next: start or repair the mesh's manager (the renewal owner) so it re-signs and re-proves the daemon creds`);
|
|
186
|
-
if (superseded.length)
|
|
187
|
-
printSuperseded(superseded);
|
|
188
|
-
process.exitCode = 1;
|
|
167
|
+
const adoption = prior.brokerAcceptance === "recorded-refusal" ? { ok: false, error: "re-signed locally by doctor auth --fix; the previous broker refusal remains unproven until the native renewal owner proves and adopts the generation" } : undefined;
|
|
168
|
+
writeRenewalRecord(root, auth.space, { ts: new Date().toISOString(), owner: "doctor --fix", results, adoption, authority: observed.authority });
|
|
189
169
|
}
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
170
|
+
function renewalObservation(root, space) {
|
|
171
|
+
const absent = { state: "absent", recordedAt: null, recordedOwner: null, authority: null, brokerAcceptance: "not-recorded", deliveryResponderUnbound: false };
|
|
172
|
+
try {
|
|
173
|
+
const bytes = readLocalRecordSource(renewalRecordPath(root, space), 1024 * 1024, true);
|
|
174
|
+
if (!bytes)
|
|
175
|
+
return { ...absent, legacyRecordPresent: legacyRenewalRecord(root) !== undefined };
|
|
176
|
+
const value = JSON.parse(new TextDecoder("utf-8", { fatal: true }).decode(bytes));
|
|
177
|
+
if (!value || typeof value !== "object" || typeof value.ts !== "string" || !Number.isFinite(Date.parse(value.ts)) || typeof value.owner !== "string" || !Array.isArray(value.results))
|
|
178
|
+
throw new Error();
|
|
179
|
+
const adoption = value.adoption;
|
|
180
|
+
if (adoption !== undefined && (!adoption || typeof adoption !== "object" || typeof adoption.ok !== "boolean"))
|
|
181
|
+
throw new Error();
|
|
182
|
+
return { state: "present", recordedAt: value.ts, recordedOwner: value.owner, authority: value.authority === "lease" || value.authority === "offline" ? value.authority : null, brokerAcceptance: adoption === undefined ? "not-requested-by-that-pass" : adoption.ok ? "recorded-acceptance" : "recorded-refusal", deliveryResponderUnbound: responderUnboundAtLastRenewal(typeof adoption?.error === "string" ? adoption.error : undefined), legacyRecordPresent: legacyRenewalRecord(root) !== undefined };
|
|
183
|
+
}
|
|
184
|
+
catch {
|
|
185
|
+
return { ...absent, state: "unreadable", brokerAcceptance: "not-established", legacyRecordPresent: false };
|
|
186
|
+
}
|
|
200
187
|
}
|
|
201
188
|
function isRemintable(kind) {
|
|
202
189
|
return kind === "delivery" || kind === "membership-rw";
|
|
203
190
|
}
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
* other two. A reporter was shown it for 15 credentials during an outage; following it would have
|
|
209
|
-
* destroyed 18 live agent sessions, each holding working context, to fix a state the manager's own
|
|
210
|
-
* renewal pass repaired by itself thirty minutes later.
|
|
211
|
-
*
|
|
212
|
-
* WHAT THE MANAGER ACTUALLY DOES, which is what makes the distinction real rather than softer
|
|
213
|
-
* wording: its renewal pass walks its managed agents and re-signs any whose credential is expired
|
|
214
|
-
* or near expiry for the SAME nkey, and the agent adopts the new file through its own source
|
|
215
|
-
* re-read. It explicitly does NOT renew an `unbounded` or `unreadable` credential. So:
|
|
216
|
-
* - an EXPIRED current incarnation is re-minted by a running manager: start it, do not respawn;
|
|
217
|
-
* - an UNBOUNDED/UNREADABLE one genuinely cannot be renewed: respawn is the honest answer;
|
|
218
|
-
* - a SUPERSEDED incarnation belongs to no live agent at all: it is a leftover FILE, and the
|
|
219
|
-
* repair is to delete it, never to touch the running agent that replaced it. */
|
|
220
|
-
function agentRepair(path, live) {
|
|
221
|
-
if (live?.role === "superseded")
|
|
222
|
-
return `nothing is wrong with this agent - this file is a SUPERSEDED incarnation left on disk after a re-mint, and its live successor is listed above. Delete it when convenient (\`rm ${path}\`). DO NOT respawn the agent.`;
|
|
223
|
-
return `if the mesh's manager is running it RE-MINTS this credential by itself (it is the renewal owner for managed agents; start it with \`${displayCmd()} up\` and the agent adopts the new file without being restarted). Respawn only if the manager cannot: \`${displayCmd()} spawn\``;
|
|
191
|
+
function agentRepair(path, family) {
|
|
192
|
+
if (family?.role === "superseded")
|
|
193
|
+
return `an older local incarnation file exists at ${path}; inspect its exact lifecycle and owner before removing it. File ordering alone proves no live successor. Do not respawn an agent from this finding`;
|
|
194
|
+
return `inspect this original lifecycle under its manager; supported managed renewal can re-sign the same nkey without a replacement. Do not spawn another agent only because a local file expired`;
|
|
224
195
|
}
|
|
225
|
-
/** The repair for a credential no renewal pass can rescue — the one case where respawning is right.
|
|
226
|
-
* An `unbounded` credential predates the renewal slice and an `unreadable` one cannot be parsed to
|
|
227
|
-
* re-sign; the manager skips both by name, so promising a re-mint here would be a false hope. */
|
|
228
196
|
function agentUnrenewableRepair() {
|
|
229
|
-
return
|
|
197
|
+
return "native renewal skips unbounded or unreadable material; inspect the exact lifecycle and authority before choosing an explicit replacement. This diagnosis does not prove the agent is stopped or authorize a blind respawn";
|
|
230
198
|
}
|
|
231
199
|
/** Classify every `agent` file by alias family, so a superseded incarnation is never reported as a
|
|
232
200
|
* broken fleet (#1576 ask 3).
|
|
@@ -296,13 +264,13 @@ function aliasOf(label) {
|
|
|
296
264
|
/** Inspect every managed credential file for this folder. Missing files are noted (with how they
|
|
297
265
|
* get provisioned) but only EXISTING-but-bad material is a problem — process presence is `cotal
|
|
298
266
|
* status`'s job; this surface owns credential health. */
|
|
299
|
-
function inventory(root, space, sysPub) {
|
|
267
|
+
function inventory(root, space, sysPub, readOnly = false, onMigrated) {
|
|
300
268
|
// Through the choke point, not a hand-composed `.cotal/<file>` (P7 §2 rule 1). The four kinds are
|
|
301
269
|
// per-space now, and a diagnosis that read the canonical location past an unmigrated copy would
|
|
302
270
|
// report every one of them "missing" on a root `up` has not re-provisioned — the worst possible
|
|
303
271
|
// answer from the surface an operator reaches for when something is already wrong. The LABEL stays
|
|
304
272
|
// the kind, which is what the operator reads and what `staleSystemCreds` keys its answer by.
|
|
305
|
-
const at = (kind) => migrateLegacyCotalMaterial(root, space, kind);
|
|
273
|
+
const at = (kind) => migrateLegacyCotalMaterial(root, space, kind, { readOnly, onMigrated });
|
|
306
274
|
const fixed = [
|
|
307
275
|
{ label: DELIVERY_CREDS_KIND, kind: "delivery", path: at(DELIVERY_CREDS_KIND) },
|
|
308
276
|
{ label: MEMBERSHIP_RW_CREDS_KIND, kind: "membership-rw", path: at(MEMBERSHIP_RW_CREDS_KIND) },
|
|
@@ -311,14 +279,14 @@ function inventory(root, space, sysPub) {
|
|
|
311
279
|
];
|
|
312
280
|
// Ask the staleness question ONCE, through the same helper the boot path uses, so `doctor auth`
|
|
313
281
|
// and `cotal up` can never disagree about which $SYS creds the trust record authorizes.
|
|
314
|
-
const stale = new Map(sysPub ? staleSystemCreds(root, sysPub, space).map((x) => [x.file, x]) : []);
|
|
282
|
+
const stale = new Map(sysPub ? staleSystemCreds(root, sysPub, space, { readOnly, onMigrated }).map((x) => [x.file, x]) : []);
|
|
315
283
|
const reports = fixed.map((f) => report(f.label, f.kind, f.path, sysPub, stale.get(f.label)));
|
|
316
284
|
// Same posture for the per-agent secrets (P1), and for the same reason: this space's segment
|
|
317
285
|
// through the choke point, never `join(authDir(root), "creds")`, so an operator running `doctor`
|
|
318
286
|
// on a root that has not migrated yet sees their agents' creds rather than an empty inventory. It
|
|
319
287
|
// is also what keeps the report SPACE-scoped now that the dir holds every tenant's segment — a
|
|
320
288
|
// diagnosis must not name a co-resident tenant's material.
|
|
321
|
-
const agentDir = agentCredsDir(root, space);
|
|
289
|
+
const agentDir = agentCredsDir(root, space, { readOnly, onMigrated });
|
|
322
290
|
if (existsSync(agentDir)) {
|
|
323
291
|
for (const f of readdirSync(agentDir).filter((f) => f.endsWith(".creds") && !f.endsWith(".sentinel.creds")).sort()) {
|
|
324
292
|
reports.push(report(basename(f), "agent", join(agentDir, f)));
|
|
@@ -332,10 +300,18 @@ function inventory(root, space, sysPub) {
|
|
|
332
300
|
return reports.map((r) => r.kind === "agent" && r.health ? report(r.label, r.kind, r.path, undefined, undefined, { role: roles.get(r.label) ?? "sole" }) : r);
|
|
333
301
|
}
|
|
334
302
|
function report(label, kind, path, sysPub, stale, live) {
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
303
|
+
let health;
|
|
304
|
+
try {
|
|
305
|
+
const bytes = readLocalRecordSource(path, 1024 * 1024, true);
|
|
306
|
+
if (!bytes)
|
|
307
|
+
return { label, kind, path };
|
|
308
|
+
health = inspectCredHealth(new TextDecoder("utf-8", { fatal: true }).decode(bytes));
|
|
309
|
+
}
|
|
310
|
+
catch (error) {
|
|
311
|
+
if (isCommandFailure(error) && error.code === "UNSUPPORTED")
|
|
312
|
+
throw error;
|
|
313
|
+
health = { state: "unreadable", error: "protected credential could not be read or parsed" };
|
|
314
|
+
}
|
|
339
315
|
const r = { label, kind, path, health };
|
|
340
316
|
const policy = credentialLifetime(kind);
|
|
341
317
|
const standing = policy.class === "standing-renewable" || policy.class === "rotation-renewed";
|
|
@@ -355,7 +331,7 @@ function report(label, kind, path, sysPub, stale, live) {
|
|
|
355
331
|
// helper the boot path uses, so the two surfaces cannot drift on what "stale" means. Checked
|
|
356
332
|
// before the health switch, so it wins over a merely-healthy verdict.
|
|
357
333
|
if (stale && sysPub) {
|
|
358
|
-
r.problem =
|
|
334
|
+
r.problem = stale.iss ? `the claimed system-account issuer ${stale.iss} differs from this root's ${sysPub}; current broker acceptance is not checked` : "the system-account issuer could not be established; current broker acceptance is not checked";
|
|
359
335
|
r.repair = repair;
|
|
360
336
|
return r;
|
|
361
337
|
}
|
|
@@ -388,88 +364,16 @@ function report(label, kind, path, sysPub, stale, live) {
|
|
|
388
364
|
}
|
|
389
365
|
break;
|
|
390
366
|
case "unbounded":
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
367
|
+
// A credential with no expiry claim stays valid until its signer rotates, whatever its kind,
|
|
368
|
+
// so it is a finding even where no renewal owner bounds it.
|
|
369
|
+
r.problem = standing
|
|
370
|
+
? "unbounded standing credential (minted before the renewal slice) - a copied cred never dies"
|
|
371
|
+
: "unbounded credential (no expiry claim) - a copied cred never dies";
|
|
372
|
+
r.repair = kind === "agent" && live?.role !== "superseded" ? agentUnrenewableRepair() : repair;
|
|
395
373
|
break;
|
|
396
374
|
}
|
|
397
375
|
return r;
|
|
398
376
|
}
|
|
399
|
-
function render(title, reports) {
|
|
400
|
-
console.log(`\n ${c.bold(title)}`);
|
|
401
|
-
if (!reports.length) {
|
|
402
|
-
console.log(c.dim(" none"));
|
|
403
|
-
return;
|
|
404
|
-
}
|
|
405
|
-
for (const r of reports) {
|
|
406
|
-
if (!r.health) {
|
|
407
|
-
console.log(` ${c.dim("−")} ${r.label} ${c.dim(`not provisioned here (written by \`${displayCmd()} up\`)`)}`);
|
|
408
|
-
continue;
|
|
409
|
-
}
|
|
410
|
-
const h = r.health;
|
|
411
|
-
const lastRenewal = h.iat ? c.dim(` · last renewal ${at(h.iat)}`) : "";
|
|
412
|
-
const expiry = h.exp ? c.dim(` · expires ${at(h.exp)}`) : "";
|
|
413
|
-
// A superseded incarnation is dim and NAMED, never red (#1576): its expiry is the expected
|
|
414
|
-
// consequence of the re-mint that replaced it, and an operator scanning red rows during an
|
|
415
|
-
// incident must not be sent to destroy the live agent that succeeded it.
|
|
416
|
-
const badge = r.superseded
|
|
417
|
-
? c.dim("⊖ superseded")
|
|
418
|
-
: h.state === "healthy" ? c.green("● healthy")
|
|
419
|
-
: h.state === "near-expiry" ? c.yellow("◐ near-expiry")
|
|
420
|
-
: h.state === "unbounded" ? (r.problem ? c.red("∞ unbounded") : c.dim("∞ static (dies at the flip)"))
|
|
421
|
-
: c.red(`✗ ${h.state}`);
|
|
422
|
-
const note = r.superseded ? c.dim(` · replaced by a newer incarnation of "${aliasOf(r.label)}" - leftover file, not a broken agent`) : "";
|
|
423
|
-
console.log(` ${badge} ${r.label}${lastRenewal}${expiry}${note}`);
|
|
424
|
-
}
|
|
425
|
-
}
|
|
426
|
-
/** Render the renewal owner's audit record (written by the manager's pass / doctor --fix): when the
|
|
427
|
-
* last pass ran, who ran it, and whether the daemon EXPLICITLY adopted — the "file re-signed" vs
|
|
428
|
-
* "daemon adopted" distinction the D5 panel required. Absence is informational (a mesh started
|
|
429
|
-
* before the renewal owner existed, or an open mesh). The record is PER-SPACE (`renewal.<spaceKey>.json`);
|
|
430
|
-
* a root-only `renewal.json` left by a pre-per-space build names no space, so it is never read as
|
|
431
|
-
* this space's verdict — it is named as a leftover, with the exact next command. */
|
|
432
|
-
function renderRenewalRecord(root, space) {
|
|
433
|
-
const rec = readRenewalRecord(root, space);
|
|
434
|
-
if (!rec) {
|
|
435
|
-
console.log(c.dim(" no renewal record yet (written by the manager's renewal pass)"));
|
|
436
|
-
const legacy = legacyRenewalRecord(root);
|
|
437
|
-
if (legacy)
|
|
438
|
-
console.log(c.yellow(` ⚠ ${legacy.path} is a pre-per-space renewal record that names no space - not read as this space's verdict; remove it with \`cotal clean all --force\` when resetting this root`));
|
|
439
|
-
return;
|
|
440
|
-
}
|
|
441
|
-
const resigned = rec.results.filter((r) => r.ok).map((r) => r.file);
|
|
442
|
-
const failed = rec.results.filter((r) => !r.ok && !r.skipped);
|
|
443
|
-
// Per-component result from the daemon's structured reply detail (persisted on ok AND failed
|
|
444
|
-
// passes): "accepted" = the broker accepted this generation (the proof); "rejected" (ok:false);
|
|
445
|
-
// "n/a" (absent/skipped). NOT "adopted" — the resident wire swap is best-effort/self-healing, not
|
|
446
|
-
// witnessed. Empty for an older record.
|
|
447
|
-
const detail = rec.adoption?.detail;
|
|
448
|
-
const compStatus = (comp) => comp === undefined ? "n/a" : comp.ok === false ? "rejected" : comp.skipped ? "n/a" : comp.brokerAccepted ? "accepted" : "n/a";
|
|
449
|
-
const perComponent = detail && typeof detail === "object" && (detail.delivery !== undefined || detail.membership !== undefined)
|
|
450
|
-
? ` (delivery: ${compStatus(detail.delivery)}, membership: ${compStatus(detail.membership)})`
|
|
451
|
-
: "";
|
|
452
|
-
const adoption = rec.adoption === undefined
|
|
453
|
-
? resigned.length
|
|
454
|
-
? c.yellow("daemon reload not requested by this pass - daemons pick up the re-sign via the 75% re-read backstop or the next renewal pass")
|
|
455
|
-
: c.dim("renewal: n/a (nothing re-signed)")
|
|
456
|
-
: rec.adoption.ok
|
|
457
|
-
? c.green(`broker-accepted ✓${perComponent}`)
|
|
458
|
-
: c.yellow(`renewal not accepted - ${rec.adoption.error ?? "unknown"}${perComponent}`);
|
|
459
|
-
console.log(` ${c.dim(`last renewal pass ${rec.ts} by ${rec.owner}`)} - re-signed [${resigned.join(", ") || "none"}] · ${adoption}${rec.authority === "offline" ? c.dim(" · offline") : ""}`);
|
|
460
|
-
for (const f of failed)
|
|
461
|
-
console.log(` ${c.red("✗")} last pass failed on ${f.file}: ${f.error}`);
|
|
462
|
-
// #1576: NAME THE DELIVERY RESPONDER, OFFLINE. `doctor auth` resolves no mesh and opens no
|
|
463
|
-
// connection by design (and on a user-auth mesh it is forbidden to mint at all), so it cannot read
|
|
464
|
-
// the delivery lease that `cotal status` reads. It does not have to: when the manager's renewal
|
|
465
|
-
// pass finds no responder on the delivery-admin rail it RECORDS that, in this file, which doctor
|
|
466
|
-
// already reads. That record was being rendered only as a generic "renewal not accepted", so the
|
|
467
|
-
// one surface an operator reaches for when credentials look wrong never said the word "delivery"
|
|
468
|
-
// — and in the reported incident credentials were exactly what the operator wrongly suspected.
|
|
469
|
-
if (responderUnboundAtLastRenewal(rec.adoption?.error))
|
|
470
|
-
console.log(` ${c.red("✗")} the delivery daemon's responder was NOT BOUND at that pass - ${RESPONDER_UNBOUND_CONSEQUENCE}\n` +
|
|
471
|
-
` next: start it (\`${displayCmd()} up\`) and confirm with \`${displayCmd()} status --components\`. Expired agent creds above are re-minted once it binds - do NOT respawn agents for this.`);
|
|
472
|
-
}
|
|
473
377
|
/** Did the last renewal pass fail because the delivery-admin rail had NO RESPONDER (#1576)?
|
|
474
378
|
*
|
|
475
379
|
* Matched on the manager's own recorded sentence for that case. A TIMEOUT is deliberately excluded:
|
|
@@ -481,6 +385,9 @@ function responderUnboundAtLastRenewal(error) {
|
|
|
481
385
|
return /no delivery-admin responder|no responders/i.test(error);
|
|
482
386
|
}
|
|
483
387
|
function at(sec) {
|
|
484
|
-
|
|
388
|
+
if (sec === undefined)
|
|
389
|
+
return "not reported";
|
|
390
|
+
const date = new Date(sec * 1000);
|
|
391
|
+
return Number.isFinite(date.getTime()) ? date.toISOString() : "not representable as a date";
|
|
485
392
|
}
|
|
486
393
|
//# sourceMappingURL=doctor.js.map
|