@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,259 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* mesh cluster access — `mesh kubectl` / `mesh logs` / `mesh exec` against a
|
|
3
|
+
* deployed app's EKS cluster, authenticated as the app's Zitadel deployer role
|
|
4
|
+
* (MESH-2060).
|
|
5
|
+
*
|
|
6
|
+
* Reuses exactly what `mesh dev` already does internally: assume the app's
|
|
7
|
+
* deployer role, build a session kubeconfig from the platform `eks` SSM export
|
|
8
|
+
* (`aws eks get-token` — needs neither `eks:DescribeCluster` nor a readable
|
|
9
|
+
* `~/.kube/config`, which macOS TCC blocks for non-FDA shells), and shell out to
|
|
10
|
+
* kubectl with `KUBECONFIG` set.
|
|
11
|
+
*
|
|
12
|
+
* The deployer role's cluster RBAC is namespace-scoped to the tenant's
|
|
13
|
+
* namespaces (verified live: the `<tenant>-<env>-deployers` group grants
|
|
14
|
+
* pods/log/exec read in the app's namespace), so every command defaults to the
|
|
15
|
+
* app's own namespace and callers can still `-n <other>` within the tenant.
|
|
16
|
+
*/
|
|
17
|
+
import { spawnSync } from "node:child_process";
|
|
18
|
+
import { logError, logInfo } from "../utils/log.js";
|
|
19
|
+
import { findAppRoot, findStackConfigs, getCurrentStack, pulumiStackOutput, readStackConfig, } from "../utils/pulumi.js";
|
|
20
|
+
import { resolveAwsCredentials, derivePlatformContext } from "../utils/aws-auth.js";
|
|
21
|
+
import { ensureKubeconfig, resolveHubPlatformName, } from "../utils/kubeconfig.js";
|
|
22
|
+
import { probeCredentials } from "./login.js";
|
|
23
|
+
import { credProbeToPreflightError } from "../utils/pulumi-run.js";
|
|
24
|
+
/**
|
|
25
|
+
* Assume the app's deployer role, resolve the deployed app's platform env +
|
|
26
|
+
* namespace from stack output, and materialize a session kubeconfig. Throws with
|
|
27
|
+
* an actionable message on any failure (missing app dir, unresolved creds,
|
|
28
|
+
* undeployed stack, unresolvable cluster).
|
|
29
|
+
*/
|
|
30
|
+
async function resolveClusterAccess(opts) {
|
|
31
|
+
const appRoot = findAppRoot(process.cwd());
|
|
32
|
+
if (!appRoot) {
|
|
33
|
+
throw new Error("Not in a Mesh app directory (no Pulumi.yaml found). Run from an app directory.");
|
|
34
|
+
}
|
|
35
|
+
const stack = opts.stack ?? getCurrentStack(appRoot);
|
|
36
|
+
if (!stack) {
|
|
37
|
+
const stacks = findStackConfigs(appRoot);
|
|
38
|
+
throw new Error("No Pulumi stack selected.\n" +
|
|
39
|
+
(stacks.length > 0
|
|
40
|
+
? `Available: ${stacks.join(", ")}\nUse --stack <name> (the deployed stack, e.g. dev).`
|
|
41
|
+
: "No stack configs found in this directory."));
|
|
42
|
+
}
|
|
43
|
+
const sa = ["--stack", stack];
|
|
44
|
+
// Assume the app's deployer role — same path as `mesh dev` / `mesh temporal`.
|
|
45
|
+
const deployerRole = readStackConfig(appRoot, stack, "mesh:deployerRole");
|
|
46
|
+
const ctx = derivePlatformContext(appRoot, stack);
|
|
47
|
+
const resolved = deployerRole
|
|
48
|
+
? await resolveAwsCredentials(deployerRole, appRoot, stack)
|
|
49
|
+
: null;
|
|
50
|
+
// Login preflight: name the credential problem up front instead of failing
|
|
51
|
+
// deep inside the kubectl `aws eks get-token` exec plugin.
|
|
52
|
+
if (deployerRole && !resolved && !process.env.AWS_ACCESS_KEY_ID) {
|
|
53
|
+
const pf = ctx
|
|
54
|
+
? credProbeToPreflightError(await probeCredentials(ctx, deployerRole), ctx)
|
|
55
|
+
: null;
|
|
56
|
+
throw new Error(pf?.message ??
|
|
57
|
+
`Couldn't resolve AWS credentials. Run: mesh login ${ctx ?? "mesh.dev"} --device`);
|
|
58
|
+
}
|
|
59
|
+
const awsEnv = resolved?.env;
|
|
60
|
+
const region = readStackConfig(appRoot, stack, "aws:region");
|
|
61
|
+
if (awsEnv && region && !awsEnv.AWS_REGION)
|
|
62
|
+
awsEnv.AWS_REGION = region;
|
|
63
|
+
// Thread the resolved creds into this process so ensureKubeconfig's SSM read
|
|
64
|
+
// and the kubectl `aws eks get-token` exec plugin run credentialed.
|
|
65
|
+
if (awsEnv)
|
|
66
|
+
Object.assign(process.env, awsEnv);
|
|
67
|
+
// Read the deployed app output for platform env + namespace (mirrors the
|
|
68
|
+
// reader in `mesh temporal`; the `app` struct's `dev` field is secret-tainted,
|
|
69
|
+
// and pulumiStackOutput transparently retries with --show-secrets).
|
|
70
|
+
let appOutput;
|
|
71
|
+
let devOutput;
|
|
72
|
+
try {
|
|
73
|
+
appOutput = JSON.parse(pulumiStackOutput(appRoot, "app", sa, awsEnv));
|
|
74
|
+
devOutput = appOutput.dev ?? appOutput;
|
|
75
|
+
}
|
|
76
|
+
catch {
|
|
77
|
+
try {
|
|
78
|
+
devOutput = JSON.parse(pulumiStackOutput(appRoot, "dev", sa, awsEnv));
|
|
79
|
+
appOutput = devOutput;
|
|
80
|
+
}
|
|
81
|
+
catch {
|
|
82
|
+
throw new Error(`Could not read stack output for '${stack}'. Ensure the app is deployed: mesh deploy up`);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
const platformEnv = devOutput?.platform?.env ?? "dev";
|
|
86
|
+
// The HUB platform name (e.g. "trabian") — cluster data lives under it, not
|
|
87
|
+
// under a hardcoded "mesh" (MESH-2515). Same axis `mesh dev` uses for the
|
|
88
|
+
// bastion; "mesh" is only the default hub.
|
|
89
|
+
const platformName = resolveHubPlatformName(devOutput?.platform);
|
|
90
|
+
const namespace = appOutput?.namespace ?? devOutput?.namespace;
|
|
91
|
+
if (!namespace) {
|
|
92
|
+
throw new Error(`No namespace found in stack output for '${stack}'.`);
|
|
93
|
+
}
|
|
94
|
+
// Build a session kubeconfig from the platform eks SSM export. Key the session
|
|
95
|
+
// file on platformName + platformEnv too, so two apps on DIFFERENT platforms
|
|
96
|
+
// that share a stack name (e.g. both "dev") don't race on the same kubeconfig
|
|
97
|
+
// path.
|
|
98
|
+
let failure;
|
|
99
|
+
const kubeconfigPath = await ensureKubeconfig(platformName, platformEnv, `mesh-cluster-${platformName}-${platformEnv}-${stack}`, { onError: (f) => (failure = f) });
|
|
100
|
+
if (!kubeconfigPath) {
|
|
101
|
+
throw new Error(clusterResolveErrorMessage(platformName, platformEnv, failure));
|
|
102
|
+
}
|
|
103
|
+
return { kubeconfigPath, namespace, stack };
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Render the "couldn't resolve the EKS cluster" failure with the parameter
|
|
107
|
+
* tried and the real exception. The pre-MESH-2515 message guessed "you have
|
|
108
|
+
* SSM read access" at every failure — which sent three investigations after a
|
|
109
|
+
* permission that was never missing when the actual cause was the wrong
|
|
110
|
+
* platform name in the SSM path.
|
|
111
|
+
*/
|
|
112
|
+
export function clusterResolveErrorMessage(platformName, platformEnv, failure) {
|
|
113
|
+
const parameter = failure?.parameter ?? `/mesh-platform/${platformName}/${platformEnv}/core/eks`;
|
|
114
|
+
const err = failure?.error;
|
|
115
|
+
const detail = err instanceof Error
|
|
116
|
+
? `${err.name}: ${err.message}`
|
|
117
|
+
: err !== undefined
|
|
118
|
+
? String(err)
|
|
119
|
+
: "no cluster data returned";
|
|
120
|
+
return (`Could not resolve the EKS cluster for platform '${platformName}/${platformEnv}' from SSM.\n` +
|
|
121
|
+
` Parameter tried: ${parameter}\n` +
|
|
122
|
+
` Failure: ${detail}\n` +
|
|
123
|
+
"If this platform name is wrong, check the app's `mesh:platform` stack config " +
|
|
124
|
+
"(the hub platform name, e.g. `trabian`) — an AccessDeniedException here usually " +
|
|
125
|
+
"means the WRONG platform path, not missing SSM permissions.");
|
|
126
|
+
}
|
|
127
|
+
const NS_FLAGS = new Set(["-n", "--namespace", "-A", "--all-namespaces"]);
|
|
128
|
+
/**
|
|
129
|
+
* Whether the user already scoped the namespace. Deliberately only detects the
|
|
130
|
+
* split forms (`-n foo`, `--namespace foo`, `--namespace=foo`, `-A`), NOT the
|
|
131
|
+
* smashed short form `-nfoo`: our default `-n <ns>` is PREPENDED, and kubectl's
|
|
132
|
+
* pflag lets the later (user-supplied) `-nfoo` win, so a missed detection here is
|
|
133
|
+
* harmless. Do not "fix" this into an append — that would let our default win
|
|
134
|
+
* over the user's intent.
|
|
135
|
+
*/
|
|
136
|
+
export function hasNamespaceFlag(args) {
|
|
137
|
+
return args.some((a) => NS_FLAGS.has(a) || a.startsWith("--namespace="));
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Run kubectl with the session kubeconfig, defaulting the namespace to the app's
|
|
141
|
+
* own unless the caller already scoped it. Returns the child exit code.
|
|
142
|
+
*/
|
|
143
|
+
function runKubectl(access, args, opts = {}) {
|
|
144
|
+
const finalArgs = opts.defaultNamespace !== false && !hasNamespaceFlag(args)
|
|
145
|
+
? ["-n", access.namespace, ...args]
|
|
146
|
+
: args;
|
|
147
|
+
const res = spawnSync("kubectl", finalArgs, {
|
|
148
|
+
stdio: "inherit",
|
|
149
|
+
env: { ...process.env, KUBECONFIG: access.kubeconfigPath },
|
|
150
|
+
});
|
|
151
|
+
if (res.error) {
|
|
152
|
+
const e = res.error;
|
|
153
|
+
if (e.code === "ENOENT") {
|
|
154
|
+
logError("kubectl not found on PATH. Install kubectl to use mesh cluster commands.");
|
|
155
|
+
}
|
|
156
|
+
else {
|
|
157
|
+
logError(`Failed to run kubectl: ${e.message}`);
|
|
158
|
+
}
|
|
159
|
+
return 1;
|
|
160
|
+
}
|
|
161
|
+
return res.status ?? 0;
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Translate an ergonomic log/exec target into kubectl selector args.
|
|
165
|
+
* - `deployment/x` / `pod/x` (contains `/`) → passed through
|
|
166
|
+
* - `k=v` (contains `=`) → label selector `-l k=v`
|
|
167
|
+
* - bare `<service>` → `-l app=<service>` (the reliable
|
|
168
|
+
* per-service label; deployment names == service names)
|
|
169
|
+
*/
|
|
170
|
+
export function targetToSelector(target) {
|
|
171
|
+
if (target.includes("/"))
|
|
172
|
+
return [target];
|
|
173
|
+
if (target.includes("="))
|
|
174
|
+
return ["-l", target];
|
|
175
|
+
return ["-l", `app=${target}`];
|
|
176
|
+
}
|
|
177
|
+
export function registerClusterCommands(program) {
|
|
178
|
+
// `mesh kubectl [args…]` — passthrough. Help is delegated to kubectl so
|
|
179
|
+
// `mesh kubectl get --help` works; run `mesh kubectl` with no args to see it.
|
|
180
|
+
program
|
|
181
|
+
.command("kubectl")
|
|
182
|
+
.description("Run kubectl against the app's cluster (deployer role + SSM kubeconfig)")
|
|
183
|
+
.option("--stack <stack>", "Deployed Pulumi stack (default: current selection)")
|
|
184
|
+
.allowUnknownOption(true)
|
|
185
|
+
// Forward every positional (kubectl subcommand + args) verbatim. Commander
|
|
186
|
+
// v13 flips the default to ERROR on excess args, so declare it explicitly —
|
|
187
|
+
// a routine dependency bump must not silently break the passthrough.
|
|
188
|
+
.allowExcessArguments(true)
|
|
189
|
+
.helpOption(false)
|
|
190
|
+
.action(async (opts, cmd) => {
|
|
191
|
+
try {
|
|
192
|
+
const access = await resolveClusterAccess({ stack: opts.stack });
|
|
193
|
+
// Context line to stderr so stdout stays clean for piping.
|
|
194
|
+
process.stderr.write(`→ kubectl · ns ${access.namespace} · stack ${access.stack}\n`);
|
|
195
|
+
process.exit(runKubectl(access, cmd.args));
|
|
196
|
+
}
|
|
197
|
+
catch (e) {
|
|
198
|
+
logError(e.message);
|
|
199
|
+
process.exit(1);
|
|
200
|
+
}
|
|
201
|
+
});
|
|
202
|
+
// `mesh logs [target]` — ergonomic kubectl logs against the app's namespace.
|
|
203
|
+
program
|
|
204
|
+
.command("logs [target]")
|
|
205
|
+
.description("Tail logs from the app's pods (kubectl logs; target = service, deployment/x, or k=v)")
|
|
206
|
+
.option("--stack <stack>", "Deployed Pulumi stack (default: current selection)")
|
|
207
|
+
.option("-f, --follow", "Stream new logs")
|
|
208
|
+
.option("--tail <n>", "Lines from the end of the logs", "200")
|
|
209
|
+
.option("-c, --container <name>", "Container name")
|
|
210
|
+
.option("--previous", "Logs from the previous container instance (crash debugging)")
|
|
211
|
+
.action(async (target, opts) => {
|
|
212
|
+
try {
|
|
213
|
+
const access = await resolveClusterAccess({ stack: opts.stack });
|
|
214
|
+
if (!target) {
|
|
215
|
+
logInfo(`Which service? Pods in ${access.namespace}:\n` +
|
|
216
|
+
"Then: mesh logs <service> (e.g. mesh logs demo-agent-worker)\n");
|
|
217
|
+
process.exit(runKubectl(access, ["get", "pods"]));
|
|
218
|
+
}
|
|
219
|
+
const kargs = ["logs", ...targetToSelector(target), "--prefix", "--tail", opts.tail ?? "200"];
|
|
220
|
+
if (opts.follow)
|
|
221
|
+
kargs.push("-f");
|
|
222
|
+
if (opts.container)
|
|
223
|
+
kargs.push("-c", opts.container);
|
|
224
|
+
if (opts.previous)
|
|
225
|
+
kargs.push("--previous");
|
|
226
|
+
process.exit(runKubectl(access, kargs));
|
|
227
|
+
}
|
|
228
|
+
catch (e) {
|
|
229
|
+
logError(e.message);
|
|
230
|
+
process.exit(1);
|
|
231
|
+
}
|
|
232
|
+
});
|
|
233
|
+
// `mesh exec <target> -- <cmd…>` — exec into one of the app's pods.
|
|
234
|
+
program
|
|
235
|
+
.command("exec <target> [cmd...]")
|
|
236
|
+
.description("Exec a command in the app's pod (kubectl exec; target = service or deployment/x)")
|
|
237
|
+
.option("--stack <stack>", "Deployed Pulumi stack (default: current selection)")
|
|
238
|
+
.option("-c, --container <name>", "Container name")
|
|
239
|
+
.action(async (target, cmdParts, opts) => {
|
|
240
|
+
try {
|
|
241
|
+
const access = await resolveClusterAccess({ stack: opts.stack });
|
|
242
|
+
// exec needs a single pod; a bare service resolves to its deployment.
|
|
243
|
+
const podRef = target.includes("/") ? target : `deployment/${target}`;
|
|
244
|
+
const command = cmdParts.length > 0 ? cmdParts : ["sh"];
|
|
245
|
+
const kargs = ["exec"];
|
|
246
|
+
kargs.push(process.stdout.isTTY ? "-it" : "-i");
|
|
247
|
+
kargs.push(podRef);
|
|
248
|
+
if (opts.container)
|
|
249
|
+
kargs.push("-c", opts.container);
|
|
250
|
+
kargs.push("--", ...command);
|
|
251
|
+
process.exit(runKubectl(access, kargs));
|
|
252
|
+
}
|
|
253
|
+
catch (e) {
|
|
254
|
+
logError(e.message);
|
|
255
|
+
process.exit(1);
|
|
256
|
+
}
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
//# sourceMappingURL=cluster.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cluster.js","sourceRoot":"","sources":["../../../src/commands/cluster.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EACL,WAAW,EACX,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EACjB,eAAe,GAChB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AACpF,OAAO,EACL,gBAAgB,EAChB,sBAAsB,GAEvB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AAQnE;;;;;GAKG;AACH,KAAK,UAAU,oBAAoB,CAAC,IAAwB;IAC1D,MAAM,OAAO,GAAG,WAAW,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;IAC3C,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CACb,gFAAgF,CACjF,CAAC;IACJ,CAAC;IACD,MAA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IACH,CAAC,CACF,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* mesh conversations — read a deployed Mesh agent's conversations
|
|
3
|
+
*
|
|
4
|
+
* Commands:
|
|
5
|
+
* mesh conversations list List conversations visible to the caller
|
|
6
|
+
* mesh conversations show <id> Render a conversation's transcript
|
|
7
|
+
* mesh conversations artifacts <id> List a conversation's artifacts
|
|
8
|
+
*
|
|
9
|
+
* Discovery-first: resolves a target (registry name, --api-url, or
|
|
10
|
+
* fallback) via `resolveTarget`/`agentApiFetch` (Task 3) and renders a
|
|
11
|
+
* table (TTY) or JSON (piped / --json).
|
|
12
|
+
*/
|
|
13
|
+
import { Command } from "commander";
|
|
14
|
+
export interface ConversationSummary {
|
|
15
|
+
id: string;
|
|
16
|
+
title?: string;
|
|
17
|
+
updatedAt?: string;
|
|
18
|
+
lastUpdated?: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Pure formatter: JSON verbatim (compact — agents parse this, so it's kept
|
|
22
|
+
* dense rather than pretty-printed) when `asJson`, else a simple aligned
|
|
23
|
+
* ID/TITLE/UPDATED table. Tolerant of missing title/updatedAt/lastUpdated
|
|
24
|
+
* and an empty list.
|
|
25
|
+
*/
|
|
26
|
+
export declare function formatConversations(list: ConversationSummary[], asJson: boolean): string;
|
|
27
|
+
export interface TranscriptMessage {
|
|
28
|
+
role: string;
|
|
29
|
+
/** Plain string, or an AI SDK array of content parts (rendered via renderMessageContent). */
|
|
30
|
+
content?: unknown;
|
|
31
|
+
/** Present on assistant turns that invoked tools; shape varies by agent-sdk version. */
|
|
32
|
+
toolCalls?: unknown[];
|
|
33
|
+
/** Artifact ids/refs produced or referenced by this turn. */
|
|
34
|
+
artifactRefs?: unknown[];
|
|
35
|
+
}
|
|
36
|
+
export interface TranscriptBody {
|
|
37
|
+
messages?: TranscriptMessage[];
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Pure formatter: JSON verbatim (compact) when `asJson`, else one `role:
|
|
41
|
+
* content` block per message (blank-line separated). Tolerant of a missing
|
|
42
|
+
* `content` (renders `role: ` with nothing after it) and an empty/missing
|
|
43
|
+
* `messages` array. When a message carries `toolCalls`/`artifactRefs`, notes
|
|
44
|
+
* them compactly on an indented line beneath the block.
|
|
45
|
+
*/
|
|
46
|
+
export declare function formatTranscript(body: TranscriptBody, asJson: boolean): string;
|
|
47
|
+
export interface ArtifactSummary {
|
|
48
|
+
id: string;
|
|
49
|
+
kind?: string;
|
|
50
|
+
title?: string;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Pure formatter: JSON verbatim (compact) when `asJson`, else an
|
|
54
|
+
* `ARTIFACT-ID · KIND · TITLE` table plus a trailing download hint (using
|
|
55
|
+
* `refHint` — the conversation id — and the first artifact's id as the
|
|
56
|
+
* copy-pasteable example). Tolerant of missing kind/title and an empty list
|
|
57
|
+
* (no download hint when there's nothing to download).
|
|
58
|
+
*/
|
|
59
|
+
export declare function formatArtifacts(list: ArtifactSummary[], asJson: boolean, refHint: string): string;
|
|
60
|
+
export declare function registerConversationsCommands(program: Command): void;
|
|
61
|
+
//# sourceMappingURL=conversations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conversations.d.ts","sourceRoot":"","sources":["../../../src/commands/conversations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAgBpC,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAQD;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,mBAAmB,EAAE,EAAE,MAAM,EAAE,OAAO,GAAG,MAAM,CAwBxF;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,6FAA6F;IAC7F,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,wFAAwF;IACxF,SAAS,CAAC,EAAE,OAAO,EAAE,CAAC;IACtB,6DAA6D;IAC7D,YAAY,CAAC,EAAE,OAAO,EAAE,CAAC;CAC1B;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,EAAE,iBAAiB,EAAE,CAAC;CAChC;AAiBD;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,cAAc,EAAE,MAAM,EAAE,OAAO,GAAG,MAAM,CAsB9E;AAED,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,eAAe,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAwBjG;AAiFD,wBAAgB,6BAA6B,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAsFpE"}
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* mesh conversations — read a deployed Mesh agent's conversations
|
|
3
|
+
*
|
|
4
|
+
* Commands:
|
|
5
|
+
* mesh conversations list List conversations visible to the caller
|
|
6
|
+
* mesh conversations show <id> Render a conversation's transcript
|
|
7
|
+
* mesh conversations artifacts <id> List a conversation's artifacts
|
|
8
|
+
*
|
|
9
|
+
* Discovery-first: resolves a target (registry name, --api-url, or
|
|
10
|
+
* fallback) via `resolveTarget`/`agentApiFetch` (Task 3) and renders a
|
|
11
|
+
* table (TTY) or JSON (piped / --json).
|
|
12
|
+
*/
|
|
13
|
+
// renderMessageContent is needed synchronously by the exported formatter;
|
|
14
|
+
// safe at top level since agent-targets' exports are source-mapped. The
|
|
15
|
+
// heavy pull/writeBundle pair stays lazily imported in the pull action.
|
|
16
|
+
import { renderMessageContent } from "@mesh-tech/agent-targets";
|
|
17
|
+
import { buildVcsEnricher } from "./vcs-enrich.js";
|
|
18
|
+
import { logError, logInfo, logWarn } from "../utils/log.js";
|
|
19
|
+
import { agentApiFetch, describeHttpError, describeNetworkError, resolveTarget, TargetResolutionError, } from "./agent-api-client.js";
|
|
20
|
+
const MAX_TITLE_LEN = 40;
|
|
21
|
+
function truncate(s, max) {
|
|
22
|
+
return s.length > max ? s.slice(0, max - 1) + "…" : s;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Pure formatter: JSON verbatim (compact — agents parse this, so it's kept
|
|
26
|
+
* dense rather than pretty-printed) when `asJson`, else a simple aligned
|
|
27
|
+
* ID/TITLE/UPDATED table. Tolerant of missing title/updatedAt/lastUpdated
|
|
28
|
+
* and an empty list.
|
|
29
|
+
*/
|
|
30
|
+
export function formatConversations(list, asJson) {
|
|
31
|
+
if (asJson) {
|
|
32
|
+
return JSON.stringify(list);
|
|
33
|
+
}
|
|
34
|
+
if (list.length === 0) {
|
|
35
|
+
return "(no conversations)";
|
|
36
|
+
}
|
|
37
|
+
const rows = list.map((c) => ({
|
|
38
|
+
id: c.id ?? "",
|
|
39
|
+
title: truncate(c.title ?? "", MAX_TITLE_LEN),
|
|
40
|
+
updated: c.updatedAt ?? c.lastUpdated ?? "",
|
|
41
|
+
}));
|
|
42
|
+
const idWidth = Math.max("ID".length, ...rows.map((r) => r.id.length));
|
|
43
|
+
const titleWidth = Math.max("TITLE".length, ...rows.map((r) => r.title.length));
|
|
44
|
+
const pad = (s, width) => s.padEnd(width);
|
|
45
|
+
const header = `${pad("ID", idWidth)} ${pad("TITLE", titleWidth)} UPDATED`;
|
|
46
|
+
const lines = rows.map((r) => `${pad(r.id, idWidth)} ${pad(r.title, titleWidth)} ${r.updated}`);
|
|
47
|
+
return [header, ...lines].join("\n");
|
|
48
|
+
}
|
|
49
|
+
/** Compact a list of tool-call/artifact-ref entries to a comma-joined summary. */
|
|
50
|
+
function summarizeRefs(items) {
|
|
51
|
+
return items
|
|
52
|
+
.map((item) => {
|
|
53
|
+
if (typeof item === "string")
|
|
54
|
+
return item;
|
|
55
|
+
if (item && typeof item === "object") {
|
|
56
|
+
const rec = item;
|
|
57
|
+
const label = rec.id ?? rec.name ?? rec.toolName;
|
|
58
|
+
if (typeof label === "string")
|
|
59
|
+
return label;
|
|
60
|
+
}
|
|
61
|
+
return "?";
|
|
62
|
+
})
|
|
63
|
+
.join(", ");
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Pure formatter: JSON verbatim (compact) when `asJson`, else one `role:
|
|
67
|
+
* content` block per message (blank-line separated). Tolerant of a missing
|
|
68
|
+
* `content` (renders `role: ` with nothing after it) and an empty/missing
|
|
69
|
+
* `messages` array. When a message carries `toolCalls`/`artifactRefs`, notes
|
|
70
|
+
* them compactly on an indented line beneath the block.
|
|
71
|
+
*/
|
|
72
|
+
export function formatTranscript(body, asJson) {
|
|
73
|
+
if (asJson) {
|
|
74
|
+
return JSON.stringify(body);
|
|
75
|
+
}
|
|
76
|
+
const messages = body.messages ?? [];
|
|
77
|
+
if (messages.length === 0) {
|
|
78
|
+
return "(no messages)";
|
|
79
|
+
}
|
|
80
|
+
return messages
|
|
81
|
+
.map((m) => {
|
|
82
|
+
const lines = [`${m.role}: ${renderMessageContent(m.content)}`];
|
|
83
|
+
if (Array.isArray(m.toolCalls) && m.toolCalls.length > 0) {
|
|
84
|
+
lines.push(` tool-calls: ${summarizeRefs(m.toolCalls)}`);
|
|
85
|
+
}
|
|
86
|
+
if (Array.isArray(m.artifactRefs) && m.artifactRefs.length > 0) {
|
|
87
|
+
lines.push(` artifacts: ${summarizeRefs(m.artifactRefs)}`);
|
|
88
|
+
}
|
|
89
|
+
return lines.join("\n");
|
|
90
|
+
})
|
|
91
|
+
.join("\n\n");
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Pure formatter: JSON verbatim (compact) when `asJson`, else an
|
|
95
|
+
* `ARTIFACT-ID · KIND · TITLE` table plus a trailing download hint (using
|
|
96
|
+
* `refHint` — the conversation id — and the first artifact's id as the
|
|
97
|
+
* copy-pasteable example). Tolerant of missing kind/title and an empty list
|
|
98
|
+
* (no download hint when there's nothing to download).
|
|
99
|
+
*/
|
|
100
|
+
export function formatArtifacts(list, asJson, refHint) {
|
|
101
|
+
if (asJson) {
|
|
102
|
+
return JSON.stringify(list);
|
|
103
|
+
}
|
|
104
|
+
if (list.length === 0) {
|
|
105
|
+
return "(no artifacts)";
|
|
106
|
+
}
|
|
107
|
+
const rows = list.map((a) => ({
|
|
108
|
+
id: a.id ?? "",
|
|
109
|
+
kind: a.kind ?? "",
|
|
110
|
+
title: a.title ?? "",
|
|
111
|
+
}));
|
|
112
|
+
const idWidth = Math.max("ARTIFACT-ID".length, ...rows.map((r) => r.id.length));
|
|
113
|
+
const kindWidth = Math.max("KIND".length, ...rows.map((r) => r.kind.length));
|
|
114
|
+
const pad = (s, width) => s.padEnd(width);
|
|
115
|
+
const header = `${pad("ARTIFACT-ID", idWidth)} · ${pad("KIND", kindWidth)} · TITLE`;
|
|
116
|
+
const lines = rows.map((r) => `${pad(r.id, idWidth)} · ${pad(r.kind, kindWidth)} · ${r.title}`);
|
|
117
|
+
const exampleId = rows[0]?.id ?? "";
|
|
118
|
+
return [header, ...lines, "", `Download: mesh artifacts get ${refHint}:${exampleId}`].join("\n");
|
|
119
|
+
}
|
|
120
|
+
/** Add the shared `--target/--api-url/--context/--json` option set (same across list/show/artifacts). */
|
|
121
|
+
function withTargetOptions(cmd) {
|
|
122
|
+
return cmd
|
|
123
|
+
.option("--target <name>", "Named agent target from the agent-targets registry")
|
|
124
|
+
.option("--api-url <url>", "Agent API URL (overrides --target; ad-hoc, no registry lookup)")
|
|
125
|
+
.option("--context <ctx>", "Zitadel auth context, used with --api-url (default: mesh.dev)")
|
|
126
|
+
.option("--json", "Emit JSON (default when stdout is not a TTY)");
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Shared resolve → fetch → format → print flow for a conversations verb.
|
|
130
|
+
* `ctx.id` (the conversation id, when the verb has one) is passed through to
|
|
131
|
+
* `describeHttpError` so it can echo it in the 404 message and offer the
|
|
132
|
+
* `mesh temporal recover-conversation <id>` hint on a 503
|
|
133
|
+
* `conversation_unavailable` response (formerly `show`'s own special-case;
|
|
134
|
+
* now folded into the one shared renderer).
|
|
135
|
+
*/
|
|
136
|
+
async function runConversationsVerb(opts, apiPath, format, ctx) {
|
|
137
|
+
// Declared outside the try so a network-error catch can give
|
|
138
|
+
// local-vs-remote-aware guidance (`describeNetworkError` needs the
|
|
139
|
+
// target); stays undefined if `resolveTarget` itself is what threw.
|
|
140
|
+
let target;
|
|
141
|
+
try {
|
|
142
|
+
target = resolveTarget(opts);
|
|
143
|
+
const res = await agentApiFetch(target, apiPath);
|
|
144
|
+
if (!res.ok) {
|
|
145
|
+
throw new Error(await describeHttpError(res, target, ctx));
|
|
146
|
+
}
|
|
147
|
+
const body = (await res.json());
|
|
148
|
+
const asJson = opts.json ?? !process.stdout.isTTY;
|
|
149
|
+
process.stdout.write(format(body, asJson) + "\n");
|
|
150
|
+
}
|
|
151
|
+
catch (error) {
|
|
152
|
+
reportCliError(error, target);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Symmetric with `mesh artifacts get`'s catch: `describeHttpError` failures
|
|
157
|
+
* already carry target-aware guidance in their message (so `hint === message`
|
|
158
|
+
* and nothing further is logged), while a genuine network throw
|
|
159
|
+
* (ECONNREFUSED/"fetch failed"/ENOTFOUND/EAI_AGAIN) gets an extra
|
|
160
|
+
* local-vs-remote hint via `describeNetworkError`.
|
|
161
|
+
*/
|
|
162
|
+
function reportCliError(error, target) {
|
|
163
|
+
if (error instanceof TargetResolutionError) {
|
|
164
|
+
logError(error.message);
|
|
165
|
+
}
|
|
166
|
+
else {
|
|
167
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
168
|
+
logError(message);
|
|
169
|
+
if (target) {
|
|
170
|
+
const hint = describeNetworkError(error, target);
|
|
171
|
+
if (hint !== message)
|
|
172
|
+
logWarn(hint);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
process.exitCode = 1;
|
|
176
|
+
}
|
|
177
|
+
export function registerConversationsCommands(program) {
|
|
178
|
+
const group = program
|
|
179
|
+
.command("conversations")
|
|
180
|
+
.alias("conv")
|
|
181
|
+
.description("Read a deployed Mesh agent's conversations (list, show, artifacts)");
|
|
182
|
+
withTargetOptions(group
|
|
183
|
+
.command("list")
|
|
184
|
+
.description("List the caller's conversations on an agent target")).action(async (opts) => {
|
|
185
|
+
await runConversationsVerb(opts, "/v1/conversations", (body, asJson) => formatConversations(body.conversations ?? [], asJson));
|
|
186
|
+
});
|
|
187
|
+
withTargetOptions(group
|
|
188
|
+
.command("show <id>")
|
|
189
|
+
.description("Render a conversation's transcript")).action(async (id, opts) => {
|
|
190
|
+
await runConversationsVerb(opts, `/v1/conversations/${encodeURIComponent(id)}`, (body, asJson) => formatTranscript(body, asJson), { id });
|
|
191
|
+
});
|
|
192
|
+
withTargetOptions(group
|
|
193
|
+
.command("artifacts <id>")
|
|
194
|
+
.description("List a conversation's artifacts")).action(async (id, opts) => {
|
|
195
|
+
await runConversationsVerb(opts, `/v1/conversations/${encodeURIComponent(id)}/artifacts`, (body, asJson) => formatArtifacts(body.artifacts ?? [], asJson, id), { id });
|
|
196
|
+
});
|
|
197
|
+
group
|
|
198
|
+
.command("pull <id>")
|
|
199
|
+
.description("Pull a conversation + its designs/UI + recursive subagent transcripts into a bundle")
|
|
200
|
+
.option("--target <name>", "Named agent target from the agent-targets registry")
|
|
201
|
+
.option("--api-url <url>", "Agent API URL (overrides --target)")
|
|
202
|
+
.option("--context <ctx>", "Zitadel auth context (default: mesh.dev)")
|
|
203
|
+
.option("-o, --output <dir>", "Write the bundle directory here (prints JSON when omitted)")
|
|
204
|
+
.option("--no-recursive", "Only pull direct subagents (default: recurse the delegate tree)")
|
|
205
|
+
.option("--no-vcs", "Skip pulling each design's own vcs folder (docs/manifest); IR-only")
|
|
206
|
+
.action(async (id, opts) => {
|
|
207
|
+
// Lazy: an unbuilt/unresolvable agent-targets must degrade only this
|
|
208
|
+
// command, never brick the whole CLI at boot (src/program.ts imports all
|
|
209
|
+
// command modules eagerly).
|
|
210
|
+
const { pullConversation, writeBundle } = await import("@mesh-tech/agent-targets");
|
|
211
|
+
let target;
|
|
212
|
+
let enricher;
|
|
213
|
+
try {
|
|
214
|
+
target = resolveTarget(opts);
|
|
215
|
+
const resolved = target;
|
|
216
|
+
enricher = opts.vcs === false ? undefined : await buildVcsEnricher(resolved);
|
|
217
|
+
const bundle = await pullConversation({ fetchApi: (apiPath) => agentApiFetch(resolved, apiPath), enrichVcs: enricher?.enrichVcs }, id, { recursive: opts.recursive !== false, hintTarget: opts.target });
|
|
218
|
+
if (opts.output) {
|
|
219
|
+
const written = await writeBundle(bundle, opts.output);
|
|
220
|
+
logInfo(`wrote ${written.length} files → ${opts.output}`);
|
|
221
|
+
if (bundle.warnings.length) {
|
|
222
|
+
logWarn(`${bundle.warnings.length} warning(s): ${bundle.warnings
|
|
223
|
+
.map((w) => `${w.stage}:${w.ref ?? ""}`)
|
|
224
|
+
.join(", ")}`);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
else {
|
|
228
|
+
process.stdout.write(JSON.stringify(bundle) + "\n");
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
catch (error) {
|
|
232
|
+
reportCliError(error, target);
|
|
233
|
+
}
|
|
234
|
+
finally {
|
|
235
|
+
await enricher?.cleanup();
|
|
236
|
+
}
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
//# sourceMappingURL=conversations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conversations.js","sourceRoot":"","sources":["../../../src/commands/conversations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;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AC,IAAI,CAAC,EAAE,CAChB,CAAC;gBACJ,CAAC;YACH,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC;YACtD,CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,cAAc,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;QAChC,CAAC;gBAAS,CAAC;YACT,MAAM,QAAQ,EAAE,OAAO,EAAE,CAAC;QAC5B,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1,10 +1,33 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* mesh create-app - Scaffold a new tenant application
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* Three modes:
|
|
5
|
+
* 1. Legacy: `mesh create-app --template workflow --tenant x --name y`
|
|
6
|
+
* 2. Composable (flags): `mesh create-app --tenant x --name y --primitives service,database`
|
|
7
|
+
* 3. Interactive: `mesh create-app` (prompts when TTY detected and flags missing)
|
|
8
|
+
*
|
|
9
|
+
* All options can be passed as flags for agent/CI usage (no TTY required).
|
|
7
10
|
*/
|
|
8
11
|
import { Command } from "commander";
|
|
12
|
+
/**
|
|
13
|
+
* A fresh standalone tenant-apps repo (empty clone of {tenant}-mesh-apps) is
|
|
14
|
+
* bootstrappable when the cwd is a git repo root that has none of the layouts
|
|
15
|
+
* `resolveAppDir` looks for. Previously create-app exited with "Tenant
|
|
16
|
+
* directory not found: tenants/<t>/" here — even though the app-tenant
|
|
17
|
+
* doctor's Repo-shape check names create-app as the fix ("workspace files
|
|
18
|
+
* included"), so the command must actually deliver them.
|
|
19
|
+
*/
|
|
20
|
+
export declare function shouldBootstrapAppsRepo(cwd: string): boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Generate the repo-level files of a standalone tenant-apps repo (the
|
|
23
|
+
* trabian-mesh-apps shape): pnpm workspace over apps/*, private root
|
|
24
|
+
* package.json, scoped CodeArtifact .npmrc, base tsconfig, .gitignore, README.
|
|
25
|
+
* Only writes files that don't already exist; returns what it created.
|
|
26
|
+
*/
|
|
27
|
+
export declare function bootstrapAppsRepo(cwd: string, tenant: string): string[];
|
|
28
|
+
/**
|
|
29
|
+
* Recursively copy a directory, processing .hbs templates
|
|
30
|
+
*/
|
|
31
|
+
export declare function copyTemplate(srcDir: string, destDir: string, context: Record<string, unknown>): void;
|
|
9
32
|
export declare function registerCreateAppCommand(program: Command): void;
|
|
10
33
|
//# sourceMappingURL=create-app.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-app.d.ts","sourceRoot":"","sources":["../../../src/commands/create-app.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"create-app.d.ts","sourceRoot":"","sources":["../../../src/commands/create-app.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAqFpC;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAQ5D;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAuCvE;AAwFD;;GAEG;AACH,wBAAgB,YAAY,CAC1B,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC/B,IAAI,CAiCN;AA6HD,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA8E/D"}
|