@serene-pub/sdk 0.6.0-pr-7 → 0.6.0-pr-8

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.
Files changed (79) hide show
  1. package/dist/annexFields.d.ts +14 -0
  2. package/dist/annexFields.js +7 -0
  3. package/dist/announce.d.ts +26 -13
  4. package/dist/announce.js +31 -0
  5. package/dist/appletCard.d.ts +17 -0
  6. package/dist/appletCard.js +60 -0
  7. package/dist/attributes.d.ts +3 -3
  8. package/dist/attributes.js +1 -1
  9. package/dist/builder.d.ts +23 -6
  10. package/dist/builder.js +57 -5
  11. package/dist/cadences.d.ts +11 -2
  12. package/dist/cadences.js +27 -2
  13. package/dist/characterProfile.d.ts +137 -0
  14. package/dist/characterProfile.js +24 -0
  15. package/dist/component.d.ts +1 -1
  16. package/dist/componentImports.d.ts +1 -1
  17. package/dist/componentImports.js +2 -0
  18. package/dist/declarations.js +4 -0
  19. package/dist/descriptors.d.ts +68 -3
  20. package/dist/descriptors.js +23 -0
  21. package/dist/document.d.ts +8 -0
  22. package/dist/document.js +44 -1
  23. package/dist/events.d.ts +35 -4
  24. package/dist/events.js +7 -3
  25. package/dist/executor.js +26 -5
  26. package/dist/extension.d.ts +17 -0
  27. package/dist/fit.d.ts +4 -1
  28. package/dist/fit.js +43 -1
  29. package/dist/functions.d.ts +7 -1
  30. package/dist/functions.js +3 -1
  31. package/dist/genres.d.ts +7 -0
  32. package/dist/genres.js +32 -1
  33. package/dist/hookGrants.js +10 -0
  34. package/dist/index.d.ts +4 -0
  35. package/dist/index.js +9 -0
  36. package/dist/layout.d.ts +18 -0
  37. package/dist/libraryDraft.d.ts +2 -0
  38. package/dist/libraryDraft.js +5 -1
  39. package/dist/lorebookFile.d.ts +8 -0
  40. package/dist/lorebookFile.js +21 -0
  41. package/dist/participants.d.ts +53 -8
  42. package/dist/participants.js +9 -5
  43. package/dist/pluginPermissions.js +1 -1
  44. package/dist/promptBlocks.d.ts +5 -1
  45. package/dist/promptBlocks.js +23 -8
  46. package/dist/registry.js +6 -3
  47. package/dist/sceneSettings.d.ts +4 -0
  48. package/dist/sceneSettings.js +7 -4
  49. package/dist/sessionDossier.d.ts +57 -0
  50. package/dist/sessionLayout.d.ts +296 -85
  51. package/dist/sessionLayout.js +397 -133
  52. package/dist/settings.d.ts +28 -1
  53. package/dist/settings.js +50 -2
  54. package/dist/shapes.d.ts +6 -1
  55. package/dist/shapes.js +6 -1
  56. package/dist/sheetLatitude.d.ts +148 -0
  57. package/dist/sheetLatitude.js +161 -0
  58. package/dist/storyTime.js +6 -4
  59. package/dist/surfaces.d.ts +11 -1
  60. package/dist/template.d.ts +26 -1
  61. package/dist/templateCheck.d.ts +24 -0
  62. package/dist/templateCheck.js +299 -7
  63. package/dist/templateFit.js +4 -0
  64. package/dist/templateIds.d.ts +6 -0
  65. package/dist/templateIds.js +9 -0
  66. package/dist/turnLock.d.ts +10 -1
  67. package/dist/turnLock.js +6 -1
  68. package/dist/turnOrder.d.ts +37 -4
  69. package/dist/turnOrder.js +49 -11
  70. package/dist/validate.d.ts +4 -2
  71. package/dist/validate.js +15 -11
  72. package/dist/variableLayouts.d.ts +141 -0
  73. package/dist/variableLayouts.js +183 -0
  74. package/dist/variables.d.ts +35 -7
  75. package/dist/variables.js +34 -1
  76. package/dist/widgetDecls.js +12 -0
  77. package/dist/widgets.d.ts +384 -41
  78. package/dist/widgets.js +23 -0
  79. package/package.json +1 -1
@@ -7,28 +7,27 @@
7
7
  *
8
8
  * ## The shape in one paragraph
9
9
  *
