# nodes

id: import:29917dea279bb9c5a6d8bfdadda45046
kind: import
name: ../executors/antigravity.ts
qualified_name: ../executors/antigravity.ts
file_path: open-sse/services/usage.ts
language: typescript
signature:
import {
  getAntigravityRemainingCredits,
  updateAntigravityRemainingCredits,
} from "../executors/antigravity.ts";


id: import:e482b490d52d7f01731232d0960e0156
kind: import
name: ./codeAssistSubscription.ts
qualified_name: ./codeAssistSubscription.ts
file_path: open-sse/services/usage.ts
language: typescript
signature:
import {
  extractCodeAssistOnboardTierId,
  extractCodeAssistSubscriptionTier,
} from "./codeAssistSubscription.ts";


id: constant:ed75c8e650efa028d7b6606493b42cdc
kind: constant
name: ANTIGRAVITY_CONFIG
qualified_name: ANTIGRAVITY_CONFIG
file_path: open-sse/services/usage.ts
language: typescript
docstring: Antigravity API config (credentials from PROVIDERS via credential loader)
signature:
= {
  quotaApiUrls: getAntigravityFetchAvailableModelsUrls(),
  loadProjectApiUrl: "https://daily-clou...


id: constant:48254a317509383da02628dc1b76508c
kind: constant
name: CLAUDE_CONFIG
qualified_name: CLAUDE_CONFIG
file_path: open-sse/services/usage.ts
language: typescript
docstring: Claude API config
signature:
= {
  oauthUsageUrl: "https://api.anthropic.com/api/oauth/usage",
  usageUrl: "https://api.anthropic.c...


id: constant:634683055ca6306ca054e0b2a425b53a
kind: constant
name: KIMI_CONFIG
qualified_name: KIMI_CONFIG
file_path: open-sse/services/usage.ts
language: typescript
docstring: Kimi Coding API config
signature:
= {
  baseUrl: "https://api.kimi.com/coding/v1",
  usageUrl: "https://api.kimi.com/coding/v1/usages",
...


id: constant:ad3c553eaad8ed3e1e1257b397d19cf1
kind: constant
name: CURSOR_USAGE_CONFIG
qualified_name: CURSOR_USAGE_CONFIG
file_path: open-sse/services/usage.ts
language: typescript
docstring:
Cursor dashboard usage API config
The endpoint that powers https://cursor.com/dashboard/spending. Validates the WorkOS
session via the WorkosCursorSessionToken cookie (format: `${userId}::${jwt}`) and
rejects requests without a matching Origin/Referer (Invalid origin for state-changing request).

signature:
= {
  usageUrl: "https://cursor.com/api/dashboard/get-current-period-usage",
  origin: "https://cursor...


id: constant:33c6edea900710c940e834f2473d984e
kind: constant
name: MINIMAX_USAGE_CONFIG
qualified_name: MINIMAX_USAGE_CONFIG
file_path: open-sse/services/usage.ts
language: typescript
signature:
= {
  minimax: {
    usageUrls: [
      "https://www.minimax.io/v1/token_plan/remains",
      "https:/...


id: function:37ef9c9f9e88034389ac11582aa2e441
kind: function
name: getMiniMaxQuotaResetAt
qualified_name: getMiniMaxQuotaResetAt
file_path: open-sse/services/usage.ts
language: typescript
signature:
(
  model: JsonRecord,
  capturedAtMs: number,
  remainsTimeSnakeKey: string,
  remainsTimeCamelKey: string,
  endTimeSnakeKey: string,
  endTimeCamelKey: string
): string | null


id: function:3b481fb3e78f0b777d81ce97a1bea614
kind: function
name: createMiniMaxQuotaFromCount
qualified_name: createMiniMaxQuotaFromCount
file_path: open-sse/services/usage.ts
language: typescript
signature:
(
  total: number,
  count: number,
  resetAt: string | null,
  countMeansRemaining: boolean
): UsageQuota


id: function:4148f2915cba6e31e8754c5a538bb5d8
kind: function
name: getCrofUsage
qualified_name: getCrofUsage
file_path: open-sse/services/usage.ts
language: typescript
signature: (apiKey: string)
docstring:
CrofAI surfaces a tiny endpoint with two signals:
GET https://crof.ai/usage_api/  →  { usable_requests: number|null, credits: number }
`usable_requests` is the daily request bucket on a subscription plan; `null`
for pay-as-you-go. `credits` is the USD credit balance. We surface both as
quotas so the Limits & Quotas page can render whichever the account uses.


id: function:9f4e6e3ae27383b5bfb5a9141fdbc377
kind: function
name: getBailianCodingPlanUsage
qualified_name: getBailianCodingPlanUsage
file_path: open-sse/services/usage.ts
language: typescript
signature: ( connectionId: string, apiKey: string, providerSpecificData?: Record<string, unknown> )
docstring:
Bailian (Alibaba Coding Plan) Usage
Fetches triple-window quota (5h, weekly, monthly) and returns worst-case.


id: function:34d821a5550aff56d8b5caefd9062f39
kind: function
name: getDeepseekUsage
qualified_name: getDeepseekUsage
file_path: open-sse/services/usage.ts
language: typescript
signature: (connectionId: string, apiKey: string)
docstring:
DeepSeek Usage
Fetches balance from the DeepSeek balance API.
Returns all balances (USD and CNY) as "credits" for credits-style UI display.


id: function:6df899df51cbaa4ac0beb08c702d9043
kind: function
name: getNanoGptUsage
qualified_name: getNanoGptUsage
file_path: open-sse/services/usage.ts
language: typescript
signature: (apiKey: string)
docstring:
NanoGPT Usage
Fetches subscription-level quota from the NanoGPT API.
Returns daily/weekly token limits and daily image limits for PRO accounts.


id: function:0d118600a0866e76bce6730eb648fcad
kind: function
name: decodeCursorJwtSub
qualified_name: decodeCursorJwtSub
file_path: open-sse/services/usage.ts
language: typescript
signature: (token: string): string | null
docstring:
Decode the `sub` claim of a Cursor JWT (the WorkOS user id).
Returns null if the token is not a parseable JWT.


id: function:7282b239ff70cd185097e27fad1787cf
kind: function
name: getCursorUsage
qualified_name: getCursorUsage
file_path: open-sse/services/usage.ts
language: typescript
signature: (accessToken: string, providerSpecificData?: unknown)
docstring:
Cursor Pro Plan Usage
Fetches current-billing-cycle spend from the cursor.com dashboard API and exposes three
windows that mirror the cursor.com/dashboard/spending UI: Total / Auto + Composer / API.


id: constant:1bf6adb8c781744f0df95009d8f609c9
kind: constant
name: USAGE_FETCHER_PROVIDERS
qualified_name: USAGE_FETCHER_PROVIDERS
file_path: open-sse/services/usage.ts
language: typescript
signature:
= [
  "github",
  "gemini-cli",
  "antigravity",
  "claude",
  "codex",
  "cursor",
  "kiro",
  "amazo...


id: function:b2da278de2fc7655869926ca78afb4ff
kind: function
name: parseResetTime
qualified_name: parseResetTime
file_path: open-sse/services/usage.ts
language: typescript
signature: (resetValue: unknown): string | null
docstring:
Parse reset date/time to ISO string
Handles multiple formats: Unix timestamp (ms), ISO date string, etc.


id: constant:2969e71289573d74e597f936d4ebfc6c
kind: constant
name: _geminiCliSubCache
qualified_name: _geminiCliSubCache
file_path: open-sse/services/usage.ts
language: typescript
signature: = new Map<string, SubscriptionCacheEntry>()
docstring:
── Gemini CLI subscription info cache ──────────────────────────────────────
Prevents duplicate loadCodeAssist calls within the same quota cycle.
Key: accessToken → { data, fetchedAt }


id: function:45f325b100fd4ee29c60b23455818c2d
kind: function
name: getGeminiUsage
qualified_name: getGeminiUsage
file_path: open-sse/services/usage.ts
language: typescript
signature: ( accessToken?: string, providerSpecificData?: JsonRecord, connectionProjectId?: string )
docstring:
5 minutes
Gemini CLI Usage — fetch per-model quota from Cloud Code Assist API.
Gemini CLI and Antigravity share the same upstream (cloudcode-pa.googleapis.com),
so this follows the same pattern as getAntigravityUsage().


id: constant:84ee59fe8b0dfa4eb2757f9a55898456
kind: constant
name: _antigravitySubCache
qualified_name: _antigravitySubCache
file_path: open-sse/services/usage.ts
language: typescript
signature: = new Map<string, SubscriptionCacheEntry>()
docstring:
── Antigravity subscription info cache ──────────────────────────────────────
Prevents duplicate loadCodeAssist calls within the same quota cycle.
Key: truncated accessToken → { data, fetchedAt }


id: function:1aea99059f7e0f282d1d408dfeedb028
kind: function
name: fetchAntigravityAvailableModelsCached
qualified_name: fetchAntigravityAvailableModelsCached
file_path: open-sse/services/usage.ts
language: typescript
signature:
(
  accessToken: string,
  projectId?: string | null,
  options: AntigravityUsageOptions = {}
): Promise<unknown>


id: function:d9c0b3fad46db4c3466da3e9da13f4e6
kind: function
name: probeAntigravityCreditBalance
qualified_name: probeAntigravityCreditBalance
file_path: open-sse/services/usage.ts
language: typescript
docstring:
Proactive credit balance probe for Antigravity.
Fires a minimal streamGenerateContent request with GOOGLE_ONE_AI credits enabled
and maxOutputTokens=1 to extract the `remainingCredits` field from the SSE stream.
This uses ~1 credit but lets us show the balance on the dashboard without waiting
for a real user request.
Returns the credit balance, or null if the probe failed.

signature:
(
  accessToken: string,
  accountId: string,
  projectId?: string | null,
  options: AntigravityUsageOptions = {},
  providerSpecificData: JsonRecord = {}
): Promise<number | null>


id: function:a9b5aad3f9ad006426beee3537dbc64b
kind: function
name: probeAntigravityCreditBalanceUncached
qualified_name: probeAntigravityCreditBalanceUncached
file_path: open-sse/services/usage.ts
language: typescript
signature:
(
  accessToken: string,
  accountId: string,
  projectId?: string | null,
  providerSpecificData: JsonRecord = {}
): Promise<number | null>


id: function:3bdb93ddd282f10ea633c917fe032bec
kind: function
name: getAntigravityUsage
qualified_name: getAntigravityUsage
file_path: open-sse/services/usage.ts
language: typescript
docstring:
Antigravity Usage - Fetch quota from Google Cloud Code API
Uses fetchAvailableModels API which returns ALL models (including Claude)
with per-model quotaInfo (remainingFraction, resetTime).
retrieveUserQuota only returns Gemini models — not suitable for Antigravity.

signature:
(
  accessToken?: string,
  providerSpecificData?: JsonRecord,
  connectionProjectId?: string,
  connectionId?: string,
  options: AntigravityUsageOptions = {}
)


id: function:15aea4b09eddfe90a037d01ad138c42d
kind: function
name: getAntigravitySubscriptionInfoCached
qualified_name: getAntigravitySubscriptionInfoCached
file_path: open-sse/services/usage.ts
language: typescript
docstring:
Get Antigravity subscription info (cached, 5 min TTL)
Prevents duplicate loadCodeAssist calls within the same quota cycle.

signature:
(
  accessToken: string,
  providerSpecificData?: JsonRecord,
  options: AntigravityUsageOptions = {}
): Promise<unknown>


id: function:4b72507853f949c8522fa715a03bf56d
kind: function
name: getAntigravitySubscriptionInfo
qualified_name: getAntigravitySubscriptionInfo
file_path: open-sse/services/usage.ts
language: typescript
signature: ( accessToken: string, providerSpecificData?: JsonRecord ): Promise<unknown | null>
docstring:
Get Antigravity subscription info using correct Antigravity headers.
Must match the headers used in providers.js postExchange (not CLI headers).


id: function:87bf8d0b3616ad7a0deea1b790d3de89
kind: function
name: getClaudeUsageLegacy
qualified_name: getClaudeUsageLegacy
file_path: open-sse/services/usage.ts
language: typescript
signature: (accessToken?: string)
docstring:
Legacy Claude usage fetcher for API key / org admin users.
Uses /v1/settings + /v1/organizations/{org_id}/usage endpoints.


id: function:58a3f38ea3607f46c759dd2ebe06bcf7
kind: function
name: getCodexUsage
qualified_name: getCodexUsage
file_path: open-sse/services/usage.ts
language: typescript
signature: ( accessToken?: string, providerSpecificData: Record<string, unknown> = {} )
docstring:
Codex (OpenAI) Usage - Fetch from ChatGPT backend API
IMPORTANT: Uses persisted workspaceId from OAuth to ensure correct workspace binding.
No fallback to other workspaces - strict binding to user's selected workspace.


id: function:4095a724ee41972747b3c33c2a5ddc84
kind: function
name: getKimiPlanName
qualified_name: getKimiPlanName
file_path: open-sse/services/usage.ts
language: typescript
signature: (level: unknown): string
docstring:
Map Kimi membership level to display name
LEVEL_BASIC = Moderato, LEVEL_INTERMEDIATE = Allegretto,
LEVEL_ADVANCED = Allegro, LEVEL_STANDARD = Vivace


id: function:622780645e4c807a30902256ec38d272
kind: function
name: getKimiUsage
qualified_name: getKimiUsage
file_path: open-sse/services/usage.ts
language: typescript
signature: (accessToken?: string)
docstring:
Kimi Coding Usage - Fetch quota from Kimi API
Uses the official /v1/usages endpoint with custom X-Msh-* headers


id: constant:2814a7a58cb9f498386a2a3d39cb180f
kind: constant
name: __testing
qualified_name: __testing
file_path: open-sse/services/usage.ts
language: typescript
signature:
= {
  parseResetTime,
  formatGitHubQuotaSnapshot,
  inferGitHubPlanName,
  getGeminiCliPlanLabel,
  g...


id: constant:d6a7c66f300d2f90af7cdc4418be9144
kind: constant
name: BROWSER_KEYWORDS
qualified_name: BROWSER_KEYWORDS
file_path: open-sse/services/volumeDetector.ts
language: typescript
docstring: Tool-related keywords that signal browser/UI interaction
signature:
= [
  "browser",
  "playwright",
  "puppeteer",
  "screenshot",
  "navigate",
  "click",
  "form",
  "...


id: constant:9c7811fa739b2c52e01eaa3d28daaff7
kind: constant
name: HIGH_COMPLEXITY_KEYWORDS
qualified_name: HIGH_COMPLEXITY_KEYWORDS
file_path: open-sse/services/volumeDetector.ts
language: typescript
docstring: Keywords that signal high complexity
signature:
= [
  "deploy",
  "migration",
  "security",
  "auth",
  "database",
  "refactor",
  "production",
  "...


id: function:151d5eeca5411922f977e7dcf69acb0d
kind: function
name: supportsNativeWebSearchFallbackBypass
qualified_name: supportsNativeWebSearchFallbackBypass
file_path: open-sse/services/webSearchFallback.ts
language: typescript
signature:
({
  targetFormat,
  nativeCodexPassthrough,
}: {
  provider?: string | null;
  sourceFormat?: string | null;
  targetFormat: string | null | undefined;
  nativeCodexPassthrough: boolean;
}): boolean


id: function:f92daa9ef48aecaaa7afb597bc170dbb
kind: function
name: prepareWebSearchFallbackBody
qualified_name: prepareWebSearchFallbackBody
file_path: open-sse/services/webSearchFallback.ts
language: typescript
signature:
(
  body: T,
  options: {
    provider?: string | null;
    sourceFormat?: string | null;
    targetFormat?: string | null;
    nativeCodexPassthrough: boolean;
  }
): { body: T; fallback: WebSearchFallbackPlan }


id: constant:f48b08f881399642503645e57c47d849
kind: constant
name: HIGH_KEYWORDS
qualified_name: HIGH_KEYWORDS
file_path: open-sse/services/workflowFSM.ts
language: typescript
signature:
= [
  "schema",
  "migration",
  "deploy",
  "delete",
  "drop",
  "env",
  "database",
  "refactor",
...


id: constant:4e447cdf57db91c9d75a8d5c8a4d60c4
kind: constant
name: MED_KEYWORDS
qualified_name: MED_KEYWORDS
file_path: open-sse/services/workflowFSM.ts
language: typescript
signature:
= [
  "endpoint",
  "feature",
  "service",
  "model",
  "api",
  "integration",
  "webhook",
  "middl...


id: constant:aa0a22bdbf81ad9f41f396727b140c91
kind: constant
name: PHASE_ORDER
qualified_name: PHASE_ORDER
file_path: open-sse/services/workflowFSM.ts
language: typescript
signature:
= [
  "classify",
  "plan",
  "plan_review",
  "execute",
  "code_review",
  "quality_review",
  "secu...


id: constant:f6e8f99032418bf2556592c7991e3e39
kind: constant
name: T
qualified_name: T
file_path: open-sse/services/workflowFSM.ts
language: typescript
signature:
= [
  {
    from: "classify",
    to: "plan",
    condition: (c) => c.risk === "high",
    description...


id: function:8e125e1dd233e82978f46ec4d739f43a
kind: function
name: createWorkflow
qualified_name: createWorkflow
file_path: open-sse/services/workflowFSM.ts
language: typescript
signature:
(
  id: string,
  description: string,
  opts?: { maxRetries?: number; metadata?: Record<string, unknown> }
): WorkflowContext


id: function:10a50b735ef32ead3bfe521fed364a05
kind: function
name: advance
qualified_name: advance
file_path: open-sse/services/workflowFSM.ts
language: typescript
signature:
(
  ctx: WorkflowContext,
  result?: {
    verdict?: Verdict;
    testsPass?: boolean;
    provider?: string;
    model?: string;
    notes?: string;
  }
): Phase | null


id: variable:3fe9403f47c0bac993f62026c5879d01
kind: variable
name: _fs
qualified_name: _fs
file_path: open-sse/transformer/responsesTransformer.ts
language: typescript
signature: = null
docstring:
Responses API Transformer
Converts OpenAI Chat Completions SSE to Codex Responses API SSE format
Can be used in both Next.js and Cloudflare Workers
Dynamic import for Node.js-only modules (fs/path unavailable in Workers)


id: constant:c2353453e993b27793f2e92bab6628bb
kind: constant
name: FORMATS
qualified_name: FORMATS
file_path: open-sse/translator/formats.ts
language: typescript
signature:
= {
  OPENAI: "openai",
  OPENAI_RESPONSES: "openai-responses",
  OPENAI_RESPONSE: "openai-response",
...


id: function:212bcb118b45c84536ba982c639c6ef9
kind: function
name: prepareClaudeRequest
qualified_name: prepareClaudeRequest
file_path: open-sse/translator/helpers/claudeHelper.ts
language: typescript
signature:
(
  body: ClaudeRequestBody,
  provider: string | null = null,
  preserveCacheControl = false
): ClaudeRequestBody


id: constant:596112dbf5ad02f5309bfcec1addf0d2
kind: constant
name: GEMINI_UNSUPPORTED_SCHEMA_KEYS
qualified_name: GEMINI_UNSUPPORTED_SCHEMA_KEYS
file_path: open-sse/translator/helpers/geminiHelper.ts
language: typescript
signature:
= new Set([
  // Basic constraints (not supported by Gemini API)
  "minLength",
  "maxLength",
  "excl...


id: constant:c5407051be51316efb1bc6a1633c3b56
kind: constant
name: DEFAULT_SAFETY_SETTINGS
qualified_name: DEFAULT_SAFETY_SETTINGS
file_path: open-sse/translator/helpers/geminiHelper.ts
language: typescript
signature:
= [
  { category: "HARM_CATEGORY_HATE_SPEECH", threshold: "OFF" },
  { category: "HARM_CATEGORY_DANGER...


id: function:a7accc2fc8d038650e84e8b2b688229a
kind: function
name: convertEnumValuesToStrings
qualified_name: convertEnumValuesToStrings
file_path: open-sse/translator/helpers/geminiHelper.ts
language: typescript
signature: (obj: unknown): void
docstring:
Convert enum values to strings (Gemini requires string enum values)
For integer types, remove enum entirely as Gemini doesn't support it


id: function:f8c6eebd23525674ec4b223ff30f7680
kind: function
name: isSanitizedNameTaken
qualified_name: isSanitizedNameTaken
file_path: open-sse/translator/helpers/geminiToolsSanitizer.ts
language: typescript
signature:
(
  toolNameMap: Map<string, string> | null | undefined,
  sanitizedName: string,
  originalName: string
): boolean


id: constant:41af01b5121a5f79e6a9070a48c4c2d8
kind: constant
name: VALID_OPENAI_MESSAGE_TYPES
qualified_name: VALID_OPENAI_MESSAGE_TYPES
file_path: open-sse/translator/helpers/openaiHelper.ts
language: typescript
signature:
= [
  "text",
  "image_url",
  "image",
  "file_url",
  "file",
  "document",
  "image",
  "tool_calls...


id: type_alias:d56b0b401b8575e9af01c6cef983dd71
kind: type_alias
name: JsonRecord
qualified_name: JsonRecord
file_path: open-sse/translator/helpers/schemaCoercion.ts
language: typescript
docstring:
Shared sanitizers for tool payloads that arrive from IDEs/SDKs with
JSON Schema numeric constraints encoded as strings or invalid descriptions.


id: constant:684deddd9a5f8fd13ae8e1c9d51b175b
kind: constant
name: NUMERIC_SCHEMA_FIELDS
qualified_name: NUMERIC_SCHEMA_FIELDS
file_path: open-sse/translator/helpers/schemaCoercion.ts
language: typescript
signature:
= [
  "minimum",
  "maximum",
  "exclusiveMinimum",
  "exclusiveMaximum",
  "minLength",
  "maxLength"...


id: type_alias:e84fca35d57216bb5f663761f7b8921b
kind: type_alias
name: ShimFn
qualified_name: ShimFn
file_path: open-sse/translator/helpers/toolCallShim.ts
language: typescript
docstring:
Defensive shims for tool calls whose strict-schema fields can be malformed
by upstream models (e.g. MiMo emitting empty objects/strings instead of
arrays for Capy's submit_pr_review).

Applied on the assembled OpenAI tool-call arguments after streaming, just
before they are re-emitted as a single Claude input_json_delta.

To add a new shim: register a (input) => input transformer in TOOL_SHIMS
keyed by the tool name. The transformer must accept arbitrary input and
return a JSON-safe value.


id: constant:5d2da0588055daf1ec8f8ad7d741e002
kind: constant
name: TOOL_SHIMS
qualified_name: TOOL_SHIMS
file_path: open-sse/translator/helpers/toolCallShim.ts
language: typescript
signature:
= {
  submit_pr_review: (input) => {
    if (typeof input !== "object" || input === null || Array.isAr...


id: constant:42d4ab9dfa767be41693b434b4d2c396
kind: constant
name: OPENAI_SIZE_TO_ASPECT_RATIO
qualified_name: OPENAI_SIZE_TO_ASPECT_RATIO
file_path: open-sse/translator/image/sizeMapper.ts
language: typescript
signature:
= {
  "256x256": "1:1",
  "512x512": "1:1",
  "1024x1024": "1:1",
  "1792x1024": "16:9",
  "1024x1792"...


id: import:fbf063a9551aff60b9d6f7a0cac792a6
kind: import
name: ./helpers/schemaCoercion.ts
qualified_name: ./helpers/schemaCoercion.ts
file_path: open-sse/translator/index.ts
language: typescript
signature:
import {
  coerceToolSchemas,
  injectEmptyReasoningContentForToolCalls,
  sanitizeToolDescriptions,
} from "./helpers/schemaCoercion.ts";


id: import:ec2ecadb24821e93de9147d505cbb319
kind: import
name: ../services/reasoningCache.ts
qualified_name: ../services/reasoningCache.ts
file_path: open-sse/translator/index.ts
language: typescript
signature:
import {
  lookupReasoning,
  recordReplay,
  requiresReasoningReplay,
} from "../services/reasoningCache.ts";


id: function:2a56099d5852e517c7aec5d6f0b32add
kind: function
name: translateRequest
qualified_name: translateRequest
file_path: open-sse/translator/index.ts
language: typescript
signature:
(
  sourceFormat,
  targetFormat,
  model,
  body,
  stream = true,
  credentials = null,
  provider = null,
  reqLogger = null,
  options?: {
    normalizeToolCallId?: boolean;
    preserveDeveloperRole?: boolean;
    preserveCacheControl?: boolean;
    signatureNamespace?: string | null;
  }
)


id: function:1e5132f84f0c246f66f3d7f023e0b2ae
kind: function
name: register
qualified_name: register
file_path: open-sse/translator/registry.ts
language: typescript
signature:
(
  from: string,
  to: string,
  requestFn?: RequestTranslator,
  responseFn?: ResponseTranslator
)


id: function:884675b5ed5289a8f93f5fab6fbe2608
kind: function
name: convertContent
qualified_name: convertContent
file_path: open-sse/translator/request/antigravity-to-openai.ts
language: typescript
signature: (content)
docstring:
Convert Antigravity content to OpenAI message
Handles: text, thought, thoughtSignature, functionCall, functionResponse, inlineData


id: import:64865214532fe4034ad86dc4e17897e9
kind: import
name: ../helpers/geminiHelper.ts
qualified_name: ../helpers/geminiHelper.ts
file_path: open-sse/translator/request/claude-to-gemini.ts
language: typescript
signature:
import {
  DEFAULT_SAFETY_SETTINGS,
  tryParseJSON,
  cleanJSONSchemaForAntigravity,
} from "../helpers/geminiHelper.ts";


id: function:2273758fe4eda6493ca28299783bb7ef
kind: function
name: normalizeToolSchema
qualified_name: normalizeToolSchema
file_path: open-sse/translator/request/claude-to-openai.ts
language: typescript
signature: (schema: unknown): Record<string, unknown>
docstring:
Normalize tool input schema for OpenAI compatibility.
OpenAI strict mode requires `properties: {}` on object-type schemas,
even for zero-argument tools. Anthropic/MCP tools may omit it (#1898).


id: constant:45865d8b94f6f18ab2c8f07894d82b6c
kind: constant
name: MIN_CLAUDE_THINKING_BUDGET
qualified_name: MIN_CLAUDE_THINKING_BUDGET
file_path: open-sse/translator/request/openai-to-claude.ts
language: typescript
signature: = 1024
docstring:
Anthropic constraints for the thinking + max_tokens contract:
- thinking.budget_tokens must be >= 1024 when thinking is enabled
- max_tokens must be > thinking.budget_tokens (covers thinking + response)
- max_tokens must be <= model output cap (e.g. 128000 for Opus 4.7)


id: function:1dda691d6800262c74dce543d93cb76d
kind: function
name: fitThinkingToMaxTokens
qualified_name: fitThinkingToMaxTokens
file_path: open-sse/translator/request/openai-to-claude.ts
language: typescript
signature:
(
  model: string,
  callerMaxTokens: number,
  thinking: Record<string, unknown> | undefined
): { maxTokens: number; thinking: Record<string, unknown> | undefined }


id: import:34dd55792ad4328166e9a397d397728a
kind: import
name: ../../services/geminiThoughtSignatureStore.ts
qualified_name: ../../services/geminiThoughtSignatureStore.ts
file_path: open-sse/translator/request/openai-to-gemini.ts
language: typescript
signature:
import {
  buildGeminiThoughtSignatureKey,
  resolveGeminiThoughtSignature,
} from "../../services/geminiThoughtSignatureStore.ts";


id: import:481e7fb09bf619c64967b8de0519df14
kind: import
name: ../../services/antigravityIdentity.ts
qualified_name: ../../services/antigravityIdentity.ts
file_path: open-sse/translator/request/openai-to-gemini.ts
language: typescript
signature:
import {
  generateAntigravityRequestId,
  getAntigravityEnvelopeUserAgent,
  getAntigravitySessionId,
} from "../../services/antigravityIdentity.ts";


id: import:09d5149be2f90329e8ce07ee99fd6a4a
kind: import
name: ../../../src/lib/modelCapabilities.ts
qualified_name: ../../../src/lib/modelCapabilities.ts
file_path: open-sse/translator/request/openai-to-gemini.ts
language: typescript
signature:
import {
  capMaxOutputTokens,
  capThinkingBudget,
  getDefaultThinkingBudget,
} from "../../../src/lib/modelCapabilities.ts";


id: import:2358744d08f2b692b5a03378b5eb5a46
kind: import
name: ../helpers/geminiHelper.ts
qualified_name: ../helpers/geminiHelper.ts
file_path: open-sse/translator/request/openai-to-gemini.ts
language: typescript
signature:
import {
  DEFAULT_SAFETY_SETTINGS,
  convertOpenAIContentToParts,
  extractTextContent,
  tryParseJSON,
  generateSessionId,
  cleanJSONSchemaForAntigravity,
} from "../helpers/geminiHelper.ts";


id: constant:e4ecb52894b7197e9c91013d9f3c18aa
kind: constant
name: ANTIGRAVITY_CLAUDE_MAX_OUTPUT_TOKENS
qualified_name: ANTIGRAVITY_CLAUDE_MAX_OUTPUT_TOKENS
file_path: open-sse/translator/request/openai-to-gemini.ts
language: typescript
signature: = 16_384
docstring:
Observed Antigravity wrapper output cap, not an underlying model capability.
Keep this bridge-local: capMaxOutputTokens() falls back to OmniRoute's generic
8192 default for unknown Claude-family IDs, while Antigravity currently caps
visible output around 16K. See: https://github.com/keisksw/antigravity-output-analysis


id: function:3af239eb897d6f91f9b096291cb45233
kind: function
name: openaiToGeminiCLIRequest
qualified_name: openaiToGeminiCLIRequest
file_path: open-sse/translator/request/openai-to-gemini.ts
language: typescript
signature:
(
  model,
  body,
  stream,
  options: {
    functionResponseShape?: "result" | "output";
    signatureNamespace?: string | null;
    signaturelessToolCallMode?: "native" | "text";
  } = {}
)


id: function:c10f51371aa0b62f51044d9a01f568a0
kind: function
name: normalizeKiroToolSchema
qualified_name: normalizeKiroToolSchema
file_path: open-sse/translator/request/openai-to-kiro.ts
language: typescript
signature: (schema: unknown): Record<string, unknown>
docstring:
Recursively sanitize JSON Schema for Kiro API.
Kiro returns 400 "Improperly formed request" if:
- `required` is an empty array []
- `additionalProperties` is present anywhere


id: function:2b0e9803161c3b245171b37cdd1038db
kind: function
name: convertMessages
qualified_name: convertMessages
file_path: open-sse/translator/request/openai-to-kiro.ts
language: typescript
signature: (messages, tools, model)
docstring:
Convert OpenAI messages to Kiro format
Rules: system/tool/user -> user role, merge consecutive same roles


id: import:9eb65862f491c8847af120e31789574b
kind: import
name: ../../services/geminiThoughtSignatureStore.ts
qualified_name: ../../services/geminiThoughtSignatureStore.ts
file_path: open-sse/translator/response/gemini-to-openai.ts
language: typescript
signature:
import {
  buildGeminiThoughtSignatureKey,
  storeGeminiThoughtSignature,
} from "../../services/geminiThoughtSignatureStore.ts";


id: function:778554d77d061c28979b0a7a1b2a88ac
kind: function
name: buildToolCallId
qualified_name: buildToolCallId
file_path: open-sse/translator/response/gemini-to-openai.ts
language: typescript
signature:
(
  functionCall: GeminiFunctionCallPart["functionCall"],
  toolName: string,
  toolCallIndex: number
)


id: function:b6e3d78159829199e7f07e2ced74c737
kind: function
name: emitFunctionCallPart
qualified_name: emitFunctionCallPart
file_path: open-sse/translator/response/gemini-to-openai.ts
language: typescript
signature:
(
  part: GeminiFunctionCallPart,
  state: GeminiToOpenAIState,
  results: Array<Record<string, unknown>>
)


id: function:313f6ed6057b4703caf01979d8e116f7
kind: function
name: signAwsRequest
qualified_name: signAwsRequest
file_path: open-sse/utils/awsSigV4.ts
language: typescript
signature:
({
  method,
  url,
  region,
  service,
  headers = {},
  body = "",
  credentials,
  now = new Date(),
}: AwsSigV4Request): Record<string, string>


id: function:71edeb82fb159d692bd03ad2c0e824d3
kind: function
name: mergeChunksToResponse
qualified_name: mergeChunksToResponse
file_path: open-sse/utils/bypassHandler.ts
language: typescript
signature: (chunks, sourceFormat)
docstring:
Merge translated chunks into final response object (for non-streaming)
Takes the last complete chunk as the final response


id: function:11cc2bed32fdc9b0a41b21c00bd8f628
kind: function
name: shouldPreserveCacheControl
qualified_name: shouldPreserveCacheControl
file_path: open-sse/utils/cacheControlPolicy.ts
language: typescript
signature:
({
  userAgent,
  isCombo,
  comboStrategy,
  targetProvider,
  targetFormat,
  settings,
}: {
  userAgent: string | null | undefined;
  isCombo: boolean;
  comboStrategy?: RoutingStrategyValue | null;
  targetProvider: string | null | undefined;
  targetFormat?: string | null;
  settings?: CacheControlSettings;
}): boolean


id: function:b958a26d711b01837d1975934a8c0605
kind: function
name: trackCacheMetrics
qualified_name: trackCacheMetrics
file_path: open-sse/utils/cacheControlPolicy.ts
language: typescript
signature:
({
  preserved,
  provider,
  strategy,
  metrics,
  inputTokens,
  cachedTokens,
  cacheCreationTokens,
}: {
  preserved: boolean;
  provider: string;
  strategy: string | null | undefined;
  metrics: CacheControlMetrics;
  inputTokens?: number;
  cachedTokens?: number;
  cacheCreationTokens?: number;
}): CacheControlMetrics


id: function:c411e6ea13872b5d89b9efd6fdf4cff2
kind: function
name: updateCacheTokenMetrics
qualified_name: updateCacheTokenMetrics
file_path: open-sse/utils/cacheControlPolicy.ts
language: typescript
signature:
({
  metrics,
  provider,
  strategy,
  inputTokens,
  cachedTokens,
  cacheCreationTokens,
  costSaved,
}: {
  metrics: CacheControlMetrics;
  provider: string;
  strategy: string | null | undefined;
  inputTokens: number;
  cachedTokens: number;
  cacheCreationTokens: number;
  costSaved?: number;
}): CacheControlMetrics


id: type_alias:e4f41f3a5ab418289dce28dcf14e7f18
kind: type_alias
name: JsonRecord
qualified_name: JsonRecord
file_path: open-sse/utils/comfyuiClient.ts
language: typescript
docstring:
Shared ComfyUI API Client
Used by image, video, and music handlers to submit workflows,
poll for completion, and fetch output files from a ComfyUI server.


id: function:799123c90e649025f9c3ab1e7b7db37f
kind: function
name: pollComfyResult
qualified_name: pollComfyResult
file_path: open-sse/utils/comfyuiClient.ts
language: typescript
signature:
(
  baseUrl: string,
  promptId: string,
  timeoutMs: number = 120_000
): Promise<ComfyHistoryEntry>


id: function:2e04626731553862785d6ac67132df01
kind: function
name: fetchComfyOutput
qualified_name: fetchComfyOutput
file_path: open-sse/utils/comfyuiClient.ts
language: typescript
signature:
(
  baseUrl: string,
  filename: string,
  subfolder: string,
  type: string
): Promise<ArrayBuffer>


id: constant:912e0fb262f13163c565bb27ff4290f8
kind: constant
name: CORS_HEADERS
qualified_name: CORS_HEADERS
file_path: open-sse/utils/cors.ts
language: typescript
signature:
= {
  "Access-Control-Allow-Methods": "GET, POST, PUT, DELETE, PATCH, OPTIONS",
  "Access-Control-Allo...


id: constant:f4cd18a34478fd7a740ac590ff3c18b6
kind: constant
name: ESM_ID
qualified_name: ESM_ID
file_path: open-sse/utils/cursorAgentProtobuf.ts
language: typescript
signature: = 1
docstring:
AgentServerMessage.kv_server_message
Cursor sends kv_server_message frames once the model stops generating
(it saves the assistant turn into a blob). For non-tool-calling chats
this functions as our end-of-response marker.


id: constant:f96183bd5393989e92f0cce406d30be5
kind: constant
name: ACM_KV_CLIENT_MESSAGE
qualified_name: ACM_KV_CLIENT_MESSAGE
file_path: open-sse/utils/cursorAgentProtobuf.ts
language: typescript
signature: = 3
docstring:
TextDeltaUpdate.text
─── Phase 1+: tool-use field numbers ──────────────────────────────────────
Field numbers in result-message oneof discriminators (RES_*) are best-known
values; verified against wire-tap captures during integration testing.


id: constant:e02941b44ca5273c11d406f820973204
kind: constant
name: ECM_SHELL_RESULT
qualified_name: ECM_SHELL_RESULT
file_path: open-sse/utils/cursorAgentProtobuf.ts
language: typescript
signature: = 2
docstring:
AgentClientMessage.kv_client_message
CSS_ROOT_PROMPT and CSS_TURNS already declared above (lines 34-35)
CSS_TURNS_OLD = 2 is deprecated; CSS_TURNS = 8 is current.
ExecClientMessage payload variants (mirror ESM_*)


id: constant:1f0bbbe46d40678122dd8150bcea3722
kind: constant
name: KSM_REQUEST_METADATA
qualified_name: KSM_REQUEST_METADATA
file_path: open-sse/utils/cursorAgentProtobuf.ts
language: typescript
signature: = 4
docstring:
Field 4 of KvServerMessage is an opaque request-correlation/metadata
envelope — observed in real wire captures. The exact schema isn't
public; we capture its raw bytes and echo them back in our reply
so cursor can match request to response.


id: constant:495494e34993aef8152416de9a886c8f
kind: constant
name: REJ_PATH
qualified_name: REJ_PATH
file_path: open-sse/utils/cursorAgentProtobuf.ts
language: typescript
signature: = 1
docstring:
GetBlobResult.blob_data (bytes) — verified by wire test (cursor parses field 1 as JSON)
Rejection sub-messages (path-based: read/write/delete/ls)


id: constant:21f3a1bc8602249afb2cb6158020be0f
kind: constant
name: RES_REJECTED
qualified_name: RES_REJECTED
file_path: open-sse/utils/cursorAgentProtobuf.ts
language: typescript
signature: = 2
docstring:
FetchError.error
Result-message variant discriminators (oneof). field 1 = success/accepted,
field 2 = rejected/error. Matches existing RCR_SUCCESS=1 pattern.


id: constant:a42e15309c28f29b54b9e191de291ef3
kind: constant
name: MAP_KEY
qualified_name: MAP_KEY
file_path: open-sse/utils/cursorAgentProtobuf.ts
language: typescript
signature: = 1
docstring:
ListValue.values = repeated Value
proto3 map<K,V> serializes as repeated FieldsEntry { key=1, value=2 }


id: constant:1d20750d73adb72ab424c2397d020ad5
kind: constant
name: ARR_MCP_TOOLS_INNER
qualified_name: ARR_MCP_TOOLS_INNER
file_path: open-sse/utils/cursorAgentProtobuf.ts
language: typescript
signature: = 1
docstring:
McpTools.tool field number — repeated McpToolDefinition entries go under
field 1 of the McpTools wrapper (which itself is field 4 of AgentRunRequest).


id: constant:8d0dfe31bd401ddaaa321e9424ac1d4e
kind: constant
name: RCS_TOOLS
qualified_name: RCS_TOOLS
file_path: open-sse/utils/cursorAgentProtobuf.ts
language: typescript
signature: = 2
docstring:
RequestContext.tools field number — multiple tool defs are repeated within
the inner RequestContext message.


id: function:50474177a017915a7f8d03a6fa9b27f8
kind: function
name: wrapExecClientMessage
qualified_name: wrapExecClientMessage
file_path: open-sse/utils/cursorAgentProtobuf.ts
language: typescript
docstring:
─── ExecClientMessage wrapper ──────────────────────────────────────────────
Build an ExecClientMessage frame:
  AgentClientMessage {
    exec_client_message (2): ExecClientMessage {
      id (1): execMsgId,
      exec_id (15): execId,
      <resultFieldNumber>: resultPayload,
    }
  }
Connect-RPC framed, ready to write to the h2 stream.
`exec_id` is force-set even when empty (matches kaitranntt's behavior).

signature:
(
  execMsgId: number,
  execId: string,
  resultFieldNumber: number,
  resultPayload: Buffer
): Buffer


id: function:396acb90b229289523651e981c439617
kind: function
name: encodePathRejection
qualified_name: encodePathRejection
file_path: open-sse/utils/cursorAgentProtobuf.ts
language: typescript
signature: (path: string, reason: string): Buffer
docstring:
─── Phase 1: built-in tool rejection encoders ─────────────────────────────
Cursor's model invokes built-in tools (read/write/shell/grep/etc.) which we
can't safely run inside the proxy. We respond with a typed rejection so the
model continues without that tool — matches kaitranntt's stance and avoids
stalling the h2 stream.


id: function:7a9d3e639936fdc55e7a1b7a8d6b89d4
kind: function
name: encodeExecShellRejected
qualified_name: encodeExecShellRejected
file_path: open-sse/utils/cursorAgentProtobuf.ts
language: typescript
signature:
(
  execMsgId: number,
  execId: string,
  command: string,
  workingDir: string,
  reason: string
): Buffer


id: constant:22ae07be11e3c1fecde6ad7d92ab824c
kind: constant
name: ENCODER
qualified_name: ENCODER
file_path: open-sse/utils/earlyStreamKeepalive.ts
language: typescript
signature: = new TextEncoder()
docstring:
Early SSE keepalive wrapper for streaming route handlers.
Strict HTTP clients (notably Codex CLI's `reqwest`, which has a ~5s idle-read
timeout) drop the connection if no bytes arrive shortly after the request.
OmniRoute, however, holds the streaming response until `ensureStreamReadiness`
observes the upstream's first useful byte — which can exceed 5s for reasoning
models that "think" before emitting any token (#2544). `curl` has no such
idle timeout, so it was never affected, which is why the bug looked
client-specific.
This wrapper keeps the connection warm without disturbing the handler's
internal logic (combo failover, stream readiness, account cooldown all still
run inside the handler before it resolves):
  - Fast path: if the handler resolves within `thresholdMs`, its `Response`
    is returned verbatim — identical status, headers, and body. There is zero
    behavior change for normal latency, so metadata headers and non-200 error
    statuses are fully preserved for the common case.
  - Slow path: if the handler is still pending after `thresholdMs`, a 200
    `text/event-stream` response is opened immediately and SSE comment
    heartbeats are emitted every `intervalMs` until the handler resolves; its
    body is then forwarded. If the handler ultimately fails, a structured
    `event: error` frame is emitted in-band (the response is already committed
    to 200, so the HTTP status can no longer change).


id: constant:fe87fa41c936a4f788d2791c5ac2136f
kind: constant
name: ERROR_FRAME
qualified_name: ERROR_FRAME
file_path: open-sse/utils/earlyStreamKeepalive.ts
language: typescript
signature:
= ENCODER.encode(
  `event: error\ndata: ${JSON.stringify({
    error: { message: "Upstream stream fai...


id: function:e29010350613f989d2d6cf005ea72359
kind: function
name: withEarlyStreamKeepalive
qualified_name: withEarlyStreamKeepalive
file_path: open-sse/utils/earlyStreamKeepalive.ts
language: typescript
signature:
(
  handlerPromise: Promise<Response>,
  options: EarlyStreamKeepaliveOptions = {}
): Promise<Response>


id: interface:f917eda67445a78a705fd2811788d60a
kind: interface
name: ErrorResponseBody
qualified_name: ErrorResponseBody
file_path: open-sse/utils/error.ts
language: typescript
docstring:
Sanitize an error message to prevent stack trace exposure in API responses.
Strips stack traces, file paths, and absolute Windows/POSIX paths from
error messages before they reach the client.


id: function:2a6ac5096aaf97371b006f12eda54b41
kind: function
name: createErrorResult
qualified_name: createErrorResult
file_path: open-sse/utils/error.ts
language: typescript
signature:
(
  statusCode: number,
  message: string,
  retryAfterMs: number | null = null,
  errorCode?: string,
  errorType?: string,
  upstreamDetails?: unknown
)


id: function:39663ab46a896c2daebe39beec789a2c
kind: function
name: unavailableResponse
qualified_name: unavailableResponse
file_path: open-sse/utils/error.ts
language: typescript
signature:
(
  statusCode: number,
  message: string,
  retryAfter?: string | number | Date | null,
  retryAfterHuman?: string
)


id: function:692a1937fb8bcba2494078e610d98dee
kind: function
name: buildModelCooldownBody
qualified_name: buildModelCooldownBody
file_path: open-sse/utils/error.ts
language: typescript
signature:
({
  model,
  retryAfterSec,
}: {
  model?: string | null;
  retryAfterSec: number;
}): ModelCooldownErrorPayload


id: function:a736efe7fd74bd9cfc8bbccd95bdcd32
kind: function
name: modelCooldownResponse
qualified_name: modelCooldownResponse
file_path: open-sse/utils/error.ts
language: typescript
signature:
({
  model,
  retryAfter,
}: {
  model?: string | null;
  retryAfter?: string | number | Date | null;
})


id: function:07b49fa166692144f996f2ea9668957f
kind: function
name: formatMeta
qualified_name: formatMeta
file_path: open-sse/utils/logger.ts
language: typescript
signature: (meta?: LogMetadata | null): string
docstring:
Format metadata object as compact JSON string for log output.
Omits keys with null/undefined values to keep logs clean.
@param {object} [meta] - Optional metadata
@returns {string} Formatted metadata string or empty string


id: variable:4204dd73df5485d6a2050205b543ddb1
kind: variable
name: _cachedConfig
qualified_name: _cachedConfig
file_path: open-sse/utils/networkProxy.ts
language: typescript
signature: = null
docstring:
Network Proxy Resolver
Resolves the outbound proxy URL for a given provider.
Precedence: provider-specific > global > environment variables
Usage:
  import { resolveProxy } from "open-sse/utils/networkProxy.js";
  const proxyUrl = await resolveProxy("openai");


id: constant:8fb62882e426bf4523d261adb519348d
kind: constant
name: DEFAULT_INTERVAL_MS
qualified_name: DEFAULT_INTERVAL_MS
file_path: open-sse/utils/progressTracker.ts
language: typescript
signature: = 2000
docstring:
Progress Tracker — Phase 9.3
Emits SSE `event: progress` events during long streaming responses.
Opt-in via X-OmniRoute-Progress: true header.
Progress events contain:
  { tokens_generated, elapsed_ms }
@module utils/progressTracker


id: function:c6f24c3e46d350ec3e964189fa8f4f93
kind: function
name: createProgressTransform
qualified_name: createProgressTransform
file_path: open-sse/utils/progressTracker.ts
language: typescript
signature:
({
  intervalMs = DEFAULT_INTERVAL_MS,
  signal,
}: { intervalMs?: number; signal?: AbortSignal } = {})


id: function:bd94b96d9a0dd7ad4d631c688b896616
kind: function
name: extractExplicitPort
qualified_name: extractExplicitPort
file_path: open-sse/utils/proxyDispatcher.ts
language: typescript
signature: (urlStr: string): string | null
docstring:
Extract the port from a proxy URL string before URL parsing.
`new URL("http://host:80")` strips port 80 since it's the HTTP default,
but proxy servers commonly listen on port 80/443, so we need to preserve it.


id: function:3de70cf4bc21dc43fbae74efc55fddf2
kind: function
name: buildProxyUrlString
qualified_name: buildProxyUrlString
file_path: open-sse/utils/proxyDispatcher.ts
language: typescript
signature: (parsed: URL, port: string): string
docstring:
Build a proxy URL string manually from parsed URL components.
We cannot use URL.toString() because the URL serializer silently strips
default ports (80 for http, 443 for https). Proxy servers commonly
listen on these ports, so we must always include the port explicitly.


id: import:c8aa166c38b89b336a425681ff8c0e29
kind: import
name: ./proxyDispatcher.ts
qualified_name: ./proxyDispatcher.ts
file_path: open-sse/utils/proxyFetch.ts
language: typescript
signature:
import {
  createProxyDispatcher,
  getDefaultDispatcher,
  normalizeProxyUrl,
  proxyConfigToUrl,
  proxyUrlForLogs,
} from "./proxyDispatcher.ts";


id: function:43bf4b0c96bec29061a589e4710d397d
kind: function
name: patchedFetch
qualified_name: patchedFetch
file_path: open-sse/utils/proxyFetch.ts
language: typescript
signature:
(
  input: RequestInfo | URL,
  options: FetchWithDispatcherOptions = {},
  deps: ProxyFetchDeps = {}
)


id: function:0c82553ef3be04f615ec306f15a63a06
kind: function
name: proxyFetch
qualified_name: proxyFetch
file_path: open-sse/utils/proxyFetch.ts
language: typescript
signature:
(
  input: RequestInfo | URL,
  options: RequestInit = {},
  deps: ProxyFetchDeps = {}
): Promise<Response>


id: constant:0a74ba8c3cccb7323cde5cc2c1789c96
kind: constant
name: MASK
qualified_name: MASK
file_path: open-sse/utils/publicCreds.ts
language: typescript
signature: = "omniroute-public-v1"
docstring:
Public credentials decoder.
Some upstream providers (Gemini CLI, Antigravity, Windsurf/Devin CLI) ship
OAuth client_id / client_secret / Firebase Web API key values inside their
public binaries or web apps. These are credentials by name only — Google
explicitly documents that:
  - OAuth client_id/secret for native/installed apps using PKCE are
    publicly distributed and must not be treated as secrets.
    https://developers.google.com/identity/protocols/oauth2/native-app
  - Firebase Web API keys are public client identifiers.
    https://firebase.google.com/docs/projects/api-keys
OmniRoute embeds them so users who do not configure `.env` still get a
working OAuth flow out of the box. The literals, however, trip pattern
scanners (AIza..., GOCSPX-..., ...googleusercontent.com) and produce
noisy false-positive alerts on every release.
To silence the scanners without losing functionality we store each value
as a XOR-masked byte sequence and decode at runtime. This is NOT
encryption — anyone reading the source can trivially recover the value,
which is fine because the value is public by design. The only goal is to
avoid known scanner regexes in the source text.
Backward compatibility: existing users have raw values in their `.env`
(e.g. `WINDSURF_FIREBASE_API_KEY=AIzaSy...`). `decodePublicCred()` detects
raw values by their well-known prefixes and passes them through unchanged,
so no migration is required for current installations.


id: constant:53892023cb534a6a25940bbc2282fd6e
kind: constant
name: RAW_VALUE_PATTERN
qualified_name: RAW_VALUE_PATTERN
file_path: open-sse/utils/publicCreds.ts
language: typescript
signature:
= /^(AIza[A-Za-z0-9_-]{20,}|GOCSPX-[A-Za-z0-9_-]+|\d+-[a-z0-9]{32}\.apps\.googleusercontent\.com|Iv1\....


id: constant:ab085be95f54a990e77f9f60b3cc0097
kind: constant
name: STRICT_BASE64
qualified_name: STRICT_BASE64
file_path: open-sse/utils/publicCreds.ts
language: typescript
signature: = /^[A-Za-z0-9+/]+={0,2}$/
docstring:
A valid base64-encoded masked value uses only the base64 alphabet plus
optional padding. Anything outside that alphabet is definitely a raw
credential the user supplied (a token format we don't yet recognize in
RAW_VALUE_PATTERN) — never try to base64-decode it.


id: function:3095a96aa4fb7ad0f5180721e30d4b01
kind: function
name: looksLikePrintablePlain
qualified_name: looksLikePrintablePlain
file_path: open-sse/utils/publicCreds.ts
language: typescript
signature: (s: string): boolean
docstring:
Plaintext credentials never contain control characters. If unmasking
produces non-printable bytes, the input wasn't actually masked and we
must return it untouched to avoid silently mangling raw overrides.


id: constant:00de896869d565011793fb69ef97f740
kind: constant
name: EMBEDDED_DEFAULTS
qualified_name: EMBEDDED_DEFAULTS
file_path: open-sse/utils/publicCreds.ts
language: typescript
docstring:
Embedded public defaults. Each value is the masked byte sequence
corresponding to a credential extracted from a public upstream CLI/binary.
To regenerate a value:
  node -e 'import("./open-sse/utils/publicCreds.ts").then(m =>
    console.log(JSON.stringify(m.encodePublicCred("<plaintext>"))))'
Or use the helper below `embeddedBytesFor()`.

signature:
= {
  // Gemini CLI / Code Assist — google oauth client (public, PKCE)
  gemini_id: [
    89, 85, 95, ...


id: function:561b56a23656e1d8d20a1ff19df8c586
kind: function
name: appendBoundedChunk
qualified_name: appendBoundedChunk
file_path: open-sse/utils/requestLogger.ts
language: typescript
signature:
(
  chunks: string[],
  bytes: { value: number; truncated: boolean },
  chunk: string,
  maxBytes: number,
  maxItems = DEFAULT_MAX_STREAM_CHUNK_ITEMS
)


id: function:0c742dc4206cc5596d756eb0e58d0540
kind: function
name: createRequestLogger
qualified_name: createRequestLogger
file_path: open-sse/utils/requestLogger.ts
language: typescript
signature:
(
  _sourceFormat?: string,
  _targetFormat?: string,
  _model?: string,
  options: RequestLoggerOptions = {}
): Promise<RequestLogger>


id: constant:335ab1c86fa336353732f962bd6ab4c5
kind: constant
name: HEARTBEAT_SHAPES
qualified_name: HEARTBEAT_SHAPES
file_path: open-sse/utils/sseHeartbeat.ts
language: typescript
signature:
= {
  COMMENT: "comment",
  ANTHROPIC_PING: "anthropic-ping",
  OPENAI_CHUNK: "openai-chunk",
  OPENAI...


id: function:cf3b983ce7bb590c286624b59d75fc6c
kind: function
name: createSseHeartbeatTransform
qualified_name: createSseHeartbeatTransform
file_path: open-sse/utils/sseHeartbeat.ts
language: typescript
signature:
({
  intervalMs = DEFAULT_SSE_HEARTBEAT_INTERVAL_MS,
  signal,
  shape = DEFAULT_SSE_HEARTBEAT_SHAPE,
  chunkId,
  chunkModel,
}: SseHeartbeatTransformOptions = {}): TransformStream<Uint8Array, Uint8Array>


id: import:9276da7123033aeadfb9c9f32eb11e2c
kind: import
name: ./usageTracking.ts
qualified_name: ./usageTracking.ts
file_path: open-sse/utils/stream.ts
language: typescript
signature:
import {
  extractUsage,
  hasValidUsage,
  estimateUsage,
  logUsage,
  addBufferToUsage,
  filterUsageForFormat,
  COLORS,
} from "./usageTracking.ts";


id: import:a360534a3725d92b6928c237942c5a33
kind: import
name: ./streamHelpers.ts
qualified_name: ./streamHelpers.ts
file_path: open-sse/utils/stream.ts
language: typescript
signature:
import {
  parseSSELine,
  hasValuableContent,
  fixInvalidId,
  formatSSE,
  unwrapGeminiChunk,
} from "./streamHelpers.ts";


id: import:81de14e6f3430e573d0f34e855288839
kind: import
name: ./streamPayloadCollector.ts
qualified_name: ./streamPayloadCollector.ts
file_path: open-sse/utils/stream.ts
language: typescript
signature:
import {
  createStructuredSSECollector,
  buildStreamSummaryFromEvents,
} from "./streamPayloadCollector.ts";


id: import:a739ab44227f6e5e89e55e79d0c45133
kind: import
name: ../config/constants.ts
qualified_name: ../config/constants.ts
file_path: open-sse/utils/stream.ts
language: typescript
signature:
import { STREAM_IDLE_TIMEOUT_MS, FETCH_BODY_TIMEOUT_MS, HTTP_STATUS } from "../config/constants.ts";


id: import:abd3d40049976945bfd869a068f889f7
kind: import
name: ../handlers/responseSanitizer.ts
qualified_name: ../handlers/responseSanitizer.ts
file_path: open-sse/utils/stream.ts
language: typescript
signature:
import {
  sanitizeStreamingChunk,
  extractThinkingFromContent,
} from "../handlers/responseSanitizer.ts";


id: function:efc2c1e317225e8bea8273e32f4a33e7
kind: function
name: buildSyntheticClaudeEmptyResponseEvents
qualified_name: buildSyntheticClaudeEmptyResponseEvents
file_path: open-sse/utils/stream.ts
language: typescript
signature:
(
  lifecycle: ClaudeEmptyResponseLifecycle,
  model: string | null,
  options: {
    includeContentBlock?: boolean;
    includeMessageDelta?: boolean;
    includeMessageStop?: boolean;
  } = {}
): JsonRecord[]


id: constant:cd10b674ecbe368a1e0cd12e1545cc75
kind: constant
name: STREAM_MODE
qualified_name: STREAM_MODE
file_path: open-sse/utils/stream.ts
language: typescript
docstring:
Note: TextDecoder/TextEncoder are created per-stream inside createSSEStream()
to avoid shared state issues with concurrent streams (TextDecoder with {stream:true}
maintains internal buffering state between decode() calls).
Stream modes

signature:
= {
  TRANSLATE: "translate", // Full translation between formats
  PASSTHROUGH: "passthrough", // No ...


id: constant:52cecec9426d5d5856bb4d111a9a9fea
kind: constant
name: RESPONSES_LIFECYCLE_EVENT_TYPES
qualified_name: RESPONSES_LIFECYCLE_EVENT_TYPES
file_path: open-sse/utils/stream.ts
language: typescript
signature: = new Set([ "response.created", "response.in_progress", "response.completed", ])
docstring:
Lifecycle event types in OpenAI Responses API streams whose `response`
payload is a snapshot of the request (echoes back `instructions` + `tools`).


id: function:a77eddb7996953e2a9905803f7864529
kind: function
name: createSSETransformStreamWithLogger
qualified_name: createSSETransformStreamWithLogger
file_path: open-sse/utils/stream.ts
language: typescript
signature:
(
  targetFormat: string,
  sourceFormat: string,
  provider: string | null = null,
  reqLogger: StreamLogger | null = null,
  toolNameMap: unknown = null,
  model: string | null = null,
  connectionId: string | null = null,
  body: unknown = null,
  onComplete: ((payload: StreamCompletePayload) => void) | null = null,
  apiKeyInfo: unknown = null,
  onFailure: ((payload: StreamFailurePayload) => void | Promise<void>) | null = null,
  copilotCompatibleReasoning = false
)


id: function:fe023f13f9ca740914cae3b2c9334a12
kind: function
name: createPassthroughStreamWithLogger
qualified_name: createPassthroughStreamWithLogger
file_path: open-sse/utils/stream.ts
language: typescript
signature:
(
  provider: string | null = null,
  reqLogger: StreamLogger | null = null,
  toolNameMap: unknown = null,
  model: string | null = null,
  connectionId: string | null = null,
  body: unknown = null,
  onComplete: ((payload: StreamCompletePayload) => void) | null = null,
  apiKeyInfo: unknown = null,
  onFailure: ((payload: StreamFailurePayload) => void | Promise<void>) | null = null,
  clientResponseFormat: string | null = null
)


id: function:9889b611e7020e17304eb95db2ef2174
kind: function
name: encodeSseEvent
qualified_name: encodeSseEvent
file_path: open-sse/utils/streamHandler.ts
language: typescript
signature:
(
  data: unknown,
  {
    event,
    includeDone = false,
  }: {
    event?: string;
    includeDone?: boolean;
  } = {}
)


id: function:604f5989bef04507e62414f7cfb28ff5
kind: function
name: createStreamController
qualified_name: createStreamController
file_path: open-sse/utils/streamHandler.ts
language: typescript
signature:
({
  onDisconnect,
  provider,
  model,
  connectionId,
  clientResponseFormat,
}: StreamControllerOptions = {})


id: function:526b9ca35f5a60e284dd716eb277005c
kind: function
name: pipeWithDisconnect
qualified_name: pipeWithDisconnect
file_path: open-sse/utils/streamHandler.ts
language: typescript
signature:
(
  providerResponse: Response,
  transformStream: TransformStream<Uint8Array, Uint8Array>,
  streamController: StreamController
)


id: function:c37dc60255b2205c0f5d3887102c677e
kind: function
name: buildStreamSummaryFromEvents
qualified_name: buildStreamSummaryFromEvents
file_path: open-sse/utils/streamPayloadCollector.ts
language: typescript
signature:
(
  events: StructuredSSEEvent[],
  fallbackFormat?: string | null,
  fallbackModel?: string | null
): unknown


id: function:21a1df46269adcb2febfa3158c29b042
kind: function
name: prependBufferedChunks
qualified_name: prependBufferedChunks
file_path: open-sse/utils/streamReadiness.ts
language: typescript
signature:
(
  chunks: Uint8Array[],
  reader: ReadableStreamDefaultReader<Uint8Array>
): ReadableStream<Uint8Array>


id: function:1bbee210a64df4d9db7a763f94a1ace3
kind: function
name: ensureStreamReadiness
qualified_name: ensureStreamReadiness
file_path: open-sse/utils/streamReadiness.ts
language: typescript
signature:
(
  response: Response,
  options: {
    timeoutMs: number;
    provider?: string | null;
    model?: string | null;
    log?: StreamReadinessLogger | null;
  }
): Promise<StreamReadinessResult>


id: constant:9c0126f0048b33d89923eda1069cee21
kind: constant
name: THINK_OPEN
qualified_name: THINK_OPEN
file_path: open-sse/utils/thinkTagParser.ts
language: typescript
signature: = "<think>"
docstring:
Think Tag Parser
Parses <think>...</think> tags from LLM output and converts them
to a structured `reasoning_content` field.
Used by providers like DeepSeek, Qwen, and Qoder that embed
chain-of-thought reasoning inside <think> tags.
Usage:
  import { extractThinkTags, hasThinkTags } from "./thinkTagParser.ts";
  const { reasoning, content } = extractThinkTags(rawOutput);
  // reasoning = "step-by-step thinking..."
  // content = "final answer..."


id: class:23bccf9902b64911c25b539de6513e3b
kind: class
name: TlsClient
qualified_name: TlsClient
file_path: open-sse/utils/tlsClient.ts
language: typescript
docstring:
TLS Client — Chrome 124 TLS fingerprint spoofing via wreq-js
Singleton instance used to disguise Node.js TLS handshake as Chrome browser.
wreq-js natively supports proxy — TLS fingerprinting works through proxy.
Proxy URL is read from environment variables (HTTPS_PROXY, HTTP_PROXY, ALL_PROXY).


id: method:21722a2ff976c2e481adac038c6bfc45
kind: method
name: fetch
qualified_name: TlsClient::fetch
file_path: open-sse/utils/tlsClient.ts
language: typescript
signature: (url: string, options: FetchOptions = {})
docstring:
Fetch with Chrome 124 TLS fingerprint.
wreq-js Response is already fetch-compatible (headers, text(), json(), clone(), body).


id: constant:41549b1c6c5e93c63da1733a1f9fd95c
kind: constant
name: STRIP_HEADER_NAMES
qualified_name: STRIP_HEADER_NAMES
file_path: open-sse/utils/upstreamResponseHeaders.ts
language: typescript
signature: = new Set([ "content-encoding", "content-length", "transfer-encoding", ])
docstring:
Header-strip helper for upstream provider responses.
`fetch()` always decompresses the upstream body before exposing it via
`.text()` or the stream reader, so forwarding the upstream `content-encoding`
to the downstream client (e.g. `gzip`) makes the client attempt to gunzip
plain text and fail with `ZlibError: incorrect header check`.
Similarly, `content-length` becomes stale once we transform or repack the
response stream, and `transfer-encoding` is managed by the runtime
(Next.js / Node), not us.


id: function:2237c931d1a210da41dcdcb73217b0e4
kind: function
name: filterUpstreamResponseHeaderEntries
qualified_name: filterUpstreamResponseHeaderEntries
file_path: open-sse/utils/upstreamResponseHeaders.ts
language: typescript
signature:
(
  entries: Iterable<[string, string]>,
  extraToStrip: ReadonlyArray<string> = []
): Array<[string, string]>


id: import:c33709fe8ef0c44aa842ec922630df34
kind: import
name: @/lib/usage/tokenAccounting
qualified_name: @/lib/usage/tokenAccounting
file_path: open-sse/utils/usageTracking.ts
language: typescript
signature:
import {
  getLoggedInputTokens,
  getLoggedOutputTokens,
  getPromptCacheCreationTokens,
  getPromptCacheReadTokens,
} from "@/lib/usage/tokenAccounting";


id: constant:57b980e24e31121f620e08816a09ad0b
kind: constant
name: COLORS
qualified_name: COLORS
file_path: open-sse/utils/usageTracking.ts
language: typescript
signature:
= {
  reset: "\x1b[0m",
  red: "\x1b[31m",
  green: "\x1b[32m",
  yellow: "\x1b[33m",
  blue: "\x1b[34...


id: constant:a96df5e30ee48156493cb4b191439bd5
kind: constant
name: DEFAULT_BUFFER_TOKENS
qualified_name: DEFAULT_BUFFER_TOKENS
file_path: open-sse/utils/usageTracking.ts
language: typescript
signature: = 2000
docstring:
Safety buffer added to reported token usage to prevent clients from hitting
context window limits. Accounts for overhead from system prompts,
tool definitions, and format translation that may not be reflected in raw usage.
Configurable via:
  - Settings API / Dashboard: `usageTokenBuffer` (persisted in DB)
  - Environment variable: `USAGE_TOKEN_BUFFER`
  - Defaults to 2000 if neither is set
Set to 0 to disable the buffer entirely (raw provider token counts).


id: function:94c3f2a012e374ad83fd955c4195fca0
kind: function
name: estimateTokenCount
qualified_name: estimateTokenCount
file_path: open-sse/utils/usageTracking.ts
language: typescript
signature: (text)
docstring:
~6 chars/token for JSON schemas (more verbose per token)
Improved token estimation heuristic (no dependency).
Splits text on common token boundaries (whitespace, punctuation, camelCase)
and applies a sub-word correction factor. Better accuracy for:
- English text (~4 chars/token)
- CJK text (~1 char/token for ideographs)
- Code (~3.5 chars/token, more punctuation-heavy)
@param {string} text - Text to estimate tokens for
@returns {number} Estimated token count


id: function:3eed31dbef06de1a48f374c9fbf6c294
kind: function
name: logUsage
qualified_name: logUsage
file_path: open-sse/utils/usageTracking.ts
language: typescript
signature:
(
  provider,
  usage,
  model: string | null = null,
  connectionId: string | null = null,
  apiKeyInfo = null
)


id: import:35870abaa081f319674f8d3d3edaffb4
kind: import
name: ../../src/shared/utils/nodeRuntimeSupport.ts
qualified_name: ../../src/shared/utils/nodeRuntimeSupport.ts
file_path: scripts/check/check-supported-node-runtime.ts
language: typescript
signature:
import {
  getNodeRuntimeSupport,
  getNodeRuntimeWarning,
} from "../../src/shared/utils/nodeRuntimeSupport.ts";


id: import:88b03d8d3022f7eacd38db924872c84d
kind: import
name: ../../src/shared/constants/providers.ts
qualified_name: ../../src/shared/constants/providers.ts
file_path: scripts/docs/gen-provider-reference.ts
language: typescript
signature:
import {
  FREE_PROVIDERS,
  OAUTH_PROVIDERS,
  WEB_COOKIE_PROVIDERS,
  APIKEY_PROVIDERS,
  LOCAL_PROVIDERS,
  SEARCH_PROVIDERS,
  AUDIO_ONLY_PROVIDERS,
  UPSTREAM_PROXY_PROVIDERS,
  CLOUD_AGENT_PROVIDERS,
  SYSTEM_PROVIDERS,
  IMAGE_ONLY_PROVIDER_IDS,
  AGGREGATOR_PROVIDER_IDS,
  ENTERPRISE_CLOUD_PROVIDER_IDS,
  VIDEO_PROVIDER_IDS,
  EMBEDDING_RERANK_PROVIDER_IDS,
  SELF_HOSTED_CHAT_PROVIDER_IDS,
} from "../../src/shared/constants/providers.ts";


id: constant:58969140fff15658a7e37fb455f5b96c
kind: constant
name: docs
qualified_name: docs
file_path: source.config.ts
language: typescript
signature:
= defineDocs({
  dir: "docs",
  docs: {
    files: [
      "./architecture/**/*.md",
      "./guides/*...


id: function:8fd273ae405650bbf69aafe257c849de
kind: function
name: ProviderOverviewCard
qualified_name: ProviderOverviewCard
file_path: src/app/(dashboard)/dashboard/HomePageClient.tsx
language: tsx
signature:
({
  item,
  metrics,
  onClick,
}: {
  item: ProviderSummaryItem;
  metrics?: ProviderMetricSummary;
  onClick: () => void;
})


id: function:8bf2462f3a305ee2e3c8613824b339d0
kind: function
name: ProviderModelsModal
qualified_name: ProviderModelsModal
file_path: src/app/(dashboard)/dashboard/HomePageClient.tsx
language: tsx
signature:
({
  provider,
  models,
  onClose,
}: {
  provider: ProviderSummaryItem;
  models: ProviderModelSummary[];
  onClose: () => void;
})


id: function:d99ab5506dd51c5ba50c7b07a112023b
kind: function
name: ServiceToggle
qualified_name: ServiceToggle
file_path: src/app/(dashboard)/dashboard/a2a/page.tsx
language: tsx
signature:
({
  label,
  status,
  enabled,
  onToggle,
  toggling,
}: {
  label: string;
  status: ServiceStatus;
  enabled: boolean;
  onToggle: () => void;
  toggling: boolean;
})


id: import:c790cd6866de5d9141de3dacf20252ec
kind: import
name: @/shared/constants/agentSkills
qualified_name: @/shared/constants/agentSkills
file_path: src/app/(dashboard)/dashboard/agent-skills/page.tsx
language: tsx
signature:
import {
  AGENT_SKILLS,
  AGENT_SKILLS_REPO_URL,
  getAgentSkillRawUrl,
  getAgentSkillBlobUrl,
  type AgentSkill,
} from "@/shared/constants/agentSkills";


id: function:1103d1f2a57e034c2e7ee8606d3ad3b2
kind: function
name: SkillSection
qualified_name: SkillSection
file_path: src/app/(dashboard)/dashboard/agent-skills/page.tsx
language: tsx
signature:
({
  title,
  subtitle,
  icon,
  skills,
}: {
  title: string;
  subtitle: string;
  icon: string;
  skills: AgentSkill[];
})


id: constant:b543ca88f8eb37209b7d143a2e7ea99b
kind: constant
name: AGENT_ICON_MAP
qualified_name: AGENT_ICON_MAP
file_path: src/app/(dashboard)/dashboard/agents/page.tsx
language: tsx
docstring: Map agent binary IDs to provider icon IDs for ProviderIcon component
signature:
= {
  claude: "anthropic",
  "claude-code": "anthropic",
  codex: "openai",
  "gemini-cli": "google",
...


id: import:c512170a564906327c1917492926f569
kind: import
name: @/shared/types/utilization
qualified_name: @/shared/types/utilization
file_path: src/app/(dashboard)/dashboard/analytics/ComboHealthTab.tsx
language: tsx
signature:
import type {
  ComboHealthMetrics,
  ComboHealthResponse,
  UtilizationTimeRange,
} from "@/shared/types/utilization";


id: function:883024d6fda951b3661a24e2714abf45
kind: function
name: MetricBlock
qualified_name: MetricBlock
file_path: src/app/(dashboard)/dashboard/analytics/ComboHealthTab.tsx
language: tsx
signature:
({
  icon,
  label,
  value,
  subValue,
}: {
  icon: string;
  label: string;
  value: string;
  subValue?: string;
})


id: function:e4ef5a4bd560edc136cf433b08e5b771
kind: function
name: StatCard
qualified_name: StatCard
file_path: src/app/(dashboard)/dashboard/analytics/CompressionAnalyticsTab.tsx
language: tsx
signature:
({
  icon,
  label,
  value,
  sub,
}: {
  icon: string;
  label: string;
  value: string | number;
  sub?: string;
})


id: function:6ca6b4d6d78c6a7a84d856e06ba91560
kind: function
name: ModeBar
qualified_name: ModeBar
file_path: src/app/(dashboard)/dashboard/analytics/CompressionAnalyticsTab.tsx
language: tsx
signature:
({
  mode,
  count,
  total,
  tokensSaved,
}: {
  mode: string;
  count: number;
  total: number;
  tokensSaved: number;
})


id: function:5e751873725e1aa7ec9a2fce9fc15fc5
kind: function
name: ProviderBar
qualified_name: ProviderBar
file_path: src/app/(dashboard)/dashboard/analytics/CompressionAnalyticsTab.tsx
language: tsx
signature:
({
  provider,
  count,
  total,
  tokensSaved,
}: {
  provider: string;
  count: number;
  total: number;
  tokensSaved: number;
})


id: import:56667e9b11f09aee0e7a77c17c1230ec
kind: import
name: recharts
qualified_name: recharts
file_path: src/app/(dashboard)/dashboard/analytics/ProviderUtilizationTab.tsx
language: tsx
signature:
import {
  CartesianGrid,
  Legend,
  Line,
  LineChart,
  ResponsiveContainer,
  Tooltip,
  XAxis,
  YAxis,
} from "recharts";


id: import:1058c5fea91b193a32bf3b55e8f03f97
kind: import
name: @/shared/types/utilization
qualified_name: @/shared/types/utilization
file_path: src/app/(dashboard)/dashboard/analytics/ProviderUtilizationTab.tsx
language: tsx
signature:
import type {
  ProviderUtilizationPoint,
  ProviderUtilizationResponse,
  UtilizationTimeRange,
} from "@/shared/types/utilization";


id: constant:b0dbbbf3acdb30f63abd2f57d6955667
kind: constant
name: RANGE_LABELS
qualified_name: RANGE_LABELS
file_path: src/app/(dashboard)/dashboard/analytics/ProviderUtilizationTab.tsx
language: tsx
signature:
= {
  "1h": "Last hour",
  "24h": "Last 24 hours",
  "7d": "Last 7 days",
  "30d": "Last 30 days",
}


id: constant:7fa662cccb79121f8f46a976c5119ac6
kind: constant
name: PROVIDER_COLORS
qualified_name: PROVIDER_COLORS
file_path: src/app/(dashboard)/dashboard/analytics/ProviderUtilizationTab.tsx
language: tsx
signature:
= [
  "var(--color-primary)",
  "var(--color-accent)",
  "var(--color-success)",
  "var(--color-warnin...


id: function:920d0b87b9b201e4c41f6b1147b62c55
kind: function
name: ProviderBar
qualified_name: ProviderBar
file_path: src/app/(dashboard)/dashboard/analytics/SearchAnalyticsTab.tsx
language: tsx
signature:
({
  provider,
  count,
  total,
  costUsd,
}: {
  provider: string;
  count: number;
  total: number;
  costUsd: number;
})


id: function:a1758a686f1ea24c3e9cceb7b00b5a6a
kind: function
name: validateKeyName
qualified_name: validateKeyName
file_path: src/app/(dashboard)/dashboard/api-manager/ApiManagerPageClient.tsx
language: tsx
docstring: Validate key name
signature:
(
  name: string,
  t: (key: string, values?: Record<string, unknown>) => string
): { valid: boolean; error?: string }


id: constant:04f2bc3b2272e7473b5d2de2e4e80a1e
kind: constant
name: PermissionsModal
qualified_name: PermissionsModal
file_path: src/app/(dashboard)/dashboard/api-manager/ApiManagerPageClient.tsx
language: tsx
docstring:
-- Permissions Modal Component (Memoized for Performance) ------------------------------------------

signature:
= memo(function PermissionsModal({
  isOpen,
  onClose,
  apiKey,
  modelsByProvider,
  allModels,
  a...


id: constant:779c261a56fc8e443615d85925daeafe
kind: constant
name: STATE_STYLES
qualified_name: STATE_STYLES
file_path: src/app/(dashboard)/dashboard/audit/A2aAuditTab.tsx
language: tsx
signature:
= {
  submitted: "border-amber-500/30 bg-amber-500/10 text-amber-600",
  working: "border-blue-500/30 ...


id: constant:0d67a591087a4f193039bafb23dda274
kind: constant
name: STATUS_STYLES
qualified_name: STATUS_STYLES
file_path: src/app/(dashboard)/dashboard/batch/BatchDetailModal.tsx
language: tsx
signature:
= {
  completed: "bg-emerald-500/15 text-emerald-400 border-emerald-500/25",
  completed_with_failures...


id: constant:04e463640487fba82c549239eb61f0a6
kind: constant
name: STATUS_LABELS
qualified_name: STATUS_LABELS
file_path: src/app/(dashboard)/dashboard/batch/BatchDetailModal.tsx
language: tsx
signature:
= {
  completed_with_failures: "completed with failures",
  in_progress_with_failures: "in progress (w...


id: constant:7cf006db935a299aaf06c6a41d783aae
kind: constant
name: ALL_STATUSES
qualified_name: ALL_STATUSES
file_path: src/app/(dashboard)/dashboard/batch/BatchListTab.tsx
language: tsx
signature:
= [
  "all",
  "in_progress",
  "validating",
  "finalizing",
  "completed",
  "failed",
  "cancelled"...


id: constant:420084918709c39604002174426d6d28
kind: constant
name: PURPOSE_STYLES_MAP
qualified_name: PURPOSE_STYLES_MAP
file_path: src/app/(dashboard)/dashboard/batch/FilesListTab.tsx
language: tsx
signature:
= {
  batch: "bg-blue-500/15 text-blue-400 border-blue-500/25",
  "batch-output": "bg-emerald-500/15 t...


id: constant:5fa729eec1b392505876de83b6695b65
kind: constant
name: sampleTrendData
qualified_name: sampleTrendData
file_path: src/app/(dashboard)/dashboard/cache/__tests__/CacheTrends.test.tsx
language: tsx
signature:
= [
  { timestamp: "2026-04-01T00:00:00Z", requests: 120, hits: 100, misses: 20, hitRate: 83.3 },
  { ...


id: function:b309560d7bb612b7253af4276e8a26ad
kind: function
name: CachePerformance
qualified_name: CachePerformance
file_path: src/app/(dashboard)/dashboard/cache/components/CachePerformance.tsx
language: tsx
signature:
({
  hits = 0,
  misses = 0,
  hitRate,
  avgLatencyMs,
  p95LatencyMs,
  totalRequests = 0,
  loading = false,
  error = null,
  onRetry,
  stats,
}: CachePerformanceProps)


id: function:c216f0ed4b81e8edf7ec0638bbd157ea
kind: function
name: IdempotencyLayer
qualified_name: IdempotencyLayer
file_path: src/app/(dashboard)/dashboard/cache/components/IdempotencyLayer.tsx
language: tsx
signature:
({
  activeKeys,
  windowMs,
  deduplicatedRequests,
  totalProcessed,
  savedCalls,
  stats,
  loading = false,
  error = null,
  onRetry,
}: IdempotencyLayerProps)


id: function:a1c2537cf366fed29f421a2ea706bfa7
kind: function
name: StatCard
qualified_name: StatCard
file_path: src/app/(dashboard)/dashboard/cache/components/MemoryCards.tsx
language: tsx
docstring: ─── Internal StatCard ────────────────────────────────────────────────────────
signature:
({
  icon,
  label,
  value,
  sub,
  valueClass = "text-text",
}: {
  icon: string;
  label: string;
  value: string | number;
  sub?: string;
  valueClass?: string;
})


id: function:28970e309e7397a57fb7753a17d8f701
kind: function
name: MemoryCards
qualified_name: MemoryCards
file_path: src/app/(dashboard)/dashboard/cache/components/MemoryCards.tsx
language: tsx
signature:
({
  memoryEntries = 0,
  dbEntries = 0,
  hits = 0,
  misses: _misses = 0,
  hitRate,
  tokensSaved = 0,
  loading = false,
  error = null,
  onRetry,
}: MemoryCardsProps)


id: function:d8ee2a458e63efac9e2731368c19c79e
kind: function
name: StatCard
qualified_name: StatCard
file_path: src/app/(dashboard)/dashboard/cache/components/ReasoningCacheTab.tsx
language: tsx
docstring: ──────────────── Sub-Components ────────────────
signature:
({
  icon,
  label,
  value,
  sub,
  accent = "text-text-main",
}: {
  icon: string;
  label: string;
  value: string | number;
  sub?: string;
  accent?: string;
})


id: function:e2c7e284c631a43a2a49acef778eb612
kind: function
name: SectionBadge
qualified_name: SectionBadge
file_path: src/app/(dashboard)/dashboard/cache/components/ReasoningCacheTab.tsx
language: tsx
signature:
({
  icon,
  children,
  tone = "neutral",
}: {
  icon: string;
  children: React.ReactNode;
  tone?: "neutral" | "green" | "amber" | "blue";
})


id: import:96ec6567b0dec3b2692ab92947de87ea
kind: import
name: @omniroute/open-sse/config/audioRegistry.ts
qualified_name: @omniroute/open-sse/config/audioRegistry.ts
file_path: src/app/(dashboard)/dashboard/cache/media/MediaPageClient.tsx
language: tsx
signature:
import {
  AUDIO_SPEECH_PROVIDERS,
  AUDIO_TRANSCRIPTION_PROVIDERS,
} from "@omniroute/open-sse/config/audioRegistry.ts";


id: constant:199d8a0b8115176795a76289564e69eb
kind: constant
name: MODALITY_CONFIG
qualified_name: MODALITY_CONFIG
file_path: src/app/(dashboard)/dashboard/cache/media/MediaPageClient.tsx
language: tsx
signature:
= {
  image: {
    icon: "image",
    endpoint: "/api/v1/images/generations",
    label: "Image Genera...


id: constant:1e705b12c9fc8677089660a9dc7e5be8
kind: constant
name: PROVIDER_MODELS
qualified_name: PROVIDER_MODELS
file_path: src/app/(dashboard)/dashboard/cache/media/MediaPageClient.tsx
language: tsx
docstring: Provider+model registry derived from runtime registries to avoid dashboard drift
signature:
= {
  image: IMAGE_PROVIDER_MODELS,
  video: VIDEO_PROVIDER_MODELS,
  music: MUSIC_PROVIDER_MODELS,
  ...


id: constant:577c10c841c4ebad257b0d005da372f6
kind: constant
name: VOICE_PRESETS
qualified_name: VOICE_PRESETS
file_path: src/app/(dashboard)/dashboard/cache/media/MediaPageClient.tsx
language: tsx
docstring: Voice presets per TTS provider
signature:
= {
  default: [
    { id: "alloy", label: "Alloy" },
    { id: "echo", label: "Echo" },
    { id: "fa...


id: function:83ff8e98aafdd50be1e549e33810b0c9
kind: function
name: StatCard
qualified_name: StatCard
file_path: src/app/(dashboard)/dashboard/cache/page.tsx
language: tsx
signature:
({
  icon,
  label,
  value,
  sub,
  accent = "text-text-main",
  size = "default",
}: {
  icon: string;
  label: string;
  value: string | number;
  sub?: string;
  accent?: string;
  size?: "default" | "hero";
})


id: function:962bfacebb0c248517df32d71543fe83
kind: function
name: SectionBadge
qualified_name: SectionBadge
file_path: src/app/(dashboard)/dashboard/cache/page.tsx
language: tsx
signature:
({
  icon,
  children,
  tone = "neutral",
}: {
  icon: string;
  children: ReactNode;
  tone?: "neutral" | "green" | "amber";
})


id: function:8b3f28a2e1c5b154bc58d451d7a37e88
kind: function
name: LinearMeter
qualified_name: LinearMeter
file_path: src/app/(dashboard)/dashboard/cache/page.tsx
language: tsx
signature:
({
  label,
  value,
  tone = "green",
  helper,
}: {
  label: string;
  value: number;
  tone?: "green" | "blue" | "amber";
  helper?: string;
})


id: function:aacf650f9130c10cf8670302d22d096e
kind: function
name: DetailStat
qualified_name: DetailStat
file_path: src/app/(dashboard)/dashboard/cache/page.tsx
language: tsx
signature:
({
  label,
  value,
  accent = "text-text-main",
}: {
  label: string;
  value: string;
  accent?: string;
})


id: function:963e9048e9cac519b29e6172e1cb8d9a
kind: function
name: PromptTrendPanel
qualified_name: PromptTrendPanel
file_path: src/app/(dashboard)/dashboard/cache/page.tsx
language: tsx
signature:
({
  trend,
  title,
  description,
  busiestHourLabel,
  peakCacheRateLabel,
  cachedRequestsLabel,
  hoursTrackedLabel,
  hourLabel,
  activityLabel,
  requestsLabel,
  cacheRateLabel,
  cachedTokensLabel,
  noDataLabel,
}: {
  trend: CacheTrendPoint[];
  title: string;
  description: string;
  busiestHourLabel: string;
  peakCacheRateLabel: string;
  cachedRequestsLabel: string;
  hoursTrackedLabel: string;
  hourLabel: string;
  activityLabel: string;
  requestsLabel: string;
  cacheRateLabel: string;
  cachedTokensLabel: string;
  noDataLabel: string;
})


id: import:0e4104c1256edfe7e1e4c7d59938248e
kind: import
name: @/shared/utils/releaseNotes
qualified_name: @/shared/utils/releaseNotes
file_path: src/app/(dashboard)/dashboard/changelog/components/ChangelogViewer.tsx
language: tsx
signature:
import {
  CHANGELOG_GITHUB_URL,
  CHANGELOG_RAW_URL,
  getLatestChangelogMarkdown,
} from "@/shared/utils/releaseNotes";


id: constant:c41a50daf44657154e643fe12f2fb826
kind: constant
name: markdownComponents
qualified_name: markdownComponents
file_path: src/app/(dashboard)/dashboard/changelog/components/ChangelogViewer.tsx
language: tsx
signature:
= {
  h1({ children }) {
    return <h1 className="mb-6 text-2xl font-bold text-text-main">{children}<...


id: import:f5ffd75e0310516839d44d11cf8b32ad
kind: import
name: @/shared/utils/releaseNotes
qualified_name: @/shared/utils/releaseNotes
file_path: src/app/(dashboard)/dashboard/changelog/components/NewsViewer.tsx
language: tsx
signature:
import {
  NEWS_JSON_URL,
  parseActiveNewsPayload,
  type NewsAnnouncement,
} from "@/shared/utils/releaseNotes";


id: import:67af805cb414db82448871f3f41a27ca
kind: import
name: @/shared/constants/models
qualified_name: @/shared/constants/models
file_path: src/app/(dashboard)/dashboard/cli-tools/CLIToolsPageClient.tsx
language: tsx
signature:
import {
  PROVIDER_MODELS,
  getModelsByProviderId,
  PROVIDER_ID_TO_ALIAS,
} from "@/shared/constants/models";


id: import:e90f7d65c6c168eb164d356e0a85b54e
kind: import
name: ./components
qualified_name: ./components
file_path: src/app/(dashboard)/dashboard/cli-tools/CLIToolsPageClient.tsx
language: tsx
signature:
import {
  ClaudeToolCard,
  CodexToolCard,
  DroidToolCard,
  OpenClawToolCard,
  ClineToolCard,
  KiloToolCard,
  DefaultToolCard,
  AntigravityToolCard,
  CopilotToolCard,
  CustomCliCard,
  HermesAgentToolCard,
} from "./components";


id: constant:354c930be5f4ffedc24a6cf2539a6d13
kind: constant
name: AUTO_CONFIGURED_TOOL_IDS
qualified_name: AUTO_CONFIGURED_TOOL_IDS
file_path: src/app/(dashboard)/dashboard/cli-tools/CLIToolsPageClient.tsx
language: tsx
signature:
= new Set([
  "claude",
  "codex",
  "droid",
  "openclaw",
  "cline",
  "kilo",
  "copilot",
  "herme...


id: function:42c120659f4e02d601fbed446273779c
kind: function
name: AntigravityToolCard
qualified_name: AntigravityToolCard
file_path: src/app/(dashboard)/dashboard/cli-tools/components/AntigravityToolCard.tsx
language: tsx
signature:
({
  tool,
  isExpanded,
  onToggle,
  baseUrl,
  apiKeys,
  activeProviders,
  hasActiveProviders,
  cloudEnabled,
})


id: import:f154cd06e3766eca323cfaf58e41f706
kind: import
name: @/shared/services/claudeCliConfig
qualified_name: @/shared/services/claudeCliConfig
file_path: src/app/(dashboard)/dashboard/cli-tools/components/ClaudeToolCard.tsx
language: tsx
signature:
import {
  getStoredClaudeAuthValue,
  normalizeClaudeBaseUrl,
} from "@/shared/services/claudeCliConfig";


id: function:60399967a22e1f0167c8ef8b21a65804
kind: function
name: ClaudeToolCard
qualified_name: ClaudeToolCard
file_path: src/app/(dashboard)/dashboard/cli-tools/components/ClaudeToolCard.tsx
language: tsx
signature:
({
  tool,
  isExpanded,
  onToggle,
  activeProviders,
  modelMappings,
  onModelMappingChange,
  baseUrl,
  hasActiveProviders,
  apiKeys,
  cloudEnabled,
  batchStatus,
  lastConfiguredAt,
})


id: function:c2a145da2c4f59dc3a49a75e54b7379f
kind: function
name: formatRelativeTime
qualified_name: formatRelativeTime
file_path: src/app/(dashboard)/dashboard/cli-tools/components/CliStatusBadge.tsx
language: tsx
signature: ( isoDate: string, t: (key: string, values?: Record<string, unknown>) => string ): string
docstring:
Shared status badge for CLI tool cards.
Shows the effective config/installation status using batch data,
so badges are visible even when cards are collapsed.
Optionally shows last-configured relative timestamp.


id: function:763046f342ea7bee24ef235893c9cb28
kind: function
name: ClineToolCard
qualified_name: ClineToolCard
file_path: src/app/(dashboard)/dashboard/cli-tools/components/ClineToolCard.tsx
language: tsx
signature:
({
  tool,
  isExpanded,
  onToggle,
  baseUrl,
  hasActiveProviders,
  apiKeys,
  activeProviders,
  cloudEnabled,
  batchStatus,
  lastConfiguredAt,
})


id: function:5343bcb4479586742268e18cbc9471c2
kind: function
name: CodexToolCard
qualified_name: CodexToolCard
file_path: src/app/(dashboard)/dashboard/cli-tools/components/CodexToolCard.tsx
language: tsx
signature:
({
  tool,
  isExpanded,
  onToggle,
  baseUrl,
  apiKeys,
  activeProviders,
  cloudEnabled,
  batchStatus,
  lastConfiguredAt,
})


id: function:50df1860cb06b562fa22b79e663108ab
kind: function
name: CopilotToolCard
qualified_name: CopilotToolCard
file_path: src/app/(dashboard)/dashboard/cli-tools/components/CopilotToolCard.tsx
language: tsx
signature:
({
  tool,
  isExpanded,
  onToggle,
  baseUrl,
  apiKeys,
  activeProviders = [],
  hasActiveProviders = false,
  cloudEnabled = false,
  batchStatus,
})


id: import:d48a8c771997ffd8a34da4825e1d2c28
kind: import
name: ./customCliConfig
qualified_name: ./customCliConfig
file_path: src/app/(dashboard)/dashboard/cli-tools/components/CustomCliCard.tsx
language: tsx
signature:
import {
  buildCustomCliEnvScript,
  buildCustomCliJsonConfig,
  normalizeOpenAiBaseUrl,
} from "./customCliConfig";


id: function:025103c3683518289bc7a85888bce5a5
kind: function
name: CustomCliCard
qualified_name: CustomCliCard
file_path: src/app/(dashboard)/dashboard/cli-tools/components/CustomCliCard.tsx
language: tsx
signature:
({
  tool,
  isExpanded,
  onToggle,
  baseUrl,
  apiKeys,
  availableModels = [],
  cloudEnabled = false,
  hasActiveProviders = false,
})


id: function:02b7a69e1d68259aada110b94b0fff80
kind: function
name: DefaultToolCard
qualified_name: DefaultToolCard
file_path: src/app/(dashboard)/dashboard/cli-tools/components/DefaultToolCard.tsx
language: tsx
signature:
({
  toolId,
  tool,
  isExpanded,
  onToggle,
  baseUrl,
  apiKeys,
  activeProviders = [],
  cloudEnabled = false,
  batchStatus,
})


id: constant:1fb8909e3c17821739c1e593ce0d8e97
kind: constant
name: HERMES_ROLES
qualified_name: HERMES_ROLES
file_path: src/app/(dashboard)/dashboard/cli-tools/components/HermesAgentToolCard.tsx
language: tsx
signature:
= [
  { id: "default", label: "Default (main)", description: "Primary conversation model" },
  {
    i...


id: function:c8340c1e7e3dbee87cbd3289c597a712
kind: function
name: HermesAgentToolCard
qualified_name: HermesAgentToolCard
file_path: src/app/(dashboard)/dashboard/cli-tools/components/HermesAgentToolCard.tsx
language: tsx
signature:
({
  tool,
  isExpanded,
  onToggle,
  baseUrl,
  apiKeys,
  activeProviders = [],
  hasActiveProviders,
  cloudEnabled,
  batchStatus,
}: any)


id: function:2e00055f92fc082f2da9a107d76255d1
kind: function
name: buildCustomCliEnvScript
qualified_name: buildCustomCliEnvScript
file_path: src/app/(dashboard)/dashboard/cli-tools/components/customCliConfig.ts
language: typescript
signature:
({
  cliName,
  baseUrl,
  apiKey,
  defaultModel = "",
  aliasMappings = [],
}: CustomCliConfigInput): string


id: constant:90c48e5a74b70efb5f752c2b81fc7e53
kind: constant
name: CLOUD_AGENTS
qualified_name: CLOUD_AGENTS
file_path: src/app/(dashboard)/dashboard/cloud-agents/page.tsx
language: tsx
docstring: ── Constants ────────────────────────────────────────────────────────────────
signature:
= [
  {
    id: "jules",
    name: "Jules",
    provider: "Google",
    description: "Google's autonom...


id: constant:26b9f9a5620b5b1c1c332e0629552a58
kind: constant
name: STATUS_OPTIONS
qualified_name: STATUS_OPTIONS
file_path: src/app/(dashboard)/dashboard/cloud-agents/page.tsx
language: tsx
signature:
= [
  { value: "all", labelKey: "filterAll" },
  { value: "queued", labelKey: "statusPending" },
  { v...


id: import:09348a750d5f5bea7df3a289dbea80d7
kind: import
name: @/lib/combos/intelligentRouting
qualified_name: @/lib/combos/intelligentRouting
file_path: src/app/(dashboard)/dashboard/combos/BuilderIntelligentStep.tsx
language: tsx
signature:
import {
  DEFAULT_INTELLIGENT_WEIGHTS,
  FACTOR_LABELS,
  MODE_PACK_OPTIONS,
  ROUTER_STRATEGY_OPTIONS,
  normalizeIntelligentRoutingConfig,
} from "@/lib/combos/intelligentRouting";


id: function:6a4416b5392c6df916c40afc5bbd84ef
kind: function
name: BuilderIntelligentStep
qualified_name: BuilderIntelligentStep
file_path: src/app/(dashboard)/dashboard/combos/BuilderIntelligentStep.tsx
language: tsx
signature:
({
  t,
  config,
  onChange,
  activeProviders,
}: {
  t: any;
  config: Record<string, unknown>;
  onChange: (nextConfig: Record<string, unknown>) => void;
  activeProviders: any[];
})


id: import:00d9a8a1cb02241263d95ec0d98708a0
kind: import
name: @/lib/combos/intelligentRouting
qualified_name: @/lib/combos/intelligentRouting
file_path: src/app/(dashboard)/dashboard/combos/IntelligentComboPanel.tsx
language: tsx
signature:
import {
  FACTOR_LABELS,
  MODE_PACK_OPTIONS,
  buildIntelligentProviderScores,
  normalizeIntelligentRoutingConfig,
} from "@/lib/combos/intelligentRouting";


id: function:4bf0c10523894e9b8841bf888606caee
kind: function
name: IntelligentComboPanel
qualified_name: IntelligentComboPanel
file_path: src/app/(dashboard)/dashboard/combos/IntelligentComboPanel.tsx
language: tsx
signature:
({
  t,
  combo,
  allCombos,
  activeProviders,
  onComboUpdated,
}: {
  t: any;
  combo: any;
  allCombos: any[];
  activeProviders: any[];
  onComboUpdated?: (combo: any) => void;
})


id: import:b1963729f6cfdcc8c474bc6da4415e3f
kind: import
name: @/lib/combos/builderDraft
qualified_name: @/lib/combos/builderDraft
file_path: src/app/(dashboard)/dashboard/combos/page.tsx
language: tsx
signature:
import {
  COMBO_BUILDER_AUTO_CONNECTION,
  COMBO_BUILDER_STAGES,
  buildManualComboModelStep,
  buildPrecisionComboModelStep,
  canAccessComboBuilderStage,
  findNextSuggestedConnectionId,
  getComboBuilderStageChecks,
  getComboBuilderStages,
  getNextComboBuilderStage,
  getPreviousComboBuilderStage,
  hasExactModelStepDuplicate,
  isIntelligentBuilderStrategy,
  parseQualifiedModel,
  resolveComboBuilderProviderId,
} from "@/lib/combos/builderDraft";


id: import:f4c46b0e5bc3d5a574dab90e66add3da
kind: import
name: @/lib/combos/intelligentRouting
qualified_name: @/lib/combos/intelligentRouting
file_path: src/app/(dashboard)/dashboard/combos/page.tsx
language: tsx
signature:
import {
  filterCombosByStrategyCategory,
  getStrategyCategory,
  isIntelligentStrategy,
  normalizeIntelligentRoutingFilter,
  normalizeIntelligentRoutingConfig,
} from "@/lib/combos/intelligentRouting";


id: constant:0b8d9dddca23e09b0e38adacbbd3ffde
kind: constant
name: STRATEGY_OPTIONS
qualified_name: STRATEGY_OPTIONS
file_path: src/app/(dashboard)/dashboard/combos/page.tsx
language: tsx
signature:
= ROUTING_STRATEGIES.map((strategy) => ({
  value: strategy.value,
  labelKey: strategy.labelKey,
  de...


id: constant:0bc62c319d2ba7690364f0f7b69e4022
kind: constant
name: STRATEGY_DESC_FALLBACK
qualified_name: STRATEGY_DESC_FALLBACK
file_path: src/app/(dashboard)/dashboard/combos/page.tsx
language: tsx
signature:
= {
  "context-relay":
    "Priority-style routing with automatic context handoffs when account rotati...


id: constant:55c161c6ca1da947d51ffb2d8681d5f1
kind: constant
name: STRATEGY_GUIDANCE_FALLBACK
qualified_name: STRATEGY_GUIDANCE_FALLBACK
file_path: src/app/(dashboard)/dashboard/combos/page.tsx
language: tsx
signature:
= {
  priority: {
    when: "Use when you have one preferred model and only want fallback on failure."...


id: constant:7ee5c7394badc53b5ca019970797a558
kind: constant
name: ADVANCED_FIELD_HELP_FALLBACK
qualified_name: ADVANCED_FIELD_HELP_FALLBACK
file_path: src/app/(dashboard)/dashboard/combos/page.tsx
language: tsx
signature:
= {
  maxRetries: "How many retries are attempted before failing the request.",
  retryDelay: "Initial...


id: constant:c2383950c5dc008618ebf4f5e497daba
kind: constant
name: STRATEGY_RECOMMENDATIONS_FALLBACK
qualified_name: STRATEGY_RECOMMENDATIONS_FALLBACK
file_path: src/app/(dashboard)/dashboard/combos/page.tsx
language: tsx
signature:
= {
  priority: {
    title: "Fail-safe baseline",
    description: "Use one primary model and keep fa...


id: constant:2a527925e9957d5a9faae2f0ff3e2258
kind: constant
name: COMBO_FORM_STAGE_META
qualified_name: COMBO_FORM_STAGE_META
file_path: src/app/(dashboard)/dashboard/combos/page.tsx
language: tsx
signature:
= [
  {
    id: "basics",
    fallbackLabel: "Basics",
    fallbackDescription: "Name and starting tem...


id: constant:d6dda89559e3b852c959acf7841ffb70
kind: constant
name: COMBO_TEMPLATE_FALLBACK
qualified_name: COMBO_TEMPLATE_FALLBACK
file_path: src/app/(dashboard)/dashboard/combos/page.tsx
language: tsx
signature:
= {
  title: "Quick templates",
  description: "Apply a starting profile, then adjust models and confi...


id: constant:271208942efbe05a5d289d1b035c42af
kind: constant
name: COMBO_TEMPLATES
qualified_name: COMBO_TEMPLATES
file_path: src/app/(dashboard)/dashboard/combos/page.tsx
language: tsx
signature:
= [
  {
    id: "free-stack",
    icon: "volunteer_activism",
    titleKey: "templateFreeStack",
    d...


id: function:d7957f8794c7837a0fa346f6e5a07b7a
kind: function
name: normalizeModelEntry
qualified_name: normalizeModelEntry
file_path: src/app/(dashboard)/dashboard/combos/page.tsx
language: tsx
signature: (entry)
docstring:
─────────────────────────────────────────────
Helper: normalize model entry (legacy string ↔ new object)
─────────────────────────────────────────────


id: function:471008893c0deb34eb683c4e7e18dbea
kind: function
name: formatComboEntryDisplay
qualified_name: formatComboEntryDisplay
file_path: src/app/(dashboard)/dashboard/combos/page.tsx
language: tsx
signature:
(
  entry,
  {
    providerNodes = [],
    builderProviders = [],
    includeConnection = false,
    showFullEmails = true,
  }: {
    providerNodes?: any[];
    builderProviders?: any[];
    includeConnection?: boolean;
    showFullEmails?: boolean;
  } = {}
)


id: constant:d4e6c29ebfb426cf56ba5e0d24db4b05
kind: constant
name: COMBO_WIZARD_STEPS
qualified_name: COMBO_WIZARD_STEPS
file_path: src/app/(dashboard)/dashboard/combos/page.tsx
language: tsx
signature:
= [
  {
    step: 1,
    icon: "badge",
    titleKey: "wizardStep1Title",
    descKey: "wizardStep1Des...


id: function:f3d780159936e66e45376f0430ca53a3
kind: function
name: ComboCard
qualified_name: ComboCard
file_path: src/app/(dashboard)/dashboard/combos/page.tsx
language: tsx
docstring:
─────────────────────────────────────────────
Combo Card
─────────────────────────────────────────────

signature:
({
  combo,
  metrics,
  compressionEnabled,
  copied,
  onCopy,
  onEdit,
  onDelete,
  onDuplicate,
  onTest,
  testing,
  onProxy,
  hasProxy,
  onToggle,
  providerNodes,
  dragDisabled,
  isDragged,
  isDropTarget,
  isSelected,
  onDragStart,
  onDragEnd,
})


id: function:eec01262dd674bf702984ca9cb769af8
kind: function
name: TestResultsView
qualified_name: TestResultsView
file_path: src/app/(dashboard)/dashboard/combos/page.tsx
language: tsx
signature: ({ results })
docstring:
─────────────────────────────────────────────
Test Results View
─────────────────────────────────────────────


id: function:6c9b488236675851258616f70a7bd312
kind: function
name: ComboFormModal
qualified_name: ComboFormModal
file_path: src/app/(dashboard)/dashboard/combos/page.tsx
language: tsx
signature: ({ isOpen, combo, onClose, onSave, activeProviders, comboConfigMode })
docstring:
─────────────────────────────────────────────
Combo Form Modal
─────────────────────────────────────────────


id: function:4fb76cff726253c28f9083aba3a95ee0
kind: function
name: WeightTotalBar
qualified_name: WeightTotalBar
file_path: src/app/(dashboard)/dashboard/combos/page.tsx
language: tsx
signature: ({ models })
docstring:
─────────────────────────────────────────────
Weight Total Bar
─────────────────────────────────────────────


id: constant:cdcccda530c2e03d5a6105cd53301ebc
kind: constant
name: RARITY_COLORS
qualified_name: RARITY_COLORS
file_path: src/app/(dashboard)/dashboard/components/BadgeToast.tsx
language: tsx
signature:
= {
  common: "border-gray-500 bg-gray-800",
  uncommon: "border-green-500 bg-green-900/30",
  rare: "...


id: constant:c02e98df23ac7a41b963e6ce683ba582
kind: constant
name: metadata
qualified_name: metadata
file_path: src/app/(dashboard)/dashboard/compression/page.tsx
language: tsx
signature:
= {
  title: "Compression",
  description: "Configure context compression settings to reduce token usa...


id: import:47d8a3a5116af18cd148482385fd1212
kind: import
name: @/app/(dashboard)/dashboard/settings/components/CompressionSettingsTab
qualified_name: @/app/(dashboard)/dashboard/settings/components/CompressionSettingsTab
file_path: src/app/(dashboard)/dashboard/context/caveman/CavemanContextPageClient.tsx
language: tsx
signature:
import CompressionSettingsTab from "@/app/(dashboard)/dashboard/settings/components/CompressionSettingsTab";


id: constant:7aff7d4d080ad260b83bd0178773e740
kind: constant
name: ENGINE_INTENSITIES
qualified_name: ENGINE_INTENSITIES
file_path: src/app/(dashboard)/dashboard/context/combos/CompressionCombosPageClient.tsx
language: tsx
signature:
= {
  rtk: ["minimal", "standard", "aggressive"],
  caveman: ["lite", "full", "ultra"],
  lite: ["lite...


id: constant:6742310eda33b13e410d302e530adc83
kind: constant
name: SAMPLE_OUTPUT
qualified_name: SAMPLE_OUTPUT
file_path: src/app/(dashboard)/dashboard/context/rtk/RtkContextPageClient.tsx
language: tsx
signature:
= `$ npm run typecheck
src/lib/example.ts:10:15 - error TS2322: Type 'string' is not assignable to typ...


id: import:e3110c8cec53a55532ec858af95c3f5c
kind: import
name: recharts
qualified_name: recharts
file_path: src/app/(dashboard)/dashboard/costs/CostOverviewTab.tsx
language: tsx
signature:
import {
  ResponsiveContainer,
  PieChart,
  Pie,
  Cell,
  Tooltip,
  LineChart,
  Line,
  XAxis,
  YAxis,
  CartesianGrid,
  BarChart,
  Bar,
} from "recharts";


id: constant:b21b17e1aca2409d659a6e1c3b91d1df
kind: constant
name: RANGE_OPTIONS
qualified_name: RANGE_OPTIONS
file_path: src/app/(dashboard)/dashboard/costs/CostOverviewTab.tsx
language: tsx
signature:
= [
  { value: "7d", labelKey: "range7d" },
  { value: "30d", labelKey: "range30d" },
  { value: "90d"...


id: constant:63a86489926204097586002fa3bb4034
kind: constant
name: CHART_COLORS
qualified_name: CHART_COLORS
file_path: src/app/(dashboard)/dashboard/costs/CostOverviewTab.tsx
language: tsx
signature:
= [
  "#10b981",
  "#06b6d4",
  "#f59e0b",
  "#8b5cf6",
  "#ef4444",
  "#14b8a6",
  "#6366f1",
  "#ec4...


id: function:6157971b337a6eb92dcae119de26222b
kind: function
name: MetricCard
qualified_name: MetricCard
file_path: src/app/(dashboard)/dashboard/costs/CostOverviewTab.tsx
language: tsx
signature:
({
  label,
  value,
  subValue,
  color = "text-text-main",
  loading = false,
}: {
  label: string;
  value: string;
  subValue?: string;
  color?: string;
  loading?: boolean;
})


id: function:8f6117b1779a987e195117bc95607c6f
kind: function
name: ProviderSpendCard
qualified_name: ProviderSpendCard
file_path: src/app/(dashboard)/dashboard/costs/CostOverviewTab.tsx
language: tsx
signature:
({
  title,
  rows,
  locale,
}: {
  title: string;
  rows: UsageAnalyticsProviderRow[];
  locale: string;
})


id: function:930e5218ffa5dde59a82a0983ba8ae0b
kind: function
name: CostTrendCard
qualified_name: CostTrendCard
file_path: src/app/(dashboard)/dashboard/costs/CostOverviewTab.tsx
language: tsx
signature:
({
  title,
  rows,
  locale,
}: {
  title: string;
  rows: UsageAnalyticsTrendRow[];
  locale: string;
})


id: function:ecbf542d35508fe14f05dc6d4eae20db
kind: function
name: WeeklyPatternCard
qualified_name: WeeklyPatternCard
file_path: src/app/(dashboard)/dashboard/costs/CostOverviewTab.tsx
language: tsx
signature:
({
  title,
  rows,
  locale,
}: {
  title: string;
  rows: Array<{ day: string; avgTokens: number; totalTokens: number }>;
  locale: string;
})


id: function:a93ea96c100209697e7b5641fe9782b3
kind: function
name: ActivityHeatmap
qualified_name: ActivityHeatmap
file_path: src/app/(dashboard)/dashboard/costs/CostOverviewTab.tsx
language: tsx
signature:
({
  title,
  activityMap,
  lessLabel,
  moreLabel,
  locale,
}: {
  title: string;
  activityMap: Record<string, number>;
  lessLabel: string;
  moreLabel: string;
  locale: string;
})


id: function:174d868ff058a854aaf6b061563f6268
kind: function
name: TopListCard
qualified_name: TopListCard
file_path: src/app/(dashboard)/dashboard/costs/CostOverviewTab.tsx
language: tsx
signature:
({
  title,
  rows,
  nameKey,
  valueKey,
  secondaryKey,
  secondaryLabel,
  locale,
  hasCostData,
}: {
  title: string;
  rows: Array<Record<string, any>>;
  nameKey: string;
  valueKey: string;
  secondaryKey?: string;
  secondaryLabel?: string;
  locale: string;
  hasCostData?: boolean;
})


id: function:547b0c8aefa49f2080c8d2263da321fa
kind: function
name: CostBreakdownTable
qualified_name: CostBreakdownTable
file_path: src/app/(dashboard)/dashboard/costs/CostOverviewTab.tsx
language: tsx
signature:
({
  title,
  rows,
  columns,
  locale,
  legacyFreeLabel,
}: {
  title: string;
  rows: Array<Record<string, any>>;
  columns: ColumnDef[];
  locale: string;
  legacyFreeLabel: string;
})


id: type_alias:b23b6d69a13330fbc656678191ff9dae
kind: type_alias
name: Allocation
qualified_name: Allocation
file_path: src/app/(dashboard)/dashboard/costs/quota-share/QuotaSharePageClient.tsx
language: tsx
docstring:
────────────────────────────────────────────────────────────────────────────
Types
────────────────────────────────────────────────────────────────────────────


id: function:03726308a16d283d265b3b7b67c1b917
kind: function
name: generatePoolId
qualified_name: generatePoolId
file_path: src/app/(dashboard)/dashboard/costs/quota-share/QuotaSharePageClient.tsx
language: tsx
signature: (): string
docstring:
Side-effecting helpers kept at module scope so React's purity lint does
not flag callers — they only ever run inside event handlers.


id: constant:349e7b885f9685cc05c484f89837e009
kind: constant
name: SLICE_PALETTE
qualified_name: SLICE_PALETTE
file_path: src/app/(dashboard)/dashboard/costs/quota-share/QuotaSharePageClient.tsx
language: tsx
docstring: Palette for allocation slices in donut + bars
signature:
= [
  "#a78bfa", // violet
  "#60a5fa", // blue
  "#34d399", // emerald
  "#fbbf24", // amber
  "#f871...


id: function:3de15969739f1418596b2e9458d6bea3
kind: function
name: extractPoolSources
qualified_name: extractPoolSources
file_path: src/app/(dashboard)/dashboard/costs/quota-share/QuotaSharePageClient.tsx
language: tsx
docstring:
Extract candidate pool sources from a provider's cached quota response.
Each quota window (session/weekly/credits) becomes a potential pool.

signature:
(
  conn: Connection,
  cached: CachedProviderLimit | undefined
): Array<{
  window: string;
  windowLabel: string;
  totalQuota: number;
  unit: string;
  resetIso?: string | null;
}>


id: function:1fa5d1cacf8f2fc224e9570d55b665a9
kind: function
name: Donut
qualified_name: Donut
file_path: src/app/(dashboard)/dashboard/costs/quota-share/QuotaSharePageClient.tsx
language: tsx
docstring: Donut SVG renderer — slices from allocations array + unfilled gap if <100%
signature:
({
  size = 140,
  thickness = 22,
  slices,
}: {
  size?: number;
  thickness?: number;
  slices: Array<{ percent: number; color: string; label?: string }>;
})


id: function:85452df89cf2177f9660f3768fa022df
kind: function
name: StatCard
qualified_name: StatCard
file_path: src/app/(dashboard)/dashboard/costs/quota-share/QuotaSharePageClient.tsx
language: tsx
docstring:
────────────────────────────────────────────────────────────────────────────
Sub-components
────────────────────────────────────────────────────────────────────────────

signature:
({
  label,
  value,
  tone,
}: {
  label: string;
  value: string;
  tone?: "green" | "amber" | "red";
})


id: function:c91cb4835f292cf04394be042d525ebf
kind: function
name: PoolCard
qualified_name: PoolCard
file_path: src/app/(dashboard)/dashboard/costs/quota-share/QuotaSharePageClient.tsx
language: tsx
signature:
({
  pool,
  cached,
  apiKeys,
  onEdit,
  onRemove,
  onPolicyChange,
}: {
  pool: QuotaPool;
  cached?: CachedProviderLimit;
  apiKeys: ApiKey[];
  onEdit: () => void;
  onRemove: () => void;
  onPolicyChange: (policy: PoolPolicy) => void;
})


id: function:ac44585bb70cda4906569b427303b053
kind: function
name: CreatePoolModal
qualified_name: CreatePoolModal
file_path: src/app/(dashboard)/dashboard/costs/quota-share/QuotaSharePageClient.tsx
language: tsx
signature:
({
  connections,
  caches,
  existingPools,
  onClose,
  onCreate,
}: {
  connections: Connection[];
  caches: Record<string, CachedProviderLimit>;
  existingPools: QuotaPool[];
  onClose: () => void;
  onCreate: (pool: QuotaPool) => void;
})


id: function:6570541f47f61d1ab0c893421bfe0c6e
kind: function
name: EditAllocationsModal
qualified_name: EditAllocationsModal
file_path: src/app/(dashboard)/dashboard/costs/quota-share/QuotaSharePageClient.tsx
language: tsx
signature:
({
  pool,
  apiKeys,
  onClose,
  onSave,
}: {
  pool: QuotaPool;
  apiKeys: ApiKey[];
  onClose: () => void;
  onSave: (allocations: Allocation[]) => void;
})


id: constant:bc34d6d51427a6fc7d4c2a5e5a1bb0cb
kind: constant
name: METHOD_COLORS
qualified_name: METHOD_COLORS
file_path: src/app/(dashboard)/dashboard/endpoint/ApiEndpointsTab.tsx
language: tsx
signature:
= {
  GET: "bg-emerald-500/15 text-emerald-500 border-emerald-500/30",
  POST: "bg-blue-500/15 text-bl...


id: function:6b6693f84bde66cf954a584a4dfc01c1
kind: function
name: ProviderModelsModal
qualified_name: ProviderModelsModal
file_path: src/app/(dashboard)/dashboard/endpoint/EndpointPageClient.tsx
language: tsx
docstring: -- Sub-component: Provider Models Modal ------------------------------------------
signature:
({
  provider,
  models,
  copy,
  copied,
  onClose,
}: Readonly<{
  provider: EndpointProviderSummary;
  models: EndpointModelSummary[];
  copy: CopyHandler;
  copied?: string | null;
  onClose: () => void;
}>)


id: function:bd792b7f2b01902488274589ecda4d75
kind: function
name: EndpointCard
qualified_name: EndpointCard
file_path: src/app/(dashboard)/dashboard/endpoint/EndpointPageClient.tsx
language: tsx
docstring: -- Sub-component: Endpoint Section ------------------------------------------
signature:
({
  icon,
  iconColor,
  iconBg,
  title,
  path,
  models,
  copy,
  copied,
  baseUrl,
  badge,
  modelsLoading = false,
}: Readonly<{
  icon: string;
  iconColor: string;
  iconBg: string;
  title: string;
  path: string;
  models: EndpointModelSummary[] | null;
  copy: CopyHandler;
  copied?: string | null;
  baseUrl: string;
  badge?: string;
  modelsLoading?: boolean;
}>)


id: function:5acedc750c351a530d26428816182b2f
kind: function
name: EndpointSection
qualified_name: EndpointSection
file_path: src/app/(dashboard)/dashboard/endpoint/EndpointPageClient.tsx
language: tsx
signature:
({
  icon,
  iconColor,
  iconBg,
  title,
  path,
  description,
  models,
  expanded,
  onToggle,
  copy,
  copied,
  baseUrl,
  modelsLoading = false,
}: Readonly<{
  icon: string;
  iconColor: string;
  iconBg: string;
  title: string;
  path: string;
  description: string;
  models: EndpointModelSummary[];
  expanded: boolean;
  onToggle: () => void;
  copy: CopyHandler;
  copied?: string | null;
  baseUrl: string;
  modelsLoading?: boolean;
}>)


id: function:ca46e7c53ee0d1a04914a9bb8a2a44c4
kind: function
name: StatCard
qualified_name: StatCard
file_path: src/app/(dashboard)/dashboard/endpoint/components/MCPDashboard.tsx
language: tsx
signature:
({
  label,
  value,
  compact = false,
}: {
  label: string;
  value: string | number;
  compact?: boolean;
})


id: constant:5020e7531f38d1cd5fe2c7b8cfd815ff
kind: constant
name: CAVEMAN_LEVELS
qualified_name: CAVEMAN_LEVELS
file_path: src/app/(dashboard)/dashboard/endpoint/components/TokenSaverCard.tsx
language: tsx
signature:
= [
  { value: "lite", label: "Lite" },
  { value: "full", label: "Full" },
  { value: "ultra", label:...


id: constant:8bbad51bc25a282ead14da29f5f68e8e
kind: constant
name: RTK_LEVELS
qualified_name: RTK_LEVELS
file_path: src/app/(dashboard)/dashboard/endpoint/components/TokenSaverCard.tsx
language: tsx
signature:
= [
  { value: "minimal", label: "Min" },
  { value: "standard", label: "Std" },
  { value: "aggressiv...


id: function:33cfffa0c4e03e582449d7380dc7a8a0
kind: function
name: SegmentedLevel
qualified_name: SegmentedLevel
file_path: src/app/(dashboard)/dashboard/endpoint/components/TokenSaverCard.tsx
language: tsx
signature:
({
  levels,
  value,
  onChange,
  disabled,
}: {
  levels: readonly { value: T; label: string }[];
  value: T;
  onChange: (v: T) => void;
  disabled: boolean;
})


id: function:952500a32a0c0009e00c02ae5edad619
kind: function
name: EngineRow
qualified_name: EngineRow
file_path: src/app/(dashboard)/dashboard/endpoint/components/TokenSaverCard.tsx
language: tsx
signature:
({
  title,
  description,
  href,
  badge,
  enabled,
  masterEnabled,
  onToggle,
  level,
}: {
  title: string;
  description: string;
  href: string;
  badge: string;
  enabled: boolean;
  masterEnabled: boolean;
  onToggle: (v: boolean) => void;
  level: React.ReactNode;
})


id: constant:518c3cd5c9f873423af29f785a137a10
kind: constant
name: CB_STYLES
qualified_name: CB_STYLES
file_path: src/app/(dashboard)/dashboard/health/page.tsx
language: tsx
signature:
= {
  CLOSED: { bg: "bg-green-500/10", text: "text-green-500", labelKey: "healthy" },
  OPEN: { bg: "b...


id: constant:a908cfaf0d06ada9cfc7d4332105b7c8
kind: constant
name: SCOPE_LABELS
qualified_name: SCOPE_LABELS
file_path: src/app/(dashboard)/dashboard/leaderboard/page.tsx
language: tsx
signature:
= {
  global: "All Time",
  weekly: "Weekly",
  monthly: "Monthly",
  tokens_shared: "Tokens Shared",
...


id: constant:201d607faf05f4cd4d46eb546cc6e3af
kind: constant
name: MEDAL_COLORS
qualified_name: MEDAL_COLORS
file_path: src/app/(dashboard)/dashboard/leaderboard/page.tsx
language: tsx
signature:
= [
  "from-amber-400 to-yellow-600", // gold
  "from-gray-300 to-gray-500", // silver
  "from-amber-6...


id: function:c19830645a29489a8e273571c6d568c7
kind: function
name: TransportSelector
qualified_name: TransportSelector
file_path: src/app/(dashboard)/dashboard/mcp/page.tsx
language: tsx
signature:
({
  value,
  onChange,
  disabled,
  baseUrl,
}: {
  value: McpTransport;
  onChange: (t: McpTransport) => void;
  disabled: boolean;
  baseUrl: string;
})


id: constant:3d127bcb88b65394e719721bcd36d309
kind: constant
name: COMMON_PROVIDERS
qualified_name: COMMON_PROVIDERS
file_path: src/app/(dashboard)/dashboard/onboarding/page.tsx
language: tsx
signature:
= [
  { id: "openai", name: "OpenAI", color: "#10A37F" },
  { id: "anthropic", name: "Anthropic", colo...


id: function:8a9f80192da15203f67135769e715b1f
kind: function
name: ChatPlayground
qualified_name: ChatPlayground
file_path: src/app/(dashboard)/dashboard/playground/ChatPlayground.tsx
language: tsx
signature:
({
  selectedProvider,
  selectedModel,
  selectedConnection,
  models,
  providers,
  providerConnections,
  onProviderChange,
  onModelChange,
  onConnectionChange,
  noAccountsString,
  autoAccountsString,
}: ChatPlaygroundProps)


id: constant:5ae6f8ae1c9d87a15cf21448191c067e
kind: constant
name: DEFAULT_BODIES
qualified_name: DEFAULT_BODIES
file_path: src/app/(dashboard)/dashboard/playground/page.tsx
language: tsx
docstring: Endpoint options will be generated dynamically with translations
signature:
= {
  chat: {
    model: "",
    messages: [{ role: "user", content: "Hello! Say hi in one sentence." ...


id: constant:1e3f968d12316d385fd3008422e357fd
kind: constant
name: ENDPOINT_PATHS
qualified_name: ENDPOINT_PATHS
file_path: src/app/(dashboard)/dashboard/playground/page.tsx
language: tsx
signature:
= {
  chat: "/v1/chat/completions",
  responses: "/v1/responses",
  images: "/v1/images/generations",
...


id: constant:f38c2fd0effed018949c871772691b91
kind: constant
name: VISION_MODELS
qualified_name: VISION_MODELS
file_path: src/app/(dashboard)/dashboard/playground/page.tsx
language: tsx
docstring: Models known to support vision (image input)
signature:
= [
  "gpt-4o",
  "gpt-4o-mini",
  "gpt-4-turbo",
  "gpt-4-vision",
  "claude-3",
  "claude-sonnet",
 ...


id: import:b40397f390b9a968804e5b6343a1a333
kind: import
name: @/lib/gamification/xp
qualified_name: @/lib/gamification/xp
file_path: src/app/(dashboard)/dashboard/profile/page.tsx
language: tsx
signature:
import {
  xpForLevel,
  calculateLevel,
  cumulativeXpForLevel,
  getLevelTier,
  getLevelTitle,
} from "@/lib/gamification/xp";


id: constant:f9ced21428c97f456012fba8c8649f4a
kind: constant
name: TIER_CONFIG
qualified_name: TIER_CONFIG
file_path: src/app/(dashboard)/dashboard/profile/page.tsx
language: tsx
signature:
= {
  bronze: { label: "Bronze", color: "text-amber-600", bg: "bg-amber-600/10" },
  silver: { label: ...


id: constant:bee8a8d3e8f7532bad21bab0c0fe94cc
kind: constant
name: RARITY_COLORS
qualified_name: RARITY_COLORS
file_path: src/app/(dashboard)/dashboard/profile/page.tsx
language: tsx
signature:
= {
  common: "text-gray-400 border-gray-500/30",
  uncommon: "text-green-400 border-green-500/30",
  ...


id: import:df0db06ca1fb8b244e82c1dfc15b9310
kind: import
name: @/shared/components
qualified_name: @/shared/components
file_path: src/app/(dashboard)/dashboard/providers/[id]/page.tsx
language: tsx
signature:
import {
  Card,
  Button,
  Badge,
  Input,
  Modal,
  CardSkeleton,
  OAuthModal,
  KiroOAuthWrapper,
  CursorAuthModal,
  Toggle,
  Select,
  ProxyConfigModal,
  NoAuthProviderCard,
} from "@/shared/components";


id: import:2b2cb3fd14b523182d8cc2fd7aa2cd6d
kind: import
name: @/shared/constants/providers
qualified_name: @/shared/constants/providers
file_path: src/app/(dashboard)/dashboard/providers/[id]/page.tsx
language: tsx
signature:
import {
  LOCAL_PROVIDERS,
  FREE_PROVIDERS,
  getProviderAlias,
  isOpenAICompatibleProvider,
  isAnthropicCompatibleProvider,
  isClaudeCodeCompatibleProvider,
  isSelfHostedChatProvider,
  providerAllowsOptionalApiKey,
  supportsApiKeyOnFreeProvider,
  supportsBulkApiKey,
} from "@/shared/constants/providers";


id: import:6a231a010a7ef1eda086bba3f7701d1c
kind: import
name: @/shared/constants/antigravityClientProfile
qualified_name: @/shared/constants/antigravityClientProfile
file_path: src/app/(dashboard)/dashboard/providers/[id]/page.tsx
language: tsx
signature:
import {
  ANTIGRAVITY_CLIENT_PROFILE_OPTIONS,
  normalizeAntigravityClientProfileSetting,
} from "@/shared/constants/antigravityClientProfile";


id: import:26c306522d90f7f1eb486707706f2b67
kind: import
name: @/lib/providers/managedAvailableModels
qualified_name: @/lib/providers/managedAvailableModels
file_path: src/app/(dashboard)/dashboard/providers/[id]/page.tsx
language: tsx
signature:
import {
  compatibleProviderSupportsModelImport,
  getCompatibleFallbackModels,
} from "@/lib/providers/managedAvailableModels";


id: import:e1065961b8dd8f1dcdc6b23ef9796d13
kind: import
name: @/shared/utils/modelCatalogSearch
qualified_name: @/shared/utils/modelCatalogSearch
file_path: src/app/(dashboard)/dashboard/providers/[id]/page.tsx
language: tsx
signature:
import {
  getModelCatalogSourceLabel,
  matchesModelCatalogQuery,
  normalizeModelCatalogSource,
} from "@/shared/utils/modelCatalogSearch";


id: import:82b42f8ff7b0e23c99b58c8cbb7da78c
kind: import
name: @/shared/constants/modelCompat
qualified_name: @/shared/constants/modelCompat
file_path: src/app/(dashboard)/dashboard/providers/[id]/page.tsx
language: tsx
signature:
import {
  MODEL_COMPAT_PROTOCOL_KEYS,
  type ModelCompatProtocolKey,
} from "@/shared/constants/modelCompat";


id: import:5517cb45fafe4a69e6fc87f45e1b6ca2
kind: import
name: @/lib/providers/requestDefaults
qualified_name: @/lib/providers/requestDefaults
file_path: src/app/(dashboard)/dashboard/providers/[id]/page.tsx
language: tsx
signature:
import {
  getClaudeCodeCompatibleRequestDefaults as _getClaudeCodeCompatibleRequestDefaults,
  getCodexRequestDefaults as _getCodexRequestDefaults,
} from "@/lib/providers/requestDefaults";


id: import:43ffdf08db6de6d250dffb371ade42dd
kind: import
name: @/lib/providers/codexFastTier
qualified_name: @/lib/providers/codexFastTier
file_path: src/app/(dashboard)/dashboard/providers/[id]/page.tsx
language: tsx
signature:
import {
  getCodexEffectiveFastServiceTier,
  isCodexGlobalFastServiceTierEnabled,
} from "@/lib/providers/codexFastTier";


id: function:3cb23ae3d550aed01498e4de18399292
kind: function
name: providerText
qualified_name: providerText
file_path: src/app/(dashboard)/dashboard/providers/[id]/page.tsx
language: tsx
signature:
(
  t: ((key: string, values?: Record<string, unknown>) => string) & {
    has?: (key: string) => boolean;
  },
  key: string,
  fallback: string,
  values?: Record<string, unknown>
): string


id: function:43a795754d50ac735d576146aee57d2b
kind: function
name: effectiveNormalizeForProtocol
qualified_name: effectiveNormalizeForProtocol
file_path: src/app/(dashboard)/dashboard/providers/[id]/page.tsx
language: tsx
signature:
(
  modelId: string,
  protocol: string,
  customMap: CompatModelMap,
  overrideMap: CompatModelMap
): boolean


id: function:f557af51050a43a548fb076a0af714d7
kind: function
name: effectiveUpstreamHeadersForProtocol
qualified_name: effectiveUpstreamHeadersForProtocol
file_path: src/app/(dashboard)/dashboard/providers/[id]/page.tsx
language: tsx
signature:
(
  modelId: string,
  protocol: string,
  customMap: CompatModelMap,
  overrideMap: CompatModelMap
): Record<string, string>


id: constant:4c8c199918d2b8f0202bd601ade4dafb
kind: constant
name: CODEX_REASONING_STRENGTH_OPTIONS
qualified_name: CODEX_REASONING_STRENGTH_OPTIONS
file_path: src/app/(dashboard)/dashboard/providers/[id]/page.tsx
language: tsx
signature:
= [
  { value: "none", label: "None" },
  { value: "low", label: "Low" },
  { value: "medium", label: ...


id: function:ed012f9b46850e2c21705b3079d89772
kind: function
name: getCodexRequestDefaults
qualified_name: getCodexRequestDefaults
file_path: src/app/(dashboard)/dashboard/providers/[id]/page.tsx
language: tsx
signature: (providerSpecificData: unknown): { reasoningEffort: string; serviceTier?: "priority"; }
docstring:
UI adapter around the canonical getCodexRequestDefaults from requestDefaults.ts.
Adds the "medium" fallback for reasoningEffort required by the connection form.


id: function:4063c479366bc4aab396dfa6edd4aa47
kind: function
name: ModelCompatPopover
qualified_name: ModelCompatPopover
file_path: src/app/(dashboard)/dashboard/providers/[id]/page.tsx
language: tsx
signature:
({
  t,
  effectiveModelNormalize,
  effectiveModelPreserveDeveloper,
  getUpstreamHeadersRecord,
  onCompatPatch,
  showDeveloperToggle = true,
  disabled,
}: {
  t: (key: string) => string;
  effectiveModelNormalize: (protocol: string) => boolean;
  effectiveModelPreserveDeveloper: (protocol: string) => boolean;
  getUpstreamHeadersRecord: (protocol: string) => Record<string, string>;
  onCompatPatch: (
    protocol: string,
    payload: {
      normalizeToolCallId?: boolean;
      preserveOpenAIDeveloperRole?: boolean;
      upstreamHeaders?: Record<string, string>;
    }
  ) => void;
  showDeveloperToggle?: boolean;
  disabled?: boolean;
})


id: function:4a265e15200ee0957ef90587473b45fc
kind: function
name: ModelRow
qualified_name: ModelRow
file_path: src/app/(dashboard)/dashboard/providers/[id]/page.tsx
language: tsx
signature:
({
  model,
  fullModel,
  provider,
  copied,
  onCopy,
  t,
  showDeveloperToggle = true,
  effectiveModelNormalize,
  effectiveModelPreserveDeveloper,
  getUpstreamHeadersRecord,
  saveModelCompatFlags,
  compatDisabled,
  onToggleHidden,
  togglingHidden,
  onTestModel,
  testStatus,
  testingModel,
}: ModelRowProps)


id: function:5d8ec8f105a12d553fcec9dc310c5194
kind: function
name: ModelVisibilityToolbar
qualified_name: ModelVisibilityToolbar
file_path: src/app/(dashboard)/dashboard/providers/[id]/page.tsx
language: tsx
signature:
({
  t,
  filterValue,
  onFilterChange,
  activeCount,
  totalCount,
  onSelectAll,
  onDeselectAll,
  selectAllDisabled,
  deselectAllDisabled,
}: {
  t: ((key: string, values?: Record<string, unknown>) => string) & {
    has?: (key: string) => boolean;
  };
  filterValue: string;
  onFilterChange: (value: string) => void;
  activeCount: number;
  totalCount: number;
  onSelectAll: () => void;
  onDeselectAll: () => void;
  selectAllDisabled?: boolean;
  deselectAllDisabled?: boolean;
})


id: function:054a4582f2afba4382f8c57b30730e06
kind: function
name: PassthroughModelsSection
qualified_name: PassthroughModelsSection
file_path: src/app/(dashboard)/dashboard/providers/[id]/page.tsx
language: tsx
signature:
({
  providerAlias,
  modelAliases,
  availableModels = [],
  customModels = [],
  copied,
  onCopy,
  onSetAlias,
  onDeleteAlias,
  t,
  effectiveModelNormalize,
  effectiveModelPreserveDeveloper,
  getUpstreamHeadersRecord,
  saveModelCompatFlags,
  compatSavingModelId,
  isModelHidden,
  onToggleHidden,
  onBulkToggleHidden,
  bulkTogglePending,
  togglingModelId,
  onTestModel,
  modelTestStatus,
  testingModelId,
}: PassthroughModelsSectionProps)


id: function:e48e5d5f82439eaa7c1b161436fb4171
kind: function
name: PassthroughModelRow
qualified_name: PassthroughModelRow
file_path: src/app/(dashboard)/dashboard/providers/[id]/page.tsx
language: tsx
signature:
({
  modelId,
  fullModel,
  source,
  isHidden,
  copied,
  onCopy,
  onDeleteAlias,
  t,
  showDeveloperToggle = true,
  effectiveModelNormalize,
  effectiveModelPreserveDeveloper,
  getUpstreamHeadersRecord,
  saveModelCompatFlags,
  compatDisabled,
  onToggleHidden,
  togglingHidden,
  onTestModel,
  testStatus,
  testingModel,
}: PassthroughModelRowProps)


id: function:54826e6c781541645944e6fca28d1ecc
kind: function
name: CustomModelsSection
qualified_name: CustomModelsSection
file_path: src/app/(dashboard)/dashboard/providers/[id]/page.tsx
language: tsx
docstring: ============ Custom Models Section (for ALL providers) ============
signature:
({
  providerId,
  providerAlias,
  copied,
  onCopy,
  onModelsChanged,
}: CustomModelsSectionProps)


id: function:1d34f6e032e9b358af02c522413bdc60
kind: function
name: CompatibleModelsSection
qualified_name: CompatibleModelsSection
file_path: src/app/(dashboard)/dashboard/providers/[id]/page.tsx
language: tsx
signature:
({
  providerStorageAlias,
  providerDisplayAlias,
  modelAliases,
  availableModels = [],
  customModels = [],
  fallbackModels = [],
  description,
  inputLabel,
  inputPlaceholder,
  copied,
  onCopy,
  onSetAlias,
  onDeleteAlias,
  connections,
  isAnthropic,
  onImportWithProgress,
  t,
  effectiveModelNormalize,
  effectiveModelPreserveDeveloper,
  getUpstreamHeadersRecord,
  saveModelCompatFlags,
  compatSavingModelId,
  onModelsChanged,
  allowImport,
  isModelHidden,
  onToggleHidden,
  onBulkToggleHidden,
  bulkTogglePending,
  togglingModelId,
  onTestModel,
  modelTestStatus,
  testingModelId,
}: CompatibleModelsSectionProps)


id: constant:6eb4e4c5af5cc25a4de043ac2aff02f0
kind: constant
name: ERROR_TYPE_LABELS
qualified_name: ERROR_TYPE_LABELS
file_path: src/app/(dashboard)/dashboard/providers/[id]/page.tsx
language: tsx
signature:
= {
  runtime_error: { labelKey: "errorTypeRuntime", variant: "warning" },
  upstream_auth_error: { la...


id: function:12daac7e75a62a3d9e51b506ceae5b91
kind: function
name: ConnectionRow
qualified_name: ConnectionRow
file_path: src/app/(dashboard)/dashboard/providers/[id]/page.tsx
language: tsx
signature:
({
  connection,
  isOAuth,
  isClaude,
  isCodex,
  isGeminiCli,
  codexFastGlobalEnabled,
  isCcCompatible,
  cliproxyapiEnabled,
  isFirst,
  isLast,
  isSelected,
  onToggleSelect,
  onMoveUp,
  onMoveDown,
  onToggleActive,
  onToggleRateLimit,
  onToggleClaudeExtraUsage,
  onToggleCodex5h,
  onToggleCodexWeekly,
  onToggleCliproxyapiMode,
  onRetest,
  isRetesting,
  onEdit,
  onDelete,
  onReauth,
  onProxy,
  hasProxy,
  proxySource,
  proxyHost,
  onRefreshToken,
  isRefreshing,
  onApplyCodexAuthLocal,
  isApplyingCodexAuthLocal,
  onExportCodexAuthFile,
  isExportingCodexAuthFile,
  onApplyClaudeAuthLocal,
  isApplyingClaudeAuthLocal,
  onExportClaudeAuthFile,
  isExportingClaudeAuthFile,
  onApplyGeminiAuthLocal,
  isApplyingGeminiAuthLocal,
  onExportGeminiAuthFile,
  isExportingGeminiAuthFile,
}: ConnectionRowProps)


id: constant:320943c06a75e9383148343da3a0185c
kind: constant
name: CONFIGURABLE_BASE_URL_PROVIDERS
qualified_name: CONFIGURABLE_BASE_URL_PROVIDERS
file_path: src/app/(dashboard)/dashboard/providers/[id]/page.tsx
language: tsx
signature:
= new Set([
  "azure-openai",
  "azure-ai",
  "bailian-coding-plan",
  "xiaomi-mimo",
  "heroku",
  "d...


id: constant:7dacfff71c9eb703da8abf87e0be9547
kind: constant
name: DEFAULT_PROVIDER_BASE_URLS
qualified_name: DEFAULT_PROVIDER_BASE_URLS
file_path: src/app/(dashboard)/dashboard/providers/[id]/page.tsx
language: tsx
signature:
= {
  "azure-openai": "https://example-resource.openai.azure.com",
  "azure-ai": "https://example-reso...


id: function:aa6c3e2dfa6e2784872ffb08f5ca0936
kind: function
name: getProviderBaseUrlHint
qualified_name: getProviderBaseUrlHint
file_path: src/app/(dashboard)/dashboard/providers/[id]/page.tsx
language: tsx
signature:
(
  providerId?: string | null,
  t?: ((key: string, values?: Record<string, unknown>) => string) | null
)


id: function:d3594b2c001ba5787a2772be3cd52df2
kind: function
name: AddApiKeyModal
qualified_name: AddApiKeyModal
file_path: src/app/(dashboard)/dashboard/providers/[id]/page.tsx
language: tsx
signature:
({
  isOpen,
  provider,
  providerName,
  isCompatible,
  isAnthropic,
  isCcCompatible,
  isCommandCode,
  commandCodeAuthState,
  onStartCommandCodeAuth,
  onSave,
  onClose,
}: AddApiKeyModalProps)


id: function:eb9194f30619b14736d69ed714b2b62a
kind: function
name: ApplyCodexAuthModal
qualified_name: ApplyCodexAuthModal
file_path: src/app/(dashboard)/dashboard/providers/[id]/page.tsx
language: tsx
signature:
({
  connectionId,
  inProgress,
  onConfirm,
  onClose,
}: {
  connectionId: string | null;
  inProgress: boolean;
  onConfirm: (id: string) => Promise<void>;
  onClose: () => void;
})


id: function:a40937dc81bdcfb7570197a6322fdd24
kind: function
name: EditCompatibleNodeModal
qualified_name: EditCompatibleNodeModal
file_path: src/app/(dashboard)/dashboard/providers/[id]/page.tsx
language: tsx
signature:
({
  isOpen,
  node,
  onSave,
  onClose,
  isAnthropic,
  isCcCompatible,
}: EditCompatibleNodeModalProps)


id: constant:6b1eb477b4fd69066a12bf917c696759
kind: constant
name: MODE_DEFAULTS
qualified_name: MODE_DEFAULTS
file_path: src/app/(dashboard)/dashboard/providers/components/AddCompatibleProviderModal.tsx
language: tsx
signature:
= {
  openai: {
    baseUrl: "https://api.openai.com/v1",
    type: "openai-compatible",
    chatPath:...


id: import:395fe890f89ace6b9ce80eecc06b94a5
kind: import
name: @/shared/constants/providers
qualified_name: @/shared/constants/providers
file_path: src/app/(dashboard)/dashboard/providers/components/ProviderCard.tsx
language: tsx
signature:
import {
  isAnthropicCompatibleProvider,
  isClaudeCodeCompatibleProvider,
  isOpenAICompatibleProvider,
} from "@/shared/constants/providers";


id: constant:e6a35dd627d8c3574aa64095a6f96787
kind: constant
name: DOT_COLORS
qualified_name: DOT_COLORS
file_path: src/app/(dashboard)/dashboard/providers/components/ProviderCard.tsx
language: tsx
signature:
= {
  free: "bg-green-500",
  oauth: "bg-blue-500",
  apikey: "bg-amber-500",
  compatible: "bg-orange...


id: function:382b4f7a2298c0ecc25155f66d8ecb49
kind: function
name: getStatusDisplay
qualified_name: getStatusDisplay
file_path: src/app/(dashboard)/dashboard/providers/components/ProviderCard.tsx
language: tsx
signature:
(
  connected: number,
  error: number,
  warning: number,
  errorCode: string | null | undefined,
  t: ReturnType<typeof useTranslations>,
  afterConnected?: ReactNode
)


id: import:d559ad5f0d0c723552fff3da25cfa18a
kind: import
name: @/shared/components
qualified_name: @/shared/components
file_path: src/app/(dashboard)/dashboard/providers/page.tsx
language: tsx
signature:
import {
  Card,
  CardSkeleton,
  Badge,
  Button,
  Input,
  Toggle,
  CollapsibleSection,
} from "@/shared/components";


id: import:59883e1a15c673babc9afe44d9ff9ea6
kind: import
name: @/shared/constants/providers
qualified_name: @/shared/constants/providers
file_path: src/app/(dashboard)/dashboard/providers/page.tsx
language: tsx
signature:
import {
  FREE_PROVIDERS,
  OAUTH_PROVIDERS,
  AGGREGATOR_PROVIDER_IDS,
  EMBEDDING_RERANK_PROVIDER_IDS,
  ENTERPRISE_CLOUD_PROVIDER_IDS,
  IDE_PROVIDER_IDS,
  IMAGE_ONLY_PROVIDER_IDS,
  VIDEO_PROVIDER_IDS,
  isClaudeCodeCompatibleProvider,
  CLOUD_AGENT_PROVIDERS,
} from "@/shared/constants/providers";


id: import:4b0161f83adceda822a21f0968dbe3f5
kind: import
name: ./providerPageUtils
qualified_name: ./providerPageUtils
file_path: src/app/(dashboard)/dashboard/providers/page.tsx
language: tsx
signature:
import {
  buildMergedOAuthProviderEntries,
  buildStaticProviderEntries,
  filterConfiguredProviderEntries,
  shouldApplyConfiguredOnlyFilter,
  shouldShowFirstProviderHint,
} from "./providerPageUtils";


id: import:ef026dd1ab2a3f419ab1580aa9a16f9f
kind: import
name: ./providerPageStorage
qualified_name: ./providerPageStorage
file_path: src/app/(dashboard)/dashboard/providers/page.tsx
language: tsx
signature:
import { readConfiguredOnlyPreference, writeConfiguredOnlyPreference } from "./providerPageStorage";


id: import:83679629895db71351d594f8b1bfb831
kind: import
name: @/lib/providers/catalog
qualified_name: @/lib/providers/catalog
file_path: src/app/(dashboard)/dashboard/providers/providerPageUtils.ts
language: typescript
signature:
import {
  getStaticProviderCatalogGroup,
  resolveProviderCatalogEntry,
  type CompatibleProviderLabels,
  type CompatibleProviderNodeLike,
  type ProviderCatalogMetadata,
  type ResolvedProviderCatalogEntry,
  type StaticProviderCatalogCategory,
} from "@/lib/providers/catalog";


id: function:fab587d2e20e3933293b84790cc42714
kind: function
name: buildProviderEntries
qualified_name: buildProviderEntries
file_path: src/app/(dashboard)/dashboard/providers/providerPageUtils.ts
language: typescript
signature:
(
  providers: ProviderRecord<TProvider>,
  displayAuthType: ProviderEntry["displayAuthType"],
  toggleAuthType: ProviderEntry["toggleAuthType"],
  getProviderStats: GetProviderStats
): ProviderEntry<TProvider>[]


id: function:c075b721d1ce7af4cab06e1ab7df58a8
kind: function
name: buildMergedOAuthProviderEntries
qualified_name: buildMergedOAuthProviderEntries
file_path: src/app/(dashboard)/dashboard/providers/providerPageUtils.ts
language: typescript
signature:
(
  oauthProviders: ProviderRecord<TProvider>,
  freeProviders: ProviderRecord<TProvider>,
  getProviderStats: GetProviderStats
): ProviderEntry<TProvider>[]


id: function:843180567ba1f7d15be5d296a2a8c50c
kind: function
name: buildStaticProviderEntries
qualified_name: buildStaticProviderEntries
file_path: src/app/(dashboard)/dashboard/providers/providerPageUtils.ts
language: typescript
signature:
(
  category: StaticProviderCatalogCategory,
  getProviderStats: GetProviderStats
): ProviderEntry<ProviderCatalogMetadata>[]


id: function:ca6fdc1b54cd27c282dd3687dd9dd17a
kind: function
name: filterConfiguredProviderEntries
qualified_name: filterConfiguredProviderEntries
file_path: src/app/(dashboard)/dashboard/providers/providerPageUtils.ts
language: typescript
signature:
(
  entries: ProviderEntry<TProvider>[],
  showConfiguredOnly: boolean,
  searchQuery?: string,
  showFreeOnly?: boolean
): ProviderEntry<TProvider>[]


id: function:2fb1eb62b620d6a5ba405fbe6047d83c
kind: function
name: resolveDashboardProviderInfo
qualified_name: resolveDashboardProviderInfo
file_path: src/app/(dashboard)/dashboard/providers/providerPageUtils.ts
language: typescript
signature:
(
  providerId: string,
  options?: {
    providerNode?: CompatibleProviderNodeLike | null;
    compatibleLabels?: CompatibleProviderLabels | null;
  }
): ResolvedProviderCatalogEntry | null


id: type_alias:2f5c63e2f6fe9c7e2a17c4ba1a8a81b6
kind: type_alias
name: BreakerState
qualified_name: BreakerState
file_path: src/app/(dashboard)/dashboard/runtime/RuntimePageClient.tsx
language: tsx
docstring:
─────────────────────────────────────────────────────────────────────────────
Types
─────────────────────────────────────────────────────────────────────────────


id: constant:cdcaa3d8a19fd0816bee3ea83ecd48be
kind: constant
name: REFRESH_INTERVAL_MS
qualified_name: REFRESH_INTERVAL_MS
file_path: src/app/(dashboard)/dashboard/runtime/RuntimePageClient.tsx
language: tsx
signature: = 5000
docstring:
─────────────────────────────────────────────────────────────────────────────
Constants & helpers
─────────────────────────────────────────────────────────────────────────────


id: constant:f369a9ba8c5fa8e5d55a8d95a69cb83d
kind: constant
name: BREAKER_TONE
qualified_name: BREAKER_TONE
file_path: src/app/(dashboard)/dashboard/runtime/RuntimePageClient.tsx
language: tsx
signature:
= {
  CLOSED: {
    dot: "#22c55e",
    bg: "rgba(34,197,94,0.10)",
    ring: "rgba(34,197,94,0.30)",
...


id: constant:c20c5b7020029541e8194a3b6ac7cb4c
kind: constant
name: FEED_KIND_META
qualified_name: FEED_KIND_META
file_path: src/app/(dashboard)/dashboard/runtime/RuntimePageClient.tsx
language: tsx
signature:
= {
  "circuit-opened": { icon: "block", color: "#ef4444", group: "circuits" },
  "circuit-recovered":...


id: function:c14b623298c986b2814d7bbc73a393e0
kind: function
name: diffSnapshots
qualified_name: diffSnapshots
file_path: src/app/(dashboard)/dashboard/runtime/RuntimePageClient.tsx
language: tsx
docstring:
Compute new feed events by diffing previous vs next snapshot.
Conservative: only emit transitions (added/cleared/state-change), never
emit for items that simply persist between polls.

signature:
(
  prev: { health: HealthPayload | null; conns: Connection[] },
  next: { health: HealthPayload | null; conns: Connection[] },
  nowTs: number
): FeedEvent[]


id: function:5a45b34c86de57c974e3aed7a2df8e1a
kind: function
name: KpiCard
qualified_name: KpiCard
file_path: src/app/(dashboard)/dashboard/runtime/RuntimePageClient.tsx
language: tsx
docstring:
─────────────────────────────────────────────────────────────────────────────
Sub-components
─────────────────────────────────────────────────────────────────────────────

signature:
({
  icon,
  label,
  value,
  hint,
  tone,
  onClick,
  active,
}: {
  icon: string;
  label: string;
  value: string | number;
  hint: string;
  tone: string;
  onClick: () => void;
  active: boolean;
})


id: function:fb7d3f123cdc78f786dfcfa181837b0d
kind: function
name: SectionHeader
qualified_name: SectionHeader
file_path: src/app/(dashboard)/dashboard/runtime/RuntimePageClient.tsx
language: tsx
signature:
({
  icon,
  title,
  subtitle,
  trailing,
}: {
  icon: string;
  title: string;
  subtitle?: string;
  trailing?: React.ReactNode;
})


id: function:6e92001c67133684b801946a8ecb49ca
kind: function
name: LayerSection
qualified_name: LayerSection
file_path: src/app/(dashboard)/dashboard/runtime/RuntimePageClient.tsx
language: tsx
signature:
({
  id,
  title,
  description,
  badge,
  badgeTone,
  children,
}: {
  id: 1 | 2 | 3;
  title: string;
  description: string;
  badge: string;
  badgeTone: "red" | "amber" | "green" | "blue" | "orange";
  children: React.ReactNode;
})


id: function:f9dde8958aaaccd8ee4ac62d2fe1c1d8
kind: function
name: QuotaGroup
qualified_name: QuotaGroup
file_path: src/app/(dashboard)/dashboard/runtime/RuntimePageClient.tsx
language: tsx
signature:
({
  tone,
  label,
  items,
}: {
  tone: "red" | "amber" | "orange";
  label: string;
  items: QuotaMonitor[];
})


id: function:667caab0756803f92730e9c277816487
kind: function
name: ProviderComparison
qualified_name: ProviderComparison
file_path: src/app/(dashboard)/dashboard/search-tools/components/ProviderComparison.tsx
language: tsx
signature:
({
  initialProvider,
  initialResult,
  otherResults,
  loading,
  onClose,
}: ProviderComparisonProps)


id: import:4213ef57e442e2dfa696eaa848309ea1
kind: import
name: @/shared/constants/comboConfigMode
qualified_name: @/shared/constants/comboConfigMode
file_path: src/app/(dashboard)/dashboard/settings/components/AppearanceTab.tsx
language: tsx
signature:
import {
  COMBO_CONFIG_MODE_SETTING_KEY,
  normalizeComboConfigMode,
  type ComboConfigMode,
} from "@/shared/constants/comboConfigMode";


id: function:662e632f621b6b345f6c889ca031d95c
kind: function
name: tierBadgeVariant
qualified_name: tierBadgeVariant
file_path: src/app/(dashboard)/dashboard/settings/components/AuthzSection.tsx
language: tsx
docstring: ─── helpers ──────────────────────────────────────────────────────────────
signature:
(
  tier: TierName,
  prefix: string,
  spawnCapable: ReadonlyArray<string>,
  bypassPrefixes: ReadonlyArray<string>,
  bypassEnabled: boolean
): { variant: "default" | "success" | "warning" | "error" | "info"; key: string }


id: import:77e229da9bd31d8d88afc0d010e6c980
kind: import
name: @/lib/providers/claudeFastMode
qualified_name: @/lib/providers/claudeFastMode
file_path: src/app/(dashboard)/dashboard/settings/components/ClaudeFastModeTab.tsx
language: tsx
signature:
import {
  CLAUDE_FAST_MODE_DEFAULT_MODELS,
  getClaudeFastModeSupportedModels,
  isClaudeFastModeEnabled,
} from "@/lib/providers/claudeFastMode";


id: import:a5c746ba4e6e5209d23e64e7059e4804
kind: import
name: @/lib/providers/codexFastTier
qualified_name: @/lib/providers/codexFastTier
file_path: src/app/(dashboard)/dashboard/settings/components/CodexFastTierTab.tsx
language: tsx
signature:
import {
  CODEX_FAST_TIER_DEFAULT_SUPPORTED_MODELS,
  resolveCodexGlobalFastServiceTier,
} from "@/lib/providers/codexFastTier";


id: constant:00fc21522bbf2f10d35551d5dea42472
kind: constant
name: CODEX_FAST_TIER_CATALOG
qualified_name: CODEX_FAST_TIER_CATALOG
file_path: src/app/(dashboard)/dashboard/settings/components/CodexFastTierTab.tsx
language: tsx
signature: = ["gpt-5.5", "gpt-5.4"]
docstring:
Fast-eligible Codex models per OpenAI ~/.codex/models_cache.json (service_tiers: priority).
Other future Fast-eligible slugs can be added here without code changes once the user
opts them in via the checkbox UI.


id: import:ea29faa1d93e745d083d3de3bb237668
kind: import
name: @/shared/constants/routingStrategies
qualified_name: @/shared/constants/routingStrategies
file_path: src/app/(dashboard)/dashboard/settings/components/ComboDefaultsTab.tsx
language: tsx
signature:
import {
  ROUTING_STRATEGIES,
  SETTINGS_FALLBACK_STRATEGY_VALUES,
} from "@/shared/constants/routingStrategies";


id: constant:d608523b7f0a49e1f61bdd57475265ce
kind: constant
name: MODES
qualified_name: MODES
file_path: src/app/(dashboard)/dashboard/settings/components/CompressionSettingsTab.tsx
language: tsx
signature:
= [
  {
    value: "off",
    labelKey: "compressionModeOff",
    descKey: "compressionModeOffDesc",
 ...


id: constant:62ef256f6c31d4bc4affee45c0461eae
kind: constant
name: ROLE_OPTIONS
qualified_name: ROLE_OPTIONS
file_path: src/app/(dashboard)/dashboard/settings/components/CompressionSettingsTab.tsx
language: tsx
signature:
= [
  { value: "user", labelKey: "compressionRoleUser" },
  { value: "assistant", labelKey: "compressi...


id: constant:7d04fe8b15718283fddfd668890566a5
kind: constant
name: CHAIN_COLORS
qualified_name: CHAIN_COLORS
file_path: src/app/(dashboard)/dashboard/settings/components/FallbackChainsEditor.tsx
language: tsx
signature:
= [
  "#6366f1",
  "#22c55e",
  "#f59e0b",
  "#ef4444",
  "#8b5cf6",
  "#06b6d4",
  "#ec4899",
  "#14b...


id: constant:b62e26372abd54acb082c905f24695b2
kind: constant
name: CATEGORY_STYLES
qualified_name: CATEGORY_STYLES
file_path: src/app/(dashboard)/dashboard/settings/components/FeatureFlagCard.tsx
language: tsx
signature:
= {
  security: { bg: "bg-red-500/15", text: "text-red-400", label: "Security" },
  network: { bg: "bg...


id: constant:4a9d69c767b02573a2f589f7fab5413c
kind: constant
name: SOURCE_STYLES
qualified_name: SOURCE_STYLES
file_path: src/app/(dashboard)/dashboard/settings/components/FeatureFlagCard.tsx
language: tsx
signature:
= {
  db: { bg: "bg-blue-500/20", text: "text-blue-300", label: "DB" },
  env: { bg: "bg-amber-500/20"...


id: constant:24f02c6c3b9a966a953da941578f63d2
kind: constant
name: CATEGORIES
qualified_name: CATEGORIES
file_path: src/app/(dashboard)/dashboard/settings/components/FeatureFlagsGrid.tsx
language: tsx
signature:
= [
  { value: "all", label: "All" },
  { value: "security", label: "Security (6)" },
  { value: "netw...


id: constant:986af01dd52f5ee09ec5e0a46364cc3a
kind: constant
name: MODES
qualified_name: MODES
file_path: src/app/(dashboard)/dashboard/settings/components/IPFilterSection.tsx
language: tsx
signature:
= [
  { value: "disabled", labelKey: "ipModeDisabled", icon: "block" },
  { value: "blacklist", labelK...


id: constant:d64d810b24ad571cab9032e5d1d0477f
kind: constant
name: STRATEGIES
qualified_name: STRATEGIES
file_path: src/app/(dashboard)/dashboard/settings/components/MemorySkillsTab.tsx
language: tsx
signature:
= [
  { value: "recent", labelKey: "recent", descKey: "recentDesc" },
  { value: "semantic", labelKey:...


id: constant:c9d45121bc5c9af1b09cf60c7552d270
kind: constant
name: FIELD_LABEL_KEYS
qualified_name: FIELD_LABEL_KEYS
file_path: src/app/(dashboard)/dashboard/settings/components/PricingTab.tsx
language: tsx
signature:
= {
  input: "input",
  output: "output",
  cached: "cached",
  reasoning: "reasoning",
  cache_creati...


id: function:596b809946ef3be57e3c66eac0492a7b
kind: function
name: FilterSelect
qualified_name: FilterSelect
file_path: src/app/(dashboard)/dashboard/settings/components/PricingTab.tsx
language: tsx
signature:
({
  label,
  value,
  onChange,
  options,
}: {
  label: string;
  value: string;
  onChange: (v: string) => void;
  options: Array<{ value: string; label: string }>;
})


id: function:2f322d51d632a3da4f16b15eb2b9d671
kind: function
name: ProviderSection
qualified_name: ProviderSection
file_path: src/app/(dashboard)/dashboard/settings/components/PricingTab.tsx
language: tsx
signature:
({
  provider,
  pricingData,
  sourceMap,
  isExpanded,
  isEdited,
  onToggle,
  onPricingChange,
  onSave,
  onReset,
  saving,
  getSourceLabel,
}: {
  provider: PricingCatalogProvider;
  pricingData: Record<string, Record<string, number>>;
  sourceMap: Record<string, PricingSource>;
  isExpanded: boolean;
  isEdited: boolean;
  onToggle: () => void;
  onPricingChange: (model: string, field: PricingField, value: string) => void;
  onSave: () => void;
  onReset: () => void;
  saving: boolean;
  getSourceLabel: (source: PricingSource) => string;
})


id: function:944c11b8a7c33db72607aa3f05974881
kind: function
name: ModelRow
qualified_name: ModelRow
file_path: src/app/(dashboard)/dashboard/settings/components/PricingTab.tsx
language: tsx
signature:
({
  model,
  pricing,
  source,
  getSourceLabel,
  onPricingChange,
}: {
  model: PricingCatalogModel;
  pricing?: Record<string, number>;
  source: PricingSource;
  getSourceLabel: (source: PricingSource) => string;
  onPricingChange: (field: PricingField, value: string) => void;
})


id: constant:4919efa350832b469deb7d757e8a00a0
kind: constant
name: EMPTY_FORM
qualified_name: EMPTY_FORM
file_path: src/app/(dashboard)/dashboard/settings/components/ProxyRegistryManager.tsx
language: tsx
signature:
= {
  id: "",
  name: "",
  type: "http",
  host: "",
  port: "8080",
  username: "",
  password: "",
...


id: constant:29a6fd4b57c0f907ea5f524063b3098e
kind: constant
name: BULK_IMPORT_TEMPLATE
qualified_name: BULK_IMPORT_TEMPLATE
file_path: src/app/(dashboard)/dashboard/settings/components/ProxyRegistryManager.tsx
language: tsx
signature:
= `# Proxy Bulk Import
# Format: NAME|HOST|PORT|USERNAME|PASSWORD|TYPE|REGION|STATUS|NOTES
# Required:...


id: import:fbbabd7fab9670fa2ef128d18d8b7f48
kind: import
name: @/shared/constants/bodySize
qualified_name: @/shared/constants/bodySize
file_path: src/app/(dashboard)/dashboard/settings/components/RequestLimitsTab.tsx
language: tsx
signature:
import {
  DEFAULT_REQUEST_BODY_LIMIT_MB,
  MAX_REQUEST_BODY_LIMIT_MB,
  MIN_REQUEST_BODY_LIMIT_MB,
} from "@/shared/constants/bodySize";


id: function:db8f77893cb922636931a1b50a162a5b
kind: function
name: NumberField
qualified_name: NumberField
file_path: src/app/(dashboard)/dashboard/settings/components/ResilienceTab.tsx
language: tsx
signature:
({
  label,
  value,
  suffix,
  min = 0,
  onChange,
}: {
  label: string;
  value: number;
  suffix?: string;
  min?: number;
  onChange: (value: number) => void;
})


id: function:dcc49462f9dd348405d2614efebbe22a
kind: function
name: BooleanField
qualified_name: BooleanField
file_path: src/app/(dashboard)/dashboard/settings/components/ResilienceTab.tsx
language: tsx
signature:
({
  label,
  description,
  checked,
  onChange,
}: {
  label: string;
  description: string;
  checked: boolean;
  onChange: (value: boolean) => void;
})


id: function:1c150a7538a2b46cdb041847bf8ade7e
kind: function
name: ActionRow
qualified_name: ActionRow
file_path: src/app/(dashboard)/dashboard/settings/components/ResilienceTab.tsx
language: tsx
signature:
({
  editing,
  saving,
  onEdit,
  onCancel,
  onSave,
}: {
  editing: boolean;
  saving: boolean;
  onEdit: () => void;
  onCancel: () => void;
  onSave: () => void;
})


id: function:9d710bf788719a667fbe1af9c4d20c9f
kind: function
name: RequestQueueCard
qualified_name: RequestQueueCard
file_path: src/app/(dashboard)/dashboard/settings/components/ResilienceTab.tsx
language: tsx
signature:
({
  value,
  onSave,
  saving,
}: {
  value: RequestQueueSettings;
  onSave: (next: RequestQueueSettings) => Promise<void>;
  saving: boolean;
})


id: function:e63630a3805a5363bfad56c0be8d0959
kind: function
name: ConnectionCooldownCard
qualified_name: ConnectionCooldownCard
file_path: src/app/(dashboard)/dashboard/settings/components/ResilienceTab.tsx
language: tsx
signature:
({
  value,
  onSave,
  saving,
}: {
  value: ResilienceResponse["connectionCooldown"];
  onSave: (next: ResilienceResponse["connectionCooldown"]) => Promise<void>;
  saving: boolean;
})


id: function:2ce8192554490ecffd3830d8c3560fed
kind: function
name: ProviderBreakerCard
qualified_name: ProviderBreakerCard
file_path: src/app/(dashboard)/dashboard/settings/components/ResilienceTab.tsx
language: tsx
signature:
({
  value,
  onSave,
  saving,
}: {
  value: ResilienceResponse["providerBreaker"];
  onSave: (next: ResilienceResponse["providerBreaker"]) => Promise<void>;
  saving: boolean;
})


id: function:acd1d7b629fb4603ac6137f14c3315f9
kind: function
name: WaitForCooldownCard
qualified_name: WaitForCooldownCard
file_path: src/app/(dashboard)/dashboard/settings/components/ResilienceTab.tsx
language: tsx
signature:
({
  value,
  onSave,
  saving,
}: {
  value: WaitForCooldownSettings;
  onSave: (next: WaitForCooldownSettings) => Promise<void>;
  saving: boolean;
})


id: import:156ceb6bed4e4dce803397b08b7d2b44
kind: import
name: @/shared/constants/cliCompatProviders
qualified_name: @/shared/constants/cliCompatProviders
file_path: src/app/(dashboard)/dashboard/settings/components/RoutingTab.tsx
language: tsx
signature:
import {
  CLI_COMPAT_PROVIDER_DISPLAY,
  CLI_COMPAT_TOGGLE_IDS,
  normalizeCliCompatProviderId,
} from "@/shared/constants/cliCompatProviders";


id: type_alias:2d1177c4de9233c85147e631febbcffb
kind: type_alias
name: ProviderCatalogEntry
qualified_name: ProviderCatalogEntry
file_path: src/app/(dashboard)/dashboard/settings/components/RoutingTab.tsx
language: tsx
docstring:
Canonical provider catalog for the "Add provider" dropdown. Pulled from the
shared AI_PROVIDERS registry so the UI stays in sync with backend provider
definitions. We add the CC bridge synthetic ID (no AI_PROVIDERS entry — it's
a relay surface, not an upstream provider). Sorted by display name.


id: constant:b87a7679845fc3967e49354443a38404
kind: constant
name: PROVIDER_CATALOG
qualified_name: PROVIDER_CATALOG
file_path: src/app/(dashboard)/dashboard/settings/components/RoutingTab.tsx
language: tsx
signature:
= (() => {
  const entries: ProviderCatalogEntry[] = Object.values(AI_PROVIDERS).map((p) => ({
    id:...


id: constant:7e71ff00e15ca4abe38d4d28fe4707bb
kind: constant
name: DEFAULT_PARAGRAPH_REMOVAL_ANCHORS
qualified_name: DEFAULT_PARAGRAPH_REMOVAL_ANCHORS
file_path: src/app/(dashboard)/dashboard/settings/components/RoutingTab.tsx
language: tsx
docstring:
Mirrors of ccBridgeTransforms.ts constants used by the native `claude` and
CC-bridge default pipelines.

signature:
= [
  "github.com/anomalyco/opencode",
  "opencode.ai/docs",
  "github.com/cline/cline",
  "github.com...


id: constant:e30944dee1c679d3e0338ba9a59a86b1
kind: constant
name: DEFAULT_SYSTEM_TRANSFORMS_CLIENT
qualified_name: DEFAULT_SYSTEM_TRANSFORMS_CLIENT
file_path: src/app/(dashboard)/dashboard/settings/components/RoutingTab.tsx
language: tsx
docstring:
Mirror of DEFAULT_SYSTEM_TRANSFORMS_CONFIG from open-sse/services/systemTransforms.ts.
Kept client-side so the UI can render + reset to defaults without a server roundtrip.
Server remains the source of truth — UI just lets the user inspect, edit, and reset.

signature:
= {
  providers: {
    [PROVIDER_CLAUDE]: {
      enabled: true,
      pipeline: [
        {
         ...


id: constant:d2b4406a3d66580467b3d38d9a12a016
kind: constant
name: PROVIDER_TILE_DISPLAY
qualified_name: PROVIDER_TILE_DISPLAY
file_path: src/app/(dashboard)/dashboard/settings/components/RoutingTab.tsx
language: tsx
signature:
= {
  [PROVIDER_CLAUDE]: {
    name: "Claude (OAuth)",
    description: "Native Claude provider with O...


id: constant:babf075e192d93a6da28969310210032
kind: constant
name: OP_KIND_LABELS
qualified_name: OP_KIND_LABELS
file_path: src/app/(dashboard)/dashboard/settings/components/RoutingTab.tsx
language: tsx
signature:
= {
  drop_paragraph_if_contains: "routingOpDropParagraphContainsLabel",
  drop_paragraph_if_starts_wi...


id: constant:8f06e9ba6ce1f89dc10d1332ba47764e
kind: constant
name: OP_KIND_DESCRIPTIONS
qualified_name: OP_KIND_DESCRIPTIONS
file_path: src/app/(dashboard)/dashboard/settings/components/RoutingTab.tsx
language: tsx
docstring:
Human-readable description shown above each op's editor. Explains in one
sentence what the op DOES (transformation effect) and one sentence WHEN
to use it (the typical fingerprint-sanitization use-case).

signature:
= {
  drop_paragraph_if_contains: "routingOpDropParagraphContainsDesc",
  drop_paragraph_if_starts_wit...


id: constant:c69117685ee27c8cf1dc8b8c8dabd1e1
kind: constant
name: FIELD_HINTS
qualified_name: FIELD_HINTS
file_path: src/app/(dashboard)/dashboard/settings/components/RoutingTab.tsx
language: tsx
docstring:
Per-field hints rendered under each Input/Select/Toggle inside the
editor. Short, plain-English. Keep under ~120 chars each.

signature:
= {
  needles: "routingNeedlesHint",
  prefixes: "routingPrefixesHint",
  caseSensitive: "routingCaseS...


id: function:0224e919614b0f905a3476ae488a8d56
kind: function
name: StringListEditor
qualified_name: StringListEditor
file_path: src/app/(dashboard)/dashboard/settings/components/RoutingTab.tsx
language: tsx
signature:
({
  label,
  hint,
  items,
  onChange,
  disabled,
}: {
  label: string;
  hint?: string;
  items: string[];
  onChange: (next: string[]) => void;
  disabled?: boolean;
})


id: function:6c8778b74640a48a50487db76688841e
kind: function
name: OpEditor
qualified_name: OpEditor
file_path: src/app/(dashboard)/dashboard/settings/components/RoutingTab.tsx
language: tsx
signature:
({
  op,
  onChange,
  disabled,
}: {
  op: any;
  onChange: (next: any) => void;
  disabled?: boolean;
})


id: function:78ff04b6bbdc3f9893832026b3edf198
kind: function
name: validateProviderTransformsConfig
qualified_name: validateProviderTransformsConfig
file_path: src/app/(dashboard)/dashboard/settings/components/RoutingTab.tsx
language: tsx
signature: (value: unknown): string | null
docstring:
Client-side validator — light shape check before we PATCH; the server
re-validates with the full zod schema in settingsSchemas.ts.


id: import:88bce62678d5fdbe5a171c811740b8cf
kind: import
name: @dnd-kit/core
qualified_name: @dnd-kit/core
file_path: src/app/(dashboard)/dashboard/settings/components/SidebarTab.tsx
language: tsx
signature:
import {
  DndContext,
  closestCenter,
  PointerSensor,
  useSensor,
  useSensors,
  type DragEndEvent,
} from "@dnd-kit/core";


id: import:8c4944b9aec665b3f711556d647a14ab
kind: import
name: @dnd-kit/sortable
qualified_name: @dnd-kit/sortable
file_path: src/app/(dashboard)/dashboard/settings/components/SidebarTab.tsx
language: tsx
signature:
import {
  SortableContext,
  useSortable,
  verticalListSortingStrategy,
  arrayMove,
} from "@dnd-kit/sortable";


id: import:c37b0b6d8a5ee7850a1421a0fe634d66
kind: import
name: @/shared/constants/sidebarVisibility
qualified_name: @/shared/constants/sidebarVisibility
file_path: src/app/(dashboard)/dashboard/settings/components/SidebarTab.tsx
language: tsx
signature:
import {
  HIDDEN_SIDEBAR_ITEMS_SETTING_KEY,
  SIDEBAR_SECTION_ORDER_KEY,
  SIDEBAR_ITEM_ORDER_KEY,
  SIDEBAR_PRESET_KEY,
  SIDEBAR_SETTINGS_UPDATED_EVENT,
  SIDEBAR_SECTIONS,
  SIDEBAR_PRESETS,
  applySectionOrder,
  applyItemOrder,
  getSectionItems,
  normalizeHiddenSidebarItems,
  type HideableSidebarItemId,
  type SidebarSectionId,
  type SidebarItemOrder,
  type SidebarPresetId,
  type SidebarSectionDefinition,
  type SidebarSectionChild,
  type SidebarItemDefinition,
  type SidebarItemGroup,
} from "@/shared/constants/sidebarVisibility";


id: function:f6f17325c588d9b70b94c16100f74627
kind: function
name: SortableSection
qualified_name: SortableSection
file_path: src/app/(dashboard)/dashboard/settings/components/SidebarTab.tsx
language: tsx
signature:
({
  section,
  hiddenSet,
  itemOrder,
  onToggleItem,
  onItemReorder,
  getLabel,
}: SortableSectionProps)


id: constant:2e7014e5bb769a5d4ac69440922ea0d7
kind: constant
name: MODES
qualified_name: MODES
file_path: src/app/(dashboard)/dashboard/settings/components/ThinkingBudgetTab.tsx
language: tsx
signature:
= [
  {
    value: "passthrough",
    labelKey: "passthrough",
    descKey: "passthroughDesc",
    ico...


id: constant:b51923ea047697bafa56ef8d4012a5bf
kind: constant
name: EFFORTS
qualified_name: EFFORTS
file_path: src/app/(dashboard)/dashboard/settings/components/ThinkingBudgetTab.tsx
language: tsx
signature:
= [
  { value: "none", labelKey: "effortNone" },
  { value: "low", labelKey: "effortLow" },
  { value:...


id: function:baf72190fc8bb40478aacef662798a4c
kind: function
name: FeatureChip
qualified_name: FeatureChip
file_path: src/app/(dashboard)/dashboard/translator/TranslatorPageClient.tsx
language: tsx
signature:
({
  icon,
  title,
  description,
  color,
}: {
  icon: string;
  title: string;
  description: string;
  color: "purple" | "blue" | "amber" | "emerald" | "cyan" | "orange" | "pink" | "indigo";
})


id: constant:b8683b38f38ec24869e1e47ab7d2370a
kind: constant
name: TEXT_SAMPLE
qualified_name: TEXT_SAMPLE
file_path: src/app/(dashboard)/dashboard/translator/components/StreamTransformerMode.tsx
language: tsx
signature:
= `data: {"id":"chatcmpl_demo","object":"chat.completion.chunk","created":1745366400,"model":"gpt-4o-m...


id: constant:ccb830d5fb027565796a06cf0abc15bf
kind: constant
name: TOOL_SAMPLE
qualified_name: TOOL_SAMPLE
file_path: src/app/(dashboard)/dashboard/translator/components/StreamTransformerMode.tsx
language: tsx
signature:
= `data: {"id":"chatcmpl_tool","object":"chat.completion.chunk","created":1745366400,"model":"gpt-4o-m...


id: constant:a4e2b749397436c4dd00ffc52c969f50
kind: constant
name: SCENARIOS
qualified_name: SCENARIOS
file_path: src/app/(dashboard)/dashboard/translator/components/TestBenchMode.tsx
language: tsx
docstring:
Test Bench Mode:
Run translation + send scenarios between providers to validate compatibility.
How it works:
Predefined scenarios (Simple Chat, Tool Calling, etc.) are loaded from example templates,
translated from the source format to the target provider, and sent to the provider API.
Results show pass/fail, latency, and chunk count, with a compatibility percentage.

signature:
= [
  { id: "simple-chat", icon: "chat", templateId: "simple-chat" },
  { id: "tool-calling", icon: "b...


id: type_alias:d2c6b769a295ab6b4a9c7423c8cb652f
kind: type_alias
name: TranslatorMessage
qualified_name: TranslatorMessage
file_path: src/app/(dashboard)/dashboard/translator/exampleTemplates.tsx
language: tsx
docstring:
Example templates for the Translator Playground.
Each template provides request bodies in multiple formats so users can
quickly load a realistic payload and see how the translator converts it.


id: constant:bc67b23104c80d1df892a12462e86c5e
kind: constant
name: FORMAT_META
qualified_name: FORMAT_META
file_path: src/app/(dashboard)/dashboard/translator/exampleTemplates.tsx
language: tsx
signature:
= {
  openai: { label: "OpenAI", color: "emerald", icon: "smart_toy" },
  "openai-responses": { label:...


id: constant:e8437fa278caa7b45c9221a5c81f2044
kind: constant
name: FORMAT_MODEL_PREFIXES
qualified_name: FORMAT_MODEL_PREFIXES
file_path: src/app/(dashboard)/dashboard/translator/hooks/useAvailableModels.tsx
language: tsx
docstring:
Prefix-based format→model matching, used to pick a smart default
model from the available models list when the user changes format.

signature:
= {
  openai: ["gpt-", "o1-", "o3-", "o4-"],
  "openai-responses": ["gpt-", "o1-", "o3-", "o4-"],
  cl...


id: import:344844e093e7c7b8c2e374bc9dbd49ef
kind: import
name: @/shared/constants/providers
qualified_name: @/shared/constants/providers
file_path: src/app/(dashboard)/dashboard/translator/hooks/useProviderOptions.tsx
language: tsx
signature:
import {
  AI_PROVIDERS,
  CLAUDE_CODE_COMPATIBLE_PREFIX,
  OPENAI_COMPATIBLE_PREFIX,
  ANTHROPIC_COMPATIBLE_PREFIX,
} from "@/shared/constants/providers";


id: constant:71a8cfacbb0ab0ef0eb33cd204e9ca9c
kind: constant
name: DEFAULT_TEMPLATES
qualified_name: DEFAULT_TEMPLATES
file_path: src/app/(dashboard)/dashboard/usage/components/BudgetTab.tsx
language: tsx
signature:
= [
  {
    id: "tpl-prod",
    name: "Production",
    emoji: "💎",
    dailyLimitUsd: 50,
    monthl...


id: function:41349c01aa16e9e932f96d29827afb4b
kind: function
name: projectEndOfMonth
qualified_name: projectEndOfMonth
file_path: src/app/(dashboard)/dashboard/usage/components/BudgetTab.tsx
language: tsx
signature: (monthlyCost: number, now = new Date()): number
docstring:
Project end-of-month spend based on current burn rate. Simple linear
extrapolation: (monthly cost so far) / (days elapsed) * (days in month).


id: constant:f2b36c71f88deb139c9b7ffb4fe3fed9
kind: constant
name: STATUS_META
qualified_name: STATUS_META
file_path: src/app/(dashboard)/dashboard/usage/components/BudgetTab.tsx
language: tsx
signature:
= {
  all: { label: "All", tone: "text-text-main", bg: "bg-bg-subtle", dot: "var(--color-text-muted)" ...


id: function:13763d83148882bdd1cb84febed0703d
kind: function
name: KpiBlock
qualified_name: KpiBlock
file_path: src/app/(dashboard)/dashboard/usage/components/BudgetTab.tsx
language: tsx
docstring:
────────────────────────────────────────────────────────────────────────────
Sub-components
────────────────────────────────────────────────────────────────────────────

signature:
({
  label,
  value,
  hint,
  tone,
}: {
  label: string;
  value: string;
  hint?: string;
  tone?: "amber" | "red";
})


id: function:733f40e86865bfac40f145ae4c5c86ab
kind: function
name: BudgetRow
qualified_name: BudgetRow
file_path: src/app/(dashboard)/dashboard/usage/components/BudgetTab.tsx
language: tsx
signature:
({
  row,
  isLast,
  isExpanded,
  isSelected,
  onToggleExpand,
  onToggleSelect,
  formatCurrency,
  formatDateTime,
  breakdown,
  onSave,
  saving,
}: {
  row: KeyRow;
  isLast: boolean;
  isExpanded: boolean;
  isSelected: boolean;
  onToggleExpand: () => void;
  onToggleSelect: () => void;
  formatCurrency: (v: number | undefined) => string;
  formatDateTime: (v: number | string | null | undefined) => string;
  breakdown?: ProviderBreakdown[];
  onSave: (payload: any) => void;
  saving: boolean;
})


id: function:fc00fd8bad36f0b1df84e8c10d653cde
kind: function
name: BudgetRowExpanded
qualified_name: BudgetRowExpanded
file_path: src/app/(dashboard)/dashboard/usage/components/BudgetTab.tsx
language: tsx
signature:
({
  row,
  month,
  monthly,
  breakdown,
  formatCurrency,
  formatDateTime,
  onSave,
  saving,
}: {
  row: KeyRow;
  month: number;
  monthly: number;
  breakdown?: ProviderBreakdown[];
  formatCurrency: (v: number | undefined) => string;
  formatDateTime: (v: number | string | null | undefined) => string;
  onSave: (payload: any) => void;
  saving: boolean;
})


id: import:176015580ed365fb371526b6b92dc98c
kind: import
name: @/shared/components
qualified_name: @/shared/components
file_path: src/app/(dashboard)/dashboard/usage/components/EvalsTab.tsx
language: tsx
signature:
import {
  Card,
  Button,
  EmptyState,
  DataTable,
  FilterBar,
  Input,
  Modal,
  Select,
} from "@/shared/components";


id: constant:107a11e1a63f3e4d49e6865a3b60d080
kind: constant
name: STRATEGIES
qualified_name: STRATEGIES
file_path: src/app/(dashboard)/dashboard/usage/components/EvalsTab.tsx
language: tsx
signature:
= [
  {
    name: "contains",
    labelKey: "evalsStrategyContainsLabel",
    icon: "search",
    colo...


id: constant:1f1991f0963fc0f334a10f3bc27056d0
kind: constant
name: HISTORY_COLUMNS
qualified_name: HISTORY_COLUMNS
file_path: src/app/(dashboard)/dashboard/usage/components/EvalsTab.tsx
language: tsx
signature:
= [
  { key: "suiteName", labelKey: "historyColumnSuiteName" },
  { key: "target", labelKey: "historyC...


id: function:6da1712349bf27f232cbfd01519cc7d7
kind: function
name: suiteToCloneDraft
qualified_name: suiteToCloneDraft
file_path: src/app/(dashboard)/dashboard/usage/components/EvalsTab.tsx
language: tsx
signature:
(
  suite: EvalSuite,
  t: (key: string, values?: Record<string, unknown>) => string
): EvalSuiteDraft


id: function:cd95ec206990432c0a46775e45cefbdc
kind: function
name: getTargetLabel
qualified_name: getTargetLabel
file_path: src/app/(dashboard)/dashboard/usage/components/EvalsTab.tsx
language: tsx
signature:
(
  target: { type: EvalTargetType; id: string | null },
  t: (key: string, values?: Record<string, unknown>) => string
): string


id: function:30ab4b55826c31c425a4ad7353ba983f
kind: function
name: SuiteBuilderModal
qualified_name: SuiteBuilderModal
file_path: src/app/(dashboard)/dashboard/usage/components/EvalsTab.tsx
language: tsx
signature:
({
  draft,
  isOpen,
  onChange,
  onClose,
  onSave,
  saving,
  t,
}: {
  draft: EvalSuiteDraft;
  isOpen: boolean;
  onChange: (next: EvalSuiteDraft) => void;
  onClose: () => void;
  onSave: () => void;
  saving: boolean;
  t: (key: string, values?: Record<string, unknown>) => string;
})


id: interface:a6ca37a1727fc19bb55ca0f854bd62fd
kind: interface
name: AccountRowProps
qualified_name: AccountRowProps
file_path: src/app/(dashboard)/dashboard/usage/components/ProviderLimits/AccountRow.tsx
language: tsx
docstring:
One row inside a ProviderGroup's content column.
Collapsed view: account identity + tier badge + one cell per resolved
column + overflow count + cutoff/refresh actions. Provider identity is
rendered by the parent's left rail, not here.
Expanded panel (`isExpanded`): full quota detail laid out as a 2-column
grid inside the right content area (no full-page-width stretch). Quotas
whose remaining=100% and used=0 are hidden behind a "Show N unused"
toggle so the panel stays compact on providers like Antigravity.
All semantics preserved from earlier iterations:
- `pct` is *remaining* (high = green, low = red)
- `unlimited`, `staleAfterReset`, `isCredits` branches intact
- row click toggles expansion; nested controls stop propagation


id: function:3c9bddc4c345cb56adc51e19a0f31ad0
kind: function
name: isUntouched
qualified_name: isUntouched
file_path: src/app/(dashboard)/dashboard/usage/components/ProviderLimits/AccountRow.tsx
language: tsx
signature: (q: any): boolean
docstring:
A quota is "unused" when nothing has been consumed: full remaining and no
recorded usage. Credits-balance entries are never counted here — they
always carry meaning (account funded amount).


id: function:89d20a8772500cb662c46103539f26bd
kind: function
name: AccountRow
qualified_name: AccountRow
file_path: src/app/(dashboard)/dashboard/usage/components/ProviderLimits/AccountRow.tsx
language: tsx
signature:
({
  connection,
  quota,
  loading,
  error,
  refreshedAt,
  tierMeta,
  resolvedPlan,
  status,
  statusTone,
  columns,
  overflowCount,
  isExpanded,
  emailsVisible,
  gridTemplateColumns,
  onToggle,
  onRefresh,
  onOpenCutoff,
  isLast,
}: AccountRowProps)


id: interface:548b346adc67ee61c9ae3c19972abcc5
kind: interface
name: ProviderGroupProps
qualified_name: ProviderGroupProps
file_path: src/app/(dashboard)/dashboard/usage/components/ProviderLimits/ProviderGroup.tsx
language: tsx
docstring:
Provider group rendered as a 2-column grid:
 - left rail (fixed width) hosts the provider identity, vertically centered:
   icon + display name + account count + worst-status dot + bulk refresh
 - right content column hosts a thin per-group column-header row followed
   by the AccountRow stack passed in via `children`.
The rail eliminates the per-row provider duplication seen in the previous
flat-table iteration without taking a full row for a header banner.
`gridTemplateColumns` from `buildGridTemplate(columns.length)` is the
single source of truth shared between the column-header row inside this
component and each AccountRow nested in `children`.


id: constant:914f4026eec974dcaf770b974ae0e04b
kind: constant
name: STATUS_DOT
qualified_name: STATUS_DOT
file_path: src/app/(dashboard)/dashboard/usage/components/ProviderLimits/ProviderGroup.tsx
language: tsx
signature:
= {
  critical: "#ef4444",
  alert: "#eab308",
  ok: "#22c55e",
  empty: "var(--color-text-muted)",
}


id: function:99cde3f52788fb498a0da4d8e29849ca
kind: function
name: ProviderGroup
qualified_name: ProviderGroup
file_path: src/app/(dashboard)/dashboard/usage/components/ProviderLimits/ProviderGroup.tsx
language: tsx
signature:
({
  providerKey,
  providerLabel,
  accountCount,
  worstStatus,
  columns,
  overflowMax,
  isRefreshing,
  onRefreshGroup,
  children,
}: ProviderGroupProps)


id: constant:9c866fff6071a234e2d6e9a8e324d9bc
kind: constant
name: planVariants
qualified_name: planVariants
file_path: src/app/(dashboard)/dashboard/usage/components/ProviderLimits/ProviderLimitCard.tsx
language: tsx
signature:
= {
  free: "default",
  lite: "primary",
  pro: "primary",
  ultra: "success",
  enterprise: "info",
...


id: function:3f154b1b549d79a8fb0b893731d06658
kind: function
name: ProviderLimitCard
qualified_name: ProviderLimitCard
file_path: src/app/(dashboard)/dashboard/usage/components/ProviderLimits/ProviderLimitCard.tsx
language: tsx
signature:
({
  provider,
  name,
  plan,
  quotas = [],
  message = null,
  loading = false,
  error = null,
  onRefresh,
})


id: function:b436588b4156dddc603439bd7c07dd1d
kind: function
name: QuotaCutoffModal
qualified_name: QuotaCutoffModal
file_path: src/app/(dashboard)/dashboard/usage/components/ProviderLimits/QuotaCutoffModal.tsx
language: tsx
signature:
({
  isOpen,
  onClose,
  connectionName,
  provider,
  windows,
  current,
  providerDefaults,
  globalDefaultPercent,
  onSave,
}: QuotaCutoffModalProps)


id: function:d2944468a16f529752061bf394167004
kind: function
name: QuotaProgressBar
qualified_name: QuotaProgressBar
file_path: src/app/(dashboard)/dashboard/usage/components/ProviderLimits/QuotaProgressBar.tsx
language: tsx
signature:
({
  percentage = 0,
  label = "",
  used = 0,
  total = 0,
  unlimited = false,
  resetTime = null,
  staleAfterReset = false,
})


id: function:cd4cf65646b2f93046306db8d58828b6
kind: function
name: translateUsageOrFallback
qualified_name: translateUsageOrFallback
file_path: src/app/(dashboard)/dashboard/usage/components/ProviderLimits/i18nFallback.ts
language: typescript
signature:
(
  t: UsageTranslator,
  key: string,
  fallback: string,
  values?: UsageTranslationValues
): string


id: import:0226fd21f5ab475db04706dc6fda1ade
kind: import
name: ./utils
qualified_name: ./utils
file_path: src/app/(dashboard)/dashboard/usage/components/ProviderLimits/index.tsx
language: tsx
signature:
import {
  parseQuotaData,
  formatQuotaLabel,
  normalizePlanTier,
  resolvePlanValue,
  calculatePercentage,
} from "./utils";


id: constant:e39acb29604b6bf56dd5409d7e013fa6
kind: constant
name: PROVIDER_LABEL
qualified_name: PROVIDER_LABEL
file_path: src/app/(dashboard)/dashboard/usage/components/ProviderLimits/index.tsx
language: tsx
docstring: Display label per known provider; the icon is resolved by ProviderIcon.
signature:
= {
  antigravity: "Antigravity",
  "gemini-cli": "Gemini CLI",
  github: "GitHub Copilot",
  kiro: "K...


id: constant:cbe9f0d053e40ee46436a3ddc346a5c8
kind: constant
name: PROVIDER_ORDER
qualified_name: PROVIDER_ORDER
file_path: src/app/(dashboard)/dashboard/usage/components/ProviderLimits/index.tsx
language: tsx
docstring:
Group ordering — single source of truth for "where does Codex sit
relative to Antigravity on the page".

signature:
= {
  antigravity: 1,
  "gemini-cli": 2,
  github: 3,
  codex: 4,
  claude: 5,
  kiro: 6,
  glm: 7,
  ...


id: constant:271d8182c3aab01d6c8bb8b342daf2d8
kind: constant
name: TIER_FILTERS
qualified_name: TIER_FILTERS
file_path: src/app/(dashboard)/dashboard/usage/components/ProviderLimits/index.tsx
language: tsx
signature:
= [
  { key: "all", labelKey: "tierAll" },
  { key: "enterprise", labelKey: "tierEnterprise" },
  { ke...


id: constant:30b2f7c6cc80d18113a4357a164e919d
kind: constant
name: PURCHASE_TYPES
qualified_name: PURCHASE_TYPES
file_path: src/app/(dashboard)/dashboard/usage/components/ProviderLimits/index.tsx
language: tsx
signature:
= [
  { key: "all", labelKey: "purchaseAll", fallback: "All" },
  { key: "oauth-sub", labelKey: "purch...


id: constant:7d3ed627133a1bdd0356d959b8260784
kind: constant
name: STATUS_TONE
qualified_name: STATUS_TONE
file_path: src/app/(dashboard)/dashboard/usage/components/ProviderLimits/index.tsx
language: tsx
signature:
= {
  all: {
    bar: "var(--color-text-muted)",
    text: "var(--color-text-main)",
    bg: "var(--co...


id: constant:90059c25e36e29d9ffa5342e9087caca
kind: constant
name: PROVIDER_COLUMNS
qualified_name: PROVIDER_COLUMNS
file_path: src/app/(dashboard)/dashboard/usage/components/ProviderLimits/providerColumns.ts
language: typescript
docstring:
Per-provider column schema for the grouped Provider Quota layout.
Each entry lists the canonical quota keys we want to surface as
fixed-width table columns. Matching is done both exact (by `quota.name`)
and via the normalized label (so MiniMax's `"session (5h)"` still lands in
the `"session"` column).
Providers not listed here fall back to a dynamic schema: take the first
`MAX_DYNAMIC_COLUMNS` quotas in the order returned by `parseQuotaData()`
and surface them as columns; everything else becomes "+N more".

signature:
= {
  codex: ["session", "weekly"],
  claude: ["session", "weekly"],
  glm: ["session", "weekly", "mcp...


id: constant:957c4082f81e6369aca941d8357d583d
kind: constant
name: PROVIDER_PLAN_FALLBACKS
qualified_name: PROVIDER_PLAN_FALLBACKS
file_path: src/app/(dashboard)/dashboard/usage/components/ProviderLimits/utils.tsx
language: tsx
signature:
= new Set([
  "claude code",
  "kimi coding",
  "kiro",
  "amazon q",
  "openai codex",
  "codex",
  "...


id: constant:2e6e78efb73fe7fbde2674fbfba1372f
kind: constant
name: QUOTA_LABEL_MAP
qualified_name: QUOTA_LABEL_MAP
file_path: src/app/(dashboard)/dashboard/usage/components/ProviderLimits/utils.tsx
language: tsx
signature:
= {
  chat: "Chat",
  completions: "Completions",
  premium_interactions: "Premium",
  session: "Sessi...


id: constant:2d83b384666b09fc76497d66712dacd1
kind: constant
name: WEBHOOK_EVENTS
qualified_name: WEBHOOK_EVENTS
file_path: src/app/(dashboard)/dashboard/webhooks/page.tsx
language: tsx
signature:
= [
  "request.completed",
  "request.failed",
  "provider.error",
  "provider.recovered",
  "quota.ex...


id: import:67cc020707d731df93de432a7b132b84
kind: import
name: @xyflow/react
qualified_name: @xyflow/react
file_path: src/app/(dashboard)/home/ProviderTopology.tsx
language: tsx
signature:
import {
  ReactFlow,
  Handle,
  Position,
  Controls,
  type Node,
  type Edge,
  type NodeTypes,
} from "@xyflow/react";


id: constant:1d34cfeeeeff2f75ae9267ce1f8e43ee
kind: constant
name: RINGS
qualified_name: RINGS
file_path: src/app/(dashboard)/home/ProviderTopology.tsx
language: tsx
docstring: Rings: [capacity, rx, ry]. Each successive ring fits ~6 more nodes.
signature:
= [
  [8, 210, 132],
  [14, 370, 233],
  [20, 530, 334],
  [26, 690, 435],
  [32, 850, 536],
  [38, 10...


id: function:30fc11ea5399ceab77cd56d78091b702
kind: function
name: buildLayout
qualified_name: buildLayout
file_path: src/app/(dashboard)/home/ProviderTopology.tsx
language: tsx
signature:
(
  providers: ProviderEntry[],
  activeSet: Set<string>,
  lastSet: Set<string>,
  errorSet: Set<string>
): { nodes: Node[]; edges: Edge[] }


id: import:cfaff59e15aa2cb01d80f82d686371d2
kind: import
name: @/lib/acp/registry
qualified_name: @/lib/acp/registry
file_path: src/app/api/acp/agents/route.ts
language: typescript
signature:
import {
  type CliAgentInfo,
  detectInstalledAgents,
  refreshAgentCache,
  resolveVersionProbe,
  setCustomAgents,
  type CustomAgentDef,
} from "@/lib/acp/registry";


id: constant:5a0fd08beaec9247cb640ed439e04f5b
kind: constant
name: customAgentBodySchema
qualified_name: customAgentBodySchema
file_path: src/app/api/acp/agents/route.ts
language: typescript
signature:
= z.object({
  action: z.string().optional(),
  id: z.string().optional(),
  name: z.string().optional...


id: import:8c8cd28be286f02bd5dd6c84825cb2cd
kind: import
name: @omniroute/open-sse/services/accountSemaphore.ts
qualified_name: @omniroute/open-sse/services/accountSemaphore.ts
file_path: src/app/api/admin/concurrency/route.ts
language: typescript
signature:
import {
  getStats as getSemaphoreStats,
  resetAll as resetAllSemaphores,
} from "@omniroute/open-sse/services/accountSemaphore.ts";


id: import:beb966b4bdd9eed295cfb9924b1a9575
kind: import
name: @/domain/assessment/types
qualified_name: @/domain/assessment/types
file_path: src/app/api/assess/route.ts
language: typescript
signature:
import {
  type AssessmentScope,
  type AssessmentTrigger,
  type ModelCategory,
} from "@/domain/assessment/types";


id: constant:415670abf7b9423c1cfb33d3ac36c351
kind: constant
name: assessor
qualified_name: assessor
file_path: src/app/api/assess/route.ts
language: typescript
signature:
= new Assessor(
  process.env.OMNIROUTe_API_KEY ?? process.env.API_KEY ?? "",
  process.env.OMNIROUTe_...


id: constant:17e5d31378067c0e74106517c84866e0
kind: constant
name: modelCategories
qualified_name: modelCategories
file_path: src/app/api/assess/route.ts
language: typescript
signature:
= new Set<ModelCategory>([
  "coding",
  "reasoning",
  "reasoning_deep",
  "chat",
  "fast",
  "visio...


id: constant:f6918dd5ebd70088fa566301db92db5d
kind: constant
name: assessmentScopeSchema
qualified_name: assessmentScopeSchema
file_path: src/app/api/assess/route.ts
language: typescript
signature:
= z.discriminatedUnion("type", [
  z.object({ type: z.literal("all") }),
  z.object({ type: z.literal(...


id: constant:5772c6c3fde43a03757abd5abd0d803f
kind: constant
name: assessmentPostSchema
qualified_name: assessmentPostSchema
file_path: src/app/api/assess/route.ts
language: typescript
signature:
= z.object({
  scope: assessmentScopeSchema.optional().default({ type: "all" }),
  trigger: z
    .enu...


id: import:efd4995b7d628fbf09584981978e062f
kind: import
name: @/lib/auth/managementPassword
qualified_name: @/lib/auth/managementPassword
file_path: src/app/api/auth/login/route.ts
language: typescript
signature:
import {
  ensurePersistentManagementPasswordHash,
  getStoredManagementPassword,
  verifyManagementPassword,
} from "@/lib/auth/managementPassword";


id: import:00384f586ce8a46a4041c8b2493255cd
kind: import
name: @omniroute/open-sse/services/reasoningCache.ts
qualified_name: @omniroute/open-sse/services/reasoningCache.ts
file_path: src/app/api/cache/reasoning/route.ts
language: typescript
signature:
import {
  clearReasoningCacheAll,
  deleteReasoningCacheEntry,
  getReasoningCacheServiceEntries,
  getReasoningCacheServiceStats,
} from "@omniroute/open-sse/services/reasoningCache.ts";


id: import:673a9645a24eace3c92aae6c677dfd6d
kind: import
name: @/lib/semanticCache
qualified_name: @/lib/semanticCache
file_path: src/app/api/cache/route.ts
language: typescript
signature:
import {
  getCacheStats,
  clearCache,
  invalidateByModel,
  invalidateBySignature,
  invalidateStale,
} from "@/lib/semanticCache";


id: constant:bc5330db9954454044e562cee613e52c
kind: constant
name: applySchema
qualified_name: applySchema
file_path: src/app/api/cli-tools/apply/route.ts
language: typescript
signature:
= z.object({
  toolId: z.string().min(1),
  baseUrl: z.string().optional(),
  apiKey: z.string().min(1...


id: constant:59c51f72bd8698a06620734f46993606
kind: constant
name: TOOL_CONFIG_PATHS
qualified_name: TOOL_CONFIG_PATHS
file_path: src/app/api/cli-tools/apply/route.ts
language: typescript
signature:
= {
  claude: path.join(os.homedir(), ".claude", "settings.json"),
  codex: path.join(os.homedir(), "....


id: import:2625758e8d0c007d25efe9c37772b71f
kind: import
name: @/shared/services/cliRuntime
qualified_name: @/shared/services/cliRuntime
file_path: src/app/api/cli-tools/claude-settings/route.ts
language: typescript
signature:
import {
  ensureCliConfigWriteAllowed,
  getCliPrimaryConfigPath,
  getCliRuntimeStatus,
} from "@/shared/services/cliRuntime";


id: constant:7167973d67384b6b72faa4e4cdb96f90
kind: constant
name: RESET_ENV_KEYS
qualified_name: RESET_ENV_KEYS
file_path: src/app/api/cli-tools/claude-settings/route.ts
language: typescript
docstring: Fields to remove when resetting
signature:
= [
  "ANTHROPIC_BASE_URL",
  "ANTHROPIC_AUTH_TOKEN",
  "ANTHROPIC_API_KEY",
  "ANTHROPIC_DEFAULT_OPUS...


id: function:d2daea5712039a15a29a5a72fcb7e50b
kind: function
name: safeProfilePath
qualified_name: safeProfilePath
file_path: src/app/api/cli-tools/codex-profiles/route.ts
language: typescript
signature: (...segments: string[]): string
docstring:
Resolve a path inside PROFILES_DIR and verify it stays within bounds.
Throws on path traversal attempts.


id: import:e25226b30de6dc95b7e9211c696ec8c9
kind: import
name: @/shared/services/cliRuntime
qualified_name: @/shared/services/cliRuntime
file_path: src/app/api/cli-tools/codex-settings/route.ts
language: typescript
signature:
import {
  ensureCliConfigWriteAllowed,
  getCliConfigPaths,
  getCliRuntimeStatus,
} from "@/shared/services/cliRuntime";


id: function:b943b3f51c9c26c910855383c5d8643f
kind: function
name: saveOpenCodeConfig
qualified_name: saveOpenCodeConfig
file_path: src/app/api/cli-tools/guide-settings/[toolId]/route.ts
language: typescript
signature: ({ baseUrl, apiKey, model, models, modelLabels })
docstring:
Save OpenCode config to:
- Linux/macOS: ~/.config/opencode/opencode.json (XDG_CONFIG_HOME aware)
- Windows: %APPDATA%/opencode/opencode.json
(#524) OpenCode was silently failing because this handler was missing.


id: function:630e55468ff93ed8a34ba99ba1c1d191
kind: function
name: saveQwenConfig
qualified_name: saveQwenConfig
file_path: src/app/api/cli-tools/guide-settings/[toolId]/route.ts
language: typescript
signature: ({ baseUrl, apiKey, model })
docstring:
Save Qwen Code config to ~/.qwen/settings.json
Uses security.auth format (not modelProviders) since Qwen Code
prioritizes security.auth.selectedType over modelProviders entries.
Per official docs: security.auth takes highest precedence.


id: function:937edd7fb85fe1d4e9e1bf54261e5c4b
kind: function
name: saveHermesConfig
qualified_name: saveHermesConfig
file_path: src/app/api/cli-tools/guide-settings/[toolId]/route.ts
language: typescript
signature: ({ baseUrl, apiKey, model })
docstring:
Save Hermes config to ~/.hermes/config.yaml
Hermes stores its primary routing settings in YAML. Preserve any existing
keys, but make sure the OmniRoute provider entry is present and selected.


id: import:310f307ab20e1facae04c359abb09ecc
kind: import
name: @/lib/cli-helper/config-generator/hermes-agent
qualified_name: @/lib/cli-helper/config-generator/hermes-agent
file_path: src/app/api/cli-tools/hermes-agent-settings/route.ts
language: typescript
signature:
import {
  generateHermesAgentConfig,
  getCurrentHermesAgentRoles,
} from "@/lib/cli-helper/config-generator/hermes-agent";


id: constant:a3a956a1d47b30cc23601909f3d37edb
kind: constant
name: hermesAgentSettingsSchema
qualified_name: hermesAgentSettingsSchema
file_path: src/app/api/cli-tools/hermes-agent-settings/route.ts
language: typescript
signature:
= z.object({
  baseUrl: z.string().min(1, "baseUrl is required"),
  keyId: z.string().optional().nulla...


id: constant:c16dfb543d5bca87cbeb547282f06235
kind: constant
name: CONFIG_PATH
qualified_name: CONFIG_PATH
file_path: src/app/api/cli-tools/hermes-agent-settings/route.ts
language: typescript
signature: = path.join(os.homedir(), ".hermes", "config.yaml")
docstring:
Dedicated endpoint for Hermes Agent (the advanced Nous Research terminal agent).
This is separate from the original simple "Hermes" guided tool.
GET  -> returns current per-role configuration (default, delegation, auxiliary.*)
POST -> accepts { baseUrl, keyId?, apiKey?, selections: [{role, model}, ...] }


id: import:1e5f742e50f0822c1b2d24761740df4c
kind: import
name: @/shared/services/cliRuntime
qualified_name: @/shared/services/cliRuntime
file_path: src/app/api/cli-tools/runtime/[toolId]/route.ts
language: typescript
signature:
import {
  CLI_TOOL_IDS,
  getCliPrimaryConfigPath,
  getCliRuntimeStatus,
} from "@/shared/services/cliRuntime";


id: import:7af78ff92e46f7817e585f50594bf586
kind: import
name: @/shared/services/cliRuntime
qualified_name: @/shared/services/cliRuntime
file_path: src/app/api/cli-tools/status/route.ts
language: typescript
signature:
import {
  getCliRuntimeStatus,
  CLI_TOOL_IDS,
  getCliPrimaryConfigPath,
} from "@/shared/services/cliRuntime";


id: function:ec09b3d4a83830e2a22d0e50e4749628
kind: function
name: checkToolConfigStatus
qualified_name: checkToolConfigStatus
file_path: src/app/api/cli-tools/status/route.ts
language: typescript
signature: (toolId: string): Promise<string>
docstring:
Check if a tool has OmniRoute configured by reading its config file directly
This replaces the expensive self-referential HTTP calls to /api/cli-tools/*-settings


id: import:e3870127300ba11ab2f6c50884533858
kind: import
name: @/lib/localDb
qualified_name: @/lib/localDb
file_path: src/app/api/combos/[id]/route.ts
language: typescript
signature:
import {
  getComboById,
  updateCombo,
  deleteCombo,
  getComboByName,
  getCombos,
  isCloudEnabled,
} from "@/lib/localDb";


id: import:8264bbc6e1c57fba71273173a6378bc3
kind: import
name: @omniroute/open-sse/services/comboMetrics.ts
qualified_name: @omniroute/open-sse/services/comboMetrics.ts
file_path: src/app/api/combos/metrics/route.ts
language: typescript
signature:
import {
  getAllComboMetrics,
  getComboMetrics,
  resetComboMetrics,
  resetAllComboMetrics,
} from "@omniroute/open-sse/services/comboMetrics.ts";


id: import:9599c1c6d1d7662024429e0e839b3258
kind: import
name: @omniroute/open-sse/services/compression
qualified_name: @omniroute/open-sse/services/compression
file_path: src/app/api/compression/language-packs/route.ts
language: typescript
signature:
import {
  listCavemanRulePacks,
  listSupportedCompressionLanguages,
} from "@omniroute/open-sse/services/compression";


id: import:aba6ecea5006b8441ffdd6da6fc45051
kind: import
name: @omniroute/open-sse/services/compression/types
qualified_name: @omniroute/open-sse/services/compression/types
file_path: src/app/api/compression/preview/route.ts
language: typescript
signature:
import type {
  CompressionConfig,
  CompressionMode,
} from "@omniroute/open-sse/services/compression/types";


id: constant:d76a03c77f47a7881e13d4e4396b05ae
kind: constant
name: PreviewRequestSchema
qualified_name: PreviewRequestSchema
file_path: src/app/api/compression/preview/route.ts
language: typescript
signature:
= z.object({
  messages: z
    .array(
      z.object({
        role: z.string(),
        content: z.u...


id: import:db76cce107febae29f1c8e7d69837856
kind: import
name: @/lib/db/compressionCombos
qualified_name: @/lib/db/compressionCombos
file_path: src/app/api/context/combos/[id]/assignments/route.ts
language: typescript
signature:
import {
  getAssignmentsForCompressionCombo,
  getCompressionCombo,
  updateAssignments,
} from "@/lib/db/compressionCombos";


id: import:2a72e654d8bbadcfd6f1144f8c629aa4
kind: import
name: @/lib/db/compressionCombos
qualified_name: @/lib/db/compressionCombos
file_path: src/app/api/context/combos/[id]/route.ts
language: typescript
signature:
import {
  deleteCompressionCombo,
  getCompressionCombo,
  setDefaultCompressionCombo,
  updateCompressionCombo,
} from "@/lib/db/compressionCombos";


id: import:66613fa138f49948ddc3fe7603a3e2f0
kind: import
name: @/shared/validation/compressionConfigSchemas
qualified_name: @/shared/validation/compressionConfigSchemas
file_path: src/app/api/context/combos/[id]/route.ts
language: typescript
signature:
import {
  cavemanIntensitySchema,
  stackedPipelineStepSchema,
} from "@/shared/validation/compressionConfigSchemas";


id: constant:424165af5a057e7aa0fc8628a3204e62
kind: constant
name: compressionComboUpdateSchema
qualified_name: compressionComboUpdateSchema
file_path: src/app/api/context/combos/[id]/route.ts
language: typescript
signature:
= z
  .object({
    name: z.string().trim().min(1).max(120).optional(),
    description: z.string().ma...


id: constant:4ea49709b624c58e76a1d4217d220107
kind: constant
name: compressionComboCreateSchema
qualified_name: compressionComboCreateSchema
file_path: src/app/api/context/combos/route.ts
language: typescript
signature:
= z
  .object({
    id: z.string().trim().min(1).optional(),
    name: z.string().trim().min(1).max(12...


id: import:692e37259e727547017d60a720535df5
kind: import
name: @omniroute/open-sse/services/compression/engines/rtk/filterLoader
qualified_name: @omniroute/open-sse/services/compression/engines/rtk/filterLoader
file_path: src/app/api/context/rtk/filters/route.ts
language: typescript
signature:
import {
  getRtkFilterCatalog,
  getRtkFilterLoadDiagnostics,
} from "@omniroute/open-sse/services/compression/engines/rtk/filterLoader";


id: import:a74ec0bbf08c5a339905ff5d301c250e
kind: import
name: @omniroute/open-sse/services/compression/engines/rtk
qualified_name: @omniroute/open-sse/services/compression/engines/rtk
file_path: src/app/api/context/rtk/test/route.ts
language: typescript
signature:
import {
  detectCommandType,
  processRtkText,
} from "@omniroute/open-sse/services/compression/engines/rtk";


id: constant:a9bcacbadf92749d79dc3617741d3683
kind: constant
name: rtkTestSchema
qualified_name: rtkTestSchema
file_path: src/app/api/context/rtk/test/route.ts
language: typescript
signature:
= z
  .object({
    text: z.string().min(1),
    command: z.string().optional(),
    config: rtkConfig...


id: import:2879b963d6f7483c0e62530dbd8416a6
kind: import
name: @/lib/localDb
qualified_name: @/lib/localDb
file_path: src/app/api/db-backups/route.ts
language: typescript
signature:
import {
  listDbBackups,
  restoreDbBackup,
  backupDbFile,
  cleanupDbBackups,
  getDbBackupMaxFiles,
  getDbBackupRetentionDays,
} from "@/lib/localDb";


id: import:43714d75c83b9854d88ab49529f2552e
kind: import
name: @/lib/gamification/leaderboard
qualified_name: @/lib/gamification/leaderboard
file_path: src/app/api/gamification/leaderboard/route.ts
language: typescript
signature:
import {
  getTopN,
  getRank,
  getNeighbors,
  type LeaderboardScope,
} from "@/lib/gamification/leaderboard";


id: import:f297876e3aeb903557ec8c959a448f07
kind: import
name: @/domain/degradation
qualified_name: @/domain/degradation
file_path: src/app/api/health/degradation/route.ts
language: typescript
signature:
import {
  getDegradationReport,
  getDegradationSummary,
  hasAnyDegradation,
} from "@/domain/degradation";


id: constant:9008994821f8053506bac0c787e6e760
kind: constant
name: bridgePayloadSchema
qualified_name: bridgePayloadSchema
file_path: src/app/api/internal/codex-responses-ws/route.ts
language: typescript
signature:
= z
  .object({
    action: z.string().optional(),
    requestUrl: z.string().optional(),
    headers:...


id: import:8e92b87bdf9fff01f6df9ea7a50ad1a4
kind: import
name: @/lib/localDb
qualified_name: @/lib/localDb
file_path: src/app/api/keys/[id]/route.ts
language: typescript
signature:
import {
  deleteApiKey,
  getApiKeyById,
  updateApiKeyPermissions,
  isCloudEnabled,
} from "@/lib/localDb";


id: import:30aadcdbfc66aeed023bca24477fce86
kind: import
name: @omniroute/open-sse/mcp-server/runtimeHeartbeat
qualified_name: @omniroute/open-sse/mcp-server/runtimeHeartbeat
file_path: src/app/api/mcp/status/route.ts
language: typescript
signature:
import {
  isMcpHeartbeatOnline,
  isProcessAlive,
  readMcpHeartbeat,
  resolveMcpHeartbeatPath,
} from "@omniroute/open-sse/mcp-server/runtimeHeartbeat";


id: constant:153a9b2295bd3cdb81ff1aa125b2e96a
kind: constant
name: createMemorySchema
qualified_name: createMemorySchema
file_path: src/app/api/memory/route.ts
language: typescript
signature:
= z.object({
  content: z.string().min(1),
  key: z.string().min(1),
  type: z.nativeEnum(MemoryType)....


id: import:97c6d5faa171ac04b519e447926fa1eb
kind: import
name: @/lib/localDb
qualified_name: @/lib/localDb
file_path: src/app/api/model-combo-mappings/[id]/route.ts
language: typescript
signature:
import {
  updateModelComboMapping,
  deleteModelComboMapping,
  getModelComboMappingById,
} from "@/lib/localDb";


id: constant:8373b63510da7d80da59028e7f984cda
kind: constant
name: updateMappingSchema
qualified_name: updateMappingSchema
file_path: src/app/api/model-combo-mappings/[id]/route.ts
language: typescript
signature:
= z.object({
  pattern: z.string().min(1).max(500).optional(),
  comboId: z.string().min(1).optional()...


id: constant:4d56d8cc222061af071c1df6d7c7f8cd
kind: constant
name: createMappingSchema
qualified_name: createMappingSchema
file_path: src/app/api/model-combo-mappings/route.ts
language: typescript
signature:
= z.object({
  pattern: z.string().min(1, "Pattern is required").max(500),
  comboId: z.string().min(1...


id: import:8a243ba168d1915c9833060824dfd5e6
kind: import
name: @/lib/modelMetadataRegistry
qualified_name: @/lib/modelMetadataRegistry
file_path: src/app/api/models/alias/route.ts
language: typescript
signature:
import {
  INTERNAL_PROXY_ERROR,
  getCatalogDiagnosticsHeaders,
  resolveModelAliasLookup,
} from "@/lib/modelMetadataRegistry";


id: import:697a2a2d4703dd095f27699f8307688d
kind: import
name: @/lib/oauth/providers
qualified_name: @/lib/oauth/providers
file_path: src/app/api/oauth/[provider]/[action]/route.ts
language: typescript
signature:
import {
  getProvider,
  generateAuthData,
  exchangeTokens,
  requestDeviceCode,
  pollForToken,
} from "@/lib/oauth/providers";


id: import:7d23db6e0167199ad97b2dfbc1022f0b
kind: import
name: @/models
qualified_name: @/models
file_path: src/app/api/oauth/[provider]/[action]/route.ts
language: typescript
signature:
import {
  createProviderConnection,
  updateProviderConnection,
  getProviderConnections,
  isCloudEnabled,
  resolveProxyForProvider,
} from "@/models";


id: import:3362e6144b2d00a56db5048eb95a4bfb
kind: import
name: @/shared/validation/schemas
qualified_name: @/shared/validation/schemas
file_path: src/app/api/oauth/[provider]/[action]/route.ts
language: typescript
signature:
import {
  jsonObjectSchema,
  oauthExchangeSchema,
  oauthImportTokenSchema,
  oauthPollSchema,
} from "@/shared/validation/schemas";


id: function:8255cc54f0cb1d95c53b40f4043a5409
kind: function
name: safeEqual
qualified_name: safeEqual
file_path: src/app/api/oauth/[provider]/[action]/route.ts
language: typescript
signature: (a: string | null | undefined, b: string | null | undefined): boolean
docstring:
Constant-time string comparison to prevent timing-oracle attacks (CWE-208).
Handles null/undefined safely and different-length strings.


id: function:56f095c50d09d31e6a5920130486c063
kind: function
name: handleStartCallbackServer
qualified_name: handleStartCallbackServer
file_path: src/app/api/oauth/[provider]/[action]/route.ts
language: typescript
signature: (provider: string, searchParams: URLSearchParams)
docstring:
Start PKCE callback server for Codex, Windsurf, or Devin CLI.
Codex uses fixed port 1455; Windsurf/Devin CLI use a random free port (port 0).
Returns the auth URL and stores codeVerifier for later exchange.


id: function:638f4a38e6969b36b56e8956a1a6ceda
kind: function
name: tryIdeAuth
qualified_name: tryIdeAuth
file_path: src/app/api/oauth/cursor/auto-import/route.ts
language: typescript
docstring: Try to read credentials from Cursor IDE's state.vscdb
signature:
(): Promise<{
  found: boolean;
  accessToken?: string;
  machineId?: string;
  source?: string;
  error?: string;
}>


id: function:7f92cd2a3796ebff2b6e7c3caccab053
kind: function
name: tryKiroCliSqlite
qualified_name: tryKiroCliSqlite
file_path: src/app/api/oauth/kiro/auto-import/route.ts
language: typescript
docstring: ── kiro-cli SQLite reader ────────────────────────────────────────────────────
signature:
(): Promise<{
  found: boolean;
  triedPath?: string;
  refreshToken?: string;
  accessToken?: string;
  expiresAt?: string;
  clientId?: string;
  clientSecret?: string;
  region?: string;
  profileArn?: string;
  source?: string;
}>


id: function:8d297a7aad13314e3d027a6fcebd62e8
kind: function
name: tryAwsSsoCache
qualified_name: tryAwsSsoCache
file_path: src/app/api/oauth/kiro/auto-import/route.ts
language: typescript
docstring: ── ~/.aws/sso/cache fallback ─────────────────────────────────────────────────
signature:
(targetProvider: string): Promise<{
  found: boolean;
  triedPath?: string;
  refreshToken?: string;
  source?: string;
}>


id: function:8e88c6ddb3fcf3833547f4a210d0c1ae
kind: function
name: saveAndRespond
qualified_name: saveAndRespond
file_path: src/app/api/oauth/kiro/auto-import/route.ts
language: typescript
docstring: ── Save to OmniRoute DB ──────────────────────────────────────────────────────
signature:
(
  result: Awaited<ReturnType<typeof tryKiroCliSqlite>>,
  targetProvider: string,
  request: Request
)


id: constant:09f4cf10adcd24992c8bf7d150d1e47b
kind: constant
name: socialExchangeSchema
qualified_name: socialExchangeSchema
file_path: src/app/api/oauth/kiro/social-exchange/route.ts
language: typescript
signature:
= z.object({
  deviceCode: z.string().min(1, "Missing deviceCode or provider"),
  provider: z.string()...


id: constant:4170adfc0e8e8896ab934323a148ecdc
kind: constant
name: OPENAPI_SPEC_CANDIDATES
qualified_name: OPENAPI_SPEC_CANDIDATES
file_path: src/app/api/openapi/spec/route.ts
language: typescript
signature:
= [
  path.join(/* turbopackIgnore: true */ process.cwd(), "docs", "reference", "openapi.yaml"),
  pat...


id: constant:31c66cd4dca65c236df589181935f328
kind: constant
name: BLOCKED_FORWARD_HEADERS
qualified_name: BLOCKED_FORWARD_HEADERS
file_path: src/app/api/openapi/try/route.ts
language: typescript
signature:
= new Set([
  "connection",
  "content-length",
  "cookie",
  "host",
  "keep-alive",
  "proxy-authent...


id: constant:fc787def7273721af145967debaa7cba
kind: constant
name: tryRequestSchema
qualified_name: tryRequestSchema
file_path: src/app/api/openapi/try/route.ts
language: typescript
signature:
= z.object({
  method: z
    .enum(["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS"])
    ....


id: import:232fd81d70b88aae0a2721a1436194a2
kind: import
name: @/lib/localDb
qualified_name: @/lib/localDb
file_path: src/app/api/pricing/route.ts
language: typescript
signature:
import {
  getPricing,
  getPricingWithSources,
  updatePricing,
  resetPricing,
  resetAllPricing,
} from "@/lib/localDb";


id: import:69ce87bd1a573ec2f3ac7bb46000dbfb
kind: import
name: @/lib/localDb
qualified_name: @/lib/localDb
file_path: src/app/api/provider-models/route.ts
language: typescript
signature:
import {
  getCustomModels,
  getAllCustomModels,
  addCustomModel,
  removeCustomModel,
  replaceCustomModels,
  deleteSyncedAvailableModelsForProvider,
  updateCustomModel,
  getModelCompatOverrides,
  mergeModelCompatOverride,
  type ModelCompatPatch,
} from "@/lib/localDb";


id: import:001817b3ed65c96bee421793d25b48b6
kind: import
name: @/lib/providerModels/managedAvailableModels
qualified_name: @/lib/providerModels/managedAvailableModels
file_path: src/app/api/provider-models/route.ts
language: typescript
signature:
import {
  deleteManagedAvailableModelAliases,
  deleteManagedAvailableModelAliasesForProvider,
  syncManagedAvailableModelAliases,
} from "@/lib/providerModels/managedAvailableModels";


id: import:a817c9e345f67be0698f589e271f0a4c
kind: import
name: @/shared/constants/providers
qualified_name: @/shared/constants/providers
file_path: src/app/api/provider-models/route.ts
language: typescript
signature:
import {
  AI_PROVIDERS,
  isOpenAICompatibleProvider,
  isAnthropicCompatibleProvider,
} from "@/shared/constants/providers";


id: import:4d313803563098a6d220392c6ff84543
kind: import
name: @/models
qualified_name: @/models
file_path: src/app/api/provider-nodes/[id]/route.ts
language: typescript
signature:
import {
  deleteProviderConnectionsByProvider,
  deleteProviderNode,
  getProviderConnections,
  getProviderNodeById,
  updateProviderConnection,
  updateProviderNode,
} from "@/models";


id: import:9ca121f9cad9b7eb6eaac0a35dcbe41c
kind: import
name: @/shared/constants/providers
qualified_name: @/shared/constants/providers
file_path: src/app/api/provider-nodes/route.ts
language: typescript
signature:
import {
  OPENAI_COMPATIBLE_PREFIX,
  ANTHROPIC_COMPATIBLE_PREFIX,
  CLAUDE_CODE_COMPATIBLE_PREFIX,
} from "@/shared/constants/providers";


id: import:1c13e2927a26821bf20a944cf5072d84
kind: import
name: @/shared/network/safeOutboundFetch
qualified_name: @/shared/network/safeOutboundFetch
file_path: src/app/api/provider-nodes/validate/route.ts
language: typescript
signature:
import {
  SAFE_OUTBOUND_FETCH_PRESETS,
  SafeOutboundFetchError,
  getSafeOutboundFetchErrorStatus,
  safeOutboundFetch,
} from "@/shared/network/safeOutboundFetch";


id: import:15fbc01e24376ad8f43651a661a3c6e1
kind: import
name: @/shared/network/outboundUrlGuard
qualified_name: @/shared/network/outboundUrlGuard
file_path: src/app/api/provider-nodes/validate/route.ts
language: typescript
signature:
import {
  PROVIDER_URL_BLOCKED_MESSAGE,
  getProviderOutboundGuard,
} from "@/shared/network/outboundUrlGuard";


id: import:caec55de1107de0b590f08349ab75c10
kind: import
name: @/lib/oauth/utils/claudeAuthFile
qualified_name: @/lib/oauth/utils/claudeAuthFile
file_path: src/app/api/providers/[id]/claude-auth/apply-local/route.ts
language: typescript
signature:
import {
  ClaudeAuthFileError,
  writeClaudeAuthFileToLocalCli,
} from "@/lib/oauth/utils/claudeAuthFile";


id: import:b09f6eb8474a2381154208be2675cfac
kind: import
name: @/lib/oauth/utils/geminiAuthFile
qualified_name: @/lib/oauth/utils/geminiAuthFile
file_path: src/app/api/providers/[id]/gemini-cli-auth/apply-local/route.ts
language: typescript
signature:
import {
  GeminiAuthFileError,
  writeGeminiAuthFileToLocalCli,
} from "@/lib/oauth/utils/geminiAuthFile";


id: import:f6fa74cf963422f0ca5909aea38ba5b9
kind: import
name: @/shared/constants/providers
qualified_name: @/shared/constants/providers
file_path: src/app/api/providers/[id]/models/route.ts
language: typescript
signature:
import {
  isClaudeCodeCompatibleProvider,
  isAnthropicCompatibleProvider,
  isOpenAICompatibleProvider,
  isSelfHostedChatProvider,
} from "@/shared/constants/providers";


id: import:b695eadbda3accc8eaa3e62639b6f080
kind: import
name: @/lib/localDb
qualified_name: @/lib/localDb
file_path: src/app/api/providers/[id]/models/route.ts
language: typescript
signature:
import {
  getProviderConnectionById,
  getModelIsHidden,
  resolveProxyForProvider,
} from "@/lib/localDb";


id: import:6cb5906a37294889c89c11ac9562265c
kind: import
name: @omniroute/open-sse/services/antigravityProjectBootstrap.ts
qualified_name: @omniroute/open-sse/services/antigravityProjectBootstrap.ts
file_path: src/app/api/providers/[id]/models/route.ts
language: typescript
signature:
import { ensureAntigravityProjectAssigned } from "@omniroute/open-sse/services/antigravityProjectBootstrap.ts";


id: import:48be8124d2f5447fb8f6938492dd84b1
kind: import
name: @omniroute/open-sse/config/antigravityUpstream.ts
qualified_name: @omniroute/open-sse/config/antigravityUpstream.ts
file_path: src/app/api/providers/[id]/models/route.ts
language: typescript
signature:
import {
  getAntigravityModelsDiscoveryUrls,
  getAntigravityFetchAvailableModelsUrls,
} from "@omniroute/open-sse/config/antigravityUpstream.ts";


id: import:c2a576fd532d151d79af74c862f36315
kind: import
name: @omniroute/open-sse/config/glmProvider.ts
qualified_name: @omniroute/open-sse/config/glmProvider.ts
file_path: src/app/api/providers/[id]/models/route.ts
language: typescript
signature:
import {
  buildGlmCodingHeaders,
  buildGlmModelsUrl,
} from "@omniroute/open-sse/config/glmProvider.ts";


id: import:c6b882e962ba70223249432c3a2b623c
kind: import
name: @omniroute/open-sse/config/azureAi.ts
qualified_name: @omniroute/open-sse/config/azureAi.ts
file_path: src/app/api/providers/[id]/models/route.ts
language: typescript
signature:
import {
  AZURE_AI_DEFAULT_BASE_URL,
  buildAzureAiModelsUrl,
} from "@omniroute/open-sse/config/azureAi.ts";


id: import:aea07f0ae1f2ec1afc6fda708884053b
kind: import
name: @omniroute/open-sse/config/datarobot.ts
qualified_name: @omniroute/open-sse/config/datarobot.ts
file_path: src/app/api/providers/[id]/models/route.ts
language: typescript
signature:
import {
  DATAROBOT_DEFAULT_BASE_URL,
  buildDataRobotCatalogUrl,
  isDataRobotDeploymentUrl,
} from "@omniroute/open-sse/config/datarobot.ts";


id: import:3d644a1b34c4dfe858655b9365f9b156
kind: import
name: @omniroute/open-sse/config/sap.ts
qualified_name: @omniroute/open-sse/config/sap.ts
file_path: src/app/api/providers/[id]/models/route.ts
language: typescript
signature:
import {
  SAP_DEFAULT_BASE_URL,
  buildSapModelsUrl,
  getSapResourceGroup,
} from "@omniroute/open-sse/config/sap.ts";


id: import:0e012eff19eb0f458c77056e162db974
kind: import
name: @omniroute/open-sse/config/watsonx.ts
qualified_name: @omniroute/open-sse/config/watsonx.ts
file_path: src/app/api/providers/[id]/models/route.ts
language: typescript
signature:
import {
  WATSONX_DEFAULT_BASE_URL,
  buildWatsonxModelsUrl,
} from "@omniroute/open-sse/config/watsonx.ts";


id: import:99113777b83dd44a6376f58004c4866e
kind: import
name: @omniroute/open-sse/config/antigravityModelAliases.ts
qualified_name: @omniroute/open-sse/config/antigravityModelAliases.ts
file_path: src/app/api/providers/[id]/models/route.ts
language: typescript
signature:
import {
  ANTIGRAVITY_PUBLIC_MODELS,
  getClientVisibleAntigravityModelName,
  isUserCallableAntigravityModelId,
  toClientAntigravityModelId,
} from "@omniroute/open-sse/config/antigravityModelAliases.ts";


id: import:608dd55516a69580cfa6145911af8e80
kind: import
name: @omniroute/open-sse/config/audioRegistry.ts
qualified_name: @omniroute/open-sse/config/audioRegistry.ts
file_path: src/app/api/providers/[id]/models/route.ts
language: typescript
signature:
import {
  getSpeechProvider,
  getTranscriptionProvider,
} from "@omniroute/open-sse/config/audioRegistry.ts";


id: import:dc296cce681a170601f6d66626594675
kind: import
name: @/lib/providerModels/modelDiscovery
qualified_name: @/lib/providerModels/modelDiscovery
file_path: src/app/api/providers/[id]/models/route.ts
language: typescript
signature:
import {
  getCachedDiscoveredModels,
  isAutoFetchModelsEnabled,
  persistDiscoveredModels,
} from "@/lib/providerModels/modelDiscovery";


id: function:26663d724908f0e26528cfdba4c2e705
kind: function
name: fetchAntigravityDiscoveryModelsCached
qualified_name: fetchAntigravityDiscoveryModelsCached
file_path: src/app/api/providers/[id]/models/route.ts
language: typescript
signature:
(
  accessToken: string,
  connectionId: string,
  proxy: unknown,
  providerSpecificData?: unknown
): Promise<Array<{ id: string; name: string }>>


id: constant:0f310c1a331237a6b2d8f03fd6ed4ce9
kind: constant
name: KIMI_CODING_MODELS_CONFIG
qualified_name: KIMI_CODING_MODELS_CONFIG
file_path: src/app/api/providers/[id]/models/route.ts
language: typescript
signature:
= {
  url: "https://api.kimi.com/coding/v1/models",
  method: "GET",
  headers: { "Content-Type": "app...


id: constant:59b0e25dbb595ee9a04740b45640e28d
kind: constant
name: STATIC_MODEL_PROVIDERS
qualified_name: STATIC_MODEL_PROVIDERS
file_path: src/app/api/providers/[id]/models/route.ts
language: typescript
docstring: Providers that return hardcoded models (no remote /models API)
signature:
= {
  deepgram: () => [
    { id: "nova-3", name: "Nova 3 (Transcription)" },
    { id: "nova-2", name...


id: constant:652ff924bdcf2919f659c4129a18eeeb
kind: constant
name: PROVIDER_MODELS_CONFIG
qualified_name: PROVIDER_MODELS_CONFIG
file_path: src/app/api/providers/[id]/models/route.ts
language: typescript
docstring: Provider models endpoints configuration
signature:
= {
  claude: {
    url: "https://api.anthropic.com/v1/models",
    method: "GET",
    headers: {
    ...


id: import:6a45e4918d31c8839e5ffb7067a10217
kind: import
name: @/lib/compliance/providerAudit
qualified_name: @/lib/compliance/providerAudit
file_path: src/app/api/providers/[id]/route.ts
language: typescript
signature:
import {
  getProviderAuditTarget,
  summarizeProviderConnectionForAudit,
} from "@/lib/compliance/providerAudit";


id: import:ece48f8e274e8ce41d61ea2676d87d72
kind: import
name: @/models
qualified_name: @/models
file_path: src/app/api/providers/[id]/route.ts
language: typescript
signature:
import {
  getProviderConnectionById,
  updateProviderConnection,
  deleteProviderConnection,
  isCloudEnabled,
} from "@/models";


id: import:ceb5e68f1ba2960242ec35f46d729188
kind: import
name: @/lib/providers/requestDefaults
qualified_name: @/lib/providers/requestDefaults
file_path: src/app/api/providers/[id]/route.ts
language: typescript
signature:
import {
  normalizeProviderSpecificData,
  sanitizeProviderSpecificDataForResponse,
} from "@/lib/providers/requestDefaults";


id: import:e1188c105b1dc8b3f045127ca54b4326
kind: import
name: @/lib/providers/claudeExtraUsage
qualified_name: @/lib/providers/claudeExtraUsage
file_path: src/app/api/providers/[id]/route.ts
language: typescript
signature:
import {
  buildClaudeExtraUsageStateClearUpdate,
  isClaudeExtraUsageBlockEnabled,
} from "@/lib/providers/claudeExtraUsage";


id: import:05ca91d925772a047a46797bcfb83b46
kind: import
name: @/lib/providerModels/managedModelImport
qualified_name: @/lib/providerModels/managedModelImport
file_path: src/app/api/providers/[id]/sync-models/route.ts
language: typescript
signature:
import {
  importManagedModels,
  type ManagedModelImportMode,
} from "@/lib/providerModels/managedModelImport";


id: import:53a4287e76e40a61faee57a6d950534d
kind: import
name: @/shared/services/modelSyncScheduler
qualified_name: @/shared/services/modelSyncScheduler
file_path: src/app/api/providers/[id]/sync-models/route.ts
language: typescript
signature:
import {
  buildModelSyncInternalHeaders,
  isModelSyncInternalRequest,
} from "@/shared/services/modelSyncScheduler";


id: variable:b4c24e9199268aaba08a553577be55cc
kind: variable
name: __loopbackReadyPromise
qualified_name: __loopbackReadyPromise
file_path: src/app/api/providers/[id]/sync-models/route.ts
language: typescript
signature: = null
docstring:
---------------------------------------------------------------------------
Shared loopback readiness gate — eliminates 17× retry amplification at boot
---------------------------------------------------------------------------
Module-level shared promise: gates all selfFetchWithRetry callers behind a
single readiness probe. The 17 connections that fire ModelSync at boot all
await the same promise; the underlying HTTP probe runs exactly once per
process. Resolves on first HTTP response (any status — even 4xx confirms the
server is up); rejects only if maxWaitMs elapses with consistent network
errors.


id: function:b3a4ffa9e8ebd874fa2b756b117d6a7a
kind: function
name: fetchProviderModelsForSync
qualified_name: fetchProviderModelsForSync
file_path: src/app/api/providers/[id]/sync-models/route.ts
language: typescript
signature: (request: Request, connectionId: string)
docstring:
---------------------------------------------------------------------------
fetchProviderModelsForSync — private orchestrator (uses selfFetchWithRetry)
---------------------------------------------------------------------------


id: import:a05026025e280380c10b4900ad1e801d
kind: import
name: @/lib/localDb
qualified_name: @/lib/localDb
file_path: src/app/api/providers/[id]/test/route.ts
language: typescript
signature:
import {
  getProviderConnectionById,
  updateProviderConnection,
  isCloudEnabled,
  resolveProxyForConnection,
} from "@/lib/localDb";


id: import:a1636f28a1913e18f60e8f988f0c81ba
kind: import
name: @/lib/oauth/gitlab
qualified_name: @/lib/oauth/gitlab
file_path: src/app/api/providers/[id]/test/route.ts
language: typescript
signature:
import {
  buildGitLabOAuthEndpoints,
  isGitLabDirectAccessDisabled,
  resolveGitLabOAuthBaseUrl,
} from "@/lib/oauth/gitlab";


id: constant:c41b86adbca4cb854ba361890b585db3
kind: constant
name: OAUTH_TEST_CONFIG
qualified_name: OAUTH_TEST_CONFIG
file_path: src/app/api/providers/[id]/test/route.ts
language: typescript
docstring: OAuth provider test endpoints
signature:
= {
  claude: {
    // Claude doesn't have userinfo, we verify token exists and not expired
    checkE...


id: function:0090d9695338fa65ba75ef322f9546d1
kind: function
name: classifyFailure
qualified_name: classifyFailure
file_path: src/app/api/providers/[id]/test/route.ts
language: typescript
signature:
({
  error,
  statusCode = null,
  refreshFailed = false,
  unsupported = false,
}: {
  error: string;
  statusCode?: number | null;
  refreshFailed?: boolean;
  unsupported?: boolean;
})


id: function:d496844a4f6654eae399a4dd92ecc347
kind: function
name: refreshOAuthToken
qualified_name: refreshOAuthToken
file_path: src/app/api/providers/[id]/test/route.ts
language: typescript
signature: (connection: any)
docstring:
Refresh OAuth token using the shared open-sse getAccessToken.
This shares the in-flight promise cache with the SSE layer,
preventing race conditions where two code paths attempt to
refresh the same token concurrently.
@returns {object} { accessToken, expiresIn, refreshToken } or null if failed


id: function:c9186fa9662fe21ed1406ddf03fb6f77
kind: function
name: testOAuthConnection
qualified_name: testOAuthConnection
file_path: src/app/api/providers/[id]/test/route.ts
language: typescript
signature: (connection: any)
docstring:
Test OAuth connection by calling provider API
Auto-refreshes token if expired
@returns {{ valid: boolean, error: string|null, refreshed: boolean, newTokens: object|null }}


id: import:5460ccb619849dac53c918f12b964fed
kind: import
name: @/shared/constants/providers
qualified_name: @/shared/constants/providers
file_path: src/app/api/providers/bulk/route.ts
language: typescript
signature:
import {
  isAnthropicCompatibleProvider,
  isOpenAICompatibleProvider,
  supportsBulkApiKey,
} from "@/shared/constants/providers";


id: import:a749b2dc164f99ba14ad469df1380d99
kind: import
name: @/lib/oauth/utils/claudeAuthImport
qualified_name: @/lib/oauth/utils/claudeAuthImport
file_path: src/app/api/providers/claude-auth/import-bulk/route.ts
language: typescript
signature:
import {
  parseAndValidateClaudeAuth,
  enrichWithBootstrap,
  createConnectionFromAuthFile,
} from "@/lib/oauth/utils/claudeAuthImport";


id: import:b74fc43ffc8c8bf6ab31e9ce3f1119fe
kind: import
name: @/lib/oauth/utils/codexAuthImport
qualified_name: @/lib/oauth/utils/codexAuthImport
file_path: src/app/api/providers/codex-auth/import-bulk/route.ts
language: typescript
signature:
import {
  parseAndValidateCodexAuth,
  createConnectionFromAuthFile,
} from "@/lib/oauth/utils/codexAuthImport";


id: import:00e075bae1eef32863007fb77f810882
kind: import
name: @/lib/db/providers
qualified_name: @/lib/db/providers
file_path: src/app/api/providers/command-code/auth/apply/route.ts
language: typescript
signature:
import {
  createProviderConnection,
  getProviderConnectionById,
  updateProviderConnection,
} from "@/lib/db/providers";


id: import:8467af61dbf5b045b9674e1928d5e3bb
kind: import
name: ../shared
qualified_name: ../shared
file_path: src/app/api/providers/command-code/auth/callback/route.ts
language: typescript
signature:
import {
  callbackCorsHeaders,
  commandCodeCallbackSchema,
  MAX_CALLBACK_BODY_BYTES,
  noStoreJson,
  readJsonBodyWithLimit,
  rejectDisallowedCallbackOrigin,
  stateHashFromState,
} from "../shared";


id: constant:7fcbbeb0ee9e1655d1b38acc77a027dc
kind: constant
name: commandCodeCallbackSchema
qualified_name: commandCodeCallbackSchema
file_path: src/app/api/providers/command-code/auth/shared.ts
language: typescript
signature:
= z.object({
  apiKey: z.string().trim().min(1).max(4096),
  state: z.string().trim().min(32).max(512)...


id: constant:557101d3c59da0c0eb9c2ebd4db5295a
kind: constant
name: commandCodeApplySchema
qualified_name: commandCodeApplySchema
file_path: src/app/api/providers/command-code/auth/shared.ts
language: typescript
signature:
= commandCodeStateSchema.extend({
  connectionId: z.string().trim().min(1).max(256).optional(),
  name...


id: import:151eed309ddaa890d933fa7e432759ec
kind: import
name: ../shared
qualified_name: ../shared
file_path: src/app/api/providers/command-code/auth/start/route.ts
language: typescript
signature:
import {
  buildCommandCodeCliCallbackUrl,
  COMMAND_CODE_AUTH_TTL_MS,
  COMMAND_CODE_STUDIO_AUTH_URL,
  generateCommandCodeState,
  noStoreJson,
  stateHashFromState,
} from "../shared";


id: import:aa8306efa95d98062bbec0a67dd68b6f
kind: import
name: @/lib/oauth/utils/geminiAuthImport
qualified_name: @/lib/oauth/utils/geminiAuthImport
file_path: src/app/api/providers/gemini-cli-auth/import-bulk/route.ts
language: typescript
signature:
import {
  parseAndValidateGeminiAuth,
  enrichWithLoadCodeAssist,
  createConnectionFromAuthFile,
} from "@/lib/oauth/utils/geminiAuthImport";


id: import:c656494f700d1805da34029bce3c0d48
kind: import
name: @/models
qualified_name: @/models
file_path: src/app/api/providers/route.ts
language: typescript
signature:
import {
  getProviderConnections,
  createProviderConnection,
  deleteProviderConnections,
  getProviderNodeById,
  isCloudEnabled,
} from "@/models";


id: import:f5ed454bb8f452228f344a6c29de5b51
kind: import
name: @/shared/constants/providers
qualified_name: @/shared/constants/providers
file_path: src/app/api/providers/route.ts
language: typescript
signature:
import {
  isClaudeCodeCompatibleProvider,
  isOpenAICompatibleProvider,
  isAnthropicCompatibleProvider,
} from "@/shared/constants/providers";


id: import:18d0d967060434351656fc1e69503191
kind: import
name: @/shared/constants/providers
qualified_name: @/shared/constants/providers
file_path: src/app/api/providers/test-batch/route.ts
language: typescript
signature:
import {
  FREE_PROVIDERS,
  OAUTH_PROVIDERS,
  APIKEY_PROVIDERS,
  LOCAL_PROVIDERS,
  UPSTREAM_PROXY_PROVIDERS,
  WEB_COOKIE_PROVIDERS,
  SEARCH_PROVIDERS,
  AUDIO_ONLY_PROVIDERS,
  CLOUD_AGENT_PROVIDERS,
  IDE_PROVIDER_IDS,
  OPENAI_COMPATIBLE_PREFIX,
  ANTHROPIC_COMPATIBLE_PREFIX,
} from "@/shared/constants/providers";


id: constant:865a6e491d14a2ad6ef9e3da8997d39d
kind: constant
name: manualImportSchema
qualified_name: manualImportSchema
file_path: src/app/api/providers/zed/manual-import/route.ts
language: typescript
signature:
= z.object({
  provider: z.string().min(1).max(64),
  token: z.string().min(1).max(512),
  label: z.st...


id: import:5de50773914b07e20475fb13696ebc64
kind: import
name: @omniroute/open-sse/services/rateLimitManager.ts
qualified_name: @omniroute/open-sse/services/rateLimitManager.ts
file_path: src/app/api/rate-limits/route.ts
language: typescript
signature:
import {
  enableRateLimitProtection,
  disableRateLimitProtection,
  getRateLimitStatus,
  getAllRateLimitStatus,
} from "@omniroute/open-sse/services/rateLimitManager.ts";


id: import:1a4b5263b19e87c10efae57e6f2f1473
kind: import
name: @/domain/modelAvailability
qualified_name: @/domain/modelAvailability
file_path: src/app/api/resilience/model-cooldowns/route.ts
language: typescript
signature:
import {
  clearModelUnavailability,
  getAvailabilityReport,
  resetAllAvailability,
} from "@/domain/modelAvailability";


id: constant:75c61c4b7accfa5ce2a72a7012c5d31a
kind: constant
name: deleteCooldownSchema
qualified_name: deleteCooldownSchema
file_path: src/app/api/resilience/model-cooldowns/route.ts
language: typescript
signature:
= z
  .object({
    provider: z.string().optional(),
    model: z.string().optional(),
    all: z.bool...


id: import:aa6eb0d5e72fe3279ed5ad6e4082a540
kind: import
name: @/lib/resilience/settings
qualified_name: @/lib/resilience/settings
file_path: src/app/api/resilience/route.ts
language: typescript
signature:
import {
  buildLegacyResilienceCompat,
  mergeResilienceSettings,
  resolveResilienceSettings,
  type ResilienceSettings,
  type ResilienceSettingsPatch,
} from "@/lib/resilience/settings";


id: import:5c6cf99883829abbd52c71a7a14e2691
kind: import
name: @omniroute/open-sse/config/searchRegistry.ts
qualified_name: @omniroute/open-sse/config/searchRegistry.ts
file_path: src/app/api/search/providers/route.ts
language: typescript
signature:
import {
  SEARCH_PROVIDERS,
  SEARCH_CREDENTIAL_FALLBACKS,
} from "@omniroute/open-sse/config/searchRegistry.ts";


id: import:41534dd27ce5ba20c1c4d102b432adf1
kind: import
name: @omniroute/open-sse/services/sessionManager.ts
qualified_name: @omniroute/open-sse/services/sessionManager.ts
file_path: src/app/api/sessions/route.ts
language: typescript
signature:
import {
  getActiveSessions,
  getActiveSessionCount,
  getAllActiveSessionCountsByKey,
} from "@omniroute/open-sse/services/sessionManager.ts";


id: import:765d06202ce38b55913c45753e1ff14f
kind: import
name: @/server/authz/routeGuard
qualified_name: @/server/authz/routeGuard
file_path: src/app/api/settings/authz-inventory/route.ts
language: typescript
signature:
import {
  LOCAL_ONLY_API_PREFIXES,
  ALWAYS_PROTECTED_API_PATHS,
  LOCAL_ONLY_MANAGE_SCOPE_BYPASS_PREFIXES,
  SPAWN_CAPABLE_PREFIXES,
} from "@/server/authz/routeGuard";


id: constant:6f8924140223f3a8042ae9272bccb280
kind: constant
name: MANAGEMENT_TIER_PREFIXES
qualified_name: MANAGEMENT_TIER_PREFIXES
file_path: src/app/api/settings/authz-inventory/route.ts
language: typescript
signature: = [ "/api/settings", "/api/providers/", "/api/api-keys", ]
docstring:
Static MANAGEMENT-tier example prefixes. Render-only — never consulted by
the runtime policy. The actual MANAGEMENT classification is "any /api/*
that is not LOCAL_ONLY, not v1/client, not on the public allowlist", so the
inventory shows representative entries rather than a generated enumeration.


id: function:a58a4236334a53440213f5ff6c1b67da
kind: function
name: requireInventoryReadAuth
qualified_name: requireInventoryReadAuth
file_path: src/app/api/settings/authz-inventory/route.ts
language: typescript
signature: (request: Request): Promise<Response | null>
docstring:
OQ-5: viewing the inventory requires authentication (dashboard session OR
any valid API key, regardless of scope). The inventory leaks route-prefix
taxonomy + current bypass state (reconnaissance value), so we never expose
it anonymously — but a non-manage key holder may still inspect it.
Compare with `requireManagementAuth` which would refuse anything below the
manage scope; this endpoint is intentionally read-only and one rung lower.


id: import:a07d8b43e832d73f42ec6a40d3737b83
kind: import
name: @omniroute/open-sse/services/backgroundTaskDetector.ts
qualified_name: @omniroute/open-sse/services/backgroundTaskDetector.ts
file_path: src/app/api/settings/background-degradation/route.ts
language: typescript
signature:
import {
  getBackgroundDegradationConfig,
  setBackgroundDegradationConfig,
  resetStats,
} from "@omniroute/open-sse/services/backgroundTaskDetector.ts";


id: constant:1aa162324c4a46fa8b6f49cb4995eff4
kind: constant
name: cacheConfigUpdateSchema
qualified_name: cacheConfigUpdateSchema
file_path: src/app/api/settings/cache-config/route.ts
language: typescript
signature:
= z.object({
  semanticCacheEnabled: z.boolean().optional(),
  semanticCacheMaxSize: z.number().positi...


id: constant:5f9f8c9c472547037b16703f0fc767e0
kind: constant
name: CACHE_CONFIG_KEYS
qualified_name: CACHE_CONFIG_KEYS
file_path: src/app/api/settings/cache-config/route.ts
language: typescript
signature:
= [
  "semanticCacheEnabled",
  "semanticCacheMaxSize",
  "semanticCacheTTL",
  "promptCacheEnabled",
...


id: constant:475beb1c68d4656b6481171e0bcda440
kind: constant
name: DEFAULTS
qualified_name: DEFAULTS
file_path: src/app/api/settings/cache-config/route.ts
language: typescript
signature:
= {
  semanticCacheEnabled: true,
  semanticCacheMaxSize: 100,
  semanticCacheTTL: 1800000,
  promptCa...


id: import:d479415571f68c4e537016e4c6f6d6f6
kind: import
name: @/lib/localDb
qualified_name: @/lib/localDb
file_path: src/app/api/settings/export-json/route.ts
language: typescript
signature:
import {
  getSettings,
  getProviderConnections,
  getProviderNodes,
  getCombos,
  getApiKeys,
} from "@/lib/localDb";


id: import:b82b3df6db04525a4ffa2e0245a02a7e
kind: import
name: @/shared/network/safeOutboundFetch
qualified_name: @/shared/network/safeOutboundFetch
file_path: src/app/api/settings/favicon/route.ts
language: typescript
signature:
import { SAFE_OUTBOUND_FETCH_PRESETS, safeOutboundFetch } from "@/shared/network/safeOutboundFetch";


id: constant:9035ae9b21c6464a368aad87fa21f8ea
kind: constant
name: ALLOWED_IMAGE_TYPES
qualified_name: ALLOWED_IMAGE_TYPES
file_path: src/app/api/settings/favicon/route.ts
language: typescript
signature:
= [
  "image/png",
  "image/x-icon",
  "image/svg+xml",
  "image/gif",
  "image/webp",
  "image/jpeg",...


id: import:08bd2f91263f3c78ad6b76e9b40bff14
kind: import
name: @/lib/db/featureFlags
qualified_name: @/lib/db/featureFlags
file_path: src/app/api/settings/feature-flags/route.ts
language: typescript
signature:
import {
  getFeatureFlagOverrides,
  setFeatureFlagOverride,
  removeFeatureFlagOverride,
  clearAllFeatureFlagOverrides,
} from "@/lib/db/featureFlags";


id: import:53e8fd313a819c470fa0e6835789eaa4
kind: import
name: @omniroute/open-sse/services/ipFilter.ts
qualified_name: @omniroute/open-sse/services/ipFilter.ts
file_path: src/app/api/settings/ip-filter/route.ts
language: typescript
signature:
import {
  configureIPFilter,
  getIPFilterConfig,
  addToBlacklist,
  removeFromBlacklist,
  addToWhitelist,
  removeFromWhitelist,
  tempBanIP,
  removeTempBan,
} from "@omniroute/open-sse/services/ipFilter.ts";


id: import:2c0eaa1a02de4855d82485de94c82fde
kind: import
name: @/lib/memory/settings
qualified_name: @/lib/memory/settings
file_path: src/app/api/settings/memory/route.ts
language: typescript
signature:
import {
  invalidateMemorySettingsCache,
  normalizeMemorySettings,
  toMemorySettingsUpdates,
} from "@/lib/memory/settings";


id: constant:7561c373b4a4e37af856ca23b9f366f4
kind: constant
name: memorySettingsUpdateSchema
qualified_name: memorySettingsUpdateSchema
file_path: src/app/api/settings/memory/route.ts
language: typescript
signature:
= z
  .object({
    enabled: z.boolean().optional(),
    maxTokens: z.number().int().min(0).max(16000)...


id: constant:438b4e9fa7317a42f8b346214dac2056
kind: constant
name: MITM_PORT_ERROR
qualified_name: MITM_PORT_ERROR
file_path: src/app/api/settings/mitm/route.ts
language: typescript
signature:
= "Transparent MITM interception currently requires port 443 because DNS override does not redirect de...


id: constant:ca9bca0a146a976a2f95f9a706009ab7
kind: constant
name: updateMitmSchema
qualified_name: updateMitmSchema
file_path: src/app/api/settings/mitm/route.ts
language: typescript
signature:
= z.object({
  enabled: z.boolean().optional(),
  apiKey: z.string().optional(),
  keyId: z.string().o...


id: import:49df23b1b5ed7f2fa21f0da62bf66824
kind: import
name: @omniroute/open-sse/services/modelDeprecation.ts
qualified_name: @omniroute/open-sse/services/modelDeprecation.ts
file_path: src/app/api/settings/model-aliases/route.ts
language: typescript
signature:
import {
  getAllAliases,
  getCustomAliases,
  getBuiltInAliases,
  setCustomAliases,
  addCustomAlias,
  removeCustomAlias,
} from "@omniroute/open-sse/services/modelDeprecation.ts";


id: import:a437cb876df32ff11437b1c149eb2700
kind: import
name: @/shared/validation/schemas
qualified_name: @/shared/validation/schemas
file_path: src/app/api/settings/model-aliases/route.ts
language: typescript
signature:
import {
  addModelAliasSchema,
  removeModelAliasSchema,
  updateModelAliasesSchema,
} from "@/shared/validation/schemas";


id: import:db4c8dc0e5ccfaefaac8e99a58b95d50
kind: import
name: @/lib/modelsDevSync
qualified_name: @/lib/modelsDevSync
file_path: src/app/api/settings/models-dev/route.ts
language: typescript
signature:
import {
  syncModelsDev,
  getModelsDevPricing,
  getSyncedCapabilities,
  getSyncStatus,
  startPeriodicSync,
  stopPeriodicSync,
} from "@/lib/modelsDevSync";


id: constant:069e88cdfdc10077bbd3f79c6c534cd0
kind: constant
name: modelsDevActionSchema
qualified_name: modelsDevActionSchema
file_path: src/app/api/settings/models-dev/route.ts
language: typescript
signature:
= z.object({
  action: z.enum(["sync", "start", "stop"]),
  dryRun: z.boolean().optional(),
  syncCapa...


id: import:38cbfa1f76b70d1c14f25857f9b9941b
kind: import
name: @/lib/localDb
qualified_name: @/lib/localDb
file_path: src/app/api/settings/oneproxy/route.ts
language: typescript
signature:
import {
  listOneproxyProxies,
  getOneproxyStats,
  deleteOneproxyProxy,
  clearAllOneproxyProxies,
} from "@/lib/localDb";


id: import:d4db3ed9e5d91dd79010961c359a5cba
kind: import
name: @/lib/oneproxySync
qualified_name: @/lib/oneproxySync
file_path: src/app/api/settings/oneproxy/route.ts
language: typescript
signature:
import {
  syncOneproxyProxies,
  getOneproxySyncStatus,
  resetOneproxyCircuitBreaker,
} from "@/lib/oneproxySync";


id: import:5f1566963e0e66bbb37685d593b8900d
kind: import
name: @omniroute/open-sse/services/payloadRules.ts
qualified_name: @omniroute/open-sse/services/payloadRules.ts
file_path: src/app/api/settings/payload-rules/route.ts
language: typescript
signature:
import {
  getPayloadRulesConfig,
  normalizePayloadRulesConfig,
} from "@omniroute/open-sse/services/payloadRules.ts";


id: import:d5fea0d75c85d3bf6d2a0b3339af21fd
kind: import
name: @/lib/localDb
qualified_name: @/lib/localDb
file_path: src/app/api/settings/proxies/route.ts
language: typescript
signature:
import {
  createProxy,
  deleteProxyById,
  getProxyById,
  getProxyWhereUsed,
  listProxies,
  updateProxy,
} from "@/lib/localDb";


id: import:6b9f2cfbd248656f17bc05a76e569f1e
kind: import
name: ../../../../lib/localDb
qualified_name: ../../../../lib/localDb
file_path: src/app/api/settings/proxy/route.ts
language: typescript
signature:
import {
  getProxyConfig,
  setProxyConfig,
  getProxyForLevel,
  deleteProxyForLevel,
  resolveProxyForConnection,
  getProxyAssignments,
  getProxyById,
} from "../../../../lib/localDb";


id: import:fa4fbba911433fb4e35c4e1d7e3bf0da
kind: import
name: @/lib/api/errorResponse
qualified_name: @/lib/api/errorResponse
file_path: src/app/api/settings/proxy/route.ts
language: typescript
signature:
import {
  createErrorResponse,
  createErrorResponseFromUnknown,
  type ApiErrorType,
} from "@/lib/api/errorResponse";


id: function:c7ad1a4694ee60094c6503f4221f8521
kind: function
name: normalizeAndValidateProxy
qualified_name: normalizeAndValidateProxy
file_path: src/app/api/settings/proxy/route.ts
language: typescript
signature:
(
  proxy: ProxyConfigInput | null | undefined,
  pathLabel: string
): ProxyConfigInput | null | undefined


id: import:3ec9ff319f8cd4c8bf7f523e265e25c2
kind: import
name: @omniroute/open-sse/utils/proxyDispatcher.ts
qualified_name: @omniroute/open-sse/utils/proxyDispatcher.ts
file_path: src/app/api/settings/proxy/test/route.ts
language: typescript
signature:
import {
  createProxyDispatcher,
  isSocks5ProxyEnabled,
  proxyConfigToUrl,
  proxyUrlForLogs,
} from "@omniroute/open-sse/utils/proxyDispatcher.ts";


id: import:1d597016c3cde80e1fc0c8429c480ba8
kind: import
name: @/lib/auth/managementPassword
qualified_name: @/lib/auth/managementPassword
file_path: src/app/api/settings/require-login/route.ts
language: typescript
signature:
import {
  hasManagementPasswordConfigured,
  hashManagementPassword,
} from "@/lib/auth/managementPassword";


id: import:83c96b9ea1d1d84ecb0fcc44341a1c6b
kind: import
name: @/lib/auth/managementPassword
qualified_name: @/lib/auth/managementPassword
file_path: src/app/api/settings/route.ts
language: typescript
signature:
import {
  ensurePersistentManagementPasswordHash,
  getStoredManagementPassword,
  hasManagementPasswordConfigured,
  hashManagementPassword,
  verifyManagementPassword,
} from "@/lib/auth/managementPassword";


id: constant:f9ff018e2f63b6d9ad66beaaabb2a43f
kind: constant
name: SECURITY_IMPACTING_KEYS
qualified_name: SECURITY_IMPACTING_KEYS
file_path: src/app/api/settings/route.ts
language: typescript
docstring:
Settings keys whose change broadens attack surface. Spec §Security:
password re-auth is required when any of these is present in a PATCH body.
- `localOnlyManageScopeBypassEnabled` / `localOnlyManageScopeBypassPrefixes`:
  T-011 bypass kill-switch + per-prefix list. Operator must re-confirm
  before broadening the LOCAL_ONLY carve-out.
- `requireLogin`: dashboard login enforcement toggle.
- `newPassword`: password rotation (existing). Handled by the same gate so
  the password-verify only fires ONCE per PATCH.
Note: `mcpEnabled` is NOT gated server-side — the dedicated MCP page
(/dashboard/mcp) toggles it via patchSetting() without a currentPassword
prompt. The Authz section can still prompt client-side for consistency,
but the server accepts the change without re-auth.

signature:
= [
  "localOnlyManageScopeBypassEnabled",
  "localOnlyManageScopeBypassPrefixes",
  "requireLogin",
 ...


id: function:7ccac88c2cb6b96470f4f50538e79111
kind: function
name: deriveAuditActor
qualified_name: deriveAuditActor
file_path: src/app/api/settings/route.ts
language: typescript
signature: (request: Request): Promise<string>
docstring:
Derive an audit actor string from the inbound request. Falls back to
`"dashboard"` for cookie sessions, `"apikey:<id>"` for Bearer API keys,
`"cli"` for CLI machine-token sessions, and `"anonymous"` otherwise. Best
effort — any lookup error degrades to `"unknown"` so the audit row still
carries actor context.


id: function:2bf541d5c1155dc6f10d416f8794dff8
kind: function
name: computeSettingsDiff
qualified_name: computeSettingsDiff
file_path: src/app/api/settings/route.ts
language: typescript
docstring: Build per-key `{before, after}` diff for changed keys (top-level only).
signature:
(
  before: Record<string, unknown>,
  after: Record<string, unknown>,
  candidateKeys: string[]
): Record<string, { before: unknown; after: unknown }>


id: import:40d6eb085390d43b8018936353250847
kind: import
name: @omniroute/open-sse/services/systemPrompt.ts
qualified_name: @omniroute/open-sse/services/systemPrompt.ts
file_path: src/app/api/settings/system-prompt/route.ts
language: typescript
signature:
import {
  setSystemPromptConfig,
  getSystemPromptConfig,
} from "@omniroute/open-sse/services/systemPrompt.ts";


id: import:d7838a7a826d8b15af5e0958d9487776
kind: import
name: @omniroute/open-sse/services/taskAwareRouter.ts
qualified_name: @omniroute/open-sse/services/taskAwareRouter.ts
file_path: src/app/api/settings/task-routing/route.ts
language: typescript
signature:
import {
  getTaskRoutingConfig,
  setTaskRoutingConfig,
  resetTaskRoutingStats,
  getDefaultTaskModelMap,
} from "@omniroute/open-sse/services/taskAwareRouter.ts";


id: import:8039d0d0c1f01fc5756712bc0453c931
kind: import
name: @omniroute/open-sse/services/thinkingBudget.ts
qualified_name: @omniroute/open-sse/services/thinkingBudget.ts
file_path: src/app/api/settings/thinking-budget/route.ts
language: typescript
signature:
import {
  setThinkingBudgetConfig,
  getThinkingBudgetConfig,
  ThinkingMode,
} from "@omniroute/open-sse/services/thinkingBudget.ts";


id: constant:7d3a96ef92578c07ea52f85191f54183
kind: constant
name: updateSkillSchema
qualified_name: updateSkillSchema
file_path: src/app/api/skills/[id]/route.ts
language: typescript
signature:
= z.object({
  enabled: z.boolean().optional(),
  mode: z.enum(["on", "off", "auto"]).optional(),
})


id: constant:a47cbcccf8f7990b727fd9508d6b198a
kind: constant
name: executionSchema
qualified_name: executionSchema
file_path: src/app/api/skills/executions/route.ts
language: typescript
signature:
= z.object({
  skillName: z.string().min(1),
  apiKeyId: z.string().min(1),
  input: z.record(z.string...


id: constant:0ff25d76dc3877bae9ee1262de56ac06
kind: constant
name: installManifestSchema
qualified_name: installManifestSchema
file_path: src/app/api/skills/install/route.ts
language: typescript
signature:
= z.object({
  name: z.string().min(1).max(100),
  version: z
    .string()
    .regex(/^\d+\.\d+\.\d+...


id: constant:bba2c81af61bd113bc397557f7a9a3ce
kind: constant
name: marketplaceInstallSchema
qualified_name: marketplaceInstallSchema
file_path: src/app/api/skills/marketplace/install/route.ts
language: typescript
signature:
= z.object({
  name: z.string().min(1).max(64),
  description: z.string().min(1).max(1024),
  skillMdC...


id: constant:06163c5a289684b759f30c07d8000c63
kind: constant
name: POPULAR_BY_PROVIDER
qualified_name: POPULAR_BY_PROVIDER
file_path: src/app/api/skills/marketplace/route.ts
language: typescript
signature:
= {
  skillsmp: ["web-search", "file-reader", "sql-assistant", "devops-helper", "docs-assistant"],
  s...


id: constant:fd117b8112ca6622bb7fbe7c6152089f
kind: constant
name: skillsshInstallSchema
qualified_name: skillsshInstallSchema
file_path: src/app/api/skills/skillssh/install/route.ts
language: typescript
signature:
= z.object({
  name: z.string().min(1).max(64),
  description: z.string().min(1).max(1024),
  source: ...


id: import:c00fc48d9051966360615092a076ab98
kind: import
name: @/lib/logEnv
qualified_name: @/lib/logEnv
file_path: src/app/api/storage/health/route.ts
language: typescript
signature:
import {
  getAppLogRetentionDays,
  getCallLogRetentionDays,
  getCallLogsTableMaxRows,
  getProxyLogsTableMaxRows,
} from "@/lib/logEnv";


id: import:fb583b25e3b5d05c864d53afb98be6e7
kind: import
name: @/lib/sync/tokens
qualified_name: @/lib/sync/tokens
file_path: src/app/api/sync/tokens/route.ts
language: typescript
signature:
import {
  issueSyncToken,
  listSyncTokenSummaries,
  resolveSyncApiKeyIdFromManagementRequest,
} from "@/lib/sync/tokens";


id: import:301fa7b88523d05709435e785a5882fc
kind: import
name: @/lib/system/autoUpdate
qualified_name: @/lib/system/autoUpdate
file_path: src/app/api/system/version/route.ts
language: typescript
signature:
import {
  ensureGitTagExists,
  getAutoUpdateConfig,
  launchAutoUpdate,
  validateAutoUpdateRuntime,
} from "@/lib/system/autoUpdate";


id: import:22e5ffe81ab48d80d9ece5264b74a81e
kind: import
name: @omniroute/open-sse/services/provider.ts
qualified_name: @omniroute/open-sse/services/provider.ts
file_path: src/app/api/translator/send/route.ts
language: typescript
signature:
import {
  buildProviderUrl,
  buildProviderHeaders,
  detectFormat,
  getTargetFormat,
} from "@omniroute/open-sse/services/provider.ts";


id: import:6bdd1e85d91a11d34dd4824ba432ecd8
kind: import
name: @omniroute/open-sse/services/provider.ts
qualified_name: @omniroute/open-sse/services/provider.ts
file_path: src/app/api/translator/translate/route.ts
language: typescript
signature:
import {
  detectFormat,
  getTargetFormat,
  buildProviderUrl,
  buildProviderHeaders,
} from "@omniroute/open-sse/services/provider.ts";


id: import:6eac5f1a50ee3a5924101c1d0d009f66
kind: import
name: @/lib/cloudflaredTunnel
qualified_name: @/lib/cloudflaredTunnel
file_path: src/app/api/tunnels/cloudflared/route.ts
language: typescript
signature:
import {
  getCloudflaredTunnelStatus,
  startCloudflaredTunnel,
  stopCloudflaredTunnel,
} from "@/lib/cloudflaredTunnel";


id: constant:503dc9637ebe6cf0b856af0b939b499f
kind: constant
name: tailscaleEnableSchema
qualified_name: tailscaleEnableSchema
file_path: src/app/api/tunnels/tailscale/routeUtils.ts
language: typescript
signature:
= z.object({
  sudoPassword: z.string().optional(),
  hostname: z.string().optional(),
  port: z.numbe...


id: import:454eccced7606aeb0b6d4275faa6c925
kind: import
name: @/lib/db/upstreamProxy
qualified_name: @/lib/db/upstreamProxy
file_path: src/app/api/upstream-proxy/[providerId]/route.ts
language: typescript
signature:
import {
  getUpstreamProxyConfig,
  upsertUpstreamProxyConfig,
  deleteUpstreamProxyConfig,
} from "@/lib/db/upstreamProxy";


id: constant:26eca534dde750943caec35ecc81d8e1
kind: constant
name: upstreamProxySchema
qualified_name: upstreamProxySchema
file_path: src/app/api/upstream-proxy/[providerId]/route.ts
language: typescript
signature:
= z.object({
  mode: z.enum(["native", "cliproxyapi", "fallback"]).default("native"),
  enabled: z.boo...


id: function:6cea4400a4160811de568ea65d4ec995
kind: function
name: resolveModelPricing
qualified_name: resolveModelPricing
file_path: src/app/api/usage/analytics/route.ts
language: typescript
signature:
(
  pricingByProvider: PricingByProvider,
  providerAliasMap: Record<string, string>,
  providerRaw: string,
  model: string,
  normalizeModelName: (model: string) => string
): Record<string, unknown> | null


id: function:0122fa5400bdef96656ffc1273224090
kind: function
name: computeUsageRowCost
qualified_name: computeUsageRowCost
file_path: src/app/api/usage/analytics/route.ts
language: typescript
signature:
(
  row: Record<string, unknown>,
  pricingByProvider: PricingByProvider,
  providerAliasMap: Record<string, string>,
  normalizeModelName: (model: string) => string,
  computeCostFromPricing: ComputeCostFromPricing
): number


id: import:0a8da78137b8ce852eab392a5e58e69f
kind: import
name: @/shared/types/utilization
qualified_name: @/shared/types/utilization
file_path: src/app/api/usage/combo-health/route.ts
language: typescript
signature:
import type {
  ComboHealthMetrics,
  ComboHealthResponse,
  QuotaSnapshotRow,
  UtilizationTimeRange,
} from "@/shared/types/utilization";


id: constant:c09fbbddc01135110fc11fcbddeef72d
kind: constant
name: querySchema
qualified_name: querySchema
file_path: src/app/api/usage/combo-health/route.ts
language: typescript
signature:
= z.object({
  range: z.enum(["1h", "24h", "7d", "30d"]),
  comboId: z
    .string()
    .regex(/^[0-9...


id: function:80fb81edc7c0dcddf5028fd0112a9d06
kind: function
name: buildConnectionHealth
qualified_name: buildConnectionHealth
file_path: src/app/api/usage/combo-health/route.ts
language: typescript
signature:
(
  provider: string,
  connectionId: string,
  snapshots: QuotaSnapshotRow[]
): ProviderHealth | null


id: function:0ac41538d60265faaee599d3d37690fb
kind: function
name: buildTargetHealth
qualified_name: buildTargetHealth
file_path: src/app/api/usage/combo-health/route.ts
language: typescript
signature:
(
  comboName: string,
  targets: ResolvedComboTargetView[],
  since: string
): NonNullable<ComboHealthMetrics["targetHealth"]>


id: import:76fe2d35e31f3c2d49ce8c1ba684bf9d
kind: import
name: @/lib/usage/providerLimits
qualified_name: @/lib/usage/providerLimits
file_path: src/app/api/usage/provider-limits/route.ts
language: typescript
signature:
import {
  getCachedProviderLimitsMap,
  getLastProviderLimitsAutoSyncTime,
  getProviderLimitsSyncIntervalMinutes,
  syncAllProviderLimits,
} from "@/lib/usage/providerLimits";


id: import:f4faa6eb0a5844f39269d5a1817b6dbd
kind: import
name: @omniroute/open-sse/services/rateLimitManager.ts
qualified_name: @omniroute/open-sse/services/rateLimitManager.ts
file_path: src/app/api/usage/quota/route.ts
language: typescript
signature:
import {
  getLearnedLimits,
  getRateLimitStatus,
} from "@omniroute/open-sse/services/rateLimitManager.ts";


id: import:213881e0b3854b2ab950d9624b70155c
kind: import
name: @/shared/contracts/quota
qualified_name: @/shared/contracts/quota
file_path: src/app/api/usage/quota/route.ts
language: typescript
signature:
import {
  normalizeQuotaResponse,
  sanitizeQuotaProvider,
  type QuotaProviderEntry,
  type QuotaTokenStatus,
} from "@/shared/contracts/quota";


id: function:0e3e37a5322495c24cdd375f8a4ff39b
kind: function
name: buildQuotaEntry
qualified_name: buildQuotaEntry
file_path: src/app/api/usage/quota/route.ts
language: typescript
signature:
(
  connection: ProviderConnectionRecord,
  learnedLimit: unknown,
  rateStatus: Record<string, unknown>
): QuotaProviderEntry


id: import:251394ba4540b89cea498e190d53c631
kind: import
name: @/shared/types/utilization
qualified_name: @/shared/types/utilization
file_path: src/app/api/usage/utilization/route.ts
language: typescript
signature:
import type { ProviderUtilizationResponse, UtilizationTimeRange } from "@/shared/types/utilization";


id: constant:365e79b4d9ec327ea7052a622ba08f91
kind: constant
name: limitsSchema
qualified_name: limitsSchema
file_path: src/app/api/v1/accounts/[id]/limits/route.ts
language: typescript
signature:
= z.object({
  maxActiveKeys: z.number().int().positive().nullable().optional(),
  dailyIssueLimit: z....


id: import:36763e3fe31df996c65dc58a98c857df
kind: import
name: @/lib/cloudAgent/credentials
qualified_name: @/lib/cloudAgent/credentials
file_path: src/app/api/v1/agents/credentials/route.ts
language: typescript
signature:
import {
  listCloudAgentCredentials,
  saveCloudAgentCredential,
  maskApiKey,
} from "@/lib/cloudAgent/credentials";


id: constant:325a24ab26e9f93b5d4ad24b55479b62
kind: constant
name: SaveCredentialSchema
qualified_name: SaveCredentialSchema
file_path: src/app/api/v1/agents/credentials/route.ts
language: typescript
signature:
= z.object({
  providerId: z.enum(["jules", "devin", "codex-cloud"]),
  apiKey: z.string().min(1),
  b...


id: import:cc659f8ca0ce1e7cde2188c4296c5204
kind: import
name: @/lib/cloudAgent/db
qualified_name: @/lib/cloudAgent/db
file_path: src/app/api/v1/agents/tasks/[id]/route.ts
language: typescript
signature:
import {
  createCloudAgentTaskTable,
  getCloudAgentTaskById,
  updateCloudAgentTask,
  deleteCloudAgentTask,
} from "@/lib/cloudAgent/db";


id: import:df29bb59b98d7f428fe9a16495042845
kind: import
name: @/lib/cloudAgent/api
qualified_name: @/lib/cloudAgent/api
file_path: src/app/api/v1/agents/tasks/[id]/route.ts
language: typescript
signature:
import {
  getCloudAgentCorsHeaders,
  getCloudAgentCredentials,
  requireCloudAgentManagementAuth,
  serializeCloudAgentTask,
} from "@/lib/cloudAgent/api";


id: import:4c352539c2f4bf0c98c53b79558c4420
kind: import
name: @/lib/cloudAgent/db
qualified_name: @/lib/cloudAgent/db
file_path: src/app/api/v1/agents/tasks/route.ts
language: typescript
signature:
import {
  createCloudAgentTaskTable,
  insertCloudAgentTask,
  getAllCloudAgentTasks,
  getCloudAgentTasksByProvider,
  getCloudAgentTasksByStatus,
  deleteCloudAgentTask,
} from "@/lib/cloudAgent/db";


id: import:978a13d8d2d9c3d5642dd72a380ec937
kind: import
name: @omniroute/open-sse/config/audioRegistry.ts
qualified_name: @omniroute/open-sse/config/audioRegistry.ts
file_path: src/app/api/v1/audio/speech/route.ts
language: typescript
signature:
import {
  parseSpeechModel,
  getSpeechProvider,
  buildDynamicAudioProvider,
  type ProviderNodeRow,
} from "@omniroute/open-sse/config/audioRegistry.ts";


id: import:aec7da33d25b88fbb69e64238a5dcabb
kind: import
name: @omniroute/open-sse/config/audioRegistry.ts
qualified_name: @omniroute/open-sse/config/audioRegistry.ts
file_path: src/app/api/v1/audio/transcriptions/route.ts
language: typescript
signature:
import {
  parseTranscriptionModel,
  getTranscriptionProvider,
  buildDynamicAudioProvider,
  type ProviderNodeRow,
} from "@omniroute/open-sse/config/audioRegistry.ts";


id: function:0f179fee784592b78c4637d4129b7a5e
kind: function
name: scopeCheck
qualified_name: scopeCheck
file_path: src/app/api/v1/batches/[id]/route.ts
language: typescript
signature:
(
  scope: { isSessionAuth: boolean; apiKeyId: string | null },
  recordApiKeyId: string | null | undefined
): boolean


id: import:e98ecc99d55bd6634199cf8013af373f
kind: import
name: @omniroute/open-sse/config/embeddingRegistry.ts
qualified_name: @omniroute/open-sse/config/embeddingRegistry.ts
file_path: src/app/api/v1/embeddings/route.ts
language: typescript
signature:
import {
  parseEmbeddingModel,
  getAllEmbeddingModels,
} from "@omniroute/open-sse/config/embeddingRegistry.ts";


id: function:95e9434bc0064092ab4680983de4fba6
kind: function
name: readMultipartImage
qualified_name: readMultipartImage
file_path: src/app/api/v1/images/edits/route.ts
language: typescript
signature:
(formData: FormData): Promise<{
  prompt: string;
  model: string | null;
  size: string | null;
  responseFormat: string | null;
  imageBytes: Buffer | null;
  imageMime: string | null;
}>


id: import:cd7ff4eb93401cb945072355b6c3a0d5
kind: import
name: @/sse/services/auth
qualified_name: @/sse/services/auth
file_path: src/app/api/v1/images/generations/route.ts
language: typescript
signature:
import {
  getProviderCredentials,
  clearRecoveredProviderState,
  extractApiKey,
  isValidApiKey,
} from "@/sse/services/auth";


id: import:aae3365c43545d97d1a94d1b9932b55e
kind: import
name: @omniroute/open-sse/config/imageRegistry.ts
qualified_name: @omniroute/open-sse/config/imageRegistry.ts
file_path: src/app/api/v1/images/generations/route.ts
language: typescript
signature:
import {
  parseImageModel,
  getAllImageModels,
  getImageProvider,
  getImageModelEntry,
} from "@omniroute/open-sse/config/imageRegistry.ts";


id: constant:4667564377f9b27336ce658972b19737
kind: constant
name: PUBLIC_BASE_URL_HEADER_KEYS
qualified_name: PUBLIC_BASE_URL_HEADER_KEYS
file_path: src/app/api/v1/images/generations/route.ts
language: typescript
signature: = ["host", "x-forwarded-host", "x-forwarded-proto"] as const
docstring:
Forward only the host-shaped headers the chatgpt-web image handler needs
to derive the browser-facing public base URL. Avoid copying the full
request header set: it's wider than the handler needs (auth tokens,
content-type, etc.) and `Headers.forEach` collapses repeated values, which
would silently drop entries if a wider helper were reused for headers
that can legitimately repeat (e.g., set-cookie).


id: constant:303e88563921ee67c660cb8f5e482fd8
kind: constant
name: reportSchema
qualified_name: reportSchema
file_path: src/app/api/v1/issues/report/route.ts
language: typescript
signature:
= z.object({
  title: z.string().min(1).max(300),
  provider: z.string().max(80).optional(),
  account...


id: import:1645c702a086d5f47726e95fc6911ed4
kind: import
name: @/lib/localDb
qualified_name: @/lib/localDb
file_path: src/app/api/v1/models/catalog.ts
language: typescript
signature:
import {
  getProviderConnections,
  getCombos,
  getAllCustomModels,
  getSettings,
  getProviderNodes,
  getModelIsHidden,
} from "@/lib/localDb";


id: import:6113d35f5c02bc75306cc83fd8217a2d
kind: import
name: @/lib/modelMetadataRegistry
qualified_name: @/lib/modelMetadataRegistry
file_path: src/app/api/v1/models/catalog.ts
language: typescript
signature:
import {
  INTERNAL_PROXY_ERROR,
  enrichCatalogModelEntry,
  getCanonicalModelMetadata,
  getCatalogDiagnosticsHeaders,
} from "@/lib/modelMetadataRegistry";


id: constant:bb02000abdbfc8931bf1c9e1c673ef07
kind: constant
name: FALLBACK_ALIAS_TO_PROVIDER
qualified_name: FALLBACK_ALIAS_TO_PROVIDER
file_path: src/app/api/v1/models/catalog.ts
language: typescript
signature:
= {
  ag: "antigravity",
  cc: "claude",
  cl: "cline",
  cu: "cursor",
  cx: "codex",
  gc: "gemini-c...


id: constant:59d8e6a489281b020fa38c4ca4bbe683
kind: constant
name: VISION_MODEL_KEYWORDS
qualified_name: VISION_MODEL_KEYWORDS
file_path: src/app/api/v1/models/catalog.ts
language: typescript
signature:
= [
  "gpt-4o",
  "gpt-4.1",
  "gpt-4-vision",
  "gpt-4-turbo",
  "claude-3",
  "claude-3.5",
  "claud...


id: function:2bdf9a4985cf4430a7e9d87bc05fec81
kind: function
name: getModelCatalogAuthRejection
qualified_name: getModelCatalogAuthRejection
file_path: src/app/api/v1/models/catalog.ts
language: typescript
signature:
(
  request: Request,
  settings: Record<string, any>,
  headers: Record<string, string>
): Promise<Response | null>


id: import:5a94792eae93d651d8d0283d788845d7
kind: import
name: @omniroute/open-sse/config/musicRegistry.ts
qualified_name: @omniroute/open-sse/config/musicRegistry.ts
file_path: src/app/api/v1/music/generations/route.ts
language: typescript
signature:
import {
  parseMusicModel,
  getAllMusicModels,
  getMusicProvider,
} from "@omniroute/open-sse/config/musicRegistry.ts";


id: constant:d05e11dc63a3ea02bd492183c66f88dd
kind: constant
name: issueKeySchema
qualified_name: issueKeySchema
file_path: src/app/api/v1/registered-keys/route.ts
language: typescript
docstring: ─── Validation ───────────────────────────────────────────────────────────────
signature:
= z.object({
  name: z.string().min(1).max(120),
  provider: z.string().max(80).optional().default("")...


id: function:50f0444f63322e75b2b8b88e0dd10cf7
kind: function
name: buildDynamicRerankProvider
qualified_name: buildDynamicRerankProvider
file_path: src/app/api/v1/rerank/route.ts
language: typescript
signature: (node: any)
docstring:
Build dynamic rerank provider from a local provider_node.
Local OpenAI-compatible backends (oMLX, vLLM, etc.) expose /v1/rerank
under the same base URL as chat.


id: import:8e76b7f4d41a11f9e60919a9f0fc1150
kind: import
name: @omniroute/open-sse/config/searchRegistry.ts
qualified_name: @omniroute/open-sse/config/searchRegistry.ts
file_path: src/app/api/v1/search/route.ts
language: typescript
signature:
import {
  getAllSearchProviders,
  getSearchProvider,
  selectProvider,
  supportsSearchType,
  SEARCH_PROVIDERS,
  SEARCH_CREDENTIAL_FALLBACKS,
} from "@omniroute/open-sse/config/searchRegistry.ts";


id: import:f177fcc816fd9ba9f3d9005478549c10
kind: import
name: @omniroute/open-sse/services/searchCache.ts
qualified_name: @omniroute/open-sse/services/searchCache.ts
file_path: src/app/api/v1/search/route.ts
language: typescript
signature:
import {
  computeCacheKey,
  getOrCoalesce,
  SEARCH_CACHE_DEFAULT_TTL_MS,
} from "@omniroute/open-sse/services/searchCache.ts";


id: constant:eb7f1642eebcfd8c5041f1a72a6b3701
kind: constant
name: CORS_HEADERS
qualified_name: CORS_HEADERS
file_path: src/app/api/v1/search/route.ts
language: typescript
signature:
= {
  "Access-Control-Allow-Methods": "GET, POST, OPTIONS",
  "Access-Control-Allow-Headers": "*",
}


id: import:fb9081d03074d2eeb152c9bf8e2935bb
kind: import
name: @omniroute/open-sse/config/videoRegistry.ts
qualified_name: @omniroute/open-sse/config/videoRegistry.ts
file_path: src/app/api/v1/videos/generations/route.ts
language: typescript
signature:
import {
  parseVideoModel,
  getAllVideoModels,
  getVideoProvider,
} from "@omniroute/open-sse/config/videoRegistry.ts";


id: constant:0ae9ccde081d47f8365c4586d91d29cb
kind: constant
name: WS_PROTOCOL
qualified_name: WS_PROTOCOL
file_path: src/app/api/v1/ws/route.ts
language: typescript
signature:
= {
  request: {
    type: "request",
    id: "req-1",
    payload: { model: "openai/gpt-4.1-mini", me...


id: import:1f198c461a5f8bcdfc46b7176b367470
kind: import
name: @/lib/db/models
qualified_name: @/lib/db/models
file_path: src/app/api/v1beta/models/route.ts
language: typescript
signature:
import {
  getAllCustomModels,
  getAllSyncedAvailableModels,
  getSyncedAvailableModels,
} from "@/lib/db/models";


id: function:308d604321fea0a25f966a9aa6b1531e
kind: function
name: getActiveProviderKeys
qualified_name: getActiveProviderKeys
file_path: src/app/api/v1beta/models/route.ts
language: typescript
signature: (): Promise<Set<string>>
docstring:
Build the set of provider keys (raw id + alias) that have at least one active/validated
connection. Mirrors the active-provider filter used by the OpenAI-format /v1/models
catalog so /v1beta/models only lists models the user can actually call (#2483).


id: constant:9638054dbd48e3d60229eb7199af95fa
kind: constant
name: updateWebhookSchema
qualified_name: updateWebhookSchema
file_path: src/app/api/webhooks/[id]/route.ts
language: typescript
signature:
= z
  .object({
    url: z.string().url("Invalid URL format").max(2000).optional(),
    events: z.arra...


id: constant:1852f9412c5eeb4e89f4a27c1aba2842
kind: constant
name: createWebhookSchema
qualified_name: createWebhookSchema
file_path: src/app/api/webhooks/route.ts
language: typescript
signature:
= z.object({
  url: z.string().url("Invalid URL format").max(2000),
  events: z.array(z.string()).opti...


id: function:49e30d9f47f739763b3fff4a6778230f
kind: function
name: tryI18nFallback
qualified_name: tryI18nFallback
file_path: src/app/docs/[...slug]/page.tsx
language: tsx
signature: (slug: string[], locale: string): string | null
docstring:
── i18n fallback ───────────────────────────────────────────────────────────
When locale ≠ "en", try to load the translated .md from
`docs/i18n/<locale>/docs/<section>/<FILE>.md` — the exact path layout that
`scripts/i18n/run-translation.mjs` produces. Returns rendered HTML or null.


id: constant:0d65fbb30f6d61dc804f987651bae09e
kind: constant
name: metadata
qualified_name: metadata
file_path: src/app/docs/api-explorer/page.tsx
language: tsx
signature:
= {
  title: "API Explorer — OmniRoute Docs",
  description: "Interactive API explorer — try OmniRoute...


id: import:8c4b21ada14ed3390c4c01ebd8c4eabc
kind: import
name: ../lib/openapi.generated
qualified_name: ../lib/openapi.generated
file_path: src/app/docs/components/ApiExplorerClient.tsx
language: tsx
signature:
import {
  OPENAPI_ENDPOINTS,
  OPENAPI_TAGS,
  OPENAPI_VERSION,
  type OpenApiEndpoint,
} from "../lib/openapi.generated";


id: constant:f8cbf24bde2a4a3ffb5bc178cb5671b9
kind: constant
name: METHOD_COLORS
qualified_name: METHOD_COLORS
file_path: src/app/docs/components/ApiExplorerClient.tsx
language: tsx
signature:
= {
  GET: "bg-emerald-500/10 text-emerald-600 border-emerald-500/20",
  POST: "bg-blue-500/10 text-bl...


id: constant:fe62d79acae694d2c341a25c06205d73
kind: constant
name: EXAMPLE_BODIES
qualified_name: EXAMPLE_BODIES
file_path: src/app/docs/components/ApiExplorerClient.tsx
language: tsx
docstring:
A small map of richer "Try It" example bodies keyed by full path. The
generated OpenAPI module exposes every endpoint with its description and
summary; only paths in this map get a non-empty default request body when
selected. Anything not listed here falls back to the empty placeholder
(the user can paste their own body).

signature:
= {
  "/api/v1/chat/completions": JSON.stringify(
    {
      model: "openai/gpt-4o-mini",
      messa...


id: constant:d5028688bf99d71a21cccc80247df096
kind: constant
name: metadata
qualified_name: metadata
file_path: src/app/docs/layout.tsx
language: tsx
signature:
= {
  title: {
    template: "%s — OmniRoute Docs",
    default: "OmniRoute Documentation",
  },
  des...


id: constant:251df6edc27a336da6118063a333c66e
kind: constant
name: docsLayoutOptions
qualified_name: docsLayoutOptions
file_path: src/app/docs/layout.tsx
language: tsx
signature:
= {
  nav: {
    title: "OmniRoute Docs",
    url: "/docs",
    children: (
      <Suspense fallback={...


id: constant:5fa2389f2e414c0e61404763caac70a3
kind: constant
name: OPENAPI_ENDPOINTS
qualified_name: OPENAPI_ENDPOINTS
file_path: src/app/docs/lib/openapi.generated.ts
language: typescript
signature:
= [
  {
    path: "/api/v1",
    method: "GET",
    summary: "API v1 root endpoint",
    description: ...


id: constant:897486ee25ae66bb0620aecbb9aee1a3
kind: constant
name: metadata
qualified_name: metadata
file_path: src/app/docs/page.tsx
language: tsx
signature:
= {
  title: "OmniRoute Documentation",
  description:
    "Everything you need to route, compress, an...


id: constant:245659d6c4c63cb0a965307dddd7259d
kind: constant
name: featuredLinks
qualified_name: featuredLinks
file_path: src/app/docs/page.tsx
language: tsx
signature:
= [
  {
    href: "/docs/guides/setup-guide",
    title: "Setup Guide",
    icon: "rocket_launch",
   ...


id: constant:5bb95c3a90505f9d16363a1c07c132fc
kind: constant
name: sections
qualified_name: sections
file_path: src/app/docs/page.tsx
language: tsx
signature:
= [
  { title: "Architecture", folder: "architecture" },
  { title: "Guides", folder: "guides" },
  { ...


id: interface:1cedb7078c14aed6b0d35c8c0343b93f
kind: interface
name: ErrorProps
qualified_name: ErrorProps
file_path: src/app/error.tsx
language: tsx
docstring:
Server Error Page — P-1
Per-page error boundary for unrecoverable errors within the
dashboard layout. Falls back to global-error.tsx if this fails.


id: interface:605cbb6bd7cc7b55606d294155eb143e
kind: interface
name: GlobalErrorProps
qualified_name: GlobalErrorProps
file_path: src/app/global-error.tsx
language: tsx
docstring:
Global Error Page — FASE-04 Error Handling
Root-level error boundary for unrecoverable errors.
This is the last resort — catches errors that the per-page
error.js boundaries don't handle.


id: constant:0f25b228c3e249ed87cce454893b0aae
kind: constant
name: FEATURES
qualified_name: FEATURES
file_path: src/app/landing/components/Features.tsx
language: tsx
signature:
= [
  {
    icon: "link",
    titleKey: "featureUnifiedEndpointTitle",
    descKey: "featureUnifiedEnd...


id: import:2bf0c617430e46957030ee42ec086750
kind: import
name: ./types
qualified_name: ./types
file_path: src/domain/assessment/assessor.ts
language: typescript
signature:
import type {
  ModelAssessment,
  AssessmentStatus,
  ProbeLevel,
  AssessmentConfig,
  AssessmentRun,
  AssessmentScope,
  AssessmentTrigger,
} from "./types";


id: method:6395a2f560143212e2e770f18cb54c09
kind: method
name: constructor
qualified_name: Assessor::constructor
file_path: src/domain/assessment/assessor.ts
language: typescript
signature:
(
    apiKey: string,
    baseUrl: string = "http://localhost:20128/v1",
    config: Partial<AssessmentConfig> = {}
  )


id: method:2d6e49ab3d1923c0f33ccdba5a882a46
kind: method
name: probeModel
qualified_name: Assessor::probeModel
file_path: src/domain/assessment/assessor.ts
language: typescript
signature:
(
    providerId: string,
    modelId: string,
    level: ProbeLevel = "quick"
  ): Promise<ProbeResult>


id: method:d8053d2d0d7dbac3a5980d68adc25362
kind: method
name: runAssessment
qualified_name: Assessor::runAssessment
file_path: src/domain/assessment/assessor.ts
language: typescript
signature:
(
    models: Array<{ providerId: string; modelId: string }>,
    trigger: AssessmentTrigger = "on_demand"
  ): Promise<AssessmentRun>


id: constant:a933da7af97652a180812bf20f02614a
kind: constant
name: CATEGORY_WEIGHTS
qualified_name: CATEGORY_WEIGHTS
file_path: src/domain/assessment/categorizer.ts
language: typescript
signature:
= {
  coding: { tier: 0.4, speed: 0.3, success: 0.2, cost: 0.1 },
  reasoning: { tier: 0.5, success: 0...


id: constant:f42dda4a91fc2e68b1e493488bbb48b2
kind: constant
name: MODEL_PATTERNS
qualified_name: MODEL_PATTERNS
file_path: src/domain/assessment/categorizer.ts
language: typescript
signature:
= [
  {
    pattern: /opus|o[1-4]/i,
    categories: ["reasoning_deep", "coding", "reasoning"],
    ti...


id: constant:202f729fcde64ad8f2b0aa0a72f431d8
kind: constant
name: MIGRATION_SQL
qualified_name: MIGRATION_SQL
file_path: src/domain/assessment/migration.ts
language: typescript
signature:
= `
-- Model assessments: probe results for each provider/model pair
CREATE TABLE IF NOT EXISTS model_...


id: import:870ada94a29309ab8cce183f8a2526e8
kind: import
name: ./types
qualified_name: ./types
file_path: src/domain/assessment/selfHealer.ts
language: typescript
signature:
import type {
  ModelAssessment,
  ComboHealth,
  HealAction,
  HealActionType,
  AssessmentConfig,
  AutoComboTemplate,
} from "./types";


id: method:ee1fe03f8a39ad6585683d4760ea5d92
kind: method
name: healCombo
qualified_name: SelfHealer::healCombo
file_path: src/domain/assessment/selfHealer.ts
language: typescript
signature:
(
    combo: Combo,
    assessments: Map<string, ModelAssessment>
  ): {
    combo: Combo;
    actions: HealAction[];
    health: ComboHealth;
  }


id: method:395833ffde2d3942dcdd65fefa0da501
kind: method
name: generateCombosFromAssessments
qualified_name: SelfHealer::generateCombosFromAssessments
file_path: src/domain/assessment/selfHealer.ts
language: typescript
signature:
(
    assessments: Map<string, ModelAssessment>,
    templates: AutoComboTemplate[] = AUTO_COMBO_TEMPLATES
  ): Array<{ template: AutoComboTemplate; models: ComboModel[] }>


id: method:ef1b721fa89000301457801a16e82ae3
kind: method
name: createAction
qualified_name: SelfHealer::createAction
file_path: src/domain/assessment/selfHealer.ts
language: typescript
visibility: private
signature:
(
    comboId: string,
    actionType: HealActionType,
    modelId: string,
    providerId: string,
    reason: string
  ): HealAction


id: constant:f57d7360310867a61a65b99d3e35c3e9
kind: constant
name: DEFAULT_ASSESSMENT_CONFIG
qualified_name: DEFAULT_ASSESSMENT_CONFIG
file_path: src/domain/assessment/types.ts
language: typescript
signature:
= {
  quickProbeIntervalMs: 5 * 60 * 1000, // 5 minutes
  standardProbeIntervalMs: 30 * 60 * 1000, // ...


id: constant:871e4f917b63f0d43db2350e3cb3e128
kind: constant
name: PROBE_MESSAGES
qualified_name: PROBE_MESSAGES
file_path: src/domain/assessment/types.ts
language: typescript
signature:
= {
  quick: [{ role: "user" as const, content: "ok" }],
  standard: [
    {
      role: "user" as con...


id: constant:835f58e01f37e4eaf3a1b856208fcc75
kind: constant
name: AUTO_COMBO_TEMPLATES
qualified_name: AUTO_COMBO_TEMPLATES
file_path: src/domain/assessment/types.ts
language: typescript
signature:
= [
  {
    name: "auto/best-coding",
    displayName: "Best Coding",
    categories: ["coding"],
    ...


id: variable:4beb934f1ac18280f5150e0956015347
kind: variable
name: auditLog
qualified_name: auditLog
file_path: src/domain/configAudit.ts
language: typescript
signature: = []
docstring:
── In-memory store ──────────────────────────────────────────────────────────
In production, persist to SQLite alongside other domain state.


id: function:0224bba57503993f5b33ed8b51d14e42
kind: function
name: recordChange
qualified_name: recordChange
file_path: src/domain/configAudit.ts
language: typescript
signature:
(
  action: AuditAction,
  target: AuditTarget,
  targetId: string,
  targetName: string,
  before: Record<string, unknown> | null,
  after: Record<string, unknown> | null,
  source: AuditSource,
  note?: string | null
): ConfigAuditEntry


id: function:e56bbd24afee6d204193eeb9fb63ca51
kind: function
name: getAuditLog
qualified_name: getAuditLog
file_path: src/domain/configAudit.ts
language: typescript
signature:
(options?: {
  target?: AuditTarget;
  targetId?: string;
  action?: AuditAction;
  source?: AuditSource;
  since?: string; // ISO date
  limit?: number;
  offset?: number;
}): { entries: ConfigAuditEntry[]; total: number }


id: function:3770f0f7381f1b229f030c12340ebac8
kind: function
name: getAuditSummary
qualified_name: getAuditSummary
file_path: src/domain/configAudit.ts
language: typescript
signature:
(): {
  totalEntries: number;
  byTarget: Record<string, number>;
  byAction: Record<string, number>;
  bySource: Record<string, number>;
  oldestEntry: string | null;
  newestEntry: string | null;
}


id: import:ed1a079554a152154bb5544ba0bf4a33
kind: import
name: ../lib/db/domainState
qualified_name: ../lib/db/domainState
file_path: src/domain/costRules.ts
language: typescript
signature:
import {
  deleteAllCostData,
  deleteBudget as dbDeleteBudget,
  deleteCostEntries,
  loadAllBudgets,
  loadBudget,
  loadCostEntries,
  loadCostEntriesInRange,
  loadCostTotal,
  saveBudget,
  saveBudgetResetLog,
} from "../lib/db/domainState";


id: import:6cc82f91f91522097097dd5afbe820b9
kind: import
name: @/lib/spend/batchWriter
qualified_name: @/lib/spend/batchWriter
file_path: src/domain/costRules.ts
language: typescript
signature:
import {
  discardSpendBatchEntries,
  resetSpendBatchWriterForTests,
  spendBatchWriter,
} from "@/lib/spend/batchWriter";


id: function:3f6d313e0164ee1995b416e13ee3eb32
kind: function
name: emitBudgetWarning
qualified_name: emitBudgetWarning
file_path: src/domain/costRules.ts
language: typescript
signature:
(
  apiKeyId: string,
  budget: NormalizedBudgetConfig,
  projectedTotal: number,
  activeLimitUsd: number,
  nextResetAt: number
)


id: function:fdd0d3b7c453b69bb21a0b50782b83c5
kind: function
name: syncBudgetSchedule
qualified_name: syncBudgetSchedule
file_path: src/domain/costRules.ts
language: typescript
signature:
(
  apiKeyId: string,
  config: BudgetConfig,
  now = Date.now(),
  options: SyncBudgetScheduleOptions = {}
): NormalizedBudgetConfig


id: function:41520b085bd38c78dc2efb77134a043e
kind: function
name: withDegradation
qualified_name: withDegradation
file_path: src/domain/degradation.ts
language: typescript
signature:
(
  feature: string,
  primary: () => T | Promise<T>,
  fallback: () => T | Promise<T>,
  safeDefault: T,
  options?: {
    /** Description of full capability */
    fullCapability?: string;
    /** Description of reduced capability */
    reducedCapability?: string;
    /** Description of default capability */
    defaultCapability?: string;
    /** Log function for degradation events */
    onDegrade?: (status: DegradationStatus) => void;
  }
): Promise<DegradedResult<T>>


id: function:934b522b3702e73c8dd51046654ef5de
kind: function
name: withDegradationSync
qualified_name: withDegradationSync
file_path: src/domain/degradation.ts
language: typescript
signature:
(
  feature: string,
  primary: () => T,
  fallback: () => T,
  safeDefault: T,
  options?: {
    fullCapability?: string;
    reducedCapability?: string;
    defaultCapability?: string;
    onDegrade?: (status: DegradationStatus) => void;
  }
): DegradedResult<T>


id: import:1ef96058ba147c9ce830c288af32a00e
kind: import
name: ../lib/db/domainState
qualified_name: ../lib/db/domainState
file_path: src/domain/fallbackPolicy.ts
language: typescript
signature:
import {
  saveFallbackChain,
  loadFallbackChain,
  loadAllFallbackChains,
  deleteFallbackChain,
  deleteAllFallbackChains,
} from "../lib/db/domainState";


id: constant:940de4ddaae6123021b38d2ab61d81ae
kind: constant
name: fallbackChains
qualified_name: fallbackChains
file_path: src/domain/fallbackPolicy.ts
language: typescript
signature: = new Map()
docstring:
@typedef {Object} FallbackEntry
@property {string} provider - Provider ID
@property {number} [priority=0] - Lower = higher priority
@property {boolean} [enabled=true] - Whether this fallback is active
@type {Map<string, FallbackEntry[]>} In-memory cache backed by SQLite


id: import:88c06db211b6a39df7083c20e6690781
kind: import
name: ../lib/db/domainState
qualified_name: ../lib/db/domainState
file_path: src/domain/lockoutPolicy.ts
language: typescript
signature:
import {
  saveLockoutState,
  loadLockoutState,
  deleteLockoutState,
  loadAllLockedIdentifiers,
} from "../lib/db/domainState";


id: constant:fdeaac8c057cefa5fb0a1e60fb0e2ed7
kind: constant
name: lockoutCache
qualified_name: lockoutCache
file_path: src/domain/lockoutPolicy.ts
language: typescript
signature: = new Map()
docstring:
@typedef {Object} LockoutConfig
@property {number} [maxAttempts=5] - Max failed attempts before lockout
@property {number} [lockoutDurationMs=900000] - Lockout duration (15 min default)
@property {number} [attemptWindowMs=300000] - Window for counting attempts (5 min)
@type {Map<string, { attempts: number[], lockedUntil: number|null }>} In-memory cache


id: constant:2cb0a3f79123e8afffbafeae77b369b9
kind: constant
name: DEFAULT_CONFIG
qualified_name: DEFAULT_CONFIG
file_path: src/domain/lockoutPolicy.ts
language: typescript
docstring: @type {LockoutConfig}
signature:
= {
  maxAttempts: 5,
  lockoutDurationMs: 15 * 60 * 1000, // 15 minutes
  attemptWindowMs: 5 * 60 * 1...


id: function:74439a9340ba82122014a9ddc9fdb6ea
kind: function
name: getState
qualified_name: getState
file_path: src/domain/lockoutPolicy.ts
language: typescript
signature: (identifier)
docstring:
Load state from DB into cache if not already cached.
@param {string} identifier
@returns {{ attempts: number[], lockedUntil: number|null }}


id: function:88601c84b7dac8b733294ff0e55ebc1d
kind: function
name: persistState
qualified_name: persistState
file_path: src/domain/lockoutPolicy.ts
language: typescript
signature: (identifier, state)
docstring:
Persist state to both cache and DB.
@param {string} identifier
@param {{ attempts: number[], lockedUntil: number|null }} state


id: import:9a5bbf564ede9ed18f9bba29b92519f2
kind: import
name: @omniroute/open-sse/services/accountFallback
qualified_name: @omniroute/open-sse/services/accountFallback
file_path: src/domain/modelAvailability.ts
language: typescript
signature:
import {
  getAllModelLockouts,
  clearModelLock,
  type ModelLockoutInfo,
} from "@omniroute/open-sse/services/accountFallback";


id: function:f4d6cf5f7beced166b1da45c11c3fcab
kind: function
name: buildOmniRouteResponseMetaHeaders
qualified_name: buildOmniRouteResponseMetaHeaders
file_path: src/domain/omnirouteResponseMeta.ts
language: typescript
signature:
({
  cacheHit = false,
  costUsd = 0,
  latencyMs = 0,
  model = null,
  provider = null,
  usage = null,
}: {
  cacheHit?: boolean;
  costUsd?: unknown;
  latencyMs?: unknown;
  model?: string | null;
  provider?: string | null;
  usage?: UsageLike;
}): Record<string, string>


id: constant:dfce12549d44796ecd0302fa32af3311
kind: constant
name: TASK_STAGES
qualified_name: TASK_STAGES
file_path: src/domain/pipeline.ts
language: typescript
docstring:
---------------------------------------------------------------------------
Pipeline templates per task type
---------------------------------------------------------------------------

signature:
= {
  code: [
    { name: "plan", fitnessTier: "best-reasoning" },
    { name: "execute", fitnessTier:...


id: function:2bf85054d24e6395cb6efbea1ed62c1e
kind: function
name: executeStage
qualified_name: executeStage
file_path: src/domain/pipeline.ts
language: typescript
docstring:
---------------------------------------------------------------------------
Pipeline execution
---------------------------------------------------------------------------

signature:
(
  stage: PipelineStage,
  request: string,
  context: Record<string, string>,
  executor: StageExecutor
): Promise<StageResult>


id: constant:1081e8e8aafb909e97f1c847f98723ea
kind: constant
name: STAGE_PROMPTS
qualified_name: STAGE_PROMPTS
file_path: src/domain/prompts.ts
language: typescript
signature:
= {
  plan: {
    system: [
      "You are a planning assistant. Analyze the user's request and produc...


id: constant:86d4c1df5266847bd601e2d61b0d1beb
kind: constant
name: expirations
qualified_name: expirations
file_path: src/domain/providerExpiration.ts
language: typescript
signature: = new Map<string, ProviderExpiration>()
docstring:
── In-memory store ──────────────────────────────────────────────────────────
In production, this would be persisted to SQLite alongside other domain state.
Using in-memory Map for the initial implementation.


id: function:fa519b8ace56c2c4cbf4a17fd42b8525
kind: function
name: setExpiration
qualified_name: setExpiration
file_path: src/domain/providerExpiration.ts
language: typescript
signature:
(
  connectionId: string,
  provider: string,
  connectionName: string,
  expiresAt: string | null,
  expiryType: ExpiryType,
  options?: { alertDays?: number; note?: string | null }
): ProviderExpiration


id: function:d052a6305ed73cb11c9360770007ae0e
kind: function
name: detectExpirationFromResponse
qualified_name: detectExpirationFromResponse
file_path: src/domain/providerExpiration.ts
language: typescript
signature:
(
  provider: string,
  status: number,
  headers: Record<string, string>
): { expiresAt: string; expiryType: ExpiryType } | null


id: function:238c41ed1e593dbb57737f1398711445
kind: function
name: advancedWindowResetAt
qualified_name: advancedWindowResetAt
file_path: src/domain/quotaCache.ts
language: typescript
signature: (entry: QuotaCacheEntry, now: number): { exhausted: false } | null
docstring:
T08 — Auto-advance quota window.
If we know the window duration, advance past the expired window(s) to
avoid blocking requests when the quota reset already happened but the
background refresh hasn't run yet.


id: function:d02de76f5065dc2965eb82af61b60a7b
kind: function
name: getQuotaWindowStatus
qualified_name: getQuotaWindowStatus
file_path: src/domain/quotaCache.ts
language: typescript
signature:
(
  connectionId: string,
  windowName: string,
  thresholdPercent = DEFAULT_QUOTA_THRESHOLD_PERCENT
): QuotaWindowStatus | null


id: function:9a4432584011702d296ac7d2494e46a9
kind: function
name: matchesRoutingTags
qualified_name: matchesRoutingTags
file_path: src/domain/tagRouter.ts
language: typescript
signature:
(
  connectionTags: string[],
  requestTags: string[],
  matchMode: RoutingTagMatchMode = "any"
): boolean


id: function:d371b87d49117ccb0c939d341d678824
kind: function
name: resolveRequestRoutingTags
qualified_name: resolveRequestRoutingTags
file_path: src/domain/tagRouter.ts
language: typescript
signature:
(body: Record<string, unknown> | null | undefined): {
  tags: string[];
  matchMode: RoutingTagMatchMode;
}


id: constant:984a0adbc714ef1951d8cd06154c326f
kind: constant
name: LANGUAGES
qualified_name: LANGUAGES
file_path: src/i18n/config.ts
language: typescript
signature:
= config.locales.map((entry) => ({
  code: entry.code as Locale,
  label: entry.label,
  name: entry.n...


id: constant:7c460181cc0e5385bdf6d9a6cab83ef8
kind: constant
name: DOCS_TARGET_LOCALES
qualified_name: DOCS_TARGET_LOCALES
file_path: src/i18n/config.ts
language: typescript
signature:
= LANGUAGES.map((l) => l.code).filter(
  (code) => !(config.docsExcluded ?? []).includes(code)
) as re...


id: function:1cee87d12089131d16842fa865c6cccb
kind: function
name: getRandomBytes
qualified_name: getRandomBytes
file_path: src/instrumentation-node.ts
language: typescript
signature: (byteLength: number): Uint8Array
docstring:
Node.js-only instrumentation logic.
Separated from instrumentation.ts so that Turbopack's Edge bundler
does not trace into Node.js-only modules (fs, path, os, better-sqlite3, etc.)
and emit spurious "not supported in Edge Runtime" warnings.


id: function:a91395aeebf7f7fa027879c69590ffbb
kind: function
name: getDecisionStats
qualified_name: getDecisionStats
file_path: src/lib/a2a/routingLogger.ts
language: typescript
signature:
(): {
  total: number;
  successRate: number;
  avgLatencyMs: number;
  topProviders: Array<{ provider: string; count: number }>;
}


id: import:2d4d3072bc2056cf3fdc38f57cc924ab
kind: import
name: @/shared/constants/providers
qualified_name: @/shared/constants/providers
file_path: src/lib/a2a/skills/providerDiscovery.ts
language: typescript
signature:
import {
  AI_PROVIDERS,
  AUDIO_ONLY_PROVIDERS,
  EMBEDDING_RERANK_PROVIDER_IDS,
  IMAGE_ONLY_PROVIDER_IDS,
  LOCAL_PROVIDERS,
  SEARCH_PROVIDERS,
  VIDEO_PROVIDER_IDS,
} from "@/shared/constants/providers";


id: constant:fdc232c17cfa6c02efc52c4efb523807
kind: constant
name: SSE_HEADERS
qualified_name: SSE_HEADERS
file_path: src/lib/a2a/streaming.ts
language: typescript
signature:
= {
  "Content-Type": "text/event-stream",
  "Cache-Control": "no-cache, no-transform",
  Connection: ...


id: function:a3a2c1d8f175bd9e7fc63b093cf61b01
kind: function
name: createA2AStream
qualified_name: createA2AStream
file_path: src/lib/a2a/streaming.ts
language: typescript
signature:
(
  task: A2ATask,
  executeSkill: (
    task: A2ATask
  ) => Promise<{ artifacts: Array<{ content: string }>; metadata: Record<string, unknown> }>,
  abortSignal?: AbortSignal,
  lifecycle?: {
    onStart?: () => void;
    onEnd?: () => void;
  }
): ReadableStream<Uint8Array>


id: constant:78d7b7b039d9e11abd113df11a6395f6
kind: constant
name: A2A_SKILL_HANDLERS
qualified_name: A2A_SKILL_HANDLERS
file_path: src/lib/a2a/taskExecution.ts
language: typescript
signature:
= {
  "smart-routing": async (task) => {
    const skillModule = await import("./skills/smartRouting")...


id: constant:4a40309d16ee44aa208484d47f764b02
kind: constant
name: VALID_TRANSITIONS
qualified_name: VALID_TRANSITIONS
file_path: src/lib/a2a/taskManager.ts
language: typescript
docstring: ============ Valid Transitions ============
signature:
= {
  submitted: ["working", "failed", "cancelled"],
  working: ["completed", "failed", "cancelled"],
...


id: method:432c754c5114b2f4ef2b81d5fc7563dd
kind: method
name: updateTask
qualified_name: A2ATaskManager::updateTask
file_path: src/lib/a2a/taskManager.ts
language: typescript
signature:
(
    taskId: string,
    state: TaskState,
    artifacts?: TaskArtifact[],
    message?: string
  ): A2ATask


id: method:fc3843365d3662d1bb3e8ef91b0d24fb
kind: method
name: spawn
qualified_name: AcpManager::spawn
file_path: src/lib/acp/manager.ts
language: typescript
docstring: Spawn a new CLI agent process.
signature:
(
    agentId: string,
    binary: string,
    args: string[] = [],
    env: Record<string, string> = {}
  ): AcpSession


id: method:d63ab064dad0dd3a937a832f1698a967
kind: method
name: sendPrompt
qualified_name: AcpManager::sendPrompt
file_path: src/lib/acp/manager.ts
language: typescript
signature: (sessionId: string, prompt: string, timeoutMs: number = 120000): Promise<string>
docstring:
Send a prompt to a CLI agent and collect the response.
This is a higher-level method that handles the send/receive cycle.


id: constant:dd0cddedc37c71fc5cafd5135145e044
kind: constant
name: AGENT_DEFINITIONS
qualified_name: AGENT_DEFINITIONS
file_path: src/lib/acp/registry.ts
language: typescript
docstring: Registry of known CLI agents that support ACP or similar protocols.
signature:
= [
  {
    id: "codex",
    name: "OpenAI Codex CLI",
    binary: "codex",
    versionCommand: "codex...


id: variable:eb613fe6b59c23901ff90b2727853232
kind: variable
name: _cachedAgents
qualified_name: _cachedAgents
file_path: src/lib/acp/registry.ts
language: typescript
signature: = null
docstring:
---------------------------------------------------------------------------
Detection cache (60 seconds)
---------------------------------------------------------------------------


id: function:131c7232e9e122743f87bc21754af4fd
kind: function
name: resolveVersionProbe
qualified_name: resolveVersionProbe
file_path: src/lib/acp/registry.ts
language: typescript
signature:
(
  binary: string,
  versionCommand: string,
  requireBinaryMatch = false
): { command: string; args: string[] } | null


id: import:2c91ceb22f33d8b3a85a00368719fc22
kind: import
name: @/shared/constants/managementScopes
qualified_name: @/shared/constants/managementScopes
file_path: src/lib/api/requireManagementAuth.ts
language: typescript
signature:
import {
  MANAGE_SCOPE,
  hasManageScope as hasManageScopeShared,
} from "@/shared/constants/managementScopes";


id: constant:7c4d8475bc33cd0ae340ee8f3c940fb4
kind: constant
name: API_BRIDGE_TIMEOUTS
qualified_name: API_BRIDGE_TIMEOUTS
file_path: src/lib/apiBridgeServer.ts
language: typescript
signature:
= getApiBridgeTimeoutConfig(process.env, (message) => {
  console.warn(`[API Bridge] ${message}`);
})


id: constant:cb0a6b8039b5c5ea2acd513fabfe94aa
kind: constant
name: OPENAI_COMPAT_PATHS
qualified_name: OPENAI_COMPAT_PATHS
file_path: src/lib/apiBridgeServer.ts
language: typescript
signature:
= [
  /^\/v1(?:\/|$)/,
  /^\/chat\/completions(?:\?|$)/,
  /^\/responses(?:\?|$)/,
  /^\/models(?:\?|$...


id: constant:99e43f31ef6456d35e8475c8100c7c70
kind: constant
name: handlerLoaders
qualified_name: handlerLoaders
file_path: src/lib/batches/dispatch.ts
language: typescript
signature:
= {
  "/v1/responses": async () => (await import("@/app/api/v1/responses/route")).POST,
  "/v1/chat/co...


id: function:8c5c7234e1d6a0fcfb39602997aee671
kind: function
name: dispatchBatchApiRequest
qualified_name: dispatchBatchApiRequest
file_path: src/lib/batches/dispatch.ts
language: typescript
signature:
({
  endpoint,
  body,
  apiKey,
}: {
  endpoint: SupportedBatchEndpoint;
  body: Record<string, unknown>;
  apiKey?: string | null;
}): Promise<Response>


id: constant:3a8f33376376484815c7415b3fdfb779
kind: constant
name: DEFAULT_MAX_ENTRIES
qualified_name: DEFAULT_MAX_ENTRIES
file_path: src/lib/cacheLayer.ts
language: typescript
signature: = 50
docstring:
@typedef {Object} CacheEntry
@property {string} key - Cache key (hash)
@property {*} value - Cached value
@property {number} createdAt - Timestamp
@property {number} ttl - TTL in ms
@property {number} size - Approximate size in bytes
@property {number} hits - Number of times this entry was accessed


id: method:796904409f54f7d7f423324ebbea1df6
kind: method
name: constructor
qualified_name: LRUCache::constructor
file_path: src/lib/cacheLayer.ts
language: typescript
signature: (options: { maxSize?: number; maxBytes?: number; defaultTTL?: number } = {})
docstring:
@param {Object} options
@param {number} [options.maxSize=50] - Max number of entries (reduced for memory)
@param {number} [options.maxBytes=2097152] - Max bytes (default: 2MB)
@param {number} [options.defaultTTL=300000] - Default TTL in ms (5 min)


id: method:af9ea8f4a46bc7e612e153f96f097fe0
kind: method
name: generateKey
qualified_name: LRUCache::generateKey
file_path: src/lib/cacheLayer.ts
language: typescript
signature: (params: Record<string, unknown>)
docstring:
Generate a cache key from input.
@param {Object} params - Parameters to hash
@returns {string} Cache key


id: method:96f0916b19e565b0c1c2181f12663f3d
kind: method
name: set
qualified_name: LRUCache::set
file_path: src/lib/cacheLayer.ts
language: typescript
signature: (key: string, value: unknown, ttl?: number)
docstring:
Set a value in the cache.
@param {string} key
@param {*} value
@param {number} [ttl] - Override default TTL


id: method:95b3afcb0b92a352867526c482d24e4c
kind: method
name: getStats
qualified_name: LRUCache::getStats
file_path: src/lib/cacheLayer.ts
language: typescript
signature: ()
docstring:
@returns {{ size: number, maxSize: number, bytes: number, maxBytes: number, hits: number, misses: number, evictions: number, hitRate: number }}


id: function:bbff0fbc286660243ef178799c352614
kind: function
name: getPromptCache
qualified_name: getPromptCache
file_path: src/lib/cacheLayer.ts
language: typescript
signature:
(
  options?: { maxSize?: number; maxBytes?: number; defaultTTL?: number } & Record<string, unknown>
)


id: function:8d6b7a9e320d3713d8ac265abc55a10d
kind: function
name: getOpenRouterCatalog
qualified_name: getOpenRouterCatalog
file_path: src/lib/catalog/openrouterCatalog.ts
language: typescript
signature:
(): Promise<{
  data: CatalogEntry[];
  stale: boolean;
  cachedAt: string | null;
  fromCache: boolean;
}>


id: constant:d3d62a1740d048431362e3f878cd8e4f
kind: constant
name: GENERATORS
qualified_name: GENERATORS
file_path: src/lib/cli-helper/config-generator/index.ts
language: typescript
signature:
= {
  claude: generateClaudeConfig,
  codex: generateCodexConfig,
  opencode: generateOpencodeConfig,
...


id: constant:581d0f07cdfdf305894e724b2fc10c6d
kind: constant
name: TOOLS
qualified_name: TOOLS
file_path: src/lib/cli-helper/tool-detector.ts
language: typescript
signature:
= [
  { id: "claude", name: "Claude Code", configPath: "~/.claude/settings.json" },
  { id: "codex", n...


id: constant:3ab04ff8e70d3747e9ef207ae06f3b9f
kind: constant
name: BINARY_NAMES
qualified_name: BINARY_NAMES
file_path: src/lib/cli-helper/tool-detector.ts
language: typescript
signature:
= {
  claude: "claude",
  codex: "codex",
  opencode: "opencode",
  cline: "cline",
  kilocode: "kiloc...


id: import:976b1c81794d5d6bcaf6f6ea942170ba
kind: import
name: ../baseAgent.ts
qualified_name: ../baseAgent.ts
file_path: src/lib/cloudAgent/agents/codex.ts
language: typescript
signature:
import {
  CloudAgentBase,
  type AgentCredentials,
  type CreateTaskParams,
  type GetStatusResult,
} from "../baseAgent.ts";


id: method:48d1279fb49916b3bc1d90ce31cd9748
kind: method
name: sendMessage
qualified_name: CodexCloudAgent::sendMessage
file_path: src/lib/cloudAgent/agents/codex.ts
language: typescript
signature:
(
    externalId: string,
    message: string,
    credentials: AgentCredentials
  ): Promise<CloudAgentActivity>


id: import:fefe7189d4a4b021cd6b534cffffd806
kind: import
name: ../types.ts
qualified_name: ../types.ts
file_path: src/lib/cloudAgent/agents/jules.ts
language: typescript
signature:
import type {
  CloudAgentTask,
  CloudAgentActivity,
  CloudAgentStatus,
  CloudAgentResult,
} from "../types.ts";


id: import:3448443f44ccc1b449381b6b53c0e543
kind: import
name: ./types.ts
qualified_name: ./types.ts
file_path: src/lib/cloudAgent/baseAgent.ts
language: typescript
signature:
import type {
  CloudAgentTask,
  CloudAgentStatus,
  CloudAgentSource,
  CloudAgentResult,
  CloudAgentActivity,
} from "./types.ts";


id: function:f48079b9b8d5a2ef1e41d3d3ef89acc9
kind: function
name: listCloudAgentCredentials
qualified_name: listCloudAgentCredentials
file_path: src/lib/cloudAgent/credentials.ts
language: typescript
signature:
(): Array<{
  providerId: string;
  apiKey: string;
  baseUrl: string | null;
  updatedAt: string;
}>


id: constant:0fd0672690c2032511247a56bc8633b7
kind: constant
name: ALLOWED_UPDATE_COLUMNS
qualified_name: ALLOWED_UPDATE_COLUMNS
file_path: src/lib/cloudAgent/db.ts
language: typescript
docstring: Whitelist of allowed columns for update operations
signature:
= new Set([
  "status",
  "prompt",
  "source",
  "options",
  "result",
  "activities",
  "error",
  ...


id: constant:aed8e5d60f90bb91b294c8d000840f19
kind: constant
name: CLOUD_AGENT_STATUS
qualified_name: CLOUD_AGENT_STATUS
file_path: src/lib/cloudAgent/types.ts
language: typescript
signature:
= {
  QUEUED: "queued",
  RUNNING: "running",
  AWAITING_APPROVAL: "awaiting_approval",
  COMPLETED: "...


id: constant:d46963d5f5cf6a20eb2cc34f680dcb36
kind: constant
name: CloudAgentStatusSchema
qualified_name: CloudAgentStatusSchema
file_path: src/lib/cloudAgent/types.ts
language: typescript
signature:
= z.enum([
  "queued",
  "running",
  "awaiting_approval",
  "completed",
  "failed",
  "cancelled",
]...


id: constant:cc434247c5a367ddd94df52ae8a07697
kind: constant
name: CloudAgentSourceSchema
qualified_name: CloudAgentSourceSchema
file_path: src/lib/cloudAgent/types.ts
language: typescript
signature:
= z.object({
  repoName: z.string().min(1),
  repoUrl: z.string().url(),
  branch: z.string().optional...


id: constant:48da2bc2129926aaf6c79d7c55734ce1
kind: constant
name: CloudAgentResultSchema
qualified_name: CloudAgentResultSchema
file_path: src/lib/cloudAgent/types.ts
language: typescript
signature:
= z.object({
  prUrl: z.string().url().optional(),
  prNumber: z.number().int().positive().optional(),...


id: constant:5776b782cb45a058ce74eccfcec5cbb7
kind: constant
name: CloudAgentActivitySchema
qualified_name: CloudAgentActivitySchema
file_path: src/lib/cloudAgent/types.ts
language: typescript
signature:
= z.object({
  id: z.string(),
  type: z.enum(["plan", "command", "code_change", "message", "error", "...


id: constant:c565ea86f580cb1f3d08dacc5da08cdd
kind: constant
name: CloudAgentTaskOptionsSchema
qualified_name: CloudAgentTaskOptionsSchema
file_path: src/lib/cloudAgent/types.ts
language: typescript
signature:
= z.object({
  autoCreatePr: z.boolean().optional(),
  planApprovalRequired: z.boolean().optional(),
 ...


id: constant:188d783e51f44f1c7c1e9e81267234d7
kind: constant
name: CreateCloudAgentTaskSchema
qualified_name: CreateCloudAgentTaskSchema
file_path: src/lib/cloudAgent/types.ts
language: typescript
signature:
= z.object({
  providerId: z.enum(["jules", "devin", "codex-cloud"]),
  prompt: z.string().min(1).max(...


id: constant:dba332beda231f293481976a85f19a60
kind: constant
name: UpdateCloudAgentTaskSchema
qualified_name: UpdateCloudAgentTaskSchema
file_path: src/lib/cloudAgent/types.ts
language: typescript
signature:
= z.object({
  id: z.string().min(1),
  action: z.enum(["approve", "reject", "cancel", "message"]),
  ...


id: function:e7a5f5d616ee0881118c2f6aa633b1f8
kind: function
name: updateLocalTokens
qualified_name: updateLocalTokens
file_path: src/lib/cloudSync.ts
language: typescript
signature: (cloudProviders: unknown)
docstring:
Update local db with data from Cloud
Simple logic: if Cloud is newer, sync entire provider
cloudProviders is object keyed by provider ID


id: constant:d043b25ca640c1a0fb13f08a76262066
kind: constant
name: DEFAULT_CERT_FILE_CANDIDATES
qualified_name: DEFAULT_CERT_FILE_CANDIDATES
file_path: src/lib/cloudflaredTunnel.ts
language: typescript
signature:
= [
  "/etc/ssl/certs/ca-certificates.crt",
  "/etc/pki/tls/certs/ca-bundle.crt",
  "/etc/ssl/cert.pem...


id: constant:e456d37cd5fe01b03c09b30a01d6a5e0
kind: constant
name: CLOUDFLARED_SAFE_ENV_KEYS
qualified_name: CLOUDFLARED_SAFE_ENV_KEYS
file_path: src/lib/cloudflaredTunnel.ts
language: typescript
signature:
= [
  "PATH",
  "HOME",
  "USERPROFILE",
  "APPDATA",
  "LOCALAPPDATA",
  "PROGRAMDATA",
  "ProgramDat...


id: function:eb16e7089c3a017710b1611fe69a5422
kind: function
name: getDefaultCloudflaredCertEnv
qualified_name: getDefaultCloudflaredCertEnv
file_path: src/lib/cloudflaredTunnel.ts
language: typescript
signature:
(
  existsSync: (candidate: string) => boolean = fsSync.existsSync,
  certFileCandidates: readonly string[] = DEFAULT_CERT_FILE_CANDIDATES,
  certDirCandidates: readonly string[] = DEFAULT_CERT_DIR_CANDIDATES
)


id: function:adbfbb63cba987308b6b4b89cf412e64
kind: function
name: buildCloudflaredChildEnv
qualified_name: buildCloudflaredChildEnv
file_path: src/lib/cloudflaredTunnel.ts
language: typescript
signature:
(
  sourceEnv: NodeJS.ProcessEnv = process.env,
  runtimeDirs: CloudflaredRuntimeDirs = getCloudflaredRuntimeDirs(),
  defaultCertEnv: NodeJS.ProcessEnv = getDefaultCloudflaredCertEnv()
): NodeJS.ProcessEnv


id: function:e25b988a83ba8b87c8a0e18cc6777617
kind: function
name: buildStoppedState
qualified_name: buildStoppedState
file_path: src/lib/cloudflaredTunnel.ts
language: typescript
signature:
(
  state: PersistedTunnelState,
  binaryResolved: boolean,
  targetUrl = getLocalTargetUrl()
): PersistedTunnelState


id: function:c37e9e435b59b29deb132d90a0627dd9
kind: function
name: buildPrecisionComboModelStep
qualified_name: buildPrecisionComboModelStep
file_path: src/lib/combos/builderDraft.ts
language: typescript
signature:
({
  providerId,
  modelId,
  connectionId = null,
  connectionLabel,
  weight = 0,
}: {
  providerId: string;
  modelId: string;
  connectionId?: string | null;
  connectionLabel?: string | null;
  weight?: number;
}): ComboModelStep


id: function:51cf35ad68c2801583c3a25be89f5c3a
kind: function
name: buildManualComboModelStep
qualified_name: buildManualComboModelStep
file_path: src/lib/combos/builderDraft.ts
language: typescript
signature:
({
  value,
  providers = [],
  weight = 0,
}: {
  value: unknown;
  providers?: ComboBuilderProviderIdentity[];
  weight?: number;
}): ComboModelStep | null


id: function:42cb674a9eb6d5b7e90ec9feb91faa9c
kind: function
name: findNextSuggestedConnectionId
qualified_name: findNextSuggestedConnectionId
file_path: src/lib/combos/builderDraft.ts
language: typescript
signature:
(
  entries: unknown[],
  providerId: string,
  modelId: string,
  connections: Array<{ id?: string | null }> = []
): string


id: function:e51f43e83c9418402721c075b52219d9
kind: function
name: getComboBuilderStageChecks
qualified_name: getComboBuilderStageChecks
file_path: src/lib/combos/builderDraft.ts
language: typescript
signature:
({
  name,
  nameError,
  modelsCount,
  hasInvalidWeightedTotal,
  hasCostOptimizedWithoutPricing,
}: {
  name: string;
  nameError?: string | null;
  modelsCount: number;
  hasInvalidWeightedTotal?: boolean;
  hasCostOptimizedWithoutPricing?: boolean;
})


id: function:af35674af3fdcb701e4371a18252169b
kind: function
name: canAccessComboBuilderStage
qualified_name: canAccessComboBuilderStage
file_path: src/lib/combos/builderDraft.ts
language: typescript
signature:
(
  stage: ComboBuilderStage,
  checks: ReturnType<typeof getComboBuilderStageChecks>,
  options: ComboBuilderStageOptions = {}
): boolean


id: import:73b5595c20ed22f7ae5d5d8dc86c7a82
kind: import
name: @/lib/localDb
qualified_name: @/lib/localDb
file_path: src/lib/combos/builderOptions.ts
language: typescript
signature:
import {
  getAllCustomModels,
  getAllSyncedAvailableModels,
  getCombos,
  getModelIsHidden,
  getProviderConnections,
  getProviderNodes,
} from "@/lib/localDb";


id: import:bc7339b9c114cb903279af3f4aad8b9e
kind: import
name: @/shared/constants/providers
qualified_name: @/shared/constants/providers
file_path: src/lib/combos/builderOptions.ts
language: typescript
signature:
import {
  AI_PROVIDERS,
  isAnthropicCompatibleProvider,
  isClaudeCodeCompatibleProvider,
  isOpenAICompatibleProvider,
} from "@/shared/constants/providers";


id: function:6ad29f46ef675a7854d472dfa0d08baf
kind: function
name: getProviderVisual
qualified_name: getProviderVisual
file_path: src/lib/combos/builderOptions.ts
language: typescript
signature:
(
  providerId: string,
  providerNode: ProviderNodeLike | null
): ProviderVisual & { alias: string; providerType: string }


id: function:da7338a46fa945447c9d325a69f4dd5e
kind: function
name: addModelOption
qualified_name: addModelOption
file_path: src/lib/combos/builderOptions.ts
language: typescript
signature:
(
  modelMap: Map<string, ComboBuilderModelOption>,
  providerId: string,
  input: {
    id: string | null;
    name?: string | null;
    source: BuilderModelSource;
    supportedEndpoints?: string[];
    apiFormat?: string | null;
    contextLength?: number | null;
    outputTokenLimit?: number | null;
    supportsThinking?: boolean;
  }
)


id: function:f7dbc3e46c723f1706f0ade6cf106016
kind: function
name: validateCompositeTiersConfig
qualified_name: validateCompositeTiersConfig
file_path: src/lib/combos/compositeTiers.ts
language: typescript
signature:
(combo: {
  name?: unknown;
  models?: unknown;
  config?: unknown;
}): CompositeTierValidationResult


id: constant:7ca29fcc0d36cedf5187f065c17b429b
kind: constant
name: DEFAULT_INTELLIGENT_WEIGHTS
qualified_name: DEFAULT_INTELLIGENT_WEIGHTS
file_path: src/lib/combos/intelligentRouting.ts
language: typescript
signature:
= {
  quota: 0.2,
  health: 0.25,
  costInv: 0.2,
  latencyInv: 0.15,
  taskFit: 0.1,
  stability: 0.0...


id: constant:678f6f9b3d249230355b96083efe4b57
kind: constant
name: MODE_PACK_OPTIONS
qualified_name: MODE_PACK_OPTIONS
file_path: src/lib/combos/intelligentRouting.ts
language: typescript
signature:
= [
  { id: "ship-fast", label: "Ship Fast", emoji: "rocket_launch" },
  { id: "cost-saver", label: "C...


id: constant:98020b05d3f1917542aaee390c79cc90
kind: constant
name: ROUTER_STRATEGY_OPTIONS
qualified_name: ROUTER_STRATEGY_OPTIONS
file_path: src/lib/combos/intelligentRouting.ts
language: typescript
signature:
= [
  { id: "rules", label: "Rules (6-Factor Scoring)" },
  { id: "cost", label: "Cost Optimized" },
 ...


id: constant:2eb858dc5ea86083033e5734dbe7d4a0
kind: constant
name: FACTOR_LABELS
qualified_name: FACTOR_LABELS
file_path: src/lib/combos/intelligentRouting.ts
language: typescript
signature:
= {
  quota: "Quota",
  health: "Health",
  costInv: "Cost",
  latencyInv: "Latency",
  taskFit: "Task...


id: function:d81c90ddd0f92a481dbe3ceb0a6dc3fe
kind: function
name: normalizeComboRecord
qualified_name: normalizeComboRecord
file_path: src/lib/combos/steps.ts
language: typescript
signature:
(
  combo: T,
  options: NormalizeComboRecordOptions = {}
): T & { version: 2; models: ComboStep[] }


id: import:7c58b09cacc7c102a1f692ef199599e7
kind: import
name: ../logEnv
qualified_name: ../logEnv
file_path: src/lib/compliance/index.ts
language: typescript
signature:
import {
  getAppLogRetentionDays,
  getCallLogRetentionDays,
  getCallLogsTableMaxRows,
  getProxyLogsTableMaxRows,
} from "../logEnv";


id: constant:5d9850d666ea3dbf7ad53c53ef8656a6
kind: constant
name: SENSITIVE_AUDIT_KEYS
qualified_name: SENSITIVE_AUDIT_KEYS
file_path: src/lib/compliance/index.ts
language: typescript
signature:
= new Set([
  "apikey",
  "accesstoken",
  "refreshtoken",
  "idtoken",
  "authtoken",
  "jwttoken",
 ...


id: function:73fab80faf5c9d99691de4e66b45180f
kind: function
name: getAuditRequestContext
qualified_name: getAuditRequestContext
file_path: src/lib/compliance/index.ts
language: typescript
signature:
(request?: {
  headers?: Headers | { get?: (name: string) => string | null };
  socket?: { remoteAddress?: string };
  ip?: string;
})


id: function:7c1eea03a49463dcaa4b55f216747295
kind: function
name: logAuditEvent
qualified_name: logAuditEvent
file_path: src/lib/compliance/index.ts
language: typescript
signature:
(entry: {
  action: string;
  actor?: string;
  target?: string;
  details?: unknown;
  metadata?: unknown;
  ipAddress?: string;
  resourceType?: string;
  status?: string;
  requestId?: string;
  createdAt?: string;
})


id: constant:8a958fa11353dfe43415209ea9af218f
kind: constant
name: noLogIdsFromEnv
qualified_name: noLogIdsFromEnv
file_path: src/lib/compliance/index.ts
language: typescript
signature:
= (process.env.NO_LOG_API_KEY_IDS || "")
  .split(",")
  .map((value) => value.trim())
  .filter(Boole...


id: constant:b885afd5a1654ebaf680728e6670a8be
kind: constant
name: WARNING_PATTERNS
qualified_name: WARNING_PATTERNS
file_path: src/lib/compliance/providerAudit.ts
language: typescript
signature:
= [
  /\[sanitizer\]/i,
  /prompt injection detected/i,
  /content(?:\s+has\s+been|\s+was)?\s+filtered...


id: constant:49f2370b37ddbe2a7f88116909e2f517
kind: constant
name: DEFAULT_AUTHZ_BYPASS_SNAPSHOT
qualified_name: DEFAULT_AUTHZ_BYPASS_SNAPSHOT
file_path: src/lib/config/runtimeSettings.ts
language: typescript
signature: = { enabled: true, prefixes: ["/api/mcp/"], }
docstring:
Default bypass policy: kill-switch on, `/api/mcp/` bypassable. Mirrors the
pre-T-011 compile-time constant so the route guard works identically before
the first `applyRuntimeSettings` call (e.g. cold-boot requests).


id: constant:a8835866d0fd815d30a4bebf5032c8e6
kind: constant
name: DEFAULT_RUNTIME_SETTINGS_SNAPSHOT
qualified_name: DEFAULT_RUNTIME_SETTINGS_SNAPSHOT
file_path: src/lib/config/runtimeSettings.ts
language: typescript
signature:
= {
  payloadRules: null,
  modelAliases: {},
  backgroundDegradation: null,
  cliCompatProviders: [],...


id: variable:9a288e69e06e796984542cf7700888e1
kind: variable
name: currentAuthzBypass
qualified_name: currentAuthzBypass
file_path: src/lib/config/runtimeSettings.ts
language: typescript
signature: = DEFAULT_AUTHZ_BYPASS_SNAPSHOT
docstring:
Module-local mirror of the current bypass policy. Read by the route guard
on every non-loopback hit to a LOCAL_ONLY path via `getAuthzBypassSnapshot`.
Initialised to the default so cold-boot requests (before any
`applyRuntimeSettings` call) behave identically to PR #2473.


id: function:a02fc4687c0378a36469d840dc0f6ba0
kind: function
name: applyCcBridgeTransformsSection
qualified_name: applyCcBridgeTransformsSection
file_path: src/lib/config/runtimeSettings.ts
language: typescript
signature: (ccBridgeTransforms: unknown)
docstring:
Legacy alias for the v2 systemTransforms config. The `ccBridgeTransforms`
settings field carried the single-provider shape `{ enabled, pipeline }`
during Phase 2 (commit e3e962db, pre-release). v2 unifies everything under
`systemTransforms.providers[*]`. We migrate the legacy shape into the v2
registry on every reload so users with persisted Phase-2 data keep working.
`setSystemTransformsConfig` accepts both shapes and routes legacy into
`providers[PROVIDER_CC_BRIDGE]`.


id: function:8e70161767996409abbdebf00c3c6c6e
kind: function
name: applyAuthzBypassSection
qualified_name: applyAuthzBypassSection
file_path: src/lib/config/runtimeSettings.ts
language: typescript
signature: (snapshot: AuthzBypassSnapshot)
docstring:
Swap the in-process bypass policy. Synchronous, O(1), no I/O — the SLA
(<50 ms hot-reload) is structurally satisfied by this shape.


id: function:8f2b28d7d455d801731bfcef01ebdefe
kind: function
name: applyModelsDevSyncSection
qualified_name: applyModelsDevSyncSection
file_path: src/lib/config/runtimeSettings.ts
language: typescript
signature:
(
  previousSnapshot: RuntimeSettingsSnapshot,
  currentSnapshot: RuntimeSettingsSnapshot,
  force: boolean
)


id: function:2a3c7590a4d5922bf7a374234634a5ec
kind: function
name: applyRuntimeSettings
qualified_name: applyRuntimeSettings
file_path: src/lib/config/runtimeSettings.ts
language: typescript
signature:
(
  settings: Record<string, unknown>,
  options: { force?: boolean; source?: string } = {}
): Promise<RuntimeReloadChange[]>


id: import:9a48dc1bfd9edac2cfea32b332ec1bd5
kind: import
name: ./db/encryption.ts
qualified_name: ./db/encryption.ts
file_path: src/lib/container.ts
language: typescript
signature:
import {
  decrypt,
  decryptConnectionFields,
  encrypt,
  encryptConnectionFields,
} from "./db/encryption.ts";


id: method:d67ec1ba029f1d998e52c5957e281c01
kind: method
name: resolve
qualified_name: Container::resolve
file_path: src/lib/container.ts
language: typescript
signature: (name: string): T
docstring:
Resolve a service by name. Lazy-creates via factory on first call,
then returns the cached singleton.


id: constant:5761bc823f1c4b82e60cca80e05577c6
kind: constant
name: MIGRATION_SQL
qualified_name: MIGRATION_SQL
file_path: src/lib/db/__tests__/quotaSnapshots.test.ts
language: typescript
signature:
= `
  CREATE TABLE IF NOT EXISTS quota_snapshots (
    id INTEGER PRIMARY KEY AUTOINCREMENT,
    provi...


id: function:553e23f0724db403e813a6f8759db085
kind: function
name: getQuotaSnapshotsForTest
qualified_name: getQuotaSnapshotsForTest
file_path: src/lib/db/__tests__/quotaSnapshots.test.ts
language: typescript
signature:
(
  db: Database.Database,
  opts: {
    provider?: string;
    connectionId?: string;
    since: string;
    until?: string;
  }
): Array<{
  id: number;
  provider: string;
  connectionId: string;
  windowKey: string;
  remainingPercentage: number | null;
  isExhausted: number;
  nextResetAt: string | null;
  windowDurationMs: number | null;
  rawData: string | null;
  createdAt: string;
}>


id: function:43187821aedba0e4cdba9f9cab28d2b9
kind: function
name: getAggregatedSnapshotsForTest
qualified_name: getAggregatedSnapshotsForTest
file_path: src/lib/db/__tests__/quotaSnapshots.test.ts
language: typescript
signature:
(
  db: Database.Database,
  opts: {
    provider?: string;
    since: string;
    until?: string;
    bucketMinutes: number;
  }
): Array<{
  timestamp: string;
  provider: string;
  remainingPct: number;
  isExhausted: boolean;
  windowKey: string;
}>


id: function:0815399878146ddec7fbe8563e751df9
kind: function
name: buildNodeAdapterSync
qualified_name: buildNodeAdapterSync
file_path: src/lib/db/adapters/driverFactory.ts
language: typescript
signature:
(
  db: {
    prepare(sql: string): {
      run(...p: unknown[]): { changes: number | bigint; lastInsertRowid: number | bigint };
      get(...p: unknown[]): unknown;
      all(...p: unknown[]): unknown[];
    };
    exec(sql: string): void;
    close(): void;
  },
  filePath: string
): SqliteAdapter


id: variable:f511d6160f1721e094aab0546c246174
kind: variable
name: _schemaChecked
qualified_name: _schemaChecked
file_path: src/lib/db/apiKeys.ts
language: typescript
signature: = false
docstring:
──────────────── Performance Optimizations ────────────────
Schema check memoization - only run once


id: constant:eedcaa9acf695e7e56dec8a139225d88
kind: constant
name: API_KEY_COLUMN_FALLBACKS
qualified_name: API_KEY_COLUMN_FALLBACKS
file_path: src/lib/db/apiKeys.ts
language: typescript
docstring:
Wildcard scope matching is now handled by `matchesWildcardPattern`
(deterministic, no RegExp from dynamic strings).

signature:
= [
  { name: "allowed_models", definition: "allowed_models TEXT" },
  { name: "no_log", definition: "...


id: function:438b001c9f8c44114381dea4630470f9
kind: function
name: matchesWildcardPattern
qualified_name: matchesWildcardPattern
file_path: src/lib/db/apiKeys.ts
language: typescript
signature: (pattern: string, candidate: string): boolean
docstring:
Match an API-key wildcard scope pattern against a model id without
compiling a RegExp from string concatenation (avoid ReDoS exposure on
operator-supplied patterns and silence the Semgrep `js/regex-injection`
advisory for `new RegExp(<dynamic>)`).
Supported pattern syntax (only what real scopes use):
  - literal segments
  - `*` matches any run of characters, but does NOT cross `/`
Walks the pattern token-by-token: each `*` consumes the longest possible
run within the current path segment, then the next literal anchor must
appear before the segment boundary. Worst-case complexity is O(n*m)
where n = pattern length, m = candidate length — there is no nested
backtracking that could explode adversarially.


id: function:5aabebf525f58d87c8da540c237e5377
kind: function
name: ensureApiKeyColumn
qualified_name: ensureApiKeyColumn
file_path: src/lib/db/apiKeys.ts
language: typescript
signature:
(
  db: ApiKeysDbLike,
  columnNames: Set<string>,
  column: (typeof API_KEY_COLUMN_FALLBACKS)[number]
): void


id: function:50d9ed8f1fdc739c4d11bd7ec6133d9d
kind: function
name: updateApiKeyPermissions
qualified_name: updateApiKeyPermissions
file_path: src/lib/db/apiKeys.ts
language: typescript
signature:
(
  id: string,
  update:
    | string[]
    | {
        name?: string;
        allowedModels?: string[];
        allowedConnections?: string[];
        noLog?: boolean;
        autoResolve?: boolean;
        isActive?: boolean;
        accessSchedule?: AccessSchedule | null;
        maxRequestsPerDay?: number | null;
        maxRequestsPerMinute?: number | null;
        rateLimits?: RateLimitRule[] | null;
        isBanned?: boolean;
        expiresAt?: string | null;
        // T08: max concurrent sessions for this key (0 = unlimited)
        maxSessions?: number | null;
        scopes?: string[] | null;
      }
)


id: function:304c80152fe5347f11e20c0ce576ccb2
kind: function
name: clearPreparedStatementCache
qualified_name: clearPreparedStatementCache
file_path: src/lib/db/apiKeys.ts
language: typescript
signature: ()
docstring:
Clear prepared statements cache (called on database reset/restore)
Prepared statements are bound to a specific database connection,
so they must be cleared when the connection is reset.


id: import:3c75950cf47400e20c71972a0c168e68
kind: import
name: ./core
qualified_name: ./core
file_path: src/lib/db/backup.ts
language: typescript
signature:
import {
  getDbInstance,
  resetDbInstance,
  isBuildPhase,
  isCloud,
  SQLITE_FILE,
  DB_BACKUPS_DIR,
  DATA_DIR,
} from "./core";


id: function:53bddd0e9aad97a8d69592bf74ab7e04
kind: function
name: unlinkFileWithRetry
qualified_name: unlinkFileWithRetry
file_path: src/lib/db/backup.ts
language: typescript
signature:
(
  filePath: string,
  options?: { maxAttempts?: number; retryableCodes?: string[]; baseDelayMs?: number }
)


id: function:703ef609f3481d2a3ef375882167a400
kind: function
name: createBatch
qualified_name: createBatch
file_path: src/lib/db/batches.ts
language: typescript
signature:
(
  batch: Omit<
    BatchRecord,
    "id" | "createdAt" | "requestCountsTotal" | "requestCountsCompleted" | "requestCountsFailed"
  >
): BatchRecord


id: function:d74f39527ad4eb5326306fef2edf8f32
kind: function
name: runAutoCleanup
qualified_name: runAutoCleanup
file_path: src/lib/db/cleanup.ts
language: typescript
signature:
(): Promise<{
  totalDeleted: number;
  totalErrors: number;
  results: Record<string, CleanupResult>;
}>


id: function:acd7065c950e6cba917b111406fcbb2c
kind: function
name: normalizeStoredCombo
qualified_name: normalizeStoredCombo
file_path: src/lib/db/combos.ts
language: typescript
signature:
(
  combo: JsonRecord,
  db: ReturnType<typeof getDbInstance>,
  extraNames: string[] = []
): JsonRecord


id: function:8ca0692e8b3f75d47389907a3e60ad50
kind: function
name: markCommandCodeAuthSessionReceived
qualified_name: markCommandCodeAuthSessionReceived
file_path: src/lib/db/commandCodeAuth.ts
language: typescript
signature:
(input: {
  stateHash: string;
  apiKey: string;
  metadata?: CommandCodeAuthMetadata;
}): CommandCodeAuthSafeStatus | null


id: import:961718cc5e5269d7fb87a5c3f82ad291
kind: import
name: @omniroute/open-sse/services/compression/types.ts
qualified_name: @omniroute/open-sse/services/compression/types.ts
file_path: src/lib/db/compression.ts
language: typescript
signature:
import {
  DEFAULT_AGGRESSIVE_CONFIG,
  DEFAULT_CAVEMAN_CONFIG,
  DEFAULT_CAVEMAN_OUTPUT_MODE_CONFIG,
  DEFAULT_COMPRESSION_LANGUAGE_CONFIG,
  DEFAULT_COMPRESSION_CONFIG,
  DEFAULT_MCP_ACCESSIBILITY_CONFIG,
  DEFAULT_RTK_CONFIG,
  DEFAULT_ULTRA_CONFIG,
  type AggressiveConfig,
  type CavemanConfig,
  type CavemanOutputModeConfig,
  type CompressionLanguageConfig,
  type CompressionPipelineStep,
  type CompressionConfig,
  type CompressionMode,
  type McpAccessibilityConfig,
  type RtkConfig,
  type UltraConfig,
} from "@omniroute/open-sse/services/compression/types.ts";


id: constant:4ebd09f364231e0a38eb91a13cb12b90
kind: constant
name: COMPRESSION_MODES
qualified_name: COMPRESSION_MODES
file_path: src/lib/db/compression.ts
language: typescript
signature:
= new Set<CompressionMode>([
  "off",
  "lite",
  "standard",
  "aggressive",
  "ultra",
  "rtk",
  "s...


id: function:e0ade7d51c443f308dce669488947307
kind: function
name: attachCompressionUsageReceipt
qualified_name: attachCompressionUsageReceipt
file_path: src/lib/db/compressionAnalytics.ts
language: typescript
signature:
(
  requestId: string | null | undefined,
  usage: Record<string, unknown> | null | undefined,
  source: "provider" | "estimated" | "stream" = "provider"
): void


id: import:ff5ee1233f1a200a3702dfb31bba1324
kind: import
name: ./adapters/driverFactory
qualified_name: ./adapters/driverFactory
file_path: src/lib/db/core.ts
language: typescript
signature:
import {
  tryOpenSync,
  getSqlJsAdapter,
  preInitSqlJs,
  openDatabaseAsync,
} from "./adapters/driverFactory";


id: import:c6cc5d6b2dfa96bad5d6359d33f8a205
kind: import
name: ../usage/callLogArtifacts
qualified_name: ../usage/callLogArtifacts
file_path: src/lib/db/core.ts
language: typescript
signature:
import {
  buildArtifactRelativePath,
  writeCallArtifact,
  type CallLogArtifact,
} from "../usage/callLogArtifacts";


id: constant:0a50de6265b941c4648767da8f67553d
kind: constant
name: SKIP_PRESERVE_NAMESPACES
qualified_name: SKIP_PRESERVE_NAMESPACES
file_path: src/lib/db/core.ts
language: typescript
signature:
= new Set([
  "syncedAvailableModels",
  "providerLimitsCache",
  "lkgp",
  "gemini_thought_signatures...


id: constant:1c0d55e9c723fb4030493c9e7501c190
kind: constant
name: CRITICAL_DB_TABLES
qualified_name: CRITICAL_DB_TABLES
file_path: src/lib/db/core.ts
language: typescript
signature:
= [
  {
    table: "key_value",
    maxRows: 10_000,
    readRows(db) {
      return (
        (db.pre...


id: constant:5f90a1cf0897c980f3dd14fbd6f41362
kind: constant
name: SCHEMA_SQL
qualified_name: SCHEMA_SQL
file_path: src/lib/db/core.ts
language: typescript
docstring: ──────────────── Schema ────────────────
signature:
= `
  CREATE TABLE IF NOT EXISTS provider_connections (
    id TEXT PRIMARY KEY,
    provider TEXT NOT...


id: constant:557c0c53c8ddcf5639c0b39f4a9aafec
kind: constant
name: LEGACY_FLAT_KEYS
qualified_name: LEGACY_FLAT_KEYS
file_path: src/lib/db/databaseSettings.ts
language: typescript
signature:
= {
  logs: {
    detailedLogsEnabled: ["detailedLogsEnabled"],
    callLogPipelineEnabled: ["callLogP...


id: import:9769acba9a7b06513474f83d35dd04cb
kind: import
name: ../logPayloads
qualified_name: ../logPayloads
file_path: src/lib/db/detailedLogs.ts
language: typescript
signature:
import {
  protectPayloadForLog,
  serializePayloadForStorage,
  parseStoredPayload,
} from "../logPayloads";


id: import:54415424bda5a35a3f34e8580c423a24
kind: import
name: @omniroute/open-sse/utils/streamPayloadCollector.ts
qualified_name: @omniroute/open-sse/utils/streamPayloadCollector.ts
file_path: src/lib/db/detailedLogs.ts
language: typescript
signature:
import { compactStructuredStreamPayload } from "@omniroute/open-sse/utils/streamPayloadCollector.ts";


id: constant:bf6c7a2567f7242e500c8e3ca519c5fd
kind: constant
name: AUTH_TAG_LENGTH
qualified_name: AUTH_TAG_LENGTH
file_path: src/lib/db/encryption.ts
language: typescript
signature: = 16
docstring:
GCM authentication tag length, in bytes. Pinned to the full 16-byte tag
produced by `cipher.getAuthTag()`. Passing `authTagLength` to
`createDecipheriv` rejects truncated authentication tags up front, closing
the GCM tag-truncation forgery vector (Semgrep gcm-no-tag-length).


id: function:7b471200ff273d957ee0c427fb7997f1
kind: function
name: getStaticKey
qualified_name: getStaticKey
file_path: src/lib/db/encryption.ts
language: typescript
signature: (): Buffer | null
docstring:
Derive the PRIMARY encryption key using the static salt.
This is the canonical key derivation that all new encryptions use.
Returns null if no encryption key is configured.


id: function:3c2ed263da34c6e2078057667b0f8ab4
kind: function
name: getLegacyDynamicKey
qualified_name: getLegacyDynamicKey
file_path: src/lib/db/encryption.ts
language: typescript
signature: (): Buffer | null
docstring:
Derive the LEGACY key using the old dynamic salt method.
Used exclusively for fallback decryption of tokens encrypted by older versions.
The old dynamic salt was: createHash("sha256").update(secret).digest().slice(0, 16)
This produced a different derived key than the static salt, causing incompatibility.


id: function:be664cc0967d85900c994116da12c5d6
kind: function
name: migrateLegacyEncryptedString
qualified_name: migrateLegacyEncryptedString
file_path: src/lib/db/encryption.ts
language: typescript
signature:
(ciphertext: string | null | undefined): {
  updated: boolean;
  value: string | null | undefined;
}


id: function:25ae550206107e318e34e3ae70c2605b
kind: function
name: createScorecardFromRuns
qualified_name: createScorecardFromRuns
file_path: src/lib/db/evals.ts
language: typescript
signature:
(
  runs: Array<{
    suiteId: string;
    suiteName: string;
    summary: EvalRunSummary;
    results: Array<Record<string, unknown>>;
  }>
)


id: function:7e12f34bea8371c4a73df8ac6d6b451e
kind: function
name: saveEvalRun
qualified_name: saveEvalRun
file_path: src/lib/db/evals.ts
language: typescript
signature:
(input: {
  runGroupId?: string | null;
  suiteId: string;
  suiteName: string;
  target: { type: EvalTargetType; id?: string | null; label: string };
  apiKeyId?: string | null;
  avgLatencyMs?: number;
  summary: EvalRunSummary;
  results: Array<Record<string, unknown>>;
  outputs?: Record<string, string>;
  createdAt?: string;
}): PersistedEvalRun


id: function:4c42f89ff9adb4f73a7886bc0a0539ab
kind: function
name: listEvalRuns
qualified_name: listEvalRuns
file_path: src/lib/db/evals.ts
language: typescript
signature:
(
  options: {
    suiteId?: string;
    runGroupId?: string;
    limit?: number;
  } = {}
): PersistedEvalRun[]


id: function:340f8ea9b97d2983b8fa2bf3f6a21ffe
kind: function
name: saveCustomEvalSuite
qualified_name: saveCustomEvalSuite
file_path: src/lib/db/evals.ts
language: typescript
signature:
(input: {
  id?: string;
  name: string;
  description?: string;
  cases: Array<{
    id?: string;
    name: string;
    model?: string;
    input: {
      messages: EvalMessage[];
      max_tokens?: number;
    };
    expected: {
      strategy: EvalCaseStrategy;
      value?: string;
    };
    tags?: string[];
  }>;
}): EvalSuiteRecord


id: function:9f5578a919081eeaddc0fb4f853cd64c
kind: function
name: listFiles
qualified_name: listFiles
file_path: src/lib/db/files.ts
language: typescript
signature:
(
  options: {
    apiKeyId?: string;
    purpose?: string;
    limit?: number;
    after?: string;
    order?: "asc" | "desc";
  } = {}
): FileRecord[]


id: function:6b22d8402d9e1a336b61e209fc7ba352
kind: function
name: transferTokens
qualified_name: transferTokens
file_path: src/lib/db/gamification.ts
language: typescript
signature:
(
  fromId: string,
  toId: string,
  amount: number,
  reason: string,
  idempotencyKey: string
): { success: boolean; error?: string }


id: function:1ef003647d12b856ab685a706b93a951
kind: function
name: createInviteToken
qualified_name: createInviteToken
file_path: src/lib/db/gamification.ts
language: typescript
signature:
(
  id: string,
  code: string,
  tokenHash: string,
  createdBy: string,
  serverUrl?: string,
  maxUses?: number
): void


id: function:f61087418d1bb3ac03124a1f293c4c11
kind: function
name: getLeaderboardNeighbors
qualified_name: getLeaderboardNeighbors
file_path: src/lib/db/gamification.ts
language: typescript
signature:
(
  apiKeyId: string,
  scope: string,
  radius: number = 5
): {
  above: Array<{ apiKeyId: string; score: number }>;
  below: Array<{ apiKeyId: string; score: number }>;
}


id: function:9d3f33983ca017504c75f6f5056bdb4a
kind: function
name: repairComboRows
qualified_name: repairComboRows
file_path: src/lib/db/healthCheck.ts
language: typescript
signature:
(
  db: SqliteDatabase,
  rows: ComboRow[],
  checkedAt: string,
  options: { autoRepair: boolean }
): ComboRepairResult


id: function:d05f611ea4d54e51e441e5d0031d3835
kind: function
name: countInvalidJsonRows
qualified_name: countInvalidJsonRows
file_path: src/lib/db/healthCheck.ts
language: typescript
signature:
(
  db: SqliteDatabase,
  table: "domain_fallback_chains" | "domain_lockout_state" | "domain_circuit_breakers",
  column: "chain" | "attempts" | "options"
): number


id: function:13da7a7e019e91aa041312dbd085625b
kind: function
name: runJsonMigration
qualified_name: runJsonMigration
file_path: src/lib/db/jsonMigration.ts
language: typescript
signature:
(
  db: SqliteDatabase,
  data: LegacyJsonData
): {
  connections: number;
  nodes: number;
  combos: number;
  apiKeys: number;
  usageHistory: number;
  domainCostHistory: number;
  domainBudgets: number;
}


id: function:0174dbaca58e5d65221d0e74e2ed6bb7
kind: function
name: resolveMigrationsDir
qualified_name: resolveMigrationsDir
file_path: src/lib/db/migrationRunner.ts
language: typescript
signature: (): string
docstring:
Resolve the migrations directory path safely across platforms.
On Windows with global npm installs, `import.meta.url` may not be a valid
`file://` URL, causing `fileURLToPath` to throw `ERR_INVALID_FILE_URL_PATH`.


id: constant:6aaba3989923e24a632848be72ef02e2
kind: constant
name: MAX_PENDING_MIGRATIONS_ON_EXISTING_DB
qualified_name: MAX_PENDING_MIGRATIONS_ON_EXISTING_DB
file_path: src/lib/db/migrationRunner.ts
language: typescript
signature: = 50
docstring:
Maximum number of migrations allowed to run in a single startup on an
existing database. If more migrations are pending than this threshold,
it likely means the migration tracking table was accidentally wiped,
and running all migrations from scratch could cause data loss.
Set to 0 to disable this safety check.


id: constant:92cc0576b5014bd268b07c8c6a28d24f
kind: constant
name: RENAMED_MIGRATION_COMPATIBILITY
qualified_name: RENAMED_MIGRATION_COMPATIBILITY
file_path: src/lib/db/migrationRunner.ts
language: typescript
signature:
= [
  {
    fromVersion: "022",
    fromName: "call_logs_summary_storage",
    toVersion: "025",
    t...


id: constant:9f45d0d862214a671d3355b169ed07d1
kind: constant
name: LEGACY_VERSION_SLOT_MIGRATIONS
qualified_name: LEGACY_VERSION_SLOT_MIGRATIONS
file_path: src/lib/db/migrationRunner.ts
language: typescript
signature:
= [
  { version: "028", name: "evals_tables" },
  { version: "029", name: "webhooks_templates" },
  { ...


id: constant:1cb030d4b73c74c9fa92cd3e54fa1507
kind: constant
name: SUPERSEDED_DUPLICATE_MIGRATIONS
qualified_name: SUPERSEDED_DUPLICATE_MIGRATIONS
file_path: src/lib/db/migrationRunner.ts
language: typescript
signature:
= [
  {
    version: "041",
    name: "session_account_affinity",
    supersededByVersion: "050",
    ...


id: constant:0d564d10d5b0a9b726516cceb66d53ca
kind: constant
name: PHYSICAL_SCHEMA_SENTINELS
qualified_name: PHYSICAL_SCHEMA_SENTINELS
file_path: src/lib/db/migrationRunner.ts
language: typescript
signature:
= [
  { version: "028", tableName: "batches", description: "batches table" },
  { version: "024", tabl...


id: function:630b2dd27c61c5b5709f61c8cbfcae1b
kind: function
name: filterSupersededDuplicateMigrations
qualified_name: filterSupersededDuplicateMigrations
file_path: src/lib/db/migrationRunner.ts
language: typescript
signature:
(
  files: Array<{ version: string; name: string; path: string }>
): Array<{ version: string; name: string; path: string }>


id: function:18f0f8c020e73032e67804e074cf5b2d
kind: function
name: getPlausiblePendingCount
qualified_name: getPlausiblePendingCount
file_path: src/lib/db/migrationRunner.ts
language: typescript
signature:
(
  files: Array<{ version: string; name: string; path: string }>,
  baselineVersion: string
): number


id: function:592e8489ee76038f1c3025a6235655b7
kind: function
name: detectNameMismatches
qualified_name: detectNameMismatches
file_path: src/lib/db/migrationRunner.ts
language: typescript
docstring:
Detect migration name mismatches — when a migration version number
has been reused/renumbered with a different name. This is a strong signal
that the migration tracking is corrupted or migrations were renumbered.

signature:
(
  appliedRecords: Array<{ version: string; name: string }>,
  files: Array<{ version: string; name: string; path: string }>
): Array<{ version: string; appliedName: string; diskName: string }>


id: function:7cefca8f53deb6ba8d4af62dcce4db76
kind: function
name: createPreMigrationBackup
qualified_name: createPreMigrationBackup
file_path: src/lib/db/migrationRunner.ts
language: typescript
signature: (db: SqliteAdapter): string | null
docstring:
Create a pre-migration backup of the SQLite database using VACUUM INTO.
Returns the backup path on success, null on failure.


id: function:342f5e521ab89ea5ca1c60df85487566
kind: function
name: getMigrationStatus
qualified_name: getMigrationStatus
file_path: src/lib/db/migrationRunner.ts
language: typescript
signature:
(db: SqliteAdapter): {
  applied: Array<{ version: string; name: string; applied_at: string }>;
  pending: Array<{ version: string; name: string }>;
}


id: function:efa97d906647a919a4c0b0297fe30a26
kind: function
name: globToRegex
qualified_name: globToRegex
file_path: src/lib/db/modelComboMappings.ts
language: typescript
signature: (pattern: string): RegExp
docstring:
──────────────────────────────────────────────────────────
Glob → RegExp conversion
──────────────────────────────────────────────────────────
Convert a simple glob pattern to a RegExp.
Supports `*` (any characters) and `?` (single character).
Case-insensitive matching.


id: function:9010ac0b57305722da670dd9250a388f
kind: function
name: rowToMapping
qualified_name: rowToMapping
file_path: src/lib/db/modelComboMappings.ts
language: typescript
signature: (row: MappingRow): ModelComboMapping
docstring:
──────────────────────────────────────────────────────────
Row mapping
──────────────────────────────────────────────────────────


id: function:b79eaab6ccab1eab4abbfa351e85d920
kind: function
name: createModelComboMapping
qualified_name: createModelComboMapping
file_path: src/lib/db/modelComboMappings.ts
language: typescript
signature:
(data: {
  pattern: string;
  comboId: string;
  priority?: number;
  enabled?: boolean;
  description?: string;
}): Promise<ModelComboMapping>


id: function:f18dae76e12c48df60f85894b29b9bf1
kind: function
name: updateModelComboMapping
qualified_name: updateModelComboMapping
file_path: src/lib/db/modelComboMappings.ts
language: typescript
signature:
(
  id: string,
  data: Partial<{
    pattern: string;
    comboId: string;
    priority: number;
    enabled: boolean;
    description: string;
  }>
): Promise<ModelComboMapping | null>


id: function:d3d53428b453d1c5333ca399327ad082
kind: function
name: deepMergeCompatByProtocol
qualified_name: deepMergeCompatByProtocol
file_path: src/lib/db/models.ts
language: typescript
signature:
(
  prev: CompatByProtocolMap | undefined,
  patch: Partial<Record<ModelCompatProtocolKey, Partial<ModelCompatPerProtocol>>>
): CompatByProtocolMap


id: function:05f3335fd32db0a80655e0756d4aaa31
kind: function
name: addCustomModel
qualified_name: addCustomModel
file_path: src/lib/db/models.ts
language: typescript
signature:
(
  providerId: string,
  modelId: string,
  modelName?: string,
  source = "manual",
  apiFormat:
    | "chat-completions"
    | "responses"
    | "embeddings"
    | "rerank"
    | "audio-transcriptions"
    | "audio-speech"
    | "images-generations" = "chat-completions",
  supportedEndpoints: string[] = ["chat"]
)


id: function:3a51fb39e5a595981132b78205627e56
kind: function
name: replaceCustomModels
qualified_name: replaceCustomModels
file_path: src/lib/db/models.ts
language: typescript
signature:
(
  providerId: string,
  models: Array<{
    id: string;
    name?: string;
    source?: string;
    apiFormat?: string;
    supportedEndpoints?: string[];
    inputTokenLimit?: number;
    outputTokenLimit?: number;
    description?: string;
    supportsThinking?: boolean;
  }>,
  { allowEmpty = false }: { allowEmpty?: boolean } = {}
)


id: function:54c7759ed4dae34f88fc420cd70feec7
kind: function
name: replaceSyncedAvailableModelsForConnection
qualified_name: replaceSyncedAvailableModelsForConnection
file_path: src/lib/db/models.ts
language: typescript
signature:
(
  providerId: string,
  connectionId: string,
  models: SyncedAvailableModelInput[]
): Promise<SyncedAvailableModel[]>


id: function:070c3e7a97c1cf052eaa8df8d9d54903
kind: function
name: readUpstreamFromJsonRecord
qualified_name: readUpstreamFromJsonRecord
file_path: src/lib/db/models.ts
language: typescript
signature:
(
  row: JsonRecord | null | undefined,
  key: "upstreamHeaders"
): Record<string, string> | undefined


id: function:9b5515b55f75d4e6af1bd2b6303728bf
kind: function
name: listOneproxyProxies
qualified_name: listOneproxyProxies
file_path: src/lib/db/oneproxy.ts
language: typescript
signature:
(options?: {
  protocol?: string;
  countryCode?: string;
  minQuality?: number;
  limit?: number;
}): Promise<OneproxyProxyRecord[]>


id: function:49bc2927c0d0125b4d626026ba176f33
kind: function
name: upsertOneproxyProxy
qualified_name: upsertOneproxyProxy
file_path: src/lib/db/oneproxy.ts
language: typescript
signature:
(
  input: OneproxyUpsertInput
): Promise<{ proxy: OneproxyProxyRecord | null; action: "created" | "updated" }>


id: function:609a59ed729da1c870e65b5eb84d6618
kind: function
name: getOneproxyProxyForRotation
qualified_name: getOneproxyProxyForRotation
file_path: src/lib/db/oneproxy.ts
language: typescript
signature:
(options?: {
  strategy?: "random" | "quality" | "sequential";
}): Promise<OneproxyProxyRecord | null>


id: constant:69e38ffa968eea9887d38ef419d5cfcd
kind: constant
name: PROMPT_SCHEMA
qualified_name: PROMPT_SCHEMA
file_path: src/lib/db/prompts.ts
language: typescript
docstring: ── Schema (auto-created on first access) ──
signature:
= `
  CREATE TABLE IF NOT EXISTS prompt_templates (
    id INTEGER PRIMARY KEY AUTOINCREMENT,
    slug...


id: function:3b533c9f03822c50e844d1ea0191e476
kind: function
name: savePrompt
qualified_name: savePrompt
file_path: src/lib/db/prompts.ts
language: typescript
signature:
(
  slug: string,
  content: string,
  options: { variables?: string[]; description?: string } = {}
): PromptTemplate


id: import:354d0a9a983d150cb08ec7def234c29e
kind: import
name: ./encryption
qualified_name: ./encryption
file_path: src/lib/db/providers.ts
language: typescript
signature:
import {
  encryptConnectionFields,
  decryptConnectionFields,
  migrateLegacyEncryptedString,
} from "./encryption";


id: function:49fcea4320073cffd8935d5db436673c
kind: function
name: withNullableQuotaWindowThresholds
qualified_name: withNullableQuotaWindowThresholds
file_path: src/lib/db/providers.ts
language: typescript
signature: ( record: JsonRecord, source: JsonRecord | null | undefined ): JsonRecord
docstring:
Always surface `quotaWindowThresholds` (possibly null) on the returned
object — `cleanNulls` strips null values, but the UI needs to see null so
it can distinguish "no overrides on this connection" from "field was
never read." Mirrors `withNullableMaxConcurrent`'s contract so create and
update return the same shape regardless of whether the source had the key
stripped or carried forward.


id: function:a6509f46652ad060964c4b2490cd87b3
kind: function
name: sanitizeQuotaWindowThresholds
qualified_name: sanitizeQuotaWindowThresholds
file_path: src/lib/db/providers.ts
language: typescript
signature: (value: unknown): Record<string, number> | null
docstring:
Sanitize the per-window threshold map: keep only 0-100 integer values.
Called once at each write-path boundary (createProviderConnection +
updateProviderConnection) so both the in-memory return and the persisted
row share the same shape. Serialization below trusts this output.


id: function:4318ce667fcce51f3b73e8988578b4c6
kind: function
name: serializeQuotaWindowThresholds
qualified_name: serializeQuotaWindowThresholds
file_path: src/lib/db/providers.ts
language: typescript
signature: (value: unknown): string | null
docstring:
Serialize an already-sanitized map for SQLite TEXT storage. Pass `null` to
store a NULL column; anything else is expected to be the output of
sanitizeQuotaWindowThresholds above.


id: function:256e840fdfa91b802e5f4f7778bd2d58
kind: function
name: upsertProxy
qualified_name: upsertProxy
file_path: src/lib/db/proxies.ts
language: typescript
signature:
(payload: ProxyPayload): Promise<{
  proxy: ProxyRegistryRecord | null;
  action: "created" | "updated";
}>


id: function:5d092b6c8af2a7d61013610cb0d3e6b9
kind: function
name: assignProxyToScope
qualified_name: assignProxyToScope
file_path: src/lib/db/proxies.ts
language: typescript
signature:
(
  scope: string,
  scopeId: string | null,
  proxyId: string | null
): Promise<ProxyAssignmentRecord | null>


id: function:e9f5495fe1a1f863cd12a9875581b2d6
kind: function
name: bulkAssignProxyToScope
qualified_name: bulkAssignProxyToScope
file_path: src/lib/db/proxies.ts
language: typescript
signature:
(
  scope: string,
  scopeIds: string[],
  proxyId: string | null
): Promise<{ updated: number; failed: Array<{ scopeId: string; reason: string }> }>


id: function:d81983e244b57cbd060a7fe3474928c9
kind: function
name: getQuotaSnapshots
qualified_name: getQuotaSnapshots
file_path: src/lib/db/quotaSnapshots.ts
language: typescript
signature:
(opts: {
  provider?: string;
  connectionId?: string;
  since: string;
  until?: string;
}): QuotaSnapshotRow[]


id: function:7c87a2cbc8727b91d91ced69cb8dbce8
kind: function
name: getAggregatedSnapshots
qualified_name: getAggregatedSnapshots
file_path: src/lib/db/quotaSnapshots.ts
language: typescript
signature:
(opts: {
  provider?: string;
  since: string;
  until?: string;
  bucketMinutes: number;
  aggregateBy?: "provider" | "connection";
}): ProviderUtilizationPoint[]


id: type_alias:7518080f919435ed270f2468f075dd7a
kind: type_alias
name: CacheEntry
qualified_name: CacheEntry
file_path: src/lib/db/readCache.ts
language: typescript
docstring:
DB Read Cache — In-memory TTL cache for hot read paths.
SQLite reads are already fast since better-sqlite3 is synchronous and
memory-mapped. However, some functions (getSettings, getPricing,
getProviderConnections) are called on every request by multiple callers.
A short TTL cache (5s) eliminates redundant I/O without staling data for
long enough to matter (settings changes are applied within one cache cycle).
Usage:
  import { dbCache } from '@/lib/db/readCache';
  const settings = await dbCache.getSettings();


id: constant:674dcc438637b71f4513793eda7d6dfc
kind: constant
name: SETTINGS_TTL_MS
qualified_name: SETTINGS_TTL_MS
file_path: src/lib/db/readCache.ts
language: typescript
signature: = 5_000
docstring:
Cache with 5s TTL — short enough to pick up dashboard changes quickly,
long enough to serve burst request bursts without hammering SQLite.


id: function:c850934e6e3dbbbea54f78eeb4aaccd2
kind: function
name: setCachedLKGP
qualified_name: setCachedLKGP
file_path: src/lib/db/readCache.ts
language: typescript
signature:
(
  comboName: string,
  modelId: string,
  providerId: string,
  connectionId?: string
): Promise<void>


id: constant:f477e952b5f53f21f3e404bfda56f23d
kind: constant
name: EXPIRES_AT_EPOCH_SQL
qualified_name: EXPIRES_AT_EPOCH_SQL
file_path: src/lib/db/reasoningCache.ts
language: typescript
signature:
= `COALESCE(
  CASE
    WHEN typeof(expires_at) IN ('integer', 'real') THEN CAST(expires_at AS INTEGER...


id: function:e4cb9ac42d26b0fcc26b382a946f29ed
kind: function
name: setReasoningCache
qualified_name: setReasoningCache
file_path: src/lib/db/reasoningCache.ts
language: typescript
signature:
(
  toolCallId: string,
  provider: string,
  model: string,
  reasoning: string,
  ttlMs: number = DEFAULT_TTL_MS
): void


id: function:a0554455c73eb42e23e791e57f9fadb6
kind: function
name: getReasoningCacheEntries
qualified_name: getReasoningCacheEntries
file_path: src/lib/db/reasoningCache.ts
language: typescript
signature:
(
  opts: {
    limit?: number;
    offset?: number;
    provider?: string;
    model?: string;
  } = {}
): ReasoningCacheEntry[]


id: function:9344dab8483754faeab5fcc73c6c10ff
kind: function
name: maybeResetWindow
qualified_name: maybeResetWindow
file_path: src/lib/db/registeredKeys.ts
language: typescript
docstring: Reset window counters if the tracking period has changed.
signature:
(
  db: ReturnType<typeof getDbInstance>,
  table: string,
  idField: string,
  idValue: string
): void


id: function:297d448510fc10dafb0559104c0e1eb4
kind: function
name: issueRegisteredKey
qualified_name: issueRegisteredKey
file_path: src/lib/db/registeredKeys.ts
language: typescript
signature:
(
  params: IssueKeyParams
): RegisteredKeyWithSecret | { idempotencyConflict: true; existing: RegisteredKey }


id: function:c9faaf6973d43952aac1b85741c3f419
kind: function
name: setProviderKeyLimit
qualified_name: setProviderKeyLimit
file_path: src/lib/db/registeredKeys.ts
language: typescript
signature:
(
  provider: string,
  limits: Partial<Omit<ProviderKeyLimit, "provider" | "dailyIssued" | "hourlyIssued" | "updatedAt">>
): void


id: function:f2b8482869f58aa4688a45e57a9b9717
kind: function
name: setAccountKeyLimit
qualified_name: setAccountKeyLimit
file_path: src/lib/db/registeredKeys.ts
language: typescript
signature:
(
  accountId: string,
  limits: Partial<Omit<AccountKeyLimit, "accountId" | "dailyIssued" | "hourlyIssued" | "updatedAt">>
): void


id: function:99fb00f197f770c908b5bed67a579489
kind: function
name: upsertSessionAccountAffinity
qualified_name: upsertSessionAccountAffinity
file_path: src/lib/db/sessionAccountAffinity.ts
language: typescript
signature:
(
  sessionKey: string,
  provider: string,
  connectionId: string,
  now: number = Date.now()
): void


id: function:2842f85194752049d7b28090c52f07d5
kind: function
name: cacheProxyResolution
qualified_name: cacheProxyResolution
file_path: src/lib/db/settings.ts
language: typescript
signature:
(
  connectionId: string,
  generation: number,
  registryGeneration: number,
  result: ProxyResolutionResult
)


id: function:579cc4a525dcda5dc0b94091268a71cf
kind: function
name: buildPricingSourceMap
qualified_name: buildPricingSourceMap
file_path: src/lib/db/settings.ts
language: typescript
signature:
(layers: {
  defaults: PricingByProvider;
  litellm: PricingByProvider;
  modelsDev: PricingByProvider;
  user: PricingByProvider;
}): PricingSourceMap


id: constant:46aaa6bf58b8fbc30f009bae6e517efc
kind: constant
name: ALIAS_TO_PROVIDER_ID
qualified_name: ALIAS_TO_PROVIDER_ID
file_path: src/lib/db/settings.ts
language: typescript
signature:
= Object.entries(PROVIDER_ID_TO_ALIAS).reduce(
  (acc, [providerId, alias]) => {
    if (alias) acc[al...


id: type_alias:3b819a4eb1bdc2006400fd63178a6f4f
kind: type_alias
name: DbStateResetter
qualified_name: DbStateResetter
file_path: src/lib/db/stateReset.ts
language: typescript
docstring:
Central registry for DB module state resetters.
Used by restore flows to clear prepared statement caches without cross-module imports.


id: function:96cd2debe6714b7eaca22b372b83d1c0
kind: function
name: upsertUpstreamProxyConfig
qualified_name: upsertUpstreamProxyConfig
file_path: src/lib/db/upstreamProxy.ts
language: typescript
signature:
(data: {
  providerId: string;
  mode?: string;
  cliproxyapiModelMapping?: Record<string, unknown> | null;
  nativePriority?: number;
  cliproxyapiPriority?: number;
  enabled?: boolean;
})


id: function:1f9aaee18cf4f0083ac824c8d755821e
kind: function
name: upsertVersionManagerTool
qualified_name: upsertVersionManagerTool
file_path: src/lib/db/versionManager.ts
language: typescript
signature:
(data: {
  tool: string;
  currentVersion?: string | null;
  installedVersion?: string | null;
  pinnedVersion?: string | null;
  binaryPath?: string | null;
  status?: string;
  pid?: number | null;
  port?: number;
  apiKey?: string | null;
  managementKey?: string | null;
  autoUpdate?: boolean;
  autoStart?: boolean;
  healthStatus?: string;
  configOverrides?: Record<string, unknown> | null;
  errorMessage?: string | null;
}): Promise<VersionManagerTool>


id: function:60bcce67339e78d3cadf6be71cc3a8d1
kind: function
name: updateToolVersion
qualified_name: updateToolVersion
file_path: src/lib/db/versionManager.ts
language: typescript
signature:
(
  tool: string,
  field: "current_version" | "installed_version",
  version: string
): Promise<boolean>


id: function:d0d0763ea73e155ae3463f989849394f
kind: function
name: updateWebhook
qualified_name: updateWebhook
file_path: src/lib/db/webhooks.ts
language: typescript
signature:
(
  id: string,
  data: Partial<{
    url: string;
    events: string[];
    secret: string;
    enabled: boolean;
    description: string;
  }>
): Webhook | null


id: import:13c3e2617a13a3f172eeb53ebe94c46a
kind: import
name: @omniroute/open-sse/config/embeddingRegistry.ts
qualified_name: @omniroute/open-sse/config/embeddingRegistry.ts
file_path: src/lib/embeddings/service.ts
language: typescript
signature:
import {
  parseEmbeddingModel,
  getEmbeddingProvider,
  buildDynamicEmbeddingProvider,
  type EmbeddingProviderNodeRow,
  type EmbeddingProvider,
} from "@omniroute/open-sse/config/embeddingRegistry.ts";


id: constant:e7a8a6074b6d76a5a84cbadad848309c
kind: constant
name: optionalHttpUrl
qualified_name: optionalHttpUrl
file_path: src/lib/env/runtimeEnv.ts
language: typescript
signature:
= z.preprocess(
  normalizeOptionalString,
  z
    .string()
    .url()
    .refine((value) => value.s...


id: constant:cfd5f6e9f75a2a41a0ccc4f028244955
kind: constant
name: optionalPortEnv
qualified_name: optionalPortEnv
file_path: src/lib/env/runtimeEnv.ts
language: typescript
signature:
= z.preprocess(
  normalizeOptionalString,
  z
    .string()
    .regex(/^\d+$/, "must be an integer b...


id: constant:948610ad52323158cdec8773b14544b1
kind: constant
name: webRuntimeEnvSchema
qualified_name: webRuntimeEnvSchema
file_path: src/lib/env/runtimeEnv.ts
language: typescript
signature:
= z.object({
  NODE_ENV: z.preprocess(normalizeOptionalString, z.enum(NODE_ENV_VALUES).optional()),
  ...


id: function:cd3f1377e2c15b508de5d223d7f7e8f4
kind: function
name: enforceWebRuntimeEnv
qualified_name: enforceWebRuntimeEnv
file_path: src/lib/env/runtimeEnv.ts
language: typescript
signature:
(
  env: NodeJS.ProcessEnv = process.env,
  logger: Pick<Console, "error" | "warn"> = console
): void


id: constant:0b6313f427b8c687fb95db7e8f8c14d8
kind: constant
name: suites
qualified_name: suites
file_path: src/lib/evals/evalRunner.ts
language: typescript
signature: = new Map()
docstring:
@typedef {Object} EvalCase
@property {string} id - Unique case ID
@property {string} name - Human-readable name
@property {string} model - Target model
@property {Object} input - Request input (messages, etc.)
@property {Object} expected - Expected output criteria
@property {string} expected.strategy - "exact" | "contains" | "regex" | "custom"
@property {string|RegExp} [expected.value] - Expected value for match strategies
@property {Function} [expected.fn] - Custom evaluation function
@property {string[]} [tags] - Tags for filtering
@typedef {Object} EvalResult
@property {string} caseId
@property {string} caseName
@property {boolean} passed
@property {number} durationMs
@property {string} [error]
@property {Object} [details]
@typedef {Object} EvalSuite
@property {string} id
@property {string} name
@property {EvalCase[]} cases
@property {string} [description]
@type {Map<string, EvalSuite>}


id: function:4b73143a0094f42c8e7a7bfdda907013
kind: function
name: runSuite
qualified_name: runSuite
file_path: src/lib/evals/evalRunner.ts
language: typescript
signature:
(
  suiteId: string,
  outputs: Record<string, string>,
  caseMetrics: Record<string, { durationMs?: number; error?: string }> = {}
)


id: constant:f501021dea448c881d8135281d1f12c6
kind: constant
name: goldenSet
qualified_name: goldenSet
file_path: src/lib/evals/evalRunner.ts
language: typescript
docstring: ─── Built-in Golden Set Suite (≥10 cases, multi-model) ────────────────
signature:
= {
  id: "golden-set",
  name: "OmniRoute Golden Set",
  description: "Baseline evaluation cases for ...


id: constant:0ccd506100a7575a970f38b4970c7ed1
kind: constant
name: codingSuite
qualified_name: codingSuite
file_path: src/lib/evals/evalRunner.ts
language: typescript
docstring: ─── Coding Proficiency Suite ──────────────────────────────────────────
signature:
= {
  id: "coding-proficiency",
  name: "Coding Proficiency",
  description: "Tests code generation, d...


id: constant:44fa8068bc7fa568a12cabcd3908e510
kind: constant
name: reasoningSuite
qualified_name: reasoningSuite
file_path: src/lib/evals/evalRunner.ts
language: typescript
docstring: ─── Reasoning & Logic Suite ───────────────────────────────────────────
signature:
= {
  id: "reasoning-logic",
  name: "Reasoning & Logic",
  description: "Tests logical deduction, mat...


id: constant:c74c7450d7e00237b5eed1b7501eb46c
kind: constant
name: multilingualSuite
qualified_name: multilingualSuite
file_path: src/lib/evals/evalRunner.ts
language: typescript
docstring: ─── Multilingual Suite ────────────────────────────────────────────────
signature:
= {
  id: "multilingual",
  name: "Multilingual",
  description: "Tests translation, language detectio...


id: constant:9f2e8f176917019cf0a6ddfd6ea4e902
kind: constant
name: safetySuite
qualified_name: safetySuite
file_path: src/lib/evals/evalRunner.ts
language: typescript
docstring: ─── Safety & Guardrails Suite ─────────────────────────────────────────
signature:
= {
  id: "safety-guardrails",
  name: "Safety & Guardrails",
  description:
    "Tests PII handling, ...


id: constant:aa792ae037276d7b0bcff03585736811
kind: constant
name: instructionSuite
qualified_name: instructionSuite
file_path: src/lib/evals/evalRunner.ts
language: typescript
docstring: ─── Instruction Following Suite ───────────────────────────────────────
signature:
= {
  id: "instruction-following",
  name: "Instruction Following",
  description: "Tests format compl...


id: constant:40f732a21182b390d0b81136747cfbd4
kind: constant
name: codexComparisonSuite
qualified_name: codexComparisonSuite
file_path: src/lib/evals/evalRunner.ts
language: typescript
docstring: ─── Codex Comparison Suite ────────────────────────────────────────────
signature:
= {
  id: "codex-comparison",
  name: "Codex Comparison",
  description:
    "Head-to-head coding task...


id: function:75b7afbf149e193e9428afd471b01c12
kind: function
name: executeEvalCase
qualified_name: executeEvalCase
file_path: src/lib/evals/runtime.ts
language: typescript
signature:
(
  evalCase: Record<string, unknown>,
  target: EvalTargetInput,
  apiKey: string | null
): Promise<{ output: string; durationMs: number; error?: string }>


id: function:f63d529324e8a3ada7f1f11487c989f7
kind: function
name: runEvalSuiteAgainstTarget
qualified_name: runEvalSuiteAgainstTarget
file_path: src/lib/evals/runtime.ts
language: typescript
signature:
(input: {
  suiteId: string;
  target?: EvalTargetInput | null;
  apiKeyId?: string;
  runGroupId?: string | null;
}): Promise<PersistedEvalRun>


id: function:290b9abc0ee724e2280827954b59b519
kind: function
name: computeZScore
qualified_name: computeZScore
file_path: src/lib/gamification/antiCheat.ts
language: typescript
signature: (apiKeyId: string): Promise<number | null>
docstring:
─── Internal Helpers ────────────────────────────────────────────────────────
Compute the z-score for a user's hourly XP against the global distribution.
Returns null if insufficient data.


id: constant:9369589742b04f21e1467d14fce31e67
kind: constant
name: BUILTIN_BADGES
qualified_name: BUILTIN_BADGES
file_path: src/lib/gamification/badges.ts
language: typescript
signature:
= [
  // ── Token Usage (Milestone) ──────────────────────────────────────────────
  {
    id: "first-...


id: function:993a4b79bc255ec84d359a56ec6cc86b
kind: function
name: getActionCount
qualified_name: getActionCount
file_path: src/lib/gamification/badges.ts
language: typescript
signature: (apiKeyId: string, action: string): Promise<number>
docstring:
─── Helper: Action Count ────────────────────────────────────────────────────
Get the total count of a specific action for an API key from the XP audit log.


id: function:bb8831c00a06336222b5a480781d33db
kind: function
name: getUniqueCount
qualified_name: getUniqueCount
file_path: src/lib/gamification/badges.ts
language: typescript
signature: (apiKeyId: string, type: string): Promise<number>
docstring:
─── Helper: Unique Count ────────────────────────────────────────────────────
Get the count of unique values for a given type (provider, model, etc.)
from the XP audit log metadata.


id: function:d69dfdf18a02f4340e9a584788371065
kind: function
name: getStreak
qualified_name: getStreak
file_path: src/lib/gamification/badges.ts
language: typescript
signature: (apiKeyId: string): Promise<number>
docstring:
─── Helper: Streak ──────────────────────────────────────────────────────────
Get the current streak count for an API key.
Delegates to the streaks module to avoid duplication.


id: function:634798e6d3c06a005095580df2a92b8a
kind: function
name: getRank
qualified_name: getRank
file_path: src/lib/gamification/badges.ts
language: typescript
signature: (apiKeyId: string, scope: string): Promise<number>
docstring:
─── Helper: Leaderboard Rank ────────────────────────────────────────────────
Get the rank of an API key on the global leaderboard.
Rank = number of users with a higher score + 1.


id: function:0be18e7995bd3786b805fff92021f5b9
kind: function
name: emitGamificationEvent
qualified_name: emitGamificationEvent
file_path: src/lib/gamification/events.ts
language: typescript
signature:
(params: {
  apiKeyId: string;
  action:
    | "request"
    | "provider_switch"
    | "model_switch"
    | "combo_create"
    | "combo_use"
    | "token_share"
    | "invite_redeem"
    | "daily_login";
  metadata?: Record<string, unknown>;
}): Promise<void>


id: function:accf63a1b6d29259f80aeeb85b51b75f
kind: function
name: createInvite
qualified_name: createInvite
file_path: src/lib/gamification/invites.ts
language: typescript
signature:
(
  createdByApiKeyId: string,
  serverUrl?: string,
  maxUses: number = 1
): Promise<{ code: string; token: string }>


id: function:e7201291570681f4fc942d528a81521b
kind: function
name: redeemInvite
qualified_name: redeemInvite
file_path: src/lib/gamification/invites.ts
language: typescript
signature:
(
  code: string,
  usedByApiKeyId: string
): Promise<{ success: boolean; serverUrl?: string; error?: string }>


id: function:11a641e0b398fc5b70fd7b3f81b576d6
kind: function
name: getNeighbors
qualified_name: getNeighbors
file_path: src/lib/gamification/leaderboard.ts
language: typescript
signature:
(
  apiKeyId: string,
  scope: LeaderboardScope,
  radius: number = 5
): Promise<{ above: LeaderboardEntry[]; below: LeaderboardEntry[] }>


id: function:f09786ef0b9f9a9ebdc252c698d8d1d4
kind: function
name: pushScore
qualified_name: pushScore
file_path: src/lib/gamification/servers.ts
language: typescript
signature:
(
  serverId: string,
  apiKeyId: string,
  score: number
): Promise<{ success: boolean; error?: string }>


id: function:1f5238d3fb7383a62473d99780bca2cc
kind: function
name: transferTokens
qualified_name: transferTokens
file_path: src/lib/gamification/sharing.ts
language: typescript
signature:
(
  fromApiKeyId: string,
  toApiKeyId: string,
  amount: number,
  reason?: string,
  idempotencyKey?: string
): Promise<{ success: boolean; idempotencyKey: string; error?: string }>


id: function:0448615d96457695688137cb2ff54ef5
kind: function
name: todayUtc
qualified_name: todayUtc
file_path: src/lib/gamification/streaks.ts
language: typescript
signature: (): string
docstring:
─── Helpers ─────────────────────────────────────────────────────────────────
Get today's date as YYYY-MM-DD in UTC.


id: constant:d0f3b044b176497b5641815561e01ccd
kind: constant
name: XP_REWARDS
qualified_name: XP_REWARDS
file_path: src/lib/gamification/xp.ts
language: typescript
signature:
= {
  /** Per API request routed through OmniRoute */
  request: 1,
  /** Switching to a different pro...


id: constant:04a0dadc28e087b6a1e3c87bce54a1ea
kind: constant
name: SHUTDOWN_TIMEOUT_MS
qualified_name: SHUTDOWN_TIMEOUT_MS
file_path: src/lib/gracefulShutdown.ts
language: typescript
signature: = parseInt(process.env.SHUTDOWN_TIMEOUT_MS || "30000", 10)
docstring:
Graceful Shutdown — E-2 Critical Fix
Handles SIGTERM / SIGINT to drain in-flight requests before exit.
Critical for Docker containers and Kubernetes pods where hard kills
can drop active SSE streams.
Usage:
  import { initGracefulShutdown } from "@/lib/gracefulShutdown";
  initGracefulShutdown();
@module lib/gracefulShutdown
Grace period before forced exit (default 30s, configurable)


id: method:3397f1f9ce249e4b34fd16521caf25fe
kind: method
name: preCall
qualified_name: BaseGuardrail::preCall
file_path: src/lib/guardrails/base.ts
language: typescript
signature:
(
    _payload: unknown,
    _context: GuardrailContext
  ): Promise<GuardrailResult<unknown> | void>


id: method:c029a7bcb949a45afbd39b12012c228d
kind: method
name: postCall
qualified_name: BaseGuardrail::postCall
file_path: src/lib/guardrails/base.ts
language: typescript
signature:
(
    _response: unknown,
    _context: GuardrailContext
  ): Promise<GuardrailResult<unknown> | void>


id: constant:22895d3a01a0b14f4c86f7d3d38776b1
kind: constant
name: DEFAULT_GUARD_PATTERNS
qualified_name: DEFAULT_GUARD_PATTERNS
file_path: src/lib/guardrails/promptInjection.ts
language: typescript
signature:
= [
  {
    name: "system_override_inline",
    pattern: /\bsystem\s*:\s*override\b/i,
    severity: "...


id: function:0175c81dc8998fb7e997bc58cb9fbede
kind: function
name: evaluatePromptInjection
qualified_name: evaluatePromptInjection
file_path: src/lib/guardrails/promptInjection.ts
language: typescript
signature:
(
  body: unknown,
  options: PromptInjectionGuardrailOptions = {},
  context: GuardrailContext = {}
): PromptInjectionGuardrailDecision


id: function:c7d0efca8b336393f5284777fd9938e7
kind: function
name: resolveDisabledGuardrails
qualified_name: resolveDisabledGuardrails
file_path: src/lib/guardrails/registry.ts
language: typescript
signature:
({
  apiKeyInfo,
  body,
  headers,
}: {
  apiKeyInfo?: Record<string, unknown> | null;
  body?: unknown;
  headers?: HeadersLike;
}): string[]


id: import:a11addaecd3dfc74bc171d924744acd1
kind: import
name: ./visionBridgeHelpers
qualified_name: ./visionBridgeHelpers
file_path: src/lib/guardrails/visionBridge.ts
language: typescript
signature:
import {
  extractImageParts,
  callVisionModel as defaultCallVisionModel,
  replaceImageParts,
} from "./visionBridgeHelpers";


id: import:e0f8884e44c5b65e143c5455849ac154
kind: import
name: @/shared/constants/visionBridgeDefaults
qualified_name: @/shared/constants/visionBridgeDefaults
file_path: src/lib/guardrails/visionBridge.ts
language: typescript
signature:
import {
  VISION_BRIDGE_DEFAULTS,
  getVisionBridgeConfig,
  isVisionBridgeForcedModel,
} from "@/shared/constants/visionBridgeDefaults";


id: function:ad76aab7808b7afaaff88f2ca940bf4b
kind: function
name: getClientIpFromRequest
qualified_name: getClientIpFromRequest
file_path: src/lib/ipUtils.ts
language: typescript
signature:
(req: {
  headers?: Headers | { get?: (n: string) => string | null };
  socket?: { remoteAddress?: string };
  ip?: string;
}): string


id: constant:1f2c37248d2320c032f309770580323a
kind: constant
name: SENSITIVE_KEYS
qualified_name: SENSITIVE_KEYS
file_path: src/lib/logPayloads.ts
language: typescript
signature:
= new Set([
  "api_key",
  "apiKey",
  "api-key",
  "authorization",
  "Authorization",
  "x-api-key",...


id: import:99e6602f9b1e3a9e2706765519665ae3
kind: import
name: ./logEnv
qualified_name: ./logEnv
file_path: src/lib/logRotation.ts
language: typescript
signature:
import {
  getAppLogFilePath,
  getAppLogMaxFiles,
  getAppLogMaxFileSize,
  getAppLogRetentionDays,
  getAppLogToFile,
} from "./logEnv";


id: import:8d5e009c1880c4d7ef69dcf17b46edc2
kind: import
name: ../injection
qualified_name: ../injection
file_path: src/lib/memory/__tests__/injection.test.ts
language: typescript
signature:
import {
  injectMemory,
  shouldInjectMemory,
  formatMemoryContext,
  providerSupportsSystemMessage,
  ChatRequest,
} from "../injection";


id: constant:fc852ac11e857c164e1c80ba30b8b4e5
kind: constant
name: API_KEY_ID
qualified_name: API_KEY_ID
file_path: src/lib/memory/__tests__/retrieval.test.ts
language: typescript
signature: = "test-api-key-fts5"
docstring:
────────────────────────────────────────────────────────────
FTS5-specific tests (real in-memory SQLite DB)
────────────────────────────────────────────────────────────


id: function:2e9fa4ff875192ca7413be8a256b23d7
kind: function
name: setupSchema
qualified_name: setupSchema
file_path: src/lib/memory/__tests__/retrieval.test.ts
language: typescript
signature: (db: InstanceType<typeof Database>)
docstring:
Helper: create the `memories` table + `memory_fts` FTS5 virtual table
with the same DDL used in the real migrations (015 + 022).


id: function:e280d7d49a6cfe6c55d99b153e77b4ae
kind: function
name: insertMemory
qualified_name: insertMemory
file_path: src/lib/memory/__tests__/retrieval.test.ts
language: typescript
docstring: Insert a memory row with an auto-incremented INTEGER id (FTS5-compatible).
signature:
(
  db: InstanceType<typeof Database>,
  opts: {
    apiKeyId?: string;
    sessionId?: string;
    type?: string;
    key?: string;
    content: string;
    metadata?: string;
    createdAt?: string;
  }
)


id: constant:6af53094e7a05342639a094faf7b97e4
kind: constant
name: PREFERENCE_PATTERNS
qualified_name: PREFERENCE_PATTERNS
file_path: src/lib/memory/extraction.ts
language: typescript
docstring:
─── Pattern Definitions ────────────────────────────────────────────────────
Patterns indicating user preferences

signature:
= [
  /\bI\s+(?:really\s+)?prefer\s+([^.,\n]+)/gi,
  /\bI\s+(?:really\s+)?like\s+([^.,\n]+)/gi,
  /\bm...


id: constant:00f210903339ee8ff7dcb20908bc6f3d
kind: constant
name: DECISION_PATTERNS
qualified_name: DECISION_PATTERNS
file_path: src/lib/memory/extraction.ts
language: typescript
docstring: Patterns indicating user decisions
signature:
= [
  /\bI'?(?:ll|will)\s+use\s+([^.,\n]+)/gi,
  /\bI\s+chose\s+([^.,\n]+)/gi,
  /\bI\s+(?:have\s+)?de...


id: constant:970874a7daa1db92fea1b968d0216669
kind: constant
name: PATTERN_PATTERNS
qualified_name: PATTERN_PATTERNS
file_path: src/lib/memory/extraction.ts
language: typescript
docstring: Patterns indicating user behavioral patterns
signature:
= [
  /\bI\s+usually\s+([^.,\n]+)/gi,
  /\bI\s+always\s+([^.,\n]+)/gi,
  /\bI\s+never\s+([^.,\n]+)/gi,...


id: function:3ea8b83e5fd5098034947ab91b593baa
kind: function
name: sanitizeMatch
qualified_name: sanitizeMatch
file_path: src/lib/memory/extraction.ts
language: typescript
signature: (raw: string): string
docstring:
─── Extraction Logic ────────────────────────────────────────────────────────
Sanitize a matched string: trim, collapse whitespace, cap length


id: function:26099f8fb0cef80140e3b4b2509595ba
kind: function
name: runPatterns
qualified_name: runPatterns
file_path: src/lib/memory/extraction.ts
language: typescript
docstring:
Run a set of patterns against text and collect extracted facts.
Deduplicates by key within the batch.

signature:
(
  text: string,
  patterns: RegExp[],
  category: "preference" | "decision" | "pattern",
  memoryType: MemoryType,
  seen: Set<string>
): ExtractedFact[]


id: constant:c8efca78899741c3697cc824ef292c03
kind: constant
name: PROVIDERS_WITHOUT_SYSTEM_MESSAGE
qualified_name: PROVIDERS_WITHOUT_SYSTEM_MESSAGE
file_path: src/lib/memory/injection.ts
language: typescript
docstring:
Providers known NOT to support a top-level system-role message.
These receive memories injected as the first user message instead.

signature:
= new Set([
  "o1",
  "o1-mini",
  "o1-preview",
  "glm", // GLM/ZhipuAI rejects system role (#1701)
 ...


id: function:38616fcff11ff2db8bd34299d8af388c
kind: function
name: injectMemory
qualified_name: injectMemory
file_path: src/lib/memory/injection.ts
language: typescript
signature:
(
  request: ChatRequest,
  memories: Memory[],
  provider: string | null | undefined
): ChatRequest


id: function:00ce1f6888c172e91ce6dc271d18614d
kind: function
name: upsertSemanticMemoryPoint
qualified_name: upsertSemanticMemoryPoint
file_path: src/lib/memory/qdrant.ts
language: typescript
signature:
(input: {
  id: string;
  apiKeyId: string;
  sessionId: string;
  key: string;
  content: string;
  metadata: JsonRecord;
  createdAt: string;
  expiresAt: string | null;
}): Promise<{ ok: boolean; latencyMs: number; error?: string }>


id: function:8d55af8e3aa13597a9c6e2e205a31115
kind: function
name: searchSemanticMemory
qualified_name: searchSemanticMemory
file_path: src/lib/memory/qdrant.ts
language: typescript
signature:
(
  query: string,
  topK = 5,
  scope?: { apiKeyId?: string; sessionId?: string | null }
): Promise<{
  ok: boolean;
  latencyMs: number;
  results?: Array<{ id: string; score: number; payload?: JsonRecord }>;
  error?: string;
}>


id: function:0a509a1ee97c099559c74afed9d1bce2
kind: function
name: cleanupSemanticMemoryPoints
qualified_name: cleanupSemanticMemoryPoints
file_path: src/lib/memory/qdrant.ts
language: typescript
signature:
(input: {
  retentionDays: number;
}): Promise<{ ok: boolean; deletedCount: number; latencyMs: number; error?: string }>


id: constant:81be8648be0fd33d04ff85ec67108bc3
kind: constant
name: MemoryConfigSchema
qualified_name: MemoryConfigSchema
file_path: src/lib/memory/schemas.ts
language: typescript
signature:
= z.object({
  enabled: z.boolean(),
  maxTokens: z.number().int().nonnegative(),
  retrievalStrategy:...


id: constant:3fc92e654b534aae3d473ad53c336c64
kind: constant
name: MemoryCreateInputSchema
qualified_name: MemoryCreateInputSchema
file_path: src/lib/memory/schemas.ts
language: typescript
signature:
= z
  .object({
    type: z.nativeEnum(MemoryType),
    key: z.string().min(1),
    content: z.string(...


id: constant:a5f90b96c0fec84db5e94731be858339
kind: constant
name: MemoryUpdateInputSchema
qualified_name: MemoryUpdateInputSchema
file_path: src/lib/memory/schemas.ts
language: typescript
signature:
= z
  .object({
    type: z.nativeEnum(MemoryType).optional(),
    key: z.string().min(1).optional(),
...


id: constant:11672d82d2090189fdead7e634c51f05
kind: constant
name: DEFAULT_MEMORY_SETTINGS
qualified_name: DEFAULT_MEMORY_SETTINGS
file_path: src/lib/memory/settings.ts
language: typescript
signature:
= {
  enabled: true,
  maxTokens: 2000,
  retentionDays: 30,
  strategy: "hybrid",
  skillsEnabled: tr...


id: function:e75b4efff2c2ad638cc68064271f5f42
kind: function
name: findExistingMemory
qualified_name: findExistingMemory
file_path: src/lib/memory/store.ts
language: typescript
docstring: Find existing memory by apiKeyId and key (for UPSERT logic)
signature:
(
  db: ReturnType<typeof getDbInstance>,
  apiKeyId: string,
  key: string
): MemoryRow | undefined


id: function:5998a81789bb5555eda672e9a01fb143
kind: function
name: listMemories
qualified_name: listMemories
file_path: src/lib/memory/store.ts
language: typescript
signature:
(filters: {
  apiKeyId?: string;
  type?: MemoryType;
  sessionId?: string;
  query?: string;
  limit?: number;
  offset?: number;
  page?: number;
}): Promise<{ data: Memory[]; total: number; byType: Record<string, number> }>


id: function:bf9276dfad2649ac7a0ad4692abb8b06
kind: function
name: summarizeMemories
qualified_name: summarizeMemories
file_path: src/lib/memory/summarization.ts
language: typescript
signature:
(
  apiKeyId: string,
  sessionId?: string,
  maxTokens: number = 4000
): Promise<SummarizationResult>


id: function:65260a683f54b3020eccb7ee177cea08
kind: function
name: readHeader
qualified_name: readHeader
file_path: src/lib/middleware/cliTokenAuth.ts
language: typescript
signature: (request: Request, name: string): Promise<string | null>
docstring:
Read a header value preferring the Request's own headers (works in any
context — App Router request handlers, unit tests, raw fetch) and falling
back to `next/headers` only when the request object isn't carrying them.
Calling `headers()` outside a request scope throws (see Next.js
`next-dynamic-api-wrong-context`), so we guard the import.


id: constant:f0be62941c405e3e7425d7fcdfc9ddbf
kind: constant
name: DEFAULT_MODEL_ALIAS_SEED
qualified_name: DEFAULT_MODEL_ALIAS_SEED
file_path: src/lib/modelAliasSeed.ts
language: typescript
signature:
= Object.freeze({
  "gemini-1.5-pro": "gemini-cli/gemini-1.5-pro",
  "gemini-1.5-flash": "gemini-cli/g...


id: import:072109f9b5cdbc9e2fd13356c6b2c385
kind: import
name: @omniroute/open-sse/config/providerModels.ts
qualified_name: @omniroute/open-sse/config/providerModels.ts
file_path: src/lib/modelCapabilities.ts
language: typescript
signature:
import {
  PROVIDER_ID_TO_ALIAS,
  PROVIDER_MODELS,
} from "@omniroute/open-sse/config/providerModels.ts";


id: constant:1b20e677bac64a83130120a79382f758
kind: constant
name: REASONING_UNSUPPORTED_PATTERNS
qualified_name: REASONING_UNSUPPORTED_PATTERNS
file_path: src/lib/modelCapabilities.ts
language: typescript
signature:
= [
  "antigravity/claude-sonnet-4-6",
  "antigravity/claude-sonnet-4-5",
  "antigravity/claude-sonnet...


id: function:b1d381cd1bdbda8743b4342934e1205d
kind: function
name: resolveVisionCapability
qualified_name: resolveVisionCapability
file_path: src/lib/modelCapabilities.ts
language: typescript
signature:
(
  spec: ModelSpec | undefined,
  registryModel: { supportsVision?: boolean } | null,
  synced: SyncedCapabilities,
  modalitiesInput: string[],
  modalitiesOutput: string[]
): boolean | null


id: import:9b4be542e1ea11451606ea9148e94861
kind: import
name: @/shared/constants/modelSpecs
qualified_name: @/shared/constants/modelSpecs
file_path: src/lib/modelMetadataRegistry.ts
language: typescript
signature:
import {
  getModelSpec,
  resolveModelAlias as resolveStaticModelAlias,
} from "@/shared/constants/modelSpecs";


id: function:c96c7d4bf2a5cb71ff86b3ab31940025
kind: function
name: buildModalities
qualified_name: buildModalities
file_path: src/lib/modelMetadataRegistry.ts
language: typescript
signature:
(
  input: string[],
  output: string[],
  supportsVision: boolean | null
): { input: string[]; output: string[] }


id: function:27d57f459b03c74158c626d952d62f9b
kind: function
name: resolveModelAliasLookup
qualified_name: resolveModelAliasLookup
file_path: src/lib/modelMetadataRegistry.ts
language: typescript
signature:
(
  alias: string
): Promise<{ ok: true; value: ResolvedAliasLookup } | { ok: false; error: AliasResolutionError }>


id: constant:e66bb41a223c7a605bd371aa45244527
kind: constant
name: MODELS_DEV_PROVIDER_MAP
qualified_name: MODELS_DEV_PROVIDER_MAP
file_path: src/lib/modelsDevSync.ts
language: typescript
docstring:
─── Provider mapping: models.dev provider ID → OmniRoute provider IDs/aliases ──

models.dev uses canonical provider IDs (e.g. "openai", "anthropic", "google").
OmniRoute uses both full IDs and short aliases (e.g. "cc" for claude, "cx" for codex).
We map each models.dev provider to ALL OmniRoute identifiers that should receive
its pricing/capability data.

signature:
= {
  // Major providers
  openai: ["openai", "cx"], // cx = Codex (uses OpenAI models)
  anthropic: [...


id: function:09013c80b45d7e3d58f9c82acd2f6bc7
kind: function
name: syncModelsDev
qualified_name: syncModelsDev
file_path: src/lib/modelsDevSync.ts
language: typescript
signature:
(opts?: {
  dryRun?: boolean;
  syncCapabilities?: boolean;
  maxRetries?: number;
  signal?: AbortSignal;
}): Promise<SyncResult>


id: function:2bce5277065a54ab4cb5ec2dbe1326da
kind: function
name: buildHealthPayload
qualified_name: buildHealthPayload
file_path: src/lib/monitoring/observability.ts
language: typescript
signature:
({
  appVersion,
  catalogCount = 0,
  settings,
  connections,
  circuitBreakers,
  rateLimitStatus,
  learnedLimits,
  lockouts,
  localProviders,
  inflightRequests,
  quotaMonitorSummary,
  quotaMonitorMonitors,
  activeSessions,
  activeSessionsByKey = {},
}: BuildHealthPayloadOptions)


id: import:5529b6e1e2d26ae40679d637a51af970
kind: import
name: @omniroute/open-sse/config/antigravityUpstream.ts
qualified_name: @omniroute/open-sse/config/antigravityUpstream.ts
file_path: src/lib/oauth/constants/oauth.ts
language: typescript
signature:
import {
  ANTIGRAVITY_BASE_URLS,
  getAntigravityFetchAvailableModelsUrls,
} from "@omniroute/open-sse/config/antigravityUpstream.ts";


id: import:28c56a37babcd5fdeaa903297fac30c8
kind: import
name: @omniroute/open-sse/services/antigravityHeaders.ts
qualified_name: @omniroute/open-sse/services/antigravityHeaders.ts
file_path: src/lib/oauth/constants/oauth.ts
language: typescript
signature:
import {
  ANTIGRAVITY_LOAD_CODE_ASSIST_API_CLIENT,
  ANTIGRAVITY_LOAD_CODE_ASSIST_USER_AGENT,
  getAntigravityLoadCodeAssistClientMetadata,
} from "@omniroute/open-sse/services/antigravityHeaders.ts";


id: import:f7e1a00a4b9babd76723d9857e0e1f08
kind: import
name: @omniroute/open-sse/config/providerHeaderProfiles.ts
qualified_name: @omniroute/open-sse/config/providerHeaderProfiles.ts
file_path: src/lib/oauth/constants/oauth.ts
language: typescript
signature:
import {
  GITHUB_COPILOT_API_VERSION,
  GITHUB_COPILOT_CHAT_PLUGIN_VERSION,
  GITHUB_COPILOT_CHAT_USER_AGENT,
  GITHUB_COPILOT_EDITOR_VERSION,
} from "@omniroute/open-sse/config/providerHeaderProfiles.ts";


id: import:19bea04a36444e50ab73d10b258d10d4
kind: import
name: @omniroute/open-sse/utils/publicCreds.ts
qualified_name: @omniroute/open-sse/utils/publicCreds.ts
file_path: src/lib/oauth/constants/oauth.ts
language: typescript
signature:
import {
  resolvePublicCred,
  resolvePublicCredMulti,
} from "@omniroute/open-sse/utils/publicCreds.ts";


id: constant:b8ca4408c4d76c3d2b422e48fea63305
kind: constant
name: CLAUDE_CONFIG
qualified_name: CLAUDE_CONFIG
file_path: src/lib/oauth/constants/oauth.ts
language: typescript
signature:
= {
  clientId: process.env.CLAUDE_OAUTH_CLIENT_ID || "9d1c250a-e61b-44d9-88ed-5944d1962f5e",
  author...


id: constant:7c93c097f3c1774d1f3ba7cd91318965
kind: constant
name: CODEX_CONFIG
qualified_name: CODEX_CONFIG
file_path: src/lib/oauth/constants/oauth.ts
language: typescript
signature:
= {
  clientId: process.env.CODEX_OAUTH_CLIENT_ID || "app_EMoamEEZ73f0CkXaXp7hrann",
  authorizeUrl: "...


id: constant:48239e216acd74fcd2024912a3a2bd92
kind: constant
name: GEMINI_CONFIG
qualified_name: GEMINI_CONFIG
file_path: src/lib/oauth/constants/oauth.ts
language: typescript
signature:
= {
  clientId: resolvePublicCredMulti("gemini_id", [
    "GEMINI_CLI_OAUTH_CLIENT_ID",
    "GEMINI_OA...


id: constant:89d74cddbe332e5f7ef9a7cfc9ffc3a1
kind: constant
name: QWEN_CONFIG
qualified_name: QWEN_CONFIG
file_path: src/lib/oauth/constants/oauth.ts
language: typescript
signature:
= {
  clientId: process.env.QWEN_OAUTH_CLIENT_ID || "f0304373b74a44d2b584a3fb70ca9e56",
  deviceCodeUr...


id: constant:960d831eea1f4e4240a4b63b6b5a5d2e
kind: constant
name: QODER_OAUTH_ENABLED
qualified_name: QODER_OAUTH_ENABLED
file_path: src/lib/oauth/constants/oauth.ts
language: typescript
signature:
= !!QODER_OAUTH_AUTHORIZE_URL &&
  !!QODER_OAUTH_TOKEN_URL &&
  !!QODER_OAUTH_USERINFO_URL &&
  !!QODE...


id: constant:01d913fe5f45ceb505f28223f6bc74bd
kind: constant
name: QODER_CONFIG
qualified_name: QODER_CONFIG
file_path: src/lib/oauth/constants/oauth.ts
language: typescript
signature:
= {
  enabled: QODER_OAUTH_ENABLED,
  clientId: QODER_OAUTH_CLIENT_ID,
  clientSecret: QODER_OAUTH_CLI...


id: constant:94960a939b48afef7363e6ce51fd783d
kind: constant
name: KIMI_CODING_CONFIG
qualified_name: KIMI_CODING_CONFIG
file_path: src/lib/oauth/constants/oauth.ts
language: typescript
signature:
= {
  clientId: process.env.KIMI_CODING_OAUTH_CLIENT_ID || "17e5f671-d194-4dfb-9706-5516cb48c098",
  d...


id: constant:9fa2fd944c37079bd1586a1e7cdedc93
kind: constant
name: KILOCODE_CONFIG
qualified_name: KILOCODE_CONFIG
file_path: src/lib/oauth/constants/oauth.ts
language: typescript
signature:
= {
  apiBaseUrl: "https://api.kilo.ai",
  initiateUrl: "https://api.kilo.ai/api/device-auth/codes",
 ...


id: constant:2735ada6d8ae715c0605929b4b1198dc
kind: constant
name: CLINE_CONFIG
qualified_name: CLINE_CONFIG
file_path: src/lib/oauth/constants/oauth.ts
language: typescript
signature:
= {
  appBaseUrl: "https://app.cline.bot",
  apiBaseUrl: "https://api.cline.bot",
  authorizeUrl: "htt...


id: constant:f6ddbebf234e2cf17a5604b121c29fe4
kind: constant
name: ANTIGRAVITY_CONFIG
qualified_name: ANTIGRAVITY_CONFIG
file_path: src/lib/oauth/constants/oauth.ts
language: typescript
signature:
= {
  clientId: resolvePublicCred("antigravity_id", "ANTIGRAVITY_OAUTH_CLIENT_ID"),
  clientSecret: re...


id: constant:1a016e97d91bde6cd6d5860f344f5dba
kind: constant
name: OPENAI_CONFIG
qualified_name: OPENAI_CONFIG
file_path: src/lib/oauth/constants/oauth.ts
language: typescript
signature:
= {
  clientId: CODEX_CONFIG.clientId,
  authorizeUrl: "https://auth.openai.com/oauth/authorize",
  to...


id: constant:faddae2409d0cde9d10e8e344fb84f8d
kind: constant
name: GITHUB_CONFIG
qualified_name: GITHUB_CONFIG
file_path: src/lib/oauth/constants/oauth.ts
language: typescript
signature:
= {
  clientId: process.env.GITHUB_OAUTH_CLIENT_ID || "Iv1.b507a08c87ecfe98",
  deviceCodeUrl: "https:...


id: constant:7ce6d4f13bda0dfa64a72d53504315be
kind: constant
name: GITLAB_DUO_CONFIG
qualified_name: GITLAB_DUO_CONFIG
file_path: src/lib/oauth/constants/oauth.ts
language: typescript
signature:
= {
  baseUrl: GITLAB_DUO_ENDPOINTS.root,
  clientId: process.env.GITLAB_DUO_OAUTH_CLIENT_ID || proces...


id: constant:38f5db775e86c4de7a7003734f7cb713
kind: constant
name: KIRO_CONFIG
qualified_name: KIRO_CONFIG
file_path: src/lib/oauth/constants/oauth.ts
language: typescript
signature:
= {
  // AWS SSO OIDC endpoints for Builder ID/IDC (Device Code Flow)
  ssoOidcEndpoint: "https://oidc...


id: constant:4f5fe1ae0655d7ab06c975047c3be342
kind: constant
name: CURSOR_CONFIG
qualified_name: CURSOR_CONFIG
file_path: src/lib/oauth/constants/oauth.ts
language: typescript
signature:
= {
  // API endpoints
  apiEndpoint: "https://api2.cursor.sh",
  chatEndpoint: "/aiserver.v1.ChatServ...


id: constant:6812655ff53f59ce26506c27da19dc58
kind: constant
name: WINDSURF_CONFIG
qualified_name: WINDSURF_CONFIG
file_path: src/lib/oauth/constants/oauth.ts
language: typescript
signature:
= {
  // Browser-based PKCE authorize endpoint (extracted from devin.exe binary)
  authorizeUrl: "http...


id: constant:eb7b441a873ef9b7ee0d7108d48e2cf3
kind: constant
name: PROVIDERS
qualified_name: PROVIDERS
file_path: src/lib/oauth/constants/oauth.ts
language: typescript
signature:
= {
  CLAUDE: "claude",
  CODEX: "codex",
  GEMINI: "gemini-cli",
  QWEN: "qwen",
  QODER: "qoder",
  ...


id: import:bf1e3539dd130c6c66724304861111f2
kind: import
name: @omniroute/open-sse/services/antigravityHeaders.ts
qualified_name: @omniroute/open-sse/services/antigravityHeaders.ts
file_path: src/lib/oauth/providers/antigravity.ts
language: typescript
signature:
import {
  antigravityNativeOAuthUserAgent,
  getAntigravityHeaders,
  getAntigravityLoadCodeAssistMetadata,
} from "@omniroute/open-sse/services/antigravityHeaders.ts";


id: import:d4b59ce180a954774ce9976816e7cbd7
kind: import
name: @omniroute/open-sse/services/codeAssistSubscription.ts
qualified_name: @omniroute/open-sse/services/codeAssistSubscription.ts
file_path: src/lib/oauth/providers/antigravity.ts
language: typescript
signature:
import { extractCodeAssistOnboardTierId } from "@omniroute/open-sse/services/codeAssistSubscription.ts";


id: constant:6e21f7dcad5e9cedf5eaf56eb07ca7e3
kind: constant
name: antigravity
qualified_name: antigravity
file_path: src/lib/oauth/providers/antigravity.ts
language: typescript
signature:
= {
  config: ANTIGRAVITY_CONFIG,
  flowType: "authorization_code",
  buildAuthUrl: (config, redirectU...


id: constant:6f1ca468effb20449961dffb0aef9bbd
kind: constant
name: claude
qualified_name: claude
file_path: src/lib/oauth/providers/claude.ts
language: typescript
signature:
= {
  config: CLAUDE_CONFIG,
  flowType: "authorization_code_pkce",
  buildAuthUrl: (config, _redirect...


id: constant:98b58eff1b82d15c0efb36e90a9331c1
kind: constant
name: cline
qualified_name: cline
file_path: src/lib/oauth/providers/cline.ts
language: typescript
signature:
= {
  config: CLINE_CONFIG,
  flowType: "authorization_code",
  buildAuthUrl: (config, redirectUri) =>...


id: interface:a6560d829dbf0e0f31e563d051eae901
kind: interface
name: CodexAuthInfo
qualified_name: CodexAuthInfo
file_path: src/lib/oauth/providers/codex.ts
language: typescript
docstring:
OpenAI Codex Auth Info embedded in id_token JWT
The JWT claims contain a custom claim at "https://api.openai.com/auth"


id: function:8dab449a558d6c4e0dcb23a57adc3863
kind: function
name: base64Decode
qualified_name: base64Decode
file_path: src/lib/oauth/providers/codex.ts
language: typescript
signature: (str: string): string
docstring:
Decode base64 string with proper UTF-8 handling.
atob() doesn't handle multi-byte UTF-8 characters correctly.


id: function:fd3c9b26c75394f508531070d80f5a9d
kind: function
name: parseIdToken
qualified_name: parseIdToken
file_path: src/lib/oauth/providers/codex.ts
language: typescript
signature: (idToken: string): { email: string | null; authInfo: CodexAuthInfo | null }
docstring:
Parse the id_token JWT to extract Codex-specific auth information.
The workspace selection is embedded in the JWT after OAuth completion.
Note: The OAuth flow already verified this token with OpenAI's server.
We only extract metadata (workspace info) from the already-validated token.


id: constant:d67cef543f6fabaf16f441ce2281f030
kind: constant
name: codex
qualified_name: codex
file_path: src/lib/oauth/providers/codex.ts
language: typescript
signature:
= {
  config: CODEX_CONFIG,
  flowType: "authorization_code_pkce",
  fixedPort: 1455,
  callbackPath: ...


id: constant:673ad35b3dbee8e7ed82819ba0bf95cb
kind: constant
name: cursor
qualified_name: cursor
file_path: src/lib/oauth/providers/cursor.ts
language: typescript
signature:
= {
  config: CURSOR_CONFIG,
  flowType: "import_token",
  mapTokens: (tokens) => ({
    accessToken: ...


id: import:af795680bd38286a3828359333329f00
kind: import
name: @omniroute/open-sse/services/geminiCliHeaders.ts
qualified_name: @omniroute/open-sse/services/geminiCliHeaders.ts
file_path: src/lib/oauth/providers/gemini.ts
language: typescript
signature:
import { getGeminiCliLoadCodeAssistMetadata } from "@omniroute/open-sse/services/geminiCliHeaders.ts";


id: constant:c2aaffc5dd0168abdc8e3ca19f933fb0
kind: constant
name: gemini
qualified_name: gemini
file_path: src/lib/oauth/providers/gemini.ts
language: typescript
signature:
= {
  config: GEMINI_CONFIG,
  flowType: "authorization_code",
  buildAuthUrl: (config, redirectUri, s...


id: constant:51cda60479ec39dea75ac6fd8da13609
kind: constant
name: github
qualified_name: github
file_path: src/lib/oauth/providers/github.ts
language: typescript
signature:
= {
  config: GITHUB_CONFIG,
  flowType: "device_code",
  requestDeviceCode: async (config) => {
    c...


id: constant:14d81492c640e7b1277cd83d7d7a8d07
kind: constant
name: gitlabDuo
qualified_name: gitlabDuo
file_path: src/lib/oauth/providers/gitlab-duo.ts
language: typescript
signature:
= {
  config: GITLAB_DUO_CONFIG,
  flowType: "authorization_code_pkce",
  buildAuthUrl: (config, redir...


id: constant:3e8480da1e1ee4487f503276097e4e62
kind: constant
name: PROVIDERS
qualified_name: PROVIDERS
file_path: src/lib/oauth/providers/index.ts
language: typescript
signature:
= {
  claude,
  codex,
  "gemini-cli": gemini,
  antigravity,
  qoder,
  qwen,
  "kimi-coding": kimiCo...


id: constant:b66bdc4baa4023f3882abc2bf020f547
kind: constant
name: kilocode
qualified_name: kilocode
file_path: src/lib/oauth/providers/kilocode.ts
language: typescript
signature:
= {
  config: KILOCODE_CONFIG,
  flowType: "device_code",
  requestDeviceCode: async (config) => {
   ...


id: constant:d0d7af5847d9f0276646012f8c9d0b7e
kind: constant
name: kimiCoding
qualified_name: kimiCoding
file_path: src/lib/oauth/providers/kimi-coding.ts
language: typescript
signature:
= {
  config: KIMI_CODING_CONFIG,
  flowType: "device_code",
  requestDeviceCode: async (config) => {
...


id: constant:de07f211e6bec1b1a2e05fb707bfb650
kind: constant
name: kiro
qualified_name: kiro
file_path: src/lib/oauth/providers/kiro.ts
language: typescript
signature:
= {
  config: KIRO_CONFIG,
  flowType: "device_code",
  requestDeviceCode: async (config) => {
    con...


id: constant:eb7de4ce7bf25971107c0664b8e7b93d
kind: constant
name: qoder
qualified_name: qoder
file_path: src/lib/oauth/providers/qoder.ts
language: typescript
signature:
= {
  config: QODER_CONFIG,
  flowType: "authorization_code",
  buildAuthUrl: (config, redirectUri, st...


id: constant:63a77b6c832e4238ff7cef7a1d768c7f
kind: constant
name: qwen
qualified_name: qwen
file_path: src/lib/oauth/providers/qwen.ts
language: typescript
signature:
= {
  config: QWEN_CONFIG,
  flowType: "device_code",
  requestDeviceCode: async (config, codeChalleng...


id: constant:f7aae012c781cfd7c0ef5d9e68b5decb
kind: constant
name: windsurf
qualified_name: windsurf
file_path: src/lib/oauth/providers/windsurf.ts
language: typescript
signature:
= {
  config: WINDSURF_CONFIG,
  flowType: "authorization_code_pkce",
  // Fixed callback path expecte...


id: method:a6ef4f80e83544a4469d0f5aa5d6c32f
kind: method
name: generateChecksum
qualified_name: CursorService::generateChecksum
file_path: src/lib/oauth/services/cursor.ts
language: typescript
signature: (machineId: string)
docstring:
Generate Cursor checksum (jyh cipher)
Algorithm: XOR timestamp bytes with rolling key (initial 165), then base64 encode
Format: {encoded_timestamp},{machineId}


id: method:28de6022eaf9c7f18589274a74d96bbb
kind: method
name: validateImportToken
qualified_name: CursorService::validateImportToken
file_path: src/lib/oauth/services/cursor.ts
language: typescript
signature: (accessToken: string, machineId?: string)
docstring:
Validate and import token from Cursor IDE or cursor-agent CLI.
Note: We skip API validation because Cursor API uses complex protobuf format.
Token will be validated when actually used for requests.
@param {string} accessToken - Access token from state.vscdb or auth.json
@param {string} [machineId] - Machine ID from state.vscdb (optional for cursor-agent imports)


id: method:9d983a5d1643abd2cf91ba3d8ef52538
kind: method
name: fetchUserInfo
qualified_name: CursorService::fetchUserInfo
file_path: src/lib/oauth/services/cursor.ts
language: typescript
docstring:
Fetch real user profile from cursor.com using the same WorkOS-session cookie
format that powers the dashboard. Returns null on any failure so the import
flow can fall back to whatever it can extract from the JWT.

signature:
(
    accessToken: string,
    userId: string
  ): Promise<{ email: string | null; name: string | null; sub: string | null } | null>


id: constant:81382841aa15a153888b3b7f127a6d34
kind: constant
name: KIRO_AUTH_SERVICE
qualified_name: KIRO_AUTH_SERVICE
file_path: src/lib/oauth/services/kiro.ts
language: typescript
signature: = "https://prod.us-east-1.auth.desktop.kiro.dev"
docstring:
Kiro OAuth Service
Supports multiple authentication methods:
1. AWS Builder ID (Device Code Flow)
2. AWS IAM Identity Center/IDC (Device Code Flow)
3. Google/GitHub Social Login (Authorization Code Flow + Manual Callback)
4. Import Token (Manual refresh token paste)


id: method:69a7443743f9fd1ad4869d7b59aeb9dc
kind: method
name: startDeviceAuthorization
qualified_name: KiroService::startDeviceAuthorization
file_path: src/lib/oauth/services/kiro.ts
language: typescript
docstring: Start device authorization for AWS Builder ID or IDC
signature:
(
    clientId: string,
    clientSecret: string,
    startUrl: string,
    region: string = "us-east-1"
  )


id: method:525ad23987c74d8571a59c6d388896f8
kind: method
name: pollDeviceToken
qualified_name: KiroService::pollDeviceToken
file_path: src/lib/oauth/services/kiro.ts
language: typescript
docstring: Poll for token using device code (AWS Builder ID/IDC)
signature:
(
    clientId: string,
    clientSecret: string,
    deviceCode: string,
    region: string = "us-east-1"
  )


id: method:0554ba98d8e3aaef1ea3533fca466652
kind: method
name: buildSocialLoginUrl
qualified_name: KiroService::buildSocialLoginUrl
file_path: src/lib/oauth/services/kiro.ts
language: typescript
signature: (provider: string, codeChallenge: string, state: string)
docstring:
Build Google/GitHub social login URL
Returns authorization URL for manual callback flow
Uses kiro:// custom protocol as required by AWS Cognito whitelist


id: method:a1848fa073423ac5de77d1d3653f72a2
kind: method
name: exchangeSocialCode
qualified_name: KiroService::exchangeSocialCode
file_path: src/lib/oauth/services/kiro.ts
language: typescript
signature: (code: string, codeVerifier: string)
docstring:
Exchange authorization code for tokens (Social Login)
Must use same redirect_uri as authorization request


id: method:c475d8bc81925649d555b9263d0f33b3
kind: method
name: validateImportToken
qualified_name: KiroService::validateImportToken
file_path: src/lib/oauth/services/kiro.ts
language: typescript
signature: (refreshToken: string, region: string = "us-east-1")
docstring:
Validate and import refresh token.
Registers a dedicated OIDC client so this connection has an isolated refresh session.
If registerClient() fails (network issue, OIDC service down), the import still
succeeds and the connection falls back to the shared social-auth refresh path.


id: method:f11c160e499497e52a814b31acae9d8a
kind: method
name: buildAuthUrl
qualified_name: OAuthService::buildAuthUrl
file_path: src/lib/oauth/services/oauth.ts
language: typescript
docstring: Build authorization URL
signature:
(
    redirectUri: string,
    state: string,
    codeChallenge: string,
    extraParams: Record<string, string> = {}
  )


id: method:01b2c13a802812d2e58ddbaf204a9b75
kind: method
name: exchangeCode
qualified_name: OAuthService::exchangeCode
file_path: src/lib/oauth/services/oauth.ts
language: typescript
docstring: Exchange authorization code for tokens
signature:
(
    code: string,
    redirectUri: string,
    codeVerifier: string,
    contentType = "application/x-www-form-urlencoded"
  )


id: method:ea5f725e08a5b43f0f6bf0df7e700820
kind: method
name: authenticate
qualified_name: OAuthService::authenticate
file_path: src/lib/oauth/services/oauth.ts
language: typescript
docstring: Complete OAuth flow
signature:
(
    providerName: string,
    buildAuthUrlFn: (redirectUri: string, state: string, codeChallenge: string) => string
  )


id: import:46aee36848eb59e713318ba05a95365a
kind: import
name: @/sse/services/tokenRefresh
qualified_name: @/sse/services/tokenRefresh
file_path: src/lib/oauth/utils/claudeAuthFile.ts
language: typescript
signature:
import {
  TOKEN_EXPIRY_BUFFER_MS,
  getAccessToken,
  updateProviderCredentials,
} from "@/sse/services/tokenRefresh";


id: import:d0b6cbda13863c8d36b8134fbd80b4b8
kind: import
name: @/lib/localDb
qualified_name: @/lib/localDb
file_path: src/lib/oauth/utils/claudeAuthImport.ts
language: typescript
signature:
import {
  getProviderConnections,
  createProviderConnection,
  updateProviderConnection,
} from "@/lib/localDb";


id: function:2de62ffd432205429617f072c63829b4
kind: function
name: enrichWithBootstrap
qualified_name: enrichWithBootstrap
file_path: src/lib/oauth/utils/claudeAuthImport.ts
language: typescript
signature:
(
  parsed: ParsedClaudeAuth,
  // proxyConfig reserved for future authenticated-proxy support
  proxyConfig?: null
): Promise<EnrichedClaudeAuth>


id: function:3e791128013551ce690cbfdc66edc0f2
kind: function
name: createConnectionFromAuthFile
qualified_name: createConnectionFromAuthFile
file_path: src/lib/oauth/utils/claudeAuthImport.ts
language: typescript
signature:
(
  enriched: EnrichedClaudeAuth,
  options: CreateConnectionOptions
): Promise<{ connection: JsonRecord; created: boolean }>


id: function:d39d71bc253b375c802fc1c53196052e
kind: function
name: createConnectionFromAuthFile
qualified_name: createConnectionFromAuthFile
file_path: src/lib/oauth/utils/codexAuthImport.ts
language: typescript
signature:
(
  parsed: ParsedCodexAuth,
  options: CreateConnectionOptions
): Promise<{ connection: JsonRecord; created: boolean }>


id: function:430d7d66fcd99c6a11e7b19f9a2c5936
kind: function
name: mergeGoogleAccountsFile
qualified_name: mergeGoogleAccountsFile
file_path: src/lib/oauth/utils/geminiAuthFile.ts
language: typescript
signature:
(
  accountsPath: string,
  newEmail: string
): Promise<{ updated: boolean; savedBakPath: string | null }>


id: function:eb15d85855eb4f3ee6bf7f21b6b8dfc5
kind: function
name: createConnectionFromAuthFile
qualified_name: createConnectionFromAuthFile
file_path: src/lib/oauth/utils/geminiAuthImport.ts
language: typescript
signature:
(
  enriched: EnrichedGeminiAuth,
  options: CreateConnectionOptions
): Promise<{ connection: JsonRecord; created: boolean }>


id: function:3ee89dab9f240c65a9b6b7cc93ba39c8
kind: function
name: startLocalServer
qualified_name: startLocalServer
file_path: src/lib/oauth/utils/server.ts
language: typescript
signature:
(
  onCallback: (params: Record<string, string>) => void,
  fixedPort: number | null = null
): Promise<{ server: any; port: number; close: () => void }>


id: function:3603fd7bb95c74a0cd9dfefed6e9e2a0
kind: function
name: syncOneproxyProxies
qualified_name: syncOneproxyProxies
file_path: src/lib/oneproxySync.ts
language: typescript
signature:
(options?: {
  apiUrl?: string;
  maxProxies?: number;
  minQuality?: number;
}): Promise<{
  success: boolean;
  added: number;
  updated: number;
  failed: number;
  total: number;
  error: string | null;
}>


id: function:9034ba24a03bdf82a2aeb9541a208214
kind: function
name: getOneproxySyncStatus
qualified_name: getOneproxySyncStatus
file_path: src/lib/oneproxySync.ts
language: typescript
signature:
(): {
  lastSyncSuccess: boolean;
  lastSyncError: string | null;
  lastSyncAt: string | null;
  lastSyncCount: number;
  consecutiveFailures: number;
}


id: constant:c51852385e54668f0234fe3298af3c42
kind: constant
name: PII_PATTERNS
qualified_name: PII_PATTERNS
file_path: src/lib/piiSanitizer.ts
language: typescript
signature:
= [
  {
    name: "email",
    regex: /\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,}\b/g,
    repl...


id: constant:8231b446a0d7587c6ea507dd8753dc8f
kind: constant
name: SYNC_SOURCES
qualified_name: SYNC_SOURCES
file_path: src/lib/pricingSync.ts
language: typescript
signature:
= (process.env.PRICING_SYNC_SOURCES || "litellm")
  .split(",")
  .map((s) => s.trim())
  .filter((s):...


id: constant:552d76f3d593b47a41a8c9cfeb1d278c
kind: constant
name: LITELLM_PROVIDER_MAP
qualified_name: LITELLM_PROVIDER_MAP
file_path: src/lib/pricingSync.ts
language: typescript
docstring: ─── Provider mapping: LiteLLM provider → OmniRoute aliases ─────
signature:
= {
  openai: ["openai", "cx"],
  anthropic: ["anthropic", "cc"],
  vertex_ai: ["gemini", "gemini-cli"...


id: function:0d0e6cb7b82240b51654bb07ae7beaff
kind: function
name: runCursorAgent
qualified_name: runCursorAgent
file_path: src/lib/providerModels/cursorAgent.ts
language: typescript
docstring:
cursor-agent waits on stdin when given a piped fd, so we always launch it
with stdin closed ("ignore") so it exits as soon as it prints the model list.

signature:
(
  binary: string,
  args: string[],
  timeoutMs: number
): Promise<{ stdout: string; stderr: string; code: number | null; signal: NodeJS.Signals | null }>


id: function:ca188d575ee143645ea3cea4aeed496b
kind: function
name: resolveCursorAgentBinary
qualified_name: resolveCursorAgentBinary
file_path: src/lib/providerModels/cursorAgent.ts
language: typescript
signature: (): string | null
docstring:
Resolve cursor-agent across common install locations, since the standalone
Next.js server may run with a PATH that doesn't include the user's local bin.


id: constant:84ddbecef8f03f0f3748c579edce758b
kind: constant
name: SEGMENT_OVERRIDES
qualified_name: SEGMENT_OVERRIDES
file_path: src/lib/providerModels/cursorAgent.ts
language: typescript
signature:
= {
  gpt: "GPT",
  claude: "Claude",
  gemini: "Gemini",
  grok: "Grok",
  kimi: "Kimi",
  composer: ...


id: import:d18bceeb2d5cd7011e575feabca7d3be
kind: import
name: @/lib/localDb
qualified_name: @/lib/localDb
file_path: src/lib/providerModels/managedAvailableModels.ts
language: typescript
signature:
import {
  deleteModelAlias,
  getModelAliases,
  getModelIsHidden,
  getProviderNodeById,
  setModelAlias,
} from "@/lib/localDb";


id: import:1ec6427d12024b535df0b618c2ab188d
kind: import
name: @/shared/constants/providers
qualified_name: @/shared/constants/providers
file_path: src/lib/providerModels/managedAvailableModels.ts
language: typescript
signature:
import {
  getProviderAlias,
  isAnthropicCompatibleProvider,
  isOpenAICompatibleProvider,
} from "@/shared/constants/providers";


id: function:b389551d5af82d3b368c36c364a2a9b4
kind: function
name: syncManagedAvailableModelAliases
qualified_name: syncManagedAvailableModelAliases
file_path: src/lib/providerModels/managedAvailableModels.ts
language: typescript
signature:
(
  providerId: string,
  modelIds: string[],
  { pruneMissing = true }: { pruneMissing?: boolean } = {}
)


id: import:1b497857f1541c0e4ab2e8189f9b0dc7
kind: import
name: @/lib/db/models
qualified_name: @/lib/db/models
file_path: src/lib/providerModels/managedModelImport.ts
language: typescript
signature:
import {
  getCustomModels,
  getSyncedAvailableModelsForConnection,
  mergeModelCompatOverride,
  replaceCustomModels,
  replaceSyncedAvailableModelsForConnection,
  type ModelCompatPatch,
  type SyncedAvailableModel,
} from "@/lib/db/models";


id: import:8919a37a037e4d46bdf267507a445036
kind: import
name: @/lib/providerModels/managedAvailableModels
qualified_name: @/lib/providerModels/managedAvailableModels
file_path: src/lib/providerModels/managedModelImport.ts
language: typescript
signature:
import {
  syncManagedAvailableModelAliases,
  usesManagedAvailableModels,
} from "@/lib/providerModels/managedAvailableModels";


id: function:220082660e7fe766869f589a5075025e
kind: function
name: collectAddedImportedModels
qualified_name: collectAddedImportedModels
file_path: src/lib/providerModels/managedModelImport.ts
language: typescript
signature:
(
  previousModels: JsonRecord[],
  importedModels: ManagedImportedModel[]
): ManagedImportedModel[]


id: function:c64690b16dcbf598a83868bf7eff4477
kind: function
name: importManagedModels
qualified_name: importManagedModels
file_path: src/lib/providerModels/managedModelImport.ts
language: typescript
signature:
({
  providerId,
  connectionId,
  fetchedModels,
  mode,
  previousSyncedAvailableModels: previousSyncedAvailableModelsInput,
}: {
  providerId: string;
  connectionId: string;
  fetchedModels: unknown;
  mode: ManagedModelImportMode;
  previousSyncedAvailableModels?: SyncedAvailableModel[];
})


id: import:bfcefd848629ef95b6a8243000c7cd37
kind: import
name: @/lib/db/models
qualified_name: @/lib/db/models
file_path: src/lib/providerModels/modelDiscovery.ts
language: typescript
signature:
import {
  getSyncedAvailableModelsForConnection,
  replaceSyncedAvailableModelsForConnection,
  type SyncedAvailableModel,
} from "@/lib/db/models";


id: function:1d2a0cfbdbb2abf8c5802e673ab8eb9f
kind: function
name: persistDiscoveredModels
qualified_name: persistDiscoveredModels
file_path: src/lib/providerModels/modelDiscovery.ts
language: typescript
signature:
(
  providerId: string,
  connectionId: string,
  models: unknown
): Promise<SyncedAvailableModel[]>


id: import:00cf8e0e299775cf4fd234a1a8654f7d
kind: import
name: @/shared/constants/providers
qualified_name: @/shared/constants/providers
file_path: src/lib/providers/catalog.ts
language: typescript
signature:
import {
  APIKEY_PROVIDERS,
  AUDIO_ONLY_PROVIDERS,
  CLOUD_AGENT_PROVIDERS,
  FREE_PROVIDERS,
  LOCAL_PROVIDERS,
  OAUTH_PROVIDERS,
  SEARCH_PROVIDERS,
  UPSTREAM_PROXY_PROVIDERS,
  WEB_COOKIE_PROVIDERS,
  isClaudeCodeCompatibleProvider,
  supportsApiKeyOnFreeProvider,
} from "@/shared/constants/providers";


id: constant:66ef389bb84b346ce5a7271af86c17d8
kind: constant
name: STATIC_PROVIDER_CATALOG_GROUPS
qualified_name: STATIC_PROVIDER_CATALOG_GROUPS
file_path: src/lib/providers/catalog.ts
language: typescript
signature:
= {
  free: {
    category: "free",
    providers: FREE_PROVIDERS as ProviderRecord,
    displayAuthTy...


id: constant:1731490af37a6964ad562bf68bb3a9dc
kind: constant
name: STATIC_PROVIDER_CATALOG_RESOLUTION_ORDER
qualified_name: STATIC_PROVIDER_CATALOG_RESOLUTION_ORDER
file_path: src/lib/providers/catalog.ts
language: typescript
signature:
= [
  "free",
  "oauth",
  "web-cookie",
  "local",
  "search",
  "audio",
  "upstream-proxy",
  "clou...


id: constant:1f564eb6af3e0ec3cf53de8872add924
kind: constant
name: MANAGED_PROVIDER_CONNECTION_CATEGORIES
qualified_name: MANAGED_PROVIDER_CONNECTION_CATEGORIES
file_path: src/lib/providers/catalog.ts
language: typescript
signature:
= new Set<StaticProviderCatalogCategory>([
  "apikey",
  "web-cookie",
  "local",
  "search",
  "audio...


id: function:52856230c465ca82e2d7ae6273fa207a
kind: function
name: resolveCompatibleProviderCatalogEntry
qualified_name: resolveCompatibleProviderCatalogEntry
file_path: src/lib/providers/catalog.ts
language: typescript
signature:
(
  providerNode: CompatibleProviderNodeLike,
  labels: CompatibleProviderLabels
): ResolvedCompatibleProviderCatalogEntry


id: function:695deebd82fd46fd559bd79b12f1b326
kind: function
name: migrateCodexConnectionDefaultsFromLegacySettings
qualified_name: migrateCodexConnectionDefaultsFromLegacySettings
file_path: src/lib/providers/codexConnectionDefaults.ts
language: typescript
signature:
(): Promise<{
  migrated: boolean;
  updatedConnectionIds: string[];
  legacyFastEnabled: boolean;
}>


id: function:6c413a90f26db331ab16f720129d68b6
kind: function
name: applyCodexGlobalFastServiceTier
qualified_name: applyCodexGlobalFastServiceTier
file_path: src/lib/providers/codexFastTier.ts
language: typescript
signature:
(
  provider: string | null | undefined,
  credentials: T,
  settings: unknown,
  options: ApplyCodexGlobalFastServiceTierOptions = {}
): T


id: constant:9f89b07d2e9c996e13e6284332dc7a76
kind: constant
name: IMAGE_PROVIDER_VALIDATION_ENDPOINTS
qualified_name: IMAGE_PROVIDER_VALIDATION_ENDPOINTS
file_path: src/lib/providers/imageValidation.ts
language: typescript
signature:
= {
  nanobanana: {
    baseUrl: "https://api.nanobananaapi.ai",
    path: "/api/v1/common/credit",
  ...


id: function:2f8591440fcf180473f067000e40d3b1
kind: function
name: getCompatibleFallbackModels
qualified_name: getCompatibleFallbackModels
file_path: src/lib/providers/managedAvailableModels.ts
language: typescript
signature:
(
  providerId: string,
  fallbackModels: ManagedAvailableModel[] = []
): ManagedAvailableModel[] | undefined


id: function:c357c1ff2782c84a7bf79a1e9b37c3b6
kind: function
name: getCodexRequestDefaults
qualified_name: getCodexRequestDefaults
file_path: src/lib/providers/requestDefaults.ts
language: typescript
signature:
(providerSpecificData: unknown): {
  reasoningEffort?: CodexReasoningEffort;
  serviceTier?: "priority";
}


id: import:97499010a8cc15dee823d4a34c9c9f24
kind: import
name: @omniroute/open-sse/services/claudeCodeCompatible.ts
qualified_name: @omniroute/open-sse/services/claudeCodeCompatible.ts
file_path: src/lib/providers/validation.ts
language: typescript
signature:
import {
  buildClaudeCodeCompatibleHeaders,
  buildClaudeCodeCompatibleValidationPayload,
  CLAUDE_CODE_COMPATIBLE_DEFAULT_CHAT_PATH,
  CLAUDE_CODE_COMPATIBLE_DEFAULT_MODELS_PATH,
  joinClaudeCodeCompatibleUrl,
  joinBaseUrlAndPath,
  stripClaudeCodeCompatibleEndpointSuffix,
  stripAnthropicMessagesSuffix,
} from "@omniroute/open-sse/services/claudeCodeCompatible.ts";


id: import:af3b12df2187b68a1d424955c80531c9
kind: import
name: @/shared/constants/providers
qualified_name: @/shared/constants/providers
file_path: src/lib/providers/validation.ts
language: typescript
signature:
import {
  isClaudeCodeCompatibleProvider,
  isAnthropicCompatibleProvider,
  isOpenAICompatibleProvider,
  isSelfHostedChatProvider,
  providerAllowsOptionalApiKey,
  isLocalProvider,
} from "@/shared/constants/providers";


id: import:e7d243e0b1461af463ca2cbaddea5468
kind: import
name: @omniroute/open-sse/config/azureAi.ts
qualified_name: @omniroute/open-sse/config/azureAi.ts
file_path: src/lib/providers/validation.ts
language: typescript
signature:
import {
  AZURE_AI_DEFAULT_BASE_URL,
  buildAzureAiChatUrl,
  buildAzureAiModelsUrl,
} from "@omniroute/open-sse/config/azureAi.ts";


id: import:6607dd05af4bd6d16051954993b1caf7
kind: import
name: @omniroute/open-sse/config/bedrock.ts
qualified_name: @omniroute/open-sse/config/bedrock.ts
file_path: src/lib/providers/validation.ts
language: typescript
signature:
import {
  BEDROCK_DEFAULT_BASE_URL,
  buildBedrockModelsUrl,
  getBedrockValidationModelId,
  normalizeBedrockBaseUrl,
} from "@omniroute/open-sse/config/bedrock.ts";


id: import:912be33914ed41fc10c4a90b7e0f618b
kind: import
name: @omniroute/open-sse/config/datarobot.ts
qualified_name: @omniroute/open-sse/config/datarobot.ts
file_path: src/lib/providers/validation.ts
language: typescript
signature:
import {
  DATAROBOT_DEFAULT_BASE_URL,
  buildDataRobotCatalogUrl,
  buildDataRobotChatUrl,
  isDataRobotDeploymentUrl,
} from "@omniroute/open-sse/config/datarobot.ts";


id: import:d2cb887d5333cf52605ff02c1b691f56
kind: import
name: @omniroute/open-sse/config/oci.ts
qualified_name: @omniroute/open-sse/config/oci.ts
file_path: src/lib/providers/validation.ts
language: typescript
signature:
import {
  OCI_DEFAULT_BASE_URL,
  buildOciChatUrl,
  buildOciModelsUrl,
} from "@omniroute/open-sse/config/oci.ts";


id: import:b3b544b404c745d717ad5aa5f6648105
kind: import
name: @omniroute/open-sse/config/sap.ts
qualified_name: @omniroute/open-sse/config/sap.ts
file_path: src/lib/providers/validation.ts
language: typescript
signature:
import {
  SAP_DEFAULT_BASE_URL,
  buildSapChatUrl,
  buildSapModelsUrl,
  getSapResourceGroup,
  isSapDeploymentUrl,
} from "@omniroute/open-sse/config/sap.ts";


id: import:aa7b4e539833208d15c57b5885190b24
kind: import
name: @omniroute/open-sse/config/watsonx.ts
qualified_name: @omniroute/open-sse/config/watsonx.ts
file_path: src/lib/providers/validation.ts
language: typescript
signature:
import {
  WATSONX_DEFAULT_BASE_URL,
  buildWatsonxChatUrl,
  buildWatsonxModelsUrl,
} from "@omniroute/open-sse/config/watsonx.ts";


id: import:868ac3f217e78984e44ac4fc699ba3f8
kind: import
name: @omniroute/open-sse/config/runway.ts
qualified_name: @omniroute/open-sse/config/runway.ts
file_path: src/lib/providers/validation.ts
language: typescript
signature:
import {
  buildRunwayApiUrl,
  buildRunwayHeaders,
  normalizeRunwayBaseUrl,
} from "@omniroute/open-sse/config/runway.ts";


id: import:d882eac2b3293c14290f2be91fcea9ea
kind: import
name: @omniroute/open-sse/config/petals.ts
qualified_name: @omniroute/open-sse/config/petals.ts
file_path: src/lib/providers/validation.ts
language: typescript
signature:
import { PETALS_DEFAULT_MODEL, normalizePetalsBaseUrl } from "@omniroute/open-sse/config/petals.ts";


id: import:28518fd3c0a82522492dbf8d0ec2e642
kind: import
name: @omniroute/open-sse/config/maritalk.ts
qualified_name: @omniroute/open-sse/config/maritalk.ts
file_path: src/lib/providers/validation.ts
language: typescript
signature:
import {
  buildMaritalkChatUrl,
  buildMaritalkModelsUrl,
} from "@omniroute/open-sse/config/maritalk.ts";


id: function:31b0d8895f5b7d86cd7137beacbcb508
kind: function
name: validateOpenAILikeProvider
qualified_name: validateOpenAILikeProvider
file_path: src/lib/providers/validation.ts
language: typescript
signature:
({
  apiKey,
  baseUrl,
  headers = {},
  modelId = "gpt-3.5-turbo",
  providerSpecificData,
  modelsUrl = "",
  isLocal = false,
}: any)


id: function:b76cec09c37bf928da1a6007759f77d4
kind: function
name: validateAnthropicLikeProvider
qualified_name: validateAnthropicLikeProvider
file_path: src/lib/providers/validation.ts
language: typescript
signature:
({
  apiKey,
  baseUrl,
  modelId = "claude-3-5-sonnet-20240620",
  headers = {},
  providerSpecificData = {},
  isLocal = false,
}: any)


