@serene-pub/sdk 0.6.0-pr-4 → 0.6.0-pr-5

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 (186) hide show
  1. package/README.md +23 -19
  2. package/dist/actions.d.ts +149 -67
  3. package/dist/actions.js +89 -35
  4. package/dist/annexFields.d.ts +8 -4
  5. package/dist/annexFields.js +5 -2
  6. package/dist/announce.d.ts +78 -28
  7. package/dist/announce.js +14 -5
  8. package/dist/attributes.d.ts +9 -6
  9. package/dist/attributes.js +9 -5
  10. package/dist/bands.d.ts +41 -6
  11. package/dist/bands.js +83 -33
  12. package/dist/builder.d.ts +161 -58
  13. package/dist/builder.js +128 -22
  14. package/dist/candidates.d.ts +5 -3
  15. package/dist/candidates.js +3 -2
  16. package/dist/clauses.d.ts +2 -1
  17. package/dist/clauses.js +2 -1
  18. package/dist/component.d.ts +24 -7
  19. package/dist/component.js +16 -6
  20. package/dist/componentBuild.d.ts +16 -5
  21. package/dist/componentBuild.js +14 -5
  22. package/dist/componentClient.d.ts +61 -30
  23. package/dist/componentClient.js +11 -1
  24. package/dist/componentImports.d.ts +8 -5
  25. package/dist/componentImports.js +23 -4
  26. package/dist/componentModule.js +2 -1
  27. package/dist/componentWire.d.ts +2 -1
  28. package/dist/componentWire.js +34 -2
  29. package/dist/config.d.ts +28 -14
  30. package/dist/config.js +20 -10
  31. package/dist/connections.d.ts +9 -4
  32. package/dist/connections.js +7 -4
  33. package/dist/declarations.d.ts +46 -17
  34. package/dist/declarations.js +46 -15
  35. package/dist/descriptors.d.ts +242 -97
  36. package/dist/descriptors.js +145 -41
  37. package/dist/dev.d.ts +6 -5
  38. package/dist/dev.js +6 -5
  39. package/dist/document.d.ts +74 -25
  40. package/dist/document.js +32 -11
  41. package/dist/dowry.d.ts +241 -0
  42. package/dist/dowry.js +315 -0
  43. package/dist/engines.d.ts +16 -7
  44. package/dist/engines.js +6 -4
  45. package/dist/eventMapLaws.d.ts +19 -8
  46. package/dist/eventMapLaws.js +9 -6
  47. package/dist/events.d.ts +101 -39
  48. package/dist/events.js +106 -33
  49. package/dist/executor.d.ts +122 -41
  50. package/dist/executor.js +188 -95
  51. package/dist/extension.d.ts +99 -35
  52. package/dist/extension.js +43 -9
  53. package/dist/facets.d.ts +2 -1
  54. package/dist/facets.js +4 -2
  55. package/dist/foldedSections.d.ts +4 -2
  56. package/dist/foldedSections.js +2 -1
  57. package/dist/genres.d.ts +123 -41
  58. package/dist/genres.js +127 -22
  59. package/dist/guardedConnection.d.ts +4 -3
  60. package/dist/guardedConnection.js +4 -3
  61. package/dist/handlebarsReach.d.ts +1 -1
  62. package/dist/handlebarsReach.js +1 -1
  63. package/dist/hash.d.ts +16 -5
  64. package/dist/hash.js +14 -4
  65. package/dist/hookGrants.d.ts +3 -2
  66. package/dist/hookGrants.js +6 -4
  67. package/dist/hooks.d.ts +21 -16
  68. package/dist/hooks.js +12 -10
  69. package/dist/hostElements.d.ts +41 -17
  70. package/dist/hostElements.js +49 -17
  71. package/dist/i18n.d.ts +5 -3
  72. package/dist/i18n.js +5 -3
  73. package/dist/identity.d.ts +4 -3
  74. package/dist/identity.js +4 -3
  75. package/dist/index.d.ts +5 -0
  76. package/dist/index.js +15 -0
  77. package/dist/layout.d.ts +36 -15
  78. package/dist/layout.js +2 -2
  79. package/dist/loadouts.d.ts +97 -0
  80. package/dist/loadouts.js +81 -0
  81. package/dist/media.d.ts +26 -4
  82. package/dist/media.js +2 -1
  83. package/dist/messageBlocks.d.ts +44 -32
  84. package/dist/messageBlocks.js +23 -18
  85. package/dist/migration.d.ts +16 -8
  86. package/dist/migration.js +14 -8
  87. package/dist/names.d.ts +2 -1
  88. package/dist/names.js +2 -1
  89. package/dist/nodeInput.d.ts +2 -1
  90. package/dist/nodeInput.js +2 -1
  91. package/dist/participants.d.ts +22 -15
  92. package/dist/participants.js +14 -12
  93. package/dist/personGate.d.ts +2 -1
  94. package/dist/personGate.js +2 -1
  95. package/dist/pluginHarness.d.ts +8 -3
  96. package/dist/pluginHarness.js +4 -2
  97. package/dist/pluginPermissions.d.ts +2 -1
  98. package/dist/pluginPermissions.js +12 -1
  99. package/dist/pluginRuleRef.d.ts +2 -2
  100. package/dist/pluginRuleRef.js +1 -1
  101. package/dist/predicates.d.ts +16 -11
  102. package/dist/predicates.js +7 -6
  103. package/dist/preview.d.ts +8 -3
  104. package/dist/preview.js +2 -1
  105. package/dist/promptBlocks.d.ts +5 -3
  106. package/dist/promptBlocks.js +5 -3
  107. package/dist/rankingDecisions.d.ts +2 -1
  108. package/dist/rankingDecisions.js +2 -1
  109. package/dist/receipt.d.ts +65 -29
  110. package/dist/receipt.js +9 -4
  111. package/dist/receiverRules.js +3 -2
  112. package/dist/refs.d.ts +34 -9
  113. package/dist/refs.js +33 -13
  114. package/dist/registry.d.ts +42 -23
  115. package/dist/registry.js +7 -5
  116. package/dist/review.d.ts +16 -5
  117. package/dist/review.js +11 -4
  118. package/dist/sampling.d.ts +54 -0
  119. package/dist/sampling.js +95 -3
  120. package/dist/sceneSettings.d.ts +312 -0
  121. package/dist/sceneSettings.js +425 -0
  122. package/dist/scope.d.ts +6 -4
  123. package/dist/scope.js +4 -3
  124. package/dist/scripts.d.ts +81 -14
  125. package/dist/scripts.js +90 -11
  126. package/dist/sessionDossier.d.ts +521 -0
  127. package/dist/sessionDossier.js +33 -0
  128. package/dist/sessionLayout.d.ts +303 -19
  129. package/dist/sessionLayout.js +354 -40
  130. package/dist/sessionSettings.d.ts +8 -5
  131. package/dist/settings.d.ts +45 -20
  132. package/dist/settings.js +19 -12
  133. package/dist/settingsSlot.d.ts +11 -8
  134. package/dist/settingsSlot.js +11 -8
  135. package/dist/shapes.d.ts +99 -36
  136. package/dist/shapes.js +101 -35
  137. package/dist/sheets.d.ts +4 -2
  138. package/dist/sheets.js +6 -3
  139. package/dist/statShapes.d.ts +2 -1
  140. package/dist/statShapes.js +2 -1
  141. package/dist/status.d.ts +13 -9
  142. package/dist/status.js +8 -6
  143. package/dist/storage.d.ts +2 -1
  144. package/dist/storage.js +2 -1
  145. package/dist/storyTime.d.ts +13 -7
  146. package/dist/storyTime.js +11 -6
  147. package/dist/strokes.d.ts +176 -0
  148. package/dist/strokes.js +281 -0
  149. package/dist/surfaces.d.ts +54 -25
  150. package/dist/surfaces.js +3 -3
  151. package/dist/template.d.ts +9 -5
  152. package/dist/template.js +5 -3
  153. package/dist/templateCheck.d.ts +2 -2
  154. package/dist/templateCheck.js +2 -2
  155. package/dist/templateFit.d.ts +37 -8
  156. package/dist/templateFit.js +92 -8
  157. package/dist/templateIds.d.ts +3 -3
  158. package/dist/templateIds.js +3 -3
  159. package/dist/templateScopeAt.d.ts +21 -11
  160. package/dist/templateScopeAt.js +21 -11
  161. package/dist/testing.d.ts +11 -4
  162. package/dist/testing.js +13 -5
  163. package/dist/tokenizers.d.ts +2 -2
  164. package/dist/tokenizers.js +2 -2
  165. package/dist/turnLock.d.ts +4 -2
  166. package/dist/turnLock.js +2 -1
  167. package/dist/turnOrder.d.ts +17 -11
  168. package/dist/turnOrder.js +9 -5
  169. package/dist/validate.d.ts +11 -8
  170. package/dist/validate.js +81 -10
  171. package/dist/values.d.ts +17 -8
  172. package/dist/values.js +11 -6
  173. package/dist/variables.d.ts +46 -7
  174. package/dist/variables.js +87 -6
  175. package/dist/verdicts.d.ts +20 -13
  176. package/dist/verdicts.js +17 -11
  177. package/dist/widgetDecls.d.ts +8 -4
  178. package/dist/widgetDecls.js +4 -2
  179. package/dist/widgets.d.ts +987 -94
  180. package/dist/widgets.js +93 -18
  181. package/dist/wire.d.ts +13 -6
  182. package/dist/wire.js +3 -3
  183. package/dist/worldinfo.d.ts +11 -6
  184. package/dist/worldinfo.js +8 -4
  185. package/host-elements.d.ts +13 -0
  186. package/package.json +1 -1
package/dist/widgets.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * The widget data contract — ONE envelope every session widget receives,
3
- * native and frame alike (PLAN 25, ruled 2026-08-30).
3
+ * native and frame alike.
4
4
  *
5
5
  * A native widget reads these sections through the host's in-document context
6
6
  * (live, reactive); a frame receives the same sections snapshotted over its
@@ -17,7 +17,7 @@
17
17
  * ## Two version clocks
18
18
  *
19
19
  * - `WIDGET_PROTOCOL` versions the TRANSPORT — the verbs (`action` / `invoke`
20
- * / `request` / `menu` / `on`) and the message kinds. Rev only when the wire
20
+ * / `request` / `on`, and the retired ⏳ `menu`) and the message kinds. Rev only when the wire
21
21
  * itself changes.
22
22
  * - Each DATA section is a bag of versioned shapes (`layout: { v1 }`, …). When
23
23
  * a pre-existing key inside a section changes meaning, emit `v2` alongside
@@ -28,9 +28,9 @@
28
28
  *
29
29
  * Base sections ({@link WIDGET_BASE_SECTIONS}: layout / session / channels /
30
30
  * messages / props / actions / settings / annex / locale / viewer /
31
- * turnOrder) are delivered to every widget that READS them (R75,
32
- * `WidgetDecl.reads`; a declaration without `reads` reads all of them, which
33
- * is every widget written before R75). Scoped sections
31
+ * turnOrder / attendance) are delivered to every widget that READS them
32
+ * (`WidgetDecl.reads`; a declaration without `reads` reads all of them, which
33
+ * is every widget written before `reads` existed). Scoped sections
34
34
  * ({@link WidgetScopedSections}, the one table) appear ONLY when the widget
