@serene-pub/contracts 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/outlets.js CHANGED
@@ -631,6 +631,52 @@ export const setSeatName = pin(describeOutletDefinition({
631
631
  },
632
632
  },
633
633
  }));
634
+ /**
635
+ * 🚧 **Bench a seat, or bring it back** (owner ruling 2026-11-10: a seat's
636
+ * status is managed by the genre, never by core on its own). Benched, a seat
637
+ * stays in the session and leaves the turns; brought back, it takes its turns
638
+ * again.
639
+ *
640
+ * Opt-in: a genre declares `writes.seats: true` (absent is off). Without it
641
+ * the host refuses, in words.
642
+ *
643
+ * Tied to the turn: the bench is recorded against the run's turn message.
644
+ * Back and a retake put the seat back as it was, Forward does it again, and a
645
+ * person's later bench or drag wins (the undo only puts back a seat still as
646
+ * this port left it). With no turn message (a person's action) the write is
647
+ * not tied to a turn.
648
+ *
649
+ * A seat already in the asked state is a no-op. Envoys and removed seats are
650
+ * refused. `seat` / `seats` give the seat's reference, as `set-seat-name@1`
651
+ * does.
652
+ *
653
+ * `seat` is `seated-member:<id>`, `player-seat:<id>` or `character:<id>`, and
654
+ * `benched` is `true` to bench or `false` to bring back; both are JSON, as
655
+ * `setSeatName.retire` and `setComposerState.open` are. `@1` evolves in place.
656
+ * @experimental
657
+ */
658
+ export const setSeatBench = pin(describeOutletDefinition({
659
+ id: 'core:outlet/set-seat-bench@1',
660
+ i18n: { name: { en: 'Bench or bring back a seat' } },
661
+ effects: 'write',
662
+ reviewDefault: 'off',
663
+ // Approve or refuse: which seat, and which way, are the write itself (R-15).
664
+ review: { fields: [] },
665
+ timeoutMs: 2000,
666
+ ports: {
667
+ in: {
668
+ /** The seat: `seated-member:<id>`, `player-seat:<id>` or `character:<id>`. */
669
+ seat: S.json,
670
+ /** `true` benches the seat, `false` brings it back. */
671
+ benched: S.json,
672
+ },
673
+ out: {
674
+ main: S.writeResult,
675
+ seat: S.participantRef,
676
+ seats: S.participantRefs,
677
+ },
678
+ },
679
+ }));
634
680
  /**
635
681
  * 🚧 **Open or close the composer** on a channel lane (owner ruling
636
682
  * 2026-10-15): the genre's switch for whether a person may write there. The
@@ -699,6 +745,8 @@ export const setComposerState = pin(describeOutletDefinition({
699
745
  * no longer hold or `at` is not one of its lines. Never held at the review gate: a cue's review
700
746
  * is the chip.
701
747
  *
748
+ * 🚧 An optional `trigger` in-port names the boundary trigger the scene cue is for (absent or blank: `judged`); the scenes routine passes the one that fired at `at`.
749
+ *
702
750
  * ⚠ Not a scene write (a person's *Start scene here*) and not a state proposal.
703
751
  * @experimental
704
752
  * @ruling R-i (2026-10-24)
@@ -734,10 +782,16 @@ export const proposeSceneCue = pin(describeOutletDefinition({
734
782
  * `person` is: wired from a script's output.
735
783
  */
736
784
  at: S.json,
737
- /** The channel lane `at` is on, any spelling (canonicalised); absent or blank: `main`. */
785
+ /** The channel lane `at` is on, any spelling (canonicalised); absent or blank: the lane the line `at` is on. */
738
786
  channel: S.text,
739
787
  /** Why, in the model's few words β€” the chip's reason ("the party left the inn"). */
740
788
  reason: S.text,
789
+ /**
790
+ * 🚧 The boundary trigger the scene cue is for. Absent or blank: `judged` (the judged scene check's, as before).
791
+ * The scenes routine (`core:spec/scene-boundaries`) passes the boundary trigger that fired at `at`; a scene cue already at
792
+ * that line for that boundary trigger (a time action's marker) is the one offered or placed.
793
+ */
794
+ trigger: S.text,
741
795
  },
742
796
  out: {
743
797
  main: S.writeResult,
@@ -746,6 +800,77 @@ export const proposeSceneCue = pin(describeOutletDefinition({
746
800
  },
747
801
  },
748
802
  }));
