/** * @fileoverview Lowering (SPEC Section 13) * * Lower IntentIR to IntentBody. * * Pipeline: * IntentIR (semantic structure) * ↓ lower() * IntentBody (protocol intent) * ↓ Issuer.issue() * IntentInstance (executable attempt) */ import type { IntentIR, ResolvedIntentIR } from "../schema/index.js"; import type { Lexicon } from "../lexicon/index.js"; import type { Resolver, ResolutionContext } from "../resolver/index.js"; import type { IntentBody } from "../keys/types.js"; /** * Error during lowering (as value, not exception). */ export type LoweringError = { readonly code: "UNKNOWN_LEMMA"; readonly lemma: string; } | { readonly code: "RESOLUTION_FAILED"; readonly message: string; }; /** * Lowering result type. */ export type LowerResult = { readonly ok: true; readonly body: IntentBody; readonly resolvedIR: ResolvedIntentIR; } | { readonly ok: false; readonly error: LoweringError; }; /** * Lower IntentIR to IntentBody. * * Per SPEC Section 13.3: * 1. Resolve action type from lemma * 2. Resolve discourse references (this/that/last -> id) * 3. Map args + cond to domain input (cond becomes filter) * 4. Derive scope proposal if write operation * * @example * const result = lower(ir, lexicon, resolver, context); * if (result.ok) { * const { body, resolvedIR } = result; * // Use body for protocol, resolvedIR for strictKey * } */ export declare function lower(ir: IntentIR, lexicon: Lexicon, resolver: Resolver, context?: ResolutionContext): LowerResult; /** * Lower IntentIR to IntentBody, throwing on error. * * Use when you want exception-based error handling. */ export declare function lowerOrThrow(ir: IntentIR, lexicon: Lexicon, resolver: Resolver, context?: ResolutionContext): { body: IntentBody; resolvedIR: ResolvedIntentIR; }; //# sourceMappingURL=lower.d.ts.map