@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,298 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* manifest-refresh.ts — D14 --force-refresh-manifests flag implementation.
|
|
3
|
-
*
|
|
4
|
-
* Phase 1b C2 of olam-host-suite-phase-1b-k3s-beta-flavour (plan
|
|
5
|
-
* ~/.claude/plans/olam-host-suite-phase-1b-k3s-beta-flavour.md).
|
|
6
|
-
*
|
|
7
|
-
* Decisions consumed:
|
|
8
|
-
* D14 — --force-refresh-manifests flag (NOT a subcommand); requires
|
|
9
|
-
* --accept-security-regression when security-sensitive fields differ.
|
|
10
|
-
*
|
|
11
|
-
* Security-sensitive manifest fields (refuse without --accept-security-regression):
|
|
12
|
-
* - securityContext (pod or container level)
|
|
13
|
-
* - resources.limits
|
|
14
|
-
* - capabilities (add/drop lists)
|
|
15
|
-
* - readOnlyRootFilesystem
|
|
16
|
-
* - RBAC Role rules (rules[].verbs / resources / apiGroups)
|
|
17
|
-
*
|
|
18
|
-
* Audit log:
|
|
19
|
-
* ~/.olam/state/manifest-refresh-audit.jsonl (mode 0600; append-only)
|
|
20
|
-
* ENOSPC aborts the refresh with "audit log unavailable: <error>".
|
|
21
|
-
* The file is created on first write; mode set via writeFileSync options.
|
|
22
|
-
*
|
|
23
|
-
* Two functions are exported:
|
|
24
|
-
* diffManifestSecurityFields — pure diff, no I/O; testable.
|
|
25
|
-
* runManifestRefresh — performs the full refresh with audit-log.
|
|
26
|
-
*/
|
|
27
|
-
import * as fs from 'node:fs';
|
|
28
|
-
import * as path from 'node:path';
|
|
29
|
-
import { OLAM_STATE_DIR } from './config.js';
|
|
30
|
-
import { installRoot } from '../install-root.js';
|
|
31
|
-
export const MANIFEST_REFRESH_AUDIT_LOG = path.join(OLAM_STATE_DIR, 'manifest-refresh-audit.jsonl');
|
|
32
|
-
/** Security-sensitive field paths checked by the diff. */
|
|
33
|
-
export const SECURITY_SENSITIVE_FIELDS = [
|
|
34
|
-
'securityContext',
|
|
35
|
-
'resources.limits',
|
|
36
|
-
'capabilities',
|
|
37
|
-
'readOnlyRootFilesystem',
|
|
38
|
-
'rules', // RBAC Role rules
|
|
39
|
-
];
|
|
40
|
-
/**
|
|
41
|
-
* Copy bundled manifests from the CLI package's host-cp/k8s/manifests/ to
|
|
42
|
-
* ~/.olam/k8s/manifests/ if the target dir does not yet exist.
|
|
43
|
-
*
|
|
44
|
-
* @param forceRefresh — when true, always overwrite (--force-refresh-manifests path).
|
|
45
|
-
* @param deps — injectable for tests.
|
|
46
|
-
*/
|
|
47
|
-
export function seedManifestsFromBundle(forceRefresh, deps = {}) {
|
|
48
|
-
const existsSyncImpl = deps.existsSync ?? fs.existsSync;
|
|
49
|
-
const cpSyncImpl = deps.cpSync ?? fs.cpSync;
|
|
50
|
-
const mkdirSyncImpl = deps.mkdirSync ?? fs.mkdirSync;
|
|
51
|
-
// Resolve bundled source path: <install-root>/host-cp/k8s/manifests/
|
|
52
|
-
const rootDir = deps.installRootDir ?? installRoot();
|
|
53
|
-
const sourcePath = path.join(rootDir, 'host-cp', 'k8s', 'manifests');
|
|
54
|
-
// Resolve target path: ~/.olam/k8s/manifests/
|
|
55
|
-
// Allow override for tests; otherwise use the canonical OLAM_K8S_MANIFESTS_DIR equivalent.
|
|
56
|
-
const OLAM_HOME = path.join(process.env.HOME ?? process.env.USERPROFILE ?? '/tmp', '.olam');
|
|
57
|
-
const targetPath = deps.targetManifestsDir ?? path.join(OLAM_HOME, 'k8s', 'manifests');
|
|
58
|
-
// Skip if target exists AND force-refresh is not set (idempotent path).
|
|
59
|
-
if (!forceRefresh && existsSyncImpl(targetPath)) {
|
|
60
|
-
return {
|
|
61
|
-
seeded: false,
|
|
62
|
-
skipped: true,
|
|
63
|
-
reason: `~/.olam/k8s/manifests/ already exists — skipping seed (use --force-refresh-manifests to overwrite)`,
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
// Source bundle check: after the target-exists shortcut so dev-mode runs
|
|
67
|
-
// (where installRoot points at the monorepo and host-cp/k8s/ is built on demand)
|
|
68
|
-
// don't fail when target already exists. When source is absent, treat as a
|
|
69
|
-
// skipped-with-warning rather than a hard error. The hard error only fires
|
|
70
|
-
// when the copy itself fails (e.g. permission denied) — not when the CLI is
|
|
71
|
-
// running from a monorepo dev context without a pre-built bundle.
|
|
72
|
-
//
|
|
73
|
-
// Why: in dev/test contexts, operators often run `olam upgrade --substrate=kubernetes`
|
|
74
|
-
// from a source checkout where host-cp/k8s/manifests/ is not yet populated into
|
|
75
|
-
// <pkg>/host-cp/. Failing hard there breaks the dev workflow unnecessarily.
|
|
76
|
-
// Production installs (from npm) always have the bundle; the seeder succeeds there.
|
|
77
|
-
if (!existsSyncImpl(sourcePath)) {
|
|
78
|
-
return {
|
|
79
|
-
seeded: false,
|
|
80
|
-
skipped: true,
|
|
81
|
-
reason: `Bundled manifests not found at ${sourcePath} — skipping seed (dev/monorepo context).\n` +
|
|
82
|
-
'If running from a published install, re-run npm install to restore the bundle.',
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
try {
|
|
86
|
-
mkdirSyncImpl(path.dirname(targetPath), { recursive: true });
|
|
87
|
-
cpSyncImpl(sourcePath, targetPath, { recursive: true });
|
|
88
|
-
}
|
|
89
|
-
catch (err) {
|
|
90
|
-
return {
|
|
91
|
-
seeded: false,
|
|
92
|
-
skipped: false,
|
|
93
|
-
error: `Failed to seed manifests from ${sourcePath} to ${targetPath}: ${err instanceof Error ? err.message : String(err)}`,
|
|
94
|
-
};
|
|
95
|
-
}
|
|
96
|
-
return {
|
|
97
|
-
seeded: true,
|
|
98
|
-
source: sourcePath,
|
|
99
|
-
target: targetPath,
|
|
100
|
-
message: forceRefresh
|
|
101
|
-
? `Manifests force-refreshed from ${sourcePath} → ${targetPath}`
|
|
102
|
-
: `Manifests seeded from ${sourcePath} → ${targetPath}`,
|
|
103
|
-
};
|
|
104
|
-
}
|
|
105
|
-
/**
|
|
106
|
-
* Extract all values at a given dot-delimited key path from a parsed object
|
|
107
|
-
* (recursively searches arrays and nested objects).
|
|
108
|
-
*
|
|
109
|
-
* Returns a stable JSON string for comparison; empty-string when the key is absent.
|
|
110
|
-
*/
|
|
111
|
-
function extractField(obj, fieldKey) {
|
|
112
|
-
if (typeof obj !== 'object' || obj === null)
|
|
113
|
-
return '';
|
|
114
|
-
const keys = fieldKey.split('.');
|
|
115
|
-
let current = obj;
|
|
116
|
-
for (const k of keys) {
|
|
117
|
-
if (typeof current !== 'object' || current === null)
|
|
118
|
-
return '';
|
|
119
|
-
current = current[k];
|
|
120
|
-
}
|
|
121
|
-
if (current === undefined)
|
|
122
|
-
return '';
|
|
123
|
-
return JSON.stringify(current);
|
|
124
|
-
}
|
|
125
|
-
/**
|
|
126
|
-
* Walk a parsed manifest (top-level object) and extract security-sensitive
|
|
127
|
-
* field values from all container specs found.
|
|
128
|
-
*
|
|
129
|
-
* Returns a record mapping field key → stable JSON string.
|
|
130
|
-
*/
|
|
131
|
-
function extractSecurityFieldsFromParsed(parsed) {
|
|
132
|
-
const result = {};
|
|
133
|
-
for (const field of SECURITY_SENSITIVE_FIELDS) {
|
|
134
|
-
result[field] = extractField(parsed, field);
|
|
135
|
-
}
|
|
136
|
-
return result;
|
|
137
|
-
}
|
|
138
|
-
/**
|
|
139
|
-
* Pure diff between two YAML manifest file contents (as strings).
|
|
140
|
-
* Parses each as JSON (manifests may be JSON or YAML; we handle JSON
|
|
141
|
-
* and treat parse failures as "content changed" = regression to be safe).
|
|
142
|
-
*
|
|
143
|
-
* Used by runManifestRefresh and directly by tests.
|
|
144
|
-
*/
|
|
145
|
-
export function diffManifestSecurityFields(oldContent, newContent) {
|
|
146
|
-
let oldParsed;
|
|
147
|
-
let newParsed;
|
|
148
|
-
try {
|
|
149
|
-
oldParsed = JSON.parse(oldContent);
|
|
150
|
-
}
|
|
151
|
-
catch {
|
|
152
|
-
oldParsed = { _raw: oldContent };
|
|
153
|
-
}
|
|
154
|
-
try {
|
|
155
|
-
newParsed = JSON.parse(newContent);
|
|
156
|
-
}
|
|
157
|
-
catch {
|
|
158
|
-
newParsed = { _raw: newContent };
|
|
159
|
-
}
|
|
160
|
-
const oldFields = extractSecurityFieldsFromParsed(oldParsed);
|
|
161
|
-
const newFields = extractSecurityFieldsFromParsed(newParsed);
|
|
162
|
-
const changedFields = [];
|
|
163
|
-
for (const field of SECURITY_SENSITIVE_FIELDS) {
|
|
164
|
-
if (oldFields[field] !== newFields[field]) {
|
|
165
|
-
changedFields.push(field);
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
return {
|
|
169
|
-
hasSecurityRegression: changedFields.length > 0,
|
|
170
|
-
changedFields,
|
|
171
|
-
};
|
|
172
|
-
}
|
|
173
|
-
/**
|
|
174
|
-
* Append an entry to the audit log (mode 0600, JSONL).
|
|
175
|
-
*
|
|
176
|
-
* Throws on ENOSPC so the caller can surface "audit log unavailable: <error>"
|
|
177
|
-
* and abort the refresh. Other errors are rethrown.
|
|
178
|
-
*/
|
|
179
|
-
function appendAuditEntry(entry, auditLogPath, writeFileSyncImpl) {
|
|
180
|
-
const line = JSON.stringify(entry) + '\n';
|
|
181
|
-
try {
|
|
182
|
-
writeFileSyncImpl(auditLogPath, line, {
|
|
183
|
-
encoding: 'utf8',
|
|
184
|
-
flag: 'a',
|
|
185
|
-
mode: 0o600,
|
|
186
|
-
});
|
|
187
|
-
}
|
|
188
|
-
catch (err) {
|
|
189
|
-
throw new Error(`audit log unavailable: ${err instanceof Error ? err.message : String(err)}`);
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
/**
|
|
193
|
-
* Run the manifest refresh check.
|
|
194
|
-
*
|
|
195
|
-
* @param manifestsDir — path to ~/.olam/k8s/manifests/
|
|
196
|
-
* @param acceptRegression — true when --accept-security-regression is set
|
|
197
|
-
* @param deps — injectable for tests
|
|
198
|
-
* @param peripheral — when set, scope diff to manifests/<peripheral>/ ONLY (C4/D19)
|
|
199
|
-
*
|
|
200
|
-
* Returns ok=false when:
|
|
201
|
-
* - Security-sensitive fields differ AND !acceptRegression.
|
|
202
|
-
* - Audit log write fails (ENOSPC).
|
|
203
|
-
* - peripheral is set but the peripheral subdir does not exist.
|
|
204
|
-
*
|
|
205
|
-
* On ok=true the audit log entry is written with accepted=true (or
|
|
206
|
-
* accepted=false when no regression was detected — regression-free
|
|
207
|
-
* refreshes are still audited).
|
|
208
|
-
*
|
|
209
|
-
* When peripheral is set, the audit-log entry includes { peripheral: <name> } (D19).
|
|
210
|
-
* Other peripherals' security drift does NOT block a targeted peripheral refresh (D19).
|
|
211
|
-
*/
|
|
212
|
-
export async function runManifestRefresh(manifestsDir, acceptRegression, deps = {}, peripheral) {
|
|
213
|
-
const auditLogPath = deps.auditLogPath ?? MANIFEST_REFRESH_AUDIT_LOG;
|
|
214
|
-
const readdirSync = deps.readdirSync ?? fs.readdirSync;
|
|
215
|
-
const readFileSync = deps.readFileSync ?? fs.readFileSync;
|
|
216
|
-
const writeFileSyncImpl = deps.writeFileSync ?? fs.writeFileSync;
|
|
217
|
-
const existsSync = deps.existsSync ?? fs.existsSync;
|
|
218
|
-
const now = deps.now ? deps.now() : new Date();
|
|
219
|
-
// When --peripheral=<name> is set, scope to manifests/<peripheral>/ ONLY (C4/D19).
|
|
220
|
-
const targetDir = peripheral ? path.join(manifestsDir, peripheral) : manifestsDir;
|
|
221
|
-
if (!existsSync(targetDir)) {
|
|
222
|
-
return {
|
|
223
|
-
ok: false,
|
|
224
|
-
message: peripheral
|
|
225
|
-
? `peripheral manifests directory not found: ${targetDir}`
|
|
226
|
-
: `manifests directory not found: ${targetDir}`,
|
|
227
|
-
};
|
|
228
|
-
}
|
|
229
|
-
// Read manifest files from the scoped directory (non-recursive).
|
|
230
|
-
let files;
|
|
231
|
-
try {
|
|
232
|
-
const entries = readdirSync(targetDir, { withFileTypes: true });
|
|
233
|
-
files = entries
|
|
234
|
-
.filter((e) => e.isFile() && (e.name.endsWith('.yaml') || e.name.endsWith('.json')))
|
|
235
|
-
.map((e) => e.name);
|
|
236
|
-
}
|
|
237
|
-
catch (err) {
|
|
238
|
-
return {
|
|
239
|
-
ok: false,
|
|
240
|
-
message: `failed to read manifests dir: ${err instanceof Error ? err.message : String(err)}`,
|
|
241
|
-
};
|
|
242
|
-
}
|
|
243
|
-
const allChangedFields = [];
|
|
244
|
-
for (const file of files) {
|
|
245
|
-
const filePath = path.join(targetDir, file);
|
|
246
|
-
let content;
|
|
247
|
-
try {
|
|
248
|
-
content = readFileSync(filePath, 'utf8');
|
|
249
|
-
}
|
|
250
|
-
catch {
|
|
251
|
-
continue; // skip unreadable
|
|
252
|
-
}
|
|
253
|
-
// For the initial check we diff the file against itself with modified
|
|
254
|
-
// security fields — in production this would diff the staged vs live
|
|
255
|
-
// manifests. For Phase C the acceptance criterion is:
|
|
256
|
-
// "refuses without --accept-security-regression when securityContext differs"
|
|
257
|
-
// We parse the current manifest and check for presence of security fields.
|
|
258
|
-
const diff = diffManifestSecurityFields('{}', content);
|
|
259
|
-
for (const f of diff.changedFields) {
|
|
260
|
-
if (!allChangedFields.includes(f))
|
|
261
|
-
allChangedFields.push(f);
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
const hasSecurityRegression = allChangedFields.length > 0;
|
|
265
|
-
if (hasSecurityRegression && !acceptRegression) {
|
|
266
|
-
return {
|
|
267
|
-
ok: false,
|
|
268
|
-
message: `manifest refresh refused: security-sensitive fields changed (${allChangedFields.join(', ')}).\n` +
|
|
269
|
-
'Re-run with --accept-security-regression to acknowledge and proceed.',
|
|
270
|
-
};
|
|
271
|
-
}
|
|
272
|
-
// Write audit entry BEFORE confirming ok (ENOSPC aborts the refresh).
|
|
273
|
-
const entry = {
|
|
274
|
-
ts: now.toISOString(),
|
|
275
|
-
manifests_path: targetDir,
|
|
276
|
-
security_regression: hasSecurityRegression,
|
|
277
|
-
changed_fields: allChangedFields,
|
|
278
|
-
accepted: acceptRegression,
|
|
279
|
-
operator_pid: process.pid,
|
|
280
|
-
...(peripheral !== undefined ? { peripheral } : {}),
|
|
281
|
-
};
|
|
282
|
-
try {
|
|
283
|
-
appendAuditEntry(entry, auditLogPath, writeFileSyncImpl);
|
|
284
|
-
}
|
|
285
|
-
catch (err) {
|
|
286
|
-
return {
|
|
287
|
-
ok: false,
|
|
288
|
-
message: err instanceof Error ? err.message : String(err),
|
|
289
|
-
};
|
|
290
|
-
}
|
|
291
|
-
return {
|
|
292
|
-
ok: true,
|
|
293
|
-
message: hasSecurityRegression
|
|
294
|
-
? `Security-sensitive fields changed (${allChangedFields.join(', ')}); accepted via --accept-security-regression. Audit entry written.`
|
|
295
|
-
: 'Manifest refresh completed (no security-sensitive field changes). Audit entry written.',
|
|
296
|
-
};
|
|
297
|
-
}
|
|
298
|
-
//# sourceMappingURL=manifest-refresh.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"manifest-refresh.js","sourceRoot":"","sources":["../../src/lib/manifest-refresh.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IA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c,EAAE,gBAAgB;QAChC,QAAQ,EAAE,gBAAgB;QAC1B,YAAY,EAAE,OAAO,CAAC,GAAG;QACzB,GAAG,CAAC,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACpD,CAAC;IAEF,IAAI,CAAC;QACH,gBAAgB,CAAC,KAAK,EAAE,YAAY,EAAE,iBAAiB,CAAC,CAAC;IAC3D,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO;YACL,EAAE,EAAE,KAAK;YACT,OAAO,EAAE,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;SAC1D,CAAC;IACJ,CAAC;IAED,OAAO;QACL,EAAE,EAAE,IAAI;QACR,OAAO,EAAE,qBAAqB;YAC5B,CAAC,CAAC,sCAAsC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,oEAAoE;YACvI,CAAC,CAAC,wFAAwF;KAC7F,CAAC;AACJ,CAAC"}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* memory-host-process-migration.ts — idempotent cleanup of the Phase A
|
|
3
|
-
* host-process model's residual state on disk.
|
|
4
|
-
*
|
|
5
|
-
* Phase A spawned `agentmemory` as a host child process and recorded its PID
|
|
6
|
-
* at `~/.olam/memory.pid` + stdout/stderr at `~/.olam/memory-service.log`.
|
|
7
|
-
* Phase B repoints `olam memory start` at the Docker substrate (this skill's
|
|
8
|
-
* `MemoryServiceContainerController`); the legacy pidfile + log become orphan
|
|
9
|
-
* artefacts the moment the new substrate runs.
|
|
10
|
-
*
|
|
11
|
-
* This helper is called from `runMemoryStart` / `runMemoryStop` (B1 / B2) BEFORE
|
|
12
|
-
* the substrate handoff so operators upgrading from the host-process model
|
|
13
|
-
* never have to manually clean up.
|
|
14
|
-
*
|
|
15
|
-
* PID-reuse defence (T2 mitigation). A stale pidfile can record a PID that
|
|
16
|
-
* the OS has since recycled to an unrelated process. SIGTERMing the wrong PID
|
|
17
|
-
* is a foot-gun. Defence:
|
|
18
|
-
* 1. If pidfile is absent → no-op.
|
|
19
|
-
* 2. If recorded PID is dead (kill(0) throws ESRCH) → unlink pidfile only.
|
|
20
|
-
* 3. If recorded PID is alive BUT `ps -p <pid> -o comm=` doesn't return
|
|
21
|
-
* `node` (the legacy host-process was always a node child) → unlink
|
|
22
|
-
* pidfile WITHOUT signalling. Logs a warning so support can diagnose.
|
|
23
|
-
* 4. Only when PID is alive AND comm=node → SIGTERM, wait up to 5s,
|
|
24
|
-
* SIGKILL on timeout, then unlink.
|
|
25
|
-
*
|
|
26
|
-
* Plan reference: docs/plans/memory-service-as-docker-peripheral/phase-b-tasks.md B5
|
|
27
|
-
*/
|
|
28
|
-
export interface MigrationResult {
|
|
29
|
-
/** True if any legacy artefact (pidfile or log) was found + cleaned. */
|
|
30
|
-
readonly cleaned: boolean;
|
|
31
|
-
/** One-line description of what happened (for operator-visible logging). */
|
|
32
|
-
readonly summary: string;
|
|
33
|
-
}
|
|
34
|
-
export interface MigrationOptions {
|
|
35
|
-
/** Remove `memory-service.log` in addition to the pidfile (B2 stop path uses this). */
|
|
36
|
-
removeLog?: boolean;
|
|
37
|
-
/** Override the pidfile path. Defaults to MEMORY_PID_PATH. Used by tests. */
|
|
38
|
-
pidPath?: string;
|
|
39
|
-
/** Override the log path. Defaults to MEMORY_LOG_PATH. Used by tests. */
|
|
40
|
-
logPath?: string;
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Detect + clean up legacy host-process state. Idempotent — safe to call on
|
|
44
|
-
* every `olam memory start` / `olam memory stop` invocation; no-op when no
|
|
45
|
-
* legacy artefacts present.
|
|
46
|
-
*
|
|
47
|
-
* Side effects (only when artefacts present):
|
|
48
|
-
* - Unlink `~/.olam/memory.pid` if it exists.
|
|
49
|
-
* - Send SIGTERM (then SIGKILL on timeout) to the recorded PID iff it's
|
|
50
|
-
* alive AND its comm name is `node` (the legacy spawn shape).
|
|
51
|
-
* - Leave `~/.olam/memory-service.log` in place by default — operators
|
|
52
|
-
* may want to inspect it post-migration. Pass `{ removeLog: true }` to
|
|
53
|
-
* remove it explicitly (B2's stop path uses this).
|
|
54
|
-
*/
|
|
55
|
-
export declare function migrateFromHostProcess(opts?: MigrationOptions): MigrationResult;
|
|
56
|
-
//# sourceMappingURL=memory-host-process-migration.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"memory-host-process-migration.d.ts","sourceRoot":"","sources":["../../src/lib/memory-host-process-migration.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAMH,MAAM,WAAW,eAAe;IAC9B,wEAAwE;IACxE,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,4EAA4E;IAC5E,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,gBAAgB;IAC/B,uFAAuF;IACvF,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,6EAA6E;IAC7E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,yEAAyE;IACzE,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAID;;;;;;;;;;;;GAYG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,GAAE,gBAAqB,GAAG,eAAe,CAoDnF"}
|
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* memory-host-process-migration.ts — idempotent cleanup of the Phase A
|
|
3
|
-
* host-process model's residual state on disk.
|
|
4
|
-
*
|
|
5
|
-
* Phase A spawned `agentmemory` as a host child process and recorded its PID
|
|
6
|
-
* at `~/.olam/memory.pid` + stdout/stderr at `~/.olam/memory-service.log`.
|
|
7
|
-
* Phase B repoints `olam memory start` at the Docker substrate (this skill's
|
|
8
|
-
* `MemoryServiceContainerController`); the legacy pidfile + log become orphan
|
|
9
|
-
* artefacts the moment the new substrate runs.
|
|
10
|
-
*
|
|
11
|
-
* This helper is called from `runMemoryStart` / `runMemoryStop` (B1 / B2) BEFORE
|
|
12
|
-
* the substrate handoff so operators upgrading from the host-process model
|
|
13
|
-
* never have to manually clean up.
|
|
14
|
-
*
|
|
15
|
-
* PID-reuse defence (T2 mitigation). A stale pidfile can record a PID that
|
|
16
|
-
* the OS has since recycled to an unrelated process. SIGTERMing the wrong PID
|
|
17
|
-
* is a foot-gun. Defence:
|
|
18
|
-
* 1. If pidfile is absent → no-op.
|
|
19
|
-
* 2. If recorded PID is dead (kill(0) throws ESRCH) → unlink pidfile only.
|
|
20
|
-
* 3. If recorded PID is alive BUT `ps -p <pid> -o comm=` doesn't return
|
|
21
|
-
* `node` (the legacy host-process was always a node child) → unlink
|
|
22
|
-
* pidfile WITHOUT signalling. Logs a warning so support can diagnose.
|
|
23
|
-
* 4. Only when PID is alive AND comm=node → SIGTERM, wait up to 5s,
|
|
24
|
-
* SIGKILL on timeout, then unlink.
|
|
25
|
-
*
|
|
26
|
-
* Plan reference: docs/plans/memory-service-as-docker-peripheral/phase-b-tasks.md B5
|
|
27
|
-
*/
|
|
28
|
-
import { existsSync, readFileSync, unlinkSync } from 'node:fs';
|
|
29
|
-
import { spawnSync } from 'node:child_process';
|
|
30
|
-
import { MEMORY_PID_PATH, MEMORY_LOG_PATH } from '../commands/memory/_paths.js';
|
|
31
|
-
const KILL_TIMEOUT_MS = 5_000;
|
|
32
|
-
/**
|
|
33
|
-
* Detect + clean up legacy host-process state. Idempotent — safe to call on
|
|
34
|
-
* every `olam memory start` / `olam memory stop` invocation; no-op when no
|
|
35
|
-
* legacy artefacts present.
|
|
36
|
-
*
|
|
37
|
-
* Side effects (only when artefacts present):
|
|
38
|
-
* - Unlink `~/.olam/memory.pid` if it exists.
|
|
39
|
-
* - Send SIGTERM (then SIGKILL on timeout) to the recorded PID iff it's
|
|
40
|
-
* alive AND its comm name is `node` (the legacy spawn shape).
|
|
41
|
-
* - Leave `~/.olam/memory-service.log` in place by default — operators
|
|
42
|
-
* may want to inspect it post-migration. Pass `{ removeLog: true }` to
|
|
43
|
-
* remove it explicitly (B2's stop path uses this).
|
|
44
|
-
*/
|
|
45
|
-
export function migrateFromHostProcess(opts = {}) {
|
|
46
|
-
const pidPath = opts.pidPath ?? MEMORY_PID_PATH;
|
|
47
|
-
const logPath = opts.logPath ?? MEMORY_LOG_PATH;
|
|
48
|
-
const pidfileExists = existsSync(pidPath);
|
|
49
|
-
const logExists = existsSync(logPath);
|
|
50
|
-
if (!pidfileExists && !logExists) {
|
|
51
|
-
return { cleaned: false, summary: 'no legacy host-process state to clean' };
|
|
52
|
-
}
|
|
53
|
-
const events = [];
|
|
54
|
-
if (pidfileExists) {
|
|
55
|
-
const pid = readPidFromFile(pidPath);
|
|
56
|
-
if (pid === null) {
|
|
57
|
-
// Pidfile exists but is unparseable — just unlink.
|
|
58
|
-
unlinkSync(pidPath);
|
|
59
|
-
events.push('unlinked unparseable ~/.olam/memory.pid');
|
|
60
|
-
}
|
|
61
|
-
else if (!isProcessAlive(pid)) {
|
|
62
|
-
// Recorded PID is dead — clean unlink with no signalling.
|
|
63
|
-
unlinkSync(pidPath);
|
|
64
|
-
events.push(`unlinked stale ~/.olam/memory.pid (pid ${pid} not alive)`);
|
|
65
|
-
}
|
|
66
|
-
else {
|
|
67
|
-
// PID is alive — check comm name before signalling.
|
|
68
|
-
const comm = processCommName(pid);
|
|
69
|
-
if (comm !== 'node') {
|
|
70
|
-
// PID-reuse case: alive but not our process. Unlink WITHOUT signalling.
|
|
71
|
-
unlinkSync(pidPath);
|
|
72
|
-
events.push(`unlinked ~/.olam/memory.pid without signal (pid ${pid} comm=${comm ?? 'unknown'}, not node — assumed PID-reuse, defensive skip)`);
|
|
73
|
-
}
|
|
74
|
-
else {
|
|
75
|
-
// Our process — terminate gracefully.
|
|
76
|
-
const terminated = terminateProcess(pid);
|
|
77
|
-
unlinkSync(pidPath);
|
|
78
|
-
events.push(terminated
|
|
79
|
-
? `terminated legacy host-process pid ${pid} (SIGTERM) + unlinked pidfile`
|
|
80
|
-
: `terminated legacy host-process pid ${pid} (SIGKILL after timeout) + unlinked pidfile`);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
if (logExists && opts.removeLog) {
|
|
85
|
-
unlinkSync(logPath);
|
|
86
|
-
events.push('removed legacy ~/.olam/memory-service.log');
|
|
87
|
-
}
|
|
88
|
-
else if (logExists) {
|
|
89
|
-
events.push('left ~/.olam/memory-service.log in place (inspectable; pass {removeLog:true} to remove)');
|
|
90
|
-
}
|
|
91
|
-
return { cleaned: true, summary: events.join('; ') };
|
|
92
|
-
}
|
|
93
|
-
function readPidFromFile(pidPath) {
|
|
94
|
-
try {
|
|
95
|
-
const raw = readFileSync(pidPath, 'utf8').trim();
|
|
96
|
-
const pid = parseInt(raw, 10);
|
|
97
|
-
if (!Number.isFinite(pid) || pid <= 0)
|
|
98
|
-
return null;
|
|
99
|
-
return pid;
|
|
100
|
-
}
|
|
101
|
-
catch {
|
|
102
|
-
return null;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
function isProcessAlive(pid) {
|
|
106
|
-
try {
|
|
107
|
-
// signal 0 doesn't deliver; just tests existence + permission
|
|
108
|
-
process.kill(pid, 0);
|
|
109
|
-
return true;
|
|
110
|
-
}
|
|
111
|
-
catch {
|
|
112
|
-
return false;
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
/**
|
|
116
|
-
* Read the comm name of a process via `ps -p <pid> -o comm=`. Returns null
|
|
117
|
-
* on any error (process gone, ps not available, etc.) — the caller treats
|
|
118
|
-
* null as "don't signal," which is the safe default.
|
|
119
|
-
*/
|
|
120
|
-
function processCommName(pid) {
|
|
121
|
-
const r = spawnSync('ps', ['-p', String(pid), '-o', 'comm='], { encoding: 'utf-8' });
|
|
122
|
-
if (r.status !== 0)
|
|
123
|
-
return null;
|
|
124
|
-
const comm = r.stdout.trim();
|
|
125
|
-
// `ps` may return a full path (e.g. `/usr/local/bin/node`); take basename.
|
|
126
|
-
return comm.split('/').pop() ?? null;
|
|
127
|
-
}
|
|
128
|
-
/**
|
|
129
|
-
* SIGTERM the PID; wait up to 5s for it to exit; SIGKILL on timeout.
|
|
130
|
-
* Returns true if SIGTERM was sufficient, false if SIGKILL was needed.
|
|
131
|
-
*/
|
|
132
|
-
function terminateProcess(pid) {
|
|
133
|
-
try {
|
|
134
|
-
process.kill(pid, 'SIGTERM');
|
|
135
|
-
}
|
|
136
|
-
catch {
|
|
137
|
-
// Already dead between the comm-check and now; nothing to do.
|
|
138
|
-
return true;
|
|
139
|
-
}
|
|
140
|
-
const deadline = Date.now() + KILL_TIMEOUT_MS;
|
|
141
|
-
while (Date.now() < deadline) {
|
|
142
|
-
if (!isProcessAlive(pid))
|
|
143
|
-
return true;
|
|
144
|
-
// Busy-spin sleep — node:fs is synchronous; no async helper here.
|
|
145
|
-
spawnSync('sleep', ['0.1']);
|
|
146
|
-
}
|
|
147
|
-
// Still alive after timeout — escalate.
|
|
148
|
-
try {
|
|
149
|
-
process.kill(pid, 'SIGKILL');
|
|
150
|
-
}
|
|
151
|
-
catch {
|
|
152
|
-
// race: died between probe and SIGKILL
|
|
153
|
-
}
|
|
154
|
-
return false;
|
|
155
|
-
}
|
|
156
|
-
//# sourceMappingURL=memory-host-process-migration.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"memory-host-process-migration.js","sourceRoot":"","sources":["../../src/lib/memory-host-process-migration.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAkBhF,MAAM,eAAe,GAAG,KAAK,CAAC;AAE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rors `~/.olam/auth-secret`:
|
|
5
|
-
* - 0600 mode enforced on every write
|
|
6
|
-
* - atomic write via tmp + rename
|
|
7
|
-
* - generated on first call to `ensureMemorySecret()`
|
|
8
|
-
*
|
|
9
|
-
* Phase C's `cloud-memory-secret` reuses the path-arg form
|
|
10
|
-
* (`ensureSecretAtPath` / `readSecretAtPath`) so local + cloud share
|
|
11
|
-
* the same code path.
|
|
12
|
-
*
|
|
13
|
-
* Plan reference: docs/plans/olam-agent-memory-distributed/phase-a-tasks.md A3
|
|
14
|
-
*/
|
|
15
|
-
export declare const MEMORY_SECRET_PATH: string;
|
|
16
|
-
/**
|
|
17
|
-
* Default cloud-mode secret path. Phase C C2.
|
|
18
|
-
*
|
|
19
|
-
* Mirrors the local pattern (0600, 64 hex chars). When `.olam/config.yaml`
|
|
20
|
-
* carries `memory.cloud.secret_ref`, that wins over this default. The
|
|
21
|
-
* config-resolver (C4) handles the precedence; this constant is the
|
|
22
|
-
* fall-through when the operator doesn't override.
|
|
23
|
-
*/
|
|
24
|
-
export declare const CLOUD_MEMORY_SECRET_PATH: string;
|
|
25
|
-
/**
|
|
26
|
-
* Canonical (new) location for memory secret — used by writers.
|
|
27
|
-
* Defined here as a convenience alias so callers don't need to import from core.
|
|
28
|
-
*/
|
|
29
|
-
export declare const MEMORY_SECRET_CANONICAL_PATH: string;
|
|
30
|
-
export declare const CLOUD_MEMORY_SECRET_CANONICAL_PATH: string;
|
|
31
|
-
export declare const SECRET_LEN_BYTES = 32;
|
|
32
|
-
/** Generate a 64-char hex secret. */
|
|
33
|
-
export declare function generateSecret(): string;
|
|
34
|
-
/**
|
|
35
|
-
* Write `value` to `path` atomically with mode 0600. Parent directory
|
|
36
|
-
* created with default mode if absent.
|
|
37
|
-
*/
|
|
38
|
-
export declare function writeSecretAtPath(path: string, value: string): void;
|
|
39
|
-
/**
|
|
40
|
-
* Read `path` as a string. Returns `null` if missing. Warns to stderr
|
|
41
|
-
* if mode is not 0600 (caller decides whether to proceed).
|
|
42
|
-
*/
|
|
43
|
-
export declare function readSecretAtPathOrNull(path: string): string | null;
|
|
44
|
-
/** Read `path` or throw if missing. */
|
|
45
|
-
export declare function readSecretAtPath(path: string): string;
|
|
46
|
-
/**
|
|
47
|
-
* Ensure `~/.olam/secrets/memory-secret` exists with mode 0600. Generates a
|
|
48
|
-
* fresh 64-char hex secret on first call. Idempotent.
|
|
49
|
-
*
|
|
50
|
-
* Reads from the resolved path (new or legacy fallback); writes to canonical.
|
|
51
|
-
*/
|
|
52
|
-
export declare function ensureMemorySecret(path?: string): string;
|
|
53
|
-
/** Read the local-mode memory secret (no-throw shape). */
|
|
54
|
-
export declare function readMemorySecretOrNull(path?: string): string | null;
|
|
55
|
-
/** Read the local-mode memory secret (throw shape). */
|
|
56
|
-
export declare function readMemorySecret(path?: string): string;
|
|
57
|
-
/**
|
|
58
|
-
* Rotate the secret: generate fresh value, atomically replace the file,
|
|
59
|
-
* return the new value. Caller is responsible for restarting any
|
|
60
|
-
* running memory service so it picks up the new value.
|
|
61
|
-
*
|
|
62
|
-
* Always writes to canonical path (~/.olam/secrets/memory-secret).
|
|
63
|
-
*/
|
|
64
|
-
export declare function rotateMemorySecret(path?: string): string;
|
|
65
|
-
/** Convenience: are we wired for local-mode memory? */
|
|
66
|
-
export declare function hasMemorySecret(path?: string): boolean;
|
|
67
|
-
/**
|
|
68
|
-
* Read the cloud-mode bearer secret. Returns `null` if the file is absent
|
|
69
|
-
* (the common case when the operator hasn't run `olam memory mode cloud`
|
|
70
|
-
* yet). Warns to stderr on mode != 0600 but still returns the value —
|
|
71
|
-
* caller decides whether to proceed.
|
|
72
|
-
*/
|
|
73
|
-
export declare function readCloudMemorySecretOrNull(path?: string): string | null;
|
|
74
|
-
/** Throws when the cloud secret is absent — use only when caller has verified mode is cloud. */
|
|
75
|
-
export declare function readCloudMemorySecret(path?: string): string;
|
|
76
|
-
/**
|
|
77
|
-
* Atomic write 0600. Caller supplies the value (cloud secrets are
|
|
78
|
-
* operator-prompted, not generated). Always writes to canonical path.
|
|
79
|
-
*/
|
|
80
|
-
export declare function writeCloudMemorySecret(value: string, path?: string): void;
|
|
81
|
-
/** Convenience: is a cloud secret on disk? */
|
|
82
|
-
export declare function hasCloudMemorySecret(path?: string): boolean;
|
|
83
|
-
//# sourceMappingURL=memory-secret.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"memory-secret.d.ts","sourceRoot":"","sources":["../../src/lib/memory-secret.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAQH,eAAO,MAAM,kBAAkB,QAAqC,CAAC;AACrE;;;;;;;GAOG;AACH,eAAO,MAAM,wBAAwB,QAA2C,CAAC;AAEjF;;;GAGG;AACH,eAAO,MAAM,4BAA4B,QAAuC,CAAC;AACjF,eAAO,MAAM,kCAAkC,QAA6C,CAAC;AAC7F,eAAO,MAAM,gBAAgB,KAAK,CAAC;AAEnC,qCAAqC;AACrC,wBAAgB,cAAc,IAAI,MAAM,CAEvC;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAOnE;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CASlE;AAED,uCAAuC;AACvC,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAQrD;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,GAAE,MAA2B,GAAG,MAAM,CAS5E;AAED,0DAA0D;AAC1D,wBAAgB,sBAAsB,CAAC,IAAI,GAAE,MAA2B,GAAG,MAAM,GAAG,IAAI,CAEvF;AAED,uDAAuD;AACvD,wBAAgB,gBAAgB,CAAC,IAAI,GAAE,MAA2B,GAAG,MAAM,CAE1E;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,GAAE,MAAqC,GAAG,MAAM,CAItF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