803
+ /**
804
+ * 🚧 **Summarize a finished scene** β€” the scene summaries routine's outlet
805
+ * (every name here is provisional): starts the session genre's **own** scene
806
+ * summarizer (its summarize-scene pipeline, never a second prompt) for one
807
+ * finished scene, in the background, and returns at once: the summary's model
808
+ * calls are never awaited by the routine's run.
809
+ *
810
+ * Under the routine's **Full** the result is saved by itself (the summary, and
811
+ * the model's name only while the scene still has its automatic name; the known
812
+ * cast stored at the scene's close is left as it is) and marked as saved by the
813
+ * routine; a summary saved this way never settles the story. Under **Review**
814
+ * it waits for a person in the review window, as a pressed *Summarize* does.
815
+ * Its model calls queue as a routine's, after people's replies. The host half
816
+ * is the app's.
817
+ *
818
+ * ⚠ Not `scenes:process` (a person's press) and not *Compile to Entry*.
819
+ * @experimental
820
+ */
821
+ export const summarizeFinishedScene = pin(describeOutletDefinition({
822
+ id: 'core:outlet/summarize-finished-scene@1',
823
+ i18n: { name: { en: 'Summarize a finished scene' } },
824
+ effects: 'write',
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'] },
829
+ timeoutMs: 5000,
830
+ ports: {
831
+ in: {
832
+ /** The scene to summarize: a scene id, as `core:query/scene-summary-due@1` names it. Absent or null: nothing is due, and nothing starts. */
833
+ scene: S.json,
834
+ /** The routine inlet's `routine` port (the firing): its `mode` decides what the summary becomes. */
835
+ routine: S.json,
836
+ },
837
+ out: { main: S.writeResult },
838
+ },
839
+ }));
840
+ /**
841
+ * 🚧 **Note it in the scene** (β˜…S4, owner 2026-11-10): adds a note to a scene β€” a fact that
842
+ * isn't a story line (a death, a treaty, a clock jump). Notes reach the scene's summary and
843
+ * Compile. Never writes history or messages. Refused when the genre writes no scenes, when the
844
+ * scene is another session's, or when no scene is open.
845
+ *
846
+ * Scenes first: a pipeline puts story events into scenes β€” this outlet, or a story line through
847
+ * `create-message@1` β€” and a person's Compile files a day's scenes under that day's one history
848
+ * entry. A history write through `create-lore-entry@1` is the second choice.
849
+ *
850
+ * `text` is required. `scene` names a scene by id; absent, the note goes to the run's lane's open
851
+ * scene. `sources` (optional) are the messages the note was written from, the shape the lore
852
+ * writes take. "The genre writes no scenes" is `writes.scenes: false`. The host half is the app's.
853
+ * @experimental
854
+ * @ruling β˜…S4 (2026-11-10)
855
+ */
856
+ export const noteScene = pin(describeOutletDefinition({
857
+ id: 'core:outlet/note-scene@1',
858
+ i18n: { name: { en: 'Note it in the scene' } },
859
+ effects: 'write',
860
+ review: { fields: ['text'] },
861
+ timeoutMs: 10000,
862
+ ports: {
863
+ in: {
864
+ /** The note, a sentence or two. Required. */
865
+ text: S.text,
866
+ /** A scene id. Optional; absent, the run's lane's open scene. `json`, as `propose-scene-cue@1`'s `at` is. */
867
+ scene: S.json,
868
+ /** 🚧 The messages the note was written from β€” as the lore writes take them. Optional. */
869
+ sources: S.loreSources,
870
+ },
871
+ out: { main: S.writeResult },
872
+ },
873
+ }));
749
874
  /**
750
875
  * 🚧 **Configure a stat** for one owner in this session (owner ruling
751
876
  * 2026-10-15): the pipeline door to an owner's **stat configuration** β€” the
@@ -1150,6 +1275,12 @@ export const showSprite = pin(describeOutletDefinition({
1150
1275
  * it carries the card's visibility and stays out of the card's gallery like
1151
1276
  * every sprite. Refused unless the run's person owns the card or is an admin.
1152
1277
  *
1278
+ * On a run pressed on a **cast member** the host files the pictures as the
1279
+ * member's own sprites (the files become the member's lorebook owner's, the
1280
+ * lorebook as provenance) and ignores nothing silently: a wired `characterId`
1281
+ * must be empty on such a run. Refused unless the run's person may edit the
1282
+ * member's lorebook. The card rule above stays as written.
1283
+ *
1153
1284
  * Causes `core:event/sprites-attached@1` when at least one row was written.
1154
1285
  * About a card, not a session: it writes no session row.
1155
1286
  * @experimental
@@ -1199,6 +1330,12 @@ export const attachSprite = pin(describeOutletDefinition({
1199
1330
  * key it was drawn for (`null` for surplus the host kept unkeyed). Refused
1200
1331
  * unless the run's person owns the card or is an admin.
1201
1332
  *
1333
+ * On a run pressed on a **cast member** the host files the pictures as the
1334
+ * member's own gallery pictures (the files become the member's lorebook
1335
+ * owner's, the lorebook as provenance) and ignores nothing silently: a wired
1336
+ * `characterId` must be empty on such a run. Refused unless the run's person
1337
+ * may edit the member's lorebook. The card rule above stays as written.
1338
+ *
1202
1339
  * Causes `core:event/media-offered@1` when at least one picture was placed.
1203
1340
  * About a card, not a session: it writes no session row.
1204
1341
  * @experimental
@@ -1308,7 +1445,7 @@ export const advanceStoryClock = pin(describeOutletDefinition({
1308
1445
  * 🚧 **Why the clock moves** (live scenes Β§15 G4, 2026-10-13),
1309
1446
  * a literal: `'action'` β€” a person's press (*Time passes…*);
1310
1447
  * `'keeper'` β€” the state-keeper's move under Trust the
1311
- * narrator; `'tick'` β€” a reply's fixed tick. An action's and
1448
+ * narrator; `'tick'` β€” a fixed step, a round's. An action's and
1312
1449
  * the keeper's move are **time actions** the boundary watcher
1313
1450
  * may begin a new scene at; a tick never is. Unwired reads as
1314
1451
  * `'action'`.
@@ -1427,7 +1564,8 @@ export const answerForm = pin(describeOutletDefinition({
1427
1564
  * 🚧 Speech (seam S3, 2026-10-28): `meta` is the `SpokenMeta` record
1428
1565
  * `core:oracle/speak@1` publishes, kept in the line's metadata for the swipe
1429
1566
  * (`spoken`) beside the audio part; `replace` swaps the line's earlier spoken
1430
- * audio rather than adding a second part β€” what re-speaking a line does.
1567
+ * files for the whole new list rather than adding to them β€” what re-speaking
1568
+ * a line does.
1431
1569
  * @experimental
1432
1570
  */
