@pygmalionjs/pygmalion 0.4.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/types.d.ts CHANGED
@@ -18,6 +18,14 @@ export interface RegistryEntry {
18
18
  defaultProps?: Record<string, RegistryPropValue>;
19
19
  /** 'text' = children Edit string · 'nodes' = Place canvas nodes as children (Card, etc.). */
20
20
  children?: 'text' | 'none' | 'nodes';
21
+ /**
22
+ * Whether a captured screen subtree may be REPLACED by this entry when a
23
+ * screen is imported. Declare it only for entries that render the real
24
+ * component from literal props — a catalog demo or a fixture-seeded adapter
25
+ * draws its own sample content, so collapsing into it swaps the captured
26
+ * screen for that sample. Default false.
27
+ */
28
+ collapsible?: boolean;
21
29
  /** Static children default values ​​to use when inserting from the palette. */
22
30
  defaultChildren?: string;
23
31
  /** Path for generating codegen import statements. */
@@ -435,6 +443,13 @@ export interface StoryboardEnvironment {
435
443
  devices?: readonly StoryboardMediaDevice[];
436
444
  getUserMedia?: 'passthrough' | StoryboardMediaFailure;
437
445
  };
446
+ /**
447
+ * 'sandbox' virtualizes the whole origin storage for the document: reads
448
+ * of undeclared keys see a pristine profile and writes never reach the
449
+ * shared storage. Hidden preview instances set it so persisted UI state
450
+ * from one walk cannot poison sibling instances or the designer's tab.
451
+ */
452
+ storageIsolation?: 'sandbox';
438
453
  }
439
454
 
440
455
  export type DesignScreenAssertionVisibility = 'visible' | 'hidden';
