Skip to main content

Module settings

Module settings 

Source
Expand description

The class catalogue and the effective-config document.

One table lists every key the loader accepts, the area it draws in and when an edit to it takes effect; each entry also resolves its own value from a LoadedConfig. The reload summary and the settings page both read that table, so a key cannot be live in one and next-session in the other.

Re-exportsยง

use std::collections::BTreeSet; ๐Ÿ”’
use std::path::Path; ๐Ÿ”’
use forge_primitives::settings::SettingsTotals; ๐Ÿ”’
use forge_primitives::EditKind; ๐Ÿ”’
use forge_primitives::EffectClass; ๐Ÿ”’
use forge_primitives::SettingKind; ๐Ÿ”’
use forge_primitives::SettingsArea; ๐Ÿ”’
use forge_primitives::SettingsDocument; ๐Ÿ”’
use forge_primitives::SettingsEdit; ๐Ÿ”’
use forge_primitives::SettingsKey; ๐Ÿ”’
use serde_json::json; ๐Ÿ”’
use crate::config::ConfigReload; ๐Ÿ”’
use crate::config::DEFAULT_HANDOFF_AFTER_COMPACTIONS; ๐Ÿ”’
use crate::config::DEFAULT_HANDOFF_AT_PERCENT; ๐Ÿ”’
use crate::config::DEFAULT_MAX_WORKERS_PER_PROJECT; ๐Ÿ”’
use crate::config::LoadedConfig; ๐Ÿ”’
use crate::config::LoadedProject; ๐Ÿ”’
use crate::config::format_session_duration; ๐Ÿ”’

Structsยง

AreaSpec
One areaโ€™s fixed identity: the id the page keys on, the name it draws, and the line under it.
CatalogueKeyTarget ๐Ÿ”’
One catalogue patternโ€™s own metadata, for a key the config does not set and therefore emits no row for.
ConfigKey
One accepted key: its pattern, the area it draws in, its class, and the rows it resolves to for a load.
EditSpec ๐Ÿ”’
One keyโ€™s edit metadata, in the catalogueโ€™s own static form.
KeyRow ๐Ÿ”’
One row a catalogued key resolves to: a concrete path (with the instance where the table repeats) and the effective value.
SettingsTarget ๐Ÿ”’
One key a settings tool can address: the document row the writer would locate, with everything an edit needs to be built and validated.

Constantsยง

ACCOUNT_KEYS ๐Ÿ”’
AREAS
The sub-navโ€™s areas, in the order it draws them. [browser] rides with the server that hosts it; [dictate] and [tts] share the voice area, because they are the two directions of one conversation.
BOOLEAN ๐Ÿ”’
CLIENT_KEYS ๐Ÿ”’
CONNECTOR_KEYS ๐Ÿ”’
DICTATE_BINDS ๐Ÿ”’
DICTATE_CONTEXTS ๐Ÿ”’
DICTATE_KEYS ๐Ÿ”’
DICTATE_MODES ๐Ÿ”’
DICTATE_STRUCTURES ๐Ÿ”’
DICTATE_STYLINGS ๐Ÿ”’
DOCUMENT_KEYS ๐Ÿ”’
ENV_KEYS ๐Ÿ”’
GATEWAY_KEYS ๐Ÿ”’
HANDOFF_KEYS ๐Ÿ”’
LIST ๐Ÿ”’
MODEL_KEYS ๐Ÿ”’
NUMBER ๐Ÿ”’
PERMISSION_MODES ๐Ÿ”’
PROJECT_KEYS ๐Ÿ”’
PROVIDERS ๐Ÿ”’
SERVER_KEYS ๐Ÿ”’
SESSION_KEYS ๐Ÿ”’
TERMINAL_KEYS ๐Ÿ”’
TEXT ๐Ÿ”’
TTS_KEYS ๐Ÿ”’
The speaking roleโ€™s keys: the other direction of the same voice area.
USAGE_KEYS ๐Ÿ”’

Functionsยง

all_keys ๐Ÿ”’
catalogue_target ๐Ÿ”’
The catalogue entry a pattern names, or None when it is not a key the loader accepts.
changed_paths ๐Ÿ”’
choice ๐Ÿ”’
diff ๐Ÿ”’
The reload summary, derived from the same rows the page draws: a key reported as moved and the class the page chips it with are one tableโ€™s.
document ๐Ÿ”’
The whole document for one load, every catalogued key resolved.
edit_kind_name ๐Ÿ”’
The name of a valueโ€™s edit control, as the index states its type.
edit_spec ๐Ÿ”’
The control and the entry a catalogued key belongs to. The default is a plain text field; a numeric, boolean, list or choice key is named here, and a test holds each edit kind to the value kind the resolver draws.
edit_wire ๐Ÿ”’
enum_name ๐Ÿ”’
flag ๐Ÿ”’
index_instances ๐Ÿ”’
The instance names a repeated catalogue key takes, for the callerโ€™s own reach: its projectโ€™s keys list its project alone, and the global accounts, workspaces and models list every one this config declares.
index_row_in_reach ๐Ÿ”’
Whether a row is one the callerโ€™s reach covers: its own projectโ€™s rows and its own orgโ€™s, so another projectโ€™s set key does not mark the callerโ€™s index as set.
index_text ๐Ÿ”’
The compact catalogue an agent reads: sections and keys with type, whether the config sets one, and when an edit lands. No value crosses, so this is the shape of the file without its contents.
index_value_set ๐Ÿ”’
Whether a rowโ€™s value is one the reader would act on. The resolvers draw โ€œnot setโ€ for an unset optional that has no row of its own (a modelโ€™s window), so that placeholder is not a setting either.
instance ๐Ÿ”’
The longest of names the path names after prefix, and the key tail that follows it.
instances_exist ๐Ÿ”’
Whether the instance names a pattern took all exist in config.
key_leaf ๐Ÿ”’
The keyโ€™s own name from a tail that may start with a repeated table: model_slugs.glm-5.3-flash names the slug, not the table.
last_segment ๐Ÿ”’
list ๐Ÿ”’
named ๐Ÿ”’
number ๐Ÿ”’
org_names ๐Ÿ”’
org_project ๐Ÿ”’
owning_org ๐Ÿ”’
The org a concrete path belongs to, when it is one of the orgโ€™s own keys (orgs.<org>.browser_profile, the orgโ€™s Slack binding) rather than a projectโ€™s. A read from another org is refused by name like another projectโ€™s key is: the orgโ€™s settings shape every project in it, and the org segment is ownership even though the planโ€™s sentence names projects.
owning_project ๐Ÿ”’
The project a concrete path belongs to, when the path is one of a projectโ€™s keys. The configโ€™s own names are matched, longest first, so a project name containing a dot stays one name.
project_path ๐Ÿ”’
provider_label ๐Ÿ”’
required ๐Ÿ”’
resolve_target ๐Ÿ”’
The target a callerโ€™s path names for a read or a write.
sorted_keys ๐Ÿ”’
split_row ๐Ÿ”’
The instance names and the keyโ€™s own name for one row.
synthetic_key ๐Ÿ”’
The row a writer locates for a key the document does not carry: its pattern and path are the editโ€™s own, and only the fields set_key reads are populated.
target ๐Ÿ”’
The document row a concrete path names, or None when the path is no key this load resolves. settings__get and settings__set take a path exactly as the row states it - never a catalogue pattern, which has no value and no instance to write.
text ๐Ÿ”’
text_set ๐Ÿ”’
An optional settingโ€™s raw value: the value when the file set it, and null when it did not. The effective built-in is the pageโ€™s to draw, so the clientโ€™s axes path never reads a display default back as a setting.