@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
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The **guide** genre's two pipelines (plans/29 R-18; 09-B B10; built
|
|
3
3
|
* 2026-09-16 as U5g): the create pipeline that is the genre's required
|
|
4
|
-
* member, and the reply that answers as the genre's envoy
|
|
4
|
+
* member (`create.ts`), and the reply that answers as the genre's envoy (this
|
|
5
|
+
* file).
|
|
5
6
|
*
|
|
6
7
|
* ## What `guide-respond` is
|
|
7
8
|
*
|
|
8
|
-
* `core:spec/respond` with the lore machinery replaced by one mechanism. A
|
|
9
|
+
* `core:spec/chat-respond` with the lore machinery replaced by one mechanism. A
|
|
9
10
|
* reply here is inlet → placeholder → (history, cast, docs) → speaker →
|
|
10
11
|
* budget → rank → context → lines → assemble → generate → save: the same
|
|
11
12
|
* spine, the same nodes, the same story string — so the parity of a reply
|
|
@@ -44,62 +45,11 @@
|
|
|
44
45
|
*/
|
|
45
46
|
import { compile, handlebars, slot, spec, sessionEvents } from '@serene-pub/sdk';
|
|
46
47
|
import * as C from '@serene-pub/contracts';
|
|
47
|
-
import {
|
|
48
|
-
import { GUIDE_MASCOT_KEY, guideGenre, POST_HISTORY_TOKEN_TRIGGER } from './genres.js';
|
|
49
|
-
/** Where Serene's greeting lands: the channel her declaration names. */
|
|
50
|
-
const SERENE_GREETING_CHANNEL = guideGenre.envoys?.find((e) => e.key === GUIDE_MASCOT_KEY)?.greeting?.channel ?? 'main';
|
|
51
|
-
/** @internal */
|
|
52
|
-
export const CREATE_GUIDE_SPEC_ID = 'core:spec/create-guide';
|
|
53
|
-
/** @internal */
|
|
54
|
-
export const CREATE_GUIDE_VERSION = '1.1.0';
|
|
55
|
-
/**
|
|
56
|
-
* The guide's create pipeline — the genre's one required member (24 §3).
|
|
57
|
-
*
|
|
58
|
-
* The same two nodes as `create-chat` — which, with no characters to greet
|
|
59
|
-
* with, write nothing — then Serene's declared greeting (`EnvoyDecl.greeting`),
|
|
60
|
-
* read through `core:query/envoy-greeting@1` and interpolated for this
|
|
61
|
-
* session, written on `main` under her name: only when it has text, which it
|
|
62
|
-
* lacks when she is not seated. No model call: a person is waiting on a
|
|
63
|
-
* create, so the welcome is declared, instant and translatable.
|
|
64
|
-
* The genre's declaration — envoys included — rides `meta.genre` on the
|
|
65
|
-
* version row, which is where the host reads "which speakers does this genre
|
|
66
|
-
* bring" from (`listSessionGenres`).
|
|
67
|
-
* @internal
|
|
68
|
-
*/
|
|
69
|
-
export const createGuideSpec = () => compile(spec(CREATE_GUIDE_SPEC_ID, {
|
|
70
|
-
version: CREATE_GUIDE_VERSION,
|
|
71
|
-
taxonomy: { role: 'create' },
|
|
72
|
-
genre: {
|
|
73
|
-
name: guideGenre.name,
|
|
74
|
-
family: guideGenre.family,
|
|
75
|
-
description: guideGenre.description,
|
|
76
|
-
shape: guideGenre.shape,
|
|
77
|
-
events: guideGenre.events,
|
|
78
|
-
envoys: guideGenre.envoys,
|
|
79
|
-
},
|
|
80
|
-
})
|
|
81
|
-
.inlet('input', C.sessionCreated.v1(), {
|
|
82
|
-
genre: guideGenre,
|
|
83
|
-
event: sessionEvents.sessionCreated,
|
|
84
|
-
})
|
|
85
|
-
.query('collect', ($) => C.sessionGreetings.v1({ scope: $.input.sessionScope }))
|
|
86
|
-
.outlet('seed', ($) => C.seedGreetings.v1({
|
|
87
|
-
greetings: $.collect.greetings,
|
|
88
|
-
channel: guideGenre.shape?.greeting?.channel ?? 'main',
|
|
89
|
-
}))
|
|
90
|
-
/** Serene's greeting, interpolated — empty when she is not seated. */
|
|
91
|
-
.query('welcome', ($) => C.envoyGreeting.v1({ scope: $.input.sessionScope, params: slot.params() }))
|
|
92
|
-
.junction('greet', { on: ($) => $.welcome.text }, (g) => g.when('greets', { truthy: true }, (c) => c.outlet('write', ($) => C.createMessage.v1({
|
|
93
|
-
text: $.welcome.text,
|
|
94
|
-
channel: SERENE_GREETING_CHANNEL,
|
|
95
|
-
speaker: `envoy:${GUIDE_MASCOT_KEY}`,
|
|
96
|
-
}))))
|
|
97
|
-
.preset('guide', { label: 'Guide', default: true }, (p) => p.params('welcome', { envoy: GUIDE_MASCOT_KEY }))
|
|
98
|
-
.build());
|
|
48
|
+
import { GUIDE_MASCOT_KEY, guideGenre, POST_HISTORY_TOKEN_TRIGGER } from '../../registry/genres.js';
|
|
99
49
|
/** @internal */
|
|
100
50
|
export const GUIDE_RESPOND_SPEC_ID = 'core:spec/guide-respond';
|
|
101
51
|
// 1.1.0: the `speaker` node moved to `core:spec/turn-order` — see
|
|
102
|
-
// `
|
|
52
|
+
// `CHAT_RESPOND_VERSION`, same change, same reason.
|
|
103
53
|
// 1.2.0 (2026-09-27): the guide's own template, as the spec's default preset
|
|
104
54
|
// — the docs arrive in their declared `docsExcerpts` band, framed as the only
|
|
105
55
|
// source of truth, with an explicit line for a turn nothing matched. The
|
|
@@ -112,6 +62,10 @@ export const GUIDE_RESPOND_SPEC_ID = 'core:spec/guide-respond';
|
|
|
112
62
|
// reads and the history read takes its `budget`: about twice the window's
|
|
113
63
|
// worth of the newest rows (never more than 2000) instead of the newest 100,
|
|
114
64
|
// so the transcript fit decides where the conversation starts.
|
|
65
|
+
// ⚠ Edited in place (2026-10-05, sprites in-pipeline) — content-addressed;
|
|
66
|
+
// `specHashes.test.ts` records the move. The sprite step is written out after
|
|
67
|
+
// `save` (`spritePick`, `spriteShow`) where the retired `withSpriteTail`
|
|
68
|
+
// wrapper appended nodes this source never named.
|
|
115
69
|
/** @internal */
|
|
116
70
|
export const GUIDE_RESPOND_VERSION = '1.2.0';
|
|
117
71
|
/**
|
|
@@ -212,9 +166,7 @@ Character reminder:
|
|
|
212
166
|
{{/if}}
|
|
213
167
|
{{/each}}`;
|
|
214
168
|
/** The guide's reply: the envoy answers, grounded in the docs. @internal */
|
|
215
|
-
export const guideRespondSpec = () => compile(
|
|
216
|
-
// The sprite tail (DESIGN-sprites §5): after `save`, choose the line's face.
|
|
217
|
-
withSpriteTail(spec(GUIDE_RESPOND_SPEC_ID, {
|
|
169
|
+
export const guideRespondSpec = () => compile(spec(GUIDE_RESPOND_SPEC_ID, {
|
|
218
170
|
version: GUIDE_RESPOND_VERSION,
|
|
219
171
|
taxonomy: { role: 'primary' },
|
|
220
172
|
})
|
|
@@ -374,7 +326,24 @@ withSpriteTail(spec(GUIDE_RESPOND_SPEC_ID, {
|
|
|
374
326
|
target: $.placeholder.messageId,
|
|
375
327
|
text: $.generate.text,
|
|
376
328
|
reasoning: $.generate.reasoning,
|
|
377
|
-
}))
|
|
329
|
+
}))
|
|
330
|
+
/**
|
|
331
|
+
* The line's face (DESIGN-sprites §5) — see `respond`. The Guide
|
|
332
|
+
* seats no characters and its mascot is an envoy with no card, so
|
|
333
|
+
* today this picks nothing: the step is written in like every reply
|
|
334
|
+
* spec's, and costs nothing until a speaker has sprites.
|
|
335
|
+
*/
|
|
336
|
+
.oracle('spritePick', ($) => C.pickSprite.v1({
|
|
337
|
+
text: $.generate.text,
|
|
338
|
+
speaker: $.input.speaker,
|
|
339
|
+
scope: $.input.sessionScope,
|
|
340
|
+
params: slot.params(),
|
|
341
|
+
}), { expose: { session: true } })
|
|
342
|
+
.outlet('spriteShow', ($) => C.showSprite.v1({
|
|
343
|
+
target: $.save.messageId,
|
|
344
|
+
pick: $.spritePick.main,
|
|
345
|
+
source: 'picker',
|
|
346
|
+
}))
|
|
378
347
|
/** The guide's own template (1.2.0) — see `GUIDE_RESPOND_TEMPLATE`. */
|
|
379
348
|
.preset('guide', { label: 'Guide', default: true }, (p) => p
|
|
380
349
|
.template('prompt', {
|
|
@@ -383,4 +352,4 @@ withSpriteTail(spec(GUIDE_RESPOND_SPEC_ID, {
|
|
|
383
352
|
})
|
|
384
353
|
.params('prompt', { postHistoryTokenTrigger: POST_HISTORY_TOKEN_TRIGGER }))
|
|
385
354
|
.build());
|
|
386
|
-
//# sourceMappingURL=
|
|
355
|
+
//# sourceMappingURL=respond.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The guide's turn order: `turnOrderSpec` (`factories/turnOrder.ts`) for the
|
|
3
|
+
* guide genre.
|
|
4
|
+
*/
|
|
5
|
+
import { type TurnOrderHandle } from '../../factories/turnOrder.js';
|
|
6
|
+
/** @experimental */
|
|
7
|
+
export declare const GUIDE_TURN_ORDER_SPEC_ID = "core:spec/guide-turn-order";
|
|
8
|
+
/** Guide's turn order, by value — hand `build()` and `strategyNode` to `swaps` (R26). @experimental */
|
|
9
|
+
export declare const guideTurnOrder: TurnOrderHandle;
|
|
10
|
+
//# sourceMappingURL=turnOrder.d.ts.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The guide's turn order: `turnOrderSpec` (`factories/turnOrder.ts`) for the
|
|
3
|
+
* guide genre.
|
|
4
|
+
*/
|
|
5
|
+
import * as C from '@serene-pub/contracts';
|
|
6
|
+
import { guideGenre } from '../../registry/genres.js';
|
|
7
|
+
import { TURN_ORDER_EVENTS, turnOrderSpec, turnStrategyNode } from '../../factories/turnOrder.js';
|
|
8
|
+
import { once } from '../../factories/once.js';
|
|
9
|
+
/** @experimental */
|
|
10
|
+
export const GUIDE_TURN_ORDER_SPEC_ID = 'core:spec/guide-turn-order';
|
|
11
|
+
/** Guide: its one in-turn envoy is the whole order. */
|
|
12
|
+
const ENVOY_ONLY = { characters: 'none', envoys: 'in-turn' };
|
|
13
|
+
/** Guide's turn order, by value — hand `build()` and `strategyNode` to `swaps` (R26). @experimental */
|
|
14
|
+
export const guideTurnOrder = {
|
|
15
|
+
genre: guideGenre,
|
|
16
|
+
spec: GUIDE_TURN_ORDER_SPEC_ID,
|
|
17
|
+
events: TURN_ORDER_EVENTS,
|
|
18
|
+
build: once(() => turnOrderSpec({
|
|
19
|
+
id: GUIDE_TURN_ORDER_SPEC_ID,
|
|
20
|
+
genre: guideGenre,
|
|
21
|
+
events: TURN_ORDER_EVENTS,
|
|
22
|
+
strategy: C.turnRoundRobin,
|
|
23
|
+
pool: ENVOY_ONLY,
|
|
24
|
+
})),
|
|
25
|
+
strategyNode: turnStrategyNode({}),
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=turnOrder.js.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { TurnOrderHandle } from '../factories/turnOrder.js';
|
|
2
|
+
export * from './chat/index.js';
|
|
3
|
+
export * from './guide/index.js';
|
|
4
|
+
export * from './adventure/index.js';
|
|
5
|
+
export * from './lair/index.js';
|
|
6
|
+
/** Every answer pipeline core ships, by the genre it serves. @internal */
|
|
7
|
+
export declare const ANSWER_FORM_SPEC_IDS: Readonly<Record<string, string>>;
|
|
8
|
+
/**
|
|
9
|
+
* Core's four (§4.14's table): which genre gets which spec, on which events —
|
|
10
|
+
* what the presets bind and what `CORE_SPECS` publishes.
|
|
11
|
+
* @experimental
|
|
12
|
+
*/
|
|
13
|
+
export declare const TURN_ORDER_BY_GENRE: ReadonlyArray<TurnOrderHandle>;
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core's four genres, a folder each (`chat`, `adventure`, `guide`, `lair`):
|
|
3
|
+
* every pipeline a genre is locked to, one per file, and any widget only that
|
|
4
|
+
* genre offers. What more than one genre uses lives in `../shared`; the
|
|
5
|
+
* builders a genre calls (answer form, turn order) in `../factories`; the
|
|
6
|
+
* genres' declarations themselves in `../registry`.
|
|
7
|
+
*
|
|
8
|
+
* Below, the two lists that span the four.
|
|
9
|
+
*/
|
|
10
|
+
import { adventureGenre, chatGenre, guideGenre, lairGenre } from '../registry/genres.js';
|
|
11
|
+
import { CHAT_ANSWER_FORM_SPEC_ID } from './chat/answerForm.js';
|
|
12
|
+
import { ADVENTURE_ANSWER_FORM_SPEC_ID } from './adventure/answerForm.js';
|
|
13
|
+
import { GUIDE_ANSWER_FORM_SPEC_ID } from './guide/answerForm.js';
|
|
14
|
+
import { LAIR_ANSWER_FORM_SPEC_ID } from './lair/answerForm.js';
|
|
15
|
+
import { chatTurnOrder } from './chat/turnOrder.js';
|
|
16
|
+
import { guideTurnOrder } from './guide/turnOrder.js';
|
|
17
|
+
import { adventureTurnOrder } from './adventure/turnOrder.js';
|
|
18
|
+
import { lairTurnOrder } from './lair/turnOrder.js';
|
|
19
|
+
export * from './chat/index.js';
|
|
20
|
+
export * from './guide/index.js';
|
|
21
|
+
export * from './adventure/index.js';
|
|
22
|
+
export * from './lair/index.js';
|
|
23
|
+
/** Every answer pipeline core ships, by the genre it serves. @internal */
|
|
24
|
+
export const ANSWER_FORM_SPEC_IDS = Object.freeze({
|
|
25
|
+
[chatGenre.id]: CHAT_ANSWER_FORM_SPEC_ID,
|
|
26
|
+
[adventureGenre.id]: ADVENTURE_ANSWER_FORM_SPEC_ID,
|
|
27
|
+
[guideGenre.id]: GUIDE_ANSWER_FORM_SPEC_ID,
|
|
28
|
+
[lairGenre.id]: LAIR_ANSWER_FORM_SPEC_ID,
|
|
29
|
+
});
|
|
30
|
+
/**
|
|
31
|
+
* Core's four (§4.14's table): which genre gets which spec, on which events —
|
|
32
|
+
* what the presets bind and what `CORE_SPECS` publishes.
|
|
33
|
+
* @experimental
|
|
34
|
+
*/
|
|
35
|
+
export const TURN_ORDER_BY_GENRE = [
|
|
36
|
+
chatTurnOrder,
|
|
37
|
+
guideTurnOrder,
|
|
38
|
+
adventureTurnOrder,
|
|
39
|
+
lairTurnOrder,
|
|
40
|
+
];
|
|
41
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Lair's answer pipeline: `answerFormSpec` (`factories/answerForm.ts`),
|
|
3
|
+
* published for the Lair.
|
|
4
|
+
*/
|
|
5
|
+
/** @internal */
|
|
6
|
+
export declare const LAIR_ANSWER_FORM_SPEC_ID = "core:spec/lair-answer-form";
|
|
7
|
+
/**
|
|
8
|
+
* Lair's, on the same terms as the other three (one graph, published once per
|
|
9
|
+
* shipped genre because a preset binds a spec whose inlet lock names its
|
|
10
|
+
* genre). Its forms are addressed to the **owner**, which is a person, so this
|
|
11
|
+
* pipeline is what waits for the day a Lair session seats an AI in a seat a
|
|
12
|
+
* form is put to — core records `form-addressed` only when the resolver says
|
|
13
|
+
* the AI portrays the addressee, and `owner` never resolves that way.
|
|
14
|
+
* @internal
|
|
15
|
+
*/
|
|
16
|
+
export declare const answerFormLairSpec: () => import("@serene-pub/sdk").SpecDocument;
|
|
17
|
+
//# sourceMappingURL=answerForm.d.ts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Lair's answer pipeline: `answerFormSpec` (`factories/answerForm.ts`),
|
|
3
|
+
* published for the Lair.
|
|
4
|
+
*/
|
|
5
|
+
import { lairGenre } from '../../registry/genres.js';
|
|
6
|
+
import { answerFormSpec } from '../../factories/answerForm.js';
|
|
7
|
+
/** @internal */
|
|
8
|
+
export const LAIR_ANSWER_FORM_SPEC_ID = 'core:spec/lair-answer-form';
|
|
9
|
+
/**
|
|
10
|
+
* Lair's, on the same terms as the other three (one graph, published once per
|
|
11
|
+
* shipped genre because a preset binds a spec whose inlet lock names its
|
|
12
|
+
* genre). Its forms are addressed to the **owner**, which is a person, so this
|
|
13
|
+
* pipeline is what waits for the day a Lair session seats an AI in a seat a
|
|
14
|
+
* form is put to — core records `form-addressed` only when the resolver says
|
|
15
|
+
* the AI portrays the addressee, and `owner` never resolves that way.
|
|
16
|
+
* @internal
|
|
17
|
+
*/
|
|
18
|
+
export const answerFormLairSpec = () => answerFormSpec(LAIR_ANSWER_FORM_SPEC_ID, lairGenre);
|
|
19
|
+
//# sourceMappingURL=answerForm.js.map
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Lair's **Build room** action. The genre's actions are introduced in
|
|
3
|
+
* `index.ts`.
|
|
4
|
+
*/
|
|
5
|
+
/** @internal */
|
|
6
|
+
export declare const LAIR_BUILD_ROOM_SPEC_ID = "core:spec/lair-build-room";
|
|
7
|
+
/** @internal */
|
|
8
|
+
export declare const LAIR_BUILD_ROOM_VERSION = "1.0.0";
|
|
9
|
+
/**
|
|
10
|
+
* The layout a drafted room's body takes — its `Exits:` line among it — and
|
|
11
|
+
* why that line is still prose beside the graph.
|
|
12
|
+
*
|
|
13
|
+
* **The ways between rooms are relationships now** (places plan, 2026-09-29):
|
|
14
|
+
* one `narrative_relationships` row per way, read both ways when it has a
|
|
15
|
+
* reverse wording, drawn on the Places lens or in a place's own Links, and
|
|
16
|
+
* written by a pipeline through `core:outlet/link-lore-entries@1`. The Lair's
|
|
17
|
+
* rooms listing asks for them (`withLinks`), so `{{locationEntry}}` says a
|
|
18
|
+
* room's ways out under its body as "From here:" — that, not this line, is
|
|
19
|
+
* what the planner reads the ways on from. *Answer the door* links the room it
|
|
20
|
+
* writes to the room the party stand in (B6).
|
|
21
|
+
*
|
|
22
|
+
* ⚠ **The drafted `Exits:` line stays** (plan §11; how the map should grow is
|
|
23
|
+
* the owner's open Q4). A draft names ways out to rooms that may not exist
|
|
24
|
+
* yet, and nothing in the bound catalogue turns a line of prose into a list
|
|
25
|
+
* of names; parsing it at write time, with stub rooms for the names nothing
|
|
26
|
+
* answers, would change what a knock means. So the line is the room's own
|
|
27
|
+
* words — a reader still reads it, and an older room has only it — and the
|
|
28
|
+
* master turns it into links by hand, or with the place editor's *Read links
|
|
29
|
+
* from the Exits line* (B7). It stays a fixed line so a parser can take it
|
|
30
|
+
* apart.
|
|
31
|
+
* @internal
|
|
32
|
+
*/
|
|
33
|
+
export declare const LAIR_ROOM_CONTENT_SHAPE: string;
|
|
34
|
+
/**
|
|
35
|
+
* **Build room**: the master writes a room into the dungeon.
|
|
36
|
+
*
|
|
37
|
+
* The collected text (R3) is the room's **name** — the one thing a person always
|
|
38
|
+
* knows when they press this — and the model writes the body against the lore,
|
|
39
|
+
* the party's position and the fixed layout above. The name reaches the draft
|
|
40
|
+
* as `{{turnDirection}}`, and every room the dungeon already has as
|
|
41
|
+
* `{{knownLocations}}` (the rooms listing, plan A28) — the prompt's "name only
|
|
42
|
+
* rooms this dungeon already has" with the rooms in front of it. The world
|
|
43
|
+
* lore it reads carries no private entries. The write then parks at the
|
|
44
|
+
* review gate: `core:outlet/create-lore-entry@1` declares
|
|
45
|
+
* `review: { fields: ['name', 'content'] }`, and the preset below turns the
|
|
46
|
+
* gate ON — without that line `resolvePosition` defaults an undeclared position
|
|
47
|
+
* to `off` and this docblock's promise would be false, which it was until
|
|
48
|
+
* 2026-09-17. The gate IS the Build room form, with the name and the whole body
|
|
49
|
+
* editable before anything lands.
|
|
50
|
+
*
|
|
51
|
+
* **The entry is a location** (L3, contracts batch 2, 2026-09-17): the preset
|
|
52
|
+
* sets `entryType: 'core:entry/location'`, so a room files as a place rather
|
|
53
|
+
* than as world lore whose content happens to be laid out, and "which rows are
|
|
54
|
+
* the map" becomes a question a reader can ask. It is written with no links:
|
|
55
|
+
* a room built ahead of the party stands nowhere yet, and its drafted `Exits:`
|
|
56
|
+
* line is prose the master links by hand — see `LAIR_ROOM_CONTENT_SHAPE`.
|
|
57
|
+
*
|
|
58
|
+
* ⚠ **`effects: 'world'`** (R-15 *The line*): the result is lorebook data, so
|
|
59
|
+
* this action is the owner's, lives in the composer, and no message block may
|
|
60
|
+
* name it. That last rule is why the knock's form cannot save a room itself.
|
|
61
|
+
* @internal
|
|
62
|
+
*/
|
|
63
|
+
export declare const lairBuildRoomSpec: () => import("@serene-pub/sdk").SpecDocument;
|
|
64
|
+
//# sourceMappingURL=buildRoom.d.ts.map
|
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Lair's **Build room** 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
|
+
/* ── Build room ─────────────────────────────────────────────────────────── */
|
|
9
|
+
/** @internal */
|
|
10
|
+
export const LAIR_BUILD_ROOM_SPEC_ID = 'core:spec/lair-build-room';
|
|
11
|
+
// ⚠ Every Lair action that ranks (build room, answer the door, file as a
|
|
12
|
+
// room, and the Castellan's whisper/trap/reveal builder), edited in place
|
|
13
|
+
// (lorebooks C2, 2026-10-02): a `presences` read and an `eligible` step
|
|
14
|
+
// (`core:task/eligibility@1`) between `lore` and `rank`; and Build room,
|
|
15
|
+
// Answer the door and File as a room, which show the party's room under
|
|
16
|
+
// `{{locationEntry}}`, take the room rule — a `place` step wired into `rank`
|
|
17
|
+
// as `shownElsewhere`. Content-addressed; `specHashes.test.ts` records the
|
|
18
|
+
// moves.
|
|
19
|
+
/** @internal */
|
|
20
|
+
export const LAIR_BUILD_ROOM_VERSION = '1.0.0';
|
|
21
|
+
/**
|
|
22
|
+
* The layout a drafted room's body takes — its `Exits:` line among it — and
|
|
23
|
+
* why that line is still prose beside the graph.
|
|
24
|
+
*
|
|
25
|
+
* **The ways between rooms are relationships now** (places plan, 2026-09-29):
|
|
26
|
+
* one `narrative_relationships` row per way, read both ways when it has a
|
|
27
|
+
* reverse wording, drawn on the Places lens or in a place's own Links, and
|
|
28
|
+
* written by a pipeline through `core:outlet/link-lore-entries@1`. The Lair's
|
|
29
|
+
* rooms listing asks for them (`withLinks`), so `{{locationEntry}}` says a
|
|
30
|
+
* room's ways out under its body as "From here:" — that, not this line, is
|
|
31
|
+
* what the planner reads the ways on from. *Answer the door* links the room it
|
|
32
|
+
* writes to the room the party stand in (B6).
|
|
33
|
+
*
|
|
34
|
+
* ⚠ **The drafted `Exits:` line stays** (plan §11; how the map should grow is
|
|
35
|
+
* the owner's open Q4). A draft names ways out to rooms that may not exist
|
|
36
|
+
* yet, and nothing in the bound catalogue turns a line of prose into a list
|
|
37
|
+
* of names; parsing it at write time, with stub rooms for the names nothing
|
|
38
|
+
* answers, would change what a knock means. So the line is the room's own
|
|
39
|
+
* words — a reader still reads it, and an older room has only it — and the
|
|
40
|
+
* master turns it into links by hand, or with the place editor's *Read links
|
|
41
|
+
* from the Exits line* (B7). It stays a fixed line so a parser can take it
|
|
42
|
+
* apart.
|
|
43
|
+
* @internal
|
|
44
|
+
*/
|
|
45
|
+
export const LAIR_ROOM_CONTENT_SHAPE = [
|
|
46
|
+
'Exits: <direction> → <room>, <direction> → <room>',
|
|
47
|
+
'Contents: …',
|
|
48
|
+
'Hazards: …',
|
|
49
|
+
'Occupants: …',
|
|
50
|
+
].join('\n');
|
|
51
|
+
/**
|
|
52
|
+
* **Build room**: the master writes a room into the dungeon.
|
|
53
|
+
*
|
|
54
|
+
* The collected text (R3) is the room's **name** — the one thing a person always
|
|
55
|
+
* knows when they press this — and the model writes the body against the lore,
|
|
56
|
+
* the party's position and the fixed layout above. The name reaches the draft
|
|
57
|
+
* as `{{turnDirection}}`, and every room the dungeon already has as
|
|
58
|
+
* `{{knownLocations}}` (the rooms listing, plan A28) — the prompt's "name only
|
|
59
|
+
* rooms this dungeon already has" with the rooms in front of it. The world
|
|
60
|
+
* lore it reads carries no private entries. The write then parks at the
|
|
61
|
+
* review gate: `core:outlet/create-lore-entry@1` declares
|
|
62
|
+
* `review: { fields: ['name', 'content'] }`, and the preset below turns the
|
|
63
|
+
* gate ON — without that line `resolvePosition` defaults an undeclared position
|
|
64
|
+
* to `off` and this docblock's promise would be false, which it was until
|
|
65
|
+
* 2026-09-17. The gate IS the Build room form, with the name and the whole body
|
|
66
|
+
* editable before anything lands.
|
|
67
|
+
*
|
|
68
|
+
* **The entry is a location** (L3, contracts batch 2, 2026-09-17): the preset
|
|
69
|
+
* sets `entryType: 'core:entry/location'`, so a room files as a place rather
|
|
70
|
+
* than as world lore whose content happens to be laid out, and "which rows are
|
|
71
|
+
* the map" becomes a question a reader can ask. It is written with no links:
|
|
72
|
+
* a room built ahead of the party stands nowhere yet, and its drafted `Exits:`
|
|
73
|
+
* line is prose the master links by hand — see `LAIR_ROOM_CONTENT_SHAPE`.
|
|
74
|
+
*
|
|
75
|
+
* ⚠ **`effects: 'world'`** (R-15 *The line*): the result is lorebook data, so
|
|
76
|
+
* this action is the owner's, lives in the composer, and no message block may
|
|
77
|
+
* name it. That last rule is why the knock's form cannot save a room itself.
|
|
78
|
+
* @internal
|
|
79
|
+
*/
|
|
80
|
+
export const lairBuildRoomSpec = () => compile(spec(LAIR_BUILD_ROOM_SPEC_ID, {
|
|
81
|
+
version: LAIR_BUILD_ROOM_VERSION,
|
|
82
|
+
taxonomy: { role: 'action' },
|
|
83
|
+
contributes: {
|
|
84
|
+
actions: [
|
|
85
|
+
{
|
|
86
|
+
key: 'build-room',
|
|
87
|
+
venue: { kind: 'composer' },
|
|
88
|
+
quick: true,
|
|
89
|
+
icon: 'hammer',
|
|
90
|
+
/** The room's name is the whole instruction (R3): nothing to do without it. */
|
|
91
|
+
collects: { text: { need: 'required', label: { en: 'Room name' } } },
|
|
92
|
+
effects: 'world',
|
|
93
|
+
/** The owner's, and stated rather than inherited — see the note above. */
|
|
94
|
+
audience: { see: ['participant'], act: ['owner'] },
|
|
95
|
+
label: { en: 'Build room' },
|
|
96
|
+
description: {
|
|
97
|
+
en: "Write a room into the dungeon. Name it, and edit what the narrator drafts before it's saved.",
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
],
|
|
101
|
+
},
|
|
102
|
+
})
|
|
103
|
+
.inlet('input', C.userMessage.v1(), {
|
|
104
|
+
genre: lairGenre,
|
|
105
|
+
event: sessionEvents.sessionAction,
|
|
106
|
+
})
|
|
107
|
+
.gather('gather', { mode: 'parallel' }, (b) => b
|
|
108
|
+
.chain('history', (c) => c.query('read', ($) => C.sessionHistory.v1({
|
|
109
|
+
scope: $.input.sessionScope,
|
|
110
|
+
params: slot.params(),
|
|
111
|
+
})))
|
|
112
|
+
/** The world as the lore tells it, ranked against the conversation. */
|
|
113
|
+
.chain('lore', (c) => c.query('read', ($) => C.worldLore.v1({
|
|
114
|
+
scope: $.input.sessionScope,
|
|
115
|
+
params: slot.params(),
|
|
116
|
+
})))
|
|
117
|
+
.chain('cast', (c) => c.query('read', ($) => C.sessionCast.v1({ scope: $.input.sessionScope })))
|
|
118
|
+
.chain('state', (c) => c.query('read', ($) => C.sessionState.v1({ scope: $.input.sessionScope })))
|
|
119
|
+
/**
|
|
120
|
+
* Every room the dungeon holds (location entries, the
|
|
121
|
+
* preset), by listing rather than by rank — what this room
|
|
122
|
+
* has to join onto, named to the draft whatever the
|
|
123
|
+
* ranker admitted.
|
|
124
|
+
*/
|
|
125
|
+
.chain('rooms', (c) => c.query('read', ($) => C.lorebookEntries.v1({
|
|
126
|
+
scope: $.input.sessionScope,
|
|
127
|
+
params: slot.params(),
|
|
128
|
+
}))))
|
|
129
|
+
.task('contextBudget', ($) => C.contextBudget.v1({
|
|
130
|
+
sampling: slot.samplingOf('write'),
|
|
131
|
+
connection: slot.connectionOf('write'),
|
|
132
|
+
params: slot.params(),
|
|
133
|
+
}))
|
|
134
|
+
.task('lore', ($) => C.concatCandidates.v1({
|
|
135
|
+
sources: [$.gather.history.read.band, $.gather.lore.read.main],
|
|
136
|
+
}))
|
|
137
|
+
// The room `{{locationEntry}}` shows (the room rule, 2026-10-02):
|
|
138
|
+
// the world's location at `world.location` (the preset's `path`),
|
|
139
|
+
// by the one room rule; the ranker leaves it out of the lore.
|
|
140
|
+
.task('place', ($) => C.undescribedName.v1({
|
|
141
|
+
name: $.gather.state.read.state,
|
|
142
|
+
locationEntries: $.gather.rooms.read.entries,
|
|
143
|
+
params: slot.params(),
|
|
144
|
+
}), { expose: { label: 'The current place' } })
|
|
145
|
+
// Who is in the world at the session's moment (R4), for `eligible`.
|
|
146
|
+
.query('presences', ($) => C.castPresences.v1({ scope: $.input.sessionScope }))
|
|
147
|
+
// The hard gates before the ranker (C2; R2, R4): selective-logic
|
|
148
|
+
// exclusions from the keyword lanes, and the presence gate.
|
|
149
|
+
.task('eligible', ($) => C.eligibility.v1({
|
|
150
|
+
candidates: $.lore.candidates,
|
|
151
|
+
exclusions: $.gather.lore.read.exclusions,
|
|
152
|
+
presences: $.presences.main,
|
|
153
|
+
at: $.presences.at,
|
|
154
|
+
}))
|
|
155
|
+
.task('rank', ($) => C.rankHybrid.v1({
|
|
156
|
+
candidates: $.eligible.candidates,
|
|
157
|
+
budget: $.contextBudget.available,
|
|
158
|
+
shownElsewhere: $.place.entryId,
|
|
159
|
+
params: slot.params(),
|
|
160
|
+
}))
|
|
161
|
+
.task('context', ($) => C.buildTemplateContext.v1({
|
|
162
|
+
cast: $.gather.cast.read.cast,
|
|
163
|
+
state: $.gather.state.read.state,
|
|
164
|
+
locationEntries: $.gather.rooms.read.entries,
|
|
165
|
+
// The room's name, as the master typed it.
|
|
166
|
+
turnDirection: $.input.text,
|
|
167
|
+
prompts: slot.prompts(),
|
|
168
|
+
variables: slot.variables(),
|
|
169
|
+
}))
|
|
170
|
+
/** Prose and no seed: a room is drafted, not spoken. */
|
|
171
|
+
.task('lines', ($) => C.proseTranscript.v1({
|
|
172
|
+
messages: $.gather.history.read.messages,
|
|
173
|
+
cast: $.gather.cast.read.cast,
|
|
174
|
+
templateContext: $.context.templateContext,
|
|
175
|
+
}))
|
|
176
|
+
/**
|
|
177
|
+
* 🚧 **The transcript's files, placed** (attachments follow-ups, owner
|
|
178
|
+
* ruling 2026-10-03) — `respond`'s two steps: the files the rows show,
|
|
179
|
+
* then per line what `write` receives (an image it can read rides its
|
|
180
|
+
* own turn; otherwise its name). A transcript with no files passes
|
|
181
|
+
* through untouched, so the prompt is byte for byte what it was.
|
|
182
|
+
*/
|
|
183
|
+
.query('attachments', ($) => C.historyAttachments.v1({
|
|
184
|
+
messages: $.gather.history.read.messages,
|
|
185
|
+
params: slot.params(),
|
|
186
|
+
}))
|
|
187
|
+
.task('attached', ($) => C.placeAttachments.v1({
|
|
188
|
+
messages: $.lines.messages,
|
|
189
|
+
attachments: $.attachments.attachments,
|
|
190
|
+
connection: slot.connectionOf('write'),
|
|
191
|
+
params: slot.params(),
|
|
192
|
+
}))
|
|
193
|
+
.task('prompt', ($) => C.assemble.v2({
|
|
194
|
+
candidates: $.rank.candidates,
|
|
195
|
+
decisions: $.rank.decisions,
|
|
196
|
+
groups: $.rank.groups,
|
|
197
|
+
budget: $.contextBudget.available,
|
|
198
|
+
messages: $.attached.messages,
|
|
199
|
+
templateContext: $.context.templateContext,
|
|
200
|
+
template: slot.template(),
|
|
201
|
+
prompts: slot.prompts({ node: 'context' }),
|
|
202
|
+
variables: slot.variables(),
|
|
203
|
+
params: slot.params(),
|
|
204
|
+
connection: slot.connectionOf('write'),
|
|
205
|
+
}))
|
|
206
|
+
.oracle('write', ($) => C.generateText.v1({
|
|
207
|
+
context: $.prompt.context,
|
|
208
|
+
connection: slot.connection(),
|
|
209
|
+
sampling: slot.sampling(),
|
|
210
|
+
params: slot.params(),
|
|
211
|
+
}), { expose: { status: 'Building the room' } })
|
|
212
|
+
/**
|
|
213
|
+
* The name is what the master typed, never what the model wrote: a
|
|
214
|
+
* room the person named is a room they can find again, and the gate
|
|
215
|
+
* lets them fix it if the composer was empty.
|
|
216
|
+
*/
|
|
217
|
+
.outlet('save', ($) => C.createLoreEntry.v1({
|
|
218
|
+
name: $.input.text,
|
|
219
|
+
content: $.write.text,
|
|
220
|
+
// Named so the entry-kind setting is live rather than
|
|
221
|
+
// rendered and unread (L3); the preset below sets it to a
|
|
222
|
+
// location. `links` is left unwired: a room built ahead of
|
|
223
|
+
// the party joins nothing yet, and its drafted exits are
|
|
224
|
+
// prose the master links (see `LAIR_ROOM_CONTENT_SHAPE`).
|
|
225
|
+
params: slot.params(),
|
|
226
|
+
}))
|
|
227
|
+
/**
|
|
228
|
+
* ⚠ **The gate is the point, not a precaution** — and this preset is
|
|
229
|
+
* what makes it true. `resolvePosition` defaults an undeclared review
|
|
230
|
+
* position to `off`, so until this line the drafted room landed unseen
|
|
231
|
+
* while the docblock above promised a form. *Answer the door* has
|
|
232
|
+
* carried the same two lines since L1; this is the pair.
|
|
233
|
+
*/
|
|
234
|
+
.preset('lair', { label: 'Lair', default: true }, (p) => p
|
|
235
|
+
.settings('save', { review: 'on' })
|
|
236
|
+
// A room is a place (L3) — bare id, the way a listing spells
|
|
237
|
+
// them; the version is the row's own column.
|
|
238
|
+
.params('save', { entryType: 'core:entry/location' })
|
|
239
|
+
// The rooms the draft is shown: the dungeon's places.
|
|
240
|
+
.params('gather.rooms.read', { entryTypes: ['core:entry/location'] })
|
|
241
|
+
// The room the place slot shows (the room rule).
|
|
242
|
+
.params('place', { path: 'world.location' }))
|
|
243
|
+
.build());
|
|
244
|
+
//# sourceMappingURL=buildRoom.js.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Castellan's turn as an action, which Trigger trap and Reveal share
|
|
3
|
+
* (`trap.ts`, `reveal.ts`).
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Trigger trap and Reveal are one graph with two sets of instructions, and
|
|
7
|
+
* saying so in a builder is more honest than writing it twice — Adventure's
|
|
8
|
+
* `keeperAction` makes the same call for the same reason.
|
|
9
|
+
*
|
|
10
|
+
* Both are Adventure's *Look*: the Castellan describes something from the lore
|
|
11
|
+
* and the world state, changes nothing, and writes one message. They are
|
|
12
|
+
* separate SPECS rather than one spec with a parameter because a shipped
|
|
13
|
+
* prompt is resolved per (pool, spec) — two specs is what gives the trap its
|
|
14
|
+
* own instructions and the reveal its own, in the same pool, each editable
|
|
15
|
+
* without touching the other.
|
|
16
|
+
*/
|
|
17
|
+
export declare const castellanAction: (id: string, version: string, trigger: {
|
|
18
|
+
key: string;
|
|
19
|
+
icon: string;
|
|
20
|
+
label: string;
|
|
21
|
+
description: string;
|
|
22
|
+
/** What the row says while the Castellan writes (B18 step status). */
|
|
23
|
+
status: string;
|
|
24
|
+
/** The collect modal's question (R3): what the master may say the thing is. */
|
|
25
|
+
ask: string;
|
|
26
|
+
}) => import("@serene-pub/sdk").SpecDocument;
|
|
27
|
+
//# sourceMappingURL=castellanAction.d.ts.map
|