- Bug B1-B7: media UI m.kind||m.type, serviceKinds, gemini mediaPriority, schema kind, models/info lookup by kind - Dead code D1-D6: safeParseJSON, drop PROVIDER_ENDPOINTS, orphan fetcher, GITHUB_CONFIG derive, getProviderConfig internal, legacy kiro file - Translator concerns: toOpenAIUsage, toOpenAIFinish (gemini/kiro/ollama + fix kiro tool finish), thinking effort maps - Reorg helpers/ → concerns/ (logic) + formats/ (per-format) + schema/ (pure enums: roles/blocks/finishReasons/defaults) - Wire ~280 hardcoded role/block/finish/default literals to schema enums across 20+ files - collapseTextParts + extractTextContent dedup - Normalize translator fn names to openaiToXRequest / xToOpenAIResponse - Golden tests lock behavior; 0 regression (byte-for-byte providers/alias, 26=26 known fails) Co-authored-by: Cursor <cursoragent@cursor.com>
79 lines
1.8 KiB
JavaScript
79 lines
1.8 KiB
JavaScript
import pkg from "../../../package.json" with { type: "json" };
|
|
|
|
// App configuration
|
|
export const APP_CONFIG = {
|
|
name: "9Router Proxy",
|
|
description: "AI Infrastructure Management",
|
|
version: pkg.version,
|
|
};
|
|
|
|
// GitHub configuration
|
|
export const GITHUB_CONFIG = {
|
|
changelogUrl: "https://raw.githubusercontent.com/decolua/9router/refs/heads/master/CHANGELOG.md",
|
|
donateUrl: "https://9router.com/api/donate",
|
|
};
|
|
|
|
// Updater configuration
|
|
export const UPDATER_CONFIG = {
|
|
npmPackageName: "9router",
|
|
installCmd: "npm i -g 9router",
|
|
installCmdLatest: "npm i -g 9router@latest --prefer-online",
|
|
shutdownCountdownSec: 3,
|
|
exitDelayMs: 500,
|
|
statusPort: 20129,
|
|
statusPollIntervalMs: 1000,
|
|
statusLogTailLines: 8,
|
|
installRetries: 3,
|
|
installRetryDelayMs: 5000,
|
|
lingerAfterDoneMs: 30000,
|
|
waitForExitMinMs: 5000,
|
|
waitForExitMaxMs: 20000,
|
|
waitForExitCheckMs: 500,
|
|
appPort: 20128,
|
|
};
|
|
|
|
// Theme configuration
|
|
export const THEME_CONFIG = {
|
|
storageKey: "theme",
|
|
defaultTheme: "system", // "light" | "dark" | "system"
|
|
};
|
|
|
|
// Subscription
|
|
export const SUBSCRIPTION_CONFIG = {
|
|
price: 1.0,
|
|
currency: "USD",
|
|
interval: "month",
|
|
planName: "Pro Plan",
|
|
};
|
|
|
|
// API endpoints
|
|
export const API_ENDPOINTS = {
|
|
users: "/api/users",
|
|
providers: "/api/providers",
|
|
payments: "/api/payments",
|
|
auth: "/api/auth",
|
|
};
|
|
|
|
export const CONSOLE_LOG_CONFIG = {
|
|
maxLines: 200,
|
|
pollIntervalMs: 1000,
|
|
};
|
|
|
|
// Client-side store TTL: how long fetched data stays fresh before re-fetching
|
|
export const CLIENT_STORE_TTL_MS = 60000;
|
|
|
|
// Re-export from providers.js for backward compatibility
|
|
export {
|
|
FREE_PROVIDERS,
|
|
OAUTH_PROVIDERS,
|
|
APIKEY_PROVIDERS,
|
|
WEB_COOKIE_PROVIDERS,
|
|
AI_PROVIDERS,
|
|
AUTH_METHODS,
|
|
} from "./providers.js";
|
|
|
|
// Re-export from models.js for backward compatibility
|
|
export {
|
|
PROVIDER_MODELS,
|
|
AI_MODELS,
|
|
} from "./models.js";
|