import { IStringDictionary } from "../../../../../../base/common/collections.js"; import { IJSONSchema } from "../../../../../../base/common/jsonSchema.js"; import { ILanguageModelConfigurationSchema } from "../../../common/languageModels.js"; /** Applies host-owned read-only values while retaining the provenance of displayed defaults. */ export declare function applyModelConfigurationDefaults(configuration: IStringDictionary, preferences: IStringDictionary | undefined, schema: ILanguageModelConfigurationSchema | undefined, keys: readonly string[] | undefined, startupDefaults?: readonly string[]): IStringDictionary; export declare function assertModelConfigurationWritable(values: IStringDictionary, schema: ILanguageModelConfigurationSchema | undefined): void; /** Keeps serialized defaults out of durable preferences, including before a model re-registers. */ export declare function modelConfigurationPreferences(values: IStringDictionary, preserveDefaults?: boolean): IStringDictionary; /** * Extracts the schema-default values from a model configuration schema, keyed by * property name. Properties without a `default` are omitted. */ export declare function extractSchemaDefaults(schema: ILanguageModelConfigurationSchema | undefined): IStringDictionary; /** * Filters a configuration down to what the *current* schema accepts, so neither a value * captured against an older schema nor one supplied by an experiment treatment can be pinned * as an invalid override. A value is kept only when its property is declared and every * constraint this understands is satisfied: * 1. Keys absent from the current schema are dropped (removed properties). * 2. `enum` and `const` must contain the value, and `enumItemDisabled` must not mark it. * 3. `type` must match, including a union of types. * 4. Numeric bounds and string `pattern`/length are enforced when declared. * A property using a composite schema (`anyOf`, `oneOf`, `allOf`, `not`, `$ref`) is failed * closed, since a value cannot be checked against a shape this does not interpret. When the * schema is missing entirely, nothing can be validated and an empty configuration is returned. */ export declare function filterConfigurationToSchema(values: IStringDictionary, schema: ILanguageModelConfigurationSchema | undefined): IStringDictionary; export declare function isDisabledEnumValue(value: unknown, schema: { enum?: unknown[]; enumItemDisabled?: boolean[]; } & IJSONSchema): boolean; /** * Resolves the effective configuration for a model within a single * `(location, sessionType)` scope. * * A *present* stored entry — even an empty one, which marks an explicit * reset-to-default — wins and is merged over the schema defaults. Only a * *missing* entry (`undefined`) falls back to the profile-global value, which is * the one-time migration for setups that pre-date per-editor scoping. * * Schema defaults are merged in every branch so a value the user never * explicitly set (e.g. a model's default `contextSize`) is always present in the * resolved configuration. Otherwise the model picker — which paints the schema * default when a key is absent — would show one value while the request and the * context-usage widget, which read the resolved configuration, fall back to the * model's full native window. See issue #320393. * * Distinguishing "present but empty" from "absent" is what prevents a newly * opened editor from reverting an explicit default selection back to a stale * profile-global value. See issue #320393. */ export declare function resolveModelConfiguration(storedEntry: IStringDictionary | undefined, schemaDefaults: IStringDictionary, globalConfig: IStringDictionary | undefined): IStringDictionary; /** * Computes the entry to persist for a model after applying `values` on top of the * `current` effective configuration. Values equal to their schema default are * stripped so storage holds only genuine user overrides. * * The result may be an empty object: callers are expected to still persist it so * that an explicit reset-to-default is remembered and does not fall back to the * profile-global value on the next read. See issue #320393. */ export declare function computeStoredConfiguration(current: IStringDictionary, values: IStringDictionary, schemaDefaults: IStringDictionary): IStringDictionary;