@shadowforge0/aquifer-memory 1.5.12 → 1.7.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.
Files changed (60) hide show
  1. package/.env.example +23 -0
  2. package/README.md +84 -73
  3. package/README_CN.md +676 -0
  4. package/README_TW.md +684 -0
  5. package/aquifer.config.example.json +34 -0
  6. package/consumers/claude-code.js +11 -11
  7. package/consumers/cli.js +421 -53
  8. package/consumers/codex-handoff.js +258 -0
  9. package/consumers/codex.js +1676 -0
  10. package/consumers/default/daily-entries.js +23 -4
  11. package/consumers/default/index.js +2 -2
  12. package/consumers/default/prompts/summary.js +6 -6
  13. package/consumers/mcp.js +96 -5
  14. package/consumers/openclaw-ext/index.js +0 -1
  15. package/consumers/openclaw-plugin.js +1 -1
  16. package/consumers/shared/config.js +8 -0
  17. package/consumers/shared/factory.js +1 -0
  18. package/consumers/shared/ingest.js +1 -1
  19. package/consumers/shared/normalize.js +14 -3
  20. package/consumers/shared/recall-format.js +27 -0
  21. package/consumers/shared/summary-parser.js +151 -0
  22. package/core/aquifer.js +380 -18
  23. package/core/finalization-review.js +319 -0
  24. package/core/mcp-manifest.js +52 -2
  25. package/core/memory-bootstrap.js +200 -0
  26. package/core/memory-consolidation.js +1590 -0
  27. package/core/memory-promotion.js +544 -0
  28. package/core/memory-recall.js +247 -0
  29. package/core/memory-records.js +797 -0
  30. package/core/memory-safety-gate.js +224 -0
  31. package/core/session-finalization.js +365 -0
  32. package/core/storage.js +385 -2
  33. package/docs/getting-started.md +105 -0
  34. package/docs/postprocess-contract.md +2 -2
  35. package/docs/setup.md +92 -2
  36. package/package.json +25 -11
  37. package/pipeline/normalize/adapters/codex.js +106 -0
  38. package/pipeline/normalize/detect.js +3 -2
  39. package/schema/001-base.sql +3 -0
  40. package/schema/007-v1-foundation.sql +273 -0
  41. package/schema/008-session-finalizations.sql +50 -0
  42. package/schema/009-v1-assertion-plane.sql +193 -0
  43. package/schema/010-v1-finalization-review.sql +160 -0
  44. package/schema/011-v1-compaction-claim.sql +46 -0
  45. package/schema/012-v1-compaction-lease.sql +39 -0
  46. package/schema/013-v1-compaction-lineage.sql +193 -0
  47. package/scripts/codex-recovery.js +672 -0
  48. package/consumers/miranda/context-inject.js +0 -120
  49. package/consumers/miranda/daily-entries.js +0 -224
  50. package/consumers/miranda/index.js +0 -364
  51. package/consumers/miranda/instance.js +0 -55
  52. package/consumers/miranda/llm.js +0 -99
  53. package/consumers/miranda/profile.json +0 -145
  54. package/consumers/miranda/prompts/summary.js +0 -303
  55. package/consumers/miranda/recall-format.js +0 -76
  56. package/consumers/miranda/render-daily-md.js +0 -186
  57. package/consumers/miranda/workspace-files.js +0 -91
  58. package/scripts/drop-entity-state-history.sql +0 -17
  59. package/scripts/drop-insights.sql +0 -12
  60. package/scripts/install-openclaw.sh +0 -59
@@ -0,0 +1,34 @@
1
+ {
2
+ "db": {
3
+ "url": "postgresql://user:password@localhost:5432/mydb",
4
+ "max": 10
5
+ },
6
+ "schema": "aquifer",
7
+ "tenantId": "default",
8
+ "defaults": {
9
+ "agentId": "main",
10
+ "source": "api"
11
+ },
12
+ "memory": {
13
+ "servingMode": "legacy",
14
+ "activeScopeKey": null,
15
+ "activeScopePath": null
16
+ },
17
+ "embed": {
18
+ "baseUrl": "http://localhost:11434/v1",
19
+ "model": "bge-m3",
20
+ "dim": null
21
+ },
22
+ "llm": {
23
+ "baseUrl": null,
24
+ "model": null
25
+ },
26
+ "entities": {
27
+ "enabled": false,
28
+ "scope": "default"
29
+ },
30
+ "rerank": {
31
+ "enabled": false,
32
+ "provider": null
33
+ }
34
+ }
@@ -3,10 +3,9 @@
3
3
  // ---------------------------------------------------------------------------
4
4
  // Claude Code host adapter.
5
5
  //
6
- // Generic entry points for CC-side afterburn hooks. No persona logic — the
7
- // caller (typically cc-afterburn.js) constructs the Miranda persona hooks
8
- // via consumers/miranda and injects them via `postProcess`, `summaryFn`,
9
- // `entityParseFn`.
6
+ // Generic entry points for CC-side afterburn hooks. No persona logic — callers
7
+ // construct any persona-specific hooks outside this package and inject them via
8
+ // `postProcess`, `summaryFn`, `entityParseFn`, or `contextInjector`.
10
9
  //
11
10
  // API:
12
11
  // runEnrich({ aquifer, sessionId, agentId, ... })
@@ -16,9 +15,9 @@
16
15
  // runBackfill({ aquifer, sessionIds, ... })
17
16
  // Iterate enrich() over pending sessions (for catch-up after a gap).
18
17
  //
19
- // runContextInject({ aquifer, pool, agentId })
20
- // Return the Miranda-flavored system context string for a CC session
21
- // start hook. (Delegates to consumers/miranda/context-inject.)
18
+ // runContextInject({ contextInjector, ... })
19
+ // Return a host-specific system context string for a CC session start
20
+ // hook. The injector is supplied by the deployment, not by Aquifer core.
22
21
  // ---------------------------------------------------------------------------
23
22
 
24
23
  /**
@@ -106,12 +105,13 @@ async function runBackfill({
106
105
  }
107
106
 
108
107
  /**
109
- * Build the Miranda-flavored system context for a CC SessionStart hook.
110
- * Delegates to consumers/miranda/context-inject.computeInjection.
108
+ * Build a host-specific system context for a CC SessionStart hook.
109
+ * The caller supplies the context injector so this public adapter stays generic.
111
110
  */
112
111
  async function runContextInject(opts = {}) {
113
- const { computeInjection } = require('./miranda/context-inject');
114
- return computeInjection(opts);
112
+ const injector = opts.contextInjector || opts.computeInjection;
113
+ if (typeof injector !== 'function') throw new Error('runContextInject: contextInjector is required');
114
+ return injector(opts);
115
115
  }
116
116
 
117
117
  module.exports = { runEnrich, runBackfill, runContextInject };