@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,363 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* agentmemory-classify-queue.mjs
|
|
4
|
+
*
|
|
5
|
+
* PostToolUse hook for Claude Code — captures every PostToolUse event
|
|
6
|
+
* as a queue candidate at `~/.olam/agentmemory-queue/<ts>-<rand>.jsonl`
|
|
7
|
+
* for later batch-classification by Phase B2's background classifier.
|
|
8
|
+
*
|
|
9
|
+
* Hot-path SLO: p99 dump latency < 100ms (Phase A plan P1 row).
|
|
10
|
+
* Fail-open: any error exits 0 with no stdout — never blocks the tool loop.
|
|
11
|
+
*
|
|
12
|
+
* Pipeline:
|
|
13
|
+
* 1. Read JSON event from stdin (Claude Code hook protocol).
|
|
14
|
+
* 2. Per-tool capture (closes B1 CP3 ADV-B1-002 + ADV-B1-003): each
|
|
15
|
+
* tool_name has an explicit extraction function instead of generic
|
|
16
|
+
* shape-probing. Write/NotebookEdit DO NOT capture file body
|
|
17
|
+
* (only `wrote <path> (<N> bytes)`) — avoids leaking .env /
|
|
18
|
+
* credentials / id_rsa file writes into the queue. Edit/MultiEdit
|
|
19
|
+
* capture OLD/NEW strings so substantive changes reach B2.
|
|
20
|
+
* 3. Strip secrets from the captured text BEFORE writing to disk
|
|
21
|
+
* (12 patterns; see SECRET_PATTERNS). Includes quoted env-var
|
|
22
|
+
* values, AWS access keys, Slack tokens, Stripe keys, JWTs,
|
|
23
|
+
* private-key armor, DB URLs with creds, and context-anchored
|
|
24
|
+
* hex64 bearer tokens. Closes plan OQ12 + B1 CP3 ADV-B1-001 +
|
|
25
|
+
* ADV-B1-004.
|
|
26
|
+
* 4. Cap queue depth at 50 (force-flush trigger) / 80 (hard drop).
|
|
27
|
+
* Closes OQ10.
|
|
28
|
+
* 5. Atomic write via tmp + rename. 8-byte rand suffix (2^64 space;
|
|
29
|
+
* birthday-paradox-free at any realistic capture rate). Closes
|
|
30
|
+
* B1 CP3 ADV-B1-005.
|
|
31
|
+
*
|
|
32
|
+
* Candidate schema (B1.1 — closes ADV-B1-006):
|
|
33
|
+
* { ts, tool_name, cwd, session_id, captured_text, queue_pressure }
|
|
34
|
+
*
|
|
35
|
+
* Install (operator runs manually):
|
|
36
|
+
* $ cp packages/memory-service/hooks/agentmemory-classify-queue.mjs \
|
|
37
|
+
* ~/.claude/scripts/hooks/agentmemory-classify-queue.mjs
|
|
38
|
+
* $ jq '.hooks.PostToolUse += [{"command": "~/.claude/scripts/hooks/agentmemory-classify-queue.mjs"}]' \
|
|
39
|
+
* ~/.claude/settings.json > ~/.claude/settings.json.new
|
|
40
|
+
* $ mv ~/.claude/settings.json.new ~/.claude/settings.json
|
|
41
|
+
* (Phase B3 will ship `olam memory classifier install-hook` to
|
|
42
|
+
* automate this.)
|
|
43
|
+
*
|
|
44
|
+
* Plan reference:
|
|
45
|
+
* docs/plans/agentmemory-classifier-and-regret/phase-b-tasks.md B1
|
|
46
|
+
* OQ10 (queue depth cap), OQ12 (secret stripper before enqueue)
|
|
47
|
+
* B1 CP3 ADV-B1-001..006 (B1.1 follow-up)
|
|
48
|
+
*/
|
|
49
|
+
|
|
50
|
+
import {
|
|
51
|
+
existsSync,
|
|
52
|
+
mkdirSync,
|
|
53
|
+
readdirSync,
|
|
54
|
+
readFileSync,
|
|
55
|
+
realpathSync,
|
|
56
|
+
renameSync,
|
|
57
|
+
writeFileSync,
|
|
58
|
+
} from 'node:fs';
|
|
59
|
+
import { homedir } from 'node:os';
|
|
60
|
+
import { join } from 'node:path';
|
|
61
|
+
import { randomBytes } from 'node:crypto';
|
|
62
|
+
import { fileURLToPath } from 'node:url';
|
|
63
|
+
|
|
64
|
+
/** Max bytes of captured text persisted per candidate. Keeps queue files small. */
|
|
65
|
+
export const MAX_CAPTURED_CHARS = 4000;
|
|
66
|
+
|
|
67
|
+
/** Queue depth at which `main()` triggers a force-flush of the oldest 20 entries. */
|
|
68
|
+
export const QUEUE_FORCE_FLUSH_THRESHOLD = 50;
|
|
69
|
+
|
|
70
|
+
/** Queue depth at which `main()` drops the new event entirely (warn-log only). */
|
|
71
|
+
export const QUEUE_DROP_THRESHOLD = 80;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Random bytes appended to each queue filename. 8 bytes = 2^64 space;
|
|
75
|
+
* birthday-paradox-free at any realistic capture rate (collision
|
|
76
|
+
* probability < 1e-12 even at 100M events). Was 4 bytes in B1 (~1.6%
|
|
77
|
+
* collision at 360K events/hour bursts — silently lost a candidate per
|
|
78
|
+
* collision per ADV-B1-005).
|
|
79
|
+
*/
|
|
80
|
+
const RAND_BYTES = 8;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Vetted secret patterns. Each pattern matches a specific secret shape;
|
|
84
|
+
* matches are redacted with `<REDACTED:<pattern-name>>` so the queue
|
|
85
|
+
* file stays parseable and the redaction is observable in audits.
|
|
86
|
+
*
|
|
87
|
+
* Pattern set covers (closes ADV-B1-001 quoted-env-var bypass + adds
|
|
88
|
+
* coverage for shapes B1's initial 6-pattern set missed):
|
|
89
|
+
* env-var-assign — `KEY=value`, `KEY='value'`, `KEY="value"`,
|
|
90
|
+
* `"KEY":"value"` JSON-stringified form.
|
|
91
|
+
* Permissive key matcher (any uppercase
|
|
92
|
+
* identifier ending in SECRET|KEY|TOKEN|
|
|
93
|
+
* PASSWORD|PASS|BEARER|AUTH|CREDS|CREDENTIALS)
|
|
94
|
+
* so STRIPE_SECRET_KEY, CUSTOM_API_TOKEN,
|
|
95
|
+
* etc. all fire.
|
|
96
|
+
* bearer — `Bearer <token>` Authorization headers.
|
|
97
|
+
* sk-prefix — Anthropic/OpenAI keys.
|
|
98
|
+
* gh-pat — GitHub personal access tokens.
|
|
99
|
+
* slack-token — `xoxa|xoxb|xoxp|xoxr|xoxs|xoxo-...`
|
|
100
|
+
* aws-access-key-id — `AKIA[A-Z0-9]{16}` access key IDs.
|
|
101
|
+
* stripe-key — `sk_live_...` / `sk_test_...`.
|
|
102
|
+
* jwt — 3-segment base64url tokens.
|
|
103
|
+
* hex64-bearer — 64-hex tokens ONLY when adjacent to
|
|
104
|
+
* bearer|token|secret|key context word.
|
|
105
|
+
* (Was unanchored in B1; false-fired on
|
|
106
|
+
* container digests / sha256sum output per
|
|
107
|
+
* ADV-B1-004.)
|
|
108
|
+
* private-key-armor — PEM/OpenSSH key headers.
|
|
109
|
+
* db-url-with-creds — `postgres|mysql|mongodb|redis://user:pw@host`.
|
|
110
|
+
*/
|
|
111
|
+
export const SECRET_PATTERNS = [
|
|
112
|
+
{
|
|
113
|
+
name: 'env-var-assign',
|
|
114
|
+
re: /\b[A-Z][A-Z0-9_]*(?:SECRET|KEY|TOKEN|PASSWORD|PASS|BEARER|AUTH|CREDS|CREDENTIALS)[A-Z0-9_]*\s*[:=]\s*(?:"[^"\n]+"|'[^'\n]+'|[^\s"',;\n]+)/g,
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
// Same shape but inside JSON-string keys: `"FOO_KEY":"value"`.
|
|
118
|
+
// env-var-assign catches the unquoted KEY case; this rule catches
|
|
119
|
+
// the JSON-stringified key case where the key itself is wrapped in
|
|
120
|
+
// double-quotes.
|
|
121
|
+
name: 'env-var-assign',
|
|
122
|
+
re: /"[A-Z][A-Z0-9_]*(?:SECRET|KEY|TOKEN|PASSWORD|PASS|BEARER|AUTH|CREDS|CREDENTIALS)[A-Z0-9_]*"\s*:\s*"[^"\n]+"/g,
|
|
123
|
+
},
|
|
124
|
+
{ name: 'bearer', re: /\bBearer\s+[A-Za-z0-9._-]{16,}/g },
|
|
125
|
+
{ name: 'sk-prefix', re: /\bsk-[A-Za-z0-9_-]{20,}/g },
|
|
126
|
+
{ name: 'gh-pat', re: /\bghp_[A-Za-z0-9]{30,}/g },
|
|
127
|
+
{ name: 'slack-token', re: /\bxox[abopsr]-[A-Za-z0-9-]{10,}/g },
|
|
128
|
+
{ name: 'aws-access-key-id', re: /\bAKIA[A-Z0-9]{16}\b/g },
|
|
129
|
+
{ name: 'stripe-key', re: /\bsk_(?:live|test)_[A-Za-z0-9]{20,}/g },
|
|
130
|
+
{ name: 'jwt', re: /\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}/g },
|
|
131
|
+
{ name: 'hex64-bearer', re: /\b(?:bearer|token|secret|key)[\s:=]+[a-f0-9]{64}\b/gi },
|
|
132
|
+
{ name: 'private-key-armor', re: /-----BEGIN [A-Z ]+PRIVATE KEY-----/g },
|
|
133
|
+
{ name: 'db-url-with-creds', re: /\b(?:postgres|postgresql|mysql|mongodb|redis):\/\/[^:@\s'"]+:[^@\s'"]+@[^\s'"]+/g },
|
|
134
|
+
];
|
|
135
|
+
|
|
136
|
+
/** Resolved queue directory path under `~/.olam/agentmemory-queue/`. */
|
|
137
|
+
export function queueDir() {
|
|
138
|
+
return join(homedir(), '.olam', 'agentmemory-queue');
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Strip all configured secret patterns from `text`. Returns the
|
|
143
|
+
* redacted text. Idempotent — running twice doesn't re-redact.
|
|
144
|
+
*/
|
|
145
|
+
export function stripSecrets(text) {
|
|
146
|
+
if (typeof text !== 'string' || text.length === 0) return text;
|
|
147
|
+
let out = text;
|
|
148
|
+
for (const { name, re } of SECRET_PATTERNS) {
|
|
149
|
+
const pattern = new RegExp(re.source, re.flags);
|
|
150
|
+
out = out.replace(pattern, `<REDACTED:${name}>`);
|
|
151
|
+
}
|
|
152
|
+
return out;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/** Ensure the queue directory exists (idempotent). */
|
|
156
|
+
export function ensureQueueDir(dir = queueDir()) {
|
|
157
|
+
if (!existsSync(dir)) {
|
|
158
|
+
mkdirSync(dir, { recursive: true });
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/** Count `.jsonl` files in the queue dir (excludes the `.warn.log`). */
|
|
163
|
+
export function queueDepth(dir = queueDir()) {
|
|
164
|
+
if (!existsSync(dir)) return 0;
|
|
165
|
+
return readdirSync(dir).filter((n) => n.endsWith('.jsonl')).length;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* Atomic queue-file write. Writes to a tmp path then renames into place
|
|
170
|
+
* so a partial JSONL never ends up in the queue dir. Uses 8-byte rand
|
|
171
|
+
* to eliminate collision class (ADV-B1-005).
|
|
172
|
+
*/
|
|
173
|
+
export function writeCandidate(candidate, dir = queueDir()) {
|
|
174
|
+
ensureQueueDir(dir);
|
|
175
|
+
const ts = candidate.ts ?? Date.now();
|
|
176
|
+
const rand = randomBytes(RAND_BYTES).toString('hex');
|
|
177
|
+
const final = join(dir, `${ts}-${rand}.jsonl`);
|
|
178
|
+
const tmp = final + '.tmp';
|
|
179
|
+
writeFileSync(tmp, JSON.stringify(candidate) + '\n', 'utf-8');
|
|
180
|
+
renameSync(tmp, final);
|
|
181
|
+
return final;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/** Append a structured warning to the queue dir's `.warn.log` (fail-open). */
|
|
185
|
+
export function warnLog(message, dir = queueDir()) {
|
|
186
|
+
try {
|
|
187
|
+
ensureQueueDir(dir);
|
|
188
|
+
const line = JSON.stringify({ ts: Date.now(), level: 'warn', message }) + '\n';
|
|
189
|
+
writeFileSync(join(dir, '.warn.log'), line, { flag: 'a' });
|
|
190
|
+
} catch {
|
|
191
|
+
// Fail-open: warn-log failure is non-fatal.
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* Build a candidate payload from a Claude Code PostToolUse event. The
|
|
197
|
+
* captured text is per-tool (see {@link extractCapturedText}); secrets
|
|
198
|
+
* are stripped before this candidate ever touches disk.
|
|
199
|
+
*
|
|
200
|
+
* Schema (B1.1):
|
|
201
|
+
* ts unix ms timestamp
|
|
202
|
+
* tool_name from event.tool_name
|
|
203
|
+
* cwd from event.cwd
|
|
204
|
+
* session_id from event.session_id (B2 needs this for chain
|
|
205
|
+
* reconstruction — was missing in B1, would have
|
|
206
|
+
* forever-orphaned every pre-fix candidate)
|
|
207
|
+
* captured_text per-tool extraction, secret-stripped, truncated
|
|
208
|
+
* queue_pressure depth at capture time (B2 observability)
|
|
209
|
+
*/
|
|
210
|
+
export function buildCandidate(event, depth = 0, now = Date.now()) {
|
|
211
|
+
const rawText = extractCapturedText(event);
|
|
212
|
+
const stripped = stripSecrets(rawText);
|
|
213
|
+
const truncated = stripped.length > MAX_CAPTURED_CHARS
|
|
214
|
+
? stripped.slice(0, MAX_CAPTURED_CHARS)
|
|
215
|
+
: stripped;
|
|
216
|
+
return {
|
|
217
|
+
ts: now,
|
|
218
|
+
tool_name: event?.tool_name ?? null,
|
|
219
|
+
cwd: event?.cwd ?? null,
|
|
220
|
+
session_id: event?.session_id ?? null,
|
|
221
|
+
captured_text: truncated,
|
|
222
|
+
queue_pressure: depth,
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* Per-tool capture map. Each tool_name has an explicit extraction
|
|
228
|
+
* function — generic shape-probing would leak file bodies for Write
|
|
229
|
+
* (per ADV-B1-002) and miss substantive edits for Edit/MultiEdit
|
|
230
|
+
* (per ADV-B1-003). The explicit map closes both classes.
|
|
231
|
+
*
|
|
232
|
+
* Write / NotebookEdit: capture ONLY `wrote <path> (<N> bytes)` — never
|
|
233
|
+
* the file body. Operator writing ~/.env or ~/.aws/credentials gets
|
|
234
|
+
* the metadata in the queue, not the secret content.
|
|
235
|
+
* Edit / MultiEdit: capture OLD + NEW strings (substantive change).
|
|
236
|
+
* stripSecrets runs over the serialized form, so secret-bearing
|
|
237
|
+
* edits are still redacted.
|
|
238
|
+
* Read: capture `read <path>` + first 2KB of content. Same Write
|
|
239
|
+
* reasoning would apply but Read explicitly returns content the
|
|
240
|
+
* agent will reason over — withholding it makes classification
|
|
241
|
+
* useless.
|
|
242
|
+
* Bash: capture command + stdout.
|
|
243
|
+
* Generic fallback: tool_response.content / .text.
|
|
244
|
+
*/
|
|
245
|
+
export function extractCapturedText(event) {
|
|
246
|
+
if (!event || typeof event !== 'object') return '';
|
|
247
|
+
const toolName = event.tool_name;
|
|
248
|
+
const ti = event.tool_input ?? event.toolInput ?? null;
|
|
249
|
+
const tr = event.tool_response ?? event.toolResponse ?? null;
|
|
250
|
+
|
|
251
|
+
if (toolName === 'Bash') {
|
|
252
|
+
const command = ti?.command ?? '';
|
|
253
|
+
const stdout = readContentField(tr) ?? '';
|
|
254
|
+
return command ? (stdout ? `$ ${command}\n${stdout}` : `$ ${command}`) : (stdout ?? '');
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
if (toolName === 'Write' || toolName === 'NotebookEdit') {
|
|
258
|
+
const filePath = ti?.file_path ?? ti?.notebook_path ?? '<unknown>';
|
|
259
|
+
const content = ti?.content ?? ti?.new_source ?? '';
|
|
260
|
+
const len = typeof content === 'string' ? content.length : 0;
|
|
261
|
+
return `wrote ${filePath} (${len} bytes)`;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
if (toolName === 'Edit') {
|
|
265
|
+
const filePath = ti?.file_path ?? '<unknown>';
|
|
266
|
+
const oldStr = ti?.old_string ?? '';
|
|
267
|
+
const newStr = ti?.new_string ?? '';
|
|
268
|
+
return `edit ${filePath}\nOLD:\n${oldStr}\nNEW:\n${newStr}`;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
if (toolName === 'MultiEdit') {
|
|
272
|
+
const filePath = ti?.file_path ?? '<unknown>';
|
|
273
|
+
const edits = Array.isArray(ti?.edits) ? ti.edits : [];
|
|
274
|
+
const parts = edits.map((e, i) => `[${i}] OLD:\n${e?.old_string ?? ''}\nNEW:\n${e?.new_string ?? ''}`);
|
|
275
|
+
return `multi-edit ${filePath}\n${parts.join('\n---\n')}`;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
if (toolName === 'Read') {
|
|
279
|
+
const filePath = ti?.file_path ?? '<unknown>';
|
|
280
|
+
const content = readContentField(tr) ?? '';
|
|
281
|
+
const truncated = content.length > MAX_CAPTURED_CHARS / 2
|
|
282
|
+
? content.slice(0, MAX_CAPTURED_CHARS / 2)
|
|
283
|
+
: content;
|
|
284
|
+
return `read ${filePath}\n${truncated}`;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
// Generic fallback: tool_response content/text or tool_input content.
|
|
288
|
+
const fromResponse = readContentField(tr);
|
|
289
|
+
if (typeof fromResponse === 'string' && fromResponse.length > 0) return fromResponse;
|
|
290
|
+
if (ti && typeof ti === 'object') {
|
|
291
|
+
if (typeof ti.content === 'string') return ti.content;
|
|
292
|
+
if (typeof ti.command === 'string') return ti.command;
|
|
293
|
+
}
|
|
294
|
+
return '';
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
/**
|
|
298
|
+
* Read a content payload from a tool_response-shaped object. Handles:
|
|
299
|
+
* - string (return as-is)
|
|
300
|
+
* - { content: [{text}, ...] } MCP-style array (concat text blocks)
|
|
301
|
+
* - { text: string }
|
|
302
|
+
* - { content: string }
|
|
303
|
+
*/
|
|
304
|
+
function readContentField(obj) {
|
|
305
|
+
if (!obj) return null;
|
|
306
|
+
if (typeof obj === 'string') return obj;
|
|
307
|
+
if (Array.isArray(obj.content)) {
|
|
308
|
+
return obj.content
|
|
309
|
+
.map((c) => (typeof c?.text === 'string' ? c.text : ''))
|
|
310
|
+
.join('\n');
|
|
311
|
+
}
|
|
312
|
+
if (typeof obj.text === 'string') return obj.text;
|
|
313
|
+
if (typeof obj.content === 'string') return obj.content;
|
|
314
|
+
return null;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
async function main() {
|
|
318
|
+
let event = {};
|
|
319
|
+
try {
|
|
320
|
+
event = JSON.parse(readFileSync(0, 'utf-8'));
|
|
321
|
+
} catch {
|
|
322
|
+
return; // unparseable stdin → fail-open
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
const dir = queueDir();
|
|
326
|
+
ensureQueueDir(dir);
|
|
327
|
+
const depth = queueDepth(dir);
|
|
328
|
+
|
|
329
|
+
if (depth >= QUEUE_DROP_THRESHOLD) {
|
|
330
|
+
warnLog(`queue depth ${depth} >= drop threshold ${QUEUE_DROP_THRESHOLD}; dropping event tool_name=${event?.tool_name ?? '?'}`, dir);
|
|
331
|
+
return;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
const candidate = buildCandidate(event, depth);
|
|
335
|
+
writeCandidate(candidate, dir);
|
|
336
|
+
|
|
337
|
+
if (depth >= QUEUE_FORCE_FLUSH_THRESHOLD) {
|
|
338
|
+
// Phase B2 will own the force-flush trigger via an out-of-band
|
|
339
|
+
// signal (touching a sentinel file the launchd timer watches).
|
|
340
|
+
// For B1 ship we just warn — the next scheduled flush picks it up.
|
|
341
|
+
warnLog(`queue depth ${depth} >= force-flush threshold ${QUEUE_FORCE_FLUSH_THRESHOLD}; awaiting B2 timer`, dir);
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
// Run main only when invoked directly (allows test files to import the
|
|
346
|
+
// pure functions above without firing the hook side-effects). Compare
|
|
347
|
+
// REAL paths (not raw argv vs file://) so the hook still fires when
|
|
348
|
+
// resolved through a symlink — toolbox sync mounts these scripts via
|
|
349
|
+
// $HOME/.claude/scripts/agentmemory-classifier/ which is a symlink to the
|
|
350
|
+
// canonical atlas-toolbox path. Pre-fix, the raw-string compare missed
|
|
351
|
+
// the symlink and main() never ran.
|
|
352
|
+
function isDirectInvocation() {
|
|
353
|
+
try {
|
|
354
|
+
const argvPath = process.argv[1] ? realpathSync(process.argv[1]) : '';
|
|
355
|
+
const metaPath = realpathSync(fileURLToPath(import.meta.url));
|
|
356
|
+
return argvPath === metaPath;
|
|
357
|
+
} catch {
|
|
358
|
+
return false;
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
if (isDirectInvocation()) {
|
|
362
|
+
main().catch(() => process.exit(0));
|
|
363
|
+
}
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* agentmemory-recall-trigger.mjs
|
|
4
|
+
*
|
|
5
|
+
* PreToolUse hook for Claude Code — derives a prompt-context from the
|
|
6
|
+
* incoming tool event, POSTs to the bridge `/classify/recall` endpoint
|
|
7
|
+
* (Phase C2), and injects the top-3 results as additionalContext so
|
|
8
|
+
* the agent has relevant memory before executing the tool call.
|
|
9
|
+
*
|
|
10
|
+
* Hot-path SLO: p99 latency < 500ms (Phase A plan P1 row). The 500ms
|
|
11
|
+
* budget covers the bridge round-trip + the bridge → container
|
|
12
|
+
* memory_recall hop. Fail-open: any error exits 0 with no stdout —
|
|
13
|
+
* never blocks the tool loop.
|
|
14
|
+
*
|
|
15
|
+
* cwd → store routing (T4 mitigation):
|
|
16
|
+
* Derived from process.cwd() via the same regex pattern the existing
|
|
17
|
+
* SessionStart agentmemory-session-recall.js hook uses. The bridge
|
|
18
|
+
* URL itself is per-store (operators set AGENTMEMORY_BRIDGE_URL per
|
|
19
|
+
* project / per store) so cross-store leak is impossible from this
|
|
20
|
+
* hook — the bridge it talks to is single-store by configuration.
|
|
21
|
+
*
|
|
22
|
+
* Install (operator runs manually):
|
|
23
|
+
* $ cp packages/memory-service/hooks/agentmemory-recall-trigger.mjs \
|
|
24
|
+
* ~/.claude/scripts/hooks/agentmemory-recall-trigger.mjs
|
|
25
|
+
* $ packages/memory-service/scripts/install-recall-hook.sh
|
|
26
|
+
* # the install script does the cp + the settings.json edit + cp BACKUP first
|
|
27
|
+
*
|
|
28
|
+
* Plan reference:
|
|
29
|
+
* docs/plans/agentmemory-classifier-and-regret/phase-c-tasks.md C3
|
|
30
|
+
*/
|
|
31
|
+
|
|
32
|
+
import { existsSync, readFileSync, realpathSync } from 'node:fs';
|
|
33
|
+
import { homedir } from 'node:os';
|
|
34
|
+
import { join } from 'node:path';
|
|
35
|
+
import { fileURLToPath } from 'node:url';
|
|
36
|
+
|
|
37
|
+
// Built-in tool-event filter: only fire on tool calls where recall has
|
|
38
|
+
// signal. Bash + Edit + MultiEdit + Read on substantive paths qualify;
|
|
39
|
+
// TodoWrite + Glob + Grep are too lightweight to justify the recall
|
|
40
|
+
// round-trip.
|
|
41
|
+
const RECALL_WORTHY_TOOL_NAMES = new Set([
|
|
42
|
+
'Bash', 'Edit', 'MultiEdit', 'Write', 'Read', 'NotebookEdit',
|
|
43
|
+
]);
|
|
44
|
+
|
|
45
|
+
// Default to the LIVE memory-service Worker — the same host the remember/write
|
|
46
|
+
// path targets, so recall reads where the fleet writes. The prior default
|
|
47
|
+
// (olam-agent-memory.ernestcodes.workers.dev) is a dead host (HTTP 404), which
|
|
48
|
+
// made recall reach nothing. env still overrides for per-store / wrangler-dev.
|
|
49
|
+
// env wins → `olam memory connect` artifact → live default. See
|
|
50
|
+
// packages/cli/src/lib/memory-connection.ts (keep precedence in sync).
|
|
51
|
+
function resolveBridgeUrlDefault() {
|
|
52
|
+
if (process.env.AGENTMEMORY_BRIDGE_URL) return process.env.AGENTMEMORY_BRIDGE_URL;
|
|
53
|
+
try {
|
|
54
|
+
const conn = JSON.parse(
|
|
55
|
+
readFileSync(join(homedir(), '.olam', 'memory-connection.json'), 'utf8'),
|
|
56
|
+
);
|
|
57
|
+
if (conn && typeof conn.url === 'string' && conn.url) return conn.url;
|
|
58
|
+
} catch {
|
|
59
|
+
// artifact absent / malformed — fall through
|
|
60
|
+
}
|
|
61
|
+
return 'https://atlas-agent-memory.atlas-kitchen.workers.dev';
|
|
62
|
+
}
|
|
63
|
+
const BRIDGE_URL = resolveBridgeUrlDefault();
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Resolve a secret file path: prefers ~/.olam/secrets/<name>,
|
|
67
|
+
* falls back to ~/.olam/<name>. Inlined here because this .mjs hook
|
|
68
|
+
* has no @olam/core dep.
|
|
69
|
+
*/
|
|
70
|
+
function resolveSecretPathInline(name) {
|
|
71
|
+
const olamHome = join(homedir(), '.olam');
|
|
72
|
+
const newPath = join(olamHome, 'secrets', name);
|
|
73
|
+
if (existsSync(newPath)) return newPath;
|
|
74
|
+
return join(olamHome, name);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/** Read a trimmed secret file by name, or '' if absent/unreadable. */
|
|
78
|
+
function readSecretFile(name) {
|
|
79
|
+
try {
|
|
80
|
+
return readFileSync(resolveSecretPathInline(name), 'utf8').trim();
|
|
81
|
+
} catch {
|
|
82
|
+
return '';
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// Bearer resolution (first match wins; no literal embedded):
|
|
87
|
+
// env AGENTMEMORY_BRIDGE_SECRET → env OLAM_AGENT_MEMORY_BEARER
|
|
88
|
+
// → file bridge-secret → file agent-memory-bearer → '' (no-op fail-open).
|
|
89
|
+
// Empty string short-circuits callBridge() to a fail-open no-op so the hook
|
|
90
|
+
// never blocks the tool loop on a missing secret.
|
|
91
|
+
const BEARER =
|
|
92
|
+
process.env.AGENTMEMORY_BRIDGE_SECRET ||
|
|
93
|
+
process.env.OLAM_AGENT_MEMORY_BEARER ||
|
|
94
|
+
readSecretFile('bridge-secret') ||
|
|
95
|
+
readSecretFile('agent-memory-bearer') ||
|
|
96
|
+
'';
|
|
97
|
+
const RECALL_TIMEOUT_MS = 1500;
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Derive the recall prompt from a Claude Code PreToolUse event. Each
|
|
101
|
+
* tool gets a tailored prompt shape:
|
|
102
|
+
* Bash → `$ <command>`
|
|
103
|
+
* Edit → `edit <file_path>: <truncated new_string>`
|
|
104
|
+
* MultiEdit → `multi-edit <file_path>`
|
|
105
|
+
* Write → `wrote <file_path>`
|
|
106
|
+
* Read → `read <file_path>`
|
|
107
|
+
* default → JSON.stringify(tool_input).slice(0, 200)
|
|
108
|
+
*/
|
|
109
|
+
export function derivePrompt(event) {
|
|
110
|
+
if (!event || typeof event !== 'object') return '';
|
|
111
|
+
const toolName = event.tool_name;
|
|
112
|
+
const ti = event.tool_input ?? event.toolInput ?? null;
|
|
113
|
+
if (!RECALL_WORTHY_TOOL_NAMES.has(toolName)) return '';
|
|
114
|
+
|
|
115
|
+
if (toolName === 'Bash') {
|
|
116
|
+
const cmd = ti?.command;
|
|
117
|
+
return typeof cmd === 'string' ? `$ ${cmd}` : '';
|
|
118
|
+
}
|
|
119
|
+
if (toolName === 'Edit') {
|
|
120
|
+
const fp = ti?.file_path ?? '';
|
|
121
|
+
const ns = typeof ti?.new_string === 'string'
|
|
122
|
+
? ti.new_string.slice(0, 200)
|
|
123
|
+
: '';
|
|
124
|
+
return `edit ${fp}: ${ns}`;
|
|
125
|
+
}
|
|
126
|
+
if (toolName === 'MultiEdit') {
|
|
127
|
+
return `multi-edit ${ti?.file_path ?? ''}`;
|
|
128
|
+
}
|
|
129
|
+
if (toolName === 'Write') {
|
|
130
|
+
return `wrote ${ti?.file_path ?? ''}`;
|
|
131
|
+
}
|
|
132
|
+
if (toolName === 'Read') {
|
|
133
|
+
return `read ${ti?.file_path ?? ''}`;
|
|
134
|
+
}
|
|
135
|
+
if (toolName === 'NotebookEdit') {
|
|
136
|
+
return `edit ${ti?.notebook_path ?? ''}`;
|
|
137
|
+
}
|
|
138
|
+
return '';
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Call the bridge /classify/recall endpoint. Returns the parsed
|
|
143
|
+
* response body or null on any failure (fail-open).
|
|
144
|
+
*/
|
|
145
|
+
async function callBridge(prompt, cwd) {
|
|
146
|
+
if (!prompt || !BRIDGE_URL || !BEARER) return null;
|
|
147
|
+
try {
|
|
148
|
+
const res = await fetch(`${BRIDGE_URL}/classify/recall`, {
|
|
149
|
+
method: 'POST',
|
|
150
|
+
headers: {
|
|
151
|
+
Authorization: `Bearer ${BEARER}`,
|
|
152
|
+
'content-type': 'application/json',
|
|
153
|
+
},
|
|
154
|
+
body: JSON.stringify({ prompt, cwd, limit: 3 }),
|
|
155
|
+
signal: AbortSignal.timeout(RECALL_TIMEOUT_MS),
|
|
156
|
+
});
|
|
157
|
+
if (!res.ok) return null;
|
|
158
|
+
return await res.json();
|
|
159
|
+
} catch (err) {
|
|
160
|
+
// Fail-open: one-line breadcrumb to stderr, then null (no output, no block).
|
|
161
|
+
process.stderr.write(`[agentmemory-recall-trigger] recall failed: ${err?.message ?? err}\n`);
|
|
162
|
+
return null;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Format the recall response as a markdown additionalContext block
|
|
168
|
+
* for hookSpecificOutput. Returns empty string when no results so the
|
|
169
|
+
* hook emits no output and the agent sees no noise.
|
|
170
|
+
*/
|
|
171
|
+
export function formatAdditionalContext(response, prompt) {
|
|
172
|
+
if (!response || !Array.isArray(response.results) || response.results.length === 0) {
|
|
173
|
+
return '';
|
|
174
|
+
}
|
|
175
|
+
const lines = [
|
|
176
|
+
`## Recalled from agent memory (prompt: "${prompt.slice(0, 80)}${prompt.length > 80 ? '…' : ''}")`,
|
|
177
|
+
'',
|
|
178
|
+
];
|
|
179
|
+
for (const r of response.results) {
|
|
180
|
+
const title = r.title || r.id || '(untitled)';
|
|
181
|
+
const score = typeof r.score === 'number' ? r.score.toFixed(1) : '?';
|
|
182
|
+
const conv = typeof r.conviction === 'number' ? r.conviction : '?';
|
|
183
|
+
const sim = typeof r.similarity === 'number' ? r.similarity.toFixed(2) : '?';
|
|
184
|
+
lines.push(`- [score ${score} | conv ${conv} | sim ${sim}] ${title}`);
|
|
185
|
+
if (r.contentExcerpt) {
|
|
186
|
+
lines.push(` ${r.contentExcerpt}`);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
return lines.join('\n');
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
async function main() {
|
|
193
|
+
let event = {};
|
|
194
|
+
try {
|
|
195
|
+
event = JSON.parse(readFileSync(0, 'utf-8'));
|
|
196
|
+
} catch {
|
|
197
|
+
return; // unparseable stdin → fail-open
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
const prompt = derivePrompt(event);
|
|
201
|
+
if (!prompt) return;
|
|
202
|
+
|
|
203
|
+
const response = await callBridge(prompt, event.cwd ?? process.cwd());
|
|
204
|
+
const additionalContext = formatAdditionalContext(response, prompt);
|
|
205
|
+
if (!additionalContext) return;
|
|
206
|
+
|
|
207
|
+
process.stdout.write(JSON.stringify({
|
|
208
|
+
hookSpecificOutput: {
|
|
209
|
+
hookEventName: 'PreToolUse',
|
|
210
|
+
additionalContext,
|
|
211
|
+
},
|
|
212
|
+
}));
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
// Run main only when invoked directly (allows test files to import the
|
|
216
|
+
// pure functions above without firing the hook side-effects). Compare
|
|
217
|
+
// REAL paths (not raw argv vs file://) so the hook still fires when
|
|
218
|
+
// resolved through a symlink — toolbox sync mounts these scripts via
|
|
219
|
+
// $HOME/.claude/scripts/agentmemory-classifier/ which is a symlink to the
|
|
220
|
+
// canonical atlas-toolbox path. Pre-fix, the raw-string compare missed
|
|
221
|
+
// the symlink and main() never ran.
|
|
222
|
+
function isDirectInvocation() {
|
|
223
|
+
try {
|
|
224
|
+
const argvPath = process.argv[1] ? realpathSync(process.argv[1]) : '';
|
|
225
|
+
const metaPath = realpathSync(fileURLToPath(import.meta.url));
|
|
226
|
+
return argvPath === metaPath;
|
|
227
|
+
} catch {
|
|
228
|
+
return false;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
if (isDirectInvocation()) {
|
|
232
|
+
main().catch(() => process.exit(0));
|
|
233
|
+
}
|