MilanoViewBuilder

The construction gate's public face: a MilanoView is created exclusively through a MilanoViewBuilder, obtained from a MilanoEngine.

Functions

Link copied to clipboard
fun action(name: String, parameters: Map<String, MilanoType> = emptyMap(), result: MilanoType? = null, failure: MilanoType? = null): MilanoViewBuilder

Declares (or overrides) a custom action for this surface: the name, parameter shape, optional success result type, and optional failure payload type join the granted set for this builder only. Declarations type the payload; meaning is assigned by this surface's action handler.

Link copied to clipboard

The view's action handler; required when the document uses custom actions.

Link copied to clipboard

Grants only the listed custom actions to this surface: a document binding any other custom action fails at the gate with a SchemaViolation (rule "action-capability"). Built-in dollar actions are contract, not capabilities, and are always available.

Link copied to clipboard
suspend fun build(): MilanoView

Building is asynchronous: the document is parsed and validated in full, then the state data provider is awaited and its values are validated against the document's declarations. Throws typed MilanoBuildExceptions; provider failures propagate unchanged.

Link copied to clipboard

Supplies fixed context values for the keys the document declares.

Link copied to clipboard

Supplies an observable context source (see MilanoContextHandle).

Link copied to clipboard

The serialization seam; the platform layer binds it to the main thread.

Link copied to clipboard
fun function(name: String, arguments: List<MilanoType>, returns: MilanoType): MilanoViewBuilder

Declares (or overrides) a host function for this surface (contract 2.1): its argument types in order and its return type join the vocabulary's declarations for this builder only. The engine's function handler resolves it by name like any other.

Link copied to clipboard

Host-chosen name attached to this view's observability reports.

Link copied to clipboard

Per-view override of the engine's default unknown-type policy.