@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,42 +1,17 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* mesh vpn — Headscale VPN management commands
|
|
3
|
-
*
|
|
4
|
-
* Commands:
|
|
5
|
-
* mesh vpn connect <context> Connect to VPN via Tailscale + OIDC
|
|
6
|
-
* mesh vpn disconnect Disconnect from VPN
|
|
7
|
-
* mesh vpn status Show VPN control plane status
|
|
8
|
-
* mesh vpn api-key Create a Headscale API key
|
|
9
|
-
* mesh vpn pre-auth-key Create a pre-authentication key for a user
|
|
10
|
-
* mesh vpn users List registered VPN users
|
|
11
|
-
*
|
|
12
|
-
* All commands shell out to kubectl. The user must have kubeconfig
|
|
13
|
-
* configured for the target cluster (e.g., via `aws eks update-kubeconfig`).
|
|
14
|
-
*/
|
|
15
1
|
import { execFileSync } from "child_process";
|
|
16
2
|
import * as net from "node:net";
|
|
17
3
|
import { logInfo, logSuccess, logError, logWarn } from "../../utils/index.js";
|
|
18
4
|
import { getContextConfig } from "../login.js";
|
|
19
5
|
import { registerTunnelSubcommands } from "./tunnel.js";
|
|
20
6
|
import { ensureDaemon, joinHeadscale, daemonState, stopDaemon, tailscaleAvailable, readDaemonMeta, findRunningDaemon, } from "../../utils/tailscale.js";
|
|
21
|
-
// =============================================================================
|
|
22
|
-
// Constants
|
|
23
|
-
// =============================================================================
|
|
24
|
-
/** Default namespace follows the convention: {tenant}-{env}-headscale */
|
|
25
7
|
function defaultNamespace(tenant, env) {
|
|
26
8
|
return `${tenant}-${env}-headscale`;
|
|
27
9
|
}
|
|
28
10
|
const HEADSCALE_POD = "headscale-0";
|
|
29
11
|
const HEADSCALE_CONTAINER = "headscale";
|
|
30
|
-
// =============================================================================
|
|
31
|
-
// Helpers
|
|
32
|
-
// =============================================================================
|
|
33
12
|
function resolveNamespace(options) {
|
|
34
13
|
return options.namespace ?? defaultNamespace(options.tenant, options.env);
|
|
35
14
|
}
|
|
36
|
-
/**
|
|
37
|
-
* Run a headscale CLI command inside the headscale pod.
|
|
38
|
-
* Returns stdout as a string. Throws on non-zero exit.
|
|
39
|
-
*/
|
|
40
15
|
function headscaleExec(namespace, args, opts) {
|
|
41
16
|
const cmd = ["headscale", ...args];
|
|
42
17
|
if (opts?.json) {
|
|
@@ -66,15 +41,9 @@ function headscaleExec(namespace, args, opts) {
|
|
|
66
41
|
throw error;
|
|
67
42
|
}
|
|
68
43
|
}
|
|
69
|
-
/**
|
|
70
|
-
* Derive the likely EKS cluster name from tenant/env convention.
|
|
71
|
-
*/
|
|
72
44
|
function clusterName(tenant, env) {
|
|
73
45
|
return `${tenant}-${env}-eks`;
|
|
74
46
|
}
|
|
75
|
-
/**
|
|
76
|
-
* Check that the headscale pod is running and reachable.
|
|
77
|
-
*/
|
|
78
47
|
function assertPodReady(namespace, options) {
|
|
79
48
|
try {
|
|
80
49
|
const output = execFileSync("kubectl", [
|
|
@@ -102,14 +71,10 @@ function assertPodReady(namespace, options) {
|
|
|
102
71
|
process.exit(1);
|
|
103
72
|
}
|
|
104
73
|
}
|
|
105
|
-
// =============================================================================
|
|
106
|
-
// Commands
|
|
107
|
-
// =============================================================================
|
|
108
74
|
async function vpnStatus(options) {
|
|
109
75
|
const ns = resolveNamespace(options);
|
|
110
76
|
logInfo(`Checking Headscale in namespace ${ns}...`);
|
|
111
77
|
assertPodReady(ns, options);
|
|
112
|
-
// Get pod details
|
|
113
78
|
const podJson = execFileSync("kubectl", [
|
|
114
79
|
"get", "pod", HEADSCALE_POD,
|
|
115
80
|
"-n", ns,
|
|
@@ -120,7 +85,6 @@ async function vpnStatus(options) {
|
|
|
120
85
|
const image = container?.image ?? "unknown";
|
|
121
86
|
const ready = container?.ready ?? false;
|
|
122
87
|
const restarts = container?.restartCount ?? 0;
|
|
123
|
-
// Get the HTTPRoute hostname
|
|
124
88
|
let endpoint = "unknown";
|
|
125
89
|
try {
|
|
126
90
|
endpoint = execFileSync("kubectl", [
|
|
@@ -133,9 +97,7 @@ async function vpnStatus(options) {
|
|
|
133
97
|
}
|
|
134
98
|
}
|
|
135
99
|
catch {
|
|
136
|
-
// HTTPRoute may not exist
|
|
137
100
|
}
|
|
138
|
-
// List users
|
|
139
101
|
let userCount = 0;
|
|
140
102
|
try {
|
|
141
103
|
const usersJson = headscaleExec(ns, ["users", "list"], { json: true });
|
|
@@ -143,9 +105,7 @@ async function vpnStatus(options) {
|
|
|
143
105
|
userCount = Array.isArray(users) ? users.length : 0;
|
|
144
106
|
}
|
|
145
107
|
catch {
|
|
146
|
-
// Users may not be queryable yet
|
|
147
108
|
}
|
|
148
|
-
// List nodes
|
|
149
109
|
let nodeCount = 0;
|
|
150
110
|
try {
|
|
151
111
|
const nodesJson = headscaleExec(ns, ["nodes", "list"], { json: true });
|
|
@@ -153,7 +113,6 @@ async function vpnStatus(options) {
|
|
|
153
113
|
nodeCount = Array.isArray(nodes) ? nodes.length : 0;
|
|
154
114
|
}
|
|
155
115
|
catch {
|
|
156
|
-
// Nodes may not be queryable
|
|
157
116
|
}
|
|
158
117
|
console.log("");
|
|
159
118
|
console.log(` Endpoint: ${endpoint}`);
|
|
@@ -195,14 +154,12 @@ async function createPreAuthKey(options) {
|
|
|
195
154
|
const { user, expiration, reusable, ephemeral } = options;
|
|
196
155
|
logInfo(`Creating pre-auth key for user "${user}" in namespace ${ns}...`);
|
|
197
156
|
assertPodReady(ns, options);
|
|
198
|
-
// Ensure the user exists
|
|
199
157
|
try {
|
|
200
158
|
headscaleExec(ns, ["users", "create", user]);
|
|
201
159
|
logInfo(`Created user "${user}"`);
|
|
202
160
|
}
|
|
203
161
|
catch (error) {
|
|
204
162
|
const message = error instanceof Error ? error.message : String(error);
|
|
205
|
-
// "already exists" is fine
|
|
206
163
|
if (!message.includes("already exists")) {
|
|
207
164
|
logError(`Failed to create user: ${message}`);
|
|
208
165
|
process.exit(1);
|
|
@@ -251,17 +208,6 @@ async function listUsers(options) {
|
|
|
251
208
|
process.exit(1);
|
|
252
209
|
}
|
|
253
210
|
}
|
|
254
|
-
// =============================================================================
|
|
255
|
-
// VPN Connect / Disconnect
|
|
256
|
-
// =============================================================================
|
|
257
|
-
/**
|
|
258
|
-
* Derive the VPN (Headscale) endpoint from a mesh login context.
|
|
259
|
-
*
|
|
260
|
-
* The login config stores an issuer URL like:
|
|
261
|
-
* https://identity.dev.mesh-platform.trabian.com
|
|
262
|
-
* The VPN endpoint follows the same domain with "vpn" as the subdomain:
|
|
263
|
-
* https://vpn.dev.mesh-platform.trabian.com
|
|
264
|
-
*/
|
|
265
211
|
function vpnEndpointFromContext(context) {
|
|
266
212
|
const config = getContextConfig(context);
|
|
267
213
|
if (!config) {
|
|
@@ -269,7 +215,6 @@ function vpnEndpointFromContext(context) {
|
|
|
269
215
|
`Run: mesh login ${context} (or add the context to ~/.config/mesh/config.json)`);
|
|
270
216
|
}
|
|
271
217
|
const issuerUrl = new URL(config.issuer);
|
|
272
|
-
// Replace the first subdomain ("identity") with "vpn"
|
|
273
218
|
const hostParts = issuerUrl.hostname.split(".");
|
|
274
219
|
if (hostParts.length < 3) {
|
|
275
220
|
throw new Error(`Cannot derive VPN endpoint from issuer "${config.issuer}". ` +
|
|
@@ -278,12 +223,10 @@ function vpnEndpointFromContext(context) {
|
|
|
278
223
|
hostParts[0] = "vpn";
|
|
279
224
|
return `https://${hostParts.join(".")}`;
|
|
280
225
|
}
|
|
281
|
-
/** Split a platform context ("mesh.dev") into its tenant + env. Pure. */
|
|
282
226
|
export function parseContextTenantEnv(context) {
|
|
283
227
|
const [tenant, env] = context.split(".");
|
|
284
228
|
return { tenant: tenant || "mesh", env: env || "dev" };
|
|
285
229
|
}
|
|
286
|
-
/** Ephemeral free TCP port on loopback for the userspace daemon's SOCKS proxy. */
|
|
287
230
|
function findFreePort() {
|
|
288
231
|
return new Promise((resolve, reject) => {
|
|
289
232
|
const srv = net.createServer();
|
|
@@ -295,10 +238,6 @@ function findFreePort() {
|
|
|
295
238
|
});
|
|
296
239
|
});
|
|
297
240
|
}
|
|
298
|
-
/**
|
|
299
|
-
* Check whether the `tailscale` CLI is installed and return its path,
|
|
300
|
-
* or null if not found.
|
|
301
|
-
*/
|
|
302
241
|
function findTailscale() {
|
|
303
242
|
try {
|
|
304
243
|
return execFileSync("which", ["tailscale"], {
|
|
@@ -310,7 +249,6 @@ function findTailscale() {
|
|
|
310
249
|
return null;
|
|
311
250
|
}
|
|
312
251
|
}
|
|
313
|
-
/** Return Tailscale's full status, or null if tailscale is not running. */
|
|
314
252
|
function tailscaleStatus() {
|
|
315
253
|
try {
|
|
316
254
|
const json = execFileSync("tailscale", ["status", "--json"], {
|
|
@@ -323,14 +261,9 @@ function tailscaleStatus() {
|
|
|
323
261
|
return null;
|
|
324
262
|
}
|
|
325
263
|
}
|
|
326
|
-
/** Return Tailscale's BackendState, or null if tailscale is not running. */
|
|
327
264
|
export function tailscaleBackendState() {
|
|
328
265
|
return tailscaleStatus()?.BackendState ?? null;
|
|
329
266
|
}
|
|
330
|
-
/**
|
|
331
|
-
* Normalize a control server URL for comparison.
|
|
332
|
-
* Trims trailing slashes and lowercases the origin.
|
|
333
|
-
*/
|
|
334
267
|
function normalizeControlUrl(url) {
|
|
335
268
|
try {
|
|
336
269
|
const u = new URL(url);
|
|
@@ -343,22 +276,11 @@ function normalizeControlUrl(url) {
|
|
|
343
276
|
async function vpnConnect(context, opts = {}) {
|
|
344
277
|
const endpoint = vpnEndpointFromContext(context);
|
|
345
278
|
if (opts.system) {
|
|
346
|
-
// Whole-machine VPN via the GUI Tailscale.app daemon. Opt-in only: it needs
|
|
347
|
-
// the GUI app installed/running and CANNOT run headless or under the safehouse
|
|
348
|
-
// sandbox (dyld can't load the app bundle's Sparkle.framework → abort trap).
|
|
349
279
|
await vpnConnectSystem(endpoint);
|
|
350
280
|
return;
|
|
351
281
|
}
|
|
352
282
|
await vpnConnectUserspace(context, endpoint);
|
|
353
283
|
}
|
|
354
|
-
/**
|
|
355
|
-
* Default path: bring up the per-tenant userspace `tailscaled` (brew formula, NOT
|
|
356
|
-
* the GUI app) and register this machine with the platform Headscale. This is the
|
|
357
|
-
* same daemon `mesh dev --transport tailscale` / `mesh vpn tunnel` already use, so
|
|
358
|
-
* it runs headless and under the sandbox. It exposes a local SOCKS5 proxy — the
|
|
359
|
-
* userspace analog of system-wide routing — instead of a system TUN; for
|
|
360
|
-
* auto-forwarded VPC services (Temporal, RDS, …) use `mesh vpn tunnel` / `mesh dev`.
|
|
361
|
-
*/
|
|
362
284
|
async function vpnConnectUserspace(context, loginServer) {
|
|
363
285
|
if (!tailscaleAvailable()) {
|
|
364
286
|
logError("Standalone tailscale/tailscaled not found.");
|
|
@@ -369,8 +291,6 @@ async function vpnConnectUserspace(context, loginServer) {
|
|
|
369
291
|
const { tenant } = parseContextTenantEnv(context);
|
|
370
292
|
const region = process.env.AWS_REGION ?? process.env.AWS_DEFAULT_REGION ?? "us-east-2";
|
|
371
293
|
if (daemonState(tenant).backendState === "Running") {
|
|
372
|
-
// Prefer daemon.json; recover the real bound port from argv if meta is missing
|
|
373
|
-
// (older build) so a "connected" session always shows how to reach it.
|
|
374
294
|
const port = readDaemonMeta(tenant)?.socksPort ?? findRunningDaemon(tenant)?.socksPort;
|
|
375
295
|
logSuccess(`Already connected to the platform VPN for '${tenant}' (userspace).`);
|
|
376
296
|
if (port)
|
|
@@ -380,23 +300,17 @@ async function vpnConnectUserspace(context, loginServer) {
|
|
|
380
300
|
logInfo(`Connecting to the platform VPN for '${tenant}' (userspace tailscaled)…`);
|
|
381
301
|
const socksPort = readDaemonMeta(tenant)?.socksPort ?? (await findFreePort());
|
|
382
302
|
const realPort = await ensureDaemon(tenant, { region, socksPort });
|
|
383
|
-
// Interactive join — joinHeadscale relays the one-time registration URL for
|
|
384
|
-
// headless/SSH machines (no local browser to pop) and polls up to ~5 min.
|
|
385
303
|
await joinHeadscale(tenant, loginServer);
|
|
386
304
|
logSuccess(`VPN connected (userspace) for '${tenant}'.`);
|
|
387
305
|
logInfo(` SOCKS5 proxy: 127.0.0.1:${realPort} — route a tool via ALL_PROXY=socks5://127.0.0.1:${realPort}`);
|
|
388
306
|
logInfo(" For auto-forwarded VPC services (Temporal, RDS, …): mesh vpn tunnel up (or mesh dev)");
|
|
389
307
|
}
|
|
390
|
-
/** Opt-in whole-machine VPN via the GUI Tailscale.app daemon (`mesh vpn connect --system`). */
|
|
391
308
|
async function vpnConnectSystem(endpoint) {
|
|
392
309
|
if (!findTailscale()) {
|
|
393
310
|
logError("Tailscale CLI not found.");
|
|
394
311
|
logInfo("Install it: brew install tailscale (or see https://tailscale.com/download)");
|
|
395
312
|
process.exit(1);
|
|
396
313
|
}
|
|
397
|
-
// If already connected to *this* endpoint, short-circuit. But if connected
|
|
398
|
-
// to a different control server, fall through and reconnect — otherwise the
|
|
399
|
-
// user would silently stay on the wrong tailnet.
|
|
400
314
|
const status = tailscaleStatus();
|
|
401
315
|
if (status?.BackendState === "Running") {
|
|
402
316
|
const current = status.ControlURL ? normalizeControlUrl(status.ControlURL) : null;
|
|
@@ -413,15 +327,6 @@ async function vpnConnectSystem(endpoint) {
|
|
|
413
327
|
logInfo(`Connecting to VPN at ${endpoint}...`);
|
|
414
328
|
logInfo("A browser window will open for Zitadel authentication.");
|
|
415
329
|
console.log("");
|
|
416
|
-
// tailscale up is interactive (opens browser), so we inherit stdio.
|
|
417
|
-
// On macOS, Tailscale.app owns the daemon — `tailscale up` talks to it.
|
|
418
|
-
// On Linux, tailscaled runs as root and `tailscale up` may need sudo.
|
|
419
|
-
//
|
|
420
|
-
// --reset: wipe prior prefs so this command is idempotent. Without it,
|
|
421
|
-
// tailscale refuses to apply prefs if a previous session set non-default
|
|
422
|
-
// flags that aren't re-specified here.
|
|
423
|
-
// --accept-routes: accept subnet routes advertised by the Headscale
|
|
424
|
-
// SubnetRouter so clients can reach in-VPC services (EKS, RDS, internal LBs).
|
|
425
330
|
const upArgs = [
|
|
426
331
|
"up",
|
|
427
332
|
"--reset",
|
|
@@ -447,7 +352,6 @@ async function vpnConnectSystem(endpoint) {
|
|
|
447
352
|
}
|
|
448
353
|
async function vpnDisconnect(opts) {
|
|
449
354
|
if (opts.system) {
|
|
450
|
-
// Whole-machine GUI Tailscale down (opt-in, mirrors `connect --system`).
|
|
451
355
|
if (!findTailscale()) {
|
|
452
356
|
logError("Tailscale CLI not found.");
|
|
453
357
|
process.exit(1);
|
|
@@ -468,8 +372,6 @@ async function vpnDisconnect(opts) {
|
|
|
468
372
|
}
|
|
469
373
|
return;
|
|
470
374
|
}
|
|
471
|
-
// Default: stop the tenant's userspace daemon (leaves the Headscale node
|
|
472
|
-
// identity in the statedir so a later `connect` rejoins without re-login).
|
|
473
375
|
const { tenant } = opts;
|
|
474
376
|
if (daemonState(tenant).backendState === "Down") {
|
|
475
377
|
logInfo(`No userspace VPN daemon running for '${tenant}'.`);
|
|
@@ -479,9 +381,6 @@ async function vpnDisconnect(opts) {
|
|
|
479
381
|
stopDaemon(tenant);
|
|
480
382
|
logSuccess(`VPN disconnected for '${tenant}'.`);
|
|
481
383
|
}
|
|
482
|
-
// =============================================================================
|
|
483
|
-
// Registration
|
|
484
|
-
// =============================================================================
|
|
485
384
|
export function registerVpnCommands(program) {
|
|
486
385
|
const vpn = program
|
|
487
386
|
.command("vpn")
|
|
@@ -540,4 +439,3 @@ export function registerVpnCommands(program) {
|
|
|
540
439
|
});
|
|
541
440
|
registerTunnelSubcommands(vpn);
|
|
542
441
|
}
|
|
543
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,11 +1,2 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `mesh vpn tunnel` — userspace-Tailscale tunnels to a tenant's VPC services.
|
|
3
|
-
*
|
|
4
|
-
* Stands up the tenant's `localhost:PORT` set (drop-in for the SSM tunnels)
|
|
5
|
-
* backed by a per-tenant userspace `tailscaled` + SOCKS5 forwarders. Detached
|
|
6
|
-
* and managed: `up` starts everything and returns; `down`/`status` manage it.
|
|
7
|
-
* (MESH-2040 / Slice 1 of MESH-2014; graduates the MESH-2036 spike.)
|
|
8
|
-
*/
|
|
9
1
|
import type { Command } from "commander";
|
|
10
2
|
export declare function registerTunnelSubcommands(vpn: Command): void;
|
|
11
|
-
//# sourceMappingURL=tunnel.d.ts.map
|
|
@@ -1,21 +1,7 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `mesh vpn tunnel` — userspace-Tailscale tunnels to a tenant's VPC services.
|
|
3
|
-
*
|
|
4
|
-
* Stands up the tenant's `localhost:PORT` set (drop-in for the SSM tunnels)
|
|
5
|
-
* backed by a per-tenant userspace `tailscaled` + SOCKS5 forwarders. Detached
|
|
6
|
-
* and managed: `up` starts everything and returns; `down`/`status` manage it.
|
|
7
|
-
* (MESH-2040 / Slice 1 of MESH-2014; graduates the MESH-2036 spike.)
|
|
8
|
-
*/
|
|
9
1
|
import * as net from "node:net";
|
|
10
2
|
import { logInfo, logError, logSuccess } from "../../utils/log.js";
|
|
11
3
|
import { getContextConfig } from "../login.js";
|
|
12
4
|
import { ensureTailscaleTunnels, stopDaemon, logout, daemonState, readTunnelState, clearTunnelState, readDaemonMeta, runTunnels, stopTunnelRunners, verifyTunnelOwnership, } from "../../utils/tailscale.js";
|
|
13
|
-
/**
|
|
14
|
-
* Derive the Headscale login-server URL from the login context's issuer
|
|
15
|
-
* (`identity.<env>.<domain>` → `vpn.<env>.<domain>`). Mirrors
|
|
16
|
-
* `vpnEndpointFromContext` in index.ts (kept local to avoid a circular import;
|
|
17
|
-
* Slice 2 can unify).
|
|
18
|
-
*/
|
|
19
5
|
function deriveLoginServer(context) {
|
|
20
6
|
const cfg = getContextConfig(context);
|
|
21
7
|
if (!cfg?.issuer) {
|
|
@@ -54,7 +40,6 @@ function canConnect(port) {
|
|
|
54
40
|
s.connect(port, "127.0.0.1");
|
|
55
41
|
});
|
|
56
42
|
}
|
|
57
|
-
// ── up ──────────────────────────────────────────────────────────────────────
|
|
58
43
|
async function tunnelUp(vpn, cmdOpts) {
|
|
59
44
|
const { tenant, env } = vpn;
|
|
60
45
|
const context = cmdOpts.context ?? `${tenant}.${env}`;
|
|
@@ -62,9 +47,6 @@ async function tunnelUp(vpn, cmdOpts) {
|
|
|
62
47
|
const loginServer = deriveLoginServer(context);
|
|
63
48
|
const prior = readTunnelState(tenant);
|
|
64
49
|
const daemonUp = daemonState(tenant).backendState !== "Down";
|
|
65
|
-
// When the daemon is already up, reuse the SOCKS port IT is listening on
|
|
66
|
-
// (from daemon.json, which `down` doesn't clear) — not `prior` (cleared by
|
|
67
|
-
// `down`) and never a fresh port the daemon isn't bound to.
|
|
68
50
|
const socksPort = daemonUp
|
|
69
51
|
? (readDaemonMeta(tenant)?.socksPort ?? prior?.socksPort ?? (await findFreePort()))
|
|
70
52
|
: await findFreePort();
|
|
@@ -75,28 +57,18 @@ async function tunnelUp(vpn, cmdOpts) {
|
|
|
75
57
|
logInfo(` ${t.name.padEnd(14)} 127.0.0.1:${t.localPort} → ${t.targetHost}:${t.remotePort}`);
|
|
76
58
|
}
|
|
77
59
|
}
|
|
78
|
-
// The __run / __supervise runner lives in utils/tailscale.ts (runTunnels) —
|
|
79
|
-
// forwarders + a continuous self-heal loop, used under launchd or detached.
|
|
80
|
-
// ── down ────────────────────────────────────────────────────────────────────
|
|
81
60
|
function tunnelDown(vpn, cmdOpts) {
|
|
82
61
|
const { tenant } = vpn;
|
|
83
62
|
const st = readTunnelState(tenant);
|
|
84
|
-
// Nothing to tear down for the forwarders — but still honor an explicit
|
|
85
|
-
// --stop/--logout so a leaked daemon (state file already gone) can be killed.
|
|
86
63
|
if (!st && !cmdOpts.stop && !cmdOpts.logout) {
|
|
87
64
|
logInfo(`No tunnels running for tenant '${tenant}'.`);
|
|
88
65
|
return;
|
|
89
66
|
}
|
|
90
|
-
// One teardown path for every runner shape (state pid group, launchd agent,
|
|
91
|
-
// manifest process group, argv-discovered strays) — no kill path may leave a
|
|
92
|
-
// grandchild with ports still bound (MESH-2407).
|
|
93
67
|
stopTunnelRunners(tenant, st);
|
|
94
68
|
if (cmdOpts.logout) {
|
|
95
69
|
logout(tenant);
|
|
96
70
|
logInfo("Logged the VPN daemon out of Headscale.");
|
|
97
71
|
}
|
|
98
|
-
// By default the daemon persists (join-once / reuse). --stop or --logout
|
|
99
|
-
// (after which the daemon is useless) tear it down too.
|
|
100
72
|
if (cmdOpts.stop || cmdOpts.logout) {
|
|
101
73
|
stopDaemon(tenant);
|
|
102
74
|
logInfo("Stopped the userspace VPN daemon.");
|
|
@@ -104,13 +76,10 @@ function tunnelDown(vpn, cmdOpts) {
|
|
|
104
76
|
clearTunnelState(tenant);
|
|
105
77
|
logSuccess(`VPN tunnels down for '${tenant}'.`);
|
|
106
78
|
}
|
|
107
|
-
// ── status ────────────────────────────────────────────────────────────────────
|
|
108
79
|
async function tunnelStatus(vpn, cmdOpts) {
|
|
109
80
|
const { tenant } = vpn;
|
|
110
81
|
const st = readTunnelState(tenant);
|
|
111
82
|
const ds = daemonState(tenant);
|
|
112
|
-
// Ownership handshake against the runner's manifest — status must distinguish
|
|
113
|
-
// "our runner owns the ports" from "something answers the port" (MESH-2407).
|
|
114
83
|
const owned = st
|
|
115
84
|
? await verifyTunnelOwnership(tenant, {
|
|
116
85
|
socksPort: st.socksPort,
|
|
@@ -140,14 +109,10 @@ async function tunnelStatus(vpn, cmdOpts) {
|
|
|
140
109
|
: `Runner: NOT OWNED (${owned?.reason}) — ports below may be foreign listeners`);
|
|
141
110
|
const listening = owned?.ok ? new Set(owned.resp?.listening ?? []) : null;
|
|
142
111
|
for (const t of st.tunnels) {
|
|
143
|
-
// When ownership holds, report from the runner's in-process listening set
|
|
144
|
-
// (no data-plane dial); otherwise fall back to a dial, flagged above.
|
|
145
112
|
const up = listening ? listening.has(t.localPort) : await canConnect(t.localPort);
|
|
146
113
|
logInfo(` ${up ? "✓" : "✗"} ${t.name.padEnd(14)} 127.0.0.1:${t.localPort} → ${t.targetHost}:${t.remotePort}`);
|
|
147
114
|
}
|
|
148
115
|
}
|
|
149
|
-
// ── registration ──────────────────────────────────────────────────────────────
|
|
150
|
-
/** Run an action, printing a clean error (not a stack trace) + exit 1 on failure. */
|
|
151
116
|
async function guard(fn) {
|
|
152
117
|
try {
|
|
153
118
|
await fn();
|
|
@@ -180,9 +145,7 @@ export function registerTunnelSubcommands(vpn) {
|
|
|
180
145
|
tunnel
|
|
181
146
|
.command("__run <tenant>", { hidden: true })
|
|
182
147
|
.action((tenant) => runTunnels(tenant));
|
|
183
|
-
// Back-compat alias for any launchd/detached runner referencing the old name.
|
|
184
148
|
tunnel
|
|
185
149
|
.command("__supervise <tenant>", { hidden: true })
|
|
186
150
|
.action((tenant) => runTunnels(tenant));
|
|
187
151
|
}
|
|
188
|
-
//# sourceMappingURL=tunnel.js.map
|
|
@@ -1,24 +1,2 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* mesh workflow — workflow tooling commands
|
|
3
|
-
*
|
|
4
|
-
* Commands:
|
|
5
|
-
* mesh workflow extract-ir <path> Extract WorkflowIR from Temporal workflow source
|
|
6
|
-
* mesh workflow inventory <path> Extract the as-built command/query/activity inventory
|
|
7
|
-
* mesh workflow lint-process <path> Lint a process artifact's bindings against the code inventory
|
|
8
|
-
*
|
|
9
|
-
* Examples:
|
|
10
|
-
* # Extract and print to stdout
|
|
11
|
-
* mesh workflow extract-ir apps/ops/worker/src/workflows/
|
|
12
|
-
*
|
|
13
|
-
* # Extract and upload to S3
|
|
14
|
-
* mesh workflow extract-ir apps/ops/worker/src/workflows/ --app ops --upload mesh-trabian-dev-artifacts
|
|
15
|
-
*
|
|
16
|
-
* # Print the as-built inventory (lint's code-side input)
|
|
17
|
-
* mesh workflow inventory apps/ops/worker/src/workflows/workflows.ts
|
|
18
|
-
*
|
|
19
|
-
* # Lint a process artifact (conformance) — sibling process/*.process.json auto-discovered
|
|
20
|
-
* mesh workflow lint-process apps/ops/worker/src/workflows.ts --predicates engagementComplete,accountNumbersComplete
|
|
21
|
-
*/
|
|
22
1
|
import { Command } from "commander";
|
|
23
2
|
export declare function registerWorkflowCommands(program: Command): void;
|
|
24
|
-
//# sourceMappingURL=workflow.d.ts.map
|
|
@@ -1,37 +1,8 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* mesh workflow — workflow tooling commands
|
|
3
|
-
*
|
|
4
|
-
* Commands:
|
|
5
|
-
* mesh workflow extract-ir <path> Extract WorkflowIR from Temporal workflow source
|
|
6
|
-
* mesh workflow inventory <path> Extract the as-built command/query/activity inventory
|
|
7
|
-
* mesh workflow lint-process <path> Lint a process artifact's bindings against the code inventory
|
|
8
|
-
*
|
|
9
|
-
* Examples:
|
|
10
|
-
* # Extract and print to stdout
|
|
11
|
-
* mesh workflow extract-ir apps/ops/worker/src/workflows/
|
|
12
|
-
*
|
|
13
|
-
* # Extract and upload to S3
|
|
14
|
-
* mesh workflow extract-ir apps/ops/worker/src/workflows/ --app ops --upload mesh-trabian-dev-artifacts
|
|
15
|
-
*
|
|
16
|
-
* # Print the as-built inventory (lint's code-side input)
|
|
17
|
-
* mesh workflow inventory apps/ops/worker/src/workflows/workflows.ts
|
|
18
|
-
*
|
|
19
|
-
* # Lint a process artifact (conformance) — sibling process/*.process.json auto-discovered
|
|
20
|
-
* mesh workflow lint-process apps/ops/worker/src/workflows.ts --predicates engagementComplete,accountNumbersComplete
|
|
21
|
-
*/
|
|
22
1
|
import * as fs from "fs";
|
|
23
2
|
import * as path from "path";
|
|
24
3
|
import { createRequire } from "module";
|
|
25
4
|
import { execFileSync } from "child_process";
|
|
26
5
|
import { logError, logInfo, logSuccess, logWarn } from "../utils/log.js";
|
|
27
|
-
/**
|
|
28
|
-
* Shared subprocess-script helpers: discover auxiliary source files (shared
|
|
29
|
-
* helpers/child workflows) and activity definition files referenced by a
|
|
30
|
-
* workflow file's imports, so the extractor can resolve calls/signatures
|
|
31
|
-
* across files. Emitted verbatim into both the extract-ir and inventory
|
|
32
|
-
* tsx scripts below (they run as plain functions inside the subprocess, not
|
|
33
|
-
* in this process, so they can't be imported/shared as normal TS).
|
|
34
|
-
*/
|
|
35
6
|
const DISCOVERY_HELPERS_SRC = `
|
|
36
7
|
function discoverAux(filePath, source) {
|
|
37
8
|
const dir = dirname(filePath);
|
|
@@ -122,10 +93,6 @@ function discoverProcessArtifact(filePath, source) {
|
|
|
122
93
|
return undefined;
|
|
123
94
|
}
|
|
124
95
|
`;
|
|
125
|
-
/**
|
|
126
|
-
* Resolve the path to @mesh-tech/workflow-viz/ast-extractor source file.
|
|
127
|
-
* Uses createRequire from the CLI's own location so workspace links resolve.
|
|
128
|
-
*/
|
|
129
96
|
function resolveExtractorPath() {
|
|
130
97
|
try {
|
|
131
98
|
const require = createRequire(import.meta.url);
|
|
@@ -136,19 +103,6 @@ function resolveExtractorPath() {
|
|
|
136
103
|
return null;
|
|
137
104
|
}
|
|
138
105
|
}
|
|
139
|
-
/**
|
|
140
|
-
* Run the extraction in a tsx subprocess. The extractor depends on ts-morph
|
|
141
|
-
* and workflow-viz exports TypeScript source (no dist build), so we need tsx
|
|
142
|
-
* rather than plain Node.
|
|
143
|
-
*
|
|
144
|
-
* `explicitProcessPath`, when given, is read here (parent process) and baked
|
|
145
|
-
* into the script verbatim, applied to EVERY discovered workflow file
|
|
146
|
-
* (extractWorkflowIR's own workflowType check drops it wherever it doesn't
|
|
147
|
-
* match — P6). Absent that, each file gets a sibling `process/*.process.json`
|
|
148
|
-
* lookup (see `discoverProcessArtifact` in DISCOVERY_HELPERS_SRC).
|
|
149
|
-
*
|
|
150
|
-
* Returns parsed ExtractedWorkflow[] or null on failure.
|
|
151
|
-
*/
|
|
152
106
|
function runExtraction(targetPath, extractorPath, explicitProcessPath) {
|
|
153
107
|
let explicitProcessArtifact;
|
|
154
108
|
if (explicitProcessPath) {
|
|
@@ -160,8 +114,6 @@ function runExtraction(targetPath, extractorPath, explicitProcessPath) {
|
|
|
160
114
|
return null;
|
|
161
115
|
}
|
|
162
116
|
}
|
|
163
|
-
// Build an inline script that does the extraction and writes JSON to stdout.
|
|
164
|
-
// Stderr is used for progress messages.
|
|
165
117
|
const script = `
|
|
166
118
|
import { extractWorkflowIR } from "${extractorPath.replace(/\\/g, "/")}";
|
|
167
119
|
import { readFileSync, readdirSync, statSync, existsSync } from "node:fs";
|
|
@@ -207,14 +159,6 @@ process.stdout.write(JSON.stringify(results));
|
|
|
207
159
|
return null;
|
|
208
160
|
}
|
|
209
161
|
}
|
|
210
|
-
/**
|
|
211
|
-
* Run inventory extraction in a tsx subprocess — same aux-discovery pattern
|
|
212
|
-
* as {@link runExtraction}, but calls `extractInventory` instead of
|
|
213
|
-
* `extractWorkflowIR` and returns the as-built {@link Inventory} per
|
|
214
|
-
* discovered workflow file.
|
|
215
|
-
*
|
|
216
|
-
* Returns parsed Inventory[] or null on failure.
|
|
217
|
-
*/
|
|
218
162
|
function runInventoryExtraction(targetPath, extractorPath) {
|
|
219
163
|
const script = `
|
|
220
164
|
import { extractInventory } from "${extractorPath.replace(/\\/g, "/")}";
|
|
@@ -256,20 +200,6 @@ process.stdout.write(JSON.stringify(results));
|
|
|
256
200
|
return null;
|
|
257
201
|
}
|
|
258
202
|
}
|
|
259
|
-
/**
|
|
260
|
-
* Run inventory + process-artifact discovery in a tsx subprocess, for
|
|
261
|
-
* `lint-process`. Same aux/activity discovery as {@link runInventoryExtraction};
|
|
262
|
-
* additionally resolves each file's process artifact the same way
|
|
263
|
-
* {@link runExtraction} does — `explicitProcessPath` (baked in, applied to
|
|
264
|
-
* every discovered file) if given, else the sibling `process/*.process.json`
|
|
265
|
-
* lookup (`discoverProcessArtifact` in DISCOVERY_HELPERS_SRC).
|
|
266
|
-
*
|
|
267
|
-
* Parsing/linting the artifact happens back in the parent process (not
|
|
268
|
-
* here) since `parseProcessArtifact`/`lintProcess` are plain TS this file
|
|
269
|
-
* can import directly — no need to duplicate them into the subprocess script.
|
|
270
|
-
*
|
|
271
|
-
* Returns parsed LintExtractionResult[] or null on failure.
|
|
272
|
-
*/
|
|
273
203
|
function runLintExtraction(targetPath, extractorPath, explicitProcessPath) {
|
|
274
204
|
let explicitProcessArtifact;
|
|
275
205
|
if (explicitProcessPath) {
|
|
@@ -358,12 +288,6 @@ async function uploadToS3(bucket, appName, workflows) {
|
|
|
358
288
|
ContentType: "application/json",
|
|
359
289
|
}));
|
|
360
290
|
}
|
|
361
|
-
/**
|
|
362
|
-
* Split a `--predicates` / `--selectors` comma-list into names. `undefined`
|
|
363
|
-
* (the flag absent) is load-bearing and distinct from an empty list: it means
|
|
364
|
-
* "the CLI cannot check this", which suppresses the corresponding findings
|
|
365
|
-
* rather than failing every reference.
|
|
366
|
-
*/
|
|
367
291
|
function parseNameList(value) {
|
|
368
292
|
return value
|
|
369
293
|
? value
|
|
@@ -519,9 +443,6 @@ export function registerWorkflowCommands(program) {
|
|
|
519
443
|
process.exitCode = 1;
|
|
520
444
|
return;
|
|
521
445
|
}
|
|
522
|
-
// Lazy-load workflow-model's runtime exports (see the import note at top): a
|
|
523
|
-
// static import would take down `mesh` bootstrap in the published CLI. Fail
|
|
524
|
-
// gracefully here, exactly like the extractor resolution above.
|
|
525
446
|
let parseProcessArtifact;
|
|
526
447
|
let lintProcess;
|
|
527
448
|
try {
|
|
@@ -591,4 +512,3 @@ export function registerWorkflowCommands(program) {
|
|
|
591
512
|
}
|
|
592
513
|
});
|
|
593
514
|
}
|
|
594
|
-
//# sourceMappingURL=workflow.js.map
|