docs: define streaming mcp architecture

This commit is contained in:
a.tolmachev
2026-04-06 01:45:48 +03:00
parent d7e5ae95d6
commit 04ed704e94
12 changed files with 834 additions and 29 deletions
+56 -1
View File
@@ -17,7 +17,7 @@
Каждая `Operation` соответствует одному интеграционному контракту:
- GraphQL -> один конкретный `query` или `mutation`;
- gRPC -> один unary method;
- gRPC -> один unary method или один server-streaming method в bounded execution mode;
- REST -> один endpoint-сценарий.
Однако MCP tool публикуется не напрямую из operation, а через `AgentOperationBinding` внутри конкретного `Agent`.
@@ -54,6 +54,16 @@
Помимо канонической JSON-модели система поддерживает импорт и экспорт конфигураций в `YAML`.
### 2.7. Streaming operation обязана быть bounded
Если операция использует upstream streaming, она должна работать в одном из execution modes:
- `window`
- `session`
- `async_job`
Бесконечный passthrough stream не является допустимой моделью `Operation`.
## 3. Корневые сущности
### 3.1. `Workspace`
@@ -96,6 +106,7 @@
- `samples`
- `generated_draft`
- `config_export`
- `streaming_config`
- `created_at`
- `updated_at`
- `published_at`
@@ -314,6 +325,50 @@
- `p95_ms`
- `p99_ms`
### 3.16. `StreamSession`
Поля:
- `id`
- `workspace_id`
- `agent_id`
- `operation_id`
- `mode`
- `status`
- `cursor`
- `state`
- `expires_at`
- `last_poll_at`
- `created_at`
- `closed_at`
Назначение:
- хранение bounded session state для streaming tools;
- поддержка `start/poll/stop`;
- cleanup orphaned и expired sessions.
### 3.17. `AsyncJobHandle`
Поля:
- `id`
- `workspace_id`
- `agent_id`
- `operation_id`
- `status`
- `progress`
- `result`
- `error`
- `expires_at`
- `created_at`
- `updated_at`
- `finished_at`
Назначение:
- поддержка `start/status/result/cancel` для long-running upstream actions.
## 4. `Target`
`Target` описывает конкретный внешний вызов. Это discriminated union по протоколу.