@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,21 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Local DevOutput source for `mesh dev` (design §5.2, AC C1/C3).
|
|
3
|
-
*
|
|
4
|
-
* Instead of reading a deployed Pulumi stack, synthesize the same DevOutput
|
|
5
|
-
* shape from repo conventions and point every service at the running
|
|
6
|
-
* `mesh start` platform. Zero AWS credentials, zero VPN, zero Pulumi state —
|
|
7
|
-
* the app's code never knows it's local:
|
|
8
|
-
* - Temporal → localhost:7233, namespace local-dev (seeded)
|
|
9
|
-
* - Postgres → the local `app` database
|
|
10
|
-
* - Zitadel → http://localhost:8080 (seeded org/app/users)
|
|
11
|
-
* - SpiceDB → localhost:50051 (preshared key)
|
|
12
|
-
* - AWS SDK → ministack via AWS_ENDPOINT_URL (SSM/Secrets/S3 registry)
|
|
13
|
-
*
|
|
14
|
-
* Detection convention = what `mesh create-app` templates emit: immediate
|
|
15
|
-
* subdirectories of the app root whose package.json has a `dev` script
|
|
16
|
-
* (api/, worker/, web/, …); a single-package app root with its own `dev`
|
|
17
|
-
* script becomes one service.
|
|
18
|
-
*/
|
|
19
1
|
import * as fs from "fs";
|
|
20
2
|
import * as path from "path";
|
|
21
3
|
import { isServiceMode, openapiMockCommand } from "./mocks.js";
|
|
@@ -30,28 +12,12 @@ import { getContextConfig } from "../login.js";
|
|
|
30
12
|
import { findMeshJson } from "../../utils/mesh-json.js";
|
|
31
13
|
export const LOCAL_STACK_NAME = "local";
|
|
32
14
|
const BASE_PORT = 3000;
|
|
33
|
-
/**
|
|
34
|
-
* The app's namespace, exactly the name the cloud gives it in K8s AND
|
|
35
|
-
* Temporal ({tenant}-{env}-{app}) — the Hub resolves both from this one
|
|
36
|
-
* convention, so local runs are addressable with zero translation.
|
|
37
|
-
*/
|
|
38
15
|
export function localAppNamespace(tenant, appName) {
|
|
39
16
|
return `${tenant}-${LOCAL_ENV}-${appName}`;
|
|
40
17
|
}
|
|
41
|
-
/** The OTLP log shipper (assets/log-shipper.mjs) each local service's
|
|
42
|
-
* launch pipeline pipes through — ships stdout to the stack's collector
|
|
43
|
-
* with the hosted k8s_* attribution. */
|
|
44
18
|
export function logShipperPath() {
|
|
45
19
|
return path.join(findPackageRoot(), "assets", "log-shipper.mjs");
|
|
46
20
|
}
|
|
47
|
-
/**
|
|
48
|
-
* OTel SDK bootstrap — the local analog of the OTel Operator's pod
|
|
49
|
-
* injection: when the service ships `@opentelemetry/auto-instrumentations-
|
|
50
|
-
* node` (the templates declare it), the platform injects the `--import`
|
|
51
|
-
* register hook + exporter env, and HTTP/fetch/gRPC spans flow to the
|
|
52
|
-
* stack's collector → Tempo → the Hub's Traces views. Apps without the
|
|
53
|
-
* package run untouched.
|
|
54
|
-
*/
|
|
55
21
|
export function autoInstrumentationEnv(appRoot, src) {
|
|
56
22
|
const pkgDir = path.join("node_modules", "@opentelemetry", "auto-instrumentations-node");
|
|
57
23
|
const present = fs.existsSync(path.join(appRoot, src, pkgDir)) || fs.existsSync(path.join(appRoot, pkgDir));
|
|
@@ -60,15 +26,11 @@ export function autoInstrumentationEnv(appRoot, src) {
|
|
|
60
26
|
return {
|
|
61
27
|
NODE_OPTIONS: { value: "--import @opentelemetry/auto-instrumentations-node/register" },
|
|
62
28
|
OTEL_TRACES_EXPORTER: { value: "otlp" },
|
|
63
|
-
// Logs ship via the launch pipeline; metrics locally come from
|
|
64
|
-
// Prometheus scrapes — keep the SDK to traces.
|
|
65
29
|
OTEL_METRICS_EXPORTER: { value: "none" },
|
|
66
30
|
OTEL_LOGS_EXPORTER: { value: "none" },
|
|
67
31
|
OTEL_NODE_DISABLED_INSTRUMENTATIONS: { value: "fs,dns,net" },
|
|
68
32
|
};
|
|
69
33
|
}
|
|
70
|
-
/** Hosted-parity resource attribution for a local service — what the
|
|
71
|
-
* in-cluster k8sattributes processor stamps. */
|
|
72
34
|
export function otelEnv(tenant, appName, serviceName) {
|
|
73
35
|
const namespace = localAppNamespace(tenant, appName);
|
|
74
36
|
return {
|
|
@@ -79,23 +41,15 @@ export function otelEnv(tenant, appName, serviceName) {
|
|
|
79
41
|
},
|
|
80
42
|
};
|
|
81
43
|
}
|
|
82
|
-
/** Endpoints of the running `mesh start` platform, as service env. */
|
|
83
44
|
export function localPlatformEnv(tenant, appName, serviceName) {
|
|
84
45
|
const namespace = localAppNamespace(tenant, appName);
|
|
85
46
|
const env = {
|
|
86
47
|
TEMPORAL_ADDRESS: { value: TEMPORAL_ADDRESS },
|
|
87
48
|
TEMPORAL_NAMESPACE: { value: namespace },
|
|
88
49
|
TEMPORAL_TASK_QUEUE: { value: appName },
|
|
89
|
-
// OTel wiring, two consumers: instrumented services ship traces/metrics
|
|
90
|
-
// themselves, and the launch pipeline's log shipper reads these to ship
|
|
91
|
-
// stdout logs — both with the in-cluster k8sattributes attribution.
|
|
92
50
|
...otelEnv(tenant, appName, serviceName),
|
|
93
51
|
DATABASE_URL: { value: "postgres://postgres:postgres@localhost:5433/app" },
|
|
94
52
|
ZITADEL_ISSUER: { value: ZITADEL_ISSUER },
|
|
95
|
-
// The service's own Zitadel M2M credentials (created by ensureAppTenantAuth
|
|
96
|
-
// on session start) — resolveCredentials("zitadel") picks this up, so apps
|
|
97
|
-
// can hydrate introspection/M2M config the same way they resolve
|
|
98
|
-
// ExternalService links instead of hand-carrying client ids in env files.
|
|
99
53
|
ZITADEL_SECRET_PREFIX: { value: authSecretPath(tenant, appName, serviceName) },
|
|
100
54
|
SPICEDB_ENDPOINT: { value: "localhost:50051" },
|
|
101
55
|
SPICEDB_HTTP_ENDPOINT: { value: "http://localhost:8443" },
|
|
@@ -104,9 +58,6 @@ export function localPlatformEnv(tenant, appName, serviceName) {
|
|
|
104
58
|
MESH_LOCAL: { value: "1" },
|
|
105
59
|
MESH_SERVICE: { value: serviceName },
|
|
106
60
|
};
|
|
107
|
-
// Local tokens come from `mesh login local` (the seeded CLI app), so that
|
|
108
|
-
// app's clientId is the audience local APIs should verify. In the cloud,
|
|
109
|
-
// consumers request the API project's audience scope instead.
|
|
110
61
|
const cliClientId = getContextConfig(LOGIN_CONTEXT)?.clientId;
|
|
111
62
|
if (cliClientId) {
|
|
112
63
|
env.AUTH_AUDIENCE = { value: cliClientId };
|
|
@@ -116,18 +67,6 @@ export function localPlatformEnv(tenant, appName, serviceName) {
|
|
|
116
67
|
}
|
|
117
68
|
return env;
|
|
118
69
|
}
|
|
119
|
-
/**
|
|
120
|
-
* A Dagster workspace announces itself in one of the two shapes `dg dev`
|
|
121
|
-
* accepts: a `dg.toml` at the root (workspace convention — one file listing
|
|
122
|
-
* one or more projects), or a root `pyproject.toml` carrying a `[tool.dg]`
|
|
123
|
-
* table (single-project convention). Either earns the synthesized `dg dev`
|
|
124
|
-
* service.
|
|
125
|
-
*
|
|
126
|
-
* @example
|
|
127
|
-
* isDagsterWorkspaceRoot("/repos/acme-dagster"); // true — has dg.toml
|
|
128
|
-
* isDagsterWorkspaceRoot("/repos/bank-statements"); // true — pyproject.toml has [tool.dg]
|
|
129
|
-
* isDagsterWorkspaceRoot("/repos/plain-hono-api"); // false
|
|
130
|
-
*/
|
|
131
70
|
export function isDagsterWorkspaceRoot(appRoot) {
|
|
132
71
|
if (fs.existsSync(path.join(appRoot, "dg.toml")))
|
|
133
72
|
return true;
|
|
@@ -141,20 +80,6 @@ export function isDagsterWorkspaceRoot(appRoot) {
|
|
|
141
80
|
return false;
|
|
142
81
|
}
|
|
143
82
|
}
|
|
144
|
-
/**
|
|
145
|
-
* Locate the `dg` binary for a workspace, by layout convention:
|
|
146
|
-
* `deployments/local/.venv` (a workspace keeping its dev CLI venv separate
|
|
147
|
-
* from per-project venvs) first, then a root `.venv` (single-project
|
|
148
|
-
* workspaces where one `uv sync` at the root covers everything). Falls back
|
|
149
|
-
* to `dg` on PATH (uv tool install / pipx) when neither venv exists yet —
|
|
150
|
-
* the launch window then shows dg's own error, which names the missing venv
|
|
151
|
-
* more usefully than a failed path lookup would.
|
|
152
|
-
*
|
|
153
|
-
* @example
|
|
154
|
-
* resolveDgBinary("/repos/acme-dagster"); // "deployments/local/.venv/bin/dg"
|
|
155
|
-
* resolveDgBinary("/repos/bank-statements"); // ".venv/bin/dg" (root uv sync)
|
|
156
|
-
* resolveDgBinary("/repos/fresh-clone"); // "dg" (no venv built yet)
|
|
157
|
-
*/
|
|
158
83
|
export function resolveDgBinary(appRoot) {
|
|
159
84
|
for (const candidate of ["deployments/local/.venv/bin/dg", ".venv/bin/dg"]) {
|
|
160
85
|
if (fs.existsSync(path.join(appRoot, candidate)))
|
|
@@ -174,11 +99,6 @@ function hasDevScript(dir) {
|
|
|
174
99
|
return false;
|
|
175
100
|
}
|
|
176
101
|
}
|
|
177
|
-
/**
|
|
178
|
-
* Detect runnable services by template convention: immediate subdirectories
|
|
179
|
-
* with a package.json `dev` script; falls back to the app root itself when
|
|
180
|
-
* it is a single-package app.
|
|
181
|
-
*/
|
|
182
102
|
export function detectLocalServices(appRoot) {
|
|
183
103
|
const services = {};
|
|
184
104
|
for (const entry of fs.readdirSync(appRoot, { withFileTypes: true })) {
|
|
@@ -193,26 +113,13 @@ export function detectLocalServices(appRoot) {
|
|
|
193
113
|
}
|
|
194
114
|
return services;
|
|
195
115
|
}
|
|
196
|
-
/** Synthesize the DevOutput `mesh dev` would otherwise read from Pulumi.
|
|
197
|
-
* `tenant` is the app tenant (detectLocalTenant) — it scopes the app's
|
|
198
|
-
* namespace ({tenant}-{env}-{app}) for Temporal, logs, and traces.
|
|
199
|
-
* `opts.mocks` (mesh dev --externals) appends declared mock services and injects
|
|
200
|
-
* their ExternalService credential prefixes into every app service. */
|
|
201
116
|
export function buildLocalDevOutput(appRoot, tenant, opts = {}) {
|
|
202
117
|
const detected = detectLocalServices(appRoot);
|
|
203
118
|
const names = Object.keys(detected);
|
|
204
|
-
// A Dagster workspace (dg.toml, or [tool.dg] in a root pyproject.toml) is
|
|
205
|
-
// runnable even with zero package.json services — the common shape: the
|
|
206
|
-
// pipelines are Python, the only Node artifact is the Pulumi program.
|
|
207
119
|
const isDagsterWorkspace = isDagsterWorkspaceRoot(appRoot);
|
|
208
120
|
if (names.length === 0 && !isDagsterWorkspace) {
|
|
209
121
|
throw new MeshCliError(`No runnable services found under ${appRoot} — expected subdirectories (api/, worker/, …) with a package.json 'dev' script, or a Dagster workspace (dg.toml, or [tool.dg] in pyproject.toml).`, { remediation: { command: "mesh create-app" } });
|
|
210
122
|
}
|
|
211
|
-
// App name = project name = authz namespace. Pulumi.yaml `name:` wins
|
|
212
|
-
// (matches getProjectName — a stack-backed app run with --local must keep
|
|
213
|
-
// its deployed identity), then package.json name, then the basename.
|
|
214
|
-
// Scoped package names (@scu-apps/plaid) are unusable as Temporal/K8s
|
|
215
|
-
// namespaces — drop the scope.
|
|
216
123
|
let appName = path.basename(appRoot);
|
|
217
124
|
try {
|
|
218
125
|
const pkg = JSON.parse(fs.readFileSync(path.join(appRoot, "package.json"), "utf-8"));
|
|
@@ -220,7 +127,6 @@ export function buildLocalDevOutput(appRoot, tenant, opts = {}) {
|
|
|
220
127
|
appName = pkg.name.replace(/^@[^/]+\//, "");
|
|
221
128
|
}
|
|
222
129
|
catch {
|
|
223
|
-
// no root package.json — keep the basename
|
|
224
130
|
}
|
|
225
131
|
const pulumiYaml = path.join(appRoot, "Pulumi.yaml");
|
|
226
132
|
if (fs.existsSync(pulumiYaml)) {
|
|
@@ -230,13 +136,7 @@ export function buildLocalDevOutput(appRoot, tenant, opts = {}) {
|
|
|
230
136
|
}
|
|
231
137
|
const services = {};
|
|
232
138
|
const mocks = opts.mocks ?? {};
|
|
233
|
-
// Only process/openapi declarations run as mock-{name} services in this
|
|
234
|
-
// orchestration; compose externals are docker-managed and sandbox
|
|
235
|
-
// declarations spawn nothing (dev.ts seeds their credentials directly).
|
|
236
139
|
const mockNames = Object.keys(mocks).filter((name) => isServiceMode(name, mocks[name]));
|
|
237
|
-
// The ExternalService link() contract, synthesized: every app service gets
|
|
238
|
-
// {EXT}_SECRET_PREFIX for each mocked external, so resolveCredentials()
|
|
239
|
-
// runs the exact deployed code path against the locally seeded secret.
|
|
240
140
|
const externalEnv = {};
|
|
241
141
|
for (const decl of Object.values(mocks)) {
|
|
242
142
|
if (!decl.external)
|
|
@@ -253,7 +153,6 @@ export function buildLocalDevOutput(appRoot, tenant, opts = {}) {
|
|
|
253
153
|
port,
|
|
254
154
|
command: ["pnpm", "dev"],
|
|
255
155
|
env: {
|
|
256
|
-
// allocatePorts keeps service.port and env.PORT in sync on reallocation
|
|
257
156
|
PORT: { value: String(port) },
|
|
258
157
|
...localPlatformEnv(tenant, appName, name),
|
|
259
158
|
...autoInstrumentationEnv(appRoot, detected[name].src),
|
|
@@ -261,18 +160,6 @@ export function buildLocalDevOutput(appRoot, tenant, opts = {}) {
|
|
|
261
160
|
},
|
|
262
161
|
};
|
|
263
162
|
});
|
|
264
|
-
// Sibling-service URLs — the local analog of the deployed cross-service
|
|
265
|
-
// wiring (http://{svc}.{namespace}.svc.cluster.local:{port} in-cluster):
|
|
266
|
-
// every app service gets SERVICE_{NAME}_URL for each app service, so code
|
|
267
|
-
// can wire cross-service clients locally without knowing allocated ports.
|
|
268
|
-
// allocatePorts' cross-service localhost:{port} rewrite keeps them in sync
|
|
269
|
-
// when ports are reallocated.
|
|
270
|
-
//
|
|
271
|
-
// This is a PUBLIC, app-facing env contract — {NAME} is the service's
|
|
272
|
-
// directory name upper-cased, non-[A-Z0-9] → "_". Apps that name their
|
|
273
|
-
// link the same way (events.link({ environmentPrefix: "SERVICE_EVENTS" }))
|
|
274
|
-
// read ONE variable deployed and locally, with no isLocal branch.
|
|
275
|
-
// See docs/guides/mesh-dev-local-env.md.
|
|
276
163
|
for (const name of names) {
|
|
277
164
|
const key = `SERVICE_${name.toUpperCase().replace(/[^A-Z0-9]/g, "_")}_URL`;
|
|
278
165
|
const url = `http://localhost:${services[name].port}`;
|
|
@@ -280,25 +167,9 @@ export function buildLocalDevOutput(appRoot, tenant, opts = {}) {
|
|
|
280
167
|
services[other].env[key] = { value: url };
|
|
281
168
|
}
|
|
282
169
|
}
|
|
283
|
-
// Dagster workspace: synthesize the `dg dev` webserver as a first-class
|
|
284
|
-
// service — the local counterpart of the dev service a DagsterInstance
|
|
285
|
-
// registers from its Pulumi program. The binary is resolved by layout
|
|
286
|
-
// convention (resolveDgBinary). `-p "$PORT"` is expanded by the launch
|
|
287
|
-
// shell from the sourced env file, so a reallocated port
|
|
288
|
-
// (rewriteOwnServicePort keeps env.PORT in sync) still binds correctly — a
|
|
289
|
-
// literal port in the argv would go stale. DAGSTER_HOME pins instance
|
|
290
|
-
// state under the app root so `dg dev` doesn't scatter
|
|
291
|
-
// .tmp_dagster_home_* directories. The service inherits localPlatformEnv,
|
|
292
|
-
// so pipelines reach ministack S3 (AWS_ENDPOINT_URL) with no credential
|
|
293
|
-
// setup.
|
|
294
170
|
if (isDagsterWorkspace) {
|
|
295
171
|
const port = BASE_PORT + names.length + mockNames.length;
|
|
296
172
|
services["dagster"] = {
|
|
297
|
-
// Absolute on purpose: a relative src is MONOREPO-ROOT-relative by the
|
|
298
|
-
// ServiceDevOutput contract (rebaseServiceSrc), which for an app nested
|
|
299
|
-
// in the monorepo would cd the launch shell to the repo root — where
|
|
300
|
-
// neither dg.toml nor the venv path resolves. The absolute app root
|
|
301
|
-
// survives rebasing in both the monorepo and standalone-repo shapes.
|
|
302
173
|
src: appRoot,
|
|
303
174
|
kind: "dagster",
|
|
304
175
|
port,
|
|
@@ -310,14 +181,11 @@ export function buildLocalDevOutput(appRoot, tenant, opts = {}) {
|
|
|
310
181
|
},
|
|
311
182
|
};
|
|
312
183
|
}
|
|
313
|
-
// Declared mocks join the same orchestration (ports, env file, tmux
|
|
314
|
-
// window, log pipeline) as first-class services named mock-{name}.
|
|
315
184
|
mockNames.forEach((name, i) => {
|
|
316
185
|
const decl = mocks[name];
|
|
317
186
|
const serviceName = `mock-${name}`;
|
|
318
187
|
const port = decl.port ?? BASE_PORT + names.length + i;
|
|
319
188
|
services[serviceName] = {
|
|
320
|
-
// openapi mode runs Prism from the app root against the spec path.
|
|
321
189
|
src: decl.src ?? ".",
|
|
322
190
|
port,
|
|
323
191
|
command: decl.openapi ? openapiMockCommand(decl) : (decl.command ?? ["pnpm", "dev"]),
|
|
@@ -336,13 +204,6 @@ export function buildLocalDevOutput(appRoot, tenant, opts = {}) {
|
|
|
336
204
|
tunnels: {},
|
|
337
205
|
};
|
|
338
206
|
}
|
|
339
|
-
/**
|
|
340
|
-
* Whether the app is backed by a Pulumi program: its own (Pulumi.yaml or a
|
|
341
|
-
* Pulumi.<stack>.yaml stack config in the app dir), or a monorepo ROOT
|
|
342
|
-
* program above it (walk up to the repo boundary — .git/pnpm-workspace).
|
|
343
|
-
* Apps like apps/hub deploy via a root program and have no per-app
|
|
344
|
-
* Pulumi.yaml; they must NOT default into `mesh dev` local mode.
|
|
345
|
-
*/
|
|
346
207
|
export function hasStackBacking(appRoot) {
|
|
347
208
|
const hasOwn = fs.existsSync(path.join(appRoot, "Pulumi.yaml")) ||
|
|
348
209
|
fs.readdirSync(appRoot).some((f) => /^Pulumi\..+\.yaml$/.test(f));
|
|
@@ -361,10 +222,6 @@ export function hasStackBacking(appRoot) {
|
|
|
361
222
|
dir = parent;
|
|
362
223
|
}
|
|
363
224
|
}
|
|
364
|
-
/**
|
|
365
|
-
* The app's tenant, for auth provisioning: `mesh:tenant` from the app's
|
|
366
|
-
* Pulumi stack config when present (templates write it), else "local".
|
|
367
|
-
*/
|
|
368
225
|
export function detectLocalTenant(appRoot) {
|
|
369
226
|
for (const file of fs.readdirSync(appRoot)) {
|
|
370
227
|
if (!/^Pulumi\..*\.yaml$/.test(file))
|
|
@@ -375,18 +232,14 @@ export function detectLocalTenant(appRoot) {
|
|
|
375
232
|
if (match)
|
|
376
233
|
return match[1];
|
|
377
234
|
}
|
|
378
|
-
// No per-app stack config names a tenant: fall back to the repo-level
|
|
379
|
-
// record `mesh init` writes, then to the local default.
|
|
380
235
|
const recorded = findMeshJson(appRoot);
|
|
381
236
|
if (recorded)
|
|
382
237
|
return recorded.data.tenant;
|
|
383
238
|
return "local";
|
|
384
239
|
}
|
|
385
|
-
/** The local platform must be up before `mesh dev` can wire services to it. */
|
|
386
240
|
export async function ensureLocalPlatformRunning() {
|
|
387
241
|
const [temporalUp, fabricUp] = await Promise.all([probeTcp(7233), probeTcp(4566)]);
|
|
388
242
|
if (!temporalUp || !fabricUp) {
|
|
389
243
|
throw new MeshCliError("The local Mesh platform is not running (mesh dev local mode wires services to it).", { remediation: { command: "mesh start" } });
|
|
390
244
|
}
|
|
391
245
|
}
|
|
392
|
-
//# sourceMappingURL=dev-local.js.map
|
|
@@ -1,23 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Docker runner for `mesh dev --local` (design §5.3, AC C2).
|
|
3
|
-
*
|
|
4
|
-
* The tmux runner stays the default on dev machines; `--runner docker` is
|
|
5
|
-
* for environments where tmux isn't sensible — CI (the golden-path
|
|
6
|
-
* workflow), headless agents, non-macOS boxes. It renders the SAME
|
|
7
|
-
* synthesized DevOutput into a docker compose project:
|
|
8
|
-
*
|
|
9
|
-
* - one service per DevOutput service, `node:22-bookworm`, the app
|
|
10
|
-
* bind-mounted at /workspace, `pnpm dev` in the service dir
|
|
11
|
-
* - `network_mode: host` — services reach the `mesh start` platform on
|
|
12
|
-
* localhost exactly like the tmux runner (Linux/CI semantics; on macOS
|
|
13
|
-
* Docker Desktop host networking must be enabled, and host-installed
|
|
14
|
-
* node_modules are platform-specific — tmux is the right runner there)
|
|
15
|
-
* - per-service env files carrying the identical env contract
|
|
16
|
-
* - logs ship through the same OTLP shipper (mounted from the CLI)
|
|
17
|
-
*
|
|
18
|
-
* Parity: `mesh dev --status|--kill|logs|restart` map to
|
|
19
|
-
* `docker compose ps|down|logs|restart` via the session state's runner.
|
|
20
|
-
*/
|
|
21
1
|
interface RunnerService {
|
|
22
2
|
src: string;
|
|
23
3
|
port: number;
|
|
@@ -26,7 +6,6 @@ interface RunnerService {
|
|
|
26
6
|
value: string;
|
|
27
7
|
}>;
|
|
28
8
|
}
|
|
29
|
-
/** Write the compose project for a dev session; returns the compose file path. */
|
|
30
9
|
export declare function writeDevCompose(sessionName: string, appRoot: string, services: Record<string, RunnerService>): string;
|
|
31
10
|
export declare function dockerDevUp(sessionName: string): void;
|
|
32
11
|
export declare function dockerDevDown(sessionName: string): void;
|
|
@@ -34,4 +13,3 @@ export declare function dockerDevPs(sessionName: string): string;
|
|
|
34
13
|
export declare function dockerDevLogs(sessionName: string, service: string, tail: number): string;
|
|
35
14
|
export declare function dockerDevRestart(sessionName: string, service: string): void;
|
|
36
15
|
export {};
|
|
37
|
-
//# sourceMappingURL=docker-runner.d.ts.map
|
|
@@ -1,45 +1,21 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Docker runner for `mesh dev --local` (design §5.3, AC C2).
|
|
3
|
-
*
|
|
4
|
-
* The tmux runner stays the default on dev machines; `--runner docker` is
|
|
5
|
-
* for environments where tmux isn't sensible — CI (the golden-path
|
|
6
|
-
* workflow), headless agents, non-macOS boxes. It renders the SAME
|
|
7
|
-
* synthesized DevOutput into a docker compose project:
|
|
8
|
-
*
|
|
9
|
-
* - one service per DevOutput service, `node:22-bookworm`, the app
|
|
10
|
-
* bind-mounted at /workspace, `pnpm dev` in the service dir
|
|
11
|
-
* - `network_mode: host` — services reach the `mesh start` platform on
|
|
12
|
-
* localhost exactly like the tmux runner (Linux/CI semantics; on macOS
|
|
13
|
-
* Docker Desktop host networking must be enabled, and host-installed
|
|
14
|
-
* node_modules are platform-specific — tmux is the right runner there)
|
|
15
|
-
* - per-service env files carrying the identical env contract
|
|
16
|
-
* - logs ship through the same OTLP shipper (mounted from the CLI)
|
|
17
|
-
*
|
|
18
|
-
* Parity: `mesh dev --status|--kill|logs|restart` map to
|
|
19
|
-
* `docker compose ps|down|logs|restart` via the session state's runner.
|
|
20
|
-
*/
|
|
21
1
|
import { execFileSync } from "child_process";
|
|
22
2
|
import * as fs from "fs";
|
|
23
3
|
import * as path from "path";
|
|
24
4
|
import { logShipperPath } from "./dev-local.js";
|
|
25
5
|
import { meshCacheDir } from "../../utils/cache-home.js";
|
|
26
|
-
// Digest-pinned so dev-runner containers are reproducible (matches the
|
|
27
|
-
// pinning of the stack's third-party images).
|
|
28
6
|
const DEV_RUNNER_IMAGE = "node:22-bookworm@sha256:5647be709086c696ff32edaaf1c70cd26d1da6ab2b39c32f3c7b4c4a31957e37";
|
|
29
7
|
function sessionDir(sessionName) {
|
|
30
8
|
return meshCacheDir("mesh-local", "dev", sessionName);
|
|
31
9
|
}
|
|
32
|
-
/** docker env-file format: KEY=VALUE, no quoting, single-line values only. */
|
|
33
10
|
function renderDockerEnvFile(env) {
|
|
34
11
|
const lines = [];
|
|
35
12
|
for (const [key, entry] of Object.entries(env)) {
|
|
36
13
|
if (entry.value.includes("\n"))
|
|
37
|
-
continue;
|
|
14
|
+
continue;
|
|
38
15
|
lines.push(`${key}=${entry.value}`);
|
|
39
16
|
}
|
|
40
17
|
return lines.join("\n") + "\n";
|
|
41
18
|
}
|
|
42
|
-
/** Write the compose project for a dev session; returns the compose file path. */
|
|
43
19
|
export function writeDevCompose(sessionName, appRoot, services) {
|
|
44
20
|
const dir = sessionDir(sessionName);
|
|
45
21
|
const shipper = logShipperPath();
|
|
@@ -55,15 +31,7 @@ export function writeDevCompose(sessionName, appRoot, services) {
|
|
|
55
31
|
const ship = env.OTEL_RESOURCE_ATTRIBUTES
|
|
56
32
|
? ` 2>&1 | NODE_OPTIONS= node /mesh-assets/log-shipper.mjs`
|
|
57
33
|
: "";
|
|
58
|
-
blocks.push(` ${name}:`, ` image: ${DEV_RUNNER_IMAGE}`, ` network_mode: host`, ` working_dir: ${workdir}`, ` volumes:`, ` - '${appRoot}:/workspace'`, ` - '${path.dirname(shipper)}:/mesh-assets:ro'`, ` environment:`,
|
|
59
|
-
// node_modules is the HOST's bind-mounted install — pnpm inside the
|
|
60
|
-
// container must never "verify" it and try a purge/reinstall (pnpm
|
|
61
|
-
// ≥10.9's verify-deps-before-run prompts and dies headless; worse, a
|
|
62
|
-
// purge would clobber the host install).
|
|
63
|
-
` CI: 'true'`, ` npm_config_verify_deps_before_run: 'false'`, ` env_file:`, ` - './${name}.env'`,
|
|
64
|
-
// pipefail: the container's exit code must be the SERVICE's, not the
|
|
65
|
-
// log-shipper's — otherwise a crashed service reports success (CI).
|
|
66
|
-
` command: ["bash", "-lc", "set -o pipefail; corepack enable >/dev/null 2>&1; { ${service.command.join(" ")}; }${ship}"]`, ` restart: unless-stopped`);
|
|
34
|
+
blocks.push(` ${name}:`, ` image: ${DEV_RUNNER_IMAGE}`, ` network_mode: host`, ` working_dir: ${workdir}`, ` volumes:`, ` - '${appRoot}:/workspace'`, ` - '${path.dirname(shipper)}:/mesh-assets:ro'`, ` environment:`, ` CI: 'true'`, ` npm_config_verify_deps_before_run: 'false'`, ` env_file:`, ` - './${name}.env'`, ` command: ["bash", "-lc", "set -o pipefail; corepack enable >/dev/null 2>&1; { ${service.command.join(" ")}; }${ship}"]`, ` restart: unless-stopped`);
|
|
67
35
|
}
|
|
68
36
|
const composePath = path.join(dir, "compose.yml");
|
|
69
37
|
fs.writeFileSync(composePath, blocks.join("\n") + "\n");
|
|
@@ -99,4 +67,3 @@ export function dockerDevRestart(sessionName, service) {
|
|
|
99
67
|
stdio: ["ignore", "inherit", "inherit"],
|
|
100
68
|
});
|
|
101
69
|
}
|
|
102
|
-
//# sourceMappingURL=docker-runner.js.map
|
|
@@ -1,22 +1,8 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Small shared helpers for the local-platform commands — extracted from the
|
|
3
|
-
* copies that had grown in auth-provision/mocks (secret upsert) and
|
|
4
|
-
* dev-local/stack (TCP probe).
|
|
5
|
-
*/
|
|
6
|
-
/** The subset of SecretsManagerClient upsertLocalSecret depends on. */
|
|
7
1
|
export interface SecretsSender {
|
|
8
2
|
send(command: unknown): Promise<unknown>;
|
|
9
3
|
}
|
|
10
|
-
/**
|
|
11
|
-
* Create-or-update a Secrets Manager secret in the local AWS fabric
|
|
12
|
-
* (ministack). Create first; on ResourceExistsException, put a new value.
|
|
13
|
-
* `client` is injectable for tests; defaults to a client against the local
|
|
14
|
-
* fabric.
|
|
15
|
-
*/
|
|
16
4
|
export declare function upsertLocalSecret(secretId: string, value: Record<string, string>, client?: SecretsSender): Promise<void>;
|
|
17
|
-
/** True when a TCP connect to host:port succeeds within timeoutMs. */
|
|
18
5
|
export declare function probeTcp(port: number, opts?: {
|
|
19
6
|
host?: string;
|
|
20
7
|
timeoutMs?: number;
|
|
21
8
|
}): Promise<boolean>;
|
|
22
|
-
//# sourceMappingURL=helpers.d.ts.map
|
|
@@ -1,16 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Small shared helpers for the local-platform commands — extracted from the
|
|
3
|
-
* copies that had grown in auth-provision/mocks (secret upsert) and
|
|
4
|
-
* dev-local/stack (TCP probe).
|
|
5
|
-
*/
|
|
6
1
|
import * as net from "net";
|
|
7
2
|
import { LOCAL_AWS_CONFIG } from "./seed.js";
|
|
8
|
-
/**
|
|
9
|
-
* Create-or-update a Secrets Manager secret in the local AWS fabric
|
|
10
|
-
* (ministack). Create first; on ResourceExistsException, put a new value.
|
|
11
|
-
* `client` is injectable for tests; defaults to a client against the local
|
|
12
|
-
* fabric.
|
|
13
|
-
*/
|
|
14
3
|
export async function upsertLocalSecret(secretId, value, client) {
|
|
15
4
|
const { SecretsManagerClient, CreateSecretCommand, PutSecretValueCommand } = await import("@aws-sdk/client-secrets-manager");
|
|
16
5
|
const sm = client ?? new SecretsManagerClient(LOCAL_AWS_CONFIG);
|
|
@@ -27,7 +16,6 @@ export async function upsertLocalSecret(secretId, value, client) {
|
|
|
27
16
|
}
|
|
28
17
|
}
|
|
29
18
|
}
|
|
30
|
-
/** True when a TCP connect to host:port succeeds within timeoutMs. */
|
|
31
19
|
export function probeTcp(port, opts = {}) {
|
|
32
20
|
const { host = "127.0.0.1", timeoutMs = 2000 } = opts;
|
|
33
21
|
return new Promise((resolve) => {
|
|
@@ -43,4 +31,3 @@ export function probeTcp(port, opts = {}) {
|
|
|
43
31
|
});
|
|
44
32
|
});
|
|
45
33
|
}
|
|
46
|
-
//# sourceMappingURL=helpers.js.map
|
|
@@ -1,28 +1,7 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Local Hub image builder (`mesh start --with-hub`) — the interim path
|
|
3
|
-
* until the hub pipeline publishes pullable container images (design §11).
|
|
4
|
-
*
|
|
5
|
-
* Resolves the published @mesh-tech/hub tarball with the user's registry
|
|
6
|
-
* auth (mesh registry login), extracts it, and docker-builds two images
|
|
7
|
-
* from the prebuilt dists it ships (api/dist → mesh-local-hub-api,
|
|
8
|
-
* ui/build → mesh-local-hub-ui). The CodeArtifact token enters the build
|
|
9
|
-
* as a BuildKit secret and never lands in a layer. Idempotent: images are
|
|
10
|
-
* keyed by the package version and rebuilt only when missing.
|
|
11
|
-
*/
|
|
12
1
|
import { type RegistryTokenState } from "../../utils/auth-preflight.js";
|
|
13
2
|
export declare const HUB_IMAGES: readonly ["mesh-local-hub-api", "mesh-local-hub-ui"];
|
|
14
|
-
/**
|
|
15
|
-
* Build the Hub's oauth2-proxy image (hosted sidecar + loopback issuer
|
|
16
|
-
* forward). Public base images only — no registry auth involved.
|
|
17
|
-
*/
|
|
18
3
|
export declare function ensureHubAuthImage(): void;
|
|
19
|
-
/** Registry auth present? (Needed only to BUILD hub images, not to run them.) */
|
|
20
4
|
export declare function hasRegistryAuth(): boolean;
|
|
21
|
-
/**
|
|
22
|
-
* Newest hub version whose images already exist locally — lets `mesh start`
|
|
23
|
-
* include the Hub by default with no network and no registry auth. Returns
|
|
24
|
-
* undefined when no built images are present.
|
|
25
|
-
*/
|
|
26
5
|
export declare function localHubVersion(): string | undefined;
|
|
27
6
|
export type WithHubPlan = {
|
|
28
7
|
action: "refresh";
|
|
@@ -35,90 +14,15 @@ export type WithHubPlan = {
|
|
|
35
14
|
message: string;
|
|
36
15
|
remediation: string;
|
|
37
16
|
};
|
|
38
|
-
/**
|
|
39
|
-
* Pure: decide what `mesh start --with-hub` does given the registry probe
|
|
40
|
-
* and any already-built local images. Only a *refresh* needs the registry —
|
|
41
|
-
* already-built images run without it, so an expired/missing token degrades
|
|
42
|
-
* to those (with the fixing command) instead of hard-failing a path that
|
|
43
|
-
* works offline (MESH-2479).
|
|
44
|
-
*/
|
|
45
17
|
export declare function planWithHubRefresh(probeState: RegistryTokenState, builtVersion: string | undefined): WithHubPlan;
|
|
46
|
-
/**
|
|
47
|
-
* Ensure the two local hub images exist; build them from the tarball when
|
|
48
|
-
* missing. Returns the hub version (used as the compose image tag).
|
|
49
|
-
*/
|
|
50
18
|
export declare function ensureHubImages(): Promise<string>;
|
|
51
|
-
/** Where the packed Hub ships its compiled authz catalog (`compile-authz.ts`). */
|
|
52
19
|
export declare const HUB_COMPILED_AUTHZ_REL = "api/dist/authz/compiled.json";
|
|
53
|
-
/** The compiled catalog artifact: `{ zed, metadata }`, the shape `SpiceDBSchema` takes. */
|
|
54
20
|
export type HubCompiledAuthz = {
|
|
55
21
|
zed: string;
|
|
56
22
|
metadata: Record<string, unknown>;
|
|
57
23
|
};
|
|
58
|
-
/**
|
|
59
|
-
* The cached tarball a local image version was built from, or null for a
|
|
60
|
-
* from-source build (`<version>-src`), which never has one.
|
|
61
|
-
*
|
|
62
|
-
* @example
|
|
63
|
-
* ```typescript
|
|
64
|
-
* tarballNameForImageVersion("2.2.0-r2"); // => "mesh-tech-hub-2.2.0.tgz"
|
|
65
|
-
* tarballNameForImageVersion("2.2.0-src"); // => null
|
|
66
|
-
* ```
|
|
67
|
-
*/
|
|
68
24
|
export declare function tarballNameForImageVersion(version: string): string | null;
|
|
69
|
-
/**
|
|
70
|
-
* Read the compiled authz catalog of the Hub whose images `mesh start` runs.
|
|
71
|
-
*
|
|
72
|
-
* The staged build context (`context-<version>/`) carries it after a build; when
|
|
73
|
-
* the images already existed nothing was staged, so the one file is extracted
|
|
74
|
-
* from the cached tarball on demand. Returns null for a Hub that ships no
|
|
75
|
-
* catalog (published before 2.1.0) — the caller says so and moves on.
|
|
76
|
-
*/
|
|
77
25
|
export declare function readHubCompiledAuthz(version: string): HubCompiledAuthz | null;
|
|
78
|
-
/**
|
|
79
|
-
* The workspace's default pnpm catalog, as `{ dependency: range }`.
|
|
80
|
-
*
|
|
81
|
-
* Nested manifests inside the packed Hub (`api/package.json`, `ui/package.json`)
|
|
82
|
-
* reference shared versions as `catalog:`. pnpm resolves that on publish for the
|
|
83
|
-
* package's OWN manifest only — the nested ones ship the literal `catalog:`, and
|
|
84
|
-
* `npm install` inside the image rejects it with `EUNSUPPORTEDPROTOCOL`.
|
|
85
|
-
*/
|
|
86
26
|
export declare function readWorkspaceCatalog(repoRoot: string): Record<string, string>;
|
|
87
|
-
/**
|
|
88
|
-
* Make an extracted Hub tarball installable by plain `npm` inside the image.
|
|
89
|
-
*
|
|
90
|
-
* Two rewrites, both on the NESTED manifests the Dockerfiles copy:
|
|
91
|
-
*
|
|
92
|
-
* - `catalog:` → the range the workspace catalog pins.
|
|
93
|
-
* - `workspace:*` dependencies are DROPPED. Every deployed Hub entrypoint is
|
|
94
|
-
* bundled by `esm-bundle`, so no `@mesh-tech/*`
|
|
95
|
-
* or `@libs/*` import survives into `api/dist` / `ui/build` — installing them
|
|
96
|
-
* would fetch PUBLISHED copies that nothing imports, and for a package being
|
|
97
|
-
* changed in this checkout that published copy is precisely the wrong code.
|
|
98
|
-
* - `devDependencies` are DROPPED wholesale. Both Dockerfiles install with
|
|
99
|
-
* `--omit=dev`, so nothing in the image ever needs them — but npm still
|
|
100
|
-
* resolves them into the ideal tree before omitting, and the Hub's dev set
|
|
101
|
-
* (vitest, tsx, the React Router toolchain) trips a peer-conflict crash in
|
|
102
|
-
* the image's npm 10 (`Cannot read properties of null (reading 'edgesOut')`
|
|
103
|
-
* in arborist's `#loadPeerSet`) that fails the build before a single layer
|
|
104
|
-
* is written. Reproduced on the normalized `api/package.json` alone; the
|
|
105
|
-
* same manifest installs clean without the block.
|
|
106
|
-
*
|
|
107
|
-
* Returns the manifests it touched, for the caller to log.
|
|
108
|
-
*/
|
|
109
27
|
export declare function normalizeHubManifests(contextDir: string, catalog: Record<string, string>): string[];
|
|
110
|
-
/**
|
|
111
|
-
* Build the local Hub images from THIS checkout instead of the registry.
|
|
112
|
-
*
|
|
113
|
-
* `mesh start`'s Hub normally comes from the published `@mesh-tech/hub` tarball,
|
|
114
|
-
* which makes it the one environment where a Hub change cannot be exercised
|
|
115
|
-
* before it ships. This packs `apps/hub` exactly as a release would — same
|
|
116
|
-
* `files` allowlist, same Dockerfiles — so the containerized Hub, its auth proxy
|
|
117
|
-
* and its login flow all stay identical; only the code inside changes.
|
|
118
|
-
*
|
|
119
|
-
* Images are tagged `<version>-src` so they can never be mistaken for, or reused
|
|
120
|
-
* as, a published build, and are rebuilt every call: the whole point is to pick
|
|
121
|
-
* up working-tree changes.
|
|
122
|
-
*/
|
|
123
28
|
export declare function buildHubImagesFromSource(repoRoot: string): Promise<string>;
|
|
124
|
-
//# sourceMappingURL=hub-local.d.ts.map
|