toolnet-memory 0.3.15 → 0.3.17

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 (48) hide show
  1. package/.env.example +74 -0
  2. package/.release-target +1 -1
  3. package/README.md +316 -6
  4. package/bin/toolnet-memory +12 -0
  5. package/bundle/agy-hook.js +66 -66
  6. package/bundle/agy.js +56 -56
  7. package/bundle/api.js +15 -15
  8. package/bundle/audit.js +2 -0
  9. package/bundle/background-refresh.js +7 -7
  10. package/bundle/claude-hook.js +49 -49
  11. package/bundle/code-capabilities.js +2 -0
  12. package/bundle/codex-context.js +29 -29
  13. package/bundle/codex.js +71 -71
  14. package/bundle/context-runtime.js +39 -39
  15. package/bundle/context.js +15 -15
  16. package/bundle/copilot-hook.js +78 -78
  17. package/bundle/cursor-hook.js +78 -78
  18. package/bundle/docker-healthcheck.js +3 -0
  19. package/bundle/doctor.js +4 -4
  20. package/bundle/full-index.js +22 -21
  21. package/bundle/gc.js +5 -3
  22. package/bundle/graph-cli.js +1 -1
  23. package/bundle/graph-index.js +5 -4
  24. package/bundle/graph-ui.js +4 -3
  25. package/bundle/grok-hook.js +56 -56
  26. package/bundle/handoff-refresh.js +10 -10
  27. package/bundle/help-cli.js +4 -4
  28. package/bundle/impact.js +5 -4
  29. package/bundle/incremental.js +5 -5
  30. package/bundle/init.js +36 -35
  31. package/bundle/kiro-hook.js +85 -85
  32. package/bundle/learner.js +8 -6
  33. package/bundle/mcp.js +19 -17
  34. package/bundle/memory-agent.js +6 -6
  35. package/bundle/memory-query.js +7 -7
  36. package/bundle/opencode.js +77 -77
  37. package/bundle/project-manual.js +7 -7
  38. package/bundle/public/index.html +51 -2
  39. package/bundle/recovery-certify.js +9 -9
  40. package/bundle/runtime.js +16 -13
  41. package/bundle/semantic.js +6 -5
  42. package/bundle/service.js +11 -6
  43. package/bundle/snapshot.js +6 -4
  44. package/bundle/status-cli.js +4 -4
  45. package/bundle/toolnet-cli.js +46 -46
  46. package/bundle/work-continuity.js +7 -7
  47. package/package.json +38 -2
  48. package/release-manifest.json +143 -4
package/.env.example CHANGED
@@ -59,3 +59,77 @@ TOOLNET_API_TOKEN=
59
59
  # ToolNet Memory Hub
60
60
  TOOLNET_HUB_OWNER=owner
61
61
  TOOLNET_HUB_MAX_EVENTS=100
