@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,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "{{tenant}}-core",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"private": true,
|
|
5
|
+
"description": "Core infrastructure for the {{tenant}} tenant (VPC, EKS, RDS)",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "index.ts",
|
|
8
|
+
"scripts": {
|
|
9
|
+
"typecheck": "tsc --noEmit"
|
|
10
|
+
},
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"@mesh-tech/infra-components": "latest",
|
|
13
|
+
"@pulumi/aws": "6.66.2",
|
|
14
|
+
"@pulumi/pulumi": "3.214.1"
|
|
15
|
+
},
|
|
16
|
+
"devDependencies": {
|
|
17
|
+
"@mesh-tech/tsconfig": "latest",
|
|
18
|
+
"@types/node": "^24.2.1",
|
|
19
|
+
"tsx": "^4.20.4",
|
|
20
|
+
"typescript": "^5.9.2"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "{{tenant}}-mesh-platform",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"private": true,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"packageManager": "pnpm@10.29.2",
|
|
7
|
+
"keywords": ["tanstack-intent"],
|
|
8
|
+
"scripts": {
|
|
9
|
+
"mesh": "mesh",
|
|
10
|
+
"typecheck": "pnpm -r typecheck"
|
|
11
|
+
},
|
|
12
|
+
"devDependencies": {
|
|
13
|
+
"@mesh-tech/mesh-cli": "latest"
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
name: {{tenant}}-platform
|
|
2
|
+
description: Platform services for the {{tenant}} tenant (Temporal, Zitadel, Monitoring, Hub)
|
|
3
|
+
runtime:
|
|
4
|
+
name: nodejs
|
|
5
|
+
options:
|
|
6
|
+
packagemanager: pnpm
|
|
7
|
+
nodeargs: "--import tsx"
|
|
8
|
+
backend:
|
|
9
|
+
url: s3://{{stateBucket}}
|
|
10
|
+
config:
|
|
11
|
+
aws:region: {{region}}
|
|
12
|
+
mesh:tenant: {{tenant}}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# Platform layer stack config — {{tenant}}/{{env}}. Deploy AFTER core:
|
|
2
|
+
# cd ../core && mesh deploy up
|
|
3
|
+
# cd ../platform && mesh deploy up
|
|
4
|
+
# MeshPlatform auto-imports core from SSM and exports its own registrations
|
|
5
|
+
# the same way — apps and the Hub discover everything through the registry.
|
|
6
|
+
config:
|
|
7
|
+
aws:region: {{region}}
|
|
8
|
+
aws:profile: {{profile}}
|
|
9
|
+
# Tenant name; the env is derived from the stack name minus this prefix.
|
|
10
|
+
mesh:tenant: {{tenant}}
|
|
11
|
+
mesh:coreEnv: {{env}}
|
|
12
|
+
# Env-zone DNS (recommended for secondary / personal platform envs):
|
|
13
|
+
# platform hostnames derive from {env}.{parentZone} instead of the shared
|
|
14
|
+
# core zone, so envs never collide on DNS. The parent zone must exist in
|
|
15
|
+
# this account's Route53 (one-time NS delegation at the registrar/CDN).
|
|
16
|
+
# mesh:dns:
|
|
17
|
+
# public:
|
|
18
|
+
# parentZone: {{tenant}}.meshtech.io
|
|
19
|
+
# # waitForValidation: false # don't block the deploy while the parent
|
|
20
|
+
# # # zone's public delegation is propagating
|
|
21
|
+
|
|
22
|
+
# Temporal — workflow engine + Web UI behind platform auth.
|
|
23
|
+
mesh:temporal:
|
|
24
|
+
webUI:
|
|
25
|
+
enabled: true
|
|
26
|
+
ingress:
|
|
27
|
+
subdomain: temporal
|
|
28
|
+
|
|
29
|
+
# Zitadel — the tenant's identity provider (approved tenant-auth pattern:
|
|
30
|
+
# platform org + app-tenant orgs). Minimal dedicated RDS by default.
|
|
31
|
+
mesh:zitadel:
|
|
32
|
+
rds: {}
|
|
33
|
+
|
|
34
|
+
# Mesh Hub — the operations dashboard (your platform's front door).
|
|
35
|
+
# No auth.clientId → MeshHub auto-provisions its Zitadel OIDC app.
|
|
36
|
+
mesh:hub:
|
|
37
|
+
enabled: true
|
|
38
|
+
|
|
39
|
+
# App tenants served by this platform. Registering a tenant here is the
|
|
40
|
+
# operator action `mesh init app-tenant` points at — add an entry and
|
|
41
|
+
# deploy; each gets its own namespace scoping, deployer role, and
|
|
42
|
+
# registry entries.
|
|
43
|
+
mesh:tenants:
|
|
44
|
+
{{tenant}}: {}
|
|
45
|
+
# another-tenant:
|
|
46
|
+
# subdomain: at
|
|
47
|
+
|
|
48
|
+
# Database provisioner — creates app/SpiceDB databases on core's shared
|
|
49
|
+
# RDS on demand.
|
|
50
|
+
mesh:databaseProvisioner: true
|
|
51
|
+
|
|
52
|
+
# Optional platform services — uncomment as needed:
|
|
53
|
+
# mesh:monitoring: {}
|
|
54
|
+
# mesh:headscale: # self-hosted VPN (Tailscale control plane)
|
|
55
|
+
# subdomain: vpn
|
|
56
|
+
# allowedDomains: [{{domain}}]
|
|
57
|
+
# mesh:packageRegistry: {} # CodeArtifact for @-scoped package distribution
|
|
58
|
+
# mesh:auth: # org admins (Zitadel user IDs, post-first-deploy)
|
|
59
|
+
# orgAdmins: []
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import * as pulumi from "@pulumi/pulumi";
|
|
2
|
+
import * as aws from "@pulumi/aws";
|
|
3
|
+
import { mesh, parseEnvFromStack } from "@mesh-tech/infra-components";
|
|
4
|
+
|
|
5
|
+
// ============================================================================
|
|
6
|
+
// Configuration
|
|
7
|
+
// ============================================================================
|
|
8
|
+
|
|
9
|
+
const config = new pulumi.Config("mesh");
|
|
10
|
+
|
|
11
|
+
const tenant = config.require("tenant");
|
|
12
|
+
const env = parseEnvFromStack(tenant);
|
|
13
|
+
|
|
14
|
+
// Get AWS account ID
|
|
15
|
+
const callerIdentity = await aws.getCallerIdentity();
|
|
16
|
+
const awsAccountId = callerIdentity.accountId;
|
|
17
|
+
|
|
18
|
+
// ============================================================================
|
|
19
|
+
// Platform Infrastructure
|
|
20
|
+
// ============================================================================
|
|
21
|
+
// MeshPlatform:
|
|
22
|
+
// - Auto-imports core from SSM (use coreEnv config to override which env)
|
|
23
|
+
// - Creates Temporal, Zitadel, Monitoring (if configured)
|
|
24
|
+
// - Auto-exports to SSM: /mesh/{tenant}/{env}/platform
|
|
25
|
+
|
|
26
|
+
const meshPlatform = new mesh.layers.MeshPlatform("platform", {
|
|
27
|
+
tenant,
|
|
28
|
+
env,
|
|
29
|
+
// Core environment to import from (defaults to env)
|
|
30
|
+
// Set mesh:coreEnv in Pulumi config when core is deployed to a different stack
|
|
31
|
+
coreEnv: config.get("coreEnv"),
|
|
32
|
+
// Platform services - all disabled by default
|
|
33
|
+
// Enable via Pulumi config: mesh:temporal, mesh:zitadel, mesh:spicedb, mesh:monitoring
|
|
34
|
+
// infra-components >= 0.1.130 bundles the Temporal server source, so no
|
|
35
|
+
// serverSourcePath override is needed — the SDK resolves its bundled copy.
|
|
36
|
+
// Env-zone DNS (personal / secondary platform stacks): mesh:dns with a
|
|
37
|
+
// public.parentZone makes every platform hostname derive from
|
|
38
|
+
// {env}.{parentZone} instead of the shared core zone.
|
|
39
|
+
dns: config.getObject("dns") ?? false,
|
|
40
|
+
temporal: config.getObject("temporal") ?? false,
|
|
41
|
+
zitadel: config.getObject("zitadel") ?? false,
|
|
42
|
+
headscale: config.getObject("headscale") ?? false,
|
|
43
|
+
subnetRouter: config.getObject("subnetRouter") ?? false,
|
|
44
|
+
// Platform auth — org admin seeding (Zitadel users granted platform-wide
|
|
45
|
+
// Temporal system admin). Config: mesh:auth: { orgAdmins: ["zitadel-id", ...] }
|
|
46
|
+
// (SpiceDB authorization schemas are owned by apps/stacks, not the platform.)
|
|
47
|
+
auth: config.getObject("auth") ?? false,
|
|
48
|
+
monitoring: config.getObject("monitoring") ?? false,
|
|
49
|
+
// Mesh Hub (operations dashboard) — tenant-opt-in via mesh:hub config.
|
|
50
|
+
// Omit auth.clientId to have MeshHub auto-provision the Zitadel OIDC app
|
|
51
|
+
// (requires mesh:zitadel + Temporal auth + public DNS, all enabled here).
|
|
52
|
+
hub: config.getObject("hub") ?? false,
|
|
53
|
+
// Database provisioner - enabled when RDS is available in core
|
|
54
|
+
databaseProvisioner: config.getBoolean("databaseProvisioner") ?? true,
|
|
55
|
+
// Cluster owner: controls whether cluster-scoped resources are created
|
|
56
|
+
// Only ONE stack per cluster should be the owner (default: true)
|
|
57
|
+
// Set mesh:clusterOwner: false for secondary stacks sharing the same EKS cluster
|
|
58
|
+
clusterOwner: config.getBoolean("clusterOwner") ?? true,
|
|
59
|
+
// Shared tenants that use this platform (creates per-tenant infra)
|
|
60
|
+
// Config: mesh:tenants: { acme: {}, smallbank: { subdomain: sb } }
|
|
61
|
+
tenants: config.getObject("tenants"),
|
|
62
|
+
// Node pools for primary tenant workloads (e.g., Dagster jobs)
|
|
63
|
+
// Config: mesh:primaryTenantNodePools: { dagster-jobs: { instanceType: t3.large } }
|
|
64
|
+
primaryTenantNodePools: config.getObject("primaryTenantNodePools"),
|
|
65
|
+
// Package registry (CodeArtifact) for distributing @mesh-tech/* packages
|
|
66
|
+
// Config: mesh:packageRegistry: {} or mesh:packageRegistry: { readerRoleArns: [...] }
|
|
67
|
+
// NOTE: no monorepoRoot here — package publishing stays with the
|
|
68
|
+
// mesh-platform monorepo (scripts/publish-packages.sh). This stack only
|
|
69
|
+
// provisions the CodeArtifact registry.
|
|
70
|
+
packageRegistry: config.getObject("packageRegistry") ?? false,
|
|
71
|
+
// DevBox - remote development instances (optional)
|
|
72
|
+
// Config: mesh:devbox: { users: { trabianmatt: { home: "/Users/mattdean", ... } } }
|
|
73
|
+
devbox: config.getObject("devbox") ?? false,
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
// ============================================================================
|
|
77
|
+
// Stack Exports
|
|
78
|
+
// ============================================================================
|
|
79
|
+
// These are available via `pulumi stack output`
|
|
80
|
+
|
|
81
|
+
export const stack = pulumi.getStack();
|
|
82
|
+
export const tenantName = tenant;
|
|
83
|
+
export const environment = env;
|
|
84
|
+
export const accountId = awsAccountId;
|
|
85
|
+
|
|
86
|
+
// All platform infrastructure outputs (includes core infra, services, ssmPath)
|
|
87
|
+
export const platform = meshPlatform.outputs;
|
|
88
|
+
|
|
89
|
+
// Tenant environments (primary + shared) - deployer roles, ingress config
|
|
90
|
+
// Note: Also exported to SSM at /mesh/{tenant}/{env}/app-tenants
|
|
91
|
+
export const tenantEnvironments = {
|
|
92
|
+
primary: meshPlatform.tenantEnvironments.primaryTenant,
|
|
93
|
+
shared: meshPlatform.tenantEnvironments.sharedTenants,
|
|
94
|
+
ssmPath: meshPlatform.tenantEnvironments.ssmPath,
|
|
95
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "{{tenant}}-platform",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"private": true,
|
|
5
|
+
"description": "Platform services for the {{tenant}} tenant (Temporal, Zitadel, Monitoring, Hub)",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "index.ts",
|
|
8
|
+
"scripts": {
|
|
9
|
+
"typecheck": "tsc --noEmit"
|
|
10
|
+
},
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"@aws-sdk/client-lambda": "^3.964.0",
|
|
13
|
+
"@aws-sdk/credential-providers": "^3.964.0",
|
|
14
|
+
"@mesh-tech/hub": "latest",
|
|
15
|
+
"@mesh-tech/infra-components": "latest",
|
|
16
|
+
"@pulumi/aws": "6.66.2",
|
|
17
|
+
"@pulumi/kubernetes": "4.24.1",
|
|
18
|
+
"@pulumi/pulumi": "3.214.1"
|
|
19
|
+
},
|
|
20
|
+
"devDependencies": {
|
|
21
|
+
"@mesh-tech/tsconfig": "latest",
|
|
22
|
+
"@types/node": "^24.2.1",
|
|
23
|
+
"tsx": "^4.20.4",
|
|
24
|
+
"typescript": "^5.9.2"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Agent guidance — {{name}}
|
|
2
|
+
|
|
3
|
+
- Invoke the CLI as `pnpm mesh <cmd>` or (cwd-independent) `pnpm exec mesh <cmd>` —
|
|
4
|
+
a `"mesh"` script + the bundled `@mesh-tech/*` dep make both work after
|
|
5
|
+
`pnpm install`. For a bare `mesh` on PATH, run once: `pnpm exec mesh install-shim`.
|
|
6
|
+
- Operations are `mesh` commands, never raw `aws`/`pulumi`/`kubectl`:
|
|
7
|
+
`mesh start` (local platform), `mesh dev` (run services), `mesh login`,
|
|
8
|
+
`mesh deploy`. Errors print the exact `mesh` command that fixes them.
|
|
9
|
+
- Local loop needs zero cloud access: `mesh start && mesh dev`, then
|
|
10
|
+
`curl -X POST localhost:3000/workflows/greet -d '{"name":"…"}'`.
|
|
11
|
+
- Workflows (`worker/src/workflows.ts`) must stay deterministic — no
|
|
12
|
+
`Date.now()`/`Math.random()`/IO; put side effects in `activities.ts`.
|
|
13
|
+
- Pattern skills for the SDKs used here ship inside the `@mesh-tech/*`
|
|
14
|
+
packages (discoverable via TanStack Intent after `pnpm install`).
|
|
15
|
+
- This app's own skill lives at `skills/develop/SKILL.md`.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# {{titleCase name}}
|
|
2
|
+
|
|
3
|
+
Temporal workflow app: Hono API + Temporal worker + a hello workflow.
|
|
4
|
+
|
|
5
|
+
## Run it locally (no AWS, no VPN)
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
mesh start # local Mesh platform (Docker only) — the Hub is at http://localhost:9000
|
|
9
|
+
pnpm install
|
|
10
|
+
mesh dev # auto-wires api + worker to the local platform (tmux)
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Prove the workflow end-to-end:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
curl -s -X POST http://localhost:3000/workflows/greet \
|
|
17
|
+
-H 'content-type: application/json' -d '{"name":"Mesh"}'
|
|
18
|
+
# → {"workflowId":"greeting-…","result":"Hello, Mesh!"}
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Watch it in the **Hub** (http://localhost:9000 → {{tenant}} → {{name}}) or the
|
|
22
|
+
Temporal UI: http://localhost:8233/namespaces/{{tenant}}-dev-{{name}}/workflows
|
|
23
|
+
(the app gets its own Temporal namespace `{{tenant}}-dev-{{name}}`, exactly
|
|
24
|
+
like a deployed environment; its logs land in the Hub's logs view too).
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
mesh dev logs worker # tail a service
|
|
28
|
+
mesh dev --kill # stop the session
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Deploy to a tenant environment
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
mesh login {{tenant}}.dev
|
|
35
|
+
mesh deploy up --yes
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
The stack registers itself in the platform registry (`env.register()`) and
|
|
39
|
+
appears in the Hub.
|
|
40
|
+
|
|
41
|
+
## Layout
|
|
42
|
+
|
|
43
|
+
- `index.ts` — Pulumi program (`AppEnvironment` + API `Service` + `TemporalWorker`)
|
|
44
|
+
- `api/` — Hono API that starts workflows
|
|
45
|
+
- `worker/` — Temporal worker: `workflows.ts` (deterministic) + `activities.ts`
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
FROM node:20-slim
|
|
2
|
+
|
|
3
|
+
WORKDIR /app
|
|
4
|
+
|
|
5
|
+
COPY package*.json ./
|
|
6
|
+
# Full install (not --omit=dev): the build needs esm-bundle, a devDependency.
|
|
7
|
+
# npm install (not ci) — these scaffolds ship no lockfile.
|
|
8
|
+
RUN npm install
|
|
9
|
+
|
|
10
|
+
COPY . .
|
|
11
|
+
RUN npm run build
|
|
12
|
+
|
|
13
|
+
EXPOSE 3000
|
|
14
|
+
|
|
15
|
+
CMD ["node", "dist/index.js"]
|
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "
|
|
2
|
+
"name": "{{name}}-api",
|
|
3
3
|
"version": "0.0.1",
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"dev": "tsx watch src/index.ts",
|
|
8
8
|
"start": "node dist/index.js",
|
|
9
|
-
"build": "
|
|
9
|
+
"build": "esm-bundle src/index.ts --outfile dist/index.js",
|
|
10
|
+
"check-types": "tsc --noEmit"
|
|
10
11
|
},
|
|
11
12
|
"dependencies": {
|
|
13
|
+
"@mesh-tech/app-kit": "latest",
|
|
14
|
+
"@opentelemetry/auto-instrumentations-node": "^0.78.0",
|
|
12
15
|
"@temporalio/client": "^1.11.7",
|
|
13
|
-
"
|
|
14
|
-
"@
|
|
15
|
-
"express": "^4.21.0"
|
|
16
|
+
"hono": "^4.0.0",
|
|
17
|
+
"@hono/node-server": "^1.0.0"
|
|
16
18
|
},
|
|
17
19
|
"devDependencies": {
|
|
18
|
-
"@
|
|
20
|
+
"@mesh-tech/esm-bundle": "latest",
|
|
19
21
|
"@types/node": "^20.0.0",
|
|
20
22
|
"tsx": "^4.0.0",
|
|
21
23
|
"typescript": "^5.0.0"
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* {{titleCase name}} API
|
|
3
|
+
*
|
|
4
|
+
* HTTP API for triggering Temporal workflows.
|
|
5
|
+
*
|
|
6
|
+
* Environment variables:
|
|
7
|
+
* - PORT: Server port (default: 3000)
|
|
8
|
+
* - TEMPORAL_ADDRESS, TEMPORAL_NAMESPACE, TEMPORAL_TASK_QUEUE
|
|
9
|
+
* - TEMPORAL_ENCODING_KEY: Encoding key for payload encryption (optional)
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import { Hono } from "hono";
|
|
13
|
+
import { serve } from "@hono/node-server";
|
|
14
|
+
import { createTemporalClient, type WithClient } from "@mesh-tech/app-kit/temporal-client";
|
|
15
|
+
|
|
16
|
+
const PORT = parseInt(process.env.PORT ?? "3000", 10);
|
|
17
|
+
const TEMPORAL_TASK_QUEUE = process.env.TEMPORAL_TASK_QUEUE ?? "{{name}}";
|
|
18
|
+
|
|
19
|
+
const app = new Hono();
|
|
20
|
+
|
|
21
|
+
// createTemporalClient returns a withClient wrapper (auth is applied
|
|
22
|
+
// per-call); with no TEMPORAL_AUTH_* env it runs unauthenticated — the
|
|
23
|
+
// local platform mode.
|
|
24
|
+
let withClient: WithClient;
|
|
25
|
+
|
|
26
|
+
async function initClient(): Promise<void> {
|
|
27
|
+
({ withClient } = await createTemporalClient());
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// Health check
|
|
31
|
+
app.get("/health", (c) => c.json({ status: "ok" }));
|
|
32
|
+
|
|
33
|
+
// Root
|
|
34
|
+
app.get("/", (c) =>
|
|
35
|
+
c.json({
|
|
36
|
+
name: "{{titleCase name}} API",
|
|
37
|
+
endpoints: [
|
|
38
|
+
"GET /health",
|
|
39
|
+
"POST /workflows/greet",
|
|
40
|
+
"POST /workflows/task",
|
|
41
|
+
"GET /workflows/:id",
|
|
42
|
+
],
|
|
43
|
+
})
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
// Trigger greeting workflow
|
|
47
|
+
app.post("/workflows/greet", async (c) => {
|
|
48
|
+
try {
|
|
49
|
+
const { name } = await c.req.json<{ name: string }>();
|
|
50
|
+
if (!name) {
|
|
51
|
+
return c.json({ error: "name is required" }, 400);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const { workflowId, result } = await withClient(async (client) => {
|
|
55
|
+
const handle = await client.workflow.start("greetingWorkflow", {
|
|
56
|
+
taskQueue: TEMPORAL_TASK_QUEUE,
|
|
57
|
+
workflowId: `greeting-${Date.now()}`,
|
|
58
|
+
args: [name],
|
|
59
|
+
});
|
|
60
|
+
return { workflowId: handle.workflowId, result: await handle.result() };
|
|
61
|
+
});
|
|
62
|
+
return c.json({ workflowId, result });
|
|
63
|
+
} catch (error) {
|
|
64
|
+
console.error("[API] Error starting workflow:", error);
|
|
65
|
+
return c.json({ error: "Failed to start workflow" }, 500);
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
// Trigger task workflow
|
|
70
|
+
app.post("/workflows/task", async (c) => {
|
|
71
|
+
try {
|
|
72
|
+
const { taskId, userId } = await c.req.json<{
|
|
73
|
+
taskId: string;
|
|
74
|
+
userId: string;
|
|
75
|
+
}>();
|
|
76
|
+
if (!taskId || !userId) {
|
|
77
|
+
return c.json({ error: "taskId and userId are required" }, 400);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
const workflowId = await withClient(async (client) => {
|
|
81
|
+
const handle = await client.workflow.start("taskWorkflow", {
|
|
82
|
+
taskQueue: TEMPORAL_TASK_QUEUE,
|
|
83
|
+
workflowId: `task-${taskId}`,
|
|
84
|
+
args: [taskId, userId],
|
|
85
|
+
});
|
|
86
|
+
return handle.workflowId;
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
return c.json({
|
|
90
|
+
workflowId,
|
|
91
|
+
status: "started",
|
|
92
|
+
message: "Workflow started. Check Temporal Web UI for progress.",
|
|
93
|
+
});
|
|
94
|
+
} catch (error) {
|
|
95
|
+
console.error("[API] Error starting workflow:", error);
|
|
96
|
+
return c.json({ error: "Failed to start workflow" }, 500);
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
// Get workflow status
|
|
101
|
+
app.get("/workflows/:id", async (c) => {
|
|
102
|
+
try {
|
|
103
|
+
const workflowId = c.req.param("id");
|
|
104
|
+
const describe = await withClient((client) =>
|
|
105
|
+
client.workflow.getHandle(workflowId).describe(),
|
|
106
|
+
);
|
|
107
|
+
|
|
108
|
+
return c.json({
|
|
109
|
+
workflowId,
|
|
110
|
+
status: describe.status.name,
|
|
111
|
+
startTime: describe.startTime,
|
|
112
|
+
closeTime: describe.closeTime,
|
|
113
|
+
});
|
|
114
|
+
} catch (error) {
|
|
115
|
+
console.error("[API] Error getting workflow:", error);
|
|
116
|
+
return c.json({ error: "Failed to get workflow status" }, 500);
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
// Start server
|
|
121
|
+
initClient()
|
|
122
|
+
.then(() => {
|
|
123
|
+
serve({ fetch: app.fetch, port: PORT, hostname: "0.0.0.0" }, () => {
|
|
124
|
+
console.log(`[API] {{titleCase name}} API listening on port ${PORT}`);
|
|
125
|
+
});
|
|
126
|
+
})
|
|
127
|
+
.catch((err) => {
|
|
128
|
+
console.error("[API] Failed to initialize:", err);
|
|
129
|
+
process.exit(1);
|
|
130
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"module": "NodeNext",
|
|
5
|
+
"moduleResolution": "NodeNext",
|
|
6
|
+
"outDir": "./dist",
|
|
7
|
+
"rootDir": "./src",
|
|
8
|
+
"strict": true,
|
|
9
|
+
"esModuleInterop": true,
|
|
10
|
+
"skipLibCheck": true,
|
|
11
|
+
"declaration": true
|
|
12
|
+
},
|
|
13
|
+
"include": ["src/**/*"]
|
|
14
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* {{titleCase name}} — Temporal Workflow Application
|
|
3
|
+
*
|
|
4
|
+
* Infrastructure: AppEnvironment + API Service + TemporalWorker
|
|
5
|
+
*
|
|
6
|
+
* Dev mode: pnpm mesh dev
|
|
7
|
+
* Deploy: pnpm mesh deploy up
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import * as pulumi from "@pulumi/pulumi";
|
|
11
|
+
import * as path from "node:path";
|
|
12
|
+
import { fileURLToPath } from "node:url";
|
|
13
|
+
import { mesh } from "@mesh-tech/app-kit";
|
|
14
|
+
|
|
15
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
16
|
+
const { tenant, platform, stack, deploy } = mesh.apps.getConfig(pulumi);
|
|
17
|
+
|
|
18
|
+
const TASK_QUEUE = "{{name}}";
|
|
19
|
+
|
|
20
|
+
// --- Environment ---
|
|
21
|
+
|
|
22
|
+
const env = new mesh.apps.AppEnvironment("env", {
|
|
23
|
+
tenant,
|
|
24
|
+
platform,
|
|
25
|
+
stack,
|
|
26
|
+
deploy,
|
|
27
|
+
appName: "{{name}}",
|
|
28
|
+
namespace: true,
|
|
29
|
+
rootDir: __dirname,
|
|
30
|
+
temporal: true,
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
// --- Services ---
|
|
34
|
+
|
|
35
|
+
const api = new mesh.apps.Service("api", {
|
|
36
|
+
env,
|
|
37
|
+
runtime: "node",
|
|
38
|
+
src: "./api",
|
|
39
|
+
port: 3000,
|
|
40
|
+
link: [
|
|
41
|
+
env.temporal!.link({
|
|
42
|
+
environmentPrefix: "TEMPORAL",
|
|
43
|
+
taskQueue: TASK_QUEUE,
|
|
44
|
+
}),
|
|
45
|
+
],
|
|
46
|
+
ingress: env.buildIngress({
|
|
47
|
+
subdomain: "{{name}}-api",
|
|
48
|
+
healthCheckPath: "/health",
|
|
49
|
+
}),
|
|
50
|
+
replicas: 1,
|
|
51
|
+
resources: { cpu: "100m", memory: "128Mi" },
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
const worker = new mesh.apps.TemporalWorker("worker", {
|
|
55
|
+
env,
|
|
56
|
+
runtime: "node",
|
|
57
|
+
src: "./worker",
|
|
58
|
+
taskQueue: TASK_QUEUE,
|
|
59
|
+
replicas: 1,
|
|
60
|
+
resources: { cpu: "200m", memory: "256Mi" },
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
// --- Outputs ---
|
|
64
|
+
|
|
65
|
+
export const app = env.register({
|
|
66
|
+
description: "{{titleCase name}} — Temporal workflow app",
|
|
67
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "{{name}}",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"private": true,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"packageManager": "pnpm@10.29.2",
|
|
7
|
+
"keywords": ["tanstack-intent"],
|
|
8
|
+
"scripts": {
|
|
9
|
+
"mesh": "mesh",
|
|
10
|
+
"typecheck": "tsc --noEmit"
|
|
11
|
+
},
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"@mesh-tech/app-kit": "latest",
|
|
14
|
+
"@pulumi/pulumi": "^3.214.1"
|
|
15
|
+
},
|
|
16
|
+
"devDependencies": {
|
|
17
|
+
"tsx": "^4.20.4",
|
|
18
|
+
"typescript": "^5.7.2"
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: develop-{{name}}
|
|
3
|
+
description: Run, extend, and deploy the {{name}} Temporal workflow app — local loop, adding workflows/activities, and the deploy path.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Developing {{name}}
|
|
7
|
+
|
|
8
|
+
## Run locally (zero cloud access)
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
mesh start # local Mesh platform (Hub at http://localhost:9000)
|
|
12
|
+
pnpm install
|
|
13
|
+
mesh dev # api + worker in tmux, wired to the local platform
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Prove it: `curl -s -X POST http://localhost:3000/workflows/greet -H 'content-type: application/json' -d '{"name":"Mesh"}'` → `{"result":"Hello, Mesh!"}`. Inspect runs in the Hub (http://localhost:9000) or at http://localhost:8233/namespaces/{{tenant}}-dev-{{name}}/workflows (per-app Temporal namespace, same as deployed).
|
|
17
|
+
|
|
18
|
+
## Add a workflow
|
|
19
|
+
|
|
20
|
+
1. Define the deterministic function in `worker/src/workflows.ts` (no `Date.now()`/`Math.random()`/IO — use `proxyActivities`).
|
|
21
|
+
2. Side effects go in `worker/src/activities.ts`.
|
|
22
|
+
3. Expose it from the API (`api/src/index.ts`): `client.workflow.start("yourWorkflow", { taskQueue: TEMPORAL_TASK_QUEUE, … })`.
|
|
23
|
+
4. `mesh dev restart worker` picks up the new code; re-curl to verify.
|
|
24
|
+
|
|
25
|
+
## Deploy
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
mesh login {{tenant}}.dev
|
|
29
|
+
mesh deploy up --yes
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Never call `pulumi`/`aws`/`kubectl` directly — every operation has a `mesh` command, and failures name their fix.
|