# nodes

id: function:95180bf9ed36aa687017101e758e7260
kind: function
name: validateClaudeOAuthInline
qualified_name: validateClaudeOAuthInline
file_path: src/lib/providers/validation.ts
language: typescript
signature:
({
  apiKey,
  modelId,
  providerSpecificData = {},
}: {
  apiKey: string;
  modelId: string | null | undefined;
  providerSpecificData?: Record<string, unknown>;
})


id: function:d73628ebd3ead9464d832e9fe72642ce
kind: function
name: validateGeminiLikeProvider
qualified_name: validateGeminiLikeProvider
file_path: src/lib/providers/validation.ts
language: typescript
signature:
({
  apiKey,
  baseUrl,
  providerSpecificData = {},
  authType = "query",
  isLocal = false,
}: any)


id: function:de25b2ce6f22ede8518d5a08da036f10
kind: function
name: validateGenericProvider
qualified_name: validateGenericProvider
file_path: src/lib/providers/validation.ts
language: typescript
docstring: ── Search provider validators (factored) ──
signature:
(
  baseUrl: string,
  apiKey: string,
  providerSpecificData: any = {},
  provider: string,
  isLocal: boolean = false
)


id: function:e88d89e82c9841228e60d13485d0d170
kind: function
name: validateSearchProvider
qualified_name: validateSearchProvider
file_path: src/lib/providers/validation.ts
language: typescript
signature:
(
  url: string,
  init: RequestInit,
  providerSpecificData: any = {},
  isLocal: boolean = false
): Promise<{ valid: boolean; error: string | null; unsupported: false }>


id: constant:97f8ab296cd2af4c3f435f46abb7d07a
kind: constant
name: SEARCH_VALIDATOR_CONFIGS
qualified_name: SEARCH_VALIDATOR_CONFIGS
file_path: src/lib/providers/validation.ts
language: typescript
signature:
= {
  "serper-search": (apiKey) => ({
    url: "https://google.serper.dev/search",
    init: {
      m...


id: constant:263eb443712390e29987ed44639298c6
kind: constant
name: META_AI_SEND_MESSAGE_DOC_ID
qualified_name: META_AI_SEND_MESSAGE_DOC_ID
file_path: src/lib/providers/validation.ts
language: typescript
signature: = "29ae946c82d1f301196c6ca2226400b5"
docstring:
See open-sse/executors/muse-spark-web.ts for the rationale: Meta migrated
from the "Abra" mutation (doc_id 078dfdff…, type RewriteOptionsInput now
missing from schema) to the "Ecto" subscription. POST graphql still
streams the response; only the persisted-query identifier and operation
shape changed.


id: constant:8f2384ce2120a082df215114906c1909
kind: constant
name: CLAUDE_WEB_API_INFO
qualified_name: CLAUDE_WEB_API_INFO
file_path: src/lib/providers/wrappers/claudeWeb.ts
language: typescript
signature:
= {
  baseUrl: "https://claude.ai/api",
  // Dynamic endpoint: /organizations/{orgId}/chat_conversatio...


id: constant:b60fcf344fe243a13586e92fd2776454
kind: constant
name: DeepSeekWebEndpoint
qualified_name: DeepSeekWebEndpoint
file_path: src/lib/providers/wrappers/deepseekWeb.ts
language: typescript
signature:
= {
  base: "https://chat.deepseek.com",
  completion: "/api/v0/chat/completion",
  rateLimit: { reque...


id: constant:4ba1ea3c6ee3698acd7bd8fff907a6db
kind: constant
name: DeepSeekWebModels
qualified_name: DeepSeekWebModels
file_path: src/lib/providers/wrappers/deepseekWeb.ts
language: typescript
signature:
= {
  default: "deepseek-v4-flash",
  flash: "deepseek-v4-flash",
  pro: "deepseek-v4-pro",
  reasonin...


id: constant:09d8d1a43309b700890b67d8e448b3ee
kind: constant
name: DeepSeekWebDefaults
qualified_name: DeepSeekWebDefaults
file_path: src/lib/providers/wrappers/deepseekWeb.ts
language: typescript
signature:
= {
  temperature: 0.7,
  maxTokens: 4096,
  reasoningEffort: "medium" as const,
  topP: 1.0,
  freque...


id: constant:44c08531c619060525b5bfed637abd74
kind: constant
name: DeepSeekWebHeaders
qualified_name: DeepSeekWebHeaders
file_path: src/lib/providers/wrappers/deepseekWeb.ts
language: typescript
signature:
= {
  "Content-Type": "application/json",
  "User-Agent":
    "Mozilla/5.0 (Windows NT 10.0; Win64; x6...


id: constant:fcf6bd89b1f38e6e4648becd31c48053
kind: constant
name: DeepSeekWebErrors
qualified_name: DeepSeekWebErrors
file_path: src/lib/providers/wrappers/deepseekWeb.ts
language: typescript
signature:
= {
  SESSION_EXPIRED: "session_expired",
  RATE_LIMITED: "rate_limit_exceeded",
  INVALID_REQUEST: "i...


id: function:9ad32e71701b86c6779acb7cb2dc0fa5
kind: function
name: isProxyReachable
qualified_name: isProxyReachable
file_path: src/lib/proxyHealth.ts
language: typescript
signature:
(
  proxyUrl: string,
  timeoutMs = FAST_FAIL_TIMEOUT_MS,
  cacheTtlMs = HEALTH_CACHE_TTL_MS
): Promise<boolean>


id: constant:79c910248f64c9cfca14f7282aacaa21
kind: constant
name: DEFAULT_REQUEST_QUEUE_MAX_WAIT_MS
qualified_name: DEFAULT_REQUEST_QUEUE_MAX_WAIT_MS
file_path: src/lib/resilience/settings.ts
language: typescript
signature:
= (() => {
  const parsed = Number(process.env.RATE_LIMIT_MAX_WAIT_MS || "120000");
  return Number.is...


id: constant:33fb611d721d9ff302710ab25bfe8eef
kind: constant
name: DEFAULT_RESILIENCE_SETTINGS
qualified_name: DEFAULT_RESILIENCE_SETTINGS
file_path: src/lib/resilience/settings.ts
language: typescript
signature:
= {
  requestQueue: {
    autoEnableApiKeyProviders: true,
    requestsPerMinute: DEFAULT_API_LIMITS.r...


id: function:ab11b3b89f130577725aa8b382c69b8c
kind: function
name: normalizeConnectionCooldownProfile
qualified_name: normalizeConnectionCooldownProfile
file_path: src/lib/resilience/settings.ts
language: typescript
signature:
(
  next: unknown,
  fallback: ConnectionCooldownProfileSettings
): ConnectionCooldownProfileSettings


id: function:26c1671f6b7acc99c1f88f5fb8894103
kind: function
name: normalizeProviderWindowDefaults
qualified_name: normalizeProviderWindowDefaults
file_path: src/lib/resilience/settings.ts
language: typescript
signature:
(
  next: unknown,
  fallback: Record<string, Record<string, number>>
): Record<string, Record<string, number>>


id: import:121bad9e3870dbfe3b77c24b317ac4fc
kind: import
name: @omniroute/open-sse/config/searchRegistry.ts
qualified_name: @omniroute/open-sse/config/searchRegistry.ts
file_path: src/lib/search/executeWebSearch.ts
language: typescript
signature:
import {
  getAllSearchProviders,
  getSearchProvider,
  selectProvider,
  supportsSearchType,
  SEARCH_CREDENTIAL_FALLBACKS,
  SEARCH_PROVIDERS,
  type SearchProviderConfig,
} from "@omniroute/open-sse/config/searchRegistry.ts";


id: function:a542ff89b40140659ef28808dc5e600a
kind: function
name: getHeaderValue
qualified_name: getHeaderValue
file_path: src/lib/semanticCache.ts
language: typescript
signature:
(
  headers: { get?: (name: string) => string | null } | Record<string, unknown> | null | undefined,
  name: string
): string | null


id: function:a9a25362aef308aa3763e15ba702bce6
kind: function
name: normalizeConversation
qualified_name: normalizeConversation
file_path: src/lib/semanticCache.ts
language: typescript
signature: (conversation: unknown)
docstring:
Normalize conversation items for consistent hashing.
Supports both Chat Completions `messages[]` and Responses API `input[]`.


id: constant:6095a8cd2a9b838fc7304b82a4328a62
kind: constant
name: a2aMemorySkill
qualified_name: a2aMemorySkill
file_path: src/lib/skills/a2a.ts
language: typescript
signature:
= {
  name: "memory_aware_routing",
  version: "1.0.0",
  description: "A2A skill for memory-aware req...


id: constant:d3ecf73e33f040f5e130e020699c5258
kind: constant
name: SANDBOX_NETWORK_ENABLED
qualified_name: SANDBOX_NETWORK_ENABLED
file_path: src/lib/skills/builtins.ts
language: typescript
signature:
= process.env.SKILLS_SANDBOX_NETWORK_ENABLED === "1" ||
  process.env.SKILLS_SANDBOX_NETWORK_ENABLED =...


id: constant:04f227eb170c454c4681665281d3d222
kind: constant
name: ALLOWED_SANDBOX_IMAGES
qualified_name: ALLOWED_SANDBOX_IMAGES
file_path: src/lib/skills/builtins.ts
language: typescript
signature:
= new Set(
  (process.env.SKILLS_ALLOWED_SANDBOX_IMAGES || "")
    .split(",")
    .map((value) => val...


id: constant:fa8ae27317ca56b49e30579170e59b48
kind: constant
name: BLOCKED_REQUEST_HEADERS
qualified_name: BLOCKED_REQUEST_HEADERS
file_path: src/lib/skills/builtins.ts
language: typescript
signature:
= new Set([
  "host",
  "connection",
  "content-length",
  "cookie",
  "set-cookie",
  "authorization...


id: constant:73c5b7e475e03e953e3aecfd45fd2758
kind: constant
name: builtinSkills
qualified_name: builtinSkills
file_path: src/lib/skills/builtins.ts
language: typescript
signature:
= {
  file_read: async (input, context) => {
    const { path: inputPath, encoding = "utf8" } = input ...


id: function:1f7b6a7e67a5c989687724760364fe0e
kind: function
name: registerCustomSkill
qualified_name: registerCustomSkill
file_path: src/lib/skills/custom.ts
language: typescript
signature:
(data: {
  name: string;
  version?: string;
  description?: string;
  schema: { input: Record<string, unknown>; output: Record<string, unknown> };
  handler: string;
  apiKeyId: string;
  enabled?: boolean;
}): Promise<any>


id: method:8a3da677d7b5f13e68cfa539bbbd1cb0
kind: method
name: execute
qualified_name: SkillExecutor::execute
file_path: src/lib/skills/executor.ts
language: typescript
signature:
(
    skillName: string,
    input: Record<string, unknown>,
    context: { apiKeyId: string; sessionId?: string }
  ): Promise<SkillExecution>


id: function:700580d9c07fa3171b8913f1a6d1d90e
kind: function
name: scoreAutoSkill
qualified_name: scoreAutoSkill
file_path: src/lib/skills/injection.ts
language: typescript
signature:
(
  skill: Skill,
  options: InjectionOptions,
  contextText: string,
  contextTokens: Set<string>,
  backgroundTokens: Set<string>
): number


id: function:d74e8084685e9fefb71d91eb54fd78e5
kind: function
name: injectSkillTools
qualified_name: injectSkillTools
file_path: src/lib/skills/injection.ts
language: typescript
signature:
(
  messages: any[],
  provider: "openai" | "anthropic" | "google" | "other",
  apiKeyId: string
): any[]


id: import:06a3c8c09b15cfb93ccd2b5693cc673d
kind: import
name: @omniroute/open-sse/services/webSearchFallback.ts
qualified_name: @omniroute/open-sse/services/webSearchFallback.ts
file_path: src/lib/skills/interception.ts
language: typescript
signature:
import { OMNIROUTE_WEB_SEARCH_FALLBACK_TOOL_NAME } from "@omniroute/open-sse/services/webSearchFallback.ts";


id: function:61c34a8b3c528f57e59fdb17d3e5d0c9
kind: function
name: getResponsesOutputContainer
qualified_name: getResponsesOutputContainer
file_path: src/lib/skills/interception.ts
language: typescript
signature:
(response: Record<string, unknown> | null | undefined): {
  root: Record<string, unknown>;
  responseRoot: Record<string, unknown>;
  output: unknown[];
} | null


id: function:14b4e01ce6a116f16e517036bc32ab4c
kind: function
name: interceptToolCalls
qualified_name: interceptToolCalls
file_path: src/lib/skills/interception.ts
language: typescript
signature:
(
  toolCalls: ToolCall[],
  context: ExecutionContext
): Promise<{ id: string; result: unknown }[]>


id: method:35443d4ce5679b7bd852ecc07a4b2b7e
kind: method
name: register
qualified_name: SkillRegistry::register
file_path: src/lib/skills/registry.ts
language: typescript
signature:
(skillData: {
    name: string;
    version?: string;
    description?: string;
    schema: SkillSchema;
    handler: string;
    enabled?: boolean;
    apiKeyId: string;
    mode?: "on" | "off" | "auto";
    sourceProvider?: "skillsmp" | "skillssh" | "local";
    tags?: string[];
    installCount?: number;
  }): Promise<Skill>


id: constant:1efe4f15482d4c2ebc14179540a87f22
kind: constant
name: DEFAULT_CONFIG
qualified_name: DEFAULT_CONFIG
file_path: src/lib/skills/sandbox.ts
language: typescript
signature:
= {
  cpuLimit: 100,
  memoryLimit: 256,
  timeout: 30000,
  networkEnabled: false,
  readOnly: true,
...


id: method:51174e9291d803975cdd560e9728519a
kind: method
name: run
qualified_name: SandboxRunner::run
file_path: src/lib/skills/sandbox.ts
language: typescript
signature:
(
    image: string,
    command: string[],
    env: Record<string, string> = {},
    configOverride: Partial<SandboxConfig> = {}
  ): Promise<SandboxResult>


id: constant:481999261386919fa6986dbcc6fc2014
kind: constant
name: SkillSchema
qualified_name: SkillSchema
file_path: src/lib/skills/schemas.ts
language: typescript
signature:
= z.object({
  input: z.record(z.string(), z.unknown()),
  output: z.record(z.string(), z.unknown()),
...


id: constant:d52d5653aadf0ad76a3ca0afc5321357
kind: constant
name: SkillCreateInputSchema
qualified_name: SkillCreateInputSchema
file_path: src/lib/skills/schemas.ts
language: typescript
signature:
= z
  .object({
    name: z.string().min(1).max(100),
    version: z
      .string()
      .regex(/^\d...


id: constant:49a3163adde0fc52b5118b636b0bbae6
kind: constant
name: SkillUpdateInputSchema
qualified_name: SkillUpdateInputSchema
file_path: src/lib/skills/schemas.ts
language: typescript
signature:
= z
  .object({
    name: z.string().min(1).max(100).optional(),
    version: z
      .string()
      ...


id: constant:8164e18a7eeb2b68d9e7143cd0a2969b
kind: constant
name: SkillConfigSchema
qualified_name: SkillConfigSchema
file_path: src/lib/skills/schemas.ts
language: typescript
signature:
= z.object({
  enabled: z.boolean(),
  mode: z.nativeEnum(SkillMode),
  allowedSkills: z.array(z.strin...


id: constant:2de203067fd359199244fe0ef9dea66b
kind: constant
name: SkillsShSkillSchema
qualified_name: SkillsShSkillSchema
file_path: src/lib/skills/skillssh.ts
language: typescript
signature:
= z.object({
  id: z.string(),
  skillId: z.string(),
  name: z.string(),
  installs: z.number().optio...


id: constant:15672d4102ee1d72823b15be5fd85860
kind: constant
name: SkillsShSearchResponseSchema
qualified_name: SkillsShSearchResponseSchema
file_path: src/lib/skills/skillssh.ts
language: typescript
signature:
= z.object({
  query: z.string().optional(),
  searchType: z.string().optional(),
  skills: z.array(Sk...


id: import:2b409e60bfe23e3da3ce2116e939e64a
kind: import
name: @/lib/localDb
qualified_name: @/lib/localDb
file_path: src/lib/sync/bundle.ts
language: typescript
signature:
import {
  getApiKeys,
  getCombos,
  getModelAliases,
  getProviderConnections,
  getProviderNodes,
  getSettings,
} from "@/lib/localDb";


id: import:3738474de3572a36bde8021960fd898c
kind: import
name: @/lib/db/syncTokens
qualified_name: @/lib/db/syncTokens
file_path: src/lib/sync/tokens.ts
language: typescript
signature:
import {
  createSyncTokenRecord,
  getSyncTokenByHash,
  listSyncTokens,
  revokeSyncToken,
  touchSyncTokenLastUsed,
  type SyncTokenRecord,
} from "@/lib/db/syncTokens";


id: function:890991f255bbf41906324078c326d5a6
kind: function
name: validateAutoUpdateRuntime
qualified_name: validateAutoUpdateRuntime
file_path: src/lib/system/autoUpdate.ts
language: typescript
signature:
(
  config: AutoUpdateConfig,
  execFileImpl: ExecFileLike = execFileAsync,
  existsImpl: (targetPath: string) => Promise<boolean> = pathExists
): Promise<AutoUpdateValidation>


id: function:af5900a4ab13ff225aa0ec62fa0fcd25
kind: function
name: ensureGitTagExists
qualified_name: ensureGitTagExists
file_path: src/lib/system/autoUpdate.ts
language: typescript
signature:
(
  targetTag: string,
  execFileImpl: ExecFileLike = execFileAsync,
  cwd = process.cwd()
): Promise<void>


id: function:b1eeac4c0eea9f803f94855e2cc97f96
kind: function
name: buildDockerComposeUpdateScript
qualified_name: buildDockerComposeUpdateScript
file_path: src/lib/system/autoUpdate.ts
language: typescript
signature:
({
  latest,
  config,
  composeCommand,
}: {
  latest: string;
  config: AutoUpdateConfig;
  composeCommand: ComposeCommand;
}): string


id: function:6ff0208f860ce5b2930384dbf501f834
kind: function
name: launchAutoUpdate
qualified_name: launchAutoUpdate
file_path: src/lib/system/autoUpdate.ts
language: typescript
signature:
({
  latest,
  env = process.env,
  execFileImpl = execFileAsync,
  spawnImpl = spawn,
  existsImpl = pathExists,
}: {
  latest: string;
  env?: NodeJS.ProcessEnv;
  execFileImpl?: ExecFileLike;
  spawnImpl?: SpawnLike;
  existsImpl?: (targetPath: string) => Promise<boolean>;
}): Promise<AutoUpdateLaunchResult>


id: function:0d914211fbedcc144edd570ff9b99816
kind: function
name: getActiveSocketPath
qualified_name: getActiveSocketPath
file_path: src/lib/tailscaleTunnel.ts
language: typescript
signature: (): Promise<string>
docstring:
Probe which tailscaled socket is actually live.
Priority: system daemon socket → OmniRoute custom socket.
When the system daemon is running (e.g. via systemd), we MUST use its socket
because only one tailscaled can hold the TUN device.


id: function:9097e021671102b8be8000043892412f
kind: function
name: enableTailscaleTunnel
qualified_name: enableTailscaleTunnel
file_path: src/lib/tailscaleTunnel.ts
language: typescript
signature:
({
  sudoPassword,
  hostname,
  port,
}: {
  sudoPassword?: string;
  hostname?: string;
  port?: number;
} = {}): Promise<TailscaleEnableResult>


id: function:9e7099452cfeadeed5bfe3cee46ac8e3
kind: function
name: installTailscale
qualified_name: installTailscale
file_path: src/lib/tailscaleTunnel.ts
language: typescript
signature:
({
  sudoPassword,
  onProgress,
}: {
  sudoPassword?: string;
  onProgress?: (message: string) => void;
} = {})


id: import:dc4dc74e3e8188d801787e9be12f3573
kind: import
name: @/lib/localDb
qualified_name: @/lib/localDb
file_path: src/lib/tokenHealthCheck.ts
language: typescript
signature:
import {
  getProviderConnections,
  getProviderConnectionById,
  updateProviderConnection,
  getSettings,
  resolveProxyForConnection,
} from "@/lib/localDb";


id: import:4e59a1c3e60cfcc6eeaeeef2e22e317e
kind: import
name: @omniroute/open-sse/services/tokenRefresh.ts
qualified_name: @omniroute/open-sse/services/tokenRefresh.ts
file_path: src/lib/tokenHealthCheck.ts
language: typescript
signature:
import {
  getAccessToken,
  supportsTokenRefresh,
  isUnrecoverableRefreshError,
} from "@omniroute/open-sse/services/tokenRefresh.ts";


id: import:82ad7fd5264ed31197a196dd5e75888b
kind: import
name: @omniroute/open-sse/transformer/responsesTransformer.ts
qualified_name: @omniroute/open-sse/transformer/responsesTransformer.ts
file_path: src/lib/translator/streamTransform.ts
language: typescript
signature:
import { createResponsesApiTransformStream } from "@omniroute/open-sse/transformer/responsesTransformer.ts";


id: function:a760f804d67658a3223ba0935afe8507
kind: function
name: writeCallArtifact
qualified_name: writeCallArtifact
file_path: src/lib/usage/callLogArtifacts.ts
language: typescript
signature:
(
  artifact: CallLogArtifact,
  relativePath = buildArtifactRelativePath(artifact.summary.timestamp, artifact.summary.id)
): CallLogArtifactWriteResult | null


id: function:62949f1de8af2b736f6366154c77f837
kind: function
name: readCallArtifact
qualified_name: readCallArtifact
file_path: src/lib/usage/callLogArtifacts.ts
language: typescript
signature:
(relativePath: string | null): {
  artifact: CallLogArtifact | null;
  state: "ready" | "missing" | "corrupt";
}


id: import:080ab703d61cc4d07be96d7db3bebb47
kind: import
name: ./tokenAccounting
qualified_name: ./tokenAccounting
file_path: src/lib/usage/callLogs.ts
language: typescript
signature:
import {
  getLoggedInputTokens,
  getLoggedOutputTokens,
  getPromptCacheReadTokensOrNull,
  getPromptCacheCreationTokensOrNull,
  getReasoningTokensOrNull,
} from "./tokenAccounting";


id: import:89bef3cee82e5c19ff86657c30677cba
kind: import
name: ./callLogArtifacts
qualified_name: ./callLogArtifacts
file_path: src/lib/usage/callLogs.ts
language: typescript
signature:
import {
  CALL_LOGS_DIR,
  cleanupEmptyCallLogDirs,
  deleteCallArtifact,
  listCallLogArtifactFiles,
  readCallArtifact,
  writeCallArtifact,
  type CallLogArtifact,
  type CallLogDetailState,
} from "./callLogArtifacts";


id: function:173041bb73506f323a608d7ed33800fd
kind: function
name: applyNodePrefix
qualified_name: applyNodePrefix
file_path: src/lib/usage/callLogs.ts
language: typescript
signature:
(
  requestedModel: string | null,
  provider: string | null,
  nodePrefix: string | null
): string | null


id: function:d532d4cc5ac5b2c953faea6b09efad52
kind: function
name: buildArtifact
qualified_name: buildArtifact
file_path: src/lib/usage/callLogs.ts
language: typescript
signature:
(
  logEntry: {
    id: string;
    timestamp: string;
    method: string;
    path: string;
    status: number;
    model: string;
    requestedModel: string | null;
    provider: string;
    account: string;
    connectionId: string | null;
    duration: number;
    tokensIn: number;
    tokensOut: number;
    tokensCacheRead: number | null;
    tokensCacheCreation: number | null;
    tokensReasoning: number | null;
    tokensCompressed: number | null;
    requestType: string | null;
    sourceFormat: string | null;
    targetFormat: string | null;
    apiKeyId: string | null;
    apiKeyName: string | null;
    comboName: string | null;
    comboStepId: string | null;
    comboExecutionKey: string | null;
  },
  requestBody: unknown,
  responseBody: unknown,
  error: unknown,
  pipelinePayloads: RequestPipelinePayloads | null
): CallLogArtifact


id: function:8e9ca464e11154b65fde162a1351c32a
kind: function
name: getCodexFastCostMultiplier
qualified_name: getCodexFastCostMultiplier
file_path: src/lib/usage/costCalculator.ts
language: typescript
signature:
(
  provider: string | null | undefined,
  model: string | null | undefined,
  serviceTier: string | null | undefined
): number


id: function:d5ed2c8c24517749eeec2421a49c8fdc
kind: function
name: computeCostFromPricing
qualified_name: computeCostFromPricing
file_path: src/lib/usage/costCalculator.ts
language: typescript
signature:
(
  pricing: Record<string, unknown> | null | undefined,
  tokens: Record<string, number | undefined> | null | undefined,
  options: CostCalculationOptions = {}
): number


id: function:f3b6ec7b22b4f47947f761a43886a628
kind: function
name: calculateCost
qualified_name: calculateCost
file_path: src/lib/usage/costCalculator.ts
language: typescript
signature:
(
  provider: string,
  model: string,
  tokens: Record<string, number | undefined> | null | undefined,
  options: CostCalculationOptions = {}
): Promise<number>


id: import:4f7f0d85a3daf17ed8eb83aab09fe448
kind: import
name: @omniroute/open-sse/config/providerHeaderProfiles.ts
qualified_name: @omniroute/open-sse/config/providerHeaderProfiles.ts
file_path: src/lib/usage/fetcher.ts
language: typescript
signature:
import {
  getGitHubCopilotInternalUserHeaders,
  getKiroServiceHeaders,
} from "@omniroute/open-sse/config/providerHeaderProfiles.ts";


id: import:8ccdcf9f7ca7473b374cbc9295c5be04
kind: import
name: @omniroute/open-sse/services/antigravityClientProfile.ts
qualified_name: @omniroute/open-sse/services/antigravityClientProfile.ts
file_path: src/lib/usage/fetcher.ts
language: typescript
signature:
import { applyAntigravityClientProfileHeaders } from "@omniroute/open-sse/services/antigravityClientProfile.ts";


id: import:c64bfb570d76e378df61a935b30da284
kind: import
name: @omniroute/open-sse/config/antigravityUpstream.ts
qualified_name: @omniroute/open-sse/config/antigravityUpstream.ts
file_path: src/lib/usage/fetcher.ts
language: typescript
signature:
import {
  getAntigravityFetchAvailableModelsUrls,
  ANTIGRAVITY_BASE_URLS,
} from "@omniroute/open-sse/config/antigravityUpstream.ts";


id: import:9f37079201d325261d83e7d6993ec552
kind: import
name: @omniroute/open-sse/executors/antigravity.ts
qualified_name: @omniroute/open-sse/executors/antigravity.ts
file_path: src/lib/usage/fetcher.ts
language: typescript
signature:
import {
  getAntigravityRemainingCredits,
  updateAntigravityRemainingCredits,
} from "@omniroute/open-sse/executors/antigravity.ts";


id: import:288500b968b10e4d3036539644d09654
kind: import
name: @omniroute/open-sse/services/antigravityIdentity.ts
qualified_name: @omniroute/open-sse/services/antigravityIdentity.ts
file_path: src/lib/usage/fetcher.ts
language: typescript
signature:
import {
  generateAntigravityRequestId,
  getAntigravitySessionId,
} from "@omniroute/open-sse/services/antigravityIdentity.ts";


id: function:1370e386e33304d9e2c537204251ef3b
kind: function
name: probeAntigravityCreditBalance
qualified_name: probeAntigravityCreditBalance
file_path: src/lib/usage/fetcher.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,
  providerSpecificData: Record<string, unknown> = {}
): Promise<number | null>


id: function:3cbcadd51784c4a0cc14438978265e14
kind: function
name: getAntigravityUsage
qualified_name: getAntigravityUsage
file_path: src/lib/usage/fetcher.ts
language: typescript
docstring:
Antigravity Usage
Calls fetchAvailableModels to get per-model quota fractions.
Credit balance (GOOGLE_ONE_AI) is read from the executor's in-memory cache,
which is populated automatically after each successful credit-injected SSE call.
If the cache is empty and credits mode is enabled, fires a minimal probe request
to fetch the balance proactively.

signature:
(
  accessToken: string,
  providerSpecificData: Record<string, unknown> = {},
  projectId?: string | null,
  connectionId?: string | null
)


id: function:9c446a201da32a697b21f0d4ed960143
kind: function
name: getClaudeUsage
qualified_name: getClaudeUsage
file_path: src/lib/usage/fetcher.ts
language: typescript
signature: (accessToken?: string)
docstring:
Claude Usage (legacy fallback)
Real Claude OAuth quota windows are fetched in @omniroute/open-sse/services/usage.ts.


id: function:363fc30df0504d7ee7ff27f42bf71e22
kind: function
name: getCodexUsage
qualified_name: getCodexUsage
file_path: src/lib/usage/fetcher.ts
language: typescript
signature: (accessToken, providerSpecificData: Record<string, any> = {})
docstring:
Codex (OpenAI) Usage
Note: Actual quota tracking is handled by open-sse/services/usage.ts
This fallback returns a message directing users to the dashboard.


id: function:b319cc5dc7655323f58caa97bd790030
kind: function
name: getKiroUsage
qualified_name: getKiroUsage
file_path: src/lib/usage/fetcher.ts
language: typescript
signature: (accessToken: string)
docstring:
Kiro Credits
Fetches credit balance from Kiro's AWS CodeWhisperer backend.
The endpoint mirrors what Kiro IDE uses internally for the credit badge.


id: import:8708cc859e7a3da99be7861bc91af8f1
kind: import
name: @/lib/localDb
qualified_name: @/lib/localDb
file_path: src/lib/usage/providerLimits.ts
language: typescript
signature:
import {
  getAllProviderLimitsCache,
  getProviderConnectionById,
  getProviderConnections,
  getProviderLimitsCache,
  getSettings,
  resolveProxyForConnection,
  setProviderLimitsCache,
  setProviderLimitsCacheBatch,
  updateProviderConnection,
  updateSettings,
  type ProviderLimitsCacheEntry,
} from "@/lib/localDb";


id: import:18ade9ada76d09cb4fe7335ef02f4f82
kind: import
name: @omniroute/open-sse/services/codeAssistSubscription.ts
qualified_name: @omniroute/open-sse/services/codeAssistSubscription.ts
file_path: src/lib/usage/providerLimits.ts
language: typescript
signature:
import {
  extractCodeAssistOnboardTierId,
  extractCodeAssistSubscriptionTier,
} from "@omniroute/open-sse/services/codeAssistSubscription.ts";


id: constant:c454851cad8b83001192a06f64da2af1
kind: constant
name: PROVIDER_LIMITS_APIKEY_PROVIDERS
qualified_name: PROVIDER_LIMITS_APIKEY_PROVIDERS
file_path: src/lib/usage/providerLimits.ts
language: typescript
signature:
= new Set([
  "glm",
  "glm-cn",
  "zai",
  "glmt",
  "minimax",
  "minimax-cn",
  "crof",
  "nanogpt"...


id: function:85b7ac5a0bad0643f982d7676cb6bc31
kind: function
name: toProviderLimitsCacheEntry
qualified_name: toProviderLimitsCacheEntry
file_path: src/lib/usage/providerLimits.ts
language: typescript
signature:
(
  usage: JsonRecord,
  source: SyncSource,
  fetchedAt = new Date().toISOString()
): ProviderLimitsCacheEntry


id: function:acdbd6d3a0ba680cae7171358efc1dc9
kind: function
name: fetchLiveProviderLimitsWithOptions
qualified_name: fetchLiveProviderLimitsWithOptions
file_path: src/lib/usage/providerLimits.ts
language: typescript
signature:
(
  connectionId: string,
  options: { forceRefresh?: boolean } = {}
): Promise<{
  connection: ProviderConnectionLike;
  usage: JsonRecord;
}>


id: function:09e52a2b9be283a36d8c334a7d36632a
kind: function
name: fetchAndPersistProviderLimits
qualified_name: fetchAndPersistProviderLimits
file_path: src/lib/usage/providerLimits.ts
language: typescript
signature:
(
  connectionId: string,
  source: SyncSource = "manual"
): Promise<{
  connection: ProviderConnectionLike;
  usage: JsonRecord;
  cache: ProviderLimitsCacheEntry;
}>


id: function:0475c885559717650886327a9f94dc26
kind: function
name: syncAllProviderLimits
qualified_name: syncAllProviderLimits
file_path: src/lib/usage/providerLimits.ts
language: typescript
signature:
(
  options: {
    source?: SyncSource;
    concurrency?: number;
  } = {}
): Promise<{
  total: number;
  succeeded: number;
  failed: number;
  caches: Record<string, ProviderLimitsCacheEntry>;
  errors: Record<string, string>;
}>


id: function:3b1d147571c0e8809548b73e7f9ffce2
kind: function
name: hasAnyKey
qualified_name: hasAnyKey
file_path: src/lib/usage/tokenAccounting.ts
language: typescript
signature: (record: JsonRecord, keys: string[]): boolean
docstring:
─── Nullable variants ──────────────────────────────────────────────────
Return `null` when the provider simply doesn't report the field,
vs `0` when the provider explicitly reported zero.


id: import:d2b0270f13600246fb192f0a25859a58
kind: import
name: ./tokenAccounting
qualified_name: ./tokenAccounting
file_path: src/lib/usage/usageHistory.ts
language: typescript
signature:
import {
  getLoggedInputTokens,
  getLoggedOutputTokens,
  getPromptCacheCreationTokens,
  getPromptCacheReadTokens,
  getReasoningTokens,
} from "./tokenAccounting";


id: constant:55d8da4c3e232d51f28c0d55ff01c22c
kind: constant
name: pendingRequests
qualified_name: pendingRequests
file_path: src/lib/usage/usageHistory.ts
language: typescript
docstring: ──────────────── Pending Requests (in-memory) ────────────────
signature:
= {
  byModel: Object.create(null) as Record<string, number>,
  byAccount: Object.create(null) as Reco...


id: constant:a747935e95150e7e93c87ae520d70ed4
kind: constant
name: UNSAFE_KEYS
qualified_name: UNSAFE_KEYS
file_path: src/lib/usage/usageHistory.ts
language: typescript
signature: = new Set(["__proto__", "constructor", "prototype"])
docstring:
Prototype-pollution denylist — prevents crafted model/provider names from mutating Object.prototype.


id: function:fab435c57bdfef4347cbc992f7bafba3
kind: function
name: trackPendingRequest
qualified_name: trackPendingRequest
file_path: src/lib/usage/usageHistory.ts
language: typescript
signature:
(
  model: string,
  provider: string,
  connectionId: string | null,
  started: boolean,
  metadata?: PendingRequestMetadata
)


id: function:ad8eee5d47a18da87a58c0c3b18e4370
kind: function
name: updatePendingRequest
qualified_name: updatePendingRequest
file_path: src/lib/usage/usageHistory.ts
language: typescript
signature:
(
  model: string,
  provider: string,
  connectionId: string | null,
  metadata: PendingRequestMetadata
)


id: function:3ebfdd46548867bc647062c9bb299e36
kind: function
name: getModelLatencyStats
qualified_name: getModelLatencyStats
file_path: src/lib/usage/usageHistory.ts
language: typescript
signature:
(
  options: { windowHours?: number; minSamples?: number; maxRows?: number } = {}
): Promise<Record<string, ModelLatencyStatsEntry>>


id: function:991d9c7cf4070193a360a41522e3d696
kind: function
name: appendRequestLog
qualified_name: appendRequestLog
file_path: src/lib/usage/usageHistory.ts
language: typescript
signature:
({
  model: _model,
  provider: _provider,
  connectionId: _connectionId,
  tokens: _tokens,
  status: _status,
}: {
  model?: string;
  provider?: string;
  connectionId?: string;
  tokens?: any;
  status?: string | number;
})


id: import:6bbfdf4e98b774a401d72c26cc601c1f
kind: import
name: @/lib/usage/costCalculator
qualified_name: @/lib/usage/costCalculator
file_path: src/lib/usageAnalytics.ts
language: typescript
signature:
import {
  normalizeModelName as normModel,
  computeCostFromPricing,
} from "@/lib/usage/costCalculator";


id: function:8ba3429ab811f42a77752078077e51be
kind: function
name: getDateRange
qualified_name: getDateRange
file_path: src/lib/usageAnalytics.ts
language: typescript
signature: (range: string, startDate?: string, endDate?: string)
docstring:
Compute date range boundaries
@param {string} range - "1d" | "7d" | "30d" | "90d" | "ytd" | "all" | "custom"
@param {string} [startDate] - ISO string for custom range start
@param {string} [endDate] - ISO string for custom range end
@returns {{ start: Date, end: Date }}


id: function:1482ba579d01502329b3621bd89ede9d
kind: function
name: computeAnalytics
qualified_name: computeAnalytics
file_path: src/lib/usageAnalytics.ts
language: typescript
signature:
(
  history: any[],
  range = "30d",
  connectionMap: Record<string, string> = {},
  options: { startDate?: string; endDate?: string } = {}
)


id: import:91c8ae86adb2bc7e27fd04af127b3c94
kind: import
name: @/lib/db/versionManager
qualified_name: @/lib/db/versionManager
file_path: src/lib/versionManager/index.ts
language: typescript
signature:
import {
  getVersionManagerStatus,
  getVersionManagerTool,
  upsertVersionManagerTool,
  updateVersionManagerTool,
  setToolStatus,
  updateToolVersion,
} from "@/lib/db/versionManager";


id: function:f4b8ec12acb6eea53c02fe905aed8090
kind: function
name: installTool
qualified_name: installTool
file_path: src/lib/versionManager/index.ts
language: typescript
signature:
(
  tool: string,
  version?: string
): Promise<{
  installedVersion: string;
  binaryPath: string;
}>


id: function:11fa32768635c58cbc121f91ade90517
kind: function
name: startTool
qualified_name: startTool
file_path: src/lib/versionManager/index.ts
language: typescript
signature:
(tool: string): Promise<{
  pid: number;
  port: number;
  health?: Awaited<ReturnType<typeof checkHealth>>;
}>


id: function:0483f04add6c2d993a01f563d6837f1a
kind: function
name: checkForUpdates
qualified_name: checkForUpdates
file_path: src/lib/versionManager/index.ts
language: typescript
signature:
(tool: string): Promise<{
  current: string | null;
  latest: string;
  updateAvailable: boolean;
}>


id: function:287c2ce6f0f1211b56bacc631708c48d
kind: function
name: startProcess
qualified_name: startProcess
file_path: src/lib/versionManager/processManager.ts
language: typescript
signature:
(
  binaryPath: string,
  port?: number,
  configDir?: string
): Promise<{ pid: number; port: number }>


id: function:5afd5e4cc6123001a944c4cc06d8e9f6
kind: function
name: restartProcess
qualified_name: restartProcess
file_path: src/lib/versionManager/processManager.ts
language: typescript
signature:
(
  binaryPath: string,
  port?: number,
  configDir?: string,
  currentPid?: number | null
): Promise<{ pid: number; port: number }>


id: function:340716c63cc5de47873984a5b73af63a
kind: function
name: deliverWebhook
qualified_name: deliverWebhook
file_path: src/lib/webhookDispatcher.ts
language: typescript
signature:
(
  url: string,
  payload: WebhookPayload,
  secret?: string | null,
  maxRetries = 3
): Promise<{ success: boolean; status: number; error?: string }>


id: constant:1dbc32aef2deed50dac13f1d4c44296c
kind: constant
name: defaultDeps
qualified_name: defaultDeps
file_path: src/lib/zed-oauth/dockerDetect.ts
language: typescript
signature:
= {
  existsSync: fs.existsSync,
  readFileSync: (path, encoding) => fs.readFileSync(path, encoding as...


id: constant:8f09a7846a7f92ab9af750889d838620
kind: constant
name: ZED_SERVICE_PATTERNS
qualified_name: ZED_SERVICE_PATTERNS
file_path: src/lib/zed-oauth/keychain-reader.ts
language: typescript
docstring: Common service name patterns used by Zed IDE for storing OAuth tokens
signature:
= [
  // OpenAI
  "zed-openai",
  "ai.zed.openai",
  "zed.openai",
  "Zed-OpenAI",

  // Anthropic
  "...


id: import:8670152a4831e12bb181d7d5c916377b
kind: import
name: @/lib/guardrails/promptInjection
qualified_name: @/lib/guardrails/promptInjection
file_path: src/middleware/promptInjectionGuard.ts
language: typescript
signature:
import {
  evaluatePromptInjection,
  type PromptInjectionGuardrailOptions,
} from "@/lib/guardrails/promptInjection";


id: import:5998f3758fd6d61268746163d1bd84c7
kind: import
name: ../systemCommands.ts
qualified_name: ../systemCommands.ts
file_path: src/mitm/cert/install.ts
language: typescript
signature:
import {
  execFileText,
  execFileWithPassword,
  getErrorMessage,
  quotePowerShell,
  runElevatedPowerShell,
} from "../systemCommands.ts";


id: constant:5fbf87c4fe33c6a2bbbceee52637976c
kind: constant
name: LINUX_CERT_PATHS
qualified_name: LINUX_CERT_PATHS
file_path: src/mitm/cert/install.ts
language: typescript
signature:
= [
  // Debian / Ubuntu
  { dir: "/usr/local/share/ca-certificates", cmd: "update-ca-certificates" },...


id: import:95c14ddd81b76034b0ecbd7eea3e8146
kind: import
name: ../systemCommands.ts
qualified_name: ../systemCommands.ts
file_path: src/mitm/dns/dnsConfig.ts
language: typescript
signature:
import {
  execFileWithPassword,
  getErrorMessage,
  quotePowerShell,
  runElevatedPowerShell,
} from "../systemCommands.ts";


id: constant:b49eb5c2a9d39d539f5df31fd9472ccf
kind: constant
name: HOSTS_FILE
qualified_name: HOSTS_FILE
file_path: src/mitm/dns/dnsConfig.ts
language: typescript
signature:
= IS_WIN
  ? path.join(process.env.SystemRoot || "C:\\Windows", "System32", "drivers", "etc", "hosts")...


id: constant:19c80090c1ee8e0f7d94bfc09641e7d3
kind: constant
name: DNS_ENTRIES
qualified_name: DNS_ENTRIES
file_path: src/mitm/dns/dnsConfig.ts
language: typescript
signature: = [`127.0.0.1 ${TARGET_HOST}`, `::1 ${TARGET_HOST}`]
docstring:
Both IPv4 and IPv6 entries are needed — modern Windows apps often resolve
to IPv6 first, bypassing an IPv4-only MITM redirect.


id: constant:6a3104879f301242d6d71555a2423b30
kind: constant
name: REMOVE_HOSTS_ENTRY_SCRIPT
qualified_name: REMOVE_HOSTS_ENTRY_SCRIPT
file_path: src/mitm/dns/dnsConfig.ts
language: typescript
signature:
= `
const fs = require("fs");
const filePath = process.argv[1];
const targetHost = process.argv[2];
co...


id: constant:1a38f6194c66806832cd1ab0982fb437
kind: constant
name: STUB_ERROR
qualified_name: STUB_ERROR
file_path: src/mitm/manager.stub.ts
language: typescript
docstring:
Build-time stub for @/mitm/manager
Used by Turbopack during next build to avoid native module resolution errors.
Dynamic import() in route handlers should load the REAL manager at runtime.
If this stub is reached at runtime, the build alias is incorrectly applied.

signature:
= "MITM manager stub reached at runtime — build alias applied incorrectly. " +
  "Use --webpack for pr...


id: variable:b49ad138f3f06d7522827a0e6b2ef6c3
kind: variable
name: _cachedPassword
qualified_name: _cachedPassword
file_path: src/mitm/manager.ts
language: typescript
signature: = null
docstring:
Module-scoped password cache (not exposed on globalThis).
Cleared automatically when the MITM proxy is stopped.


id: constant:edff7041c912a8274d5cad0f5e81cbed
kind: constant
name: urlPath
qualified_name: urlPath
file_path: src/mitm/manager.ts
language: typescript
signature:
= process.platform === "win32" && MITM_SERVER_URL.pathname.startsWith("/")
    ? decodeURIComponent(MI...


id: function:e72696ba8e1eee87690e08499fc849c9
kind: function
name: getMitmStatus
qualified_name: getMitmStatus
file_path: src/mitm/manager.ts
language: typescript
signature:
(): Promise<{
  running: boolean;
  pid: number | null;
  dnsConfigured: boolean;
  certExists: boolean;
}>


id: function:dd2807fbd3f777c76fe37e8b84290691
kind: function
name: startMitm
qualified_name: startMitm
file_path: src/mitm/manager.ts
language: typescript
signature:
(
  apiKey: string,
  sudoPassword: string,
  options: { port?: number } = {}
): Promise<{ running: true; pid: number | null }>


id: function:ce764177a938af4891df7f8d71f68179
kind: function
name: execFileWithPassword
qualified_name: execFileWithPassword
file_path: src/mitm/systemCommands.ts
language: typescript
signature:
(
  command: string,
  args: string[],
  password: string,
  stdinAfterPassword = ""
): Promise<string>


id: constant:20bbfe93f43552b1001b14465769c90a
kind: constant
name: ANTIGRAVITY_MITM_PROFILE
qualified_name: ANTIGRAVITY_MITM_PROFILE
file_path: src/mitm/targets/antigravity.ts
language: typescript
signature:
= {
  id: "antigravity",
  name: "Antigravity IDE",
  description:
    "Intercepts Antigravity IDE req...


id: constant:ee2c8265d807a96c126f9a8f34f2a063
kind: constant
name: KIRO_MITM_PROFILE
qualified_name: KIRO_MITM_PROFILE
file_path: src/mitm/targets/kiro.ts
language: typescript
signature:
= {
  id: "kiro",
  name: "Kiro IDE",
  description:
    "Intercepts Kiro IDE requests to api.anthropi...


id: constant:2ef11eeaebd5cf660eb5ef3c8ea38725
kind: constant
name: config
qualified_name: config
file_path: src/proxy.ts
language: typescript
signature:
= {
  matcher: [
    "/",
    "/dashboard/:path*",
    "/api/:path*",
    "/v1/:path*",
    "/v1",
   ...


id: constant:22b3aae521fe40f0637044f9bf2fdb08
kind: constant
name: WINDOW_MS
qualified_name: WINDOW_MS
file_path: src/server/auth/loginGuard.ts
language: typescript
signature: = 15 * 60 * 1000
docstring:
Login brute-force guard.
Tracks failed `/api/auth/login` attempts per client IP in process memory
and returns lockout decisions. Single-process scope is intentional — this
is a defense-in-depth check that pairs with Cloudflare/reverse-proxy rate
limiting, not a substitute for it.
Tunables:
  - failure threshold: 5 within `WINDOW_MS`
  - lockout duration: `LOCKOUT_MS`
  - sliding window: `WINDOW_MS`
The guard is a no-op when `enabled` is false; the caller decides based on
the `bruteForceProtection` setting (default true).


id: import:dc81f0bb21d3cc4d1e47a4c5b3203665
kind: import
name: ./headers
qualified_name: ./headers
file_path: src/server/authz/assertAuth.ts
language: typescript
signature:
import {
  AUTHZ_HEADER_AUTH_ID,
  AUTHZ_HEADER_AUTH_KIND,
  AUTHZ_HEADER_AUTH_LABEL,
  AUTHZ_HEADER_AUTH_SCOPES,
  AUTHZ_HEADER_ROUTE_CLASS,
} from "./headers";


id: import:2cafc49a2ef569f588313f9e38ff2740
kind: import
name: ../../shared/constants/publicApiRoutes
qualified_name: ../../shared/constants/publicApiRoutes
file_path: src/server/authz/classify.ts
language: typescript
signature:
import {
  PUBLIC_API_ROUTE_PREFIXES,
  PUBLIC_READONLY_API_ROUTE_PREFIXES,
  PUBLIC_READONLY_METHODS,
} from "../../shared/constants/publicApiRoutes";


id: constant:afd740f372bcd9b28ee0ab5756e39021
kind: constant
name: CLIENT_API_ALIAS_PREFIXES
qualified_name: CLIENT_API_ALIAS_PREFIXES
file_path: src/server/authz/classify.ts
language: typescript
signature:
= [
  { alias: "/chat/completions", canonical: "/api/v1/chat/completions" },
  { alias: "/responses", ...


id: constant:697a52fbb34b4863ef83fc6d9fc68dac
kind: constant
name: AUTHZ_TRUSTED_HEADERS
qualified_name: AUTHZ_TRUSTED_HEADERS
file_path: src/server/authz/headers.ts
language: typescript
signature:
= [
  AUTHZ_HEADER_ROUTE_CLASS,
  AUTHZ_HEADER_AUTH_KIND,
  AUTHZ_HEADER_AUTH_ID,
  AUTHZ_HEADER_AUTH_...


id: import:75a8ec79f534502cbf60ac4cfc6cb925
kind: import
name: ./headers
qualified_name: ./headers
file_path: src/server/authz/pipeline.ts
language: typescript
signature:
import {
  AUTHZ_HEADER_AUTH_ID,
  AUTHZ_HEADER_AUTH_KIND,
  AUTHZ_HEADER_AUTH_LABEL,
  AUTHZ_HEADER_AUTH_SCOPES,
  AUTHZ_HEADER_REQUEST_ID,
  AUTHZ_HEADER_ROUTE_CLASS,
  AUTHZ_TRUSTED_HEADERS,
} from "./headers";


id: function:bda02ba331b6cf6e0bfc4d4ccfa12c52
kind: function
name: rejectionResponse
qualified_name: rejectionResponse
file_path: src/server/authz/pipeline.ts
language: typescript
signature:
(
  outcome: Extract<AuthOutcome, { allow: false }>,
  classification: RouteClassification,
  requestId: string
): NextResponse


id: constant:8bef30320dc23a3c394f0ab69c9ae1f1
kind: constant
name: clientApiPolicy
qualified_name: clientApiPolicy
file_path: src/server/authz/policies/clientApi.ts
language: typescript
signature:
= {
  routeClass: "CLIENT_API",
  async evaluate(ctx: PolicyContext): Promise<AuthOutcome> {
    const...


id: import:38eae941af39714d24758d6f44afd2e4
kind: import
name: ../routeGuard
qualified_name: ../routeGuard
file_path: src/server/authz/policies/management.ts
language: typescript
signature:
import {
  isAlwaysProtectedPath,
  isLocalOnlyBypassableByManageScope,
  isLocalOnlyPath,
  isLoopbackHost,
} from "../routeGuard";


id: constant:91824d97f69147bb807e4010422b7ba9
kind: constant
name: managementPolicy
qualified_name: managementPolicy
file_path: src/server/authz/policies/management.ts
language: typescript
signature:
= {
  routeClass: "MANAGEMENT",
  async evaluate(ctx: PolicyContext): Promise<AuthOutcome> {
    const...


id: constant:09b33addcff292763bfc00bea9004142
kind: constant
name: publicPolicy
qualified_name: publicPolicy
file_path: src/server/authz/policies/public.ts
language: typescript
signature:
= {
  routeClass: "PUBLIC",
  async evaluate(_ctx: PolicyContext): Promise<AuthOutcome> {
    return a...


id: constant:b1933b741423fc9b04387ddd42d7c6b8
kind: constant
name: ENV_ALLOW_ALL
qualified_name: ENV_ALLOW_ALL
file_path: src/server/cors/origins.ts
language: typescript
signature: = "CORS_ALLOW_ALL"
docstring:
Centralized CORS origin allowlist.
Source of truth for which browser origins may call OmniRoute over CORS.
No wildcard default. To allow any origin, opt in via `CORS_ALLOW_ALL=true`.
Resolution order:
  1. If `CORS_ALLOW_ALL=true` → echo any origin back (effectively `*`,
     but with `Vary: Origin` so caches stay correct).
  2. Otherwise, the request's `Origin` is matched (case-insensitive,
     trailing slash ignored) against the allowlist.
  3. Allowlist sources (merged): env `CORS_ALLOWED_ORIGINS` (csv) and
     anything injected at runtime via `setRuntimeAllowedOrigins()` from
     the persisted settings layer.
The middleware applies the resolved value via `applyCorsHeaders()`.
Per-route handlers no longer set `Access-Control-Allow-Origin` themselves.


id: constant:a635950fc059947b809c15eb0b1c7911
kind: constant
name: STANDARD_ALLOW_HEADERS
qualified_name: STANDARD_ALLOW_HEADERS
file_path: src/server/cors/origins.ts
language: typescript
signature:
= "Content-Type, Authorization, x-api-key, anthropic-version, x-omniroute-connection, x-internal-test,...


id: constant:c2f70c56eed909b74533a0c002251a67
kind: constant
name: STATIC_CORS_HEADERS
qualified_name: STATIC_CORS_HEADERS
file_path: src/server/cors/origins.ts
language: typescript
signature:
= Object.freeze({
  "Access-Control-Allow-Methods": STANDARD_ALLOW_METHODS,
  "Access-Control-Allow-He...


id: constant:d56c9d7228d7212beb6a674ed8051c27
kind: constant
name: variants
qualified_name: variants
file_path: src/shared/components/Badge.tsx
language: tsx
signature:
= {
  default: "bg-black/5 dark:bg-white/10 text-text-muted",
  primary: "bg-primary/10 text-primary",...


id: function:e035caa01763bd3c6e3f4d09990848be
kind: function
name: Badge
qualified_name: Badge
file_path: src/shared/components/Badge.tsx
language: tsx
signature:
({
  children,
  variant = "default",
  size = "md",
  dot = false,
  icon,
  className,
}: BadgeProps)


id: constant:94914c36d5fbc3df78add3dfadd0c7fb
kind: constant
name: PATH_LABELS
qualified_name: PATH_LABELS
file_path: src/shared/components/Breadcrumbs.tsx
language: tsx
signature:
= {
  dashboard: "Dashboard",
  providers: "Providers",
  combos: "Combos",
  settings: "Settings",
  ...


id: constant:30ea73a8bf22c735db4b446a25c8eff2
kind: constant
name: variants
qualified_name: variants
file_path: src/shared/components/Button.tsx
language: tsx
signature:
= {
  primary: "bg-gradient-to-b from-primary to-primary-hover text-white shadow-sm",
  secondary:
   ...


id: constant:1c539000631327c2dc25b4c2262bdebb
kind: constant
name: sizes
qualified_name: sizes
file_path: src/shared/components/Button.tsx
language: tsx
signature:
= {
  sm: "h-7 px-3 text-xs rounded-md",
  md: "h-9 px-4 text-sm rounded-lg",
  lg: "h-11 px-6 text-sm...


id: function:fd329e1c6bdb4639d6ef62793695acfb
kind: function
name: Button
qualified_name: Button
file_path: src/shared/components/Button.tsx
language: tsx
signature:
({
  children,
  variant = "primary",
  size = "md",
  icon,
  iconRight,
  disabled = false,
  loading = false,
  fullWidth = false,
  className,
  ...props
}: ButtonProps)


id: function:6ade93bad94e956b38ba6161fb9f6e5b
kind: function
name: Card
qualified_name: Card
file_path: src/shared/components/Card.tsx
language: tsx
signature:
({
  children,
  title,
  subtitle,
  icon,
  action,
  padding = "md",
  hover = false,
  className,
  ...props
}: CardProps)


id: constant:7f99564821ac342035e248cc9511ce11
kind: constant
name: STATUS_CONFIG
qualified_name: STATUS_CONFIG
file_path: src/shared/components/CloudSyncStatus.tsx
language: tsx
signature:
= {
  connected: { icon: "cloud_done", color: "text-green-500", label: "Cloud" },
  syncing: { icon: "...


id: function:5c2a1c11f1adb4b8760351ff0b7a3227
kind: function
name: Collapsible
qualified_name: Collapsible
file_path: src/shared/components/Collapsible.tsx
language: tsx
signature:
({
  title,
  subtitle,
  icon,
  trailing,
  defaultOpen = false,
  variant = "default",
  className,
  children,
}: CollapsibleProps)


id: function:5ede2cc33afb9c1919b03ba21ace7b25
kind: function
name: CollapsibleSection
qualified_name: CollapsibleSection
file_path: src/shared/components/CollapsibleSection.tsx
language: tsx
signature:
({
  title,
  description,
  count,
  defaultOpen = true,
  children,
  className,
}: CollapsibleSectionProps)


id: constant:833fa78208ebadb49663b0649b7ec40e
kind: constant
name: LEVEL_COLORS
qualified_name: LEVEL_COLORS
file_path: src/shared/components/ConsoleLogViewer.tsx
language: tsx
signature:
= {
  debug: "text-gray-400",
  trace: "text-gray-500",
  info: "text-cyan-400",
  warn: "text-yellow-...


id: constant:b7606a70d2c8e202df6714036599436a
kind: constant
name: LEVEL_BG
qualified_name: LEVEL_BG
file_path: src/shared/components/ConsoleLogViewer.tsx
language: tsx
signature:
= {
  debug: "bg-gray-500/10 border-gray-500/20",
  trace: "bg-gray-500/10 border-gray-500/20",
  info...


id: interface:b3272b484709ea1c5ef85eb4d640fd80
kind: interface
name: DataTableColumn
qualified_name: DataTableColumn
file_path: src/shared/components/DataTable.tsx
language: tsx
docstring:
DataTable — Shared UI primitive (T-29)
Configurable data table with sticky header, row click,
and optional loading/empty states. Extracts the shared
table rendering pattern from RequestLoggerV2 and ProxyLogger.
Usage:
  <DataTable
    columns={visibleColumns}
    data={filteredLogs}
    renderCell={(row, column) => <span>{row[column.key]}</span>}
    onRowClick={(row) => openDetail(row)}
    selectedId={selectedLog?.id}
    loading={isLoading}
    emptyIcon="📋"
    emptyMessage="No logs found"
  />


id: function:3dd0d078a1ed80831dc1170982ee9b61
kind: function
name: DataTable
qualified_name: DataTable
file_path: src/shared/components/DataTable.tsx
language: tsx
signature:
({
  columns = [],
  data = [],
  renderCell,
  renderHeader,
  onRowClick,
  selectedId,
  loading = false,
  maxHeight = "calc(100vh - 320px)",
  emptyIcon = "📭",
  emptyMessage,
}: DataTableProps)


id: interface:0580141b2d912ca4b1e56488f9a491b2
kind: interface
name: EmptyStateProps
qualified_name: EmptyStateProps
file_path: src/shared/components/EmptyState.tsx
language: tsx
docstring:
EmptyState — FASE-07 UX
Reusable empty state component for dashboard sections when no data
is available. Provides visual feedback and optional action button.
Usage:
  <EmptyState
    icon="📡"
    title="No providers yet"
    description="Add your first API provider to get started."
    actionLabel="Add Provider"
    onAction={() => router.push('/providers/add')}
  />


id: function:aa9af2f1da428fe63f4cee777a84f0c3
kind: function
name: EmptyState
qualified_name: EmptyState
file_path: src/shared/components/EmptyState.tsx
language: tsx
signature:
({
  icon = "📭",
  title,
  description = "",
  actionLabel = "",
  onAction = null,
}: EmptyStateProps)


id: function:f249d543a61351675727291a08bb81c7
kind: function
name: ErrorPageScaffold
qualified_name: ErrorPageScaffold
file_path: src/shared/components/ErrorPageScaffold.tsx
language: tsx
signature:
({
  code,
  title,
  description,
  icon = "error",
  suggestions = [],
  primaryAction,
  secondaryAction,
}: ErrorPageScaffoldProps)


id: function:7eb5ba235131418d10d59f9b7dfd4743
kind: function
name: FilterBar
qualified_name: FilterBar
file_path: src/shared/components/FilterBar.tsx
language: tsx
signature:
({
  searchValue = "",
  onSearchChange,
  placeholder = "Search...",
  filters = [],
  activeFilters = {},
  onFilterChange,
  children,
})


id: constant:53b454ddebfb8eea550498afa021f752
kind: constant
name: footerLinks
qualified_name: footerLinks
file_path: src/shared/components/Footer.tsx
language: tsx
signature:
= {
  product: [
    { label: "Features", href: "#features" },
    { label: "Pricing", href: "#pricing...


id: import:32759e2b2a381e7256039709168fbb17
kind: import
name: @/shared/constants/providers
qualified_name: @/shared/constants/providers
file_path: src/shared/components/Header.tsx
language: tsx
signature:
import {
  OAUTH_PROVIDERS,
  APIKEY_PROVIDERS,
  FREE_PROVIDERS,
  CLAUDE_CODE_COMPATIBLE_PREFIX,
  OPENAI_COMPATIBLE_PREFIX,
  ANTHROPIC_COMPATIBLE_PREFIX,
} from "@/shared/constants/providers";


id: import:a81338db04a17a97579a2260cd96ca0a
kind: import
name: @/shared/constants/sidebarVisibility
qualified_name: @/shared/constants/sidebarVisibility
file_path: src/shared/components/Header.tsx
language: tsx
signature:
import {
  SIDEBAR_SECTIONS,
  getSectionItems,
  type SidebarItemDefinition,
  type HideableSidebarItemId,
} from "@/shared/constants/sidebarVisibility";


id: constant:0cbacb88eb896d5a4adf7a77c477e1a7
kind: constant
name: HEADER_DESCRIPTIONS
qualified_name: HEADER_DESCRIPTIONS
file_path: src/shared/components/Header.tsx
language: tsx
docstring: Map sidebar item id → header description i18n key
signature:
= {
  home: "homeDescription",
  endpoints: "endpointDescription",
  "api-manager": "apiManagerDescrip...


id: function:df9e079b40a6c029c7c6b1bddcdb9733
kind: function
name: Input
qualified_name: Input
file_path: src/shared/components/Input.tsx
language: tsx
signature:
({
  label,
  type = "text",
  placeholder,
  value,
  onChange,
  error,
  hint,
  icon,
  disabled = false,
  required = false,
  className,
  inputClassName,
  id: externalId,
  ...props
}: InputProps)


id: function:a22eb6cb26681f122eb5d7fd851cac79
kind: function
name: KiroAuthModal
qualified_name: KiroAuthModal
file_path: src/shared/components/KiroAuthModal.tsx
language: tsx
signature:
({
  isOpen,
  providerId = "kiro",
  providerLabel = "Kiro",
  onMethodSelect,
  onClose,
}: KiroAuthModalProps)


id: function:d5951cdb63db3425fbe7f47782b23085
kind: function
name: KiroSocialOAuthModal
qualified_name: KiroSocialOAuthModal
file_path: src/shared/components/KiroSocialOAuthModal.tsx
language: tsx
signature:
({
  isOpen,
  provider,
  providerLabel = "Kiro",
  onSuccess,
  onClose,
}: KiroSocialOAuthModalProps)


id: function:60031b1d3520d68f79dbb45fe1bd0897
kind: function
name: Modal
qualified_name: Modal
file_path: src/shared/components/Modal.tsx
language: tsx
signature:
({
  isOpen,
  onClose,
  title,
  children,
  footer,
  size = "md",
  closeOnOverlay = true,
  showCloseButton = true,
  className,
}: ModalProps)


id: function:cae9206c4f35c9b5f8c1d9ba749ec623
kind: function
name: ConfirmModal
qualified_name: ConfirmModal
file_path: src/shared/components/Modal.tsx
language: tsx
signature:
({
  isOpen,
  onClose,
  onConfirm,
  title = "Confirm",
  message,
  confirmText = "Confirm",
  cancelText = "Cancel",
  variant = "danger",
  loading = false,
})


id: import:ba67903a48924196d909784ca2fd03bd
kind: import
name: @/shared/constants/providers
qualified_name: @/shared/constants/providers
file_path: src/shared/components/ModelSelectModal.tsx
language: tsx
signature:
import {
  OAUTH_PROVIDERS,
  FREE_PROVIDERS,
  APIKEY_PROVIDERS,
  isOpenAICompatibleProvider,
  isAnthropicCompatibleProvider,
} from "@/shared/constants/providers";


id: constant:16b9ff3b55d16019b9b5bd53daf1ce10
kind: constant
name: PROVIDER_ORDER
qualified_name: PROVIDER_ORDER
file_path: src/shared/components/ModelSelectModal.tsx
language: tsx
docstring: Provider order: OAuth first, then Free, then API Key (matches dashboard/providers)
signature:
= [
  ...Object.keys(OAUTH_PROVIDERS),
  ...Object.keys(FREE_PROVIDERS),
  ...Object.keys(APIKEY_PROVI...


id: function:ffd4960ceb2ec80d8d11ddab189712a1
kind: function
name: ModelSelectModal
qualified_name: ModelSelectModal
file_path: src/shared/components/ModelSelectModal.tsx
language: tsx
signature:
({
  isOpen,
  onClose,
  onSelect,
  selectedModel,
  selectedModels = [],
  activeProviders = [],
  title,
  modelAliases = {},
  addedModelValues = [],
  multiSelect = false,
  showCombos = true,
}: ModelSelectModalProps)


id: constant:e289d4fc747f43e0e3d978cfa9f3ea8a
kind: constant
name: MonacoEditor
qualified_name: MonacoEditor
file_path: src/shared/components/MonacoEditor.tsx
language: tsx
docstring:
Self-hosted Monaco. Configures @monaco-editor/react to use the bundled
`monaco-editor` package instead of the default jsdelivr CDN, which is
blocked by our CSP (script-src 'self'). Keep all Editor imports going
through this wrapper so the loader is configured exactly once.

signature:
= dynamic<EditorProps>(
  async () => {
    const [{ default: Editor, loader }, monaco] = await Promis...


id: constant:0ebee22988433438ad710ca520c99da8
kind: constant
name: COLORS
qualified_name: COLORS
file_path: src/shared/components/NotificationToast.tsx
language: tsx
signature:
= {
  success: {
    bg: BG_DARK,
    border: "rgba(16, 185, 129, 0.6)",
    icon: "#10b981",
  },
  e...


id: function:cf931b2fffa804d21ab33fe60a6774b1
kind: function
name: OAuthModal
qualified_name: OAuthModal
file_path: src/shared/components/OAuthModal.tsx
language: tsx
signature:
({
  isOpen,
  provider,
  providerInfo,
  onSuccess,
  onClose,
  idcConfig,
  reauthConnection,
}: OAuthModalProps)


id: type_alias:74ba1edbe29df7edd3cff727bf36c9a9
kind: type_alias
name: OmniRouteLogoProps
qualified_name: OmniRouteLogoProps
file_path: src/shared/components/OmniRouteLogo.tsx
language: tsx
docstring:
OmniRoute logo SVG — network hub icon with connected nodes.
Matches the favicon and app icon design.


id: function:df69bdd50caa050745ba865e5da38ea1
kind: function
name: PresetSlider
qualified_name: PresetSlider
file_path: src/shared/components/PresetSlider.tsx
language: tsx
signature:
({
  value,
  onChange,
  presets,
  min = 0,
  max = 100,
  step = 1,
  className,
}: PresetSliderProps)


id: constant:1156e5cec6cd28352af0774a9ceae9fa
kind: constant
name: KNOWN_PNGS
qualified_name: KNOWN_PNGS
file_path: src/shared/components/ProviderIcon.tsx
language: tsx
signature:
= new Set([
  "agentrouter",
  "aimlapi",
  "anthropic-m",
  "blackbox",
  "claude",
  "continue",
  "...


id: constant:75c56c11abb4c4662cda20b6ad7d1492
kind: constant
name: KNOWN_SVGS
qualified_name: KNOWN_SVGS
file_path: src/shared/components/ProviderIcon.tsx
language: tsx
signature:
= new Set([
  "apikey",
  "bazaarlink",
  "brave",
  "brave-search",
  "cartesia",
  "360ai",
  "huggi...


id: constant:a67064c34ebb9bcc02b57bc9655aa2ea
kind: constant
name: ProviderIcon
qualified_name: ProviderIcon
file_path: src/shared/components/ProviderIcon.tsx
language: tsx
signature:
= memo(function ProviderIcon({
  providerId,
  size = 24,
  type = "color",
  className,
  style,
}: P...


id: constant:743c03c16c370472fff5f27d976737e9
kind: constant
name: ALL_PROXY_TYPES
qualified_name: ALL_PROXY_TYPES
file_path: src/shared/components/ProxyConfigModal.tsx
language: tsx
signature:
= [
  { value: "http", label: "HTTP" },
  { value: "https", label: "HTTPS" },
  { value: "socks5", lab...


id: constant:eb0eabeeda83225752411dd8524305b8
kind: constant
name: PROXY_TYPES
qualified_name: PROXY_TYPES
file_path: src/shared/components/ProxyConfigModal.tsx
language: tsx
signature:
= SOCKS5_UI_ENABLED
  ? ALL_PROXY_TYPES
  : ALL_PROXY_TYPES.filter((type) => type.value !== "socks5")


id: import:67f98540acd20ca3a3213d19e482fbf8
kind: import
name: @/shared/constants/colors
qualified_name: @/shared/constants/colors
file_path: src/shared/components/ProxyLogDetail.tsx
language: tsx
signature:
import {
  TYPE_COLORS,
  LEVEL_COLORS,
  PROVIDER_COLORS,
  getProxyStatusStyle as getStatusStyle,
} from "@/shared/constants/colors";


id: import:67664174f903c7e88071c9fe7cb7d2e1
kind: import
name: @/shared/utils/formatting
qualified_name: @/shared/utils/formatting
file_path: src/shared/components/ProxyLogger.tsx
language: tsx
signature:
import {
  formatTime,
  formatDuration as formatLatency,
  truncateUrl,
} from "@/shared/utils/formatting";


id: constant:ab3507d054a709e85bef359365e664e1
kind: constant
name: PROXY_COLUMN_KEYS
qualified_name: PROXY_COLUMN_KEYS
file_path: src/shared/components/ProxyLogger.tsx
language: tsx
signature:
= [
  "status",
  "proxy",
  "tls",
  "type",
  "level",
  "provider",
  "target",
  "latency",
  "ip"...


id: import:0d6fccbbe1c0c29b7c4e084a850d8a3e
kind: import
name: @/shared/constants/colors
qualified_name: @/shared/constants/colors
file_path: src/shared/components/RequestLoggerDetail.tsx
language: tsx
signature:
import {
  PROVIDER_COLORS,
  getHttpStatusStyle as getStatusStyle,
  getProtocolColor,
} from "@/shared/constants/colors";


id: import:a1f1f70649ca89544e6caf5c97ad85cf
kind: import
name: @/shared/utils/formatting
qualified_name: @/shared/utils/formatting
file_path: src/shared/components/RequestLoggerV2.tsx
language: tsx
signature:
import {
  formatTime,
  formatDuration,
  maskSegment,
  maskAccount,
  formatApiKeyLabel,
} from "@/shared/utils/formatting";


id: constant:f4ca81f695fb42b3ed3338b3701d764e
kind: constant
name: PAGE_SIZE
qualified_name: PAGE_SIZE
file_path: src/shared/components/RequestLoggerV2.tsx
language: tsx
signature: = 300
docstring:
Number of call-log rows fetched per page. The viewer grows its window by this
amount on "Load more" / infinite scroll so users can browse past the first
page (previously hardcoded to a single 300-row window). See #2565.


id: function:a1bc0784cc55fec063963983c356228e
kind: function
name: getProviderDisplayLabel
qualified_name: getProviderDisplayLabel
file_path: src/shared/components/RequestLoggerV2.tsx
language: tsx
signature: (provider: string, providerNodes?: any[]): string
docstring:
Get a friendly display label for compatible providers.
Converts long IDs like "openai-compatible-chat-02669115-2545-4896-b003-cb4dac09d441"
to readable labels. If providerNodes are available, uses user-defined name;
otherwise falls back to "OAI-Compat".


id: function:c7f812a1d5e0ad2c94dd807d0f857e25
kind: function
name: SegmentedControl
qualified_name: SegmentedControl
file_path: src/shared/components/SegmentedControl.tsx
language: tsx
signature:
({
  options = [],
  value,
  onChange,
  size = "md",
  className,
  "aria-label": ariaLabel,
}: SegmentedControlProps)


id: function:9502cf07f31c6b1d170c7bdcf22667b8
kind: function
name: Select
qualified_name: Select
file_path: src/shared/components/Select.tsx
language: tsx
signature:
({
  label,
  options = [],
  value,
  onChange,
  placeholder = "Select an option",
  error,
  hint,
  disabled = false,
  required = false,
  className,
  selectClassName,
  id: externalId,
  ...props
}: SelectProps)


id: import:1837119ed06d2a91a5c9a07ddda95377
kind: import
name: @/shared/constants/sidebarVisibility
qualified_name: @/shared/constants/sidebarVisibility
file_path: src/shared/components/Sidebar.tsx
language: tsx
signature:
import {
  HIDDEN_SIDEBAR_ITEMS_SETTING_KEY,
  SIDEBAR_SETTINGS_UPDATED_EVENT,
  SIDEBAR_SECTION_ORDER_KEY,
  SIDEBAR_ITEM_ORDER_KEY,
  SIDEBAR_SECTIONS,
  getSectionItems,
  normalizeHiddenSidebarItems,
  applySectionOrder,
  applyItemOrder,
  type SidebarSectionId,
  type SidebarItemDefinition,
  type SidebarItemGroup,
  type SidebarItemOrder,
} from "@/shared/constants/sidebarVisibility";


id: function:ad760eb86d787bbf0a827b9817be23d1
kind: function
name: Toggle
qualified_name: Toggle
file_path: src/shared/components/Toggle.tsx
language: tsx
signature:
({
  checked = false,
  onChange,
  label,
  description,
  disabled = false,
  size = "md",
  className,
  title,
  ariaLabel,
}: ToggleProps)


id: constant:fb540faa638b8b3a631a82167e7062ed
kind: constant
name: STATUS_MAP
qualified_name: STATUS_MAP
file_path: src/shared/components/TokenHealthBadge.tsx
language: tsx
signature:
= {
  healthy: { icon: "check_circle", color: "#22c55e", tooltip: "All tokens healthy" },
  warning: {...


id: import:ecc483d56a8401a2f1f2ffed2d08ad21
kind: import
name: react
qualified_name: react
file_path: src/shared/components/Tooltip.tsx
language: tsx
signature:
import {
  cloneElement,
  isValidElement,
  useCallback,
  useEffect,
  useId,
  useLayoutEffect,
  useRef,
  useState,
} from "react";


id: function:49dcf1c590ae40980423b647a8762b26
kind: function
name: Tooltip
qualified_name: Tooltip
file_path: src/shared/components/Tooltip.tsx
language: tsx
signature:
({
  children,
  content,
  position = "top",
  className = "",
  delayMs = 200,
  usePortal = true,
  multiline = false,
}: TooltipProps)


id: import:ea1e04c78d84d5867e6093197a6aa220
kind: import
name: ./analytics
qualified_name: ./analytics
file_path: src/shared/components/UsageAnalytics.tsx
language: tsx
signature:
import {
  StatCard,
  CompactStatGrid,
  ActivityHeatmap,
  DailyTrendChart,
  AccountDonut,
  ApiKeyDonut,
  ApiKeyTable,
  MostActiveDay7d,
  WeeklySquares7d,
  ModelTable,
  ProviderCostDonut,
  ModelOverTimeChart,
  ProviderTable,
  ServiceTierBreakdown,
  ApiKeyFilterDropdown,
  CustomRangePicker,
} from "./analytics";


id: function:df1d15a2acf0320c51794d939c76e843
kind: function
name: SortIcon
qualified_name: SortIcon
file_path: src/shared/components/UsageStats.tsx
language: tsx
signature:
({
  field,
  currentSort,
  currentOrder,
}: {
  field: string;
  currentSort: string;
  currentOrder: string;
})


id: constant:874be9d335549302b391b40f8f3abfa1
kind: constant
name: OPTIONS
qualified_name: OPTIONS
file_path: src/shared/components/analytics/TimeRangeSelector.tsx
language: tsx
signature:
= [
  { value: "1h", label: "1h" },
  { value: "24h", label: "24h" },
  { value: "7d", label: "7d" },
...


id: import:2d8400d2df8be814a28eff5fb222535d
kind: import
name: @/shared/utils/formatting
qualified_name: @/shared/utils/formatting
file_path: src/shared/components/analytics/charts.tsx
language: tsx
signature:
import {
  fmtCompact as fmt,
  fmtFull,
  fmtCost,
  formatApiKeyLabel as maskApiKeyLabel,
} from "@/shared/utils/formatting";


id: import:e053769a8b91a31f75f3fc64a277ec5f
kind: import
name: recharts
qualified_name: recharts
file_path: src/shared/components/analytics/charts.tsx
language: tsx
signature:
import {
  BarChart,
  ComposedChart,
  Bar,
  Line,
  XAxis,
  YAxis,
  Tooltip,
  ResponsiveContainer,
  Cell,
  PieChart,
  Pie,
  AreaChart,
  Area,
} from "recharts";


id: function:5a24a08b481808a1a56977959de769c9
kind: function
name: DarkTooltip
qualified_name: DarkTooltip
file_path: src/shared/components/analytics/charts.tsx
language: tsx
docstring: ── Custom Tooltip for dark theme ──────────────────────────────────────────
signature:
({
  active,
  payload,
  label,
  formatter,
}: {
  active?: boolean;
  payload?: any[];
  label?: any;
  formatter?: Function;
})


id: function:d02b133239a288e953693d1f251bb977
kind: function
name: StatCard
qualified_name: StatCard
file_path: src/shared/components/analytics/charts.tsx
language: tsx
signature:
({
  icon,
  label,
  value,
  subValue,
  color = "text-text-main",
}: {
  icon: any;
  label: any;
  value: any;
  subValue?: any;
  color?: string;
})


id: constant:1de0de0436ee920f3871fc1a80be2d4d
kind: constant
name: PROVIDER_COLORS
qualified_name: PROVIDER_COLORS
file_path: src/shared/components/analytics/charts.tsx
language: tsx
docstring: ── ProviderCostDonut ──────────────────────────────────────────────────────
signature:
= [
  "#f59e0b",
  "#ef4444",
  "#8b5cf6",
  "#10b981",
  "#06b6d4",
  "#ec4899",
  "#f97316",
  "#636...


id: constant:51106ef79acb672a5464f58c2454d2da
kind: constant
name: Default
qualified_name: Default
file_path: src/shared/components/docs/APIReference.stories.tsx
language: tsx
signature:
= {
  args: {
    name: "handleChat()",
    type: "async function",
    description: "Processes a chat...


id: constant:17fab963e537070d9e100d5ce9292e58
kind: constant
name: meta
qualified_name: meta
file_path: src/shared/components/docs/Callout.stories.tsx
language: tsx
signature:
= {
  title: "Docs/Callout",
  component: Callout,
  argTypes: {
    type: {
      control: "select",
...


id: constant:249d449792792c184bed1353b3b0e17a
kind: constant
name: Default
qualified_name: Default
file_path: src/shared/components/docs/Callout.stories.tsx
language: tsx
signature:
= {
  args: {
    type: "info",
    title: "Information",
    children: "This is a helpful hint to gui...


id: constant:57b31aa7b93e203f25b5ab543570120d
kind: constant
name: Warning
qualified_name: Warning
file_path: src/shared/components/docs/Callout.stories.tsx
language: tsx
signature:
= {
  args: {
    type: "warning",
    title: "Warning",
    children: "Be careful when modifying thes...


id: constant:1318bc1f981ddd69d83b40bc64fc5f37
kind: constant
name: Danger
qualified_name: Danger
file_path: src/shared/components/docs/Callout.stories.tsx
language: tsx
signature:
= {
  args: {
    type: "danger",
    title: "Critical",
    children: "Deleting this resource is irre...


id: constant:385c9c4e3860989d8e647b5f911e3076
kind: constant
name: Default
qualified_name: Default
file_path: src/shared/components/docs/CodeBlock.stories.tsx
language: tsx
signature:
= {
  args: {
    code: 'const hello = "world";\nconsole.log(hello);',
    language: "typescript",
   ...


id: constant:d6efc7edaa580ea4ad6da1489c8f8844
kind: constant
name: Default
qualified_name: Default
file_path: src/shared/components/docs/DocsBreadcrumbs.stories.tsx
language: tsx
signature:
= {
  args: {
    labels: {
      intro: "Introduction",
      routing: "Routing Engine",
      provid...


id: constant:65bcf26bd46ede3bb98efed0ac43d90e
kind: constant
name: Default
qualified_name: Default
file_path: src/shared/components/docs/DocsSidebar.stories.tsx
language: tsx
signature:
= {
  args: {
    sections: [
      {
        title: "Getting Started",
        children: [
          ...


id: constant:ef6415f0e0b010fd7515394f360aa353
kind: constant
name: Default
qualified_name: Default
file_path: src/shared/components/docs/Tabs.stories.tsx
language: tsx
signature:
= {
  args: {
    tabs: [
      {
        label: "Installation",
        content: '<div className="p-2...


id: constant:7425ae9a86ce4e93adc2923339253fa7
kind: constant
name: DOCS_TOKENS
qualified_name: DOCS_TOKENS
file_path: src/shared/components/docs/tokens.ts
language: typescript
signature:
= {
  colors: {
    info: {
      bg: "var(--color-bg-subtle)",
      border: "var(--color-accent)",
 ...


id: constant:7b61384a798624eca52e89cd39c205de
kind: constant
name: LOBE_ICON_COMPONENTS
qualified_name: LOBE_ICON_COMPONENTS
file_path: src/shared/components/lobeProviderIcons.ts
language: typescript
signature:
= {
  Ai21: { mono: Ai21MonoIcon },
  Alibaba: { mono: AlibabaMonoIcon, color: AlibabaColorIcon },
  A...


id: constant:35ffece08cce60a95664785d78a20cae
kind: constant
name: LOBE_PROVIDER_ALIASES
qualified_name: LOBE_PROVIDER_ALIASES
file_path: src/shared/components/lobeProviderIcons.ts
language: typescript
signature:
= {
  ai21: "Ai21",
  alibaba: "Alibaba",
  "alibaba-cn": "Alibaba",
  "amazon-q": "Aws",
  anthropic:...


id: constant:a1cc6bbd37c9b743e46fccd9ad3e7b9b
kind: constant
name: REPO
qualified_name: REPO
file_path: src/shared/constants/agentSkills.ts
language: typescript
signature: = "diegosouzapw/OmniRoute"
docstring:
Agent Skills metadata — single source of truth for /dashboard/agent-skills.
Each skill = 1 raw GitHub URL the user copies and pastes to any AI agent.


id: constant:bdc7695b277a4d29a189d833651b91aa
kind: constant
name: AGENT_SKILLS
qualified_name: AGENT_SKILLS
file_path: src/shared/constants/agentSkills.ts
language: typescript
signature:
= [
  // ── API Skills ──────────────────────────────────────────────────────────────
  {
    id: "omn...


id: constant:f811aaffb49929671b5d77eab4a4234f
kind: constant
name: ANTIGRAVITY_CLIENT_PROFILE_OPTIONS
qualified_name: ANTIGRAVITY_CLIENT_PROFILE_OPTIONS
file_path: src/shared/constants/antigravityClientProfile.ts
language: typescript
signature:
= [
  { value: "ide", labelKey: "antigravityClientProfileIde" },
  { value: "harness", labelKey: "anti...


id: constant:4f9c272abac335e2bacb2f4ef13da45f
kind: constant
name: APP_CONFIG
qualified_name: APP_CONFIG
file_path: src/shared/constants/appConfig.ts
language: typescript
signature:
= {
  name: "OmniRoute",
  description: "AI Gateway for Multi-Provider LLMs",
  version: pkg.version,
...


id: constant:13a6162d7657eaf70ff7d42bcdf467d6
kind: constant
name: SUPPORTED_BATCH_ENDPOINTS
qualified_name: SUPPORTED_BATCH_ENDPOINTS
file_path: src/shared/constants/batchEndpoints.ts
language: typescript
signature:
= [
  "/v1/responses",
  "/v1/chat/completions",
  "/v1/embeddings",
  "/v1/completions",
  "/v1/moder...


id: constant:f3c0290b87e93b504f595dbc4278e1e4
kind: constant
name: CLI_COMPAT_OMITTED_PROVIDER_IDS
qualified_name: CLI_COMPAT_OMITTED_PROVIDER_IDS
file_path: src/shared/constants/cliCompatProviders.ts
language: typescript
signature:
= [
  "kiro",
  "cursor",
  "droid",
  "openclaw",
  "windsurf",
  "hermes",
  "cline",
  "kilocode",
...


id: constant:3e81694fa3de139201da0a37530a8c79
kind: constant
name: CLI_COMPAT_PROVIDER_DISPLAY
qualified_name: CLI_COMPAT_PROVIDER_DISPLAY
file_path: src/shared/constants/cliCompatProviders.ts
language: typescript
signature:
= {
  claude: {
    name: "Claude Code",
    description: "Anthropic Claude Code CLI",
  },
  codex: {...


id: constant:eeb59ca03abe501da0774267f1382fdf
kind: constant
name: CLI_TOOLS
qualified_name: CLI_TOOLS
file_path: src/shared/constants/cliTools.ts
language: typescript
signature:
= {
  claude: {
    id: "claude",
    name: "Claude Code",
    icon: "terminal",
    color: "#D97757",...


id: constant:dc6a9aa7451dc9e400ed6c69c7404fdd
kind: constant
name: PROVIDER_COLORS
qualified_name: PROVIDER_COLORS
file_path: src/shared/constants/colors.ts
language: typescript
signature:
= {
  github: { bg: "#6e40c9", text: "#fff", label: "GitHub" },
  kiro: { bg: "#FF9900", text: "#000",...


id: constant:ead42702723ed46b74ef045b11997e6d
kind: constant
name: PROTOCOL_COLORS
qualified_name: PROTOCOL_COLORS
file_path: src/shared/constants/colors.ts
language: typescript
signature:
= {
  openai: { bg: "#1A1A2E", text: "#fff", label: "OpenAI-Chat" },
  "openai-responses": { bg: "#1A1...


id: constant:f1c1fd2fb1088d3bf69f1713a4253632
kind: constant
name: TYPE_COLORS
qualified_name: TYPE_COLORS
file_path: src/shared/constants/colors.ts
language: typescript
signature:
= {
  http: { bg: "#3B82F6", text: "#fff", label: "HTTP" },
  https: { bg: "#10B981", text: "#fff", la...


id: constant:af92cba9787cf00d8d074c90b7089c44
kind: constant
name: LEVEL_COLORS
qualified_name: LEVEL_COLORS
file_path: src/shared/constants/colors.ts
language: typescript
signature:
= {
  key: { bg: "#F59E0B", text: "#000", label: "Key" },
  combo: { bg: "#8B5CF6", text: "#fff", labe...


id: constant:e9b7151813d3ec6727e870dfb1b17e3f
kind: constant
name: MODEL_COLORS
qualified_name: MODEL_COLORS
file_path: src/shared/constants/colors.ts
language: typescript
signature:
= [
  "#D97757",
  "#60A5FA",
  "#34D399",
  "#A78BFA",
  "#F472B6",
  "#FBBF24",
  "#38BDF8",
  "#FB9...


id: constant:03f313bed6ea5582e2e59a2523d31014
kind: constant
name: API_ENDPOINTS
qualified_name: API_ENDPOINTS
file_path: src/shared/constants/config.ts
language: typescript
signature:
= {
  users: "/api/users",
  providers: "/api/providers",
  payments: "/api/payments",
  auth: "/api/a...


id: constant:81e03cb5336fa117cc3c691dba40dfb9
kind: constant
name: PROVIDER_ENDPOINTS
qualified_name: PROVIDER_ENDPOINTS
file_path: src/shared/constants/config.ts
language: typescript
signature:
= {
  agentrouter: "https://agentrouter.org/v1/chat/completions",
  openrouter: "https://openrouter.ai...


id: constant:02671d797a01ad02b3c8458e21f5fd5b
kind: constant
name: ERROR_CODES
qualified_name: ERROR_CODES
file_path: src/shared/constants/errorCodes.ts
language: typescript
signature:
= {
  // ── Auth ──
  AUTH_001: {
    code: "AUTH_001",
    message: "Authentication required",
    ht...


id: constant:101b034707d5f22e7da087388a48e7c5
kind: constant
name: FEATURE_FLAG_DEFINITIONS
qualified_name: FEATURE_FLAG_DEFINITIONS
file_path: src/shared/constants/featureFlagDefinitions.ts
language: typescript
signature:
= [
  // ──────────────── Security (6) ────────────────
  {
    key: "REQUIRE_API_KEY",
    label: "Re...


id: constant:5d8ace3d1a8e550eae266277888d1113
kind: constant
name: OMNIROUTE_RESPONSE_HEADERS
qualified_name: OMNIROUTE_RESPONSE_HEADERS
file_path: src/shared/constants/headers.ts
language: typescript
signature:
= {
  cache: "X-OmniRoute-Cache",
  cacheHit: "X-OmniRoute-Cache-Hit",
  latencyMs: "X-OmniRoute-Laten...


id: constant:5241f425eccd3f496632ad11b106285b
kind: constant
name: MCP_SCOPE_LIST
qualified_name: MCP_SCOPE_LIST
file_path: src/shared/constants/mcpScopes.ts
language: typescript
signature:
= [
  "read:health",
  "read:combos",
  "write:combos",
  "read:quota",
  "read:usage",
  "read:models...


id: constant:43bab14c7973f799846df8b13e94bc22
kind: constant
name: MCP_TOOL_SCOPES
qualified_name: MCP_TOOL_SCOPES
file_path: src/shared/constants/mcpScopes.ts
language: typescript
signature:
= {
  // Phase 1: Essential Tools
  omniroute_get_health: ["read:health"],
  omniroute_list_combos: ["...


id: constant:eecca34129027fa872abb37fd929f5a9
kind: constant
name: MCP_SCOPE_PRESETS
qualified_name: MCP_SCOPE_PRESETS
file_path: src/shared/constants/mcpScopes.ts
language: typescript
signature:
= {
  /** Read-only access to all health, combo, quota, and usage data */
  readonly: [
    "read:heal...


id: constant:ad401502d213dfac41b756105cb7a8d4
kind: constant
name: MODEL_SPECS
qualified_name: MODEL_SPECS
file_path: src/shared/constants/modelSpecs.ts
language: typescript
signature:
= {
  "gpt-5.5": {
    maxOutputTokens: 128000,
    contextWindow: 1050000,
    supportsThinking: true...


id: import:5113cdee213b7a7c18785e58fc60952b
kind: import
name: ./providers
qualified_name: ./providers
file_path: src/shared/constants/models.ts
language: typescript
signature:
import {
  AI_PROVIDERS,
  isAnthropicCompatibleProvider,
  isOpenAICompatibleProvider,
} from "./providers";


id: constant:2f9e06055a3694238c12cd6e9f3c5e6a
kind: constant
name: PASSTHROUGH_PROVIDERS
qualified_name: PASSTHROUGH_PROVIDERS
file_path: src/shared/constants/models.ts
language: typescript
docstring: Providers that accept any model (passthrough)
signature:
= new Set(
  Object.entries(AI_PROVIDERS)
    .filter(([, p]) => (p as any).passthroughModels)
    .ma...


id: constant:dfa13f9c0d74b818d3165f02d1effd97
kind: constant
name: AI_MODELS
qualified_name: AI_MODELS
file_path: src/shared/constants/models.ts
language: typescript
signature:
= Object.entries(MODELS).flatMap(([alias, models]) =>
  models.map((m) => ({ provider: alias, model: m...


id: constant:aa08fb75ef8185197fe5150e817b27c7
kind: constant
name: GPT_5_3_CODEX_PRICING
qualified_name: GPT_5_3_CODEX_PRICING
file_path: src/shared/constants/pricing.ts
language: typescript
signature: = { input: 5.0, output: 20.0, cached: 2.5, reasoning: 30.0, cache_creation: 5.0, }
docstring:
Default pricing rates for AI models
All rates are in dollars per million tokens ($/1M tokens)
Based on user-provided pricing for Antigravity models and industry standards for others
Shared pricing constants to reduce duplication


id: constant:cf3d23de1b49d6b0e5a5d4d95201ad2a
kind: constant
name: GLM_PRICING
qualified_name: GLM_PRICING
file_path: src/shared/constants/pricing.ts
language: typescript
signature:
= {
  "glm-5.1": {
    input: 1.2,
    output: 5,
    cached: 0.3,
    reasoning: 5,
    cache_creatio...


id: constant:8b5c1c55308a79c1ac771297f130a7e1
kind: constant
name: DEFAULT_PRICING
qualified_name: DEFAULT_PRICING
file_path: src/shared/constants/pricing.ts
language: typescript
signature:
= {
  // OAuth Providers (using aliases)

  // Claude Code (cc)
  cc: {
    "claude-opus-4-7": {
     ...


id: constant:d6fd38d482bc93ade173c3f8f4de30f0
kind: constant
name: FREE_PROVIDERS
qualified_name: FREE_PROVIDERS
file_path: src/shared/constants/providers.ts
language: typescript
signature:
= {
  qoder: { id: "qoder", alias: "if", name: "Qoder AI", icon: "water_drop", color: "#6366F1" },
  q...


id: constant:49ba9c4ff1233dd21f0ed12105d20234
kind: constant
name: OAUTH_PROVIDERS
qualified_name: OAUTH_PROVIDERS
file_path: src/shared/constants/providers.ts
language: typescript
signature:
= {
  claude: { id: "claude", alias: "cc", name: "Claude Code", icon: "smart_toy", color: "#D97757" },...


id: constant:941a362bc64efdf67a7c7f0f79a6689a
kind: constant
name: WEB_COOKIE_PROVIDERS
qualified_name: WEB_COOKIE_PROVIDERS
file_path: src/shared/constants/providers.ts
language: typescript
signature:
= {
  "chatgpt-web": {
    id: "chatgpt-web",
    alias: "cgpt-web",
    name: "ChatGPT Web (Plus/Pro)...


id: constant:15f9a4e01b0226a6dae082f75fe40097
kind: constant
name: APIKEY_PROVIDERS
qualified_name: APIKEY_PROVIDERS
file_path: src/shared/constants/providers.ts
language: typescript
signature:
= {
  agentrouter: {
    id: "agentrouter",
    alias: "agentrouter",
    name: "AgentRouter",
    ico...


id: constant:28b8fee126e8cc1aa8b3167c60454f01
kind: constant
name: IMAGE_ONLY_PROVIDER_IDS
qualified_name: IMAGE_ONLY_PROVIDER_IDS
file_path: src/shared/constants/providers.ts
language: typescript
signature:
= new Set([
  "nanobanana",
  "fal-ai",
  "stability-ai",
  "black-forest-labs",
  "recraft",
  "topaz...


id: constant:6ff5d3a1f1bcf85a733196df3f0c5c55
kind: constant
name: AGGREGATOR_PROVIDER_IDS
qualified_name: AGGREGATOR_PROVIDER_IDS
file_path: src/shared/constants/providers.ts
language: typescript
signature:
= new Set([
  "openrouter",
  "synthetic",
  "kilo-gateway",
  "aimlapi",
  "novita",
  "piapi",
  "ge...


id: constant:0631ab8b68688d9a8c23edf1974d493c
kind: constant
name: ENTERPRISE_CLOUD_PROVIDER_IDS
qualified_name: ENTERPRISE_CLOUD_PROVIDER_IDS
file_path: src/shared/constants/providers.ts
language: typescript
signature:
= new Set([
  "azure-openai",
  "azure-ai",
  "bedrock",
  "watsonx",
  "oci",
  "sap",
  "vertex",
  ...


id: constant:e90e196f67ef012f219bad06afb6f41d
kind: constant
name: VIDEO_PROVIDER_IDS
qualified_name: VIDEO_PROVIDER_IDS
file_path: src/shared/constants/providers.ts
language: typescript
signature:
= new Set([
  "runwayml",
  "veoaifree-web",
  "pollinations",
  "minimax",
  "together",
  "replicate...


id: constant:59156fa9f83becb9ec98fb3f9bd7e9cf
kind: constant
name: LOCAL_PROVIDERS
qualified_name: LOCAL_PROVIDERS
file_path: src/shared/constants/providers.ts
language: typescript
signature:
= {
  "lm-studio": {
    id: "lm-studio",
    alias: "lmstudio",
    name: "LM Studio",
    icon: "ser...


id: constant:5480427735fe6514c5cd562d07c5d943
kind: constant
name: SEARCH_PROVIDERS
qualified_name: SEARCH_PROVIDERS
file_path: src/shared/constants/providers.ts
language: typescript
signature:
= {
  "perplexity-search": {
    id: "perplexity-search",
    alias: "pplx-search",
    name: "Perplex...


id: constant:35c5b82b7365ee2aed49e9da755ef914
kind: constant
name: AUDIO_ONLY_PROVIDERS
qualified_name: AUDIO_ONLY_PROVIDERS
file_path: src/shared/constants/providers.ts
language: typescript
signature:
= {
  deepgram: {
    id: "deepgram",
    alias: "dg",
    name: "Deepgram",
    icon: "mic",
    colo...


id: constant:673b8ba47158465a7a1b8916c8c33493
kind: constant
name: UPSTREAM_PROXY_PROVIDERS
qualified_name: UPSTREAM_PROXY_PROVIDERS
file_path: src/shared/constants/providers.ts
language: typescript
signature:
= {
  cliproxyapi: {
    id: "cliproxyapi",
    alias: "cpa",
    name: "CLIProxyAPI",
    icon: "prox...


id: constant:9d170471103af11c5727610f0b3a6b0a
kind: constant
name: CLOUD_AGENT_PROVIDERS
qualified_name: CLOUD_AGENT_PROVIDERS
file_path: src/shared/constants/providers.ts
language: typescript
signature:
= {
  jules: {
    id: "jules",
    alias: "jules",
    name: "Google Jules",
    icon: "engineering",...


id: constant:6c86c265037da5ba98aa1922c291f3ad
kind: constant
name: SELF_HOSTED_CHAT_PROVIDER_IDS
qualified_name: SELF_HOSTED_CHAT_PROVIDER_IDS
file_path: src/shared/constants/providers.ts
language: typescript
signature:
= new Set([
  "lm-studio",
  "vllm",
  "lemonade",
  "llamafile",
  "llama-cpp",
  "triton",
  "docker...


id: constant:4c26a0f33e0533ef7ea2f72e060ef362
kind: constant
name: BULK_API_KEY_EXCLUDED
qualified_name: BULK_API_KEY_EXCLUDED
file_path: src/shared/constants/providers.ts
language: typescript
docstring:
Providers explicitly excluded from bulk API key add — auth is heterogeneous,
OAuth-based, multi-field, or requires manual setup per connection.

signature:
= new Set([
  "vertex",
  "vertex-partner",
  "ollama-local",
  "grok-web",
  "perplexity-web",
  "bla...


id: constant:893563116c1ae1052c19e7f032af4e2f
kind: constant
name: SYSTEM_PROVIDERS
qualified_name: SYSTEM_PROVIDERS
file_path: src/shared/constants/providers.ts
language: typescript
signature:
= {
  auto: {
    id: "auto",
    alias: "auto",
    name: "Auto (Zero-Config)",
    icon: "auto_aweso...


id: constant:156ea5efb9ba008eb629b670891340f8
kind: constant
name: AI_PROVIDERS
qualified_name: AI_PROVIDERS
file_path: src/shared/constants/providers.ts
language: typescript
signature:
= {
  ...FREE_PROVIDERS,
  ...OAUTH_PROVIDERS,
  ...APIKEY_PROVIDERS,
  ...WEB_COOKIE_PROVIDERS,
  ......


id: constant:5c2adf1313ce26760e691477c74c1909
kind: constant
name: AUTH_METHODS
qualified_name: AUTH_METHODS
file_path: src/shared/constants/providers.ts
language: typescript
signature:
= {
  oauth: { id: "oauth", name: "OAuth", icon: "lock" },
  apikey: { id: "apikey", name: "API Key", ...


id: constant:17721a0cf6c3e597c6e14d961d1d56b3
kind: constant
name: ALIAS_TO_ID
qualified_name: ALIAS_TO_ID
file_path: src/shared/constants/providers.ts
language: typescript
signature:
= Object.values(AI_PROVIDERS).reduce<Record<string, string>>((acc, p) => {
  if (p.alias) acc[p.alias]...


id: constant:fd3f52f03ad7756c2dc73ae5d3b2ac27
kind: constant
name: ID_TO_ALIAS
qualified_name: ID_TO_ALIAS
file_path: src/shared/constants/providers.ts
language: typescript
signature:
= Object.values(AI_PROVIDERS).reduce<Record<string, string>>((acc, p) => {
  acc[p.id] = p.alias || p....


id: constant:dc651fcc79a7bb0813b87a8ef6f9e873
kind: constant
name: USAGE_SUPPORTED_PROVIDERS
qualified_name: USAGE_SUPPORTED_PROVIDERS
file_path: src/shared/constants/providers.ts
language: typescript
signature:
= [
  "antigravity",
  "gemini-cli",
  "kiro",
  "amazon-q",
  "github",
  "codex",
  "claude",
  "cur...


id: constant:c89fdcf45895e73a3d24c3bb72c5b39a
kind: constant
name: PUBLIC_API_ROUTE_PREFIXES
qualified_name: PUBLIC_API_ROUTE_PREFIXES
file_path: src/shared/constants/publicApiRoutes.ts
language: typescript
signature:
= [
  "/api/auth/login",
  "/api/auth/logout",
  "/api/auth/status",
  "/api/init",
  "/api/v1/",
  "/...


id: constant:8d8f6035bf32f766778f7b516c8e8597
kind: constant
name: ROUTING_STRATEGY_VALUES
qualified_name: ROUTING_STRATEGY_VALUES
file_path: src/shared/constants/routingStrategies.ts
language: typescript
signature:
= [
  "priority",
  "weighted",
  "round-robin",
  "context-relay",
  "fill-first",
  "p2c",
  "random...


id: constant:1d84015cc4d53189ecd22ca276eb2384
kind: constant
name: ACCOUNT_FALLBACK_STRATEGY_VALUES
qualified_name: ACCOUNT_FALLBACK_STRATEGY_VALUES
file_path: src/shared/constants/routingStrategies.ts
language: typescript
signature:
= [
  "priority",
  "weighted",
  "fill-first",
  "round-robin",
  "p2c",
  "random",
  "least-used",
...


id: constant:cbc61885769b991d5ca8e098f9fbf050
kind: constant
name: ROUTING_STRATEGIES
qualified_name: ROUTING_STRATEGIES
file_path: src/shared/constants/routingStrategies.ts
language: typescript
signature:
= [
  {
    value: "priority",
    labelKey: "priority",
    combosDescKey: "priorityDesc",
    settin...


id: constant:dac17385600af095cacc555d7af49a08
kind: constant
name: HIDEABLE_SIDEBAR_ITEM_IDS
qualified_name: HIDEABLE_SIDEBAR_ITEM_IDS
file_path: src/shared/constants/sidebarVisibility.ts
language: typescript
signature:
= [
  // Home
  "home",
  // OmniProxy — flat
  "api-manager",
  "endpoints",
  "providers",
  "combos...


id: function:66c88558b548050dd54ab88ae8978dd1
kind: function
name: getSectionItems
qualified_name: getSectionItems
file_path: src/shared/constants/sidebarVisibility.ts
language: typescript
signature:
(
  section: SidebarSectionDefinition | { children: readonly SidebarSectionChild[] }
): readonly SidebarItemDefinition[]


id: constant:8f72734051d9f40bec6ce9aee3d6471b
kind: constant
name: HOME_ITEMS
qualified_name: HOME_ITEMS
file_path: src/shared/constants/sidebarVisibility.ts
language: typescript
docstring: ─── Item arrays ────────────────────────────────────────────────────────────
signature:
= [
  {
    id: "home",
    href: "/home",
    i18nKey: "home",
    subtitleKey: "homeSubtitle",
    i...


id: constant:e38e6101c371a2539a317835e4e1e6a5
kind: constant
name: OMNI_PROXY_ITEMS
qualified_name: OMNI_PROXY_ITEMS
file_path: src/shared/constants/sidebarVisibility.ts
language: typescript
signature:
= [
  {
    id: "endpoints",
    href: "/dashboard/endpoint",
    i18nKey: "endpoints",
    subtitleKe...


id: constant:f50367578885149bdcbd248dd7dd25dc
kind: constant
name: COMPRESSION_CONTEXT_GROUP
qualified_name: COMPRESSION_CONTEXT_GROUP
file_path: src/shared/constants/sidebarVisibility.ts
language: typescript
signature:
= {
  type: "group",
  id: "compression-context",
  titleKey: "compressionContextGroup",
  titleFallba...


id: constant:48b3d6184622c29d120cba4a7e1d1973
kind: constant
name: TOOLS_GROUP
qualified_name: TOOLS_GROUP
file_path: src/shared/constants/sidebarVisibility.ts
language: typescript
signature:
= {
  type: "group",
  id: "tools",
  titleKey: "toolsGroup",
  titleFallback: "Tools",
  items: [
   ...


id: constant:d980e8cf1bf3ce2f69904bc77254926e
kind: constant
name: INTEGRATIONS_GROUP
qualified_name: INTEGRATIONS_GROUP
file_path: src/shared/constants/sidebarVisibility.ts
language: typescript
signature:
= {
  type: "group",
  id: "integrations",
  titleKey: "integrationsGroup",
  titleFallback: "Integrat...


id: constant:b5ea3e8aef076bb9fb05c958a3521a17
kind: constant
name: PROXY_GROUP
qualified_name: PROXY_GROUP
file_path: src/shared/constants/sidebarVisibility.ts
language: typescript
signature:
= {
  type: "group",
  id: "proxy",
  titleKey: "proxyGroup",
  titleFallback: "Proxy",
  items: [
   ...


id: constant:b11406b4233057acbd9681fd97160815
kind: constant
name: ANALYTICS_ITEMS
qualified_name: ANALYTICS_ITEMS
file_path: src/shared/constants/sidebarVisibility.ts
language: typescript
signature:
= [
  {
    id: "analytics",
    href: "/dashboard/analytics",
    i18nKey: "usage",
    subtitleKey: ...


id: constant:b235ad68dcdf2de7b0730a7dd1f0650f
kind: constant
name: MONITORING_ITEMS
qualified_name: MONITORING_ITEMS
file_path: src/shared/constants/sidebarVisibility.ts
language: typescript
signature:
= [
  {
    id: "logs",
    href: "/dashboard/logs",
    i18nKey: "logs",
    subtitleKey: "logsSubtit...


id: constant:297b672f27298017441e445028617ce5
kind: constant
name: COSTS_PARAMS_GROUP
qualified_name: COSTS_PARAMS_GROUP
file_path: src/shared/constants/sidebarVisibility.ts
language: typescript
signature:
= {
  type: "group",
  id: "costs-parameters",
  titleKey: "costsParametersGroup",
  titleFallback: "C...


id: constant:2bcce21466465a92810d3a5ff8aec137
kind: constant
name: AUDIT_GROUP
qualified_name: AUDIT_GROUP
file_path: src/shared/constants/sidebarVisibility.ts
language: typescript
signature:
= {
  type: "group",
  id: "audit",
  titleKey: "auditGroup",
  titleFallback: "Audit",
  items: [
   ...


id: constant:f7b871fb48da21513f7e203d24cca8a7
kind: constant
name: DEVTOOLS_ITEMS
qualified_name: DEVTOOLS_ITEMS
file_path: src/shared/constants/sidebarVisibility.ts
language: typescript
signature:
= [
  {
    id: "translator",
    href: "/dashboard/translator",
    i18nKey: "translator",
    subtit...


id: constant:ed17cf7290c46962d99550c17a9061c8
kind: constant
name: MCP_GROUP
qualified_name: MCP_GROUP
file_path: src/shared/constants/sidebarVisibility.ts
language: typescript
signature:
= {
  type: "group",
  id: "mcp",
  titleKey: "mcp",
  titleFallback: "MCP Server",
  items: [
    {
 ...


id: constant:a21b9ddecebc937b43450c7fc842df58
kind: constant
name: AGENTIC_FEATURES_ITEMS
qualified_name: AGENTIC_FEATURES_ITEMS
file_path: src/shared/constants/sidebarVisibility.ts
language: typescript
signature:
= [
  {
    id: "memory",
    href: "/dashboard/memory",
    i18nKey: "memory",
    subtitleKey: "memo...


id: constant:c6303b9aceb1f87d11a79f2cf41a71c4
kind: constant
name: GAMIFICATION_GROUP
qualified_name: GAMIFICATION_GROUP
file_path: src/shared/constants/sidebarVisibility.ts
language: typescript
signature:
= {
  type: "group",
  id: "gamification",
  titleKey: "gamificationGroup",
  titleFallback: "Gamifica...


id: constant:86219b99d53343d64c653f8ed34238cb
kind: constant
name: OTHER_FEATURES_ITEMS
qualified_name: OTHER_FEATURES_ITEMS
file_path: src/shared/constants/sidebarVisibility.ts
language: typescript
signature:
= [
  {
    id: "media",
    href: "/dashboard/cache/media",
    i18nKey: "media",
    subtitleKey: "m...


id: constant:58e5265bd988d4f3983df3caa64cf7c7
kind: constant
name: BATCH_GROUP
qualified_name: BATCH_GROUP
file_path: src/shared/constants/sidebarVisibility.ts
language: typescript
signature:
= {
  type: "group",
  id: "batch",
  titleKey: "batchGroup",
  titleFallback: "Batch",
  items: [
   ...


id: constant:ef5c73e9c52e16e4f332f83a418533c3
kind: constant
name: CONFIGURATION_ITEMS
qualified_name: CONFIGURATION_ITEMS
file_path: src/shared/constants/sidebarVisibility.ts
language: typescript
signature:
= [
  {
    id: "settings",
    href: "/dashboard/settings",
    i18nKey: "settings",
    subtitleKey:...


id: constant:2326f4f55025cd7ec12631b0b900e051
kind: constant
name: HELP_ITEMS
qualified_name: HELP_ITEMS
file_path: src/shared/constants/sidebarVisibility.ts
language: typescript
signature:
= [
  {
    id: "docs",
    href: "/docs",
    i18nKey: "docs",
    subtitleKey: "docsSubtitle",
    i...


id: constant:65ac3d059848067624ae1545f3fcb731
kind: constant
name: SIDEBAR_SECTIONS
qualified_name: SIDEBAR_SECTIONS
file_path: src/shared/constants/sidebarVisibility.ts
language: typescript
signature:
= [
  {
    id: "home",
    titleKey: "home",
    titleFallback: "Home",
    children: HOME_ITEMS,
   ...


id: constant:7e63c82e07e4fbb0cc68776fe06c0fea
kind: constant
name: MINIMAL_SHOWN
qualified_name: MINIMAL_SHOWN
file_path: src/shared/constants/sidebarVisibility.ts
language: typescript
signature:
= new Set([
  "home",
  "endpoints",
  "api-manager",
  "providers",
  "combos",
  "analytics",
  "cos...


id: constant:196fced4f42e28f238e405840a093abc
kind: constant
name: DEVELOPER_SHOWN
qualified_name: DEVELOPER_SHOWN
file_path: src/shared/constants/sidebarVisibility.ts
language: typescript
signature:
= new Set([
  "home",
  "endpoints",
  "api-manager",
  "providers",
  "combos",
  "quota",
  "context...


id: constant:d4d5b9f3974c260cb059f9b628530c40
kind: constant
name: ADMIN_SHOWN
qualified_name: ADMIN_SHOWN
file_path: src/shared/constants/sidebarVisibility.ts
language: typescript
signature:
= new Set([
  "home",
  "endpoints",
  "api-manager",
  "providers",
  "combos",
  "quota",
  "analyti...


id: constant:f4bc00d823d7648eaef6f74467ae8dd6
kind: constant
name: SIDEBAR_PRESETS
qualified_name: SIDEBAR_PRESETS
file_path: src/shared/constants/sidebarVisibility.ts
language: typescript
signature:
= [
  { id: "all", icon: "select_all", hiddenItems: [] },
  { id: "minimal", icon: "minimize", hiddenI...


id: function:558dfb0a27f1168c728a35a30c85f653
kind: function
name: applySectionOrder
qualified_name: applySectionOrder
file_path: src/shared/constants/sidebarVisibility.ts
language: typescript
signature:
(
  sections: readonly SidebarSectionDefinition[],
  order: SidebarSectionId[]
): SidebarSectionDefinition[]


id: constant:ec7f8274c8a9e1050e51e62473388049
kind: constant
name: FORBIDDEN
qualified_name: FORBIDDEN
file_path: src/shared/constants/upstreamHeaders.ts
language: typescript
docstring:
User-supplied upstream extra headers: names we never forward (Host / hop-by-hop / framing).
Changing this list requires syncing: `sanitizeUpstreamHeadersMap` (models.ts), Zod
`upstreamHeaderNameSchema` / record refine (schemas.ts), and `upstream-headers-sanitize` tests.

signature:
= new Set(
  [
    "host",
    "connection",
    "content-length",
    "keep-alive",
    "proxy-connec...


id: constant:e1ec9a28cdecda3fa6166035120f4429
kind: constant
name: FORCED_VISION_BRIDGE_MODELS
qualified_name: FORCED_VISION_BRIDGE_MODELS
file_path: src/shared/constants/visionBridgeDefaults.ts
language: typescript
docstring: Vision Bridge default configuration values.
signature:
= new Set<string>([
  // Fallback list for models whose metadata is known to overstate native vision s...


id: constant:9235166c09993d8a45830b06ca69c63f
kind: constant
name: VISION_BRIDGE_DEFAULTS
qualified_name: VISION_BRIDGE_DEFAULTS
file_path: src/shared/constants/visionBridgeDefaults.ts
language: typescript
signature:
= {
  enabled: true,
  model: "openai/gpt-4o-mini",
  prompt:
    "Describe this image concisely in 2-...


id: constant:851e19e3692de0b6a77d5e24ec76a51c
kind: constant
name: VISION_BRIDGE_SETTINGS_KEYS
qualified_name: VISION_BRIDGE_SETTINGS_KEYS
file_path: src/shared/constants/visionBridgeDefaults.ts
language: typescript
signature:
= [
  "visionBridgeEnabled",
  "visionBridgeModel",
  "visionBridgePrompt",
  "visionBridgeTimeout",
 ...


id: function:0363c7608fe24f7d229048ea6f28117d
kind: function
name: normalizeQuotaResponse
qualified_name: normalizeQuotaResponse
file_path: src/shared/contracts/quota.ts
language: typescript
signature:
(
  raw: unknown,
  filters: { provider?: string | null; connectionId?: string | null } = {}
): QuotaResponse


id: function:13b23999df427cc820e13930e9b23844
kind: function
name: getIsElectronSnapshot
qualified_name: getIsElectronSnapshot
file_path: src/shared/hooks/useElectron.ts
language: typescript
signature: (): boolean
docstring:
Code Review Fixes Applied:
#7  useIsElectron — useSyncExternalStore for zero re-renders
#11 Import AppInfo type instead of inline duplication
#12 useDataDir — add error state (was swallowed silently)
── Fix #7: Module-level detection (no state, no re-renders) ──


id: interface:3b811cd5d317eb55f1ac9621b180c320
kind: interface
name: AppInfo
qualified_name: AppInfo
file_path: src/shared/hooks/useElectron.ts
language: typescript
docstring:
App info shape from Electron main process
Fix #11: Single source of truth (matches electron/types.d.ts)


id: import:91db34dc58e71e776bf846a34e6de672
kind: import
name: ../constants/bodySize
qualified_name: ../constants/bodySize
file_path: src/shared/middleware/bodySizeGuard.ts
language: typescript
signature:
import {
  normalizeRequestBodyLimitMb,
  parseRequestBodyLimitBytes,
  requestBodyLimitBytesToMb,
  requestBodyLimitMbToBytes,
} from "../constants/bodySize";


id: constant:eee5e823088ce9070163f1a46c4dde28
kind: constant
name: ROUTE_LIMITS
qualified_name: ROUTE_LIMITS
file_path: src/shared/middleware/bodySizeGuard.ts
language: typescript
signature:
= [
  { prefix: "/api/db-backups/import", limit: MAX_BODY_BYTES_IMPORT },
  { prefix: "/api/v1/audio/t...


id: import:95deb55b7d5bb1a82684b5e959b3b5e0
kind: import
name: @/shared/network/outboundUrlGuard
qualified_name: @/shared/network/outboundUrlGuard
file_path: src/shared/network/remoteImageFetch.ts
language: typescript
signature:
import {
  type OutboundUrlGuardMode,
  getProviderOutboundGuard,
  parseAndValidatePublicUrl,
  parseOutboundUrl,
} from "@/shared/network/outboundUrlGuard";


id: import:761b06e8e9c904b7337fc125f5d2098d
kind: import
name: @/shared/network/outboundUrlGuard
qualified_name: @/shared/network/outboundUrlGuard
file_path: src/shared/network/safeOutboundFetch.ts
language: typescript
signature:
import {
  OutboundUrlGuardError,
  type OutboundUrlGuardMode,
  parseAndValidatePublicUrl,
  parseOutboundUrl,
} from "@/shared/network/outboundUrlGuard";


id: constant:3791b6f6916d2dc077d536d11a63744a
kind: constant
name: SAFE_OUTBOUND_FETCH_PRESETS
qualified_name: SAFE_OUTBOUND_FETCH_PRESETS
file_path: src/shared/network/safeOutboundFetch.ts
language: typescript
signature:
= {
  validationRead: {
    timeoutMs: 5000,
    allowRedirect: false,
    retry: {
      attempts: 2,...


id: function:5fb93f7af309684607a2f0d3dd631fb2
kind: function
name: normalizeFetchFailure
qualified_name: normalizeFetchFailure
file_path: src/shared/network/safeOutboundFetch.ts
language: typescript
signature:
(
  error: unknown,
  targetUrl: string,
  method: string,
  attempts: number
): SafeOutboundFetchError


id: constant:e4e72d04ec3d8c8c481d94c45acc3865
kind: constant
name: providerConnectionSchema
qualified_name: providerConnectionSchema
file_path: src/shared/schemas/validation.ts
language: typescript
signature:
= z.object({
  provider: z.string().min(1, "Provider name is required"),
  authType: z.enum(["oauth", ...


id: constant:2741d8964882e38b777f590ad18f6614
kind: constant
name: comboNodeSchema
qualified_name: comboNodeSchema
file_path: src/shared/schemas/validation.ts
language: typescript
signature:
= z.object({
  connectionId: z.string().uuid("Invalid connection ID"),
  weight: z.number().int().min(...


id: constant:2858522eacaa8ec4cd4ef925b42b64d2
kind: constant
name: comboSchema
qualified_name: comboSchema
file_path: src/shared/schemas/validation.ts
language: typescript
signature:
= z.object({
  name: z.string().min(1, "Combo name is required").max(100),
  model: z.string().min(1, ...


id: constant:6e0ccd8fc67225681df5a22a295a04cf
kind: constant
name: settingsSchema
qualified_name: settingsSchema
file_path: src/shared/schemas/validation.ts
language: typescript
signature:
= z
  .object({
    requireLogin: z.boolean().optional(),
    password: z.string().min(6, "Password mu...


id: constant:611b482dd98aee40490e075d08911e11
kind: constant
name: proxySettingsSchema
qualified_name: proxySettingsSchema
file_path: src/shared/schemas/validation.ts
language: typescript
signature:
= z.object({
  enabled: z.boolean(),
  url: z.string().url("Invalid proxy URL").optional().or(z.litera...


id: constant:bb86b5c6d78bc2f9e7e712f74269f958
kind: constant
name: resilienceProfileSchema
qualified_name: resilienceProfileSchema
file_path: src/shared/schemas/validation.ts
language: typescript
signature:
= z.object({
  provider: z.string().min(1),
  circuitBreaker: z
    .object({
      failureThreshold: ...


id: constant:2ebde733b7c40fafeac584ee4fbffb34
kind: constant
name: chatCompletionSchema
qualified_name: chatCompletionSchema
file_path: src/shared/schemas/validation.ts
language: typescript
signature:
= z.object({
  model: z.string().min(1, "Model is required"),
  messages: z
    .array(
      z.object...


id: function:2951c98ed6d333924e29bf3d05d40e7d
kind: function
name: safePath
qualified_name: safePath
file_path: src/shared/services/backupService.ts
language: typescript
signature: (...segments: string[]): string
docstring:
Resolve a path within BACKUP_DIR and verify it stays within bounds.
Throws if the resolved path escapes BACKUP_DIR (path traversal guard).


id: function:2771b35a99da005c6890f8fc8896202a
kind: function
name: rotateBackups
qualified_name: rotateBackups
file_path: src/shared/services/backupService.ts
language: typescript
signature: (toolId: string)
docstring:
Enforce max backups per tool — removes oldest when limit exceeded.
Groups by original file basename so each config file gets its own rotation.


id: constant:e020aa098f31a7cad961f3040ab0d6c2
kind: constant
name: CLI_TOOLS
qualified_name: CLI_TOOLS
file_path: src/shared/services/cliRuntime.ts
language: typescript
signature:
= {
  claude: {
    defaultCommand: "claude",
    envBinKey: "CLI_CLAUDE_BIN",
    requiresBinary: tru...


id: function:b62c8b4205986775c7eb36afef494b21
kind: function
name: runProcess
qualified_name: runProcess
file_path: src/shared/services/cliRuntime.ts
language: typescript
signature:
(
  command: string,
  args: string[],
  {
    env,
    timeoutMs = 3000,
    useShell = isWindows(),
  }: {
    env?: Record<string, string | undefined>;
    timeoutMs?: number;
    useShell?: boolean;
  } = {}
): Promise<any>


id: constant:87cbc1f590c3757f8a85a060b09edc2c
kind: constant
name: DANGEROUS_PATH_CHARS
qualified_name: DANGEROUS_PATH_CHARS
file_path: src/shared/services/cliRuntime.ts
language: typescript
signature: = ["&", "|", ";", "<", ">", "(", ")", "`", "$", "^", "%", "!"]
docstring:
T12: Validate a CLI executable path to prevent shell injection.
Enforces: absolute path, no dangerous shell metacharacters, must exist and be a file.
Inspired by Antigravity Manager commit 96732c2 (Mar 11, 2026).


id: variable:6e4b65907a959e7090c7d64a69b6717c
kind: variable
name: _npmGlobalPrefix
qualified_name: _npmGlobalPrefix
file_path: src/shared/services/cliRuntime.ts
language: typescript
docstring:
Detect the npm global bin directory.
Cached on first call — `execFileSync` is expensive, only run once.


id: constant:a3773f8bad6a784d6f9d1b9b7b0fcaee
kind: constant
name: INTERNAL_BASE_URL
qualified_name: INTERNAL_BASE_URL
file_path: src/shared/services/cloudSyncScheduler.ts
language: typescript
signature:
= process.env.BASE_URL ||
  process.env.NEXT_PUBLIC_BASE_URL ||
  process.env.NEXT_PUBLIC_APP_URL ||
 ...


id: constant:70f074c8b6893d373480cfbeae48fc32
kind: constant
name: OPENCODE_DEFAULT_MODELS
qualified_name: OPENCODE_DEFAULT_MODELS
file_path: src/shared/services/opencodeConfig.ts
language: typescript
signature:
= [
  "claude-opus-4-5-thinking",
  "claude-sonnet-4-5-thinking",
  "gemini-3.1-pro-high",
  "gemini-3...


id: function:2d2c3d7e00bf081df7c03742afb0ae44
kind: function
name: buildOpenCodeProviderConfig
qualified_name: buildOpenCodeProviderConfig
file_path: src/shared/services/opencodeConfig.ts
language: typescript
signature:
({
  baseUrl,
  apiKey,
  model,
  models,
  modelLabels,
}: OpenCodeConfigInput): Record<string, any>


id: import:3e383ab2b93b3c0449a5036339a35ecf
kind: import
name: @/lib/usage/providerLimits
qualified_name: @/lib/usage/providerLimits
file_path: src/shared/services/providerLimitsSyncScheduler.ts
language: typescript
signature:
import {
  getLastProviderLimitsAutoSyncTime,
  getProviderLimitsSyncIntervalMinutes,
  getProviderLimitsSyncIntervalMs,
  syncAllProviderLimits,
} from "@/lib/usage/providerLimits";


id: constant:92855a5673b60f926ac2daa03469c9b0
kind: constant
name: PaginationParamsSchema
qualified_name: PaginationParamsSchema
file_path: src/shared/types/pagination.ts
language: typescript
docstring: Zod schema for validating pagination parameters from URL search params
signature:
= z.object({
  page: z.coerce.number().int().min(1).default(1),
  limit: z.coerce.number().int().min(1...


id: constant:09f5c4d26c982f7d75d51f21daca1c0c
kind: constant
name: WCAG_RULES
qualified_name: WCAG_RULES
file_path: src/shared/utils/a11yAudit.ts
language: typescript
signature:
= {
  IMAGE_ALT: "image-alt",
  ARIA_LABEL: "aria-label",
  DIALOG_ROLE: "dialog-role",
  COLOR_CONTRA...


id: function:88ece3635416b86de5c697458c83b374
kind: function
name: parseHexColor
qualified_name: parseHexColor
file_path: src/shared/utils/a11yAudit.ts
language: typescript
signature: (hex)
docstring:
Parse a hex color string to RGB components.
@param {string} hex - Color in #RGB, #RRGGBB, or #RRGGBBAA format
@returns {{ r: number, g: number, b: number }|null}


id: function:9382f6c355507567550377f97beba588
kind: function
name: relativeLuminance
qualified_name: relativeLuminance
file_path: src/shared/utils/a11yAudit.ts
language: typescript
signature: ({ r, g, b })
docstring:
Compute relative luminance per WCAG 2.x specification.
@param {{ r: number, g: number, b: number }} rgb
@returns {number} Relative luminance (0..1)


id: function:9009b66758e4a543e31441686195aebe
kind: function
name: validateBearerApiKeyForManagement
qualified_name: validateBearerApiKeyForManagement
file_path: src/shared/utils/apiAuth.ts
language: typescript
signature: (apiKey: string | null): Promise<boolean>
docstring:
Check whether a Bearer API key is valid AND carries a scope that authorizes
it on management API routes (`/api/*` excluding `/api/v1/*` and the public
allowlist). Returns `false` for unscoped keys so that the existing
default-deny posture on management routes is preserved.
Scope set is sourced from `@/shared/constants/managementScopes` so this
helper stays in lockstep with `requireManagementAuth.hasManageScope`.


id: function:a8b95d0ce8c96f92e0b3450c50411c2d
kind: function
name: isWithinSchedule
qualified_name: isWithinSchedule
file_path: src/shared/utils/apiKeyPolicy.ts
language: typescript
signature: (schedule: AccessSchedule): boolean
docstring:
Returns true if the current time (in the schedule's timezone) is within
the configured window.
Supports overnight ranges (e.g. 22:00 until 06:00).


id: function:ca0d2f8a32829a0435cdad5d91694b00
kind: function
name: errorResponse
qualified_name: errorResponse
file_path: src/shared/utils/apiResponse.ts
language: typescript
signature:
(
  code: string,
  message: string,
  status: number,
  opts?: { correlationId?: string; details?: Record<string, unknown> }
): NextResponse


id: constant:96099faeb6ba48f614addf3a1fcfb821
kind: constant
name: ErrorCodes
qualified_name: ErrorCodes
file_path: src/shared/utils/apiResponse.ts
language: typescript
signature:
= {
  // Auth
  AUTH_001: "AUTH_001", // Authentication required
  AUTH_002: "AUTH_002", // Invalid cr...


id: import:576a9ec0231b9b3ceab7bd4ef59f72ca
kind: import
name: ../../lib/db/domainState
qualified_name: ../../lib/db/domainState
file_path: src/shared/utils/circuitBreaker.ts
language: typescript
signature:
import {
  saveCircuitBreakerState,
  loadCircuitBreakerState,
  loadAllCircuitBreakerStates,
  deleteCircuitBreakerState,
  deleteAllCircuitBreakerStates,
} from "../../lib/db/domainState";


id: method:50730cf1599c4210595ede2c0374bbc4
kind: method
name: execute
qualified_name: CircuitBreaker::execute
file_path: src/shared/utils/circuitBreaker.ts
language: typescript
signature: (fn: () => Promise<T>): Promise<T>
docstring:
Execute a function through the circuit breaker.
@template T
@param {() => Promise<T>} fn - Function to execute
@returns {Promise<T>}
@throws {Error} If circuit is OPEN


id: method:7356af14359d3278ac62ebc5c7cd9039
kind: method
name: getStatus
qualified_name: CircuitBreaker::getStatus
file_path: src/shared/utils/circuitBreaker.ts
language: typescript
signature: ()
docstring:
Get the current state for monitoring.
@returns {{ name: string, state: string, failureCount: number, lastFailureTime: number|null }}


id: method:dce1f36b079707813abd48bf0906dc41
kind: method
name: _effectiveCooldown
qualified_name: CircuitBreaker::_effectiveCooldown
file_path: src/shared/utils/circuitBreaker.ts
language: typescript
signature: ()
docstring:
Resolve the cooldown for the current `lastFailureKind`. Falls back to
`resetTimeout` when no kind was recorded, no override exists for it,
or the override is not a finite non-negative number (NaN / Infinity /
negative all silently fall through to `resetTimeout`).
@private


id: constant:082dca8bc80be987170f42940f84d39c
kind: constant
name: QUOTA_PATTERNS
qualified_name: QUOTA_PATTERNS
file_path: src/shared/utils/classify429.ts
language: typescript
docstring:
Heuristic regexes for "explicit quota exhausted" vs "rate-limited"
detection in 429 error bodies. A 429 alone never implies quota
exhausted — only an explicit keyword does.
Patterns observed across OpenAI, Anthropic, Groq, Cerebras, Mistral,
Google Gemini, and OpenRouter free-tier responses.

signature:
= [
  /daily.*limit/i,
  /daily.*quota/i,
  /per.?day.*limit/i,
  /monthly.*limit/i,
  /monthly.*quota...


id: function:549382e5d97e4fd63f52842742041c8c
kind: function
name: bodyToText
qualified_name: bodyToText
file_path: src/shared/utils/classify429.ts
language: typescript
signature: (body: unknown): string
docstring:
Coerce a body of unknown shape to a string for keyword scanning.
- string: returned as-is
- object: JSON-stringified (so nested error.message gets scanned)
- undefined/null: empty string


id: function:474fd995f42d94d264e948de348f1875
kind: function
name: classify429
qualified_name: classify429
file_path: src/shared/utils/classify429.ts
language: typescript
signature:
(response: {
  status: number;
  headers?: Record<string, string>;
  body?: unknown;
}): FailureKind


id: function:7781c1b274fd9fe478f514dbd1b06330
kind: function
name: normalizeHeaders
qualified_name: normalizeHeaders
file_path: src/shared/utils/classify429.ts
language: typescript
signature: (raw: unknown): Record<string, string> | undefined
docstring:
Normalize an unknown headers-like value into a plain `Record<string, string>`.
Native `Headers` (from `fetch`) does NOT respond to `Object.entries` — it
exposes `.entries()` instead. Without this normalization, `getHeader` would
silently miss every header on a Headers instance.


id: constant:6b28e320728f557c88b91aa7cd73d50e
kind: constant
name: DEFAULT_PRICING
qualified_name: DEFAULT_PRICING
file_path: src/shared/utils/costEstimator.ts
language: typescript
docstring: Default pricing per 1M tokens (fallback when no pricing config exists). Values in USD.
signature:
= {
  "gpt-4o": { input: 2.5, output: 10.0 },
  "gpt-4o-mini": { input: 0.15, output: 0.6 },
  "gpt-4....


id: import:aeb0c35865f492ca73ec0e9c48fe3f23
kind: import
name: @/shared/constants/featureFlagDefinitions
qualified_name: @/shared/constants/featureFlagDefinitions
file_path: src/shared/utils/featureFlags.ts
language: typescript
signature:
import {
  FEATURE_FLAG_DEFINITIONS,
  type FeatureFlagDefinition,
} from "@/shared/constants/featureFlagDefinitions";


id: function:ad8ec0ec090fcb87e7be8ecb8b3e00d1
kind: function
name: resolveAllFeatureFlags
qualified_name: resolveAllFeatureFlags
file_path: src/shared/utils/featureFlags.ts
language: typescript
signature:
(): Array<{
  key: string;
  effectiveValue: string;
  source: "db" | "env" | "default";
  definition: FeatureFlagDefinition;
}>


id: constant:675fefe5bb3da57917e7a0f81f24dc51
kind: constant
name: DEFAULT_TIMEOUT_MS
qualified_name: DEFAULT_TIMEOUT_MS
file_path: src/shared/utils/fetchTimeout.ts
language: typescript
signature: = parseInt(process.env.OMNIROUTE_DEFAULT_FETCH_TIMEOUT_MS || "", 10) || 120000
docstring:
Fetch Timeout — T-25
Wraps fetch() with an AbortController-based timeout.
Default timeout is 120 seconds (FETCH_TIMEOUT_MS env var).
@module shared/utils/fetchTimeout


id: constant:a9c8cc940270f9f330fe9192736698f6
kind: constant
name: INJECTION_PATTERNS
qualified_name: INJECTION_PATTERNS
file_path: src/shared/utils/inputSanitizer.ts
language: typescript
docstring:
Input Sanitizer — FASE-01 Security Hardening
Detects prompt injection patterns and redacts PII from LLM requests.
Configurable via environment variables or dashboard settings.
@module inputSanitizer
─── Prompt Injection Patterns ───────────────────────────────────────
@type {Array<{name: string, pattern: RegExp, severity: string}>}

signature:
= [
  {
    name: "system_override",
    pattern:
      /\b(ignore|disregard|forget)\s+(all\s+)?(previ...


id: constant:baa51412c7e3a5c3c7142576f5d963c1
kind: constant
name: PII_PATTERNS
qualified_name: PII_PATTERNS
file_path: src/shared/utils/inputSanitizer.ts
language: typescript
docstring:
─── PII Patterns ────────────────────────────────────────────────────
@type {Array<{name: string, pattern: RegExp, replacement: string}>}

signature:
= [
  {
    name: "email",
    pattern: /\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,}\b/g,
    re...


id: function:aa4dba7319fbc10e623e1af29bc0d22f
kind: function
name: getConfig
qualified_name: getConfig
file_path: src/shared/utils/inputSanitizer.ts
language: typescript
signature: ()
docstring:
─── Configuration ────────────────────────────────────────────────────
Get sanitizer configuration from environment.
@returns {{ enabled: boolean, mode: string, piiRedaction: boolean }}


id: function:7b656b2dbe76f06e90a8c8243d065048
kind: function
name: extractMessageContents
qualified_name: extractMessageContents
file_path: src/shared/utils/inputSanitizer.ts
language: typescript
signature: (body)
docstring:
─── Core Functions ───────────────────────────────────────────────────
@typedef {Object} SanitizeResult
@property {boolean} blocked - Whether the request should be blocked
@property {boolean} modified - Whether the content was modified (PII redacted)
@property {Array<{pattern: string, severity: string, match: string}>} detections
@property {Array<{type: string, count: number}>} piiDetections
@property {Object} [sanitizedBody] - Modified body (if PII redaction active)
Extract all message content strings from a chat body.
Supports both `messages[]` (OpenAI/Claude) and `input[]` (Responses API).
@param {Object} body
@returns {string[]}


id: function:1a24ca4e22a0988101b962211f9299e6
kind: function
name: detectInjection
qualified_name: detectInjection
file_path: src/shared/utils/inputSanitizer.ts
language: typescript
signature: (text)
docstring:
Scan content for prompt injection patterns.
@param {string} text
@returns {Array<{pattern: string, severity: string, match: string}>}


id: function:f61cf212cc777a4408627d39fd7fb09b
kind: function
name: processPII
qualified_name: processPII
file_path: src/shared/utils/inputSanitizer.ts
language: typescript
signature: (text, redact = false)
docstring:
Scan and optionally redact PII from text.
@param {string} text
@param {boolean} redact - If true, replaces PII with placeholders
@returns {{ text: string, detections: Array<{type: string, count: number}> }}


id: function:8da11497b71f85f39ce6a10bbe508616
kind: function
name: redactBody
qualified_name: redactBody
file_path: src/shared/utils/inputSanitizer.ts
language: typescript
signature: (body)
docstring:
Deep clone body and replace message contents with PII-redacted versions.
@param {Object} body
@returns {Object}


id: constant:9970853f292c263f33b62453de254069
kind: constant
name: baseConfig
qualified_name: baseConfig
file_path: src/shared/utils/logger.ts
language: typescript
signature:
= {
  level: getAppLogLevel(isDev ? "debug" : "info"),
  base: { service: "omniroute" },
  timestamp: ...


id: function:6d1ec753f5c56b0fe0591b313629820d
kind: function
name: getMachineIdRaw
qualified_name: getMachineIdRaw
file_path: src/shared/utils/machineId.ts
language: typescript
signature: (): string
docstring:
Get raw machine ID using OS-specific methods.
We use try/catch waterfall: try each OS method and fall through
to the next on failure. Platform checks are INSIDE try blocks so they
run at RUNTIME (not build time), avoiding Next.js SWC dead-code elimination.
On Linux: skips Windows (REG.exe) and macOS (ioreg) strategies entirely.


id: constant:26b31d85ee2170bda514aee668adee2f
kind: constant
name: SECURE_NODE_LINES
qualified_name: SECURE_NODE_LINES
file_path: src/shared/utils/nodeRuntimeSupport.ts
language: typescript
signature:
= Object.freeze([
  Object.freeze({ major: 20, minor: 20, patch: 2 }),
  Object.freeze({ major: 22, mi...


id: constant:90754867e79426c9903b97e179a637df
kind: constant
name: SUPPORTED_NODE_DISPLAY
qualified_name: SUPPORTED_NODE_DISPLAY
file_path: src/shared/utils/nodeRuntimeSupport.ts
language: typescript
signature:
= "Node.js 20.20.2+ (20.x LTS), 22.22.2+ (22.x LTS), 24.0.0+ (24.x LTS), 25.0.0+ (25.x), or 26.0.0+ (2...


id: import:6d5d3fe77c28b131d41d48824e60c4a2
kind: import
name: ../constants/providers
qualified_name: ../constants/providers
file_path: src/shared/utils/providerHints.ts
language: typescript
signature:
import {
  UPSTREAM_PROXY_PROVIDERS,
  SELF_HOSTED_CHAT_PROVIDER_IDS,
  isLocalProvider,
  isClaudeCodeCompatibleProvider,
} from "../constants/providers";


id: function:6cb73653ec1eb7e52176a948efa95c05
kind: function
name: resolveManagedModelAlias
qualified_name: resolveManagedModelAlias
file_path: src/shared/utils/providerModelAliases.ts
language: typescript
signature:
({
  modelId,
  fullModel,
  providerDisplayAlias,
  existingAliases,
}: {
  modelId: string;
  fullModel: string;
  providerDisplayAlias: string;
  existingAliases: AliasMap;
}): string | null


id: constant:ad8927c7464b0211eb462fa18c75eb43
kind: constant
name: REDIS_URL
qualified_name: REDIS_URL
file_path: src/shared/utils/rateLimiter.ts
language: typescript
signature: = process.env.REDIS_URL
docstring:
Issue #2357: When OmniRoute runs in Docker without a sibling Redis
container (the default `docker run` / portainer one-click install), every
rate-limit lookup hits `redis://localhost:6379` inside the container and
spams `[REDIS] Error: connect ECONNREFUSED 127.0.0.1:6379`. Rate limiting
is non-essential for a single-instance deployment, so we now:

1) Treat `REDIS_URL` as opt-in. If it's not set we silently fall back to
the in-memory store (same code path used by unit tests).
2) Even when set, errors degrade gracefully: a single startup warning,
then suppress per-request error spam after the first occurrence.


id: constant:d19422141e9ba00d0f0a72cfc812833a
kind: constant
name: RATE_LIMIT_SCRIPT
qualified_name: RATE_LIMIT_SCRIPT
file_path: src/shared/utils/rateLimiter.ts
language: typescript
docstring:
Atomic Lua script for multi-rule rate limiting using fixed window.
Returns {1, 0} if allowed, or {0, failedWindow} if rejected.

signature:
= `
local key_prefix = KEYS[1]
local current_time = tonumber(ARGV[1])

local rules = {}
for i = 2, #AR...


id: constant:5a1e0c28b15517bb643e90675ba3033a
kind: constant
name: activeNewsSchema
qualified_name: activeNewsSchema
file_path: src/shared/utils/releaseNotes.ts
language: typescript
signature:
= z.object({
  active: z.literal(true),
  title: z.string().trim().min(1).max(120),
  message: z.strin...


id: interface:11003fcb8b30ed1f6ecae6a03c4a40a3
kind: interface
name: PhaseTiming
qualified_name: PhaseTiming
file_path: src/shared/utils/requestTelemetry.ts
language: typescript
docstring:
Request Telemetry — FASE-09 E2E Hardening (T-45)
Measures 7 phases of a request lifecycle and stores timings
for percentile calculations and monitoring.
Phases: parse → validate → policy → resolve → connect → stream → finalize
@module shared/utils/requestTelemetry


id: method:1728941137ca2cafb6ff8a1630c672cb
kind: method
name: measure
qualified_name: RequestTelemetry::measure
file_path: src/shared/utils/requestTelemetry.ts
language: typescript
signature: (phase, fn)
docstring:
Convenience: measure an async function as a phase.
@template T
@param {string} phase
@param {() => Promise<T>} fn
@returns {Promise<T>}


id: method:1f123457f6146ceab3aef8a0c709601e
kind: method
name: getSummary
qualified_name: RequestTelemetry::getSummary
file_path: src/shared/utils/requestTelemetry.ts
language: typescript
signature: ()
docstring:
Get the full telemetry summary.
@returns {{ requestId: string, totalMs: number, phases: PhaseTiming[] }}


id: function:6ba75c94150126caa575366c17feaa3c
kind: function
name: percentile
qualified_name: percentile
file_path: src/shared/utils/requestTelemetry.ts
language: typescript
signature: (sorted, p)
docstring:
Calculate percentile from sorted array.
@param {number[]} sorted
@param {number} p - Percentile (0-100)
@returns {number}


id: interface:b42f3a70fa563cd023e62e500d65ad90
kind: interface
name: TimeoutOptions
qualified_name: TimeoutOptions
file_path: src/shared/utils/requestTimeout.ts
language: typescript
docstring:
Request Timeout Utility — FASE-04 Observability
Wraps fetch/async calls with configurable timeouts and
abort controller support.
@module shared/utils/requestTimeout


id: constant:ec0d69963ba4293ff8ae83149445485e
kind: constant
name: PROVIDER_TIMEOUTS
qualified_name: PROVIDER_TIMEOUTS
file_path: src/shared/utils/requestTimeout.ts
language: typescript
signature:
= {
  openai: 60000,
  claude: 90000, // Claude can be slower for long outputs
  gemini: 60000,
  code...


id: function:634451d674fdb47abfd4a14cf7bb233b
kind: function
name: readTimeoutMs
qualified_name: readTimeoutMs
file_path: src/shared/utils/runtimeTimeouts.ts
language: typescript
signature:
(
  env: EnvSource,
  name: string,
  defaultValue: number,
  options: ReadTimeoutOptions = {}
): number


id: constant:d242ef224b68e1f5fb1b57911cb90645
kind: constant
name: KNOWN_WEAK_SECRETS
qualified_name: KNOWN_WEAK_SECRETS
file_path: src/shared/utils/secretsValidator.ts
language: typescript
docstring:
Secrets Validator — FASE-01 Security Hardening
Validates that required secrets are configured with strong values.
Called during server initialization (fail-fast on missing or weak secrets).
@module secretsValidator

signature:
= [
  "omniroute-default-secret-change-me",
  "change-me-to-a-long-random-secret",
  "endpoint-proxy-a...


id: constant:d0be71ddc1c911087003ab70f5f48006
kind: constant
name: SECRET_RULES
qualified_name: SECRET_RULES
file_path: src/shared/utils/secretsValidator.ts
language: typescript
docstring:
@typedef {Object} SecretRule
@property {string} name - Environment variable name
@property {number} minLength - Minimum acceptable length
@property {boolean} required - Whether the secret is required for startup
@property {string} description - Human-readable description
@property {string} generateHint - Command to generate a strong value
@type {SecretRule[]}

signature:
= [
  {
    name: "JWT_SECRET",
    minLength: 32,
    required: false,
    description: "JWT signing ...


id: interface:2784048f6a013dcbdf38d71ce0b7e75f
kind: interface
name: ShuffleDeck
qualified_name: ShuffleDeck
file_path: src/shared/utils/shuffleDeck.ts
language: typescript
docstring:
Shared shuffle deck utility — Fisher-Yates shuffle with anti-repeat guarantee.
Used by both combo model rotation and credential connection selection.
Thread-safe: each deck namespace gets its own promise-based mutex to prevent
race conditions when concurrent requests hit the same deck simultaneously.
─── Types ──────────────────────────────────────────────────────────────────


id: constant:7e189d9d24037150259b98d1045346a5
kind: constant
name: cavemanConfigSchema
qualified_name: cavemanConfigSchema
file_path: src/shared/validation/compressionConfigSchemas.ts
language: typescript
signature:
= z
  .object({
    enabled: z.boolean().optional(),
    compressRoles: z.array(z.enum(["user", "assis...


id: constant:e940a5da5eafb356e11d2382666d23a1
kind: constant
name: cavemanOutputModeSchema
qualified_name: cavemanOutputModeSchema
file_path: src/shared/validation/compressionConfigSchemas.ts
language: typescript
signature:
= z
  .object({
    enabled: z.boolean().optional(),
    intensity: cavemanIntensitySchema.optional(),...


id: constant:ea2a15a7331608e1007d9195d701839b
kind: constant
name: rtkConfigSchema
qualified_name: rtkConfigSchema
file_path: src/shared/validation/compressionConfigSchemas.ts
language: typescript
signature:
= z
  .object({
    enabled: z.boolean().optional(),
    intensity: rtkIntensitySchema.optional(),
   ...


id: constant:c088192c3710fd9cfaa50d01ef5b2c90
kind: constant
name: languageConfigSchema
qualified_name: languageConfigSchema
file_path: src/shared/validation/compressionConfigSchemas.ts
language: typescript
signature:
= z
  .object({
    enabled: z.boolean().optional(),
    defaultLanguage: z.string().trim().min(1).opt...


id: constant:e259822c405f5cc3a5aa424f9ad0c811
kind: constant
name: aggressiveConfigSchema
qualified_name: aggressiveConfigSchema
file_path: src/shared/validation/compressionConfigSchemas.ts
language: typescript
signature:
= z
  .object({
    thresholds: z
      .object({
        fullSummary: z.number().int().min(1).max(100...


id: constant:3249838cb744351e681a7547fcdb9ade
kind: constant
name: ultraConfigSchema
qualified_name: ultraConfigSchema
file_path: src/shared/validation/compressionConfigSchemas.ts
language: typescript
signature:
= z
  .object({
    enabled: z.boolean().optional(),
    compressionRate: z.number().min(0).max(1).opt...


id: constant:a954807c8cf2431d5d7288c4809702a3
kind: constant
name: stackedPipelineStepSchema
qualified_name: stackedPipelineStepSchema
file_path: src/shared/validation/compressionConfigSchemas.ts
language: typescript
signature:
= z.discriminatedUnion("engine", [
  z
    .object({
      engine: z.literal("lite"),
      intensity:...


id: constant:63c467558eaa8b0d623b066c6a46cb19
kind: constant
name: compressionSettingsUpdateSchema
qualified_name: compressionSettingsUpdateSchema
file_path: src/shared/validation/compressionConfigSchemas.ts
language: typescript
signature:
= z
  .object({
    enabled: z.boolean().optional(),
    defaultMode: compressionModeSchema.optional()...


id: constant:483c46cb4692f611b82ad0293caee09e
kind: constant
name: oneproxyFilterSchema
qualified_name: oneproxyFilterSchema
file_path: src/shared/validation/oneproxySchemas.ts
language: typescript
signature:
= z.object({
  protocol: z.enum(["http", "https", "socks4", "socks5"]).optional(),
  countryCode: z.st...


id: constant:e37a074a48a2a189a1ca55565ebe6b94
kind: constant
name: ProviderSchema
qualified_name: ProviderSchema
file_path: src/shared/validation/providerSchema.ts
language: typescript
signature:
= z.object({
  id: z.string().min(1),
  alias: z.string().min(1).optional(),
  name: z.string().min(1)...


id: import:7b5d3ce3fa9390ac419fe6025c4e7c7a
kind: import
name: @/shared/constants/routingStrategies
qualified_name: @/shared/constants/routingStrategies
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
import {
  ACCOUNT_FALLBACK_STRATEGY_VALUES,
  ROUTING_STRATEGY_VALUES,
} from "@/shared/constants/routingStrategies";


id: constant:fdf2cf318476c9106d51480dd0b5c233
kind: constant
name: createProviderSchema
qualified_name: createProviderSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z
  .object({
    provider: z.string().min(1).max(100),
    apiKey: z.string().max(10000).optional()...


id: constant:2ef2684fc85d27bf53cab2c78e9fb049
kind: constant
name: bulkCreateProviderSchema
qualified_name: bulkCreateProviderSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z
  .object({
    provider: z.string().min(1).max(100),
    entries: z
      .array(
        z.objec...


id: constant:d6ba042f6b26da47b5385e21972a783b
kind: constant
name: importCodexAuthSchema
qualified_name: importCodexAuthSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z.object({
  source: z.discriminatedUnion("kind", [
    z.object({ kind: z.literal("json"), json: z....


id: constant:419d96b1393f08bf459b1fc05a037b08
kind: constant
name: importCodexAuthBulkSchema
qualified_name: importCodexAuthBulkSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z.object({
  entries: z
    .array(
      z.object({
        json: z.unknown(),
        name: z.stri...


id: constant:b97b0ce421fc12a7feea1b6a90414cb7
kind: constant
name: createKeySchema
qualified_name: createKeySchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z.object({
  name: z.string().min(1, "Name is required").max(200),
  noLog: z.boolean().optional(),
...


id: constant:d8e18620f1a37899ae7d2e637a2875c9
kind: constant
name: comboStepMetaSchema
qualified_name: comboStepMetaSchema
file_path: src/shared/validation/schemas.ts
language: typescript
docstring: ──── Combo Schemas ────
signature:
= {
  id: z.string().trim().min(1).max(200).optional(),
  weight: z.number().min(0).max(100).optional(...


id: constant:fb77add1038ec951e8f92fdeb633bbc8
kind: constant
name: comboModelStepInputSchema
qualified_name: comboModelStepInputSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z.object({
  kind: z.literal("model").optional(),
  provider: z.string().trim().min(1).max(120).opti...


id: constant:560dc5b5bf060eeebc8adeb124f85200
kind: constant
name: comboRefStepInputSchema
qualified_name: comboRefStepInputSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z.object({
  kind: z.literal("combo-ref"),
  comboName: z.string().trim().min(1).max(100),
  ...comb...


id: constant:164e2f4f6c70837ccc6b2a72b135efec
kind: constant
name: comboModelEntry
qualified_name: comboModelEntry
file_path: src/shared/validation/schemas.ts
language: typescript
docstring: A combo entry can be a plain string (legacy), a legacy object, or a structured ComboStep.
signature:
= z.union([
  z.string().trim().min(1).max(300),
  comboModelStepInputSchema,
  comboRefStepInputSchem...


id: constant:90d257042f1bb46fa76639c4398437f7
kind: constant
name: scoringWeightsSchema
qualified_name: scoringWeightsSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z
  .object({
    quota: z.number().min(0).max(1),
    health: z.number().min(0).max(1),
    costInv...


id: constant:56bcc40b24213cb39e2f4c6188b15d8a
kind: constant
name: compositeTierEntrySchema
qualified_name: compositeTierEntrySchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z
  .object({
    stepId: z.string().trim().min(1).max(200),
    fallbackTier: z.string().trim().min...


id: constant:31647af6a122d5ec930d1e1e7ce11f25
kind: constant
name: compositeTiersSchema
qualified_name: compositeTiersSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z
  .object({
    defaultTier: z.string().trim().min(1).max(100),
    tiers: z.record(z.string().tri...


id: constant:1d11ffd3cd8830f32a01096d9f78c52f
kind: constant
name: comboRuntimeConfigSchema
qualified_name: comboRuntimeConfigSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z
  .object({
    strategy: comboStrategySchema.optional(),
    maxRetries: z.coerce.number().int()....


id: constant:5e93462c7ac0348bd041fa7f95ec2c2f
kind: constant
name: comboNameSchema
qualified_name: comboNameSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z
  .string()
  .trim()
  .min(1, "Name is required")
  .max(100)
  .regex(
    /^[a-zA-Z0-9_/.\-\[\...


id: constant:2a9f46cf2a9ea8736835fc5751a814a2
kind: constant
name: createComboSchema
qualified_name: createComboSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z.object({
  name: comboNameSchema,
  models: z.array(comboModelEntry).optional().default([]),
  str...


id: constant:b0e7d9f0d3f51eae681de5caf544a5dd
kind: constant
name: settingsFallbackStrategySchema
qualified_name: settingsFallbackStrategySchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature: = z.enum(ACCOUNT_FALLBACK_STRATEGY_VALUES)
docstring:
──── Settings Schemas ────
FASE-01: Removed .passthrough() — only explicitly listed fields are accepted


id: constant:3e8950e365b854d08fc98091918846b7
kind: constant
name: updateSettingsSchema
qualified_name: updateSettingsSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z.object({
  newPassword: z.string().min(1).max(200).optional(),
  currentPassword: z.string().max(2...


id: constant:963bdef748c873d1bcb91c39d7447e56
kind: constant
name: dbBackupCleanupSchema
qualified_name: dbBackupCleanupSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z.object({
  keepLatest: z.number().int().min(1).max(200).optional(),
  retentionDays: z.number().in...


id: constant:c687c5c603dff4b479d26a496f76e21a
kind: constant
name: embeddingInputSchema
qualified_name: embeddingInputSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z.union([
  nonEmptyStringSchema,
  z.array(nonEmptyStringSchema).min(1, "input must contain at leas...


id: constant:50c9babef069278f9797a84adc0e4e21
kind: constant
name: chatMessageSchema
qualified_name: chatMessageSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z
  .object({
    role: z.string().trim().min(1, "messages[].role is required"),
    content: z.unio...


id: constant:7a94d208e83453a9c1cdc796fefde1d1
kind: constant
name: countTokensMessageSchema
qualified_name: countTokensMessageSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z
  .object({
    content: z.union([
      nonEmptyStringSchema,
      z
        .array(
          z...


id: constant:428fde8c0017d8be685bc99a87a09cc7
kind: constant
name: v1EmbeddingsSchema
qualified_name: v1EmbeddingsSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z
  .object({
    model: modelIdSchema,
    input: embeddingInputSchema,
    dimensions: z.coerce.nu...


id: constant:3033b7885e1c6d58eeb016565a266b87
kind: constant
name: v1ImageGenerationSchema
qualified_name: v1ImageGenerationSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z
  .object({
    model: modelIdSchema,
    prompt: nonEmptyStringSchema.optional(),
  })
  .catchal...


id: constant:20c12a13b5f42b074830e737d4ebfeac
kind: constant
name: v1AudioSpeechSchema
qualified_name: v1AudioSpeechSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z
  .object({
    model: modelIdSchema,
    input: nonEmptyStringSchema,
  })
  .catchall(z.unknown(...


id: constant:20901491d1c55fa719f2b265426465ee
kind: constant
name: v1ModerationSchema
qualified_name: v1ModerationSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z
  .object({
    model: modelIdSchema.optional(),
    input: z.unknown().refine((value) => {
      ...


id: constant:4b72fc40d9a10a129f781bdc7ee628c2
kind: constant
name: v1RerankSchema
qualified_name: v1RerankSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z
  .object({
    model: modelIdSchema,
    query: nonEmptyStringSchema,
    documents: z.array(z.un...


id: constant:c9314b3465e4a171459787ac0485077c
kind: constant
name: providerChatCompletionSchema
qualified_name: providerChatCompletionSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z
  .object({
    model: modelIdSchema,
    messages: z.array(chatMessageSchema).min(1).optional(),
...


id: constant:9a216d35d01fea1f6eb5261456e2e3d1
kind: constant
name: v1CountTokensSchema
qualified_name: v1CountTokensSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z
  .object({
    messages: z.array(countTokensMessageSchema).min(1, "messages must contain at least...


id: constant:5548ee16a496aa46d295a2136582f268
kind: constant
name: setBudgetSchema
qualified_name: setBudgetSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z
  .object({
    apiKeyId: z.string().trim().min(1, "apiKeyId is required"),
    dailyLimitUsd: z.c...


id: constant:bef2c40a8b30611d7426ef6732497116
kind: constant
name: policyActionSchema
qualified_name: policyActionSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z
  .object({
    action: z.enum(["unlock"]),
    identifier: z.string().trim().min(1).optional(),
 ...


id: constant:be5e0e6582afef8e57a019abc2af7249
kind: constant
name: fallbackChainEntrySchema
qualified_name: fallbackChainEntrySchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z
  .object({
    provider: z.string().trim().min(1, "provider is required"),
    priority: z.number...


id: constant:babd271184d0e9c4b4933924fcb3101f
kind: constant
name: registerFallbackSchema
qualified_name: registerFallbackSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z.object({
  model: modelIdSchema,
  chain: z.array(fallbackChainEntrySchema).min(1, "chain must con...


id: constant:cbe0a11580672e113dd3b4e67f0db5af
kind: constant
name: updateModelAliasSchema
qualified_name: updateModelAliasSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z.object({
  model: modelIdSchema,
  alias: z.string().trim().min(1, "Alias is required").max(200),
...


id: constant:bb803518a57bb42f83b3f494451be1d6
kind: constant
name: upstreamHeaderNameSchema
qualified_name: upstreamHeaderNameSchema
file_path: src/shared/validation/schemas.ts
language: typescript
docstring:
Align with `sanitizeUpstreamHeadersMap` — allow non-ASCII names; reject Host / hop-by-hop / whitespace / ":".

signature:
= z
  .string()
  .trim()
  .min(1)
  .max(128)
  .refine((s) => !/[\r\n\0]/.test(s), { message: "head...


id: constant:1b83ca2e8fb97954b24687b3e29bba17
kind: constant
name: upstreamHeaderValueSchema
qualified_name: upstreamHeaderValueSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z
  .string()
  .max(4096)
  .refine((s) => !/[\r\n]/.test(s), { message: "header value cannot conta...


id: constant:112fb2e22dfff8a50cd6e66f8dd926a7
kind: constant
name: upstreamHeadersRecordSchema
qualified_name: upstreamHeadersRecordSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z
  .record(upstreamHeaderNameSchema, upstreamHeaderValueSchema)
  .refine((rec) => Object.keys(rec)...


id: constant:956eef244e1da904ccc0a36e83d8845d
kind: constant
name: modelCompatPerProtocolSchema
qualified_name: modelCompatPerProtocolSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z
  .object({
    normalizeToolCallId: z.boolean().optional(),
    preserveOpenAIDeveloperRole: z.bo...


id: constant:219006e3b2177122c3ebcba529442039
kind: constant
name: providerModelMutationSchema
qualified_name: providerModelMutationSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z.object({
  provider: z.string().trim().min(1, "provider is required").max(120),
  modelId: z.strin...


id: constant:366ef4c4450fed1811b0875e583d7c0c
kind: constant
name: pricingFieldsSchema
qualified_name: pricingFieldsSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z
  .object({
    input: z.number().min(0).optional(),
    output: z.number().min(0).optional(),
   ...


id: constant:c8f1ecfe462266c14a585f01c40122c0
kind: constant
name: toggleRateLimitSchema
qualified_name: toggleRateLimitSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z.object({
  connectionId: z.string().trim().min(1, "connectionId is required"),
  enabled: z.boolea...


id: constant:ab7f5bd418c9e47a112431fa5905bc26
kind: constant
name: legacyResilienceProfileSchema
qualified_name: legacyResilienceProfileSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z.object({
  transientCooldown: z.number().min(0),
  rateLimitCooldown: z.number().min(0),
  maxBack...


id: constant:4691a2f3d0073d2e8468fc106d3511b9
kind: constant
name: legacyResilienceDefaultsSchema
qualified_name: legacyResilienceDefaultsSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z
  .object({
    requestsPerMinute: z.number().int().min(1).optional(),
    minTimeBetweenRequests:...


id: constant:ae3b047c55e00ac992ad4f33c9ee8c99
kind: constant
name: requestQueueSettingsSchema
qualified_name: requestQueueSettingsSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z
  .object({
    autoEnableApiKeyProviders: z.boolean().optional(),
    requestsPerMinute: z.number...


id: constant:85b42fd723e5fb9fda26f5afcaf241aa
kind: constant
name: connectionCooldownProfileSchema
qualified_name: connectionCooldownProfileSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z
  .object({
    baseCooldownMs: z.number().int().min(0).optional(),
    useUpstreamRetryHints: z.b...


id: constant:67d21e574d619cacf6bfe40f675431b8
kind: constant
name: providerBreakerProfileSchema
qualified_name: providerBreakerProfileSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z
  .object({
    failureThreshold: z.number().int().min(1).optional(),
    resetTimeoutMs: z.number...


id: constant:bc26d51875c0fee693c409fe239d0671
kind: constant
name: waitForCooldownSettingsSchema
qualified_name: waitForCooldownSettingsSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z
  .object({
    enabled: z.boolean().optional(),
    maxRetries: z.number().int().min(0).max(10).o...


id: constant:7575dc78d80c7f4bbc31c169bb46c9e3
kind: constant
name: updateResilienceSchema
qualified_name: updateResilienceSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z
  .object({
    requestQueue: requestQueueSettingsSchema.optional(),
    connectionCooldown: z
   ...


id: constant:4ad06226458b64af137c0a125e4a77b6
kind: constant
name: pricingSyncRequestSchema
qualified_name: pricingSyncRequestSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z
  .object({
    sources: z.array(pricingSyncSourceSchema).min(1).optional(),
    dryRun: z.boolean...


id: constant:ef7057c7a2af3210c3fba43e9aa9ab01
kind: constant
name: taskRoutingModelMapSchema
qualified_name: taskRoutingModelMapSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z
  .object({
    coding: z.string().max(200).optional(),
    creative: z.string().max(200).optional...


id: constant:19989821d382273aa38f4d5a35259b69
kind: constant
name: updateTaskRoutingSchema
qualified_name: updateTaskRoutingSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z
  .object({
    enabled: z.boolean().optional(),
    taskModelMap: taskRoutingModelMapSchema.optio...


id: constant:c4f9d775686bf41e4a5ad8a843122ed7
kind: constant
name: taskRoutingActionSchema
qualified_name: taskRoutingActionSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z.discriminatedUnion("action", [
  resetStatsActionSchema,
  z
    .object({
      action: z.literal...


id: constant:ff381d0cb770c0364d22f3d99ccaecf3
kind: constant
name: updateComboDefaultsSchema
qualified_name: updateComboDefaultsSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z
  .object({
    comboDefaults: comboRuntimeConfigSchema.optional(),
    providerOverrides: z.recor...


id: constant:38b24f51962c6c2dc2b819a51ed4b95c
kind: constant
name: updateRequireLoginSchema
qualified_name: updateRequireLoginSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z
  .object({
    requireLogin: z.boolean().optional(),
    password: z.string().min(4, "Password mu...


id: constant:a48489e4e622b5b502a501e059119701
kind: constant
name: updateSystemPromptSchema
qualified_name: updateSystemPromptSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z
  .object({
    prompt: z.string().max(50000).optional(),
    enabled: z.boolean().optional(),
  }...


id: constant:8a47ffd51d21d1515179b60dedccee10
kind: constant
name: updateThinkingBudgetSchema
qualified_name: updateThinkingBudgetSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z
  .object({
    mode: z.enum(["passthrough", "auto", "custom", "adaptive"]).optional(),
    custom...


id: constant:67d1824366ecb976b6e5c291dda09928
kind: constant
name: payloadRuleModelSpecSchema
qualified_name: payloadRuleModelSpecSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z
  .object({
    name: z.string().trim().min(1),
    protocol: z.string().trim().min(1).optional(),...


id: constant:1a35234f6d50f5e63316d2d07ea26e89
kind: constant
name: payloadMutationRuleSchema
qualified_name: payloadMutationRuleSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z
  .object({
    models: z.array(payloadRuleModelSpecSchema).min(1),
    params: z
      .record(z....


id: constant:5b92b6488d450b01024551bddcdc6d74
kind: constant
name: payloadFilterRuleSchema
qualified_name: payloadFilterRuleSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z
  .object({
    models: z.array(payloadRuleModelSpecSchema).min(1),
    params: z.array(z.string()...


id: constant:801d7c948d86829c8073a025039bdf54
kind: constant
name: updatePayloadRulesSchema
qualified_name: updatePayloadRulesSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z
  .object({
    default: z.array(payloadMutationRuleSchema).optional(),
    override: z.array(payl...


id: constant:839d3350b55fd96405467c4f24f1b909
kind: constant
name: tempBanSchema
qualified_name: tempBanSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z.object({
  ip: z.string().trim().min(1),
  durationMs: z.coerce.number().int().min(1).optional(),
...


id: constant:bcf13c0d7833411f3d0c5dff4951ffb2
kind: constant
name: updateIpFilterSchema
qualified_name: updateIpFilterSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z
  .object({
    enabled: z.boolean().optional(),
    mode: ipFilterModeSchema.optional(),
    blac...


id: constant:0d23ab0636860689f342675ae586f52c
kind: constant
name: proxyConfigSchema
qualified_name: proxyConfigSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z
  .object({
    type: z
      .preprocess(
        (value) => (typeof value === "string" ? value.t...


id: constant:188bb286440f5a164fd03992cae58353
kind: constant
name: updateProxyConfigSchema
qualified_name: updateProxyConfigSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z
  .object({
    proxy: proxyConfigSchema.nullable().optional(),
    global: proxyConfigSchema.null...


id: constant:b42cb8a4986ca6e8dc9e3253baa22de1
kind: constant
name: testProxySchema
qualified_name: testProxySchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z.object({
  proxy: z.object({
    type: z.string().optional(),
    host: z.string().trim().min(1, "...


id: constant:2747c4f138957bc58baf75b2f4e9d45b
kind: constant
name: createProxyRegistrySchema
qualified_name: createProxyRegistrySchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z
  .object({
    name: z.string().trim().min(1, "name is required").max(120),
    type: z
      .pr...


id: constant:3840d4a58e28cdb6c09404b3bef6381e
kind: constant
name: bulkImportProxiesSchema
qualified_name: bulkImportProxiesSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z
  .object({
    items: z
      .array(createProxyRegistrySchema)
      .min(1, "At least one proxy...


id: constant:23cf0e081b9473d290c732d4dded4489
kind: constant
name: proxyAssignmentSchema
qualified_name: proxyAssignmentSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z
  .object({
    scope: z.enum(["global", "provider", "account", "combo", "key"]),
    scopeId: z.s...


id: constant:03a706340ba181271c4c5206eab9c8af
kind: constant
name: bulkProxyAssignmentSchema
qualified_name: bulkProxyAssignmentSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z
  .object({
    scope: z.enum(["global", "provider", "account", "combo", "key"]),
    scopeIds: z....


id: constant:72cf8fa64975ba282ad3e9b0f7ab9e92
kind: constant
name: nonEmptyJsonRecordSchema
qualified_name: nonEmptyJsonRecordSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= jsonRecordSchema.refine(
  (value) => Object.keys(value).length > 0,
  "Body must be a non-empty obj...


id: constant:88879c900b81ba49f8060b722e7a73c1
kind: constant
name: translatorSendSchema
qualified_name: translatorSendSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z.object({
  provider: z.string().trim().min(1, "Provider is required"),
  body: nonEmptyJsonRecordS...


id: constant:8708bbc8bd86fc338a9c21aad28b53ae
kind: constant
name: translatorTranslateSchema
qualified_name: translatorTranslateSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z
  .object({
    step: z.union([z.number().int().min(1).max(4), z.literal("direct")]),
    provider...


id: constant:c48fe77628110889cfad51770e9aa237
kind: constant
name: oauthExchangeSchema
qualified_name: oauthExchangeSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z.object({
  code: z.string().trim().min(1),
  redirectUri: z.string().trim().min(1),
  codeVerifier...


id: constant:00ef3477099529274db5c496ca1a3df3
kind: constant
name: oauthPollSchema
qualified_name: oauthPollSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z.object({
  deviceCode: z.string().trim().min(1),
  codeVerifier: z.string().optional(),
  extraDat...


id: constant:26875ee4941afb3dcab6a35e300cdf5e
kind: constant
name: oauthImportTokenSchema
qualified_name: oauthImportTokenSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z.object({
  token: z.string().trim().min(1, "Token is required"),
  connectionId: z.string().option...


id: constant:5d7035010aaeb06bf1d9ad0b1859988d
kind: constant
name: cursorImportSchema
qualified_name: cursorImportSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z.object({
  accessToken: z.string().trim().min(1, "Access token is required"),
  machineId: z.strin...


id: constant:0148c04d667587177350e93b06b4ff13
kind: constant
name: kiroImportSchema
qualified_name: kiroImportSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z.object({
  refreshToken: z.string().trim().min(1, "Refresh token is required"),
  region: z.string...


id: constant:a8e0aaaafe6c5c468879343e7ce89e01
kind: constant
name: kiroSocialExchangeSchema
qualified_name: kiroSocialExchangeSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z.object({
  code: z.string().trim().min(1, "Code is required"),
  codeVerifier: z.string().trim().m...


id: constant:eab6db1d9f679ac80552562f14f9b05c
kind: constant
name: cloudCredentialUpdateSchema
qualified_name: cloudCredentialUpdateSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z.object({
  provider: z.string().trim().min(1, "Provider is required"),
  credentials: z
    .objec...


id: constant:c7b6e3e17e7b8af87c07b75b26194f54
kind: constant
name: cloudModelAliasUpdateSchema
qualified_name: cloudModelAliasUpdateSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z.object({
  model: z.string().trim().min(1, "Model and alias required"),
  alias: z.string().trim()...


id: constant:047c9a3b8b1bf3f17278fd04df3904b0
kind: constant
name: updateComboSchema
qualified_name: updateComboSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z
  .object({
    name: comboNameSchema.optional(),
    models: z.array(comboModelEntry).optional(),...


id: constant:6914280466b0b082aba01e68382d7fc6
kind: constant
name: reorderCombosSchema
qualified_name: reorderCombosSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z
  .object({
    comboIds: z.array(z.string().trim().min(1).max(200)).min(1).max(1000),
  })
  .sup...


id: constant:f2c19ae2a6724039922325238e66a947
kind: constant
name: evalTargetSchema
qualified_name: evalTargetSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z
  .object({
    type: z.enum(["suite-default", "model", "combo"]),
    id: z.string().trim().min(1...


id: constant:2c768ae563edd4aa004077dc2b084ea1
kind: constant
name: evalMessageSchema
qualified_name: evalMessageSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z.object({
  role: z.string().trim().min(1, "message.role is required").max(50),
  content: z.string...


id: constant:3726d9613146305ff93501e51cbc8989
kind: constant
name: evalCaseBuilderSchema
qualified_name: evalCaseBuilderSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z.object({
  id: z.string().trim().min(1).optional(),
  name: z.string().trim().min(1, "case.name is...


id: constant:ad7bbefa5e40e596ed8d7eb4f97a256d
kind: constant
name: evalRunSuiteSchema
qualified_name: evalRunSuiteSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z
  .object({
    suiteId: z.string().trim().min(1, "suiteId is required"),
    outputs: z.record(z....


id: constant:d2532e8866b9c1837ee522b2334a4f93
kind: constant
name: evalSuiteSaveSchema
qualified_name: evalSuiteSaveSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z.object({
  id: z.string().trim().min(1).optional(),
  name: z.string().trim().min(1, "name is requ...


id: constant:e12e96a12591a55824685d882ad61fe0
kind: constant
name: accessScheduleSchema
qualified_name: accessScheduleSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z.object({
  enabled: z.boolean(),
  from: z.string().regex(/^\d{2}:\d{2}$/, "Time must be in HH:MM ...


id: constant:4df46b6154172244cf714d71cf0006c6
kind: constant
name: updateKeyPermissionsSchema
qualified_name: updateKeyPermissionsSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z
  .object({
    name: z.string().trim().min(1).max(200).optional(),
    allowedModels: z.array(z.s...


id: constant:c5be807cb999f0abd37a4d9292200264
kind: constant
name: createProviderNodeSchema
qualified_name: createProviderNodeSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z
  .object({
    name: z.string().trim().min(1, "Name is required"),
    prefix: z.string().trim()....


id: constant:4f81a2bc444cc7a5b2a79c12021ba0a8
kind: constant
name: updateProviderNodeSchema
qualified_name: updateProviderNodeSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z.object({
  name: z.string().trim().min(1, "Name is required"),
  prefix: z.string().trim().min(1, ...


id: constant:2b04a371582e34d209e488b82d0c5243
kind: constant
name: providerNodeValidateSchema
qualified_name: providerNodeValidateSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z.object({
  baseUrl: z.string().trim().min(1, "Base URL and API key required"),
  apiKey: z.string(...


id: constant:8207bf9c69b88598fa05f52bac695893
kind: constant
name: updateProviderConnectionSchema
qualified_name: updateProviderConnectionSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z
  .object({
    name: z.string().max(200).optional(),
    priority: z.coerce.number().int().min(1)...


id: constant:667da1d47c69f1bec241946d43e27cf8
kind: constant
name: providersBatchTestSchema
qualified_name: providersBatchTestSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z
  .object({
    mode: z.enum([
      "provider",
      "oauth",
      "free",
      "apikey",
    ...


id: constant:e6bd8693f928fde83b6071d50b6d91e8
kind: constant
name: validateProviderApiKeySchema
qualified_name: validateProviderApiKeySchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z
  .object({
    provider: z.string().trim().min(1, "Provider and API key required"),
    apiKey: z...


id: constant:e4aef8769de98cc995b7803fc0d34859
kind: constant
name: geminiContentSchema
qualified_name: geminiContentSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z
  .object({
    role: z.string().optional(),
    parts: z.array(geminiPartSchema).optional(),
  })...


id: constant:548aefed2aabdee6b16e08ca1284e3e5
kind: constant
name: v1betaGeminiGenerateSchema
qualified_name: v1betaGeminiGenerateSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z
  .object({
    contents: z.array(geminiContentSchema).optional(),
    systemInstruction: z
      ...


id: constant:c01af1469ce4c90f2d854b066a24fd49
kind: constant
name: cliMitmStartSchema
qualified_name: cliMitmStartSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z.object({
  apiKey: z.string().trim().min(1, "Missing apiKey"),
  sudoPassword: z.string().optional...


id: constant:31cc749fbebd5bd5312b4bc4425207e9
kind: constant
name: cliMitmAliasUpdateSchema
qualified_name: cliMitmAliasUpdateSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z.object({
  tool: z.string().trim().min(1, "tool and mappings required"),
  mappings: z.record(z.st...


id: constant:ef1a1a2990f08a67a328e28c5911781f
kind: constant
name: cliBackupMutationSchema
qualified_name: cliBackupMutationSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z
  .object({
    tool: z.string().trim().min(1).optional(),
    toolId: z.string().trim().min(1).op...


id: constant:c984a303f1060e981ed616dada5d402a
kind: constant
name: envKeySchema
qualified_name: envKeySchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z
  .string()
  .trim()
  .min(1, "Environment key is required")
  .max(120)
  .regex(/^[A-Z_][A-Z0-...


id: constant:5f7fb2e364bd11485af5d4b053ed3d14
kind: constant
name: envValueSchema
qualified_name: envValueSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z
  .union([z.string(), z.number(), z.boolean()])
  .transform((value) => String(value))
  .refine((...


id: constant:97a7878ba313b1588bb5ad64d929a1b0
kind: constant
name: cliSettingsEnvSchema
qualified_name: cliSettingsEnvSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z.object({
  env: z
    .record(envKeySchema, envValueSchema)
    .refine((value) => Object.keys(val...


id: constant:db4c47f9eefb8845a3168665ae6771fd
kind: constant
name: cliModelConfigSchema
qualified_name: cliModelConfigSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z.object({
  baseUrl: z.string().trim().min(1, "baseUrl and model are required"),
  apiKey: z.string...


id: constant:a8bd221cf0feda8acd20098efe0d2266
kind: constant
name: codexProfileIdSchema
qualified_name: codexProfileIdSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z.object({
  // profileId is interpolated into a filesystem path (`<PROFILES_DIR>/<id>.json`).
  // ...


id: constant:f0391dc65f60366da8802b5b6ec26703
kind: constant
name: guideSettingsSaveSchema
qualified_name: guideSettingsSaveSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z
  .object({
    baseUrl: z.string().trim().min(1).optional(),
    apiKey: z.string().optional(),
 ...


id: constant:daa377d7a4f69aa9de09fcae243d510f
kind: constant
name: v1SearchSchema
qualified_name: v1SearchSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z
  .object({
    // Core
    query: z
      .string()
      .trim()
      .min(1, "Query is require...


id: constant:f8888bbe87c4ab508b76089b2e9b1ea7
kind: constant
name: searchResultSchema
qualified_name: searchResultSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z.object({
  title: z.string(),
  url: z.string(),
  display_url: z.string().optional(),
  snippet: ...


id: constant:273298bea0e7bd4143f3c7ea72e6d91c
kind: constant
name: v1SearchResponseSchema
qualified_name: v1SearchResponseSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z.object({
  id: z.string(),
  provider: z.string(),
  query: z.string(),
  results: z.array(searchR...


id: constant:aeea551a82498be0760deb3da8b7eaa7
kind: constant
name: updateAutoDisableAccountsSchema
qualified_name: updateAutoDisableAccountsSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z
  .object({
    enabled: z.boolean(),
    threshold: z.number().int().min(1).max(10).optional(),
 ...


id: constant:76fc2880a3f1a898441ec3c1c227bffb
kind: constant
name: v1BatchCreateSchema
qualified_name: v1BatchCreateSchema
file_path: src/shared/validation/schemas.ts
language: typescript
signature:
= z.object({
  input_file_id: z.string().min(1),
  endpoint: z.enum(SUPPORTED_BATCH_ENDPOINTS),
  comp...


id: constant:43d5719134a90db12942fd0b1dde6052
kind: constant
name: databaseSettingsSchema
qualified_name: databaseSettingsSchema
file_path: src/shared/validation/settingsSchemas.ts
language: typescript
signature:
= z.object(
  {
    // Logs settings
    logs: z.object({
      detailedLogsEnabled: z.boolean(),
    ...


id: import:5efa030ffd3bf1c9ddfcac0da74259d8
kind: import
name: ../services/auth
qualified_name: ../services/auth
file_path: src/sse/handlers/chat.ts
language: typescript
signature:
import {
  getProviderCredentialsWithQuotaPreflight,
  markAccountUnavailable,
  extractApiKey,
  isValidApiKey,
  extractSessionAffinityKey,
} from "../services/auth";


id: import:4ebe966e7d7a96a44588b0c74a1eeba2
kind: import
name: @omniroute/open-sse/services/accountFallback.ts
qualified_name: @omniroute/open-sse/services/accountFallback.ts
file_path: src/sse/handlers/chat.ts
language: typescript
signature:
import {
  getRuntimeProviderProfile,
  shouldMarkAccountExhaustedFrom429,
  clearModelLock,
  lockModel,
  recordModelLockoutFailure,
  isDailyQuotaExhausted,
} from "@omniroute/open-sse/services/accountFallback.ts";


id: import:1a5d31c0601daa7a0dea3b8eae65a01a
kind: import
name: @omniroute/open-sse/config/constants.ts
qualified_name: @omniroute/open-sse/config/constants.ts
file_path: src/sse/handlers/chat.ts
language: typescript
signature:
import {
  HTTP_STATUS,
  ANTIGRAVITY_PRE_RESPONSE_TIMEOUT_CODE,
} from "@omniroute/open-sse/config/constants.ts";


id: import:028039664c34788825786a6cecf0aec1
kind: import
name: @omniroute/open-sse/config/providerModels.ts
qualified_name: @omniroute/open-sse/config/providerModels.ts
file_path: src/sse/handlers/chat.ts
language: typescript
signature:
import {
  getModelTargetFormat,
  PROVIDER_ID_TO_ALIAS,
} from "@omniroute/open-sse/config/providerModels.ts";


id: import:ea58189ff19bc5bf54bc0e900b78856b
kind: import
name: @/lib/localDb
qualified_name: @/lib/localDb
file_path: src/sse/handlers/chat.ts
language: typescript
signature:
import {
  deleteSessionAccountAffinity,
  getCachedSettings,
  getCombos,
  getSessionAccountAffinity,
} from "@/lib/localDb";


id: import:0d20aae1584a414903fd5a627ea88a3a
kind: import
name: @/lib/providers/requestDefaults
qualified_name: @/lib/providers/requestDefaults
file_path: src/sse/handlers/chat.ts
language: typescript
signature:
import {
  ensureOpenAIStoreSessionFallback,
  isOpenAIResponsesStoreEnabled,
} from "@/lib/providers/requestDefaults";


id: import:7af6bca1db873a3f222050f04a71f7e7
kind: import
name: ./chatHelpers
qualified_name: ./chatHelpers
file_path: src/sse/handlers/chat.ts
language: typescript
signature:
import {
  resolveModelOrError,
  checkPipelineGates,
  executeChatWithBreaker,
  handleNoCredentials,
  safeResolveProxy,
  safeLogEvents,
  withSessionHeader,
} from "./chatHelpers";


id: import:30f77eea91f266c892436c3fe4acf9c7
kind: import
name: @omniroute/open-sse/services/taskAwareRouter.ts
qualified_name: @omniroute/open-sse/services/taskAwareRouter.ts
file_path: src/sse/handlers/chat.ts
language: typescript
signature:
import {
  applyTaskAwareRouting,
  getTaskRoutingConfig,
} from "@omniroute/open-sse/services/taskAwareRouter.ts";


id: import:e8a897afa7307107e1a0f8f62691421a
kind: import
name: @omniroute/open-sse/services/sessionManager.ts
qualified_name: @omniroute/open-sse/services/sessionManager.ts
file_path: src/sse/handlers/chat.ts
language: typescript
signature:
import {
  generateSessionId as generateStableSessionId,
  touchSession,
  extractExternalSessionId,
  checkSessionLimit,
  registerKeySession,
  isSessionRegisteredForKey,
} from "@omniroute/open-sse/services/sessionManager.ts";


id: import:4dae35f198ddbe94194610f6118ca4b6
kind: import
name: @omniroute/open-sse/services/emergencyFallback.ts
qualified_name: @omniroute/open-sse/services/emergencyFallback.ts
file_path: src/sse/handlers/chat.ts
language: typescript
signature:
import {
  isFallbackDecision,
  shouldUseFallback,
} from "@omniroute/open-sse/services/emergencyFallback.ts";


id: import:9c72284286fe7e32f5699b16f36dfb8e
kind: import
name: @omniroute/open-sse/services/codexQuotaFetcher.ts
qualified_name: @omniroute/open-sse/services/codexQuotaFetcher.ts
file_path: src/sse/handlers/chat.ts
language: typescript
signature:
import {
  registerCodexConnection,
  registerCodexQuotaFetcher,
} from "@omniroute/open-sse/services/codexQuotaFetcher.ts";


id: import:fd3bf32f106961bfa3c12175a660ba88
kind: import
name: @omniroute/open-sse/services/bailianQuotaFetcher.ts
qualified_name: @omniroute/open-sse/services/bailianQuotaFetcher.ts
file_path: src/sse/handlers/chat.ts
language: typescript
signature:
import { registerBailianCodingPlanQuotaFetcher } from "@omniroute/open-sse/services/bailianQuotaFetcher.ts";


id: import:78378f1d892f008677de85192c82024d
kind: import
name: @omniroute/open-sse/services/deepseekQuotaFetcher.ts
qualified_name: @omniroute/open-sse/services/deepseekQuotaFetcher.ts
file_path: src/sse/handlers/chat.ts
language: typescript
signature:
import { registerDeepseekQuotaFetcher } from "@omniroute/open-sse/services/deepseekQuotaFetcher.ts";


id: import:518df75567b464e2fc7e4b4df99c5818
kind: import
name: ../services/cooldownAwareRetry
qualified_name: ../services/cooldownAwareRetry
file_path: src/sse/handlers/chat.ts
language: typescript
signature:
import {
  getCooldownAwareRetryDecision,
  resolveCooldownAwareRetrySettings,
  waitForCooldownAwareRetry,
} from "../services/cooldownAwareRetry";


id: function:7534ff332292c68a1d061f186d5c15d4
kind: function
name: handleSingleModelChat
qualified_name: handleSingleModelChat
file_path: src/sse/handlers/chat.ts
language: typescript
docstring:
Handle single model chat request
Refactored: model resolution, logging, pipeline gates, and chat execution
extracted to focused helpers. This function orchestrates the credential
retry loop.

signature:
(
  body: any,
  modelStr: string,
  clientRawRequest: any = null,
  request: any = null,
  comboName: string | null = null,
  apiKeyInfo: any = null,
  telemetry: any = null,
  runtimeOptions: {
    emergencyFallbackTried?: boolean;
    forceLiveComboTest?: boolean;
    sessionId?: string | null;
    sessionAffinityKey?: string | null;
    forcedConnectionId?: string | null;
    allowedConnectionIds?: string[] | null;
    comboStepId?: string | null;
    comboExecutionKey?: string | null;
    skipUpstreamRetry?: boolean;
    preselectedCredentials?: any;
    cachedSettings?: any;
  } = {},
  comboStrategy: string | null = null,
  isCombo: boolean = false
)


id: import:a6a5283d2b54906eb92a48db69269a27
kind: import
name: @omniroute/open-sse/services/provider.ts
qualified_name: @omniroute/open-sse/services/provider.ts
file_path: src/sse/handlers/chatHelpers.ts
language: typescript
signature:
import {
  detectFormatFromEndpoint,
  getTargetFormat,
} from "@omniroute/open-sse/services/provider.ts";


id: import:2c7ea24b68302ca06a35ed56cb1ca1a8
kind: import
name: @omniroute/open-sse/utils/error.ts
qualified_name: @omniroute/open-sse/utils/error.ts
file_path: src/sse/handlers/chatHelpers.ts
language: typescript
signature:
import {
  errorResponse,
  modelCooldownResponse,
  providerCircuitOpenResponse,
  unavailableResponse,
} from "@omniroute/open-sse/utils/error.ts";


id: import:d04935dd85cf4a5f5568be619d635a35
kind: import
name: @omniroute/open-sse/utils/proxyFetch.ts
qualified_name: @omniroute/open-sse/utils/proxyFetch.ts
file_path: src/sse/handlers/chatHelpers.ts
language: typescript
signature:
import {
  runWithProxyContext,
  runWithTlsTracking,
  isTlsFingerprintActive,
} from "@omniroute/open-sse/utils/proxyFetch.ts";


id: constant:0b0f17250f0e4665c49bbe3da2010c17
kind: constant
name: NON_OAUTH_MODEL_PREFIX
qualified_name: NON_OAUTH_MODEL_PREFIX
file_path: src/sse/handlers/chatHelpers.ts
language: typescript
signature: = /^(deepseek|qwen|kimi|glm|minimax|mimo)/i
docstring:
Models that explicitly cannot run on the codex/ChatGPT-Pro OAuth pool — when
a caller writes `codex/deepseek-v4-pro` we transparently reroute to the
canonical provider whose API key is configured. Saves callers from having
to know about the OAuth-vs-API-key split.


id: constant:91ee18f79541fe775302e86cb5dd2058
kind: constant
name: PREFERRED_BY_FAMILY
qualified_name: PREFERRED_BY_FAMILY
file_path: src/sse/handlers/chatHelpers.ts
language: typescript
signature:
= {
  deepseek: "deepseek",
  qwen: "bailian",
  kimi: "moonshot",
  glm: "zhipu",
  minimax: "minimax...


id: function:461fcd807aaeb0137288eec0a7a9072c
kind: function
name: resolveModelOrError
qualified_name: resolveModelOrError
file_path: src/sse/handlers/chatHelpers.ts
language: typescript
signature:
(
  modelStr: string,
  body: any,
  endpointPath: string = "",
  requestHeaders: Record<string, unknown> | null | undefined = null
)


id: function:1db191a665fbdda09e40d992922339b4
kind: function
name: checkPipelineGates
qualified_name: checkPipelineGates
file_path: src/sse/handlers/chatHelpers.ts
language: typescript
signature:
(
  provider: string,
  model: string,
  options: {
    ignoreCircuitBreaker?: boolean;
    ignoreModelCooldown?: boolean;
    bypassReason?: string;
    providerProfile?: {
      circuitBreakerThreshold?: number;
      circuitBreakerReset?: number;
      failureThreshold?: number;
      resetTimeoutMs?: number;
    } | null;
  } = {}
)


id: function:3a92cbd93a5f85ed89fb37f38846ae4c
kind: function
name: executeChatWithBreaker
qualified_name: executeChatWithBreaker
file_path: src/sse/handlers/chatHelpers.ts
language: typescript
signature:
({
  bypassCircuitBreaker,
  breaker,
  body,
  provider,
  model,
  refreshedCredentials,
  proxyInfo,
  log: handlerLog,
  clientRawRequest,
  credentials,
  apiKeyInfo,
  userAgent,
  comboName,
  comboStrategy,
  isCombo,
  comboStepId,
  comboExecutionKey,
  extendedContext,
  modelApiFormat,
  providerProfile,
  cachedSettings,
  skipUpstreamRetry = false,
}: any): Promise<{ result: any; tlsFingerprintUsed: boolean }>


id: function:56d60d4a92618b4b5670e786beb2146c
kind: function
name: handleNoCredentials
qualified_name: handleNoCredentials
file_path: src/sse/handlers/chatHelpers.ts
language: typescript
signature:
(
  credentials: any,
  excludeConnectionId: string | null,
  provider: string,
  model: string,
  lastError: string | null,
  lastStatus: number | null
)


id: function:c01fc12402eafdf9e12c574b09244190
kind: function
name: safeLogEvents
qualified_name: safeLogEvents
file_path: src/sse/handlers/chatHelpers.ts
language: typescript
signature:
({
  result,
  proxyInfo,
  proxyLatency,
  provider,
  model,
  sourceFormat,
  targetFormat,
  credentials,
  comboName,
  clientRawRequest,
  tlsFingerprintUsed = false,
})


id: import:07e3bc6922d2d73a3d2aa5c36260c169
kind: import
name: @/lib/localDb
qualified_name: @/lib/localDb
file_path: src/sse/services/auth.ts
language: typescript
signature:
import {
  getProviderConnections,
  validateApiKey,
  updateProviderConnection,
  getSettings,
  getCachedSettings,
  getSessionAccountAffinity,
  upsertSessionAccountAffinity,
  touchSessionAccountAffinity,
  deleteSessionAccountAffinity,
} from "@/lib/localDb";


id: import:18b16460b6c3edd2847f0e90c3e22d93
kind: import
name: @/domain/quotaCache
qualified_name: @/domain/quotaCache
file_path: src/sse/services/auth.ts
language: typescript
signature:
import {
  DEFAULT_QUOTA_THRESHOLD_PERCENT,
  getQuotaCache,
  getQuotaWindowStatus,
  isAccountQuotaExhausted,
} from "@/domain/quotaCache";


id: import:4f2e8048043e30377a1a36f29d4d9e0c
kind: import
name: @omniroute/open-sse/services/accountFallback.ts
qualified_name: @omniroute/open-sse/services/accountFallback.ts
file_path: src/sse/services/auth.ts
language: typescript
signature:
import {
  isAccountUnavailable,
  getUnavailableUntil,
  getEarliestRateLimitedUntil,
  formatRetryAfter,
  checkFallbackError,
  isModelLocked,
  getModelLockoutInfo,
  lockModel,
  hasPerModelQuota,
  getRuntimeProviderProfile,
  recordModelLockoutFailure,
} from "@omniroute/open-sse/services/accountFallback.ts";


id: import:939751b0f2ea5977a7252e679fc172e2
kind: import
name: @omniroute/open-sse/services/quotaPreflight.ts
qualified_name: @omniroute/open-sse/services/quotaPreflight.ts
file_path: src/sse/services/auth.ts
language: typescript
signature:
import {
  preflightQuota,
  isQuotaPreflightEnabled,
} from "@omniroute/open-sse/services/quotaPreflight.ts";


id: import:94d0426c06c0a9b72c8a2b729e25cb69
kind: import
name: @omniroute/open-sse/services/errorClassifier.ts
qualified_name: @omniroute/open-sse/services/errorClassifier.ts
file_path: src/sse/services/auth.ts
language: typescript
signature:
import {
  classifyProviderError,
  PROVIDER_ERROR_TYPES,
} from "@omniroute/open-sse/services/errorClassifier.ts";


id: function:337a952c2deaa473d0669ad2ff4b05c3
kind: function
name: readHeaderValue
qualified_name: readHeaderValue
file_path: src/sse/services/auth.ts
language: typescript
signature:
(
  headers: Headers | { get?: (name: string) => string | null } | null | undefined,
  name: string
): string | null


id: function:4e759b3b7038a1fc5e2eb9252d8e9695
kind: function
name: extractSessionAffinityKey
qualified_name: extractSessionAffinityKey
file_path: src/sse/services/auth.ts
language: typescript
signature:
(
  body: unknown,
  headers?: Headers | { get?: (name: string) => string | null } | null
): string | null


id: function:e104dee05001e667f9601a6590f00eaa
kind: function
name: resolveTerminalConnectionStatus
qualified_name: resolveTerminalConnectionStatus
file_path: src/sse/services/auth.ts
language: typescript
signature:
(
  status: number,
  result: { permanent?: boolean; creditsExhausted?: boolean },
  providerErrorType: string | null = null
): string | null


id: function:be9ea87ebe5f4b2f4a46d647c049a731
kind: function
name: evaluateQuotaLimitPolicy
qualified_name: evaluateQuotaLimitPolicy
file_path: src/sse/services/auth.ts
language: typescript
signature:
(
  provider: string,
  connection: ProviderConnectionView
): { blocked: boolean; reasons: string[]; resetAt: string | null }


id: function:ae75e766bdfe54efa4b9afac4fe368aa
kind: function
name: getP2CConnectionScore
qualified_name: getP2CConnectionScore
file_path: src/sse/services/auth.ts
language: typescript
signature:
(
  provider: string,
  connection: ProviderConnectionView
): { score: number; quotaHeadroomPercent: number | null }


id: function:2cae8ef893e600d9f07d11c7d70d8196
kind: function
name: selectSessionAffinityConnection
qualified_name: selectSessionAffinityConnection
file_path: src/sse/services/auth.ts
language: typescript
signature:
(
  provider: string,
  sessionKey: string | null | undefined,
  connections: ProviderConnectionView[]
): Promise<ProviderConnectionView | null>


id: function:0615f1a14c3a7f952ff21557feb634ff
kind: function
name: normalizeExcludedConnectionIds
qualified_name: normalizeExcludedConnectionIds
file_path: src/sse/services/auth.ts
language: typescript
signature:
(
  excludeConnectionId: string | null,
  extraExcludedConnectionIds: string[] | null | undefined
): Set<string>


id: function:ac2004b52a83cd78c54d960a493cd242
kind: function
name: buildQuotaPreflightRateLimitedResult
qualified_name: buildQuotaPreflightRateLimitedResult
file_path: src/sse/services/auth.ts
language: typescript
signature:
(
  provider: string,
  blockedByPreflight: Array<{
    id: string;
    quotaPercent?: number;
    resetAt?: string | null;
  }>
)


id: constant:395d972975699ea32679b220a594b94b
kind: constant
name: markMutexes
qualified_name: markMutexes
file_path: src/sse/services/auth.ts
language: typescript
signature: = new Map<string, Promise<void>>()
docstring:
─── Anti-Thundering Herd: per-connection mutex for markAccountUnavailable ───
Prevents multiple concurrent requests from marking the same connection
unavailable in parallel, which was the root cause of cascading 502 lockouts.


id: function:90a573ce9566b28c0e1fe8a98735ed78
kind: function
name: getProviderCredentials
qualified_name: getProviderCredentials
file_path: src/sse/services/auth.ts
language: typescript
signature:
(
  provider: string,
  excludeConnectionId: string | null = null,
  allowedConnections: string[] | null = null,
  requestedModel: string | null = null,
  options: CredentialSelectionOptions = {}
)


id: function:464bfb5d78dfc7a8ebbb1ce0709cfced
kind: function
name: markAccountUnavailable
qualified_name: markAccountUnavailable
file_path: src/sse/services/auth.ts
language: typescript
signature:
(
  connectionId: string,
  status: number,
  errorText: string,
  provider: string | null = null,
  model: string | null = null,
  providerProfile = null
)


id: function:9d36ad7b7142a415e3ce572529f95eba
kind: function
name: computeClosestRetryAfter
qualified_name: computeClosestRetryAfter
file_path: src/sse/services/cooldownAwareRetry.ts
language: typescript
signature:
(retryAfter: unknown): {
  retryAfter: string | null;
  retryAfterHuman: string;
  waitMs: number | null;
}


id: function:b80a9359eef08f96d6c97ee8b94bb72b
kind: function
name: getCooldownAwareRetryDecision
qualified_name: getCooldownAwareRetryDecision
file_path: src/sse/services/cooldownAwareRetry.ts
language: typescript
signature:
({
  retryAfter,
  settings,
  attempt,
}: {
  retryAfter: unknown;
  settings: CooldownAwareRetrySettings;
  attempt: number;
}): {
  shouldRetry: boolean;
  retryAfter: string | null;
  retryAfterHuman: string;
  waitMs: number;
}


id: import:7dfb1cfd61352e8f53bff899c7f3f3c1
kind: import
name: @omniroute/open-sse/services/model.ts
qualified_name: @omniroute/open-sse/services/model.ts
file_path: src/sse/services/model.ts
language: typescript
signature:
import {
  parseModel,
  resolveModelAliasFromMap,
  getModelInfoCore,
} from "@omniroute/open-sse/services/model.ts";


id: function:3de168ff404a523409a0bde6d2cd190d
kind: function
name: lookupCustomModelApiFormat
qualified_name: lookupCustomModelApiFormat
file_path: src/sse/services/model.ts
language: typescript
signature: ( providerId: string, modelId: string ): Promise<string | undefined>
docstring:
Look up the apiFormat for a custom model from the DB.
Returns "responses" if the model is configured for the Responses API, otherwise undefined.


id: constant:6e9b48074ae25604cf636b3469d9436e
kind: constant
name: STREAM_STATES
qualified_name: STREAM_STATES
file_path: src/sse/services/streamState.ts
language: typescript
signature:
= {
  INITIALIZED: "initialized",
  CONNECTING: "connecting",
  STREAMING: "streaming",
  COMPLETED: "...


id: constant:35c44b497815a5899fc9c94f65642f8c
kind: constant
name: VALID_TRANSITIONS
qualified_name: VALID_TRANSITIONS
file_path: src/sse/services/streamState.ts
language: typescript
docstring: Valid state transitions
signature:
= {
  [STREAM_STATES.INITIALIZED]: [STREAM_STATES.CONNECTING, STREAM_STATES.CANCELLED],
  [STREAM_STAT...


id: method:6366fd818adc3706c565161d4089dc3b
kind: method
name: transition
qualified_name: StreamTracker::transition
file_path: src/sse/services/streamState.ts
language: typescript
signature: (newState, transitionMeta = {})
docstring:
Transition to a new state.
@param {string} newState - Target state
@param {Object} [transitionMeta] - Metadata for this transition
@returns {boolean} Whether the transition was valid


id: import:6ab407fd9dcb66309bcec009cbe75408
kind: import
name: @omniroute/open-sse/services/tokenRefresh.ts
qualified_name: @omniroute/open-sse/services/tokenRefresh.ts
file_path: src/sse/services/tokenRefresh.ts
language: typescript
signature:
import {
  TOKEN_EXPIRY_BUFFER_MS as BUFFER_MS,
  refreshAccessToken as _refreshAccessToken,
  refreshClaudeOAuthToken as _refreshClaudeOAuthToken,
  refreshGoogleToken as _refreshGoogleToken,
  refreshQwenToken as _refreshQwenToken,
  refreshCodexToken as _refreshCodexToken,
  refreshQoderToken as _refreshQoderToken,
  refreshGitHubToken as _refreshGitHubToken,
  refreshCopilotToken as _refreshCopilotToken,
  getAccessToken as _getAccessToken,
  refreshTokenByProvider as _refreshTokenByProvider,
  formatProviderCredentials as _formatProviderCredentials,
  getAllAccessTokens as _getAllAccessTokens,
} from "@omniroute/open-sse/services/tokenRefresh.ts";


id: constant:496639fba7d3a30cc4c378f19e487eda
kind: constant
name: connectionRefreshMutex
qualified_name: connectionRefreshMutex
file_path: src/sse/services/tokenRefresh.ts
language: typescript
signature: = new Map<string, { promise: Promise<any>; waiters: number }>()
docstring:
Per-connection mutex: prevents concurrent OAuth refresh for rotating tokens.
Key = connectionId, Value = { promise: in-flight refresh, waiters: count of callers sharing it }


id: function:08a26fc08122f995efb78c52bc28c224
kind: function
name: refreshGoogleToken
qualified_name: refreshGoogleToken
file_path: src/sse/services/tokenRefresh.ts
language: typescript
signature:
(
  refreshToken: string,
  clientId: string,
  clientSecret: string,
  provider: string = "gemini"
)


id: constant:68dbcf06e32b44cd7408ae37b94c7ff7
kind: constant
name: useEmailPrivacyStore
qualified_name: useEmailPrivacyStore
file_path: src/store/emailPrivacyStore.ts
language: typescript
signature:
= create<EmailPrivacyState>()(
  persist(
    (set, get) => ({
      emailsVisible: false,
      toggl...


id: constant:3dba6be6eac21414051b587717cc7cb9
kind: constant
name: useNotificationStore
qualified_name: useNotificationStore
file_path: src/store/notificationStore.ts
language: typescript
signature:
= create<NotificationStore>((set, get) => ({
  notifications: [],

  addNotification: (notification) =...


id: constant:568f53452db5a155dc4091e02f1b9503
kind: constant
name: useProviderStore
qualified_name: useProviderStore
file_path: src/store/providerStore.ts
language: typescript
signature:
= create((set, get) => ({
  providers: [],
  loading: false,
  error: null,

  setProviders: (provider...


id: constant:a5e5edc683c46da48d03ba301fb94121
kind: constant
name: useThemeStore
qualified_name: useThemeStore
file_path: src/store/themeStore.ts
language: typescript
signature:
= create<ThemeState>()(
  persist(
    (set, get) => ({
      theme: THEME_CONFIG.defaultTheme,
      ...


id: constant:42adcff71a17f7ac2f33d96aa8cd8283
kind: constant
name: COLOR_THEMES
qualified_name: COLOR_THEMES
file_path: src/store/themeStore.ts
language: typescript
signature:
= {
  coral: "#e54d5e",
  blue: "#3b82f6",
  red: "#ef4444",
  green: "#22c55e",
  violet: "#8b5cf6",
...


id: constant:985bc61b4e52fa71a5610cea7b1216aa
kind: constant
name: useUserStore
qualified_name: useUserStore
file_path: src/store/userStore.ts
language: typescript
signature:
= create((set) => ({
  user: null,
  loading: false,
  error: null,

  setUser: (user) => set({ user }...


id: constant:4988f9011d9da6782eac53bb33c7d20f
kind: constant
name: DEFAULT_DATABASE_SETTINGS
qualified_name: DEFAULT_DATABASE_SETTINGS
file_path: src/types/databaseSettings.ts
language: typescript
signature:
= {
  logs: {
    detailedLogsEnabled: false,
    callLogPipelineEnabled: false,
    maxDetailSizeKb: ...


id: import:21e7543a2f7869195298a2f87216569b
kind: import
name: @/shared/constants/sidebarVisibility
qualified_name: @/shared/constants/sidebarVisibility
file_path: src/types/settings.ts
language: typescript
signature:
import type {
  HideableSidebarItemId,
  SidebarItemOrder,
  SidebarPresetId,
  SidebarSectionId,
} from "@/shared/constants/sidebarVisibility";


id: import:6122500b5e506fc4d7f2cd88a8bfad6e
kind: import
name: @/shared/constants/routingStrategies
qualified_name: @/shared/constants/routingStrategies
file_path: src/types/settings.ts
language: typescript
signature:
import type {
  AccountFallbackStrategyValue,
  RoutingStrategyValue,
} from "@/shared/constants/routingStrategies";


id: import:a7952cda2c282ed5954bd6f69b3c07d2
kind: import
name: ../../src/domain/pipeline.ts
qualified_name: ../../src/domain/pipeline.ts
file_path: tests/benchmarks/pipeline-accuracy.test.ts
language: typescript
signature:
import {
  buildPipelineConfig,
  executePipeline,
  type StageExecutor,
  type StageExecutorResult,
  type FitnessTier,
} from "../../src/domain/pipeline.ts";


id: constant:2639635c91e42a5d92e5423ce3cef729
kind: constant
name: MATH_PROBLEMS
qualified_name: MATH_PROBLEMS
file_path: tests/benchmarks/pipeline-accuracy.test.ts
language: typescript
docstring:
---------------------------------------------------------------------------
Test cases
---------------------------------------------------------------------------

signature:
= [
  { q: "What is 17 * 23?", expected: "391" },
  { q: "Solve for x: 2x + 5 = 13", expected: "4" },
...


id: constant:cf3003d8a02969c03b19e0217e27b3ce
kind: constant
name: CODING_PROBLEMS
qualified_name: CODING_PROBLEMS
file_path: tests/benchmarks/pipeline-accuracy.test.ts
language: typescript
signature:
= [
  {
    q: "Write a JavaScript function that returns the factorial of n.",
    check: (r: string) ...


id: interface:525576d6dd3b9b4fdcdcd929267e67a0
kind: interface
name: CallResult
qualified_name: CallResult
file_path: tests/benchmarks/pipeline-accuracy.test.ts
language: typescript
docstring:
---------------------------------------------------------------------------
API call helper
---------------------------------------------------------------------------


id: function:86d2e3b28f83b7316cc84fa52c5b5cbb
kind: function
name: makeDeepSeekExecutor
qualified_name: makeDeepSeekExecutor
file_path: tests/benchmarks/pipeline-accuracy.test.ts
language: typescript
signature: (): StageExecutor
docstring:
---------------------------------------------------------------------------
Stage executor — calls DeepSeek directly
---------------------------------------------------------------------------


id: interface:dff092d7cb373522c94a28b33d705a9a
kind: interface
name: BenchResult
qualified_name: BenchResult
file_path: tests/benchmarks/pipeline-accuracy.test.ts
language: typescript
docstring:
---------------------------------------------------------------------------
Benchmark runner
---------------------------------------------------------------------------


id: function:493e76e2fce606629f60445c2ee1d99c
kind: function
name: main
qualified_name: main
file_path: tests/benchmarks/pipeline-accuracy.test.ts
language: typescript
signature: ()
docstring:
---------------------------------------------------------------------------
Main
---------------------------------------------------------------------------


id: constant:2d334387c2cdeea14efecd056c40d124
kind: constant
name: a11yRoutes
qualified_name: a11yRoutes
file_path: tests/e2e/a11y-resilience.spec.ts
language: typescript
signature:
= [
  "/400",
  "/401",
  "/403",
  "/408",
  "/429",
  "/500",
  "/502",
  "/503",
  "/offline",
  "/...


id: function:ba2fad48c5ed0bedacf16f92e43a6374
kind: function
name: dispatchHtml5DragAndDrop
qualified_name: dispatchHtml5DragAndDrop
file_path: tests/e2e/combos-flow.spec.ts
language: typescript
signature:
(
  page: import("@playwright/test").Page,
  source: import("@playwright/test").Locator,
  target: import("@playwright/test").Locator
)


id: constant:573143b854b8d213f983486f9dc257c2
kind: constant
name: errorPages
qualified_name: errorPages
file_path: tests/e2e/error-pages.spec.ts
language: typescript
signature:
= [
  {
    path: "/400",
    heading: "Bad Request",
    primaryHref: "/docs",
    secondaryHref: "/d...


id: method:74dfd582153fb97275abb757c77b90bf
kind: method
name: configureToken
qualified_name: MockUpstreamServer::configureToken
file_path: tests/e2e/helpers/mockUpstreamServer.ts
language: typescript
signature:
(
    token: string,
    config: { defaultResponse: PlannedResponse; queue?: PlannedResponse[] }
  ): void


id: function:500d3f53384d1ef995ded748f23d32cf
kind: function
name: consumeA2AStream
qualified_name: consumeA2AStream
file_path: tests/e2e/protocol-clients.test.ts
language: typescript
signature:
(response: Response): Promise<{
  taskId: string | null;
  terminalState: string | null;
  chunks: number;
}>


id: constant:493a3239cc1efda57c8ecf558743a399
kind: constant
name: resilienceSettings
qualified_name: resilienceSettings
file_path: tests/e2e/resilience-plan-alignment.spec.ts
language: typescript
signature:
= {
  requestQueue: {
    autoEnableApiKeyProviders: true,
    requestsPerMinute: 100,
    minTimeBetw...


id: constant:e1b52be508474e35076e714f1817be4b
kind: constant
name: VIEWPORTS
qualified_name: VIEWPORTS
file_path: tests/e2e/responsiveSpecs.ts
language: typescript
signature:
= {
  mobile: { width: 375, height: 812, label: "Mobile (375px)" },
  tablet: { width: 768, height: 10...


id: constant:3c1f941ca29552ff1d23d379efa09f0d
kind: constant
name: PAGES
qualified_name: PAGES
file_path: tests/e2e/responsiveSpecs.ts
language: typescript
signature:
= [
  { path: "/login", name: "Login", requiresAuth: false },
  { path: "/dashboard", name: "Dashboard...


id: constant:ccbfbf522e49641d1f08c1a851a14cf3
kind: constant
name: A11Y_CHECKS
qualified_name: A11Y_CHECKS
file_path: tests/e2e/responsiveSpecs.ts
language: typescript
signature:
= [
  {
    id: "overflow-x",
    check: "document.body.scrollWidth <= document.body.clientWidth",
   ...


id: function:cbfa0620dd8f5a2ea9eac7029b6deb93
kind: function
name: waitForServer
qualified_name: waitForServer
file_path: tests/e2e/system-failover.test.ts
language: typescript
signature:
(
  baseUrl: string,
  logs: {
    stdoutLines: string[];
    stderrLines: string[];
    exitInfo?: { code: number | null; signal: NodeJS.Signals | null } | null;
  }
)


id: constant:689b12c239bdd1454289a099a7f297d5
kind: constant
name: verbosePrompts
qualified_name: verbosePrompts
file_path: tests/golden-set/compression-caveman-v2.test.ts
language: typescript
signature:
= [
  "Sure, I will make sure to provide a detailed explanation of the database connection issue becau...


id: import:e3b4629daed293f0ef0ded6b5a323e2a
kind: import
name: ../../open-sse/mcp-server/descriptionCompressor.ts
qualified_name: ../../open-sse/mcp-server/descriptionCompressor.ts
file_path: tests/golden-set/compression-upstream-parity.test.ts
language: typescript
signature:
import {
  compressDescriptionsInPlace,
  getMcpDescriptionCompressionStats,
  resetMcpDescriptionCompressionStats,
} from "../../open-sse/mcp-server/descriptionCompressor.ts";


id: constant:556c851011ead818a4b37c1c0f543777
kind: constant
name: upstream
qualified_name: upstream
file_path: tests/golden-set/compression-upstream-parity.test.ts
language: typescript
signature:
= require(
  path.resolve("_references/_outros/caveman/mcp-servers/caveman-shrink/compress.js")
) as {...


id: constant:8f78a2b062c600a217ecbf2a9aaefd23
kind: constant
name: parityCases
qualified_name: parityCases
file_path: tests/golden-set/compression-upstream-parity.test.ts
language: typescript
signature:
= [
  "The user is the owner of an account and should make sure to configure the database.",
  "Sure, ...


id: function:b06457716012a49d7629e9d85b0b4ee1
kind: function
name: makeManagementSessionRequest
qualified_name: makeManagementSessionRequest
file_path: tests/helpers/managementSession.ts
language: typescript
signature:
(
  url: string,
  options: {
    method?: string;
    token?: string;
    headers?: HeadersInit;
    body?: BodyInit | Record<string, unknown> | unknown[] | number | boolean | null;
  } = {}
): Promise<Request>


id: function:95249956d650a7706f910f4c33d67d60
kind: function
name: makeRequest
qualified_name: makeRequest
file_path: tests/integration/api-keys.test.ts
language: typescript
signature:
(
  url: string | URL,
  { method = "GET", token, body }: { method?: string; token?: string; body?: unknown } = {}
)


id: function:041e11f8da5a5634e38796970e398416
kind: function
name: buildRequest
qualified_name: buildRequest
file_path: tests/integration/chat-pipeline.test.ts
language: typescript
signature:
({
  url = "http://localhost/v1/chat/completions",
  body,
  authKey = null,
  headers = {},
}: {
  url?: string;
  body?: unknown;
  authKey?: string | null;
  headers?: Record<string, string>;
} = {})


id: function:a638c077b579ad9b58050c4975d09242
kind: function
name: buildOpenAIToolCallResponse
qualified_name: buildOpenAIToolCallResponse
file_path: tests/integration/chat-pipeline.test.ts
language: typescript
signature:
({
  model = "gpt-4o-mini",
  toolName = "lookupWeather@1.0.0",
  toolCallId = "call_weather",
  argumentsObject = { location: "Sao Paulo" },
} = {})


id: function:48599d443335554724a1377b83373b71
kind: function
name: seedApiKey
qualified_name: seedApiKey
file_path: tests/integration/chat-pipeline.test.ts
language: typescript
signature:
({
  name = "chat-pipeline-key",
  noLog = false,
  allowedConnections,
  allowedModels,
}: SeedApiKeyOptions = {})


id: import:a08e7352d6b3a236f93a87476a164836
kind: import
name: ../../open-sse/services/compression/strategySelector.ts
qualified_name: ../../open-sse/services/compression/strategySelector.ts
file_path: tests/integration/compression-pipeline.test.ts
language: typescript
signature:
import {
  selectCompressionStrategy,
  getEffectiveMode,
  applyCompression,
} from "../../open-sse/services/compression/strategySelector.ts";


id: import:80e4c5f5031b0d62f07c26c6e97e4421
kind: import
name: ../../open-sse/services/compression/lite.ts
qualified_name: ../../open-sse/services/compression/lite.ts
file_path: tests/integration/compression-pipeline.test.ts
language: typescript
signature:
import {
  applyLiteCompression,
  replaceImageUrls,
} from "../../open-sse/services/compression/lite.ts";


id: import:4d5903fa82b394f4de44bfce09f48f52
kind: import
name: ../../open-sse/services/compression/stats.ts
qualified_name: ../../open-sse/services/compression/stats.ts
file_path: tests/integration/compression-pipeline.test.ts
language: typescript
signature:
import {
  createCompressionStats,
  estimateCompressionTokens,
} from "../../open-sse/services/compression/stats.ts";


id: constant:0637cf8651c6259fed42ecca646cac84
kind: constant
name: baseConfig
qualified_name: baseConfig
file_path: tests/integration/compression-pipeline.test.ts
language: typescript
signature:
= {
  enabled: true,
  defaultMode: "lite",
  autoTriggerTokens: 0,
  cacheMinutes: 5,
  preserveSyste...


id: constant:35cc093a67efbe394d3a0e9c4496d22e
kind: constant
name: _db
qualified_name: _db
file_path: tests/integration/performance-regression.test.ts
language: typescript
signature: = core.getDbInstance()
docstring:
--- Work around FTS5 trigger bug ---
Migration 022_add_memory_fts5.sql creates FTS5 with content_rowid='id' expecting
INTEGER rowids, but memories.id is TEXT (UUID). The triggers fail with
SQLITE_MISMATCH on INSERT. Drop them so createMemory() works.
Also drop the memory_fts table since FTS5 can't work with TEXT rowids.
retrieveMemories() has a fallback that uses keyword scoring when FTS5 is unavailable.


id: constant:7d3c6ef6de744159af01b14a194550eb
kind: constant
name: mockLog
qualified_name: mockLog
file_path: tests/integration/pipeline-combo.test.ts
language: typescript
signature: = { info: () => {}, warn: () => {}, error: () => {}, }
docstring:
---------------------------------------------------------------------------
Helpers
---------------------------------------------------------------------------


id: constant:e3f594b764e1bbba87b1351956536a20
kind: constant
name: TOKENS
qualified_name: TOKENS
file_path: tests/integration/resilience-http-e2e.test.ts
language: typescript
signature:
= {
  p1: "sk-e2e-p1",
  p2: "sk-e2e-p2",
  p3: "sk-e2e-p3",
  p4: "sk-e2e-p4",
  p5: "sk-e2e-p5",
  p...


id: import:8d551d2b6ee826114f171ed70430151e
kind: import
name: ../../open-sse/services/webSearchFallback.ts
qualified_name: ../../open-sse/services/webSearchFallback.ts
file_path: tests/integration/skills-pipeline.test.ts
language: typescript
signature:
import { OMNIROUTE_WEB_SEARCH_FALLBACK_TOOL_NAME } from "../../open-sse/services/webSearchFallback.ts";


id: function:3ccba89afa96a9d226a7254ab7828d11
kind: function
name: registerSkill
qualified_name: registerSkill
file_path: tests/integration/skills-pipeline.test.ts
language: typescript
signature:
({
  apiKeyId,
  name,
  version = "1.0.0",
  handler,
  enabled = true,
  description = "Test skill",
  mode,
  tags,
  installCount,
})


id: constant:24d7bf2605e20cab0fac8b93a9e32282
kind: constant
name: options
qualified_name: options
file_path: tests/load/proxy-load.ts
language: typescript
signature:
= {
  scenarios: {
    // Ramp-up scenario for stress testing
    chat_stress: {
      executor: "ramp...


id: import:11c3869b64122ebd45b3c196bb401900
kind: import
name: ../../open-sse/services/accountSemaphore
qualified_name: ../../open-sse/services/accountSemaphore
file_path: tests/unit/accountSemaphore.test.ts
language: typescript
signature:
import {
  acquire,
  buildAccountSemaphoreKey,
  getStats,
  markBlocked,
  reset,
  resetAll,
} from "../../open-sse/services/accountSemaphore";


id: import:59049e66804151d396ffb118878b6a1e
kind: import
name: ../../src/sse/services/streamState.ts
qualified_name: ../../src/sse/services/streamState.ts
file_path: tests/unit/advanced-fase07-09.test.ts
language: typescript
signature:
import {
  StreamTracker,
  STREAM_STATES,
  createStreamTracker,
  getActiveStreams,
  archiveStream,
} from "../../src/sse/services/streamState.ts";


id: import:dba3f83769e4c103ee2030eab90b06a6
kind: import
name: ../../src/shared/constants/antigravityClientProfile.ts
qualified_name: ../../src/shared/constants/antigravityClientProfile.ts
file_path: tests/unit/antigravity-client-profile.test.ts
language: typescript
signature:
import { normalizeAntigravityClientProfile } from "../../src/shared/constants/antigravityClientProfile.ts";


id: import:fea9d1f7ed2890a4c50be40ce3e8a924
kind: import
name: ../../open-sse/services/antigravityClientProfile.ts
qualified_name: ../../open-sse/services/antigravityClientProfile.ts
file_path: tests/unit/antigravity-client-profile.test.ts
language: typescript
signature:
import {
  applyAntigravityClientProfileHeaders,
  getAntigravityBootstrapHeaders,
  antigravityHarnessUserAgent,
  getAntigravityClientProfile,
} from "../../open-sse/services/antigravityClientProfile.ts";


id: import:8d6d31121983b1a0ad1f33877b3a5ba5
kind: import
name: ../../open-sse/services/antigravityVersion.ts
qualified_name: ../../open-sse/services/antigravityVersion.ts
file_path: tests/unit/antigravity-client-profile.test.ts
language: typescript
signature:
import {
  seedAntigravityVersionCache,
  clearAntigravityVersionCache,
} from "../../open-sse/services/antigravityVersion.ts";


id: import:6ecd4d95836719dea52768bf67e1446e
kind: import
name: ../../open-sse/executors/antigravity.ts
qualified_name: ../../open-sse/executors/antigravity.ts
file_path: tests/unit/antigravity-credits.test.ts
language: typescript
signature:
import {
  getAntigravityRemainingCredits,
  updateAntigravityRemainingCredits,
} from "../../open-sse/executors/antigravity.ts";


id: import:64b050943f37e81cddcf07ff36e11dbd
kind: import
name: ../../open-sse/services/antigravityProjectBootstrap.ts
qualified_name: ../../open-sse/services/antigravityProjectBootstrap.ts
file_path: tests/unit/antigravity-discovery-bootstrap.test.ts
language: typescript
signature:
import {
  ensureAntigravityProjectAssigned,
  clearAntigravityProjectCache,
  getAntigravityProjectFromCache,
  getAntigravityLoadCodeAssistUrls,
} from "../../open-sse/services/antigravityProjectBootstrap.ts";


id: import:5d3fb16e5edfcaab6d3bedfcd971b0c0
kind: import
name: ../../open-sse/services/antigravityHeaders.ts
qualified_name: ../../open-sse/services/antigravityHeaders.ts
file_path: tests/unit/antigravity-headers.test.ts
language: typescript
signature:
import { getAntigravityLoadCodeAssistMetadata } from "../../open-sse/services/antigravityHeaders.ts";


id: import:4f9d62c7eadade10350f72f18524dee8
kind: import
name: ../../open-sse/config/antigravityModelAliases.ts
qualified_name: ../../open-sse/config/antigravityModelAliases.ts
file_path: tests/unit/antigravity-model-aliases.test.ts
language: typescript
signature:
import {
  ANTIGRAVITY_PUBLIC_MODELS,
  getClientVisibleAntigravityModelName,
  isUserCallableAntigravityModelId,
  resolveAntigravityModelId,
  toClientAntigravityModelId,
} from "../../open-sse/config/antigravityModelAliases.ts";


id: import:61ac4afdca2afd169646d321d8493c49
kind: import
name: ../../open-sse/config/toolCloaking.ts
qualified_name: ../../open-sse/config/toolCloaking.ts
file_path: tests/unit/antigravity-tool-cloaking.test.ts
language: typescript
signature:
import {
  AG_DECOY_TOOLS,
  AG_TOOL_SUFFIX,
  cloakAntigravityToolPayload,
} from "../../open-sse/config/toolCloaking.ts";


id: import:9d915a915b622b6b25922be39997e70b
kind: import
name: ../../open-sse/services/antigravityVersion.ts
qualified_name: ../../open-sse/services/antigravityVersion.ts
file_path: tests/unit/antigravity-version.test.ts
language: typescript
signature:
import {
  ANTIGRAVITY_FALLBACK_VERSION,
  ANTIGRAVITY_VERSION_CACHE_TTL_MS,
  clearAntigravityVersionCache,
  getCachedAntigravityVersion,
  resolveAntigravityVersion,
  seedAntigravityVersionCache,
} from "../../open-sse/services/antigravityVersion.ts";


id: function:a404cdab2c58d1f454cb3b0e6dcf784e
kind: function
name: isWithinSchedule
qualified_name: isWithinSchedule
file_path: tests/unit/api-key-policy.test.ts
language: typescript
signature: (schedule, now = new Date())
docstring:
─── Replicate the isWithinSchedule logic for pure unit testing ───────────────

This mirrors the implementation in apiKeyPolicy.ts exactly.
If the production code changes, update this copy too.
@param {{ enabled: boolean; from: string; until: string; days: number[]; tz: string }} schedule
@param {Date} now  — injectable "current time"
@returns {boolean}


id: function:df03a78d23037336db680e8999151e73
kind: function
name: utc
qualified_name: utc
file_path: tests/unit/api-key-policy.test.ts
language: typescript
signature: (y, m, d, h, min)
docstring:
─── isWithinSchedule ────────────────────────────────────────────────────────
Helper: create a Date at a specific UTC datetime


id: import:6e62118965e5ae04398f396e5af455ce
kind: import
name: ../../open-sse/services/apiKeyRotator.ts
qualified_name: ../../open-sse/services/apiKeyRotator.ts
file_path: tests/unit/api-key-rotator-health.test.ts
language: typescript
signature:
import {
  getValidApiKey,
  recordKeyFailure,
  recordKeySuccess,
  connectionHasExtraKeys,
  trackConnectionExtraKeys,
  getInvalidKeyCount,
  resetKeyStatus,
  getAllKeyHealth,
  syncHealthFromDB,
  type KeyHealth,
} from "../../open-sse/services/apiKeyRotator.ts";


id: import:7b1eba84717181ffa54ac1281cacf9d0
kind: import
name: ../../../src/app/api/providers/[id]/sync-models/route.ts
qualified_name: ../../../src/app/api/providers/[id]/sync-models/route.ts
file_path: tests/unit/api/sync-models-readiness.test.ts
language: typescript
signature:
import {
  selfFetchWithRetry,
  ensureLoopbackServerReady,
  __resetLoopbackReadinessForTests,
} from "../../../src/app/api/providers/[id]/sync-models/route.ts";


id: import:dc9f9ff14c3284c3307cc961973293ca
kind: import
name: ../../../src/server/auth/loginGuard
qualified_name: ../../../src/server/auth/loginGuard
file_path: tests/unit/auth/loginGuard.test.ts
language: typescript
signature:
import {
  checkLoginGuard,
  clearLoginAttempts,
  recordLoginFailure,
  resetLoginGuardForTests,
  LOGIN_GUARD_TUNABLES,
} from "../../../src/server/auth/loginGuard";


id: constant:d16659767e4dfdcd4b5ea7ba346374a2
kind: constant
name: cases
qualified_name: cases
file_path: tests/unit/authz/classify.test.ts
language: typescript
signature:
= [
  { name: "root /", path: "/", expectedClass: "MANAGEMENT", expectedNormalized: "/" },
  { name: "...


id: type_alias:9e175041130694038c31c93e1d7db8af
kind: type_alias
name: ValidateFn
qualified_name: ValidateFn
file_path: tests/unit/authz/client-api-policy-fallback.test.ts
language: typescript
docstring:
─── Mock validateApiKey via require interception (so the dynamic import in
the policy module returns our stub instead of hitting the real DB module) ─


id: constant:55c8c76b053bf75ab160f8e49d8afd71
kind: constant
name: POLICY_IMPORT_TARGET
qualified_name: POLICY_IMPORT_TARGET
file_path: tests/unit/authz/client-api-policy-fallback.test.ts
language: typescript
signature: = "src/lib/db/apiKeys"
docstring:
Intercept require() / import() resolution for the apiKeys DB module and
substitute it for our stub. This runs only for the exact path the policy
imports — production code paths are unaffected.


id: import:63aed6e493ae84174cd7a907b680dbc8
kind: import
name: ../../../src/server/authz/routeGuard.ts
qualified_name: ../../../src/server/authz/routeGuard.ts
file_path: tests/unit/authz/routeGuard.test.ts
language: typescript
signature:
import {
  isLocalOnlyPath,
  isLocalOnlyBypassableByManageScope,
  isAlwaysProtectedPath,
  isLoopbackHost,
} from "../../../src/server/authz/routeGuard.ts";


id: constant:58cfcfe7edcfbcc7263149aa190b5ab1
kind: constant
name: baseConfig
qualified_name: baseConfig
file_path: tests/unit/auto-combo-engine.test.ts
language: typescript
signature:
= {
  id: "auto-main",
  name: "Auto Main",
  type: "auto",
  candidatePool: [],
  weights: DEFAULT_WE...


id: import:f33e866db0b5fc75edca32aa08310e33
kind: import
name: ../../src/shared/validation/schemas.ts
qualified_name: ../../src/shared/validation/schemas.ts
file_path: tests/unit/bailian-coding-plan-provider.test.ts
language: typescript
signature:
import {
  validateBody,
  createProviderSchema,
  updateProviderConnectionSchema,
} from "../../src/shared/validation/schemas.ts";


id: import:c77ee76af195f75cdb3f80b055fb58f7
kind: import
name: ../../open-sse/services/bailianQuotaFetcher.ts
qualified_name: ../../open-sse/services/bailianQuotaFetcher.ts
file_path: tests/unit/bailian-quota-fetcher.test.ts
language: typescript
signature:
import {
  fetchBailianQuota,
  invalidateBailianQuotaCache,
  registerBailianCodingPlanQuotaFetcher,
} from "../../open-sse/services/bailianQuotaFetcher.ts";


id: import:dbf85c564b12b236ecc2ace9823ba1ac
kind: import
name: ../../open-sse/services/quotaMonitor.ts
qualified_name: ../../open-sse/services/quotaMonitor.ts
file_path: tests/unit/bailian-quota-fetcher.test.ts
language: typescript
signature:
import {
  clearQuotaMonitors,
  getActiveMonitorCount,
  startQuotaMonitor,
  stopQuotaMonitor,
} from "../../open-sse/services/quotaMonitor.ts";


id: import:645b93b9105edb3c64d01a3a849b8091
kind: import
name: ../../src/shared/validation/schemas.ts
qualified_name: ../../src/shared/validation/schemas.ts
file_path: tests/unit/bailian-schema-validation.test.ts
language: typescript
signature:
import {
  createProviderSchema,
  updateProviderConnectionSchema,
} from "../../src/shared/validation/schemas.ts";


id: import:362c18cf0c23389d9d016abf4c48e947
kind: import
name: ../../src/domain/costRules.ts
qualified_name: ../../src/domain/costRules.ts
file_path: tests/unit/batch-a-domain.test.ts
language: typescript
signature:
import {
  setBudget,
  getBudget,
  recordCost,
  checkBudget,
  getDailyTotal,
  getCostSummary,
  resetCostData,
} from "../../src/domain/costRules.ts";


id: import:085c74d72cbed8c451d9bffe1faa527e
kind: import
name: ../../src/domain/fallbackPolicy.ts
qualified_name: ../../src/domain/fallbackPolicy.ts
file_path: tests/unit/batch-a-domain.test.ts
language: typescript
signature:
import {
  registerFallback,
  resolveFallbackChain,
  getNextFallback,
  hasFallback,
  removeFallback,
  getAllFallbackChains,
  resetAllFallbacks,
} from "../../src/domain/fallbackPolicy.ts";


id: import:a196d4d8dc9d4df01844ed03bdeed34e
kind: import
name: ../../src/shared/constants/errorCodes.ts
qualified_name: ../../src/shared/constants/errorCodes.ts
file_path: tests/unit/batch-a-domain.test.ts
language: typescript
signature:
import {
  ERROR_CODES,
  createErrorResponse,
  getErrorsByCategory,
} from "../../src/shared/constants/errorCodes.ts";


id: import:99150ce52813f357046bb4679ee43457
kind: import
name: ../../src/shared/utils/requestId.ts
qualified_name: ../../src/shared/utils/requestId.ts
file_path: tests/unit/batch-a-domain.test.ts
language: typescript
signature:
import {
  getRequestId,
  withRequestId,
  addRequestIdHeader,
  generateRequestId,
} from "../../src/shared/utils/requestId.ts";


id: import:701b2006311e8364310e74fab46c8abc
kind: import
name: ../../src/lib/evals/evalRunner.ts
qualified_name: ../../src/lib/evals/evalRunner.ts
file_path: tests/unit/batch-b-final.test.ts
language: typescript
signature:
import {
  registerSuite,
  getSuite,
  listSuites,
  evaluateCase,
  runSuite,
  createScorecard,
  resetSuites,
} from "../../src/lib/evals/evalRunner.ts";


id: import:326eafe502de9844005146fe82cdd12d
kind: import
name: ../../tests/e2e/responsiveSpecs.ts
qualified_name: ../../tests/e2e/responsiveSpecs.ts
file_path: tests/unit/batch-b-final.test.ts
language: typescript
signature:
import {
  VIEWPORTS,
  PAGES,
  generateTestMatrix,
  getViewportNames,
} from "../../tests/e2e/responsiveSpecs.ts";


id: constant:0429de6a3a8a3b3598a36fd6b9a7102e
kind: constant
name: TERMINAL
qualified_name: TERMINAL
file_path: tests/unit/batch-deletion-route-logic.test.ts
language: typescript
signature: = ["completed", "failed", "cancelled", "expired"]
docstring:
Tests for the business logic embedded in DELETE route handlers.
These verify every code path without importing Next.js route modules
(which pull in pino/thread-stream — broken on Node 26).


id: function:d4b62f1e137b3b34264b3f71632c8ed0
kind: function
name: scopeCheck
qualified_name: scopeCheck
file_path: tests/unit/batch-deletion-route-logic.test.ts
language: typescript
signature:
(
  isSessionAuth: boolean,
  recordApiKeyId: string | null | undefined,
  apiKeyId: string | null
): boolean


id: import:14bc47c33938e7e70ada20bfae756408
kind: import
name: @/lib/localDb
qualified_name: @/lib/localDb
file_path: tests/unit/batch-deletion.test.ts
language: typescript
signature:
import {
  createFile,
  createBatch,
  getBatch,
  deleteBatch,
  deleteCompletedBatches,
  getFile,
  deleteFile,
} from "@/lib/localDb";


id: import:ce29ecf311f003b90f211534af04201f
kind: import
name: ../../src/shared/middleware/bodySizeGuard.ts
qualified_name: ../../src/shared/middleware/bodySizeGuard.ts
file_path: tests/unit/body-size-guard.test.ts
language: typescript
signature:
import {
  MAX_BODY_BYTES_AUDIO,
  getBodySizeLimit,
  checkBodySize,
} from "../../src/shared/middleware/bodySizeGuard.ts";


id: import:6c1bdcd2adc58f6358e6f2e3cb178e75
kind: import
name: ../../src/shared/utils/bulkApiKeyParser.ts
qualified_name: ../../src/shared/utils/bulkApiKeyParser.ts
file_path: tests/unit/bulkApiKeyParser.test.ts
language: typescript
signature:
import {
  parseBulkApiKeys,
  BULK_API_KEY_MAX_LINES,
} from "../../src/shared/utils/bulkApiKeyParser.ts";


id: import:a5d130767bb18ff528287d5f62db8c03
kind: import
name: ../../open-sse/utils/cacheControlPolicy.ts
qualified_name: ../../open-sse/utils/cacheControlPolicy.ts
file_path: tests/unit/cache-control-claude-providers.test.ts
language: typescript
signature:
import {
  providerSupportsCaching,
  shouldPreserveCacheControl,
} from "../../open-sse/utils/cacheControlPolicy.ts";


id: import:d8c458a748ac6307b75e9312a80cbe8e
kind: import
name: ../../open-sse/utils/cacheControlPolicy.ts
qualified_name: ../../open-sse/utils/cacheControlPolicy.ts
file_path: tests/unit/cache-control-policy.test.ts
language: typescript
signature:
import {
  isClaudeCodeClient,
  providerSupportsCaching,
  isDeterministicStrategy,
  shouldPreserveCacheControl,
  trackCacheMetrics,
  updateCacheTokenMetrics,
} from "../../open-sse/utils/cacheControlPolicy.ts";


id: constant:764c7cc3782e51027c505513329776dd
kind: constant
name: TEST_DATA_DIR
qualified_name: TEST_DATA_DIR
file_path: tests/unit/call-logs-pagination.test.ts
language: typescript
signature: = fs.mkdtempSync(path.join(os.tmpdir(), "omniroute-calllogs-pagination-"))
docstring:
Regression for #2565: the dashboard log viewer paginates by growing its
fetch window. getCallLogs must honor `limit` and `offset` and keep a stable
`timestamp DESC` ordering so each page returns the expected rows.


id: constant:5f491a20cff88ec12661a21486990fc7
kind: constant
name: originalRetryConfig
qualified_name: originalRetryConfig
file_path: tests/unit/chat-cooldown-aware-retry.test.ts
language: typescript
signature:
= {
  maxAttempts: BaseExecutor.RETRY_CONFIG.maxAttempts,
  delayMs: BaseExecutor.RETRY_CONFIG.delayMs...


id: constant:d697fd5e0f7de04287dae9a8da87f13f
kind: constant
name: CHAT_OPENAI_COMPAT_PROVIDER_IDS
qualified_name: CHAT_OPENAI_COMPAT_PROVIDER_IDS
file_path: tests/unit/chat-openai-compat-providers.test.ts
language: typescript
signature:
= [
  "deepinfra",
  "vercel-ai-gateway",
  "qianfan",
  "lambda-ai",
  "sambanova",
  "nscale",
  "ov...


id: function:61a304c799482c28a8f2b83493a53de0
kind: function
name: invokeChatCore
qualified_name: invokeChatCore
file_path: tests/unit/chatcore-sanitization.test.ts
language: typescript
signature:
({
  body,
  accept = "application/json",
  provider = "openai",
  model = "gpt-4o-mini",
  endpoint = "/v1/chat/completions",
  credentials = { apiKey: "sk-test", providerSpecificData: {} },
  apiKeyInfo = null,
  userAgent = "unit-test",
  responseFactory,
} = {})


id: function:d3caf5e208f84a4ee25ef350fff12195
kind: function
name: invokeChatCore
qualified_name: invokeChatCore
file_path: tests/unit/chatcore-translation-paths.test.ts
language: typescript
signature:
({
  body,
  provider = "openai",
  model = "gpt-4o-mini",
  endpoint = "/v1/chat/completions",
  accept = "application/json",
  userAgent = "unit-test",
  credentials,
  apiKeyInfo = null,
  responseFormat = "openai",
  responseFactory,
  isCombo = false,
  comboStrategy = null,
  requestHeaders = {},
  connectionId = null,
  onCredentialsRefreshed = null,
  onRequestSuccess = null,
}: any = {})


id: function:822ef1962ac781cd7b06fe7a5809afd0
kind: function
name: installMockFetch
qualified_name: installMockFetch
file_path: tests/unit/chatgpt-web.test.ts
language: typescript
docstring:
Dispatch the TLS-impersonating fetch by URL pathname.
 Default: session 200 with accessToken, sentinel 200 no PoW, conv 200 empty stream.

signature:
({
  session,
  sentinel,
  conv,
  dpl,
  fileDownload,
  attachmentDownload,
  signedDownload,
  userConfig,
  onSession,
  onSentinel,
  onConv,
  onFileDownload,
  onAttachmentDownload,
  onUserConfig,
}: any = {})


id: function:f959d83bb414d1bc48a954f5ba80af97
kind: function
name: imageGenEvents
qualified_name: imageGenEvents
file_path: tests/unit/chatgpt-web.test.ts
language: typescript
signature: ({ pointer, text = "Here's your kitten:" })
docstring:
─── Image generation ──────────────────────────────────────────────────────
Build a SSE event stream that mimics ChatGPT's image-generation reply.
 Text turn first, then a finalized multimodal_text with one image_asset_pointer.


id: import:73190d86439aba425eb180efb4539d8b
kind: import
name: ../../scripts/check/check-env-doc-sync.mjs
qualified_name: ../../scripts/check/check-env-doc-sync.mjs
file_path: tests/unit/check-env-doc-sync.test.ts
language: typescript
signature:
import {
  parseEnvExampleVars,
  parseEnvDocVars,
  runEnvDocSync,
} from "../../scripts/check/check-env-doc-sync.mjs";


id: import:9a008def7d7a80ddd10f7105483e901e
kind: import
name: ../../src/shared/utils/circuitBreaker.ts
qualified_name: ../../src/shared/utils/circuitBreaker.ts
file_path: tests/unit/circuit-breaker-failure-kind.test.ts
language: typescript
signature:
import {
  CircuitBreaker,
  resetAllCircuitBreakers,
  getCircuitBreaker,
} from "../../src/shared/utils/circuitBreaker.ts";


id: import:3402056114949635726dc90235fe8c75
kind: import
name: ../../src/shared/utils/classify429.ts
qualified_name: ../../src/shared/utils/classify429.ts
file_path: tests/unit/classify429.test.ts
language: typescript
signature:
import {
  classify429,
  looksLikeQuotaExhausted,
  parseRetryAfter,
  retryAfterFromResponse,
  type FailureKind,
} from "../../src/shared/utils/classify429.ts";


id: function:a4528b5e54a1313340d853828c36ec80
kind: function
name: fullAgentBody
qualified_name: fullAgentBody
file_path: tests/unit/claude-beta-flags-2454.test.ts
language: typescript
signature: (model: string)
docstring:
Regression for #2454: Haiku with OAuth rejects `context-1m-2025-08-07` with
400 "This authentication style is incompatible with the long context beta header".
The heavy-agent beta tier (effort, advanced-tool-use) must be gated on
Opus/Sonnet only; Haiku still receives the general full-agent flags.
context-1m is Opus-only in captured Claude Code traffic.


id: import:51b5f1dcbf67f07a38f10a979c9d6b3d
kind: import
name: ../../src/shared/services/claudeCliConfig.ts
qualified_name: ../../src/shared/services/claudeCliConfig.ts
file_path: tests/unit/claude-cli-config.test.ts
language: typescript
signature:
import {
  getStoredClaudeAuthValue,
  normalizeClaudeBaseUrl,
} from "../../src/shared/services/claudeCliConfig.ts";


id: import:ea180ec6d3924e34fa020d3e482c7b65
kind: import
name: ../../open-sse/services/claudeCodeCCH.ts
qualified_name: ../../open-sse/services/claudeCodeCCH.ts
file_path: tests/unit/claude-code-parity.test.ts
language: typescript
signature:
import { computeCCH, signRequestBody, CCH_PATTERN } from "../../open-sse/services/claudeCodeCCH.ts";


id: import:908caa4a3a99aa087c54050400b118d9
kind: import
name: ../../open-sse/services/claudeCodeFingerprint.ts
qualified_name: ../../open-sse/services/claudeCodeFingerprint.ts
file_path: tests/unit/claude-code-parity.test.ts
language: typescript
signature:
import {
  computeFingerprint,
  extractFirstUserMessageText,
} from "../../open-sse/services/claudeCodeFingerprint.ts";


id: import:b7b8b33c32da05f47dd4ee94ab2ca5db
kind: import
name: ../../open-sse/services/claudeCodeToolRemapper.ts
qualified_name: ../../open-sse/services/claudeCodeToolRemapper.ts
file_path: tests/unit/claude-code-parity.test.ts
language: typescript
signature:
import {
  remapToolNamesInRequest,
  remapToolNamesInResponse,
} from "../../open-sse/services/claudeCodeToolRemapper.ts";


id: import:59be6fb51132012438615b8dffd86ed7
kind: import
name: ../../open-sse/services/claudeCodeConstraints.ts
qualified_name: ../../open-sse/services/claudeCodeConstraints.ts
file_path: tests/unit/claude-code-parity.test.ts
language: typescript
signature:
import {
  enforceThinkingTemperature,
  disableThinkingIfToolChoiceForced,
  enforceCacheControlLimit,
  ensureCacheControlOnLastUserMessage,
} from "../../open-sse/services/claudeCodeConstraints.ts";


id: import:df591536cecf7cda2dcc15463e9fe95f
kind: import
name: ../../open-sse/services/claudeWebAutoRefresh
qualified_name: ../../open-sse/services/claudeWebAutoRefresh
file_path: tests/unit/claude-web-auto-refresh.test.ts
language: typescript
signature:
import {
  injectCfClearance,
  refreshCookie,
  getCacheInfo,
  createAutoRefreshMiddleware,
} from "../../open-sse/services/claudeWebAutoRefresh";


id: import:86f3113886f8b6a68017f2683f0ea161
kind: import
name: ../../open-sse/services/claudeTurnstileSolver
qualified_name: ../../open-sse/services/claudeTurnstileSolver
file_path: tests/unit/claude-web-auto-refresh.test.ts
language: typescript
signature:
import { getCfClearanceToken, getCacheStatus } from "../../open-sse/services/claudeTurnstileSolver";


id: type_alias:329cb3223efdc7aafc7a55fd3bf4d74d
kind: type_alias
name: JsonRecord
qualified_name: JsonRecord
file_path: tests/unit/claudeAuthFile.test.ts
language: typescript
docstring:
We don't import the full claudeAuthFile module (it pulls in DB/cliRuntime/tokenRefresh).
Instead, we re-implement the same pure primitives here and verify their shape
matches the rules documented in the spec — unit-testing the helpers in isolation.
──── Helpers (mirror of claudeAuthFile.ts pure functions) ────────────────────


id: function:58123d55507275e4f2bae859033dbd52
kind: function
name: checkCreateConnectionPreconditions
qualified_name: checkCreateConnectionPreconditions
file_path: tests/unit/claudeAuthImport.test.ts
language: typescript
docstring: Mirror of the duplicate-detection + identity-check logic in createConnectionFromAuthFile
signature:
(
  enriched: EnrichedClaudeAuth,
  options: CreateConnectionOptions,
  existingByAccountUUID: JsonRecord | null
): { error: string; code: string; status: number } | null


id: constant:dcc9cee183cc38ed0a4f21f0023ddc8e
kind: constant
name: TASK
qualified_name: TASK
file_path: tests/unit/cli-a2a-invoke-commands.test.ts
language: typescript
signature:
= {
  id: "a2a-task-001",
  skill: "smart-routing",
  status: "completed",
  createdAt: "2026-05-14T10...


id: constant:c9052aa38402a3b362b9d686a0bce9b3
kind: constant
name: COMPLIANCE_ENTRIES
qualified_name: COMPLIANCE_ENTRIES
file_path: tests/unit/cli-audit-commands.test.ts
language: typescript
signature:
= [
  {
    id: "c1",
    timestamp: "2026-05-10T10:00:00Z",
    actor: "admin@acme.com",
    action: ...


id: constant:0a432ef442612d716008c35815a1a5dd
kind: constant
name: MCP_ENTRIES
qualified_name: MCP_ENTRIES
file_path: tests/unit/cli-audit-commands.test.ts
language: typescript
signature:
= [
  {
    id: "m1",
    timestamp: "2026-05-10T11:00:00Z",
    actor: "cli_client",
    action: "omn...


id: constant:03c1d655969f183b3de2dc8c6e807dec
kind: constant
name: MCP_STATS
qualified_name: MCP_STATS
file_path: tests/unit/cli-audit-commands.test.ts
language: typescript
signature:
= {
  period: "7d",
  totalCalls: 150,
  byTool: [{ tool: "omniroute_memory_search", count: 40 }],
  b...


id: constant:a44fb4b897507726035abbcf8e907b19
kind: constant
name: FAKE_RESPONSE
qualified_name: FAKE_RESPONSE
file_path: tests/unit/cli-chat.test.ts
language: typescript
signature:
= {
  id: "chatcmpl-abc",
  model: "claude-sonnet-4-6",
  choices: [{ message: { role: "assistant", co...


id: constant:a34d227f4a9ea1195607490f2146f7ba
kind: constant
name: TASK
qualified_name: TASK
file_path: tests/unit/cli-cloud-commands.test.ts
language: typescript
signature:
= {
  id: "task-001",
  agent: "codex",
  status: "running",
  title: "Fix the login bug",
  createdAt...


id: constant:89cc692d78d15cc004afc0ad7049720a
kind: constant
name: ANALYTICS_RESPONSE
qualified_name: ANALYTICS_RESPONSE
file_path: tests/unit/cli-cost.test.ts
language: typescript
signature:
= {
  byProvider: [
    {
      provider: "openai",
      totalRequests: 150,
      totalTokensIn: 500...


id: constant:6ed7a67ed9b4578cd5fd4e5eca0d4c3f
kind: constant
name: SUITE
qualified_name: SUITE
file_path: tests/unit/cli-eval-commands.test.ts
language: typescript
signature:
= {
  id: "suite-001",
  name: "Chat quality",
  samples: 50,
  rubric: "accuracy",
  updatedAt: "2026...


id: constant:17bb285e9508a03df260e5edaf63202e
kind: constant
name: RUN
qualified_name: RUN
file_path: tests/unit/cli-eval-commands.test.ts
language: typescript
signature:
= {
  id: "run-001",
  suiteId: "suite-001",
  status: "completed",
  model: "gpt-4o",
  score: 0.87,
...


id: constant:9ad740286e055dbc0e9c22b224335255
kind: constant
name: SAMPLES
qualified_name: SAMPLES
file_path: tests/unit/cli-eval-commands.test.ts
language: typescript
signature:
= [
  { id: "s1", score: 0.9, passed: true, input: "Hello", output: "Hi there" },
  { id: "s2", score:...


id: constant:0577a7b7894cf0e6631431d9f90c4865
kind: constant
name: MEMORY_ITEMS
qualified_name: MEMORY_ITEMS
file_path: tests/unit/cli-memory-commands.test.ts
language: typescript
signature:
= [
  {
    id: "mem_001",
    type: "user",
    content: "User prefers dark mode",
    score: 0.95,
 ...


id: constant:f1a5e56a97946f823a1cf68160f79184
kind: constant
name: CONNECTIONS
qualified_name: CONNECTIONS
file_path: tests/unit/cli-oauth-commands.test.ts
language: typescript
signature:
= [
  {
    id: "conn1",
    provider: "gemini",
    name: "My Gemini",
    authType: "oauth",
    isA...


id: constant:f0fa2d314c1ef949791b3ff31d8e7e18
kind: constant
name: fakeSpec
qualified_name: fakeSpec
file_path: tests/unit/cli-openapi-commands.test.ts
language: typescript
signature:
= {
  openapi: "3.0.0",
  info: { title: "OmniRoute API", version: "1.0.0" },
  paths: {
    "/v1/chat...


id: constant:2e6db41ea43d0143757b32825554dc2a
kind: constant
name: POLICY
qualified_name: POLICY
file_path: tests/unit/cli-policy-commands.test.ts
language: typescript
signature:
= {
  id: "pol-001",
  name: "Block free tier",
  kind: "deny",
  scope: "api-key",
  enabled: true,
 ...


id: constant:c7ee77c5e378ecc7fb3f153f33321a70
kind: constant
name: METRICS_OBJECT
qualified_name: METRICS_OBJECT
file_path: tests/unit/cli-providers-metrics.test.ts
language: typescript
signature:
= {
  metrics: {
    openai: { totalRequests: 200, successRate: 0.97, avgLatencyMs: 450, errors: 6 },
...


id: constant:efaeaaae41e53c3ce7930b1a32d8ed1e
kind: constant
name: METRICS_ARRAY
qualified_name: METRICS_ARRAY
file_path: tests/unit/cli-providers-metrics.test.ts
language: typescript
signature:
= {
  providers: [
    { provider: "openai", requests: 200, successRate: 0.97, avgLatencyMs: 450, erro...


id: constant:fa6937ff3c6163c77f46382cf914c91d
kind: constant
name: COMBO_RESPONSE
qualified_name: COMBO_RESPONSE
file_path: tests/unit/cli-simulate.test.ts
language: typescript
signature:
= {
  combos: [
    {
      id: "default",
      name: "default",
      enabled: true,
      steps: [
...


id: constant:7628300e7650307fcecd31b1bd1fc5db
kind: constant
name: HEALTH_RESPONSE
qualified_name: HEALTH_RESPONSE
file_path: tests/unit/cli-simulate.test.ts
language: typescript
signature:
= {
  circuitBreakers: [
    { provider: "openai", state: "CLOSED" },
    { provider: "anthropic", sta...


id: constant:405745576150a8f876986a63d03b905a
kind: constant
name: QUOTA_RESPONSE
qualified_name: QUOTA_RESPONSE
file_path: tests/unit/cli-simulate.test.ts
language: typescript
signature:
= {
  providers: [
    { provider: "openai", percentRemaining: 80 },
    { provider: "anthropic", perc...


id: constant:96b5cecd58ec9853620a846c779d8067
kind: constant
name: SKILLS_DATA
qualified_name: SKILLS_DATA
file_path: tests/unit/cli-skills-commands.test.ts
language: typescript
signature:
= [
  { id: "sk_pdf", name: "PDF Parser", type: "sandbox", version: "1.0.0", enabled: true },
  { id: ...


id: constant:40800d1049e0aee8ff036907e2e6f50d
kind: constant
name: EXECUTIONS_DATA
qualified_name: EXECUTIONS_DATA
file_path: tests/unit/cli-skills-commands.test.ts
language: typescript
signature:
= [
  {
    id: "ex_001",
    skillId: "sk_pdf",
    status: "completed",
    startedAt: "2026-05-10T1...


id: constant:2be07c55dd6788d901fae60523dcbdb8
kind: constant
name: MARKETPLACE_DATA
qualified_name: MARKETPLACE_DATA
file_path: tests/unit/cli-skills-commands.test.ts
language: typescript
signature:
= [
  {
    id: "pkg_pdf",
    name: "PDF Toolkit",
    category: "documents",
    version: "1.0.0",
 ...


id: constant:4798f70c2b659fc65dbcf77b5d25d6cc
kind: constant
name: BIN
qualified_name: BIN
file_path: tests/unit/cli-storage-key-bootstrap.test.ts
language: typescript
signature:
= path.join(
  path.dirname(fileURLToPath(import.meta.url)),
  "..",
  "..",
  "bin",
  "omniroute.mjs...


id: constant:42374bb8f4a16bc741593bc94bdba3f6
kind: constant
name: COMPONENTS
qualified_name: COMPONENTS
file_path: tests/unit/cli-tui.test.ts
language: typescript
signature:
= [
  { file: "DataTable.jsx", export: "DataTable" },
  { file: "MenuSelect.jsx", export: "MenuSelect"...


id: constant:da91a7c16b785671e6b91a999776bcb8
kind: constant
name: ANALYTICS_DATA
qualified_name: ANALYTICS_DATA
file_path: tests/unit/cli-usage.test.ts
language: typescript
signature:
= {
  byProvider: [
    {
      provider: "openai",
      totalRequests: 100,
      totalTokensIn: 400...


id: constant:5cf35767bafc944944a40308bbd81b17
kind: constant
name: BUDGET_DATA
qualified_name: BUDGET_DATA
file_path: tests/unit/cli-usage.test.ts
language: typescript
signature:
= {
  budgets: [
    { scope: "global", period: "monthly", limit: 100, used: 42.5, remaining: 57.5, pc...


id: constant:acf15ed72143c15da2e3c7e2f4b45b90
kind: constant
name: QUOTA_DATA
qualified_name: QUOTA_DATA
file_path: tests/unit/cli-usage.test.ts
language: typescript
signature:
= {
  providers: [
    { provider: "openai", limit: 1000000, used: 500000, remaining: 500000, state: "...


id: constant:432fc332398d610bdf104bf8670795c1
kind: constant
name: LOGS_DATA
qualified_name: LOGS_DATA
file_path: tests/unit/cli-usage.test.ts
language: typescript
signature:
= {
  logs: [
    {
      id: "1",
      createdAt: "2026-05-15T10:00:00Z",
      apiKey: "sk-test-key...


id: constant:6b149cf121245befbd6163abb8f604e5
kind: constant
name: WEBHOOK
qualified_name: WEBHOOK
file_path: tests/unit/cli-webhooks-commands.test.ts
language: typescript
signature:
= {
  id: "wh-001",
  url: "https://example.com/hook",
  events: ["request.completed", "request.failed...


id: function:171e1f455893c77c4fd7e4a744257ffc
kind: function
name: maskApiKey
qualified_name: maskApiKey
file_path: tests/unit/cloud-agent-credentials-api.test.ts
language: typescript
signature: (key: string): string
docstring:
─── maskApiKey ───────────────────────────────────────
Exact replica of the function from
src/app/api/v1/agents/credentials/route.ts:31-34


id: constant:9b80dab56e5ed379b765dce7e3ab1012
kind: constant
name: SaveCredentialSchema
qualified_name: SaveCredentialSchema
file_path: tests/unit/cloud-agent-credentials-api.test.ts
language: typescript
docstring:
─── SaveCredentialSchema ─────────────────────────────
Exact replica of the schema from
src/app/api/v1/agents/credentials/route.ts:13-17

signature:
= z.object({
  providerId: z.enum(["jules", "devin", "codex-cloud"]),
  apiKey: z.string().min(1),
  b...


id: import:f403e3e410b0d58c8507f0c9151e0c42
kind: import
name: ../../src/lib/cloudflaredTunnel.ts
qualified_name: ../../src/lib/cloudflaredTunnel.ts
file_path: tests/unit/cloudflaredTunnel.test.ts
language: typescript
signature:
import {
  buildCloudflaredChildEnv,
  extractCloudflaredErrorMessage,
  extractTryCloudflareUrl,
  getCloudflaredTunnelStatus,
  getDefaultCloudflaredCertEnv,
  getCloudflaredStartArgs,
  getCloudflaredAssetSpec,
  getSha256FromGitHubDigest,
  verifyCloudflaredDownloadDigest,
} from "../../src/lib/cloudflaredTunnel.ts";


id: import:cfde2d2b7a2e7dcebfbac737aa0e20aa
kind: import
name: ../../open-sse/services/codeAssistSubscription.ts
qualified_name: ../../open-sse/services/codeAssistSubscription.ts
file_path: tests/unit/code-assist-subscription.test.ts
language: typescript
signature:
import {
  extractCodeAssistOnboardTierId,
  extractCodeAssistSubscriptionTier,
} from "../../open-sse/services/codeAssistSubscription.ts";


id: function:268733ae4a8b4485ffb3c1efccd0e188
kind: function
name: getPromptCacheSessionId
qualified_name: getPromptCacheSessionId
file_path: tests/unit/codex-cache-key.test.ts
language: typescript
docstring: We test the logic inline since the method is private — replicate the priority logic
signature:
(
  credentials: { providerSpecificData?: { workspaceId?: string } } | null,
  body: Record<string, unknown> | null
): string | null


id: type_alias:6ad1afaf506f39c821f8f24d27149409
kind: type_alias
name: Inputs
qualified_name: Inputs
file_path: tests/unit/codex-effort-alias-priority.test.ts
language: typescript
docstring:
Replicate the priority chain that lives in
open-sse/executors/codex.ts:1382-1402 so tests fail loudly if someone
reverts the order.


id: import:25ef10b5032710823a03694f41e38447
kind: import
name: ../../src/lib/providers/codexFastTier.ts
qualified_name: ../../src/lib/providers/codexFastTier.ts
file_path: tests/unit/codex-fast-tier.test.ts
language: typescript
signature:
import {
  applyCodexGlobalFastServiceTier,
  getCodexEffectiveFastServiceTier,
  isCodexGlobalFastServiceTierEnabled,
} from "../../src/lib/providers/codexFastTier.ts";


id: import:3c44049f0cd507221c401e084dc26b66
kind: import
name: ../../open-sse/services/codexQuotaFetcher.ts
qualified_name: ../../open-sse/services/codexQuotaFetcher.ts
file_path: tests/unit/codex-quota-fetcher.test.ts
language: typescript
signature:
import {
  fetchCodexQuota,
  getCodexQuotaCooldownMs,
  invalidateCodexQuotaCache,
  registerCodexConnection,
  registerCodexQuotaFetcher,
} from "../../open-sse/services/codexQuotaFetcher.ts";


id: function:3829941234f418d9a00ff1f2c60337d8
kind: function
name: invokeChatCore
qualified_name: invokeChatCore
file_path: tests/unit/codex-stream-false.test.ts
language: typescript
signature:
({
  body,
  provider = "openai",
  model = "gpt-4o-mini",
  endpoint = "/v1/chat/completions",
  accept = "application/json",
  responseFactory,
} = {})


id: function:bcf14382718cb760f1161f1ae8ce7fbc
kind: function
name: buildJwt
qualified_name: buildJwt
file_path: tests/unit/codexAuthFile.test.ts
language: typescript
signature: (payload: Record<string, unknown>): string
docstring:
We don't import the full codexAuthFile module (it pulls in DB/cliRuntime).
Instead, we re-implement the same primitives here and verify their shape
matches the rules documented in PR1 — and unit-test the pure helpers via
dynamic import for the ones that don't need DB.


id: function:99923911550cd7aaf86f65920bb9427f
kind: function
name: sanitizeFileNamePart
qualified_name: sanitizeFileNamePart
file_path: tests/unit/codexAuthFile.test.ts
language: typescript
signature: (value: string): string
docstring:
Mirror of the helper inside codexAuthFile.ts — keeping a copy here so we
can exercise it without dragging the whole module's deps into the test.


id: function:d103a2dfcbecb2f7f7fe9b1883782ea9
kind: function
name: parsePasteList
qualified_name: parsePasteList
file_path: tests/unit/codexAuthImportBulk.test.ts
language: typescript
signature: (text: string): Array<{ json: unknown; parseError: string | null }>
docstring:
──── Paste-list parser tests ─────────────────────────────────────────────────
Client-side paste parser logic (mirrors what the UI does before submitting)


id: interface:bcba59bfb81f9bbf87e712a7bd124570
kind: interface
name: ExtractedZipFile
qualified_name: ExtractedZipFile
file_path: tests/unit/codexAuthZipExtract.test.ts
language: typescript
docstring:
Mirror the safety logic from codexAuthZipExtract.ts so we can test without
importing the module (which is fine since it has no external DB deps, but
we test the pure logic to keep the test surface clear).


id: interface:4802064dbc4adb667458bf36ffa2c069
kind: interface
name: Target
qualified_name: Target
file_path: tests/unit/combo-context-window-filter.test.ts
language: typescript
docstring:
Test cases for the auto-combo context window pre-filter (#1808)
Filters out models whose context window is too small for the estimated input tokens


id: function:5383dfcca461b0c1918763f919adee87
kind: function
name: contextWindowFilter
qualified_name: contextWindowFilter
file_path: tests/unit/combo-context-window-filter.test.ts
language: typescript
docstring:
Simulates the context-window filter logic from combo.ts
Filters out candidates whose known context limit is smaller than estimated input tokens.
Null/unknown limits are treated as "include" to avoid incorrectly dropping valid targets.

signature:
(
  eligibleTargets: Target[],
  estimatedInputTokens: number,
  getLimitFn: (modelStr: string) => number | null
): FilterResult


id: constant:e2126b14245cd8c7e9c9a6a79952283d
kind: constant
name: OUTPUT_TOKEN_RATIO
qualified_name: OUTPUT_TOKEN_RATIO
file_path: tests/unit/combo-cost-blending.test.ts
language: typescript
signature: = 0.4
docstring:
Test cases for the auto-combo output token cost blending formula
Formula: costPer1MTokens = inputPrice * (1 - OUTPUT_TOKEN_RATIO) + outputPrice * OUTPUT_TOKEN_RATIO
where OUTPUT_TOKEN_RATIO = 0.4


id: function:ca8f8a7ff4f796a524809d2f91440d73
kind: function
name: blendCost
qualified_name: blendCost
file_path: tests/unit/combo-cost-blending.test.ts
language: typescript
signature: (inputPrice: number, outputPrice: number): number
docstring:
Blends input and output prices using the formula from combo.ts
@param inputPrice Price per 1M input tokens
@param outputPrice Price per 1M output tokens
@returns Blended cost per 1M tokens


id: constant:12511427a76e998f1b4c75730c4bbf08
kind: constant
name: reqBodyNullContext
qualified_name: reqBodyNullContext
file_path: tests/unit/combo-strategies.test.ts
language: typescript
signature:
= {
  model: "comboTest",
  messages: [{ role: "user", content: null }], // hit toTextContent (!string...


id: constant:d1c7f47109cfbfd96f7fecf53bcc1445
kind: constant
name: reqBodyTextArray
qualified_name: reqBodyTextArray
file_path: tests/unit/combo-strategies.test.ts
language: typescript
signature:
= {
  model: "comboTest",
  messages: [{ role: "user", content: [{ text: "hi array" }, { image: "url" ...


id: function:bf34e15b44296d4a10617f42fe922f53
kind: function
name: codexQuota
qualified_name: codexQuota
file_path: tests/unit/combo-strategies.test.ts
language: typescript
signature:
({
  used5h,
  reset5hSeconds,
  used7d,
  reset7dSeconds,
}: {
  used5h: number;
  reset5hSeconds: number;
  used7d: number;
  reset7dSeconds: number;
})


id: function:922d90ae041d083c8dbb513b785eded1
kind: function
name: resetAwareCombo
qualified_name: resetAwareCombo
file_path: tests/unit/combo-strategies.test.ts
language: typescript
signature:
(
  name: string,
  connections: Array<{ id: string; token: string }>,
  config: Record<string, unknown> = {}
)


id: function:321061b06620f46ff72e7adf7a21fdd0
kind: function
name: selectedConnectionFor
qualified_name: selectedConnectionFor
file_path: tests/unit/combo-strategies.test.ts
language: typescript
signature:
(
  combo: Record<string, unknown>,
  options: { apiKeyAllowedConnections?: string[] | null } = {}
)


id: constant:fa159d43d6ebb2e1ec44e902143ae429
kind: constant
name: PINNED_COMMAND_CODE_MODELS
qualified_name: PINNED_COMMAND_CODE_MODELS
file_path: tests/unit/command-code-executor.test.ts
language: typescript
signature:
= [
  "claude-opus-4-7",
  "claude-opus-4-6",
  "claude-sonnet-4-6",
  "claude-haiku-4-5-20251001",
  ...


id: import:df0d708592fe252e9b127285a4084c58
kind: import
name: ../../../open-sse/services/compression/cachingAware.ts
qualified_name: ../../../open-sse/services/compression/cachingAware.ts
file_path: tests/unit/compression/cachingAware.test.ts
language: typescript
signature:
import {
  detectCachingContext,
  getCacheAwareStrategy,
} from "../../../open-sse/services/compression/cachingAware.ts";


id: import:028f0af6288c543f0f6927eec9be9840
kind: import
name: ../../../open-sse/services/compression/caveman.ts
qualified_name: ../../../open-sse/services/compression/caveman.ts
file_path: tests/unit/compression/caveman-engine.test.ts
language: typescript
signature:
import {
  cavemanCompress,
  applyRulesToText,
} from "../../../open-sse/services/compression/caveman.ts";


id: import:4d6dfc1b902004879c818332a2a533b3
kind: import
name: ../../../open-sse/services/compression/preservation.ts
qualified_name: ../../../open-sse/services/compression/preservation.ts
file_path: tests/unit/compression/caveman-preservation.test.ts
language: typescript
signature:
import {
  extractPreservedBlocks,
  restorePreservedBlocks,
  shouldPreserve,
} from "../../../open-sse/services/compression/preservation.ts";


id: import:5b63bcfd9fa4a136ff797ea07fa09288
kind: import
name: ../../../open-sse/services/compression/cavemanRules.ts
qualified_name: ../../../open-sse/services/compression/cavemanRules.ts
file_path: tests/unit/compression/caveman-rules.test.ts
language: typescript
signature:
import {
  CAVEMAN_RULES,
  getRulesForContext,
  getRuleByName,
} from "../../../open-sse/services/compression/cavemanRules.ts";


id: import:5b332ca844a167f45b6ade71cdfa54bc
kind: import
name: ../../../open-sse/services/compression/cavemanRules.ts
qualified_name: ../../../open-sse/services/compression/cavemanRules.ts
file_path: tests/unit/compression/caveman-v379.test.ts
language: typescript
signature:
import {
  getCavemanRuleMetadata,
  getRuleByName,
} from "../../../open-sse/services/compression/cavemanRules.ts";


id: import:21fc5004672c51897970b338dc481dc2
kind: import
name: ../../../open-sse/services/compression/outputMode.ts
qualified_name: ../../../open-sse/services/compression/outputMode.ts
file_path: tests/unit/compression/cavemanSharedBoundaries.test.ts
language: typescript
signature:
import {
  SHARED_BOUNDARIES,
  buildCavemanOutputInstruction,
} from "../../../open-sse/services/compression/outputMode.ts";


id: import:5c7b946f8987855b5b12bf02a37e34af
kind: import
name: ../../../open-sse/services/compression/strategySelector.ts
qualified_name: ../../../open-sse/services/compression/strategySelector.ts
file_path: tests/unit/compression/compression-aggressive.test.ts
language: typescript
signature:
import {
  applyCompression,
  selectCompressionStrategy,
} from "../../../open-sse/services/compression/strategySelector.ts";


id: import:878137138ed3c2df05ee205a674a1881
kind: import
name: ../../../open-sse/services/compression/types.ts
qualified_name: ../../../open-sse/services/compression/types.ts
file_path: tests/unit/compression/compression-aggressive.test.ts
language: typescript
signature:
import type {
  AggressiveConfig,
  CompressionConfig,
} from "../../../open-sse/services/compression/types.ts";


id: import:01e06ef695d64e7f578deee621bd9c31
kind: import
name: ../../../src/app/api/compression/preview/route.ts
qualified_name: ../../../src/app/api/compression/preview/route.ts
file_path: tests/unit/compression/compression-preview-api.test.ts
language: typescript
signature:
import {
  PreviewCompressionConfigSchema,
  PreviewRequestSchema,
} from "../../../src/app/api/compression/preview/route.ts";


id: import:42f95f02710bc97e22043f7d15c6d7ac
kind: import
name: ../../../src/app/api/context/combos/[id]/assignments/route.ts
qualified_name: ../../../src/app/api/context/combos/[id]/assignments/route.ts
file_path: tests/unit/compression/context-compression-api.test.ts
language: typescript
signature:
import { assignmentsUpdateSchema } from "../../../src/app/api/context/combos/[id]/assignments/route.ts";


id: import:a92c8cecd892360103c8c7da50131998
kind: import
name: ../../../open-sse/services/compression/engines/cavemanAdapter.ts
qualified_name: ../../../open-sse/services/compression/engines/cavemanAdapter.ts
file_path: tests/unit/compression/engine-registry.test.ts
language: typescript
signature:
import {
  aggressiveEngine,
  cavemanEngine,
  ultraEngine,
} from "../../../open-sse/services/compression/engines/cavemanAdapter.ts";


id: import:b4e96dabdded15ba48458f62c07867f1
kind: import
name: ../../../open-sse/services/compression/engines/rtk/index.ts
qualified_name: ../../../open-sse/services/compression/engines/rtk/index.ts
file_path: tests/unit/compression/engine-registry.test.ts
language: typescript
signature:
import { rtkEngine as realRtkEngine } from "../../../open-sse/services/compression/engines/rtk/index.ts";


id: import:3581b8faa703b43981431336217d7ad4
kind: import
name: ../../../open-sse/services/compression/index.ts
qualified_name: ../../../open-sse/services/compression/index.ts
file_path: tests/unit/compression/engine-registry.test.ts
language: typescript
signature:
import {
  clearCompressionEngineRegistry,
  getEngine,
  getEngineEntry,
  listEnabledEngines,
  listEngines,
  registerEngine,
  setEngineEnabled,
  updateEngineConfig,
} from "../../../open-sse/services/compression/index.ts";


id: function:f34f1cbe846f1f31c8e2c6513a75f8dc
kind: function
name: loadFixture
qualified_name: loadFixture
file_path: tests/unit/compression/golden-eval.test.ts
language: typescript
signature:
(): Array<{
  role: string;
  content: string | null;
  tool_calls?: unknown;
  tool_call_id?: string;
  name?: string;
}>


id: import:ff7027a003f37e98b8889b011dc2ec85
kind: import
name: ../../../open-sse/services/compression/index.ts
qualified_name: ../../../open-sse/services/compression/index.ts
file_path: tests/unit/compression/language-packs.test.ts
language: typescript
signature:
import {
  buildCavemanOutputInstruction,
  detectCompressionLanguage,
  loadAllRulesForLanguage,
} from "../../../open-sse/services/compression/index.ts";


id: import:5e32fafc5af9c229cb358345503c0ff1
kind: import
name: ../../../open-sse/services/compression/lite.ts
qualified_name: ../../../open-sse/services/compression/lite.ts
file_path: tests/unit/compression/lite.test.ts
language: typescript
signature:
import {
  applyLiteCompression,
  collapseWhitespace,
  dedupSystemPrompt,
  compressToolResults,
  removeRedundantContent,
  replaceImageUrls,
} from "../../../open-sse/services/compression/lite.ts";


id: import:0a4cd4e0efd1a274e1f6365d5e4d2518
kind: import
name: ../../../open-sse/mcp-server/descriptionCompressor.ts
qualified_name: ../../../open-sse/mcp-server/descriptionCompressor.ts
file_path: tests/unit/compression/mcp-description-compressor.test.ts
language: typescript
signature:
import {
  compressDescriptionsInPlace,
  compressMcpListMetadata,
  compressMcpRegistryMetadata,
  compressMcpDescription,
  getMcpDescriptionCompressionStats,
  maybeCompressMcpDescription,
  resetMcpDescriptionCompressionStats,
} from "../../../open-sse/mcp-server/descriptionCompressor.ts";


id: import:58b4606ababf1127cd0a98a7d2fcab8c
kind: import
name: @omniroute/open-sse/services/compression/engines/mcpAccessibility/index.ts
qualified_name: @omniroute/open-sse/services/compression/engines/mcpAccessibility/index.ts
file_path: tests/unit/compression/mcpAccessibility.test.ts
language: typescript
signature:
import { smartFilterText } from "@omniroute/open-sse/services/compression/engines/mcpAccessibility/index.ts";


id: import:f2b9dc0ce2bb1dd6508c5fa14e8412c9
kind: import
name: @omniroute/open-sse/services/compression/engines/mcpAccessibility/constants.ts
qualified_name: @omniroute/open-sse/services/compression/engines/mcpAccessibility/constants.ts
file_path: tests/unit/compression/mcpAccessibility.test.ts
language: typescript
signature:
import { DEFAULT_MCP_ACCESSIBILITY_CONFIG } from "@omniroute/open-sse/services/compression/engines/mcpAccessibility/constants.ts";


id: import:4a848b8fe74a3f7c6f34f10febb57dc7
kind: import
name: ../../../open-sse/services/compression/outputMode.ts
qualified_name: ../../../open-sse/services/compression/outputMode.ts
file_path: tests/unit/compression/outputMode.test.ts
language: typescript
signature:
import {
  applyCavemanOutputMode,
  buildCavemanOutputInstruction,
  shouldBypassCavemanOutputMode,
} from "../../../open-sse/services/compression/outputMode.ts";


id: import:faf6885ba387e0c1a69ecb3e55db52c3
kind: import
name: ../../../open-sse/services/compression/index.ts
qualified_name: ../../../open-sse/services/compression/index.ts
file_path: tests/unit/compression/pipeline-integration.test.ts
language: typescript
signature:
import {
  applyCompression,
  applyStackedCompression,
} from "../../../open-sse/services/compression/index.ts";


id: function:cad1bba5a3fc5e0f408d7f545f39ec6a
kind: function
name: makeMessages
qualified_name: makeMessages
file_path: tests/unit/compression/progressiveAging.test.ts
language: typescript
signature:
(
  count: number,
  role: string = "user",
  prefix: string = "Message"
): Array<{ role: string; content: string }>


id: import:4d9f14b52bb21343a5788d512ca506b3
kind: import
name: ../../../open-sse/services/compression/index.ts
qualified_name: ../../../open-sse/services/compression/index.ts
file_path: tests/unit/compression/rtk-code-stripper.test.ts
language: typescript
signature:
import {
  applyRtkCompression,
  detectCodeLanguage,
  stripCode,
} from "../../../open-sse/services/compression/index.ts";


id: import:2c3a3e3c19c0ee508dc98b721d13a16d
kind: import
name: ../../../open-sse/services/compression/index.ts
qualified_name: ../../../open-sse/services/compression/index.ts
file_path: tests/unit/compression/rtk-command-detector.test.ts
language: typescript
signature:
import {
  detectCommandOutput,
  detectCommandType,
} from "../../../open-sse/services/compression/index.ts";


id: import:d2a3eb93c77b79b474159fd68797122f
kind: import
name: ../../../open-sse/services/compression/index.ts
qualified_name: ../../../open-sse/services/compression/index.ts
file_path: tests/unit/compression/rtk-custom-filters.test.ts
language: typescript
signature:
import {
  getRtkFilterLoadDiagnostics,
  getRtkFilterCatalog,
  loadRtkFilters,
  matchRtkFilter,
} from "../../../open-sse/services/compression/index.ts";


id: import:a4464ee940399629c003d8cb93584f0e
kind: import
name: ../../../open-sse/services/compression/engines/rtk/deduplicator.ts
qualified_name: ../../../open-sse/services/compression/engines/rtk/deduplicator.ts
file_path: tests/unit/compression/rtk-deduplicator.test.ts
language: typescript
signature:
import { deduplicateRepeatedLines } from "../../../open-sse/services/compression/engines/rtk/deduplicator.ts";


id: import:7aaae11bdda7a03cd9f863467d0635c1
kind: import
name: ../../../open-sse/services/compression/engines/rtk/filterSchema.ts
qualified_name: ../../../open-sse/services/compression/engines/rtk/filterSchema.ts
file_path: tests/unit/compression/rtk-dsl-pipeline.test.ts
language: typescript
signature:
import { validateRtkFilter } from "../../../open-sse/services/compression/engines/rtk/filterSchema.ts";


id: import:b960c676424148795c29c0bf3cfa63f1
kind: import
name: ../../../open-sse/services/compression/index.ts
qualified_name: ../../../open-sse/services/compression/index.ts
file_path: tests/unit/compression/rtk-engine.test.ts
language: typescript
signature:
import {
  detectCommandType,
  loadRtkFilters,
  matchRtkFilter,
  processRtkText,
  applyRtkCompression,
  rtkEngine,
} from "../../../open-sse/services/compression/index.ts";


id: import:f2fd9e7bf9852bc0fd164bc6e259f3a3
kind: import
name: ../../../open-sse/services/compression/index.ts
qualified_name: ../../../open-sse/services/compression/index.ts
file_path: tests/unit/compression/rtk-filter-catalog.test.ts
language: typescript
signature:
import {
  loadRtkFilters,
  matchRtkFilter,
  runRtkFilterTests,
} from "../../../open-sse/services/compression/index.ts";


id: constant:835cd5e22cd412b5528845113a83ceba
kind: constant
name: FILTER_DIR
qualified_name: FILTER_DIR
file_path: tests/unit/compression/rtk-filter-catalog.test.ts
language: typescript
signature:
= path.join(
  process.cwd(),
  "open-sse",
  "services",
  "compression",
  "engines",
  "rtk",
  "fi...


id: constant:77cb9445ea9c3276f9d23c7c0f37225c
kind: constant
name: PLANNED_FILTERS
qualified_name: PLANNED_FILTERS
file_path: tests/unit/compression/rtk-filter-catalog.test.ts
language: typescript
signature:
= [
  "rubocop",
  "aws",
  "gcloud",
  "ssh",
  "rsync",
  "curl",
  "wget",
  "ps",
  "df",
  "du",
...


id: constant:23388b4433f830e0295db3b34c6dcb43
kind: constant
name: MATCH_CASES
qualified_name: MATCH_CASES
file_path: tests/unit/compression/rtk-filter-catalog.test.ts
language: typescript
signature:
= [
  [
    "rubocop",
    "app/models/user.rb:12:3: C: Style/IfUnlessModifier: Favor modifier if usag...


id: import:c447a3fd7d575e55c4b15422e7b04edd
kind: import
name: ../../../open-sse/services/compression/index.ts
qualified_name: ../../../open-sse/services/compression/index.ts
file_path: tests/unit/compression/rtk-raw-output.test.ts
language: typescript
signature:
import {
  applyCompression,
  maybePersistRtkRawOutput,
  processRtkText,
  readRtkRawOutput,
  redactRtkRawOutput,
} from "../../../open-sse/services/compression/index.ts";


id: import:ec67e8a98c8d6e5b9acf479ad2cbc149
kind: import
name: ../../../open-sse/services/compression/engines/rtk/smartTruncate.ts
qualified_name: ../../../open-sse/services/compression/engines/rtk/smartTruncate.ts
file_path: tests/unit/compression/rtk-smart-truncate.test.ts
language: typescript
signature:
import { smartTruncate } from "../../../open-sse/services/compression/engines/rtk/smartTruncate.ts";


id: import:c6926c5244c278600bc341a053077fb0
kind: import
name: ../../../open-sse/services/compression/index.ts
qualified_name: ../../../open-sse/services/compression/index.ts
file_path: tests/unit/compression/rtk-verify.test.ts
language: typescript
signature:
import { loadRtkFilters, runRtkFilterTests } from "../../../open-sse/services/compression/index.ts";


id: constant:4d968a6427bc31c63aa5ed94105fb85b
kind: constant
name: PARITY_FILTER_IDS
qualified_name: PARITY_FILTER_IDS
file_path: tests/unit/compression/rtk-verify.test.ts
language: typescript
signature:
= [
  "git-branch",
  "make",
  "terraform-plan",
  "tofu-plan",
  "docker-logs",
  "systemctl-status"...


id: import:0b682527195491e937e3eaa460b7ac91
kind: import
name: ../../../open-sse/services/compression/index.ts
qualified_name: ../../../open-sse/services/compression/index.ts
file_path: tests/unit/compression/rule-loader.test.ts
language: typescript
signature:
import {
  getAvailableLanguagePacks,
  loadAllRulesForLanguage,
  loadRulePack,
  validateRulePack,
} from "../../../open-sse/services/compression/index.ts";


id: import:52eb92113f8e07a73ff8b070f6bd6a12
kind: import
name: ../../../open-sse/services/compression/stats.ts
qualified_name: ../../../open-sse/services/compression/stats.ts
file_path: tests/unit/compression/stats.test.ts
language: typescript
signature:
import {
  estimateCompressionTokens,
  createCompressionStats,
  trackCompressionStats,
} from "../../../open-sse/services/compression/stats.ts";


id: import:2345207908e4ee9b2f241457baa4de99
kind: import
name: ../../../open-sse/services/compression/strategySelector.ts
qualified_name: ../../../open-sse/services/compression/strategySelector.ts
file_path: tests/unit/compression/strategySelector.test.ts
language: typescript
signature:
import {
  selectCompressionStrategy,
  getEffectiveMode,
  applyCompression,
  checkComboOverride,
  shouldAutoTrigger,
} from "../../../open-sse/services/compression/strategySelector.ts";


id: import:cbfe41688e24feadd4f42d82b411548e
kind: import
name: ../../../open-sse/services/compression/summarizer.ts
qualified_name: ../../../open-sse/services/compression/summarizer.ts
file_path: tests/unit/compression/summarizer.test.ts
language: typescript
signature:
import {
  RuleBasedSummarizer,
  createSummarizer,
} from "../../../open-sse/services/compression/summarizer.ts";


id: import:8f8938af8258f3b59a30dbdfbd012858
kind: import
name: ../../../open-sse/services/compression/toolResultCompressor.ts
qualified_name: ../../../open-sse/services/compression/toolResultCompressor.ts
file_path: tests/unit/compression/toolResultCompressor.test.ts
language: typescript
signature:
import { compressToolResult } from "../../../open-sse/services/compression/toolResultCompressor.ts";


id: constant:26790bf9a91d4a43518ae0117999ab52
kind: constant
name: ALL_ON
qualified_name: ALL_ON
file_path: tests/unit/compression/toolResultCompressor.test.ts
language: typescript
signature:
= {
  fileContent: true,
  grepSearch: true,
  shellOutput: true,
  json: true,
  errorMessage: true,
...


id: import:ccad70dd9e187ee3c22276f955550bef
kind: import
name: ../../../open-sse/services/compression/types.ts
qualified_name: ../../../open-sse/services/compression/types.ts
file_path: tests/unit/compression/types.test.ts
language: typescript
signature:
import {
  DEFAULT_AGGRESSIVE_CONFIG,
  DEFAULT_COMPRESSION_CONFIG,
  DEFAULT_ULTRA_CONFIG,
} from "../../../open-sse/services/compression/types.ts";


id: import:a8f72727624a8281042d3d17a1d95ad4
kind: import
name: ../../../open-sse/services/compression/types.ts
qualified_name: ../../../open-sse/services/compression/types.ts
file_path: tests/unit/compression/types.test.ts
language: typescript
signature:
import type {
  AggressiveConfig,
  AgingThresholds,
  ToolStrategiesConfig,
  SummarizerOpts,
  Summarizer,
  CompressionMode,
  CompressionStats,
  CompressionConfig,
  UltraConfig,
} from "../../../open-sse/services/compression/types.ts";


id: import:b8e12d63e75c98192f302d355bc75b5c
kind: import
name: ../../../open-sse/services/compression/ultraHeuristic.ts
qualified_name: ../../../open-sse/services/compression/ultraHeuristic.ts
file_path: tests/unit/compression/ultra.test.ts
language: typescript
signature:
import {
  scoreToken,
  pruneByScore,
  STOPWORDS,
  FORCE_PRESERVE_RE,
} from "../../../open-sse/services/compression/ultraHeuristic.ts";


id: import:ba71d8d487e0eb3b3f8bf766e4741147
kind: import
name: ../../../open-sse/services/compression/ultra.ts
qualified_name: ../../../open-sse/services/compression/ultra.ts
file_path: tests/unit/compression/ultra.test.ts
language: typescript
signature:
import {
  ultraCompress,
  createSLMStub,
  type SLMInterface,
} from "../../../open-sse/services/compression/ultra.ts";


id: import:bca33f6ee1a82ee41c5654c32a0ef44c
kind: import
name: ../../../open-sse/services/compression/preservation.ts
qualified_name: ../../../open-sse/services/compression/preservation.ts
file_path: tests/unit/compression/validation.test.ts
language: typescript
signature:
import {
  extractPreservedBlocks,
  restorePreservedBlocks,
} from "../../../open-sse/services/compression/preservation.ts";


id: import:c842c2d5e0495c23275e8f70b0c36fad
kind: import
name: ../../src/domain/connectionModelRules.ts
qualified_name: ../../src/domain/connectionModelRules.ts
file_path: tests/unit/connection-model-rules.test.ts
language: typescript
signature:
import {
  getConnectionExcludedModels,
  hasEligibleConnectionForModel,
  isModelExcludedByConnection,
  normalizeExcludedModelPatterns,
} from "../../src/domain/connectionModelRules.ts";


id: import:342a627788028f0152c8e5ec94a119a9
kind: import
name: ../../open-sse/services/comboAgentMiddleware.ts
qualified_name: ../../open-sse/services/comboAgentMiddleware.ts
file_path: tests/unit/context-pinning-tool-calls.test.ts
language: typescript
signature:
import {
  injectModelTag,
  extractPinnedModel,
} from "../../open-sse/services/comboAgentMiddleware.ts";


id: import:6e07865e44d6a8f1c17db6ac4de214f5
kind: import
name: ../../../src/server/cors/origins
qualified_name: ../../../src/server/cors/origins
file_path: tests/unit/cors/origins.test.ts
language: typescript
signature:
import {
  applyCorsHeaders,
  resolveAllowedOrigin,
  setRuntimeAllowedOrigins,
  STATIC_CORS_HEADERS,
} from "../../../src/server/cors/origins";


id: import:35106a0c3b0392058a3eae8e7cc90e34
kind: import
name: ../../open-sse/utils/cursorAgentProtobuf
qualified_name: ../../open-sse/utils/cursorAgentProtobuf
file_path: tests/unit/cursor-agent-exec-router.test.ts
language: typescript
signature:
import {
  decodeExecServerEvent,
  iterateConnectFrames,
  wrapConnectFrame,
} from "../../open-sse/utils/cursorAgentProtobuf";


id: function:a2cfb1a3e1e2007d2c3284505ef829a8
kind: function
name: v
qualified_name: v
file_path: tests/unit/cursor-agent-exec-router.test.ts
language: typescript
signature: (n: number): Buffer
docstring:
─── Wire-format helpers (match the encoder's primitives) ──────────────────

We synthesize ExecServerMessage payloads for each variant and assert
decodeExecServerEvent returns the right kind + extracted fields. This
validates the decoder against the field-number contract independently of
the encoder (which runs the same code path in different test files).


id: import:3d6bfded3ada5249c0795fe3841ee54e
kind: import
name: ../../src/lib/providerModels/cursorAgent
qualified_name: ../../src/lib/providerModels/cursorAgent
file_path: tests/unit/cursor-agent-models.test.ts
language: typescript
signature:
import {
  humanizeCursorModelId,
  parseCursorAgentModels,
} from "../../src/lib/providerModels/cursorAgent";


id: import:a6c2953fcc96aa067311fd7b20939fa2
kind: import
name: ../../open-sse/utils/cursorAgentProtobuf
qualified_name: ../../open-sse/utils/cursorAgentProtobuf
file_path: tests/unit/cursor-agent-protobuf.test.ts
language: typescript
signature:
import {
  resolveRequestedModel,
  encodeAgentRunRequest,
  buildAgentRequestBody,
  iterateConnectFrames,
  decodeAgentServerMessage,
  flattenMessages,
  wrapConnectFrame,
  encodeExecReadRejected,
  encodeExecWriteRejected,
  encodeExecDeleteRejected,
  encodeExecLsRejected,
  encodeExecShellRejected,
  encodeExecBackgroundShellSpawnRejected,
  encodeExecGrepError,
  encodeExecFetchError,
  encodeExecWriteShellStdinError,
  encodeExecDiagnosticsResult,
  encodeExecMcpResult,
  encodeExecMcpError,
  encodeKvGetBlobResult,
  encodeKvSetBlobResult,
  encodeMcpToolDefinitionBody,
  jsonSchemaToProtobufValue,
  encodeRequestContextResponse,
  openAIToolsToMcpDefs,
} from "../../open-sse/utils/cursorAgentProtobuf";


id: function:1c332e073c0105bef7dc5128687b52b2
kind: function
name: unwrapFrame
qualified_name: unwrapFrame
file_path: tests/unit/cursor-agent-protobuf.test.ts
language: typescript
signature: (buf: Buffer): Buffer
docstring:
─── Phase 1: rejection encoders ───────────────────────────────────────────

All ExecClientMessage frames share a structure:
wrapConnectFrame(
AgentClientMessage {
exec_client_message (2): ExecClientMessage {
id (1): execMsgId,
exec_id (15): execId,
<result_field>: <result_payload>,
}
}
)

We unwrap via decodeFields and assert: (1) framing is valid, (2) the
ExecClientMessage carries the right id+exec_id, (3) the result field
number matches the variant, (4) the payload bytes contain the rejection
reason as a substring (sufficient since Buffer.from(reason, "utf8") is
embedded verbatim by encodeString).


id: function:3e5325dfda704b08d14c96cb8f2d847c
kind: function
name: assertEcmShape
qualified_name: assertEcmShape
file_path: tests/unit/cursor-agent-protobuf.test.ts
language: typescript
signature:
(
  framed: Buffer,
  expectedExecMsgId: number,
  expectedExecId: string,
  expectedResultField: number
)


id: import:606814cad12a54d748de7f2676e9fe22
kind: import
name: ../../open-sse/services/cursorSessionManager
qualified_name: ../../open-sse/services/cursorSessionManager
file_path: tests/unit/cursor-agent-session.test.ts
language: typescript
signature:
import {
  CursorSessionManager,
  type CursorSession,
} from "../../open-sse/services/cursorSessionManager";


id: type_alias:ce16a638ab303e9ba98791d331a0b460
kind: type_alias
name: WriteCall
qualified_name: WriteCall
file_path: tests/unit/cursor-agent-session.test.ts
language: typescript
docstring:
─── Test doubles for h2 ───────────────────────────────────────────────────

We don't open real h2 connections in unit tests. Sessions hold opaque
references that the manager only ever .close()s or .write()s through
encodeExecMcpResult. A pair of stubs is enough.


id: import:8864c6f9f5092279b1f4bef2345ea7b5
kind: import
name: ../../open-sse/utils/cursorAgentProtobuf
qualified_name: ../../open-sse/utils/cursorAgentProtobuf
file_path: tests/unit/cursor-agent-system-prompt.test.ts
language: typescript
signature:
import {
  encodeAgentRunRequest,
  decodeKvServerEvent,
} from "../../open-sse/utils/cursorAgentProtobuf";


id: import:72583167c076f7347fdbbceec1e2b4cb
kind: import
name: ../../open-sse/utils/cursorAgentProtobuf
qualified_name: ../../open-sse/utils/cursorAgentProtobuf
file_path: tests/unit/cursor-agent-tool-calls.test.ts
language: typescript
signature:
import {
  decodeExecServerEvent,
  decodeProtobufValue,
  jsonSchemaToProtobufValue,
} from "../../open-sse/utils/cursorAgentProtobuf";


id: function:9b08d38122ab65a338da51feb679dabf
kind: function
name: buildMcpArgsEvent
qualified_name: buildMcpArgsEvent
file_path: tests/unit/cursor-agent-tool-calls.test.ts
language: typescript
docstring: AgentServerMessage { exec_server_message (2): ESM { id, exec_id, mcp_args (11): ... } }
signature:
(
  execMsgId: number,
  execId: string,
  toolName: string,
  toolCallId: string,
  args: Record<string, unknown>
): Buffer


id: function:904b368251965a1311f31b2da6a44824
kind: function
name: parseChunk
qualified_name: parseChunk
file_path: tests/unit/cursor-agent-tool-calls.test.ts
language: typescript
docstring: ─── Streaming SSE tool_calls emission ─────────────────────────────────────
signature:
(line: string): {
  delta?: {
    tool_calls?: Array<{
      index: number;
      id?: string;
      function?: { name?: string; arguments?: string };
    }>;
  };
  finish_reason?: string | null;
}


id: import:b28b09ad81b69f8a5db615e583c78c3a
kind: import
name: ../../open-sse/executors/cursor
qualified_name: ../../open-sse/executors/cursor
file_path: tests/unit/cursor-streaming.test.ts
language: typescript
signature:
import {
  newStreamCtx,
  processFrame,
  buildCursorUsage,
  type StreamCtx,
} from "../../open-sse/executors/cursor";


id: constant:62af036712ba032a6f1b54a2d691698d
kind: constant
name: SAMPLE_RESPONSE
qualified_name: SAMPLE_RESPONSE
file_path: tests/unit/cursor-usage-fetcher.test.ts
language: typescript
signature:
= {
  billingCycleStart: "1776672371000",
  billingCycleEnd: "1779264371000",
  planUsage: {
    total...


id: function:a0b724015f0e953cee362cae0e17af8a
kind: function
name: installFetchMock
qualified_name: installFetchMock
file_path: tests/unit/cursor-usage-fetcher.test.ts
language: typescript
signature:
(
  responder: (url: string, init: RequestInit) => Response | Promise<Response>
): { restore: () => void; calls: CapturedRequest[] }


id: import:1bf58234106a43df41c8be3ff5c51ac4
kind: import
name: ../../src/app/(dashboard)/dashboard/cli-tools/components/customCliConfig.ts
qualified_name: ../../src/app/(dashboard)/dashboard/cli-tools/components/customCliConfig.ts
file_path: tests/unit/custom-cli-config.test.ts
language: typescript
signature:
import {
  buildAliasEnvVar,
  buildCustomCliEnvScript,
  buildCustomCliJsonConfig,
  normalizeOpenAiBaseUrl,
} from "../../src/app/(dashboard)/dashboard/cli-tools/components/customCliConfig.ts";


id: function:35a46f5135c80c90a6ffcd136c30c24b
kind: function
name: buildUrlOpenAI
qualified_name: buildUrlOpenAI
file_path: tests/unit/custom-endpoint-paths.test.ts
language: typescript
signature: (_provider, credentials)
docstring:
Inline buildUrl logic from DefaultExecutor for unit testing
(avoids importing ESM modules with complex dependency chains)


id: constant:8c4cd3f080867f2a27f1abed4ee271de
kind: constant
name: originalEnv
qualified_name: originalEnv
file_path: tests/unit/db-core-init.test.ts
language: typescript
signature:
= {
  DATA_DIR: process.env.DATA_DIR,
  NEXT_PHASE: process.env.NEXT_PHASE,
  HOME: process.env.HOME,
...


id: constant:c8f5e7f3f54e63c397d0188e5ef466a0
kind: constant
name: SCHEMA
qualified_name: SCHEMA
file_path: tests/unit/db-upstreamProxy.test.ts
language: typescript
signature:
= `
CREATE TABLE IF NOT EXISTS upstream_proxy_config (
  id                        INTEGER PRIMARY KEY...


id: constant:49648590b28eef8601e2e8aad64fdbe0
kind: constant
name: SCHEMA
qualified_name: SCHEMA
file_path: tests/unit/db-versionManager.test.ts
language: typescript
signature:
= `
CREATE TABLE IF NOT EXISTS version_manager (
  id                INTEGER PRIMARY KEY AUTOINCREMENT...


id: import:dfef772959add188752018a37131dfcc
kind: import
name: ../../open-sse/services/deepseekQuotaFetcher.ts
qualified_name: ../../open-sse/services/deepseekQuotaFetcher.ts
file_path: tests/unit/deepseek-quota-fetcher.test.ts
language: typescript
signature:
import {
  fetchDeepseekQuota,
  invalidateDeepseekQuotaCache,
  registerDeepseekQuotaFetcher,
} from "../../open-sse/services/deepseekQuotaFetcher.ts";


id: constant:34f6e84bc029383e5ce5b987294cb24b
kind: constant
name: REQUIRED_DOCS
qualified_name: REQUIRED_DOCS
file_path: tests/unit/dockerignore-docs-coverage.test.ts
language: typescript
docstring:
Subset of the docs viewer's catalog that MUST survive the docker filter.
Sourced from src/app/docs/lib/docs-auto-generated.ts.

signature:
= [
  "docs/README.md",
  "docs/PROVIDERS.md",
  "docs/AUTO-COMBO.md",
  "docs/guides/SETUP_GUIDE.md",...


id: function:f2b76ba78857355ddd56e327cc17f034
kind: function
name: parseDockerignore
qualified_name: parseDockerignore
file_path: tests/unit/dockerignore-docs-coverage.test.ts
language: typescript
signature: (text: string): { excludes: string[]; includes: string[] }
docstring:
Compile .dockerignore patterns into a simple matcher.
We only need to support the directives we actually use: glob `**`, plain
path prefixes, and negations starting with `!`.


id: function:f56d05a85666ad15d0b48ebca0d2665e
kind: function
name: patternMatches
qualified_name: patternMatches
file_path: tests/unit/dockerignore-docs-coverage.test.ts
language: typescript
signature: (pattern: string, file: string): boolean
docstring:
Match a Docker glob pattern against a file path without building a dynamic
RegExp (avoid ReDoS risk on patterns sourced from .dockerignore). We walk
the pattern token-by-token. Supported syntax (the subset our .dockerignore
actually uses): literal segments, `*` (no slash), `**` (any depth incl. 0),
and trailing `**`.


id: import:bada6f4fe15aa4b0d3bfc6b1b7dfd8e4
kind: import
name: ../../scripts/dev/smoke-electron-packaged.mjs
qualified_name: ../../scripts/dev/smoke-electron-packaged.mjs
file_path: tests/unit/electron-smoke-script.test.ts
language: typescript
signature:
import {
  buildSmokeEnv,
  FATAL_LOG_PATTERNS,
  LINUX_EXECUTABLE_NAMES,
} from "../../scripts/dev/smoke-electron-packaged.mjs";


id: import:1cd4446c561b60ef8987fa527afcb26d
kind: import
name: ../../open-sse/config/embeddingRegistry.ts
qualified_name: ../../open-sse/config/embeddingRegistry.ts
file_path: tests/unit/embedding-rerank-provider-registry.test.ts
language: typescript
signature:
import {
  getAllEmbeddingModels,
  getEmbeddingProvider,
  parseEmbeddingModel,
} from "../../open-sse/config/embeddingRegistry.ts";


id: import:7e03e530afea42a534bb684a707f6db7
kind: import
name: ../../open-sse/config/rerankRegistry.ts
qualified_name: ../../open-sse/config/rerankRegistry.ts
file_path: tests/unit/embedding-rerank-provider-registry.test.ts
language: typescript
signature:
import {
  getAllRerankModels,
  getRerankProvider,
  parseRerankModel,
} from "../../open-sse/config/rerankRegistry.ts";


id: import:bfc6d8eef34f612b1a3541209c345495
kind: import
name: ../../open-sse/services/antigravityHeaderScrub.ts
qualified_name: ../../open-sse/services/antigravityHeaderScrub.ts
file_path: tests/unit/executor-antigravity.test.ts
language: typescript
signature:
import { scrubProxyAndFingerprintHeaders } from "../../open-sse/services/antigravityHeaderScrub.ts";


id: import:e1e2eed4e835b51e4e45655fb6de2cb4
kind: import
name: ../../open-sse/services/antigravityVersion.ts
qualified_name: ../../open-sse/services/antigravityVersion.ts
file_path: tests/unit/executor-antigravity.test.ts
language: typescript
signature:
import {
  clearAntigravityVersionCache,
  seedAntigravityVersionCache,
} from "../../open-sse/services/antigravityVersion.ts";


id: import:2ddb2701fd3bd021310ad429ab35d44c
kind: import
name: ../../open-sse/services/antigravityProjectBootstrap.ts
qualified_name: ../../open-sse/services/antigravityProjectBootstrap.ts
file_path: tests/unit/executor-antigravity.test.ts
language: typescript
signature:
import { clearAntigravityProjectCache } from "../../open-sse/services/antigravityProjectBootstrap.ts";


id: import:63f71e35ffec2ace99cd4dcae7911fbb
kind: import
name: ../../open-sse/executors/codex.ts
qualified_name: ../../open-sse/executors/codex.ts
file_path: tests/unit/executor-codex.test.ts
language: typescript
signature:
import {
  CodexExecutor,
  __setCodexWebSocketTransportForTesting,
  encodeResponseSseEvent,
  getCodexModelScope,
  getCodexRateLimitKey,
  getCodexResetTime,
  getCodexUpstreamModel,
  isCodexResponsesWebSocketRequired,
  parseCodexQuotaHeaders,
} from "../../open-sse/executors/codex.ts";


id: import:02c1b3be65a3aec267bd98eb67bfe0c4
kind: import
name: ../../open-sse/services/thinkingBudget.ts
qualified_name: ../../open-sse/services/thinkingBudget.ts
file_path: tests/unit/executor-codex.test.ts
language: typescript
signature:
import {
  DEFAULT_THINKING_CONFIG,
  setThinkingBudgetConfig,
  ThinkingMode,
} from "../../open-sse/services/thinkingBudget.ts";


id: import:eb81c3bd030d0ba326f5c9bf0d6c6e0a
kind: import
name: ../../open-sse/executors/base.ts
qualified_name: ../../open-sse/executors/base.ts
file_path: tests/unit/executor-default-base.test.ts
language: typescript
signature:
import {
  applyConfiguredUserAgent,
  BaseExecutor,
  getCustomUserAgent,
  mergeAbortSignals,
  mergeUpstreamExtraHeaders,
  setUserAgentHeader,
} from "../../open-sse/executors/base.ts";


id: import:26c08994c29c26d02d02b2bb6b38f979
kind: import
name: ../../open-sse/services/claudeCodeCompatible.ts
qualified_name: ../../open-sse/services/claudeCodeCompatible.ts
file_path: tests/unit/executor-default-base.test.ts
language: typescript
signature:
import {
  CLAUDE_CODE_COMPATIBLE_ANTHROPIC_VERSION,
  CLAUDE_CODE_COMPATIBLE_DEFAULT_CHAT_PATH,
  CONTEXT_1M_BETA_HEADER,
} from "../../open-sse/services/claudeCodeCompatible.ts";


id: function:22ba4aede9ffcf12c1905be375bbfa0a
kind: function
name: createServiceAccountJson
qualified_name: createServiceAccountJson
file_path: tests/unit/executor-vertex-extended.test.ts
language: typescript
signature:
({
  projectId = "vertex-project-123",
  includeProjectId = true,
  includeEmail = true,
  includePrivateKey = true,
} = {})


id: import:7abb5bf3ebd70ee2e0bed29eb46ddcf7
kind: import
name: ../../../src/lib/gamification/invites
qualified_name: ../../../src/lib/gamification/invites
file_path: tests/unit/gamification/invites.test.ts
language: typescript
signature:
import {
  createInvite,
  redeemInvite,
  listInvites,
  revokeInvite,
} from "../../../src/lib/gamification/invites";


id: import:ffdaa5c3d3508cf2880be80fd0bd58cf
kind: import
name: ../../../src/lib/gamification/leaderboard
qualified_name: ../../../src/lib/gamification/leaderboard
file_path: tests/unit/gamification/leaderboard.test.ts
language: typescript
signature:
import {
  updateScore,
  getRank,
  getTopN,
  getNeighbors,
} from "../../../src/lib/gamification/leaderboard";


id: import:3cd3263a0c8c5092276075f9ee869760
kind: import
name: ../../../src/lib/gamification/xp
qualified_name: ../../../src/lib/gamification/xp
file_path: tests/unit/gamification/xp.test.ts
language: typescript
signature:
import {
  calculateLevel,
  xpForLevel,
  cumulativeXpForLevel,
  xpToNextLevel,
  getLevelTitle,
  getLevelTier,
  XP_REWARDS,
} from "../../../src/lib/gamification/xp";


id: function:7ebb199a989eab15b7bf916b8a3fd488
kind: function
name: parseGeminiAuthLocal
qualified_name: parseGeminiAuthLocal
file_path: tests/unit/gemini-import-route.test.ts
language: typescript
docstring:
Inline parse logic (mirrors parseAndValidateGeminiAuth) to allow pure-logic tests
without importing DB-coupled modules.

signature:
(raw: unknown): {
  accessToken: string;
  refreshToken: string;
  idToken: string;
  scope: string;
  tokenType: string;
  expiresAt: string | null;
  email: string | null;
}


id: constant:b64f56f5828f5e82414ec143e33e69eb
kind: constant
name: SIMPLE_RESPONSE
qualified_name: SIMPLE_RESPONSE
file_path: tests/unit/grok-web.test.ts
language: typescript
signature:
= [
  { result: { response: { token: "Hello" } } },
  { result: { response: { token: " world!" } } },
...


id: import:0b8fd69dabe0092cd06a506185333848
kind: import
name: ../../src/lib/guardrails/index.ts
qualified_name: ../../src/lib/guardrails/index.ts
file_path: tests/unit/guardrails-registry.test.ts
language: typescript
signature:
import {
  BaseGuardrail,
  GuardrailRegistry,
  PIIMaskerGuardrail,
  PromptInjectionGuardrail,
  resolveDisabledGuardrails,
} from "../../src/lib/guardrails/index.ts";


id: variable:183defc31ba5b456639f662f2b36c046
kind: variable
name: mockSettings
qualified_name: mockSettings
file_path: tests/unit/guardrails/visionBridge.test.ts
language: typescript
docstring: ── Mock state ──────────────────────────────────────────────────────────────
signature:
= {
  visionBridgeEnabled: true,
  visionBridgeModel: "openai/gpt-4o-mini",
  visionBridgePrompt: "Des...


id: constant:c62f00346c07762294511b1476321a41
kind: constant
name: EN
qualified_name: EN
file_path: tests/unit/i18n-quota-share-english.test.ts
language: typescript
signature:
= path.join(
  path.dirname(fileURLToPath(import.meta.url)),
  "..",
  "..",
  "src",
  "i18n",
  "mes...


id: constant:5fbc34353614164a8cbdedce65cd4e2b
kind: constant
name: PT_MARKERS
qualified_name: PT_MARKERS
file_path: tests/unit/i18n-quota-share-english.test.ts
language: typescript
signature: = /configuração|não persiste|aplicação|divisão|cota|salva em/i
docstring:
Regression for #2540: the English source-of-truth (en.json) had Portuguese values for the
quota-share Beta strings, which then propagated to every locale as __MISSING__ placeholders
and surfaced as Portuguese on /dashboard/costs/quota-share. Guard that these stay English.


id: import:9b3337cf1b85d6ba62302ec32fb0ffd7
kind: import
name: ../../src/lib/idempotencyLayer.ts
qualified_name: ../../src/lib/idempotencyLayer.ts
file_path: tests/unit/idempotency.test.ts
language: typescript
signature:
import {
  getIdempotencyKey,
  checkIdempotency,
  saveIdempotency,
  clearIdempotency,
  getIdempotencyStats,
} from "../../src/lib/idempotencyLayer.ts";


id: function:3c9de4238ae3bf7acc10a5cb64a6d482
kind: function
name: buildFetchMock
qualified_name: buildFetchMock
file_path: tests/unit/kiro-multi-account-isolation.test.ts
language: typescript
signature: (registration: { clientId: string; clientSecret: string; clientSecretExpiresAt?: number; })
docstring:
Build a fetch mock that handles:
 - /token  → returns a minimal token refresh response
 - /client/register → returns the given registration pair


id: function:458d398d399f004e8807e557ecd1ccc4
kind: function
name: flushBackgroundWork
qualified_name: flushBackgroundWork
file_path: tests/unit/limiter-lifecycle.test.ts
language: typescript
signature: ()
docstring:
Flush lingering microtasks and Bottleneck yieldLoop(0) timers after each test.
Without this, leftover timers from a previous test's _free→_drainAll chain can
interleave with the next test's Bottleneck timer chain, causing timing-sensitive
IPC deserialization failures in Node.js v24 test runner subprocesses.
Pattern borrowed from rate-limit-manager.test.ts.


id: import:1c6b9e5acaef5af521060e156ce9238b
kind: import
name: fs
qualified_name: fs
file_path: tests/unit/log-rotation.test.ts
language: typescript
signature:
import {
  existsSync,
  mkdirSync,
  writeFileSync,
  unlinkSync,
  readdirSync,
  mkdtempSync,
  rmdirSync,
} from "fs";


id: import:08fd7fb1b8bd6d953cd38065145e902e
kind: import
name: ../../src/shared/utils/maskEmail.ts
qualified_name: ../../src/shared/utils/maskEmail.ts
file_path: tests/unit/mask-email.test.ts
language: typescript
signature:
import {
  maskEmail,
  maskEmailLikeValue,
  pickDisplayValue,
  pickMaskedDisplayValue,
} from "../../src/shared/utils/maskEmail.ts";


id: constant:91317fc05730472aa88f46cc1c5b15d5
kind: constant
name: testMemories
qualified_name: testMemories
file_path: tests/unit/memory-glm-injection.test.ts
language: typescript
signature:
= [
  {
    id: "mem-1",
    content: "User prefers dark mode",
    type: "factual" as any,
    apiKey...


id: import:e133d2dc3a3c81623d3c2f447ddf0513
kind: import
name: ../../src/lib/memory/settings.ts
qualified_name: ../../src/lib/memory/settings.ts
file_path: tests/unit/memory-settings.test.ts
language: typescript
signature:
import {
  DEFAULT_MEMORY_SETTINGS,
  normalizeMemorySettings,
  toMemoryRetrievalConfig,
  toMemorySettingsUpdates,
} from "../../src/lib/memory/settings.ts";


id: function:7a468299105e37c5efe80abe985a6bde
kind: function
name: estimateTokens
qualified_name: estimateTokens
file_path: tests/unit/memory-stats-api.test.ts
language: typescript
signature: (text: string): number
docstring:
We import the pure function directly from the source module.
estimateTokens lives in src/lib/memory/retrieval.ts but the module
has heavy DB dependencies at the top level.  We replicate the pure
function here to test the exact algorithm used by the route handler.
Exact replica of estimateTokens from src/lib/memory/retrieval.ts:34-37
so the test does not pull in the full DB/SQLite dependency graph.


id: function:663fe19e2b0a92f0ce754c83dffe0218
kind: function
name: insertMemoryRow
qualified_name: insertMemoryRow
file_path: tests/unit/memory-store.test.ts
language: typescript
signature:
({
  id,
  apiKeyId = "key-a",
  sessionId = "session-a",
  type = "factual",
  key = "memory:key",
  content = "stored content",
  metadata = "{}",
  createdAt = new Date().toISOString(),
  updatedAt = createdAt,
  expiresAt = null,
})


id: import:129c0cc3b72d7be9dc2a124da4398000
kind: import
name: ../../src/shared/utils/modelCatalogSearch.ts
qualified_name: ../../src/shared/utils/modelCatalogSearch.ts
file_path: tests/unit/model-catalog-search.test.ts
language: typescript
signature:
import {
  getModelCatalogSourceLabel,
  matchesModelCatalogQuery,
  normalizeModelCatalogSource,
} from "../../src/shared/utils/modelCatalogSearch.ts";


id: function:9bc85be874202c9150031cefd1e9b534
kind: function
name: globToRegex
qualified_name: globToRegex
file_path: tests/unit/model-combo-mappings.test.ts
language: typescript
signature: (pattern)
docstring:
──────────────────────────────────────────────────────────
Inline glob-to-regex (same logic as modelComboMappings.ts)
──────────────────────────────────────────────────────────


id: import:3695d9a0f4e4a7edda78e827fe0bad7c
kind: import
name: ../../src/domain/modelAvailability.ts
qualified_name: ../../src/domain/modelAvailability.ts
file_path: tests/unit/model-cooldowns-route.test.ts
language: typescript
signature:
import {
  getAvailabilityReport,
  clearModelUnavailability,
  resetAllAvailability,
} from "../../src/domain/modelAvailability.ts";


id: import:6ea01c9dea5779c2d46b4113f73fa51a
kind: import
name: ../../open-sse/services/modelStrip.ts
qualified_name: ../../open-sse/services/modelStrip.ts
file_path: tests/unit/model-strip.test.ts
language: typescript
signature:
import {
  getStripTypesForProviderModel,
  stripIncompatibleMessageContent,
} from "../../open-sse/services/modelStrip.ts";


id: constant:f58051e93f0147f2c7e3c716a247c7dd
kind: constant
name: MOCK_MODELS_DEV_DATA
qualified_name: MOCK_MODELS_DEV_DATA
file_path: tests/unit/modelsDevSync-extended.test.ts
language: typescript
signature:
= {
  openai: {
    id: "openai",
    models: {
      "gpt-4o": {
        id: "gpt-4o",
        name: ...


id: import:302e4a493dd6755ea84044495262c76c
kind: import
name: ../../src/lib/modelsDevSync.ts
qualified_name: ../../src/lib/modelsDevSync.ts
file_path: tests/unit/modelsDevSync.test.ts
language: typescript
signature:
import {
  transformModelsDevToPricing,
  transformModelsDevToCapabilities,
  mapProviderId,
  fetchModelsDev,
} from "../../src/lib/modelsDevSync.ts";


id: constant:67f1430498eb50851511bb3e57f855f9
kind: constant
name: MOCK_MODELS_DEV_DATA
qualified_name: MOCK_MODELS_DEV_DATA
file_path: tests/unit/modelsDevSync.test.ts
language: typescript
docstring: ─── Mock data ───────────────────────────────────────────
signature:
= {
  openai: {
    id: "openai",
    name: "OpenAI",
    npm: "@ai-sdk/openai",
    env: ["OPENAI_API...


id: import:8f8ad053f16009716681a8f468bd36df
kind: import
name: ../../open-sse/executors/muse-spark-web.ts
qualified_name: ../../open-sse/executors/muse-spark-web.ts
file_path: tests/unit/muse-spark-web-continuation.test.ts
language: typescript
signature:
import {
  MuseSparkWebExecutor,
  __resetMuseSparkConversationCacheForTesting,
} from "../../open-sse/executors/muse-spark-web.ts";


id: function:05ebcc5f3be390723b7d106e619624ad
kind: function
name: metaAiSseResponse
qualified_name: metaAiSseResponse
file_path: tests/unit/muse-spark-web-continuation.test.ts
language: typescript
signature: (content: string): Response
docstring:
Canned Meta AI response shape. parseMetaAiResponseText accepts either a
plain JSON body or an SSE stream of `data: <json>` frames; we send a plain
JSON body since the assertions don't care about delta structure.


id: import:a754ee2e4fe1abfaae01d5c2068951d5
kind: import
name: ../../scripts/build/native-binary-compat.mjs
qualified_name: ../../scripts/build/native-binary-compat.mjs
file_path: tests/unit/native-binary-compat.test.ts
language: typescript
signature:
import {
  detectNativeBinaryTarget,
  isNativeBinaryCompatible,
} from "../../scripts/build/native-binary-compat.mjs";


id: import:24bab95ee643bf53c631b4c58573d905
kind: import
name: ../../src/shared/utils/nodeRuntimeSupport.ts
qualified_name: ../../src/shared/utils/nodeRuntimeSupport.ts
file_path: tests/unit/node-runtime-support.test.ts
language: typescript
signature:
import {
  SUPPORTED_NODE_RANGE,
  getNodeRuntimeSupport,
  getNodeRuntimeWarning,
  parseNodeVersion,
} from "../../src/shared/utils/nodeRuntimeSupport.ts";


id: import:3a8f5e7f71ad323a91e33376ac81f895
kind: import
name: ../../bin/nodeRuntimeSupport.mjs
qualified_name: ../../bin/nodeRuntimeSupport.mjs
file_path: tests/unit/node-runtime-support.test.ts
language: typescript
signature:
import {
  getNodeRuntimeSupport as getCliNodeRuntimeSupport,
  getNodeRuntimeWarning as getCliNodeRuntimeWarning,
} from "../../bin/nodeRuntimeSupport.mjs";


id: constant:26d28741e68d00867ee5b7e3c9abffce
kind: constant
name: originalEnv
qualified_name: originalEnv
file_path: tests/unit/oauth-providers-config.test.ts
language: typescript
signature: = { ...process.env }
docstring:
Gemini, Antigravity and Windsurf public defaults come from
open-sse/utils/publicCreds.ts — no env override needed in this suite.


id: constant:e80760b9148166e4376e54c57a9fd5fa
kind: constant
name: EXPECTED_PROVIDER_KEYS
qualified_name: EXPECTED_PROVIDER_KEYS
file_path: tests/unit/oauth-providers-config.test.ts
language: typescript
signature:
= [
  "claude",
  "codex",
  "gemini-cli",
  "antigravity",
  "qoder",
  "qwen",
  "kimi-coding",
  "g...


id: constant:5d2ed4830280af7140e223b9cace3f50
kind: constant
name: EXPECTED_CONFIG_BY_PROVIDER
qualified_name: EXPECTED_CONFIG_BY_PROVIDER
file_path: tests/unit/oauth-providers-config.test.ts
language: typescript
signature:
= {
  claude: CLAUDE_CONFIG,
  codex: CODEX_CONFIG,
  "gemini-cli": GEMINI_CONFIG,
  antigravity: ANTI...


id: constant:36b25b414c6758385ccb935ed1fb2182
kind: constant
name: REQUIRED_FIELDS_BY_PROVIDER
qualified_name: REQUIRED_FIELDS_BY_PROVIDER
file_path: tests/unit/oauth-providers-config.test.ts
language: typescript
signature:
= {
  claude: ["authorizeUrl", "tokenUrl", "redirectUri", "scopes", "clientId"],
  codex: ["authorizeU...


id: import:205d4c90652a2445321ea66d9564c63c
kind: import
name: ../../src/shared/utils/circuitBreaker.ts
qualified_name: ../../src/shared/utils/circuitBreaker.ts
file_path: tests/unit/observability-fase04.test.ts
language: typescript
signature:
import {
  CircuitBreaker,
  CircuitBreakerOpenError,
  STATE,
} from "../../src/shared/utils/circuitBreaker.ts";


id: import:53f53eb6e028835755d0c32633ac8e37
kind: import
name: ../../src/shared/middleware/correlationId.ts
qualified_name: ../../src/shared/middleware/correlationId.ts
file_path: tests/unit/observability-fase04.test.ts
language: typescript
signature:
import { getCorrelationId, runWithCorrelation } from "../../src/shared/middleware/correlationId.ts";


id: import:4e82e9eb7042c63e1ddafba305aa1bad
kind: import
name: ../../src/lib/monitoring/observability.ts
qualified_name: ../../src/lib/monitoring/observability.ts
file_path: tests/unit/observability-payloads.test.ts
language: typescript
signature:
import {
  buildHealthPayload,
  buildSessionsSummary,
  buildTelemetryPayload,
} from "../../src/lib/monitoring/observability.ts";


id: import:d2ec60394af4df16f2ff5ce35e5851d6
kind: import
name: ../../src/domain/omnirouteResponseMeta.ts
qualified_name: ../../src/domain/omnirouteResponseMeta.ts
file_path: tests/unit/omniroute-response-meta.test.ts
language: typescript
signature:
import {
  buildOmniRouteResponseMetaHeaders,
  buildOmniRouteSseMetadataComment,
  formatOmniRouteCost,
  getOmniRouteTokenCounts,
} from "../../src/domain/omnirouteResponseMeta.ts";


id: import:3bae0464f4373556830778cf6efe993e
kind: import
name: ../../open-sse/config/embeddingRegistry.ts
qualified_name: ../../open-sse/config/embeddingRegistry.ts
file_path: tests/unit/openrouter-registry.test.ts
language: typescript
signature:
import {
  getEmbeddingProvider,
  parseEmbeddingModel,
  getAllEmbeddingModels,
} from "../../open-sse/config/embeddingRegistry.ts";


id: import:9aabb0f5622cc86e80648ee9a372af1a
kind: import
name: ../../scripts/build/pack-artifact-policy.ts
qualified_name: ../../scripts/build/pack-artifact-policy.ts
file_path: tests/unit/pack-artifact-policy.test.ts
language: typescript
signature:
import {
  APP_STAGING_ALLOWED_EXACT_PATHS,
  APP_STAGING_ALLOWED_PATH_PREFIXES,
  PACK_ARTIFACT_ALLOWED_EXACT_PATHS,
  PACK_ARTIFACT_ALLOWED_PATH_PREFIXES,
  PACK_ARTIFACT_REQUIRED_PATHS,
  findMissingArtifactPaths,
  findUnexpectedArtifactPaths,
  normalizeArtifactPath,
} from "../../scripts/build/pack-artifact-policy.ts";


id: function:124fbb5c7809db745b5f04a6274e83fc
kind: function
name: mockFetch
qualified_name: mockFetch
file_path: tests/unit/perplexity-web.test.ts
language: typescript
signature: (status, streamEvents, bodyText)
docstring:
─── Helper: stub globalThis.fetch for testing ──────────────────────────────
The persistent bridge above forwards tlsFetchPerplexity calls to globalThis.fetch,
so stubbing fetch is still the way to mock Perplexity's upstream response.


id: import:c35452603ea08d04217de4913a54c052
kind: import
name: ../../open-sse/services/autoCombo/pipelineRouter.ts
qualified_name: ../../open-sse/services/autoCombo/pipelineRouter.ts
file_path: tests/unit/pipeline-router.test.ts
language: typescript
signature:
import {
  handlePipelineCombo,
  buildPipelineResponse,
  FITNESS_TIERS,
} from "../../open-sse/services/autoCombo/pipelineRouter.ts";


id: function:f9bfd99546ace97fbce71c58672829a2
kind: function
name: makePipelineResult
qualified_name: makePipelineResult
file_path: tests/unit/pipeline-router.test.ts
language: typescript
signature: (text: string): PipelineResult
docstring:
---------------------------------------------------------------------------
buildPipelineResponse — adapts a PipelineResult into an HTTP Response
(release/v3.8.2 review, finding C-1: callers expect a Response, not a
PipelineResult; before the fix the buffered pipeline text was silently lost)
---------------------------------------------------------------------------


id: interface:4da726c1b080e80151622b50d4777e83
kind: interface
name: PipelineResult
qualified_name: PipelineResult
file_path: tests/unit/pipeline-router.test.ts
language: typescript
docstring:
---------------------------------------------------------------------------
Type for test result access
---------------------------------------------------------------------------


id: import:b5ddf02520c94493a3b69d0a77210f6a
kind: import
name: ../../src/domain/pipeline.ts
qualified_name: ../../src/domain/pipeline.ts
file_path: tests/unit/pipeline.test.ts
language: typescript
signature:
import {
  buildPipelineConfig,
  executePipeline,
  parseReflectJson,
} from "../../src/domain/pipeline.ts";


id: import:7f37c785aac641168c6790853a871720
kind: import
name: ../../open-sse/handlers/sseParser.ts
qualified_name: ../../open-sse/handlers/sseParser.ts
file_path: tests/unit/plan3-p0.test.ts
language: typescript
signature:
import {
  parseSSEToOpenAIResponse,
  parseSSEToResponsesOutput,
} from "../../open-sse/handlers/sseParser.ts";


id: variable:342bf59e9d73829916014aa1dc62ad19
kind: variable
name: tmpDir
qualified_name: tmpDir
file_path: tests/unit/policy-engine.test.ts
language: typescript
docstring:
──────────────────────────────────────────────────────
Policy Engine Tests — FASE-06
──────────────────────────────────────────────────────


id: import:7aecc4d70650b042192320905109d75a
kind: import
name: ../../src/middleware/promptInjectionGuard.ts
qualified_name: ../../src/middleware/promptInjectionGuard.ts
file_path: tests/unit/prompt-injection-guard.test.ts
language: typescript
signature:
import {
  createInjectionGuard,
  withInjectionGuard,
} from "../../src/middleware/promptInjectionGuard.ts";


id: constant:a0bbb857e6cd31a3bd6784ae46afffcf
kind: constant
name: providerColumns
qualified_name: providerColumns
file_path: tests/unit/provider-columns.test.ts
language: typescript
signature:
= await import("../../src/app/(dashboard)/dashboard/usage/components/ProviderLimits/providerColumns.ts...


id: import:191239500cf1c0b150b70d94d728e9bc
kind: import
name: ../../open-sse/config/providerHeaderProfiles.ts
qualified_name: ../../open-sse/config/providerHeaderProfiles.ts
file_path: tests/unit/provider-header-profiles.test.ts
language: typescript
signature:
import {
  GITHUB_COPILOT_API_VERSION,
  GITHUB_COPILOT_CHAT_PLUGIN_VERSION,
  GITHUB_COPILOT_CHAT_USER_AGENT,
  GITHUB_COPILOT_EDITOR_VERSION,
  GITHUB_COPILOT_REFRESH_PLUGIN_VERSION,
  GITHUB_COPILOT_REFRESH_USER_AGENT,
  KIRO_AMZ_USER_AGENT,
  KIRO_SDK_USER_AGENT,
  QWEN_CLI_VERSION,
  getQwenCliUserAgent,
  getGitHubCopilotChatHeaders,
  getGitHubCopilotInternalUserHeaders,
  getGitHubCopilotRefreshHeaders,
  getKiroServiceHeaders,
  getQoderDashscopeCompatHeaders,
  getQwenOauthHeaders,
} from "../../open-sse/config/providerHeaderProfiles.ts";


id: import:1a8d64e7efcb77af39a794dcaeed0251
kind: import
name: ../../src/shared/utils/providerHints.ts
qualified_name: ../../src/shared/utils/providerHints.ts
file_path: tests/unit/provider-hints.test.ts
language: typescript
signature:
import {
  defaultUseUpstream429BreakerHints,
  resolveUseUpstream429BreakerHints,
} from "../../src/shared/utils/providerHints.ts";


id: import:251d1f706c29c4391c87475ed2563196
kind: import
name: ../../open-sse/config/providerModels.ts
qualified_name: ../../open-sse/config/providerModels.ts
file_path: tests/unit/provider-models-config.test.ts
language: typescript
signature:
import {
  PROVIDER_ID_TO_ALIAS,
  PROVIDER_MODELS,
  findModelName,
  getDefaultModel,
  getModelTargetFormat,
  getModelsByProviderId,
  getProviderModels,
  isValidModel,
} from "../../open-sse/config/providerModels.ts";


id: import:e572a601a6adf5cdbf8f52fe3c28d1be
kind: import
name: ../../open-sse/services/provider.ts
qualified_name: ../../open-sse/services/provider.ts
file_path: tests/unit/provider-service.test.ts
language: typescript
signature:
import {
  buildProviderHeaders,
  buildProviderUrl,
  getProviderConfig,
  getProviderFallbackCount,
  getTargetFormat,
  hasThinkingConfig,
  isClaudeCodeCompatible,
  isLastMessageFromUser,
  normalizeThinkingConfig,
} from "../../open-sse/services/provider.ts";


id: import:992564f9968d8e2c3fd75a47e5ed9c32
kind: import
name: ../../src/lib/skills/providerSettings.ts
qualified_name: ../../src/lib/skills/providerSettings.ts
file_path: tests/unit/provider-settings-default.test.ts
language: typescript
signature:
import {
  DEFAULT_SKILLS_PROVIDER,
  normalizeSkillsProvider,
} from "../../src/lib/skills/providerSettings.ts";


id: constant:708266204598339b699adee9f02bb51d
kind: constant
name: imageOnlyProviders
qualified_name: imageOnlyProviders
file_path: tests/unit/provider-validation-image-only.test.ts
language: typescript
signature:
= {
  "fal-ai": {
    url: "https://api.fal.ai/v1/models?limit=1",
    header: "Authorization",
    va...


id: import:d4ae2d44165df4c2e64a1280e3a1d634
kind: import
name: ../../src/app/api/providers/[id]/test/cliRuntimeProviderMap
qualified_name: ../../src/app/api/providers/[id]/test/cliRuntimeProviderMap
file_path: tests/unit/providers-test-route-cli-map.test.ts
language: typescript
signature:
import { CLI_RUNTIME_PROVIDER_MAP } from "../../src/app/api/providers/[id]/test/cliRuntimeProviderMap";


id: import:4a8043ef04d3e95a3fcc8306e6d99e50
kind: import
name: @/shared/constants/providers
qualified_name: @/shared/constants/providers
file_path: tests/unit/proxy-connection-test.test.ts
language: typescript
signature:
import {
  providerAllowsOptionalApiKey,
  SELF_HOSTED_CHAT_PROVIDER_IDS,
} from "@/shared/constants/providers";


id: function:b7d5df899d0a9457cbc7b800d941b4ce
kind: function
name: classifyFailure
qualified_name: classifyFailure
file_path: tests/unit/proxy-connection-test.test.ts
language: typescript
signature: ({ error, statusCode = null, refreshFailed = false, unsupported = false })
docstring:
── Import test targets from connection test route ──────────────────────────
We can't import the full route (needs DB), but we can test the pure functions
by importing them from the module. The classifyFailure, toSafeMessage, isTokenExpired,
and makeDiagnosis are not exported, so we test them through testSingleConnection's
behavior patterns using inline reimplementations that verify the same logic.
─── classifyFailure Logic Tests ────────────────────────────────────────────
Reimplementation of classifyFailure for testing (mirrors route.ts logic)


id: import:4197f23d3c7e1d04ddd3b5a698a69031
kind: import
name: ../../open-sse/utils/proxyFetch.ts
qualified_name: ../../open-sse/utils/proxyFetch.ts
file_path: tests/unit/proxy-fetch.test.ts
language: typescript
signature:
import proxyFetch, {
  runWithProxyContext,
  runWithTlsTracking,
  isTlsFingerprintActive,
} from "../../open-sse/utils/proxyFetch.ts";


id: import:6cf477ce41f676dbb39a39be62b56cfa
kind: import
name: ../../open-sse/utils/publicCreds.ts
qualified_name: ../../open-sse/utils/publicCreds.ts
file_path: tests/unit/publicCreds.test.ts
language: typescript
signature:
import {
  decodePublicCred,
  encodePublicCred,
  resolvePublicCred,
  resolvePublicCredMulti,
} from "../../open-sse/utils/publicCreds.ts";


id: constant:f1dff4b043ff002d6c7f2173ecc15227
kind: constant
name: FAKE_AIZA
qualified_name: FAKE_AIZA
file_path: tests/unit/publicCreds.test.ts
language: typescript
signature: = ["A", "I", "z", "a"].join("") + "_" + "x".repeat(36)
docstring:
Build a fake raw value that matches the helper's passthrough regex
without producing a literal that secret scanners will detect.


id: import:2558f4f5f65897fc9527000f2c40772d
kind: import
name: ../../open-sse/services/qoderCli.ts
qualified_name: ../../open-sse/services/qoderCli.ts
file_path: tests/unit/qoder-executor.test.ts
language: typescript
signature:
import {
  buildQoderPrompt,
  getStaticQoderModels,
  mapQoderModelToLevel,
  normalizeQoderPatProviderData,
  parseQoderCliFailure,
  validateQoderCliPat,
} from "../../open-sse/services/qoderCli.ts";


id: import:f8275ffcf12e795b564e8e2269811a63
kind: import
name: ../../open-sse/services/reasoningCache.ts
qualified_name: ../../open-sse/services/reasoningCache.ts
file_path: tests/unit/reasoning-cache.test.ts
language: typescript
signature:
import {
  cacheReasoningFromAssistantMessage,
  cacheReasoning,
  cacheReasoningByKey,
  cacheReasoningBatch,
  deleteReasoningCacheEntry,
  getReasoningCacheServiceEntries,
  lookupReasoning,
  recordReplay,
  getReasoningCacheServiceStats,
  clearReasoningCacheAll,
  isDeepSeekReasoningModel,
  requiresReasoningReplay,
  cleanupReasoningCache,
} from "../../open-sse/services/reasoningCache.ts";


id: constant:a77f4263824af283f3b7a63f54c78a21
kind: constant
name: MOCK_REGISTRY
qualified_name: MOCK_REGISTRY
file_path: tests/unit/registry-utils.test.ts
language: typescript
docstring: ─── Test fixtures ────────────────────────────────────────────
signature:
= {
  elevenlabs: {
    id: "elevenlabs",
    baseUrl: "https://api.elevenlabs.io/v1",
    authType: "...


id: import:5d2ba660e420e95825fb66583f51fde6
kind: import
name: ../../src/shared/utils/requestTelemetry.ts
qualified_name: ../../src/shared/utils/requestTelemetry.ts
file_path: tests/unit/remaining-tasks.test.ts
language: typescript
signature:
import {
  RequestTelemetry,
  recordTelemetry,
  getTelemetrySummary,
} from "../../src/shared/utils/requestTelemetry.ts";


id: import:91286fcea5e2d34ce0a778a271dc1e83
kind: import
name: ../../src/domain/lockoutPolicy.ts
qualified_name: ../../src/domain/lockoutPolicy.ts
file_path: tests/unit/remaining-tasks.test.ts
language: typescript
signature:
import {
  checkLockout,
  recordFailedAttempt,
  recordSuccess,
  forceUnlock,
} from "../../src/domain/lockoutPolicy.ts";


id: import:5bf991b291167fda8978b60de6e13ff3
kind: import
name: ../../src/lib/resilience/settings.ts
qualified_name: ../../src/lib/resilience/settings.ts
file_path: tests/unit/resilience-settings-quota-preflight.test.ts
language: typescript
signature:
import {
  DEFAULT_RESILIENCE_SETTINGS,
  mergeResilienceSettings,
  resolveResilienceSettings,
  type ResilienceSettings,
} from "../../src/lib/resilience/settings.ts";


id: import:a6ba64fefbf8df116bdf06f11cca7ba9
kind: import
name: ../../src/shared/utils/resolveOmniRouteBaseUrl.ts
qualified_name: ../../src/shared/utils/resolveOmniRouteBaseUrl.ts
file_path: tests/unit/resolve-omniroute-base-url.test.ts
language: typescript
signature:
import {
  DEFAULT_OMNIROUTE_BASE_URL,
  resolveOmniRouteBaseUrl,
} from "../../src/shared/utils/resolveOmniRouteBaseUrl.ts";


id: function:b83797fa9f5503a6e082d4729d6a3f0f
kind: function
name: invokeResponsesCore
qualified_name: invokeResponsesCore
file_path: tests/unit/responses-handler.test.ts
language: typescript
signature:
({
  body,
  provider = "openai",
  model = "gpt-4o-mini",
  credentials,
  responseFactory,
  signal,
}: {
  body?: any;
  provider?: string;
  model?: string;
  credentials?: any;
  responseFactory?: any;
  signal?: AbortSignal;
} = {})


id: import:29e43c66b58ff3497b4728d602eaaf31
kind: import
name: node:fs
qualified_name: node:fs
file_path: tests/unit/responses-transformer.test.ts
language: typescript
signature:
import { mkdtempSync, readdirSync, readFileSync, rmSync, unlinkSync, writeFileSync } from "node:fs";


id: import:ad96433ee18da4097ed78b878c511edb
kind: import
name: ../../open-sse/translator/helpers/schemaCoercion.ts
qualified_name: ../../open-sse/translator/helpers/schemaCoercion.ts
file_path: tests/unit/schema-coercion.test.ts
language: typescript
signature:
import {
  coerceSchemaNumericFields,
  coerceToolSchemas,
  injectEmptyReasoningContentForToolCalls,
  sanitizeToolDescription,
  sanitizeToolDescriptions,
} from "../../open-sse/translator/helpers/schemaCoercion.ts";


id: import:068f6fca0d6973c9e3689d7f3b1d54e5
kind: import
name: ../../open-sse/services/searchCache.ts
qualified_name: ../../open-sse/services/searchCache.ts
file_path: tests/unit/search-cache-ttl-zero.test.ts
language: typescript
signature:
import {
  getOrCoalesce,
  computeCacheKey,
  getCacheStats,
} from "../../open-sse/services/searchCache.ts";


id: constant:f96afba85b7d4882efd1c2bef3e8242e
kind: constant
name: ZAI_MOCK_RESULTS
qualified_name: ZAI_MOCK_RESULTS
file_path: tests/unit/search-handler-extended.test.ts
language: typescript
docstring: ─── Z.AI Coding Plan Search Tests ────────────────────
signature:
= [
  {
    title: "Z.AI Coding Plan Search",
    link: "https://docs.z.ai/search",
    content: "Z.AI...


id: function:8a5e4ee85fc6ceae85164fa7828265dd
kind: function
name: seedConnection
qualified_name: seedConnection
file_path: tests/unit/search-route.test.ts
language: typescript
signature:
(
  provider: string,
  overrides: {
    apiKey?: string | null;
    authType?: string;
    providerSpecificData?: Record<string, unknown>;
  } = {}
)


id: function:9f20ff356443373acb9441e6a3c92d44
kind: function
name: withEnv
qualified_name: withEnv
file_path: tests/unit/security-fase01.test.ts
language: typescript
signature: (overrides, fn)
docstring:
═════════════════════════════════════════════════════
FASE-01: Security Unit Tests
Tests for secretsValidator.js and inputSanitizer.js
═════════════════════════════════════════════════════
─── Secrets Validator Tests ──────────────────────────
Helper to run with temporary env vars


id: import:dc7fc70e615817d693070d628ad65352
kind: import
name: ../../src/lib/semanticCache.ts
qualified_name: ../../src/lib/semanticCache.ts
file_path: tests/unit/semantic-cache.test.ts
language: typescript
signature:
import {
  generateSignature,
  isCacheableForRead,
  isCacheableForWrite,
} from "../../src/lib/semanticCache.ts";


id: constant:1d289759bcccdfe31744779924f8bf1b
kind: constant
name: requiredSettingsKeys
qualified_name: requiredSettingsKeys
file_path: tests/unit/settings-i18n-keys.test.ts
language: typescript
signature:
= [
  "adaptiveVolumeRouting",
  "adaptiveVolumeRoutingDesc",
  "lkgpToggleTitle",
  "lkgpToggleDesc",...


id: constant:fcbdb6324be2b0572915a3924085ad4a
kind: constant
name: requestBodyLimitSettingsKeys
qualified_name: requestBodyLimitSettingsKeys
file_path: tests/unit/settings-i18n-keys.test.ts
language: typescript
signature:
= [
  "requestBodyLimitTitle",
  "requestBodyLimitDescription",
  "requestBodyLimitInputLabel",
  "req...


id: import:40d3057bb685a2bf5fc33ec8e52156cc
kind: import
name: ../../open-sse/services/geminiThoughtSignatureStore.ts
qualified_name: ../../open-sse/services/geminiThoughtSignatureStore.ts
file_path: tests/unit/signature-cache-bypass.test.ts
language: typescript
signature:
import {
  clearGeminiThoughtSignatureMemoryForTests,
  clearGeminiThoughtSignatures,
  getGeminiThoughtSignature,
  getGeminiThoughtSignatureMode,
  isValidBasicGeminiThoughtSignature,
  isValidFullGeminiThoughtSignature,
  resolveGeminiThoughtSignature,
  setGeminiThoughtSignatureMode,
  storeGeminiThoughtSignature,
} from "../../open-sse/services/geminiThoughtSignatureStore.ts";


id: import:9811174f1079fee671eaf7551ead6270
kind: import
name: ../../open-sse/utils/streamHandler.ts
qualified_name: ../../open-sse/utils/streamHandler.ts
file_path: tests/unit/stream-handler.test.ts
language: typescript
signature:
import {
  createDisconnectAwareStream,
  createStreamController,
  pipeWithDisconnect,
} from "../../open-sse/utils/streamHandler.ts";


id: import:908d371836fa44251c02aee309513818
kind: import
name: ../../src/lib/usage/usageHistory.ts
qualified_name: ../../src/lib/usage/usageHistory.ts
file_path: tests/unit/stream-handler.test.ts
language: typescript
signature:
import {
  clearPendingRequests,
  getPendingRequests,
  trackPendingRequest,
} from "../../src/lib/usage/usageHistory.ts";


id: import:48321310ac62953752bd3819d69deee5
kind: import
name: ../../open-sse/utils/streamReadiness.ts
qualified_name: ../../open-sse/utils/streamReadiness.ts
file_path: tests/unit/stream-readiness.test.ts
language: typescript
signature:
import {
  ensureStreamReadiness,
  hasStreamReadinessSignal,
  hasUsefulStreamContent,
} from "../../open-sse/utils/streamReadiness.ts";


id: import:4a08b3e6610b35741208c7b001eeec00
kind: import
name: ../../open-sse/utils/stream.ts
qualified_name: ../../open-sse/utils/stream.ts
file_path: tests/unit/stream-strip-responses-lifecycle-echo.test.ts
language: typescript
signature:
import {
  backfillResponsesCompletedOutput,
  stripResponsesLifecycleEcho,
} from "../../open-sse/utils/stream.ts";


id: import:1024cb4e1465555da944adecf7430e01
kind: import
name: ../../open-sse/utils/streamHandler.ts
qualified_name: ../../open-sse/utils/streamHandler.ts
file_path: tests/unit/stream-utilities.test.ts
language: typescript
signature:
import {
  pipeWithDisconnect,
  createStreamController,
  createDisconnectAwareStream,
} from "../../open-sse/utils/streamHandler.ts";


id: constant:8b6926ccd5ec83a3409aca8bdeab83bb
kind: constant
name: UI_DEFAULTS_SNAPSHOT
qualified_name: UI_DEFAULTS_SNAPSHOT
file_path: tests/unit/system-transforms.test.ts
language: typescript
docstring:
────────────────────────────────────────────────────────────────────────────
UI ↔ server defaults parity
────────────────────────────────────────────────────────────────────────────

The Settings UI keeps a hand-maintained mirror of DEFAULT_SYSTEM_TRANSFORMS_CONFIG
in src/app/(dashboard)/dashboard/settings/components/RoutingTab.tsx so it can
render + reset to defaults without a server roundtrip. The snapshot below is
the contract between server and UI — if it drifts, both must be updated in
the same commit.

signature:
= {
  providers: {
    claude: {
      enabled: true,
      pipeline: [
        {
          kind: "dro...


id: import:82d84a31f18ff0ade1a7974cbebcfe8a
kind: import
name: ../../src/shared/validation/schemas.ts
qualified_name: ../../src/shared/validation/schemas.ts
file_path: tests/unit/t06-schema-hardening.test.ts
language: typescript
signature:
import {
  validateBody,
  translatorDetectSchema,
  translatorSendSchema,
  translatorTranslateSchema,
  cliSettingsEnvSchema,
  v1EmbeddingsSchema,
  providerChatCompletionSchema,
  v1CountTokensSchema,
  pricingSyncRequestSchema,
  updateTaskRoutingSchema,
  taskRoutingActionSchema,
  codexProfileIdSchema,
} from "../../src/shared/validation/schemas.ts";


id: import:874955fb7ab12e3e6a0bb22cca7fe4c9
kind: import
name: ../../open-sse/mcp-server/scopeEnforcement.ts
qualified_name: ../../open-sse/mcp-server/scopeEnforcement.ts
file_path: tests/unit/t08-mcp-scope-enforcement.test.ts
language: typescript
signature:
import {
  evaluateToolScopes,
  resolveCallerScopeContext,
} from "../../open-sse/mcp-server/scopeEnforcement.ts";


id: import:568f6300365d095983d5c77a33d309c8
kind: import
name: ../../src/app/(dashboard)/dashboard/usage/components/ProviderLimits/utils.tsx
qualified_name: ../../src/app/(dashboard)/dashboard/usage/components/ProviderLimits/utils.tsx
file_path: tests/unit/t13-stale-quota-display.test.ts
language: typescript
signature:
import { parseQuotaData } from "../../src/app/(dashboard)/dashboard/usage/components/ProviderLimits/utils.tsx";


id: import:cc966e99bbc98b3c0d7577c19b49debb
kind: import
name: ../../src/lib/proxyHealth.ts
qualified_name: ../../src/lib/proxyHealth.ts
file_path: tests/unit/t14-proxy-fast-fail.test.ts
language: typescript
signature:
import {
  isProxyReachable,
  getCachedProxyHealth,
  invalidateProxyHealth,
} from "../../src/lib/proxyHealth.ts";


id: constant:698efefa1a5db9ca211b4a6aca9832f1
kind: constant
name: originalEnv
qualified_name: originalEnv
file_path: tests/unit/tailscaleTunnel.test.ts
language: typescript
signature:
= {
  tailscaleBin: process.env.TAILSCALE_BIN,
  tailscaledBin: process.env.TAILSCALED_BIN,
  statusJs...


id: import:f262d6f7b04fb4b1aef3fe5b9125a765
kind: import
name: ../../open-sse/services/toolLimitDetector.ts
qualified_name: ../../open-sse/services/toolLimitDetector.ts
file_path: tests/unit/tool-limit-detector.test.ts
language: typescript
signature:
import {
  getEffectiveToolLimit,
  setDetectedToolLimit,
  parseToolLimitFromError,
  shouldDetectLimit,
  clearDetectedLimits,
} from "../../open-sse/services/toolLimitDetector.ts";


id: import:c3c1e25621d38b12a5e65506b55f56f9
kind: import
name: ../../src/lib/translator/streamTransform.ts
qualified_name: ../../src/lib/translator/streamTransform.ts
file_path: tests/unit/translator-stream-transform.test.ts
language: typescript
signature:
import { transformChatCompletionSseToResponses } from "../../src/lib/translator/streamTransform.ts";


id: import:f0a9c90831f5163df25b7c369dc2d778
kind: import
name: ../../open-sse/utils/upstreamResponseHeaders.ts
qualified_name: ../../open-sse/utils/upstreamResponseHeaders.ts
file_path: tests/unit/upstream-response-headers-strip.test.ts
language: typescript
signature:
import {
  stripStaleEncodingHeaders,
  filterUpstreamResponseHeaderEntries,
  STRIP_UPSTREAM_HEADER_NAMES,
} from "../../open-sse/utils/upstreamResponseHeaders.ts";


id: function:09f863ba0932c192c9b136054c4314ab
kind: function
name: seedUsageEntries
qualified_name: seedUsageEntries
file_path: tests/unit/usage-history-db.test.ts
language: typescript
signature:
(
  entries: Array<{
    provider: string;
    model: string;
    connectionId?: string;
    tokens: { input?: number; output?: number };
    success?: boolean;
    latencyMs?: number;
    minutesAgo?: number;
    serviceTier?: string;
  }>
)


id: constant:12f47b01554152c0327f0dcbb97f6d17
kind: constant
name: MARKER_PATH
qualified_name: MARKER_PATH
file_path: tests/unit/usage-migrations.test.ts
language: typescript
signature:
= migrations.LOG_ARCHIVES_DIR
  ? path.join(migrations.LOG_ARCHIVES_DIR, "legacy-request-logs.json")
 ...


id: variable:fd919a9d06fca2c742e097f76cef85e0
kind: variable
name: forceExitScheduled
qualified_name: forceExitScheduled
file_path: tests/unit/versionManager-orchestrator.test.ts
language: typescript
signature: = false
docstring:
The orchestrator imports chain triggers getDbInstance() which runs migrations.
A pre-existing migration conflict (014_create_memories_down.sql) causes a
rejected promise that keeps the event loop alive. We force-exit after tests.


id: constant:3bf2cc2cc41cd1e00cf742e3767e4df0
kind: constant
name: ENV_KEYS
qualified_name: ENV_KEYS
file_path: tests/unit/vision-bridge-env-override.test.ts
language: typescript
signature:
= [
  "VISION_BRIDGE_API_KEY",
  "VISION_BRIDGE_BASE_URL",
  "OPENAI_API_URL",
  "OPENAI_API_KEY",
  "...


id: import:e1be34acd39e0735d744093bdb7fe170
kind: import
name: @/shared/constants/visionBridgeDefaults
qualified_name: @/shared/constants/visionBridgeDefaults
file_path: tests/unit/visionBridgeDefaults.test.ts
language: typescript
signature:
import {
  VISION_BRIDGE_DEFAULTS,
  VISION_BRIDGE_SETTINGS_KEYS,
  getVisionBridgeConfig,
  isVisionBridgeForcedModel,
  type VisionBridgeSettings,
} from "@/shared/constants/visionBridgeDefaults";


id: import:1587c1965d301d2975db6f719b576449
kind: import
name: ../../src/lib/env/runtimeEnv.ts
qualified_name: ../../src/lib/env/runtimeEnv.ts
file_path: tests/unit/web-runtime-env.test.ts
language: typescript
signature:
import {
  formatRuntimeEnvValidationErrors,
  getWebRuntimeEnv,
  validateWebRuntimeEnv,
} from "../../src/lib/env/runtimeEnv.ts";


id: function:a38282b0ee38eaf2a253b84eeaadf159
kind: function
name: makeBody
qualified_name: makeBody
file_path: tests/unit/web-search-fallback-format.test.ts
language: typescript
signature: ()
docstring:
Regression for #2390: when the target is a Responses-API provider, the injected
omniroute_web_search tool must use the FLAT function shape ({ type, name }), not the
nested Chat Completions shape ({ type, function: { name } }). On the Responses→Responses
passthrough path nothing flattens it, so a nested tool reaches the upstream as
tools[0].function.name and is rejected with "Missing required parameter: 'tools[0].name'".


id: function:64c883b256230ce8ffef67bced353740
kind: function
name: openAIMessagesToWsLocal
qualified_name: openAIMessagesToWsLocal
file_path: tests/unit/windsurf-devin-executors.test.ts
language: typescript
docstring:
─── openAIMessagesToWs message conversion ────────────────────────────────────
Tests the message role/content extraction logic. Since the function is not
exported, we test via a re-implementation that mirrors the source exactly.

signature:
(
  messages: Array<{ role?: string; content?: unknown; tool_call_id?: string }>
): Array<{ role: string; content: string; toolCallId?: string }>


