MCPcopy Create free account
hub / github.com/T-Lab-CUHKSZ/claude-code / parseFeatureFlags

Function parseFeatureFlags

config-ui/server.ts:124–141  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

122// --- Feature Flags ---
123
124function parseFeatureFlags(): Record<string, boolean> {
125 const content = readTextSafe(getBundlePolyfillPath())
126 const flags: Record<string, boolean> = {}
127 const allFlags = [
128 'KAIROS', 'PROACTIVE', 'BRIDGE_MODE', 'VOICE_MODE', 'COORDINATOR_MODE',
129 'TRANSCRIPT_CLASSIFIER', 'BASH_CLASSIFIER', 'BUDDY', 'WEB_BROWSER_TOOL',
130 'CHICAGO_MCP', 'AGENT_TRIGGERS', 'ULTRAPLAN', 'MONITOR_TOOL', 'TEAMMEM',
131 'EXTRACT_MEMORIES', 'MCP_SKILLS', 'REVIEW_ARTIFACT', 'CONNECTOR_TEXT',
132 'DOWNLOAD_USER_SETTINGS', 'MESSAGE_ACTIONS', 'KAIROS_CHANNELS', 'KAIROS_GITHUB_WEBHOOKS',
133 ]
134 for (const flag of allFlags) {
135 // Check if the flag line is uncommented (enabled)
136 const enabledRegex = new RegExp(`^\\s*'${flag}'`, 'm')
137 const commentedRegex = new RegExp(`^\\s*//\\s*'${flag}'`, 'm')
138 flags[flag] = enabledRegex.test(content) && !commentedRegex.test(content)
139 }
140 return flags
141}
142
143function writeFeatureFlags(flags: Record<string, boolean>) {
144 const descriptions: Record<string, string> = {

Callers 1

handleAPIFunction · 0.85

Calls 2

readTextSafeFunction · 0.85
getBundlePolyfillPathFunction · 0.85

Tested by

no test coverage detected