@serene-pub/sdk 0.6.0-pr-1

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 (187) hide show
  1. package/LICENSE +202 -0
  2. package/NOTICE +17 -0
  3. package/README.md +368 -0
  4. package/dist/actions.d.ts +572 -0
  5. package/dist/actions.js +829 -0
  6. package/dist/annexFields.d.ts +234 -0
  7. package/dist/annexFields.js +413 -0
  8. package/dist/announce.d.ts +464 -0
  9. package/dist/announce.js +426 -0
  10. package/dist/attributes.d.ts +670 -0
  11. package/dist/attributes.js +904 -0
  12. package/dist/bands.d.ts +125 -0
  13. package/dist/bands.js +256 -0
  14. package/dist/builder.d.ts +683 -0
  15. package/dist/builder.js +677 -0
  16. package/dist/candidates.d.ts +109 -0
  17. package/dist/candidates.js +118 -0
  18. package/dist/capabilities.d.ts +744 -0
  19. package/dist/capabilities.js +679 -0
  20. package/dist/channels.d.ts +106 -0
  21. package/dist/channels.js +129 -0
  22. package/dist/clauses.d.ts +40 -0
  23. package/dist/clauses.js +43 -0
  24. package/dist/component.d.ts +33 -0
  25. package/dist/component.js +27 -0
  26. package/dist/componentBuild.d.ts +48 -0
  27. package/dist/componentBuild.js +84 -0
  28. package/dist/componentClient.d.ts +100 -0
  29. package/dist/componentClient.js +13 -0
  30. package/dist/componentImports.d.ts +51 -0
  31. package/dist/componentImports.js +106 -0
  32. package/dist/componentModule.d.ts +8 -0
  33. package/dist/componentModule.js +270 -0
  34. package/dist/componentWire.d.ts +130 -0
  35. package/dist/componentWire.js +280 -0
  36. package/dist/config.d.ts +295 -0
  37. package/dist/config.js +231 -0
  38. package/dist/connections.d.ts +89 -0
  39. package/dist/connections.js +131 -0
  40. package/dist/declarations.d.ts +290 -0
  41. package/dist/declarations.js +794 -0
  42. package/dist/descriptors.d.ts +1774 -0
  43. package/dist/descriptors.js +1329 -0
  44. package/dist/dev.d.ts +136 -0
  45. package/dist/dev.js +161 -0
  46. package/dist/document.d.ts +202 -0
  47. package/dist/document.js +312 -0
  48. package/dist/engines.d.ts +117 -0
  49. package/dist/engines.js +203 -0
  50. package/dist/eventMapLaws.d.ts +63 -0
  51. package/dist/eventMapLaws.js +128 -0
  52. package/dist/events.d.ts +554 -0
  53. package/dist/events.js +633 -0
  54. package/dist/executor.d.ts +771 -0
  55. package/dist/executor.js +1829 -0
  56. package/dist/extension.d.ts +448 -0
  57. package/dist/extension.js +315 -0
  58. package/dist/facets.d.ts +53 -0
  59. package/dist/facets.js +60 -0
  60. package/dist/foldedSections.d.ts +74 -0
  61. package/dist/foldedSections.js +161 -0
  62. package/dist/genres.d.ts +507 -0
  63. package/dist/genres.js +633 -0
  64. package/dist/guardedConnection.d.ts +138 -0
  65. package/dist/guardedConnection.js +341 -0
  66. package/dist/handlebarsReach.d.ts +122 -0
  67. package/dist/handlebarsReach.js +222 -0
  68. package/dist/hash.d.ts +146 -0
  69. package/dist/hash.js +166 -0
  70. package/dist/hookGrants.d.ts +47 -0
  71. package/dist/hookGrants.js +68 -0
  72. package/dist/hooks.d.ts +290 -0
  73. package/dist/hooks.js +113 -0
  74. package/dist/hostElements.d.ts +447 -0
  75. package/dist/hostElements.js +702 -0
  76. package/dist/i18n.d.ts +94 -0
  77. package/dist/i18n.js +123 -0
  78. package/dist/identity.d.ts +93 -0
  79. package/dist/identity.js +135 -0
  80. package/dist/index.d.ts +85 -0
  81. package/dist/index.js +176 -0
  82. package/dist/layout.d.ts +194 -0
  83. package/dist/layout.js +40 -0
  84. package/dist/media.d.ts +202 -0
  85. package/dist/media.js +70 -0
  86. package/dist/messageBlocks.d.ts +487 -0
  87. package/dist/messageBlocks.js +683 -0
  88. package/dist/migration.d.ts +128 -0
  89. package/dist/migration.js +261 -0
  90. package/dist/names.d.ts +78 -0
  91. package/dist/names.js +136 -0
  92. package/dist/nodeInput.d.ts +399 -0
  93. package/dist/nodeInput.js +178 -0
  94. package/dist/participants.d.ts +291 -0
  95. package/dist/participants.js +252 -0
  96. package/dist/personGate.d.ts +62 -0
  97. package/dist/personGate.js +77 -0
  98. package/dist/pick.d.ts +84 -0
  99. package/dist/pick.js +103 -0
  100. package/dist/pluginHarness.d.ts +235 -0
  101. package/dist/pluginHarness.js +558 -0
  102. package/dist/pluginPermissions.d.ts +25 -0
  103. package/dist/pluginPermissions.js +97 -0
  104. package/dist/pluginRuleRef.d.ts +13 -0
  105. package/dist/pluginRuleRef.js +10 -0
  106. package/dist/predicates.d.ts +182 -0
  107. package/dist/predicates.js +249 -0
  108. package/dist/preview.d.ts +120 -0
  109. package/dist/preview.js +82 -0
  110. package/dist/promptBlocks.d.ts +130 -0
  111. package/dist/promptBlocks.js +197 -0
  112. package/dist/rankingDecisions.d.ts +60 -0
  113. package/dist/rankingDecisions.js +48 -0
  114. package/dist/receipt.d.ts +313 -0
  115. package/dist/receipt.js +60 -0
  116. package/dist/receiverRules.d.ts +24 -0
  117. package/dist/receiverRules.js +94 -0
  118. package/dist/refs.d.ts +117 -0
  119. package/dist/refs.js +137 -0
  120. package/dist/registry.d.ts +230 -0
  121. package/dist/registry.js +273 -0
  122. package/dist/review.d.ts +108 -0
  123. package/dist/review.js +97 -0
  124. package/dist/sampling.d.ts +152 -0
  125. package/dist/sampling.js +712 -0
  126. package/dist/scope.d.ts +65 -0
  127. package/dist/scope.js +128 -0
  128. package/dist/scripts.d.ts +243 -0
  129. package/dist/scripts.js +326 -0
  130. package/dist/sessionLayout.d.ts +339 -0
  131. package/dist/sessionLayout.js +503 -0
  132. package/dist/sessionSettings.d.ts +70 -0
  133. package/dist/sessionSettings.js +2 -0
  134. package/dist/settings.d.ts +501 -0
  135. package/dist/settings.js +604 -0
  136. package/dist/settingsSlot.d.ts +108 -0
  137. package/dist/settingsSlot.js +166 -0
  138. package/dist/shapes.d.ts +373 -0
  139. package/dist/shapes.js +408 -0
  140. package/dist/sheets.d.ts +165 -0
  141. package/dist/sheets.js +251 -0
  142. package/dist/statShapes.d.ts +96 -0
  143. package/dist/statShapes.js +112 -0
  144. package/dist/status.d.ts +103 -0
  145. package/dist/status.js +125 -0
  146. package/dist/storage.d.ts +145 -0
  147. package/dist/storage.js +33 -0
  148. package/dist/storyTime.d.ts +308 -0
  149. package/dist/storyTime.js +560 -0
  150. package/dist/surfaces.d.ts +501 -0
  151. package/dist/surfaces.js +292 -0
  152. package/dist/template.d.ts +312 -0
  153. package/dist/template.js +554 -0
  154. package/dist/templateCheck.d.ts +60 -0
  155. package/dist/templateCheck.js +516 -0
  156. package/dist/templateFit.d.ts +157 -0
  157. package/dist/templateFit.js +349 -0
  158. package/dist/templateIds.d.ts +138 -0
  159. package/dist/templateIds.js +144 -0
  160. package/dist/templateScopeAt.d.ts +131 -0
  161. package/dist/templateScopeAt.js +354 -0
  162. package/dist/testing.d.ts +177 -0
  163. package/dist/testing.js +383 -0
  164. package/dist/tokenizers.d.ts +113 -0
  165. package/dist/tokenizers.js +184 -0
  166. package/dist/turnLock.d.ts +96 -0
  167. package/dist/turnLock.js +79 -0
  168. package/dist/turnOrder.d.ts +143 -0
  169. package/dist/turnOrder.js +128 -0
  170. package/dist/validate.d.ts +74 -0
  171. package/dist/validate.js +1399 -0
  172. package/dist/values.d.ts +212 -0
  173. package/dist/values.js +390 -0
  174. package/dist/variables.d.ts +493 -0
  175. package/dist/variables.js +662 -0
  176. package/dist/verdicts.d.ts +275 -0
  177. package/dist/verdicts.js +348 -0
  178. package/dist/widgetDecls.d.ts +88 -0
  179. package/dist/widgetDecls.js +119 -0
  180. package/dist/widgets.d.ts +1527 -0
  181. package/dist/widgets.js +208 -0
  182. package/dist/wire.d.ts +126 -0
  183. package/dist/wire.js +140 -0
  184. package/dist/worldinfo.d.ts +150 -0
  185. package/dist/worldinfo.js +212 -0
  186. package/host-elements.d.ts +914 -0
  187. package/package.json +67 -0
