mirror of
https://github.com/tiennm99/ccs.git
synced 2026-09-02 02:19:09 +00:00
The normalizers extraction in #1168 introduced a circular module-load chain that crashed the built CLI: ccs.js -> errors -> services/logging -> log-config -> config-loader-facade -> unified-config-loader -> loader/normalizers -> channels/official-channels-runtime -> utils/claude-detector -> utils/shell-executor -> utils/websearch-manager -> utils/websearch/hook-env -> utils/websearch/trace -> services/logging (mid-load - createLogger undefined) -> CRASH normalizers only needed three pure helpers from official-channels-runtime (isOfficialChannelId, normalizeOfficialChannelIds, resolveLegacyDiscord Selection) but pulled in the whole file's claude-detector / shell- executor / websearch chain. Fix: extract those three helpers + OFFICIAL_CHANNEL_IDS into a leaf module src/channels/official-channels-ids.ts with no runtime deps. Update normalizers.ts and config-getters.ts to import from the leaf. official-channels-runtime.ts re-exports from the leaf for callers that still want the bundled API. Also revert the over-eager facade-import migration in src/utils/config-manager.ts (it was importing from config-loader-facade which re-exports from itself, creating a direct cycle). Verified: dist/ccs.js boots cleanly (--version returns); test:all 1828/1828 pass; typecheck/lint/format clean. Refs #1135