blackriver-gateway 3.8.46 → 3.8.48

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (324) hide show
  1. package/package.json +1 -1
  2. package/src/domain/assessment/migration.ts +2 -2
  3. package/src/domain/connectionModelRules.ts +1 -1
  4. package/src/domain/modelAvailability.ts +1 -1
  5. package/src/domain/omnirouteResponseMeta.ts +30 -30
  6. package/src/domain/quotaCache.ts +3 -3
  7. package/src/domain/types.ts +1 -1
  8. package/src/lib/a2a/routingLogger.ts +1 -1
  9. package/src/lib/a2a/skills/costAnalysis.ts +5 -5
  10. package/src/lib/a2a/skills/healthReport.ts +5 -5
  11. package/src/lib/a2a/skills/listCapabilities.ts +2 -2
  12. package/src/lib/a2a/skills/providerDiscovery.ts +1 -1
  13. package/src/lib/a2a/skills/quotaManagement.ts +5 -5
  14. package/src/lib/a2a/skills/smartRouting.ts +6 -6
  15. package/src/lib/accessTokens/scopes.ts +2 -2
  16. package/src/lib/acp/manager.ts +1 -1
  17. package/src/lib/acp/registry.ts +1 -1
  18. package/src/lib/agentSkills/generator.ts +4 -4
  19. package/src/lib/api/comboErrorResponse.ts +1 -1
  20. package/src/lib/api/modelTestRunner.ts +7 -7
  21. package/src/lib/api/proxyRegistryRouteHandlers.ts +1 -1
  22. package/src/lib/api/serverErrorMessage.ts +1 -1
  23. package/src/lib/apiBridgeServer.ts +3 -3
  24. package/src/lib/arenaEloSync.ts +5 -5
  25. package/src/lib/build-profile/featureDisabled.ts +3 -3
  26. package/src/lib/cacheControlSettings.ts +1 -1
  27. package/src/lib/catalog/openrouterCatalog.ts +1 -1
  28. package/src/lib/cli-helper/claudeProfileAutoSync.ts +4 -4
  29. package/src/lib/cli-helper/codexProfileAutoSync.ts +3 -3
  30. package/src/lib/cli-helper/config-generator/continue.ts +1 -1
  31. package/src/lib/cli-helper/config-generator/hermes-agent.ts +10 -10
  32. package/src/lib/cli-helper/config-generator/hermes.ts +2 -2
  33. package/src/lib/cli-helper/config-generator/hermesHome.ts +1 -1
  34. package/src/lib/cli-helper/config-generator/opencode.ts +10 -10
  35. package/src/lib/cli-helper/doctor/checks.ts +1 -1
  36. package/src/lib/cli-helper/tool-detector.ts +4 -4
  37. package/src/lib/cliTools/checkToolConfigStatus.ts +13 -13
  38. package/src/lib/cloudSync.stub.ts +1 -1
  39. package/src/lib/cloudSync.ts +6 -6
  40. package/src/lib/cloudflaredTunnel.ts +1 -1
  41. package/src/lib/combos/autoPromote.ts +1 -1
  42. package/src/lib/combos/builderOptions.ts +1 -1
  43. package/src/lib/compression/judgeModelClient.ts +3 -3
  44. package/src/lib/config/hotReload.ts +1 -1
  45. package/src/lib/config/runtimeSettings.ts +11 -11
  46. package/src/lib/consoleInterceptor.ts +3 -3
  47. package/src/lib/copilot/engine.ts +16 -16
  48. package/src/lib/copilot/systemPrompt.ts +12 -12
  49. package/src/lib/copilot/tools.ts +13 -13
  50. package/src/lib/credentialHealth/cache.ts +4 -4
  51. package/src/lib/credentialHealth/scheduler.ts +5 -5
  52. package/src/lib/dataPaths.ts +1 -1
  53. package/src/lib/db/adapters/driverFactory.ts +4 -4
  54. package/src/lib/db/apiKeys/modelPermissions.ts +1 -1
  55. package/src/lib/db/apiKeys.ts +5 -5
  56. package/src/lib/db/backup.ts +1 -1
  57. package/src/lib/db/cliToolState.ts +2 -2
  58. package/src/lib/db/compression.ts +3 -3
  59. package/src/lib/db/compressionCombos.ts +1 -1
  60. package/src/lib/db/core.ts +13 -13
  61. package/src/lib/db/databaseSettings.ts +1 -1
  62. package/src/lib/db/detailedLogs.ts +1 -1
  63. package/src/lib/db/encryption.ts +3 -3
  64. package/src/lib/db/healthCheck.ts +2 -2
  65. package/src/lib/db/jsonMigration.ts +1 -1
  66. package/src/lib/db/migrationRunner.ts +29 -29
  67. package/src/lib/db/settings/pricing.ts +1 -1
  68. package/src/lib/db/settings.ts +3 -3
  69. package/src/lib/db/tierConfig.ts +1 -1
  70. package/src/lib/db/usageAnalytics.ts +1 -1
  71. package/src/lib/db/webhookDeliveries.ts +1 -1
  72. package/src/lib/discovery/index.ts +2 -2
  73. package/src/lib/embeddings/familyGuard.ts +2 -2
  74. package/src/lib/embeddings/service.ts +9 -9
  75. package/src/lib/env/runtimeEnv.ts +4 -4
  76. package/src/lib/evals/evalRunner/builtinSuites.ts +1 -1
  77. package/src/lib/events/eventBus.ts +4 -4
  78. package/src/lib/freeProviderRankings.ts +1 -1
  79. package/src/lib/gamification/badges.ts +2 -2
  80. package/src/lib/gamification/servers.ts +1 -1
  81. package/src/lib/gamification/streaks.ts +1 -1
  82. package/src/lib/gamification/xp.ts +2 -2
  83. package/src/lib/gracefulShutdown.ts +5 -5
  84. package/src/lib/guardrails/registry.ts +1 -1
  85. package/src/lib/guardrails/visionBridge.ts +1 -1
  86. package/src/lib/guardrails/visionBridgeHelpers.ts +15 -15
  87. package/src/lib/guardrails/visionBridgeRouter.ts +1 -1
  88. package/src/lib/headroom/detect.ts +1 -1
  89. package/src/lib/images/imageRouteModel.ts +2 -2
  90. package/src/lib/initCloudSync.ts +2 -2
  91. package/src/lib/inspector/harExport.ts +5 -5
  92. package/src/lib/jobs/budgetResetJob.ts +1 -1
  93. package/src/lib/jobs/reasoningCacheCleanupJob.ts +1 -1
  94. package/src/lib/localHealthCheck.ts +5 -5
  95. package/src/lib/machineToken.ts +2 -2
  96. package/src/lib/memory/embedding/index.ts +1 -1
  97. package/src/lib/memory/embedding/remote.ts +1 -1
  98. package/src/lib/memory/embedding/staticPotion.ts +2 -2
  99. package/src/lib/memory/embedding/transformersLocal.ts +1 -1
  100. package/src/lib/memory/qdrant.ts +4 -4
  101. package/src/lib/memory/settings.ts +1 -1
  102. package/src/lib/memory/types.ts +1 -1
  103. package/src/lib/middleware/cliTokenAuth.ts +4 -4
  104. package/src/lib/middleware/registry.ts +5 -5
  105. package/src/lib/modelCapabilities.ts +2 -2
  106. package/src/lib/modelMetadataRegistry.ts +1 -1
  107. package/src/lib/modelsDevSync/transform.ts +14 -14
  108. package/src/lib/monitoring/providerHealthAutopilot.ts +3 -3
  109. package/src/lib/monitoring/providerHealthMatrix.ts +2 -2
  110. package/src/lib/oauth/codexDeviceFlow.ts +1 -1
  111. package/src/lib/oauth/config/index.ts +4 -4
  112. package/src/lib/oauth/constants/oauth.ts +5 -5
  113. package/src/lib/oauth/credentialBlob.ts +2 -2
  114. package/src/lib/oauth/providers/antigravity.ts +2 -2
  115. package/src/lib/oauth/providers/claude.ts +1 -1
  116. package/src/lib/oauth/providers/windsurf.ts +1 -1
  117. package/src/lib/oauth/providers/zed-hosted.ts +1 -1
  118. package/src/lib/oauth/providers/zed.ts +1 -1
  119. package/src/lib/oauth/providers.ts +3 -3
  120. package/src/lib/oauth/services/cursor.ts +1 -1
  121. package/src/lib/oauth/utils/agyAuthImport.ts +2 -2
  122. package/src/lib/oauth/utils/claudeAuthFile.ts +1 -1
  123. package/src/lib/oauth/utils/cliProxyAuthImport.ts +1 -1
  124. package/src/lib/oauth/utils/codexAuthFile.ts +1 -1
  125. package/src/lib/oauth/utils/codexAuthImport.ts +1 -1
  126. package/src/lib/obsidian/api.ts +1 -1
  127. package/src/lib/obsidianSync.ts +1 -1
  128. package/src/lib/playground/codeExport.ts +5 -5
  129. package/src/lib/plugins/hooks.ts +1 -1
  130. package/src/lib/plugins/loader.ts +1 -1
  131. package/src/lib/plugins/manifest.ts +3 -3
  132. package/src/lib/plugins/marketplace.ts +4 -4
  133. package/src/lib/plugins/pluginWorker.ts +3 -3
  134. package/src/lib/plugins/scanner.ts +3 -3
  135. package/src/lib/plugins/sdk.ts +3 -3
  136. package/src/lib/pricingSync.ts +9 -9
  137. package/src/lib/providerModels/geminiModelsParser.ts +1 -1
  138. package/src/lib/providerModels/managedModelImport.ts +1 -1
  139. package/src/lib/providers/imageValidation.ts +1 -1
  140. package/src/lib/providers/requestDefaults.ts +1 -1
  141. package/src/lib/providers/serviceKindIndex.ts +0 -0
  142. package/src/lib/providers/staticModels.ts +7 -7
  143. package/src/lib/providers/validation/anthropicFormat.ts +2 -2
  144. package/src/lib/providers/validation/audioMiscProviders.ts +4 -4
  145. package/src/lib/providers/validation/cloudProviders.ts +6 -6
  146. package/src/lib/providers/validation/openaiFormat.ts +3 -3
  147. package/src/lib/providers/validation/transport.ts +1 -1
  148. package/src/lib/providers/validation/urlHelpers.ts +1 -1
  149. package/src/lib/providers/validation/webProvidersA.ts +3 -3
  150. package/src/lib/providers/validation/webProvidersB.ts +2 -2
  151. package/src/lib/providers/validation.ts +7 -7
  152. package/src/lib/proxyEgress.ts +2 -2
  153. package/src/lib/proxyHealth/scheduler.ts +3 -3
  154. package/src/lib/proxyHealth.ts +2 -2
  155. package/src/lib/proxyRelay/cloudflareWorkerScript.ts +3 -3
  156. package/src/lib/quota/connectionRecovery.ts +9 -9
  157. package/src/lib/quota/quotaCombos.ts +1 -1
  158. package/src/lib/quota/redisQuotaStore.ts +2 -2
  159. package/src/lib/quota/saturationSignals.ts +4 -4
  160. package/src/lib/resilience/settings.ts +1 -1
  161. package/src/lib/runtime/ports.ts +2 -2
  162. package/src/lib/search/executeWebSearch.ts +3 -3
  163. package/src/lib/security/localEndpoints.ts +5 -5
  164. package/src/lib/semanticCache.ts +3 -3
  165. package/src/lib/services/ServiceSupervisor.ts +1 -1
  166. package/src/lib/services/embedWsProxy.ts +4 -4
  167. package/src/lib/services/htmlRewriter.ts +1 -1
  168. package/src/lib/services/installers/bifrost.ts +1 -1
  169. package/src/lib/services/installers/mux.ts +1 -1
  170. package/src/lib/services/installers/ninerouter.stub.ts +1 -1
  171. package/src/lib/services/installers/ninerouter.ts +2 -2
  172. package/src/lib/services/installers/utils.ts +2 -2
  173. package/src/lib/services/modelSync.ts +1 -1
  174. package/src/lib/services/reverseProxy.ts +7 -7
  175. package/src/lib/skills/builtins.ts +1 -1
  176. package/src/lib/skills/interception.ts +3 -3
  177. package/src/lib/skills/sandbox.ts +3 -3
  178. package/src/lib/spend/batchWriter.ts +2 -2
  179. package/src/lib/system/autoUpdate.ts +9 -9
  180. package/src/lib/system/globalPackagePath.ts +5 -5
  181. package/src/lib/system/versionCheck.ts +5 -5
  182. package/src/lib/tailscaleTunnel.ts +4 -4
  183. package/src/lib/tokenHealthCheck.ts +10 -10
  184. package/src/lib/translator/streamTransform.ts +1 -1
  185. package/src/lib/usage/apiKeyUsageLimits.ts +1 -1
  186. package/src/lib/usage/callLogArtifacts.ts +4 -4
  187. package/src/lib/usage/callLogs/format.ts +1 -1
  188. package/src/lib/usage/callLogs.ts +1 -1
  189. package/src/lib/usage/codexResetCredits.ts +3 -3
  190. package/src/lib/usage/comboForecast.ts +1 -1
  191. package/src/lib/usage/comboHealth.ts +2 -2
  192. package/src/lib/usage/comboScoringInspector.ts +2 -2
  193. package/src/lib/usage/fetcher.ts +8 -8
  194. package/src/lib/usage/flatRateProviders.ts +1 -1
  195. package/src/lib/usage/internalUsageCommand.ts +4 -4
  196. package/src/lib/usage/providerLimits/quotaNormalize.ts +2 -2
  197. package/src/lib/usage/providerLimits.ts +5 -5
  198. package/src/lib/usage/resilienceExplain.ts +1 -1
  199. package/src/lib/usage/routeExplain.ts +2 -2
  200. package/src/lib/usage/usageStats.ts +4 -4
  201. package/src/lib/versionManager/binaryManager.ts +1 -1
  202. package/src/lib/versionManager/healthMonitor.ts +1 -1
  203. package/src/lib/vscode/modelPresentation.ts +1 -1
  204. package/src/lib/vscode/reasoningMetadata.ts +2 -2
  205. package/src/lib/webhookDispatcher.ts +2 -2
  206. package/src/lib/webhooks/eventDescriptions.ts +1 -1
  207. package/src/lib/webhooks/integrations/discord.ts +1 -1
  208. package/src/lib/webhooks/integrations/slack.ts +1 -1
  209. package/src/lib/webhooks/integrations/telegram.ts +1 -1
  210. package/src/lib/zed-oauth/dockerDetect.ts +1 -1
  211. package/src/lib/zed-oauth/keychain-reader.stub.ts +1 -1
  212. package/src/lib/zed-oauth/keychain-reader.ts +1 -1
  213. package/src/mitm/cert/install.stub.ts +1 -1
  214. package/src/mitm/cert/install.ts +7 -7
  215. package/src/mitm/dataDir.ts +1 -1
  216. package/src/mitm/handlers/antigravity.ts +4 -4
  217. package/src/mitm/handlers/base.ts +9 -9
  218. package/src/mitm/handlers/claudeCode.ts +2 -2
  219. package/src/mitm/handlers/codex.ts +2 -2
  220. package/src/mitm/handlers/copilot.ts +2 -2
  221. package/src/mitm/handlers/cursor.ts +2 -2
  222. package/src/mitm/handlers/kiro.ts +2 -2
  223. package/src/mitm/handlers/openCode.ts +2 -2
  224. package/src/mitm/handlers/zed.ts +2 -2
  225. package/src/mitm/inspector/agentBridgeHook.ts +1 -1
  226. package/src/mitm/inspector/httpProxyServer.ts +1 -1
  227. package/src/mitm/inspector/llmMetadataExtractor.ts +2 -2
  228. package/src/mitm/inspector/systemProxyConfig.ts +2 -2
  229. package/src/mitm/manager.ts +4 -4
  230. package/src/mitm/systemCommands.ts +10 -10
  231. package/src/mitm/targets/antigravity.ts +3 -3
  232. package/src/mitm/targets/claudeCode.ts +2 -2
  233. package/src/mitm/targets/codex.ts +1 -1
  234. package/src/mitm/targets/copilot.ts +1 -1
  235. package/src/mitm/targets/cursor.ts +2 -2
  236. package/src/mitm/targets/kiro.ts +5 -5
  237. package/src/mitm/targets/openCode.ts +2 -2
  238. package/src/mitm/targets/zed.ts +2 -2
  239. package/src/mitm/tproxy/caTrust.ts +7 -7
  240. package/src/mitm/tproxy/dynamicCert.ts +2 -2
  241. package/src/mitm/tproxy/tlsCapture.ts +1 -1
  242. package/src/server/authz/csrf.ts +1 -1
  243. package/src/server/authz/headers.ts +11 -11
  244. package/src/server/authz/peerStamp.ts +1 -1
  245. package/src/server/authz/pipeline.ts +3 -3
  246. package/src/server/authz/policies/clientApi.ts +2 -2
  247. package/src/server/authz/policies/management.ts +5 -5
  248. package/src/server/cors/origins.ts +2 -2
  249. package/src/server/origin/publicOrigin.ts +4 -4
  250. package/src/server/ws/liveServer.ts +3 -3
  251. package/src/server/ws/liveServerAllowList.ts +1 -1
  252. package/src/shared/components/Collapsible.tsx +1 -1
  253. package/src/shared/components/ConsoleLogViewer.tsx +1 -1
  254. package/src/shared/components/Footer.tsx +8 -8
  255. package/src/shared/components/Header.tsx +1 -1
  256. package/src/shared/components/OAuthModal.tsx +7 -7
  257. package/src/shared/components/OmniRouteLogo.tsx +3 -3
  258. package/src/shared/components/RequestLoggerDetail.tsx +3 -3
  259. package/src/shared/components/Sidebar.tsx +3 -3
  260. package/src/shared/components/compression/EngineConfigForm.tsx +1 -1
  261. package/src/shared/components/compression/EngineConfigPage.tsx +1 -1
  262. package/src/shared/components/docs/CodeBlock.stories.tsx +1 -1
  263. package/src/shared/components/docs/DocsSidebar.tsx +1 -1
  264. package/src/shared/components/flow/FlowCanvas.tsx +1 -1
  265. package/src/shared/components/layouts/DashboardLayout.tsx +1 -1
  266. package/src/shared/components/oauthBlobSubmit.ts +1 -1
  267. package/src/shared/constants/agentSkills.ts +14 -14
  268. package/src/shared/constants/appConfig.ts +3 -3
  269. package/src/shared/constants/cliCompatProviders.ts +1 -1
  270. package/src/shared/constants/cliTools.ts +12 -12
  271. package/src/shared/constants/dashboardCsrf.ts +1 -1
  272. package/src/shared/constants/featureFlagDefinitions.ts +31 -31
  273. package/src/shared/constants/headers.ts +15 -15
  274. package/src/shared/constants/mcpScopes.ts +36 -36
  275. package/src/shared/constants/models.ts +2 -2
  276. package/src/shared/constants/providers/apikey/enterprise-cloud.ts +5 -5
  277. package/src/shared/constants/providers/apikey/frontier-labs.ts +3 -3
  278. package/src/shared/constants/providers/apikey/gateways.ts +7 -7
  279. package/src/shared/constants/providers/apikey/specialty-media.ts +5 -5
  280. package/src/shared/constants/providers/noauth.ts +3 -3
  281. package/src/shared/constants/providers/oauth.ts +2 -2
  282. package/src/shared/constants/providers.ts +1 -1
  283. package/src/shared/constants/sidebarVisibility/sections.ts +1 -1
  284. package/src/shared/constants/sidebarVisibility.ts +1 -1
  285. package/src/shared/hooks/useDisplayBaseUrl.ts +1 -1
  286. package/src/shared/http/apiErrorMessage.ts +1 -1
  287. package/src/shared/middleware/chatBodyAdmission.ts +3 -3
  288. package/src/shared/network/outboundUrlGuard.ts +6 -6
  289. package/src/shared/network/safeOutboundFetch.ts +1 -1
  290. package/src/shared/reasoning/effortStandardization.ts +1 -1
  291. package/src/shared/schemas/qdrant.ts +1 -1
  292. package/src/shared/services/apiKeyResolver.ts +2 -2
  293. package/src/shared/services/cliRuntime.ts +1 -1
  294. package/src/shared/services/droidCustomModels.ts +8 -8
  295. package/src/shared/services/modelSyncScheduler.ts +6 -6
  296. package/src/shared/services/opencodeConfig.ts +5 -5
  297. package/src/shared/utils/apiKeyPolicy.ts +5 -5
  298. package/src/shared/utils/classify429.ts +1 -1
  299. package/src/shared/utils/clineAuth.ts +2 -2
  300. package/src/shared/utils/codexConfig.ts +1 -1
  301. package/src/shared/utils/compressionHeaderEcho.ts +7 -7
  302. package/src/shared/utils/cors.ts +1 -1
  303. package/src/shared/utils/featureFlags.ts +2 -2
  304. package/src/shared/utils/fetchError.ts +1 -1
  305. package/src/shared/utils/fetchTimeout.ts +1 -1
  306. package/src/shared/utils/freeModels.ts +1 -1
  307. package/src/shared/utils/logger.ts +2 -2
  308. package/src/shared/utils/nodeRuntimeSupport.ts +3 -3
  309. package/src/shared/utils/releaseNotes.ts +3 -3
  310. package/src/shared/utils/resolveOmniRouteBaseUrl.ts +7 -7
  311. package/src/shared/utils/secretsValidator.ts +1 -1
  312. package/src/shared/utils/secureRandom.ts +1 -1
  313. package/src/shared/validation/freeProxySchemas.ts +3 -3
  314. package/src/shared/validation/schemas/auth.ts +1 -1
  315. package/src/shared/validation/settingsSchemas.ts +1 -1
  316. package/src/sse/handlers/chat.ts +36 -36
  317. package/src/sse/handlers/chatHelpers.ts +14 -14
  318. package/src/sse/services/auth.ts +13 -13
  319. package/src/sse/services/cooldownAwareRetry.ts +1 -1
  320. package/src/sse/services/model.ts +2 -2
  321. package/src/sse/services/sessionAffinityPin.ts +1 -1
  322. package/src/sse/services/tokenRefresh.ts +1 -1
  323. package/src/types/global.d.ts +7 -7
  324. package/src/types/index.ts +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "blackriver-gateway",
