hippo-memory 1.44.0 → 1.45.0
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 +12 -10
- package/bin/hippo.js +3 -1
- package/dist/api.d.ts +21 -21
- package/dist/api.js +69 -42
- package/dist/audit.d.ts +1 -1
- package/dist/audit.js +9 -0
- package/dist/autolearn.d.ts +1 -1
- package/dist/autolearn.js +2 -1
- package/dist/cli.d.ts +3 -0
- package/dist/cli.js +151 -72
- package/dist/client.d.ts +4 -21
- package/dist/client.js +3 -112
- package/dist/config.js +2 -1
- package/dist/consolidate.d.ts +3 -0
- package/dist/consolidate.js +44 -42
- package/dist/dag.d.ts +1 -0
- package/dist/dag.js +10 -5
- package/dist/dashboard.js +7 -3
- package/dist/db.js +12 -23
- package/dist/dedupe.d.ts +1 -0
- package/dist/dedupe.js +4 -7
- package/dist/embedding-provider.js +2 -1
- package/dist/embeddings.js +81 -8
- package/dist/extract.d.ts +2 -0
- package/dist/extract.js +9 -4
- package/dist/mcp/server.js +21 -36
- package/dist/memory.d.ts +3 -0
- package/dist/memory.js +7 -1
- package/dist/refine-llm.js +3 -2
- package/dist/rerankers/jev.js +3 -2
- package/dist/rerankers/llm.js +3 -2
- package/dist/search.js +3 -3
- package/dist/server.d.ts +5 -0
- package/dist/server.js +39 -29
- package/dist/shared.js +1 -1
- package/dist/store.d.ts +18 -11
- package/dist/store.js +144 -63
- package/dist/version.d.ts +4 -6
- package/dist/version.js +4 -7
- package/extensions/openclaw-plugin/openclaw.plugin.json +1 -1
- package/extensions/openclaw-plugin/package.json +1 -1
- package/openclaw.plugin.json +1 -1
- package/package.json +6 -3
- package/dist/ablation.d.ts.map +0 -1
- package/dist/ablation.js.map +0 -1
- package/dist/ambient.d.ts.map +0 -1
- package/dist/ambient.js.map +0 -1
- package/dist/api.d.ts.map +0 -1
- package/dist/api.js.map +0 -1
- package/dist/audit-prune.d.ts.map +0 -1
- package/dist/audit-prune.js.map +0 -1
- package/dist/audit.d.ts.map +0 -1
- package/dist/audit.js.map +0 -1
- package/dist/auth.d.ts.map +0 -1
- package/dist/auth.js.map +0 -1
- package/dist/autolearn.d.ts.map +0 -1
- package/dist/autolearn.js.map +0 -1
- package/dist/availability.d.ts.map +0 -1
- package/dist/availability.js.map +0 -1
- package/dist/benchmarks/e1.3/incident-recall-eval.js +0 -78
- package/dist/benchmarks/e1.3/incident-recall-eval.js.map +0 -1
- package/dist/benchmarks/e1.3/slack-1000-event-smoke.js +0 -103
- package/dist/benchmarks/e1.3/slack-1000-event-smoke.js.map +0 -1
- package/dist/capture.d.ts.map +0 -1
- package/dist/capture.js.map +0 -1
- package/dist/card-detail.d.ts.map +0 -1
- package/dist/card-detail.js.map +0 -1
- package/dist/card.d.ts.map +0 -1
- package/dist/card.js.map +0 -1
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js.map +0 -1
- package/dist/client.d.ts.map +0 -1
- package/dist/client.js.map +0 -1
- package/dist/compare.d.ts.map +0 -1
- package/dist/compare.js.map +0 -1
- package/dist/config.d.ts.map +0 -1
- package/dist/config.js.map +0 -1
- package/dist/connectors/github/backfill.d.ts.map +0 -1
- package/dist/connectors/github/backfill.js.map +0 -1
- package/dist/connectors/github/cli-impl.d.ts.map +0 -1
- package/dist/connectors/github/cli-impl.js.map +0 -1
- package/dist/connectors/github/deletion.d.ts.map +0 -1
- package/dist/connectors/github/deletion.js.map +0 -1
- package/dist/connectors/github/dlq.d.ts.map +0 -1
- package/dist/connectors/github/dlq.js.map +0 -1
- package/dist/connectors/github/idempotency.d.ts.map +0 -1
- package/dist/connectors/github/idempotency.js.map +0 -1
- package/dist/connectors/github/ingest.d.ts.map +0 -1
- package/dist/connectors/github/ingest.js.map +0 -1
- package/dist/connectors/github/octokit-client.d.ts.map +0 -1
- package/dist/connectors/github/octokit-client.js.map +0 -1
- package/dist/connectors/github/ratelimit.d.ts.map +0 -1
- package/dist/connectors/github/ratelimit.js.map +0 -1
- package/dist/connectors/github/scope.d.ts.map +0 -1
- package/dist/connectors/github/scope.js.map +0 -1
- package/dist/connectors/github/signature.d.ts.map +0 -1
- package/dist/connectors/github/signature.js.map +0 -1
- package/dist/connectors/github/tenant-routing.d.ts.map +0 -1
- package/dist/connectors/github/tenant-routing.js.map +0 -1
- package/dist/connectors/github/transform.d.ts.map +0 -1
- package/dist/connectors/github/transform.js.map +0 -1
- package/dist/connectors/github/types.d.ts.map +0 -1
- package/dist/connectors/github/types.js.map +0 -1
- package/dist/connectors/slack/backfill.d.ts.map +0 -1
- package/dist/connectors/slack/backfill.js.map +0 -1
- package/dist/connectors/slack/deletion.d.ts.map +0 -1
- package/dist/connectors/slack/deletion.js.map +0 -1
- package/dist/connectors/slack/dlq.d.ts.map +0 -1
- package/dist/connectors/slack/dlq.js.map +0 -1
- package/dist/connectors/slack/idempotency.d.ts.map +0 -1
- package/dist/connectors/slack/idempotency.js.map +0 -1
- package/dist/connectors/slack/ingest.d.ts.map +0 -1
- package/dist/connectors/slack/ingest.js.map +0 -1
- package/dist/connectors/slack/ratelimit.d.ts.map +0 -1
- package/dist/connectors/slack/ratelimit.js.map +0 -1
- package/dist/connectors/slack/scope.d.ts.map +0 -1
- package/dist/connectors/slack/scope.js.map +0 -1
- package/dist/connectors/slack/signature.d.ts.map +0 -1
- package/dist/connectors/slack/signature.js.map +0 -1
- package/dist/connectors/slack/tenant-routing.d.ts.map +0 -1
- package/dist/connectors/slack/tenant-routing.js.map +0 -1
- package/dist/connectors/slack/transform.d.ts.map +0 -1
- package/dist/connectors/slack/transform.js.map +0 -1
- package/dist/connectors/slack/types.d.ts.map +0 -1
- package/dist/connectors/slack/types.js.map +0 -1
- package/dist/connectors/slack/web-client.d.ts.map +0 -1
- package/dist/connectors/slack/web-client.js.map +0 -1
- package/dist/connectors/slack/workspaces.d.ts.map +0 -1
- package/dist/connectors/slack/workspaces.js.map +0 -1
- package/dist/consolidate.d.ts.map +0 -1
- package/dist/consolidate.js.map +0 -1
- package/dist/correction-latency.d.ts.map +0 -1
- package/dist/correction-latency.js.map +0 -1
- package/dist/customer-notes.d.ts.map +0 -1
- package/dist/customer-notes.js.map +0 -1
- package/dist/dag.d.ts.map +0 -1
- package/dist/dag.js.map +0 -1
- package/dist/dashboard.d.ts.map +0 -1
- package/dist/dashboard.js.map +0 -1
- package/dist/db.d.ts.map +0 -1
- package/dist/db.js.map +0 -1
- package/dist/decisions.d.ts.map +0 -1
- package/dist/decisions.js.map +0 -1
- package/dist/dedupe.d.ts.map +0 -1
- package/dist/dedupe.js.map +0 -1
- package/dist/embedding-provider.d.ts.map +0 -1
- package/dist/embedding-provider.js.map +0 -1
- package/dist/embeddings.d.ts.map +0 -1
- package/dist/embeddings.js.map +0 -1
- package/dist/eval-suite.d.ts.map +0 -1
- package/dist/eval-suite.js.map +0 -1
- package/dist/eval.d.ts.map +0 -1
- package/dist/eval.js.map +0 -1
- package/dist/extensions/openclaw-plugin/index.js.map +0 -1
- package/dist/extract.d.ts.map +0 -1
- package/dist/extract.js.map +0 -1
- package/dist/forward-claim-detector.d.ts.map +0 -1
- package/dist/forward-claim-detector.js.map +0 -1
- package/dist/goals.d.ts.map +0 -1
- package/dist/goals.js.map +0 -1
- package/dist/graph-extract.d.ts.map +0 -1
- package/dist/graph-extract.js.map +0 -1
- package/dist/graph-recall.d.ts.map +0 -1
- package/dist/graph-recall.js.map +0 -1
- package/dist/graph-stream.d.ts.map +0 -1
- package/dist/graph-stream.js.map +0 -1
- package/dist/graph-view.d.ts.map +0 -1
- package/dist/graph-view.js.map +0 -1
- package/dist/graph.d.ts.map +0 -1
- package/dist/graph.js.map +0 -1
- package/dist/handoff.d.ts.map +0 -1
- package/dist/handoff.js.map +0 -1
- package/dist/hooks.d.ts.map +0 -1
- package/dist/hooks.js.map +0 -1
- package/dist/importers.d.ts.map +0 -1
- package/dist/importers.js.map +0 -1
- package/dist/incidents.d.ts.map +0 -1
- package/dist/incidents.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/invalidation.d.ts.map +0 -1
- package/dist/invalidation.js.map +0 -1
- package/dist/mcp/framing.d.ts.map +0 -1
- package/dist/mcp/framing.js.map +0 -1
- package/dist/mcp/server.d.ts.map +0 -1
- package/dist/mcp/server.js.map +0 -1
- package/dist/memory-value-weights.d.ts.map +0 -1
- package/dist/memory-value-weights.js.map +0 -1
- package/dist/memory-value.d.ts.map +0 -1
- package/dist/memory-value.js.map +0 -1
- package/dist/memory.d.ts.map +0 -1
- package/dist/memory.js.map +0 -1
- package/dist/multihop.d.ts.map +0 -1
- package/dist/multihop.js.map +0 -1
- package/dist/owner-validation.d.ts.map +0 -1
- package/dist/owner-validation.js.map +0 -1
- package/dist/path-context.d.ts.map +0 -1
- package/dist/path-context.js.map +0 -1
- package/dist/physics-config.d.ts.map +0 -1
- package/dist/physics-config.js.map +0 -1
- package/dist/physics-state.d.ts.map +0 -1
- package/dist/physics-state.js.map +0 -1
- package/dist/physics.d.ts.map +0 -1
- package/dist/physics.js.map +0 -1
- package/dist/policies.d.ts.map +0 -1
- package/dist/policies.js.map +0 -1
- package/dist/postinstall.d.ts.map +0 -1
- package/dist/postinstall.js.map +0 -1
- package/dist/predictions.d.ts.map +0 -1
- package/dist/predictions.js.map +0 -1
- package/dist/processes.d.ts.map +0 -1
- package/dist/processes.js.map +0 -1
- package/dist/project-briefs.d.ts.map +0 -1
- package/dist/project-briefs.js.map +0 -1
- package/dist/project-identity.d.ts.map +0 -1
- package/dist/project-identity.js.map +0 -1
- package/dist/provenance-coverage.d.ts.map +0 -1
- package/dist/provenance-coverage.js.map +0 -1
- package/dist/rate-limit.d.ts.map +0 -1
- package/dist/rate-limit.js.map +0 -1
- package/dist/raw-archive-mirror-cleanup.d.ts.map +0 -1
- package/dist/raw-archive-mirror-cleanup.js.map +0 -1
- package/dist/raw-archive.d.ts.map +0 -1
- package/dist/raw-archive.js.map +0 -1
- package/dist/recall-history.d.ts.map +0 -1
- package/dist/recall-history.js.map +0 -1
- package/dist/recall-scope.d.ts.map +0 -1
- package/dist/recall-scope.js.map +0 -1
- package/dist/recall-trace.d.ts.map +0 -1
- package/dist/recall-trace.js.map +0 -1
- package/dist/refine-llm.d.ts.map +0 -1
- package/dist/refine-llm.js.map +0 -1
- package/dist/reject-flow.d.ts.map +0 -1
- package/dist/reject-flow.js.map +0 -1
- package/dist/rejection.d.ts.map +0 -1
- package/dist/rejection.js.map +0 -1
- package/dist/replay.d.ts.map +0 -1
- package/dist/replay.js.map +0 -1
- package/dist/rerankers/cross-encoder.d.ts.map +0 -1
- package/dist/rerankers/cross-encoder.js.map +0 -1
- package/dist/rerankers/index.d.ts.map +0 -1
- package/dist/rerankers/index.js.map +0 -1
- package/dist/rerankers/jev.d.ts.map +0 -1
- package/dist/rerankers/jev.js.map +0 -1
- package/dist/rerankers/llm.d.ts.map +0 -1
- package/dist/rerankers/llm.js.map +0 -1
- package/dist/rerankers/types.d.ts.map +0 -1
- package/dist/rerankers/types.js.map +0 -1
- package/dist/rrf.d.ts.map +0 -1
- package/dist/rrf.js.map +0 -1
- package/dist/salience.d.ts.map +0 -1
- package/dist/salience.js.map +0 -1
- package/dist/scheduler.d.ts.map +0 -1
- package/dist/scheduler.js.map +0 -1
- package/dist/scope.d.ts.map +0 -1
- package/dist/scope.js.map +0 -1
- package/dist/search.d.ts.map +0 -1
- package/dist/search.js.map +0 -1
- package/dist/secret-detect.d.ts.map +0 -1
- package/dist/secret-detect.js.map +0 -1
- package/dist/server-detect.d.ts.map +0 -1
- package/dist/server-detect.js.map +0 -1
- package/dist/server.d.ts.map +0 -1
- package/dist/server.js.map +0 -1
- package/dist/shared.d.ts.map +0 -1
- package/dist/shared.js.map +0 -1
- package/dist/skills.d.ts.map +0 -1
- package/dist/skills.js.map +0 -1
- package/dist/sleep-redact.d.ts +0 -58
- package/dist/sleep-redact.d.ts.map +0 -1
- package/dist/sleep-redact.js +0 -80
- package/dist/sleep-redact.js.map +0 -1
- package/dist/src/ablation.js +0 -138
- package/dist/src/ablation.js.map +0 -1
- package/dist/src/ambient.js +0 -148
- package/dist/src/ambient.js.map +0 -1
- package/dist/src/api.js +0 -2109
- package/dist/src/api.js.map +0 -1
- package/dist/src/audit-prune.js +0 -109
- package/dist/src/audit-prune.js.map +0 -1
- package/dist/src/audit.js +0 -213
- package/dist/src/audit.js.map +0 -1
- package/dist/src/auth.js +0 -97
- package/dist/src/auth.js.map +0 -1
- package/dist/src/autolearn.js +0 -174
- package/dist/src/autolearn.js.map +0 -1
- package/dist/src/availability.js +0 -94
- package/dist/src/availability.js.map +0 -1
- package/dist/src/capture.js +0 -1346
- package/dist/src/capture.js.map +0 -1
- package/dist/src/card-detail.js +0 -15
- package/dist/src/card-detail.js.map +0 -1
- package/dist/src/card.js +0 -19
- package/dist/src/card.js.map +0 -1
- package/dist/src/cli.js +0 -9387
- package/dist/src/cli.js.map +0 -1
- package/dist/src/client.js +0 -237
- package/dist/src/client.js.map +0 -1
- package/dist/src/compare.js +0 -122
- package/dist/src/compare.js.map +0 -1
- package/dist/src/config.js +0 -135
- package/dist/src/config.js.map +0 -1
- package/dist/src/connectors/github/backfill.js +0 -281
- package/dist/src/connectors/github/backfill.js.map +0 -1
- package/dist/src/connectors/github/cli-impl.js +0 -234
- package/dist/src/connectors/github/cli-impl.js.map +0 -1
- package/dist/src/connectors/github/deletion.js +0 -85
- package/dist/src/connectors/github/deletion.js.map +0 -1
- package/dist/src/connectors/github/dlq.js +0 -190
- package/dist/src/connectors/github/dlq.js.map +0 -1
- package/dist/src/connectors/github/idempotency.js +0 -27
- package/dist/src/connectors/github/idempotency.js.map +0 -1
- package/dist/src/connectors/github/ingest.js +0 -156
- package/dist/src/connectors/github/ingest.js.map +0 -1
- package/dist/src/connectors/github/octokit-client.js +0 -70
- package/dist/src/connectors/github/octokit-client.js.map +0 -1
- package/dist/src/connectors/github/ratelimit.js +0 -31
- package/dist/src/connectors/github/ratelimit.js.map +0 -1
- package/dist/src/connectors/github/scope.js +0 -13
- package/dist/src/connectors/github/scope.js.map +0 -1
- package/dist/src/connectors/github/signature.js +0 -81
- package/dist/src/connectors/github/signature.js.map +0 -1
- package/dist/src/connectors/github/tenant-routing.js +0 -69
- package/dist/src/connectors/github/tenant-routing.js.map +0 -1
- package/dist/src/connectors/github/transform.js +0 -103
- package/dist/src/connectors/github/transform.js.map +0 -1
- package/dist/src/connectors/github/types.js +0 -100
- package/dist/src/connectors/github/types.js.map +0 -1
- package/dist/src/connectors/slack/backfill.js +0 -78
- package/dist/src/connectors/slack/backfill.js.map +0 -1
- package/dist/src/connectors/slack/deletion.js +0 -59
- package/dist/src/connectors/slack/deletion.js.map +0 -1
- package/dist/src/connectors/slack/dlq.js +0 -224
- package/dist/src/connectors/slack/dlq.js.map +0 -1
- package/dist/src/connectors/slack/idempotency.js +0 -31
- package/dist/src/connectors/slack/idempotency.js.map +0 -1
- package/dist/src/connectors/slack/ingest.js +0 -109
- package/dist/src/connectors/slack/ingest.js.map +0 -1
- package/dist/src/connectors/slack/ratelimit.js +0 -18
- package/dist/src/connectors/slack/ratelimit.js.map +0 -1
- package/dist/src/connectors/slack/scope.js +0 -13
- package/dist/src/connectors/slack/scope.js.map +0 -1
- package/dist/src/connectors/slack/signature.js +0 -27
- package/dist/src/connectors/slack/signature.js.map +0 -1
- package/dist/src/connectors/slack/tenant-routing.js +0 -41
- package/dist/src/connectors/slack/tenant-routing.js.map +0 -1
- package/dist/src/connectors/slack/transform.js +0 -47
- package/dist/src/connectors/slack/transform.js.map +0 -1
- package/dist/src/connectors/slack/types.js +0 -35
- package/dist/src/connectors/slack/types.js.map +0 -1
- package/dist/src/connectors/slack/web-client.js +0 -43
- package/dist/src/connectors/slack/web-client.js.map +0 -1
- package/dist/src/connectors/slack/workspaces.js +0 -62
- package/dist/src/connectors/slack/workspaces.js.map +0 -1
- package/dist/src/consolidate.js +0 -978
- package/dist/src/consolidate.js.map +0 -1
- package/dist/src/correction-latency.js +0 -74
- package/dist/src/correction-latency.js.map +0 -1
- package/dist/src/customer-notes.js +0 -325
- package/dist/src/customer-notes.js.map +0 -1
- package/dist/src/dag.js +0 -352
- package/dist/src/dag.js.map +0 -1
- package/dist/src/dashboard.js +0 -258
- package/dist/src/dashboard.js.map +0 -1
- package/dist/src/db.js +0 -2731
- package/dist/src/db.js.map +0 -1
- package/dist/src/decisions.js +0 -304
- package/dist/src/decisions.js.map +0 -1
- package/dist/src/dedupe.js +0 -141
- package/dist/src/dedupe.js.map +0 -1
- package/dist/src/embedding-provider.js +0 -314
- package/dist/src/embedding-provider.js.map +0 -1
- package/dist/src/embeddings.js +0 -543
- package/dist/src/embeddings.js.map +0 -1
- package/dist/src/eval-suite.js +0 -294
- package/dist/src/eval-suite.js.map +0 -1
- package/dist/src/eval.js +0 -187
- package/dist/src/eval.js.map +0 -1
- package/dist/src/extract.js +0 -117
- package/dist/src/extract.js.map +0 -1
- package/dist/src/forward-claim-detector.js +0 -117
- package/dist/src/forward-claim-detector.js.map +0 -1
- package/dist/src/goals.js +0 -399
- package/dist/src/goals.js.map +0 -1
- package/dist/src/graph-extract.js +0 -314
- package/dist/src/graph-extract.js.map +0 -1
- package/dist/src/graph-recall.js +0 -277
- package/dist/src/graph-recall.js.map +0 -1
- package/dist/src/graph-stream.js +0 -176
- package/dist/src/graph-stream.js.map +0 -1
- package/dist/src/graph-view.js +0 -310
- package/dist/src/graph-view.js.map +0 -1
- package/dist/src/graph.js +0 -762
- package/dist/src/graph.js.map +0 -1
- package/dist/src/handoff.js +0 -65
- package/dist/src/handoff.js.map +0 -1
- package/dist/src/hooks.js +0 -926
- package/dist/src/hooks.js.map +0 -1
- package/dist/src/importers.js +0 -881
- package/dist/src/importers.js.map +0 -1
- package/dist/src/incidents.js +0 -336
- package/dist/src/incidents.js.map +0 -1
- package/dist/src/index.js +0 -32
- package/dist/src/index.js.map +0 -1
- package/dist/src/invalidation.js +0 -129
- package/dist/src/invalidation.js.map +0 -1
- package/dist/src/mcp/framing.js +0 -45
- package/dist/src/mcp/framing.js.map +0 -1
- package/dist/src/mcp/server.js +0 -1298
- package/dist/src/mcp/server.js.map +0 -1
- package/dist/src/memory-value-weights.js +0 -31
- package/dist/src/memory-value-weights.js.map +0 -1
- package/dist/src/memory-value.js +0 -261
- package/dist/src/memory-value.js.map +0 -1
- package/dist/src/memory.js +0 -425
- package/dist/src/memory.js.map +0 -1
- package/dist/src/multihop.js +0 -35
- package/dist/src/multihop.js.map +0 -1
- package/dist/src/owner-validation.js +0 -56
- package/dist/src/owner-validation.js.map +0 -1
- package/dist/src/path-context.js +0 -48
- package/dist/src/path-context.js.map +0 -1
- package/dist/src/physics-config.js +0 -26
- package/dist/src/physics-config.js.map +0 -1
- package/dist/src/physics-state.js +0 -172
- package/dist/src/physics-state.js.map +0 -1
- package/dist/src/physics.js +0 -378
- package/dist/src/physics.js.map +0 -1
- package/dist/src/policies.js +0 -414
- package/dist/src/policies.js.map +0 -1
- package/dist/src/postinstall.js +0 -101
- package/dist/src/postinstall.js.map +0 -1
- package/dist/src/predictions.js +0 -629
- package/dist/src/predictions.js.map +0 -1
- package/dist/src/processes.js +0 -349
- package/dist/src/processes.js.map +0 -1
- package/dist/src/project-briefs.js +0 -492
- package/dist/src/project-briefs.js.map +0 -1
- package/dist/src/project-identity.js +0 -200
- package/dist/src/project-identity.js.map +0 -1
- package/dist/src/provenance-coverage.js +0 -23
- package/dist/src/provenance-coverage.js.map +0 -1
- package/dist/src/rate-limit.js +0 -60
- package/dist/src/rate-limit.js.map +0 -1
- package/dist/src/raw-archive-mirror-cleanup.js +0 -55
- package/dist/src/raw-archive-mirror-cleanup.js.map +0 -1
- package/dist/src/raw-archive.js +0 -91
- package/dist/src/raw-archive.js.map +0 -1
- package/dist/src/recall-history.js +0 -235
- package/dist/src/recall-history.js.map +0 -1
- package/dist/src/recall-scope.js +0 -89
- package/dist/src/recall-scope.js.map +0 -1
- package/dist/src/recall-trace.js +0 -186
- package/dist/src/recall-trace.js.map +0 -1
- package/dist/src/refine-llm.js +0 -156
- package/dist/src/refine-llm.js.map +0 -1
- package/dist/src/reject-flow.js +0 -209
- package/dist/src/reject-flow.js.map +0 -1
- package/dist/src/rejection.js +0 -160
- package/dist/src/rejection.js.map +0 -1
- package/dist/src/replay.js +0 -122
- package/dist/src/replay.js.map +0 -1
- package/dist/src/rerankers/cross-encoder.js +0 -137
- package/dist/src/rerankers/cross-encoder.js.map +0 -1
- package/dist/src/rerankers/index.js +0 -20
- package/dist/src/rerankers/index.js.map +0 -1
- package/dist/src/rerankers/jev.js +0 -119
- package/dist/src/rerankers/jev.js.map +0 -1
- package/dist/src/rerankers/llm.js +0 -80
- package/dist/src/rerankers/llm.js.map +0 -1
- package/dist/src/rerankers/types.js +0 -2
- package/dist/src/rerankers/types.js.map +0 -1
- package/dist/src/rrf.js +0 -61
- package/dist/src/rrf.js.map +0 -1
- package/dist/src/salience.js +0 -74
- package/dist/src/salience.js.map +0 -1
- package/dist/src/scheduler.js +0 -77
- package/dist/src/scheduler.js.map +0 -1
- package/dist/src/scope.js +0 -35
- package/dist/src/scope.js.map +0 -1
- package/dist/src/search.js +0 -1003
- package/dist/src/search.js.map +0 -1
- package/dist/src/secret-detect.js +0 -95
- package/dist/src/secret-detect.js.map +0 -1
- package/dist/src/server-detect.js +0 -231
- package/dist/src/server-detect.js.map +0 -1
- package/dist/src/server.js +0 -3255
- package/dist/src/server.js.map +0 -1
- package/dist/src/shared.js +0 -502
- package/dist/src/shared.js.map +0 -1
- package/dist/src/skills.js +0 -346
- package/dist/src/skills.js.map +0 -1
- package/dist/src/sleep-redact.js +0 -80
- package/dist/src/sleep-redact.js.map +0 -1
- package/dist/src/sso.js +0 -22
- package/dist/src/sso.js.map +0 -1
- package/dist/src/stdin.js +0 -41
- package/dist/src/stdin.js.map +0 -1
- package/dist/src/store.js +0 -3749
- package/dist/src/store.js.map +0 -1
- package/dist/src/tenant.js +0 -17
- package/dist/src/tenant.js.map +0 -1
- package/dist/src/trace.js +0 -72
- package/dist/src/trace.js.map +0 -1
- package/dist/src/version.js +0 -40
- package/dist/src/version.js.map +0 -1
- package/dist/src/working-memory.js +0 -157
- package/dist/src/working-memory.js.map +0 -1
- package/dist/src/yaml.js +0 -107
- package/dist/src/yaml.js.map +0 -1
- package/dist/sso.d.ts +0 -13
- package/dist/sso.d.ts.map +0 -1
- package/dist/sso.js +0 -22
- package/dist/sso.js.map +0 -1
- package/dist/stdin.d.ts.map +0 -1
- package/dist/stdin.js.map +0 -1
- package/dist/store.d.ts.map +0 -1
- package/dist/store.js.map +0 -1
- package/dist/tenant.d.ts.map +0 -1
- package/dist/tenant.js.map +0 -1
- package/dist/trace.d.ts.map +0 -1
- package/dist/trace.js.map +0 -1
- package/dist/version.d.ts.map +0 -1
- package/dist/version.js.map +0 -1
- package/dist/working-memory.d.ts.map +0 -1
- package/dist/working-memory.js.map +0 -1
- package/dist/yaml.d.ts.map +0 -1
- package/dist/yaml.js.map +0 -1
package/dist/cli.js
CHANGED
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
* hippo decide "<decision>" [--context "<why>"] [--supersedes <id>]
|
|
30
30
|
* hippo wm <push|read|clear|flush>
|
|
31
31
|
*/
|
|
32
|
-
import { evalNow
|
|
32
|
+
import { evalNow } from './ablation.js';
|
|
33
33
|
import * as path from 'path';
|
|
34
34
|
import * as fs from 'fs';
|
|
35
35
|
import * as os from 'os';
|
|
@@ -38,14 +38,14 @@ import { execFileSync, execSync, spawn } from 'child_process';
|
|
|
38
38
|
import { installJsonHooks, uninstallJsonHooks, resolveJsonHookPaths, detectInstalledTools, defaultSleepLogPath, ensureCodexWrapperInstalled, installCodexWrapper, isCodexWrapperInstalled, repairCodexWrapperIfInstalled, uninstallCodexWrapper, resolveCodexSessionTranscript, resolveCodexWrapperPaths, installOpencodePlugin, uninstallOpencodePlugin, resolveOpencodePluginPath, } from './hooks.js';
|
|
39
39
|
import { createMemory, calculateStrength, calculateRewardFactor, deriveHalfLife, resolveConfidence, confidenceFacets, confidenceLabel, computeSchemaFit, Layer, } from './memory.js';
|
|
40
40
|
import { detectSecret } from './secret-detect.js';
|
|
41
|
-
import { getHippoRoot, isInitialized, initStore, writeEntry, readEntry, deleteEntry, loadAllEntries, loadSearchEntries, loadRecallSearchEntries, loadIndex, saveIndex, loadStats, updateStats, saveActiveTaskSnapshot, loadActiveTaskSnapshot, closeTaskSnapshotsForSession, clearActiveTaskSnapshot, appendSessionEvent, listSessionEvents, listMemoryConflicts, resolveConflict, saveSessionHandoff, loadLatestHandoff, loadHandoffById, stampHandoffOutcome, writeSessionEndHandoff, createCard, loadCard, listCards, loadCardRuns, claimCard, heartbeatCard, blockCard, reviewCard, completeCard, reclaimExpiredCards, addCardComment, } from './store.js';
|
|
41
|
+
import { getHippoRoot, isInitialized, initStore, writeEntry, strengthenRetrieved, readEntry, deleteEntry, loadAllEntries, loadSearchEntries, loadRecallSearchEntries, loadIndex, saveIndex, loadStats, updateStats, saveActiveTaskSnapshot, loadActiveTaskSnapshot, closeTaskSnapshotsForSession, clearActiveTaskSnapshot, appendSessionEvent, listSessionEvents, listMemoryConflicts, resolveConflict, saveSessionHandoff, loadLatestHandoff, loadHandoffById, stampHandoffOutcome, writeSessionEndHandoff, createCard, loadCard, listCards, loadCardRuns, claimCard, heartbeatCard, blockCard, reviewCard, completeCard, reclaimExpiredCards, addCardComment, } from './store.js';
|
|
42
42
|
import { rejectValue, unrejectValue, listRejectionsForTenant } from './reject-flow.js';
|
|
43
43
|
import { RejectedValueError } from './rejection.js';
|
|
44
44
|
import { isHandoffOutcome, formatHandoffEvidenceLine } from './handoff.js';
|
|
45
45
|
import { isCardStatus } from './card.js';
|
|
46
46
|
import { loadCardDetail } from './card-detail.js';
|
|
47
47
|
import { passesScopeFilterForRecall } from './recall-scope.js';
|
|
48
|
-
import {
|
|
48
|
+
import { hybridSearch, physicsSearch, explainMatch, textOverlap, tokenize as tokenizeQuery } from './search.js';
|
|
49
49
|
import { compareEntryIdentity } from './compare.js';
|
|
50
50
|
import { renderTraceContent, parseSteps } from './trace.js';
|
|
51
51
|
import { writeRecallTraceAtRoot } from './recall-trace.js';
|
|
@@ -195,8 +195,8 @@ function requireInit(hippoRoot) {
|
|
|
195
195
|
* H2: when HIPPO_REQUIRE_SERVER is set, the CLI must not silently fall back to
|
|
196
196
|
* direct DB mode — a missing server then masks a real misconfiguration (the
|
|
197
197
|
* configured HIPPO_API_KEY is also silently discarded on fallback). Throws a
|
|
198
|
-
* clear
|
|
199
|
-
*
|
|
198
|
+
* clear error then. It guards only the routed writes (remember, forget, archive,
|
|
199
|
+
* promote); every other command opens the store directly, knob or not.
|
|
200
200
|
*/
|
|
201
201
|
function failIfServerRequired(reason) {
|
|
202
202
|
if (process.env['HIPPO_REQUIRE_SERVER']) {
|
|
@@ -263,6 +263,42 @@ export const BOOLEAN_FLAGS = new Set([
|
|
|
263
263
|
'reset-physics', 'save-baseline', 'show-cases', 'stats', 'stdin',
|
|
264
264
|
'strict', 'suite', 'value-aware', 'verified', 'version', 'why',
|
|
265
265
|
]);
|
|
266
|
+
// Every flag some command reads. Anything else is a typo that no command would act on.
|
|
267
|
+
export const KNOWN_FLAGS = new Set([
|
|
268
|
+
...BOOLEAN_FLAGS,
|
|
269
|
+
'actual', 'artifact', 'artifact-ref', 'as-of', 'author', 'baseline', 'body', 'budget', 'card-id',
|
|
270
|
+
'change', 'channel', 'chatgpt', 'class', 'claude', 'codex-home', 'compare', 'constraint', 'content',
|
|
271
|
+
'context', 'contract', 'cursor', 'customer', 'days', 'depends-on', 'depth', 'description',
|
|
272
|
+
'embedding-weight', 'entity', 'estimate', 'file', 'format', 'framing', 'fresh-tail', 'from', 'goal',
|
|
273
|
+
'graph-hops', 'graph-seeds', 'history-path', 'hops', 'host', 'id', 'importance', 'include-recent',
|
|
274
|
+
'instructions', 'keep', 'kind', 'label', 'layer', 'level', 'limit', 'link', 'local-bump', 'log-file',
|
|
275
|
+
'markdown', 'max', 'max-cases', 'max-neighbors', 'min-mrr', 'min-results', 'min-score', 'mmr-lambda',
|
|
276
|
+
'model', 'name', 'next', 'next-step', 'note', 'older-than', 'op', 'out', 'outcome', 'owner', 'parent',
|
|
277
|
+
'path', 'policy', 'port', 'reason', 'repo', 'repos', 'reranker', 'reranker-top-k', 'resolution',
|
|
278
|
+
'role', 'run', 'runtime', 'salience-threshold', 'scan', 'scope', 'session', 'session-id', 'since',
|
|
279
|
+
'source', 'start-offset', 'started-at', 'state', 'status', 'step', 'steps', 'success', 'summary',
|
|
280
|
+
'supersedes', 'tag', 'target', 'target-runtime', 'task', 'team', 'tenant', 'tenant-id', 'tests',
|
|
281
|
+
'text', 'threshold', 'title', 'to', 'transcript', 'trigger', 'type', 'unit', 'value', 'vault',
|
|
282
|
+
]);
|
|
283
|
+
// Commands that delete or hide memories: an unknown flag here stops the run instead of being ignored.
|
|
284
|
+
const DESTRUCTIVE_COMMANDS = new Set([
|
|
285
|
+
'audit', 'dedup', 'forget', 'invalidate', 'reject', 'resolve', 'sleep', 'supersede',
|
|
286
|
+
]);
|
|
287
|
+
// Commands that honour --dry-run. Any other command would ignore it and run for real.
|
|
288
|
+
const DRY_RUN_COMMANDS = new Set([
|
|
289
|
+
'audit', 'capture', 'dedup', 'forget', 'import', 'invalidate', 'refine', 'setup', 'sleep',
|
|
290
|
+
]);
|
|
291
|
+
// share and brief honour --dry-run in one form only; their other forms write for real.
|
|
292
|
+
function dryRunRefusal(command, args, flags) {
|
|
293
|
+
const isBrief = command === 'brief' || command === 'project-brief';
|
|
294
|
+
const onlyForm = command === 'share' ? 'share --auto' : isBrief ? `${command} refresh` : null;
|
|
295
|
+
const honoured = command === 'share' ? args[0] === '--auto' || Boolean(flags['auto'])
|
|
296
|
+
: isBrief ? args[0] === 'refresh' : DRY_RUN_COMMANDS.has(command);
|
|
297
|
+
if (honoured)
|
|
298
|
+
return null;
|
|
299
|
+
const where = onlyForm ? ` outside \`hippo ${onlyForm}\`` : '';
|
|
300
|
+
return `hippo ${command} has no --dry-run${where}, so it would run for real. Nothing was changed.`;
|
|
301
|
+
}
|
|
266
302
|
// Shared by both the separated and glued (`=`) forms so the list can't drift.
|
|
267
303
|
function isRepeatableFlag(key) {
|
|
268
304
|
return key === 'tag' || key === 'artifact' || key === 'link' || key === 'step' || key === 'constraint' || key === 'depends-on';
|
|
@@ -658,7 +694,7 @@ async function cmdRemember(hippoRoot, text, flags) {
|
|
|
658
694
|
if (flags['verified'])
|
|
659
695
|
confidence = 'verified';
|
|
660
696
|
// Compute schema fit against existing memories
|
|
661
|
-
const existing = loadAllEntries(targetRoot);
|
|
697
|
+
const existing = loadAllEntries(targetRoot, resolveTenantId({}));
|
|
662
698
|
const schemaFit = computeSchemaFit(text, rawTags, existing);
|
|
663
699
|
// A3 envelope flags
|
|
664
700
|
const kindFlagRaw = typeof flags['kind'] === 'string' ? flags['kind'] : undefined;
|
|
@@ -688,6 +724,7 @@ async function cmdRemember(hippoRoot, text, flags) {
|
|
|
688
724
|
// A5 stub auth: stamp tenant_id from env (HIPPO_TENANT) so recall isolation
|
|
689
725
|
// can filter on this row. Default tenant 'default' for unauthenticated CLI.
|
|
690
726
|
const tenantId = resolveTenantId({});
|
|
727
|
+
const rememberConfig = loadConfig(targetRoot);
|
|
691
728
|
const entry = createMemory(text, {
|
|
692
729
|
layer: Layer.Episodic,
|
|
693
730
|
tags: rawTags,
|
|
@@ -700,6 +737,7 @@ async function cmdRemember(hippoRoot, text, flags) {
|
|
|
700
737
|
owner: ownerFlag,
|
|
701
738
|
artifact_ref: artifactRefFlag,
|
|
702
739
|
tenantId,
|
|
740
|
+
baseHalfLifeDays: rememberConfig.defaultHalfLifeDays,
|
|
703
741
|
});
|
|
704
742
|
// Auto-tag with path context
|
|
705
743
|
const pathTags = extractPathTags(process.cwd());
|
|
@@ -716,7 +754,6 @@ async function cmdRemember(hippoRoot, text, flags) {
|
|
|
716
754
|
entry.tags.push(scopeTag);
|
|
717
755
|
}
|
|
718
756
|
// Salience gate: decide if this memory is worth storing
|
|
719
|
-
const rememberConfig = loadConfig(targetRoot);
|
|
720
757
|
if (rememberConfig.salience.enabled && !Boolean(flags['pin']) && !Boolean(flags['force'])) {
|
|
721
758
|
const salienceResult = computeSalience(text, entry.tags, existing, {
|
|
722
759
|
recentWindow: rememberConfig.salience.recentWindow,
|
|
@@ -758,14 +795,16 @@ async function cmdRemember(hippoRoot, text, flags) {
|
|
|
758
795
|
const facts = await extractFacts(entry.content, {
|
|
759
796
|
apiKey,
|
|
760
797
|
model: config.extraction.model,
|
|
798
|
+
onError: (msg) => console.error(` (extraction failed: ${msg})`),
|
|
761
799
|
});
|
|
762
800
|
if (facts.length > 0) {
|
|
763
801
|
storeExtractedFacts(targetRoot, entry, facts);
|
|
764
802
|
console.error(` extracted ${facts.length} fact(s)`);
|
|
765
803
|
}
|
|
766
804
|
}
|
|
767
|
-
catch {
|
|
768
|
-
// Extraction is best-effort
|
|
805
|
+
catch (err) {
|
|
806
|
+
// Extraction is best-effort: report it, never block remember.
|
|
807
|
+
console.error(` (extraction failed: ${err instanceof Error ? err.message : String(err)})`);
|
|
769
808
|
}
|
|
770
809
|
}
|
|
771
810
|
else if (shouldExtract && !apiKey) {
|
|
@@ -797,6 +836,7 @@ function cmdSupersede(hippoRoot, oldId, newContent, flags) {
|
|
|
797
836
|
pinned,
|
|
798
837
|
source: old.source,
|
|
799
838
|
confidence: 'verified',
|
|
839
|
+
tenantId: old.tenantId,
|
|
800
840
|
});
|
|
801
841
|
// AT1: write the SUCCESSOR first. The rejection guard fires on the new
|
|
802
842
|
// content — if it refuses, nothing has been mutated yet (the old ordering
|
|
@@ -854,8 +894,9 @@ async function cmdRecall(hippoRoot, query, flags) {
|
|
|
854
894
|
// detected-project recalls would change shape.
|
|
855
895
|
const recallExplicitScope = flags['scope'] !== undefined ? String(flags['scope']).trim() : null;
|
|
856
896
|
const requestedScopeForFilter = recallExplicitScope || undefined;
|
|
857
|
-
|
|
858
|
-
let
|
|
897
|
+
const loadSuperseded = includeSuperseded || Boolean(asOf);
|
|
898
|
+
let localEntries = loadRecallSearchEntries(hippoRoot, query, undefined, tenantId, requestedScopeForFilter, 'additive', loadSuperseded);
|
|
899
|
+
let globalEntries = isInitialized(globalRoot) ? loadRecallSearchEntries(globalRoot, query, undefined, tenantId, requestedScopeForFilter, 'additive', loadSuperseded) : [];
|
|
859
900
|
// v1.12.13 / C5 — WYSIATI counters. Track filter activity per the plan v3
|
|
860
901
|
// Task 3 mapping table. dropped_pre_rank is the SUM of all non-budget
|
|
861
902
|
// filter drops (pre-rank AND post-rank); its meaning is unchanged by C5.
|
|
@@ -1725,21 +1766,13 @@ async function cmdRecall(hippoRoot, query, flags) {
|
|
|
1725
1766
|
console.log('No memories found for:', query);
|
|
1726
1767
|
return;
|
|
1727
1768
|
}
|
|
1728
|
-
|
|
1729
|
-
const updated = markRetrieved(results.map((r) => r.entry));
|
|
1769
|
+
const retrievedIds = results.map((r) => r.entry.id);
|
|
1730
1770
|
const localIndex = loadIndex(hippoRoot);
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
// updated_at, rewrites mirrors, and marks DAG parents dirty.
|
|
1735
|
-
if (!isRecallBoostAblated()) {
|
|
1736
|
-
for (const u of updated) {
|
|
1737
|
-
const targetRoot = localIndex.entries[u.id] ? hippoRoot : (isInitialized(globalRoot) ? globalRoot : hippoRoot);
|
|
1738
|
-
writeEntry(targetRoot, u);
|
|
1739
|
-
}
|
|
1740
|
-
}
|
|
1771
|
+
const strengthenedHere = strengthenRetrieved(hippoRoot, retrievedIds);
|
|
1772
|
+
if (isInitialized(globalRoot))
|
|
1773
|
+
strengthenRetrieved(globalRoot, retrievedIds.filter((id) => !strengthenedHere.has(id)));
|
|
1741
1774
|
// Track last retrieval IDs for outcome command
|
|
1742
|
-
localIndex.last_retrieval_ids =
|
|
1775
|
+
localIndex.last_retrieval_ids = retrievedIds;
|
|
1743
1776
|
// LC1 F1 structural fix (docs/plans/2026-08-02-lc1-recall-trace-persistence.md):
|
|
1744
1777
|
// ONE trace at hippoRoot (where last_retrieval_ids and outcome
|
|
1745
1778
|
// attribution live). Write the trace FIRST, then fold its id into
|
|
@@ -1971,8 +2004,9 @@ async function cmdExplain(hippoRoot, query, flags) {
|
|
|
1971
2004
|
// command honest for an operator debugging a hidden row.
|
|
1972
2005
|
const explainExplicitScope = flags['scope'] !== undefined ? String(flags['scope']).trim() : null;
|
|
1973
2006
|
const explainRequestedScope = explainExplicitScope || undefined;
|
|
1974
|
-
|
|
1975
|
-
let
|
|
2007
|
+
const explainLoadSuperseded = explainIncludeSuperseded || Boolean(explainAsOf);
|
|
2008
|
+
let explainLocalEntries = loadRecallSearchEntries(hippoRoot, query, undefined, tenantId, explainRequestedScope, 'additive', explainLoadSuperseded);
|
|
2009
|
+
let explainGlobalEntries = isInitialized(globalRoot) ? loadRecallSearchEntries(globalRoot, query, undefined, tenantId, explainRequestedScope, 'additive', explainLoadSuperseded) : [];
|
|
1976
2010
|
const passesExplainScope = (e) => api.passesCliRecallScopeFilter(e.scope ?? null, explainRequestedScope);
|
|
1977
2011
|
explainLocalEntries = explainLocalEntries.filter(passesExplainScope);
|
|
1978
2012
|
explainGlobalEntries = explainGlobalEntries.filter(passesExplainScope);
|
|
@@ -2376,6 +2410,7 @@ function cmdTraceRecord(hippoRoot, flags) {
|
|
|
2376
2410
|
source: String(flags['source'] ?? 'cli'),
|
|
2377
2411
|
trace_outcome: outcome,
|
|
2378
2412
|
source_session_id: sessionId,
|
|
2413
|
+
tenantId: resolveTenantId({}),
|
|
2379
2414
|
});
|
|
2380
2415
|
writeEntry(hippoRoot, entry);
|
|
2381
2416
|
console.log(`Recorded trace ${entry.id} (outcome=${outcome}, ${steps.length} steps)`);
|
|
@@ -2540,7 +2575,7 @@ export function learnFromMemoryMd(hippoRoot, homeDir = os.homedir()) {
|
|
|
2540
2575
|
}
|
|
2541
2576
|
if (memoryDirs.length === 0)
|
|
2542
2577
|
return 0;
|
|
2543
|
-
const existing = loadAllEntries(hippoRoot);
|
|
2578
|
+
const existing = loadAllEntries(hippoRoot, resolveTenantId({}));
|
|
2544
2579
|
let imported = 0;
|
|
2545
2580
|
let skippedSecret = 0;
|
|
2546
2581
|
// AT1 (plan §3 containment): a rejection guard refusal is per-VALUE — one
|
|
@@ -2583,6 +2618,7 @@ export function learnFromMemoryMd(hippoRoot, homeDir = os.homedir()) {
|
|
|
2583
2618
|
tags: ['claude-code-memory'],
|
|
2584
2619
|
source: `claude-memory:${file}`,
|
|
2585
2620
|
confidence: 'observed',
|
|
2621
|
+
tenantId: resolveTenantId({}),
|
|
2586
2622
|
});
|
|
2587
2623
|
try {
|
|
2588
2624
|
writeEntry(hippoRoot, entry);
|
|
@@ -2731,11 +2767,11 @@ export function renderSleepResult(result) {
|
|
|
2731
2767
|
parts.push(`${epiDups} duplicate episodic lessons`);
|
|
2732
2768
|
if (crossDups > 0)
|
|
2733
2769
|
parts.push(`${crossDups} cross-layer duplicates`);
|
|
2734
|
-
console.log(`\
|
|
2770
|
+
console.log(`\n${result.dryRun ? 'Would dedupe' : 'Deduped'} ${removed} duplicates (${parts.join(', ')}). ${result.dryRun ? 'Would keep' : 'Kept'} stronger copies.`);
|
|
2735
2771
|
}
|
|
2736
2772
|
if (result.audit) {
|
|
2737
2773
|
if (result.audit.errorsRemoved > 0) {
|
|
2738
|
-
console.log(`\nAudit: removed ${result.audit.errorsRemoved} junk memories (too short/empty).`);
|
|
2774
|
+
console.log(`\nAudit: ${result.dryRun ? 'would remove' : 'removed'} ${result.audit.errorsRemoved} junk memories (too short/empty).`);
|
|
2739
2775
|
}
|
|
2740
2776
|
if (result.audit.warningCount > 0) {
|
|
2741
2777
|
console.log(`Audit: ${result.audit.warningCount} low-quality memories detected (run \`hippo audit\` for details).`);
|
|
@@ -2760,7 +2796,10 @@ async function cmdSleepCore(hippoRoot, flags) {
|
|
|
2760
2796
|
requireInit(hippoRoot);
|
|
2761
2797
|
// Phase 1: Auto-learn from git + MEMORY.md (CLI-only, uses process.cwd() / os.homedir()).
|
|
2762
2798
|
// Stays in cli.ts; api.sleep covers Phase 2-6 only.
|
|
2763
|
-
if (!flags['no-learn']) {
|
|
2799
|
+
if (!flags['no-learn'] && flags['dry-run']) {
|
|
2800
|
+
console.log('Dry run: skipped learning from git commits and MEMORY.md files.');
|
|
2801
|
+
}
|
|
2802
|
+
else if (!flags['no-learn']) {
|
|
2764
2803
|
const config = loadConfig(hippoRoot);
|
|
2765
2804
|
if (config.autoLearnOnSleep && isGitRepo(process.cwd())) {
|
|
2766
2805
|
const { added } = learnFromRepo(hippoRoot, process.cwd(), 1);
|
|
@@ -3227,13 +3266,13 @@ async function cmdCodexSessionEndWorker(hippoRoot, flags) {
|
|
|
3227
3266
|
// capture path logs its own failures
|
|
3228
3267
|
}
|
|
3229
3268
|
}
|
|
3230
|
-
function shouldAutoRepairCodexWrapper(currentCommand,
|
|
3269
|
+
export function shouldAutoRepairCodexWrapper(currentCommand, flags) {
|
|
3231
3270
|
if (process.env.HIPPO_SKIP_AUTO_INTEGRATIONS === '1')
|
|
3232
3271
|
return false;
|
|
3233
3272
|
if (!['context', 'remember', 'recall', 'sleep', 'capture', 'outcome', 'status', 'init'].includes(currentCommand)) {
|
|
3234
3273
|
return false;
|
|
3235
3274
|
}
|
|
3236
|
-
if (currentCommand === 'init' &&
|
|
3275
|
+
if (currentCommand === 'init' && flags['no-hooks'] === true)
|
|
3237
3276
|
return false;
|
|
3238
3277
|
return true;
|
|
3239
3278
|
}
|
|
@@ -3242,8 +3281,8 @@ function shouldAutoRepairCodexWrapper(currentCommand, currentArgs) {
|
|
|
3242
3281
|
// shim). Never first-installs — silently swapping the codex binary on routine
|
|
3243
3282
|
// commands is a consent violation and reads as binary hijacking to
|
|
3244
3283
|
// supply-chain scanners (issue #133).
|
|
3245
|
-
function maybeRepairCodexWrapper(currentCommand,
|
|
3246
|
-
if (!shouldAutoRepairCodexWrapper(currentCommand,
|
|
3284
|
+
function maybeRepairCodexWrapper(currentCommand, flags) {
|
|
3285
|
+
if (!shouldAutoRepairCodexWrapper(currentCommand, flags))
|
|
3247
3286
|
return;
|
|
3248
3287
|
try {
|
|
3249
3288
|
repairCodexWrapperIfInstalled();
|
|
@@ -3465,8 +3504,7 @@ function cmdForget(hippoRoot, id, flags) {
|
|
|
3465
3504
|
if (/append-only/i.test(msg)) {
|
|
3466
3505
|
// The delete was refused by the append-only trigger — this is a raw
|
|
3467
3506
|
// memory, not a missing one. Point the user at the archive path.
|
|
3468
|
-
console.error(
|
|
3469
|
-
`Archive it instead: hippo forget ${id} --archive --reason "<why>"`);
|
|
3507
|
+
console.error(rawForgetRefusal(id));
|
|
3470
3508
|
}
|
|
3471
3509
|
else {
|
|
3472
3510
|
console.error(`Memory not found: ${id}`);
|
|
@@ -3474,6 +3512,28 @@ function cmdForget(hippoRoot, id, flags) {
|
|
|
3474
3512
|
process.exit(1);
|
|
3475
3513
|
}
|
|
3476
3514
|
}
|
|
3515
|
+
function rawForgetRefusal(id) {
|
|
3516
|
+
return `Cannot forget ${id}: it is a raw, append-only memory. Archive it instead: hippo forget ${id} --archive --reason "<why>"`;
|
|
3517
|
+
}
|
|
3518
|
+
// Refuses exactly where the real run would, so "Would forget" is a promise, not a guess.
|
|
3519
|
+
function previewForget(hippoRoot, id, archive) {
|
|
3520
|
+
requireInit(hippoRoot);
|
|
3521
|
+
const entry = readEntry(hippoRoot, id, resolveTenantId({}));
|
|
3522
|
+
if (!entry) {
|
|
3523
|
+
console.error(`Memory not found: ${id}`);
|
|
3524
|
+
process.exit(1);
|
|
3525
|
+
}
|
|
3526
|
+
if (!archive && entry.kind === 'raw') {
|
|
3527
|
+
console.error(rawForgetRefusal(id));
|
|
3528
|
+
process.exit(1);
|
|
3529
|
+
}
|
|
3530
|
+
if (archive && entry.kind !== 'raw') {
|
|
3531
|
+
console.error(`Could not archive ${id}: memory ${id} is not raw (kind=${entry.kind})`);
|
|
3532
|
+
process.exit(1);
|
|
3533
|
+
}
|
|
3534
|
+
const snippet = entry.content.length > 80 ? `${entry.content.slice(0, 80)}...` : entry.content;
|
|
3535
|
+
console.log(`Would ${archive ? 'archive' : 'forget'} ${id} (dry run, nothing changed): "${snippet}"`);
|
|
3536
|
+
}
|
|
3477
3537
|
function cmdInspect(hippoRoot, id) {
|
|
3478
3538
|
requireInit(hippoRoot);
|
|
3479
3539
|
const entry = readEntry(hippoRoot, id, resolveTenantId({}));
|
|
@@ -6304,9 +6364,9 @@ async function cmdWatch(command, hippoRoot) {
|
|
|
6304
6364
|
console.error('Command failed but .hippo not initialized. Run `hippo init` to enable auto-learn.');
|
|
6305
6365
|
process.exit(exitCode);
|
|
6306
6366
|
}
|
|
6307
|
-
const entry = captureError(exitCode, stderr, command);
|
|
6367
|
+
const entry = captureError(exitCode, stderr, command, resolveTenantId({}));
|
|
6308
6368
|
// Compute schema fit against existing memories
|
|
6309
|
-
const existingWatch = loadAllEntries(hippoRoot);
|
|
6369
|
+
const existingWatch = loadAllEntries(hippoRoot, entry.tenantId);
|
|
6310
6370
|
const watchFit = computeSchemaFit(entry.content, entry.tags, existingWatch);
|
|
6311
6371
|
entry.schema_fit = watchFit;
|
|
6312
6372
|
entry.half_life_days = deriveHalfLife(7, entry);
|
|
@@ -6392,14 +6452,9 @@ function learnFromRepo(hippoRoot, repoPath, days, label) {
|
|
|
6392
6452
|
// the existing summary line.
|
|
6393
6453
|
let rejected = 0;
|
|
6394
6454
|
const gitLearnTags = ['error', 'git-learned'];
|
|
6395
|
-
const existingForSchema = loadAllEntries(hippoRoot);
|
|
6455
|
+
const existingForSchema = loadAllEntries(hippoRoot, resolveTenantId({}));
|
|
6396
6456
|
for (const lesson of lessons) {
|
|
6397
|
-
//
|
|
6398
|
-
// `loadAllEntries(hippoRoot)` call a few lines up) is host-wide and
|
|
6399
|
-
// intentionally out-of-L9-scope per plan §11 (cli.ts is
|
|
6400
|
-
// single-tenant-per-process). The tenantId arg here is a defensive no-op:
|
|
6401
|
-
// deduplicateLesson's array overload ignores it; the parameter exists
|
|
6402
|
-
// only to mirror the canonical caller pattern used elsewhere in cli.ts.
|
|
6457
|
+
// The array overload ignores the tenant arg; existingForSchema is already scoped.
|
|
6403
6458
|
if (deduplicateLesson(existingForSchema, lesson, 0.7, resolveTenantId({}))) {
|
|
6404
6459
|
skipped++;
|
|
6405
6460
|
continue;
|
|
@@ -6418,6 +6473,7 @@ function learnFromRepo(hippoRoot, repoPath, days, label) {
|
|
|
6418
6473
|
source: 'git-learn',
|
|
6419
6474
|
confidence: 'observed',
|
|
6420
6475
|
schema_fit: schemaFitVal,
|
|
6476
|
+
tenantId: resolveTenantId({}),
|
|
6421
6477
|
});
|
|
6422
6478
|
// Auto-tag with path context from the repo being learned
|
|
6423
6479
|
const learnPathTags = extractPathTags(repoPath);
|
|
@@ -8632,25 +8688,16 @@ Examples:
|
|
|
8632
8688
|
// ---------------------------------------------------------------------------
|
|
8633
8689
|
// Entry point
|
|
8634
8690
|
// ---------------------------------------------------------------------------
|
|
8635
|
-
|
|
8636
|
-
const hippoRoot = getHippoRoot(process.cwd());
|
|
8637
|
-
async function main() {
|
|
8691
|
+
async function main(command, args, flags, hippoRoot) {
|
|
8638
8692
|
if (command === '--version' || command === '-v' || flags['version']) {
|
|
8639
8693
|
const __filename_local = fileURLToPath(import.meta.url);
|
|
8640
8694
|
const __dirname_local = path.dirname(__filename_local);
|
|
8641
|
-
const
|
|
8642
|
-
let pkgJson;
|
|
8643
|
-
try {
|
|
8644
|
-
pkgJson = fs.readFileSync(pkgPath, 'utf-8');
|
|
8645
|
-
}
|
|
8646
|
-
catch {
|
|
8647
|
-
pkgJson = fs.readFileSync(path.join(__dirname_local, '..', '..', 'package.json'), 'utf-8');
|
|
8648
|
-
}
|
|
8695
|
+
const pkgJson = fs.readFileSync(path.join(__dirname_local, '..', 'package.json'), 'utf-8');
|
|
8649
8696
|
const { version } = JSON.parse(pkgJson);
|
|
8650
8697
|
console.log(version);
|
|
8651
8698
|
process.exit(0);
|
|
8652
8699
|
}
|
|
8653
|
-
maybeRepairCodexWrapper(command,
|
|
8700
|
+
maybeRepairCodexWrapper(command, flags);
|
|
8654
8701
|
/** Global --scope well-formedness guard (v1.26.2). parseArgs stores a value-less
|
|
8655
8702
|
* flag as boolean true; downstream the 14 consumer sites either coerced that to
|
|
8656
8703
|
* the literal scope string 'true' (recall filter/unlock input, wm session scope,
|
|
@@ -8685,6 +8732,21 @@ async function main() {
|
|
|
8685
8732
|
process.exit(1);
|
|
8686
8733
|
}
|
|
8687
8734
|
}
|
|
8735
|
+
// card checks its flags per subcommand, with a stricter message.
|
|
8736
|
+
const unknownFlags = command === 'card' ? [] : Object.keys(flags).filter((key) => !KNOWN_FLAGS.has(key));
|
|
8737
|
+
if (unknownFlags.length > 0) {
|
|
8738
|
+
const names = unknownFlags.map((key) => `--${key}`).join(', ');
|
|
8739
|
+
if (DESTRUCTIVE_COMMANDS.has(command)) {
|
|
8740
|
+
console.error(`Unknown flag ${names} for hippo ${command}. Nothing was changed.`);
|
|
8741
|
+
process.exit(2);
|
|
8742
|
+
}
|
|
8743
|
+
console.error(`hippo: ignoring unknown flag ${names}. A later release will reject it.`);
|
|
8744
|
+
}
|
|
8745
|
+
const refusal = Object.hasOwn(flags, 'dry-run') ? dryRunRefusal(command, args, flags) : null;
|
|
8746
|
+
if (refusal) {
|
|
8747
|
+
console.error(refusal);
|
|
8748
|
+
process.exit(2);
|
|
8749
|
+
}
|
|
8688
8750
|
switch (command) {
|
|
8689
8751
|
case 'init':
|
|
8690
8752
|
cmdInit(hippoRoot, flags);
|
|
@@ -8876,7 +8938,7 @@ async function main() {
|
|
|
8876
8938
|
break;
|
|
8877
8939
|
}
|
|
8878
8940
|
requireInit(hippoRoot);
|
|
8879
|
-
const entries = loadAllEntries(hippoRoot);
|
|
8941
|
+
const entries = loadAllEntries(hippoRoot, resolveTenantId({}));
|
|
8880
8942
|
const result = auditMemories(entries);
|
|
8881
8943
|
const shouldFix = Boolean(flags['fix']);
|
|
8882
8944
|
if (result.issues.length === 0) {
|
|
@@ -8890,13 +8952,15 @@ async function main() {
|
|
|
8890
8952
|
console.log(` "${issue.content.slice(0, 80)}${issue.content.length > 80 ? '...' : ''}"`);
|
|
8891
8953
|
}
|
|
8892
8954
|
if (shouldFix) {
|
|
8893
|
-
const
|
|
8894
|
-
if (
|
|
8895
|
-
|
|
8896
|
-
|
|
8897
|
-
|
|
8898
|
-
|
|
8899
|
-
|
|
8955
|
+
const errors = result.issues.filter(i => i.severity === 'error');
|
|
8956
|
+
if (errors.length > 0 && flags['dry-run'] === true) {
|
|
8957
|
+
console.log(`\nWould remove ${errors.length} error-severity memories (dry run, nothing deleted).`);
|
|
8958
|
+
console.log(`${result.issues.length - errors.length} warnings would remain (review manually).`);
|
|
8959
|
+
}
|
|
8960
|
+
else if (errors.length > 0) {
|
|
8961
|
+
const removedCount = errors.filter((issue) => deleteEntry(hippoRoot, issue.memoryId, { reason: `audit --fix: ${issue.reason}`, automatic: true })).length;
|
|
8962
|
+
console.log(`\nRemoved ${removedCount} error-severity memories.`);
|
|
8963
|
+
console.log(`${result.issues.length - errors.length} warnings remain (review manually).`);
|
|
8900
8964
|
}
|
|
8901
8965
|
else {
|
|
8902
8966
|
console.log(`\nNo error-severity issues. Warnings require manual review.`);
|
|
@@ -9017,6 +9081,10 @@ async function main() {
|
|
|
9017
9081
|
console.error(ARCHIVE_REASON_REQUIRED);
|
|
9018
9082
|
process.exit(1);
|
|
9019
9083
|
}
|
|
9084
|
+
if (flags['dry-run'] === true) {
|
|
9085
|
+
previewForget(hippoRoot, id, archive);
|
|
9086
|
+
break;
|
|
9087
|
+
}
|
|
9020
9088
|
const routed = await runViaServerIfAvailable(hippoRoot, async (info, apiKey) => {
|
|
9021
9089
|
try {
|
|
9022
9090
|
if (archive) {
|
|
@@ -9182,7 +9250,7 @@ async function main() {
|
|
|
9182
9250
|
requireInit(hippoRoot);
|
|
9183
9251
|
const format = flags['format'] || 'json';
|
|
9184
9252
|
const outputPath = args[0] || null;
|
|
9185
|
-
const entries = loadAllEntries(hippoRoot);
|
|
9253
|
+
const entries = loadAllEntries(hippoRoot, resolveTenantId({}));
|
|
9186
9254
|
let output;
|
|
9187
9255
|
if (format === 'markdown' || format === 'md') {
|
|
9188
9256
|
output = entries.map(e => {
|
|
@@ -9282,11 +9350,11 @@ async function main() {
|
|
|
9282
9350
|
}
|
|
9283
9351
|
const host = typeof flags['host'] === 'string' ? flags['host'] : '127.0.0.1';
|
|
9284
9352
|
const { serve } = await import('./server.js');
|
|
9285
|
-
const handle = await serve({ hippoRoot, port, host });
|
|
9353
|
+
const handle = await serve({ hippoRoot, port, host, handleSignals: true });
|
|
9286
9354
|
console.log(`hippo serve listening on ${handle.url} (pid ${process.pid})`);
|
|
9287
9355
|
console.log(`pidfile: ${path.join(hippoRoot, 'server.pid')}`);
|
|
9288
9356
|
console.log('press Ctrl+C to stop');
|
|
9289
|
-
// SIGINT/SIGTERM handlers
|
|
9357
|
+
// The SIGINT/SIGTERM handlers stop the server and exit. Hang until then.
|
|
9290
9358
|
await new Promise(() => { });
|
|
9291
9359
|
break;
|
|
9292
9360
|
}
|
|
@@ -9380,8 +9448,19 @@ async function main() {
|
|
|
9380
9448
|
process.exit(1);
|
|
9381
9449
|
}
|
|
9382
9450
|
}
|
|
9383
|
-
|
|
9384
|
-
|
|
9385
|
-
|
|
9386
|
-
|
|
9451
|
+
export async function runCli(argv = process.argv) {
|
|
9452
|
+
const { command, args, flags } = parseArgs(argv);
|
|
9453
|
+
try {
|
|
9454
|
+
await main(command, args, flags, getHippoRoot(process.cwd()));
|
|
9455
|
+
}
|
|
9456
|
+
catch (err) {
|
|
9457
|
+
console.error('Error:', err instanceof Error ? err.message : err);
|
|
9458
|
+
process.exit(1);
|
|
9459
|
+
}
|
|
9460
|
+
}
|
|
9461
|
+
// bin/hippo.js calls runCli(); this keeps `node dist/cli.js` working while an import runs nothing.
|
|
9462
|
+
const entryPath = process.argv[1];
|
|
9463
|
+
if (entryPath && fs.existsSync(entryPath) && fs.realpathSync(entryPath) === fileURLToPath(import.meta.url)) {
|
|
9464
|
+
void runCli();
|
|
9465
|
+
}
|
|
9387
9466
|
//# sourceMappingURL=cli.js.map
|
package/dist/client.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* HTTP client wrapper for `hippo serve`.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* returns the same shape that api.ts would.
|
|
4
|
+
* Only the writes the CLI routes (remember, forget, archive, promote), which are
|
|
5
|
+
* also all HIPPO_REQUIRE_SERVER covers; every other command opens the store
|
|
6
|
+
* directly. Each call returns the same shape that api.ts would.
|
|
7
7
|
*
|
|
8
8
|
* Errors from the server (4xx/5xx) are mapped back into thrown Errors with
|
|
9
9
|
* the server's `error` message preserved verbatim so existing CLI handlers
|
|
@@ -13,9 +13,7 @@
|
|
|
13
13
|
* Network errors (ECONNREFUSED on a stale pidfile, etc.) propagate as the
|
|
14
14
|
* native fetch failure so the caller can detect them and self-heal.
|
|
15
15
|
*/
|
|
16
|
-
import type {
|
|
17
|
-
import type { ApiKeyListItem } from './auth.js';
|
|
18
|
-
import type { RememberOpts, RememberResult, RecallOpts, RecallResult, AuthCreateOpts, AuthCreateResult, AuditListOpts } from './api.js';
|
|
16
|
+
import type { RememberOpts, RememberResult } from './api.js';
|
|
19
17
|
/** An error the server answered with, not one the transport raised. The
|
|
20
18
|
* refused-connection classifier sniffs message text, and a server message
|
|
21
19
|
* quotes the caller's own id or content back verbatim. */
|
|
@@ -24,7 +22,6 @@ export declare class HttpResponseError extends Error {
|
|
|
24
22
|
constructor(message: string, status: number);
|
|
25
23
|
}
|
|
26
24
|
export declare function remember(serverUrl: string, apiKey: string | undefined, opts: RememberOpts): Promise<RememberResult>;
|
|
27
|
-
export declare function recall(serverUrl: string, apiKey: string | undefined, opts: RecallOpts): Promise<RecallResult>;
|
|
28
25
|
export declare function forget(serverUrl: string, apiKey: string | undefined, id: string): Promise<{
|
|
29
26
|
ok: true;
|
|
30
27
|
id: string;
|
|
@@ -34,24 +31,10 @@ export declare function promote(serverUrl: string, apiKey: string | undefined, i
|
|
|
34
31
|
sourceId: string;
|
|
35
32
|
globalId: string;
|
|
36
33
|
}>;
|
|
37
|
-
export declare function supersede(serverUrl: string, apiKey: string | undefined, oldId: string, newContent: string): Promise<{
|
|
38
|
-
ok: true;
|
|
39
|
-
oldId: string;
|
|
40
|
-
newId: string;
|
|
41
|
-
}>;
|
|
42
34
|
export declare function archiveRaw(serverUrl: string, apiKey: string | undefined, id: string, reason: string): Promise<{
|
|
43
35
|
ok: true;
|
|
44
36
|
archivedAt: string;
|
|
45
37
|
}>;
|
|
46
|
-
export declare function authCreate(serverUrl: string, apiKey: string | undefined, opts: AuthCreateOpts): Promise<AuthCreateResult>;
|
|
47
|
-
export declare function authList(serverUrl: string, apiKey: string | undefined, opts: {
|
|
48
|
-
active: boolean;
|
|
49
|
-
}): Promise<ApiKeyListItem[]>;
|
|
50
|
-
export declare function authRevoke(serverUrl: string, apiKey: string | undefined, keyId: string): Promise<{
|
|
51
|
-
ok: true;
|
|
52
|
-
revokedAt: string;
|
|
53
|
-
}>;
|
|
54
|
-
export declare function auditList(serverUrl: string, apiKey: string | undefined, opts: AuditListOpts): Promise<AuditEvent[]>;
|
|
55
38
|
/**
|
|
56
39
|
* How far a request got before the transport failed.
|
|
57
40
|
*
|