@mesh-tech/mesh-cli 0.20.2 → 0.20.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/mesh.d.ts +0 -12
- package/dist/bin/mesh.js +15 -13
- package/dist/bin/mesh.js.map +1 -2
- package/dist/build-info.json +2 -2
- package/dist/src/commands/agent-api-client.d.ts +0 -70
- package/dist/src/commands/agent-api-client.js +0 -80
- package/dist/src/commands/app-check.d.ts +0 -56
- package/dist/src/commands/app-check.js +0 -72
- package/dist/src/commands/artifacts.d.ts +0 -11
- package/dist/src/commands/artifacts.js +0 -33
- package/dist/src/commands/cluster.d.ts +0 -39
- package/dist/src/commands/cluster.js +0 -73
- package/dist/src/commands/conversations.d.ts +0 -36
- package/dist/src/commands/conversations.js +0 -59
- package/dist/src/commands/create-app.d.ts +0 -98
- package/dist/src/commands/create-app.js +1 -163
- package/dist/src/commands/db/connect.d.ts +0 -7
- package/dist/src/commands/db/connect.js +0 -9
- package/dist/src/commands/db/credentials.d.ts +0 -7
- package/dist/src/commands/db/credentials.js +0 -10
- package/dist/src/commands/db/env.d.ts +0 -6
- package/dist/src/commands/db/env.js +0 -14
- package/dist/src/commands/db/exec.d.ts +0 -43
- package/dist/src/commands/db/exec.js +0 -69
- package/dist/src/commands/db/index.d.ts +0 -10
- package/dist/src/commands/db/index.js +0 -10
- package/dist/src/commands/db/psql.d.ts +0 -7
- package/dist/src/commands/db/psql.js +0 -18
- package/dist/src/commands/deploy.d.ts +0 -38
- package/dist/src/commands/deploy.js +1 -76
- package/dist/src/commands/dev-doctor.d.ts +0 -82
- package/dist/src/commands/dev-doctor.js +3 -132
- package/dist/src/commands/dev-launch.d.ts +0 -52
- package/dist/src/commands/dev-launch.js +0 -56
- package/dist/src/commands/dev-token-server.d.ts +0 -18
- package/dist/src/commands/dev-token-server.js +1 -24
- package/dist/src/commands/dev.d.ts +0 -246
- package/dist/src/commands/dev.js +5 -963
- package/dist/src/commands/docs.d.ts +0 -1
- package/dist/src/commands/docs.js +0 -12
- package/dist/src/commands/hub/index.d.ts +0 -60
- package/dist/src/commands/hub/index.js +2 -139
- package/dist/src/commands/init/wizard.d.ts +0 -128
- package/dist/src/commands/init/wizard.js +0 -109
- package/dist/src/commands/init.d.ts +0 -55
- package/dist/src/commands/init.js +0 -70
- package/dist/src/commands/install-shim.d.ts +0 -23
- package/dist/src/commands/install-shim.js +2 -29
- package/dist/src/commands/local/auth-provision.d.ts +0 -80
- package/dist/src/commands/local/auth-provision.js +0 -109
- package/dist/src/commands/local/dev-local.d.ts +0 -91
- package/dist/src/commands/local/dev-local.js +0 -147
- package/dist/src/commands/local/docker-runner.d.ts +0 -22
- package/dist/src/commands/local/docker-runner.js +2 -35
- package/dist/src/commands/local/helpers.d.ts +0 -14
- package/dist/src/commands/local/helpers.js +0 -13
- package/dist/src/commands/local/hub-local.d.ts +0 -96
- package/dist/src/commands/local/hub-local.js +0 -111
- package/dist/src/commands/local/index.d.ts +0 -14
- package/dist/src/commands/local/index.js +0 -86
- package/dist/src/commands/local/mocks.d.ts +0 -269
- package/dist/src/commands/local/mocks.js +1 -274
- package/dist/src/commands/local/seed-hub-catalog.d.ts +0 -25
- package/dist/src/commands/local/seed-hub-catalog.js +0 -41
- package/dist/src/commands/local/seed-zitadel.d.ts +0 -82
- package/dist/src/commands/local/seed-zitadel.js +0 -158
- package/dist/src/commands/local/seed.d.ts +0 -64
- package/dist/src/commands/local/seed.js +0 -78
- package/dist/src/commands/local/stack.d.ts +0 -141
- package/dist/src/commands/local/stack.js +0 -153
- package/dist/src/commands/login.d.ts +0 -265
- package/dist/src/commands/login.js +4 -418
- package/dist/src/commands/peer-addressing.d.ts +0 -39
- package/dist/src/commands/peer-addressing.js +0 -37
- package/dist/src/commands/port-ownership.d.ts +0 -44
- package/dist/src/commands/port-ownership.js +0 -47
- package/dist/src/commands/registry-publish.d.ts +0 -1
- package/dist/src/commands/registry-publish.js +0 -46
- package/dist/src/commands/registry.d.ts +4 -237
- package/dist/src/commands/registry.js +2 -316
- package/dist/src/commands/secrets/exec.d.ts +0 -16
- package/dist/src/commands/secrets/exec.js +0 -24
- package/dist/src/commands/secrets/index.d.ts +0 -9
- package/dist/src/commands/secrets/index.js +0 -10
- package/dist/src/commands/secrets/migrate-config.d.ts +0 -17
- package/dist/src/commands/secrets/migrate-config.js +0 -40
- package/dist/src/commands/secrets/reindex.d.ts +0 -38
- package/dist/src/commands/secrets/reindex.js +0 -39
- package/dist/src/commands/secrets/set.d.ts +0 -47
- package/dist/src/commands/secrets/set.js +0 -107
- package/dist/src/commands/site.d.ts +0 -1
- package/dist/src/commands/site.js +0 -61
- package/dist/src/commands/skills.d.ts +0 -61
- package/dist/src/commands/skills.js +0 -83
- package/dist/src/commands/stack.d.ts +0 -15
- package/dist/src/commands/stack.js +1 -128
- package/dist/src/commands/temporal.d.ts +0 -30
- package/dist/src/commands/temporal.js +3 -1
- package/dist/src/commands/temporal.js.map +1 -2
- package/dist/src/commands/tenant.d.ts +0 -31
- package/dist/src/commands/tenant.js +0 -55
- package/dist/src/commands/tunnel/index.d.ts +0 -40
- package/dist/src/commands/tunnel/index.js +0 -141
- package/dist/src/commands/vcs/clone.d.ts +0 -1
- package/dist/src/commands/vcs/clone.js +0 -4
- package/dist/src/commands/vcs/common.d.ts +0 -32
- package/dist/src/commands/vcs/common.js +0 -41
- package/dist/src/commands/vcs/drafts.d.ts +0 -1
- package/dist/src/commands/vcs/drafts.js +0 -1
- package/dist/src/commands/vcs/get.d.ts +0 -1
- package/dist/src/commands/vcs/get.js +0 -11
- package/dist/src/commands/vcs/index.d.ts +0 -1
- package/dist/src/commands/vcs/index.js +0 -1
- package/dist/src/commands/vcs/propose.d.ts +0 -26
- package/dist/src/commands/vcs/propose.js +3 -34
- package/dist/src/commands/vcs/review.d.ts +0 -1
- package/dist/src/commands/vcs/review.js +0 -1
- package/dist/src/commands/vcs/rm.d.ts +0 -11
- package/dist/src/commands/vcs/rm.js +0 -14
- package/dist/src/commands/vcs-enrich.d.ts +0 -12
- package/dist/src/commands/vcs-enrich.js +0 -12
- package/dist/src/commands/vpn/index.d.ts +0 -17
- package/dist/src/commands/vpn/index.js +0 -102
- package/dist/src/commands/vpn/tunnel.d.ts +0 -9
- package/dist/src/commands/vpn/tunnel.js +0 -37
- package/dist/src/commands/workflow.d.ts +0 -22
- package/dist/src/commands/workflow.js +0 -80
- package/dist/src/docs/assemble.d.ts +0 -117
- package/dist/src/docs/assemble.js +0 -142
- package/dist/src/docs/cli-reference.d.ts +0 -58
- package/dist/src/docs/cli-reference.js +0 -77
- package/dist/src/docs/discover.d.ts +0 -40
- package/dist/src/docs/discover.js +2 -60
- package/dist/src/docs/portal.d.ts +0 -44
- package/dist/src/docs/portal.js +0 -49
- package/dist/src/docs/registry-docs.d.ts +0 -29
- package/dist/src/docs/registry-docs.js +0 -40
- package/dist/src/docs/schema.d.ts +0 -36
- package/dist/src/docs/schema.js +0 -52
- package/dist/src/docs/serve.d.ts +0 -18
- package/dist/src/docs/serve.js +2 -30
- package/dist/src/docs/start.d.ts +0 -42
- package/dist/src/docs/start.js +0 -70
- package/dist/src/eval/agent-eval.d.mts +0 -12
- package/dist/src/eval/agent-eval.mjs +0 -22
- package/dist/src/index.d.ts +0 -6
- package/dist/src/index.js.map +0 -1
- package/dist/src/program.d.ts +0 -20
- package/dist/src/program.js +0 -24
- package/dist/src/utils/auth-preflight.d.ts +0 -137
- package/dist/src/utils/auth-preflight.js +0 -149
- package/dist/src/utils/aws-auth.d.ts +0 -163
- package/dist/src/utils/aws-auth.js +3 -232
- package/dist/src/utils/bastion.d.ts +0 -27
- package/dist/src/utils/bastion.js +0 -28
- package/dist/src/utils/build-info.d.ts +0 -22
- package/dist/src/utils/build-info.js +0 -27
- package/dist/src/utils/cache-home.d.ts +0 -23
- package/dist/src/utils/cache-home.js +0 -25
- package/dist/src/utils/capture-history.d.ts +0 -54
- package/dist/src/utils/capture-history.js +1 -55
- package/dist/src/utils/context.d.ts +0 -23
- package/dist/src/utils/context.js +0 -43
- package/dist/src/utils/credentials.d.ts +0 -38
- package/dist/src/utils/credentials.js +0 -39
- package/dist/src/utils/deploy-preflight.d.ts +0 -38
- package/dist/src/utils/deploy-preflight.js +1 -71
- package/dist/src/utils/errors.d.ts +0 -53
- package/dist/src/utils/errors.js +0 -49
- package/dist/src/utils/first-party-contexts.d.ts +0 -38
- package/dist/src/utils/first-party-contexts.js +0 -44
- package/dist/src/utils/index.d.ts +0 -4
- package/dist/src/utils/index.js +0 -4
- package/dist/src/utils/kubeconfig.d.ts +0 -40
- package/dist/src/utils/kubeconfig.js +0 -44
- package/dist/src/utils/log.d.ts +0 -20
- package/dist/src/utils/log.js +0 -20
- package/dist/src/utils/mesh-json.d.ts +0 -46
- package/dist/src/utils/mesh-json.js +0 -39
- package/dist/src/utils/pid.d.ts +0 -42
- package/dist/src/utils/pid.js +0 -48
- package/dist/src/utils/pulumi-run.d.ts +0 -14
- package/dist/src/utils/pulumi-run.js +0 -42
- package/dist/src/utils/pulumi.d.ts +0 -34
- package/dist/src/utils/pulumi.js +0 -38
- package/dist/src/utils/reachability.d.ts +0 -27
- package/dist/src/utils/reachability.js +0 -40
- package/dist/src/utils/recover-conversation.d.ts +0 -110
- package/dist/src/utils/recover-conversation.js +0 -108
- package/dist/src/utils/registry-broker.d.ts +5 -84
- package/dist/src/utils/registry-broker.js +0 -62
- package/dist/src/utils/registry-identity.d.ts +0 -149
- package/dist/src/utils/registry-identity.js +0 -143
- package/dist/src/utils/scaffold-versions.d.ts +0 -41
- package/dist/src/utils/scaffold-versions.js +0 -42
- package/dist/src/utils/socks-forward.d.ts +0 -24
- package/dist/src/utils/socks-forward.js +2 -25
- package/dist/src/utils/stack-flag.d.ts +0 -13
- package/dist/src/utils/stack-flag.js +0 -21
- package/dist/src/utils/tailscale-targets.d.ts +0 -37
- package/dist/src/utils/tailscale-targets.js +0 -33
- package/dist/src/utils/tailscale.d.ts +0 -177
- package/dist/src/utils/tailscale.js +6 -337
- package/dist/src/utils/temporal-auth.d.ts +0 -41
- package/dist/src/utils/temporal-auth.js +0 -52
- package/dist/src/utils/temporal-codec.d.ts +0 -89
- package/dist/src/utils/temporal-codec.js.map +0 -1
- package/dist/src/utils/tunnel-ownership.d.ts +0 -79
- package/dist/src/utils/tunnel-ownership.js +0 -74
- package/dist/src/utils/vpn-join.d.ts +0 -16
- package/dist/src/utils/vpn-join.js +0 -17
- package/dist/src/utils/vpn.d.ts +0 -42
- package/dist/src/utils/vpn.js +0 -52
- package/dist/src/utils/workflow-fingerprint.d.ts +0 -39
- package/dist/src/utils/workflow-fingerprint.js +1 -63
- package/dist/src/utils/worktree-identity.d.ts +0 -62
- package/dist/src/utils/worktree-identity.js +0 -88
- package/package.json +2 -2
- package/skills/core/SKILL.md +9 -10
- package/templates/api-auth/api/src/index.ts.hbs +1 -1
- package/templates/api-auth/api/src/spicedb-http-provider.ts.hbs +2 -2
- package/templates/api-role-gating/api/src/authn.ts.hbs +2 -2
- package/templates/api-role-gating/index.ts.hbs +1 -1
- package/templates/api-role-gating/skills/develop/SKILL.md.hbs +1 -1
- package/templates/platform-repo/core/Pulumi.{{tenant}}-{{env}}.yaml.hbs +2 -2
- package/templates/platform-repo/platform/index.ts +1 -1
- package/dist/bin/mesh.d.ts.map +0 -1
- package/dist/src/commands/agent-api-client.d.ts.map +0 -1
- package/dist/src/commands/agent-api-client.js.map +0 -1
- package/dist/src/commands/app-check.d.ts.map +0 -1
- package/dist/src/commands/app-check.js.map +0 -1
- package/dist/src/commands/artifacts.d.ts.map +0 -1
- package/dist/src/commands/artifacts.js.map +0 -1
- package/dist/src/commands/cluster.d.ts.map +0 -1
- package/dist/src/commands/cluster.js.map +0 -1
- package/dist/src/commands/conversations.d.ts.map +0 -1
- package/dist/src/commands/conversations.js.map +0 -1
- package/dist/src/commands/create-app.d.ts.map +0 -1
- package/dist/src/commands/create-app.js.map +0 -1
- package/dist/src/commands/db/connect.d.ts.map +0 -1
- package/dist/src/commands/db/connect.js.map +0 -1
- package/dist/src/commands/db/credentials.d.ts.map +0 -1
- package/dist/src/commands/db/credentials.js.map +0 -1
- package/dist/src/commands/db/env.d.ts.map +0 -1
- package/dist/src/commands/db/env.js.map +0 -1
- package/dist/src/commands/db/exec.d.ts.map +0 -1
- package/dist/src/commands/db/exec.js.map +0 -1
- package/dist/src/commands/db/index.d.ts.map +0 -1
- package/dist/src/commands/db/index.js.map +0 -1
- package/dist/src/commands/db/psql.d.ts.map +0 -1
- package/dist/src/commands/db/psql.js.map +0 -1
- package/dist/src/commands/deploy.d.ts.map +0 -1
- package/dist/src/commands/deploy.js.map +0 -1
- package/dist/src/commands/dev-doctor.d.ts.map +0 -1
- package/dist/src/commands/dev-doctor.js.map +0 -1
- package/dist/src/commands/dev-launch.d.ts.map +0 -1
- package/dist/src/commands/dev-launch.js.map +0 -1
- package/dist/src/commands/dev-token-server.d.ts.map +0 -1
- package/dist/src/commands/dev-token-server.js.map +0 -1
- package/dist/src/commands/dev.d.ts.map +0 -1
- package/dist/src/commands/dev.js.map +0 -1
- package/dist/src/commands/docs.d.ts.map +0 -1
- package/dist/src/commands/docs.js.map +0 -1
- package/dist/src/commands/hub/index.d.ts.map +0 -1
- package/dist/src/commands/hub/index.js.map +0 -1
- package/dist/src/commands/init/wizard.d.ts.map +0 -1
- package/dist/src/commands/init/wizard.js.map +0 -1
- package/dist/src/commands/init.d.ts.map +0 -1
- package/dist/src/commands/init.js.map +0 -1
- package/dist/src/commands/install-shim.d.ts.map +0 -1
- package/dist/src/commands/install-shim.js.map +0 -1
- package/dist/src/commands/local/auth-provision.d.ts.map +0 -1
- package/dist/src/commands/local/auth-provision.js.map +0 -1
- package/dist/src/commands/local/dev-local.d.ts.map +0 -1
- package/dist/src/commands/local/dev-local.js.map +0 -1
- package/dist/src/commands/local/docker-runner.d.ts.map +0 -1
- package/dist/src/commands/local/docker-runner.js.map +0 -1
- package/dist/src/commands/local/helpers.d.ts.map +0 -1
- package/dist/src/commands/local/helpers.js.map +0 -1
- package/dist/src/commands/local/hub-local.d.ts.map +0 -1
- package/dist/src/commands/local/hub-local.js.map +0 -1
- package/dist/src/commands/local/index.d.ts.map +0 -1
- package/dist/src/commands/local/index.js.map +0 -1
- package/dist/src/commands/local/mocks.d.ts.map +0 -1
- package/dist/src/commands/local/mocks.js.map +0 -1
- package/dist/src/commands/local/seed-hub-catalog.d.ts.map +0 -1
- package/dist/src/commands/local/seed-hub-catalog.js.map +0 -1
- package/dist/src/commands/local/seed-zitadel.d.ts.map +0 -1
- package/dist/src/commands/local/seed-zitadel.js.map +0 -1
- package/dist/src/commands/local/seed.d.ts.map +0 -1
- package/dist/src/commands/local/seed.js.map +0 -1
- package/dist/src/commands/local/stack.d.ts.map +0 -1
- package/dist/src/commands/local/stack.js.map +0 -1
- package/dist/src/commands/login.d.ts.map +0 -1
- package/dist/src/commands/login.js.map +0 -1
- package/dist/src/commands/peer-addressing.d.ts.map +0 -1
- package/dist/src/commands/peer-addressing.js.map +0 -1
- package/dist/src/commands/port-ownership.d.ts.map +0 -1
- package/dist/src/commands/port-ownership.js.map +0 -1
- package/dist/src/commands/registry-publish.d.ts.map +0 -1
- package/dist/src/commands/registry-publish.js.map +0 -1
- package/dist/src/commands/registry.d.ts.map +0 -1
- package/dist/src/commands/registry.js.map +0 -1
- package/dist/src/commands/secrets/exec.d.ts.map +0 -1
- package/dist/src/commands/secrets/exec.js.map +0 -1
- package/dist/src/commands/secrets/index.d.ts.map +0 -1
- package/dist/src/commands/secrets/index.js.map +0 -1
- package/dist/src/commands/secrets/migrate-config.d.ts.map +0 -1
- package/dist/src/commands/secrets/migrate-config.js.map +0 -1
- package/dist/src/commands/secrets/reindex.d.ts.map +0 -1
- package/dist/src/commands/secrets/reindex.js.map +0 -1
- package/dist/src/commands/secrets/set.d.ts.map +0 -1
- package/dist/src/commands/secrets/set.js.map +0 -1
- package/dist/src/commands/site.d.ts.map +0 -1
- package/dist/src/commands/site.js.map +0 -1
- package/dist/src/commands/skills.d.ts.map +0 -1
- package/dist/src/commands/skills.js.map +0 -1
- package/dist/src/commands/stack.d.ts.map +0 -1
- package/dist/src/commands/stack.js.map +0 -1
- package/dist/src/commands/temporal.d.ts.map +0 -1
- package/dist/src/commands/tenant.d.ts.map +0 -1
- package/dist/src/commands/tenant.js.map +0 -1
- package/dist/src/commands/tunnel/index.d.ts.map +0 -1
- package/dist/src/commands/tunnel/index.js.map +0 -1
- package/dist/src/commands/vcs/clone.d.ts.map +0 -1
- package/dist/src/commands/vcs/clone.js.map +0 -1
- package/dist/src/commands/vcs/common.d.ts.map +0 -1
- package/dist/src/commands/vcs/common.js.map +0 -1
- package/dist/src/commands/vcs/drafts.d.ts.map +0 -1
- package/dist/src/commands/vcs/drafts.js.map +0 -1
- package/dist/src/commands/vcs/get.d.ts.map +0 -1
- package/dist/src/commands/vcs/get.js.map +0 -1
- package/dist/src/commands/vcs/index.d.ts.map +0 -1
- package/dist/src/commands/vcs/index.js.map +0 -1
- package/dist/src/commands/vcs/propose.d.ts.map +0 -1
- package/dist/src/commands/vcs/propose.js.map +0 -1
- package/dist/src/commands/vcs/review.d.ts.map +0 -1
- package/dist/src/commands/vcs/review.js.map +0 -1
- package/dist/src/commands/vcs/rm.d.ts.map +0 -1
- package/dist/src/commands/vcs/rm.js.map +0 -1
- package/dist/src/commands/vcs-enrich.d.ts.map +0 -1
- package/dist/src/commands/vcs-enrich.js.map +0 -1
- package/dist/src/commands/vpn/index.d.ts.map +0 -1
- package/dist/src/commands/vpn/index.js.map +0 -1
- package/dist/src/commands/vpn/tunnel.d.ts.map +0 -1
- package/dist/src/commands/vpn/tunnel.js.map +0 -1
- package/dist/src/commands/workflow.d.ts.map +0 -1
- package/dist/src/commands/workflow.js.map +0 -1
- package/dist/src/docs/assemble.d.ts.map +0 -1
- package/dist/src/docs/assemble.js.map +0 -1
- package/dist/src/docs/cli-reference.d.ts.map +0 -1
- package/dist/src/docs/cli-reference.js.map +0 -1
- package/dist/src/docs/discover.d.ts.map +0 -1
- package/dist/src/docs/discover.js.map +0 -1
- package/dist/src/docs/portal.d.ts.map +0 -1
- package/dist/src/docs/portal.js.map +0 -1
- package/dist/src/docs/registry-docs.d.ts.map +0 -1
- package/dist/src/docs/registry-docs.js.map +0 -1
- package/dist/src/docs/schema.d.ts.map +0 -1
- package/dist/src/docs/schema.js.map +0 -1
- package/dist/src/docs/serve.d.ts.map +0 -1
- package/dist/src/docs/serve.js.map +0 -1
- package/dist/src/docs/start.d.ts.map +0 -1
- package/dist/src/docs/start.js.map +0 -1
- package/dist/src/eval/agent-eval.d.mts.map +0 -1
- package/dist/src/eval/agent-eval.mjs.map +0 -1
- package/dist/src/index.d.ts.map +0 -1
- package/dist/src/program.d.ts.map +0 -1
- package/dist/src/program.js.map +0 -1
- package/dist/src/utils/auth-preflight.d.ts.map +0 -1
- package/dist/src/utils/auth-preflight.js.map +0 -1
- package/dist/src/utils/aws-auth.d.ts.map +0 -1
- package/dist/src/utils/aws-auth.js.map +0 -1
- package/dist/src/utils/bastion.d.ts.map +0 -1
- package/dist/src/utils/bastion.js.map +0 -1
- package/dist/src/utils/build-info.d.ts.map +0 -1
- package/dist/src/utils/build-info.js.map +0 -1
- package/dist/src/utils/cache-home.d.ts.map +0 -1
- package/dist/src/utils/cache-home.js.map +0 -1
- package/dist/src/utils/capture-history.d.ts.map +0 -1
- package/dist/src/utils/capture-history.js.map +0 -1
- package/dist/src/utils/context.d.ts.map +0 -1
- package/dist/src/utils/context.js.map +0 -1
- package/dist/src/utils/credentials.d.ts.map +0 -1
- package/dist/src/utils/credentials.js.map +0 -1
- package/dist/src/utils/deploy-preflight.d.ts.map +0 -1
- package/dist/src/utils/deploy-preflight.js.map +0 -1
- package/dist/src/utils/errors.d.ts.map +0 -1
- package/dist/src/utils/errors.js.map +0 -1
- package/dist/src/utils/first-party-contexts.d.ts.map +0 -1
- package/dist/src/utils/first-party-contexts.js.map +0 -1
- package/dist/src/utils/index.d.ts.map +0 -1
- package/dist/src/utils/index.js.map +0 -1
- package/dist/src/utils/kubeconfig.d.ts.map +0 -1
- package/dist/src/utils/kubeconfig.js.map +0 -1
- package/dist/src/utils/log.d.ts.map +0 -1
- package/dist/src/utils/log.js.map +0 -1
- package/dist/src/utils/mesh-json.d.ts.map +0 -1
- package/dist/src/utils/mesh-json.js.map +0 -1
- package/dist/src/utils/pid.d.ts.map +0 -1
- package/dist/src/utils/pid.js.map +0 -1
- package/dist/src/utils/pulumi-run.d.ts.map +0 -1
- package/dist/src/utils/pulumi-run.js.map +0 -1
- package/dist/src/utils/pulumi.d.ts.map +0 -1
- package/dist/src/utils/pulumi.js.map +0 -1
- package/dist/src/utils/reachability.d.ts.map +0 -1
- package/dist/src/utils/reachability.js.map +0 -1
- package/dist/src/utils/recover-conversation.d.ts.map +0 -1
- package/dist/src/utils/recover-conversation.js.map +0 -1
- package/dist/src/utils/registry-broker.d.ts.map +0 -1
- package/dist/src/utils/registry-broker.js.map +0 -1
- package/dist/src/utils/registry-identity.d.ts.map +0 -1
- package/dist/src/utils/registry-identity.js.map +0 -1
- package/dist/src/utils/scaffold-versions.d.ts.map +0 -1
- package/dist/src/utils/scaffold-versions.js.map +0 -1
- package/dist/src/utils/socks-forward.d.ts.map +0 -1
- package/dist/src/utils/socks-forward.js.map +0 -1
- package/dist/src/utils/stack-flag.d.ts.map +0 -1
- package/dist/src/utils/stack-flag.js.map +0 -1
- package/dist/src/utils/tailscale-targets.d.ts.map +0 -1
- package/dist/src/utils/tailscale-targets.js.map +0 -1
- package/dist/src/utils/tailscale.d.ts.map +0 -1
- package/dist/src/utils/tailscale.js.map +0 -1
- package/dist/src/utils/temporal-auth.d.ts.map +0 -1
- package/dist/src/utils/temporal-auth.js.map +0 -1
- package/dist/src/utils/temporal-codec.d.ts.map +0 -1
- package/dist/src/utils/tunnel-ownership.d.ts.map +0 -1
- package/dist/src/utils/tunnel-ownership.js.map +0 -1
- package/dist/src/utils/vpn-join.d.ts.map +0 -1
- package/dist/src/utils/vpn-join.js.map +0 -1
- package/dist/src/utils/vpn.d.ts.map +0 -1
- package/dist/src/utils/vpn.js.map +0 -1
- package/dist/src/utils/workflow-fingerprint.d.ts.map +0 -1
- package/dist/src/utils/workflow-fingerprint.js.map +0 -1
- package/dist/src/utils/worktree-identity.d.ts.map +0 -1
- package/dist/src/utils/worktree-identity.js.map +0 -1
|
@@ -1,27 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* mesh tenant — register and inspect app tenants on a Mesh platform stack.
|
|
3
|
-
*
|
|
4
|
-
* `mesh tenant add <name>` closes the gap the app-tenant doctor punts on:
|
|
5
|
-
* its "not registered" check names `mesh deploy up # platform repo: add the
|
|
6
|
-
* tenant under mesh:tenants first` as the fix, but that first half — "add the
|
|
7
|
-
* tenant under mesh:tenants" — had no command and meant hand-editing
|
|
8
|
-
* Pulumi.<stack>.yaml. This command performs the registration itself: run from
|
|
9
|
-
* the PLATFORM layer of a tenant platform repo (e.g. mesh-sandbox/platform),
|
|
10
|
-
* it inserts the tenant into the stack config's `mesh:tenants` map
|
|
11
|
-
* (comment-preserving round-trip) and prints the deploy + verify steps that
|
|
12
|
-
* make the registration live.
|
|
13
|
-
*
|
|
14
|
-
* `mesh tenant list` prints what the stack config declares, so "is it
|
|
15
|
-
* registered?" is answerable without opening YAML.
|
|
16
|
-
*/
|
|
17
1
|
import { Command } from "commander";
|
|
18
|
-
/** Same rule `mesh init platform` applies to tenant names. */
|
|
19
2
|
export declare function validateTenantName(name: string): boolean;
|
|
20
|
-
/**
|
|
21
|
-
* "{tenant}-{env}" → "{env}" (mesh-dev → dev). The last dash-segment is the
|
|
22
|
-
* env by the platform stack naming convention; null when there is no dash to
|
|
23
|
-
* split on, in which case the caller must pass --subdomain explicitly.
|
|
24
|
-
*/
|
|
25
3
|
export declare function deriveEnvFromStack(stack: string): string | null;
|
|
26
4
|
export interface TenantAddSpec {
|
|
27
5
|
name: string;
|
|
@@ -38,19 +16,10 @@ export type TenantAddResult = {
|
|
|
38
16
|
reason: "exists" | "no-config";
|
|
39
17
|
detail: string;
|
|
40
18
|
};
|
|
41
|
-
/**
|
|
42
|
-
* Insert a tenant under `config."mesh:tenants"` in a Pulumi stack config.
|
|
43
|
-
* Round-trips through the yaml Document API so existing comments and entries
|
|
44
|
-
* survive verbatim. Refuses (rather than merges) when the tenant is already
|
|
45
|
-
* declared — an existing entry may carry fields (zitadelOrgId, nodePools…)
|
|
46
|
-
* that a re-add would silently drop.
|
|
47
|
-
*/
|
|
48
19
|
export declare function addTenantToStackConfig(yamlText: string, spec: TenantAddSpec): TenantAddResult;
|
|
49
|
-
/** Read the `mesh:tenants` map (name → config) out of a stack config, if any. */
|
|
50
20
|
export declare function listTenantsInStackConfig(yamlText: string): Array<{
|
|
51
21
|
name: string;
|
|
52
22
|
displayName?: string;
|
|
53
23
|
subdomain?: string;
|
|
54
24
|
}>;
|
|
55
25
|
export declare function registerTenantCommands(program: Command): void;
|
|
56
|
-
//# sourceMappingURL=tenant.d.ts.map
|
|
@@ -1,19 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* mesh tenant — register and inspect app tenants on a Mesh platform stack.
|
|
3
|
-
*
|
|
4
|
-
* `mesh tenant add <name>` closes the gap the app-tenant doctor punts on:
|
|
5
|
-
* its "not registered" check names `mesh deploy up # platform repo: add the
|
|
6
|
-
* tenant under mesh:tenants first` as the fix, but that first half — "add the
|
|
7
|
-
* tenant under mesh:tenants" — had no command and meant hand-editing
|
|
8
|
-
* Pulumi.<stack>.yaml. This command performs the registration itself: run from
|
|
9
|
-
* the PLATFORM layer of a tenant platform repo (e.g. mesh-sandbox/platform),
|
|
10
|
-
* it inserts the tenant into the stack config's `mesh:tenants` map
|
|
11
|
-
* (comment-preserving round-trip) and prints the deploy + verify steps that
|
|
12
|
-
* make the registration live.
|
|
13
|
-
*
|
|
14
|
-
* `mesh tenant list` prints what the stack config declares, so "is it
|
|
15
|
-
* registered?" is answerable without opening YAML.
|
|
16
|
-
*/
|
|
17
1
|
import chalk from "chalk";
|
|
18
2
|
import * as fs from "fs";
|
|
19
3
|
import * as path from "path";
|
|
@@ -22,29 +6,13 @@ import { logInfo, logWarn } from "../utils/log.js";
|
|
|
22
6
|
import { MeshCliError, emitJsonPayload } from "../utils/errors.js";
|
|
23
7
|
import { findAppRoot, findStackConfigs, getCurrentStack } from "../utils/pulumi.js";
|
|
24
8
|
import { atomicWriteFileSync } from "./login.js";
|
|
25
|
-
// =============================================================================
|
|
26
|
-
// Pure helpers (unit-tested)
|
|
27
|
-
// =============================================================================
|
|
28
|
-
/** Same rule `mesh init platform` applies to tenant names. */
|
|
29
9
|
export function validateTenantName(name) {
|
|
30
10
|
return /^[a-z][a-z0-9-]*$/.test(name) && !name.endsWith("-");
|
|
31
11
|
}
|
|
32
|
-
/**
|
|
33
|
-
* "{tenant}-{env}" → "{env}" (mesh-dev → dev). The last dash-segment is the
|
|
34
|
-
* env by the platform stack naming convention; null when there is no dash to
|
|
35
|
-
* split on, in which case the caller must pass --subdomain explicitly.
|
|
36
|
-
*/
|
|
37
12
|
export function deriveEnvFromStack(stack) {
|
|
38
13
|
const m = stack.match(/-([a-z0-9]+)$/);
|
|
39
14
|
return m ? (m[1] ?? null) : null;
|
|
40
15
|
}
|
|
41
|
-
/**
|
|
42
|
-
* Insert a tenant under `config."mesh:tenants"` in a Pulumi stack config.
|
|
43
|
-
* Round-trips through the yaml Document API so existing comments and entries
|
|
44
|
-
* survive verbatim. Refuses (rather than merges) when the tenant is already
|
|
45
|
-
* declared — an existing entry may carry fields (zitadelOrgId, nodePools…)
|
|
46
|
-
* that a re-add would silently drop.
|
|
47
|
-
*/
|
|
48
16
|
export function addTenantToStackConfig(yamlText, spec) {
|
|
49
17
|
const doc = parseDocument(yamlText);
|
|
50
18
|
const config = doc.getIn(["config"]);
|
|
@@ -70,15 +38,12 @@ export function addTenantToStackConfig(yamlText, spec) {
|
|
|
70
38
|
if (spec.zitadelOrgId)
|
|
71
39
|
entry.zitadelOrgId = spec.zitadelOrgId;
|
|
72
40
|
doc.setIn([...tenantsPath, spec.name], doc.createNode(entry));
|
|
73
|
-
// Keep the rewrite surgical: no flow-seq re-padding (["a"] → [ "a" ]) and no
|
|
74
|
-
// long-line rewrapping on parts of the file this command never touched.
|
|
75
41
|
return {
|
|
76
42
|
ok: true,
|
|
77
43
|
yaml: doc.toString({ flowCollectionPadding: false, lineWidth: 0 }),
|
|
78
44
|
createdTenantsBlock,
|
|
79
45
|
};
|
|
80
46
|
}
|
|
81
|
-
/** Read the `mesh:tenants` map (name → config) out of a stack config, if any. */
|
|
82
47
|
export function listTenantsInStackConfig(yamlText) {
|
|
83
48
|
const doc = parseDocument(yamlText);
|
|
84
49
|
const tenants = doc.getIn(["config", "mesh:tenants"]);
|
|
@@ -96,10 +61,6 @@ export function listTenantsInStackConfig(yamlText) {
|
|
|
96
61
|
return { name, displayName: get("displayName"), subdomain: get("subdomain") };
|
|
97
62
|
});
|
|
98
63
|
}
|
|
99
|
-
/**
|
|
100
|
-
* Resolve which Pulumi.<stack>.yaml to operate on: --stack wins, else the
|
|
101
|
-
* currently-selected pulumi stack, else the single stack config in the dir.
|
|
102
|
-
*/
|
|
103
64
|
function resolveStackConfig(explicitStack) {
|
|
104
65
|
const appRoot = findAppRoot(process.cwd());
|
|
105
66
|
if (!appRoot) {
|
|
@@ -118,12 +79,6 @@ function resolveStackConfig(explicitStack) {
|
|
|
118
79
|
}
|
|
119
80
|
return { appRoot, stack, file, content: fs.readFileSync(file, "utf-8") };
|
|
120
81
|
}
|
|
121
|
-
/**
|
|
122
|
-
* The two real platform-layer project names are `mesh-platform`
|
|
123
|
-
* (mesh-sandbox/platform) and `{tenant}-platform` (the `mesh init platform`
|
|
124
|
-
* scaffold); the sibling core layer is `{tenant}-core`. Anchoring on the
|
|
125
|
-
* suffix keeps an app incidentally named e.g. `platform-api` out.
|
|
126
|
-
*/
|
|
127
82
|
function readProjectName(appRoot) {
|
|
128
83
|
const projectDoc = parseDocument(fs.readFileSync(path.join(appRoot, "Pulumi.yaml"), "utf-8"));
|
|
129
84
|
return String(projectDoc.get("name") ?? "");
|
|
@@ -131,11 +86,6 @@ function readProjectName(appRoot) {
|
|
|
131
86
|
function looksLikePlatformLayer(projectName) {
|
|
132
87
|
return projectName.endsWith("-platform");
|
|
133
88
|
}
|
|
134
|
-
/**
|
|
135
|
-
* Guard against registering tenants on the wrong layer (core / an app): only
|
|
136
|
-
* proceed without an existing `mesh:tenants` block when the Pulumi project
|
|
137
|
-
* name says this is a platform layer.
|
|
138
|
-
*/
|
|
139
89
|
function assertPlatformLayer(appRoot, content) {
|
|
140
90
|
if (parseDocument(content).hasIn(["config", "mesh:tenants"]))
|
|
141
91
|
return;
|
|
@@ -177,8 +127,6 @@ export function registerTenantCommands(program) {
|
|
|
177
127
|
}
|
|
178
128
|
throw new MeshCliError(`${resolved.file}: ${result.detail}`);
|
|
179
129
|
}
|
|
180
|
-
// Pulumi.<stack>.yaml holds every capability toggle and the tenants map —
|
|
181
|
-
// an interrupt mid-write must not truncate it.
|
|
182
130
|
atomicWriteFileSync(resolved.file, result.yaml, fs.statSync(resolved.file).mode & 0o777);
|
|
183
131
|
if (opts.json) {
|
|
184
132
|
emitJsonPayload({
|
|
@@ -214,8 +162,6 @@ export function registerTenantCommands(program) {
|
|
|
214
162
|
return;
|
|
215
163
|
}
|
|
216
164
|
if (tenants.length === 0) {
|
|
217
|
-
// "No tenants" on a non-platform layer means "wrong directory", not
|
|
218
|
-
// "this platform has no tenants" — warn rather than let it mislead.
|
|
219
165
|
const projectName = readProjectName(resolved.appRoot);
|
|
220
166
|
if (!looksLikePlatformLayer(projectName)) {
|
|
221
167
|
logWarn(`Project '${projectName}' does not look like a platform layer — tenants are declared on the tenant platform repo's PLATFORM stack (e.g. mesh-sandbox/platform).`);
|
|
@@ -230,4 +176,3 @@ export function registerTenantCommands(program) {
|
|
|
230
176
|
}
|
|
231
177
|
});
|
|
232
178
|
}
|
|
233
|
-
//# sourceMappingURL=tenant.js.map
|
|
@@ -1,29 +1,6 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* mesh tunnel - SSM tunneling to platform services
|
|
3
|
-
*
|
|
4
|
-
* Commands:
|
|
5
|
-
* mesh tunnel dev Start all dev tunnels (temporal + db)
|
|
6
|
-
* mesh tunnel --services Start specific services
|
|
7
|
-
* mesh tunnel --list List available services
|
|
8
|
-
* mesh tunnel external <name> Tunnel to a registered external service
|
|
9
|
-
*/
|
|
10
1
|
import { Command } from "commander";
|
|
11
|
-
/** `region = …` from a specific section of an ini-style `~/.aws` file. */
|
|
12
2
|
export declare function parseProfileRegion(text: string, header: string): string | undefined;
|
|
13
|
-
/**
|
|
14
|
-
* Section headers for the SDK's implicit `[default]` profile. Spelled
|
|
15
|
-
* `[default]` in BOTH files — `~/.aws/config` has no `[profile default]`
|
|
16
|
-
* form — so it cannot be routed through awsProfileSections("default").
|
|
17
|
-
*/
|
|
18
3
|
export declare function awsDefaultProfileSections(): Array<[string, string]>;
|
|
19
|
-
/**
|
|
20
|
-
* The credential axis (app tenant/stage) the ExternalService secret is keyed
|
|
21
|
-
* on, which is NOT the platform axis that hosts the bastion.
|
|
22
|
-
*
|
|
23
|
-
* Precedence: explicit --app-tenant/--app-stage, then the stage detected from
|
|
24
|
-
* cwd (a tenant-prefixed stack like `scu-dev` maps to platform env `dev`, and
|
|
25
|
-
* the secret is keyed on the former), then the platform tenant/env.
|
|
26
|
-
*/
|
|
27
4
|
export declare function resolveCredentialAxis(options: {
|
|
28
5
|
tenant: string;
|
|
29
6
|
env: string;
|
|
@@ -34,27 +11,10 @@ export declare function resolveCredentialAxis(options: {
|
|
|
34
11
|
appTenant: string;
|
|
35
12
|
appStage: string;
|
|
36
13
|
};
|
|
37
|
-
/**
|
|
38
|
-
* Secrets Manager id for an ExternalService's credentials.
|
|
39
|
-
*
|
|
40
|
-
* Mirrors what the primitive builds (ExternalService.ts) and what apps resolve
|
|
41
|
-
* at runtime (libs/secrets): keyed on the APP tenant/stage, with multi-instance
|
|
42
|
-
* (credentials.keyedBy) services storing one secret per instance under the base.
|
|
43
|
-
*/
|
|
44
14
|
export declare function externalSecretId(appTenant: string, appStage: string, name: string, key?: string): string;
|
|
45
|
-
/**
|
|
46
|
-
* Pull the tunnel endpoint out of a credential secret. The local port defaults
|
|
47
|
-
* to the remote port so `localhost:<same-port>` behaves like the real service.
|
|
48
|
-
* Throws with a user-facing message when the secret isn't tunnelable or the
|
|
49
|
-
* `--port` override isn't a valid port number.
|
|
50
|
-
*/
|
|
51
15
|
export declare function resolveExternalPorts(creds: Record<string, string | number>, portOverride?: string): {
|
|
52
16
|
host: string;
|
|
53
17
|
remotePort: number;
|
|
54
18
|
localPort: number;
|
|
55
19
|
};
|
|
56
|
-
/**
|
|
57
|
-
* Register tunnel commands with the CLI
|
|
58
|
-
*/
|
|
59
20
|
export declare function registerTunnelCommands(program: Command): void;
|
|
60
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,38 +1,13 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* mesh tunnel - SSM tunneling to platform services
|
|
3
|
-
*
|
|
4
|
-
* Commands:
|
|
5
|
-
* mesh tunnel dev Start all dev tunnels (temporal + db)
|
|
6
|
-
* mesh tunnel --services Start specific services
|
|
7
|
-
* mesh tunnel --list List available services
|
|
8
|
-
* mesh tunnel external <name> Tunnel to a registered external service
|
|
9
|
-
*/
|
|
10
1
|
import { spawn } from "child_process";
|
|
11
2
|
import * as fs from "fs";
|
|
12
3
|
import * as os from "os";
|
|
13
4
|
import * as path from "path";
|
|
14
5
|
import { SecretsManagerClient, GetSecretValueCommand, } from "@aws-sdk/client-secrets-manager";
|
|
15
6
|
import { detectContext, getPlatformBastionInfo, logInfo, logError, } from "../../utils/index.js";
|
|
16
|
-
/**
|
|
17
|
-
* Resolve tenant/env without ceremony: explicit flags win, otherwise the
|
|
18
|
-
* same Pulumi/SST context detection `mesh dev` uses (mesh:tenant + stack
|
|
19
|
-
* file in the current app dir).
|
|
20
|
-
*
|
|
21
|
-
* Returns the detected app `stage` alongside the platform `env` because they
|
|
22
|
-
* are genuinely different values — detectContext() strips the tenant prefix
|
|
23
|
-
* and runs the result through the platform-env map, so a stack
|
|
24
|
-
* `Pulumi.scu-dev.yaml` yields stage `scu-dev` but platform env `dev`.
|
|
25
|
-
* Callers that key on the app axis (credential secrets) need the former.
|
|
26
|
-
*/
|
|
27
7
|
function resolveTenantEnv(options) {
|
|
28
8
|
if (options.tenant && options.env) {
|
|
29
|
-
// Fully explicit: nothing was detected, so there is no app stage to offer —
|
|
30
|
-
// the credential axis falls back to --env, exactly as `mesh db …` does.
|
|
31
9
|
return { tenant: options.tenant, env: options.env };
|
|
32
10
|
}
|
|
33
|
-
// `options.env` is a platform env, not a stage; passing it as detectContext's
|
|
34
|
-
// stage hint is deliberate (it's the best hint available) but does make that
|
|
35
|
-
// function's own "Stage: …" log line read as an env when only -e was given.
|
|
36
11
|
const ctx = detectContext(options.env);
|
|
37
12
|
return {
|
|
38
13
|
tenant: options.tenant ?? ctx.tenant,
|
|
@@ -40,11 +15,6 @@ function resolveTenantEnv(options) {
|
|
|
40
15
|
stage: ctx.stage,
|
|
41
16
|
};
|
|
42
17
|
}
|
|
43
|
-
/**
|
|
44
|
-
* aws:region from the nearest Pulumi config in cwd. Prefers the stack actually
|
|
45
|
-
* being targeted; otherwise stack files before the project file, and among
|
|
46
|
-
* several stacks this is a best-effort pick (readdir order).
|
|
47
|
-
*/
|
|
48
18
|
function readPulumiAwsRegion(stage) {
|
|
49
19
|
const preferred = stage ? `Pulumi.${stage}.yaml` : undefined;
|
|
50
20
|
const rank = (f) => f === preferred ? 0 : f === "Pulumi.yaml" ? 2 : 1;
|
|
@@ -62,11 +32,9 @@ function readPulumiAwsRegion(stage) {
|
|
|
62
32
|
}
|
|
63
33
|
}
|
|
64
34
|
catch {
|
|
65
|
-
/* unreadable cwd — fall through */
|
|
66
35
|
}
|
|
67
36
|
return undefined;
|
|
68
37
|
}
|
|
69
|
-
/** `~/.aws` section headers a profile can appear under, in precedence order. */
|
|
70
38
|
function awsProfileSections(name) {
|
|
71
39
|
return [
|
|
72
40
|
[path.join(os.homedir(), ".aws", "config"), `[profile ${name}]`],
|
|
@@ -81,12 +49,10 @@ function awsProfileExists(name) {
|
|
|
81
49
|
return true;
|
|
82
50
|
}
|
|
83
51
|
catch {
|
|
84
|
-
/* file absent */
|
|
85
52
|
}
|
|
86
53
|
}
|
|
87
54
|
return false;
|
|
88
55
|
}
|
|
89
|
-
/** `region = …` from a specific section of an ini-style `~/.aws` file. */
|
|
90
56
|
export function parseProfileRegion(text, header) {
|
|
91
57
|
let inSection = false;
|
|
92
58
|
for (const raw of text.split("\n")) {
|
|
@@ -98,9 +64,6 @@ export function parseProfileRegion(text, header) {
|
|
|
98
64
|
if (!inSection)
|
|
99
65
|
continue;
|
|
100
66
|
const m = line.match(/^region\s*=\s*(.+)$/);
|
|
101
|
-
// AWS's shared-config parser strips whitespace-prefixed inline comments
|
|
102
|
-
// (`region = us-east-1 # prod` means us-east-1); match it. The regex
|
|
103
|
-
// already ate leading whitespace, so the first split segment is the value.
|
|
104
67
|
const value = m?.[1]?.split(/\s+[#;]/)[0]?.trim();
|
|
105
68
|
if (value)
|
|
106
69
|
return value;
|
|
@@ -117,23 +80,16 @@ function awsProfileRegion(profile) {
|
|
|
117
80
|
return region;
|
|
118
81
|
}
|
|
119
82
|
catch {
|
|
120
|
-
/* file absent */
|
|
121
83
|
}
|
|
122
84
|
}
|
|
123
85
|
return undefined;
|
|
124
86
|
}
|
|
125
|
-
/**
|
|
126
|
-
* Section headers for the SDK's implicit `[default]` profile. Spelled
|
|
127
|
-
* `[default]` in BOTH files — `~/.aws/config` has no `[profile default]`
|
|
128
|
-
* form — so it cannot be routed through awsProfileSections("default").
|
|
129
|
-
*/
|
|
130
87
|
export function awsDefaultProfileSections() {
|
|
131
88
|
return [
|
|
132
89
|
[path.join(os.homedir(), ".aws", "config"), "[default]"],
|
|
133
90
|
[path.join(os.homedir(), ".aws", "credentials"), "[default]"],
|
|
134
91
|
];
|
|
135
92
|
}
|
|
136
|
-
/** Region the SDK would take from `[default]` when no named profile is in play. */
|
|
137
93
|
function awsDefaultProfileRegion() {
|
|
138
94
|
for (const [file, header] of awsDefaultProfileSections()) {
|
|
139
95
|
try {
|
|
@@ -142,32 +98,10 @@ function awsDefaultProfileRegion() {
|
|
|
142
98
|
return region;
|
|
143
99
|
}
|
|
144
100
|
catch {
|
|
145
|
-
/* file absent */
|
|
146
101
|
}
|
|
147
102
|
}
|
|
148
103
|
return undefined;
|
|
149
104
|
}
|
|
150
|
-
/**
|
|
151
|
-
* Fill AWS_PROFILE/AWS_REGION so tunnels run without env-var ceremony:
|
|
152
|
-
* profile by tenant convention ({tenant}-{env}, then {tenant}) when no
|
|
153
|
-
* credentials are already present, then region from the nearest Pulumi config,
|
|
154
|
-
* else that profile's own region. Applies to both the SDK lookups and the
|
|
155
|
-
* spawned `aws ssm start-session`.
|
|
156
|
-
*
|
|
157
|
-
* Order matters: AWS_REGION in the environment outranks a profile's own
|
|
158
|
-
* `region` in both the SDK v3 chain and the `aws` CLI, so the profile must be
|
|
159
|
-
* resolved FIRST and its region consulted BEFORE any platform default —
|
|
160
|
-
* otherwise a stack that isn't in us-east-2 (tests/tenants/bigbank,
|
|
161
|
-
* tests/tenants/mesh/apps/hello are us-east-1) gets silently redirected when
|
|
162
|
-
* run from a directory with no Pulumi.*.yaml. Same call `dev.ts:3157` and
|
|
163
|
-
* `utils/tailscale.ts:611` make.
|
|
164
|
-
*
|
|
165
|
-
* us-east-2 survives only as the last resort, because this module builds its
|
|
166
|
-
* SecretsManagerClient inline (`new SecretsManagerClient({})`) — aws-auth.ts's
|
|
167
|
-
* DEFAULT_REGION is module-private to that file and does NOT backstop it, so
|
|
168
|
-
* dropping the default outright turns a no-Pulumi/no-profile-region directory
|
|
169
|
-
* into `Region is missing` rather than a working tunnel.
|
|
170
|
-
*/
|
|
171
105
|
function applyAwsDefaults(tenant, env, stage) {
|
|
172
106
|
if (!process.env.AWS_PROFILE && !process.env.AWS_ACCESS_KEY_ID) {
|
|
173
107
|
const profile = [`${tenant}-${env}`, tenant].find(awsProfileExists);
|
|
@@ -177,10 +111,6 @@ function applyAwsDefaults(tenant, env, stage) {
|
|
|
177
111
|
}
|
|
178
112
|
}
|
|
179
113
|
if (!process.env.AWS_REGION && !process.env.AWS_DEFAULT_REGION) {
|
|
180
|
-
// stack config > the effective profile's own region > platform default.
|
|
181
|
-
// When no named profile is in play the SDK's effective profile is
|
|
182
|
-
// `[default]`, so consult ITS region before inventing us-east-2 —
|
|
183
|
-
// otherwise a plain `[default]`-only setup gets silently redirected.
|
|
184
114
|
const region = readPulumiAwsRegion(stage) ??
|
|
185
115
|
(process.env.AWS_PROFILE
|
|
186
116
|
? awsProfileRegion(process.env.AWS_PROFILE)
|
|
@@ -190,9 +120,6 @@ function applyAwsDefaults(tenant, env, stage) {
|
|
|
190
120
|
logInfo(`AWS region: ${region} (auto)`);
|
|
191
121
|
}
|
|
192
122
|
}
|
|
193
|
-
/**
|
|
194
|
-
* Service definitions with their local ports and display names
|
|
195
|
-
*/
|
|
196
123
|
const SERVICE_CONFIG = {
|
|
197
124
|
"temporal-frontend": {
|
|
198
125
|
bastionKey: "temporal-frontend",
|
|
@@ -210,16 +137,10 @@ const SERVICE_CONFIG = {
|
|
|
210
137
|
displayName: "Database (PostgreSQL)",
|
|
211
138
|
},
|
|
212
139
|
};
|
|
213
|
-
/**
|
|
214
|
-
* Service groups for convenience commands
|
|
215
|
-
*/
|
|
216
140
|
const SERVICE_GROUPS = {
|
|
217
141
|
dev: ["temporal-frontend", "temporal-ui", "db"],
|
|
218
142
|
temporal: ["temporal-frontend", "temporal-ui"],
|
|
219
143
|
};
|
|
220
|
-
/**
|
|
221
|
-
* Get the effective local port for a service, using custom port if provided
|
|
222
|
-
*/
|
|
223
144
|
function getEffectivePort(serviceName, options) {
|
|
224
145
|
const config = SERVICE_CONFIG[serviceName];
|
|
225
146
|
if (!config)
|
|
@@ -239,20 +160,12 @@ function getEffectivePort(serviceName, options) {
|
|
|
239
160
|
return config.localPort;
|
|
240
161
|
}
|
|
241
162
|
}
|
|
242
|
-
/**
|
|
243
|
-
* Parse services from --services flag or group name
|
|
244
|
-
*/
|
|
245
163
|
function parseServices(input) {
|
|
246
|
-
// Check if it's a group name
|
|
247
164
|
if (SERVICE_GROUPS[input]) {
|
|
248
165
|
return SERVICE_GROUPS[input];
|
|
249
166
|
}
|
|
250
|
-
// Otherwise parse as comma-separated list
|
|
251
167
|
return input.split(",").map((s) => s.trim());
|
|
252
168
|
}
|
|
253
|
-
/**
|
|
254
|
-
* Spawn an SSM tunnel to a service endpoint
|
|
255
|
-
*/
|
|
256
169
|
function spawnSsmTunnel(instanceId, service, localPort) {
|
|
257
170
|
return spawn("aws", [
|
|
258
171
|
"ssm",
|
|
@@ -269,9 +182,6 @@ function spawnSsmTunnel(instanceId, service, localPort) {
|
|
|
269
182
|
}),
|
|
270
183
|
], { stdio: "inherit" });
|
|
271
184
|
}
|
|
272
|
-
/**
|
|
273
|
-
* List available services
|
|
274
|
-
*/
|
|
275
185
|
async function listServices(options) {
|
|
276
186
|
const { tenant, env } = options;
|
|
277
187
|
const bastion = await getPlatformBastionInfo(tenant, env);
|
|
@@ -299,13 +209,9 @@ async function listServices(options) {
|
|
|
299
209
|
console.log(" mesh tunnel external <name> # Registered external service");
|
|
300
210
|
console.log("");
|
|
301
211
|
}
|
|
302
|
-
/**
|
|
303
|
-
* Start tunnels to multiple services
|
|
304
|
-
*/
|
|
305
212
|
async function tunnelServices(serviceNames, options) {
|
|
306
213
|
const { tenant, env } = options;
|
|
307
214
|
const bastion = await getPlatformBastionInfo(tenant, env);
|
|
308
|
-
// Resolve service names to configs and endpoints
|
|
309
215
|
const servicesToStart = [];
|
|
310
216
|
for (const name of serviceNames) {
|
|
311
217
|
const config = SERVICE_CONFIG[name];
|
|
@@ -342,7 +248,6 @@ async function tunnelServices(serviceNames, options) {
|
|
|
342
248
|
const localPort = getEffectivePort(name, options);
|
|
343
249
|
processes.push(spawnSsmTunnel(bastion.instanceId, endpoint, localPort));
|
|
344
250
|
}
|
|
345
|
-
// Handle cleanup on exit
|
|
346
251
|
const cleanup = () => {
|
|
347
252
|
for (const proc of processes) {
|
|
348
253
|
proc.kill();
|
|
@@ -351,21 +256,12 @@ async function tunnelServices(serviceNames, options) {
|
|
|
351
256
|
};
|
|
352
257
|
process.on("SIGINT", cleanup);
|
|
353
258
|
process.on("SIGTERM", cleanup);
|
|
354
|
-
// Wait for any process to exit
|
|
355
259
|
await Promise.race(processes.map((proc) => new Promise((resolve) => {
|
|
356
260
|
proc.on("exit", () => resolve());
|
|
357
261
|
proc.on("error", () => resolve());
|
|
358
262
|
})));
|
|
359
263
|
cleanup();
|
|
360
264
|
}
|
|
361
|
-
/**
|
|
362
|
-
* The credential axis (app tenant/stage) the ExternalService secret is keyed
|
|
363
|
-
* on, which is NOT the platform axis that hosts the bastion.
|
|
364
|
-
*
|
|
365
|
-
* Precedence: explicit --app-tenant/--app-stage, then the stage detected from
|
|
366
|
-
* cwd (a tenant-prefixed stack like `scu-dev` maps to platform env `dev`, and
|
|
367
|
-
* the secret is keyed on the former), then the platform tenant/env.
|
|
368
|
-
*/
|
|
369
265
|
export function resolveCredentialAxis(options) {
|
|
370
266
|
return {
|
|
371
267
|
appTenant: options.appTenant ?? options.tenant,
|
|
@@ -375,23 +271,10 @@ export function resolveCredentialAxis(options) {
|
|
|
375
271
|
function isValidPort(port) {
|
|
376
272
|
return Number.isInteger(port) && port >= 1 && port <= 65535;
|
|
377
273
|
}
|
|
378
|
-
/**
|
|
379
|
-
* Secrets Manager id for an ExternalService's credentials.
|
|
380
|
-
*
|
|
381
|
-
* Mirrors what the primitive builds (ExternalService.ts) and what apps resolve
|
|
382
|
-
* at runtime (libs/secrets): keyed on the APP tenant/stage, with multi-instance
|
|
383
|
-
* (credentials.keyedBy) services storing one secret per instance under the base.
|
|
384
|
-
*/
|
|
385
274
|
export function externalSecretId(appTenant, appStage, name, key) {
|
|
386
275
|
const base = `mesh/${appTenant}/${appStage}/external/${name}`;
|
|
387
276
|
return key ? `${base}/${key}` : base;
|
|
388
277
|
}
|
|
389
|
-
/**
|
|
390
|
-
* Pull the tunnel endpoint out of a credential secret. The local port defaults
|
|
391
|
-
* to the remote port so `localhost:<same-port>` behaves like the real service.
|
|
392
|
-
* Throws with a user-facing message when the secret isn't tunnelable or the
|
|
393
|
-
* `--port` override isn't a valid port number.
|
|
394
|
-
*/
|
|
395
278
|
export function resolveExternalPorts(creds, portOverride) {
|
|
396
279
|
const host = typeof creds.host === "string" ? creds.host.trim() : "";
|
|
397
280
|
const remotePort = Number(creds.port);
|
|
@@ -407,20 +290,8 @@ export function resolveExternalPorts(creds, portOverride) {
|
|
|
407
290
|
}
|
|
408
291
|
return { host, remotePort, localPort };
|
|
409
292
|
}
|
|
410
|
-
/**
|
|
411
|
-
* Tunnel to a registered external service (ExternalService primitive).
|
|
412
|
-
*
|
|
413
|
-
* The service's credential secret (mesh/{app-tenant}/{app-stage}/external/{name})
|
|
414
|
-
* is the source of truth for host/port — the same values deployed apps resolve
|
|
415
|
-
* at runtime via resolveCredentials() — so anything the platform bastion can
|
|
416
|
-
* reach is tunnelable without a per-service CLI entry.
|
|
417
|
-
*/
|
|
418
293
|
async function tunnelExternal(name, options) {
|
|
419
294
|
const { tenant, env, key } = options;
|
|
420
|
-
// The bastion lives in the platform tenant/env; the credential secret is
|
|
421
|
-
// keyed on the app tenant/stage. Those are different axes (a platform env
|
|
422
|
-
// like `dev-temporal` can host an app at stage `dev`), so they default to
|
|
423
|
-
// each other but stay separately overridable — same as `mesh db …`.
|
|
424
295
|
const { appTenant, appStage } = resolveCredentialAxis(options);
|
|
425
296
|
const secretId = externalSecretId(appTenant, appStage, name, key);
|
|
426
297
|
const setHint = `mesh secrets set external/${name}${key ? ` --key=${key}` : ""}`;
|
|
@@ -475,9 +346,6 @@ async function tunnelExternal(name, options) {
|
|
|
475
346
|
});
|
|
476
347
|
cleanup();
|
|
477
348
|
}
|
|
478
|
-
/**
|
|
479
|
-
* Register tunnel commands with the CLI
|
|
480
|
-
*/
|
|
481
349
|
export function registerTunnelCommands(program) {
|
|
482
350
|
const tunnel = program
|
|
483
351
|
.command("tunnel")
|
|
@@ -494,23 +362,18 @@ export function registerTunnelCommands(program) {
|
|
|
494
362
|
const { tenant, env, stage } = resolveTenantEnv(rawOptions);
|
|
495
363
|
applyAwsDefaults(tenant, env, stage);
|
|
496
364
|
const options = { ...rawOptions, tenant, env };
|
|
497
|
-
// Handle --list
|
|
498
365
|
if (options.list) {
|
|
499
366
|
await listServices(options);
|
|
500
367
|
return;
|
|
501
368
|
}
|
|
502
|
-
// Determine which services to start
|
|
503
369
|
let services;
|
|
504
370
|
if (options.services) {
|
|
505
|
-
// Explicit --services flag
|
|
506
371
|
services = parseServices(options.services);
|
|
507
372
|
}
|
|
508
373
|
else if (group) {
|
|
509
|
-
// Positional group argument
|
|
510
374
|
services = parseServices(group);
|
|
511
375
|
}
|
|
512
376
|
else {
|
|
513
|
-
// No services specified - show help
|
|
514
377
|
await listServices(options);
|
|
515
378
|
return;
|
|
516
379
|
}
|
|
@@ -528,13 +391,9 @@ export function registerTunnelCommands(program) {
|
|
|
528
391
|
.option("-k, --key <key>", "Instance key for a multi-instance external (credentials.keyedBy)")
|
|
529
392
|
.option("-p, --port <port>", "Local port (default: the service's remote port)")
|
|
530
393
|
.action(async (name, _options, command) => {
|
|
531
|
-
// -t/-e are also declared on the parent `tunnel` command, which
|
|
532
|
-
// consumes them wherever they appear — merge both scopes, then fall
|
|
533
|
-
// back to Pulumi/SST context detection.
|
|
534
394
|
const merged = command.optsWithGlobals();
|
|
535
395
|
const { tenant, env, stage } = resolveTenantEnv(merged);
|
|
536
396
|
applyAwsDefaults(tenant, env, stage);
|
|
537
397
|
await tunnelExternal(name, { ...merged, tenant, env, stage });
|
|
538
398
|
});
|
|
539
399
|
}
|
|
540
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -11,10 +11,6 @@ export async function cloneCommand(repo, dest, opts) {
|
|
|
11
11
|
`${baseUrl}/git/${repo}`,
|
|
12
12
|
dest ?? repo,
|
|
13
13
|
], token);
|
|
14
|
-
// Persist the auth header for future fetches in THIS clone only.
|
|
15
|
-
// Dev-grade: tokens land in .git/config — revisit with a credential helper
|
|
16
|
-
// once non-dev tokens are routine.
|
|
17
14
|
await gitWithAuth(["config", "http.extraHeader", `Authorization: Bearer ${token}`], token, dest ?? repo);
|
|
18
15
|
console.log(`cloned ${repo} → ${dest ?? repo} (read-only remote; use 'mesh vcs propose' to submit changes)`);
|
|
19
16
|
}
|
|
20
|
-
//# sourceMappingURL=clone.js.map
|
|
@@ -9,47 +9,15 @@ export interface CommonOpts {
|
|
|
9
9
|
token?: string;
|
|
10
10
|
context?: string;
|
|
11
11
|
}
|
|
12
|
-
/** Strip a bearer token out of an error before it is surfaced.
|
|
13
|
-
*
|
|
14
|
-
* The vcs git calls authenticate by putting the token in argv
|
|
15
|
-
* (`-c http.extraHeader=Authorization: Bearer <jwt>`), and `execFile` puts the
|
|
16
|
-
* whole argv into the message it throws. So an ordinary mistake — a wrong repo
|
|
17
|
-
* name, a typo'd host — prints a live credential into the terminal, the CI log,
|
|
18
|
-
* or an agent transcript — a `mesh vcs clone` against a mistyped host would
|
|
19
|
-
* otherwise emit the full JWT.
|
|
20
|
-
*
|
|
21
|
-
* Folds `stderr` into the message on the way, because that is where git's
|
|
22
|
-
* actual reason lives ("repository not found", "Authentication failed") and it
|
|
23
|
-
* can carry the token too.
|
|
24
|
-
*
|
|
25
|
-
* @example
|
|
26
|
-
* try {
|
|
27
|
-
* await execFileAsync("git", ["-c", `http.extraHeader=Authorization: Bearer ${token}`, "clone", url]);
|
|
28
|
-
* } catch (err) {
|
|
29
|
-
* throw redactToken(err, token); // the JWT reads as `<redacted-token>`
|
|
30
|
-
* }
|
|
31
|
-
*/
|
|
32
12
|
export declare function redactToken(err: unknown, token: string): Error;
|
|
33
|
-
/**
|
|
34
|
-
* Run git with a bearer token in argv, redacting it from any failure.
|
|
35
|
-
*
|
|
36
|
-
* @example
|
|
37
|
-
* const { stdout } = await gitWithAuth(
|
|
38
|
-
* ["-c", `http.extraHeader=Authorization: Bearer ${token}`, "ls-remote", url],
|
|
39
|
-
* token,
|
|
40
|
-
* );
|
|
41
|
-
*/
|
|
42
13
|
export declare function gitWithAuth(args: string[], token: string, cwd?: string): Promise<{
|
|
43
14
|
stdout: string;
|
|
44
15
|
stderr: string;
|
|
45
16
|
}>;
|
|
46
|
-
/** https://host/git/<repo> (origin remote) → { baseUrl: https://host, repo }. */
|
|
47
17
|
export declare function parseRemote(remoteUrl: string): VcsTarget | null;
|
|
48
18
|
export declare function resolveTarget(opts: CommonOpts & {
|
|
49
19
|
repo?: string;
|
|
50
20
|
cwd?: string;
|
|
51
21
|
}): Promise<VcsTarget>;
|
|
52
22
|
export declare function resolveToken(opts: CommonOpts): Promise<string>;
|
|
53
|
-
/** Minimal authenticated JSON call against the vcs API. */
|
|
54
23
|
export declare function vcsApi(baseUrl: string, token: string, path: string, method?: string, body?: unknown): Promise<unknown>;
|
|
55
|
-
//# sourceMappingURL=common.d.ts.map
|