@serene-pub/sdk 0.6.0-pr-4 → 0.6.0-pr-5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -19
- package/dist/actions.d.ts +149 -67
- package/dist/actions.js +89 -35
- package/dist/annexFields.d.ts +8 -4
- package/dist/annexFields.js +5 -2
- package/dist/announce.d.ts +78 -28
- package/dist/announce.js +14 -5
- package/dist/attributes.d.ts +9 -6
- package/dist/attributes.js +9 -5
- package/dist/bands.d.ts +41 -6
- package/dist/bands.js +83 -33
- package/dist/builder.d.ts +161 -58
- package/dist/builder.js +128 -22
- package/dist/candidates.d.ts +5 -3
- package/dist/candidates.js +3 -2
- package/dist/clauses.d.ts +2 -1
- package/dist/clauses.js +2 -1
- package/dist/component.d.ts +24 -7
- package/dist/component.js +16 -6
- package/dist/componentBuild.d.ts +16 -5
- package/dist/componentBuild.js +14 -5
- package/dist/componentClient.d.ts +61 -30
- package/dist/componentClient.js +11 -1
- package/dist/componentImports.d.ts +8 -5
- package/dist/componentImports.js +23 -4
- package/dist/componentModule.js +2 -1
- package/dist/componentWire.d.ts +2 -1
- package/dist/componentWire.js +34 -2
- package/dist/config.d.ts +28 -14
- package/dist/config.js +20 -10
- package/dist/connections.d.ts +9 -4
- package/dist/connections.js +7 -4
- package/dist/declarations.d.ts +46 -17
- package/dist/declarations.js +46 -15
- package/dist/descriptors.d.ts +242 -97
- package/dist/descriptors.js +145 -41
- package/dist/dev.d.ts +6 -5
- package/dist/dev.js +6 -5
- package/dist/document.d.ts +74 -25
- package/dist/document.js +32 -11
- package/dist/dowry.d.ts +241 -0
- package/dist/dowry.js +315 -0
- package/dist/engines.d.ts +16 -7
- package/dist/engines.js +6 -4
- package/dist/eventMapLaws.d.ts +19 -8
- package/dist/eventMapLaws.js +9 -6
- package/dist/events.d.ts +101 -39
- package/dist/events.js +106 -33
- package/dist/executor.d.ts +122 -41
- package/dist/executor.js +188 -95
- package/dist/extension.d.ts +99 -35
- package/dist/extension.js +43 -9
- package/dist/facets.d.ts +2 -1
- package/dist/facets.js +4 -2
- package/dist/foldedSections.d.ts +4 -2
- package/dist/foldedSections.js +2 -1
- package/dist/genres.d.ts +123 -41
- package/dist/genres.js +127 -22
- package/dist/guardedConnection.d.ts +4 -3
- package/dist/guardedConnection.js +4 -3
- package/dist/handlebarsReach.d.ts +1 -1
- package/dist/handlebarsReach.js +1 -1
- package/dist/hash.d.ts +16 -5
- package/dist/hash.js +14 -4
- package/dist/hookGrants.d.ts +3 -2
- package/dist/hookGrants.js +6 -4
- package/dist/hooks.d.ts +21 -16
- package/dist/hooks.js +12 -10
- package/dist/hostElements.d.ts +41 -17
- package/dist/hostElements.js +49 -17
- package/dist/i18n.d.ts +5 -3
- package/dist/i18n.js +5 -3
- package/dist/identity.d.ts +4 -3
- package/dist/identity.js +4 -3
- package/dist/index.d.ts +5 -0
- package/dist/index.js +15 -0
- package/dist/layout.d.ts +36 -15
- package/dist/layout.js +2 -2
- package/dist/loadouts.d.ts +97 -0
- package/dist/loadouts.js +81 -0
- package/dist/media.d.ts +26 -4
- package/dist/media.js +2 -1
- package/dist/messageBlocks.d.ts +44 -32
- package/dist/messageBlocks.js +23 -18
- package/dist/migration.d.ts +16 -8
- package/dist/migration.js +14 -8
- package/dist/names.d.ts +2 -1
- package/dist/names.js +2 -1
- package/dist/nodeInput.d.ts +2 -1
- package/dist/nodeInput.js +2 -1
- package/dist/participants.d.ts +22 -15
- package/dist/participants.js +14 -12
- package/dist/personGate.d.ts +2 -1
- package/dist/personGate.js +2 -1
- package/dist/pluginHarness.d.ts +8 -3
- package/dist/pluginHarness.js +4 -2
- package/dist/pluginPermissions.d.ts +2 -1
- package/dist/pluginPermissions.js +12 -1
- package/dist/pluginRuleRef.d.ts +2 -2
- package/dist/pluginRuleRef.js +1 -1
- package/dist/predicates.d.ts +16 -11
- package/dist/predicates.js +7 -6
- package/dist/preview.d.ts +8 -3
- package/dist/preview.js +2 -1
- package/dist/promptBlocks.d.ts +5 -3
- package/dist/promptBlocks.js +5 -3
- package/dist/rankingDecisions.d.ts +2 -1
- package/dist/rankingDecisions.js +2 -1
- package/dist/receipt.d.ts +65 -29
- package/dist/receipt.js +9 -4
- package/dist/receiverRules.js +3 -2
- package/dist/refs.d.ts +34 -9
- package/dist/refs.js +33 -13
- package/dist/registry.d.ts +42 -23
- package/dist/registry.js +7 -5
- package/dist/review.d.ts +16 -5
- package/dist/review.js +11 -4
- package/dist/sampling.d.ts +54 -0
- package/dist/sampling.js +95 -3
- package/dist/sceneSettings.d.ts +312 -0
- package/dist/sceneSettings.js +425 -0
- package/dist/scope.d.ts +6 -4
- package/dist/scope.js +4 -3
- package/dist/scripts.d.ts +81 -14
- package/dist/scripts.js +90 -11
- package/dist/sessionDossier.d.ts +521 -0
- package/dist/sessionDossier.js +33 -0
- package/dist/sessionLayout.d.ts +303 -19
- package/dist/sessionLayout.js +354 -40
- package/dist/sessionSettings.d.ts +8 -5
- package/dist/settings.d.ts +45 -20
- package/dist/settings.js +19 -12
- package/dist/settingsSlot.d.ts +11 -8
- package/dist/settingsSlot.js +11 -8
- package/dist/shapes.d.ts +99 -36
- package/dist/shapes.js +101 -35
- package/dist/sheets.d.ts +4 -2
- package/dist/sheets.js +6 -3
- package/dist/statShapes.d.ts +2 -1
- package/dist/statShapes.js +2 -1
- package/dist/status.d.ts +13 -9
- package/dist/status.js +8 -6
- package/dist/storage.d.ts +2 -1
- package/dist/storage.js +2 -1
- package/dist/storyTime.d.ts +13 -7
- package/dist/storyTime.js +11 -6
- package/dist/strokes.d.ts +176 -0
- package/dist/strokes.js +281 -0
- package/dist/surfaces.d.ts +54 -25
- package/dist/surfaces.js +3 -3
- package/dist/template.d.ts +9 -5
- package/dist/template.js +5 -3
- package/dist/templateCheck.d.ts +2 -2
- package/dist/templateCheck.js +2 -2
- package/dist/templateFit.d.ts +37 -8
- package/dist/templateFit.js +92 -8
- package/dist/templateIds.d.ts +3 -3
- package/dist/templateIds.js +3 -3
- package/dist/templateScopeAt.d.ts +21 -11
- package/dist/templateScopeAt.js +21 -11
- package/dist/testing.d.ts +11 -4
- package/dist/testing.js +13 -5
- package/dist/tokenizers.d.ts +2 -2
- package/dist/tokenizers.js +2 -2
- package/dist/turnLock.d.ts +4 -2
- package/dist/turnLock.js +2 -1
- package/dist/turnOrder.d.ts +17 -11
- package/dist/turnOrder.js +9 -5
- package/dist/validate.d.ts +11 -8
- package/dist/validate.js +81 -10
- package/dist/values.d.ts +17 -8
- package/dist/values.js +11 -6
- package/dist/variables.d.ts +46 -7
- package/dist/variables.js +87 -6
- package/dist/verdicts.d.ts +20 -13
- package/dist/verdicts.js +17 -11
- package/dist/widgetDecls.d.ts +8 -4
- package/dist/widgetDecls.js +4 -2
- package/dist/widgets.d.ts +987 -94
- package/dist/widgets.js +93 -18
- package/dist/wire.d.ts +13 -6
- package/dist/wire.js +3 -3
- package/dist/worldinfo.d.ts +11 -6
- package/dist/worldinfo.js +8 -4
- package/host-elements.d.ts +13 -0
- package/package.json +1 -1
package/dist/actions.js
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Actions — what a person (or an AI-portrayed participant) can invoke, and
|
|
3
|
-
* where (
|
|
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
|
|
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
|
|
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
|
|
30
|
+
* localised: the palette shows the localised `label` beside it.
|
|
33
31
|
*
|
|
34
|
-
* - **enabled-when** (
|
|
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,10 +42,11 @@
|
|
|
44
42
|
* ## What this is not
|
|
45
43
|
*
|
|
46
44
|
* Not a *pipeline* — an action *starts* one (`function` is the key routing
|
|
47
|
-
* resolves
|
|
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 { isParticipantRef, PARTICIPANT_ROLES } from './participants.js';
|
|
53
52
|
import { DEFAULT_CHANNEL, parseChannel } from './channels.js';
|
|
@@ -56,30 +55,57 @@ import { enabledWhenFindings, i18nFindings, isEnabledWhenShaped, normalizeEnable
|
|
|
56
55
|
import { i18nText } from './i18n.js';
|
|
57
56
|
import { CORE_ACTION_SPEC_ID } from './identity.js';
|
|
58
57
|
import { assertSlotId } from './attributes.js';
|
|
59
|
-
|
|
58
|
+
import { STORY_TIME_UNITS } from './storyTime.js';
|
|
59
|
+
/**
|
|
60
|
+
* The two sides of the effects line. `fiction` is the default.
|
|
61
|
+
* @experimental
|
|
62
|
+
* @ruling R-15
|
|
63
|
+
*/
|
|
60
64
|
export const ACTION_EFFECTS = ['fiction', 'world'];
|
|
61
65
|
/**
|
|
62
|
-
* How much an action needs the text it **collects
|
|
63
|
-
*
|
|
66
|
+
* How much an action needs the text it **collects**: `required` — the
|
|
67
|
+
* press does not fire without some;
|
|
64
68
|
* `optional` — an empty submit fires too, and `CollectedText.ifEmpty` says
|
|
65
|
-
* what that does. Was `COMPOSER_TEXT_MODES
|
|
69
|
+
* what that does. Was `COMPOSER_TEXT_MODES`, when the text was read
|
|
66
70
|
* off the composer's draft.
|
|
67
71
|
* @experimental
|
|
72
|
+
* @ruling lair pass R3 (2026-09-28), B10
|
|
68
73
|
*/
|
|
69
74
|
export const TEXT_NEEDS = ['required', 'optional'];
|
|
75
|
+
/** The largest step a press may collect, either way — a typo of 100000 years is refused, not stepped. @experimental */
|
|
76
|
+
export const CLOCK_STEP_MAX = 10_000;
|
|
77
|
+
/**
|
|
78
|
+
* Why a collected clock step cannot ride, as a sentence — or null when it can:
|
|
79
|
+
* `{ by, unit }`, a whole `by` other than zero within ±`CLOCK_STEP_MAX`, a unit
|
|
80
|
+
* of `STORY_TIME_UNITS`. The host's door and the modal ask the same.
|
|
81
|
+
* @experimental
|
|
82
|
+
*/
|
|
83
|
+
export function clockStepRefusal(raw) {
|
|
84
|
+
if (!raw || typeof raw !== 'object' || Array.isArray(raw))
|
|
85
|
+
return 'takes its time as { by, unit } — how many, and of what.';
|
|
86
|
+
const { by, unit } = raw;
|
|
87
|
+
if (typeof by !== 'number' || !Number.isInteger(by) || by === 0)
|
|
88
|
+
return 'takes a whole number of units other than zero.';
|
|
89
|
+
if (Math.abs(by) > CLOCK_STEP_MAX)
|
|
90
|
+
return `takes at most ${CLOCK_STEP_MAX} units at a time.`;
|
|
91
|
+
if (!STORY_TIME_UNITS.includes(unit))
|
|
92
|
+
return `counts in ${STORY_TIME_UNITS.join(', ')}.`;
|
|
93
|
+
return null;
|
|
94
|
+
}
|
|
70
95
|
/** The keys `ActionDecl.collects` may carry, and each request's own keys. */
|
|
71
|
-
const COLLECTS_KEYS = ['text', 'recipients'];
|
|
96
|
+
const COLLECTS_KEYS = ['text', 'recipients', 'clockStep'];
|
|
97
|
+
const COLLECTED_CLOCK_STEP_KEYS = ['label', 'default'];
|
|
72
98
|
const COLLECTED_TEXT_KEYS = ['need', 'label', 'placeholder', 'ifEmpty'];
|
|
73
99
|
const COLLECTED_RECIPIENTS_KEYS = ['label', 'min', 'max', 'overwrites'];
|
|
74
100
|
/**
|
|
75
101
|
* The venues a `world` action may appear in: never a form, the extra tab or a
|
|
76
102
|
* widget.
|
|
77
103
|
*
|
|
78
|
-
* ⚠ **`message` is on the owner's side since 2026-09-28
|
|
79
|
-
*
|
|
80
|
-
* to answer an out-of-fiction question
|
|
104
|
+
* ⚠ **`message` is on the owner's side since 2026-09-28**. The line exists
|
|
105
|
+
* so that a character can never be asked
|
|
106
|
+
* to answer an out-of-fiction question, and a question
|
|
81
107
|
* put to someone lives in the **`form`** venue — split out of `message` the
|
|
82
|
-
* day the line was built
|
|
108
|
+
* day the line was built. The `message` venue is a message's
|
|
83
109
|
* own ⋮ and quick row: a person's button, pressed by the person, on a row.
|
|
84
110
|
* With `act` held to `owner` / `admin` (`WORLD_ACTION_ACTORS`), no block
|
|
85
111
|
* naming it, and no fire made **as** a participant, a `world` action there
|
|
@@ -87,6 +113,7 @@ const COLLECTED_RECIPIENTS_KEYS = ['label', 'min', 'max', 'overwrites'];
|
|
|
87
113
|
* with the row as its subject. `extra` and `widget` stay out: a widget can
|
|
88
114
|
* invoke without a person's press.
|
|
89
115
|
* @experimental
|
|
116
|
+
* @ruling lair re-plan R11 *File as a room*, 29 R-15 *The line*, U5d review, S1
|
|
90
117
|
*/
|
|
91
118
|
export const WORLD_ACTION_VENUES = ['composer', 'message', 'session-settings', 'admin', 'review'];
|
|
92
119
|
/** The references a `world` action's `act` audience may name: the owner, an administrator. @experimental */
|
|
@@ -96,7 +123,7 @@ export const effectsOf = (action) => action.effects === 'world' ? 'world' : 'fic
|
|
|
96
123
|
/**
|
|
97
124
|
* The closed set of places an action may appear. Core owns it; a plugin picks.
|
|
98
125
|
*
|
|
99
|
-
* `form`
|
|
126
|
+
* `form` is the one venue nothing lists: an action carried
|
|
100
127
|
* by a **form** — a `choices` or `form` block in a message — and pressed
|
|
101
128
|
* only from that block (the Adventure genre's *Answer*). A `form`-venue
|
|
102
129
|
* action never appears in a message's overflow, the composer's More menu or
|
|
@@ -104,7 +131,7 @@ export const effectsOf = (action) => action.effects === 'world' ? 'world' : 'fic
|
|
|
104
131
|
* it. A `world` action may not take it (`WORLD_ACTION_VENUES`): an
|
|
105
132
|
* out-of-fiction effect is never a question a message carries.
|
|
106
133
|
*
|
|
107
|
-
* ⚠ **`form` stays fiction-only
|
|
134
|
+
* ⚠ **`form` stays fiction-only** (ruled 2026-09-17). A block
|
|
108
135
|
* addressed to the **owner** may name a `world` action — see
|
|
109
136
|
* `worldBlockFunctions` — but a *venue* is declared and an *addressee* is
|
|
110
137
|
* decided at run time, so this check cannot see one and would have to admit
|
|
@@ -113,6 +140,7 @@ export const effectsOf = (action) => action.effects === 'world' ? 'world' : 'fic
|
|
|
113
140
|
* says where the declaration may be OFFERED, the addressee says who may press
|
|
114
141
|
* this particular button, and the two answers stay separate.
|
|
115
142
|
* @experimental
|
|
143
|
+
* @ruling U5d review, S1, L1
|
|
116
144
|
*/
|
|
117
145
|
export const VENUE_KINDS = [
|
|
118
146
|
'composer',
|
|
@@ -143,10 +171,10 @@ export const BARE_SLASH = /^[a-z][a-z0-9-]*$/;
|
|
|
143
171
|
export const NAMESPACED_SLASH = /^([a-z0-9]+(?:[.-][a-z0-9]+)*)\.([a-z][a-z0-9-]*)$/;
|
|
144
172
|
/**
|
|
145
173
|
* Place actions into their venues for one channel — the placement rule every
|
|
146
|
-
* listing applies
|
|
174
|
+
* listing applies. `quick` → the primary set, else the
|
|
147
175
|
* overflow; a venue naming another channel's slug is skipped (a bare slug
|
|
148
|
-
* means every lane of it
|
|
149
|
-
* block alone reaches it
|
|
176
|
+
* means every lane of it); a `form` venue is listed nowhere — the
|
|
177
|
+
* block alone reaches it.
|
|
150
178
|
*
|
|
151
179
|
* Availability is decided BEFORE this: the genre's verbs, the preset's
|
|
152
180
|
* included set and enabled-when say which actions a session offers, and the
|
|
@@ -155,8 +183,9 @@ export const NAMESPACED_SLASH = /^([a-z0-9]+(?:[.-][a-z0-9]+)*)\.([a-z][a-z0-9-]
|
|
|
155
183
|
* the conformance kit's `listActions` seam on it — the SDK's own host does
|
|
156
184
|
* — and the kit itself never calls it: C19 judges the listing the HOST
|
|
157
185
|
* returns, entry by entry, and a rule the kit applied for the host would be
|
|
158
|
-
* a rule it could not see the host break
|
|
186
|
+
* a rule it could not see the host break.
|
|
159
187
|
* @experimental
|
|
188
|
+
* @ruling F40, R-15 *quick*, 20 §7, U5d review, S1, U7 review, C1
|
|
160
189
|
*/
|
|
161
190
|
export function placeActions(actions, channel = DEFAULT_CHANNEL) {
|
|
162
191
|
const listings = {};
|
|
@@ -185,8 +214,9 @@ export const isCoreNamespace = (ns) => ns === 'core';
|
|
|
185
214
|
* The slash name an action is called by: the declared one, else derived from
|
|
186
215
|
* the key by the same rule a declared name must obey — `key` for core,
|
|
187
216
|
* `<plugin>.<key>` for a plugin. Always defined, so every composer action is
|
|
188
|
-
* reachable by `/`
|
|
217
|
+
* reachable by `/` whether or not its author named one.
|
|
189
218
|
* @experimental
|
|
219
|
+
* @ruling F40
|
|
190
220
|
*/
|
|
191
221
|
export function slashNameOf(action, specId) {
|
|
192
222
|
if (action.slash)
|
|
@@ -200,7 +230,7 @@ const EFFECTS_LINE_FIX = `move the action to a venue on the owner's side of the
|
|
|
200
230
|
`and keep audience.act to ${WORLD_ACTION_ACTORS.join(' and/or ')} — or declare effects: 'fiction' ` +
|
|
201
231
|
`if its result stays inside the story`;
|
|
202
232
|
/**
|
|
203
|
-
* The effects line at a declaration
|
|
233
|
+
* The effects line at a declaration: a `world` action
|
|
204
234
|
* is owner-only and never in a form, extra or widget venue. Judged one venue or one
|
|
205
235
|
* reference at a time, so the sentence names the venue or the reference
|
|
206
236
|
* that crossed.
|
|
@@ -211,6 +241,7 @@ const EFFECTS_LINE_FIX = `move the action to a venue on the owner's side of the
|
|
|
211
241
|
* import graph and must not import it. The verdict calls this for a
|
|
212
242
|
* `venue` or `actor` input; the door calls it directly and quotes it.
|
|
213
243
|
* @experimental
|
|
244
|
+
* @ruling R-15 *The line*, F41
|
|
214
245
|
*/
|
|
215
246
|
export function worldActionCrossing(input) {
|
|
216
247
|
if (input.effects !== 'world')
|
|
@@ -239,11 +270,12 @@ export function worldActionCrossing(input) {
|
|
|
239
270
|
};
|
|
240
271
|
}
|
|
241
272
|
/**
|
|
242
|
-
* Every fault in one `ActionDecl.collects
|
|
273
|
+
* Every fault in one `ActionDecl.collects`, as sentences: an
|
|
243
274
|
* unknown key, a missing label, an `optional` text with no `ifEmpty`, a
|
|
244
275
|
* `min` below 1 or a `max` below `min`. `where` is the field's address
|
|
245
276
|
* (`contributes.actions[nudge].collects`).
|
|
246
277
|
* @experimental
|
|
278
|
+
* @ruling lair pass R3
|
|
247
279
|
*/
|
|
248
280
|
export function collectsFindings(raw, where) {
|
|
249
281
|
const out = [];
|
|
@@ -253,7 +285,7 @@ export function collectsFindings(raw, where) {
|
|
|
253
285
|
out.push(`${at}: '${k}' is not something an action collects here — one of ${known.join(', ')}`);
|
|
254
286
|
};
|
|
255
287
|
if (!raw || typeof raw !== 'object' || Array.isArray(raw))
|
|
256
|
-
return [`${where} is { text?, recipients? } — what the press asks for before it fires`];
|
|
288
|
+
return [`${where} is { text?, recipients?, clockStep? } — what the press asks for before it fires`];
|
|
257
289
|
const c = raw;
|
|
258
290
|
unknownKeys(c, COLLECTS_KEYS, where);
|
|
259
291
|
if (c.text !== undefined) {
|
|
@@ -304,18 +336,37 @@ export function collectsFindings(raw, where) {
|
|
|
304
336
|
}
|
|
305
337
|
}
|
|
306
338
|
}
|
|
307
|
-
if (c.
|
|
308
|
-
|
|
339
|
+
if (c.clockStep !== undefined) {
|
|
340
|
+
const at = `${where}.clockStep`;
|
|
341
|
+
const k = c.clockStep;
|
|
342
|
+
if (!k || typeof k !== 'object' || Array.isArray(k))
|
|
343
|
+
out.push(`${at} is { label, default? } — the amount of story time the modal's stepper asks for`);
|
|
344
|
+
else {
|
|
345
|
+
unknownKeys(k, COLLECTED_CLOCK_STEP_KEYS, at);
|
|
346
|
+
out.push(...i18nFindings(k.label, `${at}.label`, { required: true }));
|
|
347
|
+
if (k.default !== undefined) {
|
|
348
|
+
const why = clockStepRefusal(k.default);
|
|
349
|
+
const by = k.default?.by;
|
|
350
|
+
if (why)
|
|
351
|
+
out.push(`${at}.default ${why}`);
|
|
352
|
+
else if (by < 0)
|
|
353
|
+
out.push(`${at}.default.by is above 0 — the stepper opens going forward; Back is the person's`);
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
if (c.text === undefined && c.recipients === undefined && c.clockStep === undefined && !out.length)
|
|
358
|
+
out.push(`${where} collects nothing — declare text, recipients, clockStep, or leave collects out`);
|
|
309
359
|
return out;
|
|
310
360
|
}
|
|
311
361
|
/**
|
|
312
362
|
* Every fault in one action declaration, as sentences — the teaching-error
|
|
313
|
-
* pattern
|
|
363
|
+
* pattern. Empty when the declaration is sound.
|
|
314
364
|
*
|
|
315
365
|
* `specId` decides which slash grammar applies: a `core:` spec may not claim a
|
|
316
366
|
* dotted name and a plugin spec may not claim a bare one, or a name outside its
|
|
317
367
|
* own namespace. That rule is the whole collision guarantee.
|
|
318
368
|
* @experimental
|
|
369
|
+
* @ruling 15 §1.3
|
|
319
370
|
*/
|
|
320
371
|
export function actionFindings(raw, specId, at = 'contributes.actions') {
|
|
321
372
|
return actionFindingsByLaw(raw, specId, at).map((f) => f.message);
|
|
@@ -543,16 +594,16 @@ export function actionsOf(doc) {
|
|
|
543
594
|
export { ACTION_IDENTITY, ACTION_IDENTITY_MAX_LENGTH, CORE_ACTION_SPEC_ID, actionIdentity, isActionIdentity, parseActionIdentity, } from './identity.js';
|
|
544
595
|
/**
|
|
545
596
|
* A slash collision: two actions offered to one genre under one name. One
|
|
546
|
-
* slash name means one action (
|
|
597
|
+
* slash name means one action (ruled 2026-09-17): since the
|
|
547
598
|
* identity `<spec>#<key>` is the only routing key, two specs claiming one
|
|
548
599
|
* name are two actions a palette could not tell apart — a collision, not
|
|
549
|
-
* alternatives. (Until
|
|
600
|
+
* alternatives. (Until then two specs sharing a *function* under one name were
|
|
550
601
|
* alternatives a binding selected among; the function is gone, and so is the
|
|
551
602
|
* exemption.) A plugin's names are namespaced (`acme.roll`), so a plugin
|
|
552
603
|
* declaring the same `key` as a core verb is a different identity under a
|
|
553
604
|
* different name, and never shadows it.
|
|
554
605
|
*
|
|
555
|
-
* Core's verbs hold their names first
|
|
606
|
+
* Core's verbs hold their names first: every genre the list
|
|
556
607
|
* touches is seeded with `CORE_ACTIONS` under `core`, so a core spec claiming
|
|
557
608
|
* `/retry` collides with the verb rather than shadowing it in the palette. (A
|
|
558
609
|
* plugin spec cannot claim a bare name at all — that is the grammar's job.)
|
|
@@ -561,6 +612,7 @@ export { ACTION_IDENTITY, ACTION_IDENTITY_MAX_LENGTH, CORE_ACTION_SPEC_ID, actio
|
|
|
561
612
|
* document, `announce.build()` inside one package, and the host across every
|
|
562
613
|
* published spec of an install (a boot-time refusal).
|
|
563
614
|
* @experimental
|
|
615
|
+
* @ruling plans/31 V2, U5c review, S1
|
|
564
616
|
*/
|
|
565
617
|
export function slashCollisions(actions) {
|
|
566
618
|
const seen = new Map();
|
|
@@ -618,12 +670,13 @@ export function actionDocumentFindingsByLaw(doc) {
|
|
|
618
670
|
}
|
|
619
671
|
/**
|
|
620
672
|
* The sentences beside a grey core verb, as locale maps — the `reason` of
|
|
621
|
-
* each verb's enabled-when below
|
|
673
|
+
* each verb's enabled-when below. One vocabulary: the host's chips,
|
|
622
674
|
* menus and palette read these through the verdict, and a refusal at the
|
|
623
675
|
* door says the same words. The two conditions that are NOT published
|
|
624
676
|
* values — an edit in progress, the audience — keep their sentences on the
|
|
625
677
|
* client (`messageVerbState.ts`).
|
|
626
678
|
* @internal
|
|
679
|
+
* @ruling U5e
|
|
627
680
|
*/
|
|
628
681
|
export const CORE_VERB_REASONS = Object.freeze({
|
|
629
682
|
generating: { en: 'wait for the reply to finish' },
|
|
@@ -645,8 +698,9 @@ const NEWEST = { on: 'item.isNewest', truthy: true, reason: CORE_VERB_REASONS.no
|
|
|
645
698
|
/**
|
|
646
699
|
* The row is a reply — retry, extend and swipe write a reply over the row,
|
|
647
700
|
* so on the author's own line (`role: 'user'`) they would overwrite what the
|
|
648
|
-
* author wrote with the narrator's prose (
|
|
701
|
+
* author wrote with the narrator's prose (in every persona-less genre). Keyed
|
|
649
702
|
* on the role, never on a persona: a persona-less author line has none.
|
|
703
|
+
* @ruling F1
|
|
650
704
|
*/
|
|
651
705
|
const REPLY = { on: 'item.role', equals: 'assistant', reason: CORE_VERB_REASONS.ownLine };
|
|
652
706
|
/** @internal */
|
package/dist/annexFields.d.ts
CHANGED
|
@@ -41,12 +41,13 @@
|
|
|
41
41
|
* declaration, so a field can only ever describe its own package's document.
|
|
42
42
|
* Core's own keys are core-catalog's `CORE_ANNEX_FIELDS`, under `core`.
|
|
43
43
|
*
|
|
44
|
-
* Never credentials or personal data
|
|
44
|
+
* Never credentials or personal data: a shape holding a `secret`
|
|
45
45
|
* anywhere is refused at the declaration.
|
|
46
46
|
*
|
|
47
47
|
* @experimental 🚧 provisional — the vocabulary (annex field, annex
|
|
48
48
|
* declaration, settable, the `<owner>:annex#<key>` identity) is new with this
|
|
49
49
|
* module.
|
|
50
|
+
* @ruling R61
|
|
50
51
|
*/
|
|
51
52
|
import { type FieldDecl, type SettingsSchema } from './settings.js';
|
|
52
53
|
import { type I18n } from './i18n.js';
|
|
@@ -69,9 +70,10 @@ export interface AnnexFieldDecl {
|
|
|
69
70
|
/** What the value must be — the settings vocabulary's `FieldDecl`, checked by `checkValues`. */
|
|
70
71
|
readonly shape: FieldDecl;
|
|
71
72
|
/**
|
|
72
|
-
* Who may SEE the stored value besides pipelines
|
|
73
|
+
* Who may SEE the stored value besides pipelines — a data
|
|
73
74
|
* audience (participant references). `[]` (the default) is
|
|
74
|
-
* pipelines only
|
|
75
|
+
* pipelines only: a widget cannot read back a value nobody may see.
|
|
76
|
+
* @ruling R57, R59
|
|
75
77
|
*/
|
|
76
78
|
readonly see: readonly string[];
|
|
77
79
|
/**
|
|
@@ -165,7 +167,9 @@ export declare const isSettableAnnexField: (f: Pick<AnnexFieldDecl, 'act'>) => b
|
|
|
165
167
|
* An owner's annex schema — key → declared shape — for a session of `genre`
|
|
166
168
|
* (or every genre, with none). Undefined when the owner is unknown here; `{}`
|
|
167
169
|
* when it declares nothing. What a typed template reads `annex.<owner>.<key>`
|
|
168
|
-
* against
|
|
170
|
+
* against.
|
|
171
|
+
* @experimental
|
|
172
|
+
* @ruling typed-templates §1b, P6
|
|
169
173
|
*/
|
|
170
174
|
export declare function annexSchemaOf(owner: string, genre?: string): SettingsSchema | undefined;
|
|
171
175
|
/**
|
package/dist/annexFields.js
CHANGED
|
@@ -41,12 +41,13 @@
|
|
|
41
41
|
* declaration, so a field can only ever describe its own package's document.
|
|
42
42
|
* Core's own keys are core-catalog's `CORE_ANNEX_FIELDS`, under `core`.
|
|
43
43
|
*
|
|
44
|
-
* Never credentials or personal data
|
|
44
|
+
* Never credentials or personal data: a shape holding a `secret`
|
|
45
45
|
* anywhere is refused at the declaration.
|
|
46
46
|
*
|
|
47
47
|
* @experimental 🚧 provisional — the vocabulary (annex field, annex
|
|
48
48
|
* declaration, settable, the `<owner>:annex#<key>` identity) is new with this
|
|
49
49
|
* module.
|
|
50
|
+
* @ruling R61
|
|
50
51
|
*/
|
|
51
52
|
import { dataAudienceFindings, isParticipantRef } from './participants.js';
|
|
52
53
|
import { checkSchema, checkValues } from './settings.js';
|
|
@@ -257,7 +258,9 @@ export const isSettableAnnexField = (f) => !!f.act?.length;
|
|
|
257
258
|
* An owner's annex schema — key → declared shape — for a session of `genre`
|
|
258
259
|
* (or every genre, with none). Undefined when the owner is unknown here; `{}`
|
|
259
260
|
* when it declares nothing. What a typed template reads `annex.<owner>.<key>`
|
|
260
|
-
* against
|
|
261
|
+
* against.
|
|
262
|
+
* @experimental
|
|
263
|
+
* @ruling typed-templates §1b, P6
|
|
261
264
|
*/
|
|
262
265
|
export function annexSchemaOf(owner, genre) {
|
|
263
266
|
const fields = declarations.get(owner);
|