@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,706 +0,0 @@
|
|
|
1
|
-
import fs from "node:fs";
|
|
2
|
-
import { spawn } from "node:child_process";
|
|
3
|
-
import chalk from "chalk";
|
|
4
|
-
import { addDataOption, apiPath, client, deleteAndPrint, enc, getAndPrint, parseData, postAndPrint, printValue, resourceCommands, runAction, unwrap, } from "./enterprise-util.js";
|
|
5
|
-
import { isJsonMode } from "../cli-env.js";
|
|
6
|
-
import { MiosaClient, parseSse } from "../client.js";
|
|
7
|
-
import { loadConfig } from "../config.js";
|
|
8
|
-
import { UserError } from "../errors.js";
|
|
9
|
-
import { toComputerId } from "../types.js";
|
|
10
|
-
import { parseEnvPairs } from "./util.js";
|
|
11
|
-
import { pickOne } from "../ui/picker.js";
|
|
12
|
-
import { spin } from "../ui/spinner.js";
|
|
13
|
-
import { formatDuration, hintBlock, icon, kvPanel, printBanner, printElapsed, } from "../ui/render.js";
|
|
14
|
-
import { renderTable } from "../ui/table.js";
|
|
15
|
-
const actions = [
|
|
16
|
-
"start",
|
|
17
|
-
"stop",
|
|
18
|
-
"restart",
|
|
19
|
-
"clone",
|
|
20
|
-
"resize",
|
|
21
|
-
"move",
|
|
22
|
-
];
|
|
23
|
-
function openUrl(url) {
|
|
24
|
-
const command = process.platform === "darwin"
|
|
25
|
-
? "open"
|
|
26
|
-
: process.platform === "win32"
|
|
27
|
-
? "cmd"
|
|
28
|
-
: "xdg-open";
|
|
29
|
-
const args = process.platform === "win32" ? ["/c", "start", "", url] : [url];
|
|
30
|
-
const child = spawn(command, args, { detached: true, stdio: "ignore" });
|
|
31
|
-
child.unref();
|
|
32
|
-
}
|
|
33
|
-
function colorStatus(status) {
|
|
34
|
-
const s = status.toLowerCase();
|
|
35
|
-
if (s === "running")
|
|
36
|
-
return chalk.green(status);
|
|
37
|
-
if (s === "provisioning" || s === "starting" || s === "pending")
|
|
38
|
-
return chalk.yellow(status);
|
|
39
|
-
if (s === "error" || s === "failed" || s === "stopped")
|
|
40
|
-
return chalk.red(status);
|
|
41
|
-
return chalk.dim(status || "—");
|
|
42
|
-
}
|
|
43
|
-
function friendlyComputerType(record) {
|
|
44
|
-
const template = String(record["template_type"] ?? record["template"] ?? "").toLowerCase();
|
|
45
|
-
return template.includes("desktop") ? "Desktop" : "Computer";
|
|
46
|
-
}
|
|
47
|
-
async function promptForComputerDetails() {
|
|
48
|
-
const { default: inquirer } = await import("inquirer");
|
|
49
|
-
return inquirer.prompt([
|
|
50
|
-
{
|
|
51
|
-
type: "input",
|
|
52
|
-
name: "name",
|
|
53
|
-
message: "What should we call your computer?",
|
|
54
|
-
default: "my-computer",
|
|
55
|
-
validate: (value) => value.trim().length > 0 || "Enter a name for your computer.",
|
|
56
|
-
filter: (value) => value.trim(),
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
type: "list",
|
|
60
|
-
name: "size",
|
|
61
|
-
message: "Choose a size",
|
|
62
|
-
default: "small",
|
|
63
|
-
choices: [
|
|
64
|
-
{ name: "Small Everyday development", value: "small" },
|
|
65
|
-
{ name: "Medium Larger builds and multitasking", value: "medium" },
|
|
66
|
-
{ name: "Large Heavy workloads", value: "large" },
|
|
67
|
-
],
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
type: "list",
|
|
71
|
-
name: "region",
|
|
72
|
-
message: "Choose a location",
|
|
73
|
-
default: "us-mia",
|
|
74
|
-
choices: [
|
|
75
|
-
{ name: "Miami", value: "us-mia" },
|
|
76
|
-
{ name: "New York", value: "us-nyc" },
|
|
77
|
-
{ name: "Los Angeles", value: "us-la" },
|
|
78
|
-
],
|
|
79
|
-
},
|
|
80
|
-
]);
|
|
81
|
-
}
|
|
82
|
-
async function resolveComputerForDesktop(requested) {
|
|
83
|
-
const raw = unwrap(await client().apiGet(apiPath("/computers")));
|
|
84
|
-
const computers = Array.isArray(raw)
|
|
85
|
-
? raw
|
|
86
|
-
: [];
|
|
87
|
-
const available = computers.filter((computer) => ["running", "active", "provisioning", "starting", "pending"].includes(String(computer["status"] ?? "").toLowerCase()));
|
|
88
|
-
if (requested) {
|
|
89
|
-
const normalized = requested.toLowerCase();
|
|
90
|
-
const match = computers.find((computer) => String(computer["id"] ?? "").toLowerCase() === normalized ||
|
|
91
|
-
String(computer["name"] ?? "").toLowerCase() === normalized);
|
|
92
|
-
if (!match) {
|
|
93
|
-
throw new UserError(`Computer "${requested}" was not found.`, "Run `miosa computers list` to see available computers.");
|
|
94
|
-
}
|
|
95
|
-
if (!available.includes(match)) {
|
|
96
|
-
throw new UserError(`Computer "${requested}" is not running.`, `Start it with \`miosa computers action ${String(match["id"])} start\`.`);
|
|
97
|
-
}
|
|
98
|
-
return match;
|
|
99
|
-
}
|
|
100
|
-
const picked = await pickOne(available.map((computer) => ({
|
|
101
|
-
id: String(computer["id"] ?? ""),
|
|
102
|
-
label: String(computer["name"] ?? computer["id"] ?? "Unnamed computer"),
|
|
103
|
-
hint: [
|
|
104
|
-
String(computer["status"] ?? ""),
|
|
105
|
-
String(computer["region"] ?? ""),
|
|
106
|
-
String(computer["size"] ?? ""),
|
|
107
|
-
]
|
|
108
|
-
.filter(Boolean)
|
|
109
|
-
.join(" · "),
|
|
110
|
-
data: computer,
|
|
111
|
-
})), "Which desktop would you like to open?");
|
|
112
|
-
return picked.data;
|
|
113
|
-
}
|
|
114
|
-
async function waitUntilDesktopReady(computer) {
|
|
115
|
-
const ready = new Set(["running", "active"]);
|
|
116
|
-
const transitional = new Set(["provisioning", "starting", "pending"]);
|
|
117
|
-
let current = computer;
|
|
118
|
-
let status = String(current["status"] ?? "").toLowerCase();
|
|
119
|
-
if (ready.has(status))
|
|
120
|
-
return current;
|
|
121
|
-
if (!transitional.has(status))
|
|
122
|
-
return current;
|
|
123
|
-
const name = String(current["name"] ?? current["id"] ?? "computer");
|
|
124
|
-
const spinner = spin(`Preparing ${name}...`);
|
|
125
|
-
const deadline = Date.now() + 120_000;
|
|
126
|
-
while (Date.now() < deadline) {
|
|
127
|
-
await sleep(2_000);
|
|
128
|
-
current = unwrap(await client().apiGet(apiPath(`/computers/${enc(String(computer["id"]))}`)));
|
|
129
|
-
status = String(current["status"] ?? "").toLowerCase();
|
|
130
|
-
if (ready.has(status)) {
|
|
131
|
-
spinner.succeed(`${name} is ready`);
|
|
132
|
-
return current;
|
|
133
|
-
}
|
|
134
|
-
if (!transitional.has(status)) {
|
|
135
|
-
spinner.fail(`${name} entered status ${status || "unknown"}`);
|
|
136
|
-
throw new UserError(`Computer "${name}" did not become ready.`, `Inspect it with \`miosa computers show ${String(computer["id"])}\`.`);
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
spinner.fail(`${name} is still preparing`);
|
|
140
|
-
throw new UserError(`Computer "${name}" is taking longer than expected to start.`, `Check it with \`miosa computers show ${String(computer["id"])}\`, then run \`miosa computers open ${name}\` again.`);
|
|
141
|
-
}
|
|
142
|
-
async function openComputerDesktop(requested, opts) {
|
|
143
|
-
const selected = await resolveComputerForDesktop(requested);
|
|
144
|
-
const computer = await waitUntilDesktopReady(selected);
|
|
145
|
-
const id = String(computer["id"]);
|
|
146
|
-
const name = String(computer["name"] ?? id);
|
|
147
|
-
const access = unwrap(await client().apiGet(apiPath(`/computers/${enc(id)}/embed`)));
|
|
148
|
-
const url = String(access["embed_url"] ?? access["desktop_url"] ?? "");
|
|
149
|
-
if (!url) {
|
|
150
|
-
throw new UserError(`MIOSA could not prepare desktop access for "${name}".`, `Check it with \`miosa computers show ${id}\` and try again.`);
|
|
151
|
-
}
|
|
152
|
-
if (isJsonMode(opts)) {
|
|
153
|
-
console.log(JSON.stringify({
|
|
154
|
-
id,
|
|
155
|
-
name,
|
|
156
|
-
url,
|
|
157
|
-
expires_at: access["expires_at"] ?? null,
|
|
158
|
-
password_required: false,
|
|
159
|
-
}, null, 2));
|
|
160
|
-
return;
|
|
161
|
-
}
|
|
162
|
-
if (opts.printUrl) {
|
|
163
|
-
console.log(url);
|
|
164
|
-
return;
|
|
165
|
-
}
|
|
166
|
-
openUrl(url);
|
|
167
|
-
console.log();
|
|
168
|
-
console.log(` ${icon.ok} Opening ${chalk.bold(name)} in your browser`);
|
|
169
|
-
console.log();
|
|
170
|
-
}
|
|
171
|
-
function collectOption(value, previous) {
|
|
172
|
-
previous.push(value);
|
|
173
|
-
return previous;
|
|
174
|
-
}
|
|
175
|
-
function isTerminalRunStatus(status) {
|
|
176
|
-
return (typeof status === "string" &&
|
|
177
|
-
["succeeded", "failed", "canceled", "cancelled"].includes(status.toLowerCase()));
|
|
178
|
-
}
|
|
179
|
-
function sleep(ms) {
|
|
180
|
-
if (ms <= 0)
|
|
181
|
-
return Promise.resolve();
|
|
182
|
-
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
183
|
-
}
|
|
184
|
-
async function waitForComputerRun(runId, timeoutSec) {
|
|
185
|
-
const deadline = Date.now() + timeoutSec * 1000;
|
|
186
|
-
while (true) {
|
|
187
|
-
const run = unwrap(await client().apiGet(apiPath(`/runs/${enc(runId)}`)));
|
|
188
|
-
if (isTerminalRunStatus(run["status"]))
|
|
189
|
-
return run;
|
|
190
|
-
if (Date.now() >= deadline) {
|
|
191
|
-
throw new Error(`Timed out waiting for run ${runId}`);
|
|
192
|
-
}
|
|
193
|
-
await sleep(Math.min(2_000, Math.max(0, deadline - Date.now())));
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
export function register(program) {
|
|
197
|
-
resourceCommands({
|
|
198
|
-
program,
|
|
199
|
-
command: "computers",
|
|
200
|
-
description: "Manage Computers (Firecracker microVMs with optional desktops)",
|
|
201
|
-
route: "/computers",
|
|
202
|
-
itemName: "computer-id",
|
|
203
|
-
actions,
|
|
204
|
-
// list, show, and create are registered below with styled overrides.
|
|
205
|
-
skipCommands: ["list", "show", "create"],
|
|
206
|
-
});
|
|
207
|
-
const computers = program.commands.find((cmd) => cmd.name() === "computers");
|
|
208
|
-
// Back-compat alias: `miosa machines` continues to work for one release.
|
|
209
|
-
computers.alias("machines");
|
|
210
|
-
// Workspace-aware list (skipped in resourceCommands via skipCommands).
|
|
211
|
-
computers
|
|
212
|
-
.command("list")
|
|
213
|
-
.description("List computers, optionally filtered to a workspace")
|
|
214
|
-
.option("--workspace <workspace-id>", "Filter by workspace ID")
|
|
215
|
-
.option("--json", "Output as JSON")
|
|
216
|
-
.action((opts) => runAction(async () => {
|
|
217
|
-
const url = new URL(apiPath("/computers"), "https://placeholder.invalid");
|
|
218
|
-
if (opts.workspace)
|
|
219
|
-
url.searchParams.set("workspace_id", opts.workspace);
|
|
220
|
-
const path = url.pathname + (url.search ? url.search : "");
|
|
221
|
-
const raw = unwrap(await client().apiGet(apiPath(path)));
|
|
222
|
-
if (isJsonMode(opts)) {
|
|
223
|
-
console.log(JSON.stringify(raw, null, 2));
|
|
224
|
-
return;
|
|
225
|
-
}
|
|
226
|
-
const rows = Array.isArray(raw)
|
|
227
|
-
? raw
|
|
228
|
-
: [];
|
|
229
|
-
console.log();
|
|
230
|
-
if (rows.length === 0) {
|
|
231
|
-
console.log(kvPanel([
|
|
232
|
-
{
|
|
233
|
-
icon: icon.info,
|
|
234
|
-
label: "Computers",
|
|
235
|
-
value: chalk.dim("0 — none created yet"),
|
|
236
|
-
},
|
|
237
|
-
]));
|
|
238
|
-
console.log();
|
|
239
|
-
console.log(hintBlock("Create your first computer", [
|
|
240
|
-
"miosa computers create",
|
|
241
|
-
"miosa computers create --name boris",
|
|
242
|
-
]));
|
|
243
|
-
console.log();
|
|
244
|
-
return;
|
|
245
|
-
}
|
|
246
|
-
console.log(` ${icon.info} ${chalk.bold(String(rows.length))} ${chalk.dim("computer(s)")}`);
|
|
247
|
-
console.log();
|
|
248
|
-
renderTable(rows, [
|
|
249
|
-
{
|
|
250
|
-
header: "ID",
|
|
251
|
-
key: (r) => String(r["id"] ?? ""),
|
|
252
|
-
width: 12,
|
|
253
|
-
},
|
|
254
|
-
{
|
|
255
|
-
header: "NAME",
|
|
256
|
-
key: (r) => String(r["name"] ?? chalk.dim("—")),
|
|
257
|
-
},
|
|
258
|
-
{
|
|
259
|
-
header: "STATUS",
|
|
260
|
-
key: (r) => String(r["status"] ?? ""),
|
|
261
|
-
color: (val) => colorStatus(val.trim()),
|
|
262
|
-
},
|
|
263
|
-
{
|
|
264
|
-
header: "TYPE",
|
|
265
|
-
key: (r) => friendlyComputerType(r),
|
|
266
|
-
},
|
|
267
|
-
{
|
|
268
|
-
header: "REGION",
|
|
269
|
-
key: (r) => String(r["region"] ?? chalk.dim("—")),
|
|
270
|
-
},
|
|
271
|
-
{
|
|
272
|
-
header: "CREATED",
|
|
273
|
-
key: (r) => String(r["created_at"] ?? chalk.dim("—")),
|
|
274
|
-
},
|
|
275
|
-
]);
|
|
276
|
-
console.log();
|
|
277
|
-
console.log(hintBlock("Try", [
|
|
278
|
-
"miosa computers show <id>",
|
|
279
|
-
"miosa computers create --name <name>",
|
|
280
|
-
]));
|
|
281
|
-
console.log();
|
|
282
|
-
}));
|
|
283
|
-
// Styled show (skipped in resourceCommands via skipCommands).
|
|
284
|
-
computers
|
|
285
|
-
.command("show <computer-id>")
|
|
286
|
-
.description("Show a computer")
|
|
287
|
-
.option("--json", "Output as JSON")
|
|
288
|
-
.action((id, opts) => runAction(async () => {
|
|
289
|
-
const raw = unwrap(await client().apiGet(apiPath(`/computers/${enc(id)}`)));
|
|
290
|
-
if (isJsonMode(opts)) {
|
|
291
|
-
console.log(JSON.stringify(raw, null, 2));
|
|
292
|
-
return;
|
|
293
|
-
}
|
|
294
|
-
const c = raw;
|
|
295
|
-
const status = String(c["status"] ?? "");
|
|
296
|
-
printBanner({ subtitle: "Computer" });
|
|
297
|
-
console.log(kvPanel([
|
|
298
|
-
{
|
|
299
|
-
icon: icon.ok,
|
|
300
|
-
label: "id",
|
|
301
|
-
value: chalk.dim(String(c["id"] ?? "—")),
|
|
302
|
-
},
|
|
303
|
-
{ label: "name", value: chalk.bold(String(c["name"] ?? "—")) },
|
|
304
|
-
{ label: "status", value: colorStatus(status) },
|
|
305
|
-
{
|
|
306
|
-
label: "type",
|
|
307
|
-
value: friendlyComputerType(c),
|
|
308
|
-
},
|
|
309
|
-
{ label: "size", value: String(c["size"] ?? chalk.dim("—")) },
|
|
310
|
-
{ label: "region", value: String(c["region"] ?? chalk.dim("—")) },
|
|
311
|
-
...(c["ip_address"]
|
|
312
|
-
? [
|
|
313
|
-
{
|
|
314
|
-
label: "ip_address",
|
|
315
|
-
value: chalk.cyan(String(c["ip_address"])),
|
|
316
|
-
},
|
|
317
|
-
]
|
|
318
|
-
: []),
|
|
319
|
-
{
|
|
320
|
-
label: "created_at",
|
|
321
|
-
value: chalk.dim(String(c["created_at"] ?? "—")),
|
|
322
|
-
},
|
|
323
|
-
...(c["public_url"]
|
|
324
|
-
? [
|
|
325
|
-
{
|
|
326
|
-
label: "public_url",
|
|
327
|
-
value: chalk.cyan(String(c["public_url"])),
|
|
328
|
-
},
|
|
329
|
-
]
|
|
330
|
-
: []),
|
|
331
|
-
]));
|
|
332
|
-
console.log();
|
|
333
|
-
console.log(hintBlock("Try", [
|
|
334
|
-
`miosa computers open ${String(c["name"] ?? id)}`,
|
|
335
|
-
`miosa ssh ${String(c["name"] ?? id)}`,
|
|
336
|
-
`miosa exec ${String(c["name"] ?? id)} "pwd"`,
|
|
337
|
-
`miosa watch ${String(c["name"] ?? id)}`,
|
|
338
|
-
`miosa computers action ${id} stop`,
|
|
339
|
-
]));
|
|
340
|
-
console.log();
|
|
341
|
-
}));
|
|
342
|
-
computers
|
|
343
|
-
.command("viewer-password <computer-id>")
|
|
344
|
-
.alias("password")
|
|
345
|
-
.description("Show external desktop viewer-password status")
|
|
346
|
-
.option("--json", "Output as JSON")
|
|
347
|
-
.action((id, opts) => runAction(async () => {
|
|
348
|
-
const raw = unwrap(await client().apiGet(apiPath(`/computers/${enc(id)}/viewer-password`)));
|
|
349
|
-
if (isJsonMode(opts)) {
|
|
350
|
-
console.log(JSON.stringify(raw, null, 2));
|
|
351
|
-
return;
|
|
352
|
-
}
|
|
353
|
-
printBanner({ subtitle: "External desktop viewer password" });
|
|
354
|
-
console.log(kvPanel([
|
|
355
|
-
{ icon: icon.info, label: "computer", value: chalk.dim(id) },
|
|
356
|
-
{
|
|
357
|
-
label: "password_set",
|
|
358
|
-
value: raw["password_set"] ? chalk.green("yes") : chalk.yellow("no"),
|
|
359
|
-
},
|
|
360
|
-
...(raw["viewer_password_set_at"] || raw["password_set_at"]
|
|
361
|
-
? [
|
|
362
|
-
{
|
|
363
|
-
label: "set_at",
|
|
364
|
-
value: chalk.dim(String(raw["viewer_password_set_at"] ?? raw["password_set_at"])),
|
|
365
|
-
},
|
|
366
|
-
]
|
|
367
|
-
: []),
|
|
368
|
-
]));
|
|
369
|
-
console.log();
|
|
370
|
-
console.log(hintBlock("Use", [
|
|
371
|
-
`miosa computers rotate-viewer-password ${id}`,
|
|
372
|
-
"Authenticated platform desktop links do not need this password.",
|
|
373
|
-
]));
|
|
374
|
-
console.log();
|
|
375
|
-
}));
|
|
376
|
-
computers
|
|
377
|
-
.command("rotate-viewer-password <computer-id>")
|
|
378
|
-
.alias("rotate-password")
|
|
379
|
-
.description("Rotate and print the external desktop viewer password once")
|
|
380
|
-
.option("--json", "Output as JSON")
|
|
381
|
-
.action((id, opts) => runAction(async () => {
|
|
382
|
-
const raw = unwrap(await client().apiPost(apiPath(`/computers/${enc(id)}/viewer-password/rotate`), {}));
|
|
383
|
-
if (isJsonMode(opts)) {
|
|
384
|
-
console.log(JSON.stringify(raw, null, 2));
|
|
385
|
-
return;
|
|
386
|
-
}
|
|
387
|
-
const password = String(raw["viewer_password"] ?? raw["password"] ?? "");
|
|
388
|
-
printBanner({ subtitle: "Rotated external viewer password" });
|
|
389
|
-
console.log(kvPanel([
|
|
390
|
-
{ icon: icon.ok, label: "computer", value: chalk.dim(id) },
|
|
391
|
-
{
|
|
392
|
-
label: "viewer_password",
|
|
393
|
-
value: password ? chalk.bold(password) : chalk.dim("not returned"),
|
|
394
|
-
},
|
|
395
|
-
...(raw["rotated_at"]
|
|
396
|
-
? [{ label: "rotated_at", value: chalk.dim(String(raw["rotated_at"])) }]
|
|
397
|
-
: []),
|
|
398
|
-
]));
|
|
399
|
-
console.log();
|
|
400
|
-
console.log(chalk.yellow("This password is for raw external desktop viewer links. Store it now; it may not be returned again."));
|
|
401
|
-
console.log();
|
|
402
|
-
}));
|
|
403
|
-
computers
|
|
404
|
-
.command("run-agent <computer-id> <instruction...>")
|
|
405
|
-
.description("Run an in-Computer runner with the given instruction")
|
|
406
|
-
.option("--runner <name>", "Runner: claude-code (default), codex, claude (alias), hermes, osa, pi")
|
|
407
|
-
.option("--model <name>", "Provider-specific model name")
|
|
408
|
-
.option("--cwd <path>", "Working directory inside the Computer")
|
|
409
|
-
.option("--env <KEY=VALUE>", "Environment variable for the run. Repeatable.", collectOption, [])
|
|
410
|
-
.option("--timeout <sec>", "Exec timeout in seconds")
|
|
411
|
-
.option("--wait", "Wait for run completion")
|
|
412
|
-
.option("--wait-timeout <sec>", "Maximum seconds to wait for --wait")
|
|
413
|
-
.option("--json", "Output as JSON")
|
|
414
|
-
.action((id, words, opts) => runAction(async () => {
|
|
415
|
-
const runner = opts.runner ?? "claude-code";
|
|
416
|
-
const allowedRunners = [
|
|
417
|
-
"claude-code",
|
|
418
|
-
"codex",
|
|
419
|
-
"claude",
|
|
420
|
-
"hermes",
|
|
421
|
-
"osa",
|
|
422
|
-
"pi",
|
|
423
|
-
];
|
|
424
|
-
if (!allowedRunners.includes(runner)) {
|
|
425
|
-
throw new Error(`Unsupported runner "${runner}". Use: ${allowedRunners.join(", ")}`);
|
|
426
|
-
}
|
|
427
|
-
const body = {
|
|
428
|
-
target_kind: "computer",
|
|
429
|
-
target_id: id,
|
|
430
|
-
computer_id: id,
|
|
431
|
-
runner,
|
|
432
|
-
instruction: words.join(" "),
|
|
433
|
-
};
|
|
434
|
-
if (opts.model)
|
|
435
|
-
body["model"] = opts.model;
|
|
436
|
-
if (opts.cwd)
|
|
437
|
-
body["cwd"] = opts.cwd;
|
|
438
|
-
if (opts.env && opts.env.length > 0) {
|
|
439
|
-
body["env"] = parseEnvPairs(opts.env);
|
|
440
|
-
}
|
|
441
|
-
if (opts.timeout != null) {
|
|
442
|
-
body["timeout"] = Number.parseInt(opts.timeout, 10);
|
|
443
|
-
}
|
|
444
|
-
if (opts.wait)
|
|
445
|
-
body["wait"] = true;
|
|
446
|
-
let run = unwrap(await client().apiPost(apiPath("/runs"), body));
|
|
447
|
-
if (opts.wait) {
|
|
448
|
-
const runId = String(run["id"] ?? "");
|
|
449
|
-
const waitTimeout = Number.parseInt(opts.waitTimeout ?? opts.timeout ?? "900", 10);
|
|
450
|
-
run = await waitForComputerRun(runId, waitTimeout);
|
|
451
|
-
}
|
|
452
|
-
if (isJsonMode(opts)) {
|
|
453
|
-
console.log(JSON.stringify(run, null, 2));
|
|
454
|
-
return;
|
|
455
|
-
}
|
|
456
|
-
printBanner({ subtitle: "Computer run" });
|
|
457
|
-
console.log(kvPanel([
|
|
458
|
-
{ label: "run", value: chalk.bold(String(run["id"] ?? "—")) },
|
|
459
|
-
{ label: "computer", value: chalk.dim(id) },
|
|
460
|
-
{ label: "runner", value: String(run["runner"] ?? runner) },
|
|
461
|
-
{ label: "status", value: colorStatus(String(run["status"] ?? "")) },
|
|
462
|
-
{ label: "exit", value: String(run["exit_code"] ?? "—") },
|
|
463
|
-
]));
|
|
464
|
-
const output = String(run["output"] ?? "").trim();
|
|
465
|
-
const stderr = String(run["stderr"] ?? "").trim();
|
|
466
|
-
if (output)
|
|
467
|
-
console.log(`\n${output}`);
|
|
468
|
-
if (stderr)
|
|
469
|
-
console.error(`\n${chalk.red(stderr)}`);
|
|
470
|
-
console.log();
|
|
471
|
-
}));
|
|
472
|
-
// Workspace-aware create (skipped in resourceCommands via skipCommands).
|
|
473
|
-
addDataOption(computers
|
|
474
|
-
.command("create")
|
|
475
|
-
.description("Create a persistent cloud computer with a desktop")
|
|
476
|
-
.option("--name <name>", "Name your computer")
|
|
477
|
-
.option("--size <size>", "Size: small, medium, or large", "small")
|
|
478
|
-
.option("--region <region>", "Location: us-mia, us-nyc, or us-la", "us-mia")
|
|
479
|
-
.option("--workspace <workspace-id>", "Workspace to assign the computer to")
|
|
480
|
-
.option("--external-workspace <id>", "Your internal workspace ID (attribution)")
|
|
481
|
-
.option("--external-project <id>", "Your internal project ID (attribution)")
|
|
482
|
-
.option("--agent-profile <profile-id>", "Agent runtime profile to mount into the computer")
|
|
483
|
-
.option("--skip-agent-profile", "Do not apply the default agent runtime profile"))
|
|
484
|
-
.option("--json", "Output as JSON")
|
|
485
|
-
.addHelpText("after", `
|
|
486
|
-
Examples:
|
|
487
|
-
miosa computers create --name boris
|
|
488
|
-
miosa computers create --name boris --size medium
|
|
489
|
-
miosa computers create --name boris --region us-nyc
|
|
490
|
-
|
|
491
|
-
Run without flags for guided setup:
|
|
492
|
-
miosa computers create
|
|
493
|
-
|
|
494
|
-
Defaults:
|
|
495
|
-
size=small, region=us-mia, desktop included
|
|
496
|
-
`)
|
|
497
|
-
.action((opts) => runAction(async () => {
|
|
498
|
-
const base = parseData(opts.data, opts.input, opts.file) ?? {};
|
|
499
|
-
const hasStructuredInput = Boolean(opts.data || opts.input || opts.file);
|
|
500
|
-
if (!opts.name && base["name"] == null && !hasStructuredInput) {
|
|
501
|
-
if (!process.stdin.isTTY || isJsonMode(opts)) {
|
|
502
|
-
throw new UserError("A computer name is required in non-interactive mode.", "Try `miosa computers create --name boris`.");
|
|
503
|
-
}
|
|
504
|
-
const answers = await promptForComputerDetails();
|
|
505
|
-
opts.name = answers.name;
|
|
506
|
-
opts.size = answers.size;
|
|
507
|
-
opts.region = answers.region;
|
|
508
|
-
}
|
|
509
|
-
if (opts.name)
|
|
510
|
-
base["name"] = opts.name;
|
|
511
|
-
if (base["template_type"] == null)
|
|
512
|
-
base["template_type"] = "miosa-desktop";
|
|
513
|
-
if (base["size"] == null)
|
|
514
|
-
base["size"] = opts.size ?? "small";
|
|
515
|
-
if (base["region"] == null)
|
|
516
|
-
base["region"] = opts.region ?? "us-mia";
|
|
517
|
-
if (opts.workspace)
|
|
518
|
-
base["workspace_id"] = opts.workspace;
|
|
519
|
-
if (opts.externalWorkspace)
|
|
520
|
-
base["external_workspace_id"] = opts.externalWorkspace;
|
|
521
|
-
if (opts.externalProject)
|
|
522
|
-
base["external_project_id"] = opts.externalProject;
|
|
523
|
-
if (opts.agentProfile)
|
|
524
|
-
base["agent_runtime_profile_id"] = opts.agentProfile;
|
|
525
|
-
if (opts.skipAgentProfile)
|
|
526
|
-
base["skip_agent_runtime_profile"] = true;
|
|
527
|
-
const createStart = Date.now();
|
|
528
|
-
const result = await client().apiPost(apiPath("/computers"), base);
|
|
529
|
-
const value = result !== null &&
|
|
530
|
-
typeof result === "object" &&
|
|
531
|
-
!Array.isArray(result) &&
|
|
532
|
-
"data" in result
|
|
533
|
-
? result["data"]
|
|
534
|
-
: result;
|
|
535
|
-
if (isJsonMode(opts)) {
|
|
536
|
-
printValue(value, opts);
|
|
537
|
-
return;
|
|
538
|
-
}
|
|
539
|
-
const c = value !== null && typeof value === "object" && !Array.isArray(value)
|
|
540
|
-
? value
|
|
541
|
-
: {};
|
|
542
|
-
const newId = String(c["id"] ?? "—");
|
|
543
|
-
printBanner({ subtitle: "Create computer" });
|
|
544
|
-
console.log(kvPanel([
|
|
545
|
-
{ icon: icon.ok, label: "id", value: chalk.dim(newId) },
|
|
546
|
-
{
|
|
547
|
-
label: "name",
|
|
548
|
-
value: chalk.bold(String(c["name"] ?? base["name"] ?? "—")),
|
|
549
|
-
},
|
|
550
|
-
{
|
|
551
|
-
label: "status",
|
|
552
|
-
value: colorStatus(String(c["status"] ?? "provisioning")),
|
|
553
|
-
},
|
|
554
|
-
{
|
|
555
|
-
label: "type",
|
|
556
|
-
value: "Desktop computer",
|
|
557
|
-
},
|
|
558
|
-
{
|
|
559
|
-
label: "size",
|
|
560
|
-
value: String(c["size"] ?? base["size"] ?? chalk.dim("—")),
|
|
561
|
-
},
|
|
562
|
-
{
|
|
563
|
-
label: "location",
|
|
564
|
-
value: String(c["region"] ?? base["region"] ?? chalk.dim("—")),
|
|
565
|
-
},
|
|
566
|
-
]));
|
|
567
|
-
const viewerPassword = String(c["viewer_password"] ?? "");
|
|
568
|
-
if (viewerPassword) {
|
|
569
|
-
console.log();
|
|
570
|
-
console.log(kvPanel([
|
|
571
|
-
{
|
|
572
|
-
icon: icon.warn,
|
|
573
|
-
label: "viewer password",
|
|
574
|
-
value: chalk.bold(viewerPassword),
|
|
575
|
-
},
|
|
576
|
-
]));
|
|
577
|
-
console.log();
|
|
578
|
-
console.log(` ${chalk.yellow("Save this password now.")} ${chalk.dim("It is shown once and is only needed for direct or external viewer access.")}`);
|
|
579
|
-
console.log(` ${chalk.dim(`Signed-in access with \`miosa computers open ${String(c["name"] ?? newId)}\` does not require it.`)}`);
|
|
580
|
-
}
|
|
581
|
-
console.log();
|
|
582
|
-
console.log(hintBlock("Next", [
|
|
583
|
-
`miosa computers open ${String(c["name"] ?? newId)}`,
|
|
584
|
-
`miosa exec ${String(c["name"] ?? newId)} "uname -a"`,
|
|
585
|
-
`miosa computers show ${newId}`,
|
|
586
|
-
]));
|
|
587
|
-
printElapsed(formatDuration(Date.now() - createStart));
|
|
588
|
-
}));
|
|
589
|
-
const createCommand = computers.commands.find((command) => command.name() === "create");
|
|
590
|
-
const advancedCreateFlags = new Set([
|
|
591
|
-
"--external-workspace",
|
|
592
|
-
"--external-project",
|
|
593
|
-
"--agent-profile",
|
|
594
|
-
"--skip-agent-profile",
|
|
595
|
-
"--data",
|
|
596
|
-
"--input",
|
|
597
|
-
"--file",
|
|
598
|
-
]);
|
|
599
|
-
for (const option of createCommand?.options ?? []) {
|
|
600
|
-
if (option.long && advancedCreateFlags.has(option.long))
|
|
601
|
-
option.hideHelp();
|
|
602
|
-
}
|
|
603
|
-
computers
|
|
604
|
-
.command("exec <computer> <command...>")
|
|
605
|
-
.description("Run a command on a computer by name or ID")
|
|
606
|
-
.option("--json", "Output as JSON")
|
|
607
|
-
.addHelpText("after", `
|
|
608
|
-
Examples:
|
|
609
|
-
miosa computers exec boris pwd
|
|
610
|
-
miosa computers exec boris "uname -a"
|
|
611
|
-
`)
|
|
612
|
-
.action((computerArg, command, opts) => runAction(async () => {
|
|
613
|
-
const selected = await resolveComputerForDesktop(computerArg);
|
|
614
|
-
const computer = await waitUntilDesktopReady(selected);
|
|
615
|
-
const id = toComputerId(String(computer["id"]));
|
|
616
|
-
const response = await new MiosaClient(loadConfig()).computerExec(id, command.join(" "));
|
|
617
|
-
let exitCode = 0;
|
|
618
|
-
for await (const event of parseSse(response.body)) {
|
|
619
|
-
if (isJsonMode(opts)) {
|
|
620
|
-
console.log(JSON.stringify(event));
|
|
621
|
-
continue;
|
|
622
|
-
}
|
|
623
|
-
if (event.type === "stdout")
|
|
624
|
-
process.stdout.write(event.data);
|
|
625
|
-
if (event.type === "stderr")
|
|
626
|
-
process.stderr.write(event.data);
|
|
627
|
-
if (event.type === "error") {
|
|
628
|
-
console.error(chalk.red(event.message));
|
|
629
|
-
exitCode = 1;
|
|
630
|
-
}
|
|
631
|
-
if (event.type === "exit")
|
|
632
|
-
exitCode = event.exit_code;
|
|
633
|
-
}
|
|
634
|
-
process.exitCode = exitCode;
|
|
635
|
-
}));
|
|
636
|
-
computers
|
|
637
|
-
.command("logs <computer-id>")
|
|
638
|
-
.description("Show Computer logs")
|
|
639
|
-
.option("--json", "Output as JSON")
|
|
640
|
-
.action((id, opts) => runAction(() => getAndPrint(`/computers/${enc(id)}/logs`, opts)));
|
|
641
|
-
computers
|
|
642
|
-
.command("download <computer-id> <remote-path>")
|
|
643
|
-
.description("Download a file from a Computer to a local path or stdout")
|
|
644
|
-
.option("--output <file>", "Write to this local file instead of stdout")
|
|
645
|
-
.option("--json", "Output as JSON metadata")
|
|
646
|
-
.action((id, remotePath, opts) => runAction(async () => {
|
|
647
|
-
const query = new URLSearchParams({ path: remotePath });
|
|
648
|
-
const bytes = await client().apiGetBinary(apiPath(`/computers/${enc(id)}/files/download?${query.toString()}`));
|
|
649
|
-
if (opts.output) {
|
|
650
|
-
fs.writeFileSync(opts.output, bytes);
|
|
651
|
-
if (isJsonMode(opts)) {
|
|
652
|
-
console.log(JSON.stringify({
|
|
653
|
-
computer_id: id,
|
|
654
|
-
remote_path: remotePath,
|
|
655
|
-
output: opts.output,
|
|
656
|
-
bytes: bytes.length,
|
|
657
|
-
}, null, 2));
|
|
658
|
-
return;
|
|
659
|
-
}
|
|
660
|
-
console.log(chalk.green(`Downloaded ${remotePath} → ${opts.output}`));
|
|
661
|
-
return;
|
|
662
|
-
}
|
|
663
|
-
if (isJsonMode(opts)) {
|
|
664
|
-
console.log(JSON.stringify({
|
|
665
|
-
computer_id: id,
|
|
666
|
-
remote_path: remotePath,
|
|
667
|
-
bytes: bytes.length,
|
|
668
|
-
content_base64: bytes.toString("base64"),
|
|
669
|
-
}, null, 2));
|
|
670
|
-
return;
|
|
671
|
-
}
|
|
672
|
-
process.stdout.write(bytes);
|
|
673
|
-
}));
|
|
674
|
-
computers
|
|
675
|
-
.command("export <computer-id> <remote-path>")
|
|
676
|
-
.description("Export a file from a Computer")
|
|
677
|
-
.option("--json", "Output as JSON")
|
|
678
|
-
.action((id, remotePath, opts) => runAction(() => postAndPrint(`/computers/${enc(id)}/files/export`, opts, { path: remotePath })));
|
|
679
|
-
computers
|
|
680
|
-
.command("delete-checkpoint <computer-id> <checkpoint-id>")
|
|
681
|
-
.alias("delete-snapshot")
|
|
682
|
-
.description("Delete a Computer checkpoint")
|
|
683
|
-
.option("--json", "Output as JSON")
|
|
684
|
-
.action((id, sid, opts) => runAction(() => deleteAndPrint(`/computers/${enc(id)}/snapshots/${enc(sid)}`, opts)));
|
|
685
|
-
computers
|
|
686
|
-
.command("open [computer]")
|
|
687
|
-
.alias("desktop")
|
|
688
|
-
.description("Open a running computer's desktop in your browser")
|
|
689
|
-
.option("--print-url", "Print the desktop URL instead of opening it")
|
|
690
|
-
.option("--json", "Output as JSON")
|
|
691
|
-
.addHelpText("after", `
|
|
692
|
-
Examples:
|
|
693
|
-
miosa computers open
|
|
694
|
-
miosa computers open boris
|
|
695
|
-
|
|
696
|
-
When no computer is given, MIOSA shows a picker of running desktops.
|
|
697
|
-
`)
|
|
698
|
-
.action((computer, opts) => runAction(() => openComputerDesktop(computer, opts)));
|
|
699
|
-
computers
|
|
700
|
-
.command("vnc <computer-id>")
|
|
701
|
-
.description("Open a desktop by exact computer ID (advanced)")
|
|
702
|
-
.option("--print-url", "Print the URL instead of opening a browser")
|
|
703
|
-
.option("--json", "Output as JSON")
|
|
704
|
-
.action((id, opts) => runAction(() => openComputerDesktop(id, opts)));
|
|
705
|
-
}
|
|
706
|
-
//# sourceMappingURL=computers.js.map
|