62
+
63
+ # ------------------------------------------------------------
64
+ # Graph UI
65
+ # ------------------------------------------------------------
66
+ #
67
+ # Localhost-only by default.
68
+ TOOLNET_GRAPH_HOST=127.0.0.1
69
+ TOOLNET_GRAPH_PORT=9749
70
+ # Optional API bearer token.
71
+ # Recommended whenever Graph UI is reachable from another host.
72
+ # Generate a strong random token, for example:
73
+ # openssl rand -hex 32
74
+ #
75
+ # TOOLNET_GRAPH_TOKEN=
76
+ # Optional comma-separated Host allow-list for reverse proxies
77
+ # or wildcard binds.
78
+ #
79
+ # TOOLNET_GRAPH_ALLOWED_HOSTS=graph.example.com
80
+
81
+ # ------------------------------------------------------------
82
+ # Optional remote client-side encryption
83
+ # ------------------------------------------------------------
84
+ #
85
+ # OFF by default. Normal ToolNet usage needs no encryption key.
86
+ #
87
+ # Enable only when you want ToolNet to encrypt objects before
88
+ # they are sent to S3 / R2 / Hugging Face object storage.
89
+ #
90
+ # TOOLNET_REMOTE_ENCRYPTION=on
91
+ #
92
+ # Generate a 32-byte key:
93
+ # openssl rand -base64 32
94
+ #
95
+ # Configure ONE:
96
+ #
97
+ # TOOLNET_REMOTE_ENCRYPTION_KEY=
98
+ #
99
+ # or preferably from a protected file / Docker secret:
100
+ #
101
+ # TOOLNET_REMOTE_ENCRYPTION_KEY_FILE=/run/secrets/toolnet_remote_encryption_key
102
+
103
+ # ------------------------------------------------------------
104
+ # Automatic garbage collection
105
+ # ------------------------------------------------------------
106
+ #
107
+ # Disabled by default.
108
+ #
109
+ # When enabled on the ToolNet service, GC runs only for already
110
+ # initialized projects observed by the service.
111
+ #
112
+ # TOOLNET_AUTO_GC=on
113
+ #
114
+ # Default: 168 hours = weekly.
115
+ #
116
+ # TOOLNET_AUTO_GC_INTERVAL_HOURS=168
117
+ #
118
+ # Internal due-check cadence. Default: 15 minutes.
119
+ #
120
+ # TOOLNET_AUTO_GC_TICK_MINUTES=15
121
+ #
122
+ # Remote snapshot deletion remains OFF unless explicitly enabled.
123
+ #
124
+ # TOOLNET_AUTO_GC_REMOTE=off
125
+ #
126
+ # Retention policy overrides:
127
+ #
128
+ # TOOLNET_AUTO_GC_KEEP_SNAPSHOTS=10
129
+ # TOOLNET_AUTO_GC_RUNTIME_DAYS=30
130
+ # TOOLNET_AUTO_GC_STALE_LOCK_MINUTES=10
131
+ # TOOLNET_AUTO_GC_SNAPSHOT_DAYS=30
132
+ #
133
+ # Optional audit actor identity:
134
+ #
135
+ # TOOLNET_AGENT_ID=
package/.release-target CHANGED
@@ -1 +1 @@
1
- 0.3.15
1
+ 0.3.17
package/README.md CHANGED
@@ -11,7 +11,7 @@
11
11
 
12
12
  **One project. Multiple coding agents. Continuous context.**
13
13
 
14
- Current release: **v0.3.15**
14
+ Current release: v0.3.17
15
15
 
16
16
  </div>
17
17
 
@@ -28,7 +28,7 @@ ToolNet Memory combines four layers:
28
28
  - **Fast project context** — small local startup context for normal work.
29
29
  - **Work continuity** — current goal, phase, blockers, decisions, and next actions.
30
30
  - **Durable memory** — filtered project knowledge that survives agent/session changes.
31
- - **Code intelligence** — symbols, dependencies, call graphs, architecture, semantic search, impact analysis, and graph visualization.
31
+ - **Code intelligence** — symbols, dependencies, call graphs, architecture, local SQLite FTS5/BM25 code search, impact analysis, and graph visualization.
32
32
 
33
33
  ToolNet Memory is **not a raw transcript dump**. Raw session history is kept separate from durable project memory and is protected from normal agent reads.
34
34
 
@@ -154,6 +154,25 @@ Project identity is stored in:
154
154
  .toolnet/project.json
155
155
  ```
156
156
 
157
+ For Git projects, new project identity is derived from normalized Git
158
+ repository identity instead of absolute checkout path.
159
+
160
+ A fresh clone can recover a registered existing ToolNet project identity from
161
+ the configured remote identity registry.
162
+
163
+ Pre-registry legacy projects require explicit adoption when identity cannot be
164
+ proven automatically:
165
+
166
+ ```text
167
+ toolnet-memory init --adopt-remote <remote-name>
168
+ ```
169
+
170
+ To intentionally initialize without remote identity lookup:
171
+
172
+ ```text
173
+ toolnet-memory init --no-remote-identity
174
+ ```
175
+
157
176
  ### 4. Build project intelligence
158
177
 
159
178
  ```bash
@@ -171,7 +190,7 @@ Type Resolution
171
190
 
172
191
  Rich Graph
173
192
 
174
- Semantic Code Index
193
+ Local Code Search — SQLite FTS5/BM25
175
194
 
176
195
  Architecture Intelligence
177
196
 
@@ -595,6 +614,161 @@ toolnet-memory project:manual-sync
595
614
 
596
615
  Secrets and credentials should remain in `.env` or another secret store, not in `PROJECT.md`.
597
616
 
