mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-17 13:55:50 +00:00
删除未使用的文件(BuiltinStatusLine.tsx、4 个重复的 .ts stub)、 移除约 55 个文件中未使用的 React 导入、 清理约 50 处未使用的导入/变量/参数。 净减少 ~296 行代码,precheck 4077 测试全部通过。 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
24 lines
775 B
TypeScript
24 lines
775 B
TypeScript
import { feature } from 'bun:bundle'
|
|
import { getFeatureValue_CACHED_MAY_BE_STALE } from '../services/analytics/growthbook.js'
|
|
|
|
/**
|
|
* Runtime gate for KAIROS features.
|
|
*
|
|
* Two-layer gate:
|
|
* 1. Build-time: feature('KAIROS') must be on
|
|
* 2. Runtime: tengu_kairos_assistant GrowthBook flag (remote kill switch)
|
|
*
|
|
* Called by main.tsx BEFORE setKairosActive(true) — must NOT check
|
|
* kairosActive (that would deadlock: gate needs active, active needs gate).
|
|
* The caller (main.tsx L1826-1832) sets kairosActive after this returns true.
|
|
*/
|
|
export async function isKairosEnabled(): Promise<boolean> {
|
|
if (!feature('KAIROS')) {
|
|
return false
|
|
}
|
|
if (!getFeatureValue_CACHED_MAY_BE_STALE('tengu_kairos_assistant', false)) {
|
|
return false
|
|
}
|
|
return true
|
|
}
|