@mesh-tech/mesh-cli 0.1.1 → 0.12.1
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 +20878 -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 +28 -0
- package/dist/src/commands/install-shim.d.ts.map +1 -0
- package/dist/src/commands/install-shim.js +191 -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 +1 -0
- package/dist/src/commands/secrets/set.d.ts.map +1 -1
- package/dist/src/commands/secrets/set.js +96 -2
- 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 +36 -22
- 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,106 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* First-boot seeding for the `mesh start` local platform.
|
|
3
|
+
*
|
|
4
|
+
* Registers tenant `local` / env `dev` in the local AWS fabric's (ministack)
|
|
5
|
+
* SSM registry with the same shape TenantEnvironments writes in the cloud
|
|
6
|
+
* (/mesh-platform/{tenant}/{env}/app-tenants → TenantEnvironmentsExports), and
|
|
7
|
+
* creates the tenant artifacts bucket. Idempotent — parameters are overwritten,
|
|
8
|
+
* the bucket create tolerates "already owned by you".
|
|
9
|
+
*
|
|
10
|
+
* Zitadel org/project/CLI-app + test-user seeding (the `mesh login local`
|
|
11
|
+
* path) is tracked as a follow-up on the mesh start epic.
|
|
12
|
+
*/
|
|
13
|
+
export declare const LOCAL_TENANT = "local";
|
|
14
|
+
export declare const LOCAL_ENV = "dev";
|
|
15
|
+
export declare const LOCAL_AWS_ENDPOINT = "http://localhost:4566";
|
|
16
|
+
export declare const LOCAL_AWS_REGION = "us-east-2";
|
|
17
|
+
export declare const ARTIFACTS_BUCKET = "mesh-local-artifacts";
|
|
18
|
+
export declare const APP_TENANTS_PARAM = "/mesh-platform/local/dev/app-tenants";
|
|
19
|
+
export declare const LOCAL_AWS_CONFIG: {
|
|
20
|
+
endpoint: string;
|
|
21
|
+
region: string;
|
|
22
|
+
credentials: {
|
|
23
|
+
accessKeyId: string;
|
|
24
|
+
secretAccessKey: string;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Env vars that point any AWS SDK process on the host at the local fabric —
|
|
29
|
+
* the SDK-native endpoint override (AWS_ENDPOINT_URL, supported since SDK JS
|
|
30
|
+
* v3 ~3.428), so no client-code changes are needed. `mesh dev` local mode
|
|
31
|
+
* injects these into app processes; humans can `eval` them from the
|
|
32
|
+
* `mesh start` output. In-network services get the same wiring with
|
|
33
|
+
* http://ministack:4566 (see the compose file's x-local-aws-env anchor).
|
|
34
|
+
*/
|
|
35
|
+
export declare function localAwsEnv(): Record<string, string>;
|
|
36
|
+
/**
|
|
37
|
+
* The local tenant registration, shaped like TenantEnvironmentsExports
|
|
38
|
+
* (libs/infra-components …/platform/TenantEnvironments.ts) so consumers of the
|
|
39
|
+
* registry (Hub API, init checks) read local and cloud identically. AWS-only
|
|
40
|
+
* fields carry inert local placeholders.
|
|
41
|
+
*/
|
|
42
|
+
export declare function buildAppTenantsSeed(): {
|
|
43
|
+
hubTenant: string;
|
|
44
|
+
primaryTenant: {
|
|
45
|
+
albGroupName: string;
|
|
46
|
+
certificateArn: string;
|
|
47
|
+
baseDomain: string;
|
|
48
|
+
deployerRoleArn: string;
|
|
49
|
+
artifactsBucket: string;
|
|
50
|
+
spicedb: {
|
|
51
|
+
endpoint: string;
|
|
52
|
+
presharedKeySecret: string;
|
|
53
|
+
};
|
|
54
|
+
zitadel: {
|
|
55
|
+
orgId: string;
|
|
56
|
+
domain: string;
|
|
57
|
+
issuer: string;
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
sharedTenants: {};
|
|
61
|
+
};
|
|
62
|
+
export interface SeedResult {
|
|
63
|
+
parameter: string;
|
|
64
|
+
bucket: string;
|
|
65
|
+
}
|
|
66
|
+
export declare const FABRIC_CHECK_PATH = "/mesh-platform/local/dev/.fabric-check";
|
|
67
|
+
/** The tenant's Temporal namespace, matching the cloud convention
|
|
68
|
+
* TemporalNamespaceProvisioner uses ({tenant}-{env}, e.g. "acme-dev"). */
|
|
69
|
+
export declare const TEMPORAL_NAMESPACE = "local-dev";
|
|
70
|
+
export declare const TEMPORAL_ADDRESS = "localhost:7233";
|
|
71
|
+
/**
|
|
72
|
+
* Register the local tenant's Temporal namespace ({tenant}-{env} — the same
|
|
73
|
+
* name TemporalNamespaceProvisioner would create in the cloud). Idempotent:
|
|
74
|
+
* "already exists" is success. Dynamic import — @temporalio/client is an
|
|
75
|
+
* optionalDependency (same pattern as commands/temporal.ts).
|
|
76
|
+
*/
|
|
77
|
+
export declare function seedTemporalNamespace(): Promise<void>;
|
|
78
|
+
/**
|
|
79
|
+
* Idempotently register a Temporal namespace. `mesh dev --local` uses this
|
|
80
|
+
* for the per-app namespaces ({tenant}-{env}-{app}) the cloud provisioner
|
|
81
|
+
* creates — the Hub's per-app workflow views resolve exactly that name.
|
|
82
|
+
*/
|
|
83
|
+
export declare function ensureTemporalNamespace(namespace: string, description?: string): Promise<void>;
|
|
84
|
+
/**
|
|
85
|
+
* A deterministic >4 KB payload for the Advanced-tier round-trip. Standard
|
|
86
|
+
* SSM params cap at 4 KB; mesh.exports.Export writes tier "Advanced" values
|
|
87
|
+
* up to 8 KB (Export.ts), and the emulator's fidelity there is the one open
|
|
88
|
+
* question the design (§2.5) requires this check to answer on every boot.
|
|
89
|
+
*/
|
|
90
|
+
export declare function buildFabricCheckPayload(targetBytes?: number): string;
|
|
91
|
+
/**
|
|
92
|
+
* Verify the local AWS fabric behaves like real SSM where the platform
|
|
93
|
+
* depends on it: an 8 KB Advanced-tier parameter round-trips intact, and
|
|
94
|
+
* child parameters under a path come back via GetParametersByPath (the
|
|
95
|
+
* shape mesh.exports.Export's splitKeys mode reads). Check params are
|
|
96
|
+
* removed afterwards.
|
|
97
|
+
*/
|
|
98
|
+
export declare function verifyFabric(): Promise<void>;
|
|
99
|
+
/** Write the Hub-readable tenant + environment registrations (the shapes
|
|
100
|
+
* hub-api's SSM assembler requires: RawTenant at /{tenant}, RawEnvironment
|
|
101
|
+
* at /{tenant}/{env}). Exported for reuse by app-tenant provisioning. */
|
|
102
|
+
export declare function registerTenantEnv(tenant: string, opts?: {
|
|
103
|
+
tier?: "hub" | "dedicated" | "shared";
|
|
104
|
+
}): Promise<void>;
|
|
105
|
+
export declare function seedLocalPlatform(): Promise<SeedResult>;
|
|
106
|
+
//# sourceMappingURL=seed.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"seed.d.ts","sourceRoot":"","sources":["../../../../src/commands/local/seed.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAKH,eAAO,MAAM,YAAY,UAAU,CAAC;AACpC,eAAO,MAAM,SAAS,QAAQ,CAAC;AAC/B,eAAO,MAAM,kBAAkB,0BAA0B,CAAC;AAC1D,eAAO,MAAM,gBAAgB,cAAc,CAAC;AAC5C,eAAO,MAAM,gBAAgB,yBAAyB,CAAC;AACvD,eAAO,MAAM,iBAAiB,yCAA4D,CAAC;AAE3F,eAAO,MAAM,gBAAgB;;;;;;;CAI5B,CAAC;AAGF;;;;;;;GAOG;AACH,wBAAgB,WAAW,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAOpD;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB;;;;;;;;;;;;;;;;;;;EAsBlC;AAED,MAAM,WAAW,UAAU;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,iBAAiB,2CAA8D,CAAC;AAE7F;0EAC0E;AAC1E,eAAO,MAAM,kBAAkB,cAAiC,CAAC;AACjE,eAAO,MAAM,gBAAgB,mBAAmB,CAAC;AAEjD;;;;;GAKG;AACH,wBAAsB,qBAAqB,IAAI,OAAO,CAAC,IAAI,CAAC,CAK3D;AAED;;;;GAIG;AACH,wBAAsB,uBAAuB,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAsCpG;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,WAAW,SAAQ,GAAG,MAAM,CAInE;AAED;;;;;;GAMG;AACH,wBAAsB,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC,CA0DlD;AAED;;yEAEyE;AACzE,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,MAAM,EACd,IAAI,GAAE;IAAE,IAAI,CAAC,EAAE,KAAK,GAAG,WAAW,GAAG,QAAQ,CAAA;CAAO,GACnD,OAAO,CAAC,IAAI,CAAC,CA4Bf;AAED,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,UAAU,CAAC,CA+B7D"}
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* First-boot seeding for the `mesh start` local platform.
|
|
3
|
+
*
|
|
4
|
+
* Registers tenant `local` / env `dev` in the local AWS fabric's (ministack)
|
|
5
|
+
* SSM registry with the same shape TenantEnvironments writes in the cloud
|
|
6
|
+
* (/mesh-platform/{tenant}/{env}/app-tenants → TenantEnvironmentsExports), and
|
|
7
|
+
* creates the tenant artifacts bucket. Idempotent — parameters are overwritten,
|
|
8
|
+
* the bucket create tolerates "already owned by you".
|
|
9
|
+
*
|
|
10
|
+
* Zitadel org/project/CLI-app + test-user seeding (the `mesh login local`
|
|
11
|
+
* path) is tracked as a follow-up on the mesh start epic.
|
|
12
|
+
*/
|
|
13
|
+
import { logInfo, logSuccess } from "../../utils/log.js";
|
|
14
|
+
import { MeshCliError } from "../../utils/errors.js";
|
|
15
|
+
export const LOCAL_TENANT = "local";
|
|
16
|
+
export const LOCAL_ENV = "dev";
|
|
17
|
+
export const LOCAL_AWS_ENDPOINT = "http://localhost:4566";
|
|
18
|
+
export const LOCAL_AWS_REGION = "us-east-2";
|
|
19
|
+
export const ARTIFACTS_BUCKET = "mesh-local-artifacts";
|
|
20
|
+
export const APP_TENANTS_PARAM = `/mesh-platform/${LOCAL_TENANT}/${LOCAL_ENV}/app-tenants`;
|
|
21
|
+
export const LOCAL_AWS_CONFIG = {
|
|
22
|
+
endpoint: LOCAL_AWS_ENDPOINT,
|
|
23
|
+
region: LOCAL_AWS_REGION,
|
|
24
|
+
credentials: { accessKeyId: "test", secretAccessKey: "test" },
|
|
25
|
+
};
|
|
26
|
+
const AWS_CONFIG = LOCAL_AWS_CONFIG;
|
|
27
|
+
/**
|
|
28
|
+
* Env vars that point any AWS SDK process on the host at the local fabric —
|
|
29
|
+
* the SDK-native endpoint override (AWS_ENDPOINT_URL, supported since SDK JS
|
|
30
|
+
* v3 ~3.428), so no client-code changes are needed. `mesh dev` local mode
|
|
31
|
+
* injects these into app processes; humans can `eval` them from the
|
|
32
|
+
* `mesh start` output. In-network services get the same wiring with
|
|
33
|
+
* http://ministack:4566 (see the compose file's x-local-aws-env anchor).
|
|
34
|
+
*/
|
|
35
|
+
export function localAwsEnv() {
|
|
36
|
+
return {
|
|
37
|
+
AWS_ENDPOINT_URL: LOCAL_AWS_ENDPOINT,
|
|
38
|
+
AWS_REGION: LOCAL_AWS_REGION,
|
|
39
|
+
AWS_ACCESS_KEY_ID: "test",
|
|
40
|
+
AWS_SECRET_ACCESS_KEY: "test",
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* The local tenant registration, shaped like TenantEnvironmentsExports
|
|
45
|
+
* (libs/infra-components …/platform/TenantEnvironments.ts) so consumers of the
|
|
46
|
+
* registry (Hub API, init checks) read local and cloud identically. AWS-only
|
|
47
|
+
* fields carry inert local placeholders.
|
|
48
|
+
*/
|
|
49
|
+
export function buildAppTenantsSeed() {
|
|
50
|
+
const tenantExport = {
|
|
51
|
+
albGroupName: LOCAL_TENANT,
|
|
52
|
+
certificateArn: "",
|
|
53
|
+
baseDomain: "localhost",
|
|
54
|
+
deployerRoleArn: "arn:aws:iam::000000000000:role/local-dev-deployer",
|
|
55
|
+
artifactsBucket: ARTIFACTS_BUCKET,
|
|
56
|
+
spicedb: {
|
|
57
|
+
endpoint: "localhost:50051",
|
|
58
|
+
presharedKeySecret: "local-dev-key",
|
|
59
|
+
},
|
|
60
|
+
zitadel: {
|
|
61
|
+
orgId: "local",
|
|
62
|
+
domain: "localhost:8080",
|
|
63
|
+
issuer: "http://localhost:8080",
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
return {
|
|
67
|
+
hubTenant: LOCAL_TENANT,
|
|
68
|
+
primaryTenant: tenantExport,
|
|
69
|
+
sharedTenants: {},
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
export const FABRIC_CHECK_PATH = `/mesh-platform/${LOCAL_TENANT}/${LOCAL_ENV}/.fabric-check`;
|
|
73
|
+
/** The tenant's Temporal namespace, matching the cloud convention
|
|
74
|
+
* TemporalNamespaceProvisioner uses ({tenant}-{env}, e.g. "acme-dev"). */
|
|
75
|
+
export const TEMPORAL_NAMESPACE = `${LOCAL_TENANT}-${LOCAL_ENV}`;
|
|
76
|
+
export const TEMPORAL_ADDRESS = "localhost:7233";
|
|
77
|
+
/**
|
|
78
|
+
* Register the local tenant's Temporal namespace ({tenant}-{env} — the same
|
|
79
|
+
* name TemporalNamespaceProvisioner would create in the cloud). Idempotent:
|
|
80
|
+
* "already exists" is success. Dynamic import — @temporalio/client is an
|
|
81
|
+
* optionalDependency (same pattern as commands/temporal.ts).
|
|
82
|
+
*/
|
|
83
|
+
export async function seedTemporalNamespace() {
|
|
84
|
+
await ensureTemporalNamespace(TEMPORAL_NAMESPACE, `Mesh local tenant '${LOCAL_TENANT}' env '${LOCAL_ENV}' (seeded by mesh start)`);
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Idempotently register a Temporal namespace. `mesh dev --local` uses this
|
|
88
|
+
* for the per-app namespaces ({tenant}-{env}-{app}) the cloud provisioner
|
|
89
|
+
* creates — the Hub's per-app workflow views resolve exactly that name.
|
|
90
|
+
*/
|
|
91
|
+
export async function ensureTemporalNamespace(namespace, description) {
|
|
92
|
+
const { Connection } = await import("@temporalio/client");
|
|
93
|
+
const connection = await Connection.connect({ address: TEMPORAL_ADDRESS });
|
|
94
|
+
try {
|
|
95
|
+
await connection.workflowService.registerNamespace({
|
|
96
|
+
namespace,
|
|
97
|
+
description: description ?? `Mesh local namespace '${namespace}'`,
|
|
98
|
+
// protobufjs accepts plain numbers for int64 at runtime; the generated
|
|
99
|
+
// typing insists on Long (whose package isn't a direct dep), hence any.
|
|
100
|
+
workflowExecutionRetentionPeriod: { seconds: (3 * 24 * 60 * 60) },
|
|
101
|
+
});
|
|
102
|
+
// A freshly registered namespace isn't usable until the frontend's
|
|
103
|
+
// namespace cache refreshes (~10s) — a worker connecting immediately
|
|
104
|
+
// would die on "Namespace not found". Wait it out once, here.
|
|
105
|
+
logInfo(`Registered Temporal namespace '${namespace}' — waiting for it to become active…`);
|
|
106
|
+
const deadline = Date.now() + 20_000;
|
|
107
|
+
while (Date.now() < deadline) {
|
|
108
|
+
try {
|
|
109
|
+
await connection.workflowService.describeTaskQueue({
|
|
110
|
+
namespace,
|
|
111
|
+
taskQueue: { name: "namespace-propagation-probe" },
|
|
112
|
+
taskQueueType: 1,
|
|
113
|
+
});
|
|
114
|
+
break;
|
|
115
|
+
}
|
|
116
|
+
catch {
|
|
117
|
+
await new Promise((resolve) => setTimeout(resolve, 1_000));
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
logSuccess(`Temporal namespace '${namespace}' is active`);
|
|
121
|
+
}
|
|
122
|
+
catch (err) {
|
|
123
|
+
if (err?.name === "NamespaceAlreadyExistsError" || /already exists/i.test(err?.message ?? "")) {
|
|
124
|
+
logInfo(`Temporal namespace '${namespace}' already exists`);
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
throw err;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
finally {
|
|
131
|
+
await connection.close();
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* A deterministic >4 KB payload for the Advanced-tier round-trip. Standard
|
|
136
|
+
* SSM params cap at 4 KB; mesh.exports.Export writes tier "Advanced" values
|
|
137
|
+
* up to 8 KB (Export.ts), and the emulator's fidelity there is the one open
|
|
138
|
+
* question the design (§2.5) requires this check to answer on every boot.
|
|
139
|
+
*/
|
|
140
|
+
export function buildFabricCheckPayload(targetBytes = 8_000) {
|
|
141
|
+
const base = { probe: "advanced-tier-round-trip", tenant: LOCAL_TENANT, env: LOCAL_ENV, pad: "" };
|
|
142
|
+
const overhead = JSON.stringify(base).length;
|
|
143
|
+
return JSON.stringify({ ...base, pad: "x".repeat(Math.max(0, targetBytes - overhead)) });
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Verify the local AWS fabric behaves like real SSM where the platform
|
|
147
|
+
* depends on it: an 8 KB Advanced-tier parameter round-trips intact, and
|
|
148
|
+
* child parameters under a path come back via GetParametersByPath (the
|
|
149
|
+
* shape mesh.exports.Export's splitKeys mode reads). Check params are
|
|
150
|
+
* removed afterwards.
|
|
151
|
+
*/
|
|
152
|
+
export async function verifyFabric() {
|
|
153
|
+
const { SSMClient, PutParameterCommand, GetParameterCommand, GetParametersByPathCommand, DeleteParametersCommand } = await import("@aws-sdk/client-ssm");
|
|
154
|
+
const ssm = new SSMClient(AWS_CONFIG);
|
|
155
|
+
const payload = buildFabricCheckPayload();
|
|
156
|
+
const mainParam = FABRIC_CHECK_PATH;
|
|
157
|
+
const childParams = [`${FABRIC_CHECK_PATH}/vpc`, `${FABRIC_CHECK_PATH}/eks`];
|
|
158
|
+
try {
|
|
159
|
+
await ssm.send(new PutParameterCommand({
|
|
160
|
+
Name: mainParam,
|
|
161
|
+
Type: "String",
|
|
162
|
+
Tier: "Advanced",
|
|
163
|
+
Overwrite: true,
|
|
164
|
+
Value: payload,
|
|
165
|
+
}));
|
|
166
|
+
for (const name of childParams) {
|
|
167
|
+
await ssm.send(new PutParameterCommand({ Name: name, Type: "String", Overwrite: true, Value: `{"probe":"${name}"}` }));
|
|
168
|
+
}
|
|
169
|
+
const roundTrip = await ssm.send(new GetParameterCommand({ Name: mainParam }));
|
|
170
|
+
if (roundTrip.Parameter?.Value !== payload) {
|
|
171
|
+
throw new MeshCliError(`Local AWS fabric failed the ${payload.length}-byte Advanced-tier SSM round-trip (got ${roundTrip.Parameter?.Value?.length ?? 0} bytes back).`, {
|
|
172
|
+
remediation: {
|
|
173
|
+
docs: "libs/mesh-cli/stack/docker-compose.yml — swap the ministack image for motoserver/moto (design §2.5 fallback)",
|
|
174
|
+
},
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
const byPath = await ssm.send(new GetParametersByPathCommand({ Path: FABRIC_CHECK_PATH, Recursive: true }));
|
|
178
|
+
const returned = new Set((byPath.Parameters ?? []).map((p) => p.Name));
|
|
179
|
+
const missing = childParams.filter((name) => !returned.has(name));
|
|
180
|
+
if (missing.length > 0) {
|
|
181
|
+
throw new MeshCliError(`Local AWS fabric's GetParametersByPath missed child parameter(s): ${missing.join(", ")} (splitKeys exports would not resolve).`, {
|
|
182
|
+
remediation: {
|
|
183
|
+
docs: "libs/mesh-cli/stack/docker-compose.yml — swap the ministack image for motoserver/moto (design §2.5 fallback)",
|
|
184
|
+
},
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
logSuccess(`Fabric check passed: ${payload.length}-byte Advanced-tier round-trip + GetParametersByPath`);
|
|
188
|
+
}
|
|
189
|
+
finally {
|
|
190
|
+
await ssm
|
|
191
|
+
.send(new DeleteParametersCommand({ Names: [mainParam, ...childParams] }))
|
|
192
|
+
.catch(() => { });
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
/** Write the Hub-readable tenant + environment registrations (the shapes
|
|
196
|
+
* hub-api's SSM assembler requires: RawTenant at /{tenant}, RawEnvironment
|
|
197
|
+
* at /{tenant}/{env}). Exported for reuse by app-tenant provisioning. */
|
|
198
|
+
export async function registerTenantEnv(tenant, opts = {}) {
|
|
199
|
+
const { SSMClient, PutParameterCommand } = await import("@aws-sdk/client-ssm");
|
|
200
|
+
const ssm = new SSMClient(AWS_CONFIG);
|
|
201
|
+
await ssm.send(new PutParameterCommand({
|
|
202
|
+
Name: `/mesh-platform/${tenant}`,
|
|
203
|
+
Type: "String",
|
|
204
|
+
Overwrite: true,
|
|
205
|
+
Value: JSON.stringify({ name: tenant, tier: opts.tier ?? "shared", subdomain: tenant }),
|
|
206
|
+
Description: `Tenant registration (seeded by mesh CLI, local platform)`,
|
|
207
|
+
}));
|
|
208
|
+
await ssm.send(new PutParameterCommand({
|
|
209
|
+
Name: `/mesh-platform/${tenant}/${LOCAL_ENV}`,
|
|
210
|
+
Type: "String",
|
|
211
|
+
Overwrite: true,
|
|
212
|
+
Value: JSON.stringify({
|
|
213
|
+
env: LOCAL_ENV,
|
|
214
|
+
region: LOCAL_AWS_REGION,
|
|
215
|
+
baseDomain: "localhost",
|
|
216
|
+
// monitoring is true: the local stack runs the same Loki/Tempo/
|
|
217
|
+
// Prometheus backends the hosted platform provides.
|
|
218
|
+
services: { temporal: true, zitadel: true, monitoring: true },
|
|
219
|
+
}),
|
|
220
|
+
Description: `Environment registration (seeded by mesh CLI, local platform)`,
|
|
221
|
+
}));
|
|
222
|
+
}
|
|
223
|
+
export async function seedLocalPlatform() {
|
|
224
|
+
const { SSMClient, PutParameterCommand } = await import("@aws-sdk/client-ssm");
|
|
225
|
+
const ssm = new SSMClient(AWS_CONFIG);
|
|
226
|
+
await ssm.send(new PutParameterCommand({
|
|
227
|
+
Name: APP_TENANTS_PARAM,
|
|
228
|
+
Type: "String",
|
|
229
|
+
Overwrite: true,
|
|
230
|
+
Value: JSON.stringify(buildAppTenantsSeed()),
|
|
231
|
+
Description: `TenantEnvironments exports for ${LOCAL_TENANT}-${LOCAL_ENV} (seeded by mesh start)`,
|
|
232
|
+
}));
|
|
233
|
+
await registerTenantEnv(LOCAL_TENANT, { tier: "hub" });
|
|
234
|
+
logSuccess(`Registered tenant '${LOCAL_TENANT}' env '${LOCAL_ENV}' → ${APP_TENANTS_PARAM}`);
|
|
235
|
+
const { S3Client, CreateBucketCommand } = await import("@aws-sdk/client-s3");
|
|
236
|
+
const s3 = new S3Client({ ...AWS_CONFIG, forcePathStyle: true });
|
|
237
|
+
try {
|
|
238
|
+
await s3.send(new CreateBucketCommand({ Bucket: ARTIFACTS_BUCKET }));
|
|
239
|
+
logSuccess(`Created artifacts bucket s3://${ARTIFACTS_BUCKET}`);
|
|
240
|
+
}
|
|
241
|
+
catch (err) {
|
|
242
|
+
if (err?.name === "BucketAlreadyOwnedByYou" || err?.name === "BucketAlreadyExists") {
|
|
243
|
+
logInfo(`Artifacts bucket s3://${ARTIFACTS_BUCKET} already exists`);
|
|
244
|
+
}
|
|
245
|
+
else {
|
|
246
|
+
throw err;
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
await seedTemporalNamespace();
|
|
250
|
+
return { parameter: APP_TENANTS_PARAM, bucket: ARTIFACTS_BUCKET };
|
|
251
|
+
}
|
|
252
|
+
//# sourceMappingURL=seed.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"seed.js","sourceRoot":"","sources":["../../../../src/commands/local/seed.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErD,MAAM,CAAC,MAAM,YAAY,GAAG,OAAO,CAAC;AACpC,MAAM,CAAC,MAAM,SAAS,GAAG,KAAK,CAAC;AAC/B,MAAM,CAAC,MAAM,kBAAkB,GAAG,uBAAuB,CAAC;AAC1D,MAAM,CAAC,MAAM,gBAAgB,GAAG,WAAW,CAAC;AAC5C,MAAM,CAAC,MAAM,gBAAgB,GAAG,sBAAsB,CAAC;AACvD,MAAM,CAAC,MAAM,iBAAiB,GAAG,kBAAkB,YAAY,IAAI,SAAS,cAAc,CAAC;AAE3F,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,QAAQ,EAAE,kBAAkB;IAC5B,MAAM,EAAE,gBAAgB;IACxB,WAAW,EAAE,EAAE,WAAW,EAAE,MAAM,EA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C,gBAAgB,EAAE,CAAC,CAAC;IAClE,CAAC;IAAC,OAAO,GAAQ,EAAE,CAAC;QAClB,IAAI,GAAG,EAAE,IAAI,KAAK,yBAAyB,IAAI,GAAG,EAAE,IAAI,KAAK,qBAAqB,EAAE,CAAC;YACnF,OAAO,CAAC,yBAAyB,gBAAgB,iBAAiB,CAAC,CAAC;QACtE,CAAC;aAAM,CAAC;YACN,MAAM,GAAG,CAAC;QACZ,CAAC;IACH,CAAC;IAED,MAAM,qBAAqB,EAAE,CAAC;IAE9B,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,EAAE,gBAAgB,EAAE,CAAC;AACpE,CAAC"}
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Helpers for the `mesh start/stop/status` full-local platform stack.
|
|
3
|
+
*
|
|
4
|
+
* The docker compose project (name `mesh-local`) ships inside the CLI package
|
|
5
|
+
* at `<package root>/stack/`, so the stack works in any repo with only Docker
|
|
6
|
+
* installed and is version-locked to the CLI.
|
|
7
|
+
*/
|
|
8
|
+
export declare const COMPOSE_PROJECT = "mesh-local";
|
|
9
|
+
/**
|
|
10
|
+
* Host directory `mesh dev --local` writes service logs into
|
|
11
|
+
* ({namespace}/{service}.log). The stack's OTel collector tails it (filelog
|
|
12
|
+
* receiver) and ships to Loki with the hosted k8s_* label scheme, so the
|
|
13
|
+
* Hub's logs view works on local runs unchanged.
|
|
14
|
+
*/
|
|
15
|
+
export declare function localLogsDir(): string;
|
|
16
|
+
/**
|
|
17
|
+
* Host directory holding blackbox probe targets (Prometheus file_sd JSON) —
|
|
18
|
+
* written by `mesh dev --externals` for external services, mounted into the
|
|
19
|
+
* stack's Prometheus. The local analog of the hosted Probe CRs.
|
|
20
|
+
*/
|
|
21
|
+
export declare function localProbesDir(): string;
|
|
22
|
+
/** Endpoints the local stack exposes on the host. */
|
|
23
|
+
export interface StackEndpoint {
|
|
24
|
+
service: string;
|
|
25
|
+
label: string;
|
|
26
|
+
url: string;
|
|
27
|
+
/** How `mesh status` probes it from the host */
|
|
28
|
+
probe: {
|
|
29
|
+
kind: "http";
|
|
30
|
+
url: string;
|
|
31
|
+
} | {
|
|
32
|
+
kind: "tcp";
|
|
33
|
+
port: number;
|
|
34
|
+
} | {
|
|
35
|
+
kind: "none";
|
|
36
|
+
};
|
|
37
|
+
/** Extra hint printed under the endpoint (credentials, tokens, …) */
|
|
38
|
+
hint?: string;
|
|
39
|
+
}
|
|
40
|
+
export declare const STACK_ENDPOINTS: StackEndpoint[];
|
|
41
|
+
/** Default host port for the containerized local Hub. `mesh hub dev` derives
|
|
42
|
+
* its dev-server default from this too (hub/index.ts), so the two Hubs share
|
|
43
|
+
* one source for "9000" while keeping separate override variables
|
|
44
|
+
* (MESH_HUB_PORT here, MESH_HUB_DEV_PORT there). */
|
|
45
|
+
export declare const DEFAULT_HUB_PORT = "9000";
|
|
46
|
+
/**
|
|
47
|
+
* Host port the Hub is published on (docker-compose.hub.yml binds
|
|
48
|
+
* `${MESH_HUB_PORT:-9000}:4180`). Override with MESH_HUB_PORT to run the
|
|
49
|
+
* local Hub beside another process that owns 9000 — e.g. a hub-ui dev
|
|
50
|
+
* server running from a different checkout. Export it for BOTH `mesh start`
|
|
51
|
+
* and later `mesh status` calls: the compose file and these probes read the
|
|
52
|
+
* same variable (MESH-2256 tracks deriving it from the running stack so
|
|
53
|
+
* `mesh status` stops depending on shell hygiene). `mesh start` reconciles
|
|
54
|
+
* the seeded Zitadel Hub app's redirect URIs to include the chosen port —
|
|
55
|
+
* Zitadel requires every redirect URI to be registered even in devMode
|
|
56
|
+
* (devMode only allows http).
|
|
57
|
+
*
|
|
58
|
+
* Empty string falls back like compose's `${MESH_HUB_PORT:-9000}` does —
|
|
59
|
+
* `??` alone would diverge (probe `:`, publish 9000).
|
|
60
|
+
*/
|
|
61
|
+
export declare function hubPort(): string;
|
|
62
|
+
/** Hub overlay endpoints — probed only when the hub containers exist.
|
|
63
|
+
* A function (not a module constant) so hubPort() is read at call time:
|
|
64
|
+
* the CLI's env is fixed before node starts, but tests and programmatic
|
|
65
|
+
* callers set MESH_HUB_PORT after import. */
|
|
66
|
+
export declare function hubEndpoints(): StackEndpoint[];
|
|
67
|
+
/**
|
|
68
|
+
* Locate the CLI package root (the directory whose package.json is
|
|
69
|
+
* @mesh-tech/mesh-cli). Works from both the compiled layout (dist/src/…)
|
|
70
|
+
* and the source layout (src/… under tsx).
|
|
71
|
+
*/
|
|
72
|
+
export declare function findPackageRoot(startDir?: string): string;
|
|
73
|
+
export declare function stackDir(): string;
|
|
74
|
+
/** The compose overlay that declares the Hub services. */
|
|
75
|
+
export declare const HUB_OVERLAY_FILE = "docker-compose.hub.yml";
|
|
76
|
+
/** Top-level service names a compose file declares. Pure — takes the file text. */
|
|
77
|
+
export declare function parseComposeServiceNames(yamlText: string): string[];
|
|
78
|
+
/**
|
|
79
|
+
* The services the Hub overlay — and only the overlay — declares.
|
|
80
|
+
*
|
|
81
|
+
* Read from `docker-compose.hub.yml` rather than hard-coded beside
|
|
82
|
+
* ONE_SHOT_SERVICES on purpose: a second name list rots the moment the
|
|
83
|
+
* overlay gains or renames a service. (It already declares three — hub-api,
|
|
84
|
+
* hub-ui, hub-auth — not the two the Hub is usually described by.)
|
|
85
|
+
*/
|
|
86
|
+
export declare function hubOverlayServices(): ReadonlySet<string>;
|
|
87
|
+
/**
|
|
88
|
+
* The compose project is a MACHINE-WIDE singleton (`mesh-local`), but any
|
|
89
|
+
* checkout of the CLI can drive it — and `docker compose up` from a checkout
|
|
90
|
+
* whose stack config differs will recreate shared containers out from under
|
|
91
|
+
* whatever else is running against the stack (a second project's `mesh dev`
|
|
92
|
+
* session, a Hub built from another worktree, …).
|
|
93
|
+
*
|
|
94
|
+
* Returns the working dir of the checkout that last (re)created the running
|
|
95
|
+
* stack when it is NOT this one; undefined when the stack isn't running or
|
|
96
|
+
* is already owned here. Callers gate lifecycle commands on it.
|
|
97
|
+
*/
|
|
98
|
+
export declare function stackOwnedElsewhere(): string | undefined;
|
|
99
|
+
/** Throw a remediated error if the docker daemon isn't reachable. */
|
|
100
|
+
export declare function ensureDockerAvailable(): void;
|
|
101
|
+
/** Run `docker compose` against the packaged stack. `hub` adds the Hub
|
|
102
|
+
* overlay file (safe for ps/logs/down: services simply may not exist);
|
|
103
|
+
* `env` adds process-env overrides (e.g. MESH_HUB_VERSION). */
|
|
104
|
+
export declare function compose(args: string[], opts?: {
|
|
105
|
+
inherit?: boolean;
|
|
106
|
+
hub?: boolean;
|
|
107
|
+
env?: Record<string, string>;
|
|
108
|
+
}): string;
|
|
109
|
+
/**
|
|
110
|
+
* Pick the one line worth reading out of a failed compose run's output:
|
|
111
|
+
* the last error-looking line, else the last non-empty line (MESH-2479).
|
|
112
|
+
* Pure so the selection heuristic is unit-testable.
|
|
113
|
+
*/
|
|
114
|
+
export declare function summarizeComposeFailure(output: string): string;
|
|
115
|
+
/** Where a lifecycle command's full compose output is written (per operation). */
|
|
116
|
+
export declare function composeLogPath(op: string): string;
|
|
117
|
+
/**
|
|
118
|
+
* `docker compose` for lifecycle commands (`up -d`): stream output like
|
|
119
|
+
* `compose({inherit: true})` does, but never bury the failure — on a non-zero
|
|
120
|
+
* exit throw a one-line summary instead of leaving ~200 lines of pull/create
|
|
121
|
+
* noise as the only signal (MESH-2479). In non-TTY runs the output is also
|
|
122
|
+
* teed to a log file (named in the error) and a heartbeat fills long quiet
|
|
123
|
+
* stretches; interactive terminals keep docker's own progress rendering.
|
|
124
|
+
*/
|
|
125
|
+
export declare function composeStreamed(args: string[], opts?: {
|
|
126
|
+
hub?: boolean;
|
|
127
|
+
env?: Record<string, string>;
|
|
128
|
+
}): Promise<void>;
|
|
129
|
+
export interface ServiceStatus {
|
|
130
|
+
name: string;
|
|
131
|
+
state: string;
|
|
132
|
+
health?: string;
|
|
133
|
+
}
|
|
134
|
+
/** Parse `docker compose ps --format json` (NDJSON, one object per line). */
|
|
135
|
+
export declare function parseComposePs(output: string): ServiceStatus[];
|
|
136
|
+
export declare function stackServices(): ServiceStatus[];
|
|
137
|
+
/** Services expected to exit (one-shot jobs) — an `exited` state is fine. */
|
|
138
|
+
export declare const ONE_SHOT_SERVICES: Set<string>;
|
|
139
|
+
/**
|
|
140
|
+
* The services whose `exited` state is a real failure *right now*.
|
|
141
|
+
*
|
|
142
|
+
* `stackServices()` scans the whole `mesh-local` compose project, overlay
|
|
143
|
+
* included — but `mesh start` brings the base stack up first and the Hub
|
|
144
|
+
* overlay only afterwards. Before that point an `exited` hub container is a
|
|
145
|
+
* leftover from a previous run (a Docker restart, a laptop sleep), not a
|
|
146
|
+
* crash: the base `up -d` deliberately never started it. Counting it made
|
|
147
|
+
* `mesh start` abort before it ever tried to start the Hub, pointing at the
|
|
148
|
+
* wrong thing.
|
|
149
|
+
*
|
|
150
|
+
* Once the overlay HAS been started, an exited overlay service is a crash
|
|
151
|
+
* like any other — pass `overlayStarted: true` and the signal is preserved.
|
|
152
|
+
*/
|
|
153
|
+
export declare function crashedServices(services: ServiceStatus[], opts: {
|
|
154
|
+
overlayServices: ReadonlySet<string>;
|
|
155
|
+
overlayStarted: boolean;
|
|
156
|
+
}): ServiceStatus[];
|
|
157
|
+
/**
|
|
158
|
+
* Whether the Hub overlay is up in this run — i.e. at least one overlay
|
|
159
|
+
* container is actually `running`. `mesh status` has no other way to know
|
|
160
|
+
* (it never started anything), and "a container exists" is not it: a
|
|
161
|
+
* leftover `exited` one exists too.
|
|
162
|
+
*/
|
|
163
|
+
export declare function hubOverlayRunning(services: ServiceStatus[], overlayServices: ReadonlySet<string>): boolean;
|
|
164
|
+
/**
|
|
165
|
+
* Whether the Hub API is serving. `some(s => s.name === "hub-api")` is not
|
|
166
|
+
* the same question — that is true of a leftover exited container, and
|
|
167
|
+
* probing Hub endpoints that were never meant to be up this run reports the
|
|
168
|
+
* stack unhealthy for a Hub nobody started.
|
|
169
|
+
*/
|
|
170
|
+
export declare function hubApiRunning(services: ServiceStatus[]): boolean;
|
|
171
|
+
/** Probe a host endpoint (http 2xx-4xx counts as up; tcp connect counts as up). */
|
|
172
|
+
export declare function probeEndpoint(endpoint: StackEndpoint): Promise<boolean>;
|
|
173
|
+
//# sourceMappingURL=stack.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stack.d.ts","sourceRoot":"","sources":["../../../../src/commands/local/stack.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAYH,eAAO,MAAM,eAAe,eAAe,CAAC;AAE5C;;;;;GAKG;AACH,wBAAgB,YAAY,IAAI,MAAM,CAIrC;AAED;;;;GAIG;AACH,wBAAgB,cAAc,IAAI,MAAM,CAIvC;AAED,qDAAqD;AACrD,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,gDAAgD;IAChD,KAAK,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,GAAG;QAAE,IAAI,EAAE,KAAK,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IACxF,qEAAqE;IACrE,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,eAAO,MAAM,eAAe,EAAE,aAAa,EAuF1C,CAAC;AAEF;;;oDAGoD;AACpD,eAAO,MAAM,gBAAgB,SAAS,CAAC;AAEvC;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,OAAO,IAAI,MAAM,CAShC;AAED;;;6CAG6C;AAC7C,wBAAgB,YAAY,IAAI,aAAa,EAAE,CAgB9C;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAmBzD;AAED,wBAAgB,QAAQ,IAAI,MAAM,CAQjC;AAED,0DAA0D;AAC1D,eAAO,MAAM,gBAAgB,2BAA2B,CAAC;AAEzD,mFAAmF;AACn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