@serene-pub/contracts 0.6.0-pr-7 → 0.6.0-pr-8

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)
@@ -738,6 +786,12 @@ export const proposeSceneCue = pin(describeOutletDefinition({
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,74 @@ 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
+ timeoutMs: 5000,
827
+ ports: {
828
+ in: {
829
+ /** 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. */
830
+ scene: S.json,
831
+ /** The routine inlet's `routine` port (the firing): its `mode` decides what the summary becomes. */
832
+ routine: S.json,
833
+ },
834
+ out: { main: S.writeResult },
835
+ },
836
+ }));
837
+ /**
838
+ * 🚧 **Note it in the scene** (★S4, owner 2026-11-10): adds a note to a scene — a fact that
839
+ * isn't a story line (a death, a treaty, a clock jump). Notes reach the scene's summary and
840
+ * Compile. Never writes history or messages. Refused when the genre writes no scenes, when the
841
+ * scene is another session's, or when no scene is open.
842
+ *
843
+ * Scenes first: a pipeline puts story events into scenes — this outlet, or a story line through
844
+ * `create-message@1` — and a person's Compile files a day's scenes under that day's one history
845
+ * entry. A history write through `create-lore-entry@1` is the second choice.
846
+ *
847
+ * `text` is required. `scene` names a scene by id; absent, the note goes to the run's lane's open
848
+ * scene. `sources` (optional) are the messages the note was written from, the shape the lore
849
+ * writes take. "The genre writes no scenes" is `writes.scenes: false`. The host half is the app's.
850
+ * @experimental
851
+ * @ruling ★S4 (2026-11-10)
852
+ */
853
+ export const noteScene = pin(describeOutletDefinition({
854
+ id: 'core:outlet/note-scene@1',
855
+ i18n: { name: { en: 'Note it in the scene' } },
856
+ effects: 'write',
857
+ review: { fields: ['text'] },
858
+ timeoutMs: 10000,
859
+ ports: {
860
+ in: {
861
+ /** The note, a sentence or two. Required. */
862
+ text: S.text,
863
+ /** A scene id. Optional; absent, the run's lane's open scene. `json`, as `propose-scene-cue@1`'s `at` is. */
864
+ scene: S.json,
865
+ /** 🚧 The messages the note was written from — as the lore writes take them. Optional. */
866
+ sources: S.loreSources,
867
+ },
868
+ out: { main: S.writeResult },
869
+ },
870
+ }));
749
871
  /**
750
872
  * 🚧 **Configure a stat** for one owner in this session (owner ruling
751
873
  * 2026-10-15): the pipeline door to an owner's **stat configuration** — the
@@ -1150,6 +1272,12 @@ export const showSprite = pin(describeOutletDefinition({
1150
1272
  * it carries the card's visibility and stays out of the card's gallery like
1151
1273
  * every sprite. Refused unless the run's person owns the card or is an admin.
1152
1274
  *
1275
+ * On a run pressed on a **cast member** the host files the pictures as the
1276
+ * member's own sprites (the files become the member's lorebook owner's, the
1277
+ * lorebook as provenance) and ignores nothing silently: a wired `characterId`
1278
+ * must be empty on such a run. Refused unless the run's person may edit the
1279
+ * member's lorebook. The card rule above stays as written.
1280
+ *
1153
1281
  * Causes `core:event/sprites-attached@1` when at least one row was written.
1154
1282
  * About a card, not a session: it writes no session row.
1155
1283
  * @experimental
@@ -1199,6 +1327,12 @@ export const attachSprite = pin(describeOutletDefinition({
1199
1327
  * key it was drawn for (`null` for surplus the host kept unkeyed). Refused
1200
1328
  * unless the run's person owns the card or is an admin.
1201
1329
  *
1330
+ * On a run pressed on a **cast member** the host files the pictures as the
1331
+ * member's own gallery pictures (the files become the member's lorebook
1332
+ * owner's, the lorebook as provenance) and ignores nothing silently: a wired
1333
+ * `characterId` must be empty on such a run. Refused unless the run's person
1334
+ * may edit the member's lorebook. The card rule above stays as written.
1335
+ *
1202
1336
  * Causes `core:event/media-offered@1` when at least one picture was placed.
1203
1337
  * About a card, not a session: it writes no session row.
1204
1338
  * @experimental
@@ -1308,7 +1442,7 @@ export const advanceStoryClock = pin(describeOutletDefinition({
1308
1442
  * 🚧 **Why the clock moves** (live scenes §15 G4, 2026-10-13),
1309
1443
  * a literal: `'action'` — a person's press (*Time passes…*);
1310
1444
  * `'keeper'` — the state-keeper's move under Trust the
1311
- * narrator; `'tick'` — a reply's fixed tick. An action's and
1445
+ * narrator; `'tick'` — a fixed step, a round's. An action's and
1312
1446
  * the keeper's move are **time actions** the boundary watcher
1313
1447
  * may begin a new scene at; a tick never is. Unwired reads as
1314
1448
  * `'action'`.
@@ -1473,14 +1607,12 @@ export const attachAudio = pin(describeOutletDefinition({
1473
1607
  * written that *which kind of entry comes from the pipeline that ran*. It did
1474
1608
  * not: it wrote world lore whatever ran, because nothing on this declaration
1475
1609
  * 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
1610
+ * entry type id (`core:entry/world-lore`, `core:entry/location`), bare, the way `core:query/lorebook-entries@1` spells
1478
1611
  * them; the version is the row's own column.
1479
1612
  *
1480
1613
  * 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
1614
+ * is a fact about the pipeline rather than about the turn — a room-builder
1615
+ * writes locations every time it runs — and a param is what a preset can set per session without the spec
1484
1616
  * being rewired. An unknown id is refused at the commit with a sentence
1485
1617
  * naming the declared types, never coerced to world lore: a typo that silently
1486
1618
  * files rooms as world lore is the defect this replaces.
@@ -1488,6 +1620,14 @@ export const attachAudio = pin(describeOutletDefinition({
1488
1620
  * Default world lore, the agnostic shape, so every spec written before this
1489
1621
  * keeps doing exactly what it did.
1490
1622
  *
1623
+ * ## History is compiled, not written (2026-11-10)
1624
+ *
1625
+ * 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.
1626
+ *
1627
+ * ## Where the write lands
1628
+ *
1629
+ * For a session whose scenes end by themselves (it runs the *Find where scenes begin* routine, not switched Off, and its scene mode is Automatic) a new entry, a room or a history day is written to the session's own book **whatever the lorebook's write mode (Full too)**, and the result carries `route: "own-book"` and the own book's `lorebookId`. A history write there files onto the day's one entry of the own book, merged onto the lorebook's day at Apply. Any other session writes as before: to the lorebook under Full, to its own book under Review changes, Off or a book someone else owns.
1630
+ *
1491
1631
  * ## `links`, or a second write
1492
1632
  *
1493
1633
  * Linking a new entry takes one of two shapes, and both exist on purpose.
@@ -1550,7 +1690,7 @@ export const createLoreEntry = pin(describeOutletDefinition({
1550
1690
  default: 'core:entry/world-lore',
1551
1691
  quick: true,
1552
1692
  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.',
1693
+ 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.',
1554
1694
  },
1555
1695
  },
1556
1696
  },
@@ -1573,7 +1713,7 @@ export const createLoreEntry = pin(describeOutletDefinition({
1573
1713
  /**
1574
1714
  * 🚧 The messages this write was written from. Pass it when the write is a
1575
1715
  * 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.
1716
+ * 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
1717
  */
