From fc23afdfc78a955fc0a1ce7f55d2e2bd098fc6c4 Mon Sep 17 00:00:00 2001 From: kaitranntt Date: Mon, 26 Jan 2026 02:03:47 -0500 Subject: [PATCH] feat(cliproxy): add auto_sync config option - export sync module from cliproxy barrel - add auto_sync field to CLIProxyConfig interface --- src/cliproxy/index.ts | 31 ++++++++++++++++++++++++++++++ src/config/unified-config-types.ts | 4 ++++ 2 files changed, 35 insertions(+) diff --git a/src/cliproxy/index.ts b/src/cliproxy/index.ts index df83c881..8fbcffbe 100644 --- a/src/cliproxy/index.ts +++ b/src/cliproxy/index.ts @@ -166,3 +166,34 @@ export { THINKING_BUDGET_MAX, THINKING_BUDGET_DEFAULT_MIN, } from './thinking-validator'; + +// Management API client (for remote CLIProxy sync) +export type { + ClaudeKey, + ClaudeModel, + ManagementClientConfig, + ManagementHealthStatus, + ManagementApiErrorCode, + ClaudeKeyPatch, + SyncStatus, +} from './management-api-types'; +export { ManagementApiClient, createManagementClient } from './management-api-client'; + +// Sync module (profile sync to remote CLIProxy) +export type { SyncableProfile, SyncPreviewItem, ModelAlias, ModelAliasConfig } from './sync'; +export { + loadSyncableProfiles, + mapProfileToClaudeKey, + generateSyncPayload, + generateSyncPreview, + getSyncableProfileCount, + isProfileSyncable, + getModelAliasesPath, + loadModelAliases, + saveModelAliases, + getProfileAliases, + addProfileAlias, + removeProfileAlias, + listAllAliases, + DEFAULT_MODEL_ALIASES, +} from './sync'; diff --git a/src/config/unified-config-types.ts b/src/config/unified-config-types.ts index 0df03c27..a7c0eedf 100644 --- a/src/config/unified-config-types.ts +++ b/src/config/unified-config-types.ts @@ -132,6 +132,8 @@ export interface CLIProxyConfig { auth?: CLIProxyAuthConfig; /** Background token refresh worker settings */ token_refresh?: TokenRefreshSettings; + /** Auto-sync API profiles to local CLIProxy config on settings change (default: false) */ + auto_sync?: boolean; } /** @@ -259,6 +261,8 @@ export interface ProxyRemoteConfig { management_key?: string; /** Connection timeout in milliseconds (default: 2000) */ timeout?: number; + /** Enable auto-sync profiles to remote on settings change (default: false) */ + auto_sync?: boolean; } /**