@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,1002 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* bootstrap-kubernetes.ts — k3s mode of `olam bootstrap`.
|
|
3
|
-
*
|
|
4
|
-
* Wraps the legacy `scripts/dogfood/up.sh` reference flow into a CLI
|
|
5
|
-
* routine so external operators with only the published `@pleri/olam-cli`
|
|
6
|
-
* tarball (no access to the private `pleri/olam` repo) can bring up an
|
|
7
|
-
* end-to-end olam-on-k3s stack with one command.
|
|
8
|
-
*
|
|
9
|
-
* Steps (idempotent):
|
|
10
|
-
* 0. Preflight — detect required tools (k3d, kubectl, helm, jq, curl,
|
|
11
|
-
* openssl, gh, docker). With --auto-install on macOS, run `brew
|
|
12
|
-
* install` for missing brew-formulae.
|
|
13
|
-
* 1. Secrets — generate `~/.olam/{auth-secret,kg-bearer-token,
|
|
14
|
-
* auth-db-secret,mcp-auth-jwt-secret,memory-bearer-secret}` if absent.
|
|
15
|
-
* 2. Container runtime (macOS only) — honour host.preferred_runtime;
|
|
16
|
-
* auto-detect otherwise (prefer an installed Docker Desktop over
|
|
17
|
-
* imposing Colima). For Docker Desktop: select the `desktop-linux`
|
|
18
|
-
* context + ensure the daemon is up. For Colima: ensure running +
|
|
19
|
-
* chmod /var/run/docker.sock inside the VM (virtiofs mitigation).
|
|
20
|
-
* 3. k3d cluster — create `<cluster>` with the gh-config bind. Skipped
|
|
21
|
-
* if cluster already exists.
|
|
22
|
-
* 4. Observability — chain bundled scripts in `<install>/host-cp/
|
|
23
|
-
* observability/` to install Loki + Promtail + Grafana +
|
|
24
|
-
* kube-prometheus-stack + Kyverno admission policy.
|
|
25
|
-
* 5. Delegate to `olam upgrade -y` — that flow handles namespace + RBAC
|
|
26
|
-
* + secrets + ghcr-pull + host-side docker-socket-proxy +
|
|
27
|
-
* manifest apply + rollout + verify.
|
|
28
|
-
*
|
|
29
|
-
* Note: `olam upgrade` already ships the 8-step k8s flow in
|
|
30
|
-
* `upgrade-kubernetes.ts` (Phase 1b C2 + Phase 2 C/D). This module is
|
|
31
|
-
* the prereq + cluster-create + observability wrapper around it.
|
|
32
|
-
*/
|
|
33
|
-
import { spawn, spawnSync } from "node:child_process";
|
|
34
|
-
import { existsSync, mkdirSync, readdirSync, readFileSync, writeFileSync, chmodSync, statSync, } from "node:fs";
|
|
35
|
-
import { join } from "node:path";
|
|
36
|
-
import { homedir, platform } from "node:os";
|
|
37
|
-
import { randomBytes } from "node:crypto";
|
|
38
|
-
import pc from "picocolors";
|
|
39
|
-
import ora from "ora";
|
|
40
|
-
import { printError, printSuccess, printInfo, printWarning, printHeader, } from "../output.js";
|
|
41
|
-
import { installRoot } from "../install-root.js";
|
|
42
|
-
import { resolveK8sAssetsRoot } from "./k8s-bootstrap.js";
|
|
43
|
-
import { canonicalSecretPath, ensureSecretsDir } from "@olam/core/src/secrets/paths.js";
|
|
44
|
-
const OLAM_HOME = join(homedir(), ".olam");
|
|
45
|
-
export const DEFAULT_K3S_CLUSTER = "olam-host";
|
|
46
|
-
const REQUIRED_TOOLS = [
|
|
47
|
-
{ name: "k3d", brew: "k3d" },
|
|
48
|
-
{ name: "kubectl", brew: "kubectl" },
|
|
49
|
-
{ name: "helm", brew: "helm" },
|
|
50
|
-
{ name: "jq", brew: "jq" },
|
|
51
|
-
{
|
|
52
|
-
name: "curl",
|
|
53
|
-
hint: "expected on macOS by default; `apt install curl` on linux",
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
name: "openssl",
|
|
57
|
-
hint: "expected on macOS by default; `apt install openssl` on linux",
|
|
58
|
-
},
|
|
59
|
-
{ name: "gh", brew: "gh", hint: "after install: `gh auth login`" },
|
|
60
|
-
{ name: "docker", hint: "Docker Desktop, or colima on macOS" },
|
|
61
|
-
];
|
|
62
|
-
const SECRET_FILES = [
|
|
63
|
-
"auth-secret",
|
|
64
|
-
"kg-bearer-token",
|
|
65
|
-
"auth-db-secret",
|
|
66
|
-
"mcp-auth-jwt-secret",
|
|
67
|
-
"memory-bearer-secret",
|
|
68
|
-
];
|
|
69
|
-
const OBSERVABILITY_SCRIPTS = [
|
|
70
|
-
"loki-ingest.sh",
|
|
71
|
-
"grafana-port-forward.sh",
|
|
72
|
-
"prom-no-double-grafana.sh",
|
|
73
|
-
"kyverno-cardinality-mutate.sh",
|
|
74
|
-
];
|
|
75
|
-
/** Wraps `command -v <tool>` returning true when the binary is on PATH. */
|
|
76
|
-
function hasTool(tool) {
|
|
77
|
-
const result = spawnSync("command", ["-v", tool], {
|
|
78
|
-
shell: true,
|
|
79
|
-
stdio: "pipe",
|
|
80
|
-
});
|
|
81
|
-
return result.status === 0;
|
|
82
|
-
}
|
|
83
|
-
function detectMissingTools() {
|
|
84
|
-
return REQUIRED_TOOLS.filter((tool) => !hasTool(tool.name));
|
|
85
|
-
}
|
|
86
|
-
function runOrFail(cmd, args, description) {
|
|
87
|
-
const result = spawnSync(cmd, args, { stdio: "inherit" });
|
|
88
|
-
if (result.status !== 0) {
|
|
89
|
-
printError(`${description} failed (exit ${result.status ?? "signal"})`);
|
|
90
|
-
process.exit(result.status ?? 1);
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
function runCapture(cmd, args) {
|
|
94
|
-
const result = spawnSync(cmd, args, { encoding: "utf8" });
|
|
95
|
-
return {
|
|
96
|
-
ok: result.status === 0,
|
|
97
|
-
stdout: result.stdout ?? "",
|
|
98
|
-
stderr: result.stderr ?? "",
|
|
99
|
-
};
|
|
100
|
-
}
|
|
101
|
-
function step(label) {
|
|
102
|
-
process.stdout.write("\n" + pc.bold(pc.cyan(`==> ${label}`)) + "\n");
|
|
103
|
-
}
|
|
104
|
-
/** Truncate a single status line so the spinner never wraps the terminal. */
|
|
105
|
-
function truncate(text, max) {
|
|
106
|
-
const clean = text.replace(/\s+/g, " ").trim();
|
|
107
|
-
return clean.length > max ? clean.slice(0, max - 1) + "…" : clean;
|
|
108
|
-
}
|
|
109
|
-
/**
|
|
110
|
-
* Run a child process with live, single-line progress (default) or full
|
|
111
|
-
* sequential streaming (verbose / non-TTY). Combined stdout+stderr is always
|
|
112
|
-
* captured to `~/.olam/logs/<logName>.log` for post-hoc debugging regardless
|
|
113
|
-
* of mode. Async (uses `spawn`) so the spinner can actually animate — the
|
|
114
|
-
* legacy `spawnSync` path blocked the event loop and showed nothing for the
|
|
115
|
-
* full 90-155s of each observability script.
|
|
116
|
-
*/
|
|
117
|
-
export function runLiveTask(label, cmd, args, opts) {
|
|
118
|
-
const logDir = join(homedir(), ".olam", "logs");
|
|
119
|
-
mkdirSync(logDir, { recursive: true });
|
|
120
|
-
const logPath = join(logDir, `${opts.logName}.log`);
|
|
121
|
-
const startMs = Date.now();
|
|
122
|
-
const settle = opts.settle ?? "auto";
|
|
123
|
-
const useSpinner = !opts.verbose && Boolean(process.stdout.isTTY);
|
|
124
|
-
return new Promise((resolve) => {
|
|
125
|
-
const child = spawn(cmd, [...args], {
|
|
126
|
-
env: opts.env ?? process.env,
|
|
127
|
-
stdio: ["ignore", "pipe", "pipe"],
|
|
128
|
-
});
|
|
129
|
-
const chunks = [];
|
|
130
|
-
let latestLine = "";
|
|
131
|
-
let outBuf = "";
|
|
132
|
-
let errBuf = "";
|
|
133
|
-
const spinner = useSpinner ? ora({ text: label }).start() : null;
|
|
134
|
-
const elapsed = () => ((Date.now() - startMs) / 1000).toFixed(0);
|
|
135
|
-
const render = () => {
|
|
136
|
-
if (!spinner)
|
|
137
|
-
return;
|
|
138
|
-
const suffix = latestLine ? ` ${pc.dim("·")} ${truncate(latestLine, 60)}` : "";
|
|
139
|
-
spinner.text = `${label}${suffix} ${pc.dim(`(${elapsed()}s)`)}`;
|
|
140
|
-
};
|
|
141
|
-
const ticker = spinner ? setInterval(render, 1000) : null;
|
|
142
|
-
if (ticker && typeof ticker.unref === "function")
|
|
143
|
-
ticker.unref();
|
|
144
|
-
const onData = (buf, which) => {
|
|
145
|
-
const text = buf.toString("utf-8");
|
|
146
|
-
chunks.push(text);
|
|
147
|
-
const acc = (which === "out" ? outBuf : errBuf) + text;
|
|
148
|
-
const lines = acc.split("\n");
|
|
149
|
-
const remainder = lines.pop() ?? "";
|
|
150
|
-
if (which === "out")
|
|
151
|
-
outBuf = remainder;
|
|
152
|
-
else
|
|
153
|
-
errBuf = remainder;
|
|
154
|
-
for (const raw of lines) {
|
|
155
|
-
const line = raw.replace(/\s+$/, "");
|
|
156
|
-
if (line.length === 0)
|
|
157
|
-
continue;
|
|
158
|
-
if (spinner) {
|
|
159
|
-
latestLine = line;
|
|
160
|
-
render();
|
|
161
|
-
}
|
|
162
|
-
else if (opts.verbose) {
|
|
163
|
-
process.stdout.write(` ${pc.dim(`[${label}]`)} ${line}\n`);
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
};
|
|
167
|
-
child.stdout?.on("data", (b) => onData(b, "out"));
|
|
168
|
-
child.stderr?.on("data", (b) => onData(b, "err"));
|
|
169
|
-
const finalize = (code) => {
|
|
170
|
-
if (ticker)
|
|
171
|
-
clearInterval(ticker);
|
|
172
|
-
const durationMs = Date.now() - startMs;
|
|
173
|
-
writeFileSync(logPath, chunks.join(""), "utf-8");
|
|
174
|
-
const ok = code === 0;
|
|
175
|
-
const secs = `${(durationMs / 1000).toFixed(1)}s`;
|
|
176
|
-
if (spinner) {
|
|
177
|
-
if (settle === "auto") {
|
|
178
|
-
if (ok)
|
|
179
|
-
spinner.succeed(`${label} ${pc.dim(`(${secs})`)}`);
|
|
180
|
-
else
|
|
181
|
-
spinner.fail(`${label} — failed (${secs}) — log=${logPath}`);
|
|
182
|
-
}
|
|
183
|
-
else {
|
|
184
|
-
// Caller owns the final line; clear the transient progress line.
|
|
185
|
-
spinner.stop();
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
else if (settle === "auto") {
|
|
189
|
-
// No spinner (verbose or non-TTY): the live line never rendered, so emit
|
|
190
|
-
// a plain terminal status line. Manual-settle callers print their own.
|
|
191
|
-
if (ok) {
|
|
192
|
-
process.stdout.write(`${pc.green("ok")} ${label} ${pc.dim(`(${secs})`)}\n`);
|
|
193
|
-
}
|
|
194
|
-
else {
|
|
195
|
-
process.stderr.write(`${pc.red("error")} ${label} — failed (${secs}) — log=${logPath}\n`);
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
resolve({ ok, exitCode: code, durationMs, logPath });
|
|
199
|
-
};
|
|
200
|
-
child.on("error", (err) => {
|
|
201
|
-
chunks.push(`\n[spawn error] ${err.message}\n`);
|
|
202
|
-
finalize(-1);
|
|
203
|
-
});
|
|
204
|
-
child.on("close", (code) => finalize(code));
|
|
205
|
-
});
|
|
206
|
-
}
|
|
207
|
-
function preflight(opts) {
|
|
208
|
-
step("0/7 — preflight (tool detection)");
|
|
209
|
-
const missing = detectMissingTools();
|
|
210
|
-
if (missing.length === 0) {
|
|
211
|
-
printSuccess("all required tools present");
|
|
212
|
-
}
|
|
213
|
-
else if (opts.autoInstall && platform() === "darwin") {
|
|
214
|
-
const brewable = missing.filter((t) => t.brew);
|
|
215
|
-
if (brewable.length > 0) {
|
|
216
|
-
printInfo("auto-install", `${brewable.length} brew formula(s): ${brewable.map((t) => t.brew).join(", ")}`);
|
|
217
|
-
runOrFail("brew", ["install", ...brewable.map((t) => t.brew)], "brew install");
|
|
218
|
-
}
|
|
219
|
-
const stillMissing = detectMissingTools();
|
|
220
|
-
if (stillMissing.length > 0) {
|
|
221
|
-
printError("tools still missing after auto-install:");
|
|
222
|
-
for (const t of stillMissing) {
|
|
223
|
-
process.stderr.write(` - ${t.name}${t.hint ? ` — ${t.hint}` : ""}\n`);
|
|
224
|
-
}
|
|
225
|
-
process.exit(1);
|
|
226
|
-
}
|
|
227
|
-
printSuccess("all required tools present after auto-install");
|
|
228
|
-
}
|
|
229
|
-
else {
|
|
230
|
-
printError(`${missing.length} required tool(s) missing:`);
|
|
231
|
-
for (const t of missing) {
|
|
232
|
-
const hint = t.brew
|
|
233
|
-
? `brew install ${t.brew}`
|
|
234
|
-
: (t.hint ?? "(install manually)");
|
|
235
|
-
process.stderr.write(` - ${pc.bold(t.name)}: ${hint}\n`);
|
|
236
|
-
}
|
|
237
|
-
process.stderr.write("\nRe-run with --auto-install on macOS to install brew-formulae automatically.\n");
|
|
238
|
-
process.exit(1);
|
|
239
|
-
}
|
|
240
|
-
// gh auth — honour env-var auth (GH_TOKEN / GITHUB_TOKEN). `gh auth status`
|
|
241
|
-
// exits non-zero when auth comes from env even though the user IS authenticated
|
|
242
|
-
// (gh prints "✓ Logged in (GH_TOKEN)" but returns exit code 1 because no
|
|
243
|
-
// gh-managed credential is stored). Don't fail bootstrap on that case —
|
|
244
|
-
// exercise the token directly via `gh api user` which actually validates it.
|
|
245
|
-
const authStatus = runCapture("gh", ["auth", "status"]);
|
|
246
|
-
const ghTokenSet = !!(process.env.GH_TOKEN || process.env.GITHUB_TOKEN);
|
|
247
|
-
if (!authStatus.ok && !ghTokenSet) {
|
|
248
|
-
printError("gh is not authenticated — run: gh auth login");
|
|
249
|
-
process.exit(1);
|
|
250
|
-
}
|
|
251
|
-
if (!authStatus.ok && ghTokenSet) {
|
|
252
|
-
// Env-var token present but gh auth status non-zero. Validate by hitting
|
|
253
|
-
// the API. If that fails too, the token is bad/expired.
|
|
254
|
-
if (!runCapture("gh", ["api", "user", "--jq", ".login"]).ok) {
|
|
255
|
-
printError("GH_TOKEN/GITHUB_TOKEN set but invalid — `gh api user` failed");
|
|
256
|
-
process.exit(1);
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
printSuccess("gh authenticated");
|
|
260
|
-
// docker reachability. On macOS the runtime (Docker Desktop / Colima)
|
|
261
|
-
// may not be started yet — ensureContainerRuntime (step 2/7) brings it
|
|
262
|
-
// up, so a cold daemon here is only a warning. On Linux the operator
|
|
263
|
-
// owns the daemon, so an unreachable daemon stays a hard failure.
|
|
264
|
-
if (!runCapture("docker", ["info"]).ok) {
|
|
265
|
-
if (platform() === "darwin") {
|
|
266
|
-
printWarning("docker daemon not reachable yet — starting the container runtime next");
|
|
267
|
-
}
|
|
268
|
-
else {
|
|
269
|
-
printError("docker daemon unreachable — start Docker Desktop or colima");
|
|
270
|
-
process.exit(1);
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
else {
|
|
274
|
-
printSuccess("docker daemon reachable");
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
function ensureSecrets() {
|
|
278
|
-
step("1/7 — operator secrets");
|
|
279
|
-
mkdirSync(OLAM_HOME, { recursive: true });
|
|
280
|
-
ensureSecretsDir();
|
|
281
|
-
for (const name of SECRET_FILES) {
|
|
282
|
-
// Write to canonical new location (~/.olam/secrets/<name>).
|
|
283
|
-
const newPath = canonicalSecretPath(name);
|
|
284
|
-
// Legacy path — if it already exists there, skip (migration handles move).
|
|
285
|
-
const legacyPath = join(OLAM_HOME, name);
|
|
286
|
-
if (existsSync(newPath) || existsSync(legacyPath)) {
|
|
287
|
-
printInfo("skip", `~/.olam/secrets/${name} already exists`);
|
|
288
|
-
continue;
|
|
289
|
-
}
|
|
290
|
-
const hex = randomBytes(32).toString("hex");
|
|
291
|
-
writeFileSync(newPath, hex + "\n", { encoding: "utf8", mode: 0o600 });
|
|
292
|
-
chmodSync(newPath, 0o600);
|
|
293
|
-
printSuccess(`generated ~/.olam/secrets/${name}`);
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
/**
|
|
297
|
-
* Decide which macOS container runtime to drive for the k3d node.
|
|
298
|
-
*
|
|
299
|
-
* Explicit operator preference (from `~/.olam/config.json
|
|
300
|
-
* host.preferred_runtime`) always wins. When unset, prefer an installed
|
|
301
|
-
* Docker Desktop over Colima — i.e. never impose a second Colima VM onto
|
|
302
|
-
* a machine that already runs Docker Desktop. Pure function: the
|
|
303
|
-
* detection result is injected so it stays unit-testable.
|
|
304
|
-
*/
|
|
305
|
-
export function resolveMacRuntime(preferred, dockerDesktopInstalled) {
|
|
306
|
-
if (preferred)
|
|
307
|
-
return preferred;
|
|
308
|
-
return dockerDesktopInstalled ? "docker-desktop" : "colima";
|
|
309
|
-
}
|
|
310
|
-
/** True when the Docker Desktop app bundle is present on this Mac. */
|
|
311
|
-
function isDockerDesktopInstalled() {
|
|
312
|
-
return existsSync("/Applications/Docker.app");
|
|
313
|
-
}
|
|
314
|
-
/** True when the active docker context has a reachable daemon. */
|
|
315
|
-
function dockerDaemonReachable() {
|
|
316
|
-
return runCapture("docker", ["info"]).ok;
|
|
317
|
-
}
|
|
318
|
-
/**
|
|
319
|
-
* macOS container-runtime bring-up (step 2/7). Honours
|
|
320
|
-
* `opts.preferredRuntime`; auto-detects Docker Desktop otherwise. k3d
|
|
321
|
-
* runs its k3s node on whichever daemon the *active docker context*
|
|
322
|
-
* points at, so this both selects the runtime and points the context at
|
|
323
|
-
* it before `k3d cluster create`. No-op on non-darwin (Linux operators
|
|
324
|
-
* manage their own daemon).
|
|
325
|
-
*/
|
|
326
|
-
function ensureContainerRuntime(opts) {
|
|
327
|
-
if (platform() !== "darwin")
|
|
328
|
-
return;
|
|
329
|
-
const runtime = resolveMacRuntime(opts.preferredRuntime, isDockerDesktopInstalled());
|
|
330
|
-
if (runtime === "external-k8s") {
|
|
331
|
-
step("2/7 — container runtime (external-k8s)");
|
|
332
|
-
printInfo("runtime", "preferred_runtime=external-k8s — not managing Docker Desktop/Colima");
|
|
333
|
-
return;
|
|
334
|
-
}
|
|
335
|
-
if (runtime === "docker-desktop") {
|
|
336
|
-
ensureDockerDesktop();
|
|
337
|
-
return;
|
|
338
|
-
}
|
|
339
|
-
ensureColima();
|
|
340
|
-
}
|
|
341
|
-
/**
|
|
342
|
-
* Ensure Docker Desktop is the active docker context and its daemon is
|
|
343
|
-
* up. Starts the app (`open -a Docker`) and polls `docker info` for up to
|
|
344
|
-
* ~90s when the daemon isn't ready yet. Used instead of Colima whenever
|
|
345
|
-
* Docker Desktop is the resolved runtime.
|
|
346
|
-
*/
|
|
347
|
-
function ensureDockerDesktop() {
|
|
348
|
-
step("2/7 — Docker Desktop (macOS)");
|
|
349
|
-
// Point the docker CLI at Docker Desktop's daemon. `desktop-linux` is
|
|
350
|
-
// Docker Desktop's macOS context name; k3d reads the active context to
|
|
351
|
-
// choose where the k3s node container runs. Non-fatal if the context is
|
|
352
|
-
// already current or named differently on exotic installs.
|
|
353
|
-
if (runCapture("docker", ["context", "use", "desktop-linux"]).ok) {
|
|
354
|
-
printSuccess("docker context → desktop-linux");
|
|
355
|
-
}
|
|
356
|
-
else {
|
|
357
|
-
printWarning("could not select the 'desktop-linux' docker context — using the current context");
|
|
358
|
-
}
|
|
359
|
-
if (dockerDaemonReachable()) {
|
|
360
|
-
printSuccess("Docker Desktop daemon reachable");
|
|
361
|
-
return;
|
|
362
|
-
}
|
|
363
|
-
printWarning("Docker Desktop not running — starting (open -a Docker)");
|
|
364
|
-
runCapture("open", ["-a", "Docker"]);
|
|
365
|
-
for (let waited = 0; waited < 90; waited += 3) {
|
|
366
|
-
spawnSync("sleep", ["3"]);
|
|
367
|
-
if (dockerDaemonReachable()) {
|
|
368
|
-
printSuccess(`Docker Desktop daemon reachable (after ~${waited + 3}s)`);
|
|
369
|
-
return;
|
|
370
|
-
}
|
|
371
|
-
}
|
|
372
|
-
printError("Docker Desktop did not become ready within 90s — start it manually and re-run `olam bootstrap`");
|
|
373
|
-
process.exit(1);
|
|
374
|
-
}
|
|
375
|
-
function ensureColima() {
|
|
376
|
-
if (platform() !== "darwin")
|
|
377
|
-
return;
|
|
378
|
-
step("2/7 — colima (macOS)");
|
|
379
|
-
if (!runCapture("colima", ["status"]).ok) {
|
|
380
|
-
printWarning("colima not running — starting");
|
|
381
|
-
runOrFail("colima", [
|
|
382
|
-
"start",
|
|
383
|
-
"--cpu",
|
|
384
|
-
"4",
|
|
385
|
-
"--memory",
|
|
386
|
-
"8",
|
|
387
|
-
"--vm-type=vz",
|
|
388
|
-
"--mount-type=virtiofs",
|
|
389
|
-
], "colima start");
|
|
390
|
-
}
|
|
391
|
-
printSuccess("colima running");
|
|
392
|
-
// virtiofs blocks chmod of docker.sock from the macOS side. Idempotent + non-fatal.
|
|
393
|
-
const chmod = runCapture("colima", [
|
|
394
|
-
"ssh",
|
|
395
|
-
"--",
|
|
396
|
-
"sudo",
|
|
397
|
-
"chmod",
|
|
398
|
-
"666",
|
|
399
|
-
"/var/run/docker.sock",
|
|
400
|
-
]);
|
|
401
|
-
if (chmod.ok) {
|
|
402
|
-
printSuccess("docker.sock chmod applied inside colima VM");
|
|
403
|
-
}
|
|
404
|
-
else {
|
|
405
|
-
printWarning("colima ssh chmod failed — k3d cluster create may still succeed");
|
|
406
|
-
}
|
|
407
|
-
}
|
|
408
|
-
function ensureCluster(opts) {
|
|
409
|
-
if (opts.skipClusterCreate) {
|
|
410
|
-
step("3/7 — cluster (skipped via --skip-cluster-create)");
|
|
411
|
-
return;
|
|
412
|
-
}
|
|
413
|
-
step(`3/7 — k3d cluster create (${opts.cluster})`);
|
|
414
|
-
if (runCapture("k3d", ["cluster", "list", opts.cluster]).ok) {
|
|
415
|
-
printInfo("cluster", `'${opts.cluster}' already exists`);
|
|
416
|
-
return;
|
|
417
|
-
}
|
|
418
|
-
// host-cp's deployment has two hostPath mounts:
|
|
419
|
-
// /host/.config/gh ← gh CLI config (optional; bound when present)
|
|
420
|
-
// /host/olam ← operator's olam source (DEV ONLY via --host-cp-dev-path)
|
|
421
|
-
// Published-CLI consumers have no olam checkout; the operator-repo mount
|
|
422
|
-
// is left absent + DirectoryOrCreate handles it gracefully in-cluster.
|
|
423
|
-
const volumes = [];
|
|
424
|
-
const ghConfigDir = `${homedir()}/.config/gh`;
|
|
425
|
-
if (existsSync(ghConfigDir)) {
|
|
426
|
-
volumes.push("--volume", `${ghConfigDir}:/host/.config/gh`);
|
|
427
|
-
}
|
|
428
|
-
else {
|
|
429
|
-
printInfo("cluster", `${ghConfigDir} not found; skipping gh-config bind (run \`gh auth login\` to enable)`);
|
|
430
|
-
}
|
|
431
|
-
if (opts.hostCpDevPath) {
|
|
432
|
-
if (!existsSync(opts.hostCpDevPath)) {
|
|
433
|
-
printError(`--host-cp-dev-path ${opts.hostCpDevPath} does not exist`);
|
|
434
|
-
process.exit(1);
|
|
435
|
-
}
|
|
436
|
-
volumes.push("--volume", `${opts.hostCpDevPath}:/host/olam`);
|
|
437
|
-
printInfo("cluster", `dev-mode: mounting ${opts.hostCpDevPath} → /host/olam`);
|
|
438
|
-
}
|
|
439
|
-
runOrFail("k3d", [
|
|
440
|
-
"cluster",
|
|
441
|
-
"create",
|
|
442
|
-
opts.cluster,
|
|
443
|
-
...volumes,
|
|
444
|
-
"--wait",
|
|
445
|
-
"--timeout",
|
|
446
|
-
"90s",
|
|
447
|
-
], `k3d cluster create ${opts.cluster}`);
|
|
448
|
-
if (!runCapture("kubectl", ["cluster-info"]).ok) {
|
|
449
|
-
printError("kubectl cannot reach the cluster — check kubeconfig context");
|
|
450
|
-
process.exit(1);
|
|
451
|
-
}
|
|
452
|
-
printSuccess(`cluster ready (${runCapture("kubectl", ["config", "current-context"]).stdout.trim()})`);
|
|
453
|
-
}
|
|
454
|
-
/** Resolve the bundled observability scripts dir. */
|
|
455
|
-
function resolveObservabilityScriptsDir() {
|
|
456
|
-
// Install-mode: bundle-host-cp.mjs copies scripts/e2e/*.sh to
|
|
457
|
-
// <install-root>/host-cp/observability/.
|
|
458
|
-
const installed = join(installRoot(), "host-cp", "observability");
|
|
459
|
-
if (existsSync(installed))
|
|
460
|
-
return installed;
|
|
461
|
-
// Dev-mode fallback: resolve via the k8s assets root + walk up to repo
|
|
462
|
-
// root then into scripts/e2e/. Works when running against the monorepo.
|
|
463
|
-
const k8sRoot = resolveK8sAssetsRoot();
|
|
464
|
-
if (k8sRoot) {
|
|
465
|
-
const dev = join(k8sRoot, "..", "..", "..", "scripts", "e2e");
|
|
466
|
-
if (existsSync(dev))
|
|
467
|
-
return dev;
|
|
468
|
-
}
|
|
469
|
-
return null;
|
|
470
|
-
}
|
|
471
|
-
/**
|
|
472
|
-
* Resolve the bundled peripheral-services dir (helm-values + manifests).
|
|
473
|
-
* Returns null when neither install-mode nor dev-mode layout matches.
|
|
474
|
-
*/
|
|
475
|
-
function resolvePeripheralServicesDir() {
|
|
476
|
-
// Install-mode: bundle-host-cp.mjs copies packages/peripheral-services/
|
|
477
|
-
// {helm-values,manifests} to <install-root>/host-cp/peripheral-services/.
|
|
478
|
-
const installed = join(installRoot(), "host-cp", "peripheral-services");
|
|
479
|
-
if (existsSync(installed))
|
|
480
|
-
return installed;
|
|
481
|
-
// Dev-mode fallback: walk up from k8s assets root to packages/peripheral-services.
|
|
482
|
-
const k8sRoot = resolveK8sAssetsRoot();
|
|
483
|
-
if (k8sRoot) {
|
|
484
|
-
const dev = join(k8sRoot, "..", "..", "peripheral-services");
|
|
485
|
-
if (existsSync(dev))
|
|
486
|
-
return dev;
|
|
487
|
-
}
|
|
488
|
-
return null;
|
|
489
|
-
}
|
|
490
|
-
/**
|
|
491
|
-
* Resolve OLAM_BUNDLE_ROOT — the dir the observability scripts read to find
|
|
492
|
-
* `peripheral-services/{helm-values,manifests}/...`. In install-mode this is
|
|
493
|
-
* `<install>/host-cp`; in dev-mode it's the monorepo's `packages/` dir.
|
|
494
|
-
*/
|
|
495
|
-
function resolveBundleRoot() {
|
|
496
|
-
const installed = join(installRoot(), "host-cp");
|
|
497
|
-
if (existsSync(join(installed, "peripheral-services")))
|
|
498
|
-
return installed;
|
|
499
|
-
const k8sRoot = resolveK8sAssetsRoot();
|
|
500
|
-
if (k8sRoot) {
|
|
501
|
-
const dev = join(k8sRoot, "..", "..");
|
|
502
|
-
if (existsSync(join(dev, "peripheral-services")))
|
|
503
|
-
return dev;
|
|
504
|
-
}
|
|
505
|
-
return null;
|
|
506
|
-
}
|
|
507
|
-
/**
|
|
508
|
-
* Probe whether the component installed by `script` is already healthy.
|
|
509
|
-
* Uses `spawnSync` with `stdio: 'pipe'` so output never leaks to the operator.
|
|
510
|
-
* Returns false on any error or unexpected output — conservatively runs the
|
|
511
|
-
* script when in doubt.
|
|
512
|
-
*/
|
|
513
|
-
export function isObservabilityComponentReady(component) {
|
|
514
|
-
/** Silent kubectl probe — returns trimmed stdout or empty string on failure. */
|
|
515
|
-
function kget(args) {
|
|
516
|
-
const r = spawnSync("kubectl", [...args], {
|
|
517
|
-
encoding: "utf-8",
|
|
518
|
-
stdio: "pipe",
|
|
519
|
-
});
|
|
520
|
-
if (r.status !== 0)
|
|
521
|
-
return "";
|
|
522
|
-
return (r.stdout ?? "").trim();
|
|
523
|
-
}
|
|
524
|
-
switch (component) {
|
|
525
|
-
case "kyverno-cardinality-mutate": {
|
|
526
|
-
// ClusterPolicy doesn't expose `.status.ready` as a flat field — the real
|
|
527
|
-
// shape is `.status.conditions[?(@.type=="Ready")].status == "True"`.
|
|
528
|
-
// The previous flat probe always returned empty → script re-ran every
|
|
529
|
-
// boot. Caught during live verification on 2026-05-28.
|
|
530
|
-
const policyReady = kget([
|
|
531
|
-
"get", "clusterpolicy", "enforce-cardinality-labeldrop",
|
|
532
|
-
"-o", `jsonpath={.status.conditions[?(@.type=="Ready")].status}`,
|
|
533
|
-
]);
|
|
534
|
-
const admissionReplicas = parseInt(kget([
|
|
535
|
-
"get", "deploy", "-n", "kyverno", "kyverno-admission-controller",
|
|
536
|
-
"-o", "jsonpath={.status.readyReplicas}",
|
|
537
|
-
]) || "0", 10);
|
|
538
|
-
return policyReady === "True" && admissionReplicas >= 1;
|
|
539
|
-
}
|
|
540
|
-
case "prom-no-double-grafana": {
|
|
541
|
-
const grafanaReplicas = parseInt(kget([
|
|
542
|
-
"-n", "monitoring", "get", "deploy", "olam-grafana",
|
|
543
|
-
"-o", "jsonpath={.status.readyReplicas}",
|
|
544
|
-
]) || "0", 10);
|
|
545
|
-
const promReplicas = parseInt(kget([
|
|
546
|
-
"-n", "monitoring", "get", "sts",
|
|
547
|
-
"prometheus-olam-prom-kube-prometheus-prometheus",
|
|
548
|
-
"-o", "jsonpath={.status.readyReplicas}",
|
|
549
|
-
]) || "0", 10);
|
|
550
|
-
return grafanaReplicas >= 1 && promReplicas >= 1;
|
|
551
|
-
}
|
|
552
|
-
case "loki-ingest": {
|
|
553
|
-
const lokiReplicas = parseInt(kget([
|
|
554
|
-
"-n", "monitoring", "get", "sts", "olam-loki",
|
|
555
|
-
"-o", "jsonpath={.status.readyReplicas}",
|
|
556
|
-
]) || "0", 10);
|
|
557
|
-
const promtailReady = parseInt(kget([
|
|
558
|
-
"-n", "monitoring", "get", "ds", "olam-promtail",
|
|
559
|
-
"-o", "jsonpath={.status.numberReady}",
|
|
560
|
-
]) || "0", 10);
|
|
561
|
-
return lokiReplicas >= 1 && promtailReady >= 1;
|
|
562
|
-
}
|
|
563
|
-
case "grafana-port-forward": {
|
|
564
|
-
// Probe: Grafana deploy has >= 1 ready replica AND the olam-dashboards
|
|
565
|
-
// ConfigMap exists (created by this script). When both are true the
|
|
566
|
-
// chart + dashboards are already installed; skip the re-run.
|
|
567
|
-
const grafanaReplicas = parseInt(kget([
|
|
568
|
-
"-n", "monitoring", "get", "deploy", "olam-grafana",
|
|
569
|
-
"-o", "jsonpath={.status.readyReplicas}",
|
|
570
|
-
]) || "0", 10);
|
|
571
|
-
const dashboardsCm = kget([
|
|
572
|
-
"-n", "monitoring", "get", "cm", "olam-dashboards",
|
|
573
|
-
"-o", "name",
|
|
574
|
-
]);
|
|
575
|
-
return grafanaReplicas >= 1 && dashboardsCm.trim().length > 0;
|
|
576
|
-
}
|
|
577
|
-
default:
|
|
578
|
-
return false;
|
|
579
|
-
}
|
|
580
|
-
}
|
|
581
|
-
/**
|
|
582
|
-
* Read the Grafana admin credentials from the cluster secret.
|
|
583
|
-
* Returns null when the secret is absent or kubectl fails (bootstrap
|
|
584
|
-
* may not have run observability yet).
|
|
585
|
-
*/
|
|
586
|
-
export function getGrafanaCredentials() {
|
|
587
|
-
function getSecretKey(key) {
|
|
588
|
-
const r = spawnSync("kubectl", [
|
|
589
|
-
"-n", "monitoring", "get", "secret", "olam-grafana-admin",
|
|
590
|
-
"-o", `jsonpath={.data.${key}}`,
|
|
591
|
-
], { encoding: "utf-8", stdio: "pipe" });
|
|
592
|
-
if (r.status !== 0)
|
|
593
|
-
return "";
|
|
594
|
-
return (r.stdout ?? "").trim();
|
|
595
|
-
}
|
|
596
|
-
const rawUser = getSecretKey("admin-user");
|
|
597
|
-
const rawPassword = getSecretKey("admin-password");
|
|
598
|
-
if (!rawUser || !rawPassword)
|
|
599
|
-
return null;
|
|
600
|
-
try {
|
|
601
|
-
const user = Buffer.from(rawUser, "base64").toString("utf-8");
|
|
602
|
-
const password = Buffer.from(rawPassword, "base64").toString("utf-8");
|
|
603
|
-
if (!user || !password)
|
|
604
|
-
return null;
|
|
605
|
-
return { user, password };
|
|
606
|
-
}
|
|
607
|
-
catch {
|
|
608
|
-
return null;
|
|
609
|
-
}
|
|
610
|
-
}
|
|
611
|
-
/**
|
|
612
|
-
* Run a single observability bash script with live progress.
|
|
613
|
-
*
|
|
614
|
-
* Default mode shows a one-line spinner (latest output + elapsed) that the
|
|
615
|
-
* CALLER settles (manual settle) so it can map exit codes to nuanced states
|
|
616
|
-
* (e.g. the loki scrub-wait flake → warn, not fail). Verbose / non-TTY mode
|
|
617
|
-
* streams all output sequentially. Combined output is always captured to
|
|
618
|
-
* `~/.olam/logs/observability-<name>.log`.
|
|
619
|
-
*/
|
|
620
|
-
export async function runObservabilityScript(scriptPath, scriptName, env, verbose = false) {
|
|
621
|
-
const baseName = scriptName.replace(/\.sh$/, "");
|
|
622
|
-
const res = await runLiveTask(baseName, "bash", [scriptPath], {
|
|
623
|
-
verbose,
|
|
624
|
-
env,
|
|
625
|
-
logName: `observability-${baseName}`,
|
|
626
|
-
settle: "manual",
|
|
627
|
-
});
|
|
628
|
-
return { ok: res.ok, durationMs: res.durationMs, logPath: res.logPath };
|
|
629
|
-
}
|
|
630
|
-
async function installObservability(opts) {
|
|
631
|
-
if (opts.skipObservability) {
|
|
632
|
-
step("4/7 — observability (skipped via --skip-observability)");
|
|
633
|
-
return;
|
|
634
|
-
}
|
|
635
|
-
step("4/7 — observability");
|
|
636
|
-
const observabilityDir = resolveObservabilityScriptsDir();
|
|
637
|
-
if (!observabilityDir) {
|
|
638
|
-
throw new Error(`Bundled observability assets missing. ` +
|
|
639
|
-
`This indicates a corrupt or incomplete @pleri/olam-cli installation. ` +
|
|
640
|
-
`Remediation: reinstall with 'npm install -g @pleri/olam-cli@latest', ` +
|
|
641
|
-
`or open an issue at https://github.com/pleri/olam/issues with this error.`);
|
|
642
|
-
}
|
|
643
|
-
// Export OLAM_BUNDLE_ROOT so the scripts resolve helm-values/manifests from
|
|
644
|
-
// the published tarball instead of `git rev-parse` (which fails outside the
|
|
645
|
-
// monorepo). resolveBundleRoot returns null only in degenerate dev contexts;
|
|
646
|
-
// the scripts handle absence by falling back to git.
|
|
647
|
-
const bundleRoot = resolveBundleRoot();
|
|
648
|
-
const scriptEnv = { ...process.env };
|
|
649
|
-
if (bundleRoot) {
|
|
650
|
-
scriptEnv.OLAM_BUNDLE_ROOT = bundleRoot;
|
|
651
|
-
}
|
|
652
|
-
const outcomes = [];
|
|
653
|
-
for (const script of OBSERVABILITY_SCRIPTS) {
|
|
654
|
-
const path = join(observabilityDir, script);
|
|
655
|
-
if (!existsSync(path)) {
|
|
656
|
-
outcomes.push({ script, state: "missing" });
|
|
657
|
-
continue;
|
|
658
|
-
}
|
|
659
|
-
if (!opts.forceObservability) {
|
|
660
|
-
const component = script.replace(/\.sh$/, "");
|
|
661
|
-
if (isObservabilityComponentReady(component)) {
|
|
662
|
-
outcomes.push({ script, state: "skipped" });
|
|
663
|
-
continue;
|
|
664
|
-
}
|
|
665
|
-
}
|
|
666
|
-
const runResult = await runObservabilityScript(path, script, scriptEnv, opts.verbose);
|
|
667
|
-
if (runResult.ok) {
|
|
668
|
-
outcomes.push({
|
|
669
|
-
script,
|
|
670
|
-
state: "ran",
|
|
671
|
-
durationMs: runResult.durationMs,
|
|
672
|
-
logPath: runResult.logPath,
|
|
673
|
-
});
|
|
674
|
-
}
|
|
675
|
-
else if (script === "loki-ingest.sh") {
|
|
676
|
-
outcomes.push({
|
|
677
|
-
script,
|
|
678
|
-
state: "loki-flake",
|
|
679
|
-
durationMs: runResult.durationMs,
|
|
680
|
-
logPath: runResult.logPath,
|
|
681
|
-
});
|
|
682
|
-
}
|
|
683
|
-
else {
|
|
684
|
-
outcomes.push({
|
|
685
|
-
script,
|
|
686
|
-
state: "ran-failed",
|
|
687
|
-
durationMs: runResult.durationMs,
|
|
688
|
-
logPath: runResult.logPath,
|
|
689
|
-
});
|
|
690
|
-
}
|
|
691
|
-
}
|
|
692
|
-
// Compact name: strip the .sh suffix and the cardinality-mutate suffix that
|
|
693
|
-
// serves no informational purpose at this level.
|
|
694
|
-
const niceName = (script) => script.replace(/\.sh$/, "").replace(/-cardinality-mutate$/, "");
|
|
695
|
-
// All-installed fast path: one line instead of four. Trims the most common
|
|
696
|
-
// case (operator re-runs setup on a healthy cluster) to a single line.
|
|
697
|
-
const allSkipped = outcomes.length > 0 && outcomes.every((o) => o.state === "skipped");
|
|
698
|
-
if (allSkipped) {
|
|
699
|
-
printSuccess(`all ${outcomes.length} already installed (--force-observability to reinstall)`);
|
|
700
|
-
return;
|
|
701
|
-
}
|
|
702
|
-
for (const o of outcomes) {
|
|
703
|
-
const name = niceName(o.script);
|
|
704
|
-
const seconds = o.durationMs !== undefined
|
|
705
|
-
? `${(o.durationMs / 1000).toFixed(1)}s`
|
|
706
|
-
: "";
|
|
707
|
-
switch (o.state) {
|
|
708
|
-
case "missing":
|
|
709
|
-
printWarning(`${name}: script not found — skipping`);
|
|
710
|
-
break;
|
|
711
|
-
case "skipped":
|
|
712
|
-
printSuccess(`${name}: already installed`);
|
|
713
|
-
break;
|
|
714
|
-
case "ran":
|
|
715
|
-
printSuccess(`${name}: ${seconds}`);
|
|
716
|
-
break;
|
|
717
|
-
case "loki-flake":
|
|
718
|
-
printWarning(`${name}: ${seconds} (promtail scrub-wait flake; continuing)`);
|
|
719
|
-
break;
|
|
720
|
-
case "ran-failed": {
|
|
721
|
-
printError(`${name}: failed (${seconds}) — log=${o.logPath}`);
|
|
722
|
-
if (o.logPath !== undefined) {
|
|
723
|
-
const tail = readFileSync(o.logPath, "utf-8")
|
|
724
|
-
.split("\n")
|
|
725
|
-
.slice(-20)
|
|
726
|
-
.join("\n");
|
|
727
|
-
process.stderr.write(` --- last 20 lines from ${o.script} ---\n${tail}\n`);
|
|
728
|
-
}
|
|
729
|
-
process.exit(1);
|
|
730
|
-
}
|
|
731
|
-
}
|
|
732
|
-
}
|
|
733
|
-
}
|
|
734
|
-
/**
|
|
735
|
-
* Step 5: Apply the peripheral-services manifest tree (IngressRoutes,
|
|
736
|
-
* NetworkPolicies, ServiceMonitors, recording rules, Grafana dashboard
|
|
737
|
-
* ConfigMaps, Kyverno ClusterPolicy). These are NOT covered by `olam
|
|
738
|
-
* upgrade`'s host-cp manifest apply — without this step, the observability
|
|
739
|
-
* stack runs but has no scrape targets and no dashboards.
|
|
740
|
-
*/
|
|
741
|
-
function applyPeripheralServicesManifests() {
|
|
742
|
-
step("5/7 — peripheral-services manifests (IngressRoutes + ServiceMonitors + recording rules + dashboards + Kyverno)");
|
|
743
|
-
const dir = resolvePeripheralServicesDir();
|
|
744
|
-
if (!dir) {
|
|
745
|
-
printWarning("bundled peripheral-services manifests not found — skipping");
|
|
746
|
-
return;
|
|
747
|
-
}
|
|
748
|
-
const manifestsDir = join(dir, "manifests");
|
|
749
|
-
if (!existsSync(manifestsDir)) {
|
|
750
|
-
printWarning(`peripheral-services/manifests not found at ${manifestsDir} — skipping`);
|
|
751
|
-
return;
|
|
752
|
-
}
|
|
753
|
-
// Skip deployment manifests (files matching *deploy*.yaml): these overlap with the
|
|
754
|
-
// canonical deployment specs applied by `olam upgrade` step 3 (k8s/manifests/<svc>/50-deployment.yaml).
|
|
755
|
-
// Applying them here causes a rolling update when upgrade re-applies with a different image
|
|
756
|
-
// digest, making `kubectl rollout status` fail while the old pod is Terminating.
|
|
757
|
-
// Standalone operators can still apply deployment manifests manually if needed.
|
|
758
|
-
const manifestFiles = readdirSync(manifestsDir)
|
|
759
|
-
.filter((f) => (f.endsWith(".yaml") || f.endsWith(".yml")) && !/deploy/i.test(f))
|
|
760
|
-
.map((f) => join(manifestsDir, f));
|
|
761
|
-
if (manifestFiles.length === 0) {
|
|
762
|
-
printWarning("no non-deployment peripheral-services manifests found — skipping");
|
|
763
|
-
return;
|
|
764
|
-
}
|
|
765
|
-
// Capture kubectl apply output for each manifest; count unchanged vs changed.
|
|
766
|
-
// On a healthy re-run every resource reports "unchanged" — no per-manifest spam.
|
|
767
|
-
// Verbose output is written to ~/.olam/logs/peripheral-services-apply.log.
|
|
768
|
-
const logDir = join(homedir(), ".olam", "logs");
|
|
769
|
-
mkdirSync(logDir, { recursive: true });
|
|
770
|
-
const logPath = join(logDir, "peripheral-services-apply.log");
|
|
771
|
-
const logLines = [];
|
|
772
|
-
let unchangedCount = 0;
|
|
773
|
-
let changedCount = 0;
|
|
774
|
-
for (const manifest of manifestFiles) {
|
|
775
|
-
const r = spawnSync("kubectl", ["apply", "-f", manifest], {
|
|
776
|
-
stdio: "pipe",
|
|
777
|
-
encoding: "utf-8",
|
|
778
|
-
});
|
|
779
|
-
const combined = (r.stdout ?? "") + (r.stderr ?? "");
|
|
780
|
-
logLines.push(`==> ${manifest}\n${combined}`);
|
|
781
|
-
if (r.status !== 0) {
|
|
782
|
-
// Write the full log before aborting so the operator can diagnose.
|
|
783
|
-
writeFileSync(logPath, logLines.join("\n"), "utf-8");
|
|
784
|
-
printError(`kubectl apply failed for ${manifest.replace(manifestsDir + "/", "")} — see ${logPath}`);
|
|
785
|
-
process.stderr.write(` --- last lines ---\n${combined.split("\n").slice(-10).join("\n")}\n`);
|
|
786
|
-
process.exit(r.status ?? 1);
|
|
787
|
-
}
|
|
788
|
-
// Count resources by whether kubectl reported "unchanged" or "configured"/"created".
|
|
789
|
-
const lines = combined.split("\n").filter((l) => l.trim().length > 0);
|
|
790
|
-
for (const line of lines) {
|
|
791
|
-
if (/unchanged$/.test(line.trim())) {
|
|
792
|
-
unchangedCount++;
|
|
793
|
-
}
|
|
794
|
-
else if (/configured$|created$/.test(line.trim())) {
|
|
795
|
-
changedCount++;
|
|
796
|
-
}
|
|
797
|
-
}
|
|
798
|
-
}
|
|
799
|
-
writeFileSync(logPath, logLines.join("\n"), "utf-8");
|
|
800
|
-
// Compact: "12 manifests — no-op" or "12 manifests — 3 changed"
|
|
801
|
-
const summary = changedCount > 0
|
|
802
|
-
? `${manifestFiles.length} manifests — ${changedCount} changed`
|
|
803
|
-
: `${manifestFiles.length} manifests — no-op`;
|
|
804
|
-
printSuccess(`peripheral-services: ${summary}`);
|
|
805
|
-
}
|
|
806
|
-
/**
|
|
807
|
-
* Recursively collect deployment manifest files (`50-deployment.yaml`) under
|
|
808
|
-
* `manifestsRoot`, including the top-level host-cp one and every peripheral
|
|
809
|
-
* subdir.
|
|
810
|
-
*/
|
|
811
|
-
function findDeploymentManifests(manifestsRoot) {
|
|
812
|
-
const out = [];
|
|
813
|
-
const walk = (dir) => {
|
|
814
|
-
let names;
|
|
815
|
-
try {
|
|
816
|
-
names = readdirSync(dir);
|
|
817
|
-
}
|
|
818
|
-
catch {
|
|
819
|
-
return;
|
|
820
|
-
}
|
|
821
|
-
for (const name of names) {
|
|
822
|
-
const full = join(dir, name);
|
|
823
|
-
let isDir = false;
|
|
824
|
-
try {
|
|
825
|
-
isDir = statSync(full).isDirectory();
|
|
826
|
-
}
|
|
827
|
-
catch {
|
|
828
|
-
continue;
|
|
829
|
-
}
|
|
830
|
-
if (isDir) {
|
|
831
|
-
walk(full);
|
|
832
|
-
}
|
|
833
|
-
else if (/^50-deployment\.ya?ml$/.test(name)) {
|
|
834
|
-
out.push(full);
|
|
835
|
-
}
|
|
836
|
-
}
|
|
837
|
-
};
|
|
838
|
-
walk(manifestsRoot);
|
|
839
|
-
return out;
|
|
840
|
-
}
|
|
841
|
-
/**
|
|
842
|
-
* Parse the bundled deployment manifests and return the UNIQUE set of
|
|
843
|
-
* `ghcr.io/pleri/olam-*@sha256:<digest>` image refs they pin. These are the
|
|
844
|
-
* authoritative refs that actually get deployed (host-cp + plan-chat share one
|
|
845
|
-
* host-cp digest → deduped to a single pull). Non-olam images (busybox init,
|
|
846
|
-
* postgres, electric) are ignored.
|
|
847
|
-
*
|
|
848
|
-
* Pure function — no I/O beyond reading the passed-in files; unit-tested.
|
|
849
|
-
*/
|
|
850
|
-
export function collectOlamImageRefs(manifestsRoot) {
|
|
851
|
-
const refRe = /image:\s*(ghcr\.io\/pleri\/olam-[a-z0-9-]+@sha256:[a-f0-9]{64})/g;
|
|
852
|
-
const seen = new Set();
|
|
853
|
-
for (const file of findDeploymentManifests(manifestsRoot)) {
|
|
854
|
-
let raw;
|
|
855
|
-
try {
|
|
856
|
-
raw = readFileSync(file, "utf-8");
|
|
857
|
-
}
|
|
858
|
-
catch {
|
|
859
|
-
continue;
|
|
860
|
-
}
|
|
861
|
-
for (const m of raw.matchAll(refRe)) {
|
|
862
|
-
const ref = m[1];
|
|
863
|
-
if (ref)
|
|
864
|
-
seen.add(ref);
|
|
865
|
-
}
|
|
866
|
-
}
|
|
867
|
-
return [...seen].sort();
|
|
868
|
-
}
|
|
869
|
-
/**
|
|
870
|
-
* Step 6/7: pre-pull the manifest-pinned olam-* images and import them into the
|
|
871
|
-
* k3d node's containerd. Warms the cache so pod rollouts in step 7 don't
|
|
872
|
-
* cold-pull — which is what widened the rollout-race window that surfaced as
|
|
873
|
-
* "image not detected" / "pod not ready" in `olam doctor`. Best-effort:
|
|
874
|
-
* per-image failures warn + continue (kubelet on-demand pull is the fallback).
|
|
875
|
-
*/
|
|
876
|
-
async function prepullImages(opts) {
|
|
877
|
-
if (opts.skipPrepull) {
|
|
878
|
-
step("6/7 — pre-pull olam images (skipped via --skip-prepull)");
|
|
879
|
-
return;
|
|
880
|
-
}
|
|
881
|
-
step("6/7 — pre-pull olam images (docker pull + k3d image import)");
|
|
882
|
-
const k8sRoot = resolveK8sAssetsRoot();
|
|
883
|
-
const manifestsRoot = k8sRoot ? join(k8sRoot, "manifests") : null;
|
|
884
|
-
if (!manifestsRoot || !existsSync(manifestsRoot)) {
|
|
885
|
-
printWarning("bundled manifests not found — skipping pre-pull (pods will cold-pull on demand)");
|
|
886
|
-
return;
|
|
887
|
-
}
|
|
888
|
-
const refs = collectOlamImageRefs(manifestsRoot);
|
|
889
|
-
if (refs.length === 0) {
|
|
890
|
-
printWarning("no ghcr.io/pleri/olam-* image refs found in manifests — skipping");
|
|
891
|
-
return;
|
|
892
|
-
}
|
|
893
|
-
printInfo("pre-pull", `${refs.length} unique olam image(s) → node '${opts.cluster}'`);
|
|
894
|
-
for (const ref of refs) {
|
|
895
|
-
const short = ref.replace(/^ghcr\.io\/pleri\//, "").replace(/@sha256:.*/, "");
|
|
896
|
-
const pull = await runLiveTask(`pull ${short}`, "docker", ["pull", ref], {
|
|
897
|
-
verbose: opts.verbose,
|
|
898
|
-
logName: `prepull-${short}`,
|
|
899
|
-
});
|
|
900
|
-
if (!pull.ok) {
|
|
901
|
-
printWarning(`${short}: docker pull failed — pod will cold-pull on demand (log=${pull.logPath})`);
|
|
902
|
-
continue;
|
|
903
|
-
}
|
|
904
|
-
const imp = await runLiveTask(`import ${short}`, "k3d", ["image", "import", ref, "-c", opts.cluster], { verbose: opts.verbose, logName: `prepull-import-${short}` });
|
|
905
|
-
if (!imp.ok) {
|
|
906
|
-
printWarning(`${short}: k3d image import failed — pod will cold-pull on demand (log=${imp.logPath})`);
|
|
907
|
-
}
|
|
908
|
-
}
|
|
909
|
-
}
|
|
910
|
-
async function delegateToUpgrade(opts) {
|
|
911
|
-
step("7/7 — apply host-cp + peripherals + rollout (olam upgrade)");
|
|
912
|
-
// Re-invoke `olam upgrade -y` via the same process binary. The upgrade
|
|
913
|
-
// flow's 8-step k8s path (upgrade-kubernetes.ts) handles namespace +
|
|
914
|
-
// RBAC + Secrets + ghcr-pull + host-side docker-socket-proxy + manifest
|
|
915
|
-
// apply + rollout status + port-forward + /health verify + audit log.
|
|
916
|
-
const olamBin = process.argv[1] ?? "olam";
|
|
917
|
-
// Verbose: stream the full upgrade output inline (its own ora spinners + logs
|
|
918
|
-
// are most useful raw when debugging). Default: collapse to one live line and
|
|
919
|
-
// capture everything to ~/.olam/logs/bootstrap-upgrade.log.
|
|
920
|
-
if (opts.verbose) {
|
|
921
|
-
const result = spawnSync(process.execPath, [olamBin, "upgrade", "-y"], {
|
|
922
|
-
stdio: "inherit",
|
|
923
|
-
});
|
|
924
|
-
if (result.status !== 0) {
|
|
925
|
-
printError("olam upgrade failed — see output above");
|
|
926
|
-
process.exit(result.status ?? 1);
|
|
927
|
-
}
|
|
928
|
-
return;
|
|
929
|
-
}
|
|
930
|
-
const res = await runLiveTask("olam upgrade", process.execPath, [olamBin, "upgrade", "-y"], { verbose: false, logName: "bootstrap-upgrade", settle: "auto" });
|
|
931
|
-
if (!res.ok) {
|
|
932
|
-
printError(`olam upgrade failed (exit ${res.exitCode}) — see ${res.logPath}`);
|
|
933
|
-
const tail = readFileSync(res.logPath, "utf-8")
|
|
934
|
-
.split("\n")
|
|
935
|
-
.slice(-30)
|
|
936
|
-
.join("\n");
|
|
937
|
-
process.stderr.write(` --- last 30 lines from olam upgrade ---\n${tail}\n`);
|
|
938
|
-
process.exit(res.exitCode ?? 1);
|
|
939
|
-
}
|
|
940
|
-
}
|
|
941
|
-
function summary(opts) {
|
|
942
|
-
step("done");
|
|
943
|
-
const grafanaCreds = getGrafanaCredentials();
|
|
944
|
-
const grafanaCredsBlock = grafanaCreds
|
|
945
|
-
? ` User: ${grafanaCreds.user}\n Password: ${grafanaCreds.password}`
|
|
946
|
-
: ` # Get password: kubectl -n monitoring get secret olam-grafana-admin \\
|
|
947
|
-
# -o jsonpath='{.data.admin-password}' | base64 -d`;
|
|
948
|
-
process.stdout.write(`
|
|
949
|
-
Cluster: ${opts.cluster}
|
|
950
|
-
Next steps:
|
|
951
|
-
olam doctor # verify the stack
|
|
952
|
-
olam services status # peripherals 1/1
|
|
953
|
-
kubectl get pods -n olam
|
|
954
|
-
|
|
955
|
-
Grafana:
|
|
956
|
-
URL: http://localhost:3000 (after the port-forward below)
|
|
957
|
-
${grafanaCredsBlock}
|
|
958
|
-
Port-forward: kubectl port-forward -n monitoring svc/olam-grafana 3000:80
|
|
959
|
-
|
|
960
|
-
Prometheus:
|
|
961
|
-
URL: http://localhost:9090 (after the port-forward below)
|
|
962
|
-
Port-forward: kubectl port-forward -n monitoring svc/olam-prom-kube-prometheus-prometheus 9090:9090
|
|
963
|
-
`);
|
|
964
|
-
}
|
|
965
|
-
export async function runBootstrapKubernetes(rawOpts) {
|
|
966
|
-
// Default auto-install ON for macOS. The wizard contract is "fresh
|
|
967
|
-
// machine → working cluster in one command", which requires installing
|
|
968
|
-
// missing brew formulae without operator intervention. Linux operators
|
|
969
|
-
// see a per-tool install hint (apt/dnf auto-install is queued as a
|
|
970
|
-
// follow-up). Pass --no-auto-install or set autoInstall=false to
|
|
971
|
-
// restore the earlier opt-in behaviour.
|
|
972
|
-
const defaultAutoInstall = platform() === "darwin";
|
|
973
|
-
// `verbose` is the canonical flag; `verboseObservability` is the deprecated
|
|
974
|
-
// alias and ORs in for back-compat.
|
|
975
|
-
const verbose = (rawOpts.verbose ?? false) || (rawOpts.verboseObservability ?? false);
|
|
976
|
-
const opts = {
|
|
977
|
-
cluster: rawOpts.cluster ?? DEFAULT_K3S_CLUSTER,
|
|
978
|
-
autoInstall: rawOpts.autoInstall ?? defaultAutoInstall,
|
|
979
|
-
skipObservability: rawOpts.skipObservability ?? false,
|
|
980
|
-
skipClusterCreate: rawOpts.skipClusterCreate ?? false,
|
|
981
|
-
forceObservability: rawOpts.forceObservability ?? false,
|
|
982
|
-
skipPrepull: rawOpts.skipPrepull ?? false,
|
|
983
|
-
verbose,
|
|
984
|
-
verboseObservability: rawOpts.verboseObservability ?? false,
|
|
985
|
-
hostCpDevPath: rawOpts.hostCpDevPath,
|
|
986
|
-
preferredRuntime: rawOpts.preferredRuntime,
|
|
987
|
-
};
|
|
988
|
-
printHeader("olam setup — k3s mode");
|
|
989
|
-
printInfo("mode", "one-command bring-up of olam peripherals + observability on a local k3d cluster");
|
|
990
|
-
preflight(opts);
|
|
991
|
-
ensureSecrets();
|
|
992
|
-
ensureContainerRuntime(opts);
|
|
993
|
-
ensureCluster(opts);
|
|
994
|
-
await installObservability(opts);
|
|
995
|
-
applyPeripheralServicesManifests();
|
|
996
|
-
await prepullImages(opts);
|
|
997
|
-
await delegateToUpgrade(opts);
|
|
998
|
-
summary(opts);
|
|
999
|
-
printSuccess("setup complete");
|
|
1000
|
-
return { exitCode: 0, summary: `setup complete on cluster ${opts.cluster}` };
|
|
1001
|
-
}
|
|
1002
|
-
//# sourceMappingURL=bootstrap-kubernetes.js.map
|