@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/queries.js CHANGED
@@ -293,6 +293,69 @@ export const sessionHistory = pin(describeQueryDefinition({
293
293
  * The Dungeon Crawler's Planner reads its player's lane so.
294
294
  */
295
295
  channelLane: S.text,
296
+ /**
297
+ * 🚧 **Firsthand** (opt-in, 2026-11-15) — wired
298
+ * `$.input.characterId`, the character a reply is spoken by on
299
+ * its own turn, the rows this node returns leave out what that
300
+ * member was not there for. Unwired: no filter, the node reads
301
+ * as it always did. A card-less character seat's turn is read
302
+ * from the session scope's `currentCastMemberId`, so wire
303
+ * `scope` too. Wired to anything that is not one character id
304
+ * (a narrator's turn, an envoy's, several characters, null)
305
+ * on a turn whose scope names no such member: nothing is left
306
+ * out, and the run's receipt says so.
307
+ *
308
+ * The rule, for one cast member on its own turn:
309
+ * 1. By scene — a member was there for a scene if it spoke at
310
+ * least once in it (hidden, rewound and swiped-away lines do
311
+ * not count). Its own lines are always kept; messages in no
312
+ * scene are kept; the open scene is kept for its speaker.
313
+ * 2. By place, when `firsthandBy` names a cast-level state slot
314
+ * — a member was there for a message when its value of that
315
+ * slot in force at that message equals the message speaker's
316
+ * value in force at it (references compare by `entryId`;
317
+ * words trimmed and case-folded). Only values set in the
318
+ * session count; a value known only from the lorebook's
319
+ * timeline counts as missing. A message whose speaker has
320
+ * no value falls under rule 1. With a slot named, rule 2
321
+ * decides wherever both values exist.
322
+ * 3. The receipt says how many rows were left out and why.
323
+ *
324
+ * ⚠ Not Bench (a benched member is still in the scene), not a
325
+ * scene's cast. A port, not a parameter: a spec writes the slot name as
326
+ * a literal in the node's config (as `generating` on the reply
327
+ * outlets); a `params` field would put a structural fact of the
328
+ * document in the panel as a knob.
329
+ *
330
+ * ⏳ transitional: superseded for scenes and days by the
331
+ * `speakerInCast` param; kept because a pipeline of a user's own
332
+ * may wire it.
333
+ * @experimental
334
+ */
335
+ firsthandFor: S.rowIds,
336
+ /**
337
+ * 🚧 **Firsthand, by place** (opt-in, 2026-11-15) — the
338
+ * cast-level stat, by full id or local name (as
339
+ * `stat-trail@1`'s `slotId`), that rule 2 of `firsthandFor`
340
+ * compares. Read only with `firsthandFor`; unwired, the rule is
341
+ * by scene alone. Same ⚠ as `firsthandFor`.
342
+ *
343
+ * ⏳ transitional: superseded for scenes and days by the
344
+ * `speakerInCast` param; kept because a pipeline of a user's own
345
+ * may wire it.
346
+ * @experimental
347
+ */
348
+ firsthandBy: S.text,
349
+ /**
350
+ * 🚧 **Outcome numbers** — wired, the genre's own Show outcomes
351
+ * field: `false` reads each outcome row as its result in words
352
+ * with no number (`metadata.diceWords`, stamped on every
353
+ * outcome row); anything else reads rows as written. Unwired:
354
+ * ⏳ the host reads the session's `showDice` field for that
355
+ * read (to retire with 0.7). Each read's own wiring decides.
356
+ * The rows themselves are never changed.
357
+ */
358
+ outcomeNumbers: S.json,
296
359
  },
297
360
  out: {
298
361
  /**
@@ -615,6 +678,34 @@ const bandIntentFieldsOf = (band) => {
615
678
  [`${band}Priority`]: f.priority,
616
679
  };
617
680
  };
681
+ /**
682
+ * 🚧 (wt-1b-fix2, 2026-11-17; name provisional) The `speakerInCast` param as
683
+ * every read that can hand a run a history entry declares it: the same boolean,
684
+ * default on, the same label; only the sentence under it fits the read.
685
+ */
686
+ const speakerInCastParam = (description) => ({
687
+ type: 'boolean',
688
+ default: true,
689
+ label: { en: 'Only scenes the speaker was in' },
690
+ description,
691
+ });
692
+ /**
693
+ * 🚧 ★ (cm-1-w4, 2026-11-19; name and label provisional) The `speakerMemory`
694
+ * param, declared on every read that declares `speakerInCast`, right after it
695
+ * (and on the two relationship nodes, which carry no `speakerInCast`):
696
+ * the same boolean, default on; only the sentence under it fits the read. On, a
697
+ * speaking character whose cast version has a Memory reads as of it (its
698
+ * *Remembers as of* line and date, and nothing before its *Nothing before*).
699
+ * Off, the speaker reads as the session does. A lorebook with its Timeline off
700
+ * has no Memory to apply, and a turn no single character speaks, such as the
701
+ * narrator's, reads everything: off or on, no effect there.
702
+ */
703
+ const speakerMemoryParam = (description) => ({
704
+ type: 'boolean',
705
+ default: true,
706
+ label: { en: 'Read as the speaker remembers' },
707
+ description,
708
+ });
618
709
  /** @public */
619
710
  export const lorebookTriggers = pin(describeQueryDefinition({
620
711
  id: 'core:query/lorebook-triggers@1',
@@ -766,6 +857,31 @@ export const lorebookTriggers = pin(describeQueryDefinition({
766
857
  lexicalScoring: LEXICAL_SCORING,
767
858
  trigramFolding: TRIGRAM_FOLDING,
768
859
  titleWeight: TITLE_WEIGHT,
860
+ /**
861
+ * 🚧 (kn-2a, 2026-11-16; name provisional) An entry marked *not common
862
+ * knowledge* is left out unless the speaker has a knowledge tie to it (any active
863
+ * tie from its cast binding that reads on the reply's line at the reply's date and
864
+ * is not *kept from*) or it is the place the speaker stands in; an entry a *kept
865
+ * from* tie wins for is left out, marked or not. The speaker is this read's own
866
+ * `speaker` in-port when wired, else the character the run speaks as (`scope`); a
867
+ * run that speaks as nobody (a narrator's turn, a routine, an action, an envoy, a
868
+ * step writing for several characters) has no speaker and the read returns
869
+ * everything. `false` turns it off for this node.
870
+ */
871
+ knownToSpeaker: {
872
+ type: 'boolean',
873
+ default: true,
874
+ label: { en: 'Only what the speaker knows' },
875
+ description: 'Leaves out the entries the speaking character does not know (marked not common knowledge with no knowledge tie to it, or kept from it; the place it stands in always counts as known), and does nothing on a turn no single character speaks, such as the narrator’s.',
876
+ },
877
+ /**
878
+ * 🚧 (wt-1b-fix2, 2026-11-17; name provisional) The same switch as on `history-entries@1`: the
879
+ * host's lore read judges every history day against the stored cast of the scenes compiled
880
+ * into it, for the read that asked, so a pipeline that turns it off must turn it off on every
881
+ * read. `false` turns it off for this node.
882
+ */
883
+ speakerInCast: speakerInCastParam('Shows a history day the speaking character missed part of as the summaries of the scenes whose cast lists it, and leaves out one it was in none of, among the entries these keywords bring in, and does nothing on a turn no single character speaks, such as the narrator’s.'),
884
+ speakerMemory: speakerMemoryParam('A speaking character with a Memory reads the entries these keywords bring in as of its Memory: its line and date, and nothing before its *Nothing before*.'),
769
885
  },
770
886
  },
771
887
  },
@@ -967,6 +1083,31 @@ const loreSlots = (band, defaults) => ({
967
1083
  // the owner it is all the panel shows.
968
1084
  ...bandIntentFields(band, defaults),
969
1085
  ...loreScanFields(),
1086
+ /**
1087
+ * 🚧 (kn-2a, 2026-11-16; name provisional) An entry marked *not common
1088
+ * knowledge* is left out unless the speaker has a knowledge tie to it (any active
1089
+ * tie from its cast binding that reads on the reply's line at the reply's date and
1090
+ * is not *kept from*) or it is the place the speaker stands in; an entry a *kept
1091
+ * from* tie wins for is left out, marked or not. The speaker is this read's own
1092
+ * `speaker` in-port when wired, else the character the run speaks as (`scope`); a
1093
+ * run that speaks as nobody (a narrator's turn, a routine, an action, an envoy, a
1094
+ * step writing for several characters) has no speaker and the read returns
1095
+ * everything. `false` turns it off for this node.
1096
+ */
1097
+ knownToSpeaker: {
1098
+ type: 'boolean',
1099
+ default: true,
1100
+ label: { en: 'Only what the speaker knows' },
1101
+ description: 'Leaves out the entries the speaking character does not know (marked not common knowledge with no knowledge tie to it, or kept from it; the place it stands in always counts as known), and does nothing on a turn no single character speaks, such as the narrator’s.',
1102
+ },
1103
+ /**
1104
+ * 🚧 (wt-1b-fix2, 2026-11-17; name provisional) The same switch as on `history-entries@1`: the
1105
+ * host's lore read judges every history day against the stored cast of the scenes compiled
1106
+ * into it, for the read that asked, so a pipeline that turns it off must turn it off on every
1107
+ * read. `false` turns it off for this node.
1108
+ */
1109
+ speakerInCast: speakerInCastParam('Shows a history day the speaking character missed part of as the summaries of the scenes whose cast lists it, and leaves out one it was in none of, among the entries this lane reads, and does nothing on a turn no single character speaks, such as the narrator’s.'),
1110
+ speakerMemory: speakerMemoryParam('A speaking character with a Memory reads the entries this lane reads as of its Memory: its line and date, and nothing before its *Nothing before*.'),
970
1111
  },
971
1112
  },
972
1113
  });
@@ -1081,6 +1222,20 @@ export const characterLore = pin(describeQueryDefinition({
1081
1222
  * a comment in that file warns about. The corpus mirrors the three lanes now.
1082
1223
  *
1083
1224
  * Same retrieval as its two siblings: one scan, one filter.
1225
+ *
1226
+ * 🚧 Opting in to the firsthand option is wiring `firsthandFor` (⏳ transitional,
1227
+ * see `speakerInCast`).
1228
+ *
1229
+ * 🚧 `speakerInCast` (param, on by default; name provisional): for a compiled
1230
+ * day, if the speaker is in the stored cast (`scene_characters`, role
1231
+ * participant) of every scene of this session compiled into it, the day's own
1232
+ * text; if it misses any, the summaries of the scenes whose cast lists it, in
1233
+ * story order, under the day's date, every one of them. A day it is in none of, or
1234
+ * whose kept scenes have no summary, is left out of the read itself. The host's
1235
+ * lore read judges it, so it holds however the day is found. A day with none
1236
+ * of this session's scenes is untouched. The speaker is the character the
1237
+ * run speaks as; a run that speaks as nobody, or a card in no seat, reads
1238
+ * everything. `false` turns it off for this node.
1084
1239
  * @experimental
1085
1240
  */
1086
1241
  export const historyEntries = pin(describeQueryDefinition({
@@ -1096,7 +1251,41 @@ export const historyEntries = pin(describeQueryDefinition({
1096
1251
  ports: {
1097
1252
  // No `text` in-port — see `lorebookTriggers`: the scan reads its
1098
1253
  // window through `scope` (culled 2026-09-16, R-12).
1099
- in: { scope: S.sessionScope },
1254
+ in: {
1255
+ scope: S.sessionScope,
1256
+ /**
1257
+ * 🚧 **Firsthand** (opt-in, 2026-11-15) — wired
1258
+ * `$.input.characterId`, an entry is left out when a scene of
1259
+ * this session compiled into it is one that member was not
1260
+ * there for. The rule, the unwired and not-one-character cases,
1261
+ * and the ⚠ are those of `core:query/session-history@1`'s
1262
+ * `firsthandFor`, plus: a scene counts as "was there for" by
1263
+ * `core:query/earlier-scenes@1`'s rule, and an entry with none
1264
+ * of this session's scenes is kept. A left-out entry is
1265
+ * published on `exclusions` with the reason, so
1266
+ * `core:task/eligibility@1` marks it ineligible whichever
1267
+ * mechanism found it; `main` and `hits` are unchanged. Unwired,
1268
+ * nothing changes.
1269
+ *
1270
+ * ⏳ transitional: superseded for scenes and days by the
1271
+ * `speakerInCast` param; kept because a pipeline of a user's own
1272
+ * may wire it.
1273
+ * @experimental
1274
+ */
1275
+ firsthandFor: S.rowIds,
1276
+ /**
1277
+ * 🚧 **Firsthand, by place** (opt-in, 2026-11-15) — as
1278
+ * `core:query/session-history@1`'s `firsthandBy`: the
1279
+ * cast-level stat rule 2 compares, read only with
1280
+ * `firsthandFor`.
1281
+ *
1282
+ * ⏳ transitional: superseded for scenes and days by the
1283
+ * `speakerInCast` param; kept because a pipeline of a user's own
1284
+ * may wire it.
1285
+ * @experimental
1286
+ */
1287
+ firsthandBy: S.text,
1288
+ },
1100
1289
  // Both open with a band-intent element — this lane's own — ahead
1101
1290
  // of the items; readers call `splitCandidates()`.
1102
1291
  out: {
@@ -1202,12 +1391,15 @@ export const roundWorth = pin(describeQueryDefinition({
1202
1391
  }));
1203
1392
  /**
1204
1393
  * 🚧 **Where scenes begin** — the scenes routine's code-only look back over
1205
- * the session's `main` channel (every name here is provisional).
1394
+ * each of the session's story lanes (every name here is provisional): `main`,
1395
+ * and each channel the genre declares with `lore: 'story'`, each with its own
1396
+ * rounds, anchor, open scene and boundary triggers.
1206
1397
  *
1207
- * It walks the channel's standing lines up to the newest line that is at least
1398
+ * It walks a lane's standing lines up to the newest line that is at least
1208
1399
  * `depth` rounds old (a round as the turn order counts it), evaluates the
1209
1400
  * session's enabled boundary triggers line by line, and returns
1210
- * `SceneBoundary[]` in line order on `main`. **A query writes nothing.**
1401
+ * `SceneBoundary[]` with `main`'s first, then each other lane's, each in line
1402
+ * order. **A query writes nothing.**
1211
1403
  *
1212
1404
  * Where the walk starts is derived, never stored: after the latest of the
1213
1405
  * channel's latest scene boundary, its latest decided or offered scene cue, and
@@ -1302,9 +1494,27 @@ export const sceneSummaryDue = pin(describeQueryDefinition({
1302
1494
  * entry, in story order (oldest first, by where each scene starts: its opening
1303
1495
  * line, else its smallest selected line), at most the newest 200. `name` is
1304
1496
  * the scene's name as shown; `firstLineId` is its first line's message id.
1497
+ * Each scene also carries `openedStoryClock: { year, month, day, hour, minute } | null`:
1498
+ * the session's story clock when the scene opened (columns `opened_story_clock_*`),
1499
+ * `null` when it opened with no clock, and `null` when the lorebook keeps no
1500
+ * timeline, whatever is stored.
1305
1501
  * `maxTokens` is `floor(share × budget.total)`, or `null` when `budget` is
1306
1502
  * unwired (then the block is not capped).
1307
1503
  *
1504
+ * Opt-in: wire `firsthandFor` (and `firsthandBy`) and the scenes the speaking
1505
+ * cast member was not there for are left out of `scenes` (⏳ transitional,
1506
+ * see `speakerInCast`).
1507
+ *
1508
+ * 🚧 `speakerInCast` (param, on by default; name provisional): only the scenes
1509
+ * whose stored cast (`scene_characters`, role participant) lists the speaker
1510
+ * are returned. An open scene is kept; a scene whose cast was never worked out
1511
+ * (no stored cast at all) is kept; so is one whose worked-out cast lists
1512
+ * nobody. The speaker is the character the run speaks
1513
+ * as (`scope`); a run that speaks as nobody, or a card in no seat, reads
1514
+ * everything. `false` turns it off for this node.
1515
+ *
1516
+ * It reads the story channel named by `channel` (`main` when absent).
1517
+ *
1308
1518
  * It returns data, never rendered text: `core:task/assemble@2` decides which
1309
1519
  * scenes show (only those whose first line is older than the first line the
1310
1520
  * prompt keeps) and fits them to `maxTokens`.
@@ -1333,14 +1543,149 @@ export const earlierScenes = pin(describeQueryDefinition({
1333
1543
  en: 'How much of the context window the summaries of earlier scenes may take. When they do not fit, the oldest are left out first.',
1334
1544
  },
1335
1545
  },
1546
+ speakerInCast: {
1547
+ type: 'boolean',
1548
+ default: true,
1549
+ label: { en: 'Only scenes the speaker was in' },
1550
+ description: 'Leaves out the earlier scenes whose cast does not list the speaking character (an open scene, and one whose cast was never worked out, are kept), and does nothing on a turn no single character speaks, such as the narrator’s.',
1551
+ },
1552
+ speakerMemory: speakerMemoryParam('A speaking character with a Memory leaves out the scenes before its *Nothing before*.'),
1336
1553
  },
1337
1554
  },
1338
1555
  },
1339
1556
  ports: {
1340
- in: { scope: S.sessionScope, budget: S.budget },
1557
+ in: {
1558
+ scope: S.sessionScope,
1559
+ budget: S.budget,
1560
+ /**
1561
+ * 🚧 **Firsthand** (opt-in, 2026-11-15) — wired
1562
+ * `$.input.characterId`, the summaries this node returns leave
1563
+ * out the scenes that member was not there for. The rule, the
1564
+ * unwired and not-one-character cases, and the ⚠ are those of
1565
+ * `core:query/session-history@1`'s `firsthandFor`, plus: a
1566
+ * summary is kept for a member that was there for the scene's last
1567
+ * message or more than half of its messages, else left out. The
1568
+ * receipt says how many summaries were left out and why.
1569
+ *
1570
+ * ⏳ transitional: superseded for scenes and days by the
1571
+ * `speakerInCast` param; kept because a pipeline of a user's own
1572
+ * may wire it.
1573
+ * @experimental
1574
+ */
1575
+ firsthandFor: S.rowIds,
1576
+ /**
1577
+ * 🚧 **Firsthand, by place** (opt-in, 2026-11-15) — as
1578
+ * `core:query/session-history@1`'s `firsthandBy`: the
1579
+ * cast-level stat rule 2 compares, read only with
1580
+ * `firsthandFor`.
1581
+ *
1582
+ * ⏳ transitional: superseded for scenes and days by the
1583
+ * `speakerInCast` param; kept because a pipeline of a user's own
1584
+ * may wire it.
1585
+ * @experimental
1586
+ */
1587
+ firsthandBy: S.text,
1588
+ /**
1589
+ * 🚧 The story channel whose earlier scenes are read; absent: `main`.
1590
+ * A summary of one story channel never enters another channel's block (CP8).
1591
+ * @experimental
1592
+ */
1593
+ channel: S.text,
1594
+ },
1341
1595
  out: { main: S.json },
1342
1596
  },
1343
1597
  }));
1598
+ /**
1599
+ * 🚧 **Entries the lines name** — the entries the session already has whose
1600
+ * name or key appears in the lines a step read (every name here is
1601
+ * provisional).
1602
+ *
1603
+ * `main` is `Array<{ entryId: number, entryType: string, name: string,
1604
+ * content: string, byPerson: boolean }>`: the entries of `entryTypes` the
1605
+ * session reads (its own book first, then the attached lorebook, each as the
1606
+ * session reads it, held changes included; switched-off, archived and unseen
1607
+ * entries left out), whose name or one of whose keys appears as whole words
1608
+ * in one of `messages` (the SDK's `namesName`), in that order, at most
1609
+ * `maxEntries`, and within `floor(share × budget.total)` tokens when `budget`
1610
+ * is wired (an entry too long for what is left is left out, the next one
1611
+ * still tried). `content` is the whole text as the session reads it.
1612
+ * `byPerson` is true for an entry a person wrote (`provenance: "human"`).
1613
+ * `ids` is the `entryId` of each row of `main`, in order: what a write passes
1614
+ * as `create-lore-entry@1`'s `shown`. Deterministic, no model.
1615
+ *
1616
+ * ⚠ Not `core:query/entity-search@1` (ranked retrieval by annotated entities
1617
+ * over its own window), not `core:query/lorebook-entries@1` (the listing).
1618
+ * **A query writes nothing.**
1619
+ * @experimental
1620
+ */
1621
+ export const entriesNamed = pin(describeQueryDefinition({
1622
+ id: 'core:query/entries-named@1',
1623
+ i18n: { name: { en: 'Entries the lines name' } },
1624
+ timeoutMs: 2000,
1625
+ slots: {
1626
+ params: {
1627
+ kind: 'parameters',
1628
+ schema: {
1629
+ entryTypes: {
1630
+ type: 'list',
1631
+ item: { type: 'text' },
1632
+ label: { en: 'Entry types looked for' },
1633
+ description: {
1634
+ en: 'Which kinds of entry to look for, by type id. Leave it empty for world lore.',
1635
+ },
1636
+ },
1637
+ maxEntries: {
1638
+ type: 'integer',
1639
+ min: 0,
1640
+ default: 12,
1641
+ label: { en: 'Entries shown at most' },
1642
+ description: {
1643
+ en: 'How many existing entries the model is shown before it writes. 0 shows none.',
1644
+ },
1645
+ },
1646
+ share: {
1647
+ type: 'number',
1648
+ min: 0,
1649
+ max: 1,
1650
+ default: 0.2,
1651
+ label: { en: 'Share — entries shown' },
1652
+ description: {
1653
+ en: 'How much of the context window the entries shown may take. An entry too long to show whole is left out.',
1654
+ },
1655
+ },
1656
+ /**
1657
+ * 🚧 (kn-2a, 2026-11-16; name provisional) An entry marked *not common
1658
+ * knowledge* is left out unless the speaker has a knowledge tie to it (any active
1659
+ * tie from its cast binding that reads on the reply's line at the reply's date and
1660
+ * is not *kept from*) or it is the place the speaker stands in; an entry a *kept
1661
+ * from* tie wins for is left out, marked or not. The speaker is this read's own
1662
+ * `speaker` in-port when wired, else the character the run speaks as (`scope`); a
1663
+ * run that speaks as nobody (a narrator's turn, a routine, an action, an envoy, a
1664
+ * step writing for several characters) has no speaker and the read returns
1665
+ * everything. `false` turns it off for this node.
1666
+ */
1667
+ knownToSpeaker: {
1668
+ type: 'boolean',
1669
+ default: true,
1670
+ label: { en: 'Only what the speaker knows' },
1671
+ description: 'Leaves out the entries the speaking character does not know (marked not common knowledge with no knowledge tie to it, or kept from it; the place it stands in always counts as known), and does nothing on a turn no single character speaks, such as the narrator’s.',
1672
+ },
1673
+ /**
1674
+ * 🚧 (wt-1b-fix2, 2026-11-17; name provisional) The same switch as on `history-entries@1`: the
1675
+ * host's lore read judges every history day against the stored cast of the scenes compiled
1676
+ * into it, for the read that asked, so a pipeline that turns it off must turn it off on every
1677
+ * read. `false` turns it off for this node.
1678
+ */
1679
+ speakerInCast: speakerInCastParam('Shows a history day the speaking character missed part of as the summaries of the scenes whose cast lists it, and leaves out one it was in none of, among the entries found by name, and does nothing on a turn no single character speaks, such as the narrator’s.'),
1680
+ speakerMemory: speakerMemoryParam('A speaking character with a Memory reads the entries found by name as of its Memory: its line and date, and nothing before its *Nothing before*.'),
1681
+ },
1682
+ },
1683
+ },
1684
+ ports: {
1685
+ in: { scope: S.sessionScope, messages: S.messages, budget: S.budget },
1686
+ out: { main: S.json, ids: S.json },
1687
+ },
1688
+ }));
1344
1689
  /**
1345
1690
  * 🚧 **One cast member**, as the scope session reads them — their line, their
1346
1691
  * clock, the session's own notes over the book.
@@ -1490,6 +1835,31 @@ export const vectorSearch = pin(describeQueryDefinition({
1490
1835
  label: { en: 'Discount weak matches' },
1491
1836
  description: 'How sharply a loose resemblance counts for less than a close one. 1 takes the similarity as it comes; higher pushes vague matches down without ever removing them, so they can still be found by a keyword or a name.',
1492
1837
  },
1838
+ /**
1839
+ * 🚧 (kn-2a, 2026-11-16; name provisional) An entry marked *not common
1840
+ * knowledge* is left out unless the speaker has a knowledge tie to it (any active
1841
+ * tie from its cast binding that reads on the reply's line at the reply's date and
1842
+ * is not *kept from*) or it is the place the speaker stands in; an entry a *kept
1843
+ * from* tie wins for is left out, marked or not. The speaker is this read's own
1844
+ * `speaker` in-port when wired, else the character the run speaks as (`scope`); a
1845
+ * run that speaks as nobody (a narrator's turn, a routine, an action, an envoy, a
1846
+ * step writing for several characters) has no speaker and the read returns
1847
+ * everything. `false` turns it off for this node.
1848
+ */
1849
+ knownToSpeaker: {
1850
+ type: 'boolean',
1851
+ default: true,
1852
+ label: { en: 'Only what the speaker knows' },
1853
+ description: 'Leaves out the entries the speaking character does not know (marked not common knowledge with no knowledge tie to it, or kept from it; the place it stands in always counts as known), and does nothing on a turn no single character speaks, such as the narrator’s.',
1854
+ },
1855
+ /**
1856
+ * 🚧 (wt-1b-fix2, 2026-11-17; name provisional) The same switch as on `history-entries@1`: the
1857
+ * host's lore read judges every history day against the stored cast of the scenes compiled
1858
+ * into it, for the read that asked, so a pipeline that turns it off must turn it off on every
1859
+ * read. `false` turns it off for this node.
1860
+ */
1861
+ speakerInCast: speakerInCastParam('Shows a history day the speaking character missed part of as the summaries of the scenes whose cast lists it, and leaves out one it was in none of, among the entries found by meaning, and does nothing on a turn no single character speaks, such as the narrator’s.'),
1862
+ speakerMemory: speakerMemoryParam('A speaking character with a Memory reads the entries found by meaning as of its Memory: its line and date, and nothing before its *Nothing before*.'),
1493
1863
  },
1494
1864
  },
1495
1865
  },
@@ -1656,6 +2026,31 @@ export const entitySearch = pin(describeQueryDefinition({
1656
2026
  label: { en: 'Strength' },
1657
2027
  description: 'How much weight a shared name carries against the other ways an entry can be found. 0 leaves the arm finding things and ranking them last.',
1658
2028
  },
2029
+ /**
2030
+ * 🚧 (kn-2a, 2026-11-16; name provisional) An entry marked *not common
2031
+ * knowledge* is left out unless the speaker has a knowledge tie to it (any active
2032
+ * tie from its cast binding that reads on the reply's line at the reply's date and
2033
+ * is not *kept from*) or it is the place the speaker stands in; an entry a *kept
2034
+ * from* tie wins for is left out, marked or not. The speaker is this read's own
2035
+ * `speaker` in-port when wired, else the character the run speaks as (`scope`); a
2036
+ * run that speaks as nobody (a narrator's turn, a routine, an action, an envoy, a
2037
+ * step writing for several characters) has no speaker and the read returns
2038
+ * everything. `false` turns it off for this node.
2039
+ */
2040
+ knownToSpeaker: {
2041
+ type: 'boolean',
2042
+ default: true,
2043
+ label: { en: 'Only what the speaker knows' },
2044
+ description: 'Leaves out the entries the speaking character does not know (marked not common knowledge with no knowledge tie to it, or kept from it; the place it stands in always counts as known), and does nothing on a turn no single character speaks, such as the narrator’s.',
2045
+ },
2046
+ /**
2047
+ * 🚧 (wt-1b-fix2, 2026-11-17; name provisional) The same switch as on `history-entries@1`: the
2048
+ * host's lore read judges every history day against the stored cast of the scenes compiled
2049
+ * into it, for the read that asked, so a pipeline that turns it off must turn it off on every
2050
+ * read. `false` turns it off for this node.
2051
+ */
2052
+ speakerInCast: speakerInCastParam('Shows a history day the speaking character missed part of as the summaries of the scenes whose cast lists it, and leaves out one it was in none of, among the entries found by name or description, and does nothing on a turn no single character speaks, such as the narrator’s.'),
2053
+ speakerMemory: speakerMemoryParam('A speaking character with a Memory reads the entries found by name or description as of its Memory: its line and date, and nothing before its *Nothing before*.'),
1659
2054
  },
1660
2055
  },
1661
2056
  },
@@ -1921,6 +2316,31 @@ export const entityLink = pin(describeQueryDefinition({
1921
2316
  label: { en: 'Most entries linked' },
1922
2317
  description: 'A ceiling on how many entries one turn may have matched to a description. The best matches are kept; this never brings in an entry nothing else found, it only changes where one comes in the order.',
1923
2318
  },
2319
+ /**
2320
+ * 🚧 (kn-2a, 2026-11-16; name provisional) An entry marked *not common
2321
+ * knowledge* is left out unless the speaker has a knowledge tie to it (any active
2322
+ * tie from its cast binding that reads on the reply's line at the reply's date and
2323
+ * is not *kept from*) or it is the place the speaker stands in; an entry a *kept
2324
+ * from* tie wins for is left out, marked or not. The speaker is this read's own
2325
+ * `speaker` in-port when wired, else the character the run speaks as (`scope`); a
2326
+ * run that speaks as nobody (a narrator's turn, a routine, an action, an envoy, a
2327
+ * step writing for several characters) has no speaker and the read returns
2328
+ * everything. `false` turns it off for this node.
2329
+ */
2330
+ knownToSpeaker: {
2331
+ type: 'boolean',
2332
+ default: true,
2333
+ label: { en: 'Only what the speaker knows' },
2334
+ description: 'Leaves out the entries the speaking character does not know (marked not common knowledge with no knowledge tie to it, or kept from it; the place it stands in always counts as known), and does nothing on a turn no single character speaks, such as the narrator’s.',
2335
+ },
2336
+ /**
2337
+ * 🚧 (wt-1b-fix2, 2026-11-17; name provisional) The same switch as on `history-entries@1`: the
2338
+ * host's lore read judges every history day against the stored cast of the scenes compiled
2339
+ * into it, for the read that asked, so a pipeline that turns it off must turn it off on every
2340
+ * read. `false` turns it off for this node.
2341
+ */
2342
+ speakerInCast: speakerInCastParam('Shows a history day the speaking character missed part of as the summaries of the scenes whose cast lists it, and leaves out one it was in none of, among the entries matched to a description, and does nothing on a turn no single character speaks, such as the narrator’s.'),
2343
+ speakerMemory: speakerMemoryParam('A speaking character with a Memory reads the entries matched to a description as of its Memory: its line and date, and nothing before its *Nothing before*.'),
1924
2344
  },
1925
2345
  },
1926
2346
  },
@@ -2043,7 +2463,7 @@ export const sessionSettings = pin(describeQueryDefinition({
2043
2463
  * that reads well and does nothing, which is what `session-history@1`'s dead
2044
2464
  * `template` slot already cost this codebase once.
2045
2465
  */
2046
- const relationshipSlots = (what) => ({
2466
+ const relationshipSlots = (what, speakerMemoryDescription) => ({
2047
2467
  params: {
2048
2468
  kind: 'parameters',
2049
2469
  facet: 'weights',
@@ -2091,6 +2511,11 @@ const relationshipSlots = (what) => ({
2091
2511
  en: `A ceiling on how many ${what} reach the prompt, closest first. Leave it empty for no ceiling; 0 leaves the section out altogether.`,
2092
2512
  },
2093
2513
  },
2514
+ ...(speakerMemoryDescription === undefined
2515
+ ? {}
2516
+ : {
2517
+ speakerMemory: speakerMemoryParam(speakerMemoryDescription),
2518
+ }),
2094
2519
  },
2095
2520
  },
2096
2521
  });
@@ -2115,7 +2540,7 @@ export const relationshipsPerspectives = pin(describeQueryDefinition({
2115
2540
  },
2116
2541
  optional: true,
2117
2542
  timeoutMs: RELATIONSHIP_TIMEOUT,
2118
- slots: relationshipSlots('of their own views'),
2543
+ slots: relationshipSlots('of their own views', 'A speaking character with a Memory reads its own views of the others as of its Memory: its line and date.'),
2119
2544
  ports: {
2120
2545
  in: { scope: S.sessionScope },
2121
2546
  /**
@@ -2150,7 +2575,7 @@ export const relationshipsKnown = pin(describeQueryDefinition({
2150
2575
  },
2151
2576
  optional: true,
2152
2577
  timeoutMs: RELATIONSHIP_TIMEOUT,
2153
- slots: relationshipSlots('views of them'),
2578
+ slots: relationshipSlots('views of them', 'A speaking character with a Memory reads how the others regard it as of its Memory: its line and date.'),
2154
2579
  ports: {
2155
2580
  in: { scope: S.sessionScope },
2156
2581
  out: { main: S.json, relationshipsKnown: S.json },
@@ -2278,6 +2703,31 @@ export const relationshipSearch = pin(describeQueryDefinition({
2278
2703
  en: 'Also offer the links one step from the lore this turn found — a room’s ways out, what an item belongs to. Off keeps the band to relationships between characters.',
2279
2704
  },
2280
2705
  },
2706
+ /**
2707
+ * 🚧 (kn-2a, 2026-11-16; name provisional) An entry marked *not common
2708
+ * knowledge* is left out unless the speaker has a knowledge tie to it (any active
2709
+ * tie from its cast binding that reads on the reply's line at the reply's date and
2710
+ * is not *kept from*) or it is the place the speaker stands in; an entry a *kept
2711
+ * from* tie wins for is left out, marked or not. The speaker is this read's own
2712
+ * `speaker` in-port when wired, else the character the run speaks as (`scope`); a
2713
+ * run that speaks as nobody (a narrator's turn, a routine, an action, an envoy, a
2714
+ * step writing for several characters) has no speaker and the read returns
2715
+ * everything. `false` turns it off for this node.
2716
+ */
2717
+ knownToSpeaker: {
2718
+ type: 'boolean',
2719
+ default: true,
2720
+ label: { en: 'Only what the speaker knows' },
2721
+ description: 'Leaves out the entries the speaking character does not know, and the links that lead to them (an entry marked not common knowledge with no knowledge tie to it, or kept from it; the place it stands in always counts as known), and does nothing on a turn no single character speaks, such as the narrator’s.',
2722
+ },
2723
+ /**
2724
+ * 🚧 (wt-1b-fix2, 2026-11-17; name provisional) The same switch as on `history-entries@1`: the
2725
+ * host's lore read judges every history day against the stored cast of the scenes compiled
2726
+ * into it, for the read that asked, so a pipeline that turns it off must turn it off on every
2727
+ * read. `false` turns it off for this node.
2728
+ */
2729
+ speakerInCast: speakerInCastParam('Shows a history day the speaking character missed part of as the summaries of the scenes whose cast lists it, and leaves out one it was in none of, among the entries the links lead to, and does nothing on a turn no single character speaks, such as the narrator’s.'),
2730
+ speakerMemory: speakerMemoryParam('A speaking character with a Memory reads the entries the links lead to as of its Memory: its line and date, and nothing before its *Nothing before*.'),
2281
2731
  },
2282
2732
  },
2283
2733
  },
@@ -3168,7 +3618,8 @@ export const channelLane = pin(describeQueryDefinition({
3168
3618
  * recorded is dropped here, since it is already one of its points.
3169
3619
  *
3170
3620
  * Each point: `{ value, layer: 'session' | 'timeline', anchor, provenance }` —
3171
- * `anchor` is `{ messageId }` or `{ historyEntryId, date }`; `provenance` is
3621
+ * `anchor` is `{ messageId }` or `{ historyEntryId, date }` (`date` is `null` when
3622
+ * the lorebook keeps no timeline, whatever is stored); `provenance` is
3172
3623
  * `{ updatedBy, sessionId, messageId, sceneId, note, createdAt }` (who wrote
3173
3624
  * it: `user`, `run:<id>`, or `session:<id>` for write-back). The document is
3174
3625
  * `{ lorebookId, sessionId, branchId, owner, slotId, mode, tracked, points }`;
@@ -3649,6 +4100,31 @@ export const lorebookEntries = pin(describeQueryDefinition({
3649
4100
  label: { en: 'With each entry’s links' },
3650
4101
  description: 'Also list, on each entry, the links that lead from it to other entries — a room’s ways out, what it is inside — each said from that entry.',
3651
4102
  },
4103
+ /**
4104
+ * 🚧 (kn-2a, 2026-11-16; name provisional) An entry marked *not common
4105
+ * knowledge* is left out unless the speaker has a knowledge tie to it (any active
4106
+ * tie from its cast binding that reads on the reply's line at the reply's date and
4107
+ * is not *kept from*) or it is the place the speaker stands in; an entry a *kept
4108
+ * from* tie wins for is left out, marked or not. The speaker is this read's own
4109
+ * `speaker` in-port when wired, else the character the run speaks as (`scope`); a
4110
+ * run that speaks as nobody (a narrator's turn, a routine, an action, an envoy, a
4111
+ * step writing for several characters) has no speaker and the read returns
4112
+ * everything. `false` turns it off for this node.
4113
+ */
4114
+ knownToSpeaker: {
4115
+ type: 'boolean',
4116
+ default: true,
4117
+ label: { en: 'Only what the speaker knows' },
4118
+ description: 'Leaves out the entries the speaking character does not know, and the links that name them (an entry marked not common knowledge with no knowledge tie to it, or kept from it; the place it stands in always counts as known), and does nothing on a turn no single character speaks, such as the narrator’s.',
4119
+ },
4120
+ /**
4121
+ * 🚧 (wt-1b-fix2, 2026-11-17; name provisional) The same switch as on `history-entries@1`: the
4122
+ * host's lore read judges every history day against the stored cast of the scenes compiled
4123
+ * into it, for the read that asked, so a pipeline that turns it off must turn it off on every
4124
+ * read. `false` turns it off for this node.
4125
+ */
4126
+ speakerInCast: speakerInCastParam('Shows a history day the speaking character missed part of as the summaries of the scenes whose cast lists it, and leaves out one it was in none of, among the entries this read lists, and does nothing on a turn no single character speaks, such as the narrator’s.'),
4127
+ speakerMemory: speakerMemoryParam('A speaking character with a Memory reads the entries this read lists as of its Memory: its line and date, and nothing before its *Nothing before*.'),
3652
4128
  },
3653
4129
  },
3654
4130
  },
package/dist/tasks.d.ts CHANGED
@@ -1590,6 +1590,11 @@ export declare const assemble: import("@serene-pub/sdk").Pinned<import("@serene-
1590
1590
  readonly optional: true;
1591
1591
  readonly description: 'The story’s current date, laid out.';
1592
1592
  };
1593
+ readonly storyCalendar: {
1594
+ readonly type: 'string';
1595
+ readonly optional: true;
1596
+ readonly description: 'The lorebook’s calendar, laid out — absent for a free-form book.';
1597
+ };
1593
1598
  readonly sessionMessages: {
1594
1599
  readonly type: 'list';
1595
1600
  readonly description: 'The transcript, oldest first, ending with the seed line.';
@@ -1743,6 +1748,7 @@ export declare const assemble: import("@serene-pub/sdk").Pinned<import("@serene-
1743
1748
  readonly history: "core:var/history@1";
1744
1749
  readonly earlierScenes: "core:var/earlier-scenes@1";
1745
1750
  readonly currentDate: "core:var/current-date@1";
1751
+ readonly storyCalendar: "core:var/story-calendar@1";
1746
1752
  };
1747
1753
  /**
1748
1754
  * Open (typed templates, edited in place by owner ruling):