@fudrouter/fsrouter 0.6.78 → 0.6.79
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.
- package/bin/rewriteSseImports.js +13 -15
- package/dist/open-sse/handlers/chatCore/nonStreamingHandler.js +1 -1
- package/dist/open-sse/handlers/chatCore/requestDetail.js +1 -1
- package/dist/open-sse/handlers/chatCore/sseToJsonHandler.js +1 -1
- package/dist/open-sse/handlers/chatCore/streamingHandler.js +1 -1
- package/dist/open-sse/handlers/imageProviders/leonardo.js +1 -1
- package/dist/open-sse/handlers/imageProviders/weavy.js +1 -1
- package/dist/open-sse/handlers/videoProviders/weavy.js +1 -1
- package/dist/open-sse/mcp-server/tools/advancedTools.js +2 -2
- package/dist/open-sse/mcp-server/tools/agentSkillTools.js +1 -1
- package/dist/open-sse/mcp-server/tools/compressionTools.js +4 -4
- package/dist/open-sse/mcp-server/tools/gamificationTools.js +10 -10
- package/dist/open-sse/mcp-server/tools/githubSkillTools.js +1 -1
- package/dist/open-sse/mcp-server/tools/memoryTools.js +3 -3
- package/dist/open-sse/mcp-server/tools/notionTools.js +2 -2
- package/dist/open-sse/mcp-server/tools/obsidianTools.js +2 -2
- package/dist/open-sse/mcp-server/tools/pickFastestModel.js +1 -1
- package/dist/open-sse/mcp-server/tools/pluginTools.js +4 -4
- package/dist/open-sse/mcp-server/tools/skillTools.js +2 -2
- package/dist/open-sse/services/combo/quotaExhaustionCutoff.js +2 -2
- package/dist/open-sse/services/combo/quotaShareStrategy.js +1 -1
- package/dist/open-sse/services/combo/resolveAutoStrategy.js +1 -1
- package/dist/open-sse/services/combo/sessionStickiness.js +1 -1
- package/dist/open-sse/services/combo/targetSorters.js +2 -2
- package/dist/open-sse/services/combo/validateQuality.js +1 -1
- package/dist/open-sse/services/tokenRefresh/providers.js +3 -3
- package/open-sse/handlers/chatCore/nonStreamingHandler.js +1 -1
- package/open-sse/handlers/chatCore/requestDetail.js +1 -1
- package/open-sse/handlers/chatCore/sseToJsonHandler.js +1 -1
- package/open-sse/handlers/chatCore/streamingHandler.js +1 -1
- package/open-sse/handlers/imageProviders/leonardo.js +1 -1
- package/open-sse/handlers/imageProviders/weavy.js +1 -1
- package/open-sse/handlers/videoProviders/weavy.js +1 -1
- package/open-sse/mcp-server/tools/advancedTools.js +2 -2
- package/open-sse/mcp-server/tools/agentSkillTools.js +1 -1
- package/open-sse/mcp-server/tools/compressionTools.js +4 -4
- package/open-sse/mcp-server/tools/gamificationTools.js +10 -10
- package/open-sse/mcp-server/tools/githubSkillTools.js +1 -1
- package/open-sse/mcp-server/tools/memoryTools.js +3 -3
- package/open-sse/mcp-server/tools/notionTools.js +2 -2
- package/open-sse/mcp-server/tools/obsidianTools.js +2 -2
- package/open-sse/mcp-server/tools/pickFastestModel.js +1 -1
- package/open-sse/mcp-server/tools/pluginTools.js +4 -4
- package/open-sse/mcp-server/tools/skillTools.js +2 -2
- package/open-sse/services/combo/quotaExhaustionCutoff.js +2 -2
- package/open-sse/services/combo/quotaShareStrategy.js +1 -1
- package/open-sse/services/combo/resolveAutoStrategy.js +1 -1
- package/open-sse/services/combo/sessionStickiness.js +1 -1
- package/open-sse/services/combo/targetSorters.js +2 -2
- package/open-sse/services/combo/validateQuality.js +1 -1
- package/open-sse/services/tokenRefresh/providers.js +3 -3
- package/package.json +1 -1
package/bin/rewriteSseImports.js
CHANGED
|
@@ -19,23 +19,23 @@ function rewrite(file) {
|
|
|
19
19
|
const prefix = "../".repeat(depth) + "dist/";
|
|
20
20
|
|
|
21
21
|
content = content
|
|
22
|
-
.replace(/from\s+['
|
|
22
|
+
.replace(/from\s+['"]@\/lib\/([^'"]+)['"]/g, (m, imp) => {
|
|
23
23
|
const resolved = imp.endsWith(".js") ? imp : imp + ".js";
|
|
24
24
|
return `from '${prefix}lib/${resolved}'`;
|
|
25
25
|
})
|
|
26
|
-
.replace(/from\s+['
|
|
26
|
+
.replace(/from\s+['"]@\/shared\/([^'"]+)['"]/g, (m, imp) => {
|
|
27
27
|
const resolved = imp.endsWith(".js") ? imp : imp + ".js";
|
|
28
28
|
return `from '${prefix}shared/${resolved}'`;
|
|
29
29
|
})
|
|
30
|
-
.replace(/from\s+['
|
|
30
|
+
.replace(/from\s+['"]@\/store\/([^'"]+)['"]/g, (m, imp) => {
|
|
31
31
|
const resolved = imp.endsWith(".js") ? imp : imp + ".js";
|
|
32
32
|
return `from '${prefix}store/${resolved}'`;
|
|
33
33
|
})
|
|
34
|
-
.replace(/from\s+['
|
|
34
|
+
.replace(/from\s+['"]@\/utils\/([^'"]+)['"]/g, (m, imp) => {
|
|
35
35
|
const resolved = imp.endsWith(".js") ? imp : imp + ".js";
|
|
36
36
|
return `from '${prefix}utils/${resolved}'`;
|
|
37
37
|
})
|
|
38
|
-
.replace(/from\s+['
|
|
38
|
+
.replace(/from\s+['"]@\/services\/([^'"]+)['"]/g, (m, imp) => {
|
|
39
39
|
const resolved = imp.endsWith(".js") ? imp : imp + ".js";
|
|
40
40
|
return `from '${prefix}services/${resolved}'`;
|
|
41
41
|
})
|
|
@@ -47,25 +47,23 @@ function rewrite(file) {
|
|
|
47
47
|
const resolved = imp.endsWith(".js") ? imp : imp + ".js";
|
|
48
48
|
return `import('${prefix}lib/${resolved}')`;
|
|
49
49
|
})
|
|
50
|
-
// Fix relative imports pointing to ../../../src/lib →
|
|
51
|
-
// For open-sse/services/*.js (depth=2): ../../../src/lib/ = open-sse/src/lib/ (wrong)
|
|
52
|
-
// correct: ../../dist/lib/
|
|
50
|
+
// Fix relative imports pointing to ../../../src/lib → dist/lib (depth-aware)
|
|
53
51
|
.replace(/['"]\.\.\/\.\.\/\.\.\/src\/lib\/([^'"]+)['"]/g, (m, imp) => {
|
|
54
52
|
const resolved = imp.endsWith(".js") ? imp : imp + ".js";
|
|
55
|
-
return `'
|
|
53
|
+
return `'${prefix}lib/${resolved}'`;
|
|
56
54
|
})
|
|
57
55
|
.replace(/import\(\s*['"]\.\.\/\.\.\/\.\.\/src\/lib\/([^'"]+)['"]\s*\)/g, (m, imp) => {
|
|
58
56
|
const resolved = imp.endsWith(".js") ? imp : imp + ".js";
|
|
59
|
-
return `import('
|
|
57
|
+
return `import('${prefix}lib/${resolved}')`;
|
|
60
58
|
})
|
|
61
|
-
//
|
|
62
|
-
.replace(/['"]
|
|
59
|
+
// Normalize any ../-chain pointing at dist/lib to the depth-correct prefix
|
|
60
|
+
.replace(/['"](?:\.\.\/)+dist\/lib\/([^'"]+)['"]/g, (m, imp) => {
|
|
63
61
|
const resolved = imp.endsWith(".js") ? imp : imp + ".js";
|
|
64
|
-
return `'
|
|
62
|
+
return `'${prefix}lib/${resolved}'`;
|
|
65
63
|
})
|
|
66
|
-
.replace(/import\(\s*['"]
|
|
64
|
+
.replace(/import\(\s*['"](?:\.\.\/)+dist\/lib\/([^'"]+)['"]\s*\)/g, (m, imp) => {
|
|
67
65
|
const resolved = imp.endsWith(".js") ? imp : imp + ".js";
|
|
68
|
-
return `import('
|
|
66
|
+
return `import('${prefix}lib/${resolved}')`;
|
|
69
67
|
})
|
|
70
68
|
.replace(/['"]\.\.\/\.\.\/src\/shared\/([^'"]+)['"]/g, (m, imp) => {
|
|
71
69
|
const resolved = imp.endsWith(".js") ? imp : imp + ".js";
|
|
@@ -7,7 +7,7 @@ import { createErrorResult } from "../../utils/error.js";
|
|
|
7
7
|
import { HTTP_STATUS } from "../../config/runtimeConfig.js";
|
|
8
8
|
import { parseSSEToOpenAIResponse } from "./sseToJsonHandler.js";
|
|
9
9
|
import { buildRequestDetail, extractRequestConfig, extractUsageFromResponse, saveUsageStats, formatDoneLine } from "./requestDetail.js";
|
|
10
|
-
import { appendRequestLog, saveRequestDetail } from '
|
|
10
|
+
import { appendRequestLog, saveRequestDetail } from '../../../../dist/lib/usageDb.js';
|
|
11
11
|
import { decloakToolNames } from "../../utils/claudeCloaking.js";
|
|
12
12
|
|
|
13
13
|
function parseToolArguments(value) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { saveRequestUsage, appendRequestLog, saveRequestDetail } from '
|
|
1
|
+
import { saveRequestUsage, appendRequestLog, saveRequestDetail } from '../../../../dist/lib/usageDb.js';
|
|
2
2
|
import { COLORS } from "../../utils/stream.js";
|
|
3
3
|
import { canonicalizeUsage } from "../../utils/usageTracking.js";
|
|
4
4
|
|
|
@@ -7,7 +7,7 @@ import { buildRequestDetail, extractRequestConfig, saveUsageStats, formatDoneLin
|
|
|
7
7
|
|
|
8
8
|
// Responses-API providers (e.g. codex) may emit SSE without content-type + use Responses output shape
|
|
9
9
|
const isResponsesProvider = (p) => PROVIDERS[p]?.format === FORMATS.OPENAI_RESPONSES;
|
|
10
|
-
import { saveRequestDetail, appendRequestLog } from '
|
|
10
|
+
import { saveRequestDetail, appendRequestLog } from '../../../../dist/lib/usageDb.js';
|
|
11
11
|
|
|
12
12
|
function textFromResponsesMessageItem(item) {
|
|
13
13
|
if (!item?.content || !Array.isArray(item.content)) return "";
|
|
@@ -6,7 +6,7 @@ import { PROVIDERS } from "../../config/providers.js";
|
|
|
6
6
|
import { STREAM_STALL_TIMEOUT_MS } from "../../config/runtimeConfig.js";
|
|
7
7
|
import { buildAbortedResponsesTerminalBytes } from "../../utils/responsesStreamHelpers.js";
|
|
8
8
|
import { buildRequestDetail, extractRequestConfig, saveUsageStats, formatDoneLine } from "./requestDetail.js";
|
|
9
|
-
import { saveRequestDetail } from '
|
|
9
|
+
import { saveRequestDetail } from '../../../../dist/lib/usageDb.js';
|
|
10
10
|
import { SSE_HEADERS_CORS as SSE_HEADERS } from "../../utils/sseConstants.js";
|
|
11
11
|
|
|
12
12
|
// Codex returns Responses API SSE → which client format to translate INTO, by request sourceFormat.
|
|
@@ -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('
|
|
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 '
|
|
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 '
|
|
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;
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
getComboModelProvider,
|
|
7
7
|
getComboModelString,
|
|
8
8
|
getComboStepTarget
|
|
9
|
-
} from '
|
|
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('
|
|
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 '
|
|
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 '
|
|
6
|
-
import { getCompressionAnalyticsSummary } from '
|
|
7
|
-
import { getCacheStatsSummary } from '
|
|
8
|
-
import { listCompressionCombos } from '
|
|
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('
|
|
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('
|
|
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('
|
|
40
|
-
const { calculateLevel, getLevelTitle, getLevelTier } = await import('
|
|
41
|
-
const { getStreak } = await import('
|
|
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('
|
|
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('
|
|
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('
|
|
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('
|
|
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('
|
|
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 '
|
|
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 '
|
|
3
|
-
import { createMemory, deleteMemory, listMemories } from '
|
|
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 '
|
|
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 '
|
|
3
|
-
import { getNotionToken } from '
|
|
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 '
|
|
2
|
+
import { createObsidianClient, createSyncServerClient, getSyncToken } from '../../../../dist/lib/obsidian/api.ts.js';
|
|
3
3
|
import {
|
|
4
4
|
getObsidianConfigForApiKey
|
|
5
|
-
} from '
|
|
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 '
|
|
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 '
|
|
4
|
-
import { pluginManager } from '
|
|
5
|
-
import { validatePluginConfig } from '
|
|
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('
|
|
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 '
|
|
3
|
-
import { skillExecutor } from '
|
|
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 '
|
|
5
|
+
import { getProviderConnectionById } from '../../../../dist/lib/db/providers.js';
|
|
6
6
|
import {
|
|
7
7
|
resolveResilienceSettings
|
|
8
|
-
} from '
|
|
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 '
|
|
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('
|
|
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('
|
|
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 '
|
|
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('
|
|
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 '
|
|
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) {
|
|
@@ -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 '
|
|
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('
|
|
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('
|
|
299
|
+
const { fetchKiroProfileArn } = await import('../../../../dist/lib/oauth/providers.js');
|
|
300
300
|
profileArn = await fetchKiroProfileArn(accessToken);
|
|
301
301
|
}
|
|
302
302
|
return profileArn ? { providerSpecificData: { profileArn } } : {};
|
|
@@ -7,7 +7,7 @@ import { createErrorResult } from "../../utils/error.js";
|
|
|
7
7
|
import { HTTP_STATUS } from "../../config/runtimeConfig.js";
|
|
8
8
|
import { parseSSEToOpenAIResponse } from "./sseToJsonHandler.js";
|
|
9
9
|
import { buildRequestDetail, extractRequestConfig, extractUsageFromResponse, saveUsageStats, formatDoneLine } from "./requestDetail.js";
|
|
10
|
-
import { appendRequestLog, saveRequestDetail } from '
|
|
10
|
+
import { appendRequestLog, saveRequestDetail } from '../../../dist/lib/usageDb.js';
|
|
11
11
|
import { decloakToolNames } from "../../utils/claudeCloaking.js";
|
|
12
12
|
|
|
13
13
|
function parseToolArguments(value) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { saveRequestUsage, appendRequestLog, saveRequestDetail } from '
|
|
1
|
+
import { saveRequestUsage, appendRequestLog, saveRequestDetail } from '../../../dist/lib/usageDb.js';
|
|
2
2
|
import { COLORS } from "../../utils/stream.js";
|
|
3
3
|
import { canonicalizeUsage } from "../../utils/usageTracking.js";
|
|
4
4
|
|
|
@@ -7,7 +7,7 @@ import { buildRequestDetail, extractRequestConfig, saveUsageStats, formatDoneLin
|
|
|
7
7
|
|
|
8
8
|
// Responses-API providers (e.g. codex) may emit SSE without content-type + use Responses output shape
|
|
9
9
|
const isResponsesProvider = (p) => PROVIDERS[p]?.format === FORMATS.OPENAI_RESPONSES;
|
|
10
|
-
import { saveRequestDetail, appendRequestLog } from '
|
|
10
|
+
import { saveRequestDetail, appendRequestLog } from '../../../dist/lib/usageDb.js';
|
|
11
11
|
|
|
12
12
|
function textFromResponsesMessageItem(item) {
|
|
13
13
|
if (!item?.content || !Array.isArray(item.content)) return "";
|
|
@@ -6,7 +6,7 @@ import { PROVIDERS } from "../../config/providers.js";
|
|
|
6
6
|
import { STREAM_STALL_TIMEOUT_MS } from "../../config/runtimeConfig.js";
|
|
7
7
|
import { buildAbortedResponsesTerminalBytes } from "../../utils/responsesStreamHelpers.js";
|
|
8
8
|
import { buildRequestDetail, extractRequestConfig, saveUsageStats, formatDoneLine } from "./requestDetail.js";
|
|
9
|
-
import { saveRequestDetail } from '
|
|
9
|
+
import { saveRequestDetail } from '../../../dist/lib/usageDb.js';
|
|
10
10
|
import { SSE_HEADERS_CORS as SSE_HEADERS } from "../../utils/sseConstants.js";
|
|
11
11
|
|
|
12
12
|
// Codex returns Responses API SSE → which client format to translate INTO, by request sourceFormat.
|
|
@@ -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('
|
|
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 '
|
|
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 '
|
|
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;
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
getComboModelProvider,
|
|
7
7
|
getComboModelString,
|
|
8
8
|
getComboStepTarget
|
|
9
|
-
} from '
|
|
9
|
+
} from '../../../dist/lib/combos/steps.ts.js';
|
|
10
10
|
import { normalizeRoutingStrategy } from "../../../src/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('
|
|
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 '
|
|
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 '
|
|
6
|
-
import { getCompressionAnalyticsSummary } from '
|
|
7
|
-
import { getCacheStatsSummary } from '
|
|
8
|
-
import { listCompressionCombos } from '
|
|
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('
|
|
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('
|
|
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('
|
|
40
|
-
const { calculateLevel, getLevelTitle, getLevelTier } = await import('
|
|
41
|
-
const { getStreak } = await import('
|
|
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('
|
|
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('
|
|
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('
|
|
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('
|
|
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('
|
|
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 '
|
|
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 '
|
|
3
|
-
import { createMemory, deleteMemory, listMemories } from '
|
|
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 '
|
|
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 '
|
|
3
|
-
import { getNotionToken } from '
|
|
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 '
|
|
2
|
+
import { createObsidianClient, createSyncServerClient, getSyncToken } from '../../../dist/lib/obsidian/api.ts.js';
|
|
3
3
|
import {
|
|
4
4
|
getObsidianConfigForApiKey
|
|
5
|
-
} from '
|
|
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 '
|
|
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 '
|
|
4
|
-
import { pluginManager } from '
|
|
5
|
-
import { validatePluginConfig } from '
|
|
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('
|
|
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 '
|
|
3
|
-
import { skillExecutor } from '
|
|
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 '
|
|
5
|
+
import { getProviderConnectionById } from '../../../dist/lib/db/providers.js';
|
|
6
6
|
import {
|
|
7
7
|
resolveResilienceSettings
|
|
8
|
-
} from '
|
|
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 '
|
|
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('
|
|
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('
|
|
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 "../../../src/shared/utils/circuitBreaker";
|
|
2
2
|
import { secureRandomFloat, secureRandomInt } from "../../../src/shared/utils/secureRandom";
|
|
3
|
-
import { getComboStepTarget, getComboStepWeight } from '
|
|
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('
|
|
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 '
|
|
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) {
|
|
@@ -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 '
|
|
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('
|
|
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('
|
|
299
|
+
const { fetchKiroProfileArn } = await import('../../../dist/lib/oauth/providers.js');
|
|
300
300
|
profileArn = await fetchKiroProfileArn(accessToken);
|
|
301
301
|
}
|
|
302
302
|
return profileArn ? { providerSpecificData: { profileArn } } : {};
|