@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
@@ -1,12 +0,0 @@
1
- -- DROP-clean script for insights (Q4 bitter-lesson escape hatch).
2
- --
3
- -- Removes the table and all dependent indexes. Nothing else in Aquifer
4
- -- references it directly, so DROP CASCADE is safe and complete.
5
-
6
- DROP TABLE IF EXISTS :"schema".insights CASCADE;
7
-
8
- -- Verify nothing remains.
9
- SELECT to_regclass(:'schema' || '.insights') AS table_after_drop;
10
- SELECT to_regclass(:'schema' || '.idx_insights_active') AS idx_active_after_drop;
11
- SELECT to_regclass(:'schema' || '.idx_insights_embedding') AS idx_embedding_after_drop;
12
- -- All three should report NULL.
@@ -1,59 +0,0 @@
1
- #!/usr/bin/env bash
2
- # Aquifer — Install drop-in OpenClaw extension
3
- #
4
- # Usage:
5
- # bash scripts/install-openclaw.sh [OPENCLAW_HOME]
6
- #
7
- # Default OPENCLAW_HOME: $HOME/.openclaw
8
- #
9
- # What it does:
10
- # 1. Creates / overwrites $OPENCLAW_HOME/extensions/aquifer-memory/
11
- # as a symlink to <this_package>/consumers/openclaw-ext/
12
- # 2. Prints follow-up instructions: set the .env keys, restart the gateway.
13
- #
14
- # Idempotent; safe to re-run.
15
-
16
- set -euo pipefail
17
-
18
- OPENCLAW_HOME="${1:-${OPENCLAW_HOME:-$HOME/.openclaw}}"
19
- SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
20
- PKG_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
21
- EXT_SRC="$PKG_ROOT/consumers/openclaw-ext"
22
- EXT_DEST="$OPENCLAW_HOME/extensions/aquifer-memory"
23
-
24
- if [[ ! -d "$EXT_SRC" ]]; then
25
- echo "error: $EXT_SRC not found (expected inside the Aquifer package)" >&2
26
- exit 1
27
- fi
28
-
29
- if [[ ! -d "$OPENCLAW_HOME" ]]; then
30
- echo "error: OPENCLAW_HOME=$OPENCLAW_HOME not found" >&2
31
- exit 1
32
- fi
33
-
34
- mkdir -p "$OPENCLAW_HOME/extensions"
35
-
36
- if [[ -L "$EXT_DEST" || -e "$EXT_DEST" ]]; then
37
- echo "note: $EXT_DEST already exists — replacing"
38
- rm -rf "$EXT_DEST"
39
- fi
40
-
41
- ln -s "$EXT_SRC" "$EXT_DEST"
42
- echo "ok: linked $EXT_DEST → $EXT_SRC"
43
-
44
- cat <<'EOF'
45
-
46
- Next steps:
47
- 1. Edit $OPENCLAW_HOME/.env and set:
48
- DATABASE_URL=postgresql://user:pass@host:5432/db
49
- EMBED_PROVIDER=ollama # or openai
50
- AQUIFER_LLM_PROVIDER=minimax # or openai / openrouter / opencode
51
- MINIMAX_API_KEY=... # (or the key for your chosen provider)
52
- # Optional:
53
- AQUIFER_SCHEMA=my_namespace
54
- AQUIFER_PERSONA=/path/to/host-local/persona-module
55
- 2. Restart OpenClaw:
56
- systemctl --user restart openclaw-gateway
57
- 3. Verify:
58
- journalctl --user -u openclaw-gateway -f | grep aquifer-memory
59
- EOF