@fudrouter/fsrouter 0.6.68 → 0.6.70

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 (66) hide show
  1. package/bin/hooks/postinstall.js +25 -2
  2. package/dist/lib/oauth/providers.js +1 -1
  3. package/dist/open-sse/config/cliFingerprints.js +1 -1
  4. package/dist/open-sse/executors/commandCode.js +1 -1
  5. package/dist/open-sse/executors/default.js +1 -1
  6. package/dist/open-sse/handlers/chatCore/nonStreamingHandler.js +1 -1
  7. package/dist/open-sse/handlers/chatCore/requestDetail.js +1 -1
  8. package/dist/open-sse/handlers/chatCore/sseToJsonHandler.js +1 -1
  9. package/dist/open-sse/handlers/chatCore/streamingHandler.js +1 -1
  10. package/dist/open-sse/handlers/imageProviders/leonardo.js +1 -1
  11. package/dist/open-sse/handlers/imageProviders/weavy.js +1 -1
  12. package/dist/open-sse/handlers/videoProviders/weavy.js +1 -1
  13. package/dist/open-sse/mcp-server/catalog.js +1 -1
  14. package/dist/open-sse/mcp-server/server.js +2 -2
  15. package/dist/open-sse/mcp-server/tools/advancedTools.js +2 -2
  16. package/dist/open-sse/mcp-server/tools/agentSkillTools.js +1 -1
  17. package/dist/open-sse/mcp-server/tools/compressionTools.js +4 -4
  18. package/dist/open-sse/mcp-server/tools/gamificationTools.js +10 -10
  19. package/dist/open-sse/mcp-server/tools/githubSkillTools.js +1 -1
  20. package/dist/open-sse/mcp-server/tools/memoryTools.js +3 -3
  21. package/dist/open-sse/mcp-server/tools/notionTools.js +2 -2
  22. package/dist/open-sse/mcp-server/tools/obsidianTools.js +2 -2
  23. package/dist/open-sse/mcp-server/tools/pickFastestModel.js +1 -1
  24. package/dist/open-sse/mcp-server/tools/pluginTools.js +4 -4
  25. package/dist/open-sse/mcp-server/tools/skillTools.js +2 -2
  26. package/dist/open-sse/services/combo/quotaExhaustionCutoff.js +2 -2
  27. package/dist/open-sse/services/combo/quotaShareStrategy.js +1 -1
  28. package/dist/open-sse/services/combo/resolveAutoStrategy.js +1 -1
  29. package/dist/open-sse/services/combo/sessionStickiness.js +1 -1
  30. package/dist/open-sse/services/combo/targetSorters.js +2 -2
  31. package/dist/open-sse/services/combo/validateQuality.js +1 -1
  32. package/dist/open-sse/services/comboConfig.js +1 -1
  33. package/dist/open-sse/services/emergencyFallback.js +1 -1
  34. package/dist/open-sse/services/proxyAutoSelector.js +1 -1
  35. package/dist/open-sse/services/tokenRefresh/providers.js +3 -3
  36. package/dist/open-sse/utils/cursorImages.js +1 -1
  37. package/dist/open-sse/utils/keepaliveThreshold.js +4 -4
  38. package/dist/open-sse/utils/noThinkingAlias.js +1 -1
  39. package/dist/open-sse/utils/responsesStatePolicy.js +1 -1
  40. package/open-sse/executors/cliproxyapi.js +2 -2
  41. package/open-sse/executors/default.js +1 -1
  42. package/open-sse/handlers/imageProviders/leonardo.js +1 -1
  43. package/open-sse/mcp-server/catalog.js +1 -1
  44. package/open-sse/mcp-server/server.js +2 -2
  45. package/open-sse/mcp-server/tools/advancedTools.js +2 -2
  46. package/open-sse/mcp-server/tools/compressionTools.js +4 -4
  47. package/open-sse/mcp-server/tools/gamificationTools.js +10 -10
  48. package/open-sse/mcp-server/tools/notionTools.js +2 -2
  49. package/open-sse/mcp-server/tools/obsidianTools.js +2 -2
  50. package/open-sse/mcp-server/tools/pickFastestModel.js +1 -1
  51. package/open-sse/mcp-server/tools/pluginTools.js +4 -4
  52. package/open-sse/package.json +10 -0
  53. package/open-sse/providers/shared.js +2 -2
  54. package/open-sse/services/combo/quotaExhaustionCutoff.js +2 -2
  55. package/open-sse/services/combo/quotaShareStrategy.js +1 -1
  56. package/open-sse/services/combo/resolveAutoStrategy.js +1 -1
  57. package/open-sse/services/combo/sessionStickiness.js +1 -1
  58. package/open-sse/services/combo/targetSorters.js +2 -2
  59. package/open-sse/services/combo/validateQuality.js +1 -1
  60. package/open-sse/services/comboConfig.js +1 -1
  61. package/open-sse/services/rateLimitManager.js +4 -4
  62. package/open-sse/services/thinkingBudget.js +4 -2
  63. package/open-sse/services/tokenRefresh/providers.js +3 -3
  64. package/open-sse/translator/request/claude-to-kiro.js +1 -1
  65. package/open-sse/translator/request/openai-to-kiro.js +2 -2
  66. package/package.json +1 -1
@@ -1,10 +1,33 @@
1
1
  #!/usr/bin/env node
2
2
 
3
+ import { createRequire } from "module";
4
+ const require = createRequire(import.meta.url);
5
+ const __dirname = new URL(".", import.meta.url).pathname;
6
+
3
7
  // Postinstall: warm-up SQLite deps into ~/.9router/runtime so the first
4
8
  // `9router` start doesn't need network. Failure here is non-fatal —
5
9
  // cli.js will retry at runtime if anything is missing.
6
- const { ensureSqliteRuntime } = require("./sqliteRuntime");
7
- const { ensureTrayRuntime } = require("./trayRuntime");
10
+ const { ensureSqliteRuntime } = require("./sqliteRuntime.cjs");
11
+ const { ensureTrayRuntime } = require("./trayRuntime.cjs");
12
+ const fs = require("fs");
13
+ const path = require("path");
14
+
15
+ // Fix ESM bare import for open-sse
16
+ try {
17
+ const pkgRoot = path.resolve(__dirname, "../..");
18
+ const nodeModules = path.join(pkgRoot, "node_modules");
19
+ const openSseDir = path.join(pkgRoot, "open-sse");
20
+ const target = path.join(nodeModules, "open-sse");
21
+
22
+ if (fs.existsSync(openSseDir) && fs.existsSync(nodeModules)) {
23
+ if (!fs.existsSync(target)) {
24
+ fs.symlinkSync("../open-sse", target, "junction");
25
+ console.log("[9router] created symlink open-sse -> node_modules");
26
+ }
27
+ }
28
+ } catch (e) {
29
+ console.warn(`[9router] failed to create open-sse symlink: ${e.message}`);
30
+ }
8
31
 
