@serene-pub/core-catalog 0.6.0-pr-2 → 0.6.0-pr-5

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.
Files changed (360) hide show
  1. package/README.md +21 -1
  2. package/components/{sessions → genres/chat}/authors-note/AuthorsNote.svelte +1 -1
  3. package/components/{sessions → genres/chat}/authors-note/AuthorsNoteWidget.svelte +1 -1
  4. package/components/{sessions/world-state/WorldState.svelte → shared/actions/Actions.svelte} +5 -5
  5. package/components/shared/actions/ActionsWidget.svelte +118 -0
  6. package/components/shared/actions/actions.ts +11 -0
  7. package/components/shared/album/Album.svelte +24 -0
  8. package/components/shared/album/AlbumWidget.svelte +163 -0
  9. package/components/shared/album/album.ts +10 -0
  10. package/components/shared/annex/Annex.svelte +24 -0
  11. package/components/shared/annex/AnnexWidget.svelte +151 -0
  12. package/components/shared/annex/annex.ts +10 -0
  13. package/components/shared/attendance/Attendance.svelte +24 -0
  14. package/components/shared/attendance/AttendanceWidget.svelte +136 -0
  15. package/components/shared/attendance/attendance.ts +12 -0
  16. package/components/shared/backdrop/Backdrop.svelte +24 -0
  17. package/components/shared/backdrop/BackdropWidget.svelte +345 -0
  18. package/components/shared/backdrop/backdrop.ts +10 -0
  19. package/components/shared/chronicle/Chronicle.svelte +36 -0
  20. package/components/shared/chronicle/ChronicleWidget.svelte +569 -0
  21. package/components/shared/chronicle/chronicle.ts +11 -0
  22. package/components/{sessions → shared}/lore-entries/LoreEntries.svelte +1 -1
  23. package/components/{sessions → shared}/lore-entries/LoreEntriesWidget.svelte +3 -3
  24. package/components/shared/map-canvas/MapCanvas.svelte +171 -0
  25. package/components/shared/map-canvas/index.ts +390 -0
  26. package/components/{sessions → shared}/messages/MessageComposer.svelte +1 -1
  27. package/components/{sessions → shared}/messages/MessageControls.svelte +42 -0
  28. package/components/{sessions → shared}/messages/MessageStateLedger.svelte +19 -8
  29. package/components/{sessions → shared}/messages/Messages.svelte +1 -1
  30. package/components/{sessions → shared}/messages/MessagesWidget.svelte +126 -40
  31. package/components/{sessions → shared}/messages/NextCharacterBlock.svelte +17 -14
  32. package/components/shared/messages/SceneCueChip.svelte +82 -0
  33. package/components/shared/messages/SceneDivider.svelte +399 -0
  34. package/components/{sessions → shared}/messages/SessionComposer.svelte +33 -9
  35. package/components/shared/messages/SessionContainer.svelte +651 -0
  36. package/components/{sessions → shared}/messages/SessionMessage.svelte +52 -7
  37. package/components/shared/messages/TurnLine.svelte +254 -0
  38. package/components/{sessions → shared}/messages/conversation.svelte.ts +191 -2
  39. package/components/shared/messages/sceneMarks.ts +397 -0
  40. package/components/shared/places/Places.svelte +24 -0
  41. package/components/shared/places/PlacesWidget.svelte +290 -0
  42. package/components/shared/places/places.ts +11 -0
  43. package/components/{sessions → shared}/scene-portraits/ScenePortraits.svelte +1 -1
  44. package/components/shared/scene-portraits/ScenePortraitsWidget.svelte +404 -0
  45. package/components/{sessions → shared}/state/SlotControl.svelte +9 -1
  46. package/components/{sessions → shared}/stats/Stats.svelte +1 -1
  47. package/components/shared/stats/StatsWidget.svelte +350 -0
  48. package/components/{sessions → shared}/stats/stats.ts +3 -2
  49. package/components/shared/turn-order/TurnOrder.svelte +24 -0
  50. package/components/shared/turn-order/TurnOrderWidget.svelte +167 -0
  51. package/components/shared/turn-order/turn-order.ts +11 -0
  52. package/components/{sessions/shared → shared}/widgetRef.svelte.ts +9 -2
  53. package/components/shared/world-state/WorldState.svelte +33 -0
  54. package/components/shared/world-state/world-state.ts +10 -0
  55. package/components/tsconfig.json +2 -2
  56. package/dist/components/actions.js +294 -0
  57. package/dist/components/actions.source.json +1 -0
  58. package/dist/components/album.js +386 -0
  59. package/dist/components/album.source.json +1 -0
  60. package/dist/components/annex.js +457 -0
  61. package/dist/components/annex.source.json +1 -0
  62. package/dist/components/attendance.js +353 -0
  63. package/dist/components/attendance.source.json +1 -0
  64. package/dist/components/authors-note.js +5 -5
  65. package/dist/components/authors-note.source.json +1 -1
  66. package/dist/components/backdrop.js +561 -0
  67. package/dist/components/backdrop.source.json +1 -0
  68. package/dist/components/chronicle.js +1141 -0
  69. package/dist/components/chronicle.source.json +1 -0
  70. package/dist/components/core-ui.json +1 -1
  71. package/dist/components/lore-entries.js +5 -5
  72. package/dist/components/lore-entries.source.json +1 -1
  73. package/dist/components/messages.js +3014 -2489
  74. package/dist/components/messages.source.json +1 -1
  75. package/dist/components/places.js +1133 -0
  76. package/dist/components/places.source.json +1 -0
  77. package/dist/components/scene-portraits.js +514 -345
  78. package/dist/components/scene-portraits.source.json +1 -1
  79. package/dist/components/shared-3K7SOGH7.js +16 -0
  80. package/dist/components/shared-452PIS46.js +156 -0
  81. package/dist/components/shared-GEDAMORM.js +45 -0
  82. package/dist/components/{shared-TCQZXBE3.js → shared-GXTL5G2H.js} +4 -3
  83. package/dist/components/shared-ITSLBJB5.js +478 -0
  84. package/dist/components/shared-NK7QSVMU.js +400 -0
  85. package/dist/components/shared-TDWKI2QV.js +58 -0
  86. package/dist/components/{shared-UAQVMZZK.js → shared-XBPH6USH.js} +586 -18
  87. package/dist/components/{shared-AINANAIA.js → shared-XISPHAKY.js} +502 -98
  88. package/dist/components/stats.js +8 -208
  89. package/dist/components/stats.source.json +1 -1
  90. package/dist/components/turn-order.js +461 -0
  91. package/dist/components/turn-order.source.json +1 -0
  92. package/dist/components/world-state.js +14 -202
  93. package/dist/components/world-state.source.json +1 -1
  94. package/dist/{answerForm.d.ts → factories/answerForm.d.ts} +4 -30
  95. package/dist/{answerForm.js → factories/answerForm.js} +10 -39
  96. package/dist/factories/once.d.ts +7 -0
  97. package/dist/factories/once.js +9 -0
  98. package/dist/{turnOrder.d.ts → factories/turnOrder.d.ts} +0 -22
  99. package/dist/{turnOrder.js → factories/turnOrder.js} +4 -104
  100. package/dist/genres/adventure/advanceTime.d.ts +18 -0
  101. package/dist/genres/adventure/advanceTime.js +24 -0
  102. package/dist/genres/adventure/answer.d.ts +23 -0
  103. package/dist/genres/adventure/answer.js +59 -0
  104. package/dist/genres/adventure/answerForm.d.ts +9 -0
  105. package/dist/genres/adventure/answerForm.js +11 -0
  106. package/dist/genres/adventure/ask.d.ts +73 -0
  107. package/dist/genres/adventure/ask.js +157 -0
  108. package/dist/genres/adventure/create.d.ts +36 -0
  109. package/dist/genres/adventure/create.js +62 -0
  110. package/dist/genres/adventure/illustrateScene.d.ts +7 -0
  111. package/dist/genres/adventure/illustrateScene.js +19 -0
  112. package/dist/genres/adventure/index.d.ts +45 -0
  113. package/dist/genres/adventure/index.js +45 -0
  114. package/dist/genres/adventure/keeperAction.d.ts +43 -0
  115. package/dist/genres/adventure/keeperAction.js +217 -0
  116. package/dist/genres/adventure/look.d.ts +45 -0
  117. package/dist/genres/adventure/look.js +209 -0
  118. package/dist/{adventure.d.ts → genres/adventure/respond.d.ts} +74 -65
  119. package/dist/{adventure.js → genres/adventure/respond.js} +125 -65
  120. package/dist/genres/adventure/rest.d.ts +10 -0
  121. package/dist/genres/adventure/rest.js +16 -0
  122. package/dist/genres/adventure/summarizeScene.d.ts +7 -0
  123. package/dist/genres/adventure/summarizeScene.js +14 -0
  124. package/dist/genres/adventure/turnOrder.d.ts +10 -0
  125. package/dist/genres/adventure/turnOrder.js +27 -0
  126. package/dist/genres/chat/advanceTime.d.ts +7 -0
  127. package/dist/genres/chat/advanceTime.js +17 -0
  128. package/dist/genres/chat/answerForm.d.ts +9 -0
  129. package/dist/genres/chat/answerForm.js +11 -0
  130. package/dist/genres/chat/create.d.ts +7 -0
  131. package/dist/{createChat.js → genres/chat/create.js} +6 -6
  132. package/dist/genres/chat/generateImage.d.ts +7 -0
  133. package/dist/{generateImage.js → genres/chat/generateImage.js} +26 -22
  134. package/dist/genres/chat/illustrateScene.d.ts +8 -0
  135. package/dist/genres/chat/illustrateScene.js +19 -0
  136. package/dist/genres/chat/index.d.ts +18 -0
  137. package/dist/genres/chat/index.js +19 -0
  138. package/dist/{narrate.d.ts → genres/chat/narrate.d.ts} +3 -3
  139. package/dist/{narrate.js → genres/chat/narrate.js} +37 -12
  140. package/dist/{narrateCharacter.d.ts → genres/chat/narrateCharacter.d.ts} +2 -2
  141. package/dist/{narrateCharacter.js → genres/chat/narrateCharacter.js} +39 -17
  142. package/dist/genres/chat/respond.d.ts +25 -0
  143. package/dist/{respond.js → genres/chat/respond.js} +91 -23
  144. package/dist/genres/chat/summarizeScene.d.ts +7 -0
  145. package/dist/genres/chat/summarizeScene.js +14 -0
  146. package/dist/genres/chat/turnOrder.d.ts +9 -0
  147. package/dist/genres/chat/turnOrder.js +28 -0
  148. package/dist/{ui/sessions → genres/chat/ui}/authors-note/index.d.ts +1 -1
  149. package/dist/genres/guide/answerForm.d.ts +9 -0
  150. package/dist/genres/guide/answerForm.js +11 -0
  151. package/dist/genres/guide/create.d.ts +24 -0
  152. package/dist/genres/guide/create.js +58 -0
  153. package/dist/genres/guide/index.d.ts +10 -0
  154. package/dist/genres/guide/index.js +10 -0
  155. package/dist/{guide.d.ts → genres/guide/respond.d.ts} +1 -20
  156. package/dist/{guide.js → genres/guide/respond.js} +32 -61
  157. package/dist/genres/guide/summarizeScene.d.ts +7 -0
  158. package/dist/genres/guide/summarizeScene.js +14 -0
  159. package/dist/genres/guide/turnOrder.d.ts +10 -0
  160. package/dist/genres/guide/turnOrder.js +27 -0
  161. package/dist/genres/index.d.ts +14 -0
  162. package/dist/genres/index.js +41 -0
  163. package/dist/genres/lair/advanceTime.d.ts +7 -0
  164. package/dist/genres/lair/advanceTime.js +17 -0
  165. package/dist/genres/lair/answerForm.d.ts +17 -0
  166. package/dist/genres/lair/answerForm.js +19 -0
  167. package/dist/genres/lair/buildRoom.d.ts +64 -0
  168. package/dist/genres/lair/buildRoom.js +244 -0
  169. package/dist/genres/lair/castellanAction.d.ts +27 -0
  170. package/dist/genres/lair/castellanAction.js +177 -0
  171. package/dist/genres/lair/create.d.ts +28 -0
  172. package/dist/genres/lair/create.js +69 -0
  173. package/dist/genres/lair/fileRoom.d.ts +53 -0
  174. package/dist/genres/lair/fileRoom.js +288 -0
  175. package/dist/genres/lair/index.d.ts +62 -0
  176. package/dist/genres/lair/index.js +63 -0
  177. package/dist/genres/lair/nudge.d.ts +25 -0
  178. package/dist/genres/lair/nudge.js +78 -0
  179. package/dist/{lair.d.ts → genres/lair/respond.d.ts} +46 -59
  180. package/dist/{lair.js → genres/lair/respond.js} +55 -76
  181. package/dist/genres/lair/reveal.d.ts +10 -0
  182. package/dist/genres/lair/reveal.js +18 -0
  183. package/dist/genres/lair/roomAnswer.d.ts +86 -0
  184. package/dist/genres/lair/roomAnswer.js +378 -0
  185. package/dist/genres/lair/summarizeScene.d.ts +39 -0
  186. package/dist/genres/lair/summarizeScene.js +51 -0
  187. package/dist/genres/lair/trap.d.ts +11 -0
  188. package/dist/genres/lair/trap.js +24 -0
  189. package/dist/genres/lair/turnOrder.d.ts +9 -0
  190. package/dist/genres/lair/turnOrder.js +36 -0
  191. package/dist/genres/lair/whisper.d.ts +35 -0
  192. package/dist/genres/lair/whisper.js +90 -0
  193. package/dist/index.d.ts +52 -29
  194. package/dist/index.js +192 -86
  195. package/dist/loadouts.d.ts +37 -0
  196. package/dist/loadouts.js +105 -0
  197. package/dist/{entries.d.ts → registry/entries.d.ts} +1 -1
  198. package/dist/{genres.js → registry/genres.js} +40 -6
  199. package/dist/{ui/sessions → registry}/layouts.d.ts +41 -27
  200. package/dist/{ui/sessions → registry}/layouts.js +90 -49
  201. package/dist/{ui/sessions → registry}/widgets.d.ts +22 -0
  202. package/dist/registry/widgets.js +1294 -0
  203. package/dist/{presets.js → seed/presets.js} +28 -13
  204. package/dist/{prompts.d.ts → seed/prompts.d.ts} +10 -5
  205. package/dist/{prompts.js → seed/prompts.js} +225 -176
  206. package/dist/{annexField.d.ts → shared/annexField.d.ts} +12 -8
  207. package/dist/{annexField.js → shared/annexField.js} +16 -15
  208. package/dist/shared/builtins/branch.d.ts +8 -0
  209. package/dist/shared/builtins/branch.js +13 -0
  210. package/dist/{builtins.d.ts → shared/builtins/builtIn.d.ts} +16 -21
  211. package/dist/{builtins.js → shared/builtins/builtIn.js} +3 -37
  212. package/dist/shared/builtins/delete.d.ts +8 -0
  213. package/dist/shared/builtins/delete.js +13 -0
  214. package/dist/shared/builtins/edit.d.ts +8 -0
  215. package/dist/shared/builtins/edit.js +13 -0
  216. package/dist/shared/builtins/hide.d.ts +8 -0
  217. package/dist/shared/builtins/hide.js +13 -0
  218. package/dist/shared/builtins/index.d.ts +11 -0
  219. package/dist/shared/builtins/index.js +11 -0
  220. package/dist/shared/builtins/swipe.d.ts +8 -0
  221. package/dist/shared/builtins/swipe.js +17 -0
  222. package/dist/shared/describeLikeness.d.ts +14 -0
  223. package/dist/shared/describeLikeness.js +65 -0
  224. package/dist/shared/illustrateScene.d.ts +28 -0
  225. package/dist/shared/illustrateScene.js +181 -0
  226. package/dist/shared/portrait.d.ts +21 -0
  227. package/dist/shared/portrait.js +101 -0
  228. package/dist/shared/spriteFill.d.ts +14 -0
  229. package/dist/shared/spriteFill.js +107 -0
  230. package/dist/shared/sprites.d.ts +34 -0
  231. package/dist/shared/sprites.js +98 -0
  232. package/dist/shared/summarize/character.d.ts +9 -0
  233. package/dist/shared/summarize/character.js +10 -0
  234. package/dist/shared/summarize/history.d.ts +9 -0
  235. package/dist/shared/summarize/history.js +10 -0
  236. package/dist/shared/summarize/index.d.ts +12 -0
  237. package/dist/shared/summarize/index.js +12 -0
  238. package/dist/shared/summarize/scene.d.ts +38 -0
  239. package/dist/shared/summarize/scene.js +42 -0
  240. package/dist/shared/summarize/sceneIds.d.ts +17 -0
  241. package/dist/shared/summarize/sceneIds.js +17 -0
  242. package/dist/shared/summarize/summarizeScene.d.ts +113 -0
  243. package/dist/shared/summarize/summarizeScene.js +234 -0
  244. package/dist/shared/summarize/summarizeSpec.d.ts +54 -0
  245. package/dist/{summarize.js → shared/summarize/summarizeSpec.js} +23 -53
  246. package/dist/shared/summarize/world.d.ts +8 -0
  247. package/dist/shared/summarize/world.js +9 -0
  248. package/dist/shared/timePasses.d.ts +56 -0
  249. package/dist/shared/timePasses.js +86 -0
  250. package/dist/{toolLoop.d.ts → shared/toolLoop.d.ts} +25 -3
  251. package/dist/{toolLoop.js → shared/toolLoop.js} +70 -14
  252. package/dist/shared/ui/actions/index.d.ts +117 -0
  253. package/dist/shared/ui/actions/index.js +154 -0
  254. package/dist/shared/ui/album/index.d.ts +115 -0
  255. package/dist/shared/ui/album/index.js +178 -0
  256. package/dist/shared/ui/annex/index.d.ts +163 -0
  257. package/dist/shared/ui/annex/index.js +273 -0
  258. package/dist/shared/ui/attendance/index.d.ts +97 -0
  259. package/dist/shared/ui/attendance/index.js +89 -0
  260. package/dist/shared/ui/backdrop/index.d.ts +78 -0
  261. package/dist/shared/ui/backdrop/index.js +98 -0
  262. package/dist/shared/ui/chronicle/index.d.ts +230 -0
  263. package/dist/shared/ui/chronicle/index.js +249 -0
  264. package/dist/shared/ui/conversation/dossier.d.ts +33 -0
  265. package/dist/shared/ui/conversation/dossier.js +31 -0
  266. package/dist/{ui/sessions → shared/ui}/conversation/index.d.ts +2 -1
  267. package/dist/{ui/sessions → shared/ui}/conversation/index.js +3 -1
  268. package/dist/{ui/sessions → shared/ui}/conversation/messageVerbState.d.ts +1 -1
  269. package/dist/shared/ui/conversation/storyDays.d.ts +21 -0
  270. package/dist/shared/ui/conversation/storyDays.js +23 -0
  271. package/dist/{ui/sessions → shared/ui}/coreWidgetsEntry.d.ts +1 -1
  272. package/dist/{ui/sessions → shared/ui}/coreWidgetsEntry.js +1 -1
  273. package/dist/{ui/sessions → shared/ui}/lore-entries/index.d.ts +2 -2
  274. package/dist/shared/ui/places/index.d.ts +148 -0
  275. package/dist/shared/ui/places/index.js +249 -0
  276. package/dist/{ui/sessions → shared/ui}/scene-portraits/index.d.ts +1 -1
  277. package/dist/{ui/sessions → shared/ui}/scene-portraits/index.js +1 -1
  278. package/dist/shared/ui/scene-portraits/portraits.d.ts +191 -0
  279. package/dist/shared/ui/scene-portraits/portraits.js +223 -0
  280. package/dist/shared/ui/session-state/index.d.ts +16 -0
  281. package/dist/shared/ui/session-state/index.js +16 -0
  282. package/dist/{ui/sessions → shared/ui}/session-state/shapes.d.ts +2 -2
  283. package/dist/shared/ui/session-state/stateView.d.ts +249 -0
  284. package/dist/shared/ui/session-state/stateView.js +247 -0
  285. package/dist/shared/ui/turn-order/index.d.ts +146 -0
  286. package/dist/shared/ui/turn-order/index.js +257 -0
  287. package/dist/{ui/sessions → shared/ui}/widgetContext.d.ts +19 -10
  288. package/package.json +69 -30
  289. package/components/sessions/messages/SessionContainer.svelte +0 -459
  290. package/components/sessions/scene-portraits/ScenePortraitsWidget.svelte +0 -249
  291. package/components/sessions/stats/StatsWidget.svelte +0 -112
  292. package/components/sessions/world-state/WorldStateWidget.svelte +0 -112
  293. package/components/sessions/world-state/world-state.ts +0 -10
  294. package/dist/adventureActions.d.ts +0 -169
  295. package/dist/adventureActions.js +0 -599
  296. package/dist/createChat.d.ts +0 -7
  297. package/dist/generateImage.d.ts +0 -7
  298. package/dist/lairActions.d.ts +0 -296
  299. package/dist/lairActions.js +0 -1287
  300. package/dist/respond.d.ts +0 -24
  301. package/dist/sprites.d.ts +0 -24
  302. package/dist/sprites.js +0 -102
  303. package/dist/summarize.d.ts +0 -76
  304. package/dist/ui/sessions/conversation/dossier.d.ts +0 -328
  305. package/dist/ui/sessions/conversation/dossier.js +0 -31
  306. package/dist/ui/sessions/scene-portraits/portraits.d.ts +0 -95
  307. package/dist/ui/sessions/scene-portraits/portraits.js +0 -115
  308. package/dist/ui/sessions/session-state/index.d.ts +0 -15
  309. package/dist/ui/sessions/session-state/index.js +0 -15
  310. package/dist/ui/sessions/session-state/stateView.d.ts +0 -155
  311. package/dist/ui/sessions/session-state/stateView.js +0 -141
  312. package/dist/ui/sessions/widgets.js +0 -567
  313. package/components/{sessions → genres/chat}/authors-note/authors-note.ts +0 -0
  314. package/components/{sessions/shared → shared}/context.ts +0 -0
  315. package/components/{sessions → shared}/lore-entries/lore-entries.ts +0 -0
  316. package/components/{sessions → shared}/messages/MessageBlocksView.svelte +0 -0
  317. package/components/{sessions → shared}/messages/MessageMediaStrip.svelte +0 -0
  318. package/components/{sessions → shared}/messages/MessagePartsView.svelte +0 -0
  319. package/components/{sessions → shared}/messages/StateProposalList.svelte +0 -0
  320. package/components/{sessions → shared}/messages/mediaStrip.ts +0 -0
  321. package/components/{sessions → shared}/messages/messages.ts +0 -0
  322. package/components/{sessions → shared}/scene-portraits/StatBars.svelte +0 -0
  323. package/components/{sessions → shared}/scene-portraits/scene-portraits.ts +0 -0
  324. package/components/{sessions → shared}/state/entryFinder.ts +0 -0
  325. package/components/{sessions → shared}/state/slotWriter.svelte.ts +0 -0
  326. package/dist/components/{shared-RJDGOAVC.js → shared-FTRGUE7G.js} +78 -78
  327. /package/dist/{ui/sessions → genres/chat/ui}/authors-note/index.js +0 -0
  328. /package/dist/{entries.js → registry/entries.js} +0 -0
  329. /package/dist/{genres.d.ts → registry/genres.d.ts} +0 -0
  330. /package/dist/{slots.d.ts → registry/slots.d.ts} +0 -0
  331. /package/dist/{slots.js → registry/slots.js} +0 -0
  332. /package/dist/{statShapes.d.ts → registry/statShapes.d.ts} +0 -0
  333. /package/dist/{statShapes.js → registry/statShapes.js} +0 -0
  334. /package/dist/{guideMascotImage.d.ts → seed/guideMascotImage.d.ts} +0 -0
  335. /package/dist/{guideMascotImage.js → seed/guideMascotImage.js} +0 -0
  336. /package/dist/{presets.d.ts → seed/presets.d.ts} +0 -0
  337. /package/dist/{graphBuild.d.ts → shared/graphBuild.d.ts} +0 -0
  338. /package/dist/{graphBuild.js → shared/graphBuild.js} +0 -0
  339. /package/dist/{ui/sessions → shared/ui}/conversation/actionsDisclosure.d.ts +0 -0
  340. /package/dist/{ui/sessions → shared/ui}/conversation/actionsDisclosure.js +0 -0
  341. /package/dist/{ui/sessions → shared/ui}/conversation/composerTray.d.ts +0 -0
  342. /package/dist/{ui/sessions → shared/ui}/conversation/composerTray.js +0 -0
  343. /package/dist/{ui/sessions → shared/ui}/conversation/formAnswer.d.ts +0 -0
  344. /package/dist/{ui/sessions → shared/ui}/conversation/formAnswer.js +0 -0
  345. /package/dist/{ui/sessions → shared/ui}/conversation/itemValues.d.ts +0 -0
  346. /package/dist/{ui/sessions → shared/ui}/conversation/itemValues.js +0 -0
  347. /package/dist/{ui/sessions → shared/ui}/conversation/messageOrder.d.ts +0 -0
  348. /package/dist/{ui/sessions → shared/ui}/conversation/messageOrder.js +0 -0
  349. /package/dist/{ui/sessions → shared/ui}/conversation/messageSpeaker.d.ts +0 -0
  350. /package/dist/{ui/sessions → shared/ui}/conversation/messageSpeaker.js +0 -0
  351. /package/dist/{ui/sessions → shared/ui}/conversation/messageVerbState.js +0 -0
  352. /package/dist/{ui/sessions → shared/ui}/conversation/slashPalette.d.ts +0 -0
  353. /package/dist/{ui/sessions → shared/ui}/conversation/slashPalette.js +0 -0
  354. /package/dist/{ui/sessions → shared/ui}/conversation/text.d.ts +0 -0
  355. /package/dist/{ui/sessions → shared/ui}/conversation/text.js +0 -0
  356. /package/dist/{ui/sessions → shared/ui}/lore-entries/index.js +0 -0
  357. /package/dist/{ui/sessions → shared/ui}/session-state/barMath.d.ts +0 -0
  358. /package/dist/{ui/sessions → shared/ui}/session-state/barMath.js +0 -0
  359. /package/dist/{ui/sessions → shared/ui}/session-state/shapes.js +0 -0
  360. /package/dist/{ui/sessions → shared/ui}/widgetContext.js +0 -0
