runtime: sync router/gateway/config policy and clan role registry
This commit is contained in:
@@ -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}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user