c0b205208d
✨ Implement x402 payment handling in WebFetchTool 📝 Refactor count increment logic in X402 payment tracker ✨ Introduce feature flag management in Bun build ✨ Create macro for package versioning and issue reporting ✨ Add preload script for Bun bundler features
29 lines
1.1 KiB
TypeScript
29 lines
1.1 KiB
TypeScript
// src/shims/bun-bundle.ts
|
|
|
|
// Map of feature flags to their enabled state.
|
|
// In production Bun builds, these are compile-time constants.
|
|
// For our dev build, we read from env vars with sensible defaults.
|
|
const FEATURE_FLAGS: Record<string, boolean> = {
|
|
PROACTIVE: envBool('CLAUDE_CODE_PROACTIVE', false),
|
|
KAIROS: envBool('CLAUDE_CODE_KAIROS', false),
|
|
BRIDGE_MODE: envBool('CLAUDE_CODE_BRIDGE_MODE', false),
|
|
DAEMON: envBool('CLAUDE_CODE_DAEMON', false),
|
|
VOICE_MODE: envBool('CLAUDE_CODE_VOICE_MODE', false),
|
|
AGENT_TRIGGERS: envBool('CLAUDE_CODE_AGENT_TRIGGERS', false),
|
|
MONITOR_TOOL: envBool('CLAUDE_CODE_MONITOR_TOOL', false),
|
|
COORDINATOR_MODE: envBool('CLAUDE_CODE_COORDINATOR_MODE', false),
|
|
ABLATION_BASELINE: false, // always off for external builds
|
|
DUMP_SYSTEM_PROMPT: envBool('CLAUDE_CODE_DUMP_SYSTEM_PROMPT', false),
|
|
BG_SESSIONS: envBool('CLAUDE_CODE_BG_SESSIONS', false),
|
|
}
|
|
|
|
function envBool(key: string, fallback: boolean): boolean {
|
|
const v = process.env[key]
|
|
if (v === undefined) return fallback
|
|
return v === '1' || v === 'true'
|
|
}
|
|
|
|
export function feature(name: string): boolean {
|
|
return FEATURE_FLAGS[name] ?? false
|
|
}
|