Files
OmniRoute/docs/diagrams/cloud-agent-flow.mmd
diegosouzapw 675668c430 docs(diagrams): create 8 canonical Mermaid sources + folder structure
Introduce docs/diagrams/ with the README index and 8 versioned Mermaid
sources that reflect the v3.8.0 platform:

- request-pipeline.mmd     /v1/chat/completions request pipeline
- auto-combo-9factor.mmd   Auto-Combo 9-factor scoring weights
- resilience-3layers.mmd   Provider breaker / cooldown / model lockout
- i18n-flow.mmd            Hash-based incremental doc translation
- mcp-tools-37.mmd         MCP Server tool inventory by category
- cloud-agent-flow.mmd     Codex / Devin / Jules task lifecycle
- authz-pipeline.mmd       3-class authz pipeline (PUBLIC/CLIENT_API/MANAGEMENT)
- db-schema-overview.mmd   Selected core SQLite relations

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 13:53:56 -03:00

33 lines
1020 B
Plaintext

%% Cloud Agent task lifecycle
%% Reflects: src/lib/cloudAgent/* and src/app/api/v1/agents/tasks/*
%% Supported agents: codex-cloud, devin, jules
%% v3.8.0
sequenceDiagram
participant U as User
participant API as /v1/agents/tasks
participant Reg as Cloud Agent Registry
participant Ag as Cloud Agent<br/>(codex-cloud / devin / jules)
participant DB as SQLite domain DB
U->>API: POST createTask (description, sources)
API->>API: Zod validation + AuthZ (management)
API->>Reg: getAgent(providerId)
Reg->>Ag: instantiate with credentials
Ag->>Ag: createTask() returns planning
Ag-->>API: taskId + status: planning
API->>DB: insertCloudAgentTask
API-->>U: taskId
U->>API: GET /tasks/:id (poll)
API->>Ag: getStatus(externalId)
Ag-->>API: status, plan, messages
API->>DB: updateCloudAgentTask
API-->>U: snapshot
U->>API: POST approvePlan
API->>Ag: approvePlan(externalId)
Ag-->>API: status: running
Note over Ag: Async execution upstream
Ag-->>DB: stream events / final result