import { ZodType, z } from "zod"; import { ArtifactPart as ArtifactPart$1, EvidenceReference, ResourceReference, StateDefinition } from "@data-elements/runtime"; import { Artifact } from "@data-elements/schema"; //#region src/types.d.ts type Scalar = null | boolean | string | number; type JsonValue = Scalar | JsonValue[] | { [key: string]: JsonValue; }; type JsonObject = { [key: string]: JsonValue; }; type JSONSchema = JsonObject; type ConditionOperator = "eq" | "neq" | "lt" | "lte" | "gt" | "gte" | "and" | "or" | "not"; type PlainAuthoringObject = { [key: string]: AuthoringValue; }; type AuthoringValue = Scalar | AuthoringValue[] | PlainAuthoringObject | { $ref: "state" | "resource"; id: string; path?: (string | number)[]; } | { $ref: "event"; port: string; path?: (string | number)[]; } | { $ref: "context"; key: "locale" | "timezone"; } | { $condition: { op: ConditionOperator; args: AuthoringValue[]; }; }; type AuthoringNode = { id: string; type: string; typeVersion?: number; props?: Record; slots?: Record; events?: Record; evidence?: string[]; }; type AuthoringNavigationTarget = { kind: "route"; capabilityId: string; routeId: string; params?: Record; } | { kind: "resource"; capabilityId: string; resourceId: string; } | { kind: "external"; capabilityId: string; input: Record; }; type AuthoringActionStep = { stepId: string; } & ({ type: "state.set"; stateId: string; value: AuthoringValue; } | { type: "state.reset"; stateIds: string[]; } | { type: "node.focus"; nodeId: string; } | { type: "agent.message"; templateGrantId: string; values?: Record; } | { type: "capability.request"; capabilityId: string; input: Record; } | { type: "navigation.request"; target: AuthoringNavigationTarget; }); type AuthoringActionPlan = { contractId: string; contractVersion?: number; steps: AuthoringActionStep[]; onError?: "halt" | "continue"; }; type AuthoringStateDefinition = { schema: JSONSchema; initial: JsonValue; }; type ArtifactMeta = { title?: string; description?: string; locale?: string; tags?: string[]; }; type ArtifactProposal = { root: AuthoringNode; state?: Record; actions?: Record; claims?: Record; resourceIds?: string[]; meta?: ArtifactMeta; }; type PathSegment = string | number; type ArtifactValue = { kind: "literal"; value: Scalar; } | { kind: "array"; items: ArtifactValue[]; } | { kind: "object"; entries: Record; } | { kind: "state-ref"; stateId: string; path?: PathSegment[]; } | { kind: "resource-ref"; resourceId: string; path?: PathSegment[]; } | { kind: "event-ref"; port: string; path?: PathSegment[]; } | { kind: "context-ref"; key: "locale" | "timezone"; } | { kind: "condition"; op: ConditionOperator; args: ArtifactValue[]; }; type NormalizedActionStep = { stepId: string; } & ({ type: "state.set"; stateId: string; value: ArtifactValue; } | { type: "state.reset"; stateIds: string[]; } | { type: "node.focus"; nodeId: string; } | { type: "agent.message"; templateGrantId: string; values: Record; } | { type: "capability.request"; capabilityId: string; input: Record; } | { type: "navigation.request"; target: { kind: "route"; capabilityId: string; routeId: string; params: Record; } | { kind: "resource"; capabilityId: string; resourceId: string; } | { kind: "external"; capabilityId: string; input: Record; }; }); type NormalizedActionPlan = { contractId: string; contractVersion: number; steps: NormalizedActionStep[]; onError: "halt" | "continue"; }; type NormalizedArtifactNode = { type: string; typeVersion: number; props: Record; slots?: Record; events?: Record; evidence?: string[]; }; type NormalizedArtifactProposal = { root: string; nodes: Record; state: Record; actions: Record; claims: Record; resourceIds: string[]; meta: ArtifactMeta; }; type PolicySink = "model-generation" | "renderer" | "model-repair" | "export" | "share" | "telemetry"; type InformationFlowLabel = { scopeRef: string; sensitivity: "public" | "private" | "sensitive"; persistence: "none" | "session" | "host"; allowedSinks: PolicySink[]; expiresAt?: string; }; type DocumentPolicy = InformationFlowLabel & { policyId: string; policyVersion: number; policyHash: string; }; type LabeledModelInput = { provenanceRef: string; kind: "message" | "tool-result" | "resource" | "state" | "parent-summary" | "example" | "repair"; content: JsonValue; label: InformationFlowLabel; }; type DiagnosticPhase = "decode" | "normalize" | "validate" | "policy" | "commit" | "render" | "effect" | "transport"; type Diagnostic = { phase: DiagnosticPhase; code: string; severity: "info" | "warning" | "error" | "fatal"; recoverable: boolean; modelCorrectable: boolean; message: string; location?: { streamId?: string; transactionId?: string; seq?: number; opId?: string; revisionId?: string; entity?: { kind: "document" | "node" | "state" | "action" | "resource" | "evidence" | "claim" | "effect" | "migration"; id: string; }; path?: string; }; expected?: JsonValue; actualSummary?: string; hint?: string; retryAfterMs?: number; }; type GenerationLimits = { maxDocumentBytes: number; maxNodes: number; maxDepth: number; maxStringBytes: number; maxCollectionItems: number; maxObjectKeys: number; maxTotalValues: number; maxNodeTypes: number; maxExamples: number; maxRepairFragmentBytes: number; maxRepairAttempts: number; }; type SurfaceProfile = "analysis" | "report" | "form" | "operations"; type CompilerPreset = "standard" | "governed" | "custom"; type AuthoringCodec = "snapshot-json" | "delta-jsonl"; type RenderMode = "strict" | "progressive"; type NodeCategory = "surface-layout" | "surface-content" | "surface-form" | "semantic-artifact" | `extension:${string}`; type SlotContract = { accepts?: readonly string[]; categories?: readonly NodeCategory[]; min?: number; max?: number; fallback: "omit" | "empty" | "placeholder"; }; type NodePromptMetadata = { summary: string; useWhen: readonly string[]; avoidWhen: readonly string[]; }; type NodeContract = { type: string; version: number; category: NodeCategory; propsSchema: ZodType>; providerSchema?: JSONSchema; slots: Readonly>; trust: "safe" | "governed"; commitPolicy: "progressive" | "atomic"; prompt: NodePromptMetadata; profiles: readonly SurfaceProfile[]; searchTerms?: readonly string[]; dependencies?: readonly string[]; examples?: readonly CompilerExample[]; maxInstances?: number; events?: Readonly; actionContracts: Readonly>; }>>; bindings?: { referencePaths?: readonly string[]; conditionPaths?: readonly string[]; }; }; type CompilerExample = { id: string; profiles: readonly SurfaceProfile[]; nodeTypes: readonly string[]; user: string; proposal: ArtifactProposal; }; type CatalogIdentity = { id: string; version: string; }; type CatalogSlice = { catalog: CatalogIdentity; contractFingerprint: string; sliceHash: string; contracts: readonly NodeContract[]; }; type SchemaProfileBinding = { profileId: "data-elements.schema-core"; profileVersion: number; profileHash: string; }; type ModelVisibleCapability = { capabilityId: string; grantVersion: number; schemaProfile: SchemaProfileBinding; kind: string; summary: string; inputSchemaId: string; inputSchemaVersion: number; inputSchema: JSONSchema; inputSchemaHash: string; outputSchemaId: string; outputSchemaVersion: number; outputSchemaHash: string; requiresApproval: boolean; }; type ModelVisibleMessageTemplate = { templateGrantId: string; templateGrantVersion: number; schemaProfile: SchemaProfileBinding; summary: string; templateHash: string; variableSchema: JSONSchema; variableSchemaHash: string; }; type DocumentSummary = { documentId: string; revisionId: string; title?: string; summary: string; }; type PromptBundle = { protocolVersion: "2.0"; system: string; providerSchema: JSONSchema; tool: { name: "renderArtifact"; description: string; inputSchema: JSONSchema; }; catalogSlice: CatalogSlice; contractFingerprint: string; promptBundleHash: string; generationTaintHash: string; profile: SurfaceProfile; preset: CompilerPreset; codec: AuthoringCodec; renderMode: RenderMode; locale: string; limits: GenerationLimits; examples: readonly CompilerExample[]; repair: { maxAttempts: number; redactedFields: readonly string[]; }; }; type RepairDiagnostic = Pick & { path?: string; hint?: string; }; type RepairRequest = { attempt: number; maxAttempts: number; contractFingerprint: string; promptBundleHash: string; system: string; providerSchema: JSONSchema; parentRevisionId?: string; headPreconditions?: Readonly>; statePreconditions?: Readonly>; allowedOperations: readonly ["replace-snapshot"]; diagnostics: readonly RepairDiagnostic[]; fragment: JsonValue; prompt: string; }; type MaybePromise = T | Promise; interface ArtifactTransportAdapter { readonly id: string; extractProposal(output: TProviderOutput, context: AdapterContext): MaybePromise; encodePart?(part: ArtifactPart, context: AdapterContext): MaybePromise; } interface RepairProvider { readonly id: string; repair(request: RepairRequest): MaybePromise; } type AdapterContext = { protocolVersion: "2.0"; contractFingerprint: string; promptBundleHash: string; generationTaintHash: string; codec: AuthoringCodec; renderMode: RenderMode; }; declare const validatedArtifactPart: unique symbol; type ArtifactPart = { readonly kind: "artifact-snapshot"; readonly snapshot: TSnapshot; readonly contractFingerprint: string; readonly promptBundleHash: string; readonly generationTaintHash: string; readonly [validatedArtifactPart]: true; }; //#endregion //#region src/catalog.d.ts declare function defineNodeContract(contract: T): T; declare class CompilerCatalog { #private; readonly identity: Readonly; readonly contractFingerprint: string; constructor(identity: CatalogIdentity, contracts: readonly NodeContract[]); has(type: string): boolean; get(type: string): NodeContract | undefined; contracts(): readonly NodeContract[]; extend(contracts: readonly NodeContract[], identity?: CatalogIdentity): CompilerCatalog; } declare function createCompilerCatalog(contracts: readonly NodeContract[], identity?: CatalogIdentity): CompilerCatalog; declare const surfaceNodeContracts: readonly [{ readonly type: "layout.stack"; readonly version: 1; readonly category: "surface-layout"; readonly propsSchema: ZodType, unknown, z.core.$ZodTypeInternals, unknown>>; readonly slots: { readonly children: { readonly categories: readonly ["surface-layout", "surface-content", "surface-form", "semantic-artifact", "extension:*"]; readonly min: 1; readonly max: 32; readonly fallback: "placeholder"; }; }; readonly trust: "safe"; readonly commitPolicy: "progressive"; readonly prompt: { readonly summary: "Arrange related nodes vertically with semantic spacing."; readonly useWhen: readonly ["The result contains more than one related block."]; readonly avoidWhen: readonly ["A single semantic artifact can be the root."]; }; readonly profiles: readonly ["analysis", "report", "form", "operations"]; readonly searchTerms: readonly ["stack", "layout", "section", "纵向", "布局"]; readonly maxInstances: 16; }, { readonly type: "layout.grid"; readonly version: 1; readonly category: "surface-layout"; readonly propsSchema: ZodType, unknown, z.core.$ZodTypeInternals, unknown>>; readonly slots: { readonly children: { readonly categories: readonly ["surface-layout", "surface-content", "surface-form", "semantic-artifact", "extension:*"]; readonly min: 1; readonly max: 16; readonly fallback: "placeholder"; }; }; readonly trust: "safe"; readonly commitPolicy: "progressive"; readonly prompt: { readonly summary: "Arrange comparable nodes in a responsive grid."; readonly useWhen: readonly ["Several peers benefit from side-by-side comparison."]; readonly avoidWhen: readonly ["Reading order or narrow-screen density would be unclear."]; }; readonly profiles: readonly ["analysis", "report", "operations"]; readonly searchTerms: readonly ["grid", "compare", "dashboard", "网格", "对比"]; readonly maxInstances: 8; }, { readonly type: "layout.section"; readonly version: 1; readonly category: "surface-layout"; readonly propsSchema: ZodType, unknown, z.core.$ZodTypeInternals, unknown>>; readonly slots: { readonly children: { readonly categories: readonly ["surface-layout", "surface-content", "surface-form", "semantic-artifact", "extension:*"]; readonly min: 1; readonly max: 24; readonly fallback: "placeholder"; }; }; readonly trust: "safe"; readonly commitPolicy: "progressive"; readonly prompt: { readonly summary: "Group a named part of a report without controlling visual styling."; readonly useWhen: readonly ["A document needs a clear semantic subsection."]; readonly avoidWhen: readonly ["The section would contain no meaningful child."]; }; readonly profiles: readonly ["analysis", "report", "form", "operations"]; readonly searchTerms: readonly ["section", "group", "章节", "分组"]; readonly maxInstances: 16; }, { readonly type: "content.text"; readonly version: 1; readonly category: "surface-content"; readonly propsSchema: ZodType, unknown, z.core.$ZodTypeInternals, unknown>>; readonly slots: {}; readonly trust: "safe"; readonly commitPolicy: "progressive"; readonly prompt: { readonly summary: "Render bounded plain text with a semantic role."; readonly useWhen: readonly ["A short heading, explanation, or caption improves comprehension."]; readonly avoidWhen: readonly ["Structured data belongs in a semantic artifact node."]; }; readonly profiles: readonly ["analysis", "report", "form", "operations"]; readonly searchTerms: readonly ["text", "summary", "explain", "文本", "说明"]; readonly maxInstances: 32; }, { readonly type: "content.callout"; readonly version: 1; readonly category: "surface-content"; readonly propsSchema: ZodType, unknown, z.core.$ZodTypeInternals, unknown>>; readonly slots: {}; readonly trust: "safe"; readonly commitPolicy: "progressive"; readonly prompt: { readonly summary: "Emphasize a bounded status, warning, or conclusion."; readonly useWhen: readonly ["One short message needs distinct semantic emphasis."]; readonly avoidWhen: readonly ["The content is ordinary narrative or unsupported alarm."]; }; readonly profiles: readonly ["analysis", "report", "form", "operations"]; readonly searchTerms: readonly ["warning", "notice", "status", "提醒", "警告"]; readonly maxInstances: 12; }, { readonly type: "content.progress"; readonly version: 1; readonly category: "surface-content"; readonly propsSchema: ZodType, unknown, z.core.$ZodTypeInternals, unknown>>; readonly slots: {}; readonly trust: "safe"; readonly commitPolicy: "progressive"; readonly prompt: { readonly summary: "Show validated completion against a zero-to-one-hundred scale."; readonly useWhen: readonly ["A real process or target has a validated completion percentage."]; readonly avoidWhen: readonly ["The percentage is an unsupported estimate."]; }; readonly profiles: readonly ["report", "operations"]; readonly searchTerms: readonly ["progress", "completion", "进度", "完成率"]; readonly maxInstances: 12; }, { readonly type: "content.empty"; readonly version: 1; readonly category: "surface-content"; readonly propsSchema: ZodType, unknown, z.core.$ZodTypeInternals, unknown>>; readonly slots: {}; readonly trust: "safe"; readonly commitPolicy: "progressive"; readonly prompt: { readonly summary: "Represent a valid empty or unavailable result explicitly."; readonly useWhen: readonly ["A trusted query produced no data or a resource is unavailable."]; readonly avoidWhen: readonly ["Generation failed or validation is incomplete."]; }; readonly profiles: readonly ["analysis", "report", "form", "operations"]; readonly searchTerms: readonly ["empty", "no data", "unavailable", "空", "无数据"]; readonly maxInstances: 8; }, { readonly type: "form.root"; readonly version: 1; readonly category: "surface-form"; readonly propsSchema: ZodType, unknown, z.core.$ZodTypeInternals, unknown>>; readonly slots: { readonly fields: { readonly accepts: readonly ["form.input", "form.select", "form.toggle", "form.button"]; readonly min: 1; readonly max: 32; readonly fallback: "placeholder"; }; }; readonly trust: "safe"; readonly commitPolicy: "atomic"; readonly prompt: { readonly summary: "Collect typed local state through a bounded declarative form."; readonly useWhen: readonly ["The user needs to review or change a small set of typed values."]; readonly avoidWhen: readonly ["The interaction can execute without explicit user review."]; }; readonly profiles: readonly ["form", "operations"]; readonly searchTerms: readonly ["form", "input", "edit", "表单", "填写"]; readonly dependencies: readonly ["form.input", "form.select", "form.toggle", "form.button"]; readonly maxInstances: 4; readonly events: { readonly submit: { readonly payloadSchema: z.ZodObject<{}, z.core.$strict>; readonly actionContracts: { readonly "form.submit": "^1"; }; }; readonly reset: { readonly payloadSchema: z.ZodObject<{}, z.core.$strict>; readonly actionContracts: { readonly "form.reset": "^1"; }; }; }; }, { readonly type: "form.input"; readonly version: 1; readonly category: "surface-form"; readonly propsSchema: ZodType, unknown, z.core.$ZodTypeInternals, unknown>>; readonly slots: {}; readonly trust: "safe"; readonly commitPolicy: "atomic"; readonly prompt: { readonly summary: "Edit one bounded string or numeric state value."; readonly useWhen: readonly ["A form needs a short text, email, number, or date value."]; readonly avoidWhen: readonly ["The field is a fixed option set or boolean choice."]; }; readonly profiles: readonly ["form", "operations"]; readonly searchTerms: readonly ["input", "field", "text field", "输入", "字段"]; readonly maxInstances: 24; readonly events: { readonly change: { readonly payloadSchema: z.ZodObject<{ value: z.ZodUnion; }, z.core.$strict>; readonly actionContracts: { readonly "form.change": "^1"; }; }; }; readonly bindings: { readonly referencePaths: readonly ["/value", "/disabled"]; readonly conditionPaths: readonly ["/disabled"]; }; }, { readonly type: "form.select"; readonly version: 1; readonly category: "surface-form"; readonly propsSchema: ZodType, unknown, z.core.$ZodTypeInternals, unknown>>; readonly slots: {}; readonly trust: "safe"; readonly commitPolicy: "atomic"; readonly prompt: { readonly summary: "Choose one value from a bounded option set."; readonly useWhen: readonly ["A typed form value must come from known options."]; readonly avoidWhen: readonly ["The option set is unbounded or free-form text is required."]; }; readonly profiles: readonly ["form", "operations"]; readonly searchTerms: readonly ["select", "options", "choice", "选择", "选项"]; readonly maxInstances: 16; readonly events: { readonly change: { readonly payloadSchema: z.ZodObject<{ value: z.ZodString; }, z.core.$strict>; readonly actionContracts: { readonly "form.change": "^1"; }; }; }; readonly bindings: { readonly referencePaths: readonly ["/value", "/options", "/disabled"]; readonly conditionPaths: readonly ["/disabled"]; }; }, { readonly type: "form.toggle"; readonly version: 1; readonly category: "surface-form"; readonly propsSchema: ZodType, unknown, z.core.$ZodTypeInternals, unknown>>; readonly slots: {}; readonly trust: "safe"; readonly commitPolicy: "atomic"; readonly prompt: { readonly summary: "Edit one explicit boolean state value."; readonly useWhen: readonly ["A form needs a binary on or off choice."]; readonly avoidWhen: readonly ["The choice has more than two meaningful values."]; }; readonly profiles: readonly ["form", "operations"]; readonly searchTerms: readonly ["toggle", "boolean", "switch", "开关", "布尔"]; readonly maxInstances: 16; readonly events: { readonly change: { readonly payloadSchema: z.ZodObject<{ checked: z.ZodBoolean; }, z.core.$strict>; readonly actionContracts: { readonly "form.change": "^1"; }; }; }; readonly bindings: { readonly referencePaths: readonly ["/checked", "/disabled"]; readonly conditionPaths: readonly ["/disabled"]; }; }, { readonly type: "form.button"; readonly version: 1; readonly category: "surface-form"; readonly propsSchema: ZodType, unknown, z.core.$ZodTypeInternals, unknown>>; readonly slots: {}; readonly trust: "safe"; readonly commitPolicy: "atomic"; readonly prompt: { readonly summary: "Trigger a declared form action with an explicit command button."; readonly useWhen: readonly ["A form needs an explicit submit, reset, or local action command."]; readonly avoidWhen: readonly ["The action is not declared or requires hidden executable behavior."]; }; readonly profiles: readonly ["form", "operations"]; readonly searchTerms: readonly ["button", "submit", "reset", "按钮", "提交"]; readonly maxInstances: 8; readonly events: { readonly press: { readonly payloadSchema: z.ZodObject<{}, z.core.$strict>; readonly actionContracts: { readonly "form.press": "^1"; }; }; }; readonly bindings: { readonly referencePaths: readonly ["/disabled"]; readonly conditionPaths: readonly ["/disabled"]; }; }]; declare const semanticArtifactContracts: readonly NodeContract[]; declare const defaultCompilerCatalog: CompilerCatalog; type CatalogSliceInput = { catalog?: CompilerCatalog; profile?: SurfaceProfile; requestedNodeTypes?: readonly string[]; task?: string; maxNodeTypes?: number; }; declare function sliceCatalog(input?: CatalogSliceInput): CatalogSlice; //#endregion //#region src/diagnostics.d.ts declare class CompilerDiagnosticError extends Error { readonly diagnostics: readonly Diagnostic[]; constructor(diagnostics: readonly Diagnostic[]); } declare function compilerDiagnostic(input: { phase: DiagnosticPhase; code: string; message: string; path?: string; severity?: Diagnostic["severity"]; recoverable?: boolean; modelCorrectable?: boolean; expected?: JsonValue; actualSummary?: string; hint?: string; }): Diagnostic; declare function diagnosticsFromUnknown(error: unknown): readonly Diagnostic[]; //#endregion //#region src/commit.d.ts type ArtifactUIIdKind = "document" | "revision" | "head-token" | "state-revision" | "ui-part"; type ArtifactUIHostContext = { branchId?: string; resources?: Readonly>; evidence?: Readonly>; }; type ArtifactCommitHostContext = ArtifactUIHostContext; type ArtifactCommitIdKind = ArtifactUIIdKind; type CommitBundle = Pick; type ArtifactCommitOptions = ArtifactCommitHostContext & { documentPolicy?: DocumentPolicy; now?: () => string; idFactory?: (kind: ArtifactCommitIdKind, hint?: string) => string; stateDefinition?: (stateId: string, authoring: NormalizedArtifactProposal["state"][string], policy: DocumentPolicy) => MaybePromise; }; type MaterializeArtifactPartOptions = ArtifactCommitOptions & { bundle: CommitBundle; documentPolicy: DocumentPolicy; }; declare class ArtifactCommitError extends TypeError { readonly code: string; constructor(code: string, message: string); } /** * Crosses the only trusted boundary from a compiler-branded proposal into the * runtime document protocol. Transport adapters should never construct runtime * snapshots independently. */ declare function materializeArtifactPart(proposalPart: ArtifactPart, options: MaterializeArtifactPartOptions): Promise; declare function commitValidatedArtifactProposal(proposalPart: ArtifactPart, bundle: CommitBundle, options?: ArtifactCommitOptions): Promise; declare function toArtifactPartWire(part: ArtifactPart$1): import("@data-elements/runtime").ArtifactPartWire; declare function mergeArtifactCommitHostContext(base: ArtifactCommitHostContext, turn: ArtifactCommitHostContext): Required; declare function defaultArtifactIdFactory(kind: ArtifactCommitIdKind, hint?: string): string; //#endregion //#region src/information-flow.d.ts type DocumentPolicyInput = InformationFlowLabel & { policyId: string; policyVersion?: number; }; declare function computeDocumentPolicyHash(policy: Omit | DocumentPolicyInput): string; declare function createDocumentPolicy(input: DocumentPolicyInput): Readonly; declare const DEFAULT_DOCUMENT_POLICY: Readonly; declare function joinInformationFlow(labels: readonly InformationFlowLabel[]): Readonly; type PreparedInformationFlow = { included: readonly LabeledModelInput[]; excluded: readonly LabeledModelInput[]; joinedLabel: Readonly; generationTaintHash: string; }; declare function prepareInformationFlow(inputs: readonly LabeledModelInput[], documentPolicy: DocumentPolicy): Readonly; //#endregion //#region src/normalize.d.ts declare const DEFAULT_GENERATION_LIMITS: Readonly; declare function resolveGenerationLimits(overrides?: Partial): Readonly; type NormalizeSurfaceOptions = { catalog?: CompilerCatalog | CatalogSlice; limits?: Partial; allowedResourceIds?: readonly string[]; capabilityIds?: readonly string[]; messageTemplateIds?: readonly string[]; }; declare function normalizeSurface(input: unknown, options?: NormalizeSurfaceOptions): Readonly; declare function safeNormalizeSurface(input: unknown, options?: NormalizeSurfaceOptions): { success: true; data: Readonly; } | { success: false; diagnostics: readonly Diagnostic[]; }; //#endregion //#region src/part.d.ts declare function isArtifactPart(value: unknown): value is ArtifactPart; //#endregion //#region src/prompt.d.ts declare const schemaProfile: { readonly profileId: "data-elements.schema-core"; readonly profileVersion: 1; readonly profileHash: string; }; declare function createProviderSchema(slice: CatalogSlice, options?: { capabilities?: readonly ModelVisibleCapability[]; messageTemplates?: readonly ModelVisibleMessageTemplate[]; }): JSONSchema; type PromptCompileInput = { catalog?: CompilerCatalog | CatalogSlice; preset?: CompilerPreset; profile?: SurfaceProfile; documentPolicy?: DocumentPolicy; generationTaintHash: string; requestedNodeTypes?: readonly string[]; task?: string; codec?: AuthoringCodec; renderMode?: RenderMode; capabilityDescriptors?: readonly ModelVisibleCapability[]; messageTemplateDescriptors?: readonly ModelVisibleMessageTemplate[]; locale?: string; limits?: Partial; parentDocumentSummaries?: readonly DocumentSummary[]; }; declare function compilePrompt(input: PromptCompileInput): Readonly; //#endregion //#region src/repair.d.ts declare function sanitizeRepairDiagnostics(diagnostics: readonly Diagnostic[]): readonly RepairDiagnostic[]; type BoundedRepairOptions = { initialValue: unknown; bundle: PromptBundle; informationFlow: InformationFlowLabel; validate(value: unknown): T; provider?: RepairProvider; parentRevisionId?: string; headPreconditions?: Readonly>; statePreconditions?: Readonly>; }; declare function runBoundedRepair(options: BoundedRepairOptions): Promise; //#endregion //#region src/surface.d.ts type NodeBase = { id: string; events?: Record; evidence?: string[]; }; declare const reference: Readonly<{ state(id: string, path?: PathSegment[]): AuthoringValue; resource(id: string, path?: PathSegment[]): AuthoringValue; event(port: string, path?: PathSegment[]): AuthoringValue; context(key: "locale" | "timezone"): AuthoringValue; }>; declare function condition(op: ConditionOperator, ...args: AuthoringValue[]): AuthoringValue; declare const surface: Readonly<{ node(input: AuthoringNode): AuthoringNode; stack(input: NodeBase & { children: AuthoringNode[]; gap?: "none" | "xs" | "sm" | "md" | "lg" | "xl"; align?: "start" | "center" | "end" | "stretch"; }): AuthoringNode; grid(input: NodeBase & { children: AuthoringNode[]; columns?: 1 | 2 | 3 | 4; gap?: "none" | "xs" | "sm" | "md" | "lg" | "xl"; align?: "start" | "center" | "end" | "stretch"; }): AuthoringNode; section(input: NodeBase & { children: AuthoringNode[]; title?: string; description?: string; }): AuthoringNode; text(input: NodeBase & { text: string; role?: "heading" | "paragraph" | "caption"; tone?: "default" | "muted" | "positive" | "warning" | "critical"; }): AuthoringNode; callout(input: NodeBase & { body: string; title?: string; tone?: "info" | "success" | "warning" | "critical"; }): AuthoringNode; progress(input: NodeBase & { label: string; value: number; detail?: string; }): AuthoringNode; empty(input: NodeBase & { title: string; description?: string; reason?: "no-data" | "filtered" | "unavailable" | "not-applicable"; }): AuthoringNode; form(input: NodeBase & { fields: AuthoringNode[]; title?: string; description?: string; }): AuthoringNode; input(input: NodeBase & { label: string; inputType?: "text" | "email" | "number" | "date"; value?: AuthoringValue; placeholder?: string; description?: string; required?: boolean; disabled?: AuthoringValue; }): AuthoringNode; select(input: NodeBase & { label: string; options?: AuthoringValue; value?: AuthoringValue; placeholder?: string; description?: string; required?: boolean; disabled?: AuthoringValue; }): AuthoringNode; toggle(input: NodeBase & { label: string; description?: string; checked?: AuthoringValue; disabled?: AuthoringValue; }): AuthoringNode; button(input: NodeBase & { label: string; type?: "button" | "submit" | "reset"; variant?: "default" | "secondary" | "destructive"; disabled?: AuthoringValue; }): AuthoringNode; artifact(artifact: Artifact, options?: { id?: string; events?: Record; evidence?: string[]; }): AuthoringNode; }>; declare function projectArtifactToNodeProps(artifact: Artifact): Record; declare function defineSurface(input: AuthoringNode | ArtifactProposal): ArtifactProposal; //#endregion //#region src/turn.d.ts type TurnMessage = { role: "system" | "user" | "assistant" | "tool" | string; content: JsonValue; provenanceRef?: string; label?: InformationFlowLabel; }; type LabeledDocumentSummary = { value: DocumentSummary; provenanceRef: string; label: InformationFlowLabel; }; type PrepareTurnInput = { messages: readonly TMessage[]; profile?: SurfaceProfile; preset?: CompilerPreset; catalog?: CompilerCatalog; documentPolicy?: DocumentPolicy; modelInputs?: readonly LabeledModelInput[]; requestedNodeTypes?: readonly string[]; task?: string; codec?: AuthoringCodec; renderMode?: RenderMode; capabilityDescriptors?: readonly ModelVisibleCapability[]; messageTemplateDescriptors?: readonly ModelVisibleMessageTemplate[]; parentDocumentSummaries?: readonly LabeledDocumentSummary[]; resourceIds?: readonly string[]; locale?: string; limits?: Partial; }; type AcceptArtifactOptions = { repairProvider?: RepairProvider; parentRevisionId?: string; headPreconditions?: Readonly>; statePreconditions?: Readonly>; }; type PreparedTurn = { readonly system: string; readonly messages: readonly TMessage[]; readonly modelInputs: readonly LabeledModelInput[]; readonly tools: Readonly<{ renderArtifact: PromptBundle["tool"]; }>; readonly providerSchema: PromptBundle["providerSchema"]; readonly bundle: Readonly; readonly context: Readonly; accept(output: TProviderOutput, adapter: ArtifactTransportAdapter, options?: AcceptArtifactOptions): Promise; respond(part: ArtifactPart, adapter: ArtifactTransportAdapter): Promise; }; declare function prepareTurn(input: PrepareTurnInput): Promise>; type ArtifactCompilerOptions = { catalog?: CompilerCatalog; preset?: CompilerPreset; documentPolicy?: DocumentPolicy; codec?: AuthoringCodec; renderMode?: RenderMode; limits?: Partial; }; declare function createArtifactCompiler(options?: ArtifactCompilerOptions): Readonly<{ catalog: CompilerCatalog; prepareTurn(input: PrepareTurnInput): Promise>; }>; //#endregion export { type AcceptArtifactOptions, type AdapterContext, ArtifactCommitError, type ArtifactCommitHostContext, type ArtifactCommitIdKind, type ArtifactCommitOptions, type ArtifactCompilerOptions, type ArtifactMeta, type ArtifactPart, type ArtifactProposal, type ArtifactTransportAdapter, type ArtifactUIHostContext, type ArtifactUIIdKind, type ArtifactValue, type AuthoringActionPlan, type AuthoringActionStep, type AuthoringCodec, type AuthoringNavigationTarget, type AuthoringNode, type AuthoringStateDefinition, type AuthoringValue, type BoundedRepairOptions, type CatalogIdentity, type CatalogSlice, type CatalogSliceInput, CompilerCatalog, CompilerDiagnosticError, type CompilerExample, type CompilerPreset, type ConditionOperator, DEFAULT_DOCUMENT_POLICY, DEFAULT_GENERATION_LIMITS, type Diagnostic, type DiagnosticPhase, type DocumentPolicy, type DocumentPolicyInput, type DocumentSummary, type GenerationLimits, type InformationFlowLabel, type JSONSchema, type JsonObject, type JsonValue, type LabeledDocumentSummary, type LabeledModelInput, type MaterializeArtifactPartOptions, type MaybePromise, type ModelVisibleCapability, type ModelVisibleMessageTemplate, type NodeCategory, type NodeContract, type NodePromptMetadata, type NormalizeSurfaceOptions, type NormalizedActionPlan, type NormalizedActionStep, type NormalizedArtifactNode, type NormalizedArtifactProposal, type PathSegment, type PlainAuthoringObject, type PolicySink, type PrepareTurnInput, type PreparedInformationFlow, type PreparedTurn, type PromptBundle, type PromptCompileInput, type RenderMode, type RepairDiagnostic, type RepairProvider, type RepairRequest, type Scalar, type SchemaProfileBinding, type SlotContract, type SurfaceProfile, type TurnMessage, commitValidatedArtifactProposal, compilePrompt, compilerDiagnostic, schemaProfile as compilerSchemaProfile, computeDocumentPolicyHash, condition, createArtifactCompiler, createCompilerCatalog, createDocumentPolicy, createProviderSchema, defaultArtifactIdFactory, defaultCompilerCatalog, defineNodeContract, defineSurface, diagnosticsFromUnknown, isArtifactPart, joinInformationFlow, materializeArtifactPart, mergeArtifactCommitHostContext, normalizeSurface, prepareInformationFlow, prepareTurn, projectArtifactToNodeProps, reference, resolveGenerationLimits, runBoundedRepair, safeNormalizeSurface, sanitizeRepairDiagnostics, semanticArtifactContracts, sliceCatalog, surface, surfaceNodeContracts, toArtifactPartWire }; //# sourceMappingURL=index.d.mts.map