@serene-pub/sdk 0.6.0-pr-5 → 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/dist/actions.d.ts +29 -2
- package/dist/actions.js +20 -5
- package/dist/annexFields.d.ts +4 -1
- package/dist/annexFields.js +1 -0
- package/dist/announce.d.ts +142 -2
- package/dist/announce.js +198 -2
- package/dist/attributes.d.ts +281 -5
- package/dist/attributes.js +308 -27
- package/dist/bridges.d.ts +61 -0
- package/dist/bridges.js +112 -0
- package/dist/builder.d.ts +277 -50
- package/dist/builder.js +266 -29
- package/dist/cadences.d.ts +578 -0
- package/dist/cadences.js +1111 -0
- 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/component.d.ts +1 -1
- 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 +42 -6
- package/dist/config.js +48 -20
- package/dist/conversions.d.ts +41 -0
- package/dist/conversions.js +50 -0
- package/dist/declarations.d.ts +25 -2
- package/dist/declarations.js +149 -10
- package/dist/descriptors.d.ts +186 -4
- package/dist/descriptors.js +199 -18
- package/dist/document.d.ts +47 -2
- package/dist/document.js +46 -14
- package/dist/entities.d.ts +156 -0
- package/dist/entities.js +259 -0
- package/dist/events.d.ts +547 -1
- package/dist/events.js +345 -1
- package/dist/executor.d.ts +4 -3
- package/dist/executor.js +22 -8
- package/dist/exposure.d.ts +128 -0
- package/dist/exposure.js +168 -0
- package/dist/fit.d.ts +198 -0
- package/dist/fit.js +351 -0
- package/dist/functions.d.ts +554 -0
- package/dist/functions.js +712 -0
- package/dist/genres.d.ts +285 -89
- package/dist/genres.js +299 -100
- package/dist/hookGrants.d.ts +1 -1
- package/dist/hookGrants.js +1 -1
- package/dist/hooks.d.ts +21 -5
- package/dist/hooks.js +5 -2
- package/dist/hostElements.d.ts +7 -1
- package/dist/hostElements.js +14 -1
- package/dist/hostState.d.ts +110 -0
- package/dist/hostState.js +140 -0
- package/dist/identity.d.ts +1 -1
- package/dist/identity.js +1 -1
- package/dist/index.d.ts +21 -0
- package/dist/index.js +40 -0
- package/dist/jsonSchema.d.ts +178 -0
- package/dist/jsonSchema.js +558 -0
- package/dist/media.d.ts +127 -12
- package/dist/media.js +45 -1
- package/dist/messageBlocks.d.ts +179 -5
- package/dist/messageBlocks.js +208 -6
- package/dist/participants.d.ts +32 -9
- package/dist/participants.js +13 -2
- package/dist/pluginHarness.d.ts +14 -32
- package/dist/pluginHarness.js +14 -141
- package/dist/pluginPermissions.js +1 -1
- package/dist/preview.d.ts +45 -4
- package/dist/preview.js +52 -12
- package/dist/primers.d.ts +177 -0
- package/dist/primers.js +265 -0
- package/dist/receipt.d.ts +11 -0
- package/dist/refs.d.ts +9 -1
- package/dist/refs.js +12 -0
- package/dist/registrations.d.ts +384 -0
- package/dist/registrations.js +625 -0
- package/dist/repertoires.d.ts +502 -0
- package/dist/repertoires.js +666 -0
- 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/sceneSettings.d.ts +8 -0
- package/dist/sceneSettings.js +10 -2
- package/dist/scope.d.ts +44 -3
- package/dist/scope.js +18 -0
- package/dist/scripts.d.ts +31 -8
- package/dist/scripts.js +45 -8
- package/dist/sessionDossier.d.ts +124 -7
- package/dist/sessionLayout.d.ts +291 -138
- package/dist/sessionLayout.js +504 -211
- package/dist/sessionSettings.d.ts +24 -0
- package/dist/settings.d.ts +21 -0
- package/dist/shapes.d.ts +40 -1
- package/dist/shapes.js +52 -4
- package/dist/statShapes.d.ts +8 -1
- package/dist/statShapes.js +8 -1
- package/dist/status.d.ts +14 -0
- package/dist/status.js +12 -0
- package/dist/storage.d.ts +9 -66
- package/dist/storage.js +7 -12
- package/dist/templateScopeAt.d.ts +1 -1
- package/dist/templateScopeAt.js +11 -8
- package/dist/ties.d.ts +210 -0
- package/dist/ties.js +300 -0
- package/dist/turnOrder.d.ts +25 -14
- package/dist/turnOrder.js +21 -8
- package/dist/validate.js +114 -19
- package/dist/vocabularies.d.ts +192 -0
- package/dist/vocabularies.js +326 -0
- package/dist/widgetDecls.d.ts +12 -0
- package/dist/widgetDecls.js +2 -0
- package/dist/widgets.d.ts +597 -21
- package/dist/widgets.js +20 -0
- package/host-elements.d.ts +88 -0
- package/package.json +1 -1
package/dist/attributes.d.ts
CHANGED
|
@@ -74,6 +74,7 @@
|
|
|
74
74
|
import type { I18n } from './descriptors.js';
|
|
75
75
|
import type { FieldDecl } from './settings.js';
|
|
76
76
|
import { type StatShapeId, type StatShapeKind } from './statShapes.js';
|
|
77
|
+
import { type PieceDuration } from './repertoires.js';
|
|
77
78
|
/** `owner:slot/name@N` — `core:slot/hp@1`, `acme.rp:slot/tension@1`. @experimental */
|
|
78
79
|
export type SlotId = string;
|
|
79
80
|
/** @experimental */
|
|
@@ -209,6 +210,12 @@ export interface SlotConfig {
|
|
|
209
210
|
* premade stat).
|
|
210
211
|
*/
|
|
211
212
|
entryTypes?: readonly string[];
|
|
213
|
+
/**
|
|
214
|
+
* 🚧 `list`: the repertoire whose pieces it holds, by address —
|
|
215
|
+
* `core:ruleset/freeform@1#things` (`repertoireAddress`). Absent, the list
|
|
216
|
+
* holds words and lore references only.
|
|
217
|
+
*/
|
|
218
|
+
repertoire?: string;
|
|
212
219
|
/** `derived`: which computation, and the slot it reads. */
|
|
213
220
|
derivation?: string;
|
|
214
221
|
from?: SlotId;
|
|
@@ -249,8 +256,100 @@ export interface SlotLoreRef {
|
|
|
249
256
|
/** The entry's title as of the read. Filled by the host; never stored. */
|
|
250
257
|
name?: string;
|
|
251
258
|
}
|
|
252
|
-
/**
|
|
253
|
-
|
|
259
|
+
/**
|
|
260
|
+
* 🚧 A piece's overrides on a referenced lore entry or compendium row: the
|
|
261
|
+
* piece fields this holder's copy changes (a sword's new nickname, a door
|
|
262
|
+
* now barred) and no others. Checked key by key against the repertoire's
|
|
263
|
+
* piece shape. Never an edit to the entry or the row.
|
|
264
|
+
* @experimental
|
|
265
|
+
*/
|
|
266
|
+
export type PieceOverrides = Readonly<Record<string, unknown>>;
|
|
267
|
+
/**
|
|
268
|
+
* 🚧 A piece written out where it is held: the universal parts (`name`,
|
|
269
|
+
* `description`, `prose?`, `traits?`, `equipped?`, `duration?` —
|
|
270
|
+
* `PIECE_FIELDS`) and the repertoire's own fields, flat.
|
|
271
|
+
* @experimental
|
|
272
|
+
*/
|
|
273
|
+
export interface InlinePiece {
|
|
274
|
+
kind: 'inline';
|
|
275
|
+
name: string;
|
|
276
|
+
description: string;
|
|
277
|
+
prose?: string;
|
|
278
|
+
traits?: readonly string[];
|
|
279
|
+
/** 🚧 Worn, wielded or readied (2026-10-17, universal). */
|
|
280
|
+
equipped?: boolean;
|
|
281
|
+
/** 🚧 How long it lasts on its holder (2026-10-17, universal) — `PieceDuration`. */
|
|
282
|
+
duration?: PieceDuration;
|
|
283
|
+
/** How many are held; absent means one. */
|
|
284
|
+
count?: number;
|
|
285
|
+
[field: string]: unknown;
|
|
286
|
+
}
|
|
287
|
+
/**
|
|
288
|
+
* 🚧 A referenced piece as the host read it — the lore entry or the
|
|
289
|
+
* compendium row, **before** this holder's overrides — so a widget draws it
|
|
290
|
+
* without carrying the compendium or reading the lorebook. Filled by the
|
|
291
|
+
* host at read time on a `lore` or `compendium` piece; never stored, never
|
|
292
|
+
* written back (`slotValueForStorage` drops it). Absent: the host could not
|
|
293
|
+
* read it (an entry gone, a ruleset not installed) — draw the reference by
|
|
294
|
+
* its id.
|
|
295
|
+
* @experimental
|
|
296
|
+
*/
|
|
297
|
+
export interface SlotPieceResolved {
|
|
298
|
+
/** The entry's title, or the row's name. */
|
|
299
|
+
name: string;
|
|
300
|
+
description?: string;
|
|
301
|
+
prose?: string;
|
|
302
|
+
traits?: readonly string[];
|
|
303
|
+
/**
|
|
304
|
+
* Its key facts, in words, in the repertoire's declared order — the
|
|
305
|
+
* field's key, its label, its value (`damage` · _Damage_ · _1d8 Slashing_).
|
|
306
|
+
*/
|
|
307
|
+
keyProps: readonly {
|
|
308
|
+
key: string;
|
|
309
|
+
label: string;
|
|
310
|
+
value: string;
|
|
311
|
+
}[];
|
|
312
|
+
/** The name of the ruleset whose library holds a compendium row (_Vis Itineris_). */
|
|
313
|
+
compendiumName?: string;
|
|
314
|
+
}
|
|
315
|
+
/** 🚧 A piece that is a lore entry, with this holder's overrides. @experimental */
|
|
316
|
+
export interface LorePiece {
|
|
317
|
+
kind: 'lore';
|
|
318
|
+
entryId: number;
|
|
319
|
+
count?: number;
|
|
320
|
+
overrides?: PieceOverrides;
|
|
321
|
+
/** The entry's title as of the read. Filled by the host; never stored. */
|
|
322
|
+
name?: string; /** 🚧 The entry as the host read it. Filled by the host; never stored. @experimental */
|
|
323
|
+
resolved?: SlotPieceResolved;
|
|
324
|
+
}
|
|
325
|
+
/**
|
|
326
|
+
* 🚧 A piece that is a compendium row, pinned to the row's `version`, with
|
|
327
|
+
* this holder's overrides. `compendiumId` is the ruleset whose compendium
|
|
328
|
+
* holds it.
|
|
329
|
+
* @experimental
|
|
330
|
+
*/
|
|
331
|
+
export interface CompendiumPiece {
|
|
332
|
+
kind: 'compendium';
|
|
333
|
+
compendiumId: string;
|
|
334
|
+
pieceId: string;
|
|
335
|
+
version: string;
|
|
336
|
+
count?: number;
|
|
337
|
+
overrides?: PieceOverrides;
|
|
338
|
+
/** The row's name as of the read. Filled by the host; never stored. */
|
|
339
|
+
name?: string; /** 🚧 The row as the host read it. Filled by the host; never stored. @experimental */
|
|
340
|
+
resolved?: SlotPieceResolved;
|
|
341
|
+
}
|
|
342
|
+
/**
|
|
343
|
+
* 🚧 A structured list item — a **piece** of a repertoire. Legal only in a
|
|
344
|
+
* list slot whose `config.repertoire` names one (`repertoires.ts`); a plain
|
|
345
|
+
* list holds words and lore references.
|
|
346
|
+
* @experimental
|
|
347
|
+
*/
|
|
348
|
+
export type SlotPiece = InlinePiece | LorePiece | CompendiumPiece;
|
|
349
|
+
/** 🚧 Is this list item a piece? @experimental */
|
|
350
|
+
export declare const isSlotPiece: (item: unknown) => item is SlotPiece;
|
|
351
|
+
/** One item of a `list`: a word, a lore reference, or (🚧 on a repertoire) a piece. @experimental */
|
|
352
|
+
export type SlotListItem = SlotScalar | SlotLoreRef | SlotPiece;
|
|
254
353
|
/**
|
|
255
354
|
* A stored attribute value: one thing, or — for a `list` — several. One thing
|
|
256
355
|
* may be a lore reference only on a `text` slot whose config names
|
|
@@ -286,6 +385,25 @@ export declare function slotListItemText(item: SlotListItem): string;
|
|
|
286
385
|
* @experimental
|
|
287
386
|
*/
|
|
288
387
|
export declare function slotValueForStorage(value: SlotValue): SlotValue;
|
|
388
|
+
/**
|
|
389
|
+
* 🚧 One band of a slot's words ({@link AttributeSlotProps.words}): a value
|
|
390
|
+
* whose share of the stat's maximum is at most `upTo` reads `label`.
|
|
391
|
+
* @experimental
|
|
392
|
+
*/
|
|
393
|
+
export interface SlotWordsBand {
|
|
394
|
+
readonly upTo: number;
|
|
395
|
+
readonly label: I18n;
|
|
396
|
+
}
|
|
397
|
+
/**
|
|
398
|
+
* 🚧 The words a value reads at a table that keeps no numbers: the first
|
|
399
|
+
* band its share of `max` fits (`max` absent or 0: a value above none is the
|
|
400
|
+
* whole), or `null` when the slot declares none.
|
|
401
|
+
* @experimental
|
|
402
|
+
*/
|
|
403
|
+
export declare function slotWordsFor(bands: readonly {
|
|
404
|
+
upTo: number;
|
|
405
|
+
label: string;
|
|
406
|
+
}[] | undefined, value: unknown, max: unknown): string | null;
|
|
289
407
|
/**
|
|
290
408
|
* One rule on a declaration: when this holds, do this to the value.
|
|
291
409
|
*
|
|
@@ -413,6 +531,76 @@ export interface AttributeSlotProps {
|
|
|
413
531
|
* Absent is pickable. Inside the content hash when stated.
|
|
414
532
|
*/
|
|
415
533
|
pickable?: false;
|
|
534
|
+
/**
|
|
535
|
+
* 🚧 The ruleset that declares this slot (`core:ruleset/vis-itineris@1`), when
|
|
536
|
+
* one does. Such a slot is **pickable only in a session whose ruleset it
|
|
537
|
+
* is** (`slotPickableIn`) — so a ruleset's stats never flood every
|
|
538
|
+
* session's picker. Declaration-level; the host honours it where it lists
|
|
539
|
+
* pickable slots. Inside the content hash when stated (added 2026-10-16,
|
|
540
|
+
* rulesets W3-S).
|
|
541
|
+
*
|
|
542
|
+
* ⏳ Redundant since 2026-10-17: a slot a ruleset lists under its `stats`
|
|
543
|
+
* is owned by it without saying so (`slotRulesetOwners`), unless that
|
|
544
|
+
* ruleset marks the entry `borrowed`. Still accepted for a plugin that
|
|
545
|
+
* spells it; the two are read together.
|
|
546
|
+
*/
|
|
547
|
+
rulesetOwned?: string;
|
|
548
|
+
/**
|
|
549
|
+
* 🚧 The fewest **active player seats** a session needs before this slot
|
|
550
|
+
* is tracked at all (owner ruling 2026-10-17: "What does Ann do when
|
|
551
|
+
* you're away?" is a question for a table with other seats). `2` on
|
|
552
|
+
* the Dungeon Crawler's standing order: a solo session leaves the slot
|
|
553
|
+
* out of its vocabulary — no sheet row, no form question, a write
|
|
554
|
+
* refused — and it appears the moment a second seat joins. Absent or
|
|
555
|
+
* `1`: always tracked. Read by the host's vocabulary from its seat
|
|
556
|
+
* count; inside the content hash when stated, as `rulesetOwned` is.
|
|
557
|
+
*/
|
|
558
|
+
minSeats?: number;
|
|
559
|
+
/**
|
|
560
|
+
* 🚧 The **ruleset setting** this slot is tracked under (2026-10-18): a
|
|
561
|
+
* slot only one way of playing a ruleset uses — Vis Itineris's spell
|
|
562
|
+
* points under `casting: points`, a crawl's spell slots under `casting:
|
|
563
|
+
* slots` — is left out of a session whose setting holds another choice,
|
|
564
|
+
* as `minSeats` leaves a slot out below its seat count: no sheet row, no
|
|
565
|
+
* form question, a write refused. The values already filed stay, and read
|
|
566
|
+
* again the moment the setting comes back. Read by the host's vocabulary
|
|
567
|
+
* from the session's ruleset settings (the setting's default when the
|
|
568
|
+
* session chose none). 🚧 A session that does not play `ruleset` does not
|
|
569
|
+
* track it either (2026-10-19, PLAN-dc-after-walk2 Q2-3): the setting is
|
|
570
|
+
* that ruleset's, and the slot means nothing without it — a Story
|
|
571
|
+
* session's sheet showed an empty "Spell slots" row. Inside the content
|
|
572
|
+
* hash when stated, as `minSeats` is.
|
|
573
|
+
*/
|
|
574
|
+
whenRulesetSetting?: {
|
|
575
|
+
/** The ruleset whose setting is read (`core:ruleset/vis-itineris@1`). */
|
|
576
|
+
readonly ruleset: string;
|
|
577
|
+
/** The setting's name (`casting`). */
|
|
578
|
+
readonly setting: string;
|
|
579
|
+
/** The choices under which the slot is tracked (`['points']`). */
|
|
580
|
+
readonly is: readonly string[];
|
|
581
|
+
};
|
|
582
|
+
/**
|
|
583
|
+
* 🚧 How a bounded number reads at a table that **keeps no numbers** (a
|
|
584
|
+
* ruleset of words, the Freeform ruleset — PLAN-dc-after-walk2 Q2-3, owner
|
|
585
|
+
* ruling ★3): bands, first fitting first, each `upTo` a share of the
|
|
586
|
+
* stat's own maximum (0 to 1) and its words — core's health reads
|
|
587
|
+
* _unhurt_, _hurt_, _badly hurt_, _at death's door_. A widget draws the
|
|
588
|
+
* words in place of the number there, and a number with no words not at
|
|
589
|
+
* all; everywhere else they change nothing. Inside the content hash when
|
|
590
|
+
* stated.
|
|
591
|
+
* @experimental
|
|
592
|
+
*/
|
|
593
|
+
words?: readonly SlotWordsBand[];
|
|
594
|
+
/**
|
|
595
|
+
* 🚧 A stat drawn on a sheet **only while it holds something**
|
|
596
|
+
* (PLAN-dc-after-walk2 Q3-8): a mechanism's passing state — a crawl's
|
|
597
|
+
* death saves while somebody lies dying — that would otherwise stand on
|
|
598
|
+
* every sheet as an empty row. Nothing, null and blank text read as
|
|
599
|
+
* nothing. Tracked, written and read as any other stat; only a widget's
|
|
600
|
+
* drawing changes. Inside the content hash when stated.
|
|
601
|
+
* @experimental
|
|
602
|
+
*/
|
|
603
|
+
shownWhenSet?: true;
|
|
416
604
|
/**
|
|
417
605
|
* 🚧 **Earshot**: which prompts may read this slot's value.
|
|
418
606
|
*
|
|
@@ -447,6 +635,36 @@ export declare const SLOT_EARSHOTS: readonly SlotEarshot[];
|
|
|
447
635
|
export declare const slotEarshot: (decl: Pick<AttributeSlotProps, 'earshot'>) => SlotEarshot;
|
|
448
636
|
/** 🚧 May a session pick this slot as an attribute of its own or carry it in from its world? @experimental */
|
|
449
637
|
export declare const slotPickable: (decl: Pick<AttributeSlotProps, 'pickable'>) => boolean;
|
|
638
|
+
/** Record the slots a registering ruleset owns. Called by `rulesets.ts` only. @internal */
|
|
639
|
+
export declare function _registerRulesetStats(rulesetId: string, slotIds: readonly SlotId[]): void;
|
|
640
|
+
/** @internal */
|
|
641
|
+
export declare function _clearRulesetStats(): void;
|
|
642
|
+
/**
|
|
643
|
+
* 🚧 Forget that one ruleset lists any slot (`_registerRulesetStats`'s
|
|
644
|
+
* inverse); a slot nobody lists any more is dropped from the index.
|
|
645
|
+
* @internal
|
|
646
|
+
*/
|
|
647
|
+
export declare function _withdrawRulesetStats(rulesetId: string): void;
|
|
648
|
+
/**
|
|
649
|
+
* 🚧 The rulesets that own a slot: every registered ruleset that lists it
|
|
650
|
+
* under its `stats` (not `borrowed`), with the slot's own `rulesetOwned` if
|
|
651
|
+
* it spells one. Empty: no ruleset's — pickable in every session.
|
|
652
|
+
* @experimental
|
|
653
|
+
*/
|
|
654
|
+
export declare function slotRulesetOwners(decl: Pick<AttributeSlotProps, 'rulesetOwned'> & {
|
|
655
|
+
id?: SlotId;
|
|
656
|
+
}): readonly string[];
|
|
657
|
+
/**
|
|
658
|
+
* 🚧 May a session whose ruleset is `sessionRuleset` pick this slot? A slot a
|
|
659
|
+
* ruleset owns (`slotRulesetOwners`: listed under its `stats`, or spelled
|
|
660
|
+
* `rulesetOwned`) is pickable only in the sessions of a ruleset that owns
|
|
661
|
+
* it; every other slot answers as `slotPickable` does. Pass the declaration
|
|
662
|
+
* with its `id`, so the derived owners are read.
|
|
663
|
+
* @experimental
|
|
664
|
+
*/
|
|
665
|
+
export declare const slotPickableIn: (decl: Pick<AttributeSlotProps, 'pickable' | 'rulesetOwned'> & {
|
|
666
|
+
id?: SlotId;
|
|
667
|
+
}, sessionRuleset: string | null | undefined) => boolean;
|
|
450
668
|
/**
|
|
451
669
|
* Which source a registry entry came through.
|
|
452
670
|
*
|
|
@@ -500,14 +718,35 @@ export declare const SLOT_DISPLAY_KEYS: {
|
|
|
500
718
|
* with both hashes named.
|
|
501
719
|
* @internal
|
|
502
720
|
*/
|
|
503
|
-
export declare function defineAttributeSlot(id:
|
|
721
|
+
export declare function defineAttributeSlot<const Id extends SlotId, const P extends AttributeSlotProps>(id: Id, props: P): DeclaredAttributeSlot<Id, P>;
|
|
722
|
+
/**
|
|
723
|
+
* 🚧 A slot declaration that remembers, in its TYPE, what was declared — its
|
|
724
|
+
* id and its props (A5, A18): what `sessionOf(genre)` and `vocabulary(…)` read
|
|
725
|
+
* to type a condition's property (`s.world.weather` is an enum of the slot's
|
|
726
|
+
* own choices). The value is the plain registered `AttributeSlotDecl`;
|
|
727
|
+
* `__declared` is a phantom, never set.
|
|
728
|
+
* @experimental
|
|
729
|
+
* @ruling A5, A18
|
|
730
|
+
*/
|
|
731
|
+
export type DeclaredAttributeSlot<Id extends SlotId = SlotId, P extends AttributeSlotProps = AttributeSlotProps> = AttributeSlotDecl & {
|
|
732
|
+
readonly id: Id;
|
|
733
|
+
readonly __declared?: P;
|
|
734
|
+
};
|
|
735
|
+
/**
|
|
736
|
+
* 🚧 The rulesets' door: the slot a ruleset's own attribute files its values
|
|
737
|
+
* under (`rulesetAttributeSlotDecls`, `<owner>.<ruleset>:slot/<attribute>@N`),
|
|
738
|
+
* registered by `defineRuleset` with the ruleset and withdrawn with it. A
|
|
739
|
+
* code declaration, so an identical re-declaration is a no-op.
|
|
740
|
+
* @internal
|
|
741
|
+
*/
|
|
742
|
+
export declare function _defineRulesetAttributeSlot(id: SlotId, props: AttributeSlotProps): AttributeSlotDecl;
|
|
504
743
|
/**
|
|
505
744
|
* The plugin-facing door — same registration, minus the ability to claim core's
|
|
506
745
|
* namespace. A plugin that could redefine `core:slot/hp@1` would change what
|
|
507
746
|
* every character's health means on the instance without appearing anywhere.
|
|
508
747
|
* @experimental
|
|
509
748
|
*/
|
|
510
|
-
export declare function definePluginAttributeSlot(pluginId: string, id:
|
|
749
|
+
export declare function definePluginAttributeSlot<const Id extends SlotId, const P extends AttributeSlotProps>(pluginId: string, id: Id, props: P): DeclaredAttributeSlot<Id, P>;
|
|
511
750
|
/**
|
|
512
751
|
* The person-facing door: a slot somebody authored, loaded from the host's
|
|
513
752
|
* `attribute_declarations` row.
|
|
@@ -577,7 +816,9 @@ export declare function slotField(decl: Pick<AttributeSlotProps, 'type' | 'shape
|
|
|
577
816
|
/** The catalogue shape a slot names, when it names one (an inline `FieldDecl` names none). @experimental */
|
|
578
817
|
export declare const slotStatShapeId: (decl: Pick<AttributeSlotProps, 'shape'>) => StatShapeId | undefined;
|
|
579
818
|
/** Which kind of stat a slot is; `undefined` for a derived slot, which is computed rather than kept. @experimental */
|
|
580
|
-
export declare const slotStatShapeKind: (decl: Pick<AttributeSlotProps, 'type' | 'shape'>
|
|
819
|
+
export declare const slotStatShapeKind: (decl: Pick<AttributeSlotProps, 'type' | 'shape'> & {
|
|
820
|
+
config?: Pick<SlotConfig, 'repertoire'>;
|
|
821
|
+
}) => StatShapeKind | undefined;
|
|
581
822
|
/**
|
|
582
823
|
* What a field bounds, as the configuration keys a layer deviates from: a
|
|
583
824
|
* number's `min`/`max`; a choice's options (`of`, or its `members`' keys); a
|
|
@@ -586,6 +827,41 @@ export declare const slotStatShapeKind: (decl: Pick<AttributeSlotProps, 'type' |
|
|
|
586
827
|
* @experimental
|
|
587
828
|
*/
|
|
588
829
|
export declare function fieldSlotConfig(field: FieldDecl | undefined): SlotConfig;
|
|
830
|
+
/**
|
|
831
|
+
* 🚧 One owner's **stat configuration**, as a document (owner ruling
|
|
832
|
+
* 2026-10-15): which owner, which attribute slot, and the deviations this
|
|
833
|
+
* owner makes from the slot's own config — `{ max: 26 }`, never the whole.
|
|
834
|
+
* The ONE format a pipeline's `core:outlet/set-stat-config@1` and a person's
|
|
835
|
+
* card or session editor (`state:configure`) both send.
|
|
836
|
+
*
|
|
837
|
+
* `owner` is a participant reference — `player-seat:<id>`, `character:<id>`
|
|
838
|
+
* — or `world`; `config`'s keys are only those `statConfigKeys` names.
|
|
839
|
+
* @experimental
|
|
840
|
+
*/
|
|
841
|
+
export interface StatConfigDocument {
|
|
842
|
+
owner: string;
|
|
843
|
+
slot: SlotId;
|
|
844
|
+
config: SlotConfig;
|
|
845
|
+
}
|
|
846
|
+
/**
|
|
847
|
+
* 🚧 The configuration keys an owner may set on this slot: what its stat
|
|
848
|
+
* shape bounds (`fieldSlotConfig`'s keys) — a number's `min` and `max`; a
|
|
849
|
+
* choice's `of`; a list's `maxItems` and, by its item, `of` or
|
|
850
|
+
* `maxLength`; a line's `maxLength` — and, on every kept slot, the
|
|
851
|
+
* `descriptor` (the model-facing sentence in this world, R5). A derived
|
|
852
|
+
* slot takes none. Nothing else is stored per owner: a key outside these
|
|
853
|
+
* would be kept and read by nobody.
|
|
854
|
+
* @experimental
|
|
855
|
+
*/
|
|
856
|
+
export declare function statConfigKeys(decl: Pick<AttributeSlotProps, 'type' | 'shape'>): readonly string[];
|
|
857
|
+
/**
|
|
858
|
+
* 🚧 Why this owner configuration may not be stored for this slot — one
|
|
859
|
+
* sentence per fault, empty when it may. Asked of the document's `config`
|
|
860
|
+
* alone; whether its `min` still sits under the owner's `max` once merged
|
|
861
|
+
* with what is in force is the writer's to ask (it holds the layers).
|
|
862
|
+
* @experimental
|
|
863
|
+
*/
|
|
864
|
+
export declare function statConfigRefusals(decl: AttributeSlotDecl, config: unknown): string[];
|
|
589
865
|
/**
|
|
590
866
|
* The configuration in force for one owner: the declaration's own config with
|
|
591
867
|
* each layer's deviations laid over it, nearest layer last.
|