@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/shapes.js CHANGED
@@ -1,11 +1,12 @@
1
1
  /**
2
- * Shapes — versioned edge/payload contracts (01 §1, §3).
2
+ * Shapes — versioned edge/payload contracts.
3
3
  *
4
4
  * A shape is the unit of compatibility. Two nodes connect if the upstream port's
5
5
  * shape is assignable to the downstream port's. Shapes are also connection kinds
6
- * and sampling-config kinds (F17), which is what makes the system modality-agnostic:
6
+ * and sampling-config kinds, which is what makes the system modality-agnostic:
7
7
  * nothing anywhere switches on "is this an LLM".
8
8
  * @public
9
+ * @ruling 01 §1, §3, F17
9
10
  */
10
11
  const registry = new Map();
11
12
  /** @experimental */
@@ -17,6 +18,16 @@ export function defineShape(def) {
17
18
  export function getShape(id) {
18
19
  return registry.get(id);
19
20
  }
21
+ /**
22
+ * Every registered shape, in registration order — core's and any a package
23
+ * declared in this process. The packager reads it to carry a package's own
24
+ * shapes (`<slug>:shape/…`) in the manifest, so an instance can register
25
+ * them from data before the events and ports that name them.
26
+ * @experimental
27
+ */
28
+ export function listShapes() {
29
+ return [...registry.values()];
30
+ }
20
31
  /** @experimental */
21
32
  export function isStreaming(id) {
22
33
  return registry.get(id)?.streaming === true;
@@ -37,6 +48,16 @@ export function assignable(from, to, seen = new Set()) {
37
48
  return false;
38
49
  return def.assignableTo.some((next) => assignable(next, to, seen));
39
50
  }
51
+ /**
52
+ * Withdraw one shape — a host's uninstall of the package that declared it,
53
+ * so a reinstall may declare it afresh. Never a core shape.
54
+ * @internal
55
+ */
56
+ export function _withdrawShape(id) {
57
+ if (id.startsWith('core:'))
58
+ return;
59
+ registry.delete(id);
60
+ }
40
61
  /** Reset — test isolation only. @internal */
41
62
  export function _clearShapes() {
42
63
  registry.clear();
@@ -54,12 +75,12 @@ export const S = {
54
75
  /**
55
76
  * Transcript rows — what `session-history@1` publishes on `main` and
56
77
  * `messages` and what `process-messages@1` / `prose-transcript@1` read
57
- * (declared so since 2026-09-17, U5d review W9; the port had said
78
+ * (declared so since 2026-09-17; the port had said
58
79
  * `context-candidates@1` since the SDK was vendored while the value was
59
80
  * always rows, and `validate()` never ran over the catalog to say so).
60
81
  *
61
- * **Not assignable to `context-candidates@1`** (U5d review R-a, the same
62
- * day; W9 had declared it one way). A transcript wired into a candidates
82
+ * **Not assignable to `context-candidates@1`** (decided the same day; the
83
+ * first declaration had made it one way). A transcript wired into a candidates
63
84
  * port is a wiring the host silently drops: `concat-candidates` keys a
64
85
  * row that is not a candidate as `undefined:<id>`, the ranker's `select`
65
86
  * excludes it as `excluded_unknown_source`, and `assemble` handed rows
@@ -71,19 +92,21 @@ export const S = {
71
92
  * rather than refusing, so a document built from the older corpus still
72
93
  * compiles. The reverse was never declared either: a ranked candidates
73
94
  * list is not a transcript, and a port that reads rows is handed rows.
95
+ * @ruling U5d review W9, U5d review R-a
74
96
  */
75
97
  messages: defineShape({ id: 'core:shape/messages@1' }),
76
98
  candidates: defineShape({ id: 'core:shape/context-candidates@1' }),
77
99
  renderedBlocks: defineShape({ id: 'core:shape/rendered-blocks@1' }),
78
100
  assembled: defineShape({ id: 'core:shape/assembled-context@1' }),
79
101
  /**
80
- * What Assemble publishes after the allocation/formatting split (16 §7): ordered
102
+ * What Assemble publishes after the allocation/formatting split: ordered
81
103
  * **blocks** with role, source, token count and a `why` trail — not prose. The
82
104
  * Provider's `wire` slot turns it into whatever its connection actually wants.
83
105
  *
84
106
  * Assignable to `assembled-context@1` so existing specs keep connecting while core
85
107
  * migrates; the reverse is not assignable, because a rendered string has already
86
108
  * thrown away everything the panel and the budget need.
109
+ * @ruling 16 §7
87
110
  */
88
111
  allocated: defineShape({
89
112
  id: 'core:shape/allocated-context@1',
@@ -106,11 +129,12 @@ export const S = {
106
129
  */
107
130
  sessionCast: defineShape({ id: 'core:shape/session-cast@1' }),
108
131
  /**
109
- * The MCP connection kind (14 §1). A connection whose shape is `mcp` is a
132
+ * The MCP connection kind. A connection whose shape is `mcp` is a
110
133
  * Model Context Protocol server core talks to — foreign code SP speaks
111
134
  * JSON-RPC with, never code SP loads. The shape doubles as the connection
112
- * kind (F17), so only MCP connections are offerable on an MCP provider's
135
+ * kind, so only MCP connections are offerable on an MCP provider's
113
136
  * connection slot.
137
+ * @ruling 14 §1, F17
114
138
  */
115
139
  mcp: defineShape({ id: 'core:shape/mcp@1' }),
116
140
  templateContext: defineShape({ id: 'core:shape/template-context@1' }),
@@ -118,20 +142,21 @@ export const S = {
118
142
  budget: defineShape({ id: 'core:shape/context-budget@1' }),
119
143
  rowIds: defineShape({ id: 'core:shape/row-ids@1' }),
120
144
  /**
121
- * The output of an async block or a map (01 §1, 13 §1). An ordered list in
145
+ * The output of an async block or a map. An ordered list in
122
146
  * **declaration order**, one entry per branch — never a merged object, because
123
147
  * merging needs a field-collision policy and every such policy is wrong for
124
148
  * somebody. `async` and `map` produce the same shape, so one equivalence
125
- * harness covers both (F26).
149
+ * harness covers both.
150
+ * @ruling 01 §1, 13 §1, F26
126
151
  */
127
152
  branchResults: defineShape({ id: 'core:shape/branch-results@1' }),
128
153
  /**
129
- * What a **gate-eligible** Consumer publishes (13 §7j-b). Discriminated, because
154
+ * What a **gate-eligible** Consumer publishes. Discriminated, because
130
155
  * a write may in principle land as a proposal rather than a row — and a
131
156
  * proposal id in a shared id space is indistinguishable from a real row id
132
157
  * right up until the foreign key dangles.
133
158
  *
134
- * **Assignable to `row-ids@1`** since the 2026-09-15 rulings (09-B B4, R-17).
159
+ * **Assignable to `row-ids@1`** since the 2026-09-15 rulings.
135
160
  * It was deliberately not, and the reason was the `async` review position:
136
161
  * a row proposed under it might never exist. That position is gone
137
162
  * (`review.ts` — on or off, nothing between): `on` parks the run until the
@@ -140,6 +165,7 @@ export const S = {
140
165
  * a create → update pair on one row inside one run legal, and it is how a
141
166
  * pipeline owns its reply: a placeholder outlet straight after the inlet,
142
167
  * and an `update-message` at the end that fills it.
168
+ * @ruling 13 §7j-b, 09-B B4, R-17
143
169
  */
144
170
  writeResult: defineShape({
145
171
  id: 'core:shape/write-result@1',
@@ -149,9 +175,10 @@ export const S = {
149
175
  * A request to summarize something into a lore entry.
150
176
  *
151
177
  * Its own shape rather than `json@1` because it is what the summarize
152
- * pipelines take as *input*, and 11 §2 matches an event's payload against a
178
+ * pipelines take as *input*, and core matches an event's payload against a
153
179
  * pipeline's Input contract by shape. A request typed as bare json would make
154
180
  * every pipeline compatible with every event.
181
+ * @ruling 11 §2
155
182
  */
156
183
  summarizeRequest: defineShape({ id: 'core:shape/summarize-request@1' }),
157
184
  /**
@@ -162,6 +189,19 @@ export const S = {
162
189
  * that permitted reordering would turn a narrative into a pile of events.
163
190
  */
164
191
  drafts: defineShape({ id: 'core:shape/drafts@1' }),
192
+ /**
193
+ * 🚧 A scene's transcript, rendered — one **transcript unit** per message:
194
+ * `{ messageId, text, tokens }[]`, in reading order, from
195
+ * `core:task/render-transcript@1` (live scenes, 2026-10-13).
196
+ *
197
+ * Its own shape rather than `messages@1` because a unit is already TEXT —
198
+ * the genre's transcript template has laid the line out — and the batch
199
+ * cut counts it as it stands. Every unit names the message it was
200
+ * rendered from, so a batch can always be traced back to its rows.
201
+ * Not a transcript *line* of the prompt (Assemble's `sessionMessages`):
202
+ * a unit is what a summarizer drafts from, never what a reply is sent.
203
+ */
204
+ transcriptUnits: defineShape({ id: 'core:shape/transcript-units@1' }),
165
205
  /** Scenes with their messages, as the graph builder walks them. */
166
206
  graphScenes: defineShape({ id: 'core:shape/graph-scenes@1' }),
167
207
  /**
@@ -173,19 +213,20 @@ export const S = {
173
213
  */
174
214
  graphProposal: defineShape({ id: 'core:shape/graph-proposal@1' }),
175
215
  /**
176
- * Who speaks next, and how that was decided (19 §5).
216
+ * Who speaks next, and how that was decided.
177
217
  *
178
218
  * Its own shape rather than `row-ids@1` because it is the swap-list
179
219
  * membership test: a task whose `main` publishes this shape *is* a
180
220
  * next-speaker strategy, and the dropdown is a SELECT over such rows — an
181
221
  * extension's strategy appears beside core's by existing, the same way a
182
222
  * chat mode does. The bundle carries `{speaker, characterId, strategy, via}`
183
- * — the speaker as a participant reference beside the bare id (R-18 (3)) —
223
+ * — the speaker as a participant reference beside the bare id —
184
224
  * and each rides its own port for wiring.
225
+ * @ruling 19 §5, R-18 (3)
185
226
  */
186
227
  speakerSelection: defineShape({ id: 'core:shape/speaker-selection@1' }),
187
228
  /**
188
- * A participant reference (R-15, R-18 (3)): `character:<id>`,
229
+ * A participant reference: `character:<id>`,
189
230
  * `envoy:<slug>`, `user:<id>`, or a role — see `participants.ts`.
190
231
  *
191
232
  * The inlet's `speaker` port and a turn strategy's carry this, so one
@@ -193,19 +234,21 @@ export const S = {
193
234
  * envoy alike. Not assignable to `row-ids@1` on purpose: a reference is a
194
235
  * name, and a node that wants the bare character id keeps reading
195
236
  * `characterId` until every reader speaks references.
237
+ * @ruling R-15, R-18 (3)
196
238
  */
197
239
  participantRef: defineShape({ id: 'core:shape/participant-ref@1' }),
198
240
  /**
199
- * An ordered list of participant references, no duplicates (lair pass R3,
200
- * 2026-09-28): the inlet's `recipients` — the cast members a press
241
+ * An ordered list of participant references, no duplicates: the inlet's
242
+ * `recipients` — the cast members a press
201
243
  * collected (`CollectedRecipients`). Its own id rather than `json@1` so a
202
244
  * port that wants people is not handed any list. Consumed by
203
- * `core:query/resolve-state-changes@1`'s `owners` (R10): the Whisper's
245
+ * `core:query/resolve-state-changes@1`'s `owners`: the Whisper's
204
246
  * one change, made on each recipient.
247
+ * @ruling lair pass R3 (2026-09-28), R10
205
248
  */
206
249
  participantRefs: defineShape({ id: 'core:shape/participant-refs@1' }),
207
250
  /**
208
- * One **session change** (R-15, built 2026-09-16): the payload every
251
+ * One **session change** (built 2026-09-16): the payload every
209
252
  * built-in write's event carries — `{ event, sessionId, messageId, at,
210
253
  * … }` plus what was lost or replaced (`lost` on a delete, `previous` on
211
254
  * an edit or a swipe). The next reply's inlet publishes the changes since
@@ -215,90 +258,99 @@ export const S = {
215
258
  * Its own id rather than `json@1`, for the reason `summarize-request@1`
216
259
  * gives: `pipeline_event_registry.payload_shape` names it, and an event
217
260
  * whose payload was bare json would match every inlet.
261
+ * @ruling R-15
218
262
  */
219
263
  sessionChange: defineShape({ id: 'core:shape/session-change@1' }),
220
264
  /**
221
- * A **form addressed** to a participant the AI portrays (R-15 *Forms*;
222
- * 30 §U5d): the payload of `core:event/form-addressed@1` — `{ sessionId,
265
+ * A **form addressed** to a participant the AI portrays: the payload of
266
+ * `core:event/form-addressed@1` — `{ sessionId,
223
267
  * messageId, blockId, action, addressee }` (`FormAddressedPayload`,
224
268
  * events.ts) — and what `core:inlet/form-addressed@1` publishes, port by
225
269
  * port, with the block itself beside them. Its own id for the reason
226
270
  * `session-change@1` has: the registry's `payload_shape` names it.
271
+ * @ruling R-15 *Forms*, 30 §U5d
227
272
  */
228
273
  formAddressed: defineShape({ id: 'core:shape/form-addressed@1' }),
229
274
  /**
230
- * A **cast change** (PLAN-turn-order §4.1): the payload of
275
+ * A **cast change**: the payload of
231
276
  * `core:event/cast-changed@1` — `{ event, sessionId, at, cause, ref,
232
277
  * change, value }` (`CastChangePayload`, events.ts). A seated
233
278
  * participant was switched on or off, or its `position` or portrayal moved;
234
279
  * a seat added or removed is `member-added` / `member-removed`, not
235
280
  * this. Its own id for the reason `session-change@1` has.
281
+ * @ruling PLAN-turn-order §4.1
236
282
  */
237
283
  castChange: defineShape({ id: 'core:shape/cast-change@1' }),
238
284
  /**
239
- * **Annex changed** (PLAN-turn-order §4.14, R30): the payload of
285
+ * **Annex changed**: the payload of
240
286
  * `core:event/annex-changed@1` — `{ event, sessionId, at, cause, owner }`
241
287
  * (`AnnexChangePayload`, events.ts). Names whose entry moved, never the
242
288
  * value.
289
+ * @ruling PLAN-turn-order §4.14, R30
243
290
  */
244
291
  annexChange: defineShape({ id: 'core:shape/annex-change@1' }),
245
292
  /** What a listener receives for an event a pipeline recorded: the envelope, the author's payload inside. */
246
293
  recordedEvent: defineShape({ id: 'core:shape/recorded-event@1' }),
247
294
  /**
248
- * **Turn order changed** (§4.1): the payload of
295
+ * **Turn order changed**: the payload of
249
296
  * `core:event/turn-order-changed@1` — `{ event, sessionId, at, cause,
250
297
  * runId, turnOrder }` (`TurnOrderChangedPayload`, events.ts), the
251
298
  * document as `core:outlet/set-turn-order@1` wrote it. Core-internal:
252
299
  * the auto-advance listener and the `sessions:turnOrder` push read it;
253
300
  * a genre may not bind a spec to it.
301
+ * @ruling §4.1
254
302
  */
255
303
  turnOrderChanged: defineShape({ id: 'core:shape/turn-order-changed@1' }),
256
304
  /**
257
- * The session's **turn order** as state (§4.2): `TurnOrderV1` —
305
+ * The session's **turn order** as state: `TurnOrderV1` —
258
306
  * `{ v, order, candidates, basedOnAt, computedAt, runId, event,
259
307
  * strategy }`, stored at `sessions.metadata.turnOrder` and written by
260
308
  * `core:outlet/set-turn-order@1` alone. Not the entries alone and not
261
309
  * the candidates alone: the whole answer, with what it answered.
310
+ * @ruling §4.2
262
311
  */
263
312
  turnOrder: defineShape({ id: 'core:shape/turn-order@1' }),
264
313
  /**
265
- * **Turn candidates** (§4.2): `TurnCandidateV1[]` — the participants the
314
+ * **Turn candidates**: `TurnCandidateV1[]` — the participants the
266
315
  * pool admitted this run, in pool order. What `core:task/turn-pool@1`
267
316
  * publishes, an orderer rewrites, and a strategy reads. Open objects:
268
317
  * an orderer or a plugin may add keys and core passes them through.
318
+ * @ruling §4.2
269
319
  */
270
320
  turnCandidates: defineShape({ id: 'core:shape/turn-candidates@1' }),
271
321
  /**
272
- * **Turn entries** (§4.2): `TurnEntryV1[]` — prepared turns, each
322
+ * **Turn entries**: `TurnEntryV1[]` — prepared turns, each
273
323
  * `{ ref, channel?, subject?, via }`. What a strategy publishes on
274
324
  * `main` and `order`; the shape-based swap list keys a strategy on it,
275
325
  * as it keyed one on `speaker-selection@1` before (that shape stays
276
326
  * until the strategies are re-ported).
327
+ * @ruling §4.2
277
328
  */
278
329
  turnEntries: defineShape({ id: 'core:shape/turn-entries@1' }),
279
330
  /**
280
- * **Sprite choices** (DESIGN-sprites §5.2): what a line's speaker can show
281
- * — `{ characterId, set, defaultSet, labels, last, decidedBy, text }`.
331
+ * **Sprite choices**: what a line's speaker can show
332
+ * — `{ characterId, set, defaultSet, labels, last, recent, decidedBy }`.
282
333
  * `set` is the sprite set in force for the line (a session override, the
283
334
  * cast member's amendment, or the card's default — `decidedBy` says
284
335
  * which); `labels` are that set's sprite labels with an image; `last` is
285
336
  * the speaker's previous shown sprite, for stickiness. What
286
- * `core:query/sprites-for@1` publishes and every sprite picker reads.
337
+ * `core:oracle/pick-sprite@1` publishes beside its pick, for the receipt.
338
+ * @ruling DESIGN-sprites §5.2
287
339
  */
288
340
  spriteChoices: defineShape({ id: 'core:shape/sprite-choices@1' }),
289
341
  /**
290
342
  * **A sprite pick**: `{ set, label, score?, runnerUp?, held? } | null` — the
291
- * sprite a picker chose for a line, or null for none. What every sprite
292
- * picker publishes on `main`, so the shape-based swap list keys a picker on
293
- * it exactly as it keys a turn strategy on `turn-entries@1`.
343
+ * sprite a picker chose for a line, or null for none. What the sprite
344
+ * picker publishes on `main` and `core:outlet/show-sprite@1` records.
294
345
  */
295
346
  spritePick: defineShape({ id: 'core:shape/sprite-pick@1' }),
296
347
  /**
297
- * The **settings document** (§4.12): `SessionSettingsV1` — every
348
+ * The **settings document**: `SessionSettingsV1` — every
298
349
  * setting a person can see in session settings, resolved once per run
299
350
  * with the cascade applied (session > genre > core), and handed to the
300
351
  * inlet as `session`. A spec reads `$.input.session.fields.tone` and
301
352
  * never learns which table it came from.
353
+ * @ruling §4.12
302
354
  */
303
355
  sessionSettings: defineShape({ id: 'core:shape/session-settings@1' }),
304
356
  /**
@@ -315,19 +367,31 @@ export const S = {
315
367
  * as its attachments. */
316
368
  mediaList: defineShape({ id: 'core:shape/media-refs@1' }),
317
369
  /**
318
- * 🚧 **A transcript's attachments, by message** (PLAN-composer-attachments
319
- * §3.5): `Record<messageId, HistoryAttachmentV1[]>` (media.ts) — each
370
+ * 🚧 **An image series**: `ImageSeriesItemV1[]` (media.ts) — the pictures
371
+ * one image step is asked for, each `{ key, vars }`. The prompt rows
372
+ * render once per item with `vars` in scope; every media item the step
373
+ * returns carries the `key` of the item it was drawn for. A spec says
374
+ * WHAT pictures it wants; how many calls that costs is the host's packing,
375
+ * never the spec's. Absent on the port = one item, key `"1"`.
376
+ * @ruling DESIGN-image-generation §4.7
377
+ */
378
+ imageSeries: defineShape({ id: 'core:shape/image-series@1' }),
379
+ /**
380
+ * 🚧 **A transcript's attachments, by message**:
381
+ * `Record<messageId, HistoryAttachmentV1[]>` (media.ts) — each
320
382
  * message's `core:image` / `core:file` parts, in part order. What
321
383
  * `core:query/history-attachments@1` publishes and
322
384
  * `core:task/place-attachments@1` reads, so each line's files travel with
323
385
  * that line's own turn rather than with the request as a whole.
386
+ * @ruling PLAN-composer-attachments §3.5
324
387
  */
325
388
  mediaByMessage: defineShape({ id: 'core:shape/media-by-message@1' }),
326
389
  /**
327
- * A reply's **folded sections** (B4; D5, 2026-09-27): `FoldedSectionV1[]`
390
+ * A reply's **folded sections**: `FoldedSectionV1[]`
328
391
  * (widgets.ts) — each `{ kind, label, content }` or `{ kind, label, items }`,
329
392
  * shown collapsed beside the body and never read into the prompt. What the
330
393
  * message outlets' `sections` in-port takes.
394
+ * @ruling B4, D5 (2026-09-27)
331
395
  */
332
396
  foldedSections: defineShape({ id: 'core:shape/folded-sections@1' }),
333
397
  audio: defineShape({
@@ -340,10 +404,11 @@ export const S = {
340
404
  }),
341
405
  json: defineShape({ id: 'core:shape/json@1' }),
342
406
  /**
343
- * What a ranker judged (PLAN-sdk-1.0 §3.9, R64): one `RankingDecisionV1`
407
+ * What a ranker judged: one `RankingDecisionV1`
344
408
  * per candidate. A node whose out-port carries this shape is RECORDED by
345
409
  * the host — core's rankers and a plugin's alike — into the ranking store.
346
- * Reviewed with L1 (PLAN-sdk-1.0 §4 ✓); it carries `S`'s own tag.
410
+ * It carries `S`'s own tag.
411
+ * @ruling PLAN-sdk-1.0 §3.9, R64, L1, PLAN-sdk-1.0 §4 ✓
347
412
  */
348
413
  decisions: defineShape({ id: 'core:shape/decisions@1' }),
349
414
  // connection / sampling kinds — the same ids, which is the point (F17)
package/dist/sheets.d.ts CHANGED
@@ -28,13 +28,14 @@
28
28
  * any other, which is why the union a genre computes preserves the order rather
29
29
  * than sorting it.
30
30
  *
31
- * ⚠ **Not a layout sheet.** §26 uses *sheet* for what a side zone becomes below
31
+ * ⚠ **Not a layout sheet.** The shell layout uses *sheet* for what a side zone becomes below
32
32
  * `roomy`, and *More sheet* for the mobile overflow; those are places on a
33
33
  * screen. Prose says the qualified word — *attribute sheet* — exactly as it
34
34
  * does for an attribute slot, and the exported API says it too.
35
35
  *
36
36
  * ⚠ Never an *attachment* (that is a message part) and never a *template*
37
37
  * (taken three times over already).
38
+ * @ruling §26
38
39
  */
39
40
  import type { I18n } from './descriptors.js';
40
41
  import { type AttributeSlotDecl, type SlotAppliesTo, type SlotConfig, type SlotId, type SlotOrigin, type SlotValue } from './attributes.js';
@@ -155,11 +156,12 @@ export declare function retireAttributeSheet(id: SheetId): AttributeSheetDecl;
155
156
  /** The reverse of `retireAttributeSheet`, with the same `stored`-only rule. @experimental */
156
157
  export declare function reviveAttributeSheet(id: SheetId): AttributeSheetDecl;
157
158
  /**
158
- * The display-text findings of one sheet declaration (R-20): a sheet is
159
+ * The display-text findings of one sheet declaration: a sheet is
159
160
  * offered by its `label`, so the label is required; the `description` is what
160
161
  * a person reads under the offer. Run by the code door here and by the host's
161
162
  * **write** door for an authored sheet, never by a reload.
162
163
  * @experimental
164
+ * @ruling R-20
163
165
  */
164
166
  export declare function attributeSheetDisplayFindings(id: SheetId, props: AttributeSheetProps): string[];
165
167
  //# sourceMappingURL=sheets.d.ts.map
package/dist/sheets.js CHANGED
@@ -28,13 +28,14 @@
28
28
  * any other, which is why the union a genre computes preserves the order rather
29
29
  * than sorting it.
30
30
  *
31
- * ⚠ **Not a layout sheet.** §26 uses *sheet* for what a side zone becomes below
31
+ * ⚠ **Not a layout sheet.** The shell layout uses *sheet* for what a side zone becomes below
32
32
  * `roomy`, and *More sheet* for the mobile overflow; those are places on a
33
33
  * screen. Prose says the qualified word — *attribute sheet* — exactly as it
34
34
  * does for an attribute slot, and the exported API says it too.
35
35
  *
36
36
  * ⚠ Never an *attachment* (that is a message part) and never a *template*
37
37
  * (taken three times over already).
38
+ * @ruling §26
38
39
  */
39
40
  import { i18nFindings } from './i18n.js';
40
41
  import { refuseUnlessIdentical } from './hash.js';
@@ -177,11 +178,12 @@ export function reviveAttributeSheet(id) {
177
178
  return next;
178
179
  }
179
180
  /**
180
- * The display-text findings of one sheet declaration (R-20): a sheet is
181
+ * The display-text findings of one sheet declaration: a sheet is
181
182
  * offered by its `label`, so the label is required; the `description` is what
182
183
  * a person reads under the offer. Run by the code door here and by the host's
183
184
  * **write** door for an authored sheet, never by a reload.
184
185
  * @experimental
186
+ * @ruling R-20
185
187
  */
186
188
  export function attributeSheetDisplayFindings(id, props) {
187
189
  return [
@@ -197,9 +199,10 @@ function assertDisplayText(id, props) {
197
199
  }
198
200
  /**
199
201
  * A stored row reloading at boot is never refused for its display text (ruled
200
- * 2026-09-17, U5i review): the offending field is dropped and a warning names
202
+ * 2026-09-17): the offending field is dropped and a warning names
201
203
  * the row — a sheet with no readable label is listed by its id, and a sheet
202
204
  * that vanished from every boot would be the worse answer.
205
+ * @ruling U5i review
203
206
  */
204
207
  function withDisplayTextTolerated(id, props) {
205
208
  const findings = attributeSheetDisplayFindings(id, props);
@@ -9,7 +9,7 @@
9
9
  * inline (ruled 2026-09-25: stat shapes are the field language, and core
10
10
  * SEEDS a catalogue of common ones so stats stay predictable). Core's
11
11
  * catalogue is declared in `@serene-pub/core-catalog` through this file's
12
- * door, like anybody's would be (R26).
12
+ * door, like anybody's would be.
13
13
  *
14
14
  * ## Open in the declaration, closed in the behaviour
15
15
  *
@@ -27,6 +27,7 @@
27
27
  *
28
28
  * ⚠ Lore entry types keep their own fixed shapes (`entryShape`); a stat
29
29
  * shape describes a value an owner holds, never a lorebook row.
30
+ * @ruling R26
30
31
  */
31
32
  import type { I18n } from './descriptors.js';
32
33
  import type { FieldDecl } from './settings.js';
@@ -9,7 +9,7 @@
9
9
  * inline (ruled 2026-09-25: stat shapes are the field language, and core
10
10
  * SEEDS a catalogue of common ones so stats stay predictable). Core's
11
11
  * catalogue is declared in `@serene-pub/core-catalog` through this file's
12
- * door, like anybody's would be (R26).
12
+ * door, like anybody's would be.
13
13
  *
14
14
  * ## Open in the declaration, closed in the behaviour
15
15
  *
@@ -27,6 +27,7 @@
27
27
  *
28
28
  * ⚠ Lore entry types keep their own fixed shapes (`entryShape`); a stat
29
29
  * shape describes a value an owner holds, never a lorebook row.
30
+ * @ruling R26
30
31
  */
31
32
  import { i18nFindings } from './i18n.js';
32
33
  import { refuseUnlessIdentical } from './hash.js';
package/dist/status.d.ts CHANGED
@@ -1,17 +1,17 @@
1
1
  /**
2
- * Statuses (plans/29 R-19, R-21; 09-B B11) — what a node says it is doing,
2
+ * Statuses — what a node says it is doing,
3
3
  * from inside its execution.
4
4
  *
5
5
  * `ctx.status({ i18n, vars })` is callable at any point, by any kind: a query
6
6
  * says *{speaker} is thinking*, the oracle five nodes later says *{speaker} is
7
7
  * typing*. It is **ephemeral** — never a parameter, never declared on a
8
- * definition, never a node row on the receipt (F34) — and it persists until
9
- * the next status or the run's end. The one exception R-21 took: the **last**
8
+ * definition, never a node row on the receipt — and it persists until
9
+ * the next status or the run's end. The one exception: the **last**
10
10
  * status is recorded on the receipt when a run ends `halt`, `err` or
11
11
  * `cancelled`, because "what was it doing when it died" is a question the
12
12
  * receipt should answer.
13
13
  *
14
- * Text is display text with variables — a string, or a locale map (R-20);
14
+ * Text is display text with variables — a string, or a locale map;
15
15
  * the CLIENT resolves the locale, so a handler never sees a language. `{speaker}` is the one variable the HOST
16
16
  * fills — see `HOST_FILLED_STATUS_VARS` — because a handler is blind to who
17
17
  * is speaking and must stay so.
@@ -19,13 +19,15 @@
19
19
  * ⚠ Not HTTP's `statusText` (a reason phrase beside a code) and not a run's
20
20
  * *outcome* (`ok · halt · err · cancelled`): a status is prose about progress,
21
21
  * and it decides nothing.
22
+ * @ruling plans/29 R-19, R-21, 09-B B11, F34, R-21, R-20
22
23
  */
23
24
  import { type I18n, type LocaleMap } from './i18n.js';
24
25
  /**
25
- * One status: display text (R-20 — a string or a locale map with `en`), and
26
+ * One status: display text (a string or a locale map with `en`), and
26
27
  * the values its `{vars}` take. A bare string is `en`, so `ctx.status({ i18n:
27
28
  * '{speaker} is thinking' })` is the short spelling of the map form.
28
29
  * @experimental
30
+ * @ruling R-20
29
31
  */
30
32
  export interface StatusText {
31
33
  i18n: I18n;
@@ -48,9 +50,10 @@ export interface WidgetActionReason extends StatusText {
48
50
  }
49
51
  /**
50
52
  * The receipt's one record of a status — the last one set, and the node that
51
- * set it — present only when the run ended `halt`, `err` or `cancelled`
52
- * (R-21, "optional, taken"). Never on an `ok` receipt, and never a node row.
53
+ * set it — present only when the run ended `halt`, `err` or `cancelled`.
54
+ * Never on an `ok` receipt, and never a node row.
53
55
  * @experimental
56
+ * @ruling R-21 ("optional, taken")
54
57
  */
55
58
  export interface LastStatus {
56
59
  nodeKey: string;
@@ -67,11 +70,12 @@ export interface LastStatus {
67
70
  */
68
71
  export declare const HOST_FILLED_STATUS_VARS: readonly ['speaker'];
69
72
  /**
70
- * Is this a status a run can carry? `i18n` is display text a publish accepts
71
- * (R-20): a non-blank string, or a locale map whose `en` is non-blank. The
73
+ * Is this a status a run can carry? `i18n` is display text a publish accepts:
74
+ * a non-blank string, or a locale map whose `en` is non-blank. The
72
75
  * executor drops a status that is not, with a note on the receipt — a status
73
76
  * is advisory and never halts a run.
74
77
  * @internal
78
+ * @ruling R-20
75
79
  */
76
80
  export declare function isStatusText(value: unknown): value is StatusText;
77
81
  /** The variable names a status's text mentions, across every locale it carries. @internal */
package/dist/status.js CHANGED
@@ -1,17 +1,17 @@
1
1
  /**
2
- * Statuses (plans/29 R-19, R-21; 09-B B11) — what a node says it is doing,
2
+ * Statuses — what a node says it is doing,
3
3
  * from inside its execution.
4
4
  *
5
5
  * `ctx.status({ i18n, vars })` is callable at any point, by any kind: a query
6
6
  * says *{speaker} is thinking*, the oracle five nodes later says *{speaker} is
7
7
  * typing*. It is **ephemeral** — never a parameter, never declared on a
8
- * definition, never a node row on the receipt (F34) — and it persists until
9
- * the next status or the run's end. The one exception R-21 took: the **last**
8
+ * definition, never a node row on the receipt — and it persists until
9
+ * the next status or the run's end. The one exception: the **last**
10
10
  * status is recorded on the receipt when a run ends `halt`, `err` or
11
11
  * `cancelled`, because "what was it doing when it died" is a question the
12
12
  * receipt should answer.
13
13
  *
14
- * Text is display text with variables — a string, or a locale map (R-20);
14
+ * Text is display text with variables — a string, or a locale map;
15
15
  * the CLIENT resolves the locale, so a handler never sees a language. `{speaker}` is the one variable the HOST
16
16
  * fills — see `HOST_FILLED_STATUS_VARS` — because a handler is blind to who
17
17
  * is speaking and must stay so.
@@ -19,6 +19,7 @@
19
19
  * ⚠ Not HTTP's `statusText` (a reason phrase beside a code) and not a run's
20
20
  * *outcome* (`ok · halt · err · cancelled`): a status is prose about progress,
21
21
  * and it decides nothing.
22
+ * @ruling plans/29 R-19, R-21, 09-B B11, F34, R-21, R-20
22
23
  */
23
24
  import { i18nText, isI18n, localeMapOf } from './i18n.js';
24
25
  /**
@@ -34,11 +35,12 @@ export const HOST_FILLED_STATUS_VARS = ['speaker'];
34
35
  /** `{name}` — one variable placeholder, as every locale of a status spells it. */
35
36
  const VAR_PATTERN = /\{([A-Za-z_][A-Za-z0-9_]*)\}/g;
36
37
  /**
37
- * Is this a status a run can carry? `i18n` is display text a publish accepts
38
- * (R-20): a non-blank string, or a locale map whose `en` is non-blank. The
38
+ * Is this a status a run can carry? `i18n` is display text a publish accepts:
39
+ * a non-blank string, or a locale map whose `en` is non-blank. The
39
40
  * executor drops a status that is not, with a note on the receipt — a status
40
41
  * is advisory and never halts a run.
41
42
  * @internal
43
+ * @ruling R-20
42
44
  */
43
45
  export function isStatusText(value) {
44
46
  if (!value || typeof value !== 'object')
package/dist/storage.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * What an extension may do with its own data (13 §7c).
2
+ * What an extension may do with its own data.
3
3
  *
4
4
  * The surface this replaces was `readOwnRows` / `writeOwnRows` and nothing
5
5
  * else, which composed into a one-way door: a quota was declared in the
@@ -23,6 +23,7 @@
23
23
  * **Both count against one quota.** A single number is what an author can
24
24
  * reason about and what a consent screen can state; two budgets that can each
25
25
  * be under while the disk fills is the failure this avoids.
26
+ * @ruling 13 §7c
26
27
  */
27
28
  import type { Result } from './executor.js';
28
29
  /** @experimental */
package/dist/storage.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * What an extension may do with its own data (13 §7c).
2
+ * What an extension may do with its own data.
3
3
  *
4
4
  * The surface this replaces was `readOwnRows` / `writeOwnRows` and nothing
5
5
  * else, which composed into a one-way door: a quota was declared in the
@@ -23,6 +23,7 @@
23
23
  * **Both count against one quota.** A single number is what an author can
24
24
  * reason about and what a consent screen can state; two budgets that can each
25
25
  * be under while the disk fills is the failure this avoids.
26
+ * @ruling 13 §7c
26
27
  */
27
28
  /** Nothing here reaches outside the extension's own namespace, so there is no
28
29
  * capability to grant and nothing to put on a consent screen: an extension