/**
 * Feature flag registry for cowork-service.
 *
 * Defaults match the 13 platform flags seeded in H.1
 * (platform-service/src/modules/flags/seed.ts clawcowork entry).
 */
import { createFlagRegistry } from '@bytelyst/backend-flags';
import { config } from './config.js';

const registry = createFlagRegistry({
  defaults: {
    // ── Product-specific flags (seed.ts clawcowork entry) ──
    sandbox_enabled: true,
    plugins_enabled: true,
    mcp_connectors_enabled: true,
    scheduling_enabled: true,
    computer_use_enabled: false,
    parallel_agents_enabled: true,
    marketplace_enabled: true,
    wasm_plugins_enabled: false,
    llm_multi_model_enabled: false,
    audit_logging_enabled: true,
    platform_auth_required: false,
    dispatch_api_enabled: true,
    // ── Common flag (from COMMON_FLAGS in seed.ts) ──
    telemetry_enabled: false,
  },
  enabled: config.FEATURE_FLAGS_ENABLED,
});

export const { isFeatureEnabled, getAllFlags, setFlag } = registry;
