Back to Omniroute

Repository Map

docs/architecture/REPOSITORY_MAP.md

3.8.4966.9 KB
Original Source

Repository Map

One-line description for every directory and root file. Last updated: 2026-06-28 — OmniRoute v3.8.40

Use this map to navigate the codebase quickly. For deep dives, follow links to dedicated docs.

Top-level tree

OmniRoute/
├── src/                  # Next.js 16 application (UI + API routes + libs + domain + server)
├── open-sse/             # Streaming engine workspace (handlers, executors, translator, MCP server)
├── electron/             # Desktop wrapper (Electron 41 + electron-builder 26.10)
├── bin/                  # CLI entry point and command handlers
├── scripts/              # Build, check, sync, and one-off scripts
├── docs/                 # Public documentation (you are here)
├── tests/                # All test suites (unit, integration, e2e, protocols-e2e)
├── public/               # Next.js static assets, PWA manifest, service worker, icons
├── config/               # Static config + quality-gate state (i18n, payloadRules, quality/)
├── images/               # Marketing / README image assets
├── @omniroute/           # Publishable companion packages (opencode-plugin, opencode-provider)
├── skills/               # CLI/agent skill packs (cli-* + omni-* + config-codex-cli)
├── examples/             # Sample plugins + omniroute-cmd-hello starter
├── contrib/              # Community contributions (podman/)
├── .source/              # Fumadocs source config (source.config.mjs + server/browser/dynamic)
├── .github/              # GitHub Actions workflows + issue templates + PR template
├── .husky/               # Git hooks (pre-commit, pre-push)
├── .claude/              # Claude Code slash commands (project-scoped)
├── .agents/              # Codex / generic agent workflows + skills (mirror of .claude/)
├── .vscode/              # VS Code workspace settings
├── _ideia/               # Planning notes (informal; not shipped)
├── _mono_repo/           # Historic subprojects (cloud, site, vscode-extension)
├── _references/          # Read-only reference clones from related OSS projects
├── _tasks/               # Per-release task tracking files (informal)
├── .build/ .worktrees/ dist/   # local build / git-worktree / build-output scratch (gitignored)
├── .issues/              # Local issue cache (gitignored)
├── .playwright-mcp/      # Playwright MCP test artifacts
├── coverage/             # c8 coverage output (gitignored)
├── logs/                 # Runtime logs (gitignored)
├── node_modules/         # Dependencies (gitignored)
├── package/              # npm pack staging area (build artifact)
├── .next/                # Next.js build output (gitignored)
└── (root files — see below)

Root files

FilePurpose
README.mdMarketing landing page + quick start + feature matrix (see also llm.txt)
CHANGELOG.mdPer-release changelog (auto-generated by /version-bump-cc skill)
LICENSEMIT license text
CLAUDE.mdProject rules for Claude Code agents (hard rules, conventions, scenarios)
AGENTS.mdSame as CLAUDE.md but for non-Claude AI agents (Codex, Cursor, etc.)
GEMINI.mdConcise rules for Gemini-based agents (subset of CLAUDE.md)
CONTRIBUTING.mdContributor guide: setup, conventional commits, testing, PR flow
SECURITY.mdVulnerability reporting policy, supported versions, threat model
CODE_OF_CONDUCT.mdContributor Covenant — community behavior expectations
llm.txtPlain-text landing optimized for LLM crawlers (SEO for AI assistants)
package.jsonnpm manifest, scripts, dependencies, engines, c8 coverage gate
package-lock.jsonLocked dependency tree
tsconfig.jsonRoot TypeScript config
tsconfig.typecheck-core.jsonTypecheck config for src/ core
tsconfig.typecheck-noimplicit-core.jsonStrict (noImplicitAny) typecheck
tsconfig.tsbuildinfoTS incremental build cache (gitignored)
next.config.mjsNext.js 16 build configuration (standalone output)
next-env.d.tsNext.js auto-generated env types
eslint.config.mjsESLint flat config (rules per project area)
prettier.config.mjsPrettier formatting rules
postcss.config.mjsPostCSS config for Tailwind/CSS pipeline
playwright.config.tsPlaywright E2E test config
vitest.config.tsVitest config (default suite)
vitest.mcp.config.tsVitest config for MCP server / autoCombo / cache suites
sonar-project.propertiesSonarQube/SonarCloud config (code quality)
DockerfileMulti-stage Docker build (builder → runner-base → runner-cli)
docker-compose.ymlDev compose with 4 profiles (base, cli, host, cliproxyapi) + redis sidecar
docker-compose.prod.ymlProduction compose (port 20130, redis, named volumes)
.dockerignoreFiles excluded from Docker context
fly.tomlFly.io deployment config (region sin, port 20128, /data volume)
.env.exampleTemplate env file (auto-copied to .env on first install)
.gitignoreGit ignore patterns
.npmignorenpm publish exclusion list
.npmrcnpm config (registry, lockfile policy)
.node-versionNode version pin (used by nvm-compatible tools)
.nvmrcNode version pin for nvm
eslint.complexity.config.mjsESLint config for the complexity ratchet (scripts/check/check-complexity.mjs --config)
eslint.sonarjs.config.mjsESLint config for SonarJS rules (cognitive complexity / duplication)
source.config.tsFumadocs defineDocs source config (feeds .source/)
knip.jsonKnip config — unused files/exports/deps (feeds the dead-code gate)
stryker.conf.jsonStryker mutation-testing config
.size-limit.jsonsize-limit bundle budget config
promptfooconfig.yamlpromptfoo eval config
.gitleaks.tomlgitleaks secret-scan ruleset
.zizmor.ymlzizmor GitHub-Actions security-lint config
socket.ymlSocket.dev supply-chain config
news.jsonIn-app release-notes feed (read by src/shared/utils/releaseNotes.ts)
flake.nix / flake.lockNix dev-shell definition + lock
.envLocal secrets (gitignored — generated from .env.example)