@@ -0,0 +1,572 @@
1
+ /**
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).
6
+ *
7
+ * 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
9
+ * a client renders **one list** per venue and never hand-writes a verb button.
10
+ *
11
+ * ## The four declarations
12
+ *
13
+ * - **venue** — where the action appears, *per channel*: `{ kind, channel? }`.
14
+ * `VENUE_KINDS` is a closed set core owns; a plugin picks from it. An
15
+ * action may name several venues. A venue with no `channel` appears on
16
+ * every channel of the session.
17
+ * - **audience** — who may *see* and who may *act*, as participant
18
+ * references (`participants.ts`). Defaults per kind: a contributed action
19
+ * is seen by any `participant` and acted on by the `owner`
20
+ * (`DEFAULT_ACTION_AUDIENCE`); a core message verb is `item` — whoever the
21
+ * message belongs to, decided against the row at the venue.
22
+ * - **quick** — the one prominence flag. Every venue is a **primary set**
23
+ * (`quick: true`) plus an **overflow** that always lists every enabled
24
+ * action; composer actions are always reachable through `/`. Placement is
25
+ * presentation; availability is data (F40). A CSS pack may reposition the
26
+ * primary set, never remove an action.
27
+ * - **slash** — the stable ASCII id a composer action is called by. Core's
28
+ * specs claim bare names (`advance`, `narrate`); a plugin's are
29
+ * `<plugin>.<action>` (`acme.roll`), the plugin id being the spec's
30
+ * namespace — so a collision across owners is impossible by construction,
31
+ * and the palette autocompletes so nobody types the long form. Never
32
+ * localised (R-20): the palette shows the localised `label` beside it.
33
+ *
34
+ * - **enabled-when** (U5e, built 2026-09-17) — whether the action is offered
35
+ * *now*: a declared predicate over the session's **published values**, the
36
+ * junction clause's shape (`{ on: 'state.world.location', truthy: true,
37
+ * reason }`), never code. A list means all must hold. The genre supplies
38
+ * defaults per function (`GenreDecl.enabledWhen`); a session may override
39
+ * one function's; the action's own declaration sits between. The panel
40
+ * renders **why** a button is grey from the failing predicate's `reason`.
41
+ * The shape and its evaluator live in `predicates.ts`, shared with the
42
+ * junction clause.
43
+ *
44
+ * ## What this is not
45
+ *
46
+ * 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
48
+ * *availability* — the genre's `messageVerbs` and the preset's included set
49
+ * decide that; a declaration here says where and to whom an available action
50
+ * is offered.
51
+ */
52
+ import type { Audience } from './participants.js';
53
+ import type { I18n } from './descriptors.js';
54
+ import { type EnvoyDecl } from './genres.js';
55
+ import { type EnabledWhen, type EnabledWhenDecl } from './predicates.js';
56
+ import type { VerdictResult } from './verdicts.js';
57
+ export type { EnabledWhen, EnabledWhenDecl } from './predicates.js';
58
+ /** The two sides of the effects line (R-15). `fiction` is the default. @experimental */
59
+ export declare const ACTION_EFFECTS: readonly ['fiction', 'world'];
60
+ /** @experimental */
61
+ export type ActionEffects = (typeof ACTION_EFFECTS)[number];
62
+ /**
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;
65
+ * `optional` — an empty submit fires too, and `CollectedText.ifEmpty` says
66
+ * what that does. Was `COMPOSER_TEXT_MODES` (B10), when the text was read
67
+ * off the composer's draft.
68
+ * @experimental
69
+ */
70
+ export declare const TEXT_NEEDS: readonly ['required', 'optional'];
71
+ /**
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
75
+ * reaches the run as `input.text`, trimmed.
76
+ * @experimental
77
+ */
78
+ export interface CollectedText {
79
+ need: (typeof TEXT_NEEDS)[number];
80
+ /** The field's label — what the modal asks: "What do you whisper?". Display text (R-20). */
81
+ label: I18n;
82
+ /** The empty field's placeholder. Display text (R-20). */
83
+ placeholder?: I18n;
84
+ /**
85
+ * What an empty submit does, in one sentence — "The room decides."
86
+ * **Required when `need` is `optional`**: an empty box must say what
87
+ * pressing on will do. Display text (R-20).
88
+ */
89
+ ifEmpty?: I18n;
90
+ }
91
+ /**
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
94
+ * members**, each a `character:<id>` reference. They reach the run as
95
+ * `input.recipients`, validated by the host: seated and enabled, no
96
+ * duplicates, within `min` and `max`.
97
+ * @experimental
98
+ */
99
+ export interface CollectedRecipients {
100
+ /** The list's label — "Who hears it". Display text (R-20). */
101
+ label: I18n;
102
+ /** The fewest that may be picked. Default 1; never below 1. */
103
+ min?: number;
104
+ /** The most that may be picked. Absent: any number. */
105
+ max?: number;
106
+ /**
107
+ * 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
109
+ * `core:slot/whisper@1`. The collect modal shows each member's current
110
+ * value beside their box, so an overwrite is visible before it happens.
111
+ * Display only: what the run writes is the spec's.
112
+ */
113
+ overwrites?: string;
114
+ }
115
+ /**
116
+ * The venues a `world` action may appear in: never a form, the extra tab or a
117
+ * widget.
118
+ *
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
122
+ * 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
124
+ * own ⋮ and quick row: a person's button, pressed by the person, on a row.
125
+ * With `act` held to `owner` / `admin` (`WORLD_ACTION_ACTORS`), no block
126
+ * naming it, and no fire made **as** a participant, a `world` action there
127
+ * is the owner acting on a row — the same act as the composer's button,
128
+ * with the row as its subject. `extra` and `widget` stay out: a widget can
129
+ * invoke without a person's press.
130
+ * @experimental
131
+ */
132
+ export declare const WORLD_ACTION_VENUES: readonly VenueKind[];
133
+ /** The references a `world` action's `act` audience may name: the owner, an administrator. @experimental */
134
+ export declare const WORLD_ACTION_ACTORS: readonly string[];
135
+ /** An action's side of the line: what it declared, else `fiction`. @experimental */
136
+ export declare const effectsOf: (action: {
137
+ effects?: unknown;
138
+ }) => ActionEffects;
139
+ /**
140
+ * The closed set of places an action may appear. Core owns it; a plugin picks.
141
+ *
142
+ * `form` (U5d review, S1) is the one venue nothing lists: an action carried
143
+ * by a **form** — a `choices` or `form` block in a message — and pressed
144
+ * only from that block (the Adventure genre's *Answer*). A `form`-venue
145
+ * action never appears in a message's overflow, the composer's More menu or
146
+ * any other listing (`LISTED_VENUE_KINDS`); the block's fire still resolves
147
+ * it. A `world` action may not take it (`WORLD_ACTION_VENUES`): an
148
+ * out-of-fiction effect is never a question a message carries.
149
+ *
150
+ * ⚠ **`form` stays fiction-only even after L1** (ruled 2026-09-17). A block
151
+ * addressed to the **owner** may name a `world` action — see
152
+ * `worldBlockFunctions` — but a *venue* is declared and an *addressee* is
153
+ * decided at run time, so this check cannot see one and would have to admit
154
+ * every `form`-venue world action to admit the owner's. The owner-addressed
155
+ * block therefore names a `composer`-venue world action instead: the venue
156
+ * says where the declaration may be OFFERED, the addressee says who may press
157
+ * this particular button, and the two answers stay separate.
158
+ * @experimental
159
+ */
160
+ export declare const VENUE_KINDS: readonly ['composer', 'message', 'extra', 'widget', 'session-settings', 'pipelines', 'admin', 'review', 'form'];
161
+ /** @experimental */
162
+ export type VenueKind = (typeof VENUE_KINDS)[number];
163
+ /** The venues a listing offers — every kind but `form`, which only a block reaches. @experimental */
164
+ export declare const LISTED_VENUE_KINDS: readonly Exclude<VenueKind, 'form'>[];
165
+ /** @experimental */
166
+ export type ListedVenueKind = (typeof LISTED_VENUE_KINDS)[number];
167
+ /** Where an action appears, optionally on one channel only. @experimental */
168
+ export interface Venue {
169
+ kind: VenueKind;
170
+ /** A channel slug (20 §7). Absent = every channel of the session. */
171
+ channel?: string;
172
+ }
173
+ /**
174
+ * A contributed action, as a spec declares it under `contributes.actions[]`.
175
+ *
176
+ * `key` is the action's own identity within the spec — what a widget's
177
+ * `invoke(key)` names, what the *new* marker is kept against, and, joined to
178
+ * 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
180
+ * binding's subject, a preset's included set, a session's enablement row, a
181
+ * genre's enabled-when default, the fire, a block's `action`. There is no
182
+ * second routing key: two specs declaring the same `key` are two actions, and
183
+ * a person binds each on its own.
184
+ * @experimental
185
+ */
186
+ export interface ActionDecl {
187
+ key: string;
188
+ /**
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
191
+ * would be offered to nobody while still claiming a slash name — so it is
192
+ * refused at construction, in `validate()` and in `announce.build()`.
193
+ */
194
+ genre: string;
195
+ venue: Venue | Venue[];
196
+ audience?: Audience;
197
+ quick?: boolean;
198
+ /** The slash name. Composer actions without one are called by their `key`. */
199
+ slash?: string;
200
+ /** What the control reads — a string or a locale map with `en` (R-20); never the slash name. */
201
+ label: I18n;
202
+ /** A Lucide icon name, kebab-case. */
203
+ icon?: string;
204
+ /**
205
+ * 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
207
+ * `label`, which is right for nearly every action; give one only when the
208
+ * icon-only control should read differently from the named one. Needs an
209
+ * `icon`.
210
+ * @experimental
211
+ */
212
+ iconAlt?: I18n;
213
+ /**
214
+ * What the action does, in one plain sentence — display text (R-20).
215
+ * **Required** (2026-09-28): the session's action legend lists every
216
+ * action with it, and a control shows it as its tooltip, so a person can
217
+ * learn what a button does before pressing it. Say the effect, not the
218
+ * mechanism: "Roll the dice and post the result."
219
+ * @experimental
220
+ */
221
+ description: I18n;
222
+ /**
223
+ * When the action is offered (plans/29 R-15 *enabled-when*; U5e): a
224
+ * predicate — or a list, all of which must hold — over the session's
225
+ * published values, the junction clause's shape and never code. `on` is
226
+ * a dotted path such as `state.world.location`, `session.generating` or
227
+ * `item.hidden` (message venue) — not a port reference: actions live
228
+ * outside a run. `reason` says why the control is grey. Absent: the
229
+ * genre's default for this function, if it declares one, else always
230
+ * enabled. See `predicates.ts`.
231
+ */
232
+ enabledWhen?: EnabledWhenDecl;
233
+ /**
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
236
+ * predicate grammar as `enabledWhen`, over the same published values,
237
+ * and the opposite answer when it fails — the action is **hidden**, not
238
+ * grey: left out of every listing and refused at the door when pressed
239
+ * from one. A press on a form (a block) is judged by that form instead,
240
+ * which is its own evidence the action has something to act on.
241
+ *
242
+ * For an action that is nonsense rather than merely unavailable without
243
+ * its referent — the Lair's *Answer the door* with no door knocked
244
+ * (`session.openForm.action`). An `item.*` predicate is refused: a
245
+ * listing has no row to judge it on. Absent: always present.
246
+ * @experimental
247
+ */
248
+ presentWhen?: EnabledWhenDecl;
249
+ /**
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).
252
+ *
253
+ * `fiction` (the default): the result stays inside the story — a
254
+ * message, a state proposal, a narration, a branch (a copy of a session
255
+ * is still the fiction). `world`: the result touches something outside
256
+ * it — character cards, lorebook data, settings, permissions,
257
+ * connections. A `world` action may appear only in the `composer`,
258
+ * `message` (a row's own ⋮, since lair re-plan R11), `session-settings`,
259
+ * `admin` or `review` venues (never `form`, `extra` or `widget`), its `act` audience is `owner` and/or `admin`
260
+ * 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
263
+ * character asking a question is fine, and a character granting another
264
+ * character permission is impossible by construction. Refused at
265
+ * construction, in `validate()`, in `announce.build()` and at the host's
266
+ * publish.
267
+ */
268
+ effects?: ActionEffects;
269
+ /**
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
272
+ * "the Dice Master". Addressed as `envoy:<plugin>.<key>`
273
+ * (`envoyIdentity({ action: { specId } }, key)`), a cast member with
274
+ * `origin: action` once it has posted, and **`on-action` only**: it
275
+ * speaks through this action's outputs and is never a turn-taking
276
+ * candidate. `speaks` is stamped by `normalizeAction` and a declaration
277
+ * saying `in-turn` is refused.
278
+ */
279
+ envoy?: EnvoyDecl;
280
+ /**
281
+ * What the action asks for before it fires (lair pass R3, 2026-09-28):
282
+ * `text` (`CollectedText`) and/or `recipients` (`CollectedRecipients`).
283
+ * 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
285
+ * supplies the text instead. What was collected reaches the run as
286
+ * `input.text` and `input.recipients`. Absent: the action collects
287
+ * nothing, and its run's `input.text` is empty. Any venue. Was
288
+ * `composerText`, when the text was read off the composer's draft.
289
+ * @experimental
290
+ */
291
+ collects?: {
292
+ text?: CollectedText;
293
+ recipients?: CollectedRecipients;
294
+ };
295
+ }
296
+ /** A declaration after normalisation: venues and predicates always lists, no alias spellings, no `function`. @experimental */
297
+ export interface NormalizedAction extends ActionDecl {
298
+ venue: Venue[];
299
+ enabledWhen?: EnabledWhen[];
300
+ presentWhen?: EnabledWhen[];
301
+ envoy?: EnvoyDecl & {
302
+ speaks: 'on-action';
303
+ };
304
+ }
305
+ /** A contributed action's default audience: any member sees it, the owner acts. @internal */
306
+ export declare const DEFAULT_ACTION_AUDIENCE: Readonly<Audience>;
307
+ /** A core message verb's audience: whoever the message belongs to (the item rule). @experimental */
308
+ export declare const ITEM_AUDIENCE: Readonly<Audience>;
309
+ /** A bare slash name — core's and its genres'. @experimental */
310
+ export declare const BARE_SLASH: RegExp;
311
+ /** A plugin's slash name is `<plugin>.<action>`; the plugin id is the spec's namespace. @experimental */
312
+ export declare const NAMESPACED_SLASH: RegExp;
313
+ /**
314
+ * One venue's listing (F40 — every enabled action is reachable): the
315
+ * **primary set**, the actions declaring `quick`, and the **overflow**, the
316
+ * rest. Every action the venue holds is in exactly one of the two, so nothing
317
+ * is reachable only by prominence and nothing is dropped. Placement is
318
+ * presentation: a CSS pack may reposition the primary set and never remove an
319
+ * entry. The host's `SessionActionVenues` is this shape with its entries
320
+ * decorated (audience, the *new* mark, enablement).
321
+ * @experimental
322
+ */
323
+ export interface VenueListing<A> {
324
+ primary: A[];
325
+ overflow: A[];
326
+ }
327
+ /** Every listed venue's listing — `form` has none (`LISTED_VENUE_KINDS`). @experimental */
328
+ export type VenueListings<A> = Record<ListedVenueKind, VenueListing<A>>;
329
+ /**
330
+ * 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
332
+ * 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).
335
+ *
336
+ * Availability is decided BEFORE this: the genre's verbs, the preset's
337
+ * included set and enabled-when say which actions a session offers, and the
338
+ * host's `listSessionActions` decorates each. Pass the offered set and every
339
+ * entry lands in each of its venues exactly once. Pure, so a host can build
340
+ * the conformance kit's `listActions` seam on it — the SDK's own host does
341
+ * — and the kit itself never calls it: C19 judges the listing the HOST
342
+ * 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).
344
+ * @experimental
345
+ */
346
+ export declare function placeActions<A extends {
347
+ venue: ReadonlyArray<Venue>;
348
+ quick?: boolean;
349
+ }>(actions: ReadonlyArray<A>, channel?: string): VenueListings<A>;
350
+ /** The namespace of a spec id — `core:spec/narrate` → `core`, `acme:spec/roll` → `acme`. @experimental */
351
+ export declare function specNamespace(specId: string): string;
352
+ /** Is this namespace core's — the one whose actions take bare slash names? @experimental */
353
+ export declare const isCoreNamespace: (ns: string) => boolean;
354
+ /**
355
+ * The slash name an action is called by: the declared one, else derived from
356
+ * the key by the same rule a declared name must obey — `key` for core,
357
+ * `<plugin>.<key>` for a plugin. Always defined, so every composer action is
358
+ * reachable by `/` (F40) whether or not its author named one.
359
+ * @experimental
360
+ */
361
+ export declare function slashNameOf(action: {
362
+ key: string;
363
+ slash?: string;
364
+ }, specId: string): string;
365
+ /**
366
+ * The law one action finding comes from. Nearly every fault in a declaration
367
+ * is its shape — a venue core does not offer, a slash name outside the
368
+ * 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
370
+ * venue where a character could be asked to press it, or one whose `act`
371
+ * audience names someone other than the owner or an administrator. The
372
+ * validator labels each finding with its law, so a kit can key on `F41`
373
+ * rather than on a word in the sentence.
374
+ * @experimental
375
+ */
376
+ export interface ActionFinding {
377
+ law: 'R-15' | 'F41';
378
+ message: string;
379
+ /** What to do instead, where the law states one — an F41 finding quotes the verdict's fix. */
380
+ fix?: string;
381
+ }
382
+ /**
383
+ * The declaration half of the effects line's input — a `world` action's
384
+ * declared venue, or a reference its `act` audience names. The whole
385
+ * input, with the write and fire halves, is `EffectsLineInput` in
386
+ * `messageBlocks.ts`, where `core:verdict/effects-line` is declared.
387
+ * @experimental
388
+ */
389
+ export type EffectsLineDeclarationInput = {
390
+ kind: 'venue';
391
+ where: string;
392
+ effects: unknown;
393
+ venue: unknown;
394
+ } | {
395
+ kind: 'actor';
396
+ where: string;
397
+ effects: unknown;
398
+ ref: unknown;
399
+ };
400
+ /**
401
+ * The effects line at a declaration (R-15 *The line*; F41): a `world` action
402
+ * is owner-only and never in a form, extra or widget venue. Judged one venue or one
403
+ * reference at a time, so the sentence names the venue or the reference
404
+ * that crossed.
405
+ *
406
+ * This is the declaration half of `effectsLineVerdict`'s judge
407
+ * (`messageBlocks.ts`), defined here because `actionFindingsByLaw` — the
408
+ * construction and `validate()` door — sits below that module in the
409
+ * import graph and must not import it. The verdict calls this for a
410
+ * `venue` or `actor` input; the door calls it directly and quotes it.
411
+ * @experimental
412
+ */
413
+ export declare function worldActionCrossing(input: EffectsLineDeclarationInput): VerdictResult;
414
+ /**
415
+ * Every fault in one `ActionDecl.collects` (lair pass R3), as sentences: an
416
+ * unknown key, a missing label, an `optional` text with no `ifEmpty`, a
417
+ * `min` below 1 or a `max` below `min`. `where` is the field's address
418
+ * (`contributes.actions[nudge].collects`).
419
+ * @experimental
420
+ */
421
+ export declare function collectsFindings(raw: unknown, where: string): string[];
422
+ /**
423
+ * Every fault in one action declaration, as sentences — the teaching-error
424
+ * pattern (15 §1.3). Empty when the declaration is sound.
425
+ *
426
+ * `specId` decides which slash grammar applies: a `core:` spec may not claim a
427
+ * dotted name and a plugin spec may not claim a bare one, or a name outside its
428
+ * own namespace. That rule is the whole collision guarantee.
429
+ * @experimental
430
+ */
431
+ export declare function actionFindings(raw: unknown, specId: string, at?: string): string[];
432
+ /** `actionFindings`, each sentence with the law it comes from (`ActionFinding`). @experimental */
433
+ export declare function actionFindingsByLaw(raw: unknown, specId: string, at?: string): ActionFinding[];
434
+ /** The slash-name grammar, applied to one name for one spec. @experimental */
435
+ export declare function slashFindings(slash: string, specId: string, where?: string): string[];
436
+ /**
437
+ * The document form of one declaration: `venue` as a list. Returns a copy.
438
+ * @experimental
439
+ */
440
+ export declare function normalizeAction(raw: ActionDecl): NormalizedAction;
441
+ /**
442
+ * `contributes` after normalisation: every action in its document form.
443
+ * @experimental
444
+ */
445
+ export declare function normalizeContributes<T extends {
446
+ actions?: unknown[];
447
+ }>(contributes: T | undefined): (Omit<T, 'actions'> & {
448
+ actions?: NormalizedAction[];
449
+ }) | undefined;
450
+ /**
451
+ * Every action a document contributes, normalised, with the spec id each
452
+ * came from. The one reader hosts use.
453
+ * @experimental
454
+ */
455
+ export declare function actionsOf(doc: {
456
+ id: string;
457
+ contributes?: unknown;
458
+ }): Array<NormalizedAction & {
459
+ specId: string;
460
+ }>;
461
+ export { ACTION_IDENTITY, ACTION_IDENTITY_MAX_LENGTH, CORE_ACTION_SPEC_ID, actionIdentity, isActionIdentity, parseActionIdentity, } from './identity.js';
462
+ /**
463
+ * 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
465
+ * identity `<spec>#<key>` is the only routing key, two specs claiming one
466
+ * 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
468
+ * alternatives a binding selected among; the function is gone, and so is the
469
+ * exemption.) A plugin's names are namespaced (`acme.roll`), so a plugin
470
+ * declaring the same `key` as a core verb is a different identity under a
471
+ * different name, and never shadows it.
472
+ *
473
+ * Core's verbs hold their names first (U5c review, S1): every genre the list
474
+ * touches is seeded with `CORE_ACTIONS` under `core`, so a core spec claiming
475
+ * `/retry` collides with the verb rather than shadowing it in the palette. (A
476
+ * plugin spec cannot claim a bare name at all — that is the grammar's job.)
477
+ *
478
+ * `slashCollisions` is the whole rule; `validate()` applies it inside one
479
+ * document, `announce.build()` inside one package, and the host across every
480
+ * published spec of an install (a boot-time refusal).
481
+ * @experimental
482
+ */
483
+ export declare function slashCollisions(actions: ReadonlyArray<NormalizedAction & {
484
+ specId: string;
485
+ }>): string[];
486
+ /** Every finding on one document's contributed actions, sentences only. @internal */
487
+ export declare function actionDocumentFindings(doc: {
488
+ id: string;
489
+ contributes?: unknown;
490
+ }): string[];
491
+ /**
492
+ * `actionDocumentFindings` with the law each sentence comes from — what
493
+ * `validate()` labels its findings by. A slash collision is R-15's.
494
+ * @experimental
495
+ */
496
+ export declare function actionDocumentFindingsByLaw(doc: {
497
+ id: string;
498
+ contributes?: unknown;
499
+ }): ActionFinding[];
500
+ /**
501
+ * Who core's message verbs are for and where they live — the same shape a
502
+ * contributed action has, so the client renders one list.
503
+ *
504
+ * Every entry is a **built-in** (U5b): its `key` is the verb the
505
+ * message-verb handlers know (`sessionMessages:*`), never something
506
+ * `sessions:fireAction` routes; its identity is `core#<key>`
507
+ * (`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
509
+ * composer's *extra* venue (the turn controls), where it acts on the newest
510
+ * reply. Availability is the genre's (`messageVerbs`): a host lists an entry
511
+ * only when the genre offers it; the floors are always offered.
512
+ *
513
+ * Four entries are not message verbs but **turn controls**
514
+ * (`TURN_CONTROLS`, lair pass B7 + B8, R2): **`advance`**, the composer's
515
+ * Continue, which fires the turn order's head; **`pick`**, Pick who speaks;
516
+ * and **`narrate`**, a narrator turn — all `sessions:fireTurn` — and
517
+ * **`retake`**, Regenerate the last turn as a whole (`sessions:retakeTurn`).
518
+ * They live at the extra venue only, their presence is the genre's
519
+ * `turnControls`, and they act on no row. ⚠ `advance` is not `extend` — the prefill verb that
520
+ * extends one reply (`core#extend`, labelled Extend; renamed from
521
+ * `continue` 2026-09-28 so Continue means one press).
522
+ */
523
+ /**
524
+ * A core verb is declared without a `genre` (U5c review, S-E): it is offered
525
+ * in **every** genre — availability is the genre's `messageVerbs`, and the
526
+ * floors are not even that — so a genre on the declaration would name one
527
+ * and lie about the rest. `Omit` rather than a cast, so a verb missing a
528
+ * required field is a compile error here and not a runtime surprise in the
529
+ * host's list.
530
+ * @experimental
531
+ */
532
+ export interface CoreActionDecl extends Omit<NormalizedAction, 'genre'> {
533
+ /** stop · branch · edit — present in every genre. */
534
+ floor: boolean;
535
+ }
536
+ /**
537
+ * 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,
539
+ * menus and palette read these through the verdict, and a refusal at the
540
+ * door says the same words. The two conditions that are NOT published
541
+ * values — an edit in progress, the audience — keep their sentences on the
542
+ * client (`messageVerbState.ts`).
543
+ * @internal
544
+ */
545
+ export declare const CORE_VERB_REASONS: Readonly<{
546
+ readonly generating: {
547
+ readonly en: 'wait for the reply to finish';
548
+ };
549
+ readonly hidden: {
550
+ readonly en: 'unhide it first';
551
+ };
552
+ readonly notNewest: {
553
+ readonly en: 'only the newest reply can be regenerated';
554
+ };
555
+ readonly noSwipe: {
556
+ readonly en: 'nothing to swipe to';
557
+ };
558
+ readonly greeting: {
559
+ readonly en: 'a greeting is swiped, not regenerated';
560
+ };
561
+ readonly ownLine: {
562
+ readonly en: 'your own line is edited, not regenerated';
563
+ };
564
+ readonly nobodySeated: {
565
+ readonly en: 'nobody is seated to pick';
566
+ };
567
+ }>;
568
+ /** @internal */
569
+ export declare const CORE_ACTIONS: ReadonlyArray<CoreActionDecl>;
570
+ /** The core action a verb is, or undefined for a verb core does not describe. @internal */
571
+ export declare const coreAction: (key: string) => CoreActionDecl | undefined;
572
+ //# sourceMappingURL=actions.d.ts.map