@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,332 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* agentmemory-reflect-cite.mjs — the Phase D citation floor WIRING (Stop hook).
|
|
4
|
+
*
|
|
5
|
+
* This is the session-end backstop to the explicit `memory_reinforce` tool. At
|
|
6
|
+
* Stop it:
|
|
7
|
+
* 1. derives the SAME session key the recall hook wrote under
|
|
8
|
+
* ({@link sessionKeyFor} — keyed on `session_id`, identical derivation at
|
|
9
|
+
* both ends; a mismatch would be a silent no-op, so it is inlined from the
|
|
10
|
+
* same source as the recall hook and covered by a key-parity test),
|
|
11
|
+
* 2. reads the surfaced set from the recall-log ({@link collectSurfaced}),
|
|
12
|
+
* 3. builds the scan text from the agent's OWN output/edits in the transcript,
|
|
13
|
+
* EXCLUDING the injected recall-context block (the self-citation guard —
|
|
14
|
+
* see {@link buildScanText}),
|
|
15
|
+
* 4. runs {@link detectCitedMemories} (precision-biased contiguous-distinctive
|
|
16
|
+
* -run match), and
|
|
17
|
+
* 5. POSTs the cited ids to `/classify/reinforce` with `source: 'citation'`.
|
|
18
|
+
*
|
|
19
|
+
* The bridge enforces the FIX-1 abuse guards, so cited ids pass the recalled-gate
|
|
20
|
+
* by construction (they were surfaced this session → recorded in last_recalled_at
|
|
21
|
+
* by the recall path) and the cooldown still bounds re-stamping.
|
|
22
|
+
*
|
|
23
|
+
* Fail-open in every branch: a missing bearer, an unreadable transcript, an empty
|
|
24
|
+
* recall-log, or a bridge error all exit 0 with no output. The floor is a
|
|
25
|
+
* best-effort signal and must NEVER block session end.
|
|
26
|
+
*
|
|
27
|
+
* ESM (.mjs) so it can import recall-log.mjs + reinforce-citation logic directly
|
|
28
|
+
* and be unit-tested via node:test. The citation DETECTOR lives in TS
|
|
29
|
+
* (src/reinforce-citation.ts); its small, dependency-free logic is mirrored here
|
|
30
|
+
* as an inlined ESM copy for the same no-build reason the recall hook inlines
|
|
31
|
+
* deriveRecallQuery (the .ts remains the source of truth + carries its own
|
|
32
|
+
* adversarial unit tests).
|
|
33
|
+
*/
|
|
34
|
+
|
|
35
|
+
import { readFileSync } from 'node:fs';
|
|
36
|
+
import { homedir } from 'node:os';
|
|
37
|
+
import { join } from 'node:path';
|
|
38
|
+
import { fileURLToPath } from 'node:url';
|
|
39
|
+
import { realpathSync } from 'node:fs';
|
|
40
|
+
|
|
41
|
+
import { collectSurfaced, sessionKeyFor, sweepStaleLogs } from './recall-log.mjs';
|
|
42
|
+
|
|
43
|
+
// ---------------------------------------------------------------------------
|
|
44
|
+
// Bridge config — mirrors agentmemory-session-recall.js so recall + cite agree.
|
|
45
|
+
// ---------------------------------------------------------------------------
|
|
46
|
+
|
|
47
|
+
// env wins → `olam memory connect` artifact → live default. See
|
|
48
|
+
// packages/cli/src/lib/memory-connection.ts (keep precedence in sync).
|
|
49
|
+
function resolveBridgeUrlDefault() {
|
|
50
|
+
if (process.env.AGENTMEMORY_BRIDGE_URL) return process.env.AGENTMEMORY_BRIDGE_URL;
|
|
51
|
+
try {
|
|
52
|
+
const conn = JSON.parse(
|
|
53
|
+
readFileSync(join(homedir(), '.olam', 'memory-connection.json'), 'utf8'),
|
|
54
|
+
);
|
|
55
|
+
if (conn && typeof conn.url === 'string' && conn.url) return conn.url;
|
|
56
|
+
} catch {
|
|
57
|
+
// artifact absent / malformed — fall through
|
|
58
|
+
}
|
|
59
|
+
return 'https://atlas-agent-memory.atlas-kitchen.workers.dev';
|
|
60
|
+
}
|
|
61
|
+
const BRIDGE_URL = resolveBridgeUrlDefault();
|
|
62
|
+
|
|
63
|
+
function resolveSecretPath(name) {
|
|
64
|
+
const olamHome = join(homedir(), '.olam');
|
|
65
|
+
const newPath = join(olamHome, 'secrets', name);
|
|
66
|
+
try {
|
|
67
|
+
readFileSync(newPath);
|
|
68
|
+
return newPath;
|
|
69
|
+
} catch {
|
|
70
|
+
return join(olamHome, name);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function readSecretFile(name) {
|
|
75
|
+
try {
|
|
76
|
+
return readFileSync(resolveSecretPath(name), 'utf8').trim();
|
|
77
|
+
} catch {
|
|
78
|
+
return '';
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
const BEARER =
|
|
83
|
+
process.env.AGENTMEMORY_BRIDGE_SECRET ||
|
|
84
|
+
process.env.OLAM_AGENT_MEMORY_BEARER ||
|
|
85
|
+
readSecretFile('bridge-secret') ||
|
|
86
|
+
readSecretFile('agent-memory-bearer') ||
|
|
87
|
+
'';
|
|
88
|
+
|
|
89
|
+
// ---------------------------------------------------------------------------
|
|
90
|
+
// Citation detector (inlined ESM mirror of src/reinforce-citation.ts).
|
|
91
|
+
// Kept structurally identical — the .ts is the source of truth + unit tests.
|
|
92
|
+
// ---------------------------------------------------------------------------
|
|
93
|
+
|
|
94
|
+
const MIN_SHINGLE = 4;
|
|
95
|
+
const MIN_TITLE_TOKENS = 4;
|
|
96
|
+
|
|
97
|
+
const STOPWORDS = new Set([
|
|
98
|
+
'a', 'an', 'the', 'and', 'or', 'but', 'if', 'then', 'else', 'of', 'to', 'in',
|
|
99
|
+
'on', 'at', 'by', 'for', 'with', 'as', 'is', 'are', 'was', 'were', 'be',
|
|
100
|
+
'been', 'being', 'it', 'its', 'this', 'that', 'these', 'those', 'i', 'you',
|
|
101
|
+
'we', 'they', 'he', 'she', 'do', 'does', 'did', 'so', 'not', 'no', 'can',
|
|
102
|
+
'will', 'would', 'should', 'could', 'has', 'have', 'had', 'from', 'into',
|
|
103
|
+
'out', 'up', 'down', 'over', 'under', 'about', 'than', 'too', 'very', 'just',
|
|
104
|
+
'use', 'used', 'using', 'via', 'per', 'when', 'while', 'how', 'what', 'why',
|
|
105
|
+
]);
|
|
106
|
+
|
|
107
|
+
function tokenize(text) {
|
|
108
|
+
return text.toLowerCase().split(/[^a-z0-9]+/).filter((t) => t.length > 0);
|
|
109
|
+
}
|
|
110
|
+
function distinctiveTokens(text) {
|
|
111
|
+
return tokenize(text).filter((t) => t.length > 1 && !STOPWORDS.has(t));
|
|
112
|
+
}
|
|
113
|
+
function distinctiveOf(tokens) {
|
|
114
|
+
return tokens.filter((t) => t.length > 1 && !STOPWORDS.has(t));
|
|
115
|
+
}
|
|
116
|
+
function containsRun(haystackTokens, needleTokens) {
|
|
117
|
+
if (needleTokens.length === 0 || needleTokens.length > haystackTokens.length) return false;
|
|
118
|
+
for (let i = 0; i + needleTokens.length <= haystackTokens.length; i += 1) {
|
|
119
|
+
let match = true;
|
|
120
|
+
for (let j = 0; j < needleTokens.length; j += 1) {
|
|
121
|
+
if (haystackTokens[i + j] !== needleTokens[j]) {
|
|
122
|
+
match = false;
|
|
123
|
+
break;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
if (match) return true;
|
|
127
|
+
}
|
|
128
|
+
return false;
|
|
129
|
+
}
|
|
130
|
+
function hasShingleMatch(sourceTokens, outputTokens) {
|
|
131
|
+
if (sourceTokens.length < MIN_SHINGLE) return false;
|
|
132
|
+
for (let i = 0; i + MIN_SHINGLE <= sourceTokens.length; i += 1) {
|
|
133
|
+
if (containsRun(outputTokens, sourceTokens.slice(i, i + MIN_SHINGLE))) return true;
|
|
134
|
+
}
|
|
135
|
+
return false;
|
|
136
|
+
}
|
|
137
|
+
function isMemoryCited(memory, outputTokens) {
|
|
138
|
+
const outputDistinctive = distinctiveOf(outputTokens);
|
|
139
|
+
if (outputDistinctive.length === 0) return false;
|
|
140
|
+
const titleTokens = distinctiveTokens(memory.title ?? '');
|
|
141
|
+
if (titleTokens.length >= MIN_TITLE_TOKENS && containsRun(outputDistinctive, titleTokens)) return true;
|
|
142
|
+
if (hasShingleMatch(titleTokens, outputDistinctive)) return true;
|
|
143
|
+
const excerptTokens = distinctiveTokens(memory.excerpt ?? '');
|
|
144
|
+
if (hasShingleMatch(excerptTokens, outputDistinctive)) return true;
|
|
145
|
+
return false;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* Return the subset of `surfaced` literally referenced in `agentOutputText`.
|
|
150
|
+
* Order-preserving, de-duplicated by id. (Mirror of the TS export.)
|
|
151
|
+
*/
|
|
152
|
+
export function detectCitedMemories(surfaced, agentOutputText) {
|
|
153
|
+
if (!Array.isArray(surfaced) || surfaced.length === 0) return [];
|
|
154
|
+
if (typeof agentOutputText !== 'string' || agentOutputText.length === 0) return [];
|
|
155
|
+
const outputTokens = tokenize(agentOutputText);
|
|
156
|
+
if (outputTokens.length === 0) return [];
|
|
157
|
+
const cited = [];
|
|
158
|
+
const seen = new Set();
|
|
159
|
+
for (const m of surfaced) {
|
|
160
|
+
if (!m || typeof m.id !== 'string' || seen.has(m.id)) continue;
|
|
161
|
+
if (isMemoryCited(m, outputTokens)) {
|
|
162
|
+
cited.push(m);
|
|
163
|
+
seen.add(m.id);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
return cited;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
// ---------------------------------------------------------------------------
|
|
170
|
+
// Self-citation guard — extract the agent's OWN output, EXCLUDING the recall block.
|
|
171
|
+
// ---------------------------------------------------------------------------
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Markers that identify the injected recall-context block (from
|
|
175
|
+
* agentmemory-session-recall.js + agentmemory-recall-trigger.mjs). Any text
|
|
176
|
+
* block containing one of these is the SYSTEM's injected context — NOT the
|
|
177
|
+
* agent's own output — and must be excluded from the citation scan, or every
|
|
178
|
+
* surfaced memory self-matches its own injected title (the self-citation loop).
|
|
179
|
+
*/
|
|
180
|
+
export const RECALL_BLOCK_MARKERS = [
|
|
181
|
+
'Recalled from agent memory',
|
|
182
|
+
'call `memory_reinforce`',
|
|
183
|
+
'call memory_reinforce',
|
|
184
|
+
];
|
|
185
|
+
|
|
186
|
+
function looksLikeRecallBlock(text) {
|
|
187
|
+
return RECALL_BLOCK_MARKERS.some((m) => text.includes(m));
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* Build the citation-scan text from a parsed transcript (array of JSONL entries).
|
|
192
|
+
*
|
|
193
|
+
* Includes ONLY the agent's OWN output:
|
|
194
|
+
* - `assistant` message `text` blocks (the agent's prose), and
|
|
195
|
+
* - `assistant` `tool_use` input strings (the edits/commands the agent issued)
|
|
196
|
+
*
|
|
197
|
+
* Excludes — by construction and by marker — anything that is NOT the agent's own
|
|
198
|
+
* authored output:
|
|
199
|
+
* - all `user` messages + `tool_result` blocks (inputs / tool outputs the agent
|
|
200
|
+
* merely received, including the recalled memory content itself),
|
|
201
|
+
* - any assistant text block that carries a {@link RECALL_BLOCK_MARKERS} marker
|
|
202
|
+
* (defensive: the injected recall block is normally a system/user-context
|
|
203
|
+
* injection, but if a transcript variant echoes it into an assistant turn we
|
|
204
|
+
* still strip it).
|
|
205
|
+
*
|
|
206
|
+
* This is THE self-citation guard: the scanned text never contains the injected
|
|
207
|
+
* titles, so a surfaced memory can only be "cited" if the AGENT independently
|
|
208
|
+
* wrote its distinctive tokens.
|
|
209
|
+
*/
|
|
210
|
+
export function buildScanText(transcriptEntries) {
|
|
211
|
+
if (!Array.isArray(transcriptEntries)) return '';
|
|
212
|
+
const parts = [];
|
|
213
|
+
for (const entry of transcriptEntries) {
|
|
214
|
+
if (!entry || entry.type !== 'assistant') continue;
|
|
215
|
+
const msg = entry.message;
|
|
216
|
+
const content = msg && msg.content;
|
|
217
|
+
if (typeof content === 'string') {
|
|
218
|
+
if (!looksLikeRecallBlock(content)) parts.push(content);
|
|
219
|
+
continue;
|
|
220
|
+
}
|
|
221
|
+
if (!Array.isArray(content)) continue;
|
|
222
|
+
for (const block of content) {
|
|
223
|
+
if (!block || typeof block !== 'object') continue;
|
|
224
|
+
if (block.type === 'text' && typeof block.text === 'string') {
|
|
225
|
+
if (!looksLikeRecallBlock(block.text)) parts.push(block.text);
|
|
226
|
+
} else if (block.type === 'tool_use' && block.input && typeof block.input === 'object') {
|
|
227
|
+
// The agent's edits/commands ARE its output. Pull the string-valued
|
|
228
|
+
// fields (new_string / content / command / etc.); skip the recall block
|
|
229
|
+
// if a tool input somehow echoes it.
|
|
230
|
+
for (const v of Object.values(block.input)) {
|
|
231
|
+
if (typeof v === 'string' && v.length > 0 && !looksLikeRecallBlock(v)) parts.push(v);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
return parts.join('\n');
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
* Parse a transcript JSONL file into an array of entries. Fail-open: returns []
|
|
241
|
+
* on any read/parse error (the floor is best-effort).
|
|
242
|
+
*/
|
|
243
|
+
export function readTranscript(transcriptPath) {
|
|
244
|
+
if (typeof transcriptPath !== 'string' || transcriptPath.length === 0) return [];
|
|
245
|
+
let raw;
|
|
246
|
+
try {
|
|
247
|
+
raw = readFileSync(transcriptPath, 'utf8');
|
|
248
|
+
} catch {
|
|
249
|
+
return [];
|
|
250
|
+
}
|
|
251
|
+
const entries = [];
|
|
252
|
+
for (const line of raw.split('\n')) {
|
|
253
|
+
const trimmed = line.trim();
|
|
254
|
+
if (!trimmed) continue;
|
|
255
|
+
try {
|
|
256
|
+
entries.push(JSON.parse(trimmed));
|
|
257
|
+
} catch {
|
|
258
|
+
// skip a malformed line — never abort the whole parse
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
return entries;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
async function postReinforce(memoryIds) {
|
|
265
|
+
const res = await fetch(`${BRIDGE_URL}/classify/reinforce`, {
|
|
266
|
+
method: 'POST',
|
|
267
|
+
headers: { Authorization: `Bearer ${BEARER}`, 'Content-Type': 'application/json' },
|
|
268
|
+
body: JSON.stringify({
|
|
269
|
+
memoryIds,
|
|
270
|
+
source: 'citation',
|
|
271
|
+
reason: 'session-end citation floor: literally referenced in agent output',
|
|
272
|
+
}),
|
|
273
|
+
signal: AbortSignal.timeout(5000),
|
|
274
|
+
});
|
|
275
|
+
if (!res.ok) throw new Error(`HTTP ${res.status}`);
|
|
276
|
+
return res.json();
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
async function main() {
|
|
280
|
+
let event = {};
|
|
281
|
+
try {
|
|
282
|
+
event = JSON.parse(readFileSync(0, 'utf8'));
|
|
283
|
+
} catch {
|
|
284
|
+
return; // unparseable stdin → fail-open
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
// No bearer → no-op fail-open (matches the recall hook).
|
|
288
|
+
if (!BEARER) return;
|
|
289
|
+
|
|
290
|
+
// SAME session-key derivation as the recall hook — keyed on session_id. A
|
|
291
|
+
// mismatch here would silently union nothing; the key-parity test pins this.
|
|
292
|
+
const sessionKey = sessionKeyFor(event);
|
|
293
|
+
const surfaced = collectSurfaced(sessionKey);
|
|
294
|
+
if (!surfaced || surfaced.length === 0) {
|
|
295
|
+
sweepStaleLogs(); // opportunistic GC even when there's nothing to cite
|
|
296
|
+
return;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
const transcript = readTranscript(event.transcript_path);
|
|
300
|
+
const scanText = buildScanText(transcript);
|
|
301
|
+
if (!scanText) {
|
|
302
|
+
sweepStaleLogs();
|
|
303
|
+
return;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
const cited = detectCitedMemories(surfaced, scanText);
|
|
307
|
+
if (cited.length === 0) {
|
|
308
|
+
sweepStaleLogs();
|
|
309
|
+
return;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
try {
|
|
313
|
+
await postReinforce(cited.map((m) => m.id));
|
|
314
|
+
} catch (err) {
|
|
315
|
+
process.stderr.write(`[agentmemory-reflect-cite] reinforce failed: ${err?.message ?? err}\n`);
|
|
316
|
+
}
|
|
317
|
+
sweepStaleLogs();
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
function isDirectInvocation() {
|
|
321
|
+
try {
|
|
322
|
+
const argvPath = process.argv[1] ? realpathSync(process.argv[1]) : '';
|
|
323
|
+
const metaPath = realpathSync(fileURLToPath(import.meta.url));
|
|
324
|
+
return argvPath === metaPath;
|
|
325
|
+
} catch {
|
|
326
|
+
return false;
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
if (isDirectInvocation()) {
|
|
331
|
+
main().catch(() => process.exit(0));
|
|
332
|
+
}
|
|
@@ -0,0 +1,332 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* agentmemory-session-recall.js
|
|
4
|
+
*
|
|
5
|
+
* SessionStart hook — recalls relevant memories from the agentmemory bridge
|
|
6
|
+
* and injects them as additionalContext so Claude has project history before
|
|
7
|
+
* doing any work.
|
|
8
|
+
*
|
|
9
|
+
* Config (env vars, checked in order):
|
|
10
|
+
* AGENTMEMORY_BRIDGE_URL bridge base URL (default: the live memory-service
|
|
11
|
+
* Worker — same host the remember/write path targets,
|
|
12
|
+
* so recall reads where the fleet writes)
|
|
13
|
+
* AGENTMEMORY_BRIDGE_SECRET bearer token (resolution order below)
|
|
14
|
+
*
|
|
15
|
+
* Bearer resolution (first match wins; no literal is embedded):
|
|
16
|
+
* 1. process.env.AGENTMEMORY_BRIDGE_SECRET
|
|
17
|
+
* 2. process.env.OLAM_AGENT_MEMORY_BEARER
|
|
18
|
+
* 3. file bridge-secret (~/.olam/secrets/ preferred, then ~/.olam/)
|
|
19
|
+
* 4. file agent-memory-bearer (~/.olam/secrets/ preferred, then ~/.olam/)
|
|
20
|
+
* 5. else '' → no-op (recall is skipped; session continues normally)
|
|
21
|
+
*
|
|
22
|
+
* The file lookup mirrors agentmemory-recall-trigger.mjs (secrets/ first,
|
|
23
|
+
* then the bare ~/.olam/ path) so BOTH recall hooks resolve the SAME bearer
|
|
24
|
+
* file and can't diverge.
|
|
25
|
+
*
|
|
26
|
+
* Fails open — any error (or a missing bearer) exits 0 with no output; the
|
|
27
|
+
* session continues normally and is never blocked.
|
|
28
|
+
*
|
|
29
|
+
* E2 — task-aware query derivation:
|
|
30
|
+
* Query is now derived from git branch + recent-changed files + cwd terms
|
|
31
|
+
* (via `deriveRecallQuery` in src/recall-query.ts, inlined below as CJS).
|
|
32
|
+
* This replaces the old cwd-last-2-segments slug that was task-blind.
|
|
33
|
+
* taskText feed (from UserPromptSubmit) is the E2 follow-on; noted at
|
|
34
|
+
* the bottom of this file.
|
|
35
|
+
*/
|
|
36
|
+
|
|
37
|
+
'use strict';
|
|
38
|
+
|
|
39
|
+
const fs = require('fs');
|
|
40
|
+
const os = require('os');
|
|
41
|
+
const path = require('path');
|
|
42
|
+
|
|
43
|
+
// Resolve the bridge URL: operator env wins, then the `olam memory connect`
|
|
44
|
+
// artifact (~/.olam/memory-connection.json), then the LIVE memory-service
|
|
45
|
+
// Worker. The prior default (olam-agent-memory.ernestcodes.workers.dev) is a
|
|
46
|
+
// dead host (HTTP 404); the artifact path lets `olam memory connect <url>` take
|
|
47
|
+
// effect without reinstalling hooks. Keep in sync with
|
|
48
|
+
// packages/cli/src/lib/memory-connection.ts resolveMemoryServiceUrl().
|
|
49
|
+
function resolveBridgeUrlDefault() {
|
|
50
|
+
if (process.env.AGENTMEMORY_BRIDGE_URL) return process.env.AGENTMEMORY_BRIDGE_URL;
|
|
51
|
+
try {
|
|
52
|
+
const conn = JSON.parse(
|
|
53
|
+
fs.readFileSync(path.join(os.homedir(), '.olam', 'memory-connection.json'), 'utf8'),
|
|
54
|
+
);
|
|
55
|
+
if (conn && typeof conn.url === 'string' && conn.url) return conn.url;
|
|
56
|
+
} catch {
|
|
57
|
+
// artifact absent / malformed — fall through to the live default
|
|
58
|
+
}
|
|
59
|
+
return 'https://atlas-agent-memory.atlas-kitchen.workers.dev';
|
|
60
|
+
}
|
|
61
|
+
const BRIDGE_URL = resolveBridgeUrlDefault();
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Resolve a secret file path: prefers ~/.olam/secrets/<name>, falls back to
|
|
65
|
+
* ~/.olam/<name>. Mirrors resolveSecretPathInline() in
|
|
66
|
+
* agentmemory-recall-trigger.mjs so both recall hooks pick the SAME bearer file.
|
|
67
|
+
*/
|
|
68
|
+
function resolveSecretPath(name) {
|
|
69
|
+
const olamHome = path.join(os.homedir(), '.olam');
|
|
70
|
+
const newPath = path.join(olamHome, 'secrets', name);
|
|
71
|
+
if (fs.existsSync(newPath)) return newPath;
|
|
72
|
+
return path.join(olamHome, name);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/** Read a trimmed secret file by name, or '' if absent/unreadable. */
|
|
76
|
+
function readSecretFile(name) {
|
|
77
|
+
try {
|
|
78
|
+
return fs.readFileSync(resolveSecretPath(name), 'utf8').trim();
|
|
79
|
+
} catch {
|
|
80
|
+
return '';
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// Bearer resolution: env → env → bridge-secret → agent-memory-bearer (each file
|
|
85
|
+
// resolved secrets/ first, then bare ~/.olam/) → '' (no-op fail-open). No secret
|
|
86
|
+
// literal is embedded in source.
|
|
87
|
+
const BEARER =
|
|
88
|
+
process.env.AGENTMEMORY_BRIDGE_SECRET ||
|
|
89
|
+
process.env.OLAM_AGENT_MEMORY_BEARER ||
|
|
90
|
+
readSecretFile('bridge-secret') ||
|
|
91
|
+
readSecretFile('agent-memory-bearer') ||
|
|
92
|
+
'';
|
|
93
|
+
|
|
94
|
+
// ---------------------------------------------------------------------------
|
|
95
|
+
// E2: task-aware query derivation helpers (inlined CJS copy of src/recall-query.ts)
|
|
96
|
+
// Kept here to avoid a build step — the hook runs as raw Node.js CJS.
|
|
97
|
+
// ---------------------------------------------------------------------------
|
|
98
|
+
|
|
99
|
+
const PATH_NOISE = new Set([
|
|
100
|
+
'home', 'users', 'projects', 'src', 'packages', 'app', 'apps', 'libs',
|
|
101
|
+
'tmp', 'wt', 'olam-wt', 'work', 'workspace', 'workspaces',
|
|
102
|
+
]);
|
|
103
|
+
const BRANCH_PREFIX_RE = /^(?:fix|feat|feature|chore|hotfix|release|docs|refactor|test|ci)\//i;
|
|
104
|
+
const BRANCH_NOISE_TOKENS = new Set([
|
|
105
|
+
'update', 'patch', 'wip', 'main', 'master', 'develop', 'dev', 'staging',
|
|
106
|
+
'prod', 'production', 'hotfix', 'release', 'draft',
|
|
107
|
+
]);
|
|
108
|
+
|
|
109
|
+
function tokenize(s) {
|
|
110
|
+
return s.toLowerCase().split(/[\s\-_/\\.]+/).filter((t) => t.length > 1);
|
|
111
|
+
}
|
|
112
|
+
function cwdTokens(cwd) {
|
|
113
|
+
const parts = (cwd || '').replace(/\/$/, '').split('/').slice(-3);
|
|
114
|
+
const tokens = [];
|
|
115
|
+
for (const p of parts) {
|
|
116
|
+
for (const t of tokenize(p)) {
|
|
117
|
+
if (!PATH_NOISE.has(t)) tokens.push(t);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
return tokens;
|
|
121
|
+
}
|
|
122
|
+
function branchTokens(branch) {
|
|
123
|
+
const stripped = branch.replace(BRANCH_PREFIX_RE, '');
|
|
124
|
+
return tokenize(stripped).filter((t) => !BRANCH_NOISE_TOKENS.has(t));
|
|
125
|
+
}
|
|
126
|
+
function fileTokens(files) {
|
|
127
|
+
const SKIP = new Set(['index', 'mod', 'main', 'test', 'spec', 'types', '__tests__']);
|
|
128
|
+
const tokens = [];
|
|
129
|
+
for (const f of (files || [])) {
|
|
130
|
+
const base = f.replace(/\.[^.]+$/, '').split('/').pop() || '';
|
|
131
|
+
for (const t of tokenize(base)) {
|
|
132
|
+
if (!SKIP.has(t)) tokens.push(t);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
return tokens;
|
|
136
|
+
}
|
|
137
|
+
function dedupTokens(tokens) {
|
|
138
|
+
const seen = new Set();
|
|
139
|
+
const out = [];
|
|
140
|
+
for (const t of tokens) {
|
|
141
|
+
if (!seen.has(t)) { seen.add(t); out.push(t); }
|
|
142
|
+
}
|
|
143
|
+
return out;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Derive a task-aware recall query from the signals available at SessionStart.
|
|
148
|
+
* Priority: taskText (verbatim) > gitBranch > recentFiles > cwd terms.
|
|
149
|
+
* Mirrors the exported `deriveRecallQuery` in src/recall-query.ts.
|
|
150
|
+
*
|
|
151
|
+
* @param {object} context
|
|
152
|
+
* @param {string} context.cwd
|
|
153
|
+
* @param {string|undefined} context.gitBranch
|
|
154
|
+
* @param {string[]|undefined} context.recentFiles
|
|
155
|
+
* @param {string|undefined} context.taskText — E2 follow-on; not yet fed at SessionStart
|
|
156
|
+
* @returns {string}
|
|
157
|
+
*/
|
|
158
|
+
function deriveRecallQuery(context) {
|
|
159
|
+
const { cwd, gitBranch, recentFiles, taskText } = context;
|
|
160
|
+
if (taskText && taskText.trim().length > 0) return taskText.trim();
|
|
161
|
+
const allTokens = [];
|
|
162
|
+
if (gitBranch && gitBranch.trim().length > 0) allTokens.push(...branchTokens(gitBranch.trim()));
|
|
163
|
+
if (recentFiles && recentFiles.length > 0) allTokens.push(...fileTokens(recentFiles));
|
|
164
|
+
allTokens.push(...cwdTokens(cwd || ''));
|
|
165
|
+
const tokens = dedupTokens(allTokens).slice(0, 12);
|
|
166
|
+
return tokens.length === 0 ? 'recent work decisions architecture' : tokens.join(' ');
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Gather git signals at SessionStart (best-effort; fail-open).
|
|
171
|
+
* Returns { gitBranch, recentFiles } — either may be undefined if the
|
|
172
|
+
* git commands fail (not a git repo, git not installed, etc.).
|
|
173
|
+
*
|
|
174
|
+
* NOTE: taskText is not yet available at SessionStart (no UserPromptSubmit
|
|
175
|
+
* context here). Feeding taskText is the E2 follow-on hook; noted in the PR.
|
|
176
|
+
*
|
|
177
|
+
* @param {string} cwd
|
|
178
|
+
* @returns {{ gitBranch?: string, recentFiles?: string[] }}
|
|
179
|
+
*/
|
|
180
|
+
function gatherGitSignals(cwd) {
|
|
181
|
+
const { execSync } = require('child_process');
|
|
182
|
+
const opts = { cwd, stdio: ['pipe', 'pipe', 'pipe'], timeout: 3000 };
|
|
183
|
+
let gitBranch;
|
|
184
|
+
let recentFiles;
|
|
185
|
+
try {
|
|
186
|
+
gitBranch = execSync('git branch --show-current', opts).toString().trim() || undefined;
|
|
187
|
+
} catch (_) { /* not a git repo or git unavailable — ignore */ }
|
|
188
|
+
try {
|
|
189
|
+
const raw = execSync('git diff --name-only HEAD~3 2>/dev/null || git diff --name-only HEAD~1', opts)
|
|
190
|
+
.toString().trim();
|
|
191
|
+
recentFiles = raw ? raw.split('\n').map((f) => f.trim()).filter(Boolean).map((f) => f.split('/').pop() || f) : undefined;
|
|
192
|
+
} catch (_) { /* ignore */ }
|
|
193
|
+
return { gitBranch, recentFiles };
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
// ---------------------------------------------------------------------------
|
|
197
|
+
// (End E2 helpers)
|
|
198
|
+
// ---------------------------------------------------------------------------
|
|
199
|
+
|
|
200
|
+
// ---------------------------------------------------------------------------
|
|
201
|
+
// Phase D: recall-linkage log (inlined CJS copy of hooks/recall-log.mjs).
|
|
202
|
+
// Persists the surfaced set so the session-end citation hook can detect which
|
|
203
|
+
// surfaced memories were actually used and reinforce them. Inlined for the same
|
|
204
|
+
// no-build reason as deriveRecallQuery above; kept structurally identical to
|
|
205
|
+
// recall-log.mjs (the .mjs is the source of truth + carries the unit tests).
|
|
206
|
+
// ---------------------------------------------------------------------------
|
|
207
|
+
|
|
208
|
+
const RECALL_LOG_MAX_ENTRIES = 50;
|
|
209
|
+
const RECALL_LOG_MAX_SURFACED = 20;
|
|
210
|
+
const RECALL_LOG_MAX_EXCERPT = 240;
|
|
211
|
+
|
|
212
|
+
function recallLogSlug(s) {
|
|
213
|
+
return String(s).replace(/[^A-Za-z0-9._-]+/g, '-').replace(/^-+|-+$/g, '').slice(0, 80);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
function sessionKeyFor(event, now = new Date()) {
|
|
217
|
+
const sid = event && typeof event.session_id === 'string' ? event.session_id.trim() : '';
|
|
218
|
+
if (sid) return recallLogSlug(sid);
|
|
219
|
+
const cwd = event && typeof event.cwd === 'string' ? event.cwd : '';
|
|
220
|
+
const cwdSlug = recallLogSlug(cwd.replace(/\/+$/, '').split('/').slice(-2).join('-')) || 'session';
|
|
221
|
+
return `${cwdSlug}-${now.toISOString().slice(0, 10)}`;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
function normalizeSurfaced(surfaced) {
|
|
225
|
+
const out = [];
|
|
226
|
+
for (const m of Array.isArray(surfaced) ? surfaced : []) {
|
|
227
|
+
if (!m || typeof m !== 'object') continue;
|
|
228
|
+
const id = typeof m.id === 'string' ? m.id : typeof m.obsId === 'string' ? m.obsId : '';
|
|
229
|
+
if (!id) continue;
|
|
230
|
+
const title = typeof m.title === 'string' ? m.title : '';
|
|
231
|
+
const rawExcerpt =
|
|
232
|
+
(typeof m.excerpt === 'string' && m.excerpt) ||
|
|
233
|
+
(typeof m.contentExcerpt === 'string' && m.contentExcerpt) ||
|
|
234
|
+
(typeof m.content === 'string' && m.content) || '';
|
|
235
|
+
out.push({ id, title, excerpt: String(rawExcerpt).slice(0, RECALL_LOG_MAX_EXCERPT) });
|
|
236
|
+
if (out.length >= RECALL_LOG_MAX_SURFACED) break;
|
|
237
|
+
}
|
|
238
|
+
return out;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
function appendRecallLog(sessionKey, surfaced, now = Date.now()) {
|
|
242
|
+
const normalized = normalizeSurfaced(surfaced);
|
|
243
|
+
if (normalized.length === 0) return;
|
|
244
|
+
try {
|
|
245
|
+
const dir = path.join(os.homedir(), '.olam', 'recall-log');
|
|
246
|
+
if (!fs.existsSync(dir)) fs.mkdirSync(dir, { recursive: true });
|
|
247
|
+
const final = path.join(dir, `${recallLogSlug(sessionKey)}.json`);
|
|
248
|
+
let log = { entries: [] };
|
|
249
|
+
try {
|
|
250
|
+
const parsed = JSON.parse(fs.readFileSync(final, 'utf8'));
|
|
251
|
+
if (parsed && Array.isArray(parsed.entries)) log = parsed;
|
|
252
|
+
} catch (_) { /* fresh log */ }
|
|
253
|
+
log.entries.push({ ts: now, surfaced: normalized });
|
|
254
|
+
if (log.entries.length > RECALL_LOG_MAX_ENTRIES) {
|
|
255
|
+
log.entries = log.entries.slice(log.entries.length - RECALL_LOG_MAX_ENTRIES);
|
|
256
|
+
}
|
|
257
|
+
const tmp = `${final}.${require('crypto').randomBytes(6).toString('hex')}.tmp`;
|
|
258
|
+
fs.writeFileSync(tmp, JSON.stringify(log), 'utf8');
|
|
259
|
+
fs.renameSync(tmp, final);
|
|
260
|
+
} catch (_) {
|
|
261
|
+
// Fail-open: the linkage log is best-effort and must never block recall.
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
async function recall(query, limit = 5) {
|
|
266
|
+
const res = await fetch(`${BRIDGE_URL}/agentmemory/mcp/call`, {
|
|
267
|
+
method: 'POST',
|
|
268
|
+
headers: { Authorization: `Bearer ${BEARER}`, 'Content-Type': 'application/json' },
|
|
269
|
+
body: JSON.stringify({ name: 'memory_recall', arguments: { query, limit, format: 'compact' } }),
|
|
270
|
+
signal: AbortSignal.timeout(5000),
|
|
271
|
+
});
|
|
272
|
+
if (!res.ok) throw new Error(`HTTP ${res.status}`);
|
|
273
|
+
const body = await res.json();
|
|
274
|
+
const text = body?.content?.[0]?.text;
|
|
275
|
+
return text ? JSON.parse(text) : null;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
async function main() {
|
|
279
|
+
const raw = require('fs').readFileSync(0, 'utf8');
|
|
280
|
+
let event = {};
|
|
281
|
+
try { event = JSON.parse(raw); } catch (_) {}
|
|
282
|
+
|
|
283
|
+
// No bearer → no-op fail-open. Never throw, never block the session.
|
|
284
|
+
if (!BEARER) return;
|
|
285
|
+
|
|
286
|
+
const cwd = event?.cwd || process.cwd();
|
|
287
|
+
// E2: gather git signals (best-effort) then derive a task-aware query.
|
|
288
|
+
const { gitBranch, recentFiles } = gatherGitSignals(cwd);
|
|
289
|
+
const query = deriveRecallQuery({ cwd, gitBranch, recentFiles });
|
|
290
|
+
// taskText is not yet available at SessionStart; it will be fed in the
|
|
291
|
+
// E2 follow-on (a UserPromptSubmit hook that updates a per-session context
|
|
292
|
+
// file that this hook can read on the next session open).
|
|
293
|
+
let result;
|
|
294
|
+
try {
|
|
295
|
+
result = await recall(query);
|
|
296
|
+
} catch (err) {
|
|
297
|
+
// Fail-open: one-line breadcrumb to stderr, then continue with no output.
|
|
298
|
+
process.stderr.write(`[agentmemory-session-recall] recall failed: ${err?.message ?? err}\n`);
|
|
299
|
+
return;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
if (!result?.results?.length) return;
|
|
303
|
+
|
|
304
|
+
// Phase D: persist the surfaced set so the session-end citation hook can
|
|
305
|
+
// detect which of these memories were actually used and reinforce them.
|
|
306
|
+
// Best-effort — never blocks recall.
|
|
307
|
+
appendRecallLog(sessionKeyFor(event), result.results);
|
|
308
|
+
|
|
309
|
+
const lines = result.results
|
|
310
|
+
.map((r, i) => `${i + 1}. [id ${r.obsId || r.id}] [score ${r.score?.toFixed(2) ?? '?'}] ${r.title || r.obsId}`)
|
|
311
|
+
.join('\n');
|
|
312
|
+
|
|
313
|
+
// Phase D nudge: close the agent-native reinforcement loop. If the agent acts
|
|
314
|
+
// on a recalled memory, it should call memory_reinforce(id) so the system
|
|
315
|
+
// learns the memory was useful (writes last_reinforced_at → the usage/recency
|
|
316
|
+
// ranking lift engages next session). Kept to one line to avoid bloating the
|
|
317
|
+
// injected context.
|
|
318
|
+
const nudge =
|
|
319
|
+
'If you act on any memory above, call `memory_reinforce` with its id so the system learns it was useful.';
|
|
320
|
+
|
|
321
|
+
const additionalContext =
|
|
322
|
+
`## Recalled from agent memory (query: "${query}")\n\n${lines}\n\n${nudge}`;
|
|
323
|
+
|
|
324
|
+
process.stdout.write(JSON.stringify({
|
|
325
|
+
hookSpecificOutput: {
|
|
326
|
+
hookEventName: 'SessionStart',
|
|
327
|
+
additionalContext,
|
|
328
|
+
}
|
|
329
|
+
}));
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
main().catch(() => process.exit(0));
|