1578
1718
  sources: S.loreSources,
1579
1719
  /** 🚧 A `LoreMatch` — how to find the entry this would otherwise create. */
@@ -1607,8 +1747,16 @@ export const createLoreEntry = pin(describeOutletDefinition({
1607
1747
  *
1608
1748
  * How the change lands is the host's: on the session's line, the way the
1609
1749
  * 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
1750
+ * amends). A change to an entry of the lorebook the session reads is kept in the
1751
+ * session's own book as a held change whatever the lorebook's write mode (**Full**
1752
+ * too), and reaches the lorebook only when it is applied; a change to an entry of the own
1753
+ * book is written there, and the result of a session whose scenes end by themselves
1754
+ * carries `route: "own-book"` and the own book's `lorebookId`. `entry` names an entry the session reads, in the lorebook or
1755
+ * in its own book.
1756
+ * ⚠ It causes no event yet (🚧): `lore-entry-created` means a new
1611
1757
  * row, and a subscriber that needs edits waits for one of its own.
1758
+ *
1759
+ * 🚧 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
1760
  * @internal
1613
1761
  */
1614
1762
  export const updateLoreEntry = pin(describeOutletDefinition({
@@ -1634,7 +1782,7 @@ export const updateLoreEntry = pin(describeOutletDefinition({
1634
1782
  /**
1635
1783
  * 🚧 The messages this write was written from. Pass it when the write is a
1636
1784
  * 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.
1785
+ * 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
1786
  */
1639
1787
  sources: S.loreSources,
1640
1788
  },
@@ -1665,10 +1813,22 @@ export const updateLoreEntry = pin(describeOutletDefinition({
1665
1813
  * entries answer to — the second never picks one, because picking would link
1666
1814
  * the wrong room silently and a duplicate name is the author's to resolve.
1667
1815
  *
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.
1816
+ * One lorebook, both ends — except on the own-book route. An edge whose ends
1817
+ * live in two books belongs to neither and the row carries one `lorebook_id`, so
1818
+ * where the write lands in the lorebook the session reads (**Full** for a session
1819
+ * 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
1820
+ * repaired — the same rule the socket handlers hold, held again here because a
1821
+ * pipeline does not come through them. A session that reads a lorebook it may not
1822
+ * write (**Review changes**, **Off**, or a book someone else owns), or whose scenes
1823
+ * end by themselves (the result then carries `route: "own-book"` and the own
1824
+ * book's `lorebookId`, whatever the write mode), keeps the row in
1825
+ * its own book, and an end may be an entry of the own book or an entry of the
1826
+ * lorebook as the session reads it (entries only, never a cast member): an id is
1827
+ * found in the own book, else in the lorebook; a name is looked up in the own book
1828
+ * first, and only when none answers there in the lorebook (two answers refuse
1829
+ * within one book, never across). A link either book already holds is not written
1830
+ * again (`written: false`); an id in neither book is refused. The row is the
1831
+ * session's own: it reaches no other session until applied.
1672
1832
  *
1673
1833
  * ## After a create
1674
1834
  *
@@ -1777,7 +1937,7 @@ export const linkLoreEntries = pin(describeOutletDefinition({
1777
1937
  /**
1778
1938
  * 🚧 The messages this write was written from. Pass it when the write is a
1779
1939
  * 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.
1940
+ * 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
1941
  */
1782
1942
  sources: S.loreSources,
1783
1943
  },
@@ -1808,7 +1968,7 @@ export const graphProposal = pin(describeOutletDefinition({
1808
1968
  /**
1809
1969
  * 🚧 The messages this write was written from. Pass it when the write is a
1810
1970
  * 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.
1971
+ * 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
1972
  */
1813
1973
  sources: S.loreSources,
1814
1974
  },
@@ -1848,12 +2008,16 @@ export const createCharacter = pin(describeOutletDefinition({
1848
2008
  * Change a character: edit the text fields of a character the acting person
1849
2009
  * may write to.
1850
2010
  *
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`.
2011
+ * Takes `characterId` and `changes` — an object of character profile names:
2012
+ * `name`, `description`, `personality`, `scenario`, `greetings` (`{ text,
2013
+ * groupOnly? }[]` — the whole list, replacing the card's) and
2014
+ * `exampleDialogues` (`string[]`). The change writes the card's **current
2015
+ * version**, those fields and nothing else; the fields it replaced are kept so
2016
+ * Back can restore them. `first_mes` and `mes_example` are no longer accepted
2017
+ * (owner 2026-11-05: new names now, old removed); any other key is refused.
2018
+ * The app judges the person (write rights on the character) and their library
2019
+ * write mode (Full, Review or Off); a genre must declare
2020
+ * `writes.library.characters`.
1857
2021
  * @internal
1858
2022
  */
1859
2023
  export const updateCharacter = pin(describeOutletDefinition({
@@ -1868,6 +2032,55 @@ export const updateCharacter = pin(describeOutletDefinition({
1868
2032
  out: { main: S.writeResult, characterId: S.writeResult },
1869
2033
  },
1870
2034
  }));
2035
+ /**
2036
+ * 🚧 Change a cast member of the session — one or more fields of their
2037
+ * character profile.
2038
+ *
2039
+ * `member` is `seated-member:<castMemberId>`, `player-seat:<seatId>` or a cast
2040
+ * member id, as `core:query/cast-member@1` takes it. `changes` is an object of
2041
+ * character profile fields (`CHARACTER_PROFILE_FIELDS`), each a new value in
2042
+ * the field's own shape or `{ follow: true }` (read that field from the
2043
+ * member's card again; refused for a card-less member). Other keys are
2044
+ * refused, never dropped.
2045
+ *
2046
+ * 🚧 `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.
2047
+ *
2048
+ * How it lands is the host's: one story write — a cast version dated at the
2049
+ * session's story time and tied to the turn, so Back takes it with the turn; a
2050
+ * second change in the same turn and moment updates that version (coalesces).
2051
+ * The genre's `writes.lore` and the session's lore write mode decide where:
2052
+ * the book's line, or under Review / Off the session's own notes (an overlay
2053
+ * of the member).
2054
+ *
2055
+ * A genre must place it: the Dungeon Crawler places it to mark the fallen
2056
+ * deceased (2026-11-10). ⚠ It causes no event yet
2057
+ * (🚧). `castVersionId` is the cast version written.
2058
+ * @experimental
2059
+ */
2060
+ export const updateCastMember = pin(describeOutletDefinition({
2061
+ id: 'core:outlet/update-cast-member@1',
2062
+ i18n: { name: { en: 'Change a cast member' } },
2063
+ effects: 'write',
2064
+ /**
2065
+ * What the change says may be retyped; which member it changes may not
2066
+ * — that is the run's identity, the rule `update-lore-entry@1` states.
2067
+ */
2068
+ review: { fields: ['changes'] },
2069
+ timeoutMs: 10000,
2070
+ ports: {
2071
+ in: {
2072
+ /** The member to change: `seated-member:<id>`, `player-seat:<id>`, or a cast member id. */
2073
+ member: S.json,
2074
+ /** `{ [profile field]: value | { follow: true } }`, plus `nodeState` / `nodeVisibility` (see above). */
2075
+ changes: S.json,
2076
+ },
2077
+ out: {
2078
+ main: S.writeResult,
2079
+ /** The cast version written. */
2080
+ castVersionId: S.writeResult,
2081
+ },
2082
+ },
2083
+ }));
1871
2084
  /**
1872
2085
  * Make a lorebook: write one lorebook into the acting person's library.
1873
2086
  *
@@ -1891,27 +2104,4 @@ export const createLorebook = pin(describeOutletDefinition({
1891
2104
  out: { main: S.writeResult, lorebookId: S.writeResult },
1892
2105
  },
1893
2106
  }));
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
2107
  //# sourceMappingURL=outlets.js.map
package/dist/queries.d.ts CHANGED
@@ -1368,6 +1368,217 @@ export declare const castPresences: import("@serene-pub/sdk").Pinned<import("@se
1368
1368
  kind: 'query';
1369
1369
  slots?: Record<string, import("@serene-pub/sdk").SlotDecl> | undefined;
1370
1370
  }>;
1371
+ /**
1372
+ * 🚧 **Minutes a round is worth** — the session's round worth, as a whole
1373
+ * number and as a clock step.
1374
+ *
1375
+ * It reads the session's `roundWorth` genre field from the settings document
1376
+ * (the cascade applied: the session's value, else its preset's, else the
1377
+ * genre's, else the field's default). `minutes` is a whole number ≥ 0; `step`
1378
+ * is `{ by: minutes, unit: 'minutes' }`, exactly what `core:task/clock-step@1`'s
1379
+ * `step` in-port takes; `main` is `{ minutes, step }`. All of it is 0 when the
1380
+ * genre places no `roundWorth` field (it has not opted in) or the session sets
1381
+ * 0 (off).
1382
+ *
1383
+ * It never reads or moves the clock and does not say whether one is set: gate
1384
+ * on `core:query/cast-presences@1`'s `at` for that.
1385
+ *
1386
+ * ⚠ Not the Dungeon Crawler Planner's round minutes (the time one round took,
1387
+ * judged), and not `core:task/clock-step@1`.
1388
+ * @experimental
1389
+ */
1390
+ export declare const roundWorth: import("@serene-pub/sdk").Pinned<import("@serene-pub/sdk").Descriptor<{
1391
+ /** `{ minutes, step }`. */
1392
+ main: string;
1393
+ /** The round worth as a whole number of minutes, ≥ 0. */
1394
+ minutes: string;
1395
+ /** `{ by: minutes, unit: 'minutes' }`: what `clock-step@1`'s `step` in-port takes. */
1396
+ step: string;
1397
+ }, {
1398
+ scope: string;
1399
+ }, "core:query/round-worth@1"> & {
1400
+ kind: 'query';
1401
+ slots?: Record<string, import("@serene-pub/sdk").SlotDecl> | undefined;
1402
+ }>;
1403
+ /**
1404
+ * 🚧 One scene boundary the scenes routine found: the line it begins at, the boundary trigger that fired there, and its words. @experimental
1405
+ */
1406
+ export interface SceneBoundary {
1407
+ /** The message id the new scene begins at. */
1408
+ at: number;
1409
+ /** The boundary trigger that fired there: a core trigger key (`dayCrossed`, `placeChanged`, `timeAction`, `opening`, …) or a genre's declared one. */
1410
+ trigger: string;
1411
+ /** What the boundary trigger says, as the chip and the divider say it ("the day changed"). */
1412
+ reason: string;
1413
+ }
1414
+ /**
1415
+ * 🚧 **Where scenes begin** — the scenes routine's code-only look back over
1416
+ * the session's `main` channel (every name here is provisional).
1417
+ *
1418
+ * It walks the channel's standing lines up to the newest line that is at least
1419
+ * `depth` rounds old (a round as the turn order counts it), evaluates the
1420
+ * session's enabled boundary triggers line by line, and returns
1421
+ * `SceneBoundary[]` in line order on `main`. **A query writes nothing.**
1422
+ *
1423
+ * Where the walk starts is derived, never stored: after the latest of the
1424
+ * channel's latest scene boundary, its latest decided or offered scene cue, and
1425
+ * a branch's last copied line. `routine` is the routine inlet's `routine` port
1426
+ * (the firing); its cadence's `n` bounds how far back a session with none of
1427
+ * those looks. `depth` keeps a line that is swiped, retaken or taken back from
1428
+ * ever being read.
1429
+ *
1430
+ * ⚠ Not the judged scene check (the sweep's model question) and not
1431
+ * `core:outlet/propose-scene-cue@1` (which places).
1432
+ * @experimental
1433
+ */
1434
+ export declare const sceneBoundaries: import("@serene-pub/sdk").Pinned<import("@serene-pub/sdk").Descriptor<{
1435
+ main: string;
1436
+ }, {
1437
+ scope: string;
1438
+ routine: string;
1439
+ }, "core:query/scene-boundaries@1"> & {
1440
+ kind: 'query';
1441
+ slots?: {
1442
+ readonly params: {
1443
+ readonly kind: "parameters";
1444
+ readonly facet: "behavior";
1445
+ readonly schema: {
1446
+ readonly depth: {
1447
+ readonly type: "integer";
1448
+ readonly default: 2;
1449
+ readonly min: 1;
1450
+ readonly max: 50;
1451
+ readonly label: {
1452
+ readonly en: "Rounds it waits";
1453
+ };
1454
+ readonly description: {
1455
+ readonly en: "Only lines at least this many rounds old are read, so a line that is swiped, retaken or taken back is never read.";
1456
+ };
1457
+ };
1458
+ };
1459
+ };
1460
+ } | undefined;
1461
+ }>;
1462
+ /**
1463
+ * 🚧 **The scene due a summary** — the scene summaries routine's code-only look
1464
+ * at the session's `main` channel (every name here is provisional).
1465
+ *
1466
+ * `main` is **the oldest** finished scene on `main` that is due a summary, as
1467
+ * its scene id (a number), or `null` when none is due. Due: it closed at least
1468
+ * `depth` rounds ago (a round as the turn order counts it), it is not
1469
+ * summarized, and nobody has decided about it — a summary a person saved, a
1470
+ * review a person discarded, a failed run, a run going or a review waiting are
1471
+ * never taken; the session's **Summaries** is not *Never*; and no turns are
1472
+ * taken back. At most one scene per run. **A query writes nothing.**
1473
+ *
1474
+ * ⚠ Not *Summarize all* (the app's `scenesToSummarize`: every unsummarized
1475
+ * scene, a person's press) and not `core:outlet/summarize-finished-scene@1`
1476
+ * (which starts the summary).
1477
+ * @experimental
1478
+ */
1479
+ export declare const sceneSummaryDue: import("@serene-pub/sdk").Pinned<import("@serene-pub/sdk").Descriptor<{
1480
+ main: string;
1481
+ }, {
1482
+ scope: string;
1483
+ }, "core:query/scene-summary-due@1"> & {
1484
+ kind: 'query';
1485
+ slots?: {
1486
+ readonly params: {
1487
+ readonly kind: "parameters";
1488
+ readonly facet: "behavior";
1489
+ readonly schema: {
1490
+ readonly depth: {
1491
+ readonly type: "integer";
1492
+ readonly default: 6;
1493
+ readonly min: 1;
1494
+ readonly max: 50;
1495
+ readonly label: {
1496
+ readonly en: "Rounds after it ends";
1497
+ };
1498
+ readonly description: {
1499
+ readonly en: "A scene is summarized once it ended at least this many rounds ago, so its lines have stopped changing.";
1500
+ };
1501
+ };
1502
+ };
1503
+ };
1504
+ } | undefined;
1505
+ }>;
1506
+ /**
1507
+ * 🚧 **Earlier scenes** — the summaries of this session's finished scenes, for
1508
+ * the block *Earlier in the story* (every name here is provisional).
1509
+ *
1510
+ * `main` is `{ maxTokens: number | null, scenes: Array<{ sceneId: number,
1511
+ * name: string, summary: string, firstLineId: number }> }`: the session's
1512
+ * closed `main`-channel scenes with a usable summary (`summaryStatus =
1513
+ * 'done'`, a person's or the routine's) that are not compiled into a history
1514
+ * entry, in story order (oldest first, by where each scene starts: its opening
1515
+ * line, else its smallest selected line), at most the newest 200. `name` is
1516
+ * the scene's name as shown; `firstLineId` is its first line's message id.
1517
+ * `maxTokens` is `floor(share × budget.total)`, or `null` when `budget` is
1518
+ * unwired (then the block is not capped).
1519
+ *
1520
+ * It returns data, never rendered text: `core:task/assemble@2` decides which
1521
+ * scenes show (only those whose first line is older than the first line the
1522
+ * prompt keeps) and fits them to `maxTokens`.
1523
+ *
1524
+ * ⚠ Not `core:query/scene-summary-due@1` (the routine's look, one scene), not
1525
+ * `core:spec/scene-summaries` (the routine that writes the summaries) and not
1526
+ * `core:query/session-history@1`. **A query writes nothing.**
1527
+ * @experimental
1528
+ */
1529
+ export declare const earlierScenes: import("@serene-pub/sdk").Pinned<import("@serene-pub/sdk").Descriptor<{
1530
+ main: string;
1531
+ }, {
1532
+ scope: string;
1533
+ budget: string;
1534
+ }, "core:query/earlier-scenes@1"> & {
1535
+ kind: 'query';
1536
+ slots?: {
1537
+ readonly params: {
1538
+ readonly kind: "parameters";
1539
+ readonly facet: "weights";
1540
+ readonly schema: {
1541
+ readonly share: {
1542
+ readonly type: "number";
1543
+ readonly min: 0;
1544
+ readonly max: 1;
1545
+ readonly default: 0.15;
1546
+ readonly label: {
1547
+ readonly en: "Share — earlier scenes";
1548
+ };
1549
+ readonly description: {
1550
+ readonly 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.";
1551
+ };
1552
+ };
1553
+ };
1554
+ };
1555
+ } | undefined;
1556
+ }>;
1557
+ /**
1558
+ * 🚧 **One cast member**, as the scope session reads them — their line, their
1559
+ * clock, the session's own notes over the book.
1560
+ *
1561
+ * `member` is `seated-member:<castMemberId>`, `player-seat:<seatId>` (that
1562
+ * seat's cast member), or a cast member id (a number) of the session's
1563
+ * lorebook or its own. Anything else, a seat with no cast member, or a member
1564
+ * the session doesn't read is refused with a sentence.
1565
+ *
1566
+ * `main` is `CastMemberV1` (`@serene-pub/sdk`): the member, the card version
1567
+ * they follow, which fields they follow, and the character profile as the
1568
+ * session reads it.
1569
+ * @experimental
1570
+ */
1571
+ export declare const castMember: import("@serene-pub/sdk").Pinned<import("@serene-pub/sdk").Descriptor<{
1572
+ /** `CastMemberV1`. */
1573
+ main: string;
1574
+ }, {
1575
+ scope: string;
1576
+ /** `seated-member:<id>`, `player-seat:<id>`, or a cast member id. */
1577
+ member: string;
1578
+ }, "core:query/cast-member@1"> & {
1579
+ kind: 'query';
1580
+ slots?: Record<string, import("@serene-pub/sdk").SlotDecl> | undefined;
1581
+ }>;
1371
1582
  /** @experimental */
1372
1583
  export declare const vectorSearch: import("@serene-pub/sdk").Pinned<import("@serene-pub/sdk").Descriptor<{
1373
1584
  main: string;
@@ -2926,6 +3137,14 @@ export declare const graphScenes: import("@serene-pub/sdk").Pinned<import("@sere
2926
3137
  * declaration default, with absence meaning **inherit** rather than zero, and
2927
3138
  * derived slots computed rather than read.
2928
3139
  *
3140
+ * 🚧 Each `cast.byId` entry carries `ref` (the seat's participant reference,
3141
+ * as the host fills it), `castMemberId` (the seat's cast member) and `cardId`
3142
+ * (the member's active card on the timeline; null when card-less). A reader
3143
+ * looks an entry up by `ref` or `castMemberId` (or takes the owner's `key` off
3144
+ * `session-state@1`'s owners), never by building or parsing the key: it is an
3145
+ * opaque owner key — `player_seat:<id>`, 🚧 `seated_member:<id>` from the
3146
+ * flip, ⏳ the card id before it.
3147
+ *
2929
3148
  * A Query, and a plain one: what it is is a read. There is no as-of parameter
2930
3149
  * — this is the `current` view, and the temporal registry that would give the
2931
3150
  * other one is not built (see docs/stats-and-states.md).
@@ -3045,7 +3264,8 @@ export declare const lorebookState: import("@serene-pub/sdk").Pinned<import("@se
3045
3264
  /**
3046
3265
  * One owner: `"world"`, `{ kind: 'cast_member', id }` or
3047
3266
  * `{ kind: 'location', id }` (the session kinds `session`,
3048
- * `session_cast`, `session_location` are translated). Optional.
3267
+ * 🚧 `seated_member`, ⏳ `session_cast`, `session_location` are
3268
+ * translated). Optional.
3049
3269
  */
3050
3270
  owner: string;
3051
3271
  /** 🚧 `'main'`, `'mostRecent'`, `'session'` or a branch id of this book. Optional. */