@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,577 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* mesh workflow — workflow tooling commands
|
|
3
|
+
*
|
|
4
|
+
* Commands:
|
|
5
|
+
* mesh workflow extract-ir <path> Extract WorkflowIR from Temporal workflow source
|
|
6
|
+
* mesh workflow inventory <path> Extract the as-built command/query/activity inventory
|
|
7
|
+
* mesh workflow lint-process <path> Lint a process artifact's bindings against the code inventory
|
|
8
|
+
*
|
|
9
|
+
* Examples:
|
|
10
|
+
* # Extract and print to stdout
|
|
11
|
+
* mesh workflow extract-ir apps/ops/worker/src/workflows/
|
|
12
|
+
*
|
|
13
|
+
* # Extract and upload to S3
|
|
14
|
+
* mesh workflow extract-ir apps/ops/worker/src/workflows/ --app ops --upload mesh-trabian-dev-artifacts
|
|
15
|
+
*
|
|
16
|
+
* # Print the as-built inventory (lint's code-side input)
|
|
17
|
+
* mesh workflow inventory apps/ops/worker/src/workflows/workflows.ts
|
|
18
|
+
*
|
|
19
|
+
* # Lint a process artifact (conformance) — sibling process/*.process.json auto-discovered
|
|
20
|
+
* mesh workflow lint-process apps/ops/worker/src/workflows.ts --predicates engagementComplete,accountNumbersComplete
|
|
21
|
+
*/
|
|
22
|
+
import * as fs from "fs";
|
|
23
|
+
import * as path from "path";
|
|
24
|
+
import { createRequire } from "module";
|
|
25
|
+
import { execFileSync } from "child_process";
|
|
26
|
+
import { logError, logInfo, logSuccess, logWarn } from "../utils/log.js";
|
|
27
|
+
/**
|
|
28
|
+
* Shared subprocess-script helpers: discover auxiliary source files (shared
|
|
29
|
+
* helpers/child workflows) and activity definition files referenced by a
|
|
30
|
+
* workflow file's imports, so the extractor can resolve calls/signatures
|
|
31
|
+
* across files. Emitted verbatim into both the extract-ir and inventory
|
|
32
|
+
* tsx scripts below (they run as plain functions inside the subprocess, not
|
|
33
|
+
* in this process, so they can't be imported/shared as normal TS).
|
|
34
|
+
*/
|
|
35
|
+
const DISCOVERY_HELPERS_SRC = `
|
|
36
|
+
function discoverAux(filePath, source) {
|
|
37
|
+
const dir = dirname(filePath);
|
|
38
|
+
const aux = {};
|
|
39
|
+
const re = /import\\s+(?:type\\s+)?(?:(?:\\{[^}]*\\}|\\*\\s+as\\s+\\w+)(?:\\s*,\\s*)?)+\\s+from\\s+["'](\\.[^"']+)["']/g;
|
|
40
|
+
let m;
|
|
41
|
+
while ((m = re.exec(source)) !== null) {
|
|
42
|
+
const spec = m[1];
|
|
43
|
+
if (!spec.startsWith("./") && !spec.startsWith("../")) continue;
|
|
44
|
+
for (const c of [join(dir, spec.replace(/\\.js$/, ".ts")), join(dir, spec + ".ts")]) {
|
|
45
|
+
if (existsSync(c) && statSync(c).isFile()) {
|
|
46
|
+
const s = readFileSync(c, "utf-8");
|
|
47
|
+
if (s.includes("proxyActivities") || s.includes("@temporalio/workflow") || s.includes("wf.")) {
|
|
48
|
+
aux[spec] = s;
|
|
49
|
+
}
|
|
50
|
+
break;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return aux;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function discoverActivities(filePath, source) {
|
|
58
|
+
const dir = dirname(filePath);
|
|
59
|
+
const acts = {};
|
|
60
|
+
const re = /import\\s+type\\s+\\{[^}]*createActivities[^}]*\\}\\s+from\\s+["'](\\.[^"']+)["']/g;
|
|
61
|
+
let m;
|
|
62
|
+
while ((m = re.exec(source)) !== null) {
|
|
63
|
+
const spec = m[1];
|
|
64
|
+
for (const c of [join(dir, spec.replace(/\\.js$/, ".ts")), join(dir, spec + ".ts")]) {
|
|
65
|
+
if (existsSync(c) && statSync(c).isFile()) {
|
|
66
|
+
acts[spec] = readFileSync(c, "utf-8");
|
|
67
|
+
const actDir = dirname(c);
|
|
68
|
+
try {
|
|
69
|
+
for (const sib of readdirSync(actDir)) {
|
|
70
|
+
if (!sib.endsWith(".ts") || sib === basename(c)) continue;
|
|
71
|
+
const sp = join(actDir, sib);
|
|
72
|
+
if (statSync(sp).isFile()) {
|
|
73
|
+
acts[spec.replace(/\\/[^/]+$/, "/" + sib.replace(".ts", ".js"))] = readFileSync(sp, "utf-8");
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
} catch {}
|
|
77
|
+
break;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
return acts;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Discover a sibling process artifact for a workflow file: a "process/"
|
|
86
|
+
* directory containing "*.process.json" files, checked both next to the
|
|
87
|
+
* workflow file itself AND next to its parent directory (worker packages
|
|
88
|
+
* typically nest the workflow file under "src/", with "process/" a sibling
|
|
89
|
+
* of "src/" at the package root, not of the file directly — e.g.
|
|
90
|
+
* "worker/src/workflows.ts" + "worker/process/*.process.json"). Since
|
|
91
|
+
* extractWorkflowIR itself validates the artifact (schema errors and a
|
|
92
|
+
* workflowType mismatch both fall back with a warning, never throw — P6),
|
|
93
|
+
* this only needs a best-effort guess at the workflow's name to avoid
|
|
94
|
+
* bothering with an OBVIOUSLY unrelated file in a multi-workflow directory —
|
|
95
|
+
* a quick regex for the first exported async function, same derivation
|
|
96
|
+
* extractWorkflowIR falls back to absent an explicit \`name\` override.
|
|
97
|
+
* Returns the parsed JSON (unknown to this script) or undefined.
|
|
98
|
+
*/
|
|
99
|
+
function discoverProcessArtifact(filePath, source) {
|
|
100
|
+
const fileDir = dirname(filePath);
|
|
101
|
+
const candidateDirs = [join(fileDir, "process"), join(fileDir, "..", "process")];
|
|
102
|
+
|
|
103
|
+
const nameMatch = source.match(/export\\s+async\\s+function\\s+(\\w+)/);
|
|
104
|
+
const guessedName = nameMatch ? nameMatch[1] : undefined;
|
|
105
|
+
|
|
106
|
+
for (const procDir of candidateDirs) {
|
|
107
|
+
if (!existsSync(procDir) || !statSync(procDir).isDirectory()) continue;
|
|
108
|
+
for (const entry of readdirSync(procDir)) {
|
|
109
|
+
if (!entry.endsWith(".process.json")) continue;
|
|
110
|
+
const entryPath = join(procDir, entry);
|
|
111
|
+
if (!statSync(entryPath).isFile()) continue;
|
|
112
|
+
try {
|
|
113
|
+
const parsed = JSON.parse(readFileSync(entryPath, "utf-8"));
|
|
114
|
+
if (!guessedName || parsed?.process?.workflowType === guessedName) {
|
|
115
|
+
return parsed;
|
|
116
|
+
}
|
|
117
|
+
} catch {
|
|
118
|
+
// Not valid JSON — skip; extractWorkflowIR would reject it anyway.
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
return undefined;
|
|
123
|
+
}
|
|
124
|
+
`;
|
|
125
|
+
/**
|
|
126
|
+
* Resolve the path to @mesh-tech/workflow-viz/ast-extractor source file.
|
|
127
|
+
* Uses createRequire from the CLI's own location so workspace links resolve.
|
|
128
|
+
*/
|
|
129
|
+
function resolveExtractorPath() {
|
|
130
|
+
try {
|
|
131
|
+
const require = createRequire(import.meta.url);
|
|
132
|
+
const resolved = require.resolve("@mesh-tech/workflow-viz/ast-extractor");
|
|
133
|
+
return resolved;
|
|
134
|
+
}
|
|
135
|
+
catch {
|
|
136
|
+
return null;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Run the extraction in a tsx subprocess. The extractor depends on ts-morph
|
|
141
|
+
* and workflow-viz exports TypeScript source (no dist build), so we need tsx
|
|
142
|
+
* rather than plain Node.
|
|
143
|
+
*
|
|
144
|
+
* `explicitProcessPath`, when given, is read here (parent process) and baked
|
|
145
|
+
* into the script verbatim, applied to EVERY discovered workflow file
|
|
146
|
+
* (extractWorkflowIR's own workflowType check drops it wherever it doesn't
|
|
147
|
+
* match — P6). Absent that, each file gets a sibling `process/*.process.json`
|
|
148
|
+
* lookup (see `discoverProcessArtifact` in DISCOVERY_HELPERS_SRC).
|
|
149
|
+
*
|
|
150
|
+
* Returns parsed ExtractedWorkflow[] or null on failure.
|
|
151
|
+
*/
|
|
152
|
+
function runExtraction(targetPath, extractorPath, explicitProcessPath) {
|
|
153
|
+
let explicitProcessArtifact;
|
|
154
|
+
if (explicitProcessPath) {
|
|
155
|
+
try {
|
|
156
|
+
explicitProcessArtifact = JSON.parse(fs.readFileSync(explicitProcessPath, "utf-8"));
|
|
157
|
+
}
|
|
158
|
+
catch (err) {
|
|
159
|
+
logError(`Could not read/parse --process ${explicitProcessPath}: ${err instanceof Error ? err.message : String(err)}`);
|
|
160
|
+
return null;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
// Build an inline script that does the extraction and writes JSON to stdout.
|
|
164
|
+
// Stderr is used for progress messages.
|
|
165
|
+
const script = `
|
|
166
|
+
import { extractWorkflowIR } from "${extractorPath.replace(/\\/g, "/")}";
|
|
167
|
+
import { readFileSync, readdirSync, statSync, existsSync } from "node:fs";
|
|
168
|
+
import { basename, dirname, join } from "node:path";
|
|
169
|
+
${DISCOVERY_HELPERS_SRC}
|
|
170
|
+
const target = ${JSON.stringify(targetPath)};
|
|
171
|
+
const explicitProcessArtifact = ${JSON.stringify(explicitProcessArtifact ?? null)};
|
|
172
|
+
const stat = statSync(target);
|
|
173
|
+
const files = stat.isDirectory()
|
|
174
|
+
? readdirSync(target).filter(f => f.endsWith(".ts") && f !== "index.ts").map(f => join(target, f))
|
|
175
|
+
: [target];
|
|
176
|
+
|
|
177
|
+
const results = [];
|
|
178
|
+
for (const file of files) {
|
|
179
|
+
const source = readFileSync(file, "utf-8");
|
|
180
|
+
if (!source.includes("proxyActivities") && !source.includes("@temporalio/workflow")) continue;
|
|
181
|
+
try {
|
|
182
|
+
const aux = discoverAux(file, source);
|
|
183
|
+
const acts = discoverActivities(file, source);
|
|
184
|
+
const processArtifact = explicitProcessArtifact ?? discoverProcessArtifact(file, source);
|
|
185
|
+
const extractOptions = { auxiliarySources: aux, activitySources: acts };
|
|
186
|
+
if (processArtifact) extractOptions.processArtifact = processArtifact;
|
|
187
|
+
const ir = extractWorkflowIR(source, extractOptions);
|
|
188
|
+
const name = ir.name || basename(file, ".ts");
|
|
189
|
+
results.push({ workflowType: name, ir, sourceFile: file });
|
|
190
|
+
process.stderr.write(" " + name + " (" + ir.nodes.length + " nodes, " + ir.edges.length + " edges)\\n");
|
|
191
|
+
} catch (err) {
|
|
192
|
+
process.stderr.write(" skip " + file + ": " + err.message + "\\n");
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
process.stdout.write(JSON.stringify(results));
|
|
196
|
+
`;
|
|
197
|
+
try {
|
|
198
|
+
const result = execFileSync("npx", ["tsx", "--eval", script], {
|
|
199
|
+
encoding: "utf-8",
|
|
200
|
+
stdio: ["pipe", "pipe", "inherit"],
|
|
201
|
+
maxBuffer: 10 * 1024 * 1024,
|
|
202
|
+
});
|
|
203
|
+
return JSON.parse(result);
|
|
204
|
+
}
|
|
205
|
+
catch (err) {
|
|
206
|
+
logError(`Extraction subprocess failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
207
|
+
return null;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Run inventory extraction in a tsx subprocess — same aux-discovery pattern
|
|
212
|
+
* as {@link runExtraction}, but calls `extractInventory` instead of
|
|
213
|
+
* `extractWorkflowIR` and returns the as-built {@link Inventory} per
|
|
214
|
+
* discovered workflow file.
|
|
215
|
+
*
|
|
216
|
+
* Returns parsed Inventory[] or null on failure.
|
|
217
|
+
*/
|
|
218
|
+
function runInventoryExtraction(targetPath, extractorPath) {
|
|
219
|
+
const script = `
|
|
220
|
+
import { extractInventory } from "${extractorPath.replace(/\\/g, "/")}";
|
|
221
|
+
import { readFileSync, readdirSync, statSync, existsSync } from "node:fs";
|
|
222
|
+
import { basename, dirname, join } from "node:path";
|
|
223
|
+
${DISCOVERY_HELPERS_SRC}
|
|
224
|
+
const target = ${JSON.stringify(targetPath)};
|
|
225
|
+
const stat = statSync(target);
|
|
226
|
+
const files = stat.isDirectory()
|
|
227
|
+
? readdirSync(target).filter(f => f.endsWith(".ts") && f !== "index.ts").map(f => join(target, f))
|
|
228
|
+
: [target];
|
|
229
|
+
|
|
230
|
+
const results = [];
|
|
231
|
+
for (const file of files) {
|
|
232
|
+
const source = readFileSync(file, "utf-8");
|
|
233
|
+
if (!source.includes("proxyActivities") && !source.includes("@temporalio/workflow")) continue;
|
|
234
|
+
try {
|
|
235
|
+
const aux = discoverAux(file, source);
|
|
236
|
+
const acts = discoverActivities(file, source);
|
|
237
|
+
const inventory = extractInventory(source, { auxiliarySources: aux, activitySources: acts });
|
|
238
|
+
results.push(inventory);
|
|
239
|
+
process.stderr.write(" " + inventory.workflowType + " (" + inventory.commands.length + " commands, " + inventory.queries.length + " queries, " + inventory.activities.length + " activities)\\n");
|
|
240
|
+
} catch (err) {
|
|
241
|
+
process.stderr.write(" skip " + file + ": " + err.message + "\\n");
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
process.stdout.write(JSON.stringify(results));
|
|
245
|
+
`;
|
|
246
|
+
try {
|
|
247
|
+
const result = execFileSync("npx", ["tsx", "--eval", script], {
|
|
248
|
+
encoding: "utf-8",
|
|
249
|
+
stdio: ["pipe", "pipe", "inherit"],
|
|
250
|
+
maxBuffer: 10 * 1024 * 1024,
|
|
251
|
+
});
|
|
252
|
+
return JSON.parse(result);
|
|
253
|
+
}
|
|
254
|
+
catch (err) {
|
|
255
|
+
logError(`Inventory extraction subprocess failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
256
|
+
return null;
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
260
|
+
* Run inventory + process-artifact discovery in a tsx subprocess, for
|
|
261
|
+
* `lint-process`. Same aux/activity discovery as {@link runInventoryExtraction};
|
|
262
|
+
* additionally resolves each file's process artifact the same way
|
|
263
|
+
* {@link runExtraction} does — `explicitProcessPath` (baked in, applied to
|
|
264
|
+
* every discovered file) if given, else the sibling `process/*.process.json`
|
|
265
|
+
* lookup (`discoverProcessArtifact` in DISCOVERY_HELPERS_SRC).
|
|
266
|
+
*
|
|
267
|
+
* Parsing/linting the artifact happens back in the parent process (not
|
|
268
|
+
* here) since `parseProcessArtifact`/`lintProcess` are plain TS this file
|
|
269
|
+
* can import directly — no need to duplicate them into the subprocess script.
|
|
270
|
+
*
|
|
271
|
+
* Returns parsed LintExtractionResult[] or null on failure.
|
|
272
|
+
*/
|
|
273
|
+
function runLintExtraction(targetPath, extractorPath, explicitProcessPath) {
|
|
274
|
+
let explicitProcessArtifact;
|
|
275
|
+
if (explicitProcessPath) {
|
|
276
|
+
try {
|
|
277
|
+
explicitProcessArtifact = JSON.parse(fs.readFileSync(explicitProcessPath, "utf-8"));
|
|
278
|
+
}
|
|
279
|
+
catch (err) {
|
|
280
|
+
logError(`Could not read/parse --process ${explicitProcessPath}: ${err instanceof Error ? err.message : String(err)}`);
|
|
281
|
+
return null;
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
const script = `
|
|
285
|
+
import { extractInventory } from "${extractorPath.replace(/\\/g, "/")}";
|
|
286
|
+
import { readFileSync, readdirSync, statSync, existsSync } from "node:fs";
|
|
287
|
+
import { basename, dirname, join } from "node:path";
|
|
288
|
+
${DISCOVERY_HELPERS_SRC}
|
|
289
|
+
const target = ${JSON.stringify(targetPath)};
|
|
290
|
+
const explicitProcessArtifact = ${JSON.stringify(explicitProcessArtifact ?? null)};
|
|
291
|
+
const stat = statSync(target);
|
|
292
|
+
const files = stat.isDirectory()
|
|
293
|
+
? readdirSync(target).filter(f => f.endsWith(".ts") && f !== "index.ts").map(f => join(target, f))
|
|
294
|
+
: [target];
|
|
295
|
+
|
|
296
|
+
const results = [];
|
|
297
|
+
for (const file of files) {
|
|
298
|
+
const source = readFileSync(file, "utf-8");
|
|
299
|
+
if (!source.includes("proxyActivities") && !source.includes("@temporalio/workflow")) continue;
|
|
300
|
+
try {
|
|
301
|
+
const aux = discoverAux(file, source);
|
|
302
|
+
const acts = discoverActivities(file, source);
|
|
303
|
+
const inventory = extractInventory(source, { auxiliarySources: aux, activitySources: acts });
|
|
304
|
+
const processArtifact = explicitProcessArtifact ?? discoverProcessArtifact(file, source) ?? null;
|
|
305
|
+
results.push({ inventory, processArtifact, sourceFile: file });
|
|
306
|
+
process.stderr.write(" " + inventory.workflowType + " (" + inventory.commands.length + " commands, " + inventory.queries.length + " queries, " + inventory.activities.length + " activities)\\n");
|
|
307
|
+
} catch (err) {
|
|
308
|
+
process.stderr.write(" skip " + file + ": " + err.message + "\\n");
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
process.stdout.write(JSON.stringify(results));
|
|
312
|
+
`;
|
|
313
|
+
try {
|
|
314
|
+
const result = execFileSync("npx", ["tsx", "--eval", script], {
|
|
315
|
+
encoding: "utf-8",
|
|
316
|
+
stdio: ["pipe", "pipe", "inherit"],
|
|
317
|
+
maxBuffer: 10 * 1024 * 1024,
|
|
318
|
+
});
|
|
319
|
+
return JSON.parse(result);
|
|
320
|
+
}
|
|
321
|
+
catch (err) {
|
|
322
|
+
logError(`Lint extraction subprocess failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
323
|
+
return null;
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
async function uploadToS3(bucket, appName, workflows) {
|
|
327
|
+
const { S3Client, PutObjectCommand } = await import("@aws-sdk/client-s3");
|
|
328
|
+
const s3 = new S3Client({ region: process.env.AWS_REGION ?? "us-east-2" });
|
|
329
|
+
for (const wf of workflows) {
|
|
330
|
+
const key = `workflow-ir/${appName}/${wf.workflowType}.json`;
|
|
331
|
+
const body = JSON.stringify(wf.ir, null, 2);
|
|
332
|
+
logInfo(` Uploading s3://${bucket}/${key} (${body.length} bytes)`);
|
|
333
|
+
await s3.send(new PutObjectCommand({
|
|
334
|
+
Bucket: bucket,
|
|
335
|
+
Key: key,
|
|
336
|
+
Body: body,
|
|
337
|
+
ContentType: "application/json",
|
|
338
|
+
}));
|
|
339
|
+
}
|
|
340
|
+
const manifest = {
|
|
341
|
+
extractedAt: new Date().toISOString(),
|
|
342
|
+
app: appName,
|
|
343
|
+
workflows: Object.fromEntries(workflows.map((wf) => [
|
|
344
|
+
wf.workflowType,
|
|
345
|
+
{
|
|
346
|
+
sourceFile: wf.sourceFile,
|
|
347
|
+
nodeCount: wf.ir.nodes.length,
|
|
348
|
+
edgeCount: wf.ir.edges.length,
|
|
349
|
+
},
|
|
350
|
+
])),
|
|
351
|
+
};
|
|
352
|
+
const manifestKey = `workflow-ir/${appName}/_manifest.json`;
|
|
353
|
+
logInfo(` Uploading s3://${bucket}/${manifestKey}`);
|
|
354
|
+
await s3.send(new PutObjectCommand({
|
|
355
|
+
Bucket: bucket,
|
|
356
|
+
Key: manifestKey,
|
|
357
|
+
Body: JSON.stringify(manifest, null, 2),
|
|
358
|
+
ContentType: "application/json",
|
|
359
|
+
}));
|
|
360
|
+
}
|
|
361
|
+
export function registerWorkflowCommands(program) {
|
|
362
|
+
const workflow = program
|
|
363
|
+
.command("workflow")
|
|
364
|
+
.description("Workflow tooling — IR extraction, visualization");
|
|
365
|
+
workflow
|
|
366
|
+
.command("extract-ir <path>")
|
|
367
|
+
.description("Extract WorkflowIR from Temporal workflow source files\n\n" +
|
|
368
|
+
"Parses TypeScript workflow code into a graph (nodes + edges) for visualization.\n" +
|
|
369
|
+
"Supports single files or directories.")
|
|
370
|
+
.option("--app <name>", "Application name (used as S3 key prefix)")
|
|
371
|
+
.option("--upload <bucket>", "S3 bucket to upload extracted IR (requires --app)")
|
|
372
|
+
.option("--process <path>", "Path to a process artifact JSON file (docs/plans/2026-07-05-process-artifact-design.md §1); " +
|
|
373
|
+
"renders substeps/actors/outcomes in place of a BUSINESS_STAGES map. Absent this flag, a sibling " +
|
|
374
|
+
"process/*.process.json is auto-discovered per workflow file.")
|
|
375
|
+
.action(async (targetPath, opts) => {
|
|
376
|
+
try {
|
|
377
|
+
const resolvedPath = path.resolve(targetPath);
|
|
378
|
+
if (!fs.existsSync(resolvedPath)) {
|
|
379
|
+
logError(`Path does not exist: ${resolvedPath}`);
|
|
380
|
+
process.exitCode = 1;
|
|
381
|
+
return;
|
|
382
|
+
}
|
|
383
|
+
let resolvedProcessPath;
|
|
384
|
+
if (opts.process) {
|
|
385
|
+
resolvedProcessPath = path.resolve(opts.process);
|
|
386
|
+
if (!fs.existsSync(resolvedProcessPath)) {
|
|
387
|
+
logError(`--process path does not exist: ${resolvedProcessPath}`);
|
|
388
|
+
process.exitCode = 1;
|
|
389
|
+
return;
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
const extractorPath = resolveExtractorPath();
|
|
393
|
+
if (!extractorPath) {
|
|
394
|
+
logError("Cannot resolve @mesh-tech/workflow-viz/ast-extractor.\n" +
|
|
395
|
+
"Workflow viz is an OPTIONAL peer of the CLI. In the monorepo it is already linked;\n" +
|
|
396
|
+
"from a registry install, add it: npm i -g @mesh-tech/workflow-viz");
|
|
397
|
+
process.exitCode = 1;
|
|
398
|
+
return;
|
|
399
|
+
}
|
|
400
|
+
logInfo(`Extracting WorkflowIR from ${resolvedPath}`);
|
|
401
|
+
const results = runExtraction(resolvedPath, extractorPath, resolvedProcessPath);
|
|
402
|
+
if (!results || results.length === 0) {
|
|
403
|
+
if (results)
|
|
404
|
+
logWarn("No workflows found");
|
|
405
|
+
process.exitCode = results ? 0 : 1;
|
|
406
|
+
return;
|
|
407
|
+
}
|
|
408
|
+
for (const wf of results) {
|
|
409
|
+
logSuccess(` ${wf.workflowType} (${wf.ir.nodes.length} nodes, ${wf.ir.edges.length} edges)`);
|
|
410
|
+
}
|
|
411
|
+
if (opts.upload && opts.app) {
|
|
412
|
+
logInfo(`Uploading ${results.length} workflow IR(s) to s3://${opts.upload}/workflow-ir/${opts.app}/`);
|
|
413
|
+
await uploadToS3(opts.upload, opts.app, results);
|
|
414
|
+
logSuccess("Upload complete");
|
|
415
|
+
}
|
|
416
|
+
else if (opts.upload || opts.app) {
|
|
417
|
+
logWarn("Both --app and --upload required for S3 upload");
|
|
418
|
+
}
|
|
419
|
+
else {
|
|
420
|
+
console.log(JSON.stringify(results.map((r) => r.ir), null, 2));
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
catch (error) {
|
|
424
|
+
logError(`Extraction failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
425
|
+
process.exitCode = 1;
|
|
426
|
+
}
|
|
427
|
+
});
|
|
428
|
+
workflow
|
|
429
|
+
.command("inventory <path>")
|
|
430
|
+
.description("Extract the as-built command/query/activity inventory from Temporal workflow source\n\n" +
|
|
431
|
+
"The inventory ({ workflowType, commands, queries, activities }) is the process-\n" +
|
|
432
|
+
"conformance lint's code-side input — it is never hand-edited. Supports single\n" +
|
|
433
|
+
"files or directories.")
|
|
434
|
+
.action(async (targetPath) => {
|
|
435
|
+
try {
|
|
436
|
+
const resolvedPath = path.resolve(targetPath);
|
|
437
|
+
if (!fs.existsSync(resolvedPath)) {
|
|
438
|
+
logError(`Path does not exist: ${resolvedPath}`);
|
|
439
|
+
process.exitCode = 1;
|
|
440
|
+
return;
|
|
441
|
+
}
|
|
442
|
+
const extractorPath = resolveExtractorPath();
|
|
443
|
+
if (!extractorPath) {
|
|
444
|
+
logError("Cannot resolve @mesh-tech/workflow-viz/ast-extractor.\n" +
|
|
445
|
+
"Workflow viz is an OPTIONAL peer of the CLI. In the monorepo it is already linked;\n" +
|
|
446
|
+
"from a registry install, add it: npm i -g @mesh-tech/workflow-viz");
|
|
447
|
+
process.exitCode = 1;
|
|
448
|
+
return;
|
|
449
|
+
}
|
|
450
|
+
logInfo(`Extracting inventory from ${resolvedPath}`);
|
|
451
|
+
const results = runInventoryExtraction(resolvedPath, extractorPath);
|
|
452
|
+
if (!results || results.length === 0) {
|
|
453
|
+
if (results)
|
|
454
|
+
logWarn("No workflows found");
|
|
455
|
+
process.exitCode = results ? 0 : 1;
|
|
456
|
+
return;
|
|
457
|
+
}
|
|
458
|
+
for (const inv of results) {
|
|
459
|
+
logSuccess(` ${inv.workflowType} (${inv.commands.length} commands, ${inv.queries.length} queries, ${inv.activities.length} activities)`);
|
|
460
|
+
}
|
|
461
|
+
console.log(JSON.stringify(results.length === 1 ? results[0] : results, null, 2));
|
|
462
|
+
}
|
|
463
|
+
catch (error) {
|
|
464
|
+
logError(`Inventory extraction failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
465
|
+
process.exitCode = 1;
|
|
466
|
+
}
|
|
467
|
+
});
|
|
468
|
+
workflow
|
|
469
|
+
.command("lint-process <path>")
|
|
470
|
+
.description("Lint a process artifact's bindings against the as-built code inventory\n\n" +
|
|
471
|
+
"Reuses the inventory extraction's aux/activity discovery, resolves the process\n" +
|
|
472
|
+
"artifact (--process, or the same sibling process/*.process.json discovery\n" +
|
|
473
|
+
"extract-ir uses), then runs parseProcessArtifact + lintProcess against it.\n\n" +
|
|
474
|
+
"Without --predicates, the CLI cannot verify predicate names against the worker's\n" +
|
|
475
|
+
"registry (it has no way to execute it) — predicate-existence findings are skipped\n" +
|
|
476
|
+
"and a note is printed; every other rule (bindings, coverage, ids, outcomes,\n" +
|
|
477
|
+
"workflowType) still runs. Pass --predicates for full conformance, or rely on the\n" +
|
|
478
|
+
"worker's own process-conformance test which has the registry in-process.")
|
|
479
|
+
.option("--process <path>", "Path to a process artifact JSON file. Absent this flag, a sibling " +
|
|
480
|
+
"process/*.process.json is auto-discovered per workflow file.")
|
|
481
|
+
.option("--predicates <names>", "Comma-separated named-predicate registry (enables UNKNOWN_PREDICATE checks)")
|
|
482
|
+
.action(async (targetPath, opts) => {
|
|
483
|
+
try {
|
|
484
|
+
const resolvedPath = path.resolve(targetPath);
|
|
485
|
+
if (!fs.existsSync(resolvedPath)) {
|
|
486
|
+
logError(`Path does not exist: ${resolvedPath}`);
|
|
487
|
+
process.exitCode = 1;
|
|
488
|
+
return;
|
|
489
|
+
}
|
|
490
|
+
let resolvedProcessPath;
|
|
491
|
+
if (opts.process) {
|
|
492
|
+
resolvedProcessPath = path.resolve(opts.process);
|
|
493
|
+
if (!fs.existsSync(resolvedProcessPath)) {
|
|
494
|
+
logError(`--process path does not exist: ${resolvedProcessPath}`);
|
|
495
|
+
process.exitCode = 1;
|
|
496
|
+
return;
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
const extractorPath = resolveExtractorPath();
|
|
500
|
+
if (!extractorPath) {
|
|
501
|
+
logError("Cannot resolve @mesh-tech/workflow-viz/ast-extractor.\n" +
|
|
502
|
+
"Workflow viz is an OPTIONAL peer of the CLI. In the monorepo it is already linked;\n" +
|
|
503
|
+
"from a registry install, add it: npm i -g @mesh-tech/workflow-viz");
|
|
504
|
+
process.exitCode = 1;
|
|
505
|
+
return;
|
|
506
|
+
}
|
|
507
|
+
// Lazy-load workflow-model's runtime exports (see the import note at top): a
|
|
508
|
+
// static import would take down `mesh` bootstrap in the published CLI. Fail
|
|
509
|
+
// gracefully here, exactly like the extractor resolution above.
|
|
510
|
+
let parseProcessArtifact;
|
|
511
|
+
let lintProcess;
|
|
512
|
+
try {
|
|
513
|
+
({ parseProcessArtifact } = await import("@mesh-tech/workflow-model"));
|
|
514
|
+
({ lintProcess } = await import("@mesh-tech/workflow-model"));
|
|
515
|
+
}
|
|
516
|
+
catch {
|
|
517
|
+
logError("Cannot resolve @mesh-tech/workflow-model (parseProcessArtifact / lintProcess).\n" +
|
|
518
|
+
"It is bundled into the published CLI — on a registry install this means a broken install; reinstall the CLI. In the monorepo, run the scoped install (pnpm bootstrap:worktree @mesh-tech/mesh-cli).");
|
|
519
|
+
process.exitCode = 1;
|
|
520
|
+
return;
|
|
521
|
+
}
|
|
522
|
+
const predicateNames = opts.predicates
|
|
523
|
+
? opts.predicates.split(",").map((s) => s.trim()).filter((s) => s.length > 0)
|
|
524
|
+
: undefined;
|
|
525
|
+
if (!predicateNames) {
|
|
526
|
+
logWarn("predicate checks skipped — pass --predicates or run the worker conformance test");
|
|
527
|
+
}
|
|
528
|
+
logInfo(`Linting process artifact(s) against ${resolvedPath}`);
|
|
529
|
+
const results = runLintExtraction(resolvedPath, extractorPath, resolvedProcessPath);
|
|
530
|
+
if (!results || results.length === 0) {
|
|
531
|
+
if (results)
|
|
532
|
+
logWarn("No workflows found");
|
|
533
|
+
process.exitCode = results ? 0 : 1;
|
|
534
|
+
return;
|
|
535
|
+
}
|
|
536
|
+
let hasError = false;
|
|
537
|
+
for (const { inventory, processArtifact, sourceFile } of results) {
|
|
538
|
+
console.log(`\n${inventory.workflowType} (${sourceFile})`);
|
|
539
|
+
if (!processArtifact) {
|
|
540
|
+
logError(" No process artifact found (checked --process and sibling process/*.process.json).");
|
|
541
|
+
hasError = true;
|
|
542
|
+
continue;
|
|
543
|
+
}
|
|
544
|
+
const { artifact, diagnostics: parseDiagnostics } = parseProcessArtifact(processArtifact);
|
|
545
|
+
let diagnostics = parseDiagnostics;
|
|
546
|
+
if (artifact) {
|
|
547
|
+
const lintDiagnostics = lintProcess(artifact, inventory, predicateNames ?? []);
|
|
548
|
+
const reportable = predicateNames
|
|
549
|
+
? lintDiagnostics
|
|
550
|
+
: lintDiagnostics.filter((d) => d.code !== "UNKNOWN_PREDICATE");
|
|
551
|
+
diagnostics = diagnostics.concat(reportable);
|
|
552
|
+
}
|
|
553
|
+
if (diagnostics.length === 0) {
|
|
554
|
+
logSuccess(" clean");
|
|
555
|
+
}
|
|
556
|
+
else {
|
|
557
|
+
for (const d of diagnostics) {
|
|
558
|
+
const line = ` [${d.severity}] ${d.code} ${d.path}: ${d.message}`;
|
|
559
|
+
if (d.severity === "error") {
|
|
560
|
+
logError(line);
|
|
561
|
+
hasError = true;
|
|
562
|
+
}
|
|
563
|
+
else {
|
|
564
|
+
logWarn(line);
|
|
565
|
+
}
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
process.exitCode = hasError ? 1 : 0;
|
|
570
|
+
}
|
|
571
|
+
catch (error) {
|
|
572
|
+
logError(`Lint failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
573
|
+
process.exitCode = 1;
|
|
574
|
+
}
|
|
575
|
+
});
|
|
576
|
+
}
|
|
577
|
+
//# sourceMappingURL=workflow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow.js","sourceRoot":"","sources":["../../../src/commands/workflow.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAGH,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAQ7C,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAQzE;;;;;;;GAOG;AACH,MAAM,qBAAqB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyF7B,CAAC;AAEF;;;GAGG;AACH,SAAS,oBAAoB;IAC3B,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC/C,MAAM,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC,uCAAuC,CAAC,CAAC;QAC1E,OAAO,QAAQ,CAAC;IAClB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,SAAS,aAAa,CACpB,UAAkB,EAClB,aAAqB,EACrB,mBAA4B;IAE5B,IAAI,uBAAgC,CAAC;IACrC,IAAI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