function defineFeatureCatalog(catalog) {
    return catalog;
}
const FEATURE_CATALOG_DEFINITION = {
    automations: {
        description: 'Automations feature surfaces and scheduling runtime.',
        defaultFailMode: 'fail_closed',
        dependencies: [],
        representation: 'server',
    },
    'execution.runs': {
        description: 'Execution runs / sub-agent orchestration surfaces and runtime.',
        defaultFailMode: 'fail_closed',
        dependencies: [],
        representation: 'client',
    },
    voice: {
        description: 'Happier voice assistant feature availability.',
        defaultFailMode: 'fail_closed',
        dependencies: [],
        representation: 'server',
    },
    'voice.happierVoice': {
        description: 'Happier-hosted voice backend availability (server-configured voice).',
        defaultFailMode: 'fail_closed',
        dependencies: ['voice'],
        representation: 'server',
    },
    'voice.agent': {
        description: 'Daemon-backed voice agent surfaces (requires execution runs substrate).',
        defaultFailMode: 'fail_closed',
        dependencies: ['voice', 'execution.runs'],
        representation: 'client',
    },
    connectedServices: {
        description: 'Connected services token sink and subscription/OAuth surfaces.',
        defaultFailMode: 'fail_closed',
        dependencies: [],
        representation: 'server',
    },
    'connectedServices.quotas': {
        description: 'Connected services quota snapshots (informational usage meters) surfaces and runtime.',
        defaultFailMode: 'fail_closed',
        dependencies: ['connectedServices'],
        representation: 'server',
    },
    channelBridges: {
        description: 'Channel bridge integrations (Telegram/Discord/etc).',
        defaultFailMode: 'fail_closed',
        dependencies: [],
        representation: 'server',
    },
    'channelBridges.telegram': {
        description: 'Telegram channel bridge provider.',
        defaultFailMode: 'fail_closed',
        dependencies: ['channelBridges'],
        representation: 'server',
    },
    'updates.ota': {
        description: 'Expo over-the-air update checks and apply flows.',
        defaultFailMode: 'fail_closed',
        dependencies: [],
        representation: 'server',
    },
    'attachments.uploads': {
        description: 'Client attachment uploads (files/images) sent to session runners for LLM access.',
        defaultFailMode: 'fail_closed',
        dependencies: [],
        representation: 'server',
    },
    'sharing.session': {
        description: 'Session sharing capability (share session with other users/devices).',
        defaultFailMode: 'fail_closed',
        dependencies: [],
        representation: 'server',
    },
    'sharing.public': {
        description: 'Public sharing link support for session content.',
        defaultFailMode: 'fail_closed',
        dependencies: [],
        representation: 'server',
    },
    'sharing.contentKeys': {
        description: 'Sharing content-key exchange support (E2EE sharing).',
        defaultFailMode: 'fail_closed',
        dependencies: [],
        representation: 'server',
    },
    'sharing.pendingQueueV2': {
        description: 'Pending queue v2 sharing/bridging surfaces and runtime.',
        defaultFailMode: 'fail_closed',
        dependencies: [],
        representation: 'server',
    },
    sessions: {
        description: 'Session-level product surfaces and control-plane capabilities.',
        defaultFailMode: 'fail_closed',
        dependencies: [],
        representation: 'client',
    },
    'sessions.handoff': {
        description: 'Session handoff between machines.',
        defaultFailMode: 'fail_closed',
        dependencies: ['sessions'],
        representation: 'server',
    },
    machines: {
        description: 'Machine control-plane transport capabilities.',
        defaultFailMode: 'fail_closed',
        dependencies: [],
        representation: 'client',
    },
    'machines.transfer': {
        description: 'Same-account machine transfer control plane.',
        defaultFailMode: 'fail_closed',
        dependencies: ['machines'],
        representation: 'client',
    },
    'machines.transfer.directPeer': {
        description: 'Direct peer machine transfer capability.',
        defaultFailMode: 'fail_closed',
        dependencies: ['machines.transfer'],
        representation: 'server',
    },
    'machines.transfer.serverRouted': {
        description: 'Server-routed machine transfer fallback capability.',
        defaultFailMode: 'fail_closed',
        dependencies: ['machines.transfer'],
        representation: 'server',
    },
    'social.friends': {
        description: 'Friends and related social feature availability.',
        defaultFailMode: 'fail_closed',
        dependencies: [],
        representation: 'server',
    },
    'inbox.global': {
        description: 'Global inbox aggregation surfaces (approvals, permissions, social, updates).',
        defaultFailMode: 'fail_closed',
        dependencies: [],
        representation: 'client',
    },
    'actions.approvals': {
        description: 'ActionSpec-driven approval request queue and inbox UI surfaces.',
        defaultFailMode: 'fail_closed',
        dependencies: ['inbox.global'],
        representation: 'client',
    },
    'prompts.library': {
        description: 'Prompt library (docs + skills bundles) stored as artifacts.',
        defaultFailMode: 'fail_closed',
        dependencies: [],
        representation: 'client',
    },
    'prompts.assets.external': {
        description: 'External prompt assets import/export surfaces and daemon adapters.',
        defaultFailMode: 'fail_closed',
        dependencies: ['prompts.library'],
        representation: 'client',
    },
    'prompts.skills.registries': {
        description: 'Prompt/skills registries and marketplace integrations (registry-of-registries).',
        defaultFailMode: 'fail_closed',
        dependencies: ['prompts.library', 'prompts.assets.external'],
        representation: 'client',
    },
    'auth.recovery.providerReset': {
        description: 'Auth provider reset support during recovery flows.',
        defaultFailMode: 'fail_closed',
        dependencies: [],
        representation: 'server',
    },
    'auth.login.keyChallenge': {
        description: 'Key-challenge login route availability (POST /v1/auth).',
        defaultFailMode: 'fail_closed',
        dependencies: [],
        representation: 'server',
    },
    'auth.mtls': {
        description: 'mTLS client certificate authentication support.',
        defaultFailMode: 'fail_closed',
        dependencies: [],
        representation: 'server',
    },
    'auth.ui.recoveryKeyReminder': {
        description: 'Recovery key reminder UI behavior.',
        defaultFailMode: 'fail_closed',
        dependencies: [],
        representation: 'server',
    },
    'auth.pairing.desktopQrMobileScan': {
        description: 'Pairing session support for desktop/web QR → logged-out mobile scan sign-in.',
        defaultFailMode: 'fail_closed',
        dependencies: [],
        representation: 'server',
    },
    'encryption.plaintextStorage': {
        description: 'Plaintext session storage support (no E2EE at rest).',
        defaultFailMode: 'fail_closed',
        dependencies: [],
        representation: 'server',
    },
    'encryption.accountOptOut': {
        description: 'Per-account encryption opt-out toggle support.',
        defaultFailMode: 'fail_closed',
        dependencies: ['encryption.plaintextStorage'],
        representation: 'server',
    },
    'e2ee.keylessAccounts': {
        description: 'Keyless account support (accounts may omit E2EE signing keys).',
        defaultFailMode: 'fail_closed',
        dependencies: [],
        representation: 'server',
    },
    'app.analytics': {
        description: 'Anonymous analytics and instrumentation (PostHog).',
        defaultFailMode: 'fail_closed',
        dependencies: [],
        representation: 'client',
    },
    'app.crashReports': {
        description: 'Crash reports and error telemetry (Sentry).',
        defaultFailMode: 'fail_closed',
        dependencies: [],
        representation: 'client',
    },
    'app.ui.storeReviewPrompts': {
        description: 'In-app store review prompts (native App Store / Play Store review sheet).',
        defaultFailMode: 'fail_closed',
        dependencies: [],
        representation: 'client',
    },
    'app.ui.sessionGettingStartedGuidance': {
        description: 'Session getting-started guidance UI (includes CLI install instructions).',
        defaultFailMode: 'fail_closed',
        dependencies: [],
        representation: 'client',
    },
    'app.ui.changelog': {
        description: 'What’s New / changelog UI surfaces (banner, settings entry, changelog screen).',
        defaultFailMode: 'fail_closed',
        dependencies: [],
        representation: 'client',
    },
    bugReports: {
        description: 'Bug report submission and diagnostics capability.',
        defaultFailMode: 'fail_closed',
        dependencies: [],
        representation: 'server',
    },
    'scm.writeOperations': {
        description: 'Source-control write operations in UI/CLI.',
        defaultFailMode: 'fail_closed',
        dependencies: [],
        representation: 'client',
    },
    'files.reviewComments': {
        description: 'Inline review comments anchored to file/diff lines.',
        defaultFailMode: 'fail_closed',
        dependencies: [],
        representation: 'client',
    },
    'files.diffSyntaxHighlighting': {
        description: 'Syntax highlighting for file and diff code rendering.',
        defaultFailMode: 'fail_closed',
        dependencies: [],
        representation: 'client',
    },
    'files.editor': {
        description: 'Embedded file editor in the session file browser.',
        defaultFailMode: 'fail_closed',
        dependencies: [],
        representation: 'client',
    },
    'files.syntaxHighlighting.advanced': {
        description: 'Advanced syntax highlighting engine selection (web/desktop).',
        defaultFailMode: 'fail_closed',
        dependencies: [],
        representation: 'client',
    },
    'terminal.embeddedPty': {
        description: 'Embedded terminal (PTY) surfaces backed by the daemon.',
        defaultFailMode: 'fail_closed',
        dependencies: [],
        representation: 'server',
    },
    'mcp.servers': {
        description: 'MCP servers management and injection support.',
        defaultFailMode: 'fail_closed',
        dependencies: [],
        representation: 'client',
    },
    'memory.search': {
        description: 'Local memory search UI entry and configuration surfaces.',
        defaultFailMode: 'fail_closed',
        dependencies: [],
        representation: 'client',
    },
    'sessions.direct': {
        description: 'Direct sessions (provider-backed transcript).',
        defaultFailMode: 'fail_closed',
        dependencies: [],
        representation: 'client',
    },
    'zen.navigation': {
        description: 'Zen navigation entry and related UX.',
        defaultFailMode: 'fail_closed',
        dependencies: [],
        representation: 'client',
    },
    'usage.reporting': {
        description: 'Usage reporting surfaces and telemetry views.',
        defaultFailMode: 'fail_closed',
        dependencies: [],
        representation: 'client',
    },
};
export const FEATURE_CATALOG = defineFeatureCatalog(FEATURE_CATALOG_DEFINITION);
export const FEATURE_IDS = Object.freeze(Object.keys(FEATURE_CATALOG));
export const FEATURE_ID_ENUM = (() => {
    if (FEATURE_IDS.length === 0) {
        throw new Error('FEATURE_CATALOG must not be empty');
    }
    return [FEATURE_IDS[0], ...FEATURE_IDS.slice(1)];
})();
const FEATURE_ID_SET = new Set(FEATURE_IDS);
export function isFeatureId(value) {
    return typeof value === 'string' && FEATURE_ID_SET.has(value);
}
export function getFeatureDefinition(featureId) {
    return FEATURE_CATALOG[featureId];
}
export function getFeatureDependencies(featureId) {
    return FEATURE_CATALOG[featureId].dependencies;
}
export function getFeatureRepresentation(featureId) {
    return FEATURE_CATALOG[featureId].representation;
}
export function isFeatureServerRepresented(featureId) {
    return FEATURE_CATALOG[featureId].representation === 'server';
}
const REQUIRES_SERVER_SNAPSHOT_MEMO = new Map();
export function featureRequiresServerSnapshot(featureId) {
    const cached = REQUIRES_SERVER_SNAPSHOT_MEMO.get(featureId);
    if (cached !== undefined)
        return cached;
    if (isFeatureServerRepresented(featureId)) {
        REQUIRES_SERVER_SNAPSHOT_MEMO.set(featureId, true);
        return true;
    }
    for (const dep of getFeatureDependencies(featureId)) {
        if (featureRequiresServerSnapshot(dep)) {
            REQUIRES_SERVER_SNAPSHOT_MEMO.set(featureId, true);
            return true;
        }
    }
    REQUIRES_SERVER_SNAPSHOT_MEMO.set(featureId, false);
    return false;
}
//# sourceMappingURL=catalog.js.map