@serene-pub/core-catalog 0.6.0-pr-7 → 0.6.0-pr-9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/components/genres/story/authors-note/AuthorsNote.svelte +2 -1
- package/components/genres/story/authors-note/AuthorsNoteWidget.svelte +177 -58
- package/components/shared/WidgetBoundary.svelte +37 -0
- package/components/shared/actions/Actions.svelte +2 -1
- package/components/shared/actions/ActionsWidget.svelte +31 -38
- package/components/shared/album/Album.svelte +2 -1
- package/components/shared/album/AlbumWidget.svelte +1 -7
- package/components/shared/annex/Annex.svelte +2 -1
- package/components/shared/annex/AnnexWidget.svelte +1 -1
- package/components/shared/attendance/Attendance.svelte +2 -1
- package/components/shared/attendance/AttendanceWidget.svelte +5 -8
- package/components/shared/backdrop/Backdrop.svelte +2 -1
- package/components/shared/backdrop/BackdropWidget.svelte +28 -22
- package/components/shared/chronicle/Chronicle.svelte +2 -1
- package/components/shared/chronicle/ChronicleWidget.svelte +211 -99
- package/components/shared/composer/Composer.svelte +25 -0
- package/components/shared/composer/ComposerWidget.svelte +146 -0
- package/components/shared/composer/composer.ts +10 -0
- package/components/shared/composer/settings.ts +59 -0
- package/components/shared/composer/target.ts +79 -0
- package/components/shared/dialogue-box/DialogueBoxMount.svelte +25 -0
- package/components/shared/dialogue-box/DialogueBoxWidget.svelte +207 -0
- package/components/shared/dialogue-box/dialogue-box.ts +10 -0
- package/components/shared/dialogue-box/settings.ts +25 -0
- package/components/shared/lore-entries/LoreEntries.svelte +2 -1
- package/components/shared/lore-entries/LoreEntriesWidget.svelte +44 -41
- package/components/shared/messages/MessageBlocksView.svelte +1 -1
- package/components/shared/messages/MessageControls.svelte +23 -5
- package/components/shared/messages/Messages.svelte +2 -1
- package/components/shared/messages/MessagesWidget.svelte +82 -191
- package/components/shared/messages/NextCharacterBlock.svelte +35 -20
- package/components/shared/messages/SceneDivider.svelte +40 -14
- package/components/shared/messages/SessionComposer.svelte +178 -123
- package/components/shared/messages/SessionContainer.svelte +89 -38
- package/components/shared/messages/SessionMessage.svelte +157 -54
- package/components/shared/messages/SpokenLine.svelte +57 -16
- package/components/shared/messages/StateProposalList.svelte +30 -20
- package/components/shared/messages/TurnLine.svelte +258 -66
- package/components/shared/messages/conversation.svelte.ts +83 -5
- package/components/shared/messages/readingPace.ts +101 -0
- package/components/shared/messages/rowFacts.ts +44 -0
- package/components/shared/messages/sceneMarks.ts +54 -0
- package/components/shared/messages/spokenLine.ts +63 -14
- package/components/shared/places/Places.svelte +2 -1
- package/components/shared/places/PlacesWidget.svelte +42 -33
- package/components/shared/routine-log/RoutineLog.svelte +2 -1
- package/components/shared/routine-log/RoutineLogWidget.svelte +0 -4
- package/components/shared/routine-log/routineLog.ts +5 -21
- package/components/shared/scene-portraits/ScenePortraits.svelte +2 -1
- package/components/shared/scene-portraits/ScenePortraitsWidget.svelte +54 -32
- package/components/shared/session-runs/SessionRuns.svelte +26 -0
- package/components/shared/session-runs/SessionRunsWidget.svelte +270 -0
- package/components/shared/session-runs/session-runs.ts +11 -0
- package/components/shared/state/PieceCard.svelte +36 -25
- package/components/shared/state/SlotControl.svelte +18 -5
- package/components/shared/stats/Stats.svelte +2 -1
- package/components/shared/stats/StatsWidget.svelte +104 -72
- package/components/shared/turn-line/TurnLineMount.svelte +25 -0
- package/components/shared/turn-line/TurnLineWidget.svelte +25 -0
- package/components/shared/turn-line/settings.ts +31 -0
- package/components/shared/turn-line/turn-line.ts +10 -0
- package/components/shared/turn-order/TurnOrder.svelte +2 -1
- package/components/shared/turn-order/TurnOrderWidget.svelte +1 -6
- package/dist/components/actions.js +71 -88
- package/dist/components/actions.source.json +1 -1
- package/dist/components/album.js +39 -44
- package/dist/components/album.source.json +1 -1
- package/dist/components/annex.js +17 -8
- package/dist/components/annex.source.json +1 -1
- package/dist/components/attendance.js +39 -48
- package/dist/components/attendance.source.json +1 -1
- package/dist/components/authors-note.js +329 -162
- package/dist/components/authors-note.source.json +1 -1
- package/dist/components/backdrop.js +52 -55
- package/dist/components/backdrop.source.json +1 -1
- package/dist/components/chronicle.js +798 -559
- package/dist/components/chronicle.source.json +1 -1
- package/dist/components/composer.js +1639 -0
- package/dist/components/composer.source.json +1 -0
- package/dist/components/core-ui.json +1 -1
- package/dist/components/dialogue-box.js +373 -0
- package/dist/components/dialogue-box.source.json +1 -0
- package/dist/components/lore-entries.js +134 -122
- package/dist/components/lore-entries.source.json +1 -1
- package/dist/components/messages.js +1517 -8930
- package/dist/components/messages.source.json +1 -1
- package/dist/components/places.js +267 -244
- package/dist/components/places.source.json +1 -1
- package/dist/components/routine-log.js +35 -51
- package/dist/components/routine-log.source.json +1 -1
- package/dist/components/scene-portraits.js +118 -59
- package/dist/components/scene-portraits.source.json +1 -1
- package/dist/components/session-runs.js +488 -0
- package/dist/components/session-runs.source.json +1 -0
- package/dist/components/{shared-7VDIXYAL.js → shared-47J4TNSF.js} +1 -1
- package/dist/components/{shared-W3XS5FEL.js → shared-5E4RQYRX.js} +3 -2
- package/dist/components/{shared-YDS7HYL6.js → shared-EFMMT76D.js} +57 -4
- package/dist/components/{shared-BIWKZFUU.js → shared-FOVKPMSK.js} +3 -3
- package/dist/components/{shared-JPG5DQO7.js → shared-HEAKNNZB.js} +92 -17
- package/dist/components/shared-JXP6SHKF.js +159 -0
- package/dist/components/{shared-XBDUENRA.js → shared-JXYPKSTQ.js} +1 -1
- package/dist/components/shared-KJIOSSE3.js +257 -0
- package/dist/components/{shared-WV3QTKZT.js → shared-KLURQFWI.js} +13 -9
- package/dist/components/shared-MHCNUDUT.js +1680 -0
- package/dist/components/{shared-QXF5CJVN.js → shared-NICRJ4Z2.js} +1 -1
- package/dist/components/{shared-BBF64YGL.js → shared-W2BBJCNE.js} +22 -16
- package/dist/components/shared-YYYXFDZU.js +4354 -0
- package/dist/components/stats.js +828 -678
- package/dist/components/stats.source.json +1 -1
- package/dist/components/turn-line.js +856 -0
- package/dist/components/turn-line.source.json +1 -0
- package/dist/components/turn-order.js +62 -67
- package/dist/components/turn-order.source.json +1 -1
- package/dist/factories/answerForm.d.ts +6 -0
- package/dist/factories/answerForm.js +104 -96
- package/dist/factories/turnOrder.d.ts +98 -105
- package/dist/factories/turnOrder.js +120 -136
- package/dist/functions/pieces.js +1 -0
- package/dist/functions/time.js +2 -0
- package/dist/genres/chat/create.js +2 -0
- package/dist/genres/chat/memory.js +64 -43
- package/dist/genres/chat/respond.d.ts +7 -6
- package/dist/genres/chat/respond.js +13 -4
- package/dist/genres/chat/turnOrder.d.ts +2 -2
- package/dist/genres/chat/turnOrder.js +28 -12
- package/dist/genres/defaults.d.ts +28 -6
- package/dist/genres/defaults.js +84 -26
- package/dist/genres/dungeon-crawler/calls.d.ts +3 -1
- package/dist/genres/dungeon-crawler/calls.js +5 -0
- package/dist/genres/dungeon-crawler/create.d.ts +9 -6
- package/dist/genres/dungeon-crawler/create.js +18 -8
- package/dist/genres/dungeon-crawler/death.d.ts +13 -6
- package/dist/genres/dungeon-crawler/death.js +26 -12
- package/dist/genres/dungeon-crawler/index.d.ts +1 -0
- package/dist/genres/dungeon-crawler/index.js +1 -0
- package/dist/genres/dungeon-crawler/journal.d.ts +1 -1
- package/dist/genres/dungeon-crawler/journal.js +1 -1
- package/dist/genres/dungeon-crawler/lore.d.ts +13 -12
- package/dist/genres/dungeon-crawler/lore.js +16 -25
- package/dist/genres/dungeon-crawler/names.d.ts +10 -3
- package/dist/genres/dungeon-crawler/names.js +10 -3
- package/dist/genres/dungeon-crawler/preamble.d.ts +5 -4
- package/dist/genres/dungeon-crawler/preamble.js +75 -33
- package/dist/genres/dungeon-crawler/respond.js +4 -2
- package/dist/genres/dungeon-crawler/rest.d.ts +8 -7
- package/dist/genres/dungeon-crawler/rest.js +39 -15
- package/dist/genres/dungeon-crawler/reveal.js +2 -2
- package/dist/genres/dungeon-crawler/roundScript.d.ts +2 -1
- package/dist/genres/dungeon-crawler/roundScript.js +23 -5
- package/dist/genres/dungeon-crawler/scripts.js +4 -5
- package/dist/genres/dungeon-crawler/shape.d.ts +16 -0
- package/dist/genres/dungeon-crawler/shape.js +5 -1
- package/dist/genres/dungeon-crawler/sheet.d.ts +20 -20
- package/dist/genres/dungeon-crawler/story.d.ts +27 -16
- package/dist/genres/dungeon-crawler/story.js +175 -46
- package/dist/genres/dungeon-crawler/storyScripts.d.ts +2 -2
- package/dist/genres/dungeon-crawler/storyScripts.js +109 -14
- package/dist/genres/dungeon-crawler/summarizeScene.d.ts +13 -0
- package/dist/genres/dungeon-crawler/summarizeScene.js +21 -0
- package/dist/genres/dungeon-crawler/turnOrder.d.ts +8 -9
- package/dist/genres/dungeon-crawler/turnOrder.js +33 -23
- package/dist/genres/guide/create.js +2 -0
- package/dist/genres/guide/turnOrder.d.ts +3 -3
- package/dist/genres/guide/turnOrder.js +29 -13
- package/dist/genres/lair/answerForm.js +4 -1
- package/dist/genres/lair/buildRoom.js +4 -3
- package/dist/genres/lair/castellanAction.js +160 -154
- package/dist/genres/lair/create.js +2 -0
- package/dist/genres/lair/fileCurrentRoom.js +13 -10
- package/dist/genres/lair/fileRoom.js +4 -3
- package/dist/genres/lair/keeper.js +6 -2
- package/dist/genres/lair/names.d.ts +2 -0
- package/dist/genres/lair/names.js +2 -0
- package/dist/genres/lair/reply.js +16 -6
- package/dist/genres/lair/roomAnswer.js +4 -3
- package/dist/genres/lair/scratchpad.js +9 -7
- package/dist/genres/lair/scripts.js +8 -6
- package/dist/genres/lair/turnOrder.d.ts +3 -2
- package/dist/genres/lair/turnOrder.js +45 -16
- package/dist/genres/story/ask.d.ts +4 -0
- package/dist/genres/story/ask.js +4 -0
- package/dist/genres/story/create.js +15 -0
- package/dist/genres/story/index.d.ts +1 -1
- package/dist/genres/story/index.js +1 -1
- package/dist/genres/story/narrate.js +8 -0
- package/dist/genres/story/narrateCharacter.js +8 -0
- package/dist/genres/story/reckon.d.ts +5 -19
- package/dist/genres/story/reckon.js +53 -40
- package/dist/genres/story/reckoning.js +3 -0
- package/dist/genres/story/respond.js +17 -28
- package/dist/genres/story/sweep.d.ts +1 -1
- package/dist/genres/story/sweep.js +1 -1
- package/dist/genres/story/turnOrder.d.ts +21 -3
- package/dist/genres/story/turnOrder.js +87 -21
- package/dist/index.d.ts +3 -0
- package/dist/index.js +23 -9
- package/dist/loadouts.d.ts +1 -0
- package/dist/loadouts.js +17 -1
- package/dist/primers/ninth-mile.d.ts +3 -4
- package/dist/registry/entries.d.ts +2 -0
- package/dist/registry/entries.js +18 -5
- package/dist/registry/genres.d.ts +146 -40
- package/dist/registry/genres.js +373 -101
- package/dist/registry/hostState.d.ts +1 -2
- package/dist/registry/hostState.js +2 -4
- package/dist/registry/layouts.d.ts +141 -111
- package/dist/registry/layouts.js +302 -141
- package/dist/registry/slots.d.ts +4 -3
- package/dist/registry/slots.js +4 -3
- package/dist/registry/widgets.d.ts +12 -2
- package/dist/registry/widgets.js +259 -106
- package/dist/rulesets/vis-itineris/ruleset.js +8 -5
- package/dist/rulesets/wherewithal/ruleset.js +2 -1
- package/dist/seed/presets.js +15 -9
- package/dist/seed/prompts.js +24 -5
- package/dist/seed/scripts.js +3 -0
- package/dist/shared/annexField.js +23 -3
- package/dist/shared/illustrateScene.d.ts +1 -0
- package/dist/shared/illustrateScene.js +29 -1
- package/dist/shared/lore.d.ts +13 -0
- package/dist/shared/lore.js +37 -1
- package/dist/shared/portrait.js +13 -4
- package/dist/shared/reckoning.d.ts +8 -2
- package/dist/shared/reckoning.js +47 -30
- package/dist/shared/roundTick.d.ts +20 -0
- package/dist/shared/roundTick.js +76 -0
- package/dist/shared/sceneBoundaries.d.ts +7 -0
- package/dist/shared/sceneBoundaries.js +62 -0
- package/dist/shared/sceneSummaries.d.ts +7 -0
- package/dist/shared/sceneSummaries.js +49 -0
- package/dist/shared/speakMessage.d.ts +9 -2
- package/dist/shared/speakMessage.js +32 -9
- package/dist/shared/speechFields.js +4 -0
- package/dist/shared/summarize/character.d.ts +1 -1
- package/dist/shared/summarize/history.d.ts +1 -1
- package/dist/shared/summarize/scene.d.ts +1 -1
- package/dist/shared/summarize/summarizeScene.js +1 -0
- package/dist/shared/summarize/summarizeSpec.d.ts +1 -1
- package/dist/shared/summarize/world.d.ts +1 -1
- package/dist/shared/ui/attendance/index.d.ts +3 -2
- package/dist/shared/ui/attendance/index.js +3 -7
- package/dist/shared/ui/chronicle/index.d.ts +24 -2
- package/dist/shared/ui/chronicle/index.js +58 -29
- package/dist/shared/ui/conversation/formAnswer.d.ts +16 -2
- package/dist/shared/ui/conversation/formAnswer.js +23 -9
- package/dist/shared/ui/conversation/index.d.ts +2 -0
- package/dist/shared/ui/conversation/index.js +4 -0
- package/dist/shared/ui/conversation/itemValues.d.ts +16 -3
- package/dist/shared/ui/conversation/itemValues.js +15 -5
- package/dist/shared/ui/conversation/messageVerbState.d.ts +17 -2
- package/dist/shared/ui/conversation/messageVerbState.js +5 -4
- package/dist/shared/ui/conversation/readingPlace.d.ts +40 -0
- package/dist/shared/ui/conversation/readingPlace.js +119 -0
- package/dist/shared/ui/conversation/rewindStrip.d.ts +13 -4
- package/dist/shared/ui/conversation/rewindStrip.js +29 -7
- package/dist/shared/ui/conversation/runsInProgress.d.ts +30 -0
- package/dist/shared/ui/conversation/runsInProgress.js +47 -0
- package/dist/shared/ui/conversation/storyDays.d.ts +7 -1
- package/dist/shared/ui/conversation/storyDays.js +8 -0
- package/dist/shared/ui/conversation/tableChannel.d.ts +8 -11
- package/dist/shared/ui/conversation/tableChannel.js +8 -9
- package/dist/shared/ui/places/index.d.ts +3 -2
- package/dist/shared/ui/places/index.js +4 -5
- package/dist/shared/ui/routine-log/index.d.ts +3 -0
- package/dist/shared/ui/routine-log/index.js +22 -0
- package/dist/shared/ui/scene-portraits/portraits.d.ts +50 -16
- package/dist/shared/ui/scene-portraits/portraits.js +84 -21
- package/dist/shared/ui/session-runs/index.d.ts +90 -0
- package/dist/shared/ui/session-runs/index.js +143 -0
- package/dist/shared/ui/session-state/stateView.d.ts +18 -5
- package/dist/shared/ui/session-state/stateView.js +29 -8
- package/dist/shared/ui/turn-order/index.d.ts +0 -9
- package/dist/shared/ui/turn-order/index.js +1 -2
- package/package.json +12 -8
- /package/dist/components/{shared-4ME6NFDK.js → shared-LUIF6DW7.js} +0 -0
|
@@ -57,6 +57,7 @@
|
|
|
57
57
|
import { compile, handlebars, slot, spec, coreEvents } from '@serene-pub/sdk';
|
|
58
58
|
import { CORE_LOADOUT } from '../loadouts.js';
|
|
59
59
|
import * as C from '@serene-pub/contracts';
|
|
60
|
+
import { applyWiring, jsonPart, wiring } from '../shared/calls.js';
|
|
60
61
|
/** @internal */
|
|
61
62
|
export const ANSWER_FORM_VERSION = '1.0.0';
|
|
62
63
|
/**
|
|
@@ -109,101 +110,108 @@ export const ANSWER_FORM_TEMPLATE = `{{#systemBlock}}
|
|
|
109
110
|
* answer pipeline from the same graph rather than restating it.
|
|
110
111
|
* @experimental
|
|
111
112
|
*/
|
|
112
|
-
export const answerFormSpec = (id, genre, options = {}) =>
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
.
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
}))
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
.
|
|
201
|
-
|
|
202
|
-
|
|
113
|
+
export const answerFormSpec = (id, genre, options = {}) => {
|
|
114
|
+
const w = wiring();
|
|
115
|
+
const opened = spec(id, {
|
|
116
|
+
version: ANSWER_FORM_VERSION,
|
|
117
|
+
taxonomy: { role: 'action' },
|
|
118
|
+
}).inlet('input', C.formAddressed.v1(), { suits: [coreEvents.formAddressed] });
|
|
119
|
+
const showing = (b, key) => jsonPart(b, w, 'showOutcomes', ($) => $.input.fields, key, 'Show outcomes');
|
|
120
|
+
/** With no `outcomeNumbersFrom` the step is never added, and nothing reads it. */
|
|
121
|
+
const head = (options.outcomeNumbersFrom ? showing(opened, options.outcomeNumbersFrom) : opened);
|
|
122
|
+
return compile(head
|
|
123
|
+
.gather('gather', { mode: 'parallel' }, (b) => b
|
|
124
|
+
.chain('history', (c) => c.query('read', ($) => C.sessionHistory.v1({
|
|
125
|
+
scope: $.input.sessionScope,
|
|
126
|
+
...(options.outcomeNumbersFrom ? { outcomeNumbers: $.showOutcomes.main } : {}),
|
|
127
|
+
params: slot.params(),
|
|
128
|
+
})))
|
|
129
|
+
.chain('cast', (c) => c.query('read', ($) => C.sessionCast.v1({ scope: $.input.sessionScope }))))
|
|
130
|
+
/**
|
|
131
|
+
* The addressee's card, compiled where a speaker's would be: a
|
|
132
|
+
* character by `currentCharacterId`, an envoy by `speaker` (the
|
|
133
|
+
* builder reads the envoy's declaration off the cast bundle).
|
|
134
|
+
* The instructions are the pool row `answer-form-default`.
|
|
135
|
+
*/
|
|
136
|
+
.task('context', ($) => C.buildTemplateContext.v1({
|
|
137
|
+
cast: $.gather.cast.read.cast,
|
|
138
|
+
currentCharacterId: $.input.characterId,
|
|
139
|
+
speaker: $.input.addressee,
|
|
140
|
+
prompts: slot.prompts(),
|
|
141
|
+
variables: slot.variables(),
|
|
142
|
+
}))
|
|
143
|
+
.task('form', ($) => C.formContext.v1({
|
|
144
|
+
form: $.input.form,
|
|
145
|
+
templateContext: $.context.templateContext,
|
|
146
|
+
}))
|
|
147
|
+
/**
|
|
148
|
+
* Prose, and no seed: the addressee is answering a question, not
|
|
149
|
+
* taking a turn, so the transcript ends with nobody's name on an
|
|
150
|
+
* open line — the question is the last user turn instead.
|
|
151
|
+
*/
|
|
152
|
+
.task('lines', ($) => C.proseTranscript.v1({
|
|
153
|
+
messages: $.gather.history.read.messages,
|
|
154
|
+
cast: $.gather.cast.read.cast,
|
|
155
|
+
templateContext: $.form.templateContext,
|
|
156
|
+
}))
|
|
157
|
+
/**
|
|
158
|
+
* 🚧 **The transcript's files, placed** (attachments follow-ups,
|
|
159
|
+
* owner ruling 2026-10-03) — `respond`'s two steps: the files the
|
|
160
|
+
* rows show, then per line what `generate` receives. An image the
|
|
161
|
+
* call can read rides its own turn; otherwise it is named
|
|
162
|
+
* (`[image: cat.png]`). A transcript with no files passes through
|
|
163
|
+
* untouched, so the prompt is byte for byte what it was.
|
|
164
|
+
*/
|
|
165
|
+
.query('attachments', ($) => C.historyAttachments.v1({
|
|
166
|
+
messages: $.gather.history.read.messages,
|
|
167
|
+
params: slot.params(),
|
|
168
|
+
}))
|
|
169
|
+
.task('attached', ($) => C.placeAttachments.v1({
|
|
170
|
+
messages: $.lines.messages,
|
|
171
|
+
attachments: $.attachments.attachments,
|
|
172
|
+
connection: slot.connectionOf('generate'),
|
|
173
|
+
params: slot.params(),
|
|
174
|
+
}))
|
|
175
|
+
.task('contextBudget', ($) => C.contextBudget.v1({
|
|
176
|
+
sampling: slot.samplingOf('generate'),
|
|
177
|
+
connection: slot.connectionOf('generate'),
|
|
178
|
+
params: slot.params(),
|
|
179
|
+
}))
|
|
180
|
+
.task('prompt', ($) => C.assemble.v2({
|
|
181
|
+
budget: $.contextBudget.available,
|
|
182
|
+
messages: $.attached.messages,
|
|
183
|
+
templateContext: $.form.templateContext,
|
|
184
|
+
template: slot.template(),
|
|
185
|
+
prompts: slot.prompts($.context),
|
|
186
|
+
variables: slot.variables(),
|
|
187
|
+
params: slot.params(),
|
|
188
|
+
connection: slot.connectionOf('generate'),
|
|
189
|
+
}))
|
|
190
|
+
/** The one oracle: JSON against the form's schema (R-15). */
|
|
191
|
+
.oracle('generate', ($) => C.generateJson.v1({
|
|
192
|
+
context: $.prompt.context,
|
|
193
|
+
schema: $.form.schema,
|
|
194
|
+
connection: slot.connection(),
|
|
195
|
+
sampling: slot.sampling(),
|
|
196
|
+
params: slot.params(),
|
|
197
|
+
}), { expose: { status: 'Choosing an answer' } })
|
|
198
|
+
.outlet('answer', ($) => C.answerForm.v1({
|
|
199
|
+
form: $.input.form,
|
|
200
|
+
answer: $.generate.json,
|
|
201
|
+
messageId: $.input.messageId,
|
|
202
|
+
blockId: $.input.blockId,
|
|
203
|
+
addressee: $.input.addressee,
|
|
204
|
+
}))
|
|
205
|
+
.defaults((p) => {
|
|
206
|
+
const templated = p
|
|
207
|
+
.template('prompt', {
|
|
208
|
+
source: ANSWER_FORM_TEMPLATE,
|
|
209
|
+
engine: handlebars.id,
|
|
210
|
+
})
|
|
211
|
+
// Form answers run on the Reply loadout (I12).
|
|
212
|
+
.loadout('generate', slot.loadout(CORE_LOADOUT.reply));
|
|
213
|
+
return applyWiring(options.prompt ? templated.prompts('context', options.prompt) : templated, w);
|
|
203
214
|
})
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
return options.prompt ? templated.prompts('context', options.prompt) : templated;
|
|
207
|
-
})
|
|
208
|
-
.build());
|
|
215
|
+
.build());
|
|
216
|
+
};
|
|
209
217
|
//# sourceMappingURL=answerForm.js.map
|
|
@@ -4,57 +4,50 @@
|
|
|
4
4
|
*
|
|
5
5
|
* ## What this spec is
|
|
6
6
|
*
|
|
7
|
-
* One
|
|
7
|
+
* **One option among a genre's turn order options** on Turn order asked. It
|
|
8
8
|
* answers the question "whose turn is it" by **writing it down**:
|
|
9
9
|
*
|
|
10
10
|
* ```
|
|
11
11
|
* event ─► history ─► pool ─► mentioned ─► strategy ─► set-turn-order
|
|
12
12
|
* ```
|
|
13
13
|
*
|
|
14
|
-
* On
|
|
15
|
-
* — five reads and a `jsonb_set`.
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* it (§4.6).
|
|
14
|
+
* On a rules strategy it calls no model, writes no message and costs no token
|
|
15
|
+
* — five reads and a `jsonb_set`. The model option (`modelTurnOrder`) seats an
|
|
16
|
+
* oracle in place of `strategy`, which asks a model once per recompute. What
|
|
17
|
+
* it produces is the session's stored turn order: the prepared turns, the
|
|
18
|
+
* candidates they were drawn from, and what the order answers. Every surface
|
|
19
|
+
* that asks "who is next" renders that state, and the reply run fires an
|
|
20
|
+
* entry out of it (§4.6).
|
|
22
21
|
*
|
|
23
|
-
* ##
|
|
22
|
+
* ## Options, not swaps
|
|
24
23
|
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
* document, an empty order is an answer, and the trigger decides nothing.
|
|
24
|
+
* A genre registers one pipeline per option on Turn order asked (R24); the
|
|
25
|
+
* session's choice picks which one runs, and the one marked `default` runs
|
|
26
|
+
* when it chose none. The causes an option answers are its registration's
|
|
27
|
+
* `when` over `event.asked`, never part of the document. A strategy is not
|
|
28
|
+
* swapped into a node: each option pins its own, and keeps its own pool and
|
|
29
|
+
* mention settings.
|
|
32
30
|
*
|
|
33
|
-
* ## One
|
|
31
|
+
* ## One document per option (R27)
|
|
34
32
|
*
|
|
35
|
-
* `turnOrderSpec()` below is the **public** builder
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
* refuses a preset binding a spec whose
|
|
39
|
-
*
|
|
40
|
-
* `core:spec/turn-order-narrator`) are retired.
|
|
41
|
-
*
|
|
42
|
-
* A cast genre pins round robin; a planner genre (Adventure, the Lair)
|
|
43
|
-
* pins `turn-narrator`, so it gets exactly one narrator turn per send —
|
|
44
|
-
* Adventure's pool admits nobody; the Lair's admits its delvers, for the
|
|
45
|
-
* character turns a standing turn plan names. What a session may pick instead is
|
|
46
|
-
* the `strategy` node's `expose.swaps` (R28) — chat lists the other five
|
|
47
|
-
* core strategies; the rest list none, so they render no control.
|
|
33
|
+
* `turnOrderSpec()` below is the **public** builder, with one ready-made
|
|
34
|
+
* builder per core strategy: `roundRobinTurnOrder`, `byUserTurnOrder`,
|
|
35
|
+
* `randomTurnOrder`, `narratorTurnOrder` and `modelTurnOrder`. One document
|
|
36
|
+
* serves one genre — the preset check refuses a preset binding a spec whose
|
|
37
|
+
* lock names another genre (24 §4) — so an option's id is taken, never derived.
|
|
48
38
|
*/
|
|
49
39
|
import { S } from '@serene-pub/sdk';
|
|
50
|
-
import type { Descriptor, GenreDecl, SpecDocument } from '@serene-pub/sdk';
|
|
40
|
+
import type { ConditionDecl, Descriptor, GenreDecl, SpecDocument } from '@serene-pub/sdk';
|
|
51
41
|
/**
|
|
52
42
|
* 🚧 `core:script/unprompted-modes` (2026-10-20): the genre's voices settings
|
|
53
43
|
* — its fields `sideCast` and `narratorInterjections`, read off the settings
|
|
54
44
|
* document a turn-order spec's inlet carries — as `core:task/turn-unprompted@1`
|
|
55
45
|
* reads them: `{ 'side-cast', 'narrator-interjections' }`, each `full` or
|
|
56
|
-
* `off
|
|
57
|
-
*
|
|
46
|
+
* `off`, plus `narrator-every` (1, 2 or 3; present only when the narrator is
|
|
47
|
+
* on). `sideCast` set `true` (or a stored `full` / `review`) is on.
|
|
48
|
+
* `narratorInterjections` reads `true`, `full`, `review` and `every-round` as
|
|
49
|
+
* every round, `every-2nd-round` as 2, `every-3rd-round` as 3; anything else
|
|
50
|
+
* is off (2026-11-04, playtest ruling item 7). Seeded by core (`CORE_SCRIPTS`); a turn-order spec with `unprompted` runs it.
|
|
58
51
|
* @experimental
|
|
59
52
|
*/
|
|
60
53
|
export declare const UNPROMPTED_MODES_SCRIPT: Readonly<{
|
|
@@ -67,31 +60,6 @@ export declare const UNPROMPTED_MODES_SCRIPT: Readonly<{
|
|
|
67
60
|
}>;
|
|
68
61
|
/** @experimental */
|
|
69
62
|
export declare const TURN_ORDER_VERSION = "1.0.0";
|
|
70
|
-
/**
|
|
71
|
-
* The nine events a cast genre recomputes on (§4.5).
|
|
72
|
-
*
|
|
73
|
-
* Every one of them can change who should speak next: a row landing, a row
|
|
74
|
-
* leaving, a seat being switched off, a setting moving, a branch being
|
|
75
|
-
* born. There is no gating (R1) — the list is what the genre declares and
|
|
76
|
-
* the inlet locks, and a genre that wants fewer binds fewer.
|
|
77
|
-
* @public
|
|
78
|
-
*/
|
|
79
|
-
export declare const TURN_ORDER_EVENTS: readonly ["core:event/message-completed@1", "core:event/message-edited@1", "core:event/message-deleted@1", "core:event/message-hidden@1", "core:event/member-added@1", "core:event/member-removed@1", "core:event/cast-changed@1", "core:event/session-updated@1", "core:event/session-branched@1"];
|
|
80
|
-
/**
|
|
81
|
-
* The four events a planner genre recomputes on: a row landing, a row
|
|
82
|
-
* leaving (deleted, or hidden and shown again), and a branch's birth. Its
|
|
83
|
-
* order is one narrator entry or none — decided by whether the newest
|
|
84
|
-
* visible row is a person's — so exactly the events that change which row
|
|
85
|
-
* is newest move it. A cast change or a settings save cannot, and
|
|
86
|
-
* recomputing on them would be reads for a document that cannot differ.
|
|
87
|
-
*
|
|
88
|
-
* Delete and hide are here (lair pass F6/B9, 2026-09-27) so the order stays
|
|
89
|
-
* honest after a person removes the narrator's last reply: the line they
|
|
90
|
-
* wrote is newest again, and the narrator is ready. Both carry an `edit`
|
|
91
|
-
* cause, which auto-advance never fires on.
|
|
92
|
-
* @experimental
|
|
93
|
-
*/
|
|
94
|
-
export declare const TURN_ORDER_NARRATOR_EVENTS: readonly ["core:event/message-completed@1", "core:event/message-deleted@1", "core:event/message-hidden@1", "core:event/session-branched@1"];
|
|
95
63
|
/**
|
|
96
64
|
* A pin a turn-order spec may seat as `strategy`: a task over `candidates`
|
|
97
65
|
* and `messages` that publishes `turn-entries@1` on `main` and `order`.
|
|
@@ -109,7 +77,7 @@ type TurnStrategyDescriptor = Descriptor<{
|
|
|
109
77
|
/**
|
|
110
78
|
* A pin at any type version (`@1`, `@2` …): only `id` and `descriptor` are
|
|
111
79
|
* read, and the node is built from the descriptor. The ports are also checked
|
|
112
|
-
*
|
|
80
|
+
* by the spec's edges.
|
|
113
81
|
* @public
|
|
114
82
|
*/
|
|
115
83
|
export type TurnStrategyPin = {
|
|
@@ -126,10 +94,10 @@ type TurnAdviseDescriptor = Descriptor<{
|
|
|
126
94
|
kind: 'oracle';
|
|
127
95
|
};
|
|
128
96
|
/**
|
|
129
|
-
* A pin a turn-order spec may seat as
|
|
130
|
-
* `candidates` and `messages` publishing `turn-entries@1` on `main` and
|
|
97
|
+
* A pin a turn-order spec may seat as its model strategy (R41): an oracle
|
|
98
|
+
* over `candidates` and `messages` publishing `turn-entries@1` on `main` and
|
|
131
99
|
* `order`, with a model's `connection`, `sampling` and `prompts` slots —
|
|
132
|
-
* `core:oracle/turn-advise@1`, or a plugin's own.
|
|
100
|
+
* `core:oracle/turn-advise@1`, or a plugin's own. Its node key is `advise`.
|
|
133
101
|
* @experimental
|
|
134
102
|
*/
|
|
135
103
|
export type TurnAdvisePin = {
|
|
@@ -144,37 +112,35 @@ export interface TurnPoolParams {
|
|
|
144
112
|
envoySlugs?: string[];
|
|
145
113
|
}
|
|
146
114
|
/**
|
|
147
|
-
* **
|
|
148
|
-
* genre's come from this one call
|
|
115
|
+
* **One turn order option for one genre** (R27). Core's and every plugin
|
|
116
|
+
* genre's come from this one call, or from the ready-made builder of the
|
|
117
|
+
* strategy:
|
|
149
118
|
*
|
|
150
119
|
* ```ts
|
|
151
|
-
* const
|
|
152
|
-
*
|
|
153
|
-
*
|
|
154
|
-
*
|
|
155
|
-
*
|
|
156
|
-
* swaps: [C.turnRandom, myStrategy],
|
|
120
|
+
* const tavernRoundRobin = roundRobinTurnOrder(tavern, { id: 'acme.rp:spec/tavern-turn-order' })
|
|
121
|
+
* register(coreEvents.turnOrderAsked, tavernRoundRobin, {
|
|
122
|
+
* label: 'Round robin',
|
|
123
|
+
* when: { on: 'event.asked', in: [sessionEvents.messageCompleted] },
|
|
124
|
+
* default: true,
|
|
157
125
|
* })
|
|
158
126
|
* ```
|
|
159
127
|
*
|
|
160
|
-
* `id` is taken, never derived (R26). `strategy` is the pin —
|
|
161
|
-
*
|
|
162
|
-
*
|
|
163
|
-
*
|
|
164
|
-
*
|
|
165
|
-
*
|
|
128
|
+
* `id` is taken, never derived (R26). `strategy` is the pin — a task pin is a
|
|
129
|
+
* rule (node key `strategy`), an oracle pin asks a model (node key `advise`).
|
|
130
|
+
* `pool` is the author preset on the pool node, the one road configuration
|
|
131
|
+
* takes: declared default, the author's preset over it, an administrator's
|
|
132
|
+
* deviation, a session's override last. A preset binds the result like any
|
|
133
|
+
* spec: `bindings: [tavernRoundRobin, …]`.
|
|
166
134
|
*
|
|
167
|
-
* With `
|
|
168
|
-
* settings (§4.11, R42): who is eligible
|
|
169
|
-
*
|
|
135
|
+
* With `sessionSettings`, `pool` and `mentioned` are marked for session
|
|
136
|
+
* settings (§4.11, R42): who is eligible and the mention rule's lookback.
|
|
137
|
+
* Without, the spec shows no turn control at all.
|
|
170
138
|
* @public
|
|
171
139
|
*/
|
|
172
140
|
export declare function turnOrderSpec(opts: {
|
|
173
141
|
id: string;
|
|
174
142
|
genre: GenreDecl;
|
|
175
|
-
|
|
176
|
-
strategy: TurnStrategyPin;
|
|
177
|
-
swaps?: readonly TurnStrategyPin[];
|
|
143
|
+
strategy: TurnStrategyPin | TurnAdvisePin;
|
|
178
144
|
pool?: TurnPoolParams;
|
|
179
145
|
/**
|
|
180
146
|
* Which channel the `history` node reads (lair re-plan R6) — the author
|
|
@@ -184,15 +150,6 @@ export declare function turnOrderSpec(opts: {
|
|
|
184
150
|
* person's (R5): the Lair's Sanctum line is answered on the Sanctum.
|
|
185
151
|
*/
|
|
186
152
|
historyChannel?: string;
|
|
187
|
-
/**
|
|
188
|
-
* The optional model path (R41, M4): the oracle that asks a model who
|
|
189
|
-
* speaks. Given, the spec branches after `mentioned` on the genre field
|
|
190
|
-
* `turnMode` — `model` runs this oracle, anything else runs `strategy` —
|
|
191
|
-
* and the node keys become `decide.model.advise` / `decide.rules.strategy`
|
|
192
|
-
* (`turnStrategyNode` answers which). The genre declares `turnMode`
|
|
193
|
-
* (`TURN_MODE_FIELD`) so a session can choose. Absent, no branch.
|
|
194
|
-
*/
|
|
195
|
-
advise?: TurnAdvisePin;
|
|
196
153
|
/**
|
|
197
154
|
* 🚧 Script chains on the `strategy` node, by interior point and seed key
|
|
198
155
|
* (`PresetBuilder.scripts`) — `{ select: [{ seedKey }] }` for
|
|
@@ -215,28 +172,64 @@ export declare function turnOrderSpec(opts: {
|
|
|
215
172
|
unprompted?: {
|
|
216
173
|
narrate?: string;
|
|
217
174
|
};
|
|
175
|
+
/**
|
|
176
|
+
* 🚧 **Nobody can take a turn** (owner ruling 2026-11-08): after the
|
|
177
|
+
* write, the `main` composer is closed with `reason` while the pool has
|
|
178
|
+
* no candidate at all — no character, persona or envoy seated — and
|
|
179
|
+
* opened again once it has one. The session's own answer to "who could
|
|
180
|
+
* reply?", read off `pool`, never a count a genre keeps. Absent: the
|
|
181
|
+
* composer is left as it is. (`emptyCastClosure` closes the same way at
|
|
182
|
+
* create, where no turn order runs yet.)
|
|
183
|
+
*/
|
|
184
|
+
emptyCast?: {
|
|
185
|
+
reason: string;
|
|
186
|
+
};
|
|
187
|
+
/** Marks `pool` and `mentioned` for session settings (§4.11, R42). Absent: no turn control. */
|
|
188
|
+
sessionSettings?: true;
|
|
189
|
+
/**
|
|
190
|
+
* 🚧 The key of the genre's field that carries Show outcomes: the
|
|
191
|
+
* `history` read wires it as `session-history@1`'s `outcomeNumbers`.
|
|
192
|
+
* Absent: the read wires nothing.
|
|
193
|
+
*/
|
|
194
|
+
outcomeNumbersFrom?: string;
|
|
218
195
|
version?: string;
|
|
219
196
|
}): SpecDocument;
|
|
220
|
-
/**
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
197
|
+
/** What each builder takes: `turnOrderSpec`'s options but the genre and the strategy it pins. */
|
|
198
|
+
type TurnOrderOptions = Omit<Parameters<typeof turnOrderSpec>[0], 'genre' | 'strategy'>;
|
|
199
|
+
/** **Round robin** option: each in the pool speaks in turn. @experimental */
|
|
200
|
+
export declare const roundRobinTurnOrder: (genre: GenreDecl, opts: TurnOrderOptions) => SpecDocument;
|
|
201
|
+
/** **By user** option: round robin split by the person each seat belongs to. @experimental */
|
|
202
|
+
export declare const byUserTurnOrder: (genre: GenreDecl, opts: TurnOrderOptions) => SpecDocument;
|
|
203
|
+
/** **Random** option: the next speaker is drawn at random from the pool. @experimental */
|
|
204
|
+
export declare const randomTurnOrder: (genre: GenreDecl, opts: TurnOrderOptions) => SpecDocument;
|
|
205
|
+
/** **Narrator replies** option: one narrator turn per person's line. @experimental */
|
|
206
|
+
export declare const narratorTurnOrder: (genre: GenreDecl, opts: TurnOrderOptions) => SpecDocument;
|
|
207
|
+
/** **Model** option: a model decides who speaks (R41); its node key is `advise`. @experimental */
|
|
208
|
+
export declare const modelTurnOrder: (genre: GenreDecl, opts: TurnOrderOptions) => SpecDocument;
|
|
224
209
|
/**
|
|
225
|
-
* One core genre's turn
|
|
226
|
-
*
|
|
227
|
-
* a strategy on it hands `build()` and `strategyNode` to `swaps` — no spec id,
|
|
228
|
-
* no lookup.
|
|
210
|
+
* One core genre's turn order, by value (R26): its default option's document
|
|
211
|
+
* and every option the genre registers on Turn order asked.
|
|
229
212
|
* @experimental
|
|
230
213
|
*/
|
|
231
214
|
export interface TurnOrderHandle {
|
|
232
215
|
genre: GenreDecl;
|
|
233
|
-
/** The
|
|
216
|
+
/** The default option's spec id — what core's presets bind and `CORE_SPECS` publishes it under. */
|
|
234
217
|
spec: string;
|
|
235
|
-
|
|
236
|
-
/** The spec document, built once. */
|
|
218
|
+
/** The default option's document, built once. */
|
|
237
219
|
build: () => SpecDocument;
|
|
238
|
-
/**
|
|
239
|
-
|
|
220
|
+
/** Every option, the default first. */
|
|
221
|
+
options: ReadonlyArray<{
|
|
222
|
+
/** The option's spec id. */
|
|
223
|
+
spec: string;
|
|
224
|
+
/** The option's document, built once. */
|
|
225
|
+
build: () => SpecDocument;
|
|
226
|
+
label: string;
|
|
227
|
+
/** The definition id the option's strategy step pins (`C.turnRandom.id`, `C.turnAdvise.id` …). */
|
|
228
|
+
strategy: string;
|
|
229
|
+
/** The causes the option answers: `{ on: 'event.asked', in: [...] }`. */
|
|
230
|
+
when: ConditionDecl;
|
|
231
|
+
default?: true;
|
|
232
|
+
}>;
|
|
240
233
|
}
|
|
241
234
|
export {};
|
|
242
235
|
//# sourceMappingURL=turnOrder.d.ts.map
|