nexo-brain 2.7.0 → 3.0.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 +66 -12
- package/hooks/hooks.json +79 -0
- package/package.json +1 -1
- package/src/agent_runner.py +295 -7
- package/src/cli.py +111 -0
- package/src/client_preferences.py +99 -1
- package/src/client_sync.py +207 -3
- package/src/cognitive/__init__.py +1 -1
- package/src/cognitive/_search.py +39 -19
- package/src/dashboard/app.py +141 -1
- package/src/dashboard/templates/base.html +4 -0
- package/src/dashboard/templates/protocol.html +199 -0
- package/src/db/__init__.py +23 -1
- package/src/db/_learnings.py +31 -4
- package/src/db/_personal_scripts.py +12 -0
- package/src/db/_protocol.py +303 -0
- package/src/db/_schema.py +248 -0
- package/src/db/_watchers.py +173 -0
- package/src/db/_workflow.py +952 -0
- package/src/doctor/providers/boot.py +45 -19
- package/src/doctor/providers/runtime.py +923 -8
- package/src/evolution_cycle.py +62 -0
- package/src/hook_guardrails.py +308 -0
- package/src/hooks/protocol-guardrail.sh +10 -0
- package/src/nexo_sdk.py +103 -0
- package/src/plugins/cognitive_memory.py +18 -0
- package/src/plugins/cortex.py +55 -35
- package/src/plugins/guard.py +132 -16
- package/src/plugins/protocol.py +911 -0
- package/src/plugins/schedule.py +40 -6
- package/src/plugins/simple_api.py +103 -0
- package/src/plugins/skills.py +67 -0
- package/src/plugins/state_watchers.py +79 -0
- package/src/plugins/workflow.py +588 -0
- package/src/public_contribution.py +86 -12
- package/src/requirements.txt +1 -0
- package/src/script_registry.py +142 -0
- package/src/scripts/deep-sleep/apply_findings.py +204 -0
- package/src/scripts/deep-sleep/collect.py +49 -4
- package/src/scripts/nexo-agent-run.py +2 -0
- package/src/scripts/nexo-daily-self-audit.py +843 -5
- package/src/scripts/nexo-evolution-run.py +343 -1
- package/src/server.py +92 -6
- package/src/skills_runtime.py +151 -0
- package/src/state_watchers_runtime.py +334 -0
- package/src/tools_learnings.py +345 -7
- package/src/tools_sessions.py +183 -0
- package/templates/CLAUDE.md.template +9 -1
- package/templates/CODEX.AGENTS.md.template +10 -2
|
@@ -148,37 +148,63 @@ def check_python_runtime() -> DoctorCheck:
|
|
|
148
148
|
)
|
|
149
149
|
|
|
150
150
|
|
|
151
|
+
CRITICAL_CONFIG_FILES = (
|
|
152
|
+
("schedule.json", ("config", "schedule.json")),
|
|
153
|
+
("optionals.json", ("config", "optionals.json")),
|
|
154
|
+
("crons/manifest.json", ("crons", "manifest.json")),
|
|
155
|
+
)
|
|
156
|
+
|
|
157
|
+
|
|
151
158
|
def check_config_parse() -> DoctorCheck:
|
|
152
|
-
"""
|
|
153
|
-
|
|
154
|
-
|
|
159
|
+
"""Validate that critical JSON config files parse correctly."""
|
|
160
|
+
import json
|
|
161
|
+
|
|
162
|
+
errors: list[str] = []
|
|
163
|
+
checked: list[str] = []
|
|
164
|
+
|
|
165
|
+
for label, relative in CRITICAL_CONFIG_FILES:
|
|
166
|
+
path = NEXO_HOME.joinpath(*relative)
|
|
167
|
+
if not path.exists():
|
|
168
|
+
continue
|
|
169
|
+
try:
|
|
170
|
+
data = json.loads(path.read_text())
|
|
171
|
+
except Exception as exc:
|
|
172
|
+
errors.append(f"{label}: {exc}")
|
|
173
|
+
continue
|
|
174
|
+
if not isinstance(data, dict):
|
|
175
|
+
errors.append(f"{label}: expected JSON object, got {type(data).__name__}")
|
|
176
|
+
continue
|
|
177
|
+
checked.append(label)
|
|
178
|
+
|
|
179
|
+
if errors:
|
|
155
180
|
return DoctorCheck(
|
|
156
181
|
id="boot.config_parse",
|
|
157
182
|
tier="boot",
|
|
158
|
-
status="
|
|
159
|
-
severity="
|
|
160
|
-
summary="
|
|
183
|
+
status="degraded",
|
|
184
|
+
severity="warn",
|
|
185
|
+
summary=f"{len(errors)} config file parse error" + ("s" if len(errors) != 1 else ""),
|
|
186
|
+
evidence=errors,
|
|
187
|
+
repair_plan=["Fix JSON syntax in the listed config files, or delete them to fall back to defaults"],
|
|
161
188
|
)
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
json.loads(schedule_file.read_text())
|
|
189
|
+
|
|
190
|
+
if not checked:
|
|
165
191
|
return DoctorCheck(
|
|
166
192
|
id="boot.config_parse",
|
|
167
193
|
tier="boot",
|
|
168
194
|
status="healthy",
|
|
169
195
|
severity="info",
|
|
170
|
-
summary="
|
|
171
|
-
)
|
|
172
|
-
except Exception as e:
|
|
173
|
-
return DoctorCheck(
|
|
174
|
-
id="boot.config_parse",
|
|
175
|
-
tier="boot",
|
|
176
|
-
status="degraded",
|
|
177
|
-
severity="warn",
|
|
178
|
-
summary=f"schedule.json parse error: {e}",
|
|
179
|
-
repair_plan=["Fix JSON syntax in schedule.json or delete to use defaults"],
|
|
196
|
+
summary="No config files present (using defaults)",
|
|
180
197
|
)
|
|
181
198
|
|
|
199
|
+
return DoctorCheck(
|
|
200
|
+
id="boot.config_parse",
|
|
201
|
+
tier="boot",
|
|
202
|
+
status="healthy",
|
|
203
|
+
severity="info",
|
|
204
|
+
summary=f"{len(checked)} config file" + ("s" if len(checked) != 1 else "") + " parse OK",
|
|
205
|
+
evidence=checked,
|
|
206
|
+
)
|
|
207
|
+
|
|
182
208
|
|
|
183
209
|
def run_boot_checks(fix: bool = False) -> list[DoctorCheck]:
|
|
184
210
|
"""Run all boot-tier checks."""
|