@@ -479,7 +494,13 @@ export interface DesignImportPage {
479
494
  flow?: string;
480
495
  scenario?: string;
481
496
  state?: string;
497
+ /** Host-declared kind of the state branch (overlay, badge, layout, ...). Presentation hint for the Screen states control. */
498
+ stateKind?: string;
499
+ /** Host-declared situation lane the canvas arranges the frame into. */
500
+ lane?: string;
482
501
  scenarioId?: string;
502
+ /** Every scenario the screen demonstrates; coverage counts this set. */
503
+ scenarioIds?: readonly string[];
483
504
  interactions?: readonly DesignScreenInteraction[];
484
505
  environment?: StoryboardEnvironment;
485
506
  preset?: DesignScreenPreset;
@@ -768,6 +789,10 @@ export interface DesignImportInitialPage extends InitialPageDef {
768
789
  flow?: string;
769
790
  scenario?: string;
770
791
  state?: string;
792
+ /** Host-declared kind of the state branch (overlay, badge, layout, ...). Presentation hint for the Screen states control. */
793
+ stateKind?: string;
794
+ /** Host-declared situation lane the canvas arranges the frame into. */
795
+ lane?: string;
771
796
  scenarioId?: string;
772
797
  interactions?: DesignScreenInteraction[];
773
798
  environment?: StoryboardEnvironment;
@@ -813,6 +838,12 @@ export interface DesignImportController {
813
838
  export interface CreateDesignImportOptions {
814
839
  layerOptions?: DomImportOptions;
815
840
  executeScreenPreset?: DesignScreenPresetExecutor;
841
+ /**
842
+ * `section` gives each screen section its own canvas
843
+ * (`<screens canvas> · <section>`), so the camera, the LOD budget, and
844
+ * decoded previews scale with a section instead of the whole catalog.
845
+ */
846
+ screensCanvasPartition?: 'single' | 'section';
816
847
  }
817
848
 
818
849
  export declare function createDesignImportController(
@@ -1173,6 +1204,414 @@ export declare function createPreviewCacheNamespace(
1173
1204
  export declare function createStoryboardCaptureRecipeIdentity(
1174
1205
  screen: StoryboardCaptureRecipeInput,
1175
1206
  ): unknown;
1207
+ /** The declaration-relevant slice of a page: everything grouping keys off. */
1208
+ export interface ScreenStateGroupInput {
1209
+ name: string;
1210
+ canvas?: string;
1211
+ route?: string;
1212
+ scenario?: string;
1213
+ state?: string;
1214
+ width?: number;
1215
+ height?: number;
1216
+ }
1217
+ export interface ScreenStateGroupDiagnostic {
1218
+ severity: 'warning' | 'info';
1219
+ code: 'mixed-viewport' | 'duplicate-state' | 'cross-canvas' | 'singleton-group';
1220
+ scenario: string;
1221
+ message: string;
1222
+ }
1223
+ /**
1224
+ * Validates host-declared screen-state groups against the contract the
1225
+ * Screen states panel enforces — same canvas, one frame per state label, a
1226
+ * shared viewport, at least one sibling. Hosts own membership; the core
1227
+ * validates the declaration.
1228
+ */
1229
+ export declare function validateScreenStateGroups(
1230
+ pages: readonly ScreenStateGroupInput[],
1231
+ ): ScreenStateGroupDiagnostic[];
1232
+ /** One waypoint of a flow path: the screen it materializes and the walk delta reaching it. */
1233
+ export interface ScreenFlowWaypoint {
1234
+ /** Catalog id of the screen this waypoint materializes (importPageId). */
1235
+ screenId: string;
1236
+ /** Interactions from the previous waypoint (or the boot) to this screen's state. */
1237
+ steps?: readonly DesignScreenInteraction[];
1238
+ }
1239
+ /**
1240
+ * One captureless surface path: a hidden live instance boots `route` with
1241
+ * `environment` and walks the waypoints in order, publishing one frozen
1242
+ * snapshot per screen. A single-waypoint path is a per-screen recipe; a
1243
+ * multi-waypoint path amortizes one boot across a user journey.
1244
+ */
1245
+ export interface ScreenFlowPath {
1246
+ id: string;
1247
+ route: string;
1248
+ environment?: StoryboardEnvironment;
1249
+ waypoints: readonly ScreenFlowWaypoint[];
1250
+ }
1251
+ export interface ScreenFlowDiagnostic {
1252
+ severity: 'error' | 'warning';
1253
+ pathId: string;
1254
+ message: string;
1255
+ }
1256
+ /** Structural validation of flow paths against the screen catalog. */
1257
+ export declare function validateScreenFlows(
1258
+ paths: readonly ScreenFlowPath[],
1259
+ screens: readonly { id: string }[],
1260
+ ): ScreenFlowDiagnostic[];
1261
+ /**
1262
+ * Where one QA scenario is verified: a dedicated frame, a folded screen
1263
+ * state, a component toggle, a viewport preset, or a declared behavior/todo.
1264
+ * Claims are host-declared, core-validated, and executable in the editor.
1265
+ */
1266
+ export type ScenarioCoverageClaim =
1267
+ | { scenarioId: string; kind: 'frame'; screenId: string; reason?: string }
1268
+ | { scenarioId: string; kind: 'screen-state'; screenId: string; reason?: string }
1269
+ | {
1270
+ scenarioId: string;
1271
+ kind: 'component-state';
1272
+ screenId: string;
1273
+ componentName: string;
1274
+ prop: string;
1275
+ value: RegistryPropValue;
1276
+ reason?: string;
1277
+ }
1278
+ | {
1279
+ scenarioId: string;
1280
+ kind: 'viewport';
1281
+ screenId: string;
1282
+ preset: string;
1283
+ reason?: string;
1284
+ }
1285
+ | { scenarioId: string; kind: 'catalog'; screenId: string; reason?: string }
1286
+ | {
1287
+ scenarioId: string;
1288
+ /** A declared interactive axis reaches the scenario in one gesture. */
1289
+ kind: 'interactive-state';
1290
+ /** InteractiveStateDef id. */
1291
+ interaction: string;
1292
+ /** InteractiveStateOption id within that axis. */
1293
+ option: string;
1294
+ screenId: string;
1295
+ reason?: string;
1296
+ }
1297
+ | {
1298
+ scenarioId: string;
1299
+ /** A badge composition on the screen's repeated card demonstrates it. */
1300
+ kind: 'card-slot';
1301
+ /** ScreenCardDef id. */
1302
+ card: string;
1303
+ /** CardSlotDef id within that card. */
1304
+ slot: string;
1305
+ /** CardBadgeOption id within that slot. */
1306
+ option: string;
1307
+ screenId: string;
1308
+ reason?: string;
1309
+ }
1310
+ | {
1311
+ scenarioId: string;
1312
+ /** A row count on the screen's declared list demonstrates it. */
1313
+ kind: 'list-length';
1314
+ /** ScreenListDef id. */
1315
+ list: string;
1316
+ count: number;
1317
+ screenId: string;
1318
+ reason?: string;
1319
+ }
1320
+ | { scenarioId: string; kind: 'behavior'; reason: string }
1321
+ | { scenarioId: string; kind: 'todo'; reason: string };
1322
+ export interface ScenarioCoverageDiagnostic {
1323
+ severity: 'error' | 'warning';
1324
+ scenarioId: string;
1325
+ message: string;
1326
+ }
1327
+ export interface ScenarioCoverageContext {
1328
+ scenarios: readonly { id: string }[];
1329
+ screens: readonly { id: string; scenario?: string; state?: string }[];
1330
+ registry: Readonly<
1331
+ Record<string, { props?: Readonly<Record<string, readonly RegistryPropValue[]>> }>
1332
+ >;
1333
+ viewportPresets: readonly { label: string }[];
1334
+ catalogPages?: readonly { id: string }[];
1335
+ /** Host-declared interactive axes, for interactive-state claims. */
1336
+ interactiveStates?: readonly {
1337
+ id: string;
1338
+ options: readonly { id: string; steps?: readonly unknown[] }[];
1339
+ }[];
1340
+ /** Host-declared card compositions, for card-slot claims. */
1341
+ screenCards?: readonly {
1342
+ id: string;
1343
+ slots: readonly { id: string; options: readonly { id: string }[] }[];
1344
+ }[];
1345
+ /** Host-declared list axes, for list-length claims. */
1346
+ screenLists?: readonly { id: string; min?: number; max?: number }[];
1347
+ }
1348
+ export declare function validateScenarioCoverage(
1349
+ claims: readonly ScenarioCoverageClaim[],
1350
+ context: ScenarioCoverageContext,
1351
+ ): ScenarioCoverageDiagnostic[];
1352
+ /** One discovered conditional-render branch from the component scanner. */
1353
+ export interface ComponentBranch {
1354
+ kind: 'conditional' | 'enum';
1355
+ condition: string;
1356
+ element?: string;
1357
+ renders?: string;
1358
+ values?: readonly string[];
1359
+ line?: number;
1360
+ }
1361
+ export interface ScreenDimensionOption {
1362
+ label: string;
1363
+ props: Readonly<Record<string, RegistryPropValue>>;
1364
+ }
1365
+ /**
1366
+ * Points at captured markup by a test id or css-module class prefix. A list
1367
+ * of prefixes matches any one of them, which lets a single axis cover
1368
+ * sibling elements the product renders from different branches.
1369
+ */
1370
+ export interface NodeSelector {
1371
+ testId?: string;
1372
+ classIncludes?: string | readonly string[];
1373
+ }
1374
+ /**
1375
+ * A curated right-panel control that swaps a captured piece's state by
1376
+ * adopting the matched node into a registry adapter instance.
1377
+ */
1378
+ export interface ScreenDimensionDef {
1379
+ id: string;
1380
+ label: string;
1381
+ component: string;
1382
+ prop?: string;
1383
+ options?: readonly ScreenDimensionOption[];
1384
+ match: NodeSelector;
1385
+ /**
1386
+ * 'first' (default) drives the one piece a screen shows once; 'each'
1387
+ * opens a control per match, which is what a list of rows needs.
1388
+ */
1389
+ sourcePath?: string;
1390
+ }
1391
+ export interface ScreenDimensionDiagnostic {
1392
+ severity: 'error' | 'warning';
1393
+ dimensionId: string;
1394
+ message: string;
1395
+ }
1396
+ export declare function validateScreenDimensions(
1397
+ dimensions: readonly ScreenDimensionDef[],
1398
+ context: {
1399
+ registry: Readonly<
1400
+ Record<string, { props?: Readonly<Record<string, readonly RegistryPropValue[]>> }>
1401
+ >;
1402
+ scansBySource?: Readonly<Record<string, readonly ComponentBranch[]>>;
1403
+ },
1404
+ ): ScreenDimensionDiagnostic[];
1405
+ /**
1406
+ * A repeating list whose row count becomes a right-panel control. Growing
1407
+ * clones the last row (identical on purpose — the per-row dimension
1408
+ * controls are what make rows differ); shrinking drops trailing rows. It
1409
+ * edits the captured tree, so it applies instantly and undoes in one step.
1410
+ */
1411
+ export interface ScreenListDef {
1412
+ id: string;
1413
+ label: string;
1414
+ container: NodeSelector;
1415
+ item: NodeSelector;
1416
+ /** Fewest rows the control offers. Default 0. */
1417
+ min?: number;
1418
+ /** Most rows the control offers. Default 12. */
1419
+ max?: number;
1420
+ }
1421
+ export interface ScreenListDiagnostic {
1422
+ severity: 'error' | 'warning';
1423
+ listId: string;
1424
+ message: string;
1425
+ }
1426
+ export declare function validateScreenLists(
1427
+ defs: readonly ScreenListDef[],
1428
+ ): ScreenListDiagnostic[];
1429
+ /**
1430
+ * One badge a card slot may hold. `match` recognizes the captured element;
1431
+ * `component`/`props` build it from the registry when the screen has no
1432
+ * captured instance to clone; `anchor` is its fixed position in the slot.
1433
+ */
1434
+ export interface CardBadgeOption {
1435
+ id: string;
1436
+ label: string;
1437
+ component: string;
1438
+ props: Readonly<Record<string, RegistryPropValue>>;
1439
+ match: NodeSelector;
1440
+ anchor?: { before?: NodeSelector; after?: NodeSelector };
1441
+ }
1442
+ /** A region of a card with its own vocabulary and capacity. */
1443
+ export interface CardSlotDef {
1444
+ id: string;
1445
+ label: string;
1446
+ container: NodeSelector;
1447
+ /** 'multiple' (the default) when the product can show several at once. */
1448
+ arity?: 'single' | 'multiple';
1449
+ /** The product renders the container only when it has content. */
1450
+ hideWhenEmpty?: boolean;
1451
+ /** Where to create the container on a card that lacks one. */
1452
+ placement?: { parent: NodeSelector; before?: NodeSelector; after?: NodeSelector };
1453
+ options: readonly CardBadgeOption[];
1454
+ }
1455
+ /**
1456
+ * The badge composition of a repeated card, declared the way the component
1457
+ * is built: slots, what each may hold, how many at once.
1458
+ */
1459
+ export interface ScreenCardDef {
1460
+ id: string;
1461
+ label: string;
1462
+ card: NodeSelector;
1463
+ slots: readonly CardSlotDef[];
1464
+ sourcePath?: string;
1465
+ }
1466
+ export interface ScreenCardDiagnostic {
1467
+ severity: 'error' | 'warning';
1468
+ cardId: string;
1469
+ message: string;
1470
+ }
1471
+ export declare function validateScreenCards(
1472
+ defs: readonly ScreenCardDef[],
1473
+ context: {
1474
+ registry: Readonly<
1475
+ Record<string, { props?: Readonly<Record<string, readonly RegistryPropValue[]>> }>
1476
+ >;
1477
+ scansBySource?: Readonly<Record<string, readonly ComponentBranch[]>>;
1478
+ },
1479
+ ): ScreenCardDiagnostic[];
1480
+ /**
1481
+ * An axis a screen reaches by acting on it (folding the sidebar, hovering a
1482
+ * row) rather than by being a separate captured frame. Selecting an option
1483
+ * appends its steps to the frame's recipe, so the ordinary supply produces
1484
+ * the variant.
1485
+ */
1486
+ export interface InteractiveStateOption {
1487
+ id: string;
1488
+ label: string;
1489
+ /** Absent or empty marks the base state — the screen as captured. */
1490
+ steps?: readonly DesignScreenInteraction[];
1491
+ }
1492
+ export interface InteractiveStateDef {
1493
+ id: string;
1494
+ label: string;
1495
+ /** Frames the axis applies to: exact route and/or a test id in the tree. */
1496
+ requires?: { testId?: string; route?: string };
1497
+ options: readonly InteractiveStateOption[];
1498
+ }
1499
+ export interface InteractiveStateDiagnostic {
1500
+ severity: 'error' | 'warning';
1501
+ interactionId: string;
1502
+ message: string;
1503
+ }
1504
+ export declare function validateInteractiveStates(
1505
+ defs: readonly InteractiveStateDef[],
1506
+ ): InteractiveStateDiagnostic[];
1507
+ /**
1508
+ * Host-declared description of one canvas section — the band above its box.
1509
+ * The core counts frames, folded variants, scenarios and viewport itself.
1510
+ */
1511
+ /**
1512
+ * A situation group within one section. Declaration order is lane order, and
1513
+ * one lane is one row of the canvas — the axis that replaces area packing so
1514
+ * an arrangement reads as the product's structure.
1515
+ */
1516
+ export interface ScreenLaneDef {
1517
+ /** Unique within its section. */
1518
+ id: string;
1519
+ /** Human-readable, drawn as the lane caption. */
1520
+ label: string;
1521
+ /** Section name exactly as the frames carry it. */
1522
+ section: string;
1523
+ /** Caption rule colour (hex). Defaults to a neutral. */
1524
+ accent?: string;
1525
+ }
1526
+ export interface ScreenLaneDiagnostic {
1527
+ severity: 'error' | 'warning';
1528
+ laneId: string;
1529
+ message: string;
1530
+ }
1531
+ export declare function validateScreenLanes(
1532
+ lanes: readonly ScreenLaneDef[],
1533
+ context?: { sections?: readonly string[] },
1534
+ ): ScreenLaneDiagnostic[];
1535
+ export interface SectionHeaderDef {
1536
+ /** Section name exactly as the frames carry it — the join key. */
1537
+ section: string;
1538
+ /** Short handle shown large, e.g. "02". */
1539
+ code: string;
1540
+ /** Section title. */
1541
+ title: string;
1542
+ /** Secondary clause after the title: what kind of group this is. */
1543
+ kind?: string;
1544
+ /** One line a planner needs: what the section covers. */
1545
+ purpose: string;
1546
+ /** Accent colour (hex) for the rule and the category pill. */
1547
+ accent: string;
1548
+ /** Category shown in the pill. */
1549
+ pill?: string;
1550
+ }
1551
+ /** Words for the facts a section header counts. Defaults are English. */
1552
+ export interface SectionHeaderLabels {
1553
+ code?: string;
1554
+ frames?: string;
1555
+ folded?: string;
1556
+ scenarios?: string;
1557
+ flows?: string;
1558
+ }
1559
+ export interface SectionHeaderDiagnostic {
1560
+ severity: 'error' | 'warning';
1561
+ section: string;
1562
+ message: string;
1563
+ }
1564
+ export interface SectionHeaderFacts {
1565
+ frameCount: number;
1566
+ foldedCount: number;
1567
+ scenarioCount: number;
1568
+ flows: string[];
1569
+ viewport: string | null;
1570
+ }
1571
+ export declare function validateSectionHeaders(
1572
+ defs: readonly SectionHeaderDef[],
1573
+ context: { sections: readonly string[] },
1574
+ ): SectionHeaderDiagnostic[];
1575
+ /**
1576
+ * Presentation of one branch kind a frame label can carry: a state kind the
1577
+ * catalog declares, or the core's own `step` (a plain screen) and `variant`
1578
+ * (a numbered branch that declares no state kind).
1579
+ */
1580
+ export interface FrameBranchKindDef {
1581
+ kind: string;
1582
+ /** Word shown in the label's pill. */
1583
+ label: string;
1584
+ /** Accent colour for the rule and the pill text. */
1585
+ accent: string;
1586
+ }
1587
+ /** Words for the facts a frame label counts. English by default. */
1588
+ export interface FrameLabelLabels {
1589
+ layers?: string;
1590
+ noScenario?: string;
1591
+ omissions?: string;
1592
+ checkFlow?: string;
1593
+ }
1594
+ export interface FrameBranchKindDiagnostic {
1595
+ severity: 'error' | 'warning';
1596
+ kind: string;
1597
+ message: string;
1598
+ }
1599
+ export declare function validateFrameBranchKinds(
1600
+ defs: readonly FrameBranchKindDef[],
1601
+ context?: { stateKinds?: readonly string[] },
1602
+ ): FrameBranchKindDiagnostic[];
1603
+ /** Screen frames claiming no scenario at all — the holes in the ledger. */
1604
+ export declare function framesMissingScenario(
1605
+ pages: readonly { route?: string; scenarioId?: string; scenarioIds?: readonly string[] }[],
1606
+ ): readonly { name: string; section?: string }[];
1607
+ export interface ApplyCoverageResult {
1608
+ status: 'applied' | 'pending-import' | 'failed';
1609
+ message?: string;
1610
+ }
1611
+ /** Reproduces the reviewed state a claim describes inside the editor. */
1612
+ export declare function applyScenarioCoverageClaim(
1613
+ claim: ScenarioCoverageClaim,
1614
+ ): ApplyCoverageResult;
1176
1615
  export declare function createPreviewArtifactHttpTransport(
1177
1616
  options: PreviewArtifactHttpTransportOptions,
1178
1617
  ): PreviewArtifactTransport;
@@ -1464,6 +1903,8 @@ export interface StoryboardResolvedPage {
1464
1903
  flow?: string;
1465
1904
  scenario?: string;
1466
1905
  state?: string;
1906
+ /** Host-declared kind of the state branch (overlay, badge, layout, ...). Presentation hint for the Screen states control. */
1907
+ stateKind?: string;
1467
1908
  scenarioId?: string;
1468
1909
  interactions?: readonly DesignScreenInteraction[];
1469
1910
  environment?: StoryboardEnvironment;
@@ -1558,6 +1999,10 @@ export interface InitialPageDef {
1558
1999
  flow?: string;
1559
2000
  scenario?: string;
1560
2001
  state?: string;
2002
+ /** Host-declared kind of the state branch (overlay, badge, layout, ...). Presentation hint for the Screen states control. */
2003
+ stateKind?: string;
2004
+ /** Host-declared situation lane the canvas arranges the frame into. */
2005
+ lane?: string;
1561
2006
  scenarioId?: string;
1562
2007
  interactions?: DesignScreenInteraction[];
1563
2008
  environment?: StoryboardEnvironment;
@@ -1975,6 +2420,12 @@ export declare function PygmalionEditor(props: {
1975
2420
  initialPages?: InitialPageDef[];
1976
2421
  /** Canvas shown on first mount. Useful when an earlier catalog canvas is expensive to render. */
1977
2422
  initialCanvas?: string;
2423
+ /**
2424
+ * Mode the editor opens in. Defaults to 'edit'. Declare 'view-only' when the
2425
+ * editor is a review surface: it applies once, so the toggle still belongs to
2426
+ * the designer, and nothing is persisted across reloads.
2427
+ */
2428
+ initialEditMode?: 'edit' | 'view-only';
1978
2429
  /** Explicit external-design to registered-code component mappings. */
1979
2430
  componentConnections?: readonly DesignComponentConnectionDef[];
1980
2431
  /** Named frame widths the application supports — rendered as one-click buttons beside the W/H boxes. */
@@ -2003,6 +2454,50 @@ export declare function PygmalionEditor(props: {
2003
2454
  onPreviewOpenChange?: (open: boolean) => void;
2004
2455
  /** ▶ The name of the “app screen flow” canvas that the preview will always play — Enter this canvas screen even if you press it on another canvas. */
2005
2456
  flowCanvas?: string;
2457
+ /**
2458
+ * Static surface for route frames: `bitmap` (default) renders captured
2459
+ * screenshots and reconstructs frozen DOM on demand; `dom` mounts the
2460
+ * frozen DOM from the start — recommended with per-section canvases.
2461
+ */
2462
+ frameSurface?: 'bitmap' | 'dom';
2463
+ /**
2464
+ * Host-declared flow paths — the captureless surface supply. One hidden
2465
+ * live instance walks each path and publishes a frozen snapshot per
2466
+ * waypoint; frames a flow claims wait for delivery instead of booting
2467
+ * live. Screens no flow claims keep the artifact/sweep/boot supply.
2468
+ */
2469
+ screenFlows?: readonly ScreenFlowPath[];
2470
+ /**
2471
+ * Host-declared scenario coverage ledger. The right panel lists a screen's
2472
+ * claims as executable rows and badges component controls with the
2473
+ * scenarios they demonstrate.
2474
+ */
2475
+ scenarioCoverage?: readonly ScenarioCoverageClaim[];
2476
+ /** Curated per-screen dimension controls (see ScreenDimensionDef). */
2477
+ screenDimensions?: readonly ScreenDimensionDef[];
2478
+ /** Row-count controls for repeating lists (see ScreenListDef). */
2479
+ screenLists?: readonly ScreenListDef[];
2480
+ /** Section header bands (see SectionHeaderDef). */
2481
+ sectionHeaders?: readonly SectionHeaderDef[];
2482
+ /** Situation lanes: one lane is one canvas row (see ScreenLaneDef). */
2483
+ screenLanes?: readonly ScreenLaneDef[];
2484
+ /** Branch-kind presentation for frame labels (see FrameBranchKindDef). */
2485
+ frameBranchKinds?: readonly FrameBranchKindDef[];
2486
+ /** Words for the facts a frame label counts. */
2487
+ frameLabelLabels?: FrameLabelLabels;
2488
+ /** Words for the facts a section header counts. */
2489
+ sectionHeaderLabels?: SectionHeaderLabels;
2490
+ /** Badge composition per repeated card (see ScreenCardDef). */
2491
+ screenCards?: readonly ScreenCardDef[];
2492
+ /**
2493
+ * How many frames may render the running application instead of their
2494
+ * capture. Default 0 — every frame is served from its capture. Raise it
2495
+ * to keep the frames in use interactive; the least recently activated
2496
+ * holder gives its slot back.
2497
+ */
2498
+ liveScreenBudget?: number;
2499
+ /** Interactive axes reachable by acting on a screen (see InteractiveStateDef). */
2500
+ interactiveStates?: readonly InteractiveStateDef[];
2006
2501
  /** Reflect button — Returns { branch } after the host saves the file and commits the branch (push is done directly by the user). */
2007
2502
  onApply?: (payload: ApplyPayload) => Promise<{ branch: string } | void>;
2008
2503
  /** Code auto-save path that does not differentiate between icon/token/atom/component/screen. */
package/vite.d.ts CHANGED
@@ -612,3 +612,34 @@ export declare function findAffectedSourceFiles(
612
612
 
613
613
  /** source.ref value that previews the current working tree, uncommitted changes included. */
614
614
  export declare const PYGMALION_WORKTREE_SOURCE_REF: 'worktree';
615
+
616
+
617
+ // ── Component branch scanner ────────────────────────────────────────────────
618
+
619
+ export interface ScannedComponentBranch {
620
+ kind: 'conditional' | 'enum';
621
+ condition: string;
622
+ element?: string;
623
+ renders?: string;
624
+ values?: readonly string[];
625
+ line?: number;
626
+ }
627
+
628
+ export interface ComponentBranchManifest {
629
+ sourcePath: string;
630
+ branches: readonly ScannedComponentBranch[];
631
+ }
632
+
633
+ export declare const PYGMALION_COMPONENT_BRANCHES_CONTROL: string;
634
+
635
+ /** Extracts conditional-render guards and string-literal enum chains. */
636
+ export declare function scanComponentBranches(
637
+ source: string,
638
+ sourcePath: string,
639
+ ): ComponentBranchManifest;
640
+
641
+ /** Reads and scans one source file, refusing paths outside the root. */
642
+ export declare function scanComponentBranchesFile(
643
+ root: string,
644
+ sourcePath: string,
645
+ ): Promise<ComponentBranchManifest>;