n2-soul 9.0.1 → 9.0.3

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 (81) hide show
  1. package/CHANGELOG.md +114 -103
  2. package/README.ko.md +496 -496
  3. package/README.md +586 -595
  4. package/dist/index.js +9 -1
  5. package/dist/index.js.map +1 -1
  6. package/dist/lib/agent-registry.d.ts +17 -0
  7. package/dist/lib/agent-registry.js +67 -0
  8. package/dist/lib/agent-registry.js.map +1 -0
  9. package/dist/lib/config.d.ts +3 -0
  10. package/dist/lib/config.default.d.ts +3 -0
  11. package/dist/lib/config.default.js +66 -0
  12. package/dist/lib/config.default.js.map +1 -0
  13. package/dist/lib/config.js +47 -0
  14. package/dist/lib/config.js.map +1 -0
  15. package/dist/lib/context.d.ts +15 -0
  16. package/dist/lib/context.js +35 -0
  17. package/dist/lib/context.js.map +1 -0
  18. package/dist/lib/core-memory.d.ts +34 -0
  19. package/dist/lib/core-memory.js +102 -0
  20. package/dist/lib/core-memory.js.map +1 -0
  21. package/dist/lib/entity-memory.d.ts +58 -0
  22. package/dist/lib/entity-memory.js +190 -0
  23. package/dist/lib/entity-memory.js.map +1 -0
  24. package/dist/lib/intercom-log.d.ts +41 -0
  25. package/dist/lib/intercom-log.js +163 -0
  26. package/dist/lib/intercom-log.js.map +1 -0
  27. package/dist/lib/kv-cache/agent-adapter.d.ts +44 -0
  28. package/dist/lib/kv-cache/agent-adapter.js +132 -0
  29. package/dist/lib/kv-cache/agent-adapter.js.map +1 -0
  30. package/dist/lib/kv-cache/backup.d.ts +64 -0
  31. package/dist/lib/kv-cache/backup.js +335 -0
  32. package/dist/lib/kv-cache/backup.js.map +1 -0
  33. package/dist/lib/kv-cache/compressor.d.ts +20 -0
  34. package/dist/lib/kv-cache/compressor.js +92 -0
  35. package/dist/lib/kv-cache/compressor.js.map +1 -0
  36. package/dist/lib/kv-cache/embedding.d.ts +39 -0
  37. package/dist/lib/kv-cache/embedding.js +164 -0
  38. package/dist/lib/kv-cache/embedding.js.map +1 -0
  39. package/dist/lib/kv-cache/index.d.ts +84 -0
  40. package/dist/lib/kv-cache/index.js +320 -0
  41. package/dist/lib/kv-cache/index.js.map +1 -0
  42. package/dist/lib/kv-cache/schema.d.ts +60 -0
  43. package/dist/lib/kv-cache/schema.js +85 -0
  44. package/dist/lib/kv-cache/schema.js.map +1 -0
  45. package/dist/lib/kv-cache/snapshot.d.ts +42 -0
  46. package/dist/lib/kv-cache/snapshot.js +220 -0
  47. package/dist/lib/kv-cache/snapshot.js.map +1 -0
  48. package/dist/lib/kv-cache/sqlite-store.d.ts +66 -0
  49. package/dist/lib/kv-cache/sqlite-store.js +343 -0
  50. package/dist/lib/kv-cache/sqlite-store.js.map +1 -0
  51. package/dist/lib/kv-cache/tier-manager.d.ts +71 -0
  52. package/dist/lib/kv-cache/tier-manager.js +146 -0
  53. package/dist/lib/kv-cache/tier-manager.js.map +1 -0
  54. package/dist/lib/kv-cache/token-saver.d.ts +19 -0
  55. package/dist/lib/kv-cache/token-saver.js +99 -0
  56. package/dist/lib/kv-cache/token-saver.js.map +1 -0
  57. package/dist/lib/paths.d.ts +6 -0
  58. package/dist/lib/paths.js +33 -0
  59. package/dist/lib/paths.js.map +1 -0
  60. package/dist/lib/soul-engine.d.ts +43 -0
  61. package/dist/lib/soul-engine.js +276 -0
  62. package/dist/lib/soul-engine.js.map +1 -0
  63. package/dist/lib/utils.d.ts +16 -0
  64. package/dist/lib/utils.js +185 -0
  65. package/dist/lib/utils.js.map +1 -0
  66. package/dist/sequences/boot.d.ts +13 -0
  67. package/dist/sequences/boot.js +154 -0
  68. package/dist/sequences/boot.js.map +1 -0
  69. package/dist/sequences/end.d.ts +3 -0
  70. package/dist/sequences/end.js +210 -0
  71. package/dist/sequences/end.js.map +1 -0
  72. package/dist/sequences/work.d.ts +17 -0
  73. package/dist/sequences/work.js +244 -0
  74. package/dist/sequences/work.js.map +1 -0
  75. package/dist/tools/brain.d.ts +3 -0
  76. package/dist/tools/brain.js +93 -0
  77. package/dist/tools/brain.js.map +1 -0
  78. package/dist/tools/kv-cache.d.ts +3 -0
  79. package/dist/tools/kv-cache.js +181 -0
  80. package/dist/tools/kv-cache.js.map +1 -0
  81. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,103 +1,114 @@
