nexo-brain 5.4.0 → 5.4.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/.claude-plugin/plugin.json +1 -1
- package/README.md +2 -2
- package/package.json +1 -1
- package/src/cli.py +21 -0
- package/src/hooks/capture-session.sh +31 -9
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nexo-brain",
|
|
3
|
-
"version": "5.4.
|
|
3
|
+
"version": "5.4.1",
|
|
4
4
|
"description": "Local cognitive runtime for Claude Code \u2014 persistent memory, overnight learning, doctor diagnostics, personal scripts, recovery-aware jobs, startup preflight, and optional dashboard/power helper.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "NEXO Brain",
|
package/README.md
CHANGED
|
@@ -18,9 +18,9 @@
|
|
|
18
18
|
|
|
19
19
|
[Watch the overview video](https://nexo-brain.com/watch/) · [Watch on YouTube](https://www.youtube.com/watch?v=i2lkGhKyVqI) · [Open the infographic](https://nexo-brain.com/assets/nexo-brain-infographic-v5.png)
|
|
20
20
|
|
|
21
|
-
Version `5.4.
|
|
21
|
+
Version `5.4.1` is the current packaged-runtime line: hook hygiene fix — the PostToolUse `capture-session.sh` hook had been reading a nonexistent env var since 2026-04-12, silently writing `"tool":"unknown"` to the Sensory Register for 48 hours. v5.4.1 parses the tool name from stdin JSON, removes the filter that was hiding `Bash`, and purges pre-fix entries from the buffer on update.
|
|
22
22
|
|
|
23
|
-
Previously in `5.
|
|
23
|
+
Previously in `5.4.0`: runtime event bus at `~/.nexo/runtime/events.ndjson`, `nexo notify`, `nexo health --json`, `nexo logs --tail --json`, and a safe flat→nested migration for `calibration.json`.
|
|
24
24
|
|
|
25
25
|
Start here:
|
|
26
26
|
- [5-minute quickstart](docs/quickstart-5-minutes.md)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nexo-brain",
|
|
3
|
-
"version": "5.4.
|
|
3
|
+
"version": "5.4.1",
|
|
4
4
|
"mcpName": "io.github.wazionapps/nexo",
|
|
5
5
|
"description": "NEXO Brain — Shared brain for AI agents. Persistent memory, semantic RAG, natural forgetting, metacognitive guard, trust scoring, 150+ MCP tools. Works with Claude Code, Codex, Claude Desktop & any MCP client. 100% local, free.",
|
|
6
6
|
"homepage": "https://nexo-brain.com",
|
package/src/cli.py
CHANGED
|
@@ -935,6 +935,27 @@ def _update(args):
|
|
|
935
935
|
except Exception:
|
|
936
936
|
pass
|
|
937
937
|
|
|
938
|
+
# v5.4.1 one-time hygiene: purge pre-fix "tool":"unknown" entries from
|
|
939
|
+
# the sensory-register buffer. Keeps a .pre-v5.4.1.bak backup the first
|
|
940
|
+
# time it runs on a given host.
|
|
941
|
+
try:
|
|
942
|
+
buf = NEXO_HOME / "brain" / "session_buffer.jsonl"
|
|
943
|
+
marker = buf.with_suffix(".jsonl.pre-v5.4.1.bak")
|
|
944
|
+
if buf.is_file() and not marker.is_file():
|
|
945
|
+
raw = buf.read_text(errors="ignore").splitlines()
|
|
946
|
+
unknown = sum(1 for ln in raw if '"tool":"unknown"' in ln)
|
|
947
|
+
if unknown > 0:
|
|
948
|
+
buf.rename(marker)
|
|
949
|
+
cleaned = "\n".join(ln for ln in raw if '"tool":"unknown"' not in ln)
|
|
950
|
+
if cleaned:
|
|
951
|
+
cleaned += "\n"
|
|
952
|
+
buf.write_text(cleaned)
|
|
953
|
+
if not args.json:
|
|
954
|
+
print(f"[NEXO] session_buffer.jsonl: purged {unknown} legacy "
|
|
955
|
+
f"\"tool\":\"unknown\" entries (backup: {marker.name})", flush=True)
|
|
956
|
+
except Exception:
|
|
957
|
+
pass
|
|
958
|
+
|
|
938
959
|
return 0 if result.get("ok") else 1
|
|
939
960
|
|
|
940
961
|
|
|
@@ -1,21 +1,43 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
2
|
# NEXO PostToolUse hook — captures tool usage to session_buffer.jsonl
|
|
3
|
-
#
|
|
3
|
+
# Feeds the Sensory Register (Atkinson-Shiffrin Layer 1).
|
|
4
|
+
#
|
|
5
|
+
# IMPORTANT: Claude Code passes the tool name in a JSON payload over stdin,
|
|
6
|
+
# NOT as the $CLAUDE_TOOL_NAME env var. Earlier revisions of this hook
|
|
7
|
+
# assumed the env var existed and always wrote "unknown", masking the
|
|
8
|
+
# entire sensory-register stream. Do not reintroduce that pattern.
|
|
9
|
+
|
|
10
|
+
set -uo pipefail
|
|
4
11
|
|
|
5
12
|
NEXO_HOME="${NEXO_HOME:-$HOME/.nexo}"
|
|
6
13
|
BUFFER="$NEXO_HOME/brain/session_buffer.jsonl"
|
|
7
|
-
|
|
8
14
|
mkdir -p "$NEXO_HOME/brain"
|
|
9
15
|
|
|
10
|
-
# Capture basic event: timestamp + tool name
|
|
11
|
-
# Read stdin (Claude Code passes JSON via stdin for PostToolUse hooks)
|
|
12
16
|
INPUT=$(cat 2>/dev/null || true)
|
|
13
|
-
|
|
14
|
-
|
|
17
|
+
[ -z "$INPUT" ] && exit 0
|
|
18
|
+
|
|
19
|
+
# Extract tool_name from the stdin JSON payload. Fall back to env var for
|
|
20
|
+
# compatibility with any platform that still sets it; final fallback is an
|
|
21
|
+
# empty string, in which case we exit without writing so "unknown" noise
|
|
22
|
+
# never reaches the buffer.
|
|
23
|
+
TOOL_NAME=$(echo "$INPUT" \
|
|
24
|
+
| python3 -c "import sys,json; print(json.load(sys.stdin).get('tool_name',''))" 2>/dev/null \
|
|
25
|
+
|| true)
|
|
26
|
+
if [ -z "$TOOL_NAME" ]; then
|
|
27
|
+
TOOL_NAME="${CLAUDE_TOOL_NAME:-}"
|
|
28
|
+
fi
|
|
29
|
+
[ -z "$TOOL_NAME" ] && exit 0
|
|
15
30
|
|
|
16
|
-
#
|
|
31
|
+
# Skip high-frequency read-only tools: they add noise without signal.
|
|
32
|
+
# Bash / Write / Edit / MultiEdit / Task / MCP tools ARE kept — that is
|
|
33
|
+
# where real state change happens and where the sensory register matters.
|
|
17
34
|
case "$TOOL_NAME" in
|
|
18
|
-
Read|Glob|Grep|LS|
|
|
35
|
+
Read|Glob|Grep|LS|Skill|ToolSearch|TodoWrite) exit 0 ;;
|
|
19
36
|
esac
|
|
20
37
|
|
|
21
|
-
|
|
38
|
+
TS=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
|
|
39
|
+
# Escape embedded quotes / special chars in tool names (MCP names can be
|
|
40
|
+
# long and contain colons, underscores, and dashes).
|
|
41
|
+
ESCAPED_NAME=$(printf '%s' "$TOOL_NAME" \
|
|
42
|
+
| python3 -c "import sys,json; print(json.dumps(sys.stdin.read().strip()))")
|
|
43
|
+
echo "{\"ts\":\"$TS\",\"tool\":$ESCAPED_NAME,\"source\":\"hook\"}" >> "$BUFFER"
|