@gamaze/hicortex 0.10.1 → 0.11.1

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 (49) hide show
  1. package/README.md +42 -0
  2. package/THIRD_PARTY_NOTICES.md +108 -0
  3. package/assets/vendor/3d-force-graph.min.js +5 -0
  4. package/assets/vendor/force-graph.min.js +5 -0
  5. package/assets/vendor/three.core.min.js +6 -0
  6. package/assets/vendor/three.module.min.js +6 -0
  7. package/assets/viz.html +1128 -0
  8. package/dist/classify-domains.d.ts +98 -0
  9. package/dist/classify-domains.js +340 -0
  10. package/dist/cli.d.ts +1 -0
  11. package/dist/cli.js +63 -0
  12. package/dist/consolidate.d.ts +139 -2
  13. package/dist/consolidate.js +302 -87
  14. package/dist/db.js +70 -0
  15. package/dist/domain-classify.d.ts +164 -0
  16. package/dist/domain-classify.js +300 -0
  17. package/dist/extensions.d.ts +12 -0
  18. package/dist/graph.d.ts +56 -0
  19. package/dist/graph.js +145 -0
  20. package/dist/index.js +1 -1
  21. package/dist/init.d.ts +25 -0
  22. package/dist/init.js +54 -0
  23. package/dist/lesson-selection.js +12 -5
  24. package/dist/lessons-context.js +2 -1
  25. package/dist/llm.d.ts +67 -0
  26. package/dist/llm.js +122 -0
  27. package/dist/mcp-server.js +86 -28
  28. package/dist/nightly-status.js +9 -28
  29. package/dist/nightly.js +42 -32
  30. package/dist/nofit.d.ts +111 -0
  31. package/dist/nofit.js +176 -0
  32. package/dist/prompts.d.ts +0 -5
  33. package/dist/prompts.js +5 -29
  34. package/dist/relink.d.ts +100 -0
  35. package/dist/relink.js +277 -0
  36. package/dist/retrieval.d.ts +16 -1
  37. package/dist/retrieval.js +34 -2
  38. package/dist/schema-prototypes.d.ts +149 -0
  39. package/dist/schema-prototypes.js +329 -0
  40. package/dist/state.d.ts +32 -0
  41. package/dist/state.js +29 -0
  42. package/dist/status.js +12 -19
  43. package/dist/storage.d.ts +44 -1
  44. package/dist/storage.js +70 -1
  45. package/dist/types.d.ts +90 -0
  46. package/dist/viz.d.ts +69 -0
  47. package/dist/viz.js +180 -0
  48. package/domains.example.json +36 -0
  49. package/package.json +6 -3
package/README.md CHANGED
@@ -14,6 +14,8 @@ npx @gamaze/hicortex init
14
14
 
15
15
  Detects available LLM candidates (Ollama models, Claude CLI, API keys from env/Hermes/.env/Claude Code settings/OpenClaw), presents a numbered list, and asks you to choose. Installs a persistent MCP server daemon and registers with Claude Code. One command.
16
16
 