35
35
  * declared the scope AND it was granted — the same deny-by-default a frame
36
36
  * gets, applied at projection so a native widget is no more privileged.
@@ -38,12 +38,16 @@
38
38
  * which of the two, the host says with `grants` (the scopes the widget
39
39
  * holds, on mount and on every change), so a widget draws "not granted"
40
40
  * rather than loading forever.
41
+ * @ruling PLAN 25 (ruled 2026-08-30), R75
41
42
  */
42
43
  import type { TurnOrderV1 } from './turnOrder.js';
44
+ import type { SessionDossierV1 } from './sessionDossier.js';
43
45
  import type { SlotAppliesTo, SlotType, SlotValue } from './attributes.js';
44
46
  import type { FieldDecl } from './settings.js';
45
47
  import type { StatusText, WidgetActionReason } from './status.js';
46
48
  import type { EnabledWhen } from './predicates.js';
49
+ import type { StoryTime, StoryTimeUnit } from './storyTime.js';
50
+ import type { SceneSummaryMode } from './sceneSettings.js';
47
51
  /** Free-form data riding beside a verb or an event. Keys are the sender's. @experimental */
48
52
  export type WidgetPayload = Record<string, unknown>;
49
53
  /**
@@ -138,6 +142,24 @@ export interface LayoutV1 {
138
142
  export interface SessionV1 {
139
143
  id: number;
140
144
  name: string | null;
145
+ /**
146
+ * 🚧 The session's **backdrop** — the picture the Backdrop widget shows
147
+ * (`sessions.backdropMediaId`), or null when none is set. Absent from a
148
+ * host that does not know the field yet; read absent as null.
149
+ * @ruling DESIGN-image-generation §6.4, §9.4
150
+ */
151
+ backdrop?: SessionBackdropV1 | null;
152
+ }
153
+ /**
154
+ * 🚧 A session's **backdrop** as a widget sees it: its file id and the
155
+ * address of its `fitted` representation (the whole picture, long edge
156
+ * ≤ 1568 px), resolved by the host. ⚠ Not the app background, not a message
157
+ * attachment.
158
+ * @experimental
159
+ */
160
+ export interface SessionBackdropV1 {
161
+ mediaId: number;
162
+ src: string;
141
163
  }
142
164
  /**
143
165
  * @experimental One message as a widget sees it (🚧 `parts`).
@@ -205,6 +227,19 @@ export interface MessageV1 {
205
227
  createdAt?: string;
206
228
  /** When the row last changed — a timestamp, as a string on the wire. */
207
229
  updatedAt?: string;
230
+ /**
231
+ * 🚧 The **story clock stamp**: the session's story now as it stood when
232
+ * the row was written (its own clock, else its line's present), as the
233
+ * five stored columns. All null or absent on a row written before stamps,
234
+ * or in a session with no dated story. What the conversation's **day
235
+ * marks** read.
236
+ * @ruling PROPOSAL-live-scenes §6, §8
237
+ */
238
+ storyClockYear?: number | null;
239
+ storyClockMonth?: number | null;
240
+ storyClockDay?: number | null;
241
+ storyClockHour?: number | null;
242
+ storyClockMinute?: number | null;
208
243
  /** A person has edited this row's text. */
209
244
  isEdited?: boolean;
210
245
  /** The host is not showing this row. */
