/** * feature-settings-queries.ts, the questions a surface asks of the * FEATURE_SETTINGS catalog next door. * * Every platform capability is configured through a first-class settings key * in its natural domain (behavior.compactionStrategy, sandbox.enabled, * surfaces.slack.enabled, ...). There is no separate enablement namespace. * The recurring questions: * - which feature a given id names, and whether a stock config has it on, * - whether a raw config value means the feature is currently on, * - which single settings write turns a feature on or off. * * Enablement kinds (from the SDK binding layer): * - boolean : the key's boolean value is the enablement. * - enum : active while the key's value is in enabledValues (several * features can share one key, e.g. behavior.compactionStrategy). * - constant: the capability has no separate off switch. When its key is a * boolean (the surface enabled keys) that value is the honest * user-facing switch; a non-boolean constant key (e.g. * fetch.sanitizeMode) has no off position at all. */ import { type ConfigKey, type ConfigManager, type ConfigSetting } from '../../config/index.js'; import { type FeatureSetting } from '../state.js'; export type { FeatureSetting } from '../state.js'; /** Every capability by id, in SDK declaration order. */ export declare const FEATURE_SETTINGS_BY_ID: ReadonlyMap; export declare function getFeatureSetting(featureId: string): FeatureSetting | null; /** The CONFIG_SCHEMA descriptor for a settings key, or null for host-local synthetics. */ export declare function getConfigSchemaSetting(key: string): ConfigSetting | null; /** Whether a stock configuration has the feature active. */ export declare function isFeatureDefaultEnabled(featureId: string): boolean; /** All features whose enablement key is `key` (several features can share one). */ export declare function featuresForEnablementKey(key: string): readonly FeatureSetting[]; /** * Whether a raw config value means the feature is on, as a settings surface * should display it. Boolean/enum kinds derive exactly as the runtime gate * does; constant kinds fall back to the boolean key value when there is one * (the honest user-facing switch for the surface adapters) and read as always * on otherwise. */ export declare function isFeatureValueEnabled(feature: FeatureSetting, value: unknown): boolean; /** Whether the live config currently has the feature on (see isFeatureValueEnabled). */ export declare function isFeatureConfigEnabled(configManager: Pick, featureId: string): boolean; export interface FeatureEnablementWrite { readonly key: ConfigKey; readonly value: boolean | string; } /** * The single settings write that turns a feature on or off, or null when the * feature has no off position (a constant-kind capability on a non-boolean * key). For enum kinds the schema default is preferred whenever it sits on * the requested side, so "enable" lands on the feature's stock mode and * "disable" lands on the stock off mode rather than an arbitrary value. */ export declare function featureEnablementWrite(featureId: string, enabled: boolean): FeatureEnablementWrite | null; //# sourceMappingURL=feature-settings-queries.d.ts.map