Configuration API
Define, admit, project, and validate versioned runtime configuration without treating form metadata as authority.
Configuration API
Import the configuration contracts from @taucad/runtime/schema. A configuration has a trusted Standard Schema for validation and a bounded, serializable manifest for display and transport. The manifest's form hints do not validate submitted values.
Definition and validation
defineConfiguration accepts a ConfigurationSource: an id, version, Standard Schema, optional defaults, and restricted UI metadata. Non-Standard-JSON schemas also require a JSON Schema converter. It returns a ConfigurationDefinition containing the frozen ConfigurationManifestV1, canonical manifest text, diagnostics, schema, and asynchronous manifestDigest().
validateConfiguration takes ValidateConfigurationInput: definition, matching manifest digest, monotonically tracked form revision, raw value, explicit RFC 6901 pointers, and optional abort signal. ValidateConfigurationResult is discriminated by type: valid carries the parsed output and effective digest; invalid carries ConfigurationIssue values with code, message, and pointer. Keep the returned revision and digest so late validations cannot overwrite newer edits.
admitConfigurationManifest parses an untrusted manifest into ConfigurationAdmissionResult, including cosmetic ConfigurationAdmissionDiagnostic entries. Admission checks the wire shape only. admitJsonSchema admits the JsonSchema that manifests and provider descriptors use.
Native parameter projection and UI hints
ConfigurationManifestV1.parameters has input and output ConfigurationNativeProjection values. A usable projection carries a ParameterDeclaration (exported from @taucad/runtime/kernel); an unsupported projection carries defaults and ConfigurationNativeProjectionDiagnostic reasons. Check the status before showing a native editor. The manifest also carries a draft-07 projection.
RestrictedRjsfUiSchemaV1 wraps a JSON-only RestrictedUiNodeV1. Its RestrictedUiWidgetV1 values are color, radio, segmented, select, slider, textarea, and toggle. configurationIconIds is the admitted icon vocabulary; ConfigurationIconId types its members. Unsupported icon hints produce a diagnostic.
Import quantity and QuantitySchemaOptions from @taucad/runtime/schema/zod to declare unit-bearing numeric fields. Import quantityKinds from @taucad/units/quantity for the reviewed quantity-kind identities. Validate units at the authority boundary.
Import SourceRevision and GetParameterDeclarationsResult from @taucad/runtime/types. The former identifies the source state of an operation; the latter carries declarations resolved for it. Do not reuse them after the source changes.
Project config
A tau.config.ts beside tau.json default-exports defineConfig({ plugins: [zoo()] }), a TauConfig from @taucad/runtime/config. Each plugin replaces the same-named built-in or is appended.
Node hosts call loadTauConfig from @taucad/runtime/config/node with LoadTauConfigOptions. It returns a LoadedTauConfig and throws a TypeError for an ambiguous, escaping or invalid config. Config files are trusted code.