@serene-pub/core-catalog 0.6.0-pr-2 → 0.6.0-pr-4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +21 -1
- package/components/{sessions → genres/chat}/authors-note/AuthorsNote.svelte +1 -1
- package/components/{sessions → genres/chat}/authors-note/AuthorsNoteWidget.svelte +1 -1
- package/components/{sessions → shared}/lore-entries/LoreEntries.svelte +1 -1
- package/components/{sessions → shared}/lore-entries/LoreEntriesWidget.svelte +1 -1
- package/components/{sessions → shared}/messages/MessageComposer.svelte +1 -1
- package/components/{sessions → shared}/messages/Messages.svelte +1 -1
- package/components/{sessions → shared}/messages/MessagesWidget.svelte +1 -1
- package/components/{sessions → shared}/messages/SessionComposer.svelte +1 -1
- package/components/{sessions → shared}/messages/SessionMessage.svelte +1 -1
- package/components/{sessions → shared}/messages/conversation.svelte.ts +1 -1
- package/components/{sessions → shared}/scene-portraits/ScenePortraits.svelte +1 -1
- package/components/{sessions → shared}/scene-portraits/ScenePortraitsWidget.svelte +1 -1
- package/components/{sessions → shared}/stats/Stats.svelte +1 -1
- package/components/{sessions → shared}/stats/StatsWidget.svelte +1 -1
- package/components/{sessions → shared}/world-state/WorldState.svelte +1 -1
- package/components/{sessions → shared}/world-state/WorldStateWidget.svelte +1 -1
- package/dist/components/authors-note.js +5 -5
- package/dist/components/authors-note.source.json +1 -1
- package/dist/components/core-ui.json +1 -1
- package/dist/components/lore-entries.js +5 -5
- package/dist/components/lore-entries.source.json +1 -1
- package/dist/components/messages.js +26 -26
- package/dist/components/messages.source.json +1 -1
- package/dist/components/scene-portraits.js +7 -7
- package/dist/components/scene-portraits.source.json +1 -1
- package/dist/components/{shared-TCQZXBE3.js → shared-3FGURYVS.js} +2 -2
- package/dist/components/{shared-AINANAIA.js → shared-FXYLABGF.js} +6 -6
- package/dist/components/{shared-UAQVMZZK.js → shared-U3UU5V7L.js} +3 -3
- package/dist/components/stats.js +6 -6
- package/dist/components/stats.source.json +1 -1
- package/dist/components/world-state.js +6 -6
- package/dist/components/world-state.source.json +1 -1
- package/dist/{answerForm.d.ts → factories/answerForm.d.ts} +4 -30
- package/dist/{answerForm.js → factories/answerForm.js} +4 -37
- package/dist/factories/once.d.ts +7 -0
- package/dist/factories/once.js +9 -0
- package/dist/{turnOrder.d.ts → factories/turnOrder.d.ts} +0 -22
- package/dist/{turnOrder.js → factories/turnOrder.js} +4 -104
- package/dist/genres/adventure/advanceTime.d.ts +11 -0
- package/dist/genres/adventure/advanceTime.js +17 -0
- package/dist/genres/adventure/answer.d.ts +23 -0
- package/dist/genres/adventure/answer.js +59 -0
- package/dist/genres/adventure/answerForm.d.ts +9 -0
- package/dist/genres/adventure/answerForm.js +11 -0
- package/dist/genres/adventure/ask.d.ts +73 -0
- package/dist/genres/adventure/ask.js +157 -0
- package/dist/genres/adventure/create.d.ts +36 -0
- package/dist/genres/adventure/create.js +62 -0
- package/dist/genres/adventure/index.d.ts +43 -0
- package/dist/genres/adventure/index.js +43 -0
- package/dist/genres/adventure/keeperAction.d.ts +24 -0
- package/dist/genres/adventure/keeperAction.js +150 -0
- package/dist/genres/adventure/look.d.ts +45 -0
- package/dist/genres/adventure/look.js +209 -0
- package/dist/{adventure.d.ts → genres/adventure/respond.d.ts} +10 -34
- package/dist/{adventure.js → genres/adventure/respond.js} +34 -60
- package/dist/genres/adventure/rest.d.ts +10 -0
- package/dist/genres/adventure/rest.js +16 -0
- package/dist/genres/adventure/turnOrder.d.ts +10 -0
- package/dist/genres/adventure/turnOrder.js +27 -0
- package/dist/genres/chat/answerForm.d.ts +9 -0
- package/dist/genres/chat/answerForm.js +11 -0
- package/dist/genres/chat/create.d.ts +7 -0
- package/dist/{createChat.js → genres/chat/create.js} +6 -6
- package/dist/genres/chat/generateImage.d.ts +7 -0
- package/dist/{generateImage.js → genres/chat/generateImage.js} +5 -5
- package/dist/genres/chat/index.d.ts +15 -0
- package/dist/genres/chat/index.js +15 -0
- package/dist/{narrate.d.ts → genres/chat/narrate.d.ts} +3 -3
- package/dist/{narrate.js → genres/chat/narrate.js} +34 -12
- package/dist/{narrateCharacter.d.ts → genres/chat/narrateCharacter.d.ts} +2 -2
- package/dist/{narrateCharacter.js → genres/chat/narrateCharacter.js} +35 -16
- package/dist/genres/chat/respond.d.ts +25 -0
- package/dist/{respond.js → genres/chat/respond.js} +48 -22
- package/dist/genres/chat/turnOrder.d.ts +9 -0
- package/dist/genres/chat/turnOrder.js +28 -0
- package/dist/{ui/sessions → genres/chat/ui}/authors-note/index.d.ts +1 -1
- package/dist/genres/guide/answerForm.d.ts +9 -0
- package/dist/genres/guide/answerForm.js +11 -0
- package/dist/genres/guide/create.d.ts +24 -0
- package/dist/genres/guide/create.js +58 -0
- package/dist/genres/guide/index.d.ts +9 -0
- package/dist/genres/guide/index.js +9 -0
- package/dist/{guide.d.ts → genres/guide/respond.d.ts} +1 -20
- package/dist/{guide.js → genres/guide/respond.js} +29 -60
- package/dist/genres/guide/turnOrder.d.ts +10 -0
- package/dist/genres/guide/turnOrder.js +27 -0
- package/dist/genres/index.d.ts +14 -0
- package/dist/genres/index.js +41 -0
- package/dist/genres/lair/answerForm.d.ts +17 -0
- package/dist/genres/lair/answerForm.js +19 -0
- package/dist/genres/lair/buildRoom.d.ts +64 -0
- package/dist/genres/lair/buildRoom.js +244 -0
- package/dist/genres/lair/castellanAction.d.ts +27 -0
- package/dist/genres/lair/castellanAction.js +177 -0
- package/dist/genres/lair/create.d.ts +28 -0
- package/dist/genres/lair/create.js +69 -0
- package/dist/genres/lair/fileRoom.d.ts +53 -0
- package/dist/genres/lair/fileRoom.js +288 -0
- package/dist/genres/lair/index.d.ts +60 -0
- package/dist/genres/lair/index.js +60 -0
- package/dist/genres/lair/nudge.d.ts +25 -0
- package/dist/genres/lair/nudge.js +78 -0
- package/dist/{lair.d.ts → genres/lair/respond.d.ts} +15 -28
- package/dist/{lair.js → genres/lair/respond.js} +45 -76
- package/dist/genres/lair/reveal.d.ts +10 -0
- package/dist/genres/lair/reveal.js +18 -0
- package/dist/genres/lair/roomAnswer.d.ts +86 -0
- package/dist/genres/lair/roomAnswer.js +378 -0
- package/dist/genres/lair/trap.d.ts +11 -0
- package/dist/genres/lair/trap.js +24 -0
- package/dist/genres/lair/turnOrder.d.ts +9 -0
- package/dist/genres/lair/turnOrder.js +36 -0
- package/dist/genres/lair/whisper.d.ts +35 -0
- package/dist/genres/lair/whisper.js +90 -0
- package/dist/index.d.ts +47 -29
- package/dist/index.js +117 -88
- package/dist/{genres.js → registry/genres.js} +4 -4
- package/dist/{ui/sessions → registry}/widgets.js +6 -6
- package/dist/{presets.js → seed/presets.js} +28 -13
- package/dist/{prompts.js → seed/prompts.js} +27 -56
- package/dist/{annexField.d.ts → shared/annexField.d.ts} +3 -2
- package/dist/{annexField.js → shared/annexField.js} +6 -8
- package/dist/shared/builtins/branch.d.ts +8 -0
- package/dist/shared/builtins/branch.js +13 -0
- package/dist/{builtins.d.ts → shared/builtins/builtIn.d.ts} +16 -21
- package/dist/{builtins.js → shared/builtins/builtIn.js} +3 -37
- package/dist/shared/builtins/delete.d.ts +8 -0
- package/dist/shared/builtins/delete.js +13 -0
- package/dist/shared/builtins/edit.d.ts +8 -0
- package/dist/shared/builtins/edit.js +13 -0
- package/dist/shared/builtins/hide.d.ts +8 -0
- package/dist/shared/builtins/hide.js +13 -0
- package/dist/shared/builtins/index.d.ts +11 -0
- package/dist/shared/builtins/index.js +11 -0
- package/dist/shared/builtins/swipe.d.ts +8 -0
- package/dist/shared/builtins/swipe.js +17 -0
- package/dist/shared/sprites.d.ts +34 -0
- package/dist/shared/sprites.js +98 -0
- package/dist/shared/summarize/character.d.ts +9 -0
- package/dist/shared/summarize/character.js +10 -0
- package/dist/shared/summarize/history.d.ts +9 -0
- package/dist/shared/summarize/history.js +10 -0
- package/dist/shared/summarize/index.d.ts +10 -0
- package/dist/shared/summarize/index.js +10 -0
- package/dist/shared/summarize/scene.d.ts +38 -0
- package/dist/shared/summarize/scene.js +42 -0
- package/dist/shared/summarize/summarizeSpec.d.ts +54 -0
- package/dist/{summarize.js → shared/summarize/summarizeSpec.js} +8 -53
- package/dist/shared/summarize/world.d.ts +8 -0
- package/dist/shared/summarize/world.js +9 -0
- package/dist/{toolLoop.d.ts → shared/toolLoop.d.ts} +25 -3
- package/dist/{toolLoop.js → shared/toolLoop.js} +67 -14
- package/dist/{ui/sessions → shared/ui}/conversation/index.d.ts +1 -1
- package/dist/{ui/sessions → shared/ui}/conversation/index.js +1 -1
- package/dist/{ui/sessions → shared/ui}/coreWidgetsEntry.d.ts +1 -1
- package/dist/{ui/sessions → shared/ui}/coreWidgetsEntry.js +1 -1
- package/dist/{ui/sessions → shared/ui}/lore-entries/index.d.ts +1 -1
- package/dist/{ui/sessions → shared/ui}/scene-portraits/index.d.ts +1 -1
- package/dist/{ui/sessions → shared/ui}/scene-portraits/index.js +1 -1
- package/dist/{ui/sessions → shared/ui}/session-state/index.d.ts +1 -1
- package/dist/{ui/sessions → shared/ui}/session-state/index.js +1 -1
- package/package.json +28 -28
- package/dist/adventureActions.d.ts +0 -169
- package/dist/adventureActions.js +0 -599
- package/dist/createChat.d.ts +0 -7
- package/dist/generateImage.d.ts +0 -7
- package/dist/lairActions.d.ts +0 -296
- package/dist/lairActions.js +0 -1287
- package/dist/respond.d.ts +0 -24
- package/dist/sprites.d.ts +0 -24
- package/dist/sprites.js +0 -102
- package/dist/summarize.d.ts +0 -76
- /package/components/{sessions → genres/chat}/authors-note/authors-note.ts +0 -0
- /package/components/{sessions/shared → shared}/context.ts +0 -0
- /package/components/{sessions → shared}/lore-entries/lore-entries.ts +0 -0
- /package/components/{sessions → shared}/messages/MessageBlocksView.svelte +0 -0
- /package/components/{sessions → shared}/messages/MessageControls.svelte +0 -0
- /package/components/{sessions → shared}/messages/MessageMediaStrip.svelte +0 -0
- /package/components/{sessions → shared}/messages/MessagePartsView.svelte +0 -0
- /package/components/{sessions → shared}/messages/MessageStateLedger.svelte +0 -0
- /package/components/{sessions → shared}/messages/NextCharacterBlock.svelte +0 -0
- /package/components/{sessions → shared}/messages/SessionContainer.svelte +0 -0
- /package/components/{sessions → shared}/messages/StateProposalList.svelte +0 -0
- /package/components/{sessions → shared}/messages/mediaStrip.ts +0 -0
- /package/components/{sessions → shared}/messages/messages.ts +0 -0
- /package/components/{sessions → shared}/scene-portraits/StatBars.svelte +0 -0
- /package/components/{sessions → shared}/scene-portraits/scene-portraits.ts +0 -0
- /package/components/{sessions → shared}/state/SlotControl.svelte +0 -0
- /package/components/{sessions → shared}/state/entryFinder.ts +0 -0
- /package/components/{sessions → shared}/state/slotWriter.svelte.ts +0 -0
- /package/components/{sessions → shared}/stats/stats.ts +0 -0
- /package/components/{sessions/shared → shared}/widgetRef.svelte.ts +0 -0
- /package/components/{sessions → shared}/world-state/world-state.ts +0 -0
- /package/dist/{ui/sessions → genres/chat/ui}/authors-note/index.js +0 -0
- /package/dist/{entries.d.ts → registry/entries.d.ts} +0 -0
- /package/dist/{entries.js → registry/entries.js} +0 -0
- /package/dist/{genres.d.ts → registry/genres.d.ts} +0 -0
- /package/dist/{ui/sessions → registry}/layouts.d.ts +0 -0
- /package/dist/{ui/sessions → registry}/layouts.js +0 -0
- /package/dist/{slots.d.ts → registry/slots.d.ts} +0 -0
- /package/dist/{slots.js → registry/slots.js} +0 -0
- /package/dist/{statShapes.d.ts → registry/statShapes.d.ts} +0 -0
- /package/dist/{statShapes.js → registry/statShapes.js} +0 -0
- /package/dist/{ui/sessions → registry}/widgets.d.ts +0 -0
- /package/dist/{guideMascotImage.d.ts → seed/guideMascotImage.d.ts} +0 -0
- /package/dist/{guideMascotImage.js → seed/guideMascotImage.js} +0 -0
- /package/dist/{presets.d.ts → seed/presets.d.ts} +0 -0
- /package/dist/{prompts.d.ts → seed/prompts.d.ts} +0 -0
- /package/dist/{graphBuild.d.ts → shared/graphBuild.d.ts} +0 -0
- /package/dist/{graphBuild.js → shared/graphBuild.js} +0 -0
- /package/dist/{ui/sessions → shared/ui}/conversation/actionsDisclosure.d.ts +0 -0
- /package/dist/{ui/sessions → shared/ui}/conversation/actionsDisclosure.js +0 -0
- /package/dist/{ui/sessions → shared/ui}/conversation/composerTray.d.ts +0 -0
- /package/dist/{ui/sessions → shared/ui}/conversation/composerTray.js +0 -0
- /package/dist/{ui/sessions → shared/ui}/conversation/dossier.d.ts +0 -0
- /package/dist/{ui/sessions → shared/ui}/conversation/dossier.js +0 -0
- /package/dist/{ui/sessions → shared/ui}/conversation/formAnswer.d.ts +0 -0
- /package/dist/{ui/sessions → shared/ui}/conversation/formAnswer.js +0 -0
- /package/dist/{ui/sessions → shared/ui}/conversation/itemValues.d.ts +0 -0
- /package/dist/{ui/sessions → shared/ui}/conversation/itemValues.js +0 -0
- /package/dist/{ui/sessions → shared/ui}/conversation/messageOrder.d.ts +0 -0
- /package/dist/{ui/sessions → shared/ui}/conversation/messageOrder.js +0 -0
- /package/dist/{ui/sessions → shared/ui}/conversation/messageSpeaker.d.ts +0 -0
- /package/dist/{ui/sessions → shared/ui}/conversation/messageSpeaker.js +0 -0
- /package/dist/{ui/sessions → shared/ui}/conversation/messageVerbState.d.ts +0 -0
- /package/dist/{ui/sessions → shared/ui}/conversation/messageVerbState.js +0 -0
- /package/dist/{ui/sessions → shared/ui}/conversation/slashPalette.d.ts +0 -0
- /package/dist/{ui/sessions → shared/ui}/conversation/slashPalette.js +0 -0
- /package/dist/{ui/sessions → shared/ui}/conversation/text.d.ts +0 -0
- /package/dist/{ui/sessions → shared/ui}/conversation/text.js +0 -0
- /package/dist/{ui/sessions → shared/ui}/lore-entries/index.js +0 -0
- /package/dist/{ui/sessions → shared/ui}/scene-portraits/portraits.d.ts +0 -0
- /package/dist/{ui/sessions → shared/ui}/scene-portraits/portraits.js +0 -0
- /package/dist/{ui/sessions → shared/ui}/session-state/barMath.d.ts +0 -0
- /package/dist/{ui/sessions → shared/ui}/session-state/barMath.js +0 -0
- /package/dist/{ui/sessions → shared/ui}/session-state/shapes.d.ts +0 -0
- /package/dist/{ui/sessions → shared/ui}/session-state/shapes.js +0 -0
- /package/dist/{ui/sessions → shared/ui}/session-state/stateView.d.ts +0 -0
- /package/dist/{ui/sessions → shared/ui}/session-state/stateView.js +0 -0
- /package/dist/{ui/sessions → shared/ui}/widgetContext.d.ts +0 -0
- /package/dist/{ui/sessions → shared/ui}/widgetContext.js +0 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Adventure's answer pipeline: `answerFormSpec` (`factories/answerForm.ts`),
|
|
3
|
+
* published for Adventure.
|
|
4
|
+
*/
|
|
5
|
+
/** @internal */
|
|
6
|
+
export declare const ADVENTURE_ANSWER_FORM_SPEC_ID = "core:spec/adventure-answer-form";
|
|
7
|
+
/** @internal */
|
|
8
|
+
export declare const answerFormAdventureSpec: () => import("@serene-pub/sdk").SpecDocument;
|
|
9
|
+
//# sourceMappingURL=answerForm.d.ts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Adventure's answer pipeline: `answerFormSpec` (`factories/answerForm.ts`),
|
|
3
|
+
* published for Adventure.
|
|
4
|
+
*/
|
|
5
|
+
import { adventureGenre } from '../../registry/genres.js';
|
|
6
|
+
import { answerFormSpec } from '../../factories/answerForm.js';
|
|
7
|
+
/** @internal */
|
|
8
|
+
export const ADVENTURE_ANSWER_FORM_SPEC_ID = 'core:spec/adventure-answer-form';
|
|
9
|
+
/** @internal */
|
|
10
|
+
export const answerFormAdventureSpec = () => answerFormSpec(ADVENTURE_ANSWER_FORM_SPEC_ID, adventureGenre);
|
|
11
|
+
//# sourceMappingURL=answerForm.js.map
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Adventure's **Ask** action: the narrator asks, the cast answers (`answer.ts`).
|
|
3
|
+
* The genre's actions are introduced in `index.ts`.
|
|
4
|
+
*/
|
|
5
|
+
/** @internal */
|
|
6
|
+
export declare const ADVENTURE_ASK_SPEC_ID = "core:spec/adventure-ask";
|
|
7
|
+
/** @internal */
|
|
8
|
+
export declare const ADVENTURE_ASK_VERSION = "1.0.0";
|
|
9
|
+
/**
|
|
10
|
+
* What the narrator's question comes back as, from `generate-json@1`.
|
|
11
|
+
*
|
|
12
|
+
* The addressee is a **name** rather than a participant reference: the
|
|
13
|
+
* model reads names off the transcript, and `make-choices@1` resolves
|
|
14
|
+
* the name — against the cast first, then the members' presences, by
|
|
15
|
+
* name or nickname — into `character:<id>` at the write. A name that
|
|
16
|
+
* resolves to nobody leaves the block unaddressed; a press on an
|
|
17
|
+
* unaddressed block is answered as the presser (their presence when
|
|
18
|
+
* they hold one, else their own line).
|
|
19
|
+
* @internal
|
|
20
|
+
*/
|
|
21
|
+
export declare const ADVENTURE_ASK_SCHEMA: {
|
|
22
|
+
readonly type: 'object';
|
|
23
|
+
readonly properties: {
|
|
24
|
+
readonly addressee: {
|
|
25
|
+
readonly type: 'string';
|
|
26
|
+
};
|
|
27
|
+
readonly question: {
|
|
28
|
+
readonly type: 'string';
|
|
29
|
+
};
|
|
30
|
+
readonly options: {
|
|
31
|
+
readonly type: 'array';
|
|
32
|
+
readonly minItems: 2;
|
|
33
|
+
readonly maxItems: 4;
|
|
34
|
+
readonly items: {
|
|
35
|
+
readonly type: 'object';
|
|
36
|
+
readonly properties: {
|
|
37
|
+
readonly key: {
|
|
38
|
+
readonly type: 'string';
|
|
39
|
+
};
|
|
40
|
+
readonly label: {
|
|
41
|
+
readonly type: 'string';
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
readonly required: readonly ['key', 'label'];
|
|
45
|
+
readonly additionalProperties: false;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
readonly required: readonly ['addressee', 'question', 'options'];
|
|
50
|
+
readonly additionalProperties: false;
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* **Ask**: the narrator puts a question with options to one of the cast.
|
|
54
|
+
*
|
|
55
|
+
* The worked form of R-15: the oracle writes `{ addressee, question, options }`,
|
|
56
|
+
* `make-choices` turns it into a `choices` block addressed to that cast
|
|
57
|
+
* member (`character:<id>`) whose options fire `answer`, and the narration
|
|
58
|
+
* row carries it. The host stamps the block with this spec's `answer` action
|
|
59
|
+
* and an id at the write; if the run's pinned portrayals say the AI portrays
|
|
60
|
+
* the addressee, it records `form-addressed` and the genre's answer pipeline
|
|
61
|
+
* (`core:spec/adventure-answer-form`) answers as them — else the block waits
|
|
62
|
+
* for the person portraying them to click. Either way the click, real or
|
|
63
|
+
* committed, runs `adventure-answer` below.
|
|
64
|
+
*
|
|
65
|
+
* Two actions on one spec, each its own thing to the venue model: `ask` is
|
|
66
|
+
* the composer's chip and `/ask`; `answer` is what the block's options fire,
|
|
67
|
+
* declared here so the block has an identity to be stamped with. `answer`
|
|
68
|
+
* is offered to any participant — the form's **addressee** is who may
|
|
69
|
+
* actually press it, decided per block at the fire.
|
|
70
|
+
* @internal
|
|
71
|
+
*/
|
|
72
|
+
export declare const adventureAskSpec: () => import("@serene-pub/sdk").SpecDocument;
|
|
73
|
+
//# sourceMappingURL=ask.d.ts.map
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Adventure's **Ask** action: the narrator asks, the cast answers (`answer.ts`).
|
|
3
|
+
* The genre's actions are introduced in `index.ts`.
|
|
4
|
+
*/
|
|
5
|
+
import { compile, slot, spec, sessionEvents } from '@serene-pub/sdk';
|
|
6
|
+
import * as C from '@serene-pub/contracts';
|
|
7
|
+
import { adventureGenre } from '../../registry/genres.js';
|
|
8
|
+
import { ADVENTURE_ANSWER_SPEC_ID } from './answer.js';
|
|
9
|
+
/* ── ask / answer: the worked form (plans/29 R-15 *Forms*; 30 §U5d) ──────── */
|
|
10
|
+
/** @internal */
|
|
11
|
+
export const ADVENTURE_ASK_SPEC_ID = 'core:spec/adventure-ask';
|
|
12
|
+
/** @internal */
|
|
13
|
+
export const ADVENTURE_ASK_VERSION = '1.0.0';
|
|
14
|
+
/**
|
|
15
|
+
* What the narrator's question comes back as, from `generate-json@1`.
|
|
16
|
+
*
|
|
17
|
+
* The addressee is a **name** rather than a participant reference: the
|
|
18
|
+
* model reads names off the transcript, and `make-choices@1` resolves
|
|
19
|
+
* the name — against the cast first, then the members' presences, by
|
|
20
|
+
* name or nickname — into `character:<id>` at the write. A name that
|
|
21
|
+
* resolves to nobody leaves the block unaddressed; a press on an
|
|
22
|
+
* unaddressed block is answered as the presser (their presence when
|
|
23
|
+
* they hold one, else their own line).
|
|
24
|
+
* @internal
|
|
25
|
+
*/
|
|
26
|
+
export const ADVENTURE_ASK_SCHEMA = {
|
|
27
|
+
type: 'object',
|
|
28
|
+
properties: {
|
|
29
|
+
addressee: { type: 'string' },
|
|
30
|
+
question: { type: 'string' },
|
|
31
|
+
options: {
|
|
32
|
+
type: 'array',
|
|
33
|
+
minItems: 2,
|
|
34
|
+
maxItems: 4,
|
|
35
|
+
items: {
|
|
36
|
+
type: 'object',
|
|
37
|
+
properties: { key: { type: 'string' }, label: { type: 'string' } },
|
|
38
|
+
required: ['key', 'label'],
|
|
39
|
+
additionalProperties: false,
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
required: ['addressee', 'question', 'options'],
|
|
44
|
+
additionalProperties: false,
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* **Ask**: the narrator puts a question with options to one of the cast.
|
|
48
|
+
*
|
|
49
|
+
* The worked form of R-15: the oracle writes `{ addressee, question, options }`,
|
|
50
|
+
* `make-choices` turns it into a `choices` block addressed to that cast
|
|
51
|
+
* member (`character:<id>`) whose options fire `answer`, and the narration
|
|
52
|
+
* row carries it. The host stamps the block with this spec's `answer` action
|
|
53
|
+
* and an id at the write; if the run's pinned portrayals say the AI portrays
|
|
54
|
+
* the addressee, it records `form-addressed` and the genre's answer pipeline
|
|
55
|
+
* (`core:spec/adventure-answer-form`) answers as them — else the block waits
|
|
56
|
+
* for the person portraying them to click. Either way the click, real or
|
|
57
|
+
* committed, runs `adventure-answer` below.
|
|
58
|
+
*
|
|
59
|
+
* Two actions on one spec, each its own thing to the venue model: `ask` is
|
|
60
|
+
* the composer's chip and `/ask`; `answer` is what the block's options fire,
|
|
61
|
+
* declared here so the block has an identity to be stamped with. `answer`
|
|
62
|
+
* is offered to any participant — the form's **addressee** is who may
|
|
63
|
+
* actually press it, decided per block at the fire.
|
|
64
|
+
* @internal
|
|
65
|
+
*/
|
|
66
|
+
export const adventureAskSpec = () => compile(spec(ADVENTURE_ASK_SPEC_ID, {
|
|
67
|
+
version: ADVENTURE_ASK_VERSION,
|
|
68
|
+
taxonomy: { role: 'action' },
|
|
69
|
+
contributes: {
|
|
70
|
+
actions: [
|
|
71
|
+
{
|
|
72
|
+
key: 'ask',
|
|
73
|
+
venue: { kind: 'composer' },
|
|
74
|
+
quick: true,
|
|
75
|
+
icon: 'message-circle-question',
|
|
76
|
+
label: { en: 'Ask' },
|
|
77
|
+
description: { en: 'The narrator puts a question, with choices, to one of the cast.' },
|
|
78
|
+
},
|
|
79
|
+
],
|
|
80
|
+
},
|
|
81
|
+
})
|
|
82
|
+
.inlet('input', C.userMessage.v1(), {
|
|
83
|
+
genre: adventureGenre,
|
|
84
|
+
event: sessionEvents.sessionAction,
|
|
85
|
+
})
|
|
86
|
+
.gather('gather', { mode: 'parallel' }, (b) => b
|
|
87
|
+
.chain('history', (c) => c.query('read', ($) => C.sessionHistory.v1({
|
|
88
|
+
scope: $.input.sessionScope,
|
|
89
|
+
params: slot.params(),
|
|
90
|
+
})))
|
|
91
|
+
.chain('cast', (c) => c.query('read', ($) => C.sessionCast.v1({ scope: $.input.sessionScope }))))
|
|
92
|
+
.task('contextBudget', ($) => C.contextBudget.v1({
|
|
93
|
+
sampling: slot.samplingOf('write'),
|
|
94
|
+
connection: slot.connectionOf('write'),
|
|
95
|
+
params: slot.params(),
|
|
96
|
+
}))
|
|
97
|
+
.task('context', ($) => C.buildNarratorContext.v1({
|
|
98
|
+
cast: $.gather.cast.read.cast,
|
|
99
|
+
prompts: slot.prompts(),
|
|
100
|
+
variables: slot.variables(),
|
|
101
|
+
}))
|
|
102
|
+
/** Prose and no seed — a question is asked, not a turn taken (see the keeper actions). */
|
|
103
|
+
.task('lines', ($) => C.proseTranscript.v1({
|
|
104
|
+
messages: $.gather.history.read.messages,
|
|
105
|
+
cast: $.gather.cast.read.cast,
|
|
106
|
+
templateContext: $.context.templateContext,
|
|
107
|
+
}))
|
|
108
|
+
/**
|
|
109
|
+
* 🚧 **The transcript's files, placed** (attachments follow-ups, owner
|
|
110
|
+
* ruling 2026-10-03) — `respond`'s two steps: the files the rows show,
|
|
111
|
+
* then per line what `write` receives (an image it can read rides its
|
|
112
|
+
* own turn; otherwise its name). A transcript with no files passes
|
|
113
|
+
* through untouched, so the prompt is byte for byte what it was.
|
|
114
|
+
*/
|
|
115
|
+
.query('attachments', ($) => C.historyAttachments.v1({
|
|
116
|
+
messages: $.gather.history.read.messages,
|
|
117
|
+
params: slot.params(),
|
|
118
|
+
}))
|
|
119
|
+
.task('attached', ($) => C.placeAttachments.v1({
|
|
120
|
+
messages: $.lines.messages,
|
|
121
|
+
attachments: $.attachments.attachments,
|
|
122
|
+
connection: slot.connectionOf('write'),
|
|
123
|
+
params: slot.params(),
|
|
124
|
+
}))
|
|
125
|
+
.task('prompt', ($) => C.assemble.v2({
|
|
126
|
+
budget: $.contextBudget.available,
|
|
127
|
+
messages: $.attached.messages,
|
|
128
|
+
templateContext: $.context.templateContext,
|
|
129
|
+
template: slot.template(),
|
|
130
|
+
prompts: slot.prompts({ node: 'context' }),
|
|
131
|
+
variables: slot.variables(),
|
|
132
|
+
params: slot.params(),
|
|
133
|
+
connection: slot.connectionOf('write'),
|
|
134
|
+
}))
|
|
135
|
+
.oracle('write', ($) => C.generateJson.v1({
|
|
136
|
+
context: $.prompt.context,
|
|
137
|
+
schema: ADVENTURE_ASK_SCHEMA,
|
|
138
|
+
connection: slot.connection(),
|
|
139
|
+
sampling: slot.sampling(),
|
|
140
|
+
params: slot.params(),
|
|
141
|
+
}), { expose: { status: 'Posing a question' } })
|
|
142
|
+
.task('choices', ($) => C.makeChoices.v1({
|
|
143
|
+
json: $.write.json,
|
|
144
|
+
fn: 'answer',
|
|
145
|
+
// Answer is the other spec's declaration, named on purpose:
|
|
146
|
+
// the host holds the options to THAT action's audience —
|
|
147
|
+
// the block's addressee — and runs THAT spec on a press.
|
|
148
|
+
action: `${ADVENTURE_ANSWER_SPEC_ID}#answer`,
|
|
149
|
+
cast: $.gather.cast.read.cast,
|
|
150
|
+
}))
|
|
151
|
+
.outlet('save', ($) => C.createMessage.v1({
|
|
152
|
+
narration: true,
|
|
153
|
+
text: $.choices.text,
|
|
154
|
+
blocks: $.choices.blocks,
|
|
155
|
+
}))
|
|
156
|
+
.build());
|
|
157
|
+
//# sourceMappingURL=ask.js.map
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Adventure's create pipeline: make the world (DESIGN-adventure-genre.md). The
|
|
3
|
+
* genre's turn, and the notes both share, are `respond.ts`'s.
|
|
4
|
+
*/
|
|
5
|
+
/** @internal */
|
|
6
|
+
export declare const ADVENTURE_CREATE_SPEC_ID = "core:spec/adventure-create";
|
|
7
|
+
/** @internal */
|
|
8
|
+
export declare const ADVENTURE_CREATE_VERSION = "1.0.0";
|
|
9
|
+
/**
|
|
10
|
+
* The genre's one required member: what happens when an Adventure session is
|
|
11
|
+
* created.
|
|
12
|
+
*
|
|
13
|
+
* ## Attaching the slots is writing nothing
|
|
14
|
+
*
|
|
15
|
+
* The design says creation "attaches the lorebook's world slots and each cast
|
|
16
|
+
* member's card config". Resolution already does that by READING: `valueOf`
|
|
17
|
+
* walks session → lorebook → card → declaration default, and absence means
|
|
18
|
+
* inherit. So attaching is materialising rows that say what the declaration
|
|
19
|
+
* already says, and the one thing a seed must never do is write a row nobody
|
|
20
|
+
* asked for — a stored 20 would stop tracking a card that later says 40.
|
|
21
|
+
*
|
|
22
|
+
* What makes the slots appear at all is the genre declaring them (`genreSlots`);
|
|
23
|
+
* this pipeline's job is the greetings, exactly as Chat's is.
|
|
24
|
+
*
|
|
25
|
+
* ## No opening narration, deliberately
|
|
26
|
+
*
|
|
27
|
+
* The design asks for the narrator to run once for the opening scene. It is not
|
|
28
|
+
* here, and the reason is what creating a session is: a synchronous action a
|
|
29
|
+
* person is waiting on. A model call inside it makes "New session" as slow as
|
|
30
|
+
* the slowest backend and fails the whole creation when no connection is set —
|
|
31
|
+
* on the one screen where a new user is most likely to have set none. The
|
|
32
|
+
* opening scene is `core:spec/adventure-look` instead, which is a button.
|
|
33
|
+
* @internal
|
|
34
|
+
*/
|
|
35
|
+
export declare const adventureCreateSpec: () => import("@serene-pub/sdk").SpecDocument;
|
|
36
|
+
//# sourceMappingURL=create.d.ts.map
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Adventure's create pipeline: make the world (DESIGN-adventure-genre.md). The
|
|
3
|
+
* genre's turn, and the notes both share, are `respond.ts`'s.
|
|
4
|
+
*/
|
|
5
|
+
import { compile, spec, sessionEvents } from '@serene-pub/sdk';
|
|
6
|
+
import * as C from '@serene-pub/contracts';
|
|
7
|
+
import { adventureGenre } from '../../registry/genres.js';
|
|
8
|
+
/* ── create ─────────────────────────────────────────────────────────────── */
|
|
9
|
+
/** @internal */
|
|
10
|
+
export const ADVENTURE_CREATE_SPEC_ID = 'core:spec/adventure-create';
|
|
11
|
+
/** @internal */
|
|
12
|
+
export const ADVENTURE_CREATE_VERSION = '1.0.0';
|
|
13
|
+
/**
|
|
14
|
+
* The genre's one required member: what happens when an Adventure session is
|
|
15
|
+
* created.
|
|
16
|
+
*
|
|
17
|
+
* ## Attaching the slots is writing nothing
|
|
18
|
+
*
|
|
19
|
+
* The design says creation "attaches the lorebook's world slots and each cast
|
|
20
|
+
* member's card config". Resolution already does that by READING: `valueOf`
|
|
21
|
+
* walks session → lorebook → card → declaration default, and absence means
|
|
22
|
+
* inherit. So attaching is materialising rows that say what the declaration
|
|
23
|
+
* already says, and the one thing a seed must never do is write a row nobody
|
|
24
|
+
* asked for — a stored 20 would stop tracking a card that later says 40.
|
|
25
|
+
*
|
|
26
|
+
* What makes the slots appear at all is the genre declaring them (`genreSlots`);
|
|
27
|
+
* this pipeline's job is the greetings, exactly as Chat's is.
|
|
28
|
+
*
|
|
29
|
+
* ## No opening narration, deliberately
|
|
30
|
+
*
|
|
31
|
+
* The design asks for the narrator to run once for the opening scene. It is not
|
|
32
|
+
* here, and the reason is what creating a session is: a synchronous action a
|
|
33
|
+
* person is waiting on. A model call inside it makes "New session" as slow as
|
|
34
|
+
* the slowest backend and fails the whole creation when no connection is set —
|
|
35
|
+
* on the one screen where a new user is most likely to have set none. The
|
|
36
|
+
* opening scene is `core:spec/adventure-look` instead, which is a button.
|
|
37
|
+
* @internal
|
|
38
|
+
*/
|
|
39
|
+
export const adventureCreateSpec = () => compile(spec(ADVENTURE_CREATE_SPEC_ID, {
|
|
40
|
+
version: ADVENTURE_CREATE_VERSION,
|
|
41
|
+
taxonomy: {
|
|
42
|
+
role: 'create',
|
|
43
|
+
},
|
|
44
|
+
genre: {
|
|
45
|
+
name: adventureGenre.name,
|
|
46
|
+
family: adventureGenre.family,
|
|
47
|
+
description: adventureGenre.description,
|
|
48
|
+
shape: adventureGenre.shape,
|
|
49
|
+
events: adventureGenre.events,
|
|
50
|
+
},
|
|
51
|
+
})
|
|
52
|
+
.inlet('input', C.sessionCreated.v1(), {
|
|
53
|
+
genre: adventureGenre,
|
|
54
|
+
event: sessionEvents.sessionCreated,
|
|
55
|
+
})
|
|
56
|
+
.query('collect', ($) => C.sessionGreetings.v1({ scope: $.input.sessionScope }))
|
|
57
|
+
.outlet('seed', ($) => C.seedGreetings.v1({
|
|
58
|
+
greetings: $.collect.greetings,
|
|
59
|
+
channel: adventureGenre.shape?.greeting?.channel ?? 'main',
|
|
60
|
+
}))
|
|
61
|
+
.build());
|
|
62
|
+
//# sourceMappingURL=create.js.map
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Adventure genre's pipelines, one per file: its two required pipelines
|
|
3
|
+
* (`create.ts`, `respond.ts`), its actions, and its answer form and turn order.
|
|
4
|
+
*/
|
|
5
|
+
export * from './create.js';
|
|
6
|
+
export * from './respond.js';
|
|
7
|
+
/**
|
|
8
|
+
* The Adventure genre's actions — the small pipelines a player fires from the
|
|
9
|
+
* composer (DESIGN-adventure-genre.md, "Actions").
|
|
10
|
+
*
|
|
11
|
+
* `session-action` is an OPEN event: any number of pipelines may serve it, and
|
|
12
|
+
* which ones a session offers is the preset's `actions.include`. So these are
|
|
13
|
+
* the E-series "events are all optional" made concrete — each is two or three
|
|
14
|
+
* nodes, each contributes its own button, and removing one from a preset takes
|
|
15
|
+
* the button with it and breaks nothing.
|
|
16
|
+
*
|
|
17
|
+
* ## Two shapes, three specs
|
|
18
|
+
*
|
|
19
|
+
* `adventure-look` writes a message and changes nothing. The other two change
|
|
20
|
+
* state and write no message at all, which is worth stating plainly because it
|
|
21
|
+
* looks like a bug the first time you see a run with no reply: pressing Rest
|
|
22
|
+
* produces a ledger under the last message, not a new one. A pipeline may
|
|
23
|
+
* write as often as it likes and is not obliged to write at all (F7).
|
|
24
|
+
*
|
|
25
|
+
* ## Why `adventure-inventory` is not here
|
|
26
|
+
*
|
|
27
|
+
* The design lists a fourth action: a prose inventory check with no model call.
|
|
28
|
+
* Two things say it should not be a pipeline. What somebody carries is their
|
|
29
|
+
* `inventory` stat (phase 3b), already in the state block every prompt reads,
|
|
30
|
+
* so a pipeline would only restate it. And the question it answers was the one
|
|
31
|
+
* the **Inventory widget** answered continuously, in the session, with the item
|
|
32
|
+
* prose on hover. A button that writes a worse copy of a panel already on
|
|
33
|
+
* screen is a feature competing with itself. (R79 removed that widget for now;
|
|
34
|
+
* the first reason still stands on its own, so the action stays out.)
|
|
35
|
+
*/
|
|
36
|
+
export * from './look.js';
|
|
37
|
+
export * from './rest.js';
|
|
38
|
+
export * from './advanceTime.js';
|
|
39
|
+
export * from './ask.js';
|
|
40
|
+
export * from './answer.js';
|
|
41
|
+
export * from './answerForm.js';
|
|
42
|
+
export * from './turnOrder.js';
|
|
43
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Adventure genre's pipelines, one per file: its two required pipelines
|
|
3
|
+
* (`create.ts`, `respond.ts`), its actions, and its answer form and turn order.
|
|
4
|
+
*/
|
|
5
|
+
export * from './create.js';
|
|
6
|
+
export * from './respond.js';
|
|
7
|
+
/**
|
|
8
|
+
* The Adventure genre's actions — the small pipelines a player fires from the
|
|
9
|
+
* composer (DESIGN-adventure-genre.md, "Actions").
|
|
10
|
+
*
|
|
11
|
+
* `session-action` is an OPEN event: any number of pipelines may serve it, and
|
|
12
|
+
* which ones a session offers is the preset's `actions.include`. So these are
|
|
13
|
+
* the E-series "events are all optional" made concrete — each is two or three
|
|
14
|
+
* nodes, each contributes its own button, and removing one from a preset takes
|
|
15
|
+
* the button with it and breaks nothing.
|
|
16
|
+
*
|
|
17
|
+
* ## Two shapes, three specs
|
|
18
|
+
*
|
|
19
|
+
* `adventure-look` writes a message and changes nothing. The other two change
|
|
20
|
+
* state and write no message at all, which is worth stating plainly because it
|
|
21
|
+
* looks like a bug the first time you see a run with no reply: pressing Rest
|
|
22
|
+
* produces a ledger under the last message, not a new one. A pipeline may
|
|
23
|
+
* write as often as it likes and is not obliged to write at all (F7).
|
|
24
|
+
*
|
|
25
|
+
* ## Why `adventure-inventory` is not here
|
|
26
|
+
*
|
|
27
|
+
* The design lists a fourth action: a prose inventory check with no model call.
|
|
28
|
+
* Two things say it should not be a pipeline. What somebody carries is their
|
|
29
|
+
* `inventory` stat (phase 3b), already in the state block every prompt reads,
|
|
30
|
+
* so a pipeline would only restate it. And the question it answers was the one
|
|
31
|
+
* the **Inventory widget** answered continuously, in the session, with the item
|
|
32
|
+
* prose on hover. A button that writes a worse copy of a panel already on
|
|
33
|
+
* screen is a feature competing with itself. (R79 removed that widget for now;
|
|
34
|
+
* the first reason still stands on its own, so the action stays out.)
|
|
35
|
+
*/
|
|
36
|
+
export * from './look.js';
|
|
37
|
+
export * from './rest.js';
|
|
38
|
+
export * from './advanceTime.js';
|
|
39
|
+
export * from './ask.js';
|
|
40
|
+
export * from './answer.js';
|
|
41
|
+
export * from './answerForm.js';
|
|
42
|
+
export * from './turnOrder.js';
|
|
43
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The state-keeper action Rest and Time passes share (`rest.ts`, `advanceTime.ts`).
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Rest and Advance time are one graph with two sets of instructions, and saying
|
|
6
|
+
* so in a builder is more honest than writing it twice.
|
|
7
|
+
*
|
|
8
|
+
* Both read the state, ask the keeper what changes, resolve the names it used
|
|
9
|
+
* and land the result as proposals — or as writes, when the session trusts the
|
|
10
|
+
* narrator. Neither writes a message: a clock tick is a ledger line, not a
|
|
11
|
+
* paragraph, and the narrator has its own button for the paragraph.
|
|
12
|
+
*
|
|
13
|
+
* They are separate SPECS rather than one spec with a parameter because a
|
|
14
|
+
* shipped prompt is resolved per (pool, spec): two specs is what gives Rest its
|
|
15
|
+
* own instructions and Advance time its own, in the same pool, each editable
|
|
16
|
+
* without touching the other.
|
|
17
|
+
*/
|
|
18
|
+
export declare const keeperAction: (id: string, version: string, trigger: {
|
|
19
|
+
key: string;
|
|
20
|
+
icon: string;
|
|
21
|
+
label: string;
|
|
22
|
+
description: string;
|
|
23
|
+
}) => import("@serene-pub/sdk").SpecDocument;
|
|
24
|
+
//# sourceMappingURL=keeperAction.d.ts.map
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The state-keeper action Rest and Time passes share (`rest.ts`, `advanceTime.ts`).
|
|
3
|
+
*/
|
|
4
|
+
import { compile, slot, spec, sessionEvents } from '@serene-pub/sdk';
|
|
5
|
+
import * as C from '@serene-pub/contracts';
|
|
6
|
+
import { ADVENTURE_KEEPER_SCHEMA } from './respond.js';
|
|
7
|
+
import { adventureGenre } from '../../registry/genres.js';
|
|
8
|
+
/* ── the two keeper-only actions ────────────────────────────────────────── */
|
|
9
|
+
/**
|
|
10
|
+
* Rest and Advance time are one graph with two sets of instructions, and saying
|
|
11
|
+
* so in a builder is more honest than writing it twice.
|
|
12
|
+
*
|
|
13
|
+
* Both read the state, ask the keeper what changes, resolve the names it used
|
|
14
|
+
* and land the result as proposals — or as writes, when the session trusts the
|
|
15
|
+
* narrator. Neither writes a message: a clock tick is a ledger line, not a
|
|
16
|
+
* paragraph, and the narrator has its own button for the paragraph.
|
|
17
|
+
*
|
|
18
|
+
* They are separate SPECS rather than one spec with a parameter because a
|
|
19
|
+
* shipped prompt is resolved per (pool, spec): two specs is what gives Rest its
|
|
20
|
+
* own instructions and Advance time its own, in the same pool, each editable
|
|
21
|
+
* without touching the other.
|
|
22
|
+
*/
|
|
23
|
+
export const keeperAction = (id, version, trigger) => compile(spec(id, {
|
|
24
|
+
version,
|
|
25
|
+
taxonomy: {
|
|
26
|
+
role: 'action',
|
|
27
|
+
},
|
|
28
|
+
contributes: {
|
|
29
|
+
actions: [
|
|
30
|
+
{
|
|
31
|
+
key: trigger.key,
|
|
32
|
+
venue: { kind: 'composer' },
|
|
33
|
+
quick: true,
|
|
34
|
+
icon: trigger.icon,
|
|
35
|
+
label: { en: trigger.label },
|
|
36
|
+
description: { en: trigger.description },
|
|
37
|
+
},
|
|
38
|
+
],
|
|
39
|
+
},
|
|
40
|
+
})
|
|
41
|
+
.inlet('input', C.userMessage.v1(), {
|
|
42
|
+
genre: adventureGenre,
|
|
43
|
+
event: sessionEvents.sessionAction,
|
|
44
|
+
})
|
|
45
|
+
.gather('gather', { mode: 'parallel' }, (b) => b
|
|
46
|
+
.chain('history', (c) => c.query('read', ($) => C.sessionHistory.v1({
|
|
47
|
+
scope: $.input.sessionScope,
|
|
48
|
+
params: slot.params(),
|
|
49
|
+
})))
|
|
50
|
+
.chain('cast', (c) => c.query('read', ($) => C.sessionCast.v1({ scope: $.input.sessionScope })))
|
|
51
|
+
.chain('state', (c) => c.query('read', ($) => C.sessionState.v1({ scope: $.input.sessionScope }))))
|
|
52
|
+
.task('contextBudget', ($) => C.contextBudget.v1({
|
|
53
|
+
sampling: slot.samplingOf('write'),
|
|
54
|
+
// The other half of the same pair, for the model's own
|
|
55
|
+
// window (0114) — see `respond`.
|
|
56
|
+
connection: slot.connectionOf('write'),
|
|
57
|
+
params: slot.params(),
|
|
58
|
+
}))
|
|
59
|
+
.task('context', ($) => C.buildKeeperContext.v1({
|
|
60
|
+
cast: $.gather.cast.read.cast,
|
|
61
|
+
state: $.gather.state.read.state,
|
|
62
|
+
fields: $.input.fields,
|
|
63
|
+
prompts: slot.prompts(),
|
|
64
|
+
variables: slot.variables(),
|
|
65
|
+
}))
|
|
66
|
+
/**
|
|
67
|
+
* Prose, and no turn to continue — the respond pipeline's
|
|
68
|
+
* reasoning, applied to the two actions it left behind. A step
|
|
69
|
+
* that is asking a question must not be handed a line with
|
|
70
|
+
* somebody's name on the end of it, and must not be shown the
|
|
71
|
+
* JSON an earlier turn left in the session.
|
|
72
|
+
*/
|
|
73
|
+
.task('lines', ($) => C.proseTranscript.v1({
|
|
74
|
+
messages: $.gather.history.read.messages,
|
|
75
|
+
cast: $.gather.cast.read.cast,
|
|
76
|
+
templateContext: $.context.templateContext,
|
|
77
|
+
}))
|
|
78
|
+
/**
|
|
79
|
+
* 🚧 **The transcript's files, placed** (attachments follow-ups, owner
|
|
80
|
+
* ruling 2026-10-03) — `respond`'s two steps: the files the rows show,
|
|
81
|
+
* then per line what `write` receives (an image it can read rides its
|
|
82
|
+
* own turn; otherwise its name). A transcript with no files passes
|
|
83
|
+
* through untouched, so the prompt is byte for byte what it was.
|
|
84
|
+
*/
|
|
85
|
+
.query('attachments', ($) => C.historyAttachments.v1({
|
|
86
|
+
messages: $.gather.history.read.messages,
|
|
87
|
+
params: slot.params(),
|
|
88
|
+
}))
|
|
89
|
+
.task('attached', ($) => C.placeAttachments.v1({
|
|
90
|
+
messages: $.lines.messages,
|
|
91
|
+
attachments: $.attachments.attachments,
|
|
92
|
+
connection: slot.connectionOf('write'),
|
|
93
|
+
params: slot.params(),
|
|
94
|
+
}))
|
|
95
|
+
.task('prompt', ($) => C.assemble.v2({
|
|
96
|
+
budget: $.contextBudget.available,
|
|
97
|
+
messages: $.attached.messages,
|
|
98
|
+
templateContext: $.context.templateContext,
|
|
99
|
+
template: slot.template(),
|
|
100
|
+
prompts: slot.prompts({ node: 'context' }),
|
|
101
|
+
variables: slot.variables(),
|
|
102
|
+
params: slot.params(),
|
|
103
|
+
connection: slot.connectionOf('write'),
|
|
104
|
+
}))
|
|
105
|
+
/**
|
|
106
|
+
* The keeper's own shape, asked for as a shape.
|
|
107
|
+
*
|
|
108
|
+
* ⚠ **A moved pin**: asking for a document rather than parsing one
|
|
109
|
+
* out of a prefilled reply moves both spec hashes, recorded in the
|
|
110
|
+
* app's `boot/specHashes.test.ts`. Both slugs are new in this
|
|
111
|
+
* release, which is what makes a moved pin a recorded change here
|
|
112
|
+
* rather than a break.
|
|
113
|
+
*
|
|
114
|
+
* The respond pipeline's keeper schema, deliberately: a Rest
|
|
115
|
+
* reporting in one shape and a turn reporting in another would
|
|
116
|
+
* be two vocabularies for one ledger, and the resolver reads one.
|
|
117
|
+
*/
|
|
118
|
+
.oracle('write', ($) => C.generateJson.v1({
|
|
119
|
+
context: $.prompt.context,
|
|
120
|
+
schema: ADVENTURE_KEEPER_SCHEMA,
|
|
121
|
+
connection: slot.connection(),
|
|
122
|
+
sampling: slot.sampling(),
|
|
123
|
+
params: slot.params(),
|
|
124
|
+
}), { expose: { status: 'Updating the world' } })
|
|
125
|
+
.query('resolve', ($) => C.resolveStateChanges.v1({
|
|
126
|
+
changes: $.write.items,
|
|
127
|
+
scope: $.input.sessionScope,
|
|
128
|
+
// The version this run read — see `respond`'s keeperResolve.
|
|
129
|
+
base: $.gather.state.read.version,
|
|
130
|
+
}))
|
|
131
|
+
.junction('commit', { on: ($) => $.input.fields }, (r) => r
|
|
132
|
+
.when('trusted', { path: 'trustNarrator', truthy: true }, (c) => c.task('apply', ($) => C.setState.v1({
|
|
133
|
+
changes: $.resolve.changes,
|
|
134
|
+
scope: $.input.sessionScope,
|
|
135
|
+
base: $.gather.state.read.version,
|
|
136
|
+
params: slot.params(),
|
|
137
|
+
}), { expose: { label: 'Apply the changes' } }))
|
|
138
|
+
.otherwise('reviewed', (c) => c.task('propose', ($) => C.setState.v1({
|
|
139
|
+
changes: $.resolve.changes,
|
|
140
|
+
scope: $.input.sessionScope,
|
|
141
|
+
base: $.gather.state.read.version,
|
|
142
|
+
params: slot.params(),
|
|
143
|
+
}), { expose: { label: 'Propose the changes' } })))
|
|
144
|
+
.preset('adventure', { label: 'Adventure', default: true }, (p) => p
|
|
145
|
+
// The keeper's two arms, joined into the one list
|
|
146
|
+
// the resolver takes.
|
|
147
|
+
.params('write', { path: 'values,inventory' })
|
|
148
|
+
.params('commit.trusted.apply', { mode: 'apply' }))
|
|
149
|
+
.build());
|
|
150
|
+
//# sourceMappingURL=keeperAction.js.map
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Adventure's **Look** action. The genre's actions are introduced in `index.ts`.
|
|
3
|
+
*/
|
|
4
|
+
/** @internal */
|
|
5
|
+
export declare const ADVENTURE_LOOK_SPEC_ID = "core:spec/adventure-look";
|
|
6
|
+
/**
|
|
7
|
+
* 1.0.0, edited in place (lorebooks C2, 2026-10-02): a `presences` read and an
|
|
8
|
+
* `eligible` step before `rank`. Content-addressed; `specHashes.test.ts`
|
|
9
|
+
* records the move.
|
|
10
|
+
*
|
|
11
|
+
* Edited in place again (owner ruling 2026-10-03): the context step is the
|
|
12
|
+
* SCENE builder, with the places listing — see `adventureLookSpec`.
|
|
13
|
+
*
|
|
14
|
+
* And again (history window, 2026-10-03): `contextBudget` runs before the
|
|
15
|
+
* reads and `gather.history.read` takes its `budget`, so the transcript fit,
|
|
16
|
+
* not the newest 100 rows, decides where the conversation starts.
|
|
17
|
+
* @internal
|
|
18
|
+
*/
|
|
19
|
+
export declare const ADVENTURE_LOOK_VERSION = "1.0.0";
|
|
20
|
+
/**
|
|
21
|
+
* The narrator describes where you are, from the lore and the world state, and
|
|
22
|
+
* changes nothing.
|
|
23
|
+
*
|
|
24
|
+
* It is also the opening scene: the create pipeline deliberately makes no model
|
|
25
|
+
* call, so this is the button a new Adventure session is meant to start with.
|
|
26
|
+
*
|
|
27
|
+
* **Built on the scene builder** (`core:task/build-scene-context@1`, owner
|
|
28
|
+
* ruling 2026-10-03), the context Adventure's own narrator reads, so Look is
|
|
29
|
+
* shown what the narrator is shown: `{{location}}`, the clock and the weather,
|
|
30
|
+
* the place the scene is in with its ways on (`{{locationEntry}}`) and every
|
|
31
|
+
* place the world holds (`{{knownLocations}}`), off the same `rooms` listing
|
|
32
|
+
* and the same room rule as `adventure-respond`. It was built on
|
|
33
|
+
* `build-template-context@1`, which computes no scene variables, so Look
|
|
34
|
+
* described a place it had never been shown. No `plan`: nothing is planned,
|
|
35
|
+
* so `{{beats}}` is empty and the builder anchors on the world state alone.
|
|
36
|
+
* The builder also resolves the step as nobody, so the line the model
|
|
37
|
+
* continues is the narrator's rather than the session's last speaker's.
|
|
38
|
+
*
|
|
39
|
+
* Its prompt row moved with it, from the `build-template-context` pool into
|
|
40
|
+
* the `build-scene-context` pool (migration `0111` re-keys the row in place,
|
|
41
|
+
* so a configuration pointing at it keeps pointing at it).
|
|
42
|
+
* @internal
|
|
43
|
+
*/
|
|
44
|
+
export declare const adventureLookSpec: () => import("@serene-pub/sdk").SpecDocument;
|
|
45
|
+
//# sourceMappingURL=look.d.ts.map
|