@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,168 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* port-forward.ts — kubectl port-forward lifecycle manager for olam-cli.
|
|
3
|
-
*
|
|
4
|
-
* Phase 1b C1 of olam-host-suite-phase-1b-k3s-beta-flavour (plan
|
|
5
|
-
* ~/.claude/plans/olam-host-suite-phase-1b-k3s-beta-flavour.md).
|
|
6
|
-
*
|
|
7
|
-
* Phase 2 Phase B B2 (olam-host-suite-phase-2-peripheral-services-on-k3s):
|
|
8
|
-
* Extended with registry-driven multi-peripheral support:
|
|
9
|
-
* spawnAllPeripheralPortForwards() — iterate PERIPHERALS; spawn each in parallel
|
|
10
|
-
* stopAllPeripheralPortForwards() — SIGTERM each peripheral's port-forward
|
|
11
|
-
* getPeripheralLivenessSnapshot() — TCP probe all 4 peripherals; return {name, alive}[]
|
|
12
|
-
* Each peripheral uses its own independent flock + PID file named by peripheral.name.
|
|
13
|
-
* host-cp port-forward retained as a named special-case; Phase 1b callers unchanged.
|
|
14
|
-
*
|
|
15
|
-
* Decisions consumed:
|
|
16
|
-
* D17 — port-forward spawn via flock advisory lock (race-safe)
|
|
17
|
-
* D23 — PID file at ~/.olam/state/port-forward.pid (mode 0600)
|
|
18
|
-
* D24 — probePortForwardLiveness uses TCP probe, NOT kill(pid, 0)
|
|
19
|
-
* D26 — per-peripheral PID/lock at ~/.olam/state/port-forward-<name>.{pid,lock}
|
|
20
|
-
*
|
|
21
|
-
* ## Flock strategy (why O_CREAT|O_EXCL, not POSIX flock(2))
|
|
22
|
-
*
|
|
23
|
-
* Node.js has no built-in `flock(2)` syscall binding. Instead we use
|
|
24
|
-
* `fs.openSync(lockPath, 'wx')` which maps to `open(O_CREAT|O_EXCL|O_WRONLY)`.
|
|
25
|
-
* On POSIX this is atomic: exactly ONE caller will succeed; concurrent callers
|
|
26
|
-
* receive EEXIST. This is semantically equivalent to a non-blocking `flock`
|
|
27
|
-
* for our scenario (guard the read-check-spawn sequence against concurrent
|
|
28
|
-
* `olam upgrade` / `olam status` invocations). POSIX flock would additionally
|
|
29
|
-
* survive fd inheritance across forks — we don't need that here because the
|
|
30
|
-
* lock scope is only the spawn decision, not the port-forward subprocess lifetime.
|
|
31
|
-
* Lock release: `unlinkSync(lockPath)` in a finally block.
|
|
32
|
-
*
|
|
33
|
-
* ## PID file lifecycle
|
|
34
|
-
* 1. Acquire lock (O_CREAT|O_EXCL on lock file).
|
|
35
|
-
* 2. Read PID file (if present) → TCP-probe liveness of existing forward.
|
|
36
|
-
* 3. If live → release lock; return (nothing to do).
|
|
37
|
-
* 4. Write PID file to a tmp path, set mode 0600, rename atomically.
|
|
38
|
-
* 5. Spawn kubectl port-forward.
|
|
39
|
-
* 6. Release lock.
|
|
40
|
-
* 7. Port-forward runs detached (stderr suppressed); PID file removed on exit.
|
|
41
|
-
*
|
|
42
|
-
* ## TCP probe (D24)
|
|
43
|
-
*
|
|
44
|
-
* `probePortForwardLiveness` opens a TCP connection to 127.0.0.1:19000.
|
|
45
|
-
* `kill(pid, 0)` would only check process existence — it cannot distinguish
|
|
46
|
-
* "port-forward process alive but tunnel broken" from "tunnel working". TCP
|
|
47
|
-
* is the ground truth.
|
|
48
|
-
*/
|
|
49
|
-
import { spawn } from 'node:child_process';
|
|
50
|
-
import * as path from 'node:path';
|
|
51
|
-
import * as os from 'node:os';
|
|
52
|
-
import { type Peripheral } from './peripheral-registry.js';
|
|
53
|
-
export declare const PORT_FORWARD_PORT = 19000;
|
|
54
|
-
export declare const PORT_FORWARD_LOCK_PATH: string;
|
|
55
|
-
export declare const PORT_FORWARD_PID_PATH: string;
|
|
56
|
-
export interface PortForwardDeps {
|
|
57
|
-
/** inject for tests — overrides the state dir used for lock + PID files */
|
|
58
|
-
readonly stateDir?: string;
|
|
59
|
-
/** inject for tests — overrides the spawn factory */
|
|
60
|
-
readonly spawnImpl?: typeof spawn;
|
|
61
|
-
/** inject for tests — overrides TCP probe */
|
|
62
|
-
readonly tcpProbeImpl?: (host: string, port: number, timeoutMs: number) => Promise<boolean>;
|
|
63
|
-
/** inject for tests — overrides Date.now() for timestamp assertions */
|
|
64
|
-
readonly now?: () => number;
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* Probe liveness of the port-forward tunnel via a TCP connection attempt.
|
|
68
|
-
*
|
|
69
|
-
* Returns true only when a TCP connection to 127.0.0.1:PORT_FORWARD_PORT
|
|
70
|
-
* succeeds. PID-alive check (kill(pid, 0)) is intentionally NOT used —
|
|
71
|
-
* the process could be alive but the tunnel broken (per D24).
|
|
72
|
-
*
|
|
73
|
-
* Injectable: `deps.tcpProbeImpl` replaces the real TCP socket for tests.
|
|
74
|
-
*/
|
|
75
|
-
export declare function probePortForwardLiveness(deps?: Pick<PortForwardDeps, 'tcpProbeImpl'>): Promise<boolean>;
|
|
76
|
-
export type SpawnPortForwardResult = {
|
|
77
|
-
spawned: true;
|
|
78
|
-
pid: number;
|
|
79
|
-
} | {
|
|
80
|
-
spawned: false;
|
|
81
|
-
reason: 'live' | 'lock-held';
|
|
82
|
-
};
|
|
83
|
-
/**
|
|
84
|
-
* Spawn a `kubectl port-forward` subprocess, guarded by an advisory lock
|
|
85
|
-
* so concurrent callers produce exactly ONE running port-forward process.
|
|
86
|
-
*
|
|
87
|
-
* Protocol:
|
|
88
|
-
* 1. Acquire advisory lock (throws on concurrent access → returns 'lock-held').
|
|
89
|
-
* 2. TCP-probe liveness of any existing port-forward.
|
|
90
|
-
* 3. If live → release lock; return { spawned: false, reason: 'live' }.
|
|
91
|
-
* 4. Spawn kubectl port-forward (detached, stdio ignored).
|
|
92
|
-
* 5. Write PID file atomically (mode 0600).
|
|
93
|
-
* 6. Release lock.
|
|
94
|
-
* 7. Unref child so the CLI process can exit without waiting for it.
|
|
95
|
-
* 8. Register 'exit' listener on child to remove the PID file on teardown.
|
|
96
|
-
*
|
|
97
|
-
* @param context - kubectl context name (--context flag)
|
|
98
|
-
* @param namespace - target namespace
|
|
99
|
-
* @param target - service or pod target (e.g. 'service/olam-host-cp')
|
|
100
|
-
* @param localPort - local port to bind (default: PORT_FORWARD_PORT)
|
|
101
|
-
* @param remotePort - remote port on the target (default: PORT_FORWARD_PORT)
|
|
102
|
-
* @param deps - injectable dependencies for testing
|
|
103
|
-
*/
|
|
104
|
-
export declare function spawnPortForward(context: string, namespace: string, target: string, localPort?: number, remotePort?: number, deps?: PortForwardDeps): Promise<SpawnPortForwardResult>;
|
|
105
|
-
/**
|
|
106
|
-
* Kill a running port-forward identified by the PID file and remove the file.
|
|
107
|
-
* No-op when no PID file exists. Returns true when a process was signalled.
|
|
108
|
-
*/
|
|
109
|
-
export declare function stopPortForward(deps?: PortForwardDeps): boolean;
|
|
110
|
-
/**
|
|
111
|
-
* Options for peripheral port-forward operations (injectable for tests).
|
|
112
|
-
* Extends the same deps pattern as the host-cp single port-forward.
|
|
113
|
-
*/
|
|
114
|
-
export interface PeripheralPortForwardDeps {
|
|
115
|
-
/** Override state directory (default: OLAM_STATE_DIR). Used in tests to isolate state. */
|
|
116
|
-
readonly stateDir?: string;
|
|
117
|
-
/** Override spawn factory (default: child_process.spawn). */
|
|
118
|
-
readonly spawnImpl?: typeof spawn;
|
|
119
|
-
/** Override TCP probe (default: real TCP socket). */
|
|
120
|
-
readonly tcpProbeImpl?: (host: string, port: number, timeoutMs: number) => Promise<boolean>;
|
|
121
|
-
}
|
|
122
|
-
/**
|
|
123
|
-
* Spawn a kubectl port-forward for a single peripheral, guarded by an
|
|
124
|
-
* independent advisory lock per peripheral. Mirrors the Phase 1b host-cp
|
|
125
|
-
* pattern (D17/D23/D24) generalised to any Peripheral entry.
|
|
126
|
-
*
|
|
127
|
-
* Returns true when a new process was spawned; false when the tunnel was
|
|
128
|
-
* already live or the lock was held by a concurrent caller.
|
|
129
|
-
*
|
|
130
|
-
* @internal — called by spawnAllPeripheralPortForwards; exported for test injection.
|
|
131
|
-
*/
|
|
132
|
-
export declare function spawnPeripheralPortForward(peripheral: Peripheral, context: string, namespace: string, deps?: PeripheralPortForwardDeps): Promise<boolean>;
|
|
133
|
-
/**
|
|
134
|
-
* Spawn kubectl port-forward processes for all 4 peripherals in parallel.
|
|
135
|
-
*
|
|
136
|
-
* Each peripheral uses its own independent flock + PID file
|
|
137
|
-
* (`~/.olam/state/port-forward-<name>.{lock,pid}`), so locking one
|
|
138
|
-
* peripheral does NOT block another.
|
|
139
|
-
*
|
|
140
|
-
* @param context - kubectl context name (--context flag); defaults to 'olam'
|
|
141
|
-
* @param namespace - target namespace; defaults to 'olam'
|
|
142
|
-
* @param deps - injectable dependencies for testing
|
|
143
|
-
*/
|
|
144
|
-
export declare function spawnAllPeripheralPortForwards(context?: string, namespace?: string, deps?: PeripheralPortForwardDeps): Promise<void>;
|
|
145
|
-
/**
|
|
146
|
-
* Send SIGTERM to all running peripheral port-forward processes and
|
|
147
|
-
* remove their PID and lock files.
|
|
148
|
-
*
|
|
149
|
-
* No-op for any peripheral whose PID file is absent (process already stopped).
|
|
150
|
-
*
|
|
151
|
-
* @param deps - injectable dependencies for testing (stateDir override)
|
|
152
|
-
*/
|
|
153
|
-
export declare function stopAllPeripheralPortForwards(deps?: Pick<PeripheralPortForwardDeps, 'stateDir'>): void;
|
|
154
|
-
export interface PeripheralLivenessEntry {
|
|
155
|
-
name: string;
|
|
156
|
-
alive: boolean;
|
|
157
|
-
}
|
|
158
|
-
/**
|
|
159
|
-
* TCP-probe each peripheral and return a snapshot of their liveness.
|
|
160
|
-
*
|
|
161
|
-
* Uses the same realTcpProbe utility as probePortForwardLiveness (D24).
|
|
162
|
-
* Probes run in parallel for speed.
|
|
163
|
-
*
|
|
164
|
-
* @param deps - injectable dependencies for testing
|
|
165
|
-
*/
|
|
166
|
-
export declare function getPeripheralLivenessSnapshot(deps?: Pick<PeripheralPortForwardDeps, 'tcpProbeImpl'>): Promise<PeripheralLivenessEntry[]>;
|
|
167
|
-
export { os, path };
|
|
168
|
-
//# sourceMappingURL=port-forward.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"port-forward.d.ts","sourceRoot":"","sources":["../../src/lib/port-forward.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAG3C,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAE9B,OAAO,EAAe,KAAK,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAExE,eAAO,MAAM,iBAAiB,QAAQ,CAAC;AACvC,eAAO,MAAM,sBAAsB,QAAiD,CAAC;AACrF,eAAO,MAAM,qBAAqB,QAAgD,CAAC;AAKnF,MAAM,WAAW,eAAe;IAC9B,2EAA2E;IAC3E,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,qDAAqD;IACrD,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,KAAK,CAAC;IAClC,6CAA6C;IAC7C,QAAQ,CAAC,YAAY,CAAC,EAAE,CA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,EAAE,UAAU,EACtB,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EACjB,IAAI,GAAE,yBAA8B,GACnC,OAAO,CAAC,OAAO,CAAC,CAkElB;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,8BAA8B,CAClD,OAAO,SAAS,EAChB,SAAS,SAAS,EAClB,IAAI,GAAE,yBAA8B,GACnC,OAAO,CAAC,IAAI,CAAC,CAIf;AAED;;;;;;;GAOG;AACH,wBAAgB,6BAA6B,CAC3C,IAAI,GAAE,IAAI,CAAC,yBAAyB,EAAE,UAAU,CAAM,GACrD,IAAI,CAYN;AAED,MAAM,WAAW,uBAAuB;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,OAAO,CAAC;CAChB;AAED;;;;;;;GAOG;AACH,wBAAsB,6BAA6B,CACjD,IAAI,GAAE,IAAI,CAAC,yBAAyB,EAAE,cAAc,CAAM,GACzD,OAAO,CAAC,uBAAuB,EAAE,CAAC,CAQpC;AAGD,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC"}
|
package/dist/lib/port-forward.js
DELETED
|
@@ -1,393 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* port-forward.ts — kubectl port-forward lifecycle manager for olam-cli.
|
|
3
|
-
*
|
|
4
|
-
* Phase 1b C1 of olam-host-suite-phase-1b-k3s-beta-flavour (plan
|
|
5
|
-
* ~/.claude/plans/olam-host-suite-phase-1b-k3s-beta-flavour.md).
|
|
6
|
-
*
|
|
7
|
-
* Phase 2 Phase B B2 (olam-host-suite-phase-2-peripheral-services-on-k3s):
|
|
8
|
-
* Extended with registry-driven multi-peripheral support:
|
|
9
|
-
* spawnAllPeripheralPortForwards() — iterate PERIPHERALS; spawn each in parallel
|
|
10
|
-
* stopAllPeripheralPortForwards() — SIGTERM each peripheral's port-forward
|
|
11
|
-
* getPeripheralLivenessSnapshot() — TCP probe all 4 peripherals; return {name, alive}[]
|
|
12
|
-
* Each peripheral uses its own independent flock + PID file named by peripheral.name.
|
|
13
|
-
* host-cp port-forward retained as a named special-case; Phase 1b callers unchanged.
|
|
14
|
-
*
|
|
15
|
-
* Decisions consumed:
|
|
16
|
-
* D17 — port-forward spawn via flock advisory lock (race-safe)
|
|
17
|
-
* D23 — PID file at ~/.olam/state/port-forward.pid (mode 0600)
|
|
18
|
-
* D24 — probePortForwardLiveness uses TCP probe, NOT kill(pid, 0)
|
|
19
|
-
* D26 — per-peripheral PID/lock at ~/.olam/state/port-forward-<name>.{pid,lock}
|
|
20
|
-
*
|
|
21
|
-
* ## Flock strategy (why O_CREAT|O_EXCL, not POSIX flock(2))
|
|
22
|
-
*
|
|
23
|
-
* Node.js has no built-in `flock(2)` syscall binding. Instead we use
|
|
24
|
-
* `fs.openSync(lockPath, 'wx')` which maps to `open(O_CREAT|O_EXCL|O_WRONLY)`.
|
|
25
|
-
* On POSIX this is atomic: exactly ONE caller will succeed; concurrent callers
|
|
26
|
-
* receive EEXIST. This is semantically equivalent to a non-blocking `flock`
|
|
27
|
-
* for our scenario (guard the read-check-spawn sequence against concurrent
|
|
28
|
-
* `olam upgrade` / `olam status` invocations). POSIX flock would additionally
|
|
29
|
-
* survive fd inheritance across forks — we don't need that here because the
|
|
30
|
-
* lock scope is only the spawn decision, not the port-forward subprocess lifetime.
|
|
31
|
-
* Lock release: `unlinkSync(lockPath)` in a finally block.
|
|
32
|
-
*
|
|
33
|
-
* ## PID file lifecycle
|
|
34
|
-
* 1. Acquire lock (O_CREAT|O_EXCL on lock file).
|
|
35
|
-
* 2. Read PID file (if present) → TCP-probe liveness of existing forward.
|
|
36
|
-
* 3. If live → release lock; return (nothing to do).
|
|
37
|
-
* 4. Write PID file to a tmp path, set mode 0600, rename atomically.
|
|
38
|
-
* 5. Spawn kubectl port-forward.
|
|
39
|
-
* 6. Release lock.
|
|
40
|
-
* 7. Port-forward runs detached (stderr suppressed); PID file removed on exit.
|
|
41
|
-
*
|
|
42
|
-
* ## TCP probe (D24)
|
|
43
|
-
*
|
|
44
|
-
* `probePortForwardLiveness` opens a TCP connection to 127.0.0.1:19000.
|
|
45
|
-
* `kill(pid, 0)` would only check process existence — it cannot distinguish
|
|
46
|
-
* "port-forward process alive but tunnel broken" from "tunnel working". TCP
|
|
47
|
-
* is the ground truth.
|
|
48
|
-
*/
|
|
49
|
-
import { spawn } from 'node:child_process';
|
|
50
|
-
import * as fs from 'node:fs';
|
|
51
|
-
import * as net from 'node:net';
|
|
52
|
-
import * as path from 'node:path';
|
|
53
|
-
import * as os from 'node:os';
|
|
54
|
-
import { OLAM_STATE_DIR } from './config.js';
|
|
55
|
-
import { PERIPHERALS } from './peripheral-registry.js';
|
|
56
|
-
export const PORT_FORWARD_PORT = 19000;
|
|
57
|
-
export const PORT_FORWARD_LOCK_PATH = path.join(OLAM_STATE_DIR, 'port-forward.lock');
|
|
58
|
-
export const PORT_FORWARD_PID_PATH = path.join(OLAM_STATE_DIR, 'port-forward.pid');
|
|
59
|
-
/** TCP probe timeout (ms). Fast enough to feel snappy; generous enough for loopback. */
|
|
60
|
-
const TCP_PROBE_TIMEOUT_MS = 2_000;
|
|
61
|
-
/**
|
|
62
|
-
* Probe liveness of the port-forward tunnel via a TCP connection attempt.
|
|
63
|
-
*
|
|
64
|
-
* Returns true only when a TCP connection to 127.0.0.1:PORT_FORWARD_PORT
|
|
65
|
-
* succeeds. PID-alive check (kill(pid, 0)) is intentionally NOT used —
|
|
66
|
-
* the process could be alive but the tunnel broken (per D24).
|
|
67
|
-
*
|
|
68
|
-
* Injectable: `deps.tcpProbeImpl` replaces the real TCP socket for tests.
|
|
69
|
-
*/
|
|
70
|
-
export async function probePortForwardLiveness(deps = {}) {
|
|
71
|
-
const probe = deps.tcpProbeImpl ?? realTcpProbe;
|
|
72
|
-
return probe('127.0.0.1', PORT_FORWARD_PORT, TCP_PROBE_TIMEOUT_MS);
|
|
73
|
-
}
|
|
74
|
-
function realTcpProbe(host, port, timeoutMs) {
|
|
75
|
-
return new Promise((resolve) => {
|
|
76
|
-
const socket = new net.Socket();
|
|
77
|
-
let done = false;
|
|
78
|
-
function finish(result) {
|
|
79
|
-
if (done)
|
|
80
|
-
return;
|
|
81
|
-
done = true;
|
|
82
|
-
socket.destroy();
|
|
83
|
-
resolve(result);
|
|
84
|
-
}
|
|
85
|
-
const timer = setTimeout(() => finish(false), timeoutMs);
|
|
86
|
-
socket.once('connect', () => { clearTimeout(timer); finish(true); });
|
|
87
|
-
socket.once('error', () => { clearTimeout(timer); finish(false); });
|
|
88
|
-
socket.once('timeout', () => { clearTimeout(timer); finish(false); });
|
|
89
|
-
socket.connect(port, host);
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
* Acquire the flock advisory lock (O_CREAT|O_EXCL). Returns a release function.
|
|
94
|
-
* Throws with code EEXIST when the lock is already held by a concurrent caller.
|
|
95
|
-
*
|
|
96
|
-
* The lock file is only held for the duration of the read-check-spawn sequence;
|
|
97
|
-
* it is not held for the port-forward subprocess lifetime.
|
|
98
|
-
*/
|
|
99
|
-
function acquireAdvisoryLock(lockPath) {
|
|
100
|
-
// O_CREAT|O_EXCL|O_WRONLY — POSIX atomic create; throws EEXIST if already exists
|
|
101
|
-
const fd = fs.openSync(lockPath, fs.constants.O_CREAT | fs.constants.O_EXCL | fs.constants.O_WRONLY);
|
|
102
|
-
fs.closeSync(fd);
|
|
103
|
-
return () => {
|
|
104
|
-
try {
|
|
105
|
-
fs.unlinkSync(lockPath);
|
|
106
|
-
}
|
|
107
|
-
catch { /* already removed; best-effort */ }
|
|
108
|
-
};
|
|
109
|
-
}
|
|
110
|
-
function pidFilePath(deps) {
|
|
111
|
-
const stateDir = deps.stateDir ?? OLAM_STATE_DIR;
|
|
112
|
-
return path.join(stateDir, 'port-forward.pid');
|
|
113
|
-
}
|
|
114
|
-
function lockFilePath(deps) {
|
|
115
|
-
const stateDir = deps.stateDir ?? OLAM_STATE_DIR;
|
|
116
|
-
return path.join(stateDir, 'port-forward.lock');
|
|
117
|
-
}
|
|
118
|
-
/**
|
|
119
|
-
* Ensure the state directory exists, then atomically write a PID file
|
|
120
|
-
* to a tmp path and rename into place (mode 0600).
|
|
121
|
-
*/
|
|
122
|
-
function writePidFile(pidPath, pid) {
|
|
123
|
-
const dir = path.dirname(pidPath);
|
|
124
|
-
if (!fs.existsSync(dir)) {
|
|
125
|
-
fs.mkdirSync(dir, { recursive: true });
|
|
126
|
-
}
|
|
127
|
-
const tmp = `${pidPath}.tmp.${process.pid}`;
|
|
128
|
-
fs.writeFileSync(tmp, String(pid) + '\n', { encoding: 'utf8', mode: 0o600 });
|
|
129
|
-
fs.renameSync(tmp, pidPath);
|
|
130
|
-
}
|
|
131
|
-
/**
|
|
132
|
-
* Read the PID from the PID file. Returns null when the file is absent
|
|
133
|
-
* or its content is not a valid positive integer.
|
|
134
|
-
*/
|
|
135
|
-
function readPidFile(pidPath) {
|
|
136
|
-
if (!fs.existsSync(pidPath))
|
|
137
|
-
return null;
|
|
138
|
-
try {
|
|
139
|
-
const raw = fs.readFileSync(pidPath, 'utf8').trim();
|
|
140
|
-
const n = Number.parseInt(raw, 10);
|
|
141
|
-
if (!Number.isInteger(n) || n <= 0)
|
|
142
|
-
return null;
|
|
143
|
-
return n;
|
|
144
|
-
}
|
|
145
|
-
catch {
|
|
146
|
-
return null;
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
/**
|
|
150
|
-
* Spawn a `kubectl port-forward` subprocess, guarded by an advisory lock
|
|
151
|
-
* so concurrent callers produce exactly ONE running port-forward process.
|
|
152
|
-
*
|
|
153
|
-
* Protocol:
|
|
154
|
-
* 1. Acquire advisory lock (throws on concurrent access → returns 'lock-held').
|
|
155
|
-
* 2. TCP-probe liveness of any existing port-forward.
|
|
156
|
-
* 3. If live → release lock; return { spawned: false, reason: 'live' }.
|
|
157
|
-
* 4. Spawn kubectl port-forward (detached, stdio ignored).
|
|
158
|
-
* 5. Write PID file atomically (mode 0600).
|
|
159
|
-
* 6. Release lock.
|
|
160
|
-
* 7. Unref child so the CLI process can exit without waiting for it.
|
|
161
|
-
* 8. Register 'exit' listener on child to remove the PID file on teardown.
|
|
162
|
-
*
|
|
163
|
-
* @param context - kubectl context name (--context flag)
|
|
164
|
-
* @param namespace - target namespace
|
|
165
|
-
* @param target - service or pod target (e.g. 'service/olam-host-cp')
|
|
166
|
-
* @param localPort - local port to bind (default: PORT_FORWARD_PORT)
|
|
167
|
-
* @param remotePort - remote port on the target (default: PORT_FORWARD_PORT)
|
|
168
|
-
* @param deps - injectable dependencies for testing
|
|
169
|
-
*/
|
|
170
|
-
export async function spawnPortForward(context, namespace, target, localPort = PORT_FORWARD_PORT, remotePort = PORT_FORWARD_PORT, deps = {}) {
|
|
171
|
-
const lockPath = lockFilePath(deps);
|
|
172
|
-
const pidPath = pidFilePath(deps);
|
|
173
|
-
const spawnImpl = deps.spawnImpl ?? spawn;
|
|
174
|
-
// Ensure state dir exists before trying to create lock file
|
|
175
|
-
const stateDir = deps.stateDir ?? OLAM_STATE_DIR;
|
|
176
|
-
if (!fs.existsSync(stateDir)) {
|
|
177
|
-
fs.mkdirSync(stateDir, { recursive: true });
|
|
178
|
-
}
|
|
179
|
-
let releaseLock = null;
|
|
180
|
-
try {
|
|
181
|
-
releaseLock = acquireAdvisoryLock(lockPath);
|
|
182
|
-
}
|
|
183
|
-
catch (err) {
|
|
184
|
-
const code = err.code;
|
|
185
|
-
if (code === 'EEXIST') {
|
|
186
|
-
return { spawned: false, reason: 'lock-held' };
|
|
187
|
-
}
|
|
188
|
-
throw err;
|
|
189
|
-
}
|
|
190
|
-
try {
|
|
191
|
-
// TCP-probe any existing port-forward before deciding to spawn.
|
|
192
|
-
const live = await probePortForwardLiveness(deps);
|
|
193
|
-
if (live) {
|
|
194
|
-
return { spawned: false, reason: 'live' };
|
|
195
|
-
}
|
|
196
|
-
// Spawn kubectl port-forward detached so the CLI can exit independently.
|
|
197
|
-
const child = spawnImpl('kubectl', [
|
|
198
|
-
'--context', context,
|
|
199
|
-
'port-forward',
|
|
200
|
-
'-n', namespace,
|
|
201
|
-
target,
|
|
202
|
-
`${localPort}:${remotePort}`,
|
|
203
|
-
], {
|
|
204
|
-
stdio: ['ignore', 'ignore', 'ignore'],
|
|
205
|
-
detached: true,
|
|
206
|
-
});
|
|
207
|
-
if (typeof child.pid !== 'number' || child.pid <= 0) {
|
|
208
|
-
return { spawned: false, reason: 'lock-held' }; // spawn failed; surface as non-fatal
|
|
209
|
-
}
|
|
210
|
-
// Atomic PID file write (tmp → rename, mode 0600).
|
|
211
|
-
writePidFile(pidPath, child.pid);
|
|
212
|
-
// Unref so the parent CLI process can exit without waiting for the tunnel.
|
|
213
|
-
child.unref();
|
|
214
|
-
// Best-effort PID file cleanup when the port-forward exits.
|
|
215
|
-
child.once('exit', () => {
|
|
216
|
-
try {
|
|
217
|
-
fs.unlinkSync(pidPath);
|
|
218
|
-
}
|
|
219
|
-
catch { /* already gone */ }
|
|
220
|
-
});
|
|
221
|
-
return { spawned: true, pid: child.pid };
|
|
222
|
-
}
|
|
223
|
-
finally {
|
|
224
|
-
releaseLock();
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
/**
|
|
228
|
-
* Kill a running port-forward identified by the PID file and remove the file.
|
|
229
|
-
* No-op when no PID file exists. Returns true when a process was signalled.
|
|
230
|
-
*/
|
|
231
|
-
export function stopPortForward(deps = {}) {
|
|
232
|
-
const pidPath = pidFilePath(deps);
|
|
233
|
-
const pid = readPidFile(pidPath);
|
|
234
|
-
if (pid === null)
|
|
235
|
-
return false;
|
|
236
|
-
try {
|
|
237
|
-
process.kill(pid, 'SIGTERM');
|
|
238
|
-
}
|
|
239
|
-
catch {
|
|
240
|
-
// ESRCH: already dead; fine.
|
|
241
|
-
}
|
|
242
|
-
try {
|
|
243
|
-
fs.unlinkSync(pidPath);
|
|
244
|
-
}
|
|
245
|
-
catch { /* already gone */ }
|
|
246
|
-
return true;
|
|
247
|
-
}
|
|
248
|
-
/**
|
|
249
|
-
* Build the PID file path for a peripheral by name.
|
|
250
|
-
* Path: <stateDir>/port-forward-<name>.pid
|
|
251
|
-
*/
|
|
252
|
-
function peripheralPidPath(name, stateDir) {
|
|
253
|
-
return path.join(stateDir, `port-forward-${name}.pid`);
|
|
254
|
-
}
|
|
255
|
-
/**
|
|
256
|
-
* Build the lock file path for a peripheral by name.
|
|
257
|
-
* Path: <stateDir>/port-forward-<name>.lock
|
|
258
|
-
* Each peripheral gets its own independent lock file (D26: locking auth-service
|
|
259
|
-
* must NOT block mcp-auth-service).
|
|
260
|
-
*/
|
|
261
|
-
function peripheralLockPath(name, stateDir) {
|
|
262
|
-
return path.join(stateDir, `port-forward-${name}.lock`);
|
|
263
|
-
}
|
|
264
|
-
/**
|
|
265
|
-
* Spawn a kubectl port-forward for a single peripheral, guarded by an
|
|
266
|
-
* independent advisory lock per peripheral. Mirrors the Phase 1b host-cp
|
|
267
|
-
* pattern (D17/D23/D24) generalised to any Peripheral entry.
|
|
268
|
-
*
|
|
269
|
-
* Returns true when a new process was spawned; false when the tunnel was
|
|
270
|
-
* already live or the lock was held by a concurrent caller.
|
|
271
|
-
*
|
|
272
|
-
* @internal — called by spawnAllPeripheralPortForwards; exported for test injection.
|
|
273
|
-
*/
|
|
274
|
-
export async function spawnPeripheralPortForward(peripheral, context, namespace, deps = {}) {
|
|
275
|
-
const stateDir = deps.stateDir ?? OLAM_STATE_DIR;
|
|
276
|
-
const spawnImpl = deps.spawnImpl ?? spawn;
|
|
277
|
-
const tcpProbeImpl = deps.tcpProbeImpl ?? realTcpProbe;
|
|
278
|
-
// Ensure state dir exists.
|
|
279
|
-
if (!fs.existsSync(stateDir)) {
|
|
280
|
-
fs.mkdirSync(stateDir, { recursive: true });
|
|
281
|
-
}
|
|
282
|
-
const lockPath = peripheralLockPath(peripheral.name, stateDir);
|
|
283
|
-
const pidPath = peripheralPidPath(peripheral.name, stateDir);
|
|
284
|
-
let releaseLock = null;
|
|
285
|
-
try {
|
|
286
|
-
releaseLock = acquireAdvisoryLock(lockPath);
|
|
287
|
-
}
|
|
288
|
-
catch (err) {
|
|
289
|
-
const code = err.code;
|
|
290
|
-
if (code === 'EEXIST') {
|
|
291
|
-
return false; // lock held by concurrent caller
|
|
292
|
-
}
|
|
293
|
-
throw err;
|
|
294
|
-
}
|
|
295
|
-
try {
|
|
296
|
-
// TCP-probe any existing port-forward before deciding to spawn (D24).
|
|
297
|
-
const alive = await tcpProbeImpl('127.0.0.1', peripheral.port, TCP_PROBE_TIMEOUT_MS);
|
|
298
|
-
if (alive) {
|
|
299
|
-
return false; // tunnel already live
|
|
300
|
-
}
|
|
301
|
-
// Spawn kubectl port-forward detached (stdio ignored).
|
|
302
|
-
const child = spawnImpl('kubectl', [
|
|
303
|
-
'--context', context,
|
|
304
|
-
'port-forward',
|
|
305
|
-
'-n', namespace,
|
|
306
|
-
`service/${peripheral.k8sResourceName}`,
|
|
307
|
-
`${peripheral.port}:${peripheral.port}`,
|
|
308
|
-
], {
|
|
309
|
-
stdio: ['ignore', 'ignore', 'ignore'],
|
|
310
|
-
detached: true,
|
|
311
|
-
});
|
|
312
|
-
if (typeof child.pid !== 'number' || child.pid <= 0) {
|
|
313
|
-
return false; // spawn failed; non-fatal
|
|
314
|
-
}
|
|
315
|
-
// Atomic PID file write (tmp → rename, mode 0600).
|
|
316
|
-
writePidFile(pidPath, child.pid);
|
|
317
|
-
// Unref so the parent CLI process can exit without waiting for the tunnel.
|
|
318
|
-
child.unref();
|
|
319
|
-
// Best-effort PID file cleanup when the port-forward exits.
|
|
320
|
-
child.once('exit', () => {
|
|
321
|
-
try {
|
|
322
|
-
fs.unlinkSync(pidPath);
|
|
323
|
-
}
|
|
324
|
-
catch { /* already gone */ }
|
|
325
|
-
});
|
|
326
|
-
return true;
|
|
327
|
-
}
|
|
328
|
-
finally {
|
|
329
|
-
releaseLock();
|
|
330
|
-
}
|
|
331
|
-
}
|
|
332
|
-
/**
|
|
333
|
-
* Spawn kubectl port-forward processes for all 4 peripherals in parallel.
|
|
334
|
-
*
|
|
335
|
-
* Each peripheral uses its own independent flock + PID file
|
|
336
|
-
* (`~/.olam/state/port-forward-<name>.{lock,pid}`), so locking one
|
|
337
|
-
* peripheral does NOT block another.
|
|
338
|
-
*
|
|
339
|
-
* @param context - kubectl context name (--context flag); defaults to 'olam'
|
|
340
|
-
* @param namespace - target namespace; defaults to 'olam'
|
|
341
|
-
* @param deps - injectable dependencies for testing
|
|
342
|
-
*/
|
|
343
|
-
export async function spawnAllPeripheralPortForwards(context = 'olam', namespace = 'olam', deps = {}) {
|
|
344
|
-
await Promise.all(PERIPHERALS.map((p) => spawnPeripheralPortForward(p, context, namespace, deps)));
|
|
345
|
-
}
|
|
346
|
-
/**
|
|
347
|
-
* Send SIGTERM to all running peripheral port-forward processes and
|
|
348
|
-
* remove their PID and lock files.
|
|
349
|
-
*
|
|
350
|
-
* No-op for any peripheral whose PID file is absent (process already stopped).
|
|
351
|
-
*
|
|
352
|
-
* @param deps - injectable dependencies for testing (stateDir override)
|
|
353
|
-
*/
|
|
354
|
-
export function stopAllPeripheralPortForwards(deps = {}) {
|
|
355
|
-
const stateDir = deps.stateDir ?? OLAM_STATE_DIR;
|
|
356
|
-
for (const p of PERIPHERALS) {
|
|
357
|
-
const pidPath = peripheralPidPath(p.name, stateDir);
|
|
358
|
-
const lockPath = peripheralLockPath(p.name, stateDir);
|
|
359
|
-
const pid = readPidFile(pidPath);
|
|
360
|
-
if (pid !== null) {
|
|
361
|
-
try {
|
|
362
|
-
process.kill(pid, 'SIGTERM');
|
|
363
|
-
}
|
|
364
|
-
catch { /* ESRCH: already dead; fine */ }
|
|
365
|
-
}
|
|
366
|
-
try {
|
|
367
|
-
fs.unlinkSync(pidPath);
|
|
368
|
-
}
|
|
369
|
-
catch { /* already gone */ }
|
|
370
|
-
try {
|
|
371
|
-
fs.unlinkSync(lockPath);
|
|
372
|
-
}
|
|
373
|
-
catch { /* already gone */ }
|
|
374
|
-
}
|
|
375
|
-
}
|
|
376
|
-
/**
|
|
377
|
-
* TCP-probe each peripheral and return a snapshot of their liveness.
|
|
378
|
-
*
|
|
379
|
-
* Uses the same realTcpProbe utility as probePortForwardLiveness (D24).
|
|
380
|
-
* Probes run in parallel for speed.
|
|
381
|
-
*
|
|
382
|
-
* @param deps - injectable dependencies for testing
|
|
383
|
-
*/
|
|
384
|
-
export async function getPeripheralLivenessSnapshot(deps = {}) {
|
|
385
|
-
const tcpProbeImpl = deps.tcpProbeImpl ?? realTcpProbe;
|
|
386
|
-
return Promise.all(PERIPHERALS.map(async (p) => {
|
|
387
|
-
const alive = await tcpProbeImpl('127.0.0.1', p.port, TCP_PROBE_TIMEOUT_MS);
|
|
388
|
-
return { name: p.name, alive };
|
|
389
|
-
}));
|
|
390
|
-
}
|
|
391
|
-
// Re-export so tests can import from this module without needing os/path.
|
|
392
|
-
export { os, path };
|
|
393
|
-
//# sourceMappingURL=port-forward.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"port-forward.js","sourceRoot":"","sources":["../../src/lib/port-forward.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,GAAG,MAAM,UAAU,CAAC;AAChC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAmB,MAAM,0BAA0B,CAAC;AAExE,MAAM,CAAC,MAAM,iBAAiB,GAAG,KAAK,CAAC;AACvC,MAAM,CAAC,MAAM,sBAAsB,GAAG,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,mBAAmB,CAAC,CAAC;AACrF,MAAM,CAAC,MAAM,qBAAqB,GAAG,IAAI,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C,IAAI,EAAE,KAAK,EAAE,CAAC;IACjC,CAAC,CAAC,CACH,CAAC;AACJ,CAAC;AAED,0EAA0E;AAC1E,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC"}
|
package/dist/lib/shell-rc.d.ts
DELETED
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* shell-rc.ts — Idempotent shell-rc file append + timestamped backup.
|
|
3
|
-
*
|
|
4
|
-
* Phase C1 of olam-operator-onboarding-parity (plan
|
|
5
|
-
* ~/.claude/plans/olam-operator-onboarding-parity.md).
|
|
6
|
-
*
|
|
7
|
-
* Phase C's `olam setup` wizard offers to add
|
|
8
|
-
* eval "$(olam completion zsh)"
|
|
9
|
-
* to the operator's `~/.zshrc` / `~/.bashrc`. This module is the safety
|
|
10
|
-
* layer that:
|
|
11
|
-
*
|
|
12
|
-
* 1. Grep-checks a marker substring before writing — re-running the
|
|
13
|
-
* wizard is a no-op (no duplicate eval lines, no n-times appended).
|
|
14
|
-
* 2. Backs the file up to `<rcPath>.olam-bak.<ISO-timestamp>` before
|
|
15
|
-
* ANY mutation — recoverable if the operator decides they didn't
|
|
16
|
-
* want the line.
|
|
17
|
-
* 3. Writes atomically via tmp-file + rename — `kill -9` mid-write
|
|
18
|
-
* can't leave a half-written rc file.
|
|
19
|
-
*
|
|
20
|
-
* Decision 6 (plan): mirrors adb's `phase_mise_activation` pattern; the
|
|
21
|
-
* idempotency + backup pair is the operator-UX floor.
|
|
22
|
-
*
|
|
23
|
-
* Risk T4 mitigation (per plan + design doc): the grep-for-marker check
|
|
24
|
-
* uses `String.includes` not a per-line scan — a marker can match across
|
|
25
|
-
* whitespace if needed. The backup runs unconditionally before the
|
|
26
|
-
* append; corrupted rc states are recoverable via `mv <backup> <rcPath>`.
|
|
27
|
-
*/
|
|
28
|
-
export type AppendStatus = 'appended' | 'already-present' | 'no-rc-file';
|
|
29
|
-
export interface AppendResult {
|
|
30
|
-
readonly status: AppendStatus;
|
|
31
|
-
/** Path to the timestamped backup file. `null` when `status !== 'appended'`. */
|
|
32
|
-
readonly backupPath: string | null;
|
|
33
|
-
}
|
|
34
|
-
export interface AppendOptions {
|
|
35
|
-
/** Absolute path to the operator's shell rc (e.g. `/Users/me/.zshrc`). */
|
|
36
|
-
readonly rcPath: string;
|
|
37
|
-
/**
|
|
38
|
-
* Substring searched for in the rc to detect "already present."
|
|
39
|
-
* Convention: a short stable token (e.g. `olam completion`) — distinct
|
|
40
|
-
* enough to avoid collisions with unrelated mentions, short enough that
|
|
41
|
-
* the operator can edit the exact line shape without breaking
|
|
42
|
-
* idempotency.
|
|
43
|
-
*/
|
|
44
|
-
readonly marker: string;
|
|
45
|
-
/**
|
|
46
|
-
* The exact line to append. The function adds a trailing newline if
|
|
47
|
-
* not already present + ensures the previous line of the rc file ends
|
|
48
|
-
* with a newline (so the appended line isn't concatenated onto the
|
|
49
|
-
* previous line on rcs that don't end with `\n`).
|
|
50
|
-
*/
|
|
51
|
-
readonly contentLine: string;
|
|
52
|
-
/**
|
|
53
|
-
* Optional clock override for deterministic test timestamps. Defaults
|
|
54
|
-
* to `() => new Date()`.
|
|
55
|
-
*/
|
|
56
|
-
readonly clock?: () => Date;
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Append `contentLine` to `rcPath` exactly once.
|
|
60
|
-
*
|
|
61
|
-
* - rcPath doesn't exist → returns `{status: 'no-rc-file', backupPath: null}`
|
|
62
|
-
* - rcPath content already includes the marker substring
|
|
63
|
-
* → returns `{status: 'already-present', backupPath: null}`
|
|
64
|
-
* - otherwise: backup + append
|
|
65
|
-
* → returns `{status: 'appended', backupPath: <ts-path>}`
|
|
66
|
-
*
|
|
67
|
-
* The write is atomic: content is staged to `<rcPath>.olam-tmp.<pid>`
|
|
68
|
-
* and then `renameSync`'d to `rcPath`. POSIX rename is atomic within a
|
|
69
|
-
* filesystem; a `kill -9` mid-call leaves either the backup-only state
|
|
70
|
-
* (no rc change) or the renamed-final state (atomic apply), never a
|
|
71
|
-
* half-written rc.
|
|
72
|
-
*
|
|
73
|
-
* The backup path uses a filesystem-safe ISO timestamp with `:` + `.`
|
|
74
|
-
* replaced by `-` (avoids colons in filenames on Windows for cross-
|
|
75
|
-
* platform consumers; not strictly required on macOS / Linux but
|
|
76
|
-
* cosmetically nicer).
|
|
77
|
-
*/
|
|
78
|
-
export declare function appendIdempotent(opts: AppendOptions): AppendResult;
|
|
79
|
-
/**
|
|
80
|
-
* Resolve the operator's shell rc path based on `$SHELL`.
|
|
81
|
-
*
|
|
82
|
-
* /bin/zsh, /usr/bin/zsh, /opt/homebrew/bin/zsh → ~/.zshrc
|
|
83
|
-
* /bin/bash, /usr/bin/bash → ~/.bashrc
|
|
84
|
-
* anything else → null (caller must surface)
|
|
85
|
-
*
|
|
86
|
-
* The caller decides what to do on null — typically Phase C surfaces a
|
|
87
|
-
* remedy message naming the supported shells.
|
|
88
|
-
*/
|
|
89
|
-
export declare function resolveShellRc(home: string, shellEnv: string | undefined): string | null;
|
|
90
|
-
//# sourceMappingURL=shell-rc.d.ts.map
|