Skip to content

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.

key class-attribute instance-attribute

key = 'native'

describe

describe(target: ConfigTarget) -> ConfigSectionView

fields

fields(target: ConfigTarget) -> tuple[FieldSpec, ...]

post_apply_effects

post_apply_effects(draft: ConfigDraft) -> tuple[str, ...]

supports

supports(target: ConfigTarget) -> bool

validate

validate(draft: ConfigDraft) -> tuple[ValidationIssue, ...]

wizard_controller

wizard_controller(
    target: ConfigTarget,
) -> WizardController | None

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.

as_tree_view

as_tree_view(snapshot: ConfiguratorSnapshot) -> TreeView

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.

EffectRef module-attribute

EffectRef = str

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.

apply_token instance-attribute

apply_token: str

diff instance-attribute

diff: ConfigDiff

effects class-attribute instance-attribute

effects: tuple[EffectRef, ...] = ()

expected_revision instance-attribute

expected_revision: str | None

target instance-attribute

target: ConfigTarget

ConfigDiff dataclass

ConfigDiff(
    target: ConfigTarget,
    entries: tuple[ConfigDiffEntry, ...],
)

changed property

changed: bool

entries instance-attribute

entries: tuple[ConfigDiffEntry, ...]

target instance-attribute

target: ConfigTarget

ConfigDiffEntry dataclass

ConfigDiffEntry(
    field: str,
    before: object,
    after: object,
    sensitive: bool = False,
)

after instance-attribute

after: object

before instance-attribute

before: object

field instance-attribute

field: str

sensitive class-attribute instance-attribute

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.

changed property

changed: bool

changed_fields class-attribute instance-attribute

changed_fields: frozenset[str] = frozenset()

expected_revision class-attribute instance-attribute

expected_revision: str | None = None

target instance-attribute

target: ConfigTarget

ConfigResourceAdapter

Bases: Protocol

Consumer extension point for richer resource-specific presentation.

key instance-attribute

key: str

describe

describe(target: ConfigTarget) -> ConfigSectionView

fields

fields(target: ConfigTarget) -> tuple[FieldSpec, ...]

post_apply_effects

post_apply_effects(
    draft: ConfigDraft,
) -> tuple[EffectRef, ...]

supports

supports(target: ConfigTarget) -> bool

validate

validate(draft: ConfigDraft) -> tuple[ValidationIssue, ...]

wizard_controller

wizard_controller(
    target: ConfigTarget,
) -> WizardController | None

ConfigSectionView dataclass

ConfigSectionView(
    target: ConfigTarget,
    fields: Mapping[str, object] = dict(),
    children: tuple[ConfigSectionView, ...] = (),
    notes: tuple[str, ...] = (),
)

Read-only view of one configuration section.

children class-attribute instance-attribute

children: tuple[ConfigSectionView, ...] = ()

fields class-attribute instance-attribute

fields: Mapping[str, object] = field(default_factory=dict)

notes class-attribute instance-attribute

notes: tuple[str, ...] = ()

target instance-attribute

target: ConfigTarget

ConfigTarget dataclass

ConfigTarget(
    kind: str,
    key: str,
    title: str,
    status: SemanticStatus = SemanticStatus.INFO,
)

One selectable configuration target.

key instance-attribute

key: str

kind instance-attribute

kind: str

status class-attribute instance-attribute

status: SemanticStatus = SemanticStatus.INFO

title instance-attribute

title: str

ConfiguratorSnapshot dataclass

ConfiguratorSnapshot(
    title: str,
    profile: str | None,
    path: str | None,
    sections: tuple[ConfigSectionView, ...],
)

Read-only snapshot of an effective oa-configurator stack.

path instance-attribute

path: str | None

profile instance-attribute

profile: str | None

sections instance-attribute

sections: tuple[ConfigSectionView, ...]

title instance-attribute

title: str

RedactedValue dataclass

RedactedValue(label: str = '<redacted>')

Marker used when a known secret must not enter ordinary view models.

label class-attribute instance-attribute

label: str = '<redacted>'

__str__

__str__() -> str