@jonnyhoo/ccs 1.1.2 → 1.1.3
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/api/services/index.d.ts +1 -1
- package/dist/api/services/index.d.ts.map +1 -1
- package/dist/api/services/index.js.map +1 -1
- package/dist/api/services/profile-reader.d.ts.map +1 -1
- package/dist/api/services/profile-reader.js +1 -21
- package/dist/api/services/profile-reader.js.map +1 -1
- package/dist/api/services/profile-types.d.ts +0 -7
- package/dist/api/services/profile-types.d.ts.map +1 -1
- package/dist/api/services/profile-writer.d.ts.map +1 -1
- package/dist/api/services/profile-writer.js +6 -2
- package/dist/api/services/profile-writer.js.map +1 -1
- package/dist/api/services/validation-service.d.ts.map +1 -1
- package/dist/api/services/validation-service.js +44 -3
- package/dist/api/services/validation-service.js.map +1 -1
- package/dist/ccs.js +67 -514
- package/dist/ccs.js.map +1 -1
- package/dist/commands/api-command.d.ts.map +1 -1
- package/dist/commands/api-command.js +1 -20
- package/dist/commands/api-command.js.map +1 -1
- package/dist/config/index.d.ts +1 -3
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +2 -6
- package/dist/config/index.js.map +1 -1
- package/dist/config/profile-detector.d.ts +64 -0
- package/dist/config/profile-detector.d.ts.map +1 -0
- package/dist/config/profile-detector.js +220 -0
- package/dist/config/profile-detector.js.map +1 -0
- package/dist/config/unified-config-loader.d.ts +3 -64
- package/dist/config/unified-config-loader.d.ts.map +1 -1
- package/dist/config/unified-config-loader.js +44 -387
- package/dist/config/unified-config-loader.js.map +1 -1
- package/dist/config/unified-config-types.d.ts +20 -416
- package/dist/config/unified-config-types.d.ts.map +1 -1
- package/dist/config/unified-config-types.js +8 -152
- package/dist/config/unified-config-types.js.map +1 -1
- package/dist/delegation/background-monitor.d.ts.map +1 -1
- package/dist/delegation/background-monitor.js +11 -6
- package/dist/delegation/background-monitor.js.map +1 -1
- package/dist/delegation/result-formatter.d.ts +1 -29
- package/dist/delegation/result-formatter.d.ts.map +1 -1
- package/dist/delegation/result-formatter.js +3 -188
- package/dist/delegation/result-formatter.js.map +1 -1
- package/dist/{cliproxy → proxy}/anthropic-to-openai-proxy.d.ts +2 -0
- package/dist/proxy/anthropic-to-openai-proxy.d.ts.map +1 -0
- package/dist/{cliproxy → proxy}/anthropic-to-openai-proxy.js +69 -21
- package/dist/proxy/anthropic-to-openai-proxy.js.map +1 -0
- package/dist/proxy/cliproxy-autostart.d.ts +28 -0
- package/dist/proxy/cliproxy-autostart.d.ts.map +1 -0
- package/dist/proxy/cliproxy-autostart.js +226 -0
- package/dist/proxy/cliproxy-autostart.js.map +1 -0
- package/dist/proxy/tool-name-mapper.d.ts.map +1 -0
- package/dist/{cliproxy → proxy}/tool-name-mapper.js +13 -6
- package/dist/proxy/tool-name-mapper.js.map +1 -0
- package/dist/proxy/tool-name-sanitizer.d.ts.map +1 -0
- package/dist/proxy/tool-name-sanitizer.js.map +1 -0
- package/dist/proxy/tool-sanitization-proxy.d.ts.map +1 -0
- package/dist/{cliproxy → proxy}/tool-sanitization-proxy.js +4 -1
- package/dist/proxy/tool-sanitization-proxy.js.map +1 -0
- package/dist/types/config.d.ts +0 -24
- package/dist/types/config.d.ts.map +1 -1
- package/dist/types/config.js.map +1 -1
- package/dist/types/index.d.ts +1 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js.map +1 -1
- package/dist/utils/config-manager.d.ts +0 -27
- package/dist/utils/config-manager.d.ts.map +1 -1
- package/dist/utils/config-manager.js +4 -65
- package/dist/utils/config-manager.js.map +1 -1
- package/dist/utils/delegation-validator.d.ts.map +1 -1
- package/dist/utils/delegation-validator.js +0 -11
- package/dist/utils/delegation-validator.js.map +1 -1
- package/dist/utils/error-manager.d.ts +0 -28
- package/dist/utils/error-manager.d.ts.map +1 -1
- package/dist/utils/error-manager.js +6 -105
- package/dist/utils/error-manager.js.map +1 -1
- package/dist/utils/helpers.js +1 -1
- package/dist/utils/helpers.js.map +1 -1
- package/dist/utils/index.d.ts +0 -5
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +3 -17
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/shell-executor.d.ts.map +1 -1
- package/dist/utils/shell-executor.js +2 -3
- package/dist/utils/shell-executor.js.map +1 -1
- package/dist/utils/ui/index.d.ts +0 -4
- package/dist/utils/ui/index.d.ts.map +1 -1
- package/dist/utils/ui/index.js +1 -5
- package/dist/utils/ui/index.js.map +1 -1
- package/dist/utils/ui/init.d.ts.map +1 -1
- package/dist/utils/ui/init.js +1 -3
- package/dist/utils/ui/init.js.map +1 -1
- package/dist/utils/ui.d.ts +1 -2
- package/dist/utils/ui.d.ts.map +1 -1
- package/dist/utils/ui.js +2 -2
- package/dist/utils/ui.js.map +1 -1
- package/package.json +3 -29
- package/scripts/dev-install.sh +2 -1
- package/dist/auth/auth-commands.d.ts +0 -62
- package/dist/auth/auth-commands.d.ts.map +0 -1
- package/dist/auth/auth-commands.js +0 -191
- package/dist/auth/auth-commands.js.map +0 -1
- package/dist/auth/commands/create-command.d.ts +0 -11
- package/dist/auth/commands/create-command.d.ts.map +0 -1
- package/dist/auth/commands/create-command.js +0 -137
- package/dist/auth/commands/create-command.js.map +0 -1
- package/dist/auth/commands/default-command.d.ts +0 -15
- package/dist/auth/commands/default-command.d.ts.map +0 -1
- package/dist/auth/commands/default-command.js +0 -71
- package/dist/auth/commands/default-command.js.map +0 -1
- package/dist/auth/commands/index.d.ts +0 -12
- package/dist/auth/commands/index.d.ts.map +0 -1
- package/dist/auth/commands/index.js +0 -25
- package/dist/auth/commands/index.js.map +0 -1
- package/dist/auth/commands/list-command.d.ts +0 -11
- package/dist/auth/commands/list-command.d.ts.map +0 -1
- package/dist/auth/commands/list-command.js +0 -124
- package/dist/auth/commands/list-command.js.map +0 -1
- package/dist/auth/commands/remove-command.d.ts +0 -11
- package/dist/auth/commands/remove-command.d.ts.map +0 -1
- package/dist/auth/commands/remove-command.js +0 -102
- package/dist/auth/commands/remove-command.js.map +0 -1
- package/dist/auth/commands/show-command.d.ts +0 -11
- package/dist/auth/commands/show-command.d.ts.map +0 -1
- package/dist/auth/commands/show-command.js +0 -103
- package/dist/auth/commands/show-command.js.map +0 -1
- package/dist/auth/commands/types.d.ts +0 -50
- package/dist/auth/commands/types.d.ts.map +0 -1
- package/dist/auth/commands/types.js +0 -26
- package/dist/auth/commands/types.js.map +0 -1
- package/dist/auth/index.d.ts +0 -8
- package/dist/auth/index.d.ts.map +0 -1
- package/dist/auth/index.js +0 -16
- package/dist/auth/index.js.map +0 -1
- package/dist/auth/profile-detector.d.ts +0 -108
- package/dist/auth/profile-detector.d.ts.map +0 -1
- package/dist/auth/profile-detector.js +0 -430
- package/dist/auth/profile-detector.js.map +0 -1
- package/dist/auth/profile-registry.d.ts +0 -110
- package/dist/auth/profile-registry.d.ts.map +0 -1
- package/dist/auth/profile-registry.js +0 -318
- package/dist/auth/profile-registry.js.map +0 -1
- package/dist/cliproxy/account-manager.d.ts +0 -218
- package/dist/cliproxy/account-manager.d.ts.map +0 -1
- package/dist/cliproxy/account-manager.js +0 -808
- package/dist/cliproxy/account-manager.js.map +0 -1
- package/dist/cliproxy/anthropic-to-openai-proxy.d.ts.map +0 -1
- package/dist/cliproxy/anthropic-to-openai-proxy.js.map +0 -1
- package/dist/cliproxy/auth/auth-types.d.ts +0 -106
- package/dist/cliproxy/auth/auth-types.d.ts.map +0 -1
- package/dist/cliproxy/auth/auth-types.js +0 -164
- package/dist/cliproxy/auth/auth-types.js.map +0 -1
- package/dist/cliproxy/auth/environment-detector.d.ts +0 -30
- package/dist/cliproxy/auth/environment-detector.d.ts.map +0 -1
- package/dist/cliproxy/auth/environment-detector.js +0 -129
- package/dist/cliproxy/auth/environment-detector.js.map +0 -1
- package/dist/cliproxy/auth/gemini-token-refresh.d.ts +0 -38
- package/dist/cliproxy/auth/gemini-token-refresh.d.ts.map +0 -1
- package/dist/cliproxy/auth/gemini-token-refresh.js +0 -327
- package/dist/cliproxy/auth/gemini-token-refresh.js.map +0 -1
- package/dist/cliproxy/auth/index.d.ts +0 -11
- package/dist/cliproxy/auth/index.d.ts.map +0 -1
- package/dist/cliproxy/auth/index.js +0 -35
- package/dist/cliproxy/auth/index.js.map +0 -1
- package/dist/cliproxy/auth/kiro-import.d.ts +0 -23
- package/dist/cliproxy/auth/kiro-import.d.ts.map +0 -1
- package/dist/cliproxy/auth/kiro-import.js +0 -140
- package/dist/cliproxy/auth/kiro-import.js.map +0 -1
- package/dist/cliproxy/auth/oauth-handler.d.ts +0 -31
- package/dist/cliproxy/auth/oauth-handler.d.ts.map +0 -1
- package/dist/cliproxy/auth/oauth-handler.js +0 -422
- package/dist/cliproxy/auth/oauth-handler.js.map +0 -1
- package/dist/cliproxy/auth/oauth-process.d.ts +0 -27
- package/dist/cliproxy/auth/oauth-process.d.ts.map +0 -1
- package/dist/cliproxy/auth/oauth-process.js +0 -386
- package/dist/cliproxy/auth/oauth-process.js.map +0 -1
- package/dist/cliproxy/auth/provider-refreshers/index.d.ts +0 -21
- package/dist/cliproxy/auth/provider-refreshers/index.d.ts.map +0 -1
- package/dist/cliproxy/auth/provider-refreshers/index.js +0 -57
- package/dist/cliproxy/auth/provider-refreshers/index.js.map +0 -1
- package/dist/cliproxy/auth/token-expiry-checker.d.ts +0 -37
- package/dist/cliproxy/auth/token-expiry-checker.d.ts.map +0 -1
- package/dist/cliproxy/auth/token-expiry-checker.js +0 -115
- package/dist/cliproxy/auth/token-expiry-checker.js.map +0 -1
- package/dist/cliproxy/auth/token-manager.d.ts +0 -66
- package/dist/cliproxy/auth/token-manager.d.ts.map +0 -1
- package/dist/cliproxy/auth/token-manager.js +0 -309
- package/dist/cliproxy/auth/token-manager.js.map +0 -1
- package/dist/cliproxy/auth/token-refresh-config.d.ts +0 -13
- package/dist/cliproxy/auth/token-refresh-config.d.ts.map +0 -1
- package/dist/cliproxy/auth/token-refresh-config.js +0 -31
- package/dist/cliproxy/auth/token-refresh-config.js.map +0 -1
- package/dist/cliproxy/auth/token-refresh-worker.d.ts +0 -83
- package/dist/cliproxy/auth/token-refresh-worker.d.ts.map +0 -1
- package/dist/cliproxy/auth/token-refresh-worker.js +0 -214
- package/dist/cliproxy/auth/token-refresh-worker.js.map +0 -1
- package/dist/cliproxy/auth-handler.d.ts +0 -31
- package/dist/cliproxy/auth-handler.d.ts.map +0 -1
- package/dist/cliproxy/auth-handler.js +0 -60
- package/dist/cliproxy/auth-handler.js.map +0 -1
- package/dist/cliproxy/auth-session-manager.d.ts +0 -51
- package/dist/cliproxy/auth-session-manager.d.ts.map +0 -1
- package/dist/cliproxy/auth-session-manager.js +0 -134
- package/dist/cliproxy/auth-session-manager.js.map +0 -1
- package/dist/cliproxy/auth-token-manager.d.ts +0 -82
- package/dist/cliproxy/auth-token-manager.d.ts.map +0 -1
- package/dist/cliproxy/auth-token-manager.js +0 -187
- package/dist/cliproxy/auth-token-manager.js.map +0 -1
- package/dist/cliproxy/auth-utils.d.ts +0 -16
- package/dist/cliproxy/auth-utils.d.ts.map +0 -1
- package/dist/cliproxy/auth-utils.js +0 -33
- package/dist/cliproxy/auth-utils.js.map +0 -1
- package/dist/cliproxy/base-config-loader.d.ts +0 -42
- package/dist/cliproxy/base-config-loader.d.ts.map +0 -1
- package/dist/cliproxy/base-config-loader.js +0 -123
- package/dist/cliproxy/base-config-loader.js.map +0 -1
- package/dist/cliproxy/binary/downloader.d.ts +0 -42
- package/dist/cliproxy/binary/downloader.d.ts.map +0 -1
- package/dist/cliproxy/binary/downloader.js +0 -407
- package/dist/cliproxy/binary/downloader.js.map +0 -1
- package/dist/cliproxy/binary/extractor.d.ts +0 -12
- package/dist/cliproxy/binary/extractor.d.ts.map +0 -1
- package/dist/cliproxy/binary/extractor.js +0 -28
- package/dist/cliproxy/binary/extractor.js.map +0 -1
- package/dist/cliproxy/binary/index.d.ts +0 -13
- package/dist/cliproxy/binary/index.d.ts.map +0 -1
- package/dist/cliproxy/binary/index.js +0 -54
- package/dist/cliproxy/binary/index.js.map +0 -1
- package/dist/cliproxy/binary/installer.d.ts +0 -25
- package/dist/cliproxy/binary/installer.d.ts.map +0 -1
- package/dist/cliproxy/binary/installer.js +0 -129
- package/dist/cliproxy/binary/installer.js.map +0 -1
- package/dist/cliproxy/binary/lifecycle.d.ts +0 -11
- package/dist/cliproxy/binary/lifecycle.d.ts.map +0 -1
- package/dist/cliproxy/binary/lifecycle.js +0 -150
- package/dist/cliproxy/binary/lifecycle.js.map +0 -1
- package/dist/cliproxy/binary/tar-extractor.d.ts +0 -10
- package/dist/cliproxy/binary/tar-extractor.d.ts.map +0 -1
- package/dist/cliproxy/binary/tar-extractor.js +0 -118
- package/dist/cliproxy/binary/tar-extractor.js.map +0 -1
- package/dist/cliproxy/binary/types.d.ts +0 -49
- package/dist/cliproxy/binary/types.d.ts.map +0 -1
- package/dist/cliproxy/binary/types.js +0 -32
- package/dist/cliproxy/binary/types.js.map +0 -1
- package/dist/cliproxy/binary/updater.d.ts +0 -7
- package/dist/cliproxy/binary/updater.d.ts.map +0 -1
- package/dist/cliproxy/binary/updater.js +0 -18
- package/dist/cliproxy/binary/updater.js.map +0 -1
- package/dist/cliproxy/binary/verifier.d.ts +0 -18
- package/dist/cliproxy/binary/verifier.d.ts.map +0 -1
- package/dist/cliproxy/binary/verifier.js +0 -82
- package/dist/cliproxy/binary/verifier.js.map +0 -1
- package/dist/cliproxy/binary/version-cache.d.ts +0 -64
- package/dist/cliproxy/binary/version-cache.d.ts.map +0 -1
- package/dist/cliproxy/binary/version-cache.js +0 -239
- package/dist/cliproxy/binary/version-cache.js.map +0 -1
- package/dist/cliproxy/binary/version-checker.d.ts +0 -36
- package/dist/cliproxy/binary/version-checker.d.ts.map +0 -1
- package/dist/cliproxy/binary/version-checker.js +0 -135
- package/dist/cliproxy/binary/version-checker.js.map +0 -1
- package/dist/cliproxy/binary/zip-extractor.d.ts +0 -10
- package/dist/cliproxy/binary/zip-extractor.d.ts.map +0 -1
- package/dist/cliproxy/binary/zip-extractor.js +0 -110
- package/dist/cliproxy/binary/zip-extractor.js.map +0 -1
- package/dist/cliproxy/binary-manager.d.ts +0 -59
- package/dist/cliproxy/binary-manager.d.ts.map +0 -1
- package/dist/cliproxy/binary-manager.js +0 -211
- package/dist/cliproxy/binary-manager.js.map +0 -1
- package/dist/cliproxy/cliproxy-executor.d.ts +0 -33
- package/dist/cliproxy/cliproxy-executor.d.ts.map +0 -1
- package/dist/cliproxy/cliproxy-executor.js +0 -1242
- package/dist/cliproxy/cliproxy-executor.js.map +0 -1
- package/dist/cliproxy/codex-reasoning-proxy.d.ts +0 -54
- package/dist/cliproxy/codex-reasoning-proxy.d.ts.map +0 -1
- package/dist/cliproxy/codex-reasoning-proxy.js +0 -373
- package/dist/cliproxy/codex-reasoning-proxy.js.map +0 -1
- package/dist/cliproxy/config-generator.d.ts +0 -236
- package/dist/cliproxy/config-generator.d.ts.map +0 -1
- package/dist/cliproxy/config-generator.js +0 -946
- package/dist/cliproxy/config-generator.js.map +0 -1
- package/dist/cliproxy/device-code-handler.d.ts +0 -28
- package/dist/cliproxy/device-code-handler.d.ts.map +0 -1
- package/dist/cliproxy/device-code-handler.js +0 -22
- package/dist/cliproxy/device-code-handler.js.map +0 -1
- package/dist/cliproxy/endpoint-setup.d.ts +0 -44
- package/dist/cliproxy/endpoint-setup.d.ts.map +0 -1
- package/dist/cliproxy/endpoint-setup.js +0 -299
- package/dist/cliproxy/endpoint-setup.js.map +0 -1
- package/dist/cliproxy/https-tunnel-proxy.d.ts +0 -44
- package/dist/cliproxy/https-tunnel-proxy.d.ts.map +0 -1
- package/dist/cliproxy/https-tunnel-proxy.js +0 -224
- package/dist/cliproxy/https-tunnel-proxy.js.map +0 -1
- package/dist/cliproxy/index.d.ts +0 -41
- package/dist/cliproxy/index.d.ts.map +0 -1
- package/dist/cliproxy/index.js +0 -152
- package/dist/cliproxy/index.js.map +0 -1
- package/dist/cliproxy/management-api-client.d.ts +0 -67
- package/dist/cliproxy/management-api-client.d.ts.map +0 -1
- package/dist/cliproxy/management-api-client.js +0 -347
- package/dist/cliproxy/management-api-client.js.map +0 -1
- package/dist/cliproxy/management-api-types.d.ts +0 -107
- package/dist/cliproxy/management-api-types.d.ts.map +0 -1
- package/dist/cliproxy/management-api-types.js +0 -9
- package/dist/cliproxy/management-api-types.js.map +0 -1
- package/dist/cliproxy/model-catalog.d.ts +0 -108
- package/dist/cliproxy/model-catalog.d.ts.map +0 -1
- package/dist/cliproxy/model-catalog.js +0 -258
- package/dist/cliproxy/model-catalog.js.map +0 -1
- package/dist/cliproxy/model-config.d.ts +0 -31
- package/dist/cliproxy/model-config.d.ts.map +0 -1
- package/dist/cliproxy/model-config.js +0 -250
- package/dist/cliproxy/model-config.js.map +0 -1
- package/dist/cliproxy/openai-compat-manager.d.ts +0 -46
- package/dist/cliproxy/openai-compat-manager.d.ts.map +0 -1
- package/dist/cliproxy/openai-compat-manager.js +0 -191
- package/dist/cliproxy/openai-compat-manager.js.map +0 -1
- package/dist/cliproxy/platform-detector.d.ts +0 -99
- package/dist/cliproxy/platform-detector.d.ts.map +0 -1
- package/dist/cliproxy/platform-detector.js +0 -174
- package/dist/cliproxy/platform-detector.js.map +0 -1
- package/dist/cliproxy/project-selection-handler.d.ts +0 -105
- package/dist/cliproxy/project-selection-handler.d.ts.map +0 -1
- package/dist/cliproxy/project-selection-handler.js +0 -167
- package/dist/cliproxy/project-selection-handler.js.map +0 -1
- package/dist/cliproxy/proxy-config-resolver.d.ts +0 -86
- package/dist/cliproxy/proxy-config-resolver.d.ts.map +0 -1
- package/dist/cliproxy/proxy-config-resolver.js +0 -253
- package/dist/cliproxy/proxy-config-resolver.js.map +0 -1
- package/dist/cliproxy/proxy-detector.d.ts +0 -72
- package/dist/cliproxy/proxy-detector.d.ts.map +0 -1
- package/dist/cliproxy/proxy-detector.js +0 -196
- package/dist/cliproxy/proxy-detector.js.map +0 -1
- package/dist/cliproxy/proxy-target-resolver.d.ts +0 -50
- package/dist/cliproxy/proxy-target-resolver.d.ts.map +0 -1
- package/dist/cliproxy/proxy-target-resolver.js +0 -105
- package/dist/cliproxy/proxy-target-resolver.js.map +0 -1
- package/dist/cliproxy/quota-fetcher-codex.d.ts +0 -66
- package/dist/cliproxy/quota-fetcher-codex.d.ts.map +0 -1
- package/dist/cliproxy/quota-fetcher-codex.js +0 -315
- package/dist/cliproxy/quota-fetcher-codex.js.map +0 -1
- package/dist/cliproxy/quota-fetcher-gemini-cli.d.ts +0 -51
- package/dist/cliproxy/quota-fetcher-gemini-cli.d.ts.map +0 -1
- package/dist/cliproxy/quota-fetcher-gemini-cli.js +0 -492
- package/dist/cliproxy/quota-fetcher-gemini-cli.js.map +0 -1
- package/dist/cliproxy/quota-fetcher.d.ts +0 -95
- package/dist/cliproxy/quota-fetcher.d.ts.map +0 -1
- package/dist/cliproxy/quota-fetcher.js +0 -589
- package/dist/cliproxy/quota-fetcher.js.map +0 -1
- package/dist/cliproxy/quota-manager.d.ts +0 -88
- package/dist/cliproxy/quota-manager.d.ts.map +0 -1
- package/dist/cliproxy/quota-manager.js +0 -278
- package/dist/cliproxy/quota-manager.js.map +0 -1
- package/dist/cliproxy/quota-response-cache.d.ts +0 -46
- package/dist/cliproxy/quota-response-cache.d.ts.map +0 -1
- package/dist/cliproxy/quota-response-cache.js +0 -98
- package/dist/cliproxy/quota-response-cache.js.map +0 -1
- package/dist/cliproxy/quota-types.d.ts +0 -84
- package/dist/cliproxy/quota-types.d.ts.map +0 -1
- package/dist/cliproxy/quota-types.js +0 -9
- package/dist/cliproxy/quota-types.js.map +0 -1
- package/dist/cliproxy/remote-auth-fetcher.d.ts +0 -28
- package/dist/cliproxy/remote-auth-fetcher.d.ts.map +0 -1
- package/dist/cliproxy/remote-auth-fetcher.js +0 -117
- package/dist/cliproxy/remote-auth-fetcher.js.map +0 -1
- package/dist/cliproxy/remote-proxy-client.d.ts +0 -59
- package/dist/cliproxy/remote-proxy-client.d.ts.map +0 -1
- package/dist/cliproxy/remote-proxy-client.js +0 -278
- package/dist/cliproxy/remote-proxy-client.js.map +0 -1
- package/dist/cliproxy/remote-token-uploader.d.ts +0 -28
- package/dist/cliproxy/remote-token-uploader.d.ts.map +0 -1
- package/dist/cliproxy/remote-token-uploader.js +0 -178
- package/dist/cliproxy/remote-token-uploader.js.map +0 -1
- package/dist/cliproxy/service-manager.d.ts +0 -55
- package/dist/cliproxy/service-manager.d.ts.map +0 -1
- package/dist/cliproxy/service-manager.js +0 -327
- package/dist/cliproxy/service-manager.js.map +0 -1
- package/dist/cliproxy/services/binary-service.d.ts +0 -67
- package/dist/cliproxy/services/binary-service.d.ts.map +0 -1
- package/dist/cliproxy/services/binary-service.js +0 -176
- package/dist/cliproxy/services/binary-service.js.map +0 -1
- package/dist/cliproxy/services/index.d.ts +0 -8
- package/dist/cliproxy/services/index.d.ts.map +0 -1
- package/dist/cliproxy/services/index.js +0 -31
- package/dist/cliproxy/services/index.js.map +0 -1
- package/dist/cliproxy/services/proxy-lifecycle-service.d.ts +0 -38
- package/dist/cliproxy/services/proxy-lifecycle-service.d.ts.map +0 -1
- package/dist/cliproxy/services/proxy-lifecycle-service.js +0 -41
- package/dist/cliproxy/services/proxy-lifecycle-service.js.map +0 -1
- package/dist/cliproxy/services/variant-config-adapter.d.ts +0 -48
- package/dist/cliproxy/services/variant-config-adapter.d.ts.map +0 -1
- package/dist/cliproxy/services/variant-config-adapter.js +0 -215
- package/dist/cliproxy/services/variant-config-adapter.js.map +0 -1
- package/dist/cliproxy/services/variant-service.d.ts +0 -52
- package/dist/cliproxy/services/variant-service.d.ts.map +0 -1
- package/dist/cliproxy/services/variant-service.js +0 -218
- package/dist/cliproxy/services/variant-service.js.map +0 -1
- package/dist/cliproxy/services/variant-settings.d.ts +0 -37
- package/dist/cliproxy/services/variant-settings.d.ts.map +0 -1
- package/dist/cliproxy/services/variant-settings.js +0 -163
- package/dist/cliproxy/services/variant-settings.js.map +0 -1
- package/dist/cliproxy/session-tracker.d.ts +0 -100
- package/dist/cliproxy/session-tracker.d.ts.map +0 -1
- package/dist/cliproxy/session-tracker.js +0 -420
- package/dist/cliproxy/session-tracker.js.map +0 -1
- package/dist/cliproxy/startup-lock.d.ts +0 -57
- package/dist/cliproxy/startup-lock.d.ts.map +0 -1
- package/dist/cliproxy/startup-lock.js +0 -216
- package/dist/cliproxy/startup-lock.js.map +0 -1
- package/dist/cliproxy/stats-fetcher.d.ts +0 -106
- package/dist/cliproxy/stats-fetcher.d.ts.map +0 -1
- package/dist/cliproxy/stats-fetcher.js +0 -267
- package/dist/cliproxy/stats-fetcher.js.map +0 -1
- package/dist/cliproxy/sync/auto-sync-watcher.d.ts +0 -37
- package/dist/cliproxy/sync/auto-sync-watcher.d.ts.map +0 -1
- package/dist/cliproxy/sync/auto-sync-watcher.js +0 -211
- package/dist/cliproxy/sync/auto-sync-watcher.js.map +0 -1
- package/dist/cliproxy/sync/index.d.ts +0 -10
- package/dist/cliproxy/sync/index.d.ts.map +0 -1
- package/dist/cliproxy/sync/index.js +0 -27
- package/dist/cliproxy/sync/index.js.map +0 -1
- package/dist/cliproxy/sync/local-config-sync.d.ts +0 -28
- package/dist/cliproxy/sync/local-config-sync.d.ts.map +0 -1
- package/dist/cliproxy/sync/local-config-sync.js +0 -223
- package/dist/cliproxy/sync/local-config-sync.js.map +0 -1
- package/dist/cliproxy/sync/profile-mapper.d.ts +0 -55
- package/dist/cliproxy/sync/profile-mapper.d.ts.map +0 -1
- package/dist/cliproxy/sync/profile-mapper.js +0 -173
- package/dist/cliproxy/sync/profile-mapper.js.map +0 -1
- package/dist/cliproxy/thinking-validator.d.ts +0 -67
- package/dist/cliproxy/thinking-validator.d.ts.map +0 -1
- package/dist/cliproxy/thinking-validator.js +0 -327
- package/dist/cliproxy/thinking-validator.js.map +0 -1
- package/dist/cliproxy/tool-name-mapper.d.ts.map +0 -1
- package/dist/cliproxy/tool-name-mapper.js.map +0 -1
- package/dist/cliproxy/tool-name-sanitizer.d.ts.map +0 -1
- package/dist/cliproxy/tool-name-sanitizer.js.map +0 -1
- package/dist/cliproxy/tool-sanitization-proxy.d.ts.map +0 -1
- package/dist/cliproxy/tool-sanitization-proxy.js.map +0 -1
- package/dist/cliproxy/types.d.ts +0 -218
- package/dist/cliproxy/types.d.ts.map +0 -1
- package/dist/cliproxy/types.js +0 -12
- package/dist/cliproxy/types.js.map +0 -1
- package/dist/commands/cleanup-command.d.ts +0 -12
- package/dist/commands/cleanup-command.d.ts.map +0 -1
- package/dist/commands/cleanup-command.js +0 -350
- package/dist/commands/cleanup-command.js.map +0 -1
- package/dist/commands/config-auth/disable-command.d.ts +0 -10
- package/dist/commands/config-auth/disable-command.d.ts.map +0 -1
- package/dist/commands/config-auth/disable-command.js +0 -64
- package/dist/commands/config-auth/disable-command.js.map +0 -1
- package/dist/commands/config-auth/index.d.ts +0 -14
- package/dist/commands/config-auth/index.d.ts.map +0 -1
- package/dist/commands/config-auth/index.js +0 -84
- package/dist/commands/config-auth/index.js.map +0 -1
- package/dist/commands/config-auth/setup-command.d.ts +0 -13
- package/dist/commands/config-auth/setup-command.d.ts.map +0 -1
- package/dist/commands/config-auth/setup-command.js +0 -121
- package/dist/commands/config-auth/setup-command.js.map +0 -1
- package/dist/commands/config-auth/show-command.d.ts +0 -10
- package/dist/commands/config-auth/show-command.d.ts.map +0 -1
- package/dist/commands/config-auth/show-command.js +0 -79
- package/dist/commands/config-auth/show-command.js.map +0 -1
- package/dist/commands/config-auth/types.d.ts +0 -25
- package/dist/commands/config-auth/types.d.ts.map +0 -1
- package/dist/commands/config-auth/types.js +0 -8
- package/dist/commands/config-auth/types.js.map +0 -1
- package/dist/commands/config-command.d.ts +0 -12
- package/dist/commands/config-command.d.ts.map +0 -1
- package/dist/commands/config-command.js +0 -184
- package/dist/commands/config-command.js.map +0 -1
- package/dist/commands/config-image-analysis-command.d.ts +0 -8
- package/dist/commands/config-image-analysis-command.d.ts.map +0 -1
- package/dist/commands/config-image-analysis-command.js +0 -174
- package/dist/commands/config-image-analysis-command.js.map +0 -1
- package/dist/commands/copilot-command.d.ts +0 -10
- package/dist/commands/copilot-command.d.ts.map +0 -1
- package/dist/commands/copilot-command.js +0 -228
- package/dist/commands/copilot-command.js.map +0 -1
- package/dist/commands/doctor-command.d.ts +0 -11
- package/dist/commands/doctor-command.d.ts.map +0 -1
- package/dist/commands/doctor-command.js +0 -92
- package/dist/commands/doctor-command.js.map +0 -1
- package/dist/commands/help-command.d.ts +0 -5
- package/dist/commands/help-command.d.ts.map +0 -1
- package/dist/commands/help-command.js +0 -267
- package/dist/commands/help-command.js.map +0 -1
- package/dist/commands/index.d.ts +0 -17
- package/dist/commands/index.d.ts.map +0 -1
- package/dist/commands/index.js +0 -33
- package/dist/commands/index.js.map +0 -1
- package/dist/commands/install-command.d.ts +0 -14
- package/dist/commands/install-command.d.ts.map +0 -1
- package/dist/commands/install-command.js +0 -55
- package/dist/commands/install-command.js.map +0 -1
- package/dist/commands/migrate-command.d.ts +0 -17
- package/dist/commands/migrate-command.d.ts.map +0 -1
- package/dist/commands/migrate-command.js +0 -139
- package/dist/commands/migrate-command.js.map +0 -1
- package/dist/commands/persist-command.d.ts +0 -12
- package/dist/commands/persist-command.d.ts.map +0 -1
- package/dist/commands/persist-command.js +0 -565
- package/dist/commands/persist-command.js.map +0 -1
- package/dist/commands/router.d.ts +0 -41
- package/dist/commands/router.d.ts.map +0 -1
- package/dist/commands/router.js +0 -234
- package/dist/commands/router.js.map +0 -1
- package/dist/commands/setup-command.d.ts +0 -29
- package/dist/commands/setup-command.d.ts.map +0 -1
- package/dist/commands/setup-command.js +0 -426
- package/dist/commands/setup-command.js.map +0 -1
- package/dist/commands/shell-completion-command.d.ts +0 -10
- package/dist/commands/shell-completion-command.d.ts.map +0 -1
- package/dist/commands/shell-completion-command.js +0 -90
- package/dist/commands/shell-completion-command.js.map +0 -1
- package/dist/commands/sync-command.d.ts +0 -10
- package/dist/commands/sync-command.d.ts.map +0 -1
- package/dist/commands/sync-command.js +0 -67
- package/dist/commands/sync-command.js.map +0 -1
- package/dist/commands/tokens-command.d.ts +0 -19
- package/dist/commands/tokens-command.d.ts.map +0 -1
- package/dist/commands/tokens-command.js +0 -173
- package/dist/commands/tokens-command.js.map +0 -1
- package/dist/commands/update-command.d.ts +0 -19
- package/dist/commands/update-command.d.ts.map +0 -1
- package/dist/commands/update-command.js +0 -290
- package/dist/commands/update-command.js.map +0 -1
- package/dist/commands/version-command.d.ts +0 -10
- package/dist/commands/version-command.d.ts.map +0 -1
- package/dist/commands/version-command.js +0 -100
- package/dist/commands/version-command.js.map +0 -1
- package/dist/config/feature-flags.d.ts +0 -19
- package/dist/config/feature-flags.d.ts.map +0 -1
- package/dist/config/feature-flags.js +0 -31
- package/dist/config/feature-flags.js.map +0 -1
- package/dist/config/migration-manager.d.ts +0 -75
- package/dist/config/migration-manager.d.ts.map +0 -1
- package/dist/config/migration-manager.js +0 -446
- package/dist/config/migration-manager.js.map +0 -1
- package/dist/config/reserved-names.d.ts +0 -31
- package/dist/config/reserved-names.d.ts.map +0 -1
- package/dist/config/reserved-names.js +0 -80
- package/dist/config/reserved-names.js.map +0 -1
- package/dist/copilot/copilot-auth.d.ts +0 -52
- package/dist/copilot/copilot-auth.d.ts.map +0 -1
- package/dist/copilot/copilot-auth.js +0 -201
- package/dist/copilot/copilot-auth.js.map +0 -1
- package/dist/copilot/copilot-daemon.d.ts +0 -36
- package/dist/copilot/copilot-daemon.d.ts.map +0 -1
- package/dist/copilot/copilot-daemon.js +0 -237
- package/dist/copilot/copilot-daemon.js.map +0 -1
- package/dist/copilot/copilot-executor.d.ts +0 -26
- package/dist/copilot/copilot-executor.d.ts.map +0 -1
- package/dist/copilot/copilot-executor.js +0 -150
- package/dist/copilot/copilot-executor.js.map +0 -1
- package/dist/copilot/copilot-models.d.ts +0 -34
- package/dist/copilot/copilot-models.d.ts.map +0 -1
- package/dist/copilot/copilot-models.js +0 -261
- package/dist/copilot/copilot-models.js.map +0 -1
- package/dist/copilot/copilot-package-manager.d.ts +0 -93
- package/dist/copilot/copilot-package-manager.d.ts.map +0 -1
- package/dist/copilot/copilot-package-manager.js +0 -488
- package/dist/copilot/copilot-package-manager.js.map +0 -1
- package/dist/copilot/index.d.ts +0 -13
- package/dist/copilot/index.d.ts.map +0 -1
- package/dist/copilot/index.js +0 -63
- package/dist/copilot/index.js.map +0 -1
- package/dist/copilot/types.d.ts +0 -65
- package/dist/copilot/types.d.ts.map +0 -1
- package/dist/copilot/types.js +0 -8
- package/dist/copilot/types.js.map +0 -1
- package/dist/hello.d.ts +0 -7
- package/dist/hello.d.ts.map +0 -1
- package/dist/hello.js +0 -13
- package/dist/hello.js.map +0 -1
- package/dist/management/checks/cliproxy-check.d.ts +0 -37
- package/dist/management/checks/cliproxy-check.d.ts.map +0 -1
- package/dist/management/checks/cliproxy-check.js +0 -187
- package/dist/management/checks/cliproxy-check.js.map +0 -1
- package/dist/management/checks/config-check.d.ts +0 -38
- package/dist/management/checks/config-check.d.ts.map +0 -1
- package/dist/management/checks/config-check.js +0 -215
- package/dist/management/checks/config-check.js.map +0 -1
- package/dist/management/checks/env-check.d.ts +0 -17
- package/dist/management/checks/env-check.d.ts.map +0 -1
- package/dist/management/checks/env-check.js +0 -71
- package/dist/management/checks/env-check.js.map +0 -1
- package/dist/management/checks/image-analysis-check.d.ts +0 -16
- package/dist/management/checks/image-analysis-check.d.ts.map +0 -1
- package/dist/management/checks/image-analysis-check.js +0 -140
- package/dist/management/checks/image-analysis-check.js.map +0 -1
- package/dist/management/checks/index.d.ts +0 -13
- package/dist/management/checks/index.d.ts.map +0 -1
- package/dist/management/checks/index.js +0 -52
- package/dist/management/checks/index.js.map +0 -1
- package/dist/management/checks/oauth-check.d.ts +0 -16
- package/dist/management/checks/oauth-check.d.ts.map +0 -1
- package/dist/management/checks/oauth-check.js +0 -68
- package/dist/management/checks/oauth-check.js.map +0 -1
- package/dist/management/checks/profile-check.d.ts +0 -40
- package/dist/management/checks/profile-check.d.ts.map +0 -1
- package/dist/management/checks/profile-check.js +0 -190
- package/dist/management/checks/profile-check.js.map +0 -1
- package/dist/management/checks/symlink-check.d.ts +0 -30
- package/dist/management/checks/symlink-check.d.ts.map +0 -1
- package/dist/management/checks/symlink-check.js +0 -214
- package/dist/management/checks/symlink-check.js.map +0 -1
- package/dist/management/checks/system-check.d.ts +0 -25
- package/dist/management/checks/system-check.d.ts.map +0 -1
- package/dist/management/checks/system-check.js +0 -135
- package/dist/management/checks/system-check.js.map +0 -1
- package/dist/management/checks/types.d.ts +0 -64
- package/dist/management/checks/types.d.ts.map +0 -1
- package/dist/management/checks/types.js +0 -64
- package/dist/management/checks/types.js.map +0 -1
- package/dist/management/doctor.d.ts +0 -34
- package/dist/management/doctor.d.ts.map +0 -1
- package/dist/management/doctor.js +0 -154
- package/dist/management/doctor.js.map +0 -1
- package/dist/management/environment-diagnostics.d.ts +0 -69
- package/dist/management/environment-diagnostics.d.ts.map +0 -1
- package/dist/management/environment-diagnostics.js +0 -229
- package/dist/management/environment-diagnostics.js.map +0 -1
- package/dist/management/index.d.ts +0 -15
- package/dist/management/index.d.ts.map +0 -1
- package/dist/management/index.js +0 -56
- package/dist/management/index.js.map +0 -1
- package/dist/management/instance-manager.d.ts +0 -57
- package/dist/management/instance-manager.d.ts.map +0 -1
- package/dist/management/instance-manager.js +0 -195
- package/dist/management/instance-manager.js.map +0 -1
- package/dist/management/oauth-port-diagnostics.d.ts +0 -115
- package/dist/management/oauth-port-diagnostics.d.ts.map +0 -1
- package/dist/management/oauth-port-diagnostics.js +0 -291
- package/dist/management/oauth-port-diagnostics.js.map +0 -1
- package/dist/management/recovery-manager.d.ts +0 -56
- package/dist/management/recovery-manager.d.ts.map +0 -1
- package/dist/management/recovery-manager.js +0 -239
- package/dist/management/recovery-manager.js.map +0 -1
- package/dist/management/repair/auto-repair.d.ts +0 -13
- package/dist/management/repair/auto-repair.d.ts.map +0 -1
- package/dist/management/repair/auto-repair.js +0 -186
- package/dist/management/repair/auto-repair.js.map +0 -1
- package/dist/management/repair/index.d.ts +0 -5
- package/dist/management/repair/index.d.ts.map +0 -1
- package/dist/management/repair/index.js +0 -9
- package/dist/management/repair/index.js.map +0 -1
- package/dist/management/shared-manager.d.ts +0 -55
- package/dist/management/shared-manager.d.ts.map +0 -1
- package/dist/management/shared-manager.js +0 -424
- package/dist/management/shared-manager.js.map +0 -1
- package/dist/router/index.d.ts +0 -13
- package/dist/router/index.d.ts.map +0 -1
- package/dist/router/index.js +0 -25
- package/dist/router/index.js.map +0 -1
- package/dist/router/scenario-router.d.ts +0 -80
- package/dist/router/scenario-router.d.ts.map +0 -1
- package/dist/router/scenario-router.js +0 -159
- package/dist/router/scenario-router.js.map +0 -1
- package/dist/router/scenario-routing-proxy.d.ts +0 -138
- package/dist/router/scenario-routing-proxy.d.ts.map +0 -1
- package/dist/router/scenario-routing-proxy.js +0 -395
- package/dist/router/scenario-routing-proxy.js.map +0 -1
- package/dist/router/settings-routing-executor.d.ts +0 -21
- package/dist/router/settings-routing-executor.d.ts.map +0 -1
- package/dist/router/settings-routing-executor.js +0 -111
- package/dist/router/settings-routing-executor.js.map +0 -1
- package/dist/router/types.d.ts +0 -72
- package/dist/router/types.d.ts.map +0 -1
- package/dist/router/types.js +0 -20
- package/dist/router/types.js.map +0 -1
- package/dist/types/glmt.d.ts +0 -95
- package/dist/types/glmt.d.ts.map +0 -1
- package/dist/types/glmt.js +0 -7
- package/dist/types/glmt.js.map +0 -1
- package/dist/utils/api-key-validator.d.ts +0 -14
- package/dist/utils/api-key-validator.d.ts.map +0 -1
- package/dist/utils/api-key-validator.js +0 -143
- package/dist/utils/api-key-validator.js.map +0 -1
- package/dist/utils/claude-dir-installer.d.ts +0 -46
- package/dist/utils/claude-dir-installer.d.ts.map +0 -1
- package/dist/utils/claude-dir-installer.js +0 -289
- package/dist/utils/claude-dir-installer.js.map +0 -1
- package/dist/utils/claude-spawner.d.ts +0 -54
- package/dist/utils/claude-spawner.d.ts.map +0 -1
- package/dist/utils/claude-spawner.js +0 -118
- package/dist/utils/claude-spawner.js.map +0 -1
- package/dist/utils/claude-symlink-manager.d.ts +0 -75
- package/dist/utils/claude-symlink-manager.d.ts.map +0 -1
- package/dist/utils/claude-symlink-manager.js +0 -393
- package/dist/utils/claude-symlink-manager.js.map +0 -1
- package/dist/utils/hooks/get-image-analysis-hook-env.d.ts +0 -17
- package/dist/utils/hooks/get-image-analysis-hook-env.d.ts.map +0 -1
- package/dist/utils/hooks/get-image-analysis-hook-env.js +0 -42
- package/dist/utils/hooks/get-image-analysis-hook-env.js.map +0 -1
- package/dist/utils/hooks/image-analyzer-hook-configuration.d.ts +0 -17
- package/dist/utils/hooks/image-analyzer-hook-configuration.d.ts.map +0 -1
- package/dist/utils/hooks/image-analyzer-hook-configuration.js +0 -71
- package/dist/utils/hooks/image-analyzer-hook-configuration.js.map +0 -1
- package/dist/utils/hooks/image-analyzer-hook-installer.d.ts +0 -31
- package/dist/utils/hooks/image-analyzer-hook-installer.d.ts.map +0 -1
- package/dist/utils/hooks/image-analyzer-hook-installer.js +0 -149
- package/dist/utils/hooks/image-analyzer-hook-installer.js.map +0 -1
- package/dist/utils/hooks/image-analyzer-profile-hook-injector.d.ts +0 -24
- package/dist/utils/hooks/image-analyzer-profile-hook-injector.d.ts.map +0 -1
- package/dist/utils/hooks/image-analyzer-profile-hook-injector.js +0 -251
- package/dist/utils/hooks/image-analyzer-profile-hook-injector.js.map +0 -1
- package/dist/utils/hooks/index.d.ts +0 -11
- package/dist/utils/hooks/index.d.ts.map +0 -1
- package/dist/utils/hooks/index.js +0 -21
- package/dist/utils/hooks/index.js.map +0 -1
- package/dist/utils/image-analysis/hook-installer.d.ts +0 -19
- package/dist/utils/image-analysis/hook-installer.d.ts.map +0 -1
- package/dist/utils/image-analysis/hook-installer.js +0 -112
- package/dist/utils/image-analysis/hook-installer.js.map +0 -1
- package/dist/utils/image-analysis/index.d.ts +0 -7
- package/dist/utils/image-analysis/index.d.ts.map +0 -1
- package/dist/utils/image-analysis/index.js +0 -12
- package/dist/utils/image-analysis/index.js.map +0 -1
- package/dist/utils/package-manager-detector.d.ts +0 -11
- package/dist/utils/package-manager-detector.d.ts.map +0 -1
- package/dist/utils/package-manager-detector.js +0 -103
- package/dist/utils/package-manager-detector.js.map +0 -1
- package/dist/utils/platform-commands.d.ts +0 -53
- package/dist/utils/platform-commands.d.ts.map +0 -1
- package/dist/utils/platform-commands.js +0 -189
- package/dist/utils/platform-commands.js.map +0 -1
- package/dist/utils/port-utils.d.ts +0 -55
- package/dist/utils/port-utils.d.ts.map +0 -1
- package/dist/utils/port-utils.js +0 -217
- package/dist/utils/port-utils.js.map +0 -1
- package/dist/utils/sensitive-keys.d.ts +0 -35
- package/dist/utils/sensitive-keys.d.ts.map +0 -1
- package/dist/utils/sensitive-keys.js +0 -67
- package/dist/utils/sensitive-keys.js.map +0 -1
- package/dist/utils/shell-completion.d.ts +0 -54
- package/dist/utils/shell-completion.d.ts.map +0 -1
- package/dist/utils/shell-completion.js +0 -260
- package/dist/utils/shell-completion.js.map +0 -1
- package/dist/utils/ui/tasks.d.ts +0 -26
- package/dist/utils/ui/tasks.d.ts.map +0 -1
- package/dist/utils/ui/tasks.js +0 -102
- package/dist/utils/ui/tasks.js.map +0 -1
- package/dist/utils/update-checker.d.ts +0 -71
- package/dist/utils/update-checker.d.ts.map +0 -1
- package/dist/utils/update-checker.js +0 -377
- package/dist/utils/update-checker.js.map +0 -1
- package/dist/utils/version.d.ts +0 -8
- package/dist/utils/version.d.ts.map +0 -1
- package/dist/utils/version.js +0 -51
- package/dist/utils/version.js.map +0 -1
- package/dist/web-server/data-aggregator.d.ts +0 -7
- package/dist/web-server/data-aggregator.d.ts.map +0 -1
- package/dist/web-server/data-aggregator.js +0 -23
- package/dist/web-server/data-aggregator.js.map +0 -1
- package/dist/web-server/file-watcher.d.ts +0 -15
- package/dist/web-server/file-watcher.d.ts.map +0 -1
- package/dist/web-server/file-watcher.js +0 -93
- package/dist/web-server/file-watcher.js.map +0 -1
- package/dist/web-server/health/cliproxy-checks.d.ts +0 -23
- package/dist/web-server/health/cliproxy-checks.d.ts.map +0 -1
- package/dist/web-server/health/cliproxy-checks.js +0 -171
- package/dist/web-server/health/cliproxy-checks.js.map +0 -1
- package/dist/web-server/health/config-checks.d.ts +0 -20
- package/dist/web-server/health/config-checks.d.ts.map +0 -1
- package/dist/web-server/health/config-checks.js +0 -212
- package/dist/web-server/health/config-checks.js.map +0 -1
- package/dist/web-server/health/environment-checks.d.ts +0 -11
- package/dist/web-server/health/environment-checks.d.ts.map +0 -1
- package/dist/web-server/health/environment-checks.js +0 -40
- package/dist/web-server/health/environment-checks.js.map +0 -1
- package/dist/web-server/health/index.d.ts +0 -12
- package/dist/web-server/health/index.d.ts.map +0 -1
- package/dist/web-server/health/index.js +0 -38
- package/dist/web-server/health/index.js.map +0 -1
- package/dist/web-server/health/oauth-checks.d.ts +0 -11
- package/dist/web-server/health/oauth-checks.d.ts.map +0 -1
- package/dist/web-server/health/oauth-checks.js +0 -34
- package/dist/web-server/health/oauth-checks.js.map +0 -1
- package/dist/web-server/health/profile-checks.d.ts +0 -20
- package/dist/web-server/health/profile-checks.d.ts.map +0 -1
- package/dist/web-server/health/profile-checks.js +0 -184
- package/dist/web-server/health/profile-checks.js.map +0 -1
- package/dist/web-server/health/symlink-checks.d.ts +0 -15
- package/dist/web-server/health/symlink-checks.d.ts.map +0 -1
- package/dist/web-server/health/symlink-checks.js +0 -173
- package/dist/web-server/health/symlink-checks.js.map +0 -1
- package/dist/web-server/health/system-checks.d.ts +0 -19
- package/dist/web-server/health/system-checks.d.ts.map +0 -1
- package/dist/web-server/health/system-checks.js +0 -127
- package/dist/web-server/health/system-checks.js.map +0 -1
- package/dist/web-server/health/types.d.ts +0 -34
- package/dist/web-server/health/types.d.ts.map +0 -1
- package/dist/web-server/health/types.js +0 -8
- package/dist/web-server/health/types.js.map +0 -1
- package/dist/web-server/health-service.d.ts +0 -20
- package/dist/web-server/health-service.d.ts.map +0 -1
- package/dist/web-server/health-service.js +0 -158
- package/dist/web-server/health-service.js.map +0 -1
- package/dist/web-server/index.d.ts +0 -25
- package/dist/web-server/index.d.ts.map +0 -1
- package/dist/web-server/index.js +0 -118
- package/dist/web-server/index.js.map +0 -1
- package/dist/web-server/jsonl-parser.d.ts +0 -68
- package/dist/web-server/jsonl-parser.d.ts.map +0 -1
- package/dist/web-server/jsonl-parser.js +0 -214
- package/dist/web-server/jsonl-parser.js.map +0 -1
- package/dist/web-server/middleware/auth-middleware.d.ts +0 -27
- package/dist/web-server/middleware/auth-middleware.d.ts.map +0 -1
- package/dist/web-server/middleware/auth-middleware.js +0 -116
- package/dist/web-server/middleware/auth-middleware.js.map +0 -1
- package/dist/web-server/model-pricing.d.ts +0 -42
- package/dist/web-server/model-pricing.d.ts.map +0 -1
- package/dist/web-server/model-pricing.js +0 -669
- package/dist/web-server/model-pricing.js.map +0 -1
- package/dist/web-server/overview-routes.d.ts +0 -7
- package/dist/web-server/overview-routes.d.ts.map +0 -1
- package/dist/web-server/overview-routes.js +0 -75
- package/dist/web-server/overview-routes.js.map +0 -1
- package/dist/web-server/routes/account-routes.d.ts +0 -9
- package/dist/web-server/routes/account-routes.d.ts.map +0 -1
- package/dist/web-server/routes/account-routes.js +0 -274
- package/dist/web-server/routes/account-routes.js.map +0 -1
- package/dist/web-server/routes/auth-routes.d.ts +0 -7
- package/dist/web-server/routes/auth-routes.d.ts.map +0 -1
- package/dist/web-server/routes/auth-routes.js +0 -108
- package/dist/web-server/routes/auth-routes.js.map +0 -1
- package/dist/web-server/routes/cliproxy-auth-routes.d.ts +0 -3
- package/dist/web-server/routes/cliproxy-auth-routes.d.ts.map +0 -1
- package/dist/web-server/routes/cliproxy-auth-routes.js +0 -610
- package/dist/web-server/routes/cliproxy-auth-routes.js.map +0 -1
- package/dist/web-server/routes/cliproxy-stats-routes.d.ts +0 -6
- package/dist/web-server/routes/cliproxy-stats-routes.d.ts.map +0 -1
- package/dist/web-server/routes/cliproxy-stats-routes.js +0 -681
- package/dist/web-server/routes/cliproxy-stats-routes.js.map +0 -1
- package/dist/web-server/routes/cliproxy-sync-routes.d.ts +0 -6
- package/dist/web-server/routes/cliproxy-sync-routes.d.ts.map +0 -1
- package/dist/web-server/routes/cliproxy-sync-routes.js +0 -157
- package/dist/web-server/routes/cliproxy-sync-routes.js.map +0 -1
- package/dist/web-server/routes/config-routes.d.ts +0 -6
- package/dist/web-server/routes/config-routes.d.ts.map +0 -1
- package/dist/web-server/routes/config-routes.js +0 -130
- package/dist/web-server/routes/config-routes.js.map +0 -1
- package/dist/web-server/routes/copilot-routes.d.ts +0 -6
- package/dist/web-server/routes/copilot-routes.d.ts.map +0 -1
- package/dist/web-server/routes/copilot-routes.js +0 -195
- package/dist/web-server/routes/copilot-routes.js.map +0 -1
- package/dist/web-server/routes/copilot-settings-routes.d.ts +0 -6
- package/dist/web-server/routes/copilot-settings-routes.d.ts.map +0 -1
- package/dist/web-server/routes/copilot-settings-routes.js +0 -122
- package/dist/web-server/routes/copilot-settings-routes.js.map +0 -1
- package/dist/web-server/routes/health-routes.d.ts +0 -6
- package/dist/web-server/routes/health-routes.d.ts.map +0 -1
- package/dist/web-server/routes/health-routes.js +0 -40
- package/dist/web-server/routes/health-routes.js.map +0 -1
- package/dist/web-server/routes/index.d.ts +0 -8
- package/dist/web-server/routes/index.d.ts.map +0 -1
- package/dist/web-server/routes/index.js +0 -59
- package/dist/web-server/routes/index.js.map +0 -1
- package/dist/web-server/routes/misc-routes.d.ts +0 -6
- package/dist/web-server/routes/misc-routes.d.ts.map +0 -1
- package/dist/web-server/routes/misc-routes.js +0 -396
- package/dist/web-server/routes/misc-routes.js.map +0 -1
- package/dist/web-server/routes/persist-routes.d.ts +0 -6
- package/dist/web-server/routes/persist-routes.d.ts.map +0 -1
- package/dist/web-server/routes/persist-routes.js +0 -286
- package/dist/web-server/routes/persist-routes.js.map +0 -1
- package/dist/web-server/routes/profile-routes.d.ts +0 -9
- package/dist/web-server/routes/profile-routes.d.ts.map +0 -1
- package/dist/web-server/routes/profile-routes.js +0 -116
- package/dist/web-server/routes/profile-routes.js.map +0 -1
- package/dist/web-server/routes/provider-routes.d.ts +0 -6
- package/dist/web-server/routes/provider-routes.d.ts.map +0 -1
- package/dist/web-server/routes/provider-routes.js +0 -146
- package/dist/web-server/routes/provider-routes.js.map +0 -1
- package/dist/web-server/routes/proxy-routes.d.ts +0 -11
- package/dist/web-server/routes/proxy-routes.d.ts.map +0 -1
- package/dist/web-server/routes/proxy-routes.js +0 -154
- package/dist/web-server/routes/proxy-routes.js.map +0 -1
- package/dist/web-server/routes/route-helpers.d.ts +0 -50
- package/dist/web-server/routes/route-helpers.d.ts.map +0 -1
- package/dist/web-server/routes/route-helpers.js +0 -179
- package/dist/web-server/routes/route-helpers.js.map +0 -1
- package/dist/web-server/routes/settings-routes.d.ts +0 -6
- package/dist/web-server/routes/settings-routes.d.ts.map +0 -1
- package/dist/web-server/routes/settings-routes.js +0 -409
- package/dist/web-server/routes/settings-routes.js.map +0 -1
- package/dist/web-server/routes/variant-routes.d.ts +0 -8
- package/dist/web-server/routes/variant-routes.d.ts.map +0 -1
- package/dist/web-server/routes/variant-routes.js +0 -119
- package/dist/web-server/routes/variant-routes.js.map +0 -1
- package/dist/web-server/services/index.d.ts +0 -7
- package/dist/web-server/services/index.d.ts.map +0 -1
- package/dist/web-server/services/index.js +0 -21
- package/dist/web-server/services/index.js.map +0 -1
- package/dist/web-server/services/usage-aggregator.d.ts +0 -7
- package/dist/web-server/services/usage-aggregator.d.ts.map +0 -1
- package/dist/web-server/services/usage-aggregator.js +0 -23
- package/dist/web-server/services/usage-aggregator.js.map +0 -1
- package/dist/web-server/shared-routes.d.ts +0 -7
- package/dist/web-server/shared-routes.d.ts.map +0 -1
- package/dist/web-server/shared-routes.js +0 -168
- package/dist/web-server/shared-routes.js.map +0 -1
- package/dist/web-server/shutdown.d.ts +0 -14
- package/dist/web-server/shutdown.d.ts.map +0 -1
- package/dist/web-server/shutdown.js +0 -29
- package/dist/web-server/shutdown.js.map +0 -1
- package/dist/web-server/usage/aggregator.d.ts +0 -54
- package/dist/web-server/usage/aggregator.d.ts.map +0 -1
- package/dist/web-server/usage/aggregator.js +0 -470
- package/dist/web-server/usage/aggregator.js.map +0 -1
- package/dist/web-server/usage/data-aggregator.d.ts +0 -55
- package/dist/web-server/usage/data-aggregator.d.ts.map +0 -1
- package/dist/web-server/usage/data-aggregator.js +0 -391
- package/dist/web-server/usage/data-aggregator.js.map +0 -1
- package/dist/web-server/usage/disk-cache.d.ts +0 -46
- package/dist/web-server/usage/disk-cache.d.ts.map +0 -1
- package/dist/web-server/usage/disk-cache.js +0 -162
- package/dist/web-server/usage/disk-cache.js.map +0 -1
- package/dist/web-server/usage/handlers.d.ts +0 -50
- package/dist/web-server/usage/handlers.d.ts.map +0 -1
- package/dist/web-server/usage/handlers.js +0 -524
- package/dist/web-server/usage/handlers.js.map +0 -1
- package/dist/web-server/usage/index.d.ts +0 -12
- package/dist/web-server/usage/index.d.ts.map +0 -1
- package/dist/web-server/usage/index.js +0 -54
- package/dist/web-server/usage/index.js.map +0 -1
- package/dist/web-server/usage/routes.d.ts +0 -11
- package/dist/web-server/usage/routes.d.ts.map +0 -1
- package/dist/web-server/usage/routes.js +0 -37
- package/dist/web-server/usage/routes.js.map +0 -1
- package/dist/web-server/usage/types.d.ts +0 -119
- package/dist/web-server/usage/types.d.ts.map +0 -1
- package/dist/web-server/usage/types.js +0 -9
- package/dist/web-server/usage/types.js.map +0 -1
- package/dist/web-server/usage-disk-cache.d.ts +0 -7
- package/dist/web-server/usage-disk-cache.d.ts.map +0 -1
- package/dist/web-server/usage-disk-cache.js +0 -23
- package/dist/web-server/usage-disk-cache.js.map +0 -1
- package/dist/web-server/usage-routes.d.ts +0 -7
- package/dist/web-server/usage-routes.d.ts.map +0 -1
- package/dist/web-server/usage-routes.js +0 -14
- package/dist/web-server/usage-routes.js.map +0 -1
- package/dist/web-server/usage-types.d.ts +0 -7
- package/dist/web-server/usage-types.d.ts.map +0 -1
- package/dist/web-server/usage-types.js +0 -23
- package/dist/web-server/usage-types.js.map +0 -1
- package/dist/web-server/websocket.d.ts +0 -15
- package/dist/web-server/websocket.d.ts.map +0 -1
- package/dist/web-server/websocket.js +0 -162
- package/dist/web-server/websocket.js.map +0 -1
- /package/dist/{cliproxy → proxy}/tool-name-mapper.d.ts +0 -0
- /package/dist/{cliproxy → proxy}/tool-name-sanitizer.d.ts +0 -0
- /package/dist/{cliproxy → proxy}/tool-name-sanitizer.js +0 -0
- /package/dist/{cliproxy → proxy}/tool-sanitization-proxy.d.ts +0 -0
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* Unified Config Loader
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
* Provides fallback to legacy JSON format for backward compatibility.
|
|
5
|
+
* 精简版:加载和保存 YAML 配置,只保留核心功能。
|
|
7
6
|
*/
|
|
8
7
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
9
8
|
if (k2 === undefined) k2 = k;
|
|
@@ -29,133 +28,95 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
29
28
|
return result;
|
|
30
29
|
};
|
|
31
30
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
|
-
exports.
|
|
31
|
+
exports.getThinkingConfig = exports.getGlobalEnvConfig = exports.setDefaultProfile = exports.getDefaultProfile = exports.isUnifiedMode = exports.updateUnifiedConfig = exports.saveUnifiedConfig = exports.loadOrCreateUnifiedConfig = exports.loadUnifiedConfig = exports.getConfigFormat = exports.hasLegacyConfig = exports.hasUnifiedConfig = exports.getConfigJsonPath = exports.getConfigYamlPath = void 0;
|
|
33
32
|
const fs = __importStar(require("fs"));
|
|
34
33
|
const path = __importStar(require("path"));
|
|
35
34
|
const yaml = __importStar(require("js-yaml"));
|
|
36
35
|
const config_manager_1 = require("../utils/config-manager");
|
|
37
36
|
const unified_config_types_1 = require("./unified-config-types");
|
|
38
|
-
const feature_flags_1 = require("./feature-flags");
|
|
39
37
|
const CONFIG_YAML = 'config.yaml';
|
|
40
38
|
const CONFIG_JSON = 'config.json';
|
|
41
39
|
const CONFIG_LOCK = 'config.yaml.lock';
|
|
42
|
-
const LOCK_STALE_MS = 5000;
|
|
43
|
-
/**
|
|
44
|
-
* Get path to unified config.yaml
|
|
45
|
-
*/
|
|
40
|
+
const LOCK_STALE_MS = 5000;
|
|
46
41
|
function getConfigYamlPath() {
|
|
47
42
|
return path.join((0, config_manager_1.getCcsDir)(), CONFIG_YAML);
|
|
48
43
|
}
|
|
49
44
|
exports.getConfigYamlPath = getConfigYamlPath;
|
|
50
|
-
/**
|
|
51
|
-
* Get path to legacy config.json
|
|
52
|
-
*/
|
|
53
45
|
function getConfigJsonPath() {
|
|
54
46
|
return path.join((0, config_manager_1.getCcsDir)(), CONFIG_JSON);
|
|
55
47
|
}
|
|
56
48
|
exports.getConfigJsonPath = getConfigJsonPath;
|
|
57
|
-
/**
|
|
58
|
-
* Get path to config lockfile
|
|
59
|
-
*/
|
|
60
49
|
function getLockFilePath() {
|
|
61
50
|
return path.join((0, config_manager_1.getCcsDir)(), CONFIG_LOCK);
|
|
62
51
|
}
|
|
63
|
-
/**
|
|
64
|
-
* Acquire lockfile for config write operations.
|
|
65
|
-
* Returns true if lock acquired, false if already locked by another process.
|
|
66
|
-
* Cleans up stale locks (older than LOCK_STALE_MS).
|
|
67
|
-
*/
|
|
68
52
|
function acquireLock() {
|
|
69
53
|
const lockPath = getLockFilePath();
|
|
70
54
|
const lockData = `${process.pid}\n${Date.now()}`;
|
|
71
55
|
try {
|
|
72
|
-
//
|
|
73
|
-
|
|
56
|
+
// 尝试原子创建锁文件(wx = 排他写入,文件已存在则失败)
|
|
57
|
+
const fd = fs.openSync(lockPath, 'wx', 0o600);
|
|
58
|
+
fs.writeSync(fd, lockData);
|
|
59
|
+
fs.closeSync(fd);
|
|
60
|
+
return true;
|
|
61
|
+
}
|
|
62
|
+
catch (createError) {
|
|
63
|
+
// 文件已存在,检查是否过期
|
|
64
|
+
try {
|
|
74
65
|
const content = fs.readFileSync(lockPath, 'utf8');
|
|
75
66
|
const [pidStr, timestampStr] = content.trim().split('\n');
|
|
76
67
|
const timestamp = parseInt(timestampStr, 10);
|
|
77
|
-
// Check if lock is stale
|
|
78
68
|
if (Date.now() - timestamp > LOCK_STALE_MS) {
|
|
79
|
-
// Stale lock - remove and acquire
|
|
80
69
|
fs.unlinkSync(lockPath);
|
|
70
|
+
return acquireLock();
|
|
81
71
|
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
// Process doesn't exist - remove stale lock
|
|
91
|
-
fs.unlinkSync(lockPath);
|
|
92
|
-
}
|
|
72
|
+
// 检查持锁进程是否存活
|
|
73
|
+
try {
|
|
74
|
+
process.kill(parseInt(pidStr, 10), 0);
|
|
75
|
+
return false; // 进程存活,锁有效
|
|
76
|
+
}
|
|
77
|
+
catch {
|
|
78
|
+
fs.unlinkSync(lockPath);
|
|
79
|
+
return acquireLock();
|
|
93
80
|
}
|
|
94
81
|
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
}
|
|
99
|
-
catch {
|
|
100
|
-
// Lock acquisition failed
|
|
101
|
-
return false;
|
|
82
|
+
catch {
|
|
83
|
+
return false;
|
|
84
|
+
}
|
|
102
85
|
}
|
|
103
86
|
}
|
|
104
|
-
/**
|
|
105
|
-
* Release lockfile after config write operation.
|
|
106
|
-
*/
|
|
107
87
|
function releaseLock() {
|
|
108
88
|
const lockPath = getLockFilePath();
|
|
109
89
|
try {
|
|
110
|
-
if (fs.existsSync(lockPath))
|
|
90
|
+
if (fs.existsSync(lockPath))
|
|
111
91
|
fs.unlinkSync(lockPath);
|
|
112
|
-
}
|
|
113
92
|
}
|
|
114
93
|
catch {
|
|
115
|
-
|
|
94
|
+
/* ignore */
|
|
116
95
|
}
|
|
117
96
|
}
|
|
118
|
-
/**
|
|
119
|
-
* Check if unified config.yaml exists
|
|
120
|
-
*/
|
|
121
97
|
function hasUnifiedConfig() {
|
|
122
98
|
return fs.existsSync(getConfigYamlPath());
|
|
123
99
|
}
|
|
124
100
|
exports.hasUnifiedConfig = hasUnifiedConfig;
|
|
125
|
-
/**
|
|
126
|
-
* Check if legacy config.json exists
|
|
127
|
-
*/
|
|
128
101
|
function hasLegacyConfig() {
|
|
129
102
|
return fs.existsSync(getConfigJsonPath());
|
|
130
103
|
}
|
|
131
104
|
exports.hasLegacyConfig = hasLegacyConfig;
|
|
132
|
-
/**
|
|
133
|
-
* Determine which config format is active.
|
|
134
|
-
* Returns 'yaml' if unified config exists or is enabled,
|
|
135
|
-
* 'json' if only legacy config exists,
|
|
136
|
-
* 'none' if no config exists.
|
|
137
|
-
*/
|
|
138
105
|
function getConfigFormat() {
|
|
139
106
|
if (hasUnifiedConfig())
|
|
140
107
|
return 'yaml';
|
|
141
|
-
if ((0, feature_flags_1.isUnifiedConfigEnabled)())
|
|
142
|
-
return 'yaml';
|
|
143
108
|
if (hasLegacyConfig())
|
|
144
109
|
return 'json';
|
|
145
110
|
return 'none';
|
|
146
111
|
}
|
|
147
112
|
exports.getConfigFormat = getConfigFormat;
|
|
148
113
|
/**
|
|
149
|
-
*
|
|
150
|
-
* Returns null if file doesn't exist or format check fails.
|
|
151
|
-
* Auto-upgrades config if version is outdated (regenerates comments).
|
|
114
|
+
* 加载 unified config。文件不存在或格式错误返回 null。
|
|
152
115
|
*/
|
|
153
116
|
function loadUnifiedConfig() {
|
|
154
117
|
const yamlPath = getConfigYamlPath();
|
|
155
|
-
|
|
156
|
-
if (!fs.existsSync(yamlPath)) {
|
|
118
|
+
if (!fs.existsSync(yamlPath))
|
|
157
119
|
return null;
|
|
158
|
-
}
|
|
159
120
|
try {
|
|
160
121
|
const content = fs.readFileSync(yamlPath, 'utf8');
|
|
161
122
|
const parsed = yaml.load(content);
|
|
@@ -163,35 +124,25 @@ function loadUnifiedConfig() {
|
|
|
163
124
|
console.error(`[!] Invalid config format in ${yamlPath}`);
|
|
164
125
|
return null;
|
|
165
126
|
}
|
|
166
|
-
//
|
|
127
|
+
// 版本升级
|
|
167
128
|
if ((parsed.version ?? 1) < unified_config_types_1.UNIFIED_CONFIG_VERSION) {
|
|
168
|
-
// Merge with defaults to add new fields
|
|
169
129
|
const upgraded = mergeWithDefaults(parsed);
|
|
170
130
|
upgraded.version = unified_config_types_1.UNIFIED_CONFIG_VERSION;
|
|
171
131
|
try {
|
|
172
132
|
saveUnifiedConfig(upgraded);
|
|
173
|
-
if (process.env.CCS_DEBUG) {
|
|
174
|
-
console.error(`[i] Config upgraded to v${unified_config_types_1.UNIFIED_CONFIG_VERSION}`);
|
|
175
|
-
}
|
|
176
133
|
return upgraded;
|
|
177
134
|
}
|
|
178
|
-
catch
|
|
179
|
-
|
|
180
|
-
// Continue using the upgraded version in-memory even if save fails
|
|
135
|
+
catch {
|
|
136
|
+
// 保存失败也返回内存中的升级版本
|
|
181
137
|
}
|
|
182
138
|
}
|
|
183
139
|
return parsed;
|
|
184
140
|
}
|
|
185
141
|
catch (err) {
|
|
186
|
-
// U3: Provide better context for YAML syntax errors
|
|
187
142
|
if (err instanceof yaml.YAMLException) {
|
|
188
143
|
const mark = err.mark;
|
|
189
144
|
console.error(`[X] YAML syntax error in ${yamlPath}:`);
|
|
190
145
|
console.error(` Line ${(mark?.line ?? 0) + 1}, Column ${(mark?.column ?? 0) + 1}: ${err.reason || 'Invalid syntax'}`);
|
|
191
|
-
if (mark?.snippet) {
|
|
192
|
-
console.error(` ${mark.snippet}`);
|
|
193
|
-
}
|
|
194
|
-
console.error(` Tip: Check for missing colons, incorrect indentation, or unquoted special characters.`);
|
|
195
146
|
}
|
|
196
147
|
else {
|
|
197
148
|
const error = err instanceof Error ? err.message : 'Unknown error';
|
|
@@ -201,103 +152,21 @@ function loadUnifiedConfig() {
|
|
|
201
152
|
}
|
|
202
153
|
}
|
|
203
154
|
exports.loadUnifiedConfig = loadUnifiedConfig;
|
|
204
|
-
/**
|
|
205
|
-
* Merge partial config with defaults.
|
|
206
|
-
* Preserves existing data while filling in missing sections.
|
|
207
|
-
*/
|
|
208
155
|
function mergeWithDefaults(partial) {
|
|
209
156
|
const defaults = (0, unified_config_types_1.createEmptyUnifiedConfig)();
|
|
210
157
|
return {
|
|
211
158
|
version: partial.version ?? defaults.version,
|
|
212
159
|
setup_completed: partial.setup_completed,
|
|
213
160
|
default: partial.default ?? defaults.default,
|
|
214
|
-
accounts: partial.accounts ?? defaults.accounts,
|
|
215
161
|
profiles: partial.profiles ?? defaults.profiles,
|
|
216
|
-
cliproxy: {
|
|
217
|
-
oauth_accounts: partial.cliproxy?.oauth_accounts ?? defaults.cliproxy.oauth_accounts,
|
|
218
|
-
providers: defaults.cliproxy.providers, // Always use defaults for providers
|
|
219
|
-
variants: partial.cliproxy?.variants ?? defaults.cliproxy.variants,
|
|
220
|
-
logging: {
|
|
221
|
-
enabled: partial.cliproxy?.logging?.enabled ?? defaults.cliproxy.logging?.enabled ?? false,
|
|
222
|
-
request_log: partial.cliproxy?.logging?.request_log ?? defaults.cliproxy.logging?.request_log ?? false,
|
|
223
|
-
},
|
|
224
|
-
// Auth config - preserve user values, no defaults (uses constants as fallback)
|
|
225
|
-
auth: partial.cliproxy?.auth,
|
|
226
|
-
// Backend selection - validate and preserve user choice (original vs plus)
|
|
227
|
-
backend: partial.cliproxy?.backend === 'original' || partial.cliproxy?.backend === 'plus'
|
|
228
|
-
? partial.cliproxy.backend
|
|
229
|
-
: undefined, // Invalid values become undefined (defaults to 'plus' at runtime)
|
|
230
|
-
// Auto-sync - default to true
|
|
231
|
-
auto_sync: partial.cliproxy?.auto_sync ?? defaults.cliproxy.auto_sync ?? true,
|
|
232
|
-
},
|
|
233
162
|
preferences: {
|
|
234
163
|
...defaults.preferences,
|
|
235
164
|
...partial.preferences,
|
|
236
165
|
},
|
|
237
|
-
// Copilot config - strictly opt-in, merge with defaults
|
|
238
|
-
copilot: {
|
|
239
|
-
enabled: partial.copilot?.enabled ?? unified_config_types_1.DEFAULT_COPILOT_CONFIG.enabled,
|
|
240
|
-
auto_start: partial.copilot?.auto_start ?? unified_config_types_1.DEFAULT_COPILOT_CONFIG.auto_start,
|
|
241
|
-
port: partial.copilot?.port ?? unified_config_types_1.DEFAULT_COPILOT_CONFIG.port,
|
|
242
|
-
account_type: partial.copilot?.account_type ?? unified_config_types_1.DEFAULT_COPILOT_CONFIG.account_type,
|
|
243
|
-
rate_limit: partial.copilot?.rate_limit ?? unified_config_types_1.DEFAULT_COPILOT_CONFIG.rate_limit,
|
|
244
|
-
wait_on_limit: partial.copilot?.wait_on_limit ?? unified_config_types_1.DEFAULT_COPILOT_CONFIG.wait_on_limit,
|
|
245
|
-
model: partial.copilot?.model ?? unified_config_types_1.DEFAULT_COPILOT_CONFIG.model,
|
|
246
|
-
},
|
|
247
|
-
// Global env - injected into all non-Claude subscription profiles
|
|
248
166
|
global_env: {
|
|
249
167
|
enabled: partial.global_env?.enabled ?? true,
|
|
250
168
|
env: partial.global_env?.env ?? { ...unified_config_types_1.DEFAULT_GLOBAL_ENV },
|
|
251
169
|
},
|
|
252
|
-
// CLIProxy server config - remote/local CLIProxyAPI settings
|
|
253
|
-
cliproxy_server: {
|
|
254
|
-
remote: {
|
|
255
|
-
enabled: partial.cliproxy_server?.remote?.enabled ?? unified_config_types_1.DEFAULT_CLIPROXY_SERVER_CONFIG.remote.enabled,
|
|
256
|
-
host: partial.cliproxy_server?.remote?.host ?? unified_config_types_1.DEFAULT_CLIPROXY_SERVER_CONFIG.remote.host,
|
|
257
|
-
// Port is optional - undefined means use protocol default (443 for HTTPS, 8317 for HTTP)
|
|
258
|
-
port: partial.cliproxy_server?.remote?.port,
|
|
259
|
-
protocol: partial.cliproxy_server?.remote?.protocol ??
|
|
260
|
-
unified_config_types_1.DEFAULT_CLIPROXY_SERVER_CONFIG.remote.protocol,
|
|
261
|
-
auth_token: partial.cliproxy_server?.remote?.auth_token ??
|
|
262
|
-
unified_config_types_1.DEFAULT_CLIPROXY_SERVER_CONFIG.remote.auth_token,
|
|
263
|
-
// management_key is optional - falls back to auth_token when not set
|
|
264
|
-
management_key: partial.cliproxy_server?.remote?.management_key,
|
|
265
|
-
},
|
|
266
|
-
fallback: {
|
|
267
|
-
enabled: partial.cliproxy_server?.fallback?.enabled ??
|
|
268
|
-
unified_config_types_1.DEFAULT_CLIPROXY_SERVER_CONFIG.fallback.enabled,
|
|
269
|
-
auto_start: partial.cliproxy_server?.fallback?.auto_start ??
|
|
270
|
-
unified_config_types_1.DEFAULT_CLIPROXY_SERVER_CONFIG.fallback.auto_start,
|
|
271
|
-
},
|
|
272
|
-
local: {
|
|
273
|
-
port: partial.cliproxy_server?.local?.port ?? unified_config_types_1.DEFAULT_CLIPROXY_SERVER_CONFIG.local.port,
|
|
274
|
-
auto_start: partial.cliproxy_server?.local?.auto_start ??
|
|
275
|
-
unified_config_types_1.DEFAULT_CLIPROXY_SERVER_CONFIG.local.auto_start,
|
|
276
|
-
},
|
|
277
|
-
},
|
|
278
|
-
// Quota management config - hybrid auto+manual account selection
|
|
279
|
-
quota_management: {
|
|
280
|
-
mode: partial.quota_management?.mode ?? unified_config_types_1.DEFAULT_QUOTA_MANAGEMENT_CONFIG.mode,
|
|
281
|
-
auto: {
|
|
282
|
-
preflight_check: partial.quota_management?.auto?.preflight_check ??
|
|
283
|
-
unified_config_types_1.DEFAULT_QUOTA_MANAGEMENT_CONFIG.auto.preflight_check,
|
|
284
|
-
exhaustion_threshold: partial.quota_management?.auto?.exhaustion_threshold ??
|
|
285
|
-
unified_config_types_1.DEFAULT_QUOTA_MANAGEMENT_CONFIG.auto.exhaustion_threshold,
|
|
286
|
-
tier_priority: partial.quota_management?.auto?.tier_priority ??
|
|
287
|
-
unified_config_types_1.DEFAULT_QUOTA_MANAGEMENT_CONFIG.auto.tier_priority,
|
|
288
|
-
cooldown_minutes: partial.quota_management?.auto?.cooldown_minutes ??
|
|
289
|
-
unified_config_types_1.DEFAULT_QUOTA_MANAGEMENT_CONFIG.auto.cooldown_minutes,
|
|
290
|
-
},
|
|
291
|
-
manual: {
|
|
292
|
-
paused_accounts: partial.quota_management?.manual?.paused_accounts ??
|
|
293
|
-
unified_config_types_1.DEFAULT_QUOTA_MANAGEMENT_CONFIG.manual.paused_accounts,
|
|
294
|
-
forced_default: partial.quota_management?.manual?.forced_default ??
|
|
295
|
-
unified_config_types_1.DEFAULT_QUOTA_MANAGEMENT_CONFIG.manual.forced_default,
|
|
296
|
-
tier_lock: partial.quota_management?.manual?.tier_lock ??
|
|
297
|
-
unified_config_types_1.DEFAULT_QUOTA_MANAGEMENT_CONFIG.manual.tier_lock,
|
|
298
|
-
},
|
|
299
|
-
},
|
|
300
|
-
// Thinking config - auto/manual/off control for reasoning budget
|
|
301
170
|
thinking: {
|
|
302
171
|
mode: partial.thinking?.mode ?? unified_config_types_1.DEFAULT_THINKING_CONFIG.mode,
|
|
303
172
|
override: partial.thinking?.override,
|
|
@@ -309,103 +178,40 @@ function mergeWithDefaults(partial) {
|
|
|
309
178
|
provider_overrides: partial.thinking?.provider_overrides,
|
|
310
179
|
show_warnings: partial.thinking?.show_warnings ?? unified_config_types_1.DEFAULT_THINKING_CONFIG.show_warnings,
|
|
311
180
|
},
|
|
312
|
-
// Dashboard auth config - disabled by default
|
|
313
|
-
dashboard_auth: {
|
|
314
|
-
enabled: partial.dashboard_auth?.enabled ?? unified_config_types_1.DEFAULT_DASHBOARD_AUTH_CONFIG.enabled,
|
|
315
|
-
username: partial.dashboard_auth?.username ?? unified_config_types_1.DEFAULT_DASHBOARD_AUTH_CONFIG.username,
|
|
316
|
-
password_hash: partial.dashboard_auth?.password_hash ?? unified_config_types_1.DEFAULT_DASHBOARD_AUTH_CONFIG.password_hash,
|
|
317
|
-
session_timeout_hours: partial.dashboard_auth?.session_timeout_hours ??
|
|
318
|
-
unified_config_types_1.DEFAULT_DASHBOARD_AUTH_CONFIG.session_timeout_hours,
|
|
319
|
-
},
|
|
320
|
-
// Image analysis config - enabled by default for CLIProxy providers
|
|
321
|
-
image_analysis: {
|
|
322
|
-
enabled: partial.image_analysis?.enabled ?? unified_config_types_1.DEFAULT_IMAGE_ANALYSIS_CONFIG.enabled,
|
|
323
|
-
timeout: partial.image_analysis?.timeout ?? unified_config_types_1.DEFAULT_IMAGE_ANALYSIS_CONFIG.timeout,
|
|
324
|
-
provider_models: partial.image_analysis?.provider_models ?? unified_config_types_1.DEFAULT_IMAGE_ANALYSIS_CONFIG.provider_models,
|
|
325
|
-
},
|
|
326
|
-
// Router config - scenario-based routing for sub-agents
|
|
327
|
-
router: partial.router,
|
|
328
181
|
};
|
|
329
182
|
}
|
|
330
|
-
/**
|
|
331
|
-
* Load config, preferring YAML if available, falling back to creating empty config.
|
|
332
|
-
* Merges with defaults to ensure all sections exist.
|
|
333
|
-
*/
|
|
334
183
|
function loadOrCreateUnifiedConfig() {
|
|
335
184
|
const existing = loadUnifiedConfig();
|
|
336
|
-
if (existing)
|
|
337
|
-
// Merge with defaults to fill any missing sections
|
|
185
|
+
if (existing)
|
|
338
186
|
return mergeWithDefaults(existing);
|
|
339
|
-
|
|
340
|
-
// Create empty config
|
|
341
|
-
const config = (0, unified_config_types_1.createEmptyUnifiedConfig)();
|
|
342
|
-
return config;
|
|
187
|
+
return (0, unified_config_types_1.createEmptyUnifiedConfig)();
|
|
343
188
|
}
|
|
344
189
|
exports.loadOrCreateUnifiedConfig = loadOrCreateUnifiedConfig;
|
|
345
|
-
/**
|
|
346
|
-
* Generate YAML header with helpful comments.
|
|
347
|
-
*/
|
|
348
190
|
function generateYamlHeader() {
|
|
349
|
-
return `# CCS Unified Configuration
|
|
350
|
-
# Docs: https://github.com/kaitranntt/ccs
|
|
191
|
+
return `# CCS Unified Configuration
|
|
192
|
+
# Docs: https://github.com/kaitranntt/ccs
|
|
351
193
|
`;
|
|
352
194
|
}
|
|
353
|
-
/**
|
|
354
|
-
* Generate YAML content with section comments for better readability.
|
|
355
|
-
*/
|
|
356
195
|
function generateYamlWithComments(config) {
|
|
357
196
|
const lines = [];
|
|
358
|
-
// Version
|
|
359
197
|
lines.push(`version: ${config.version}`);
|
|
360
198
|
if (config.setup_completed !== undefined) {
|
|
361
199
|
lines.push(`setup_completed: ${config.setup_completed}`);
|
|
362
200
|
}
|
|
363
201
|
lines.push('');
|
|
364
|
-
// Default
|
|
365
202
|
if (config.default) {
|
|
366
203
|
lines.push(`# Default profile used when running 'ccs' without arguments`);
|
|
367
204
|
lines.push(`default: "${config.default}"`);
|
|
368
205
|
lines.push('');
|
|
369
206
|
}
|
|
370
|
-
//
|
|
371
|
-
lines.push('# ----------------------------------------------------------------------------');
|
|
372
|
-
lines.push('# Accounts: Isolated Claude instances (each with separate auth/sessions)');
|
|
373
|
-
lines.push('# Manage with: ccs auth add <name>, ccs auth list, ccs auth remove <name>');
|
|
374
|
-
lines.push('# ----------------------------------------------------------------------------');
|
|
375
|
-
lines.push(yaml.dump({ accounts: config.accounts }, { indent: 2, lineWidth: -1, quotingType: '"' }).trim());
|
|
376
|
-
lines.push('');
|
|
377
|
-
// Profiles section
|
|
207
|
+
// Profiles
|
|
378
208
|
lines.push('# ----------------------------------------------------------------------------');
|
|
379
209
|
lines.push('# Profiles: API-based providers (GLM, GLMT, Kimi, custom endpoints)');
|
|
380
210
|
lines.push('# Each profile points to a *.settings.json file containing env vars.');
|
|
381
|
-
lines.push('# Edit the settings file directly to customize (ANTHROPIC_MAX_TOKENS, etc.)');
|
|
382
211
|
lines.push('# ----------------------------------------------------------------------------');
|
|
383
212
|
lines.push(yaml.dump({ profiles: config.profiles }, { indent: 2, lineWidth: -1, quotingType: '"' }).trim());
|
|
384
213
|
lines.push('');
|
|
385
|
-
//
|
|
386
|
-
lines.push('# ----------------------------------------------------------------------------');
|
|
387
|
-
lines.push('# CLIProxy: OAuth-based providers (gemini, codex, agy, qwen, iflow)');
|
|
388
|
-
lines.push('# Each variant can reference a *.settings.json file for custom env vars.');
|
|
389
|
-
lines.push('# Edit the settings file directly to customize model or other settings.');
|
|
390
|
-
lines.push('# ----------------------------------------------------------------------------');
|
|
391
|
-
lines.push(yaml.dump({ cliproxy: config.cliproxy }, { indent: 2, lineWidth: -1, quotingType: '"' }).trim());
|
|
392
|
-
lines.push('');
|
|
393
|
-
// CLIProxy Server section (remote proxy configuration) - placed right after cliproxy
|
|
394
|
-
if (config.cliproxy_server) {
|
|
395
|
-
lines.push('# ----------------------------------------------------------------------------');
|
|
396
|
-
lines.push('# CLIProxy Server: Remote proxy connection settings');
|
|
397
|
-
lines.push('# Configure via Dashboard (`ccs config`) > Proxy tab.');
|
|
398
|
-
lines.push('#');
|
|
399
|
-
lines.push('# remote: Connect to a remote CLIProxyAPI instance');
|
|
400
|
-
lines.push('# fallback: Use local proxy if remote is unreachable');
|
|
401
|
-
lines.push('# local: Local proxy settings (port, auto-start)');
|
|
402
|
-
lines.push('# ----------------------------------------------------------------------------');
|
|
403
|
-
lines.push(yaml
|
|
404
|
-
.dump({ cliproxy_server: config.cliproxy_server }, { indent: 2, lineWidth: -1, quotingType: '"' })
|
|
405
|
-
.trim());
|
|
406
|
-
lines.push('');
|
|
407
|
-
}
|
|
408
|
-
// Preferences section
|
|
214
|
+
// Preferences
|
|
409
215
|
lines.push('# ----------------------------------------------------------------------------');
|
|
410
216
|
lines.push('# Preferences: User settings');
|
|
411
217
|
lines.push('# ----------------------------------------------------------------------------');
|
|
@@ -413,117 +219,32 @@ function generateYamlWithComments(config) {
|
|
|
413
219
|
.dump({ preferences: config.preferences }, { indent: 2, lineWidth: -1, quotingType: '"' })
|
|
414
220
|
.trim());
|
|
415
221
|
lines.push('');
|
|
416
|
-
//
|
|
417
|
-
if (config.copilot) {
|
|
418
|
-
lines.push('# ----------------------------------------------------------------------------');
|
|
419
|
-
lines.push('# Copilot: GitHub Copilot API proxy (via copilot-api)');
|
|
420
|
-
lines.push('# Uses your existing GitHub Copilot subscription with Claude Code.');
|
|
421
|
-
lines.push('#');
|
|
422
|
-
lines.push('# !! DISCLAIMER - USE AT YOUR OWN RISK !!');
|
|
423
|
-
lines.push('# This uses an UNOFFICIAL reverse-engineered API.');
|
|
424
|
-
lines.push('# Excessive usage may trigger GitHub account restrictions.');
|
|
425
|
-
lines.push('# CCS provides NO WARRANTY and accepts NO RESPONSIBILITY for consequences.');
|
|
426
|
-
lines.push('#');
|
|
427
|
-
lines.push('# Setup: npx copilot-api auth (authenticate with GitHub)');
|
|
428
|
-
lines.push('# Usage: ccs copilot (switch to copilot profile)');
|
|
429
|
-
lines.push('#');
|
|
430
|
-
lines.push('# Models: claude-sonnet-4.5, claude-opus-4.5, gpt-5.1, gemini-2.5-pro');
|
|
431
|
-
lines.push('# Account types: individual, business, enterprise');
|
|
432
|
-
lines.push('# ----------------------------------------------------------------------------');
|
|
433
|
-
lines.push(yaml.dump({ copilot: config.copilot }, { indent: 2, lineWidth: -1, quotingType: '"' }).trim());
|
|
434
|
-
lines.push('');
|
|
435
|
-
}
|
|
436
|
-
// Global env section
|
|
222
|
+
// Global env
|
|
437
223
|
if (config.global_env) {
|
|
438
224
|
lines.push('# ----------------------------------------------------------------------------');
|
|
439
225
|
lines.push('# Global Environment Variables: Injected into all non-Claude subscription profiles');
|
|
440
|
-
lines.push('# These env vars disable telemetry/reporting for third-party providers.');
|
|
441
|
-
lines.push('# Configure via Dashboard (`ccs config`) > Global Env tab.');
|
|
442
|
-
lines.push('#');
|
|
443
|
-
lines.push('# Default variables:');
|
|
444
|
-
lines.push('# DISABLE_BUG_COMMAND: Disables /bug command (not supported by proxy)');
|
|
445
|
-
lines.push('# DISABLE_ERROR_REPORTING: Disables error reporting to Anthropic');
|
|
446
|
-
lines.push('# DISABLE_TELEMETRY: Disables usage telemetry');
|
|
447
226
|
lines.push('# ----------------------------------------------------------------------------');
|
|
448
227
|
lines.push(yaml
|
|
449
228
|
.dump({ global_env: config.global_env }, { indent: 2, lineWidth: -1, quotingType: '"' })
|
|
450
229
|
.trim());
|
|
451
230
|
lines.push('');
|
|
452
231
|
}
|
|
453
|
-
// Thinking
|
|
232
|
+
// Thinking
|
|
454
233
|
if (config.thinking) {
|
|
455
234
|
lines.push('# ----------------------------------------------------------------------------');
|
|
456
235
|
lines.push('# Thinking: Extended thinking/reasoning budget configuration');
|
|
457
|
-
lines.push('# Controls reasoning depth for supported providers (agy, gemini, codex).');
|
|
458
|
-
lines.push('#');
|
|
459
236
|
lines.push('# Modes: auto (use tier_defaults), off (disable), manual (--thinking flag only)');
|
|
460
|
-
lines.push('# Levels: minimal (512), low (1K), medium (8K), high (24K), xhigh (32K), auto');
|
|
461
|
-
lines.push('# Override: Set global override value (number or level name)');
|
|
462
|
-
lines.push('# Provider overrides: Per-provider tier defaults');
|
|
463
237
|
lines.push('# ----------------------------------------------------------------------------');
|
|
464
238
|
lines.push(yaml
|
|
465
239
|
.dump({ thinking: config.thinking }, { indent: 2, lineWidth: -1, quotingType: '"' })
|
|
466
240
|
.trim());
|
|
467
241
|
lines.push('');
|
|
468
242
|
}
|
|
469
|
-
// Dashboard auth section (only if configured)
|
|
470
|
-
if (config.dashboard_auth?.enabled) {
|
|
471
|
-
lines.push('# ----------------------------------------------------------------------------');
|
|
472
|
-
lines.push('# Dashboard Auth: Optional login protection for CCS dashboard');
|
|
473
|
-
lines.push('# Generate password hash: npx bcrypt-cli hash "your-password"');
|
|
474
|
-
lines.push('# ENV override: CCS_DASHBOARD_AUTH_ENABLED, CCS_DASHBOARD_USERNAME, CCS_DASHBOARD_PASSWORD_HASH');
|
|
475
|
-
lines.push('# ----------------------------------------------------------------------------');
|
|
476
|
-
lines.push(yaml
|
|
477
|
-
.dump({ dashboard_auth: config.dashboard_auth }, { indent: 2, lineWidth: -1, quotingType: '"' })
|
|
478
|
-
.trim());
|
|
479
|
-
lines.push('');
|
|
480
|
-
}
|
|
481
|
-
// Image analysis section
|
|
482
|
-
if (config.image_analysis) {
|
|
483
|
-
lines.push('# ----------------------------------------------------------------------------');
|
|
484
|
-
lines.push('# Image Analysis: Vision-based analysis for images and PDFs');
|
|
485
|
-
lines.push('# Routes Read tool requests for images/PDFs through CLIProxy vision API.');
|
|
486
|
-
lines.push('#');
|
|
487
|
-
lines.push('# When enabled: Image files trigger vision analysis instead of raw file read');
|
|
488
|
-
lines.push('# Provider models: Vision model used for each CLIProxy provider');
|
|
489
|
-
lines.push('# Timeout: Maximum seconds to wait for analysis (10-600)');
|
|
490
|
-
lines.push('#');
|
|
491
|
-
lines.push('# Supported formats: .jpg, .jpeg, .png, .gif, .webp, .heic, .bmp, .tiff, .pdf');
|
|
492
|
-
lines.push('# Configure via: ccs config image-analysis');
|
|
493
|
-
lines.push('# ----------------------------------------------------------------------------');
|
|
494
|
-
lines.push(yaml
|
|
495
|
-
.dump({ image_analysis: config.image_analysis }, { indent: 2, lineWidth: -1, quotingType: '"' })
|
|
496
|
-
.trim());
|
|
497
|
-
lines.push('');
|
|
498
|
-
}
|
|
499
|
-
// Router section (scenario routing for sub-agents)
|
|
500
|
-
if (config.router) {
|
|
501
|
-
lines.push('# ----------------------------------------------------------------------------');
|
|
502
|
-
lines.push('# Router: Scenario-based routing for Claude sub-agents');
|
|
503
|
-
lines.push('# Routes different request types (background, think) to profiles.');
|
|
504
|
-
lines.push('#');
|
|
505
|
-
lines.push('# Scenarios:');
|
|
506
|
-
lines.push('# default - Fallback for unmatched requests');
|
|
507
|
-
lines.push('# background - Claude background/haiku sub-agents');
|
|
508
|
-
lines.push('# think - Extended thinking requests');
|
|
509
|
-
lines.push('# longContext - Requests exceeding token threshold');
|
|
510
|
-
lines.push('#');
|
|
511
|
-
lines.push('# Configure via: ccs router set <scenario> <profile>');
|
|
512
|
-
lines.push('# ----------------------------------------------------------------------------');
|
|
513
|
-
lines.push(yaml.dump({ router: config.router }, { indent: 2, lineWidth: -1, quotingType: '"' }).trim());
|
|
514
|
-
lines.push('');
|
|
515
|
-
}
|
|
516
243
|
return lines.join('\n');
|
|
517
244
|
}
|
|
518
|
-
/**
|
|
519
|
-
* Save unified config to YAML file.
|
|
520
|
-
* Uses atomic write (temp file + rename) to prevent corruption.
|
|
521
|
-
* Uses lockfile to prevent concurrent writes.
|
|
522
|
-
*/
|
|
523
245
|
function saveUnifiedConfig(config) {
|
|
524
246
|
const yamlPath = getConfigYamlPath();
|
|
525
247
|
const dir = path.dirname(yamlPath);
|
|
526
|
-
// Acquire lock (retry for up to 1 second)
|
|
527
248
|
const maxRetries = 10;
|
|
528
249
|
const retryDelayMs = 100;
|
|
529
250
|
let lockAcquired = false;
|
|
@@ -532,41 +253,34 @@ function saveUnifiedConfig(config) {
|
|
|
532
253
|
lockAcquired = true;
|
|
533
254
|
break;
|
|
534
255
|
}
|
|
535
|
-
//
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, retryDelayMs);
|
|
256
|
+
// 同步忙等待,避免阻塞事件循环的 Atomics.wait
|
|
257
|
+
const waitUntil = Date.now() + retryDelayMs;
|
|
258
|
+
while (Date.now() < waitUntil) { /* spin */ }
|
|
539
259
|
}
|
|
540
260
|
if (!lockAcquired) {
|
|
541
261
|
throw new Error('Config file is locked by another process. Wait a moment and try again.');
|
|
542
262
|
}
|
|
543
263
|
try {
|
|
544
|
-
// Ensure directory exists
|
|
545
264
|
if (!fs.existsSync(dir)) {
|
|
546
265
|
fs.mkdirSync(dir, { recursive: true, mode: 0o700 });
|
|
547
266
|
}
|
|
548
|
-
// Ensure version is set
|
|
549
267
|
config.version = unified_config_types_1.UNIFIED_CONFIG_VERSION;
|
|
550
|
-
// Generate YAML with section comments
|
|
551
268
|
const yamlContent = generateYamlWithComments(config);
|
|
552
269
|
const content = generateYamlHeader() + yamlContent;
|
|
553
|
-
// Atomic write: write to temp file, then rename
|
|
554
270
|
const tempPath = `${yamlPath}.tmp.${process.pid}`;
|
|
555
271
|
try {
|
|
556
272
|
fs.writeFileSync(tempPath, content, { mode: 0o600 });
|
|
557
273
|
fs.renameSync(tempPath, yamlPath);
|
|
558
274
|
}
|
|
559
275
|
catch (error) {
|
|
560
|
-
// Clean up temp file on error
|
|
561
276
|
if (fs.existsSync(tempPath)) {
|
|
562
277
|
try {
|
|
563
278
|
fs.unlinkSync(tempPath);
|
|
564
279
|
}
|
|
565
280
|
catch {
|
|
566
|
-
|
|
281
|
+
/* ignore */
|
|
567
282
|
}
|
|
568
283
|
}
|
|
569
|
-
// Classify filesystem errors
|
|
570
284
|
const err = error;
|
|
571
285
|
if (err.code === 'ENOSPC') {
|
|
572
286
|
throw new Error('Disk full - cannot save config. Free up space and try again.');
|
|
@@ -578,15 +292,10 @@ function saveUnifiedConfig(config) {
|
|
|
578
292
|
}
|
|
579
293
|
}
|
|
580
294
|
finally {
|
|
581
|
-
// Always release lock
|
|
582
295
|
releaseLock();
|
|
583
296
|
}
|
|
584
297
|
}
|
|
585
298
|
exports.saveUnifiedConfig = saveUnifiedConfig;
|
|
586
|
-
/**
|
|
587
|
-
* Update unified config with partial data.
|
|
588
|
-
* Loads existing config, merges changes, and saves.
|
|
589
|
-
*/
|
|
590
299
|
function updateUnifiedConfig(updates) {
|
|
591
300
|
const config = loadOrCreateUnifiedConfig();
|
|
592
301
|
const updated = { ...config, ...updates };
|
|
@@ -594,19 +303,10 @@ function updateUnifiedConfig(updates) {
|
|
|
594
303
|
return updated;
|
|
595
304
|
}
|
|
596
305
|
exports.updateUnifiedConfig = updateUnifiedConfig;
|
|
597
|
-
/**
|
|
598
|
-
* Check if unified config mode is active.
|
|
599
|
-
* Returns true if config.yaml exists OR CCS_UNIFIED_CONFIG=1.
|
|
600
|
-
*
|
|
601
|
-
* Use this centralized function instead of duplicating the logic.
|
|
602
|
-
*/
|
|
603
306
|
function isUnifiedMode() {
|
|
604
|
-
return hasUnifiedConfig()
|
|
307
|
+
return hasUnifiedConfig();
|
|
605
308
|
}
|
|
606
309
|
exports.isUnifiedMode = isUnifiedMode;
|
|
607
|
-
/**
|
|
608
|
-
* Get or set default profile name.
|
|
609
|
-
*/
|
|
610
310
|
function getDefaultProfile() {
|
|
611
311
|
const config = loadUnifiedConfig();
|
|
612
312
|
return config?.default;
|
|
@@ -616,10 +316,6 @@ function setDefaultProfile(name) {
|
|
|
616
316
|
updateUnifiedConfig({ default: name });
|
|
617
317
|
}
|
|
618
318
|
exports.setDefaultProfile = setDefaultProfile;
|
|
619
|
-
/**
|
|
620
|
-
* Get global_env configuration.
|
|
621
|
-
* Returns defaults if not configured.
|
|
622
|
-
*/
|
|
623
319
|
function getGlobalEnvConfig() {
|
|
624
320
|
const config = loadOrCreateUnifiedConfig();
|
|
625
321
|
return {
|
|
@@ -628,16 +324,10 @@ function getGlobalEnvConfig() {
|
|
|
628
324
|
};
|
|
629
325
|
}
|
|
630
326
|
exports.getGlobalEnvConfig = getGlobalEnvConfig;
|
|
631
|
-
/**
|
|
632
|
-
* Get thinking configuration.
|
|
633
|
-
* Returns defaults if not configured.
|
|
634
|
-
*/
|
|
635
327
|
function getThinkingConfig() {
|
|
636
328
|
const config = loadOrCreateUnifiedConfig();
|
|
637
|
-
// W2: Check for invalid thinking config (e.g., thinking: true instead of object)
|
|
638
329
|
if (config.thinking !== undefined && typeof config.thinking !== 'object') {
|
|
639
330
|
console.warn(`[!] Invalid thinking config: expected object, got ${typeof config.thinking}. Using defaults.`);
|
|
640
|
-
console.warn(` Tip: Use 'thinking: { mode: auto }' instead of 'thinking: true'`);
|
|
641
331
|
return unified_config_types_1.DEFAULT_THINKING_CONFIG;
|
|
642
332
|
}
|
|
643
333
|
return {
|
|
@@ -653,37 +343,4 @@ function getThinkingConfig() {
|
|
|
653
343
|
};
|
|
654
344
|
}
|
|
655
345
|
exports.getThinkingConfig = getThinkingConfig;
|
|
656
|
-
/**
|
|
657
|
-
* Get dashboard_auth configuration with ENV var override.
|
|
658
|
-
* Priority: ENV vars > config.yaml > defaults
|
|
659
|
-
*/
|
|
660
|
-
function getDashboardAuthConfig() {
|
|
661
|
-
const config = loadOrCreateUnifiedConfig();
|
|
662
|
-
// ENV vars take precedence
|
|
663
|
-
const envEnabled = process.env.CCS_DASHBOARD_AUTH_ENABLED;
|
|
664
|
-
const envUsername = process.env.CCS_DASHBOARD_USERNAME;
|
|
665
|
-
const envPasswordHash = process.env.CCS_DASHBOARD_PASSWORD_HASH;
|
|
666
|
-
return {
|
|
667
|
-
enabled: envEnabled !== undefined
|
|
668
|
-
? envEnabled === 'true' || envEnabled === '1'
|
|
669
|
-
: (config.dashboard_auth?.enabled ?? false),
|
|
670
|
-
username: envUsername ?? config.dashboard_auth?.username ?? '',
|
|
671
|
-
password_hash: envPasswordHash ?? config.dashboard_auth?.password_hash ?? '',
|
|
672
|
-
session_timeout_hours: config.dashboard_auth?.session_timeout_hours ?? 24,
|
|
673
|
-
};
|
|
674
|
-
}
|
|
675
|
-
exports.getDashboardAuthConfig = getDashboardAuthConfig;
|
|
676
|
-
/**
|
|
677
|
-
* Get image_analysis configuration.
|
|
678
|
-
* Returns defaults if not configured.
|
|
679
|
-
*/
|
|
680
|
-
function getImageAnalysisConfig() {
|
|
681
|
-
const config = loadOrCreateUnifiedConfig();
|
|
682
|
-
return {
|
|
683
|
-
enabled: config.image_analysis?.enabled ?? unified_config_types_1.DEFAULT_IMAGE_ANALYSIS_CONFIG.enabled,
|
|
684
|
-
timeout: config.image_analysis?.timeout ?? unified_config_types_1.DEFAULT_IMAGE_ANALYSIS_CONFIG.timeout,
|
|
685
|
-
provider_models: config.image_analysis?.provider_models ?? unified_config_types_1.DEFAULT_IMAGE_ANALYSIS_CONFIG.provider_models,
|
|
686
|
-
};
|
|
687
|
-
}
|
|
688
|
-
exports.getImageAnalysisConfig = getImageAnalysisConfig;
|
|
689
346
|
//# sourceMappingURL=unified-config-loader.js.map
|