@@ -218,9 +253,10 @@ export interface MessageV1 {
218
253
  */
219
254
  generationOutcome?: string | null;
220
255
  /**
221
- * What the run filling this row is doing right now (R-19) — *{speaker} is
256
+ * What the run filling this row is doing right now — *{speaker} is
222
257
  * typing* — as display text with its variables filled, NOT a string:
223
258
  * resolve it with `renderStatusText`. Null or absent when nothing runs.
259
+ * @ruling R-19
224
260
  */
225
261
  generationStatus?: StatusText | null;
226
262
  /** Why the last run on this row failed, when it did — shown in place of text. */
@@ -309,7 +345,7 @@ export interface MessagePartV1 {
309
345
  /**
310
346
  * @experimental 🚧 A **folded section**: a named piece of a reply shown
311
347
  * collapsed beside its body, never as the body — a narrator's Plan (beats and
312
- * speakers, as a list), a step's notes (B4; decision D5, 2026-09-27). What the
348
+ * speakers, as a list), a step's notes. What the
313
349
  * `sections` in-port of `core:outlet/create-message@1` and
314
350
  * `core:outlet/update-message@1` takes, as a list, and what the host stores per
315
351
  * swipe and serves to widgets as a `core:section` part.
@@ -321,6 +357,7 @@ export interface MessagePartV1 {
321
357
  * ⚠ Not a layout **fold** (a unit or zone giving way at a size), and not the
322
358
  * model's reasoning trace — that is the `reasoning` in-port, stored as a
323
359
  * `core:reasoning` part.
360
+ * @ruling B4, decision D5 (2026-09-27)
324
361
  */
325
362
  export interface FoldedSectionV1 {
326
363
  /**
@@ -397,10 +434,60 @@ export interface ViewerV1 {
397
434
  isGuest: boolean;
398
435
  }
399
436
  /**
400
- * One action as a venue lists it (plans/29 R-15) — transport-neutral here so a
437
+ * One person in the session's **attendance**: the session's owner or
438
+ * one of its guests — an account, never a cast member — whether they have
439
+ * the session open now, as whom they write, and whether they are typing.
440
+ *
441
+ * Not a cast **presence** (a cast member's dated span in the world): this is
442
+ * who has the session open, and nothing about the fiction.
443
+ * @experimental
444
+ * @ruling W10
445
+ */
446
+ export interface AttendeeV1 {
447
+ userId: number;
448
+ /** The account's display name (its username when it has none). */
449
+ name: string;
450
+ /** The session's owner, or a guest the owner added. */
451
+ role: 'owner' | 'guest';
452
+ /**
453
+ * The personas this person writes as in this session — `character:<id>`,
454
+ * the grammar of `characters.v1` refs, so a widget granted `characters`
455
+ * finds their faces. Empty when they write as none.
456
+ */
457
+ personaRefs: `character:${number}`[];
458
+ /** One of their personas pinged *typing* within the last few seconds. */
459
+ typing: boolean;
460
+ /**
461
+ * When they last had the session open (ms since the epoch): now, while
462
+ * they do; null when the server has not seen them since it started.
463
+ */
464
+ lastSeenAt: number | null;
465
+ /** They have the session open now — in any tab. */
466
+ here: boolean;
467
+ }
468
+ /**
469
+ * The session's **attendance** (`attendance.v1`): its owner and guests,
470
+ * owner first, each with whether they have the session open now. A base
471
+ * section — who is in the room is something every widget may know.
472
+ * @experimental
473
+ * @ruling W10
474
+ */
475
+ export interface AttendanceV1 {
476
+ v: 1;
477
+ people: AttendeeV1[];
478
+ }
479
+ /**
480
+ * The attendance before the host's first push — and what a reader answers
481
+ * for a section it was not sent. Frozen.
482
+ * @experimental
483
+ */
484
+ export declare const EMPTY_ATTENDANCE: AttendanceV1;
485
+ /**
486
+ * One action as a venue lists it — transport-neutral here so a
401
487
  * frame and a native widget read the same rows. `specSlug` is `core` for one
402
488
  * of core's own message verbs.
403
489
  * @experimental
490
+ * @ruling plans/29 R-15
404
491
  */
405
492
  export interface WidgetAction {
406
493
  key: string;
@@ -429,11 +516,12 @@ export interface WidgetAction {
429
516
  itemGated: boolean;
430
517
  isNew: boolean;
431
518
  /**
432
- * The enabled-when verdict (U5e), beside `canAct` — both shown, neither
519
+ * The enabled-when verdict, beside `canAct` — both shown, neither
433
520
  * hides the action: every predicate the host could judge over the
434
521
  * session's published values holds. The `item.*` ones are not among
435
522
  * them (`itemPredicates`). The host always sends it; absent (a fixture,
436
- * a host before U5e) reads as enabled.
523
+ * a host older than this field) reads as enabled.
524
+ * @ruling U5e
437
525
  */
438
526
  enabled?: boolean;
439
527
  /** Why it is grey when `enabled` is false — resolve with `renderStatusText`. */
@@ -447,12 +535,13 @@ export interface WidgetAction {
447
535
  }
448
536
  /**
449
537
  * The session's actions per **venue**, each a primary set plus an overflow
450
- * that lists every enabled action (F38). Keyed by venue kind (`composer`,
538
+ * that lists every enabled action. Keyed by venue kind (`composer`,
451
539
  * `message`, `extra`, `widget`, …); a widget reads the venues it draws —
452
540
  * `widget` for its own controls, `message` when it renders a message's menu —
453
541
  * and fires one through `invoke(key)`. Empty venues when the host has no list
454
542
  * yet.
455
543
  * @experimental
544
+ * @ruling F38
456
545
  */
457
546
  export type ActionsV1 = Record<string, {
458
547
  primary: WidgetAction[];
@@ -460,15 +549,16 @@ export type ActionsV1 = Record<string, {
460
549
  }>;
461
550
  /** The transport-neutral data half — the versioned sections. */
462
551
  /**
463
- * What this viewer may see of the session annex (R57): per owner, the values
552
+ * What this viewer may see of the session annex: per owner, the values
464
553
  * whose audience holds for them — never the annex itself. A value stored for
465
554
  * pipelines only is never here.
466
555
  * @experimental
556
+ * @ruling R57
467
557
  */
468
558
  export type AnnexV1 = Record<string, Record<string, unknown>>;
469
559
  /**
470
560
  * 🚧 The session's stats and states, as a widget reads them —
471
- * `session_state.v1` (R72: a SCOPED section, scope `session:state`, which a
561
+ * `session_state.v1` (a SCOPED section, scope `session:state`, which a
472
562
  * plugin's widget is granted as `widget:session:state`, reviewed like
473
563
  * `session:full`). The viewer's view of the one resolved read (`state:get`):
474
564
  * what every member of the session reads today, until state gets per-viewer
@@ -477,6 +567,7 @@ export type AnnexV1 = Record<string, Record<string, unknown>>;
477
567
  * `resolved`, never `state`: `state` on a component's context is the view
478
568
  * state it saved.
479
569
  * @experimental
570
+ * @ruling R72
480
571
  */
481
572
  export interface SessionStateV1 {
482
573
  /** The session this answers for. */
@@ -486,7 +577,8 @@ export interface SessionStateV1 {
486
577
  /**
487
578
  * Why the last READ failed, in words; null when it did not. A write a
488
579
  * widget asked for fails as that request's own rejection — errors are
489
- * per widget (R77), never one line every state widget shows.
580
+ * per widget, never one line every state widget shows.
581
+ * @ruling R77
490
582
  */
491
583
  error: string | null;
492
584
  /** The values, resolved: what a template reads as `state`. */
@@ -513,7 +605,10 @@ export interface SessionResolvedStateV1 {
513
605
  * that predates locations holding state.
514
606
  */
515
607
  locations?: Record<string, Record<string, unknown>>;
516
- /** The session's state version (U5f): moved by every applied change. */
608
+ /**
609
+ * The session's state version: moved by every applied change.
610
+ * @ruling U5f
611
+ */
517
612
  version?: number;
518
613
  }
519
614
  /**
@@ -547,9 +642,15 @@ export interface SessionStateSlotV1 {
547
642
  */
548
643
  field?: FieldDecl;
549
644
  appliesTo: SlotAppliesTo[];
550
- /** A sheet says a session of this shape must have a value (R7): shown, never enforced here. */
645
+ /**
646
+ * A sheet says a session of this shape must have a value: shown, never enforced here.
647
+ * @ruling R7
648
+ */
551
649
  required?: boolean;
552
- /** Retired (R3): its values still resolve and nothing new is written; drawn greyed, never dropped. */
650
+ /**
651
+ * Retired: its values still resolve and nothing new is written; drawn greyed, never dropped.
652
+ * @ruling R3
653
+ */
553
654
  retired?: boolean;
554
655
  /** The sheet that first named it, when one did. */
555
656
  sheetId?: string;
@@ -575,21 +676,37 @@ export interface SessionStateOwnerV1 {
575
676
  configs: Record<string, Record<string, unknown>>;
576
677
  }
577
678
  /**
578
- * 🚧 The session's cast, as a widget draws it — `characters.v1` (R76) — with
679
+ * 🚧 The session's cast, as a widget draws it — `characters.v1` — with
579
680
  * the scene images they picture riding along: images ride with their parent.
580
681
  * @experimental
682
+ * @ruling R76
581
683
  */
582
684
  export interface SessionCharactersV1 {
583
- /** Everyone still in the session: its characters, then its personas. */
685
+ /**
686
+ * Everyone still in the session: its characters, then its personas. A
687
+ * **benched** character (switched off in Participants: still in the
688
+ * session, out of the turns) is listed with `benched: true` — a reader that means "who is in the scene" leaves those
689
+ * out itself.
690
+ * @ruling W6 (2026-10-11)
691
+ */
584
692
  members: SessionCharacterV1[];
585
- /** The portraits pinned beside the conversation, one per side; null for an empty side. */
693
+ /**
694
+ * ⏳ The portraits pinned beside the conversation, one per side; null for
695
+ * an empty side. The composer's **Pinned images** pane that set them is
696
+ * gone: a Scene Portraits instance's **chosen images**
697
+ * replace them, and the page only seeds those from a browser's old pins
698
+ * once. Still projected this release for a widget that reads it.
699
+ * @deprecated REMOVE in 0.7.0 — read `SessionCharacterV1` and ask
700
+ * `character-images`; a chosen image is a widget setting.
701
+ * @ruling W6 (2026-10-11)
702
+ */
586
703
  sceneImages: {
587
704
  left: SessionSceneImageV1 | null;
588
705
  right: SessionSceneImageV1 | null;
589
706
  };
590
707
  }
591
708
  /**
592
- * One cast member, **cascaded cast over card** (R76): the character card's
709
+ * One cast member, **cascaded cast over card**: the character card's
593
710
  * fields overlaid by the cast member's, and **the cast member wins wherever
594
711
  * both speak** — its name, its face, its sprite set. The card owns the art;
595
712
  * the cast member picks the set. The host merges; a widget reads the merged
@@ -598,6 +715,7 @@ export interface SessionCharactersV1 {
598
715
  * The host also resolves every URL and the current sprite, so a widget draws
599
716
  * what it is handed and asks nothing of the page but its verbs.
600
717
  * @experimental
718
+ * @ruling R76
601
719
  */
602
720
  export interface SessionCharacterV1 {
603
721
  /**
@@ -611,7 +729,8 @@ export interface SessionCharacterV1 {
611
729
  isPersona: boolean;
612
730
  /**
613
731
  * The viewer's own persona in this session: what a widget draws for "your
614
- * persona" (R77 — the viewer's, never merely the first one listed).
732
+ * persona" (the viewer's, never merely the first one listed).
733
+ * @ruling R77
615
734
  */
616
735
  mine: boolean;
617
736
  /** The name to show: the cast member's (a nickname) over the card's. */
@@ -638,11 +757,53 @@ export interface SessionCharacterV1 {
638
757
  /**
639
758
  * The viewer may switch this member's set (`set-sprite-set`) — the
640
759
  * server's rule (the session's owner or the character's), answered by the
641
- * host so a menu is offered only where it will be allowed (R77).
760
+ * host so a menu is offered only where it will be allowed.
761
+ * @ruling R77
642
762
  */
643
763
  canChangeSpriteSet: boolean;
764
+ /**
765
+ * 🚧 When this member last spoke (ms since the epoch): its newest visible
766
+ * line on the session's line; null when it has spoken none. What a
767
+ * widget ranks "who spoke last" by without reading the log.
768
+ * Optional (additive): absent reads as null.
769
+ * @ruling W6
770
+ */
771
+ lastSpokeAt?: number | null;
772
+ /**
773
+ * 🚧 How many images the character's **gallery** holds, when the host
774
+ * knows — what `character-images` would page through. Optional
775
+ * (additive): absent means the host did not say, never that there are
776
+ * none; ask `character-images` to find out.
777
+ * @ruling W6
778
+ */
779
+ galleryCount?: number;
780
+ /**
781
+ * 🚧 A **benched** character: still in the session, switched off in
782
+ * Participants, out of the turns. Never a persona. Optional
783
+ * (additive): absent reads as false.
784
+ * @ruling W6
785
+ */
786
+ benched?: boolean;
644
787
  }
645
- /** A portrait pinned to one side of the conversation. @experimental */
788
+ /**
789
+ * 🚧 One of the viewer's own personas in this session — `persona.v1` is a
790
+ * list of them: the `characters.v1` members that are `isPersona && mine`,
791
+ * the same objects (cascaded, resolved) cut from the same projection, so a
792
+ * widget granted `persona` alone never needs the cast to find "you".
793
+ *
794
+ * A list because a person may write as several; today `mine` marks the one
795
+ * the viewer is voicing (the composer's pick), so it holds at most one, and
796
+ * is empty — never absent — when the viewer writes as no persona.
797
+ * @experimental
798
+ */
799
+ export type SessionPersonaV1 = SessionCharacterV1 & {
800
+ isPersona: true;
801
+ };
802
+ /**
803
+ * ⏳ A portrait pinned to one side of the conversation.
804
+ * @deprecated REMOVE in 0.7.0 with {@link SessionCharactersV1.sceneImages}.
805
+ * @experimental
806
+ */
646
807
  export interface SessionSceneImageV1 {
647
808
  /** The image, as the host resolved it. */
648
809
  src: string;
@@ -668,37 +829,60 @@ export interface SessionSceneImageV1 {
668
829
  * empty — or, before the first post, "not yet"; the host's `grants`
669
830
  * (frame message `grants`, `ComponentContext.grants` / `granted(scope)`)
670
831
  * says which.
832
+ *
833
+ * Every `v1` is a named shape — never `unknown`.
671
834
  * @experimental
835
+ * @ruling C4 (2026-10-10)
672
836
  */
673
837
  export interface WidgetScopedSections {
674
- /** 🚧 The whole conversation as core's own conversation sees it (the dossier); its shape settles with C7. */
838
+ /**
839
+ * 🚧 The whole conversation as core's own conversation sees it: the
840
+ * dossier ({@link SessionDossierV1}). Its shape settles when the
841
+ * conversation moves onto the public contract.
842
+ * @ruling C8
843
+ */
675
844
  'session:full': {
676
845
  section: 'session_full';
677
- v1: unknown;
846
+ v1: SessionDossierV1;
678
847
  };
679
- /** 🚧 The session's stats and states (R72). */
848
+ /**
849
+ * 🚧 The session's stats and states.
850
+ * @ruling R72
851
+ */
680
852
  'session:state': {
681
853
  section: 'session_state';
682
854
  v1: SessionStateV1;
683
855
  };
684
- /** 🚧 The viewer's persona. Declared; no host supplies it yet. */
856
+ /**
857
+ * 🚧 The viewer's own personas in this session ({@link SessionPersonaV1}):
858
+ * the `characters.v1` members that are `isPersona && mine`, cut from the
859
+ * same projection under this scope's own grant. Empty, never absent, when
860
+ * the viewer writes as no persona.
861
+ */
685
862
  persona: {
686
863
  section: 'persona';
687
- v1: unknown;
864
+ v1: SessionPersonaV1[];
688
865
  };
689
- /** 🚧 The session's cast, cast over card, and the scene images they picture (R76). */
866
+ /**
867
+ * 🚧 The session's cast, cast over card, and the scene images they picture.
868
+ * @ruling R76
869
+ */
690
870
  characters: {
691
871
  section: 'characters';
692
872
  v1: SessionCharactersV1;
693
873
  };
694
874
  /**
695
- * 🚧 The session's lore. Declared and never pushed: it is the grant a
696
- * plugin's widget holds to ask `session-entries` (the lore is paged by
697
- * request, as messages are).
875
+ * 🚧 The **lore grant marker**. The lore is not pushed: it is paged by
876
+ * request (`session-entries`), as messages are, and this scope is the
877
+ * grant a plugin's widget holds to ask. The section carries no data —
878
+ * `{ granted: true }`, posted when the scope is granted and absent
879
+ * otherwise — so present means granted, never "not yet".
698
880
  */
699
881
  lore: {
700
882
  section: 'lore';
701
- v1: unknown;
883
+ v1: {
884
+ granted: true;
885
+ };
702
886
  };
703
887
  }
704
888
  /** A widget scope that delivers a scoped section — every scope but `channel:<slug>`. @experimental */
@@ -731,12 +915,13 @@ export declare const isWidgetScopedSectionName: (name: unknown) => name is Widge
731
915
  * below, and the scoped half ({@link WidgetScopedData}) the table above
732
916
  * derives.
733
917
  *
734
- * A base section a widget does not READ (`WidgetDecl.reads`, R75) is never
918
+ * A base section a widget does not READ (`WidgetDecl.reads`) is never
735
919
  * sent to it: a remote or a frame never receives it, and a native widget is
736
920
  * handed its empty value (`[]`, `{}`) and never re-projected for it — so a
737
921
  * widget that does not read `messages` is not handed the log again on every
738
922
  * token.
739
923
  * @experimental
924
+ * @ruling R75
740
925
  */
741
926
  export interface WidgetData extends WidgetScopedData {
742
927
  layout: {
@@ -755,8 +940,9 @@ export interface WidgetData extends WidgetScopedData {
755
940
  v1: WidgetPayload;
756
941
  };
757
942
  /**
758
- * The action model's venues (R-15) — base, so a widget need not declare a
943
+ * The action model's venues — base, so a widget need not declare a
759
944
  * scope to offer a control.
945
+ * @ruling R-15
760
946
  */
761
947
  actions: {
762
948
  v1: ActionsV1;
@@ -770,7 +956,10 @@ export interface WidgetData extends WidgetScopedData {
770
956
  settings: {
771
957
  v1: WidgetPayload;
772
958
  };
773
- /** The viewer's view of the session annex (R57) — `{}` when there is nothing to see. */
959
+ /**
960
+ * The viewer's view of the session annex — `{}` when there is nothing to see.
961
+ * @ruling R57
962
+ */
774
963
  annex: {
775
964
  v1: AnnexV1;
776
965
  };
@@ -781,30 +970,53 @@ export interface WidgetData extends WidgetScopedData {
781
970
  locale: {
782
971
  v1: string;
783
972
  };
784
- /** 🚧 Who is looking (C0b). */
973
+ /**
974
+ * 🚧 Who is looking.
975
+ * @ruling C0b
976
+ */
785
977
  viewer: {
786
978
  v1: ViewerV1;
787
979
  };
788
980
  /**
789
- * The session's turn order (C5): who is due to speak, in order, and who
790
- * could — the stored order core and every strategy write (A9), never
981
+ * The session's turn order: who is due to speak, in order, and who
982
+ * could — the stored order core and every strategy write, never
791
983
  * recomputed by a reader. What the page already shows every member in
792
984
  * its "next" line; `EMPTY_TURN_ORDER` before the first recompute. An
793
985
  * entry is open: a strategy may add keys (a `reason`, …) and they arrive.
986
+ * @ruling C5, A9
794
987
  */
795
988
  turnOrder: {
796
989
  v1: TurnOrderV1;
797
990
  };
991
+ /**
992
+ * The session's attendance: its owner and guests, who has it open
993
+ * now and who left, as whom each writes, who is typing.
994
+ * `EMPTY_ATTENDANCE` before the host's first push.
995
+ * @ruling W10
996
+ */
997
+ attendance: {
998
+ v1: AttendanceV1;
999
+ };
798
1000
  }
799
- /** A base section's name — what a widget lists in `WidgetDecl.reads` (R75). @experimental */
1001
+ /**
1002
+ * A base section's name — what a widget lists in `WidgetDecl.reads`. @experimental
1003
+ * @ruling R75
1004
+ */
800
1005
  export type WidgetBaseSection = Exclude<keyof WidgetData, WidgetScopedSectionName>;
801
1006
  /**
802
- * The base sections, in the order the envelope declares them (R75): what
1007
+ * The base sections, in the order the envelope declares them: what
803
1008
  * `WidgetDecl.reads` may name, and what a widget reads when it names none.
804
1009
  * @experimental
1010
+ * @ruling R75
805
1011
  */
806
1012
  export declare const WIDGET_BASE_SECTIONS: readonly WidgetBaseSection[];
807
- /** A menu for the host to render at a point the widget names. @experimental */
1013
+ /**
1014
+ * ⏳ A menu for the host to render at a point the widget names — the argument
1015
+ * of the retired `menu` verb ({@link WidgetVerbs.menu}). REMOVE in 0.7.0.
1016
+ * @deprecated No host ever drew one. Place an `sp-menu` (or an `sp-popover`)
1017
+ * in your component instead: the page draws it with its own controls.
1018
+ * @experimental
1019
+ */
808
1020
  export interface MenuSpec {
809
1021
  at: {
810
1022
  x: number;
@@ -817,20 +1029,36 @@ export interface MenuSpec {
817
1029
  disabled?: boolean;
818
1030
  }>;
819
1031
  }
820
- /** What a person picked out of a `MenuSpec`. @experimental */
1032
+ /**
1033
+ * ⏳ What a person picked out of a `MenuSpec` — the retired `menu` verb's
1034
+ * answer. REMOVE in 0.7.0.
1035
+ * @deprecated See {@link MenuSpec}.
1036
+ * @experimental
1037
+ */
821
1038
  export interface MenuResult {
822
1039
  id: string;
823
1040
  }
824
1041
  /**
825
- * 🚧 What a widget may ASK the host for (C0b) — by kind, with its params and
1042
+ * 🚧 What a widget may ASK the host for — by kind, with its params and
826
1043
  * what comes back. A request is not a grant: the host may decline, and the
827
1044
  * promise rejects. The host-UI kinds open something of the host's own (a
828
1045
  * panel, a viewer, a picker) and resolve once it is shown; the widget never
829
1046
  * sees what the host draws.
830
1047
  * @experimental
1048
+ * @ruling C0b
831
1049
  */
832
1050
  export interface WidgetRequests {
833
- /** A page of a lane's messages, older than `cursor`. */
1051
+ /**
1052
+ * One page of the session's lines, for this widget's own window — never
1053
+ * the conversation's, so two paging widgets never take each other's
1054
+ * pages. Newest first on the first ask; `cursor` is the last page's
1055
+ * `nextCursor`, absent on the last page. `limit` is a wish the host clamps
1056
+ * (core: 1–100, 25 by default). `channel` is a channel string: a bare
1057
+ * slug reads the whole channel, `slug:n` one lane; absent, a widget that
1058
+ * declares one channel reads that one, any other reads every channel. A
1059
+ * plugin's widget that declares channels is held to them. Rows arrive
1060
+ * oldest first, as a log reads.
1061
+ */
834
1062
  messages: {
835
1063
  params: {
836
1064
  channel?: string;
@@ -857,11 +1085,12 @@ export interface WidgetRequests {
857
1085
  result: void;
858
1086
  };
859
1087
  /**
860
- * An image a message shows, full size, in the page's lightbox. 🚧 `gallery`
861
- * (composer attachments §3.4): the other images it sits with — a message's
1088
+ * An image a message shows, full size, in the page's lightbox. 🚧 `gallery`:
1089
+ * the other images it sits with — a message's
862
1090
  * media strip — so the lightbox pages through them (←/→, swipe); `index` is
863
1091
  * where `src` sits in `srcs`, `captions` what each is called. Without it
864
1092
  * the lightbox shows the one image.
1093
+ * @ruling composer attachments §3.4
865
1094
  */
866
1095
  'view-image': {
867
1096
  params: {
@@ -874,11 +1103,15 @@ export interface WidgetRequests {
874
1103
  };
875
1104
  result: void;
876
1105
  };
877
- /** The lore panel at a history entry, a scene, or a new history entry. */
1106
+ /**
1107
+ * The lore panel at a history entry, a scene, or a new history entry —
1108
+ * 🚧 or a place (`scope: 'places'`, an additive value).
1109
+ * @ruling W4 (2026-10-11)
1110
+ */
878
1111
  'open-lore': {
879
1112
  params: {
880
1113
  lorebookId?: number;
881
- scope: 'history' | 'scenes';
1114
+ scope: 'history' | 'scenes' | 'places';
882
1115
  entryId?: number;
883
1116
  sceneId?: number;
884
1117
  create?: boolean;
@@ -904,7 +1137,10 @@ export interface WidgetRequests {
904
1137
  params: Record<string, never>;
905
1138
  result: void;
906
1139
  };
907
- /** The host's sprite picker for a character's line (DESIGN-sprites §6). */
1140
+ /**
1141
+ * The host's sprite picker for a character's line.
1142
+ * @ruling DESIGN-sprites §6
1143
+ */
908
1144
  'change-sprite': {
909
1145
  params: {
910
1146
  messageId: number;
@@ -918,18 +1154,117 @@ export interface WidgetRequests {
918
1154
  };
919
1155
  result: void;
920
1156
  };
921
- /** Summarize the selected messages into a scene, world lore or a character's lore. */
1157
+ /**
1158
+ * Summarize the selected messages into a scene, world lore or a character's lore.
1159
+ * 🚧 `messageIds` absent: the host starts the
1160
+ * conversation's own selection instead, and the person picks the lines —
1161
+ * what Chronicle's **Summarize scene** asks, since it holds no lines.
1162
+ * 🚧 `sceneId` (with `kind: 'scene'`): summarize that existing scene — a
1163
+ * live scene's range, or a captured one's lines — in the host's review;
1164
+ * `messageIds` is then ignored. What a scene divider's **Summarize** asks.
1165
+ * A scene whose run still runs or waits in `review` opens that run's
1166
+ * review instead of starting another — what a divider's and Chronicle's
1167
+ * **Ready to review** ask (§15 G8).
1168
+ * @ruling W3 (2026-10-11); PROPOSAL-live-scenes §7, §15 G8
1169
+ */
922
1170
  summarize: {
923
1171
  params: {
924
1172
  kind: 'scene' | 'world' | 'character';
925
- messageIds: number[];
1173
+ messageIds?: number[];
1174
+ sceneId?: number;
1175
+ };
1176
+ result: void;
1177
+ };
1178
+ /**
1179
+ * 🚧 **Live scenes** (PROPOSAL-live-scenes §3, §14 C): open a scene at
1180
+ * `messageId` on its channel lane — *Start scene here*. A scene already
1181
+ * open on that lane is closed first, at the line before. The session's
1182
+ * owner only, where the genre writes scenes and the session reads a
1183
+ * lorebook (`SessionDossierV1.sceneBoundaries`); the host's refusal is
1184
+ * the rejection, in words. Resolves with the opened scene's id; the
1185
+ * scene arrives in the dossier's `scenes`.
1186
+ */
1187
+ 'scene-open': {
1188
+ params: {
1189
+ messageId: number;
1190
+ channel?: string;
1191
+ /**
1192
+ * 🚧 The scene's last line: it opens and closes in one write — a
1193
+ * closed scene over `messageId … closeAt` (*Mark as scene*, lane
1194
+ * E). Any run that overlaps no live scene on its lane; one wholly
1195
+ * before the lane's open scene leaves that scene open.
1196
+ */
1197
+ closeAt?: number;
1198
+ };
1199
+ result: {
1200
+ sceneId: number;
1201
+ };
1202
+ };
1203
+ /**
1204
+ * 🚧 Close the open scene `sceneId` at `messageId` — *End scene here* —
1205
+ * or, absent, at its lane's newest line. Owner only, as `scene-open`.
1206
+ */
1207
+ 'scene-close': {
1208
+ params: {
1209
+ sceneId: number;
1210
+ messageId?: number;
1211
+ };
1212
+ result: {
1213
+ sceneId: number;
1214
+ };
1215
+ };
1216
+ /**
1217
+ * 🚧 Move a live scene's **scene boundaries**: its opening to `openedAt`,
1218
+ * and (a closed scene only) its end to `closedAt` — message ids on the
1219
+ * scene's lane. `closedAt: null` **reopens** a closed scene: it runs on
1220
+ * to its lane's newest line again, refused while a later scene stands on
1221
+ * the lane (lane E). A move leaves the scene's summary out of date
1222
+ * (`summaryStatus` back to `none`, its text kept). Owner only, as
1223
+ * `scene-open`.
1224
+ */
1225
+ 'scene-move': {
1226
+ params: {
1227
+ sceneId: number;
1228
+ openedAt?: number;
1229
+ closedAt?: number | null;
1230
+ };
1231
+ result: {
1232
+ sceneId: number;
1233
+ };
1234
+ };
1235
+ /** 🚧 Rename a scene (a scene divider's name); null or blank clears it. Owner only. */
1236
+ 'scene-rename': {
1237
+ params: {
1238
+ sceneId: number;
1239
+ name: string | null;
926
1240
  };
927
1241
  result: void;
928
1242
  };
929
1243
  /**
930
- * 🚧 Core's own composer (C0b): send the viewer's line, as the persona and
931
- * on the lane named. A host answers it for core's widget only — a
932
- * plugin's widget writes through its own actions.
1244
+ * 🚧 *Remove boundary* on a scene divider: the host asks the person
1245
+ * first (what goes, what stays), then removes the boundary. A scene with
1246
+ * one before it on its lane **joins** that scene (lane E: its lines
1247
+ * become that scene's, its own summary goes; `mergedInto` names the
1248
+ * survivor); the lane's first scene is removed, its lines staying in the
1249
+ * conversation outside any scene. Resolves `removed: false` when the
1250
+ * person kept it. Owner only.
1251
+ */
1252
+ 'scene-remove': {
1253
+ params: {
1254
+ sceneId: number;
1255
+ };
1256
+ result: {
1257
+ removed: boolean;
1258
+ mergedInto?: number;
1259
+ };
1260
+ };
1261
+ /**
1262
+ * 🚧 Send the viewer's line, as the persona and on the lane named — what
1263
+ * core's own composer asks. A plugin's widget may ask it too, holding the
1264
+ * **write grant** on that channel (`channel:<slug>:write`, reviewed as
1265
+ * `widget:channel:<slug>:write`) and naming one of its own declared
1266
+ * `channels`; a press must be behind it, and the line goes as the viewer.
1267
+ * @ruling C0b
933
1268
  */
934
1269
  send: {
935
1270
  params: {
@@ -938,20 +1273,22 @@ export interface WidgetRequests {
938
1273
  channel: string;
939
1274
  /**
940
1275
  * 🚧 The composer's **tray items** to send as this line's
941
- * attachments (composer attachments §3.1), in tray order. With
1276
+ * attachments, in tray order. With
942
1277
  * any, `content` may be empty. The host refuses the whole line
943
1278
  * when one is not ready; the tray then stays as it was.
1279
+ * @ruling composer attachments §3.1
944
1280
  */
945
1281
  trayItemIds?: string[];
946
1282
  };
947
1283
  result: void;
948
1284
  };
949
1285
  /**
950
- * 🚧 Core's composer (composer attachments §3.3): upload these files into
1286
+ * 🚧 Core's composer: upload these files into
951
1287
  * the session's composer tray — the files a person picked, dropped or
952
1288
  * pasted (`sp-file-picker`, `sp-drop-zone`). Resolves once they are
953
1289
  * queued; their progress, readiness and refusals arrive in the dossier's
954
1290
  * `composer.tray`, never in the reply.
1291
+ * @ruling composer attachments §3.3
955
1292
  */
956
1293
  'attach-files': {
957
1294
  params: {
@@ -967,9 +1304,10 @@ export interface WidgetRequests {
967
1304
  result: void;
968
1305
  };
969
1306
  /**
970
- * 🚧 Core's conversation (composer attachments D9, remove only): take one
1307
+ * 🚧 Core's conversation: take one
971
1308
  * attachment — a `core:image` / `core:file` part, by its id — off a sent
972
1309
  * message. Whoever may edit the message may; the file itself stays.
1310
+ * @ruling composer attachments D9 (remove only)
973
1311
  */
974
1312
  'remove-attachment': {
975
1313
  params: {
@@ -978,7 +1316,12 @@ export interface WidgetRequests {
978
1316
  };
979
1317
  result: void;
980
1318
  };
981
- /** 🚧 Core's composer: the draft changed (the host keeps it, and counts its tokens). */
1319
+ /**
1320
+ * 🚧 Core's composer: the draft changed (the host keeps it, and counts its
1321
+ * tokens). A plugin's widget may ask it too — the gentler `send` — holding
1322
+ * the write grant (`channel:<slug>:write`) on the channel the composer is
1323
+ * on, one of its declared `channels`; a press must be behind it.
1324
+ */
982
1325
  draft: {
983
1326
  params: {
984
1327
  content: string;
@@ -999,9 +1342,10 @@ export interface WidgetRequests {
999
1342
  };
1000
1343
  /**
1001
1344
  * 🚧 Core's conversation: Continue — fire the first entry of the session's
1002
- * turn order on `channel`, the channel of the composer it was pressed in
1003
- * (lair re-plan R5, 2026-09-28). Absent, the host answers for its own
1345
+ * turn order on `channel`, the channel of the composer it was pressed in.
1346
+ * Absent, the host answers for its own
1004
1347
  * composer's channel.
1348
+ * @ruling lair re-plan R5 (2026-09-28)
1005
1349
  */
1006
1350
  'fire-turn': {
1007
1351
  params: {
@@ -1018,11 +1362,15 @@ export interface WidgetRequests {
1018
1362
  result: void;
1019
1363
  };
1020
1364
  /**
1021
- * 🚧 Core's state widgets (R21): set one owner's value for one slot, at
1365
+ * 🚧 Set one owner's value for one slot, as core's state widgets do, at
1022
1366
  * the session layer — the viewer's own edit, applied at once (the page's
1023
1367
  * `state:set`); `null` clears the session's value so the read inherits
1024
1368
  * again. The page names its own session. Resolves once written; the new
1025
- * value arrives as a `session_state` push, never in the reply.
1369
+ * value arrives as a `session_state` push, never in the reply. A plugin's
1370
+ * widget may ask it too, holding the write grant `session:state:write`
1371
+ * (reviewed as `widget:session:state:write`) — a grant apart from the
1372
+ * `session:state` read; a press must be behind it.
1373
+ * @ruling R21
1026
1374
  */
1027
1375
  'set-attribute-value': {
1028
1376
  params: {
@@ -1037,10 +1385,11 @@ export interface WidgetRequests {
1037
1385
  result: void;
1038
1386
  };
1039
1387
  /**
1040
- * 🚧 Core's scene portraits (R21): show a character in another of its
1388
+ * 🚧 Core's scene portraits: show a character in another of its
1041
1389
  * sprite sets, for this session only; `null` goes back to the card's.
1042
1390
  * Offered where `SessionCharacterV1.canChangeSpriteSet` says so; the
1043
1391
  * server judges it again.
1392
+ * @ruling R21
1044
1393
  */
1045
1394
  'set-sprite-set': {
1046
1395
  params: {
@@ -1050,9 +1399,13 @@ export interface WidgetRequests {
1050
1399
  result: void;
1051
1400
  };
1052
1401
  /**
1053
- * 🚧 Core's scene portraits (R21): take down the portrait pinned on one
1054
- * side — the page's own pin, which the page keeps (R77: the page and the
1055
- * widget never disagree about what is pinned).
1402
+ * ⏳ Take down the portrait pinned on one side — the page's own pin,
1403
+ * which the page keeps (the page and the widget never disagree
1404
+ * about what is pinned). Core's Scene Portraits no longer asks it (a
1405
+ * **chosen image** is the widget's own setting); still
1406
+ * answered this release.
1407
+ * @deprecated REMOVE in 0.7.0 with `SessionCharactersV1.sceneImages`.
1408
+ * @ruling R77, W6 (2026-10-11)
1056
1409
  */
1057
1410
  'clear-scene-image': {
1058
1411
  params: {
@@ -1060,13 +1413,39 @@ export interface WidgetRequests {
1060
1413
  };
1061
1414
  result: void;
1062
1415
  };
1416
+ /**
1417
+ * 🚧 Core's Scene Portraits: a page of one
1418
+ * session member's **gallery** — the character's own images, in the
1419
+ * gallery's order, sprites left out — each by `ref` (the image's stable
1420
+ * id, what a **chosen image** stores) with its `src` resolved by the
1421
+ * host. `cursor` is the last page's `nextCursor`; none is the first page,
1422
+ * and no `nextCursor` is the last. Only a member of `characters.v1` may be
1423
+ * asked about; the host refuses anyone else. A widget shows one large by
1424
+ * `view-image` with the page as its `gallery`.
1425
+ * @ruling PLAN-core-widgets W6
1426
+ */
1427
+ 'character-images': {
1428
+ params: {
1429
+ characterId: number;
1430
+ cursor?: string;
1431
+ };
1432
+ result: {
1433
+ images: Array<{
1434
+ ref: string;
1435
+ src: string;
1436
+ caption?: string;
1437
+ }>;
1438
+ nextCursor?: string;
1439
+ };
1440
+ };
1063
1441
  /**
1064
1442
  * 🚧 A page of the session's lorebook, entry by entry, with what this
1065
- * session's rankings made of each (R58) — searched by title and keys,
1443
+ * session's rankings made of each — searched by title and keys,
1066
1444
  * sorted, filtered, paged. The page names its own session. `lorebookId`
1067
1445
  * is null when the session reads into no book; `ownerOnly` when the viewer
1068
1446
  * is not the book's owner, and then `rows` is empty. `offset` is the page
1069
1447
  * actually served — pulled back when the one asked for ran past the end.
1448
+ * @ruling R58
1070
1449
  */
1071
1450
  'session-entries': {
1072
1451
  params: {
@@ -1074,7 +1453,7 @@ export interface WidgetRequests {
1074
1453
  * 🚧 Text an entry's title or one of its keys contains — the
1075
1454
  * search box's words, matched as they are (`%` and `_` are
1076
1455
  * literal). Never `query`, a retired word here — the node kind
1077
- * owns it (NOMENCLATURE, Retired words): the page reconciles this
1456
+ * owns it: the page reconciles this
1078
1457
  * with its socket's spelling.
1079
1458
  */
1080
1459
  titleOrKey?: string;
@@ -1099,7 +1478,7 @@ export interface WidgetRequests {
1099
1478
  };
1100
1479
  };
1101
1480
  /**
1102
- * 🚧 Core's lore entries (R58): an entry's **Off** and **Pin** marks, and
1481
+ * 🚧 Core's lore entries: an entry's **Off** and **Pin** marks, and
1103
1482
  * nothing else — never a re-embed. Resolves with both marks as the session
1104
1483
  * reads the entry — its line, at its clock. For the book's owner and
1105
1484
  * admins; the server judges it.
@@ -1107,6 +1486,7 @@ export interface WidgetRequests {
1107
1486
  * `heldBy` is present when a dated amendment still decides a mark asked
1108
1487
  * for, so it does not read as asked here: the entry itself was saved, and
1109
1488
  * the amendment wins from `date` on (spelled by the book's calendar).
1489
+ * @ruling R58
1110
1490
  */
1111
1491
  'set-entry-marks': {
1112
1492
  params: {
@@ -1144,6 +1524,460 @@ export interface WidgetRequests {
1144
1524
  };
1145
1525
  result: AuthorsNoteV1;
1146
1526
  };
1527
+ /**
1528
+ * 🚧 Core's Chronicle: where the
1529
+ * session stands in its story and what its lorebook has recorded of it —
1530
+ * its story clock, the history entry it reads now with this session's
1531
+ * scenes under it, and the entries before it. The page names its own
1532
+ * session. Read on the session's line, up to its own clock when it has
1533
+ * one. `earlierLimit` caps `earlier` (default 10).
1534
+ * @ruling PLAN-core-widgets W3 (2026-10-11)
1535
+ */
1536
+ 'history-entries': {
1537
+ params: {
1538
+ earlierLimit?: number;
1539
+ };
1540
+ result: HistoryEntriesV1;
1541
+ };
1542
+ /**
1543
+ * 🚧 Core's Chronicle: move the session's **story clock** — never the
1544
+ * book's present. `{ follow: true }` clears it, so the session follows
1545
+ * its line's present again; `{ to }` sets it; `{ by, unit }` steps it
1546
+ * through the book's calendar (from the line's present when the session
1547
+ * follows it). The session's owner only; a date the calendar cannot
1548
+ * place, or a step that does not land, is refused with the reason.
1549
+ * Resolves with the clock as it now reads.
1550
+ */
1551
+ 'set-story-clock': {
1552
+ params: {
1553
+ follow: true;
1554
+ } | {
1555
+ to: StoryTime;
1556
+ } | {
1557
+ by: number;
1558
+ unit: StoryTimeUnit;
1559
+ };
1560
+ result: StoryClockV1;
1561
+ };
1562
+ /**
1563
+ * 🚧 Core's Chronicle: add the next history entry after the one the
1564
+ * session reads now (`HistoryEntriesV1.current`), on the session's line,
1565
+ * one step on by the book's calendar — the lorebook's *Add the next date
1566
+ * in sequence*. The book's owner only. Resolves with the new entry's id.
1567
+ */
1568
+ 'start-history-entry': {
1569
+ params: Record<string, never>;
1570
+ result: {
1571
+ entryId: number;
1572
+ };
1573
+ };
1574
+ /**
1575
+ * 🚧 Core's Chronicle: open the host's **Extend graph** review for this
1576
+ * session's scenes on its line that are not in the lorebook's
1577
+ * relationship graph yet. Resolves once it is shown; refused when there
1578
+ * is none to read.
1579
+ */
1580
+ 'extend-graph': {
1581
+ params: Record<string, never>;
1582
+ result: void;
1583
+ };
1584
+ /**
1585
+ * 🚧 Core's Chronicle: summarize scenes of this session in the
1586
+ * background, one after another, each through the host's summarize-scene
1587
+ * path (its activity card, then its review) — `sceneIds`, or, absent,
1588
+ * every closed scene whose summary has not run or failed: **Summarize all
1589
+ * (N)**. A scene row's *Summarize* and the open scene's *Close and
1590
+ * summarize* name one. The session's owner only, where the session's
1591
+ * summary mode is not `never` (`HistoryEntriesV1.summaryMode`); a scene
1592
+ * already summarizing, or still open, is skipped. Resolves once they are
1593
+ * queued, with how many.
1594
+ * @ruling PROPOSAL-live-scenes §5, §7 (2026-10-13)
1595
+ */
1596
+ 'summarize-scenes': {
1597
+ params: {
1598
+ sceneIds?: number[];
1599
+ };
1600
+ result: {
1601
+ started: number;
1602
+ };
1603
+ };
1604
+ /**
1605
+ * 🚧 Decide a **scene cue** — Suggested mode's *New scene?* chip at a
1606
+ * line (`SessionDossierV1.sceneCues`). `accept` opens a scene at the
1607
+ * cue's line (the scene open on its lane, if any, closes at the line
1608
+ * before); `accept: false` is *Not here*: every cue at that line is
1609
+ * dismissed and never offered there again. The session's owner only.
1610
+ * Resolves with the scene it opened, or null.
1611
+ * @ruling PROPOSAL-live-scenes §4 (2026-10-13)
1612
+ */
1613
+ 'decide-scene-cue': {
1614
+ params: {
1615
+ cueId: number;
1616
+ accept: boolean;
1617
+ };
1618
+ result: {
1619
+ sceneId: number | null;
1620
+ };
1621
+ };
1622
+ /**
1623
+ * 🚧 Core's Places: the places of the
1624
+ * session's lorebook as the session reads them — on its line, at its
1625
+ * story clock, a place switched off, archived or renamed by then read as
1626
+ * the session has it — and the **ways** between them, the same ones its
1627
+ * prompt says as *From here:* (standing, never secret). The page names
1628
+ * its own session. Who stands where is not here: it is the session's
1629
+ * state (`session_state.v1`, each owner's `location`), which a widget
1630
+ * granted `session:state` reads itself.
1631
+ * @ruling PLAN-core-widgets W4 (2026-10-11)
1632
+ */
1633
+ 'session-places': {
1634
+ params: Record<string, never>;
1635
+ result: SessionPlacesV1;
1636
+ };
1637
+ /**
1638
+ * 🚧 The **channel lanes** under one channel (ruled 2026-10-12): the
1639
+ * conversations a channel carries, numbered from 1 — a phone's several
1640
+ * threads. One entry per lane that holds at least one line, with how many
1641
+ * and the latest. Who is in a lane is the genre's to keep (its extension
1642
+ * data); this lists what the log itself shows. `channel` is a bare slug;
1643
+ * a lane string (`slug:n`) answers that one lane. A plugin's widget that
1644
+ * declares channels is held to them.
1645
+ */
1646
+ 'channel-lanes': {
1647
+ params: {
1648
+ channel: string;
1649
+ };
1650
+ result: {
1651
+ lanes: ChannelLaneV1[];
1652
+ };
1653
+ };
1654
+ /**
1655
+ * 🚧 Core's Stats: one owner's
1656
+ * **stat trail** for one slot — the changes this session made to it,
1657
+ * oldest first, each with the message it was written at — read from the
1658
+ * ledger the *Stat trail* pipeline query reads. `slotId` is the full id
1659
+ * or its local name; `limit` keeps the newest that many (default 20, at
1660
+ * most 100). The page names its own session. A slot the session does not
1661
+ * track has no trail: `changes` is empty.
1662
+ * @ruling PLAN-core-widgets §3.10, F2 (2026-10-11)
1663
+ */
1664
+ 'stat-trail': {
1665
+ params: {
1666
+ owner: {
1667
+ kind: 'session' | 'session_cast' | 'session_location';
1668
+ id: number;
1669
+ };
1670
+ slotId: string;
1671
+ limit?: number;
1672
+ };
1673
+ result: {
1674
+ changes: StatTrailChangeV1[];
1675
+ };
1676
+ };
1677
+ /**
1678
+ * 🚧 Core's Scene Portraits: set the
1679
+ * **chosen image** this widget shows for one member (`character:<id>`),
1680
+ * by its image ref (what `character-images` answered as `ref`); `null`
1681
+ * takes it away, so the face falls back to the avatar. Written into the
1682
+ * asking widget's own settings (`chosenImages`), as the viewer's own
1683
+ * values; the new settings arrive as the widget's `settings` section,
1684
+ * never in the reply. Only a member of `characters.v1` may be named.
1685
+ * @ruling F2 (2026-10-11), W6 ruling 1
1686
+ */
1687
+ 'set-chosen-image': {
1688
+ params: {
1689
+ characterRef: string;
1690
+ mediaRef: string | null;
1691
+ };
1692
+ result: void;
1693
+ };
1694
+ /**
1695
+ * 🚧 Core's Backdrop widget: set the session's **backdrop** to one image,
1696
+ * by its image ref (what `character-images` answered as `ref`, a file's
1697
+ * uuid, or what `session-images` answered, a file's id); `null` clears it. The host asks the server, which lets the
1698
+ * session's owner or an admin; the new backdrop arrives on the `session`
1699
+ * section, never in the reply.
1700
+ * @ruling DESIGN-image-generation §6.4
1701
+ */
1702
+ 'set-backdrop': {
1703
+ params: {
1704
+ mediaRef: string | null;
1705
+ };
1706
+ result: void;
1707
+ };
1708
+ /**
1709
+ * 🚧 Core's Backdrop widget's *From this session*: a page of the
1710
+ * pictures generated in this session — the Album's `generated` source
1711
+ * over a page of the session's lines (the `messages` request's window),
1712
+ * newest first — each by `ref` (the file's id, which `set-backdrop`
1713
+ * takes as it takes a uuid) with its `src` resolved by the host.
1714
+ * `cursor` is the last page's `nextCursor`; none is the first page, and
1715
+ * no `nextCursor` is the last. A page may hold no picture and still have
1716
+ * a next one.
1717
+ * @ruling DESIGN-image-generation §16 follow-up D3 (2026-10-12)
1718
+ */
1719
+ 'session-images': {
1720
+ params: {
1721
+ cursor?: string;
1722
+ };
1723
+ result: {
1724
+ images: Array<{
1725
+ ref: string;
1726
+ src: string;
1727
+ caption?: string;
1728
+ }>;
1729
+ nextCursor?: string;
1730
+ };
1731
+ };
1732
+ }
1733
+ /**
1734
+ * 🚧 One change on a **stat trail** (`stat-trail`): what the slot read
1735
+ * before it (`from`; null for the first the session made with nothing
1736
+ * recorded before it) and after (`to`; null is a clear — the session's value
1737
+ * taken away, so the read inherits again), the message it was written at
1738
+ * (null when written before the session's first), when (ms since the epoch),
1739
+ * and who wrote it: `user` — a person's own edit; `model` — a turn's run
1740
+ * (what the reply said, or a proposal from it someone accepted);
1741
+ * `pipeline` — anything else that writes state (a script).
1742
+ * @experimental
1743
+ * @ruling F2
1744
+ */
1745
+ export interface StatTrailChangeV1 {
1746
+ messageId: number | null;
1747
+ at: number;
1748
+ from: unknown;
1749
+ to: unknown;
1750
+ by: 'user' | 'model' | 'pipeline';
1751
+ }
1752
+ /**
1753
+ * 🚧 One **channel lane** as the log shows it (`channel-lanes`): a numbered
1754
+ * conversation under a channel. Lane 1 is the bare slug, by canon, and
1755
+ * `channel` is always the canonical string a row carries.
1756
+ * @experimental
1757
+ */
1758
+ export interface ChannelLaneV1 {
1759
+ /** The canonical channel string of this lane: `phone` for lane 1, `phone:2` after. */
1760
+ channel: string;
1761
+ /** The channel's slug. */
1762
+ slug: string;
1763
+ /** The lane number, from 1. */
1764
+ lane: number;
1765
+ /** Lines in this lane, hidden ones included. */
1766
+ count: number;
1767
+ /** The newest line, so a list can order and preview lanes. */
1768
+ latest: {
1769
+ messageId: number;
1770
+ /** ISO time the line was created. */
1771
+ at: string;
1772
+ role: string;
1773
+ characterId?: number | null;
1774
+ personaId?: number | null;
1775
+ };
1776
+ }
1777
+ /**
1778
+ * 🚧 What `session-places` answers. With no lorebook (`lorebookId`
1779
+ * null) everything else is empty.
1780
+ * @experimental
1781
+ * @ruling W4
1782
+ */
1783
+ export interface SessionPlacesV1 {
1784
+ /** The session's book; null when it reads none. */
1785
+ lorebookId: number | null;
1786
+ /** The moment the places are read at — the session's story clock; null at the head of its line. */
1787
+ asOf: StoryTime | null;
1788
+ /** The places the session sees, in entry order. */
1789
+ places: PlaceV1[];
1790
+ /** The ways between them, by relationship id; both ends are always among `places`. */
1791
+ ways: WayV1[];
1792
+ }
1793
+ /**
1794
+ * 🚧 One place as a session reads it — a **place**, a
1795
+ * `core:entry/location` lore entry.
1796
+ * @experimental
1797
+ * @ruling W4
1798
+ */
1799
+ export interface PlaceV1 {
1800
+ /** The place's lore entry id — what `open-lore` and a `location` value name. */
1801
+ id: number;
1802
+ /** Its name as the session reads it (an amendment's, by then). */
1803
+ name: string;
1804
+ /** Its category ("a floor, a district, a wing"); null when it has none. */
1805
+ category: string | null;
1806
+ /**
1807
+ * Where its category falls among the book's categories, sorted as the
1808
+ * lorebook's Places lens sorts them (from 0) — what a tint is dealt by,
1809
+ * so a category keeps its hue when a filter hides the others. Null with
1810
+ * no category.
1811
+ */
1812
+ tint: number | null;
1813
+ /** What else the book links to it — a cast member who keeps it, a faction — each said from the place. */
1814
+ linked: PlaceLinkV1[];
1815
+ }
1816
+ /**
1817
+ * 🚧 Something the book links to a place that is not another place: a
1818
+ * cast member, or other lore. A link to a character's own lore is never
1819
+ * here.
1820
+ * @experimental
1821
+ * @ruling W4
1822
+ */
1823
+ export interface PlaceLinkV1 {
1824
+ kind: 'cast' | 'entry';
1825
+ /** The cast member's id, or the entry's. */
1826
+ id: number;
1827
+ name: string;
1828
+ /** The link said from the place, as the lorebook says it ("Verity keeps the Crypt."). */
1829
+ says: string;
1830
+ }
1831
+ /**
1832
+ * 🚧 One **way** between two places: a relationship with a place at
1833
+ * each end, standing, and not secret.
1834
+ * @experimental
1835
+ * @ruling W4
1836
+ */
1837
+ export interface WayV1 {
1838
+ /** The relationship's id. */
1839
+ id: number;
1840
+ /** The place it runs from — its `from` end. */
1841
+ from: number;
1842
+ /** The place it runs to. */
1843
+ to: number;
1844
+ /** It reads from both ends ("Both ways") — an arrowhead at each. */
1845
+ bothWays: boolean;
1846
+ /** Its own name ("the rusted iron door"); null when it has none. */
1847
+ name: string | null;
1848
+ /** Said from `from`: "The rusted iron door leads north to the Drowned Hall." */
1849
+ fromSays: string;
1850
+ /** Said from `to`; null for a one-way way, which is no way out of there. */
1851
+ toSays: string | null;
1852
+ }
1853
+ /**
1854
+ * 🚧 Where a session stands in its story: its **story clock** as read —
1855
+ * its own, or its line's present when it follows the line. Dates are the
1856
+ * SDK's `StoryTime`, spelled through the book's calendar by the host.
1857
+ * @experimental
1858
+ * @ruling W3
1859
+ */
1860
+ export interface StoryClockV1 {
1861
+ /** The session's present: its own clock, else its line's present; null when neither exists. */
1862
+ present: StoryTime | null;
1863
+ /** `present` spelled through the book's calendar; empty when there is none. */
1864
+ label: string;
1865
+ /** The session holds a clock of its own; false — it follows its line's present. */
1866
+ own: boolean;
1867
+ /** The line's present (the line's clock, else its newest history entry); null when it has none. */
1868
+ linePresent: StoryTime | null;
1869
+ /** `linePresent`, spelled; empty when there is none. */
1870
+ linePresentLabel: string;
1871
+ /** The session's own clock stands before its line's present: it reads an earlier moment. */
1872
+ behind: boolean;
1873
+ }
1874
+ /**
1875
+ * 🚧 One history entry as Chronicle reads it. A history entry is dated,
1876
+ * not named: its date is its heading.
1877
+ * @experimental
1878
+ * @ruling W3
1879
+ */
1880
+ export interface HistoryEntryV1 {
1881
+ id: number;
1882
+ /** Its date: a year, and a month and a day where it has them. */
1883
+ date: StoryTime;
1884
+ /** The date spelled through the book's calendar. */
1885
+ label: string;
1886
+ /** The first line of what it says; empty when it says nothing yet. */
1887
+ firstLine: string;
1888
+ /** How many of this session's scenes are filed under it. */
1889
+ sceneCount: number;
1890
+ }
1891
+ /**
1892
+ * 🚧 One of the session's scenes under a history entry.
1893
+ * @experimental
1894
+ * @ruling W3
1895
+ */
1896
+ export interface HistorySceneV1 {
1897
+ id: number;
1898
+ /** Its name; null when it has none yet. */
1899
+ name: string | null;
1900
+ /** How many of the session's lines it holds. */
1901
+ lineCount: number;
1902
+ /**
1903
+ * Its place among the session's scenes, oldest first (from 0) — what a
1904
+ * scene's colour is chosen by.
1905
+ */
1906
+ order: number;
1907
+ /** Its summary is written. */
1908
+ summarized: boolean;
1909
+ /** It is in the lorebook's relationship graph. */
1910
+ graphed: boolean;
1911
+ /**
1912
+ * 🚧 Where its summary stands — `none` · `running` · `review` (the run
1913
+ * finished and waits for the person's Apply, §15 G8) · `done` ·
1914
+ * `failed` — read off the scene row (a scene summarized before the
1915
+ * status existed reads `done`). Absent reads as `summarized`'s answer.
1916
+ */
1917
+ summaryStatus?: 'none' | 'running' | 'review' | 'done' | 'failed';
1918
+ }
1919
+ /**
1920
+ * 🚧 The session's **open scene**, as Chronicle's *Open scene* card reads it
1921
+ * (`HistoryEntriesV1.openScene`): the scene opened at a line and not yet
1922
+ * closed, on the session's main lane. Its cast is **proposed**, no model:
1923
+ * who spoke, who the session's roster names, who the lines name — each with
1924
+ * the evidence that put them there.
1925
+ * @experimental
1926
+ * @ruling PROPOSAL-live-scenes §7 (2026-10-13)
1927
+ */
1928
+ export interface HistoryOpenSceneV1 {
1929
+ id: number;
1930
+ /** Its name; null when it has none yet. */
1931
+ name: string | null;
1932
+ /** The channel lane it runs on (`main`). */
1933
+ channel: string;
1934
+ /** The story clock as it opened, spelled through the book's calendar; empty when it opened with none. */
1935
+ since: string;
1936
+ /** How many of the session's lines it holds so far. */
1937
+ lineCount: number;
1938
+ /** Its place among the session's scenes (from 0) — its colour. */
1939
+ order: number;
1940
+ /** The proposed cast, each with its evidence ("spoke 4 times", "named twice"). */
1941
+ cast: Array<{
1942
+ name: string;
1943
+ evidence: string;
1944
+ }>;
1945
+ }
1946
+ /**
1947
+ * 🚧 What `history-entries` answers. With no lorebook (`lorebookId`
1948
+ * null) everything else is empty. A viewer who is not the session's owner
1949
+ * reads the clock alone: the history entries and scenes are the book
1950
+ * owner's (`ownerOnly`), and only the owner moves the clock.
1951
+ * @experimental
1952
+ * @ruling W3
1953
+ */
1954
+ export interface HistoryEntriesV1 {
1955
+ lorebookId: number | null;
1956
+ /** The viewer is not the session's owner: `current`, `scenes` and `earlier` are empty, and the clock is read-only. */
1957
+ ownerOnly: boolean;
1958
+ clock: StoryClockV1;
1959
+ /** The newest history entry the session reads on its line, up to its own clock; null when none. */
1960
+ current: HistoryEntryV1 | null;
1961
+ /** This session's scenes filed under `current`, oldest first. */
1962
+ scenes: HistorySceneV1[];
1963
+ /** The entries before `current`, newest first — at most `earlierLimit` of them. */
1964
+ earlier: HistoryEntryV1[];
1965
+ /** How many entries come before `current` in all. */
1966
+ earlierTotal: number;
1967
+ /** This session's scenes on its line not yet in the lorebook's relationship graph — what Extend graph reads. */
1968
+ ungraphedScenes: number;
1969
+ /** The session's genre captures scenes: **Summarize scene** is offered. */
1970
+ opensScenes: boolean;
1971
+ /** 🚧 The session's open scene on its main lane; null when none is open. Absent on a host that predates it. */
1972
+ openScene?: HistoryOpenSceneV1 | null;
1973
+ /**
1974
+ * 🚧 When this session's scenes are summarized (its scene settings):
1975
+ * `onClose`, `onRequest` or `never` — under `never`, no *Summarize* is
1976
+ * offered. Absent reads as `onRequest`.
1977
+ */
1978
+ summaryMode?: SceneSummaryMode;
1979
+ /** 🚧 This session's closed scenes whose summary has not run, or failed — **Summarize all (N)**. */
1980
+ unsummarizedScenes?: number;
1147
1981
  }
1148
1982
  /**
1149
1983
  * 🚧 The session's author's note, as stored (2026-10-02, AN1) — the value of
@@ -1211,22 +2045,44 @@ export interface SessionEntryV1 {
1211
2045
  lastRank: number | null;
1212
2046
  }
1213
2047
  /**
1214
- * 🚧 Who a host answers a request kind for — its **askers** (F9):
2048
+ * 🚧 Who a host answers a request kind for — its **askers**:
1215
2049
  *
1216
2050
  * - `'any'` — any widget's, core's or a plugin's. The host still applies
1217
2051
  * its own rules (an admin's view, an image off the app's origin).
1218
- * - `'core'` — core's own widgets only: a verb that acts as the viewer
1219
- * (sends, writes, marks), which a plugin's widget does through its own
1220
- * actions instead.
2052
+ * - `'core'` — core's own widgets only: a verb that acts on the session's
2053
+ * structure (a turn, a summary, a proposal, the lore), which a plugin's
2054
+ * widget does through its own actions instead.
1221
2055
  * - `{ scope }` — core's, or a plugin's widget GRANTED that scope (reviewed
1222
2056
  * as `widget:<scope>`, carried as the bare scope): a request that READS
1223
2057
  * scoped data, so the scope that would have pushed it is what lets a
1224
2058
  * widget page it.
2059
+ * - `{ scope, write: true }` — core's, or a plugin's widget holding the
2060
+ * **write grant** on that scope ({@link WidgetWriteGrant}): a request that
2061
+ * CHANGES what the scope covers, as the viewer. A write grant is a
2062
+ * permission apart from the read — `session:state:write` beside
2063
+ * `session:state` — so an admin who granted the read is asked once more.
2064
+ * `scope: 'channel'` is the channel the request writes to, which must be
2065
+ * one of the widget's declared `channels`, written `channel:<slug>:write`.
2066
+ * A host holds a plugin's write to a person's press behind it as well.
1225
2067
  * @experimental
2068
+ * @ruling F9
1226
2069
  */
1227
2070
  export type WidgetRequestAskers = 'any' | 'core' | {
1228
2071
  scope: WidgetSectionScope;
2072
+ write?: never;
2073
+ } | {
2074
+ scope: WidgetSectionScope | 'channel';
2075
+ write: true;
1229
2076
  };
2077
+ /**
2078
+ * 🚧 A **write grant** as a widget's grants carry it — BARE, like the read
2079
+ * (`session:state:write`, `channel:main:write`), and reviewed as the
2080
+ * permission `widget:<it>` (`widget:session:state:write`). A widget asks for
2081
+ * one in its declaration's `scopes`. Not a scope of its own: it pushes no
2082
+ * section, and holding it never grants the read.
2083
+ * @experimental
2084
+ */
2085
+ export type WidgetWriteGrant = `${WidgetSectionScope}:write` | `channel:${string}:write`;
1230
2086
  /**
1231
2087
  * The askers of every request kind — the marking a host enforces
1232
2088
  * ({@link widgetRequestRefusal}). Typed off {@link WidgetRequests}, so a kind
@@ -1242,38 +2098,49 @@ export declare const WIDGET_REQUEST_KINDS: readonly WidgetRequestKind[];
1242
2098
  * Why a host must decline this request from this widget, as a sentence — or
1243
2099
  * null when {@link WIDGET_REQUEST_ASKERS} lets it ask. `owner` is `'core'` or
1244
2100
  * the widget's plugin id; `grants` the scopes that widget was granted, as
1245
- * BARE scopes (`'lore'`, `'session:state'`) — never the permission keys they
1246
- * are reviewed as (`'widget:lore'`), which match nothing here. Core's widgets
1247
- * hold every scope. A request is still not a grant: null means the host MAY
1248
- * answer, never that it must. Grants that are not a list — a stored string,
1249
- * whose `includes` would match a substring — grant nothing.
2101
+ * BARE scopes (`'lore'`, `'session:state'`, a write grant
2102
+ * `'session:state:write'`) — never the permission keys they are reviewed as
2103
+ * (`'widget:lore'`), which match nothing here. Core's widgets hold every
2104
+ * scope. A request is still not a grant: null means the host MAY answer,
2105
+ * never that it must. Grants that are not a list — a stored string, whose
2106
+ * `includes` would match a substring — grant nothing.
2107
+ *
2108
+ * A channel write (`send`, `draft`) is judged against `channels`, the
2109
+ * widget's declared channels, and `params.channel` when the request names
2110
+ * one: a channel the widget did not declare is refused whatever it holds.
2111
+ * A request naming none passes when the widget may write one of its
2112
+ * channels, and the HOST holds it to one of those (the composer's channel,
2113
+ * for a draft). A host also holds a plugin's write to a person's press.
1250
2114
  * @experimental
1251
2115
  */
1252
2116
  export declare function widgetRequestRefusal(kind: string, from: {
1253
2117
  owner: string;
1254
2118
  grants?: readonly string[];
1255
- }): string | null;
2119
+ channels?: readonly string[];
2120
+ }, params?: unknown): string | null;
1256
2121
  /** What rides beside an invocation: the subject message, entered values. @experimental */
1257
2122
  export interface WidgetInvokeArgs {
1258
2123
  messageId?: number;
1259
2124
  payload?: WidgetPayload;
1260
2125
  /**
1261
- * The form the press answers — a block's id within `messageId` (R-15
1262
- * *Forms*) — so the server reads the block off the row and holds the press
2126
+ * The form the press answers — a block's id within `messageId` —
2127
+ * so the server reads the block off the row and holds the press
1263
2128
  * to its addressee. Absent on every other press.
1264
2129
  *
1265
2130
  * The `invoke` spelling of {@link WidgetVerbs.action}'s fifth argument: a
1266
2131
  * widget drawing a message's form presses it by the declaration's identity
1267
2132
  * like any other action, and the block it answers rides here rather than
1268
2133
  * forcing that one press back onto the deprecated verb.
2134
+ * @ruling R-15 *Forms*
1269
2135
  */
1270
2136
  blockId?: string;
1271
2137
  /**
1272
- * The text the press already supplies (lair pass S2): the composer's
2138
+ * The text the press already supplies: the composer's
1273
2139
  * **slash argument**, `/nudge go north` → `go north`. The host hands it
1274
2140
  * to an action that collects text, as if the collect modal had — and
1275
2141
  * refuses the press, firing nothing, when the action collects none. An
1276
2142
  * action that also collects recipients still opens its modal, prefilled.
2143
+ * @ruling lair pass S2
1277
2144
  */
1278
2145
  text?: string;
1279
2146
  }
@@ -1286,6 +2153,7 @@ export interface WidgetInvokeArgs {
1286
2153
  * narrowing. A kind core does not ship is spelled `custom:<whatever>`, which
1287
2154
  * can never collide with a member added here later.
1288
2155
  * @experimental
2156
+ * @ruling R56, R81, W3 (2026-10-11)
1289
2157
  */
1290
2158
  export type WidgetEvent = {
1291
2159
  kind: 'message:created';
@@ -1377,7 +2245,7 @@ export type WidgetEvent = {
1377
2245
  layout: LayoutV1;
1378
2246
  }
1379
2247
  /**
1380
- * A package's event was recorded in this session (R56) — everything in the
2248
+ * A package's event was recorded in this session — everything in the
1381
2249
  * session hears it, so every widget does. `event` is its id (compare with
1382
2250
  * the declaration: `e.event === guessed.id`); `payload` is what the
1383
2251
  * recording wrote; `at` the instant it was recorded. Names no channel: an
@@ -1391,7 +2259,7 @@ export type WidgetEvent = {
1391
2259
  at: number;
1392
2260
  }
1393
2261
  /**
1394
- * 🚧 A turn in this session ranked its lore (R81): what the rankings made
2262
+ * 🚧 A turn in this session ranked its lore: what the rankings made
1395
2263
  * of the session's lore entries was written — the rollup `session-entries`
1396
2264
  * reads moved — so a lore reader asks again now, and only now. Carries
1397
2265
  * nothing: the rows are the request's. Sent after the write, never before
@@ -1426,6 +2294,17 @@ export type WidgetEvent = {
1426
2294
  | {
1427
2295
  kind: 'genreFields:changed';
1428
2296
  }
2297
+ /**
2298
+ * 🚧 The session's story moved (Chronicle): its story
2299
+ * clock or its line (a pipeline step, the session's settings, a widget),
2300
+ * a history entry of its book was added or changed, or one of its scenes
2301
+ * was captured, changed or removed. A widget showing where the session
2302
+ * stands asks again (`history-entries`); carries nothing. Scoped like
2303
+ * `lore:ranked` ({@link WIDGET_EVENT_SCOPES}); names no channel.
2304
+ */
2305
+ | {
2306
+ kind: 'story:moved';
2307
+ }
1429
2308
  /** Anything core does not ship. Namespaced so it cannot shadow a member. */
1430
2309
  | {
1431
2310
  kind: `custom:${string}`;
@@ -1434,12 +2313,13 @@ export type WidgetEvent = {
1434
2313
  /** Every event kind a widget may subscribe to, the custom namespace included. @experimental */
1435
2314
  export type WidgetEventKind = WidgetEvent['kind'];
1436
2315
  /**
1437
- * 🚧 The scope a widget must hold to HEAR an event kind (R81) — a kind not
2316
+ * 🚧 The scope a widget must hold to HEAR an event kind — a kind not
1438
2317
  * listed is heard by every widget its channel reaches. An event about scoped
1439
2318
  * data is scoped data: a widget that may not read the lore is not told when
1440
2319
  * it moved. Read by {@link widgetEventHeard}, which every host delivery of
1441
2320
  * widget events asks.
1442
2321
  * @experimental
2322
+ * @ruling R81
1443
2323
  */
1444
2324
  export declare const WIDGET_EVENT_SCOPES: {
1445
2325
  readonly [K in WidgetEventKind]?: WidgetSectionScope;
@@ -1464,42 +2344,55 @@ export interface WidgetVerbs {
1464
2344
  * @deprecated Use {@link WidgetVerbs.invoke}. A press names a DECLARATION
1465
2345
  * by its identity: a bare key is resolved by the server to the genre's
1466
2346
  * sole declarer of it and refused — naming the identities — when several
1467
- * specs declare it (plans/31 V2). Accepted for one release; `invoke`
2347
+ * specs declare it. Accepted for one release; `invoke`
1468
2348
  * resolves the identity for you.
1469
2349
  *
1470
2350
  * `action` is the identity of the declaration being fired
1471
2351
  * (`<spec slug>#<key>`) when one is in hand — `invoke` always supplies it —
1472
2352
  * so the server checks THAT action's audience and enablement and runs THAT
1473
2353
  * spec.
2354
+ * @ruling plans/31 V2
1474
2355
  */
1475
2356
  action(fn: string, messageId?: number, payload?: WidgetPayload, action?: string,
1476
2357
  /**
1477
- * The form the press answers — a block's id within `messageId` (R-15
1478
- * *Forms*) — so the server reads the block off the row and holds the
2358
+ * The form the press answers — a block's id within `messageId` —
2359
+ * so the server reads the block off the row and holds the
1479
2360
  * press to its addressee. Absent on every other press.
2361
+ * @ruling R-15 *Forms*
1480
2362
  */
1481
2363
  blockId?: string): void;
1482
2364
  /**
1483
2365
  * Fire an action from `actions.v1` by its **identity** (`<spec slug>#<key>`)
1484
- * or, when only one action carries it, its bare **key** (R-15
1485
- * `invoke(id, args)`): the host resolves it to the declaration and routes it
2366
+ * or, when only one action carries it, its bare **key**:
2367
+ * the host resolves it to the declaration and routes it
1486
2368
  * — one of core's verbs to the host's real handler (an `extend` is an
1487
2369
  * extend, never a function fire), a contributed one to the audited fire
1488
2370
  * with its identity. A key no venue lists, or a bare key several actions
1489
2371
  * share, throws: a widget cannot fire something the session does not offer —
1490
2372
  * or something ambiguous — and believe it did.
2373
+ * @ruling R-15 `invoke(id, args)`
1491
2374
  */
1492
2375
  invoke(key: string, args?: WidgetInvokeArgs): void;
1493
2376
  /** Ask the host for something ({@link WidgetRequests}); rejects when it declines. */
1494
2377
  request<K extends WidgetRequestKind>(kind: K, params: WidgetRequests[K]['params']): Promise<WidgetRequests[K]['result']>;
1495
2378
  /**
1496
- * 🚧 The viewer's translation of an English UI string (C0b) — synchronous,
2379
+ * 🚧 The viewer's translation of an English UI string — synchronous,
1497
2380
  * the source itself until a translation arrives, then re-rendered. For
1498
2381
  * a widget's OWN literals; declared text (a label, a title) is a locale
1499
2382
  * map read with `i18nText(text, locale.v1)`.
2383
+ * @ruling C0b
1500
2384
  */
1501
2385
  t(source: string): string;
1502
- /** Host-rendered menu; resolves to the pick, or null if dismissed. */
2386
+ /**
2387
+ * ⏳ RETIRED 2026-10-10.
2388
+ * REMOVE in 0.7.0. A host-rendered menu at a point: no host ever drew
2389
+ * one, and every host answers `null` (dismissed) at once. Kept, still
2390
+ * answering `null`, so a widget that calls it does not break before
2391
+ * 0.7.0. No frame message carries it.
2392
+ * @deprecated Place an `sp-menu` (or an `sp-popover`) in your component;
2393
+ * the page draws it with its own controls.
2394
+ * @ruling PLAN-widget-system-consolidation C4
2395
+ */
1503
2396
  menu(spec: MenuSpec): Promise<MenuResult | null>;
1504
2397
  /**
1505
2398
  * Subscribe to a host event; returns an unsubscribe.