@serene-pub/sdk 0.6.0-pr-4 → 0.6.0-pr-6
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 +178 -69
- package/dist/actions.js +109 -40
- package/dist/annexFields.d.ts +12 -5
- package/dist/annexFields.js +6 -2
- package/dist/announce.d.ts +220 -30
- package/dist/announce.js +212 -7
- package/dist/attributes.d.ts +290 -11
- package/dist/attributes.js +317 -32
- package/dist/bands.d.ts +41 -6
- package/dist/bands.js +83 -33
- package/dist/bridges.d.ts +61 -0
- package/dist/bridges.js +112 -0
- package/dist/builder.d.ts +436 -106
- package/dist/builder.js +389 -46
- package/dist/cadences.d.ts +578 -0
- package/dist/cadences.js +1111 -0
- package/dist/candidates.d.ts +5 -3
- package/dist/candidates.js +3 -2
- package/dist/capabilities.d.ts +93 -15
- package/dist/capabilities.js +57 -6
- package/dist/checkMethods.d.ts +240 -0
- package/dist/checkMethods.js +362 -0
- 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/composerStates.d.ts +96 -0
- package/dist/composerStates.js +190 -0
- package/dist/conditions.d.ts +424 -0
- package/dist/conditions.js +521 -0
- package/dist/config.d.ts +69 -19
- package/dist/config.js +64 -26
- package/dist/connections.d.ts +9 -4
- package/dist/connections.js +7 -4
- package/dist/conversions.d.ts +41 -0
- package/dist/conversions.js +50 -0
- package/dist/declarations.d.ts +70 -18
- package/dist/declarations.js +194 -24
- package/dist/descriptors.d.ts +427 -100
- package/dist/descriptors.js +344 -59
- package/dist/dev.d.ts +6 -5
- package/dist/dev.js +6 -5
- package/dist/document.d.ts +121 -27
- package/dist/document.js +77 -24
- 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/entities.d.ts +156 -0
- package/dist/entities.js +259 -0
- package/dist/eventMapLaws.d.ts +19 -8
- package/dist/eventMapLaws.js +9 -6
- package/dist/events.d.ts +648 -40
- package/dist/events.js +451 -34
- package/dist/executor.d.ts +123 -41
- package/dist/executor.js +210 -103
- package/dist/exposure.d.ts +128 -0
- package/dist/exposure.js +168 -0
- 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/fit.d.ts +198 -0
- package/dist/fit.js +351 -0
- package/dist/foldedSections.d.ts +4 -2
- package/dist/foldedSections.js +2 -1
- package/dist/functions.d.ts +554 -0
- package/dist/functions.js +712 -0
- package/dist/genres.d.ts +408 -130
- package/dist/genres.js +412 -108
- 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 +4 -3
- package/dist/hookGrants.js +7 -5
- package/dist/hooks.d.ts +42 -21
- package/dist/hooks.js +17 -12
- package/dist/hostElements.d.ts +47 -17
- package/dist/hostElements.js +62 -17
- package/dist/hostState.d.ts +110 -0
- package/dist/hostState.js +140 -0
- 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 +26 -0
- package/dist/index.js +55 -0
- package/dist/jsonSchema.d.ts +178 -0
- package/dist/jsonSchema.js +558 -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 +153 -16
- package/dist/media.js +47 -2
- package/dist/messageBlocks.d.ts +223 -37
- package/dist/messageBlocks.js +231 -24
- 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 +54 -24
- package/dist/participants.js +27 -14
- package/dist/personGate.d.ts +2 -1
- package/dist/personGate.js +2 -1
- package/dist/pluginHarness.d.ts +22 -35
- package/dist/pluginHarness.js +18 -143
- package/dist/pluginPermissions.d.ts +2 -1
- package/dist/pluginPermissions.js +13 -2
- 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 +53 -7
- package/dist/preview.js +54 -13
- package/dist/primers.d.ts +177 -0
- package/dist/primers.js +265 -0
- 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 +76 -29
- package/dist/receipt.js +9 -4
- package/dist/receiverRules.js +3 -2
- package/dist/refs.d.ts +42 -9
- package/dist/refs.js +45 -13
- package/dist/registrations.d.ts +384 -0
- package/dist/registrations.js +625 -0
- package/dist/registry.d.ts +42 -23
- package/dist/registry.js +7 -5
- package/dist/repertoires.d.ts +502 -0
- package/dist/repertoires.js +666 -0
- package/dist/review.d.ts +16 -5
- package/dist/review.js +11 -4
- package/dist/rulesetDocument.d.ts +95 -0
- package/dist/rulesetDocument.js +190 -0
- package/dist/rulesetSections.d.ts +597 -0
- package/dist/rulesetSections.js +1249 -0
- package/dist/rulesetTemplates.d.ts +161 -0
- package/dist/rulesetTemplates.js +242 -0
- package/dist/rulesets.d.ts +899 -0
- package/dist/rulesets.js +1378 -0
- package/dist/sampling.d.ts +54 -0
- package/dist/sampling.js +95 -3
- package/dist/sceneSettings.d.ts +320 -0
- package/dist/sceneSettings.js +433 -0
- package/dist/scope.d.ts +50 -7
- package/dist/scope.js +22 -3
- package/dist/scripts.d.ts +112 -22
- package/dist/scripts.js +135 -19
- package/dist/sessionDossier.d.ts +638 -0
- package/dist/sessionDossier.js +33 -0
- package/dist/sessionLayout.d.ts +492 -55
- package/dist/sessionLayout.js +697 -90
- package/dist/sessionSettings.d.ts +32 -5
- package/dist/settings.d.ts +66 -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 +139 -37
- package/dist/shapes.js +152 -38
- package/dist/sheets.d.ts +4 -2
- package/dist/sheets.js +6 -3
- package/dist/statShapes.d.ts +10 -2
- package/dist/statShapes.js +10 -2
- package/dist/status.d.ts +27 -9
- package/dist/status.js +20 -6
- package/dist/storage.d.ts +11 -67
- package/dist/storage.js +9 -13
- 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 +22 -12
- package/dist/templateScopeAt.js +32 -19
- package/dist/testing.d.ts +11 -4
- package/dist/testing.js +13 -5
- package/dist/ties.d.ts +210 -0
- package/dist/ties.js +300 -0
- 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 +39 -22
- package/dist/turnOrder.js +30 -13
- package/dist/validate.d.ts +11 -8
- package/dist/validate.js +195 -29
- 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/vocabularies.d.ts +192 -0
- package/dist/vocabularies.js +326 -0
- package/dist/widgetDecls.d.ts +20 -4
- package/dist/widgetDecls.js +6 -2
- package/dist/widgets.d.ts +1580 -111
- package/dist/widgets.js +113 -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 +101 -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;
|
|
@@ -69,6 +72,8 @@ export type SpecRef = AnnouncedSpec | ExternalRef;
|
|
|
69
72
|
/** The id a `SpecRef` names; a bare string is refused with the fix. @experimental */
|
|
70
73
|
export declare function specIdOf(v: unknown, where: string): string;
|
|
71
74
|
import { type GenreDecl, type GenreProps } from './genres.js';
|
|
75
|
+
import { type PresetRegistrationChanges, type RegistrationDecl } from './registrations.js';
|
|
76
|
+
import type { SettingValue } from './exposure.js';
|
|
72
77
|
import { type SessionEventDecl } from './events.js';
|
|
73
78
|
import { type ValueToolkit } from './values.js';
|
|
74
79
|
import type { ComponentDecl, Extension } from './extension.js';
|
|
@@ -80,18 +85,22 @@ export interface PackageIdentity {
|
|
|
80
85
|
/** The package namespace every declared id lives under — `core`, `acme.dice`. */
|
|
81
86
|
ns: string;
|
|
82
87
|
author: string;
|
|
83
|
-
/**
|
|
88
|
+
/**
|
|
89
|
+
* What the package is called where it is listed — a string or a locale map with `en`.
|
|
90
|
+
* @ruling R-20
|
|
91
|
+
*/
|
|
84
92
|
title: I18n;
|
|
85
93
|
repo?: string;
|
|
86
94
|
summary?: I18n;
|
|
87
95
|
description?: I18n;
|
|
88
96
|
}
|
|
89
97
|
/**
|
|
90
|
-
* A hook *declaration
|
|
98
|
+
* A hook *declaration*: identity, event, contract, ordering. The
|
|
91
99
|
* implementation lives with its capabilities — core's in core, a plugin's in
|
|
92
100
|
* its sandboxed bundle — and boot/install binds implementation to declared id
|
|
93
101
|
* with a completeness check.
|
|
94
102
|
* @experimental
|
|
103
|
+
* @ruling 24 §11
|
|
95
104
|
*/
|
|
96
105
|
export interface HookDeclaration {
|
|
97
106
|
event: string;
|
|
@@ -101,7 +110,7 @@ export interface HookDeclaration {
|
|
|
101
110
|
after?: string[];
|
|
102
111
|
}
|
|
103
112
|
/**
|
|
104
|
-
* A shipped prompt
|
|
113
|
+
* A shipped prompt: authored prose for one NODE's prompts slot,
|
|
105
114
|
* selectable wherever that node is used. The slug is the stable identity an
|
|
106
115
|
* instance's seed pass matches on; the label is display.
|
|
107
116
|
*
|
|
@@ -110,6 +119,7 @@ export interface HookDeclaration {
|
|
|
110
119
|
* the prompts written for it, and one built from other nodes is offered none of
|
|
111
120
|
* them. Spec scoping said the same thing less precisely and cost the reuse.
|
|
112
121
|
* @experimental
|
|
122
|
+
* @ruling 24 T6b
|
|
113
123
|
*/
|
|
114
124
|
export interface PromptDecl {
|
|
115
125
|
/**
|
|
@@ -124,17 +134,27 @@ export interface PromptDecl {
|
|
|
124
134
|
*/
|
|
125
135
|
slot: string;
|
|
126
136
|
slug: string;
|
|
127
|
-
/**
|
|
137
|
+
/**
|
|
138
|
+
* The name a picker lists it by — a string or a locale map with `en`.
|
|
139
|
+
* @ruling R-20
|
|
140
|
+
*/
|
|
128
141
|
label: I18n;
|
|
129
142
|
/** Field name → prose, exactly as that slot declares them. */
|
|
130
143
|
fields: Record<string, string>;
|
|
131
144
|
}
|
|
132
|
-
/**
|
|
145
|
+
/**
|
|
146
|
+
* A named configuration: a typed delta over a spec's author defaults.
|
|
147
|
+
* @experimental
|
|
148
|
+
* @ruling 24 §7
|
|
149
|
+
*/
|
|
133
150
|
export interface ConfigDecl {
|
|
134
151
|
/** The spec it configures — may be external (another package's id). */
|
|
135
152
|
spec: string;
|
|
136
153
|
slug: string;
|
|
137
|
-
/**
|
|
154
|
+
/**
|
|
155
|
+
* The name a picker lists it by — a string or a locale map with `en`.
|
|
156
|
+
* @ruling R-20
|
|
157
|
+
*/
|
|
138
158
|
label: I18n;
|
|
139
159
|
description?: I18n;
|
|
140
160
|
/** nodeKey → slot → value. Only deviations; everything else inherits. */
|
|
@@ -172,7 +192,7 @@ export interface PresetBinding {
|
|
|
172
192
|
config?: string;
|
|
173
193
|
}
|
|
174
194
|
/**
|
|
175
|
-
* What a preset pre-fills the creation form with
|
|
195
|
+
* What a preset pre-fills the creation form with.
|
|
176
196
|
*
|
|
177
197
|
* Every key optional and every key advisory: the form applies the ones it
|
|
178
198
|
* recognises, type-checks each, and ignores the rest — so a preset written
|
|
@@ -180,12 +200,13 @@ export interface PresetBinding {
|
|
|
180
200
|
* genre's own fields ride along in `genreFields` rather than growing this
|
|
181
201
|
* shape a key at a time.
|
|
182
202
|
* @experimental
|
|
203
|
+
* @ruling 23 §9
|
|
183
204
|
*/
|
|
184
205
|
export interface PresetDefaults {
|
|
185
206
|
name?: string;
|
|
186
207
|
scenario?: string;
|
|
187
208
|
/**
|
|
188
|
-
* Swaps to seat the session with
|
|
209
|
+
* Swaps to seat the session with: for each, a definition the named
|
|
189
210
|
* spec offers on the named node — its pin or one of its `expose.swaps`,
|
|
190
211
|
* or an enabled contribution. The same shape a package contributes with
|
|
191
212
|
* (`SwapContribution`), stored with ids:
|
|
@@ -193,6 +214,7 @@ export interface PresetDefaults {
|
|
|
193
214
|
* Written as the session's rebinds at create; an entry the node does not
|
|
194
215
|
* offer is refused there, logged, and the session starts on the pin.
|
|
195
216
|
* Replaced `speakerStrategy` (2026-09-23), which named one node.
|
|
217
|
+
* @ruling R40
|
|
196
218
|
*/
|
|
197
219
|
swaps?: StoredSwapContribution[];
|
|
198
220
|
lorebookId?: number | null;
|
|
@@ -200,38 +222,93 @@ export interface PresetDefaults {
|
|
|
200
222
|
/** The genre's declared fields, by key. */
|
|
201
223
|
genreFields?: Record<string, unknown>;
|
|
202
224
|
/**
|
|
203
|
-
* Envoys to seat on creation, by slug
|
|
225
|
+
* Envoys to seat on creation, by slug — beside the genre's
|
|
204
226
|
* `default: true` ones, which are seated with no choice. A slug the
|
|
205
227
|
* genre (or an installed action) does not declare is ignored, on the
|
|
206
228
|
* same advisory terms as every other key here.
|
|
229
|
+
* @ruling R-18, U5g
|
|
207
230
|
*/
|
|
208
231
|
envoys?: string[];
|
|
209
232
|
}
|
|
210
233
|
/**
|
|
211
|
-
* A preset populates a genre's event slots
|
|
234
|
+
* A preset populates a genre's event slots: for each event the genre
|
|
212
235
|
* declares, which pipeline variant answers it, with which config.
|
|
213
236
|
* @experimental
|
|
237
|
+
* @ruling 24 §1
|
|
214
238
|
*/
|
|
215
239
|
export interface PresetDecl {
|
|
216
240
|
slug: string;
|
|
217
241
|
genre: string;
|
|
218
|
-
/**
|
|
242
|
+
/**
|
|
243
|
+
* The name the picker lists it by — a string or a locale map with `en`.
|
|
244
|
+
* @ruling R-20
|
|
245
|
+
*/
|
|
219
246
|
label: I18n;
|
|
220
247
|
description?: I18n;
|
|
248
|
+
/**
|
|
249
|
+
* ⏳ Which spec answers each event, keyed by event id.
|
|
250
|
+
* @deprecated An alias to 0.7 (PLAN-layering D4): a preset is **changes
|
|
251
|
+
* on the genre's defaults** — `registrations`. `presetChangesOf(decl)`
|
|
252
|
+
* reads these as registrations. A preset declared with `register` /
|
|
253
|
+
* `drop` / `change` stores `{}` here.
|
|
254
|
+
*/
|
|
221
255
|
bindings: Record<string, PresetBinding>;
|
|
256
|
+
/**
|
|
257
|
+
* 🚧 This preset's **changes on the genre's defaults** (R2, PLAN-layering
|
|
258
|
+
* D4): registrations it adds, the keys it drops, and changes to the rest.
|
|
259
|
+
* Present only when declared with `register` / `drop` / `change`; a
|
|
260
|
+
* preset still on `bindings` is read through `presetChangesOf`.
|
|
261
|
+
* @ruling R2, R3, R22
|
|
262
|
+
*/
|
|
263
|
+
registrations?: PresetRegistrationChanges;
|
|
264
|
+
/**
|
|
265
|
+
* 🚧 The genre's **default preset** (R22, A18): marked here, by the
|
|
266
|
+
* preset itself, never by a slug on the genre. Absent: not the default.
|
|
267
|
+
*/
|
|
268
|
+
default?: true;
|
|
269
|
+
/**
|
|
270
|
+
* 🚧 What this preset builds on beyond its own package (A16, R6): package
|
|
271
|
+
* requirements with version ranges — `acme.dice@^1.2`. Collected from
|
|
272
|
+
* `use('…@range')` pipelines and stated ones; the host withdraws the preset
|
|
273
|
+
* when one is disabled or missing, and deletes nothing. Absent when none.
|
|
274
|
+
* @ruling A16
|
|
275
|
+
*/
|
|
276
|
+
requires?: string[];
|
|
222
277
|
/**
|
|
223
278
|
* For the open `session-action` slot: which actions come along, each by
|
|
224
|
-
* its **identity** — `<spec slug>#<key
|
|
279
|
+
* its **identity** — `<spec slug>#<key>`. A preset
|
|
225
280
|
* curates declarations, never functions: two specs contributing one
|
|
226
281
|
* function are two entries, and including one says nothing about the
|
|
227
282
|
* other. Absent means the host's companion rule (every action from the
|
|
228
283
|
* genre owner's own namespace).
|
|
284
|
+
* @deprecated ⏳ An alias to 0.7 (PLAN-layering D4): an action is offered
|
|
285
|
+
* by an action registration — `register(spec.actions.<key>, spec)` in the
|
|
286
|
+
* genre's defaults or a preset's `register`. `presetChangesOf` reads the
|
|
287
|
+
* include list as action registrations.
|
|
288
|
+
* @ruling U5c review, W-A
|
|
229
289
|
*/
|
|
230
290
|
actions?: {
|
|
231
291
|
include: string[];
|
|
232
292
|
};
|
|
233
293
|
/** What starting from this preset pre-fills the creation form with. */
|
|
234
294
|
defaults?: PresetDefaults;
|
|
295
|
+
/**
|
|
296
|
+
* 🚧 Model calls one turn costs on this preset, as the card prints it (PLAN-genre-restructure §3, 2026-10-19); the host's parity test measures a real turn against it. Absent means "as the genre".
|
|
297
|
+
* @deprecated ⏳ Accepted and kept as stated until calls per turn are derived from what is registered (PLAN-layering D4).
|
|
298
|
+
*/
|
|
299
|
+
callsPerTurn?: number;
|
|
300
|
+
/** 🚧 The cast floor this preset lowers (never raises) the shape's to — `{ characters: 0 }` lets a Minimal story start with nobody in it. */
|
|
301
|
+
cast?: {
|
|
302
|
+
characters?: number;
|
|
303
|
+
personas?: number;
|
|
304
|
+
};
|
|
305
|
+
/**
|
|
306
|
+
* 🚧 Values this preset sets, keyed by setting key — the preset layer of
|
|
307
|
+
* the cascade: `session > preset > genre > core`. Each a plain value, or
|
|
308
|
+
* `{ value, lock?, askAtStart? }` (`SettingValue`, A10): lock it for the
|
|
309
|
+
* layers below, or place it on the start form. Never stored per session.
|
|
310
|
+
*/
|
|
311
|
+
settings?: Readonly<Record<string, SettingValue>>;
|
|
235
312
|
/**
|
|
236
313
|
* Whether the instance should offer this preset the moment the package is
|
|
237
314
|
* enabled. **Absent means no**, and that is the interesting half.
|
|
@@ -311,18 +388,110 @@ export type PresetDefaultsInput = Omit<PresetDefaults, 'swaps'> & {
|
|
|
311
388
|
export interface PresetInput {
|
|
312
389
|
slug: string;
|
|
313
390
|
genre: GenreDecl | ExternalRef;
|
|
314
|
-
/**
|
|
391
|
+
/**
|
|
392
|
+
* The name the picker lists it by — a string or a locale map with `en`.
|
|
393
|
+
* @ruling R-20
|
|
394
|
+
*/
|
|
315
395
|
label: I18n;
|
|
316
396
|
description?: I18n;
|
|
317
|
-
|
|
318
|
-
|
|
397
|
+
/**
|
|
398
|
+
* 🚧 This is the genre's **default preset** (R22) — marked here, never by
|
|
399
|
+
* a slug on the genre (A18).
|
|
400
|
+
*/
|
|
401
|
+
default?: true;
|
|
402
|
+
/** 🚧 Registrations this preset adds to the genre's defaults — `register(…)` values (R2). */
|
|
403
|
+
register?: readonly RegistrationDecl[];
|
|
404
|
+
/** 🚧 Registrations of the genre's defaults this preset drops — the registration objects, never keys. */
|
|
405
|
+
drop?: readonly RegistrationDecl[];
|
|
406
|
+
/**
|
|
407
|
+
* 🚧 Changes to registrations of the genre's defaults — `{ of: reckoning, mode: 'review' }`:
|
|
408
|
+
* the registration object, and the fields that differ.
|
|
409
|
+
*/
|
|
410
|
+
change?: ReadonlyArray<{
|
|
411
|
+
of: RegistrationDecl;
|
|
412
|
+
} & Partial<Pick<RegistrationDecl, 'values' | 'mode' | 'when' | 'allowStacking' | 'caps' | 'order' | 'label'>>>;
|
|
413
|
+
/** 🚧 Package requirements with version ranges — `acme.dice@^1.2` (A16). `use('…@range')` pipelines add their own. */
|
|
414
|
+
requires?: readonly string[];
|
|
415
|
+
/**
|
|
416
|
+
* ⏳ Which spec answers which event.
|
|
417
|
+
* @deprecated An alias to 0.7 — state `register` / `drop` / `change` on the genre's defaults.
|
|
418
|
+
*/
|
|
419
|
+
bindings?: BindingEntry[];
|
|
420
|
+
/**
|
|
421
|
+
* ⏳ Which actions come along. Absent means the host's companion rule — see `PresetDecl.actions`.
|
|
422
|
+
* @deprecated An alias to 0.7 — register each action: `register(spec.actions.<key>, spec)`.
|
|
423
|
+
*/
|
|
319
424
|
actions?: {
|
|
320
425
|
include: ActionPick[];
|
|
321
426
|
};
|
|
322
427
|
defaults?: PresetDefaultsInput;
|
|
428
|
+
/**
|
|
429
|
+
* 🚧 See `PresetDecl.callsPerTurn`.
|
|
430
|
+
* @deprecated ⏳ Accepted; derived from what is registered later (PLAN-layering D4).
|
|
431
|
+
*/
|
|
432
|
+
callsPerTurn?: number;
|
|
433
|
+
/** 🚧 See `PresetDecl.cast`. */
|
|
434
|
+
cast?: {
|
|
435
|
+
characters?: number;
|
|
436
|
+
personas?: number;
|
|
437
|
+
};
|
|
438
|
+
/** 🚧 See `PresetDecl.settings` — each a value, or `{ value, lock?, askAtStart? }`. */
|
|
439
|
+
settings?: Readonly<Record<string, SettingValue>>;
|
|
323
440
|
/** Ask the instance to offer this preset immediately. See `PresetDecl.enabled`. */
|
|
324
441
|
enabled?: boolean;
|
|
325
442
|
}
|
|
443
|
+
/**
|
|
444
|
+
* Keys that would make a preset build on another preset — refused (R2).
|
|
445
|
+
* @experimental
|
|
446
|
+
* @ruling R2
|
|
447
|
+
*/
|
|
448
|
+
export declare const PRESET_PARENT_KEYS: readonly string[];
|
|
449
|
+
/**
|
|
450
|
+
* 🚧 **One level**, judged on a STORED preset (R2, R3) — the verdict the
|
|
451
|
+
* builder's refusal gives at `preset()`, for a preset that arrives as data (an
|
|
452
|
+
* announcement, a manifest, a row): it names a parent (`extends`, `base`, …),
|
|
453
|
+
* it belongs to no genre, or it drops or changes a registration that neither
|
|
454
|
+
* its genre's defaults nor its own `register` list holds (a change on a
|
|
455
|
+
* change). As sentences; empty when it is one set of changes on one genre's
|
|
456
|
+
* defaults. Conformance C37 reads it; a host's install may too.
|
|
457
|
+
* @experimental
|
|
458
|
+
* @ruling R2, R3, R22
|
|
459
|
+
*/
|
|
460
|
+
export declare function presetLevelFindings(preset: {
|
|
461
|
+
slug?: string;
|
|
462
|
+
genre?: unknown;
|
|
463
|
+
registrations?: PresetRegistrationChanges;
|
|
464
|
+
} | null | undefined, genreDefaults?: readonly RegistrationDecl[]): string[];
|
|
465
|
+
/**
|
|
466
|
+
* 🚧 One `requires` entry read (A16): a package with a version range
|
|
467
|
+
* (`acme.dice@^1.2`), or a declared id (`acme:spec/x`, `core:event/x@1` — the
|
|
468
|
+
* `@1` of an event is its version, part of the id) with an optional range
|
|
469
|
+
* written after it (`acme:spec/x@^2`). `undefined` when it is neither.
|
|
470
|
+
* @experimental
|
|
471
|
+
* @ruling A16
|
|
472
|
+
*/
|
|
473
|
+
export declare function parseRequirement(entry: string): {
|
|
474
|
+
requirement: string;
|
|
475
|
+
package: string;
|
|
476
|
+
id?: string;
|
|
477
|
+
range?: string;
|
|
478
|
+
} | undefined;
|
|
479
|
+
/**
|
|
480
|
+
* 🚧 The version ranges a manifest's (or an announcement's) `requires`
|
|
481
|
+
* names (A16) — one per entry that carries a range. The host enforces them
|
|
482
|
+
* at install (lane 5b); a preset whose requirement is missing or disabled is
|
|
483
|
+
* withdrawn, and nothing is deleted.
|
|
484
|
+
* @experimental
|
|
485
|
+
* @ruling A16
|
|
486
|
+
*/
|
|
487
|
+
export declare function requirementRanges(manifest: {
|
|
488
|
+
requires?: readonly string[];
|
|
489
|
+
} | null | undefined): Array<{
|
|
490
|
+
requirement: string;
|
|
491
|
+
package: string;
|
|
492
|
+
id?: string;
|
|
493
|
+
range: string;
|
|
494
|
+
}>;
|
|
326
495
|
/**
|
|
327
496
|
* The stored form of a preset. Every reference is read down to its id and
|
|
328
497
|
* checked against what the value says: a binding's events against its spec's
|
|
@@ -331,7 +500,11 @@ export interface PresetInput {
|
|
|
331
500
|
* @experimental
|
|
332
501
|
*/
|
|
333
502
|
export declare function preset(input: PresetInput): PresetDecl;
|
|
334
|
-
/**
|
|
503
|
+
/**
|
|
504
|
+
* The compiled announcement — the package's declaration artifact.
|
|
505
|
+
* @experimental
|
|
506
|
+
* @ruling 24 §10
|
|
507
|
+
*/
|
|
335
508
|
export interface AnnouncementDocument {
|
|
336
509
|
schemaVersion: 1;
|
|
337
510
|
identity: PackageIdentity;
|
|
@@ -343,17 +516,22 @@ export interface AnnouncementDocument {
|
|
|
343
516
|
configs: ConfigDecl[];
|
|
344
517
|
presets: PresetDecl[];
|
|
345
518
|
/**
|
|
346
|
-
* Frame surfaces this package ships
|
|
519
|
+
* Frame surfaces this package ships — the documents an
|
|
347
520
|
* instance mounts in opaque-origin iframes. Absent means the package has
|
|
348
521
|
* no UI of its own, which is the common case.
|
|
522
|
+
* @ruling 20 §12, 21 §7
|
|
349
523
|
*/
|
|
350
524
|
surfaces?: SurfacesDecl;
|
|
351
|
-
/**
|
|
525
|
+
/**
|
|
526
|
+
* In-document components (virtual tier).
|
|
527
|
+
* @ruling 10 §2
|
|
528
|
+
*/
|
|
352
529
|
components: ComponentDecl[];
|
|
353
530
|
/**
|
|
354
|
-
* Definitions this package offers on other packages' swappable nodes
|
|
355
|
-
*
|
|
531
|
+
* Definitions this package offers on other packages' swappable nodes,
|
|
532
|
+
* stored as ids. Absent when the package contributes none, so
|
|
356
533
|
* a package that declares no swap announces exactly what it did before.
|
|
534
|
+
* @ruling R29
|
|
357
535
|
*/
|
|
358
536
|
swaps?: StoredSwapContribution[];
|
|
359
537
|
/**
|
|
@@ -365,7 +543,11 @@ export interface AnnouncementDocument {
|
|
|
365
543
|
/** Ids referenced but not declared here — the instance enforces these at install. */
|
|
366
544
|
requires: string[];
|
|
367
545
|
}
|
|
368
|
-
/**
|
|
546
|
+
/**
|
|
547
|
+
* One event slot's standing in a preset, for the coverage report.
|
|
548
|
+
* @experimental
|
|
549
|
+
* @ruling 24 §7
|
|
550
|
+
*/
|
|
369
551
|
export interface CoverageSlot {
|
|
370
552
|
event: string;
|
|
371
553
|
required: boolean;
|
|
@@ -410,20 +592,27 @@ export declare class AnnouncementBuilder {
|
|
|
410
592
|
/** Context sugar: mints `${ns}:genre/${name}` so the id cannot be mistyped. */
|
|
411
593
|
genre(name: string, props: GenreProps): GenreDecl;
|
|
412
594
|
genres(map: Record<string, GenreDecl>): this;
|
|
413
|
-
/**
|
|
595
|
+
/**
|
|
596
|
+
* Declarations only — implementations bind by id per trust domain.
|
|
597
|
+
* @ruling 24 §11
|
|
598
|
+
*/
|
|
414
599
|
hooks(map: Record<string, HookDeclaration>): this;
|
|
415
600
|
pipelines(...specs: AnnouncedSpec[]): this;
|
|
416
601
|
configs(...configs: ConfigInput<any>[]): this;
|
|
417
602
|
prompts(...prompts: PromptDecl[]): this;
|
|
418
603
|
presets(...presets: PresetInput[]): this;
|
|
419
604
|
/**
|
|
420
|
-
* The frame surfaces this package ships
|
|
605
|
+
* The frame surfaces this package ships: documents mounted in
|
|
421
606
|
* opaque-origin iframes. Declared, never discovered — an instance renders
|
|
422
607
|
* what the manifest says and `serene-pub preview` renders the same list,
|
|
423
608
|
* so a surface a modder previewed is a surface an instance will offer.
|
|
609
|
+
* @ruling 20 §12
|
|
424
610
|
*/
|
|
425
611
|
surfaces(decl: SurfacesDecl): this;
|
|
426
|
-
/**
|
|
612
|
+
/**
|
|
613
|
+
* In-document components (virtual tier) — code trust at install.
|
|
614
|
+
* @ruling 10 §2
|
|
615
|
+
*/
|
|
427
616
|
components(...components: ComponentDecl[]): this;
|
|
428
617
|
/**
|
|
429
618
|
* Offer this package's definitions on another package's swappable nodes:
|
|
@@ -434,7 +623,8 @@ export declare class AnnouncementBuilder {
|
|
|
434
623
|
swaps(...contributions: SwapContribution[]): this;
|
|
435
624
|
/**
|
|
436
625
|
* Validate the announcement as a whole and compile it to the document.
|
|
437
|
-
* Errors carry exact paths — the teaching-error pattern
|
|
626
|
+
* Errors carry exact paths — the teaching-error pattern.
|
|
627
|
+
* @ruling 15 §1.3
|
|
438
628
|
*/
|
|
439
629
|
build(): {
|
|
440
630
|
document: AnnouncementDocument;
|