@mesh-tech/mesh-cli 0.20.2 → 0.20.4
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 +15 -13
- package/dist/bin/mesh.js.map +1 -2
- 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 +3 -1
- package/dist/src/commands/temporal.js.map +1 -2
- 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 +2 -2
- 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
|
@@ -1,60 +1,14 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Reconstruct an agent conversation's transcript from decoded Temporal history.
|
|
3
|
-
*
|
|
4
|
-
* An agent conversation is a Temporal `agentWorkflow`. Its durable history holds
|
|
5
|
-
* everything needed to replay the human/agent exchange even when the worker can
|
|
6
|
-
* no longer run the workflow (code drift):
|
|
7
|
-
*
|
|
8
|
-
* - `WorkflowExecutionSignaled` with signal name `submit_user_message` →
|
|
9
|
-
* one HUMAN turn. Its input payload is `SubmitUserMessageParams`
|
|
10
|
-
* (agent-sdk `agent-core/workflows/signals.ts`): `{ model, messages,
|
|
11
|
-
* streamId, ... }` where `messages` is a Vercel-AI `ModelMessage[]`; the
|
|
12
|
-
* user text lives in the `user`-role message(s).
|
|
13
|
-
* - `callLLM` `ActivityTaskCompleted` → one ASSISTANT turn. Its result is
|
|
14
|
-
* `LLMResult` (agent-sdk `agent-core/types.ts`): `{ messages, usage?,
|
|
15
|
-
* telemetry? }` where `messages` is the model's output `ModelMessage[]` —
|
|
16
|
-
* `assistant`-role text parts plus any `tool-call` parts.
|
|
17
|
-
*
|
|
18
|
-
* This module is the PURE reconstruction core: it takes events whose payloads
|
|
19
|
-
* have ALREADY been decrypted into plain objects and returns ordered turns. The
|
|
20
|
-
* Temporal fetch + decrypt wiring lives in `commands/temporal.ts`.
|
|
21
|
-
*
|
|
22
|
-
* Everything here is best-effort and defensive: payload shapes vary across
|
|
23
|
-
* agent-sdk versions, so every field access is guarded and a turn that can't be
|
|
24
|
-
* parsed becomes a placeholder rather than throwing — the whole point is to
|
|
25
|
-
* recover *something* from an otherwise-unreplayable history.
|
|
26
|
-
*/
|
|
27
|
-
/** Classification of a single decoded history event. */
|
|
28
1
|
export interface DecodedEvent {
|
|
29
|
-
/** Temporal event id (stringified). Used in placeholders. */
|
|
30
2
|
eventId: string;
|
|
31
|
-
/** Which kind of conversation event this is. */
|
|
32
3
|
kind: "userSignal" | "callLLMResult" | "other";
|
|
33
|
-
/**
|
|
34
|
-
* The decoded payload object for this event:
|
|
35
|
-
* - `userSignal` → the `submit_user_message` signal input (SubmitUserMessageParams)
|
|
36
|
-
* - `callLLMResult` → the `callLLM` activity result (LLMResult)
|
|
37
|
-
* - `other` → unused
|
|
38
|
-
*/
|
|
39
4
|
payload?: unknown;
|
|
40
5
|
}
|
|
41
|
-
/**
|
|
42
|
-
* Minimal shape of a raw Temporal history event as consumed by
|
|
43
|
-
* `classifyHistoryEvents`. Only the attribute groups we classify are declared;
|
|
44
|
-
* everything else is ignored. Field access is defensive so partial/variant
|
|
45
|
-
* shapes (across Temporal SDK versions) don't throw.
|
|
46
|
-
*/
|
|
47
6
|
export interface RawHistoryEvent {
|
|
48
7
|
eventId?: unknown;
|
|
49
8
|
activityTaskScheduledEventAttributes?: {
|
|
50
9
|
activityType?: {
|
|
51
10
|
name?: string | null;
|
|
52
11
|
} | null;
|
|
53
|
-
/**
|
|
54
|
-
* The activity's INPUT payload group. For `callLLM` this is `callLLMArgs`
|
|
55
|
-
* (`{ model, messages }`) whose `messages` is the FULL accumulated
|
|
56
|
-
* conversation — the highest-fidelity snapshot source.
|
|
57
|
-
*/
|
|
58
12
|
input?: {
|
|
59
13
|
payloads?: unknown[] | null;
|
|
60
14
|
} | null;
|
|
@@ -73,82 +27,18 @@ export interface RawHistoryEvent {
|
|
|
73
27
|
} | null;
|
|
74
28
|
[k: string]: unknown;
|
|
75
29
|
}
|
|
76
|
-
/**
|
|
77
|
-
* Decrypt+parse a payload group (the `payloads` array from a signal input or
|
|
78
|
-
* activity result) into a plain object. Returns `undefined` when nothing could
|
|
79
|
-
* be decoded, so the pure reconstructor emits a placeholder. Injected so the
|
|
80
|
-
* classification stays pure and unit-testable without a live Temporal codec.
|
|
81
|
-
*/
|
|
82
30
|
export type DecodePayload = (payloads: unknown[] | undefined | null) => Promise<unknown>;
|
|
83
|
-
/**
|
|
84
|
-
* Classify a raw Temporal history into the ordered `DecodedEvent[]` that
|
|
85
|
-
* `reconstructTranscript` consumes.
|
|
86
|
-
*
|
|
87
|
-
* `ActivityTaskCompleted` events carry only a `scheduledEventId`, not the
|
|
88
|
-
* activity's type name — so to tell which completions came from `callLLM` we
|
|
89
|
-
* build a map of `ActivityTaskScheduled.eventId → activityType.name` as we walk
|
|
90
|
-
* the history in event order, then look each completion's `scheduledEventId` up
|
|
91
|
-
* in it. Only `callLLM` completions become `callLLMResult` (assistant) events;
|
|
92
|
-
* completions of other activities (e.g. `routeTools`) are dropped.
|
|
93
|
-
* `submit_user_message` signals become `userSignal` (human) events.
|
|
94
|
-
*
|
|
95
|
-
* Pure aside from the injected `decodePayload` (which performs the decrypt):
|
|
96
|
-
* never throws, and preserves history order.
|
|
97
|
-
*/
|
|
98
31
|
export declare function classifyHistoryEvents(rawEvents: Iterable<RawHistoryEvent>, decodePayload: DecodePayload): Promise<DecodedEvent[]>;
|
|
99
|
-
/**
|
|
100
|
-
* A Vercel-AI `ModelMessage` as it appears in decoded history — kept structural
|
|
101
|
-
* (not flattened to text) so tool-call / tool-result content parts survive into
|
|
102
|
-
* the snapshot. Typed loosely on purpose: shapes vary across agent-sdk versions
|
|
103
|
-
* and the snapshot is a best-effort passthrough of whatever was persisted.
|
|
104
|
-
*/
|
|
105
32
|
export type ModelMessage = {
|
|
106
33
|
role?: string;
|
|
107
34
|
content?: unknown;
|
|
108
35
|
} & Record<string, unknown>;
|
|
109
|
-
/**
|
|
110
|
-
* Extract the highest-fidelity STRUCTURED transcript for a store-ready snapshot
|
|
111
|
-
* backfill — the complete `ModelMessage[]` with tool-call/tool-result parts
|
|
112
|
-
* intact (as opposed to `reconstructTranscript`'s flattened text turns).
|
|
113
|
-
*
|
|
114
|
-
* The source is the `callLLM` activity's SCHEDULED input, `callLLMArgs`
|
|
115
|
-
* (`{ model, messages }`), whose `messages` is the FULL accumulated conversation
|
|
116
|
-
* (user + assistant-with-tool-calls + tool-result messages) up to — but not
|
|
117
|
-
* including — that turn's assistant output. We take the LAST `callLLM`
|
|
118
|
-
* scheduled input (the most-accumulated one) and append the LAST `callLLM`
|
|
119
|
-
* completion's output messages (`LLMResult.messages`, the final assistant turn):
|
|
120
|
-
*
|
|
121
|
-
* [...lastScheduledInput.messages, ...lastCompletion.messages]
|
|
122
|
-
*
|
|
123
|
-
* Completions are matched to `callLLM` via `scheduledEventId` (same mapping as
|
|
124
|
-
* `classifyHistoryEvents`).
|
|
125
|
-
*
|
|
126
|
-
* Best-effort and never throws:
|
|
127
|
-
* - no `callLLM` scheduled input (0 assistant turns) → `[]`;
|
|
128
|
-
* - a scheduled input but no completion (last turn interrupted) → just the
|
|
129
|
-
* input messages.
|
|
130
|
-
*
|
|
131
|
-
* Pure aside from the injected `decodePayload` (which performs the decrypt).
|
|
132
|
-
*/
|
|
133
36
|
export declare function extractSnapshotMessages(rawEvents: Iterable<RawHistoryEvent>, decodePayload: DecodePayload): Promise<ModelMessage[]>;
|
|
134
|
-
/** One reconstructed conversation turn. */
|
|
135
37
|
export interface Turn {
|
|
136
38
|
role: "user" | "assistant";
|
|
137
|
-
/** Human-readable text. Empty string is valid (e.g. a tool-only assistant turn). */
|
|
138
39
|
text: string;
|
|
139
|
-
/** Formatted tool-call summaries (`name(compactArgs)`), assistant turns only. */
|
|
140
40
|
toolCalls?: string[];
|
|
141
|
-
/** Originating Temporal event id. */
|
|
142
41
|
eventId: string;
|
|
143
42
|
}
|
|
144
|
-
/**
|
|
145
|
-
* Reconstruct ordered conversation turns from decoded history events.
|
|
146
|
-
*
|
|
147
|
-
* Pure: no I/O, never throws. `other` events are skipped; unparseable
|
|
148
|
-
* user/assistant events become placeholder turns so the recovery is complete
|
|
149
|
-
* end-to-end even when individual payloads are corrupt.
|
|
150
|
-
*/
|
|
151
43
|
export declare function reconstructTranscript(events: DecodedEvent[]): Turn[];
|
|
152
|
-
/** Render turns as a readable markdown transcript. */
|
|
153
44
|
export declare function renderTranscriptMarkdown(turns: Turn[]): string;
|
|
154
|
-
//# sourceMappingURL=recover-conversation.d.ts.map
|
|
@@ -1,47 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Reconstruct an agent conversation's transcript from decoded Temporal history.
|
|
3
|
-
*
|
|
4
|
-
* An agent conversation is a Temporal `agentWorkflow`. Its durable history holds
|
|
5
|
-
* everything needed to replay the human/agent exchange even when the worker can
|
|
6
|
-
* no longer run the workflow (code drift):
|
|
7
|
-
*
|
|
8
|
-
* - `WorkflowExecutionSignaled` with signal name `submit_user_message` →
|
|
9
|
-
* one HUMAN turn. Its input payload is `SubmitUserMessageParams`
|
|
10
|
-
* (agent-sdk `agent-core/workflows/signals.ts`): `{ model, messages,
|
|
11
|
-
* streamId, ... }` where `messages` is a Vercel-AI `ModelMessage[]`; the
|
|
12
|
-
* user text lives in the `user`-role message(s).
|
|
13
|
-
* - `callLLM` `ActivityTaskCompleted` → one ASSISTANT turn. Its result is
|
|
14
|
-
* `LLMResult` (agent-sdk `agent-core/types.ts`): `{ messages, usage?,
|
|
15
|
-
* telemetry? }` where `messages` is the model's output `ModelMessage[]` —
|
|
16
|
-
* `assistant`-role text parts plus any `tool-call` parts.
|
|
17
|
-
*
|
|
18
|
-
* This module is the PURE reconstruction core: it takes events whose payloads
|
|
19
|
-
* have ALREADY been decrypted into plain objects and returns ordered turns. The
|
|
20
|
-
* Temporal fetch + decrypt wiring lives in `commands/temporal.ts`.
|
|
21
|
-
*
|
|
22
|
-
* Everything here is best-effort and defensive: payload shapes vary across
|
|
23
|
-
* agent-sdk versions, so every field access is guarded and a turn that can't be
|
|
24
|
-
* parsed becomes a placeholder rather than throwing — the whole point is to
|
|
25
|
-
* recover *something* from an otherwise-unreplayable history.
|
|
26
|
-
*/
|
|
27
|
-
/**
|
|
28
|
-
* Classify a raw Temporal history into the ordered `DecodedEvent[]` that
|
|
29
|
-
* `reconstructTranscript` consumes.
|
|
30
|
-
*
|
|
31
|
-
* `ActivityTaskCompleted` events carry only a `scheduledEventId`, not the
|
|
32
|
-
* activity's type name — so to tell which completions came from `callLLM` we
|
|
33
|
-
* build a map of `ActivityTaskScheduled.eventId → activityType.name` as we walk
|
|
34
|
-
* the history in event order, then look each completion's `scheduledEventId` up
|
|
35
|
-
* in it. Only `callLLM` completions become `callLLMResult` (assistant) events;
|
|
36
|
-
* completions of other activities (e.g. `routeTools`) are dropped.
|
|
37
|
-
* `submit_user_message` signals become `userSignal` (human) events.
|
|
38
|
-
*
|
|
39
|
-
* Pure aside from the injected `decodePayload` (which performs the decrypt):
|
|
40
|
-
* never throws, and preserves history order.
|
|
41
|
-
*/
|
|
42
1
|
export async function classifyHistoryEvents(rawEvents, decodePayload) {
|
|
43
|
-
// scheduledEventId → activity type name, so we can tell which
|
|
44
|
-
// ActivityTaskCompleted events came from `callLLM`.
|
|
45
2
|
const activityTypeByScheduledId = new Map();
|
|
46
3
|
const events = [];
|
|
47
4
|
for (const event of rawEvents) {
|
|
@@ -76,40 +33,10 @@ export async function classifyHistoryEvents(rawEvents, decodePayload) {
|
|
|
76
33
|
}
|
|
77
34
|
return events;
|
|
78
35
|
}
|
|
79
|
-
/**
|
|
80
|
-
* Extract the highest-fidelity STRUCTURED transcript for a store-ready snapshot
|
|
81
|
-
* backfill — the complete `ModelMessage[]` with tool-call/tool-result parts
|
|
82
|
-
* intact (as opposed to `reconstructTranscript`'s flattened text turns).
|
|
83
|
-
*
|
|
84
|
-
* The source is the `callLLM` activity's SCHEDULED input, `callLLMArgs`
|
|
85
|
-
* (`{ model, messages }`), whose `messages` is the FULL accumulated conversation
|
|
86
|
-
* (user + assistant-with-tool-calls + tool-result messages) up to — but not
|
|
87
|
-
* including — that turn's assistant output. We take the LAST `callLLM`
|
|
88
|
-
* scheduled input (the most-accumulated one) and append the LAST `callLLM`
|
|
89
|
-
* completion's output messages (`LLMResult.messages`, the final assistant turn):
|
|
90
|
-
*
|
|
91
|
-
* [...lastScheduledInput.messages, ...lastCompletion.messages]
|
|
92
|
-
*
|
|
93
|
-
* Completions are matched to `callLLM` via `scheduledEventId` (same mapping as
|
|
94
|
-
* `classifyHistoryEvents`).
|
|
95
|
-
*
|
|
96
|
-
* Best-effort and never throws:
|
|
97
|
-
* - no `callLLM` scheduled input (0 assistant turns) → `[]`;
|
|
98
|
-
* - a scheduled input but no completion (last turn interrupted) → just the
|
|
99
|
-
* input messages.
|
|
100
|
-
*
|
|
101
|
-
* Pure aside from the injected `decodePayload` (which performs the decrypt).
|
|
102
|
-
*/
|
|
103
36
|
export async function extractSnapshotMessages(rawEvents, decodePayload) {
|
|
104
|
-
// Track the last `callLLM` scheduled input's payload group and its eventId, so
|
|
105
|
-
// we can (a) decode the most-accumulated messages and (b) match its
|
|
106
|
-
// completion by scheduledEventId.
|
|
107
37
|
let lastCallLLMScheduledId;
|
|
108
38
|
let lastCallLLMInputPayloads;
|
|
109
|
-
// Map every scheduled activity's eventId → type name so completions resolve.
|
|
110
39
|
const activityTypeByScheduledId = new Map();
|
|
111
|
-
// Track the last `callLLM` completion result payloads, keyed by matching the
|
|
112
|
-
// scheduledEventId back to a `callLLM`.
|
|
113
40
|
let lastCallLLMResultPayloads;
|
|
114
41
|
for (const event of rawEvents) {
|
|
115
42
|
const eventId = String(event.eventId);
|
|
@@ -121,12 +48,6 @@ export async function extractSnapshotMessages(rawEvents, decodePayload) {
|
|
|
121
48
|
if (name === "callLLM") {
|
|
122
49
|
lastCallLLMScheduledId = eventId;
|
|
123
50
|
lastCallLLMInputPayloads = scheduled.input?.payloads;
|
|
124
|
-
// Reset the result: a completion only "belongs" to this newly-scheduled
|
|
125
|
-
// callLLM if it arrives AFTER this point. Without the reset, a mid-turn
|
|
126
|
-
// interrupted last turn (scheduled, never completed) would keep a STALE
|
|
127
|
-
// earlier completion and duplicate that assistant message (it's already
|
|
128
|
-
// inside this turn's accumulated input). Matches the documented contract:
|
|
129
|
-
// scheduled-input-but-no-completion → just the input messages.
|
|
130
51
|
lastCallLLMResultPayloads = undefined;
|
|
131
52
|
}
|
|
132
53
|
continue;
|
|
@@ -147,15 +68,12 @@ export async function extractSnapshotMessages(rawEvents, decodePayload) {
|
|
|
147
68
|
const resultMessages = messagesFrom(result);
|
|
148
69
|
return [...inputMessages, ...resultMessages];
|
|
149
70
|
}
|
|
150
|
-
/** Pull a `.messages` array off a decoded `{ messages }` payload, else `[]`. */
|
|
151
71
|
function messagesFrom(payload) {
|
|
152
72
|
if (isRecord(payload) && Array.isArray(payload.messages)) {
|
|
153
73
|
return payload.messages;
|
|
154
74
|
}
|
|
155
75
|
return [];
|
|
156
76
|
}
|
|
157
|
-
// ── Extraction helpers (all defensive) ───────────────────────────────────────
|
|
158
|
-
/** Pull display text out of a ModelMessage `content` (string, or parts array). */
|
|
159
77
|
function extractText(content) {
|
|
160
78
|
if (typeof content === "string")
|
|
161
79
|
return content;
|
|
@@ -167,7 +85,6 @@ function extractText(content) {
|
|
|
167
85
|
}
|
|
168
86
|
return "";
|
|
169
87
|
}
|
|
170
|
-
/** Compact a tool-call's args to a single truncated JSON line. */
|
|
171
88
|
function summarizeArgs(args) {
|
|
172
89
|
try {
|
|
173
90
|
const str = JSON.stringify(args ?? {});
|
|
@@ -177,20 +94,14 @@ function summarizeArgs(args) {
|
|
|
177
94
|
return "...";
|
|
178
95
|
}
|
|
179
96
|
}
|
|
180
|
-
/** Format a `tool-call` content part as `name(compactArgs)`. */
|
|
181
97
|
function formatToolCall(part) {
|
|
182
98
|
const name = typeof part.toolName === "string" ? part.toolName : "?";
|
|
183
|
-
// AI SDK v5 uses `input`; older payloads use `args`. Accept either.
|
|
184
99
|
const args = "input" in part ? part.input : part.args;
|
|
185
100
|
return `${name}(${summarizeArgs(args)})`;
|
|
186
101
|
}
|
|
187
102
|
function isRecord(v) {
|
|
188
103
|
return !!v && typeof v === "object";
|
|
189
104
|
}
|
|
190
|
-
/**
|
|
191
|
-
* Extract the human text from a `submit_user_message` signal payload. Returns
|
|
192
|
-
* `null` when nothing recognizable is found (caller emits a placeholder).
|
|
193
|
-
*/
|
|
194
105
|
function extractUserText(payload) {
|
|
195
106
|
if (!isRecord(payload))
|
|
196
107
|
return null;
|
|
@@ -207,7 +118,6 @@ function extractUserText(payload) {
|
|
|
207
118
|
if (parts.length > 0)
|
|
208
119
|
return parts.join("\n");
|
|
209
120
|
}
|
|
210
|
-
// Defensive fallbacks for shape drift — try common single-field carriers.
|
|
211
121
|
for (const field of ["content", "text", "message"]) {
|
|
212
122
|
const v = payload[field];
|
|
213
123
|
if (typeof v === "string" && v)
|
|
@@ -218,17 +128,11 @@ function extractUserText(payload) {
|
|
|
218
128
|
}
|
|
219
129
|
return null;
|
|
220
130
|
}
|
|
221
|
-
/**
|
|
222
|
-
* Extract the assistant text + tool calls from a `callLLM` result payload.
|
|
223
|
-
* Returns `null` only when nothing at all could be parsed (no text AND no tool
|
|
224
|
-
* calls) — a tool-only turn (empty text, non-empty toolCalls) is valid.
|
|
225
|
-
*/
|
|
226
131
|
function extractAssistantTurn(payload) {
|
|
227
132
|
if (!isRecord(payload))
|
|
228
133
|
return null;
|
|
229
134
|
const messages = payload.messages;
|
|
230
135
|
if (!Array.isArray(messages)) {
|
|
231
|
-
// Defensive fallback: some shapes may carry text directly.
|
|
232
136
|
const t = extractText(payload.content) || extractText(payload.text);
|
|
233
137
|
return t ? { text: t, toolCalls: [] } : null;
|
|
234
138
|
}
|
|
@@ -250,14 +154,6 @@ function extractAssistantTurn(payload) {
|
|
|
250
154
|
return null;
|
|
251
155
|
return { text, toolCalls };
|
|
252
156
|
}
|
|
253
|
-
// ── Reconstruction ───────────────────────────────────────────────────────────
|
|
254
|
-
/**
|
|
255
|
-
* Reconstruct ordered conversation turns from decoded history events.
|
|
256
|
-
*
|
|
257
|
-
* Pure: no I/O, never throws. `other` events are skipped; unparseable
|
|
258
|
-
* user/assistant events become placeholder turns so the recovery is complete
|
|
259
|
-
* end-to-end even when individual payloads are corrupt.
|
|
260
|
-
*/
|
|
261
157
|
export function reconstructTranscript(events) {
|
|
262
158
|
const turns = [];
|
|
263
159
|
for (const event of events) {
|
|
@@ -285,15 +181,12 @@ export function reconstructTranscript(events) {
|
|
|
285
181
|
});
|
|
286
182
|
}
|
|
287
183
|
}
|
|
288
|
-
// `other` → skipped
|
|
289
184
|
}
|
|
290
185
|
return turns;
|
|
291
186
|
}
|
|
292
187
|
function placeholder(eventId) {
|
|
293
188
|
return `_[unparseable turn: ${eventId}]_`;
|
|
294
189
|
}
|
|
295
|
-
// ── Rendering ─────────────────────────────────────────────────────────────────
|
|
296
|
-
/** Render turns as a readable markdown transcript. */
|
|
297
190
|
export function renderTranscriptMarkdown(turns) {
|
|
298
191
|
const blocks = [];
|
|
299
192
|
for (const turn of turns) {
|
|
@@ -311,4 +204,3 @@ export function renderTranscriptMarkdown(turns) {
|
|
|
311
204
|
}
|
|
312
205
|
return blocks.join("\n\n") + "\n";
|
|
313
206
|
}
|
|
314
|
-
//# sourceMappingURL=recover-conversation.js.map
|
|
@@ -1,56 +1,25 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Client for the Zitadel-gated registry-auth broker.
|
|
3
|
-
*
|
|
4
|
-
* This is the path that lets a brand-new Trabian developer install
|
|
5
|
-
* `@mesh-tech/*` with **no AWS account, no AWS CLI and no ~/.aws/config**: the
|
|
6
|
-
* broker verifies the Zitadel id token `mesh registry login` cached for the
|
|
7
|
-
* registry's own issuer, checks the caller's role, and returns a CodeArtifact
|
|
8
|
-
* token minted with the BROKER's AWS identity. No AWS credential of any kind
|
|
9
|
-
* reaches the laptop. Which broker to call comes from the registry's global
|
|
10
|
-
* identity (`registry-identity.ts`), never from a platform context.
|
|
11
|
-
*
|
|
12
|
-
* Everything here is pure or dependency-injected so the fallback behaviour —
|
|
13
|
-
* which is what decides whether a broker hiccup breaks an install — is
|
|
14
|
-
* unit-testable without a network.
|
|
15
|
-
*/
|
|
16
1
|
type CtxConfig = {
|
|
17
2
|
issuer?: string;
|
|
18
3
|
registryBroker?: string;
|
|
19
4
|
} | null;
|
|
20
|
-
/** A successful grant from `POST /token`. */
|
|
21
5
|
export interface RegistryGrant {
|
|
22
|
-
/** npm scope the endpoint is bound to, e.g. "@mesh-tech". */
|
|
23
6
|
scope: string;
|
|
24
|
-
/** Registry endpoint URL (npm format). */
|
|
25
7
|
endpoint: string;
|
|
26
|
-
/** CodeArtifact bearer for the `//<host>:_authToken=` npmrc line. */
|
|
27
8
|
authorizationToken: string;
|
|
28
|
-
/** ISO 8601 expiry, for reporting. */
|
|
29
9
|
expiresAt?: string;
|
|
30
10
|
}
|
|
31
|
-
|
|
32
|
-
export type RegistryBrokerFailure =
|
|
33
|
-
/** No broker URL for this context — the platform predates the broker. */
|
|
34
|
-
{
|
|
11
|
+
export type RegistryBrokerFailure = {
|
|
35
12
|
kind: "no-broker";
|
|
36
|
-
}
|
|
37
|
-
/** No cached Zitadel session for the registry — `mesh registry login` signs in. */
|
|
38
|
-
| {
|
|
13
|
+
} | {
|
|
39
14
|
kind: "no-session";
|
|
40
|
-
}
|
|
41
|
-
/** The broker rejected the token (expired/wrong audience). */
|
|
42
|
-
| {
|
|
15
|
+
} | {
|
|
43
16
|
kind: "unauthenticated";
|
|
44
|
-
}
|
|
45
|
-
/** A valid Mesh account that has not been granted registry access. */
|
|
46
|
-
| {
|
|
17
|
+
} | {
|
|
47
18
|
kind: "not-authorized";
|
|
48
19
|
email?: string;
|
|
49
20
|
requiredRoles?: string[];
|
|
50
21
|
requestUrl?: string;
|
|
51
|
-
}
|
|
52
|
-
/** Broker unreachable, 5xx, or a malformed body. */
|
|
53
|
-
| {
|
|
22
|
+
} | {
|
|
54
23
|
kind: "unavailable";
|
|
55
24
|
detail: string;
|
|
56
25
|
};
|
|
@@ -61,71 +30,23 @@ export type RegistryBrokerResult = {
|
|
|
61
30
|
ok: false;
|
|
62
31
|
failure: RegistryBrokerFailure;
|
|
63
32
|
};
|
|
64
|
-
/**
|
|
65
|
-
* Resolve the broker URL, preferring the platform-published value from
|
|
66
|
-
* discovery (`ContextConfig.registryBroker`) and falling back to DNS-convention
|
|
67
|
-
* derivation for platforms not yet redeployed with the payload field.
|
|
68
|
-
*
|
|
69
|
-
* Mirrors `resolveVpnJoinBroker` deliberately — one convention for
|
|
70
|
-
* platform-published service URLs, not two.
|
|
71
|
-
*/
|
|
72
33
|
export declare function resolveRegistryBroker(context: string, getCfg?: (c: string) => CtxConfig): string | null;
|
|
73
|
-
/**
|
|
74
|
-
* Timeout for a broker whose URL the platform actually published. It exists;
|
|
75
|
-
* wait for it.
|
|
76
|
-
*/
|
|
77
34
|
export declare const PUBLISHED_BROKER_TIMEOUT_MS = 15000;
|
|
78
|
-
/**
|
|
79
|
-
* Timeout for a broker URL we merely *derived* by DNS convention. For every
|
|
80
|
-
* platform that has not deployed the broker — which today is all of them — that
|
|
81
|
-
* host does not exist, and this wait sits in front of the AWS fallback on the
|
|
82
|
-
* `mesh login` path too. Fail fast on a guess; be patient with a fact.
|
|
83
|
-
*/
|
|
84
35
|
export declare const DERIVED_BROKER_TIMEOUT_MS = 4000;
|
|
85
|
-
/**
|
|
86
|
-
* Resolve the broker URL *and* say where it came from, so the caller can pick a
|
|
87
|
-
* timeout that matches how much confidence the URL deserves.
|
|
88
|
-
*/
|
|
89
36
|
export declare function resolveRegistryBrokerSource(context: string, getCfg?: (c: string) => CtxConfig): {
|
|
90
37
|
url: string | null;
|
|
91
38
|
source: "published" | "derived";
|
|
92
39
|
};
|
|
93
|
-
/**
|
|
94
|
-
* FALLBACK ONLY. Derive by convention — issuer host `identity.<env>.<domain>`
|
|
95
|
-
* → `registry-auth.<env>.<domain>`. Prefer `resolveRegistryBroker`, which reads
|
|
96
|
-
* the platform-published URL first.
|
|
97
|
-
*/
|
|
98
40
|
export declare function deriveRegistryBroker(context: string, getCfg?: (c: string) => CtxConfig): string | null;
|
|
99
41
|
export interface FetchGrantDeps {
|
|
100
42
|
getValidToken: (context: string) => Promise<string | null>;
|
|
101
43
|
fetchFn?: typeof fetch;
|
|
102
|
-
/** Abort the broker call after this long. Keeps a wedged broker from hanging an install. */
|
|
103
44
|
timeoutMs?: number;
|
|
104
45
|
}
|
|
105
|
-
/**
|
|
106
|
-
* Classify a broker response into a grant or a typed failure.
|
|
107
|
-
*
|
|
108
|
-
* Split out from the fetch so every status code's meaning is pinned by a test.
|
|
109
|
-
* The distinction that matters: **401 means re-login, 403 means request
|
|
110
|
-
* access** — collapsing them (as a boolean-returning client would) is what
|
|
111
|
-
* sends a developer to re-run `mesh login` forever when the real answer is
|
|
112
|
-
* "ask an admin for the role".
|
|
113
|
-
*/
|
|
114
46
|
export declare function classifyBrokerResponse(res: {
|
|
115
47
|
status: number;
|
|
116
48
|
json: () => Promise<unknown>;
|
|
117
49
|
}): Promise<RegistryBrokerResult>;
|
|
118
|
-
/**
|
|
119
|
-
* Exchange the cached Zitadel id token under `context` (the reserved registry
|
|
120
|
-
* key, or any cached context whose issuer matches the registry's) for a
|
|
121
|
-
* CodeArtifact read grant.
|
|
122
|
-
*
|
|
123
|
-
* The token lookup never prompts — an expired session with no refresh token
|
|
124
|
-
* comes back as `no-session` for the caller to decide about, rather than
|
|
125
|
-
* stalling a headless run in a device-code poll.
|
|
126
|
-
*/
|
|
127
50
|
export declare function fetchRegistryGrant(context: string, brokerUrl: string, deps: FetchGrantDeps): Promise<RegistryBrokerResult>;
|
|
128
|
-
/** Convenience for production callers that use the real login.ts token source. */
|
|
129
51
|
export declare function realGrantDeps(): FetchGrantDeps;
|
|
130
52
|
export {};
|
|
131
|
-
//# sourceMappingURL=registry-broker.d.ts.map
|
|
@@ -1,57 +1,15 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Client for the Zitadel-gated registry-auth broker.
|
|
3
|
-
*
|
|
4
|
-
* This is the path that lets a brand-new Trabian developer install
|
|
5
|
-
* `@mesh-tech/*` with **no AWS account, no AWS CLI and no ~/.aws/config**: the
|
|
6
|
-
* broker verifies the Zitadel id token `mesh registry login` cached for the
|
|
7
|
-
* registry's own issuer, checks the caller's role, and returns a CodeArtifact
|
|
8
|
-
* token minted with the BROKER's AWS identity. No AWS credential of any kind
|
|
9
|
-
* reaches the laptop. Which broker to call comes from the registry's global
|
|
10
|
-
* identity (`registry-identity.ts`), never from a platform context.
|
|
11
|
-
*
|
|
12
|
-
* Everything here is pure or dependency-injected so the fallback behaviour —
|
|
13
|
-
* which is what decides whether a broker hiccup breaks an install — is
|
|
14
|
-
* unit-testable without a network.
|
|
15
|
-
*/
|
|
16
1
|
import { getContextConfig, getValidToken } from "../commands/login.js";
|
|
17
|
-
/**
|
|
18
|
-
* Resolve the broker URL, preferring the platform-published value from
|
|
19
|
-
* discovery (`ContextConfig.registryBroker`) and falling back to DNS-convention
|
|
20
|
-
* derivation for platforms not yet redeployed with the payload field.
|
|
21
|
-
*
|
|
22
|
-
* Mirrors `resolveVpnJoinBroker` deliberately — one convention for
|
|
23
|
-
* platform-published service URLs, not two.
|
|
24
|
-
*/
|
|
25
2
|
export function resolveRegistryBroker(context, getCfg = getContextConfig) {
|
|
26
3
|
return resolveRegistryBrokerSource(context, getCfg).url;
|
|
27
4
|
}
|
|
28
|
-
/**
|
|
29
|
-
* Timeout for a broker whose URL the platform actually published. It exists;
|
|
30
|
-
* wait for it.
|
|
31
|
-
*/
|
|
32
5
|
export const PUBLISHED_BROKER_TIMEOUT_MS = 15_000;
|
|
33
|
-
/**
|
|
34
|
-
* Timeout for a broker URL we merely *derived* by DNS convention. For every
|
|
35
|
-
* platform that has not deployed the broker — which today is all of them — that
|
|
36
|
-
* host does not exist, and this wait sits in front of the AWS fallback on the
|
|
37
|
-
* `mesh login` path too. Fail fast on a guess; be patient with a fact.
|
|
38
|
-
*/
|
|
39
6
|
export const DERIVED_BROKER_TIMEOUT_MS = 4_000;
|
|
40
|
-
/**
|
|
41
|
-
* Resolve the broker URL *and* say where it came from, so the caller can pick a
|
|
42
|
-
* timeout that matches how much confidence the URL deserves.
|
|
43
|
-
*/
|
|
44
7
|
export function resolveRegistryBrokerSource(context, getCfg = getContextConfig) {
|
|
45
8
|
const cfg = getCfg(context);
|
|
46
9
|
if (cfg?.registryBroker)
|
|
47
10
|
return { url: cfg.registryBroker, source: "published" };
|
|
48
11
|
return { url: deriveRegistryBroker(context, getCfg), source: "derived" };
|
|
49
12
|
}
|
|
50
|
-
/**
|
|
51
|
-
* FALLBACK ONLY. Derive by convention — issuer host `identity.<env>.<domain>`
|
|
52
|
-
* → `registry-auth.<env>.<domain>`. Prefer `resolveRegistryBroker`, which reads
|
|
53
|
-
* the platform-published URL first.
|
|
54
|
-
*/
|
|
55
13
|
export function deriveRegistryBroker(context, getCfg = getContextConfig) {
|
|
56
14
|
const cfg = getCfg(context);
|
|
57
15
|
if (!cfg?.issuer)
|
|
@@ -66,15 +24,6 @@ export function deriveRegistryBroker(context, getCfg = getContextConfig) {
|
|
|
66
24
|
return null;
|
|
67
25
|
}
|
|
68
26
|
}
|
|
69
|
-
/**
|
|
70
|
-
* Classify a broker response into a grant or a typed failure.
|
|
71
|
-
*
|
|
72
|
-
* Split out from the fetch so every status code's meaning is pinned by a test.
|
|
73
|
-
* The distinction that matters: **401 means re-login, 403 means request
|
|
74
|
-
* access** — collapsing them (as a boolean-returning client would) is what
|
|
75
|
-
* sends a developer to re-run `mesh login` forever when the real answer is
|
|
76
|
-
* "ask an admin for the role".
|
|
77
|
-
*/
|
|
78
27
|
export async function classifyBrokerResponse(res) {
|
|
79
28
|
if (res.status === 401)
|
|
80
29
|
return { ok: false, failure: { kind: "unauthenticated" } };
|
|
@@ -122,15 +71,6 @@ export async function classifyBrokerResponse(res) {
|
|
|
122
71
|
},
|
|
123
72
|
};
|
|
124
73
|
}
|
|
125
|
-
/**
|
|
126
|
-
* Exchange the cached Zitadel id token under `context` (the reserved registry
|
|
127
|
-
* key, or any cached context whose issuer matches the registry's) for a
|
|
128
|
-
* CodeArtifact read grant.
|
|
129
|
-
*
|
|
130
|
-
* The token lookup never prompts — an expired session with no refresh token
|
|
131
|
-
* comes back as `no-session` for the caller to decide about, rather than
|
|
132
|
-
* stalling a headless run in a device-code poll.
|
|
133
|
-
*/
|
|
134
74
|
export async function fetchRegistryGrant(context, brokerUrl, deps) {
|
|
135
75
|
const token = await deps.getValidToken(context);
|
|
136
76
|
if (!token)
|
|
@@ -156,8 +96,6 @@ export async function fetchRegistryGrant(context, brokerUrl, deps) {
|
|
|
156
96
|
clearTimeout(timer);
|
|
157
97
|
}
|
|
158
98
|
}
|
|
159
|
-
/** Convenience for production callers that use the real login.ts token source. */
|
|
160
99
|
export function realGrantDeps() {
|
|
161
100
|
return { getValidToken: (c) => getValidToken(c) };
|
|
162
101
|
}
|
|
163
|
-
//# sourceMappingURL=registry-broker.js.map
|