Configurator¶
Read-only adapter over the public shape of oa-configurator stack models.
NativeConfigResourceAdapter ¶
Fallback adapter for ordinary configuration sections.
Consumers can register exact adapters for richer resource semantics. This fallback is
intentionally plain: it offers display fields and validates nothing beyond the model
layer that oa-configurator will run during a real apply.
OAConfiguratorAdapter ¶
Build safe, read-only views from public oa-configurator model objects.
The adapter is deliberately structural: tests and demos can pass fakes, while real
consumers pass StackConfig and PackageConfigBase instances from oa-configurator.
Editable drafts and persistence are intentionally left for a later phase that can use
a public revision-aware mutation API.
diff ¶
diff(
target: ConfigTarget,
original_fields: Mapping[str, object],
candidate_fields: Mapping[str, object],
*,
sensitive_fields: frozenset[str] = frozenset(),
) -> ConfigDiff
Build a redacted structural diff for confirmation surfaces.
snapshot ¶
snapshot(
stack_config: object,
*,
config_path: str | Path | None = None,
package_configs: Iterable[object] = (),
title: str = "Stack configuration",
) -> ConfiguratorSnapshot
wizard_controller ¶
wizard_controller(
target: ConfigTarget,
adapters: Iterable[ConfigResourceAdapter],
) -> WizardController | None
Return the first consumer adapter that can drive a setup wizard.
Groundskeeping only brokers the Textual-free controller. The adapter that understands the resource still owns candidate state, validation, revision checks, and apply semantics.
Textual-free models for presenting stack configuration.
ConfigApplyIntent
dataclass
¶
ConfigApplyIntent(
target: ConfigTarget,
apply_token: str,
expected_revision: str | None,
diff: ConfigDiff,
effects: tuple[EffectRef, ...] = (),
)
UI-level request to apply a validated draft through oa-configurator.
ConfigDiff
dataclass
¶
ConfigDiff(
target: ConfigTarget,
entries: tuple[ConfigDiffEntry, ...],
)
ConfigDiffEntry
dataclass
¶
ConfigDiffEntry(
field: str,
before: object,
after: object,
sensitive: bool = False,
)
ConfigDraft
dataclass
¶
ConfigDraft(
target: ConfigTarget,
changed_fields: frozenset[str] = frozenset(),
expected_revision: str | None = None,
)
Presentation-safe description of an edit session.
The expected revision is opaque on purpose. oa-configurator owns how a real file or
in-memory stack is fingerprinted; the widget only carries the token back when asking
a public mutation service to apply the draft.
The real candidate object belongs to the consumer-owned wizard/controller. This draft only names the safe target and records which fields are changed.
ConfigResourceAdapter ¶
Bases: Protocol
Consumer extension point for richer resource-specific presentation.
ConfigSectionView
dataclass
¶
ConfigSectionView(
target: ConfigTarget,
fields: Mapping[str, object] = dict(),
children: tuple[ConfigSectionView, ...] = (),
notes: tuple[str, ...] = (),
)
Read-only view of one configuration section.
fields
class-attribute
instance-attribute
¶
fields: Mapping[str, object] = field(default_factory=dict)
ConfigTarget
dataclass
¶
ConfigTarget(
kind: str,
key: str,
title: str,
status: SemanticStatus = SemanticStatus.INFO,
)
ConfiguratorSnapshot
dataclass
¶
ConfiguratorSnapshot(
title: str,
profile: str | None,
path: str | None,
sections: tuple[ConfigSectionView, ...],
)