@adaptiveapp/ir
v0.2.0
Published
App IR — Zod schemas, validators, differ, IR migrations
Readme
@adaptiveapp/ir
The App IR — the schemas AdaptiveApp AI generates from, and the validators that refuse to let it generate from something incoherent.
Published because @adaptiveapp/runtime is typed against it and every generated app imports its widget manifests from here.
pnpm add @adaptiveapp/irWhat is in it
Schemas (Zod, authoritative). WidgetManifest, LayoutDoc, LayoutEntry, PlacedWidget, ContextSlot, DependencyEdge, WidgetLayoutSlice, plus LAYER_ORDER, GRID_COLUMNS and LAYOUT_SCHEMA_VERSION. Types are inferred from the schemas, never duplicated alongside them.
Validators. validateWidgetLayoutSlice, validateDependencyGraph, validateBlockingProviders, validateLayoutDefaults. They return typed E-IR-* findings with addressable paths and never throw — the caller decides whether a run dies or a human sees a digest.
JSON Schema emission. emitJsonSchemas() writes the committed schemas under schemas/, importable as @adaptiveapp/ir/schemas/widget-manifest.json.
The personalization matrix generator — @adaptiveapp/ir/testing:
import { generateMatrix, uncoveredPairs } from '@adaptiveapp/ir/testing';
const matrix = generateMatrix(manifests); // seeded; same input ⇒ same matrix
uncoveredPairs(matrix); // [] when the cover is completeExhaustive visibility testing is 2ⁿ — twenty hideable widgets is a million cases. The matrix instead covers every widget solo, every declared dependency pair in all four visibility states, a greedy pairwise cover of the rest, and both extremes. It is seeded and sorts its input, so the emitted spec can be committed without churning diffs.
Fixtures. makeWidget() and hospitalSlice ship from src on purpose, so downstream tests build on the same manifests instead of re-declaring them.
License
UNLICENSED — private package.