617
+ ### Optional remote encryption
618
+
619
+ Remote S3 / R2 / Hugging Face objects can be encrypted client-side with
620
+ AES-256-GCM. Encryption remains disabled by default:
621
+
622
+ ```bash
623
+ export TOOLNET_REMOTE_ENCRYPTION=on
624
+ export TOOLNET_REMOTE_ENCRYPTION_KEY="$(openssl rand -base64 32)"
625
+ ```
626
+
627
+ Existing plaintext remote objects remain readable. New and rewritten
628
+ remote objects are encrypted while the feature is enabled. For services or
629
+ containers, `TOOLNET_REMOTE_ENCRYPTION_KEY_FILE` can load the key from a
630
+ protected file instead of placing the key directly in an environment
631
+ variable. See [`docs/remote-encryption.md`](docs/remote-encryption.md).
632
+
633
+ ---
634
+
635
+ ### Graph UI security
636
+
637
+ `toolnet-memory graph` remains localhost-first:
638
+
639
+ ```text
640
+ 127.0.0.1:9749
641
+ ```
642
+
643
+ For remote exposure, Graph API endpoints support an optional bearer token:
644
+
645
+ ```bash
646
+ export TOOLNET_GRAPH_TOKEN="$(openssl rand -hex 32)"
647
+ export TOOLNET_GRAPH_HOST="0.0.0.0"
648
+ toolnet-memory graph
649
+ ```
650
+
651
+ The browser asks for the token when a protected Graph API returns HTTP 401 and
652
+ keeps it in sessionStorage for that browser session.
653
+
654
+ `/api/health` stays unauthenticated but returns only a minimal service status.
655
+
656
+ `TOOLNET_GRAPH_TOKEN` controls Graph API access only. It is not an encryption
657
+ key and is not required for normal localhost usage.
658
+
659
+
660
+ ## Runtime Capability Truth
661
+
662
+ ToolNet Memory is local-first and deterministic.
663
+
664
+ | Component | Required | Notes |
665
+ | -------------------- | -------- | ----- |
666
+ | LLM | no | |
667
+ | Embedding provider | no | |
668
+ | Vector database | no | |
669
+ | Mandatory crypto key | no | |
670
+
671
+ Automatic memory promotion and conflict handling are deterministic and evidence-based.
672
+
673
+ ### Local Code Search
674
+
675
+ The current code-search implementation is:
676
+
677
+ ```text
678
+ Local Code Search — SQLite FTS5/BM25
679
+ Index: SQLite FTS5
680
+ Ranking: BM25
681
+ Mode: lexical
682
+ ```
683
+
684
+ It does not use embeddings or a vector database.
685
+
686
+ The following historical names remain compatibility aliases and are not being
687
+ removed in this release:
688
+
689
+ - `SemanticCodeEngine`
690
+ - `semantic_code_search`
691
+ - `toolnet-memory semantic`
692
+ - `semantic-index`
693
+
694
+ ### Parser support
695
+
696
+ | Language family | Status |
697
+ | ---------------------------- | ----------- |
698
+ | TypeScript / TSX | supported |
699
+ | JavaScript / JSX / MJS / CJS | supported |
700
+ | Python | unsupported |
701
+ | Go | unsupported |
702
+ | Rust | unsupported |
703
+ | C / C++ | unsupported |
704
+
705
+ The supported TypeScript/JavaScript family uses the TypeScript Compiler API.
706
+
707
+ Tree-sitter is not implemented in this release.
708
+
709
+ ### Cross-machine project identity
710
+
711
+ Existing `.toolnet/project.json` identity remains canonical.
712
+
713
+ New Git projects use normalized Git repository identity instead of absolute
714
+ checkout path. A registered existing ToolNet project can therefore be adopted
715
+ by another checkout of the same Git repository.
716
+
717
+ For a pre-registry legacy project, adoption is explicit:
718
+
719
+ ```text
720
+ toolnet-memory init --adopt-remote <remote-name>
721
+ ```
722
+
723
+ ToolNet refuses unverified silent adoption when repository identity cannot be
724
+ proven.
725
+
726
+ ### Multi-host behavior
727
+
728
+ Cross-host convergence is implemented under `src/multi-host/**` using immutable
729
+ append-only operations plus deterministic reduction.
730
+
731
+ The removed legacy `src/sync/**` scaffold was not the active sync engine.
732
+
733
+ ToolNet does not claim a WebSocket real-time sync protocol or vector-clock CRDT
734
+ implementation.
735
+
736
+ ### Storage truth
737
+
738
+ **Supported:**
739
+
740
+ - Local
741
+ - Hugging Face S3-compatible storage
742
+ - S3-compatible storage
743
+ - Cloudflare R2 through the S3-compatible provider
744
+
745
+ **Unsupported:**
746
+
747
+ - Google Drive storage
748
+ - GitHub storage backend
749
+
750
+ ### Security truth
751
+
752
+ ToolNet provides secret scanning and durable-data sanitization.
753
+
754
+ ToolNet does not provide mandatory client-side encryption. Remote
755
+ client-side encryption is optional and disabled by default. Normal ToolNet
756
+ usage does not require an encryption key. When
757
+ `TOOLNET_REMOTE_ENCRYPTION=on` is configured together with
758
+ `TOOLNET_REMOTE_ENCRYPTION_KEY` (or the `_FILE` variant), ToolNet encrypts
759
+ new remote object writes with AES-256-GCM before they reach S3 / R2 /
760
+ Hugging Face storage. Existing plaintext remote objects remain readable.
761
+
762
+ See [`docs/remote-encryption.md`](docs/remote-encryption.md).
763
+
764
+ Project instruction files are treated as untrusted project data, not as system
765
+ or developer authority.
766
+
767
+ For the detailed capability matrix, see:
768
+
769
+ - `docs/runtime-truth.md`
770
+ - `docs/repository-capabilities.md`
771
+
598
772
  ---