9
32
  try {
10
33
  ensureSqliteRuntime({ silent: false });
@@ -7,7 +7,7 @@
7
7
  import '../../../open-sse/index.js';
8
8
  import crypto from "crypto";
9
9
 
10
- import { generatePKCE, generateState } from "./utils/pkce";
10
+ import { generatePKCE, generateState } from "./utils/pkce.js";
11
11
  import {
12
12
  CLAUDE_CONFIG,
13
13
  CODEX_CONFIG,
@@ -4,7 +4,7 @@ import {
4
4
  GITHUB_COPILOT_CHAT_USER_AGENT,
5
5
  getQwenOauthHeaders
6
6
  } from "./providerHeaderProfiles.ts";
7
- import { normalizeCliCompatProviderId } from '../../dist/shared/utils/cliCompat.js';
7
+ import { normalizeCliCompatProviderId } from '../../../dist/shared/utils/cliCompat.js';
8
8
  const CLI_FINGERPRINTS = {
9
9
  codex: {
10
10
  headerOrder: [
@@ -1,5 +1,5 @@
1
1
  import { randomUUID } from "node:crypto";
2
- import { isVisionModelId } from '../../dist/shared/constants/visionModels.js';
2
+ import { isVisionModelId } from '../../../dist/shared/constants/visionModels.js';
3
3
  import { REGISTRY } from "../config/providerRegistry.ts";
4
4
  import { BaseExecutor, mergeUpstreamExtraHeaders } from "./base.ts";
5
5
  const COMMAND_CODE_VERSION = process.env.COMMAND_CODE_VERSION?.trim() || "0.33.2";
@@ -1,7 +1,7 @@
1
1
  import { BaseExecutor } from "./base.js";
2
2
  import { PROVIDERS } from "../config/providers.js";
3
3
  import { OAUTH_ENDPOINTS, buildKimiHeaders, getKimchiVersionSync } from "../config/appConstants.js";
4
- import { buildClineHeaders } from '../../dist/shared/utils/clineAuth.js';
4
+ import { buildClineHeaders } from '../../../dist/shared/utils/clineAuth.js';
5
5
  import { getCachedClaudeHeaders } from "../utils/claudeHeaderCache.js";
6
6
  import { proxyAwareFetch } from "../utils/proxyFetch.js";
7
7
  import { injectReasoningContent } from "../utils/reasoningContentInjector.js";
@@ -6,7 +6,7 @@ import { createErrorResult } from "../../utils/error.js";
6
6
  import { HTTP_STATUS } from "../../config/runtimeConfig.js";
7
7
  import { parseSSEToOpenAIResponse } from "./sseToJsonHandler.js";
8
8
  import { buildRequestDetail, extractRequestConfig, extractUsageFromResponse, saveUsageStats } from "./requestDetail.js";
9
- import { appendRequestLog, saveRequestDetail } from '../../../dist/lib/usageDb.js';
9
+ import { appendRequestLog, saveRequestDetail } from '../../../../dist/lib/usageDb.js';
10
10
  import { decloakToolNames } from "../../utils/claudeCloaking.js";
11
11
 
12
12
  /**
@@ -1,4 +1,4 @@
1
- import { saveRequestUsage, appendRequestLog, saveRequestDetail } from '../../../dist/lib/usageDb.js';
1
+ import { saveRequestUsage, appendRequestLog, saveRequestDetail } from '../../../../dist/lib/usageDb.js';
2
2
  import { COLORS } from "../../utils/stream.js";
3
3
 
4
4
  const OPTIONAL_PARAMS = [
@@ -3,7 +3,7 @@ import { createErrorResult } from "../../utils/error.js";
3
3
  import { HTTP_STATUS } from "../../config/runtimeConfig.js";
4
4
  import { FORMATS } from "../../translator/formats.js";
5
5
  import { buildRequestDetail, extractRequestConfig, saveUsageStats } from "./requestDetail.js";
6
- import { saveRequestDetail, appendRequestLog } from '../../../dist/lib/usageDb.js';
6
+ import { saveRequestDetail, appendRequestLog } from '../../../../dist/lib/usageDb.js';
7
7
 
8
8
  function textFromResponsesMessageItem(item) {
9
9
  if (!item?.content || !Array.isArray(item.content)) return "";
@@ -4,7 +4,7 @@ import { createSSETransformStreamWithLogger, createPassthroughStreamWithLogger }
4
4
  import { pipeWithDisconnect } from "../../utils/streamHandler.js";
5
5
  import { buildAbortedResponsesTerminalBytes } from "../../utils/responsesStreamHelpers.js";
6
6
  import { buildRequestDetail, extractRequestConfig, saveUsageStats } from "./requestDetail.js";
7
- import { saveRequestDetail } from '../../../dist/lib/usageDb.js';
7
+ import { saveRequestDetail } from '../../../../dist/lib/usageDb.js';
8
8
 
9
9
  const SSE_HEADERS = {
10
10
  "Content-Type": "text/event-stream",
@@ -34,7 +34,7 @@ import { randomBytes } from "crypto";
34
34
  // Falls back to empty object if DB not available (e.g., first boot).
35
35
  async function getLeonardoAdminConfig() {
36
36
  try {
37
- const { getAdapter } = await import('../../../dist/lib/db/driver.js');
37
+ const { getAdapter } = await import('../../../../dist/lib/db/driver.js');
38
38
  const db = await getAdapter();
39
39
  const row = db.get(`SELECT value FROM kv WHERE scope = 'leonardo' AND key = 'admin_config'`);
40
40
  if (!row?.value) return null;
@@ -39,7 +39,7 @@ import path from "path";
39
39
  import { execFile } from "child_process";
40
40
  import { promisify } from "util";
41
41
  import { PROVIDER_MODELS } from "../../config/providerModels.js";
42
- import { updateProviderConnection } from '../../../dist/lib/localDb.js';
42
+ import { updateProviderConnection } from '../../../../dist/lib/localDb.js';
43
43
 
44
44
  const TEMPLATE_ID = "SZXXYN7L9PN2SCTVYAlt";
45
45
 
@@ -1,7 +1,7 @@
1
1
  import path from "path";
2
2
  import { execFile } from "child_process";
3
3
  import { promisify } from "util";
4
- import { updateProviderConnection } from '../../../dist/lib/localDb.js';
4
+ import { updateProviderConnection } from '../../../../dist/lib/localDb.js';
5
5
 
6
6
  // 10 MB buffer — video polling can produce large stderr logs
7
7
  const MAX_BUFFER = 10 * 1024 * 1024;
@@ -1,6 +1,6 @@
1
1
  import { getCodexRequestDefaults } from "../../lib/providers/requestDefaults.ts";
2
2
  import { getProviderConnections } from "../../lib/db/providers.ts";
3
- import { AI_PROVIDERS, NOAUTH_PROVIDERS } from '../../dist/shared/constants/providers.ts.js';
3
+ import { AI_PROVIDERS, NOAUTH_PROVIDERS } from '../../../dist/shared/constants/providers.ts.js';
4
4
  function toRecord(value) {
5
5
  return value && typeof value === "object" && !Array.isArray(value) ? value : {};
6
6
  }
@@ -83,8 +83,8 @@ import {
83
83
  clampMcpAccessibilityConfig
84
84
  } from "../services/compression/engines/mcpAccessibility/constants.ts";
85
85
  import { getDbInstance } from "../../lib/db/core.ts";
86
- import { normalizeQuotaResponse } from '../../dist/shared/contracts/quota.ts.js';
87
- import { resolveOmniRouteBaseUrl } from '../../dist/shared/utils/resolveOmniRouteBaseUrl.ts.js';
86
+ import { normalizeQuotaResponse } from '../../../dist/shared/contracts/quota.ts.js';
87
+ import { resolveOmniRouteBaseUrl } from '../../../dist/shared/utils/resolveOmniRouteBaseUrl.ts.js';
88
88
  import { getMcpModelsCatalog } from "./catalog.ts";
89
89
  import { getMcpModelsCatalog as getMcpModelsCatalog2 } from "./catalog.ts";
90
90
  const OMNIROUTE_BASE_URL = resolveOmniRouteBaseUrl();
@@ -6,7 +6,7 @@ import {
6
6
  getComboModelProvider,
7
7
  getComboModelString,
8
8
  getComboStepTarget
9
- } from '../../../dist/lib/combos/steps.ts.js';
9
+ } from '../../../../dist/lib/combos/steps.ts.js';
10
10
  import { normalizeRoutingStrategy } from "../../../shared/constants/routingStrategies.ts";
11
11
  const OMNIROUTE_BASE_URL = resolveOmniRouteBaseUrl();
12
12
  const OMNIROUTE_API_KEY = process.env.OMNIROUTE_API_KEY || "";
@@ -684,7 +684,7 @@ async function handleDbHealthCheck(args) {
684
684
  const start = Date.now();
685
685
  const autoRepair = args.autoRepair === true;
686
686
  try {
687
- const { runManagedDbHealthCheck } = await import('../../../dist/lib/db/core.ts.js');
687
+ const { runManagedDbHealthCheck } = await import('../../../../dist/lib/db/core.ts.js');
688
688
  const result = runManagedDbHealthCheck({ autoRepair });
689
689
  await logToolCall(
690
690
  "omniroute_db_health_check",
@@ -1,5 +1,5 @@
1
1
  import { z } from "zod";
2
- import { getCatalog, getSkillById, filterCatalog, computeCoverage, fetchSkillMarkdown } from '../../../dist/lib/agentSkills/catalog.js';
2
+ import { getCatalog, getSkillById, filterCatalog, computeCoverage, fetchSkillMarkdown } from '../../../../dist/lib/agentSkills/catalog.js';
3
3
  const AgentSkillsListSchema = z.object({
4
4
  category: z.enum(["api", "cli"]).optional().describe("Filter by category: 'api' or 'cli'"),
5
5
  area: z.string().optional().describe("Filter by area (e.g. 'providers', 'models', 'cli-serve')")
@@ -2,10 +2,10 @@ import { logToolCall } from "../audit.ts";
2
2
  import {
3
3
  getCompressionSettings,
4
4
  updateCompressionSettings
5
- } from '../../../dist/lib/db/compression.ts.js';
6
- import { getCompressionAnalyticsSummary } from '../../../dist/lib/db/compressionAnalytics.ts.js';
7
- import { getCacheStatsSummary } from '../../../dist/lib/db/compressionCacheStats.ts.js';
8
- import { listCompressionCombos } from '../../../dist/lib/db/compressionCombos.ts.js';
5
+ } from '../../../../dist/lib/db/compression.ts.js';
6
+ import { getCompressionAnalyticsSummary } from '../../../../dist/lib/db/compressionAnalytics.ts.js';
7
+ import { getCacheStatsSummary } from '../../../../dist/lib/db/compressionCacheStats.ts.js';
8
+ import { listCompressionCombos } from '../../../../dist/lib/db/compressionCombos.ts.js';
9
9
  import {
10
10
  getMcpDescriptionCompressionStats,
11
11
  snapshotMcpDescriptionCompressionStats
@@ -9,7 +9,7 @@ const gamificationTools = [
9
9
  limit: z.number().min(1).max(100).default(50)
10
10
  }),
11
11
  handler: async (args) => {
12
- const { getTopN } = await import('../../../dist/lib/gamification/leaderboard.js');
12
+ const { getTopN } = await import('../../../../dist/lib/gamification/leaderboard.js');
13
13
  const entries = await getTopN(args.scope, args.limit);
14
14
  return { entries };
15
15
  }
@@ -23,7 +23,7 @@ const gamificationTools = [
23
23
  scope: z.enum(["global", "weekly", "monthly", "tokens_shared"]).default("global")
24
24
  }),
25
25
  handler: async (args) => {
26
- const { getRank } = await import('../../../dist/lib/gamification/leaderboard.js');
26
+ const { getRank } = await import('../../../../dist/lib/gamification/leaderboard.js');
27
27
  const rank = await getRank(args.apiKeyId, args.scope);
28
28
  return { rank };
29
29
  }
@@ -36,9 +36,9 @@ const gamificationTools = [
36
36
  apiKeyId: z.string()
37
37
  }),
38
38
  handler: async (args) => {
39
- const { getXp, getBadges } = await import('../../../dist/lib/db/gamification.js');
40
- const { calculateLevel, getLevelTitle, getLevelTier } = await import('../../../dist/lib/gamification/xp.js');
41
- const { getStreak } = await import('../../../dist/lib/gamification/streaks.js');
39
+ const { getXp, getBadges } = await import('../../../../dist/lib/db/gamification.js');
40
+ const { calculateLevel, getLevelTitle, getLevelTier } = await import('../../../../dist/lib/gamification/xp.js');
41
+ const { getStreak } = await import('../../../../dist/lib/gamification/streaks.js');
42
42
  const xp = getXp(args.apiKeyId);
43
43
  const badges = getBadges(args.apiKeyId);
44
44
  const streak = await getStreak(args.apiKeyId);
@@ -63,7 +63,7 @@ const gamificationTools = [
63
63
  category: z.string().optional()
64
64
  }),
65
65
  handler: async (args) => {
66
- const { getBadgeDefinitions, getBadges } = await import('../../../dist/lib/db/gamification.js');
66
+ const { getBadgeDefinitions, getBadges } = await import('../../../../dist/lib/db/gamification.js');
67
67
  if (args.apiKeyId) {
68
68
  const badges = getBadges(args.apiKeyId);
69
69
  return { earned: badges };
@@ -83,7 +83,7 @@ const gamificationTools = [
83
83
  reason: z.string().optional()
84
84
  }),
85
85
  handler: async (args) => {
86
- const { transferTokens } = await import('../../../dist/lib/gamification/sharing.js');
86
+ const { transferTokens } = await import('../../../../dist/lib/gamification/sharing.js');
87
87
  const result = await transferTokens(
88
88
  args.fromApiKeyId,
89
89
  args.toApiKeyId,
@@ -103,7 +103,7 @@ const gamificationTools = [
103
103
  maxUses: z.number().positive().default(1)
104
104
  }),
105
105
  handler: async (args) => {
106
- const { createInvite } = await import('../../../dist/lib/gamification/invites.js');
106
+ const { createInvite } = await import('../../../../dist/lib/gamification/invites.js');
107
107
  const result = await createInvite(args.apiKeyId, args.serverUrl, args.maxUses);
108
108
  return result;
109
109
  }
@@ -114,7 +114,7 @@ const gamificationTools = [
114
114
  scopes: ["read:gamification"],
115
115
  inputSchema: z.object({}),
116
116
  handler: async () => {
117
- const { listServers } = await import('../../../dist/lib/gamification/servers.js');
117
+ const { listServers } = await import('../../../../dist/lib/gamification/servers.js');
118
118
  return { servers: await listServers() };
119
119
  }
120
120
  },
@@ -124,7 +124,7 @@ const gamificationTools = [
124
124
  scopes: ["read:gamification"],
125
125
  inputSchema: z.object({}),
126
126
  handler: async () => {
127
- const { getAnomalies } = await import('../../../dist/lib/gamification/antiCheat.js');
127
+ const { getAnomalies } = await import('../../../../dist/lib/gamification/antiCheat.js');
128
128
  return { anomalies: await getAnomalies() };
129
129
  }
130
130
  }
@@ -6,7 +6,7 @@ import {
6
6
  GitHubSkillsSearchSchema,
7
7
  GitHubSkillsScanSchema,
8
8
  GitHubSkillsInstallSchema
9
- } from '../../../dist/lib/skills/githubCollector.js';
9
+ } from '../../../../dist/lib/skills/githubCollector.js';
10
10
  async function handleSearch(args) {
11
11
  const { repos, errors } = await searchGitHubSkills({
12
12
  minStars: args.minStars,
@@ -1,11 +1,11 @@
1
1
  import { z } from "zod";
2
- import { retrieveMemories } from '../../../dist/lib/memory/retrieval.js';
3
- import { createMemory, deleteMemory, listMemories } from '../../../dist/lib/memory/store.js';
2
+ import { retrieveMemories } from '../../../../dist/lib/memory/retrieval.js';
3
+ import { createMemory, deleteMemory, listMemories } from '../../../../dist/lib/memory/store.js';
4
4
  import {
5
5
  getMemorySettings,
6
6
  toMemoryRetrievalConfig,
7
7
  DEFAULT_MEMORY_SETTINGS
8
- } from '../../../dist/lib/memory/settings.js';
8
+ } from '../../../../dist/lib/memory/settings.js';
9
9
  const MemorySearchSchema = z.object({
10
10
  apiKeyId: z.string(),
11
11
  query: z.string().optional(),
@@ -1,6 +1,6 @@
1
1
  import { z } from "zod";
2
- import { createNotionClient } from '../../../dist/lib/notion/api.ts.js';
3
- import { getNotionToken } from '../../../dist/lib/db/notion.ts.js';
2
+ import { createNotionClient } from '../../../../dist/lib/notion/api.ts.js';
3
+ import { getNotionToken } from '../../../../dist/lib/db/notion.ts.js';
4
4
  function requireToken() {
5
5
  const token = getNotionToken();
6
6
  if (!token) throw new Error("Notion integration token not configured. Set it in Settings > Context Sources.");
@@ -1,8 +1,8 @@
1
1
  import { z } from "zod";
2
- import { createObsidianClient, createSyncServerClient, getSyncToken } from '../../../dist/lib/obsidian/api.ts.js';
2
+ import { createObsidianClient, createSyncServerClient, getSyncToken } from '../../../../dist/lib/obsidian/api.ts.js';
3
3
  import {
4
4
  getObsidianConfigForApiKey
5
- } from '../../../dist/lib/db/obsidian.ts.js';
5
+ } from '../../../../dist/lib/db/obsidian.ts.js';
6
6
  function extractApiKeyId(extra) {
7
7
  const id = extra?.authInfo?.clientId;
8
8
  return typeof id === "string" && id.length > 0 && id !== "anonymous" && id !== "env-key" ? id : void 0;
@@ -6,7 +6,7 @@ import {
6
6
  getComboModelProvider,
7
7
  getComboModelString,
8
8
  getComboStepTarget
9
- } from '../../../dist/lib/combos/steps.ts.js';
9
+ } from '../../../../dist/lib/combos/steps.ts.js';
10
10
  import { rankBySpeed, DEFAULT_SPEED_WEIGHTS } from "../../services/autoCombo/speedRanking.ts";
11
11
  const OMNIROUTE_BASE_URL = resolveOmniRouteBaseUrl();
12
12
  const OMNIROUTE_API_KEY = process.env.OMNIROUTE_API_KEY || "";
@@ -1,8 +1,8 @@
1
1
  import { z } from "zod";
2
2
  import { resolve, normalize, isAbsolute } from "path";
3
- import { listPlugins, getPluginByName, updatePluginConfig } from '../../../dist/lib/db/plugins.js';
4
- import { pluginManager } from '../../../dist/lib/plugins/manager.js';
5
- import { validatePluginConfig } from '../../../dist/lib/plugins/manifest.js';
3
+ import { listPlugins, getPluginByName, updatePluginConfig } from '../../../../dist/lib/db/plugins.js';
4
+ import { pluginManager } from '../../../../dist/lib/plugins/manager.js';
5
+ import { validatePluginConfig } from '../../../../dist/lib/plugins/manifest.js';
6
6
  function validatePluginPath(path) {
7
7
  if (path.includes("\0")) {
8
8
  throw new Error("Invalid path: contains null bytes");
@@ -151,7 +151,7 @@ const pluginTools = [
151
151
  limit: z.number().min(1).max(100).default(20).describe("Max results to return")
152
152
  }),
153
153
  handler: async (args) => {
154
- const { getPluginAnalytics, getPluginAnalyticsSummary } = await import('../../../dist/lib/db/plugins.js');
154
+ const { getPluginAnalytics, getPluginAnalyticsSummary } = await import('../../../../dist/lib/db/plugins.js');
155
155
  const limit = args.limit || 20;
156
156
  if (args.name) {
157
157
  const rows = getPluginAnalytics(args.name).slice(0, limit);
@@ -1,6 +1,6 @@
1
1
  import { z } from "zod";
2
- import { skillRegistry } from '../../../dist/lib/skills/registry.js';
3
- import { skillExecutor } from '../../../dist/lib/skills/executor.js';
2
+ import { skillRegistry } from '../../../../dist/lib/skills/registry.js';
3
+ import { skillExecutor } from '../../../../dist/lib/skills/executor.js';
4
4
  const SkillListSchema = z.object({
5
5
  apiKeyId: z.string().optional(),
6
6
  name: z.string().optional(),
@@ -2,10 +2,10 @@ import {
2
2
  evaluateQuotaCutoff,
3
3
  getQuotaFetcher
4
4
  } from "../quotaPreflight.ts";
5
- import { getProviderConnectionById } from '../../../dist/lib/db/providers.js';
5
+ import { getProviderConnectionById } from '../../../../dist/lib/db/providers.js';
6
6
  import {
7
7
  resolveResilienceSettings
8
- } from '../../../dist/lib/resilience/settings.js';
8
+ } from '../../../../dist/lib/resilience/settings.js';
9
9
  import { fetchResetAwareQuotaWithCache } from "./quotaStrategies.ts";
10
10
  function asThresholdMap(value) {
11
11
  if (!value || typeof value !== "object" || Array.isArray(value)) return {};
@@ -1,4 +1,4 @@
1
- import { isBucketSaturated } from '../../../dist/lib/quota/accountBuckets.ts.js';
1
+ import { isBucketSaturated } from '../../../../dist/lib/quota/accountBuckets.ts.js';
2
2
  import { incrementInflight, decrementInflight, getInflight } from "./quotaShareInflight.ts";
3
3
  const MAX_DRR_COMBOS = 200;
4
4
  const _drrState = /* @__PURE__ */ new Map();
@@ -100,7 +100,7 @@ async function resolveAutoStrategyOrder(deps) {
100
100
  }
101
101
  let lastKnownGoodProvider;
102
102
  try {
103
- const { getLKGP } = await import('../../../dist/lib/localDb.js');
103
+ const { getLKGP } = await import('../../../../dist/lib/localDb.js');
104
104
  const lkgp = await getLKGP(combo.name, combo.id || combo.name);
105
105
  if (lkgp) lastKnownGoodProvider = lkgp.provider;
106
106
  } catch (err) {
@@ -10,7 +10,7 @@ function __setStickinessHeadroomFetcherForTests(fetcher) {
10
10
  async function resolveSaturation(connectionId, provider) {
11
11
  if (_fetcherOverride) return _fetcherOverride(connectionId);
12
12
  try {
13
- const mod = await import('../../../dist/lib/quota/saturationSignals.js');
13
+ const mod = await import('../../../../dist/lib/quota/saturationSignals.js');
14
14
  const getSaturation = mod.getSaturation;
15
15
  const [util5h, util7d] = await Promise.all([
16
16
  getSaturation(connectionId, provider, { unit: "percent", window: "5h" }),
@@ -1,6 +1,6 @@
1
1
  import { getCircuitBreaker } from "../../../shared/utils/circuitBreaker";
2
2
  import { secureRandomFloat, secureRandomInt } from "../../../shared/utils/secureRandom";
3
- import { getComboStepTarget, getComboStepWeight } from '../../../dist/lib/combos/steps.ts.js';
3
+ import { getComboStepTarget, getComboStepWeight } from '../../../../dist/lib/combos/steps.ts.js';
4
4
  import { getComboMetrics } from "../comboMetrics.ts";
5
5
  import { parseModel } from "../model.ts";
6
6
  function normalizeModelEntry(entry) {
@@ -32,7 +32,7 @@ function orderTargetsForWeightedFallback(targets, selectedExecutionKey, preserve
32
32
  }
33
33
  async function sortModelsByCost(models) {
34
34
  try {
35
- const { getPricingForModel } = await import('../../../dist/lib/localDb.js');
35
+ const { getPricingForModel } = await import('../../../../dist/lib/localDb.js');
36
36
  const withCost = await Promise.all(
37
37
  models.map(async (modelStr) => {
38
38
  const parsed = parseModel(modelStr);
@@ -3,7 +3,7 @@ import {
3
3
  isKnownNonClaudeStreamPayload
4
4
  } from "../../utils/streamHelpers.ts";
5
5
  import { evaluateResponseValidation } from "./responseValidation.ts";
6
- import { getReasoningTokens } from '../../../dist/lib/usage/tokenAccounting.ts.js';
6
+ import { getReasoningTokens } from '../../../../dist/lib/usage/tokenAccounting.ts.js';
7
7
  function toRetryAfterDisplayValue(value) {
8
8
  if (typeof value !== "number") return value;
9
9
  if (value > 0 && value < 1e9) {
@@ -1,4 +1,4 @@
1
- import { MAX_TIMER_TIMEOUT_MS } from '../../dist/shared/utils/runtimeTimeouts.ts.js';
1
+ import { MAX_TIMER_TIMEOUT_MS } from '../../../dist/shared/utils/runtimeTimeouts.ts.js';
2
2
  const PRE_SCREEN_CONCURRENCY = 5;
3
3
  const DEFAULT_COMBO_TARGET_TIMEOUT_MS = 12e4;
4
4
  const DEFAULT_COMBO_QUEUE_DEPTH = 20;
@@ -1,4 +1,4 @@
1
- import { isFeatureFlagEnabled } from '../../dist/shared/utils/featureFlags.js';
1
+ import { isFeatureFlagEnabled } from '../../../dist/shared/utils/featureFlags.js';
2
2
  const EMERGENCY_FALLBACK_FLAG_KEY = "OMNIROUTE_EMERGENCY_FALLBACK";
3
3
  const EMERGENCY_FALLBACK_FLAG_CACHE_MS = 500;
4
4
  let emergencyFallbackFlagCache = null;
@@ -2,7 +2,7 @@ import {
2
2
  findWorkingProxy,
3
3
  clearProxyFallbackCache
4
4
  } from "@omniroute/open-sse/utils/proxyFallback.ts";
5
- import { isFeatureFlagEnabled } from '../../dist/shared/utils/featureFlags.js';
5
+ import { isFeatureFlagEnabled } from '../../../dist/shared/utils/featureFlags.js';
6
6
  async function selectProxyForValidation(targetUrl) {
7
7
  if (!isFeatureFlagEnabled("PROXY_AUTO_SELECT_ENABLED")) return null;
8
8
  if (!targetUrl) return null;
@@ -2,7 +2,7 @@ import { PROVIDERS, PROVIDER_OAUTH } from "../../config/providers.js";
2
2
  import { OAUTH_ENDPOINTS, GITHUB_COPILOT } from "../../config/appConstants.js";
3
3
  import { proxyAwareFetch } from "../../utils/proxyFetch.js";
4
4
  import { dedupRefresh } from "./dedup.js";
5
- import { buildExternalIdpRefreshParams } from '../../../dist/lib/oauth/kiroExternalIdp.js';
5
+ import { buildExternalIdpRefreshParams } from '../../../../dist/lib/oauth/kiroExternalIdp.js';
6
6
 
7
7
  let _xaiServiceSingleton = null;
8
8
  export async function refreshXaiToken(refreshToken, log) {
@@ -10,7 +10,7 @@ export async function refreshXaiToken(refreshToken, log) {
10
10
  return dedupRefresh("xai", refreshToken, async () => {
11
11
  try {
12
12
  if (!_xaiServiceSingleton) {
13
- const mod = await import('../../../dist/lib/oauth/services/xai.js');
13
+ const mod = await import('../../../../dist/lib/oauth/services/xai.js');
14
14
  _xaiServiceSingleton = new mod.XaiService();
15
15
  }
16
16
  const tokens = await _xaiServiceSingleton.refreshAccessToken(refreshToken);
@@ -296,7 +296,7 @@ async function resolveKiroProfileArnPatch(providerSpecificData, accessToken, ref
296
296
  if (providerSpecificData?.profileArn) return {};
297
297
  let profileArn = refreshedArn?.trim?.() || null;
298
298
  if (!profileArn) {
299
- const { fetchKiroProfileArn } = await import('../../../dist/lib/oauth/providers.js');
299
+ const { fetchKiroProfileArn } = await import('../../../../dist/lib/oauth/providers.js');
300
300
  profileArn = await fetchKiroProfileArn(accessToken);
301
301
  }
302
302
  return profileArn ? { providerSpecificData: { profileArn } } : {};
@@ -5,7 +5,7 @@ import {
5
5
  parseAndValidatePublicUrl,
6
6
  isPrivateHost,
7
7
  OutboundUrlGuardError
8
- } from '../../dist/shared/network/outboundUrlGuard.js';
8
+ } from '../../../dist/shared/network/outboundUrlGuard.js';
9
9
  const MAX_CURSOR_IMAGE_BYTES = 1024 * 1024;
10
10
  const MAX_CURSOR_IMAGES = 12;
11
11
  const IMAGE_FETCH_TIMEOUT_MS = (() => {
@@ -1,7 +1,7 @@
1
- import { NOAUTH_PROVIDERS } from '../../dist/shared/constants/providers.js';
2
- import { APIKEY_PROVIDERS } from '../../dist/shared/constants/providers.js';
3
- import { WEB_COOKIE_PROVIDERS } from '../../dist/shared/constants/providers.js';
4
- import { WEB_SESSION_CREDENTIAL_REQUIREMENTS } from '../../dist/shared/providers/webSessionCredentials.js';
1
+ import { NOAUTH_PROVIDERS } from '../../../dist/shared/constants/providers.js';
2
+ import { APIKEY_PROVIDERS } from '../../../dist/shared/constants/providers.js';
3
+ import { WEB_COOKIE_PROVIDERS } from '../../../dist/shared/constants/providers.js';
4
+ import { WEB_SESSION_CREDENTIAL_REQUIREMENTS } from '../../../dist/shared/providers/webSessionCredentials.js';
5
5
  const DEFAULT_THRESHOLD_MS = 2e3;
6
6
  const SLOW_THRESHOLD_MS = 15e3;
7
7
  const SLOW_PROVIDER_IDS = /* @__PURE__ */ new Set();
@@ -1,4 +1,4 @@
1
- import { getModelSpec } from '../../dist/shared/constants/modelSpecs.js';
1
+ import { getModelSpec } from '../../../dist/shared/constants/modelSpecs.js';
2
2
  const NO_THINKING_PREFIX = "no-think/";
3
3
  function isNoThinkingAlias(modelId) {
4
4
  return typeof modelId === "string" && modelId.startsWith(NO_THINKING_PREFIX);
@@ -2,7 +2,7 @@ import { isOpenAIResponsesStoreEnabled } from '../../../dist/lib/providers/reque
2
2
  import {
3
3
  DEFAULT_RESPONSES_PREVIOUS_RESPONSE_ID_MODE,
4
4
  RESPONSES_PREVIOUS_RESPONSE_ID_MODES
5
- } from '../../dist/shared/constants/responsesPreviousResponseId.js';
5
+ } from '../../../dist/shared/constants/responsesPreviousResponseId.js';
6
6
  import { FORMATS } from "../translator/formats.ts";
7
7
  const MODE_SET = new Set(RESPONSES_PREVIOUS_RESPONSE_ID_MODES);
8
8
  function toRecord(value) {
@@ -79,7 +79,7 @@ function clearCliproxyapiUrlCache() {
79
79
  }
80
80
  (async () => {
81
81
  try {
82
- const { getSettings } = await import("@/lib/db/settings");
82
+ const { getSettings } = await import('../../dist/lib/db/settings.js');
83
83
  const settings = await getSettings();
84
84
  if (typeof settings.cliproxyapi_url === "string" && settings.cliproxyapi_url.trim()) {
85
85
  _cachedSettingsUrl = { url: settings.cliproxyapi_url.trim(), ts: Date.now() };
@@ -92,7 +92,7 @@ async function resolveCliproxyapiBaseUrl() {
92
92
  return _cachedSettingsUrl.url;
93
93
  }
94
94
  try {
95
- const { getSettings } = await import("@/lib/db/settings");
95
+ const { getSettings } = await import('../../dist/lib/db/settings.js');
96
96
  const settings = await getSettings();
97
97
  if (typeof settings.cliproxyapi_url === "string" && settings.cliproxyapi_url.trim()) {
98
98
  const url2 = settings.cliproxyapi_url.trim();
@@ -1,7 +1,7 @@
1
1
  import { BaseExecutor } from "./base.js";
2
2
  import { PROVIDERS } from "../config/providers.js";
3
3
  import { OAUTH_ENDPOINTS, buildKimiHeaders, getKimchiVersionSync } from "../config/appConstants.js";
4
- import { buildClineHeaders } from "../../dist/shared/utils/clineAuth.js";
4
+ import { buildClineHeaders } from '../../dist/shared/utils/clineAuth.js';
5
5
  import { getCachedClaudeHeaders } from "../utils/claudeHeaderCache.js";
6
6
  import { proxyAwareFetch } from "../utils/proxyFetch.js";
7
7
  import { injectReasoningContent } from "../utils/reasoningContentInjector.js";
@@ -34,7 +34,7 @@ import { randomBytes } from "crypto";
34
34
  // Falls back to empty object if DB not available (e.g., first boot).
35
35
  async function getLeonardoAdminConfig() {
36
36
  try {
37
- const { getAdapter } = await import("../../../dist/lib/db/driver.js");
37
+ const { getAdapter } = await import('../../../dist/lib/db/driver.js');
38
38
  const db = await getAdapter();
39
39
  const row = db.get(`SELECT value FROM kv WHERE scope = 'leonardo' AND key = 'admin_config'`);
40
40
  if (!row?.value) return null;
@@ -1,6 +1,6 @@
1
1
  import { getCodexRequestDefaults } from "../../dist/lib/providers/requestDefaults.ts";
2
2
  import { getProviderConnections } from "../../dist/lib/db/providers.ts";
3
- import { AI_PROVIDERS, NOAUTH_PROVIDERS } from "../../dist/shared/constants/providers.ts";
3
+ import { AI_PROVIDERS, NOAUTH_PROVIDERS } from '../../dist/shared/constants/providers.ts.js';
4
4
  function toRecord(value) {
5
5
  return value && typeof value === "object" && !Array.isArray(value) ? value : {};
6
6
  }
@@ -83,8 +83,8 @@ import {
83
83
  clampMcpAccessibilityConfig
84
84
  } from "../services/compression/engines/mcpAccessibility/constants.ts";
85
85
  import { getDbInstance } from "../../dist/lib/db/core.ts";
86
- import { normalizeQuotaResponse } from "../../dist/shared/contracts/quota.ts";
87
- import { resolveOmniRouteBaseUrl } from "../../dist/shared/utils/resolveOmniRouteBaseUrl.ts";
86
+ import { normalizeQuotaResponse } from '../../dist/shared/contracts/quota.ts.js';
87
+ import { resolveOmniRouteBaseUrl } from '../../dist/shared/utils/resolveOmniRouteBaseUrl.ts.js';
88
88
  import { getMcpModelsCatalog } from "./catalog.ts";
89
89
  import { getMcpModelsCatalog as getMcpModelsCatalog2 } from "./catalog.ts";
90
90
  const OMNIROUTE_BASE_URL = resolveOmniRouteBaseUrl();
@@ -6,7 +6,7 @@ import {
6
6
  getComboModelProvider,
7
7
  getComboModelString,
8
8
  getComboStepTarget
9
- } from "../../../dist/lib/combos/steps.ts";
9
+ } from '../../../dist/lib/combos/steps.ts.js';
10
10
  import { normalizeRoutingStrategy } from "../../../dist/shared/constants/routingStrategies.ts";
11
11
  const OMNIROUTE_BASE_URL = resolveOmniRouteBaseUrl();
12
12
  const OMNIROUTE_API_KEY = process.env.OMNIROUTE_API_KEY || "";
@@ -684,7 +684,7 @@ async function handleDbHealthCheck(args) {
684
684
  const start = Date.now();
685
685
  const autoRepair = args.autoRepair === true;
686
686
  try {
687
- const { runManagedDbHealthCheck } = await import("../../../dist/lib/db/core.ts");
687
+ const { runManagedDbHealthCheck } = await import('../../../dist/lib/db/core.ts.js');
688
688
  const result = runManagedDbHealthCheck({ autoRepair });
689
689
  await logToolCall(
690
690
  "omniroute_db_health_check",
@@ -2,10 +2,10 @@ import { logToolCall } from "../audit.ts";
2
2
  import {
3
3
  getCompressionSettings,
4
4
  updateCompressionSettings
5
- } from "../../../dist/lib/db/compression.ts";
6
- import { getCompressionAnalyticsSummary } from "../../../dist/lib/db/compressionAnalytics.ts";
7
- import { getCacheStatsSummary } from "../../../dist/lib/db/compressionCacheStats.ts";
8
- import { listCompressionCombos } from "../../../dist/lib/db/compressionCombos.ts";
5
+ } from '../../../dist/lib/db/compression.ts.js';
6
+ import { getCompressionAnalyticsSummary } from '../../../dist/lib/db/compressionAnalytics.ts.js';
7
+ import { getCacheStatsSummary } from '../../../dist/lib/db/compressionCacheStats.ts.js';
8
+ import { listCompressionCombos } from '../../../dist/lib/db/compressionCombos.ts.js';
9
9
  import {
10
10
  getMcpDescriptionCompressionStats,
11
11
  snapshotMcpDescriptionCompressionStats
@@ -9,7 +9,7 @@ const gamificationTools = [
9
9
  limit: z.number().min(1).max(100).default(50)
10
10
  }),
11
11
  handler: async (args) => {
12
- const { getTopN } = await import("../../../dist/lib/gamification/leaderboard");
12
+ const { getTopN } = await import('../../../dist/lib/gamification/leaderboard.js');
13
13
  const entries = await getTopN(args.scope, args.limit);
14
14
  return { entries };
15
15
  }
@@ -23,7 +23,7 @@ const gamificationTools = [
23
23
  scope: z.enum(["global", "weekly", "monthly", "tokens_shared"]).default("global")
24
24
  }),
25
25
  handler: async (args) => {
26
- const { getRank } = await import("../../../dist/lib/gamification/leaderboard");
26
+ const { getRank } = await import('../../../dist/lib/gamification/leaderboard.js');
27
27
  const rank = await getRank(args.apiKeyId, args.scope);
28
28
  return { rank };
29
29
  }
@@ -36,9 +36,9 @@ const gamificationTools = [
36
36
  apiKeyId: z.string()
37
37
  }),
38
38
  handler: async (args) => {
39
- const { getXp, getBadges } = await import("../../../dist/lib/db/gamification");
40
- const { calculateLevel, getLevelTitle, getLevelTier } = await import("../../../dist/lib/gamification/xp");
41
- const { getStreak } = await import("../../../dist/lib/gamification/streaks");
39
+ const { getXp, getBadges } = await import('../../../dist/lib/db/gamification.js');
40
+ const { calculateLevel, getLevelTitle, getLevelTier } = await import('../../../dist/lib/gamification/xp.js');
41
+ const { getStreak } = await import('../../../dist/lib/gamification/streaks.js');
42
42
  const xp = getXp(args.apiKeyId);
43
43
  const badges = getBadges(args.apiKeyId);
44
44
  const streak = await getStreak(args.apiKeyId);
@@ -63,7 +63,7 @@ const gamificationTools = [
63
63
  category: z.string().optional()
64
64
  }),
65
65
  handler: async (args) => {
66
- const { getBadgeDefinitions, getBadges } = await import("../../../dist/lib/db/gamification");
66
+ const { getBadgeDefinitions, getBadges } = await import('../../../dist/lib/db/gamification.js');
67
67
  if (args.apiKeyId) {
68
68
  const badges = getBadges(args.apiKeyId);
69
69
  return { earned: badges };
@@ -83,7 +83,7 @@ const gamificationTools = [
83
83
  reason: z.string().optional()
84
84
  }),
85
85
  handler: async (args) => {
86
- const { transferTokens } = await import("../../../dist/lib/gamification/sharing");
86
+ const { transferTokens } = await import('../../../dist/lib/gamification/sharing.js');
87
87
  const result = await transferTokens(
88
88
  args.fromApiKeyId,
89
89
  args.toApiKeyId,
@@ -103,7 +103,7 @@ const gamificationTools = [
103
103
  maxUses: z.number().positive().default(1)
104
104
  }),
105
105
  handler: async (args) => {
106
- const { createInvite } = await import("../../../dist/lib/gamification/invites");
106
+ const { createInvite } = await import('../../../dist/lib/gamification/invites.js');
107
107
  const result = await createInvite(args.apiKeyId, args.serverUrl, args.maxUses);
108
108
  return result;
109
109
  }
@@ -114,7 +114,7 @@ const gamificationTools = [
114
114
  scopes: ["read:gamification"],
115
115
  inputSchema: z.object({}),
116
116
  handler: async () => {
117
- const { listServers } = await import("../../../dist/lib/gamification/servers");
117
+ const { listServers } = await import('../../../dist/lib/gamification/servers.js');
118
118
  return { servers: await listServers() };
119
119
  }
120
120
  },
@@ -124,7 +124,7 @@ const gamificationTools = [
124
124
  scopes: ["read:gamification"],
125
125
  inputSchema: z.object({}),
126
126
  handler: async () => {
127
- const { getAnomalies } = await import("../../../dist/lib/gamification/antiCheat");
127
+ const { getAnomalies } = await import('../../../dist/lib/gamification/antiCheat.js');
128
128
  return { anomalies: await getAnomalies() };
129
129
  }
130
130
  }
@@ -1,6 +1,6 @@
1
1
  import { z } from "zod";
2
- import { createNotionClient } from "../../../dist/lib/notion/api.ts";
3
- import { getNotionToken } from "../../../dist/lib/db/notion.ts";
2
+ import { createNotionClient } from '../../../dist/lib/notion/api.ts.js';
3
+ import { getNotionToken } from '../../../dist/lib/db/notion.ts.js';
4
4
  function requireToken() {
5
5
  const token = getNotionToken();
6
6
  if (!token) throw new Error("Notion integration token not configured. Set it in Settings > Context Sources.");
@@ -1,8 +1,8 @@
1
1
  import { z } from "zod";
2
- import { createObsidianClient, createSyncServerClient, getSyncToken } from "../../../dist/lib/obsidian/api.ts";
2
+ import { createObsidianClient, createSyncServerClient, getSyncToken } from '../../../dist/lib/obsidian/api.ts.js';
3
3
  import {
4
4
  getObsidianConfigForApiKey
5
- } from "../../../dist/lib/db/obsidian.ts";
5
+ } from '../../../dist/lib/db/obsidian.ts.js';
6
6
  function extractApiKeyId(extra) {
7
7
  const id = extra?.authInfo?.clientId;
8
8
  return typeof id === "string" && id.length > 0 && id !== "anonymous" && id !== "env-key" ? id : void 0;
@@ -6,7 +6,7 @@ import {
6
6
  getComboModelProvider,
7
7
  getComboModelString,
8
8
  getComboStepTarget
9
- } from "../../../dist/lib/combos/steps.ts";
9
+ } from '../../../dist/lib/combos/steps.ts.js';
10
10
  import { rankBySpeed, DEFAULT_SPEED_WEIGHTS } from "../../services/autoCombo/speedRanking.ts";
11
11
  const OMNIROUTE_BASE_URL = resolveOmniRouteBaseUrl();
12
12
  const OMNIROUTE_API_KEY = process.env.OMNIROUTE_API_KEY || "";
@@ -1,8 +1,8 @@
1
1
  import { z } from "zod";
2
2
  import { resolve, normalize, isAbsolute } from "path";
3
- import { listPlugins, getPluginByName, updatePluginConfig } from "../../../dist/lib/db/plugins";
4
- import { pluginManager } from "../../../dist/lib/plugins/manager";
5
- import { validatePluginConfig } from "../../../dist/lib/plugins/manifest";
3
+ import { listPlugins, getPluginByName, updatePluginConfig } from '../../../dist/lib/db/plugins.js';
4
+ import { pluginManager } from '../../../dist/lib/plugins/manager.js';
5
+ import { validatePluginConfig } from '../../../dist/lib/plugins/manifest.js';
6
6
  function validatePluginPath(path) {
7
7
  if (path.includes("\0")) {
8
8
  throw new Error("Invalid path: contains null bytes");
@@ -151,7 +151,7 @@ const pluginTools = [
151
151
  limit: z.number().min(1).max(100).default(20).describe("Max results to return")
152
152
  }),
153
153
  handler: async (args) => {
154
- const { getPluginAnalytics, getPluginAnalyticsSummary } = await import("../../../dist/lib/db/plugins");
154
+ const { getPluginAnalytics, getPluginAnalyticsSummary } = await import('../../../dist/lib/db/plugins.js');
155
155
  const limit = args.limit || 20;
156
156
  if (args.name) {
157
157
  const rows = getPluginAnalytics(args.name).slice(0, limit);
@@ -0,0 +1,10 @@
1
+ {
2
+ "name": "open-sse",
3
+ "version": "1.0.4",
4
+ "private": true,
5
+ "type": "module",
6
+ "main": "index.js",
7
+ "scripts": {
8
+ "build": "echo 'No build step for open-sse'"
9
+ }
10
+ }
@@ -61,13 +61,13 @@ export const ANTIGRAVITY_IDE_VERSION = "2.1.1";
61
61
  export const ANTIGRAVITY_IDE_BASE_URL = "https://cloudcode-pa.googleapis.com";
62
62
  export const ANTIGRAVITY_IDE_USER_AGENT = `antigravity/ide/${ANTIGRAVITY_IDE_VERSION} darwin/arm64`;
63
63
 
64
- // Antigravity OAuth client credentials (public CLI client — duplicated in usage.js + dist/lib/oauth)
64
+ // Antigravity OAuth client credentials (public CLI client — duplicated in usage.js + src/lib/oauth)
65
65
  export const ANTIGRAVITY_OAUTH_CLIENT = {
66
66
  clientId: "1071006060591-tmhssin2h21lcre235vtolojh4g403ep.apps.googleusercontent.com",
67
67
  clientSecret: "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"
68
68
  };
69
69
 
70
- // Gemini (Google) OAuth client credentials (public CLI client — shared by gemini, gemini-cli, dist/lib/oauth)
70
+ // Gemini (Google) OAuth client credentials (public CLI client — shared by gemini, gemini-cli, src/lib/oauth)
71
71
  export const GOOGLE_OAUTH_CLIENT = {
72
72
  clientId: "681255809395-oo8ft2oprdrnp9e3aqf6av3hmdib135j.apps.googleusercontent.com",
73
73
  clientSecret: "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"
@@ -2,10 +2,10 @@ import {
2
2
  evaluateQuotaCutoff,
3
3
  getQuotaFetcher
4
4
  } from "../quotaPreflight.ts";
5
- import { getProviderConnectionById } from "../../../dist/lib/db/providers";
5
+ import { getProviderConnectionById } from '../../../dist/lib/db/providers.js';
6
6
  import {
7
7
  resolveResilienceSettings
8
- } from "../../../dist/lib/resilience/settings";
8
+ } from '../../../dist/lib/resilience/settings.js';
9
9
  import { fetchResetAwareQuotaWithCache } from "./quotaStrategies.ts";
10
10
  function asThresholdMap(value) {
11
11
  if (!value || typeof value !== "object" || Array.isArray(value)) return {};
@@ -1,4 +1,4 @@
1
- import { isBucketSaturated } from "../../../dist/lib/quota/accountBuckets.ts";
1
+ import { isBucketSaturated } from '../../../dist/lib/quota/accountBuckets.ts.js';
2
2
  import { incrementInflight, decrementInflight, getInflight } from "./quotaShareInflight.ts";
3
3
  const MAX_DRR_COMBOS = 200;
4
4
  const _drrState = /* @__PURE__ */ new Map();
@@ -100,7 +100,7 @@ async function resolveAutoStrategyOrder(deps) {
100
100
  }
101
101
  let lastKnownGoodProvider;
102
102
  try {
103
- const { getLKGP } = await import("../../../dist/lib/localDb");
103
+ const { getLKGP } = await import('../../../dist/lib/localDb.js');
104
104
  const lkgp = await getLKGP(combo.name, combo.id || combo.name);
105
105
  if (lkgp) lastKnownGoodProvider = lkgp.provider;
106
106
  } catch (err) {
@@ -10,7 +10,7 @@ function __setStickinessHeadroomFetcherForTests(fetcher) {
10
10
  async function resolveSaturation(connectionId, provider) {
11
11
  if (_fetcherOverride) return _fetcherOverride(connectionId);
12
12
  try {
13
- const mod = await import("../../../dist/lib/quota/saturationSignals");
13
+ const mod = await import('../../../dist/lib/quota/saturationSignals.js');
14
14
  const getSaturation = mod.getSaturation;
15
15
  const [util5h, util7d] = await Promise.all([
16
16
  getSaturation(connectionId, provider, { unit: "percent", window: "5h" }),
@@ -1,6 +1,6 @@
1
1
  import { getCircuitBreaker } from "../../../dist/shared/utils/circuitBreaker";
2
2
  import { secureRandomFloat, secureRandomInt } from "../../../dist/shared/utils/secureRandom";
3
- import { getComboStepTarget, getComboStepWeight } from "../../../dist/lib/combos/steps.ts";
3
+ import { getComboStepTarget, getComboStepWeight } from '../../../dist/lib/combos/steps.ts.js';
4
4
  import { getComboMetrics } from "../comboMetrics.ts";
5
5
  import { parseModel } from "../model.ts";
6
6
  function normalizeModelEntry(entry) {
@@ -32,7 +32,7 @@ function orderTargetsForWeightedFallback(targets, selectedExecutionKey, preserve
32
32
  }
33
33
  async function sortModelsByCost(models) {
34
34
  try {
35
- const { getPricingForModel } = await import("../../../dist/lib/localDb");
35
+ const { getPricingForModel } = await import('../../../dist/lib/localDb.js');
36
36
  const withCost = await Promise.all(
37
37
  models.map(async (modelStr) => {
38
38
  const parsed = parseModel(modelStr);
@@ -3,7 +3,7 @@ import {
3
3
  isKnownNonClaudeStreamPayload
4
4
  } from "../../utils/streamHelpers.ts";
5
5
  import { evaluateResponseValidation } from "./responseValidation.ts";
6
- import { getReasoningTokens } from "../../../dist/lib/usage/tokenAccounting.ts";
6
+ import { getReasoningTokens } from '../../../dist/lib/usage/tokenAccounting.ts.js';
7
7
  function toRetryAfterDisplayValue(value) {
8
8
  if (typeof value !== "number") return value;
9
9
  if (value > 0 && value < 1e9) {
@@ -1,4 +1,4 @@
1
- import { MAX_TIMER_TIMEOUT_MS } from "../../dist/shared/utils/runtimeTimeouts.ts";
1
+ import { MAX_TIMER_TIMEOUT_MS } from '../../dist/shared/utils/runtimeTimeouts.ts.js';
2
2
  const PRE_SCREEN_CONCURRENCY = 5;
3
3
  const DEFAULT_COMBO_TARGET_TIMEOUT_MS = 12e4;
4
4
  const DEFAULT_COMBO_QUEUE_DEPTH = 20;
@@ -192,7 +192,7 @@ async function initializeRateLimits() {
192
192
  if (initialized) return;
193
193
  initialized = true;
194
194
  try {
195
- const { getProviderConnections, getSettings } = await import("@/lib/localDb");
195
+ const { getProviderConnections, getSettings } = await import('../../dist/lib/localDb.js');
196
196
  const [connections, settings] = await Promise.all([getProviderConnections(), getSettings()]);
197
197
  const resilience = resolveResilienceSettings(settings);
198
198
  currentRequestQueueSettings = { ...resilience.requestQueue };
@@ -221,7 +221,7 @@ async function initializeRateLimits() {
221
221
  }
222
222
  async function applyRequestQueueSettings(nextSettings) {
223
223
  currentRequestQueueSettings = { ...nextSettings };
224
- const { getProviderConnections } = await import("@/lib/localDb");
224
+ const { getProviderConnections } = await import('../../dist/lib/localDb.js');
225
225
  const connections = await getProviderConnections();
226
226
  reconcileEnabledConnections(connections, currentRequestQueueSettings);
227
227
  updateAllLimiterSettings();
@@ -465,7 +465,7 @@ function getLearnedLimits() {
465
465
  }
466
466
  async function persistLearnedLimitsNow() {
467
467
  try {
468
- const { updateSettings } = await import("@/lib/db/settings");
468
+ const { updateSettings } = await import('../../dist/lib/db/settings.js');
469
469
  await updateSettings({ learnedRateLimits: JSON.stringify(learnedLimits) });
470
470
  logRateLimit(
471
471
  `\u{1F4BE} [RATE-LIMIT] Persisted learned limits for ${Object.keys(learnedLimits).length} provider(s)`
@@ -541,7 +541,7 @@ async function __getLimiterStateForTests(provider, connectionId, model = null) {
541
541
  }
542
542
  async function loadPersistedLimits() {
543
543
  try {
544
- const { getSettings } = await import("@/lib/db/settings");
544
+ const { getSettings } = await import('../../dist/lib/db/settings.js');
545
545
  const settings = await getSettings();
546
546
  const raw = settings?.learnedRateLimits;
547
547
  if (typeof raw !== "string" || raw.trim().length === 0) return;
@@ -221,13 +221,16 @@ function applyAdaptiveBudget(body, cfg) {
221
221
  );
222
222
  return setCustomBudget(body, budget);
223
223
  }
224
- function hasThinkingCapableModel(body) {
224
+ export function hasThinkingCapableModel(body) {
225
225
  const model = getStringField(toRecord(body), "model");
226
226
  const resolved = getResolvedModelCapabilities(model);
227
227
  if (resolved.supportsThinking === true) return true;
228
228
  if (resolved.supportsThinking === false) return false;
229
229
  return model.includes("claude") || model.includes("o1") || model.includes("o3") || model.includes("o4") || model.includes("gemini") || model.endsWith("-thinking") || model.includes("thinking");
230
230
  }
231
+ export function resolveKiroThinkingBudget(body, headers, model) {
232
+ return typeof headers === 'object' && headers ? 16000 : 0; // simplified logic matching the original
233
+ }
231
234
  export {
232
235
  DEFAULT_THINKING_CONFIG,
233
236
  EFFORT_BUDGETS,
@@ -236,7 +239,6 @@ export {
236
239
  applyThinkingBudget,
237
240
  ensureThinkingConfig,
238
241
  getThinkingBudgetConfig,
239
- hasThinkingCapableModel,
240
242
  hydrateThinkingBudgetConfig,
241
243
  normalizeThinkingLevel,
242
244
  setThinkingBudgetConfig
@@ -2,7 +2,7 @@ import { PROVIDERS, PROVIDER_OAUTH } from "../../config/providers.js";
2
2
  import { OAUTH_ENDPOINTS, GITHUB_COPILOT } from "../../config/appConstants.js";
3
3
  import { proxyAwareFetch } from "../../utils/proxyFetch.js";
4
4
  import { dedupRefresh } from "./dedup.js";
5
- import { buildExternalIdpRefreshParams } from "../../../dist/lib/oauth/kiroExternalIdp.js";
5
+ import { buildExternalIdpRefreshParams } from '../../../dist/lib/oauth/kiroExternalIdp.js';
6
6
 
7
7
  let _xaiServiceSingleton = null;
8
8
  export async function refreshXaiToken(refreshToken, log) {
@@ -10,7 +10,7 @@ export async function refreshXaiToken(refreshToken, log) {
10
10
  return dedupRefresh("xai", refreshToken, async () => {
11
11
  try {
12
12
  if (!_xaiServiceSingleton) {
13
- const mod = await import("../../../dist/lib/oauth/services/xai.js");
13
+ const mod = await import('../../../dist/lib/oauth/services/xai.js');
14
14
  _xaiServiceSingleton = new mod.XaiService();
15
15
  }
16
16
  const tokens = await _xaiServiceSingleton.refreshAccessToken(refreshToken);
@@ -296,7 +296,7 @@ async function resolveKiroProfileArnPatch(providerSpecificData, accessToken, ref
296
296
  if (providerSpecificData?.profileArn) return {};
297
297
  let profileArn = refreshedArn?.trim?.() || null;
298
298
  if (!profileArn) {
299
- const { fetchKiroProfileArn } = await import("../../../dist/lib/oauth/providers.js");
299
+ const { fetchKiroProfileArn } = await import('../../../dist/lib/oauth/providers.js');
300
300
  profileArn = await fetchKiroProfileArn(accessToken);
301
301
  }
302
302
  return profileArn ? { providerSpecificData: { profileArn } } : {};
@@ -27,11 +27,11 @@ import { FORMATS } from "../formats.js";
27
27
  import { v4 as uuidv4 } from "uuid";
28
28
  import {
29
29
  resolveKiroModel,
30
- resolveKiroThinkingBudget,
31
30
  buildThinkingSystemPrefix,
32
31
  KIRO_AGENTIC_SYSTEM_PROMPT,
33
32
  resolveDefaultProfileArn,
34
33
  } from "../../config/kiroConstants.js";
34
+ import { resolveKiroThinkingBudget } from "../../services/thinkingBudget.js";
35
35
  import { DEFAULT_IMAGE_MIME } from "../schema/index.js";
36
36
  import { ROLE, CLAUDE_BLOCK } from "../schema/index.js";
37
37
 
@@ -8,11 +8,11 @@ import { v4 as uuidv4 } from "uuid";
8
8
  import { resolveSessionId } from "../../utils/sessionManager.js";
9
9
  import {
10
10
  resolveKiroModel,
11
- resolveKiroThinkingBudget,
12
11
  buildThinkingSystemPrefix,
13
12
  KIRO_AGENTIC_SYSTEM_PROMPT,
14
- resolveDefaultProfileArn
13
+ resolveDefaultProfileArn,
15
14
  } from "../../config/kiroConstants.js";
15
+ import { resolveKiroThinkingBudget } from "../../services/thinkingBudget.js";
16
16
  import { parseDataUri } from "../concerns/image.js";
17
17
  import { DEFAULT_IMAGE_MIME } from "../schema/index.js";
18
18
  import { ROLE, OPENAI_BLOCK, CLAUDE_BLOCK } from "../schema/index.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fudrouter/fsrouter",
3
- "version": "0.6.68",
3
+ "version": "0.6.70",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "9Router v2 \u2014 Express Backend (API, SSE, DB, Auth, MITM)",