mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-07-26 09:52:11 +03:00
docs: link Mermaid diagrams from 8 architecture/framework docs
Wire the new docs/diagrams/exported/*.svg into the documents that already describe each flow, with the .mmd source linked alongside so edits stay auditable: - CLAUDE.md resilience-3layers - docs/ARCHITECTURE.md request-pipeline + resilience-3layers - docs/AUTO-COMBO.md auto-combo-9factor - docs/RESILIENCE_GUIDE.md resilience-3layers - docs/I18N.md i18n-flow - docs/MCP-SERVER.md mcp-tools-37 - docs/CLOUD_AGENT.md cloud-agent-flow - docs/AUTHZ_GUIDE.md authz-pipeline - docs/CODEBASE_DOCUMENTATION.md request-pipeline + db-schema-overview Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -79,7 +79,10 @@ API routes follow a consistent pattern: `Route → CORS preflight → Zod body v
|
||||
## Resilience Runtime State
|
||||
|
||||
OmniRoute has three related but distinct temporary-failure mechanisms. Keep their
|
||||
scope separate when debugging routing behavior.
|
||||
scope separate when debugging routing behavior. See the
|
||||
[3-layer resilience diagram](./docs/diagrams/exported/resilience-3layers.svg)
|
||||
(source: [docs/diagrams/resilience-3layers.mmd](./docs/diagrams/resilience-3layers.mmd))
|
||||
for an at-a-glance map.
|
||||
|
||||
### Provider Circuit Breaker
|
||||
|
||||
|
||||
@@ -78,6 +78,21 @@ Primary runtime model:
|
||||
- Next.js app routes under `src/app/api/*` implement both dashboard APIs and compatibility APIs
|
||||
- A shared SSE/routing core in `src/sse/*` + `open-sse/*` handles provider execution, translation, streaming, fallback, and usage
|
||||
|
||||
## Reference Diagrams
|
||||
|
||||
Canonical, version-controlled Mermaid sources for the v3.8.0 platform live in
|
||||
[`docs/diagrams/`](./diagrams/README.md). Two are reproduced below for orientation;
|
||||
the rest are linked from their domain-specific guides.
|
||||
|
||||

|
||||
|
||||
> Source: [diagrams/request-pipeline.mmd](./diagrams/request-pipeline.mmd)
|
||||
|
||||

|
||||
|
||||
> Source: [diagrams/resilience-3layers.mmd](./diagrams/resilience-3layers.mmd) — also linked from
|
||||
> [RESILIENCE_GUIDE.md](./RESILIENCE_GUIDE.md) and the `CLAUDE.md` resilience reference.
|
||||
|
||||
## Scope and Boundaries
|
||||
|
||||
### In Scope
|
||||
|
||||
@@ -5,6 +5,10 @@
|
||||
|
||||
OmniRoute has a route-aware authorization pipeline that gates every API request. Classification is **deterministic** and **fail-closed** — anything that cannot be classified ends up as `MANAGEMENT` and demands a session or management-grade token. This page explains the model for engineers maintaining routes or designing new endpoints.
|
||||
|
||||

|
||||
|
||||
> Source: [diagrams/authz-pipeline.mmd](./diagrams/authz-pipeline.mmd)
|
||||
|
||||
## Two Auth Modes
|
||||
|
||||
### 1. API Key (Bearer)
|
||||
|
||||
@@ -77,6 +77,10 @@ Auto-scoring selects best provider/model per request
|
||||
|
||||
The Auto-Combo Engine dynamically selects the best provider/model for each request using a **9-factor scoring function** (defined in `open-sse/services/autoCombo/scoring.ts` → `DEFAULT_WEIGHTS`). All weights sum to **1.0**.
|
||||
|
||||

|
||||
|
||||
> Source: [diagrams/auto-combo-9factor.mmd](./diagrams/auto-combo-9factor.mmd)
|
||||
|
||||
| Factor | Default Weight | Description |
|
||||
| :----------------- | :------------- | :---------------------------------------------------------------------- |
|
||||
| `health` | 0.22 | Health score from circuit breaker (CLOSED=1.0, HALF_OPEN=0.5, OPEN=0.0) |
|
||||
|
||||
@@ -12,6 +12,10 @@ A Cloud Agent task is **not** a regular chat completion. It is a durable, multi-
|
||||
unit of work that may take minutes to hours, can produce a Pull Request as its
|
||||
artifact, and supports follow-up messages and (in some providers) plan approval gates.
|
||||
|
||||

|
||||
|
||||
> Source: [diagrams/cloud-agent-flow.mmd](./diagrams/cloud-agent-flow.mmd)
|
||||
|
||||
## Supported Agents
|
||||
|
||||
| Provider ID | Class | Source | Upstream Base URL | Plan Approval |
|
||||
|
||||
@@ -286,6 +286,10 @@ Top-level files in `src/lib/`:
|
||||
Singleton SQLite database (`getDbInstance()` in `core.ts`, WAL journaling).
|
||||
**Never write raw SQL in routes or handlers** — go through these modules.
|
||||
|
||||

|
||||
|
||||
> Source: [diagrams/db-schema-overview.mmd](./diagrams/db-schema-overview.mmd)
|
||||
|
||||
Domain modules (each owns one or more tables): `apiKeys.ts`, `backup.ts`,
|
||||
`batches.ts`, `cleanup.ts`, `cliToolState.ts`, `combos.ts`,
|
||||
`commandCodeAuth.ts`, `compression.ts`, `compressionAnalytics.ts`,
|
||||
@@ -638,6 +642,10 @@ Common commands:
|
||||
|
||||
## 9. Request Pipeline (Summary)
|
||||
|
||||

|
||||
|
||||
> Source: [diagrams/request-pipeline.mmd](./diagrams/request-pipeline.mmd)
|
||||
|
||||
```
|
||||
Client request
|
||||
→ /v1/chat/completions (route.ts)
|
||||
|
||||
@@ -17,6 +17,10 @@ OmniRoute supports **30 languages** with full dashboard UI translation, translat
|
||||
|
||||
## Architecture
|
||||
|
||||

|
||||
|
||||
> Source: [diagrams/i18n-flow.mmd](./diagrams/i18n-flow.mmd)
|
||||
|
||||
### Source of Truth
|
||||
|
||||
- **UI strings**: `src/i18n/messages/en.json` (English source, ~2800 keys)
|
||||
|
||||
@@ -4,6 +4,10 @@
|
||||
>
|
||||
> Source of truth: `open-sse/mcp-server/schemas/tools.ts` (30 tools) + `open-sse/mcp-server/tools/memoryTools.ts` (3 tools) + `open-sse/mcp-server/tools/skillTools.ts` (4 tools). Tool registration and scope wiring lives in `open-sse/mcp-server/server.ts`.
|
||||
|
||||

|
||||
|
||||
> Source: [diagrams/mcp-tools-37.mmd](./diagrams/mcp-tools-37.mmd)
|
||||
|
||||
## Installation
|
||||
|
||||
OmniRoute MCP is built-in. Start it with:
|
||||
|
||||
@@ -2,6 +2,10 @@
|
||||
|
||||
OmniRoute has three distinct but related resilience mechanisms. Each has a different scope and purpose. Keep them separate when debugging routing behavior.
|
||||
|
||||

|
||||
|
||||
> Source: [diagrams/resilience-3layers.mmd](./diagrams/resilience-3layers.mmd)
|
||||
|
||||
## 1. Provider Circuit Breaker
|
||||
|
||||
**Scope:** entire provider (e.g., `glm`, `openai`, `anthropic`).
|
||||
|
||||
Reference in New Issue
Block a user