Moved out of the root in v3.8.26 (declutter):

  • config/quality/: quality-baseline.json, complexity-baseline.json, duplication-baseline.json, file-size-baseline.json, test-discovery-baseline.json, dependency-allowlist.json, .license-allowlist.json, and the generated quality-metrics.json (gitignored). See ## config/.

src/ — Next.js application

src/
├── app/                 # App Router (pages + API routes + status pages + landing)
├── lib/                 # Core libraries / domain modules (~50 subdirs + ~30 top-level files)
├── domain/              # Pure domain logic (policy engine, fallback, cost, lockout, comboResolver, assessment)
├── server/              # Server-only modules (authz pipeline, cors, auth middleware) — cannot import from client
├── shared/              # Shared between server and client where safe (constants, types, validation, contracts, utils)
├── i18n/                # next-intl config + per-locale message JSON (30+ locales)
├── middleware/          # Next.js middleware (request enrichment, locale detection)
├── mitm/                # MITM proxy core: cert gen/install, handlers, targets, inspector, masks, passthrough
│   ├── handlers/        # 9 IDE-agent handler classes extending MitmHandlerBase (antigravity, kiro, copilot, codex, cursor, zed, claudeCode, openCode, trae)
│   └── inspector/       # Traffic capture layer: buffer (in-memory ring), sseMerger, conversationNormalizer, kindDetector, contextKey, httpProxyServer, systemProxyConfig
├── models/              # Model adapter glue (legacy shim)
├── scripts/             # In-tree maintenance scripts (e.g., backfillAggregation)
├── sse/                 # Legacy SSE handlers/services (chat.ts, chatHelpers.ts, services/auth.ts)
├── store/               # Legacy in-memory store (being phased out for src/lib/db)
├── types/               # Shared TS type files
├── instrumentation.ts   # Next.js telemetry hook (browser + edge)
├── instrumentation-node.ts  # Node-only instrumentation
├── server-init.ts       # Server bootstrap (DB migrations, jobs, cleanup)
└── proxy.ts             # HTTP-proxy entry shim

src/app/ — App Router (Next.js 16)