10
- * Its **arrangement** is `panels` ({@link PanelLayoutV1}): three zones of
11
- * **panels**, a panel being a box that holds widgets as tabs — the thing a
12
- * person drags, pins and sees. A side zone is panels top to bottom, each
13
- * docked or in the rail; the middle is the `primary` panel (the conversation's,
14
- * which fills) with panels `above` and `below` it. When `panels` is present it
15
- * is the whole truth.
10
+ * Its **arrangement** is `panels` ({@link PanelLayoutV2}): three plain
11
+ * stacks — `left`, `middle`, `right` — of **panels**, a panel being a box
12
+ * that holds widgets as tabs, the thing a person drags and sees. There is no
13
+ * pin: every panel is open. A panel may state a `priority` (`low` gives way
14
+ * first when a zone runs short; absent is its open widget's declaration), and
15
+ * the layout's look — `backing`, `opacity`, `gap`, `behind`, `behindDim` — sits inside `panels` too.
16
+ * When `panels` is present it is the whole truth.
16
17
  *
17
- * ⏳ Before panels, the arrangement was three slots, three views of one
18
- * placement — `zoneLayout` (the side zones' membership, pin and width
19
- * ladder), `widgetGrid` (each widget's zone, order, size and anchors) and
20
- * `arrangedGrid` (per zone, whole cells and each widget's box). 0.6 is in
21
- * users' hands and plugin manifests carry them, so they are still typed and
22
- * still read — by {@link panelsFromSlots} only — and are dropped at the 0.7
23
- * squash, with it. `zoneLayout`'s width `rules` are the one part still read
24
- * directly: they are a side's width ladder ({@link zoneRungAt}), not where
25
- * anything is placed.
18
+ * ⏳ Version 1 panels (the middle as `above` / `primary` / `below`, a pin per
19
+ * panel) and, before them, three slots — `zoneLayout`, `widgetGrid` and
20
+ * `arrangedGrid`, three views of one placement — are still typed and still
21
+ * read: 0.6 is in users' hands and plugin manifests carry them. The old slots
22
+ * become version 1 by {@link panelsFromSlots}, and version 1 becomes version 2
23
+ * by {@link panelsV2Of} — the ONE converter every reader reuses. The slots
24
+ * are dropped at the 0.7 squash, with `panelsFromSlots`.
26
25
  *
27
26
  * What the screen DRAWS is one reading: {@link resolveDrawn} (→
28
- * {@link DrawnLayout}) reads {@link panelsOf}, drops retired widgets, gives
29
- * every panel one pin ({@link pinnedOf}: absent means docked) and walks each
30
- * side's width ladder ({@link zoneRungAt}). The id readers that ask "is it
31
- * drawn" ({@link drawnWidgetIds}, {@link primaryPlaced}) are that answer.
27
+ * {@link DrawnLayout}) reads {@link panelsOf}, drops retired widgets, and
28
+ * gives every panel a height and a priority (its own, else its widget's
29
+ * declaration). The id readers that ask "is it drawn"
30
+ * ({@link drawnWidgetIds}, {@link primaryPlaced}) are that answer.
32
31
  *
33
32
  * A named layout adds `widgetSettings` and `widgetStyles` (per-instance values
34
33
  * and style pins), so one blob is the portable layout. A session keeps those
@@ -45,14 +44,15 @@
45
44
  * everything about the widget (its declaration, its style rows) is read
46
45
  * through {@link widgetOfInstance}.
47
46
  *
48
- * ## The one normaliser, and what is deliberately not here
47
+ * ## The converters, and what is deliberately not here
49
48
  *
50
- * The ONE normaliser the SDK owns is {@link panelsFromSlots}: the old slots
51
- * read as panels. It is here rather than in the app because four readers need
52
- * the same answer — the packager's compiler, plugin manifests in the wild
49
+ * The SDK owns two converters, and no other: {@link panelsFromSlots} (the old
50
+ * slots read as version 1 panels) and {@link panelsV2Of} (version 1, or the
51
+ * slots, read as version 2). They are here rather than in the app because
52
+ * four readers need the same answer — the packager's compiler, plugin manifests in the wild
53
53
  * (which ship the old slots and keep working with no manifest change), the
54
54
  * goldens, and the app's boot pass that writes `panels` onto stored rows — and
55
- * two converters would be two answers. Every other normaliser, the renderer
55
+ * two answers to one conversion would be a bug. Every other normaliser, the renderer
56
56
  * and all measurement are the app's, which reads a stored blob it did not
57
57
  * write and must repair rather than refuse. This module types the format,
58
58
  * reads the ids out of it, and checks a layout a package SHIPS
@@ -99,9 +99,11 @@ export declare function isWidgetInstanceId(id: unknown): id is string;
99
99
  * an arrangement may still carry one — all three are stored verbatim and
100
100
  * nothing rewrites them — so every reader drops it.
101
101
  *
102
- * `composer` is one because the conversation is ONE widget: the log and the
103
- * field are one thing to arrange, and the field's shape is a setting on
104
- * `messages` rather than a widget beside it.
102
+ * `composer` is NOT one: it is a widget again — the owner's R8, 2026-11-05,
103
+ * "Split the messages, composer and activity status/turn select into three
104
+ * widgets", which supersedes NOMENCLATURE §23's 2026-09-16 "composer (the
105
+ * widget) — Merged into messages". Only the ⏳ old slots still never draw
106
+ * one ({@link LEGACY_SLOT_DROPPED}).
105
107
  *
106
108
  * `inventory` is one because core's Inventory widget was removed (2026-09-25)
107
109
  * for now, with no replacement. Adventure and Lair shipped it, so layouts and
@@ -114,6 +116,24 @@ export declare function isWidgetInstanceId(id: unknown): id is string;
114
116
  * @ruling R79
115
117
  */
116
118
  export declare const RETIRED_WIDGET_IDS: ReadonlySet<string>;
119
+ /**
120
+ * ⏳ Widget ids the OLD-SLOT path drops, so a slot-era blob never revives a
121
+ * composer: before the split (2026-11-05) the field was `messages`' own, and
122
+ * a slot that names `composer` meant nothing. Read ONLY by {@link panelsFromSlots}'s
123
+ * conversion — nowhere else; a `panels` layout places `composer` freely.
124
+ * @experimental
125
+ */
126
+ export declare const LEGACY_SLOT_DROPPED: ReadonlySet<string>;
127
+ /**
128
+ * 🚧 The ids of the two widgets the conversation splits into, for a copy of
129
+ * `messages`: `messages` → `composer`, `turn-line`; `messages#x` →
130
+ * `composer#x`, `turn-line#x`. Pure.
131
+ * @experimental
132
+ */
133
+ export declare function conversationSplitIds(instanceId: string): {
134
+ composer: string;
135
+ turnLine: string;
136
+ };
117
137
  /**
118
138
  * One widget id that now reads as another widget with some settings implied
119
139
  * ({@link WIDGET_ID_ALIASES}).
@@ -370,6 +390,7 @@ export interface PanelV1 {
370
390
  /**
371
391
  * ABSENT MEANS DOCKED ({@link pinnedOf}); `false` is in the rail, and the
372
392
  * only value written. Refused on a middle panel: the middle never pins.
393
+ * @deprecated ⏳ removed at 0.7 (owner's call) — version 2 has no pin.
373
394
  */
374
395
  pinned?: false;
375
396
  /** A side or strip panel's height; absent is `fill`. */
@@ -383,6 +404,7 @@ export type PanelZoneV1 = PanelV1[];
383
404
  * The middle: the `primary` panel (it fills), with panels `above` and `below`
384
405
  * it, each top to bottom.
385
406
  * @experimental
407
+ * @deprecated ⏳ removed at 0.7 (owner's call) — version 2's middle is one list.
386
408
  */
387
409
  export interface PanelMiddleV1 {
388
410
  above: PanelV1[];
@@ -405,14 +427,103 @@ export interface PanelLayoutV1 {
405
427
  middle: PanelMiddleV1;
406
428
  right: PanelZoneV1;
407
429
  }
430
+ /**
431
+ * 🚧 How much a panel claims when a zone runs short: `low` gives way first,
432
+ * then `normal`; `high` last.
433
+ * @experimental
434
+ */
435
+ export type PanelPriority = 'high' | 'normal' | 'low';
436
+ /**
437
+ * 🚧 What a panel is backed by: a `card`, `glass` (translucent), or `none`.
438
+ * @experimental
439
+ */
440
+ export type PanelBacking = 'card' | 'glass' | 'none';
441
+ /**
442
+ * 🚧 The space between panels in a zone.
443
+ * @experimental
444
+ */
445
+ export type PanelGap = 'tight' | 'comfortable' | 'spacious';
446
+ /**
447
+ * 🚧 A {@link PanelGap} in px.
448
+ * @experimental
449
+ */
450
+ export declare const PANEL_GAP_PX: Readonly<Record<PanelGap, number>>;
451
+ /**
452
+ * 🚧 The layout's look: what backs a panel, how opaque, and the gap between
453
+ * panels.
454
+ * @experimental
455
+ */
456
+ export interface PanelLook {
457
+ backing: PanelBacking;
458
+ /** Percent, 0–100. */
459
+ opacity: number;
460
+ gap: PanelGap;
461
+ /** 🚧 What shows behind the panels: the person's own background (absent, `'background'`) or the session's backdrop. */
462
+ behind?: 'background' | 'backdrop';
463
+ /** 🚧 Percent, 0–100, darkening the backdrop behind the panels; absent is 0. */
464
+ behindDim?: number;
465
+ }
466
+ /**
467
+ * 🚧 The look a layout that states none has.
468
+ * @experimental
469
+ */
470
+ export declare const DEFAULT_PANEL_LOOK: Readonly<PanelLook>;
471
+ /**
472
+ * 🚧 A **panel** in version 2: a box in a zone that holds widgets as tabs.
473
+ * There is no pin — every panel is open.
474
+ * @experimental
475
+ */
476
+ export interface PanelV2 {
477
+ /** Stable within one layout; `p` + a counter. Never an instance id. */
478
+ key: string;
479
+ /** Widget instance ids, in tab order. */
480
+ tabs: string[];
481
+ /** The tab last shown; absent is `tabs[0]`. */
482
+ open?: string;
483
+ /** The panel's height; absent is the open tab's declaration (`WidgetDecl.panel.height`), else `fill`. */
484
+ height?: PanelHeightV1;
485
+ /**
486
+ * Absent = the open tab's widget declaration (`WidgetDecl.panel.priority`),
487
+ * else `'normal'`. When a zone runs short, `low` gives way first, then
488
+ * `normal`.
489
+ */
490
+ priority?: PanelPriority;
491
+ /** A person's name for the panel, shown only when it holds two or more tabs. */
492
+ title?: string;
493
+ }
494
+ /**
495
+ * 🚧 The `panels` slot in version 2 — the arrangement: three plain stacks of
496
+ * panels, top to bottom, no pin, and the layout's look beside them. The
497
+ * middle is never empty. `opacity` is a percent, 0–100; an absent look value
498
+ * is {@link DEFAULT_PANEL_LOOK}'s.
499
+ * @experimental
500
+ */
501
+ export interface PanelLayoutV2 {
502
+ version: 2;
503
+ left: PanelV2[];
504
+ middle: PanelV2[];
505
+ right: PanelV2[];
506
+ backing?: PanelBacking;
507
+ opacity?: number;
508
+ gap?: PanelGap;
509
+ /** 🚧 What shows behind the panels: the person's own background (absent, `'background'`) or the session's backdrop. */
510
+ behind?: 'background' | 'backdrop';
511
+ /** 🚧 Percent, 0–100, darkening the backdrop behind the panels; absent is 0. */
512
+ behindDim?: number;
513
+ }
408
514
  /**
409
515
  * The **session layout**. Every slot is optional: a layout says what it
410
516
  * arranges and nothing else.
411
517
  * @experimental
412
518
  */
413
519
  export interface SessionLayoutV1 {
414
- /** The arrangement ({@link PanelLayoutV1}). When present it is the whole truth. */
415
- panels?: PanelLayoutV1;
520
+ /**
521
+ * The arrangement. When present it is the whole truth. Version 2
522
+ * ({@link PanelLayoutV2}) is what is written; version 1
523
+ * ({@link PanelLayoutV1}) stays readable, converted on read by
524
+ * {@link panelsV2Of}.
525
+ */
526
+ panels?: PanelLayoutV1 | PanelLayoutV2;
416
527
  /** ⏳ Read only by {@link panelsFromSlots} (and its `rules`, a side's width ladder); dropped at the 0.7 squash. */
417
528
  zoneLayout?: ZoneLayoutV1;
418
529
  /** ⏳ Read only by {@link panelsFromSlots}; dropped at the 0.7 squash. */
@@ -470,22 +581,85 @@ export interface PanelsFromSlotsOptions {
470
581
  *
471
582
  * Every instance is admitted once, where the old readers drew it first —
472
583
  * middle, left, right, strips — and a copy of a retired widget never
473
- * ({@link RETIRED_WIDGET_IDS}). An aliased id ({@link WIDGET_ID_ALIASES})
584
+ * ({@link RETIRED_WIDGET_IDS}), nor of a {@link LEGACY_SLOT_DROPPED} one. An aliased id ({@link WIDGET_ID_ALIASES})
474
585
  * stays the id as placed, the key its settings and style pin live under.
475
586
  * Keys run `p1…pn` in discovery order: the primary, above, below, left, right.
476
587
  * @experimental
477
588
  */
478
589
  export declare function panelsFromSlots(layout: SessionLayoutV1, opts?: PanelsFromSlotsOptions): PanelLayoutV1;
590
+ /** What {@link panelsV2Of} may be told beyond the layout. @experimental */
591
+ export interface PanelsV2Options extends PanelsFromSlotsOptions {
592
+ /** Per-instance settings to read and plan moves over; absent = the layout's own `widgetSettings`. */
593
+ widgetSettings?: Readonly<Record<string, Readonly<Record<string, unknown>>>>;
594
+ /** Style pins (any value: a pin or a style id) keyed by instance id; absent = the layout's own `widgetStyles`. */
595
+ widgetStyles?: Readonly<Record<string, unknown>>;
596
+ }
479
597
  /**
480
- * The layout's panels: `layout.panels` when it has them — returned as
481
- * stored, the whole truth — else {@link panelsFromSlots}. What every reader
482
- * reads.
598
+ * 🚧 One setting the split of `messages` moves or drops: `{ from, to, key,
599
+ * value }` moves `key` of instance `from` onto instance `to` (the composer or
600
+ * turn line made for it); `{ drop, key }` removes `key` from instance `drop`
601
+ * (a key the widget no longer has).
483
602
  * @experimental
484
603
  */
485
- export declare function panelsOf(layout: SessionLayoutV1, opts?: PanelsFromSlotsOptions): PanelLayoutV1;
604
+ export type PanelSettingsMove = {
605
+ from: string;
606
+ to: string;
607
+ key: string;
608
+ value: unknown;
609
+ } | {
610
+ drop: string;
611
+ key: string;
612
+ };
613
+ /**
614
+ * 🚧 {@link panelsV2Of}'s answer: the panels, the settings the split moves or
615
+ * drops, and the style pins the new widgets copy.
616
+ * @experimental
617
+ */
618
+ export interface PanelsV2Conversion {
619
+ panels: PanelLayoutV2;
620
+ settingsMoves: PanelSettingsMove[];
621
+ styleCopies: Array<{
622
+ from: string;
623
+ to: string;
624
+ }>;
625
+ }
626
+ /**
627
+ * 🚧 The layout's arrangement as {@link PanelLayoutV2} — the ONE converter,
628
+ * with {@link panelsFromSlots} (old slots → version 1): every reader reuses
629
+ * it, and the app's boot pass writes its answer. Pure, deterministic, total
630
+ * and non-mutating.
631
+ *
632
+ * A stored version 2 is returned as it is (the same object), with nothing to
633
+ * move. Otherwise the source is a stored version 1, else
634
+ * {@link panelsFromSlots}; it is flattened — left, the middle as `above`,
635
+ * `primary`, `below`, right — each panel keeping `key`, `tabs`, `open`,
636
+ * `height` and `title` and dropping the pin.
637
+ *
638
+ * **The split.** Before it, the log, the field and the turn line were one
639
+ * widget. For each panel's first tab that is a copy of `messages` with its
640
+ * composer showing (`showComposer` not `false`), a turn-line panel (unless
641
+ * `nextUp` reads as `hidden`, the legacy `showNudge: false` included) and a
642
+ * composer panel — `height: 'fit'` — are inserted right after it, or before
643
+ * it when `composerPosition` is `'top'`; their ids are
644
+ * {@link conversationSplitIds}. A layout that already places a `composer`
645
+ * gets nothing. New keys continue the `p<n>` counter.
646
+ *
647
+ * `settingsMoves` lists what the split does to the stored settings (a key to
648
+ * move onto the new instance, or to drop) and `styleCopies` the style pins
649
+ * the new instances copy; the CALLER applies both. No look is written.
650
+ * @experimental
651
+ */
652
+ export declare function panelsV2Of(layout: SessionLayoutV1, opts?: PanelsV2Options): PanelsV2Conversion;
653
+ /**
654
+ * The layout's panels as version 2: {@link panelsV2Of}'s `panels` — a stored
655
+ * version 2 as it is, anything else converted. What every reader reads.
656
+ * ⚠ Its return type changed with version 2 (was {@link PanelLayoutV1}).
657
+ * @experimental
658
+ */
659
+ export declare function panelsOf(layout: SessionLayoutV1, opts?: PanelsV2Options): PanelLayoutV2;
486
660
  /**
487
661
  * Every widget instance id the layout NAMES, each once: its panels' tabs in
488
- * reading order — and, while it has no `panels`, then whatever the ⏳ old
662
+ * reading order (middle, left, right) — and, while it has no `panels`, then whatever the ⏳ old
489
663
  * slots name that the conversion did not keep (a retired widget, an entry an
490
664
  * arrangement shadows). What a check reads when the question is "does this
491
665
  * layout mention it at all" (a genre's omitted widgets). The floor's
@@ -494,8 +668,8 @@ export declare function panelsOf(layout: SessionLayoutV1, opts?: PanelsFromSlots
494
668
  */
495
669
  export declare function layoutWidgetIds(layout: SessionLayoutV1): string[];
496
670
  /**
497
- * The widget instance ids the MIDDLE's panels hold — above, the primary,
498
- * below — each once. The floor's conversation is not held.
671
+ * The widget instance ids the MIDDLE's panels hold, top to bottom, each
672
+ * once. The floor's conversation is not held.
499
673
  * @experimental
500
674
  */
501
675
  export declare function middleWidgetIds(layout: SessionLayoutV1): string[];
@@ -505,6 +679,7 @@ export declare function middleWidgetIds(layout: SessionLayoutV1): string[];
505
679
  * then refines a `rail`: pinned (absent or `true`) stays a docked rail, and
506
680
  * `pinned: false` is an icon strip. A strip is a `row` unless a rule hides it.
507
681
  * @experimental
682
+ * @deprecated ⏳ removed at 0.7 (owner's call) — {@link resolveDrawn} no longer walks a ladder.
508
683
  */
509
684
  export interface ZoneRung {
510
685
  mode: NonNullable<LayoutZoneRule['mode']>;
@@ -524,9 +699,14 @@ export interface ZoneRung {
524
699
  * the stage's 696px measure fit a 1216px session box (a 1280 window):
525
700
  * 248 + 248 + 2×8 + 696 = 1208. At 264 they needed 1240 and both sides tucked.
526
701
  * @experimental
702
+ * @deprecated ⏳ removed at 0.7 (owner's call) — no reader walks a width ladder now.
527
703
  */
528
704
  export declare const DEFAULT_SIDE_RULES: Readonly<Record<'left' | 'right', readonly LayoutZoneRule[]>>;
529
- /** The width ladder a strip walks when it declares none: always a row. @experimental */
705
+ /**
706
+ * The width ladder a strip walks when it declares none: always a row.
707
+ * @experimental
708
+ * @deprecated ⏳ removed at 0.7 (owner's call) — no reader walks a width ladder now.
709
+ */
530
710
  export declare const DEFAULT_STRIP_RULES: readonly LayoutZoneRule[];
531
711
  /**
532
712
  * A zone's width ladder at `inline` px — its own `rules`, else the default
@@ -535,6 +715,7 @@ export declare const DEFAULT_STRIP_RULES: readonly LayoutZoneRule[];
535
715
  * describes. The one walk: the page's rails, the editor's simulator and
536
716
  * {@link resolveDrawn} all read a ladder through it.
537
717
  * @experimental
718
+ * @deprecated ⏳ removed at 0.7 (owner's call) — {@link resolveDrawn} no longer walks a ladder.
538
719
  */
539
720
  export declare function zoneRungAt(def: LayoutZoneDef, inline: number): ZoneRung;
540
721
  /**
@@ -548,6 +729,7 @@ export declare function zoneRungAt(def: LayoutZoneDef, inline: number): ZoneRung
548
729
  * envelope's `layout.v1.pinned`, which a host tells a widget about its own
549
730
  * box.
550
731
  * @experimental
732
+ * @deprecated ⏳ removed at 0.7 (owner's call) — version 2 has no pin; still read by {@link panelsFromSlots}.
551
733
  */
552
734
  export declare function pinnedOf(placement: {
553
735
  pinned?: unknown;
@@ -568,7 +750,10 @@ export interface DrawnInstance {
568
750
  * its stored settings and style pin live under.
569
751
  */
570
752
  impliedSettings?: Readonly<Record<string, unknown>>;
571
- /** Its panel's pin, by the one rule ({@link pinnedOf}). Every instance has exactly one. */
753
+ /**
754
+ * Always `true`: version 2 has no pin.
755
+ * @deprecated ⏳ removed at 0.7 (owner's call)
756
+ */
572
757
  pinned: boolean;
573
758
  }
574
759
  /**
@@ -576,23 +761,36 @@ export interface DrawnInstance {
576
761
  * @experimental
577
762
  */
578
763
  export interface DrawnPanel {
579
- /** The panel's key ({@link PanelV1.key}). */
764
+ /** The panel's key ({@link PanelV2.key}). */
580
765
  key: string;
581
- /** Its tabs, in order: what it draws. Never empty, except a stored primary whose every tab is retired. */
766
+ /** Its tabs, in order: what it draws. Never empty, except the floor's. */
582
767
  tabs: DrawnInstance[];
583
768
  /** The instance id of the tab shown: its `open` when that is one of its tabs, else the first. */
584
769
  open: string;
585
- /** Docked (`true`) or in the rail, by the one rule ({@link pinnedOf}). A middle panel is always docked. */
770
+ /**
771
+ * Always `true`: version 2 has no pin.
772
+ * @deprecated ⏳ removed at 0.7 (owner's call)
773
+ */
586
774
  pinned: boolean;
587
- /** Its height; absent or unreadable is `fill`. */
775
+ /**
776
+ * Its height: the stored one when readable, else the open tab's
777
+ * declaration (`WidgetDecl.panel.height`), else `fill`.
778
+ */
588
779
  height: PanelHeightV1;
780
+ /**
781
+ * 🚧 Its priority: the stored one when valid, else the open tab's
782
+ * declaration (`WidgetDecl.panel.priority`), else `'normal'`. When a zone
783
+ * runs short, `low` gives way first, then `normal`.
784
+ */
785
+ priority: PanelPriority;
589
786
  /** A person's name for it, when it has one. */
590
787
  title?: string;
591
788
  /**
592
789
  * The converter's floor: the layout placed no conversation in its middle
593
790
  * (and no `panels`), so the primary is `messages` by
594
- * {@link panelsFromSlots}'s rule. A renderer draws it; the id readers do
595
- * not count it — the layout did not place it.
791
+ * {@link panelsFromSlots}'s rule — and the turn line and composer made for
792
+ * it are floor panels too. A renderer draws it; the id readers do not
793
+ * count it — the layout did not place it.
596
794
  */
597
795
  floor?: true;
598
796
  }
@@ -606,33 +804,30 @@ export interface DrawnZone {
606
804
  /** A side zone's edge. */
607
805
  side?: 'left' | 'right';
608
806
  /**
609
- * ⏳ A side: the key of the first `zoneLayout` zone drawn on it — whose
610
- * width `rules` are the side's ladder — or null when the layout declares
611
- * none there.
807
+ * No longer set: the key of the first `zoneLayout` zone drawn on a side.
808
+ * @deprecated ⏳ removed at 0.7 (owner's call)
612
809
  */
613
810
  zoneKey?: string | null;
614
811
  /**
615
- * A side: docked when any of its panels is — a side whose every panel is
616
- * in the rail takes rail width ({@link zoneRungAt}'s `icons`). With no
617
- * panels, its ⏳ `zoneLayout` zone's pin (true when it declares none). The
618
- * middle is always pinned.
812
+ * Always `true`: version 2 has no pin.
813
+ * @deprecated ⏳ removed at 0.7 (owner's call)
619
814
  */
620
815
  pinned: boolean;
621
816
  /**
622
- * A side: its width ladder at the box's inline size ({@link zoneRungAt};
623
- * the first zone's rules, else the side's default ladder), refined by the
624
- * side's `pinned`.
817
+ * No longer set: a side's width ladder at the box's inline size.
818
+ * @deprecated ⏳ removed at 0.7 (owner's call)
625
819
  */
626
820
  rung?: ZoneRung;
627
- /** Its panels in reading order (the middle: above, the primary, below). */
821
+ /** Its panels in reading order, top to bottom. */
628
822
  panels: DrawnPanel[];
629
823
  /** Every tab of its panels, in reading order — the floor's left out. */
630
824
  instances: DrawnInstance[];
631
825
  }
632
826
  /**
633
- * The middle as a layout draws it: a zone whose panels are `above`, the
634
- * `primary` and `below`.
827
+ * The middle as version 1's layout drew it: a zone whose panels are `above`,
828
+ * the `primary` and `below`. {@link resolveDrawn} no longer answers one.
635
829
  * @experimental
830
+ * @deprecated ⏳ removed at 0.7 (owner's call) — the middle is a {@link DrawnZone} now.
636
831
  */
637
832
  export interface DrawnMiddle extends DrawnZone {
638
833
  zone: 'middle';
@@ -649,40 +844,46 @@ export interface DrawnMiddle extends DrawnZone {
649
844
  */
650
845
  export interface DrawnLayout {
651
846
  left: DrawnZone;
652
- middle: DrawnMiddle;
847
+ middle: DrawnZone;
653
848
  right: DrawnZone;
849
+ /** 🚧 The layout's look, read: a stored version 2's, else {@link DEFAULT_PANEL_LOOK}'s; `gapPx` is the gap in px. */
850
+ look: Required<PanelLook> & {
851
+ gapPx: number;
852
+ };
853
+ }
854
+ /** What {@link resolveDrawn} may be told beyond the layout. @experimental */
855
+ export interface ResolveDrawnOptions {
856
+ /** Widget declarations by the id the layout names them — for a panel's default priority and height. */
857
+ widgets?: readonly Pick<WidgetDecl, 'id' | 'panel'>[];
654
858
  }
655
859
  /**
656
- * What a session layout draws at a session box of `box.inline` px: per zone,
657
- * its panels in reading order, each with its tabs, the tab shown, one pin and
658
- * a height. Pure and total — any value reads; what it cannot read places
659
- * nothing.
660
- *
661
- * It reads {@link panelsOf}: the layout's `panels`, else the ⏳ old slots
662
- * through {@link panelsFromSlots}. A tab that is a copy of a retired widget
663
- * ({@link RETIRED_WIDGET_IDS}) is not drawn, a panel left with no tab is not
664
- * drawn (the primary always is), and an instance is drawn once, in its first
665
- * panel in reading order — the middle (above, primary, below), left, right.
666
- * An aliased id ({@link WIDGET_ID_ALIASES}) is drawn as the widget it became,
667
- * under the id it was placed by, with the settings it implies.
860
+ * What a session layout draws: per zone, its panels top to bottom, each with
861
+ * its tabs, the tab shown, a height and a priority — and the layout's look.
862
+ * Pure and total — any value reads; what it cannot read places nothing.
668
863
  *
669
- * A side's `rung` is its width ladder: the first `zoneLayout` zone's `rules`
670
- * there, else the default ladder for the side ({@link zoneRungAt}), its
671
- * `rail` refined by the side's pin — an icon strip when every panel is in the
672
- * rail.
864
+ * It reads {@link panelsOf}: the layout's `panels` (version 1 converted), else
865
+ * the ⏳ old slots through {@link panelsFromSlots}. A tab that is a copy of a
866
+ * retired widget ({@link RETIRED_WIDGET_IDS}) is not drawn, a panel left with
867
+ * no tab is not drawn, and an instance is drawn once, in its first panel in
868
+ * reading order — middle, left, right. An aliased id
869
+ * ({@link WIDGET_ID_ALIASES}) is drawn as the widget it became, under the id
870
+ * it was placed by, with the settings it implies.
673
871
  *
674
- * The box's `block` size is not read today: no rung is a height.
872
+ * A panel's `height` is its stored one, else its open tab's declaration
873
+ * (`opts.widgets`, `panel.height`), else `fill`; its `priority` likewise
874
+ * (`panel.priority`, else `'normal'`). There is no pin: every `pinned` is
875
+ * `true`, and no width ladder is walked, so `box` is not read.
675
876
  * @experimental
676
877
  */
677
878
  export declare function resolveDrawn(layout: SessionLayoutV1, box: {
678
879
  inline: number;
679
880
  block?: number;
680
- }): DrawnLayout;
881
+ }, opts?: ResolveDrawnOptions): DrawnLayout;
681
882
  /** Every instance a drawn layout draws, in its reading order: middle, left, right — the floor's left out. @experimental */
682
883
  export declare function drawnInstances(drawn: DrawnLayout): DrawnInstance[];
683
884
  /**
684
- * Every widget instance id the layout DRAWS, in reading order — the middle
685
- * (above, primary, below), left, right: {@link resolveDrawn}'s answer as ids.
885
+ * Every widget instance id the layout DRAWS, in reading order — the middle,
886
+ * left, right: {@link resolveDrawn}'s answer as ids.
686
887
  * A retired widget is never drawn, and the floor's conversation is not the
687
888
  * layout's.
688
889
  * @experimental
@@ -728,12 +929,18 @@ export interface SessionLayoutValidationOptions {
728
929
  * the verdict lists every problem rather than the first.
729
930
  *
730
931
  * **Errors** (the layout is refused):
731
- * - `panels` of the wrong shape: `{ version: 1, left, middle: { above,
732
- * primary, below }, right }`; a panel with a key no other panel has, at
733
- * least one tab (the primary included), `open` one of its tabs, `height`
734
- * `fit`, `fill` or `{ share }` (an integer 1–12), and `pinned` absent or
735
- * `false` — refused on a middle panel, which never pins; an instance id
736
- * in two panels, or twice in one;
932
+ * - `panels` of the wrong shape: `{ version: 2, left, middle, right,
933
+ * backing?, opacity?, gap? }`, each zone a list of panels top to bottom
934
+ * and the middle never empty; version 1's `{ version: 1, left, middle: {
935
+ * above, primary, below }, right }` is still checked (and warned about);
936
+ * any other version is refused. A panel has a key no other panel has, at
937
+ * least one tab, `open` one of its tabs, `height` `fit`, `fill` or `{ share }`
938
+ * (an integer 1–12); in version 2 `priority` is `high`, `normal` or `low`
939
+ * and `pinned` is refused (there is no pin), `backing` is `card`, `glass`
940
+ * or `none`, `opacity` a number from 0 to 100, `gap` `tight`,
941
+ * `comfortable` or `spacious`, `behind` `background` or `backdrop`,
942
+ * `behindDim` a number from 0 to 100; in version 1 `pinned` is absent or `false`,
943
+ * refused on a middle panel. An instance id in two panels, or twice in one;
737
944
  * - an ⏳ old slot of the wrong shape: `zoneLayout` and `widgetGrid` are `version: 1`;
738
945
  * a grid entry and an arrangement name a zone, `left`, `middle` or
739
946
  * `right`; a `zoneLayout` zone is keyed by where the page draws it — a
@@ -753,6 +960,10 @@ export interface SessionLayoutValidationOptions {
753
960
  *
754
961
  * **Warnings** (the layout draws, not as written):
755
962
  * - a key that is not a slot (readers ignore it) and a retired widget;
963
+ * - `panels-v1:` — version 1 panels are converted on read ({@link panelsV2Of});
964
+ * ship version 2;
965
+ * - in the old slots, a placed copy of a {@link LEGACY_SLOT_DROPPED} widget (a
966
+ * slot-era composer): the slots never draw it;
756
967
  * - `panels` that place no copy of the conversation: the session draws one
757
968
  * by the primary floor — unless the genre withholds it, which the genre's
758
969
  * own checks judge (a layout carries no roles);