Remove session management concepts (no create_session/close_session/
DELETE /sessions — Master handles container lifecycle automatically).
Update PlatformClient contract, ChatContext, project structure tree,
and FSM diagrams across all docs to match the implemented core/.
- README.md: fix core/ structure tree + PlatformClient snippet
- docs/surface-protocol.md: remove session.py/_template.py, fix
ChatContext (drop session_id), fix PlatformClient contract, fix
"free features" list
- docs/telegram-prototype.md: remove "создаёт сессию на платформе"
- docs/matrix-prototype.md: same + remove !sessions, fix FSM
(SessionCreated → ChatCreated), fix status block
- docs/user-flow.md: rewrite sequence diagram to POST /users/{id}/
chats/{id}/messages; update FSM states
65 lines
2.4 KiB
Markdown
65 lines
2.4 KiB
Markdown
# User Flow — Lambda Bot
|
||
|
||
> **Статус:** ШАБЛОН — заполняет @architect после исследований
|
||
> **Зависит от:** docs/research/telegram-flows.md, docs/research/competitor-ux.md
|
||
|
||
---
|
||
|
||
## Основной сценарий (happy path)
|
||
|
||
```mermaid
|
||
sequenceDiagram
|
||
actor User
|
||
participant Bot as Telegram/Matrix Bot
|
||
participant Platform as Lambda Platform (Master)
|
||
|
||
User->>Bot: /start
|
||
Bot->>Platform: GET /users/{tg_id}?platform=telegram
|
||
Platform-->>Bot: {user_id, is_new}
|
||
|
||
alt Новый пользователь
|
||
Bot->>User: Приветствие + инструкция
|
||
else Существующий пользователь
|
||
Bot->>User: Добро пожаловать обратно
|
||
end
|
||
|
||
loop Диалог (бот не управляет сессиями — Master делает это автоматически)
|
||
User->>Bot: Сообщение в чат C1/C2/...
|
||
Bot->>Platform: POST /users/{user_id}/chats/{chat_id}/messages
|
||
Note over Platform: Master поднимает контейнер,<br/>монтирует нужный чат, запускает агента
|
||
Platform-->>Bot: {message_id, response, tokens_used}
|
||
Bot->>User: Ответ агента
|
||
end
|
||
```
|
||
|
||
---
|
||
|
||
## Состояния FSM (Telegram)
|
||
|
||
```mermaid
|
||
stateDiagram-v2
|
||
[*] --> Unauthenticated: первый контакт
|
||
|
||
Unauthenticated --> Idle: /start (auth confirmed)
|
||
|
||
Idle --> WaitingResponse: сообщение пользователя
|
||
WaitingResponse --> Idle: ответ получен
|
||
WaitingResponse --> Error: ошибка платформы
|
||
|
||
Idle --> Idle: /new (создан новый чат)
|
||
Idle --> ConfirmAction: агент запрашивает подтверждение
|
||
ConfirmAction --> Idle: подтверждено / отменено
|
||
|
||
Error --> Idle: /start
|
||
```
|
||
|
||
---
|
||
|
||
## Открытые вопросы
|
||
|
||
> Заполняет @researcher и @architect после исследований
|
||
|
||
- [ ] Как выглядит онбординг новых пользователей у конкурентов?
|
||
- [ ] Нужна ли кнопка "Новая сессия" или сессия стартует автоматически?
|
||
- [ ] Что показываем пока агент думает (typing indicator)?
|
||
- [ ] Как обрабатываем timeout ответа от платформы?
|