@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,16 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `mesh dev doctor` — preflight + on-demand diagnosis for `mesh dev`.
|
|
3
|
-
*
|
|
4
|
-
* Three layers kept deliberately separate so the bug-prone logic stays pure and
|
|
5
|
-
* unit-testable without network/AWS:
|
|
6
|
-
* 1. Engine + renderers (this section): `aggregateStatus`, `runChecks`,
|
|
7
|
-
* `renderHuman`, `renderJson`.
|
|
8
|
-
* 2. `DoctorContext` builder (resolves role/context/session once).
|
|
9
|
-
* 3. The individual `Check`s (creds, tunnels, ports, …), each returning data.
|
|
10
|
-
*
|
|
11
|
-
* Both `mesh dev doctor` and the `mesh dev` launch preflight call `runChecks`;
|
|
12
|
-
* see MESH-2015 (docs/superpowers/specs/2026-07-08-mesh-dev-doctor-design.md).
|
|
13
|
-
*/
|
|
14
1
|
import { execFileSync } from "node:child_process";
|
|
15
2
|
import * as fs from "node:fs";
|
|
16
3
|
import * as net from "node:net";
|
|
@@ -18,10 +5,6 @@ import * as path from "node:path";
|
|
|
18
5
|
import { isLinkedDependencyDir, isPortFree } from "./dev.js";
|
|
19
6
|
import { appUsesMeshPackages, probeRegistryToken, registryLoginFix, } from "../utils/auth-preflight.js";
|
|
20
7
|
import { probeCredentials, isRemoteEnvironment } from "./login.js";
|
|
21
|
-
// ============================================================================
|
|
22
|
-
// Engine + renderers (pure)
|
|
23
|
-
// ============================================================================
|
|
24
|
-
/** `error` if any error, else `warn` if any warn, else `ok` (empty → `ok`). */
|
|
25
8
|
export function aggregateStatus(results) {
|
|
26
9
|
if (results.some((r) => r.status === "error"))
|
|
27
10
|
return "error";
|
|
@@ -29,11 +12,6 @@ export function aggregateStatus(results) {
|
|
|
29
12
|
return "warn";
|
|
30
13
|
return "ok";
|
|
31
14
|
}
|
|
32
|
-
/**
|
|
33
|
-
* Run every check whose `phases` includes `phase`, concurrently. A check that
|
|
34
|
-
* throws is captured as an `error` result rather than aborting the run — the
|
|
35
|
-
* whole point of doctor is to report, never to crash.
|
|
36
|
-
*/
|
|
37
15
|
export async function runChecks(ctx, phase, checks) {
|
|
38
16
|
const applicable = checks.filter((c) => c.phases.includes(phase));
|
|
39
17
|
return Promise.all(applicable.map(async (check) => {
|
|
@@ -53,7 +31,6 @@ export async function runChecks(ctx, phase, checks) {
|
|
|
53
31
|
}));
|
|
54
32
|
}
|
|
55
33
|
export const ICONS = { ok: "✓", warn: "⚠", error: "✗" };
|
|
56
|
-
/** Human-readable: one line per check + indented remediation when present. */
|
|
57
34
|
export function renderHuman(results) {
|
|
58
35
|
const lines = [];
|
|
59
36
|
for (const { check, result } of results) {
|
|
@@ -65,7 +42,6 @@ export function renderHuman(results) {
|
|
|
65
42
|
}
|
|
66
43
|
return lines.join("\n");
|
|
67
44
|
}
|
|
68
|
-
/** The JSON report as data — `renderJson` serialises it; `mesh app check` nests one per app. */
|
|
69
45
|
export function jsonReport(results) {
|
|
70
46
|
return {
|
|
71
47
|
status: aggregateStatus(results.map((r) => r.result)),
|
|
@@ -73,26 +49,17 @@ export function jsonReport(results) {
|
|
|
73
49
|
id: check.id,
|
|
74
50
|
status: result.status,
|
|
75
51
|
summary: result.summary,
|
|
76
|
-
// Stable keys for tooling: always present, `null` when absent
|
|
77
|
-
// (JSON.stringify would otherwise drop `undefined`).
|
|
78
52
|
remediation: result.remediation ?? null,
|
|
79
53
|
detail: result.detail ?? null,
|
|
80
54
|
})),
|
|
81
55
|
};
|
|
82
56
|
}
|
|
83
|
-
/** Machine-readable: stable key shape for tooling / future CI. */
|
|
84
57
|
export function renderJson(results) {
|
|
85
58
|
return JSON.stringify(jsonReport(results), null, 2);
|
|
86
59
|
}
|
|
87
|
-
// ============================================================================
|
|
88
|
-
// Check: credentials + TTL (creds)
|
|
89
|
-
// ============================================================================
|
|
90
|
-
/** Render a TTL in seconds as a compact human string ("47m", "1h 10m"). */
|
|
91
60
|
function fmtTtl(seconds) {
|
|
92
61
|
if (seconds <= 0)
|
|
93
62
|
return "expired";
|
|
94
|
-
// Round to whole minutes first, then split — so 11h59.5m carries to "12h"
|
|
95
|
-
// rather than rendering "11h 60m".
|
|
96
63
|
const totalMin = Math.round(seconds / 60);
|
|
97
64
|
const h = Math.floor(totalMin / 60);
|
|
98
65
|
const m = totalMin % 60;
|
|
@@ -100,11 +67,6 @@ function fmtTtl(seconds) {
|
|
|
100
67
|
return m > 0 ? `${h}h ${m}m` : `${h}h`;
|
|
101
68
|
return `${m}m`;
|
|
102
69
|
}
|
|
103
|
-
/**
|
|
104
|
-
* Pure mapper: a `CredProbe` → a `CheckResult` with the exact remediation.
|
|
105
|
-
* `headless` selects the device-flow `mesh login` variant (browser flow times
|
|
106
|
-
* out over SSH/tailscale — see the credential runbook).
|
|
107
|
-
*/
|
|
108
70
|
export function credProbeToResult(probe, context, headless) {
|
|
109
71
|
const loginCmd = `mesh login ${context}${headless ? " --device" : ""}`;
|
|
110
72
|
switch (probe.state) {
|
|
@@ -146,10 +108,6 @@ export const credsCheck = {
|
|
|
146
108
|
title: "Credentials",
|
|
147
109
|
phases: ["preflight", "ondemand"],
|
|
148
110
|
async run(ctx) {
|
|
149
|
-
// When creds were already resolved (launch preflight passes the method),
|
|
150
|
-
// trust that result — avoids a second AssumeRole call, and correctly
|
|
151
|
-
// reports the SSO/environment paths that `probeCredentials` (Zitadel-only)
|
|
152
|
-
// would otherwise misdiagnose.
|
|
153
111
|
switch (ctx.credMethod) {
|
|
154
112
|
case "sso":
|
|
155
113
|
return {
|
|
@@ -164,8 +122,6 @@ export const credsCheck = {
|
|
|
164
122
|
summary: "using Zitadel deployer credentials (credential_process auto-refresh)",
|
|
165
123
|
};
|
|
166
124
|
}
|
|
167
|
-
// credMethod null (on-demand doctor, or a failed launch resolution) or
|
|
168
|
-
// 'ambient': determine the real state by probing.
|
|
169
125
|
if (!ctx.platformContext || !ctx.deployerRole) {
|
|
170
126
|
return {
|
|
171
127
|
status: "warn",
|
|
@@ -177,24 +133,11 @@ export const credsCheck = {
|
|
|
177
133
|
return credProbeToResult(probe, ctx.platformContext, isRemoteEnvironment());
|
|
178
134
|
},
|
|
179
135
|
};
|
|
180
|
-
// ============================================================================
|
|
181
|
-
// Check: CodeArtifact registry token (registry) — MESH-2479
|
|
182
|
-
// ============================================================================
|
|
183
|
-
/**
|
|
184
|
-
* Verify the @mesh-tech CodeArtifact token actually works BEFORE long work —
|
|
185
|
-
* an expired token otherwise surfaces minutes later as npm's generic E401
|
|
186
|
-
* ("try npm login", which cannot fix a CodeArtifact registry). Warn-level:
|
|
187
|
-
* `mesh dev` itself runs installed code, so a stale token shouldn't block
|
|
188
|
-
* launch — it should name the fix.
|
|
189
|
-
*/
|
|
190
136
|
export const registryCheck = {
|
|
191
137
|
id: "registry",
|
|
192
138
|
title: "Registry auth",
|
|
193
139
|
phases: ["preflight", "ondemand"],
|
|
194
140
|
async run(ctx, phase) {
|
|
195
|
-
// The other preflight checks are fast — don't let an unreachable
|
|
196
|
-
// registry (offline / VPN off) hold the whole launch for the full
|
|
197
|
-
// on-demand bound. The zero-access local loop must stay snappy.
|
|
198
141
|
const probe = await probeRegistryToken(phase === "preflight" ? { timeoutMs: 3_000 } : undefined);
|
|
199
142
|
switch (probe.state) {
|
|
200
143
|
case "fresh":
|
|
@@ -226,13 +169,6 @@ export const registryCheck = {
|
|
|
226
169
|
}
|
|
227
170
|
},
|
|
228
171
|
};
|
|
229
|
-
// ============================================================================
|
|
230
|
-
// Checks: tmux, ports, worktree
|
|
231
|
-
// ============================================================================
|
|
232
|
-
/**
|
|
233
|
-
* Parse `lsof -ti :PORT` + `ps -o comm= -p PID` output into the squatting
|
|
234
|
-
* process. `lsof` may list several PIDs (one per line); we name the first.
|
|
235
|
-
*/
|
|
236
172
|
export function parsePortSquatter(lsofOut, psOut) {
|
|
237
173
|
const firstLine = lsofOut.trim().split("\n")[0]?.trim();
|
|
238
174
|
const pid = Number(firstLine);
|
|
@@ -241,32 +177,16 @@ export function parsePortSquatter(lsofOut, psOut) {
|
|
|
241
177
|
const command = psOut.trim().split("\n")[0]?.trim() || "unknown";
|
|
242
178
|
return { pid, command };
|
|
243
179
|
}
|
|
244
|
-
/** True when `serviceSrc` lives under (or equals) `repoRoot`. */
|
|
245
180
|
export function sharesWorktreeRoot(serviceSrc, repoRoot) {
|
|
246
181
|
const src = path.resolve(serviceSrc);
|
|
247
182
|
const root = path.resolve(repoRoot);
|
|
248
183
|
return src === root || src.startsWith(root + path.sep);
|
|
249
184
|
}
|
|
250
|
-
/**
|
|
251
|
-
* Pure classification for the on-demand ports check. Given the PID currently
|
|
252
|
-
* listening on a service port (`null` when nothing is) and the set of PIDs in
|
|
253
|
-
* the live session's tmux process tree:
|
|
254
|
-
* - `null` listener → `dead` (the service isn't running)
|
|
255
|
-
* - listener in the session → `owned` (healthy — the session's own svc)
|
|
256
|
-
* - listener outside it → `foreign` (a real squatter)
|
|
257
|
-
* Mid-session the session's services are *supposed* to hold their ports, so a
|
|
258
|
-
* naive "occupied ⇒ squatted" test misreports a healthy session (MESH-2015).
|
|
259
|
-
*/
|
|
260
185
|
export function classifyPortListener(listenerPid, sessionPids) {
|
|
261
186
|
if (listenerPid === null)
|
|
262
187
|
return "dead";
|
|
263
188
|
return sessionPids.has(listenerPid) ? "owned" : "foreign";
|
|
264
189
|
}
|
|
265
|
-
/**
|
|
266
|
-
* Pure: expand tmux pane PIDs to the full set of PIDs in their process
|
|
267
|
-
* subtrees, using the output of `ps -eo pid=,ppid=` (each line "PID PPID").
|
|
268
|
-
* The roots themselves are included; unparseable lines are skipped.
|
|
269
|
-
*/
|
|
270
190
|
export function collectSessionPids(panePids, psOut) {
|
|
271
191
|
const children = new Map();
|
|
272
192
|
for (const line of psOut.trim().split("\n")) {
|
|
@@ -291,7 +211,6 @@ export function collectSessionPids(panePids, psOut) {
|
|
|
291
211
|
}
|
|
292
212
|
return result;
|
|
293
213
|
}
|
|
294
|
-
/** Identify the process squatting a port; null if it can't be determined. */
|
|
295
214
|
function whoHasPort(port) {
|
|
296
215
|
try {
|
|
297
216
|
const lsof = execFileSync("lsof", ["-ti", `:${port}`], {
|
|
@@ -309,7 +228,6 @@ function whoHasPort(port) {
|
|
|
309
228
|
});
|
|
310
229
|
}
|
|
311
230
|
catch {
|
|
312
|
-
/* ps failed — parsePortSquatter falls back to "unknown" */
|
|
313
231
|
}
|
|
314
232
|
return parsePortSquatter(lsof, ps);
|
|
315
233
|
}
|
|
@@ -317,13 +235,6 @@ function whoHasPort(port) {
|
|
|
317
235
|
return null;
|
|
318
236
|
}
|
|
319
237
|
}
|
|
320
|
-
/**
|
|
321
|
-
* Gather every PID in the live session's tmux process trees (pane PIDs plus
|
|
322
|
-
* their descendants). Used to tell the session's own service processes apart
|
|
323
|
-
* from foreign squatters. Returns an empty set when tmux/ps are unavailable or
|
|
324
|
-
* the session has no panes — the caller then treats occupied ports as
|
|
325
|
-
* unidentified rather than owned.
|
|
326
|
-
*/
|
|
327
238
|
function sessionProcessTree(sessionName) {
|
|
328
239
|
let panePids;
|
|
329
240
|
try {
|
|
@@ -347,7 +258,6 @@ function sessionProcessTree(sessionName) {
|
|
|
347
258
|
});
|
|
348
259
|
}
|
|
349
260
|
catch {
|
|
350
|
-
// No process table — the pane PIDs themselves are still session-owned.
|
|
351
261
|
return new Set(panePids);
|
|
352
262
|
}
|
|
353
263
|
return collectSessionPids(panePids, psOut);
|
|
@@ -377,19 +287,15 @@ export const portsCheck = {
|
|
|
377
287
|
async run(ctx) {
|
|
378
288
|
const services = ctx.sessionState?.devOutput.services;
|
|
379
289
|
if (!services || Object.keys(services).length === 0) {
|
|
380
|
-
// Preflight (no session): ports are validated at allocation/launch time.
|
|
381
290
|
return {
|
|
382
291
|
status: "ok",
|
|
383
292
|
summary: "no session — ports are checked at allocation time",
|
|
384
293
|
};
|
|
385
294
|
}
|
|
386
|
-
// Mid-session the session's OWN services should be listening on their
|
|
387
|
-
// allocated ports. Classify each port against the session's process tree so
|
|
388
|
-
// healthy self-owned ports don't read as squatters (MESH-2015).
|
|
389
295
|
const sessionPids = sessionProcessTree(ctx.sessionName);
|
|
390
|
-
const foreign = [];
|
|
391
|
-
const dead = [];
|
|
392
|
-
const unknown = [];
|
|
296
|
+
const foreign = [];
|
|
297
|
+
const dead = [];
|
|
298
|
+
const unknown = [];
|
|
393
299
|
for (const [name, svc] of Object.entries(services)) {
|
|
394
300
|
const free = await isPortFree(svc.port);
|
|
395
301
|
const who = free ? null : whoHasPort(svc.port);
|
|
@@ -400,9 +306,6 @@ export const portsCheck = {
|
|
|
400
306
|
foreign.push(`${name} :${svc.port} held by ${who.command} (pid ${who.pid})`);
|
|
401
307
|
continue;
|
|
402
308
|
}
|
|
403
|
-
// `dead` from the helper (null listener pid): either the port is
|
|
404
|
-
// genuinely free (service down) or it's occupied but the owner couldn't
|
|
405
|
-
// be resolved via lsof.
|
|
406
309
|
if (free) {
|
|
407
310
|
dead.push(`${name} :${svc.port} not listening`);
|
|
408
311
|
}
|
|
@@ -430,8 +333,6 @@ export const portsCheck = {
|
|
|
430
333
|
? "restart the stopped service: `mesh dev restart <svc>`"
|
|
431
334
|
: "identify the port owner (`lsof -i :<port>`), then `mesh dev restart <svc>`";
|
|
432
335
|
return {
|
|
433
|
-
// A real squatter or a down service is actionable → error; an
|
|
434
|
-
// unidentifiable occupant alone is only a warning.
|
|
435
336
|
status: foreign.length > 0 || dead.length > 0 ? "error" : "warn",
|
|
436
337
|
summary: `service ports: ${parts.join(", ")}`,
|
|
437
338
|
detail: [...foreign, ...dead, ...unknown].join("; "),
|
|
@@ -439,16 +340,10 @@ export const portsCheck = {
|
|
|
439
340
|
};
|
|
440
341
|
},
|
|
441
342
|
};
|
|
442
|
-
// ============================================================================
|
|
443
|
-
// Check: config staleness (config-staleness)
|
|
444
|
-
// ============================================================================
|
|
445
|
-
/** True when the stack config file changed after the session was launched. */
|
|
446
343
|
export function isConfigStale(configMtimeMs, startedAtIso) {
|
|
447
344
|
return configMtimeMs > Date.parse(startedAtIso);
|
|
448
345
|
}
|
|
449
346
|
export const configStalenessCheck = {
|
|
450
|
-
// Preflight runs *at* launch, so nothing can be stale-relative-to-launch yet
|
|
451
|
-
// — this only makes sense mid-session.
|
|
452
347
|
id: "config-staleness",
|
|
453
348
|
title: "Config freshness",
|
|
454
349
|
phases: ["ondemand"],
|
|
@@ -499,9 +394,6 @@ export const worktreeCheck = {
|
|
|
499
394
|
summary: "could not resolve git worktree root for the app",
|
|
500
395
|
};
|
|
501
396
|
}
|
|
502
|
-
// A dev-LINKED package is outside the worktree by construction and is what
|
|
503
|
-
// the app runs either way — the same exemption `mesh dev` itself applies, so
|
|
504
|
-
// the doctor does not warn about something the launcher deliberately allows.
|
|
505
397
|
const foreign = Object.entries(services)
|
|
506
398
|
.filter(([, svc]) => svc.src &&
|
|
507
399
|
!sharesWorktreeRoot(svc.src, repoRoot) &&
|
|
@@ -521,10 +413,6 @@ export const worktreeCheck = {
|
|
|
521
413
|
};
|
|
522
414
|
},
|
|
523
415
|
};
|
|
524
|
-
// ============================================================================
|
|
525
|
-
// Checks: tunnels + temporal (connectivity)
|
|
526
|
-
// ============================================================================
|
|
527
|
-
/** Resolve `true` iff a TCP connection to host:port succeeds within `timeoutMs`. */
|
|
528
416
|
export function canConnect(host, port, timeoutMs = 800) {
|
|
529
417
|
return new Promise((resolve) => {
|
|
530
418
|
const socket = new net.Socket();
|
|
@@ -547,8 +435,6 @@ function isLocalHost(host) {
|
|
|
547
435
|
return host === "localhost" || host === "127.0.0.1" || host === "::1";
|
|
548
436
|
}
|
|
549
437
|
export const tunnelsCheck = {
|
|
550
|
-
// On-demand only: pre-launch the tunnels don't exist yet, and dialing the
|
|
551
|
-
// VPC endpoints they'll use would false-positive on an SSM-only machine.
|
|
552
438
|
id: "tunnels",
|
|
553
439
|
title: "Tunnels",
|
|
554
440
|
phases: ["ondemand"],
|
|
@@ -557,9 +443,6 @@ export const tunnelsCheck = {
|
|
|
557
443
|
if (!tunnels || Object.keys(tunnels).length === 0) {
|
|
558
444
|
return { status: "ok", summary: "no tunnels in this session" };
|
|
559
445
|
}
|
|
560
|
-
// Only dial the SSM-forwarded (localhost) tunnels — those are the ones that
|
|
561
|
-
// die with "broken pipe → ECONNREFUSED". VPC-direct tunnels are reachable
|
|
562
|
-
// only over VPN and would false-positive here.
|
|
563
446
|
const local = Object.entries(tunnels).filter(([, t]) => isLocalHost(t.host));
|
|
564
447
|
if (local.length === 0) {
|
|
565
448
|
return {
|
|
@@ -584,7 +467,6 @@ export const tunnelsCheck = {
|
|
|
584
467
|
},
|
|
585
468
|
};
|
|
586
469
|
export const temporalCheck = {
|
|
587
|
-
// On-demand only: reachability depends on the session's tunnel being up.
|
|
588
470
|
id: "temporal",
|
|
589
471
|
title: "Temporal",
|
|
590
472
|
phases: ["ondemand"],
|
|
@@ -624,7 +506,6 @@ export const temporalCheck = {
|
|
|
624
506
|
}
|
|
625
507
|
catch (err) {
|
|
626
508
|
const code = err.code;
|
|
627
|
-
// gRPC status: 5 NOT_FOUND, 7 PERMISSION_DENIED, 16 UNAUTHENTICATED.
|
|
628
509
|
if (code === 5) {
|
|
629
510
|
return {
|
|
630
511
|
status: "error",
|
|
@@ -646,10 +527,6 @@ export const temporalCheck = {
|
|
|
646
527
|
}
|
|
647
528
|
},
|
|
648
529
|
};
|
|
649
|
-
// ============================================================================
|
|
650
|
-
// Registry + runner
|
|
651
|
-
// ============================================================================
|
|
652
|
-
/** All checks, in display order. */
|
|
653
530
|
export const ALL_CHECKS = [
|
|
654
531
|
tmuxCheck,
|
|
655
532
|
credsCheck,
|
|
@@ -660,11 +537,6 @@ export const ALL_CHECKS = [
|
|
|
660
537
|
tunnelsCheck,
|
|
661
538
|
temporalCheck,
|
|
662
539
|
];
|
|
663
|
-
/**
|
|
664
|
-
* Run the full on-demand doctor against a prebuilt context, print the report,
|
|
665
|
-
* and return the aggregate status. The caller (the `mesh dev doctor`
|
|
666
|
-
* subcommand) owns process exit.
|
|
667
|
-
*/
|
|
668
540
|
export async function runDoctor(ctx, opts) {
|
|
669
541
|
const results = await runChecks(ctx, "ondemand", ALL_CHECKS);
|
|
670
542
|
const status = aggregateStatus(results.map((r) => r.result));
|
|
@@ -677,4 +549,3 @@ export async function runDoctor(ctx, opts) {
|
|
|
677
549
|
}
|
|
678
550
|
return status;
|
|
679
551
|
}
|
|
680
|
-
//# sourceMappingURL=dev-doctor.js.map
|
|
@@ -1,59 +1,7 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Helpers for launching `mesh dev` services via per-session env files.
|
|
3
|
-
*
|
|
4
|
-
* Background: `mesh dev` used to inline every env var into a single giant
|
|
5
|
-
* `env K1=V1 K2=V2 … <command>` string passed to `tmux send-keys`. With large
|
|
6
|
-
* values (system prompts, encoding keys, OAuth creds) tmux intermittently
|
|
7
|
-
* truncated the string — the service never started — and `mesh dev restart`
|
|
8
|
-
* re-derived the env from scratch, drifting from what the service was
|
|
9
|
-
* originally launched with (e.g. a different TEMPORAL_ENCODING_KEY).
|
|
10
|
-
*
|
|
11
|
-
* Instead, the full env is written once at launch to a 0600 file under the
|
|
12
|
-
* session state dir, and the send-keys command is just:
|
|
13
|
-
*
|
|
14
|
-
* cd '<dir>' && source '<envfile>' && <command>
|
|
15
|
-
*
|
|
16
|
-
* Restart sources the SAME file, guaranteeing a byte-identical environment.
|
|
17
|
-
*/
|
|
18
|
-
/** Env files contain secrets — owner read/write only. */
|
|
19
1
|
export declare const ENV_FILE_MODE = 384;
|
|
20
|
-
/**
|
|
21
|
-
* Single-quote a value for POSIX shells (bash/zsh), escaping embedded
|
|
22
|
-
* single quotes via the standard `'\''` dance. Safe for newlines, spaces,
|
|
23
|
-
* `$`, backticks, etc.
|
|
24
|
-
*/
|
|
25
2
|
export declare function quoteShellValue(value: string): string;
|
|
26
|
-
/**
|
|
27
|
-
* Render a sourceable env file: one `export K='V'` per line.
|
|
28
|
-
* Throws on env var names that aren't valid shell identifiers.
|
|
29
|
-
*/
|
|
30
3
|
export declare function renderEnvFile(env: Record<string, string>): string;
|
|
31
|
-
/** Filesystem-safe env file name for a service. */
|
|
32
4
|
export declare function envFileName(serviceName: string): string;
|
|
33
|
-
/**
|
|
34
|
-
* Write the env file (creating parent dirs) with mode 0600.
|
|
35
|
-
* chmod is applied explicitly so a pre-existing file is tightened too.
|
|
36
|
-
*/
|
|
37
5
|
export declare function writeEnvFile(filePath: string, env: Record<string, string>): void;
|
|
38
|
-
/**
|
|
39
|
-
* Build the short, untruncatable command sent to tmux:
|
|
40
|
-
* cd '<dir>' && source '<envfile>' && <command>
|
|
41
|
-
*
|
|
42
|
-
* `command` is the service's dev command (already shell syntax) and is
|
|
43
|
-
* passed through verbatim.
|
|
44
|
-
*
|
|
45
|
-
* With `logShipper` (mesh dev --local: the path of assets/log-shipper.mjs),
|
|
46
|
-
* the service's combined stdout/stderr is piped through the shipper: raw
|
|
47
|
-
* bytes go to the pane (its stderr), ANSI-stripped lines ship to the local
|
|
48
|
-
* platform's OTel collector via OTLP — the same ingestion path instrumented
|
|
49
|
-
* apps use, carrying the OTEL_* resource attributes from the env file. Logs
|
|
50
|
-
* never cross the macOS Docker file mount (whose stale attribute caching
|
|
51
|
-
* hides appends from in-container tailers).
|
|
52
|
-
*/
|
|
53
6
|
export declare function buildLaunchCommand(envFilePath: string, dir: string, command: string, logShipper?: string): string;
|
|
54
|
-
/**
|
|
55
|
-
* Poll until a TCP port accepts connections, or the timeout elapses.
|
|
56
|
-
* Returns true when the port accepted, false on timeout.
|
|
57
|
-
*/
|
|
58
7
|
export declare function waitForPort(host: string, port: number, timeoutMs: number, intervalMs?: number): Promise<boolean>;
|
|
59
|
-
//# sourceMappingURL=dev-launch.d.ts.map
|
|
@@ -1,39 +1,11 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Helpers for launching `mesh dev` services via per-session env files.
|
|
3
|
-
*
|
|
4
|
-
* Background: `mesh dev` used to inline every env var into a single giant
|
|
5
|
-
* `env K1=V1 K2=V2 … <command>` string passed to `tmux send-keys`. With large
|
|
6
|
-
* values (system prompts, encoding keys, OAuth creds) tmux intermittently
|
|
7
|
-
* truncated the string — the service never started — and `mesh dev restart`
|
|
8
|
-
* re-derived the env from scratch, drifting from what the service was
|
|
9
|
-
* originally launched with (e.g. a different TEMPORAL_ENCODING_KEY).
|
|
10
|
-
*
|
|
11
|
-
* Instead, the full env is written once at launch to a 0600 file under the
|
|
12
|
-
* session state dir, and the send-keys command is just:
|
|
13
|
-
*
|
|
14
|
-
* cd '<dir>' && source '<envfile>' && <command>
|
|
15
|
-
*
|
|
16
|
-
* Restart sources the SAME file, guaranteeing a byte-identical environment.
|
|
17
|
-
*/
|
|
18
1
|
import * as fs from 'fs';
|
|
19
2
|
import * as net from 'net';
|
|
20
3
|
import * as path from 'path';
|
|
21
|
-
/** Env files contain secrets — owner read/write only. */
|
|
22
4
|
export const ENV_FILE_MODE = 0o600;
|
|
23
|
-
/** Valid POSIX env var name. Anything else is rejected to avoid shell injection. */
|
|
24
5
|
const ENV_KEY_RE = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
25
|
-
/**
|
|
26
|
-
* Single-quote a value for POSIX shells (bash/zsh), escaping embedded
|
|
27
|
-
* single quotes via the standard `'\''` dance. Safe for newlines, spaces,
|
|
28
|
-
* `$`, backticks, etc.
|
|
29
|
-
*/
|
|
30
6
|
export function quoteShellValue(value) {
|
|
31
7
|
return `'${value.replace(/'/g, "'\\''")}'`;
|
|
32
8
|
}
|
|
33
|
-
/**
|
|
34
|
-
* Render a sourceable env file: one `export K='V'` per line.
|
|
35
|
-
* Throws on env var names that aren't valid shell identifiers.
|
|
36
|
-
*/
|
|
37
9
|
export function renderEnvFile(env) {
|
|
38
10
|
const lines = [
|
|
39
11
|
'# Auto-generated by mesh dev — do not edit.',
|
|
@@ -48,49 +20,22 @@ export function renderEnvFile(env) {
|
|
|
48
20
|
}
|
|
49
21
|
return lines.join('\n') + '\n';
|
|
50
22
|
}
|
|
51
|
-
/** Filesystem-safe env file name for a service. */
|
|
52
23
|
export function envFileName(serviceName) {
|
|
53
24
|
return `${serviceName.replace(/[^A-Za-z0-9._-]/g, '-')}.env.sh`;
|
|
54
25
|
}
|
|
55
|
-
/**
|
|
56
|
-
* Write the env file (creating parent dirs) with mode 0600.
|
|
57
|
-
* chmod is applied explicitly so a pre-existing file is tightened too.
|
|
58
|
-
*/
|
|
59
26
|
export function writeEnvFile(filePath, env) {
|
|
60
27
|
fs.mkdirSync(path.dirname(filePath), { recursive: true });
|
|
61
28
|
fs.writeFileSync(filePath, renderEnvFile(env), { mode: ENV_FILE_MODE });
|
|
62
29
|
fs.chmodSync(filePath, ENV_FILE_MODE);
|
|
63
30
|
}
|
|
64
|
-
/**
|
|
65
|
-
* Build the short, untruncatable command sent to tmux:
|
|
66
|
-
* cd '<dir>' && source '<envfile>' && <command>
|
|
67
|
-
*
|
|
68
|
-
* `command` is the service's dev command (already shell syntax) and is
|
|
69
|
-
* passed through verbatim.
|
|
70
|
-
*
|
|
71
|
-
* With `logShipper` (mesh dev --local: the path of assets/log-shipper.mjs),
|
|
72
|
-
* the service's combined stdout/stderr is piped through the shipper: raw
|
|
73
|
-
* bytes go to the pane (its stderr), ANSI-stripped lines ship to the local
|
|
74
|
-
* platform's OTel collector via OTLP — the same ingestion path instrumented
|
|
75
|
-
* apps use, carrying the OTEL_* resource attributes from the env file. Logs
|
|
76
|
-
* never cross the macOS Docker file mount (whose stale attribute caching
|
|
77
|
-
* hides appends from in-container tailers).
|
|
78
|
-
*/
|
|
79
31
|
export function buildLaunchCommand(envFilePath, dir, command, logShipper) {
|
|
80
32
|
const base = `cd ${quoteShellValue(dir)} && source ${quoteShellValue(envFilePath)} && `;
|
|
81
33
|
if (!logShipper)
|
|
82
34
|
return `${base}${command}`;
|
|
83
|
-
// NODE_OPTIONS= : the shipper must not inherit the service's OTel
|
|
84
|
-
// auto-instrumentation — its own OTLP POSTs would show up as traces.
|
|
85
35
|
return `${base}{ ${command}; } 2>&1 | NODE_OPTIONS= node ${quoteShellValue(logShipper)}`;
|
|
86
36
|
}
|
|
87
|
-
/**
|
|
88
|
-
* Poll until a TCP port accepts connections, or the timeout elapses.
|
|
89
|
-
* Returns true when the port accepted, false on timeout.
|
|
90
|
-
*/
|
|
91
37
|
export async function waitForPort(host, port, timeoutMs, intervalMs = 500) {
|
|
92
38
|
const deadline = Date.now() + timeoutMs;
|
|
93
|
-
// Always attempt at least once, even with a zero/negative timeout.
|
|
94
39
|
for (;;) {
|
|
95
40
|
const remaining = deadline - Date.now();
|
|
96
41
|
const attemptTimeout = Math.max(250, Math.min(1000, remaining));
|
|
@@ -115,4 +60,3 @@ function tryConnect(host, port, timeoutMs) {
|
|
|
115
60
|
socket.once('error', () => done(false));
|
|
116
61
|
});
|
|
117
62
|
}
|
|
118
|
-
//# sourceMappingURL=dev-launch.js.map
|
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `mesh dev __token-server <port> <context>` — the producer side of the
|
|
3
|
-
* self-refreshing dev-user token seam (MESH-2039).
|
|
4
|
-
*
|
|
5
|
-
* `mesh dev` launches this in its own tmux window. On each GET it mints a
|
|
6
|
-
* currently-valid dev-user token (via the existing `getValidToken` refresh
|
|
7
|
-
* path, which silently re-mints from the refresh token and rewrites the shared
|
|
8
|
-
* cache) and returns it on loopback. Consumers poll it (agent-app-kit's
|
|
9
|
-
* dev-user-token provider) so local apps survive past the ~1h Zitadel horizon
|
|
10
|
-
* without a `mesh dev` restart. Bound to 127.0.0.1 only; dev-only.
|
|
11
|
-
*/
|
|
12
1
|
export interface TokenServerDeps {
|
|
13
2
|
getValidToken: (context: string) => Promise<string | null>;
|
|
14
3
|
readCredentials: (context: string) => {
|
|
@@ -18,15 +7,8 @@ export interface TokenServerDeps {
|
|
|
18
7
|
} | null;
|
|
19
8
|
decodeJwtPayload: (jwt: string) => Record<string, unknown>;
|
|
20
9
|
}
|
|
21
|
-
/**
|
|
22
|
-
* Pure request handler. 200 with the fresh token pair on success; 503 when the
|
|
23
|
-
* token can't be minted (refresh token lapsed — the MESH-2035 boundary), which
|
|
24
|
-
* consumers treat as "keep last good / fall back to the static env snapshot".
|
|
25
|
-
*/
|
|
26
10
|
export declare function handleTokenRequest(context: string, deps: TokenServerDeps): Promise<{
|
|
27
11
|
status: number;
|
|
28
12
|
body: unknown;
|
|
29
13
|
}>;
|
|
30
|
-
/** Start the loopback token server. Never resolves (runs until the window dies). */
|
|
31
14
|
export declare function startTokenServer(port: number, context: string): Promise<void>;
|
|
32
|
-
//# sourceMappingURL=dev-token-server.d.ts.map
|
|
@@ -1,22 +1,6 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `mesh dev __token-server <port> <context>` — the producer side of the
|
|
3
|
-
* self-refreshing dev-user token seam (MESH-2039).
|
|
4
|
-
*
|
|
5
|
-
* `mesh dev` launches this in its own tmux window. On each GET it mints a
|
|
6
|
-
* currently-valid dev-user token (via the existing `getValidToken` refresh
|
|
7
|
-
* path, which silently re-mints from the refresh token and rewrites the shared
|
|
8
|
-
* cache) and returns it on loopback. Consumers poll it (agent-app-kit's
|
|
9
|
-
* dev-user-token provider) so local apps survive past the ~1h Zitadel horizon
|
|
10
|
-
* without a `mesh dev` restart. Bound to 127.0.0.1 only; dev-only.
|
|
11
|
-
*/
|
|
12
1
|
import * as http from "node:http";
|
|
13
2
|
import { getValidToken, readCredentials, decodeJwtPayload } from "./login.js";
|
|
14
3
|
import { logInfo, logWarn } from "../utils/log.js";
|
|
15
|
-
/**
|
|
16
|
-
* Pure request handler. 200 with the fresh token pair on success; 503 when the
|
|
17
|
-
* token can't be minted (refresh token lapsed — the MESH-2035 boundary), which
|
|
18
|
-
* consumers treat as "keep last good / fall back to the static env snapshot".
|
|
19
|
-
*/
|
|
20
4
|
export async function handleTokenRequest(context, deps) {
|
|
21
5
|
const idToken = await deps.getValidToken(context);
|
|
22
6
|
const creds = idToken ? deps.readCredentials(context) : null;
|
|
@@ -34,13 +18,7 @@ export async function handleTokenRequest(context, deps) {
|
|
|
34
18
|
},
|
|
35
19
|
};
|
|
36
20
|
}
|
|
37
|
-
/**
|
|
38
|
-
* Refresh the served token this far before it actually expires, so a consumer
|
|
39
|
-
* polling on its own cadence (~60s) always fetches a token that outlives its
|
|
40
|
-
* next poll — closing the ~once-per-hour self-healing 401 window.
|
|
41
|
-
*/
|
|
42
21
|
const REFRESH_MARGIN_MS = 120_000;
|
|
43
|
-
/** Start the loopback token server. Never resolves (runs until the window dies). */
|
|
44
22
|
export async function startTokenServer(port, context) {
|
|
45
23
|
const deps = {
|
|
46
24
|
getValidToken: (c) => getValidToken(c, { marginMs: REFRESH_MARGIN_MS }),
|
|
@@ -63,6 +41,5 @@ export async function startTokenServer(port, context) {
|
|
|
63
41
|
server.on("error", (e) => logWarn(`token-server error: ${e.message}`));
|
|
64
42
|
await new Promise((resolve) => server.listen(port, "127.0.0.1", resolve));
|
|
65
43
|
logInfo(`dev-user token-server on http://127.0.0.1:${port} (context ${context})`);
|
|
66
|
-
await new Promise(() => { });
|
|
44
|
+
await new Promise(() => { });
|
|
67
45
|
}
|
|
68
|
-
//# sourceMappingURL=dev-token-server.js.map
|