@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,499 @@
|
|
|
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
|
+
import { execFileSync, spawn, spawnSync } from "child_process";
|
|
9
|
+
import * as fs from "fs";
|
|
10
|
+
import { probeTcp } from "./helpers.js";
|
|
11
|
+
import * as os from "os";
|
|
12
|
+
import * as path from "path";
|
|
13
|
+
import { fileURLToPath } from "url";
|
|
14
|
+
import { parse as parseYaml } from "yaml";
|
|
15
|
+
import { MeshCliError } from "../../utils/errors.js";
|
|
16
|
+
import { startHeartbeat } from "../../utils/log.js";
|
|
17
|
+
export const COMPOSE_PROJECT = "mesh-local";
|
|
18
|
+
/**
|
|
19
|
+
* Host directory `mesh dev --local` writes service logs into
|
|
20
|
+
* ({namespace}/{service}.log). The stack's OTel collector tails it (filelog
|
|
21
|
+
* receiver) and ships to Loki with the hosted k8s_* label scheme, so the
|
|
22
|
+
* Hub's logs view works on local runs unchanged.
|
|
23
|
+
*/
|
|
24
|
+
export function localLogsDir() {
|
|
25
|
+
const dir = path.join(os.homedir(), ".cache", "mesh", "mesh-local", "logs");
|
|
26
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
27
|
+
return dir;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Host directory holding blackbox probe targets (Prometheus file_sd JSON) —
|
|
31
|
+
* written by `mesh dev --externals` for external services, mounted into the
|
|
32
|
+
* stack's Prometheus. The local analog of the hosted Probe CRs.
|
|
33
|
+
*/
|
|
34
|
+
export function localProbesDir() {
|
|
35
|
+
const dir = path.join(os.homedir(), ".cache", "mesh", "mesh-local", "probes");
|
|
36
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
37
|
+
return dir;
|
|
38
|
+
}
|
|
39
|
+
export const STACK_ENDPOINTS = [
|
|
40
|
+
{
|
|
41
|
+
service: "temporal",
|
|
42
|
+
label: "Temporal gRPC",
|
|
43
|
+
url: "localhost:7233",
|
|
44
|
+
probe: { kind: "tcp", port: 7233 },
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
service: "temporal-ui",
|
|
48
|
+
label: "Temporal UI",
|
|
49
|
+
url: "http://localhost:8233/namespaces/local-dev/workflows",
|
|
50
|
+
probe: { kind: "http", url: "http://localhost:8233" },
|
|
51
|
+
hint: "seeded namespace: local-dev",
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
service: "zitadel",
|
|
55
|
+
label: "Zitadel console",
|
|
56
|
+
url: "http://localhost:8080",
|
|
57
|
+
probe: { kind: "http", url: "http://localhost:8080/debug/healthz" },
|
|
58
|
+
hint: "admin@local.mesh / LocalDev1!",
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
service: "database",
|
|
62
|
+
label: "Postgres",
|
|
63
|
+
url: "postgres://postgres:postgres@localhost:5433",
|
|
64
|
+
probe: { kind: "tcp", port: 5433 },
|
|
65
|
+
hint: "databases: temporal, app, spicedb, hub",
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
service: "spicedb",
|
|
69
|
+
label: "SpiceDB gRPC",
|
|
70
|
+
url: "localhost:50051",
|
|
71
|
+
probe: { kind: "tcp", port: 50051 },
|
|
72
|
+
hint: "preshared key: local-dev-key",
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
service: "ministack",
|
|
76
|
+
label: "ministack (local AWS endpoint)",
|
|
77
|
+
url: "http://localhost:4566",
|
|
78
|
+
probe: { kind: "http", url: "http://localhost:4566/_ministack/health" },
|
|
79
|
+
hint: "SSM registry under /mesh-platform/local/dev",
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
service: "stackport",
|
|
83
|
+
label: "StackPort (local AWS console)",
|
|
84
|
+
url: "http://localhost:4567",
|
|
85
|
+
probe: { kind: "http", url: "http://localhost:4567" },
|
|
86
|
+
hint: "browse the registry (SSM), secrets, S3 artifacts",
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
service: "memcached",
|
|
90
|
+
label: "Memcached",
|
|
91
|
+
url: "localhost:11211",
|
|
92
|
+
probe: { kind: "tcp", port: 11211 },
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
service: "loki",
|
|
96
|
+
label: "Loki (logs)",
|
|
97
|
+
url: "http://localhost:3100",
|
|
98
|
+
probe: { kind: "http", url: "http://localhost:3100/ready" },
|
|
99
|
+
hint: "mesh dev --local service logs, hosted label scheme",
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
service: "tempo",
|
|
103
|
+
label: "Tempo (traces)",
|
|
104
|
+
url: "http://localhost:3200",
|
|
105
|
+
probe: { kind: "http", url: "http://localhost:3200/ready" },
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
service: "prometheus",
|
|
109
|
+
label: "Prometheus (metrics)",
|
|
110
|
+
url: "http://localhost:9090",
|
|
111
|
+
probe: { kind: "http", url: "http://localhost:9090/-/ready" },
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
service: "otel-collector",
|
|
115
|
+
label: "OTel collector (OTLP in)",
|
|
116
|
+
url: "http://localhost:4318",
|
|
117
|
+
probe: { kind: "http", url: "http://localhost:13133" },
|
|
118
|
+
hint: "apps: OTEL_EXPORTER_OTLP_ENDPOINT (injected by mesh dev --local)",
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
service: "elasticsearch",
|
|
122
|
+
label: "OpenSearch (Temporal visibility)",
|
|
123
|
+
url: "http://localhost:9200",
|
|
124
|
+
probe: { kind: "http", url: "http://localhost:9200" },
|
|
125
|
+
},
|
|
126
|
+
];
|
|
127
|
+
/** Default host port for the containerized local Hub. `mesh hub dev` derives
|
|
128
|
+
* its dev-server default from this too (hub/index.ts), so the two Hubs share
|
|
129
|
+
* one source for "9000" while keeping separate override variables
|
|
130
|
+
* (MESH_HUB_PORT here, MESH_HUB_DEV_PORT there). */
|
|
131
|
+
export const DEFAULT_HUB_PORT = "9000";
|
|
132
|
+
/**
|
|
133
|
+
* Host port the Hub is published on (docker-compose.hub.yml binds
|
|
134
|
+
* `${MESH_HUB_PORT:-9000}:4180`). Override with MESH_HUB_PORT to run the
|
|
135
|
+
* local Hub beside another process that owns 9000 — e.g. a hub-ui dev
|
|
136
|
+
* server running from a different checkout. Export it for BOTH `mesh start`
|
|
137
|
+
* and later `mesh status` calls: the compose file and these probes read the
|
|
138
|
+
* same variable (MESH-2256 tracks deriving it from the running stack so
|
|
139
|
+
* `mesh status` stops depending on shell hygiene). `mesh start` reconciles
|
|
140
|
+
* the seeded Zitadel Hub app's redirect URIs to include the chosen port —
|
|
141
|
+
* Zitadel requires every redirect URI to be registered even in devMode
|
|
142
|
+
* (devMode only allows http).
|
|
143
|
+
*
|
|
144
|
+
* Empty string falls back like compose's `${MESH_HUB_PORT:-9000}` does —
|
|
145
|
+
* `??` alone would diverge (probe `:`, publish 9000).
|
|
146
|
+
*/
|
|
147
|
+
export function hubPort() {
|
|
148
|
+
const raw = process.env.MESH_HUB_PORT?.trim();
|
|
149
|
+
if (!raw)
|
|
150
|
+
return DEFAULT_HUB_PORT;
|
|
151
|
+
if (!/^\d+$/.test(raw) || Number(raw) < 1 || Number(raw) > 65535) {
|
|
152
|
+
throw new MeshCliError(`MESH_HUB_PORT must be a TCP port number 1–65535 (got '${raw}').`, {
|
|
153
|
+
remediation: { command: "unset MESH_HUB_PORT # or export a valid port, e.g. 9100" },
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
return raw;
|
|
157
|
+
}
|
|
158
|
+
/** Hub overlay endpoints — probed only when the hub containers exist.
|
|
159
|
+
* A function (not a module constant) so hubPort() is read at call time:
|
|
160
|
+
* the CLI's env is fixed before node starts, but tests and programmatic
|
|
161
|
+
* callers set MESH_HUB_PORT after import. */
|
|
162
|
+
export function hubEndpoints() {
|
|
163
|
+
return [
|
|
164
|
+
{
|
|
165
|
+
service: "hub-api",
|
|
166
|
+
label: "Hub API",
|
|
167
|
+
url: "http://localhost:4568",
|
|
168
|
+
probe: { kind: "http", url: "http://localhost:4568/health" },
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
service: "hub-ui",
|
|
172
|
+
label: "Hub UI",
|
|
173
|
+
url: `http://localhost:${hubPort()}`,
|
|
174
|
+
probe: { kind: "http", url: `http://localhost:${hubPort()}/ping` },
|
|
175
|
+
hint: "sign in: admin@local.mesh or dev@local.mesh / LocalDev1! (oauth2-proxy, same as deployed)",
|
|
176
|
+
},
|
|
177
|
+
];
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Locate the CLI package root (the directory whose package.json is
|
|
181
|
+
* @mesh-tech/mesh-cli). Works from both the compiled layout (dist/src/…)
|
|
182
|
+
* and the source layout (src/… under tsx).
|
|
183
|
+
*/
|
|
184
|
+
export function findPackageRoot(startDir) {
|
|
185
|
+
let dir = startDir ?? path.dirname(fileURLToPath(import.meta.url));
|
|
186
|
+
for (let i = 0; i < 8; i++) {
|
|
187
|
+
const pkgPath = path.join(dir, "package.json");
|
|
188
|
+
if (fs.existsSync(pkgPath)) {
|
|
189
|
+
try {
|
|
190
|
+
const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf-8"));
|
|
191
|
+
if (pkg.name === "@mesh-tech/mesh-cli")
|
|
192
|
+
return dir;
|
|
193
|
+
}
|
|
194
|
+
catch {
|
|
195
|
+
// unreadable package.json — keep walking
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
const parent = path.dirname(dir);
|
|
199
|
+
if (parent === dir)
|
|
200
|
+
break;
|
|
201
|
+
dir = parent;
|
|
202
|
+
}
|
|
203
|
+
throw new MeshCliError("Could not locate the mesh-cli package root (stack assets missing).", {
|
|
204
|
+
remediation: { command: "npm install -g @mesh-tech/mesh-cli" },
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
export function stackDir() {
|
|
208
|
+
const dir = path.join(findPackageRoot(), "stack");
|
|
209
|
+
if (!fs.existsSync(path.join(dir, "docker-compose.yml"))) {
|
|
210
|
+
throw new MeshCliError(`Local stack assets not found at ${dir}.`, {
|
|
211
|
+
remediation: { command: "npm install -g @mesh-tech/mesh-cli" },
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
return dir;
|
|
215
|
+
}
|
|
216
|
+
/** The compose overlay that declares the Hub services. */
|
|
217
|
+
export const HUB_OVERLAY_FILE = "docker-compose.hub.yml";
|
|
218
|
+
/** Top-level service names a compose file declares. Pure — takes the file text. */
|
|
219
|
+
export function parseComposeServiceNames(yamlText) {
|
|
220
|
+
const doc = parseYaml(yamlText);
|
|
221
|
+
return Object.keys(doc?.services ?? {});
|
|
222
|
+
}
|
|
223
|
+
let hubOverlayServicesCache;
|
|
224
|
+
/**
|
|
225
|
+
* The services the Hub overlay — and only the overlay — declares.
|
|
226
|
+
*
|
|
227
|
+
* Read from `docker-compose.hub.yml` rather than hard-coded beside
|
|
228
|
+
* ONE_SHOT_SERVICES on purpose: a second name list rots the moment the
|
|
229
|
+
* overlay gains or renames a service. (It already declares three — hub-api,
|
|
230
|
+
* hub-ui, hub-auth — not the two the Hub is usually described by.)
|
|
231
|
+
*/
|
|
232
|
+
export function hubOverlayServices() {
|
|
233
|
+
if (!hubOverlayServicesCache) {
|
|
234
|
+
const file = path.join(stackDir(), HUB_OVERLAY_FILE);
|
|
235
|
+
if (!fs.existsSync(file)) {
|
|
236
|
+
throw new MeshCliError(`Local stack assets are incomplete: ${file} is missing.`, {
|
|
237
|
+
remediation: { command: "npm install -g @mesh-tech/mesh-cli" },
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
hubOverlayServicesCache = new Set(parseComposeServiceNames(fs.readFileSync(file, "utf-8")));
|
|
241
|
+
}
|
|
242
|
+
return hubOverlayServicesCache;
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* The compose project is a MACHINE-WIDE singleton (`mesh-local`), but any
|
|
246
|
+
* checkout of the CLI can drive it — and `docker compose up` from a checkout
|
|
247
|
+
* whose stack config differs will recreate shared containers out from under
|
|
248
|
+
* whatever else is running against the stack (a second project's `mesh dev`
|
|
249
|
+
* session, a Hub built from another worktree, …).
|
|
250
|
+
*
|
|
251
|
+
* Returns the working dir of the checkout that last (re)created the running
|
|
252
|
+
* stack when it is NOT this one; undefined when the stack isn't running or
|
|
253
|
+
* is already owned here. Callers gate lifecycle commands on it.
|
|
254
|
+
*/
|
|
255
|
+
export function stackOwnedElsewhere() {
|
|
256
|
+
// Fail-open by design: a stack that exists but is NOT running (`ps -q`
|
|
257
|
+
// without -a) has nothing to disrupt, so `start` silently re-owns it; and
|
|
258
|
+
// any docker/inspect hiccup disables the guard rather than blocking
|
|
259
|
+
// legitimate lifecycle commands.
|
|
260
|
+
try {
|
|
261
|
+
const first = compose(["ps", "-q"]).trim().split("\n").filter(Boolean)[0];
|
|
262
|
+
if (!first)
|
|
263
|
+
return undefined;
|
|
264
|
+
const label = execFileSync("docker", ["inspect", first, "--format", '{{ index .Config.Labels "com.docker.compose.project.working_dir" }}'], { encoding: "utf-8" }).trim();
|
|
265
|
+
if (!label)
|
|
266
|
+
return undefined;
|
|
267
|
+
// realpath both sides: symlinked layouts (macOS /tmp → /private/tmp,
|
|
268
|
+
// linked worktree parents) must not make the same physical dir compare
|
|
269
|
+
// as foreign. Fall back to the raw path when realpath fails (dir gone).
|
|
270
|
+
const real = (p) => {
|
|
271
|
+
try {
|
|
272
|
+
return fs.realpathSync(p);
|
|
273
|
+
}
|
|
274
|
+
catch {
|
|
275
|
+
return path.resolve(p);
|
|
276
|
+
}
|
|
277
|
+
};
|
|
278
|
+
return real(label) === real(stackDir()) ? undefined : label;
|
|
279
|
+
}
|
|
280
|
+
catch {
|
|
281
|
+
return undefined;
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
/** Throw a remediated error if the docker daemon isn't reachable. */
|
|
285
|
+
export function ensureDockerAvailable() {
|
|
286
|
+
const probe = spawnSync("docker", ["info", "--format", "{{.ServerVersion}}"], {
|
|
287
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
288
|
+
});
|
|
289
|
+
if (probe.error || probe.status !== 0) {
|
|
290
|
+
throw new MeshCliError("Docker is not available (is Docker Desktop / the docker daemon running?).", {
|
|
291
|
+
remediation: { docs: "https://docs.docker.com/get-docker/" },
|
|
292
|
+
});
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
/** Run `docker compose` against the packaged stack. `hub` adds the Hub
|
|
296
|
+
* overlay file (safe for ps/logs/down: services simply may not exist);
|
|
297
|
+
* `env` adds process-env overrides (e.g. MESH_HUB_VERSION). */
|
|
298
|
+
export function compose(args, opts = {}) {
|
|
299
|
+
const dir = stackDir();
|
|
300
|
+
const files = ["-f", path.join(dir, "docker-compose.yml")];
|
|
301
|
+
if (opts.hub)
|
|
302
|
+
files.push("-f", path.join(dir, "docker-compose.hub.yml"));
|
|
303
|
+
const fullArgs = ["compose", "-p", COMPOSE_PROJECT, ...files, ...args];
|
|
304
|
+
return execFileSync("docker", fullArgs, {
|
|
305
|
+
cwd: dir,
|
|
306
|
+
encoding: "utf-8",
|
|
307
|
+
// MESH_LOCAL_LOGS on every call: the compose file mounts it into the
|
|
308
|
+
// OTel collector, and an unset variable would both warn and resolve to
|
|
309
|
+
// a different mount (recreate churn between CLI and raw compose runs).
|
|
310
|
+
// IGNORE_ORPHANS: base-only `up` calls would otherwise flag the hub
|
|
311
|
+
// overlay's running containers as orphans.
|
|
312
|
+
env: {
|
|
313
|
+
...process.env,
|
|
314
|
+
MESH_LOCAL_LOGS: localLogsDir(),
|
|
315
|
+
MESH_LOCAL_PROBES: localProbesDir(),
|
|
316
|
+
COMPOSE_IGNORE_ORPHANS: "1",
|
|
317
|
+
...opts.env,
|
|
318
|
+
},
|
|
319
|
+
stdio: opts.inherit ? ["ignore", "inherit", "inherit"] : ["ignore", "pipe", "pipe"],
|
|
320
|
+
});
|
|
321
|
+
}
|
|
322
|
+
/**
|
|
323
|
+
* Pick the one line worth reading out of a failed compose run's output:
|
|
324
|
+
* the last error-looking line, else the last non-empty line (MESH-2479).
|
|
325
|
+
* Pure so the selection heuristic is unit-testable.
|
|
326
|
+
*/
|
|
327
|
+
export function summarizeComposeFailure(output) {
|
|
328
|
+
const lines = output
|
|
329
|
+
.split("\n")
|
|
330
|
+
.map((l) => l.trim())
|
|
331
|
+
.filter(Boolean);
|
|
332
|
+
const errorish = lines.filter((l) => /\b(error|failed|failure|fatal|denied|unauthorized|cannot|no such)\b/i.test(l));
|
|
333
|
+
const line = errorish.at(-1) ?? lines.at(-1) ?? "no output captured";
|
|
334
|
+
return line.length > 300 ? `${line.slice(0, 297)}…` : line;
|
|
335
|
+
}
|
|
336
|
+
/** Where a lifecycle command's full compose output is written (per operation). */
|
|
337
|
+
export function composeLogPath(op) {
|
|
338
|
+
const dir = path.join(os.homedir(), ".cache", "mesh", "mesh-local");
|
|
339
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
340
|
+
return path.join(dir, `compose-${op.replace(/[^a-z0-9-]/gi, "_")}.log`);
|
|
341
|
+
}
|
|
342
|
+
/**
|
|
343
|
+
* `docker compose` for lifecycle commands (`up -d`): stream output like
|
|
344
|
+
* `compose({inherit: true})` does, but never bury the failure — on a non-zero
|
|
345
|
+
* exit throw a one-line summary instead of leaving ~200 lines of pull/create
|
|
346
|
+
* noise as the only signal (MESH-2479). In non-TTY runs the output is also
|
|
347
|
+
* teed to a log file (named in the error) and a heartbeat fills long quiet
|
|
348
|
+
* stretches; interactive terminals keep docker's own progress rendering.
|
|
349
|
+
*/
|
|
350
|
+
export async function composeStreamed(args, opts = {}) {
|
|
351
|
+
const dir = stackDir();
|
|
352
|
+
const files = ["-f", path.join(dir, "docker-compose.yml")];
|
|
353
|
+
if (opts.hub)
|
|
354
|
+
files.push("-f", path.join(dir, "docker-compose.hub.yml"));
|
|
355
|
+
const fullArgs = ["compose", "-p", COMPOSE_PROJECT, ...files, ...args];
|
|
356
|
+
const env = {
|
|
357
|
+
...process.env,
|
|
358
|
+
MESH_LOCAL_LOGS: localLogsDir(),
|
|
359
|
+
MESH_LOCAL_PROBES: localProbesDir(),
|
|
360
|
+
COMPOSE_IGNORE_ORPHANS: "1",
|
|
361
|
+
...opts.env,
|
|
362
|
+
};
|
|
363
|
+
const op = args[0] ?? "cmd";
|
|
364
|
+
if (process.stderr.isTTY) {
|
|
365
|
+
const res = spawnSync("docker", fullArgs, {
|
|
366
|
+
cwd: dir,
|
|
367
|
+
env,
|
|
368
|
+
stdio: ["ignore", "inherit", "inherit"],
|
|
369
|
+
});
|
|
370
|
+
if (res.status !== 0) {
|
|
371
|
+
throw new MeshCliError(`docker compose ${op} failed (exit ${res.status ?? "?"}) — the compose output above has the details.`, {
|
|
372
|
+
remediation: {
|
|
373
|
+
command: `docker compose -p ${COMPOSE_PROJECT} ps && docker compose -p ${COMPOSE_PROJECT} logs --tail 50`,
|
|
374
|
+
},
|
|
375
|
+
});
|
|
376
|
+
}
|
|
377
|
+
return;
|
|
378
|
+
}
|
|
379
|
+
const logPath = composeLogPath(op);
|
|
380
|
+
const logStream = fs.createWriteStream(logPath);
|
|
381
|
+
const heartbeat = startHeartbeat(`docker compose ${args.join(" ")}`);
|
|
382
|
+
let captured = "";
|
|
383
|
+
let exitCode;
|
|
384
|
+
try {
|
|
385
|
+
exitCode = await new Promise((resolve, reject) => {
|
|
386
|
+
const child = spawn("docker", fullArgs, {
|
|
387
|
+
cwd: dir,
|
|
388
|
+
env,
|
|
389
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
390
|
+
});
|
|
391
|
+
const consume = (chunk) => {
|
|
392
|
+
heartbeat.touch();
|
|
393
|
+
const text = chunk.toString();
|
|
394
|
+
captured += text;
|
|
395
|
+
logStream.write(text);
|
|
396
|
+
process.stderr.write(text);
|
|
397
|
+
};
|
|
398
|
+
child.stdout.on("data", consume);
|
|
399
|
+
child.stderr.on("data", consume);
|
|
400
|
+
child.on("error", reject);
|
|
401
|
+
child.on("close", (code) => resolve(code ?? 1));
|
|
402
|
+
});
|
|
403
|
+
}
|
|
404
|
+
finally {
|
|
405
|
+
heartbeat.stop();
|
|
406
|
+
// Flush the log file before any throw can reach handleCliError's
|
|
407
|
+
// process.exit(), which doesn't wait for pending writes.
|
|
408
|
+
await new Promise((resolve) => logStream.end(resolve));
|
|
409
|
+
}
|
|
410
|
+
if (exitCode !== 0) {
|
|
411
|
+
throw new MeshCliError(`docker compose ${op} failed (exit ${exitCode}): ${summarizeComposeFailure(captured)}`, {
|
|
412
|
+
remediation: {
|
|
413
|
+
command: `docker compose -p ${COMPOSE_PROJECT} logs --tail 50`,
|
|
414
|
+
docs: logPath,
|
|
415
|
+
},
|
|
416
|
+
});
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
/** Parse `docker compose ps --format json` (NDJSON, one object per line). */
|
|
420
|
+
export function parseComposePs(output) {
|
|
421
|
+
const services = [];
|
|
422
|
+
for (const line of output.split("\n")) {
|
|
423
|
+
const trimmed = line.trim();
|
|
424
|
+
if (!trimmed)
|
|
425
|
+
continue;
|
|
426
|
+
try {
|
|
427
|
+
const entry = JSON.parse(trimmed);
|
|
428
|
+
services.push({
|
|
429
|
+
name: entry.Service ?? entry.Name ?? "unknown",
|
|
430
|
+
state: entry.State ?? "unknown",
|
|
431
|
+
health: entry.Health || undefined,
|
|
432
|
+
});
|
|
433
|
+
}
|
|
434
|
+
catch {
|
|
435
|
+
// non-JSON noise from docker — skip
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
return services;
|
|
439
|
+
}
|
|
440
|
+
export function stackServices() {
|
|
441
|
+
// Include the hub overlay so its containers show up when running.
|
|
442
|
+
return parseComposePs(compose(["ps", "-a", "--format", "json"], { hub: true }));
|
|
443
|
+
}
|
|
444
|
+
/** Services expected to exit (one-shot jobs) — an `exited` state is fine. */
|
|
445
|
+
export const ONE_SHOT_SERVICES = new Set(["spicedb-migrate", "zitadel-machinekey-init"]);
|
|
446
|
+
/**
|
|
447
|
+
* The services whose `exited` state is a real failure *right now*.
|
|
448
|
+
*
|
|
449
|
+
* `stackServices()` scans the whole `mesh-local` compose project, overlay
|
|
450
|
+
* included — but `mesh start` brings the base stack up first and the Hub
|
|
451
|
+
* overlay only afterwards. Before that point an `exited` hub container is a
|
|
452
|
+
* leftover from a previous run (a Docker restart, a laptop sleep), not a
|
|
453
|
+
* crash: the base `up -d` deliberately never started it. Counting it made
|
|
454
|
+
* `mesh start` abort before it ever tried to start the Hub, pointing at the
|
|
455
|
+
* wrong thing.
|
|
456
|
+
*
|
|
457
|
+
* Once the overlay HAS been started, an exited overlay service is a crash
|
|
458
|
+
* like any other — pass `overlayStarted: true` and the signal is preserved.
|
|
459
|
+
*/
|
|
460
|
+
export function crashedServices(services, opts) {
|
|
461
|
+
return services.filter((s) => s.state === "exited" &&
|
|
462
|
+
!ONE_SHOT_SERVICES.has(s.name) &&
|
|
463
|
+
(opts.overlayStarted || !opts.overlayServices.has(s.name)));
|
|
464
|
+
}
|
|
465
|
+
/**
|
|
466
|
+
* Whether the Hub overlay is up in this run — i.e. at least one overlay
|
|
467
|
+
* container is actually `running`. `mesh status` has no other way to know
|
|
468
|
+
* (it never started anything), and "a container exists" is not it: a
|
|
469
|
+
* leftover `exited` one exists too.
|
|
470
|
+
*/
|
|
471
|
+
export function hubOverlayRunning(services, overlayServices) {
|
|
472
|
+
return services.some((s) => overlayServices.has(s.name) && s.state === "running");
|
|
473
|
+
}
|
|
474
|
+
/**
|
|
475
|
+
* Whether the Hub API is serving. `some(s => s.name === "hub-api")` is not
|
|
476
|
+
* the same question — that is true of a leftover exited container, and
|
|
477
|
+
* probing Hub endpoints that were never meant to be up this run reports the
|
|
478
|
+
* stack unhealthy for a Hub nobody started.
|
|
479
|
+
*/
|
|
480
|
+
export function hubApiRunning(services) {
|
|
481
|
+
return services.some((s) => s.name === "hub-api" && s.state === "running");
|
|
482
|
+
}
|
|
483
|
+
/** Probe a host endpoint (http 2xx-4xx counts as up; tcp connect counts as up). */
|
|
484
|
+
export async function probeEndpoint(endpoint) {
|
|
485
|
+
if (endpoint.probe.kind === "http") {
|
|
486
|
+
try {
|
|
487
|
+
const res = await fetch(endpoint.probe.url, { signal: AbortSignal.timeout(3000) });
|
|
488
|
+
return res.status < 500;
|
|
489
|
+
}
|
|
490
|
+
catch {
|
|
491
|
+
return false;
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
if (endpoint.probe.kind === "tcp") {
|
|
495
|
+
return probeTcp(endpoint.probe.port, { timeoutMs: 3000 });
|
|
496
|
+
}
|
|
497
|
+
return true;
|
|
498
|
+
}
|
|
499
|
+
//# sourceMappingURL=stack.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stack.js","sourceRoot":"","sources":["../../../../src/commands/local/stack.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC/D,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,MAAM,CAAC;AAC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