A12Document
A whole document in A12's canonical Document JSON, root group names at the top level.
/** A whole document in A12's canonical Document JSON, root group names at the top level. */
export type A12Document = A12DocumentGroup;
A12DocumentField
One field cell in A12 Document JSON: `null` is a present cell with no value.
/** One field cell in A12 Document JSON: `null` is a present cell with no value. */
export type A12DocumentField = string | number | boolean | null;
A12DocumentGroup
One group instance in A12 Document JSON — the Kernel's own document shape: a nested object mirrors a non-repeating group, an **array** carries the repetitions of a repeating group (the index *is* the repetition, an unfilled row is `{}`), a missing key is an omission, and a field is its value.
/**
* One group instance in A12 Document JSON — the Kernel's own document shape: a nested object mirrors a
* non-repeating group, an **array** carries the repetitions of a repeating group (the index *is* the
* repetition, an unfilled row is `{}`), a missing key is an omission, and a field is its value.
*/
export interface A12DocumentGroup {
readonly [name: string]: A12DocumentField | A12DocumentGroup | readonly A12DocumentGroup[];
}
A12PartiallyKnownMultiPointer
A12's `PartiallyKnownDocumentMultiPointer` — the addressing type A12 puts on runtime **messages**, returned by all three of `IMessage`'s address accessors and handed to `ICustomCondition`. Its indexes admit {@link A12PartiallyKnownMultiPointer.WILDCARD} at any part and {@link A12PartiallyKnownMultiPointer.UNKNOWN} for a level that matched no row. **There is no pointer string for this type.** A12 defines neither a parser nor a renderer for one, so this package publishes the owner's value and the owner's operations and nothing else. The owner operations of {@link A12PartiallyKnownMultiPointer}, mirroring the Kotlin companion. Declared beside the interface of the same name, so `A12PartiallyKnownMultiPointer` is both the type and its factory — the way `PartiallyKnownDocumentMultiPointer` is in A12, where the static factories live on the interface itself.
/**
* A12's `PartiallyKnownDocumentMultiPointer` — the addressing type A12 puts on runtime **messages**, returned by
* all three of `IMessage`'s address accessors and handed to `ICustomCondition`.
*
* Its indexes admit {@link A12PartiallyKnownMultiPointer.WILDCARD} at any part and
* {@link A12PartiallyKnownMultiPointer.UNKNOWN} for a level that matched no row.
*
* **There is no pointer string for this type.** A12 defines neither a parser nor a renderer for one, so this
* package publishes the owner's value and the owner's operations and nothing else.
*/
export interface A12PartiallyKnownMultiPointer {
readonly [A12_PARTIALLY_KNOWN_POINTER]: true;
/** `fullName()` — each name with a leading slash, so the root pointer is `"/"`. */
readonly fullName: string;
readonly repetitionIndexes: readonly number[];
}
A12PartiallyKnownMultiPointer: Readonly<{
/** `DocumentMultiPointer.WILDCARD` — all repetitions of a level. Legal at **every** part on this type. */
WILDCARD: number;
/**
* `PartiallyKnownDocumentMultiPointer.UNKNOWN` (`IIdentifier.UNKNOWN`) — not an index and not a wildcard, but
* a level the engine could not resolve to a row, which a parallel iteration can leave at any joined level.
*/
UNKNOWN: number;
/** `PartiallyKnownDocumentMultiPointer.of(fullName, repetitions)` — the one construction path. */
of(fullName: string, repetitionIndexes: readonly number[]): A12PartiallyKnownMultiPointer;
/**
* `toDocumentPointer()` — the exact pointer when this message pointer is one, else `null`.
*
* `null` is a legitimate answer, not a failure: a wildcard above the last part, or an unknown index anywhere,
* names a set or an unresolved level rather than one cell. The **root** raises instead of answering, which is
* A12's own measured behaviour for that edge rather than a choice made here.
*/
toExactPointer(pointer: A12PartiallyKnownMultiPointer): A12Pointer | null;
}>
A12PathPart
One part of an exact A12 pointer — A12's `PathPart`: a name and its 1-based repetition index.
/** One part of an exact A12 pointer — A12's `PathPart`: a name and its 1-based repetition index. */
export interface A12PathPart {
readonly name: string;
readonly repetitionIndex: number;
}
A12Pointer
One **exact** A12 `DocumentPointer`: its ordered parts, plus the two views A12 derives from them. Every `repetitionIndex` is `>= 1`, except the last, which may also be {@link A12PointerFormat.LAST_PART_ZERO} to address A12's `RepetitionsV2` slot. Nothing negative is representable here — a repetition the engine could not resolve to a row is an {@link A12PartiallyKnownMultiPointer}, which is a different type.
/**
* One **exact** A12 `DocumentPointer`: its ordered parts, plus the two views A12 derives from them.
*
* Every `repetitionIndex` is `>= 1`, except the last, which may also be
* {@link A12PointerFormat.LAST_PART_ZERO} to address A12's `RepetitionsV2` slot. Nothing negative is
* representable here — a repetition the engine could not resolve to a row is an
* {@link A12PartiallyKnownMultiPointer}, which is a different type.
*/
export interface A12Pointer {
readonly [A12_EXACT_POINTER]: true;
readonly pathParts: readonly A12PathPart[];
/** `DocumentPointer.fullName()` — each name with a leading slash, so the root pointer is `""`. */
readonly fullName: string;
readonly repetitionIndexes: readonly number[];
}
A12PointerFormat
A12's canonical **exact** `DocumentPointer` string — parts joined by `/`, each part optionally followed by `[n]`, with an absent bracket meaning repetition 1: `Order/Items[2]/Count`. This is the **string codec**, and its name grammar (`[\w_-]+` per part) is the codec's precondition, not the pointer value's: A12's own `PathPart` accepts any non-empty name, and only what is *written* into a pointer string is restricted, so that the string parses back to the same pointer. A malformed argument raises a `TypeError`. That is a caller contract violation, not a model diagnostic, so it carries no code and no structured details and is not one of this package's named `Error` subclasses.
/**
* A12's canonical **exact** `DocumentPointer` string — parts joined by `/`, each part optionally followed by
* `[n]`, with an absent bracket meaning repetition 1: `Order/Items[2]/Count`.
*
* This is the **string codec**, and its name grammar (`[\w_-]+` per part) is the codec's precondition, not the
* pointer value's: A12's own `PathPart` accepts any non-empty name, and only what is *written* into a pointer
* string is restricted, so that the string parses back to the same pointer.
*
* A malformed argument raises a `TypeError`. That is a caller contract violation, not a model diagnostic, so it
* carries no code and no structured details and is not one of this package's named `Error` subclasses.
*/
export declare class A12PointerFormat {
/** The repetition A12 permits only on an exact pointer's last part, where it addresses `RepetitionsV2`. */
static readonly LAST_PART_ZERO: number;
/** Render `path` (with or without a leading `/`) and its positional `repetitions` as the canonical string. */
static format(path: string, repetitions: readonly number[]): string;
/** Parse a canonical, house-form, or leading-slash exact pointer. */
static parse(pointer: string): A12Pointer;
}
A12Result
Success or one native typed error without throwing.
/** Success or one native typed error without throwing. */
export type A12Result<T, E extends Error> = {
readonly ok: true;
readonly value: T;
} | {
readonly ok: false;
readonly error: E;
};
ComputationOutcome
Whether one computed field received a value, was cleared, or could not be computed.
/** Whether one computed field received a value, was cleared, or could not be computed. */
export type ComputationOutcome = "value" | "cleared" | "errored";
ComputationReport
Retained computation result: report-all outcomes, source-relative actions, and support status.
/** Retained computation result: report-all outcomes, source-relative actions, and support status. */
export interface ComputationReport {
/** Every computed cell, including successful values unchanged from the computation source. */
readonly results: readonly ComputationResult[];
/** Source-relative VALUE/CLEARED/ERRORED actions retained for application. */
readonly actions: readonly ComputationResult[];
/** Eager formal diagnostics from selected computation operands. */
readonly formalErrorsInOperands: readonly ValidationFinding[];
readonly unsupported: readonly UnsupportedProgram[];
/** True exactly when there are no errored targets and no formal operand errors. */
readonly noErrorOccurred: boolean;
readonly fullySupported: boolean;
/** Apply the retained source actions to another snapshot owned by the same prepared model. */
applyTo(destination: DocumentSnapshot): DocumentSnapshot;
}
ComputationResult
Detached outcome for one computed field cell.
/** Detached outcome for one computed field cell. */
export interface ComputationResult {
readonly pointer: FieldPointer;
readonly outcome: ComputationOutcome;
readonly value?: string;
/** Target-owned formal diagnostic; present exactly when outcome is "errored". */
readonly diagnostic?: ValidationFinding;
}
ComputeOptions
Per-call locale for computation.
/** Per-call locale for computation. */
export interface ComputeOptions {
readonly locale?: string;
}
CustomCondition
Synchronous error condition; returning true fires the owning rule.
/** Synchronous error condition; returning true fires the owning rule. */
export type CustomCondition = (invocation: CustomConditionInvocation) => boolean;
CustomConditionDocumentView
Read-only model-owned Document access available during a custom condition call.
/** Read-only model-owned Document access available during a custom condition call. */
export interface CustomConditionDocumentView {
value(pointer: FieldPointer): string | undefined;
fields(): readonly FieldPointer[];
}
CustomConditionInvocation
Document, relevance, formal-error, and error-pointer context for one custom condition.
/** Document, relevance, formal-error, and error-pointer context for one custom condition. */
export interface CustomConditionInvocation {
readonly document: CustomConditionDocumentView;
readonly relevantEntities?: readonly RelevantEntityPointer[];
readonly formallyIncorrectEntities: readonly FieldPointer[];
readonly errorPointer: FieldPointer;
}
CustomFieldValidationParameters
Locale, declaration bounds, and value mode supplied to a custom field validator.
/** Locale, declaration bounds, and value mode supplied to a custom field validator. */
export interface CustomFieldValidationParameters {
readonly locale: string;
readonly minLength?: number;
readonly maxLength?: number;
readonly isDisplayValue: boolean;
}
CustomFieldValidationResult
Accepted custom field text or a project-owned rejection key and optional message.
/** Accepted custom field text or a project-owned rejection key and optional message. */
export type CustomFieldValidationResult = {
readonly accepted: true;
} | {
readonly accepted: false;
readonly errorKey: string;
readonly message?: string;
};
CustomFieldValidator
Synchronous validator for one named custom field type.
/** Synchronous validator for one named custom field type. */
export type CustomFieldValidator = (value: string, parameters: CustomFieldValidationParameters) => CustomFieldValidationResult;
DocumentCoordinateError
Invalid model-owned pointer coordinates.
/** Invalid model-owned pointer coordinates. */
export declare class DocumentCoordinateError extends Error {
readonly reason: DocumentCoordinateReasonCode;
readonly path: string;
readonly coordinateIndex: number | undefined;
readonly expectedCoordinateCount: number | undefined;
readonly actualCoordinateCount: number | undefined;
readonly code: "A12_DOCUMENT_COORDINATE_INVALID";
constructor(reason: DocumentCoordinateReasonCode, path: string, coordinateIndex: number | undefined, expectedCoordinateCount: number | undefined, actualCoordinateCount: number | undefined, message: string);
}
DocumentCoordinateReasonCode
Stable reason why a concrete or partial-validation pointer cannot be constructed.
/** Stable reason why a concrete or partial-validation pointer cannot be constructed. */
export type DocumentCoordinateReasonCode = "coordinate-count-mismatch" | "coordinate-not-positive" | "coordinate-outside-portable-range" | "field-terminal-not-one";
DocumentDecodeLimits
Optional resource ceilings applied before a Document snapshot is constructed.
/** Optional resource ceilings applied before a Document snapshot is constructed. */
export interface DocumentDecodeLimits {
readonly maxDocumentCodeUnits?: number;
readonly maxGroupPlacements?: number;
readonly maxFieldPlacements?: number;
readonly maxPathCodeUnits?: number;
readonly maxRawCodeUnitsPerField?: number;
readonly maxTotalRawCodeUnits?: number;
readonly maxModelNestingDepth?: number;
}
DocumentDecodeOptions
Options for reading A12 Document JSON.
/** Options for reading A12 Document JSON. */
export interface DocumentDecodeOptions {
readonly limits?: DocumentDecodeLimits;
}
DocumentEncodeError
The document holds state A12 Document JSON has no shape for — a non-repeatable group row above 1 — so encoding it would silently lose that row.
/**
* The document holds state A12 Document JSON has no shape for — a non-repeatable group row above 1 — so
* encoding it would silently lose that row.
*/
export declare class DocumentEncodeError extends Error {
readonly modelPath: string;
readonly pointer: string;
readonly code: "A12_DOCUMENT_NOT_REPRESENTABLE";
constructor(modelPath: string, pointer: string, message?: string);
}
DocumentInputDiagnostic
Structured detail for one invalid part of supplied Document input.
/** Structured detail for one invalid part of supplied Document input. */
export interface DocumentInputDiagnostic {
readonly reasonCode: string;
readonly message: string;
/** Canonical A12 `DocumentPointer` string of the offending document position. */
readonly pointer?: string;
readonly modelPath?: string;
readonly entityKind?: ModelEntityKind;
readonly nodeType?: DocumentJsonNodeType;
/** Path into the supplied JavaScript value, when the value itself is not JSON-representable. */
readonly inputPath?: readonly DocumentInputPathSegment[];
readonly details?: Readonly<Record<string, unknown>>;
}
DocumentInputError
Aggregate Document decoding failure produced before a snapshot is created.
/** Aggregate Document decoding failure produced before a snapshot is created. */
export declare class DocumentInputError extends Error {
readonly diagnostics: readonly DocumentInputDiagnostic[];
readonly code: "A12_DOCUMENT_INPUT_INVALID";
constructor(diagnostics: readonly DocumentInputDiagnostic[], message?: string);
}
DocumentInputPathSegment
One object-key or array-index segment locating a supplied value that JSON cannot carry.
/** One object-key or array-index segment locating a supplied value that JSON cannot carry. */
export type DocumentInputPathSegment = string | number;
DocumentJsonNodeType
What a JSON node at one document position actually is, when the model expected something else.
/** What a JSON node at one document position actually is, when the model expected something else. */
export type DocumentJsonNodeType = "object" | "array" | "value" | "null";
DocumentPointer
Exact model-owned address of one declared group row or field cell.
/** Exact model-owned address of one declared group row or field cell. */
export declare abstract class DocumentPointer {
readonly entityKind: ModelEntityKind;
readonly path: string;
readonly coordinates: readonly number[];
}
DocumentSnapshot
Immutable, opaque Document state owned by one prepared model.
/** Immutable, opaque Document state owned by one prepared model. */
export declare class DocumentSnapshot {
}
FieldPointer
Exact model-owned field-cell pointer.
/** Exact model-owned field-cell pointer. */
export declare class FieldPointer extends DocumentPointer {
}
GroupPointer
Exact model-owned group-row pointer.
/** Exact model-owned group-row pointer. */
export declare class GroupPointer extends DocumentPointer {
}
Interpreter
Reusable evaluator bound to one prepared model and callback configuration.
/** Reusable evaluator bound to one prepared model and callback configuration. */
export declare class Interpreter {
/** Report unsupported rules or computations without reading a Document. */
supportReport(): InterpreterSupportReport;
/** Validate every applicable rule against one owned Document snapshot. */
validateFull(snapshot: DocumentSnapshot, options?: ValidationOptions): ValidationReport;
/** Validate only rules relevant to the supplied exact or partial pointers. */
validatePart(snapshot: DocumentSnapshot, relevant: readonly RelevantEntityPointer[], options?: ValidationOptions): ValidationReport;
/** Evaluate every supported computation against one owned Document snapshot. */
compute(snapshot: DocumentSnapshot, options?: ComputeOptions): ComputationReport;
/** Compute once and apply that retained result back to the same immutable snapshot. */
applyComputations(snapshot: DocumentSnapshot, options?: ComputeOptions): DocumentSnapshot;
}
InterpreterConfiguration
Named project callbacks bound while creating an interpreter.
/** Named project callbacks bound while creating an interpreter. */
export interface InterpreterConfiguration {
readonly customFieldTypes?: Readonly<Record<string, CustomFieldValidator>>;
readonly customConditions?: Readonly<Record<string, CustomCondition>>;
}
InterpreterIntegrationError
A project callback failed, re-entered evaluation, or returned asynchronously.
/** A project callback failed, re-entered evaluation, or returned asynchronously. */
export declare class InterpreterIntegrationError extends Error {
readonly phase: "bind" | "evaluate";
readonly reason: InterpreterIntegrationReason;
readonly code: "A12_INTERPRETER_INTEGRATION_FAILED";
constructor(phase: "bind" | "evaluate", reason: InterpreterIntegrationReason, message: string);
}
InterpreterIntegrationReason
Stable category for a project customization integration failure.
/** Stable category for a project customization integration failure. */
export type InterpreterIntegrationReason = "factory-threw" | "callback-threw" | "reentrant-evaluation" | "thenable-returned";
InterpreterSupportReport
Document-independent support audit for a prepared model and callback configuration.
/** Document-independent support audit for a prepared model and callback configuration. */
export interface InterpreterSupportReport {
readonly unsupported: readonly UnsupportedProgram[];
readonly fullySupported: boolean;
}
ModelCollectionOptions
Resource limits and cancellation for on-demand workspace collection.
/** Resource limits and cancellation for on-demand workspace collection. */
export interface ModelCollectionOptions {
readonly limits?: ModelPreparationLimits;
readonly signal?: AbortSignal;
}
ModelDependency
One distinct resolved workspace dependency in deterministic discovery order.
/** One distinct resolved workspace dependency in deterministic discovery order. */
export interface ModelDependency {
readonly fromModelId: string;
readonly toModelId: string;
readonly purpose: "include" | "type-definitions";
readonly alias?: string;
readonly diagnosticLabel?: string;
readonly sha256: string;
}
ModelEntityKind
Whether a model-owned pointer addresses a group row or field cell.
/** Whether a model-owned pointer addresses a group row or field cell. */
export type ModelEntityKind = "group" | "field";
ModelMetadata
Prepared-model metadata and checked pointer factories.
/** Prepared-model metadata and checked pointer factories. */
export declare class ModelMetadata {
/** Exact DocumentModel id from the prepared entry model. */
readonly documentModelId: string;
/** Create an exact group-row or field-cell pointer after path and coordinate checks. */
pointer(path: string, coordinates: readonly number[]): DocumentPointer;
/** Create an exact or all-repetitions pointer for partial validation. */
relevantPointer(path: string, coordinates: readonly RelevantCoordinate[]): RelevantEntityPointer;
}
ModelOwnerMismatchError
A snapshot or pointer belongs to another prepared model.
/** A snapshot or pointer belongs to another prepared model. */
export declare class ModelOwnerMismatchError extends Error {
readonly code: "A12_MODEL_OWNER_MISMATCH";
constructor(message?: string);
}
ModelPreparationDiagnostic
Structured, privacy-safe detail for one model preparation failure.
/** Structured, privacy-safe detail for one model preparation failure. */
export interface ModelPreparationDiagnostic {
readonly code: string;
readonly diagnosticLabel?: string;
readonly requestedModelId?: string;
readonly actualModelId?: string;
readonly providerFailureReason?: ModelSourceProviderFailureReason;
readonly expectedSha256?: string;
readonly actualSha256?: string;
readonly modelId?: string;
readonly path?: string;
readonly reference?: string;
readonly referenceChain?: readonly ModelReferenceStep[];
readonly conflictingDiagnosticLabels?: readonly string[];
readonly resource?: string;
readonly maximum?: number;
readonly actual?: number;
readonly firstSourceModelId?: string;
readonly conflictingSourceModelId?: string;
readonly sourceLanguage?: string;
readonly entryLanguage?: string;
readonly reason?: string;
readonly cyclic?: boolean;
readonly message: string;
}
ModelPreparationError
Aggregate source-admission, collection, expansion, or preparation failure.
/** Aggregate source-admission, collection, expansion, or preparation failure. */
export declare class ModelPreparationError extends Error {
readonly diagnostics: readonly ModelPreparationDiagnostic[];
readonly code: "A12_MODEL_PREPARATION_FAILED";
constructor(diagnostics: readonly ModelPreparationDiagnostic[], message: string);
}
ModelPreparationLimits
Optional resource ceilings for source admission, graph assembly, and prepared output.
/** Optional resource ceilings for source admission, graph assembly, and prepared output. */
export interface ModelPreparationLimits {
readonly maxModelCount?: number;
readonly maxModelBytes?: number;
readonly maxTotalBytes?: number;
readonly maxPreparedBytes?: number;
readonly maxReferenceDepth?: number;
readonly maxReferenceEdges?: number;
readonly maxStructureDepth?: number;
readonly maxPreparedElements?: number;
}
ModelReferenceStep
One directed include or imported-type-definition edge in a diagnostic chain.
/** One directed include or imported-type-definition edge in a diagnostic chain. */
export interface ModelReferenceStep {
readonly fromModelId: string;
readonly toModelId: string;
readonly purpose: "include" | "type-definitions";
readonly alias?: string;
}
ModelSourceLoadContext
Remaining byte ceiling and cancellation signal for one provider request.
/** Remaining byte ceiling and cancellation signal for one provider request. */
export interface ModelSourceLoadContext {
readonly maximumBytes: number;
readonly signal: AbortSignal;
}
ModelSourceProvider
Application-owned asynchronous source acquisition port.
/** Application-owned asynchronous source acquisition port. */
export interface ModelSourceProvider {
readonly snapshotRevision?: string;
load(modelId: string, context: ModelSourceLoadContext): Promise<WorkspaceModelSource | undefined>;
}
ModelSourceProviderError
Application-owned acquisition failure with a stable reason and requested model id.
/** Application-owned acquisition failure with a stable reason and requested model id. */
export declare class ModelSourceProviderError extends Error {
readonly reason: ModelSourceProviderFailureReason;
readonly modelId: string;
readonly code: "A12_MODEL_SOURCE_PROVIDER_FAILED";
constructor(reason: ModelSourceProviderFailureReason, modelId: string, options?: ErrorOptions);
}
ModelSourceProviderFailureReason
Stable category supplied when an application-owned model provider cannot return a source.
/** Stable category supplied when an application-owned model provider cannot return a source. */
export type ModelSourceProviderFailureReason = "access-denied" | "unavailable" | "cancelled" | "source-too-large" | "integrity-mismatch" | "provider-failed";
ModelWorkspace
Immutable finite source snapshot that expands or prepares one selected model closure.
/** Immutable finite source snapshot that expands or prepares one selected model closure. */
export declare class ModelWorkspace {
/** Exact model ids frozen into this workspace. */
readonly modelIds: readonly string[];
/** Optional sanitized provider revision; excluded from prepared-model identity. */
readonly snapshotRevision: string | undefined;
/** Admit and freeze a caller-supplied finite model source set. */
static fromSources(sources: readonly WorkspaceModelSource[], limits?: ModelPreparationLimits): ModelWorkspace;
/** Load one discovered dependency closure through an application-owned provider. */
static collect(entryModelId: string, provider: ModelSourceProvider, options?: ModelCollectionOptions): Promise<ModelWorkspace>;
/** Return self-contained DM-JSON without applying evaluator support checks. */
expand(entryModelId: string): string;
/** Return expansion success or the same typed preparation error without throwing. */
tryExpand(entryModelId: string): A12Result<string, ModelPreparationError>;
/** Resolve and load one entry model as a reusable prepared model. */
prepare(entryModelId: string): PreparedModel;
/** Return preparation success or the same typed preparation error without throwing. */
tryPrepare(entryModelId: string): A12Result<PreparedModel, ModelPreparationError>;
}
PreparedDocumentApi
Model-aware reading and lossless writing of **A12's canonical Document JSON** — the one document shape at this boundary. Both directions run through the shared engine, so a JavaScript, JVM, or native caller sees the same validation, the same diagnostics, and the same canonical output.
/**
* Model-aware reading and lossless writing of **A12's canonical Document JSON** — the one document shape at
* this boundary. Both directions run through the shared engine, so a JavaScript, JVM, or native caller sees
* the same validation, the same diagnostics, and the same canonical output.
*/
export declare class PreparedDocumentApi {
/**
* Create a deterministic, best-effort model-derived Document candidate. It carries every declared group and
* field and instantiates one row of every repeatable group. Local field formats and bounds guide editable
* source values; computation-owned targets remain present-empty for the engine to fill. Whole-model rule
* acceptance is not guaranteed.
*/
seedDocument(): DocumentSnapshot;
/** Test whether a value is a Document snapshot owned by this prepared model. */
isSnapshot(value: unknown): value is DocumentSnapshot;
/** Read A12 Document JSON — a plain object or its text — into an immutable Document snapshot. */
readDocument(document: A12Document | string, options?: DocumentDecodeOptions): DocumentSnapshot;
/** Return reading success or the same typed input error without throwing. */
tryReadDocument(document: A12Document | string, options?: DocumentDecodeOptions): A12Result<DocumentSnapshot, DocumentInputError>;
/** Write an owned snapshot back as canonical A12 Document JSON. */
encodeDocument(snapshot: DocumentSnapshot): A12Document;
/** Write an owned snapshot back as canonical A12 Document JSON text. */
encodeDocumentJson(snapshot: DocumentSnapshot): string;
}
PreparedModel
Immutable prepared model that owns metadata, Documents, pointers, and interpreters.
/** Immutable prepared model that owns metadata, Documents, pointers, and interpreters. */
export declare class PreparedModel {
/** Exact id of the selected entry model. */
readonly entryModelId: string;
/** Deterministic identity of the preparation inputs and contract version. */
readonly fingerprint: string;
/** Distinct resolved dependency edges in deterministic discovery order. */
readonly dependencies: readonly ModelDependency[];
/** Model-aware Document decoder, encoder, and ownership boundary. */
readonly documents: PreparedDocumentApi;
/** Checked metadata and pointer factories for this model owner. */
readonly model: ModelMetadata;
/** Load already-expanded DM-JSON and apply evaluator support checks. */
static loadExpandedJson(source: string): PreparedModel;
/** Return expanded-input loading success or the same typed error without throwing. */
static tryLoadExpandedJson(source: string): A12Result<PreparedModel, ModelPreparationError>;
/** Create a reusable evaluator with optional project callbacks. */
createInterpreter(configuration?: InterpreterConfiguration): Interpreter;
}
RelevantCoordinate
One exact repetition or every repetition at one partial-validation level.
/** One exact repetition or every repetition at one partial-validation level. */
export type RelevantCoordinate = number | "ALL";
RelevantEntityPointer
Exact or all-repetitions model-owned pointer accepted by partial validation.
/** Exact or all-repetitions model-owned pointer accepted by partial validation. */
export type RelevantEntityPointer = DocumentPointer | RelevantSelectionPointer;
RelevantSelectionPointer
Partial-validation pointer containing at least one all-repetitions selector.
/** Partial-validation pointer containing at least one all-repetitions selector. */
export declare class RelevantSelectionPointer {
readonly entityKind: ModelEntityKind;
readonly path: string;
readonly coordinates: readonly RelevantCoordinate[];
}
UnknownModelPathError
A requested pointer path names no declared group or field.
/** A requested pointer path names no declared group or field. */
export declare class UnknownModelPathError extends Error {
readonly path: string;
readonly code: "A12_UNKNOWN_MODEL_PATH";
constructor(path: string, message?: string);
}
UnsupportedProgram
One construct the configured interpreter cannot evaluate — a stored rule, an implicit rule, a computation, a field declaration whose custom type is unregistered, or a single document cell. `subject` says which of those `path` addresses: `"element"` is a model path you can look up in the model, `"cell"` is an instance pointer into the document being evaluated. A support audit reports only elements; validation and computation report both kinds in one list, so a consumer that ignores `subject` cannot render either correctly.
/**
* One construct the configured interpreter cannot evaluate — a stored rule, an implicit rule, a computation, a
* field declaration whose custom type is unregistered, or a single document cell.
*
* `subject` says which of those `path` addresses: `"element"` is a model path you can look up in the model,
* `"cell"` is an instance pointer into the document being evaluated. A support audit reports only elements;
* validation and computation report both kinds in one list, so a consumer that ignores `subject` cannot render
* either correctly.
*/
export interface UnsupportedProgram {
readonly path: string;
readonly reason: string;
readonly subject: UnsupportedProgramSubject;
}
UnsupportedProgramSubject
What kind of address an {@link UnsupportedProgram.path} carries — the two are not interchangeable.
/** What kind of address an {@link UnsupportedProgram.path} carries — the two are not interchangeable. */
export type UnsupportedProgramSubject = "element" | "cell";
ValidationFinding
Detached projection of one firing validation rule. Its three addresses are A12's message pointer — `IMessage` types `getErrorFieldPointer()`, `getReferencedFieldsPointers()` and `getRefOmissionErrorResponsiblePointers()` as `PartiallyKnownDocumentMultiPointer`, and so does this. They arrive branded, so a finding's address is accepted wherever an {@link A12PartiallyKnownMultiPointer} is required and rejected where an {@link A12Pointer } is. Use {@link A12PartiallyKnownMultiPointer.toExactPointer} for the exact pointer when the address names one cell; it answers `null` when it does not.
/**
* Detached projection of one firing validation rule.
*
* Its three addresses are A12's message pointer — `IMessage` types `getErrorFieldPointer()`,
* `getReferencedFieldsPointers()` and `getRefOmissionErrorResponsiblePointers()` as
* `PartiallyKnownDocumentMultiPointer`, and so does this. They arrive branded, so a finding's address is
* accepted wherever an {@link A12PartiallyKnownMultiPointer} is required and rejected where an
* {@link A12Pointer} is. Use {@link A12PartiallyKnownMultiPointer.toExactPointer} for the exact pointer when
* the address names one cell; it answers `null` when it does not.
*/
export interface ValidationFinding {
readonly code: string;
readonly rulePath: string;
readonly errorPath: A12PartiallyKnownMultiPointer;
readonly severity: ValidationSeverity;
readonly type: ValidationFindingType;
readonly text: string;
readonly referenced: readonly A12PartiallyKnownMultiPointer[];
readonly fillToFix: readonly A12PartiallyKnownMultiPointer[];
}
ValidationFindingType
Whether a firing reports an invalid value or a required omission.
/** Whether a firing reports an invalid value or a required omission. */
export type ValidationFindingType = "value" | "omission";
ValidationOptions
Per-call locale for full or partial validation.
/** Per-call locale for full or partial validation. */
export interface ValidationOptions {
readonly locale?: string;
}
ValidationReport
Detached validation findings and the independent support status.
/** Detached validation findings and the independent support status. */
export interface ValidationReport {
readonly findings: readonly ValidationFinding[];
readonly unsupported: readonly UnsupportedProgram[];
readonly noErrorOccurred: boolean;
readonly fullySupported: boolean;
}
ValidationSeverity
Presentation severity of one validation finding.
/** Presentation severity of one validation finding. */
export type ValidationSeverity = "error" | "warning" | "info";
WorkspaceModelSource
Raw DM-JSON plus optional safe label and expected SHA-256 integrity.
/** Raw DM-JSON plus optional safe label and expected SHA-256 integrity. */
export interface WorkspaceModelSource {
readonly json: string;
readonly diagnosticLabel?: string;
readonly expectedSha256?: string;
}