mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-17 05:45:51 +00:00
Squashed 5 commits: Features (from 5 feature branches): - MCP fix, pipe mute, stub recovery - KAIROS activation, openclaw autonomy - Daemon/job command hierarchy + cross-platform bg engine Upstream fixes: - fix: Bun.hash compatibility - chore: chrome dependency update - docs: browser support guide MIME detection fix: - Screenshot detectMimeFromBase64(): decode raw bytes from base64 instead of broken charCodeAt comparison - Fixes API 400 on Windows (JPEG) and macOS (PNG) screenshots
25 lines
831 B
TypeScript
25 lines
831 B
TypeScript
import { feature } from 'bun:bundle'
|
|
import { getKairosActive } from '../bootstrap/state.js'
|
|
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
|
|
}
|