3
- "version": "3.8.46",
3
+ "version": "3.8.48",
4
4
  "description": "BlackRiver Gateway — AI routing infrastructure by BlackRiver AI. 237 providers, one endpoint, auto-fallback, RTK+Caveman compression, MCP/A2A, desktop, PWA, and OpenAI-compatible APIs.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -97,11 +97,11 @@ export async function runAssessmentMigration(dbPath: string): Promise<void> {
97
97
  db.exec(MIGRATION_SQL);
98
98
 
99
99
  const versionRow = db
100
- .prepare("SELECT COUNT(*) as count FROM _omniroute_migrations WHERE name = ?")
100
+ .prepare("SELECT COUNT(*) as count FROM _BlackRiver Gateway_migrations WHERE name = ?")
101
101
  .get("assessment_engine") as { count: number };
102
102
  if (versionRow.count === 0) {
103
103
  db.prepare(
104
- "INSERT INTO _omniroute_migrations (name, applied_at) VALUES (?, datetime('now'))"
104
+ "INSERT INTO _BlackRiver Gateway_migrations (name, applied_at) VALUES (?, datetime('now'))"
105
105
  ).run("assessment_engine");
106
106
  }
107
107
 
@@ -1,4 +1,4 @@
1
- import { wildcardMatch } from "@omniroute/open-sse/services/wildcardRouter.ts";
1
+ import { wildcardMatch } from "@BlackRiver Gateway/open-sse/services/wildcardRouter.ts";
2
2
 
