@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/README.md CHANGED
@@ -3,6 +3,10 @@
3
3
  A working draft of the SDK described in `/docs/pipeline` (00–17). **Preview: breaking
4
4
  changes are expected before 0.7.0.**
5
5
 
6
+ New here? Read the [vocabulary](../guides/vocabulary.md) before the API reference. There, 🚧
7
+ marks a shape that may still change before 1.0, and ⏳ marks one that is going away, with the
8
+ version named.
9
+
6
10
  ```bash
7
11
  npm install
8
12
  npm test # tsc --noEmit, then 310 assertions across 109 use cases
@@ -68,7 +72,7 @@ mistake that is supposed to be a compile error stops being one.**
68
72
  | `sdk/src/connections.ts` | what an import must wire, derived from types rather than stored rows |
69
73
  | `sdk/src/registry.ts` | `type_registry` rows, and install-time validation from data alone |
70
74
  | `sdk/src/dev.ts` | dev loading: memory-only overlay, and which reloads may apply mid-run |
71
- | `contracts/src/index.ts` | sample core + plugin types across four modalities |
75
+ | `contracts/src/{inlets,queries,tasks,oracles,outlets}.ts` | core's node definitions and a few sample plugin ones, one file per node kind (`index.ts` re-exports them) |
72
76
  | `cli/src/compiler.ts` | the packager: a source scan plus the built extension, cross-checked |
73
77
  | `cli/src/codegen.ts` | `/contracts` generation, and the rule that binding names are **derived** |
74
78
  | `cli/src/bin.ts` | `serene-pub build / check / contracts` |
@@ -336,25 +340,25 @@ tags belonging to an inner scope must not be stripped by an outer pass.
336
340
  entries have no `depth` field.** An entry-schema addition in the lorebook model, not pipeline
337
341
  work.
338
342
 
339
- ## Known gaps in the draft
340
-
341
- Unimplemented, not undecided.
342
-
343
- - **In-process timeouts abandon rather than kill**, matching 13 §7h. The abandoned promise
344
- keeps running; only the result is discarded.
345
- - **No sidecar transport, no MCP client.** `mcpTool` is a descriptor with a stub binding.
346
- - **No real tokenizer.** `contextBudget` reads `metadata.contextLength` and subtracts.
347
- - **The template engine is minimal** — `{{ a.b }}` and `{% for %}` only, enough to prove the
348
- variable-awareness contract, not to be Jinja.
349
- - **ST parity items are declared but not implemented** — recursion, inclusion groups and
350
- positional insertion are `params` on the descriptors only (13 §7i).
351
- - **A map forces sequential execution.** The observable result is identical, which is exactly
352
- what F26 asserts, but the draft does not actually run iterations concurrently — a single
353
- shared value map cannot hold two iterations at once. Real per-iteration scoping is the
354
- work, not the shape.
355
- - **`secret` values are stored as tagged plaintext**, not encrypted. `forOwningHookSplit` takes a
356
- `decrypt` function so the seam is in the right place; the app secret in `meta.json` is
357
- core's side of it (13 §5).
343
+ ## Known gaps
344
+
345
+ What the SDK still does not do, as of 2026-10-13. Unimplemented, not undecided; the
346
+ 2026-08 draft's list is gone because most of it has since been built (real tokenizers are
347
+ registered by the host, `recursionDepth` and inclusion groups run in `worldinfo.ts`, a scope
348
+ chain lets a map's iterations run concurrently, and a `secret` setting is ciphertext at rest
349
+ and a handle in a hook's code).
350
+
351
+ - **An in-process timeout cuts the result off, not the code.** When a node's clock runs out
352
+ its own `signal` aborts and the executor moves on; a handler that never reads its signal
353
+ keeps running until it returns. Only the host's sandboxes bound CPU.
354
+ - **No MCP client in the SDK.** `mcp-tool` and `mcp-resource` are provisional node
355
+ definitions: the `mcp` connection shape and the ports exist, and the host supplies the
356
+ client. The app does not ship one yet.
357
+ - **The template engine in `template.ts` is minimal by design** — `{{ a.b }}`, `{% for %}`
358
+ and `{% if %}`, enough for variable awareness in an editor. Rendering a real template is
359
+ the host's; `/template-check` parses Handlebars and Liquid for the same checks.
360
+ - **Depth positioning of a lore entry** is expressed in a task because lorebook entries
361
+ carry no `depth` field. The gap is in the lorebook model, not the pipeline.
358
362
 
359
363
  ## Two bugs the tests caught while writing this
360
364
 
package/dist/actions.d.ts CHANGED
@@ -1,11 +1,9 @@
1
1
  /**
2
2
  * Actions — what a person (or an AI-portrayed participant) can invoke, and
3
- * where (plans/29 R-15 *venue* · *audience* · *quick* · *slash name*;
4
- * 09-AMENDMENTS-B B9, F40 — was F38 before the 2026-09-17 renumbering; ruled
5
- * 2026-09-15, built 2026-09-16 as U5c).
3
+ * where (built 2026-09-16).
6
4
  *
7
5
  * A spec contributes actions through `contributes.actions[]`. Core's own message verbs — the floors and the
8
- * built-ins of U5b — are described by the same shape in `CORE_ACTIONS`, so
6
+ * built-ins — are described by the same shape in `CORE_ACTIONS`, so
9
7
  * a client renders **one list** per venue and never hand-writes a verb button.
10
8
  *
11
9
  * ## The four declarations
@@ -22,16 +20,16 @@
22
20
  * - **quick** — the one prominence flag. Every venue is a **primary set**
23
21
  * (`quick: true`) plus an **overflow** that always lists every enabled
24
22
  * action; composer actions are always reachable through `/`. Placement is
25
- * presentation; availability is data (F40). A CSS pack may reposition the
23
+ * presentation; availability is data. A CSS pack may reposition the
26
24
  * primary set, never remove an action.
27
25
  * - **slash** — the stable ASCII id a composer action is called by. Core's
28
26
  * specs claim bare names (`advance`, `narrate`); a plugin's are
29
27
  * `<plugin>.<action>` (`acme.roll`), the plugin id being the spec's
30
28
  * namespace — so a collision across owners is impossible by construction,
31
29
  * and the palette autocompletes so nobody types the long form. Never
32
- * localised (R-20): the palette shows the localised `label` beside it.
30
+ * localised: the palette shows the localised `label` beside it.
33
31
  *
34
- * - **enabled-when** (U5e, built 2026-09-17) — whether the action is offered
32
+ * - **enabled-when** (built 2026-09-17) — whether the action is offered
35
33
  * *now*: a declared predicate over the session's **published values**, the
36
34
  * junction clause's shape (`{ on: 'state.world.location', truthy: true,
37
35
  * reason }`), never code. A list means all must hold. The genre supplies
@@ -44,60 +42,79 @@
44
42
  * ## What this is not
45
43
  *
46
44
  * Not a *pipeline* — an action *starts* one (`function` is the key routing
47
- * resolves, 19 §3). Not an *event* — those are core-owned occurrences. Not
45
+ * resolves). Not an *event* — those are core-owned occurrences. Not
48
46
  * *availability* — the genre's `messageVerbs` and the preset's included set
49
47
  * decide that; a declaration here says where and to whom an available action
50
48
  * is offered.
49
+ * @ruling plans/29 R-15 *venue* · *audience* · *quick* · *slash name*, 09-AMENDMENTS-B B9, F40 (was F38 before the 2026-09-17 renumbering; ruled 2026-09-15), U5c, U5b, R-20, U5e, 19 §3
51
50
  */
52
51
  import type { Audience } from './participants.js';
53
52
  import type { I18n } from './descriptors.js';
54
53
  import { type EnvoyDecl } from './genres.js';
55
54
  import { type EnabledWhen, type EnabledWhenDecl } from './predicates.js';
56
55
  import type { VerdictResult } from './verdicts.js';
56
+ import { type StoryTimeUnit } from './storyTime.js';
57
57
  export type { EnabledWhen, EnabledWhenDecl } from './predicates.js';
58
- /** The two sides of the effects line (R-15). `fiction` is the default. @experimental */
58
+ /**
59
+ * The two sides of the effects line. `fiction` is the default.
60
+ * @experimental
61
+ * @ruling R-15
62
+ */
59
63
  export declare const ACTION_EFFECTS: readonly ['fiction', 'world'];
60
64
  /** @experimental */
61
65
  export type ActionEffects = (typeof ACTION_EFFECTS)[number];
62
66
  /**
63
- * How much an action needs the text it **collects** (lair pass R3,
64
- * 2026-09-28): `required` — the press does not fire without some;
67
+ * How much an action needs the text it **collects**: `required` — the
68
+ * press does not fire without some;
65
69
  * `optional` — an empty submit fires too, and `CollectedText.ifEmpty` says
66
- * what that does. Was `COMPOSER_TEXT_MODES` (B10), when the text was read
70
+ * what that does. Was `COMPOSER_TEXT_MODES`, when the text was read
67
71
  * off the composer's draft.
68
72
  * @experimental
73
+ * @ruling lair pass R3 (2026-09-28), B10
69
74
  */
70
75
  export declare const TEXT_NEEDS: readonly ['required', 'optional'];
71
76
  /**
72
- * The text an action collects before it fires (lair pass R3, ruled
73
- * 2026-09-28: typing and then pressing an action is unintuitive). The press
74
- * opens the **collect modal**, or — S2 — a slash argument supplies it. It
77
+ * The text an action collects before it fires (typing and then pressing an
78
+ * action is unintuitive). The press
79
+ * opens the **collect modal**, or a slash argument supplies it. It
75
80
  * reaches the run as `input.text`, trimmed.
76
81
  * @experimental
82
+ * @ruling lair pass R3 (ruled 2026-09-28), S2
77
83
  */
78
84
  export interface CollectedText {
79
85
  need: (typeof TEXT_NEEDS)[number];
80
- /** The field's label — what the modal asks: "What do you whisper?". Display text (R-20). */
86
+ /**
87
+ * The field's label — what the modal asks: "What do you whisper?". Display text.
88
+ * @ruling R-20
89
+ */
81
90
  label: I18n;
82
- /** The empty field's placeholder. Display text (R-20). */
91
+ /**
92
+ * The empty field's placeholder. Display text.
93
+ * @ruling R-20
94
+ */
83
95
  placeholder?: I18n;
84
96
  /**
85
97
  * What an empty submit does, in one sentence — "The room decides."
86
98
  * **Required when `need` is `optional`**: an empty box must say what
87
- * pressing on will do. Display text (R-20).
99
+ * pressing on will do. Display text.
100
+ * @ruling R-20
88
101
  */
89
102
  ifEmpty?: I18n;
90
103
  }
91
104
  /**
92
- * The cast members an action collects before it fires (lair pass R3; the
93
- * whisper's use is R10): a multiselect over the session's **enabled cast
105
+ * The cast members an action collects before it fires: a multiselect over
106
+ * the session's **enabled cast
94
107
  * members**, each a `character:<id>` reference. They reach the run as
95
108
  * `input.recipients`, validated by the host: seated and enabled, no
96
109
  * duplicates, within `min` and `max`.
97
110
  * @experimental
111
+ * @ruling lair pass R3, R10
98
112
  */
99
113
  export interface CollectedRecipients {
100
- /** The list's label — "Who hears it". Display text (R-20). */
114
+ /**
115
+ * The list's label — "Who hears it". Display text.
116
+ * @ruling R-20
117
+ */
101
118
  label: I18n;
102
119
  /** The fewest that may be picked. Default 1; never below 1. */
103
120
  min?: number;
@@ -105,22 +122,58 @@ export interface CollectedRecipients {
105
122
  max?: number;
106
123
  /**
107
124
  * The per-cast slot this action writes on each recipient, replacing what
108
- * it held (lair re-plan R10, 2026-09-28) — the Lair's Whisper names
125
+ * it held — the Lair's Whisper names
109
126
  * `core:slot/whisper@1`. The collect modal shows each member's current
110
127
  * value beside their box, so an overwrite is visible before it happens.
111
128
  * Display only: what the run writes is the spec's.
129
+ * @ruling lair re-plan R10 (2026-09-28)
112
130
  */
113
131
  overwrites?: string;
114
132
  }
133
+ /**
134
+ * 🚧 A **clock step** an action collects before it fires: an amount of story
135
+ * time, forward or back, in one unit — the collect modal's stepper (a whole
136
+ * number, a unit, *Forward* / *Back*). It reaches the run as
137
+ * `input.clockStep: { by, unit }`, `by` signed (back is negative), validated
138
+ * by the host (a whole number other than zero, within `CLOCK_STEP_MAX`, a unit
139
+ * of `STORY_TIME_UNITS`). What the run does with it is the spec's — core's
140
+ * *Time passes…* wires it into `core:task/clock-step@1` and the *Advance story
141
+ * clock* outlet. ⚠ Not a turn's step and not the Chronicle's one-press step:
142
+ * the person picks the amount.
143
+ * @experimental
144
+ * @ruling PROPOSAL-live-scenes §6 (2026-10-13)
145
+ */
146
+ export interface CollectedClockStep {
147
+ /**
148
+ * The stepper's label — what the modal asks: "How much time passes?".
149
+ * Display text.
150
+ * @ruling R-20
151
+ */
152
+ label: I18n;
153
+ /** What the stepper opens at. Default `{ by: 1, unit: 'hours' }`; `by` above 0 (the modal's Back makes it negative). */
154
+ default?: {
155
+ by: number;
156
+ unit: StoryTimeUnit;
157
+ };
158
+ }
159
+ /** The largest step a press may collect, either way — a typo of 100000 years is refused, not stepped. @experimental */
160
+ export declare const CLOCK_STEP_MAX = 10000;
161
+ /**
162
+ * Why a collected clock step cannot ride, as a sentence — or null when it can:
163
+ * `{ by, unit }`, a whole `by` other than zero within ±`CLOCK_STEP_MAX`, a unit
164
+ * of `STORY_TIME_UNITS`. The host's door and the modal ask the same.
165
+ * @experimental
166
+ */
167
+ export declare function clockStepRefusal(raw: unknown): string | null;
115
168
  /**
116
169
  * The venues a `world` action may appear in: never a form, the extra tab or a
117
170
  * widget.
118
171
  *
119
- * ⚠ **`message` is on the owner's side since 2026-09-28** (lair re-plan R11,
120
- * *File as a room*). The line exists so that a character can never be asked
121
- * to answer an out-of-fiction question (29 R-15 *The line*), and a question
172
+ * ⚠ **`message` is on the owner's side since 2026-09-28**. The line exists
173
+ * so that a character can never be asked
174
+ * to answer an out-of-fiction question, and a question
122
175
  * put to someone lives in the **`form`** venue — split out of `message` the
123
- * day the line was built (U5d review, S1). The `message` venue is a message's
176
+ * day the line was built. The `message` venue is a message's
124
177
  * own ⋮ and quick row: a person's button, pressed by the person, on a row.
125
178
  * With `act` held to `owner` / `admin` (`WORLD_ACTION_ACTORS`), no block
126
179
  * naming it, and no fire made **as** a participant, a `world` action there
@@ -128,6 +181,7 @@ export interface CollectedRecipients {
128
181
  * with the row as its subject. `extra` and `widget` stay out: a widget can
129
182
  * invoke without a person's press.
130
183
  * @experimental
184
+ * @ruling lair re-plan R11 *File as a room*, 29 R-15 *The line*, U5d review, S1
131
185
  */
132
186
  export declare const WORLD_ACTION_VENUES: readonly VenueKind[];
133
187
  /** The references a `world` action's `act` audience may name: the owner, an administrator. @experimental */
@@ -139,7 +193,7 @@ export declare const effectsOf: (action: {
139
193
  /**
140
194
  * The closed set of places an action may appear. Core owns it; a plugin picks.
141
195
  *
142
- * `form` (U5d review, S1) is the one venue nothing lists: an action carried
196
+ * `form` is the one venue nothing lists: an action carried
143
197
  * by a **form** — a `choices` or `form` block in a message — and pressed
144
198
  * only from that block (the Adventure genre's *Answer*). A `form`-venue
145
199
  * action never appears in a message's overflow, the composer's More menu or
@@ -147,7 +201,7 @@ export declare const effectsOf: (action: {
147
201
  * it. A `world` action may not take it (`WORLD_ACTION_VENUES`): an
148
202
  * out-of-fiction effect is never a question a message carries.
149
203
  *
150
- * ⚠ **`form` stays fiction-only even after L1** (ruled 2026-09-17). A block
204
+ * ⚠ **`form` stays fiction-only** (ruled 2026-09-17). A block
151
205
  * addressed to the **owner** may name a `world` action — see
152
206
  * `worldBlockFunctions` — but a *venue* is declared and an *addressee* is
153
207
  * decided at run time, so this check cannot see one and would have to admit
@@ -156,6 +210,7 @@ export declare const effectsOf: (action: {
156
210
  * says where the declaration may be OFFERED, the addressee says who may press
157
211
  * this particular button, and the two answers stay separate.
158
212
  * @experimental
213
+ * @ruling U5d review, S1, L1
159
214
  */
160
215
  export declare const VENUE_KINDS: readonly ['composer', 'message', 'extra', 'widget', 'session-settings', 'pipelines', 'admin', 'review', 'form'];
161
216
  /** @experimental */
@@ -167,7 +222,10 @@ export type ListedVenueKind = (typeof LISTED_VENUE_KINDS)[number];
167
222
  /** Where an action appears, optionally on one channel only. @experimental */
168
223
  export interface Venue {
169
224
  kind: VenueKind;
170
- /** A channel slug (20 §7). Absent = every channel of the session. */
225
+ /**
226
+ * A channel slug. Absent = every channel of the session.
227
+ * @ruling 20 §7
228
+ */
171
229
  channel?: string;
172
230
  }
173
231
  /**
@@ -176,20 +234,22 @@ export interface Venue {
176
234
  * `key` is the action's own identity within the spec — what a widget's
177
235
  * `invoke(key)` names, what the *new* marker is kept against, and, joined to
178
236
  * the spec slug as `<spec>#<key>` (`ACTION_IDENTITY`), **the one key
