@serene-pub/core-catalog 0.6.0-pr-2 → 0.6.0-pr-4
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/README.md +21 -1
- package/components/{sessions → genres/chat}/authors-note/AuthorsNote.svelte +1 -1
- package/components/{sessions → genres/chat}/authors-note/AuthorsNoteWidget.svelte +1 -1
- package/components/{sessions → shared}/lore-entries/LoreEntries.svelte +1 -1
- package/components/{sessions → shared}/lore-entries/LoreEntriesWidget.svelte +1 -1
- package/components/{sessions → shared}/messages/MessageComposer.svelte +1 -1
- package/components/{sessions → shared}/messages/Messages.svelte +1 -1
- package/components/{sessions → shared}/messages/MessagesWidget.svelte +1 -1
- package/components/{sessions → shared}/messages/SessionComposer.svelte +1 -1
- package/components/{sessions → shared}/messages/SessionMessage.svelte +1 -1
- package/components/{sessions → shared}/messages/conversation.svelte.ts +1 -1
- package/components/{sessions → shared}/scene-portraits/ScenePortraits.svelte +1 -1
- package/components/{sessions → shared}/scene-portraits/ScenePortraitsWidget.svelte +1 -1
- package/components/{sessions → shared}/stats/Stats.svelte +1 -1
- package/components/{sessions → shared}/stats/StatsWidget.svelte +1 -1
- package/components/{sessions → shared}/world-state/WorldState.svelte +1 -1
- package/components/{sessions → shared}/world-state/WorldStateWidget.svelte +1 -1
- package/dist/components/authors-note.js +5 -5
- package/dist/components/authors-note.source.json +1 -1
- package/dist/components/core-ui.json +1 -1
- package/dist/components/lore-entries.js +5 -5
- package/dist/components/lore-entries.source.json +1 -1
- package/dist/components/messages.js +26 -26
- package/dist/components/messages.source.json +1 -1
- package/dist/components/scene-portraits.js +7 -7
- package/dist/components/scene-portraits.source.json +1 -1
- package/dist/components/{shared-TCQZXBE3.js → shared-3FGURYVS.js} +2 -2
- package/dist/components/{shared-AINANAIA.js → shared-FXYLABGF.js} +6 -6
- package/dist/components/{shared-UAQVMZZK.js → shared-U3UU5V7L.js} +3 -3
- package/dist/components/stats.js +6 -6
- package/dist/components/stats.source.json +1 -1
- package/dist/components/world-state.js +6 -6
- package/dist/components/world-state.source.json +1 -1
- package/dist/{answerForm.d.ts → factories/answerForm.d.ts} +4 -30
- package/dist/{answerForm.js → factories/answerForm.js} +4 -37
- package/dist/factories/once.d.ts +7 -0
- package/dist/factories/once.js +9 -0
- package/dist/{turnOrder.d.ts → factories/turnOrder.d.ts} +0 -22
- package/dist/{turnOrder.js → factories/turnOrder.js} +4 -104
- package/dist/genres/adventure/advanceTime.d.ts +11 -0
- package/dist/genres/adventure/advanceTime.js +17 -0
- package/dist/genres/adventure/answer.d.ts +23 -0
- package/dist/genres/adventure/answer.js +59 -0
- package/dist/genres/adventure/answerForm.d.ts +9 -0
- package/dist/genres/adventure/answerForm.js +11 -0
- package/dist/genres/adventure/ask.d.ts +73 -0
- package/dist/genres/adventure/ask.js +157 -0
- package/dist/genres/adventure/create.d.ts +36 -0
- package/dist/genres/adventure/create.js +62 -0
- package/dist/genres/adventure/index.d.ts +43 -0
- package/dist/genres/adventure/index.js +43 -0
- package/dist/genres/adventure/keeperAction.d.ts +24 -0
- package/dist/genres/adventure/keeperAction.js +150 -0
- package/dist/genres/adventure/look.d.ts +45 -0
- package/dist/genres/adventure/look.js +209 -0
- package/dist/{adventure.d.ts → genres/adventure/respond.d.ts} +10 -34
- package/dist/{adventure.js → genres/adventure/respond.js} +34 -60
- package/dist/genres/adventure/rest.d.ts +10 -0
- package/dist/genres/adventure/rest.js +16 -0
- package/dist/genres/adventure/turnOrder.d.ts +10 -0
- package/dist/genres/adventure/turnOrder.js +27 -0
- package/dist/genres/chat/answerForm.d.ts +9 -0
- package/dist/genres/chat/answerForm.js +11 -0
- package/dist/genres/chat/create.d.ts +7 -0
- package/dist/{createChat.js → genres/chat/create.js} +6 -6
- package/dist/genres/chat/generateImage.d.ts +7 -0
- package/dist/{generateImage.js → genres/chat/generateImage.js} +5 -5
- package/dist/genres/chat/index.d.ts +15 -0
- package/dist/genres/chat/index.js +15 -0
- package/dist/{narrate.d.ts → genres/chat/narrate.d.ts} +3 -3
- package/dist/{narrate.js → genres/chat/narrate.js} +34 -12
- package/dist/{narrateCharacter.d.ts → genres/chat/narrateCharacter.d.ts} +2 -2
- package/dist/{narrateCharacter.js → genres/chat/narrateCharacter.js} +35 -16
- package/dist/genres/chat/respond.d.ts +25 -0
- package/dist/{respond.js → genres/chat/respond.js} +48 -22
- package/dist/genres/chat/turnOrder.d.ts +9 -0
- package/dist/genres/chat/turnOrder.js +28 -0
- package/dist/{ui/sessions → genres/chat/ui}/authors-note/index.d.ts +1 -1
- package/dist/genres/guide/answerForm.d.ts +9 -0
- package/dist/genres/guide/answerForm.js +11 -0
- package/dist/genres/guide/create.d.ts +24 -0
- package/dist/genres/guide/create.js +58 -0
- package/dist/genres/guide/index.d.ts +9 -0
- package/dist/genres/guide/index.js +9 -0
- package/dist/{guide.d.ts → genres/guide/respond.d.ts} +1 -20
- package/dist/{guide.js → genres/guide/respond.js} +29 -60
- package/dist/genres/guide/turnOrder.d.ts +10 -0
- package/dist/genres/guide/turnOrder.js +27 -0
- package/dist/genres/index.d.ts +14 -0
- package/dist/genres/index.js +41 -0
- package/dist/genres/lair/answerForm.d.ts +17 -0
- package/dist/genres/lair/answerForm.js +19 -0
- package/dist/genres/lair/buildRoom.d.ts +64 -0
- package/dist/genres/lair/buildRoom.js +244 -0
- package/dist/genres/lair/castellanAction.d.ts +27 -0
- package/dist/genres/lair/castellanAction.js +177 -0
- package/dist/genres/lair/create.d.ts +28 -0
- package/dist/genres/lair/create.js +69 -0
- package/dist/genres/lair/fileRoom.d.ts +53 -0
- package/dist/genres/lair/fileRoom.js +288 -0
- package/dist/genres/lair/index.d.ts +60 -0
- package/dist/genres/lair/index.js +60 -0
- package/dist/genres/lair/nudge.d.ts +25 -0
- package/dist/genres/lair/nudge.js +78 -0
- package/dist/{lair.d.ts → genres/lair/respond.d.ts} +15 -28
- package/dist/{lair.js → genres/lair/respond.js} +45 -76
- package/dist/genres/lair/reveal.d.ts +10 -0
- package/dist/genres/lair/reveal.js +18 -0
- package/dist/genres/lair/roomAnswer.d.ts +86 -0
- package/dist/genres/lair/roomAnswer.js +378 -0
- package/dist/genres/lair/trap.d.ts +11 -0
- package/dist/genres/lair/trap.js +24 -0
- package/dist/genres/lair/turnOrder.d.ts +9 -0
- package/dist/genres/lair/turnOrder.js +36 -0
- package/dist/genres/lair/whisper.d.ts +35 -0
- package/dist/genres/lair/whisper.js +90 -0
- package/dist/index.d.ts +47 -29
- package/dist/index.js +117 -88
- package/dist/{genres.js → registry/genres.js} +4 -4
- package/dist/{ui/sessions → registry}/widgets.js +6 -6
- package/dist/{presets.js → seed/presets.js} +28 -13
- package/dist/{prompts.js → seed/prompts.js} +27 -56
- package/dist/{annexField.d.ts → shared/annexField.d.ts} +3 -2
- package/dist/{annexField.js → shared/annexField.js} +6 -8
- package/dist/shared/builtins/branch.d.ts +8 -0
- package/dist/shared/builtins/branch.js +13 -0
- package/dist/{builtins.d.ts → shared/builtins/builtIn.d.ts} +16 -21
- package/dist/{builtins.js → shared/builtins/builtIn.js} +3 -37
- package/dist/shared/builtins/delete.d.ts +8 -0
- package/dist/shared/builtins/delete.js +13 -0
- package/dist/shared/builtins/edit.d.ts +8 -0
- package/dist/shared/builtins/edit.js +13 -0
- package/dist/shared/builtins/hide.d.ts +8 -0
- package/dist/shared/builtins/hide.js +13 -0
- package/dist/shared/builtins/index.d.ts +11 -0
- package/dist/shared/builtins/index.js +11 -0
- package/dist/shared/builtins/swipe.d.ts +8 -0
- package/dist/shared/builtins/swipe.js +17 -0
- package/dist/shared/sprites.d.ts +34 -0
- package/dist/shared/sprites.js +98 -0
- package/dist/shared/summarize/character.d.ts +9 -0
- package/dist/shared/summarize/character.js +10 -0
- package/dist/shared/summarize/history.d.ts +9 -0
- package/dist/shared/summarize/history.js +10 -0
- package/dist/shared/summarize/index.d.ts +10 -0
- package/dist/shared/summarize/index.js +10 -0
- package/dist/shared/summarize/scene.d.ts +38 -0
- package/dist/shared/summarize/scene.js +42 -0
- package/dist/shared/summarize/summarizeSpec.d.ts +54 -0
- package/dist/{summarize.js → shared/summarize/summarizeSpec.js} +8 -53
- package/dist/shared/summarize/world.d.ts +8 -0
- package/dist/shared/summarize/world.js +9 -0
- package/dist/{toolLoop.d.ts → shared/toolLoop.d.ts} +25 -3
- package/dist/{toolLoop.js → shared/toolLoop.js} +67 -14
- package/dist/{ui/sessions → shared/ui}/conversation/index.d.ts +1 -1
- package/dist/{ui/sessions → shared/ui}/conversation/index.js +1 -1
- package/dist/{ui/sessions → shared/ui}/coreWidgetsEntry.d.ts +1 -1
- package/dist/{ui/sessions → shared/ui}/coreWidgetsEntry.js +1 -1
- package/dist/{ui/sessions → shared/ui}/lore-entries/index.d.ts +1 -1
- package/dist/{ui/sessions → shared/ui}/scene-portraits/index.d.ts +1 -1
- package/dist/{ui/sessions → shared/ui}/scene-portraits/index.js +1 -1
- package/dist/{ui/sessions → shared/ui}/session-state/index.d.ts +1 -1
- package/dist/{ui/sessions → shared/ui}/session-state/index.js +1 -1
- package/package.json +28 -28
- package/dist/adventureActions.d.ts +0 -169
- package/dist/adventureActions.js +0 -599
- package/dist/createChat.d.ts +0 -7
- package/dist/generateImage.d.ts +0 -7
- package/dist/lairActions.d.ts +0 -296
- package/dist/lairActions.js +0 -1287
- package/dist/respond.d.ts +0 -24
- package/dist/sprites.d.ts +0 -24
- package/dist/sprites.js +0 -102
- package/dist/summarize.d.ts +0 -76
- /package/components/{sessions → genres/chat}/authors-note/authors-note.ts +0 -0
- /package/components/{sessions/shared → shared}/context.ts +0 -0
- /package/components/{sessions → shared}/lore-entries/lore-entries.ts +0 -0
- /package/components/{sessions → shared}/messages/MessageBlocksView.svelte +0 -0
- /package/components/{sessions → shared}/messages/MessageControls.svelte +0 -0
- /package/components/{sessions → shared}/messages/MessageMediaStrip.svelte +0 -0
- /package/components/{sessions → shared}/messages/MessagePartsView.svelte +0 -0
- /package/components/{sessions → shared}/messages/MessageStateLedger.svelte +0 -0
- /package/components/{sessions → shared}/messages/NextCharacterBlock.svelte +0 -0
- /package/components/{sessions → shared}/messages/SessionContainer.svelte +0 -0
- /package/components/{sessions → shared}/messages/StateProposalList.svelte +0 -0
- /package/components/{sessions → shared}/messages/mediaStrip.ts +0 -0
- /package/components/{sessions → shared}/messages/messages.ts +0 -0
- /package/components/{sessions → shared}/scene-portraits/StatBars.svelte +0 -0
- /package/components/{sessions → shared}/scene-portraits/scene-portraits.ts +0 -0
- /package/components/{sessions → shared}/state/SlotControl.svelte +0 -0
- /package/components/{sessions → shared}/state/entryFinder.ts +0 -0
- /package/components/{sessions → shared}/state/slotWriter.svelte.ts +0 -0
- /package/components/{sessions → shared}/stats/stats.ts +0 -0
- /package/components/{sessions/shared → shared}/widgetRef.svelte.ts +0 -0
- /package/components/{sessions → shared}/world-state/world-state.ts +0 -0
- /package/dist/{ui/sessions → genres/chat/ui}/authors-note/index.js +0 -0
- /package/dist/{entries.d.ts → registry/entries.d.ts} +0 -0
- /package/dist/{entries.js → registry/entries.js} +0 -0
- /package/dist/{genres.d.ts → registry/genres.d.ts} +0 -0
- /package/dist/{ui/sessions → registry}/layouts.d.ts +0 -0
- /package/dist/{ui/sessions → registry}/layouts.js +0 -0
- /package/dist/{slots.d.ts → registry/slots.d.ts} +0 -0
- /package/dist/{slots.js → registry/slots.js} +0 -0
- /package/dist/{statShapes.d.ts → registry/statShapes.d.ts} +0 -0
- /package/dist/{statShapes.js → registry/statShapes.js} +0 -0
- /package/dist/{ui/sessions → registry}/widgets.d.ts +0 -0
- /package/dist/{guideMascotImage.d.ts → seed/guideMascotImage.d.ts} +0 -0
- /package/dist/{guideMascotImage.js → seed/guideMascotImage.js} +0 -0
- /package/dist/{presets.d.ts → seed/presets.d.ts} +0 -0
- /package/dist/{prompts.d.ts → seed/prompts.d.ts} +0 -0
- /package/dist/{graphBuild.d.ts → shared/graphBuild.d.ts} +0 -0
- /package/dist/{graphBuild.js → shared/graphBuild.js} +0 -0
- /package/dist/{ui/sessions → shared/ui}/conversation/actionsDisclosure.d.ts +0 -0
- /package/dist/{ui/sessions → shared/ui}/conversation/actionsDisclosure.js +0 -0
- /package/dist/{ui/sessions → shared/ui}/conversation/composerTray.d.ts +0 -0
- /package/dist/{ui/sessions → shared/ui}/conversation/composerTray.js +0 -0
- /package/dist/{ui/sessions → shared/ui}/conversation/dossier.d.ts +0 -0
- /package/dist/{ui/sessions → shared/ui}/conversation/dossier.js +0 -0
- /package/dist/{ui/sessions → shared/ui}/conversation/formAnswer.d.ts +0 -0
- /package/dist/{ui/sessions → shared/ui}/conversation/formAnswer.js +0 -0
- /package/dist/{ui/sessions → shared/ui}/conversation/itemValues.d.ts +0 -0
- /package/dist/{ui/sessions → shared/ui}/conversation/itemValues.js +0 -0
- /package/dist/{ui/sessions → shared/ui}/conversation/messageOrder.d.ts +0 -0
- /package/dist/{ui/sessions → shared/ui}/conversation/messageOrder.js +0 -0
- /package/dist/{ui/sessions → shared/ui}/conversation/messageSpeaker.d.ts +0 -0
- /package/dist/{ui/sessions → shared/ui}/conversation/messageSpeaker.js +0 -0
- /package/dist/{ui/sessions → shared/ui}/conversation/messageVerbState.d.ts +0 -0
- /package/dist/{ui/sessions → shared/ui}/conversation/messageVerbState.js +0 -0
- /package/dist/{ui/sessions → shared/ui}/conversation/slashPalette.d.ts +0 -0
- /package/dist/{ui/sessions → shared/ui}/conversation/slashPalette.js +0 -0
- /package/dist/{ui/sessions → shared/ui}/conversation/text.d.ts +0 -0
- /package/dist/{ui/sessions → shared/ui}/conversation/text.js +0 -0
- /package/dist/{ui/sessions → shared/ui}/lore-entries/index.js +0 -0
- /package/dist/{ui/sessions → shared/ui}/scene-portraits/portraits.d.ts +0 -0
- /package/dist/{ui/sessions → shared/ui}/scene-portraits/portraits.js +0 -0
- /package/dist/{ui/sessions → shared/ui}/session-state/barMath.d.ts +0 -0
- /package/dist/{ui/sessions → shared/ui}/session-state/barMath.js +0 -0
- /package/dist/{ui/sessions → shared/ui}/session-state/shapes.d.ts +0 -0
- /package/dist/{ui/sessions → shared/ui}/session-state/shapes.js +0 -0
- /package/dist/{ui/sessions → shared/ui}/session-state/stateView.d.ts +0 -0
- /package/dist/{ui/sessions → shared/ui}/session-state/stateView.js +0 -0
- /package/dist/{ui/sessions → shared/ui}/widgetContext.d.ts +0 -0
- /package/dist/{ui/sessions → shared/ui}/widgetContext.js +0 -0
|
@@ -0,0 +1,378 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Lair's **Answer the door**: what the knock's option fires. The genre's
|
|
3
|
+
* actions are introduced in `index.ts`.
|
|
4
|
+
*/
|
|
5
|
+
import { compile, slot, spec, sessionEvents } from '@serene-pub/sdk';
|
|
6
|
+
import * as C from '@serene-pub/contracts';
|
|
7
|
+
import { lairGenre } from '../../registry/genres.js';
|
|
8
|
+
/* ── The party knocks: the answer ───────────────────────────────────────── */
|
|
9
|
+
/** @internal */
|
|
10
|
+
export const LAIR_ROOM_ANSWER_SPEC_ID = 'core:spec/lair-room-answer';
|
|
11
|
+
/** @internal */
|
|
12
|
+
export const LAIR_ROOM_ANSWER_VERSION = '1.0.0';
|
|
13
|
+
/**
|
|
14
|
+
* **What the knock's option fires** — the other half of the respond spec's
|
|
15
|
+
* `door.knock` branch (R-15 *Forms*), and the composer's *Answer the door*
|
|
16
|
+
* (`/room`) while a knock is open.
|
|
17
|
+
*
|
|
18
|
+
* **The knock asks for a description** (lair re-plan R9, owner rulings 2 + 6,
|
|
19
|
+
* 2026-09-28). The action collects optional text (R3's collect modal, or S2's
|
|
20
|
+
* slash argument — `/room <text>`), and a junction on it decides:
|
|
21
|
+
*
|
|
22
|
+
* - **typed** — the text IS the room: a location entry named after the door
|
|
23
|
+
* the party knocked at, its content **the typed text, verbatim**, and **no
|
|
24
|
+
* review gate**. It is the master's own words; a gate would ask them to
|
|
25
|
+
* approve what they just typed.
|
|
26
|
+
* - **drafted** — nothing typed: the Castellan drafts the room in the
|
|
27
|
+
* dungeon's layout (`LAIR_ROOM_CONTENT_SHAPE`, the form *Build room* drafts
|
|
28
|
+
* into, the `lair-knock-build` prompt), and the master edits it at
|
|
29
|
+
* `create-lore-entry`'s **review gate** before it lands.
|
|
30
|
+
*
|
|
31
|
+
* Retired with the two-option knock: *I will build it* and *Let the Castellan
|
|
32
|
+
* improvise it* (`KNOCK_OPTIONS`), and the improvise branch's narration
|
|
33
|
+
* (its `lair-improvise` prompt row). An empty answer drafts and gates exactly
|
|
34
|
+
* as either used to.
|
|
35
|
+
*
|
|
36
|
+
* **A rejected draft re-opens the knock** (owner F5; R9). Not this spec's
|
|
37
|
+
* rule: a core one in the app's review gate — an answer rejected at review
|
|
38
|
+
* that wrote nothing is no answer, so the form is not marked answered, its
|
|
39
|
+
* row is re-announced and its open-form notification raised again. The room
|
|
40
|
+
* is still undescribed, the story still waits, and *Describe <room>…* and
|
|
41
|
+
* `/room` are offered again.
|
|
42
|
+
*
|
|
43
|
+
* Writing a lore entry is `effects: 'world'`, and the rule that used to stop a
|
|
44
|
+
* block naming one is the effects line's one exception (L1, ruled 2026-09-17):
|
|
45
|
+
* `worldBlockFunctions` refuses any block naming a world action **unless the
|
|
46
|
+
* block is addressed to the owner**, and the knock's block is addressed to
|
|
47
|
+
* `owner` precisely because the dungeon's master is the only person it could
|
|
48
|
+
* sensibly be put to. So this action is declared `world` and lives in the
|
|
49
|
+
* `composer` venue — the `form` venue stays fiction-only, because a venue is
|
|
50
|
+
* declared and an addressee is decided at run time (see `sdk/src/actions.ts`).
|
|
51
|
+
*
|
|
52
|
+
* **The room's name travels on the block** (lair pass B12, 2026-09-27). The
|
|
53
|
+
* knock's `choices` block carries the checked name as its `referent`,
|
|
54
|
+
* `read-answer@1` hands it back, and it is the entry's `name`. A press that
|
|
55
|
+
* carries no form never gets that far: `answer` halts (*nothing to answer*),
|
|
56
|
+
* which is why the action is present only while a knock is open (W-GATE D3,
|
|
57
|
+
* `presentWhen`), and a composer press while it is open is addressed to that
|
|
58
|
+
* knock by the host.
|
|
59
|
+
*
|
|
60
|
+
* **The new room joins the room the party stand in** (places plan B6,
|
|
61
|
+
* 2026-09-29). The party knocked from somewhere: the world's `location` stat,
|
|
62
|
+
* else the room the knock's planner named (the block's `vantage`, plan A27).
|
|
63
|
+
* `here` resolves it against the rooms the dungeon lists — the Lair's name
|
|
64
|
+
* rule, `undescribed-name@1` reading the name at `world.location` inside the
|
|
65
|
+
* session's state (a location set to a place entry is that entry, by id) —
|
|
66
|
+
* and, once the room has landed, the `link` junction writes ONE relationship
|
|
67
|
+
* from the new room to that one, `leads to` both ways
|
|
68
|
+
* (`core:outlet/link-lore-entries@1`). The next turn's planner reads it under
|
|
69
|
+
* the room as "From here:".
|
|
70
|
+
*
|
|
71
|
+
* ⚠ **Invariant: the door never fails because the party's location names no
|
|
72
|
+
* room** (plan §3 #11). The location is usually words, and `create-lore-entry`'s
|
|
73
|
+
* own `links` refuses a name nothing answers to inside the entry's transaction
|
|
74
|
+
* — which would fail the room with it. So the link is its own write, after the
|
|
75
|
+
* room's, in a junction that fires only when `here` found a room: otherwise
|
|
76
|
+
* the room is saved unlinked. A rejected draft ends the run before either. The
|
|
77
|
+
* link is not gated (the master judged the room; the way back to where the
|
|
78
|
+
* party stand is not a second question) and the outlet is idempotent, so a
|
|
79
|
+
* repeat stacks nothing.
|
|
80
|
+
*
|
|
81
|
+
* **Then the story goes on.** Once the room lands, the master's own line —
|
|
82
|
+
* *The party go on into The Drowned Hall* — is written under their name, the
|
|
83
|
+
* way a send is: the turn order prepares the Castellan's turn, auto-advance
|
|
84
|
+
* fires it as it would after any send, and the planner, which now lists the
|
|
85
|
+
* room, walks the party in. A rejected draft ends the run at the gate, so
|
|
86
|
+
* nothing is said and the knock is open again.
|
|
87
|
+
* @internal
|
|
88
|
+
*/
|
|
89
|
+
export const lairRoomAnswerSpec = () => compile(spec(LAIR_ROOM_ANSWER_SPEC_ID, {
|
|
90
|
+
version: LAIR_ROOM_ANSWER_VERSION,
|
|
91
|
+
taxonomy: { role: 'action' },
|
|
92
|
+
contributes: {
|
|
93
|
+
actions: [
|
|
94
|
+
{
|
|
95
|
+
key: 'room',
|
|
96
|
+
/**
|
|
97
|
+
* ⚠ **`composer`, and it was `form`** (changed
|
|
98
|
+
* 2026-09-17 with L1). This action writes a lorebook
|
|
99
|
+
* entry, which is `effects: 'world'`, and F41 refuses a
|
|
100
|
+
* world action in the `form` venue at construction —
|
|
101
|
+
* deliberately, because a venue is declared and an
|
|
102
|
+
* addressee is decided at run time, so that check can
|
|
103
|
+
* never see the one fact that makes this safe. The
|
|
104
|
+
* block still reaches it: an owner-addressed block may
|
|
105
|
+
* name a `composer`-venue world action, and the press is
|
|
106
|
+
* held to the addressee.
|
|
107
|
+
*
|
|
108
|
+
* **So it is present only while a knock is open** —
|
|
109
|
+
* `presentWhen` below, hidden rather than grey (W-GATE
|
|
110
|
+
* D3, 2026-09-27). The host publishes the session's open
|
|
111
|
+
* form as `session.openForm` (unanswered, not overtaken)
|
|
112
|
+
* with the action it is answered by; the knock's block
|
|
113
|
+
* names this one. Present is answerable: the host
|
|
114
|
+
* addresses a composer press of this action to the open
|
|
115
|
+
* knock (`fireAction`), so it walks the knock's own
|
|
116
|
+
* button road.
|
|
117
|
+
*/
|
|
118
|
+
venue: { kind: 'composer' },
|
|
119
|
+
presentWhen: {
|
|
120
|
+
on: 'session.openForm.action',
|
|
121
|
+
equals: `${LAIR_ROOM_ANSWER_SPEC_ID}#room`,
|
|
122
|
+
/** Said only at the door: a listing hides it instead. */
|
|
123
|
+
reason: { en: 'There is no door to answer — the party have not knocked.' },
|
|
124
|
+
},
|
|
125
|
+
/**
|
|
126
|
+
* **The description** (R9): optional, because an empty
|
|
127
|
+
* answer has a meaning — the Castellan drafts the room
|
|
128
|
+
* for review. Typed, it is saved as written.
|
|
129
|
+
*/
|
|
130
|
+
collects: {
|
|
131
|
+
text: {
|
|
132
|
+
need: 'optional',
|
|
133
|
+
label: { en: 'Describe the room' },
|
|
134
|
+
ifEmpty: { en: 'The Castellan drafts it for you to review.' },
|
|
135
|
+
},
|
|
136
|
+
},
|
|
137
|
+
/**
|
|
138
|
+
* ⚠ Lore data, so the result is outside the story
|
|
139
|
+
* (R-15 *The line*) — the same declaration *Build
|
|
140
|
+
* room* carries, for the same write.
|
|
141
|
+
*/
|
|
142
|
+
effects: 'world',
|
|
143
|
+
/**
|
|
144
|
+
* The dungeon's master answers this and nobody else —
|
|
145
|
+
* the block is addressed to `owner`, and the audience
|
|
146
|
+
* says the same thing where a listing would ask. It is
|
|
147
|
+
* also what a `world` action is allowed to say
|
|
148
|
+
* (`WORLD_ACTION_ACTORS`).
|
|
149
|
+
*/
|
|
150
|
+
audience: { see: ['participant'], act: ['owner'] },
|
|
151
|
+
icon: 'door-open',
|
|
152
|
+
label: { en: 'Answer the door' },
|
|
153
|
+
description: {
|
|
154
|
+
en: 'Describe the room the party just found. What you write is saved as the room; leave it empty and the Castellan drafts it for you to edit before it is saved.',
|
|
155
|
+
},
|
|
156
|
+
},
|
|
157
|
+
],
|
|
158
|
+
},
|
|
159
|
+
})
|
|
160
|
+
.inlet('input', C.userMessage.v1(), {
|
|
161
|
+
genre: lairGenre,
|
|
162
|
+
event: sessionEvents.sessionAction,
|
|
163
|
+
})
|
|
164
|
+
.task('answer', ($) => C.readAnswer.v1({ payload: $.input.payload, form: $.input.form }))
|
|
165
|
+
.gather('gather', { mode: 'parallel' }, (b) => b
|
|
166
|
+
.chain('history', (c) => c.query('read', ($) => C.sessionHistory.v1({
|
|
167
|
+
scope: $.input.sessionScope,
|
|
168
|
+
params: slot.params(),
|
|
169
|
+
})))
|
|
170
|
+
/** The book's public half — world lore and history, never character lore (see the note on `CASTELLAN`). */
|
|
171
|
+
.chain('worldLore', (c) => c.query('read', ($) => C.worldLore.v1({
|
|
172
|
+
scope: $.input.sessionScope,
|
|
173
|
+
params: slot.params(),
|
|
174
|
+
})))
|
|
175
|
+
.chain('historyEntries', (c) => c.query('read', ($) => C.historyEntries.v1({
|
|
176
|
+
scope: $.input.sessionScope,
|
|
177
|
+
params: slot.params({ node: 'gather.worldLore.read' }),
|
|
178
|
+
})))
|
|
179
|
+
.chain('cast', (c) => c.query('read', ($) => C.sessionCast.v1({ scope: $.input.sessionScope })))
|
|
180
|
+
.chain('state', (c) => c.query('read', ($) => C.sessionState.v1({ scope: $.input.sessionScope })))
|
|
181
|
+
/**
|
|
182
|
+
* The rooms the dungeon holds (location entries, the
|
|
183
|
+
* preset) — what `here` resolves the party's location
|
|
184
|
+
* against (B6), and what the draft is told already exists
|
|
185
|
+
* (plan A28).
|
|
186
|
+
*/
|
|
187
|
+
.chain('rooms', (c) => c.query('read', ($) => C.lorebookEntries.v1({
|
|
188
|
+
scope: $.input.sessionScope,
|
|
189
|
+
params: slot.params(),
|
|
190
|
+
}))))
|
|
191
|
+
.task('contextBudget', ($) => C.contextBudget.v1({
|
|
192
|
+
sampling: slot.samplingOf('room.drafted.write'),
|
|
193
|
+
connection: slot.connectionOf('room.drafted.write'),
|
|
194
|
+
params: slot.params(),
|
|
195
|
+
}))
|
|
196
|
+
.task('lore', ($) => C.concatCandidates.v1({
|
|
197
|
+
sources: [
|
|
198
|
+
$.gather.history.read.band,
|
|
199
|
+
$.gather.worldLore.read.main,
|
|
200
|
+
$.gather.historyEntries.read.main,
|
|
201
|
+
],
|
|
202
|
+
}))
|
|
203
|
+
// The room `{{locationEntry}}` shows (the room rule, 2026-10-02):
|
|
204
|
+
// the world's location at `world.location` (the preset's `path`),
|
|
205
|
+
// by the one room rule; the ranker leaves it out of the lore.
|
|
206
|
+
.task('place', ($) => C.undescribedName.v1({
|
|
207
|
+
name: $.gather.state.read.state,
|
|
208
|
+
locationEntries: $.gather.rooms.read.entries,
|
|
209
|
+
params: slot.params(),
|
|
210
|
+
}), { expose: { label: 'The current place' } })
|
|
211
|
+
// Who is in the world at the session's moment (R4), for `eligible`.
|
|
212
|
+
.query('presences', ($) => C.castPresences.v1({ scope: $.input.sessionScope }))
|
|
213
|
+
// The hard gates before the ranker (C2; R2, R4): selective-logic
|
|
214
|
+
// exclusions from the keyword lanes, and the presence gate.
|
|
215
|
+
.task('eligible', ($) => C.eligibility.v1({
|
|
216
|
+
candidates: $.lore.candidates,
|
|
217
|
+
exclusions: [$.gather.worldLore.read.exclusions, $.gather.historyEntries.read.exclusions],
|
|
218
|
+
presences: $.presences.main,
|
|
219
|
+
at: $.presences.at,
|
|
220
|
+
}))
|
|
221
|
+
.task('rank', ($) => C.rankHybrid.v1({
|
|
222
|
+
candidates: $.eligible.candidates,
|
|
223
|
+
budget: $.contextBudget.available,
|
|
224
|
+
shownElsewhere: $.place.entryId,
|
|
225
|
+
params: slot.params(),
|
|
226
|
+
}))
|
|
227
|
+
/**
|
|
228
|
+
* 🚧 **The files those rows show** (attachments follow-ups, owner
|
|
229
|
+
* ruling 2026-10-03), read once on the spine; the drafting arm below
|
|
230
|
+
* places them for `room.drafted.write` — an image it can read rides its own
|
|
231
|
+
* turn, otherwise its name. No files, and the arm's prompt is byte for
|
|
232
|
+
* byte what it was.
|
|
233
|
+
*/
|
|
234
|
+
.query('attachments', ($) => C.historyAttachments.v1({
|
|
235
|
+
messages: $.gather.history.read.messages,
|
|
236
|
+
params: slot.params(),
|
|
237
|
+
}))
|
|
238
|
+
/**
|
|
239
|
+
* **Typed, or left to the Castellan** (R9). The model call is in
|
|
240
|
+
* the branch that needs one: a typed room costs nothing. Each
|
|
241
|
+
* branch files the room itself — a location (L3), set in the
|
|
242
|
+
* preset below, exactly as *Build room* files one — named after
|
|
243
|
+
* the door the party knocked at (the block's `referent`).
|
|
244
|
+
*
|
|
245
|
+
* `links` is unwired on purpose: it would fail the room with a
|
|
246
|
+
* name nothing answers to. The way back to where the party stand
|
|
247
|
+
* is the `link` junction below, after the room (B6); the drafted
|
|
248
|
+
* `Exits:` line stays prose (`LAIR_ROOM_CONTENT_SHAPE`).
|
|
249
|
+
*/
|
|
250
|
+
.junction('room', { on: ($) => $.input.text }, (r) => r
|
|
251
|
+
.when('typed', { truthy: true }, (c) => c.outlet('save', ($) => C.createLoreEntry.v1({
|
|
252
|
+
name: $.answer.referent,
|
|
253
|
+
// The master's own words, as they wrote them.
|
|
254
|
+
content: $.input.text,
|
|
255
|
+
params: slot.params(),
|
|
256
|
+
}), { expose: { label: 'Save the room as typed' } }))
|
|
257
|
+
/**
|
|
258
|
+
* The room drafted in the dungeon's layout for the master
|
|
259
|
+
* to finish (B12) — *Build room*'s layout, its own prompt
|
|
260
|
+
* row: the room is the one the party just knocked at,
|
|
261
|
+
* named by the last line of the conversation.
|
|
262
|
+
*/
|
|
263
|
+
.otherwise('drafted', (c) => c
|
|
264
|
+
.task('context', ($) => C.buildTemplateContext.v1({
|
|
265
|
+
cast: $.gather.cast.read.cast,
|
|
266
|
+
state: $.gather.state.read.state,
|
|
267
|
+
locationEntries: $.gather.rooms.read.entries,
|
|
268
|
+
prompts: slot.prompts(),
|
|
269
|
+
variables: slot.variables(),
|
|
270
|
+
}))
|
|
271
|
+
.task('lines', ($) => C.proseTranscript.v1({
|
|
272
|
+
messages: $.gather.history.read.messages,
|
|
273
|
+
cast: $.gather.cast.read.cast,
|
|
274
|
+
templateContext: $.room.drafted.context.templateContext,
|
|
275
|
+
}))
|
|
276
|
+
.task('attached', ($) => C.placeAttachments.v1({
|
|
277
|
+
messages: $.room.drafted.lines.messages,
|
|
278
|
+
attachments: $.attachments.attachments,
|
|
279
|
+
connection: slot.connectionOf('room.drafted.write'),
|
|
280
|
+
params: slot.params(),
|
|
281
|
+
}))
|
|
282
|
+
.task('prompt', ($) => C.assemble.v2({
|
|
283
|
+
candidates: $.rank.candidates,
|
|
284
|
+
decisions: $.rank.decisions,
|
|
285
|
+
groups: $.rank.groups,
|
|
286
|
+
budget: $.contextBudget.available,
|
|
287
|
+
messages: $.room.drafted.attached.messages,
|
|
288
|
+
templateContext: $.room.drafted.context.templateContext,
|
|
289
|
+
template: slot.template(),
|
|
290
|
+
prompts: slot.prompts({ node: 'room.drafted.context' }),
|
|
291
|
+
variables: slot.variables(),
|
|
292
|
+
params: slot.params(),
|
|
293
|
+
connection: slot.connectionOf('room.drafted.write'),
|
|
294
|
+
}))
|
|
295
|
+
.oracle('write', ($) => C.generateText.v1({
|
|
296
|
+
context: $.room.drafted.prompt.context,
|
|
297
|
+
connection: slot.connection(),
|
|
298
|
+
sampling: slot.sampling(),
|
|
299
|
+
params: slot.params(),
|
|
300
|
+
}), { expose: { status: 'The Castellan drafts the room' } })
|
|
301
|
+
.outlet('save', ($) => C.createLoreEntry.v1({
|
|
302
|
+
name: $.answer.referent,
|
|
303
|
+
content: $.room.drafted.write.text,
|
|
304
|
+
params: slot.params(),
|
|
305
|
+
}), { expose: { label: 'Save the drafted room' } })))
|
|
306
|
+
/**
|
|
307
|
+
* **Where the party stand** (B6): the world's `location`, read at
|
|
308
|
+
* `world.location` inside the session's state (the preset's
|
|
309
|
+
* `path`), else the knock's `vantage` — the room its planner said
|
|
310
|
+
* the party stood in (A27) — resolved against the rooms by the
|
|
311
|
+
* Lair's name rule. The world's value first and the plan's hint
|
|
312
|
+
* second is the order `{{locationEntry}}` reads them in on a play
|
|
313
|
+
* turn; the hint here is the knock turn's own, which no prompt in
|
|
314
|
+
* that turn showed. A location set to a place entry is that entry.
|
|
315
|
+
* `entryId` is the room, or null when nothing the dungeon lists
|
|
316
|
+
* answers — words naming no room, or neither a location nor a hint.
|
|
317
|
+
*/
|
|
318
|
+
.task('here', ($) => C.undescribedName.v1({
|
|
319
|
+
name: $.gather.state.read.state,
|
|
320
|
+
fallbackName: $.answer.vantage,
|
|
321
|
+
locationEntries: $.gather.rooms.read.entries,
|
|
322
|
+
params: slot.params(),
|
|
323
|
+
}))
|
|
324
|
+
/**
|
|
325
|
+
* **The way between them** (B6): one relationship from the room
|
|
326
|
+
* just written to the room the party stand in, `leads to` both
|
|
327
|
+
* ways (the preset) — only when `here` found one. The junction
|
|
328
|
+
* publishes whichever `save` ran as `room.entryId`. Nothing fires
|
|
329
|
+
* otherwise: the room stays saved, unlinked, and the story goes on.
|
|
330
|
+
*/
|
|
331
|
+
.junction('link', { on: ($) => $.here.entryId }, (r) => r.when('resolved', { truthy: true }, (c) => c.outlet('write', ($) => C.linkLoreEntries.v1({
|
|
332
|
+
from: $.room.entryId,
|
|
333
|
+
to: $.here.entryId,
|
|
334
|
+
params: slot.params(),
|
|
335
|
+
}))))
|
|
336
|
+
/**
|
|
337
|
+
* The master's line that sends the party on (B12) — after the
|
|
338
|
+
* room's write, so it is said only once the room exists. Written
|
|
339
|
+
* as the person who pressed (`presser`, `user:<id>`: a user row,
|
|
340
|
+
* their own line), which is what makes it a send: the turn order
|
|
341
|
+
* prepares the Castellan's turn and auto-advance takes it, as
|
|
342
|
+
* after any send.
|
|
343
|
+
*/
|
|
344
|
+
.task('onward', ($) => C.joinText.v1({
|
|
345
|
+
items: ['The party go on into', $.answer.referent],
|
|
346
|
+
params: slot.params(),
|
|
347
|
+
}))
|
|
348
|
+
.outlet('resume', ($) => C.createMessage.v1({
|
|
349
|
+
text: $.onward.text,
|
|
350
|
+
speaker: $.input.presser,
|
|
351
|
+
}))
|
|
352
|
+
/**
|
|
353
|
+
* ⚠ **The draft's gate is the point, not a precaution.**
|
|
354
|
+
* `create-lore-entry` declares `review: { fields: ['name',
|
|
355
|
+
* 'content'] }` and `resolvePosition` defaults an undeclared
|
|
356
|
+
* position to `off`, so without this line the Castellan's draft
|
|
357
|
+
* would land unseen. On, the run parks and the master gets the
|
|
358
|
+
* *Build room* form with the draft already in it. The typed room
|
|
359
|
+
* is `off` by name: the master wrote it (R9).
|
|
360
|
+
*/
|
|
361
|
+
.preset('lair', { label: 'Lair', default: true }, (p) => p
|
|
362
|
+
.settings('room.typed.save', { review: 'off' })
|
|
363
|
+
.settings('room.drafted.save', { review: 'on' })
|
|
364
|
+
// A room is a place (L3), however it was written.
|
|
365
|
+
.params('room.typed.save', { entryType: 'core:entry/location' })
|
|
366
|
+
.params('room.drafted.save', { entryType: 'core:entry/location' })
|
|
367
|
+
// Plain names, one sentence (B12).
|
|
368
|
+
.params('onward', { path: '', separator: ' ' })
|
|
369
|
+
// B6: the rooms, where the party stand, and the way
|
|
370
|
+
// between — one row, read the same from either end.
|
|
371
|
+
.params('gather.rooms.read', { entryTypes: ['core:entry/location'] })
|
|
372
|
+
.params('here', { path: 'world.location' })
|
|
373
|
+
// The room the place slot shows (the room rule) — the world's
|
|
374
|
+
// location alone, where `here` also falls back to the vantage.
|
|
375
|
+
.params('place', { path: 'world.location' })
|
|
376
|
+
.params('link.resolved.write', { linkType: 'leads to', reverseLinkType: 'leads to' }))
|
|
377
|
+
.build());
|
|
378
|
+
//# sourceMappingURL=roomAnswer.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Lair's **Trigger trap** action. The genre's actions are introduced in
|
|
3
|
+
* `index.ts`.
|
|
4
|
+
*/
|
|
5
|
+
/** @internal */
|
|
6
|
+
export declare const LAIR_TRAP_SPEC_ID = "core:spec/lair-trap";
|
|
7
|
+
/** @internal */
|
|
8
|
+
export declare const LAIR_TRAP_VERSION = "1.0.0";
|
|
9
|
+
/** Spring something the party walked into. The Castellan tells them what it cost. @internal */
|
|
10
|
+
export declare const lairTrapSpec: () => import("@serene-pub/sdk").SpecDocument;
|
|
11
|
+
//# sourceMappingURL=trap.d.ts.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Lair's **Trigger trap** action. The genre's actions are introduced in
|
|
3
|
+
* `index.ts`.
|
|
4
|
+
*/
|
|
5
|
+
import { castellanAction } from './castellanAction.js';
|
|
6
|
+
// ⚠ Trap and Reveal, edited in place (history window, 2026-10-03) —
|
|
7
|
+
// content-addressed; `specHashes.test.ts` records the move. The shared
|
|
8
|
+
// `castellanAction` computes `contextBudget` before the reads and its history
|
|
9
|
+
// read takes the `budget`, so the transcript fit, not the newest 100 rows,
|
|
10
|
+
// decides where the conversation starts.
|
|
11
|
+
/** @internal */
|
|
12
|
+
export const LAIR_TRAP_SPEC_ID = 'core:spec/lair-trap';
|
|
13
|
+
/** @internal */
|
|
14
|
+
export const LAIR_TRAP_VERSION = '1.0.0';
|
|
15
|
+
/** Spring something the party walked into. The Castellan tells them what it cost. @internal */
|
|
16
|
+
export const lairTrapSpec = () => castellanAction(LAIR_TRAP_SPEC_ID, LAIR_TRAP_VERSION, {
|
|
17
|
+
key: 'trap',
|
|
18
|
+
icon: 'zap',
|
|
19
|
+
label: 'Trigger trap',
|
|
20
|
+
description: 'Springs a trap in the room the party are in, and the Castellan tells what it cost them. Say what the trap is, or leave it to the room.',
|
|
21
|
+
status: 'Springing a trap',
|
|
22
|
+
ask: 'What is the trap?',
|
|
23
|
+
});
|
|
24
|
+
//# sourceMappingURL=trap.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Lair's turn order: `turnOrderSpec` (`factories/turnOrder.ts`) for the Lair.
|
|
3
|
+
*/
|
|
4
|
+
import { type TurnOrderHandle } from '../../factories/turnOrder.js';
|
|
5
|
+
/** @experimental */
|
|
6
|
+
export declare const LAIR_TURN_ORDER_SPEC_ID = "core:spec/lair-turn-order";
|
|
7
|
+
/** The Lair's turn order, by value — hand `build()` and `strategyNode` to `swaps` (R26). @experimental */
|
|
8
|
+
export declare const lairTurnOrder: TurnOrderHandle;
|
|
9
|
+
//# sourceMappingURL=turnOrder.d.ts.map
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Lair's turn order: `turnOrderSpec` (`factories/turnOrder.ts`) for the Lair.
|
|
3
|
+
*/
|
|
4
|
+
import * as C from '@serene-pub/contracts';
|
|
5
|
+
import { lairGenre } from '../../registry/genres.js';
|
|
6
|
+
import { TURN_ORDER_NARRATOR_EVENTS, turnOrderSpec, turnStrategyNode } from '../../factories/turnOrder.js';
|
|
7
|
+
import { once } from '../../factories/once.js';
|
|
8
|
+
/** @experimental */
|
|
9
|
+
export const LAIR_TURN_ORDER_SPEC_ID = 'core:spec/lair-turn-order';
|
|
10
|
+
/**
|
|
11
|
+
* 🚧 The Lair: its active delvers are seated (owner ruling 2026-09-30, "they
|
|
12
|
+
* are character turns"). The narrator strategy still seats nobody by rule;
|
|
13
|
+
* what the pool admits is who a standing turn plan may prepare a character
|
|
14
|
+
* turn for, since an entry naming somebody the pool did not admit is dropped
|
|
15
|
+
* at the write. Envoys stay out: the Castellan's turns are the null entry's.
|
|
16
|
+
*/
|
|
17
|
+
const PARTY = { characters: 'active', envoys: 'none' };
|
|
18
|
+
/** The Lair's turn order, by value — hand `build()` and `strategyNode` to `swaps` (R26). @experimental */
|
|
19
|
+
export const lairTurnOrder = {
|
|
20
|
+
genre: lairGenre,
|
|
21
|
+
spec: LAIR_TURN_ORDER_SPEC_ID,
|
|
22
|
+
events: TURN_ORDER_NARRATOR_EVENTS,
|
|
23
|
+
build: once(() => turnOrderSpec({
|
|
24
|
+
id: LAIR_TURN_ORDER_SPEC_ID,
|
|
25
|
+
genre: lairGenre,
|
|
26
|
+
events: TURN_ORDER_NARRATOR_EVENTS,
|
|
27
|
+
strategy: C.turnNarrator,
|
|
28
|
+
// The delvers its plans name take character turns.
|
|
29
|
+
pool: PARTY,
|
|
30
|
+
// Every channel (R6): a line on the Sanctum prepares the
|
|
31
|
+
// Castellan's reply there, as a line on `main` prepares its turn.
|
|
32
|
+
historyChannel: '*',
|
|
33
|
+
})),
|
|
34
|
+
strategyNode: turnStrategyNode({}),
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=turnOrder.js.map
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Lair's **Whisper** action. The genre's actions are introduced in
|
|
3
|
+
* `index.ts`.
|
|
4
|
+
*/
|
|
5
|
+
/** @internal */
|
|
6
|
+
export declare const LAIR_WHISPER_SPEC_ID = "core:spec/lair-whisper";
|
|
7
|
+
/** @internal */
|
|
8
|
+
export declare const LAIR_WHISPER_VERSION = "1.0.0";
|
|
9
|
+
/**
|
|
10
|
+
* **Whisper**: a private instruction to the delvers the master picks, which
|
|
11
|
+
* writes no message (lair re-plan R10, owner ruling 5, 2026-09-28).
|
|
12
|
+
*
|
|
13
|
+
* The press collects **who hears it** (`collects.recipients`, the session's
|
|
14
|
+
* enabled cast, validated by the host) and **what it says**
|
|
15
|
+
* (`collects.text`), and the run writes that line on
|
|
16
|
+
* `core:slot/whisper@1` of each recipient — `resolve-state-changes@1`'s
|
|
17
|
+
* `owners` port makes the one change once per recipient. **Pure:** no model
|
|
18
|
+
* call. The model step that read a name off the typed line ("Verity: hold
|
|
19
|
+
* the line") and its "Lair whisper" prompt row are retired: the modal asks
|
|
20
|
+
* who, so nothing has to guess.
|
|
21
|
+
*
|
|
22
|
+
* **Heard by the recipients alone** (earshot, lair pass R1): the slot
|
|
23
|
+
* declares `earshot: 'holder'`, so each recipient's own voice reads it and no
|
|
24
|
+
* other prompt does — not another delver's, and none of the Castellan's
|
|
25
|
+
* (planner, keeper, narration, Sanctum talk). A whispered delver acts on it
|
|
26
|
+
* when they next speak; **Pick who speaks** gives them the floor now.
|
|
27
|
+
*
|
|
28
|
+
* ⚠ One standing note per delver, not a queue: a slot holds one value, so a
|
|
29
|
+
* new whisper REPLACES a recipient's old one, and a delver it does not name
|
|
30
|
+
* keeps theirs. The modal shows each delver's current whisper
|
|
31
|
+
* (`recipients.overwrites`), so the overwrite is visible before it happens.
|
|
32
|
+
* @internal
|
|
33
|
+
*/
|
|
34
|
+
export declare const lairWhisperSpec: () => import("@serene-pub/sdk").SpecDocument;
|
|
35
|
+
//# sourceMappingURL=whisper.d.ts.map
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Lair's **Whisper** action. The genre's actions are introduced in
|
|
3
|
+
* `index.ts`.
|
|
4
|
+
*/
|
|
5
|
+
import { compile, slot, spec, sessionEvents } from '@serene-pub/sdk';
|
|
6
|
+
import * as C from '@serene-pub/contracts';
|
|
7
|
+
import { lairGenre } from '../../registry/genres.js';
|
|
8
|
+
/** @internal */
|
|
9
|
+
export const LAIR_WHISPER_SPEC_ID = 'core:spec/lair-whisper';
|
|
10
|
+
/** @internal */
|
|
11
|
+
export const LAIR_WHISPER_VERSION = '1.0.0';
|
|
12
|
+
/**
|
|
13
|
+
* **Whisper**: a private instruction to the delvers the master picks, which
|
|
14
|
+
* writes no message (lair re-plan R10, owner ruling 5, 2026-09-28).
|
|
15
|
+
*
|
|
16
|
+
* The press collects **who hears it** (`collects.recipients`, the session's
|
|
17
|
+
* enabled cast, validated by the host) and **what it says**
|
|
18
|
+
* (`collects.text`), and the run writes that line on
|
|
19
|
+
* `core:slot/whisper@1` of each recipient — `resolve-state-changes@1`'s
|
|
20
|
+
* `owners` port makes the one change once per recipient. **Pure:** no model
|
|
21
|
+
* call. The model step that read a name off the typed line ("Verity: hold
|
|
22
|
+
* the line") and its "Lair whisper" prompt row are retired: the modal asks
|
|
23
|
+
* who, so nothing has to guess.
|
|
24
|
+
*
|
|
25
|
+
* **Heard by the recipients alone** (earshot, lair pass R1): the slot
|
|
26
|
+
* declares `earshot: 'holder'`, so each recipient's own voice reads it and no
|
|
27
|
+
* other prompt does — not another delver's, and none of the Castellan's
|
|
28
|
+
* (planner, keeper, narration, Sanctum talk). A whispered delver acts on it
|
|
29
|
+
* when they next speak; **Pick who speaks** gives them the floor now.
|
|
30
|
+
*
|
|
31
|
+
* ⚠ One standing note per delver, not a queue: a slot holds one value, so a
|
|
32
|
+
* new whisper REPLACES a recipient's old one, and a delver it does not name
|
|
33
|
+
* keeps theirs. The modal shows each delver's current whisper
|
|
34
|
+
* (`recipients.overwrites`), so the overwrite is visible before it happens.
|
|
35
|
+
* @internal
|
|
36
|
+
*/
|
|
37
|
+
export const lairWhisperSpec = () => compile(spec(LAIR_WHISPER_SPEC_ID, {
|
|
38
|
+
version: LAIR_WHISPER_VERSION,
|
|
39
|
+
taxonomy: { role: 'action' },
|
|
40
|
+
contributes: {
|
|
41
|
+
actions: [
|
|
42
|
+
{
|
|
43
|
+
key: 'whisper',
|
|
44
|
+
venue: { kind: 'composer' },
|
|
45
|
+
quick: true,
|
|
46
|
+
icon: 'ear',
|
|
47
|
+
/** Who hears it and what it says (R3, R10): nothing to do without either. */
|
|
48
|
+
collects: {
|
|
49
|
+
recipients: {
|
|
50
|
+
label: { en: 'Who hears it' },
|
|
51
|
+
min: 1,
|
|
52
|
+
overwrites: 'core:slot/whisper@1',
|
|
53
|
+
},
|
|
54
|
+
text: { need: 'required', label: { en: 'What do you whisper?' } },
|
|
55
|
+
},
|
|
56
|
+
label: { en: 'Whisper' },
|
|
57
|
+
description: {
|
|
58
|
+
en: 'Tell the delvers you pick something only they hear. Nobody else does — not the rest of the party, and not the Castellan.',
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
],
|
|
62
|
+
},
|
|
63
|
+
})
|
|
64
|
+
.inlet('input', C.userMessage.v1(), {
|
|
65
|
+
genre: lairGenre,
|
|
66
|
+
event: sessionEvents.sessionAction,
|
|
67
|
+
})
|
|
68
|
+
.query('state', ($) => C.sessionState.v1({ scope: $.input.sessionScope }))
|
|
69
|
+
/**
|
|
70
|
+
* One change naming no owner, made once per recipient: the
|
|
71
|
+
* `owners` port is what turns `character:<id>` into that seated
|
|
72
|
+
* delver's row, and the slot's own validation is what refuses a
|
|
73
|
+
* line longer than it accepts, with a sentence.
|
|
74
|
+
*/
|
|
75
|
+
.query('resolve', ($) => C.resolveStateChanges.v1({
|
|
76
|
+
changes: [{ slot: 'whisper', value: $.input.text }],
|
|
77
|
+
owners: $.input.recipients,
|
|
78
|
+
scope: $.input.sessionScope,
|
|
79
|
+
base: $.state.version,
|
|
80
|
+
}))
|
|
81
|
+
/** Applied rather than proposed — the master's own instruction; see Nudge. */
|
|
82
|
+
.task('apply', ($) => C.setState.v1({
|
|
83
|
+
changes: $.resolve.changes,
|
|
84
|
+
scope: $.input.sessionScope,
|
|
85
|
+
base: $.state.version,
|
|
86
|
+
params: slot.params(),
|
|
87
|
+
}))
|
|
88
|
+
.preset('lair', { label: 'Lair', default: true }, (p) => p.params('apply', { mode: 'apply' }))
|
|
89
|
+
.build());
|
|
90
|
+
//# sourceMappingURL=whisper.js.map
|