@mesh-tech/mesh-cli 0.20.2 → 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/dist/bin/mesh.d.ts +0 -12
- package/dist/bin/mesh.js +12 -12
- package/dist/bin/mesh.js.map +0 -1
- 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 +0 -98
- package/dist/src/commands/create-app.js +1 -163
- 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 +0 -128
- package/dist/src/commands/init/wizard.js +0 -109
- 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 +9 -10
- 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
package/dist/build-info.json
CHANGED
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared agent-api client: resolves a `--target`/`--api-url`/`--context`
|
|
3
|
-
* triple (via the `@mesh-tech/agent-targets` registry) to a concrete
|
|
4
|
-
* `AgentApiTarget`, and fetches agent-api paths against it with auth.
|
|
5
|
-
*
|
|
6
|
-
* Consumed by `mesh artifacts get` today; later `mesh conversations`
|
|
7
|
-
* commands share the same resolution + fetch path.
|
|
8
|
-
*/
|
|
9
1
|
export interface AgentApiTarget {
|
|
10
2
|
apiBaseUrl: string;
|
|
11
3
|
loginContext?: string;
|
|
@@ -15,82 +7,20 @@ export interface AgentApiTarget {
|
|
|
15
7
|
}
|
|
16
8
|
export declare class TargetResolutionError extends Error {
|
|
17
9
|
}
|
|
18
|
-
/**
|
|
19
|
-
* Precedence:
|
|
20
|
-
* 1. --api-url (+ --context, default "mesh.dev") — highest.
|
|
21
|
-
* 2. --target explicitly given → registry: loaded+found wins, loaded+missing
|
|
22
|
-
* throws (unknown target), invalid throws (with the registry's parse
|
|
23
|
-
* error), absent throws ("no registry" guidance).
|
|
24
|
-
* 3. neither given → loaded registry's defaultTarget; otherwise (registry
|
|
25
|
-
* absent/invalid) falls back to AGENT_API_URL/API_URL/localhost:8787 —
|
|
26
|
-
* this path NEVER throws (backward compat with the old no-flag behavior).
|
|
27
|
-
*/
|
|
28
10
|
export declare function resolveTarget(opts: {
|
|
29
11
|
target?: string;
|
|
30
12
|
apiUrl?: string;
|
|
31
13
|
context?: string;
|
|
32
14
|
}): AgentApiTarget;
|
|
33
|
-
/**
|
|
34
|
-
* Fetch an agent-api path on the resolved target, with auth. Caller checks
|
|
35
|
-
* status.
|
|
36
|
-
*
|
|
37
|
-
* `redirect: "manual"` is deliberate: an unauthenticated `/v1` call against a
|
|
38
|
-
* deployed agent 302s to Zitadel. With the default `redirect: "follow"`,
|
|
39
|
-
* fetch follows it and returns a `200` HTML login page — `describeHttpError`'s
|
|
40
|
-
* auth branch never fires and the caller sees a raw JSON-parse error instead
|
|
41
|
-
* of auth guidance. With `"manual"`, the redirect surfaces as a Response with
|
|
42
|
-
* `type: "opaqueredirect"` (status 0), which `describeHttpError` already maps
|
|
43
|
-
* to the "auth did not reach the agent" message.
|
|
44
|
-
*/
|
|
45
15
|
export declare function agentApiFetch(target: AgentApiTarget, apiPath: string): Promise<Response>;
|
|
46
16
|
export interface AgentApiSendInit {
|
|
47
17
|
method: "POST" | "PUT" | "PATCH" | "DELETE";
|
|
48
|
-
/** JSON body — sets `content-type: application/json`. Mutually exclusive with `body`. */
|
|
49
18
|
json?: unknown;
|
|
50
|
-
/** Raw body, for uploads that are not JSON. */
|
|
51
19
|
body?: Uint8Array | string;
|
|
52
20
|
contentType?: string;
|
|
53
21
|
}
|
|
54
|
-
/**
|
|
55
|
-
* Like {@link agentApiFetch}, but with a method and a body — the write half.
|
|
56
|
-
*
|
|
57
|
-
* Shares `authHeaders` and `redirect: "manual"` with the read path for the same
|
|
58
|
-
* reasons documented there; the redirect handling matters MORE here, because a
|
|
59
|
-
* write that silently followed a 302 to Zitadel would report the login page's
|
|
60
|
-
* 200 as a successful publish.
|
|
61
|
-
*/
|
|
62
22
|
export declare function agentApiSend(target: AgentApiTarget, apiPath: string, init: AgentApiSendInit): Promise<Response>;
|
|
63
|
-
/**
|
|
64
|
-
* Turn a thrown fetch error into local-vs-remote-aware guidance. A bare
|
|
65
|
-
* `ECONNREFUSED`/`fetch failed` (also `ENOTFOUND`/`EAI_AGAIN`) means
|
|
66
|
-
* something different depending on the target: against a LOCAL apiBaseUrl it
|
|
67
|
-
* almost always means the local `mesh dev` agent API isn't running; against
|
|
68
|
-
* a REMOTE one it means a down host, a DNS typo, a dropped VPN/tailscale
|
|
69
|
-
* connection, or (occasionally) an auth redirect that the fetch layer
|
|
70
|
-
* couldn't follow. Only actual network throws get this treatment — every
|
|
71
|
-
* other error (including ones `describeHttpError` already produced) passes
|
|
72
|
-
* through unchanged so callers can log it without double guidance.
|
|
73
|
-
*/
|
|
74
23
|
export declare function describeNetworkError(err: unknown, target: AgentApiTarget): string;
|
|
75
|
-
/**
|
|
76
|
-
* Shared, target-aware renderer for a non-ok agent-api response. Used by
|
|
77
|
-
* both `mesh conversations` (list/show/artifacts) and `mesh artifacts get`
|
|
78
|
-
* so there is exactly one place that turns an HTTP failure into human
|
|
79
|
-
* guidance — no more dev-oriented "restart the API process" advice, no more
|
|
80
|
-
* a second parallel renderer for `show`'s 503 special-case.
|
|
81
|
-
*
|
|
82
|
-
* `ctx.id` (a conversation id, when the caller has one) enables the
|
|
83
|
-
* `mesh temporal recover-conversation <id>` hint on a `conversation_unavailable`
|
|
84
|
-
* 503 and is echoed in the 404 message for context.
|
|
85
|
-
*
|
|
86
|
-
* Response shapes are verified against
|
|
87
|
-
* `packages/agent-sdk/src/agent-api/server.ts` — do not re-infer:
|
|
88
|
-
* - 404 → `{ error: "conversation not found", conversationId }`.
|
|
89
|
-
* - 503 conversation_unavailable → `{ error: "conversation_unavailable",
|
|
90
|
-
* conversationId, detail: "<text>" }` — human text is under `detail`,
|
|
91
|
-
* NOT `message`.
|
|
92
|
-
*/
|
|
93
24
|
export declare function describeHttpError(res: Response, target: AgentApiTarget, ctx?: {
|
|
94
25
|
id?: string;
|
|
95
26
|
}): Promise<string>;
|
|
96
|
-
//# sourceMappingURL=agent-api-client.d.ts.map
|
|
@@ -1,31 +1,11 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared agent-api client: resolves a `--target`/`--api-url`/`--context`
|
|
3
|
-
* triple (via the `@mesh-tech/agent-targets` registry) to a concrete
|
|
4
|
-
* `AgentApiTarget`, and fetches agent-api paths against it with auth.
|
|
5
|
-
*
|
|
6
|
-
* Consumed by `mesh artifacts get` today; later `mesh conversations`
|
|
7
|
-
* commands share the same resolution + fetch path.
|
|
8
|
-
*/
|
|
9
1
|
import { loadTargetsFile, stripSlash } from "@mesh-tech/agent-targets";
|
|
10
2
|
import { getValidToken } from "./login.js";
|
|
11
3
|
import { logWarn } from "../utils/log.js";
|
|
12
4
|
const DEFAULT_AUTH_CONTEXT = "mesh.dev";
|
|
13
|
-
/** Matches a local (`mesh dev`-hosted) apiBaseUrl — shared by `authHeaders`'s
|
|
14
|
-
* dev-identity fallback and `describeNetworkError`'s local/remote gating. */
|
|
15
5
|
const LOCAL_URL_RE = /^https?:\/\/(localhost|127\.0\.0\.1|\[::1\])(:|\/|$)/i;
|
|
16
6
|
export class TargetResolutionError extends Error {
|
|
17
7
|
}
|
|
18
8
|
const NO_REGISTRY_GUIDANCE = "no registry — add `mesh agent-targets add <name>` or pass --api-url";
|
|
19
|
-
/**
|
|
20
|
-
* Precedence:
|
|
21
|
-
* 1. --api-url (+ --context, default "mesh.dev") — highest.
|
|
22
|
-
* 2. --target explicitly given → registry: loaded+found wins, loaded+missing
|
|
23
|
-
* throws (unknown target), invalid throws (with the registry's parse
|
|
24
|
-
* error), absent throws ("no registry" guidance).
|
|
25
|
-
* 3. neither given → loaded registry's defaultTarget; otherwise (registry
|
|
26
|
-
* absent/invalid) falls back to AGENT_API_URL/API_URL/localhost:8787 —
|
|
27
|
-
* this path NEVER throws (backward compat with the old no-flag behavior).
|
|
28
|
-
*/
|
|
29
9
|
export function resolveTarget(opts) {
|
|
30
10
|
if (opts.apiUrl) {
|
|
31
11
|
return { apiBaseUrl: stripSlash(opts.apiUrl), loginContext: opts.context || DEFAULT_AUTH_CONTEXT };
|
|
@@ -52,7 +32,6 @@ export function resolveTarget(opts) {
|
|
|
52
32
|
};
|
|
53
33
|
}
|
|
54
34
|
if (res.status === "loaded") {
|
|
55
|
-
// RegistrySchema's refine() guarantees defaultTarget names an existing entry.
|
|
56
35
|
const entry = res.targets[res.defaultTarget];
|
|
57
36
|
return {
|
|
58
37
|
apiBaseUrl: entry.apiBaseUrl,
|
|
@@ -63,13 +42,8 @@ export function resolveTarget(opts) {
|
|
|
63
42
|
};
|
|
64
43
|
}
|
|
65
44
|
if (res.status === "invalid") {
|
|
66
|
-
// Neither --target nor --api-url given, so this is the implicit/no-flag
|
|
67
|
-
// path — warn (don't throw) so a broken registry file doesn't silently
|
|
68
|
-
// swallow itself while the CLI quietly falls back to env/localhost.
|
|
69
45
|
logWarn(`Agent-targets registry at ${res.path} is invalid: ${res.message}. Falling back to env/localhost.`);
|
|
70
46
|
}
|
|
71
|
-
// No target/api-url given and no usable registry: preserve the old
|
|
72
|
-
// `mesh artifacts get` no-flag behavior — never throw here.
|
|
73
47
|
const fallbackUrl = process.env.AGENT_API_URL || process.env.API_URL || "http://localhost:8787";
|
|
74
48
|
return { apiBaseUrl: stripSlash(fallbackUrl), loginContext: opts.context || DEFAULT_AUTH_CONTEXT };
|
|
75
49
|
}
|
|
@@ -84,30 +58,10 @@ async function authHeaders(target) {
|
|
|
84
58
|
return { "X-Forwarded-User": "dev-user", "X-Forwarded-Email": "dev@localhost" };
|
|
85
59
|
throw new TargetResolutionError(`No valid credentials for context "${ctx}". Run: mesh login ${ctx}`);
|
|
86
60
|
}
|
|
87
|
-
/**
|
|
88
|
-
* Fetch an agent-api path on the resolved target, with auth. Caller checks
|
|
89
|
-
* status.
|
|
90
|
-
*
|
|
91
|
-
* `redirect: "manual"` is deliberate: an unauthenticated `/v1` call against a
|
|
92
|
-
* deployed agent 302s to Zitadel. With the default `redirect: "follow"`,
|
|
93
|
-
* fetch follows it and returns a `200` HTML login page — `describeHttpError`'s
|
|
94
|
-
* auth branch never fires and the caller sees a raw JSON-parse error instead
|
|
95
|
-
* of auth guidance. With `"manual"`, the redirect surfaces as a Response with
|
|
96
|
-
* `type: "opaqueredirect"` (status 0), which `describeHttpError` already maps
|
|
97
|
-
* to the "auth did not reach the agent" message.
|
|
98
|
-
*/
|
|
99
61
|
export async function agentApiFetch(target, apiPath) {
|
|
100
62
|
const headers = await authHeaders(target);
|
|
101
63
|
return fetch(`${target.apiBaseUrl}${apiPath}`, { headers, redirect: "manual" });
|
|
102
64
|
}
|
|
103
|
-
/**
|
|
104
|
-
* Like {@link agentApiFetch}, but with a method and a body — the write half.
|
|
105
|
-
*
|
|
106
|
-
* Shares `authHeaders` and `redirect: "manual"` with the read path for the same
|
|
107
|
-
* reasons documented there; the redirect handling matters MORE here, because a
|
|
108
|
-
* write that silently followed a 302 to Zitadel would report the login page's
|
|
109
|
-
* 200 as a successful publish.
|
|
110
|
-
*/
|
|
111
65
|
export async function agentApiSend(target, apiPath, init) {
|
|
112
66
|
const headers = await authHeaders(target);
|
|
113
67
|
const body = init.json !== undefined ? JSON.stringify(init.json) : init.body;
|
|
@@ -115,25 +69,11 @@ export async function agentApiSend(target, apiPath, init) {
|
|
|
115
69
|
return fetch(`${target.apiBaseUrl}${apiPath}`, {
|
|
116
70
|
method: init.method,
|
|
117
71
|
headers: { ...headers, ...(body === undefined ? {} : { "content-type": contentType }) },
|
|
118
|
-
// `as never` rather than `as BodyInit`: this package's lib config does not
|
|
119
|
-
// pull in DOM types, so the global name is unavailable even though Node's
|
|
120
|
-
// fetch accepts exactly these shapes at runtime.
|
|
121
72
|
...(body === undefined ? {} : { body: body }),
|
|
122
73
|
redirect: "manual",
|
|
123
74
|
});
|
|
124
75
|
}
|
|
125
76
|
const NETWORK_ERROR_PATTERN = /ECONNREFUSED|fetch failed|ENOTFOUND|EAI_AGAIN/;
|
|
126
|
-
/**
|
|
127
|
-
* Turn a thrown fetch error into local-vs-remote-aware guidance. A bare
|
|
128
|
-
* `ECONNREFUSED`/`fetch failed` (also `ENOTFOUND`/`EAI_AGAIN`) means
|
|
129
|
-
* something different depending on the target: against a LOCAL apiBaseUrl it
|
|
130
|
-
* almost always means the local `mesh dev` agent API isn't running; against
|
|
131
|
-
* a REMOTE one it means a down host, a DNS typo, a dropped VPN/tailscale
|
|
132
|
-
* connection, or (occasionally) an auth redirect that the fetch layer
|
|
133
|
-
* couldn't follow. Only actual network throws get this treatment — every
|
|
134
|
-
* other error (including ones `describeHttpError` already produced) passes
|
|
135
|
-
* through unchanged so callers can log it without double guidance.
|
|
136
|
-
*/
|
|
137
77
|
export function describeNetworkError(err, target) {
|
|
138
78
|
const message = err instanceof Error ? err.message : String(err);
|
|
139
79
|
if (!NETWORK_ERROR_PATTERN.test(message))
|
|
@@ -145,24 +85,6 @@ export function describeNetworkError(err, target) {
|
|
|
145
85
|
return (`Couldn't reach ${target.apiBaseUrl} — check the URL/VPN/tailscale, ` +
|
|
146
86
|
`or \`mesh login ${loginContext}\` if it's an auth redirect.`);
|
|
147
87
|
}
|
|
148
|
-
/**
|
|
149
|
-
* Shared, target-aware renderer for a non-ok agent-api response. Used by
|
|
150
|
-
* both `mesh conversations` (list/show/artifacts) and `mesh artifacts get`
|
|
151
|
-
* so there is exactly one place that turns an HTTP failure into human
|
|
152
|
-
* guidance — no more dev-oriented "restart the API process" advice, no more
|
|
153
|
-
* a second parallel renderer for `show`'s 503 special-case.
|
|
154
|
-
*
|
|
155
|
-
* `ctx.id` (a conversation id, when the caller has one) enables the
|
|
156
|
-
* `mesh temporal recover-conversation <id>` hint on a `conversation_unavailable`
|
|
157
|
-
* 503 and is echoed in the 404 message for context.
|
|
158
|
-
*
|
|
159
|
-
* Response shapes are verified against
|
|
160
|
-
* `packages/agent-sdk/src/agent-api/server.ts` — do not re-infer:
|
|
161
|
-
* - 404 → `{ error: "conversation not found", conversationId }`.
|
|
162
|
-
* - 503 conversation_unavailable → `{ error: "conversation_unavailable",
|
|
163
|
-
* conversationId, detail: "<text>" }` — human text is under `detail`,
|
|
164
|
-
* NOT `message`.
|
|
165
|
-
*/
|
|
166
88
|
export async function describeHttpError(res, target, ctx) {
|
|
167
89
|
const isRedirect = res.redirected || res.type === "opaqueredirect" || res.status === 302;
|
|
168
90
|
if (res.status === 401 || res.status === 403 || isRedirect) {
|
|
@@ -184,9 +106,7 @@ export async function describeHttpError(res, target, ctx) {
|
|
|
184
106
|
}
|
|
185
107
|
}
|
|
186
108
|
catch {
|
|
187
|
-
// Not JSON, or not the shape we expect — fall through to the generic message.
|
|
188
109
|
}
|
|
189
110
|
}
|
|
190
111
|
return `agent-api error ${res.status}: ${bodyText || res.statusText} (${target.apiBaseUrl})`;
|
|
191
112
|
}
|
|
192
|
-
//# sourceMappingURL=agent-api-client.js.map
|
|
@@ -1,97 +1,41 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `mesh app check` — the Mesh app contract, enforced.
|
|
3
|
-
*
|
|
4
|
-
* Scans a tenant-apps checkout and reports every mechanical violation of the
|
|
5
|
-
* contract in `@mesh-tech/app-kit`'s `apps` skill
|
|
6
|
-
* (`skills/apps/references/app-contract.md`): a browser UI served from inside
|
|
7
|
-
* the API process, an app that never registers with the Hub, app-written
|
|
8
|
-
* browser sessions where the platform auth proxy belongs, logging that
|
|
9
|
-
* bypasses `@mesh-tech/logger`, and an app whose people, roles or keys the
|
|
10
|
-
* Hub cannot see. `mesh create-app` runs it on every scaffold, tenant CI runs
|
|
11
|
-
* it beside `mesh skills sync --check`, and the platform reviewer runs the
|
|
12
|
-
* same command — one detector, one exit code.
|
|
13
|
-
*
|
|
14
|
-
* Three layers, like `mesh dev doctor`:
|
|
15
|
-
* 1. Pure scanners (`scanApp`, `scanRepo`) — filesystem in, `Finding[]` out.
|
|
16
|
-
* 2. One `Check` per contract code, on the dev-doctor engine (`runChecks`).
|
|
17
|
-
* 3. The command: resolves the repo root, picks the apps, renders, exits.
|
|
18
|
-
*
|
|
19
|
-
* The patterns are deliberately shape-based: `apps/<app>/index.ts` (the Pulumi
|
|
20
|
-
* program) is the contract's single point of truth, and a service directory is
|
|
21
|
-
* a UI if its name says so. A hit is a fact to READ, not a verdict — the ruling
|
|
22
|
-
* detail and every gate's owning primitive live in the contract reference.
|
|
23
|
-
*
|
|
24
|
-
* @example
|
|
25
|
-
* ```bash
|
|
26
|
-
* mesh app check # every apps/* in this repo
|
|
27
|
-
* mesh app check apps/funding-portal # one app
|
|
28
|
-
* mesh app check --json # stable shape for CI
|
|
29
|
-
* ```
|
|
30
|
-
*/
|
|
31
1
|
import { Command } from "commander";
|
|
32
2
|
import { jsonReport, type Check, type CheckResult, type CheckStatus } from "./dev-doctor.js";
|
|
33
|
-
/** Every code the contract defines. The contract reference lists the same set; a test keeps them equal. */
|
|
34
3
|
export type AppCheckCode = "UI_IN_API" | "NO_UI_SERVICE" | "NO_REGISTER" | "CUSTOM_SESSION_AUTH" | "NON_PLATFORM_LOGGER" | "LOCAL_AUTH_LIB" | "NO_AUTHZ_POINTER" | "METADATA_UNPUBLISHED" | "IAC_GRANTS" | "POINTER_PROJECT_OVERRIDE" | "PASSWORD_STORE" | "EMAIL_ALLOWLIST" | "USERS_TABLE";
|
|
35
4
|
export interface AppCheckRule {
|
|
36
|
-
/** Contract gate the code enforces (`0.1` … `0.5`, `H`). */
|
|
37
5
|
gate: string;
|
|
38
|
-
/** Human label, present tense. */
|
|
39
6
|
title: string;
|
|
40
|
-
/** `block` exits 1; `advisory` reports and exits 0. */
|
|
41
7
|
severity: "block" | "advisory";
|
|
42
|
-
/** The concrete replacement — what the author writes instead. */
|
|
43
8
|
remediation: string;
|
|
44
|
-
/** `repo` rules scan the checkout once; `app` rules run per app. */
|
|
45
9
|
scope: "app" | "repo";
|
|
46
10
|
}
|
|
47
11
|
export declare const APP_CHECK_RULES: Record<AppCheckCode, AppCheckRule>;
|
|
48
12
|
export declare const APP_CHECK_CODES: AppCheckCode[];
|
|
49
|
-
/** One mechanical hit. `path` is repo-relative (`apps/x/api/src/y.ts[:line]`). */
|
|
50
13
|
export interface Finding {
|
|
51
14
|
code: AppCheckCode;
|
|
52
15
|
path: string;
|
|
53
16
|
why: string;
|
|
54
17
|
}
|
|
55
|
-
/** Source files worth scanning: TS/JS minus tests, fixtures, generated output, tooling and dependencies. */
|
|
56
18
|
export declare function srcFiles(dir: string): string[];
|
|
57
|
-
/** A service directory whose NAME says "browser UI". */
|
|
58
19
|
export declare function isUiDir(name: string): boolean;
|
|
59
|
-
/** Apps in a checkout: every `apps/<name>` with a Pulumi program, or the root when it is itself an app. */
|
|
60
20
|
export declare function listApps(root: string): string[];
|
|
61
|
-
/**
|
|
62
|
-
* Every app-scoped finding for one app (`appRel` is repo-relative). An app
|
|
63
|
-
* directory with no Pulumi program yields nothing — it is not an app.
|
|
64
|
-
*/
|
|
65
21
|
export declare function scanApp(root: string, appRel: string): Finding[];
|
|
66
|
-
/** Repo-scoped findings: a tenant-local auth library that may duplicate `@mesh-tech/authn` (advisory). */
|
|
67
22
|
export declare function scanRepo(root: string): Finding[];
|
|
68
|
-
/** What every app-contract `Check` reads: the findings for ONE scope (an app, or the repo). */
|
|
69
23
|
export interface AppCheckContext {
|
|
70
24
|
root: string;
|
|
71
|
-
/** Repo-relative app dir, or `null` for the repo-scoped checks. */
|
|
72
25
|
app: string | null;
|
|
73
26
|
findings: Finding[];
|
|
74
27
|
}
|
|
75
|
-
/** Turn a rule + its findings into the doctor-engine result shape. */
|
|
76
28
|
export declare function resultFor(code: AppCheckCode, findings: Finding[]): CheckResult;
|
|
77
|
-
/** The `Check`s for one scope: every app-scoped rule for an app, every repo-scoped rule for the repo. */
|
|
78
29
|
export declare function appContractChecks(scope: "app" | "repo"): Check<AppCheckContext>[];
|
|
79
30
|
export interface AppCheckReport {
|
|
80
31
|
root: string;
|
|
81
32
|
status: CheckStatus;
|
|
82
|
-
/** Per-app reports, in `listApps` order; the repo-scoped checks ride under `"(repo)"`. */
|
|
83
33
|
scopes: Array<{
|
|
84
34
|
scope: string;
|
|
85
35
|
} & ReturnType<typeof jsonReport>>;
|
|
86
36
|
}
|
|
87
|
-
/**
|
|
88
|
-
* Run the contract over a checkout. `apps` narrows the run to the named
|
|
89
|
-
* repo-relative app dirs (an unknown dir is an error, not a silent pass).
|
|
90
|
-
*/
|
|
91
37
|
export declare function runAppCheck(root: string, apps?: string[]): Promise<AppCheckReport>;
|
|
92
|
-
/** Human rendering: a header per scope, the doctor lines under it, failures only unless `verbose`. */
|
|
93
38
|
export declare function renderReport(report: AppCheckReport, opts: {
|
|
94
39
|
verbose: boolean;
|
|
95
40
|
}): string;
|
|
96
41
|
export declare function registerAppCommands(program: Command): void;
|
|
97
|
-
//# sourceMappingURL=app-check.d.ts.map
|
|
@@ -1,33 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `mesh app check` — the Mesh app contract, enforced.
|
|
3
|
-
*
|
|
4
|
-
* Scans a tenant-apps checkout and reports every mechanical violation of the
|
|
5
|
-
* contract in `@mesh-tech/app-kit`'s `apps` skill
|
|
6
|
-
* (`skills/apps/references/app-contract.md`): a browser UI served from inside
|
|
7
|
-
* the API process, an app that never registers with the Hub, app-written
|
|
8
|
-
* browser sessions where the platform auth proxy belongs, logging that
|
|
9
|
-
* bypasses `@mesh-tech/logger`, and an app whose people, roles or keys the
|
|
10
|
-
* Hub cannot see. `mesh create-app` runs it on every scaffold, tenant CI runs
|
|
11
|
-
* it beside `mesh skills sync --check`, and the platform reviewer runs the
|
|
12
|
-
* same command — one detector, one exit code.
|
|
13
|
-
*
|
|
14
|
-
* Three layers, like `mesh dev doctor`:
|
|
15
|
-
* 1. Pure scanners (`scanApp`, `scanRepo`) — filesystem in, `Finding[]` out.
|
|
16
|
-
* 2. One `Check` per contract code, on the dev-doctor engine (`runChecks`).
|
|
17
|
-
* 3. The command: resolves the repo root, picks the apps, renders, exits.
|
|
18
|
-
*
|
|
19
|
-
* The patterns are deliberately shape-based: `apps/<app>/index.ts` (the Pulumi
|
|
20
|
-
* program) is the contract's single point of truth, and a service directory is
|
|
21
|
-
* a UI if its name says so. A hit is a fact to READ, not a verdict — the ruling
|
|
22
|
-
* detail and every gate's owning primitive live in the contract reference.
|
|
23
|
-
*
|
|
24
|
-
* @example
|
|
25
|
-
* ```bash
|
|
26
|
-
* mesh app check # every apps/* in this repo
|
|
27
|
-
* mesh app check apps/funding-portal # one app
|
|
28
|
-
* mesh app check --json # stable shape for CI
|
|
29
|
-
* ```
|
|
30
|
-
*/
|
|
31
1
|
import * as fs from "node:fs";
|
|
32
2
|
import * as path from "node:path";
|
|
33
3
|
import { logError, logInfo } from "../utils/index.js";
|
|
@@ -128,12 +98,8 @@ export const APP_CHECK_RULES = {
|
|
|
128
98
|
},
|
|
129
99
|
};
|
|
130
100
|
export const APP_CHECK_CODES = Object.keys(APP_CHECK_RULES);
|
|
131
|
-
// ============================================================================
|
|
132
|
-
// Filesystem helpers (pure over a root)
|
|
133
|
-
// ============================================================================
|
|
134
101
|
const SRC_EXT = new Set([".ts", ".tsx", ".js", ".mjs", ".jsx"]);
|
|
135
102
|
const SKIP_DIRS = new Set(["node_modules", "dist", "build", ".generated", "test", "tests", "__tests__", "fixtures", "scripts"]);
|
|
136
|
-
/** Directories under an app that are not services (docs, tooling, dev mocks, migrations). */
|
|
137
103
|
const NON_SERVICE_DIRS = new Set([
|
|
138
104
|
"docs",
|
|
139
105
|
"scripts",
|
|
@@ -167,7 +133,6 @@ function readText(p) {
|
|
|
167
133
|
return "";
|
|
168
134
|
}
|
|
169
135
|
}
|
|
170
|
-
/** Source files worth scanning: TS/JS minus tests, fixtures, generated output, tooling and dependencies. */
|
|
171
136
|
export function srcFiles(dir) {
|
|
172
137
|
const out = [];
|
|
173
138
|
const walk = (d) => {
|
|
@@ -198,15 +163,12 @@ export function srcFiles(dir) {
|
|
|
198
163
|
walk(dir);
|
|
199
164
|
return out.sort();
|
|
200
165
|
}
|
|
201
|
-
/** A `test-*` / `*-test` directory is a test harness (a browser fixture, a smoke client), not a deployed service. */
|
|
202
166
|
function isTestHarness(name) {
|
|
203
167
|
return name.startsWith("test-") || name.endsWith("-test");
|
|
204
168
|
}
|
|
205
|
-
/** A service directory whose NAME says "browser UI". */
|
|
206
169
|
export function isUiDir(name) {
|
|
207
170
|
return ["ui", "web", "frontend", "client", "portal-ui", "app"].includes(name) || name.endsWith("-ui");
|
|
208
171
|
}
|
|
209
|
-
/** Service directories of an app: every child dir that is not docs/tooling. */
|
|
210
172
|
function serviceDirs(app) {
|
|
211
173
|
let entries;
|
|
212
174
|
try {
|
|
@@ -220,11 +182,6 @@ function serviceDirs(app) {
|
|
|
220
182
|
.map((e) => path.join(app, e.name))
|
|
221
183
|
.sort();
|
|
222
184
|
}
|
|
223
|
-
/**
|
|
224
|
-
* Grep-like scan of an app for the authorization gate: every `.ts/.tsx/.yaml/.sql`
|
|
225
|
-
* outside dependencies, build output and tests, with comment lines dropped —
|
|
226
|
-
* a comment is not a surface. Returns `path:line` + the line for each match.
|
|
227
|
-
*/
|
|
228
185
|
function authzSurface(app) {
|
|
229
186
|
const hits = [];
|
|
230
187
|
const walk = (d) => {
|
|
@@ -258,9 +215,6 @@ function authzSurface(app) {
|
|
|
258
215
|
walk(app);
|
|
259
216
|
return hits;
|
|
260
217
|
}
|
|
261
|
-
// ============================================================================
|
|
262
|
-
// Scanners
|
|
263
|
-
// ============================================================================
|
|
264
218
|
const RE_HTML = /from ["']hono\/(html|jsx)["']|react-dom\/server|\bc\.html\(|<!doctype html|<!DOCTYPE html/;
|
|
265
219
|
const RE_OIDC = /openid-client|code_verifier|authorization_code|buildAuthorizeUrl|end_session/;
|
|
266
220
|
const RE_COOKIE = /setCookie\(|hono\/cookie|Set-Cookie/;
|
|
@@ -269,15 +223,10 @@ const RE_EXPOSURE = /ZitadelAppIdentity|createOAuthMiddleware|createAuthorizatio
|
|
|
269
223
|
const RE_POINTER = /AppAuthzPointer/;
|
|
270
224
|
const RE_METADATA = /compileOpsHubMetadata|ops-hub-metadata|SpiceDBSchema/;
|
|
271
225
|
const RE_IAC_GRANT = /userId: *"[0-9]{6,}"/;
|
|
272
|
-
// The pointer's `zitadel` override exists for the Hub, whose AppEnvironment is
|
|
273
|
-
// built before its identity. An app binds its project through AppEnvironment
|
|
274
|
-
// (`zitadelAppProjectId`), which has no `zitadel: { projectId` literal — so the
|
|
275
|
-
// literal on a program line is the override, whichever line of the call it sits on.
|
|
276
226
|
const RE_POINTER_OVERRIDE = /\bzitadel: *\{\s*projectId\b/;
|
|
277
227
|
const RE_PASSWORD = /(^|[^a-z])(bcrypt|argon2)|password_hash|passwordHash|hashPassword|temporaryPassword.*(send|mail)|(send|mail).*temporaryPassword/;
|
|
278
228
|
const RE_ALLOWLIST = /ADMIN_EMAILS|ALLOWED_EMAILS|allowedEmails|adminEmails/;
|
|
279
229
|
const RE_USERS_TABLE = /create table (if not exists )?"?(users|roles|user_roles|permissions)"?/i;
|
|
280
|
-
/** Apps in a checkout: every `apps/<name>` with a Pulumi program, or the root when it is itself an app. */
|
|
281
230
|
export function listApps(root) {
|
|
282
231
|
const apps = [];
|
|
283
232
|
const appsDir = path.join(root, "apps");
|
|
@@ -294,10 +243,6 @@ export function listApps(root) {
|
|
|
294
243
|
apps.push(".");
|
|
295
244
|
return apps;
|
|
296
245
|
}
|
|
297
|
-
/**
|
|
298
|
-
* Every app-scoped finding for one app (`appRel` is repo-relative). An app
|
|
299
|
-
* directory with no Pulumi program yields nothing — it is not an app.
|
|
300
|
-
*/
|
|
301
246
|
export function scanApp(root, appRel) {
|
|
302
247
|
const app = path.resolve(root, appRel);
|
|
303
248
|
const index = path.join(app, "index.ts");
|
|
@@ -308,7 +253,6 @@ export function scanApp(root, appRel) {
|
|
|
308
253
|
const hasProgram = fs.existsSync(index) || fs.existsSync(path.join(app, "Pulumi.yaml"));
|
|
309
254
|
if (!hasProgram)
|
|
310
255
|
return findings;
|
|
311
|
-
// ── Check 0 (contract gates 0.1–0.4) need the Pulumi program ─────────────
|
|
312
256
|
if (fs.existsSync(index)) {
|
|
313
257
|
const indexRel = rel(root, index);
|
|
314
258
|
let servesHtml = false;
|
|
@@ -355,7 +299,6 @@ export function scanApp(root, appRel) {
|
|
|
355
299
|
}
|
|
356
300
|
}
|
|
357
301
|
}
|
|
358
|
-
// ── Check H (authorization gate) ─────────────────────────────────────────
|
|
359
302
|
const surface = authzSurface(app);
|
|
360
303
|
const first = (re) => surface.find((h) => re.test(h.text));
|
|
361
304
|
const exposure = first(RE_EXPOSURE);
|
|
@@ -381,7 +324,6 @@ export function scanApp(root, appRel) {
|
|
|
381
324
|
anti("USERS_TABLE", RE_USERS_TABLE, "hand-rolled users/roles table — people and roles live in Zitadel and are administered from the Hub");
|
|
382
325
|
return findings;
|
|
383
326
|
}
|
|
384
|
-
/** True when `dir/package.json` names a `@mesh-tech/*` package (a checkout of the platform itself). */
|
|
385
327
|
function isPlatformPackage(dir) {
|
|
386
328
|
try {
|
|
387
329
|
const pkg = JSON.parse(readText(path.join(dir, "package.json")));
|
|
@@ -391,7 +333,6 @@ function isPlatformPackage(dir) {
|
|
|
391
333
|
return false;
|
|
392
334
|
}
|
|
393
335
|
}
|
|
394
|
-
/** Repo-scoped findings: a tenant-local auth library that may duplicate `@mesh-tech/authn` (advisory). */
|
|
395
336
|
export function scanRepo(root) {
|
|
396
337
|
const findings = [];
|
|
397
338
|
for (const parent of ["libs", "packages"]) {
|
|
@@ -402,8 +343,6 @@ export function scanRepo(root) {
|
|
|
402
343
|
if (!e.isDirectory() || !e.name.includes("auth"))
|
|
403
344
|
continue;
|
|
404
345
|
const lib = path.join(dir, e.name);
|
|
405
|
-
// The platform's own packages (`@mesh-tech/authn`, `@mesh-tech/authz`) are the
|
|
406
|
-
// canon, not a tenant-local copy of it — the rule is about duplicates.
|
|
407
346
|
if (isPlatformPackage(lib))
|
|
408
347
|
continue;
|
|
409
348
|
const verifies = srcFiles(lib)
|
|
@@ -420,7 +359,6 @@ export function scanRepo(root) {
|
|
|
420
359
|
}
|
|
421
360
|
return findings;
|
|
422
361
|
}
|
|
423
|
-
/** Turn a rule + its findings into the doctor-engine result shape. */
|
|
424
362
|
export function resultFor(code, findings) {
|
|
425
363
|
const rule = APP_CHECK_RULES[code];
|
|
426
364
|
const mine = findings.filter((f) => f.code === code);
|
|
@@ -433,7 +371,6 @@ export function resultFor(code, findings) {
|
|
|
433
371
|
remediation: rule.remediation,
|
|
434
372
|
};
|
|
435
373
|
}
|
|
436
|
-
/** The `Check`s for one scope: every app-scoped rule for an app, every repo-scoped rule for the repo. */
|
|
437
374
|
export function appContractChecks(scope) {
|
|
438
375
|
return APP_CHECK_CODES.filter((code) => APP_CHECK_RULES[code].scope === scope).map((code) => ({
|
|
439
376
|
id: code,
|
|
@@ -442,10 +379,6 @@ export function appContractChecks(scope) {
|
|
|
442
379
|
run: async (ctx) => resultFor(code, ctx.findings),
|
|
443
380
|
}));
|
|
444
381
|
}
|
|
445
|
-
/**
|
|
446
|
-
* Run the contract over a checkout. `apps` narrows the run to the named
|
|
447
|
-
* repo-relative app dirs (an unknown dir is an error, not a silent pass).
|
|
448
|
-
*/
|
|
449
382
|
export async function runAppCheck(root, apps) {
|
|
450
383
|
if (!isDir(root))
|
|
451
384
|
throw new MeshCliError(`no such checkout: ${root}`);
|
|
@@ -463,7 +396,6 @@ export async function runAppCheck(root, apps) {
|
|
|
463
396
|
scopes.push({ scope: "(repo)", ...jsonReport(repoResults) });
|
|
464
397
|
return { root, status: aggregateStatus(scopes.map((s) => ({ status: s.status, summary: "" }))), scopes };
|
|
465
398
|
}
|
|
466
|
-
/** Human rendering: a header per scope, the doctor lines under it, failures only unless `verbose`. */
|
|
467
399
|
export function renderReport(report, opts) {
|
|
468
400
|
const out = [];
|
|
469
401
|
for (const scope of report.scopes) {
|
|
@@ -482,9 +414,6 @@ export function renderReport(report, opts) {
|
|
|
482
414
|
out.push(`${ICONS[report.status]} app contract: ${report.status}`);
|
|
483
415
|
return out.filter(Boolean).join("\n");
|
|
484
416
|
}
|
|
485
|
-
// ============================================================================
|
|
486
|
-
// Command
|
|
487
|
-
// ============================================================================
|
|
488
417
|
export function registerAppCommands(program) {
|
|
489
418
|
const app = program.command("app").description("Inspect a tenant app against the Mesh app contract");
|
|
490
419
|
app
|
|
@@ -512,4 +441,3 @@ export function registerAppCommands(program) {
|
|
|
512
441
|
}
|
|
513
442
|
});
|
|
514
443
|
}
|
|
515
|
-
//# sourceMappingURL=app-check.js.map
|
|
@@ -1,13 +1,2 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* mesh artifacts — manage workflow artifacts from AI agent conversations
|
|
3
|
-
*
|
|
4
|
-
* Commands:
|
|
5
|
-
* mesh artifacts get <ref> Download artifact files to local directory
|
|
6
|
-
*
|
|
7
|
-
* Ref format: <conversationId>:<artifactId>
|
|
8
|
-
* - Full: mesh artifacts get conv-abc123:workflow-artifact
|
|
9
|
-
* - Short: mesh artifacts get conv-abc123 (defaults to "workflow-artifact")
|
|
10
|
-
*/
|
|
11
1
|
import { Command } from "commander";
|
|
12
2
|
export declare function registerArtifactsCommands(program: Command): void;
|
|
13
|
-
//# sourceMappingURL=artifacts.d.ts.map
|
|
@@ -1,21 +1,8 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* mesh artifacts — manage workflow artifacts from AI agent conversations
|
|
3
|
-
*
|
|
4
|
-
* Commands:
|
|
5
|
-
* mesh artifacts get <ref> Download artifact files to local directory
|
|
6
|
-
*
|
|
7
|
-
* Ref format: <conversationId>:<artifactId>
|
|
8
|
-
* - Full: mesh artifacts get conv-abc123:workflow-artifact
|
|
9
|
-
* - Short: mesh artifacts get conv-abc123 (defaults to "workflow-artifact")
|
|
10
|
-
*/
|
|
11
1
|
import * as fs from "fs";
|
|
12
2
|
import * as path from "path";
|
|
13
3
|
import { logError, logInfo, logSuccess, logWarn } from "../utils/log.js";
|
|
14
4
|
import { agentApiFetch, describeHttpError, describeNetworkError, resolveTarget } from "./agent-api-client.js";
|
|
15
5
|
const DEFAULT_ARTIFACT_ID = "workflow-artifact";
|
|
16
|
-
/**
|
|
17
|
-
* Parse an artifact ref: "conversationId:artifactId" or just "conversationId".
|
|
18
|
-
*/
|
|
19
6
|
function parseRef(ref) {
|
|
20
7
|
const colonIdx = ref.indexOf(":");
|
|
21
8
|
if (colonIdx === -1) {
|
|
@@ -39,35 +26,28 @@ async function getArtifact(ref, options, target) {
|
|
|
39
26
|
const { conversationId, artifactId } = parseRef(ref);
|
|
40
27
|
logInfo(`Fetching ${conversationId}:${artifactId} from ${target.apiBaseUrl}…`);
|
|
41
28
|
const bundle = await fetchExportBundle(target, conversationId, artifactId);
|
|
42
|
-
// Determine output directory
|
|
43
29
|
const outputDir = options.output
|
|
44
30
|
?? path.join("workflows", bundle.primaryWorkflow);
|
|
45
|
-
// Create directory
|
|
46
31
|
fs.mkdirSync(outputDir, { recursive: true });
|
|
47
32
|
let filesWritten = 0;
|
|
48
|
-
// Write workflow source files
|
|
49
33
|
for (const file of bundle.files) {
|
|
50
34
|
const filePath = path.join(outputDir, file.filename);
|
|
51
35
|
fs.writeFileSync(filePath, file.code, "utf-8");
|
|
52
36
|
logSuccess(` ${file.filename}`);
|
|
53
37
|
filesWritten++;
|
|
54
38
|
}
|
|
55
|
-
// Write README.md from overview
|
|
56
39
|
if (bundle.overview) {
|
|
57
40
|
const readmePath = path.join(outputDir, "README.md");
|
|
58
41
|
fs.writeFileSync(readmePath, bundle.overview, "utf-8");
|
|
59
42
|
logSuccess(` README.md`);
|
|
60
43
|
filesWritten++;
|
|
61
44
|
}
|
|
62
|
-
// Write IR as JSON — always present, essential for IR-only artifacts
|
|
63
|
-
// (from update_workflow) that have no source files.
|
|
64
45
|
if (bundle.ir) {
|
|
65
46
|
const irPath = path.join(outputDir, "workflow-ir.json");
|
|
66
47
|
fs.writeFileSync(irPath, JSON.stringify(bundle.ir, null, 2), "utf-8");
|
|
67
48
|
logSuccess(` workflow-ir.json`);
|
|
68
49
|
filesWritten++;
|
|
69
50
|
}
|
|
70
|
-
// Write metadata file (conversation ref, IR for tooling)
|
|
71
51
|
const metaPath = path.join(outputDir, ".workflow-meta.json");
|
|
72
52
|
const meta = {
|
|
73
53
|
conversationId: bundle.conversationId,
|
|
@@ -101,10 +81,6 @@ export function registerArtifactsCommands(program) {
|
|
|
101
81
|
.option("--api-url <url>", "Agent API URL (overrides --target; ad-hoc, no registry lookup)")
|
|
102
82
|
.option("--context <ctx>", `Zitadel auth context, used with --api-url (default: ${DEFAULT_AUTH_CONTEXT})`)
|
|
103
83
|
.action(async (ref, opts) => {
|
|
104
|
-
// Resolved outside the try so a network-error catch below can give
|
|
105
|
-
// local-vs-remote-aware guidance (`describeNetworkError` needs the
|
|
106
|
-
// target). If resolution itself throws (bad --target), there's no
|
|
107
|
-
// target to reason about — just report the resolution error.
|
|
108
84
|
let target;
|
|
109
85
|
try {
|
|
110
86
|
target = resolveTarget(opts);
|
|
@@ -120,14 +96,6 @@ export function registerArtifactsCommands(program) {
|
|
|
120
96
|
catch (error) {
|
|
121
97
|
const message = error instanceof Error ? error.message : String(error);
|
|
122
98
|
logError(message);
|
|
123
|
-
// `describeHttpError` covers every HTTP-level failure mode (auth,
|
|
124
|
-
// not-found, 503, generic) with target-aware messages already baked
|
|
125
|
-
// into the thrown message, so it round-trips through here as `hint
|
|
126
|
-
// === message` and is not re-logged. Only a genuine network throw
|
|
127
|
-
// (ECONNREFUSED/"fetch failed"/ENOTFOUND/EAI_AGAIN) — nothing
|
|
128
|
-
// listening at apiBaseUrl, a down host, a DNS typo, a dropped
|
|
129
|
-
// VPN/tailscale connection — gets guidance here, and it differs for
|
|
130
|
-
// a local vs. remote target (see `describeNetworkError`).
|
|
131
99
|
const hint = describeNetworkError(error, target);
|
|
132
100
|
if (hint !== message) {
|
|
133
101
|
logWarn(hint);
|
|
@@ -137,4 +105,3 @@ export function registerArtifactsCommands(program) {
|
|
|
137
105
|
}
|
|
138
106
|
});
|
|
139
107
|
}
|
|
140
|
-
//# sourceMappingURL=artifacts.js.map
|