3
3
  type JsonRecord = Record<string, unknown>;
4
4
 
@@ -2,7 +2,7 @@ import {
2
2
  getAllModelLockouts,
3
3
  clearModelLock,
4
4
  type ModelLockoutInfo,
5
- } from "@omniroute/open-sse/services/accountFallback";
5
+ } from "@BlackRiver Gateway/open-sse/services/accountFallback";
6
6
 
7
7
  export type AvailabilityReportItem = Pick<
8
8
  ModelLockoutInfo,
@@ -1,5 +1,5 @@
1
1
  import { getProviderAlias } from "@/shared/constants/providers";
2
- import { OMNIROUTE_RESPONSE_HEADERS } from "@/shared/constants/headers";
2
+ import { BlackRiver Gateway_RESPONSE_HEADERS } from "@/shared/constants/headers";
3
3
  import { APP_CONFIG } from "@/shared/constants/appConfig";
4
4
 
5
5
  type UsageLike = Record<string, unknown> | null | undefined;
@@ -51,7 +51,7 @@ function toHeaderValue(value: string): string {
51
51
  return encodeURIComponent(toWellFormedUnicode(withoutControls));
52
52
  }
53
53
 
54
- export function getOmniRouteTokenCounts(usage: UsageLike): { input: number; output: number } {
54
+ export function getBlackRiver GatewayTokenCounts(usage: UsageLike): { input: number; output: number } {
55
55
  if (!usage || typeof usage !== "object") {
56
56
  return { input: 0, output: 0 };
57
57
  }
@@ -74,12 +74,12 @@ export function getOmniRouteTokenCounts(usage: UsageLike): { input: number; outp
74
74
  };
75
75
  }
76
76
 
77
- export function formatOmniRouteCost(costUsd: unknown): string {
77
+ export function formatBlackRiver GatewayCost(costUsd: unknown): string {
78
78
  const normalized = toFiniteNumber(costUsd);
79
79
  return normalized > 0 ? normalized.toFixed(10) : "0.0000000000";
80
80
  }
81
81
 
82
- export function buildOmniRouteResponseMetaHeaders({
82
+ export function buildBlackRiver GatewayResponseMetaHeaders({
83
83
  cacheHit = false,
84
84
  costUsd = 0,
85
85
  costSavedUsd = undefined,
@@ -96,7 +96,7 @@ export function buildOmniRouteResponseMetaHeaders({
96
96
  * Cost the cache AVOIDED. A semantic-cache HIT serves at ≈0 incremental cost
97
97
  * (`costUsd: 0`) but saved the original call's cost — surface it here so billing
98
98
  * consumers don't charge for hits while analytics can still see what was saved.
99
- * Emitted as `X-OmniRoute-Cost-Saved` only when provided (omitted on normal
99
+ * Emitted as `X-BlackRiver Gateway-Cost-Saved` only when provided (omitted on normal
100
100
  * responses); pass `0` to explicitly mark a free-model HIT that saved nothing.
101
101
  */
102
102
  costSavedUsd?: unknown;
@@ -107,48 +107,48 @@ export function buildOmniRouteResponseMetaHeaders({
107
107
  requestId?: string | null;
108
108
  usage?: UsageLike;
109
109
  }): Record<string, string> {
110
- const tokens = getOmniRouteTokenCounts(usage);
110
+ const tokens = getBlackRiver GatewayTokenCounts(usage);
111
111
  const headers: Record<string, string> = {
112
- [OMNIROUTE_RESPONSE_HEADERS.cacheHit]: toHeaderValue(String(cacheHit)),
113
- [OMNIROUTE_RESPONSE_HEADERS.latencyMs]: toHeaderValue(String(toNonNegativeInteger(latencyMs))),
114
- [OMNIROUTE_RESPONSE_HEADERS.responseCost]: toHeaderValue(formatOmniRouteCost(costUsd)),
115
- [OMNIROUTE_RESPONSE_HEADERS.tokensIn]: toHeaderValue(String(tokens.input)),
116
- [OMNIROUTE_RESPONSE_HEADERS.tokensOut]: toHeaderValue(String(tokens.output)),
117
- [OMNIROUTE_RESPONSE_HEADERS.version]: toHeaderValue(APP_CONFIG.version),
112
+ [BlackRiver Gateway_RESPONSE_HEADERS.cacheHit]: toHeaderValue(String(cacheHit)),
113
+ [BlackRiver Gateway_RESPONSE_HEADERS.latencyMs]: toHeaderValue(String(toNonNegativeInteger(latencyMs))),
114
+ [BlackRiver Gateway_RESPONSE_HEADERS.responseCost]: toHeaderValue(formatBlackRiver GatewayCost(costUsd)),
115
+ [BlackRiver Gateway_RESPONSE_HEADERS.tokensIn]: toHeaderValue(String(tokens.input)),
116
+ [BlackRiver Gateway_RESPONSE_HEADERS.tokensOut]: toHeaderValue(String(tokens.output)),
117
+ [BlackRiver Gateway_RESPONSE_HEADERS.version]: toHeaderValue(APP_CONFIG.version),
118
118
  };
119
119
 
120
120
  if (typeof model === "string" && model.trim().length > 0) {
121
- headers[OMNIROUTE_RESPONSE_HEADERS.model] = toHeaderValue(model);
121
+ headers[BlackRiver Gateway_RESPONSE_HEADERS.model] = toHeaderValue(model);
122
122
  }
123
123
 
124
124
  if (typeof requestId === "string" && requestId.trim().length > 0) {
125
- headers[OMNIROUTE_RESPONSE_HEADERS.requestId] = toHeaderValue(requestId);
125
+ headers[BlackRiver Gateway_RESPONSE_HEADERS.requestId] = toHeaderValue(requestId);
126
126
  }
127
127
 
128
128
  if (typeof provider === "string" && provider.trim().length > 0) {
129
- headers[OMNIROUTE_RESPONSE_HEADERS.provider] = toHeaderValue(getProviderAlias(provider));
129
+ headers[BlackRiver Gateway_RESPONSE_HEADERS.provider] = toHeaderValue(getProviderAlias(provider));
130
130
  }
131
131
 
132
132
  // Cache-saved cost: emitted only when the caller passes a value (cache HITs), so
133
133
  // non-cache responses keep their existing header shape. `0` is a valid saved cost.
134
134
  if (costSavedUsd != null) {
135
- headers[OMNIROUTE_RESPONSE_HEADERS.costSaved] = toHeaderValue(
136
- formatOmniRouteCost(costSavedUsd)
135
+ headers[BlackRiver Gateway_RESPONSE_HEADERS.costSaved] = toHeaderValue(
136
+ formatBlackRiver GatewayCost(costSavedUsd)
137
137
  );
138
138
  }
139
139
 
140
140
  const attempts = toNonNegativeInteger(fallbackAttempts);
141
141
  if (attempts > 0) {
142
- headers[OMNIROUTE_RESPONSE_HEADERS.fallbackAttempts] = toHeaderValue(String(attempts));
142
+ headers[BlackRiver Gateway_RESPONSE_HEADERS.fallbackAttempts] = toHeaderValue(String(attempts));
143
143
  }
144
144
 
145
145
  return headers;
146
146
  }
147
147
 
148
- export function buildOmniRouteSseMetadataComment(
149
- options: Parameters<typeof buildOmniRouteResponseMetaHeaders>[0]
148
+ export function buildBlackRiver GatewaySseMetadataComment(
149
+ options: Parameters<typeof buildBlackRiver GatewayResponseMetaHeaders>[0]
150
150
  ): string {
151
- const headers = buildOmniRouteResponseMetaHeaders(options);
151
+ const headers = buildBlackRiver GatewayResponseMetaHeaders(options);
152
152
  const lines = Object.entries(headers)
153
153
  .filter(([, value]) => typeof value === "string" && value.trim().length > 0)
154
154
  .map(([name, value]) => `: ${name.toLowerCase()}=${value}`);
@@ -157,15 +157,15 @@ export function buildOmniRouteSseMetadataComment(
157
157
  }
158
158
 
159
159
  /**
160
- * Single choke-point for attaching the X-OmniRoute-* response meta headers.
160
+ * Single choke-point for attaching the X-BlackRiver Gateway-* response meta headers.
161
161
  * Mutates `headers` in place (accepts a Headers instance OR a plain Record).
162
162
  * Use at EVERY non-streaming success return so no route forgets the telemetry.
163
163
  */
164
- export function attachOmniRouteMetaHeaders(
164
+ export function attachBlackRiver GatewayMetaHeaders(
165
165
  headers: Headers | Record<string, string>,
166
- meta: Parameters<typeof buildOmniRouteResponseMetaHeaders>[0]
166
+ meta: Parameters<typeof buildBlackRiver GatewayResponseMetaHeaders>[0]
167
167
  ): void {
168
- const built = buildOmniRouteResponseMetaHeaders(meta);
168
+ const built = buildBlackRiver GatewayResponseMetaHeaders(meta);
169
169
  if (headers instanceof Headers) {
170
170
  for (const [name, value] of Object.entries(built)) headers.set(name, value);
171
171
  } else {
@@ -174,21 +174,21 @@ export function attachOmniRouteMetaHeaders(
174
174
  }
175
175
 
176
176
  /**
177
- * Attach the X-OmniRoute-* meta headers onto an already-built Response, ADDING
177
+ * Attach the X-BlackRiver Gateway-* meta headers onto an already-built Response, ADDING
178
178
  * (never replacing) headers so the original Content-Type / body stay intact.
179
179
  * Tries to mutate in place; if the Response headers are immutable, clones the
180
180
  * Response carrying over body + status + headers (mirrors
181
181
  * `chatHelpers.ts::withSessionHeader`). Use for opaque handler-built Responses
182
182
  * (audio streams, passthrough proxies) where the body cannot be re-serialized.
183
183
  */
184
- export function attachOmniRouteMetaToResponse(
184
+ export function attachBlackRiver GatewayMetaToResponse(
185
185
  response: Response,
186
- meta: Parameters<typeof buildOmniRouteResponseMetaHeaders>[0]
186
+ meta: Parameters<typeof buildBlackRiver GatewayResponseMetaHeaders>[0]
187
187
  ): Response {
188
188
  if (!response) return response;
189
189
 
190
190
  try {
191
- attachOmniRouteMetaHeaders(response.headers, meta);
191
+ attachBlackRiver GatewayMetaHeaders(response.headers, meta);
192
192
  return response;
193
193
  } catch {
194
194
  const cloned = new Response(response.body, {
@@ -196,7 +196,7 @@ export function attachOmniRouteMetaToResponse(
196
196
  statusText: response.statusText,
197
197
  headers: response.headers,
198
198
  });
199
- attachOmniRouteMetaHeaders(cloned.headers, meta);
199
+ attachBlackRiver GatewayMetaHeaders(cloned.headers, meta);
200
200
  return cloned;
201
201
  }
202
202
  }
@@ -13,9 +13,9 @@
13
13
  * @module domain/quotaCache
14
14
  */
15
15
 
16
- import { getUsageForProvider } from "@omniroute/open-sse/services/usage.ts";
16
+ import { getUsageForProvider } from "@BlackRiver Gateway/open-sse/services/usage.ts";
17
17
  import { getProviderConnectionById, resolveProxyForConnection } from "@/lib/localDb";
18
- import { runWithProxyContext } from "@omniroute/open-sse/utils/proxyFetch.ts";
18
+ import { runWithProxyContext } from "@BlackRiver Gateway/open-sse/utils/proxyFetch.ts";
19
19
  import { safePercentage } from "@/shared/utils/formatting";
20
20
  import {
21
21
  saveQuotaSnapshot,
@@ -23,7 +23,7 @@ import {
23
23
  getLatestQuotaSnapshotsForConnection,
24
24
  } from "@/lib/db/quotaSnapshots";
25
25
  import { recordProviderQuotaResetEventIfChanged } from "@/lib/db/quotaResetEvents";
26
- import { getCodexQuotaWindowFilterForModel } from "@omniroute/open-sse/config/codexQuotaScopes.ts";
26
+ import { getCodexQuotaWindowFilterForModel } from "@BlackRiver Gateway/open-sse/config/codexQuotaScopes.ts";
27
27
 
28
28
  // ─── Types ──────────────────────────────────────────────────────────────────
29
29
 
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Domain Types — FASE-03 Architecture Refactoring
3
3
  *
4
- * Centralized type definitions for the OmniRoute domain layer.
4
+ * Centralized type definitions for the BlackRiver Gateway domain layer.
5
5
  * Uses JSDoc for type safety without TypeScript compilation.
6
6
  *
7
7
  * @module domain/types
@@ -2,7 +2,7 @@
2
2
  * A2A Routing Decision Logger
3
3
  *
4
4
  * Records every routing decision to the `routing_decisions` SQLite table.
5
- * Used by `omniroute_explain_route` (T03) and future learning router.
5
+ * Used by `BlackRiver Gateway_explain_route` (T03) and future learning router.
6
6
  * Retention: 7 days default.
7
7
  */
8
8
 
@@ -5,7 +5,7 @@
5
5
  */
6
6
 
7
7
  import type { A2ATask, TaskArtifact } from "../taskManager";
8
- import { resolveOmniRouteBaseUrl } from "@/shared/utils/resolveOmniRouteBaseUrl";
8
+ import { resolveBlackRiver GatewayBaseUrl } from "@/shared/utils/resolveBlackRiver GatewayBaseUrl";
9
9
  import { formatCost } from "@/shared/utils/formatting";
10
10
 
11
11
  type AnalyticsRecord = Record<string, unknown>;
@@ -17,8 +17,8 @@ type CostEntry = {
17
17
  tokens: number;
18
18
  };
19
19
 
20
- const OMNIROUTE_BASE_URL = resolveOmniRouteBaseUrl();
21
- const OMNIROUTE_API_KEY = process.env.OMNIROUTE_API_KEY || "";
20
+ const BlackRiver Gateway_BASE_URL = resolveBlackRiver GatewayBaseUrl();
21
+ const BlackRiver Gateway_API_KEY = process.env.BlackRiver Gateway_API_KEY || "";
22
22
 
23
23
  function detectRange(task: A2ATask): string {
24
24
  const metadataRange = task.input.metadata?.range;
@@ -33,10 +33,10 @@ function detectRange(task: A2ATask): string {
33
33
  }
34
34
 
35
35
  async function costFetch(path: string): Promise<AnalyticsRecord> {
36
- const url = `${OMNIROUTE_BASE_URL}${path}`;
36
+ const url = `${BlackRiver Gateway_BASE_URL}${path}`;
37
37
  const headers: Record<string, string> = {
38
38
  "Content-Type": "application/json",
39
- ...(OMNIROUTE_API_KEY ? { Authorization: `Bearer ${OMNIROUTE_API_KEY}` } : {}),
39
+ ...(BlackRiver Gateway_API_KEY ? { Authorization: `Bearer ${BlackRiver Gateway_API_KEY}` } : {}),
40
40
  };
41
41
  const response = await fetch(url, { headers, signal: AbortSignal.timeout(15000) });
42
42
  if (!response.ok) {
@@ -5,7 +5,7 @@
5
5
  */
6
6
 
7
7
  import type { A2ATask, TaskArtifact } from "../taskManager";
8
- import { resolveOmniRouteBaseUrl } from "@/shared/utils/resolveOmniRouteBaseUrl";
8
+ import { resolveBlackRiver GatewayBaseUrl } from "@/shared/utils/resolveBlackRiver GatewayBaseUrl";
9
9
 
10
10
  type JsonRecord = Record<string, unknown>;
11
11
 
@@ -16,14 +16,14 @@ type ProviderHealthEntry = {
16
16
  lastFailure?: string | null;
17
17
  };
18
18
 
19
- const OMNIROUTE_BASE_URL = resolveOmniRouteBaseUrl();
20
- const OMNIROUTE_API_KEY = process.env.OMNIROUTE_API_KEY || "";
19
+ const BlackRiver Gateway_BASE_URL = resolveBlackRiver GatewayBaseUrl();
20
+ const BlackRiver Gateway_API_KEY = process.env.BlackRiver Gateway_API_KEY || "";
21
21
 
22
22
  async function healthFetch(path: string): Promise<JsonRecord> {
23
- const url = `${OMNIROUTE_BASE_URL}${path}`;
23
+ const url = `${BlackRiver Gateway_BASE_URL}${path}`;
24
24
  const headers: Record<string, string> = {
25
25
  "Content-Type": "application/json",
26
- ...(OMNIROUTE_API_KEY ? { Authorization: `Bearer ${OMNIROUTE_API_KEY}` } : {}),
26
+ ...(BlackRiver Gateway_API_KEY ? { Authorization: `Bearer ${BlackRiver Gateway_API_KEY}` } : {}),
27
27
  };
28
28
  const response = await fetch(url, { headers, signal: AbortSignal.timeout(10000) });
29
29
  if (!response.ok) {
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * A2A Skill: List Capabilities
3
3
  *
4
- * Returns the full catalog of OmniRoute agent skills (22 API + 20 CLI + config)
4
+ * Returns the full catalog of BlackRiver Gateway agent skills (22 API + 20 CLI + config)
5
5
  * as a markdown table with raw SKILL.md URLs for orchestrating agents.
6
6
  */
7
7
 
@@ -45,7 +45,7 @@ export async function executeListCapabilities(_task: A2ATask): Promise<ListCapab
45
45
  const table = buildMarkdownTable(catalog);
46
46
 
47
47
  const content = [
48
- `# OmniRoute Agent Skills Catalog`,
48
+ `# BlackRiver Gateway Agent Skills Catalog`,
49
49
  ``,
50
50
  `Total: ${catalog.length} skills (${coverage.api.total} API + ${coverage.cli.total} CLI)`,
51
51
  ``,
@@ -14,7 +14,7 @@ import {
14
14
  SEARCH_PROVIDERS,
15
15
  VIDEO_PROVIDER_IDS,
16
16
  } from "@/shared/constants/providers";
17
- import { REGISTRY } from "@omniroute/open-sse/config/providerRegistry.ts";
17
+ import { REGISTRY } from "@BlackRiver Gateway/open-sse/config/providerRegistry.ts";
18
18
 
19
19
  type ProviderConnectionLike = {
20
20
  id?: string;
@@ -7,16 +7,16 @@
7
7
 
8
8
  import type { A2ATask, TaskArtifact } from "../taskManager";
9
9
  import { normalizeQuotaResponse } from "@/shared/contracts/quota";
10
- import { resolveOmniRouteBaseUrl } from "@/shared/utils/resolveOmniRouteBaseUrl";
10
+ import { resolveBlackRiver GatewayBaseUrl } from "@/shared/utils/resolveBlackRiver GatewayBaseUrl";
11
11
 
12
- const OMNIROUTE_BASE_URL = resolveOmniRouteBaseUrl();
13
- const OMNIROUTE_API_KEY = process.env.OMNIROUTE_API_KEY || "";
12
+ const BlackRiver Gateway_BASE_URL = resolveBlackRiver GatewayBaseUrl();
13
+ const BlackRiver Gateway_API_KEY = process.env.BlackRiver Gateway_API_KEY || "";
14
14
 
15
15
  async function quotaFetch(path: string): Promise<any> {
16
- const url = `${OMNIROUTE_BASE_URL}${path}`;
16
+ const url = `${BlackRiver Gateway_BASE_URL}${path}`;
17
17
  const headers: Record<string, string> = {
18
18
  "Content-Type": "application/json",
19
- ...(OMNIROUTE_API_KEY ? { Authorization: `Bearer ${OMNIROUTE_API_KEY}` } : {}),
19
+ ...(BlackRiver Gateway_API_KEY ? { Authorization: `Bearer ${BlackRiver Gateway_API_KEY}` } : {}),
20
20
  };
21
21
  const res = await fetch(url, { headers, signal: AbortSignal.timeout(10000) });
22
22
  if (!res.ok) throw new Error(`API [${res.status}]`);
@@ -1,21 +1,21 @@
1
1
  /**
2
2
  * A2A Skill: Smart Routing
3
3
  *
4
- * Receives a prompt + metadata → routes via OmniRoute pipeline →
4
+ * Receives a prompt + metadata → routes via BlackRiver Gateway pipeline →
5
5
  * returns response with routing_explanation, cost_envelope, resilience_trace, policy_verdict.
6
6
  */
7
7
 
8
8
  import type { A2ATask, TaskArtifact } from "../taskManager";
9
- import { resolveOmniRouteBaseUrl } from "@/shared/utils/resolveOmniRouteBaseUrl";
9
+ import { resolveBlackRiver GatewayBaseUrl } from "@/shared/utils/resolveBlackRiver GatewayBaseUrl";
10
10
 
11
- const OMNIROUTE_BASE_URL = resolveOmniRouteBaseUrl();
12
- const OMNIROUTE_API_KEY = process.env.OMNIROUTE_API_KEY || "";
11
+ const BlackRiver Gateway_BASE_URL = resolveBlackRiver GatewayBaseUrl();
12
+ const BlackRiver Gateway_API_KEY = process.env.BlackRiver Gateway_API_KEY || "";
13
13
 
14
14
  async function routeFetch(path: string, options: RequestInit = {}): Promise<any> {
15
- const url = `${OMNIROUTE_BASE_URL}${path}`;
15
+ const url = `${BlackRiver Gateway_BASE_URL}${path}`;
16
16
  const headers: Record<string, string> = {
17
17
  "Content-Type": "application/json",
18
- ...(OMNIROUTE_API_KEY ? { Authorization: `Bearer ${OMNIROUTE_API_KEY}` } : {}),
18
+ ...(BlackRiver Gateway_API_KEY ? { Authorization: `Bearer ${BlackRiver Gateway_API_KEY}` } : {}),
19
19
  };
20
20
  const res = await fetch(url, { ...options, headers, signal: AbortSignal.timeout(30000) });
21
21
  if (!res.ok) throw new Error(`API [${res.status}]: ${await res.text().catch(() => "error")}`);
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * CLI access-token scopes — the 3-level hierarchy used by remote mode.
3
3
  *
4
- * These tokens authorize the `omniroute` CLI (and dashboard) to run *management*
5
- * commands against a (possibly remote) OmniRoute server. They are distinct from
4
+ * These tokens authorize the `BlackRiver Gateway` CLI (and dashboard) to run *management*
5
+ * commands against a (possibly remote) BlackRiver Gateway server. They are distinct from
6
6
  * inference API keys (`api_keys`), which authorize `/v1/chat/completions` traffic.
7
7
  *
8
8
  * Hierarchy (admin ⊃ write ⊃ read):
@@ -5,7 +5,7 @@
5
5
  * Communication happens via stdin/stdout (JSON-RPC style) or piped HTTP.
6
6
  *
7
7
  * This module provides a "CLI-as-backend" transport: instead of intercepting
8
- * HTTP API calls, OmniRoute spawns the CLI directly and feeds prompts through
8
+ * HTTP API calls, BlackRiver Gateway spawns the CLI directly and feeds prompts through
9
9
  * its native interface.
10
10
  */
11
11
 
@@ -26,7 +26,7 @@ export interface CliAgentInfo {
26
26
  version: string | null;
27
27
  /** Whether the agent is installed and available */
28
28
  installed: boolean;
29
- /** Provider ID that this agent maps to in OmniRoute */
29
+ /** Provider ID that this agent maps to in BlackRiver Gateway */
30
30
  providerAlias: string;
31
31
  /** Arguments to pass when spawning for ACP */
32
32
  spawnArgs: string[];
@@ -109,7 +109,7 @@ function buildApiBody(skill: AgentSkill, sources: BuildSources): string {
109
109
  const curlMethod = op.method === "GET" ? "" : `-X ${op.method} `;
110
110
  lines.push("```bash");
111
111
  lines.push(`curl ${curlMethod}https://localhost:20128${op.path} \\`);
112
- lines.push(' -H "Authorization: Bearer $OMNIROUTE_TOKEN"');
112
+ lines.push(' -H "Authorization: Bearer $BlackRiver Gateway_TOKEN"');
113
113
  if (["POST", "PUT", "PATCH"].includes(op.method)) {
114
114
  lines.push(' -H "Content-Type: application/json" \\');
115
115
  lines.push(" -d '{}'");
@@ -141,8 +141,8 @@ function buildCliBody(skill: AgentSkill, sources: BuildSources): string {
141
141
 
142
142
  lines.push("## Quick install\n");
143
143
  lines.push("```bash");
144
- lines.push("npm install -g omniroute # or: npx omniroute");
145
- lines.push("omniroute --version");
144
+ lines.push("npm install -g BlackRiver Gateway # or: npx BlackRiver Gateway");
145
+ lines.push("BlackRiver Gateway --version");
146
146
  lines.push("```");
147
147
  lines.push("");
148
148
 
@@ -169,7 +169,7 @@ function buildCliBody(skill: AgentSkill, sources: BuildSources): string {
169
169
 
170
170
  lines.push("**Example:**\n");
171
171
  lines.push("```bash");
172
- lines.push(`omniroute ${cmd.name}`);
172
+ lines.push(`BlackRiver Gateway ${cmd.name}`);
173
173
  lines.push("```");
174
174
  lines.push("");
175
175
  }
@@ -7,7 +7,7 @@
7
7
  * optional `details` payload, and the current `requestId` for log
8
8
  * correlation. The prior shape returned `{ error: <string|object> }` with
9
9
  * no `code` field, which forced clients to string-match English error
10
- * messages. See `plans/2026-06-23-omniroute-v3.8.34-deep-audit.md` (Bug #3).
10
+ * messages. See `plans/2026-06-23-BlackRiver Gateway-v3.8.34-deep-audit.md` (Bug #3).
11
11
  *
12
12
  * Usage:
13
13
  * return comboErrorResponse("COMBO_002", 400, { issues: validation.issues });
@@ -4,10 +4,10 @@ import { handleValidatedEmbeddingRequestBody } from "@/app/api/v1/embeddings/rou
4
4
  import { POST as postRerank } from "@/app/api/v1/rerank/route";
5
5
  import { buildComboTestRequestBody, extractComboTestResponseText } from "@/lib/combos/testHealth";
6
6
  import { getCustomModels } from "@/lib/localDb";
7
- import { sanitizeErrorMessage } from "@omniroute/open-sse/utils/error";
8
- import { withRateLimit } from "@omniroute/open-sse/services/rateLimitManager";
7
+ import { sanitizeErrorMessage } from "@BlackRiver Gateway/open-sse/utils/error";
8
+ import { withRateLimit } from "@BlackRiver Gateway/open-sse/services/rateLimitManager";
9
9
 
10
- const INTERNAL_ORIGIN = "http://omniroute.internal";
10
+ const INTERNAL_ORIGIN = "http://BlackRiver Gateway.internal";
11
11
  const DEFAULT_TEST_TIMEOUT_MS = 10_000;
12
12
  const DOLA_PRO_TEST_TIMEOUT_MS = 90_000;
13
13
  const DOUBAO_WEB_PROVIDER_ID = "doubao-web";
@@ -120,7 +120,7 @@ function buildInternalChatRequest(testBody: Record<string, unknown>, signal: Abo
120
120
  "Content-Type": "application/json",
121
121
  // Reuse the existing strict-mode internal bypass for live health checks.
122
122
  "X-Internal-Test": "combo-health-check",
123
- "X-OmniRoute-No-Cache": "true",
123
+ "X-BlackRiver Gateway-No-Cache": "true",
124
124
  "X-Request-Id": `model-test-${randomUUID()}`,
125
125
  },
126
126
  body: JSON.stringify(testBody),
@@ -134,7 +134,7 @@ function buildInternalRerankRequest(testBody: Record<string, unknown>, signal: A
134
134
  headers: {
135
135
  "Content-Type": "application/json",
136
136
  "X-Internal-Test": "combo-health-check",
137
- "X-OmniRoute-No-Cache": "true",
137
+ "X-BlackRiver Gateway-No-Cache": "true",
138
138
  "X-Request-Id": `model-test-${randomUUID()}`,
139
139
  },
140
140
  body: JSON.stringify(testBody),
@@ -230,9 +230,9 @@ export async function runSingleModelTest(
230
230
  const testBody = isRerank
231
231
  ? {
232
232
  model: fullModelStr,
233
- query: "What is OmniRoute?",
233
+ query: "What is BlackRiver Gateway?",
234
234
  documents: [
235
- "OmniRoute routes AI requests across configured providers.",
235
+ "BlackRiver Gateway routes AI requests across configured providers.",
236
236
  "This document is unrelated to the test query.",
237
237
  ],
238
238
  top_n: 1,
@@ -10,7 +10,7 @@ import {
10
10
  import { createErrorResponse, createErrorResponseFromUnknown } from "@/lib/api/errorResponse";
11
11
  import { createProxyRegistrySchema, updateProxyRegistrySchema } from "@/shared/validation/schemas";
12
12
  import { isValidationFailure, validateBody } from "@/shared/validation/helpers";
13
- import { clearDispatcherCache } from "@omniroute/open-sse/utils/proxyDispatcher";
13
+ import { clearDispatcherCache } from "@BlackRiver Gateway/open-sse/utils/proxyDispatcher";
14
14
 
15
15
  async function readJsonBody(request: Request) {
16
16
  try {
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Extract a human-readable message from a parsed API error body.
3
3
  *
4
- * OmniRoute API error bodies follow the shape produced by
4
+ * BlackRiver Gateway API error bodies follow the shape produced by
5
5
  * `comboErrorResponse`/`buildErrorBody`:
6
6
  *
7
7
  * { error: { message: string, details?: Array<{ message?: string }> } }
@@ -165,11 +165,11 @@ function proxyUpgrade(
165
165
  }
166
166
 
167
167
  declare global {
168
- var __omnirouteApiBridgeStarted: boolean | undefined;
168
+ var __BlackRiver GatewayApiBridgeStarted: boolean | undefined;
169
169
  }
170
170
 
171
171
  export function initApiBridgeServer(): void {
172
- if (globalThis.__omnirouteApiBridgeStarted) return;
172
+ if (globalThis.__BlackRiver GatewayApiBridgeStarted) return;
173
173
 
174
174
  const { apiPort, dashboardPort } = getRuntimePorts();
175
175
  if (apiPort === dashboardPort) return;
@@ -227,7 +227,7 @@ export function initApiBridgeServer(): void {
227
227
  });
228
228
 
229
229
  server.listen(apiPort, host, () => {
230
- globalThis.__omnirouteApiBridgeStarted = true;
230
+ globalThis.__BlackRiver GatewayApiBridgeStarted = true;
231
231
  console.log(`[API Bridge] Listening on ${host}:${apiPort} -> dashboard:${dashboardPort}`);
232
232
  });
233
233
  }
@@ -104,7 +104,7 @@ const ARENA_ELO_API_BASE = "https://api.wulong.dev/arena-ai-leaderboards/v1/lead
104
104
  const FETCH_CATEGORIES = ["text", "code"] as const;
105
105
 
106
106
  /**
107
- * Maps Arena leaderboard categories to OmniRoute task-type categories.
107
+ * Maps Arena leaderboard categories to BlackRiver Gateway task-type categories.
108
108
  *
109
109
  * - "text" leaderboard → default, review, documentation, debugging
110
110
  * - "code" leaderboard → coding
@@ -140,9 +140,9 @@ const VENDOR_PREFIXES = [
140
140
  ] as const;
141
141
 
142
142
  /**
143
- * OmniRoute model aliases: canonical name → known aliases.
143
+ * BlackRiver Gateway model aliases: canonical name → known aliases.
144
144
  * Creates additional DB entries for each alias so that models
145
- * are findable under any name OmniRoute uses internally.
145
+ * are findable under any name BlackRiver Gateway uses internally.
146
146
  */
147
147
  const MODEL_ALIAS_MAP: Record<string, string[]> = {
148
148
  "claude-opus-4-6-thinking": ["claude-opus-4", "anthropic/claude-opus-4"],
@@ -291,11 +291,11 @@ function computeConfidence(votes: number): "high" | "medium" | "low" {
291
291
  * This ensures scores never reach 0 or 1, leaving room for user overrides.
292
292
  * Models with fewer than 100 votes are marked as confidence="low".
293
293
  *
294
- * Leaderboard categories are mapped to OmniRoute task types:
294
+ * Leaderboard categories are mapped to BlackRiver Gateway task types:
295
295
  * - "text" → default, review, documentation, debugging
296
296
  * - "code" → coding
297
297
  *
298
- * Known OmniRoute model aliases are also expanded into additional entries.
298
+ * Known BlackRiver Gateway model aliases are also expanded into additional entries.
299
299
  *
300
300
  * @param data - Map of leaderboard category → Arena leaderboard data.
301
301
  * @returns Array of model intelligence entries ready for DB upsert.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Helper used by the `OMNIROUTE_BUILD_PROFILE=minimal` stubs to surface a
2
+ * Helper used by the `BlackRiver Gateway_BUILD_PROFILE=minimal` stubs to surface a
3
3
  * consistent "this feature was compiled out" error. Routes that depend on a
4
4
  * stubbed module should catch the error and return HTTP 503 with a clear
5
5
  * message; we don't want the bundle to silently fail.
@@ -10,8 +10,8 @@ export class FeatureDisabledError extends Error {
10
10
  readonly featureName: string;
11
11
  constructor(featureName: string) {
12
12
  super(
13
- `Feature "${featureName}" is disabled in this build (OMNIROUTE_BUILD_PROFILE=minimal). ` +
14
- `Install the full omniroute artifact instead of omniroute-secure if you need this feature.`
13
+ `Feature "${featureName}" is disabled in this build (BlackRiver Gateway_BUILD_PROFILE=minimal). ` +
14
+ `Install the full BlackRiver Gateway artifact instead of BlackRiver Gateway-secure if you need this feature.`
15
15
  );
16
16
  this.name = "FeatureDisabledError";
17
17
  this.featureName = featureName;
@@ -6,7 +6,7 @@
6
6
  */
7
7
 
8
8
  import { getSettings } from "./db/settings";
9
- import type { CacheControlMode } from "@omniroute/open-sse/utils/cacheControlPolicy";
9
+ import type { CacheControlMode } from "@BlackRiver Gateway/open-sse/utils/cacheControlPolicy";
10
10
 
11
11
  let cachedSettings: CacheControlMode | null = null;
12
12
 
@@ -88,7 +88,7 @@ function writeCache(data: CatalogEntry[]): void {
88
88
  async function fetchFromAPI(): Promise<CatalogEntry[]> {
89
89
  const res = await fetch(OPENROUTER_API_URL, {
90
90
  headers: {
91
- "User-Agent": "OmniRoute/2.0",
91
+ "User-Agent": "BlackRiver Gateway/2.0",
92
92
  Accept: "application/json",
93
93
  },
94
94
  signal: AbortSignal.timeout(15_000),