PathPurpose
app/api/v1/Public OpenAI-compat API (~25 sub-routes: chat, completions, embeddings, files, batches, audio, images, videos, music, rerank, moderations, search, ws, agents, accounts, providers, etc.)
app/api/v1beta/Gemini-style API endpoints
app/api/playground/Playground Studio routes: improve-prompt/ (POST — LLM prompt rewriter), presets/ (GET list / POST create), presets/[id]/ (GET / PUT / DELETE) — see docs/frameworks/PLAYGROUND_STUDIO.md
app/api/ (non-v1)Management/admin routes (~60 directories: providers, combos, settings, mcp, a2a, evals, memory, skills, webhooks, compliance, resilience, monitoring, tunnels, cli-tools, etc.)
app/api/tools/agent-bridge/AgentBridge REST API — 12 routes (server control, agent state/DNS/mappings, bypass, cert, upstream-CA). LOCAL_ONLY + SPAWN_CAPABLE. See docs/frameworks/AGENTBRIDGE.md §7.
app/api/tools/traffic-inspector/Traffic Inspector REST + WS API — 16+ routes (requests, sessions, hosts, capture-modes, export, ws). LOCAL_ONLY + SPAWN_CAPABLE. See docs/frameworks/TRAFFIC_INSPECTOR.md §8.
app/a2a/A2A JSON-RPC 2.0 entry point (POST /a2a)
app/.well-known/agent.json/A2A Agent Card (discovery)
app/(dashboard)/dashboard/Dashboard UI pages (~35 pages: providers, combos, settings, memory, skills, webhooks, evals, audit, batch, cache, costs, health, system, activity, etc.)
app/(dashboard)/dashboard/search-tools/Search Tools Studio UI (3 tabs: Search/Scrape/Compare + SearchConceptCard + ProviderCatalog) — see docs/frameworks/SEARCH_TOOLS_STUDIO.md
app/(dashboard)/dashboard/Dashboard UI pages (~30 pages: providers, combos, settings, memory, skills, webhooks, evals, audit, batch, cache, costs, health, system, etc.)
app/(dashboard)/dashboard/memory/Memory Studio (plan 21): page.tsx (3-tab shell), components/ (MemoryConceptCard, MemoryEngineStatus, EmbeddingSourceSelector, EditMemoryModal, RetrievePreview, QdrantConfigCard, RerankConfigCard), components/tabs/ (MemoriesTab, PlaygroundTab, EngineTab), hooks/ (useEngineStatus, useMemorySettings)
app/(dashboard)/dashboard/tools/agent-bridge/AgentBridge dashboard page — server card, 9 agent cards, setup wizard, model mapping, bypass list. i18n PT-BR + EN. See docs/frameworks/AGENTBRIDGE.md.
app/(dashboard)/dashboard/tools/traffic-inspector/Traffic Inspector dashboard page — DevTools split, 7 detail tabs, 4 capture mode toggles, session recorder, context colorization. i18n PT-BR + EN. See docs/frameworks/TRAFFIC_INSPECTOR.md.
app/(dashboard)/dashboard/activity/Activity feed page (Group B): page.tsx (server) + ActivityFeedClient.tsx + components/{ActivityFeed,ActivityItem,DayHeader,EventTypeFilter}.tsx — see docs/architecture/MONITORING_SECTIONS.md
app/(dashboard)/dashboard/costs/quota-share/Quota Sharing page (Group B): QuotaSharePageClient.tsx + components/{PoolCard,DimensionBar,AllocationTable,BurnRateChart,QuotaConceptCard,CreatePoolModal,EditAllocationsModal}.tsx + hooks/{usePools,usePoolUsage,useLocalStoragePoolMigration}.ts
app/(dashboard)/dashboard/costs/quota-share/plans/Provider plan config page (Group B): page.tsx + ProviderPlanConfigClient.tsx — quota dimensions per connection override
app/docs/Embedded documentation viewer (renders docs/*.md)
app/landing/Marketing landing page
app/login/, forgot-password/, forbidden/Auth-related pages
app/{400,401,403,408,429,500,502,503}/HTTP error pages
app/maintenance/, offline/, status/, privacy/, terms/, callback/Static/status pages
app/layout.tsx, page.tsx, manifest.ts, globals.cssRoot layout, home, PWA manifest, global CSS
app/error.tsx, global-error.tsx, not-found.tsx, loading.tsxError boundaries

src/lib/ — Core libraries (~50 modules)

ModulePurpose
a2a/A2A protocol task manager, skills (5), streaming
acp/CLI Agent Registry (local CLI discovery — see docs/frameworks/AGENT_PROTOCOLS_GUIDE.md)
api/Shared API helpers (requireManagementAuth, validation)
auth/Session, password hashing, token validation
batches/OpenAI Batches API handlers
catalog/Provider catalog Zod validation + capability resolution
cloudAgent/Cloud Agents (Codex Cloud, Devin, Jules) — see docs/frameworks/CLOUD_AGENT.md
combos/Combo resolution + reorder helpers
audit/Activity feed helpers: highLevelActions.ts (allowlist + isHighLevelAction()), activityIcons.ts (action → icon/verb map), timeline.ts (groupByDay/relativeTime) — see docs/architecture/MONITORING_SECTIONS.md
compliance/Audit log + provider audit — see docs/security/COMPLIANCE.md
compression/Compression engine glue (engines live in open-sse/services/compression/)
config/Runtime config helpers
db/95+ domain DB modules + 144 migrations (always go through here for SQLite)
quota/Quota Sharing Engine: dimensions.ts (types/Zod), types.ts (QuotaStore interface), sqliteQuotaStore.ts, redisQuotaStore.ts, storeFactory.ts, fairShare.ts, burnRate.ts, planResolver.ts, planRegistry.ts, saturationSignals.ts, enforce.ts, spendRecorder.ts — see docs/routing/QUOTA_SHARE.md
radar/Radar free-model catalog client: feedSchema.ts, pinnedKeys.ts, verify.ts, sync.ts, applyFeed.ts, index.ts (getRadarCatalog()) — see docs/frameworks/RADAR.md
display/UI formatting helpers (cost, latency, etc.)
embeddings/Embeddings service helpers
env/Env variable parsing + validation
evals/Eval framework (suites, runner, runtime) — see docs/frameworks/EVALS.md
guardrails/PII masker, prompt injection, vision bridge — see docs/security/GUARDRAILS.md
jobs/Background jobs (cron-like)
memory/Conversational memory (SQLite FTS5 + sqlite-vec hybrid RRF + Qdrant tier 2) — see docs/frameworks/MEMORY.md
memory/embedding/Multi-source embedding layer: index.ts (resolver), remote.ts, staticPotion.ts, transformersLocal.ts, cache.ts, types.ts (plan 21)
memory/vectorStore.tssqlite-vec v0.1.9 wrapper — KNN brute-force + hybrid RRF (FTS5 + vector, k=60). Lazy-init, degrades gracefully when sqlite-vec unavailable. (plan 21)
memory/reindex.tsrunReindexBatch() — processes memories with needs_reindex=1 in background; called by POST /api/memory/reindex and lazy-backfill path. (plan 21)
monitoring/Health checks, metrics emission
oauth/OAuth/import flows for 22 provider modules (agy, antigravity, claude, cline, codebuddy-cn, codex, cursor, devin-desktop, ghe-copilot, github, gitlab-duo, grok-cli-oauth, grok-cli, kilocode, kimi-coding, kiro, qoder, raycast, trae, xai-oauth, zed-hosted, zed)
plugins/Plugin registry
promptCache/Anthropic-style prompt cache breakpoints
skills/Skills framework (built-in + marketplace + SkillsSH) — see docs/frameworks/SKILLS.md
playground/Playground Studio shared helpers: codeExport.ts (curl/Python/TS generator), promptImprover.ts (meta-prompt builder), streamMetrics.ts (pure TTFT/TPS), types.ts (pricing table) — see docs/frameworks/PLAYGROUND_STUDIO.md
webhookDispatcher.tsHMAC webhook delivery — see docs/frameworks/WEBHOOKS.md
cloudflaredTunnel.ts, ngrokTunnel.tsTunnel managers — see docs/ops/TUNNELS_GUIDE.md
oneproxySync.ts, oneproxyRotator.ts1proxy free proxy marketplace — see docs/ops/PROXY_GUIDE.md
cloudSync.ts, initCloudSync.tsOptional cloud sync of state
localDb.tsRe-export barrel for db modules (no logic — re-exports only)
cacheLayer.ts, idempotencyLayer.tsRequest caching + idempotency
(~30 more top-level files)Specialized helpers (logEnv, modelsDevSync, piiSanitizer, etc.)

src/db/ — Database (117 modules + 144 migrations)

SubdirPurpose
db/core.tsgetDbInstance() singleton with WAL journaling
db/migrations/Versioned SQL files (idempotent, transactional). 073_memory_vec.sql adds memory_vec_meta + needs_reindex column (plan 21).
db/playgroundPresets.tsCRUD module for Playground Studio presets (listPlaygroundPresets, getPlaygroundPreset, createPlaygroundPreset, updatePlaygroundPreset, deletePlaygroundPreset)
db/memoryVec.tsCRUD for memory_vec_meta (active_dim, embedding_signature, last_reset_at, vec_loaded) + markMemoryNeedsReindex, getMemoryReindexQueue, etc. (plan 21)
db/<domain>.tsOne module per domain: providers, combos, apiKeys, users, sessions, usage, auditlog, webhooks, skills, memory_entries, cloud_agent_tasks, evals*, reasoning_cache, etc.

src/domain/

ModulePurpose
policy.tsPolicy engine
fallbackPolicy.tsFallback decision tree
costRules.tsCost calculation rules
lockoutPolicy.tsModel/connection lockout policy
tagRouter.tsTag-based routing
comboResolver.tsCombo resolution (used by combo engine)
modelAvailability.tsPer-model availability check
assessment/Model assessment (Phase 1 of RFC-AUTO-ASSESSMENT — see docs/archive/)

src/server/

ModulePurpose
authz/Authorization pipeline: classifypoliciesenforce — see docs/architecture/AUTHZ_GUIDE.md
cors/CORS configuration
auth/Session middleware

src/shared/

ModulePurpose
constants/providers.ts338 providers with Zod validation (source of truth)
constants/cliTools.tsExternal CLI tool registry
constants/routingStrategies.ts19 routing strategies with priorities
constants/publicApiRoutes.tsRoutes that require Bearer (vs management) auth
constants/upstreamHeaders.tsHeader denylist for upstream requests
validation/schemas.ts~80 Zod schemas (single source of truth for API contracts)
validation/helpers.tsZod validation helpers (validateBody, etc.)
types/Shared TS types
contracts/Public API contracts (consumed by files: in package.json)
utils/circuitBreaker.tsProvider circuit breaker (see docs/architecture/RESILIENCE_GUIDE.md)
utils/apiAuth.tsAPI key validation, scope checking
utils/fetchTimeout.tsTimeout/abort wrappers for upstream fetch

open-sse/ — Streaming Engine Workspace

Separate npm workspace (@omniroute/open-sse). Handles request processing + provider execution.

open-sse/
├── handlers/            # 16 files (12 handlers + 4 helpers): chatCore, responsesHandler, embeddings, audio, image, video, music, rerank, moderations, search, etc.
├── executors/           # 67 provider-specific executors (extend BaseExecutor)
├── translator/          # Format converters (9 request, 9 response, 9 helpers)
├── transformer/         # Responses API ↔ Chat Completions (TransformStream)
├── services/            # ~80+ service modules (combo, accountFallback, autoCombo, reasoningCache, claude code/chatgpt stealth, modelDeprecation, taskAwareRouter, workflowFSM, etc.)
├── mcp-server/          # MCP server (105 tools, 3 transports, 31 scopes)
├── config/              # Provider/model registries, header config, model aliases
├── utils/               # TLS client, proxy fetch/dispatcher, network helpers
├── index.ts             # Workspace entry
├── package.json         # Workspace manifest
├── tsconfig.json        # Workspace TS config
└── types.d.ts           # Workspace type declarations

open-sse/mcp-server/

PathPurpose
server.tsMCP server lifecycle (stdio + HTTP transports)
httpTransport.tsHTTP Streamable + SSE transports (/api/mcp/sse, /api/mcp/stream)
audit.tsAudit logging to mcp_tool_audit table
scopeEnforcement.tsPer-tool scope validation
runtimeHeartbeat.tsHealth heartbeat to DATA_DIR/runtime/mcp-heartbeat.json
descriptionCompressor.tsCompress tool description metadata to save context
schemas/tools.ts36 base tool definitions + scopes
tools/advancedTools.tsAdvanced tool implementations
tools/memoryTools.ts3 memory tools (search/add/clear)
tools/skillTools.ts4 skill tools (list/enable/execute/executions)
tools/compressionTools.ts5 compression tools
README.mdInternal MCP server README (cross-linked from docs/frameworks/MCP-SERVER.md)

electron/ — Desktop Wrapper

FilePurpose
main.jsElectron main process (BrowserWindow, embedded Next.js server, tray, auto-update)
preload.jsIPC bridge (contextBridge → window.omniroute)
package.jsonelectron-builder config + Electron 41 + electron-builder 26.10 deps
assets/App icons (Windows .ico, macOS .icns, Linux .png)
dist-electron/Build output (gitignored)
types.d.tsType declarations for renderer bridge
README.mdInternal Electron README (see also docs/guides/ELECTRON_GUIDE.md)

bin/ — CLI

FilePurpose
omniroute.mjsMain CLI entry — omniroute serve, omniroute setup, omniroute doctor, omniroute providers, omniroute combos, etc.
reset-password.mjsStandalone password reset CLI
cli/commands/setup.mjsInteractive + non-interactive setup wizard
cli/commands/doctor.mjsSystem health diagnostics (8+ checks)
cli/commands/providers.mjsProvider list/test/validate
cli/{args,data-dir,encryption,io,provider-catalog,provider-store,provider-test,settings-store,sqlite}.mjsCLI helper modules
cli/tray/tray.tsSystem tray integration (cross-platform: NotifyIcon on Windows, systray2 on macOS/Linux)
cli/tray/tray.ps1PowerShell NotifyIcon backend (Windows, zero new binaries)
cli/tray/autostart.tsCross-platform autostart (LaunchAgent / .desktop / registry)
cli/runtime/sqliteRuntime.mjs5-step SQLite driver resolution chain (bundled → runtime → lazy-install → node:sqlite → sql.js)
cli/runtime/magicBytes.mjsBinary magic-byte validation (ELF / Mach-O / Mach-O fat / PE)
cli/runtime/index.mjswarmUpRuntimes() — pre-resolves drivers at postinstall / first startup
nodeRuntimeSupport.mjsValidate supported Node.js version on install

skills/ — Public Agent Skills

FilePurpose
skills/omniroute*/SKILL.md10 skill manifests for external AI agents (Claude Desktop, ChatGPT, Cursor, Cline)

scripts/ — Build & Check Scripts

ScriptPurpose
run-next.mjsDev/start runner with env hydration
build-next-isolated.mjsStandalone build (Next.js 16 standalone)
prepublish.tsPackage preparation before npm pack
postinstall.mjsAuto-create .env from .env.example on first install
sync-env.mjsRe-sync .env keys with .env.example
check-cycles.mjsDetect circular dependencies
check-route-validation.mjsValidate all API routes have Zod validation
check-t11-any-budget.mjsEnforce explicit any budget per file
check-docs-sync.mjsValidate docs version sync (existing pre-commit)
check-env-doc-sync.mjsNEW: cross-check env vars in code vs .env.example vs ENVIRONMENT.md
check-docs-counts-sync.mjsNEW: validate counts (executors, strategies, OAuth, A2A skills) match docs
check-deprecated-versions.mjsNEW: flag stale versions/dates in docs
check-supported-node-runtime.tsValidate current Node version is supported
check-pr-test-policy.mjsEnforce "tests required" rule on production code changes
gen-provider-reference.tsNEW: auto-generate docs/reference/PROVIDER_REFERENCE.md from catalog
i18n/generate-multilang.mjsTranslate UI strings + docs via Google Translate
i18n_autotranslate.pyLLM-based doc translation pipeline
validate_translation.pyPer-locale translation validation
check_translations.pyCode-side i18n key check
run-playwright-tests.mjsPlaywright E2E runner
run-protocol-clients-tests.mjsMCP/A2A E2E runner
run-ecosystem-tests.mjsEcosystem (provider integration) tests
test-report-summary.mjsGenerate coverage summary markdown
smoke-electron-packaged.mjsSmoke-test packaged Electron build
native-binary-compat.mjsValidate native deps (better-sqlite3) match Electron's Node
validate-pack-artifact.tsValidate npm pack output
responses-ws-proxy.mjsWebSocket bridge for Codex Responses API
v1-ws-bridge.mjsWebSocket bridge for /api/v1/ws endpoint
standalone-server-ws.mjsStandalone WS server runner
system-info.mjsPrint system/runtime info for support
healthcheck.mjsOne-shot health check (used by Docker HEALTHCHECK)
uninstall.mjsClean uninstall script

docs/ — Public Documentation (44 files + 4 subdirs)

Top-level guides

DocPurpose
ARCHITECTURE.mdHigh-level architecture, subsystem map, dashboard surface
CODEBASE_DOCUMENTATION.mdEngineering reference: directories, modules, conventions
FEATURES.mdFeature matrix with v3.8 highlights
USER_GUIDE.mdEnd-user manual (setup, models, combos, CLIs, audio, etc.)
API_REFERENCE.mdAPI endpoint reference with auth model
openapi.yamlOpenAPI 3.0 spec (121 paths)
SETUP_GUIDE.mdInstall methods (npm, npx, Docker, Electron, Termux, source)
ENVIRONMENT.mdAll env vars (~219 used in code, ~810 lines .env.example)
TROUBLESHOOTING.mdCommon errors + v3.8.0 known issues
RELEASE_CHECKLIST.mdFull release flow (skills, husky, conventional commits, deploy)
COVERAGE_PLAN.mdCoverage goals and current state
FREE_TIERS.mdCurated free-tier providers (48+ free + 11 OAuth)
CLI-TOOLS.mdExternal CLI integrations + Internal OmniRoute CLI
I18N.mdi18n architecture, adding a language, 43 locales
UNINSTALL.mdClean uninstall steps
PROVIDER_REFERENCE.mdAuto-generated catalog of 338 providers (regen: npm run gen:provider-reference)

Subsystem deep-dives

DocPurpose
MCP-SERVER.mdMCP server: 105 tools, 3 transports, 31 scopes, REST endpoints
A2A-SERVER.mdA2A v0.3: JSON-RPC, 6 skills, REST helpers, agent card
AGENT_PROTOCOLS_GUIDE.mdUnified guide: A2A vs ACP vs Cloud Agents
CLOUD_AGENT.mdCodex Cloud / Devin / Jules orchestration
SKILLS.mdSkills framework (built-in + marketplace + SkillsSH + sandbox)
RADAR.mdRadar free-model catalog overlay (RADAR_ENABLED, off by default)
MEMORY.mdMemory system (SQLite FTS5 + Qdrant)
EVALS.mdEval framework (suites, runs, rubrics)
GUARDRAILS.mdPII masker, prompt injection, vision bridge
COMPLIANCE.mdAudit log, retention, noLog opt-out
WEBHOOKS.mdHMAC-signed webhook delivery
REASONING_REPLAY.mdHybrid memory/SQLite cache for reasoning_content
AUTHZ_GUIDE.mdAuthorization pipeline (classifypoliciesenforce)
RESILIENCE_GUIDE.mdCircuit breaker + cooldown + model lockout
STEALTH_GUIDE.mdTLS fingerprinting (JA3/JA4), Claude Code CCH, MITM cert
AUTO-COMBO.mdAuto Combo engine (9-factor scoring, 4 mode packs, virtual factory)

Compression

DocPurpose
COMPRESSION_GUIDE.mdOverview of compression modes + roadmap
COMPRESSION_ENGINES.mdCaveman + RTK engines, registry contract
COMPRESSION_RULES_FORMAT.mdCaveman rule pack JSON schema
COMPRESSION_LANGUAGE_PACKS.mdPer-language rule pack inventory
RTK_COMPRESSION.mdRTK declarative pipeline (49 filters)

Deployment

DocPurpose
DOCKER_GUIDE.mdDocker build, profiles (base/cli/host/cliproxyapi), Redis sidecar
VM_DEPLOYMENT_GUIDE.mdGeneric VM/VPS deployment (Ubuntu/Debian + nginx + systemd)
FLY_IO_DEPLOYMENT_GUIDE.mdFly.io deployment (currently Chinese-only)
TERMUX_GUIDE.mdAndroid headless via Termux
PWA_GUIDE.mdProgressive Web App install + service worker
ELECTRON_GUIDE.mdDesktop app build + sign + distribute
TUNNELS_GUIDE.mdCloudflared + ngrok + Tailscale Funnel
PROXY_GUIDE.md4-level outbound proxy + 1proxy marketplace

Subdirectories

SubdirPurpose
docs/archive/Archived/historical docs (e.g., RFC-AUTO-ASSESSMENT-DRAFT.md — superseded by EVALS)
docs/i18n/Localized doc translations (~42 locales)
docs/screenshots/Image assets for guides
_tasks/superpowers/Plans/specs from superpowers (writing-plans/brainstorming) + research — isolated, separately-versioned repo, gitignored by the main tree. See CLAUDE.md → "Planning & Research Artifacts".

tests/ — Test Suites

SubdirTypeRunner
tests/unit/Unit tests (~500 files, fastest)Node native test runner
tests/integration/Multi-module + DB integration testsNode native test runner (concurrency 1)
tests/e2e/UI + workflow E2EPlaywright
tests/protocols-e2e/MCP + A2A real-client E2ECustom protocol clients
tests/ecosystem/Provider integration (network-touching)Node native test runner

public/ — Static Assets

PathPurpose
public/ (root)Favicons, robots.txt, manifest, service worker, marketing images
public/providers/Provider logo PNG/SVG (used in dashboard)

config/ — Static Configs + Quality-Gate State

Shipped configuration templates plus the committed quality-gate baselines (moved here from the repo root in v3.8.26 to keep the root lean).

PathPurpose
config/i18n.jsonLocale list + metadata (canonical source for the 42-locale count)
config/i18n-schema.jsonJSON schema validating i18n.json
config/payloadRules.jsonUpstream payload sanitization rules
config/quality/quality-baseline.jsonMulti-metric ratchet baseline (scripts/quality/check-quality-ratchet.mjs)
config/quality/complexity-baseline.jsonFrozen ESLint-complexity baseline (check-complexity.mjs)
config/quality/duplication-baseline.jsonFrozen jscpd duplication baseline (check-duplication.mjs)
config/quality/file-size-baseline.jsonFrozen per-file size baseline (check-file-size.mjs)
config/quality/test-discovery-baseline.jsonFrozen orphan-test baseline (check-test-discovery.mjs)
config/quality/dependency-allowlist.jsonApproved dependencies allowlist (check-deps.mjs)
config/quality/.license-allowlist.jsonSPDX license allowlist (check-licenses.mjs)
config/quality/quality-metrics.jsonEphemeral collected metrics (generated by collect-metrics.mjs; gitignored)

.github/ — GitHub Integration

PathPurpose
.github/workflows/GitHub Actions CI/CD workflows (lint, test, coverage, release)
.github/ISSUE_TEMPLATE/Bug/feature issue templates
.github/PULL_REQUEST_TEMPLATE.mdPR template
.github/dependabot.ymlDependency update config

.husky/ — Git Hooks

FilePurpose
pre-commitRuns lint-staged + check-docs-sync + check:any-budget:t11
pre-pushCurrently disabled (commented). Run npm run test:unit manually.
_/Husky internals

.claude/ — Claude Code Slash Commands

FilePurpose
commands/version-bump-cc.md/version-bump-cc — bump version + auto-changelog
commands/generate-release-cc.md/generate-release-cc — full release workflow
commands/deploy-vps-{local,akamai,both}-cc.mdDeploy to VPS
commands/capture-release-evidences-cc.mdBrowser-record new features as WebP
commands/review-{prs,discussions}-cc.mdTriage GitHub PRs/discussions
commands/{review-issues,implement-features}-cc.mdIssue workflows
settings.local.jsonPer-project Claude Code settings

.agents/ — Generic Agent Workflows (Codex / Cursor / etc.)

PathPurpose
workflows/*-ag.md11 workflow definitions (mirror of .claude/commands/)
skills/<name>/SKILL.md9 skill definitions with Codex Execution Notes

Note: Workflows and commands are currently identical byte-by-byte. If .agents/ is meant to target a different agent runtime (Codex), the variants need to diverge meaningfully.


_ideia/, _mono_repo/, _references/, _tasks/ — Out-of-tree

These underscore-prefixed directories hold non-shipping content:

  • _ideia/ — design notes (defer / notfit / viable categories)
  • _mono_repo/ — historic subprojects (omnirouteCloud, omnirouteSite, vscode-extension)
  • _references/ — read-only clones of related OSS projects (LiteLLM, 9router, ClawRouter, CLIProxyAPI, modelrelay, new-api, etc.) for cross-reference during development
  • _tasks/ — per-release task tracking files (informal)

Not included in npm pack output. See .npmignore.


Generated / Gitignored

PathPurpose
node_modules/npm dependencies
.next/Next.js build output
coverage/c8 coverage reports
logs/Runtime logs
package/npm pack staging
.playwright-mcp/Playwright MCP test artifacts
.issues/Local issue cache
tsconfig.tsbuildinfoTS incremental cache

  • New contributor? Read CONTRIBUTING.mdCLAUDE.mddocs/architecture/ARCHITECTURE.mddocs/architecture/CODEBASE_DOCUMENTATION.md.
  • Adding a provider? Follow docs/architecture/ARCHITECTURE.md § Adding a New Provider + cross-check docs/reference/PROVIDER_REFERENCE.md.
  • Adding a route? docs/architecture/ARCHITECTURE.md § Adding a New API Route + src/shared/validation/schemas.ts.
  • Adding an MCP tool? docs/frameworks/MCP-SERVER.md § Adding a Tool.
  • Adding an A2A skill? docs/frameworks/A2A-SERVER.md § Adding a New Skill.
  • Running locally? docs/guides/SETUP_GUIDE.md.
  • Deploying? docs/guides/DOCKER_GUIDE.md / docs/ops/VM_DEPLOYMENT_GUIDE.md / docs/ops/FLY_IO_DEPLOYMENT_GUIDE.md.
  • Releasing? docs/ops/RELEASE_CHECKLIST.md (and /generate-release-cc Claude Code skill).