599
773
 
600
774
  ## Code Intelligence
@@ -611,11 +785,33 @@ Capabilities include:
611
785
  - subsystem clustering,
612
786
  - hotspots,
613
787
  - dead-code candidates,
614
- - semantic code search,
788
+ - local lexical code search (SQLite FTS5/BM25),
615
789
  - dependency paths,
616
790
  - change-impact analysis,
617
791
  - visualization datasets.
618
792
 
793
+ ### Local Code Search
794
+
795
+ ToolNet code search is deterministic and local.
796
+
797
+ ```text
798
+ Index backend: SQLite FTS5
799
+ Ranking: BM25
800
+ Mode: lexical
801
+ Embeddings: no
802
+ Vector DB: no
803
+ LLM/model: no
804
+ Network: not required
805
+ ```
806
+
807
+ The historical public names remain available for compatibility:
808
+
809
+ - CLI: `toolnet-memory semantic`
810
+ - MCP: `semantic_code_search`
811
+ - API: `SemanticCodeEngine`
812
+
813
+ Those names are compatibility aliases and do not indicate embedding-based semantic retrieval.
814
+
619
815
  Useful commands:
620
816
 
621
817
  ```bash
@@ -625,7 +821,7 @@ toolnet-memory index
625
821
  # Incremental update
626
822
  toolnet-memory incremental
627
823
 
628
- # Semantic search
824
+ # Local lexical code search (legacy command name)
629
825
  toolnet-memory semantic "authentication flow"
630
826
 
631
827
  # Change impact
@@ -939,7 +1135,7 @@ ToolNet Memory uses GitHub Actions for CI and npm releases.
939
1135
  The current release line is:
940
1136
 
941
1137
  ```text
942
- npm package: toolnet-memory@0.3.14
1138
+ npm package: toolnet-memory@0.3.17
943
1139
  Git tag: v0.3.14
