Preferences
Configure the React Native native preferences tools to read and mutate platform preferences under explicit store and key restrictions.
Register the Suite
await Ansight.initializeAndActivate(
Ansight.createOptionsBuilder()
.withPreferencesTools({
allowedStores: ["standard"],
allowedKeyPrefixes: ["debug."],
})
.withReadWriteToolAccess()
.build(),
);
Registration API
withPreferencesTools(options): configures native preferences tool options.remoteTools.preferences.defaultStore: sets the default store.remoteTools.preferences.allowedStores: restricts stores.remoteTools.preferences.allowedKeys/allowedKeyPrefixes: restrict keys.
Specific Concerns
- Preference values often include configuration or user state.
- Restrict stores, keys, or key prefixes at registration time.
prefs.set_valueis write-scoped.prefs.remove_keyis delete-scoped and requireswithAllToolAccess().
Tool Matrix
| Name | Id | Scope | Description | Security |
|---|---|---|---|---|
List Preference Keys | prefs.list_keys | Read | Lists native preference keys. | Moderate |
Get Preference Value | prefs.get_value | Read | Reads one native preference value. | High |
Set Preference Value | prefs.set_value | Write | Writes one native preference value. | High |
Remove Preference Key | prefs.remove_key | Delete | Deletes one preference key. | High |
Tool Details
Use read tools for inspection. Enable write and delete only for local workflows that need preference repair.