mirror of
https://github.com/tiennm99/ccs.git
synced 2026-07-16 00:22:34 +00:00
refactor(config): adopt config-loader-facade across codebase (#1169)
refactor(config): adopt config-loader-facade across codebase (#1161)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import { getCcsDir, loadConfigSafe } from '../../utils/config-manager';
|
||||
|
||||
import { buildProxyUrl, getProxyTarget } from '../../cliproxy/proxy/proxy-target-resolver';
|
||||
import { getEffectiveApiKey } from '../../cliproxy/auth/auth-token-manager';
|
||||
import { getModelMappingFromConfig } from '../../cliproxy/config/base-config-loader';
|
||||
@@ -11,7 +11,7 @@ import {
|
||||
mapExternalProviderName,
|
||||
} from '../../cliproxy/provider-capabilities';
|
||||
import { extractProviderFromPathname } from '../../cliproxy/ai-providers/model-id-normalizer';
|
||||
import { isUnifiedMode, loadOrCreateUnifiedConfig } from '../../config/unified-config-loader';
|
||||
|
||||
import type { TargetType } from '../../targets/target-adapter';
|
||||
import type { Settings } from '../../types/config';
|
||||
import type { CLIProxyProvider } from '../../cliproxy/types';
|
||||
@@ -21,6 +21,12 @@ import type {
|
||||
ModelMapping,
|
||||
ResolvedCliproxyBridgeProfile,
|
||||
} from './profile-types';
|
||||
import {
|
||||
getCcsDir,
|
||||
isUnifiedMode,
|
||||
loadConfigSafe,
|
||||
loadOrCreateUnifiedConfig,
|
||||
} from '../../config/config-loader-facade';
|
||||
|
||||
const DEFAULT_PROFILE_SUFFIX = '-api';
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import { getCcsDir } from '../../utils/config-manager';
|
||||
import { getCcsDir } from '../../config/config-loader-facade';
|
||||
|
||||
const OPENROUTER_API_URL = 'https://openrouter.ai/api/v1/models';
|
||||
function getCacheFile() {
|
||||
|
||||
@@ -9,12 +9,12 @@ import * as path from 'path';
|
||||
import type { Config, Settings } from '../../types';
|
||||
import type { TargetType } from '../../targets/target-adapter';
|
||||
import { getPersistedTargetChoices, isPersistedTargetType } from '../../targets/target-metadata';
|
||||
import { getCcsDir, getConfigPath, loadConfigSafe } from '../../utils/config-manager';
|
||||
import { getConfigPath } from '../../utils/config-manager';
|
||||
import { ensureWebSearchMcpOrThrow } from '../../utils/websearch-manager';
|
||||
import { ensureImageAnalysisMcpOrThrow } from '../../utils/image-analysis';
|
||||
import { isSensitiveKey } from '../../utils/sensitive-keys';
|
||||
import { isReservedName } from '../../config/reserved-names';
|
||||
import { isUnifiedMode, mutateUnifiedConfig } from '../../config/unified-config-loader';
|
||||
|
||||
import { validateApiName } from './validation-service';
|
||||
import { listApiProfiles } from './profile-reader';
|
||||
import { validateApiProfileSettingsPayload } from './profile-lifecycle-validation';
|
||||
@@ -26,6 +26,12 @@ import type {
|
||||
ImportApiProfileResult,
|
||||
RegisterApiProfileOrphansResult,
|
||||
} from './profile-types';
|
||||
import {
|
||||
getCcsDir,
|
||||
isUnifiedMode,
|
||||
loadConfigSafe,
|
||||
mutateConfig,
|
||||
} from '../../config/config-loader-facade';
|
||||
|
||||
const SETTINGS_FILE_SUFFIX = '.settings.json';
|
||||
const REDACTED_TOKEN_SENTINEL = '__CCS_REDACTED__';
|
||||
@@ -62,7 +68,7 @@ function writeJsonObjectAtomically(filePath: string, value: unknown): void {
|
||||
|
||||
function registerApiProfileInConfig(name: string, target: TargetType, force = false): void {
|
||||
if (isUnifiedMode()) {
|
||||
mutateUnifiedConfig((config) => {
|
||||
mutateConfig((config) => {
|
||||
if (config.profiles[name] && !force) {
|
||||
throw new Error(`API profile already exists: ${name}`);
|
||||
}
|
||||
|
||||
@@ -6,14 +6,18 @@
|
||||
*/
|
||||
|
||||
import * as fs from 'fs';
|
||||
import { loadConfigSafe } from '../../utils/config-manager';
|
||||
import { loadOrCreateUnifiedConfig, isUnifiedMode } from '../../config/unified-config-loader';
|
||||
|
||||
import { expandPath } from '../../utils/helpers';
|
||||
import type { TargetType } from '../../targets/target-adapter';
|
||||
import { isPersistedTargetType } from '../../targets/target-metadata';
|
||||
import type { Settings } from '../../types/config';
|
||||
import type { ApiProfileInfo, CliproxyVariantInfo, ApiListResult } from './profile-types';
|
||||
import { resolveCliproxyBridgeMetadata } from './cliproxy-profile-bridge';
|
||||
import {
|
||||
isUnifiedMode,
|
||||
loadConfigSafe,
|
||||
loadOrCreateUnifiedConfig,
|
||||
} from '../../config/config-loader-facade';
|
||||
|
||||
function sanitizeTarget(target: unknown): TargetType {
|
||||
if (isPersistedTargetType(target)) {
|
||||
|
||||
@@ -4,10 +4,10 @@
|
||||
*/
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import { getCcsDir, getConfigPath, loadConfigSafe } from '../../utils/config-manager';
|
||||
import { getConfigPath } from '../../utils/config-manager';
|
||||
import { expandPath } from '../../utils/helpers';
|
||||
import { validateApiName } from './validation-service';
|
||||
import { mutateUnifiedConfig, isUnifiedMode } from '../../config/unified-config-loader';
|
||||
|
||||
import { ensureWebSearchMcpOrThrow } from '../../utils/websearch-manager';
|
||||
import { ensureImageAnalysisMcpOrThrow } from '../../utils/image-analysis';
|
||||
import type { TargetType } from '../../targets/target-adapter';
|
||||
@@ -31,6 +31,12 @@ import {
|
||||
resolveCliproxyBridgeMetadata,
|
||||
resolveCliproxyBridgeProfile,
|
||||
} from './cliproxy-profile-bridge';
|
||||
import {
|
||||
getCcsDir,
|
||||
isUnifiedMode,
|
||||
loadConfigSafe,
|
||||
mutateConfig,
|
||||
} from '../../config/config-loader-facade';
|
||||
|
||||
/** Check if URL is an OpenRouter endpoint */
|
||||
function isOpenRouterUrl(baseUrl: string): boolean {
|
||||
@@ -232,7 +238,7 @@ function createApiProfileUnified(
|
||||
throw error;
|
||||
}
|
||||
|
||||
mutateUnifiedConfig((config) => {
|
||||
mutateConfig((config) => {
|
||||
config.profiles[name] = {
|
||||
type: 'api',
|
||||
settings: `~/.ccs/${settingsFile}`,
|
||||
@@ -343,7 +349,7 @@ export function updateApiProfileTarget(
|
||||
): UpdateApiProfileTargetResult {
|
||||
try {
|
||||
if (isUnifiedMode()) {
|
||||
mutateUnifiedConfig((config) => {
|
||||
mutateConfig((config) => {
|
||||
if (!config.profiles[name]) {
|
||||
throw new Error(`API profile not found: ${name}`);
|
||||
}
|
||||
@@ -392,7 +398,7 @@ export function updateApiProfileTarget(
|
||||
|
||||
/** Remove API profile from unified config */
|
||||
function removeApiProfileUnified(name: string): void {
|
||||
mutateUnifiedConfig((config) => {
|
||||
mutateConfig((config) => {
|
||||
const profile = config.profiles[name];
|
||||
|
||||
if (!profile) {
|
||||
|
||||
@@ -12,7 +12,7 @@ import {
|
||||
getWindowsEscapedCommandShell,
|
||||
stripClaudeCodeEnv,
|
||||
} from '../../utils/shell-executor';
|
||||
import { isUnifiedMode } from '../../config/unified-config-loader';
|
||||
|
||||
import { ProfileMetadata } from '../../types';
|
||||
import {
|
||||
resolveCreateAccountContext,
|
||||
@@ -25,6 +25,7 @@ import { exitWithError } from '../../errors';
|
||||
import { ExitCode } from '../../errors/exit-codes';
|
||||
import { CommandContext, parseArgs } from './types';
|
||||
import { stripAmbientProviderCredentials } from './create-command-env';
|
||||
import { isUnifiedMode } from '../../config/config-loader-facade';
|
||||
|
||||
function sanitizeProfileNameForInstance(name: string): string {
|
||||
return name.replace(/[^a-zA-Z0-9_-]/g, '-').toLowerCase();
|
||||
|
||||
@@ -5,10 +5,11 @@
|
||||
*/
|
||||
|
||||
import { initUI, color, dim, ok, fail } from '../../utils/ui';
|
||||
import { isUnifiedMode } from '../../config/unified-config-loader';
|
||||
|
||||
import { exitWithError } from '../../errors';
|
||||
import { ExitCode } from '../../errors/exit-codes';
|
||||
import { CommandContext, parseArgs } from './types';
|
||||
import { isUnifiedMode } from '../../config/config-loader-facade';
|
||||
|
||||
/**
|
||||
* Handle the default command (set default profile)
|
||||
|
||||
@@ -8,10 +8,11 @@ import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import { initUI, color, ok, fail, info } from '../../utils/ui';
|
||||
import { InteractivePrompt } from '../../utils/prompt';
|
||||
import { isUnifiedMode } from '../../config/unified-config-loader';
|
||||
|
||||
import { exitWithError } from '../../errors';
|
||||
import { ExitCode } from '../../errors/exit-codes';
|
||||
import { CommandContext, parseArgs } from './types';
|
||||
import { isUnifiedMode } from '../../config/config-loader-facade';
|
||||
|
||||
/**
|
||||
* Handle the remove command
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
import * as fs from 'fs';
|
||||
import {
|
||||
getConfigJsonPath,
|
||||
getContinuityInheritanceMap,
|
||||
isUnifiedMode,
|
||||
} from '../config/unified-config-loader';
|
||||
|
||||
import { warn } from '../utils/ui';
|
||||
import InstanceManager from '../management/instance-manager';
|
||||
import ProfileRegistry from './profile-registry';
|
||||
import { isAccountContextMetadata, resolveAccountContextPolicy } from './account-context';
|
||||
import type { ProfileType } from '../types/profile';
|
||||
import { getProfileLookupCandidates, resolveAliasToCanonical } from '../utils/profile-compat';
|
||||
import {
|
||||
getConfigJsonPath,
|
||||
getContinuityInheritanceMap,
|
||||
isUnifiedMode,
|
||||
} from '../config/config-loader-facade';
|
||||
|
||||
export interface ProfileContinuityInheritanceInput {
|
||||
profileName: string;
|
||||
|
||||
@@ -21,8 +21,7 @@ import {
|
||||
CompositeVariantConfig,
|
||||
CompositeTierConfig,
|
||||
} from '../config/unified-config-types';
|
||||
import { loadUnifiedConfig, isUnifiedMode, getCursorConfig } from '../config/unified-config-loader';
|
||||
import { getCcsDir } from '../utils/config-manager';
|
||||
|
||||
import { getProfileLookupCandidates, isLegacyProfileAlias } from '../utils/profile-compat';
|
||||
import type { CLIProxyProvider } from '../cliproxy/types';
|
||||
import { CLIPROXY_PROVIDER_IDS, isCLIProxyProvider } from '../cliproxy/provider-capabilities';
|
||||
@@ -30,6 +29,12 @@ import { LEGACY_CURSOR_PROFILE_NAME } from '../cursor/constants';
|
||||
import { normalizeCopilotModelId } from '../copilot/copilot-model-normalizer';
|
||||
import type { TargetType } from '../targets/target-adapter';
|
||||
import type { ProfileType } from '../types/profile';
|
||||
import {
|
||||
getCcsDir,
|
||||
getCursorConfig,
|
||||
isUnifiedMode,
|
||||
loadUnifiedConfig,
|
||||
} from '../config/config-loader-facade';
|
||||
export type { ProfileType } from '../types/profile';
|
||||
|
||||
/** CLIProxy profile names (OAuth-based, zero config) */
|
||||
|
||||
@@ -1,15 +1,17 @@
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import { ProfileMetadata } from '../types';
|
||||
import {
|
||||
loadOrCreateUnifiedConfig,
|
||||
mutateUnifiedConfig,
|
||||
isUnifiedMode,
|
||||
} from '../config/unified-config-loader';
|
||||
|
||||
import type { AccountConfig } from '../config/unified-config-types';
|
||||
import { getCcsDir } from '../utils/config-manager';
|
||||
|
||||
import { isValidContextGroupName, normalizeContextGroupName } from './account-context';
|
||||
import { createLogger } from '../services/logging';
|
||||
import {
|
||||
getCcsDir,
|
||||
isUnifiedMode,
|
||||
loadOrCreateUnifiedConfig,
|
||||
mutateConfig,
|
||||
} from '../config/config-loader-facade';
|
||||
|
||||
const logger = createLogger('auth:profile-registry');
|
||||
|
||||
@@ -323,7 +325,7 @@ export class ProfileRegistry {
|
||||
* Create account in unified config (config.yaml)
|
||||
*/
|
||||
createAccountUnified(name: string, metadata: CreateMetadata = {}): void {
|
||||
mutateUnifiedConfig((config) => {
|
||||
mutateConfig((config) => {
|
||||
if (config.accounts[name]) {
|
||||
throw new Error(`Account already exists: ${name}`);
|
||||
}
|
||||
@@ -342,7 +344,7 @@ export class ProfileRegistry {
|
||||
* Update account metadata in unified config
|
||||
*/
|
||||
updateAccountUnified(name: string, updates: Partial<AccountConfig>): void {
|
||||
mutateUnifiedConfig((config) => {
|
||||
mutateConfig((config) => {
|
||||
if (!config.accounts[name]) {
|
||||
throw new Error(`Account not found: ${name}`);
|
||||
}
|
||||
@@ -357,7 +359,7 @@ export class ProfileRegistry {
|
||||
* Remove account from unified config
|
||||
*/
|
||||
removeAccountUnified(name: string): void {
|
||||
mutateUnifiedConfig((config) => {
|
||||
mutateConfig((config) => {
|
||||
if (!config.accounts[name]) {
|
||||
throw new Error(`Account not found: ${name}`);
|
||||
}
|
||||
@@ -372,7 +374,7 @@ export class ProfileRegistry {
|
||||
* Set default profile in unified config
|
||||
*/
|
||||
setDefaultUnified(name: string): void {
|
||||
mutateUnifiedConfig((config) => {
|
||||
mutateConfig((config) => {
|
||||
const exists =
|
||||
config.accounts[name] || config.profiles[name] || config.cliproxy?.variants?.[name];
|
||||
if (!exists) {
|
||||
@@ -386,7 +388,7 @@ export class ProfileRegistry {
|
||||
* Clear default profile in unified config (restore original CCS behavior)
|
||||
*/
|
||||
clearDefaultUnified(): void {
|
||||
mutateUnifiedConfig((config) => {
|
||||
mutateConfig((config) => {
|
||||
config.default = undefined;
|
||||
});
|
||||
}
|
||||
@@ -426,7 +428,7 @@ export class ProfileRegistry {
|
||||
* Update account last_used in unified config
|
||||
*/
|
||||
touchAccountUnified(name: string): void {
|
||||
mutateUnifiedConfig((config) => {
|
||||
mutateConfig((config) => {
|
||||
if (!config.accounts[name]) {
|
||||
throw new Error(`Account not found: ${name}`);
|
||||
}
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import { getDefaultClaudeConfigDir } from '../utils/claude-config-path';
|
||||
import { getCcsDir } from '../utils/config-manager';
|
||||
|
||||
import InstanceManager from '../management/instance-manager';
|
||||
import ProfileDetector from './profile-detector';
|
||||
import { resolveConfiguredContinuitySourceAccount } from './profile-continuity-inheritance';
|
||||
import type { ProfileType } from '../types/profile';
|
||||
import { getCcsDir } from '../config/config-loader-facade';
|
||||
|
||||
export type ResumeLaneKind =
|
||||
| 'native'
|
||||
|
||||
+8
-11
@@ -2,12 +2,7 @@ import './utils/fetch-proxy-setup';
|
||||
|
||||
import * as fs from 'fs';
|
||||
import { detectClaudeCli } from './utils/claude-detector';
|
||||
import {
|
||||
getSettingsPath,
|
||||
loadSettings,
|
||||
setGlobalConfigDir,
|
||||
detectCloudSyncPath,
|
||||
} from './utils/config-manager';
|
||||
import { getSettingsPath, setGlobalConfigDir, detectCloudSyncPath } from './utils/config-manager';
|
||||
import { expandPath } from './utils/helpers';
|
||||
import {
|
||||
validateGlmKey,
|
||||
@@ -46,11 +41,7 @@ import {
|
||||
resolveOptionalBrowserAttachRuntime,
|
||||
syncBrowserMcpToConfigDir,
|
||||
} from './utils/browser';
|
||||
import {
|
||||
getBrowserConfig,
|
||||
getGlobalEnvConfig,
|
||||
getOfficialChannelsConfig,
|
||||
} from './config/unified-config-loader';
|
||||
|
||||
import {
|
||||
ensureProfileHooks as ensureImageAnalyzerHooks,
|
||||
removeImageAnalysisProfileHook,
|
||||
@@ -122,6 +113,12 @@ import {
|
||||
checkCachedUpdate,
|
||||
isCacheStale,
|
||||
} from './utils/update-checker';
|
||||
import {
|
||||
getBrowserConfig,
|
||||
getGlobalEnvConfig,
|
||||
getOfficialChannelsConfig,
|
||||
loadSettings,
|
||||
} from './config/config-loader-facade';
|
||||
// Note: npm is now the only supported installation method
|
||||
|
||||
// ========== Profile Detection ==========
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import { getCcsDir } from '../utils/config-manager';
|
||||
|
||||
import { getDefaultClaudeConfigDir } from '../utils/claude-config-path';
|
||||
import type { OfficialChannelId } from '../config/unified-config-types';
|
||||
import {
|
||||
@@ -10,6 +10,7 @@ import {
|
||||
getOfficialChannelTokenIds,
|
||||
isOfficialChannelTokenRequired,
|
||||
} from './official-channels-runtime';
|
||||
import { getCcsDir } from '../config/config-loader-facade';
|
||||
|
||||
export type OfficialChannelTokenSource = 'saved_env' | 'process_env' | 'missing';
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ import * as path from 'path';
|
||||
import { warn, info } from '../../utils/ui';
|
||||
import { CLIProxyProvider } from '../types';
|
||||
import { loadAccountsRegistry, pauseAccount, resumeAccount } from './registry';
|
||||
import { getCcsDir } from '../../utils/config-manager';
|
||||
import { getCcsDir } from '../../config/config-loader-facade';
|
||||
|
||||
const ISSUE_509_URL = 'https://github.com/kaitranntt/ccs/issues/509';
|
||||
|
||||
@@ -690,7 +690,7 @@ export async function handleQuotaExhaustion(
|
||||
// Dynamic imports to avoid circular dependencies
|
||||
const { applyCooldown, findHealthyAccount } = await import('../quota/quota-manager');
|
||||
const { setDefaultAccount, touchAccount } = await import('./account-manager');
|
||||
const { loadOrCreateUnifiedConfig } = await import('../../config/unified-config-loader');
|
||||
const { loadOrCreateUnifiedConfig } = await import('../../config/config-loader-facade');
|
||||
const config = loadOrCreateUnifiedConfig();
|
||||
const threshold = config.quota_management?.auto?.exhaustion_threshold ?? 5;
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
import { createInterface, Interface } from 'readline';
|
||||
import { fail, info, ok, warn } from '../../utils/ui';
|
||||
import { getCliproxySafetyConfig } from '../../config/unified-config-loader';
|
||||
import { getCliproxySafetyConfig } from '../../config/config-loader-facade';
|
||||
|
||||
export const ANTIGRAVITY_RISK_ISSUE_URL = 'https://github.com/kaitranntt/ccs/issues/509';
|
||||
export const ANTIGRAVITY_ACK_VERSION = '2026-02-24-antigravity-oauth-v2';
|
||||
|
||||
@@ -8,8 +8,9 @@
|
||||
*/
|
||||
|
||||
import { randomBytes } from 'crypto';
|
||||
import { loadOrCreateUnifiedConfig, mutateUnifiedConfig } from '../../config/unified-config-loader';
|
||||
|
||||
import { CCS_INTERNAL_API_KEY, CCS_CONTROL_PANEL_SECRET } from '../config/generator';
|
||||
import { loadOrCreateUnifiedConfig, mutateConfig } from '../../config/config-loader-facade';
|
||||
|
||||
/**
|
||||
* Generate a cryptographically secure token.
|
||||
@@ -87,7 +88,7 @@ export function getEffectiveManagementSecret(): string {
|
||||
* @param apiKey - New API key (or undefined to reset to default)
|
||||
*/
|
||||
export function setGlobalApiKey(apiKey: string | undefined): void {
|
||||
mutateUnifiedConfig((config) => {
|
||||
mutateConfig((config) => {
|
||||
if (!config.cliproxy.auth) {
|
||||
config.cliproxy.auth = {};
|
||||
}
|
||||
@@ -107,7 +108,7 @@ export function setGlobalApiKey(apiKey: string | undefined): void {
|
||||
* @param secret - New management secret (or undefined to reset to default)
|
||||
*/
|
||||
export function setGlobalManagementSecret(secret: string | undefined): void {
|
||||
mutateUnifiedConfig((config) => {
|
||||
mutateConfig((config) => {
|
||||
if (!config.cliproxy.auth) {
|
||||
config.cliproxy.auth = {};
|
||||
}
|
||||
@@ -128,7 +129,7 @@ export function setGlobalManagementSecret(secret: string | undefined): void {
|
||||
* @param apiKey - New API key (or undefined to remove override)
|
||||
*/
|
||||
export function setVariantApiKey(variantName: string, apiKey: string | undefined): void {
|
||||
mutateUnifiedConfig((config) => {
|
||||
mutateConfig((config) => {
|
||||
const variant = config.cliproxy.variants[variantName];
|
||||
|
||||
if (!variant) {
|
||||
@@ -155,7 +156,7 @@ export function setVariantApiKey(variantName: string, apiKey: string | undefined
|
||||
* Removes cliproxy.auth and all variant auth overrides.
|
||||
*/
|
||||
export function resetAuthToDefaults(): void {
|
||||
mutateUnifiedConfig((config) => {
|
||||
mutateConfig((config) => {
|
||||
delete config.cliproxy.auth;
|
||||
|
||||
for (const variantName of Object.keys(config.cliproxy.variants)) {
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
* Returns null if disabled or not configured.
|
||||
*/
|
||||
|
||||
import { loadOrCreateUnifiedConfig } from '../../config/unified-config-loader';
|
||||
import type { TokenRefreshSettings } from '../../config/unified-config-types';
|
||||
import { loadOrCreateUnifiedConfig } from '../../config/config-loader-facade';
|
||||
|
||||
/**
|
||||
* Get token refresh configuration from unified config
|
||||
|
||||
@@ -18,7 +18,7 @@ import {
|
||||
} from './binary/platform-detector';
|
||||
import { stopProxy } from './services/proxy-lifecycle-service';
|
||||
import { waitForPortFree } from '../utils/port-utils';
|
||||
import { loadOrCreateUnifiedConfig } from '../config/unified-config-loader';
|
||||
|
||||
import {
|
||||
UpdateCheckResult,
|
||||
checkForUpdates,
|
||||
@@ -39,6 +39,7 @@ import {
|
||||
|
||||
import type { CLIProxyBackend } from './types';
|
||||
import { getVersionListCachePath } from './binary/version-cache';
|
||||
import { loadOrCreateUnifiedConfig } from '../config/config-loader-facade';
|
||||
|
||||
export const CLIPROXY_DELETED_PLUS_REPO = 'router-for-me/CLIProxyAPIPlus';
|
||||
export const CLIPROXY_PLUS_FALLBACK_TRACKING_URL = 'https://github.com/kaitranntt/ccs/issues/1062';
|
||||
|
||||
@@ -7,7 +7,7 @@ import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import type { CLIProxyProvider, ProviderModelMapping } from '../types';
|
||||
import { getModelMappingFromConfig, getEnvVarsFromConfig } from '../config/base-config-loader';
|
||||
import { getGlobalEnvConfig } from '../../config/unified-config-loader';
|
||||
|
||||
import { getEffectiveApiKey } from '../auth/auth-token-manager';
|
||||
import { expandPath } from '../../utils/helpers';
|
||||
import { warn } from '../../utils/ui';
|
||||
@@ -31,6 +31,7 @@ import {
|
||||
normalizeIFlowLegacyModelAliases,
|
||||
normalizeModelIdForProvider,
|
||||
} from '../ai-providers/model-id-normalizer';
|
||||
import { getGlobalEnvConfig } from '../../config/config-loader-facade';
|
||||
|
||||
/** Settings file structure for user overrides */
|
||||
interface ProviderSettings {
|
||||
|
||||
@@ -9,11 +9,12 @@ import type { CLIProxyProvider, ProviderConfig } from '../types';
|
||||
import { getProviderDisplayName } from '../provider-capabilities';
|
||||
import { getModelMappingFromConfig } from '../config/base-config-loader';
|
||||
import { AI_PROVIDER_FAMILY_IDS } from '../ai-providers/types';
|
||||
import { loadOrCreateUnifiedConfig } from '../../config/unified-config-loader';
|
||||
|
||||
import { getEffectiveApiKey, getEffectiveManagementSecret } from '../auth/auth-token-manager';
|
||||
import { getDeniedModelIdReasonForProvider } from '../ai-providers/model-id-normalizer';
|
||||
import { getAuthDir, getProviderAuthDir, getConfigPathForPort } from './path-resolver';
|
||||
import { CLIPROXY_DEFAULT_PORT } from './port-manager';
|
||||
import { loadOrCreateUnifiedConfig } from '../../config/config-loader-facade';
|
||||
|
||||
/** Internal API key for CCS-managed requests */
|
||||
export const CCS_INTERNAL_API_KEY = 'ccs-internal-managed';
|
||||
|
||||
@@ -12,8 +12,9 @@ import { getProviderCatalog, supportsModelConfig, ModelEntry } from '../model-ca
|
||||
import { getClaudeEnvVars, resolveProviderSettingsPath } from './config-generator';
|
||||
import { CLIProxyProvider } from '../types';
|
||||
import { initUI, color, bold, dim, ok, info, header } from '../../utils/ui';
|
||||
import { getCcsDir } from '../../utils/config-manager';
|
||||
|
||||
import { normalizeModelIdForProvider } from '../ai-providers/model-id-normalizer';
|
||||
import { getCcsDir } from '../../config/config-loader-facade';
|
||||
|
||||
function canonicalizeModelForProvider(provider: CLIProxyProvider, model: string): string {
|
||||
return normalizeModelIdForProvider(model, provider);
|
||||
|
||||
@@ -4,9 +4,10 @@
|
||||
*/
|
||||
|
||||
import * as path from 'path';
|
||||
import { getCcsDir } from '../../utils/config-manager';
|
||||
|
||||
import type { CLIProxyProvider } from '../types';
|
||||
import { CLIPROXY_DEFAULT_PORT } from './port-manager';
|
||||
import { getCcsDir } from '../../config/config-loader-facade';
|
||||
|
||||
/**
|
||||
* Get CLIProxy base directory
|
||||
|
||||
@@ -6,11 +6,12 @@
|
||||
import type { CLIProxyProvider } from '../types';
|
||||
import { DEFAULT_THINKING_TIER_DEFAULTS } from '../../config/unified-config-types';
|
||||
import type { ThinkingConfig } from '../../config/unified-config-types';
|
||||
import { getThinkingConfig } from '../../config/unified-config-loader';
|
||||
|
||||
import { getModelThinkingSupport, supportsThinking } from '../model-catalog';
|
||||
import { isThinkingOffValue, validateThinking } from '../thinking-validator';
|
||||
import { normalizeModelIdForProvider } from '../ai-providers/model-id-normalizer';
|
||||
import { warn } from '../../utils/ui';
|
||||
import { getThinkingConfig } from '../../config/config-loader-facade';
|
||||
|
||||
/** Model tier types for thinking budget defaults */
|
||||
export type ModelTier = 'opus' | 'sonnet' | 'haiku';
|
||||
|
||||
@@ -16,7 +16,7 @@ import * as os from 'os';
|
||||
import * as path from 'path';
|
||||
import { ProgressIndicator } from '../../utils/progress-indicator';
|
||||
import { ok, fail, info, warn } from '../../utils/ui';
|
||||
import { getCcsDir } from '../../utils/config-manager';
|
||||
|
||||
import { escapeShellArg, getWindowsEscapedCommandShell } from '../../utils/shell-executor';
|
||||
import {
|
||||
ensureCLIProxyBinary,
|
||||
@@ -77,11 +77,7 @@ import {
|
||||
resolveOptionalBrowserAttachRuntime,
|
||||
syncBrowserMcpToConfigDir,
|
||||
} from '../../utils/browser';
|
||||
import {
|
||||
getBrowserConfig,
|
||||
loadOrCreateUnifiedConfig,
|
||||
getThinkingConfig,
|
||||
} from '../../config/unified-config-loader';
|
||||
|
||||
import { HttpsTunnelProxy } from '../proxy/https-tunnel-proxy';
|
||||
import {
|
||||
isKiroAuthMethod,
|
||||
@@ -128,6 +124,12 @@ import {
|
||||
shouldDisableCodexReasoning,
|
||||
} from './thinking-override-resolver';
|
||||
import { shouldStartHttpsTunnel } from './https-tunnel-policy';
|
||||
import {
|
||||
getBrowserConfig,
|
||||
getCcsDir,
|
||||
getThinkingConfig,
|
||||
loadOrCreateUnifiedConfig,
|
||||
} from '../../config/config-loader-facade';
|
||||
|
||||
function resolveRuntimeQuotaMonitorProviders(
|
||||
provider: CLIProxyProvider,
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
* based on unified config. Used by stats-fetcher, auth-routes, and UI.
|
||||
*/
|
||||
|
||||
import { loadOrCreateUnifiedConfig } from '../../config/unified-config-loader';
|
||||
import type { CliproxyServerConfig } from '../../config/unified-config-types';
|
||||
import {
|
||||
CLIPROXY_DEFAULT_PORT,
|
||||
@@ -15,6 +14,7 @@ import {
|
||||
} from '../config/port-manager';
|
||||
import { getProxyEnvVars } from './proxy-config-resolver';
|
||||
import { getEffectiveManagementSecret } from '../auth/auth-token-manager';
|
||||
import { loadOrCreateUnifiedConfig } from '../../config/config-loader-facade';
|
||||
|
||||
/** Resolved proxy target for making requests */
|
||||
export interface ProxyTarget {
|
||||
|
||||
@@ -25,8 +25,9 @@ import {
|
||||
stripCodexEffortSuffix,
|
||||
} from '../ai-providers/model-id-normalizer';
|
||||
import { getModelMaxLevel } from '../model-catalog';
|
||||
import { getCcsDir } from '../../utils/config-manager';
|
||||
|
||||
import { createLogger } from '../../services/logging';
|
||||
import { getCcsDir } from '../../config/config-loader-facade';
|
||||
|
||||
export interface ToolSanitizationProxyConfig {
|
||||
/** Upstream CLIProxy URL */
|
||||
|
||||
@@ -32,8 +32,9 @@ import {
|
||||
touchAccount,
|
||||
type AccountInfo,
|
||||
} from '../accounts/account-manager';
|
||||
import { loadOrCreateUnifiedConfig } from '../../config/unified-config-loader';
|
||||
|
||||
import type { RuntimeMonitorConfig } from '../../config/unified-config-types';
|
||||
import { loadOrCreateUnifiedConfig } from '../../config/config-loader-facade';
|
||||
|
||||
export type ManagedQuotaProvider = 'agy' | 'claude' | 'codex' | 'gemini' | 'ghcp';
|
||||
type ManagedQuotaResult =
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { mutateUnifiedConfig, loadOrCreateUnifiedConfig } from '../../config/unified-config-loader';
|
||||
import { regenerateConfig } from '../config/generator';
|
||||
import { getAuthDir, getConfigPathForPort } from '../config/path-resolver';
|
||||
import {
|
||||
@@ -7,6 +6,7 @@ import {
|
||||
getRoutingErrorMessage,
|
||||
} from './routing-strategy-http';
|
||||
import type { CliproxyRoutingStrategy } from '../types';
|
||||
import { loadOrCreateUnifiedConfig, mutateConfig } from '../../config/config-loader-facade';
|
||||
|
||||
export const DEFAULT_CLIPROXY_ROUTING_STRATEGY: CliproxyRoutingStrategy = 'round-robin';
|
||||
export const DEFAULT_CLIPROXY_SESSION_AFFINITY_ENABLED = false;
|
||||
@@ -223,7 +223,7 @@ export async function applyCliproxyRoutingStrategy(
|
||||
};
|
||||
}
|
||||
|
||||
mutateUnifiedConfig((config) => {
|
||||
mutateConfig((config) => {
|
||||
if (config.cliproxy) {
|
||||
config.cliproxy.routing = { ...config.cliproxy.routing, strategy };
|
||||
}
|
||||
@@ -278,7 +278,7 @@ export async function applyCliproxySessionAffinitySettings(
|
||||
current.ttl ??
|
||||
DEFAULT_CLIPROXY_SESSION_AFFINITY_TTL;
|
||||
|
||||
mutateUnifiedConfig((config) => {
|
||||
mutateConfig((config) => {
|
||||
if (config.cliproxy) {
|
||||
config.cliproxy.routing = {
|
||||
...config.cliproxy.routing,
|
||||
|
||||
@@ -22,7 +22,7 @@ import {
|
||||
} from '../binary-manager';
|
||||
import { BACKEND_CONFIG, DEFAULT_BACKEND } from '../binary/platform-detector';
|
||||
import { CLIProxyBackend } from '../types';
|
||||
import { loadOrCreateUnifiedConfig } from '../../config/unified-config-loader';
|
||||
import { loadOrCreateUnifiedConfig } from '../../config/config-loader-facade';
|
||||
|
||||
/** Binary status result */
|
||||
export interface BinaryStatusResult {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import { getCcsDir } from '../../utils/config-manager';
|
||||
|
||||
import type { CLIProxyProvider } from '../types';
|
||||
import type { ModelEntry, ProviderCatalog, ThinkingSupport } from '../model-catalog';
|
||||
import { MODEL_CATALOG } from '../model-catalog';
|
||||
@@ -15,6 +15,7 @@ import {
|
||||
buildProxyUrl,
|
||||
getProxyTarget,
|
||||
} from '../proxy/proxy-target-resolver';
|
||||
import { getCcsDir } from '../../config/config-loader-facade';
|
||||
|
||||
const CACHE_FILE_NAME = 'model-catalog-cache.json';
|
||||
const CACHE_TTL_MS = 24 * 60 * 60 * 1000; // 24 hours
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import * as fs from 'fs';
|
||||
import { getConfigPath, loadConfigSafe } from '../../utils/config-manager';
|
||||
import { getConfigPath } from '../../utils/config-manager';
|
||||
import { CLIProxyProvider } from '../types';
|
||||
import type { TargetType } from '../../targets/target-adapter';
|
||||
import {
|
||||
@@ -8,12 +8,14 @@ import {
|
||||
CompositeTierConfig,
|
||||
CLIPROXY_SUPPORTED_PROVIDERS,
|
||||
} from '../../config/unified-config-types';
|
||||
import {
|
||||
loadOrCreateUnifiedConfig,
|
||||
mutateUnifiedConfig,
|
||||
isUnifiedMode,
|
||||
} from '../../config/unified-config-loader';
|
||||
|
||||
import { CLIPROXY_DEFAULT_PORT } from '../config/config-generator';
|
||||
import {
|
||||
isUnifiedMode,
|
||||
loadConfigSafe,
|
||||
loadOrCreateUnifiedConfig,
|
||||
mutateConfig,
|
||||
} from '../../config/config-loader-facade';
|
||||
|
||||
export const VARIANT_PORT_BASE = CLIPROXY_DEFAULT_PORT + 1;
|
||||
export const VARIANT_PORT_MAX_OFFSET = 100;
|
||||
@@ -171,7 +173,7 @@ export function listVariantsFromConfig(): Record<string, VariantConfig> {
|
||||
}
|
||||
|
||||
export function saveCompositeVariantUnified(name: string, config: CompositeVariantConfig): void {
|
||||
mutateUnifiedConfig((unifiedConfig) => {
|
||||
mutateConfig((unifiedConfig) => {
|
||||
if (!unifiedConfig.cliproxy) {
|
||||
unifiedConfig.cliproxy = {
|
||||
oauth_accounts: {},
|
||||
@@ -195,7 +197,7 @@ export function saveVariantUnified(
|
||||
port?: number,
|
||||
target: TargetType = 'claude'
|
||||
): void {
|
||||
mutateUnifiedConfig((config) => {
|
||||
mutateConfig((config) => {
|
||||
if (!config.cliproxy) {
|
||||
config.cliproxy = {
|
||||
oauth_accounts: {},
|
||||
@@ -266,7 +268,7 @@ export function saveVariantLegacy(
|
||||
|
||||
export function removeVariantFromUnifiedConfig(name: string): VariantConfig | null {
|
||||
let removedVariant: CLIProxyVariantConfig | CompositeVariantConfig | null = null;
|
||||
mutateUnifiedConfig((config) => {
|
||||
mutateConfig((config) => {
|
||||
if (!config.cliproxy?.variants || !(name in config.cliproxy.variants)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -12,11 +12,11 @@ import { CLIProxyProvider, PLUS_ONLY_PROVIDERS } from '../types';
|
||||
import { CompositeTierConfig, CompositeVariantConfig } from '../../config/unified-config-types';
|
||||
import type { TargetType } from '../../targets/target-adapter';
|
||||
import { isReservedName, isWindowsReservedName } from '../../config/reserved-names';
|
||||
import { isUnifiedMode } from '../../config/unified-config-loader';
|
||||
|
||||
import { deleteConfigForPort } from '../config/config-generator';
|
||||
import { hasActiveSessions, deleteSessionLockForPort } from '../session-tracker';
|
||||
import { warn } from '../../utils/ui';
|
||||
import { getCcsDir } from '../../utils/config-manager';
|
||||
|
||||
import { validateCompositeTiers } from '../config/composite-validator';
|
||||
import {
|
||||
canonicalizeModelIdForProvider,
|
||||
@@ -43,6 +43,7 @@ import {
|
||||
getNextAvailablePort,
|
||||
} from './variant-config-adapter';
|
||||
import { getConfiguredBackend, getPlusBackendUnavailableMessage } from '../binary-manager';
|
||||
import { getCcsDir, isUnifiedMode } from '../../config/config-loader-facade';
|
||||
|
||||
// Re-export VariantConfig from adapter
|
||||
export type { VariantConfig } from './variant-config-adapter';
|
||||
|
||||
@@ -9,7 +9,7 @@ import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import * as os from 'os';
|
||||
import { CLIProxyProfileName } from '../../auth/profile-detector';
|
||||
import { getCcsDir } from '../../utils/config-manager';
|
||||
|
||||
import { expandPath } from '../../utils/helpers';
|
||||
import { getClaudeEnvVars, CLIPROXY_DEFAULT_PORT } from '../config/config-generator';
|
||||
import { CLIProxyProvider } from '../types';
|
||||
@@ -24,6 +24,7 @@ import { prepareImageAnalysisFallbackHook } from '../../utils/hooks';
|
||||
import { getEffectiveApiKey } from '../auth/auth-token-manager';
|
||||
import { warn } from '../../utils/ui';
|
||||
import { normalizeModelIdForProvider } from '../ai-providers/model-id-normalizer';
|
||||
import { getCcsDir } from '../../config/config-loader-facade';
|
||||
|
||||
/** Environment settings structure */
|
||||
interface SettingsEnv {
|
||||
|
||||
@@ -7,9 +7,9 @@
|
||||
|
||||
import * as chokidar from 'chokidar';
|
||||
import * as path from 'path';
|
||||
import { getCcsDir } from '../../utils/config-manager';
|
||||
import { loadOrCreateUnifiedConfig } from '../../config/unified-config-loader';
|
||||
|
||||
import { syncToLocalConfig } from './local-config-sync';
|
||||
import { getCcsDir, loadOrCreateUnifiedConfig } from '../../config/config-loader-facade';
|
||||
|
||||
/** Debounce delay in milliseconds */
|
||||
const DEBOUNCE_MS = 3000;
|
||||
|
||||
@@ -6,10 +6,11 @@
|
||||
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import { getCcsDir } from '../../utils/config-manager';
|
||||
|
||||
import { expandPath } from '../../utils/helpers';
|
||||
import { listApiProfiles, isApiProfileConfigured } from '../../api/services/profile-reader';
|
||||
import type { ClaudeKey } from '../management/management-api-types';
|
||||
import { getCcsDir } from '../../config/config-loader-facade';
|
||||
|
||||
/**
|
||||
* Profile info with settings for sync.
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
import * as browserUtils from '../utils/browser';
|
||||
import { getBrowserConfig, mutateUnifiedConfig } from '../config/unified-config-loader';
|
||||
|
||||
import type { BrowserToolPolicy } from '../config/unified-config-types';
|
||||
import { getCcsPathDisplay } from '../utils/config-manager';
|
||||
import { getNodePlatformKey } from '../utils/browser/platform';
|
||||
import { color, dim, header, initUI, subheader } from '../utils/ui';
|
||||
import { getBrowserConfig, mutateConfig } from '../config/config-loader-facade';
|
||||
|
||||
type HelpWriter = (line: string) => void;
|
||||
type BrowserLane = 'claude' | 'codex' | 'all';
|
||||
@@ -216,7 +217,7 @@ function updateBrowserPolicies(updates: {
|
||||
claude?: BrowserToolPolicy;
|
||||
codex?: BrowserToolPolicy;
|
||||
}): void {
|
||||
mutateUnifiedConfig((config) => {
|
||||
mutateConfig((config) => {
|
||||
const current = getBrowserConfig();
|
||||
config.browser = {
|
||||
claude: {
|
||||
@@ -235,7 +236,7 @@ function updateBrowserPolicies(updates: {
|
||||
|
||||
function updateBrowserEnabled(subcommand: 'enable' | 'disable', lane: BrowserLane): void {
|
||||
const nextEnabled = subcommand === 'enable';
|
||||
mutateUnifiedConfig((config) => {
|
||||
mutateConfig((config) => {
|
||||
const current = getBrowserConfig();
|
||||
config.browser = {
|
||||
claude: {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { CLIPROXY_DEFAULT_PORT, validatePort } from '../../cliproxy/config/port-manager';
|
||||
import { loadOrCreateUnifiedConfig } from '../../config/unified-config-loader';
|
||||
|
||||
import type { UnifiedConfig } from '../../config/unified-config-types';
|
||||
import { loadOrCreateUnifiedConfig } from '../../config/config-loader-facade';
|
||||
|
||||
type LifecyclePortConfig = Pick<UnifiedConfig, 'cliproxy_server'>;
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ import type { CliproxyProviderRoutingHints } from '../../shared/cliproxy-model-r
|
||||
import { CLIProxyProvider, CLIProxyBackend } from '../../cliproxy/types';
|
||||
import type { TargetType } from '../../targets/target-adapter';
|
||||
import { getPersistedTargetChoices, isPersistedTargetType } from '../../targets/target-metadata';
|
||||
import { isUnifiedMode } from '../../config/unified-config-loader';
|
||||
|
||||
import { initUI, header, color, ok, fail, warn, info, infoBox, dim } from '../../utils/ui';
|
||||
import { InteractivePrompt } from '../../utils/prompt';
|
||||
import {
|
||||
@@ -32,6 +32,7 @@ import {
|
||||
import { DEFAULT_BACKEND } from '../../cliproxy/binary/platform-detector';
|
||||
import { CompositeTierConfig } from '../../config/unified-config-types';
|
||||
import { formatAccountDisplayName } from '../../cliproxy/accounts/email-account-identity';
|
||||
import { isUnifiedMode } from '../../config/config-loader-facade';
|
||||
|
||||
interface CliproxyProfileArgs {
|
||||
name?: string;
|
||||
|
||||
@@ -5,8 +5,9 @@
|
||||
*/
|
||||
|
||||
import { InteractivePrompt } from '../../utils/prompt';
|
||||
import { getDashboardAuthConfig, mutateUnifiedConfig } from '../../config/unified-config-loader';
|
||||
|
||||
import { initUI, header, ok, info, warn, dim } from '../../utils/ui';
|
||||
import { getDashboardAuthConfig, mutateConfig } from '../../config/config-loader-facade';
|
||||
|
||||
/**
|
||||
* Handle disable command - disable auth with confirmation
|
||||
@@ -53,7 +54,7 @@ export async function handleDisable(): Promise<void> {
|
||||
}
|
||||
|
||||
// Disable auth
|
||||
mutateUnifiedConfig((fullConfig) => {
|
||||
mutateConfig((fullConfig) => {
|
||||
fullConfig.dashboard_auth = {
|
||||
enabled: false,
|
||||
username: fullConfig.dashboard_auth?.username ?? '',
|
||||
|
||||
@@ -8,9 +8,10 @@
|
||||
|
||||
import bcrypt from 'bcrypt';
|
||||
import { InteractivePrompt } from '../../utils/prompt';
|
||||
import { mutateUnifiedConfig } from '../../config/unified-config-loader';
|
||||
|
||||
import { initUI, header, subheader, ok, fail, info, warn, dim } from '../../utils/ui';
|
||||
import type { AuthSetupResult } from './types';
|
||||
import { mutateConfig } from '../../config/config-loader-facade';
|
||||
|
||||
const BCRYPT_ROUNDS = 10;
|
||||
const MIN_PASSWORD_LENGTH = 8;
|
||||
@@ -99,7 +100,7 @@ export async function handleSetup(): Promise<AuthSetupResult> {
|
||||
// Hash password
|
||||
const passwordHash = await bcrypt.hash(password, BCRYPT_ROUNDS);
|
||||
|
||||
const config = mutateUnifiedConfig((currentConfig) => {
|
||||
const config = mutateConfig((currentConfig) => {
|
||||
currentConfig.dashboard_auth = {
|
||||
enabled: true,
|
||||
username,
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
* Display current dashboard authentication status.
|
||||
*/
|
||||
|
||||
import { getDashboardAuthConfig } from '../../config/unified-config-loader';
|
||||
import { initUI, header, subheader, ok, info, warn, dim, color } from '../../utils/ui';
|
||||
import type { AuthStatusInfo } from './types';
|
||||
import { getDashboardAuthConfig } from '../../config/config-loader-facade';
|
||||
|
||||
/**
|
||||
* Get auth status info with ENV override detection
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
import { initUI, header, ok, info, warn, fail, subheader, color, dim } from '../utils/ui';
|
||||
import {
|
||||
getOfficialChannelsConfig,
|
||||
loadOrCreateUnifiedConfig,
|
||||
updateUnifiedConfig,
|
||||
} from '../config/unified-config-loader';
|
||||
|
||||
import type { OfficialChannelId } from '../config/unified-config-types';
|
||||
import { DEFAULT_OFFICIAL_CHANNELS_CONFIG } from '../config/unified-config-types';
|
||||
import {
|
||||
@@ -42,6 +38,11 @@ import {
|
||||
isOfficialChannelSelectionValid,
|
||||
} from '../channels/official-channels-runtime';
|
||||
import { extractOption, hasAnyFlag } from './arg-extractor';
|
||||
import {
|
||||
getOfficialChannelsConfig,
|
||||
loadOrCreateUnifiedConfig,
|
||||
updateConfig,
|
||||
} from '../config/config-loader-facade';
|
||||
|
||||
interface ChannelsCommandOptions {
|
||||
enable: boolean;
|
||||
@@ -440,7 +441,7 @@ export async function handleConfigChannelsCommand(args: string[]): Promise<void>
|
||||
|
||||
try {
|
||||
if (hasConfigMutation) {
|
||||
updateUnifiedConfig({ channels: nextConfig });
|
||||
updateConfig({ channels: nextConfig });
|
||||
}
|
||||
|
||||
if (options.setToken) {
|
||||
|
||||
@@ -12,7 +12,7 @@ import { startServer } from '../web-server';
|
||||
import { setupGracefulShutdown } from '../web-server/shutdown';
|
||||
import { ensureCliproxyService } from '../cliproxy/service-manager';
|
||||
import { CLIPROXY_DEFAULT_PORT } from '../cliproxy/config/config-generator';
|
||||
import { getDashboardAuthConfig } from '../config/unified-config-loader';
|
||||
|
||||
import { initUI, header, ok, info, warn, fail } from '../utils/ui';
|
||||
import { resolveNamedCommand, type NamedCommandRoute } from './named-command-router';
|
||||
import {
|
||||
@@ -23,6 +23,7 @@ import {
|
||||
} from './config-dashboard-host';
|
||||
import { parseConfigCommandArgs, showConfigCommandHelp } from './config-command-options';
|
||||
import { createLogger } from '../services/logging';
|
||||
import { getDashboardAuthConfig } from '../config/config-loader-facade';
|
||||
|
||||
const logger = createLogger('command:config');
|
||||
|
||||
|
||||
@@ -6,11 +6,7 @@
|
||||
*/
|
||||
|
||||
import { initUI, header, ok, info, warn, fail, subheader, color, dim } from '../utils/ui';
|
||||
import {
|
||||
getImageAnalysisConfig,
|
||||
updateUnifiedConfig,
|
||||
loadOrCreateUnifiedConfig,
|
||||
} from '../config/unified-config-loader';
|
||||
|
||||
import { DEFAULT_IMAGE_ANALYSIS_CONFIG } from '../config/unified-config-types';
|
||||
import {
|
||||
CLIPROXY_PROVIDER_IDS,
|
||||
@@ -19,6 +15,11 @@ import {
|
||||
} from '../cliproxy/provider-capabilities';
|
||||
import { extractOption, hasAnyFlag } from './arg-extractor';
|
||||
import { normalizeImageAnalysisBackendId } from '../utils/hooks';
|
||||
import {
|
||||
getImageAnalysisConfig,
|
||||
loadOrCreateUnifiedConfig,
|
||||
updateConfig,
|
||||
} from '../config/config-loader-facade';
|
||||
|
||||
interface ImageAnalysisCommandOptions {
|
||||
enable?: boolean;
|
||||
@@ -346,7 +347,7 @@ export async function handleConfigImageAnalysisCommand(args: string[]): Promise<
|
||||
}
|
||||
|
||||
if (hasChanges) {
|
||||
updateUnifiedConfig({ image_analysis: imageConfig });
|
||||
updateConfig({ image_analysis: imageConfig });
|
||||
console.log(ok('Configuration updated'));
|
||||
console.log('');
|
||||
}
|
||||
|
||||
@@ -6,11 +6,7 @@
|
||||
*/
|
||||
|
||||
import { initUI, header, ok, info, warn, fail, subheader, color, dim } from '../utils/ui';
|
||||
import {
|
||||
getThinkingConfig,
|
||||
updateUnifiedConfig,
|
||||
loadOrCreateUnifiedConfig,
|
||||
} from '../config/unified-config-loader';
|
||||
|
||||
import { DEFAULT_THINKING_TIER_DEFAULTS } from '../config/unified-config-types';
|
||||
import { VALID_THINKING_LEVELS } from '../cliproxy/thinking-validator';
|
||||
import {
|
||||
@@ -18,6 +14,11 @@ import {
|
||||
parseThinkingCommandArgs,
|
||||
parseThinkingOverrideInput,
|
||||
} from './config-thinking-parser';
|
||||
import {
|
||||
getThinkingConfig,
|
||||
loadOrCreateUnifiedConfig,
|
||||
updateConfig,
|
||||
} from '../config/config-loader-facade';
|
||||
|
||||
const VALID_THINKING_MODES = ['auto', 'off', 'manual'] as const;
|
||||
|
||||
@@ -293,7 +294,7 @@ export async function handleConfigThinkingCommand(args: string[]): Promise<void>
|
||||
}
|
||||
|
||||
if (hasChanges) {
|
||||
updateUnifiedConfig({ thinking: thinkingConfig });
|
||||
updateConfig({ thinking: thinkingConfig });
|
||||
console.log(ok('Configuration updated'));
|
||||
console.log('');
|
||||
}
|
||||
|
||||
@@ -15,10 +15,11 @@ import {
|
||||
normalizeCopilotConfigWithWarnings,
|
||||
} from '../copilot';
|
||||
import type { CopilotModel } from '../copilot';
|
||||
import { loadOrCreateUnifiedConfig, mutateUnifiedConfig } from '../config/unified-config-loader';
|
||||
|
||||
import { DEFAULT_COPILOT_CONFIG } from '../config/unified-config-types';
|
||||
import { ok, fail, info, color, warn } from '../utils/ui';
|
||||
import { normalizeCopilotSubcommand } from '../copilot/constants';
|
||||
import { loadOrCreateUnifiedConfig, mutateConfig } from '../config/config-loader-facade';
|
||||
|
||||
/**
|
||||
* Handle copilot subcommand.
|
||||
@@ -361,7 +362,7 @@ async function handleStop(): Promise<number> {
|
||||
* Handle enable subcommand.
|
||||
*/
|
||||
async function handleEnable(): Promise<number> {
|
||||
mutateUnifiedConfig((config) => {
|
||||
mutateConfig((config) => {
|
||||
if (!config.copilot) {
|
||||
config.copilot = { ...DEFAULT_COPILOT_CONFIG };
|
||||
}
|
||||
@@ -383,7 +384,7 @@ async function handleEnable(): Promise<number> {
|
||||
* Handle disable subcommand.
|
||||
*/
|
||||
async function handleDisable(): Promise<number> {
|
||||
mutateUnifiedConfig((config) => {
|
||||
mutateConfig((config) => {
|
||||
if (config.copilot) {
|
||||
config.copilot.enabled = false;
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ import {
|
||||
getDefaultModel,
|
||||
probeCursorRuntime,
|
||||
} from '../cursor';
|
||||
import { getCursorConfig, mutateUnifiedConfig } from '../config/unified-config-loader';
|
||||
|
||||
import { DEFAULT_CURSOR_CONFIG } from '../config/unified-config-types';
|
||||
import {
|
||||
renderCursorHelp,
|
||||
@@ -25,6 +25,7 @@ import {
|
||||
renderCursorStatus,
|
||||
} from './cursor-command-display';
|
||||
import { ok, fail, info } from '../utils/ui';
|
||||
import { getCursorConfig, mutateConfig } from '../config/config-loader-facade';
|
||||
|
||||
const LEGACY_CURSOR_COMMAND = 'ccs legacy cursor';
|
||||
const CLIPROXY_CURSOR_COMMAND = 'ccs cursor';
|
||||
@@ -286,7 +287,7 @@ async function handleStop(): Promise<number> {
|
||||
*/
|
||||
async function handleEnable(): Promise<number> {
|
||||
printLegacyCursorDeprecationNotice();
|
||||
mutateUnifiedConfig((config) => {
|
||||
mutateConfig((config) => {
|
||||
if (!config.cursor) {
|
||||
config.cursor = { ...DEFAULT_CURSOR_CONFIG };
|
||||
}
|
||||
@@ -310,7 +311,7 @@ async function handleEnable(): Promise<number> {
|
||||
*/
|
||||
async function handleDisable(): Promise<number> {
|
||||
printLegacyCursorDeprecationNotice();
|
||||
mutateUnifiedConfig((config) => {
|
||||
mutateConfig((config) => {
|
||||
if (config.cursor) {
|
||||
config.cursor.enabled = false;
|
||||
}
|
||||
|
||||
@@ -6,12 +6,13 @@
|
||||
*/
|
||||
|
||||
import { initUI, header, dim, color, subheader, fail, warn } from '../utils/ui';
|
||||
import { getCcsDir } from '../utils/config-manager';
|
||||
|
||||
import { CLAUDE_EXTENSION_HOSTS, type ClaudeExtensionHost } from '../shared/claude-extension-hosts';
|
||||
import {
|
||||
renderClaudeExtensionSettingsJson,
|
||||
resolveClaudeExtensionSetup,
|
||||
} from '../shared/claude-extension-setup';
|
||||
import { getCcsDir } from '../config/config-loader-facade';
|
||||
|
||||
type ShellType = 'bash' | 'fish' | 'powershell';
|
||||
type OutputFormat = 'openai' | 'anthropic' | 'raw' | 'claude-extension';
|
||||
|
||||
@@ -16,8 +16,9 @@ import {
|
||||
needsMigration,
|
||||
getBackupDirectories,
|
||||
} from '../config/migration-manager';
|
||||
import { hasUnifiedConfig } from '../config/unified-config-loader';
|
||||
|
||||
import { initUI, ok, fail, info, warn, infoBox, dim } from '../utils/ui';
|
||||
import { hasUnifiedConfig } from '../config/config-loader-facade';
|
||||
|
||||
export async function handleMigrateCommand(args: string[]): Promise<void> {
|
||||
await initUI();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { detectShell, formatExportLine } from './env-command';
|
||||
import { getSettingsPath, loadSettings } from '../utils/config-manager';
|
||||
import { getSettingsPath } from '../utils/config-manager';
|
||||
import { expandPath } from '../utils/helpers';
|
||||
import { fail, info, ok } from '../utils/ui';
|
||||
import {
|
||||
@@ -10,6 +10,7 @@ import {
|
||||
startOpenAICompatProxy,
|
||||
stopOpenAICompatProxy,
|
||||
} from '../proxy';
|
||||
import { loadSettings } from '../config/config-loader-facade';
|
||||
|
||||
function parseOptionValue(args: string[], key: string): string | undefined {
|
||||
const exactIndex = args.findIndex((arg) => arg === key);
|
||||
|
||||
@@ -16,15 +16,17 @@ import * as readline from 'readline';
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import { initUI, header, ok, info, warn } from '../utils/ui';
|
||||
|
||||
import { DEFAULT_CLIPROXY_SERVER_CONFIG } from '../config/unified-config-types';
|
||||
|
||||
import { CLIPROXY_DEFAULT_PORT } from '../cliproxy/config/port-manager';
|
||||
import {
|
||||
getCcsDir,
|
||||
hasUnifiedConfig,
|
||||
loadOrCreateUnifiedConfig,
|
||||
loadUnifiedConfig,
|
||||
mutateUnifiedConfig,
|
||||
hasUnifiedConfig,
|
||||
} from '../config/unified-config-loader';
|
||||
import { DEFAULT_CLIPROXY_SERVER_CONFIG } from '../config/unified-config-types';
|
||||
import { getCcsDir } from '../utils/config-manager';
|
||||
import { CLIPROXY_DEFAULT_PORT } from '../cliproxy/config/port-manager';
|
||||
mutateConfig,
|
||||
} from '../config/config-loader-facade';
|
||||
|
||||
/** Custom error for user cancellation (Ctrl+C) */
|
||||
class UserCancelledError extends Error {
|
||||
@@ -377,7 +379,7 @@ async function runSetupWizard(force: boolean = false): Promise<void> {
|
||||
console.log(' After creating, edit the settings file to add your API key.');
|
||||
}
|
||||
|
||||
mutateUnifiedConfig((currentConfig) => {
|
||||
mutateConfig((currentConfig) => {
|
||||
currentConfig.setup_completed = true;
|
||||
currentConfig.cliproxy_server = config.cliproxy_server;
|
||||
});
|
||||
|
||||
@@ -7,9 +7,10 @@
|
||||
import * as path from 'path';
|
||||
import * as fs from 'fs';
|
||||
import { initUI, header, subheader, color, warn } from '../utils/ui';
|
||||
import { getActiveConfigPath, getCcsDir } from '../utils/config-manager';
|
||||
import { getActiveConfigPath } from '../utils/config-manager';
|
||||
import { getVersion } from '../utils/version';
|
||||
import { getProfileLookupCandidates } from '../utils/profile-compat';
|
||||
import { getCcsDir } from '../config/config-loader-facade';
|
||||
|
||||
/**
|
||||
* Handle version command
|
||||
|
||||
@@ -11,10 +11,11 @@ import * as path from 'path';
|
||||
import * as http from 'http';
|
||||
import { CopilotDaemonStatus } from './types';
|
||||
import { CopilotConfig, DEFAULT_COPILOT_CONFIG } from '../config/unified-config-types';
|
||||
import { loadOrCreateUnifiedConfig } from '../config/unified-config-loader';
|
||||
|
||||
import { getCopilotDir, getCopilotApiBinPath } from './copilot-package-manager';
|
||||
import { verifyProcessOwnership } from '../cursor/daemon-process-ownership';
|
||||
import { createLogger } from '../services/logging';
|
||||
import { loadOrCreateUnifiedConfig } from '../config/config-loader-facade';
|
||||
|
||||
const logger = createLogger('copilot:daemon');
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
import { spawn } from 'child_process';
|
||||
import { CopilotConfig } from '../config/unified-config-types';
|
||||
import { getGlobalEnvConfig } from '../config/unified-config-loader';
|
||||
|
||||
import { ensureCliproxyService } from '../cliproxy';
|
||||
import { getEffectiveApiKey } from '../cliproxy/auth/auth-token-manager';
|
||||
import { CLIPROXY_DEFAULT_PORT } from '../cliproxy/config/port-manager';
|
||||
@@ -36,6 +36,7 @@ import {
|
||||
} from '../utils/hooks';
|
||||
import { stripClaudeCodeEnv } from '../utils/shell-executor';
|
||||
import { createLogger } from '../services/logging';
|
||||
import { getGlobalEnvConfig } from '../config/config-loader-facade';
|
||||
|
||||
const logger = createLogger('copilot:executor');
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ import * as path from 'path';
|
||||
import { spawn, spawnSync } from 'child_process';
|
||||
import { ProgressIndicator } from '../utils/progress-indicator';
|
||||
import { ok, info } from '../utils/ui';
|
||||
import { getCcsDir } from '../utils/config-manager';
|
||||
import { getCcsDir } from '../config/config-loader-facade';
|
||||
|
||||
/** Cache duration for version check (1 hour in milliseconds) */
|
||||
const VERSION_CACHE_DURATION_MS = 60 * 60 * 1000;
|
||||
|
||||
@@ -19,7 +19,7 @@ import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import * as os from 'os';
|
||||
import type { CursorCredentials, CursorAuthStatus, AutoDetectResult } from './types';
|
||||
import { getCcsDir } from '../utils/config-manager';
|
||||
import { getCcsDir } from '../config/config-loader-facade';
|
||||
|
||||
const ACCESS_TOKEN_KEYS = ['cursorAuth/accessToken', 'cursorAuth/token'] as const;
|
||||
const MACHINE_ID_KEYS = [
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import { getCcsDir } from '../utils/config-manager';
|
||||
import { getCcsDir } from '../config/config-loader-facade';
|
||||
|
||||
function getCursorDir(): string {
|
||||
return path.join(getCcsDir(), 'cursor');
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { spawn } from 'child_process';
|
||||
|
||||
import type { CursorConfig } from '../config/unified-config-types';
|
||||
import { getGlobalEnvConfig } from '../config/unified-config-loader';
|
||||
|
||||
import { ensureCliproxyService } from '../cliproxy';
|
||||
import { CLIPROXY_DEFAULT_PORT } from '../cliproxy/config/port-manager';
|
||||
import { fail, info, ok } from '../utils/ui';
|
||||
@@ -15,6 +15,7 @@ import { getImageAnalysisHookEnv, resolveImageAnalysisRuntimeStatus } from '../u
|
||||
import { stripClaudeCodeEnv } from '../utils/shell-executor';
|
||||
import { checkAuthStatus } from './cursor-auth';
|
||||
import { isDaemonRunning, startDaemon } from './cursor-daemon';
|
||||
import { getGlobalEnvConfig } from '../config/config-loader-facade';
|
||||
|
||||
interface CursorImageAnalysisResolution {
|
||||
env: Record<string, string>;
|
||||
|
||||
@@ -6,7 +6,7 @@ import { ResultFormatter } from './result-formatter';
|
||||
import { DelegationValidator } from '../utils/delegation-validator';
|
||||
import { SettingsParser } from './settings-parser';
|
||||
import { fail, warn } from '../utils/ui';
|
||||
import { getCcsDir } from '../utils/config-manager';
|
||||
import { getCcsDir } from '../config/config-loader-facade';
|
||||
|
||||
const PROFILE_FLAGS_WITH_VALUE = new Set(['-p', '--prompt', '--effort']);
|
||||
|
||||
|
||||
@@ -15,8 +15,8 @@ import { ui, warn, info } from '../utils/ui';
|
||||
import { type ExecutionOptions, type ExecutionResult, type StreamMessage } from './executor/types';
|
||||
import { StreamBuffer, formatToolVerbose } from './executor/stream-parser';
|
||||
import { buildExecutionResult } from './executor/result-aggregator';
|
||||
import { getCcsDir, getModelDisplayName, loadSettings } from '../utils/config-manager';
|
||||
import { getGlobalEnvConfig } from '../config/unified-config-loader';
|
||||
import { getModelDisplayName } from '../utils/config-manager';
|
||||
|
||||
import { getProfileLookupCandidates } from '../utils/profile-compat';
|
||||
import {
|
||||
getClaudeLaunchEnvOverrides,
|
||||
@@ -58,6 +58,7 @@ import {
|
||||
readWebSearchTraceRecords,
|
||||
syncWebSearchMcpToConfigDir,
|
||||
} from '../utils/websearch-manager';
|
||||
import { getCcsDir, getGlobalEnvConfig, loadSettings } from '../config/config-loader-facade';
|
||||
|
||||
// Re-export types for consumers
|
||||
export type { ExecutionOptions, ExecutionResult, StreamMessage } from './executor/types';
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import { getCcsDir } from '../utils/config-manager';
|
||||
import { getCcsDir } from '../config/config-loader-facade';
|
||||
|
||||
interface SessionData {
|
||||
sessionId: string;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import * as path from 'path';
|
||||
import { getCcsDir } from '../utils/config-manager';
|
||||
|
||||
import type { DockerConfigSummary } from './docker-types';
|
||||
import { getCcsDir } from '../config/config-loader-facade';
|
||||
|
||||
export const DOCKER_REMOTE_DIR = '~/.ccs/docker';
|
||||
export const DOCKER_COMPOSE_SERVICE = 'ccs-cliproxy';
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import { DeltaAccumulator } from './delta-accumulator';
|
||||
import { getCcsDir } from '../utils/config-manager';
|
||||
|
||||
import { createLogger } from '../services/logging';
|
||||
import {
|
||||
RequestTransformer,
|
||||
@@ -32,6 +32,7 @@ import {
|
||||
type ThinkingSignature,
|
||||
type ValidationResult,
|
||||
} from './pipeline';
|
||||
import { getCcsDir } from '../config/config-loader-facade';
|
||||
|
||||
export class GlmtTransformer {
|
||||
private verbose: boolean;
|
||||
|
||||
@@ -6,8 +6,9 @@ import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import { ok, fail, warn, info } from '../../utils/ui';
|
||||
import { HealthCheck, IHealthChecker, createSpinner } from './types';
|
||||
import { getCcsDir } from '../../utils/config-manager';
|
||||
|
||||
import { getClaudeConfigDir } from '../../utils/claude-config-path';
|
||||
import { getCcsDir } from '../../config/config-loader-facade';
|
||||
|
||||
const ora = createSpinner();
|
||||
|
||||
|
||||
@@ -4,8 +4,9 @@
|
||||
|
||||
import { getEnvironmentDiagnostics } from '../environment-diagnostics';
|
||||
import { ok, warn } from '../../utils/ui';
|
||||
import { getCcsDir, getCcsDirSource } from '../../utils/config-manager';
|
||||
import { getCcsDirSource } from '../../utils/config-manager';
|
||||
import { HealthCheck, IHealthChecker, createSpinner } from './types';
|
||||
import { getCcsDir } from '../../config/config-loader-facade';
|
||||
|
||||
const ora = createSpinner();
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
* Checks: enabled status, provider_models, timeout, CLIProxy availability.
|
||||
*/
|
||||
|
||||
import { getImageAnalysisConfig } from '../../config/unified-config-loader';
|
||||
import { DEFAULT_IMAGE_ANALYSIS_CONFIG } from '../../config/unified-config-types';
|
||||
import {
|
||||
countManagedImageAnalysisHookFiles,
|
||||
@@ -17,6 +16,7 @@ import { isCliproxyRunning } from '../../cliproxy/services/stats-fetcher';
|
||||
import { CLIPROXY_DEFAULT_PORT } from '../../cliproxy/config/config-generator';
|
||||
import type { HealthCheck } from './types';
|
||||
import { hasImageAnalyzerHook } from '../../utils/hooks/image-analyzer-hook-installer';
|
||||
import { getImageAnalysisConfig } from '../../config/config-loader-facade';
|
||||
|
||||
/**
|
||||
* Run image analysis configuration check
|
||||
@@ -112,8 +112,8 @@ export async function runImageAnalysisCheck(results: HealthCheck): Promise<void>
|
||||
* Fix image analysis configuration issues
|
||||
*/
|
||||
export async function fixImageAnalysisConfig(): Promise<boolean> {
|
||||
const { updateUnifiedConfig, loadOrCreateUnifiedConfig } = await import(
|
||||
'../../config/unified-config-loader'
|
||||
const { updateConfig, loadOrCreateUnifiedConfig } = await import(
|
||||
'../../config/config-loader-facade'
|
||||
);
|
||||
|
||||
const config = loadOrCreateUnifiedConfig();
|
||||
@@ -145,7 +145,7 @@ export async function fixImageAnalysisConfig(): Promise<boolean> {
|
||||
}
|
||||
|
||||
if (fixed) {
|
||||
updateUnifiedConfig({ image_analysis: config.image_analysis });
|
||||
updateConfig({ image_analysis: config.image_analysis });
|
||||
}
|
||||
|
||||
const repairStats = repairImageAnalysisRuntimeState();
|
||||
|
||||
@@ -6,7 +6,7 @@ import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import { ok, fail, warn, info } from '../../utils/ui';
|
||||
import { HealthCheck, IHealthChecker, createSpinner } from './types';
|
||||
import { getCcsDir } from '../../utils/config-manager';
|
||||
import { getCcsDir } from '../../config/config-loader-facade';
|
||||
|
||||
const ora = createSpinner();
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import * as path from 'path';
|
||||
import * as os from 'os';
|
||||
import { ok, fail, warn } from '../../utils/ui';
|
||||
import { HealthCheck, IHealthChecker, createSpinner } from './types';
|
||||
import { getCcsDir } from '../../utils/config-manager';
|
||||
import { getCcsDir } from '../../config/config-loader-facade';
|
||||
|
||||
const ora = createSpinner();
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import { getClaudeCliInfo } from '../../utils/claude-detector';
|
||||
import { escapeShellArg, stripClaudeCodeEnv } from '../../utils/shell-executor';
|
||||
import { ok, fail } from '../../utils/ui';
|
||||
import { HealthCheck, IHealthChecker, createSpinner } from './types';
|
||||
import { getCcsDir } from '../../utils/config-manager';
|
||||
import { getCcsDir } from '../../config/config-loader-facade';
|
||||
|
||||
const ora = createSpinner();
|
||||
|
||||
|
||||
@@ -12,8 +12,9 @@ import SharedManager from './shared-manager';
|
||||
import ProfileContextSyncLock from './profile-context-sync-lock';
|
||||
import { DEFAULT_ACCOUNT_CONTEXT_MODE } from '../auth/account-context';
|
||||
import type { AccountContextPolicy } from '../auth/account-context';
|
||||
import { getCcsDir, getCcsHome } from '../utils/config-manager';
|
||||
import { getCcsHome } from '../utils/config-manager';
|
||||
import { createLogger } from '../services/logging';
|
||||
import { getCcsDir } from '../config/config-loader-facade';
|
||||
|
||||
const logger = createLogger('management:instance-manager');
|
||||
|
||||
|
||||
@@ -7,13 +7,14 @@
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import { info } from '../utils/ui';
|
||||
import { getCcsHome, getCcsDir } from '../utils/config-manager';
|
||||
import { getCcsHome } from '../utils/config-manager';
|
||||
import { createEmptyUnifiedConfig, UNIFIED_CONFIG_VERSION } from '../config/unified-config-types';
|
||||
import {
|
||||
saveUnifiedConfig,
|
||||
getCcsDir,
|
||||
hasUnifiedConfig,
|
||||
loadUnifiedConfig,
|
||||
} from '../config/unified-config-loader';
|
||||
saveConfig,
|
||||
} from '../config/config-loader-facade';
|
||||
|
||||
/**
|
||||
* Recovery Manager Class
|
||||
@@ -137,7 +138,7 @@ class RecoveryManager {
|
||||
config.version = UNIFIED_CONFIG_VERSION;
|
||||
|
||||
try {
|
||||
saveUnifiedConfig(config);
|
||||
saveConfig(config);
|
||||
this.recovered.push(`Created ${this.ccsDir}/config.yaml`);
|
||||
return true;
|
||||
} catch (_saveErr) {
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import { ok, warn, fail, info, header, color } from '../../utils/ui';
|
||||
import { getCcsDir } from '../../utils/config-manager';
|
||||
|
||||
import {
|
||||
CLIPROXY_DEFAULT_PORT,
|
||||
configNeedsRegeneration,
|
||||
@@ -16,6 +16,7 @@ import { getPortProcess, isCLIProxyProcess } from '../../utils/port-utils';
|
||||
import { killProcessOnPort, getPlatformName } from '../../utils/platform-commands';
|
||||
import { createSpinner } from '../checks/types';
|
||||
import { fixImageAnalysisConfig } from '../checks/image-analysis-check';
|
||||
import { getCcsDir } from '../../config/config-loader-facade';
|
||||
|
||||
const ora = createSpinner();
|
||||
|
||||
|
||||
@@ -13,11 +13,12 @@ import ProfileContextSyncLock from './profile-context-sync-lock';
|
||||
import { ok, info, warn } from '../utils/ui';
|
||||
import { DEFAULT_ACCOUNT_CONTEXT_GROUP } from '../auth/account-context';
|
||||
import type { AccountContextPolicy } from '../auth/account-context';
|
||||
import { getCcsDir } from '../utils/config-manager';
|
||||
|
||||
import {
|
||||
normalizePluginMetadataContent,
|
||||
normalizePluginMetadataValue,
|
||||
} from './plugin-path-normalizer';
|
||||
import { getCcsDir } from '../config/config-loader-facade';
|
||||
export {
|
||||
normalizePluginMetadataContent,
|
||||
normalizePluginMetadataPathString,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { loadSettings } from '../utils/config-manager';
|
||||
import { resolveOpenAICompatProfileConfig } from './profile-router';
|
||||
import { OPENAI_COMPAT_PROXY_DEFAULT_PORT } from './proxy-daemon-paths';
|
||||
import { startOpenAICompatProxyServer } from './server/proxy-server';
|
||||
import { loadSettings } from '../config/config-loader-facade';
|
||||
|
||||
interface RuntimeOptions {
|
||||
port: number;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import * as path from 'path';
|
||||
import { getCcsDir } from '../utils/config-manager';
|
||||
import { getCcsDir } from '../config/config-loader-facade';
|
||||
|
||||
export const OPENAI_COMPAT_PROXY_LEGACY_DEFAULT_PORT = 3456;
|
||||
export const OPENAI_COMPAT_PROXY_ADAPTIVE_PORT_START = 43_456;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { loadOrCreateUnifiedConfig } from '../config/unified-config-loader';
|
||||
import {
|
||||
OPENAI_COMPAT_PROXY_ADAPTIVE_PORT_END,
|
||||
OPENAI_COMPAT_PROXY_ADAPTIVE_PORT_START,
|
||||
OPENAI_COMPAT_PROXY_LEGACY_DEFAULT_PORT,
|
||||
} from './proxy-daemon-paths';
|
||||
import { loadOrCreateUnifiedConfig } from '../config/config-loader-facade';
|
||||
|
||||
export interface OpenAICompatProxyPortPreference {
|
||||
port: number;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { loadConfigSafe, loadSettings } from '../utils/config-manager';
|
||||
import { expandPath } from '../utils/helpers';
|
||||
import type { ProxyOpenAIRequest } from './transformers/request-transformer';
|
||||
import {
|
||||
@@ -6,6 +5,7 @@ import {
|
||||
type OpenAICompatProxyRoutingConfig,
|
||||
} from './routing-config';
|
||||
import { resolveOpenAICompatProfileConfig, type OpenAICompatProfileConfig } from './profile-router';
|
||||
import { loadConfigSafe, loadSettings } from '../config/config-loader-facade';
|
||||
|
||||
export type ProxyRoutingScenario = 'default' | 'background' | 'think' | 'longContext' | 'webSearch';
|
||||
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
import * as fs from 'fs';
|
||||
import { DEFAULT_LOGGING_CONFIG } from '../../config/unified-config-types';
|
||||
|
||||
import type { LoggingConfig } from './log-types';
|
||||
import {
|
||||
getConfigYamlPath,
|
||||
getLoggingConfig as getUnifiedLoggingConfig,
|
||||
} from '../../config/unified-config-loader';
|
||||
import type { LoggingConfig } from './log-types';
|
||||
} from '../../config/config-loader-facade';
|
||||
|
||||
const CACHE_RECHECK_MS = 1000;
|
||||
let cachedConfig: LoggingConfig = { ...DEFAULT_LOGGING_CONFIG };
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import { getCcsDir } from '../../utils/config-manager';
|
||||
import { getCcsDir } from '../../config/config-loader-facade';
|
||||
|
||||
const LOGS_DIR = 'logs';
|
||||
const ARCHIVE_DIR = 'archive';
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { getBrowserConfig, mutateUnifiedConfig } from '../../config/unified-config-loader';
|
||||
import type { BrowserConfig } from '../../config/unified-config-types';
|
||||
import { getNodePlatformKey } from './platform';
|
||||
import { type BrowserStatusPayload, getBrowserStatus } from './browser-status';
|
||||
@@ -9,6 +8,7 @@ import {
|
||||
getRecommendedBrowserUserDataDir,
|
||||
isManagedClaudeBrowserAttachConfig,
|
||||
} from './browser-settings';
|
||||
import { getBrowserConfig, mutateConfig } from '../../config/config-loader-facade';
|
||||
|
||||
export interface BrowserSetupResult {
|
||||
configUpdated: boolean;
|
||||
@@ -23,14 +23,14 @@ export interface BrowserSetupResult {
|
||||
|
||||
export interface BrowserSetupDeps {
|
||||
getBrowserConfig: typeof getBrowserConfig;
|
||||
mutateUnifiedConfig: typeof mutateUnifiedConfig;
|
||||
mutateConfig: typeof mutateConfig;
|
||||
ensureBrowserMcp: typeof ensureBrowserMcp;
|
||||
getBrowserStatus: typeof getBrowserStatus;
|
||||
}
|
||||
|
||||
const defaultBrowserSetupDeps: BrowserSetupDeps = {
|
||||
getBrowserConfig,
|
||||
mutateUnifiedConfig,
|
||||
mutateConfig,
|
||||
ensureBrowserMcp,
|
||||
getBrowserStatus,
|
||||
};
|
||||
@@ -81,7 +81,7 @@ export async function runBrowserSetup(
|
||||
function persistBrowserSetupConfig(deps: BrowserSetupDeps, currentConfig: BrowserConfig): boolean {
|
||||
const before = JSON.stringify(currentConfig);
|
||||
|
||||
deps.mutateUnifiedConfig((config) => {
|
||||
deps.mutateConfig((config) => {
|
||||
const existingBrowser = config.browser ?? currentConfig;
|
||||
const currentUserDataDir = existingBrowser.claude.user_data_dir?.trim();
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import type {
|
||||
BrowserEvalMode,
|
||||
BrowserToolPolicy,
|
||||
} from '../../config/unified-config-types';
|
||||
import { getBrowserConfig, loadUnifiedConfig } from '../../config/unified-config-loader';
|
||||
|
||||
import { getCcsPathDisplay } from '../config-manager';
|
||||
import { getCodexBinaryInfo } from '../../targets/codex-detector';
|
||||
import { type BrowserRuntimeEnv, resolveBrowserRuntimeEnv } from './chrome-reuse';
|
||||
@@ -19,6 +19,7 @@ import {
|
||||
getEffectiveClaudeBrowserAttachConfig,
|
||||
getRecommendedBrowserUserDataDir,
|
||||
} from './browser-settings';
|
||||
import { getBrowserConfig, loadUnifiedConfig } from '../../config/config-loader-facade';
|
||||
|
||||
export interface ClaudeBrowserStatus {
|
||||
enabled: boolean;
|
||||
|
||||
@@ -6,7 +6,7 @@ import { isConfig, isSettings } from '../types';
|
||||
import type { Config, Settings, CLIProxyVariantsConfig, CLIProxyVariantConfig } from '../types';
|
||||
import { expandPath, error } from './helpers';
|
||||
import { info } from './ui';
|
||||
import { isUnifiedMode, loadOrCreateUnifiedConfig } from '../config/unified-config-loader';
|
||||
import { isUnifiedMode, loadOrCreateUnifiedConfig } from '../config/config-loader-facade';
|
||||
|
||||
// TODO: Replace with proper imports after converting these files
|
||||
// const { ErrorManager } = require('./error-manager');
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
* @module utils/hooks/image-analysis-hook-env
|
||||
*/
|
||||
|
||||
import { getImageAnalysisConfig } from '../../config/unified-config-loader';
|
||||
import { resolveCliproxyBridgeProfile } from '../../api/services/cliproxy-profile-bridge';
|
||||
import { getEffectiveApiKey } from '../../cliproxy/auth/auth-token-manager';
|
||||
import { mapExternalProviderName } from '../../cliproxy/provider-capabilities';
|
||||
@@ -21,6 +20,7 @@ import {
|
||||
resolveImageAnalysisStatus,
|
||||
type ImageAnalysisResolutionContext,
|
||||
} from './image-analysis-backend-resolver';
|
||||
import { getImageAnalysisConfig } from '../../config/config-loader-facade';
|
||||
|
||||
/**
|
||||
* Serialize provider_models map to env var format: provider:model,provider:model
|
||||
|
||||
@@ -7,8 +7,9 @@
|
||||
*/
|
||||
|
||||
import * as path from 'path';
|
||||
import { getImageAnalysisConfig } from '../../config/unified-config-loader';
|
||||
|
||||
import { getCcsHooksDir } from '../config-manager';
|
||||
import { getImageAnalysisConfig } from '../../config/config-loader-facade';
|
||||
|
||||
// Hook file name
|
||||
const IMAGE_ANALYZER_HOOK = 'image-analyzer-transformer.cjs';
|
||||
|
||||
@@ -12,9 +12,10 @@ import * as path from 'path';
|
||||
import { info, warn } from '../ui';
|
||||
import { getImageAnalyzerHookPath } from './image-analyzer-hook-configuration';
|
||||
import { getCcsHooksDir } from '../config-manager';
|
||||
import { getImageAnalysisConfig } from '../../config/unified-config-loader';
|
||||
|
||||
import { removeMigrationMarker } from './image-analyzer-profile-hook-injector';
|
||||
import { installImageAnalysisPrompts } from '../image-analysis/hook-installer';
|
||||
import { getImageAnalysisConfig } from '../../config/config-loader-facade';
|
||||
|
||||
// Re-export from hook-configuration for backward compatibility
|
||||
export {
|
||||
|
||||
@@ -21,12 +21,13 @@ import {
|
||||
isCcsImageAnalyzerHook,
|
||||
removeCcsImageAnalyzerHooks,
|
||||
} from './image-analyzer-hook-utils';
|
||||
import { getImageAnalysisConfig } from '../../config/unified-config-loader';
|
||||
|
||||
import { getCcsDir } from '../config-manager';
|
||||
import {
|
||||
resolveImageAnalysisStatus,
|
||||
type ImageAnalysisResolutionContext,
|
||||
} from './image-analysis-backend-resolver';
|
||||
import { getImageAnalysisConfig } from '../../config/config-loader-facade';
|
||||
|
||||
// Valid profile name pattern (alphanumeric, dot, dash, underscore only)
|
||||
const VALID_PROFILE_NAME = /^[a-zA-Z0-9][a-zA-Z0-9._-]*$/;
|
||||
|
||||
@@ -5,12 +5,13 @@
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import * as lockfile from 'proper-lockfile';
|
||||
import { getImageAnalysisConfig } from '../../config/unified-config-loader';
|
||||
|
||||
import { getCcsDir } from '../config-manager';
|
||||
import { getClaudeUserConfigPath } from '../claude-config-path';
|
||||
import { info, warn } from '../ui';
|
||||
import { InstanceManager } from '../../management/instance-manager';
|
||||
import { installImageAnalysisPrompts } from './hook-installer';
|
||||
import { getImageAnalysisConfig } from '../../config/config-loader-facade';
|
||||
|
||||
const IMAGE_ANALYSIS_MCP_SERVER = 'ccs-image-analysis-server.cjs';
|
||||
const IMAGE_ANALYSIS_MCP_RUNTIME = 'image-analysis-runtime.cjs';
|
||||
|
||||
@@ -8,8 +8,9 @@ import { spawn, spawnSync, ChildProcess, type SpawnOptions } from 'child_process
|
||||
import { ErrorManager } from './error-manager';
|
||||
import { getWebSearchHookEnv } from './websearch-manager';
|
||||
import { wireChildProcessSignals } from './signal-forwarder';
|
||||
import { loadOrCreateUnifiedConfig } from '../config/unified-config-loader';
|
||||
|
||||
import SharedManager from '../management/shared-manager';
|
||||
import { loadOrCreateUnifiedConfig } from '../config/config-loader-facade';
|
||||
|
||||
/**
|
||||
* Strip ANTHROPIC_* env vars from an environment object.
|
||||
|
||||
@@ -9,10 +9,11 @@
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import { info, warn } from '../ui';
|
||||
import { getWebSearchConfig } from '../../config/unified-config-loader';
|
||||
|
||||
import { getCcsHooksDir } from '../config-manager';
|
||||
import { getClaudeSettingsPath } from '../claude-config-path';
|
||||
import { isCcsWebSearchHook, deduplicateCcsHooks } from './hook-utils';
|
||||
import { getWebSearchConfig } from '../../config/config-loader-facade';
|
||||
|
||||
// Hook file name
|
||||
const WEBSEARCH_HOOK = 'websearch-transformer.cjs';
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
* @module utils/websearch/hook-env
|
||||
*/
|
||||
|
||||
import { getWebSearchConfig } from '../../config/unified-config-loader';
|
||||
import { normalizeSearxngBaseUrl } from './types';
|
||||
import { resolveAllowedWebSearchTraceFile } from './trace';
|
||||
import { getWebSearchConfig } from '../../config/config-loader-facade';
|
||||
|
||||
/**
|
||||
* Get environment variables for WebSearch hook configuration.
|
||||
|
||||
@@ -9,9 +9,10 @@
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import { info, warn } from '../ui';
|
||||
import { getWebSearchConfig } from '../../config/unified-config-loader';
|
||||
|
||||
import { getCcsDir, getCcsHooksDir } from '../config-manager';
|
||||
import { getHookPath } from './hook-config';
|
||||
import { getWebSearchConfig } from '../../config/config-loader-facade';
|
||||
|
||||
// Re-export from hook-config for backward compatibility
|
||||
export { getHookPath, getWebSearchHookConfig } from './hook-config';
|
||||
|
||||
@@ -4,13 +4,14 @@
|
||||
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import { getWebSearchConfig } from '../../config/unified-config-loader';
|
||||
|
||||
import { getCcsDir } from '../config-manager';
|
||||
import { getClaudeUserConfigPath } from '../claude-config-path';
|
||||
import { info, warn } from '../ui';
|
||||
import { InstanceManager } from '../../management/instance-manager';
|
||||
import { installWebSearchHook } from './hook-installer';
|
||||
import { appendWebSearchTrace } from './trace';
|
||||
import { getWebSearchConfig } from '../../config/config-loader-facade';
|
||||
|
||||
const WEBSEARCH_MCP_SERVER = 'ccs-websearch-server.cjs';
|
||||
const WEBSEARCH_MCP_SERVER_NAME = 'ccs-websearch';
|
||||
|
||||
@@ -12,11 +12,12 @@ import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import { info, warn } from '../ui';
|
||||
import { getWebSearchHookConfig, getHookPath } from './hook-config';
|
||||
import { getWebSearchConfig } from '../../config/unified-config-loader';
|
||||
|
||||
import { removeHookConfig } from './hook-config';
|
||||
import { getCcsDir } from '../config-manager';
|
||||
import { isCcsWebSearchHook, deduplicateCcsHooks } from './hook-utils';
|
||||
import { getMigrationMarkerPath, installWebSearchHook } from './hook-installer';
|
||||
import { getWebSearchConfig } from '../../config/config-loader-facade';
|
||||
|
||||
// Valid profile name pattern (alphanumeric, dash, underscore only)
|
||||
const VALID_PROFILE_NAME = /^[a-zA-Z0-9_-]+$/;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { getGlobalEnvConfig } from '../../config/unified-config-loader';
|
||||
import { maskSensitiveValue } from '../sensitive-keys';
|
||||
import { getGlobalEnvConfig } from '../../config/config-loader-facade';
|
||||
|
||||
export type WebSearchApiKeyProviderId = 'exa' | 'tavily' | 'brave';
|
||||
export type WebSearchApiKeySource = 'global_env' | 'process_env' | 'both' | 'none';
|
||||
|
||||
@@ -9,13 +9,14 @@
|
||||
import { existsSync, readFileSync } from 'fs';
|
||||
import { join } from 'path';
|
||||
import { ok, warn, fail, info } from '../ui';
|
||||
import { getWebSearchConfig } from '../../config/unified-config-loader';
|
||||
|
||||
import { getCcsDir } from '../config-manager';
|
||||
import { getGeminiCliStatus, isGeminiAuthenticated } from './gemini-cli';
|
||||
import { getGrokCliStatus } from './grok-cli';
|
||||
import { getOpenCodeCliStatus } from './opencode-cli';
|
||||
import { getWebSearchApiKeyStates } from './provider-secrets';
|
||||
import { normalizeSearxngBaseUrl, type WebSearchCliInfo, type WebSearchStatus } from './types';
|
||||
import { getWebSearchConfig } from '../../config/config-loader-facade';
|
||||
|
||||
const PROVIDER_STATE_FILE = 'websearch-provider-state.json';
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
import chokidar, { FSWatcher } from 'chokidar';
|
||||
import * as path from 'path';
|
||||
import { getCcsDir } from '../utils/config-manager';
|
||||
import { getCcsDir } from '../config/config-loader-facade';
|
||||
|
||||
export interface FileChangeEvent {
|
||||
type: 'config-changed' | 'settings-changed' | 'profiles-changed' | 'proxy-status-changed';
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import * as os from 'os';
|
||||
import { getCcsDir, getConfigPath } from '../utils/config-manager';
|
||||
import { getConfigPath } from '../utils/config-manager';
|
||||
import packageJson from '../../package.json';
|
||||
|
||||
// Import all check functions from modular components
|
||||
@@ -35,6 +35,7 @@ import {
|
||||
checkOAuthPortsForDashboard,
|
||||
checkWebSearchClis,
|
||||
} from './health';
|
||||
import { getCcsDir } from '../config/config-loader-facade';
|
||||
|
||||
// Re-export types for external consumers
|
||||
export type { HealthCheck, HealthGroup, HealthReport };
|
||||
@@ -143,10 +144,10 @@ export function fixHealthIssue(checkId: string): { success: boolean; message: st
|
||||
|
||||
case 'config-file': {
|
||||
// Use appropriate config based on unified mode
|
||||
const { isUnifiedMode } = require('../config/unified-config-loader');
|
||||
const { isUnifiedMode } = require('../config/config-loader-facade');
|
||||
if (isUnifiedMode()) {
|
||||
const { mutateUnifiedConfig } = require('../config/unified-config-loader');
|
||||
mutateUnifiedConfig(() => {});
|
||||
const { mutateConfig } = require('../config/config-loader-facade');
|
||||
mutateConfig(() => {});
|
||||
return { success: true, message: 'Created/updated config.yaml' };
|
||||
}
|
||||
const configPath = getConfigPath();
|
||||
@@ -157,7 +158,7 @@ export function fixHealthIssue(checkId: string): { success: boolean; message: st
|
||||
|
||||
case 'profiles-file': {
|
||||
// Use appropriate storage based on unified mode
|
||||
const { isUnifiedMode: isUnified } = require('../config/unified-config-loader');
|
||||
const { isUnifiedMode: isUnified } = require('../config/config-loader-facade');
|
||||
if (isUnified()) {
|
||||
// In unified mode, accounts are stored in config.yaml
|
||||
return { success: true, message: 'Accounts stored in config.yaml (unified mode)' };
|
||||
|
||||
@@ -7,9 +7,10 @@
|
||||
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import { getConfigPath, getCcsDir } from '../../utils/config-manager';
|
||||
import { isUnifiedMode, hasUnifiedConfig } from '../../config/unified-config-loader';
|
||||
import { getConfigPath } from '../../utils/config-manager';
|
||||
|
||||
import type { HealthCheck } from './types';
|
||||
import { getCcsDir, hasUnifiedConfig, isUnifiedMode } from '../../config/config-loader-facade';
|
||||
|
||||
/**
|
||||
* Check config file (config.json or config.yaml based on mode)
|
||||
|
||||
@@ -7,8 +7,9 @@
|
||||
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import { isUnifiedMode, loadUnifiedConfig } from '../../config/unified-config-loader';
|
||||
|
||||
import type { HealthCheck } from './types';
|
||||
import { isUnifiedMode, loadUnifiedConfig } from '../../config/config-loader-facade';
|
||||
|
||||
/**
|
||||
* Check profiles configuration (API profiles from config.json or config.yaml)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user