@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
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"""Loads the hyphenated `model-router.py` hook as an importable module.
|
|
2
|
+
|
|
3
|
+
The hook ships as `packages/cli/hooks/model-router.py` (hyphenated to match
|
|
4
|
+
the operator-local `~/.claude/hooks/` filename convention). A hyphen is not a
|
|
5
|
+
legal module-name char, so a plain `import` cannot reach it. Load it by path.
|
|
6
|
+
|
|
7
|
+
Stdlib-only so the tests run under either `pytest` (CI / the kg-service
|
|
8
|
+
Docker image) or a bare `python3 -m unittest` on any host — no third-party
|
|
9
|
+
dependency, fully offline.
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
from __future__ import annotations
|
|
13
|
+
|
|
14
|
+
import importlib.util
|
|
15
|
+
from pathlib import Path
|
|
16
|
+
from types import ModuleType
|
|
17
|
+
|
|
18
|
+
_HOOK_PATH = Path(__file__).resolve().parent.parent / "model-router.py"
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def load_model_router() -> ModuleType:
|
|
22
|
+
spec = importlib.util.spec_from_file_location("model_router_hook", _HOOK_PATH)
|
|
23
|
+
assert spec is not None and spec.loader is not None
|
|
24
|
+
module = importlib.util.module_from_spec(spec)
|
|
25
|
+
spec.loader.exec_module(module)
|
|
26
|
+
return module
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"""Representative prompt corpus for the model-router classifier.
|
|
2
|
+
|
|
3
|
+
Reflects real `UserPromptSubmit` shapes across the tier spectrum:
|
|
4
|
+
short one-liners, long multi-sentence asks, code-heavy transforms,
|
|
5
|
+
multi-domain (auth/payment/migration/security) prose, and the bulk /
|
|
6
|
+
bounded / negation edge cases the v2 scorer explicitly handles.
|
|
7
|
+
|
|
8
|
+
Used by BOTH the correctness pin (`test_classify_pins.py`) and the
|
|
9
|
+
benchmark (`test_classify_bench.py`) so the numbers and the
|
|
10
|
+
behaviour-lock cover the same inputs.
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
from __future__ import annotations
|
|
14
|
+
|
|
15
|
+
# Each entry exercises a distinct branch of the classifier. The corpus is
|
|
16
|
+
# deliberately spread across cheap / main / hard so the benchmark's mean is
|
|
17
|
+
# representative of mixed real traffic, not skewed to one fast/slow path.
|
|
18
|
+
PROMPTS: list[str] = [
|
|
19
|
+
# ── short ──────────────────────────────────────────────────────────
|
|
20
|
+
"rename foo to bar",
|
|
21
|
+
"format this file",
|
|
22
|
+
"add a flag to the dispatch path",
|
|
23
|
+
"investigate the flaky test",
|
|
24
|
+
"what's the signature of withCredential",
|
|
25
|
+
# ── cheap mechanical / bulk ─────────────────────────────────────────
|
|
26
|
+
"Across the whole codebase, replace every console.log with the logger "
|
|
27
|
+
"and strip all trailing whitespace — purely mechanical, no logic changes.",
|
|
28
|
+
"Add jsdoc to every exported function in packages/core/src and add "
|
|
29
|
+
"explicit return types where missing. One-line change per file.",
|
|
30
|
+
"prettier --write the entire repo and run eslint --fix afterwards",
|
|
31
|
+
"convert every require() to an ESM import across all the test files",
|
|
32
|
+
"bump every internal package.json dependency to the latest minor",
|
|
33
|
+
# ── main bounded feature work ──────────────────────────────────────
|
|
34
|
+
"Add an endpoint to host-cp that returns the current world phase, and "
|
|
35
|
+
"wire a debounce on the SPA hook that consumes it. Just this one file.",
|
|
36
|
+
"Fix the bug in tier-selection where the fallback reason is undefined; "
|
|
37
|
+
"add a regression test that pins the fallback branch.",
|
|
38
|
+
"Add a feature flag check to the dispatch enrichment path in a single "
|
|
39
|
+
"file and gate the new badge behind it.",
|
|
40
|
+
# ── hard architecture / cross-service ──────────────────────────────
|
|
41
|
+
"Design a backwards-compatible migration to shard the credential vault "
|
|
42
|
+
"across every auth service with zero-downtime cutover; we're paged on "
|
|
43
|
+
"p99 latency spikes and pool exhaustion under 50K RPS.",
|
|
44
|
+
"Investigate the cross-service race condition causing the audit-log "
|
|
45
|
+
"desync; propose a unified idempotency layer and a deprecation rollout "
|
|
46
|
+
"across all 12 microservices. This is operationally serious.",
|
|
47
|
+
"Refactor the cross-cutting retry logic across every service into a "
|
|
48
|
+
"unified middleware; audit all the call sites and plan the migration.",
|
|
49
|
+
# ── negation / bounded-scope traps ─────────────────────────────────
|
|
50
|
+
"I know this looks like an architecture change but it's really just a "
|
|
51
|
+
"rename — don't redesign anything, preserve behaviour exactly.",
|
|
52
|
+
"Investigate this specific test in `packages/core/src/dispatch/"
|
|
53
|
+
"verifiability.test.ts` — single file, no design decisions needed.",
|
|
54
|
+
# ── multi-domain prose ─────────────────────────────────────────────
|
|
55
|
+
"The payment refund flow leaks a credential into the audit log on a "
|
|
56
|
+
"stripe webhook retry — this is a security + billing issue, trace it.",
|
|
57
|
+
# ── long mixed ─────────────────────────────────────────────────────
|
|
58
|
+
"We need to standardise the error contract across the gateway and "
|
|
59
|
+
"migrate every public endpoint to it. There's a data-residency "
|
|
60
|
+
"constraint for EU tenants and a SOC2 audit-log requirement. Propose a "
|
|
61
|
+
"rollout that's backwards-compatible and won't desync the SDK bindings "
|
|
62
|
+
"going forward. Bundle is 1.8MB gzipped so watch the cdn/origin split.",
|
|
63
|
+
]
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"""Hot-path benchmark for the model-router classifier.
|
|
2
|
+
|
|
3
|
+
`classify()` runs on EVERY operator `UserPromptSubmit` (the
|
|
4
|
+
`[model-router] tier=… scores=(cheap=N,main=N,hard=N)` line). It is the
|
|
5
|
+
hottest per-prompt code path in the harness, so even microseconds compound
|
|
6
|
+
across sessions.
|
|
7
|
+
|
|
8
|
+
Perf-as-test style (mirrors `packages/kg-service/tests/` — stdlib only, no
|
|
9
|
+
pytest-benchmark dependency). Prints a hard number (classifications/sec,
|
|
10
|
+
µs/call mean, p95) and asserts a loose ceiling so a future regression that
|
|
11
|
+
makes the hot path materially slower fails CI rather than silently shipping.
|
|
12
|
+
|
|
13
|
+
The ceiling is deliberately generous (1500 µs/call mean over the mixed
|
|
14
|
+
corpus on a cold box) — it guards against ORDER-OF-MAGNITUDE regressions
|
|
15
|
+
(e.g. accidentally recompiling regexes inside the per-rule loop), not
|
|
16
|
+
micro-jitter.
|
|
17
|
+
|
|
18
|
+
Runs under pytest (CI) OR `python3 -m unittest` (offline). Either way the
|
|
19
|
+
numbers print to stdout.
|
|
20
|
+
"""
|
|
21
|
+
|
|
22
|
+
from __future__ import annotations
|
|
23
|
+
|
|
24
|
+
import statistics
|
|
25
|
+
import sys
|
|
26
|
+
import time
|
|
27
|
+
import unittest
|
|
28
|
+
from pathlib import Path
|
|
29
|
+
|
|
30
|
+
sys.path.insert(0, str(Path(__file__).resolve().parent))
|
|
31
|
+
|
|
32
|
+
from _loader import load_model_router # noqa: E402
|
|
33
|
+
from prompts import PROMPTS # noqa: E402
|
|
34
|
+
|
|
35
|
+
# Mean-per-call ceiling. Generous: catches a 5-10x regression, ignores jitter.
|
|
36
|
+
MAX_MEAN_US_PER_CALL = 1500.0
|
|
37
|
+
|
|
38
|
+
_WARMUP_ROUNDS = 50
|
|
39
|
+
_MEASURE_ROUNDS = 400
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def measure(classify) -> dict[str, float]:
|
|
43
|
+
# Warm the re-cache + interpreter so first-call compile cost doesn't skew
|
|
44
|
+
# the mean (we measure steady-state per-prompt cost).
|
|
45
|
+
for _ in range(_WARMUP_ROUNDS):
|
|
46
|
+
for p in PROMPTS:
|
|
47
|
+
classify(p)
|
|
48
|
+
|
|
49
|
+
per_call_us: list[float] = []
|
|
50
|
+
t_start = time.perf_counter()
|
|
51
|
+
for _ in range(_MEASURE_ROUNDS):
|
|
52
|
+
for p in PROMPTS:
|
|
53
|
+
t0 = time.perf_counter()
|
|
54
|
+
classify(p)
|
|
55
|
+
per_call_us.append((time.perf_counter() - t0) * 1e6)
|
|
56
|
+
wall = time.perf_counter() - t_start
|
|
57
|
+
|
|
58
|
+
n = len(per_call_us)
|
|
59
|
+
per_call_us.sort()
|
|
60
|
+
return {
|
|
61
|
+
"calls": float(n),
|
|
62
|
+
"classifications_per_sec": n / wall,
|
|
63
|
+
"us_per_call_mean": statistics.mean(per_call_us),
|
|
64
|
+
"us_per_call_median": statistics.median(per_call_us),
|
|
65
|
+
"us_per_call_p95": per_call_us[int(n * 0.95)],
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
class TestClassifyBench(unittest.TestCase):
|
|
70
|
+
@classmethod
|
|
71
|
+
def setUpClass(cls) -> None:
|
|
72
|
+
cls.mr = load_model_router()
|
|
73
|
+
|
|
74
|
+
def test_classify_throughput(self) -> None:
|
|
75
|
+
stats = measure(self.mr.classify)
|
|
76
|
+
print(
|
|
77
|
+
"\n[model-router classify bench]"
|
|
78
|
+
f"\n corpus prompts : {len(PROMPTS)}"
|
|
79
|
+
f"\n total calls : {int(stats['calls'])}"
|
|
80
|
+
f"\n throughput : {stats['classifications_per_sec']:,.0f} classifications/sec"
|
|
81
|
+
f"\n µs/call mean : {stats['us_per_call_mean']:.2f}"
|
|
82
|
+
f"\n µs/call median : {stats['us_per_call_median']:.2f}"
|
|
83
|
+
f"\n µs/call p95 : {stats['us_per_call_p95']:.2f}"
|
|
84
|
+
)
|
|
85
|
+
self.assertLess(
|
|
86
|
+
stats["us_per_call_mean"],
|
|
87
|
+
MAX_MEAN_US_PER_CALL,
|
|
88
|
+
f"classify mean {stats['us_per_call_mean']:.1f}µs/call exceeded "
|
|
89
|
+
f"ceiling {MAX_MEAN_US_PER_CALL}µs — hot-path regression?",
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
if __name__ == "__main__":
|
|
94
|
+
unittest.main()
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"""Behaviour-lock for the model-router classifier.
|
|
2
|
+
|
|
3
|
+
Pins `classify()`'s (tier, scores) output for every prompt in the
|
|
4
|
+
representative corpus. ANY change to the scoring rules, modifiers, or
|
|
5
|
+
decision logic that moves a tier or a score fails here — so a future
|
|
6
|
+
"optimization" that silently alters behaviour is caught.
|
|
7
|
+
|
|
8
|
+
This is the contract the perf work in this PR preserves: the hot-path
|
|
9
|
+
regex-precompile change MUST leave every one of these golden values
|
|
10
|
+
byte-identical.
|
|
11
|
+
|
|
12
|
+
Runs under pytest (CI) OR `python3 -m unittest` (offline, no deps).
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
|
|
17
|
+
import sys
|
|
18
|
+
import unittest
|
|
19
|
+
from pathlib import Path
|
|
20
|
+
|
|
21
|
+
sys.path.insert(0, str(Path(__file__).resolve().parent))
|
|
22
|
+
|
|
23
|
+
from _loader import load_model_router # noqa: E402
|
|
24
|
+
from prompts import PROMPTS # noqa: E402
|
|
25
|
+
|
|
26
|
+
# Golden snapshot captured from the classifier BEFORE the precompile change.
|
|
27
|
+
# (tier, {"cheap": int, "main": int, "hard": int}) — one per PROMPTS entry,
|
|
28
|
+
# same order. Regenerate ONLY with an intentional, reviewed behaviour change.
|
|
29
|
+
GOLDEN: list[tuple[str, dict[str, int]]] = [
|
|
30
|
+
("cheap", {"cheap": 5, "main": 0, "hard": 0}),
|
|
31
|
+
("cheap", {"cheap": 4, "main": 0, "hard": 0}),
|
|
32
|
+
("main", {"cheap": 0, "main": 5, "hard": 0}),
|
|
33
|
+
("hard", {"cheap": 0, "main": 0, "hard": 4}),
|
|
34
|
+
("main", {"cheap": 0, "main": 0, "hard": 0}),
|
|
35
|
+
("cheap", {"cheap": 22, "main": 0, "hard": 5}),
|
|
36
|
+
("cheap", {"cheap": 29, "main": 0, "hard": 0}),
|
|
37
|
+
("cheap", {"cheap": 18, "main": 0, "hard": 0}),
|
|
38
|
+
("cheap", {"cheap": 8, "main": 0, "hard": 0}),
|
|
39
|
+
("cheap", {"cheap": 8, "main": 0, "hard": 0}),
|
|
40
|
+
("main", {"cheap": 0, "main": 5, "hard": 0}),
|
|
41
|
+
("main", {"cheap": 0, "main": 0, "hard": 0}),
|
|
42
|
+
("main", {"cheap": 0, "main": 5, "hard": 0}),
|
|
43
|
+
("hard", {"cheap": 0, "main": 0, "hard": 43}),
|
|
44
|
+
("hard", {"cheap": 0, "main": 0, "hard": 39}),
|
|
45
|
+
("hard", {"cheap": 0, "main": 0, "hard": 31}),
|
|
46
|
+
("cheap", {"cheap": 13, "main": 0, "hard": 0}),
|
|
47
|
+
("main", {"cheap": 0, "main": 4, "hard": 0}),
|
|
48
|
+
("hard", {"cheap": 0, "main": 0, "hard": 6}),
|
|
49
|
+
("hard", {"cheap": 8, "main": 0, "hard": 37}),
|
|
50
|
+
]
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
class TestClassifyPins(unittest.TestCase):
|
|
54
|
+
@classmethod
|
|
55
|
+
def setUpClass(cls) -> None:
|
|
56
|
+
cls.mr = load_model_router()
|
|
57
|
+
|
|
58
|
+
def test_corpus_and_golden_aligned(self) -> None:
|
|
59
|
+
self.assertEqual(
|
|
60
|
+
len(GOLDEN), len(PROMPTS), "one GOLDEN entry per PROMPTS entry"
|
|
61
|
+
)
|
|
62
|
+
|
|
63
|
+
def test_classify_output_is_pinned(self) -> None:
|
|
64
|
+
for prompt, (want_tier, want_scores) in zip(PROMPTS, GOLDEN):
|
|
65
|
+
tier, scores, _triggered = self.mr.classify(prompt)
|
|
66
|
+
self.assertEqual(tier, want_tier, f"tier drift: {prompt[:60]!r}")
|
|
67
|
+
self.assertEqual(scores, want_scores, f"score drift: {prompt[:60]!r}")
|
|
68
|
+
|
|
69
|
+
def test_classify_is_deterministic(self) -> None:
|
|
70
|
+
for prompt in PROMPTS:
|
|
71
|
+
first = self.mr.classify(prompt)
|
|
72
|
+
second = self.mr.classify(prompt)
|
|
73
|
+
self.assertEqual(first[0], second[0])
|
|
74
|
+
self.assertEqual(first[1], second[1])
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
if __name__ == "__main__":
|
|
78
|
+
unittest.main()
|
package/hooks/model-router.py
CHANGED
|
@@ -179,6 +179,15 @@ RULES = [
|
|
|
179
179
|
("hard", 4, r"\bevery\s+pii\b"),
|
|
180
180
|
]
|
|
181
181
|
|
|
182
|
+
# Pre-compiled view of RULES, built ONCE at import time. `classify()` runs on
|
|
183
|
+
# every operator prompt (the hottest per-prompt path in the harness), so the
|
|
184
|
+
# ~150 per-rule regex evaluations must not re-resolve the (pattern, flags)
|
|
185
|
+
# pair through `re`'s internal cache on every call. Compiling up front and
|
|
186
|
+
# iterating the pattern objects directly is behaviour-identical to
|
|
187
|
+
# `re.finditer(pat, text, re.IGNORECASE)` but skips the per-call cache lookup.
|
|
188
|
+
# RULES stays the readable source of truth; this is its compiled mirror.
|
|
189
|
+
COMPILED_RULES = [(tier, weight, re.compile(pat, re.IGNORECASE)) for tier, weight, pat in RULES]
|
|
190
|
+
|
|
182
191
|
# Bulk indicators — if present alongside a cheap-verb match, boost CHEAP.
|
|
183
192
|
BULK_INDICATORS = re.compile(
|
|
184
193
|
r"\b(?:every|all|each|whole|entire|across\s+(?:our\s+)?(?:the\s+)?"
|
|
@@ -231,8 +240,8 @@ NEGATION = re.compile(
|
|
|
231
240
|
|
|
232
241
|
def collect_matches(prompt):
|
|
233
242
|
matches = [] # (tier, weight, regex, span_text, start_idx)
|
|
234
|
-
for tier, weight, regex in
|
|
235
|
-
for m in
|
|
243
|
+
for tier, weight, regex in COMPILED_RULES:
|
|
244
|
+
for m in regex.finditer(prompt):
|
|
236
245
|
matches.append((tier, weight, regex, m.group(0), m.start()))
|
|
237
246
|
return matches
|
|
238
247
|
|
|
@@ -384,6 +393,10 @@ DOMAIN_FLAGS = {
|
|
|
384
393
|
"security": r"\b(?:security|vulnerability|cve|xss|sqli|injection|exploit|secret\s+leak)\b",
|
|
385
394
|
}
|
|
386
395
|
|
|
396
|
+
# Pre-compiled once at import time — same per-prompt-path rationale as
|
|
397
|
+
# COMPILED_RULES (these fire on every prompt in `main()`).
|
|
398
|
+
COMPILED_DOMAIN_FLAGS = {name: re.compile(pat, re.IGNORECASE) for name, pat in DOMAIN_FLAGS.items()}
|
|
399
|
+
|
|
387
400
|
|
|
388
401
|
def emit_log(record):
|
|
389
402
|
try:
|
|
@@ -406,8 +419,8 @@ def main():
|
|
|
406
419
|
|
|
407
420
|
tier, scores, triggered = classify(prompt)
|
|
408
421
|
flags = [
|
|
409
|
-
name for name, pat in
|
|
410
|
-
if
|
|
422
|
+
name for name, pat in COMPILED_DOMAIN_FLAGS.items()
|
|
423
|
+
if pat.search(prompt)
|
|
411
424
|
]
|
|
412
425
|
word_count = len(prompt.split())
|
|
413
426
|
|
|
@@ -118,7 +118,7 @@ spec:
|
|
|
118
118
|
# k3d), started by `olam upgrade` Step 0.7 — not inside this Pod.
|
|
119
119
|
containers:
|
|
120
120
|
- name: olam-host-cp
|
|
121
|
-
image: ghcr.io/pleri/olam-host-cp@sha256:
|
|
121
|
+
image: ghcr.io/pleri/olam-host-cp@sha256:501037587e33d0a1c13df88d72ad9b855508e4c0163cb65673211cd3ddd9227b
|
|
122
122
|
imagePullPolicy: IfNotPresent
|
|
123
123
|
securityContext:
|
|
124
124
|
runAsNonRoot: true
|
|
@@ -70,7 +70,7 @@ spec:
|
|
|
70
70
|
mountPath: /data
|
|
71
71
|
containers:
|
|
72
72
|
- name: olam-auth-service
|
|
73
|
-
image: ghcr.io/pleri/olam-auth@sha256:
|
|
73
|
+
image: ghcr.io/pleri/olam-auth@sha256:06c9cd39405e650141a78927f1701bf7b06a86cd98eeaef9b22eb53d46f6f523
|
|
74
74
|
imagePullPolicy: IfNotPresent
|
|
75
75
|
securityContext:
|
|
76
76
|
runAsNonRoot: true
|
|
@@ -61,7 +61,7 @@ spec:
|
|
|
61
61
|
mountPath: /data
|
|
62
62
|
containers:
|
|
63
63
|
- name: olam-kg-service
|
|
64
|
-
image: ghcr.io/pleri/olam-kg-service@sha256:
|
|
64
|
+
image: ghcr.io/pleri/olam-kg-service@sha256:a739f0fdf60aef0d26b51314698a07bba423c3d43571616cffd7b1195abb205d
|
|
65
65
|
imagePullPolicy: IfNotPresent
|
|
66
66
|
securityContext:
|
|
67
67
|
runAsNonRoot: true
|
|
@@ -68,7 +68,7 @@ spec:
|
|
|
68
68
|
mountPath: /data
|
|
69
69
|
containers:
|
|
70
70
|
- name: olam-mcp-auth-service
|
|
71
|
-
image: ghcr.io/pleri/olam-mcp-auth@sha256:
|
|
71
|
+
image: ghcr.io/pleri/olam-mcp-auth@sha256:cdeb8813619f0198dbbcc80b2c98dbeb3a842e8d1ec38796d459ad254c5e1d98
|
|
72
72
|
imagePullPolicy: IfNotPresent
|
|
73
73
|
securityContext:
|
|
74
74
|
runAsNonRoot: true
|
|
@@ -70,7 +70,7 @@ spec:
|
|
|
70
70
|
# bootstrap-placeholder comment + run `npm run refresh:manifest-digests`
|
|
71
71
|
# once ghcr.io/pleri/olam-memory-service has a real published digest.
|
|
72
72
|
# bootstrap-placeholder: pre-publish; refresh after first release
|
|
73
|
-
image: ghcr.io/pleri/olam-memory-service@sha256:
|
|
73
|
+
image: ghcr.io/pleri/olam-memory-service@sha256:b10649ba9b56bb11b99e5142559d4b8a37a2b8ae2ad8ce38fb8b535449d26f85
|
|
74
74
|
imagePullPolicy: IfNotPresent
|
|
75
75
|
securityContext:
|
|
76
76
|
runAsNonRoot: true
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* op-side-longpoll.mjs — Operator-side long-poll loop.
|
|
3
|
+
*
|
|
4
|
+
* Maintains a persistent outbound HTTPS connection from host-cp to
|
|
5
|
+
* plan-DO's /v1/op-poll endpoint, waiting for local-Docker dispatch
|
|
6
|
+
* work to appear. Feature-flag-gated behind OLAM_OPSIDE_LONGPOLL=1
|
|
7
|
+
* (default OFF — no behavior change when unset).
|
|
8
|
+
*
|
|
9
|
+
* ELI5: like installing a phone line to the cloud planner.
|
|
10
|
+
* Your local machine stays connected, ready to receive coding tasks.
|
|
11
|
+
* Nothing calls yet — the phone just sits there waiting (v1).
|
|
12
|
+
*
|
|
13
|
+
* Phase D ships the plumbing and tests it behind a flag. Future cells
|
|
14
|
+
* (#3/#6/#7) wire actual producers on the plan-DO side.
|
|
15
|
+
*
|
|
16
|
+
* Circuit-breaker: 10 consecutive errors → 60 s pause →
|
|
17
|
+
* counter resets and polling resumes. Prevents hammering the server
|
|
18
|
+
* during outages.
|
|
19
|
+
*
|
|
20
|
+
* Reconnect delay: 1000ms base + uniform 0-500ms jitter.
|
|
21
|
+
* All structured log events emitted to console via JSON objects.
|
|
22
|
+
*
|
|
23
|
+
* @module op-side-longpoll
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
// Reconnect delay constants.
|
|
27
|
+
const RECONNECT_BASE_MS = 1000;
|
|
28
|
+
const RECONNECT_JITTER_MS = 500;
|
|
29
|
+
|
|
30
|
+
// Circuit-breaker constants.
|
|
31
|
+
const CIRCUIT_BREAKER_THRESHOLD = 10;
|
|
32
|
+
const CIRCUIT_BREAKER_PAUSE_MS = 60_000;
|
|
33
|
+
|
|
34
|
+
// Long-poll timeout — plan-DO blocks up to 25 s; we give a 5 s margin.
|
|
35
|
+
const POLL_TIMEOUT_MS = 30_000;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Compute reconnect delay: 1000 + uniform 0-500 ms jitter.
|
|
39
|
+
* Exported so tests can mock Math.random and assert the formula.
|
|
40
|
+
*
|
|
41
|
+
* @param {() => number} [randFn] - Optional RNG override for testing.
|
|
42
|
+
* @returns {number} Delay in milliseconds.
|
|
43
|
+
*/
|
|
44
|
+
export function reconnectDelay(randFn = Math.random) {
|
|
45
|
+
return RECONNECT_BASE_MS + Math.floor(randFn() * RECONNECT_JITTER_MS);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/** @type {ReturnType<typeof setTimeout> | null} */
|
|
49
|
+
let pollTimer = null;
|
|
50
|
+
|
|
51
|
+
/** @type {boolean} */
|
|
52
|
+
let running = false;
|
|
53
|
+
|
|
54
|
+
/** @type {number} */
|
|
55
|
+
let consecutiveErrors = 0;
|
|
56
|
+
|
|
57
|
+
/** @type {string | null} */
|
|
58
|
+
let activeCloudUrl = null;
|
|
59
|
+
|
|
60
|
+
/** @type {string | null} */
|
|
61
|
+
let activeAuth = null;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Emit a structured log event. Uses console.log to be consistent with
|
|
65
|
+
* host-cp's existing logging style. All events include `event` + `ts`.
|
|
66
|
+
*
|
|
67
|
+
* @param {string} event
|
|
68
|
+
* @param {Record<string, unknown>} [extra]
|
|
69
|
+
*/
|
|
70
|
+
function emit(event, extra = {}) {
|
|
71
|
+
console.log(JSON.stringify({ event, ts: new Date().toISOString(), ...extra }));
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Sleep for ms milliseconds. Returns a Promise that resolves after the
|
|
76
|
+
* delay. Cancellable via the token: if token.cancelled becomes true
|
|
77
|
+
* before the timeout fires, the promise still resolves (callers check
|
|
78
|
+
* running themselves).
|
|
79
|
+
*
|
|
80
|
+
* @param {number} ms
|
|
81
|
+
* @returns {Promise<void>}
|
|
82
|
+
*/
|
|
83
|
+
function sleep(ms) {
|
|
84
|
+
return new Promise((resolve) => {
|
|
85
|
+
pollTimer = setTimeout(resolve, ms);
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Single poll iteration: open a GET /v1/op-poll request, wait for
|
|
91
|
+
* a response, parse the JSON body.
|
|
92
|
+
*
|
|
93
|
+
* @param {string} cloudUrl Base URL (e.g. https://plan-do.example.com)
|
|
94
|
+
* @param {string} auth Authorization header value
|
|
95
|
+
* @returns {Promise<{ work: null | { worldId: string, dispatchSpec: unknown } }>}
|
|
96
|
+
*/
|
|
97
|
+
async function pollOnce(cloudUrl, auth) {
|
|
98
|
+
const controller = new AbortController();
|
|
99
|
+
const timeoutId = setTimeout(() => controller.abort(), POLL_TIMEOUT_MS);
|
|
100
|
+
|
|
101
|
+
try {
|
|
102
|
+
const url = `${cloudUrl.replace(/\/$/, '')}/v1/op-poll`;
|
|
103
|
+
const res = await fetch(url, {
|
|
104
|
+
method: 'GET',
|
|
105
|
+
headers: { Authorization: auth },
|
|
106
|
+
signal: controller.signal,
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
if (!res.ok) {
|
|
110
|
+
throw new Error(`op-poll returned ${res.status}`);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
const body = await res.json();
|
|
114
|
+
return body;
|
|
115
|
+
} finally {
|
|
116
|
+
clearTimeout(timeoutId);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* The main poll loop. Runs until stopPoll() is called.
|
|
122
|
+
*
|
|
123
|
+
* State transitions:
|
|
124
|
+
* idle
|
|
125
|
+
* → connecting (emit op-poll-connect)
|
|
126
|
+
* → got { work: null } timeout response (emit op-poll-timeout)
|
|
127
|
+
* → wait reconnect delay
|
|
128
|
+
* → connecting again
|
|
129
|
+
*
|
|
130
|
+
* On error:
|
|
131
|
+
* → consecutiveErrors++
|
|
132
|
+
* → emit op-poll-error
|
|
133
|
+
* → if consecutiveErrors >= threshold: circuit-breaker open
|
|
134
|
+
* emit op-poll-circuit-open, wait 60 s, reset counter
|
|
135
|
+
* → else: wait reconnect delay
|
|
136
|
+
*
|
|
137
|
+
* @returns {Promise<void>}
|
|
138
|
+
*/
|
|
139
|
+
async function pollLoop() {
|
|
140
|
+
while (running) {
|
|
141
|
+
emit('op-poll-connect', { cloud_url: activeCloudUrl });
|
|
142
|
+
|
|
143
|
+
try {
|
|
144
|
+
const result = await pollOnce(activeCloudUrl, activeAuth);
|
|
145
|
+
|
|
146
|
+
// On a successful { work: null } response, reset the error counter.
|
|
147
|
+
consecutiveErrors = 0;
|
|
148
|
+
|
|
149
|
+
const delay = reconnectDelay();
|
|
150
|
+
emit('op-poll-timeout', { work: result.work, reconnect_in_ms: delay });
|
|
151
|
+
|
|
152
|
+
if (!running) break;
|
|
153
|
+
await sleep(delay);
|
|
154
|
+
} catch (err) {
|
|
155
|
+
consecutiveErrors++;
|
|
156
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
157
|
+
|
|
158
|
+
emit('op-poll-error', {
|
|
159
|
+
error: message,
|
|
160
|
+
consecutive_errors: consecutiveErrors,
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
if (consecutiveErrors >= CIRCUIT_BREAKER_THRESHOLD) {
|
|
164
|
+
emit('op-poll-circuit-open', {
|
|
165
|
+
consecutive_errors: consecutiveErrors,
|
|
166
|
+
pause_ms: CIRCUIT_BREAKER_PAUSE_MS,
|
|
167
|
+
});
|
|
168
|
+
consecutiveErrors = 0;
|
|
169
|
+
if (!running) break;
|
|
170
|
+
await sleep(CIRCUIT_BREAKER_PAUSE_MS);
|
|
171
|
+
} else {
|
|
172
|
+
if (!running) break;
|
|
173
|
+
const delay = reconnectDelay();
|
|
174
|
+
await sleep(delay);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* Start the operator-side long-poll loop.
|
|
182
|
+
*
|
|
183
|
+
* No-op if already running. Reads the flag from the environment:
|
|
184
|
+
* only runs when OLAM_OPSIDE_LONGPOLL === '1'. Call this AFTER
|
|
185
|
+
* server.listen() to avoid blocking the process startup path.
|
|
186
|
+
*
|
|
187
|
+
* @param {string} cloudUrl Base URL of the plan-DO deployment.
|
|
188
|
+
* @param {string} auth Authorization header value for Basic auth.
|
|
189
|
+
*/
|
|
190
|
+
export function startPoll(cloudUrl, auth) {
|
|
191
|
+
if (running) return;
|
|
192
|
+
running = true;
|
|
193
|
+
consecutiveErrors = 0;
|
|
194
|
+
activeCloudUrl = cloudUrl;
|
|
195
|
+
activeAuth = auth;
|
|
196
|
+
// Fire-and-forget; errors are caught inside pollLoop.
|
|
197
|
+
void pollLoop();
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* Stop the operator-side long-poll loop.
|
|
202
|
+
*
|
|
203
|
+
* Cancels any in-progress sleep timer; the loop condition will
|
|
204
|
+
* exit on its next iteration. Idempotent.
|
|
205
|
+
*/
|
|
206
|
+
export function stopPoll() {
|
|
207
|
+
running = false;
|
|
208
|
+
if (pollTimer !== null) {
|
|
209
|
+
clearTimeout(pollTimer);
|
|
210
|
+
pollTimer = null;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
// plan-chat-proxy-headers.mjs — header handling for host-cp's /api/plan-chat/*
|
|
2
|
+
// passthrough proxy (server.mjs). Extracted as pure helpers so the F3 (T9)
|
|
3
|
+
// operator-chunk broker-secret contract is unit-testable without booting the
|
|
4
|
+
// whole host-cp server.
|
|
5
|
+
//
|
|
6
|
+
// F3 (T9) boundary: host-cp's /api/plan-chat/* proxy is the TRUSTED operator
|
|
7
|
+
// surface (SPA browser → host-cp → plan-chat-service). A WORLD process never
|
|
8
|
+
// routes through this proxy — it talks to plan-chat-service directly via
|
|
9
|
+
// host.docker.internal. So:
|
|
10
|
+
// - Client-supplied `x-olam-broker-secret` is ALWAYS stripped (a client must
|
|
11
|
+
// not be able to smuggle the operator-chunk authority secret through).
|
|
12
|
+
// - The real secret is injected by the proxy itself (injectBrokerSecret),
|
|
13
|
+
// only when configured, so the operator's own SPA interject is authorised
|
|
14
|
+
// while a world process — which can't present the secret — is rejected by
|
|
15
|
+
// plan-chat-service's gate.
|
|
16
|
+
|
|
17
|
+
const HOP_BY_HOP = new Set(['host', 'connection', 'content-length']);
|
|
18
|
+
const BROKER_SECRET_HEADER = 'x-olam-broker-secret';
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Build the upstream header map for a /api/plan-chat/* proxy request.
|
|
22
|
+
* Drops hop-by-hop headers AND any client-supplied broker secret (F3).
|
|
23
|
+
*
|
|
24
|
+
* @param {Record<string, string | string[] | undefined>} reqHeaders
|
|
25
|
+
* @returns {Record<string, string>}
|
|
26
|
+
*/
|
|
27
|
+
export function buildPlanChatProxyHeaders(reqHeaders) {
|
|
28
|
+
const headers = {};
|
|
29
|
+
for (const [k, v] of Object.entries(reqHeaders ?? {})) {
|
|
30
|
+
if (HOP_BY_HOP.has(k)) continue;
|
|
31
|
+
// F3 — never forward a CLIENT-supplied broker secret.
|
|
32
|
+
if (k === BROKER_SECRET_HEADER) continue;
|
|
33
|
+
if (Array.isArray(v)) headers[k] = v.join(', ');
|
|
34
|
+
else if (typeof v === 'string') headers[k] = v;
|
|
35
|
+
}
|
|
36
|
+
return headers;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Inject the operator-chunk broker secret into the upstream headers when it is
|
|
41
|
+
* configured. No-op when the secret is unset/empty (the gate then runs in its
|
|
42
|
+
* default ungated-but-loud mode). Mutates + returns `headers`.
|
|
43
|
+
*
|
|
44
|
+
* @param {Record<string, string>} headers
|
|
45
|
+
* @param {string | undefined} operatorChunkSecret
|
|
46
|
+
* @returns {Record<string, string>}
|
|
47
|
+
*/
|
|
48
|
+
export function injectBrokerSecret(headers, operatorChunkSecret) {
|
|
49
|
+
if (typeof operatorChunkSecret === 'string' && operatorChunkSecret.length > 0) {
|
|
50
|
+
headers[BROKER_SECRET_HEADER] = operatorChunkSecret;
|
|
51
|
+
}
|
|
52
|
+
return headers;
|
|
53
|
+
}
|