1
- # Changelog
2
-
3
- All notable changes to Soul are documented here.
4
-
5
- ## [9.0.0] — 2026-03-26
6
-
7
- ### 🔒 Strict TypeScript Migration
8
-
9
- Soul is now fully written in **TypeScript strict mode** with zero `any` usage.
10
-
11
- #### Added
12
- - **ESLint strict rules** automated detection of floating promises, unused vars, type safety violations
13
- - **30 unit tests** — utils, soul-engine, kv-cache, and dispose pattern verification
14
- - **`npm run verify`** — one-command pipeline: typecheck + lint + build + test
15
- - **`SoulKVCache.dispose()`** — proper timer cleanup for backup scheduler
16
- - **`disposeWorkSequence()`**GC timer cleanup for test environments
17
- - **HTTP response size limit** (10MB) for Ollama embedding requests
18
- - **`sql-js.d.ts`** custom type declarations for sql.js WASM module
19
-
20
- #### Fixed
21
- - **CRITICAL**: `stmt.free()` / `embStmt.free()` now wrapped in `try/finally` blocks (WASM memory leak prevention)
22
- - **CRITICAL**: `.catch(() => {})` silent error swallowing replaced with `logError()`
23
- - **HIGH**: Floating promise in auto-backup timer added `void` + `.catch()` error handling
24
- - **HIGH**: `Buffer` + `string` concatenation explicit `.toString()` conversion
25
-
26
- #### Changed
27
- - Source code migrated from CommonJS to `import/export` (ESM-style), compiled output remains CJS for compatibility
28
- - 13 `require()` calls 9 static `import` + 4 documented lazy `require()` (circular deps, runtime optional)
29
- - `export =` `export default` for ESM/CJS interop
30
- - `tsconfig.json` — `strict: true`, `noUncheckedIndexedAccess`, `noUnusedLocals`, `noUnusedParameters`
31
-
32
- #### Dependencies Added (devDependencies)
33
- - `eslint` ^9.x
34
- - `@eslint/js` ^9.x
35
- - `typescript-eslint` ^8.x
36
-
37
- ---
38
-
39
- ## [8.0.0] 2026-03-26
40
-
41
- ### 🧠 Forgetting Curve Intelligent Memory
42
-
43
- Soul now remembers what matters and forgets what doesn't, inspired by Ebbinghaus' forgetting curve.
44
-
45
- #### Added
46
- - **Forgetting Curve GC** — retention formula: `importance × (1 + log₂(1 + accessCount)) × e^(−λ × ageDays)`
47
- - **3-tier memory lifecycle** — Hot (0–7d, in-memory + disk) → Warm (8–30d, disk) → Cold (30d+, archived)
48
- - **Async I/O** — all hot-path operations non-blocking (42% faster KV load, 3x+ search throughput)
49
- - **Schema v2** — `accessCount`, `lastAccessed`, `importance`, `tier` fields (auto-migrated from v1)
50
- - **SQLite backend** `sql.js` WASM-based, no native bindings needed
51
- - **Incremental backups** — portable SQLite backup/restore with configurable retention
52
- - **Semantic search**Ollama `nomic-embed-text` embedding integration
53
-
54
- #### Changed
55
- - SDK Native Migration — removed legacy `registerTool` shim, direct `server.tool()` API
56
- - `z.any()` eliminated from all tool schema definitions
57
-
58
- ---
59
-
60
- ## [7.0.0]2026-03
61
-
62
- ### 🕸️ ArachneCode Context Assembly
63
-
64
- > **Note**: Arachne has been separated into its own package [`n2-arachne`](https://github.com/choihyunsus/n2-arachne) as of v8.0.
65
-
66
- - BM25 search + dependency tracking + smart assembly
67
- - 50,000 file project 30 most relevant chunks → 30K tokens (instead of 500K+)
68
- - Ollama semantic search support
69
-
70
- ---
71
-
72
- ## [6.0.0] — 2026-03
73
-
74
- ### 🛡️ Ark — AI Safety System
75
-
76
- > **Note**: Ark has been separated into its own package [`n2-ark`](https://github.com/choihyunsus/n2-ark) as of v8.0.
77
-
78
- - Zero-token-cost safety enforcement via regex pattern matching
79
- - Multi-layer response system (WARN → MODIFY → BLOCK → LOCKDOWN)
80
- - `.n2` rule file format with 7 domain templates
81
- - Full MCP compatibility
82
-
83
- ---
84
-
85
- ## [5.0.0]2026-02
86
-
87
- ### 🏷️ Entity & Core Memory
88
-
89
- - **Entity Memory** auto-track people, hardware, projects, concepts
90
- - **Core Memory** per-agent always-loaded facts
91
- - **Auto-extraction** entities and insights saved automatically at `n2_work_end`
92
- - **Context Search** — keyword search across Brain + Ledger
93
-
94
- ---
95
-
96
- ## [4.0.0] — 2026-01
97
-
98
- ### 📋 Soul Board & Ledger
99
-
100
- - **Soul Board** — project state + TODO tracking + cross-agent handoff
101
- - **Immutable Ledger** — append-only work logs with date-based partitioning
102
- - **File Ownership** — collision prevention for multi-agent environments
103
- - **Shared Brain** — file-based shared memory with path traversal protection
1
+ # Changelog
2
+
3
+ All notable changes to Soul are documented here.
4
+
5
+ ## [9.0.2] — 2026-03-27
6
+
7
+ ### Packaging Fix
8
+
9
+ #### Fixed
10
+ - **CRITICAL**: `.npmignore` excluded `dist/lib/`, `dist/sequences/`, `dist/tools/`, and `dist/index.js` — npm installs failed with `Cannot find module './lib/config'` ([#issue](https://github.com/choihyunsus/soul/issues))
11
+ - Root-anchored all ignore patterns with leading `/` so they no longer match inside `dist/`
12
+ - Removed compiled test files (`dist/tests/`) from the published tarball (88 files, down from 100)
13
+
14
+ ---
15
+
16
+ ## [9.0.0]2026-03-26
17
+
18
+ ### Strict TypeScript Migration
19
+
20
+ Soul is now fully written in **TypeScript strict mode** with zero `any` usage.
21
+
22
+ #### Added
23
+ - **ESLint strict rules** automated detection of floating promises, unused vars, type safety violations
24
+ - **30 unit tests** utils, soul-engine, kv-cache, and dispose pattern verification
25
+ - **`npm run verify`** — one-command pipeline: typecheck + lint + build + test
26
+ - **`SoulKVCache.dispose()`** — proper timer cleanup for backup scheduler
27
+ - **`disposeWorkSequence()`** GC timer cleanup for test environments
28
+ - **HTTP response size limit** (10MB) for Ollama embedding requests
29
+ - **`sql-js.d.ts`** custom type declarations for sql.js WASM module
30
+
31
+ #### Fixed
32
+ - **CRITICAL**: `stmt.free()` / `embStmt.free()` now wrapped in `try/finally` blocks (WASM memory leak prevention)
33
+ - **CRITICAL**: `.catch(() => {})` silent error swallowing replaced with `logError()`
34
+ - **HIGH**: Floating promise in auto-backup timer — added `void` + `.catch()` error handling
35
+ - **HIGH**: `Buffer` + `string` concatenation — explicit `.toString()` conversion
36
+
37
+ #### Changed
38
+ - Source code migrated from CommonJS to `import/export` (ESM-style), compiled output remains CJS for compatibility
39
+ - 13 `require()` calls → 9 static `import` + 4 documented lazy `require()` (circular deps, runtime optional)
40
+ - `export =` → `export default` for ESM/CJS interop
41
+ - `tsconfig.json` `strict: true`, `noUncheckedIndexedAccess`, `noUnusedLocals`, `noUnusedParameters`
42
+
43
+ #### Dependencies Added (devDependencies)
44
+ - `eslint` ^9.x
45
+ - `@eslint/js` ^9.x
46
+ - `typescript-eslint` ^8.x
47
+
48
+ ---
49
+
50
+ ## [8.0.0]2026-03-26
51
+
52
+ ### Forgetting CurveIntelligent Memory
53
+
54
+ Soul now remembers what matters and forgets what doesn't, inspired by Ebbinghaus' forgetting curve.
55
+
56
+ #### Added
57
+ - **Forgetting Curve GC** — retention formula: `importance × (1 + log₂(1 + accessCount)) × e^(−λ × ageDays)`
58
+ - **3-tier memory lifecycle** — Hot (0–7d, in-memory + disk) → Warm (8–30d, disk) → Cold (30d+, archived)
59
+ - **Async I/O** — all hot-path operations non-blocking (42% faster KV load, 3x+ search throughput)
60
+ - **Schema v2** `accessCount`, `lastAccessed`, `importance`, `tier` fields (auto-migrated from v1)
61
+ - **SQLite backend** — `sql.js` WASM-based, no native bindings needed
62
+ - **Incremental backups**portable SQLite backup/restore with configurable retention
63
+ - **Semantic search** — Ollama `nomic-embed-text` embedding integration
64
+
65
+ #### Changed
66
+ - SDK Native Migration removed legacy `registerTool` shim, direct `server.tool()` API
67
+ - `z.any()` eliminated from all tool schema definitions
68
+
69
+ ---
70
+
71
+ ## [7.0.0] — 2026-03
72
+
73
+ ### Arachne — Code Context Assembly
74
+
75
+ > **Note**: Arachne has been separated into its own package [`n2-arachne`](https://github.com/choihyunsus/n2-arachne) as of v8.0.
76
+
77
+ - BM25 search + dependency tracking + smart assembly
78
+ - 50,000 file project 30 most relevant chunks → 30K tokens (instead of 500K+)
79
+ - Ollama semantic search support
80
+
81
+ ---
82
+
83
+ ## [6.0.0] — 2026-03
84
+
85
+ ### ArkAI Safety System
86
+
87
+ > **Note**: Ark has been separated into its own package [`n2-ark`](https://github.com/choihyunsus/n2-ark) as of v8.0.
88
+
89
+ - Zero-token-cost safety enforcement via regex pattern matching
90
+ - Multi-layer response system (WARN MODIFY → BLOCK → LOCKDOWN)
91
+ - `.n2` rule file format with 7 domain templates
92
+ - Full MCP compatibility
93
+
94
+ ---
95
+
96
+ ## [5.0.0] — 2026-02
97
+
98
+ ### Entity & Core Memory
99
+
100
+ - **Entity Memory** — auto-track people, hardware, projects, concepts
101
+ - **Core Memory** — per-agent always-loaded facts
102
+ - **Auto-extraction** — entities and insights saved automatically at `n2_work_end`
103
+ - **Context Search** — keyword search across Brain + Ledger
104
+
105
+ ---
106
+
107
+ ## [4.0.0] — 2026-01
108
+
109
+ ### Soul Board & Ledger
110
+
111
+ - **Soul Board** — project state + TODO tracking + cross-agent handoff
112
+ - **Immutable Ledger** — append-only work logs with date-based partitioning
113
+ - **File Ownership** — collision prevention for multi-agent environments
114
+ - **Shared Brain** — file-based shared memory with path traversal protection