@miosa/cli 1.3.4 → 2.1.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/README.md +20 -835
- package/bin/miosa.js +75 -0
- package/lib/archive.js +88 -0
- package/lib/checksums.js +29 -0
- package/lib/platforms.js +31 -0
- package/lib/resolve.js +47 -0
- package/package.json +26 -41
- package/scripts/postinstall.js +68 -0
- package/CHANGELOG.md +0 -110
- package/dist/action-authority.d.ts +0 -106
- package/dist/action-authority.d.ts.map +0 -1
- package/dist/action-authority.js +0 -116
- package/dist/action-authority.js.map +0 -1
- package/dist/app-advisor.d.ts +0 -80
- package/dist/app-advisor.d.ts.map +0 -1
- package/dist/app-advisor.js +0 -486
- package/dist/app-advisor.js.map +0 -1
- package/dist/app-contract.d.ts +0 -92
- package/dist/app-contract.d.ts.map +0 -1
- package/dist/app-contract.js +0 -218
- package/dist/app-contract.js.map +0 -1
- package/dist/app-document.d.ts +0 -23
- package/dist/app-document.d.ts.map +0 -1
- package/dist/app-document.js +0 -180
- package/dist/app-document.js.map +0 -1
- package/dist/app-manifest.d.ts +0 -140
- package/dist/app-manifest.d.ts.map +0 -1
- package/dist/app-manifest.js +0 -377
- package/dist/app-manifest.js.map +0 -1
- package/dist/app-operation.d.ts +0 -23
- package/dist/app-operation.d.ts.map +0 -1
- package/dist/app-operation.js +0 -49
- package/dist/app-operation.js.map +0 -1
- package/dist/app-release.d.ts +0 -132
- package/dist/app-release.d.ts.map +0 -1
- package/dist/app-release.js +0 -294
- package/dist/app-release.js.map +0 -1
- package/dist/bin/miosa.d.ts +0 -3
- package/dist/bin/miosa.d.ts.map +0 -1
- package/dist/bin/miosa.js +0 -288
- package/dist/bin/miosa.js.map +0 -1
- package/dist/cli-env.d.ts +0 -12
- package/dist/cli-env.d.ts.map +0 -1
- package/dist/cli-env.js +0 -34
- package/dist/cli-env.js.map +0 -1
- package/dist/client.d.ts +0 -155
- package/dist/client.d.ts.map +0 -1
- package/dist/client.js +0 -865
- package/dist/client.js.map +0 -1
- package/dist/commands/actions.d.ts +0 -3
- package/dist/commands/actions.d.ts.map +0 -1
- package/dist/commands/actions.js +0 -222
- package/dist/commands/actions.js.map +0 -1
- package/dist/commands/agent-runtime-profiles.d.ts +0 -3
- package/dist/commands/agent-runtime-profiles.d.ts.map +0 -1
- package/dist/commands/agent-runtime-profiles.js +0 -198
- package/dist/commands/agent-runtime-profiles.js.map +0 -1
- package/dist/commands/agent.d.ts +0 -18
- package/dist/commands/agent.d.ts.map +0 -1
- package/dist/commands/agent.js +0 -737
- package/dist/commands/agent.js.map +0 -1
- package/dist/commands/alerts.d.ts +0 -3
- package/dist/commands/alerts.d.ts.map +0 -1
- package/dist/commands/alerts.js +0 -41
- package/dist/commands/alerts.js.map +0 -1
- package/dist/commands/api-keys.d.ts +0 -3
- package/dist/commands/api-keys.d.ts.map +0 -1
- package/dist/commands/api-keys.js +0 -160
- package/dist/commands/api-keys.js.map +0 -1
- package/dist/commands/api-resource.d.ts +0 -20
- package/dist/commands/api-resource.d.ts.map +0 -1
- package/dist/commands/api-resource.js +0 -120
- package/dist/commands/api-resource.js.map +0 -1
- package/dist/commands/app.d.ts +0 -38
- package/dist/commands/app.d.ts.map +0 -1
- package/dist/commands/app.js +0 -1182
- package/dist/commands/app.js.map +0 -1
- package/dist/commands/apps.d.ts +0 -3
- package/dist/commands/apps.d.ts.map +0 -1
- package/dist/commands/apps.js +0 -218
- package/dist/commands/apps.js.map +0 -1
- package/dist/commands/audit.d.ts +0 -3
- package/dist/commands/audit.d.ts.map +0 -1
- package/dist/commands/audit.js +0 -25
- package/dist/commands/audit.js.map +0 -1
- package/dist/commands/auth.d.ts +0 -3
- package/dist/commands/auth.d.ts.map +0 -1
- package/dist/commands/auth.js +0 -282
- package/dist/commands/auth.js.map +0 -1
- package/dist/commands/backups.d.ts +0 -3
- package/dist/commands/backups.d.ts.map +0 -1
- package/dist/commands/backups.js +0 -23
- package/dist/commands/backups.js.map +0 -1
- package/dist/commands/billing.d.ts +0 -3
- package/dist/commands/billing.d.ts.map +0 -1
- package/dist/commands/billing.js +0 -208
- package/dist/commands/billing.js.map +0 -1
- package/dist/commands/builds.d.ts +0 -3
- package/dist/commands/builds.d.ts.map +0 -1
- package/dist/commands/builds.js +0 -198
- package/dist/commands/builds.js.map +0 -1
- package/dist/commands/capabilities.d.ts +0 -3
- package/dist/commands/capabilities.d.ts.map +0 -1
- package/dist/commands/capabilities.js +0 -1002
- package/dist/commands/capabilities.js.map +0 -1
- package/dist/commands/checkpoints.d.ts +0 -3
- package/dist/commands/checkpoints.d.ts.map +0 -1
- package/dist/commands/checkpoints.js +0 -193
- package/dist/commands/checkpoints.js.map +0 -1
- package/dist/commands/cleanup.d.ts +0 -3
- package/dist/commands/cleanup.d.ts.map +0 -1
- package/dist/commands/cleanup.js +0 -65
- package/dist/commands/cleanup.js.map +0 -1
- package/dist/commands/cloud.d.ts +0 -3
- package/dist/commands/cloud.d.ts.map +0 -1
- package/dist/commands/cloud.js +0 -192
- package/dist/commands/cloud.js.map +0 -1
- package/dist/commands/command-overview.d.ts +0 -13
- package/dist/commands/command-overview.d.ts.map +0 -1
- package/dist/commands/command-overview.js +0 -50
- package/dist/commands/command-overview.js.map +0 -1
- package/dist/commands/completion.d.ts +0 -3
- package/dist/commands/completion.d.ts.map +0 -1
- package/dist/commands/completion.js +0 -183
- package/dist/commands/completion.js.map +0 -1
- package/dist/commands/computers.d.ts +0 -3
- package/dist/commands/computers.d.ts.map +0 -1
- package/dist/commands/computers.js +0 -706
- package/dist/commands/computers.js.map +0 -1
- package/dist/commands/config.d.ts +0 -3
- package/dist/commands/config.d.ts.map +0 -1
- package/dist/commands/config.js +0 -114
- package/dist/commands/config.js.map +0 -1
- package/dist/commands/connect.d.ts +0 -6
- package/dist/commands/connect.d.ts.map +0 -1
- package/dist/commands/connect.js +0 -127
- package/dist/commands/connect.js.map +0 -1
- package/dist/commands/connectors.d.ts +0 -3
- package/dist/commands/connectors.d.ts.map +0 -1
- package/dist/commands/connectors.js +0 -172
- package/dist/commands/connectors.js.map +0 -1
- package/dist/commands/containers.d.ts +0 -3
- package/dist/commands/containers.d.ts.map +0 -1
- package/dist/commands/containers.js +0 -20
- package/dist/commands/containers.js.map +0 -1
- package/dist/commands/context.d.ts +0 -3
- package/dist/commands/context.d.ts.map +0 -1
- package/dist/commands/context.js +0 -233
- package/dist/commands/context.js.map +0 -1
- package/dist/commands/cp.d.ts +0 -3
- package/dist/commands/cp.d.ts.map +0 -1
- package/dist/commands/cp.js +0 -319
- package/dist/commands/cp.js.map +0 -1
- package/dist/commands/cron.d.ts +0 -3
- package/dist/commands/cron.d.ts.map +0 -1
- package/dist/commands/cron.js +0 -65
- package/dist/commands/cron.js.map +0 -1
- package/dist/commands/dashboard.d.ts +0 -13
- package/dist/commands/dashboard.d.ts.map +0 -1
- package/dist/commands/dashboard.js +0 -54
- package/dist/commands/dashboard.js.map +0 -1
- package/dist/commands/databases.d.ts +0 -3
- package/dist/commands/databases.d.ts.map +0 -1
- package/dist/commands/databases.js +0 -714
- package/dist/commands/databases.js.map +0 -1
- package/dist/commands/db.d.ts +0 -3
- package/dist/commands/db.d.ts.map +0 -1
- package/dist/commands/db.js +0 -385
- package/dist/commands/db.js.map +0 -1
- package/dist/commands/deploy.d.ts +0 -3
- package/dist/commands/deploy.d.ts.map +0 -1
- package/dist/commands/deploy.js +0 -1234
- package/dist/commands/deploy.js.map +0 -1
- package/dist/commands/desktop.d.ts +0 -3
- package/dist/commands/desktop.d.ts.map +0 -1
- package/dist/commands/desktop.js +0 -277
- package/dist/commands/desktop.js.map +0 -1
- package/dist/commands/dev.d.ts +0 -3
- package/dist/commands/dev.d.ts.map +0 -1
- package/dist/commands/dev.js +0 -245
- package/dist/commands/dev.js.map +0 -1
- package/dist/commands/devices.d.ts +0 -3
- package/dist/commands/devices.d.ts.map +0 -1
- package/dist/commands/devices.js +0 -279
- package/dist/commands/devices.js.map +0 -1
- package/dist/commands/docker-deploy.d.ts +0 -3
- package/dist/commands/docker-deploy.d.ts.map +0 -1
- package/dist/commands/docker-deploy.js +0 -659
- package/dist/commands/docker-deploy.js.map +0 -1
- package/dist/commands/doctor.d.ts +0 -69
- package/dist/commands/doctor.d.ts.map +0 -1
- package/dist/commands/doctor.js +0 -596
- package/dist/commands/doctor.js.map +0 -1
- package/dist/commands/domains.d.ts +0 -3
- package/dist/commands/domains.d.ts.map +0 -1
- package/dist/commands/domains.js +0 -307
- package/dist/commands/domains.js.map +0 -1
- package/dist/commands/enterprise-util.d.ts +0 -39
- package/dist/commands/enterprise-util.d.ts.map +0 -1
- package/dist/commands/enterprise-util.js +0 -217
- package/dist/commands/enterprise-util.js.map +0 -1
- package/dist/commands/env-input.d.ts +0 -26
- package/dist/commands/env-input.d.ts.map +0 -1
- package/dist/commands/env-input.js +0 -68
- package/dist/commands/env-input.js.map +0 -1
- package/dist/commands/env.d.ts +0 -3
- package/dist/commands/env.d.ts.map +0 -1
- package/dist/commands/env.js +0 -189
- package/dist/commands/env.js.map +0 -1
- package/dist/commands/exec.d.ts +0 -3
- package/dist/commands/exec.d.ts.map +0 -1
- package/dist/commands/exec.js +0 -110
- package/dist/commands/exec.js.map +0 -1
- package/dist/commands/forge.d.ts +0 -3
- package/dist/commands/forge.d.ts.map +0 -1
- package/dist/commands/forge.js +0 -254
- package/dist/commands/forge.js.map +0 -1
- package/dist/commands/functions.d.ts +0 -3
- package/dist/commands/functions.d.ts.map +0 -1
- package/dist/commands/functions.js +0 -47
- package/dist/commands/functions.js.map +0 -1
- package/dist/commands/gha-runners.d.ts +0 -3
- package/dist/commands/gha-runners.d.ts.map +0 -1
- package/dist/commands/gha-runners.js +0 -33
- package/dist/commands/gha-runners.js.map +0 -1
- package/dist/commands/groups.d.ts +0 -3
- package/dist/commands/groups.d.ts.map +0 -1
- package/dist/commands/groups.js +0 -38
- package/dist/commands/groups.js.map +0 -1
- package/dist/commands/host.d.ts +0 -3
- package/dist/commands/host.d.ts.map +0 -1
- package/dist/commands/host.js +0 -74
- package/dist/commands/host.js.map +0 -1
- package/dist/commands/hosts.d.ts +0 -7
- package/dist/commands/hosts.d.ts.map +0 -1
- package/dist/commands/hosts.js +0 -91
- package/dist/commands/hosts.js.map +0 -1
- package/dist/commands/link.d.ts +0 -8
- package/dist/commands/link.d.ts.map +0 -1
- package/dist/commands/link.js +0 -124
- package/dist/commands/link.js.map +0 -1
- package/dist/commands/login.d.ts +0 -10
- package/dist/commands/login.d.ts.map +0 -1
- package/dist/commands/login.js +0 -263
- package/dist/commands/login.js.map +0 -1
- package/dist/commands/logout.d.ts +0 -3
- package/dist/commands/logout.d.ts.map +0 -1
- package/dist/commands/logout.js +0 -43
- package/dist/commands/logout.js.map +0 -1
- package/dist/commands/logs.d.ts +0 -3
- package/dist/commands/logs.d.ts.map +0 -1
- package/dist/commands/logs.js +0 -401
- package/dist/commands/logs.js.map +0 -1
- package/dist/commands/ls.d.ts +0 -3
- package/dist/commands/ls.d.ts.map +0 -1
- package/dist/commands/ls.js +0 -121
- package/dist/commands/ls.js.map +0 -1
- package/dist/commands/mcp.d.ts +0 -46
- package/dist/commands/mcp.d.ts.map +0 -1
- package/dist/commands/mcp.js +0 -3413
- package/dist/commands/mcp.js.map +0 -1
- package/dist/commands/menu.d.ts +0 -29
- package/dist/commands/menu.d.ts.map +0 -1
- package/dist/commands/menu.js +0 -147
- package/dist/commands/menu.js.map +0 -1
- package/dist/commands/meshes.d.ts +0 -3
- package/dist/commands/meshes.d.ts.map +0 -1
- package/dist/commands/meshes.js +0 -27
- package/dist/commands/meshes.js.map +0 -1
- package/dist/commands/network-policy.d.ts +0 -3
- package/dist/commands/network-policy.d.ts.map +0 -1
- package/dist/commands/network-policy.js +0 -155
- package/dist/commands/network-policy.js.map +0 -1
- package/dist/commands/new.d.ts +0 -3
- package/dist/commands/new.d.ts.map +0 -1
- package/dist/commands/new.js +0 -296
- package/dist/commands/new.js.map +0 -1
- package/dist/commands/opencomputers.d.ts +0 -10
- package/dist/commands/opencomputers.d.ts.map +0 -1
- package/dist/commands/opencomputers.js +0 -25
- package/dist/commands/opencomputers.js.map +0 -1
- package/dist/commands/operating-contract.d.ts +0 -3
- package/dist/commands/operating-contract.d.ts.map +0 -1
- package/dist/commands/operating-contract.js +0 -651
- package/dist/commands/operating-contract.js.map +0 -1
- package/dist/commands/project.d.ts +0 -4
- package/dist/commands/project.d.ts.map +0 -1
- package/dist/commands/project.js +0 -25
- package/dist/commands/project.js.map +0 -1
- package/dist/commands/pull.d.ts +0 -14
- package/dist/commands/pull.d.ts.map +0 -1
- package/dist/commands/pull.js +0 -156
- package/dist/commands/pull.js.map +0 -1
- package/dist/commands/regions.d.ts +0 -3
- package/dist/commands/regions.d.ts.map +0 -1
- package/dist/commands/regions.js +0 -103
- package/dist/commands/regions.js.map +0 -1
- package/dist/commands/releases.d.ts +0 -3
- package/dist/commands/releases.d.ts.map +0 -1
- package/dist/commands/releases.js +0 -365
- package/dist/commands/releases.js.map +0 -1
- package/dist/commands/rm.d.ts +0 -3
- package/dist/commands/rm.d.ts.map +0 -1
- package/dist/commands/rm.js +0 -42
- package/dist/commands/rm.js.map +0 -1
- package/dist/commands/rollback.d.ts +0 -3
- package/dist/commands/rollback.d.ts.map +0 -1
- package/dist/commands/rollback.js +0 -62
- package/dist/commands/rollback.js.map +0 -1
- package/dist/commands/run-groups.d.ts +0 -3
- package/dist/commands/run-groups.d.ts.map +0 -1
- package/dist/commands/run-groups.js +0 -364
- package/dist/commands/run-groups.js.map +0 -1
- package/dist/commands/run.d.ts +0 -3
- package/dist/commands/run.d.ts.map +0 -1
- package/dist/commands/run.js +0 -130
- package/dist/commands/run.js.map +0 -1
- package/dist/commands/runs.d.ts +0 -3
- package/dist/commands/runs.d.ts.map +0 -1
- package/dist/commands/runs.js +0 -365
- package/dist/commands/runs.js.map +0 -1
- package/dist/commands/runtime-env.d.ts +0 -3
- package/dist/commands/runtime-env.d.ts.map +0 -1
- package/dist/commands/runtime-env.js +0 -114
- package/dist/commands/runtime-env.js.map +0 -1
- package/dist/commands/sandbox-delete-guard.d.ts +0 -4
- package/dist/commands/sandbox-delete-guard.d.ts.map +0 -1
- package/dist/commands/sandbox-delete-guard.js +0 -32
- package/dist/commands/sandbox-delete-guard.js.map +0 -1
- package/dist/commands/sandbox-dev.d.ts +0 -20
- package/dist/commands/sandbox-dev.d.ts.map +0 -1
- package/dist/commands/sandbox-dev.js +0 -583
- package/dist/commands/sandbox-dev.js.map +0 -1
- package/dist/commands/sandbox.d.ts +0 -36
- package/dist/commands/sandbox.d.ts.map +0 -1
- package/dist/commands/sandbox.js +0 -3796
- package/dist/commands/sandbox.js.map +0 -1
- package/dist/commands/scale.d.ts +0 -3
- package/dist/commands/scale.d.ts.map +0 -1
- package/dist/commands/scale.js +0 -61
- package/dist/commands/scale.js.map +0 -1
- package/dist/commands/schedules.d.ts +0 -3
- package/dist/commands/schedules.d.ts.map +0 -1
- package/dist/commands/schedules.js +0 -37
- package/dist/commands/schedules.js.map +0 -1
- package/dist/commands/secrets.d.ts +0 -3
- package/dist/commands/secrets.d.ts.map +0 -1
- package/dist/commands/secrets.js +0 -200
- package/dist/commands/secrets.js.map +0 -1
- package/dist/commands/services.d.ts +0 -3
- package/dist/commands/services.d.ts.map +0 -1
- package/dist/commands/services.js +0 -70
- package/dist/commands/services.js.map +0 -1
- package/dist/commands/shell.d.ts +0 -16
- package/dist/commands/shell.d.ts.map +0 -1
- package/dist/commands/shell.js +0 -555
- package/dist/commands/shell.js.map +0 -1
- package/dist/commands/snapshot.d.ts +0 -10
- package/dist/commands/snapshot.d.ts.map +0 -1
- package/dist/commands/snapshot.js +0 -181
- package/dist/commands/snapshot.js.map +0 -1
- package/dist/commands/ssh.d.ts +0 -3
- package/dist/commands/ssh.d.ts.map +0 -1
- package/dist/commands/ssh.js +0 -93
- package/dist/commands/ssh.js.map +0 -1
- package/dist/commands/status.d.ts +0 -3
- package/dist/commands/status.d.ts.map +0 -1
- package/dist/commands/status.js +0 -302
- package/dist/commands/status.js.map +0 -1
- package/dist/commands/storage.d.ts +0 -3
- package/dist/commands/storage.d.ts.map +0 -1
- package/dist/commands/storage.js +0 -456
- package/dist/commands/storage.js.map +0 -1
- package/dist/commands/teams.d.ts +0 -3
- package/dist/commands/teams.d.ts.map +0 -1
- package/dist/commands/teams.js +0 -169
- package/dist/commands/teams.js.map +0 -1
- package/dist/commands/templates.d.ts +0 -3
- package/dist/commands/templates.d.ts.map +0 -1
- package/dist/commands/templates.js +0 -690
- package/dist/commands/templates.js.map +0 -1
- package/dist/commands/tenant.d.ts +0 -3
- package/dist/commands/tenant.d.ts.map +0 -1
- package/dist/commands/tenant.js +0 -95
- package/dist/commands/tenant.js.map +0 -1
- package/dist/commands/tunnel.d.ts +0 -3
- package/dist/commands/tunnel.d.ts.map +0 -1
- package/dist/commands/tunnel.js +0 -418
- package/dist/commands/tunnel.js.map +0 -1
- package/dist/commands/up.d.ts +0 -14
- package/dist/commands/up.d.ts.map +0 -1
- package/dist/commands/up.js +0 -720
- package/dist/commands/up.js.map +0 -1
- package/dist/commands/update.d.ts +0 -3
- package/dist/commands/update.d.ts.map +0 -1
- package/dist/commands/update.js +0 -166
- package/dist/commands/update.js.map +0 -1
- package/dist/commands/util.d.ts +0 -25
- package/dist/commands/util.d.ts.map +0 -1
- package/dist/commands/util.js +0 -199
- package/dist/commands/util.js.map +0 -1
- package/dist/commands/volumes.d.ts +0 -3
- package/dist/commands/volumes.d.ts.map +0 -1
- package/dist/commands/volumes.js +0 -196
- package/dist/commands/volumes.js.map +0 -1
- package/dist/commands/watch.d.ts +0 -6
- package/dist/commands/watch.d.ts.map +0 -1
- package/dist/commands/watch.js +0 -414
- package/dist/commands/watch.js.map +0 -1
- package/dist/commands/webhooks.d.ts +0 -3
- package/dist/commands/webhooks.d.ts.map +0 -1
- package/dist/commands/webhooks.js +0 -23
- package/dist/commands/webhooks.js.map +0 -1
- package/dist/commands/whoami.d.ts +0 -3
- package/dist/commands/whoami.d.ts.map +0 -1
- package/dist/commands/whoami.js +0 -156
- package/dist/commands/whoami.js.map +0 -1
- package/dist/commands/workspaces.d.ts +0 -3
- package/dist/commands/workspaces.d.ts.map +0 -1
- package/dist/commands/workspaces.js +0 -147
- package/dist/commands/workspaces.js.map +0 -1
- package/dist/config.d.ts +0 -54
- package/dist/config.d.ts.map +0 -1
- package/dist/config.js +0 -275
- package/dist/config.js.map +0 -1
- package/dist/errors.d.ts +0 -30
- package/dist/errors.d.ts.map +0 -1
- package/dist/errors.js +0 -92
- package/dist/errors.js.map +0 -1
- package/dist/framework-detector.d.ts +0 -22
- package/dist/framework-detector.d.ts.map +0 -1
- package/dist/framework-detector.js +0 -373
- package/dist/framework-detector.js.map +0 -1
- package/dist/generated/action-capabilities.d.ts +0 -826
- package/dist/generated/action-capabilities.d.ts.map +0 -1
- package/dist/generated/action-capabilities.js +0 -1035
- package/dist/generated/action-capabilities.js.map +0 -1
- package/dist/net-diagnosis.d.ts +0 -87
- package/dist/net-diagnosis.d.ts.map +0 -1
- package/dist/net-diagnosis.js +0 -408
- package/dist/net-diagnosis.js.map +0 -1
- package/dist/pty/raw-mode.d.ts +0 -7
- package/dist/pty/raw-mode.d.ts.map +0 -1
- package/dist/pty/raw-mode.js +0 -22
- package/dist/pty/raw-mode.js.map +0 -1
- package/dist/pty/ws-pty-client.d.ts +0 -13
- package/dist/pty/ws-pty-client.d.ts.map +0 -1
- package/dist/pty/ws-pty-client.js +0 -73
- package/dist/pty/ws-pty-client.js.map +0 -1
- package/dist/tui/dashboard.d.ts +0 -35
- package/dist/tui/dashboard.d.ts.map +0 -1
- package/dist/tui/dashboard.js +0 -191
- package/dist/tui/dashboard.js.map +0 -1
- package/dist/tui/logs.d.ts +0 -26
- package/dist/tui/logs.d.ts.map +0 -1
- package/dist/tui/logs.js +0 -276
- package/dist/tui/logs.js.map +0 -1
- package/dist/types.d.ts +0 -362
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -16
- package/dist/types.js.map +0 -1
- package/dist/ui/picker.d.ts +0 -41
- package/dist/ui/picker.d.ts.map +0 -1
- package/dist/ui/picker.js +0 -77
- package/dist/ui/picker.js.map +0 -1
- package/dist/ui/progress.d.ts +0 -10
- package/dist/ui/progress.d.ts.map +0 -1
- package/dist/ui/progress.js +0 -36
- package/dist/ui/progress.js.map +0 -1
- package/dist/ui/render.d.ts +0 -91
- package/dist/ui/render.d.ts.map +0 -1
- package/dist/ui/render.js +0 -138
- package/dist/ui/render.js.map +0 -1
- package/dist/ui/spinner.d.ts +0 -4
- package/dist/ui/spinner.d.ts.map +0 -1
- package/dist/ui/spinner.js +0 -7
- package/dist/ui/spinner.js.map +0 -1
- package/dist/ui/table.d.ts +0 -8
- package/dist/ui/table.d.ts.map +0 -1
- package/dist/ui/table.js +0 -46
- package/dist/ui/table.js.map +0 -1
- package/dist/update-check.d.ts +0 -13
- package/dist/update-check.d.ts.map +0 -1
- package/dist/update-check.js +0 -94
- package/dist/update-check.js.map +0 -1
- package/dist/version.d.ts +0 -3
- package/dist/version.d.ts.map +0 -1
- package/dist/version.js +0 -5
- package/dist/version.js.map +0 -1
|
@@ -1,659 +0,0 @@
|
|
|
1
|
-
import chalk from "chalk";
|
|
2
|
-
import { request } from "undici";
|
|
3
|
-
import { renderTable } from "../ui/table.js";
|
|
4
|
-
import { createClient, handleError, isJsonMode, objectOf, printJson, shortId, } from "./util.js";
|
|
5
|
-
function unwrapHosts(payload) {
|
|
6
|
-
if (Array.isArray(payload))
|
|
7
|
-
return payload;
|
|
8
|
-
if (payload && typeof payload === "object") {
|
|
9
|
-
const record = payload;
|
|
10
|
-
if (Array.isArray(record["data"]))
|
|
11
|
-
return record["data"];
|
|
12
|
-
if (Array.isArray(record["hosts"]))
|
|
13
|
-
return record["hosts"];
|
|
14
|
-
}
|
|
15
|
-
return [];
|
|
16
|
-
}
|
|
17
|
-
function unwrapTemplates(payload) {
|
|
18
|
-
if (Array.isArray(payload))
|
|
19
|
-
return payload;
|
|
20
|
-
if (payload && typeof payload === "object") {
|
|
21
|
-
const record = payload;
|
|
22
|
-
if (Array.isArray(record["data"]))
|
|
23
|
-
return record["data"];
|
|
24
|
-
if (Array.isArray(record["templates"]))
|
|
25
|
-
return record["templates"];
|
|
26
|
-
}
|
|
27
|
-
return [];
|
|
28
|
-
}
|
|
29
|
-
function statusLabel(status) {
|
|
30
|
-
switch (status) {
|
|
31
|
-
case "active":
|
|
32
|
-
return chalk.green(status);
|
|
33
|
-
case "bootstrapping":
|
|
34
|
-
case "provisioning":
|
|
35
|
-
case "pending":
|
|
36
|
-
return chalk.yellow(status);
|
|
37
|
-
case "degraded":
|
|
38
|
-
case "error":
|
|
39
|
-
return chalk.red(status);
|
|
40
|
-
default:
|
|
41
|
-
return chalk.dim(status);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
function hostReady(host) {
|
|
45
|
-
return host.status === "active" && host.appliance_status === "healthy";
|
|
46
|
-
}
|
|
47
|
-
function printHost(host) {
|
|
48
|
-
console.log();
|
|
49
|
-
console.log(chalk.bold("App Engine host"));
|
|
50
|
-
console.log();
|
|
51
|
-
console.log(` ID: ${host.id}`);
|
|
52
|
-
console.log(` Workspace: ${host.workspace_id}`);
|
|
53
|
-
if (host.external_workspace_id) {
|
|
54
|
-
console.log(` External: ${host.external_workspace_id}`);
|
|
55
|
-
}
|
|
56
|
-
console.log(` Computer: ${host.computer_id ?? "—"}`);
|
|
57
|
-
console.log(` Status: ${statusLabel(host.status)}`);
|
|
58
|
-
console.log(` Appliance: ${host.appliance_status ?? "unknown"}`);
|
|
59
|
-
console.log(` Ready: ${hostReady(host) ? chalk.green("yes") : chalk.yellow("no")}`);
|
|
60
|
-
console.log(` Size/region: ${host.size} / ${host.region}`);
|
|
61
|
-
console.log(` Portal: ${host.portal_domain ?? "—"}`);
|
|
62
|
-
console.log(` Runtime: ${host.runtime_base_url ?? "—"}`);
|
|
63
|
-
console.log(` Agent: ${host.agent_base_url ?? "—"}`);
|
|
64
|
-
console.log(` Updated: ${host.updated_at ?? "—"}`);
|
|
65
|
-
console.log();
|
|
66
|
-
}
|
|
67
|
-
function printTemplate(template) {
|
|
68
|
-
console.log();
|
|
69
|
-
console.log(chalk.bold(template.name));
|
|
70
|
-
console.log();
|
|
71
|
-
console.log(` ID: ${template.id}`);
|
|
72
|
-
console.log(` Category: ${template.category ?? "—"}`);
|
|
73
|
-
console.log(` Runtime: ${template.runtime ?? "—"}`);
|
|
74
|
-
console.log(` Tags: ${(template.tags ?? []).join(", ") || "—"}`);
|
|
75
|
-
if (template.description) {
|
|
76
|
-
console.log(` Description: ${template.description}`);
|
|
77
|
-
}
|
|
78
|
-
console.log();
|
|
79
|
-
}
|
|
80
|
-
function asRecord(value) {
|
|
81
|
-
return value !== null && typeof value === "object" && !Array.isArray(value)
|
|
82
|
-
? value
|
|
83
|
-
: {};
|
|
84
|
-
}
|
|
85
|
-
function stringField(value, key) {
|
|
86
|
-
const raw = asRecord(value)[key];
|
|
87
|
-
return typeof raw === "string" && raw.trim() ? raw.trim() : null;
|
|
88
|
-
}
|
|
89
|
-
function numberField(value, key) {
|
|
90
|
-
const raw = asRecord(value)[key];
|
|
91
|
-
if (typeof raw === "number" && Number.isFinite(raw))
|
|
92
|
-
return raw;
|
|
93
|
-
if (typeof raw === "string" && /^\d+$/.test(raw))
|
|
94
|
-
return Number(raw);
|
|
95
|
-
return null;
|
|
96
|
-
}
|
|
97
|
-
function deploymentProduct(deployment) {
|
|
98
|
-
const metadata = asRecord(deployment.metadata);
|
|
99
|
-
return (deployment.deployment_product ??
|
|
100
|
-
stringField(metadata, "deployment_product") ??
|
|
101
|
-
"miosa_deploy");
|
|
102
|
-
}
|
|
103
|
-
function deploymentHostId(deployment) {
|
|
104
|
-
const metadata = asRecord(deployment.metadata);
|
|
105
|
-
const app = deploymentDockerDeployApp(deployment);
|
|
106
|
-
return (stringField(app, "docker_deploy_host_id") ??
|
|
107
|
-
deployment.docker_deploy_host_id ??
|
|
108
|
-
stringField(metadata, "docker_deploy_host_id") ??
|
|
109
|
-
stringField(asRecord(metadata["docker_deploy"]), "host_id"));
|
|
110
|
-
}
|
|
111
|
-
function deploymentRuntime(deployment) {
|
|
112
|
-
const app = deploymentDockerDeployApp(deployment);
|
|
113
|
-
const runtime = asRecord(asRecord(deployment.metadata)["runtime"]);
|
|
114
|
-
return {
|
|
115
|
-
ip: stringField(app, "runtime_ip") ?? stringField(runtime, "ip"),
|
|
116
|
-
port: numberField(app, "runtime_port") ?? numberField(runtime, "port"),
|
|
117
|
-
};
|
|
118
|
-
}
|
|
119
|
-
function deploymentPublicUrl(deployment) {
|
|
120
|
-
return (stringField(deploymentDockerDeployApp(deployment), "public_url") ??
|
|
121
|
-
deployment.public_url ??
|
|
122
|
-
deployment.auto_subdomain ??
|
|
123
|
-
null);
|
|
124
|
-
}
|
|
125
|
-
function deploymentDockerDeployApp(deployment) {
|
|
126
|
-
const raw = asRecord(deployment)["docker_deploy_app"];
|
|
127
|
-
return raw && typeof raw === "object" ? raw : null;
|
|
128
|
-
}
|
|
129
|
-
function classifyBody(contentType, body) {
|
|
130
|
-
const trimmed = body.trim();
|
|
131
|
-
if (!trimmed)
|
|
132
|
-
return "empty";
|
|
133
|
-
if (contentType?.includes("text/html") || /^<!doctype html/i.test(trimmed))
|
|
134
|
-
return "html";
|
|
135
|
-
if (contentType?.includes("application/json") || /^[{[]/.test(trimmed)) {
|
|
136
|
-
try {
|
|
137
|
-
const parsed = JSON.parse(trimmed);
|
|
138
|
-
const record = asRecord(parsed);
|
|
139
|
-
if (record["ok"] === true && typeof record["run_id"] === "string") {
|
|
140
|
-
return "miosa_gateway_json";
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
catch {
|
|
144
|
-
// Fall through to generic JSON classification.
|
|
145
|
-
}
|
|
146
|
-
return "json";
|
|
147
|
-
}
|
|
148
|
-
return "text";
|
|
149
|
-
}
|
|
150
|
-
async function probeUrl(baseUrl, probePath, timeoutMs) {
|
|
151
|
-
if (!baseUrl)
|
|
152
|
-
return { ok: false, error: "deployment has no public_url" };
|
|
153
|
-
const url = new URL(probePath || "/", baseUrl.endsWith("/") ? baseUrl : `${baseUrl}/`);
|
|
154
|
-
const controller = new AbortController();
|
|
155
|
-
const timeout = setTimeout(() => controller.abort(), timeoutMs);
|
|
156
|
-
try {
|
|
157
|
-
const response = await request(url, {
|
|
158
|
-
method: "GET",
|
|
159
|
-
signal: controller.signal,
|
|
160
|
-
headersTimeout: timeoutMs,
|
|
161
|
-
bodyTimeout: timeoutMs,
|
|
162
|
-
});
|
|
163
|
-
const body = await response.body.text();
|
|
164
|
-
const contentType = response.headers["content-type"];
|
|
165
|
-
const bodyKind = classifyBody(Array.isArray(contentType)
|
|
166
|
-
? contentType.join(",")
|
|
167
|
-
: (contentType ?? null), body);
|
|
168
|
-
return {
|
|
169
|
-
ok: response.statusCode >= 200 &&
|
|
170
|
-
response.statusCode < 400 &&
|
|
171
|
-
bodyKind !== "miosa_gateway_json",
|
|
172
|
-
status: response.statusCode,
|
|
173
|
-
url: url.toString(),
|
|
174
|
-
body_kind: bodyKind,
|
|
175
|
-
};
|
|
176
|
-
}
|
|
177
|
-
catch (err) {
|
|
178
|
-
return {
|
|
179
|
-
ok: false,
|
|
180
|
-
url: url.toString(),
|
|
181
|
-
error: err instanceof Error ? err.message : String(err),
|
|
182
|
-
};
|
|
183
|
-
}
|
|
184
|
-
finally {
|
|
185
|
-
clearTimeout(timeout);
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
async function waitForHost(host, timeoutSec) {
|
|
189
|
-
const client = createClient();
|
|
190
|
-
const deadline = Date.now() + timeoutSec * 1000;
|
|
191
|
-
let current = host;
|
|
192
|
-
while (!hostReady(current) && Date.now() < deadline) {
|
|
193
|
-
await new Promise((resolve) => setTimeout(resolve, 2_000));
|
|
194
|
-
const raw = await client.apiGet(`/api/v1/docker-deploy/hosts/${encodeURIComponent(host.id)}`);
|
|
195
|
-
current = objectOf(raw, ["host"]);
|
|
196
|
-
}
|
|
197
|
-
return current;
|
|
198
|
-
}
|
|
199
|
-
function normalizeApplianceRelease(value) {
|
|
200
|
-
const trimmed = value.trim().toLowerCase();
|
|
201
|
-
const release = trimmed.startsWith("sha-") ? trimmed : `sha-${trimmed}`;
|
|
202
|
-
if (!/^sha-[0-9a-f]{7,40}$/.test(release)) {
|
|
203
|
-
throw new Error("Release must be an exact Git commit SHA with 7 to 40 hexadecimal characters.");
|
|
204
|
-
}
|
|
205
|
-
return release;
|
|
206
|
-
}
|
|
207
|
-
async function waitForHostRelease(host, release, timeoutSec) {
|
|
208
|
-
const client = createClient();
|
|
209
|
-
const deadline = Date.now() + timeoutSec * 1000;
|
|
210
|
-
let current = host;
|
|
211
|
-
while ((!hostReady(current) || current.appliance_version !== release) &&
|
|
212
|
-
Date.now() < deadline) {
|
|
213
|
-
await new Promise((resolve) => setTimeout(resolve, 2_000));
|
|
214
|
-
const raw = await client.apiGet(`/api/v1/docker-deploy/hosts/${encodeURIComponent(host.id)}`);
|
|
215
|
-
current = objectOf(raw, ["host"]);
|
|
216
|
-
}
|
|
217
|
-
if (!hostReady(current) || current.appliance_version !== release) {
|
|
218
|
-
throw new Error(`App Engine upgrade did not become healthy on ${release} within ${timeoutSec} seconds.`);
|
|
219
|
-
}
|
|
220
|
-
return current;
|
|
221
|
-
}
|
|
222
|
-
async function upgradeHostToRelease(hostId, release, timeout) {
|
|
223
|
-
const client = createClient();
|
|
224
|
-
const applianceImage = `ghcr.io/miosa-osa/docker-deploy-appliance:${release}`;
|
|
225
|
-
const agentImage = `ghcr.io/miosa-osa/docker-deploy-appliance-agent:${release}`;
|
|
226
|
-
const raw = await client.apiPost(`/api/v1/docker-deploy/hosts/${encodeURIComponent(hostId)}/upgrade`, {
|
|
227
|
-
appliance_image: applianceImage,
|
|
228
|
-
agent_image: agentImage,
|
|
229
|
-
appliance_version: release,
|
|
230
|
-
}, { "Idempotency-Key": `fleet-upgrade:${hostId}:${release}` });
|
|
231
|
-
return waitForHostRelease(objectOf(raw, ["host"]), release, timeout);
|
|
232
|
-
}
|
|
233
|
-
export function register(program) {
|
|
234
|
-
const root = program
|
|
235
|
-
.command("docker-deploy")
|
|
236
|
-
.alias("docker")
|
|
237
|
-
.description("Manage MIOSA App Engine appliance hosts");
|
|
238
|
-
root
|
|
239
|
-
.command("hosts")
|
|
240
|
-
.alias("list")
|
|
241
|
-
.description("List App Engine appliance hosts")
|
|
242
|
-
.option("--workspace <id>", "Filter by workspace ID")
|
|
243
|
-
.option("--json", "Output raw JSON")
|
|
244
|
-
.action(async (opts) => {
|
|
245
|
-
try {
|
|
246
|
-
const client = createClient();
|
|
247
|
-
const params = new URLSearchParams();
|
|
248
|
-
if (opts.workspace)
|
|
249
|
-
params.set("workspace_id", opts.workspace);
|
|
250
|
-
const suffix = params.toString() ? `?${params.toString()}` : "";
|
|
251
|
-
const raw = await client.apiGet(`/api/v1/docker-deploy/hosts${suffix}`);
|
|
252
|
-
const hosts = unwrapHosts(raw);
|
|
253
|
-
if (isJsonMode(opts) || opts.json) {
|
|
254
|
-
printJson(hosts);
|
|
255
|
-
return;
|
|
256
|
-
}
|
|
257
|
-
console.log();
|
|
258
|
-
console.log(`${chalk.bold(String(hosts.length))} App Engine host(s)`);
|
|
259
|
-
console.log();
|
|
260
|
-
renderTable(hosts, [
|
|
261
|
-
{ header: "ID", key: (h) => shortId(h.id), width: 10 },
|
|
262
|
-
{
|
|
263
|
-
header: "WORKSPACE",
|
|
264
|
-
key: (h) => shortId(h.workspace_id),
|
|
265
|
-
width: 12,
|
|
266
|
-
},
|
|
267
|
-
{
|
|
268
|
-
header: "STATUS",
|
|
269
|
-
key: (h) => h.status,
|
|
270
|
-
width: 14,
|
|
271
|
-
color: (v) => statusLabel(v.trim()).padEnd(14),
|
|
272
|
-
},
|
|
273
|
-
{
|
|
274
|
-
header: "APPLIANCE",
|
|
275
|
-
key: (h) => h.appliance_status ?? "unknown",
|
|
276
|
-
width: 14,
|
|
277
|
-
},
|
|
278
|
-
{ header: "COMPUTER", key: (h) => shortId(h.computer_id), width: 12 },
|
|
279
|
-
{ header: "PORTAL", key: (h) => h.portal_domain ?? "—", width: 28 },
|
|
280
|
-
]);
|
|
281
|
-
console.log();
|
|
282
|
-
}
|
|
283
|
-
catch (err) {
|
|
284
|
-
handleError(err);
|
|
285
|
-
}
|
|
286
|
-
});
|
|
287
|
-
root
|
|
288
|
-
.command("templates")
|
|
289
|
-
.description("List App Engine starter templates")
|
|
290
|
-
.option("--json", "Output raw JSON")
|
|
291
|
-
.action(async (opts) => {
|
|
292
|
-
try {
|
|
293
|
-
const client = createClient();
|
|
294
|
-
const raw = await client.apiGet("/api/v1/docker-deploy/templates");
|
|
295
|
-
const templates = unwrapTemplates(raw);
|
|
296
|
-
if (isJsonMode(opts) || opts.json) {
|
|
297
|
-
printJson(templates);
|
|
298
|
-
return;
|
|
299
|
-
}
|
|
300
|
-
console.log();
|
|
301
|
-
console.log(`${chalk.bold(String(templates.length))} App Engine template(s)`);
|
|
302
|
-
console.log();
|
|
303
|
-
renderTable(templates, [
|
|
304
|
-
{ header: "ID", key: (t) => t.id, width: 24 },
|
|
305
|
-
{ header: "NAME", key: (t) => t.name, width: 28 },
|
|
306
|
-
{ header: "CATEGORY", key: (t) => t.category ?? "—", width: 16 },
|
|
307
|
-
{ header: "RUNTIME", key: (t) => t.runtime ?? "—", width: 16 },
|
|
308
|
-
]);
|
|
309
|
-
console.log();
|
|
310
|
-
}
|
|
311
|
-
catch (err) {
|
|
312
|
-
handleError(err);
|
|
313
|
-
}
|
|
314
|
-
});
|
|
315
|
-
root
|
|
316
|
-
.command("template")
|
|
317
|
-
.description("Show one App Engine starter template")
|
|
318
|
-
.argument("<template-id>", "App Engine template ID")
|
|
319
|
-
.option("--json", "Output raw JSON")
|
|
320
|
-
.action(async (templateId, opts) => {
|
|
321
|
-
try {
|
|
322
|
-
const client = createClient();
|
|
323
|
-
const raw = await client.apiGet(`/api/v1/docker-deploy/templates/${encodeURIComponent(templateId)}`);
|
|
324
|
-
const template = objectOf(raw, ["template"]);
|
|
325
|
-
if (isJsonMode(opts) || opts.json) {
|
|
326
|
-
printJson(template);
|
|
327
|
-
return;
|
|
328
|
-
}
|
|
329
|
-
printTemplate(template);
|
|
330
|
-
}
|
|
331
|
-
catch (err) {
|
|
332
|
-
handleError(err);
|
|
333
|
-
}
|
|
334
|
-
});
|
|
335
|
-
root
|
|
336
|
-
.command("ensure")
|
|
337
|
-
.description("Provision or return the workspace App Engine host")
|
|
338
|
-
.option("--workspace <id>", "Workspace ID")
|
|
339
|
-
.option("--external-workspace <id>", "External workspace/customer ID")
|
|
340
|
-
.option("--wait", "Wait until the appliance is active and healthy")
|
|
341
|
-
.option("--timeout <seconds>", "Wait timeout in seconds", parsePositiveInt, 600)
|
|
342
|
-
.option("--json", "Output raw JSON")
|
|
343
|
-
.action(async (opts) => {
|
|
344
|
-
try {
|
|
345
|
-
const client = createClient();
|
|
346
|
-
const raw = await client.apiPost("/api/v1/docker-deploy/hosts/ensure", {
|
|
347
|
-
...(opts.workspace ? { workspace_id: opts.workspace } : {}),
|
|
348
|
-
...(opts.externalWorkspace
|
|
349
|
-
? { external_workspace_id: opts.externalWorkspace }
|
|
350
|
-
: {}),
|
|
351
|
-
});
|
|
352
|
-
let host = objectOf(raw, ["host"]);
|
|
353
|
-
if (opts.wait)
|
|
354
|
-
host = await waitForHost(host, opts.timeout);
|
|
355
|
-
if (isJsonMode(opts) || opts.json) {
|
|
356
|
-
printJson(host);
|
|
357
|
-
return;
|
|
358
|
-
}
|
|
359
|
-
printHost(host);
|
|
360
|
-
if (!hostReady(host)) {
|
|
361
|
-
console.log(chalk.dim(" The appliance is not ready yet. Re-run `miosa docker-deploy show " +
|
|
362
|
-
host.id +
|
|
363
|
-
"` until status=active and appliance=healthy."));
|
|
364
|
-
console.log();
|
|
365
|
-
}
|
|
366
|
-
}
|
|
367
|
-
catch (err) {
|
|
368
|
-
handleError(err);
|
|
369
|
-
}
|
|
370
|
-
});
|
|
371
|
-
root
|
|
372
|
-
.command("show")
|
|
373
|
-
.description("Show one App Engine appliance host")
|
|
374
|
-
.argument("<host-id>", "App Engine host ID")
|
|
375
|
-
.option("--json", "Output raw JSON")
|
|
376
|
-
.action(async (hostId, opts) => {
|
|
377
|
-
try {
|
|
378
|
-
const client = createClient();
|
|
379
|
-
const raw = await client.apiGet(`/api/v1/docker-deploy/hosts/${encodeURIComponent(hostId)}`);
|
|
380
|
-
const host = objectOf(raw, ["host"]);
|
|
381
|
-
if (isJsonMode(opts) || opts.json) {
|
|
382
|
-
printJson(host);
|
|
383
|
-
return;
|
|
384
|
-
}
|
|
385
|
-
printHost(host);
|
|
386
|
-
}
|
|
387
|
-
catch (err) {
|
|
388
|
-
handleError(err);
|
|
389
|
-
}
|
|
390
|
-
});
|
|
391
|
-
root
|
|
392
|
-
.command("upgrade")
|
|
393
|
-
.description("Upgrade an existing App Engine in place to an exact immutable release")
|
|
394
|
-
.argument("<host-id>", "App Engine host ID")
|
|
395
|
-
.requiredOption("--release <sha>", "Exact appliance Git SHA or sha-* release tag")
|
|
396
|
-
.option("--no-wait", "Queue the upgrade without waiting for health")
|
|
397
|
-
.option("--timeout <seconds>", "Wait timeout in seconds", parsePositiveInt, 900)
|
|
398
|
-
.option("--json", "Output raw JSON")
|
|
399
|
-
.action(async (hostId, opts) => {
|
|
400
|
-
try {
|
|
401
|
-
const release = normalizeApplianceRelease(opts.release);
|
|
402
|
-
const applianceImage = `ghcr.io/miosa-osa/docker-deploy-appliance:${release}`;
|
|
403
|
-
const agentImage = `ghcr.io/miosa-osa/docker-deploy-appliance-agent:${release}`;
|
|
404
|
-
const client = createClient();
|
|
405
|
-
const raw = await client.apiPost(`/api/v1/docker-deploy/hosts/${encodeURIComponent(hostId)}/upgrade`, {
|
|
406
|
-
appliance_image: applianceImage,
|
|
407
|
-
agent_image: agentImage,
|
|
408
|
-
appliance_version: release,
|
|
409
|
-
});
|
|
410
|
-
let host = objectOf(raw, ["host"]);
|
|
411
|
-
if (opts.wait !== false) {
|
|
412
|
-
host = await waitForHostRelease(host, release, opts.timeout);
|
|
413
|
-
}
|
|
414
|
-
const result = {
|
|
415
|
-
ok: true,
|
|
416
|
-
queued: true,
|
|
417
|
-
release,
|
|
418
|
-
appliance_image: applianceImage,
|
|
419
|
-
agent_image: agentImage,
|
|
420
|
-
host,
|
|
421
|
-
};
|
|
422
|
-
if (isJsonMode(opts) || opts.json) {
|
|
423
|
-
printJson(result);
|
|
424
|
-
return;
|
|
425
|
-
}
|
|
426
|
-
printHost(host);
|
|
427
|
-
console.log(opts.wait === false
|
|
428
|
-
? chalk.yellow(` Upgrade to ${release} queued.`)
|
|
429
|
-
: chalk.green(` Upgrade to ${release} is active and healthy.`));
|
|
430
|
-
console.log();
|
|
431
|
-
}
|
|
432
|
-
catch (err) {
|
|
433
|
-
handleError(err);
|
|
434
|
-
}
|
|
435
|
-
});
|
|
436
|
-
root
|
|
437
|
-
.command("upgrade-fleet")
|
|
438
|
-
.description("Roll an exact immutable release through every App Engine host and verify every assigned deployment")
|
|
439
|
-
.requiredOption("--release <sha>", "Exact appliance Git SHA or sha-* release tag")
|
|
440
|
-
.option("--timeout <seconds>", "Per-host wait timeout in seconds", parsePositiveInt, 900)
|
|
441
|
-
.option("--json", "Output raw JSON")
|
|
442
|
-
.action(async (opts) => {
|
|
443
|
-
try {
|
|
444
|
-
const release = normalizeApplianceRelease(opts.release);
|
|
445
|
-
const hosts = unwrapHosts(await createClient().apiGet("/api/v1/docker-deploy/hosts")).sort((left, right) => left.id.localeCompare(right.id));
|
|
446
|
-
if (hosts.length === 0) {
|
|
447
|
-
throw new Error("No App Engine hosts were returned by the fleet.");
|
|
448
|
-
}
|
|
449
|
-
const results = [];
|
|
450
|
-
for (const host of hosts) {
|
|
451
|
-
try {
|
|
452
|
-
const verified = await upgradeHostToRelease(host.id, release, opts.timeout);
|
|
453
|
-
const metadata = verified.metadata ?? {};
|
|
454
|
-
results.push({
|
|
455
|
-
host_id: host.id,
|
|
456
|
-
status: "verified",
|
|
457
|
-
release,
|
|
458
|
-
verified_deployment_ids: metadata["fleet_upgrade_verified_deployment_ids"] ?? [],
|
|
459
|
-
verified_deployment_count: metadata["fleet_upgrade_verified_deployment_count"] ?? 0,
|
|
460
|
-
});
|
|
461
|
-
}
|
|
462
|
-
catch (error) {
|
|
463
|
-
results.push({
|
|
464
|
-
host_id: host.id,
|
|
465
|
-
status: "failed",
|
|
466
|
-
release,
|
|
467
|
-
error: error instanceof Error ? error.message : String(error),
|
|
468
|
-
});
|
|
469
|
-
}
|
|
470
|
-
}
|
|
471
|
-
const failures = results.filter((result) => result["status"] === "failed");
|
|
472
|
-
const result = {
|
|
473
|
-
ok: failures.length === 0,
|
|
474
|
-
release,
|
|
475
|
-
host_count: hosts.length,
|
|
476
|
-
verified_host_count: results.length - failures.length,
|
|
477
|
-
failed_host_count: failures.length,
|
|
478
|
-
results,
|
|
479
|
-
};
|
|
480
|
-
if (isJsonMode(opts) || opts.json) {
|
|
481
|
-
printJson(result);
|
|
482
|
-
}
|
|
483
|
-
else {
|
|
484
|
-
console.log(JSON.stringify(result, null, 2));
|
|
485
|
-
}
|
|
486
|
-
if (failures.length > 0)
|
|
487
|
-
process.exitCode = 1;
|
|
488
|
-
}
|
|
489
|
-
catch (err) {
|
|
490
|
-
handleError(err);
|
|
491
|
-
}
|
|
492
|
-
});
|
|
493
|
-
root
|
|
494
|
-
.command("doctor")
|
|
495
|
-
.description("Verify a App Engine deployment, host, route, and public URL")
|
|
496
|
-
.argument("<deployment-id>", "Deployment/app ID to verify")
|
|
497
|
-
.option("--probe-path <path>", "HTTP path to probe on the public URL", "/")
|
|
498
|
-
.option("--timeout <seconds>", "Public probe timeout in seconds", parsePositiveInt, 20)
|
|
499
|
-
.option("--no-probe", "Skip the public HTTP probe")
|
|
500
|
-
.option("--json", "Output raw JSON")
|
|
501
|
-
.action(async (deploymentId, opts) => {
|
|
502
|
-
try {
|
|
503
|
-
const client = createClient();
|
|
504
|
-
const deployment = objectOf(await client.apiGet(`/api/v1/deployments/${encodeURIComponent(deploymentId)}`), ["deployment"]);
|
|
505
|
-
const product = deploymentProduct(deployment);
|
|
506
|
-
const app = deploymentDockerDeployApp(deployment);
|
|
507
|
-
const hostId = deploymentHostId(deployment);
|
|
508
|
-
const runtime = deploymentRuntime(deployment);
|
|
509
|
-
const publicUrl = deploymentPublicUrl(deployment);
|
|
510
|
-
const activeVersionId = deployment.active_version_id ?? null;
|
|
511
|
-
const servingVersionId = app?.deployment_version_id ?? null;
|
|
512
|
-
let host = null;
|
|
513
|
-
if (hostId) {
|
|
514
|
-
host = objectOf(await client.apiGet(`/api/v1/docker-deploy/hosts/${encodeURIComponent(hostId)}`), ["host"]);
|
|
515
|
-
}
|
|
516
|
-
const probe = opts.probe === false
|
|
517
|
-
? null
|
|
518
|
-
: await probeUrl(publicUrl, opts.probePath, opts.timeout * 1000);
|
|
519
|
-
const checks = [
|
|
520
|
-
{
|
|
521
|
-
id: "deployment_product",
|
|
522
|
-
ok: product === "docker_deploy",
|
|
523
|
-
message: product === "docker_deploy"
|
|
524
|
-
? "Deployment is marked docker_deploy."
|
|
525
|
-
: `Deployment product is ${product}; expected docker_deploy.`,
|
|
526
|
-
recovery: [
|
|
527
|
-
"Publish with --docker-deploy or inspect deployment metadata.",
|
|
528
|
-
],
|
|
529
|
-
},
|
|
530
|
-
{
|
|
531
|
-
id: "host_linked",
|
|
532
|
-
ok: Boolean(hostId),
|
|
533
|
-
message: hostId
|
|
534
|
-
? `Deployment links to App Engine host ${hostId}.`
|
|
535
|
-
: "Deployment has no App Engine host id.",
|
|
536
|
-
recovery: ["Run miosa docker-deploy ensure --wait --json."],
|
|
537
|
-
},
|
|
538
|
-
{
|
|
539
|
-
id: "host_ready",
|
|
540
|
-
ok: Boolean(host && hostReady(host)),
|
|
541
|
-
message: host
|
|
542
|
-
? `Host status=${host.status}, appliance=${host.appliance_status ?? "unknown"}.`
|
|
543
|
-
: "App Engine host could not be loaded.",
|
|
544
|
-
recovery: hostId
|
|
545
|
-
? [
|
|
546
|
-
`miosa docker-deploy show ${hostId} --json`,
|
|
547
|
-
`miosa docker-deploy ensure --wait --json`,
|
|
548
|
-
]
|
|
549
|
-
: ["miosa docker-deploy ensure --wait --json"],
|
|
550
|
-
},
|
|
551
|
-
{
|
|
552
|
-
id: "appliance_route",
|
|
553
|
-
ok: Boolean(runtime.ip && runtime.port),
|
|
554
|
-
message: runtime.ip && runtime.port
|
|
555
|
-
? `Route points to ${runtime.ip}:${runtime.port}.`
|
|
556
|
-
: "Deployment runtime route is missing ip/port metadata.",
|
|
557
|
-
recovery: [
|
|
558
|
-
"Re-publish with miosa sandbox publish --docker-deploy --wait --json.",
|
|
559
|
-
],
|
|
560
|
-
},
|
|
561
|
-
{
|
|
562
|
-
id: "app_truth_row",
|
|
563
|
-
ok: Boolean(app),
|
|
564
|
-
message: app
|
|
565
|
-
? `App Engine app row exists with status=${app.status ?? "unknown"}.`
|
|
566
|
-
: "Deployment has no App Engine app row.",
|
|
567
|
-
recovery: [
|
|
568
|
-
"Re-publish with --docker-deploy --wait, then re-run doctor.",
|
|
569
|
-
],
|
|
570
|
-
},
|
|
571
|
-
{
|
|
572
|
-
id: "app_container_running",
|
|
573
|
-
ok: Boolean(app &&
|
|
574
|
-
app.status === "running" &&
|
|
575
|
-
stringField(app, "container_id") &&
|
|
576
|
-
numberField(app, "runtime_port") &&
|
|
577
|
-
stringField(app, "runtime_ip")),
|
|
578
|
-
message: app
|
|
579
|
-
? `App status=${app.status ?? "unknown"}, container=${app.container_id ?? "missing"}, route=${app.runtime_ip ?? "missing"}:${app.runtime_port ?? "missing"}.`
|
|
580
|
-
: "Cannot verify app container because the app row is missing.",
|
|
581
|
-
recovery: [
|
|
582
|
-
"Check the appliance container list.",
|
|
583
|
-
"Re-run miosa docker-deploy doctor <deployment-id> --json after the publish job completes.",
|
|
584
|
-
],
|
|
585
|
-
},
|
|
586
|
-
{
|
|
587
|
-
id: "version_reconciled",
|
|
588
|
-
ok: Boolean(activeVersionId &&
|
|
589
|
-
servingVersionId &&
|
|
590
|
-
activeVersionId === servingVersionId),
|
|
591
|
-
message: activeVersionId === servingVersionId && activeVersionId
|
|
592
|
-
? `Control plane and App Engine serve version ${activeVersionId}.`
|
|
593
|
-
: `Version mismatch: active=${activeVersionId ?? "missing"}, serving=${servingVersionId ?? "missing"}.`,
|
|
594
|
-
recovery: [
|
|
595
|
-
"Do not treat this promotion as live.",
|
|
596
|
-
"Re-run the exact version promotion after App Engine reconciliation is healthy.",
|
|
597
|
-
],
|
|
598
|
-
},
|
|
599
|
-
];
|
|
600
|
-
if (probe) {
|
|
601
|
-
checks.push({
|
|
602
|
-
id: "public_probe",
|
|
603
|
-
ok: probe.ok,
|
|
604
|
-
message: probe.ok
|
|
605
|
-
? `Public URL returned HTTP ${probe.status}.`
|
|
606
|
-
: `Public URL did not return a healthy app response: ${probe.error ?? `HTTP ${probe.status}, body=${probe.body_kind}`}.`,
|
|
607
|
-
recovery: [
|
|
608
|
-
"Check miosa deploy show <deployment-id> --json.",
|
|
609
|
-
"Check miosa docker-deploy show <host-id> --json.",
|
|
610
|
-
"Re-run miosa sandbox publish <sandbox-id> --docker-deploy --wait --json if the app container is gone.",
|
|
611
|
-
],
|
|
612
|
-
});
|
|
613
|
-
}
|
|
614
|
-
const result = {
|
|
615
|
-
ok: checks.every((check) => check.ok),
|
|
616
|
-
deployment_id: deployment.id ?? deploymentId,
|
|
617
|
-
deployment_product: product,
|
|
618
|
-
docker_deploy_host_id: hostId,
|
|
619
|
-
host_ready: Boolean(host && hostReady(host)),
|
|
620
|
-
docker_deploy_app: app,
|
|
621
|
-
route: runtime,
|
|
622
|
-
public_url: publicUrl,
|
|
623
|
-
public_probe: probe,
|
|
624
|
-
checks,
|
|
625
|
-
};
|
|
626
|
-
if (!result.ok)
|
|
627
|
-
process.exitCode = 1;
|
|
628
|
-
if (isJsonMode(opts) || opts.json) {
|
|
629
|
-
printJson(result);
|
|
630
|
-
return;
|
|
631
|
-
}
|
|
632
|
-
console.log();
|
|
633
|
-
console.log(chalk.bold("App Engine doctor"));
|
|
634
|
-
console.log();
|
|
635
|
-
console.log(` Deployment: ${result.deployment_id}`);
|
|
636
|
-
console.log(` Product: ${result.deployment_product}`);
|
|
637
|
-
console.log(` Host: ${result.docker_deploy_host_id ?? "—"}`);
|
|
638
|
-
console.log(` Container: ${app?.container_id ?? "—"}`);
|
|
639
|
-
console.log(` Route: ${runtime.ip && runtime.port ? `${runtime.ip}:${runtime.port}` : "—"}`);
|
|
640
|
-
console.log(` URL: ${result.public_url ?? "—"}`);
|
|
641
|
-
console.log();
|
|
642
|
-
for (const check of checks) {
|
|
643
|
-
console.log(` ${check.ok ? chalk.green("✓") : chalk.red("✗")} ${check.id}: ${check.message}`);
|
|
644
|
-
}
|
|
645
|
-
console.log();
|
|
646
|
-
}
|
|
647
|
-
catch (err) {
|
|
648
|
-
handleError(err);
|
|
649
|
-
}
|
|
650
|
-
});
|
|
651
|
-
}
|
|
652
|
-
function parsePositiveInt(value) {
|
|
653
|
-
const parsed = Number.parseInt(value, 10);
|
|
654
|
-
if (!Number.isFinite(parsed) || parsed <= 0) {
|
|
655
|
-
throw new Error(`Invalid positive integer: ${value}`);
|
|
656
|
-
}
|
|
657
|
-
return parsed;
|
|
658
|
-
}
|
|
659
|
-
//# sourceMappingURL=docker-deploy.js.map
|