@@ -0,0 +1,288 @@
1
+ /**
2
+ * The Lair's **File as a room** action, on a message's ⋮. The genre's actions
3
+ * 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 { LAIR_CASTELLAN_KEY, SANCTUM_CHANNEL, lairGenre } from '../../registry/genres.js';
8
+ /**
9
+ * The Castellan's reference — who says a room is already filed.
10
+ *
11
+ * ⚠ **A room draft reads the book's public half and nothing else** (plan
12
+ * A28): the world-lore and history lanes, never character lore. A room entry
13
+ * is public lore — every delver's voice reads it, and so does every session
14
+ * on the book. Character lore is private whoever reads it: read with no
15
+ * speaker it is the omniscient narrator's (a background member's entries and
16
+ * every unbound one), and read as anybody it still carries the private lore
17
+ * of a persona someone plays in the session, which every voice of that
18
+ * session may read. Either way a secret keyed on the conversation could be
19
+ * drafted into a room anybody reads, so the drafts read no character lore
20
+ * at all. *Build room* reads world lore alone.
21
+ */
22
+ const CASTELLAN = `envoy:${LAIR_CASTELLAN_KEY}`;
23
+ /* ── File as a room ─────────────────────────────────────────────────────── */
24
+ /** @internal */
25
+ export const LAIR_FILE_ROOM_SPEC_ID = 'core:spec/lair-file-room';
26
+ /** @internal */
27
+ export const LAIR_FILE_ROOM_VERSION = '1.0.0';
28
+ /**
29
+ * **File as a room** — a room described in a message reaches the lorebook
30
+ * (lair re-plan R11, 2026-09-28; owner ruling 1: the Sanctum is where the map
31
+ * is laid out ahead of time, and a planned room reaches the lorebook only
32
+ * through a review-gated write).
33
+ *
34
+ * The rooms worth filing are written in prose first: the master narrates the
35
+ * party into one on `main` (the person is the narrator, F2), plans one with the
36
+ * Castellan in the Sanctum, or the Castellan narrates one when it is fired. So
37
+ * this lives on the **message** — a row's ⋮ — and acts on that row: its text is
38
+ * read by id (`session-history@1`'s `messageId`, the inlet's), never sent by
39
+ * the client.
40
+ *
41
+ * **Whose rows.** The person's and the Castellan's — any row that is not a
42
+ * character's line (`item.characterLine equals false`, the grammar's one
43
+ * condition: *the person's or the Castellan's* is exactly *not a delver's*). A
44
+ * delver naming a door is not the dungeon's plan, which is the same rule the
45
+ * room check applies to prose (`undescribed-name@1`, R7). Greyed there with
46
+ * the sentence, and refused at the door with the same one.
47
+ *
48
+ * **The name is collected** (R3's collect modal): required, because it is what
49
+ * the person can find the room by again (*Build room*'s rule), because a
50
+ * message may describe more than one room and the name says which, and
51
+ * because it is what the duplicate check runs on — before any model call, so
52
+ * a room already in the book costs nothing. It stays editable at the review
53
+ * gate, where the draft is.
54
+ *
55
+ * **Then, R9's drafted path.** A room already in the book by the SDK's name
56
+ * rule (`undescribed-name@1` over the location entries, then the whole book;
57
+ * no prose read — the row itself is prose) is not filed twice: the Castellan
58
+ * says so on the Sanctum, and nothing is written. Otherwise the Castellan
59
+ * drafts the entry from that one row in *Build room*'s layout
60
+ * (`LAIR_ROOM_CONTENT_SHAPE`, `Exits:` when the message names them) and
61
+ * `create-lore-entry`'s **review gate** holds it — even from the person's own
62
+ * row, because the row may say more than the room. Approved, it lands as a
63
+ * **location**; rejected, nothing is written.
64
+ *
65
+ * ⚠ **`effects: 'world'` in the `message` venue.** A row's ⋮ is the owner's
66
+ * side of the effects line since this action (`WORLD_ACTION_VENUES`, R11):
67
+ * the owner's own press, the row its subject. `act` stays `owner`; no block
68
+ * names it; no answer pipeline presses it.
69
+ * @internal
70
+ */
71
+ export const lairFileRoomSpec = () => compile(spec(LAIR_FILE_ROOM_SPEC_ID, {
72
+ version: LAIR_FILE_ROOM_VERSION,
73
+ taxonomy: { role: 'action' },
74
+ contributes: {
75
+ actions: [
76
+ {
77
+ key: 'file',
78
+ venue: { kind: 'message' },
79
+ icon: 'map',
80
+ /** The room's name (R3): which room, what it is found by, what the duplicate check reads. */
81
+ collects: {
82
+ text: {
83
+ need: 'required',
84
+ label: { en: 'Room name' },
85
+ placeholder: { en: 'The Sunken Vault' },
86
+ },
87
+ },
88
+ enabledWhen: [
89
+ {
90
+ on: 'item.characterLine',
91
+ equals: false,
92
+ reason: {
93
+ en: "a delver's line is theirs, not the dungeon's plan — file a room from your own lines or the Castellan's",
94
+ },
95
+ },
96
+ {
97
+ on: 'item.hidden',
98
+ equals: false,
99
+ reason: { en: 'unhide it first — a hidden message is left out of what the Castellan reads' },
100
+ },
101
+ { on: 'item.generating', equals: false, reason: { en: 'wait for the message to finish' } },
102
+ ],
103
+ /** Lorebook data: outside the story (R-15 *The line*), the owner's alone. */
104
+ effects: 'world',
105
+ audience: { see: ['participant'], act: ['owner'] },
106
+ label: { en: 'File as a room' },
107
+ description: {
108
+ en: 'Save the room this message describes to the lorebook. Name it; the Castellan drafts the entry from the message, and you edit it before it is saved.',
109
+ },
110
+ },
111
+ ],
112
+ },
113
+ })
114
+ .inlet('input', C.userMessage.v1(), {
115
+ genre: lairGenre,
116
+ event: sessionEvents.sessionAction,
117
+ })
118
+ .gather('gather', { mode: 'parallel' }, (b) => b
119
+ /** The message the press was made on — one row, by id. */
120
+ .chain('row', (c) => c.query('read', ($) => C.sessionHistory.v1({
121
+ scope: $.input.sessionScope,
122
+ messageId: $.input.messageId,
123
+ params: slot.params(),
124
+ })))
125
+ /** The book's public half — world lore and history, never character lore (see the note on `CASTELLAN`). */
126
+ .chain('worldLore', (c) => c.query('read', ($) => C.worldLore.v1({
127
+ scope: $.input.sessionScope,
128
+ params: slot.params(),
129
+ })))
130
+ .chain('historyEntries', (c) => c.query('read', ($) => C.historyEntries.v1({
131
+ scope: $.input.sessionScope,
132
+ params: slot.params({ node: 'gather.worldLore.read' }),
133
+ })))
134
+ /** The dungeon's rooms (location entries, the preset): checked first, and named to the draft. */
135
+ .chain('rooms', (c) => c.query('read', ($) => C.lorebookEntries.v1({
136
+ scope: $.input.sessionScope,
137
+ params: slot.params(),
138
+ }), { expose: { label: 'Rooms' } }))
139
+ /** The whole book, any entry type — a room is filed when ANY entry answers to its name (R7). */
140
+ .chain('lorebook', (c) => c.query('read', ($) => C.lorebookEntries.v1({
141
+ scope: $.input.sessionScope,
142
+ params: slot.params(),
143
+ })))
144
+ .chain('cast', (c) => c.query('read', ($) => C.sessionCast.v1({ scope: $.input.sessionScope })))
145
+ .chain('state', (c) => c.query('read', ($) => C.sessionState.v1({ scope: $.input.sessionScope }))))
146
+ /**
147
+ * Is the name already in the book — the SDK's name rule, entries
148
+ * only (`messages` unwired: the row being filed is prose, and would
149
+ * describe the room it describes). `undescribed` is the name,
150
+ * trimmed, when nothing answers to it.
151
+ */
152
+ .task('check', ($) => C.undescribedName.v1({
153
+ name: $.input.text,
154
+ locationEntries: $.gather.rooms.read.entries,
155
+ entries: $.gather.lorebook.read.entries,
156
+ params: slot.params(),
157
+ }))
158
+ .task('contextBudget', ($) => C.contextBudget.v1({
159
+ sampling: slot.samplingOf('room.new.write'),
160
+ connection: slot.connectionOf('room.new.write'),
161
+ params: slot.params(),
162
+ }))
163
+ .task('lore', ($) => C.concatCandidates.v1({
164
+ sources: [
165
+ $.gather.row.read.band,
166
+ $.gather.worldLore.read.main,
167
+ $.gather.historyEntries.read.main,
168
+ ],
169
+ }))
170
+ // The room `{{locationEntry}}` shows (the room rule, 2026-10-02):
171
+ // the world's location at `world.location` (the preset's `path`),
172
+ // by the one room rule; the ranker leaves it out of the lore.
173
+ .task('place', ($) => C.undescribedName.v1({
174
+ name: $.gather.state.read.state,
175
+ locationEntries: $.gather.rooms.read.entries,
176
+ params: slot.params(),
177
+ }), { expose: { label: 'The current place' } })
178
+ // Who is in the world at the session's moment (R4), for `eligible`.
179
+ .query('presences', ($) => C.castPresences.v1({ scope: $.input.sessionScope }))
180
+ // The hard gates before the ranker (C2; R2, R4): selective-logic
181
+ // exclusions from the keyword lanes, and the presence gate.
182
+ .task('eligible', ($) => C.eligibility.v1({
183
+ candidates: $.lore.candidates,
184
+ exclusions: [$.gather.worldLore.read.exclusions, $.gather.historyEntries.read.exclusions],
185
+ presences: $.presences.main,
186
+ at: $.presences.at,
187
+ }))
188
+ .task('rank', ($) => C.rankHybrid.v1({
189
+ candidates: $.eligible.candidates,
190
+ budget: $.contextBudget.available,
191
+ shownElsewhere: $.place.entryId,
192
+ params: slot.params(),
193
+ }))
194
+ /**
195
+ * 🚧 **The files those rows show** (attachments follow-ups, owner
196
+ * ruling 2026-10-03), read once on the spine; the drafting arm below
197
+ * places them for `room.new.write` — an image it can read rides its own
198
+ * turn, otherwise its name. No files, and the arm's prompt is byte for
199
+ * byte what it was.
200
+ */
201
+ .query('attachments', ($) => C.historyAttachments.v1({
202
+ messages: $.gather.row.read.messages,
203
+ params: slot.params(),
204
+ }))
205
+ .junction('room', { on: ($) => $.check.undescribed }, (r) => r
206
+ /**
207
+ * Not in the book: the Castellan drafts it from the row, in
208
+ * the dungeon's layout, and the master edits it at the gate.
209
+ * The name is the one typed (trimmed); the other rooms are
210
+ * named to the draft so its exits can point at them.
211
+ */
212
+ .when('new', { truthy: true }, (c) => c
213
+ .task('context', ($) => C.buildTemplateContext.v1({
214
+ cast: $.gather.cast.read.cast,
215
+ state: $.gather.state.read.state,
216
+ locationEntries: $.gather.rooms.read.entries,
217
+ turnDirection: $.check.undescribed,
218
+ prompts: slot.prompts(),
219
+ variables: slot.variables(),
220
+ }))
221
+ /** The one row, as prose: the draft is written from it and nothing else said. */
222
+ .task('lines', ($) => C.proseTranscript.v1({
223
+ messages: $.gather.row.read.messages,
224
+ cast: $.gather.cast.read.cast,
225
+ templateContext: $.room.new.context.templateContext,
226
+ }))
227
+ .task('attached', ($) => C.placeAttachments.v1({
228
+ messages: $.room.new.lines.messages,
229
+ attachments: $.attachments.attachments,
230
+ connection: slot.connectionOf('room.new.write'),
231
+ params: slot.params(),
232
+ }))
233
+ .task('prompt', ($) => C.assemble.v2({
234
+ candidates: $.rank.candidates,
235
+ decisions: $.rank.decisions,
236
+ groups: $.rank.groups,
237
+ budget: $.contextBudget.available,
238
+ messages: $.room.new.attached.messages,
239
+ templateContext: $.room.new.context.templateContext,
240
+ template: slot.template(),
241
+ prompts: slot.prompts({ node: 'room.new.context' }),
242
+ variables: slot.variables(),
243
+ params: slot.params(),
244
+ connection: slot.connectionOf('room.new.write'),
245
+ }))
246
+ .oracle('write', ($) => C.generateText.v1({
247
+ context: $.room.new.prompt.context,
248
+ connection: slot.connection(),
249
+ sampling: slot.sampling(),
250
+ params: slot.params(),
251
+ }), { expose: { status: 'The Castellan drafts the room' } })
252
+ .outlet('save', ($) => C.createLoreEntry.v1({
253
+ name: $.check.undescribed,
254
+ content: $.room.new.write.text,
255
+ params: slot.params(),
256
+ })))
257
+ /**
258
+ * Already in the book: nothing is filed twice. The Castellan
259
+ * says so at its own table — a plain line, no model call —
260
+ * so the press is answered rather than silent.
261
+ */
262
+ .otherwise('exists', (c) => c
263
+ .task('note', ($) => C.joinText.v1({
264
+ items: [
265
+ $.input.text,
266
+ 'is already in the lorebook, so nothing new was filed. Edit that entry to change it.',
267
+ ],
268
+ params: slot.params(),
269
+ }))
270
+ .outlet('said', ($) => C.createMessage.v1({
271
+ text: $.room.exists.note.text,
272
+ speaker: CASTELLAN,
273
+ channel: SANCTUM_CHANNEL,
274
+ }))))
275
+ /**
276
+ * ⚠ **The gate is the point** — `resolvePosition` defaults an
277
+ * undeclared review position to `off`, so without this line the
278
+ * draft would land unseen. A room is a place (L3).
279
+ */
280
+ .preset('lair', { label: 'Lair', default: true }, (p) => p
281
+ .settings('room.new.save', { review: 'on' })
282
+ .params('room.new.save', { entryType: 'core:entry/location' })
283
+ .params('gather.rooms.read', { entryTypes: ['core:entry/location'] })
284
+ .params('room.exists.note', { path: '', separator: ' ' })
285
+ // The room the place slot shows (the room rule).
286
+ .params('place', { path: 'world.location' }))
287
+ .build());
288
+ //# sourceMappingURL=fileRoom.js.map
@@ -0,0 +1,62 @@
1
+ /**
2
+ * The Lair 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 **Lair** genre's actions — what the dungeon's master does between turns
9
+ * (plans/genres-and-showcase-plugins §3, "Room building").
10
+ *
11
+ * `session-action` is an OPEN event, so each of these is its own small
12
+ * pipeline contributing its own button, and removing one from a preset takes
13
+ * the button with it and breaks nothing. Three shapes:
14
+ *
15
+ * - **Build room**, **Answer the door** and **File as a room** write a
16
+ * *lorebook entry*. They are the three actions here that reach outside the
17
+ * story, so they are the three declared `effects: 'world'` — owner-only,
18
+ * and never named by a block. *File as a room* lives on a message's ⋮ (the
19
+ * row it files is its subject, R11); the other two live in the composer
20
+ * and are nameable only by a message block **addressed to the owner**
21
+ * (R-15 *The line*; L1, ruled 2026-09-17). The knock's block is exactly
22
+ * that block, which is what makes its options real writes rather than
23
+ * narration.
24
+ * - **Whisper** and **Nudge** write *state* and no message: a standing
25
+ * instruction for the delvers the master picks (R10), and one for the
26
+ * Castellan. Neither calls a model. Pressing Nudge
27
+ * produces nothing visible in the log, which looks like a bug the first
28
+ * time you see it and is the same thing Adventure's Rest does.
29
+ * - **Trigger trap** and **Reveal** write a *message* and change nothing:
30
+ * the Castellan's turns with a fixed instruction, Adventure's Look with a
31
+ * different sentence in its prompt — one streamed row under the
32
+ * Castellan's name (lair pass B17, owner D7a; R8).
33
+ *
34
+ * ## Why the two steering actions write slots rather than messages
35
+ *
36
+ * A directive that produces no message still has to reach the next turn, and a
37
+ * session has exactly three places a fact can live: the transcript, the
38
+ * lorebook and the state. A nudge is not a line anybody said and not a fact
39
+ * about the world, so it is state — `core:slot/direction@1` for the Castellan,
40
+ * `core:slot/whisper@1` per delver — and the planner and the voices already
41
+ * take `state` on a port, which makes the note a control something *reads*
42
+ * rather than a second store nothing walks. (The planner reads the direction;
43
+ * a whisper is heard by its holder's voice alone — earshot, R1.)
44
+ *
45
+ * ⚠ **The channel route was the other candidate and does not work.** A hidden
46
+ * message on a `whispers` channel is one node to write and unreadable
47
+ * afterwards: `core:query/session-history@1` reads exactly one channel, and no
48
+ * core node merges two transcripts into the one `messages` port `assemble`
49
+ * takes. It would have been a button wired to nothing.
50
+ */
51
+ export * from './buildRoom.js';
52
+ export * from './roomAnswer.js';
53
+ export * from './fileRoom.js';
54
+ export * from './nudge.js';
55
+ export * from './whisper.js';
56
+ export * from './trap.js';
57
+ export * from './reveal.js';
58
+ export * from './advanceTime.js';
59
+ export * from './answerForm.js';
60
+ export * from './turnOrder.js';
61
+ export * from './summarizeScene.js';
62
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,63 @@
1
+ /**
2
+ * The Lair 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 **Lair** genre's actions — what the dungeon's master does between turns
9
+ * (plans/genres-and-showcase-plugins §3, "Room building").
10
+ *
11
+ * `session-action` is an OPEN event, so each of these is its own small
12
+ * pipeline contributing its own button, and removing one from a preset takes
13
+ * the button with it and breaks nothing. Three shapes:
14
+ *
15
+ * - **Build room**, **Answer the door** and **File as a room** write a
16
+ * *lorebook entry*. They are the three actions here that reach outside the
17
+ * story, so they are the three declared `effects: 'world'` — owner-only,
18
+ * and never named by a block. *File as a room* lives on a message's ⋮ (the
19
+ * row it files is its subject, R11); the other two live in the composer
20
+ * and are nameable only by a message block **addressed to the owner**
21
+ * (R-15 *The line*; L1, ruled 2026-09-17). The knock's block is exactly
22
+ * that block, which is what makes its options real writes rather than
23
+ * narration.
24
+ * - **Whisper** and **Nudge** write *state* and no message: a standing
25
+ * instruction for the delvers the master picks (R10), and one for the
26
+ * Castellan. Neither calls a model. Pressing Nudge
27
+ * produces nothing visible in the log, which looks like a bug the first
28
+ * time you see it and is the same thing Adventure's Rest does.
29
+ * - **Trigger trap** and **Reveal** write a *message* and change nothing:
30
+ * the Castellan's turns with a fixed instruction, Adventure's Look with a
31
+ * different sentence in its prompt — one streamed row under the
32
+ * Castellan's name (lair pass B17, owner D7a; R8).
33
+ *
34
+ * ## Why the two steering actions write slots rather than messages
35
+ *
36
+ * A directive that produces no message still has to reach the next turn, and a
37
+ * session has exactly three places a fact can live: the transcript, the
38
+ * lorebook and the state. A nudge is not a line anybody said and not a fact
39
+ * about the world, so it is state — `core:slot/direction@1` for the Castellan,
40
+ * `core:slot/whisper@1` per delver — and the planner and the voices already
41
+ * take `state` on a port, which makes the note a control something *reads*
42
+ * rather than a second store nothing walks. (The planner reads the direction;
43
+ * a whisper is heard by its holder's voice alone — earshot, R1.)
44
+ *
45
+ * ⚠ **The channel route was the other candidate and does not work.** A hidden
46
+ * message on a `whispers` channel is one node to write and unreadable
47
+ * afterwards: `core:query/session-history@1` reads exactly one channel, and no
48
+ * core node merges two transcripts into the one `messages` port `assemble`
49
+ * takes. It would have been a button wired to nothing.
50
+ */
51
+ export * from './buildRoom.js';
52
+ export * from './roomAnswer.js';
53
+ export * from './fileRoom.js';
54
+ export * from './nudge.js';
55
+ export * from './whisper.js';
56
+ export * from './trap.js';
57
+ export * from './reveal.js';
58
+ // 🚧 Time passes… (live scenes §6): the graph is `shared/timePasses.ts`.
59
+ export * from './advanceTime.js';
60
+ export * from './answerForm.js';
61
+ export * from './turnOrder.js';
62
+ export * from './summarizeScene.js';
63
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,25 @@
1
+ /**
2
+ * The Lair's **Nudge** action. The genre's actions are introduced in `index.ts`.
3
+ */
4
+ /** @internal */
5
+ export declare const LAIR_NUDGE_SPEC_ID = "core:spec/lair-nudge";
6
+ /** @internal */
7
+ export declare const LAIR_NUDGE_VERSION = "1.0.0";
8
+ /**
9
+ * **Nudge**: a directive to the Castellan's planner that produces no message.
10
+ *
11
+ * The shortest pipeline in the catalog that does anything: no model call, no
12
+ * retrieval, no transcript. The collected text (R3) becomes
13
+ * `core:slot/direction@1` on the world, the planner takes `state` on its own
14
+ * port, and the note is in the next turn's prompt.
15
+ *
16
+ * ⚠ **`apply`, not `propose`** — the one place in this genre where a state
17
+ * write skips the review the state-keeper's changes get. The argument for
18
+ * `propose` is that a *model* is not authoritative about the fiction
19
+ * (`set-state`'s own header). Here the writer is the person who owns the
20
+ * session, typing into their own composer, and asking them to accept their own
21
+ * instruction would be a dialog asking "did you mean what you just typed".
22
+ * @internal
23
+ */
24
+ export declare const lairNudgeSpec: () => import("@serene-pub/sdk").SpecDocument;
25
+ //# sourceMappingURL=nudge.d.ts.map
@@ -0,0 +1,78 @@
1
+ /**
2
+ * The Lair's **Nudge** action. The genre's actions are introduced in `index.ts`.
3
+ */
4
+ import { compile, slot, spec, sessionEvents } from '@serene-pub/sdk';
5
+ import * as C from '@serene-pub/contracts';
6
+ import { lairGenre } from '../../registry/genres.js';
7
+ /* ── The two steering actions that write state ──────────────────────────── */
8
+ /** @internal */
9
+ export const LAIR_NUDGE_SPEC_ID = 'core:spec/lair-nudge';
10
+ /** @internal */
11
+ export const LAIR_NUDGE_VERSION = '1.0.0';
12
+ /**
13
+ * **Nudge**: a directive to the Castellan's planner that produces no message.
14
+ *
15
+ * The shortest pipeline in the catalog that does anything: no model call, no
16
+ * retrieval, no transcript. The collected text (R3) becomes
17
+ * `core:slot/direction@1` on the world, the planner takes `state` on its own
18
+ * port, and the note is in the next turn's prompt.
19
+ *
20
+ * ⚠ **`apply`, not `propose`** — the one place in this genre where a state
21
+ * write skips the review the state-keeper's changes get. The argument for
22
+ * `propose` is that a *model* is not authoritative about the fiction
23
+ * (`set-state`'s own header). Here the writer is the person who owns the
24
+ * session, typing into their own composer, and asking them to accept their own
25
+ * instruction would be a dialog asking "did you mean what you just typed".
26
+ * @internal
27
+ */
28
+ export const lairNudgeSpec = () => compile(spec(LAIR_NUDGE_SPEC_ID, {
29
+ version: LAIR_NUDGE_VERSION,
30
+ taxonomy: { role: 'action' },
31
+ contributes: {
32
+ actions: [
33
+ {
34
+ key: 'nudge',
35
+ venue: { kind: 'composer' },
36
+ quick: true,
37
+ icon: 'compass',
38
+ /** The direction is the whole instruction (R3): nothing to do without it. */
39
+ collects: {
40
+ text: { need: 'required', label: { en: 'Direction the party should feel' } },
41
+ },
42
+ label: { en: 'Nudge' },
43
+ description: {
44
+ en: 'Tell the Castellan what you want next. It writes no message — the next turn just follows it.',
45
+ },
46
+ },
47
+ ],
48
+ },
49
+ })
50
+ .inlet('input', C.userMessage.v1(), {
51
+ genre: lairGenre,
52
+ event: sessionEvents.sessionAction,
53
+ })
54
+ .query('state', ($) => C.sessionState.v1({ scope: $.input.sessionScope }))
55
+ /**
56
+ * A literal change with the collected text in it. A nested literal
57
+ * is how one port takes a reference (`concat-candidates`' `sources`
58
+ * is the same construction), and this node is here rather than
59
+ * `set-state` alone because it is what turns the word `world` into
60
+ * a row and `direction` into `core:slot/direction@1` — and what
61
+ * refuses a note longer than the slot accepts, with a sentence.
62
+ */
63
+ .query('resolve', ($) => C.resolveStateChanges.v1({
64
+ changes: [
65
+ { owner: 'world', slot: 'direction', value: $.input.text },
66
+ ],
67
+ scope: $.input.sessionScope,
68
+ base: $.state.version,
69
+ }))
70
+ .task('apply', ($) => C.setState.v1({
71
+ changes: $.resolve.changes,
72
+ scope: $.input.sessionScope,
73
+ base: $.state.version,
74
+ params: slot.params(),
75
+ }))
76
+ .preset('lair', { label: 'Lair', default: true }, (p) => p.params('apply', { mode: 'apply' }))
77
+ .build());
78
+ //# sourceMappingURL=nudge.js.map