@mesh-tech/mesh-cli 0.20.1 → 0.20.3
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 +6 -5
- package/dist/bin/mesh.d.ts +0 -12
- package/dist/bin/mesh.js +99 -50
- package/dist/bin/mesh.js.map +2 -3
- 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 +4 -88
- package/dist/src/commands/create-app.js +16 -155
- 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 +5 -116
- package/dist/src/commands/init/wizard.js +42 -110
- 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.map +0 -1
- 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 +1 -1
- package/skills/core/SKILL.md +10 -11
- 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,23 +1,10 @@
|
|
|
1
1
|
export interface StackSelector {
|
|
2
|
-
/** Canonical Pulumi stack name. */
|
|
3
2
|
stack?: string;
|
|
4
|
-
/** @deprecated SST-era alias for {@link StackSelector.stack}; still accepted. */
|
|
5
3
|
stage?: string;
|
|
6
4
|
}
|
|
7
|
-
/**
|
|
8
|
-
* Resolve the stack selector, preferring the canonical `--stack` over the
|
|
9
|
-
* deprecated `--stage` alias. Pure: reports whether the deprecated alias supplied
|
|
10
|
-
* the value so the caller can warn. `--stack` wins when both are present.
|
|
11
|
-
*/
|
|
12
5
|
export declare function resolveStackSelector(opts: StackSelector): {
|
|
13
6
|
stack: string | undefined;
|
|
14
7
|
usedDeprecatedStage: boolean;
|
|
15
8
|
};
|
|
16
|
-
/** Test-only: reset the once-per-process deprecation-warning latch. */
|
|
17
9
|
export declare function resetStackFlagWarning(): void;
|
|
18
|
-
/**
|
|
19
|
-
* Resolve `--stack`/`--stage` to the effective stack for use at a consumption
|
|
20
|
-
* site, warning ONCE per process when the deprecated `--stage` alias supplied it.
|
|
21
|
-
*/
|
|
22
10
|
export declare function resolveStackOption(opts: StackSelector): string | undefined;
|
|
23
|
-
//# sourceMappingURL=stack-flag.d.ts.map
|
|
@@ -1,19 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Stack-selection flag resolution (MESH-2154).
|
|
3
|
-
*
|
|
4
|
-
* `mesh` subcommands historically disagreed on the stack-selection flag:
|
|
5
|
-
* `deploy`/`cluster` use `--stack` (Pulumi-native), while `dev`/`secrets` used
|
|
6
|
-
* `--stage` (the SST-era term the platform has moved off). So `mesh kubectl
|
|
7
|
-
* --stage dev` and `mesh dev --stack …` each errored on muscle memory. We
|
|
8
|
-
* consolidate on `--stack` everywhere and keep `--stage` as a HIDDEN, deprecated
|
|
9
|
-
* alias that still works but warns — removable after a transition window.
|
|
10
|
-
*/
|
|
11
1
|
import { logWarn } from './log.js';
|
|
12
|
-
/**
|
|
13
|
-
* Resolve the stack selector, preferring the canonical `--stack` over the
|
|
14
|
-
* deprecated `--stage` alias. Pure: reports whether the deprecated alias supplied
|
|
15
|
-
* the value so the caller can warn. `--stack` wins when both are present.
|
|
16
|
-
*/
|
|
17
2
|
export function resolveStackSelector(opts) {
|
|
18
3
|
if (opts.stack != null)
|
|
19
4
|
return { stack: opts.stack, usedDeprecatedStage: false };
|
|
@@ -22,14 +7,9 @@ export function resolveStackSelector(opts) {
|
|
|
22
7
|
return { stack: undefined, usedDeprecatedStage: false };
|
|
23
8
|
}
|
|
24
9
|
let warnedOnce = false;
|
|
25
|
-
/** Test-only: reset the once-per-process deprecation-warning latch. */
|
|
26
10
|
export function resetStackFlagWarning() {
|
|
27
11
|
warnedOnce = false;
|
|
28
12
|
}
|
|
29
|
-
/**
|
|
30
|
-
* Resolve `--stack`/`--stage` to the effective stack for use at a consumption
|
|
31
|
-
* site, warning ONCE per process when the deprecated `--stage` alias supplied it.
|
|
32
|
-
*/
|
|
33
13
|
export function resolveStackOption(opts) {
|
|
34
14
|
const { stack, usedDeprecatedStage } = resolveStackSelector(opts);
|
|
35
15
|
if (usedDeprecatedStage && !warnedOnce) {
|
|
@@ -38,4 +18,3 @@ export function resolveStackOption(opts) {
|
|
|
38
18
|
}
|
|
39
19
|
return stack;
|
|
40
20
|
}
|
|
41
|
-
//# sourceMappingURL=stack-flag.js.map
|
|
@@ -1,52 +1,15 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Resolve a tenant's VPC tunnel targets from the platform bastion's service
|
|
3
|
-
* map — the same source `startSsmTunnels` reads — mapping bastion service keys
|
|
4
|
-
* to the app's tunnel names, resolving each ELB/RDS hostname to its private IP,
|
|
5
|
-
* and assigning collision-free localhost ports via the SSM port convention.
|
|
6
|
-
* (MESH-2040 / Slice 1 of MESH-2014.)
|
|
7
|
-
*/
|
|
8
|
-
/** Local-port block width per tenant — wider than the canonical port span so
|
|
9
|
-
* two tenants' port blocks never overlap. */
|
|
10
1
|
export declare const PORT_BLOCK = 3000;
|
|
11
|
-
/**
|
|
12
|
-
* Deterministic per-tenant index for local-port offsetting. Reads a machine-global
|
|
13
|
-
* registry (`~/.config/mesh/tailscale/port-registry.json`), seeded `{ mesh: 0 }` so
|
|
14
|
-
* the hub's canonical ports are grandfathered regardless of registration order.
|
|
15
|
-
* Assigns the next index to an unseen tenant and persists it. `registryPath` is
|
|
16
|
-
* injectable for tests.
|
|
17
|
-
*/
|
|
18
2
|
export declare function tenantPortIndex(tenant: string, registryPath?: string): number;
|
|
19
3
|
export interface TunnelTarget {
|
|
20
|
-
/** App-facing tunnel name (e.g. "temporal"). */
|
|
21
4
|
name: string;
|
|
22
|
-
/** Local port the forwarder listens on (SSM convention: base + remotePort). */
|
|
23
5
|
localPort: number;
|
|
24
|
-
/** VPC hostname (internal ELB / RDS endpoint). */
|
|
25
6
|
targetHost: string;
|
|
26
|
-
/** Resolved private IP of `targetHost`. */
|
|
27
7
|
targetIp: string;
|
|
28
|
-
/** Port on the VPC service. */
|
|
29
8
|
remotePort: number;
|
|
30
9
|
}
|
|
31
|
-
/**
|
|
32
|
-
* Bastion service key → app tunnel name. Mirrors `tunnelToBastionKey` in dev.ts
|
|
33
|
-
* (inverted): the bastion exposes `temporal-frontend`; the app calls it `temporal`.
|
|
34
|
-
*/
|
|
35
10
|
export declare const TUNNEL_NAME_BY_BASTION_KEY: Record<string, string>;
|
|
36
|
-
/**
|
|
37
|
-
* Build the tunnel target set. `resolveIp` is injected for testability (the
|
|
38
|
-
* command passes `resolveElbIp`). Services not in the name map are skipped;
|
|
39
|
-
* services whose host can't be resolved are skipped (the forwarder needs an IP).
|
|
40
|
-
*/
|
|
41
11
|
export declare function resolveTunnelTargets(services: Record<string, {
|
|
42
12
|
host: string;
|
|
43
13
|
port: number;
|
|
44
14
|
}>, resolveIp: (host: string) => string | null, portOffset?: number): TunnelTarget[];
|
|
45
|
-
/**
|
|
46
|
-
* Resolve an AWS-internal ELB/RDS hostname to its private IP via a public
|
|
47
|
-
* resolver — these names publish their private (10.x) address to public DNS
|
|
48
|
-
* but the host's default resolver may not answer for them. Returns null on
|
|
49
|
-
* failure (caller skips that tunnel).
|
|
50
|
-
*/
|
|
51
15
|
export declare function resolveElbIp(host: string): string | null;
|
|
52
|
-
//# sourceMappingURL=tailscale-targets.d.ts.map
|
|
@@ -1,25 +1,9 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Resolve a tenant's VPC tunnel targets from the platform bastion's service
|
|
3
|
-
* map — the same source `startSsmTunnels` reads — mapping bastion service keys
|
|
4
|
-
* to the app's tunnel names, resolving each ELB/RDS hostname to its private IP,
|
|
5
|
-
* and assigning collision-free localhost ports via the SSM port convention.
|
|
6
|
-
* (MESH-2040 / Slice 1 of MESH-2014.)
|
|
7
|
-
*/
|
|
8
1
|
import { execFileSync } from "node:child_process";
|
|
9
2
|
import * as fs from "node:fs";
|
|
10
3
|
import * as path from "node:path";
|
|
11
4
|
import { reserveSsmLocalPortCandidate, preferredSsmLocalPort } from "../commands/dev.js";
|
|
12
5
|
import { CONFIG_DIR, atomicWriteFileSync } from "../commands/login.js";
|
|
13
|
-
/** Local-port block width per tenant — wider than the canonical port span so
|
|
14
|
-
* two tenants' port blocks never overlap. */
|
|
15
6
|
export const PORT_BLOCK = 3000;
|
|
16
|
-
/**
|
|
17
|
-
* Deterministic per-tenant index for local-port offsetting. Reads a machine-global
|
|
18
|
-
* registry (`~/.config/mesh/tailscale/port-registry.json`), seeded `{ mesh: 0 }` so
|
|
19
|
-
* the hub's canonical ports are grandfathered regardless of registration order.
|
|
20
|
-
* Assigns the next index to an unseen tenant and persists it. `registryPath` is
|
|
21
|
-
* injectable for tests.
|
|
22
|
-
*/
|
|
23
7
|
export function tenantPortIndex(tenant, registryPath) {
|
|
24
8
|
const p = registryPath ?? path.join(CONFIG_DIR, "tailscale", "port-registry.json");
|
|
25
9
|
let reg;
|
|
@@ -37,20 +21,11 @@ export function tenantPortIndex(tenant, registryPath) {
|
|
|
37
21
|
atomicWriteFileSync(p, JSON.stringify(reg, null, 2), 0o600);
|
|
38
22
|
return idx;
|
|
39
23
|
}
|
|
40
|
-
/**
|
|
41
|
-
* Bastion service key → app tunnel name. Mirrors `tunnelToBastionKey` in dev.ts
|
|
42
|
-
* (inverted): the bastion exposes `temporal-frontend`; the app calls it `temporal`.
|
|
43
|
-
*/
|
|
44
24
|
export const TUNNEL_NAME_BY_BASTION_KEY = {
|
|
45
25
|
"temporal-frontend": "temporal",
|
|
46
26
|
"temporal-ui": "temporal-ui",
|
|
47
27
|
rds: "rds",
|
|
48
28
|
};
|
|
49
|
-
/**
|
|
50
|
-
* Build the tunnel target set. `resolveIp` is injected for testability (the
|
|
51
|
-
* command passes `resolveElbIp`). Services not in the name map are skipped;
|
|
52
|
-
* services whose host can't be resolved are skipped (the forwarder needs an IP).
|
|
53
|
-
*/
|
|
54
29
|
export function resolveTunnelTargets(services, resolveIp, portOffset = 0) {
|
|
55
30
|
const reserved = new Set();
|
|
56
31
|
const targets = [];
|
|
@@ -61,18 +36,11 @@ export function resolveTunnelTargets(services, resolveIp, portOffset = 0) {
|
|
|
61
36
|
const targetIp = resolveIp(svc.host);
|
|
62
37
|
if (!targetIp)
|
|
63
38
|
continue;
|
|
64
|
-
// Per-tenant offset keeps concurrent platform tenants off each other's ports.
|
|
65
39
|
const localPort = reserveSsmLocalPortCandidate(svc.port, reserved, preferredSsmLocalPort(svc.port) + portOffset);
|
|
66
40
|
targets.push({ name, localPort, targetHost: svc.host, targetIp, remotePort: svc.port });
|
|
67
41
|
}
|
|
68
42
|
return targets;
|
|
69
43
|
}
|
|
70
|
-
/**
|
|
71
|
-
* Resolve an AWS-internal ELB/RDS hostname to its private IP via a public
|
|
72
|
-
* resolver — these names publish their private (10.x) address to public DNS
|
|
73
|
-
* but the host's default resolver may not answer for them. Returns null on
|
|
74
|
-
* failure (caller skips that tunnel).
|
|
75
|
-
*/
|
|
76
44
|
export function resolveElbIp(host) {
|
|
77
45
|
try {
|
|
78
46
|
const out = execFileSync("dig", ["+short", host, "@1.1.1.1"], {
|
|
@@ -90,4 +58,3 @@ export function resolveElbIp(host) {
|
|
|
90
58
|
return null;
|
|
91
59
|
}
|
|
92
60
|
}
|
|
93
|
-
//# sourceMappingURL=tailscale-targets.js.map
|
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Userspace-Tailscale daemon management + tunnel-session state for
|
|
3
|
-
* `mesh vpn tunnel` (MESH-2040 / Slice 1 of MESH-2014).
|
|
4
|
-
*
|
|
5
|
-
* A per-tenant `tailscaled` runs in userspace-networking mode (brew formula,
|
|
6
|
-
* NOT the GUI app) exposing a SOCKS5 proxy; forwarders bridge `localhost:PORT`
|
|
7
|
-
* to VPC services through it. State lives under `~/.config/mesh/tailscale/<tenant>/`
|
|
8
|
-
* (r+w-granted under safehouse — see the MESH-2036 spike).
|
|
9
|
-
*/
|
|
10
1
|
import type { PidSource } from "./pid.js";
|
|
11
2
|
import type { OwnershipCheck } from "./tunnel-ownership.js";
|
|
12
3
|
import type { TunnelTarget } from "./tailscale-targets.js";
|
|
@@ -15,29 +6,14 @@ export declare function tenantStateDir(tenant: string): string;
|
|
|
15
6
|
export declare function socketPath(tenant: string): string;
|
|
16
7
|
export declare function logPath(tenant: string): string;
|
|
17
8
|
export declare function statePath(tenant: string): string;
|
|
18
|
-
/**
|
|
19
|
-
* Daemon-scoped metadata, written by `ensureDaemon` when it actually spawns the
|
|
20
|
-
* daemon. Unlike `tunnel-state.json` (which `down` clears), this survives `down`
|
|
21
|
-
* so a later `up` reuses the RUNNING daemon's SOCKS port instead of minting a
|
|
22
|
-
* fresh one the daemon isn't listening on (which would leave every forwarder
|
|
23
|
-
* dialing a dead port). Also records the daemon pid so `stopDaemon` can kill it.
|
|
24
|
-
*/
|
|
25
9
|
export declare function daemonMetaPath(tenant: string): string;
|
|
26
|
-
/**
|
|
27
|
-
* Ownership manifest written by the RUNNER (the process that binds the
|
|
28
|
-
* forwarder ports) — pid, process-group id, per-run token, control port. The
|
|
29
|
-
* ownership handshake (MESH-2407) verifies against it; teardown signals the
|
|
30
|
-
* recorded process group.
|
|
31
|
-
*/
|
|
32
10
|
export declare function runnerManifestPath(tenant: string): string;
|
|
33
11
|
export interface TunnelState {
|
|
34
12
|
tenant: string;
|
|
35
13
|
env: string;
|
|
36
14
|
socksPort: number;
|
|
37
15
|
loginServer: string;
|
|
38
|
-
/** PID of the detached forwarder supervisor (null until spawned). */
|
|
39
16
|
supervisorPid: number | null;
|
|
40
|
-
/** How the runner is supervised. Defaults to "detached" when absent. */
|
|
41
17
|
managed?: "launchd" | "detached";
|
|
42
18
|
startedAt: string;
|
|
43
19
|
tunnels: TunnelTarget[];
|
|
@@ -46,191 +22,60 @@ export declare function readTunnelState(tenant: string): TunnelState | null;
|
|
|
46
22
|
export declare function writeTunnelState(tenant: string, state: TunnelState): void;
|
|
47
23
|
export declare function clearTunnelState(tenant: string): void;
|
|
48
24
|
export interface DaemonMeta {
|
|
49
|
-
/** The `--socks5-server` port the running daemon actually listens on. */
|
|
50
25
|
socksPort: number;
|
|
51
|
-
/** PID of the detached `tailscaled` process (for `stopDaemon`). */
|
|
52
26
|
pid: number;
|
|
53
27
|
}
|
|
54
28
|
export declare function readDaemonMeta(tenant: string): DaemonMeta | null;
|
|
55
29
|
export declare function writeDaemonMeta(tenant: string, meta: DaemonMeta): void;
|
|
56
30
|
export declare function clearDaemonMeta(tenant: string): void;
|
|
57
|
-
/** Parse `tailscale status --json` → the fields we care about. */
|
|
58
31
|
export declare function parseDaemonState(statusJson: string): {
|
|
59
32
|
backendState: string;
|
|
60
33
|
selfName?: string;
|
|
61
34
|
};
|
|
62
|
-
/** The brew `tailscaled` (NOT the GUI app, which ships no standalone daemon). */
|
|
63
35
|
export declare function tailscaledBinPath(): string;
|
|
64
|
-
/** The brew `tailscale` CLI (prefer it over the GUI shim, which aborts under sandbox). */
|
|
65
36
|
export declare function tailscaleBinPath(): string;
|
|
66
|
-
/** Backend state via the tenant's control socket; "Down" when no daemon answers. */
|
|
67
37
|
export declare function daemonState(tenant: string): {
|
|
68
38
|
backendState: string;
|
|
69
39
|
selfName?: string;
|
|
70
40
|
};
|
|
71
|
-
/**
|
|
72
|
-
* Extract the `--socks5-server` port from a `tailscaled` command line. Pure so
|
|
73
|
-
* it's unit-testable. Accepts both `--socks5-server=127.0.0.1:PORT` and the
|
|
74
|
-
* space-separated form, and a `localhost` host literal. Returns null if absent
|
|
75
|
-
* or malformed.
|
|
76
|
-
*/
|
|
77
41
|
export declare function parseSocksPortFromArgv(argv: string): number | null;
|
|
78
|
-
/**
|
|
79
|
-
* Find the running userspace `tailscaled` for a tenant by its unique
|
|
80
|
-
* `--socket=<path>` argument, returning its pid and the SOCKS port it ACTUALLY
|
|
81
|
-
* bound (parsed from argv). Authoritative when `daemon.json` is missing or stale
|
|
82
|
-
* (e.g. a daemon left by an older build that predates the meta file). Returns
|
|
83
|
-
* null when no matching process is found or `ps` is unavailable.
|
|
84
|
-
*/
|
|
85
42
|
export declare function findRunningDaemon(tenant: string): {
|
|
86
43
|
pid: number;
|
|
87
44
|
socksPort: number | null;
|
|
88
45
|
} | null;
|
|
89
|
-
/** True if something accepts TCP on 127.0.0.1:port within `timeoutMs`. */
|
|
90
46
|
export declare function portAccepts(port: number, timeoutMs?: number): Promise<boolean>;
|
|
91
|
-
/**
|
|
92
|
-
* Ensure a userspace `tailscaled` is running for the tenant and return the SOCKS
|
|
93
|
-
* port the forwarders should dial. Idempotent — reuses a live daemon, but
|
|
94
|
-
* RECONCILES the port: a daemon that's up on a different port than requested
|
|
95
|
-
* (older build with no `daemon.json`, or stale meta) would otherwise leave every
|
|
96
|
-
* forwarder dialing a dead port (MESH-2169). Trust `opts.socksPort` only if it
|
|
97
|
-
* truly accepts; else adopt the running daemon's real port; else restart fresh.
|
|
98
|
-
*/
|
|
99
47
|
export declare function ensureDaemon(tenant: string, opts: {
|
|
100
48
|
region: string;
|
|
101
49
|
socksPort: number;
|
|
102
50
|
}): Promise<number>;
|
|
103
|
-
/**
|
|
104
|
-
* Stop the detached `tailscaled` for a tenant (SIGTERM its pid) and remove the
|
|
105
|
-
* socket + daemon metadata. Leaves the Headscale node identity in `tailscaled.state`
|
|
106
|
-
* so a later `up` re-spawns and rejoins without an interactive re-login — unless
|
|
107
|
-
* the caller logged out first.
|
|
108
|
-
*
|
|
109
|
-
* Best-effort, and that includes a corrupt `daemon.json`: an unsignalable
|
|
110
|
-
* recorded pid is REFUSED (never handed to `kill`) but only warns — the socket
|
|
111
|
-
* and meta are still cleared. `ensureDaemon` calls this on the UP path to
|
|
112
|
-
* recycle a daemon it can't verify, so throwing here would dead-end
|
|
113
|
-
* `mesh vpn tunnel up` / `mesh dev` on the very file this function deletes.
|
|
114
|
-
* Safe to call when nothing is running.
|
|
115
|
-
*/
|
|
116
51
|
export declare function stopDaemon(tenant: string): void;
|
|
117
|
-
/**
|
|
118
|
-
* Build the `tailscale up` argument vector. Pure so it can be unit-tested and so
|
|
119
|
-
* the interactive (browser-register) and zero-touch (pre-auth key) forms differ
|
|
120
|
-
* only by the trailing `--authkey`.
|
|
121
|
-
*/
|
|
122
52
|
export declare function buildTailscaleUpArgs(opts: {
|
|
123
53
|
socket: string;
|
|
124
54
|
loginServer: string;
|
|
125
55
|
hostname: string;
|
|
126
56
|
preAuthKey?: string;
|
|
127
57
|
}): string[];
|
|
128
|
-
/**
|
|
129
|
-
* Join the tenant's Headscale tailnet via Zitadel OIDC if not already Running.
|
|
130
|
-
* Prints the device-flow registration URL and polls until registered. When a
|
|
131
|
-
* pre-auth key is supplied the join is non-interactive: no `/register/` URL is
|
|
132
|
-
* emitted, so the scrape/relay is skipped and we just wait for Running.
|
|
133
|
-
*/
|
|
134
58
|
export declare function joinHeadscale(tenant: string, loginServer: string, opts?: {
|
|
135
59
|
preAuthKey?: string;
|
|
136
60
|
}): Promise<void>;
|
|
137
|
-
/** Log the tenant daemon out of Headscale (disconnect). Daemon process persists. */
|
|
138
61
|
export declare function logout(tenant: string): void;
|
|
139
|
-
/**
|
|
140
|
-
* True iff two target sets are identical down to targetIp + remotePort. A live
|
|
141
|
-
* runner pins each forwarder's target at startup, so if the ELB IP rotated (or a
|
|
142
|
-
* port changed) the running forwarders point at a dead address and must be
|
|
143
|
-
* respawned, not reused. Pid-agnostic (a launchd runner records no supervisor pid).
|
|
144
|
-
*/
|
|
145
62
|
export declare function tunnelTargetsEqual(a: TunnelTarget[], b: TunnelTarget[]): boolean;
|
|
146
|
-
/** True iff `state` has a supervisor pid and its target set equals `targets`. */
|
|
147
63
|
export declare function supervisorTargetsMatch(state: TunnelState | null, targets: TunnelTarget[]): boolean;
|
|
148
|
-
/**
|
|
149
|
-
* SIGTERM the supervisor's whole process GROUP, not the bare pid.
|
|
150
|
-
*
|
|
151
|
-
* `state.supervisorPid` is the pid of the detached spawn — which, under the
|
|
152
|
-
* canonical source launcher, is `bin/mesh.mjs`. That launcher blocks in
|
|
153
|
-
* `execFileSync` around the *real* runner (a `node --import tsx … mesh.ts`
|
|
154
|
-
* grandchild that actually binds the forwarder ports), and `execFileSync` does
|
|
155
|
-
* not forward signals. So signalling the bare pid kills only the launcher and
|
|
156
|
-
* ORPHANS the runner, which keeps its ports bound — the orphan then answers
|
|
157
|
-
* `allForwardersListening`'s ownership-less liveness dial and silently pins
|
|
158
|
-
* every tunnel to a stale target (the MESH-2169 / MESH-2014 failure class).
|
|
159
|
-
*
|
|
160
|
-
* The launcher is spawned `detached: true`, so it is a process-group leader
|
|
161
|
-
* (`pgid === pid`); `process.kill(-pid, …)` reaps the launcher and the runner
|
|
162
|
-
* together. Falls back to the bare pid for a legacy state file whose pid was
|
|
163
|
-
* not a group leader, and tolerates ESRCH (already gone).
|
|
164
|
-
*
|
|
165
|
-
* `pid` is always recovered — from `tunnel-state.json`, `runner.json`, or a
|
|
166
|
-
* `ps` scan — never constructed here, so it is guarded first. The guard rejects
|
|
167
|
-
* anything below 2, which is what makes the NEGATED form safe: `pid >= 2` ⇒
|
|
168
|
-
* `-pid <= -2`, a real process group, never `kill(0)` (this shell's own group)
|
|
169
|
-
* or `kill(-1)` (broadcast to everything the user can signal). See utils/pid.ts.
|
|
170
|
-
*
|
|
171
|
-
* @throws {MeshCliError} when `pid` is unsignalable. Callers reaping SEVERAL
|
|
172
|
-
* independently-recovered pids must catch per-pid (see `stopTunnelRunners`) —
|
|
173
|
-
* letting one refusal propagate would skip the other pids and leave a live
|
|
174
|
-
* runner holding ports.
|
|
175
|
-
*/
|
|
176
64
|
export declare function killSupervisor(pid: number, source?: PidSource): void;
|
|
177
|
-
/**
|
|
178
|
-
* The ownership handshake for a tenant's tunnel runner (MESH-2407): manifest →
|
|
179
|
-
* live pid → control endpoint → token + SOCKS port + port coverage. This is
|
|
180
|
-
* the ONLY readiness/reuse signal — a bare TCP dial proves a listener exists,
|
|
181
|
-
* not that it is ours, and adopting a foreign listener is exactly the
|
|
182
|
-
* silent-dead-tunnel class (MESH-2169 / MESH-2014 / #2991). As a bonus the
|
|
183
|
-
* handshake reads listening state from the runner's in-process servers, so it
|
|
184
|
-
* opens no SOCKS→VPC data connection the way port dials do.
|
|
185
|
-
*/
|
|
186
65
|
export declare function verifyTunnelOwnership(tenant: string, expected: {
|
|
187
66
|
socksPort: number;
|
|
188
67
|
ports: number[];
|
|
189
68
|
}): Promise<OwnershipCheck>;
|
|
190
|
-
/**
|
|
191
|
-
* Tear down EVERY runner we can attribute to the tenant: the recorded
|
|
192
|
-
* supervisor pid (as a process group — see `killSupervisor`), the launchd
|
|
193
|
-
* agent, the manifest's process group, and any `__run`/`__supervise` process
|
|
194
|
-
* discovered from argv (a runner from an older build, or one whose state file
|
|
195
|
-
* was lost). This is the single teardown path — the #2991 lesson generalized:
|
|
196
|
-
* no kill path may leave a grandchild with ports still bound.
|
|
197
|
-
*/
|
|
198
69
|
export declare function stopTunnelRunners(tenant: string, prior: TunnelState | null): void;
|
|
199
|
-
/**
|
|
200
|
-
* Ensure the per-tenant forwarder supervisor is running for `state.tunnels`.
|
|
201
|
-
* Idempotent: reuses a live runner ONLY when it passes the ownership handshake
|
|
202
|
-
* (our manifest token, our SOCKS port, every target port listening in-process);
|
|
203
|
-
* otherwise tears down every attributable runner, verifies the ports actually
|
|
204
|
-
* freed (a still-held port is a foreign squatter → loud failure, never spawn
|
|
205
|
-
* over it), and (re)spawns a fresh runner — whose readiness is again the
|
|
206
|
-
* handshake, not a bare port dial. Persists the state and returns the pid.
|
|
207
|
-
*/
|
|
208
70
|
export declare function ensureForwarders(state: TunnelState): Promise<number>;
|
|
209
|
-
/**
|
|
210
|
-
* Rewrite `devOutput.tunnels` so each resolved target points at its local
|
|
211
|
-
* forwarder (`localhost:localPort`) — the same shape `startSsmTunnels`
|
|
212
|
-
* produces. Unmatched tunnels are left untouched. Pure (no mutation of input).
|
|
213
|
-
*/
|
|
214
71
|
export declare function rewriteTunnelsForTargets(devOutput: DevOutput, targets: TunnelTarget[]): DevOutput;
|
|
215
|
-
/** True when the brew `tailscaled` binary is resolvable (Tailscale transport is usable). */
|
|
216
72
|
export declare function tailscaleAvailable(): boolean;
|
|
217
|
-
/**
|
|
218
|
-
* Ensure the tenant's Tailscale tunnels are fully up: the shared per-tenant
|
|
219
|
-
* daemon (started + OIDC-joined if needed), the resolved VPC targets, and the
|
|
220
|
-
* forwarder supervisor. Idempotent (shared across worktrees/invocations of the
|
|
221
|
-
* same tenant). Returns the resolved targets. Used by both `mesh vpn tunnel up`
|
|
222
|
-
* and `mesh dev --transport=tailscale`.
|
|
223
|
-
*/
|
|
224
73
|
export declare function ensureTailscaleTunnels(tenant: string, env: string, opts: {
|
|
225
74
|
region: string;
|
|
226
75
|
loginServer: string;
|
|
227
76
|
socksPort: number;
|
|
228
77
|
preAuthKey?: string;
|
|
229
78
|
}): Promise<TunnelTarget[]>;
|
|
230
|
-
/**
|
|
231
|
-
* `startSsmTunnels` drop-in for `mesh dev`: ensure the tenant's Tailscale
|
|
232
|
-
* tunnels, then rewrite `devOutput.tunnels` to the local forwarder ports.
|
|
233
|
-
*/
|
|
234
79
|
export declare function startTailscaleTunnels(devOutput: DevOutput, ctx: {
|
|
235
80
|
tenant: string;
|
|
236
81
|
env: string;
|
|
@@ -240,38 +85,16 @@ export declare function startTailscaleTunnels(devOutput: DevOutput, ctx: {
|
|
|
240
85
|
preAuthKey?: string;
|
|
241
86
|
}): Promise<DevOutput>;
|
|
242
87
|
export declare function launchAgentLabel(tenant: string): string;
|
|
243
|
-
/** Render the per-tenant LaunchAgent plist (pure). */
|
|
244
88
|
export declare function renderLaunchAgentPlist(args: {
|
|
245
89
|
tenant: string;
|
|
246
90
|
meshBin: string;
|
|
247
91
|
nodeBin: string;
|
|
248
92
|
logPath: string;
|
|
249
|
-
/** PATH for the agent — must include the dir of `tailscaled` so daemon reheal
|
|
250
|
-
* works under launchd's minimal PATH (esp. Intel `/usr/local/bin`). */
|
|
251
93
|
pathEnv?: string;
|
|
252
94
|
}): string;
|
|
253
|
-
/** Targets whose local forwarder port isn't currently accepting connections. */
|
|
254
95
|
export declare function forwardersNeedingRebind(targets: TunnelTarget[], listening: Set<number>): TunnelTarget[];
|
|
255
96
|
export declare function launchAgentPath(tenant: string): string;
|
|
256
|
-
/** True when launchctl works for this user (blocked under the seatbelt sandbox → false). */
|
|
257
97
|
export declare function launchdAvailable(): boolean;
|
|
258
|
-
/**
|
|
259
|
-
* Write + (re)load the per-tenant LaunchAgent. Returns true iff it fully
|
|
260
|
-
* succeeded — any failure (plist write blocked by the sandbox, `launchctl`
|
|
261
|
-
* bootstrap denied, …) returns false so the caller falls back to a detached
|
|
262
|
-
* runner. Never throws.
|
|
263
|
-
*/
|
|
264
98
|
export declare function installLaunchAgent(tenant: string, meshBin: string): boolean;
|
|
265
|
-
/** Unload + remove the per-tenant LaunchAgent (best-effort). */
|
|
266
99
|
export declare function uninstallLaunchAgent(tenant: string): void;
|
|
267
|
-
/**
|
|
268
|
-
* Long-lived runner for a tenant's tunnels — used both under launchd and as the
|
|
269
|
-
* detached fallback. Runs a forwarder per target and, every ~5s, self-heals:
|
|
270
|
-
* respawns the daemon if its process died, and rebinds any forwarder whose port
|
|
271
|
-
* stopped listening. As the process that actually binds the ports, it is the
|
|
272
|
-
* sole author of the ownership manifest + control endpoint (MESH-2407) that
|
|
273
|
-
* callers verify against. Needs no AWS (targets come from tunnel-state). Never
|
|
274
|
-
* returns.
|
|
275
|
-
*/
|
|
276
100
|
export declare function runTunnels(tenant: string): Promise<never>;
|
|
277
|
-
//# sourceMappingURL=tailscale.d.ts.map
|