944
1140
  ```
945
1141
 
@@ -965,3 +1161,117 @@ See [CHANGELOG.md](CHANGELOG.md) for release history.
965
1161
  ## License
966
1162
 
967
1163
  MIT © 2026 LBT-AI. See [LICENSE](LICENSE).
1164
+
1165
+
1166
+
1167
+ Docker
1168
+
1169
+ ToolNet Memory includes a hardened Node.js 22 container build.
1170
+
1171
+ docker build -t toolnet-memory:local .
1172
+ docker run --rm toolnet-memory:local --version
1173
+
1174
+ Run the daemon with persistent ToolNet runtime state:
1175
+
1176
+ docker run --rm \
1177
+ -v toolnet-memory-home:/home/node/.toolnet \
1178
+ toolnet-memory:local
1179
+
1180
+ Run against the current project:
1181
+
1182
+ docker run --rm \
1183
+ -v "$PWD:/workspace" \
1184
+ -v toolnet-memory-home:/home/node/.toolnet \
1185
+ toolnet-memory:local \
1186
+ doctor
1187
+
1188
+ The final image runs as a non-root user and the Docker health check uses the
1189
+ ToolNet daemon's real Unix-socket ping protocol.
1190
+
1191
+ Release image target:
1192
+
1193
+ ghcr.io/lbt-ai/toolnet-memory
1194
+
1195
+ Optional Docker Hub publishing supports:
1196
+
1197
+ lbtai/toolnet-memory
1198
+
1199
+ when Docker Hub publishing is explicitly enabled in repository settings.
1200
+
1201
+ See docs/docker.md for Compose, shared-volume dedupe, permissions, health
1202
+ checks, and multi-architecture release details.
1203
+
1204
+
1205
+ Standalone binaries
1206
+
1207
+ ToolNet Memory can run without a separately installed Node.js/npm runtime.
1208
+
1209
+ Release targets:
1210
+
1211
+ Linux x64 / arm64
1212
+ macOS x64 / arm64
1213
+ Windows x64
1214
+
1215
+ Example:
1216
+
1217
+ ```bash
1218
+ chmod +x toolnet-memory-linux-x64
1219
+ ./toolnet-memory-linux-x64 --version
1220
+ ```
1221
+
1222
+ Standalone binaries embed the Node.js runtime and ToolNet production
1223
+ dependency graph. The npm package remains fully supported.
1224
+
1225
+ See [`docs/standalone.md`](docs/standalone.md) for platform support,
1226
+ service limitations, checksums, and build instructions.
1227
+
1228
+
1229
+
1230
+ Audit log and automatic GC
1231
+
1232
+ ToolNet can maintain a tamper-evident project audit history:
1233
+
1234
+ .toolnet/audit/events.jsonl
1235
+
1236
+ Inspect and verify:
1237
+
1238
+ ```bash
1239
+ toolnet-memory audit
1240
+ toolnet-memory audit:verify
1241
+ ```
1242
+
1243
+ The log records durable memory writes, snapshot restore/recovery, Guard
1244
+ checks, and GC execution without intentionally storing raw memory
1245
+ content or raw shell commands.
1246
+
1247
+ Automatic GC remains opt-in:
1248
+
1249
+ ```bash
1250
+ export TOOLNET_AUTO_GC=on
1251
+ toolnet-memory service
1252
+ ```
1253
+
1254
+ The default interval is weekly. Remote snapshot GC remains disabled
1255
+ unless `TOOLNET_AUTO_GC_REMOTE=on` is explicitly configured.
1256
+
1257
+ See [`docs/audit-log.md`](docs/audit-log.md) and
1258
+ [`docs/auto-gc.md`](docs/auto-gc.md).
1259
+
1260
+
1261
+
1262
+ Non-TypeScript local code search
1263
+
1264
+ Structural graph parsing remains TypeScript/JavaScript-only.
1265
+
1266
+ Python, Go, Rust, C, and C++ files are now included in deterministic local
1267
+ code search through sanitized file chunks indexed by SQLite FTS5/BM25.
1268
+
1269
+ ```bash
1270
+ toolnet-memory code:capabilities
1271
+ ```
1272
+
1273
+ Optional external LSP installations are detected for capability reporting
1274
+ only. ToolNet does not auto-download or automatically execute language
1275
+ servers during indexing.
1276
+
1277
+ See [`docs/non-ts-intelligence.md`](docs/non-ts-intelligence.md).
@@ -80,6 +80,18 @@ case "$COMMAND" in
80
80
  shift
81
81
  run bundle/gc.js src/retention/cli.ts "$@"
82
82
  ;;
83
+ audit)
84
+ shift
85
+ run bundle/audit.js src/audit/cli.ts "$@"
86
+ ;;
87
+ audit:verify)
88
+ shift
89
+ run bundle/audit.js src/audit/cli.ts verify "$@"
90
+ ;;
91
+ code:capabilities)
92
+ shift
93
+ run bundle/code-capabilities.js src/code-intelligence/parsers/capability-cli.ts "$@"
94
+ ;;
83
95
 
84
96
  run)
85
97
  run bundle/runtime.js src/index.ts