@serene-pub/sdk 0.6.0-pr-2 → 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 +24 -20
  2. package/dist/actions.d.ts +150 -68
  3. package/dist/actions.js +90 -36
  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 +195 -96
  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 +5 -4
  74. package/dist/identity.js +5 -4
  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 +103 -41
  136. package/dist/shapes.js +105 -40
  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/events.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * The event registry (01 §8 / F8, 13 §7 and §7g).
2
+ * The event registry.
3
3
  *
4
4
  * No node emits: a write causes the event its outlet declares. Core's events are a
5
5
  * closed set; a package declares its own with `defineSessionEvent()` and records one
@@ -17,8 +17,9 @@
17
17
  * mappings, so it participates in the write → event → subscription cycle check.
18
18
  * An *action* event says someone asked — a click, a scheduler tick. It has no write
19
19
  * targets, so it drops out of the cycle graph instead of needing an exception.
20
- * Without the distinction, `ui-action` would either blur F8's "occurrences core
20
+ * Without the distinction, `ui-action` would either blur "occurrences core
21
21
  * observes" or need a special case in the CTE.
22
+ * @ruling 01 §8 / F8, 13 §7 and §7g
22
23
  */
23
24
  import type { ShapeId } from './shapes.js';
24
25
  import type { RunLineage } from './executor.js';
