@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
|
@@ -1,933 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* health-probes.ts — Shared host-health probe module.
|
|
3
|
-
*
|
|
4
|
-
* Phase A1 of olam-operator-onboarding-parity (plan
|
|
5
|
-
* ~/.claude/plans/olam-operator-onboarding-parity.md).
|
|
6
|
-
*
|
|
7
|
-
* The Seam (Decision 3): `olam doctor` + `olam diagnose` both consume
|
|
8
|
-
* these probes. No probe writes to disk; no probe spawns long-running
|
|
9
|
-
* processes; each is independently safe to run in parallel.
|
|
10
|
-
*
|
|
11
|
-
* Probe contract:
|
|
12
|
-
* - Each returns ProbeResult: { ok: true, message } | { ok: false, message, remedy }
|
|
13
|
-
* - Each is async; can run in parallel via Promise.all
|
|
14
|
-
* - Each accepts injectable deps (docker exec / fetch / OLAM_HOME) for testability
|
|
15
|
-
*
|
|
16
|
-
* Cap thresholds (probeKgStorage) mirror packages/cli/src/commands/kg-status.ts:
|
|
17
|
-
* - 1.5 GB soft-cap → ok:true with "soft-warn" message
|
|
18
|
-
* - 5.0 GB hard-cap → ok:false with prune remedy
|
|
19
|
-
*
|
|
20
|
-
* Daemon-reachability rule (Risk T5): callers that probe per-image
|
|
21
|
-
* presence MUST call probeDockerDaemon first and fast-fail on its
|
|
22
|
-
* failure. Image probes throw confusing "404 no such image" errors
|
|
23
|
-
* when the daemon is paused mid-check.
|
|
24
|
-
*/
|
|
25
|
-
import { spawnSync } from 'node:child_process';
|
|
26
|
-
import { existsSync, readdirSync, readFileSync, statSync } from 'node:fs';
|
|
27
|
-
import { homedir } from 'node:os';
|
|
28
|
-
import path from 'node:path';
|
|
29
|
-
import { SOFT_CAP_BYTES, HARD_CAP_BYTES } from './kg-caps.js';
|
|
30
|
-
/**
|
|
31
|
-
* Resolve the operator's configured Anthropic base URL, which signals that
|
|
32
|
-
* a remote auth-worker is in use and no local OAuth vault is required.
|
|
33
|
-
*
|
|
34
|
-
* Resolution order (mirrors packages/auth-client/src/cloud-mode.ts):
|
|
35
|
-
* 1. OLAM_ANTHROPIC_BASE_URL env var
|
|
36
|
-
* 2. ANTHROPIC_BASE_URL env var
|
|
37
|
-
* 3. ~/.olam/anthropic-base-url file
|
|
38
|
-
*
|
|
39
|
-
* Returns null when none are set / non-empty.
|
|
40
|
-
*/
|
|
41
|
-
function resolveAnthropicBaseUrl(olamHomeOverride) {
|
|
42
|
-
const envFirst = process.env.OLAM_ANTHROPIC_BASE_URL ?? process.env.ANTHROPIC_BASE_URL;
|
|
43
|
-
if (envFirst && envFirst.trim().length > 0)
|
|
44
|
-
return envFirst.trim();
|
|
45
|
-
try {
|
|
46
|
-
const olamHome = olamHomeOverride ?? process.env.OLAM_HOME ?? path.join(homedir(), '.olam');
|
|
47
|
-
const filePath = path.join(olamHome, 'anthropic-base-url');
|
|
48
|
-
if (!existsSync(filePath))
|
|
49
|
-
return null;
|
|
50
|
-
const body = readFileSync(filePath, 'utf-8').trim();
|
|
51
|
-
return body.length > 0 ? body : null;
|
|
52
|
-
}
|
|
53
|
-
catch {
|
|
54
|
-
return null;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
const HEALTH_TIMEOUT_MS = 5_000;
|
|
58
|
-
/**
|
|
59
|
-
* Probe: GitHub CLI authenticated via `gh auth status`.
|
|
60
|
-
*
|
|
61
|
-
* k3d uses `gh auth token` to create the GHCR pull secret during olam setup.
|
|
62
|
-
* This probe warns (non-gating) when gh CLI is not authenticated.
|
|
63
|
-
*/
|
|
64
|
-
export async function probeGithubCliAuth(dockerExec = defaultDockerExec) {
|
|
65
|
-
const r = dockerExec('gh', ['auth', 'status']);
|
|
66
|
-
if (r.status === 0) {
|
|
67
|
-
return { ok: true, message: 'GitHub CLI authenticated' };
|
|
68
|
-
}
|
|
69
|
-
return {
|
|
70
|
-
ok: true,
|
|
71
|
-
warn: true,
|
|
72
|
-
message: 'GitHub CLI not authenticated',
|
|
73
|
-
remedy: 'Run `gh auth login` — k3d uses gh token to create the GHCR pull secret.',
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* Probe: Claude Code installed and accessible via `claude --version`.
|
|
78
|
-
*
|
|
79
|
-
* OLAM requires Claude Code as the primary agent runtime. This probe warns
|
|
80
|
-
* (non-gating) when Claude Code is not found on PATH.
|
|
81
|
-
*/
|
|
82
|
-
export async function probeClaudeCodeInstalled(dockerExec = defaultDockerExec) {
|
|
83
|
-
const r = dockerExec('claude', ['--version']);
|
|
84
|
-
if (r.status === 0 && r.stdout.trim().length > 0) {
|
|
85
|
-
const version = r.stdout.trim().split('\n')[0] ?? r.stdout.trim();
|
|
86
|
-
return { ok: true, message: `Claude Code ${version}` };
|
|
87
|
-
}
|
|
88
|
-
return {
|
|
89
|
-
ok: true,
|
|
90
|
-
warn: true,
|
|
91
|
-
message: 'Claude Code not found',
|
|
92
|
-
remedy: 'Install Claude Code: https://docs.claude.com/en/docs/claude-code',
|
|
93
|
-
};
|
|
94
|
-
}
|
|
95
|
-
// ── Phase C / C2: Colima version probe ────────────────────────────────
|
|
96
|
-
//
|
|
97
|
-
// Decision (plan Goal — VERBATIM): when Colima version is in the 0.10.x
|
|
98
|
-
// range, surface a WARN with the literal remediation text below. Any
|
|
99
|
-
// drift from this string is a regression — operators copy-paste it.
|
|
100
|
-
//
|
|
101
|
-
// The matcher is intentionally strict (`^v?0\.10\.\d+$`) — a future 0.11
|
|
102
|
-
// or 0.9 release MUST NOT match.
|
|
103
|
-
export const COLIMA_010_WARN_TEXT =
|
|
104
|
-
// eslint-disable-next-line @typescript-eslint/quotes
|
|
105
|
-
"Colima 0.10.1's --kubernetes mode is broken upstream. Either switch to OLAM_HOST_CP_ENGINE=docker (recommended) or downgrade Colima to 0.9.x. Track abiosoft/colima issues for fix.";
|
|
106
|
-
const COLIMA_010_RANGE = /^v?0\.10\.\d+$/;
|
|
107
|
-
/**
|
|
108
|
-
* Default Docker exec implementation. Consumers MUST inject their own
|
|
109
|
-
* `exec` parameter in tests — this default reaches real
|
|
110
|
-
* `node:child_process.spawnSync` and will shell out to a real `docker`
|
|
111
|
-
* binary on the test runner (green on dev laptops with Docker running;
|
|
112
|
-
* red on CI runners without daemon). Audit finding HIGH-2.
|
|
113
|
-
*/
|
|
114
|
-
const defaultDockerExec = (cmd, args) => {
|
|
115
|
-
const r = spawnSync(cmd, [...args], {
|
|
116
|
-
encoding: 'utf-8',
|
|
117
|
-
stdio: ['ignore', 'pipe', 'pipe'],
|
|
118
|
-
});
|
|
119
|
-
return {
|
|
120
|
-
status: r.status,
|
|
121
|
-
stdout: r.stdout ?? '',
|
|
122
|
-
stderr: r.stderr ?? '',
|
|
123
|
-
};
|
|
124
|
-
};
|
|
125
|
-
/**
|
|
126
|
-
* Default fetch implementation. Consumers MUST inject their own
|
|
127
|
-
* `fetchImpl` parameter in tests — this default reaches the global
|
|
128
|
-
* `fetch` and will make real network calls on the test runner.
|
|
129
|
-
* Audit finding HIGH-2.
|
|
130
|
-
*/
|
|
131
|
-
const defaultFetch = (input, init) => fetch(input, init);
|
|
132
|
-
// ── Probes ─────────────────────────────────────────────────────────────
|
|
133
|
-
/**
|
|
134
|
-
* Verify docker daemon is reachable via `docker info --format`.
|
|
135
|
-
*
|
|
136
|
-
* MUST be called first by callers that probe per-image presence; image
|
|
137
|
-
* probes throw confusing "404 no such image" errors when the daemon is
|
|
138
|
-
* paused mid-check (Risk T5 mitigation).
|
|
139
|
-
*/
|
|
140
|
-
export async function probeDockerDaemon(dockerExec = defaultDockerExec) {
|
|
141
|
-
const r = dockerExec('docker', ['info', '--format', '{{.ServerVersion}}']);
|
|
142
|
-
if (r.status === 0 && r.stdout.trim().length > 0) {
|
|
143
|
-
return { ok: true, message: `docker ${r.stdout.trim()} reachable` };
|
|
144
|
-
}
|
|
145
|
-
return {
|
|
146
|
-
ok: false,
|
|
147
|
-
message: 'docker daemon not reachable',
|
|
148
|
-
remedy: 'Start Docker Desktop (or your docker daemon) and re-run.',
|
|
149
|
-
};
|
|
150
|
-
}
|
|
151
|
-
/**
|
|
152
|
-
* Verify the `docker compose` v2 plugin is installed.
|
|
153
|
-
*
|
|
154
|
-
* Symptom this guards against (B2 / npm-only operator on macOS via Homebrew):
|
|
155
|
-
* `brew install docker` does NOT ship the compose v2 plugin. `docker compose pull …`
|
|
156
|
-
* fails — depending on docker version — with either "is not a docker command"
|
|
157
|
-
* (newer docker) or "unknown shorthand flag" (bare docker mis-parsing the
|
|
158
|
-
* remainder of the compose argv). The cryptic flag error misdirects operators
|
|
159
|
-
* away from the real fix.
|
|
160
|
-
*
|
|
161
|
-
* Returns:
|
|
162
|
-
* - PASS when `docker compose version` exits 0 with v2.x in stdout.
|
|
163
|
-
* - FAIL with macOS-aware remedy when docker is present but the plugin isn't.
|
|
164
|
-
* - FAIL with "install docker" remedy when the docker binary is missing entirely.
|
|
165
|
-
*
|
|
166
|
-
* Detection: relies on stderr / exit status of `docker compose version`. The
|
|
167
|
-
* exact stderr text varies by docker version, so we match a small set of
|
|
168
|
-
* substrings rather than a single regex.
|
|
169
|
-
*/
|
|
170
|
-
export async function probeComposePlugin(dockerExec = defaultDockerExec) {
|
|
171
|
-
const r = dockerExec('docker', ['compose', 'version']);
|
|
172
|
-
if (r.status === 0 && r.stdout.trim().length > 0) {
|
|
173
|
-
// Successful invocation. stdout is something like "Docker Compose version v2.29.7".
|
|
174
|
-
const version = r.stdout.trim().split('\n')[0] ?? r.stdout.trim();
|
|
175
|
-
return { ok: true, message: `${version}` };
|
|
176
|
-
}
|
|
177
|
-
// Distinguish "docker binary missing" from "docker present but compose plugin missing".
|
|
178
|
-
// status === null happens when spawn itself failed (binary not found).
|
|
179
|
-
if (r.status === null) {
|
|
180
|
-
return {
|
|
181
|
-
ok: false,
|
|
182
|
-
message: 'docker not installed (`docker` binary not found)',
|
|
183
|
-
remedy: 'Install Docker. On macOS: `brew install docker docker-compose` (CLI only) or install Docker Desktop. On Linux follow https://docs.docker.com/engine/install/.',
|
|
184
|
-
};
|
|
185
|
-
}
|
|
186
|
-
const stderrText = `${r.stdout}\n${r.stderr}`.toLowerCase();
|
|
187
|
-
const isPluginMissing = stderrText.includes('is not a docker command') ||
|
|
188
|
-
stderrText.includes('unknown command') ||
|
|
189
|
-
stderrText.includes('unknown shorthand flag') ||
|
|
190
|
-
stderrText.includes('no such file or directory');
|
|
191
|
-
if (isPluginMissing) {
|
|
192
|
-
return {
|
|
193
|
-
ok: false,
|
|
194
|
-
message: 'docker-compose-v2 plugin not installed',
|
|
195
|
-
remedy: 'Install the compose v2 plugin. macOS: `brew install docker-compose`. Linux: install the `docker-compose-plugin` package (apt/dnf) or follow https://docs.docker.com/compose/install/linux/.',
|
|
196
|
-
};
|
|
197
|
-
}
|
|
198
|
-
// Unrecognized failure — probably docker daemon down or another preflight class.
|
|
199
|
-
// Surface what we can; `probeDockerDaemon` will give the more specific remedy.
|
|
200
|
-
return {
|
|
201
|
-
ok: false,
|
|
202
|
-
message: `docker compose probe failed (status ${r.status})`,
|
|
203
|
-
remedy: 'Check `docker compose version` manually. If docker itself is down, start Docker Desktop or your docker daemon and re-run.',
|
|
204
|
-
};
|
|
205
|
-
}
|
|
206
|
-
/**
|
|
207
|
-
* Verify each ref is present locally via `docker image inspect`.
|
|
208
|
-
*
|
|
209
|
-
* Fast-fail: returns the first missing image; subsequent refs NOT
|
|
210
|
-
* probed. Caller decides ordering of refs.
|
|
211
|
-
*/
|
|
212
|
-
export async function probeImagePresence(refs, dockerExec = defaultDockerExec) {
|
|
213
|
-
for (const ref of refs) {
|
|
214
|
-
const r = dockerExec('docker', ['image', 'inspect', '--format', '{{.Id}}', ref]);
|
|
215
|
-
if (r.status !== 0) {
|
|
216
|
-
return {
|
|
217
|
-
ok: false,
|
|
218
|
-
message: `image ${ref} not present locally`,
|
|
219
|
-
remedy: 'Run `olam bootstrap` to pull the published image, or build locally.',
|
|
220
|
-
};
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
return { ok: true, message: `${refs.length} image(s) present` };
|
|
224
|
-
}
|
|
225
|
-
/**
|
|
226
|
-
* GET http://127.0.0.1:19000/health with 5s timeout; expect HTTP 200
|
|
227
|
-
* AND a JSON envelope matching the host-cp shape (defends against
|
|
228
|
-
* false-positives from a port-collision with some other 19000-bound
|
|
229
|
-
* process — audit finding HIGH body-shape).
|
|
230
|
-
*
|
|
231
|
-
* Real envelope (per `packages/host-cp/src/server.mjs:665-688`):
|
|
232
|
-
* { status: 'ok', phase, uptime_seconds: number, cache: {...},
|
|
233
|
-
* mode: { deployment, world_host }, registry: {...}, auth: {...} }
|
|
234
|
-
*
|
|
235
|
-
* Probe asserts three orthogonal fields (`phase` + `cache` object +
|
|
236
|
-
* `mode.deployment`) that no random web server would carry together.
|
|
237
|
-
* Substring-on-the-token-path was an earlier fragile heuristic; this
|
|
238
|
-
* version pins to actual server contract.
|
|
239
|
-
*
|
|
240
|
-
* Aborts via AbortController on timeout; failure mode is captured in
|
|
241
|
-
* the error path with reason ("timeout" / "ECONNREFUSED" / etc.).
|
|
242
|
-
*
|
|
243
|
-
* Always consumes the response body before returning (avoids undici
|
|
244
|
-
* socket leak when the probe is invoked in a loop).
|
|
245
|
-
*/
|
|
246
|
-
export async function probeHostCpHealth(fetchImpl = defaultFetch) {
|
|
247
|
-
const controller = new AbortController();
|
|
248
|
-
const timeout = setTimeout(() => controller.abort(), HEALTH_TIMEOUT_MS);
|
|
249
|
-
try {
|
|
250
|
-
const res = await fetchImpl('http://127.0.0.1:19000/health', { signal: controller.signal });
|
|
251
|
-
const body = await res.text().catch(() => '');
|
|
252
|
-
if (res.status !== 200) {
|
|
253
|
-
return {
|
|
254
|
-
ok: false,
|
|
255
|
-
message: `host-cp /health returned ${res.status}`,
|
|
256
|
-
remedy: 'Restart host-cp via `olam host-cp start`; verify port 19000 is bound to 127.0.0.1.',
|
|
257
|
-
};
|
|
258
|
-
}
|
|
259
|
-
if (isHostCpHealthEnvelope(body)) {
|
|
260
|
-
return { ok: true, message: 'host-cp /health returned 200' };
|
|
261
|
-
}
|
|
262
|
-
return {
|
|
263
|
-
ok: false,
|
|
264
|
-
message: 'host-cp /health returned 200 but body did not match the host-cp envelope (possible port collision on :19000)',
|
|
265
|
-
remedy: 'Check `lsof -iTCP:19000`; another process may have bound the port. Restart host-cp via `olam host-cp start`.',
|
|
266
|
-
};
|
|
267
|
-
}
|
|
268
|
-
catch (err) {
|
|
269
|
-
const e = err;
|
|
270
|
-
const reason = e.name === 'AbortError' ? `timeout (${HEALTH_TIMEOUT_MS}ms)` : e.message;
|
|
271
|
-
return {
|
|
272
|
-
ok: false,
|
|
273
|
-
message: `host-cp /health unreachable: ${reason}`,
|
|
274
|
-
remedy: 'Restart host-cp via `olam host-cp start`; verify port 19000 is bound to 127.0.0.1.',
|
|
275
|
-
};
|
|
276
|
-
}
|
|
277
|
-
finally {
|
|
278
|
-
clearTimeout(timeout);
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
/**
|
|
282
|
-
* Match three orthogonal fields from host-cp's real /health envelope.
|
|
283
|
-
* Returns true only when ALL match (a random 19000-bound web server is
|
|
284
|
-
* very unlikely to ship all three in one response by accident).
|
|
285
|
-
*/
|
|
286
|
-
function isHostCpHealthEnvelope(body) {
|
|
287
|
-
let parsed;
|
|
288
|
-
try {
|
|
289
|
-
parsed = JSON.parse(body);
|
|
290
|
-
}
|
|
291
|
-
catch {
|
|
292
|
-
return false;
|
|
293
|
-
}
|
|
294
|
-
if (!parsed || typeof parsed !== 'object')
|
|
295
|
-
return false;
|
|
296
|
-
const obj = parsed;
|
|
297
|
-
if (typeof obj.phase !== 'string')
|
|
298
|
-
return false;
|
|
299
|
-
if (!obj.cache || typeof obj.cache !== 'object')
|
|
300
|
-
return false;
|
|
301
|
-
const mode = obj.mode;
|
|
302
|
-
if (!mode || typeof mode !== 'object')
|
|
303
|
-
return false;
|
|
304
|
-
if (typeof mode.deployment !== 'string')
|
|
305
|
-
return false;
|
|
306
|
-
return true;
|
|
307
|
-
}
|
|
308
|
-
/**
|
|
309
|
-
* Read the canonical credentials vault at `<OLAM_HOME>/auth-data/accounts.json`
|
|
310
|
-
* (matching `packages/auth-service/src/store.ts:LOCAL_DATA_DIR` and
|
|
311
|
-
* `scripts/audit-credentials.mjs:resolveAccountsPath`); count active
|
|
312
|
-
* `claude` credentials.
|
|
313
|
-
*
|
|
314
|
-
* Vault shape (per packages/auth-service/src/types.ts): a flat JSON array
|
|
315
|
-
* of account objects. Each account has:
|
|
316
|
-
* - provider: 'claude' | 'codex' | ...
|
|
317
|
-
* - state?: 'active' | 'cooldown' | 'disabled'
|
|
318
|
-
* - rateLimited?: boolean (legacy fallback for state)
|
|
319
|
-
* - expiresAt?: number (epoch ms)
|
|
320
|
-
* - rateLimitResetsAt?: string (ISO 8601)
|
|
321
|
-
*
|
|
322
|
-
* Predicate mirrors `effectiveState()` from scripts/audit-credentials.mjs
|
|
323
|
-
* inline (the canonical helper is a .mjs script that we can't import from
|
|
324
|
-
* this TS module). If the canonical predicate evolves (new fields, new
|
|
325
|
-
* state literals), this mirror MUST be updated.
|
|
326
|
-
*
|
|
327
|
-
* Override: `OLAM_AUTH_DATA_PATH` env var lets CI/test fixtures point
|
|
328
|
-
* at an alternate accounts.json. Matches the canonical helper.
|
|
329
|
-
*/
|
|
330
|
-
/**
|
|
331
|
-
* Redact bearer secrets from a URL before displaying it in terminal output.
|
|
332
|
-
*
|
|
333
|
-
* Handles two formats:
|
|
334
|
-
* 1. Userinfo-style: https://user:secret@host/...
|
|
335
|
-
* → https://<redacted>@host/...
|
|
336
|
-
* 2. Kaluga/auth-worker path-style: https://host/auth/<sub>/<secret>(/path?)
|
|
337
|
-
* → https://host/auth/<sub>/<redacted>(/path?)
|
|
338
|
-
* The <sub> (UUID-like operator identity) is preserved for support debugging;
|
|
339
|
-
* only the trailing secret segment is redacted.
|
|
340
|
-
*/
|
|
341
|
-
function redactBearerUrl(url) {
|
|
342
|
-
// Format 1: userinfo → https://user:secret@host/...
|
|
343
|
-
let safe = url.replace(/\/\/[^@/]*@/, '//<redacted>@');
|
|
344
|
-
// Format 2: kaluga.co-style path-bearer → https://host/auth/<sub>/<secret>(/<path>?)
|
|
345
|
-
// The secret is the segment immediately after /auth/<sub>/. We keep <sub> (operator
|
|
346
|
-
// identity, useful for support) and redact only the secret. [^/?#]+ stops at
|
|
347
|
-
// path separator, query string, or fragment so trailing path is preserved.
|
|
348
|
-
safe = safe.replace(/\/auth\/([^/?#]+)\/([^/?#]+)/, '/auth/$1/<redacted>');
|
|
349
|
-
return safe;
|
|
350
|
-
}
|
|
351
|
-
export async function probeAuthVault(olamHomeOverride) {
|
|
352
|
-
// Honour remote auth-worker config — operators using ~/.olam/anthropic-base-url
|
|
353
|
-
// (or env OLAM_ANTHROPIC_BASE_URL / ANTHROPIC_BASE_URL) don't need the legacy
|
|
354
|
-
// local OAuth vault. Source: packages/auth-client/src/cloud-mode.ts.
|
|
355
|
-
const remoteUrl = resolveAnthropicBaseUrl(olamHomeOverride);
|
|
356
|
-
if (remoteUrl !== null) {
|
|
357
|
-
// Redact bearer secrets embedded in the URL before printing to the terminal.
|
|
358
|
-
const safeUrl = redactBearerUrl(remoteUrl);
|
|
359
|
-
return { ok: true, message: `remote auth-worker configured (${safeUrl})` };
|
|
360
|
-
}
|
|
361
|
-
const vaultPath = resolveAccountsPath(olamHomeOverride);
|
|
362
|
-
if (!existsSync(vaultPath)) {
|
|
363
|
-
return {
|
|
364
|
-
ok: false,
|
|
365
|
-
message: `auth vault missing at ${vaultPath}`,
|
|
366
|
-
remedy: 'Run `olam services up && olam auth login` to provision the vault.',
|
|
367
|
-
};
|
|
368
|
-
}
|
|
369
|
-
let parsed;
|
|
370
|
-
try {
|
|
371
|
-
parsed = JSON.parse(readFileSync(vaultPath, 'utf-8'));
|
|
372
|
-
}
|
|
373
|
-
catch (err) {
|
|
374
|
-
return {
|
|
375
|
-
ok: false,
|
|
376
|
-
message: `auth vault malformed: ${err.message}`,
|
|
377
|
-
remedy: 'Inspect the accounts.json file; restore from backup or re-run `olam services up`.',
|
|
378
|
-
};
|
|
379
|
-
}
|
|
380
|
-
if (!Array.isArray(parsed)) {
|
|
381
|
-
return {
|
|
382
|
-
ok: false,
|
|
383
|
-
message: 'auth vault malformed: expected JSON array at top level',
|
|
384
|
-
remedy: 'Restore the vault from backup or re-run `olam services up && olam auth login`.',
|
|
385
|
-
};
|
|
386
|
-
}
|
|
387
|
-
const accounts = parsed.filter((a) => a !== null && typeof a === 'object');
|
|
388
|
-
const now = Date.now();
|
|
389
|
-
const activeClaude = accounts.filter((a) => a.provider === 'claude' && effectiveState(a, now) === 'active');
|
|
390
|
-
if (activeClaude.length === 0) {
|
|
391
|
-
return {
|
|
392
|
-
ok: false,
|
|
393
|
-
message: `no active claude credentials (vault has ${accounts.length} account(s))`,
|
|
394
|
-
remedy: 'Run `olam auth login` to add a credential, or wait for the next reset.',
|
|
395
|
-
};
|
|
396
|
-
}
|
|
397
|
-
return { ok: true, message: `${activeClaude.length} active claude credential(s)` };
|
|
398
|
-
}
|
|
399
|
-
function resolveAccountsPath(olamHomeOverride) {
|
|
400
|
-
// OLAM_AUTH_DATA_PATH is the explicit override (matches the canonical
|
|
401
|
-
// helper at scripts/audit-credentials.mjs). Honoured first for CI fixtures.
|
|
402
|
-
const explicit = process.env.OLAM_AUTH_DATA_PATH;
|
|
403
|
-
if (explicit)
|
|
404
|
-
return explicit;
|
|
405
|
-
const olamHome = olamHomeOverride ?? process.env.OLAM_HOME ?? path.join(homedir(), '.olam');
|
|
406
|
-
return path.join(olamHome, 'auth-data', 'accounts.json');
|
|
407
|
-
}
|
|
408
|
-
/**
|
|
409
|
-
* Inline mirror of `effectiveState()` from scripts/audit-credentials.mjs.
|
|
410
|
-
*
|
|
411
|
-
* IMPORTANT: keep this in sync with the canonical helper. If the helper
|
|
412
|
-
* changes, this copy MUST change too (no compile-time link between them).
|
|
413
|
-
*/
|
|
414
|
-
function effectiveState(account, now) {
|
|
415
|
-
const persisted = account.state ?? (account.rateLimited ? 'cooldown' : 'active');
|
|
416
|
-
if (persisted === 'disabled')
|
|
417
|
-
return 'disabled';
|
|
418
|
-
if (typeof account.expiresAt === 'number' && account.expiresAt <= now)
|
|
419
|
-
return 'expired';
|
|
420
|
-
if (persisted === 'cooldown') {
|
|
421
|
-
const reset = account.rateLimitResetsAt ? new Date(account.rateLimitResetsAt).getTime() : 0;
|
|
422
|
-
if (reset > 0 && reset <= now)
|
|
423
|
-
return 'active';
|
|
424
|
-
}
|
|
425
|
-
return persisted;
|
|
426
|
-
}
|
|
427
|
-
/**
|
|
428
|
-
* Cumulative KG storage under OLAM_HOME (pristines + overlays).
|
|
429
|
-
* Soft warn at 1.5 GB; hard fail at 5 GB.
|
|
430
|
-
*
|
|
431
|
-
* Layout (mirrors packages/cli/src/commands/kg-status.ts):
|
|
432
|
-
* - Pristines: ~/.olam/kg/<workspace>/graphify-out/
|
|
433
|
-
* - Overlays: ~/.olam/worlds/<world>/<clone>/graphify-out/
|
|
434
|
-
*
|
|
435
|
-
* Cap constants duplicated rather than imported from kg-status.ts to
|
|
436
|
-
* keep this module self-contained (the Seam decision — see plan
|
|
437
|
-
* decision 3). A future PR may extract them to a single source if
|
|
438
|
-
* a third consumer lands.
|
|
439
|
-
*/
|
|
440
|
-
export async function probeKgStorage(olamHomeOverride) {
|
|
441
|
-
const olamHome = olamHomeOverride ?? process.env.OLAM_HOME ?? path.join(homedir(), '.olam');
|
|
442
|
-
const kgRoot = path.join(olamHome, 'kg');
|
|
443
|
-
const worldsRoot = path.join(olamHome, 'worlds');
|
|
444
|
-
const kgBytes = enumerateGraphifyOut(kgRoot, 'pristine');
|
|
445
|
-
const overlayBytes = enumerateGraphifyOut(worldsRoot, 'overlay');
|
|
446
|
-
const totalBytes = kgBytes + overlayBytes;
|
|
447
|
-
if (totalBytes >= HARD_CAP_BYTES) {
|
|
448
|
-
return {
|
|
449
|
-
ok: false,
|
|
450
|
-
message: `KG storage ${formatBytes(totalBytes)} exceeds 5 GB hard cap`,
|
|
451
|
-
remedy: 'Prune stale pristines: `rm -rf ~/.olam/kg/<workspace>` after operator review.',
|
|
452
|
-
};
|
|
453
|
-
}
|
|
454
|
-
if (totalBytes >= SOFT_CAP_BYTES) {
|
|
455
|
-
return {
|
|
456
|
-
ok: true,
|
|
457
|
-
message: `KG storage ${formatBytes(totalBytes)} (soft-warn — exceeds 1.5 GB; consider pruning)`,
|
|
458
|
-
remedy: 'Prune stale pristines: `rm -rf ~/.olam/kg/<workspace>` or raise OLAM_KG_SOFT_CAP.',
|
|
459
|
-
};
|
|
460
|
-
}
|
|
461
|
-
return { ok: true, message: `KG storage ${formatBytes(totalBytes)} (under cap)` };
|
|
462
|
-
}
|
|
463
|
-
function enumerateGraphifyOut(root, layout) {
|
|
464
|
-
if (!existsSync(root))
|
|
465
|
-
return 0;
|
|
466
|
-
let total = 0;
|
|
467
|
-
let entries;
|
|
468
|
-
try {
|
|
469
|
-
entries = readdirSync(root, { withFileTypes: true });
|
|
470
|
-
}
|
|
471
|
-
catch {
|
|
472
|
-
return 0;
|
|
473
|
-
}
|
|
474
|
-
for (const entry of entries) {
|
|
475
|
-
if (!entry.isDirectory())
|
|
476
|
-
continue;
|
|
477
|
-
if (layout === 'pristine') {
|
|
478
|
-
total += dirSizeBytes(path.join(root, entry.name, 'graphify-out'));
|
|
479
|
-
}
|
|
480
|
-
else {
|
|
481
|
-
const worldDir = path.join(root, entry.name);
|
|
482
|
-
let clones;
|
|
483
|
-
try {
|
|
484
|
-
clones = readdirSync(worldDir, { withFileTypes: true });
|
|
485
|
-
}
|
|
486
|
-
catch {
|
|
487
|
-
continue;
|
|
488
|
-
}
|
|
489
|
-
for (const clone of clones) {
|
|
490
|
-
if (!clone.isDirectory())
|
|
491
|
-
continue;
|
|
492
|
-
total += dirSizeBytes(path.join(worldDir, clone.name, 'graphify-out'));
|
|
493
|
-
}
|
|
494
|
-
}
|
|
495
|
-
}
|
|
496
|
-
return total;
|
|
497
|
-
}
|
|
498
|
-
/**
|
|
499
|
-
* Recursive byte sum over a directory.
|
|
500
|
-
*
|
|
501
|
-
* Symlink policy: short-circuited via `entry.isSymbolicLink()` in the
|
|
502
|
-
* common case. KNOWN FALSE-POSITIVE CLASS (audit finding HIGH-3): on
|
|
503
|
-
* filesystems that don't populate `d_type` (some network mounts, FUSE,
|
|
504
|
-
* exotic overlay FS), `Dirent` flags report `UV_DIRENT_UNKNOWN` and
|
|
505
|
-
* both `isSymbolicLink()` and `isDirectory()` return `false`. Such an
|
|
506
|
-
* entry is then `statSync`'d as a file; if it's actually a symlink to
|
|
507
|
-
* a giant file, the target's bytes are counted. Probability is low on
|
|
508
|
-
* APFS/ext4; impact is "doctor false-fail on a healthy host with
|
|
509
|
-
* exotic FS." Mirrors the same shape in kg-status.ts:240.
|
|
510
|
-
*/
|
|
511
|
-
function dirSizeBytes(dir) {
|
|
512
|
-
if (!existsSync(dir))
|
|
513
|
-
return 0;
|
|
514
|
-
let total = 0;
|
|
515
|
-
const stack = [dir];
|
|
516
|
-
while (stack.length > 0) {
|
|
517
|
-
const cur = stack.pop();
|
|
518
|
-
let entries;
|
|
519
|
-
try {
|
|
520
|
-
entries = readdirSync(cur, { withFileTypes: true });
|
|
521
|
-
}
|
|
522
|
-
catch {
|
|
523
|
-
continue;
|
|
524
|
-
}
|
|
525
|
-
for (const entry of entries) {
|
|
526
|
-
const full = path.join(cur, entry.name);
|
|
527
|
-
if (entry.isSymbolicLink())
|
|
528
|
-
continue;
|
|
529
|
-
if (entry.isDirectory()) {
|
|
530
|
-
stack.push(full);
|
|
531
|
-
continue;
|
|
532
|
-
}
|
|
533
|
-
try {
|
|
534
|
-
total += statSync(full).size;
|
|
535
|
-
}
|
|
536
|
-
catch {
|
|
537
|
-
// race: file disappeared between readdir + stat
|
|
538
|
-
}
|
|
539
|
-
}
|
|
540
|
-
}
|
|
541
|
-
return total;
|
|
542
|
-
}
|
|
543
|
-
function formatBytes(n) {
|
|
544
|
-
if (n < 1024)
|
|
545
|
-
return `${n} B`;
|
|
546
|
-
if (n < 1024 * 1024)
|
|
547
|
-
return `${(n / 1024).toFixed(1)} KB`;
|
|
548
|
-
if (n < 1024 * 1024 * 1024)
|
|
549
|
-
return `${(n / 1024 / 1024).toFixed(1)} MB`;
|
|
550
|
-
return `${(n / 1024 / 1024 / 1024).toFixed(2)} GB`;
|
|
551
|
-
}
|
|
552
|
-
// ── Phase C / C2: engine + colima + K8s probes ─────────────────────────
|
|
553
|
-
/**
|
|
554
|
-
* Probe: detect the active container engine via host-cp's `/health`
|
|
555
|
-
* X-Olam-Engine header (Phase A landed the header in #614). When host-cp
|
|
556
|
-
* is unreachable, the probe FAILs with the same remedy as probeHostCpHealth
|
|
557
|
-
* — operators with a stopped host-cp see one canonical fix, not two.
|
|
558
|
-
*
|
|
559
|
-
* Returns the engine name as part of the PASS message. The doctor row
|
|
560
|
-
* label is engine-agnostic (`engine`); the body surfaces the name.
|
|
561
|
-
* No kubectl jargon — for `engine=kubernetes` we say "kubernetes", not
|
|
562
|
-
* "kubectl context k3d-olam" or similar.
|
|
563
|
-
*/
|
|
564
|
-
export async function probeEngine(fetchImpl = defaultFetch) {
|
|
565
|
-
const controller = new AbortController();
|
|
566
|
-
const timeout = setTimeout(() => controller.abort(), HEALTH_TIMEOUT_MS);
|
|
567
|
-
try {
|
|
568
|
-
const res = await fetchImpl('http://127.0.0.1:19000/health', { signal: controller.signal });
|
|
569
|
-
await res.text().catch(() => '');
|
|
570
|
-
if (res.status !== 200) {
|
|
571
|
-
return {
|
|
572
|
-
ok: false,
|
|
573
|
-
message: `host-cp /health returned ${res.status}; engine unknown`,
|
|
574
|
-
remedy: 'Restart host-cp via `olam host-cp start`; verify port 19000 is bound to 127.0.0.1.',
|
|
575
|
-
};
|
|
576
|
-
}
|
|
577
|
-
const engineHeader = res.headers.get('x-olam-engine') ?? res.headers.get('X-Olam-Engine');
|
|
578
|
-
if (!engineHeader) {
|
|
579
|
-
return {
|
|
580
|
-
ok: true,
|
|
581
|
-
message: 'engine unknown (X-Olam-Engine header absent — older host-cp?)',
|
|
582
|
-
};
|
|
583
|
-
}
|
|
584
|
-
return {
|
|
585
|
-
ok: true,
|
|
586
|
-
message: `engine ${engineHeader}`,
|
|
587
|
-
engineName: engineHeader,
|
|
588
|
-
};
|
|
589
|
-
}
|
|
590
|
-
catch (err) {
|
|
591
|
-
const e = err;
|
|
592
|
-
const reason = e.name === 'AbortError' ? `timeout (${HEALTH_TIMEOUT_MS}ms)` : e.message;
|
|
593
|
-
return {
|
|
594
|
-
ok: false,
|
|
595
|
-
message: `engine probe unreachable: ${reason}`,
|
|
596
|
-
remedy: 'Restart host-cp via `olam host-cp start`; verify port 19000 is bound to 127.0.0.1.',
|
|
597
|
-
};
|
|
598
|
-
}
|
|
599
|
-
finally {
|
|
600
|
-
clearTimeout(timeout);
|
|
601
|
-
}
|
|
602
|
-
}
|
|
603
|
-
/**
|
|
604
|
-
* Probe: Colima version. On macOS / Linux dev hosts using Colima as the
|
|
605
|
-
* Docker daemon, the 0.10.x release line ships a broken
|
|
606
|
-
* `--kubernetes` flag (upstream issue). When detected, surface a WARN
|
|
607
|
-
* with the plan-specced verbatim remediation text.
|
|
608
|
-
*
|
|
609
|
-
* Behaviour matrix:
|
|
610
|
-
* - `colima` binary not on PATH → PASS (most operators don't run Colima)
|
|
611
|
-
* - `colima version` returns non-0.10.x → PASS with the detected version
|
|
612
|
-
* - `colima version` returns 0.10.x → WARN with verbatim remedy
|
|
613
|
-
* - `colima version` errors (binary present, daemon issue, etc.) → PASS
|
|
614
|
-
* with a soft message (don't fail doctor on a tool-specific quirk)
|
|
615
|
-
*/
|
|
616
|
-
export async function probeColimaVersion(dockerExec = defaultDockerExec) {
|
|
617
|
-
// Probe-which: does the binary exist? Spawn `colima --version` so we get
|
|
618
|
-
// both an "is it there?" check and the version in one call. If the
|
|
619
|
-
// first arg is unsupported we fall back to `version`.
|
|
620
|
-
const r = dockerExec('colima', ['version']);
|
|
621
|
-
if (r.status === null || (r.status !== 0 && /not found|ENOENT|not.found/i.test(r.stderr))) {
|
|
622
|
-
// Binary absent — most operators use Docker Desktop / native Docker.
|
|
623
|
-
return { ok: true, message: 'colima not installed (not in use)' };
|
|
624
|
-
}
|
|
625
|
-
if (r.status !== 0) {
|
|
626
|
-
return {
|
|
627
|
-
ok: true,
|
|
628
|
-
message: `colima present but version probe failed: ${(r.stderr || '').trim()}`,
|
|
629
|
-
};
|
|
630
|
-
}
|
|
631
|
-
// `colima version` output starts with e.g. "colima version 0.10.1" or
|
|
632
|
-
// "0.10.1" depending on the build. Tokenise + find the first semver.
|
|
633
|
-
const tokens = r.stdout.split(/\s+/);
|
|
634
|
-
const version = tokens.find((t) => /^v?\d+\.\d+\.\d+/.test(t)) ?? '';
|
|
635
|
-
if (!version) {
|
|
636
|
-
return {
|
|
637
|
-
ok: true,
|
|
638
|
-
message: `colima present but version unrecognised: ${r.stdout.trim().slice(0, 80)}`,
|
|
639
|
-
};
|
|
640
|
-
}
|
|
641
|
-
if (COLIMA_010_RANGE.test(version)) {
|
|
642
|
-
return {
|
|
643
|
-
ok: true,
|
|
644
|
-
warn: true,
|
|
645
|
-
message: `colima ${version} detected — known kubernetes-mode regression`,
|
|
646
|
-
remedy: COLIMA_010_WARN_TEXT,
|
|
647
|
-
};
|
|
648
|
-
}
|
|
649
|
-
return { ok: true, message: `colima ${version} (clear)` };
|
|
650
|
-
}
|
|
651
|
-
/**
|
|
652
|
-
* Probe: K8s API reachable via `kubectl version --output=json --request-timeout=2s`.
|
|
653
|
-
*
|
|
654
|
-
* Replaces probeDockerDaemon at position 1 of the doctor probe array when
|
|
655
|
-
* the active engine is kubernetes (Decision 16 positional contract — the
|
|
656
|
-
* `--json` consumer index stability is load-bearing).
|
|
657
|
-
*
|
|
658
|
-
* No kubectl jargon in the doctor output — this probe's row label stays
|
|
659
|
-
* canonical ("api server") and the message hides the underlying
|
|
660
|
-
* implementation detail.
|
|
661
|
-
*/
|
|
662
|
-
export async function probeK8sApiReachable(exec = defaultDockerExec) {
|
|
663
|
-
// `kubectl version --short` was removed upstream; --output=json + parse.
|
|
664
|
-
const r = exec('kubectl', ['version', '--output=json', '--request-timeout=2s']);
|
|
665
|
-
if (r.status === 0 && r.stdout.length > 0) {
|
|
666
|
-
let parsed;
|
|
667
|
-
try {
|
|
668
|
-
parsed = JSON.parse(r.stdout);
|
|
669
|
-
}
|
|
670
|
-
catch {
|
|
671
|
-
parsed = null;
|
|
672
|
-
}
|
|
673
|
-
const obj = parsed && typeof parsed === 'object' ? parsed : {};
|
|
674
|
-
const serverInfo = obj.serverVersion;
|
|
675
|
-
const gitVersion = typeof serverInfo?.gitVersion === 'string' ? serverInfo.gitVersion : 'unknown';
|
|
676
|
-
return { ok: true, message: `api server ${gitVersion} reachable` };
|
|
677
|
-
}
|
|
678
|
-
return {
|
|
679
|
-
ok: false,
|
|
680
|
-
message: 'api server not reachable',
|
|
681
|
-
remedy: 'Confirm the cluster is up (e.g. `k3d cluster list`) and your context points at it.',
|
|
682
|
-
};
|
|
683
|
-
}
|
|
684
|
-
/**
|
|
685
|
-
* Probe: required olam images are pullable on the K8s engine.
|
|
686
|
-
*
|
|
687
|
-
* Replaces probeImagePresence at position 2 of the doctor probe array when
|
|
688
|
-
* the active engine is kubernetes (Decision 16 positional contract).
|
|
689
|
-
*
|
|
690
|
-
* Implementation note: on k3d / minikube, image presence is per-node and
|
|
691
|
-
* checked via `kubectl get nodes -o json` + inspecting the `status.images`
|
|
692
|
-
* arrays. We probe the host-cp image (`olam-host-cp:latest`) — the canonical
|
|
693
|
-
* minimum-set. If absent, point the operator at `k3d image import` (or the
|
|
694
|
-
* cluster's equivalent) without exposing kubectl in the remedy.
|
|
695
|
-
*/
|
|
696
|
-
export async function probeK8sImagePresence(refs, exec = defaultDockerExec) {
|
|
697
|
-
const r = exec('kubectl', ['get', 'nodes', '-o', 'json', '--request-timeout=2s']);
|
|
698
|
-
if (r.status !== 0) {
|
|
699
|
-
return {
|
|
700
|
-
ok: false,
|
|
701
|
-
message: 'unable to list cluster nodes for image presence check',
|
|
702
|
-
remedy: 'Confirm the cluster is up and your context points at it; re-run `olam doctor`.',
|
|
703
|
-
};
|
|
704
|
-
}
|
|
705
|
-
let parsed;
|
|
706
|
-
try {
|
|
707
|
-
parsed = JSON.parse(r.stdout);
|
|
708
|
-
}
|
|
709
|
-
catch {
|
|
710
|
-
return {
|
|
711
|
-
ok: false,
|
|
712
|
-
message: 'cluster node list returned malformed output',
|
|
713
|
-
remedy: 'Restart your cluster; if persistent, re-create it.',
|
|
714
|
-
};
|
|
715
|
-
}
|
|
716
|
-
const nodes = parsed && typeof parsed === 'object'
|
|
717
|
-
? parsed.items
|
|
718
|
-
: undefined;
|
|
719
|
-
if (!Array.isArray(nodes) || nodes.length === 0) {
|
|
720
|
-
return {
|
|
721
|
-
ok: false,
|
|
722
|
-
message: 'cluster has no nodes',
|
|
723
|
-
remedy: 'Start the cluster and try again.',
|
|
724
|
-
};
|
|
725
|
-
}
|
|
726
|
-
const presentImages = new Set();
|
|
727
|
-
for (const node of nodes) {
|
|
728
|
-
const status = node.status;
|
|
729
|
-
const images = status?.images;
|
|
730
|
-
if (!Array.isArray(images))
|
|
731
|
-
continue;
|
|
732
|
-
for (const img of images) {
|
|
733
|
-
const names = img.names;
|
|
734
|
-
if (!Array.isArray(names))
|
|
735
|
-
continue;
|
|
736
|
-
for (const n of names)
|
|
737
|
-
presentImages.add(n);
|
|
738
|
-
}
|
|
739
|
-
}
|
|
740
|
-
for (const ref of refs) {
|
|
741
|
-
if (!hasImageRef(presentImages, ref)) {
|
|
742
|
-
return {
|
|
743
|
-
ok: false,
|
|
744
|
-
message: `image ${ref} not present on any cluster node`,
|
|
745
|
-
remedy: 'Run `olam bootstrap` to import the published image into the cluster.',
|
|
746
|
-
};
|
|
747
|
-
}
|
|
748
|
-
}
|
|
749
|
-
return { ok: true, message: `${refs.length} image(s) present on cluster` };
|
|
750
|
-
}
|
|
751
|
-
function hasImageRef(present, ref) {
|
|
752
|
-
if (present.has(ref))
|
|
753
|
-
return true;
|
|
754
|
-
// k3d / containerd often prefix with `docker.io/library/` for bare names.
|
|
755
|
-
const variants = [`docker.io/library/${ref}`, `docker.io/${ref}`];
|
|
756
|
-
return variants.some((v) => present.has(v));
|
|
757
|
-
}
|
|
758
|
-
/**
|
|
759
|
-
* Default implementation: checks the provided context name (or reads
|
|
760
|
-
* `kubectl config current-context` when omitted) against well-known prefixes.
|
|
761
|
-
*
|
|
762
|
-
* Heuristic (fail-open → falls back to k3d remedy as safe default):
|
|
763
|
-
* - context starts with 'colima' → 'colima'
|
|
764
|
-
* - context starts with 'k3d-' → 'k3d'
|
|
765
|
-
* - else → 'unknown'
|
|
766
|
-
*/
|
|
767
|
-
export function defaultDetectK8sClusterType(kubectlContext) {
|
|
768
|
-
const ctx = kubectlContext ?? readCurrentKubectlContext();
|
|
769
|
-
if (!ctx)
|
|
770
|
-
return 'unknown';
|
|
771
|
-
if (ctx.startsWith('colima'))
|
|
772
|
-
return 'colima';
|
|
773
|
-
if (ctx.startsWith('k3d-'))
|
|
774
|
-
return 'k3d';
|
|
775
|
-
return 'unknown';
|
|
776
|
-
}
|
|
777
|
-
function readCurrentKubectlContext() {
|
|
778
|
-
const r = spawnSync('kubectl', ['config', 'current-context'], {
|
|
779
|
-
encoding: 'utf-8',
|
|
780
|
-
stdio: ['ignore', 'pipe', 'pipe'],
|
|
781
|
-
});
|
|
782
|
-
if (r.status !== 0)
|
|
783
|
-
return undefined;
|
|
784
|
-
return r.stdout?.trim() || undefined;
|
|
785
|
-
}
|
|
786
|
-
// ── ADR 021: Colima kubernetes.enabled detection ──────────────────────────────
|
|
787
|
-
/**
|
|
788
|
-
* Probe: detect whether Colima has `kubernetes.enabled: true` in its profile config.
|
|
789
|
-
*
|
|
790
|
-
* Used by `olam setup` Phase 1 (Colima lint, ADR 021).
|
|
791
|
-
*
|
|
792
|
-
* Returns:
|
|
793
|
-
* - PASS (ok:true, warn:false) when:
|
|
794
|
-
* - platform is not darwin (Colima is macOS-mostly — skip lint on Linux)
|
|
795
|
-
* - Colima profile YAML does not exist
|
|
796
|
-
* - `kubernetes.enabled` is not `true`
|
|
797
|
-
* - WARN (ok:true, warn:true) when `kubernetes.enabled: true` is found
|
|
798
|
-
*
|
|
799
|
-
* The lint is a WARNING, not a hard fail — the operator may know what they're
|
|
800
|
-
* doing (e.g. intentional --reuse-cluster=colima usage).
|
|
801
|
-
*
|
|
802
|
-
* @param platform - os.platform() result (injectable for tests)
|
|
803
|
-
* @param home - operator's home directory (injectable for tests)
|
|
804
|
-
* @param colimaProfile - Colima profile name (default: $COLIMA_PROFILE or 'default')
|
|
805
|
-
* @param readFileFn - injectable fs.readFileSync for tests
|
|
806
|
-
* @param existsFn - injectable fs.existsSync for tests
|
|
807
|
-
*/
|
|
808
|
-
export function probeColimaKubernetesEnabled(opts) {
|
|
809
|
-
const { platform, home } = opts;
|
|
810
|
-
const colimaProfile = opts.colimaProfile ?? process.env.COLIMA_PROFILE ?? 'default';
|
|
811
|
-
const readFileFn = opts.readFileFn ?? ((p, enc) => readFileSync(p, enc));
|
|
812
|
-
const existsFn = opts.existsFn ?? existsSync;
|
|
813
|
-
// Only relevant on macOS
|
|
814
|
-
if (platform !== 'darwin') {
|
|
815
|
-
return { ok: true, message: 'colima k8s lint: not darwin, skip' };
|
|
816
|
-
}
|
|
817
|
-
const colimaYamlPath = path.join(home, '.colima', colimaProfile, 'colima.yaml');
|
|
818
|
-
if (!existsFn(colimaYamlPath)) {
|
|
819
|
-
return { ok: true, message: `colima k8s lint: ${colimaYamlPath} not found, skip` };
|
|
820
|
-
}
|
|
821
|
-
let yaml;
|
|
822
|
-
try {
|
|
823
|
-
yaml = readFileFn(colimaYamlPath, 'utf8');
|
|
824
|
-
}
|
|
825
|
-
catch {
|
|
826
|
-
return { ok: true, message: `colima k8s lint: could not read ${colimaYamlPath}` };
|
|
827
|
-
}
|
|
828
|
-
// Heuristic: find the `kubernetes:` section and look for `enabled: true` within it.
|
|
829
|
-
// Colima YAML looks like:
|
|
830
|
-
// kubernetes:
|
|
831
|
-
// enabled: true
|
|
832
|
-
// ...
|
|
833
|
-
const kubernetesSection = yaml.split(/^kubernetes:/m)[1];
|
|
834
|
-
if (!kubernetesSection) {
|
|
835
|
-
return { ok: true, message: 'colima k8s lint: no kubernetes section found' };
|
|
836
|
-
}
|
|
837
|
-
// Read until the next top-level key (unindented line)
|
|
838
|
-
const sectionLines = kubernetesSection.split('\n');
|
|
839
|
-
const sectionBody = [];
|
|
840
|
-
for (const line of sectionLines) {
|
|
841
|
-
// A non-empty, non-indented line starts the next top-level key
|
|
842
|
-
if (line.length > 0 && !/^\s/.test(line))
|
|
843
|
-
break;
|
|
844
|
-
sectionBody.push(line);
|
|
845
|
-
}
|
|
846
|
-
const section = sectionBody.join('\n');
|
|
847
|
-
const enabled = /^\s+enabled:\s*true\s*$/m.test(section);
|
|
848
|
-
if (!enabled) {
|
|
849
|
-
return { ok: true, message: 'colima k8s lint: kubernetes.enabled is not true' };
|
|
850
|
-
}
|
|
851
|
-
return {
|
|
852
|
-
ok: true,
|
|
853
|
-
warn: true,
|
|
854
|
-
message: `Colima has Kubernetes mode enabled at profile '${colimaProfile}'`,
|
|
855
|
-
remedy: `Colima has Kubernetes mode enabled at profile '${colimaProfile}'. `
|
|
856
|
-
+ `k3d will attempt to coexist but may fail to start with 'context deadline exceeded' `
|
|
857
|
-
+ `due to port conflicts. To fix: \`colima stop && colima start --kubernetes=false\`, `
|
|
858
|
-
+ `OR re-run \`olam setup --reuse-cluster=colima\` to use Colima's existing k3s.`,
|
|
859
|
-
};
|
|
860
|
-
}
|
|
861
|
-
// ── Setup wizard probes (binary-presence checks, not cluster connectivity) ─────
|
|
862
|
-
/**
|
|
863
|
-
* Probe: `kubectl` binary on PATH.
|
|
864
|
-
*
|
|
865
|
-
* Checks for the binary via `kubectl version --client --output=json`.
|
|
866
|
-
* Does NOT require a live cluster — client-only check. Used by the
|
|
867
|
-
* kubernetes substrate path of `olam setup` Phase 1 system check.
|
|
868
|
-
*/
|
|
869
|
-
export async function probeKubectl(exec = defaultDockerExec) {
|
|
870
|
-
const r = exec('kubectl', ['version', '--client', '--output=json']);
|
|
871
|
-
if (r.status === 0 && r.stdout.length > 0) {
|
|
872
|
-
let clientVersion = 'unknown';
|
|
873
|
-
try {
|
|
874
|
-
const parsed = JSON.parse(r.stdout);
|
|
875
|
-
const clientInfo = parsed.clientVersion;
|
|
876
|
-
if (typeof clientInfo?.gitVersion === 'string') {
|
|
877
|
-
clientVersion = clientInfo.gitVersion;
|
|
878
|
-
}
|
|
879
|
-
}
|
|
880
|
-
catch {
|
|
881
|
-
// version string unavailable; probe still passes
|
|
882
|
-
}
|
|
883
|
-
return { ok: true, message: `kubectl ${clientVersion} on PATH` };
|
|
884
|
-
}
|
|
885
|
-
return {
|
|
886
|
-
ok: false,
|
|
887
|
-
message: 'kubectl not found on PATH',
|
|
888
|
-
remedy: 'Install kubectl: macOS: `brew install kubectl`; Linux: https://kubernetes.io/docs/tasks/tools/install-kubectl-linux/',
|
|
889
|
-
};
|
|
890
|
-
}
|
|
891
|
-
/**
|
|
892
|
-
* Probe: `k3d` binary on PATH (macOS kubernetes substrate).
|
|
893
|
-
*
|
|
894
|
-
* Used by `olam setup --substrate=kubernetes` Phase 1 on macOS to
|
|
895
|
-
* distinguish "k3d missing" (defer to Phase 1.5 install) from
|
|
896
|
-
* "k3d present". Returns ok:false so Phase 1.5 knows to install.
|
|
897
|
-
*/
|
|
898
|
-
export async function probeK3d(exec = defaultDockerExec) {
|
|
899
|
-
const r = exec('k3d', ['version']);
|
|
900
|
-
if (r.status === 0 && r.stdout.length > 0) {
|
|
901
|
-
const versionLine = r.stdout.trim().split('\n')[0] ?? '';
|
|
902
|
-
return { ok: true, message: `k3d ${versionLine} on PATH` };
|
|
903
|
-
}
|
|
904
|
-
return {
|
|
905
|
-
ok: false,
|
|
906
|
-
message: 'k3d not found on PATH',
|
|
907
|
-
remedy: 'Install k3d: `brew install k3d` (macOS) or curl -s https://raw.githubusercontent.com/k3d-io/k3d/main/install.sh | bash',
|
|
908
|
-
};
|
|
909
|
-
}
|
|
910
|
-
/**
|
|
911
|
-
* Build the doctor/upgrade remedy text for a missing docker socket bind-mount.
|
|
912
|
-
* Colima operators need `colima start --kubernetes` with the socket mount flag;
|
|
913
|
-
* k3d operators need `k3d cluster create` with the --volume flag.
|
|
914
|
-
* Issue #713 fix: no longer k3d-only.
|
|
915
|
-
*/
|
|
916
|
-
export function buildDockerSocketRemedy(clusterType) {
|
|
917
|
-
if (clusterType === 'colima') {
|
|
918
|
-
return ('Recreate the Colima k3s cluster with the docker socket bind-mount:\n' +
|
|
919
|
-
' colima stop\n' +
|
|
920
|
-
' colima start --kubernetes \\\n' +
|
|
921
|
-
' --mount /var/run/docker.sock:/var/run/docker.sock:w \\\n' +
|
|
922
|
-
' --mount ~/.config/gh:/host/.config/gh:r\n' +
|
|
923
|
-
'Then run: olam upgrade');
|
|
924
|
-
}
|
|
925
|
-
// k3d or unknown — emit the k3d command as the safe default.
|
|
926
|
-
return ('Recreate the k3d cluster with the docker socket bind-mount:\n' +
|
|
927
|
-
' k3d cluster create olam-host \\\n' +
|
|
928
|
-
' --volume /var/run/docker.sock:/var/run/docker.sock@server:* \\\n' +
|
|
929
|
-
' --volume ~/.config/gh:/host/.config/gh \\\n' +
|
|
930
|
-
' --wait --timeout 90s\n' +
|
|
931
|
-
'Then run: olam upgrade');
|
|
932
|
-
}
|
|
933
|
-
//# sourceMappingURL=health-probes.js.map
|