@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
package/dist/adventureActions.js
DELETED
|
@@ -1,599 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The Adventure genre's actions — the small pipelines a player fires from the
|
|
3
|
-
* composer (DESIGN-adventure-genre.md, "Actions").
|
|
4
|
-
*
|
|
5
|
-
* `session-action` is an OPEN event: any number of pipelines may serve it, and
|
|
6
|
-
* which ones a session offers is the preset's `actions.include`. So these are
|
|
7
|
-
* the E-series "events are all optional" made concrete — each is two or three
|
|
8
|
-
* nodes, each contributes its own button, and removing one from a preset takes
|
|
9
|
-
* the button with it and breaks nothing.
|
|
10
|
-
*
|
|
11
|
-
* ## Two shapes, three specs
|
|
12
|
-
*
|
|
13
|
-
* `adventure-look` writes a message and changes nothing. The other two change
|
|
14
|
-
* state and write no message at all, which is worth stating plainly because it
|
|
15
|
-
* looks like a bug the first time you see a run with no reply: pressing Rest
|
|
16
|
-
* produces a ledger under the last message, not a new one. A pipeline may
|
|
17
|
-
* write as often as it likes and is not obliged to write at all (F7).
|
|
18
|
-
*
|
|
19
|
-
* ## Why `adventure-inventory` is not here
|
|
20
|
-
*
|
|
21
|
-
* The design lists a fourth action: a prose inventory check with no model call.
|
|
22
|
-
* Two things say it should not be a pipeline. What somebody carries is their
|
|
23
|
-
* `inventory` stat (phase 3b), already in the state block every prompt reads,
|
|
24
|
-
* so a pipeline would only restate it. And the question it answers was the one
|
|
25
|
-
* the **Inventory widget** answered continuously, in the session, with the item
|
|
26
|
-
* prose on hover. A button that writes a worse copy of a panel already on
|
|
27
|
-
* screen is a feature competing with itself. (R79 removed that widget for now;
|
|
28
|
-
* the first reason still stands on its own, so the action stays out.)
|
|
29
|
-
*/
|
|
30
|
-
import { compile, slot, spec, sessionEvents } from '@serene-pub/sdk';
|
|
31
|
-
import * as C from '@serene-pub/contracts';
|
|
32
|
-
import { ADVENTURE_KEEPER_SCHEMA } from './adventure.js';
|
|
33
|
-
import { adventureGenre, POST_HISTORY_TOKEN_TRIGGER } from './genres.js';
|
|
34
|
-
/* ── look ───────────────────────────────────────────────────────────────── */
|
|
35
|
-
/** @internal */
|
|
36
|
-
export const ADVENTURE_LOOK_SPEC_ID = 'core:spec/adventure-look';
|
|
37
|
-
/**
|
|
38
|
-
* 1.0.0, edited in place (lorebooks C2, 2026-10-02): a `presences` read and an
|
|
39
|
-
* `eligible` step before `rank`. Content-addressed; `specHashes.test.ts`
|
|
40
|
-
* records the move.
|
|
41
|
-
*
|
|
42
|
-
* Edited in place again (owner ruling 2026-10-03): the context step is the
|
|
43
|
-
* SCENE builder, with the places listing — see `adventureLookSpec`.
|
|
44
|
-
*
|
|
45
|
-
* And again (history window, 2026-10-03): `contextBudget` runs before the
|
|
46
|
-
* reads and `gather.history.read` takes its `budget`, so the transcript fit,
|
|
47
|
-
* not the newest 100 rows, decides where the conversation starts.
|
|
48
|
-
* @internal
|
|
49
|
-
*/
|
|
50
|
-
export const ADVENTURE_LOOK_VERSION = '1.0.0';
|
|
51
|
-
/**
|
|
52
|
-
* The narrator describes where you are, from the lore and the world state, and
|
|
53
|
-
* changes nothing.
|
|
54
|
-
*
|
|
55
|
-
* It is also the opening scene: the create pipeline deliberately makes no model
|
|
56
|
-
* call, so this is the button a new Adventure session is meant to start with.
|
|
57
|
-
*
|
|
58
|
-
* **Built on the scene builder** (`core:task/build-scene-context@1`, owner
|
|
59
|
-
* ruling 2026-10-03), the context Adventure's own narrator reads, so Look is
|
|
60
|
-
* shown what the narrator is shown: `{{location}}`, the clock and the weather,
|
|
61
|
-
* the place the scene is in with its ways on (`{{locationEntry}}`) and every
|
|
62
|
-
* place the world holds (`{{knownLocations}}`), off the same `rooms` listing
|
|
63
|
-
* and the same room rule as `adventure-respond`. It was built on
|
|
64
|
-
* `build-template-context@1`, which computes no scene variables, so Look
|
|
65
|
-
* described a place it had never been shown. No `plan`: nothing is planned,
|
|
66
|
-
* so `{{beats}}` is empty and the builder anchors on the world state alone.
|
|
67
|
-
* The builder also resolves the step as nobody, so the line the model
|
|
68
|
-
* continues is the narrator's rather than the session's last speaker's.
|
|
69
|
-
*
|
|
70
|
-
* Its prompt row moved with it, from the `build-template-context` pool into
|
|
71
|
-
* the `build-scene-context` pool (migration `0111` re-keys the row in place,
|
|
72
|
-
* so a configuration pointing at it keeps pointing at it).
|
|
73
|
-
* @internal
|
|
74
|
-
*/
|
|
75
|
-
export const adventureLookSpec = () => compile(spec(ADVENTURE_LOOK_SPEC_ID, {
|
|
76
|
-
version: ADVENTURE_LOOK_VERSION,
|
|
77
|
-
taxonomy: {
|
|
78
|
-
role: 'action',
|
|
79
|
-
},
|
|
80
|
-
contributes: {
|
|
81
|
-
actions: [
|
|
82
|
-
{
|
|
83
|
-
key: 'look',
|
|
84
|
-
venue: { kind: 'composer' },
|
|
85
|
-
quick: true,
|
|
86
|
-
icon: 'eye',
|
|
87
|
-
label: { en: 'Look' },
|
|
88
|
-
description: { en: 'Have the narrator describe where you are and what you can see.' },
|
|
89
|
-
},
|
|
90
|
-
],
|
|
91
|
-
},
|
|
92
|
-
})
|
|
93
|
-
.inlet('input', C.userMessage.v1(), {
|
|
94
|
-
genre: adventureGenre,
|
|
95
|
-
event: sessionEvents.sessionAction,
|
|
96
|
-
})
|
|
97
|
-
// Before the reads (history window, 2026-10-03): the history read
|
|
98
|
-
// is sized by this budget, so it is computed first. It reads only
|
|
99
|
-
// config, never a step, so moving it changes no value.
|
|
100
|
-
.task('contextBudget', ($) => C.contextBudget.v1({
|
|
101
|
-
sampling: slot.samplingOf('write'),
|
|
102
|
-
// The other half of the same pair, for the model's own
|
|
103
|
-
// window (0114) — see `respond`.
|
|
104
|
-
connection: slot.connectionOf('write'),
|
|
105
|
-
params: slot.params(),
|
|
106
|
-
}))
|
|
107
|
-
.gather('gather', { mode: 'parallel' }, (b) => b
|
|
108
|
-
.chain('history', (c) => c.query('read', ($) => C.sessionHistory.v1({
|
|
109
|
-
scope: $.input.sessionScope,
|
|
110
|
-
// Sized by the window (history window, 2026-10-03).
|
|
111
|
-
budget: $.contextBudget.available,
|
|
112
|
-
params: slot.params(),
|
|
113
|
-
})))
|
|
114
|
-
.chain('lore', (c) => c.query('read', ($) => C.lorebookTriggers.v1({
|
|
115
|
-
scope: $.input.sessionScope,
|
|
116
|
-
params: slot.params(),
|
|
117
|
-
})))
|
|
118
|
-
.chain('cast', (c) => c.query('read', ($) => C.sessionCast.v1({ scope: $.input.sessionScope })))
|
|
119
|
-
.chain('state', (c) => c.query('read', ($) => C.sessionState.v1({ scope: $.input.sessionScope })))
|
|
120
|
-
// Every place the world holds, by listing (the places plan
|
|
121
|
-
// A28, as `adventure-respond` reads them): location entries
|
|
122
|
-
// with their ways on (the preset), for `{{locationEntry}}`
|
|
123
|
-
// and `{{knownLocations}}`.
|
|
124
|
-
.chain('rooms', (c) => c.query('read', ($) => C.lorebookEntries.v1({
|
|
125
|
-
scope: $.input.sessionScope,
|
|
126
|
-
params: slot.params(),
|
|
127
|
-
})))
|
|
128
|
-
// Who is in the world at the session's moment (R4), for `eligible`.
|
|
129
|
-
.chain('presences', (c) => c.query('read', ($) => C.castPresences.v1({ scope: $.input.sessionScope }))))
|
|
130
|
-
// The pool the ranker reads: the conversation's band intent (R-7
|
|
131
|
-
// P5 — `session-history` ranks nothing, but its `share` reserves the
|
|
132
|
-
// transcript's slice of the window) ahead of the keyword scan's
|
|
133
|
-
// candidates, which open with the scan's own three intents
|
|
134
|
-
// (`lorebook-triggers` declares one per band it produces). A concat
|
|
135
|
-
// rather than the scan's port straight into `rank`, because a
|
|
136
|
-
// ranker takes one list and the intent needs a seat in it.
|
|
137
|
-
.task('lore', ($) => C.concatCandidates.v1({
|
|
138
|
-
sources: [$.gather.history.read.band, $.gather.lore.read.main],
|
|
139
|
-
}))
|
|
140
|
-
// The hard gates before the ranker (C2; R2, R4): the scan's own
|
|
141
|
-
// exclusions, and the presence gate.
|
|
142
|
-
.task('eligible', ($) => C.eligibility.v1({
|
|
143
|
-
candidates: $.lore.candidates,
|
|
144
|
-
exclusions: $.gather.lore.read.exclusions,
|
|
145
|
-
presences: $.gather.presences.read.main,
|
|
146
|
-
at: $.gather.presences.read.at,
|
|
147
|
-
}))
|
|
148
|
-
// The room the place slot shows (the room rule, as in
|
|
149
|
-
// `adventure-respond`): the world's `location` resolved against
|
|
150
|
-
// the places, so the ranker leaves that room to
|
|
151
|
-
// `{{locationEntry}}` rather than spending lore budget on it twice.
|
|
152
|
-
.task('place', ($) => C.undescribedName.v1({
|
|
153
|
-
name: $.gather.state.read.state,
|
|
154
|
-
locationEntries: $.gather.rooms.read.entries,
|
|
155
|
-
params: slot.params(),
|
|
156
|
-
}), { expose: { label: 'The current place' } })
|
|
157
|
-
.task('rank', ($) => C.rankHybrid.v1({
|
|
158
|
-
candidates: $.eligible.candidates,
|
|
159
|
-
budget: $.contextBudget.available,
|
|
160
|
-
shownElsewhere: $.place.entryId,
|
|
161
|
-
params: slot.params(),
|
|
162
|
-
}))
|
|
163
|
-
// The narrator's context (owner ruling 2026-10-03): the scene
|
|
164
|
-
// builder, with no plan. The key stays `context`, so a stored
|
|
165
|
-
// value at `context#prompts` keeps its address.
|
|
166
|
-
.task('context', ($) => C.buildSceneContext.v1({
|
|
167
|
-
cast: $.gather.cast.read.cast,
|
|
168
|
-
state: $.gather.state.read.state,
|
|
169
|
-
fields: $.input.fields,
|
|
170
|
-
locationEntries: $.gather.rooms.read.entries,
|
|
171
|
-
prompts: slot.prompts(),
|
|
172
|
-
variables: slot.variables(),
|
|
173
|
-
}))
|
|
174
|
-
.task('lines', ($) => C.processMessages.v1({
|
|
175
|
-
messages: $.gather.history.read.messages,
|
|
176
|
-
cast: $.gather.cast.read.cast,
|
|
177
|
-
templateContext: $.context.templateContext,
|
|
178
|
-
seedName: $.context.seedName,
|
|
179
|
-
}))
|
|
180
|
-
/**
|
|
181
|
-
* 🚧 **The transcript's files, placed** (attachments follow-ups, owner
|
|
182
|
-
* ruling 2026-10-03) — `respond`'s two steps: the files the rows show,
|
|
183
|
-
* then per line what `write` receives (an image it can read rides its
|
|
184
|
-
* own turn; otherwise its name). A transcript with no files passes
|
|
185
|
-
* through untouched, so the prompt is byte for byte what it was.
|
|
186
|
-
*/
|
|
187
|
-
.query('attachments', ($) => C.historyAttachments.v1({
|
|
188
|
-
messages: $.gather.history.read.messages,
|
|
189
|
-
params: slot.params(),
|
|
190
|
-
}))
|
|
191
|
-
.task('attached', ($) => C.placeAttachments.v1({
|
|
192
|
-
messages: $.lines.messages,
|
|
193
|
-
attachments: $.attachments.attachments,
|
|
194
|
-
connection: slot.connectionOf('write'),
|
|
195
|
-
params: slot.params(),
|
|
196
|
-
}))
|
|
197
|
-
.task('prompt', ($) => C.assemble.v2({
|
|
198
|
-
candidates: $.rank.candidates,
|
|
199
|
-
decisions: $.rank.decisions,
|
|
200
|
-
groups: $.rank.groups,
|
|
201
|
-
budget: $.contextBudget.available,
|
|
202
|
-
messages: $.attached.messages,
|
|
203
|
-
templateContext: $.context.templateContext,
|
|
204
|
-
template: slot.template(),
|
|
205
|
-
prompts: slot.prompts({ node: 'context' }),
|
|
206
|
-
variables: slot.variables(),
|
|
207
|
-
params: slot.params(),
|
|
208
|
-
connection: slot.connectionOf('write'),
|
|
209
|
-
}))
|
|
210
|
-
.oracle('write', ($) => C.generateText.v1({
|
|
211
|
-
context: $.prompt.context,
|
|
212
|
-
connection: slot.connection(),
|
|
213
|
-
sampling: slot.sampling(),
|
|
214
|
-
params: slot.params(),
|
|
215
|
-
// No `prompts` on the generating step — see `respond.ts`
|
|
216
|
-
// (culled 2026-09-16, R-12).
|
|
217
|
-
}), { expose: { stream: true, status: 'Looking around' } })
|
|
218
|
-
.outlet('save', ($) => C.createMessage.v1({ text: $.write.text }))
|
|
219
|
-
/**
|
|
220
|
-
* What this step ships with: the post-history reminder's trigger
|
|
221
|
-
* (`POST_HISTORY_TOKEN_TRIGGER`), because the prompt renders the
|
|
222
|
-
* session's growing history and the reminder only earns its place
|
|
223
|
-
* once there is enough of it to drift from; and the places and the
|
|
224
|
-
* room rule as `adventure-respond` ships them — preset values on
|
|
225
|
-
* new nodes, so they reach an install through a re-projection
|
|
226
|
-
* (0111).
|
|
227
|
-
*/
|
|
228
|
-
.preset('default', { label: 'Default', default: true }, (p) => p
|
|
229
|
-
.params('prompt', { postHistoryTokenTrigger: POST_HISTORY_TOKEN_TRIGGER })
|
|
230
|
-
.params('gather.rooms.read', {
|
|
231
|
-
entryTypes: ['core:entry/location'],
|
|
232
|
-
withLinks: true,
|
|
233
|
-
})
|
|
234
|
-
.params('place', { path: 'world.location' }))
|
|
235
|
-
.build());
|
|
236
|
-
/* ── the two keeper-only actions ────────────────────────────────────────── */
|
|
237
|
-
/**
|
|
238
|
-
* Rest and Advance time are one graph with two sets of instructions, and saying
|
|
239
|
-
* so in a builder is more honest than writing it twice.
|
|
240
|
-
*
|
|
241
|
-
* Both read the state, ask the keeper what changes, resolve the names it used
|
|
242
|
-
* and land the result as proposals — or as writes, when the session trusts the
|
|
243
|
-
* narrator. Neither writes a message: a clock tick is a ledger line, not a
|
|
244
|
-
* paragraph, and the narrator has its own button for the paragraph.
|
|
245
|
-
*
|
|
246
|
-
* They are separate SPECS rather than one spec with a parameter because a
|
|
247
|
-
* shipped prompt is resolved per (pool, spec): two specs is what gives Rest its
|
|
248
|
-
* own instructions and Advance time its own, in the same pool, each editable
|
|
249
|
-
* without touching the other.
|
|
250
|
-
*/
|
|
251
|
-
const keeperAction = (id, version, trigger) => compile(spec(id, {
|
|
252
|
-
version,
|
|
253
|
-
taxonomy: {
|
|
254
|
-
role: 'action',
|
|
255
|
-
},
|
|
256
|
-
contributes: {
|
|
257
|
-
actions: [
|
|
258
|
-
{
|
|
259
|
-
key: trigger.key,
|
|
260
|
-
venue: { kind: 'composer' },
|
|
261
|
-
quick: true,
|
|
262
|
-
icon: trigger.icon,
|
|
263
|
-
label: { en: trigger.label },
|
|
264
|
-
description: { en: trigger.description },
|
|
265
|
-
},
|
|
266
|
-
],
|
|
267
|
-
},
|
|
268
|
-
})
|
|
269
|
-
.inlet('input', C.userMessage.v1(), {
|
|
270
|
-
genre: adventureGenre,
|
|
271
|
-
event: sessionEvents.sessionAction,
|
|
272
|
-
})
|
|
273
|
-
.gather('gather', { mode: 'parallel' }, (b) => b
|
|
274
|
-
.chain('history', (c) => c.query('read', ($) => C.sessionHistory.v1({
|
|
275
|
-
scope: $.input.sessionScope,
|
|
276
|
-
params: slot.params(),
|
|
277
|
-
})))
|
|
278
|
-
.chain('cast', (c) => c.query('read', ($) => C.sessionCast.v1({ scope: $.input.sessionScope })))
|
|
279
|
-
.chain('state', (c) => c.query('read', ($) => C.sessionState.v1({ scope: $.input.sessionScope }))))
|
|
280
|
-
.task('contextBudget', ($) => C.contextBudget.v1({
|
|
281
|
-
sampling: slot.samplingOf('write'),
|
|
282
|
-
// The other half of the same pair, for the model's own
|
|
283
|
-
// window (0114) — see `respond`.
|
|
284
|
-
connection: slot.connectionOf('write'),
|
|
285
|
-
params: slot.params(),
|
|
286
|
-
}))
|
|
287
|
-
.task('context', ($) => C.buildKeeperContext.v1({
|
|
288
|
-
cast: $.gather.cast.read.cast,
|
|
289
|
-
state: $.gather.state.read.state,
|
|
290
|
-
fields: $.input.fields,
|
|
291
|
-
prompts: slot.prompts(),
|
|
292
|
-
variables: slot.variables(),
|
|
293
|
-
}))
|
|
294
|
-
/**
|
|
295
|
-
* Prose, and no turn to continue — the respond pipeline's
|
|
296
|
-
* reasoning, applied to the two actions it left behind. A step
|
|
297
|
-
* that is asking a question must not be handed a line with
|
|
298
|
-
* somebody's name on the end of it, and must not be shown the
|
|
299
|
-
* JSON an earlier turn left in the session.
|
|
300
|
-
*/
|
|
301
|
-
.task('lines', ($) => C.proseTranscript.v1({
|
|
302
|
-
messages: $.gather.history.read.messages,
|
|
303
|
-
cast: $.gather.cast.read.cast,
|
|
304
|
-
templateContext: $.context.templateContext,
|
|
305
|
-
}))
|
|
306
|
-
/**
|
|
307
|
-
* 🚧 **The transcript's files, placed** (attachments follow-ups, owner
|
|
308
|
-
* ruling 2026-10-03) — `respond`'s two steps: the files the rows show,
|
|
309
|
-
* then per line what `write` receives (an image it can read rides its
|
|
310
|
-
* own turn; otherwise its name). A transcript with no files passes
|
|
311
|
-
* through untouched, so the prompt is byte for byte what it was.
|
|
312
|
-
*/
|
|
313
|
-
.query('attachments', ($) => C.historyAttachments.v1({
|
|
314
|
-
messages: $.gather.history.read.messages,
|
|
315
|
-
params: slot.params(),
|
|
316
|
-
}))
|
|
317
|
-
.task('attached', ($) => C.placeAttachments.v1({
|
|
318
|
-
messages: $.lines.messages,
|
|
319
|
-
attachments: $.attachments.attachments,
|
|
320
|
-
connection: slot.connectionOf('write'),
|
|
321
|
-
params: slot.params(),
|
|
322
|
-
}))
|
|
323
|
-
.task('prompt', ($) => C.assemble.v2({
|
|
324
|
-
budget: $.contextBudget.available,
|
|
325
|
-
messages: $.attached.messages,
|
|
326
|
-
templateContext: $.context.templateContext,
|
|
327
|
-
template: slot.template(),
|
|
328
|
-
prompts: slot.prompts({ node: 'context' }),
|
|
329
|
-
variables: slot.variables(),
|
|
330
|
-
params: slot.params(),
|
|
331
|
-
connection: slot.connectionOf('write'),
|
|
332
|
-
}))
|
|
333
|
-
/**
|
|
334
|
-
* The keeper's own shape, asked for as a shape.
|
|
335
|
-
*
|
|
336
|
-
* ⚠ **A moved pin**: asking for a document rather than parsing one
|
|
337
|
-
* out of a prefilled reply moves both spec hashes, recorded in the
|
|
338
|
-
* app's `boot/specHashes.test.ts`. Both slugs are new in this
|
|
339
|
-
* release, which is what makes a moved pin a recorded change here
|
|
340
|
-
* rather than a break.
|
|
341
|
-
*
|
|
342
|
-
* The respond pipeline's keeper schema, deliberately: a Rest
|
|
343
|
-
* reporting in one shape and a turn reporting in another would
|
|
344
|
-
* be two vocabularies for one ledger, and the resolver reads one.
|
|
345
|
-
*/
|
|
346
|
-
.oracle('write', ($) => C.generateJson.v1({
|
|
347
|
-
context: $.prompt.context,
|
|
348
|
-
schema: ADVENTURE_KEEPER_SCHEMA,
|
|
349
|
-
connection: slot.connection(),
|
|
350
|
-
sampling: slot.sampling(),
|
|
351
|
-
params: slot.params(),
|
|
352
|
-
}), { expose: { status: 'Updating the world' } })
|
|
353
|
-
.query('resolve', ($) => C.resolveStateChanges.v1({
|
|
354
|
-
changes: $.write.items,
|
|
355
|
-
scope: $.input.sessionScope,
|
|
356
|
-
// The version this run read — see `respond`'s keeperResolve.
|
|
357
|
-
base: $.gather.state.read.version,
|
|
358
|
-
}))
|
|
359
|
-
.junction('commit', { on: ($) => $.input.fields }, (r) => r
|
|
360
|
-
.when('trusted', { path: 'trustNarrator', truthy: true }, (c) => c.task('apply', ($) => C.setState.v1({
|
|
361
|
-
changes: $.resolve.changes,
|
|
362
|
-
scope: $.input.sessionScope,
|
|
363
|
-
base: $.gather.state.read.version,
|
|
364
|
-
params: slot.params(),
|
|
365
|
-
}), { expose: { label: 'Apply the changes' } }))
|
|
366
|
-
.otherwise('reviewed', (c) => c.task('propose', ($) => C.setState.v1({
|
|
367
|
-
changes: $.resolve.changes,
|
|
368
|
-
scope: $.input.sessionScope,
|
|
369
|
-
base: $.gather.state.read.version,
|
|
370
|
-
params: slot.params(),
|
|
371
|
-
}), { expose: { label: 'Propose the changes' } })))
|
|
372
|
-
.preset('adventure', { label: 'Adventure', default: true }, (p) => p
|
|
373
|
-
// The keeper's two arms, joined into the one list
|
|
374
|
-
// the resolver takes.
|
|
375
|
-
.params('write', { path: 'values,inventory' })
|
|
376
|
-
.params('commit.trusted.apply', { mode: 'apply' }))
|
|
377
|
-
.build());
|
|
378
|
-
/** @internal */
|
|
379
|
-
export const ADVENTURE_REST_SPEC_ID = 'core:spec/adventure-rest';
|
|
380
|
-
/** @internal */
|
|
381
|
-
export const ADVENTURE_REST_VERSION = '1.0.0';
|
|
382
|
-
/** Stop and recover: stamina and health back, and the clock moves on. @internal */
|
|
383
|
-
export const adventureRestSpec = () => keeperAction(ADVENTURE_REST_SPEC_ID, ADVENTURE_REST_VERSION, {
|
|
384
|
-
key: 'rest',
|
|
385
|
-
icon: 'bed',
|
|
386
|
-
label: 'Rest',
|
|
387
|
-
description: 'Stop to recover stamina and health while time moves on.',
|
|
388
|
-
});
|
|
389
|
-
/** @internal */
|
|
390
|
-
export const ADVENTURE_ADVANCE_TIME_SPEC_ID = 'core:spec/adventure-advance-time';
|
|
391
|
-
/** @internal */
|
|
392
|
-
export const ADVENTURE_ADVANCE_TIME_VERSION = '1.0.0';
|
|
393
|
-
/** Let time pass: the world clock steps on, and the weather may turn with it. @internal */
|
|
394
|
-
export const adventureAdvanceTimeSpec = () => keeperAction(ADVENTURE_ADVANCE_TIME_SPEC_ID, ADVENTURE_ADVANCE_TIME_VERSION, {
|
|
395
|
-
key: 'advance-time',
|
|
396
|
-
icon: 'clock',
|
|
397
|
-
label: 'Time passes',
|
|
398
|
-
description: 'Let time pass in the world; the weather may change with it.',
|
|
399
|
-
});
|
|
400
|
-
/* ── ask / answer: the worked form (plans/29 R-15 *Forms*; 30 §U5d) ──────── */
|
|
401
|
-
/** @internal */
|
|
402
|
-
export const ADVENTURE_ASK_SPEC_ID = 'core:spec/adventure-ask';
|
|
403
|
-
/** @internal */
|
|
404
|
-
export const ADVENTURE_ASK_VERSION = '1.0.0';
|
|
405
|
-
/** @internal */
|
|
406
|
-
export const ADVENTURE_ANSWER_SPEC_ID = 'core:spec/adventure-answer';
|
|
407
|
-
/** @internal */
|
|
408
|
-
export const ADVENTURE_ANSWER_VERSION = '1.0.0';
|
|
409
|
-
/**
|
|
410
|
-
* What the narrator's question comes back as, from `generate-json@1`.
|
|
411
|
-
*
|
|
412
|
-
* The addressee is a **name** rather than a participant reference: the
|
|
413
|
-
* model reads names off the transcript, and `make-choices@1` resolves
|
|
414
|
-
* the name — against the cast first, then the members' presences, by
|
|
415
|
-
* name or nickname — into `character:<id>` at the write. A name that
|
|
416
|
-
* resolves to nobody leaves the block unaddressed; a press on an
|
|
417
|
-
* unaddressed block is answered as the presser (their presence when
|
|
418
|
-
* they hold one, else their own line).
|
|
419
|
-
* @internal
|
|
420
|
-
*/
|
|
421
|
-
export const ADVENTURE_ASK_SCHEMA = {
|
|
422
|
-
type: 'object',
|
|
423
|
-
properties: {
|
|
424
|
-
addressee: { type: 'string' },
|
|
425
|
-
question: { type: 'string' },
|
|
426
|
-
options: {
|
|
427
|
-
type: 'array',
|
|
428
|
-
minItems: 2,
|
|
429
|
-
maxItems: 4,
|
|
430
|
-
items: {
|
|
431
|
-
type: 'object',
|
|
432
|
-
properties: { key: { type: 'string' }, label: { type: 'string' } },
|
|
433
|
-
required: ['key', 'label'],
|
|
434
|
-
additionalProperties: false,
|
|
435
|
-
},
|
|
436
|
-
},
|
|
437
|
-
},
|
|
438
|
-
required: ['addressee', 'question', 'options'],
|
|
439
|
-
additionalProperties: false,
|
|
440
|
-
};
|
|
441
|
-
/**
|
|
442
|
-
* **Ask**: the narrator puts a question with options to one of the cast.
|
|
443
|
-
*
|
|
444
|
-
* The worked form of R-15: the oracle writes `{ addressee, question, options }`,
|
|
445
|
-
* `make-choices` turns it into a `choices` block addressed to that cast
|
|
446
|
-
* member (`character:<id>`) whose options fire `answer`, and the narration
|
|
447
|
-
* row carries it. The host stamps the block with this spec's `answer` action
|
|
448
|
-
* and an id at the write; if the run's pinned portrayals say the AI portrays
|
|
449
|
-
* the addressee, it records `form-addressed` and the genre's answer pipeline
|
|
450
|
-
* (`core:spec/answer-form-adventure`) answers as them — else the block waits
|
|
451
|
-
* for the person portraying them to click. Either way the click, real or
|
|
452
|
-
* committed, runs `adventure-answer` below.
|
|
453
|
-
*
|
|
454
|
-
* Two actions on one spec, each its own thing to the venue model: `ask` is
|
|
455
|
-
* the composer's chip and `/ask`; `answer` is what the block's options fire,
|
|
456
|
-
* declared here so the block has an identity to be stamped with. `answer`
|
|
457
|
-
* is offered to any participant — the form's **addressee** is who may
|
|
458
|
-
* actually press it, decided per block at the fire.
|
|
459
|
-
* @internal
|
|
460
|
-
*/
|
|
461
|
-
export const adventureAskSpec = () => compile(spec(ADVENTURE_ASK_SPEC_ID, {
|
|
462
|
-
version: ADVENTURE_ASK_VERSION,
|
|
463
|
-
taxonomy: { role: 'action' },
|
|
464
|
-
contributes: {
|
|
465
|
-
actions: [
|
|
466
|
-
{
|
|
467
|
-
key: 'ask',
|
|
468
|
-
venue: { kind: 'composer' },
|
|
469
|
-
quick: true,
|
|
470
|
-
icon: 'message-circle-question',
|
|
471
|
-
label: { en: 'Ask' },
|
|
472
|
-
description: { en: 'The narrator puts a question, with choices, to one of the cast.' },
|
|
473
|
-
},
|
|
474
|
-
],
|
|
475
|
-
},
|
|
476
|
-
})
|
|
477
|
-
.inlet('input', C.userMessage.v1(), {
|
|
478
|
-
genre: adventureGenre,
|
|
479
|
-
event: sessionEvents.sessionAction,
|
|
480
|
-
})
|
|
481
|
-
.gather('gather', { mode: 'parallel' }, (b) => b
|
|
482
|
-
.chain('history', (c) => c.query('read', ($) => C.sessionHistory.v1({
|
|
483
|
-
scope: $.input.sessionScope,
|
|
484
|
-
params: slot.params(),
|
|
485
|
-
})))
|
|
486
|
-
.chain('cast', (c) => c.query('read', ($) => C.sessionCast.v1({ scope: $.input.sessionScope }))))
|
|
487
|
-
.task('contextBudget', ($) => C.contextBudget.v1({
|
|
488
|
-
sampling: slot.samplingOf('write'),
|
|
489
|
-
connection: slot.connectionOf('write'),
|
|
490
|
-
params: slot.params(),
|
|
491
|
-
}))
|
|
492
|
-
.task('context', ($) => C.buildNarratorContext.v1({
|
|
493
|
-
cast: $.gather.cast.read.cast,
|
|
494
|
-
prompts: slot.prompts(),
|
|
495
|
-
variables: slot.variables(),
|
|
496
|
-
}))
|
|
497
|
-
/** Prose and no seed — a question is asked, not a turn taken (see the keeper actions). */
|
|
498
|
-
.task('lines', ($) => C.proseTranscript.v1({
|
|
499
|
-
messages: $.gather.history.read.messages,
|
|
500
|
-
cast: $.gather.cast.read.cast,
|
|
501
|
-
templateContext: $.context.templateContext,
|
|
502
|
-
}))
|
|
503
|
-
/**
|
|
504
|
-
* 🚧 **The transcript's files, placed** (attachments follow-ups, owner
|
|
505
|
-
* ruling 2026-10-03) — `respond`'s two steps: the files the rows show,
|
|
506
|
-
* then per line what `write` receives (an image it can read rides its
|
|
507
|
-
* own turn; otherwise its name). A transcript with no files passes
|
|
508
|
-
* through untouched, so the prompt is byte for byte what it was.
|
|
509
|
-
*/
|
|
510
|
-
.query('attachments', ($) => C.historyAttachments.v1({
|
|
511
|
-
messages: $.gather.history.read.messages,
|
|
512
|
-
params: slot.params(),
|
|
513
|
-
}))
|
|
514
|
-
.task('attached', ($) => C.placeAttachments.v1({
|
|
515
|
-
messages: $.lines.messages,
|
|
516
|
-
attachments: $.attachments.attachments,
|
|
517
|
-
connection: slot.connectionOf('write'),
|
|
518
|
-
params: slot.params(),
|
|
519
|
-
}))
|
|
520
|
-
.task('prompt', ($) => C.assemble.v2({
|
|
521
|
-
budget: $.contextBudget.available,
|
|
522
|
-
messages: $.attached.messages,
|
|
523
|
-
templateContext: $.context.templateContext,
|
|
524
|
-
template: slot.template(),
|
|
525
|
-
prompts: slot.prompts({ node: 'context' }),
|
|
526
|
-
variables: slot.variables(),
|
|
527
|
-
params: slot.params(),
|
|
528
|
-
connection: slot.connectionOf('write'),
|
|
529
|
-
}))
|
|
530
|
-
.oracle('write', ($) => C.generateJson.v1({
|
|
531
|
-
context: $.prompt.context,
|
|
532
|
-
schema: ADVENTURE_ASK_SCHEMA,
|
|
533
|
-
connection: slot.connection(),
|
|
534
|
-
sampling: slot.sampling(),
|
|
535
|
-
params: slot.params(),
|
|
536
|
-
}), { expose: { status: 'Posing a question' } })
|
|
537
|
-
.task('choices', ($) => C.makeChoices.v1({
|
|
538
|
-
json: $.write.json,
|
|
539
|
-
fn: 'answer',
|
|
540
|
-
// Answer is the other spec's declaration, named on purpose:
|
|
541
|
-
// the host holds the options to THAT action's audience —
|
|
542
|
-
// the block's addressee — and runs THAT spec on a press.
|
|
543
|
-
action: `${ADVENTURE_ANSWER_SPEC_ID}#answer`,
|
|
544
|
-
cast: $.gather.cast.read.cast,
|
|
545
|
-
}))
|
|
546
|
-
.outlet('save', ($) => C.createMessage.v1({
|
|
547
|
-
narration: true,
|
|
548
|
-
text: $.choices.text,
|
|
549
|
-
blocks: $.choices.blocks,
|
|
550
|
-
}))
|
|
551
|
-
.build());
|
|
552
|
-
/**
|
|
553
|
-
* **Answer**: what a form's option fires — the addressee's line, as the
|
|
554
|
-
* addressee. `read-answer` takes the press apart (the chosen option's label,
|
|
555
|
-
* who answered and their character row) and `create-message` posts the
|
|
556
|
-
* label as that participant's message. A person portraying the addressee
|
|
557
|
-
* clicks and the row is theirs; the answer pipeline commits an oracle's
|
|
558
|
-
* choice and the row is the AI's — same spec, same row, either way, which
|
|
559
|
-
* is the whole of "exactly as a click would".
|
|
560
|
-
*
|
|
561
|
-
* Declared on its own spec rather than folded into `ask`: a spec has one
|
|
562
|
-
* inlet and one graph, and asking and answering are two graphs.
|
|
563
|
-
* @internal
|
|
564
|
-
*/
|
|
565
|
-
export const adventureAnswerSpec = () => compile(spec(ADVENTURE_ANSWER_SPEC_ID, {
|
|
566
|
-
version: ADVENTURE_ANSWER_VERSION,
|
|
567
|
-
taxonomy: { role: 'action' },
|
|
568
|
-
contributes: {
|
|
569
|
-
actions: [
|
|
570
|
-
{
|
|
571
|
-
key: 'answer',
|
|
572
|
-
/**
|
|
573
|
-
* Carried by a block in a message and pressed from that
|
|
574
|
-
* block alone: the `form` venue (U5d review, S1) is the
|
|
575
|
-
* one no listing offers, so *Answer* is in no message's
|
|
576
|
-
* overflow and no composer menu — a question is answered
|
|
577
|
-
* where it was asked. The block's fire still resolves it.
|
|
578
|
-
*/
|
|
579
|
-
venue: { kind: 'form' },
|
|
580
|
-
audience: { see: ['participant'], act: ['participant'] },
|
|
581
|
-
icon: 'message-circle-reply',
|
|
582
|
-
label: { en: 'Answer' },
|
|
583
|
-
description: { en: 'Answer a question the narrator put to you.' },
|
|
584
|
-
},
|
|
585
|
-
],
|
|
586
|
-
},
|
|
587
|
-
})
|
|
588
|
-
.inlet('input', C.userMessage.v1(), {
|
|
589
|
-
genre: adventureGenre,
|
|
590
|
-
event: sessionEvents.sessionAction,
|
|
591
|
-
})
|
|
592
|
-
.task('answer', ($) => C.readAnswer.v1({ payload: $.input.payload, form: $.input.form }))
|
|
593
|
-
.outlet('save', ($) => C.createMessage.v1({
|
|
594
|
-
text: $.answer.label,
|
|
595
|
-
characterId: $.answer.characterId,
|
|
596
|
-
speaker: $.answer.addressee,
|
|
597
|
-
}))
|
|
598
|
-
.build());
|
|
599
|
-
//# sourceMappingURL=adventureActions.js.map
|
package/dist/createChat.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/** @internal */
|
|
2
|
-
export declare const CREATE_CHAT_SPEC_ID = "core:spec/create-chat";
|
|
3
|
-
/** @internal */
|
|
4
|
-
export declare const CREATE_CHAT_VERSION = "2.2.0";
|
|
5
|
-
/** @internal */
|
|
6
|
-
export declare const createChatSpec: () => import("@serene-pub/sdk").SpecDocument;
|
|
7
|
-
//# sourceMappingURL=createChat.d.ts.map
|
package/dist/generateImage.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/** @experimental */
|
|
2
|
-
export declare const GENERATE_IMAGE_SPEC_ID = "core:spec/generate-image";
|
|
3
|
-
/** @internal */
|
|
4
|
-
export declare const GENERATE_IMAGE_VERSION = "1.0.0";
|
|
5
|
-
/** @experimental */
|
|
6
|
-
export declare const generateImageSpec: () => import("@serene-pub/sdk").SpecDocument;
|
|
7
|
-
//# sourceMappingURL=generateImage.d.ts.map
|