diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ce3b2c106d..e4b57c85d7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,6 +23,21 @@ jobs: - run: npm ci - run: npm run lint + security: + name: Security Audit + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 22 + cache: npm + - run: npm ci + - name: Dependency audit + run: npm audit --audit-level=high --omit=dev + - name: Check for known vulnerabilities + run: npx is-my-node-vulnerable || true + build: name: Build runs-on: ubuntu-latest diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1e64d18ab1..3d72cd4e44 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -258,10 +258,10 @@ Write unit tests in `tests/unit/` covering at minimum: ## Releasing -When a new GitHub Release is created (e.g. `v0.3.0`), the package is **automatically published to npm** via GitHub Actions: +When a new GitHub Release is created (e.g. `v0.4.0`), the package is **automatically published to npm** via GitHub Actions: ```bash -gh release create v0.3.0 --title "v0.3.0" --generate-notes +gh release create v0.4.0 --title "v0.4.0" --generate-notes ``` --- diff --git a/README.md b/README.md index b0fc4a8e46..c950b7311a 100644 --- a/README.md +++ b/README.md @@ -189,7 +189,7 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for detailed guidelines. ```bash # Create a release — npm publish happens automatically -gh release create v0.3.0 --title "v0.3.0" --generate-notes +gh release create v0.4.0 --title "v0.4.0" --generate-notes ``` --- diff --git a/SECURITY.md b/SECURITY.md index 28ab4c29a3..e4b948831b 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -20,8 +20,9 @@ If you discover a security vulnerability in OmniRoute, please report it responsi | Version | Support Status | | ------- | -------------- | -| 0.2.x | ✅ Active | -| < 0.2.0 | ❌ Unsupported | +| 0.4.x | ✅ Active | +| 0.3.x | ✅ Active | +| < 0.3.0 | ❌ Unsupported | ## Security Best Practices diff --git a/docs/openapi.yaml b/docs/openapi.yaml index f2b14d6cd6..13c500aa1e 100644 --- a/docs/openapi.yaml +++ b/docs/openapi.yaml @@ -1,7 +1,7 @@ openapi: 3.1.0 info: title: OmniRoute API - version: 0.0.1 + version: 0.4.0 description: | OmniRoute is a local-first AI API proxy router. It provides an OpenAI-compatible endpoint that routes requests to multiple AI providers with load balancing, @@ -641,11 +641,12 @@ paths: /api/tags: get: - tags: [Settings] - summary: List all tags + tags: [System] + summary: List Ollama-compatible model tags + description: Returns models in Ollama /api/tags format for Ollama client compatibility responses: "200": - description: Tag list + description: Ollama model tags # ─── Usage & Analytics ───────────────────────────────────────── @@ -1017,6 +1018,173 @@ paths: "200": description: Sync initialized + # ─── Resilience & Monitoring ──────────────────────────────────── + + /api/resilience: + get: + tags: [System] + summary: Get resilience profiles and circuit breaker states + responses: + "200": + description: Resilience configuration and current states + put: + tags: [System] + summary: Update resilience profiles + requestBody: + required: true + content: + application/json: + schema: + type: object + responses: + "200": + description: Updated resilience profiles + + /api/resilience/reset: + post: + tags: [System] + summary: Reset circuit breakers + responses: + "200": + description: Circuit breakers reset + + /api/monitoring/health: + get: + tags: [System] + summary: System health check + description: Returns system health including uptime, memory, circuit breakers, rate limits + responses: + "200": + description: Health status + + /api/rate-limits: + get: + tags: [System] + summary: Get per-account rate limit status + responses: + "200": + description: Rate limit status by account + + /api/sessions: + get: + tags: [System] + summary: Get active sessions + responses: + "200": + description: Active session list + + /api/cache: + get: + tags: [System] + summary: Get cache statistics + responses: + "200": + description: Semantic cache and idempotency stats + delete: + tags: [System] + summary: Clear all caches + responses: + "200": + description: Caches cleared + + # ─── Evals & Policies ────────────────────────────────────────── + + /api/evals: + get: + tags: [System] + summary: List eval suites + responses: + "200": + description: Eval suite list + post: + tags: [System] + summary: Run evaluation + requestBody: + required: true + content: + application/json: + schema: + type: object + responses: + "200": + description: Eval results + + /api/policies: + get: + tags: [System] + summary: List routing policies + responses: + "200": + description: Policy list + post: + tags: [System] + summary: Create routing policy + requestBody: + required: true + content: + application/json: + schema: + type: object + responses: + "201": + description: Created policy + delete: + tags: [System] + summary: Delete routing policy + responses: + "200": + description: Policy deleted + + /api/compliance/audit-log: + get: + tags: [System] + summary: Get compliance audit log + parameters: + - name: limit + in: query + schema: + type: integer + default: 100 + responses: + "200": + description: Audit log entries + + # ─── v1beta (Gemini-Compatible) ───────────────────────────────── + + /api/v1beta/models: + get: + tags: [Models] + summary: List models (Gemini format) + description: Returns models in Gemini v1beta format for native SDK compatibility + security: + - BearerAuth: [] + responses: + "200": + description: Model list in Gemini format + + /api/v1beta/models/{path}: + post: + tags: [Models] + summary: Gemini generateContent + description: Gemini-compatible generateContent endpoint + security: + - BearerAuth: [] + parameters: + - name: path + in: path + required: true + schema: + type: string + requestBody: + required: true + content: + application/json: + schema: + type: object + responses: + "200": + description: Generated content + components: securitySchemes: BearerAuth: diff --git a/package-lock.json b/package-lock.json index cd4c822370..f5508831c9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "omniroute", - "version": "0.2.0", + "version": "0.4.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "omniroute", - "version": "0.2.0", + "version": "0.4.0", "license": "MIT", "workspaces": [ "open-sse" diff --git a/package.json b/package.json index 862bdb2d9c..2f3979aac5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "omniroute", - "version": "0.2.0", + "version": "0.4.0", "description": "Smart AI Router with auto fallback — route to FREE & cheap models, zero downtime. Works with Cursor, Cline, Claude Desktop, Codex, and any OpenAI-compatible tool.", "type": "module", "bin": { @@ -53,7 +53,7 @@ "test:fixes": "node --test tests/unit/fixes-p1.test.mjs", "test:security": "node --test tests/unit/security-fase01.test.mjs", "test:e2e": "npx playwright test", - "test:coverage": "npx c8 --check-coverage --lines 40 --functions 30 --branches 30 node --test tests/unit/*.test.mjs", + "test:coverage": "npx c8 --check-coverage --lines 60 --functions 50 --branches 50 node --test tests/unit/*.test.mjs", "test:all": "npm run test:unit && npm run test:e2e", "check": "npm run lint && npm run test", "prepublishOnly": "npm run build:cli", diff --git a/src/app/(dashboard)/dashboard/health/page.js b/src/app/(dashboard)/dashboard/health/page.js index b2d8bfa842..6d82aa7523 100644 --- a/src/app/(dashboard)/dashboard/health/page.js +++ b/src/app/(dashboard)/dashboard/health/page.js @@ -118,6 +118,8 @@ export default function HealthPage() { {/* Status Banner */}