@serene-pub/contracts 0.6.0-pr-8 → 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/oracles.d.ts +11 -1
- package/dist/oracles.js +11 -1
- package/dist/outlets.d.ts +153 -7
- package/dist/outlets.js +146 -7
- package/dist/queries.d.ts +688 -4
- package/dist/queries.js +485 -9
- package/dist/tasks.d.ts +6 -0
- package/dist/tasks.js +6 -0
- package/package.json +3 -3
package/dist/oracles.d.ts
CHANGED
|
@@ -659,7 +659,8 @@ export declare const generateJson: import("@serene-pub/sdk").Pinned<import("@ser
|
|
|
659
659
|
* that share a voice and an inflection, renders each group through the line
|
|
660
660
|
* `template`, and makes one call per group — `speaker` cues in the speaker's
|
|
661
661
|
* voice, `narrator` cues in the session's narrator voice, `silent` cues never
|
|
662
|
-
* sent —
|
|
662
|
+
* sent — one file per group, `gapMs` of silence baked into the end of each but
|
|
663
|
+
* the last. Publishes the files, the
|
|
663
664
|
* `cueMap` (where each cue sits in it), `spokenAs` (voice, model, applied,
|
|
664
665
|
* ignored) and `meta`, the three assembled as the `SpokenMeta` record
|
|
665
666
|
* `core:outlet/attach-audio@1` keeps on the line. Deterministic: the same line,
|
|
@@ -671,8 +672,17 @@ export declare const generateJson: import("@serene-pub/sdk").Pinned<import("@ser
|
|
|
671
672
|
* @experimental
|
|
672
673
|
*/
|
|
673
674
|
export declare const speak: import("@serene-pub/sdk").Pinned<import("@serene-pub/sdk").Descriptor<{
|
|
675
|
+
/** The first of `media` — wire `media` to keep every file. */
|
|
674
676
|
main: string;
|
|
677
|
+
/** The first of `media` — wire `media` to keep every file. */
|
|
675
678
|
audio: string;
|
|
679
|
+
/**
|
|
680
|
+
* 🚧 Every file of the line, in play order: one per voice/inflection
|
|
681
|
+
* group, the group's pieces joined inside it, `gapMs` of silence at
|
|
682
|
+
* the end of each but the last (WAV); a group whose pieces cannot be
|
|
683
|
+
* joined is one file per piece.
|
|
684
|
+
*/
|
|
685
|
+
media: string;
|
|
676
686
|
cueMap: string;
|
|
677
687
|
spokenAs: string;
|
|
678
688
|
/** 🚧 `SpokenMeta` — the record attach-audio keeps on the line. */
|
package/dist/oracles.js
CHANGED
|
@@ -857,7 +857,8 @@ export const generateJson = pin(describeOracleDefinition({
|
|
|
857
857
|
* that share a voice and an inflection, renders each group through the line
|
|
858
858
|
* `template`, and makes one call per group — `speaker` cues in the speaker's
|
|
859
859
|
* voice, `narrator` cues in the session's narrator voice, `silent` cues never
|
|
860
|
-
* sent —
|
|
860
|
+
* sent — one file per group, `gapMs` of silence baked into the end of each but
|
|
861
|
+
* the last. Publishes the files, the
|
|
861
862
|
* `cueMap` (where each cue sits in it), `spokenAs` (voice, model, applied,
|
|
862
863
|
* ignored) and `meta`, the three assembled as the `SpokenMeta` record
|
|
863
864
|
* `core:outlet/attach-audio@1` keeps on the line. Deterministic: the same line,
|
|
@@ -962,8 +963,17 @@ export const speak = pin(describeOracleDefinition({
|
|
|
962
963
|
text: S.text,
|
|
963
964
|
},
|
|
964
965
|
out: {
|
|
966
|
+
/** The first of `media` — wire `media` to keep every file. */
|
|
965
967
|
main: S.audio,
|
|
968
|
+
/** The first of `media` — wire `media` to keep every file. */
|
|
966
969
|
audio: S.audio,
|
|
970
|
+
/**
|
|
971
|
+
* 🚧 Every file of the line, in play order: one per voice/inflection
|
|
972
|
+
* group, the group's pieces joined inside it, `gapMs` of silence at
|
|
973
|
+
* the end of each but the last (WAV); a group whose pieces cannot be
|
|
974
|
+
* joined is one file per piece.
|
|
975
|
+
*/
|
|
976
|
+
media: S.mediaList,
|
|
967
977
|
cueMap: S.cueMap,
|
|
968
978
|
spokenAs: S.spokenAs,
|
|
969
979
|
/** 🚧 `SpokenMeta` — the record attach-audio keeps on the line. */
|
package/dist/outlets.d.ts
CHANGED
|
@@ -668,7 +668,7 @@ export declare const proposeSceneCue: import("@serene-pub/sdk").Pinned<import("@
|
|
|
668
668
|
* `person` is: wired from a script's output.
|
|
669
669
|
*/
|
|
670
670
|
at: string;
|
|
671
|
-
/** The channel lane `at` is on, any spelling (canonicalised); absent or blank: `
|
|
671
|
+
/** The channel lane `at` is on, any spelling (canonicalised); absent or blank: the lane the line `at` is on. */
|
|
672
672
|
channel: string;
|
|
673
673
|
/** Why, in the model's few words — the chip's reason ("the party left the inn"). */
|
|
674
674
|
reason: string;
|
|
@@ -1366,7 +1366,8 @@ export declare const answerForm: import("@serene-pub/sdk").Pinned<import("@seren
|
|
|
1366
1366
|
* 🚧 Speech (seam S3, 2026-10-28): `meta` is the `SpokenMeta` record
|
|
1367
1367
|
* `core:oracle/speak@1` publishes, kept in the line's metadata for the swipe
|
|
1368
1368
|
* (`spoken`) beside the audio part; `replace` swaps the line's earlier spoken
|
|
1369
|
-
*
|
|
1369
|
+
* files for the whole new list rather than adding to them — what re-speaking
|
|
1370
|
+
* a line does.
|
|
1370
1371
|
* @experimental
|
|
1371
1372
|
*/
|
|
1372
1373
|
export declare const attachAudio: import("@serene-pub/sdk").Pinned<import("@serene-pub/sdk").Descriptor<{
|
|
@@ -1374,6 +1375,12 @@ export declare const attachAudio: import("@serene-pub/sdk").Pinned<import("@sere
|
|
|
1374
1375
|
}, {
|
|
1375
1376
|
target: string;
|
|
1376
1377
|
audio: string;
|
|
1378
|
+
/**
|
|
1379
|
+
* 🚧 The line's spoken files, in play order — one take. Non-empty,
|
|
1380
|
+
* it is the take and `audio` is ignored; absent or empty, `audio`
|
|
1381
|
+
* alone is a one-file take.
|
|
1382
|
+
*/
|
|
1383
|
+
media: string;
|
|
1377
1384
|
/** 🚧 `SpokenMeta` — absent writes the audio part alone. */
|
|
1378
1385
|
meta: string;
|
|
1379
1386
|
}, "core:outlet/attach-audio@1"> & {
|
|
@@ -1425,7 +1432,15 @@ export declare const attachAudio: import("@serene-pub/sdk").Pinned<import("@sere
|
|
|
1425
1432
|
*
|
|
1426
1433
|
* ## Where the write lands
|
|
1427
1434
|
*
|
|
1428
|
-
*
|
|
1435
|
+
* Under **Full** on the owner's own lorebook the write lands in the lorebook (a change to an existing entry as the version at the session's date when it reads at one), whether or not the session's scenes end by themselves. Under Review changes, Off or on a book someone else owns it lands in the session's own book, and the result then carries `route: "own-book"` and the own book's `lorebookId`. A history write on the own-book route files onto the day's one entry of the own book, merged onto the lorebook's day at Apply.
|
|
1436
|
+
*
|
|
1437
|
+
* ## Beginning and Decay of a new entry (🚧)
|
|
1438
|
+
*
|
|
1439
|
+
* `defaultBeginning` (`perpetual` or `began`) and `defaultDecayRate` (0 to 1) are **params**, never ports, so a model's output cannot reach them; a preset may set them. The layers are the entry type's default (`EntryShape.defaultBeginning`, `defaultDecayRate`) ← these params. They apply only when the write **creates** an entry (never a match, an update or a history day). The Beginning is set only when the session reads at a story date on a lorebook whose timeline is on; the Decay always. Absent, the layer below decides.
|
|
1440
|
+
*
|
|
1441
|
+
* ## Updating what exists
|
|
1442
|
+
*
|
|
1443
|
+
* A write with `match: { name }` and `shown` (the ids `core:query/entries-named@1` returned) rewrites the entry the model was shown under that name, with this write's whole content. A name matching one entry it was not shown adds this write's content to that entry as a new paragraph; a key alone, or no entry, writes a new entry; two entries of the name write nothing.
|
|
1429
1444
|
*
|
|
1430
1445
|
* ## `links`, or a second write
|
|
1431
1446
|
*
|
|
@@ -1489,6 +1504,19 @@ export declare const createLoreEntry: import("@serene-pub/sdk").Pinned<import("@
|
|
|
1489
1504
|
sources: string;
|
|
1490
1505
|
/** 🚧 A `LoreMatch` — how to find the entry this would otherwise create. */
|
|
1491
1506
|
match: string;
|
|
1507
|
+
/**
|
|
1508
|
+
* 🚧 The entries the model that wrote this was shown, by id
|
|
1509
|
+
* (`core:query/entries-named@1`'s `ids`). Read only with `match: { name }`: one entry it was shown, found by its
|
|
1510
|
+
* name, is rewritten — its content replaced by this write's, its own name kept; one entry of that name it was not
|
|
1511
|
+
* shown keeps what it says and gets this write's content as a new paragraph; an entry met only by one of its keys is
|
|
1512
|
+
* not a match — a new entry is written and the result notes the entry whose key it met; two or more entries of that
|
|
1513
|
+
* name change nothing for this write (`written: false`) and the result notes them; content equal to what the entry
|
|
1514
|
+
* says changes nothing. A change to an entry of the lorebook is written there under **Full** on the owner's own
|
|
1515
|
+
* lorebook (as the version at the session's date when it reads at one), and otherwise kept in the session's own book
|
|
1516
|
+
* as a held change until applied; the result is `matched: true, written: false`, so no
|
|
1517
|
+
* `core:event/lore-entry-created@1`. Absent: `match` behaves as described on `LoreMatch`.
|
|
1518
|
+
*/
|
|
1519
|
+
shown: string;
|
|
1492
1520
|
/**
|
|
1493
1521
|
* 🚧 The cast member this entry is filed under — a `character:<id>` reference, resolved to that
|
|
1494
1522
|
* character's cast member in the book the entry lands in (the entry type's `anchor` role).
|
|
@@ -1509,6 +1537,40 @@ export declare const createLoreEntry: import("@serene-pub/sdk").Pinned<import("@
|
|
|
1509
1537
|
};
|
|
1510
1538
|
readonly description: "Which kind of lorebook entry this pipeline writes — world lore or a location. Leave it as world lore for anything that is simply about the world.";
|
|
1511
1539
|
};
|
|
1540
|
+
/** 🚧 Absent: the layer below decides (the entry type's default). @experimental */
|
|
1541
|
+
readonly defaultBeginning: {
|
|
1542
|
+
readonly type: "enum";
|
|
1543
|
+
readonly of: readonly ["perpetual", "began"];
|
|
1544
|
+
readonly members: readonly [{
|
|
1545
|
+
readonly key: "perpetual";
|
|
1546
|
+
readonly label: {
|
|
1547
|
+
readonly en: "Perpetual";
|
|
1548
|
+
};
|
|
1549
|
+
}, {
|
|
1550
|
+
readonly key: "began";
|
|
1551
|
+
readonly label: {
|
|
1552
|
+
readonly en: "Began at";
|
|
1553
|
+
};
|
|
1554
|
+
}];
|
|
1555
|
+
readonly label: {
|
|
1556
|
+
readonly en: "New entry's beginning";
|
|
1557
|
+
};
|
|
1558
|
+
readonly description: {
|
|
1559
|
+
readonly en: "Whether an entry this step creates begins at the session's story date (Began at) or has always been true (Perpetual). Left empty, the entry type's own default applies.";
|
|
1560
|
+
};
|
|
1561
|
+
};
|
|
1562
|
+
/** 🚧 Absent: the layer below decides (the entry type's default). @experimental */
|
|
1563
|
+
readonly defaultDecayRate: {
|
|
1564
|
+
readonly type: "number";
|
|
1565
|
+
readonly min: 0;
|
|
1566
|
+
readonly max: 1;
|
|
1567
|
+
readonly label: {
|
|
1568
|
+
readonly en: "New entry's decay";
|
|
1569
|
+
};
|
|
1570
|
+
readonly description: {
|
|
1571
|
+
readonly en: "The Decay rate an entry this step creates starts with: 0 is a fact, above 0 up to 1 a living entry. Left empty, the entry type's own default applies.";
|
|
1572
|
+
};
|
|
1573
|
+
};
|
|
1512
1574
|
};
|
|
1513
1575
|
};
|
|
1514
1576
|
} | undefined;
|
|
@@ -1533,10 +1595,10 @@ export declare const createLoreEntry: import("@serene-pub/sdk").Pinned<import("@
|
|
|
1533
1595
|
*
|
|
1534
1596
|
* How the change lands is the host's: on the session's line, the way the
|
|
1535
1597
|
* lorebook's own editor writes an edit there (an amendment where the line
|
|
1536
|
-
* amends). A change to an entry of the lorebook
|
|
1537
|
-
*
|
|
1538
|
-
*
|
|
1539
|
-
* book is written there, and the result of a session
|
|
1598
|
+
* amends). A change to an entry of the lorebook is written there under **Full** on
|
|
1599
|
+
* the owner's own lorebook (as the version at the session's date when it reads at one), and otherwise kept in the
|
|
1600
|
+
* session's own book as a held change until applied; a change to an entry of the own
|
|
1601
|
+
* book is written there, and the result of a session on the own-book route
|
|
1540
1602
|
* carries `route: "own-book"` and the own book's `lorebookId`. `entry` names an entry the session reads, in the lorebook or
|
|
1541
1603
|
* in its own book.
|
|
1542
1604
|
* ⚠ It causes no event yet (🚧): `lore-entry-created` means a new
|
|
@@ -1720,6 +1782,8 @@ export declare const linkLoreEntries: import("@serene-pub/sdk").Pinned<import("@
|
|
|
1720
1782
|
* looked in first, and only with no hit there the lorebook's entries as the session reads
|
|
1721
1783
|
* them; a hit there is a held change to that entry, not a duplicate. Two or more refuse
|
|
1722
1784
|
* within one book, never across the two.
|
|
1785
|
+
* With `name`, the write's `shown` in-port (the entries the model was shown) decides whether a
|
|
1786
|
+
* match is rewritten or appended to: see `create-lore-entry@1`'s `shown`.
|
|
1723
1787
|
* ⚠ Not an entry's `matchMode` (how its keys are matched in retrieval).
|
|
1724
1788
|
* @experimental
|
|
1725
1789
|
*/
|
|
@@ -1901,6 +1965,88 @@ export declare const updateCastMember: import("@serene-pub/sdk").Pinned<import("
|
|
|
1901
1965
|
kind: 'outlet';
|
|
1902
1966
|
slots?: Record<string, import("@serene-pub/sdk").SlotDecl> | undefined;
|
|
1903
1967
|
}>;
|
|
1968
|
+
/**
|
|
1969
|
+
* 🚧 **Note who knows an entry** (kn-4b, 2026-11-16; owner 2026-11-15: "lets add SDK api for it as
|
|
1970
|
+
* well, though we won't plug it in anywhere"): a step states that **one cast member came to know one
|
|
1971
|
+
* lorebook entry** in play, or no longer does. It writes a **knowledge tie** of one of play's two
|
|
1972
|
+
* kinds: `was_told` or `has_been_there`. No shipped genre or preset places it.
|
|
1973
|
+
*
|
|
1974
|
+
* `member` is `character:<cardId>`, `seated-member:<castMemberId>`, `player-seat:<seatId>` or a cast
|
|
1975
|
+
* member id, of this session. `entry` is an entry id, a write result, or a name in the session's
|
|
1976
|
+
* lorebook, resolved as `link-lore-entries@1`'s `to` is (a name nothing answers to, or two entries
|
|
1977
|
+
* answer to, is refused). One member and one entry per write: to note many, place it inside an
|
|
1978
|
+
* `each` clause (its `max` is mandatory).
|
|
1979
|
+
*
|
|
1980
|
+
* - **Play's kinds only.** It never writes the hand kinds `knows` / `kept_from`, and never ends or
|
|
1981
|
+
* changes a tie a person set. When an active hand tie (`knows` or `kept_from`) already exists for
|
|
1982
|
+
* the pair, nothing is written (`written: false`) and the receipt names it.
|
|
1983
|
+
* - **Once.** A pair that already has a live tie of the same kind is not written again
|
|
1984
|
+
* (`written: false`).
|
|
1985
|
+
* - **`end: true`** ends play's live ties for the pair (both kinds); a hand tie stays.
|
|
1986
|
+
* - **Where it lands.** On a lorebook the session's owner owns, with the lore write mode on
|
|
1987
|
+
* **Full**: in the lorebook, on the session's line, dated at the session's story date. Otherwise
|
|
1988
|
+
* (Review changes, Off, a lorebook someone else owns, no lorebook): in the session's notes, as the
|
|
1989
|
+
* session's own tie, offered in Apply (a tie on an entry made in the notes goes with that entry).
|
|
1990
|
+
* Back and a swipe take it back with the reply that wrote it, until it is applied.
|
|
1991
|
+
* - **Refused** for a genre whose lorebook is a reference (`writes.lore`), for a member or entry
|
|
1992
|
+
* outside the books the session reads, and without a session.
|
|
1993
|
+
*
|
|
1994
|
+
* ⚠ It does not set or clear an entry's **not common knowledge** mark: that is the lorebook owner's
|
|
1995
|
+
* own choice, and no outlet writes it. ⚠ Not
|
|
1996
|
+
* `link-lore-entries@1` (a link between two entries). It causes no event.
|
|
1997
|
+
* @experimental
|
|
1998
|
+
*/
|
|
1999
|
+
export declare const noteEntryKnowledge: import("@serene-pub/sdk").Pinned<import("@serene-pub/sdk").Descriptor<{
|
|
2000
|
+
main: string;
|
|
2001
|
+
/** The knowledge tie written, or the one that already stood. */
|
|
2002
|
+
tieId: string;
|
|
2003
|
+
}, {
|
|
2004
|
+
/** The cast member: `character:<id>`, `seated-member:<id>`, `player-seat:<id>`, or a cast member id. */
|
|
2005
|
+
member: string;
|
|
2006
|
+
/** The entry: an id, a write result, or a name in the session's lorebook. */
|
|
2007
|
+
entry: string;
|
|
2008
|
+
}, "core:outlet/note-entry-knowledge@1"> & {
|
|
2009
|
+
kind: 'outlet';
|
|
2010
|
+
slots?: {
|
|
2011
|
+
readonly params: {
|
|
2012
|
+
readonly kind: "parameters";
|
|
2013
|
+
readonly schema: {
|
|
2014
|
+
readonly knowledgeKind: {
|
|
2015
|
+
readonly type: "enum";
|
|
2016
|
+
readonly of: readonly ["was_told", "has_been_there"];
|
|
2017
|
+
readonly members: readonly [{
|
|
2018
|
+
readonly key: "was_told";
|
|
2019
|
+
readonly label: {
|
|
2020
|
+
readonly en: "Was told";
|
|
2021
|
+
};
|
|
2022
|
+
}, {
|
|
2023
|
+
readonly key: "has_been_there";
|
|
2024
|
+
readonly label: {
|
|
2025
|
+
readonly en: "Has been there";
|
|
2026
|
+
};
|
|
2027
|
+
}];
|
|
2028
|
+
readonly default: "was_told";
|
|
2029
|
+
readonly label: {
|
|
2030
|
+
readonly en: "How they came to know it";
|
|
2031
|
+
};
|
|
2032
|
+
readonly description: {
|
|
2033
|
+
readonly en: "Was told: someone said it in front of them. Has been there: they were at the place.";
|
|
2034
|
+
};
|
|
2035
|
+
};
|
|
2036
|
+
readonly end: {
|
|
2037
|
+
readonly type: "boolean";
|
|
2038
|
+
readonly default: false;
|
|
2039
|
+
readonly label: {
|
|
2040
|
+
readonly en: "No longer knows it";
|
|
2041
|
+
};
|
|
2042
|
+
readonly description: {
|
|
2043
|
+
readonly en: "Ends what play noted for this member and entry instead of noting it. A tie the lorebook’s owner set stays.";
|
|
2044
|
+
};
|
|
2045
|
+
};
|
|
2046
|
+
};
|
|
2047
|
+
};
|
|
2048
|
+
} | undefined;
|
|
2049
|
+
}>;
|
|
1904
2050
|
/**
|
|
1905
2051
|
* Make a lorebook: write one lorebook into the acting person's library.
|
|
1906
2052
|
*
|
package/dist/outlets.js
CHANGED
|
@@ -782,7 +782,7 @@ export const proposeSceneCue = pin(describeOutletDefinition({
|
|
|
782
782
|
* `person` is: wired from a script's output.
|
|
783
783
|
*/
|
|
784
784
|
at: S.json,
|
|
785
|
-
/** The channel lane `at` is on, any spelling (canonicalised); absent or blank: `
|
|
785
|
+
/** The channel lane `at` is on, any spelling (canonicalised); absent or blank: the lane the line `at` is on. */
|
|
786
786
|
channel: S.text,
|
|
787
787
|
/** Why, in the model's few words — the chip's reason ("the party left the inn"). */
|
|
788
788
|
reason: S.text,
|
|
@@ -823,6 +823,9 @@ export const summarizeFinishedScene = pin(describeOutletDefinition({
|
|
|
823
823
|
i18n: { name: { en: 'Summarize a finished scene' } },
|
|
824
824
|
effects: 'write',
|
|
825
825
|
reviewDefault: 'off',
|
|
826
|
+
// What a reviewer would be shown if a host ever held this write: the scene it names.
|
|
827
|
+
// The routine's own mode, read off `routine`, is what decides Review here.
|
|
828
|
+
review: { fields: ['scene'] },
|
|
826
829
|
timeoutMs: 5000,
|
|
827
830
|
ports: {
|
|
828
831
|
in: {
|
|
@@ -1561,7 +1564,8 @@ export const answerForm = pin(describeOutletDefinition({
|
|
|
1561
1564
|
* 🚧 Speech (seam S3, 2026-10-28): `meta` is the `SpokenMeta` record
|
|
1562
1565
|
* `core:oracle/speak@1` publishes, kept in the line's metadata for the swipe
|
|
1563
1566
|
* (`spoken`) beside the audio part; `replace` swaps the line's earlier spoken
|
|
1564
|
-
*
|
|
1567
|
+
* files for the whole new list rather than adding to them — what re-speaking
|
|
1568
|
+
* a line does.
|
|
1565
1569
|
* @experimental
|
|
1566
1570
|
*/
|
|
1567
1571
|
export const attachAudio = pin(describeOutletDefinition({
|
|
@@ -1591,6 +1595,12 @@ export const attachAudio = pin(describeOutletDefinition({
|
|
|
1591
1595
|
in: {
|
|
1592
1596
|
target: S.rowIds,
|
|
1593
1597
|
audio: S.audio,
|
|
1598
|
+
/**
|
|
1599
|
+
* 🚧 The line's spoken files, in play order — one take. Non-empty,
|
|
1600
|
+
* it is the take and `audio` is ignored; absent or empty, `audio`
|
|
1601
|
+
* alone is a one-file take.
|
|
1602
|
+
*/
|
|
1603
|
+
media: S.mediaList,
|
|
1594
1604
|
/** 🚧 `SpokenMeta` — absent writes the audio part alone. */
|
|
1595
1605
|
meta: S.spokenMeta,
|
|
1596
1606
|
},
|
|
@@ -1626,7 +1636,15 @@ export const attachAudio = pin(describeOutletDefinition({
|
|
|
1626
1636
|
*
|
|
1627
1637
|
* ## Where the write lands
|
|
1628
1638
|
*
|
|
1629
|
-
*
|
|
1639
|
+
* Under **Full** on the owner's own lorebook the write lands in the lorebook (a change to an existing entry as the version at the session's date when it reads at one), whether or not the session's scenes end by themselves. Under Review changes, Off or on a book someone else owns it lands in the session's own book, and the result then carries `route: "own-book"` and the own book's `lorebookId`. A history write on the own-book route files onto the day's one entry of the own book, merged onto the lorebook's day at Apply.
|
|
1640
|
+
*
|
|
1641
|
+
* ## Beginning and Decay of a new entry (🚧)
|
|
1642
|
+
*
|
|
1643
|
+
* `defaultBeginning` (`perpetual` or `began`) and `defaultDecayRate` (0 to 1) are **params**, never ports, so a model's output cannot reach them; a preset may set them. The layers are the entry type's default (`EntryShape.defaultBeginning`, `defaultDecayRate`) ← these params. They apply only when the write **creates** an entry (never a match, an update or a history day). The Beginning is set only when the session reads at a story date on a lorebook whose timeline is on; the Decay always. Absent, the layer below decides.
|
|
1644
|
+
*
|
|
1645
|
+
* ## Updating what exists
|
|
1646
|
+
*
|
|
1647
|
+
* A write with `match: { name }` and `shown` (the ids `core:query/entries-named@1` returned) rewrites the entry the model was shown under that name, with this write's whole content. A name matching one entry it was not shown adds this write's content to that entry as a new paragraph; a key alone, or no entry, writes a new entry; two entries of the name write nothing.
|
|
1630
1648
|
*
|
|
1631
1649
|
* ## `links`, or a second write
|
|
1632
1650
|
*
|
|
@@ -1692,6 +1710,29 @@ export const createLoreEntry = pin(describeOutletDefinition({
|
|
|
1692
1710
|
label: { en: 'Kind of entry' },
|
|
1693
1711
|
description: 'Which kind of lorebook entry this pipeline writes — world lore or a location. Leave it as world lore for anything that is simply about the world.',
|
|
1694
1712
|
},
|
|
1713
|
+
/** 🚧 Absent: the layer below decides (the entry type's default). @experimental */
|
|
1714
|
+
defaultBeginning: {
|
|
1715
|
+
type: 'enum',
|
|
1716
|
+
of: ['perpetual', 'began'],
|
|
1717
|
+
members: [
|
|
1718
|
+
{ key: 'perpetual', label: { en: 'Perpetual' } },
|
|
1719
|
+
{ key: 'began', label: { en: 'Began at' } },
|
|
1720
|
+
],
|
|
1721
|
+
label: { en: "New entry's beginning" },
|
|
1722
|
+
description: {
|
|
1723
|
+
en: "Whether an entry this step creates begins at the session's story date (Began at) or has always been true (Perpetual). Left empty, the entry type's own default applies.",
|
|
1724
|
+
},
|
|
1725
|
+
},
|
|
1726
|
+
/** 🚧 Absent: the layer below decides (the entry type's default). @experimental */
|
|
1727
|
+
defaultDecayRate: {
|
|
1728
|
+
type: 'number',
|
|
1729
|
+
min: 0,
|
|
1730
|
+
max: 1,
|
|
1731
|
+
label: { en: "New entry's decay" },
|
|
1732
|
+
description: {
|
|
1733
|
+
en: "The Decay rate an entry this step creates starts with: 0 is a fact, above 0 up to 1 a living entry. Left empty, the entry type's own default applies.",
|
|
1734
|
+
},
|
|
1735
|
+
},
|
|
1695
1736
|
},
|
|
1696
1737
|
},
|
|
1697
1738
|
},
|
|
@@ -1718,6 +1759,19 @@ export const createLoreEntry = pin(describeOutletDefinition({
|
|
|
1718
1759
|
sources: S.loreSources,
|
|
1719
1760
|
/** 🚧 A `LoreMatch` — how to find the entry this would otherwise create. */
|
|
1720
1761
|
match: S.json,
|
|
1762
|
+
/**
|
|
1763
|
+
* 🚧 The entries the model that wrote this was shown, by id
|
|
1764
|
+
* (`core:query/entries-named@1`'s `ids`). Read only with `match: { name }`: one entry it was shown, found by its
|
|
1765
|
+
* name, is rewritten — its content replaced by this write's, its own name kept; one entry of that name it was not
|
|
1766
|
+
* shown keeps what it says and gets this write's content as a new paragraph; an entry met only by one of its keys is
|
|
1767
|
+
* not a match — a new entry is written and the result notes the entry whose key it met; two or more entries of that
|
|
1768
|
+
* name change nothing for this write (`written: false`) and the result notes them; content equal to what the entry
|
|
1769
|
+
* says changes nothing. A change to an entry of the lorebook is written there under **Full** on the owner's own
|
|
1770
|
+
* lorebook (as the version at the session's date when it reads at one), and otherwise kept in the session's own book
|
|
1771
|
+
* as a held change until applied; the result is `matched: true, written: false`, so no
|
|
1772
|
+
* `core:event/lore-entry-created@1`. Absent: `match` behaves as described on `LoreMatch`.
|
|
1773
|
+
*/
|
|
1774
|
+
shown: S.json,
|
|
1721
1775
|
/**
|
|
1722
1776
|
* 🚧 The cast member this entry is filed under — a `character:<id>` reference, resolved to that
|
|
1723
1777
|
* character's cast member in the book the entry lands in (the entry type's `anchor` role).
|
|
@@ -1747,10 +1801,10 @@ export const createLoreEntry = pin(describeOutletDefinition({
|
|
|
1747
1801
|
*
|
|
1748
1802
|
* How the change lands is the host's: on the session's line, the way the
|
|
1749
1803
|
* lorebook's own editor writes an edit there (an amendment where the line
|
|
1750
|
-
* amends). A change to an entry of the lorebook
|
|
1751
|
-
*
|
|
1752
|
-
*
|
|
1753
|
-
* book is written there, and the result of a session
|
|
1804
|
+
* amends). A change to an entry of the lorebook is written there under **Full** on
|
|
1805
|
+
* the owner's own lorebook (as the version at the session's date when it reads at one), and otherwise kept in the
|
|
1806
|
+
* session's own book as a held change until applied; a change to an entry of the own
|
|
1807
|
+
* book is written there, and the result of a session on the own-book route
|
|
1754
1808
|
* carries `route: "own-book"` and the own book's `lorebookId`. `entry` names an entry the session reads, in the lorebook or
|
|
1755
1809
|
* in its own book.
|
|
1756
1810
|
* ⚠ It causes no event yet (🚧): `lore-entry-created` means a new
|
|
@@ -2081,6 +2135,91 @@ export const updateCastMember = pin(describeOutletDefinition({
|
|
|
2081
2135
|
},
|
|
2082
2136
|
},
|
|
2083
2137
|
}));
|
|
2138
|
+
/**
|
|
2139
|
+
* 🚧 **Note who knows an entry** (kn-4b, 2026-11-16; owner 2026-11-15: "lets add SDK api for it as
|
|
2140
|
+
* well, though we won't plug it in anywhere"): a step states that **one cast member came to know one
|
|
2141
|
+
* lorebook entry** in play, or no longer does. It writes a **knowledge tie** of one of play's two
|
|
2142
|
+
* kinds: `was_told` or `has_been_there`. No shipped genre or preset places it.
|
|
2143
|
+
*
|
|
2144
|
+
* `member` is `character:<cardId>`, `seated-member:<castMemberId>`, `player-seat:<seatId>` or a cast
|
|
2145
|
+
* member id, of this session. `entry` is an entry id, a write result, or a name in the session's
|
|
2146
|
+
* lorebook, resolved as `link-lore-entries@1`'s `to` is (a name nothing answers to, or two entries
|
|
2147
|
+
* answer to, is refused). One member and one entry per write: to note many, place it inside an
|
|
2148
|
+
* `each` clause (its `max` is mandatory).
|
|
2149
|
+
*
|
|
2150
|
+
* - **Play's kinds only.** It never writes the hand kinds `knows` / `kept_from`, and never ends or
|
|
2151
|
+
* changes a tie a person set. When an active hand tie (`knows` or `kept_from`) already exists for
|
|
2152
|
+
* the pair, nothing is written (`written: false`) and the receipt names it.
|
|
2153
|
+
* - **Once.** A pair that already has a live tie of the same kind is not written again
|
|
2154
|
+
* (`written: false`).
|
|
2155
|
+
* - **`end: true`** ends play's live ties for the pair (both kinds); a hand tie stays.
|
|
2156
|
+
* - **Where it lands.** On a lorebook the session's owner owns, with the lore write mode on
|
|
2157
|
+
* **Full**: in the lorebook, on the session's line, dated at the session's story date. Otherwise
|
|
2158
|
+
* (Review changes, Off, a lorebook someone else owns, no lorebook): in the session's notes, as the
|
|
2159
|
+
* session's own tie, offered in Apply (a tie on an entry made in the notes goes with that entry).
|
|
2160
|
+
* Back and a swipe take it back with the reply that wrote it, until it is applied.
|
|
2161
|
+
* - **Refused** for a genre whose lorebook is a reference (`writes.lore`), for a member or entry
|
|
2162
|
+
* outside the books the session reads, and without a session.
|
|
2163
|
+
*
|
|
2164
|
+
* ⚠ It does not set or clear an entry's **not common knowledge** mark: that is the lorebook owner's
|
|
2165
|
+
* own choice, and no outlet writes it. ⚠ Not
|
|
2166
|
+
* `link-lore-entries@1` (a link between two entries). It causes no event.
|
|
2167
|
+
* @experimental
|
|
2168
|
+
*/
|
|
2169
|
+
export const noteEntryKnowledge = pin(describeOutletDefinition({
|
|
2170
|
+
id: 'core:outlet/note-entry-knowledge@1',
|
|
2171
|
+
i18n: {
|
|
2172
|
+
name: { en: 'Note who knows an entry' },
|
|
2173
|
+
description: {
|
|
2174
|
+
en: 'Notes that a cast member came to know a lorebook entry, by being told or by having been there, or that they no longer do.',
|
|
2175
|
+
},
|
|
2176
|
+
},
|
|
2177
|
+
effects: 'write',
|
|
2178
|
+
/** Which member, which entry and how they came to know it are the run's identity: nothing to retype. */
|
|
2179
|
+
review: { fields: [] },
|
|
2180
|
+
timeoutMs: 10000,
|
|
2181
|
+
slots: {
|
|
2182
|
+
params: {
|
|
2183
|
+
kind: 'parameters',
|
|
2184
|
+
schema: {
|
|
2185
|
+
knowledgeKind: {
|
|
2186
|
+
type: 'enum',
|
|
2187
|
+
of: ['was_told', 'has_been_there'],
|
|
2188
|
+
members: [
|
|
2189
|
+
{ key: 'was_told', label: { en: 'Was told' } },
|
|
2190
|
+
{ key: 'has_been_there', label: { en: 'Has been there' } },
|
|
2191
|
+
],
|
|
2192
|
+
default: 'was_told',
|
|
2193
|
+
label: { en: 'How they came to know it' },
|
|
2194
|
+
description: {
|
|
2195
|
+
en: 'Was told: someone said it in front of them. Has been there: they were at the place.',
|
|
2196
|
+
},
|
|
2197
|
+
},
|
|
2198
|
+
end: {
|
|
2199
|
+
type: 'boolean',
|
|
2200
|
+
default: false,
|
|
2201
|
+
label: { en: 'No longer knows it' },
|
|
2202
|
+
description: {
|
|
2203
|
+
en: 'Ends what play noted for this member and entry instead of noting it. A tie the lorebook’s owner set stays.',
|
|
2204
|
+
},
|
|
2205
|
+
},
|
|
2206
|
+
},
|
|
2207
|
+
},
|
|
2208
|
+
},
|
|
2209
|
+
ports: {
|
|
2210
|
+
in: {
|
|
2211
|
+
/** The cast member: `character:<id>`, `seated-member:<id>`, `player-seat:<id>`, or a cast member id. */
|
|
2212
|
+
member: S.json,
|
|
2213
|
+
/** The entry: an id, a write result, or a name in the session's lorebook. */
|
|
2214
|
+
entry: S.json,
|
|
2215
|
+
},
|
|
2216
|
+
out: {
|
|
2217
|
+
main: S.writeResult,
|
|
2218
|
+
/** The knowledge tie written, or the one that already stood. */
|
|
2219
|
+
tieId: S.writeResult,
|
|
2220
|
+
},
|
|
2221
|
+
},
|
|
2222
|
+
}));
|
|
2084
2223
|
/**
|
|
2085
2224
|
* Make a lorebook: write one lorebook into the acting person's library.
|
|
2086
2225
|
*
|