runtime: sync router/gateway/config policy and clan role registry

This commit is contained in:
Apple
2026-02-19 00:14:06 -08:00
parent 675b25953b
commit dfc0ef1ceb
35 changed files with 6141 additions and 498 deletions

View File

@@ -6,6 +6,18 @@ from agromatrix_tools import tool_dictionary_review as review
CATEGORIES = {"field","crop","operation","material","unit"}
# Only these slash-commands are treated as operator commands.
# Everything else (e.g. /start, /agromatrix) must fall through to the normal agent flow.
OPERATOR_COMMANDS = {
"whoami",
"pending",
"pending_show",
"approve",
"reject",
"apply_dict",
"pending_stats",
}
def is_operator(user_id: str | None, chat_id: str | None) -> bool:
allowed_ids = [s.strip() for s in os.getenv('AGX_OPERATOR_IDS', '').split(',') if s.strip()]
@@ -23,6 +35,8 @@ def parse_operator_command(text: str):
return None
cmd = parts[0].lstrip('/')
args = parts[1:]
if cmd not in OPERATOR_COMMANDS:
return None
return {"cmd": cmd, "args": args}