@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,107 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* {{titleCase name}} — Pulumi app definition
|
|
3
|
+
*
|
|
4
|
+
* Pattern: getConfig → AppEnvironment → primitives → services → register
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import * as pulumi from "@pulumi/pulumi";
|
|
8
|
+
import * as path from "node:path";
|
|
9
|
+
import { fileURLToPath } from "node:url";
|
|
10
|
+
import { mesh } from "@mesh-tech/app-kit";
|
|
11
|
+
|
|
12
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
13
|
+
const { tenant, platform, stack, deploy } = mesh.apps.getConfig(pulumi);
|
|
14
|
+
{{#if temporal}}
|
|
15
|
+
|
|
16
|
+
const TASK_QUEUE = "{{name}}";
|
|
17
|
+
{{/if}}
|
|
18
|
+
|
|
19
|
+
// =============================================================================
|
|
20
|
+
// Environment
|
|
21
|
+
// =============================================================================
|
|
22
|
+
|
|
23
|
+
const env = new mesh.apps.AppEnvironment("env", {
|
|
24
|
+
tenant,
|
|
25
|
+
platform,
|
|
26
|
+
stack,
|
|
27
|
+
deploy,
|
|
28
|
+
appName: "{{name}}",
|
|
29
|
+
namespace: true,
|
|
30
|
+
rootDir: __dirname,
|
|
31
|
+
{{#if temporal}}
|
|
32
|
+
temporal: {
|
|
33
|
+
codecServer: {
|
|
34
|
+
ingressSubdomain: "codec-{{name}}",
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
{{/if}}
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
// =============================================================================
|
|
41
|
+
// Primitives
|
|
42
|
+
// =============================================================================
|
|
43
|
+
{{#if database}}
|
|
44
|
+
|
|
45
|
+
const db = new mesh.apps.Database("db", { env });
|
|
46
|
+
{{/if}}
|
|
47
|
+
{{#if bucket}}
|
|
48
|
+
|
|
49
|
+
const uploads = new mesh.apps.Bucket("uploads", {
|
|
50
|
+
env,
|
|
51
|
+
forceDestroy: stack !== "prod",
|
|
52
|
+
});
|
|
53
|
+
{{/if}}
|
|
54
|
+
|
|
55
|
+
// =============================================================================
|
|
56
|
+
// Services
|
|
57
|
+
// =============================================================================
|
|
58
|
+
{{#if service}}
|
|
59
|
+
|
|
60
|
+
const api = new mesh.apps.Service("api", {
|
|
61
|
+
env,
|
|
62
|
+
title: "{{titleCase name}} API",
|
|
63
|
+
description: "HTTP API for {{titleCase name}}",
|
|
64
|
+
runtime: "node",
|
|
65
|
+
src: "./api",
|
|
66
|
+
port: 3000,
|
|
67
|
+
link: [
|
|
68
|
+
{{#if database}}
|
|
69
|
+
db.link({ environmentPrefix: "DATABASE" }),
|
|
70
|
+
{{/if}}
|
|
71
|
+
{{#if bucket}}
|
|
72
|
+
uploads.link({ environmentPrefix: "UPLOADS", access: "readWrite" }),
|
|
73
|
+
{{/if}}
|
|
74
|
+
{{#if temporal}}
|
|
75
|
+
env.temporal!.link({ environmentPrefix: "TEMPORAL", taskQueue: TASK_QUEUE }),
|
|
76
|
+
{{/if}}
|
|
77
|
+
],
|
|
78
|
+
ingress: env.buildIngress({
|
|
79
|
+
subdomain: "{{name}}",
|
|
80
|
+
healthCheckPath: "/health",
|
|
81
|
+
}),
|
|
82
|
+
healthCheck: "/health",
|
|
83
|
+
replicas: deploy ? 2 : 1,
|
|
84
|
+
resources: { cpu: "100m", memory: "128Mi" },
|
|
85
|
+
});
|
|
86
|
+
{{/if}}
|
|
87
|
+
{{#if temporal}}
|
|
88
|
+
|
|
89
|
+
const worker = new mesh.apps.TemporalWorker("worker", {
|
|
90
|
+
env,
|
|
91
|
+
title: "{{titleCase name}} Worker",
|
|
92
|
+
description: "Temporal workflow worker for {{titleCase name}}",
|
|
93
|
+
runtime: "node",
|
|
94
|
+
src: "./worker",
|
|
95
|
+
taskQueue: TASK_QUEUE,
|
|
96
|
+
replicas: 1,
|
|
97
|
+
resources: { cpu: "100m", memory: "256Mi" },
|
|
98
|
+
});
|
|
99
|
+
{{/if}}
|
|
100
|
+
|
|
101
|
+
// =============================================================================
|
|
102
|
+
// Outputs
|
|
103
|
+
// =============================================================================
|
|
104
|
+
|
|
105
|
+
export const app = env.register({
|
|
106
|
+
description: "{{titleCase name}}",
|
|
107
|
+
});
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@{{tenant}}/{{name}}",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"private": true,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "index.ts",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"typecheck": "tsc --noEmit"
|
|
9
|
+
},
|
|
10
|
+
"dependencies": {
|
|
11
|
+
"@mesh-tech/app-kit": "{{#if workspaceDeps}}workspace:*{{else}}^0.1.0{{/if}}",
|
|
12
|
+
"@mesh-tech/infra-components": "{{#if workspaceDeps}}workspace:*{{else}}^0.1.0{{/if}}",
|
|
13
|
+
"@pulumi/aws": "6.66.2",
|
|
14
|
+
"@pulumi/kubernetes": "4.24.1",
|
|
15
|
+
"@pulumi/pulumi": "3.214.1"
|
|
16
|
+
},
|
|
17
|
+
"devDependencies": {
|
|
18
|
+
"@types/node": "catalog:",
|
|
19
|
+
"tsx": "catalog:",
|
|
20
|
+
"typescript": "catalog:"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -3,11 +3,10 @@
|
|
|
3
3
|
"target": "ES2022",
|
|
4
4
|
"module": "ESNext",
|
|
5
5
|
"moduleResolution": "bundler",
|
|
6
|
-
"esModuleInterop": true,
|
|
7
6
|
"strict": true,
|
|
7
|
+
"esModuleInterop": true,
|
|
8
8
|
"skipLibCheck": true,
|
|
9
|
-
"outDir": "
|
|
10
|
-
"rootDir": "./src"
|
|
9
|
+
"outDir": "dist"
|
|
11
10
|
},
|
|
12
|
-
"include": ["
|
|
11
|
+
"include": ["index.ts"]
|
|
13
12
|
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* S3 storage helpers for {{titleCase name}}
|
|
3
|
+
*
|
|
4
|
+
* Environment variables (injected by mesh link()):
|
|
5
|
+
* - UPLOADS_BUCKET: S3 bucket name
|
|
6
|
+
* - UPLOADS_REGION: AWS region
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import {
|
|
10
|
+
S3Client,
|
|
11
|
+
PutObjectCommand,
|
|
12
|
+
GetObjectCommand,
|
|
13
|
+
DeleteObjectCommand,
|
|
14
|
+
ListObjectsV2Command,
|
|
15
|
+
} from "@aws-sdk/client-s3";
|
|
16
|
+
|
|
17
|
+
if (!process.env.UPLOADS_BUCKET) {
|
|
18
|
+
throw new Error("UPLOADS_BUCKET environment variable is required");
|
|
19
|
+
}
|
|
20
|
+
const BUCKET = process.env.UPLOADS_BUCKET;
|
|
21
|
+
const REGION = process.env.UPLOADS_REGION ?? "us-east-2";
|
|
22
|
+
|
|
23
|
+
const s3 = new S3Client({ region: REGION });
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Upload a file to S3
|
|
27
|
+
*/
|
|
28
|
+
export async function uploadFile(
|
|
29
|
+
key: string,
|
|
30
|
+
body: Buffer | string,
|
|
31
|
+
contentType?: string
|
|
32
|
+
): Promise<{ key: string; bucket: string }> {
|
|
33
|
+
await s3.send(
|
|
34
|
+
new PutObjectCommand({
|
|
35
|
+
Bucket: BUCKET,
|
|
36
|
+
Key: key,
|
|
37
|
+
Body: body,
|
|
38
|
+
ContentType: contentType,
|
|
39
|
+
})
|
|
40
|
+
);
|
|
41
|
+
return { key, bucket: BUCKET };
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Download a file from S3
|
|
46
|
+
*/
|
|
47
|
+
export async function downloadFile(key: string): Promise<Buffer> {
|
|
48
|
+
const response = await s3.send(
|
|
49
|
+
new GetObjectCommand({ Bucket: BUCKET, Key: key })
|
|
50
|
+
);
|
|
51
|
+
const chunks: Uint8Array[] = [];
|
|
52
|
+
for await (const chunk of response.Body as AsyncIterable<Uint8Array>) {
|
|
53
|
+
chunks.push(chunk);
|
|
54
|
+
}
|
|
55
|
+
return Buffer.concat(chunks);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Delete a file from S3
|
|
60
|
+
*/
|
|
61
|
+
export async function deleteFile(key: string): Promise<void> {
|
|
62
|
+
await s3.send(
|
|
63
|
+
new DeleteObjectCommand({ Bucket: BUCKET, Key: key })
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* List files in a prefix
|
|
69
|
+
*/
|
|
70
|
+
export async function listFiles(
|
|
71
|
+
prefix: string
|
|
72
|
+
): Promise<{ key: string; size: number; lastModified: Date }[]> {
|
|
73
|
+
const response = await s3.send(
|
|
74
|
+
new ListObjectsV2Command({ Bucket: BUCKET, Prefix: prefix })
|
|
75
|
+
);
|
|
76
|
+
return (response.Contents ?? []).map((obj) => ({
|
|
77
|
+
key: obj.Key!,
|
|
78
|
+
size: obj.Size!,
|
|
79
|
+
lastModified: obj.LastModified!,
|
|
80
|
+
}));
|
|
81
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Database connection helper
|
|
3
|
+
*
|
|
4
|
+
* Uses Prisma with the pg driver adapter for PostgreSQL.
|
|
5
|
+
* DATABASE_URL is injected by mesh link().
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { PrismaClient } from "@prisma/client";
|
|
9
|
+
import { Pool } from "pg";
|
|
10
|
+
import { PrismaPg } from "@prisma/adapter-pg";
|
|
11
|
+
|
|
12
|
+
const pool = new Pool({ connectionString: process.env.DATABASE_URL });
|
|
13
|
+
const adapter = new PrismaPg(pool);
|
|
14
|
+
|
|
15
|
+
export const db = new PrismaClient({ adapter });
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Get the shared Prisma client instance.
|
|
19
|
+
* Use this in route handlers and activities.
|
|
20
|
+
*/
|
|
21
|
+
export function getDb(): PrismaClient {
|
|
22
|
+
return db;
|
|
23
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
generator client {
|
|
2
|
+
provider = "prisma-client-js"
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
datasource db {
|
|
6
|
+
provider = "postgresql"
|
|
7
|
+
url = env("DATABASE_URL")
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
// Add your models here
|
|
11
|
+
// Example:
|
|
12
|
+
// model User {
|
|
13
|
+
// id String @id @default(cuid())
|
|
14
|
+
// email String @unique
|
|
15
|
+
// name String?
|
|
16
|
+
// createdAt DateTime @default(now())
|
|
17
|
+
// updatedAt DateTime @updatedAt
|
|
18
|
+
// }
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@{{tenant}}/{{name}}-api",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"private": true,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"dev": "tsx watch src/index.ts",
|
|
8
|
+
"start": "node dist/index.js",
|
|
9
|
+
"build": "esm-bundle src/index.ts --outfile dist/index.js"
|
|
10
|
+
},
|
|
11
|
+
"dependencies": {
|
|
12
|
+
{{#if bucket}}
|
|
13
|
+
"@aws-sdk/client-s3": "^3.700.0",
|
|
14
|
+
{{/if}}
|
|
15
|
+
"@hono/node-server": "^1.13.0",
|
|
16
|
+
{{#if temporal}}
|
|
17
|
+
"@mesh-tech/app-kit": "{{#if workspaceDeps}}workspace:*{{else}}^0.1.0{{/if}}",
|
|
18
|
+
{{/if}}
|
|
19
|
+
{{#if database}}
|
|
20
|
+
"@prisma/adapter-pg": "^6.0.0",
|
|
21
|
+
"@prisma/client": "^6.0.0",
|
|
22
|
+
{{/if}}
|
|
23
|
+
{{#if temporal}}
|
|
24
|
+
"@temporalio/client": "^1.11.7",
|
|
25
|
+
"@temporalio/common": "^1.11.7",
|
|
26
|
+
{{/if}}
|
|
27
|
+
"hono": "^4.6.0"{{#if database}},
|
|
28
|
+
"pg": "^8.13.0"{{/if}}
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"@mesh-tech/esm-bundle": "{{#if workspaceDeps}}workspace:*{{else}}latest{{/if}}",
|
|
32
|
+
{{#if database}}
|
|
33
|
+
"@types/pg": "^8.11.0",
|
|
34
|
+
"prisma": "^6.0.0",
|
|
35
|
+
{{/if}}
|
|
36
|
+
"@types/node": "^22.10.2",
|
|
37
|
+
"tsx": "^4.0.0",
|
|
38
|
+
"typescript": "^5.0.0"
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* {{titleCase name}} API
|
|
3
|
+
*
|
|
4
|
+
* Environment variables injected by mesh link():
|
|
5
|
+
* - PORT: Server port (default: 3000)
|
|
6
|
+
{{#if database}}
|
|
7
|
+
* - DATABASE_URL: PostgreSQL connection string
|
|
8
|
+
{{/if}}
|
|
9
|
+
{{#if temporal}}
|
|
10
|
+
* - TEMPORAL_ADDRESS, TEMPORAL_NAMESPACE, TEMPORAL_TASK_QUEUE
|
|
11
|
+
{{/if}}
|
|
12
|
+
{{#if bucket}}
|
|
13
|
+
* - UPLOADS_BUCKET, UPLOADS_REGION
|
|
14
|
+
{{/if}}
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { Hono } from "hono";
|
|
18
|
+
import { serve } from "@hono/node-server";
|
|
19
|
+
{{#if temporal}}
|
|
20
|
+
import { createTemporalClient } from "@mesh-tech/app-kit/temporal-client";
|
|
21
|
+
{{/if}}
|
|
22
|
+
{{#if database}}
|
|
23
|
+
import { getDb } from "./db.js";
|
|
24
|
+
{{/if}}
|
|
25
|
+
|
|
26
|
+
const PORT = parseInt(process.env.PORT ?? "3000", 10);
|
|
27
|
+
const app = new Hono();
|
|
28
|
+
|
|
29
|
+
{{#if temporal}}
|
|
30
|
+
const { withClient } = await createTemporalClient();
|
|
31
|
+
{{/if}}
|
|
32
|
+
|
|
33
|
+
// Health check
|
|
34
|
+
app.get("/health", (c) => c.json({ status: "ok" }));
|
|
35
|
+
|
|
36
|
+
// Hello endpoint
|
|
37
|
+
app.get("/", (c) => c.json({ message: "{{titleCase name}} API" }));
|
|
38
|
+
|
|
39
|
+
{{#if temporal}}
|
|
40
|
+
// Start a workflow
|
|
41
|
+
app.post("/workflow", async (c) => {
|
|
42
|
+
const body = await c.req.json<{ name: string }>();
|
|
43
|
+
const result = await withClient(async (client) => {
|
|
44
|
+
const handle = await client.workflow.start("greetingWorkflow", {
|
|
45
|
+
taskQueue: process.env.TEMPORAL_TASK_QUEUE ?? "{{name}}",
|
|
46
|
+
workflowId: `greeting-${Date.now()}`,
|
|
47
|
+
args: [body.name ?? "world"],
|
|
48
|
+
});
|
|
49
|
+
return handle.result();
|
|
50
|
+
});
|
|
51
|
+
return c.json({ result });
|
|
52
|
+
});
|
|
53
|
+
{{/if}}
|
|
54
|
+
|
|
55
|
+
// Start server
|
|
56
|
+
serve({ fetch: app.fetch, port: PORT, hostname: "0.0.0.0" }, (info) => {
|
|
57
|
+
console.log(`[API] {{titleCase name}} listening on port ${info.port}`);
|
|
58
|
+
});
|
|
@@ -3,9 +3,11 @@
|
|
|
3
3
|
"target": "ES2022",
|
|
4
4
|
"module": "ESNext",
|
|
5
5
|
"moduleResolution": "bundler",
|
|
6
|
-
"esModuleInterop": true,
|
|
7
6
|
"strict": true,
|
|
8
|
-
"
|
|
7
|
+
"esModuleInterop": true,
|
|
8
|
+
"skipLibCheck": true,
|
|
9
|
+
"outDir": "dist",
|
|
10
|
+
"rootDir": "src"
|
|
9
11
|
},
|
|
10
|
-
"include": ["
|
|
12
|
+
"include": ["src"]
|
|
11
13
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
FROM node:20-alpine AS builder
|
|
2
|
+
WORKDIR /app
|
|
3
|
+
COPY package.json pnpm-lock.yaml* ./
|
|
4
|
+
RUN corepack enable && pnpm install --frozen-lockfile
|
|
5
|
+
COPY . .
|
|
6
|
+
RUN pnpm build
|
|
7
|
+
|
|
8
|
+
FROM node:20-alpine
|
|
9
|
+
RUN addgroup -S app && adduser -S app -G app
|
|
10
|
+
WORKDIR /app
|
|
11
|
+
COPY --from=builder /app/package.json /app/pnpm-lock.yaml* ./
|
|
12
|
+
RUN corepack enable && pnpm install --frozen-lockfile --prod
|
|
13
|
+
COPY --from=builder /app/dist ./dist
|
|
14
|
+
USER app
|
|
15
|
+
CMD ["node", "dist/worker.js"]
|
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
"scripts": {
|
|
7
7
|
"dev": "tsx watch src/worker.ts",
|
|
8
8
|
"start": "node dist/worker.js",
|
|
9
|
-
"build": "
|
|
10
|
-
"bundle:workflows": "tsx src/bundle-workflows.ts"
|
|
9
|
+
"build": "esm-bundle src/worker.ts --outfile dist/worker.js --workflows src/workflows.ts --external '@temporalio/*'"
|
|
11
10
|
},
|
|
12
11
|
"dependencies": {
|
|
12
|
+
"@mesh-tech/app-kit": "0.0.10",
|
|
13
13
|
"@temporalio/activity": "^1.11.7",
|
|
14
14
|
"@temporalio/client": "^1.11.7",
|
|
15
15
|
"@temporalio/common": "^1.11.7",
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
"@temporalio/workflow": "^1.11.7"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
|
+
"@mesh-tech/esm-bundle": "{{#if workspaceDeps}}workspace:*{{else}}latest{{/if}}",
|
|
21
22
|
"@types/node": "^20.0.0",
|
|
22
23
|
"tsx": "^4.0.0",
|
|
23
24
|
"typescript": "^5.0.0"
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* {{titleCase name}} Activities
|
|
3
|
+
*
|
|
4
|
+
* Activities handle non-deterministic operations:
|
|
5
|
+
* API calls, database queries, external services, etc.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Generate a greeting message
|
|
10
|
+
*/
|
|
11
|
+
export async function greet(name: string): Promise<string> {
|
|
12
|
+
console.log(`[Activity] Generating greeting for ${name}`);
|
|
13
|
+
return `Hello, ${name}!`;
|
|
14
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* {{titleCase name}} Temporal Worker
|
|
3
|
+
*
|
|
4
|
+
* Uses @mesh-tech/app-kit factories for authenticated connections,
|
|
5
|
+
* encryption codec, and OpenTelemetry instrumentation.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { createTemporalWorker, resolveWorkflows } from "@mesh-tech/app-kit/temporal";
|
|
9
|
+
import * as activities from "./activities.js";
|
|
10
|
+
|
|
11
|
+
async function run() {
|
|
12
|
+
const { worker, cleanup } = await createTemporalWorker({
|
|
13
|
+
activities,
|
|
14
|
+
...await resolveWorkflows(import.meta.url),
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
try {
|
|
18
|
+
await worker.run();
|
|
19
|
+
} finally {
|
|
20
|
+
cleanup();
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
run().catch((err) => {
|
|
25
|
+
console.error("[Worker] Fatal error:", err);
|
|
26
|
+
process.exit(1);
|
|
27
|
+
});
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* {{titleCase name}} Workflows
|
|
3
|
+
*
|
|
4
|
+
* Rules for workflows:
|
|
5
|
+
* - Must be deterministic (same inputs = same outputs)
|
|
6
|
+
* - Cannot use Date.now(), Math.random(), or other non-deterministic APIs
|
|
7
|
+
* - Use sleep() instead of setTimeout()
|
|
8
|
+
* - Use proxyActivities() to call activities
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import { proxyActivities, sleep } from "@temporalio/workflow";
|
|
12
|
+
import type * as activities from "./activities.js";
|
|
13
|
+
|
|
14
|
+
const { greet } = proxyActivities<typeof activities>({
|
|
15
|
+
startToCloseTimeout: "30 seconds",
|
|
16
|
+
retry: { maximumAttempts: 3 },
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Simple greeting workflow
|
|
21
|
+
*/
|
|
22
|
+
export async function greetingWorkflow(name: string): Promise<string> {
|
|
23
|
+
return await greet(name);
|
|
24
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mesh-tech/mesh-cli",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "CLI for Mesh platform development
|
|
3
|
+
"version": "0.12.0",
|
|
4
|
+
"description": "CLI for Mesh platform development utilities",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "UNLICENSED",
|
|
7
7
|
"repository": {
|
|
@@ -13,38 +13,52 @@
|
|
|
13
13
|
"mesh": "./dist/bin/mesh.js"
|
|
14
14
|
},
|
|
15
15
|
"files": [
|
|
16
|
+
"bin/mesh.mjs",
|
|
16
17
|
"dist",
|
|
17
|
-
"templates"
|
|
18
|
+
"templates",
|
|
19
|
+
"fragments",
|
|
20
|
+
"stack",
|
|
21
|
+
".agents",
|
|
22
|
+
"skills",
|
|
23
|
+
"assets"
|
|
24
|
+
],
|
|
25
|
+
"keywords": [
|
|
26
|
+
"tanstack-intent"
|
|
18
27
|
],
|
|
19
|
-
"publishConfig": {
|
|
20
|
-
"access": "public",
|
|
21
|
-
"registry": "https://registry.npmjs.org"
|
|
22
|
-
},
|
|
23
|
-
"scripts": {
|
|
24
|
-
"build": "tsc",
|
|
25
|
-
"dev": "tsc --watch",
|
|
26
|
-
"typecheck": "tsc --noEmit",
|
|
27
|
-
"prepublishOnly": "tsc"
|
|
28
|
-
},
|
|
29
28
|
"exports": {
|
|
30
29
|
".": {
|
|
31
30
|
"types": "./dist/src/index.d.ts",
|
|
32
31
|
"default": "./dist/src/index.js"
|
|
33
|
-
}
|
|
32
|
+
},
|
|
33
|
+
"./package.json": "./package.json"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@
|
|
36
|
+
"@mesh-tech/tsconfig": "1.13.0",
|
|
37
|
+
"@mesh-tech/workflow-viz": "0.2.1",
|
|
38
|
+
"@tanstack/intent": "^0.3.6",
|
|
39
|
+
"@types/node": "^20.0.0",
|
|
40
|
+
"tsx": "^4.20.4"
|
|
37
41
|
},
|
|
38
42
|
"dependencies": {
|
|
43
|
+
"@aws-sdk/client-route-53": "^3.700.0",
|
|
39
44
|
"@aws-sdk/client-secrets-manager": "^3.700.0",
|
|
40
45
|
"@aws-sdk/client-ssm": "^3.700.0",
|
|
41
|
-
"@
|
|
42
|
-
"@inquirer/
|
|
46
|
+
"@aws-sdk/client-sts": "^3.700.0",
|
|
47
|
+
"@inquirer/checkbox": "^4.2.0",
|
|
48
|
+
"@inquirer/input": "^4.2.1",
|
|
49
|
+
"@inquirer/password": "^4.0.17",
|
|
50
|
+
"@inquirer/select": "^4.3.1",
|
|
43
51
|
"chalk": "^5.3.0",
|
|
44
52
|
"commander": "^12.1.0",
|
|
45
|
-
"handlebars": "^4.7.8"
|
|
53
|
+
"handlebars": "^4.7.8",
|
|
54
|
+
"yaml": "^2.8.1",
|
|
55
|
+
"zod": "^4.2.1"
|
|
56
|
+
},
|
|
57
|
+
"optionalDependencies": {
|
|
58
|
+
"@aws-sdk/client-s3": "^3.864.0",
|
|
59
|
+
"@temporalio/client": "^1.17.0",
|
|
60
|
+
"@temporalio/common": "^1.17.0"
|
|
46
61
|
},
|
|
47
|
-
"
|
|
48
|
-
|
|
49
|
-
}
|
|
62
|
+
"main": "./dist/src/index.js",
|
|
63
|
+
"types": "./dist/src/index.d.ts"
|
|
50
64
|
}
|