17
+ Init also scaffolds five editable default [memory domains](#memory-domains--tags) (Work, Personal, People, Health, Finance) in `~/.hicortex/config.json`. Domain classification activates automatically once an LLM is configured — no extra setup.
18
+
17
19
  ## Install — Client Mode (multi-client)
18
20
 
19
21
  ```bash
@@ -66,6 +68,43 @@ The plugin connects to `http://127.0.0.1:8787` by default. For a remote server,
66
68
  | Agent start | Recent lessons fetched fresh and injected into context | CC SessionStart hook (calls `hicortex lessons-context`) / Hermes plugin prefetch / OC `before_agent_start` hook |
67
69
  | Nightly | Denoise sessions → POST /distill → server distills + embeds + stores → consolidate (score, reflect, link, decay) | Automatic pipeline — no manual steps |
68
70
 
71
+ ## Memory Domains & Tags
72
+
73
+ Domains are your top-level memory spheres — the handful of areas your life or work actually splits into. Every memory gets **multiple weighted tags** from your domain list plus one **primary** domain, so a memory that spans areas (a work project that touches your finances) lives in both instead of being forced into one bin. Domains drive the knowledge index, graph coloring, and lesson selection.
74
+
75
+ `hicortex init` scaffolds five generic defaults: **Work, Personal, People, Health, Finance**. They are a starting point, not a taxonomy — edit them to match how *you* think. Life areas or project/topic areas both work. Your existing list is never overwritten by init.
76
+
77
+ Edit `~/.hicortex/config.json` on the server machine:
78
+
79
+ ```json
80
+ {
81
+ "domains": [
82
+ { "name": "Work", "description": "Your job and professional life — employer, clients, workstreams" },
83
+ { "name": "Personal", "description": "Private life — home, hobbies, everyday matters" },
84
+ { "name": "People", "description": "Relationships — family, friends, social life, network" },
85
+ { "name": "Health", "description": "Fitness, wellbeing, medical" },
86
+ { "name": "Finance", "description": "Money — budgeting, spending, investing" }
87
+ ]
88
+ }
89
+ ```
90
+
91
+ A richer example — including a `compartment: true` work/life firewall and a custom `weakPrimaryFloor` — ships as `domains.example.json` in the package.
92
+
93
+ **How classification works:** the LLM decides only *which* of your domains apply to a memory — never weights or rankings. The weight of each tag is derived from your own data: each domain builds a prototype from the memories already in it, and a tag's weight is how strongly the memory's embedding matches that prototype. The primary domain is picked deterministically from those weights, and everything is recomputed each nightly, so your categories drift with your data instead of going stale. Memories that genuinely fit nothing get a weak association when they are close enough to some domain — and otherwise fade away over time. No junk drawer, no "Unsorted" pile.
94
+
95
+ `weakPrimaryFloor` (config, default 0.45) sets how close a no-fit memory must be to its nearest domain to earn that weak association instead of fading.
96
+
97
+ **Backfill an existing corpus** (server mode, needs `domains` in config):
98
+
99
+ ```bash
100
+ npx @gamaze/hicortex classify-domains # classify unfiled/stale memories
101
+ npx @gamaze/hicortex classify-domains --all # reclassify every memory
102
+ npx @gamaze/hicortex classify-domains --batch 100 # memories per batch (default: 200)
103
+ npx @gamaze/hicortex classify-domains --reset # restart from the beginning (ignore saved cursor)
104
+ ```
105
+
106
+ The run is resumable — interrupt it any time and it continues where it stopped. New memories are classified automatically by the nightly; the backfill is only needed once for a pre-existing corpus or after you reshape your domain list.
107
+
69
108
  ## Agent Tools (MCP)
70
109
 
71
110
  8 tools available via MCP:
@@ -90,6 +129,7 @@ npx @gamaze/hicortex init --server <url> # Set up client mode
90
129
  npx @gamaze/hicortex nightly # Run distill + consolidate (full nightly)
91
130
  npx @gamaze/hicortex nightly --capture-only # Capture only, skip consolidation (safe for sub-daily runs)
92
131
  npx @gamaze/hicortex nightly --dry-run # Preview without changes
132
+ npx @gamaze/hicortex classify-domains # Backfill domain tags over the corpus (see Memory Domains & Tags)
93
133
  npx @gamaze/hicortex status # Show config, DB stats
94
134
  npx @gamaze/hicortex uninstall # Remove CC integration (keeps DB)
95
135
  ```
@@ -131,6 +171,8 @@ Config at `~/.hicortex/config.json`. Created by `init`. Key options:
131
171
  | `reflectBaseUrl` | Separate Ollama instance for reflection (server mode) |
132
172
  | `authToken` | Bearer token for endpoint auth. Generated on first `init` in server mode. Find the active token with `hicortex status` or in `~/.hicortex/config.json`. |
133
173
  | `licenseKey` | Commercial license key (optional; for display in `hicortex status`) |
174
+ | `domains` | Your memory domain list (`[{name, description}]`). Scaffolded by `init`; edit freely — see [Memory Domains & Tags](#memory-domains--tags) |
175
+ | `weakPrimaryFloor` | Minimum similarity for a no-fit memory to keep a weak domain association (default: 0.45) |
134
176
  | `moduleIndexTokenBudget` | Max tokens for domain index in lessons context (default: 500) |
135
177
  | `nightlyHour` | Local hour (0–23) for the nightly job installed by `init` (defaults: client 2, server 3). Applied on fresh installs; existing schedules are never overwritten |
136
178
  | `telemetry` | Anonymous usage telemetry, `false` to opt out |
@@ -0,0 +1,108 @@
1
+ # Third-Party Notices
2
+
3
+ This package vendors the following third-party libraries as pinned, unmodified
4
+ standalone browser bundles under `assets/vendor/`. They are served same-origin
5
+ by the Hicortex daemon for the `/viz` knowledge-graph page (zero external
6
+ requests, works offline). They are NOT runtime npm dependencies; each file was
7
+ copied verbatim from the official npm tarball of the exact version listed.
8
+
9
+ | Library | Version | File(s) in `assets/vendor/` | License | Source tarball |
10
+ |---|---|---|---|---|
11
+ | 3d-force-graph | 1.80.0 | `3d-force-graph.min.js` | MIT | `3d-force-graph-1.80.0.tgz` (`dist/3d-force-graph.min.js`) |
12
+ | force-graph | 1.51.4 | `force-graph.min.js` | MIT | `force-graph-1.51.4.tgz` (`dist/force-graph.min.js`) |
13
+ | three.js | 0.183.0 | `three.module.min.js`, `three.core.min.js` | MIT | `three-0.183.0.tgz` (`build/three.module.min.js`, `build/three.core.min.js`) |
14
+
15
+ Notes:
16
+ - `three.module.min.js` imports `./three.core.min.js` (relative), which is why
17
+ both three.js build files are vendored.
18
+ - three.js is pinned to 0.183.0 to match the three revision (r183) bundled
19
+ inside `3d-force-graph.min.js` 1.80.0, so the page's `window.THREE` and the
20
+ graph renderer use the same three API surface.
21
+
22
+ The full license text for each library follows.
23
+
24
+ ---
25
+
26
+ ## 3d-force-graph 1.80.0
27
+
28
+ Repository: https://github.com/vasturiano/3d-force-graph
29
+
30
+ ```
31
+ MIT License
32
+
33
+ Copyright (c) 2017 Vasco Asturiano
34
+
35
+ Permission is hereby granted, free of charge, to any person obtaining a copy
36
+ of this software and associated documentation files (the "Software"), to deal
37
+ in the Software without restriction, including without limitation the rights
38
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
39
+ copies of the Software, and to permit persons to whom the Software is
40
+ furnished to do so, subject to the following conditions:
41
+
42
+ The above copyright notice and this permission notice shall be included in all
43
+ copies or substantial portions of the Software.
44
+
45
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
46
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
47
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
48
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
49
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
50
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
51
+ SOFTWARE.
52
+ ```
53
+
54
+ ## force-graph 1.51.4
55
+
56
+ Repository: https://github.com/vasturiano/force-graph
57
+
58
+ ```
59
+ MIT License
60
+
61
+ Copyright (c) 2018 Vasco Asturiano
62
+
63
+ Permission is hereby granted, free of charge, to any person obtaining a copy
64
+ of this software and associated documentation files (the "Software"), to deal
65
+ in the Software without restriction, including without limitation the rights
66
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
67
+ copies of the Software, and to permit persons to whom the Software is
68
+ furnished to do so, subject to the following conditions:
69
+
70
+ The above copyright notice and this permission notice shall be included in all
71
+ copies or substantial portions of the Software.
72
+
73
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
74
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
75
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
76
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
77
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
78
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
79
+ SOFTWARE.
80
+ ```
81
+
82
+ ## three.js 0.183.0
83
+
84
+ Repository: https://github.com/mrdoob/three.js
85
+
86
+ ```
87
+ The MIT License
88
+
89
+ Copyright © 2010-2026 three.js authors
90
+
91
+ Permission is hereby granted, free of charge, to any person obtaining a copy
92
+ of this software and associated documentation files (the "Software"), to deal
93
+ in the Software without restriction, including without limitation the rights
94
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
95
+ copies of the Software, and to permit persons to whom the Software is
96
+ furnished to do so, subject to the following conditions:
97
+
98
+ The above copyright notice and this permission notice shall be included in
99
+ all copies or substantial portions of the Software.
100
+
101
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
102
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
103
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
104
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
105
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
106
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
107
+ THE SOFTWARE.
108
+ ```