@mesh-tech/mesh-cli 0.1.0 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/intent/agents-fence.md +10 -0
- package/assets/intent/intent-claude-gate.mjs +255 -0
- package/assets/log-shipper.mjs +94 -0
- package/bin/mesh.mjs +80 -0
- package/dist/bin/mesh.d.ts +7 -9
- package/dist/bin/mesh.d.ts.map +1 -1
- package/dist/bin/mesh.js +20826 -37
- package/dist/bin/mesh.js.map +7 -1
- package/dist/build-info.json +4 -0
- package/dist/src/commands/agent-api-client.d.ts +79 -0
- package/dist/src/commands/agent-api-client.d.ts.map +1 -0
- package/dist/src/commands/agent-api-client.js +170 -0
- package/dist/src/commands/agent-api-client.js.map +1 -0
- package/dist/src/commands/artifacts.d.ts +13 -0
- package/dist/src/commands/artifacts.d.ts.map +1 -0
- package/dist/src/commands/artifacts.js +140 -0
- package/dist/src/commands/artifacts.js.map +1 -0
- package/dist/src/commands/cluster.d.ts +45 -0
- package/dist/src/commands/cluster.d.ts.map +1 -0
- package/dist/src/commands/cluster.js +259 -0
- package/dist/src/commands/cluster.js.map +1 -0
- package/dist/src/commands/conversations.d.ts +61 -0
- package/dist/src/commands/conversations.d.ts.map +1 -0
- package/dist/src/commands/conversations.js +239 -0
- package/dist/src/commands/conversations.js.map +1 -0
- package/dist/src/commands/create-app.d.ts +26 -3
- package/dist/src/commands/create-app.d.ts.map +1 -1
- package/dist/src/commands/create-app.js +465 -107
- package/dist/src/commands/create-app.js.map +1 -1
- package/dist/src/commands/deploy.d.ts +19 -0
- package/dist/src/commands/deploy.d.ts.map +1 -1
- package/dist/src/commands/deploy.js +83 -142
- package/dist/src/commands/deploy.js.map +1 -1
- package/dist/src/commands/dev-doctor.d.ts +137 -0
- package/dist/src/commands/dev-doctor.d.ts.map +1 -0
- package/dist/src/commands/dev-doctor.js +671 -0
- package/dist/src/commands/dev-doctor.js.map +1 -0
- package/dist/src/commands/dev-launch.d.ts +59 -0
- package/dist/src/commands/dev-launch.d.ts.map +1 -0
- package/dist/src/commands/dev-launch.js +118 -0
- package/dist/src/commands/dev-launch.js.map +1 -0
- package/dist/src/commands/dev-token-server.d.ts +32 -0
- package/dist/src/commands/dev-token-server.d.ts.map +1 -0
- package/dist/src/commands/dev-token-server.js +68 -0
- package/dist/src/commands/dev-token-server.js.map +1 -0
- package/dist/src/commands/dev.d.ts +289 -2
- package/dist/src/commands/dev.d.ts.map +1 -1
- package/dist/src/commands/dev.js +2501 -574
- package/dist/src/commands/dev.js.map +1 -1
- package/dist/src/commands/docs.d.ts +3 -0
- package/dist/src/commands/docs.d.ts.map +1 -0
- package/dist/src/commands/docs.js +262 -0
- package/dist/src/commands/docs.js.map +1 -0
- package/dist/src/commands/hub/index.d.ts +99 -0
- package/dist/src/commands/hub/index.d.ts.map +1 -0
- package/dist/src/commands/hub/index.js +452 -0
- package/dist/src/commands/hub/index.js.map +1 -0
- package/dist/src/commands/init.d.ts +65 -0
- package/dist/src/commands/init.d.ts.map +1 -0
- package/dist/src/commands/init.js +370 -0
- package/dist/src/commands/init.js.map +1 -0
- package/dist/src/commands/install-shim.d.ts +21 -0
- package/dist/src/commands/install-shim.d.ts.map +1 -0
- package/dist/src/commands/install-shim.js +132 -0
- package/dist/src/commands/install-shim.js.map +1 -0
- package/dist/src/commands/local/auth-provision.d.ts +71 -0
- package/dist/src/commands/local/auth-provision.d.ts.map +1 -0
- package/dist/src/commands/local/auth-provision.js +286 -0
- package/dist/src/commands/local/auth-provision.js.map +1 -0
- package/dist/src/commands/local/dev-local.d.ts +97 -0
- package/dist/src/commands/local/dev-local.d.ts.map +1 -0
- package/dist/src/commands/local/dev-local.js +306 -0
- package/dist/src/commands/local/dev-local.js.map +1 -0
- package/dist/src/commands/local/docker-runner.d.ts +37 -0
- package/dist/src/commands/local/docker-runner.d.ts.map +1 -0
- package/dist/src/commands/local/docker-runner.js +104 -0
- package/dist/src/commands/local/docker-runner.js.map +1 -0
- package/dist/src/commands/local/helpers.d.ts +22 -0
- package/dist/src/commands/local/helpers.d.ts.map +1 -0
- package/dist/src/commands/local/helpers.js +46 -0
- package/dist/src/commands/local/helpers.js.map +1 -0
- package/dist/src/commands/local/hub-local.d.ts +51 -0
- package/dist/src/commands/local/hub-local.d.ts.map +1 -0
- package/dist/src/commands/local/hub-local.js +197 -0
- package/dist/src/commands/local/hub-local.js.map +1 -0
- package/dist/src/commands/local/index.d.ts +23 -0
- package/dist/src/commands/local/index.d.ts.map +1 -0
- package/dist/src/commands/local/index.js +386 -0
- package/dist/src/commands/local/index.js.map +1 -0
- package/dist/src/commands/local/mocks.d.ts +361 -0
- package/dist/src/commands/local/mocks.d.ts.map +1 -0
- package/dist/src/commands/local/mocks.js +756 -0
- package/dist/src/commands/local/mocks.js.map +1 -0
- package/dist/src/commands/local/seed-zitadel.d.ts +151 -0
- package/dist/src/commands/local/seed-zitadel.d.ts.map +1 -0
- package/dist/src/commands/local/seed-zitadel.js +408 -0
- package/dist/src/commands/local/seed-zitadel.js.map +1 -0
- package/dist/src/commands/local/seed.d.ts +106 -0
- package/dist/src/commands/local/seed.d.ts.map +1 -0
- package/dist/src/commands/local/seed.js +252 -0
- package/dist/src/commands/local/seed.js.map +1 -0
- package/dist/src/commands/local/stack.d.ts +173 -0
- package/dist/src/commands/local/stack.d.ts.map +1 -0
- package/dist/src/commands/local/stack.js +499 -0
- package/dist/src/commands/local/stack.js.map +1 -0
- package/dist/src/commands/login.d.ts +256 -12
- package/dist/src/commands/login.d.ts.map +1 -1
- package/dist/src/commands/login.js +978 -50
- package/dist/src/commands/login.js.map +1 -1
- package/dist/src/commands/peer-addressing.d.ts +51 -0
- package/dist/src/commands/peer-addressing.d.ts.map +1 -0
- package/dist/src/commands/peer-addressing.js +64 -0
- package/dist/src/commands/peer-addressing.js.map +1 -0
- package/dist/src/commands/port-ownership.d.ts +69 -0
- package/dist/src/commands/port-ownership.d.ts.map +1 -0
- package/dist/src/commands/port-ownership.js +161 -0
- package/dist/src/commands/port-ownership.js.map +1 -0
- package/dist/src/commands/registry-publish.d.ts +3 -0
- package/dist/src/commands/registry-publish.d.ts.map +1 -0
- package/dist/src/commands/registry-publish.js +161 -0
- package/dist/src/commands/registry-publish.js.map +1 -0
- package/dist/src/commands/registry.d.ts +146 -2
- package/dist/src/commands/registry.d.ts.map +1 -1
- package/dist/src/commands/registry.js +541 -85
- package/dist/src/commands/registry.js.map +1 -1
- package/dist/src/commands/secrets/index.d.ts.map +1 -1
- package/dist/src/commands/secrets/index.js +15 -1
- package/dist/src/commands/secrets/index.js.map +1 -1
- package/dist/src/commands/secrets/migrate-config.d.ts +24 -0
- package/dist/src/commands/secrets/migrate-config.d.ts.map +1 -0
- package/dist/src/commands/secrets/migrate-config.js +277 -0
- package/dist/src/commands/secrets/migrate-config.js.map +1 -0
- package/dist/src/commands/secrets/set.d.ts +4 -0
- package/dist/src/commands/secrets/set.d.ts.map +1 -1
- package/dist/src/commands/secrets/set.js +243 -64
- package/dist/src/commands/secrets/set.js.map +1 -1
- package/dist/src/commands/skills.d.ts +34 -0
- package/dist/src/commands/skills.d.ts.map +1 -0
- package/dist/src/commands/skills.js +207 -0
- package/dist/src/commands/skills.js.map +1 -0
- package/dist/src/commands/stack.d.ts.map +1 -1
- package/dist/src/commands/stack.js +361 -23
- package/dist/src/commands/stack.js.map +1 -1
- package/dist/src/commands/temporal.d.ts +15 -0
- package/dist/src/commands/temporal.d.ts.map +1 -0
- package/dist/src/commands/temporal.js +781 -0
- package/dist/src/commands/temporal.js.map +1 -0
- package/dist/src/commands/tenant.d.ts +56 -0
- package/dist/src/commands/tenant.d.ts.map +1 -0
- package/dist/src/commands/tenant.js +233 -0
- package/dist/src/commands/tenant.js.map +1 -0
- package/dist/src/commands/tunnel/index.d.ts +49 -3
- package/dist/src/commands/tunnel/index.d.ts.map +1 -1
- package/dist/src/commands/tunnel/index.js +331 -8
- package/dist/src/commands/tunnel/index.js.map +1 -1
- package/dist/src/commands/vcs/clone.d.ts +3 -0
- package/dist/src/commands/vcs/clone.d.ts.map +1 -0
- package/dist/src/commands/vcs/clone.js +20 -0
- package/dist/src/commands/vcs/clone.js.map +1 -0
- package/dist/src/commands/vcs/common.d.ts +21 -0
- package/dist/src/commands/vcs/common.d.ts.map +1 -0
- package/dist/src/commands/vcs/common.js +62 -0
- package/dist/src/commands/vcs/common.js.map +1 -0
- package/dist/src/commands/vcs/drafts.d.ts +13 -0
- package/dist/src/commands/vcs/drafts.d.ts.map +1 -0
- package/dist/src/commands/vcs/drafts.js +45 -0
- package/dist/src/commands/vcs/drafts.js.map +1 -0
- package/dist/src/commands/vcs/get.d.ts +8 -0
- package/dist/src/commands/vcs/get.d.ts.map +1 -0
- package/dist/src/commands/vcs/get.js +61 -0
- package/dist/src/commands/vcs/get.js.map +1 -0
- package/dist/src/commands/vcs/index.d.ts +3 -0
- package/dist/src/commands/vcs/index.d.ts.map +1 -0
- package/dist/src/commands/vcs/index.js +58 -0
- package/dist/src/commands/vcs/index.js.map +1 -0
- package/dist/src/commands/vcs/propose.d.ts +23 -0
- package/dist/src/commands/vcs/propose.d.ts.map +1 -0
- package/dist/src/commands/vcs/propose.js +94 -0
- package/dist/src/commands/vcs/propose.js.map +1 -0
- package/dist/src/commands/vcs/review.d.ts +15 -0
- package/dist/src/commands/vcs/review.d.ts.map +1 -0
- package/dist/src/commands/vcs/review.js +35 -0
- package/dist/src/commands/vcs/review.js.map +1 -0
- package/dist/src/commands/vcs-enrich.d.ts +15 -0
- package/dist/src/commands/vcs-enrich.d.ts.map +1 -0
- package/dist/src/commands/vcs-enrich.js +28 -0
- package/dist/src/commands/vcs-enrich.js.map +1 -0
- package/dist/src/commands/vpn/index.d.ts +24 -0
- package/dist/src/commands/vpn/index.d.ts.map +1 -0
- package/dist/src/commands/vpn/index.js +543 -0
- package/dist/src/commands/vpn/index.js.map +1 -0
- package/dist/src/commands/vpn/tunnel.d.ts +11 -0
- package/dist/src/commands/vpn/tunnel.d.ts.map +1 -0
- package/dist/src/commands/vpn/tunnel.js +188 -0
- package/dist/src/commands/vpn/tunnel.js.map +1 -0
- package/dist/src/commands/workflow.d.ts +24 -0
- package/dist/src/commands/workflow.d.ts.map +1 -0
- package/dist/src/commands/workflow.js +577 -0
- package/dist/src/commands/workflow.js.map +1 -0
- package/dist/src/docs/assemble.d.ts +217 -0
- package/dist/src/docs/assemble.d.ts.map +1 -0
- package/dist/src/docs/assemble.js +739 -0
- package/dist/src/docs/assemble.js.map +1 -0
- package/dist/src/docs/cli-reference.d.ts +93 -0
- package/dist/src/docs/cli-reference.d.ts.map +1 -0
- package/dist/src/docs/cli-reference.js +256 -0
- package/dist/src/docs/cli-reference.js.map +1 -0
- package/dist/src/docs/discover.d.ts +60 -0
- package/dist/src/docs/discover.d.ts.map +1 -0
- package/dist/src/docs/discover.js +233 -0
- package/dist/src/docs/discover.js.map +1 -0
- package/dist/src/docs/portal.d.ts +79 -0
- package/dist/src/docs/portal.d.ts.map +1 -0
- package/dist/src/docs/portal.js +242 -0
- package/dist/src/docs/portal.js.map +1 -0
- package/dist/src/docs/registry-docs.d.ts +43 -0
- package/dist/src/docs/registry-docs.d.ts.map +1 -0
- package/dist/src/docs/registry-docs.js +138 -0
- package/dist/src/docs/registry-docs.js.map +1 -0
- package/dist/src/docs/schema.d.ts +48 -0
- package/dist/src/docs/schema.d.ts.map +1 -0
- package/dist/src/docs/schema.js +96 -0
- package/dist/src/docs/schema.js.map +1 -0
- package/dist/src/docs/serve.d.ts +27 -0
- package/dist/src/docs/serve.d.ts.map +1 -0
- package/dist/src/docs/serve.js +102 -0
- package/dist/src/docs/serve.js.map +1 -0
- package/dist/src/docs/start.d.ts +80 -0
- package/dist/src/docs/start.d.ts.map +1 -0
- package/dist/src/docs/start.js +313 -0
- package/dist/src/docs/start.js.map +1 -0
- package/dist/src/eval/agent-eval.d.mts +14 -0
- package/dist/src/eval/agent-eval.d.mts.map +1 -0
- package/dist/src/eval/agent-eval.mjs +273 -0
- package/dist/src/eval/agent-eval.mjs.map +1 -0
- package/dist/src/index.js +624 -7
- package/dist/src/index.js.map +7 -1
- package/dist/src/program.d.ts +26 -0
- package/dist/src/program.d.ts.map +1 -0
- package/dist/src/program.js +76 -0
- package/dist/src/program.js.map +1 -0
- package/dist/src/utils/auth-preflight.d.ts +159 -0
- package/dist/src/utils/auth-preflight.d.ts.map +1 -0
- package/dist/src/utils/auth-preflight.js +298 -0
- package/dist/src/utils/auth-preflight.js.map +1 -0
- package/dist/src/utils/aws-auth.d.ts +181 -0
- package/dist/src/utils/aws-auth.d.ts.map +1 -0
- package/dist/src/utils/aws-auth.js +527 -0
- package/dist/src/utils/aws-auth.js.map +1 -0
- package/dist/src/utils/bastion.d.ts +1 -1
- package/dist/src/utils/bastion.d.ts.map +1 -1
- package/dist/src/utils/bastion.js +29 -8
- package/dist/src/utils/bastion.js.map +1 -1
- package/dist/src/utils/build-info.d.ts +33 -0
- package/dist/src/utils/build-info.d.ts.map +1 -0
- package/dist/src/utils/build-info.js +102 -0
- package/dist/src/utils/build-info.js.map +1 -0
- package/dist/src/utils/capture-history.d.ts +62 -0
- package/dist/src/utils/capture-history.d.ts.map +1 -0
- package/dist/src/utils/capture-history.js +94 -0
- package/dist/src/utils/capture-history.js.map +1 -0
- package/dist/src/utils/deploy-preflight.d.ts +52 -0
- package/dist/src/utils/deploy-preflight.d.ts.map +1 -0
- package/dist/src/utils/deploy-preflight.js +183 -0
- package/dist/src/utils/deploy-preflight.js.map +1 -0
- package/dist/src/utils/errors.d.ts +75 -0
- package/dist/src/utils/errors.d.ts.map +1 -0
- package/dist/src/utils/errors.js +106 -0
- package/dist/src/utils/errors.js.map +1 -0
- package/dist/src/utils/first-party-contexts.d.ts +40 -0
- package/dist/src/utils/first-party-contexts.d.ts.map +1 -0
- package/dist/src/utils/first-party-contexts.js +53 -0
- package/dist/src/utils/first-party-contexts.js.map +1 -0
- package/dist/src/utils/index.d.ts +2 -0
- package/dist/src/utils/index.d.ts.map +1 -1
- package/dist/src/utils/index.js +2 -0
- package/dist/src/utils/index.js.map +1 -1
- package/dist/src/utils/kubeconfig.d.ts +62 -0
- package/dist/src/utils/kubeconfig.d.ts.map +1 -0
- package/dist/src/utils/kubeconfig.js +118 -0
- package/dist/src/utils/kubeconfig.js.map +1 -0
- package/dist/src/utils/log.d.ts +27 -1
- package/dist/src/utils/log.d.ts.map +1 -1
- package/dist/src/utils/log.js +59 -5
- package/dist/src/utils/log.js.map +1 -1
- package/dist/src/utils/pid.d.ts +47 -0
- package/dist/src/utils/pid.d.ts.map +1 -0
- package/dist/src/utils/pid.js +83 -0
- package/dist/src/utils/pid.js.map +1 -0
- package/dist/src/utils/pulumi-run.d.ts +23 -0
- package/dist/src/utils/pulumi-run.d.ts.map +1 -0
- package/dist/src/utils/pulumi-run.js +112 -0
- package/dist/src/utils/pulumi-run.js.map +1 -0
- package/dist/src/utils/pulumi.d.ts +15 -0
- package/dist/src/utils/pulumi.d.ts.map +1 -1
- package/dist/src/utils/pulumi.js +35 -0
- package/dist/src/utils/pulumi.js.map +1 -1
- package/dist/src/utils/reachability.d.ts +29 -0
- package/dist/src/utils/reachability.d.ts.map +1 -0
- package/dist/src/utils/reachability.js +81 -0
- package/dist/src/utils/reachability.js.map +1 -0
- package/dist/src/utils/recover-conversation.d.ts +154 -0
- package/dist/src/utils/recover-conversation.d.ts.map +1 -0
- package/dist/src/utils/recover-conversation.js +314 -0
- package/dist/src/utils/recover-conversation.js.map +1 -0
- package/dist/src/utils/registry-broker.d.ts +148 -0
- package/dist/src/utils/registry-broker.d.ts.map +1 -0
- package/dist/src/utils/registry-broker.js +180 -0
- package/dist/src/utils/registry-broker.js.map +1 -0
- package/dist/src/utils/socks-forward.d.ts +40 -0
- package/dist/src/utils/socks-forward.d.ts.map +1 -0
- package/dist/src/utils/socks-forward.js +97 -0
- package/dist/src/utils/socks-forward.js.map +1 -0
- package/dist/src/utils/stack-flag.d.ts +23 -0
- package/dist/src/utils/stack-flag.d.ts.map +1 -0
- package/dist/src/utils/stack-flag.js +41 -0
- package/dist/src/utils/stack-flag.js.map +1 -0
- package/dist/src/utils/tailscale-targets.d.ts +52 -0
- package/dist/src/utils/tailscale-targets.d.ts.map +1 -0
- package/dist/src/utils/tailscale-targets.js +93 -0
- package/dist/src/utils/tailscale-targets.js.map +1 -0
- package/dist/src/utils/tailscale.d.ts +277 -0
- package/dist/src/utils/tailscale.d.ts.map +1 -0
- package/dist/src/utils/tailscale.js +1007 -0
- package/dist/src/utils/tailscale.js.map +1 -0
- package/dist/src/utils/temporal-auth.d.ts +43 -0
- package/dist/src/utils/temporal-auth.d.ts.map +1 -0
- package/dist/src/utils/temporal-auth.js +176 -0
- package/dist/src/utils/temporal-auth.js.map +1 -0
- package/dist/src/utils/temporal-codec.d.ts +101 -0
- package/dist/src/utils/temporal-codec.d.ts.map +1 -0
- package/dist/src/utils/temporal-codec.js +319 -0
- package/dist/src/utils/temporal-codec.js.map +1 -0
- package/dist/src/utils/tunnel-ownership.d.ts +130 -0
- package/dist/src/utils/tunnel-ownership.d.ts.map +1 -0
- package/dist/src/utils/tunnel-ownership.js +274 -0
- package/dist/src/utils/tunnel-ownership.js.map +1 -0
- package/dist/src/utils/vpn-join.d.ts +32 -0
- package/dist/src/utils/vpn-join.d.ts.map +1 -0
- package/dist/src/utils/vpn-join.js +62 -0
- package/dist/src/utils/vpn-join.js.map +1 -0
- package/dist/src/utils/vpn.d.ts +62 -0
- package/dist/src/utils/vpn.d.ts.map +1 -0
- package/dist/src/utils/vpn.js +183 -0
- package/dist/src/utils/vpn.js.map +1 -0
- package/dist/src/utils/workflow-fingerprint.d.ts +49 -0
- package/dist/src/utils/workflow-fingerprint.d.ts.map +1 -0
- package/dist/src/utils/workflow-fingerprint.js +135 -0
- package/dist/src/utils/workflow-fingerprint.js.map +1 -0
- package/dist/src/utils/worktree-identity.d.ts +86 -0
- package/dist/src/utils/worktree-identity.d.ts.map +1 -0
- package/dist/src/utils/worktree-identity.js +164 -0
- package/dist/src/utils/worktree-identity.js.map +1 -0
- package/fragments/agents/AGENTS.md.hbs +92 -0
- package/fragments/agents/CLAUDE.md.hbs +8 -0
- package/fragments/base/Pulumi.dev.yaml.hbs +10 -0
- package/fragments/base/Pulumi.yaml.hbs +9 -0
- package/fragments/base/index.ts.hbs +107 -0
- package/fragments/base/package.json.hbs +22 -0
- package/{templates/api-web-db/api → fragments/base}/tsconfig.json +3 -4
- package/fragments/bucket/api/src/storage.ts.hbs +81 -0
- package/fragments/database/api/src/db.ts.hbs +23 -0
- package/fragments/database/prisma/schema.prisma.hbs +18 -0
- package/{templates/api-web-db → fragments/service}/api/.dockerignore +2 -0
- package/fragments/service/api/package.json.hbs +40 -0
- package/fragments/service/api/src/index.ts.hbs +58 -0
- package/{templates/api-web-db → fragments/service/api}/tsconfig.json +5 -3
- package/fragments/temporal/worker/.dockerignore +4 -0
- package/fragments/temporal/worker/Dockerfile +15 -0
- package/{templates/temporal-api-worker → fragments/temporal}/worker/package.json.hbs +3 -2
- package/fragments/temporal/worker/src/activities.ts.hbs +14 -0
- package/fragments/temporal/worker/src/worker.ts.hbs +27 -0
- package/fragments/temporal/worker/src/workflows.ts.hbs +24 -0
- package/fragments/temporal/worker/tsconfig.json +13 -0
- package/package.json +35 -21
- package/skills/core/SKILL.md +365 -0
- package/skills/pull-remote-agent-context/SKILL.md +194 -0
- package/stack/docker-compose.hub.yml +134 -0
- package/stack/docker-compose.yml +447 -0
- package/stack/hub/Dockerfile.api +18 -0
- package/stack/hub/Dockerfile.auth +10 -0
- package/stack/hub/Dockerfile.ui +10 -0
- package/stack/init/01-databases.sql +12 -0
- package/stack/observability/blackbox.yml +20 -0
- package/stack/observability/otel-collector.yaml +73 -0
- package/stack/observability/prometheus.yml +36 -0
- package/stack/observability/tempo.yaml +25 -0
- package/stack/temporal/local.yaml +44 -0
- package/templates/api-auth/AGENTS.md.hbs +16 -0
- package/templates/api-auth/Pulumi.dev.yaml.hbs +8 -0
- package/templates/api-auth/Pulumi.yaml.hbs +8 -0
- package/templates/api-auth/README.md.hbs +67 -0
- package/templates/api-auth/api/package.json.hbs +28 -0
- package/templates/api-auth/api/src/index.ts.hbs +96 -0
- package/templates/api-auth/api/src/schema.ts.hbs +35 -0
- package/templates/api-auth/api/src/seed-authz.ts.hbs +48 -0
- package/templates/api-auth/api/src/spicedb-http-provider.ts.hbs +89 -0
- package/templates/api-auth/index.ts.hbs +65 -0
- package/templates/api-auth/package.json.hbs +20 -0
- package/templates/api-auth/skills/develop/SKILL.md.hbs +32 -0
- package/templates/api-role-gating/AGENTS.md.hbs +20 -0
- package/templates/api-role-gating/Pulumi.dev.yaml.hbs +8 -0
- package/templates/api-role-gating/Pulumi.yaml.hbs +8 -0
- package/templates/api-role-gating/README.md.hbs +64 -0
- package/templates/api-role-gating/api/Dockerfile +17 -0
- package/templates/api-role-gating/api/package.json.hbs +28 -0
- package/templates/api-role-gating/api/src/authn.ts.hbs +29 -0
- package/templates/api-role-gating/api/src/authz.ts.hbs +12 -0
- package/templates/api-role-gating/api/src/main.ts.hbs +58 -0
- package/templates/api-role-gating/api/src/schema.ts.hbs +22 -0
- package/templates/api-role-gating/api/tsconfig.json +13 -0
- package/templates/api-role-gating/index.ts.hbs +107 -0
- package/templates/api-role-gating/package.json.hbs +21 -0
- package/templates/api-role-gating/skills/develop/SKILL.md.hbs +60 -0
- package/templates/api-role-gating/tsconfig.json +10 -0
- package/templates/apps-repo/README.md.hbs +24 -0
- package/templates/apps-repo/gitignore +41 -0
- package/templates/apps-repo/npmrc.hbs +7 -0
- package/templates/apps-repo/package.json.hbs +15 -0
- package/templates/apps-repo/pnpm-workspace.yaml +3 -0
- package/templates/apps-repo/tsconfig.json +18 -0
- package/templates/external-service/AGENTS.md.hbs +20 -0
- package/templates/external-service/Pulumi.dev.yaml.hbs +8 -0
- package/templates/external-service/Pulumi.yaml.hbs +8 -0
- package/templates/external-service/README.md.hbs +56 -0
- package/templates/external-service/api/Dockerfile +15 -0
- package/templates/external-service/api/package.json.hbs +25 -0
- package/templates/external-service/api/src/index.ts.hbs +81 -0
- package/templates/external-service/index.ts.hbs +82 -0
- package/templates/external-service/mocks/vendorpay/package.json.hbs +9 -0
- package/templates/external-service/mocks/vendorpay/server.mjs.hbs +61 -0
- package/templates/external-service/package.json.hbs +34 -0
- package/templates/external-service/skills/develop/SKILL.md.hbs +55 -0
- package/templates/external-service/tsconfig.json +10 -0
- package/templates/platform-repo/AGENTS.md.hbs +18 -0
- package/templates/platform-repo/README.md.hbs +38 -0
- package/templates/platform-repo/core/Pulumi.yaml.hbs +12 -0
- package/templates/platform-repo/core/Pulumi.{{tenant}}-{{env}}.yaml.hbs +57 -0
- package/templates/platform-repo/core/index.ts +62 -0
- package/templates/platform-repo/core/package.json.hbs +22 -0
- package/templates/platform-repo/core/tsconfig.json +8 -0
- package/templates/platform-repo/package.json.hbs +15 -0
- package/templates/platform-repo/platform/Pulumi.yaml.hbs +12 -0
- package/templates/platform-repo/platform/Pulumi.{{tenant}}-{{env}}.yaml.hbs +59 -0
- package/templates/platform-repo/platform/index.ts +95 -0
- package/templates/platform-repo/platform/package.json.hbs +26 -0
- package/templates/platform-repo/platform/tsconfig.json +8 -0
- package/templates/platform-repo/pnpm-workspace.yaml +3 -0
- package/templates/workflow/AGENTS.md.hbs +15 -0
- package/templates/workflow/Pulumi.dev.yaml.hbs +8 -0
- package/templates/workflow/Pulumi.yaml.hbs +8 -0
- package/templates/workflow/README.md.hbs +45 -0
- package/templates/workflow/api/.dockerignore +4 -0
- package/templates/workflow/api/Dockerfile +15 -0
- package/templates/{temporal-api-worker → workflow}/api/package.json.hbs +8 -6
- package/templates/workflow/api/src/index.ts.hbs +130 -0
- package/templates/workflow/api/tsconfig.json +14 -0
- package/templates/workflow/index.ts.hbs +67 -0
- package/templates/workflow/package.json.hbs +20 -0
- package/templates/workflow/skills/develop/SKILL.md.hbs +32 -0
- package/templates/workflow/tsconfig.json +10 -0
- package/templates/workflow/worker/.dockerignore +4 -0
- package/templates/workflow/worker/Dockerfile +13 -0
- package/templates/workflow/worker/package.json.hbs +25 -0
- package/templates/workflow/worker/src/worker.ts.hbs +24 -0
- package/templates/workflow/worker/tsconfig.json +14 -0
- package/dist/src/commands/devbox.d.ts +0 -22
- package/dist/src/commands/devbox.d.ts.map +0 -1
- package/dist/src/commands/devbox.js +0 -463
- package/dist/src/commands/devbox.js.map +0 -1
- package/templates/api-web-db/api/Dockerfile +0 -16
- package/templates/api-web-db/api/package.json.hbs +0 -21
- package/templates/api-web-db/api/src/index.ts.hbs +0 -123
- package/templates/api-web-db/package.json.hbs +0 -27
- package/templates/api-web-db/sst.config.ts.hbs +0 -151
- package/templates/api-web-db/web/.dockerignore +0 -3
- package/templates/api-web-db/web/Dockerfile +0 -17
- package/templates/api-web-db/web/app/lib/db.server.ts +0 -36
- package/templates/api-web-db/web/app/root.tsx +0 -29
- package/templates/api-web-db/web/app/routes/home.tsx.hbs +0 -114
- package/templates/api-web-db/web/app/routes.ts +0 -3
- package/templates/api-web-db/web/package.json.hbs +0 -30
- package/templates/api-web-db/web/prisma/schema.prisma +0 -25
- package/templates/api-web-db/web/prisma.config.ts +0 -18
- package/templates/api-web-db/web/react-router.config.ts +0 -5
- package/templates/api-web-db/web/tsconfig.json +0 -19
- package/templates/api-web-db/web/vite.config.ts +0 -9
- package/templates/temporal-api-worker/README.md.hbs +0 -133
- package/templates/temporal-api-worker/api/src/index.ts.hbs +0 -145
- package/templates/temporal-api-worker/package.json.hbs +0 -29
- package/templates/temporal-api-worker/sst.config.ts.hbs +0 -161
- package/templates/temporal-api-worker/worker/Dockerfile +0 -11
- package/templates/temporal-api-worker/worker/src/bundle-workflows.ts +0 -38
- package/templates/temporal-api-worker/worker/src/worker.ts.hbs +0 -93
- /package/templates/{temporal-api-worker → api-auth}/api/.dockerignore +0 -0
- /package/templates/{temporal-api-worker → api-auth}/api/Dockerfile +0 -0
- /package/templates/{temporal-api-worker → api-auth}/api/tsconfig.json +0 -0
- /package/templates/{temporal-api-worker → api-auth}/tsconfig.json +0 -0
- /package/templates/{temporal-api-worker/worker → api-role-gating/api}/.dockerignore +0 -0
- /package/templates/{temporal-api-worker/worker → external-service/api}/tsconfig.json +0 -0
- /package/templates/{temporal-api-worker → workflow}/api/src/encryption-codec.ts +0 -0
- /package/templates/{temporal-api-worker → workflow}/worker/src/activities.ts.hbs +0 -0
- /package/templates/{temporal-api-worker → workflow}/worker/src/encryption-codec.ts +0 -0
- /package/templates/{temporal-api-worker → workflow}/worker/src/workflows.ts.hbs +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dev-doctor.js","sourceRoot":"","sources":["../../../src/commands/dev-doctor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,GAAG,MAAM,UAAU,CAAC;AAChC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEtC,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,gBAAgB,GACjB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAkB,MAAM,YAAY,CAAC;AA6CnF,+EAA+E;AAC/E,4BAA4B;AAC5B,+EAA+E;AAE/E,+EAA+E;AAC/E,MAAM,UAAU,eAAe,CAAC,OAAsB;IACpD,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,OAAO,CAAC;QAAE,OAAO,OAAO,CAAC;IAC9D,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,MAAM,CAAC;QAAE,OAAO,MAAM,CAAC;IAC5D,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAA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AAC,CAAC,MAAM,CAAC,CAAC,CAAC;IAC7D,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;QACd,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC;IACnC,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC;QAClC,OAAO,CAAC,GAAG,CAAC,KAAK,KAAK,CAAC,MAAM,CAAC,aAAa,MAAM,EAAE,CAAC,CAAC;IACvD,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Helpers for launching `mesh dev` services via per-session env files.
|
|
3
|
+
*
|
|
4
|
+
* Background: `mesh dev` used to inline every env var into a single giant
|
|
5
|
+
* `env K1=V1 K2=V2 … <command>` string passed to `tmux send-keys`. With large
|
|
6
|
+
* values (system prompts, encoding keys, OAuth creds) tmux intermittently
|
|
7
|
+
* truncated the string — the service never started — and `mesh dev restart`
|
|
8
|
+
* re-derived the env from scratch, drifting from what the service was
|
|
9
|
+
* originally launched with (e.g. a different TEMPORAL_ENCODING_KEY).
|
|
10
|
+
*
|
|
11
|
+
* Instead, the full env is written once at launch to a 0600 file under the
|
|
12
|
+
* session state dir, and the send-keys command is just:
|
|
13
|
+
*
|
|
14
|
+
* cd '<dir>' && source '<envfile>' && <command>
|
|
15
|
+
*
|
|
16
|
+
* Restart sources the SAME file, guaranteeing a byte-identical environment.
|
|
17
|
+
*/
|
|
18
|
+
/** Env files contain secrets — owner read/write only. */
|
|
19
|
+
export declare const ENV_FILE_MODE = 384;
|
|
20
|
+
/**
|
|
21
|
+
* Single-quote a value for POSIX shells (bash/zsh), escaping embedded
|
|
22
|
+
* single quotes via the standard `'\''` dance. Safe for newlines, spaces,
|
|
23
|
+
* `$`, backticks, etc.
|
|
24
|
+
*/
|
|
25
|
+
export declare function quoteShellValue(value: string): string;
|
|
26
|
+
/**
|
|
27
|
+
* Render a sourceable env file: one `export K='V'` per line.
|
|
28
|
+
* Throws on env var names that aren't valid shell identifiers.
|
|
29
|
+
*/
|
|
30
|
+
export declare function renderEnvFile(env: Record<string, string>): string;
|
|
31
|
+
/** Filesystem-safe env file name for a service. */
|
|
32
|
+
export declare function envFileName(serviceName: string): string;
|
|
33
|
+
/**
|
|
34
|
+
* Write the env file (creating parent dirs) with mode 0600.
|
|
35
|
+
* chmod is applied explicitly so a pre-existing file is tightened too.
|
|
36
|
+
*/
|
|
37
|
+
export declare function writeEnvFile(filePath: string, env: Record<string, string>): void;
|
|
38
|
+
/**
|
|
39
|
+
* Build the short, untruncatable command sent to tmux:
|
|
40
|
+
* cd '<dir>' && source '<envfile>' && <command>
|
|
41
|
+
*
|
|
42
|
+
* `command` is the service's dev command (already shell syntax) and is
|
|
43
|
+
* passed through verbatim.
|
|
44
|
+
*
|
|
45
|
+
* With `logShipper` (mesh dev --local: the path of assets/log-shipper.mjs),
|
|
46
|
+
* the service's combined stdout/stderr is piped through the shipper: raw
|
|
47
|
+
* bytes go to the pane (its stderr), ANSI-stripped lines ship to the local
|
|
48
|
+
* platform's OTel collector via OTLP — the same ingestion path instrumented
|
|
49
|
+
* apps use, carrying the OTEL_* resource attributes from the env file. Logs
|
|
50
|
+
* never cross the macOS Docker file mount (whose stale attribute caching
|
|
51
|
+
* hides appends from in-container tailers).
|
|
52
|
+
*/
|
|
53
|
+
export declare function buildLaunchCommand(envFilePath: string, dir: string, command: string, logShipper?: string): string;
|
|
54
|
+
/**
|
|
55
|
+
* Poll until a TCP port accepts connections, or the timeout elapses.
|
|
56
|
+
* Returns true when the port accepted, false on timeout.
|
|
57
|
+
*/
|
|
58
|
+
export declare function waitForPort(host: string, port: number, timeoutMs: number, intervalMs?: number): Promise<boolean>;
|
|
59
|
+
//# sourceMappingURL=dev-launch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dev-launch.d.ts","sourceRoot":"","sources":["../../../src/commands/dev-launch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAMH,yDAAyD;AACzD,eAAO,MAAM,aAAa,MAAQ,CAAC;AAKnC;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAErD;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAajE;AAED,mDAAmD;AACnD,wBAAgB,WAAW,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAEvD;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAIhF;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,kBAAkB,CAChC,WAAW,EAAE,MAAM,EACnB,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,MAAM,EACf,UAAU,CAAC,EAAE,MAAM,GAClB,MAAM,CAMR;AAED;;;GAGG;AACH,wBAAsB,WAAW,CAC/B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,EACjB,UAAU,SAAM,GACf,OAAO,CAAC,OAAO,CAAC,CAWlB"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Helpers for launching `mesh dev` services via per-session env files.
|
|
3
|
+
*
|
|
4
|
+
* Background: `mesh dev` used to inline every env var into a single giant
|
|
5
|
+
* `env K1=V1 K2=V2 … <command>` string passed to `tmux send-keys`. With large
|
|
6
|
+
* values (system prompts, encoding keys, OAuth creds) tmux intermittently
|
|
7
|
+
* truncated the string — the service never started — and `mesh dev restart`
|
|
8
|
+
* re-derived the env from scratch, drifting from what the service was
|
|
9
|
+
* originally launched with (e.g. a different TEMPORAL_ENCODING_KEY).
|
|
10
|
+
*
|
|
11
|
+
* Instead, the full env is written once at launch to a 0600 file under the
|
|
12
|
+
* session state dir, and the send-keys command is just:
|
|
13
|
+
*
|
|
14
|
+
* cd '<dir>' && source '<envfile>' && <command>
|
|
15
|
+
*
|
|
16
|
+
* Restart sources the SAME file, guaranteeing a byte-identical environment.
|
|
17
|
+
*/
|
|
18
|
+
import * as fs from 'fs';
|
|
19
|
+
import * as net from 'net';
|
|
20
|
+
import * as path from 'path';
|
|
21
|
+
/** Env files contain secrets — owner read/write only. */
|
|
22
|
+
export const ENV_FILE_MODE = 0o600;
|
|
23
|
+
/** Valid POSIX env var name. Anything else is rejected to avoid shell injection. */
|
|
24
|
+
const ENV_KEY_RE = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
25
|
+
/**
|
|
26
|
+
* Single-quote a value for POSIX shells (bash/zsh), escaping embedded
|
|
27
|
+
* single quotes via the standard `'\''` dance. Safe for newlines, spaces,
|
|
28
|
+
* `$`, backticks, etc.
|
|
29
|
+
*/
|
|
30
|
+
export function quoteShellValue(value) {
|
|
31
|
+
return `'${value.replace(/'/g, "'\\''")}'`;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Render a sourceable env file: one `export K='V'` per line.
|
|
35
|
+
* Throws on env var names that aren't valid shell identifiers.
|
|
36
|
+
*/
|
|
37
|
+
export function renderEnvFile(env) {
|
|
38
|
+
const lines = [
|
|
39
|
+
'# Auto-generated by mesh dev — do not edit.',
|
|
40
|
+
'# Sourced by service launch/restart commands; this file IS the',
|
|
41
|
+
"# session's env contract for the service (restart fidelity).",
|
|
42
|
+
];
|
|
43
|
+
for (const [key, value] of Object.entries(env)) {
|
|
44
|
+
if (!ENV_KEY_RE.test(key)) {
|
|
45
|
+
throw new Error(`Invalid env var name for env file: ${JSON.stringify(key)}`);
|
|
46
|
+
}
|
|
47
|
+
lines.push(`export ${key}=${quoteShellValue(value)}`);
|
|
48
|
+
}
|
|
49
|
+
return lines.join('\n') + '\n';
|
|
50
|
+
}
|
|
51
|
+
/** Filesystem-safe env file name for a service. */
|
|
52
|
+
export function envFileName(serviceName) {
|
|
53
|
+
return `${serviceName.replace(/[^A-Za-z0-9._-]/g, '-')}.env.sh`;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Write the env file (creating parent dirs) with mode 0600.
|
|
57
|
+
* chmod is applied explicitly so a pre-existing file is tightened too.
|
|
58
|
+
*/
|
|
59
|
+
export function writeEnvFile(filePath, env) {
|
|
60
|
+
fs.mkdirSync(path.dirname(filePath), { recursive: true });
|
|
61
|
+
fs.writeFileSync(filePath, renderEnvFile(env), { mode: ENV_FILE_MODE });
|
|
62
|
+
fs.chmodSync(filePath, ENV_FILE_MODE);
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Build the short, untruncatable command sent to tmux:
|
|
66
|
+
* cd '<dir>' && source '<envfile>' && <command>
|
|
67
|
+
*
|
|
68
|
+
* `command` is the service's dev command (already shell syntax) and is
|
|
69
|
+
* passed through verbatim.
|
|
70
|
+
*
|
|
71
|
+
* With `logShipper` (mesh dev --local: the path of assets/log-shipper.mjs),
|
|
72
|
+
* the service's combined stdout/stderr is piped through the shipper: raw
|
|
73
|
+
* bytes go to the pane (its stderr), ANSI-stripped lines ship to the local
|
|
74
|
+
* platform's OTel collector via OTLP — the same ingestion path instrumented
|
|
75
|
+
* apps use, carrying the OTEL_* resource attributes from the env file. Logs
|
|
76
|
+
* never cross the macOS Docker file mount (whose stale attribute caching
|
|
77
|
+
* hides appends from in-container tailers).
|
|
78
|
+
*/
|
|
79
|
+
export function buildLaunchCommand(envFilePath, dir, command, logShipper) {
|
|
80
|
+
const base = `cd ${quoteShellValue(dir)} && source ${quoteShellValue(envFilePath)} && `;
|
|
81
|
+
if (!logShipper)
|
|
82
|
+
return `${base}${command}`;
|
|
83
|
+
// NODE_OPTIONS= : the shipper must not inherit the service's OTel
|
|
84
|
+
// auto-instrumentation — its own OTLP POSTs would show up as traces.
|
|
85
|
+
return `${base}{ ${command}; } 2>&1 | NODE_OPTIONS= node ${quoteShellValue(logShipper)}`;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Poll until a TCP port accepts connections, or the timeout elapses.
|
|
89
|
+
* Returns true when the port accepted, false on timeout.
|
|
90
|
+
*/
|
|
91
|
+
export async function waitForPort(host, port, timeoutMs, intervalMs = 500) {
|
|
92
|
+
const deadline = Date.now() + timeoutMs;
|
|
93
|
+
// Always attempt at least once, even with a zero/negative timeout.
|
|
94
|
+
for (;;) {
|
|
95
|
+
const remaining = deadline - Date.now();
|
|
96
|
+
const attemptTimeout = Math.max(250, Math.min(1000, remaining));
|
|
97
|
+
if (await tryConnect(host, port, attemptTimeout))
|
|
98
|
+
return true;
|
|
99
|
+
if (Date.now() + intervalMs >= deadline)
|
|
100
|
+
return false;
|
|
101
|
+
await new Promise((resolve) => setTimeout(resolve, intervalMs));
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
function tryConnect(host, port, timeoutMs) {
|
|
105
|
+
return new Promise((resolve) => {
|
|
106
|
+
const socket = net.connect({ host, port });
|
|
107
|
+
const done = (ok) => {
|
|
108
|
+
socket.removeAllListeners();
|
|
109
|
+
socket.destroy();
|
|
110
|
+
resolve(ok);
|
|
111
|
+
};
|
|
112
|
+
socket.setTimeout(timeoutMs);
|
|
113
|
+
socket.once('connect', () => done(true));
|
|
114
|
+
socket.once('timeout', () => done(false));
|
|
115
|
+
socket.once('error', () => done(false));
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
//# sourceMappingURL=dev-launch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dev-launch.js","sourceRoot":"","sources":["../../../src/commands/dev-launch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,GAAG,MAAM,KAAK,CAAC;AAC3B,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;A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AAS,UAAU,CAAC,IAAY,EAAE,IAAY,EAAE,SAAiB;IAC/D,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC7B,MAAM,MAAM,GAAG,GAAG,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;QAC3C,MAAM,IAAI,GAAG,CAAC,EAAW,EAAE,EAAE;YAC3B,MAAM,CAAC,kBAAkB,EAAE,CAAC;YAC5B,MAAM,CAAC,OAAO,EAAE,CAAC;YACjB,OAAO,CAAC,EAAE,CAAC,CAAC;QACd,CAAC,CAAC;QACF,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;QAC7B,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QACzC,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;QAC1C,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `mesh dev __token-server <port> <context>` — the producer side of the
|
|
3
|
+
* self-refreshing dev-user token seam (MESH-2039).
|
|
4
|
+
*
|
|
5
|
+
* `mesh dev` launches this in its own tmux window. On each GET it mints a
|
|
6
|
+
* currently-valid dev-user token (via the existing `getValidToken` refresh
|
|
7
|
+
* path, which silently re-mints from the refresh token and rewrites the shared
|
|
8
|
+
* cache) and returns it on loopback. Consumers poll it (agent-app-kit's
|
|
9
|
+
* dev-user-token provider) so local apps survive past the ~1h Zitadel horizon
|
|
10
|
+
* without a `mesh dev` restart. Bound to 127.0.0.1 only; dev-only.
|
|
11
|
+
*/
|
|
12
|
+
export interface TokenServerDeps {
|
|
13
|
+
getValidToken: (context: string) => Promise<string | null>;
|
|
14
|
+
readCredentials: (context: string) => {
|
|
15
|
+
accessToken: string;
|
|
16
|
+
expiresAt: string;
|
|
17
|
+
email?: string;
|
|
18
|
+
} | null;
|
|
19
|
+
decodeJwtPayload: (jwt: string) => Record<string, unknown>;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Pure request handler. 200 with the fresh token pair on success; 503 when the
|
|
23
|
+
* token can't be minted (refresh token lapsed — the MESH-2035 boundary), which
|
|
24
|
+
* consumers treat as "keep last good / fall back to the static env snapshot".
|
|
25
|
+
*/
|
|
26
|
+
export declare function handleTokenRequest(context: string, deps: TokenServerDeps): Promise<{
|
|
27
|
+
status: number;
|
|
28
|
+
body: unknown;
|
|
29
|
+
}>;
|
|
30
|
+
/** Start the loopback token server. Never resolves (runs until the window dies). */
|
|
31
|
+
export declare function startTokenServer(port: number, context: string): Promise<void>;
|
|
32
|
+
//# sourceMappingURL=dev-token-server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dev-token-server.d.ts","sourceRoot":"","sources":["../../../src/commands/dev-token-server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAMH,MAAM,WAAW,eAAe;IAC9B,aAAa,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAC3D,eAAe,EAAE,CACf,OAAO,EAAE,MAAM,KACZ;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IACvE,gBAAgB,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC5D;AAED;;;;GAIG;AACH,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,eAAe,GACpB,OAAO,CAAC;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,OAAO,CAAA;CAAE,CAAC,CAe5C;AASD,oFAAoF;AACpF,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAsBnF"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `mesh dev __token-server <port> <context>` — the producer side of the
|
|
3
|
+
* self-refreshing dev-user token seam (MESH-2039).
|
|
4
|
+
*
|
|
5
|
+
* `mesh dev` launches this in its own tmux window. On each GET it mints a
|
|
6
|
+
* currently-valid dev-user token (via the existing `getValidToken` refresh
|
|
7
|
+
* path, which silently re-mints from the refresh token and rewrites the shared
|
|
8
|
+
* cache) and returns it on loopback. Consumers poll it (agent-app-kit's
|
|
9
|
+
* dev-user-token provider) so local apps survive past the ~1h Zitadel horizon
|
|
10
|
+
* without a `mesh dev` restart. Bound to 127.0.0.1 only; dev-only.
|
|
11
|
+
*/
|
|
12
|
+
import * as http from "node:http";
|
|
13
|
+
import { getValidToken, readCredentials, decodeJwtPayload } from "./login.js";
|
|
14
|
+
import { logInfo, logWarn } from "../utils/log.js";
|
|
15
|
+
/**
|
|
16
|
+
* Pure request handler. 200 with the fresh token pair on success; 503 when the
|
|
17
|
+
* token can't be minted (refresh token lapsed — the MESH-2035 boundary), which
|
|
18
|
+
* consumers treat as "keep last good / fall back to the static env snapshot".
|
|
19
|
+
*/
|
|
20
|
+
export async function handleTokenRequest(context, deps) {
|
|
21
|
+
const idToken = await deps.getValidToken(context);
|
|
22
|
+
const creds = idToken ? deps.readCredentials(context) : null;
|
|
23
|
+
if (!idToken || !creds)
|
|
24
|
+
return { status: 503, body: { error: "token-unavailable" } };
|
|
25
|
+
const payload = deps.decodeJwtPayload(idToken);
|
|
26
|
+
return {
|
|
27
|
+
status: 200,
|
|
28
|
+
body: {
|
|
29
|
+
idToken,
|
|
30
|
+
accessToken: creds.accessToken,
|
|
31
|
+
sub: payload.sub ?? undefined,
|
|
32
|
+
email: creds.email ?? payload.email ?? undefined,
|
|
33
|
+
expiresAt: creds.expiresAt,
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Refresh the served token this far before it actually expires, so a consumer
|
|
39
|
+
* polling on its own cadence (~60s) always fetches a token that outlives its
|
|
40
|
+
* next poll — closing the ~once-per-hour self-healing 401 window.
|
|
41
|
+
*/
|
|
42
|
+
const REFRESH_MARGIN_MS = 120_000;
|
|
43
|
+
/** Start the loopback token server. Never resolves (runs until the window dies). */
|
|
44
|
+
export async function startTokenServer(port, context) {
|
|
45
|
+
const deps = {
|
|
46
|
+
getValidToken: (c) => getValidToken(c, { marginMs: REFRESH_MARGIN_MS }),
|
|
47
|
+
readCredentials,
|
|
48
|
+
decodeJwtPayload,
|
|
49
|
+
};
|
|
50
|
+
const server = http.createServer((_req, res) => {
|
|
51
|
+
void (async () => {
|
|
52
|
+
try {
|
|
53
|
+
const { status, body } = await handleTokenRequest(context, deps);
|
|
54
|
+
res.writeHead(status, { "content-type": "application/json" });
|
|
55
|
+
res.end(JSON.stringify(body));
|
|
56
|
+
}
|
|
57
|
+
catch (e) {
|
|
58
|
+
res.writeHead(500, { "content-type": "application/json" });
|
|
59
|
+
res.end(JSON.stringify({ error: e.message }));
|
|
60
|
+
}
|
|
61
|
+
})();
|
|
62
|
+
});
|
|
63
|
+
server.on("error", (e) => logWarn(`token-server error: ${e.message}`));
|
|
64
|
+
await new Promise((resolve) => server.listen(port, "127.0.0.1", resolve));
|
|
65
|
+
logInfo(`dev-user token-server on http://127.0.0.1:${port} (context ${context})`);
|
|
66
|
+
await new Promise(() => { }); // run forever
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=dev-token-server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dev-token-server.js","sourceRoot":"","sources":["../../../src/commands/dev-token-server.ts"],"names":[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
2
2
|
* mesh dev — Pulumi-output-driven local development orchestrator
|
|
3
3
|
*
|
|
4
|
-
* Reads `pulumi stack output dev --json` to discover services and
|
|
4
|
+
* Reads `pulumi stack output dev --json` to discover services and VPC endpoints,
|
|
5
5
|
* then launches each service's dev command in a tmux window.
|
|
6
|
+
* Requires VPN connection for direct access to VPC resources.
|
|
6
7
|
*
|
|
7
8
|
* Usage:
|
|
8
9
|
* mesh dev Start all services, attach tmux
|
|
@@ -12,6 +13,292 @@
|
|
|
12
13
|
* mesh dev logs <service> Tail a service's output
|
|
13
14
|
* mesh dev restart <svc> Restart a single service
|
|
14
15
|
*/
|
|
15
|
-
import { Command } from
|
|
16
|
+
import { Command } from 'commander';
|
|
17
|
+
import { type ResolvedAwsCreds } from '../utils/aws-auth.js';
|
|
18
|
+
import { type ComposeExternalRef } from './local/mocks.js';
|
|
19
|
+
interface DevEnvVar {
|
|
20
|
+
value: string;
|
|
21
|
+
/** If set, env var value uses the named tunnel's host:port */
|
|
22
|
+
tunnel?: string;
|
|
23
|
+
}
|
|
24
|
+
interface DevService {
|
|
25
|
+
src: string;
|
|
26
|
+
port: number;
|
|
27
|
+
command: string[];
|
|
28
|
+
env?: Record<string, DevEnvVar>;
|
|
29
|
+
}
|
|
30
|
+
/** VPC-accessible endpoint for VPN direct access */
|
|
31
|
+
interface DevTunnel {
|
|
32
|
+
/** VPC hostname (RDS endpoint, NLB hostname, etc.) */
|
|
33
|
+
host: string;
|
|
34
|
+
/** Port number */
|
|
35
|
+
port: number;
|
|
36
|
+
}
|
|
37
|
+
interface DevSecret {
|
|
38
|
+
/** Secrets Manager secret name */
|
|
39
|
+
secretName: string;
|
|
40
|
+
/** Maps secret JSON keys → env var names to inject into services */
|
|
41
|
+
envMapping: Record<string, string>;
|
|
42
|
+
}
|
|
43
|
+
export interface DevOutput {
|
|
44
|
+
/**
|
|
45
|
+
* Platform context. `tenant` is the APP tenant (Temporal namespace auth +
|
|
46
|
+
* encoding key). `name` is the HUB platform name (bastion + headscale DNS,
|
|
47
|
+
* which live in the hub for shared tenants); falls back to "mesh".
|
|
48
|
+
*/
|
|
49
|
+
platform?: {
|
|
50
|
+
tenant: string;
|
|
51
|
+
name?: string;
|
|
52
|
+
env: string;
|
|
53
|
+
};
|
|
54
|
+
/** App name (e.g., "hub") */
|
|
55
|
+
app?: string;
|
|
56
|
+
/** Pulumi stack name (e.g., "dev", "feature-xyz") */
|
|
57
|
+
stack?: string;
|
|
58
|
+
services: Record<string, DevService>;
|
|
59
|
+
tunnels: Record<string, DevTunnel>;
|
|
60
|
+
/** Secrets to resolve from Secrets Manager at dev startup */
|
|
61
|
+
secrets?: Record<string, DevSecret>;
|
|
62
|
+
}
|
|
63
|
+
export interface SessionState {
|
|
64
|
+
appRoot: string;
|
|
65
|
+
stack: string;
|
|
66
|
+
devOutput: DevOutput;
|
|
67
|
+
startedAt: string;
|
|
68
|
+
/** 'tmux' (default) or 'docker' (mesh dev --runner docker, local mode) */
|
|
69
|
+
runner?: 'tmux' | 'docker';
|
|
70
|
+
/** Compose-mode external services (mesh dev --externals) this session brought
|
|
71
|
+
* up — torn down (volumes kept) on `mesh dev --kill`. */
|
|
72
|
+
composeExternals?: ComposeExternalRef[];
|
|
73
|
+
/** Prometheus file_sd probe targets this session's externals registered —
|
|
74
|
+
* removed on `mesh dev --kill` so the Hub stops showing uptime for a
|
|
75
|
+
* session that isn't running. Recorded as paths so `--kill --session`
|
|
76
|
+
* works without resolving an app root. */
|
|
77
|
+
externalProbeFiles?: string[];
|
|
78
|
+
/**
|
|
79
|
+
* Content fingerprint of the workflow source (agent-sdk / interpreter /
|
|
80
|
+
* agent-contracts) at launch. Compared on relaunch/restart to warn before the
|
|
81
|
+
* worker replays in-flight conversations against changed workflow code
|
|
82
|
+
* (MESH-2017). Absent for sessions launched before this field existed.
|
|
83
|
+
*/
|
|
84
|
+
workflowFingerprint?: string;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Relaunch safety (MESH-2017): if the workflow source changed since this session
|
|
88
|
+
* launched, restarting the worker replays any in-flight conversations against the
|
|
89
|
+
* NEW code — a replay-incompatible change strands them. Warn and require `--force`.
|
|
90
|
+
*
|
|
91
|
+
* Silent no-op when there's no prior session, no stored fingerprint (pre-feature
|
|
92
|
+
* session), or nothing changed — so a restart of unchanged code never nags.
|
|
93
|
+
* Returns `true` if the caller should ABORT (changed && !force).
|
|
94
|
+
*/
|
|
95
|
+
/** Pure: did the workflow source change since launch (→ risk of stranding)? */
|
|
96
|
+
export declare function workflowChanged(prior: string | undefined, current: string): boolean;
|
|
97
|
+
/**
|
|
98
|
+
* Check whether a TCP port is available — probing the way services actually bind.
|
|
99
|
+
*
|
|
100
|
+
* This used to bind `127.0.0.1` only, and that made it blind to exactly the
|
|
101
|
+
* processes it exists to find. Node's `listen(port)` (and `@hono/node-server`,
|
|
102
|
+
* which every agent-api uses) binds the WILDCARD address `::` in dual-stack mode,
|
|
103
|
+
* holding the port on every interface — yet a probe bound to `127.0.0.1` still
|
|
104
|
+
* succeeds against such a holder. So the check returned `true` for a port already
|
|
105
|
+
* held by a prior `mesh dev` service, `allocatePorts` kept the preferred port, and
|
|
106
|
+
* the service then died on `EADDRINUSE` at its real bind.
|
|
107
|
+
*
|
|
108
|
+
* Observed 2026-07-31: the `studio-api` pane died on `EADDRINUSE :::40161` while a
|
|
109
|
+
* stale agent-api from an earlier boot kept serving on the same port, so the Studio
|
|
110
|
+
* UI drove a process from a previous session's configuration and the conversation
|
|
111
|
+
* list came back empty. Reproduced in isolation — holder on `::`, loopback probe
|
|
112
|
+
* reports free, real bind fails (MESH-2590).
|
|
113
|
+
*
|
|
114
|
+
* Both addresses are probed: the wildcard catches all-interface holders, and the
|
|
115
|
+
* loopback probe still catches a loopback-only squatter. A false "busy" is cheap —
|
|
116
|
+
* `allocatePorts` simply picks another port — while a false "free" crashes the
|
|
117
|
+
* service, so this deliberately errs toward busy.
|
|
118
|
+
*/
|
|
119
|
+
export declare function isPortFree(port: number): Promise<boolean>;
|
|
120
|
+
/**
|
|
121
|
+
* Rewrite a service's OWN listen-port env var(s) from `oldPort` to `newPort`
|
|
122
|
+
* when `allocatePorts` reassigns its port (e.g. a worktree block). Matches any
|
|
123
|
+
* port-ish var (`PORT` or `*_PORT`, e.g. `VCS_PORT`/`AGENT_API_PORT`) whose value
|
|
124
|
+
* is exactly the old port — so a service that reads its own env var still binds
|
|
125
|
+
* the reassigned port instead of its deploy-time default (which would collide
|
|
126
|
+
* with another worktree/session on that default). The name + exact-value match
|
|
127
|
+
* keeps this from touching cross-service references or unrelated vars.
|
|
128
|
+
* Mutates `service.env`. Pure otherwise — exported for unit testing. (MESH-2088)
|
|
129
|
+
*/
|
|
130
|
+
export declare function rewriteOwnServicePort(service: DevService, oldPort: number, newPort: number): void;
|
|
131
|
+
/**
|
|
132
|
+
* Merge a session's PINNED ports/tunnels into a freshly-read DevOutput.
|
|
133
|
+
*
|
|
134
|
+
* `mesh dev restart <svc> --refresh-env` re-reads `pulumi stack output` to pick
|
|
135
|
+
* up config/deploy changes, but the running session already allocated local
|
|
136
|
+
* ports (`allocatePorts`) and opened SSM tunnels. Re-reading the raw stack
|
|
137
|
+
* output would carry the DEPLOYED (pre-allocation) ports, so writing those into
|
|
138
|
+
* the env file would point the service — and its peers — at the wrong ports and
|
|
139
|
+
* break the live tunnels.
|
|
140
|
+
*
|
|
141
|
+
* This returns `fresh` (so new/changed non-port env values win) but overrides:
|
|
142
|
+
* - EVERY service present in both `fresh` and `pinned` keeps its pinned/
|
|
143
|
+
* allocated PORT (both `service.port` and `service.env.PORT.value`) — not
|
|
144
|
+
* just the refreshed one, so a regenerated service's peer references land on
|
|
145
|
+
* the session-allocated ports, and
|
|
146
|
+
* - every tunnel present in `pinned` with the pinned host:port (the live SSM
|
|
147
|
+
* endpoints); tunnels that exist only in `fresh` survive untouched.
|
|
148
|
+
*
|
|
149
|
+
* It then re-applies BOTH of the peer-addressing rewrites `allocatePorts` does —
|
|
150
|
+
* there are two now, and naming only one here is how they drift apart:
|
|
151
|
+
* - PORT: for each service whose port differs between `fresh` (preferred) and
|
|
152
|
+
* `pinned` (allocated), `localhost:${freshPort}` → `localhost:${pinnedPort}`
|
|
153
|
+
* across EVERY service's env (e.g. a `ui`'s `API_URL` pointing at `api`).
|
|
154
|
+
* - HOST: an in-cluster address for a service running LOCALLY becomes its local
|
|
155
|
+
* one. `pulumi stack output` carries cluster hosts verbatim, so a refresh
|
|
156
|
+
* without this restores exactly the value MESH-2597 exists to remove.
|
|
157
|
+
*
|
|
158
|
+
* Pure: deep-clones and never mutates its arguments.
|
|
159
|
+
*/
|
|
160
|
+
export declare function mergePinnedPorts(fresh: DevOutput, pinned: DevOutput): DevOutput;
|
|
161
|
+
/**
|
|
162
|
+
* Build the AWS env vars to hand to long-lived child services (ui, api,
|
|
163
|
+
* ai-assistant) and SSM tunnels.
|
|
164
|
+
*
|
|
165
|
+
* For the AWS SSO credential path, returns AWS_PROFILE + AWS_REGION only so
|
|
166
|
+
* the AWS SDK's default provider chain can auto-refresh credentials from the
|
|
167
|
+
* SSO cache (~8h session) as short-lived STS tokens expire. Without this,
|
|
168
|
+
* child processes inherit a frozen STS triple and start throwing
|
|
169
|
+
* ExpiredTokenException ~1h into a dev session.
|
|
170
|
+
*
|
|
171
|
+
* For the Zitadel web-identity path, when `opts` is supplied we write an AWS
|
|
172
|
+
* config file whose `credential_process` re-invokes `mesh login … --credential-process`,
|
|
173
|
+
* so the AWS SDK's default provider chain auto-refreshes the underlying STS
|
|
174
|
+
* triple (the `mesh login` process re-issues the Zitadel token as needed).
|
|
175
|
+
* This removes the ~1h forced `mesh dev` restart. When `opts` is absent we
|
|
176
|
+
* fall back to the frozen STS triple (used by CI/`environment` and any caller
|
|
177
|
+
* that doesn't thread the context/role through).
|
|
178
|
+
*
|
|
179
|
+
* For the remaining non-SSO paths (CI/CD env keys, or no deployer role),
|
|
180
|
+
* returns the explicit STS triple — there is no profile to refresh from. The
|
|
181
|
+
* user must restart `mesh dev` when those tokens expire.
|
|
182
|
+
*/
|
|
183
|
+
export declare function buildChildAwsEnv(awsEnv: Record<string, string>, method: ResolvedAwsCreds['method'] | 'ambient', profile: string | undefined, opts?: {
|
|
184
|
+
context: string;
|
|
185
|
+
roleArn: string;
|
|
186
|
+
sessionScratchDir: string;
|
|
187
|
+
meshBin: string;
|
|
188
|
+
}): Record<string, string>;
|
|
189
|
+
/**
|
|
190
|
+
* Reduce a service `src` to its monorepo-relative form (pure; no filesystem).
|
|
191
|
+
* - relative (`./packages/x` or `packages/x`) → normalized `packages/x`
|
|
192
|
+
* - legacy absolute (`/…/mesh-platform[/.worktrees/<name>]/packages/x`) →
|
|
193
|
+
* `packages/x` (drops the repo root AND any deploying-worktree segment)
|
|
194
|
+
* Returns null when an absolute path has no recognizable monorepo marker.
|
|
195
|
+
*/
|
|
196
|
+
export declare function monorepoRelativeSrc(src: string): string | null;
|
|
197
|
+
/**
|
|
198
|
+
* Build the client-facing `host:port` for an SSM tunnel.
|
|
199
|
+
*
|
|
200
|
+
* The `aws ssm start-session` port-forwarder binds IPv4 `127.0.0.1` only.
|
|
201
|
+
* Advertising `localhost` lets Node/grpc-js resolve to IPv6 `::1` first, which
|
|
202
|
+
* the tunnel isn't listening on — so e.g. the Temporal gRPC client fails with
|
|
203
|
+
* `ECONNREFUSED ::1:<port>` and the Hub's Automations/workflow lists never load.
|
|
204
|
+
* Maps the literal `localhost` (how tunnels are advertised today) to `127.0.0.1`
|
|
205
|
+
* so clients hit the bound listener. Any other host — VPN-direct VPC endpoints,
|
|
206
|
+
* or a different loopback literal like `::1`/`127.0.0.1` — passes through unchanged.
|
|
207
|
+
*/
|
|
208
|
+
export declare function tunnelClientAddress(tunnel: {
|
|
209
|
+
host: string;
|
|
210
|
+
port: number;
|
|
211
|
+
}): string;
|
|
212
|
+
/** One tunnel's live health, resolved by a TCP dial of its client address. */
|
|
213
|
+
export interface TunnelHealth {
|
|
214
|
+
name: string;
|
|
215
|
+
/** Client-facing `host:port` (see {@link tunnelClientAddress}). */
|
|
216
|
+
address: string;
|
|
217
|
+
reachable: boolean;
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Render the Connections section (live tunnel health) as status-window lines.
|
|
221
|
+
*
|
|
222
|
+
* The status window refreshes every ~2s, so this is where a mid-session tunnel
|
|
223
|
+
* death surfaces (MESH-2016): a dead tunnel shows `⚠ … DOWN` and a SINGLE
|
|
224
|
+
* remediation line explains the `ECONNREFUSED` retry spam the dependent service
|
|
225
|
+
* windows emit — instead of leaving the operator to decode that spam themselves.
|
|
226
|
+
* Returns `[]` when there are no tunnels (nothing to show).
|
|
227
|
+
*/
|
|
228
|
+
export declare function formatTunnelHealth(health: TunnelHealth[]): string[];
|
|
229
|
+
/**
|
|
230
|
+
* Probe the routing-critical tunnel of a (Tailscale-rewritten) devOutput and
|
|
231
|
+
* return its name if the forwarder binds but does not ROUTE, else null.
|
|
232
|
+
*
|
|
233
|
+
* Only `temporal` is gated — it's the load-bearing VPC dependency (services die
|
|
234
|
+
* on a gRPC deadline when it's dead), and keying on it mirrors the vpn-direct
|
|
235
|
+
* reachability gate ({@link gateVpnDirectReachability}). A Tailscale forwarder
|
|
236
|
+
* accepts its local port even when its SOCKS upstream is dead or the joined
|
|
237
|
+
* tailnet doesn't route the VPC; such a forwarder tears the connection down
|
|
238
|
+
* within the grace window, so it fails the connection-HOLDS probe that a bare
|
|
239
|
+
* accept (the readiness gate's `waitForPort`) would pass (MESH-2169/MESH-2268).
|
|
240
|
+
*/
|
|
241
|
+
export declare function firstUnroutableTunnel(tunnels: Record<string, {
|
|
242
|
+
host: string;
|
|
243
|
+
port: number;
|
|
244
|
+
}>): Promise<string | null>;
|
|
245
|
+
/** Compute the preferred local port for an SSM tunnel. */
|
|
246
|
+
/** Tunnel backing for a dev session. */
|
|
247
|
+
export type Transport = "ssm" | "tailscale" | "vpn-direct";
|
|
248
|
+
/** What `startServices` should do for VPC tunnels. */
|
|
249
|
+
export interface TunnelPlan {
|
|
250
|
+
transport: Transport;
|
|
251
|
+
tailscale?: {
|
|
252
|
+
tenant: string;
|
|
253
|
+
env: string;
|
|
254
|
+
region: string;
|
|
255
|
+
loginServer: string;
|
|
256
|
+
socksPort: number;
|
|
257
|
+
preAuthKey?: string;
|
|
258
|
+
};
|
|
259
|
+
/** True when the user EXPLICITLY asked for this transport (`--transport <x>`),
|
|
260
|
+
* vs an auto-resolved default. An explicit tailscale choice must NOT silently
|
|
261
|
+
* fall back to SSM — surface the failure so the user can act (MESH-2098). */
|
|
262
|
+
explicit?: boolean;
|
|
263
|
+
}
|
|
264
|
+
/**
|
|
265
|
+
* Resolve which tunnel backing `mesh dev` should use.
|
|
266
|
+
*
|
|
267
|
+
* An explicit `--transport` flag wins. Both `auto` and the default (unset)
|
|
268
|
+
* prefer Tailscale when it's available (brew `tailscaled` present), else fall
|
|
269
|
+
* back to the VPN-direct/SSM choice: VPN-direct when the VPN is connected, else
|
|
270
|
+
* SSM when the session-manager plugin is present. Where Tailscale isn't
|
|
271
|
+
* available the behavior is unchanged from before this feature.
|
|
272
|
+
*/
|
|
273
|
+
export declare function resolveTransport(flag: string | undefined, ctx: {
|
|
274
|
+
vpnConnected: boolean;
|
|
275
|
+
hasSsmPlugin: boolean;
|
|
276
|
+
tailscaleAvailable: boolean;
|
|
277
|
+
}): Transport;
|
|
278
|
+
/** Outcome of the reachability gate — `transport` is what to use, `reason` drives the log. */
|
|
279
|
+
export type ReachabilityDecision = {
|
|
280
|
+
transport: Transport;
|
|
281
|
+
reason: "not-vpn-direct" | "reachable" | "fallback-ssm" | "unreachable-no-plugin";
|
|
282
|
+
};
|
|
283
|
+
/**
|
|
284
|
+
* Correct an auto-selected `vpn-direct` transport against ACTUAL reachability of
|
|
285
|
+
* the Temporal VPC endpoint (MESH-2016). `resolveTransport` uses a presence check
|
|
286
|
+
* (any Tailscale/VPN up) that's tailnet-blind — Tailscale-for-SSH looks connected
|
|
287
|
+
* but doesn't route the mesh VPC. Only `vpn-direct` is reachability-gated (it's
|
|
288
|
+
* never an explicit choice); every other transport passes through unchanged.
|
|
289
|
+
*
|
|
290
|
+
* Pure so the fallback logic is testable independently of the TCP probe.
|
|
291
|
+
*/
|
|
292
|
+
export declare function reachabilityFallbackTransport(transport: Transport, temporalReachable: boolean, hasSsmPlugin: boolean): ReachabilityDecision;
|
|
293
|
+
export declare function preferredSsmLocalPort(remotePort: number): number;
|
|
294
|
+
/**
|
|
295
|
+
* Reserve a deterministic local-port candidate for an SSM tunnel.
|
|
296
|
+
*
|
|
297
|
+
* This prevents two tunnels with the same remote port (common for HTTPS
|
|
298
|
+
* endpoints) from being assigned the same localhost port before the AWS CLI
|
|
299
|
+
* has a chance to bind it.
|
|
300
|
+
*/
|
|
301
|
+
export declare function reserveSsmLocalPortCandidate(remotePort: number, reservedPorts: Set<number>, startAt?: number): number;
|
|
16
302
|
export declare function registerDevCommand(program: Command): void;
|
|
303
|
+
export {};
|
|
17
304
|
//# sourceMappingURL=dev.d.ts.map
|