@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.
- package/README.md +24 -20
- package/dist/actions.d.ts +150 -68
- package/dist/actions.js +90 -36
- 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 +195 -96
- 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 +5 -4
- package/dist/identity.js +5 -4
- 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 +103 -41
- package/dist/shapes.js +105 -40
- 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/announce.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* announce() — the serializer behind `defineExtension()
|
|
2
|
+
* announce() — the serializer behind `defineExtension()`. A package
|
|
3
3
|
* is authored with `defineExtension()`; `announcementOf()` compiles that to the
|
|
4
4
|
* announcement document this builder produces. Kept exported for core's and
|
|
5
5
|
* the CLI's use, and for one release of packages still exporting a builder.
|
|
6
6
|
*
|
|
7
|
-
* Was: "the ONE authoring surface"
|
|
7
|
+
* Was: "the ONE authoring surface".
|
|
8
8
|
*
|
|
9
9
|
* A package is an announcement: identity first, then everything it declares —
|
|
10
10
|
* genres, hook declarations, pipelines, configs, presets. Plugins compile the
|
|
@@ -19,20 +19,22 @@
|
|
|
19
19
|
* Cross-package references are ids with the referenced thing's owner in them
|
|
20
20
|
* (`use()` handles compile down to these). Referencing something external is
|
|
21
21
|
* allowed and recorded; what the instance enforces at install is the
|
|
22
|
-
* requirement, not the bundle
|
|
22
|
+
* requirement, not the bundle.
|
|
23
|
+
* @ruling R48, T1b, 24 §6, 24 §10
|
|
23
24
|
*/
|
|
24
25
|
import type { BuiltSpec } from './builder.js';
|
|
25
26
|
import { type SpecDocument } from './document.js';
|
|
26
27
|
/** announce() accepts pipelines built or already compiled — one shape lands. @experimental */
|
|
27
28
|
export type AnnouncedSpec = BuiltSpec | SpecDocument;
|
|
28
29
|
/**
|
|
29
|
-
* A reference to something another package ships
|
|
30
|
+
* A reference to something another package ships: an id plus an
|
|
30
31
|
* optional semver range. `use()` handles compile to references in the
|
|
31
32
|
* document and requirements in the manifest — never a bundle. The
|
|
32
33
|
* fully-typed form (option autocomplete off the published declaration
|
|
33
34
|
* artifact's generated .d.ts) rides the artifact work; this is the
|
|
34
35
|
* reference primitive both share.
|
|
35
36
|
* @experimental
|
|
37
|
+
* @ruling 24 §10
|
|
36
38
|
*/
|
|
37
39
|
export interface ExternalRef {
|
|
38
40
|
readonly kind: 'external-ref';
|
|
@@ -44,9 +46,10 @@ export interface ExternalRef {
|
|
|
44
46
|
/**
|
|
45
47
|
* An external reference carrying its target's option space in the type —
|
|
46
48
|
* what the generated typings (`serene-pub types`) produce, so a config over
|
|
47
|
-
* another package's pipeline autocompletes node → slot → field
|
|
49
|
+
* another package's pipeline autocompletes node → slot → field.
|
|
48
50
|
* The phantom never exists at runtime; the document still stores the id.
|
|
49
51
|
* @experimental
|
|
52
|
+
* @ruling 24 T7b
|
|
50
53
|
*/
|
|
51
54
|
export interface TypedExternalRef<T> extends ExternalRef {
|
|
52
55
|
readonly __options?: T;
|
|
@@ -80,18 +83,22 @@ export interface PackageIdentity {
|
|
|
80
83
|
/** The package namespace every declared id lives under — `core`, `acme.dice`. */
|
|
81
84
|
ns: string;
|
|
82
85
|
author: string;
|
|
83
|
-
/**
|
|
86
|
+
/**
|
|
87
|
+
* What the package is called where it is listed — a string or a locale map with `en`.
|
|
88
|
+
* @ruling R-20
|
|
89
|
+
*/
|
|
84
90
|
title: I18n;
|
|
85
91
|
repo?: string;
|
|
86
92
|
summary?: I18n;
|
|
87
93
|
description?: I18n;
|
|
88
94
|
}
|
|
89
95
|
/**
|
|
90
|
-
* A hook *declaration
|
|
96
|
+
* A hook *declaration*: identity, event, contract, ordering. The
|
|
91
97
|
* implementation lives with its capabilities — core's in core, a plugin's in
|
|
92
98
|
* its sandboxed bundle — and boot/install binds implementation to declared id
|
|
93
99
|
* with a completeness check.
|
|
94
100
|
* @experimental
|
|
101
|
+
* @ruling 24 §11
|
|
95
102
|
*/
|
|
96
103
|
export interface HookDeclaration {
|
|
97
104
|
event: string;
|
|
@@ -101,7 +108,7 @@ export interface HookDeclaration {
|
|
|
101
108
|
after?: string[];
|
|
102
109
|
}
|
|
103
110
|
/**
|
|
104
|
-
* A shipped prompt
|
|
111
|
+
* A shipped prompt: authored prose for one NODE's prompts slot,
|
|
105
112
|
* selectable wherever that node is used. The slug is the stable identity an
|
|
106
113
|
* instance's seed pass matches on; the label is display.
|
|
107
114
|
*
|
|
@@ -110,6 +117,7 @@ export interface HookDeclaration {
|
|
|
110
117
|
* the prompts written for it, and one built from other nodes is offered none of
|
|
111
118
|
* them. Spec scoping said the same thing less precisely and cost the reuse.
|
|
112
119
|
* @experimental
|
|
120
|
+
* @ruling 24 T6b
|
|
113
121
|
*/
|
|
114
122
|
export interface PromptDecl {
|
|
115
123
|
/**
|
|
@@ -124,17 +132,27 @@ export interface PromptDecl {
|
|
|
124
132
|
*/
|
|
125
133
|
slot: string;
|
|
126
134
|
slug: string;
|
|
127
|
-
/**
|
|
135
|
+
/**
|
|
136
|
+
* The name a picker lists it by — a string or a locale map with `en`.
|
|
137
|
+
* @ruling R-20
|
|
138
|
+
*/
|
|
128
139
|
label: I18n;
|
|
129
140
|
/** Field name → prose, exactly as that slot declares them. */
|
|
130
141
|
fields: Record<string, string>;
|
|
131
142
|
}
|
|
132
|
-
/**
|
|
143
|
+
/**
|
|
144
|
+
* A named configuration: a typed delta over a spec's author defaults.
|
|
145
|
+
* @experimental
|
|
146
|
+
* @ruling 24 §7
|
|
147
|
+
*/
|
|
133
148
|
export interface ConfigDecl {
|
|
134
149
|
/** The spec it configures — may be external (another package's id). */
|
|
135
150
|
spec: string;
|
|
136
151
|
slug: string;
|
|
137
|
-
/**
|
|
152
|
+
/**
|
|
153
|
+
* The name a picker lists it by — a string or a locale map with `en`.
|
|
154
|
+
* @ruling R-20
|
|
155
|
+
*/
|
|
138
156
|
label: I18n;
|
|
139
157
|
description?: I18n;
|
|
140
158
|
/** nodeKey → slot → value. Only deviations; everything else inherits. */
|
|
@@ -172,7 +190,7 @@ export interface PresetBinding {
|
|
|
172
190
|
config?: string;
|
|
173
191
|
}
|
|
174
192
|
/**
|
|
175
|
-
* What a preset pre-fills the creation form with
|
|
193
|
+
* What a preset pre-fills the creation form with.
|
|
176
194
|
*
|
|
177
195
|
* Every key optional and every key advisory: the form applies the ones it
|
|
178
196
|
* recognises, type-checks each, and ignores the rest — so a preset written
|
|
@@ -180,12 +198,13 @@ export interface PresetBinding {
|
|
|
180
198
|
* genre's own fields ride along in `genreFields` rather than growing this
|
|
181
199
|
* shape a key at a time.
|
|
182
200
|
* @experimental
|
|
201
|
+
* @ruling 23 §9
|
|
183
202
|
*/
|
|
184
203
|
export interface PresetDefaults {
|
|
185
204
|
name?: string;
|
|
186
205
|
scenario?: string;
|
|
187
206
|
/**
|
|
188
|
-
* Swaps to seat the session with
|
|
207
|
+
* Swaps to seat the session with: for each, a definition the named
|
|
189
208
|
* spec offers on the named node — its pin or one of its `expose.swaps`,
|
|
190
209
|
* or an enabled contribution. The same shape a package contributes with
|
|
191
210
|
* (`SwapContribution`), stored with ids:
|
|
@@ -193,6 +212,7 @@ export interface PresetDefaults {
|
|
|
193
212
|
* Written as the session's rebinds at create; an entry the node does not
|
|
194
213
|
* offer is refused there, logged, and the session starts on the pin.
|
|
195
214
|
* Replaced `speakerStrategy` (2026-09-23), which named one node.
|
|
215
|
+
* @ruling R40
|
|
196
216
|
*/
|
|
197
217
|
swaps?: StoredSwapContribution[];
|
|
198
218
|
lorebookId?: number | null;
|
|
@@ -200,32 +220,38 @@ export interface PresetDefaults {
|
|
|
200
220
|
/** The genre's declared fields, by key. */
|
|
201
221
|
genreFields?: Record<string, unknown>;
|
|
202
222
|
/**
|
|
203
|
-
* Envoys to seat on creation, by slug
|
|
223
|
+
* Envoys to seat on creation, by slug — beside the genre's
|
|
204
224
|
* `default: true` ones, which are seated with no choice. A slug the
|
|
205
225
|
* genre (or an installed action) does not declare is ignored, on the
|
|
206
226
|
* same advisory terms as every other key here.
|
|
227
|
+
* @ruling R-18, U5g
|
|
207
228
|
*/
|
|
208
229
|
envoys?: string[];
|
|
209
230
|
}
|
|
210
231
|
/**
|
|
211
|
-
* A preset populates a genre's event slots
|
|
232
|
+
* A preset populates a genre's event slots: for each event the genre
|
|
212
233
|
* declares, which pipeline variant answers it, with which config.
|
|
213
234
|
* @experimental
|
|
235
|
+
* @ruling 24 §1
|
|
214
236
|
*/
|
|
215
237
|
export interface PresetDecl {
|
|
216
238
|
slug: string;
|
|
217
239
|
genre: string;
|
|
218
|
-
/**
|
|
240
|
+
/**
|
|
241
|
+
* The name the picker lists it by — a string or a locale map with `en`.
|
|
242
|
+
* @ruling R-20
|
|
243
|
+
*/
|
|
219
244
|
label: I18n;
|
|
220
245
|
description?: I18n;
|
|
221
246
|
bindings: Record<string, PresetBinding>;
|
|
222
247
|
/**
|
|
223
248
|
* For the open `session-action` slot: which actions come along, each by
|
|
224
|
-
* its **identity** — `<spec slug>#<key
|
|
249
|
+
* its **identity** — `<spec slug>#<key>`. A preset
|
|
225
250
|
* curates declarations, never functions: two specs contributing one
|
|
226
251
|
* function are two entries, and including one says nothing about the
|
|
227
252
|
* other. Absent means the host's companion rule (every action from the
|
|
228
253
|
* genre owner's own namespace).
|
|
254
|
+
* @ruling U5c review, W-A
|
|
229
255
|
*/
|
|
230
256
|
actions?: {
|
|
231
257
|
include: string[];
|
|
@@ -311,7 +337,10 @@ export type PresetDefaultsInput = Omit<PresetDefaults, 'swaps'> & {
|
|
|
311
337
|
export interface PresetInput {
|
|
312
338
|
slug: string;
|
|
313
339
|
genre: GenreDecl | ExternalRef;
|
|
314
|
-
/**
|
|
340
|
+
/**
|
|
341
|
+
* The name the picker lists it by — a string or a locale map with `en`.
|
|
342
|
+
* @ruling R-20
|
|
343
|
+
*/
|
|
315
344
|
label: I18n;
|
|
316
345
|
description?: I18n;
|
|
317
346
|
bindings: BindingEntry[];
|
|
@@ -331,7 +360,11 @@ export interface PresetInput {
|
|
|
331
360
|
* @experimental
|
|
332
361
|
*/
|
|
333
362
|
export declare function preset(input: PresetInput): PresetDecl;
|
|
334
|
-
/**
|
|
363
|
+
/**
|
|
364
|
+
* The compiled announcement — the package's declaration artifact.
|
|
365
|
+
* @experimental
|
|
366
|
+
* @ruling 24 §10
|
|
367
|
+
*/
|
|
335
368
|
export interface AnnouncementDocument {
|
|
336
369
|
schemaVersion: 1;
|
|
337
370
|
identity: PackageIdentity;
|
|
@@ -343,17 +376,22 @@ export interface AnnouncementDocument {
|
|
|
343
376
|
configs: ConfigDecl[];
|
|
344
377
|
presets: PresetDecl[];
|
|
345
378
|
/**
|
|
346
|
-
* Frame surfaces this package ships
|
|
379
|
+
* Frame surfaces this package ships — the documents an
|
|
347
380
|
* instance mounts in opaque-origin iframes. Absent means the package has
|
|
348
381
|
* no UI of its own, which is the common case.
|
|
382
|
+
* @ruling 20 §12, 21 §7
|
|
349
383
|
*/
|
|
350
384
|
surfaces?: SurfacesDecl;
|
|
351
|
-
/**
|
|
385
|
+
/**
|
|
386
|
+
* In-document components (virtual tier).
|
|
387
|
+
* @ruling 10 §2
|
|
388
|
+
*/
|
|
352
389
|
components: ComponentDecl[];
|
|
353
390
|
/**
|
|
354
|
-
* Definitions this package offers on other packages' swappable nodes
|
|
355
|
-
*
|
|
391
|
+
* Definitions this package offers on other packages' swappable nodes,
|
|
392
|
+
* stored as ids. Absent when the package contributes none, so
|
|
356
393
|
* a package that declares no swap announces exactly what it did before.
|
|
394
|
+
* @ruling R29
|
|
357
395
|
*/
|
|
358
396
|
swaps?: StoredSwapContribution[];
|
|
359
397
|
/**
|
|
@@ -365,7 +403,11 @@ export interface AnnouncementDocument {
|
|
|
365
403
|
/** Ids referenced but not declared here — the instance enforces these at install. */
|
|
366
404
|
requires: string[];
|
|
367
405
|
}
|
|
368
|
-
/**
|
|
406
|
+
/**
|
|
407
|
+
* One event slot's standing in a preset, for the coverage report.
|
|
408
|
+
* @experimental
|
|
409
|
+
* @ruling 24 §7
|
|
410
|
+
*/
|
|
369
411
|
export interface CoverageSlot {
|
|
370
412
|
event: string;
|
|
371
413
|
required: boolean;
|
|
@@ -410,20 +452,27 @@ export declare class AnnouncementBuilder {
|
|
|
410
452
|
/** Context sugar: mints `${ns}:genre/${name}` so the id cannot be mistyped. */
|
|
411
453
|
genre(name: string, props: GenreProps): GenreDecl;
|
|
412
454
|
genres(map: Record<string, GenreDecl>): this;
|
|
413
|
-
/**
|
|
455
|
+
/**
|
|
456
|
+
* Declarations only — implementations bind by id per trust domain.
|
|
457
|
+
* @ruling 24 §11
|
|
458
|
+
*/
|
|
414
459
|
hooks(map: Record<string, HookDeclaration>): this;
|
|
415
460
|
pipelines(...specs: AnnouncedSpec[]): this;
|
|
416
461
|
configs(...configs: ConfigInput<any>[]): this;
|
|
417
462
|
prompts(...prompts: PromptDecl[]): this;
|
|
418
463
|
presets(...presets: PresetInput[]): this;
|
|
419
464
|
/**
|
|
420
|
-
* The frame surfaces this package ships
|
|
465
|
+
* The frame surfaces this package ships: documents mounted in
|
|
421
466
|
* opaque-origin iframes. Declared, never discovered — an instance renders
|
|
422
467
|
* what the manifest says and `serene-pub preview` renders the same list,
|
|
423
468
|
* so a surface a modder previewed is a surface an instance will offer.
|
|
469
|
+
* @ruling 20 §12
|
|
424
470
|
*/
|
|
425
471
|
surfaces(decl: SurfacesDecl): this;
|
|
426
|
-
/**
|
|
472
|
+
/**
|
|
473
|
+
* In-document components (virtual tier) — code trust at install.
|
|
474
|
+
* @ruling 10 §2
|
|
475
|
+
*/
|
|
427
476
|
components(...components: ComponentDecl[]): this;
|
|
428
477
|
/**
|
|
429
478
|
* Offer this package's definitions on another package's swappable nodes:
|
|
@@ -434,7 +483,8 @@ export declare class AnnouncementBuilder {
|
|
|
434
483
|
swaps(...contributions: SwapContribution[]): this;
|
|
435
484
|
/**
|
|
436
485
|
* Validate the announcement as a whole and compile it to the document.
|
|
437
|
-
* Errors carry exact paths — the teaching-error pattern
|
|
486
|
+
* Errors carry exact paths — the teaching-error pattern.
|
|
487
|
+
* @ruling 15 §1.3
|
|
438
488
|
*/
|
|
439
489
|
build(): {
|
|
440
490
|
document: AnnouncementDocument;
|
package/dist/announce.js
CHANGED
|
@@ -59,9 +59,10 @@ export function storedConfig(c) {
|
|
|
59
59
|
};
|
|
60
60
|
}
|
|
61
61
|
/**
|
|
62
|
-
* The display text rule
|
|
62
|
+
* The display text rule as a throw for `config()` / `preset()`, where
|
|
63
63
|
* the author is. `build()` collects the same findings instead, through the
|
|
64
64
|
* shared declaration pass.
|
|
65
|
+
* @ruling R-20
|
|
65
66
|
*/
|
|
66
67
|
function assertDisplayText(at, meta) {
|
|
67
68
|
const findings = labelFindings(at, meta);
|
|
@@ -260,7 +261,10 @@ export class AnnouncementBuilder {
|
|
|
260
261
|
}
|
|
261
262
|
return this;
|
|
262
263
|
}
|
|
263
|
-
/**
|
|
264
|
+
/**
|
|
265
|
+
* Declarations only — implementations bind by id per trust domain.
|
|
266
|
+
* @ruling 24 §11
|
|
267
|
+
*/
|
|
264
268
|
hooks(map) {
|
|
265
269
|
for (const [key, decl] of Object.entries(map))
|
|
266
270
|
this._hooks[`${this.identity.ns}:hook/${key}`] = decl;
|
|
@@ -283,16 +287,20 @@ export class AnnouncementBuilder {
|
|
|
283
287
|
return this;
|
|
284
288
|
}
|
|
285
289
|
/**
|
|
286
|
-
* The frame surfaces this package ships
|
|
290
|
+
* The frame surfaces this package ships: documents mounted in
|
|
287
291
|
* opaque-origin iframes. Declared, never discovered — an instance renders
|
|
288
292
|
* what the manifest says and `serene-pub preview` renders the same list,
|
|
289
293
|
* so a surface a modder previewed is a surface an instance will offer.
|
|
294
|
+
* @ruling 20 §12
|
|
290
295
|
*/
|
|
291
296
|
surfaces(decl) {
|
|
292
297
|
this._surfaces = { ...this._surfaces, ...decl };
|
|
293
298
|
return this;
|
|
294
299
|
}
|
|
295
|
-
/**
|
|
300
|
+
/**
|
|
301
|
+
* In-document components (virtual tier) — code trust at install.
|
|
302
|
+
* @ruling 10 §2
|
|
303
|
+
*/
|
|
296
304
|
components(...components) {
|
|
297
305
|
this._components.push(...components);
|
|
298
306
|
return this;
|
|
@@ -312,7 +320,8 @@ export class AnnouncementBuilder {
|
|
|
312
320
|
}
|
|
313
321
|
/**
|
|
314
322
|
* Validate the announcement as a whole and compile it to the document.
|
|
315
|
-
* Errors carry exact paths — the teaching-error pattern
|
|
323
|
+
* Errors carry exact paths — the teaching-error pattern.
|
|
324
|
+
* @ruling 15 §1.3
|
|
316
325
|
*/
|
|
317
326
|
build() {
|
|
318
327
|
const errors = [];
|
package/dist/attributes.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* ## Three levels, and only the middle one is new here
|
|
5
5
|
*
|
|
6
|
-
* A stat is three things, not one
|
|
6
|
+
* A stat is three things, not one: a **declaration**
|
|
7
7
|
* ("Health is an integer with a max, and it attaches to cast members"), a
|
|
8
8
|
* **configuration** ("this character's Health caps at 20"), and a **value**
|
|
9
9
|
* ("health = 12, as of message 47"). This file owns the first. The other two
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
* than part of it, and writing one down must not force an `@N+1` on everything
|
|
58
58
|
* already storing values under the id.
|
|
59
59
|
*
|
|
60
|
-
* ⚠ **"Slot" here is not a pipeline slot.**
|
|
60
|
+
* ⚠ **"Slot" here is not a pipeline slot.** A pipeline *slot* is a declared
|
|
61
61
|
* parameter address on a node type (`SlotDecl` in descriptors.ts). This is an
|
|
62
62
|
* *attribute* slot, and prose says the qualified word. The two never meet: one
|
|
63
63
|
* is a key on a descriptor, the other is an id in this registry.
|
|
@@ -69,6 +69,7 @@
|
|
|
69
69
|
* will be imported wrong. The *types* keep the short names (`SlotId`,
|
|
70
70
|
* `SlotConfig`, `SlotValue`): they are only ever written next to this file's
|
|
71
71
|
* functions, so they cannot be mistaken at a call site.
|
|
72
|
+
* @ruling entries plan Part 3
|
|
72
73
|
*/
|
|
73
74
|
import type { I18n } from './descriptors.js';
|
|
74
75
|
import type { FieldDecl } from './settings.js';
|
|
@@ -413,8 +414,7 @@ export interface AttributeSlotProps {
|
|
|
413
414
|
*/
|
|
414
415
|
pickable?: false;
|
|
415
416
|
/**
|
|
416
|
-
* 🚧 **Earshot**: which prompts may read this slot's value
|
|
417
|
-
* 2026-09-28).
|
|
417
|
+
* 🚧 **Earshot**: which prompts may read this slot's value.
|
|
418
418
|
*
|
|
419
419
|
* · `'all'` (the default) — every agent a run builds a prompt for: the
|
|
420
420
|
* planner, the scene, the state-keeper, every voice.
|
|
@@ -435,6 +435,7 @@ export interface AttributeSlotProps {
|
|
|
435
435
|
* so saying the default and saying nothing are one declaration and one
|
|
436
436
|
* hash. Inside the content hash when `'holder'`: it decides which prompts
|
|
437
437
|
* the value reaches.
|
|
438
|
+
* @ruling lair pass R1 (2026-09-28)
|
|
438
439
|
*/
|
|
439
440
|
earshot?: SlotEarshot;
|
|
440
441
|
}
|
|
@@ -553,12 +554,13 @@ export declare function retireAttributeSlot(id: SlotId): AttributeSlotDecl;
|
|
|
553
554
|
/** Undo a retirement. Writes are taken again; nothing about the stored values changed either way. @internal */
|
|
554
555
|
export declare function reviveAttributeSlot(id: SlotId): AttributeSlotDecl;
|
|
555
556
|
/**
|
|
556
|
-
* The display-text findings of one slot declaration
|
|
557
|
+
* The display-text findings of one slot declaration: `label` and
|
|
557
558
|
* `description`, both optional — a slot may be listed by its id — but a blank
|
|
558
559
|
* one is a label that draws nothing where the author meant to say something.
|
|
559
560
|
* Run by the code door here and by the host's **write** door for an authored
|
|
560
561
|
* slot (the app's `declareSlot` / `updateSlot`), never by a reload.
|
|
561
562
|
* @internal
|
|
563
|
+
* @ruling R-20
|
|
562
564
|
*/
|
|
563
565
|
export declare function attributeSlotDisplayFindings(id: SlotId, props: AttributeSlotProps): string[];
|
|
564
566
|
/** The `SlotType` each stat kind is stored and checked as. @experimental */
|
|
@@ -602,10 +604,11 @@ export declare function resolveSlotConfig(decl: AttributeSlotDecl, ...layers: re
|
|
|
602
604
|
* inventing three wordings for one rule is how a validator stops being one.
|
|
603
605
|
*
|
|
604
606
|
* ⚠ A value is checked against the configuration valid at **its own anchor**,
|
|
605
|
-
* not against the current one
|
|
607
|
+
* not against the current one. Callers pass that config in; this
|
|
606
608
|
* function never reaches for a current one, because doing so is precisely the
|
|
607
609
|
* mistake that retroactively invalidates a legitimate historical value.
|
|
608
610
|
* @internal
|
|
611
|
+
* @ruling plan Part 3
|
|
609
612
|
*/
|
|
610
613
|
export declare function checkSlotValue(decl: AttributeSlotDecl, value: SlotValue, config?: SlotConfig): string | null;
|
|
611
614
|
/** What a change does to the value already there. @experimental */
|
package/dist/attributes.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* ## Three levels, and only the middle one is new here
|
|
5
5
|
*
|
|
6
|
-
* A stat is three things, not one
|
|
6
|
+
* A stat is three things, not one: a **declaration**
|
|
7
7
|
* ("Health is an integer with a max, and it attaches to cast members"), a
|
|
8
8
|
* **configuration** ("this character's Health caps at 20"), and a **value**
|
|
9
9
|
* ("health = 12, as of message 47"). This file owns the first. The other two
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
* than part of it, and writing one down must not force an `@N+1` on everything
|
|
58
58
|
* already storing values under the id.
|
|
59
59
|
*
|
|
60
|
-
* ⚠ **"Slot" here is not a pipeline slot.**
|
|
60
|
+
* ⚠ **"Slot" here is not a pipeline slot.** A pipeline *slot* is a declared
|
|
61
61
|
* parameter address on a node type (`SlotDecl` in descriptors.ts). This is an
|
|
62
62
|
* *attribute* slot, and prose says the qualified word. The two never meet: one
|
|
63
63
|
* is a key on a descriptor, the other is an id in this registry.
|
|
@@ -69,6 +69,7 @@
|
|
|
69
69
|
* will be imported wrong. The *types* keep the short names (`SlotId`,
|
|
70
70
|
* `SlotConfig`, `SlotValue`): they are only ever written next to this file's
|
|
71
71
|
* functions, so they cannot be mistaken at a call site.
|
|
72
|
+
* @ruling entries plan Part 3
|
|
72
73
|
*/
|
|
73
74
|
import { i18nFindings } from './i18n.js';
|
|
74
75
|
import { refuseUnlessIdentical } from './hash.js';
|
|
@@ -407,12 +408,13 @@ export function reviveAttributeSlot(id) {
|
|
|
407
408
|
return next;
|
|
408
409
|
}
|
|
409
410
|
/**
|
|
410
|
-
* The display-text findings of one slot declaration
|
|
411
|
+
* The display-text findings of one slot declaration: `label` and
|
|
411
412
|
* `description`, both optional — a slot may be listed by its id — but a blank
|
|
412
413
|
* one is a label that draws nothing where the author meant to say something.
|
|
413
414
|
* Run by the code door here and by the host's **write** door for an authored
|
|
414
415
|
* slot (the app's `declareSlot` / `updateSlot`), never by a reload.
|
|
415
416
|
* @internal
|
|
417
|
+
* @ruling R-20
|
|
416
418
|
*/
|
|
417
419
|
export function attributeSlotDisplayFindings(id, props) {
|
|
418
420
|
return [
|
|
@@ -428,11 +430,12 @@ function assertDisplayText(id, props) {
|
|
|
428
430
|
}
|
|
429
431
|
/**
|
|
430
432
|
* A stored row reloading at boot is never refused for its display text
|
|
431
|
-
* (ruled 2026-09-17
|
|
433
|
+
* (ruled 2026-09-17): the gate is the write door, and a row that
|
|
432
434
|
* was stored with a blank `description` would otherwise vanish from every
|
|
433
435
|
* boot after. The offending field is dropped — a blank label reads as "listed
|
|
434
436
|
* by id" — and a warning names the row and the finding, so the defect is
|
|
435
437
|
* visible without the slot being lost.
|
|
438
|
+
* @ruling U5i review
|
|
436
439
|
*/
|
|
437
440
|
function withDisplayTextTolerated(id, props) {
|
|
438
441
|
const findings = attributeSlotDisplayFindings(id, props);
|
|
@@ -671,10 +674,11 @@ export function resolveSlotConfig(decl, ...layers) {
|
|
|
671
674
|
* inventing three wordings for one rule is how a validator stops being one.
|
|
672
675
|
*
|
|
673
676
|
* ⚠ A value is checked against the configuration valid at **its own anchor**,
|
|
674
|
-
* not against the current one
|
|
677
|
+
* not against the current one. Callers pass that config in; this
|
|
675
678
|
* function never reaches for a current one, because doing so is precisely the
|
|
676
679
|
* mistake that retroactively invalidates a legitimate historical value.
|
|
677
680
|
* @internal
|
|
681
|
+
* @ruling plan Part 3
|
|
678
682
|
*/
|
|
679
683
|
export function checkSlotValue(decl, value, config = resolveSlotConfig(decl)) {
|
|
680
684
|
// Retirement answers first. It is the newest fact about the slot and the
|
package/dist/bands.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Bands as template variables
|
|
2
|
+
* Bands as template variables.
|
|
3
3
|
*
|
|
4
4
|
* A **band** is the ranker's word for one source's slice of the context window
|
|
5
5
|
* (`bandIntent`, candidates.ts). A source that puts its own band in the window
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
* when the slot says `rendersBands` — every band declared upstream of the
|
|
28
28
|
* named in-port, followed through any node that takes candidates in
|
|
29
29
|
* (concatenation, fusion, ranking). `rendersAt` is that answer.
|
|
30
|
+
* @ruling typed templates P2 (2026-09-27)
|
|
30
31
|
*/
|
|
31
32
|
import { type Descriptor, type SlotDecl } from './descriptors.js';
|
|
32
33
|
import type { DocEdge, DocNode } from './document.js';
|
|
@@ -53,20 +54,54 @@ export declare const ASSEMBLE_OWN_TEMPLATE_NAMES: readonly string[];
|
|
|
53
54
|
* - the key is an identifier (a band is a template name);
|
|
54
55
|
* - the variable is registered (`defineVariable` / `definePluginVariable`) and
|
|
55
56
|
* its scope declares the key, because a layout renders `{ [key]: value }`;
|
|
56
|
-
* - the key
|
|
57
|
-
*
|
|
58
|
-
*
|
|
57
|
+
* - the key is not one of Assemble's own names.
|
|
58
|
+
*
|
|
59
|
+
* **Not refused here: a key some other definition, or some core variable,
|
|
60
|
+
* already uses** (owner ruling 2026-10-13, ★1). A key is a local name and
|
|
61
|
+
* means one variable *within one template's scope* — `bandsReaching` and
|
|
62
|
+
* `rendersAt` refuse two meanings meeting in one document, and law T1 reports
|
|
63
|
+
* it. Two pipelines that never meet may each mean their own `characterLore`.
|
|
59
64
|
*
|
|
60
65
|
* Each refusal names the fix.
|
|
61
66
|
* @internal
|
|
62
67
|
*/
|
|
63
|
-
export declare function checkBandDeclarations(d: Descriptor
|
|
68
|
+
export declare function checkBandDeclarations(d: Descriptor): void;
|
|
69
|
+
/**
|
|
70
|
+
* What is wrong with a node rendering `key` as `id`, as the end of a sentence
|
|
71
|
+
* that begins with what renders it — or `undefined` when nothing is.
|
|
72
|
+
*
|
|
73
|
+
* The facts a band declaration states, asked of every rendered key: a layout
|
|
74
|
+
* is written against its variable's scope and renders `{ [key]: value }`, so
|
|
75
|
+
* a key the scope does not name reaches no layout, and a variable nobody
|
|
76
|
+
* registered has no layout, no type and no picker.
|
|
77
|
+
* @internal
|
|
78
|
+
*/
|
|
79
|
+
export declare function rendersProblem(key: string, id: unknown): string | undefined;
|
|
80
|
+
/**
|
|
81
|
+
* Refuse a definition's static `renders` (owner ruling 2026-10-13) — at
|
|
82
|
+
* `describe…Definition`, like its bands, and for the same reasons
|
|
83
|
+
* (`rendersProblem`). Until then nothing read a `renders` entry until a run
|
|
84
|
+
* did, and a key whose variable did not declare it rendered nothing.
|
|
85
|
+
* @internal
|
|
86
|
+
*/
|
|
87
|
+
export declare function checkRendersDeclarations(d: Descriptor): void;
|
|
88
|
+
/**
|
|
89
|
+
* What one placement's `variables` slot renders, before any band: the slot's
|
|
90
|
+
* static `renders`, with each key the **spec's own `renders`** names for this
|
|
91
|
+
* node (`NodeOpts.renders`, owner ruling 2026-10-13) re-pointed at the
|
|
92
|
+
* spec's variable. Only keys the slot already renders — the spec says what a
|
|
93
|
+
* key *means* here, it does not add keys; `validate()` reports one it names
|
|
94
|
+
* that no slot renders (law T1).
|
|
95
|
+
* @experimental
|
|
96
|
+
*/
|
|
97
|
+
export declare function effectiveRenders(slot: Pick<SlotDecl, 'renders'>, node?: Pick<DocNode, 'renders'>): Record<string, VariableId>;
|
|
64
98
|
/**
|
|
65
99
|
* What `bandsReaching` needs from a node's definition: its in-ports and the
|
|
66
100
|
* bands it declares. A `Descriptor` satisfies it, and so does a registry row
|
|
67
101
|
* (whose policy carries the band ids, `DefinitionPolicy.bands`) — which is how
|
|
68
|
-
* a host reading rows answers without loading a plugin
|
|
102
|
+
* a host reading rows answers without loading a plugin.
|
|
69
103
|
* @experimental
|
|
104
|
+
* @ruling F6
|
|
70
105
|
*/
|
|
71
106
|
export interface BandSource {
|
|
72
107
|
ports?: {
|