@@ -30,31 +31,39 @@ export type EventFamily = 'data' | 'action';
30
31
  export interface EventDef {
31
32
  /** Autoincrement in core; opaque here. Never the reference used to sync. */
32
33
  id: number;
33
- /** Unique, PK-agnostic, stable across instances and upgrades (13 §7g). */
34
+ /**
35
+ * Unique, PK-agnostic, stable across instances and upgrades.
36
+ * @ruling 13 §7g
37
+ */
34
38
  slug: string;
35
39
  version: number;
36
40
  family: EventFamily;
37
- /** Does firing this touch a user's account or assets? Drives consent (11 §4). */
41
+ /**
42
+ * Does firing this touch a user's account or assets? Drives consent.
43
+ * @ruling 11 §4
44
+ */
38
45
  affectsUser: boolean;
39
46
  /** Data events only: the consumer targets whose writes cause this event. */
40
47
  causedBy?: string[];
41
48
  /**
42
- * A **declared root** (PLAN-turn-order §B3, C28): the event starts from
49
+ * A **declared root**: the event starts from
43
50
  * outside every pipeline — a person or the host does it — so it needs no
44
51
  * `causedBy`. A genre may list an event only if it is caused or a declared
45
52
  * root. Distinct from the event map's computed `root` (no `causes` edge
46
53
  * in): `message-respond` is a declared root the auto-advance listener
47
54
  * also causes.
55
+ * @ruling PLAN-turn-order §B3, C28
48
56
  */
49
57
  declaredRoot?: true;
50
58
  /**
51
- * The shape of what a listener receives (R-15, 2026-09-16). A shape id,
59
+ * The shape of what a listener receives. A shape id,
52
60
  * on the same terms as a port's: `pipeline_event_registry.payload_shape`
53
61
  * projects it, and the field-by-field account lives on the payload
54
62
  * interface the id names (`SessionChangePayload` for
55
63
  * `core:shape/session-change@1`). Optional so an event whose payload is
56
64
  * still the description's prose (`ui-action`, `schedule-tick`) registers
57
65
  * as it always did.
66
+ * @ruling R-15 (2026-09-16)
58
67
  */
59
68
  payload?: ShapeId;
60
69
  /**
@@ -94,25 +103,28 @@ export declare const notADeclaredEvent: (id: string) => string;
94
103
  /** @internal */
95
104
  export declare const allEvents: () => EventDef[];
96
105
  /**
97
- * `owner:event/name@N` — the grammar every event key wears since R-4: a
106
+ * `owner:event/name@N` — the grammar every event key wears: a
98
107
  * genre's event surface, a preset's `bindings` map and a spec's inlet lock
99
108
  * are keyed by this and nothing else. The owner segment matches the genre
100
109
  * id's (`core`, `acme.rp`); the name is lowercase-hyphenated; the version
101
110
  * is a whole number.
102
111
  * @experimental
112
+ * @ruling R-4
103
113
  */
104
114
  export declare const EVENT_ID: RegExp;
105
115
  /**
106
116
  * Is this string an event id? A bare name (`message-respond`) is not, and a
107
117
  * host that stored bare keys before the fold migrates them once — it never
108
- * accepts a new one (plans/30 §U3 review, W6).
118
+ * accepts a new one.
109
119
  * @internal
120
+ * @ruling plans/30 §U3 review, W6
110
121
  */
111
122
  export declare const isEventId: (id: string) => boolean;
112
123
  /**
113
- * The events the inter-spec cycle CTE reads (F9). Action events are excluded by
124
+ * The events the inter-spec cycle CTE reads. Action events are excluded by
114
125
  * construction rather than by an exception someone has to remember.
115
126
  * @experimental
127
+ * @ruling F9
116
128
  */
117
129
  export declare const cycleRelevantEvents: () => EventDef[];
118
130
  /** @experimental */
@@ -121,13 +133,14 @@ export declare function _clearEvents(): void;
121
133
  * An event a package declares: something that happened, recorded by a
122
134
  * pipeline's `record-event` write and heard by anything in its scope — for a
123
135
  * session event, the session's bound pipelines, plugin listeners and widgets
124
- * (R56). Declared once, globally, and passed by value wherever it is recorded
136
+ * Declared once, globally, and passed by value wherever it is recorded
125
137
  * or heard. Who may record it is the package entry's to say:
126
138
  * `defineExtension({ events })`.
127
139
  *
128
140
  * ⚠ An event is a happening, never a secret: everything in the session hears
129
141
  * its payload. Keep a secret in state, in a part whose audience is empty.
130
142
  * @experimental
143
+ * @ruling R56
131
144
  */
132
145
  export interface SessionEventDecl<Payload = unknown> {
133
146
  readonly __decl: 'session-event';
@@ -156,7 +169,8 @@ export interface RecordedEventPayload<P = unknown> {
156
169
  }
157
170
  /**
158
171
  * Declare an event your package's pipelines record. The id is under
159
- * your package's slug; the payload is a shape id, and a pipeline that records
172
+ * your package's slug; the payload is a shape id — one of core's, or one
173
+ * under your own slug (`defineShape`), which your manifest carries — and a pipeline that records
160
174
  * the event is checked against it at publish. Registered on declaration, so a
161
175
  * spec's inlet may lock on it: `.inlet('e', C.sessionEvent.v1(), { genre,
162
176
  * events: [guessed] })`.
@@ -197,9 +211,10 @@ export declare const CORE_EVENTS: {
197
211
  * A row was finished or rewritten by a pipeline's own write. A regenerate,
198
212
  * a swipe's fresh alternative and an extend are THIS event with `verb`
199
213
  * on the payload — `regenerate` · `swipe` · `extend` — rather than three
200
- * events of their own (R-15, 2026-09-16): each is the genre's pipeline
214
+ * events of their own: each is the genre's pipeline
201
215
  * producing text plus core's rewrite of the row, and the rewrite is one
202
216
  * outlet. A plain reply's finishing write carries no `verb`.
217
+ * @ruling R-15 (2026-09-16)
203
218
  */
204
219
  readonly messageUpdated: EventDef;
205
220
  readonly messageDeleted: EventDef;
@@ -207,18 +222,20 @@ export declare const CORE_EVENTS: {
207
222
  readonly messageEdited: EventDef;
208
223
  readonly messageSwiped: EventDef;
209
224
  /**
210
- * A line's **shown sprite** changed (DESIGN-sprites §5.2): a sprite picker
225
+ * A line's **shown sprite** changed: a sprite picker
211
226
  * chose one after a reply, or a person changed it from the message menu.
212
227
  * The payload names the line, the speaker, the `{ set, label }` now shown
213
228
  * (null for none) and `source` — `picker` or `person`. What TTS line
214
229
  * direction and any face-driven widget listen for.
230
+ * @ruling DESIGN-sprites §5.2
215
231
  */
216
232
  readonly spriteShown: EventDef;
217
233
  /**
218
- * Stop is not a write outlet: it is the run-level guarantee (R-17) —
234
+ * Stop is not a write outlet: it is the run-level guarantee —
219
235
  * core finalises the row a cancelled run was filling — so it has no
220
236
  * `causedBy`. Emitted by the host from that finalisation, and from the
221
237
  * message's own Stop when it releases the row first.
238
+ * @ruling R-17
222
239
  */
223
240
  readonly messageStopped: EventDef;
224
241
  readonly sessionBranched: EventDef;
@@ -250,7 +267,8 @@ export declare const CORE_EVENTS: {
250
267
  * on; it is therefore not a declared root, though a person's write also
251
268
  * starts it (as the auto-advance listener also causes `message-respond`).
252
269
  * ⚠ Never emitted by `writeTurnOrder`, which is raw SQL for exactly this
253
- * reason (§3).
270
+ * reason.
271
+ * @ruling §3
254
272
  */
255
273
  readonly sessionUpdated: EventDef;
256
274
  /**
@@ -271,24 +289,52 @@ export declare const CORE_EVENTS: {
271
289
  * rest.
272
290
  */
273
291
  readonly annexChanged: EventDef;
292
+ /**
293
+ * 🚧 The session's **backdrop** changed: a pipeline set it through
294
+ * `core:outlet/set-backdrop@1`, or a person set or cleared it from the
295
+ * Backdrop widget. The payload carries the file now shown (null when
296
+ * cleared) and the one before. ⚠ Not the app background, not a message
297
+ * attachment.
298
+ * @ruling DESIGN-image-generation §6.4, §9.4
299
+ */
300
+ readonly backdropSet: EventDef;
301
+ /**
302
+ * 🚧 Pictures were filed as a card's **sprites** by
303
+ * `core:outlet/attach-sprite@1` (the Sprite set fill). About a CARD, not a session: no session row is written, and the
304
+ * payload names the character, the sprite set, each sprite label with the
305
+ * sprite row it gained (`attached: [{ label, spriteId }]`) and the labels
306
+ * that came back with no picture (`missing`).
307
+ * @ruling DESIGN-image-generation §6.3
308
+ */
309
+ readonly spritesAttached: EventDef;
310
+ /**
311
+ * 🚧 Pictures were offered to a card's **gallery** by
312
+ * `core:outlet/offer-media@1` (Portrait).
313
+ * About a CARD, not a session: no session row is written, and the payload
314
+ * names the character and each picture placed (`offered: [{ mediaId,
315
+ * key }]`). Nothing was chosen: the avatar and likeness are untouched.
316
+ * @ruling DESIGN-image-generation §6.2
317
+ */
318
+ readonly mediaOffered: EventDef;
274
319
  /**
275
320
  * Not a write's event: the marker the `sessionChanges` list ends with when
276
- * more than fifty changes waited between two replies (U5b review S1). The
321
+ * more than fifty changes waited between two replies. The
277
322
  * newest fifty are delivered and this one entry says how many older ones
278
323
  * were not, so a pipeline can tell a full list from a truncated one. Never
279
324
  * written to `session_changes` and never on a receipt's `emitted` — no
280
325
  * `causedBy`, because no outlet causes it.
326
+ * @ruling U5b review S1
281
327
  */
282
328
  readonly sessionChangesTruncated: EventDef;
283
329
  /**
284
330
  * A **form** — a `choices` or `form` block a message carries — was
285
- * addressed to a participant the AI portrays this turn (R-15 *Forms*;
286
- * R-21 (5); 30 §U5d). Caused by the write that carried the block, and
331
+ * addressed to a participant the AI portrays this turn. Caused by the write that carried the block, and
287
332
  * dispatched through the same path as the lifecycle events, so every
288
333
  * answer run is a child of the run that asked (`parentRunId`,
289
- * `rootRunId`, `depth`) and 01 §8's cycle caps hold: a form whose answer
334
+ * `rootRunId`, `depth`) and the run tree's cycle caps hold: a form whose answer
290
335
  * asks another form stops at the depth cap, receipted. A form addressed
291
336
  * to a person is no event: the block waits for the click.
337
+ * @ruling R-15 *Forms*, R-21 (5), 30 §U5d, 01 §8
292
338
  */
293
339
  readonly formAddressed: EventDef;
294
340
  /**
@@ -299,17 +345,17 @@ export declare const CORE_EVENTS: {
299
345
  */
300
346
  readonly formAnswered: EventDef;
301
347
  /**
302
- * A form was **superseded** (plans/29 R-15 *Staleness and order*; 30
303
- * §U5f): the channel head moved past the turn it was issued at before it
348
+ * A form was **superseded**: the channel head moved past the turn it was issued at before it
304
349
  * was answered, and a press on it reached the door. Recorded ONCE per
305
350
  * block, the first time the door sees it stale, so the next reply's
306
351
  * inlet learns the question lapsed — not on every render, and never by a
307
352
  * render. No outlet causes it: the door does, like the truncation marker.
353
+ * @ruling plans/29 R-15 *Staleness and order*, 30 §U5f
308
354
  */
309
355
  readonly formSuperseded: EventDef;
310
356
  readonly loreEntryCreated: EventDef;
311
357
  /**
312
- * Two lore entries were linked (L2, 2026-09-17) — a room's exit, who keeps
358
+ * Two lore entries were linked — a room's exit, who keeps
313
359
  * what, what stands near what.
314
360
  *
315
361
  * Its own event rather than `lore-entry-created`: a link is not an entry,
@@ -318,9 +364,9 @@ export declare const CORE_EVENTS: {
318
364
  *
319
365
  * ⚠ It declares no payload shape — it rides the run's receipt as caused by
320
366
  * the outlet, and the link itself (its name, its words both ways) is the
321
- * outlet's `linkId` row, read where it is needed (places plan B2,
322
- * 2026-09-29). An idempotent repeat that found the standing row wrote
367
+ * outlet's `linkId` row, read where it is needed. An idempotent repeat that found the standing row wrote
323
368
  * nothing, and causes no event (`written: false`).
369
+ * @ruling L2 (2026-09-17), places plan B2 (2026-09-29)
324
370
  */
325
371
  readonly loreLinkCreated: EventDef;
326
372
  readonly graphProposalCreated: EventDef;
@@ -328,37 +374,42 @@ export declare const CORE_EVENTS: {
328
374
  readonly sessionCreated: EventDef;
329
375
  /** The primary turn. A swipe is this pipeline re-run, not a new event. */
330
376
  readonly messageRespond: EventDef;
331
- /** Arbitrary buttons/triggers — the contributed functions surface (19 §3). */
377
+ /**
378
+ * Arbitrary buttons/triggers — the contributed functions surface.
379
+ * @ruling 19 §3
380
+ */
332
381
  readonly sessionAction: EventDef;
333
382
  readonly memberAdded: EventDef;
334
383
  readonly memberRemoved: EventDef;
335
384
  /**
336
- * A UI action asked for a run (13 §7). Carrying both users is what answers the
385
+ * A UI action asked for a run. Carrying both users is what answers the
337
386
  * budget-owner question without a separate rule: **budget and quota attach to the
338
387
  * owner; the receipt's attribution records the trigger.** Group sessions need no
339
388
  * special case.
340
389
  *
341
390
  * ⏳ Overlaps `session-action` since the fold (a contributed action IS a UI
342
- * action). Kept because ruling 49 (`UiActionPayload`, the owner/trigger
343
- * split) has no other home yet; nothing subscribes to it. Retire when the
344
- * action model (30 §U5) gives the payload one.
391
+ * action). Kept because the owner/trigger split (`UiActionPayload`) has
392
+ * no other home yet; nothing subscribes to it. Retire when the
393
+ * action model gives the payload one.
394
+ * @ruling 13 §7, ruling 49, 30 §U5
345
395
  */
346
396
  readonly uiAction: EventDef;
347
397
  /**
348
- * The path for scheduled model work (13 §7c). No callable may call an oracle
349
- * (F32), and lifecycle callbacks may not trigger pipelines, so nightly
398
+ * The path for scheduled model work. No callable may call an oracle,
399
+ * and lifecycle callbacks may not trigger pipelines, so nightly
350
400
  * summarization subscribes here instead — which also puts it on the consent
351
401
  * screen, where a lifecycle callback doing the same work would have been
352
402
  * invisible. Serene Pub emits it hourly (`cadence: 'hourly'`, `scheduledFor`
353
403
  * the ISO instant it was due, `scope: 'pub'`), only to subscribed,
354
404
  * granted listeners; `SCHEDULED_WORK_PATH` names it.
405
+ * @ruling 13 §7c, F32
355
406
  */
356
407
  readonly scheduleTick: EventDef;
357
408
  };
358
409
  /**
359
410
  * One **session change** — the payload of every built-in write's event
360
411
  * (`core:shape/session-change@1`), and one entry of the `sessionChanges`
361
- * list the next reply's inlet publishes (R-15). The fields past `at` are per
412
+ * list the next reply's inlet publishes. The fields past `at` are per
362
413
  * event; every one is additive and a reader keys on `event` before reaching
363
414
  * for them.
364
415
  *
@@ -375,9 +426,10 @@ export declare const CORE_EVENTS: {
375
426
  * the event, the ids and the rest of the payload, so the ledger still says a
376
427
  * line was deleted without holding the line indefinitely. A run's receipt
377
428
  * keeps what the outlet published under the receipt's own retention.
429
+ * @ruling R-15
378
430
  */
379
431
  /**
380
- * Why a session event fired (PLAN-turn-order §4.1) — on every session
432
+ * Why a session event fired — on every session
381
433
  * event's payload since 2026-09-21. The auto-advance listener keys on it:
382
434
  * a `user` cause may fire the head turn, an auto `run` cause may fire the
383
435
  * next, and `edit` / `settings` / `system` never fire anything. An open
@@ -390,6 +442,7 @@ export declare const CORE_EVENTS: {
390
442
  * userId }`; settings and cast toggles → `{ kind: 'settings', userId }`;
391
443
  * boot, migration and the importer → `{ kind: 'system' }`.
392
444
  * @experimental
445
+ * @ruling PLAN-turn-order §4.1
393
446
  */
394
447
  export interface EventCause {
395
448
  /** Open string; core values: user | run | edit | settings | system. */
@@ -420,8 +473,9 @@ export interface SessionChangePayload {
420
473
  /**
421
474
  * `message-edited` and `message-swiped`: what was showing before; on
422
475
  * `message-updated` with `verb: regenerate`, the reply the regenerate
423
- * replaced (U5b review W3). `content` is nulled on the stored row once
476
+ * replaced. `content` is nulled on the stored row once
424
477
  * consumed.
478
+ * @ruling U5b review W3
425
479
  */
426
480
  previous?: {
427
481
  content: string | null;
@@ -435,6 +489,12 @@ export interface SessionChangePayload {
435
489
  verb?: 'regenerate' | 'swipe' | 'extend';
436
490
  /** `session-changes-truncated`: how many older changes the list did not carry. */
437
491
  dropped?: number;
492
+ /**
493
+ * 🚧 `backdrop-set`: the session's backdrop now, as its file id — null
494
+ * when it was cleared — and the one it replaced.
495
+ */
496
+ backdropMediaId?: number | null;
497
+ previousBackdropMediaId?: number | null;
438
498
  /** `message-stopped`: how much of the reply had arrived. */
439
499
  textLength?: number;
440
500
  /**
@@ -470,12 +530,13 @@ export interface SessionChangePayload {
470
530
  * (`character:<id>` · `persona:<id>` · `envoy:<slug>`); `change` says which
471
531
  * column, open so a host may name one this release does not. `'enabled'` is
472
532
  * the seat switched on or off (`value` is the new boolean; renamed from
473
- * `'active'` 2026-09-28, NOMENCLATURE §25).
533
+ * `'active'` 2026-09-28).
474
534
  *
475
- * `member-added` / `member-removed` carry the same payload since the modder
476
- * pass (R31): `change: 'added' | 'removed'`, so one inlet reads every seat
535
+ * `member-added` / `member-removed` carry the same payload:
536
+ * `change: 'added' | 'removed'`, so one inlet reads every seat
477
537
  * change — an envoy's included — the same way.
478
538
  * @experimental
539
+ * @ruling NOMENCLATURE §25, R31
479
540
  */
480
541
  export interface CastChangePayload {
481
542
  event: string;
@@ -489,11 +550,12 @@ export interface CastChangePayload {
489
550
  value?: unknown;
490
551
  }
491
552
  /**
492
- * The payload of `core:event/annex-changed@1` (`core:shape/annex-change@1`,
493
- * R30): which owner's annex entry changed. The value itself is not carried —
553
+ * The payload of `core:event/annex-changed@1` (`core:shape/annex-change@1`):
554
+ * which owner's annex entry changed. The value itself is not carried —
494
555
  * a spec reads it through `core:query/session-annex@1`, so the event stays
495
556
  * small and never races the row.
496
557
  * @experimental
558
+ * @ruling R30
497
559
  */
498
560
  export interface AnnexChangePayload {
499
561
  event: string;