179
- * everything routes and stores by** (plans/31 V2, ruled 2026-09-17): a
237
+ * everything routes and stores by**: a
180
238
  * binding's subject, a preset's included set, a session's enablement row, a
181
239
  * genre's enabled-when default, the fire, a block's `action`. There is no
182
240
  * second routing key: two specs declaring the same `key` are two actions, and
183
241
  * a person binds each on its own.
184
242
  * @experimental
243
+ * @ruling plans/31 V2 (2026-09-17)
185
244
  */
186
245
  export interface ActionDecl {
187
246
  key: string;
188
247
  /**
189
- * The genre this action serves — a genre id (24 §3). Required (U5c
190
- * review, W5): an action is offered *to a genre*, and one naming none
248
+ * The genre this action serves — a genre id. Required: an action is
249
+ * offered *to a genre*, and one naming none
191
250
  * would be offered to nobody while still claiming a slash name — so it is
192
251
  * refused at construction, in `validate()` and in `announce.build()`.
252
+ * @ruling 24 §3, U5c review, W5
193
253
  */
194
254
  genre: string;
195
255
  venue: Venue | Venue[];
@@ -197,30 +257,35 @@ export interface ActionDecl {
197
257
  quick?: boolean;
198
258
  /** The slash name. Composer actions without one are called by their `key`. */
199
259
  slash?: string;
200
- /** What the control reads — a string or a locale map with `en` (R-20); never the slash name. */
260
+ /**
261
+ * What the control reads — a string or a locale map with `en`; never the slash name.
262
+ * @ruling R-20
263
+ */
201
264
  label: I18n;
202
265
  /** A Lucide icon name, kebab-case. */
203
266
  icon?: string;
204
267
  /**
205
268
  * What the icon says when it stands alone — the accessible name of an
206
- * icon-only control (`aria-label`). Display text (R-20). Absent: the
269
+ * icon-only control (`aria-label`). Display text. Absent: the
207
270
  * `label`, which is right for nearly every action; give one only when the
208
271
  * icon-only control should read differently from the named one. Needs an
209
272
  * `icon`.
210
273
  * @experimental
274
+ * @ruling R-20
211
275
  */
212
276
  iconAlt?: I18n;
213
277
  /**
214
- * What the action does, in one plain sentence — display text (R-20).
278
+ * What the action does, in one plain sentence — display text.
215
279
  * **Required** (2026-09-28): the session's action legend lists every
216
280
  * action with it, and a control shows it as its tooltip, so a person can
217
281
  * learn what a button does before pressing it. Say the effect, not the
218
282
  * mechanism: "Roll the dice and post the result."
219
283
  * @experimental
284
+ * @ruling R-20
220
285
  */
221
286
  description: I18n;
222
287
  /**
223
- * When the action is offered (plans/29 R-15 *enabled-when*; U5e): a
288
+ * When the action is offered: a
224
289
  * predicate — or a list, all of which must hold — over the session's
225
290
  * published values, the junction clause's shape and never code. `on` is
226
291
  * a dotted path such as `state.world.location`, `session.generating` or
@@ -228,11 +293,12 @@ export interface ActionDecl {
228
293
  * outside a run. `reason` says why the control is grey. Absent: the
229
294
  * genre's default for this function, if it declares one, else always
230
295
  * enabled. See `predicates.ts`.
296
+ * @ruling plans/29 R-15 *enabled-when*, U5e
231
297
  */
232
298
  enabledWhen?: EnabledWhenDecl;
233
299
  /**
234
- * When the action is **present** at all (W-GATE D3, 2026-09-27): the
235
- * turn controls' present-when (B8), on a contributed action. The same
300
+ * When the action is **present** at all: the
301
+ * turn controls' present-when, on a contributed action. The same
236
302
  * predicate grammar as `enabledWhen`, over the same published values,
237
303
  * and the opposite answer when it fails — the action is **hidden**, not
238
304
  * grey: left out of every listing and refused at the door when pressed
@@ -244,53 +310,58 @@ export interface ActionDecl {
244
310
  * (`session.openForm.action`). An `item.*` predicate is refused: a
245
311
  * listing has no row to judge it on. Absent: always present.
246
312
  * @experimental
313
+ * @ruling W-GATE D3 (2026-09-27), B8
247
314
  */
248
315
  presentWhen?: EnabledWhenDecl;
249
316
  /**
250
- * What the action's result touches — **the effects line** (plans/29
251
- * R-15 *The line*; F41, was 09-B's F39; built 2026-09-17 as U5d).
317
+ * What the action's result touches — **the effects line** (built 2026-09-17).
252
318
  *
253
319
  * `fiction` (the default): the result stays inside the story — a
254
320
  * message, a state proposal, a narration, a branch (a copy of a session
255
321
  * is still the fiction). `world`: the result touches something outside
256
322
  * it — character cards, lorebook data, settings, permissions,
257
323
  * connections. A `world` action may appear only in the `composer`,
258
- * `message` (a row's own ⋮, since lair re-plan R11), `session-settings`,
324
+ * `message` (a row's own ⋮), `session-settings`,
259
325
  * `admin` or `review` venues (never `form`, `extra` or `widget`), its `act` audience is `owner` and/or `admin`
260
326
  * only, no block may name it **unless that block is addressed to the
261
- * owner** (`worldBlockFunctions`, `isOwnerAddressed`; L1, ruled
262
- * 2026-09-17), and the form-answer pipeline refuses to answer it — so a
327
+ * owner** (`worldBlockFunctions`, `isOwnerAddressed`), and the form-answer
328
+ * pipeline refuses to answer it — so a
263
329
  * character asking a question is fine, and a character granting another
264
330
  * character permission is impossible by construction. Refused at
265
331
  * construction, in `validate()`, in `announce.build()` and at the host's
266
332
  * publish.
333
+ * @ruling plans/29 R-15 *The line*, F41 (was 09-B's F39), U5d, lair re-plan R11, L1 (ruled 2026-09-17)
267
334
  */
268
335
  effects?: ActionEffects;
269
336
  /**
270
- * The speaker this action's results post as (plans/29 R-18 (1), R-21
271
- * (6); built 2026-09-16 as U5g) — a dice plugin's *Roll* reporting as
337
+ * The speaker this action's results post as (built 2026-09-16) — a dice
338
+ * plugin's *Roll* reporting as
272
339
  * "the Dice Master". Addressed as `envoy:<plugin>.<key>`
273
340
  * (`envoyIdentity({ action: { specId } }, key)`), a cast member with
274
341
  * `origin: action` once it has posted, and **`on-action` only**: it
275
342
  * speaks through this action's outputs and is never a turn-taking
276
343
  * candidate. `speaks` is stamped by `normalizeAction` and a declaration
277
344
  * saying `in-turn` is refused.
345
+ * @ruling plans/29 R-18 (1), R-21 (6), U5g
278
346
  */
279
347
  envoy?: EnvoyDecl;
280
348
  /**
281
- * What the action asks for before it fires (lair pass R3, 2026-09-28):
282
- * `text` (`CollectedText`) and/or `recipients` (`CollectedRecipients`).
349
+ * What the action asks for before it fires:
350
+ * `text` (`CollectedText`), `recipients` (`CollectedRecipients`) and/or
351
+ * 🚧 a `clockStep` (`CollectedClockStep`).
283
352
  * Every press of a collecting action — a chip, the palette, a message's
284
- * ⋮, a form's option — opens the **collect modal**; S2's slash argument
353
+ * ⋮, a form's option — opens the **collect modal**; a slash argument
285
354
  * supplies the text instead. What was collected reaches the run as
286
- * `input.text` and `input.recipients`. Absent: the action collects
355
+ * `input.text`, `input.recipients` and `input.clockStep`. Absent: the action collects
287
356
  * nothing, and its run's `input.text` is empty. Any venue. Was
288
357
  * `composerText`, when the text was read off the composer's draft.
289
358
  * @experimental
359
+ * @ruling lair pass R3 (2026-09-28), S2
290
360
  */
291
361
  collects?: {
292
362
  text?: CollectedText;
293
363
  recipients?: CollectedRecipients;
364
+ clockStep?: CollectedClockStep;
294
365
  };
295
366
  }
296
367
  /** A declaration after normalisation: venues and predicates always lists, no alias spellings, no `function`. @experimental */
@@ -311,7 +382,7 @@ export declare const BARE_SLASH: RegExp;
311
382
  /** A plugin's slash name is `<plugin>.<action>`; the plugin id is the spec's namespace. @experimental */
312
383
  export declare const NAMESPACED_SLASH: RegExp;
313
384
  /**
314
- * One venue's listing (F40 — every enabled action is reachable): the
385
+ * One venue's listing (every enabled action is reachable): the
315
386
  * **primary set**, the actions declaring `quick`, and the **overflow**, the
316
387
  * rest. Every action the venue holds is in exactly one of the two, so nothing
317
388
  * is reachable only by prominence and nothing is dropped. Placement is
@@ -319,6 +390,7 @@ export declare const NAMESPACED_SLASH: RegExp;
319
390
  * entry. The host's `SessionActionVenues` is this shape with its entries
320
391
  * decorated (audience, the *new* mark, enablement).
321
392
  * @experimental
393
+ * @ruling F40
322
394
  */
323
395
  export interface VenueListing<A> {
324
396
  primary: A[];
@@ -328,10 +400,10 @@ export interface VenueListing<A> {
328
400
  export type VenueListings<A> = Record<ListedVenueKind, VenueListing<A>>;
329
401
  /**
330
402
  * Place actions into their venues for one channel — the placement rule every
331
- * listing applies (F40; R-15 *quick*). `quick` → the primary set, else the
403
+ * listing applies. `quick` → the primary set, else the
332
404
  * overflow; a venue naming another channel's slug is skipped (a bare slug
333
- * means every lane of it, 20 §7); a `form` venue is listed nowhere — the
334
- * block alone reaches it (U5d review, S1).
405
+ * means every lane of it); a `form` venue is listed nowhere — the
406
+ * block alone reaches it.
335
407
  *
336
408
  * Availability is decided BEFORE this: the genre's verbs, the preset's
337
409
  * included set and enabled-when say which actions a session offers, and the
@@ -340,14 +412,15 @@ export type VenueListings<A> = Record<ListedVenueKind, VenueListing<A>>;
340
412
  * the conformance kit's `listActions` seam on it — the SDK's own host does
341
413
  * — and the kit itself never calls it: C19 judges the listing the HOST
342
414
  * returns, entry by entry, and a rule the kit applied for the host would be
343
- * a rule it could not see the host break (U7 review, C1).
415
+ * a rule it could not see the host break.
344
416
  * @experimental
417
+ * @ruling F40, R-15 *quick*, 20 §7, U5d review, S1, U7 review, C1
345
418
  */
346
419
  export declare function placeActions<A extends {
347
420
  venue: ReadonlyArray<Venue>;
348
421
  quick?: boolean;
349
422
  }>(actions: ReadonlyArray<A>, channel?: string): VenueListings<A>;
350
- /** The namespace of a spec id — `core:spec/narrate` → `core`, `acme:spec/roll` → `acme`. @experimental */
423
+ /** The namespace of a spec id — `core:spec/chat-narrate` → `core`, `acme:spec/roll` → `acme`. @experimental */
351
424
  export declare function specNamespace(specId: string): string;
352
425
  /** Is this namespace core's — the one whose actions take bare slash names? @experimental */
353
426
  export declare const isCoreNamespace: (ns: string) => boolean;
@@ -355,8 +428,9 @@ export declare const isCoreNamespace: (ns: string) => boolean;
355
428
  * The slash name an action is called by: the declared one, else derived from
356
429
  * the key by the same rule a declared name must obey — `key` for core,
357
430
  * `<plugin>.<key>` for a plugin. Always defined, so every composer action is
358
- * reachable by `/` (F40) whether or not its author named one.
431
+ * reachable by `/` whether or not its author named one.
359
432
  * @experimental
433
+ * @ruling F40
360
434
  */
361
435
  export declare function slashNameOf(action: {
362
436
  key: string;
@@ -366,12 +440,13 @@ export declare function slashNameOf(action: {
366
440
  * The law one action finding comes from. Nearly every fault in a declaration
367
441
  * is its shape — a venue core does not offer, a slash name outside the
368
442
  * spec's namespace, a missing label — and is **R-15**'s. The two that are
369
- * not are **the effects line** (F41; U7 review, W3): a `world` action in a
443
+ * not are **the effects line** (`F41`): a `world` action in a
370
444
  * venue where a character could be asked to press it, or one whose `act`
371
445
  * audience names someone other than the owner or an administrator. The
372
446
  * validator labels each finding with its law, so a kit can key on `F41`
373
447
  * rather than on a word in the sentence.
374
448
  * @experimental
449
+ * @ruling U7 review, W3
375
450
  */
376
451
  export interface ActionFinding {
377
452
  law: 'R-15' | 'F41';
@@ -398,7 +473,7 @@ export type EffectsLineDeclarationInput = {
398
473
  ref: unknown;
399
474
  };
400
475
  /**
401
- * The effects line at a declaration (R-15 *The line*; F41): a `world` action
476
+ * The effects line at a declaration: a `world` action
402
477
  * is owner-only and never in a form, extra or widget venue. Judged one venue or one
403
478
  * reference at a time, so the sentence names the venue or the reference
404
479
  * that crossed.
@@ -409,24 +484,27 @@ export type EffectsLineDeclarationInput = {
409
484
  * import graph and must not import it. The verdict calls this for a
410
485
  * `venue` or `actor` input; the door calls it directly and quotes it.
411
486
  * @experimental
487
+ * @ruling R-15 *The line*, F41
412
488
  */
413
489
  export declare function worldActionCrossing(input: EffectsLineDeclarationInput): VerdictResult;
414
490
  /**
415
- * Every fault in one `ActionDecl.collects` (lair pass R3), as sentences: an
491
+ * Every fault in one `ActionDecl.collects`, as sentences: an
416
492
  * unknown key, a missing label, an `optional` text with no `ifEmpty`, a
417
493
  * `min` below 1 or a `max` below `min`. `where` is the field's address
418
494
  * (`contributes.actions[nudge].collects`).
419
495
  * @experimental
496
+ * @ruling lair pass R3
420
497
  */
421
498
  export declare function collectsFindings(raw: unknown, where: string): string[];
422
499
  /**
423
500
  * Every fault in one action declaration, as sentences — the teaching-error
424
- * pattern (15 §1.3). Empty when the declaration is sound.
501
+ * pattern. Empty when the declaration is sound.
425
502
  *
426
503
  * `specId` decides which slash grammar applies: a `core:` spec may not claim a
427
504
  * dotted name and a plugin spec may not claim a bare one, or a name outside its
428
505
  * own namespace. That rule is the whole collision guarantee.
429
506
  * @experimental
507
+ * @ruling 15 §1.3
430
508
  */
431
509
  export declare function actionFindings(raw: unknown, specId: string, at?: string): string[];
432
510
  /** `actionFindings`, each sentence with the law it comes from (`ActionFinding`). @experimental */
@@ -461,16 +539,16 @@ export declare function actionsOf(doc: {
461
539
  export { ACTION_IDENTITY, ACTION_IDENTITY_MAX_LENGTH, CORE_ACTION_SPEC_ID, actionIdentity, isActionIdentity, parseActionIdentity, } from './identity.js';
462
540
  /**
463
541
  * A slash collision: two actions offered to one genre under one name. One
464
- * slash name means one action (plans/31 V2, ruled 2026-09-17): since the
542
+ * slash name means one action (ruled 2026-09-17): since the
465
543
  * identity `<spec>#<key>` is the only routing key, two specs claiming one
466
544
  * name are two actions a palette could not tell apart — a collision, not
467
- * alternatives. (Until V2 two specs sharing a *function* under one name were
545
+ * alternatives. (Until then two specs sharing a *function* under one name were
468
546
  * alternatives a binding selected among; the function is gone, and so is the
469
547
  * exemption.) A plugin's names are namespaced (`acme.roll`), so a plugin
470
548
  * declaring the same `key` as a core verb is a different identity under a
471
549
  * different name, and never shadows it.
472
550
  *
473
- * Core's verbs hold their names first (U5c review, S1): every genre the list
551
+ * Core's verbs hold their names first: every genre the list
474
552
  * touches is seeded with `CORE_ACTIONS` under `core`, so a core spec claiming
475
553
  * `/retry` collides with the verb rather than shadowing it in the palette. (A
476
554
  * plugin spec cannot claim a bare name at all — that is the grammar's job.)
@@ -479,6 +557,7 @@ export { ACTION_IDENTITY, ACTION_IDENTITY_MAX_LENGTH, CORE_ACTION_SPEC_ID, actio
479
557
  * document, `announce.build()` inside one package, and the host across every
480
558
  * published spec of an install (a boot-time refusal).
481
559
  * @experimental
560
+ * @ruling plans/31 V2, U5c review, S1
482
561
  */
483
562
  export declare function slashCollisions(actions: ReadonlyArray<NormalizedAction & {
484
563
  specId: string;
@@ -501,17 +580,17 @@ export declare function actionDocumentFindingsByLaw(doc: {
501
580
  * Who core's message verbs are for and where they live — the same shape a
502
581
  * contributed action has, so the client renders one list.
503
582
  *
504
- * Every entry is a **built-in** (U5b): its `key` is the verb the
583
+ * Every entry is a **built-in**: its `key` is the verb the
505
584
  * message-verb handlers know (`sessionMessages:*`), never something
506
585
  * `sessions:fireAction` routes; its identity is `core#<key>`
507
586
  * (`CORE_ACTION_SPEC_ID`), which is what a genre's enabled-when default
508
- * and a session's override name it by (plans/31 V2). `retry` also lives in the
587
+ * and a session's override name it by. `retry` also lives in the
509
588
  * composer's *extra* venue (the turn controls), where it acts on the newest
510
589
  * reply. Availability is the genre's (`messageVerbs`): a host lists an entry
511
590
  * only when the genre offers it; the floors are always offered.
512
591
  *
513
592
  * Four entries are not message verbs but **turn controls**
514
- * (`TURN_CONTROLS`, lair pass B7 + B8, R2): **`advance`**, the composer's
593
+ * (`TURN_CONTROLS`): **`advance`**, the composer's
515
594
  * Continue, which fires the turn order's head; **`pick`**, Pick who speaks;
516
595
  * and **`narrate`**, a narrator turn — all `sessions:fireTurn` — and
517
596
  * **`retake`**, Regenerate the last turn as a whole (`sessions:retakeTurn`).
@@ -519,15 +598,17 @@ export declare function actionDocumentFindingsByLaw(doc: {
519
598
  * `turnControls`, and they act on no row. ⚠ `advance` is not `extend` — the prefill verb that
520
599
  * extends one reply (`core#extend`, labelled Extend; renamed from
521
600
  * `continue` 2026-09-28 so Continue means one press).
601
+ * @ruling U5b, plans/31 V2, lair pass B7 + B8, R2
522
602
  */
523
603
  /**
524
- * A core verb is declared without a `genre` (U5c review, S-E): it is offered
604
+ * A core verb is declared without a `genre`: it is offered
525
605
  * in **every** genre — availability is the genre's `messageVerbs`, and the
526
606
  * floors are not even that — so a genre on the declaration would name one
527
607
  * and lie about the rest. `Omit` rather than a cast, so a verb missing a
528
608
  * required field is a compile error here and not a runtime surprise in the
529
609
  * host's list.
530
610
  * @experimental
611
+ * @ruling U5c review, S-E
531
612
  */
532
613
  export interface CoreActionDecl extends Omit<NormalizedAction, 'genre'> {
533
614
  /** stop · branch · edit — present in every genre. */
@@ -535,12 +616,13 @@ export interface CoreActionDecl extends Omit<NormalizedAction, 'genre'> {
535
616
  }
536
617
  /**
537
618
  * The sentences beside a grey core verb, as locale maps — the `reason` of
538
- * each verb's enabled-when below (U5e). One vocabulary: the host's chips,
619
+ * each verb's enabled-when below. One vocabulary: the host's chips,
539
620
  * menus and palette read these through the verdict, and a refusal at the
540
621
  * door says the same words. The two conditions that are NOT published
541
622
  * values — an edit in progress, the audience — keep their sentences on the
542
623
  * client (`messageVerbState.ts`).
543
624
  * @internal
625
+ * @ruling U5e
544
626
  */
545
627
  export declare const CORE_VERB_REASONS: Readonly<{
546
628
  readonly generating: {