Protected Readonly_ReadonlyonProtected ReadonlyonProtected ReadonlypreferenceProtected ReadonlytoProtected ReadonlytrustResolves once the underlying preference service and the initial workspace-trust state are ready. Await this before the first read for a deterministic, trust-aware result.
ProtectedenrichDerives the trust-aware AiConfigurationInspection.sourceScope and effective value
from a raw PreferenceInspection. The workspace-trust rule is applied once, via
TrustAwarePreferenceReader.suppressUntrusted (the single owner of that rule): when
untrusted, folder and workspace scope values are cleared, so the scope walk below naturally
resolves to the user/default scope and the whole inspection stays consistent with get.
Note: value reflects the narrowest defined scope, matching PreferenceService.inspect. For
object-valued preferences this can differ from get, which deep-merges across scopes.
Retrieves the effective, trust-aware value for the given preference.
the preference identifier.
OptionaldefaultValue: Tthe value to return when no value is stored.
OptionalresourceUri: stringthe uri of the resource for which the preference is read.
ProtectedinitRetrieves the per-scope values for the given preference, enriched with a derived, trust-aware AiConfigurationInspection.sourceScope and effective PreferenceInspection.value.
the preference identifier.
OptionalresourceUri: stringthe uri of the resource for which the preference is inspected.
Writes value to the given scope. Maps to PreferenceService.set.
the preference identifier.
the new value (must be JSON-serializable). undefined clears the value in the given scope.
the scope to write to. For PreferenceScope.Folder a resourceUri is required.
OptionalresourceUri: stringthe uri of the resource for which the preference is stored.
"Smart write": picks the scope so that the effective value becomes value. Maps to
PreferenceService.updateValue.
the preference identifier.
the value to apply (must be JSON-serializable). undefined resets the preference to its default value.
OptionalresourceUri: stringthe uri of the resource to which the change applies.
Framework API for reading and writing AI-related (
ai-features.*) preferences.AiConfigurationServicewraps the corePreferenceServiceand is the intended extension point for adopters and extensions that configure AI features: prefer it over talking toPreferenceServicedirectly forai-features.*keys. Routing all AI configuration through this seam keeps consumers insulated from future changes to how AI preferences are stored.Reads (get, inspect) are workspace-trust-aware: workspace and folder scope values are suppressed while the workspace is untrusted (failing closed until the trust state resolves), matching how AI features read preferences today. Writes (set, update) are never gated by trust.