@serene-pub/core-catalog 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/components/genres/story/authors-note/AuthorsNote.svelte +2 -1
- package/components/genres/story/authors-note/AuthorsNoteWidget.svelte +177 -58
- package/components/shared/WidgetBoundary.svelte +37 -0
- package/components/shared/actions/Actions.svelte +2 -1
- package/components/shared/actions/ActionsWidget.svelte +31 -38
- package/components/shared/album/Album.svelte +2 -1
- package/components/shared/album/AlbumWidget.svelte +1 -7
- package/components/shared/annex/Annex.svelte +2 -1
- package/components/shared/annex/AnnexWidget.svelte +1 -1
- package/components/shared/attendance/Attendance.svelte +2 -1
- package/components/shared/attendance/AttendanceWidget.svelte +5 -8
- package/components/shared/backdrop/Backdrop.svelte +2 -1
- package/components/shared/backdrop/BackdropWidget.svelte +28 -22
- package/components/shared/chronicle/Chronicle.svelte +2 -1
- package/components/shared/chronicle/ChronicleWidget.svelte +101 -59
- package/components/shared/composer/Composer.svelte +25 -0
- package/components/shared/composer/ComposerWidget.svelte +134 -0
- package/components/shared/composer/composer.ts +10 -0
- package/components/shared/composer/settings.ts +55 -0
- package/components/shared/composer/target.ts +60 -0
- package/components/shared/dialogue-box/DialogueBoxMount.svelte +25 -0
- package/components/shared/dialogue-box/DialogueBoxWidget.svelte +207 -0
- package/components/shared/dialogue-box/dialogue-box.ts +10 -0
- package/components/shared/dialogue-box/settings.ts +25 -0
- package/components/shared/lore-entries/LoreEntries.svelte +2 -1
- package/components/shared/lore-entries/LoreEntriesWidget.svelte +5 -6
- package/components/shared/messages/MessageControls.svelte +3 -2
- package/components/shared/messages/Messages.svelte +2 -1
- package/components/shared/messages/MessagesWidget.svelte +58 -183
- package/components/shared/messages/NextCharacterBlock.svelte +17 -17
- package/components/shared/messages/SceneDivider.svelte +18 -2
- package/components/shared/messages/SessionComposer.svelte +115 -105
- package/components/shared/messages/SessionContainer.svelte +2 -6
- package/components/shared/messages/SessionMessage.svelte +90 -26
- package/components/shared/messages/SpokenLine.svelte +12 -3
- package/components/shared/messages/StateProposalList.svelte +30 -20
- package/components/shared/messages/TurnLine.svelte +27 -23
- package/components/shared/messages/conversation.svelte.ts +53 -3
- package/components/shared/messages/readingPace.ts +101 -0
- package/components/shared/messages/sceneMarks.ts +54 -0
- package/components/shared/places/Places.svelte +2 -1
- package/components/shared/places/PlacesWidget.svelte +10 -13
- package/components/shared/routine-log/RoutineLog.svelte +2 -1
- package/components/shared/routine-log/RoutineLogWidget.svelte +0 -4
- package/components/shared/scene-portraits/ScenePortraits.svelte +2 -1
- package/components/shared/scene-portraits/ScenePortraitsWidget.svelte +54 -32
- package/components/shared/session-runs/SessionRuns.svelte +26 -0
- package/components/shared/session-runs/SessionRunsWidget.svelte +266 -0
- package/components/shared/session-runs/session-runs.ts +11 -0
- package/components/shared/state/PieceCard.svelte +36 -25
- package/components/shared/state/SlotControl.svelte +18 -5
- package/components/shared/stats/Stats.svelte +2 -1
- package/components/shared/stats/StatsWidget.svelte +104 -72
- package/components/shared/turn-line/TurnLineMount.svelte +25 -0
- package/components/shared/turn-line/TurnLineWidget.svelte +25 -0
- package/components/shared/turn-line/settings.ts +31 -0
- package/components/shared/turn-line/turn-line.ts +10 -0
- package/components/shared/turn-order/TurnOrder.svelte +2 -1
- package/components/shared/turn-order/TurnOrderWidget.svelte +1 -6
- package/dist/components/actions.js +71 -88
- package/dist/components/actions.source.json +1 -1
- package/dist/components/album.js +39 -44
- package/dist/components/album.source.json +1 -1
- package/dist/components/annex.js +17 -8
- package/dist/components/annex.source.json +1 -1
- package/dist/components/attendance.js +39 -48
- package/dist/components/attendance.source.json +1 -1
- package/dist/components/authors-note.js +329 -162
- package/dist/components/authors-note.source.json +1 -1
- package/dist/components/backdrop.js +52 -55
- package/dist/components/backdrop.source.json +1 -1
- package/dist/components/chronicle.js +510 -428
- package/dist/components/chronicle.source.json +1 -1
- package/dist/components/composer.js +1604 -0
- package/dist/components/composer.source.json +1 -0
- package/dist/components/core-ui.json +1 -1
- package/dist/components/dialogue-box.js +373 -0
- package/dist/components/dialogue-box.source.json +1 -0
- package/dist/components/lore-entries.js +64 -61
- package/dist/components/lore-entries.source.json +1 -1
- package/dist/components/messages.js +1418 -8907
- package/dist/components/messages.source.json +1 -1
- package/dist/components/places.js +148 -160
- package/dist/components/places.source.json +1 -1
- package/dist/components/routine-log.js +30 -35
- package/dist/components/routine-log.source.json +1 -1
- package/dist/components/scene-portraits.js +118 -59
- package/dist/components/scene-portraits.source.json +1 -1
- package/dist/components/session-runs.js +581 -0
- package/dist/components/session-runs.source.json +1 -0
- package/dist/components/shared-2FMI3LEE.js +257 -0
- package/dist/components/{shared-W3XS5FEL.js โ shared-5E4RQYRX.js} +3 -2
- package/dist/components/{shared-QXF5CJVN.js โ shared-6S23SGJB.js} +1 -1
- package/dist/components/{shared-JPG5DQO7.js โ shared-7SWDK5MC.js} +88 -17
- package/dist/components/{shared-YDS7HYL6.js โ shared-ASZVJYPD.js} +2 -2
- package/dist/components/shared-BR2KXM25.js +1596 -0
- package/dist/components/{shared-BBF64YGL.js โ shared-M7AYID43.js} +19 -13
- package/dist/components/{shared-BIWKZFUU.js โ shared-N7FFW5TX.js} +3 -3
- package/dist/components/{shared-7VDIXYAL.js โ shared-OVDOAXYZ.js} +1 -1
- package/dist/components/{shared-WV3QTKZT.js โ shared-RQYMTMHF.js} +13 -9
- package/dist/components/{shared-XBDUENRA.js โ shared-TNJZHTMT.js} +1 -1
- package/dist/components/shared-XJD6Y2OU.js +4215 -0
- package/dist/components/stats.js +828 -678
- package/dist/components/stats.source.json +1 -1
- package/dist/components/turn-line.js +584 -0
- package/dist/components/turn-line.source.json +1 -0
- package/dist/components/turn-order.js +62 -67
- package/dist/components/turn-order.source.json +1 -1
- package/dist/factories/turnOrder.d.ts +18 -2
- package/dist/factories/turnOrder.js +32 -6
- package/dist/functions/pieces.js +1 -0
- package/dist/functions/time.js +2 -0
- package/dist/genres/defaults.d.ts +20 -4
- package/dist/genres/defaults.js +42 -8
- package/dist/genres/dungeon-crawler/calls.d.ts +3 -1
- package/dist/genres/dungeon-crawler/calls.js +5 -0
- package/dist/genres/dungeon-crawler/create.d.ts +9 -6
- package/dist/genres/dungeon-crawler/create.js +18 -8
- package/dist/genres/dungeon-crawler/death.d.ts +13 -6
- package/dist/genres/dungeon-crawler/death.js +26 -12
- package/dist/genres/dungeon-crawler/index.d.ts +1 -0
- package/dist/genres/dungeon-crawler/index.js +1 -0
- package/dist/genres/dungeon-crawler/lore.d.ts +13 -12
- package/dist/genres/dungeon-crawler/lore.js +16 -25
- package/dist/genres/dungeon-crawler/names.d.ts +10 -3
- package/dist/genres/dungeon-crawler/names.js +10 -3
- package/dist/genres/dungeon-crawler/preamble.d.ts +5 -4
- package/dist/genres/dungeon-crawler/preamble.js +75 -33
- package/dist/genres/dungeon-crawler/respond.js +4 -2
- package/dist/genres/dungeon-crawler/rest.d.ts +8 -7
- package/dist/genres/dungeon-crawler/rest.js +34 -12
- package/dist/genres/dungeon-crawler/reveal.js +2 -2
- package/dist/genres/dungeon-crawler/roundScript.d.ts +2 -1
- package/dist/genres/dungeon-crawler/roundScript.js +23 -5
- package/dist/genres/dungeon-crawler/scripts.js +4 -5
- package/dist/genres/dungeon-crawler/shape.d.ts +16 -0
- package/dist/genres/dungeon-crawler/shape.js +5 -1
- package/dist/genres/dungeon-crawler/sheet.d.ts +20 -20
- package/dist/genres/dungeon-crawler/story.d.ts +26 -16
- package/dist/genres/dungeon-crawler/story.js +169 -43
- package/dist/genres/dungeon-crawler/storyScripts.d.ts +2 -2
- package/dist/genres/dungeon-crawler/storyScripts.js +27 -8
- package/dist/genres/dungeon-crawler/summarizeScene.d.ts +13 -0
- package/dist/genres/dungeon-crawler/summarizeScene.js +21 -0
- package/dist/genres/lair/create.js +2 -0
- package/dist/genres/lair/keeper.js +4 -2
- package/dist/genres/lair/scripts.js +8 -6
- package/dist/genres/story/ask.d.ts +4 -0
- package/dist/genres/story/ask.js +4 -0
- package/dist/genres/story/create.d.ts +0 -1
- package/dist/genres/story/create.js +15 -1
- package/dist/genres/story/index.d.ts +1 -1
- package/dist/genres/story/index.js +1 -1
- package/dist/genres/story/narrate.js +8 -0
- package/dist/genres/story/narrateCharacter.js +8 -0
- package/dist/genres/story/reckon.d.ts +5 -19
- package/dist/genres/story/reckon.js +13 -33
- package/dist/genres/story/reckoning.js +3 -0
- package/dist/genres/story/respond.js +17 -28
- package/dist/genres/story/sweep.d.ts +1 -1
- package/dist/genres/story/sweep.js +1 -1
- package/dist/genres/story/turnOrder.d.ts +8 -0
- package/dist/genres/story/turnOrder.js +10 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.js +15 -1
- package/dist/loadouts.d.ts +1 -0
- package/dist/loadouts.js +17 -1
- package/dist/registry/entries.d.ts +2 -0
- package/dist/registry/entries.js +2 -0
- package/dist/registry/genres.d.ts +104 -5
- package/dist/registry/genres.js +276 -21
- package/dist/registry/hostState.d.ts +1 -2
- package/dist/registry/hostState.js +2 -4
- package/dist/registry/layouts.d.ts +141 -111
- package/dist/registry/layouts.js +302 -141
- package/dist/registry/slots.d.ts +4 -3
- package/dist/registry/slots.js +4 -3
- package/dist/registry/widgets.d.ts +12 -2
- package/dist/registry/widgets.js +247 -105
- package/dist/rulesets/vis-itineris/ruleset.js +8 -5
- package/dist/rulesets/wherewithal/ruleset.js +2 -1
- package/dist/seed/presets.js +8 -6
- package/dist/seed/prompts.js +24 -5
- package/dist/shared/annexField.js +23 -3
- package/dist/shared/illustrateScene.d.ts +1 -0
- package/dist/shared/illustrateScene.js +29 -1
- package/dist/shared/portrait.js +13 -4
- package/dist/shared/reckoning.d.ts +1 -1
- package/dist/shared/reckoning.js +23 -13
- package/dist/shared/roundTick.d.ts +20 -0
- package/dist/shared/roundTick.js +76 -0
- package/dist/shared/sceneBoundaries.d.ts +7 -0
- package/dist/shared/sceneBoundaries.js +61 -0
- package/dist/shared/sceneSummaries.d.ts +7 -0
- package/dist/shared/sceneSummaries.js +49 -0
- package/dist/shared/speechFields.js +4 -0
- package/dist/shared/summarize/character.d.ts +1 -1
- package/dist/shared/summarize/history.d.ts +1 -1
- package/dist/shared/summarize/scene.d.ts +1 -1
- package/dist/shared/summarize/summarizeScene.js +1 -0
- package/dist/shared/summarize/summarizeSpec.d.ts +1 -1
- package/dist/shared/summarize/world.d.ts +1 -1
- package/dist/shared/ui/attendance/index.d.ts +3 -2
- package/dist/shared/ui/attendance/index.js +3 -7
- package/dist/shared/ui/chronicle/index.d.ts +17 -0
- package/dist/shared/ui/chronicle/index.js +39 -19
- package/dist/shared/ui/conversation/formAnswer.d.ts +16 -2
- package/dist/shared/ui/conversation/formAnswer.js +23 -9
- package/dist/shared/ui/conversation/index.d.ts +1 -0
- package/dist/shared/ui/conversation/index.js +2 -0
- package/dist/shared/ui/conversation/itemValues.d.ts +16 -3
- package/dist/shared/ui/conversation/itemValues.js +15 -5
- package/dist/shared/ui/conversation/messageVerbState.d.ts +12 -2
- package/dist/shared/ui/conversation/messageVerbState.js +2 -1
- package/dist/shared/ui/conversation/readingPlace.d.ts +40 -0
- package/dist/shared/ui/conversation/readingPlace.js +119 -0
- package/dist/shared/ui/conversation/rewindStrip.d.ts +2 -0
- package/dist/shared/ui/conversation/rewindStrip.js +21 -1
- package/dist/shared/ui/conversation/storyDays.d.ts +7 -1
- package/dist/shared/ui/conversation/storyDays.js +8 -0
- package/dist/shared/ui/places/index.d.ts +3 -2
- package/dist/shared/ui/places/index.js +4 -5
- package/dist/shared/ui/scene-portraits/portraits.d.ts +50 -16
- package/dist/shared/ui/scene-portraits/portraits.js +84 -21
- package/dist/shared/ui/session-runs/index.d.ts +82 -0
- package/dist/shared/ui/session-runs/index.js +137 -0
- package/dist/shared/ui/session-state/stateView.d.ts +18 -5
- package/dist/shared/ui/session-state/stateView.js +29 -8
- package/package.json +12 -8
- /package/dist/components/{shared-4ME6NFDK.js โ shared-LUIF6DW7.js} +0 -0
|
@@ -15,8 +15,7 @@
|
|
|
15
15
|
* a reply and declares for the next round, never lost between the last
|
|
16
16
|
* reply and this one; every write of the turn is anchored to it, so a
|
|
17
17
|
* retake or a delete takes it back;
|
|
18
|
-
* 1. `
|
|
19
|
-
* Journal folio) and `core:script/dungeon-crawler-books`: the Planner's
|
|
18
|
+
* 1. `log`, `books` โ the story turn's own reads (the Journal folio) and `core:script/dungeon-crawler-books`: the Planner's
|
|
20
19
|
* crib (the preamble's one crib builder โ the world as the session's own
|
|
21
20
|
* lorebook holds it, the goal, the leads, the notes and their Asks, the
|
|
22
21
|
* story so far) and this round's brief (each player seat, what they
|
|
@@ -52,7 +51,7 @@
|
|
|
52
51
|
* **table** channel (`stakes.shown.write`), anchored to the Narrator's
|
|
53
52
|
* row, in no voice;
|
|
54
53
|
* 7. `ledger` โ `core:script/dungeon-crawler-ledger`: the genre's own
|
|
55
|
-
* bookkeeping โ its fields (fate,
|
|
54
|
+
* bookkeeping โ its fields (fate, where a newcomer stands, a
|
|
56
55
|
* level's new full health), death (`death.ts`), the goal (`goal.ts`), the
|
|
57
56
|
* leads, the journal line and its kinds (`journal.ts`), the world's new
|
|
58
57
|
* places and people for the session's lorebook (`lore.ts`), the
|
|
@@ -60,8 +59,15 @@
|
|
|
60
59
|
* 8. `raise.levels.*`, `sheet.changed.*` โ the genre fields written, filed at
|
|
61
60
|
* the Narrator's row (the revealed notes kept in step, A24);
|
|
62
61
|
* `time.passed.advance` โ the handler's **advance** with the turn's
|
|
63
|
-
* minutes (A4: durations tick every turn); `
|
|
64
|
-
* the
|
|
62
|
+
* minutes (A4: durations tick every turn); `time.clock.advance` โ the
|
|
63
|
+
* clock is the session's story clock (2026-11-10), moved by the turn's
|
|
64
|
+
* minutes through `advance-story-clock@1`; `lorePlaces`, `lorePeople` โ
|
|
65
|
+
* the world written; `deaths` โ each seat that died marked `deceased` in
|
|
66
|
+
* the cast (`core:outlet/update-cast-member@1`, tied to the row;
|
|
67
|
+
* 2026-11-10: no lore is written for a death); `companions.fates.*` โ a
|
|
68
|
+
* companion's death or revival (bench-L3, โ
4 2026-11-10): the seat benched
|
|
69
|
+
* or brought back and its cast member marked, tied to the row;
|
|
70
|
+
* `filed.kept.write` โ the bookkeeping and the
|
|
65
71
|
* journal, one annex write;
|
|
66
72
|
* 9. `outcomes`, `context` โฆ `say` โ `save` โ the Narrator, streamed, under
|
|
67
73
|
* its own prompt row with the brief as `{{turnDirection}}` and the
|
|
@@ -82,7 +88,7 @@ import { DUNGEON_CRAWLER_DOOR_SCRIPT } from './dice.js';
|
|
|
82
88
|
import { DUNGEON_CRAWLER_DEATH_JS } from './death.js';
|
|
83
89
|
import { DUNGEON_CRAWLER_GOAL_JS } from './goal.js';
|
|
84
90
|
import { DUNGEON_CRAWLER_JOURNAL_JS, journalWrites } from './journal.js';
|
|
85
|
-
import {
|
|
91
|
+
import { DUNGEON_CRAWLER_WORLD_WRITES_JS, loreWrites } from './lore.js';
|
|
86
92
|
import { deliverSecrets } from './secrets.js';
|
|
87
93
|
import { DUNGEON_CRAWLER_CRIB_ROUNDS, DUNGEON_CRAWLER_STORY_PREAMBLE, storySeed } from './storyScripts.js';
|
|
88
94
|
import { DUNGEON_CRAWLER_SHAPE_SCRIPT } from './shape.js';
|
|
@@ -97,10 +103,11 @@ import { TABLE_CHANNEL } from '../../shared/ui/conversation/tableChannel.js';
|
|
|
97
103
|
*/
|
|
98
104
|
/**
|
|
99
105
|
* ๐ง `core:script/dungeon-crawler-books`: what a story turn starts from.
|
|
100
|
-
* Handed `{ session, state, story, messageId, places, people,
|
|
106
|
+
* Handed `{ session, state, story, messageId, places, people, log, cast }`
|
|
101
107
|
* โ the settings document, the session's state, the Story's newest rows, the
|
|
102
|
-
* inlet's re-driven row, the
|
|
103
|
-
*
|
|
108
|
+
* inlet's re-driven row, the two listings of the session's lorebook, the
|
|
109
|
+
* Journal folio's newest lines and the session's cast read (it carries the
|
|
110
|
+
* session's story time). Returns:
|
|
104
111
|
*
|
|
105
112
|
* - `fresh` โ plan this turn (not a re-telling, not ended); `redo` โ the row
|
|
106
113
|
* being re-driven is the last turn's, whose `told` brief and outcomes
|
|
@@ -110,8 +117,8 @@ import { TABLE_CHANNEL } from '../../shared/ui/conversation/tableChannel.js';
|
|
|
110
117
|
* reference, and `location:<entry id>` for each place one stands in;
|
|
111
118
|
* `actions` โ `[{ owner, text }]`, each live seat's declared lines, else
|
|
112
119
|
* its standing order;
|
|
113
|
-
* - `clockBase
|
|
114
|
-
* read; `log` โ the Journal's newest lines; `crib` (the preamble's one
|
|
120
|
+
* - `clockBase` (the session's story now, as the cast read carries it),
|
|
121
|
+
* `rules` (`difficulty`), `seats`, `places`, `people` โ as read; `log` โ the Journal's newest lines; `crib` (the preamble's one
|
|
115
122
|
* crib builder), `brief`;
|
|
116
123
|
* - `rigour` โ the session's, as its document carries it (empty when it
|
|
117
124
|
* carries none: the ruleset handler then reads the stored one);
|
|
@@ -142,7 +149,7 @@ var rules = { difficulty: text(w0.difficulty) || "fair" };
|
|
|
142
149
|
// ๐ง How the session's ruleset plays (P2-4, P2-6): the kit's own ruleset or
|
|
143
150
|
// another (Story: words), and Vis Itineris's casting and dying choices.
|
|
144
151
|
var rs = rulesetOf(v.ruleset);
|
|
145
|
-
var clockBase =
|
|
152
|
+
var clockBase = storyNowClock(own(own(v.cast).storyTime).now) || ${JSON.stringify(DUNGEON_CRAWLER_EPOCH)};
|
|
146
153
|
var seats = seatsOf(doc, state);
|
|
147
154
|
// ๐ง What a level brings to each seat's full health (S4, D9: the genre's
|
|
148
155
|
// HP_PER_LEVEL retired): its class's kit's level gain, read off the
|
|
@@ -162,7 +169,7 @@ function levelHpOf(cls) {
|
|
|
162
169
|
for (var lh = 0; lh < seats.length; lh++) seats[lh].levelHp = levelHpOf(seats[lh]["class"]);
|
|
163
170
|
var heroes = own(progress.heroes);
|
|
164
171
|
var places = placesOf(v.places);
|
|
165
|
-
var people = peopleOf(v.people);
|
|
172
|
+
var people = peopleOf(v.people, progress.fallen);
|
|
166
173
|
var log = logOf(v.log, CRIB_ROUNDS);
|
|
167
174
|
|
|
168
175
|
// This round's declarations: the person lines on Story since its newest
|
|
@@ -172,7 +179,11 @@ var said = {};
|
|
|
172
179
|
function seatOfLine(m) {
|
|
173
180
|
var sp = text(m.speaker);
|
|
174
181
|
for (var q = 0; q < seats.length; q++) if (seats[q].ref === sp) return seats[q];
|
|
175
|
-
|
|
182
|
+
// A line stamped with its cast member is matched by it alone when the seats carry theirs (a card id may now be somebody else's); โณ else by its card.
|
|
183
|
+
var byMember = false;
|
|
184
|
+
for (var bm = 0; bm < seats.length; bm++) if (seats[bm].castMemberId != null) byMember = true;
|
|
185
|
+
if (m.castMemberId != null && byMember) { for (var cm = 0; cm < seats.length; cm++) if (seats[cm].castMemberId === m.castMemberId) return seats[cm]; }
|
|
186
|
+
else if (m.personaId != null) for (var p = 0; p < seats.length; p++) if (seats[p].ref === "character:" + m.personaId) return seats[p];
|
|
176
187
|
if (m.userId != null) for (var u = 0; u < seats.length; u++) if (seats[u].user === Number(m.userId)) return seats[u];
|
|
177
188
|
return seats.length === 1 ? seats[0] : null;
|
|
178
189
|
}
|
|
@@ -189,7 +200,7 @@ function placeNamed(name) {
|
|
|
189
200
|
for (var i = 0; i < places.length; i++) if (places[i].name.toLowerCase() === n) return places[i];
|
|
190
201
|
return null;
|
|
191
202
|
}
|
|
192
|
-
var crib = cribLines(progress, journal, { state: state, places: v.places, people: v.people,
|
|
203
|
+
var crib = cribLines(progress, journal, { state: state, places: v.places, people: v.people, log: log, detail: true });
|
|
193
204
|
|
|
194
205
|
var brief = [];
|
|
195
206
|
brief.push("Difficulty: " + rules.difficulty + ". Time: " + clockLabel(clockBase) + ".");
|
|
@@ -230,7 +241,11 @@ if (!anyDeclared && actions.length) brief.push("Nobody new declared this round:
|
|
|
230
241
|
// ๐ง The companions are narrative only (owner ruling 2026-10-18, P3-9): no
|
|
231
242
|
// sheet is kept for them and no change reaches them โ said so, by name.
|
|
232
243
|
var comp = companionNames(doc);
|
|
233
|
-
if (comp.length) brief.push("Companions travelling with the party, voiced by the Narrator โ narrative only: no sheet keeps their health or their things, so propose no delta for them; tell what befalls them in the brief:\\n- " + comp.join("\\n- "));
|
|
244
|
+
if (comp.length) brief.push("Companions travelling with the party, voiced by the Narrator โ narrative only: no sheet keeps their health or their things, so propose no delta for them; tell what befalls them in the brief; if one of them dies this round, name them in fallenCompanions:\\n- " + comp.join("\\n- "));
|
|
245
|
+
// ๐ง The fallen companions the story could bring back (bench-L3, โ
4 2026-11-10).
|
|
246
|
+
var lost = [], fl0 = Array.isArray(progress.fallen) ? progress.fallen : [];
|
|
247
|
+
for (var fi = 0; fi < fl0.length; fi++) if (own(fl0[fi]).companion === true && text(own(fl0[fi]).name)) lost.push(text(own(fl0[fi]).name));
|
|
248
|
+
if (lost.length) brief.push("Fallen companions the story could bring back to life (a shrine, a Raise): " + lost.join(", ") + "; name any it does in revivedCompanions.");
|
|
234
249
|
var owed = Array.isArray(progress.arrivals) ? progress.arrivals : [];
|
|
235
250
|
for (var oi = 0; oi < owed.length; oi++) {
|
|
236
251
|
var o = own(owed[oi]);
|
|
@@ -246,7 +261,10 @@ return {
|
|
|
246
261
|
brief: text(last.brief), outcomes: text(last.outcomes),
|
|
247
262
|
changes: Array.isArray(last.changes) && last.changes.length ? last.changes : null,
|
|
248
263
|
raises: Array.isArray(last.raises) && last.raises.length ? last.raises : null,
|
|
249
|
-
replay: Array.isArray(last.replay) && last.replay.length ? last.replay : null
|
|
264
|
+
replay: Array.isArray(last.replay) && last.replay.length ? last.replay : null,
|
|
265
|
+
deceased: Array.isArray(last.deceased) && last.deceased.length ? last.deceased : null,
|
|
266
|
+
companionFates: Array.isArray(last.companionFates) && last.companionFates.length ? last.companionFates : null,
|
|
267
|
+
clock: num(last.clock, 0) > 0 ? num(last.clock, 0) : null
|
|
250
268
|
} : null,
|
|
251
269
|
base: { progress: progress, journal: journal },
|
|
252
270
|
owners: owners, actions: actions, rigour: text(doc.rigour),
|
|
@@ -297,7 +315,7 @@ var counted = rigour === "mechanics" || rigour === "scripts";
|
|
|
297
315
|
var slotLines = [];
|
|
298
316
|
var seatsF = Array.isArray(own(v.books).seats) ? own(v.books).seats : [];
|
|
299
317
|
for (var sf = 0; sf < seatsF.length; sf++) {
|
|
300
|
-
var sw = slotWords(own(own(own(own(v.state).cast).byId)[stateKeyOf(seatsF[sf].ref)]));
|
|
318
|
+
var sw = slotWords(own(own(own(own(v.state).cast).byId)[stateKeyOf(seatsF[sf].ref, own(own(own(v.state).cast).byId))]));
|
|
301
319
|
if (sw.length) slotLines.push(seatsF[sf].name + " โ spell slots " + sw.join(", ") + ". A spell of a level with none left cannot be cast.");
|
|
302
320
|
}
|
|
303
321
|
var sheetText = blockText(blocks.sheet);
|
|
@@ -438,7 +456,7 @@ function seatOfRef(ref) {
|
|
|
438
456
|
function bagOf(ref) {
|
|
439
457
|
var m0 = /^location:(\\d+)$/.exec(ref);
|
|
440
458
|
if (m0) return own(own(own(state.locations).byId)[m0[1]]);
|
|
441
|
-
return own(own(own(state.cast).byId)[stateKeyOf(ref)]);
|
|
459
|
+
return own(own(own(state.cast).byId)[stateKeyOf(ref, own(own(state.cast).byId))]);
|
|
442
460
|
}
|
|
443
461
|
// The repertoire an owner holds a piece in, by its name or compendium id.
|
|
444
462
|
function heldIn(ref, piece) {
|
|
@@ -461,7 +479,7 @@ function isHealth(slot) { var k = text(slot).toLowerCase(); return k === "hp" ||
|
|
|
461
479
|
function healthNow(ref) {
|
|
462
480
|
var st0 = seatOfRef(ref);
|
|
463
481
|
if (st0) return st0.hp !== null ? st0.hp : st0.maxHp;
|
|
464
|
-
var e0 = own(own(own(state.cast).byId)[stateKeyOf(ref)]);
|
|
482
|
+
var e0 = own(own(own(state.cast).byId)[stateKeyOf(ref, own(own(state.cast).byId))]);
|
|
465
483
|
return num(e0.hp, null);
|
|
466
484
|
}
|
|
467
485
|
// ๐ง Who crosses a way (Q2-1, owner ruling โ
6 โ no grammar change): the seat
|
|
@@ -557,7 +575,7 @@ var spentNow = {};
|
|
|
557
575
|
function spendSlot(dl) {
|
|
558
576
|
var lv = Number((/\\d+/.exec(text(dl.piece)) || [])[0]);
|
|
559
577
|
var ref = seatRefFor(dl.owner);
|
|
560
|
-
var held = own(own(own(state.cast).byId)[stateKeyOf(ref)])["crawl-spell-slots"];
|
|
578
|
+
var held = own(own(own(state.cast).byId)[stateKeyOf(ref, own(own(state.cast).byId))])["crawl-spell-slots"];
|
|
561
579
|
held = Array.isArray(held) ? held : [];
|
|
562
580
|
var already = num(spentNow[ref + "|" + lv], 0);
|
|
563
581
|
for (var i = 0; i < held.length; i++) {
|
|
@@ -615,10 +633,11 @@ return {
|
|
|
615
633
|
* the state it left (`state`, the turn's own, when it applied nothing),
|
|
616
634
|
* `row` the Narrator's row. Returns `{ changes, progress, journal, notes,
|
|
617
635
|
* notesRevealed, brief, narrator, travelogue, journalLines, secrets,
|
|
618
|
-
* laneLines, raises, places, people,
|
|
619
|
-
* file header, step 8. `advance` is the turn's minutes for the
|
|
620
|
-
* `advance` (AUDIT A4: durations tick on every story turn, not only
|
|
621
|
-
* Rest).
|
|
636
|
+
* laneLines, raises, places, people, deceased, companionFates, replay, advance, clock }` โ
|
|
637
|
+
* see the file header, step 8. `advance` is the turn's minutes for the
|
|
638
|
+
* handler's `advance` (AUDIT A4: durations tick on every story turn, not only
|
|
639
|
+
* on Rest). `clock` is the minutes the session's story clock moves
|
|
640
|
+
* (`advance-story-clock@1`), or null when the turn moves none. On a re-telling (a swipe), the brief and the outcomes as the turn
|
|
622
641
|
* first told them, and what it files again (`changes`, `raises`, `replay`:
|
|
623
642
|
* the host took back what was anchored to the row).
|
|
624
643
|
* @experimental
|
|
@@ -638,7 +657,11 @@ if (b.redo) {
|
|
|
638
657
|
raises: Array.isArray(told0.raises) ? told0.raises.map(function (r) { var o = own(r); if (!o.slot) o.slot = SL.hp; return o; }) : null,
|
|
639
658
|
replay: told0.replay || null,
|
|
640
659
|
progress: null, journal: null, notes: null, notesRevealed: null, travelogue: null, journalLines: null,
|
|
641
|
-
secrets: null, laneLines: null, places: null, people: null,
|
|
660
|
+
secrets: null, laneLines: null, places: null, people: null, deceased: told0.deceased || null, advance: null,
|
|
661
|
+
// ๐ง The companions' fates (bench-L3, owner โ
4 2026-11-10): the swipe took them back with the row; filed again, once.
|
|
662
|
+
companionFates: told0.companionFates || null,
|
|
663
|
+
// A swipe took the move back with the row: the redo files it again, once.
|
|
664
|
+
clock: told0.clock || null,
|
|
642
665
|
brief: text(told0.brief) || "Tell this round again from what the players just did.",
|
|
643
666
|
narrator: (function () {
|
|
644
667
|
var c0 = text(own(own(v.applied).facts).rigour) || text(b.rulesetRigour), dr = c0 === "mechanics" || c0 === "scripts" ? "yes" : "";
|
|
@@ -700,13 +723,15 @@ for (var lu = 0; lu < seats.length; lu++) {
|
|
|
700
723
|
changes.push({ owner: was.ref, slot: SL.hp, value: Math.min(top, (is.hp === null ? was.maxHp : is.hp) + gained * perLevel) });
|
|
701
724
|
}
|
|
702
725
|
|
|
703
|
-
// The clock: the turn's minutes, from where the turn started.
|
|
726
|
+
// The clock: the turn's minutes, from where the turn started. The session's
|
|
727
|
+
// story clock moves by them (\`advance-story-clock@1\`, the ledger's \`clock\`);
|
|
728
|
+
// the journal's time line reads \`clockNext\`.
|
|
704
729
|
var clockNext = null;
|
|
705
730
|
if (plan && plan.clock.minutes > 0) {
|
|
706
731
|
clockNext = addMinutes(b.clockBase, plan.clock.minutes);
|
|
707
|
-
if (clockNext
|
|
708
|
-
else clockNext = null;
|
|
732
|
+
if (!clockNext || clockNext === b.clockBase) clockNext = null;
|
|
709
733
|
}
|
|
734
|
+
var clockMinutes = clockNext ? Math.round(plan.clock.minutes) : 0;
|
|
710
735
|
|
|
711
736
|
// The world the Planner moved, for the session's own lorebook: new places
|
|
712
737
|
// with their ways out (a link says the way and how it stands), new people
|
|
@@ -714,11 +739,59 @@ if (plan && plan.clock.minutes > 0) {
|
|
|
714
739
|
// in this turn's deltas (\`exitDeltas\`, the turn script).
|
|
715
740
|
var placesNow = Array.isArray(b.places) ? b.places : [];
|
|
716
741
|
var writes = plan ? worldWrites(placesNow, Array.isArray(b.people) ? b.people : [], plan.world.rooms, plan.world.npcs, counted) : { places: [], people: [] };
|
|
717
|
-
var
|
|
742
|
+
var deceased = [];
|
|
718
743
|
${DUNGEON_CRAWLER_DEATH_JS}
|
|
719
744
|
// Who is out of the round once this turn lands (the round script's mirror).
|
|
720
745
|
var outNow = fatesAfter(seatsNow, changes);
|
|
721
746
|
keepFates(progress, seatsNow, changes);
|
|
747
|
+
// ๐ง The companions' fates (bench-L3, owner โ
4 2026-11-10; "seat to benched is
|
|
748
|
+
// something managed by the genre/pipelines, not automatically by core"): a
|
|
749
|
+
// companion the Planner names in \`fallenCompanions\` is benched and its cast
|
|
750
|
+
// member marked deceased; one named in \`revivedCompanions\` is brought back
|
|
751
|
+
// from \`progress.fallen\`. A hero is never touched here (\`death.ts\` owns
|
|
752
|
+
// heroes). The crawl's fallen list moves with it, in this turn's own write.
|
|
753
|
+
var companionFates = [];
|
|
754
|
+
function memberOf(castMemberId, ref) {
|
|
755
|
+
if (castMemberId != null) return "seated-member:" + castMemberId;
|
|
756
|
+
return typeof ref === "string" && ref.indexOf("seated-member:") === 0 ? ref : "";
|
|
757
|
+
}
|
|
758
|
+
if (plan) {
|
|
759
|
+
var cdone = {};
|
|
760
|
+
var cfall = Array.isArray(plan.fallenCompanions) ? plan.fallenCompanions : [];
|
|
761
|
+
var cnow = companionsOf(doc);
|
|
762
|
+
for (var cf = 0; cf < cfall.length; cf++) {
|
|
763
|
+
var cname = text(cfall[cf]).toLowerCase();
|
|
764
|
+
if (!cname || cdone[cname]) continue;
|
|
765
|
+
var cmatch = null;
|
|
766
|
+
for (var cn = 0; cn < cnow.length; cn++) if (cnow[cn].name.toLowerCase() === cname || cnow[cn].ref === text(cfall[cf])) cmatch = cnow[cn];
|
|
767
|
+
if (!cmatch) continue;
|
|
768
|
+
var cmember = memberOf(cmatch.castMemberId, cmatch.ref);
|
|
769
|
+
if (!cmember) continue;
|
|
770
|
+
cdone[cname] = true;
|
|
771
|
+
companionFates.push({ seat: cmatch.ref, benched: true, member: cmember, changes: { nodeState: "deceased" } });
|
|
772
|
+
var cfallen = Array.isArray(progress.fallen) ? progress.fallen.slice() : [];
|
|
773
|
+
cfallen.push({ name: cmatch.name, where: partyPlace(""), seat: cmatch.ref, castMemberId: cmatch.castMemberId != null ? cmatch.castMemberId : null, companion: true });
|
|
774
|
+
progress.fallen = cfallen;
|
|
775
|
+
told.push(cmatch.name + " is dead. Name " + cmatch.name + "'s death plainly, in a sentence of its own, and give it weight.");
|
|
776
|
+
}
|
|
777
|
+
var crev = Array.isArray(plan.revivedCompanions) ? plan.revivedCompanions : [];
|
|
778
|
+
for (var cr = 0; cr < crev.length; cr++) {
|
|
779
|
+
var rname = text(crev[cr]).toLowerCase();
|
|
780
|
+
if (!rname) continue;
|
|
781
|
+
var rlist = Array.isArray(progress.fallen) ? progress.fallen : [];
|
|
782
|
+
var rat = -1;
|
|
783
|
+
for (var rf = 0; rf < rlist.length; rf++) if (own(rlist[rf]).companion === true && text(own(rlist[rf]).name).toLowerCase() === rname) { rat = rf; break; }
|
|
784
|
+
if (rat < 0) continue;
|
|
785
|
+
var rentry = own(rlist[rat]);
|
|
786
|
+
var rmember = memberOf(rentry.castMemberId, rentry.seat);
|
|
787
|
+
if (!rmember) continue;
|
|
788
|
+
companionFates.push({ seat: rentry.seat, benched: false, member: rmember, changes: { nodeState: "active" } });
|
|
789
|
+
var rrest = rlist.slice();
|
|
790
|
+
rrest.splice(rat, 1);
|
|
791
|
+
progress.fallen = rrest;
|
|
792
|
+
told.push(text(rentry.name) + " is alive again: the story brought them back. Tell how, plainly.");
|
|
793
|
+
}
|
|
794
|
+
}
|
|
722
795
|
// ๐ง Where everybody is (core:slot/location@1, AUDIT A9): a living seat nobody
|
|
723
796
|
// has placed yet (a newcomer) stands where a living seat of the party stands,
|
|
724
797
|
// else where its arrival was owed, else the first place of the world.
|
|
@@ -806,7 +879,10 @@ for (var op2 = 0; op2 < opened.length; op2++) replay.push(opened[op2]);
|
|
|
806
879
|
if (nowOpen.length) outcomesText = (outcomesText ? outcomesText + "\\n\\n" : "") + nowOpen.join(" ");
|
|
807
880
|
progress.lastTelling = {
|
|
808
881
|
row: row, brief: briefText, outcomes: outcomesText,
|
|
809
|
-
changes: changes.length ? changes : null, raises: raises.length ? raises : null, replay: replay.length ? replay : null
|
|
882
|
+
changes: changes.length ? changes : null, raises: raises.length ? raises : null, replay: replay.length ? replay : null,
|
|
883
|
+
deceased: deceased.length ? deceased : null,
|
|
884
|
+
companionFates: companionFates.length ? companionFates : null,
|
|
885
|
+
clock: clockMinutes > 0 ? clockMinutes : null
|
|
810
886
|
};
|
|
811
887
|
return {
|
|
812
888
|
changes: changes.length ? changes : null,
|
|
@@ -827,8 +903,10 @@ return {
|
|
|
827
903
|
replay: opened.length ? opened : null,
|
|
828
904
|
places: writes.places.length ? writes.places : null,
|
|
829
905
|
people: writes.people.length ? writes.people : null,
|
|
830
|
-
|
|
831
|
-
|
|
906
|
+
deceased: deceased.length ? deceased : null,
|
|
907
|
+
companionFates: companionFates.length ? companionFates : null,
|
|
908
|
+
advance: plan && plan.clock.minutes > 0 ? { minutes: plan.clock.minutes } : null,
|
|
909
|
+
clock: clockMinutes > 0 ? clockMinutes : null
|
|
832
910
|
};
|
|
833
911
|
`);
|
|
834
912
|
/**
|
|
@@ -854,7 +932,7 @@ const applied = (a) => ({
|
|
|
854
932
|
/**
|
|
855
933
|
* The `channel.story` branch (see the header): the spec's reads โ the cast,
|
|
856
934
|
* the Story's newest rows, the session's lorebook โ are the respond spec's
|
|
857
|
-
* head (`respond.ts`); the
|
|
935
|
+
* head (`respond.ts`); the Journal folio is its own.
|
|
858
936
|
* @internal
|
|
859
937
|
*/
|
|
860
938
|
export const storyBranch = (s, w) => {
|
|
@@ -866,12 +944,8 @@ export const storyBranch = (s, w) => {
|
|
|
866
944
|
w.params.push([replanWrite.fresh, { emptyIsUnreadable: true }]);
|
|
867
945
|
w.params.push([planWrite.words, { emptyIsUnreadable: true }]);
|
|
868
946
|
w.params.push([replanWrite.words, { emptyIsUnreadable: true }]);
|
|
869
|
-
w.params.push([on(s, 'fallen'), { entryTypes: [DUNGEON_CRAWLER_ENTRY_TYPES.fallen] }]);
|
|
870
947
|
w.params.push([on(s, 'log'), { channel: TRAVELOGUE_CHANNEL, limit: DUNGEON_CRAWLER_CRIB_ROUNDS }]);
|
|
871
948
|
const reads = s
|
|
872
|
-
.query('fallen', ($) => C.lorebookEntries.v1({ scope: $.input.sessionScope, params: slot.params() }), {
|
|
873
|
-
expose: { label: 'The fallen', status: STORY_STATUS.planning },
|
|
874
|
-
})
|
|
875
949
|
.query('log', ($) => C.sessionHistory.v1({ scope: $.input.sessionScope, params: slot.params() }), {
|
|
876
950
|
expose: { label: 'The journal so far', status: STORY_STATUS.planning },
|
|
877
951
|
});
|
|
@@ -882,10 +956,11 @@ export const storyBranch = (s, w) => {
|
|
|
882
956
|
messageId: $.input.messageId,
|
|
883
957
|
places: $.places.entries,
|
|
884
958
|
people: $.people.entries,
|
|
885
|
-
fallen: $.fallen.entries,
|
|
886
959
|
log: $.log.messages,
|
|
887
960
|
// ๐ง The ruleset the session plays and its settings (P2-4, P2-6).
|
|
888
961
|
ruleset: $.input.ruleset,
|
|
962
|
+
// The session's story time rides on the cast read (2026-11-10).
|
|
963
|
+
cast: $.cast.main,
|
|
889
964
|
}), "Open the Planner's books", STORY_STATUS.planning), w, 'crib', ($) => $.books.main, 'crib', "The Planner's crib, as text"), w, 'brief', ($) => $.books.main, 'brief', 'This round, as text'), w, 'owners', ($) => $.books.main, 'owners', 'Whose rules are read'), w, 'actions', ($) => $.books.main, 'actions', 'What each one does');
|
|
890
965
|
// The session's rigour, handed to the handler as the session holds it
|
|
891
966
|
// (empty: the handler reads the stored rigour itself).
|
|
@@ -1132,7 +1207,20 @@ export const storyBranch = (s, w) => {
|
|
|
1132
1207
|
rigour: $.channel.story.rigour.text,
|
|
1133
1208
|
mode: 'advance',
|
|
1134
1209
|
elapsed: $.elapsed.main,
|
|
1135
|
-
}), { expose: { label: "Pass the turn's time under the rules", status: STORY_STATUS.books } }))
|
|
1210
|
+
}), { expose: { label: "Pass the turn's time under the rules", status: STORY_STATUS.books } }))
|
|
1211
|
+
/**
|
|
1212
|
+
* The session's story clock moves by the turn's minutes (owner ruling
|
|
1213
|
+
* 2026-11-10: the crawl keeps no clock of its own). A move the story
|
|
1214
|
+
* cannot take moves nothing (`onRefusal: 'skip'`); a swipe takes it
|
|
1215
|
+
* back with the row, the redo moves it again, once.
|
|
1216
|
+
*/
|
|
1217
|
+
.when('clock', { path: (v) => v.clock, truthy: true }, (k) => jsonPart(k, w, 'minutes', ($) => $.channel.story.ledger.main, 'clock', "The round's minutes").outlet('advance', ($) => C.advanceStoryClock.v1({
|
|
1218
|
+
by: $.minutes.main,
|
|
1219
|
+
unit: 'minutes',
|
|
1220
|
+
cause: 'action',
|
|
1221
|
+
onRefusal: 'skip',
|
|
1222
|
+
params: slot.params(),
|
|
1223
|
+
}), { expose: { label: 'Move the story clock', status: STORY_STATUS.books } })));
|
|
1136
1224
|
/**
|
|
1137
1225
|
* A swipe's re-filing (the host took back what the turn wrote at its row):
|
|
1138
1226
|
* the deltas that need no roll, applied again by the handler.
|
|
@@ -1146,10 +1234,34 @@ export const storyBranch = (s, w) => {
|
|
|
1146
1234
|
rigour: $.channel.story.rigour.text,
|
|
1147
1235
|
mode: 'apply',
|
|
1148
1236
|
}), { expose: { label: 'File the rules again' } })));
|
|
1149
|
-
// The world the turn moved: new places, ways out
|
|
1150
|
-
//
|
|
1237
|
+
// The world the turn moved: new places, ways out and people, in the
|
|
1238
|
+
// session's own lorebook, each anchored to the turn's row (`lore.ts`).
|
|
1151
1239
|
const worlded = loreWrites(replayed, w, ($) => $.channel.story.ledger.main);
|
|
1152
|
-
|
|
1240
|
+
/**
|
|
1241
|
+
* ๐ง A death writes no lore (owner ruling 2026-11-10): each seat that died
|
|
1242
|
+
* has its cast member marked `deceased`, a cast version the host ties to
|
|
1243
|
+
* the Narrator's row โ a swipe takes it back (the redo files it again,
|
|
1244
|
+
* once), a retake or a delete takes it back for good.
|
|
1245
|
+
*/
|
|
1246
|
+
const deathsFiled = worlded.junction('deaths', { on: ($) => $.ledger.main }, (j) => j.when('deceased', { path: (v) => v.deceased, truthy: true }, (k) => jsonPart(k, w, 'list', ($) => $.channel.story.ledger.main, 'deceased', 'The seats that died').each('member', { over: ($) => $.list.main, max: 8 }, (m) => jsonPart(jsonPart(m, w, 'who', ($) => $[ITEM], 'member', 'Whose cast member'), w, 'changes', ($) => $[ITEM], 'changes', 'Their new state').outlet('write', ($) => C.updateCastMember.v1({ member: $.who.main, changes: $.changes.main }), {
|
|
1247
|
+
expose: { label: 'Mark the fallen deceased' },
|
|
1248
|
+
}))));
|
|
1249
|
+
/**
|
|
1250
|
+
* ๐ง A companion's death or revival (bench-L3, owner โ
4 2026-11-10):
|
|
1251
|
+
* the genre, not core, benches the seat (\`set-seat-bench@1\`) and marks its
|
|
1252
|
+
* cast member (\`update-cast-member@1\`), both tied to the Narrator's row. A
|
|
1253
|
+
* swipe takes them back and the redo files them once; a retake or a delete
|
|
1254
|
+
* takes them back for good. A person's later drag back into the seat wins,
|
|
1255
|
+
* in core. Heroes stay with \`deaths\`.
|
|
1256
|
+
*/
|
|
1257
|
+
const companionsFiled = deathsFiled.junction('companions', { on: ($) => $.ledger.main }, (j) => j.when('fates', { path: (v) => v.companionFates, truthy: true }, (k) => jsonPart(k, w, 'list', ($) => $.channel.story.ledger.main, 'companionFates', "The companions' fates").each('companion', { over: ($) => $.list.main, max: 8 }, (m) => jsonPart(jsonPart(jsonPart(jsonPart(m, w, 'seat', ($) => $[ITEM], 'seat', 'Which seat'), w, 'benched', ($) => $[ITEM], 'benched', 'Benched or back'), w, 'member', ($) => $[ITEM], 'member', "The companion's cast member"), w, 'changes', ($) => $[ITEM], 'changes', "The companion's new state")
|
|
1258
|
+
.outlet('bench', ($) => C.setSeatBench.v1({ seat: $.seat.main, benched: $.benched.main }), {
|
|
1259
|
+
expose: { label: 'Bench or bring back the companion' },
|
|
1260
|
+
})
|
|
1261
|
+
.outlet('state', ($) => C.updateCastMember.v1({ member: $.member.main, changes: $.changes.main }), {
|
|
1262
|
+
expose: { label: "Mark the companion's state" },
|
|
1263
|
+
}))));
|
|
1264
|
+
const filed = companionsFiled.junction('filed', { on: ($) => $.ledger.main }, (j) => j.when('kept', { path: (v) => v.progress, truthy: true }, (k) => jsonPart(jsonPart(k, w, 'progress', ($) => $.channel.story.ledger.main, 'progress', 'The crawl, after the round'), w, 'journal', ($) => $.channel.story.ledger.main, 'journal', 'The journal, after the round').outlet('write', ($) => C.setSessionAnnex.v1({
|
|
1153
1265
|
value: {
|
|
1154
1266
|
[K.progress]: $.progress.main,
|
|
1155
1267
|
[K.journal]: $.journal.main,
|
|
@@ -1182,8 +1294,22 @@ export const storyBranch = (s, w) => {
|
|
|
1182
1294
|
templateContext: $.context.templateContext,
|
|
1183
1295
|
seedName: $.context.seedName,
|
|
1184
1296
|
continuationPrefill: $.input.continuationPrefill,
|
|
1297
|
+
}), telling)
|
|
1298
|
+
// ๐ง Earlier in the story. The Narrator has no budget and no fit, so
|
|
1299
|
+
// this budget is for its own model's window and sizes only the block's
|
|
1300
|
+
// share; it is not wired into `prompt`, which stays without a fit.
|
|
1301
|
+
.task('sceneBudget', ($) => C.contextBudget.v1({
|
|
1302
|
+
sampling: slot.samplingOf(sibling($.context, 'say')),
|
|
1303
|
+
connection: slot.connectionOf(sibling($.context, 'say')),
|
|
1304
|
+
params: slot.params(),
|
|
1305
|
+
}), telling)
|
|
1306
|
+
.query('earlierScenes', ($) => C.earlierScenes.v1({
|
|
1307
|
+
scope: $.input.sessionScope,
|
|
1308
|
+
budget: $.sceneBudget.available,
|
|
1309
|
+
params: slot.params(),
|
|
1185
1310
|
}), telling)
|
|
1186
1311
|
.task('prompt', ($) => C.assemble.v2({
|
|
1312
|
+
earlierScenes: $.earlierScenes.main,
|
|
1187
1313
|
messages: $.lines.messages,
|
|
1188
1314
|
templateContext: $.context.templateContext,
|
|
1189
1315
|
template: slot.template(),
|
|
@@ -29,8 +29,8 @@ export declare const DUNGEON_CRAWLER_DELTA_OPS: readonly ["add", "spend", "set",
|
|
|
29
29
|
* retired 2026-10-23: what a level brings is the session's rules', the
|
|
30
30
|
* books' `levelHp`);
|
|
31
31
|
* `sinceReply(msgs)` โ this round's declarations; `fatesAfter` /
|
|
32
|
-
* `keepFates` โ who is out of the round; the clock (`
|
|
33
|
-
* `clockLabel`); `hooks` โ the open leads; the exit model
|
|
32
|
+
* `keepFates` โ who is out of the round; the clock (`storyNowClock`,
|
|
33
|
+
* `addMinutes`, `clockLabel`); `hooks` โ the open leads; the exit model
|
|
34
34
|
* (`DUNGEON_CRAWLER_EXITS_JS`); and `checkPlan(raw)` โ the Planner's answer
|
|
35
35
|
* normalised, or `null` when it is unusable (no `narratorBrief`), its deltas
|
|
36
36
|
* read from the session's rules' grammar (`asDelta`, S1) into the handler's.
|
|
@@ -31,8 +31,8 @@ export const DUNGEON_CRAWLER_DELTA_OPS = Object.freeze(['add', 'spend', 'set', '
|
|
|
31
31
|
* retired 2026-10-23: what a level brings is the session's rules', the
|
|
32
32
|
* books' `levelHp`);
|
|
33
33
|
* `sinceReply(msgs)` โ this round's declarations; `fatesAfter` /
|
|
34
|
-
* `keepFates` โ who is out of the round; the clock (`
|
|
35
|
-
* `clockLabel`); `hooks` โ the open leads; the exit model
|
|
34
|
+
* `keepFates` โ who is out of the round; the clock (`storyNowClock`,
|
|
35
|
+
* `addMinutes`, `clockLabel`); `hooks` โ the open leads; the exit model
|
|
36
36
|
* (`DUNGEON_CRAWLER_EXITS_JS`); and `checkPlan(raw)` โ the Planner's answer
|
|
37
37
|
* normalised, or `null` when it is unusable (no `narratorBrief`), its deltas
|
|
38
38
|
* read from the session's rules' grammar (`asDelta`, S1) into the handler's.
|
|
@@ -82,7 +82,7 @@ function keepFates(progress, seats, changes) {
|
|
|
82
82
|
var MONTH_DAYS = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
83
83
|
function pad(n) { return n < 10 ? "0" + n : String(n); }
|
|
84
84
|
function addMinutes(clock, minutes) {
|
|
85
|
-
var m = /^(-?\\d+)-(\\d
|
|
85
|
+
var m = /^(-?\\d+)-(\\d+)-(\\d+)(?:[ T](\\d{1,2}):(\\d{2}))?$/.exec(text(clock));
|
|
86
86
|
if (!m || !(minutes > 0)) return text(clock) || null;
|
|
87
87
|
var y = Number(m[1]), mo = Number(m[2]), d = Number(m[3]);
|
|
88
88
|
var t = (m[4] ? Number(m[4]) : 0) * 60 + (m[5] ? Number(m[5]) : 0) + Math.round(minutes);
|
|
@@ -91,11 +91,22 @@ function addMinutes(clock, minutes) {
|
|
|
91
91
|
while (d > MONTH_DAYS[(mo - 1) % 12]) { d -= MONTH_DAYS[(mo - 1) % 12]; mo++; if (mo > 12) { mo = 1; y++; } }
|
|
92
92
|
return y + "-" + pad(mo) + "-" + pad(d) + " " + pad(Math.floor(t / 60)) + ":" + pad(t % 60);
|
|
93
93
|
}
|
|
94
|
-
// The
|
|
95
|
-
//
|
|
96
|
-
//
|
|
94
|
+
// The session's story now, as the cast read carries it (2026-11-10), as the
|
|
95
|
+
// clock line the helpers here read: "<year>-<MM>-<DD>[ HH:MM]" from
|
|
96
|
+
// { year, month?, day?, hour?, minute? } โ month and day default to 1, the
|
|
97
|
+
// time only when hour is a number; empty when there is no numeric year.
|
|
98
|
+
function storyNowClock(now) {
|
|
99
|
+
var n = own(now);
|
|
100
|
+
if (typeof n.year !== "number") return "";
|
|
101
|
+
var out = n.year + "-" + pad(typeof n.month === "number" ? n.month : 1) + "-" + pad(typeof n.day === "number" ? n.day : 1);
|
|
102
|
+
if (typeof n.hour === "number") out += " " + pad(n.hour) + ":" + pad(typeof n.minute === "number" ? n.minute : 0);
|
|
103
|
+
return out;
|
|
104
|
+
}
|
|
105
|
+
// The story clock as the table reads it: "Day N" counts from the story's
|
|
106
|
+
// first day (\`DUNGEON_CRAWLER_EPOCH\` is day 1), and the time โ "Day 3,
|
|
107
|
+
// 16:30". The clock is the session's story clock (2026-11-10); said this way.
|
|
97
108
|
function clockLabel(clock) {
|
|
98
|
-
var m = /^(-?\\d+)-(\\d
|
|
109
|
+
var m = /^(-?\\d+)-(\\d+)-(\\d+)(?:[ T](\\d{1,2}):(\\d{2}))?$/.exec(text(clock));
|
|
99
110
|
if (!m) return text(clock);
|
|
100
111
|
var y = Number(m[1]), mo = Number(m[2]), day = Number(m[3]) + (y - 1) * 365;
|
|
101
112
|
for (var i = 0; i < mo - 1; i++) day += MONTH_DAYS[i % 12];
|
|
@@ -147,11 +158,19 @@ function checkPlan(raw) {
|
|
|
147
158
|
var sec = own(rs[s]);
|
|
148
159
|
if (text(sec.seat) && text(sec.text)) secrets.push({ seat: text(sec.seat), text: text(sec.text) });
|
|
149
160
|
}
|
|
161
|
+
// ๐ง Companions the story killed or revived this round (bench-L3, owner
|
|
162
|
+
// โ
4 2026-11-10); absent in old answers, so \`[]\`.
|
|
163
|
+
function names(l) {
|
|
164
|
+
var o = [], r = Array.isArray(l) ? l : [];
|
|
165
|
+
for (var k = 0; k < r.length && o.length < 4; k++) if (typeof r[k] === "string" && text(r[k])) o.push(text(r[k]));
|
|
166
|
+
return o;
|
|
167
|
+
}
|
|
150
168
|
return {
|
|
151
169
|
deltas: deltas,
|
|
152
170
|
world: { rooms: roomsOf(w.rooms, 6), npcs: npcs, leads: hooks(w.leads, raw.roundSummary), goalProgress: text(w.goalProgress) || "none", notes: text(w.notes) },
|
|
153
171
|
clock: { minutes: clamp(Math.round(num(raw.clock && raw.clock.minutes, 10)), 0, 4320) },
|
|
154
|
-
narratorBrief: brief, roundSummary: text(raw.roundSummary), secrets: secrets
|
|
172
|
+
narratorBrief: brief, roundSummary: text(raw.roundSummary), secrets: secrets,
|
|
173
|
+
fallenCompanions: names(raw.fallenCompanions), revivedCompanions: names(raw.revivedCompanions)
|
|
155
174
|
};
|
|
156
175
|
}
|
|
157
176
|
`;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ๐ง The Dungeon Crawler's **summarize-scene** (live scenes ยง13), scenes first
|
|
3
|
+
* (owner ruling 2026-11-10): the crawl turns scenes on, and a day's scenes
|
|
4
|
+
* compile into its one history entry. One story channel, `main`, no asides,
|
|
5
|
+
* and no transcript template of its own (the builder's default is used). A
|
|
6
|
+
* death reaches the scene through the Narrator's own sentence.
|
|
7
|
+
*
|
|
8
|
+
* Registered in the Dungeon Crawler's defaults as its summarize-scene
|
|
9
|
+
* (`summaries(dungeonCrawlerSummarizeSceneSpec())`).
|
|
10
|
+
*/
|
|
11
|
+
/** @experimental */
|
|
12
|
+
export declare const dungeonCrawlerSummarizeSceneSpec: () => import("@serene-pub/sdk").CompiledSpec<"close-out" | "summarize-scene">;
|
|
13
|
+
//# sourceMappingURL=summarizeScene.d.ts.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ๐ง The Dungeon Crawler's **summarize-scene** (live scenes ยง13), scenes first
|
|
3
|
+
* (owner ruling 2026-11-10): the crawl turns scenes on, and a day's scenes
|
|
4
|
+
* compile into its one history entry. One story channel, `main`, no asides,
|
|
5
|
+
* and no transcript template of its own (the builder's default is used). A
|
|
6
|
+
* death reaches the scene through the Narrator's own sentence.
|
|
7
|
+
*
|
|
8
|
+
* Registered in the Dungeon Crawler's defaults as its summarize-scene
|
|
9
|
+
* (`summaries(dungeonCrawlerSummarizeSceneSpec())`).
|
|
10
|
+
*/
|
|
11
|
+
import { summarizeScene } from '../../shared/summarize/summarizeScene.js';
|
|
12
|
+
import { GENRE_SUMMARIZE_SCENE_VERSION } from '../../shared/summarize/sceneIds.js';
|
|
13
|
+
import { dungeonCrawlerGenre } from '../../registry/genres.js';
|
|
14
|
+
import { DUNGEON_CRAWLER_STORY_CHANNEL, DUNGEON_CRAWLER_SUMMARIZE_SCENE_SPEC_ID } from './names.js';
|
|
15
|
+
/** @experimental */
|
|
16
|
+
export const dungeonCrawlerSummarizeSceneSpec = () => summarizeScene(DUNGEON_CRAWLER_SUMMARIZE_SCENE_SPEC_ID, {
|
|
17
|
+
version: GENRE_SUMMARIZE_SCENE_VERSION,
|
|
18
|
+
genre: dungeonCrawlerGenre,
|
|
19
|
+
channels: { story: DUNGEON_CRAWLER_STORY_CHANNEL },
|
|
20
|
+
});
|
|
21
|
+
//# sourceMappingURL=summarizeScene.js.map
|
|
@@ -40,6 +40,8 @@ export const lairCreateSpec = () => compile(spec(LAIR_CREATE_SPEC_ID, {
|
|
|
40
40
|
family: lairGenre.family,
|
|
41
41
|
description: lairGenre.description,
|
|
42
42
|
shape: lairGenre.shape,
|
|
43
|
+
// ๐ง ed B1 (2026-11-05): the genre's pinned settings ride the row (sheet latitude pins).
|
|
44
|
+
settings: lairGenre.settings,
|
|
43
45
|
events: lairGenre.events,
|
|
44
46
|
// R4: the host names the person's lines off this row.
|
|
45
47
|
playerLabel: lairGenre.playerLabel,
|
|
@@ -22,8 +22,10 @@
|
|
|
22
22
|
* 2026-10-23, GM: G1's crib made them inert);
|
|
23
23
|
* - **it describes no new places** (`placesOnMove` off): the rooms are the
|
|
24
24
|
* GM's โ the knock, *Build room*, *File as a room*;
|
|
25
|
-
* -
|
|
26
|
-
*
|
|
25
|
+
* - it judges no time (`time` off: lane F โ
3, no model-driven time in the
|
|
26
|
+
* Lair); it moves the clock only when its *Move the clock* is switched on
|
|
27
|
+
* and it names a move. The round tick (`core:spec/round-tick`) moves the
|
|
28
|
+
* round worth, in every Lair preset (owner 2026-11-11).
|
|
27
29
|
*
|
|
28
30
|
* Was the `keep` junction at the tail of `core:spec/lair-respond` and each
|
|
29
31
|
* character turn's own books. It reads only the session, so it fits any
|
|
@@ -70,22 +70,24 @@ function outcomeLine(b) {
|
|
|
70
70
|
}
|
|
71
71
|
// A name compared as a person reads it: case, spacing and a leading article aside.
|
|
72
72
|
function nameKey(x) { return text(x).toLowerCase().replace(/^(the|a|an)\\s+/, "").replace(/\\s+/g, " "); }
|
|
73
|
-
//
|
|
74
|
-
|
|
73
|
+
// A seat's participant ref: the host's, else โณ today's card form.
|
|
74
|
+
function seatRefOr(s, today) { return typeof s.ref === "string" && s.ref ? s.ref : today; }
|
|
75
|
+
// Everyone seated and switched on: { ref, name, plays, castMemberId } โ a
|
|
76
|
+
// persona seat or a card-less seat is somebody a person plays.
|
|
75
77
|
function peopleOf(doc) {
|
|
76
78
|
var cast = own(own(doc).cast), out = [];
|
|
77
79
|
var cs = list(cast.sessionCharacters);
|
|
78
80
|
for (var i = 0; i < cs.length; i++) {
|
|
79
81
|
var s = own(cs[i]), ch = own(s.character);
|
|
80
82
|
if (s.enabled === false || s.removedAt || ch.id === undefined) continue;
|
|
81
|
-
out.push({ ref: "character:" + ch.id, name: text(ch.name), nick: text(ch.nickname), plays: false, at: num(s.position, out.length) });
|
|
83
|
+
out.push({ ref: seatRefOr(s, "character:" + ch.id), name: text(ch.name), nick: text(ch.nickname), plays: false, at: num(s.position, out.length), castMemberId: s.castMemberId });
|
|
82
84
|
}
|
|
83
85
|
var ps = list(cast.sessionPersonas);
|
|
84
86
|
for (var j = 0; j < ps.length; j++) {
|
|
85
87
|
var p = own(ps[j]), pe = p.persona ? own(p.persona) : null;
|
|
86
88
|
if (p.enabled === false || p.removedAt) continue;
|
|
87
|
-
if (pe && pe.id !== undefined) out.push({ ref: "character:" + pe.id, name: text(pe.name), nick: "", plays: true, seat: "persona:" + pe.id });
|
|
88
|
-
else if (p.seatId !== undefined) out.push({ ref: "player-seat:" + p.seatId, name: text(p.seatName) || "a player", nick: "", plays: true, seat: "player-seat:" + p.seatId });
|
|
89
|
+
if (pe && pe.id !== undefined) out.push({ ref: seatRefOr(p, "character:" + pe.id), name: text(pe.name), nick: "", plays: true, seat: "persona:" + pe.id, castMemberId: p.castMemberId });
|
|
90
|
+
else if (p.seatId !== undefined) out.push({ ref: seatRefOr(p, "player-seat:" + p.seatId), name: text(p.seatName) || "a player", nick: "", plays: true, seat: "player-seat:" + p.seatId, castMemberId: p.castMemberId });
|
|
89
91
|
}
|
|
90
92
|
return out;
|
|
91
93
|
}
|
|
@@ -313,7 +315,7 @@ for (var i = 0; i < outs.length; i++) {
|
|
|
313
315
|
if (text(c.five)) block.five = text(c.five);
|
|
314
316
|
for (var e = 0; e < ex.length; e++) { var x = own(ex[e]); if (text(x.target) === roller + "." + text(c.selector) && text(x.text)) { block.explain = text(x.text); break; } }
|
|
315
317
|
}
|
|
316
|
-
if (!block.by && /^(character|player-seat):\\d+$/.test(roller)) block.by = roller;
|
|
318
|
+
if (!block.by && /^(character|seated-member|player-seat):\\d+$/.test(roller)) block.by = roller;
|
|
317
319
|
blocks.push(block);
|
|
318
320
|
var who = personRef(people, roller);
|
|
319
321
|
lines.push((who ? who.name + " โ " : "") + outcomeLine(block));
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Story's **Ask** action (Adventure's until 2026-10-19): the narrator asks, the cast answers (`answer.ts`).
|
|
3
3
|
* The genre's actions are introduced in `index.ts`.
|
|
4
|
+
*
|
|
5
|
+
* Retired from Story 2026-11-04 (owner ยง0-F): Story no longer registers it, so it is on no quick
|
|
6
|
+
* row, no `/ask` and no composer chip. Still published so stored references resolve and an
|
|
7
|
+
* administrator may register it; Answer stays registered for choices blocks already in sessions.
|
|
4
8
|
*/
|
|
5
9
|
/** @internal */
|
|
6
10
|
export declare const STORY_ASK_SPEC_ID = "core:spec/story-ask";
|
package/dist/genres/story/ask.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Story's **Ask** action (Adventure's until 2026-10-19): the narrator asks, the cast answers (`answer.ts`).
|
|
3
3
|
* The genre's actions are introduced in `index.ts`.
|
|
4
|
+
*
|
|
5
|
+
* Retired from Story 2026-11-04 (owner ยง0-F): Story no longer registers it, so it is on no quick
|
|
6
|
+
* row, no `/ask` and no composer chip. Still published so stored references resolve and an
|
|
7
|
+
* administrator may register it; Answer stays registered for choices blocks already in sessions.
|
|
4
8
|
*/
|
|
5
9
|
import { compile, slot, spec } from '@serene-pub/sdk';
|
|
6
10
|
import * as C from '@serene-pub/contracts';
|