nexo-brain 7.23.1 → 7.23.2
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/package.json +1 -1
- package/src/cli.py +21 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nexo-brain",
|
|
3
|
-
"version": "7.23.
|
|
3
|
+
"version": "7.23.2",
|
|
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
|
@@ -413,13 +413,29 @@ def _version_sort_key(raw: str) -> tuple[tuple[int, ...], int, str]:
|
|
|
413
413
|
return (tuple(parts), 1 if not suffix else 0, suffix)
|
|
414
414
|
|
|
415
415
|
|
|
416
|
-
def _version_status_payload() -> dict:
|
|
416
|
+
def _version_status_payload(*, force_refresh: bool = False) -> dict:
|
|
417
417
|
installed = _get_version()
|
|
418
418
|
latest = _load_latest_version_cache()
|
|
419
419
|
latest_source = "cache" if latest else ""
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
420
|
+
should_refresh = False
|
|
421
|
+
if force_refresh and _should_refresh_latest_version():
|
|
422
|
+
# Desktop reads `nexo --version --json` to decide whether to show the
|
|
423
|
+
# Brain update CTA. If a user checked minutes before a release, the
|
|
424
|
+
# 6-hour cache can otherwise hide the new npm dist-tag until it expires.
|
|
425
|
+
should_refresh = (
|
|
426
|
+
latest is None
|
|
427
|
+
or (
|
|
428
|
+
bool(installed)
|
|
429
|
+
and _version_sort_key(latest) <= _version_sort_key(installed)
|
|
430
|
+
)
|
|
431
|
+
)
|
|
432
|
+
elif latest is None and _should_refresh_latest_version():
|
|
433
|
+
should_refresh = True
|
|
434
|
+
if should_refresh:
|
|
435
|
+
refreshed = _fetch_latest_version()
|
|
436
|
+
if refreshed:
|
|
437
|
+
latest = refreshed
|
|
438
|
+
latest_source = "npm"
|
|
423
439
|
if latest and installed and _version_sort_key(latest) < _version_sort_key(installed):
|
|
424
440
|
latest = installed
|
|
425
441
|
latest_source = "installed"
|
|
@@ -4030,7 +4046,7 @@ def main():
|
|
|
4030
4046
|
_print_help()
|
|
4031
4047
|
return 0
|
|
4032
4048
|
if args.version:
|
|
4033
|
-
payload = _version_status_payload()
|
|
4049
|
+
payload = _version_status_payload(force_refresh=bool(args.json))
|
|
4034
4050
|
if args.json:
|
|
4035
4051
|
print(json.dumps(payload, ensure_ascii=False))
|
|
4036
4052
|
else:
|