nexo-brain 7.13.5 → 7.13.6

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nexo-brain",
3
- "version": "7.13.5",
3
+ "version": "7.13.6",
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,7 +18,7 @@
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 `7.13.5` is the current packaged-runtime line. Corrective release D.5 correction-learning enforcement is durable, doctor `--fix` explicitly repairs orphan personal schedule metadata, G5 now warns on protected `com.nexo.*.plist` unload/remove flows with the three-layer recovery path, and Codex now gets a managed `PreToolUse` guard for shell/exec_command calls plus `installation_live.codex_protocol_compliance` drift checks. Result: coordinated Desktop bundles can ship the fixed Brain without changing the Mac/Windows installation contract.
21
+ Version `7.13.6` is the current packaged-runtime line. Patch release over v7.13.5 Codex hook sync now renders the managed `PreToolUse` shell/exec_command guard with native Windows `cmd.exe` syntax while preserving the existing POSIX command on macOS/Linux. Result: coordinated Desktop bundles can ship the fixed Brain without changing the Mac/Windows installation contract.
22
22
 
23
23
  Previously in `7.13.3`: unified release — doctor now repairs orphan personal script metadata and ignores historical `versions/**` snapshots, `nexo update` prunes runtime snapshots older than two back, protocol compliance self-heals missing task-open/change-log/stale-session gaps, headless automation uses bounded timeouts, Guardian false positives are tightened, and Codex CLI config/default checks are release-gated. Result: coordinated Desktop bundles can ship the new Brain without changing the Mac/Windows installation contract.
24
24
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nexo-brain",
3
- "version": "7.13.5",
3
+ "version": "7.13.6",
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",
@@ -917,23 +917,43 @@ def _resolve_hook_source_dir(runtime_root: Path) -> Path:
917
917
  return direct
918
918
 
919
919
 
920
- def _render_hook_command(spec: dict, *, nexo_home: Path, runtime_root: Path, hooks_dir: Path) -> str:
920
+ def _cmd_env_assignment(name: str, value: str | os.PathLike[str]) -> str:
921
+ # `set "VAR=value"` is the safe cmd.exe form; it preserves spaces and
922
+ # avoids trailing quote pollution.
923
+ safe_value = str(value).replace('"', r'\"')
924
+ return f'set "{name}={safe_value}"'
925
+
926
+
927
+ def _cmd_args(*args: str | os.PathLike[str]) -> str:
928
+ return subprocess.list2cmdline([str(arg) for arg in args])
929
+
930
+
931
+ def _render_hook_command(
932
+ spec: dict,
933
+ *,
934
+ nexo_home: Path,
935
+ runtime_root: Path,
936
+ hooks_dir: Path,
937
+ windows_shell: bool | None = None,
938
+ ) -> str:
921
939
  command_template = spec.get("command_template")
922
940
  if callable(command_template):
923
941
  return command_template(nexo_home, runtime_root, hooks_dir)
924
942
  handler_name = (spec.get("handler") or spec.get("script") or "").strip()
925
943
  script_path = hooks_dir / handler_name
926
- if spec.get("interpreter") == "python" or handler_name.endswith(".py"):
927
- return (
928
- f"NEXO_HOME={shlex.quote(str(nexo_home))} "
929
- f"NEXO_CODE={shlex.quote(str(runtime_root))} "
930
- f"{shlex.quote(_resolve_python(nexo_home))} {shlex.quote(str(script_path))}"
931
- )
932
- return (
933
- f"NEXO_HOME={shlex.quote(str(nexo_home))} "
934
- f"NEXO_CODE={shlex.quote(str(runtime_root))} "
935
- f"bash {shlex.quote(str(script_path))}"
944
+ use_windows_shell = (os.name == "nt") if windows_shell is None else bool(windows_shell)
945
+ env_prefix = (
946
+ f"{_cmd_env_assignment('NEXO_HOME', nexo_home)} && {_cmd_env_assignment('NEXO_CODE', runtime_root)} && "
947
+ if use_windows_shell
948
+ else f"NEXO_HOME={shlex.quote(str(nexo_home))} NEXO_CODE={shlex.quote(str(runtime_root))} "
936
949
  )
950
+ if spec.get("interpreter") == "python" or handler_name.endswith(".py"):
951
+ if use_windows_shell:
952
+ return f"{env_prefix}{_cmd_args(_resolve_python(nexo_home), script_path)}"
953
+ return env_prefix + f"{shlex.quote(_resolve_python(nexo_home))} {shlex.quote(str(script_path))}"
954
+ if use_windows_shell:
955
+ return f"{env_prefix}{_cmd_args('bash', script_path)}"
956
+ return env_prefix + f"bash {shlex.quote(str(script_path))}"
937
957
 
938
958
 
939
959
  def _hook_identity(command: str) -> str: