@pleri/olam-cli 0.1.201 → 0.1.205
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +102 -169
- package/dist/agent-stream/agent-sdk-to-chunks.js +1 -1
- package/dist/agent-stream/driver-runner.js +73 -7
- package/dist/agent-stream/host-driver-launch.js +14 -1
- package/dist/agent-stream/prototype-gen-launch.js +113 -0
- package/dist/agent-stream/question-broker-bridge.js +335 -0
- package/dist/agent-stream/sdk-env-merge.demo.js +35 -0
- package/dist/agent-stream/sdk-env-merge.js +98 -0
- package/dist/image-digests.json +8 -8
- package/dist/index.js +9533 -6258
- package/dist/index.js.map +1 -1
- package/dist/mcp-server.js +24721 -12934
- package/hermes-bundle/version.json +1 -1
- package/hooks/__tests__/_loader.py +26 -0
- package/hooks/__tests__/prompts.py +63 -0
- package/hooks/__tests__/test_classify_bench.py +94 -0
- package/hooks/__tests__/test_classify_pins.py +78 -0
- package/hooks/model-router.py +17 -4
- package/host-cp/k8s/manifests/50-deployment.yaml +1 -1
- package/host-cp/k8s/manifests/auth-service/50-deployment.yaml +1 -1
- package/host-cp/k8s/manifests/kg-service/50-deployment.yaml +1 -1
- package/host-cp/k8s/manifests/mcp-auth-service/50-deployment.yaml +1 -1
- package/host-cp/k8s/manifests/memory-service/50-deployment.yaml +1 -1
- package/host-cp/src/op-side-longpoll.mjs +212 -0
- package/host-cp/src/plan-chat-proxy-headers.mjs +53 -0
- package/host-cp/src/plan-chat-service.mjs +100 -0
- package/host-cp/src/plan-orchestrator.mjs +100 -6
- package/host-cp/src/server.mjs +607 -45
- package/memory-hooks/agentmemory-classify-queue.mjs +363 -0
- package/memory-hooks/agentmemory-recall-trigger.mjs +233 -0
- package/memory-hooks/agentmemory-reflect-cite.mjs +332 -0
- package/memory-hooks/agentmemory-session-recall.js +332 -0
- package/memory-hooks/recall-log.mjs +185 -0
- package/package.json +9 -4
- package/dist/ask/checkout.d.ts +0 -19
- package/dist/ask/checkout.d.ts.map +0 -1
- package/dist/ask/checkout.js +0 -40
- package/dist/ask/checkout.js.map +0 -1
- package/dist/ask/knowledge-pack-builder.d.ts +0 -72
- package/dist/ask/knowledge-pack-builder.d.ts.map +0 -1
- package/dist/ask/knowledge-pack-builder.js +0 -96
- package/dist/ask/knowledge-pack-builder.js.map +0 -1
- package/dist/ask/knowledge-pack.generated.d.ts +0 -8
- package/dist/ask/knowledge-pack.generated.d.ts.map +0 -1
- package/dist/ask/knowledge-pack.generated.js +0 -2362
- package/dist/ask/knowledge-pack.generated.js.map +0 -1
- package/dist/ask/one-shot.d.ts +0 -21
- package/dist/ask/one-shot.d.ts.map +0 -1
- package/dist/ask/one-shot.js +0 -50
- package/dist/ask/one-shot.js.map +0 -1
- package/dist/ask/repl.d.ts +0 -30
- package/dist/ask/repl.d.ts.map +0 -1
- package/dist/ask/repl.js +0 -109
- package/dist/ask/repl.js.map +0 -1
- package/dist/ask/sdk-client.d.ts +0 -87
- package/dist/ask/sdk-client.d.ts.map +0 -1
- package/dist/ask/sdk-client.js +0 -118
- package/dist/ask/sdk-client.js.map +0 -1
- package/dist/ask/system-prompt.d.ts +0 -30
- package/dist/ask/system-prompt.d.ts.map +0 -1
- package/dist/ask/system-prompt.js +0 -31
- package/dist/ask/system-prompt.js.map +0 -1
- package/dist/cli-version.d.ts +0 -16
- package/dist/cli-version.d.ts.map +0 -1
- package/dist/cli-version.js +0 -39
- package/dist/cli-version.js.map +0 -1
- package/dist/commands/ask.d.ts +0 -27
- package/dist/commands/ask.d.ts.map +0 -1
- package/dist/commands/ask.js +0 -63
- package/dist/commands/ask.js.map +0 -1
- package/dist/commands/auth-list-json.d.ts +0 -87
- package/dist/commands/auth-list-json.d.ts.map +0 -1
- package/dist/commands/auth-list-json.js +0 -71
- package/dist/commands/auth-list-json.js.map +0 -1
- package/dist/commands/auth-migrate.d.ts +0 -212
- package/dist/commands/auth-migrate.d.ts.map +0 -1
- package/dist/commands/auth-migrate.js +0 -465
- package/dist/commands/auth-migrate.js.map +0 -1
- package/dist/commands/auth-status.d.ts +0 -51
- package/dist/commands/auth-status.d.ts.map +0 -1
- package/dist/commands/auth-status.js +0 -250
- package/dist/commands/auth-status.js.map +0 -1
- package/dist/commands/auth-upgrade.d.ts +0 -88
- package/dist/commands/auth-upgrade.d.ts.map +0 -1
- package/dist/commands/auth-upgrade.js +0 -431
- package/dist/commands/auth-upgrade.js.map +0 -1
- package/dist/commands/auth.d.ts +0 -31
- package/dist/commands/auth.d.ts.map +0 -1
- package/dist/commands/auth.js +0 -784
- package/dist/commands/auth.js.map +0 -1
- package/dist/commands/begin.d.ts +0 -27
- package/dist/commands/begin.d.ts.map +0 -1
- package/dist/commands/begin.js +0 -45
- package/dist/commands/begin.js.map +0 -1
- package/dist/commands/bootstrap.d.ts +0 -111
- package/dist/commands/bootstrap.d.ts.map +0 -1
- package/dist/commands/bootstrap.js +0 -485
- package/dist/commands/bootstrap.js.map +0 -1
- package/dist/commands/clean.d.ts +0 -41
- package/dist/commands/clean.d.ts.map +0 -1
- package/dist/commands/clean.js +0 -382
- package/dist/commands/clean.js.map +0 -1
- package/dist/commands/completion.d.ts +0 -30
- package/dist/commands/completion.d.ts.map +0 -1
- package/dist/commands/completion.js +0 -50
- package/dist/commands/completion.js.map +0 -1
- package/dist/commands/config.d.ts +0 -3
- package/dist/commands/config.d.ts.map +0 -1
- package/dist/commands/config.js +0 -146
- package/dist/commands/config.js.map +0 -1
- package/dist/commands/create.d.ts +0 -8
- package/dist/commands/create.d.ts.map +0 -1
- package/dist/commands/create.js +0 -775
- package/dist/commands/create.js.map +0 -1
- package/dist/commands/crystallize.d.ts +0 -18
- package/dist/commands/crystallize.d.ts.map +0 -1
- package/dist/commands/crystallize.js +0 -123
- package/dist/commands/crystallize.js.map +0 -1
- package/dist/commands/destroy.d.ts +0 -59
- package/dist/commands/destroy.d.ts.map +0 -1
- package/dist/commands/destroy.js +0 -148
- package/dist/commands/destroy.js.map +0 -1
- package/dist/commands/diagnose.d.ts +0 -36
- package/dist/commands/diagnose.d.ts.map +0 -1
- package/dist/commands/diagnose.js +0 -177
- package/dist/commands/diagnose.js.map +0 -1
- package/dist/commands/dispatch-resolve.d.ts +0 -54
- package/dist/commands/dispatch-resolve.d.ts.map +0 -1
- package/dist/commands/dispatch-resolve.js +0 -105
- package/dist/commands/dispatch-resolve.js.map +0 -1
- package/dist/commands/dispatch.d.ts +0 -18
- package/dist/commands/dispatch.d.ts.map +0 -1
- package/dist/commands/dispatch.js +0 -159
- package/dist/commands/dispatch.js.map +0 -1
- package/dist/commands/doctor.d.ts +0 -258
- package/dist/commands/doctor.d.ts.map +0 -1
- package/dist/commands/doctor.js +0 -1073
- package/dist/commands/doctor.js.map +0 -1
- package/dist/commands/enter.d.ts +0 -63
- package/dist/commands/enter.d.ts.map +0 -1
- package/dist/commands/enter.js +0 -230
- package/dist/commands/enter.js.map +0 -1
- package/dist/commands/flywheel/check-persona-skeleton.d.ts +0 -35
- package/dist/commands/flywheel/check-persona-skeleton.d.ts.map +0 -1
- package/dist/commands/flywheel/check-persona-skeleton.js +0 -151
- package/dist/commands/flywheel/check-persona-skeleton.js.map +0 -1
- package/dist/commands/flywheel/diversity-check.d.ts +0 -17
- package/dist/commands/flywheel/diversity-check.d.ts.map +0 -1
- package/dist/commands/flywheel/diversity-check.js +0 -64
- package/dist/commands/flywheel/diversity-check.js.map +0 -1
- package/dist/commands/flywheel/emit-breadcrumb.d.ts +0 -20
- package/dist/commands/flywheel/emit-breadcrumb.d.ts.map +0 -1
- package/dist/commands/flywheel/emit-breadcrumb.js +0 -137
- package/dist/commands/flywheel/emit-breadcrumb.js.map +0 -1
- package/dist/commands/flywheel/index.d.ts +0 -27
- package/dist/commands/flywheel/index.d.ts.map +0 -1
- package/dist/commands/flywheel/index.js +0 -54
- package/dist/commands/flywheel/index.js.map +0 -1
- package/dist/commands/flywheel/install-sessionstart-hook.d.ts +0 -64
- package/dist/commands/flywheel/install-sessionstart-hook.d.ts.map +0 -1
- package/dist/commands/flywheel/install-sessionstart-hook.js +0 -197
- package/dist/commands/flywheel/install-sessionstart-hook.js.map +0 -1
- package/dist/commands/flywheel/install-shims.d.ts +0 -41
- package/dist/commands/flywheel/install-shims.d.ts.map +0 -1
- package/dist/commands/flywheel/install-shims.js +0 -126
- package/dist/commands/flywheel/install-shims.js.map +0 -1
- package/dist/commands/flywheel/k10-measure.d.ts +0 -17
- package/dist/commands/flywheel/k10-measure.d.ts.map +0 -1
- package/dist/commands/flywheel/k10-measure.js +0 -63
- package/dist/commands/flywheel/k10-measure.js.map +0 -1
- package/dist/commands/flywheel/k5-score.d.ts +0 -14
- package/dist/commands/flywheel/k5-score.d.ts.map +0 -1
- package/dist/commands/flywheel/k5-score.js +0 -59
- package/dist/commands/flywheel/k5-score.js.map +0 -1
- package/dist/commands/flywheel/k5-validate.d.ts +0 -46
- package/dist/commands/flywheel/k5-validate.d.ts.map +0 -1
- package/dist/commands/flywheel/k5-validate.js +0 -246
- package/dist/commands/flywheel/k5-validate.js.map +0 -1
- package/dist/commands/flywheel/migrate-overlays.d.ts +0 -116
- package/dist/commands/flywheel/migrate-overlays.d.ts.map +0 -1
- package/dist/commands/flywheel/migrate-overlays.js +0 -792
- package/dist/commands/flywheel/migrate-overlays.js.map +0 -1
- package/dist/commands/flywheel/ping.d.ts +0 -21
- package/dist/commands/flywheel/ping.d.ts.map +0 -1
- package/dist/commands/flywheel/ping.js +0 -79
- package/dist/commands/flywheel/ping.js.map +0 -1
- package/dist/commands/flywheel/sanitize-persona-output.d.ts +0 -38
- package/dist/commands/flywheel/sanitize-persona-output.d.ts.map +0 -1
- package/dist/commands/flywheel/sanitize-persona-output.js +0 -102
- package/dist/commands/flywheel/sanitize-persona-output.js.map +0 -1
- package/dist/commands/flywheel/session-start.d.ts +0 -26
- package/dist/commands/flywheel/session-start.d.ts.map +0 -1
- package/dist/commands/flywheel/session-start.js +0 -119
- package/dist/commands/flywheel/session-start.js.map +0 -1
- package/dist/commands/hermes-kg-hook.d.ts +0 -36
- package/dist/commands/hermes-kg-hook.d.ts.map +0 -1
- package/dist/commands/hermes-kg-hook.js +0 -80
- package/dist/commands/hermes-kg-hook.js.map +0 -1
- package/dist/commands/hermes.d.ts +0 -46
- package/dist/commands/hermes.d.ts.map +0 -1
- package/dist/commands/hermes.js +0 -320
- package/dist/commands/hermes.js.map +0 -1
- package/dist/commands/host-cp.d.ts +0 -216
- package/dist/commands/host-cp.d.ts.map +0 -1
- package/dist/commands/host-cp.js +0 -913
- package/dist/commands/host-cp.js.map +0 -1
- package/dist/commands/implode.d.ts +0 -86
- package/dist/commands/implode.d.ts.map +0 -1
- package/dist/commands/implode.js +0 -468
- package/dist/commands/implode.js.map +0 -1
- package/dist/commands/init.d.ts +0 -86
- package/dist/commands/init.d.ts.map +0 -1
- package/dist/commands/init.js +0 -357
- package/dist/commands/init.js.map +0 -1
- package/dist/commands/install.d.ts +0 -22
- package/dist/commands/install.d.ts.map +0 -1
- package/dist/commands/install.js +0 -203
- package/dist/commands/install.js.map +0 -1
- package/dist/commands/keys-list-json.d.ts +0 -55
- package/dist/commands/keys-list-json.d.ts.map +0 -1
- package/dist/commands/keys-list-json.js +0 -54
- package/dist/commands/keys-list-json.js.map +0 -1
- package/dist/commands/keys.d.ts +0 -26
- package/dist/commands/keys.d.ts.map +0 -1
- package/dist/commands/keys.js +0 -157
- package/dist/commands/keys.js.map +0 -1
- package/dist/commands/kg-build.d.ts +0 -80
- package/dist/commands/kg-build.d.ts.map +0 -1
- package/dist/commands/kg-build.js +0 -282
- package/dist/commands/kg-build.js.map +0 -1
- package/dist/commands/kg-classify.d.ts +0 -30
- package/dist/commands/kg-classify.d.ts.map +0 -1
- package/dist/commands/kg-classify.js +0 -88
- package/dist/commands/kg-classify.js.map +0 -1
- package/dist/commands/kg-doctor.d.ts +0 -76
- package/dist/commands/kg-doctor.d.ts.map +0 -1
- package/dist/commands/kg-doctor.js +0 -262
- package/dist/commands/kg-doctor.js.map +0 -1
- package/dist/commands/kg-install-hook.d.ts +0 -20
- package/dist/commands/kg-install-hook.d.ts.map +0 -1
- package/dist/commands/kg-install-hook.js +0 -208
- package/dist/commands/kg-install-hook.js.map +0 -1
- package/dist/commands/kg-mirror.d.ts +0 -72
- package/dist/commands/kg-mirror.d.ts.map +0 -1
- package/dist/commands/kg-mirror.js +0 -397
- package/dist/commands/kg-mirror.js.map +0 -1
- package/dist/commands/kg-savings.d.ts +0 -20
- package/dist/commands/kg-savings.d.ts.map +0 -1
- package/dist/commands/kg-savings.js +0 -77
- package/dist/commands/kg-savings.js.map +0 -1
- package/dist/commands/kg-service-container.d.ts +0 -68
- package/dist/commands/kg-service-container.d.ts.map +0 -1
- package/dist/commands/kg-service-container.js +0 -191
- package/dist/commands/kg-service-container.js.map +0 -1
- package/dist/commands/kg-status.d.ts +0 -59
- package/dist/commands/kg-status.d.ts.map +0 -1
- package/dist/commands/kg-status.js +0 -344
- package/dist/commands/kg-status.js.map +0 -1
- package/dist/commands/kg-uninstall-hook.d.ts +0 -12
- package/dist/commands/kg-uninstall-hook.d.ts.map +0 -1
- package/dist/commands/kg-uninstall-hook.js +0 -121
- package/dist/commands/kg-uninstall-hook.js.map +0 -1
- package/dist/commands/kg-watch.d.ts +0 -49
- package/dist/commands/kg-watch.d.ts.map +0 -1
- package/dist/commands/kg-watch.js +0 -172
- package/dist/commands/kg-watch.js.map +0 -1
- package/dist/commands/lanes-list-json.d.ts +0 -69
- package/dist/commands/lanes-list-json.d.ts.map +0 -1
- package/dist/commands/lanes-list-json.js +0 -42
- package/dist/commands/lanes-list-json.js.map +0 -1
- package/dist/commands/lanes.d.ts +0 -18
- package/dist/commands/lanes.d.ts.map +0 -1
- package/dist/commands/lanes.js +0 -133
- package/dist/commands/lanes.js.map +0 -1
- package/dist/commands/list.d.ts +0 -33
- package/dist/commands/list.d.ts.map +0 -1
- package/dist/commands/list.js +0 -87
- package/dist/commands/list.js.map +0 -1
- package/dist/commands/logs.d.ts +0 -52
- package/dist/commands/logs.d.ts.map +0 -1
- package/dist/commands/logs.js +0 -180
- package/dist/commands/logs.js.map +0 -1
- package/dist/commands/mcp/add.d.ts +0 -9
- package/dist/commands/mcp/add.d.ts.map +0 -1
- package/dist/commands/mcp/add.js +0 -87
- package/dist/commands/mcp/add.js.map +0 -1
- package/dist/commands/mcp/client.d.ts +0 -60
- package/dist/commands/mcp/client.d.ts.map +0 -1
- package/dist/commands/mcp/client.js +0 -70
- package/dist/commands/mcp/client.js.map +0 -1
- package/dist/commands/mcp/complete.d.ts +0 -36
- package/dist/commands/mcp/complete.d.ts.map +0 -1
- package/dist/commands/mcp/complete.js +0 -66
- package/dist/commands/mcp/complete.js.map +0 -1
- package/dist/commands/mcp/import-discovery.d.ts +0 -25
- package/dist/commands/mcp/import-discovery.d.ts.map +0 -1
- package/dist/commands/mcp/import-discovery.js +0 -135
- package/dist/commands/mcp/import-discovery.js.map +0 -1
- package/dist/commands/mcp/import-validate.d.ts +0 -15
- package/dist/commands/mcp/import-validate.d.ts.map +0 -1
- package/dist/commands/mcp/import-validate.js +0 -55
- package/dist/commands/mcp/import-validate.js.map +0 -1
- package/dist/commands/mcp/import.d.ts +0 -12
- package/dist/commands/mcp/import.d.ts.map +0 -1
- package/dist/commands/mcp/import.js +0 -126
- package/dist/commands/mcp/import.js.map +0 -1
- package/dist/commands/mcp/index.d.ts +0 -14
- package/dist/commands/mcp/index.d.ts.map +0 -1
- package/dist/commands/mcp/index.js +0 -39
- package/dist/commands/mcp/index.js.map +0 -1
- package/dist/commands/mcp/install-shared.d.ts +0 -24
- package/dist/commands/mcp/install-shared.d.ts.map +0 -1
- package/dist/commands/mcp/install-shared.js +0 -42
- package/dist/commands/mcp/install-shared.js.map +0 -1
- package/dist/commands/mcp/install.d.ts +0 -20
- package/dist/commands/mcp/install.d.ts.map +0 -1
- package/dist/commands/mcp/install.js +0 -59
- package/dist/commands/mcp/install.js.map +0 -1
- package/dist/commands/mcp/list.d.ts +0 -6
- package/dist/commands/mcp/list.d.ts.map +0 -1
- package/dist/commands/mcp/list.js +0 -56
- package/dist/commands/mcp/list.js.map +0 -1
- package/dist/commands/mcp/login.d.ts +0 -6
- package/dist/commands/mcp/login.d.ts.map +0 -1
- package/dist/commands/mcp/login.js +0 -38
- package/dist/commands/mcp/login.js.map +0 -1
- package/dist/commands/mcp/remove.d.ts +0 -6
- package/dist/commands/mcp/remove.d.ts.map +0 -1
- package/dist/commands/mcp/remove.js +0 -21
- package/dist/commands/mcp/remove.js.map +0 -1
- package/dist/commands/mcp/revoke.d.ts +0 -11
- package/dist/commands/mcp/revoke.d.ts.map +0 -1
- package/dist/commands/mcp/revoke.js +0 -51
- package/dist/commands/mcp/revoke.js.map +0 -1
- package/dist/commands/mcp/serve.d.ts +0 -23
- package/dist/commands/mcp/serve.d.ts.map +0 -1
- package/dist/commands/mcp/serve.js +0 -55
- package/dist/commands/mcp/serve.js.map +0 -1
- package/dist/commands/mcp/status.d.ts +0 -6
- package/dist/commands/mcp/status.d.ts.map +0 -1
- package/dist/commands/mcp/status.js +0 -57
- package/dist/commands/mcp/status.js.map +0 -1
- package/dist/commands/mcp/uninstall.d.ts +0 -20
- package/dist/commands/mcp/uninstall.d.ts.map +0 -1
- package/dist/commands/mcp/uninstall.js +0 -60
- package/dist/commands/mcp/uninstall.js.map +0 -1
- package/dist/commands/memory/_paths.d.ts +0 -25
- package/dist/commands/memory/_paths.d.ts.map +0 -1
- package/dist/commands/memory/_paths.js +0 -57
- package/dist/commands/memory/_paths.js.map +0 -1
- package/dist/commands/memory/bridge.d.ts +0 -57
- package/dist/commands/memory/bridge.d.ts.map +0 -1
- package/dist/commands/memory/bridge.js +0 -152
- package/dist/commands/memory/bridge.js.map +0 -1
- package/dist/commands/memory/index.d.ts +0 -20
- package/dist/commands/memory/index.d.ts.map +0 -1
- package/dist/commands/memory/index.js +0 -47
- package/dist/commands/memory/index.js.map +0 -1
- package/dist/commands/memory/install-hooks.d.ts +0 -22
- package/dist/commands/memory/install-hooks.d.ts.map +0 -1
- package/dist/commands/memory/install-hooks.js +0 -156
- package/dist/commands/memory/install-hooks.js.map +0 -1
- package/dist/commands/memory/install.d.ts +0 -57
- package/dist/commands/memory/install.d.ts.map +0 -1
- package/dist/commands/memory/install.js +0 -114
- package/dist/commands/memory/install.js.map +0 -1
- package/dist/commands/memory/logs.d.ts +0 -19
- package/dist/commands/memory/logs.d.ts.map +0 -1
- package/dist/commands/memory/logs.js +0 -50
- package/dist/commands/memory/logs.js.map +0 -1
- package/dist/commands/memory/mode.d.ts +0 -47
- package/dist/commands/memory/mode.d.ts.map +0 -1
- package/dist/commands/memory/mode.js +0 -185
- package/dist/commands/memory/mode.js.map +0 -1
- package/dist/commands/memory/reclassify.d.ts +0 -56
- package/dist/commands/memory/reclassify.d.ts.map +0 -1
- package/dist/commands/memory/reclassify.js +0 -177
- package/dist/commands/memory/reclassify.js.map +0 -1
- package/dist/commands/memory/secret.d.ts +0 -16
- package/dist/commands/memory/secret.d.ts.map +0 -1
- package/dist/commands/memory/secret.js +0 -80
- package/dist/commands/memory/secret.js.map +0 -1
- package/dist/commands/memory/start.d.ts +0 -25
- package/dist/commands/memory/start.d.ts.map +0 -1
- package/dist/commands/memory/start.js +0 -83
- package/dist/commands/memory/start.js.map +0 -1
- package/dist/commands/memory/stats.d.ts +0 -69
- package/dist/commands/memory/stats.d.ts.map +0 -1
- package/dist/commands/memory/stats.js +0 -164
- package/dist/commands/memory/stats.js.map +0 -1
- package/dist/commands/memory/status.d.ts +0 -45
- package/dist/commands/memory/status.d.ts.map +0 -1
- package/dist/commands/memory/status.js +0 -134
- package/dist/commands/memory/status.js.map +0 -1
- package/dist/commands/memory/stop.d.ts +0 -13
- package/dist/commands/memory/stop.d.ts.map +0 -1
- package/dist/commands/memory/stop.js +0 -52
- package/dist/commands/memory/stop.js.map +0 -1
- package/dist/commands/memory/uninstall.d.ts +0 -19
- package/dist/commands/memory/uninstall.d.ts.map +0 -1
- package/dist/commands/memory/uninstall.js +0 -60
- package/dist/commands/memory/uninstall.js.map +0 -1
- package/dist/commands/memory-service-container.d.ts +0 -130
- package/dist/commands/memory-service-container.d.ts.map +0 -1
- package/dist/commands/memory-service-container.js +0 -251
- package/dist/commands/memory-service-container.js.map +0 -1
- package/dist/commands/observe.d.ts +0 -9
- package/dist/commands/observe.d.ts.map +0 -1
- package/dist/commands/observe.js +0 -42
- package/dist/commands/observe.js.map +0 -1
- package/dist/commands/plans-list-json.d.ts +0 -77
- package/dist/commands/plans-list-json.d.ts.map +0 -1
- package/dist/commands/plans-list-json.js +0 -61
- package/dist/commands/plans-list-json.js.map +0 -1
- package/dist/commands/plans.d.ts +0 -3
- package/dist/commands/plans.d.ts.map +0 -1
- package/dist/commands/plans.js +0 -221
- package/dist/commands/plans.js.map +0 -1
- package/dist/commands/policy-check.d.ts +0 -14
- package/dist/commands/policy-check.d.ts.map +0 -1
- package/dist/commands/policy-check.js +0 -76
- package/dist/commands/policy-check.js.map +0 -1
- package/dist/commands/pr.d.ts +0 -17
- package/dist/commands/pr.d.ts.map +0 -1
- package/dist/commands/pr.js +0 -148
- package/dist/commands/pr.js.map +0 -1
- package/dist/commands/ps.d.ts +0 -57
- package/dist/commands/ps.d.ts.map +0 -1
- package/dist/commands/ps.js +0 -202
- package/dist/commands/ps.js.map +0 -1
- package/dist/commands/refresh-helpers.d.ts +0 -25
- package/dist/commands/refresh-helpers.d.ts.map +0 -1
- package/dist/commands/refresh-helpers.js +0 -56
- package/dist/commands/refresh-helpers.js.map +0 -1
- package/dist/commands/refresh.d.ts +0 -23
- package/dist/commands/refresh.d.ts.map +0 -1
- package/dist/commands/refresh.js +0 -237
- package/dist/commands/refresh.js.map +0 -1
- package/dist/commands/rekey.d.ts +0 -84
- package/dist/commands/rekey.d.ts.map +0 -1
- package/dist/commands/rekey.js +0 -209
- package/dist/commands/rekey.js.map +0 -1
- package/dist/commands/repos-list-json.d.ts +0 -58
- package/dist/commands/repos-list-json.d.ts.map +0 -1
- package/dist/commands/repos-list-json.js +0 -45
- package/dist/commands/repos-list-json.js.map +0 -1
- package/dist/commands/repos.d.ts +0 -11
- package/dist/commands/repos.d.ts.map +0 -1
- package/dist/commands/repos.js +0 -102
- package/dist/commands/repos.js.map +0 -1
- package/dist/commands/restart.d.ts +0 -18
- package/dist/commands/restart.d.ts.map +0 -1
- package/dist/commands/restart.js +0 -113
- package/dist/commands/restart.js.map +0 -1
- package/dist/commands/resume.d.ts +0 -63
- package/dist/commands/resume.d.ts.map +0 -1
- package/dist/commands/resume.js +0 -174
- package/dist/commands/resume.js.map +0 -1
- package/dist/commands/runbooks.d.ts +0 -45
- package/dist/commands/runbooks.d.ts.map +0 -1
- package/dist/commands/runbooks.js +0 -313
- package/dist/commands/runbooks.js.map +0 -1
- package/dist/commands/seed.d.ts +0 -27
- package/dist/commands/seed.d.ts.map +0 -1
- package/dist/commands/seed.js +0 -303
- package/dist/commands/seed.js.map +0 -1
- package/dist/commands/services-tls.d.ts +0 -120
- package/dist/commands/services-tls.d.ts.map +0 -1
- package/dist/commands/services-tls.js +0 -489
- package/dist/commands/services-tls.js.map +0 -1
- package/dist/commands/services.d.ts +0 -218
- package/dist/commands/services.d.ts.map +0 -1
- package/dist/commands/services.js +0 -830
- package/dist/commands/services.js.map +0 -1
- package/dist/commands/setup-linux-gate.d.ts +0 -26
- package/dist/commands/setup-linux-gate.d.ts.map +0 -1
- package/dist/commands/setup-linux-gate.js +0 -40
- package/dist/commands/setup-linux-gate.js.map +0 -1
- package/dist/commands/setup-metrics.d.ts +0 -26
- package/dist/commands/setup-metrics.d.ts.map +0 -1
- package/dist/commands/setup-metrics.js +0 -56
- package/dist/commands/setup-metrics.js.map +0 -1
- package/dist/commands/setup-phase-5a-skill-source.d.ts +0 -84
- package/dist/commands/setup-phase-5a-skill-source.d.ts.map +0 -1
- package/dist/commands/setup-phase-5a-skill-source.js +0 -259
- package/dist/commands/setup-phase-5a-skill-source.js.map +0 -1
- package/dist/commands/setup-phase-5b-project-sweep.d.ts +0 -38
- package/dist/commands/setup-phase-5b-project-sweep.d.ts.map +0 -1
- package/dist/commands/setup-phase-5b-project-sweep.js +0 -175
- package/dist/commands/setup-phase-5b-project-sweep.js.map +0 -1
- package/dist/commands/setup-phase-8-kg-hook.d.ts +0 -48
- package/dist/commands/setup-phase-8-kg-hook.d.ts.map +0 -1
- package/dist/commands/setup-phase-8-kg-hook.js +0 -93
- package/dist/commands/setup-phase-8-kg-hook.js.map +0 -1
- package/dist/commands/setup-phase-9-memory-bridge.d.ts +0 -36
- package/dist/commands/setup-phase-9-memory-bridge.d.ts.map +0 -1
- package/dist/commands/setup-phase-9-memory-bridge.js +0 -59
- package/dist/commands/setup-phase-9-memory-bridge.js.map +0 -1
- package/dist/commands/setup.d.ts +0 -231
- package/dist/commands/setup.d.ts.map +0 -1
- package/dist/commands/setup.js +0 -1374
- package/dist/commands/setup.js.map +0 -1
- package/dist/commands/skills-100x.d.ts +0 -34
- package/dist/commands/skills-100x.d.ts.map +0 -1
- package/dist/commands/skills-100x.js +0 -405
- package/dist/commands/skills-100x.js.map +0 -1
- package/dist/commands/skills-doctor.d.ts +0 -14
- package/dist/commands/skills-doctor.d.ts.map +0 -1
- package/dist/commands/skills-doctor.js +0 -126
- package/dist/commands/skills-doctor.js.map +0 -1
- package/dist/commands/skills-hook.d.ts +0 -19
- package/dist/commands/skills-hook.d.ts.map +0 -1
- package/dist/commands/skills-hook.js +0 -99
- package/dist/commands/skills-hook.js.map +0 -1
- package/dist/commands/skills-install-model-router.d.ts +0 -20
- package/dist/commands/skills-install-model-router.d.ts.map +0 -1
- package/dist/commands/skills-install-model-router.js +0 -55
- package/dist/commands/skills-install-model-router.js.map +0 -1
- package/dist/commands/skills-migrate-back.d.ts +0 -21
- package/dist/commands/skills-migrate-back.d.ts.map +0 -1
- package/dist/commands/skills-migrate-back.js +0 -222
- package/dist/commands/skills-migrate-back.js.map +0 -1
- package/dist/commands/skills-migrate-hooks-back.d.ts +0 -19
- package/dist/commands/skills-migrate-hooks-back.d.ts.map +0 -1
- package/dist/commands/skills-migrate-hooks-back.js +0 -83
- package/dist/commands/skills-migrate-hooks-back.js.map +0 -1
- package/dist/commands/skills-migrate-hooks.d.ts +0 -40
- package/dist/commands/skills-migrate-hooks.d.ts.map +0 -1
- package/dist/commands/skills-migrate-hooks.js +0 -178
- package/dist/commands/skills-migrate-hooks.js.map +0 -1
- package/dist/commands/skills-migrate.d.ts +0 -33
- package/dist/commands/skills-migrate.d.ts.map +0 -1
- package/dist/commands/skills-migrate.js +0 -216
- package/dist/commands/skills-migrate.js.map +0 -1
- package/dist/commands/skills-onboard.d.ts +0 -26
- package/dist/commands/skills-onboard.d.ts.map +0 -1
- package/dist/commands/skills-onboard.js +0 -230
- package/dist/commands/skills-onboard.js.map +0 -1
- package/dist/commands/skills-shadow-backups.d.ts +0 -15
- package/dist/commands/skills-shadow-backups.d.ts.map +0 -1
- package/dist/commands/skills-shadow-backups.js +0 -132
- package/dist/commands/skills-shadow-backups.js.map +0 -1
- package/dist/commands/skills-source.d.ts +0 -61
- package/dist/commands/skills-source.d.ts.map +0 -1
- package/dist/commands/skills-source.js +0 -895
- package/dist/commands/skills-source.js.map +0 -1
- package/dist/commands/skills.d.ts +0 -59
- package/dist/commands/skills.d.ts.map +0 -1
- package/dist/commands/skills.js +0 -461
- package/dist/commands/skills.js.map +0 -1
- package/dist/commands/status.d.ts +0 -65
- package/dist/commands/status.d.ts.map +0 -1
- package/dist/commands/status.js +0 -249
- package/dist/commands/status.js.map +0 -1
- package/dist/commands/stop.d.ts +0 -10
- package/dist/commands/stop.d.ts.map +0 -1
- package/dist/commands/stop.js +0 -17
- package/dist/commands/stop.js.map +0 -1
- package/dist/commands/substrate-audit-log.d.ts +0 -51
- package/dist/commands/substrate-audit-log.d.ts.map +0 -1
- package/dist/commands/substrate-audit-log.js +0 -161
- package/dist/commands/substrate-audit-log.js.map +0 -1
- package/dist/commands/substrate.d.ts +0 -87
- package/dist/commands/substrate.d.ts.map +0 -1
- package/dist/commands/substrate.js +0 -194
- package/dist/commands/substrate.js.map +0 -1
- package/dist/commands/update.d.ts +0 -89
- package/dist/commands/update.d.ts.map +0 -1
- package/dist/commands/update.js +0 -331
- package/dist/commands/update.js.map +0 -1
- package/dist/commands/upgrade-history.d.ts +0 -15
- package/dist/commands/upgrade-history.d.ts.map +0 -1
- package/dist/commands/upgrade-history.js +0 -34
- package/dist/commands/upgrade-history.js.map +0 -1
- package/dist/commands/upgrade-lock.d.ts +0 -93
- package/dist/commands/upgrade-lock.d.ts.map +0 -1
- package/dist/commands/upgrade-lock.js +0 -225
- package/dist/commands/upgrade-lock.js.map +0 -1
- package/dist/commands/upgrade-log.d.ts +0 -86
- package/dist/commands/upgrade-log.d.ts.map +0 -1
- package/dist/commands/upgrade-log.js +0 -146
- package/dist/commands/upgrade-log.js.map +0 -1
- package/dist/commands/upgrade.d.ts +0 -445
- package/dist/commands/upgrade.d.ts.map +0 -1
- package/dist/commands/upgrade.js +0 -1718
- package/dist/commands/upgrade.js.map +0 -1
- package/dist/commands/workspace-list-json.d.ts +0 -73
- package/dist/commands/workspace-list-json.d.ts.map +0 -1
- package/dist/commands/workspace-list-json.js +0 -59
- package/dist/commands/workspace-list-json.js.map +0 -1
- package/dist/commands/workspace.d.ts +0 -23
- package/dist/commands/workspace.d.ts.map +0 -1
- package/dist/commands/workspace.js +0 -203
- package/dist/commands/workspace.js.map +0 -1
- package/dist/commands/world-snapshot.d.ts +0 -32
- package/dist/commands/world-snapshot.d.ts.map +0 -1
- package/dist/commands/world-snapshot.js +0 -531
- package/dist/commands/world-snapshot.js.map +0 -1
- package/dist/commands/world-upgrade.d.ts +0 -33
- package/dist/commands/world-upgrade.d.ts.map +0 -1
- package/dist/commands/world-upgrade.js +0 -82
- package/dist/commands/world-upgrade.js.map +0 -1
- package/dist/commands/world.d.ts +0 -12
- package/dist/commands/world.d.ts.map +0 -1
- package/dist/commands/world.js +0 -18
- package/dist/commands/world.js.map +0 -1
- package/dist/commands/worldspec/compile.d.ts +0 -20
- package/dist/commands/worldspec/compile.d.ts.map +0 -1
- package/dist/commands/worldspec/compile.js +0 -130
- package/dist/commands/worldspec/compile.js.map +0 -1
- package/dist/commands/worldspec/index.d.ts +0 -12
- package/dist/commands/worldspec/index.d.ts.map +0 -1
- package/dist/commands/worldspec/index.js +0 -23
- package/dist/commands/worldspec/index.js.map +0 -1
- package/dist/commands/worldspec/init.d.ts +0 -15
- package/dist/commands/worldspec/init.d.ts.map +0 -1
- package/dist/commands/worldspec/init.js +0 -166
- package/dist/commands/worldspec/init.js.map +0 -1
- package/dist/commands/worldspec/schema.d.ts +0 -11
- package/dist/commands/worldspec/schema.d.ts.map +0 -1
- package/dist/commands/worldspec/schema.js +0 -55
- package/dist/commands/worldspec/schema.js.map +0 -1
- package/dist/commands/worldspec/validate.d.ts +0 -15
- package/dist/commands/worldspec/validate.d.ts.map +0 -1
- package/dist/commands/worldspec/validate.js +0 -66
- package/dist/commands/worldspec/validate.js.map +0 -1
- package/dist/commands/yolo.d.ts +0 -95
- package/dist/commands/yolo.d.ts.map +0 -1
- package/dist/commands/yolo.js +0 -377
- package/dist/commands/yolo.js.map +0 -1
- package/dist/context.d.ts +0 -30
- package/dist/context.d.ts.map +0 -1
- package/dist/context.js +0 -56
- package/dist/context.js.map +0 -1
- package/dist/docker-host.d.ts +0 -18
- package/dist/docker-host.d.ts.map +0 -1
- package/dist/docker-host.js +0 -17
- package/dist/docker-host.js.map +0 -1
- package/dist/exit-codes.d.ts +0 -67
- package/dist/exit-codes.d.ts.map +0 -1
- package/dist/exit-codes.js +0 -67
- package/dist/exit-codes.js.map +0 -1
- package/dist/from-manifest.d.ts +0 -53
- package/dist/from-manifest.d.ts.map +0 -1
- package/dist/from-manifest.js +0 -95
- package/dist/from-manifest.js.map +0 -1
- package/dist/image-presence.d.ts +0 -40
- package/dist/image-presence.d.ts.map +0 -1
- package/dist/image-presence.js +0 -39
- package/dist/image-presence.js.map +0 -1
- package/dist/index.d.ts +0 -9
- package/dist/index.d.ts.map +0 -1
- package/dist/install-root.d.ts +0 -74
- package/dist/install-root.d.ts.map +0 -1
- package/dist/install-root.js +0 -98
- package/dist/install-root.js.map +0 -1
- package/dist/lib/anthropic-base-url-file.d.ts +0 -37
- package/dist/lib/anthropic-base-url-file.d.ts.map +0 -1
- package/dist/lib/anthropic-base-url-file.js +0 -46
- package/dist/lib/anthropic-base-url-file.js.map +0 -1
- package/dist/lib/auth-backend.d.ts +0 -168
- package/dist/lib/auth-backend.d.ts.map +0 -1
- package/dist/lib/auth-backend.js +0 -172
- package/dist/lib/auth-backend.js.map +0 -1
- package/dist/lib/auth-list-cache.d.ts +0 -67
- package/dist/lib/auth-list-cache.d.ts.map +0 -1
- package/dist/lib/auth-list-cache.js +0 -84
- package/dist/lib/auth-list-cache.js.map +0 -1
- package/dist/lib/auth-list.d.ts +0 -107
- package/dist/lib/auth-list.d.ts.map +0 -1
- package/dist/lib/auth-list.js +0 -123
- package/dist/lib/auth-list.js.map +0 -1
- package/dist/lib/auth-login.d.ts +0 -92
- package/dist/lib/auth-login.d.ts.map +0 -1
- package/dist/lib/auth-login.js +0 -124
- package/dist/lib/auth-login.js.map +0 -1
- package/dist/lib/auth-mutator-backend.d.ts +0 -54
- package/dist/lib/auth-mutator-backend.d.ts.map +0 -1
- package/dist/lib/auth-mutator-backend.js +0 -62
- package/dist/lib/auth-mutator-backend.js.map +0 -1
- package/dist/lib/auth-refresh-kubernetes.d.ts +0 -65
- package/dist/lib/auth-refresh-kubernetes.d.ts.map +0 -1
- package/dist/lib/auth-refresh-kubernetes.js +0 -125
- package/dist/lib/auth-refresh-kubernetes.js.map +0 -1
- package/dist/lib/auth-remote.d.ts +0 -172
- package/dist/lib/auth-remote.d.ts.map +0 -1
- package/dist/lib/auth-remote.js +0 -394
- package/dist/lib/auth-remote.js.map +0 -1
- package/dist/lib/bootstrap-kubernetes.d.ts +0 -164
- package/dist/lib/bootstrap-kubernetes.d.ts.map +0 -1
- package/dist/lib/bootstrap-kubernetes.js +0 -1002
- package/dist/lib/bootstrap-kubernetes.js.map +0 -1
- package/dist/lib/build-if-stale.d.ts +0 -33
- package/dist/lib/build-if-stale.d.ts.map +0 -1
- package/dist/lib/build-if-stale.js +0 -156
- package/dist/lib/build-if-stale.js.map +0 -1
- package/dist/lib/bundle-freshness.d.ts +0 -57
- package/dist/lib/bundle-freshness.d.ts.map +0 -1
- package/dist/lib/bundle-freshness.js +0 -223
- package/dist/lib/bundle-freshness.js.map +0 -1
- package/dist/lib/bundle-source.d.ts +0 -52
- package/dist/lib/bundle-source.d.ts.map +0 -1
- package/dist/lib/bundle-source.js +0 -83
- package/dist/lib/bundle-source.js.map +0 -1
- package/dist/lib/cf-access-token.d.ts +0 -32
- package/dist/lib/cf-access-token.d.ts.map +0 -1
- package/dist/lib/cf-access-token.js +0 -51
- package/dist/lib/cf-access-token.js.map +0 -1
- package/dist/lib/completion-generator.d.ts +0 -107
- package/dist/lib/completion-generator.d.ts.map +0 -1
- package/dist/lib/completion-generator.js +0 -226
- package/dist/lib/completion-generator.js.map +0 -1
- package/dist/lib/config.d.ts +0 -114
- package/dist/lib/config.d.ts.map +0 -1
- package/dist/lib/config.js +0 -246
- package/dist/lib/config.js.map +0 -1
- package/dist/lib/flywheel-probes.d.ts +0 -58
- package/dist/lib/flywheel-probes.d.ts.map +0 -1
- package/dist/lib/flywheel-probes.js +0 -163
- package/dist/lib/flywheel-probes.js.map +0 -1
- package/dist/lib/health-probes.d.ts +0 -267
- package/dist/lib/health-probes.d.ts.map +0 -1
- package/dist/lib/health-probes.js +0 -933
- package/dist/lib/health-probes.js.map +0 -1
- package/dist/lib/help-groups.d.ts +0 -36
- package/dist/lib/help-groups.d.ts.map +0 -1
- package/dist/lib/help-groups.js +0 -124
- package/dist/lib/help-groups.js.map +0 -1
- package/dist/lib/host-side-proxy.d.ts +0 -67
- package/dist/lib/host-side-proxy.d.ts.map +0 -1
- package/dist/lib/host-side-proxy.js +0 -177
- package/dist/lib/host-side-proxy.js.map +0 -1
- package/dist/lib/instrumentation.d.ts +0 -85
- package/dist/lib/instrumentation.d.ts.map +0 -1
- package/dist/lib/instrumentation.js +0 -104
- package/dist/lib/instrumentation.js.map +0 -1
- package/dist/lib/k8s-bootstrap.d.ts +0 -126
- package/dist/lib/k8s-bootstrap.d.ts.map +0 -1
- package/dist/lib/k8s-bootstrap.js +0 -218
- package/dist/lib/k8s-bootstrap.js.map +0 -1
- package/dist/lib/k8s-context-discovery.d.ts +0 -80
- package/dist/lib/k8s-context-discovery.d.ts.map +0 -1
- package/dist/lib/k8s-context-discovery.js +0 -102
- package/dist/lib/k8s-context-discovery.js.map +0 -1
- package/dist/lib/k8s-secret-render.d.ts +0 -141
- package/dist/lib/k8s-secret-render.d.ts.map +0 -1
- package/dist/lib/k8s-secret-render.js +0 -318
- package/dist/lib/k8s-secret-render.js.map +0 -1
- package/dist/lib/kg-caps.d.ts +0 -19
- package/dist/lib/kg-caps.d.ts.map +0 -1
- package/dist/lib/kg-caps.js +0 -19
- package/dist/lib/kg-caps.js.map +0 -1
- package/dist/lib/kubectl-context.d.ts +0 -87
- package/dist/lib/kubectl-context.d.ts.map +0 -1
- package/dist/lib/kubectl-context.js +0 -105
- package/dist/lib/kubectl-context.js.map +0 -1
- package/dist/lib/kubectl-wrap.d.ts +0 -65
- package/dist/lib/kubectl-wrap.d.ts.map +0 -1
- package/dist/lib/kubectl-wrap.js +0 -135
- package/dist/lib/kubectl-wrap.js.map +0 -1
- package/dist/lib/manifest-refresh.d.ts +0 -136
- package/dist/lib/manifest-refresh.d.ts.map +0 -1
- package/dist/lib/manifest-refresh.js +0 -298
- package/dist/lib/manifest-refresh.js.map +0 -1
- package/dist/lib/memory-host-process-migration.d.ts +0 -56
- package/dist/lib/memory-host-process-migration.d.ts.map +0 -1
- package/dist/lib/memory-host-process-migration.js +0 -156
- package/dist/lib/memory-host-process-migration.js.map +0 -1
- package/dist/lib/memory-secret.d.ts +0 -83
- package/dist/lib/memory-secret.d.ts.map +0 -1
- package/dist/lib/memory-secret.js +0 -147
- package/dist/lib/memory-secret.js.map +0 -1
- package/dist/lib/peripheral-registry.d.ts +0 -53
- package/dist/lib/peripheral-registry.d.ts.map +0 -1
- package/dist/lib/peripheral-registry.js +0 -73
- package/dist/lib/peripheral-registry.js.map +0 -1
- package/dist/lib/plans-client.d.ts +0 -69
- package/dist/lib/plans-client.d.ts.map +0 -1
- package/dist/lib/plans-client.js +0 -140
- package/dist/lib/plans-client.js.map +0 -1
- package/dist/lib/port-forward.d.ts +0 -168
- package/dist/lib/port-forward.d.ts.map +0 -1
- package/dist/lib/port-forward.js +0 -393
- package/dist/lib/port-forward.js.map +0 -1
- package/dist/lib/shell-rc.d.ts +0 -90
- package/dist/lib/shell-rc.d.ts.map +0 -1
- package/dist/lib/shell-rc.js +0 -91
- package/dist/lib/shell-rc.js.map +0 -1
- package/dist/lib/shim-generator.d.ts +0 -51
- package/dist/lib/shim-generator.d.ts.map +0 -1
- package/dist/lib/shim-generator.js +0 -88
- package/dist/lib/shim-generator.js.map +0 -1
- package/dist/lib/skills-apply-overlays.d.ts +0 -35
- package/dist/lib/skills-apply-overlays.d.ts.map +0 -1
- package/dist/lib/skills-apply-overlays.js +0 -243
- package/dist/lib/skills-apply-overlays.js.map +0 -1
- package/dist/lib/symlink-reconcile.d.ts +0 -32
- package/dist/lib/symlink-reconcile.d.ts.map +0 -1
- package/dist/lib/symlink-reconcile.js +0 -80
- package/dist/lib/symlink-reconcile.js.map +0 -1
- package/dist/lib/upgrade-check.d.ts +0 -60
- package/dist/lib/upgrade-check.d.ts.map +0 -1
- package/dist/lib/upgrade-check.js +0 -169
- package/dist/lib/upgrade-check.js.map +0 -1
- package/dist/lib/upgrade-kubernetes.d.ts +0 -193
- package/dist/lib/upgrade-kubernetes.d.ts.map +0 -1
- package/dist/lib/upgrade-kubernetes.js +0 -1014
- package/dist/lib/upgrade-kubernetes.js.map +0 -1
- package/dist/lib/world-mcp-register.d.ts +0 -98
- package/dist/lib/world-mcp-register.d.ts.map +0 -1
- package/dist/lib/world-mcp-register.js +0 -117
- package/dist/lib/world-mcp-register.js.map +0 -1
- package/dist/output.d.ts +0 -10
- package/dist/output.d.ts.map +0 -1
- package/dist/output.js +0 -31
- package/dist/output.js.map +0 -1
- package/dist/pleri-config.d.ts +0 -22
- package/dist/pleri-config.d.ts.map +0 -1
- package/dist/pleri-config.js +0 -42
- package/dist/pleri-config.js.map +0 -1
- package/dist/protocol-version.d.ts +0 -79
- package/dist/protocol-version.d.ts.map +0 -1
- package/dist/protocol-version.js +0 -133
- package/dist/protocol-version.js.map +0 -1
- package/dist/registry-allowlist.d.ts +0 -47
- package/dist/registry-allowlist.d.ts.map +0 -1
- package/dist/registry-allowlist.js +0 -67
- package/dist/registry-allowlist.js.map +0 -1
- package/dist/spawn/home-override.d.ts +0 -82
- package/dist/spawn/home-override.d.ts.map +0 -1
- package/dist/spawn/home-override.js +0 -107
- package/dist/spawn/home-override.js.map +0 -1
- package/host-cp/src/linear-sync.mjs +0 -43
package/dist/commands/auth.js
DELETED
|
@@ -1,784 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* olam auth — Manage the local auth container (the long-lived Linux container
|
|
3
|
-
* that runs the same OAuth PKCE dance as the Cloudflare Worker and stores
|
|
4
|
-
* Claude tokens in a named docker volume).
|
|
5
|
-
*
|
|
6
|
-
* Subcommands (local):
|
|
7
|
-
* olam auth up — start the auth container (idempotent)
|
|
8
|
-
* olam auth down — stop the auth container
|
|
9
|
-
* olam auth status — show container state + account summary
|
|
10
|
-
* olam auth login — run PKCE login flow (one-time per host)
|
|
11
|
-
* olam auth logout — remove an account from the container
|
|
12
|
-
* olam auth refresh — force-refresh a token
|
|
13
|
-
*
|
|
14
|
-
* Subcommands (remote auth-worker — e4/e5/e6):
|
|
15
|
-
* olam auth login --remote <url> — print OAuth URL to open in browser (v1 dogfood)
|
|
16
|
-
* olam auth bind-service-token --remote <url> ... — bind a CF service token to a user sub
|
|
17
|
-
* olam auth list --remote <url> — list accounts + service tokens on remote worker
|
|
18
|
-
* olam auth migrate-to-remote --url <url> — guidance: re-OAuth each local account remotely
|
|
19
|
-
* olam auth rotate-service-token --url <url> ... — revoke + re-bind a service token
|
|
20
|
-
* olam auth doctor --auth-worker <url> — 4-probe health check against the auth-worker
|
|
21
|
-
*
|
|
22
|
-
* V1 dogfood note (e4/e5):
|
|
23
|
-
* CF Access cookie-bridging is the core UX constraint. Full CLI-orchestrated
|
|
24
|
-
* browser flow (the CLI as its own OAuth client for CF Access) is complex and
|
|
25
|
-
* deferred to v2. V1 uses a "print the URL; operator completes in browser;
|
|
26
|
-
* CLI re-checks via list --remote" model for login, and a "paste cookie from
|
|
27
|
-
* DevTools" model for service-token binding.
|
|
28
|
-
*/
|
|
29
|
-
import pc from 'picocolors';
|
|
30
|
-
import { AuthClient, AuthContainerController, runAuthPreflight, } from '@olam/core/src/auth/index.js';
|
|
31
|
-
import { printError, printHeader, printInfo, printSuccess, printWarning } from '../output.js';
|
|
32
|
-
import * as readline from 'node:readline/promises';
|
|
33
|
-
import { spawn } from 'node:child_process';
|
|
34
|
-
import { runAuthStatus } from './auth-status.js';
|
|
35
|
-
import { registerAuthUpgrade } from './auth-upgrade.js';
|
|
36
|
-
import { resolveTokenLabel, writeAnthropicBaseUrlFile } from '../lib/anthropic-base-url-file.js';
|
|
37
|
-
import { servicesUp, servicesDown, servicesStatus } from './services.js';
|
|
38
|
-
import { readConfig } from '../lib/config.js';
|
|
39
|
-
import { applyK8sAuthRefresh, resolveKubectlContext, } from '../lib/auth-refresh-kubernetes.js';
|
|
40
|
-
import { remoteOAuthStart, remoteListServiceTokens, remoteListAccounts, remoteBindServiceToken, remoteDeleteServiceToken, remoteIssueAnthropicToken, remoteListAnthropicTokens, remoteRevokeAnthropicToken, runDoctorChecks, } from '../lib/auth-remote.js';
|
|
41
|
-
import { resolveCfAccessServiceToken } from '../lib/cf-access-token.js';
|
|
42
|
-
import { renderAuthListJson, renderRemoteAuthListJson } from './auth-list-json.js';
|
|
43
|
-
import { runAuthLogin } from '../lib/auth-login.js';
|
|
44
|
-
import { runAuthList, } from '../lib/auth-list.js';
|
|
45
|
-
import { resolveMutatorBackend, } from '../lib/auth-mutator-backend.js';
|
|
46
|
-
import { registerAuthMigrate } from './auth-migrate.js';
|
|
47
|
-
/**
|
|
48
|
-
* Best-effort browser opener. Uses the host's native "open URL" command:
|
|
49
|
-
* `open` on macOS, `xdg-open` on Linux, `start` on Windows. Silently
|
|
50
|
-
* no-ops on failure — the URL is still printed for manual copy.
|
|
51
|
-
*/
|
|
52
|
-
function openBrowser(url) {
|
|
53
|
-
const cmd = process.platform === 'darwin' ? 'open' :
|
|
54
|
-
process.platform === 'win32' ? 'start' :
|
|
55
|
-
'xdg-open';
|
|
56
|
-
try {
|
|
57
|
-
const child = spawn(cmd, [url], { detached: true, stdio: 'ignore' });
|
|
58
|
-
child.unref();
|
|
59
|
-
}
|
|
60
|
-
catch {
|
|
61
|
-
// Ignore — caller already printed the URL.
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* B4 (narrowed) — render an `olam auth list` result to stdout. Returns the
|
|
66
|
-
* desired exit code (0 = success; 1 = error). Pulled out of the action body
|
|
67
|
-
* so the orchestration in `runAuthList` is testable without driving the
|
|
68
|
-
* Commander.js scaffolding.
|
|
69
|
-
*/
|
|
70
|
-
function renderAuthList(result, opts) {
|
|
71
|
-
if (result.mode === 'error') {
|
|
72
|
-
if (opts.json) {
|
|
73
|
-
console.log(JSON.stringify({ error: result.message }));
|
|
74
|
-
}
|
|
75
|
-
else {
|
|
76
|
-
printError(result.message);
|
|
77
|
-
}
|
|
78
|
-
return result.exitCode;
|
|
79
|
-
}
|
|
80
|
-
if (result.mode === 'local') {
|
|
81
|
-
if (!result.reachable) {
|
|
82
|
-
if (opts.json) {
|
|
83
|
-
console.log(JSON.stringify({ error: 'auth-container-unreachable', reachable: false }));
|
|
84
|
-
return 1;
|
|
85
|
-
}
|
|
86
|
-
printError('Auth container is not reachable. Run `olam services up` first.');
|
|
87
|
-
return 1;
|
|
88
|
-
}
|
|
89
|
-
if (opts.json) {
|
|
90
|
-
console.log(renderAuthListJson(result.accounts));
|
|
91
|
-
return 0;
|
|
92
|
-
}
|
|
93
|
-
printHeader(`Credentials (${result.accounts.length})`);
|
|
94
|
-
if (result.accounts.length === 0) {
|
|
95
|
-
console.log(` ${pc.dim('No credentials — run: olam auth login --label primary')}`);
|
|
96
|
-
return 0;
|
|
97
|
-
}
|
|
98
|
-
const stateColor = (s) => {
|
|
99
|
-
if (s === 'active')
|
|
100
|
-
return pc.green('active');
|
|
101
|
-
if (s === 'cooldown')
|
|
102
|
-
return pc.yellow('cooldown');
|
|
103
|
-
if (s === 'expired')
|
|
104
|
-
return pc.red('expired');
|
|
105
|
-
if (s === 'disabled')
|
|
106
|
-
return pc.dim('disabled');
|
|
107
|
-
return pc.dim(s ?? 'unknown');
|
|
108
|
-
};
|
|
109
|
-
for (const a of result.accounts) {
|
|
110
|
-
const label = a.accountLabel ?? a.id;
|
|
111
|
-
const reqs = a.usage?.requestCount5h ?? 0;
|
|
112
|
-
const last429 = a.usage?.last429At
|
|
113
|
-
? `last429=${a.usage.last429At}`
|
|
114
|
-
: 'last429=never';
|
|
115
|
-
const reset = a.rateLimitResetsAt ? `resets=${a.rateLimitResetsAt}` : '';
|
|
116
|
-
console.log(` ${pc.bold(label.padEnd(18))} ${stateColor(a.state).padEnd(18)} ` +
|
|
117
|
-
`${pc.dim(`req5h=${reqs}`)} ${pc.dim(`exp=${a.expiresIn}`)} ${pc.dim(last429)} ${pc.yellow(reset)}`);
|
|
118
|
-
}
|
|
119
|
-
return 0;
|
|
120
|
-
}
|
|
121
|
-
// remote
|
|
122
|
-
if (opts.json) {
|
|
123
|
-
console.log(renderRemoteAuthListJson(result.accounts, result.stale, result.fetchedAt));
|
|
124
|
-
return 0;
|
|
125
|
-
}
|
|
126
|
-
const staleSuffix = result.stale ? pc.yellow(' (stale)') : '';
|
|
127
|
-
printHeader(`Remote accounts (${result.accounts.length})${staleSuffix}`);
|
|
128
|
-
if (result.accounts.length === 0) {
|
|
129
|
-
console.log(` ${pc.dim('No accounts — run: olam auth login --remote ' + result.baseUrl)}`);
|
|
130
|
-
}
|
|
131
|
-
else {
|
|
132
|
-
for (const a of result.accounts) {
|
|
133
|
-
const label = a.label ?? a.id;
|
|
134
|
-
const state = a.state ?? 'unknown';
|
|
135
|
-
const exp = a.expiresIn ?? '';
|
|
136
|
-
console.log(` ${pc.bold(label.padEnd(20))} ${pc.green(state).padEnd(16)} ${pc.dim(exp)}`);
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
if (result.stale) {
|
|
140
|
-
const fetchedAtIso = new Date(result.fetchedAt).toISOString();
|
|
141
|
-
console.log(`\n ${pc.yellow('warning:')} showing cached results from ${fetchedAtIso}; ` +
|
|
142
|
-
`fresh fetch failed (${result.fetchError ?? 'unknown error'}).`);
|
|
143
|
-
console.log(` ${pc.dim('Retry with --no-cache once connectivity is restored.')}`);
|
|
144
|
-
}
|
|
145
|
-
return 0;
|
|
146
|
-
}
|
|
147
|
-
/**
|
|
148
|
-
* B4 (narrowed) — adapter around `resolveMutatorBackend` for the three
|
|
149
|
-
* local-only mutator subcommands. Prints the message body to stderr and
|
|
150
|
-
* returns the desired exit code (0 = proceed locally; non-zero = stop).
|
|
151
|
-
*/
|
|
152
|
-
function handleMutatorBackend(subcommand, opts) {
|
|
153
|
-
const outcome = resolveMutatorBackend(subcommand, opts);
|
|
154
|
-
if (outcome.outcome === 'proceed-local')
|
|
155
|
-
return 0;
|
|
156
|
-
if (outcome.outcome === 'conflict') {
|
|
157
|
-
process.stderr.write(`Error: ${outcome.message}\n`);
|
|
158
|
-
return 1;
|
|
159
|
-
}
|
|
160
|
-
// remote-unsupported
|
|
161
|
-
process.stderr.write(`Error: ${outcome.message}\n`);
|
|
162
|
-
return outcome.exitCode;
|
|
163
|
-
}
|
|
164
|
-
async function promptLine(question) {
|
|
165
|
-
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
166
|
-
try {
|
|
167
|
-
const answer = await rl.question(question);
|
|
168
|
-
return answer.trim();
|
|
169
|
-
}
|
|
170
|
-
finally {
|
|
171
|
-
rl.close();
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
export function registerAuth(program) {
|
|
175
|
-
const auth = program
|
|
176
|
-
.command('auth')
|
|
177
|
-
.description('Manage the local Claude auth container');
|
|
178
|
-
auth
|
|
179
|
-
.command('up')
|
|
180
|
-
.description('[deprecated] Start the auth container — use `olam services up` instead')
|
|
181
|
-
.action(async () => {
|
|
182
|
-
printWarning('`olam auth up` is deprecated. Use `olam services up` instead.');
|
|
183
|
-
const result = await servicesUp();
|
|
184
|
-
if (result.exitCode !== 0)
|
|
185
|
-
process.exitCode = result.exitCode;
|
|
186
|
-
});
|
|
187
|
-
auth
|
|
188
|
-
.command('down')
|
|
189
|
-
.description('[deprecated] Stop the auth container — use `olam services down` instead')
|
|
190
|
-
.action(() => {
|
|
191
|
-
printWarning('`olam auth down` is deprecated. Use `olam services down` instead.');
|
|
192
|
-
const result = servicesDown();
|
|
193
|
-
if (result.exitCode !== 0)
|
|
194
|
-
process.exitCode = result.exitCode;
|
|
195
|
-
});
|
|
196
|
-
auth
|
|
197
|
-
.command('status')
|
|
198
|
-
.description('[deprecated] Show container state — use `olam services status` instead')
|
|
199
|
-
.action(() => {
|
|
200
|
-
printWarning('`olam auth status` is deprecated. Use `olam services status` instead.');
|
|
201
|
-
servicesStatus();
|
|
202
|
-
});
|
|
203
|
-
auth
|
|
204
|
-
.command('disable')
|
|
205
|
-
.description('Take a credential out of rotation (manual cooldown). LOCAL ONLY — no cloud equivalent yet (see OQ7 in docs/plans/cloud-only-vault/README.md).')
|
|
206
|
-
.argument('<label>', 'Credential label or id')
|
|
207
|
-
.option('--local', 'Explicit local backend (default — only backend supported today).')
|
|
208
|
-
.option('--remote [url]', 'Reserved — exits 2 with structured message pointing to OQ7.')
|
|
209
|
-
.action(async (label, opts) => {
|
|
210
|
-
const code = handleMutatorBackend('disable', opts);
|
|
211
|
-
if (code !== 0) {
|
|
212
|
-
process.exitCode = code;
|
|
213
|
-
return;
|
|
214
|
-
}
|
|
215
|
-
const client = new AuthClient();
|
|
216
|
-
try {
|
|
217
|
-
await client.disableAccount(label);
|
|
218
|
-
printSuccess(`Disabled: ${label}`);
|
|
219
|
-
}
|
|
220
|
-
catch (err) {
|
|
221
|
-
printError(err instanceof Error ? err.message : 'failed to disable');
|
|
222
|
-
process.exitCode = 1;
|
|
223
|
-
}
|
|
224
|
-
});
|
|
225
|
-
auth
|
|
226
|
-
.command('enable')
|
|
227
|
-
.description('Re-enable a disabled credential. LOCAL ONLY — no cloud equivalent yet (see OQ7 in docs/plans/cloud-only-vault/README.md).')
|
|
228
|
-
.argument('<label>', 'Credential label or id')
|
|
229
|
-
.option('--local', 'Explicit local backend (default — only backend supported today).')
|
|
230
|
-
.option('--remote [url]', 'Reserved — exits 2 with structured message pointing to OQ7.')
|
|
231
|
-
.action(async (label, opts) => {
|
|
232
|
-
const code = handleMutatorBackend('enable', opts);
|
|
233
|
-
if (code !== 0) {
|
|
234
|
-
process.exitCode = code;
|
|
235
|
-
return;
|
|
236
|
-
}
|
|
237
|
-
const client = new AuthClient();
|
|
238
|
-
try {
|
|
239
|
-
await client.enableAccount(label);
|
|
240
|
-
printSuccess(`Enabled: ${label}`);
|
|
241
|
-
}
|
|
242
|
-
catch (err) {
|
|
243
|
-
printError(err instanceof Error ? err.message : 'failed to enable');
|
|
244
|
-
process.exitCode = 1;
|
|
245
|
-
}
|
|
246
|
-
});
|
|
247
|
-
auth
|
|
248
|
-
.command('remove')
|
|
249
|
-
.description('Permanently remove a credential (purge tokens)')
|
|
250
|
-
.argument('<label>', 'Credential label or id')
|
|
251
|
-
.action(async (label) => {
|
|
252
|
-
const client = new AuthClient();
|
|
253
|
-
try {
|
|
254
|
-
await client.deleteAccount(label);
|
|
255
|
-
printSuccess(`Removed: ${label}`);
|
|
256
|
-
}
|
|
257
|
-
catch (err) {
|
|
258
|
-
printError(err instanceof Error ? err.message : 'failed to remove');
|
|
259
|
-
process.exitCode = 1;
|
|
260
|
-
}
|
|
261
|
-
});
|
|
262
|
-
auth
|
|
263
|
-
.command('login')
|
|
264
|
-
.description('Log into the cloud auth-worker by default (Phase B); use --local to opt into the legacy local auth-service container PKCE flow.')
|
|
265
|
-
.option('--label <label>', 'Account label (e.g. primary, burner-1). Defaults to "primary" for the first account, "burner-N" thereafter.')
|
|
266
|
-
.option('--local', 'Opt into the deprecated local auth-service container PKCE flow. Emits a deprecation warning.')
|
|
267
|
-
.option('--remote [url]', 'Force remote login. Optionally accepts an explicit auth-worker URL (back-compat); without a URL falls through to env/file/default discovery.')
|
|
268
|
-
.option('--yes, -y', 'Skip the first-time interactive confirm prompt before flipping to remote.')
|
|
269
|
-
.option('--print-url', 'Print the OAuth URL without attempting to open a browser (implied by --remote).')
|
|
270
|
-
.option('--service-token <client_id:secret>', 'Delegate to bind-service-token flow instead (use with --remote).')
|
|
271
|
-
.action(async (opts) => {
|
|
272
|
-
const result = await runAuthLogin(opts, {
|
|
273
|
-
promptConfirm: (question) => promptLine(question),
|
|
274
|
-
executeRemoteLogin: (baseUrl, o) => executeRemoteLogin(baseUrl, o),
|
|
275
|
-
executeLocalLogin: (o) => executeLocalLogin(o),
|
|
276
|
-
});
|
|
277
|
-
if (result.exitCode !== 0) {
|
|
278
|
-
process.exitCode = result.exitCode;
|
|
279
|
-
}
|
|
280
|
-
});
|
|
281
|
-
// ── Legacy login executors (extracted from the action body so runAuthLogin
|
|
282
|
-
// can drive them; behaviour preserved verbatim other than the --remote
|
|
283
|
-
// <url> form now arrives via the resolution-helper rather than opts.remote
|
|
284
|
-
// directly). ───────────────────────────────────────────────────────────────
|
|
285
|
-
async function executeRemoteLogin(baseUrl, opts) {
|
|
286
|
-
if (opts.serviceToken) {
|
|
287
|
-
// Delegate to bind-service-token flow
|
|
288
|
-
const parts = opts.serviceToken.split(':');
|
|
289
|
-
if (parts.length < 2) {
|
|
290
|
-
printError('--service-token must be in format <client_id>:<secret>');
|
|
291
|
-
process.exitCode = 1;
|
|
292
|
-
return;
|
|
293
|
-
}
|
|
294
|
-
const [clientId] = parts;
|
|
295
|
-
const label = opts.label ?? clientId ?? 'service-token';
|
|
296
|
-
printHeader('Auth worker — bind service token');
|
|
297
|
-
console.log(`\n ${pc.bold('Step 1:')} Open ${pc.cyan(baseUrl + '/v1/oauth/start')} in a browser.`);
|
|
298
|
-
console.log(` Complete CF Access SSO. You may see a JSON response or "no credentials" — that is normal.`);
|
|
299
|
-
const rawCookie = await promptLine(`\n ${pc.dim('Paste CF_Authorization cookie value (from DevTools > Application > Cookies):')} `);
|
|
300
|
-
if (!rawCookie) {
|
|
301
|
-
printError('No cookie provided. Aborting.');
|
|
302
|
-
process.exitCode = 1;
|
|
303
|
-
return;
|
|
304
|
-
}
|
|
305
|
-
const clientIdStr = clientId ?? '';
|
|
306
|
-
try {
|
|
307
|
-
await remoteBindServiceToken({ baseUrl, cfAuthCookie: rawCookie }, { client_id: clientIdStr, label });
|
|
308
|
-
printSuccess(`Service token bound: ${clientIdStr} (label=${label})`);
|
|
309
|
-
console.log(`\n${pc.dim('Set ANTHROPIC_BASE' + '_URL=' + baseUrl + '/v1/proxy in your shell to route Claude API calls through this worker.')}`);
|
|
310
|
-
}
|
|
311
|
-
catch (err) {
|
|
312
|
-
printError(err instanceof Error ? err.message : 'bind failed');
|
|
313
|
-
process.exitCode = 1;
|
|
314
|
-
}
|
|
315
|
-
return;
|
|
316
|
-
}
|
|
317
|
-
// Default: print (and optionally open) the OAuth start URL.
|
|
318
|
-
// V1 dogfood: browser completes the full flow (CF Access SSO → Anthropic
|
|
319
|
-
// OAuth → worker callback → token stored). CLI re-checks via `list --remote`.
|
|
320
|
-
// Full CLI-orchestrated cookie-bridging is deferred to v2.
|
|
321
|
-
let startUrl;
|
|
322
|
-
try {
|
|
323
|
-
const r = await remoteOAuthStart({ baseUrl });
|
|
324
|
-
startUrl = r.authorize_url;
|
|
325
|
-
}
|
|
326
|
-
catch {
|
|
327
|
-
// Fallback if /v1/oauth/start isn't reachable (CF Access gate, etc.)
|
|
328
|
-
startUrl = `${baseUrl.replace(/\/+$/, '')}/v1/oauth/start`;
|
|
329
|
-
}
|
|
330
|
-
printHeader('Auth worker — OAuth login (v1 dogfood)');
|
|
331
|
-
console.log(`\n ${pc.bold('1.')} Open this URL in your browser to authenticate via CF Access + Anthropic OAuth:`);
|
|
332
|
-
console.log(`\n ${pc.cyan(startUrl)}\n`);
|
|
333
|
-
console.log(` ${pc.bold('2.')} Complete the CF Access SSO and Anthropic OAuth consent.`);
|
|
334
|
-
console.log(` The worker stores your tokens on callback — the browser lands on a success page.`);
|
|
335
|
-
console.log(`\n ${pc.bold('3.')} Confirm your credentials are stored:\n`);
|
|
336
|
-
console.log(` ${pc.dim('olam auth list --remote ' + baseUrl)}\n`);
|
|
337
|
-
console.log(` ${pc.dim('Tokens written to cloud auth-worker. Full CLI-orchestrated browser SSO flow is deferred to v2.')}\n`);
|
|
338
|
-
if (!opts.printUrl) {
|
|
339
|
-
openBrowser(startUrl);
|
|
340
|
-
}
|
|
341
|
-
}
|
|
342
|
-
async function executeLocalLogin(opts) {
|
|
343
|
-
const preflight = await runAuthPreflight({ autoStart: true });
|
|
344
|
-
if (preflight.verdict !== 'ok' && preflight.verdict !== 'no-accounts') {
|
|
345
|
-
printError(preflight.message);
|
|
346
|
-
console.log(` ${pc.dim(preflight.remedy)}`);
|
|
347
|
-
process.exitCode = 1;
|
|
348
|
-
return;
|
|
349
|
-
}
|
|
350
|
-
const client = new AuthClient();
|
|
351
|
-
// Auto-pick a sensible label when the operator didn't supply one.
|
|
352
|
-
// First credential → "primary"; subsequent → "burner-N" with N
|
|
353
|
-
// chosen to dodge any existing label.
|
|
354
|
-
let label = opts.label;
|
|
355
|
-
if (!label) {
|
|
356
|
-
try {
|
|
357
|
-
const existing = await client.status();
|
|
358
|
-
if (existing.accounts.length === 0) {
|
|
359
|
-
label = 'primary';
|
|
360
|
-
}
|
|
361
|
-
else {
|
|
362
|
-
const usedLabels = new Set(existing.accounts.map((a) => a.accountLabel ?? a.id));
|
|
363
|
-
let n = 1;
|
|
364
|
-
while (usedLabels.has(`burner-${n}`))
|
|
365
|
-
n += 1;
|
|
366
|
-
label = `burner-${n}`;
|
|
367
|
-
}
|
|
368
|
-
}
|
|
369
|
-
catch {
|
|
370
|
-
label = 'primary';
|
|
371
|
-
}
|
|
372
|
-
}
|
|
373
|
-
let pending;
|
|
374
|
-
try {
|
|
375
|
-
pending = await client.startLogin(label);
|
|
376
|
-
}
|
|
377
|
-
catch (err) {
|
|
378
|
-
printError(err instanceof Error ? err.message : 'failed to start login');
|
|
379
|
-
process.exitCode = 1;
|
|
380
|
-
return;
|
|
381
|
-
}
|
|
382
|
-
printHeader('Claude OAuth — PKCE flow (legacy local container)');
|
|
383
|
-
console.log(`\n ${pc.bold('1.')} Opening Claude in your default browser…`);
|
|
384
|
-
console.log(` ${pc.dim(pending.loginUrl)}`);
|
|
385
|
-
openBrowser(pending.loginUrl);
|
|
386
|
-
console.log(`\n ${pc.bold('2.')} After approving, paste the authorization code from the redirect page.`);
|
|
387
|
-
console.log(` ${pc.dim('(Format: <code>#<state> or just <code>.)')}\n`);
|
|
388
|
-
const raw = await promptLine(`${pc.dim('code:')} `);
|
|
389
|
-
if (!raw) {
|
|
390
|
-
printError('No code provided.');
|
|
391
|
-
process.exitCode = 1;
|
|
392
|
-
return;
|
|
393
|
-
}
|
|
394
|
-
const [codePart, statePart] = raw.includes('#') ? raw.split('#', 2) : [raw, pending.state];
|
|
395
|
-
try {
|
|
396
|
-
const result = await client.completeLogin(statePart, codePart);
|
|
397
|
-
printSuccess(`Account stored: ${result.account} (${result.expiresIn})`);
|
|
398
|
-
console.log(`${pc.dim('Tokens written to ~/.olam/auth-data/accounts.json (deprecated; cloud is the new default).')}`);
|
|
399
|
-
console.log(`\n${pc.dim('Next: olam create --name my-world')}`);
|
|
400
|
-
}
|
|
401
|
-
catch (err) {
|
|
402
|
-
printError(err instanceof Error ? err.message : 'token exchange failed');
|
|
403
|
-
process.exitCode = 1;
|
|
404
|
-
}
|
|
405
|
-
}
|
|
406
|
-
auth
|
|
407
|
-
.command('logout')
|
|
408
|
-
.description('Remove an account from the auth container')
|
|
409
|
-
.argument('<account>', 'Account id')
|
|
410
|
-
.action(async (accountId) => {
|
|
411
|
-
const client = new AuthClient();
|
|
412
|
-
try {
|
|
413
|
-
await client.deleteAccount(accountId);
|
|
414
|
-
printSuccess(`Account removed: ${accountId}`);
|
|
415
|
-
}
|
|
416
|
-
catch (err) {
|
|
417
|
-
printError(err instanceof Error ? err.message : 'failed to delete account');
|
|
418
|
-
process.exitCode = 1;
|
|
419
|
-
}
|
|
420
|
-
});
|
|
421
|
-
auth
|
|
422
|
-
.command('refresh')
|
|
423
|
-
.description('Force-refresh an account token (substrate-aware: updates kubernetes Secret on k8s substrate). LOCAL ONLY — no cloud equivalent yet (see OQ7 in docs/plans/cloud-only-vault/README.md).')
|
|
424
|
-
.argument('<account>', 'Account id')
|
|
425
|
-
.option('--local', 'Explicit local backend (default — only backend supported today).')
|
|
426
|
-
.option('--remote [url]', 'Reserved — exits 2 with structured message pointing to OQ7.')
|
|
427
|
-
.action(async (accountId, opts) => {
|
|
428
|
-
const code = handleMutatorBackend('refresh', opts);
|
|
429
|
-
if (code !== 0) {
|
|
430
|
-
process.exitCode = code;
|
|
431
|
-
return;
|
|
432
|
-
}
|
|
433
|
-
const cfg = readConfig();
|
|
434
|
-
const isK8s = cfg.host.substrate === 'kubernetes';
|
|
435
|
-
// Kubernetes substrate: validate context before touching auth-service (SEC-NEW-003).
|
|
436
|
-
if (isK8s) {
|
|
437
|
-
const ctxResult = resolveKubectlContext();
|
|
438
|
-
if (ctxResult.error) {
|
|
439
|
-
printError(ctxResult.error);
|
|
440
|
-
process.exitCode = 1;
|
|
441
|
-
return;
|
|
442
|
-
}
|
|
443
|
-
if (ctxResult.deprecationWarning) {
|
|
444
|
-
printWarning(ctxResult.deprecationWarning);
|
|
445
|
-
}
|
|
446
|
-
}
|
|
447
|
-
const client = new AuthClient();
|
|
448
|
-
try {
|
|
449
|
-
const result = await client.refreshAccount(accountId);
|
|
450
|
-
printSuccess(`Refreshed ${result.account} (${result.expiresIn})`);
|
|
451
|
-
}
|
|
452
|
-
catch (err) {
|
|
453
|
-
printError(err instanceof Error ? err.message : 'refresh failed');
|
|
454
|
-
process.exitCode = 1;
|
|
455
|
-
return;
|
|
456
|
-
}
|
|
457
|
-
if (isK8s) {
|
|
458
|
-
const ctxResult = resolveKubectlContext();
|
|
459
|
-
if (ctxResult.context) {
|
|
460
|
-
const code = await applyK8sAuthRefresh(ctxResult.context);
|
|
461
|
-
if (code !== 0)
|
|
462
|
-
process.exitCode = code;
|
|
463
|
-
}
|
|
464
|
-
}
|
|
465
|
-
});
|
|
466
|
-
// ── e5: bind-service-token ──────────────────────────────────────────────
|
|
467
|
-
auth
|
|
468
|
-
.command('bind-service-token')
|
|
469
|
-
.description('Bind a Cloudflare service token to your CF Access user sub on the remote auth-worker')
|
|
470
|
-
.requiredOption('--remote <url>', 'Auth-worker base URL')
|
|
471
|
-
.requiredOption('--token <client_id:secret>', 'CF service token in format <client_id>:<secret>')
|
|
472
|
-
.option('--label <name>', 'Friendly label for this token (defaults to client_id)')
|
|
473
|
-
.action(async (opts) => {
|
|
474
|
-
const baseUrl = opts.remote;
|
|
475
|
-
const parts = opts.token.split(':');
|
|
476
|
-
if (parts.length < 2) {
|
|
477
|
-
printError('--token must be in format <client_id>:<secret>');
|
|
478
|
-
process.exitCode = 1;
|
|
479
|
-
return;
|
|
480
|
-
}
|
|
481
|
-
const [clientId] = parts;
|
|
482
|
-
const clientIdStr = clientId ?? '';
|
|
483
|
-
const label = opts.label ?? clientIdStr;
|
|
484
|
-
printHeader('Auth worker — bind service token');
|
|
485
|
-
console.log(`\n ${pc.bold('Step 1:')} Open the URL below in your browser to authenticate via CF Access SSO:`);
|
|
486
|
-
console.log(`\n ${pc.cyan(baseUrl.replace(/\/+$/, '') + '/v1/oauth/start')}\n`);
|
|
487
|
-
console.log(` You may see a JSON response or a "no credentials" page — that is normal.`);
|
|
488
|
-
console.log(` This establishes the session that associates your user sub with the binding.\n`);
|
|
489
|
-
await promptLine(` ${pc.dim('Press Enter once you have completed the CF Access SSO step...')}`);
|
|
490
|
-
const rawCookie = await promptLine(`\n ${pc.dim('Paste your CF_Authorization cookie value (DevTools > Application > Cookies > CF_Authorization):')} `);
|
|
491
|
-
if (!rawCookie) {
|
|
492
|
-
printError('No cookie provided. Aborting.');
|
|
493
|
-
process.exitCode = 1;
|
|
494
|
-
return;
|
|
495
|
-
}
|
|
496
|
-
try {
|
|
497
|
-
await remoteBindServiceToken({ baseUrl, cfAuthCookie: rawCookie }, { client_id: clientIdStr, label });
|
|
498
|
-
printSuccess(`Service token bound: ${clientIdStr} (label=${label})`);
|
|
499
|
-
console.log(`\n${pc.dim('Tip: set ANTHROPIC_BASE' + '_URL=' + baseUrl.replace(/\/+$/, '') + '/v1/proxy')}`);
|
|
500
|
-
console.log(`${pc.dim(' to route Claude API calls through this worker.')}\n`);
|
|
501
|
-
}
|
|
502
|
-
catch (err) {
|
|
503
|
-
printError(err instanceof Error ? err.message : 'bind failed');
|
|
504
|
-
process.exitCode = 1;
|
|
505
|
-
}
|
|
506
|
-
});
|
|
507
|
-
// ── B4 (narrowed): list defaults to cloud auth-worker ────────────────────
|
|
508
|
-
auth
|
|
509
|
-
.command('list')
|
|
510
|
-
.description('List credentials. Defaults to the cloud auth-worker (Phase B). Pass --local to read the legacy ~/.olam/auth-data/accounts.json (emits deprecation warning).')
|
|
511
|
-
.option('--local', 'Read the legacy local auth-service vault. Emits a deprecation warning.')
|
|
512
|
-
.option('--remote [url]', 'Force remote. Optionally accepts an explicit auth-worker URL; without one falls through to env/file/default discovery.')
|
|
513
|
-
.option('--cookie <value>', 'CF_Authorization cookie for authenticated requests (remote path)')
|
|
514
|
-
.option('--no-cache', 'Bypass the 30 s TTL cache and force a fresh fetch (remote path)')
|
|
515
|
-
.option('--json', 'Emit machine-readable JSON instead of the text table', false)
|
|
516
|
-
.action(async (opts) => {
|
|
517
|
-
const listOpts = {
|
|
518
|
-
local: opts.local,
|
|
519
|
-
remote: opts.remote,
|
|
520
|
-
cookie: opts.cookie,
|
|
521
|
-
// commander.js maps `--no-cache` to `cache: false`. Translate.
|
|
522
|
-
noCache: opts.cache === false,
|
|
523
|
-
json: opts.json,
|
|
524
|
-
};
|
|
525
|
-
const result = await runAuthList(listOpts, {
|
|
526
|
-
fetchRemoteAccounts: async (baseUrl, cookie) => {
|
|
527
|
-
return remoteListAccounts({ baseUrl, cfAuthCookie: cookie });
|
|
528
|
-
},
|
|
529
|
-
fetchLocalStatus: () => new AuthClient().status(),
|
|
530
|
-
});
|
|
531
|
-
const exitCode = renderAuthList(result, listOpts);
|
|
532
|
-
if (exitCode !== 0)
|
|
533
|
-
process.exitCode = exitCode;
|
|
534
|
-
});
|
|
535
|
-
// ── B3: `olam auth migrate` (one-shot migration tool) ──────────────────
|
|
536
|
-
registerAuthMigrate(auth);
|
|
537
|
-
// ── Deprecation pointer: old `migrate-to-remote` → `migrate` ────────────
|
|
538
|
-
// Phase B3 replaces the e6 placeholder. Operators with scripted invocations
|
|
539
|
-
// of the old name see a one-line pointer + exit 0 (no script breakage); the
|
|
540
|
-
// real auto-migration lives at `olam auth migrate` now.
|
|
541
|
-
auth
|
|
542
|
-
.command('migrate-to-remote')
|
|
543
|
-
.description('(deprecated) renamed to `olam auth migrate`. Prints pointer + exits 0.')
|
|
544
|
-
.option('--url <url>', 'Auth-worker base URL (ignored; pass --remote to `migrate` instead)')
|
|
545
|
-
.action(() => {
|
|
546
|
-
printHeader('migrate-to-remote has been renamed');
|
|
547
|
-
console.log(`\n Run ${pc.cyan('olam auth migrate --help')} for the new auto-migration flow.\n` +
|
|
548
|
-
` (B3 of cloud-only-vault: per-account re-OAuth against the cloud auth-worker,\n` +
|
|
549
|
-
` content-hash idempotent, atomic state writes, --dry-run preview.)\n`);
|
|
550
|
-
});
|
|
551
|
-
// ── e6: rotate-service-token ───────────────────────────────────────────
|
|
552
|
-
auth
|
|
553
|
-
.command('rotate-service-token')
|
|
554
|
-
.description('Revoke a service token and guide through re-binding a replacement')
|
|
555
|
-
.requiredOption('--url <url>', 'Auth-worker base URL')
|
|
556
|
-
.requiredOption('--client-id <id>', 'CF service token client_id to revoke')
|
|
557
|
-
.option('--cookie <value>', 'CF_Authorization cookie for the DELETE request')
|
|
558
|
-
.action(async (opts) => {
|
|
559
|
-
const baseUrl = opts.url;
|
|
560
|
-
const clientId = opts.clientId;
|
|
561
|
-
printHeader('Auth worker — rotate service token');
|
|
562
|
-
console.log(`\n Revoking service token: ${pc.yellow(clientId)}\n`);
|
|
563
|
-
try {
|
|
564
|
-
await remoteDeleteServiceToken({ baseUrl, cfAuthCookie: opts.cookie }, clientId);
|
|
565
|
-
printSuccess(`Revoked: ${clientId}`);
|
|
566
|
-
}
|
|
567
|
-
catch (err) {
|
|
568
|
-
printError(err instanceof Error ? err.message : 'revoke failed');
|
|
569
|
-
process.exitCode = 1;
|
|
570
|
-
return;
|
|
571
|
-
}
|
|
572
|
-
console.log(`\n ${pc.bold('Next steps:')}`);
|
|
573
|
-
console.log(` 1. Mint a new service token in the Cloudflare Zero Trust dashboard.`);
|
|
574
|
-
console.log(` 2. Bind it:\n`);
|
|
575
|
-
console.log(` ${pc.cyan('olam auth bind-service-token --remote ' + baseUrl + ' --token <new_client_id>:<secret>')}\n`);
|
|
576
|
-
});
|
|
577
|
-
// ── e6: doctor --auth-worker ───────────────────────────────────────────
|
|
578
|
-
auth
|
|
579
|
-
.command('doctor')
|
|
580
|
-
.description('Run 4 diagnostic probes against the remote auth-worker')
|
|
581
|
-
.requiredOption('--auth-worker <url>', 'Auth-worker base URL')
|
|
582
|
-
.option('--cookie <value>', 'CF_Authorization cookie (optional, for authenticated probes)')
|
|
583
|
-
.option('--json', 'Emit JSON output')
|
|
584
|
-
.action(async (opts) => {
|
|
585
|
-
const checks = await runDoctorChecks({
|
|
586
|
-
baseUrl: opts.authWorker,
|
|
587
|
-
cfAuthCookie: opts.cookie,
|
|
588
|
-
});
|
|
589
|
-
if (opts.json) {
|
|
590
|
-
console.log(JSON.stringify(checks, null, 2));
|
|
591
|
-
const failed = checks.filter((c) => c.status === 'fail').length;
|
|
592
|
-
if (failed > 0)
|
|
593
|
-
process.exitCode = 1;
|
|
594
|
-
return;
|
|
595
|
-
}
|
|
596
|
-
printHeader(`Auth-worker diagnostics (${opts.authWorker})`);
|
|
597
|
-
let hasFailure = false;
|
|
598
|
-
for (const c of checks) {
|
|
599
|
-
const icon = c.status === 'pass' ? pc.green('✓') :
|
|
600
|
-
c.status === 'warn' ? pc.yellow('⚠') :
|
|
601
|
-
pc.red('✗');
|
|
602
|
-
console.log(` ${icon} ${pc.bold(c.probe.padEnd(20))} ${c.message}`);
|
|
603
|
-
if (c.remedy) {
|
|
604
|
-
console.log(` ${pc.dim('↳ ' + c.remedy)}`);
|
|
605
|
-
}
|
|
606
|
-
if (c.status === 'fail')
|
|
607
|
-
hasFailure = true;
|
|
608
|
-
}
|
|
609
|
-
console.log();
|
|
610
|
-
if (hasFailure) {
|
|
611
|
-
printError('One or more probes failed — see remediation steps above.');
|
|
612
|
-
process.exitCode = 1;
|
|
613
|
-
}
|
|
614
|
-
else {
|
|
615
|
-
printSuccess('All probes passed (warnings are non-blocking).');
|
|
616
|
-
}
|
|
617
|
-
});
|
|
618
|
-
// ── g4.1: issue-anthropic-token ───────────────────────────────────────────
|
|
619
|
-
auth
|
|
620
|
-
.command('issue-anthropic-token')
|
|
621
|
-
.description('Mint a new Anthropic proxy token via the remote auth-worker (g4)')
|
|
622
|
-
.requiredOption('--remote <url>', 'Auth-worker base URL')
|
|
623
|
-
.option('--label <name>', 'Friendly label for this token (e.g. my-laptop). Default: <hostname>-<timestamp>')
|
|
624
|
-
.option('--no-write-file', 'Do not write the bearer URL to ~/.olam/anthropic-base-url (default: write)')
|
|
625
|
-
.action(async (opts) => {
|
|
626
|
-
const baseUrl = opts.remote;
|
|
627
|
-
const label = resolveTokenLabel(opts.label);
|
|
628
|
-
printHeader('Auth worker — issue Anthropic proxy token');
|
|
629
|
-
// Phase H h2: prefer a CF Access service token (machine-to-machine) over
|
|
630
|
-
// the manual cookie-paste. When one is configured, authenticate without
|
|
631
|
-
// a browser round-trip.
|
|
632
|
-
const serviceToken = resolveCfAccessServiceToken();
|
|
633
|
-
let remoteOpts;
|
|
634
|
-
if (serviceToken) {
|
|
635
|
-
console.log(`\n ${pc.dim('Using CF Access service token (machine-to-machine; no cookie needed).')}`);
|
|
636
|
-
remoteOpts = {
|
|
637
|
-
baseUrl,
|
|
638
|
-
cfAccessClientId: serviceToken.clientId,
|
|
639
|
-
cfAccessClientSecret: serviceToken.clientSecret,
|
|
640
|
-
};
|
|
641
|
-
}
|
|
642
|
-
else {
|
|
643
|
-
console.log(`\n Open ${pc.cyan(baseUrl.replace(/\/+$/, '') + '/v1/oauth/start')} in a browser to authenticate via CF Access SSO.`);
|
|
644
|
-
console.log(` Once you've completed SSO, paste your CF_Authorization cookie below`);
|
|
645
|
-
console.log(` (from browser DevTools → Application → Cookies → CF_Authorization).`);
|
|
646
|
-
console.log(` ${pc.dim('Tip: provision a CF Access service token to skip this — see docs/runbooks/cf-access-service-token.md')}\n`);
|
|
647
|
-
const rawCookie = await promptLine(` ${pc.dim('CF_Authorization cookie:')} `);
|
|
648
|
-
if (!rawCookie) {
|
|
649
|
-
printError('No cookie provided. Aborting.');
|
|
650
|
-
process.exitCode = 1;
|
|
651
|
-
return;
|
|
652
|
-
}
|
|
653
|
-
remoteOpts = { baseUrl, cfAuthCookie: rawCookie };
|
|
654
|
-
}
|
|
655
|
-
try {
|
|
656
|
-
const result = await remoteIssueAnthropicToken(remoteOpts, label);
|
|
657
|
-
printSuccess(`Anthropic proxy token issued (label: ${result.label})`);
|
|
658
|
-
// Fix 1: write the BARE bearer URL straight to where auth-client's
|
|
659
|
-
// resolveCloudUrl() reads it — no hand-copy, no export-wrapper format
|
|
660
|
-
// mismatch. Opt out with --no-write-file. Never log the secret value;
|
|
661
|
-
// the URL embeds it, so the confirmation line is intentionally generic.
|
|
662
|
-
if (result.anthropic_base_url_hint) {
|
|
663
|
-
const { wrote } = writeAnthropicBaseUrlFile(result.anthropic_base_url_hint, {
|
|
664
|
-
write: opts.writeFile,
|
|
665
|
-
});
|
|
666
|
-
if (wrote) {
|
|
667
|
-
console.log(`\n ${pc.green('✓')} wrote bearer URL to ~/.olam/anthropic-base-url (chmod 600)`);
|
|
668
|
-
}
|
|
669
|
-
}
|
|
670
|
-
console.log(`\n Or set it in your shell environment yourself:`);
|
|
671
|
-
// audit:auth-callers: display-only string, not an assignment — split to avoid the regex.
|
|
672
|
-
const exportHint = 'export ANTHROPIC_BASE_URL' + `='${result.anthropic_base_url_hint}'`;
|
|
673
|
-
console.log(` ${pc.cyan(exportHint)}`);
|
|
674
|
-
console.log(`\n ${pc.yellow('WARNING: the secret above is shown ONCE. Save it now — you cannot retrieve it later.')}`);
|
|
675
|
-
console.log(` Secret: ${pc.bold(result.secret)}`);
|
|
676
|
-
console.log(` Token hash (for revocation): ${pc.dim(result.token_hash)}\n`);
|
|
677
|
-
}
|
|
678
|
-
catch (err) {
|
|
679
|
-
printError(err instanceof Error ? err.message : 'issue failed');
|
|
680
|
-
process.exitCode = 1;
|
|
681
|
-
}
|
|
682
|
-
});
|
|
683
|
-
// ── g4.2: list-anthropic-tokens ───────────────────────────────────────────
|
|
684
|
-
auth
|
|
685
|
-
.command('list-anthropic-tokens')
|
|
686
|
-
.description('List Anthropic proxy tokens from the remote auth-worker (g4)')
|
|
687
|
-
.requiredOption('--remote <url>', 'Auth-worker base URL')
|
|
688
|
-
.action(async (opts) => {
|
|
689
|
-
const baseUrl = opts.remote;
|
|
690
|
-
printHeader('Auth worker — list Anthropic proxy tokens');
|
|
691
|
-
// Phase H h2: prefer a CF Access service token over manual cookie-paste.
|
|
692
|
-
const serviceToken = resolveCfAccessServiceToken();
|
|
693
|
-
let remoteOpts;
|
|
694
|
-
if (serviceToken) {
|
|
695
|
-
console.log(`\n ${pc.dim('Using CF Access service token (machine-to-machine; no cookie needed).')}`);
|
|
696
|
-
remoteOpts = {
|
|
697
|
-
baseUrl,
|
|
698
|
-
cfAccessClientId: serviceToken.clientId,
|
|
699
|
-
cfAccessClientSecret: serviceToken.clientSecret,
|
|
700
|
-
};
|
|
701
|
-
}
|
|
702
|
-
else {
|
|
703
|
-
console.log(`\n Open ${pc.cyan(baseUrl.replace(/\/+$/, '') + '/v1/oauth/start')} in a browser to authenticate via CF Access SSO.`);
|
|
704
|
-
console.log(` Once you've completed SSO, paste your CF_Authorization cookie below.`);
|
|
705
|
-
console.log(` ${pc.dim('Tip: provision a CF Access service token to skip this — see docs/runbooks/cf-access-service-token.md')}\n`);
|
|
706
|
-
const rawCookie = await promptLine(` ${pc.dim('CF_Authorization cookie:')} `);
|
|
707
|
-
if (!rawCookie) {
|
|
708
|
-
printError('No cookie provided. Aborting.');
|
|
709
|
-
process.exitCode = 1;
|
|
710
|
-
return;
|
|
711
|
-
}
|
|
712
|
-
remoteOpts = { baseUrl, cfAuthCookie: rawCookie };
|
|
713
|
-
}
|
|
714
|
-
try {
|
|
715
|
-
const tokens = await remoteListAnthropicTokens(remoteOpts);
|
|
716
|
-
if (tokens.length === 0) {
|
|
717
|
-
console.log(`\n ${pc.dim('No Anthropic proxy tokens found. Run: olam auth issue-anthropic-token --remote ' + baseUrl + ' --label <name>')}\n`);
|
|
718
|
-
return;
|
|
719
|
-
}
|
|
720
|
-
const col = (s, w) => s.padEnd(w);
|
|
721
|
-
console.log(`\n ${'Label'.padEnd(20)} ${'Issued'.padEnd(22)} ${'Last Used'.padEnd(22)} ${'Token Hash (prefix)'}`);
|
|
722
|
-
console.log(` ${'-'.repeat(20)} ${'-'.repeat(22)} ${'-'.repeat(22)} ${'-'.repeat(10)}`);
|
|
723
|
-
for (const t of tokens) {
|
|
724
|
-
const issued = t.issued_at ?? '—';
|
|
725
|
-
const lastUsed = t.last_used_at ?? '—';
|
|
726
|
-
const hashPrefix = t.token_hash.slice(0, 8);
|
|
727
|
-
console.log(` ${col(t.label, 20)} ${col(issued, 22)} ${col(lastUsed, 22)} ${pc.dim(hashPrefix)}`);
|
|
728
|
-
}
|
|
729
|
-
console.log();
|
|
730
|
-
}
|
|
731
|
-
catch (err) {
|
|
732
|
-
printError(err instanceof Error ? err.message : 'list failed');
|
|
733
|
-
process.exitCode = 1;
|
|
734
|
-
}
|
|
735
|
-
});
|
|
736
|
-
// ── g4.3: revoke-anthropic-token ──────────────────────────────────────────
|
|
737
|
-
auth
|
|
738
|
-
.command('revoke-anthropic-token')
|
|
739
|
-
.description('Revoke an Anthropic proxy token on the remote auth-worker (g4)')
|
|
740
|
-
.requiredOption('--remote <url>', 'Auth-worker base URL')
|
|
741
|
-
.requiredOption('--token-hash <hash>', 'Token hash to revoke (from issue or list output)')
|
|
742
|
-
.action(async (opts) => {
|
|
743
|
-
const baseUrl = opts.remote;
|
|
744
|
-
printHeader('Auth worker — revoke Anthropic proxy token');
|
|
745
|
-
// Phase H h2: prefer a CF Access service token over manual cookie-paste
|
|
746
|
-
// (consistent with issue-anthropic-token and list-anthropic-tokens).
|
|
747
|
-
const serviceToken = resolveCfAccessServiceToken();
|
|
748
|
-
let remoteOpts;
|
|
749
|
-
if (serviceToken) {
|
|
750
|
-
console.log(`\n ${pc.dim('Using CF Access service token (machine-to-machine; no cookie needed).')}`);
|
|
751
|
-
remoteOpts = {
|
|
752
|
-
baseUrl,
|
|
753
|
-
cfAccessClientId: serviceToken.clientId,
|
|
754
|
-
cfAccessClientSecret: serviceToken.clientSecret,
|
|
755
|
-
};
|
|
756
|
-
}
|
|
757
|
-
else {
|
|
758
|
-
console.log(`\n Open ${pc.cyan(baseUrl.replace(/\/+$/, '') + '/v1/oauth/start')} in a browser to authenticate via CF Access SSO.`);
|
|
759
|
-
console.log(` Once you've completed SSO, paste your CF_Authorization cookie below.\n`);
|
|
760
|
-
const rawCookie = await promptLine(` ${pc.dim('CF_Authorization cookie:')} `);
|
|
761
|
-
if (!rawCookie) {
|
|
762
|
-
printError('No cookie provided. Aborting.');
|
|
763
|
-
process.exitCode = 1;
|
|
764
|
-
return;
|
|
765
|
-
}
|
|
766
|
-
remoteOpts = { baseUrl, cfAuthCookie: rawCookie };
|
|
767
|
-
}
|
|
768
|
-
try {
|
|
769
|
-
const revoked = await remoteRevokeAnthropicToken(remoteOpts, opts.tokenHash);
|
|
770
|
-
if (revoked) {
|
|
771
|
-
printSuccess(`Token ${opts.tokenHash} revoked.`);
|
|
772
|
-
}
|
|
773
|
-
else {
|
|
774
|
-
printWarning(`Token ${opts.tokenHash} not found (may already be revoked).`);
|
|
775
|
-
}
|
|
776
|
-
}
|
|
777
|
-
catch (err) {
|
|
778
|
-
printError(err instanceof Error ? err.message : 'revoke failed');
|
|
779
|
-
process.exitCode = 1;
|
|
780
|
-
}
|
|
781
|
-
});
|
|
782
|
-
registerAuthUpgrade(auth);
|
|
783
|
-
}
|
|
784
|
-
//# sourceMappingURL=auth.js.map
|