feat: add tool scoping and orchestration markers to agent tool registry

Introduce `mark_orchestration_tools`, `set_tool_scope`, and `reset_tool_scope` in `agents/agent.py` to allow runtime filtering of tool payloads by scope and orchestration flag. Refactor `get_tool_payloads` to respect the active scope and exclude orchestration-only tools. Update `agents/core/__init__.py` with `worker_tool_names` helper that returns read/reasoning tools plus conditional write/verify tools per mode, replacing the old `payloads_for` exclusion logic. Modify `agents/maestro.py` to call `mark_orchestration_tools` and wire per-agent result recording via `on_result` callback in `run_fleet`. Extend `agents/orchestrator.py` `run_fleet` signature to accept an optional `on_result` callable and invoke it after each agent run. Revise `agents/style.py` em-dash rule to distinguish prose from data occurrences, and add repository layout guidance to `agents/base.py` MAINT_HEADER.
This commit is contained in:
2026-06-12 04:30:08 +00:00
parent 31841fece4
commit 5e6b1c09df
38 changed files with 679 additions and 86 deletions
+1 -2
View File
@@ -2,7 +2,6 @@
import json
import logging
import os
from dataclasses import dataclass, field, asdict
from pathlib import Path
@@ -55,7 +54,7 @@ class BotState:
path.parent.mkdir(parents=True, exist_ok=True)
tmp = path.with_suffix(path.suffix + ".tmp")
tmp.write_text(json.dumps(asdict(self), indent=2, default=str))
os.replace(str(tmp), str(path))
tmp.replace(path)
@classmethod
def load(cls, path: Path) -> "BotState":