Refactor config

This commit is contained in:
decolua
2026-03-12 16:20:46 +07:00
parent c893aeaa4d
commit b0c6b61398
35 changed files with 575 additions and 650 deletions

View File

@@ -1,4 +1,4 @@
import { COOLDOWN_MS, BACKOFF_CONFIG, HTTP_STATUS } from "../config/constants.js";
import { COOLDOWN_MS, BACKOFF_CONFIG, HTTP_STATUS } from "../config/runtimeConfig.js";
/**
* Calculate exponential backoff cooldown for rate limits (429)

View File

@@ -8,7 +8,7 @@
* This significantly reduces the risk of being flagged by Google's anti-abuse systems.
*/
import {CLOUD_CODE_API, LOAD_CODE_ASSIST_HEADERS, LOAD_CODE_ASSIST_METADATA} from "../config/constants.js";
import { CLOUD_CODE_API, LOAD_CODE_ASSIST_HEADERS, LOAD_CODE_ASSIST_METADATA } from "../config/appConstants.js";
// ─── Cache ────────────────────────────────────────────────────────────────────
// connectionId -> { projectId: string, fetchedAt: number }

View File

@@ -1,4 +1,4 @@
import { PROVIDERS } from "../config/constants.js";
import { PROVIDERS } from "../config/providers.js";
import { buildClineHeaders } from "../../src/shared/utils/clineAuth.js";
const OPENAI_COMPATIBLE_PREFIX = "openai-compatible-";

View File

@@ -1,4 +1,5 @@
import { PROVIDERS, OAUTH_ENDPOINTS, GITHUB_COPILOT } from "../config/constants.js";
import { PROVIDERS } from "../config/providers.js";
import { OAUTH_ENDPOINTS, GITHUB_COPILOT } from "../config/appConstants.js";
// Token expiry buffer (refresh if expires within 5 minutes)
export const TOKEN_EXPIRY_BUFFER_MS = 5 * 60 * 1000;

View File

@@ -2,7 +2,7 @@
* Usage Fetcher - Get usage data from provider APIs
*/
import { CLIENT_METADATA, getPlatformUserAgent } from "../config/constants.js";
import { CLIENT_METADATA, getPlatformUserAgent } from "../config/appConstants.js";
// GitHub API config
const GITHUB_CONFIG = {