Agent routing: - Remove !agent command and manual agent selection flow - Registry auto-assigns agent from user_agents mapping (fallback: agents[0]) - provision_workspace_chat and !new both write agent_id to room_meta - Reconciliation backfills agent_id from registry on cold start - Fix duplicate agent_id block in auth.py Deployment stability: - Add bot-state named volume to persist lambda_matrix.db and matrix_store - Fix docker-compose.prod.yml duplicate environment: key (was silently losing all Matrix credentials) - Fix MATRIX_AGENT_REGISTRY_PATH to use absolute container path /app/config/... - Add bot-state volume declaration to docker-compose.fullstack.yml Docs and config: - Rewrite README.md for platform handoff (deploy table, working commands only) - Rewrite docs/matrix-prototype.md (remove stale commands and mock descriptions) - Remove !save/!load/!context/!agent from help text and welcome message - Add !clear, !list, !remove, !yes/!no to help text - Clean up .env.example (remove Telegram token, internal vars, real URLs) - Update config/matrix-agents.example.yaml with user_agents section and comments - Add explanatory comment to Dockerfile for --ignore-requires-python - Remove silent uv sync fallbacks in Dockerfile
96 lines
3.3 KiB
Python
96 lines
3.3 KiB
Python
from __future__ import annotations
|
|
|
|
from core.protocol import IncomingCommand, OutgoingMessage
|
|
|
|
HELP_TEXT = "\n".join(
|
|
[
|
|
"Команды",
|
|
"",
|
|
"!new [название] создать новый чат",
|
|
"!chats список активных чатов",
|
|
"!rename <название> переименовать текущий чат",
|
|
"!archive архивировать текущий чат",
|
|
"",
|
|
"!clear сбросить контекст текущего чата",
|
|
"",
|
|
"!list показать файлы в очереди",
|
|
"!remove <n> удалить файл из очереди",
|
|
"!remove all очистить очередь файлов",
|
|
"",
|
|
"!yes / !no подтвердить или отменить действие",
|
|
"!help эта справка",
|
|
]
|
|
)
|
|
|
|
|
|
MVP_UNAVAILABLE_TEXT = (
|
|
"Эта команда скрыта в MVP и сейчас недоступна. "
|
|
"Используй !help для списка поддерживаемых команд."
|
|
)
|
|
|
|
|
|
async def handle_settings(
|
|
event: IncomingCommand, auth_mgr, platform, chat_mgr, settings_mgr
|
|
) -> list:
|
|
return [OutgoingMessage(chat_id=event.chat_id, text=MVP_UNAVAILABLE_TEXT)]
|
|
|
|
|
|
async def handle_help(event: IncomingCommand, auth_mgr, platform, chat_mgr, settings_mgr) -> list:
|
|
return [OutgoingMessage(chat_id=event.chat_id, text=HELP_TEXT)]
|
|
|
|
|
|
async def handle_settings_skills(
|
|
event: IncomingCommand, auth_mgr, platform, chat_mgr, settings_mgr
|
|
) -> list:
|
|
return [OutgoingMessage(chat_id=event.chat_id, text=MVP_UNAVAILABLE_TEXT)]
|
|
|
|
|
|
async def handle_settings_connectors(
|
|
event: IncomingCommand, auth_mgr, platform, chat_mgr, settings_mgr
|
|
) -> list:
|
|
return [OutgoingMessage(chat_id=event.chat_id, text=MVP_UNAVAILABLE_TEXT)]
|
|
|
|
|
|
async def handle_settings_soul(
|
|
event: IncomingCommand, auth_mgr, platform, chat_mgr, settings_mgr
|
|
) -> list:
|
|
return [OutgoingMessage(chat_id=event.chat_id, text=MVP_UNAVAILABLE_TEXT)]
|
|
|
|
|
|
async def handle_settings_safety(
|
|
event: IncomingCommand, auth_mgr, platform, chat_mgr, settings_mgr
|
|
) -> list:
|
|
return [OutgoingMessage(chat_id=event.chat_id, text=MVP_UNAVAILABLE_TEXT)]
|
|
|
|
|
|
async def handle_settings_plan(
|
|
event: IncomingCommand, auth_mgr, platform, chat_mgr, settings_mgr
|
|
) -> list:
|
|
return [OutgoingMessage(chat_id=event.chat_id, text=MVP_UNAVAILABLE_TEXT)]
|
|
|
|
|
|
async def handle_settings_status(
|
|
event: IncomingCommand, auth_mgr, platform, chat_mgr, settings_mgr
|
|
) -> list:
|
|
return [OutgoingMessage(chat_id=event.chat_id, text=MVP_UNAVAILABLE_TEXT)]
|
|
|
|
|
|
async def handle_settings_whoami(
|
|
event: IncomingCommand, auth_mgr, platform, chat_mgr, settings_mgr
|
|
) -> list:
|
|
return [OutgoingMessage(chat_id=event.chat_id, text=MVP_UNAVAILABLE_TEXT)]
|
|
|
|
|
|
async def handle_toggle_skill(event, auth_mgr, platform, chat_mgr, settings_mgr) -> list:
|
|
return [OutgoingMessage(chat_id=event.chat_id, text=MVP_UNAVAILABLE_TEXT)]
|
|
|
|
|
|
async def handle_unknown_command(
|
|
event: IncomingCommand, auth_mgr, platform, chat_mgr, settings_mgr
|
|
) -> list:
|
|
return [
|
|
OutgoingMessage(
|
|
chat_id=event.chat_id,
|
|
text="Неизвестная команда. Используй !help для списка поддерживаемых команд.",
|
|
)
|
|
]
|