@gamaze/hicortex 0.19.6 → 0.20.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.
- package/README.md +8 -4
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +8 -1
- package/dist/consolidate.d.ts +21 -0
- package/dist/consolidate.js +68 -8
- package/dist/dashboard.js +5 -2
- package/dist/identity-store.d.ts +3 -3
- package/dist/identity-store.js +2 -2
- package/dist/init.d.ts +10 -1
- package/dist/init.js +210 -22
- package/dist/llm-flight.d.ts +30 -0
- package/dist/llm-flight.js +190 -0
- package/dist/llm.d.ts +32 -0
- package/dist/llm.js +69 -2
- package/dist/nightly.d.ts +41 -0
- package/dist/nightly.js +92 -5
- package/dist/opencode-transcript-reader.d.ts +63 -0
- package/dist/opencode-transcript-reader.js +181 -0
- package/dist/status.js +23 -0
- package/dist/telemetry.d.ts +5 -5
- package/dist/telemetry.js +5 -5
- package/dist/uninstall.js +34 -0
- package/hermes-plugin/hicortex/README.md +2 -2
- package/hermes-plugin/hicortex/config.py +17 -56
- package/hermes-plugin/hicortex/plugin.yaml +2 -2
- package/hermes-plugin/hicortex/provider.py +4 -1
- package/opencode-plugin/hicortex/index.ts +981 -0
- package/package.json +6 -4
- package/pi-extension/hicortex/README.md +56 -0
- package/pi-extension/hicortex/index.ts +888 -0
package/dist/telemetry.js
CHANGED
|
@@ -7,11 +7,11 @@
|
|
|
7
7
|
* v — package version
|
|
8
8
|
* pv — payload schema version
|
|
9
9
|
* mode — server or client
|
|
10
|
-
* agent — cc, pi, oc, or mixed (detected from session
|
|
11
|
-
* when the agent type is genuinely unknown
|
|
12
|
-
* transcripts read yet). The admin summary
|
|
13
|
-
* as "?", distinct from any real type, so
|
|
14
|
-
* client is never miscounted as "cc".
|
|
10
|
+
* agent — cc, hermes, pi, oc, opencode, or mixed (detected from session
|
|
11
|
+
* sources); OMITTED when the agent type is genuinely unknown
|
|
12
|
+
* (pre-flight abort — no transcripts read yet). The admin summary
|
|
13
|
+
* buckets a missing agent as "?", distinct from any real type, so
|
|
14
|
+
* an aborting Hermes/OC client is never miscounted as "cc".
|
|
15
15
|
* mem — total memory count
|
|
16
16
|
* lessons — total lesson count
|
|
17
17
|
* lessonsGenerated — lessons created THIS run (server mode only; the per-run
|
package/dist/uninstall.js
CHANGED
|
@@ -234,6 +234,40 @@ async function runUninstall() {
|
|
|
234
234
|
if ((0, claude_md_js_1.removeLessonsBlock)(CLAUDE_MD)) {
|
|
235
235
|
console.log(" ✓ Removed Hicortex Learnings block from CLAUDE.md");
|
|
236
236
|
}
|
|
237
|
+
// 6. Remove the Pi extension (#348). Guarded on the "hicortex" marker the
|
|
238
|
+
// installer always ships — "hicortex.ts" is a plausible user filename,
|
|
239
|
+
// and uninstall never deletes a file we did not write. Fail-soft when
|
|
240
|
+
// absent (no Pi on the machine) or unreadable.
|
|
241
|
+
const piExtension = (0, node_path_1.join)((0, node_os_1.homedir)(), ".pi", "agent", "extensions", "hicortex.ts");
|
|
242
|
+
if ((0, node_fs_1.existsSync)(piExtension)) {
|
|
243
|
+
try {
|
|
244
|
+
if ((0, node_fs_1.readFileSync)(piExtension, "utf-8").toLowerCase().includes("hicortex")) {
|
|
245
|
+
(0, node_fs_1.unlinkSync)(piExtension);
|
|
246
|
+
console.log(" ✓ Removed Pi extension (~/.pi/agent/extensions/hicortex.ts)");
|
|
247
|
+
}
|
|
248
|
+
else {
|
|
249
|
+
console.log(" ⚠ Skipping ~/.pi/agent/extensions/hicortex.ts — not a Hicortex file, left untouched");
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
catch { /* unreadable — leave it */ }
|
|
253
|
+
}
|
|
254
|
+
// 7. Remove the opencode plugin (#347). Same marker guard — the plugins
|
|
255
|
+
// directory is shared (third-party files live there too), and uninstall
|
|
256
|
+
// never deletes a file we did not write. Fail-soft when absent (no
|
|
257
|
+
// opencode on the machine) or unreadable.
|
|
258
|
+
const openCodePlugin = (0, node_path_1.join)((0, node_os_1.homedir)(), ".config", "opencode", "plugins", "hicortex.ts");
|
|
259
|
+
if ((0, node_fs_1.existsSync)(openCodePlugin)) {
|
|
260
|
+
try {
|
|
261
|
+
if ((0, node_fs_1.readFileSync)(openCodePlugin, "utf-8").toLowerCase().includes("hicortex")) {
|
|
262
|
+
(0, node_fs_1.unlinkSync)(openCodePlugin);
|
|
263
|
+
console.log(" ✓ Removed opencode plugin (~/.config/opencode/plugins/hicortex.ts)");
|
|
264
|
+
}
|
|
265
|
+
else {
|
|
266
|
+
console.log(" ⚠ Skipping ~/.config/opencode/plugins/hicortex.ts — not a Hicortex file, left untouched");
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
catch { /* unreadable — leave it */ }
|
|
270
|
+
}
|
|
237
271
|
console.log(`\n✓ Uninstalled. Database preserved at ${HICORTEX_HOME}/hicortex.db`);
|
|
238
272
|
console.log(" To remove all data: rm -rf ~/.hicortex");
|
|
239
273
|
}
|
|
@@ -78,7 +78,7 @@ hermes memory setup # select "hicortex", enter the server URL/token when promp
|
|
|
78
78
|
|
|
79
79
|
Run it once per profile if you use Hermes profiles. Hermes allows **one** external memory provider at a time, so disable Honcho (or any other) first, then restart the gateway.
|
|
80
80
|
|
|
81
|
-
|
|
81
|
+
Setup asks exactly two questions: the **server URL** and the **auth token**. Everything else has a correct default and is configured — if ever needed — directly in `$HERMES_HOME/plugins/hicortex/config.json`: `default_project` (blank = memories unattributed), `recall_limit` (default 5; sizes the tools and the legacy `/search` fallback only — the pushed recall index is sized by SERVER config `recallMaxItems`), `agent_name` (blank auto-derives from the running profile; pin it only for fleet re-installs — see [Per-agent standing context](#per-agent-standing-context-013)), and `mission_domains` (blank = off; an optional recall boost keyed to the server's domain vocabulary). The auth token is a **secret** — set it via env, not the JSON file:
|
|
82
82
|
|
|
83
83
|
```bash
|
|
84
84
|
export HICORTEX_AUTH_TOKEN=hctx-<your-token> # or your custom token
|
|
@@ -86,7 +86,7 @@ export HICORTEX_AUTH_TOKEN=hctx-<your-token> # or your custom token
|
|
|
86
86
|
|
|
87
87
|
Env overrides: `HICORTEX_URL`, `HICORTEX_AUTH_TOKEN`.
|
|
88
88
|
|
|
89
|
-
> **`privacy_filter` is
|
|
89
|
+
> **`privacy_filter` is REMOVED from setup** (plugin 0.7.4; deprecated since 0.7.2 / server 0.16.2). The server no longer filters on privacy — the `privacy` column is vestigial (stored, never filtered) — so the setting was a no-op the setup flow still prompted for. New setups never see the question; existing config.json files that still carry the key are tolerated (one-time warning in the gateway log; safe to delete the line). For work/personal isolation, run a **separate Hicortex server** per scope rather than relying on in-server privacy filtering.
|
|
90
90
|
|
|
91
91
|
## Topology
|
|
92
92
|
|
|
@@ -36,65 +36,25 @@ CONFIG_SCHEMA: list[dict[str, Any]] = [
|
|
|
36
36
|
"key": "hicortex_auth_token",
|
|
37
37
|
"label": "Auth token",
|
|
38
38
|
"description": (
|
|
39
|
-
"Bearer token for the server.
|
|
40
|
-
"localhost — the server bypasses auth there.
|
|
41
|
-
"
|
|
39
|
+
"Bearer token for the server. Leave blank when targeting "
|
|
40
|
+
"localhost — the server bypasses auth there. To find a remote "
|
|
41
|
+
"server's token, run `hicortex status` on the server machine "
|
|
42
|
+
"(or check ~/.hicortex/config.json there)."
|
|
42
43
|
),
|
|
43
44
|
"secret": True,
|
|
44
45
|
"env_var": "HICORTEX_AUTH_TOKEN",
|
|
45
46
|
},
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
"tools and the legacy pre-0.14 /search prefetch fallback only — "
|
|
58
|
-
"the pushed recall index is sized by SERVER config (recallMaxItems)."
|
|
59
|
-
),
|
|
60
|
-
"default": "5",
|
|
61
|
-
"required": False,
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
"key": "privacy_filter",
|
|
65
|
-
"label": "Privacy filter (DEPRECATED)",
|
|
66
|
-
"description": (
|
|
67
|
-
"DEPRECATED since plugin 0.7.2 / server 0.16.2. The server no "
|
|
68
|
-
"longer filters on privacy — the column is vestigial. This setting "
|
|
69
|
-
"is now a harmless no-op: it is still accepted for backward "
|
|
70
|
-
"compat but ignored. For work/personal isolation, run a separate "
|
|
71
|
-
"Hicortex server per scope. (Historically: comma-separated privacy "
|
|
72
|
-
"levels to include, e.g. WORK,PERSONAL.)"
|
|
73
|
-
),
|
|
74
|
-
"default": "WORK,PERSONAL",
|
|
75
|
-
"required": False,
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
"key": "agent_name",
|
|
79
|
-
"label": "Agent name (per-agent context)",
|
|
80
|
-
"description": (
|
|
81
|
-
"Identity sent as ?agent= when fetching the standing context layer, "
|
|
82
|
-
"so this profile gets its own context (0.13). Leave blank to "
|
|
83
|
-
"auto-derive from the running profile (HERMES_PROFILE / HERMES_HOME)."
|
|
84
|
-
),
|
|
85
|
-
"required": False,
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
"key": "mission_domains",
|
|
89
|
-
"label": "Mission domains",
|
|
90
|
-
"description": (
|
|
91
|
-
"Comma-separated knowledge domains this agent works in (e.g. Health, "
|
|
92
|
-
"or Finance,Work). Recall boosts memories tagged into these domains "
|
|
93
|
-
"(soft — never excludes others). Pick from the domains in your "
|
|
94
|
-
"Hicortex config; leave blank for a general-purpose agent."
|
|
95
|
-
),
|
|
96
|
-
"required": False,
|
|
97
|
-
},
|
|
47
|
+
# 0.7.6: setup asks ONLY url + token. default_project joined the
|
|
48
|
+
# config-only knobs (0.7.5 removed recall_limit / agent_name /
|
|
49
|
+
# mission_domains) after live-install feedback: "no human will understand
|
|
50
|
+
# what it is" — a memory-attribution bucket is not a setup question.
|
|
51
|
+
# Config-only knobs (set directly in config.json, all have correct
|
|
52
|
+
# defaults): default_project (blank = unattributed), recall_limit (5;
|
|
53
|
+
# tools + legacy fallback only — the pushed index is SERVER-sized via
|
|
54
|
+
# recallMaxItems), agent_name (blank auto-derives from the running
|
|
55
|
+
# profile), mission_domains (blank = off).
|
|
56
|
+
# privacy_filter was removed outright in 0.7.4 (dead since server 0.16.2;
|
|
57
|
+
# tolerated at load with a one-time warning if an old file carries it).
|
|
98
58
|
# NOTE: recall-only plugin — no capture config. Capture is handled by the
|
|
99
59
|
# nightly server-side reader of each agent's session store.
|
|
100
60
|
]
|
|
@@ -130,7 +90,8 @@ def load_config() -> Dict[str, Any]:
|
|
|
130
90
|
# Defaults
|
|
131
91
|
cfg.setdefault("hicortex_url", "http://localhost:8787")
|
|
132
92
|
cfg.setdefault("recall_limit", 5)
|
|
133
|
-
|
|
93
|
+
# No privacy_filter default — the setting is dead (see schema note) and
|
|
94
|
+
# must not be injected into new configs.
|
|
134
95
|
|
|
135
96
|
# 0.16.2 deprecation: privacy_filter is a no-op now (server ignores privacy
|
|
136
97
|
# entirely). Warn once per process if the profile explicitly sets it.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
name: hicortex
|
|
2
|
-
version: 0.7.
|
|
3
|
-
description: "Self-learning memory for Hermes agents — every session is distilled into lessons overnight, and your agent wakes up wiser. Pushes a compact per-turn recall index (lazy-loaded with hicortex_get), injects fresh lessons plus a per-agent standing context block, and exposes the full 9-tool memory surface (search, get, recent, ingest, lessons, index, graph, update, delete) via a shared Hicortex server. Stdlib-only."
|
|
2
|
+
version: 0.7.8
|
|
3
|
+
description: "Self-learning memory for Hermes agents — every session is distilled into lessons overnight, and your agent wakes up wiser. Pushes a compact per-turn recall index (lazy-loaded with hicortex_get), injects fresh lessons plus a per-agent standing context block, and exposes the full 9-tool memory surface (search, get, recent, ingest, lessons, index, graph, update, delete) via a shared Hicortex server. Stdlib-only. AFTER INSTALL: run `hermes memory setup`, select hicortex, enter the server URL + token (see the token env var description for where to find it)."
|
|
4
4
|
pip_dependencies: []
|
|
5
5
|
hooks: []
|
|
6
6
|
requires_env:
|
|
@@ -224,7 +224,10 @@ class HicortexProvider(MemoryProvider):
|
|
|
224
224
|
self._recall_limit = int(cfg.get("recall_limit", 5))
|
|
225
225
|
except (TypeError, ValueError):
|
|
226
226
|
self._recall_limit = 5
|
|
227
|
-
|
|
227
|
+
# privacy_filter removed (0.7.4): the server ignores privacy entirely;
|
|
228
|
+
# the dead setting is no longer read. _privacy stays at its inert
|
|
229
|
+
# default for the (equally ignored) wire parameter.
|
|
230
|
+
self._privacy = "WORK,PERSONAL"
|
|
228
231
|
# #203 scope: declared knowledge domains for this role-bound agent
|
|
229
232
|
# (e.g. a health-focused agent → Health). Soft affinity boost on
|
|
230
233
|
# recall; never excludes.
|