@jonnyhoo/ccs 1.1.1 → 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/.claude/skills/ccs-delegation/SKILL.md +7 -7
- package/.claude/skills/ccs-delegation/references/troubleshooting.md +20 -20
- package/config/base-codex.settings.json +3 -3
- 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 +1 -1
- package/dist/api/services/profile-writer.d.ts.map +1 -1
- package/dist/api/services/profile-writer.js +14 -11
- 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 +263 -451
- package/dist/ccs.js.map +1 -1
- package/dist/commands/api-command.d.ts.map +1 -1
- package/dist/commands/api-command.js +22 -21
- 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 -96
- package/dist/config/unified-config-loader.d.ts.map +1 -1
- package/dist/config/unified-config-loader.js +42 -474
- package/dist/config/unified-config-loader.js.map +1 -1
- package/dist/config/unified-config-types.d.ts +21 -489
- package/dist/config/unified-config-types.d.ts.map +1 -1
- package/dist/config/unified-config-types.js +8 -172
- package/dist/config/unified-config-types.js.map +1 -1
- package/dist/delegation/background-monitor.d.ts +80 -0
- package/dist/delegation/background-monitor.d.ts.map +1 -0
- package/dist/delegation/background-monitor.js +300 -0
- package/dist/delegation/background-monitor.js.map +1 -0
- package/dist/delegation/delegation-handler.d.ts +2 -1
- package/dist/delegation/delegation-handler.d.ts.map +1 -1
- package/dist/delegation/delegation-handler.js +48 -30
- package/dist/delegation/delegation-handler.js.map +1 -1
- package/dist/delegation/executor/types.d.ts +2 -0
- package/dist/delegation/executor/types.d.ts.map +1 -1
- package/dist/delegation/headless-executor.d.ts +3 -0
- package/dist/delegation/headless-executor.d.ts.map +1 -1
- package/dist/delegation/headless-executor.js +162 -14
- package/dist/delegation/headless-executor.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 +17 -1
- package/dist/proxy/anthropic-to-openai-proxy.d.ts.map +1 -0
- package/dist/proxy/anthropic-to-openai-proxy.js +1708 -0
- 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/{cliproxy → proxy}/tool-name-sanitizer.d.ts +17 -21
- package/dist/proxy/tool-name-sanitizer.d.ts.map +1 -0
- package/dist/{cliproxy → proxy}/tool-name-sanitizer.js +46 -33
- 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 +22 -2
- 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 +3 -9
- 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/background-redis-bridge.js +320 -0
- package/scripts/dev-install.sh +2 -1
- package/scripts/monitor-task.js +313 -0
- 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 -106
- package/dist/auth/profile-detector.d.ts.map +0 -1
- package/dist/auth/profile-detector.js +0 -431
- 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 +0 -856
- 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 -1228
- 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 -932
- 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 -247
- 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 -168
- 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/cliproxy-command.d.ts +0 -21
- package/dist/commands/cliproxy-command.d.ts.map +0 -1
- package/dist/commands/cliproxy-command.js +0 -1099
- package/dist/commands/cliproxy-command.js.map +0 -1
- package/dist/commands/cliproxy-sync-handler.d.ts +0 -19
- package/dist/commands/cliproxy-sync-handler.d.ts.map +0 -1
- package/dist/commands/cliproxy-sync-handler.js +0 -99
- package/dist/commands/cliproxy-sync-handler.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 -359
- package/dist/commands/help-command.js.map +0 -1
- package/dist/commands/index.d.ts +0 -18
- package/dist/commands/index.d.ts.map +0 -1
- package/dist/commands/index.js +0 -35
- 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 -62
- 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/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 -86
- package/dist/router/scenario-router.d.ts.map +0 -1
- package/dist/router/scenario-router.js +0 -178
- 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 -380
- 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/utils/websearch/gemini-cli.d.ts +0 -36
- package/dist/utils/websearch/gemini-cli.d.ts.map +0 -1
- package/dist/utils/websearch/gemini-cli.js +0 -132
- package/dist/utils/websearch/gemini-cli.js.map +0 -1
- package/dist/utils/websearch/grok-cli.d.ts +0 -26
- package/dist/utils/websearch/grok-cli.d.ts.map +0 -1
- package/dist/utils/websearch/grok-cli.js +0 -81
- package/dist/utils/websearch/grok-cli.js.map +0 -1
- package/dist/utils/websearch/hook-config.d.ts +0 -27
- package/dist/utils/websearch/hook-config.d.ts.map +0 -1
- package/dist/utils/websearch/hook-config.js +0 -280
- package/dist/utils/websearch/hook-config.js.map +0 -1
- package/dist/utils/websearch/hook-env.d.ts +0 -16
- package/dist/utils/websearch/hook-env.d.ts.map +0 -1
- package/dist/utils/websearch/hook-env.js +0 -62
- package/dist/utils/websearch/hook-env.js.map +0 -1
- package/dist/utils/websearch/hook-installer.d.ts +0 -30
- package/dist/utils/websearch/hook-installer.d.ts.map +0 -1
- package/dist/utils/websearch/hook-installer.js +0 -148
- package/dist/utils/websearch/hook-installer.js.map +0 -1
- package/dist/utils/websearch/hook-utils.d.ts +0 -18
- package/dist/utils/websearch/hook-utils.d.ts.map +0 -1
- package/dist/utils/websearch/hook-utils.js +0 -59
- package/dist/utils/websearch/hook-utils.js.map +0 -1
- package/dist/utils/websearch/index.d.ts +0 -17
- package/dist/utils/websearch/index.d.ts.map +0 -1
- package/dist/utils/websearch/index.js +0 -51
- package/dist/utils/websearch/index.js.map +0 -1
- package/dist/utils/websearch/opencode-cli.d.ts +0 -26
- package/dist/utils/websearch/opencode-cli.d.ts.map +0 -1
- package/dist/utils/websearch/opencode-cli.js +0 -81
- package/dist/utils/websearch/opencode-cli.js.map +0 -1
- package/dist/utils/websearch/profile-hook-injector.d.ts +0 -20
- package/dist/utils/websearch/profile-hook-injector.d.ts.map +0 -1
- package/dist/utils/websearch/profile-hook-injector.js +0 -250
- package/dist/utils/websearch/profile-hook-injector.js.map +0 -1
- package/dist/utils/websearch/status.d.ts +0 -36
- package/dist/utils/websearch/status.d.ts.map +0 -1
- package/dist/utils/websearch/status.js +0 -192
- package/dist/utils/websearch/status.js.map +0 -1
- package/dist/utils/websearch/types.d.ts +0 -85
- package/dist/utils/websearch/types.d.ts.map +0 -1
- package/dist/utils/websearch/types.js +0 -10
- package/dist/utils/websearch/types.js.map +0 -1
- package/dist/utils/websearch-manager.d.ts +0 -31
- package/dist/utils/websearch-manager.d.ts.map +0 -1
- package/dist/utils/websearch-manager.js +0 -72
- package/dist/utils/websearch-manager.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 -13
- package/dist/web-server/health/index.d.ts.map +0 -1
- package/dist/web-server/health/index.js +0 -41
- 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/websearch-checks.d.ts +0 -11
- package/dist/web-server/health/websearch-checks.d.ts.map +0 -1
- package/dist/web-server/health/websearch-checks.js +0 -53
- package/dist/web-server/health/websearch-checks.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 -162
- 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 -62
- 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 -413
- 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/routes/websearch-routes.d.ts +0 -6
- package/dist/web-server/routes/websearch-routes.d.ts.map +0 -1
- package/dist/web-server/routes/websearch-routes.js +0 -130
- package/dist/web-server/routes/websearch-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/lib/hooks/block-websearch.cjs +0 -75
- package/lib/hooks/websearch-transformer.cjs +0 -632
- /package/dist/{cliproxy → proxy}/tool-name-mapper.d.ts +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 (e.g., model for websearch providers)
|
|
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,128 +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
|
-
websearch: {
|
|
238
|
-
enabled: partial.websearch?.enabled ?? defaults.websearch?.enabled ?? true,
|
|
239
|
-
providers: {
|
|
240
|
-
gemini: {
|
|
241
|
-
enabled: partial.websearch?.providers?.gemini?.enabled ??
|
|
242
|
-
partial.websearch?.gemini?.enabled ?? // Legacy fallback
|
|
243
|
-
true,
|
|
244
|
-
model: partial.websearch?.providers?.gemini?.model ?? 'gemini-2.5-flash',
|
|
245
|
-
timeout: partial.websearch?.providers?.gemini?.timeout ??
|
|
246
|
-
partial.websearch?.gemini?.timeout ?? // Legacy fallback
|
|
247
|
-
55,
|
|
248
|
-
},
|
|
249
|
-
opencode: {
|
|
250
|
-
enabled: partial.websearch?.providers?.opencode?.enabled ?? false,
|
|
251
|
-
model: partial.websearch?.providers?.opencode?.model ?? 'opencode/grok-code',
|
|
252
|
-
timeout: partial.websearch?.providers?.opencode?.timeout ?? 90,
|
|
253
|
-
},
|
|
254
|
-
grok: {
|
|
255
|
-
enabled: partial.websearch?.providers?.grok?.enabled ?? false,
|
|
256
|
-
timeout: partial.websearch?.providers?.grok?.timeout ?? 55,
|
|
257
|
-
},
|
|
258
|
-
},
|
|
259
|
-
// Legacy fields (keep for backwards compatibility during read)
|
|
260
|
-
gemini: partial.websearch?.gemini,
|
|
261
|
-
},
|
|
262
|
-
// Copilot config - strictly opt-in, merge with defaults
|
|
263
|
-
copilot: {
|
|
264
|
-
enabled: partial.copilot?.enabled ?? unified_config_types_1.DEFAULT_COPILOT_CONFIG.enabled,
|
|
265
|
-
auto_start: partial.copilot?.auto_start ?? unified_config_types_1.DEFAULT_COPILOT_CONFIG.auto_start,
|
|
266
|
-
port: partial.copilot?.port ?? unified_config_types_1.DEFAULT_COPILOT_CONFIG.port,
|
|
267
|
-
account_type: partial.copilot?.account_type ?? unified_config_types_1.DEFAULT_COPILOT_CONFIG.account_type,
|
|
268
|
-
rate_limit: partial.copilot?.rate_limit ?? unified_config_types_1.DEFAULT_COPILOT_CONFIG.rate_limit,
|
|
269
|
-
wait_on_limit: partial.copilot?.wait_on_limit ?? unified_config_types_1.DEFAULT_COPILOT_CONFIG.wait_on_limit,
|
|
270
|
-
model: partial.copilot?.model ?? unified_config_types_1.DEFAULT_COPILOT_CONFIG.model,
|
|
271
|
-
},
|
|
272
|
-
// Global env - injected into all non-Claude subscription profiles
|
|
273
166
|
global_env: {
|
|
274
167
|
enabled: partial.global_env?.enabled ?? true,
|
|
275
168
|
env: partial.global_env?.env ?? { ...unified_config_types_1.DEFAULT_GLOBAL_ENV },
|
|
276
169
|
},
|
|
277
|
-
// CLIProxy server config - remote/local CLIProxyAPI settings
|
|
278
|
-
cliproxy_server: {
|
|
279
|
-
remote: {
|
|
280
|
-
enabled: partial.cliproxy_server?.remote?.enabled ?? unified_config_types_1.DEFAULT_CLIPROXY_SERVER_CONFIG.remote.enabled,
|
|
281
|
-
host: partial.cliproxy_server?.remote?.host ?? unified_config_types_1.DEFAULT_CLIPROXY_SERVER_CONFIG.remote.host,
|
|
282
|
-
// Port is optional - undefined means use protocol default (443 for HTTPS, 8317 for HTTP)
|
|
283
|
-
port: partial.cliproxy_server?.remote?.port,
|
|
284
|
-
protocol: partial.cliproxy_server?.remote?.protocol ??
|
|
285
|
-
unified_config_types_1.DEFAULT_CLIPROXY_SERVER_CONFIG.remote.protocol,
|
|
286
|
-
auth_token: partial.cliproxy_server?.remote?.auth_token ??
|
|
287
|
-
unified_config_types_1.DEFAULT_CLIPROXY_SERVER_CONFIG.remote.auth_token,
|
|
288
|
-
// management_key is optional - falls back to auth_token when not set
|
|
289
|
-
management_key: partial.cliproxy_server?.remote?.management_key,
|
|
290
|
-
},
|
|
291
|
-
fallback: {
|
|
292
|
-
enabled: partial.cliproxy_server?.fallback?.enabled ??
|
|
293
|
-
unified_config_types_1.DEFAULT_CLIPROXY_SERVER_CONFIG.fallback.enabled,
|
|
294
|
-
auto_start: partial.cliproxy_server?.fallback?.auto_start ??
|
|
295
|
-
unified_config_types_1.DEFAULT_CLIPROXY_SERVER_CONFIG.fallback.auto_start,
|
|
296
|
-
},
|
|
297
|
-
local: {
|
|
298
|
-
port: partial.cliproxy_server?.local?.port ?? unified_config_types_1.DEFAULT_CLIPROXY_SERVER_CONFIG.local.port,
|
|
299
|
-
auto_start: partial.cliproxy_server?.local?.auto_start ??
|
|
300
|
-
unified_config_types_1.DEFAULT_CLIPROXY_SERVER_CONFIG.local.auto_start,
|
|
301
|
-
},
|
|
302
|
-
},
|
|
303
|
-
// Quota management config - hybrid auto+manual account selection
|
|
304
|
-
quota_management: {
|
|
305
|
-
mode: partial.quota_management?.mode ?? unified_config_types_1.DEFAULT_QUOTA_MANAGEMENT_CONFIG.mode,
|
|
306
|
-
auto: {
|
|
307
|
-
preflight_check: partial.quota_management?.auto?.preflight_check ??
|
|
308
|
-
unified_config_types_1.DEFAULT_QUOTA_MANAGEMENT_CONFIG.auto.preflight_check,
|
|
309
|
-
exhaustion_threshold: partial.quota_management?.auto?.exhaustion_threshold ??
|
|
310
|
-
unified_config_types_1.DEFAULT_QUOTA_MANAGEMENT_CONFIG.auto.exhaustion_threshold,
|
|
311
|
-
tier_priority: partial.quota_management?.auto?.tier_priority ??
|
|
312
|
-
unified_config_types_1.DEFAULT_QUOTA_MANAGEMENT_CONFIG.auto.tier_priority,
|
|
313
|
-
cooldown_minutes: partial.quota_management?.auto?.cooldown_minutes ??
|
|
314
|
-
unified_config_types_1.DEFAULT_QUOTA_MANAGEMENT_CONFIG.auto.cooldown_minutes,
|
|
315
|
-
},
|
|
316
|
-
manual: {
|
|
317
|
-
paused_accounts: partial.quota_management?.manual?.paused_accounts ??
|
|
318
|
-
unified_config_types_1.DEFAULT_QUOTA_MANAGEMENT_CONFIG.manual.paused_accounts,
|
|
319
|
-
forced_default: partial.quota_management?.manual?.forced_default ??
|
|
320
|
-
unified_config_types_1.DEFAULT_QUOTA_MANAGEMENT_CONFIG.manual.forced_default,
|
|
321
|
-
tier_lock: partial.quota_management?.manual?.tier_lock ??
|
|
322
|
-
unified_config_types_1.DEFAULT_QUOTA_MANAGEMENT_CONFIG.manual.tier_lock,
|
|
323
|
-
},
|
|
324
|
-
},
|
|
325
|
-
// Thinking config - auto/manual/off control for reasoning budget
|
|
326
170
|
thinking: {
|
|
327
171
|
mode: partial.thinking?.mode ?? unified_config_types_1.DEFAULT_THINKING_CONFIG.mode,
|
|
328
172
|
override: partial.thinking?.override,
|
|
@@ -334,103 +178,40 @@ function mergeWithDefaults(partial) {
|
|
|
334
178
|
provider_overrides: partial.thinking?.provider_overrides,
|
|
335
179
|
show_warnings: partial.thinking?.show_warnings ?? unified_config_types_1.DEFAULT_THINKING_CONFIG.show_warnings,
|
|
336
180
|
},
|
|
337
|
-
// Dashboard auth config - disabled by default
|
|
338
|
-
dashboard_auth: {
|
|
339
|
-
enabled: partial.dashboard_auth?.enabled ?? unified_config_types_1.DEFAULT_DASHBOARD_AUTH_CONFIG.enabled,
|
|
340
|
-
username: partial.dashboard_auth?.username ?? unified_config_types_1.DEFAULT_DASHBOARD_AUTH_CONFIG.username,
|
|
341
|
-
password_hash: partial.dashboard_auth?.password_hash ?? unified_config_types_1.DEFAULT_DASHBOARD_AUTH_CONFIG.password_hash,
|
|
342
|
-
session_timeout_hours: partial.dashboard_auth?.session_timeout_hours ??
|
|
343
|
-
unified_config_types_1.DEFAULT_DASHBOARD_AUTH_CONFIG.session_timeout_hours,
|
|
344
|
-
},
|
|
345
|
-
// Image analysis config - enabled by default for CLIProxy providers
|
|
346
|
-
image_analysis: {
|
|
347
|
-
enabled: partial.image_analysis?.enabled ?? unified_config_types_1.DEFAULT_IMAGE_ANALYSIS_CONFIG.enabled,
|
|
348
|
-
timeout: partial.image_analysis?.timeout ?? unified_config_types_1.DEFAULT_IMAGE_ANALYSIS_CONFIG.timeout,
|
|
349
|
-
provider_models: partial.image_analysis?.provider_models ?? unified_config_types_1.DEFAULT_IMAGE_ANALYSIS_CONFIG.provider_models,
|
|
350
|
-
},
|
|
351
|
-
// Router config - scenario-based routing for sub-agents
|
|
352
|
-
router: partial.router,
|
|
353
181
|
};
|
|
354
182
|
}
|
|
355
|
-
/**
|
|
356
|
-
* Load config, preferring YAML if available, falling back to creating empty config.
|
|
357
|
-
* Merges with defaults to ensure all sections exist.
|
|
358
|
-
*/
|
|
359
183
|
function loadOrCreateUnifiedConfig() {
|
|
360
184
|
const existing = loadUnifiedConfig();
|
|
361
|
-
if (existing)
|
|
362
|
-
// Merge with defaults to fill any missing sections
|
|
185
|
+
if (existing)
|
|
363
186
|
return mergeWithDefaults(existing);
|
|
364
|
-
|
|
365
|
-
// Create empty config
|
|
366
|
-
const config = (0, unified_config_types_1.createEmptyUnifiedConfig)();
|
|
367
|
-
return config;
|
|
187
|
+
return (0, unified_config_types_1.createEmptyUnifiedConfig)();
|
|
368
188
|
}
|
|
369
189
|
exports.loadOrCreateUnifiedConfig = loadOrCreateUnifiedConfig;
|
|
370
|
-
/**
|
|
371
|
-
* Generate YAML header with helpful comments.
|
|
372
|
-
*/
|
|
373
190
|
function generateYamlHeader() {
|
|
374
191
|
return `# CCS Unified Configuration
|
|
375
192
|
# Docs: https://github.com/kaitranntt/ccs
|
|
376
193
|
`;
|
|
377
194
|
}
|
|
378
|
-
/**
|
|
379
|
-
* Generate YAML content with section comments for better readability.
|
|
380
|
-
*/
|
|
381
195
|
function generateYamlWithComments(config) {
|
|
382
196
|
const lines = [];
|
|
383
|
-
// Version
|
|
384
197
|
lines.push(`version: ${config.version}`);
|
|
385
198
|
if (config.setup_completed !== undefined) {
|
|
386
199
|
lines.push(`setup_completed: ${config.setup_completed}`);
|
|
387
200
|
}
|
|
388
201
|
lines.push('');
|
|
389
|
-
// Default
|
|
390
202
|
if (config.default) {
|
|
391
203
|
lines.push(`# Default profile used when running 'ccs' without arguments`);
|
|
392
204
|
lines.push(`default: "${config.default}"`);
|
|
393
205
|
lines.push('');
|
|
394
206
|
}
|
|
395
|
-
//
|
|
396
|
-
lines.push('# ----------------------------------------------------------------------------');
|
|
397
|
-
lines.push('# Accounts: Isolated Claude instances (each with separate auth/sessions)');
|
|
398
|
-
lines.push('# Manage with: ccs auth add <name>, ccs auth list, ccs auth remove <name>');
|
|
399
|
-
lines.push('# ----------------------------------------------------------------------------');
|
|
400
|
-
lines.push(yaml.dump({ accounts: config.accounts }, { indent: 2, lineWidth: -1, quotingType: '"' }).trim());
|
|
401
|
-
lines.push('');
|
|
402
|
-
// Profiles section
|
|
207
|
+
// Profiles
|
|
403
208
|
lines.push('# ----------------------------------------------------------------------------');
|
|
404
209
|
lines.push('# Profiles: API-based providers (GLM, GLMT, Kimi, custom endpoints)');
|
|
405
210
|
lines.push('# Each profile points to a *.settings.json file containing env vars.');
|
|
406
|
-
lines.push('# Edit the settings file directly to customize (ANTHROPIC_MAX_TOKENS, etc.)');
|
|
407
211
|
lines.push('# ----------------------------------------------------------------------------');
|
|
408
212
|
lines.push(yaml.dump({ profiles: config.profiles }, { indent: 2, lineWidth: -1, quotingType: '"' }).trim());
|
|
409
213
|
lines.push('');
|
|
410
|
-
//
|
|
411
|
-
lines.push('# ----------------------------------------------------------------------------');
|
|
412
|
-
lines.push('# CLIProxy: OAuth-based providers (gemini, codex, agy, qwen, iflow)');
|
|
413
|
-
lines.push('# Each variant can reference a *.settings.json file for custom env vars.');
|
|
414
|
-
lines.push('# Edit the settings file directly to customize model or other settings.');
|
|
415
|
-
lines.push('# ----------------------------------------------------------------------------');
|
|
416
|
-
lines.push(yaml.dump({ cliproxy: config.cliproxy }, { indent: 2, lineWidth: -1, quotingType: '"' }).trim());
|
|
417
|
-
lines.push('');
|
|
418
|
-
// CLIProxy Server section (remote proxy configuration) - placed right after cliproxy
|
|
419
|
-
if (config.cliproxy_server) {
|
|
420
|
-
lines.push('# ----------------------------------------------------------------------------');
|
|
421
|
-
lines.push('# CLIProxy Server: Remote proxy connection settings');
|
|
422
|
-
lines.push('# Configure via Dashboard (`ccs config`) > Proxy tab.');
|
|
423
|
-
lines.push('#');
|
|
424
|
-
lines.push('# remote: Connect to a remote CLIProxyAPI instance');
|
|
425
|
-
lines.push('# fallback: Use local proxy if remote is unreachable');
|
|
426
|
-
lines.push('# local: Local proxy settings (port, auto-start)');
|
|
427
|
-
lines.push('# ----------------------------------------------------------------------------');
|
|
428
|
-
lines.push(yaml
|
|
429
|
-
.dump({ cliproxy_server: config.cliproxy_server }, { indent: 2, lineWidth: -1, quotingType: '"' })
|
|
430
|
-
.trim());
|
|
431
|
-
lines.push('');
|
|
432
|
-
}
|
|
433
|
-
// Preferences section
|
|
214
|
+
// Preferences
|
|
434
215
|
lines.push('# ----------------------------------------------------------------------------');
|
|
435
216
|
lines.push('# Preferences: User settings');
|
|
436
217
|
lines.push('# ----------------------------------------------------------------------------');
|
|
@@ -438,144 +219,32 @@ function generateYamlWithComments(config) {
|
|
|
438
219
|
.dump({ preferences: config.preferences }, { indent: 2, lineWidth: -1, quotingType: '"' })
|
|
439
220
|
.trim());
|
|
440
221
|
lines.push('');
|
|
441
|
-
//
|
|
442
|
-
if (config.websearch) {
|
|
443
|
-
lines.push('# ----------------------------------------------------------------------------');
|
|
444
|
-
lines.push('# WebSearch: CLI-based web search for third-party profiles');
|
|
445
|
-
lines.push('# Dashboard (`ccs config`) is the source of truth for provider selection.');
|
|
446
|
-
lines.push('#');
|
|
447
|
-
lines.push('# Third-party providers (gemini, codex, agy, etc.) do not have access to');
|
|
448
|
-
lines.push("# Anthropic's WebSearch tool. These CLI tools provide fallback web search.");
|
|
449
|
-
lines.push('#');
|
|
450
|
-
lines.push('# Fallback chain: Gemini -> OpenCode -> Grok (tries in order until success)');
|
|
451
|
-
lines.push('#');
|
|
452
|
-
lines.push('# Gemini models: gemini-2.5-flash (default), gemini-2.5-pro, gemini-2.5-flash-lite');
|
|
453
|
-
lines.push('# OpenCode models: opencode/grok-code (default), opencode/gpt-4o, opencode/claude-3.5-sonnet');
|
|
454
|
-
lines.push('#');
|
|
455
|
-
lines.push('# Install commands:');
|
|
456
|
-
lines.push('# gemini: npm i -g @google/gemini-cli (FREE - 1000 req/day)');
|
|
457
|
-
lines.push('# opencode: curl -fsSL https://opencode.ai/install | bash (FREE via Zen)');
|
|
458
|
-
lines.push('# grok: npm i -g @vibe-kit/grok-cli (requires GROK_API_KEY)');
|
|
459
|
-
lines.push('# ----------------------------------------------------------------------------');
|
|
460
|
-
lines.push(yaml
|
|
461
|
-
.dump({ websearch: config.websearch }, { indent: 2, lineWidth: -1, quotingType: '"' })
|
|
462
|
-
.trim());
|
|
463
|
-
lines.push('');
|
|
464
|
-
}
|
|
465
|
-
// Copilot section (GitHub Copilot proxy)
|
|
466
|
-
if (config.copilot) {
|
|
467
|
-
lines.push('# ----------------------------------------------------------------------------');
|
|
468
|
-
lines.push('# Copilot: GitHub Copilot API proxy (via copilot-api)');
|
|
469
|
-
lines.push('# Uses your existing GitHub Copilot subscription with Claude Code.');
|
|
470
|
-
lines.push('#');
|
|
471
|
-
lines.push('# !! DISCLAIMER - USE AT YOUR OWN RISK !!');
|
|
472
|
-
lines.push('# This uses an UNOFFICIAL reverse-engineered API.');
|
|
473
|
-
lines.push('# Excessive usage may trigger GitHub account restrictions.');
|
|
474
|
-
lines.push('# CCS provides NO WARRANTY and accepts NO RESPONSIBILITY for consequences.');
|
|
475
|
-
lines.push('#');
|
|
476
|
-
lines.push('# Setup: npx copilot-api auth (authenticate with GitHub)');
|
|
477
|
-
lines.push('# Usage: ccs copilot (switch to copilot profile)');
|
|
478
|
-
lines.push('#');
|
|
479
|
-
lines.push('# Models: claude-sonnet-4.5, claude-opus-4.5, gpt-5.1, gemini-2.5-pro');
|
|
480
|
-
lines.push('# Account types: individual, business, enterprise');
|
|
481
|
-
lines.push('# ----------------------------------------------------------------------------');
|
|
482
|
-
lines.push(yaml.dump({ copilot: config.copilot }, { indent: 2, lineWidth: -1, quotingType: '"' }).trim());
|
|
483
|
-
lines.push('');
|
|
484
|
-
}
|
|
485
|
-
// Global env section
|
|
222
|
+
// Global env
|
|
486
223
|
if (config.global_env) {
|
|
487
224
|
lines.push('# ----------------------------------------------------------------------------');
|
|
488
225
|
lines.push('# Global Environment Variables: Injected into all non-Claude subscription profiles');
|
|
489
|
-
lines.push('# These env vars disable telemetry/reporting for third-party providers.');
|
|
490
|
-
lines.push('# Configure via Dashboard (`ccs config`) > Global Env tab.');
|
|
491
|
-
lines.push('#');
|
|
492
|
-
lines.push('# Default variables:');
|
|
493
|
-
lines.push('# DISABLE_BUG_COMMAND: Disables /bug command (not supported by proxy)');
|
|
494
|
-
lines.push('# DISABLE_ERROR_REPORTING: Disables error reporting to Anthropic');
|
|
495
|
-
lines.push('# DISABLE_TELEMETRY: Disables usage telemetry');
|
|
496
226
|
lines.push('# ----------------------------------------------------------------------------');
|
|
497
227
|
lines.push(yaml
|
|
498
228
|
.dump({ global_env: config.global_env }, { indent: 2, lineWidth: -1, quotingType: '"' })
|
|
499
229
|
.trim());
|
|
500
230
|
lines.push('');
|
|
501
231
|
}
|
|
502
|
-
// Thinking
|
|
232
|
+
// Thinking
|
|
503
233
|
if (config.thinking) {
|
|
504
234
|
lines.push('# ----------------------------------------------------------------------------');
|
|
505
235
|
lines.push('# Thinking: Extended thinking/reasoning budget configuration');
|
|
506
|
-
lines.push('# Controls reasoning depth for supported providers (agy, gemini, codex).');
|
|
507
|
-
lines.push('#');
|
|
508
236
|
lines.push('# Modes: auto (use tier_defaults), off (disable), manual (--thinking flag only)');
|
|
509
|
-
lines.push('# Levels: minimal (512), low (1K), medium (8K), high (24K), xhigh (32K), auto');
|
|
510
|
-
lines.push('# Override: Set global override value (number or level name)');
|
|
511
|
-
lines.push('# Provider overrides: Per-provider tier defaults');
|
|
512
237
|
lines.push('# ----------------------------------------------------------------------------');
|
|
513
238
|
lines.push(yaml
|
|
514
239
|
.dump({ thinking: config.thinking }, { indent: 2, lineWidth: -1, quotingType: '"' })
|
|
515
240
|
.trim());
|
|
516
241
|
lines.push('');
|
|
517
242
|
}
|
|
518
|
-
// Dashboard auth section (only if configured)
|
|
519
|
-
if (config.dashboard_auth?.enabled) {
|
|
520
|
-
lines.push('# ----------------------------------------------------------------------------');
|
|
521
|
-
lines.push('# Dashboard Auth: Optional login protection for CCS dashboard');
|
|
522
|
-
lines.push('# Generate password hash: npx bcrypt-cli hash "your-password"');
|
|
523
|
-
lines.push('# ENV override: CCS_DASHBOARD_AUTH_ENABLED, CCS_DASHBOARD_USERNAME, CCS_DASHBOARD_PASSWORD_HASH');
|
|
524
|
-
lines.push('# ----------------------------------------------------------------------------');
|
|
525
|
-
lines.push(yaml
|
|
526
|
-
.dump({ dashboard_auth: config.dashboard_auth }, { indent: 2, lineWidth: -1, quotingType: '"' })
|
|
527
|
-
.trim());
|
|
528
|
-
lines.push('');
|
|
529
|
-
}
|
|
530
|
-
// Image analysis section
|
|
531
|
-
if (config.image_analysis) {
|
|
532
|
-
lines.push('# ----------------------------------------------------------------------------');
|
|
533
|
-
lines.push('# Image Analysis: Vision-based analysis for images and PDFs');
|
|
534
|
-
lines.push('# Routes Read tool requests for images/PDFs through CLIProxy vision API.');
|
|
535
|
-
lines.push('#');
|
|
536
|
-
lines.push('# When enabled: Image files trigger vision analysis instead of raw file read');
|
|
537
|
-
lines.push('# Provider models: Vision model used for each CLIProxy provider');
|
|
538
|
-
lines.push('# Timeout: Maximum seconds to wait for analysis (10-600)');
|
|
539
|
-
lines.push('#');
|
|
540
|
-
lines.push('# Supported formats: .jpg, .jpeg, .png, .gif, .webp, .heic, .bmp, .tiff, .pdf');
|
|
541
|
-
lines.push('# Configure via: ccs config image-analysis');
|
|
542
|
-
lines.push('# ----------------------------------------------------------------------------');
|
|
543
|
-
lines.push(yaml
|
|
544
|
-
.dump({ image_analysis: config.image_analysis }, { indent: 2, lineWidth: -1, quotingType: '"' })
|
|
545
|
-
.trim());
|
|
546
|
-
lines.push('');
|
|
547
|
-
}
|
|
548
|
-
// Router section (scenario routing for sub-agents)
|
|
549
|
-
if (config.router) {
|
|
550
|
-
lines.push('# ----------------------------------------------------------------------------');
|
|
551
|
-
lines.push('# Router: Scenario-based routing for Claude sub-agents');
|
|
552
|
-
lines.push('# Routes different request types (background, think, webSearch) to profiles.');
|
|
553
|
-
lines.push('#');
|
|
554
|
-
lines.push('# Scenarios:');
|
|
555
|
-
lines.push('# default - Fallback for unmatched requests');
|
|
556
|
-
lines.push('# background - Claude background/haiku sub-agents');
|
|
557
|
-
lines.push('# think - Extended thinking requests');
|
|
558
|
-
lines.push('# longContext - Requests exceeding token threshold');
|
|
559
|
-
lines.push('# webSearch - Web search tool requests');
|
|
560
|
-
lines.push('#');
|
|
561
|
-
lines.push('# Configure via: ccs router set <scenario> <profile>');
|
|
562
|
-
lines.push('# ----------------------------------------------------------------------------');
|
|
563
|
-
lines.push(yaml
|
|
564
|
-
.dump({ router: config.router }, { indent: 2, lineWidth: -1, quotingType: '"' })
|
|
565
|
-
.trim());
|
|
566
|
-
lines.push('');
|
|
567
|
-
}
|
|
568
243
|
return lines.join('\n');
|
|
569
244
|
}
|
|
570
|
-
/**
|
|
571
|
-
* Save unified config to YAML file.
|
|
572
|
-
* Uses atomic write (temp file + rename) to prevent corruption.
|
|
573
|
-
* Uses lockfile to prevent concurrent writes.
|
|
574
|
-
*/
|
|
575
245
|
function saveUnifiedConfig(config) {
|
|
576
246
|
const yamlPath = getConfigYamlPath();
|
|
577
247
|
const dir = path.dirname(yamlPath);
|
|
578
|
-
// Acquire lock (retry for up to 1 second)
|
|
579
248
|
const maxRetries = 10;
|
|
580
249
|
const retryDelayMs = 100;
|
|
581
250
|
let lockAcquired = false;
|
|
@@ -584,41 +253,34 @@ function saveUnifiedConfig(config) {
|
|
|
584
253
|
lockAcquired = true;
|
|
585
254
|
break;
|
|
586
255
|
}
|
|
587
|
-
//
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
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 */ }
|
|
591
259
|
}
|
|
592
260
|
if (!lockAcquired) {
|
|
593
261
|
throw new Error('Config file is locked by another process. Wait a moment and try again.');
|
|
594
262
|
}
|
|
595
263
|
try {
|
|
596
|
-
// Ensure directory exists
|
|
597
264
|
if (!fs.existsSync(dir)) {
|
|
598
265
|
fs.mkdirSync(dir, { recursive: true, mode: 0o700 });
|
|
599
266
|
}
|
|
600
|
-
// Ensure version is set
|
|
601
267
|
config.version = unified_config_types_1.UNIFIED_CONFIG_VERSION;
|
|
602
|
-
// Generate YAML with section comments
|
|
603
268
|
const yamlContent = generateYamlWithComments(config);
|
|
604
269
|
const content = generateYamlHeader() + yamlContent;
|
|
605
|
-
// Atomic write: write to temp file, then rename
|
|
606
270
|
const tempPath = `${yamlPath}.tmp.${process.pid}`;
|
|
607
271
|
try {
|
|
608
272
|
fs.writeFileSync(tempPath, content, { mode: 0o600 });
|
|
609
273
|
fs.renameSync(tempPath, yamlPath);
|
|
610
274
|
}
|
|
611
275
|
catch (error) {
|
|
612
|
-
// Clean up temp file on error
|
|
613
276
|
if (fs.existsSync(tempPath)) {
|
|
614
277
|
try {
|
|
615
278
|
fs.unlinkSync(tempPath);
|
|
616
279
|
}
|
|
617
280
|
catch {
|
|
618
|
-
|
|
281
|
+
/* ignore */
|
|
619
282
|
}
|
|
620
283
|
}
|
|
621
|
-
// Classify filesystem errors
|
|
622
284
|
const err = error;
|
|
623
285
|
if (err.code === 'ENOSPC') {
|
|
624
286
|
throw new Error('Disk full - cannot save config. Free up space and try again.');
|
|
@@ -630,15 +292,10 @@ function saveUnifiedConfig(config) {
|
|
|
630
292
|
}
|
|
631
293
|
}
|
|
632
294
|
finally {
|
|
633
|
-
// Always release lock
|
|
634
295
|
releaseLock();
|
|
635
296
|
}
|
|
636
297
|
}
|
|
637
298
|
exports.saveUnifiedConfig = saveUnifiedConfig;
|
|
638
|
-
/**
|
|
639
|
-
* Update unified config with partial data.
|
|
640
|
-
* Loads existing config, merges changes, and saves.
|
|
641
|
-
*/
|
|
642
299
|
function updateUnifiedConfig(updates) {
|
|
643
300
|
const config = loadOrCreateUnifiedConfig();
|
|
644
301
|
const updated = { ...config, ...updates };
|
|
@@ -646,19 +303,10 @@ function updateUnifiedConfig(updates) {
|
|
|
646
303
|
return updated;
|
|
647
304
|
}
|
|
648
305
|
exports.updateUnifiedConfig = updateUnifiedConfig;
|
|
649
|
-
/**
|
|
650
|
-
* Check if unified config mode is active.
|
|
651
|
-
* Returns true if config.yaml exists OR CCS_UNIFIED_CONFIG=1.
|
|
652
|
-
*
|
|
653
|
-
* Use this centralized function instead of duplicating the logic.
|
|
654
|
-
*/
|
|
655
306
|
function isUnifiedMode() {
|
|
656
|
-
return hasUnifiedConfig()
|
|
307
|
+
return hasUnifiedConfig();
|
|
657
308
|
}
|
|
658
309
|
exports.isUnifiedMode = isUnifiedMode;
|
|
659
|
-
/**
|
|
660
|
-
* Get or set default profile name.
|
|
661
|
-
*/
|
|
662
310
|
function getDefaultProfile() {
|
|
663
311
|
const config = loadUnifiedConfig();
|
|
664
312
|
return config?.default;
|
|
@@ -668,47 +316,6 @@ function setDefaultProfile(name) {
|
|
|
668
316
|
updateUnifiedConfig({ default: name });
|
|
669
317
|
}
|
|
670
318
|
exports.setDefaultProfile = setDefaultProfile;
|
|
671
|
-
/**
|
|
672
|
-
* Get websearch configuration.
|
|
673
|
-
* Returns defaults if not configured.
|
|
674
|
-
* Supports Gemini CLI, OpenCode, and Grok CLI providers.
|
|
675
|
-
*/
|
|
676
|
-
function getWebSearchConfig() {
|
|
677
|
-
const config = loadOrCreateUnifiedConfig();
|
|
678
|
-
// Build provider configs
|
|
679
|
-
const geminiConfig = {
|
|
680
|
-
enabled: config.websearch?.providers?.gemini?.enabled ?? config.websearch?.gemini?.enabled ?? true,
|
|
681
|
-
model: config.websearch?.providers?.gemini?.model ?? 'gemini-2.5-flash',
|
|
682
|
-
timeout: config.websearch?.providers?.gemini?.timeout ?? config.websearch?.gemini?.timeout ?? 55,
|
|
683
|
-
};
|
|
684
|
-
const opencodeConfig = {
|
|
685
|
-
enabled: config.websearch?.providers?.opencode?.enabled ?? false,
|
|
686
|
-
model: config.websearch?.providers?.opencode?.model ?? 'opencode/grok-code',
|
|
687
|
-
timeout: config.websearch?.providers?.opencode?.timeout ?? 90,
|
|
688
|
-
};
|
|
689
|
-
const grokConfig = {
|
|
690
|
-
enabled: config.websearch?.providers?.grok?.enabled ?? false,
|
|
691
|
-
timeout: config.websearch?.providers?.grok?.timeout ?? 55,
|
|
692
|
-
};
|
|
693
|
-
// Auto-enable master switch if ANY provider is enabled
|
|
694
|
-
const anyProviderEnabled = geminiConfig.enabled || opencodeConfig.enabled || grokConfig.enabled;
|
|
695
|
-
const enabled = anyProviderEnabled && (config.websearch?.enabled ?? true);
|
|
696
|
-
return {
|
|
697
|
-
enabled,
|
|
698
|
-
providers: {
|
|
699
|
-
gemini: geminiConfig,
|
|
700
|
-
opencode: opencodeConfig,
|
|
701
|
-
grok: grokConfig,
|
|
702
|
-
},
|
|
703
|
-
// Legacy field for backwards compatibility
|
|
704
|
-
gemini: config.websearch?.gemini,
|
|
705
|
-
};
|
|
706
|
-
}
|
|
707
|
-
exports.getWebSearchConfig = getWebSearchConfig;
|
|
708
|
-
/**
|
|
709
|
-
* Get global_env configuration.
|
|
710
|
-
* Returns defaults if not configured.
|
|
711
|
-
*/
|
|
712
319
|
function getGlobalEnvConfig() {
|
|
713
320
|
const config = loadOrCreateUnifiedConfig();
|
|
714
321
|
return {
|
|
@@ -717,16 +324,10 @@ function getGlobalEnvConfig() {
|
|
|
717
324
|
};
|
|
718
325
|
}
|
|
719
326
|
exports.getGlobalEnvConfig = getGlobalEnvConfig;
|
|
720
|
-
/**
|
|
721
|
-
* Get thinking configuration.
|
|
722
|
-
* Returns defaults if not configured.
|
|
723
|
-
*/
|
|
724
327
|
function getThinkingConfig() {
|
|
725
328
|
const config = loadOrCreateUnifiedConfig();
|
|
726
|
-
// W2: Check for invalid thinking config (e.g., thinking: true instead of object)
|
|
727
329
|
if (config.thinking !== undefined && typeof config.thinking !== 'object') {
|
|
728
330
|
console.warn(`[!] Invalid thinking config: expected object, got ${typeof config.thinking}. Using defaults.`);
|
|
729
|
-
console.warn(` Tip: Use 'thinking: { mode: auto }' instead of 'thinking: true'`);
|
|
730
331
|
return unified_config_types_1.DEFAULT_THINKING_CONFIG;
|
|
731
332
|
}
|
|
732
333
|
return {
|
|
@@ -742,37 +343,4 @@ function getThinkingConfig() {
|
|
|
742
343
|
};
|
|
743
344
|
}
|
|
744
345
|
exports.getThinkingConfig = getThinkingConfig;
|
|
745
|
-
/**
|
|
746
|
-
* Get dashboard_auth configuration with ENV var override.
|
|
747
|
-
* Priority: ENV vars > config.yaml > defaults
|
|
748
|
-
*/
|
|
749
|
-
function getDashboardAuthConfig() {
|
|
750
|
-
const config = loadOrCreateUnifiedConfig();
|
|
751
|
-
// ENV vars take precedence
|
|
752
|
-
const envEnabled = process.env.CCS_DASHBOARD_AUTH_ENABLED;
|
|
753
|
-
const envUsername = process.env.CCS_DASHBOARD_USERNAME;
|
|
754
|
-
const envPasswordHash = process.env.CCS_DASHBOARD_PASSWORD_HASH;
|
|
755
|
-
return {
|
|
756
|
-
enabled: envEnabled !== undefined
|
|
757
|
-
? envEnabled === 'true' || envEnabled === '1'
|
|
758
|
-
: (config.dashboard_auth?.enabled ?? false),
|
|
759
|
-
username: envUsername ?? config.dashboard_auth?.username ?? '',
|
|
760
|
-
password_hash: envPasswordHash ?? config.dashboard_auth?.password_hash ?? '',
|
|
761
|
-
session_timeout_hours: config.dashboard_auth?.session_timeout_hours ?? 24,
|
|
762
|
-
};
|
|
763
|
-
}
|
|
764
|
-
exports.getDashboardAuthConfig = getDashboardAuthConfig;
|
|
765
|
-
/**
|
|
766
|
-
* Get image_analysis configuration.
|
|
767
|
-
* Returns defaults if not configured.
|
|
768
|
-
*/
|
|
769
|
-
function getImageAnalysisConfig() {
|
|
770
|
-
const config = loadOrCreateUnifiedConfig();
|
|
771
|
-
return {
|
|
772
|
-
enabled: config.image_analysis?.enabled ?? unified_config_types_1.DEFAULT_IMAGE_ANALYSIS_CONFIG.enabled,
|
|
773
|
-
timeout: config.image_analysis?.timeout ?? unified_config_types_1.DEFAULT_IMAGE_ANALYSIS_CONFIG.timeout,
|
|
774
|
-
provider_models: config.image_analysis?.provider_models ?? unified_config_types_1.DEFAULT_IMAGE_ANALYSIS_CONFIG.provider_models,
|
|
775
|
-
};
|
|
776
|
-
}
|
|
777
|
-
exports.getImageAnalysisConfig = getImageAnalysisConfig;
|
|
778
346
|
//# sourceMappingURL=unified-config-loader.js.map
|