@kaitranntt/ccs 7.75.0-dev.7 → 7.75.0-dev.9
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/dist/config/config-loader-facade.d.ts +57 -0
- package/dist/config/config-loader-facade.d.ts.map +1 -0
- package/dist/config/config-loader-facade.js +131 -0
- package/dist/config/config-loader-facade.js.map +1 -0
- package/dist/config/schemas/auth.d.ts +97 -0
- package/dist/config/schemas/auth.d.ts.map +1 -0
- package/dist/config/schemas/auth.js +25 -0
- package/dist/config/schemas/auth.js.map +1 -0
- package/dist/config/schemas/browser.d.ts +53 -0
- package/dist/config/schemas/browser.d.ts.map +1 -0
- package/dist/config/schemas/browser.js +27 -0
- package/dist/config/schemas/browser.js.map +1 -0
- package/dist/config/schemas/channels.d.ts +27 -0
- package/dist/config/schemas/channels.d.ts.map +1 -0
- package/dist/config/schemas/channels.js +19 -0
- package/dist/config/schemas/channels.js.map +1 -0
- package/dist/config/schemas/cliproxy.d.ts +140 -0
- package/dist/config/schemas/cliproxy.d.ts.map +1 -0
- package/dist/config/schemas/cliproxy.js +18 -0
- package/dist/config/schemas/cliproxy.js.map +1 -0
- package/dist/config/schemas/copilot-cursor.d.ts +75 -0
- package/dist/config/schemas/copilot-cursor.d.ts.map +1 -0
- package/dist/config/schemas/copilot-cursor.js +36 -0
- package/dist/config/schemas/copilot-cursor.js.map +1 -0
- package/dist/config/schemas/index.d.ts +28 -0
- package/dist/config/schemas/index.d.ts.map +1 -0
- package/dist/config/schemas/index.js +51 -0
- package/dist/config/schemas/index.js.map +1 -0
- package/dist/config/schemas/logging.d.ts +43 -0
- package/dist/config/schemas/logging.d.ts.map +1 -0
- package/dist/config/schemas/logging.js +23 -0
- package/dist/config/schemas/logging.js.map +1 -0
- package/dist/config/schemas/providers.d.ts +14 -0
- package/dist/config/schemas/providers.d.ts.map +1 -0
- package/dist/config/schemas/providers.js +21 -0
- package/dist/config/schemas/providers.js.map +1 -0
- package/dist/config/schemas/proxy-server.d.ts +141 -0
- package/dist/config/schemas/proxy-server.d.ts.map +1 -0
- package/dist/config/schemas/proxy-server.js +71 -0
- package/dist/config/schemas/proxy-server.js.map +1 -0
- package/dist/config/schemas/quota.d.ts +88 -0
- package/dist/config/schemas/quota.d.ts.map +1 -0
- package/dist/config/schemas/quota.js +47 -0
- package/dist/config/schemas/quota.js.map +1 -0
- package/dist/config/schemas/thinking.d.ts +50 -0
- package/dist/config/schemas/thinking.d.ts.map +1 -0
- package/dist/config/schemas/thinking.js +26 -0
- package/dist/config/schemas/thinking.js.map +1 -0
- package/dist/config/schemas/unified-config.d.ts +74 -0
- package/dist/config/schemas/unified-config.d.ts.map +1 -0
- package/dist/config/schemas/unified-config.js +131 -0
- package/dist/config/schemas/unified-config.js.map +1 -0
- package/dist/config/schemas/version.d.ts +23 -0
- package/dist/config/schemas/version.d.ts.map +1 -0
- package/dist/config/schemas/version.js +26 -0
- package/dist/config/schemas/version.js.map +1 -0
- package/dist/config/schemas/websearch.d.ts +138 -0
- package/dist/config/schemas/websearch.d.ts.map +1 -0
- package/dist/config/schemas/websearch.js +12 -0
- package/dist/config/schemas/websearch.js.map +1 -0
- package/dist/config/unified-config-types.d.ts +3 -818
- package/dist/config/unified-config-types.d.ts.map +1 -1
- package/dist/config/unified-config-types.js +19 -319
- package/dist/config/unified-config-types.js.map +1 -1
- package/dist/errors/error-types.d.ts +9 -0
- package/dist/errors/error-types.d.ts.map +1 -1
- package/dist/errors/error-types.js +15 -1
- package/dist/errors/error-types.js.map +1 -1
- package/dist/errors/index.d.ts +1 -1
- package/dist/errors/index.d.ts.map +1 -1
- package/dist/errors/index.js +3 -1
- package/dist/errors/index.js.map +1 -1
- package/dist/utils/retry-strategy.d.ts +37 -0
- package/dist/utils/retry-strategy.d.ts.map +1 -0
- package/dist/utils/retry-strategy.js +99 -0
- package/dist/utils/retry-strategy.js.map +1 -0
- package/package.json +1 -1
- package/scripts/run-test-bucket.js +1 -1
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Config Loader Facade
|
|
3
|
+
*
|
|
4
|
+
* Single import path for all config loading operations.
|
|
5
|
+
* Re-exports read-only functions from unified-config-loader and config-manager,
|
|
6
|
+
* and provides cache-coherent write wrappers that keep the memoization cache in sync.
|
|
7
|
+
*
|
|
8
|
+
* IMPORTANT:
|
|
9
|
+
* - Raw write functions (saveUnifiedConfig, mutateUnifiedConfig,
|
|
10
|
+
* updateUnifiedConfig) are NOT re-exported here. Use the cache-coherent
|
|
11
|
+
* wrappers (saveConfig, mutateConfig, updateConfig) instead.
|
|
12
|
+
* - `loadOrCreateUnifiedConfig` and `loadUnifiedConfig` are re-exported as
|
|
13
|
+
* uncached reads. If you need cached reads, use `getCachedConfig()`.
|
|
14
|
+
* If you use an uncached read followed by a write outside this facade,
|
|
15
|
+
* call `invalidateConfigCache()` to keep the cache coherent.
|
|
16
|
+
*
|
|
17
|
+
* Usage:
|
|
18
|
+
* import { getCachedConfig, saveConfig, mutateConfig } from '../config/config-loader-facade';
|
|
19
|
+
* import { getCcsDir, loadSettings } from '../config/config-loader-facade';
|
|
20
|
+
*/
|
|
21
|
+
export { loadUnifiedConfig, loadOrCreateUnifiedConfig, getConfigYamlPath, getConfigJsonPath, hasUnifiedConfig, hasLegacyConfig, getConfigFormat, isUnifiedMode, getDefaultProfile, setDefaultProfile, getWebSearchConfig, getGlobalEnvConfig, getContinuityInheritanceMap, getCliproxySafetyConfig, getThinkingConfig, getOfficialChannelsConfig, isDashboardAuthEnabled, getDashboardAuthConfig, getBrowserConfig, getImageAnalysisConfig, getLoggingConfig, getCursorConfig, } from './unified-config-loader';
|
|
22
|
+
export type { GeminiWebSearchInfo } from './unified-config-loader';
|
|
23
|
+
export { loadSettings, loadConfigSafe, readConfig, getCcsDir } from '../utils/config-manager';
|
|
24
|
+
import type { UnifiedConfig } from './unified-config-types';
|
|
25
|
+
/**
|
|
26
|
+
* Get the unified config with in-memory caching.
|
|
27
|
+
* Checks file mtime on each call — if the config file was modified
|
|
28
|
+
* externally (e.g. by code importing unified-config-loader directly),
|
|
29
|
+
* the cache is automatically invalidated and re-read from disk.
|
|
30
|
+
*/
|
|
31
|
+
export declare function getCachedConfig(): UnifiedConfig;
|
|
32
|
+
/**
|
|
33
|
+
* Clear the memoization cache.
|
|
34
|
+
* The next call to getCachedConfig() will re-read from disk.
|
|
35
|
+
*/
|
|
36
|
+
export declare function invalidateConfigCache(): void;
|
|
37
|
+
/**
|
|
38
|
+
* Save config to disk and update the cache.
|
|
39
|
+
* Stores a deep copy to break the reference alias.
|
|
40
|
+
*/
|
|
41
|
+
export declare function saveConfig(config: UnifiedConfig): void;
|
|
42
|
+
/**
|
|
43
|
+
* Atomically mutate config (read-modify-write with lock) and invalidate cache.
|
|
44
|
+
* Invalidated AFTER _mutateUnifiedConfig returns — if that throws, cache stays valid.
|
|
45
|
+
*/
|
|
46
|
+
export declare function mutateConfig(mutator: (config: UnifiedConfig) => void): UnifiedConfig;
|
|
47
|
+
/**
|
|
48
|
+
* Partial-update config and invalidate cache.
|
|
49
|
+
* Shorthand for mutateConfig with Object.assign.
|
|
50
|
+
*/
|
|
51
|
+
export declare function updateConfig(updates: Partial<UnifiedConfig>): UnifiedConfig;
|
|
52
|
+
/**
|
|
53
|
+
* Get the current cache state (for diagnostics/testing).
|
|
54
|
+
* Returns true if a cached config exists, false otherwise.
|
|
55
|
+
*/
|
|
56
|
+
export declare function hasCachedConfig(): boolean;
|
|
57
|
+
//# sourceMappingURL=config-loader-facade.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-loader-facade.d.ts","sourceRoot":"","sources":["../../src/config/config-loader-facade.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAGH,OAAO,EACL,iBAAiB,EACjB,yBAAyB,EACzB,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EACf,eAAe,EACf,aAAa,EACb,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,2BAA2B,EAC3B,uBAAuB,EACvB,iBAAiB,EACjB,yBAAyB,EACzB,sBAAsB,EACtB,sBAAsB,EACtB,gBAAgB,EAChB,sBAAsB,EACtB,gBAAgB,EAChB,eAAe,GAChB,MAAM,yBAAyB,CAAC;AAGjC,YAAY,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAGnE,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAI9F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAwB5D;;;;;GAKG;AACH,wBAAgB,eAAe,IAAI,aAAa,CAO/C;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,IAAI,IAAI,CAG5C;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI,CAGtD;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,CAAC,MAAM,EAAE,aAAa,KAAK,IAAI,GAAG,aAAa,CAIpF;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO,CAAC,aAAa,CAAC,GAAG,aAAa,CAI3E;AAED;;;GAGG;AACH,wBAAgB,eAAe,IAAI,OAAO,CAEzC"}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Config Loader Facade
|
|
4
|
+
*
|
|
5
|
+
* Single import path for all config loading operations.
|
|
6
|
+
* Re-exports read-only functions from unified-config-loader and config-manager,
|
|
7
|
+
* and provides cache-coherent write wrappers that keep the memoization cache in sync.
|
|
8
|
+
*
|
|
9
|
+
* IMPORTANT:
|
|
10
|
+
* - Raw write functions (saveUnifiedConfig, mutateUnifiedConfig,
|
|
11
|
+
* updateUnifiedConfig) are NOT re-exported here. Use the cache-coherent
|
|
12
|
+
* wrappers (saveConfig, mutateConfig, updateConfig) instead.
|
|
13
|
+
* - `loadOrCreateUnifiedConfig` and `loadUnifiedConfig` are re-exported as
|
|
14
|
+
* uncached reads. If you need cached reads, use `getCachedConfig()`.
|
|
15
|
+
* If you use an uncached read followed by a write outside this facade,
|
|
16
|
+
* call `invalidateConfigCache()` to keep the cache coherent.
|
|
17
|
+
*
|
|
18
|
+
* Usage:
|
|
19
|
+
* import { getCachedConfig, saveConfig, mutateConfig } from '../config/config-loader-facade';
|
|
20
|
+
* import { getCcsDir, loadSettings } from '../config/config-loader-facade';
|
|
21
|
+
*/
|
|
22
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
+
exports.hasCachedConfig = exports.updateConfig = exports.mutateConfig = exports.saveConfig = exports.invalidateConfigCache = exports.getCachedConfig = exports.getCcsDir = exports.readConfig = exports.loadConfigSafe = exports.loadSettings = exports.getCursorConfig = exports.getLoggingConfig = exports.getImageAnalysisConfig = exports.getBrowserConfig = exports.getDashboardAuthConfig = exports.isDashboardAuthEnabled = exports.getOfficialChannelsConfig = exports.getThinkingConfig = exports.getCliproxySafetyConfig = exports.getContinuityInheritanceMap = exports.getGlobalEnvConfig = exports.getWebSearchConfig = exports.setDefaultProfile = exports.getDefaultProfile = exports.isUnifiedMode = exports.getConfigFormat = exports.hasLegacyConfig = exports.hasUnifiedConfig = exports.getConfigJsonPath = exports.getConfigYamlPath = exports.loadOrCreateUnifiedConfig = exports.loadUnifiedConfig = void 0;
|
|
24
|
+
// Re-export read-only functions from unified-config-loader
|
|
25
|
+
var unified_config_loader_1 = require("./unified-config-loader");
|
|
26
|
+
Object.defineProperty(exports, "loadUnifiedConfig", { enumerable: true, get: function () { return unified_config_loader_1.loadUnifiedConfig; } });
|
|
27
|
+
Object.defineProperty(exports, "loadOrCreateUnifiedConfig", { enumerable: true, get: function () { return unified_config_loader_1.loadOrCreateUnifiedConfig; } });
|
|
28
|
+
Object.defineProperty(exports, "getConfigYamlPath", { enumerable: true, get: function () { return unified_config_loader_1.getConfigYamlPath; } });
|
|
29
|
+
Object.defineProperty(exports, "getConfigJsonPath", { enumerable: true, get: function () { return unified_config_loader_1.getConfigJsonPath; } });
|
|
30
|
+
Object.defineProperty(exports, "hasUnifiedConfig", { enumerable: true, get: function () { return unified_config_loader_1.hasUnifiedConfig; } });
|
|
31
|
+
Object.defineProperty(exports, "hasLegacyConfig", { enumerable: true, get: function () { return unified_config_loader_1.hasLegacyConfig; } });
|
|
32
|
+
Object.defineProperty(exports, "getConfigFormat", { enumerable: true, get: function () { return unified_config_loader_1.getConfigFormat; } });
|
|
33
|
+
Object.defineProperty(exports, "isUnifiedMode", { enumerable: true, get: function () { return unified_config_loader_1.isUnifiedMode; } });
|
|
34
|
+
Object.defineProperty(exports, "getDefaultProfile", { enumerable: true, get: function () { return unified_config_loader_1.getDefaultProfile; } });
|
|
35
|
+
Object.defineProperty(exports, "setDefaultProfile", { enumerable: true, get: function () { return unified_config_loader_1.setDefaultProfile; } });
|
|
36
|
+
Object.defineProperty(exports, "getWebSearchConfig", { enumerable: true, get: function () { return unified_config_loader_1.getWebSearchConfig; } });
|
|
37
|
+
Object.defineProperty(exports, "getGlobalEnvConfig", { enumerable: true, get: function () { return unified_config_loader_1.getGlobalEnvConfig; } });
|
|
38
|
+
Object.defineProperty(exports, "getContinuityInheritanceMap", { enumerable: true, get: function () { return unified_config_loader_1.getContinuityInheritanceMap; } });
|
|
39
|
+
Object.defineProperty(exports, "getCliproxySafetyConfig", { enumerable: true, get: function () { return unified_config_loader_1.getCliproxySafetyConfig; } });
|
|
40
|
+
Object.defineProperty(exports, "getThinkingConfig", { enumerable: true, get: function () { return unified_config_loader_1.getThinkingConfig; } });
|
|
41
|
+
Object.defineProperty(exports, "getOfficialChannelsConfig", { enumerable: true, get: function () { return unified_config_loader_1.getOfficialChannelsConfig; } });
|
|
42
|
+
Object.defineProperty(exports, "isDashboardAuthEnabled", { enumerable: true, get: function () { return unified_config_loader_1.isDashboardAuthEnabled; } });
|
|
43
|
+
Object.defineProperty(exports, "getDashboardAuthConfig", { enumerable: true, get: function () { return unified_config_loader_1.getDashboardAuthConfig; } });
|
|
44
|
+
Object.defineProperty(exports, "getBrowserConfig", { enumerable: true, get: function () { return unified_config_loader_1.getBrowserConfig; } });
|
|
45
|
+
Object.defineProperty(exports, "getImageAnalysisConfig", { enumerable: true, get: function () { return unified_config_loader_1.getImageAnalysisConfig; } });
|
|
46
|
+
Object.defineProperty(exports, "getLoggingConfig", { enumerable: true, get: function () { return unified_config_loader_1.getLoggingConfig; } });
|
|
47
|
+
Object.defineProperty(exports, "getCursorConfig", { enumerable: true, get: function () { return unified_config_loader_1.getCursorConfig; } });
|
|
48
|
+
// Re-export selected functions from config-manager
|
|
49
|
+
var config_manager_1 = require("../utils/config-manager");
|
|
50
|
+
Object.defineProperty(exports, "loadSettings", { enumerable: true, get: function () { return config_manager_1.loadSettings; } });
|
|
51
|
+
Object.defineProperty(exports, "loadConfigSafe", { enumerable: true, get: function () { return config_manager_1.loadConfigSafe; } });
|
|
52
|
+
Object.defineProperty(exports, "readConfig", { enumerable: true, get: function () { return config_manager_1.readConfig; } });
|
|
53
|
+
Object.defineProperty(exports, "getCcsDir", { enumerable: true, get: function () { return config_manager_1.getCcsDir; } });
|
|
54
|
+
// Internal imports for memoization wrappers
|
|
55
|
+
const fs_1 = require("fs");
|
|
56
|
+
const unified_config_loader_2 = require("./unified-config-loader");
|
|
57
|
+
// ---------------------------------------------------------------------------
|
|
58
|
+
// Memoization cache with mtime-based staleness detection
|
|
59
|
+
// ---------------------------------------------------------------------------
|
|
60
|
+
let _configCache = null;
|
|
61
|
+
let _cacheMtimeMs = 0;
|
|
62
|
+
function getConfigFileMtime() {
|
|
63
|
+
try {
|
|
64
|
+
return (0, fs_1.statSync)((0, unified_config_loader_2.getConfigYamlPath)()).mtimeMs;
|
|
65
|
+
}
|
|
66
|
+
catch {
|
|
67
|
+
return 0;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Get the unified config with in-memory caching.
|
|
72
|
+
* Checks file mtime on each call — if the config file was modified
|
|
73
|
+
* externally (e.g. by code importing unified-config-loader directly),
|
|
74
|
+
* the cache is automatically invalidated and re-read from disk.
|
|
75
|
+
*/
|
|
76
|
+
function getCachedConfig() {
|
|
77
|
+
const currentMtime = getConfigFileMtime();
|
|
78
|
+
if (!_configCache || currentMtime > _cacheMtimeMs) {
|
|
79
|
+
_configCache = (0, unified_config_loader_2.loadOrCreateUnifiedConfig)();
|
|
80
|
+
_cacheMtimeMs = getConfigFileMtime();
|
|
81
|
+
}
|
|
82
|
+
return structuredClone(_configCache);
|
|
83
|
+
}
|
|
84
|
+
exports.getCachedConfig = getCachedConfig;
|
|
85
|
+
/**
|
|
86
|
+
* Clear the memoization cache.
|
|
87
|
+
* The next call to getCachedConfig() will re-read from disk.
|
|
88
|
+
*/
|
|
89
|
+
function invalidateConfigCache() {
|
|
90
|
+
_configCache = null;
|
|
91
|
+
_cacheMtimeMs = 0;
|
|
92
|
+
}
|
|
93
|
+
exports.invalidateConfigCache = invalidateConfigCache;
|
|
94
|
+
/**
|
|
95
|
+
* Save config to disk and update the cache.
|
|
96
|
+
* Stores a deep copy to break the reference alias.
|
|
97
|
+
*/
|
|
98
|
+
function saveConfig(config) {
|
|
99
|
+
(0, unified_config_loader_2.saveUnifiedConfig)(config);
|
|
100
|
+
_configCache = structuredClone(config);
|
|
101
|
+
}
|
|
102
|
+
exports.saveConfig = saveConfig;
|
|
103
|
+
/**
|
|
104
|
+
* Atomically mutate config (read-modify-write with lock) and invalidate cache.
|
|
105
|
+
* Invalidated AFTER _mutateUnifiedConfig returns — if that throws, cache stays valid.
|
|
106
|
+
*/
|
|
107
|
+
function mutateConfig(mutator) {
|
|
108
|
+
const result = (0, unified_config_loader_2.mutateUnifiedConfig)(mutator);
|
|
109
|
+
_configCache = null;
|
|
110
|
+
return result;
|
|
111
|
+
}
|
|
112
|
+
exports.mutateConfig = mutateConfig;
|
|
113
|
+
/**
|
|
114
|
+
* Partial-update config and invalidate cache.
|
|
115
|
+
* Shorthand for mutateConfig with Object.assign.
|
|
116
|
+
*/
|
|
117
|
+
function updateConfig(updates) {
|
|
118
|
+
const result = (0, unified_config_loader_2.updateUnifiedConfig)(updates);
|
|
119
|
+
_configCache = null;
|
|
120
|
+
return result;
|
|
121
|
+
}
|
|
122
|
+
exports.updateConfig = updateConfig;
|
|
123
|
+
/**
|
|
124
|
+
* Get the current cache state (for diagnostics/testing).
|
|
125
|
+
* Returns true if a cached config exists, false otherwise.
|
|
126
|
+
*/
|
|
127
|
+
function hasCachedConfig() {
|
|
128
|
+
return _configCache !== null;
|
|
129
|
+
}
|
|
130
|
+
exports.hasCachedConfig = hasCachedConfig;
|
|
131
|
+
//# sourceMappingURL=config-loader-facade.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-loader-facade.js","sourceRoot":"","sources":["../../src/config/config-loader-facade.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;AAEH,2DAA2D;AAC3D,iEAuBiC;AAtB/B,0HAAA,iBAAiB,OAAA;AACjB,kIAAA,yBAAyB,OAAA;AACzB,0HAAA,iBAAiB,OAAA;AACjB,0HAAA,iBAAiB,OAAA;AACjB,yHAAA,gBAAgB,OAAA;AAChB,wHAAA,eAAe,OAAA;AACf,wHAAA,eAAe,OAAA;AACf,sHAAA,aAAa,OAAA;AACb,0HAAA,iBAAiB,OAAA;AACjB,0HAAA,iBAAiB,OAAA;AACjB,2HAAA,kBAAkB,OAAA;AAClB,2HAAA,kBAAkB,OAAA;AAClB,oIAAA,2BAA2B,OAAA;AAC3B,gIAAA,uBAAuB,OAAA;AACvB,0HAAA,iBAAiB,OAAA;AACjB,kIAAA,yBAAyB,OAAA;AACzB,+HAAA,sBAAsB,OAAA;AACtB,+HAAA,sBAAsB,OAAA;AACtB,yHAAA,gBAAgB,OAAA;AAChB,+HAAA,sBAAsB,OAAA;AACtB,yHA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,YAAY,GAAG,IAAI,CAAC;IACpB,OAAO,MAAM,CAAC;AAChB,CAAC;AAJD,oCAIC;AAED;;;GAGG;AACH,SAAgB,YAAY,CAAC,OAA+B;IAC1D,MAAM,MAAM,GAAG,IAAA,2CAAoB,EAAC,OAAO,CAAC,CAAC;IAC7C,YAAY,GAAG,IAAI,CAAC;IACpB,OAAO,MAAM,CAAC;AAChB,CAAC;AAJD,oCAIC;AAED;;;GAGG;AACH,SAAgB,eAAe;IAC7B,OAAO,YAAY,KAAK,IAAI,CAAC;AAC/B,CAAC;AAFD,0CAEC"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Account, profile, and authentication config types.
|
|
3
|
+
*
|
|
4
|
+
* Covers:
|
|
5
|
+
* - AccountConfig: isolated Claude instances via CLAUDE_CONFIG_DIR
|
|
6
|
+
* - ProfileConfig: API-based profiles (env var injection)
|
|
7
|
+
* - OAuthAccounts: CLIProxy nickname-to-email mapping
|
|
8
|
+
* - CLIProxyAuthConfig: API key and management secret customization
|
|
9
|
+
* - TokenRefreshSettings: background token refresh worker config
|
|
10
|
+
* - DashboardAuthConfig: dashboard login protection
|
|
11
|
+
*/
|
|
12
|
+
import type { TargetType } from '../../targets/target-adapter';
|
|
13
|
+
/**
|
|
14
|
+
* Account configuration (formerly in profiles.json).
|
|
15
|
+
* Represents an isolated Claude instance via CLAUDE_CONFIG_DIR.
|
|
16
|
+
*/
|
|
17
|
+
export interface AccountConfig {
|
|
18
|
+
/** ISO timestamp when account was created */
|
|
19
|
+
created: string;
|
|
20
|
+
/** ISO timestamp of last usage, null if never used */
|
|
21
|
+
last_used: string | null;
|
|
22
|
+
/** Context mode for project workspace data */
|
|
23
|
+
context_mode?: 'isolated' | 'shared';
|
|
24
|
+
/** Context-sharing group when context_mode='shared' */
|
|
25
|
+
context_group?: string;
|
|
26
|
+
/** Shared continuity depth when context_mode='shared' */
|
|
27
|
+
continuity_mode?: 'standard' | 'deeper';
|
|
28
|
+
/** Bare profile: no shared symlinks (commands, skills, agents, settings.json) */
|
|
29
|
+
bare?: boolean;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* API-based profile configuration.
|
|
33
|
+
* Injects environment variables for alternative providers (GLM, Kimi, etc.).
|
|
34
|
+
*
|
|
35
|
+
* Settings are stored in separate *.settings.json files (matching Claude's pattern)
|
|
36
|
+
* to allow users to edit them directly without touching config.yaml.
|
|
37
|
+
*/
|
|
38
|
+
export interface ProfileConfig {
|
|
39
|
+
/** Profile type - currently only 'api' */
|
|
40
|
+
type: 'api';
|
|
41
|
+
/** Path to settings file (e.g., "~/.ccs/glm.settings.json") */
|
|
42
|
+
settings: string;
|
|
43
|
+
/** Target CLI to use for this profile (default: 'claude') */
|
|
44
|
+
target?: TargetType;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* CLIProxy OAuth account nickname mapping.
|
|
48
|
+
* Maps user-friendly nicknames to email addresses.
|
|
49
|
+
*/
|
|
50
|
+
export type OAuthAccounts = Record<string, string>;
|
|
51
|
+
/**
|
|
52
|
+
* CLIProxy authentication configuration.
|
|
53
|
+
* Allows customization of API key and management secret for CLIProxyAPI.
|
|
54
|
+
*/
|
|
55
|
+
export interface CLIProxyAuthConfig {
|
|
56
|
+
/** API key for CCS-managed requests (default: 'ccs-internal-managed') */
|
|
57
|
+
api_key?: string;
|
|
58
|
+
/** Management secret for Control Panel login (default: 'ccs') */
|
|
59
|
+
management_secret?: string;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Token refresh configuration.
|
|
63
|
+
* Manages background token refresh worker settings.
|
|
64
|
+
*/
|
|
65
|
+
export interface TokenRefreshSettings {
|
|
66
|
+
/** Enable background token refresh (default: false) */
|
|
67
|
+
enabled?: boolean;
|
|
68
|
+
/** Refresh check interval in minutes (default: 30) */
|
|
69
|
+
interval_minutes?: number;
|
|
70
|
+
/** Preemptive refresh time in minutes (default: 45) */
|
|
71
|
+
preemptive_minutes?: number;
|
|
72
|
+
/** Maximum retry attempts per token (default: 3) */
|
|
73
|
+
max_retries?: number;
|
|
74
|
+
/** Enable verbose logging (default: false) */
|
|
75
|
+
verbose?: boolean;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Dashboard authentication configuration.
|
|
79
|
+
* Optional login protection for CCS dashboard.
|
|
80
|
+
* Disabled by default for backward compatibility.
|
|
81
|
+
*/
|
|
82
|
+
export interface DashboardAuthConfig {
|
|
83
|
+
/** Enable dashboard authentication (default: false) */
|
|
84
|
+
enabled: boolean;
|
|
85
|
+
/** Username for dashboard login */
|
|
86
|
+
username: string;
|
|
87
|
+
/** Bcrypt-hashed password (use: npx bcrypt-cli hash 'password') */
|
|
88
|
+
password_hash: string;
|
|
89
|
+
/** Session timeout in hours (default: 24) */
|
|
90
|
+
session_timeout_hours?: number;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Default dashboard auth configuration.
|
|
94
|
+
* Disabled by default - must be explicitly enabled.
|
|
95
|
+
*/
|
|
96
|
+
export declare const DEFAULT_DASHBOARD_AUTH_CONFIG: DashboardAuthConfig;
|
|
97
|
+
//# sourceMappingURL=auth.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../src/config/schemas/auth.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAE/D;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,6CAA6C;IAC7C,OAAO,EAAE,MAAM,CAAC;IAChB,sDAAsD;IACtD,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,8CAA8C;IAC9C,YAAY,CAAC,EAAE,UAAU,GAAG,QAAQ,CAAC;IACrC,uDAAuD;IACvD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,yDAAyD;IACzD,eAAe,CAAC,EAAE,UAAU,GAAG,QAAQ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AccountConfig: isolated Claude instances via CLAUDE_CONFIG_DIR
|
|
7
|
+
* - ProfileConfig: API-based profiles (env var injection)
|
|
8
|
+
* - OAuthAccounts: CLIProxy nickname-to-email mapping
|
|
9
|
+
* - CLIProxyAuthConfig: API key and management secret customization
|
|
10
|
+
* - TokenRefreshSettings: background token refresh worker config
|
|
11
|
+
* - DashboardAuthConfig: dashboard login protection
|
|
12
|
+
*/
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.DEFAULT_DASHBOARD_AUTH_CONFIG = void 0;
|
|
15
|
+
/**
|
|
16
|
+
* Default dashboard auth configuration.
|
|
17
|
+
* Disabled by default - must be explicitly enabled.
|
|
18
|
+
*/
|
|
19
|
+
exports.DEFAULT_DASHBOARD_AUTH_CONFIG = {
|
|
20
|
+
enabled: false,
|
|
21
|
+
username: '',
|
|
22
|
+
password_hash: '',
|
|
23
|
+
session_timeout_hours: 24,
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=auth.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../src/config/schemas/auth.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;AAyFH;;;GAGG;AACU,QAAA,6BAA6B,GAAwB;IAChE,OAAO,EAAE,KAAK;IACd,QAAQ,EAAE,EAAE;IACZ,aAAa,EAAE,EAAE;IACjB,qBAAqB,EAAE,EAAE;CAC1B,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Browser automation configuration types and defaults.
|
|
3
|
+
*
|
|
4
|
+
* Controls Claude browser attach and Codex browser tooling.
|
|
5
|
+
* Version 13+ feature.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Browser tool exposure policy.
|
|
9
|
+
*/
|
|
10
|
+
export type BrowserToolPolicy = 'auto' | 'manual';
|
|
11
|
+
/**
|
|
12
|
+
* Browser eval access mode.
|
|
13
|
+
*/
|
|
14
|
+
export type BrowserEvalMode = 'disabled' | 'readonly' | 'readwrite';
|
|
15
|
+
/**
|
|
16
|
+
* Claude browser attach configuration.
|
|
17
|
+
*/
|
|
18
|
+
export interface BrowserClaudeConfig {
|
|
19
|
+
/** Enable Claude browser attach (default: false) */
|
|
20
|
+
enabled: boolean;
|
|
21
|
+
/** Control whether Claude browser attach is exposed automatically or only via --browser */
|
|
22
|
+
policy: BrowserToolPolicy;
|
|
23
|
+
/** Chrome user-data directory used for attach mode */
|
|
24
|
+
user_data_dir: string;
|
|
25
|
+
/** DevTools port used for attach mode (default: 9222) */
|
|
26
|
+
devtools_port: number;
|
|
27
|
+
/** Eval access mode exposed through browser settings/status surfaces */
|
|
28
|
+
eval_mode?: BrowserEvalMode;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Codex browser tooling configuration.
|
|
32
|
+
*/
|
|
33
|
+
export interface BrowserCodexConfig {
|
|
34
|
+
/** Enable Codex browser tooling injection (default: false) */
|
|
35
|
+
enabled: boolean;
|
|
36
|
+
/** Control whether Codex browser tooling is exposed automatically or only via --browser */
|
|
37
|
+
policy: BrowserToolPolicy;
|
|
38
|
+
/** Eval access mode exposed through browser settings/status surfaces */
|
|
39
|
+
eval_mode?: BrowserEvalMode;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Browser automation configuration.
|
|
43
|
+
* Controls Claude browser attach and Codex browser tooling.
|
|
44
|
+
*/
|
|
45
|
+
export interface BrowserConfig {
|
|
46
|
+
claude: BrowserClaudeConfig;
|
|
47
|
+
codex: BrowserCodexConfig;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Default browser configuration.
|
|
51
|
+
*/
|
|
52
|
+
export declare const DEFAULT_BROWSER_CONFIG: BrowserConfig;
|
|
53
|
+
//# sourceMappingURL=browser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../../../src/config/schemas/browser.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,QAAQ,CAAC;AAElD;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,UAAU,GAAG,UAAU,GAAG,WAAW,CAAC;AAEpE;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,oDAAoD;IACpD,OAAO,EAAE,OAAO,CAAC;IACjB,2FAA2F;IAC3F,MAAM,EAAE,iBAAiB,CAAC;IAC1B,sDAAsD;IACtD,aAAa,EAAE,MAAM,CAAC;IACtB,yDAAyD;IACzD,aAAa,EAAE,MAAM,CAAC;IACtB,wEAAwE;IACxE,SAAS,CAAC,EAAE,eAAe,CAAC;CAC7B;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,8DAA8D;IAC9D,OAAO,EAAE,OAAO,CAAC;IACjB,2FAA2F;IAC3F,MAAM,EAAE,iBAAiB,CAAC;IAC1B,wEAAwE;IACxE,SAAS,CAAC,EAAE,eAAe,CAAC;CAC7B;AAED;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,mBAAmB,CAAC;IAC5B,KAAK,EAAE,kBAAkB,CAAC;CAC3B;AAED;;GAEG;AACH,eAAO,MAAM,sBAAsB,EAAE,aAapC,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Browser automation configuration types and defaults.
|
|
4
|
+
*
|
|
5
|
+
* Controls Claude browser attach and Codex browser tooling.
|
|
6
|
+
* Version 13+ feature.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.DEFAULT_BROWSER_CONFIG = void 0;
|
|
10
|
+
/**
|
|
11
|
+
* Default browser configuration.
|
|
12
|
+
*/
|
|
13
|
+
exports.DEFAULT_BROWSER_CONFIG = {
|
|
14
|
+
claude: {
|
|
15
|
+
enabled: false,
|
|
16
|
+
policy: 'manual',
|
|
17
|
+
user_data_dir: '',
|
|
18
|
+
devtools_port: 9222,
|
|
19
|
+
eval_mode: 'readonly',
|
|
20
|
+
},
|
|
21
|
+
codex: {
|
|
22
|
+
enabled: false,
|
|
23
|
+
policy: 'manual',
|
|
24
|
+
eval_mode: 'readonly',
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=browser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser.js","sourceRoot":"","sources":["../../../src/config/schemas/browser.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAiDH;;GAEG;AACU,QAAA,sBAAsB,GAAkB;IACnD,MAAM,EAAE;QACN,OAAO,EAAE,KAAK;QACd,MAAM,EAAE,QAAQ;QAChB,aAAa,EAAE,EAAE;QACjB,aAAa,EAAE,IAAI;QACnB,SAAS,EAAE,UAAU;KACtB;IACD,KAAK,EAAE;QACL,OAAO,EAAE,KAAK;QACd,MAAM,EAAE,QAAQ;QAChB,SAAS,EAAE,UAAU;KACtB;CACF,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Official Channels configuration types and defaults.
|
|
3
|
+
*
|
|
4
|
+
* Controls runtime-only injection of Anthropic's official channel plugins
|
|
5
|
+
* (Telegram, Discord, iMessage).
|
|
6
|
+
* Version 12+ feature.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Supported Anthropic official channel IDs.
|
|
10
|
+
*/
|
|
11
|
+
export type OfficialChannelId = 'telegram' | 'discord' | 'imessage';
|
|
12
|
+
/**
|
|
13
|
+
* Official Channels configuration.
|
|
14
|
+
* Controls runtime-only injection of Anthropic's official channel plugins.
|
|
15
|
+
*/
|
|
16
|
+
export interface OfficialChannelsConfig {
|
|
17
|
+
/** Selected official channels to auto-enable for compatible sessions */
|
|
18
|
+
selected: OfficialChannelId[];
|
|
19
|
+
/** Also add --dangerously-skip-permissions when auto-enable is active */
|
|
20
|
+
unattended: boolean;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Default Official Channels configuration.
|
|
24
|
+
* Disabled by default because the feature requires explicit user setup.
|
|
25
|
+
*/
|
|
26
|
+
export declare const DEFAULT_OFFICIAL_CHANNELS_CONFIG: OfficialChannelsConfig;
|
|
27
|
+
//# sourceMappingURL=channels.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"channels.d.ts","sourceRoot":"","sources":["../../../src/config/schemas/channels.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,UAAU,GAAG,SAAS,GAAG,UAAU,CAAC;AAEpE;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC,wEAAwE;IACxE,QAAQ,EAAE,iBAAiB,EAAE,CAAC;IAC9B,yEAAyE;IACzE,UAAU,EAAE,OAAO,CAAC;CACrB;AAED;;;GAGG;AACH,eAAO,MAAM,gCAAgC,EAAE,sBAG9C,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Official Channels configuration types and defaults.
|
|
4
|
+
*
|
|
5
|
+
* Controls runtime-only injection of Anthropic's official channel plugins
|
|
6
|
+
* (Telegram, Discord, iMessage).
|
|
7
|
+
* Version 12+ feature.
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.DEFAULT_OFFICIAL_CHANNELS_CONFIG = void 0;
|
|
11
|
+
/**
|
|
12
|
+
* Default Official Channels configuration.
|
|
13
|
+
* Disabled by default because the feature requires explicit user setup.
|
|
14
|
+
*/
|
|
15
|
+
exports.DEFAULT_OFFICIAL_CHANNELS_CONFIG = {
|
|
16
|
+
selected: [],
|
|
17
|
+
unattended: false,
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=channels.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"channels.js","sourceRoot":"","sources":["../../../src/config/schemas/channels.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAkBH;;;GAGG;AACU,QAAA,gCAAgC,GAA2B;IACtE,QAAQ,EAAE,EAAE;IACZ,UAAU,EAAE,KAAK;CAClB,CAAC"}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLIProxy configuration types and defaults.
|
|
3
|
+
*
|
|
4
|
+
* Covers provider/variant/routing/safety/logging configuration
|
|
5
|
+
* for the CLIProxy integration layer.
|
|
6
|
+
*/
|
|
7
|
+
import type { TargetType } from '../../targets/target-adapter';
|
|
8
|
+
import type { CLIProxyProvider, CliproxyRoutingStrategy } from '../../cliproxy/types';
|
|
9
|
+
import { CLIPROXY_PROVIDER_IDS } from '../../cliproxy/provider-capabilities';
|
|
10
|
+
import type { OAuthAccounts, CLIProxyAuthConfig, TokenRefreshSettings } from './auth';
|
|
11
|
+
/**
|
|
12
|
+
* Supported CLIProxy providers.
|
|
13
|
+
* Derived from CLIPROXY_PROVIDER_IDS — single source of truth in provider-capabilities.ts.
|
|
14
|
+
*/
|
|
15
|
+
export { CLIPROXY_PROVIDER_IDS as CLIPROXY_SUPPORTED_PROVIDERS };
|
|
16
|
+
/**
|
|
17
|
+
* CLIProxy variant configuration.
|
|
18
|
+
* User-defined variants of built-in OAuth providers.
|
|
19
|
+
*
|
|
20
|
+
* Settings are stored in separate *.settings.json files (matching Claude's pattern)
|
|
21
|
+
* to allow users to edit them directly without touching config.yaml.
|
|
22
|
+
*/
|
|
23
|
+
export interface CLIProxyVariantConfig {
|
|
24
|
+
/** Base provider to use */
|
|
25
|
+
provider: CLIProxyProvider;
|
|
26
|
+
/** Account nickname (references oauth_accounts) */
|
|
27
|
+
account?: string;
|
|
28
|
+
/** Path to settings file (e.g., "~/.ccs/gemini-custom.settings.json") */
|
|
29
|
+
settings?: string;
|
|
30
|
+
/** Unique port for variant isolation (8318-8417) */
|
|
31
|
+
port?: number;
|
|
32
|
+
/** Per-variant auth override (optional) */
|
|
33
|
+
auth?: CLIProxyAuthConfig;
|
|
34
|
+
/** Target CLI to use for this variant (default: 'claude') */
|
|
35
|
+
target?: TargetType;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Per-tier provider+model mapping for composite variants.
|
|
39
|
+
*/
|
|
40
|
+
export interface CompositeTierConfig {
|
|
41
|
+
/** Provider for this tier */
|
|
42
|
+
provider: CLIProxyProvider;
|
|
43
|
+
/** Model ID to use for this tier */
|
|
44
|
+
model: string;
|
|
45
|
+
/** Account nickname (optional, references oauth_accounts) */
|
|
46
|
+
account?: string;
|
|
47
|
+
/** Fallback provider+model if primary fails */
|
|
48
|
+
fallback?: {
|
|
49
|
+
provider: CLIProxyProvider;
|
|
50
|
+
model: string;
|
|
51
|
+
account?: string;
|
|
52
|
+
};
|
|
53
|
+
/** Per-tier thinking budget override (e.g. 'xhigh', 'medium', 'off') */
|
|
54
|
+
thinking?: string;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Composite variant configuration.
|
|
58
|
+
* Mixes different providers per Claude tier (opus, sonnet, haiku) in a single profile.
|
|
59
|
+
* Uses CLIProxyAPI root endpoints (/v1/messages) for model-based routing
|
|
60
|
+
* instead of provider-specific endpoints (/api/provider/{provider}).
|
|
61
|
+
*/
|
|
62
|
+
export interface CompositeVariantConfig {
|
|
63
|
+
/** Discriminator for composite type */
|
|
64
|
+
type: 'composite';
|
|
65
|
+
/** Which tier ANTHROPIC_MODEL equals (default must be one of the three) */
|
|
66
|
+
default_tier: 'opus' | 'sonnet' | 'haiku';
|
|
67
|
+
/** Per-tier provider+model mapping */
|
|
68
|
+
tiers: {
|
|
69
|
+
opus: CompositeTierConfig;
|
|
70
|
+
sonnet: CompositeTierConfig;
|
|
71
|
+
haiku: CompositeTierConfig;
|
|
72
|
+
};
|
|
73
|
+
/** Path to settings file */
|
|
74
|
+
settings?: string;
|
|
75
|
+
/** Shared port for the composite profile */
|
|
76
|
+
port?: number;
|
|
77
|
+
/** Per-variant auth override (optional) */
|
|
78
|
+
auth?: CLIProxyAuthConfig;
|
|
79
|
+
/** Target CLI to use for this composite variant (default: 'claude') */
|
|
80
|
+
target?: TargetType;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* CLIProxy logging configuration.
|
|
84
|
+
* Controls whether CLIProxyAPI writes logs to disk.
|
|
85
|
+
* Logs can grow to several GB if left enabled.
|
|
86
|
+
*/
|
|
87
|
+
export interface CLIProxyLoggingConfig {
|
|
88
|
+
/** Enable logging to file (default: false to prevent disk bloat) */
|
|
89
|
+
enabled?: boolean;
|
|
90
|
+
/** Enable request logging for debugging (default: false) */
|
|
91
|
+
request_log?: boolean;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* CLIProxy safety configuration.
|
|
95
|
+
* Controls high-risk flow safeguards for supported providers.
|
|
96
|
+
*/
|
|
97
|
+
export interface CLIProxySafetyConfig {
|
|
98
|
+
/** Allow skipping AGY responsibility checks and Gemini dashboard typed acknowledgement */
|
|
99
|
+
antigravity_ack_bypass?: boolean;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Default CLIProxy safety configuration.
|
|
103
|
+
*/
|
|
104
|
+
export declare const DEFAULT_CLIPROXY_SAFETY_CONFIG: CLIProxySafetyConfig;
|
|
105
|
+
export interface CLIProxyRoutingConfig {
|
|
106
|
+
/** Credential selection strategy when multiple accounts match */
|
|
107
|
+
strategy?: CliproxyRoutingStrategy;
|
|
108
|
+
/** Keep one conversation pinned to the same account when possible */
|
|
109
|
+
session_affinity?: boolean;
|
|
110
|
+
/** Go-style duration for session-affinity binding retention */
|
|
111
|
+
session_affinity_ttl?: string;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* CLIProxy configuration section.
|
|
115
|
+
*/
|
|
116
|
+
export interface CLIProxyConfig {
|
|
117
|
+
/** Backend selection: 'original' or 'plus' (default: 'original') */
|
|
118
|
+
backend?: 'original' | 'plus';
|
|
119
|
+
/** Nickname to email mapping for OAuth accounts */
|
|
120
|
+
oauth_accounts: OAuthAccounts;
|
|
121
|
+
/** Built-in providers (read-only, for reference) */
|
|
122
|
+
providers: readonly string[];
|
|
123
|
+
/** User-defined provider variants (single-provider or composite) */
|
|
124
|
+
variants: Record<string, CLIProxyVariantConfig | CompositeVariantConfig>;
|
|
125
|
+
/** Logging configuration (disabled by default) */
|
|
126
|
+
logging?: CLIProxyLoggingConfig;
|
|
127
|
+
/** Safety controls for high-risk provider flows */
|
|
128
|
+
safety?: CLIProxySafetyConfig;
|
|
129
|
+
/** Kiro: disable incognito browser mode (use normal browser to save credentials) */
|
|
130
|
+
kiro_no_incognito?: boolean;
|
|
131
|
+
/** Global auth configuration for CLIProxyAPI */
|
|
132
|
+
auth?: CLIProxyAuthConfig;
|
|
133
|
+
/** Background token refresh worker settings */
|
|
134
|
+
token_refresh?: TokenRefreshSettings;
|
|
135
|
+
/** Auto-sync API profiles to local CLIProxy config on settings change (default: true) */
|
|
136
|
+
auto_sync?: boolean;
|
|
137
|
+
/** Routing strategy for multi-account CLIProxy selection */
|
|
138
|
+
routing?: CLIProxyRoutingConfig;
|
|
139
|
+
}
|
|
140
|
+
//# sourceMappingURL=cliproxy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cliproxy.d.ts","sourceRoot":"","sources":["../../../src/config/schemas/cliproxy.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,KAAK,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AACtF,OAAO,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAC7E,OAAO,KAAK,EAAE,aAAa,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,QAAQ,CAAC;AA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AC5D,OAAO,CAAC,EAAE,qBAAqB,CAAC;CACjC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* CLIProxy configuration types and defaults.
|
|
4
|
+
*
|
|
5
|
+
* Covers provider/variant/routing/safety/logging configuration
|
|
6
|
+
* for the CLIProxy integration layer.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.DEFAULT_CLIPROXY_SAFETY_CONFIG = exports.CLIPROXY_SUPPORTED_PROVIDERS = void 0;
|
|
10
|
+
const provider_capabilities_1 = require("../../cliproxy/provider-capabilities");
|
|
11
|
+
Object.defineProperty(exports, "CLIPROXY_SUPPORTED_PROVIDERS", { enumerable: true, get: function () { return provider_capabilities_1.CLIPROXY_PROVIDER_IDS; } });
|
|
12
|
+
/**
|
|
13
|
+
* Default CLIProxy safety configuration.
|
|
14
|
+
*/
|
|
15
|
+
exports.DEFAULT_CLIPROXY_SAFETY_CONFIG = {
|
|
16
|
+
antigravity_ack_bypass: false,
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=cliproxy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cliproxy.js","sourceRoot":"","sources":["../../../src/config/schemas/cliproxy.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAIH,gFAA6E;AAO3C,6GAPzB,6CAAqB,OAOgC;AA4F9D;;GAEG;AACU,QAAA,8BAA8B,GAAyB;IAClE,sBAAsB,EAAE,KAAK;CAC9B,CAAC"}
|