@mesh-tech/mesh-cli 0.20.1 → 0.20.3
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/README.md +6 -5
- package/dist/bin/mesh.d.ts +0 -12
- package/dist/bin/mesh.js +99 -50
- package/dist/bin/mesh.js.map +2 -3
- package/dist/build-info.json +2 -2
- package/dist/src/commands/agent-api-client.d.ts +0 -70
- package/dist/src/commands/agent-api-client.js +0 -80
- package/dist/src/commands/app-check.d.ts +0 -56
- package/dist/src/commands/app-check.js +0 -72
- package/dist/src/commands/artifacts.d.ts +0 -11
- package/dist/src/commands/artifacts.js +0 -33
- package/dist/src/commands/cluster.d.ts +0 -39
- package/dist/src/commands/cluster.js +0 -73
- package/dist/src/commands/conversations.d.ts +0 -36
- package/dist/src/commands/conversations.js +0 -59
- package/dist/src/commands/create-app.d.ts +4 -88
- package/dist/src/commands/create-app.js +16 -155
- package/dist/src/commands/db/connect.d.ts +0 -7
- package/dist/src/commands/db/connect.js +0 -9
- package/dist/src/commands/db/credentials.d.ts +0 -7
- package/dist/src/commands/db/credentials.js +0 -10
- package/dist/src/commands/db/env.d.ts +0 -6
- package/dist/src/commands/db/env.js +0 -14
- package/dist/src/commands/db/exec.d.ts +0 -43
- package/dist/src/commands/db/exec.js +0 -69
- package/dist/src/commands/db/index.d.ts +0 -10
- package/dist/src/commands/db/index.js +0 -10
- package/dist/src/commands/db/psql.d.ts +0 -7
- package/dist/src/commands/db/psql.js +0 -18
- package/dist/src/commands/deploy.d.ts +0 -38
- package/dist/src/commands/deploy.js +1 -76
- package/dist/src/commands/dev-doctor.d.ts +0 -82
- package/dist/src/commands/dev-doctor.js +3 -132
- package/dist/src/commands/dev-launch.d.ts +0 -52
- package/dist/src/commands/dev-launch.js +0 -56
- package/dist/src/commands/dev-token-server.d.ts +0 -18
- package/dist/src/commands/dev-token-server.js +1 -24
- package/dist/src/commands/dev.d.ts +0 -246
- package/dist/src/commands/dev.js +5 -963
- package/dist/src/commands/docs.d.ts +0 -1
- package/dist/src/commands/docs.js +0 -12
- package/dist/src/commands/hub/index.d.ts +0 -60
- package/dist/src/commands/hub/index.js +2 -139
- package/dist/src/commands/init/wizard.d.ts +5 -116
- package/dist/src/commands/init/wizard.js +42 -110
- package/dist/src/commands/init.d.ts +0 -55
- package/dist/src/commands/init.js +0 -70
- package/dist/src/commands/install-shim.d.ts +0 -23
- package/dist/src/commands/install-shim.js +2 -29
- package/dist/src/commands/local/auth-provision.d.ts +0 -80
- package/dist/src/commands/local/auth-provision.js +0 -109
- package/dist/src/commands/local/dev-local.d.ts +0 -91
- package/dist/src/commands/local/dev-local.js +0 -147
- package/dist/src/commands/local/docker-runner.d.ts +0 -22
- package/dist/src/commands/local/docker-runner.js +2 -35
- package/dist/src/commands/local/helpers.d.ts +0 -14
- package/dist/src/commands/local/helpers.js +0 -13
- package/dist/src/commands/local/hub-local.d.ts +0 -96
- package/dist/src/commands/local/hub-local.js +0 -111
- package/dist/src/commands/local/index.d.ts +0 -14
- package/dist/src/commands/local/index.js +0 -86
- package/dist/src/commands/local/mocks.d.ts +0 -269
- package/dist/src/commands/local/mocks.js +1 -274
- package/dist/src/commands/local/seed-hub-catalog.d.ts +0 -25
- package/dist/src/commands/local/seed-hub-catalog.js +0 -41
- package/dist/src/commands/local/seed-zitadel.d.ts +0 -82
- package/dist/src/commands/local/seed-zitadel.js +0 -158
- package/dist/src/commands/local/seed.d.ts +0 -64
- package/dist/src/commands/local/seed.js +0 -78
- package/dist/src/commands/local/stack.d.ts +0 -141
- package/dist/src/commands/local/stack.js +0 -153
- package/dist/src/commands/login.d.ts +0 -265
- package/dist/src/commands/login.js +4 -418
- package/dist/src/commands/peer-addressing.d.ts +0 -39
- package/dist/src/commands/peer-addressing.js +0 -37
- package/dist/src/commands/port-ownership.d.ts +0 -44
- package/dist/src/commands/port-ownership.js +0 -47
- package/dist/src/commands/registry-publish.d.ts +0 -1
- package/dist/src/commands/registry-publish.js +0 -46
- package/dist/src/commands/registry.d.ts +4 -237
- package/dist/src/commands/registry.js +2 -316
- package/dist/src/commands/secrets/exec.d.ts +0 -16
- package/dist/src/commands/secrets/exec.js +0 -24
- package/dist/src/commands/secrets/index.d.ts +0 -9
- package/dist/src/commands/secrets/index.js +0 -10
- package/dist/src/commands/secrets/migrate-config.d.ts +0 -17
- package/dist/src/commands/secrets/migrate-config.js +0 -40
- package/dist/src/commands/secrets/reindex.d.ts +0 -38
- package/dist/src/commands/secrets/reindex.js +0 -39
- package/dist/src/commands/secrets/set.d.ts +0 -47
- package/dist/src/commands/secrets/set.js +0 -107
- package/dist/src/commands/site.d.ts +0 -1
- package/dist/src/commands/site.js +0 -61
- package/dist/src/commands/skills.d.ts +0 -61
- package/dist/src/commands/skills.js +0 -83
- package/dist/src/commands/stack.d.ts +0 -15
- package/dist/src/commands/stack.js +1 -128
- package/dist/src/commands/temporal.d.ts +0 -30
- package/dist/src/commands/temporal.js.map +0 -1
- package/dist/src/commands/tenant.d.ts +0 -31
- package/dist/src/commands/tenant.js +0 -55
- package/dist/src/commands/tunnel/index.d.ts +0 -40
- package/dist/src/commands/tunnel/index.js +0 -141
- package/dist/src/commands/vcs/clone.d.ts +0 -1
- package/dist/src/commands/vcs/clone.js +0 -4
- package/dist/src/commands/vcs/common.d.ts +0 -32
- package/dist/src/commands/vcs/common.js +0 -41
- package/dist/src/commands/vcs/drafts.d.ts +0 -1
- package/dist/src/commands/vcs/drafts.js +0 -1
- package/dist/src/commands/vcs/get.d.ts +0 -1
- package/dist/src/commands/vcs/get.js +0 -11
- package/dist/src/commands/vcs/index.d.ts +0 -1
- package/dist/src/commands/vcs/index.js +0 -1
- package/dist/src/commands/vcs/propose.d.ts +0 -26
- package/dist/src/commands/vcs/propose.js +3 -34
- package/dist/src/commands/vcs/review.d.ts +0 -1
- package/dist/src/commands/vcs/review.js +0 -1
- package/dist/src/commands/vcs/rm.d.ts +0 -11
- package/dist/src/commands/vcs/rm.js +0 -14
- package/dist/src/commands/vcs-enrich.d.ts +0 -12
- package/dist/src/commands/vcs-enrich.js +0 -12
- package/dist/src/commands/vpn/index.d.ts +0 -17
- package/dist/src/commands/vpn/index.js +0 -102
- package/dist/src/commands/vpn/tunnel.d.ts +0 -9
- package/dist/src/commands/vpn/tunnel.js +0 -37
- package/dist/src/commands/workflow.d.ts +0 -22
- package/dist/src/commands/workflow.js +0 -80
- package/dist/src/docs/assemble.d.ts +0 -117
- package/dist/src/docs/assemble.js +0 -142
- package/dist/src/docs/cli-reference.d.ts +0 -58
- package/dist/src/docs/cli-reference.js +0 -77
- package/dist/src/docs/discover.d.ts +0 -40
- package/dist/src/docs/discover.js +2 -60
- package/dist/src/docs/portal.d.ts +0 -44
- package/dist/src/docs/portal.js +0 -49
- package/dist/src/docs/registry-docs.d.ts +0 -29
- package/dist/src/docs/registry-docs.js +0 -40
- package/dist/src/docs/schema.d.ts +0 -36
- package/dist/src/docs/schema.js +0 -52
- package/dist/src/docs/serve.d.ts +0 -18
- package/dist/src/docs/serve.js +2 -30
- package/dist/src/docs/start.d.ts +0 -42
- package/dist/src/docs/start.js +0 -70
- package/dist/src/eval/agent-eval.d.mts +0 -12
- package/dist/src/eval/agent-eval.mjs +0 -22
- package/dist/src/index.d.ts +0 -6
- package/dist/src/index.js.map +0 -1
- package/dist/src/program.d.ts +0 -20
- package/dist/src/program.js +0 -24
- package/dist/src/utils/auth-preflight.d.ts +0 -137
- package/dist/src/utils/auth-preflight.js +0 -149
- package/dist/src/utils/aws-auth.d.ts +0 -163
- package/dist/src/utils/aws-auth.js +3 -232
- package/dist/src/utils/bastion.d.ts +0 -27
- package/dist/src/utils/bastion.js +0 -28
- package/dist/src/utils/build-info.d.ts +0 -22
- package/dist/src/utils/build-info.js +0 -27
- package/dist/src/utils/cache-home.d.ts +0 -23
- package/dist/src/utils/cache-home.js +0 -25
- package/dist/src/utils/capture-history.d.ts +0 -54
- package/dist/src/utils/capture-history.js +1 -55
- package/dist/src/utils/context.d.ts +0 -23
- package/dist/src/utils/context.js +0 -43
- package/dist/src/utils/credentials.d.ts +0 -38
- package/dist/src/utils/credentials.js +0 -39
- package/dist/src/utils/deploy-preflight.d.ts +0 -38
- package/dist/src/utils/deploy-preflight.js +1 -71
- package/dist/src/utils/errors.d.ts +0 -53
- package/dist/src/utils/errors.js +0 -49
- package/dist/src/utils/first-party-contexts.d.ts +0 -38
- package/dist/src/utils/first-party-contexts.js +0 -44
- package/dist/src/utils/index.d.ts +0 -4
- package/dist/src/utils/index.js +0 -4
- package/dist/src/utils/kubeconfig.d.ts +0 -40
- package/dist/src/utils/kubeconfig.js +0 -44
- package/dist/src/utils/log.d.ts +0 -20
- package/dist/src/utils/log.js +0 -20
- package/dist/src/utils/mesh-json.d.ts +0 -46
- package/dist/src/utils/mesh-json.js +0 -39
- package/dist/src/utils/pid.d.ts +0 -42
- package/dist/src/utils/pid.js +0 -48
- package/dist/src/utils/pulumi-run.d.ts +0 -14
- package/dist/src/utils/pulumi-run.js +0 -42
- package/dist/src/utils/pulumi.d.ts +0 -34
- package/dist/src/utils/pulumi.js +0 -38
- package/dist/src/utils/reachability.d.ts +0 -27
- package/dist/src/utils/reachability.js +0 -40
- package/dist/src/utils/recover-conversation.d.ts +0 -110
- package/dist/src/utils/recover-conversation.js +0 -108
- package/dist/src/utils/registry-broker.d.ts +5 -84
- package/dist/src/utils/registry-broker.js +0 -62
- package/dist/src/utils/registry-identity.d.ts +0 -149
- package/dist/src/utils/registry-identity.js +0 -143
- package/dist/src/utils/scaffold-versions.d.ts +0 -41
- package/dist/src/utils/scaffold-versions.js +0 -42
- package/dist/src/utils/socks-forward.d.ts +0 -24
- package/dist/src/utils/socks-forward.js +2 -25
- package/dist/src/utils/stack-flag.d.ts +0 -13
- package/dist/src/utils/stack-flag.js +0 -21
- package/dist/src/utils/tailscale-targets.d.ts +0 -37
- package/dist/src/utils/tailscale-targets.js +0 -33
- package/dist/src/utils/tailscale.d.ts +0 -177
- package/dist/src/utils/tailscale.js +6 -337
- package/dist/src/utils/temporal-auth.d.ts +0 -41
- package/dist/src/utils/temporal-auth.js +0 -52
- package/dist/src/utils/temporal-codec.d.ts +0 -89
- package/dist/src/utils/temporal-codec.js.map +0 -1
- package/dist/src/utils/tunnel-ownership.d.ts +0 -79
- package/dist/src/utils/tunnel-ownership.js +0 -74
- package/dist/src/utils/vpn-join.d.ts +0 -16
- package/dist/src/utils/vpn-join.js +0 -17
- package/dist/src/utils/vpn.d.ts +0 -42
- package/dist/src/utils/vpn.js +0 -52
- package/dist/src/utils/workflow-fingerprint.d.ts +0 -39
- package/dist/src/utils/workflow-fingerprint.js +1 -63
- package/dist/src/utils/worktree-identity.d.ts +0 -62
- package/dist/src/utils/worktree-identity.js +0 -88
- package/package.json +1 -1
- package/skills/core/SKILL.md +10 -11
- package/templates/api-auth/api/src/index.ts.hbs +1 -1
- package/templates/api-auth/api/src/spicedb-http-provider.ts.hbs +2 -2
- package/templates/api-role-gating/api/src/authn.ts.hbs +2 -2
- package/templates/api-role-gating/index.ts.hbs +1 -1
- package/templates/api-role-gating/skills/develop/SKILL.md.hbs +1 -1
- package/templates/platform-repo/core/Pulumi.{{tenant}}-{{env}}.yaml.hbs +2 -2
- package/templates/platform-repo/platform/index.ts +1 -1
- package/dist/bin/mesh.d.ts.map +0 -1
- package/dist/src/commands/agent-api-client.d.ts.map +0 -1
- package/dist/src/commands/agent-api-client.js.map +0 -1
- package/dist/src/commands/app-check.d.ts.map +0 -1
- package/dist/src/commands/app-check.js.map +0 -1
- package/dist/src/commands/artifacts.d.ts.map +0 -1
- package/dist/src/commands/artifacts.js.map +0 -1
- package/dist/src/commands/cluster.d.ts.map +0 -1
- package/dist/src/commands/cluster.js.map +0 -1
- package/dist/src/commands/conversations.d.ts.map +0 -1
- package/dist/src/commands/conversations.js.map +0 -1
- package/dist/src/commands/create-app.d.ts.map +0 -1
- package/dist/src/commands/create-app.js.map +0 -1
- package/dist/src/commands/db/connect.d.ts.map +0 -1
- package/dist/src/commands/db/connect.js.map +0 -1
- package/dist/src/commands/db/credentials.d.ts.map +0 -1
- package/dist/src/commands/db/credentials.js.map +0 -1
- package/dist/src/commands/db/env.d.ts.map +0 -1
- package/dist/src/commands/db/env.js.map +0 -1
- package/dist/src/commands/db/exec.d.ts.map +0 -1
- package/dist/src/commands/db/exec.js.map +0 -1
- package/dist/src/commands/db/index.d.ts.map +0 -1
- package/dist/src/commands/db/index.js.map +0 -1
- package/dist/src/commands/db/psql.d.ts.map +0 -1
- package/dist/src/commands/db/psql.js.map +0 -1
- package/dist/src/commands/deploy.d.ts.map +0 -1
- package/dist/src/commands/deploy.js.map +0 -1
- package/dist/src/commands/dev-doctor.d.ts.map +0 -1
- package/dist/src/commands/dev-doctor.js.map +0 -1
- package/dist/src/commands/dev-launch.d.ts.map +0 -1
- package/dist/src/commands/dev-launch.js.map +0 -1
- package/dist/src/commands/dev-token-server.d.ts.map +0 -1
- package/dist/src/commands/dev-token-server.js.map +0 -1
- package/dist/src/commands/dev.d.ts.map +0 -1
- package/dist/src/commands/dev.js.map +0 -1
- package/dist/src/commands/docs.d.ts.map +0 -1
- package/dist/src/commands/docs.js.map +0 -1
- package/dist/src/commands/hub/index.d.ts.map +0 -1
- package/dist/src/commands/hub/index.js.map +0 -1
- package/dist/src/commands/init/wizard.d.ts.map +0 -1
- package/dist/src/commands/init/wizard.js.map +0 -1
- package/dist/src/commands/init.d.ts.map +0 -1
- package/dist/src/commands/init.js.map +0 -1
- package/dist/src/commands/install-shim.d.ts.map +0 -1
- package/dist/src/commands/install-shim.js.map +0 -1
- package/dist/src/commands/local/auth-provision.d.ts.map +0 -1
- package/dist/src/commands/local/auth-provision.js.map +0 -1
- package/dist/src/commands/local/dev-local.d.ts.map +0 -1
- package/dist/src/commands/local/dev-local.js.map +0 -1
- package/dist/src/commands/local/docker-runner.d.ts.map +0 -1
- package/dist/src/commands/local/docker-runner.js.map +0 -1
- package/dist/src/commands/local/helpers.d.ts.map +0 -1
- package/dist/src/commands/local/helpers.js.map +0 -1
- package/dist/src/commands/local/hub-local.d.ts.map +0 -1
- package/dist/src/commands/local/hub-local.js.map +0 -1
- package/dist/src/commands/local/index.d.ts.map +0 -1
- package/dist/src/commands/local/index.js.map +0 -1
- package/dist/src/commands/local/mocks.d.ts.map +0 -1
- package/dist/src/commands/local/mocks.js.map +0 -1
- package/dist/src/commands/local/seed-hub-catalog.d.ts.map +0 -1
- package/dist/src/commands/local/seed-hub-catalog.js.map +0 -1
- package/dist/src/commands/local/seed-zitadel.d.ts.map +0 -1
- package/dist/src/commands/local/seed-zitadel.js.map +0 -1
- package/dist/src/commands/local/seed.d.ts.map +0 -1
- package/dist/src/commands/local/seed.js.map +0 -1
- package/dist/src/commands/local/stack.d.ts.map +0 -1
- package/dist/src/commands/local/stack.js.map +0 -1
- package/dist/src/commands/login.d.ts.map +0 -1
- package/dist/src/commands/login.js.map +0 -1
- package/dist/src/commands/peer-addressing.d.ts.map +0 -1
- package/dist/src/commands/peer-addressing.js.map +0 -1
- package/dist/src/commands/port-ownership.d.ts.map +0 -1
- package/dist/src/commands/port-ownership.js.map +0 -1
- package/dist/src/commands/registry-publish.d.ts.map +0 -1
- package/dist/src/commands/registry-publish.js.map +0 -1
- package/dist/src/commands/registry.d.ts.map +0 -1
- package/dist/src/commands/registry.js.map +0 -1
- package/dist/src/commands/secrets/exec.d.ts.map +0 -1
- package/dist/src/commands/secrets/exec.js.map +0 -1
- package/dist/src/commands/secrets/index.d.ts.map +0 -1
- package/dist/src/commands/secrets/index.js.map +0 -1
- package/dist/src/commands/secrets/migrate-config.d.ts.map +0 -1
- package/dist/src/commands/secrets/migrate-config.js.map +0 -1
- package/dist/src/commands/secrets/reindex.d.ts.map +0 -1
- package/dist/src/commands/secrets/reindex.js.map +0 -1
- package/dist/src/commands/secrets/set.d.ts.map +0 -1
- package/dist/src/commands/secrets/set.js.map +0 -1
- package/dist/src/commands/site.d.ts.map +0 -1
- package/dist/src/commands/site.js.map +0 -1
- package/dist/src/commands/skills.d.ts.map +0 -1
- package/dist/src/commands/skills.js.map +0 -1
- package/dist/src/commands/stack.d.ts.map +0 -1
- package/dist/src/commands/stack.js.map +0 -1
- package/dist/src/commands/temporal.d.ts.map +0 -1
- package/dist/src/commands/tenant.d.ts.map +0 -1
- package/dist/src/commands/tenant.js.map +0 -1
- package/dist/src/commands/tunnel/index.d.ts.map +0 -1
- package/dist/src/commands/tunnel/index.js.map +0 -1
- package/dist/src/commands/vcs/clone.d.ts.map +0 -1
- package/dist/src/commands/vcs/clone.js.map +0 -1
- package/dist/src/commands/vcs/common.d.ts.map +0 -1
- package/dist/src/commands/vcs/common.js.map +0 -1
- package/dist/src/commands/vcs/drafts.d.ts.map +0 -1
- package/dist/src/commands/vcs/drafts.js.map +0 -1
- package/dist/src/commands/vcs/get.d.ts.map +0 -1
- package/dist/src/commands/vcs/get.js.map +0 -1
- package/dist/src/commands/vcs/index.d.ts.map +0 -1
- package/dist/src/commands/vcs/index.js.map +0 -1
- package/dist/src/commands/vcs/propose.d.ts.map +0 -1
- package/dist/src/commands/vcs/propose.js.map +0 -1
- package/dist/src/commands/vcs/review.d.ts.map +0 -1
- package/dist/src/commands/vcs/review.js.map +0 -1
- package/dist/src/commands/vcs/rm.d.ts.map +0 -1
- package/dist/src/commands/vcs/rm.js.map +0 -1
- package/dist/src/commands/vcs-enrich.d.ts.map +0 -1
- package/dist/src/commands/vcs-enrich.js.map +0 -1
- package/dist/src/commands/vpn/index.d.ts.map +0 -1
- package/dist/src/commands/vpn/index.js.map +0 -1
- package/dist/src/commands/vpn/tunnel.d.ts.map +0 -1
- package/dist/src/commands/vpn/tunnel.js.map +0 -1
- package/dist/src/commands/workflow.d.ts.map +0 -1
- package/dist/src/commands/workflow.js.map +0 -1
- package/dist/src/docs/assemble.d.ts.map +0 -1
- package/dist/src/docs/assemble.js.map +0 -1
- package/dist/src/docs/cli-reference.d.ts.map +0 -1
- package/dist/src/docs/cli-reference.js.map +0 -1
- package/dist/src/docs/discover.d.ts.map +0 -1
- package/dist/src/docs/discover.js.map +0 -1
- package/dist/src/docs/portal.d.ts.map +0 -1
- package/dist/src/docs/portal.js.map +0 -1
- package/dist/src/docs/registry-docs.d.ts.map +0 -1
- package/dist/src/docs/registry-docs.js.map +0 -1
- package/dist/src/docs/schema.d.ts.map +0 -1
- package/dist/src/docs/schema.js.map +0 -1
- package/dist/src/docs/serve.d.ts.map +0 -1
- package/dist/src/docs/serve.js.map +0 -1
- package/dist/src/docs/start.d.ts.map +0 -1
- package/dist/src/docs/start.js.map +0 -1
- package/dist/src/eval/agent-eval.d.mts.map +0 -1
- package/dist/src/eval/agent-eval.mjs.map +0 -1
- package/dist/src/index.d.ts.map +0 -1
- package/dist/src/program.d.ts.map +0 -1
- package/dist/src/program.js.map +0 -1
- package/dist/src/utils/auth-preflight.d.ts.map +0 -1
- package/dist/src/utils/auth-preflight.js.map +0 -1
- package/dist/src/utils/aws-auth.d.ts.map +0 -1
- package/dist/src/utils/aws-auth.js.map +0 -1
- package/dist/src/utils/bastion.d.ts.map +0 -1
- package/dist/src/utils/bastion.js.map +0 -1
- package/dist/src/utils/build-info.d.ts.map +0 -1
- package/dist/src/utils/build-info.js.map +0 -1
- package/dist/src/utils/cache-home.d.ts.map +0 -1
- package/dist/src/utils/cache-home.js.map +0 -1
- package/dist/src/utils/capture-history.d.ts.map +0 -1
- package/dist/src/utils/capture-history.js.map +0 -1
- package/dist/src/utils/context.d.ts.map +0 -1
- package/dist/src/utils/context.js.map +0 -1
- package/dist/src/utils/credentials.d.ts.map +0 -1
- package/dist/src/utils/credentials.js.map +0 -1
- package/dist/src/utils/deploy-preflight.d.ts.map +0 -1
- package/dist/src/utils/deploy-preflight.js.map +0 -1
- package/dist/src/utils/errors.d.ts.map +0 -1
- package/dist/src/utils/errors.js.map +0 -1
- package/dist/src/utils/first-party-contexts.d.ts.map +0 -1
- package/dist/src/utils/first-party-contexts.js.map +0 -1
- package/dist/src/utils/index.d.ts.map +0 -1
- package/dist/src/utils/index.js.map +0 -1
- package/dist/src/utils/kubeconfig.d.ts.map +0 -1
- package/dist/src/utils/kubeconfig.js.map +0 -1
- package/dist/src/utils/log.d.ts.map +0 -1
- package/dist/src/utils/log.js.map +0 -1
- package/dist/src/utils/mesh-json.d.ts.map +0 -1
- package/dist/src/utils/mesh-json.js.map +0 -1
- package/dist/src/utils/pid.d.ts.map +0 -1
- package/dist/src/utils/pid.js.map +0 -1
- package/dist/src/utils/pulumi-run.d.ts.map +0 -1
- package/dist/src/utils/pulumi-run.js.map +0 -1
- package/dist/src/utils/pulumi.d.ts.map +0 -1
- package/dist/src/utils/pulumi.js.map +0 -1
- package/dist/src/utils/reachability.d.ts.map +0 -1
- package/dist/src/utils/reachability.js.map +0 -1
- package/dist/src/utils/recover-conversation.d.ts.map +0 -1
- package/dist/src/utils/recover-conversation.js.map +0 -1
- package/dist/src/utils/registry-broker.d.ts.map +0 -1
- package/dist/src/utils/registry-broker.js.map +0 -1
- package/dist/src/utils/registry-identity.d.ts.map +0 -1
- package/dist/src/utils/registry-identity.js.map +0 -1
- package/dist/src/utils/scaffold-versions.d.ts.map +0 -1
- package/dist/src/utils/scaffold-versions.js.map +0 -1
- package/dist/src/utils/socks-forward.d.ts.map +0 -1
- package/dist/src/utils/socks-forward.js.map +0 -1
- package/dist/src/utils/stack-flag.d.ts.map +0 -1
- package/dist/src/utils/stack-flag.js.map +0 -1
- package/dist/src/utils/tailscale-targets.d.ts.map +0 -1
- package/dist/src/utils/tailscale-targets.js.map +0 -1
- package/dist/src/utils/tailscale.d.ts.map +0 -1
- package/dist/src/utils/tailscale.js.map +0 -1
- package/dist/src/utils/temporal-auth.d.ts.map +0 -1
- package/dist/src/utils/temporal-auth.js.map +0 -1
- package/dist/src/utils/temporal-codec.d.ts.map +0 -1
- package/dist/src/utils/tunnel-ownership.d.ts.map +0 -1
- package/dist/src/utils/tunnel-ownership.js.map +0 -1
- package/dist/src/utils/vpn-join.d.ts.map +0 -1
- package/dist/src/utils/vpn-join.js.map +0 -1
- package/dist/src/utils/vpn.d.ts.map +0 -1
- package/dist/src/utils/vpn.js.map +0 -1
- package/dist/src/utils/workflow-fingerprint.d.ts.map +0 -1
- package/dist/src/utils/workflow-fingerprint.js.map +0 -1
- package/dist/src/utils/worktree-identity.d.ts.map +0 -1
- package/dist/src/utils/worktree-identity.js.map +0 -1
|
@@ -1,13 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* mesh create-app - Scaffold a new tenant application
|
|
3
|
-
*
|
|
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).
|
|
10
|
-
*/
|
|
11
1
|
import * as fs from "fs";
|
|
12
2
|
import * as os from "os";
|
|
13
3
|
import * as path from "path";
|
|
@@ -22,50 +12,29 @@ import { SCAFFOLD_TOOLCHAIN, resolvePublishedRange } from "../utils/scaffold-ver
|
|
|
22
12
|
import { registryPreflight } from "../utils/auth-preflight.js";
|
|
23
13
|
import { MeshCliError } from "../utils/errors.js";
|
|
24
14
|
import { findMeshJson } from "../utils/mesh-json.js";
|
|
25
|
-
// Get package root by walking up until we find package.json with our package name.
|
|
26
|
-
// Works from both src/commands/ (tsx) and dist/src/commands/ (compiled).
|
|
27
15
|
const __filename = fileURLToPath(import.meta.url);
|
|
28
16
|
const __dirname = path.dirname(__filename);
|
|
29
17
|
const packageRoot = findPackageRoot(__dirname);
|
|
30
|
-
// Available templates
|
|
31
18
|
const TEMPLATES = {
|
|
32
19
|
workflow: "Hono API + Temporal worker + hello workflow (Pulumi/app-kit)",
|
|
33
20
|
"api-auth": "Hono API with platform auth: authn (Zitadel JWT) + authz (SpiceDB)",
|
|
34
21
|
"api-role-gating": "Hono API with role-gating authz: authn (Zitadel JWT) + coarse-role checks on Zitadel project roles, in-process (no SpiceDB)",
|
|
35
22
|
"external-service": "Hono API calling a third-party vendor via platform-managed credentials (ExternalService + mock for `mesh dev --externals`)",
|
|
36
23
|
};
|
|
37
|
-
/** Removed templates → what replaced them (named in the unknown-template error). */
|
|
38
24
|
const REMOVED_TEMPLATES = {
|
|
39
25
|
"temporal-api-worker": "renamed to 'workflow'",
|
|
40
26
|
"api-web-db": "removed (SST-based) — use --primitives service,database",
|
|
41
27
|
};
|
|
42
|
-
// Available primitives for composable mode
|
|
43
28
|
const PRIMITIVES = {
|
|
44
29
|
service: "HTTP Service (API with Hono)",
|
|
45
30
|
database: "Database (PostgreSQL via Prisma)",
|
|
46
31
|
temporal: "Temporal (workflow orchestration)",
|
|
47
32
|
bucket: "S3 Bucket (file storage)",
|
|
48
33
|
};
|
|
49
|
-
/**
|
|
50
|
-
* Hub platform account IDs — the AWS account hosting a shared tenant's
|
|
51
|
-
* `{tenant}-{env}-apps-deployer` role. Shared tenants (acme, …) deploy into the
|
|
52
|
-
* hub account, so the generated `mesh:deployerRole` ARN resolves against this map.
|
|
53
|
-
* `mesh` is the only hub today; add entries as new hubs come online.
|
|
54
|
-
*/
|
|
55
34
|
const HUB_ACCOUNTS = {
|
|
56
35
|
mesh: "159923586610",
|
|
57
36
|
};
|
|
58
|
-
/** The root `package.json` name that identifies the mesh-platform monorepo. */
|
|
59
37
|
export const PLATFORM_MONOREPO_NAME = "mesh-platform";
|
|
60
|
-
/**
|
|
61
|
-
* True when `dir` sits inside the **mesh-platform monorepo** — the one workspace
|
|
62
|
-
* that publishes `@mesh-tech/*`, so a scaffolded app there wants `workspace:*` +
|
|
63
|
-
* `catalog:` (link local source) instead of published ranges.
|
|
64
|
-
*
|
|
65
|
-
* The test is deliberately narrow. Looking for any ancestor `pnpm-workspace.yaml`
|
|
66
|
-
* is not enough: a tenant-apps repo is itself a pnpm workspace (`packages: [apps/*]`).
|
|
67
|
-
* Identity comes from the root `package.json` name, which no tenant repo shares.
|
|
68
|
-
*/
|
|
69
38
|
export function isInsidePlatformMonorepo(dir) {
|
|
70
39
|
let cur = path.resolve(dir);
|
|
71
40
|
while (cur !== path.dirname(cur)) {
|
|
@@ -76,34 +45,17 @@ export function isInsidePlatformMonorepo(dir) {
|
|
|
76
45
|
return true;
|
|
77
46
|
}
|
|
78
47
|
catch {
|
|
79
|
-
// an unreadable/absent root package.json is not the platform monorepo
|
|
80
48
|
}
|
|
81
49
|
}
|
|
82
50
|
cur = path.dirname(cur);
|
|
83
51
|
}
|
|
84
52
|
return false;
|
|
85
53
|
}
|
|
86
|
-
/**
|
|
87
|
-
* Deployer-role ARN for a shared tenant on a known hub, or a clearly-marked
|
|
88
|
-
* `ACCOUNT_ID` placeholder when the hub account is unknown (the generated config
|
|
89
|
-
* comments the fill-in step in that case).
|
|
90
|
-
*/
|
|
91
54
|
function resolveDeployerRoleArn(tenant, platformName, env) {
|
|
92
55
|
const account = HUB_ACCOUNTS[platformName] ?? "ACCOUNT_ID";
|
|
93
56
|
return `arn:aws:iam::${account}:role/${tenant}-${env}-apps-deployer`;
|
|
94
57
|
}
|
|
95
58
|
const VALID_PRIMITIVES = Object.keys(PRIMITIVES);
|
|
96
|
-
// =============================================================================
|
|
97
|
-
// Standalone apps-repo bootstrap
|
|
98
|
-
// =============================================================================
|
|
99
|
-
/**
|
|
100
|
-
* A fresh standalone tenant-apps repo (empty clone of {tenant}-mesh-apps) is
|
|
101
|
-
* bootstrappable when the cwd is a git repo root that has none of the layouts
|
|
102
|
-
* `resolveAppDir` looks for. Previously create-app exited with "Tenant
|
|
103
|
-
* directory not found: tenants/<t>/" here — even though the app-tenant
|
|
104
|
-
* doctor's Repo-shape check names create-app as the fix ("workspace files
|
|
105
|
-
* included"), so the command must actually deliver them.
|
|
106
|
-
*/
|
|
107
59
|
export function shouldBootstrapAppsRepo(cwd) {
|
|
108
60
|
return (fs.existsSync(path.join(cwd, ".git")) &&
|
|
109
61
|
!isInsidePlatformMonorepo(cwd) &&
|
|
@@ -111,12 +63,6 @@ export function shouldBootstrapAppsRepo(cwd) {
|
|
|
111
63
|
!fs.existsSync(path.join(cwd, "tenants")) &&
|
|
112
64
|
!fs.existsSync(path.join(cwd, "apps")));
|
|
113
65
|
}
|
|
114
|
-
/**
|
|
115
|
-
* Generate the repo-level files of a standalone tenant-apps repo (the
|
|
116
|
-
* trabian-mesh-apps shape): pnpm workspace over apps/*, private root
|
|
117
|
-
* package.json, scoped CodeArtifact .npmrc, base tsconfig, .gitignore, README.
|
|
118
|
-
* Only writes files that don't already exist; returns what it created.
|
|
119
|
-
*/
|
|
120
66
|
export function bootstrapAppsRepo(cwd, tenant) {
|
|
121
67
|
const templateDir = path.join(packageRoot, "templates", "apps-repo");
|
|
122
68
|
const registryAccount = HUB_ACCOUNTS.mesh;
|
|
@@ -133,8 +79,6 @@ export function bootstrapAppsRepo(cwd, tenant) {
|
|
|
133
79
|
const staging = fs.mkdtempSync(path.join(os.tmpdir(), "mesh-apps-repo-"));
|
|
134
80
|
try {
|
|
135
81
|
copyTemplate(templateDir, staging, context);
|
|
136
|
-
// npm strips dotfiles from published tarballs, so the template ships
|
|
137
|
-
// `gitignore`/`npmrc` and the bootstrap restores the real names.
|
|
138
82
|
for (const [from, to] of [
|
|
139
83
|
["gitignore", ".gitignore"],
|
|
140
84
|
["npmrc", ".npmrc"],
|
|
@@ -159,17 +103,6 @@ export function bootstrapAppsRepo(cwd, tenant) {
|
|
|
159
103
|
fs.rmSync(staging, { recursive: true, force: true });
|
|
160
104
|
}
|
|
161
105
|
}
|
|
162
|
-
/**
|
|
163
|
-
* A composed app puts its runnable packages one level below the app dir
|
|
164
|
-
* (`apps/<name>/api`, `apps/<name>/worker`). pnpm only installs dependencies
|
|
165
|
-
* for workspace MEMBERS, and an apps repo whose `pnpm-workspace.yaml` says
|
|
166
|
-
* `packages: [apps/*]` does not match them — so the app scaffolds, the root
|
|
167
|
-
* install reports success, and `pnpm dev` dies on `Cannot find package 'hono'`
|
|
168
|
-
* with nothing pointing at the cause.
|
|
169
|
-
*
|
|
170
|
-
* Append any missing glob as a line under `packages:` (text edit, so comments
|
|
171
|
-
* and ordering survive). Returns the globs added, empty when nothing was missing.
|
|
172
|
-
*/
|
|
173
106
|
export function ensureWorkspaceGlobs(root, required) {
|
|
174
107
|
const file = path.join(root, "pnpm-workspace.yaml");
|
|
175
108
|
if (!fs.existsSync(file))
|
|
@@ -186,8 +119,6 @@ export function ensureWorkspaceGlobs(root, required) {
|
|
|
186
119
|
if (missing.length === 0)
|
|
187
120
|
return [];
|
|
188
121
|
const lines = text.split("\n");
|
|
189
|
-
// Insert after the last entry of the `packages:` list; bail if the file is
|
|
190
|
-
// shaped in a way we can't edit safely by hand.
|
|
191
122
|
const start = lines.findIndex((line) => /^packages:\s*$/.test(line));
|
|
192
123
|
if (start === -1)
|
|
193
124
|
return [];
|
|
@@ -207,18 +138,6 @@ export function ensureWorkspaceGlobs(root, required) {
|
|
|
207
138
|
fs.writeFileSync(file, lines.join("\n"));
|
|
208
139
|
return missing;
|
|
209
140
|
}
|
|
210
|
-
/**
|
|
211
|
-
* The `pnpm-workspace.yaml` glob that makes a composed app's nested packages
|
|
212
|
-
* (`<app>/api`, `<app>/worker`) workspace members, derived from where the app
|
|
213
|
-
* actually landed. `resolveAppDir` picks the first existing of
|
|
214
|
-
* `tenants/<t>/apps`, `../<t>/apps` and `apps`, so the glob is rooted at
|
|
215
|
-
* `apps` in one layout and at `tenants/<t>/apps` in another. Returns null when
|
|
216
|
-
* the app resolved outside `root` — nothing there is a member of this workspace.
|
|
217
|
-
*
|
|
218
|
-
* @example
|
|
219
|
-
* workspaceGlobForApp("/repo", "/repo/tenants/acme/apps/billing");
|
|
220
|
-
* // → "tenants/acme/apps" followed by two wildcard segments
|
|
221
|
-
*/
|
|
222
141
|
export function workspaceGlobForApp(root, appDir) {
|
|
223
142
|
const rel = path.relative(root, appDir).split(path.sep).join("/");
|
|
224
143
|
if (rel === "" || rel.split("/")[0] === "..")
|
|
@@ -231,25 +150,16 @@ function maybeBootstrapAppsRepo(cwd, tenant, test) {
|
|
|
231
150
|
const created = bootstrapAppsRepo(cwd, tenant);
|
|
232
151
|
logInfo(`Standalone apps repo detected — bootstrapped workspace files: ${created.join(", ")}`);
|
|
233
152
|
}
|
|
234
|
-
// Register Handlebars helpers
|
|
235
153
|
Handlebars.registerHelper("titleCase", (str) => {
|
|
236
154
|
return str
|
|
237
155
|
.split("-")
|
|
238
156
|
.map((word) => word.charAt(0).toUpperCase() + word.slice(1))
|
|
239
157
|
.join(" ");
|
|
240
158
|
});
|
|
241
|
-
/**
|
|
242
|
-
* Check if we're in an interactive terminal
|
|
243
|
-
*/
|
|
244
159
|
function isInteractive() {
|
|
245
160
|
return Boolean(process.stdin.isTTY && process.stdout.isTTY);
|
|
246
161
|
}
|
|
247
|
-
/**
|
|
248
|
-
* Run interactive prompts to gather missing options.
|
|
249
|
-
* Only called when TTY is available and required options are missing.
|
|
250
|
-
*/
|
|
251
162
|
async function promptForOptions(options) {
|
|
252
|
-
// Dynamic imports so non-interactive usage doesn't load inquirer
|
|
253
163
|
const { default: input } = await import("@inquirer/input");
|
|
254
164
|
const { default: checkbox } = await import("@inquirer/checkbox");
|
|
255
165
|
const tenant = options.tenant ??
|
|
@@ -273,14 +183,13 @@ async function promptForOptions(options) {
|
|
|
273
183
|
choices: VALID_PRIMITIVES.map((p) => ({
|
|
274
184
|
name: PRIMITIVES[p],
|
|
275
185
|
value: p,
|
|
276
|
-
checked: p === "service",
|
|
186
|
+
checked: p === "service",
|
|
277
187
|
})),
|
|
278
188
|
});
|
|
279
189
|
if (primitives.length === 0) {
|
|
280
190
|
primitives = ["service"];
|
|
281
191
|
}
|
|
282
192
|
}
|
|
283
|
-
// Database and bucket place files in api/ — ensure service is included
|
|
284
193
|
if (primitives.includes("database") && !primitives.includes("service")) {
|
|
285
194
|
primitives.push("service");
|
|
286
195
|
logInfo("Added 'service' — database files live in the api/ directory.");
|
|
@@ -291,19 +200,14 @@ async function promptForOptions(options) {
|
|
|
291
200
|
}
|
|
292
201
|
return { tenant, name, primitives };
|
|
293
202
|
}
|
|
294
|
-
/**
|
|
295
|
-
* Recursively copy a directory, processing .hbs templates
|
|
296
|
-
*/
|
|
297
203
|
export function copyTemplate(srcDir, destDir, context) {
|
|
298
204
|
const entries = fs.readdirSync(srcDir, { withFileTypes: true });
|
|
299
205
|
for (const entry of entries) {
|
|
300
206
|
const srcPath = path.join(srcDir, entry.name);
|
|
301
207
|
let destName = entry.name;
|
|
302
|
-
// Remove .hbs extension for template files
|
|
303
208
|
if (destName.endsWith(".hbs")) {
|
|
304
209
|
destName = destName.slice(0, -4);
|
|
305
210
|
}
|
|
306
|
-
// File names can be templated too (e.g. Pulumi.{{tenant}}-{{env}}.yaml.hbs)
|
|
307
211
|
if (destName.includes("{{")) {
|
|
308
212
|
destName = Handlebars.compile(destName)(context);
|
|
309
213
|
}
|
|
@@ -313,21 +217,16 @@ export function copyTemplate(srcDir, destDir, context) {
|
|
|
313
217
|
copyTemplate(srcPath, destPath, context);
|
|
314
218
|
}
|
|
315
219
|
else if (entry.name.endsWith(".hbs")) {
|
|
316
|
-
// Process Handlebars template
|
|
317
220
|
const templateContent = fs.readFileSync(srcPath, "utf-8");
|
|
318
221
|
const template = Handlebars.compile(templateContent);
|
|
319
222
|
const output = template(context);
|
|
320
223
|
fs.writeFileSync(destPath, output);
|
|
321
224
|
}
|
|
322
225
|
else {
|
|
323
|
-
// Copy file as-is
|
|
324
226
|
fs.copyFileSync(srcPath, destPath);
|
|
325
227
|
}
|
|
326
228
|
}
|
|
327
229
|
}
|
|
328
|
-
/**
|
|
329
|
-
* Parse and validate primitive selections from comma-separated string
|
|
330
|
-
*/
|
|
331
230
|
function parsePrimitives(input) {
|
|
332
231
|
const selected = input.split(",").map((s) => s.trim().toLowerCase());
|
|
333
232
|
const invalid = selected.filter((s) => !VALID_PRIMITIVES.includes(s));
|
|
@@ -338,16 +237,20 @@ function parsePrimitives(input) {
|
|
|
338
237
|
}
|
|
339
238
|
return selected;
|
|
340
239
|
}
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
240
|
+
export function describeNoAppsHome(cwd, tenant, baseDir, test) {
|
|
241
|
+
if (test || isInsidePlatformMonorepo(cwd)) {
|
|
242
|
+
return {
|
|
243
|
+
message: `Tenant directory not found: ${baseDir}/${tenant}/`,
|
|
244
|
+
hint: "Create the tenant directory first, or run from within it.",
|
|
245
|
+
};
|
|
246
|
+
}
|
|
247
|
+
return {
|
|
248
|
+
message: `This directory is not a Mesh apps repo — no apps/ here${fs.existsSync(path.join(cwd, ".git")) ? "" : " and it is not a git repo"}.`,
|
|
249
|
+
hint: `Run: mesh init (turns this folder into your ${tenant}-mesh-apps repo), or cd into that repo and re-run mesh create-app.`,
|
|
250
|
+
};
|
|
251
|
+
}
|
|
344
252
|
export function resolveAppDir(cwd, tenant, name, test) {
|
|
345
253
|
const baseDir = test ? "tests/tenants" : "tenants";
|
|
346
|
-
// `--test` names one destination, so it probes only that one. The general
|
|
347
|
-
// search below falls back to `<cwd>/apps`, which in a monorepo root is the
|
|
348
|
-
// REAL app directory (`apps/hub`, `apps/banking-api`) — it exists, so it won
|
|
349
|
-
// the probe and silently swallowed `--test`, scaffolding a throwaway test app
|
|
350
|
-
// next to the shipped ones while the log still said "Creating in tests/".
|
|
351
254
|
const possiblePaths = test
|
|
352
255
|
? [path.join(cwd, baseDir, tenant, "apps")]
|
|
353
256
|
: [
|
|
@@ -359,8 +262,9 @@ export function resolveAppDir(cwd, tenant, name, test) {
|
|
|
359
262
|
if (!appsDir) {
|
|
360
263
|
appsDir = path.join(cwd, baseDir, tenant, "apps");
|
|
361
264
|
if (!fs.existsSync(path.join(cwd, baseDir, tenant))) {
|
|
362
|
-
|
|
363
|
-
|
|
265
|
+
const { message, hint } = describeNoAppsHome(cwd, tenant, baseDir, test);
|
|
266
|
+
logError(message);
|
|
267
|
+
logInfo(hint);
|
|
364
268
|
process.exit(1);
|
|
365
269
|
}
|
|
366
270
|
if (!fs.existsSync(appsDir)) {
|
|
@@ -370,12 +274,8 @@ export function resolveAppDir(cwd, tenant, name, test) {
|
|
|
370
274
|
}
|
|
371
275
|
return path.join(appsDir, name);
|
|
372
276
|
}
|
|
373
|
-
/**
|
|
374
|
-
* Generate a composable app from fragments
|
|
375
|
-
*/
|
|
376
277
|
export function generateComposableApp(appDir, context) {
|
|
377
278
|
const fragmentsDir = path.join(packageRoot, "fragments");
|
|
378
|
-
// 1. Always copy base fragment
|
|
379
279
|
const baseDir = path.join(fragmentsDir, "base");
|
|
380
280
|
if (!fs.existsSync(baseDir)) {
|
|
381
281
|
logError(`Fragments directory not found: ${baseDir}`);
|
|
@@ -383,7 +283,6 @@ export function generateComposableApp(appDir, context) {
|
|
|
383
283
|
process.exit(1);
|
|
384
284
|
}
|
|
385
285
|
copyTemplate(baseDir, appDir, context);
|
|
386
|
-
// 2. Copy primitive-specific fragments
|
|
387
286
|
if (context.service) {
|
|
388
287
|
const serviceDir = path.join(fragmentsDir, "service");
|
|
389
288
|
if (!fs.existsSync(serviceDir)) {
|
|
@@ -412,7 +311,6 @@ export function generateComposableApp(appDir, context) {
|
|
|
412
311
|
}
|
|
413
312
|
copyTemplate(bucketDir, appDir, context);
|
|
414
313
|
}
|
|
415
|
-
// 3. Always generate AGENTS.md
|
|
416
314
|
const agentsDir = path.join(fragmentsDir, "agents");
|
|
417
315
|
if (fs.existsSync(agentsDir)) {
|
|
418
316
|
copyTemplate(agentsDir, appDir, context);
|
|
@@ -430,7 +328,6 @@ export function registerCreateAppCommand(program) {
|
|
|
430
328
|
.option("--skip-registry-check", "Scaffold without checking that this machine can install @mesh-tech packages (offline use; run `mesh registry login` before `pnpm install`)", false)
|
|
431
329
|
.action(async (options) => {
|
|
432
330
|
await ensureRegistryAccess(process.cwd(), options);
|
|
433
|
-
// Legacy template mode — requires all flags
|
|
434
331
|
if (options.template) {
|
|
435
332
|
if (!options.tenant || !options.name) {
|
|
436
333
|
logError("--tenant and --name are required with --template");
|
|
@@ -439,21 +336,17 @@ export function registerCreateAppCommand(program) {
|
|
|
439
336
|
await runLegacyTemplate(options.tenant, options.name, options.template, options.test);
|
|
440
337
|
return;
|
|
441
338
|
}
|
|
442
|
-
// Composable mode — interactive or flag-based
|
|
443
339
|
let tenant;
|
|
444
340
|
let name;
|
|
445
341
|
let primitives;
|
|
446
342
|
const needsPrompt = !options.tenant || !options.name || !options.primitives;
|
|
447
343
|
if (needsPrompt && isInteractive()) {
|
|
448
|
-
// Interactive: prompt for missing values
|
|
449
344
|
const prompted = await promptForOptions(options);
|
|
450
345
|
tenant = prompted.tenant;
|
|
451
346
|
name = prompted.name;
|
|
452
347
|
primitives = prompted.primitives;
|
|
453
348
|
}
|
|
454
349
|
else if (needsPrompt) {
|
|
455
|
-
// Non-interactive but missing flags — the repo's `mesh.json` (written
|
|
456
|
-
// by `mesh init`) supplies the tenant when the flag is omitted.
|
|
457
350
|
options.tenant ??= findMeshJson(process.cwd())?.data.tenant;
|
|
458
351
|
if (!options.tenant) {
|
|
459
352
|
logError("--tenant is required (no TTY for interactive mode)");
|
|
@@ -474,7 +367,6 @@ export function registerCreateAppCommand(program) {
|
|
|
474
367
|
name = options.name;
|
|
475
368
|
primitives = parsePrimitives(options.primitives);
|
|
476
369
|
}
|
|
477
|
-
// Database and bucket place files in api/ — ensure service is included
|
|
478
370
|
if (primitives.includes("database") && !primitives.includes("service")) {
|
|
479
371
|
primitives.push("service");
|
|
480
372
|
logInfo("Added 'service' — database files live in the api/ directory.");
|
|
@@ -486,25 +378,10 @@ export function registerCreateAppCommand(program) {
|
|
|
486
378
|
await runComposable(tenant, name, primitives, options.test);
|
|
487
379
|
});
|
|
488
380
|
}
|
|
489
|
-
/** Printed when the registry preflight fails — the scaffold stops before any prompt or write. */
|
|
490
381
|
export const NO_REGISTRY_ACCESS_MESSAGE = "No registry access on this machine — @mesh-tech packages cannot be installed.\n" +
|
|
491
382
|
" Run: mesh init\n" +
|
|
492
383
|
" (sets up your tenant and signs you in to the package registry)\n" +
|
|
493
384
|
" Scaffolding offline anyway? add --skip-registry-check";
|
|
494
|
-
/**
|
|
495
|
-
* Registry preflight, BEFORE any prompt and before any file is written.
|
|
496
|
-
*
|
|
497
|
-
* A scaffold whose `pnpm install` cannot resolve `@mesh-tech/*` is a trap: the
|
|
498
|
-
* failure arrives minutes later with npm's generic E401/E404 advice, and the
|
|
499
|
-
* fix (registry sign-in) has nothing to do with the app. So outside the
|
|
500
|
-
* platform monorepo — where `workspace:*` links need no registry — the
|
|
501
|
-
* command checks first and, when the machine has no access, stops and names
|
|
502
|
-
* `mesh init`, the one place that sets a machine up. A registry that cannot
|
|
503
|
-
* be reached is a network fault, not a missing grant: warn and carry on.
|
|
504
|
-
*
|
|
505
|
-
* @example
|
|
506
|
-
* await ensureRegistryAccess(process.cwd(), { test: false }); // throws MeshCliError when access is missing
|
|
507
|
-
*/
|
|
508
385
|
export async function ensureRegistryAccess(cwd, options, preflight = registryPreflight) {
|
|
509
386
|
if (isInsidePlatformMonorepo(cwd))
|
|
510
387
|
return;
|
|
@@ -562,11 +439,6 @@ async function runLegacyTemplate(tenant, name, template, test) {
|
|
|
562
439
|
await checkScaffoldContract(appDir);
|
|
563
440
|
printLegacyNextSteps(appDir, template);
|
|
564
441
|
}
|
|
565
|
-
/** Best-effort skills sync after scaffolding (design D1): a fresh Claude
|
|
566
|
-
* session in the repo sees the base skills + Intent discovery immediately.
|
|
567
|
-
* Also seeds the app's OWN skill stub — the app repo knows the app better than
|
|
568
|
-
* any platform skill can, so the boilerplate sets the base and the developer
|
|
569
|
-
* grows it. */
|
|
570
442
|
function autoSyncSkills(appDir, appName) {
|
|
571
443
|
const root = resolveTargetRoot(appDir);
|
|
572
444
|
try {
|
|
@@ -584,12 +456,6 @@ function autoSyncSkills(appDir, appName) {
|
|
|
584
456
|
logWarn(`App skill stub skipped: ${err instanceof Error ? err.message : err}`);
|
|
585
457
|
}
|
|
586
458
|
}
|
|
587
|
-
/**
|
|
588
|
-
* Run `mesh app check` on the app just scaffolded. A fresh scaffold satisfies
|
|
589
|
-
* the Mesh app contract by construction (the template test proves it), so a
|
|
590
|
-
* finding here is a platform defect, not the developer's: report it loudly and
|
|
591
|
-
* fail the command so it cannot be missed, but leave the files in place.
|
|
592
|
-
*/
|
|
593
459
|
async function checkScaffoldContract(appDir) {
|
|
594
460
|
const root = resolveTargetRoot(appDir);
|
|
595
461
|
const report = await runAppCheck(root, [path.relative(root, appDir) || "."]);
|
|
@@ -619,13 +485,9 @@ async function runComposable(tenant, name, primitives, test) {
|
|
|
619
485
|
logError(`App directory already exists: ${appDir}`);
|
|
620
486
|
process.exit(1);
|
|
621
487
|
}
|
|
622
|
-
// Platform defaults (the generated Pulumi config targets the mesh hub / dev).
|
|
623
488
|
const region = "us-east-2";
|
|
624
489
|
const platformName = "mesh";
|
|
625
490
|
const platformEnv = "dev";
|
|
626
|
-
// Link local source inside the platform monorepo; every other repo installs
|
|
627
|
-
// `@mesh-tech/*` from the registry, so it gets a caret range on the current
|
|
628
|
-
// published line (looked up here, baked floor when the lookup can't run).
|
|
629
491
|
const workspaceDeps = isInsidePlatformMonorepo(appDir);
|
|
630
492
|
const repoRoot = resolveTargetRoot(process.cwd());
|
|
631
493
|
const mesh = workspaceDeps
|
|
@@ -723,4 +585,3 @@ function printComposableNextSteps(appDir, context) {
|
|
|
723
585
|
console.log(" mesh dev # run locally");
|
|
724
586
|
console.log("");
|
|
725
587
|
}
|
|
726
|
-
//# sourceMappingURL=create-app.js.map
|
|
@@ -1,13 +1,6 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* mesh db connect - Start DB tunnel for manual psql access
|
|
3
|
-
*
|
|
4
|
-
* Usage:
|
|
5
|
-
* mesh db connect --tenant mesh --env dev-temporal
|
|
6
|
-
*/
|
|
7
1
|
interface ConnectOptions {
|
|
8
2
|
tenant?: string;
|
|
9
3
|
env?: string;
|
|
10
4
|
}
|
|
11
5
|
export declare function connectCommand(options: ConnectOptions): Promise<void>;
|
|
12
6
|
export {};
|
|
13
|
-
//# sourceMappingURL=connect.d.ts.map
|
|
@@ -1,13 +1,6 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* mesh db connect - Start DB tunnel for manual psql access
|
|
3
|
-
*
|
|
4
|
-
* Usage:
|
|
5
|
-
* mesh db connect --tenant mesh --env dev-temporal
|
|
6
|
-
*/
|
|
7
1
|
import { spawn } from "child_process";
|
|
8
2
|
import { detectContext, getPlatformBastionInfo, logInfo, logError, } from "../../utils/index.js";
|
|
9
3
|
export async function connectCommand(options) {
|
|
10
|
-
// Resolve tenant/env - explicit or auto-detect
|
|
11
4
|
let tenant;
|
|
12
5
|
let platformEnv;
|
|
13
6
|
if (options.tenant && options.env) {
|
|
@@ -42,7 +35,6 @@ export async function connectCommand(options) {
|
|
|
42
35
|
console.log("");
|
|
43
36
|
logInfo("Press Ctrl+C to stop the tunnel");
|
|
44
37
|
console.log("");
|
|
45
|
-
// Start SSM tunnel
|
|
46
38
|
const tunnel = spawn("aws", [
|
|
47
39
|
"ssm",
|
|
48
40
|
"start-session",
|
|
@@ -65,4 +57,3 @@ export async function connectCommand(options) {
|
|
|
65
57
|
process.exit(code ?? 0);
|
|
66
58
|
});
|
|
67
59
|
}
|
|
68
|
-
//# sourceMappingURL=connect.js.map
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* mesh db credentials - Print database credentials
|
|
3
|
-
*
|
|
4
|
-
* Usage:
|
|
5
|
-
* mesh db credentials --tenant mesh --env dev-temporal --app rdc --app-tenant encore --app-stage dev
|
|
6
|
-
*/
|
|
7
1
|
interface CredentialsOptions {
|
|
8
2
|
tenant?: string;
|
|
9
3
|
env?: string;
|
|
@@ -13,4 +7,3 @@ interface CredentialsOptions {
|
|
|
13
7
|
}
|
|
14
8
|
export declare function credentialsCommand(options: CredentialsOptions): Promise<void>;
|
|
15
9
|
export {};
|
|
16
|
-
//# sourceMappingURL=credentials.d.ts.map
|
|
@@ -1,12 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* mesh db credentials - Print database credentials
|
|
3
|
-
*
|
|
4
|
-
* Usage:
|
|
5
|
-
* mesh db credentials --tenant mesh --env dev-temporal --app rdc --app-tenant encore --app-stage dev
|
|
6
|
-
*/
|
|
7
1
|
import { detectContext, getDatabaseUrl, logInfo, logError, } from "../../utils/index.js";
|
|
8
2
|
export async function credentialsCommand(options) {
|
|
9
|
-
// Resolve platform tenant/env
|
|
10
3
|
let platformTenant;
|
|
11
4
|
let platformEnv;
|
|
12
5
|
if (options.tenant && options.env) {
|
|
@@ -25,14 +18,12 @@ export async function credentialsCommand(options) {
|
|
|
25
18
|
platformEnv = ctx.platformEnv;
|
|
26
19
|
logInfo(`Auto-detected: Tenant=${platformTenant}, Env=${platformEnv}`);
|
|
27
20
|
}
|
|
28
|
-
// Resolve app credentials
|
|
29
21
|
const appTenant = options.appTenant ?? platformTenant;
|
|
30
22
|
const appStage = options.appStage ?? platformEnv;
|
|
31
23
|
const appName = options.app;
|
|
32
24
|
if (appName) {
|
|
33
25
|
logInfo(`App credentials: tenant=${appTenant}, stage=${appStage}, app=${appName}`);
|
|
34
26
|
}
|
|
35
|
-
// Get DATABASE_URL
|
|
36
27
|
const databaseUrl = await getDatabaseUrl(appTenant, appStage, { app: appName });
|
|
37
28
|
const parsed = new URL(databaseUrl);
|
|
38
29
|
console.log("");
|
|
@@ -53,4 +44,3 @@ export async function credentialsCommand(options) {
|
|
|
53
44
|
console.log(` ${tunnelUrl.toString()}`);
|
|
54
45
|
console.log("");
|
|
55
46
|
}
|
|
56
|
-
//# sourceMappingURL=credentials.js.map
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* mesh db env - Export DATABASE_URL for shell
|
|
3
|
-
*
|
|
4
|
-
* Usage: eval $(mesh db env --tenant mesh --env dev-temporal --app rdc --app-tenant encore --app-stage dev)
|
|
5
|
-
*/
|
|
6
1
|
interface EnvOptions {
|
|
7
2
|
tenant?: string;
|
|
8
3
|
env?: string;
|
|
@@ -12,4 +7,3 @@ interface EnvOptions {
|
|
|
12
7
|
}
|
|
13
8
|
export declare function envCommand(options: EnvOptions): Promise<void>;
|
|
14
9
|
export {};
|
|
15
|
-
//# sourceMappingURL=env.d.ts.map
|
|
@@ -1,17 +1,10 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* mesh db env - Export DATABASE_URL for shell
|
|
3
|
-
*
|
|
4
|
-
* Usage: eval $(mesh db env --tenant mesh --env dev-temporal --app rdc --app-tenant encore --app-stage dev)
|
|
5
|
-
*/
|
|
6
1
|
import { detectContext, getDatabaseUrl, rewriteDatabaseUrl, logInfo, logError, } from "../../utils/index.js";
|
|
7
2
|
export async function envCommand(options) {
|
|
8
|
-
// Resolve platform tenant/env
|
|
9
3
|
let platformTenant;
|
|
10
4
|
let platformEnv;
|
|
11
5
|
if (options.tenant && options.env) {
|
|
12
6
|
platformTenant = options.tenant;
|
|
13
7
|
platformEnv = options.env;
|
|
14
|
-
// Use stderr for info so stdout is clean for eval
|
|
15
8
|
console.error(`ℹ Platform: Tenant=${platformTenant}, Env=${platformEnv}`);
|
|
16
9
|
}
|
|
17
10
|
else if (options.tenant || options.env) {
|
|
@@ -25,21 +18,15 @@ export async function envCommand(options) {
|
|
|
25
18
|
platformEnv = ctx.platformEnv;
|
|
26
19
|
console.error(`ℹ Auto-detected: Tenant=${platformTenant}, Env=${platformEnv}`);
|
|
27
20
|
}
|
|
28
|
-
// Resolve app credentials
|
|
29
21
|
const appTenant = options.appTenant ?? platformTenant;
|
|
30
22
|
const appStage = options.appStage ?? platformEnv;
|
|
31
23
|
const appName = options.app;
|
|
32
24
|
if (appName) {
|
|
33
25
|
console.error(`ℹ App credentials: tenant=${appTenant}, stage=${appStage}, app=${appName}`);
|
|
34
26
|
}
|
|
35
|
-
// Get DATABASE_URL and rewrite for tunnel
|
|
36
27
|
const rawUrl = await getDatabaseUrl(appTenant, appStage, { app: appName });
|
|
37
28
|
const tunnelUrl = rewriteDatabaseUrl(rawUrl, { endpoint: "localhost:5432" });
|
|
38
29
|
const parsed = new URL(tunnelUrl);
|
|
39
|
-
// Output export statements (to stdout for eval).
|
|
40
|
-
// WARNING: Contains plaintext credentials. Use only with:
|
|
41
|
-
// eval "$(mesh db env ...)"
|
|
42
|
-
// Do NOT run bare — credentials will appear in terminal and shell history.
|
|
43
30
|
console.log(`export DATABASE_URL="${tunnelUrl}"`);
|
|
44
31
|
console.log('export DB_HOST="localhost"');
|
|
45
32
|
console.log('export DB_PORT="5432"');
|
|
@@ -47,4 +34,3 @@ export async function envCommand(options) {
|
|
|
47
34
|
console.log(`export DB_USERNAME="${parsed.username}"`);
|
|
48
35
|
console.log(`export DB_PASSWORD="${decodeURIComponent(parsed.password)}"`);
|
|
49
36
|
}
|
|
50
|
-
//# sourceMappingURL=env.js.map
|
|
@@ -1,54 +1,11 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* mesh db exec - Run any command with database connection
|
|
3
|
-
*
|
|
4
|
-
* Three modes of operation:
|
|
5
|
-
*
|
|
6
|
-
* 1. Explicit mode (recommended for ad-hoc use):
|
|
7
|
-
* mesh db exec --tenant=<tenant> --env=<env> [--ssl=require] -- <command>
|
|
8
|
-
* - Uses explicit tenant/env to find platform bastion
|
|
9
|
-
* - Starts tunnel if needed
|
|
10
|
-
* - Similar to: mesh tunnel --tenant mesh --env dev
|
|
11
|
-
*
|
|
12
|
-
* 2. Direct mode (for sst dev integration):
|
|
13
|
-
* mesh db exec --secret=<arn> [--ssl=require] -- <command>
|
|
14
|
-
* - Uses secret ARN directly, expects tunnel already running
|
|
15
|
-
* - Ideal for sst.config.ts devCommand
|
|
16
|
-
*
|
|
17
|
-
* 3. Discovery mode (legacy, auto-detection):
|
|
18
|
-
* mesh db exec [--stage=<stage>] -- <command>
|
|
19
|
-
* - Auto-discovers tenant/env from filesystem and config files
|
|
20
|
-
* - Can be fragile if project structure doesn't match expected patterns
|
|
21
|
-
* - Starts tunnel if needed
|
|
22
|
-
*
|
|
23
|
-
* Examples:
|
|
24
|
-
* # Explicit mode (recommended)
|
|
25
|
-
* mesh db exec --tenant mesh --env dev --ssl=require -- npx prisma db push
|
|
26
|
-
* mesh db exec -t mesh -e dev -- npx prisma migrate dev
|
|
27
|
-
*
|
|
28
|
-
* # Direct mode (in sst.config.ts)
|
|
29
|
-
* mesh db exec --secret=arn:aws:secretsmanager:... --ssl=require -- pnpm dev
|
|
30
|
-
*
|
|
31
|
-
* # Discovery mode (legacy)
|
|
32
|
-
* mesh db exec -- npx prisma db push
|
|
33
|
-
* mesh db exec --stage=dev -- npx prisma migrate dev
|
|
34
|
-
*/
|
|
35
1
|
export interface ExecOptions {
|
|
36
|
-
/** Platform tenant for bastion lookup */
|
|
37
2
|
tenant?: string;
|
|
38
|
-
/** Platform environment for bastion lookup */
|
|
39
3
|
env?: string;
|
|
40
|
-
/** App name for credentials path */
|
|
41
4
|
app?: string;
|
|
42
|
-
/** Tenant for app credentials (if different from platform tenant) */
|
|
43
5
|
appTenant?: string;
|
|
44
|
-
/** Stage for app credentials */
|
|
45
6
|
appStage?: string;
|
|
46
|
-
/** Secret ARN for direct mode */
|
|
47
7
|
secret?: string;
|
|
48
|
-
/** SSL mode */
|
|
49
8
|
ssl?: string;
|
|
50
|
-
/** Local tunnel port */
|
|
51
9
|
port?: string;
|
|
52
10
|
}
|
|
53
11
|
export declare function execCommand(commandArgs: string[], options: ExecOptions): Promise<void>;
|
|
54
|
-
//# sourceMappingURL=exec.d.ts.map
|