1433
1571
  export const attachAudio = pin(describeOutletDefinition({
@@ -1457,6 +1595,12 @@ export const attachAudio = pin(describeOutletDefinition({
1457
1595
  in: {
1458
1596
  target: S.rowIds,
1459
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,
1460
1604
  /** 🚧 `SpokenMeta` β€” absent writes the audio part alone. */
1461
1605
  meta: S.spokenMeta,
1462
1606
  },
@@ -1473,14 +1617,12 @@ export const attachAudio = pin(describeOutletDefinition({
1473
1617
  * written that *which kind of entry comes from the pipeline that ran*. It did
1474
1618
  * not: it wrote world lore whatever ran, because nothing on this declaration
1475
1619
  * could say otherwise. `entryType` is that sentence made true β€” a declared
1476
- * entry type id (`core:entry/world-lore`, `core:entry/history`,
1477
- * `core:entry/location`), bare, the way `core:query/lorebook-entries@1` spells
1620
+ * entry type id (`core:entry/world-lore`, `core:entry/location`), bare, the way `core:query/lorebook-entries@1` spells
1478
1621
  * them; the version is the row's own column.
1479
1622
  *
1480
1623
  * A **param** and not an in-port, because the kind of thing a pipeline writes
1481
- * is a fact about the pipeline rather than about the turn β€” a summarizer
1482
- * writes history every time it runs, a room-builder writes locations every
1483
- * time β€” and a param is what a preset can set per session without the spec
1624
+ * is a fact about the pipeline rather than about the turn β€” a room-builder
1625
+ * writes locations every time it runs β€” and a param is what a preset can set per session without the spec
1484
1626
  * being rewired. An unknown id is refused at the commit with a sentence
1485
1627
  * naming the declared types, never coerced to world lore: a typo that silently
1486
1628
  * files rooms as world lore is the defect this replaces.
@@ -1488,6 +1630,22 @@ export const attachAudio = pin(describeOutletDefinition({
1488
1630
  * Default world lore, the agnostic shape, so every spec written before this
1489
1631
  * keeps doing exactly what it did.
1490
1632
  *
1633
+ * ## History is compiled, not written (2026-11-10)
1634
+ *
1635
+ * History is compiled, not written. Put events into scenes (`note-scene@1`, or a story line); a person's Compile files them under the day's one entry. A history write here is the second choice: it files onto its day's entry (the session's story day when no date is given), appending a paragraph. The packager warns `W_WRITES_HISTORY` on such a write; a `summarize-request@1` spec is exempt, its save being previewed.
1636
+ *
1637
+ * ## Where the write lands
1638
+ *
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.
1648
+ *
1491
1649
  * ## `links`, or a second write
1492
1650
  *
1493
1651
  * Linking a new entry takes one of two shapes, and both exist on purpose.
@@ -1550,7 +1708,30 @@ export const createLoreEntry = pin(describeOutletDefinition({
1550
1708
  default: 'core:entry/world-lore',
1551
1709
  quick: true,
1552
1710
  label: { en: 'Kind of entry' },
1553
- description: 'Which kind of lorebook entry this pipeline writes β€” world lore, history, a location. Leave it as world lore for anything that is simply about the world.',
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.',
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
+ },
1554
1735
  },
1555
1736
  },
1556
1737
  },
@@ -1573,11 +1754,24 @@ export const createLoreEntry = pin(describeOutletDefinition({
1573
1754
  /**
1574
1755
  * 🚧 The messages this write was written from. Pass it when the write is a
1575
1756
  * summary of the story; leave it off when it is a change in it (pass 6). Present, the write is committed: the
1576
- * session's settle line moves to the newest of them.
1757
+ * session's settle line moves to the newest of them (not for a session whose scenes end by themselves: its write waits in the own book and Apply settles).
1577
1758
  */
1578
1759
  sources: S.loreSources,
1579
1760
  /** 🚧 A `LoreMatch` β€” how to find the entry this would otherwise create. */
1580
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,
1581
1775
  /**
1582
1776
  * 🚧 The cast member this entry is filed under β€” a `character:<id>` reference, resolved to that
1583
1777
  * character's cast member in the book the entry lands in (the entry type's `anchor` role).
@@ -1607,8 +1801,16 @@ export const createLoreEntry = pin(describeOutletDefinition({
1607
1801
  *
1608
1802
  * How the change lands is the host's: on the session's line, the way the
1609
1803
  * lorebook's own editor writes an edit there (an amendment where the line
1610
- * amends). ⚠ It causes no event yet (🚧): `lore-entry-created` means a new
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
1808
+ * carries `route: "own-book"` and the own book's `lorebookId`. `entry` names an entry the session reads, in the lorebook or
1809
+ * in its own book.
1810
+ * ⚠ It causes no event yet (🚧): `lore-entry-created` means a new
1611
1811
  * row, and a subscriber that needs edits waits for one of its own.
1812
+ *
1813
+ * 🚧 A history entry's re-date (its `year`, `month` or `day` fields) is checked as a person's re-date is: refused, with a sentence, onto a date its line already has a history entry for, or onto a day the line shares with its parent (change that day as an amendment instead).
1612
1814
  * @internal
1613
1815
  */
1614
1816
  export const updateLoreEntry = pin(describeOutletDefinition({
@@ -1634,7 +1836,7 @@ export const updateLoreEntry = pin(describeOutletDefinition({
1634
1836
  /**
1635
1837
  * 🚧 The messages this write was written from. Pass it when the write is a
1636
1838
  * summary of the story; leave it off when it is a change in it (pass 6). Present, the write is committed: the
1637
- * session's settle line moves to the newest of them.
1839
+ * session's settle line moves to the newest of them (not for a session whose scenes end by themselves: its write waits in the own book and Apply settles).
1638
1840
  */
1639
1841
  sources: S.loreSources,
1640
1842
  },
@@ -1665,10 +1867,22 @@ export const updateLoreEntry = pin(describeOutletDefinition({
1665
1867
  * entries answer to β€” the second never picks one, because picking would link
1666
1868
  * the wrong room silently and a duplicate name is the author's to resolve.
1667
1869
  *
1668
- * One lorebook, both ends. An edge whose ends live in two books belongs to
1669
- * neither and the row carries one `lorebook_id`, so a cross-book link is
1670
- * refused rather than repaired β€” the same rule the socket handlers hold, held
1671
- * again here because a pipeline does not come through them.
1870
+ * One lorebook, both ends β€” except on the own-book route. An edge whose ends
1871
+ * live in two books belongs to neither and the row carries one `lorebook_id`, so
1872
+ * where the write lands in the lorebook the session reads (**Full** for a session
1873
+ * whose scenes do not end by themselves, or a session whose lorebook is its own book alone) a cross-book link is refused rather than
1874
+ * repaired β€” the same rule the socket handlers hold, held again here because a
1875
+ * pipeline does not come through them. A session that reads a lorebook it may not
1876
+ * write (**Review changes**, **Off**, or a book someone else owns), or whose scenes
1877
+ * end by themselves (the result then carries `route: "own-book"` and the own
1878
+ * book's `lorebookId`, whatever the write mode), keeps the row in
1879
+ * its own book, and an end may be an entry of the own book or an entry of the
1880
+ * lorebook as the session reads it (entries only, never a cast member): an id is
1881
+ * found in the own book, else in the lorebook; a name is looked up in the own book
1882
+ * first, and only when none answers there in the lorebook (two answers refuse
1883
+ * within one book, never across). A link either book already holds is not written
1884
+ * again (`written: false`); an id in neither book is refused. The row is the
1885
+ * session's own: it reaches no other session until applied.
1672
1886
  *
1673
1887
  * ## After a create
1674
1888
  *
@@ -1777,7 +1991,7 @@ export const linkLoreEntries = pin(describeOutletDefinition({
1777
1991
  /**
1778
1992
  * 🚧 The messages this write was written from. Pass it when the write is a
1779
1993
  * summary of the story; leave it off when it is a change in it (pass 6). Present, the write is committed: the
1780
- * session's settle line moves to the newest of them.
1994
+ * session's settle line moves to the newest of them (not for a session whose scenes end by themselves: its write waits in the own book and Apply settles).
1781
1995
  */
1782
1996
  sources: S.loreSources,
1783
1997
  },
@@ -1808,7 +2022,7 @@ export const graphProposal = pin(describeOutletDefinition({
1808
2022
  /**
1809
2023
  * 🚧 The messages this write was written from. Pass it when the write is a
1810
2024
  * summary of the story; leave it off when it is a change in it (pass 6). Present, the write is committed: the
1811
- * session's settle line moves to the newest of them.
2025
+ * session's settle line moves to the newest of them (not for a session whose scenes end by themselves: its write waits in the own book and Apply settles).
1812
2026
  */
1813
2027
  sources: S.loreSources,
1814
2028
  },
@@ -1848,12 +2062,16 @@ export const createCharacter = pin(describeOutletDefinition({
1848
2062
  * Change a character: edit the text fields of a character the acting person
1849
2063
  * may write to.
1850
2064
  *
1851
- * Takes `characterId` and `changes` β€” an object of the card's text fields
1852
- * (name, description, personality, scenario, first_mes, mes_example). Writes
1853
- * those fields on that character, and nothing else; the fields it replaced are
1854
- * kept so Back can restore them. The app judges the person (write rights on
1855
- * the character) and their library write mode (Full, Review or Off); a genre
1856
- * must declare `writes.library.characters`.
2065
+ * Takes `characterId` and `changes` β€” an object of character profile names:
2066
+ * `name`, `description`, `personality`, `scenario`, `greetings` (`{ text,
2067
+ * groupOnly? }[]` β€” the whole list, replacing the card's) and
2068
+ * `exampleDialogues` (`string[]`). The change writes the card's **current
2069
+ * version**, those fields and nothing else; the fields it replaced are kept so
2070
+ * Back can restore them. `first_mes` and `mes_example` are no longer accepted
2071
+ * (owner 2026-11-05: new names now, old removed); any other key is refused.
2072
+ * The app judges the person (write rights on the character) and their library
2073
+ * write mode (Full, Review or Off); a genre must declare
2074
+ * `writes.library.characters`.
1857
2075
  * @internal
1858
2076
  */
1859
2077
  export const updateCharacter = pin(describeOutletDefinition({
@@ -1868,6 +2086,140 @@ export const updateCharacter = pin(describeOutletDefinition({
1868
2086
  out: { main: S.writeResult, characterId: S.writeResult },
1869
2087
  },
1870
2088
  }));
2089
+ /**
2090
+ * 🚧 Change a cast member of the session β€” one or more fields of their
2091
+ * character profile.
2092
+ *
2093
+ * `member` is `seated-member:<castMemberId>`, `player-seat:<seatId>` or a cast
2094
+ * member id, as `core:query/cast-member@1` takes it. `changes` is an object of
2095
+ * character profile fields (`CHARACTER_PROFILE_FIELDS`), each a new value in
2096
+ * the field's own shape or `{ follow: true }` (read that field from the
2097
+ * member's card again; refused for a card-less member). Other keys are
2098
+ * refused, never dropped.
2099
+ *
2100
+ * 🚧 `changes` may also carry `nodeState` β€” one of `CAST_STATE_WORDS` (`active`, `deceased`, `missing`, `departed`; SDK `ties.ts`) β€” and `nodeVisibility` β€” `normal`, `legendary` or `hidden` β€” beside the profile fields: the member's state and visibility on the graph. Checked against those words (another word is refused, never dropped), and dated at the session's story time and tied to the turn like the profile fields.
2101
+ *
2102
+ * How it lands is the host's: one story write β€” a cast version dated at the
2103
+ * session's story time and tied to the turn, so Back takes it with the turn; a
2104
+ * second change in the same turn and moment updates that version (coalesces).
2105
+ * The genre's `writes.lore` and the session's lore write mode decide where:
2106
+ * the book's line, or under Review / Off the session's own notes (an overlay
2107
+ * of the member).
2108
+ *
2109
+ * A genre must place it: the Dungeon Crawler places it to mark the fallen
2110
+ * deceased (2026-11-10). ⚠ It causes no event yet
2111
+ * (🚧). `castVersionId` is the cast version written.
2112
+ * @experimental
2113
+ */
2114
+ export const updateCastMember = pin(describeOutletDefinition({
2115
+ id: 'core:outlet/update-cast-member@1',
2116
+ i18n: { name: { en: 'Change a cast member' } },
2117
+ effects: 'write',
2118
+ /**
2119
+ * What the change says may be retyped; which member it changes may not
2120
+ * β€” that is the run's identity, the rule `update-lore-entry@1` states.
2121
+ */
2122
+ review: { fields: ['changes'] },
2123
+ timeoutMs: 10000,
2124
+ ports: {
2125
+ in: {
2126
+ /** The member to change: `seated-member:<id>`, `player-seat:<id>`, or a cast member id. */
2127
+ member: S.json,
2128
+ /** `{ [profile field]: value | { follow: true } }`, plus `nodeState` / `nodeVisibility` (see above). */
2129
+ changes: S.json,
2130
+ },
2131
+ out: {
2132
+ main: S.writeResult,
2133
+ /** The cast version written. */
2134
+ castVersionId: S.writeResult,
2135
+ },
2136
+ },
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
+ }));
1871
2223
  /**
1872
2224
  * Make a lorebook: write one lorebook into the acting person's library.
1873
2225
  *
@@ -1891,27 +2243,4 @@ export const createLorebook = pin(describeOutletDefinition({
1891
2243
  out: { main: S.writeResult, lorebookId: S.writeResult },
1892
2244
  },
1893
2245
  }));
1894
- /**
1895
- * Read a lorebook into a session: attach an existing lorebook to a session.
1896
- *
1897
- * Takes `lorebookId` and, optionally, `sessionId` (absent: the run's own
1898
- * session). Writes the session's lorebook; what it replaced is kept so Back
1899
- * can restore it. The app judges the person (read rights on the book and write
1900
- * rights on the session) and their library write mode (Full, Review or Off).
1901
- * A genre must declare `writes.library.lorebooks`, and
1902
- * `writes.library.sessions` to name a session other than the run's.
1903
- * @internal
1904
- */
1905
- export const attachLorebook = pin(describeOutletDefinition({
1906
- id: 'core:outlet/attach-lorebook@1',
1907
- i18n: { name: { en: 'Read a lorebook into a session' } },
1908
- effects: 'write',
1909
- /** R-15: a reference, not a value to retype: a reviewer who disagrees refuses the write. */
1910
- review: { fields: [] },
1911
- timeoutMs: 10000,
1912
- ports: {
1913
- in: { lorebookId: S.json, sessionId: S.json },
1914
- out: { main: S.writeResult },
1915
- },
1916
- }));
1917
2246
  //# sourceMappingURL=outlets.js.map