3.3 KiB
3.3 KiB
Задача для Codex
Цель
Создать отдельный проект ai-orchestrator.
Это серверный orchestrator/runtime для управления AI-задачами, моделями, MCP-tools и local workers.
Проект не должен быть частью текущего Local LLM Platform.
Основные принципы
- Orchestrator — главный сервис.
- Agent — не отдельная сущность, а execution profile.
- Сложные задачи выполняются через execution graph.
- Workers не создают других workers.
- Local Worker — тонкий исполнитель на компьютере пользователя.
- В коде нет hardcoded bans.
- Все ограничения — через настраиваемую policy.
- Система должна работать без внешнего ИИ.
- Strong model может быть локальной или внешней.
- Vision model — отдельный слот.
Реализовать структуру
src/
orchestrator/
agent_runtime/
model_router/
mcp_client/
local_worker_protocol/
policy/
api/
logging/
storage/
MVP функции
1. API
Реализовать:
POST /chat
POST /tasks
GET /tasks/{id}
GET /tasks/{id}/events
POST /confirmations/{id}/approve
POST /confirmations/{id}/reject
GET /workers
2. Orchestrator
Должен:
- принимать task;
- создавать execution graph;
- запускать nodes;
- вызывать model router;
- вызывать MCP client;
- отправлять команды local worker;
- обрабатывать confirmation_required;
- писать event log.
3. Execution Graph
Node types:
planner
model_call
tool_call
local_worker_call
reviewer
finalizer
confirmation
4. Model Router
Слоты:
weak
strong
vision
embedding
Provider:
local
external
disabled
5. Policy Engine
Без hardcoded bans.
Policy читает конфиг и возвращает:
allow
confirm
manual
disabled_by_config
6. Local Worker Gateway
Поддержать:
worker registration
capabilities
command dispatch
command result
progress events
heartbeat
disconnect
7. MCP Client
Поддержать базовый MCP flow:
initialize
tools/list
tools/call
8. UI contracts
Подготовить backend ответы для карточек:
plan_card
confirmation_card
progress_card
artifact_card
error_card
Smoke tests
Добавить тесты:
1. simple chat without tools
2. task creates execution graph
3. model fallback weak → strong
4. policy confirm returns confirmation request
5. policy full_auto executes immediately
6. local worker command result is stored
7. MCP tool call result is stored
8. task event stream emits node_started/node_completed
Конфиги
Создать примеры:
configs/examples/local_only.yaml
configs/examples/local_plus_external.yaml
configs/examples/full_auto.yaml
configs/examples/confirm_mode.yaml
Важно
Не добавлять 1С-логику в ядро orchestrator.
1С должна подключаться как MCP server или tool provider.