@serene-pub/sdk 0.6.0-pr-7 → 0.6.0-pr-9
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/annexFields.d.ts +14 -0
- package/dist/annexFields.js +7 -0
- package/dist/announce.d.ts +62 -16
- package/dist/announce.js +90 -4
- package/dist/appletCard.d.ts +17 -0
- package/dist/appletCard.js +60 -0
- package/dist/attributes.d.ts +3 -3
- package/dist/attributes.js +1 -1
- package/dist/builder.d.ts +28 -13
- package/dist/builder.js +57 -5
- package/dist/cadences.d.ts +8 -1
- package/dist/cadences.js +27 -2
- package/dist/characterProfile.d.ts +137 -0
- package/dist/characterProfile.js +24 -0
- package/dist/component.d.ts +1 -1
- package/dist/componentImports.d.ts +1 -1
- package/dist/componentImports.js +2 -0
- package/dist/componentWire.js +28 -0
- package/dist/conditions.d.ts +5 -1
- package/dist/conditions.js +7 -0
- package/dist/declarations.d.ts +63 -1
- package/dist/declarations.js +176 -7
- package/dist/descriptors.d.ts +145 -6
- package/dist/descriptors.js +106 -5
- package/dist/document.d.ts +9 -1
- package/dist/document.js +44 -1
- package/dist/events.d.ts +82 -8
- package/dist/events.js +42 -5
- package/dist/executor.d.ts +27 -0
- package/dist/executor.js +32 -8
- package/dist/exposure.d.ts +35 -1
- package/dist/exposure.js +64 -2
- package/dist/extension.d.ts +30 -2
- package/dist/extension.js +3 -1
- package/dist/fit.d.ts +4 -1
- package/dist/fit.js +43 -1
- package/dist/functions.d.ts +7 -1
- package/dist/functions.js +3 -1
- package/dist/genres.d.ts +67 -2
- package/dist/genres.js +160 -8
- package/dist/hookGrants.js +10 -0
- package/dist/hostElements.d.ts +3 -3
- package/dist/hostElements.js +12 -4
- package/dist/index.d.ts +5 -0
- package/dist/index.js +10 -0
- package/dist/layout.d.ts +18 -0
- package/dist/libraryDraft.d.ts +2 -0
- package/dist/libraryDraft.js +5 -1
- package/dist/lorebookFile.d.ts +8 -0
- package/dist/lorebookFile.js +21 -0
- package/dist/participants.d.ts +83 -8
- package/dist/participants.js +9 -5
- package/dist/pluginPermissions.js +1 -1
- package/dist/promptBlocks.d.ts +5 -1
- package/dist/promptBlocks.js +23 -8
- package/dist/provisos.d.ts +92 -0
- package/dist/provisos.js +273 -0
- package/dist/receiverRules.js +1 -1
- package/dist/registrations.d.ts +154 -14
- package/dist/registrations.js +293 -23
- package/dist/registry.js +6 -3
- package/dist/repertoires.d.ts +13 -1
- package/dist/repertoires.js +5 -1
- package/dist/rulesetDocument.d.ts +11 -0
- package/dist/rulesetDocument.js +17 -0
- package/dist/rulesetSections.d.ts +12 -0
- package/dist/rulesetSections.js +8 -0
- package/dist/rulesets.js +6 -0
- package/dist/sceneSettings.d.ts +7 -1
- package/dist/sceneSettings.js +10 -5
- package/dist/sessionDossier.d.ts +159 -2
- package/dist/sessionLayout.d.ts +296 -85
- package/dist/sessionLayout.js +397 -133
- package/dist/sessionSettings.d.ts +18 -0
- package/dist/settings.d.ts +28 -1
- package/dist/settings.js +50 -2
- package/dist/shapes.d.ts +15 -1
- package/dist/shapes.js +15 -1
- package/dist/sheetLatitude.d.ts +148 -0
- package/dist/sheetLatitude.js +161 -0
- package/dist/speech.d.ts +14 -3
- package/dist/storyTime.d.ts +77 -1
- package/dist/storyTime.js +117 -8
- package/dist/surfaces.d.ts +49 -2
- package/dist/surfaces.js +3 -0
- package/dist/template.d.ts +38 -1
- package/dist/templateCheck.d.ts +24 -0
- package/dist/templateCheck.js +465 -10
- package/dist/templateFit.js +8 -1
- package/dist/templateIds.d.ts +6 -0
- package/dist/templateIds.js +9 -0
- package/dist/turnLock.d.ts +10 -1
- package/dist/turnLock.js +6 -1
- package/dist/turnOrder.d.ts +37 -4
- package/dist/turnOrder.js +49 -11
- package/dist/validate.d.ts +4 -2
- package/dist/validate.js +84 -11
- package/dist/variableLayouts.d.ts +160 -0
- package/dist/variableLayouts.js +202 -0
- package/dist/variables.d.ts +237 -20
- package/dist/variables.js +292 -33
- package/dist/widgetDecls.js +12 -0
- package/dist/widgets.d.ts +449 -47
- package/dist/widgets.js +31 -0
- package/host-elements.d.ts +4 -2
- package/package.json +1 -1
package/dist/declarations.js
CHANGED
|
@@ -20,14 +20,18 @@
|
|
|
20
20
|
* announcement has.
|
|
21
21
|
* @ruling D-1
|
|
22
22
|
*/
|
|
23
|
+
import { assertSpecId, parseSpecId } from './identity.js';
|
|
23
24
|
import { coreWidgetIds, widgetReadsFindings } from './widgetDecls.js';
|
|
25
|
+
import { presetVariableLayoutFindings } from './announce.js';
|
|
24
26
|
import { COMPONENT_FRAMEWORKS } from './extension.js';
|
|
25
|
-
import { CONVERSATION_WIDGET_ID, TURN_ORDER_CHANGED_IS_INTERNAL, sessionEvents } from './genres.js';
|
|
27
|
+
import { CONVERSATION_WIDGET_ID, TURN_ORDER_CHANGED_IS_INTERNAL, genreWarnings, sessionEvents } from './genres.js';
|
|
26
28
|
import { drawnWidgetIds, validateSessionLayout, widgetOfInstance } from './sessionLayout.js';
|
|
27
29
|
import { SAVE_MESSAGE_SPEC_ID, eventsLockFindings, getDefinition, swapFitFinding } from './descriptors.js';
|
|
28
|
-
import { eventById, isEventId, notADeclaredEvent } from './events.js';
|
|
30
|
+
import { CORE_EVENTS, eventById, eventIdOf, isEventId, notADeclaredEvent } from './events.js';
|
|
29
31
|
import { effectiveRegistrations, presetChangesOf, registrationFindings, } from './registrations.js';
|
|
30
|
-
import {
|
|
32
|
+
import { presetProvisoWarnings } from './provisos.js';
|
|
33
|
+
import { assertGenreId, genreDefaultsOf, genres as registeredGenres, getGenre } from './genres.js';
|
|
34
|
+
import { pluginRuleRef } from './pluginRuleRef.js';
|
|
31
35
|
import { actionDocumentFindings, actionsOf, slashCollisions } from './actions.js';
|
|
32
36
|
import { isTodo } from './values.js';
|
|
33
37
|
import { isServableEntry } from './surfaces.js';
|
|
@@ -41,6 +45,99 @@ export const storedSwap = (c) => ({
|
|
|
41
45
|
node: c?.node,
|
|
42
46
|
definition: typeof c?.definition === 'string' ? c.definition : (c?.definition?.id ?? ''),
|
|
43
47
|
});
|
|
48
|
+
/**
|
|
49
|
+
* The stored form of an option — the genre read down to its id; the option is
|
|
50
|
+
* the same object, so the registration door still recognises `register()`'s.
|
|
51
|
+
* @experimental
|
|
52
|
+
*/
|
|
53
|
+
export const storedTurnOrderOption = (o) => ({
|
|
54
|
+
genre: typeof o?.genre === 'string' ? o.genre : (o?.genre?.id ?? ''),
|
|
55
|
+
option: o?.option,
|
|
56
|
+
});
|
|
57
|
+
/**
|
|
58
|
+
* Turn order options a package adds to genres it names. Each is a registration
|
|
59
|
+
* on Turn order asked, labelled, marking no default, running a pipeline the
|
|
60
|
+
* package ships (a model is asked only through core's turn advise, R53), in a
|
|
61
|
+
* genre that is not this package's own. A genre that is neither core's nor the
|
|
62
|
+
* package's is accepted and not required: the instance offers the option once
|
|
63
|
+
* that genre arrives. Reads both the authored and the stored form.
|
|
64
|
+
* @experimental
|
|
65
|
+
* @ruling TQ1, TQ2, TQ4 (owner 2026-11-19)
|
|
66
|
+
*/
|
|
67
|
+
export function turnOrderOptionFindings(options, ctx) {
|
|
68
|
+
const errors = [];
|
|
69
|
+
const warnings = [];
|
|
70
|
+
const asked = eventIdOf(CORE_EVENTS.turnOrderAsked);
|
|
71
|
+
const seen = new Set();
|
|
72
|
+
for (const [i, raw] of options.entries()) {
|
|
73
|
+
const { genre, option } = storedTurnOrderOption(raw);
|
|
74
|
+
const at = `turnOrderOptions[${i}] ('${genre}')`;
|
|
75
|
+
if (!option || typeof option !== 'object' || !option.trigger || typeof option.pipeline !== 'string') {
|
|
76
|
+
errors.push(`${at}.option is not a registration — make it with register(coreEvents.turnOrderAsked, pipeline, { label })`);
|
|
77
|
+
continue;
|
|
78
|
+
}
|
|
79
|
+
let idProblem = false;
|
|
80
|
+
try {
|
|
81
|
+
assertGenreId(genre);
|
|
82
|
+
}
|
|
83
|
+
catch {
|
|
84
|
+
idProblem = true;
|
|
85
|
+
errors.push(`${at}: '${genre}' is not a genre id — name a genre by its value or its id ('core:genre/story', 'acme.rp:genre/mystery')`);
|
|
86
|
+
}
|
|
87
|
+
const own = ctx.genres?.has(genre) || (ctx.ns !== undefined && genre.startsWith(`${ctx.ns}:`));
|
|
88
|
+
if (!idProblem && own)
|
|
89
|
+
errors.push(`${at}: this package's own genre has its options in its defaults — register them with withGenreDefaults, marking one default: true`);
|
|
90
|
+
if (!idProblem && !own && genre.startsWith('core:')) {
|
|
91
|
+
const known = ctx.knownGenre
|
|
92
|
+
? ctx.knownGenre(genre)
|
|
93
|
+
: registeredGenres().some((g) => g.id.startsWith('core:'))
|
|
94
|
+
? getGenre(genre) !== undefined
|
|
95
|
+
: true;
|
|
96
|
+
if (!known)
|
|
97
|
+
errors.push(`${at}: core ships no genre '${genre}' — name one core ships, by value from @serene-pub/core-catalog`);
|
|
98
|
+
}
|
|
99
|
+
if (option.trigger.family !== 'event' || option.trigger.event !== asked)
|
|
100
|
+
errors.push(`${at}: a turn order option registers on Turn order asked ('${asked}') — register(coreEvents.turnOrderAsked, …)`);
|
|
101
|
+
if (option.default !== undefined)
|
|
102
|
+
errors.push(`${at}: a plugin never changes a genre's default — the genre's own default stays its default; drop default`);
|
|
103
|
+
errors.push(...i18nFindings(option.label, `${at}.option.label`, { required: true }));
|
|
104
|
+
const spec = ctx.pipelines.get(option.pipeline);
|
|
105
|
+
if (!spec)
|
|
106
|
+
errors.push(`${at}: runs '${option.pipeline}', which this package does not ship — add it to pipelines`);
|
|
107
|
+
else {
|
|
108
|
+
const lock = spec.input?.genre;
|
|
109
|
+
if (lock !== undefined && lock !== genre)
|
|
110
|
+
errors.push(`${at}: runs '${option.pipeline}', which is locked to genre '${lock}' — build the option for the genre it names`);
|
|
111
|
+
for (const n of spec.nodes) {
|
|
112
|
+
const def = getDefinition(`${n.definitionId}@${n.definitionVersion}`);
|
|
113
|
+
if (!def)
|
|
114
|
+
continue;
|
|
115
|
+
const slots = Object.values(def.slots ?? {});
|
|
116
|
+
const usesConnection = slots.some((s) => s?.kind === 'connection');
|
|
117
|
+
const refused = (usesConnection && !def.id.startsWith('core:')) ||
|
|
118
|
+
(def.kind === 'oracle' && usesConnection && def.id.replace(/@\d+$/, '') !== 'core:oracle/turn-advise');
|
|
119
|
+
if (refused)
|
|
120
|
+
errors.push(`${at}: the step '${n.key}' uses a connection (${def.id}) — a plugin's turn order option asks a model only through core's turn advise (core:oracle/turn-advise, the strategy modelTurnOrder pins); a plugin's code never touches connection data or calls a model (R53)` +
|
|
121
|
+
pluginRuleRef('connections'));
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
const dup = `${genre} ${option.key}`;
|
|
125
|
+
if (seen.has(dup))
|
|
126
|
+
errors.push(`${at}: the option '${option.key}' is already added to this genre — add each option once`);
|
|
127
|
+
seen.add(dup);
|
|
128
|
+
for (const f of registrationFindings([option], {
|
|
129
|
+
pipeline: (id) => ctx.pipelines.get(id),
|
|
130
|
+
external: (id) => !ctx.pipelines.has(id),
|
|
131
|
+
layer: at,
|
|
132
|
+
}))
|
|
133
|
+
// A default is the genre's own: an option marks none, and rule 6 refuses one that does.
|
|
134
|
+
if (f.law !== 'registration default')
|
|
135
|
+
(f.severity === 'error' ? errors : warnings).push(`${f.message} — ${f.fix}`);
|
|
136
|
+
if (option.trigger.family === 'event' && option.trigger.event.startsWith('core:event/'))
|
|
137
|
+
ctx.requires?.add(option.trigger.event);
|
|
138
|
+
}
|
|
139
|
+
return { errors, warnings };
|
|
140
|
+
}
|
|
44
141
|
/**
|
|
45
142
|
* Swaps as authored: the spec is a value and the definition a pin. A
|
|
46
143
|
* string is refused here, at the entry — the shared pass below also reads the
|
|
@@ -358,6 +455,20 @@ export function actionGenres(genres, presets) {
|
|
|
358
455
|
add(r.trigger.action, p.genre);
|
|
359
456
|
return out;
|
|
360
457
|
}
|
|
458
|
+
/** A versionless spec id with an owner: `owner:slug`, no `@`. */
|
|
459
|
+
function isPipelineId(id) {
|
|
460
|
+
if (typeof id !== 'string' || id.includes('@'))
|
|
461
|
+
return false;
|
|
462
|
+
if (parseSpecId(id).owner === undefined)
|
|
463
|
+
return false;
|
|
464
|
+
try {
|
|
465
|
+
assertSpecId(id);
|
|
466
|
+
return true;
|
|
467
|
+
}
|
|
468
|
+
catch {
|
|
469
|
+
return false;
|
|
470
|
+
}
|
|
471
|
+
}
|
|
361
472
|
/**
|
|
362
473
|
* Prompts: slugs unique per POOL, which is `(node type, slot)`.
|
|
363
474
|
*
|
|
@@ -372,12 +483,26 @@ export function actionGenres(genres, presets) {
|
|
|
372
483
|
* would make every install fail permanently on a requirement nothing can ever
|
|
373
484
|
* satisfy, where the real failure mode is mild and self-announcing: the row
|
|
374
485
|
* seeds into a pool no installed pipeline offers, and is simply never shown.
|
|
486
|
+
*
|
|
487
|
+
* `forPipeline` is held to the same shape as a spec id with an owner and no
|
|
488
|
+
* version pin. When `ns` is given, one in this package's own namespace must be
|
|
489
|
+
* a pipeline in `declaredSpecs`. That refusal is this function's own rule, not
|
|
490
|
+
* a copy of `configFindings`, which records another package's spec as a
|
|
491
|
+
* requirement: a prompt's pipeline never is one, so another package's id is
|
|
492
|
+
* accepted and not added to `requires`.
|
|
375
493
|
* @experimental
|
|
376
494
|
*/
|
|
377
|
-
export function promptFindings(prompts) {
|
|
495
|
+
export function promptFindings(prompts, ns, declaredSpecs) {
|
|
378
496
|
const out = [];
|
|
379
497
|
const seen = new Set();
|
|
380
498
|
for (const pr of prompts) {
|
|
499
|
+
const fp = pr.forPipeline;
|
|
500
|
+
if (fp !== undefined) {
|
|
501
|
+
if (!isPipelineId(fp))
|
|
502
|
+
out.push(`prompt '${pr.slug}'.forPipeline is a pipeline id — '<owner>:spec/<name>'`);
|
|
503
|
+
else if (ns !== undefined && fp.startsWith(`${ns}:`) && !declaredSpecs?.has(fp))
|
|
504
|
+
out.push(`prompt '${pr.slug}' is filed under '${fp}', which this package does not declare — declare that pipeline, or name one that exists`);
|
|
505
|
+
}
|
|
381
506
|
out.push(...i18nFindings(pr.label, `prompt '${pr.slug}'.label`, { required: true }));
|
|
382
507
|
const pool = `${pr.nodeType}#${pr.slot}`;
|
|
383
508
|
const key = `${pool}#${pr.slug}`;
|
|
@@ -418,6 +543,9 @@ export function presetFindings(presets, declaredGenres, declaredSpecs, configs,
|
|
|
418
543
|
const coverage = [];
|
|
419
544
|
for (const p of presets) {
|
|
420
545
|
errors.push(...labelFindings(`preset '${p.slug}'`, p));
|
|
546
|
+
// The preset's variable layouts: the same rule `preset()` throws, for a
|
|
547
|
+
// manifest written by hand.
|
|
548
|
+
errors.push(...presetVariableLayoutFindings(p));
|
|
421
549
|
const g = declaredGenres.get(p.genre);
|
|
422
550
|
if (!g)
|
|
423
551
|
requires.add(p.genre);
|
|
@@ -822,6 +950,34 @@ export function todoHoles(configs) {
|
|
|
822
950
|
});
|
|
823
951
|
return out;
|
|
824
952
|
}
|
|
953
|
+
/**
|
|
954
|
+
* 🚧 A genre with a field `showDice` whose registered pipeline reads the
|
|
955
|
+
* session history (`core:query/session-history`) without wiring its
|
|
956
|
+
* `outcomeNumbers`: that read is kept free of outcome numbers by the field's
|
|
957
|
+
* spelling, which core reads until 0.7. A read inside a junction branch is a
|
|
958
|
+
* node like any other. One line per genre and pipeline.
|
|
959
|
+
* @internal
|
|
960
|
+
*/
|
|
961
|
+
function outcomeNumbersWarnings(genres, pipelines) {
|
|
962
|
+
const out = [];
|
|
963
|
+
const byId = new Map(pipelines.map((s) => [s.id, s]));
|
|
964
|
+
for (const g of genres) {
|
|
965
|
+
const fields = (g.shape?.fields ?? {});
|
|
966
|
+
if (!Object.prototype.hasOwnProperty.call(fields, 'showDice'))
|
|
967
|
+
continue;
|
|
968
|
+
const registered = [...new Set((genreDefaultsOf(g)?.registrations ?? []).map((r) => r.pipeline))];
|
|
969
|
+
for (const id of registered) {
|
|
970
|
+
const spec = byId.get(id);
|
|
971
|
+
if (!spec)
|
|
972
|
+
continue;
|
|
973
|
+
const unwired = spec.nodes.some((n) => n.definitionId === 'core:query/session-history' &&
|
|
974
|
+
!Object.prototype.hasOwnProperty.call(n.config ?? {}, 'outcomeNumbers'));
|
|
975
|
+
if (unwired)
|
|
976
|
+
out.push(`genre '${g.id}': pipeline '${id}' reads the session history without wiring outcomeNumbers, so core keeps outcome numbers out of that read's prompt by the field's spelling 'showDice' until 0.7. Wire session-history's outcomeNumbers from the field.`);
|
|
977
|
+
}
|
|
978
|
+
}
|
|
979
|
+
return out;
|
|
980
|
+
}
|
|
825
981
|
/**
|
|
826
982
|
* Every check above, over one package's declarations — what both authoring
|
|
827
983
|
* surfaces run so that one mistake gets one sentence wherever it was written.
|
|
@@ -842,7 +998,7 @@ export function declarationFindings(p) {
|
|
|
842
998
|
...contributedActionFindings(pipelines, actionGenres(genres, p.presets ?? [])),
|
|
843
999
|
...exposeSwapFindings(pipelines),
|
|
844
1000
|
...swapContributionFindings(p.swaps ?? [], p.ns, declaredSpecs),
|
|
845
|
-
...promptFindings(p.prompts ?? []),
|
|
1001
|
+
...promptFindings(p.prompts ?? [], p.ns, declaredSpecs),
|
|
846
1002
|
...configFindings(configs, declaredSpecs, requires),
|
|
847
1003
|
...eventDeclarationFindings(p.events ?? [], p.ns, pipelines, declaredGenres, requires, p.presets ?? []),
|
|
848
1004
|
...annexDeclarationFindings(p.ns, pipelines, p.annexFields),
|
|
@@ -856,12 +1012,25 @@ export function declarationFindings(p) {
|
|
|
856
1012
|
}));
|
|
857
1013
|
const presets = presetFindings(p.presets ?? [], withEvents, declaredSpecs, configs, requires);
|
|
858
1014
|
const registrations = registrationDeclarationFindings(p.ns, genres, p.presets ?? [], declaredSpecs, requires);
|
|
859
|
-
|
|
1015
|
+
const options = turnOrderOptionFindings(p.turnOrderOptions ?? [], {
|
|
1016
|
+
ns: p.ns,
|
|
1017
|
+
pipelines: declaredSpecs,
|
|
1018
|
+
genres: new Set(declaredGenres.keys()),
|
|
1019
|
+
requires,
|
|
1020
|
+
});
|
|
1021
|
+
errors.push(...presets.errors, ...registrations.errors, ...options.errors, ...surfaceFindings(p.surfaces), ...componentFindings(p.components ?? []), ...widgetComponentFindings(genres, p.components ?? []), ...packageWidgetFindings(p.widgets ?? [], p.components ?? []));
|
|
860
1022
|
const layouts = genreLayoutFindings(genres, p.widgets, p.ns);
|
|
861
1023
|
errors.push(...layouts.errors);
|
|
862
1024
|
return {
|
|
863
1025
|
errors,
|
|
864
|
-
warnings: [
|
|
1026
|
+
warnings: [
|
|
1027
|
+
...layouts.warnings,
|
|
1028
|
+
...registrations.warnings,
|
|
1029
|
+
...options.warnings,
|
|
1030
|
+
...genres.flatMap(genreWarnings),
|
|
1031
|
+
...(p.presets ?? []).flatMap((preset) => presetProvisoWarnings(preset, declaredGenres.get(preset.genre) ?? getGenre(preset.genre))),
|
|
1032
|
+
...outcomeNumbersWarnings(genres, pipelines),
|
|
1033
|
+
],
|
|
865
1034
|
coverage: { presets: presets.coverage, todos: todoHoles(configs) },
|
|
866
1035
|
// Never the package's own ids: core locks on its own events and
|
|
867
1036
|
// requires nothing of itself.
|
package/dist/descriptors.d.ts
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
*/
|
|
10
10
|
import type { EntityKind } from './entities.js';
|
|
11
11
|
import type { Finding } from './validate.js';
|
|
12
|
+
import type { GenreProvisos } from './provisos.js';
|
|
12
13
|
import type { ShapeId } from './shapes.js';
|
|
13
14
|
import type { CapabilityId } from './capabilities.js';
|
|
14
15
|
import type { ReviewPosition } from './review.js';
|
|
@@ -695,6 +696,14 @@ export type SessionCreationMode = (typeof SESSION_CREATION_MODES)[number];
|
|
|
695
696
|
* @ruling 19 §1
|
|
696
697
|
*/
|
|
697
698
|
export interface SessionShape {
|
|
699
|
+
/**
|
|
700
|
+
* 🚧 Forms (owner 2026-11-04, playtest item 21): `modelAnswers` — the AI answers a form put to a
|
|
701
|
+
* participant it portrays. Absent = off in core (P1): the form waits for a person, and a routed
|
|
702
|
+
* answer spec gets a halted receipt saying the genre does not opt in.
|
|
703
|
+
*/
|
|
704
|
+
forms?: {
|
|
705
|
+
modelAnswers?: boolean;
|
|
706
|
+
};
|
|
698
707
|
/**
|
|
699
708
|
* The character system: toggles, ordering, pickers, cast rows.
|
|
700
709
|
*
|
|
@@ -735,6 +744,32 @@ export interface SessionShape {
|
|
|
735
744
|
* (`lorebookShapeFindings`, `lorebook-required-retired`).
|
|
736
745
|
*/
|
|
737
746
|
lorebook?: 'optional' | 'required';
|
|
747
|
+
/**
|
|
748
|
+
* 🚧 **Cast from lorebook** — at session create, the lorebook attached to
|
|
749
|
+
* the new session seats the book's own people, card or not, as the
|
|
750
|
+
* session's characters (character seats), in the book's order (never
|
|
751
|
+
* someone drawn with a persona card; for a provided book, all of its
|
|
752
|
+
* people). `field` names a declared
|
|
753
|
+
* `boolean` field of this shape that switches it per session; absent =
|
|
754
|
+
* always for this genre. At create only — never on a later attach or
|
|
755
|
+
* update. Off unless a genre declares it (P1); the person still sees who
|
|
756
|
+
* is in it on the start form's confirm.
|
|
757
|
+
*
|
|
758
|
+
* Not `characters: { min }` (a bound on how many the person picks), not a
|
|
759
|
+
* cast binding (the book's member ↔ card link), and not the start form's
|
|
760
|
+
* character picker. Needs `lorebook` and a `characters` capability that
|
|
761
|
+
* allows seats, or `genre()` refuses it.
|
|
762
|
+
*
|
|
763
|
+
* ⚠ With `characters: { min: N > 0 }` the start form's shape check runs
|
|
764
|
+
* before seating and counts only the person's own picks, so a person who
|
|
765
|
+
* picks nobody is refused even when the book would fill the seats
|
|
766
|
+
* (★m3b-D-2; owner 2026-11-05: left as is). Declare `min: 0` when the
|
|
767
|
+
* book is meant to fill the seats.
|
|
768
|
+
* @experimental
|
|
769
|
+
*/
|
|
770
|
+
castFromLorebook?: {
|
|
771
|
+
field?: string;
|
|
772
|
+
};
|
|
738
773
|
/** What the send surface is. `none` for purely trigger-driven modes. */
|
|
739
774
|
composer?: 'text' | 'none';
|
|
740
775
|
/** Whose name the seed line carries (16's seedName rule, declared). */
|
|
@@ -747,8 +782,8 @@ export interface SessionShape {
|
|
|
747
782
|
fields?: SettingsSchema;
|
|
748
783
|
/**
|
|
749
784
|
* Does the session settings form offer a **Scenario** field? Declared,
|
|
750
|
-
* never assumed: core's
|
|
751
|
-
* `true`;
|
|
785
|
+
* never assumed: core's Chat, Story and the Lair say
|
|
786
|
+
* `true`; Dungeon Crawler and the Guide say `false`. Absent = no field.
|
|
752
787
|
* @ruling §4.11, R12
|
|
753
788
|
*/
|
|
754
789
|
scenario?: boolean;
|
|
@@ -836,6 +871,15 @@ export interface SessionShape {
|
|
|
836
871
|
narrate?: TurnControlDecl;
|
|
837
872
|
retake?: TurnControlDecl;
|
|
838
873
|
};
|
|
874
|
+
/**
|
|
875
|
+
* 🚧 Which of the genre's own fields (or pinned settings) carries each rule core
|
|
876
|
+
* enforces: keeping every turn, sheet latitude, item-move latitude, the tool kinds.
|
|
877
|
+
* A genre that names none of a rule has none of it. Absent = ⏳ core reads each rule
|
|
878
|
+
* under its core spelling (`keepEveryTurn`, `ownerSheetLatitude`, …) from whatever the
|
|
879
|
+
* session's cascade carries there. Validated at `genre()`; read with `provisoFieldOf`.
|
|
880
|
+
* @experimental
|
|
881
|
+
*/
|
|
882
|
+
provisos?: GenreProvisos;
|
|
839
883
|
/**
|
|
840
884
|
* What sessions of this genre may write beyond messages.
|
|
841
885
|
* Absent = both on — the standard chat's posture. Enforced server-side at
|
|
@@ -859,9 +903,17 @@ export interface SessionShape {
|
|
|
859
903
|
lore?: boolean;
|
|
860
904
|
/** May a session of this genre open scenes? */
|
|
861
905
|
scenes?: boolean;
|
|
906
|
+
/**
|
|
907
|
+
* 🚧 May this genre's pipelines bench a seat or bring one back
|
|
908
|
+
* (`core:outlet/set-seat-bench@1`)? **Absent = off**, unlike `lore` and
|
|
909
|
+
* `scenes`: seat status is something a genre asks to manage. A person's
|
|
910
|
+
* own bench and drag are never gated by it.
|
|
911
|
+
* @experimental
|
|
912
|
+
*/
|
|
913
|
+
seats?: boolean;
|
|
862
914
|
/**
|
|
863
915
|
* The library writes a genre opts into — making or changing characters,
|
|
864
|
-
* making lorebooks
|
|
916
|
+
* making lorebooks. **Absent = all off**
|
|
865
917
|
* (unlike `lore` and `scenes`): a library write is something a genre
|
|
866
918
|
* asks for. Declaring it only lets the genre's pipelines try: the
|
|
867
919
|
* person's rights and their library write mode (Full, Review, Off)
|
|
@@ -870,9 +922,12 @@ export interface SessionShape {
|
|
|
870
922
|
library?: {
|
|
871
923
|
/** May a pipeline of this genre make or change characters? */
|
|
872
924
|
characters?: boolean;
|
|
873
|
-
/** May a pipeline of this genre make lorebooks
|
|
925
|
+
/** May a pipeline of this genre make lorebooks? */
|
|
874
926
|
lorebooks?: boolean;
|
|
875
|
-
/**
|
|
927
|
+
/**
|
|
928
|
+
* ⏳ Read by nothing since `attach-lorebook@1` was removed in 0.6;
|
|
929
|
+
* it stays declared because it is a published name.
|
|
930
|
+
*/
|
|
876
931
|
sessions?: boolean;
|
|
877
932
|
};
|
|
878
933
|
};
|
|
@@ -882,7 +937,10 @@ export interface SessionShape {
|
|
|
882
937
|
* which a session may override (`resolveSceneSettings`). Absent is
|
|
883
938
|
* `DEFAULT_SCENE_SETTINGS`: **Suggested**, with *day crossed*, *time
|
|
884
939
|
* action* and *place changed* on, summaries **on request**. Refused at
|
|
885
|
-
* the declaration when it does not read (`assertSceneSettings`). A
|
|
940
|
+
* the declaration when it does not read (`assertSceneSettings`). A session
|
|
941
|
+
* running the *Summarize finished scenes* routine
|
|
942
|
+
* (`core:spec/scene-summaries`) reads `onRequest` whatever is declared or
|
|
943
|
+
* stored. A genre
|
|
886
944
|
* whose `writes.scenes` is `false` places nothing, whatever this says.
|
|
887
945
|
* @ruling PROPOSAL-live-scenes §4, §5, ★1 (2026-10-13)
|
|
888
946
|
*/
|
|
@@ -1083,6 +1141,14 @@ export interface ChannelDecl {
|
|
|
1083
1141
|
* Read it with `channelLoreRole`. ⚠ Not `role` (how the channel enters a prompt).
|
|
1084
1142
|
*/
|
|
1085
1143
|
lore?: ChannelLoreRole;
|
|
1144
|
+
/**
|
|
1145
|
+
* 🚧 This channel is the session's **table channel**: the voiceless folio its rules'
|
|
1146
|
+
* outcomes are written to (rolls, checks, totals) and where the host writes a widget's
|
|
1147
|
+
* `say` line. One per shape, declared `voice: 'none'` — refused otherwise
|
|
1148
|
+
* (`assertChannelDecls`). Read it with `tableChannelOf`. ⚠ Not a database table.
|
|
1149
|
+
* @experimental
|
|
1150
|
+
*/
|
|
1151
|
+
table?: true;
|
|
1086
1152
|
}
|
|
1087
1153
|
/** 🚧 What a channel's lines are to a summary (pass 9 S1). @experimental */
|
|
1088
1154
|
export declare const CHANNEL_LORE_ROLES: readonly ['story', 'aside', 'never'];
|
|
@@ -1115,6 +1181,31 @@ export type ChannelRole = (typeof CHANNEL_ROLES)[number];
|
|
|
1115
1181
|
export declare const CHANNEL_VOICES: readonly ['character', 'narrator', 'none'];
|
|
1116
1182
|
/** @experimental */
|
|
1117
1183
|
export type ChannelVoice = (typeof CHANNEL_VOICES)[number];
|
|
1184
|
+
/**
|
|
1185
|
+
* 🚧 The table channel's slug in {@link TABLE_CHANNEL_DECL}. Where a genre's
|
|
1186
|
+
* rolls, checks and calculations are written — never the story's history, which
|
|
1187
|
+
* the Narrator would imitate (PLAN-rulesets §30, ruled 2026-10-16).
|
|
1188
|
+
* A folio with no voice and no speaker (not the Narrator, not an envoy); each row
|
|
1189
|
+
* is anchored to the message it belongs to (`metadata.anchorMessageId`), so it
|
|
1190
|
+
* reads "at that moment" and retracts with it.
|
|
1191
|
+
* @experimental
|
|
1192
|
+
*/
|
|
1193
|
+
export declare const TABLE_CHANNEL = "table";
|
|
1194
|
+
/**
|
|
1195
|
+
* 🚧 The table channel's declaration, as a genre lists it in
|
|
1196
|
+
* `SessionShape.channels`. The messages widget draws its rows inline under their
|
|
1197
|
+
* anchors (`interleave`), or a copy pinned to it shows them as a log (_Dice_).
|
|
1198
|
+
* @experimental
|
|
1199
|
+
*/
|
|
1200
|
+
export declare const TABLE_CHANNEL_DECL: Readonly<{
|
|
1201
|
+
readonly slug: "table";
|
|
1202
|
+
readonly label: {
|
|
1203
|
+
readonly en: 'Dice';
|
|
1204
|
+
};
|
|
1205
|
+
readonly role: 'folio';
|
|
1206
|
+
readonly voice: 'none';
|
|
1207
|
+
readonly table: true;
|
|
1208
|
+
}>;
|
|
1118
1209
|
/**
|
|
1119
1210
|
* This shape's channels as full declarations, defaults resolved — the one
|
|
1120
1211
|
* reader every consumer of `SessionShape.channels` should use, so the short
|
|
@@ -1151,6 +1242,16 @@ export declare function channelDecls(shape: unknown): ChannelDecl[];
|
|
|
1151
1242
|
export declare function channelAudience(shape: unknown, channel: string): ChannelAudience;
|
|
1152
1243
|
/** 🚧 The lore role of `channel` (may be `slug:lane`; the slug decides), default resolved. @experimental */
|
|
1153
1244
|
export declare function channelLoreRole(shape: unknown, channel: string): ChannelLoreRole;
|
|
1245
|
+
/**
|
|
1246
|
+
* 🚧 The slug of the shape's table channel — the one declaration marked
|
|
1247
|
+
* `table: true` with voice `none`. ⏳ A shape with none marked answers an unmarked
|
|
1248
|
+
* `table` channel declared `role: 'folio'`, `voice: 'none'` (bundles built before
|
|
1249
|
+
* the marker). Undefined when the shape keeps no table, when two channels are
|
|
1250
|
+
* marked, or when the marked one has a voice — the declaration refuses those, and
|
|
1251
|
+
* a read never guesses. Never throws: a stored shape is data.
|
|
1252
|
+
* @experimental
|
|
1253
|
+
*/
|
|
1254
|
+
export declare function tableChannelOf(shape: unknown): string | undefined;
|
|
1154
1255
|
/**
|
|
1155
1256
|
* A channel declaration that cannot mean what it says is refused — with a
|
|
1156
1257
|
* sentence, at the declaration, on the same terms as `assertMessageVerbFloors`.
|
|
@@ -1784,6 +1885,11 @@ export declare function definitionContract(source: ContractSource): DefinitionCo
|
|
|
1784
1885
|
* @internal
|
|
1785
1886
|
*/
|
|
1786
1887
|
export declare function definitionContractHash(source: ContractSource): string;
|
|
1888
|
+
/**
|
|
1889
|
+
* Where a definition's slots expose a context or variable template to the owner (G7): warnings, by slot kind then key.
|
|
1890
|
+
* @internal
|
|
1891
|
+
*/
|
|
1892
|
+
export declare function templateExposureOf(d: Pick<Descriptor, 'id' | 'slots'>): string[];
|
|
1787
1893
|
/**
|
|
1788
1894
|
* The extras every script site is offered, whatever its slot lists:
|
|
1789
1895
|
* `session`, the run's settings document. The
|
|
@@ -1826,6 +1932,17 @@ export declare function eventsLockFindings(inlet: Pick<Descriptor, 'id' | 'paylo
|
|
|
1826
1932
|
* @ruling R-20
|
|
1827
1933
|
*/
|
|
1828
1934
|
export declare function widgetDeclsFindings(raw: unknown, where: string): string[];
|
|
1935
|
+
/**
|
|
1936
|
+
* 🚧 Node definitions that were published and are now removed, by id without
|
|
1937
|
+
* the `@N` pin, each with the sentence a stored pipeline naming one fails with.
|
|
1938
|
+
* @internal
|
|
1939
|
+
*/
|
|
1940
|
+
export declare const REMOVED_NODE_DEFINITIONS: Readonly<Record<string, string>>;
|
|
1941
|
+
/**
|
|
1942
|
+
* 🚧 The sentence for a removed node definition (id with or without `@N`), or null when it is not removed.
|
|
1943
|
+
* @internal
|
|
1944
|
+
*/
|
|
1945
|
+
export declare function removedNodeDefinitionSentence(definitionId: string): string | null;
|
|
1829
1946
|
/** @experimental */
|
|
1830
1947
|
export declare function getDefinition(id: string): Descriptor | undefined;
|
|
1831
1948
|
/** @experimental */
|
|
@@ -2067,6 +2184,28 @@ export interface EntryShape {
|
|
|
2067
2184
|
* `matchMode` already uses.
|
|
2068
2185
|
*/
|
|
2069
2186
|
amendMode?: 'amend' | 'replace';
|
|
2187
|
+
/**
|
|
2188
|
+
* 🚧 Whether an entry a session creates begins at the session's story date
|
|
2189
|
+
* (`'began'`) or has always been true (`'perpetual'`). Applied once, at
|
|
2190
|
+
* creation; a person's later setting always wins. Absent: perpetual.
|
|
2191
|
+
*
|
|
2192
|
+
* The layers are the entry type's default ← the writing step's params
|
|
2193
|
+
* (as declared, or as a preset sets them). A
|
|
2194
|
+
* person's own entry is untouched. The Beginning is set only when the
|
|
2195
|
+
* session reads at a story date on a lorebook with its timeline on. A
|
|
2196
|
+
* type whose entries carry their own date (`year`, `month`, `day` fields)
|
|
2197
|
+
* cannot declare it.
|
|
2198
|
+
* @experimental
|
|
2199
|
+
*/
|
|
2200
|
+
defaultBeginning?: 'perpetual' | 'began';
|
|
2201
|
+
/**
|
|
2202
|
+
* 🚧 The Decay rate, 0 (a fact) to 1, an entry a session creates starts
|
|
2203
|
+
* with. Absent: 0. Same layers, same creation-only rule, and a person's
|
|
2204
|
+
* later setting wins as for `defaultBeginning`; the Decay applies
|
|
2205
|
+
* whatever the timeline.
|
|
2206
|
+
* @experimental
|
|
2207
|
+
*/
|
|
2208
|
+
defaultDecayRate?: number;
|
|
2070
2209
|
}
|
|
2071
2210
|
/** What an author writes. Flat, because nesting the facets buys nothing here. @experimental */
|
|
2072
2211
|
export interface EntryTypeDecl<Id extends string = string> extends EntryShape {
|