/** * The compile pipeline. * * `parse -> validate -> normalize -> resolve registry -> resolve theme -> * render -> collect used assets and runtime features -> assemble -> verify` * * Every stage is observable: `compile()` returns the IR, the resolved theme, the * collected features, the diagnostics, and a content hash of the emitted bytes. * `render()` is the same pipeline reduced to the HTML string. */ import { type Diagnostic } from '../diagnostics.js'; import type { DiagramAdapter } from '../diagram/adapter.js'; import type { IrDocument } from '../ir.js'; import type { BlockRegistry } from '../registry/block-module.js'; import type { RuntimeFeature } from '../registry/roster.js'; import { loadTheme, type ResolvedTheme } from '../theme/load-theme.js'; import { type ThemeCatalog } from '../theme/theme-catalog.js'; import { needsLiveRegion } from './runtime.js'; export interface RenderOptions { /** Theme preset name or typed theme input; defaults to the spec's theme. */ theme?: unknown; /** Source label used in parse diagnostics. */ source?: string; /** Emit the light/dark toggle. On by default: AgentKit HTML pages require it. */ themeToggle?: boolean; /** Preset catalog. Defaults to built-ins only; pass a discovered catalog to * resolve project or user presets. */ themeCatalog?: ThemeCatalog; /** * Diagram adapter. AgentKit's Engineer install supplies one backed by the * `ak:diagram` typed compiler; without it every diagram-panel emits the * structured semantic fallback. */ diagramAdapter?: DiagramAdapter; /** * Blocks and features available to the spec. Defaults to the built-in * registry. Internal: tests pass one from `buildRegistry()`; it is not a * supported extension point. */ registry?: BlockRegistry; } export interface CompileResult { html: string; /** Content hash of the emitted bytes; identical input yields an identical hash. */ hash: string; bytes: number; ir: IrDocument; theme: ResolvedTheme; features: RuntimeFeature[]; warnings: Diagnostic[]; } /** Run the full pipeline and return everything it produced. */ export declare function compile(spec: unknown, options?: RenderOptions): CompileResult; /** Compile a spec to a standalone HTML artifact. */ export declare function render(spec: unknown, options?: RenderOptions): string; /** True when the emitted document needs the interaction runtime. */ export declare function documentNeedsRuntime(result: CompileResult): boolean; export { loadTheme, needsLiveRegion }; //# sourceMappingURL=render.d.ts.map