@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,104 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* instrumentation.ts — stdout JSON event emitter for olam-cli.
|
|
3
|
-
*
|
|
4
|
-
* Phase 1b A3 of olam-host-suite-phase-1b-k3s-beta-flavour (plan
|
|
5
|
-
* ~/.claude/plans/olam-host-suite-phase-1b-k3s-beta-flavour.md).
|
|
6
|
-
*
|
|
7
|
-
* Canonical event schema (Decision 21 — `olam.instr.v1`):
|
|
8
|
-
* {
|
|
9
|
-
* "schema": "olam.instr.v1",
|
|
10
|
-
* "event": "substrate.set" | "upgrade.complete",
|
|
11
|
-
* "install_id": "<uuid-v4-from-config>",
|
|
12
|
-
* "ts": "<ISO-8601-UTC>",
|
|
13
|
-
* <event-specific-fields>
|
|
14
|
-
* }
|
|
15
|
-
*
|
|
16
|
-
* Emission target: **stderr**, newline-delimited, each line prefixed with
|
|
17
|
-
* `OLAM_INSTR ` so consumers can grep-distinguish from other stderr output.
|
|
18
|
-
*
|
|
19
|
-
* Why stderr (and not stdout)? olam-cli's existing stdout-JSON contracts
|
|
20
|
-
* (e.g. `olam status --json`, `olam doctor --json`) reserve stdout for
|
|
21
|
-
* command output that consumers parse positionally. Mixing instrumentation
|
|
22
|
-
* into stdout breaks those contracts. stderr keeps the emitter
|
|
23
|
-
* grep-distinguishable AND segregated from the data-plane output.
|
|
24
|
-
*
|
|
25
|
-
* Consumers: month-6 aggregator script (`scripts/aggregate-substrate-events.mjs`,
|
|
26
|
-
* D20) groups events by `install_id` for Falsifiable signal thresholds 1+4.
|
|
27
|
-
*
|
|
28
|
-
* Defensive contract:
|
|
29
|
-
* - emit() MUST NOT throw if the config can't be read; falls back to a
|
|
30
|
-
* placeholder install_id ('unknown') + emits a one-line stderr WARN.
|
|
31
|
-
* - Schema is versioned (`olam.instr.v1`); v2 fields land additively.
|
|
32
|
-
* Consumers MUST tolerate unknown fields.
|
|
33
|
-
*/
|
|
34
|
-
import { readConfig } from './config.js';
|
|
35
|
-
export const INSTRUMENTATION_SCHEMA = 'olam.instr.v1';
|
|
36
|
-
export const INSTRUMENTATION_PREFIX = 'OLAM_INSTR ';
|
|
37
|
-
function nowIso(now) {
|
|
38
|
-
const d = now ? now() : new Date();
|
|
39
|
-
return d.toISOString();
|
|
40
|
-
}
|
|
41
|
-
function resolveInstallId(opts) {
|
|
42
|
-
try {
|
|
43
|
-
if (opts.installIdProvider)
|
|
44
|
-
return opts.installIdProvider();
|
|
45
|
-
const cfg = readConfig();
|
|
46
|
-
return cfg.install_id;
|
|
47
|
-
}
|
|
48
|
-
catch {
|
|
49
|
-
return 'unknown';
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
function writeLine(stderr, payload) {
|
|
53
|
-
try {
|
|
54
|
-
const line = `${INSTRUMENTATION_PREFIX}${JSON.stringify(payload)}\n`;
|
|
55
|
-
stderr.write(line);
|
|
56
|
-
}
|
|
57
|
-
catch (err) {
|
|
58
|
-
// emit must never throw; surface the failure tersely to stderr.
|
|
59
|
-
try {
|
|
60
|
-
stderr.write(`[WARN] olam instrumentation emit failed: ${err instanceof Error ? err.message : String(err)}\n`);
|
|
61
|
-
}
|
|
62
|
-
catch {
|
|
63
|
-
// give up; emitter contract is best-effort.
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* Emit a `substrate.set` event. Called by `olam substrate set` ONLY on success
|
|
69
|
-
* (failure paths emit nothing — by design; thresholds count successful switches).
|
|
70
|
-
*
|
|
71
|
-
* @param payload — substrate + optional flavor
|
|
72
|
-
* @param opts — test-only injection points (stderr / now / installIdProvider)
|
|
73
|
-
*/
|
|
74
|
-
export function emitSubstrateSet(payload, opts = {}) {
|
|
75
|
-
const event = {
|
|
76
|
-
schema: INSTRUMENTATION_SCHEMA,
|
|
77
|
-
event: 'substrate.set',
|
|
78
|
-
install_id: resolveInstallId(opts),
|
|
79
|
-
ts: nowIso(opts.now),
|
|
80
|
-
substrate: payload.substrate,
|
|
81
|
-
...(payload.flavor !== undefined ? { flavor: payload.flavor } : {}),
|
|
82
|
-
};
|
|
83
|
-
writeLine(opts.stderr ?? process.stderr, event);
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* Emit an `upgrade.complete` event. Called by Phase C C2's substrate-aware
|
|
87
|
-
* `olam upgrade` ONLY on success.
|
|
88
|
-
*
|
|
89
|
-
* @param payload — substrate + duration_ms (and optional flavor)
|
|
90
|
-
* @param opts — test-only injection points
|
|
91
|
-
*/
|
|
92
|
-
export function emitUpgradeComplete(payload, opts = {}) {
|
|
93
|
-
const event = {
|
|
94
|
-
schema: INSTRUMENTATION_SCHEMA,
|
|
95
|
-
event: 'upgrade.complete',
|
|
96
|
-
install_id: resolveInstallId(opts),
|
|
97
|
-
ts: nowIso(opts.now),
|
|
98
|
-
substrate: payload.substrate,
|
|
99
|
-
duration_ms: payload.duration_ms,
|
|
100
|
-
...(payload.flavor !== undefined ? { flavor: payload.flavor } : {}),
|
|
101
|
-
};
|
|
102
|
-
writeLine(opts.stderr ?? process.stderr, event);
|
|
103
|
-
}
|
|
104
|
-
//# sourceMappingURL=instrumentation.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"instrumentation.js","sourceRoot":"","sources":["../../src/lib/instrumentation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,MAAM,CAAC,MAAM,sBAAsB,GAAG,eAAwB,CAAC;AAC/D,MAAM,CAAC,MAAM,sBAAsB,GAAG,aAAsB,CAAC;AAgC7D,SAAS,MAAM,CAAC,GAAgB;IAC9B,MAAM,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC;IACnC,OAAO,CAAC,CAAC,WAAW,EAAE,CAAC;AACzB,CAAC;AAED,SAAS,gBAAgB,CAAC,IAAc;IACtC,IAAI,CAAC;QACH,IAAI,IAAI,CAAC,iBAAiB;YAAE,OAAO,IAAI,CAAC,iBAAiB,EAAE,CAAC;QAC5D,MAAM,GAAG,GAAG,UAAU,EAAE,CAAC;QACzB,OAAO,GAAG,CAAC,UAAU,CAAC;IACxB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC;AAED,SAAS,SAAS,CAAC,MAA6B,EAAE,OAA6B;IAC7E,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,GAAG,sBAAsB,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC;QACrE,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACrB,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,gEAAgE;QAChE,IAAI,CAAC;YACH,MAAM,CAAC,KAAK,CACV,4CACE,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAC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|
|
|
1
|
-
/**
|
|
2
|
-
* k8s-bootstrap.ts — apply the `olam` namespace + RBAC + secret set on a
|
|
3
|
-
* fresh kubernetes cluster.
|
|
4
|
-
*
|
|
5
|
-
* B4 of olam-issue-npm-only-k3s. Without this an npm-only operator running
|
|
6
|
-
* `olam upgrade --substrate=kubernetes` against a fresh cluster fails with:
|
|
7
|
-
*
|
|
8
|
-
* Error from server (NotFound): namespaces "olam" not found
|
|
9
|
-
* Secret "olam-host-cp-secret" not found in namespace "olam"
|
|
10
|
-
*
|
|
11
|
-
* The 8-step upgrade flow (upgrade-kubernetes.ts) already runs
|
|
12
|
-
* `seedManifestsFromBundle` to put manifest YAML at ~/.olam/k8s/manifests/,
|
|
13
|
-
* but no one APPLIES them on first install — operators were expected to
|
|
14
|
-
* `kubectl apply -f` by hand. That barrier is the npm-only blocker this
|
|
15
|
-
* module closes.
|
|
16
|
-
*
|
|
17
|
-
* Idempotency: kubectl apply is idempotent by design for manifests
|
|
18
|
-
* (server-side merge keys deduplicate). For secrets we render once and
|
|
19
|
-
* persist the values to ~/.olam/k8s-secrets-state.json — subsequent runs
|
|
20
|
-
* reuse the same values so worlds that have cached tokens don't break.
|
|
21
|
-
*
|
|
22
|
-
* Order (matches the seed manifest filename numeric prefix):
|
|
23
|
-
* 1. 00-namespace.yaml — host-cp namespace
|
|
24
|
-
* 2. 10-serviceaccount.yaml — host-cp ServiceAccount
|
|
25
|
-
* 3. 20-rbac.yaml — host-cp Role/RoleBinding
|
|
26
|
-
* 4. 30-configmap.yaml — host-cp env ConfigMap
|
|
27
|
-
* 5. 45-pvc.yaml — host-cp PersistentVolumeClaim
|
|
28
|
-
* 6. host-cp Secret — RENDERED from templates/40-secret-template.yaml
|
|
29
|
-
* 7. per-peripheral manifests + secrets (auth-service, mcp-auth-service, kg-service, memory-service)
|
|
30
|
-
*
|
|
31
|
-
* Deployments + Services (50-deployment.yaml, 60-service.yaml) are NOT
|
|
32
|
-
* applied here — that is upgrade-kubernetes.ts's job (it manages rollout
|
|
33
|
-
* status + port-forward + audit log). ensureK8sBootstrap returns once the
|
|
34
|
-
* "prerequisites" (namespace + RBAC + secrets) are in place.
|
|
35
|
-
*/
|
|
36
|
-
import { kubectlWrap } from './kubectl-wrap.js';
|
|
37
|
-
import { type RenderDeps, type RenderResult } from './k8s-secret-render.js';
|
|
38
|
-
export declare const K8S_NAMESPACE = "olam";
|
|
39
|
-
/**
|
|
40
|
-
* kubectl apply wrapper — accepts a YAML string and applies via stdin (D20
|
|
41
|
-
* stdin-safe; values never inlined into argv). When `manifestPath` is given
|
|
42
|
-
* the file is applied via `-f <path>` instead (manifests stay on disk).
|
|
43
|
-
*/
|
|
44
|
-
declare function kubectlApply(context: string, source: {
|
|
45
|
-
path: string;
|
|
46
|
-
} | {
|
|
47
|
-
stdinYaml: string;
|
|
48
|
-
}, deps: BootstrapDeps): Promise<{
|
|
49
|
-
ok: boolean;
|
|
50
|
-
stderr: string;
|
|
51
|
-
}>;
|
|
52
|
-
/**
|
|
53
|
-
* Locate the bundled k8s assets directory. In install-mode this is
|
|
54
|
-
* `<install-root>/host-cp/k8s/`. In dev-mode it falls back to the
|
|
55
|
-
* monorepo's `packages/host-cp/k8s/`.
|
|
56
|
-
*/
|
|
57
|
-
export declare function resolveK8sAssetsRoot(installRootDir?: string): string | null;
|
|
58
|
-
export interface BootstrapDeps {
|
|
59
|
-
/** Injectable kubectlWrap for tests. */
|
|
60
|
-
readonly kubectlWrapImpl?: typeof kubectlWrap;
|
|
61
|
-
/** Override the k8s assets root path (auto-resolved via installRoot when absent). */
|
|
62
|
-
readonly k8sAssetsRoot?: string;
|
|
63
|
-
/** Pass-through deps for the secret renderer (file IO, gh-token, RNG, state file). */
|
|
64
|
-
readonly renderDeps?: RenderDeps;
|
|
65
|
-
/** stdout for human-readable progress. */
|
|
66
|
-
readonly stdout?: NodeJS.WritableStream;
|
|
67
|
-
/** stderr for warnings + errors. */
|
|
68
|
-
readonly stderr?: NodeJS.WritableStream;
|
|
69
|
-
/** Hook into kubectlApply for tests (overrides the kubectlWrap path entirely). */
|
|
70
|
-
readonly applyImpl?: typeof kubectlApply;
|
|
71
|
-
/**
|
|
72
|
-
* Optional progress callback invoked for each manifest/secret being applied.
|
|
73
|
-
* When provided, replaces the per-item stdout.write so callers (e.g. upgrade-kubernetes)
|
|
74
|
-
* can route progress through a spinner's `.text` instead of newlining to stdout.
|
|
75
|
-
*/
|
|
76
|
-
readonly onProgress?: (label: string) => void;
|
|
77
|
-
}
|
|
78
|
-
export interface BootstrapOptions {
|
|
79
|
-
readonly context: string;
|
|
80
|
-
readonly namespace?: string;
|
|
81
|
-
/** When true, regenerate every secret value (overwrites ~/.olam/k8s-secrets-state.json). */
|
|
82
|
-
readonly rotateSecrets?: boolean;
|
|
83
|
-
/** When true, no kubectl invocations happen; the function returns the would-be plan. */
|
|
84
|
-
readonly dryRun?: boolean;
|
|
85
|
-
}
|
|
86
|
-
export type AppliedKind = {
|
|
87
|
-
kind: 'manifest';
|
|
88
|
-
path: string;
|
|
89
|
-
} | {
|
|
90
|
-
kind: 'secret';
|
|
91
|
-
name: string;
|
|
92
|
-
};
|
|
93
|
-
export interface BootstrapResult {
|
|
94
|
-
readonly applied: ReadonlyArray<AppliedKind>;
|
|
95
|
-
readonly skipped: ReadonlyArray<{
|
|
96
|
-
kind: AppliedKind['kind'];
|
|
97
|
-
ref: string;
|
|
98
|
-
reason: string;
|
|
99
|
-
}>;
|
|
100
|
-
readonly secretResults: ReadonlyArray<RenderResult>;
|
|
101
|
-
}
|
|
102
|
-
/**
|
|
103
|
-
* Run the bootstrap. Idempotent on re-run.
|
|
104
|
-
*
|
|
105
|
-
* Apply order (numeric filename prefix mirrors apply ORDER):
|
|
106
|
-
* 1. <root>/manifests/00-namespace.yaml + 10/20/30/45 (host-cp prereqs)
|
|
107
|
-
* 2. Per-peripheral 10/20/30/45 prereqs (auth-service / mcp-auth-service / kg-service / memory-service)
|
|
108
|
-
* 3. host-cp Secret (rendered from templates/40-secret-template.yaml)
|
|
109
|
-
* 4. Per-peripheral Secrets (rendered from each *-secret-template.yaml)
|
|
110
|
-
*
|
|
111
|
-
* On the first failed apply we surface the kubectl stderr and stop —
|
|
112
|
-
* partial-apply state is left in the cluster (kubectl apply is idempotent;
|
|
113
|
-
* re-running picks up where we stopped).
|
|
114
|
-
*/
|
|
115
|
-
export declare function ensureK8sBootstrap(opts: BootstrapOptions, deps?: BootstrapDeps): Promise<{
|
|
116
|
-
exitCode: number;
|
|
117
|
-
result: BootstrapResult;
|
|
118
|
-
error?: string;
|
|
119
|
-
}>;
|
|
120
|
-
/**
|
|
121
|
-
* Read the list of expected Secret names — used by probeK8sRequiredSecrets
|
|
122
|
-
* so the doctor probe stays in lockstep with the bootstrap module.
|
|
123
|
-
*/
|
|
124
|
-
export declare function expectedSecretNames(): ReadonlyArray<string>;
|
|
125
|
-
export {};
|
|
126
|
-
//# sourceMappingURL=k8s-bootstrap.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"k8s-bootstrap.d.ts","sourceRoot":"","sources":["../../src/lib/k8s-bootstrap.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAKH,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGhD,OAAO,EAEL,KAAK,UAAU,EACf,KAAK,YAAY,EAElB,MAAM,wBAAwB,CAAC;AAEhC,eAAO,MAAM,aAAa,SAAS,CAAC;AAqCpC;;;;GAIG;AACH,iBAAe,YAAY,CACzB,OAAO,EAAE,MAAM,EACf,MAAM,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,EAChD,IAAI,EAAE,aAAa,GAClB,OAAO,CAAC;IAAE,EAAE,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,CAQ1C;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,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MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC5F,QAAQ,CAAC,aAAa,EAAE,aAAa,CAAC,YAAY,CAAC,CAAC;CACrD;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,gBAAgB,EACtB,IAAI,GAAE,aAAkB,GACvB,OAAO,CAAC;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,eAAe,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAoGxE;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,IAAI,aAAa,CAAC,MAAM,CAAC,CAE3D"}
|
|
@@ -1,218 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* k8s-bootstrap.ts — apply the `olam` namespace + RBAC + secret set on a
|
|
3
|
-
* fresh kubernetes cluster.
|
|
4
|
-
*
|
|
5
|
-
* B4 of olam-issue-npm-only-k3s. Without this an npm-only operator running
|
|
6
|
-
* `olam upgrade --substrate=kubernetes` against a fresh cluster fails with:
|
|
7
|
-
*
|
|
8
|
-
* Error from server (NotFound): namespaces "olam" not found
|
|
9
|
-
* Secret "olam-host-cp-secret" not found in namespace "olam"
|
|
10
|
-
*
|
|
11
|
-
* The 8-step upgrade flow (upgrade-kubernetes.ts) already runs
|
|
12
|
-
* `seedManifestsFromBundle` to put manifest YAML at ~/.olam/k8s/manifests/,
|
|
13
|
-
* but no one APPLIES them on first install — operators were expected to
|
|
14
|
-
* `kubectl apply -f` by hand. That barrier is the npm-only blocker this
|
|
15
|
-
* module closes.
|
|
16
|
-
*
|
|
17
|
-
* Idempotency: kubectl apply is idempotent by design for manifests
|
|
18
|
-
* (server-side merge keys deduplicate). For secrets we render once and
|
|
19
|
-
* persist the values to ~/.olam/k8s-secrets-state.json — subsequent runs
|
|
20
|
-
* reuse the same values so worlds that have cached tokens don't break.
|
|
21
|
-
*
|
|
22
|
-
* Order (matches the seed manifest filename numeric prefix):
|
|
23
|
-
* 1. 00-namespace.yaml — host-cp namespace
|
|
24
|
-
* 2. 10-serviceaccount.yaml — host-cp ServiceAccount
|
|
25
|
-
* 3. 20-rbac.yaml — host-cp Role/RoleBinding
|
|
26
|
-
* 4. 30-configmap.yaml — host-cp env ConfigMap
|
|
27
|
-
* 5. 45-pvc.yaml — host-cp PersistentVolumeClaim
|
|
28
|
-
* 6. host-cp Secret — RENDERED from templates/40-secret-template.yaml
|
|
29
|
-
* 7. per-peripheral manifests + secrets (auth-service, mcp-auth-service, kg-service, memory-service)
|
|
30
|
-
*
|
|
31
|
-
* Deployments + Services (50-deployment.yaml, 60-service.yaml) are NOT
|
|
32
|
-
* applied here — that is upgrade-kubernetes.ts's job (it manages rollout
|
|
33
|
-
* status + port-forward + audit log). ensureK8sBootstrap returns once the
|
|
34
|
-
* "prerequisites" (namespace + RBAC + secrets) are in place.
|
|
35
|
-
*/
|
|
36
|
-
import { spawnSync } from 'node:child_process';
|
|
37
|
-
import { existsSync, readdirSync, readFileSync } from 'node:fs';
|
|
38
|
-
import { join } from 'node:path';
|
|
39
|
-
import { kubectlWrap } from './kubectl-wrap.js';
|
|
40
|
-
import { installRoot } from '../install-root.js';
|
|
41
|
-
import { OLAM_HOME } from './config.js';
|
|
42
|
-
import { renderAllSecrets, SECRET_TEMPLATE_BINDINGS, } from './k8s-secret-render.js';
|
|
43
|
-
export const K8S_NAMESPACE = 'olam';
|
|
44
|
-
/**
|
|
45
|
-
* Manifest files inside `<install-root>/host-cp/k8s/manifests/` that
|
|
46
|
-
* ensureK8sBootstrap applies. Ordered numerically by filename prefix.
|
|
47
|
-
* Deployment + Service are intentionally absent — upgrade-kubernetes.ts
|
|
48
|
-
* applies those alongside its rollout-status step.
|
|
49
|
-
*/
|
|
50
|
-
const HOST_CP_PREREQ_MANIFESTS = [
|
|
51
|
-
'00-namespace.yaml',
|
|
52
|
-
'10-serviceaccount.yaml',
|
|
53
|
-
'20-rbac.yaml',
|
|
54
|
-
'30-configmap.yaml',
|
|
55
|
-
'45-pvc.yaml',
|
|
56
|
-
];
|
|
57
|
-
/**
|
|
58
|
-
* Peripheral subdirs under `<install-root>/host-cp/k8s/manifests/`. Each
|
|
59
|
-
* carries its own 10/20/30/45 prerequisite YAMLs. 50-deployment + 60-service
|
|
60
|
-
* are skipped here (upgrade.ts owns rollout).
|
|
61
|
-
*/
|
|
62
|
-
const PERIPHERAL_SUBDIRS = [
|
|
63
|
-
'auth-service',
|
|
64
|
-
'mcp-auth-service',
|
|
65
|
-
'kg-service',
|
|
66
|
-
'memory-service',
|
|
67
|
-
// Phase B Model B: in-cluster chunks substrate + plan-chat sidecar.
|
|
68
|
-
// chunks-postgres and chunks-electric come before plan-chat-service so
|
|
69
|
-
// their Services exist when plan-chat-service first resolves
|
|
70
|
-
// OLAM_PLAN_CHAT_DATABASE_URL / OLAM_PLAN_CHAT_ELECTRIC_URL.
|
|
71
|
-
'chunks-postgres',
|
|
72
|
-
'chunks-electric',
|
|
73
|
-
'plan-chat-service',
|
|
74
|
-
];
|
|
75
|
-
const PERIPHERAL_PREREQ_FILES = ['10-serviceaccount.yaml', '20-rbac.yaml', '30-configmap.yaml', '45-pvc.yaml'];
|
|
76
|
-
/**
|
|
77
|
-
* kubectl apply wrapper — accepts a YAML string and applies via stdin (D20
|
|
78
|
-
* stdin-safe; values never inlined into argv). When `manifestPath` is given
|
|
79
|
-
* the file is applied via `-f <path>` instead (manifests stay on disk).
|
|
80
|
-
*/
|
|
81
|
-
async function kubectlApply(context, source, deps) {
|
|
82
|
-
const wrap = deps.kubectlWrapImpl ?? kubectlWrap;
|
|
83
|
-
if ('path' in source) {
|
|
84
|
-
const r = await wrap(['--context', context, 'apply', '-f', source.path], { timeout: 30_000 });
|
|
85
|
-
return { ok: r.ok, stderr: r.stderr };
|
|
86
|
-
}
|
|
87
|
-
const r = await wrap(['--context', context, 'apply', '-f', '-'], { timeout: 30_000, stdin: source.stdinYaml });
|
|
88
|
-
return { ok: r.ok, stderr: r.stderr };
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
* Locate the bundled k8s assets directory. In install-mode this is
|
|
92
|
-
* `<install-root>/host-cp/k8s/`. In dev-mode it falls back to the
|
|
93
|
-
* monorepo's `packages/host-cp/k8s/`.
|
|
94
|
-
*/
|
|
95
|
-
export function resolveK8sAssetsRoot(installRootDir = installRoot()) {
|
|
96
|
-
const installed = join(installRootDir, 'host-cp', 'k8s');
|
|
97
|
-
if (existsSync(installed))
|
|
98
|
-
return installed;
|
|
99
|
-
// Dev-mode fallback. installRoot points at <repo>/packages/cli; walk up.
|
|
100
|
-
const repoRoot = join(installRootDir, '..', '..');
|
|
101
|
-
const monorepo = join(repoRoot, 'packages', 'host-cp', 'k8s');
|
|
102
|
-
if (existsSync(monorepo))
|
|
103
|
-
return monorepo;
|
|
104
|
-
return null;
|
|
105
|
-
}
|
|
106
|
-
/**
|
|
107
|
-
* Run the bootstrap. Idempotent on re-run.
|
|
108
|
-
*
|
|
109
|
-
* Apply order (numeric filename prefix mirrors apply ORDER):
|
|
110
|
-
* 1. <root>/manifests/00-namespace.yaml + 10/20/30/45 (host-cp prereqs)
|
|
111
|
-
* 2. Per-peripheral 10/20/30/45 prereqs (auth-service / mcp-auth-service / kg-service / memory-service)
|
|
112
|
-
* 3. host-cp Secret (rendered from templates/40-secret-template.yaml)
|
|
113
|
-
* 4. Per-peripheral Secrets (rendered from each *-secret-template.yaml)
|
|
114
|
-
*
|
|
115
|
-
* On the first failed apply we surface the kubectl stderr and stop —
|
|
116
|
-
* partial-apply state is left in the cluster (kubectl apply is idempotent;
|
|
117
|
-
* re-running picks up where we stopped).
|
|
118
|
-
*/
|
|
119
|
-
export async function ensureK8sBootstrap(opts, deps = {}) {
|
|
120
|
-
const stdout = deps.stdout ?? process.stdout;
|
|
121
|
-
const stderr = deps.stderr ?? process.stderr;
|
|
122
|
-
const namespace = opts.namespace ?? K8S_NAMESPACE;
|
|
123
|
-
const apply = deps.applyImpl ?? kubectlApply;
|
|
124
|
-
const onProgress = deps.onProgress;
|
|
125
|
-
const assetsRoot = deps.k8sAssetsRoot ?? resolveK8sAssetsRoot();
|
|
126
|
-
if (assetsRoot === null || !existsSync(assetsRoot)) {
|
|
127
|
-
return {
|
|
128
|
-
exitCode: 1,
|
|
129
|
-
result: { applied: [], skipped: [], secretResults: [] },
|
|
130
|
-
error: 'Could not find bundled k8s assets. Expected <install-root>/host-cp/k8s/ or <repo>/packages/host-cp/k8s/. ' +
|
|
131
|
-
'Reinstall the CLI: `npm install -g @pleri/olam-cli@latest`.',
|
|
132
|
-
};
|
|
133
|
-
}
|
|
134
|
-
const manifestsRoot = join(assetsRoot, 'manifests');
|
|
135
|
-
const applied = [];
|
|
136
|
-
const skipped = [];
|
|
137
|
-
// 1+2. host-cp prereq manifests + per-peripheral prereqs.
|
|
138
|
-
const manifestPaths = [];
|
|
139
|
-
for (const f of HOST_CP_PREREQ_MANIFESTS) {
|
|
140
|
-
manifestPaths.push(join(manifestsRoot, f));
|
|
141
|
-
}
|
|
142
|
-
for (const sub of PERIPHERAL_SUBDIRS) {
|
|
143
|
-
for (const f of PERIPHERAL_PREREQ_FILES) {
|
|
144
|
-
const p = join(manifestsRoot, sub, f);
|
|
145
|
-
if (existsSync(p))
|
|
146
|
-
manifestPaths.push(p);
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
for (const mp of manifestPaths) {
|
|
150
|
-
if (opts.dryRun) {
|
|
151
|
-
applied.push({ kind: 'manifest', path: mp });
|
|
152
|
-
continue;
|
|
153
|
-
}
|
|
154
|
-
if (!existsSync(mp)) {
|
|
155
|
-
skipped.push({ kind: 'manifest', ref: mp, reason: 'file not found in bundle (older package?)' });
|
|
156
|
-
continue;
|
|
157
|
-
}
|
|
158
|
-
const label = ` → applying ${mp.replace(assetsRoot, '<k8s-assets>')}`;
|
|
159
|
-
if (onProgress) {
|
|
160
|
-
onProgress(label);
|
|
161
|
-
}
|
|
162
|
-
else {
|
|
163
|
-
stdout.write(`${label}\n`);
|
|
164
|
-
}
|
|
165
|
-
const r = await apply(opts.context, { path: mp }, deps);
|
|
166
|
-
if (!r.ok) {
|
|
167
|
-
stderr.write(`error: kubectl apply -f ${mp} failed:\n${r.stderr}\n`);
|
|
168
|
-
return {
|
|
169
|
-
exitCode: 1,
|
|
170
|
-
result: { applied, skipped, secretResults: [] },
|
|
171
|
-
error: `kubectl apply of ${mp} failed`,
|
|
172
|
-
};
|
|
173
|
-
}
|
|
174
|
-
applied.push({ kind: 'manifest', path: mp });
|
|
175
|
-
}
|
|
176
|
-
// 3+4. Render + apply secrets.
|
|
177
|
-
const { results } = renderAllSecrets(assetsRoot, { rotate: opts.rotateSecrets === true, context: opts.context, namespace }, deps.renderDeps ?? {});
|
|
178
|
-
for (const r of results) {
|
|
179
|
-
if (r.status === 'skipped') {
|
|
180
|
-
const reason = `unresolved source(s): ${r.missingSources.join('; ')}`;
|
|
181
|
-
skipped.push({ kind: 'secret', ref: r.secretName, reason });
|
|
182
|
-
stderr.write(`warn: Secret ${r.secretName} skipped — ${reason}\n`);
|
|
183
|
-
stderr.write(` Once you have the source value, apply manually:\n`);
|
|
184
|
-
stderr.write(` kubectl --context ${opts.context} apply -n ${namespace} -f - <<EOF\n (rendered secret YAML)\nEOF\n`);
|
|
185
|
-
continue;
|
|
186
|
-
}
|
|
187
|
-
if (opts.dryRun) {
|
|
188
|
-
applied.push({ kind: 'secret', name: r.secretName });
|
|
189
|
-
continue;
|
|
190
|
-
}
|
|
191
|
-
const secretLabel = ` → applying Secret ${r.secretName}`;
|
|
192
|
-
if (onProgress) {
|
|
193
|
-
onProgress(secretLabel);
|
|
194
|
-
}
|
|
195
|
-
else {
|
|
196
|
-
stdout.write(`${secretLabel}\n`);
|
|
197
|
-
}
|
|
198
|
-
const a = await apply(opts.context, { stdinYaml: r.renderedYaml }, deps);
|
|
199
|
-
if (!a.ok) {
|
|
200
|
-
stderr.write(`error: kubectl apply Secret ${r.secretName} failed:\n${a.stderr}\n`);
|
|
201
|
-
return {
|
|
202
|
-
exitCode: 1,
|
|
203
|
-
result: { applied, skipped, secretResults: results },
|
|
204
|
-
error: `kubectl apply Secret ${r.secretName} failed`,
|
|
205
|
-
};
|
|
206
|
-
}
|
|
207
|
-
applied.push({ kind: 'secret', name: r.secretName });
|
|
208
|
-
}
|
|
209
|
-
return { exitCode: 0, result: { applied, skipped, secretResults: results } };
|
|
210
|
-
}
|
|
211
|
-
/**
|
|
212
|
-
* Read the list of expected Secret names — used by probeK8sRequiredSecrets
|
|
213
|
-
* so the doctor probe stays in lockstep with the bootstrap module.
|
|
214
|
-
*/
|
|
215
|
-
export function expectedSecretNames() {
|
|
216
|
-
return SECRET_TEMPLATE_BINDINGS.map((b) => b.secretName);
|
|
217
|
-
}
|
|
218
|
-
//# sourceMappingURL=k8s-bootstrap.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"k8s-bootstrap.js","sourceRoot":"","sources":["../../src/lib/k8s-bootstrap.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAChE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EACL,gBAAgB,EAGhB,wBAAwB,GACzB,MAAM,wBAAwB,CAAC;AAEhC,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC;AAEpC;;;;;GAKG;AACH,MAAM,wBAAwB,GAAG;IAC/B,mBAAmB;IACnB,wBAAwB;IACxB,cAAc;IACd,mBAAmB;IACnB,aA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,CAAC,UAAU,CAAC,CAAC;AAC3D,CAAC"}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* k8s-context-discovery.ts — kubeconfig context enumeration + reachability + idleness probes.
|
|
3
|
-
*
|
|
4
|
-
* Used by `olam setup` Phase 0.5 (ADR 021) to detect existing reachable
|
|
5
|
-
* Kubernetes contexts and offer to reuse them instead of provisioning a
|
|
6
|
-
* new k3d cluster.
|
|
7
|
-
*
|
|
8
|
-
* All external I/O is injected via the `KubeContextDeps` interface for
|
|
9
|
-
* testability. Production callers use the default implementations which
|
|
10
|
-
* shell out to `kubectl`.
|
|
11
|
-
*/
|
|
12
|
-
export interface KubeContextProbe {
|
|
13
|
-
readonly reachable: boolean;
|
|
14
|
-
readonly error?: string;
|
|
15
|
-
readonly serverUrl?: string;
|
|
16
|
-
}
|
|
17
|
-
export interface KubeContextDeps {
|
|
18
|
-
/**
|
|
19
|
-
* Return all context names from `~/.kube/config` (or `$KUBECONFIG`).
|
|
20
|
-
* Default: `kubectl config get-contexts -o name`
|
|
21
|
-
*/
|
|
22
|
-
readonly getContexts?: () => string[];
|
|
23
|
-
/**
|
|
24
|
-
* Probe one context for reachability.
|
|
25
|
-
* Default: `kubectl --context=<name> cluster-info --request-timeout=3s`
|
|
26
|
-
*/
|
|
27
|
-
readonly clusterInfo?: (context: string) => KubeContextProbe;
|
|
28
|
-
/**
|
|
29
|
-
* Check whether a context is idle (no `olam` namespace, or `olam` ns
|
|
30
|
-
* present but no running pods).
|
|
31
|
-
* Default: `kubectl --context=<name> get namespace olam --ignore-not-found`
|
|
32
|
-
* + `kubectl --context=<name> get pods -n olam`
|
|
33
|
-
*/
|
|
34
|
-
readonly isIdle?: (context: string) => boolean;
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Context names provisioned by `olam setup` — never offered for reuse.
|
|
38
|
-
* These are ours to manage (create/destroy via k3d).
|
|
39
|
-
*/
|
|
40
|
-
export declare const OLAM_MANAGED_CONTEXT_PREFIX = "k3d-olam-";
|
|
41
|
-
export declare function isOlamManagedContext(name: string): boolean;
|
|
42
|
-
/**
|
|
43
|
-
* Default implementation: enumerate kubeconfig contexts via
|
|
44
|
-
* `kubectl config get-contexts -o name`.
|
|
45
|
-
* Returns an empty array when kubectl is absent or returns no contexts.
|
|
46
|
-
*/
|
|
47
|
-
export declare function defaultGetContexts(): string[];
|
|
48
|
-
/**
|
|
49
|
-
* Default implementation: probe a context via
|
|
50
|
-
* `kubectl --context=<name> cluster-info --request-timeout=3s`.
|
|
51
|
-
*
|
|
52
|
-
* Returns reachable:true when exit status is 0.
|
|
53
|
-
* Returns reachable:false + the stderr text otherwise.
|
|
54
|
-
*/
|
|
55
|
-
export declare function defaultClusterInfo(context: string): KubeContextProbe;
|
|
56
|
-
/**
|
|
57
|
-
* Default implementation: a context is idle when there is no `olam`
|
|
58
|
-
* namespace OR the namespace exists but has no running pods.
|
|
59
|
-
*
|
|
60
|
-
* "Idle" means we haven't deployed Olam there yet — safe to offer for reuse.
|
|
61
|
-
*/
|
|
62
|
-
export declare function defaultIsIdle(context: string): boolean;
|
|
63
|
-
export interface DiscoveryResult {
|
|
64
|
-
/** All reachable idle contexts that are not k3d-olam-* managed contexts. */
|
|
65
|
-
readonly offerable: readonly string[];
|
|
66
|
-
/** All contexts that were probed (for diagnostics). */
|
|
67
|
-
readonly allContexts: readonly string[];
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* Discover reachable idle kubeconfig contexts that could be offered for reuse.
|
|
71
|
-
*
|
|
72
|
-
* Steps:
|
|
73
|
-
* 1. Enumerate all contexts from kubeconfig.
|
|
74
|
-
* 2. Filter out k3d-olam-* (olam-managed).
|
|
75
|
-
* 3. For each remaining context, probe reachability (3s timeout).
|
|
76
|
-
* 4. For reachable contexts, check idleness.
|
|
77
|
-
* 5. Return the offerable set.
|
|
78
|
-
*/
|
|
79
|
-
export declare function discoverOfferableContexts(deps?: KubeContextDeps): DiscoveryResult;
|
|
80
|
-
//# sourceMappingURL=k8s-context-discovery.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"k8s-context-discovery.d.ts","sourceRoot":"","sources":["../../src/lib/k8s-context-discovery.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAMH,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,MAAM,EAAE,CAAC;IACtC;;;OAGG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,gBAAgB,CAAC;IAC7D;;;;;OAKG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC;CAChD;AAID;;;GAGG;AACH,eAAO,MAAM,2BAA2B,cAAc,CAAC;AAEvD,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAE1D;AAID;;;;GAIG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,EAAE,CAW7C;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,gBAAgB,CAcpE;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAqBtD;AAID,MAAM,WAAW,eAAe;IAC9B,4EAA4E;IAC5E,QAAQ,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;IACtC,uDAAuD;IACvD,QAAQ,CAAC,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC;CACzC;AAED;;;;;;;;;GASG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,GAAE,eAAoB,GAAG,eAAe,CAgBrF"}
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* k8s-context-discovery.ts — kubeconfig context enumeration + reachability + idleness probes.
|
|
3
|
-
*
|
|
4
|
-
* Used by `olam setup` Phase 0.5 (ADR 021) to detect existing reachable
|
|
5
|
-
* Kubernetes contexts and offer to reuse them instead of provisioning a
|
|
6
|
-
* new k3d cluster.
|
|
7
|
-
*
|
|
8
|
-
* All external I/O is injected via the `KubeContextDeps` interface for
|
|
9
|
-
* testability. Production callers use the default implementations which
|
|
10
|
-
* shell out to `kubectl`.
|
|
11
|
-
*/
|
|
12
|
-
import { spawnSync } from 'node:child_process';
|
|
13
|
-
// ── k3d-managed context names we own — excluded from the reuse offer ──────────
|
|
14
|
-
/**
|
|
15
|
-
* Context names provisioned by `olam setup` — never offered for reuse.
|
|
16
|
-
* These are ours to manage (create/destroy via k3d).
|
|
17
|
-
*/
|
|
18
|
-
export const OLAM_MANAGED_CONTEXT_PREFIX = 'k3d-olam-';
|
|
19
|
-
export function isOlamManagedContext(name) {
|
|
20
|
-
return name.startsWith(OLAM_MANAGED_CONTEXT_PREFIX);
|
|
21
|
-
}
|
|
22
|
-
// ── Default implementations ───────────────────────────────────────────────────
|
|
23
|
-
/**
|
|
24
|
-
* Default implementation: enumerate kubeconfig contexts via
|
|
25
|
-
* `kubectl config get-contexts -o name`.
|
|
26
|
-
* Returns an empty array when kubectl is absent or returns no contexts.
|
|
27
|
-
*/
|
|
28
|
-
export function defaultGetContexts() {
|
|
29
|
-
const r = spawnSync('kubectl', ['config', 'get-contexts', '-o', 'name'], { encoding: 'utf-8', stdio: ['ignore', 'pipe', 'pipe'] });
|
|
30
|
-
if (r.status !== 0 || !r.stdout)
|
|
31
|
-
return [];
|
|
32
|
-
return r.stdout
|
|
33
|
-
.split('\n')
|
|
34
|
-
.map((l) => l.trim())
|
|
35
|
-
.filter(Boolean);
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Default implementation: probe a context via
|
|
39
|
-
* `kubectl --context=<name> cluster-info --request-timeout=3s`.
|
|
40
|
-
*
|
|
41
|
-
* Returns reachable:true when exit status is 0.
|
|
42
|
-
* Returns reachable:false + the stderr text otherwise.
|
|
43
|
-
*/
|
|
44
|
-
export function defaultClusterInfo(context) {
|
|
45
|
-
const r = spawnSync('kubectl', ['--context', context, 'cluster-info', '--request-timeout=3s'], { encoding: 'utf-8', stdio: ['ignore', 'pipe', 'pipe'] });
|
|
46
|
-
if (r.status === 0) {
|
|
47
|
-
// Extract server URL from stdout if present (first line looks like
|
|
48
|
-
// "Kubernetes control plane is running at https://127.0.0.1:6443")
|
|
49
|
-
const match = r.stdout.match(/running at (https?:\/\/\S+)/i);
|
|
50
|
-
return { reachable: true, serverUrl: match?.[1] };
|
|
51
|
-
}
|
|
52
|
-
const err = (r.stderr || '').trim().slice(0, 200);
|
|
53
|
-
return { reachable: false, error: err || 'cluster-info failed' };
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* Default implementation: a context is idle when there is no `olam`
|
|
57
|
-
* namespace OR the namespace exists but has no running pods.
|
|
58
|
-
*
|
|
59
|
-
* "Idle" means we haven't deployed Olam there yet — safe to offer for reuse.
|
|
60
|
-
*/
|
|
61
|
-
export function defaultIsIdle(context) {
|
|
62
|
-
// Check whether the `olam` namespace exists
|
|
63
|
-
const nsResult = spawnSync('kubectl', ['--context', context, 'get', 'namespace', 'olam', '--ignore-not-found', '-o', 'name'], { encoding: 'utf-8', stdio: ['ignore', 'pipe', 'pipe'] });
|
|
64
|
-
const nsLine = (nsResult.stdout || '').trim();
|
|
65
|
-
if (!nsLine) {
|
|
66
|
-
// No `olam` namespace → definitely idle
|
|
67
|
-
return true;
|
|
68
|
-
}
|
|
69
|
-
// Namespace exists — check if any pods are running
|
|
70
|
-
const podsResult = spawnSync('kubectl', ['--context', context, 'get', 'pods', '-n', 'olam', '--no-headers'], { encoding: 'utf-8', stdio: ['ignore', 'pipe', 'pipe'] });
|
|
71
|
-
const podsOut = (podsResult.stdout || '').trim();
|
|
72
|
-
// If output is empty or just "No resources found..." the ns is empty → idle
|
|
73
|
-
return !podsOut || /no resources found/i.test(podsOut);
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Discover reachable idle kubeconfig contexts that could be offered for reuse.
|
|
77
|
-
*
|
|
78
|
-
* Steps:
|
|
79
|
-
* 1. Enumerate all contexts from kubeconfig.
|
|
80
|
-
* 2. Filter out k3d-olam-* (olam-managed).
|
|
81
|
-
* 3. For each remaining context, probe reachability (3s timeout).
|
|
82
|
-
* 4. For reachable contexts, check idleness.
|
|
83
|
-
* 5. Return the offerable set.
|
|
84
|
-
*/
|
|
85
|
-
export function discoverOfferableContexts(deps = {}) {
|
|
86
|
-
const getContextsFn = deps.getContexts ?? defaultGetContexts;
|
|
87
|
-
const clusterInfoFn = deps.clusterInfo ?? defaultClusterInfo;
|
|
88
|
-
const isIdleFn = deps.isIdle ?? defaultIsIdle;
|
|
89
|
-
const allContexts = getContextsFn();
|
|
90
|
-
const offerable = [];
|
|
91
|
-
for (const ctx of allContexts) {
|
|
92
|
-
if (isOlamManagedContext(ctx))
|
|
93
|
-
continue;
|
|
94
|
-
const probe = clusterInfoFn(ctx);
|
|
95
|
-
if (!probe.reachable)
|
|
96
|
-
continue;
|
|
97
|
-
if (isIdleFn(ctx))
|
|
98
|
-
offerable.push(ctx);
|
|
99
|
-
}
|
|
100
|
-
return { offerable, allContexts };
|
|
101
|
-
}
|
|
102
|
-
//# sourceMappingURL=k8s-context-discovery.js.map
|