@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.
- 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/world-state/WorldState.svelte → shared/actions/Actions.svelte} +5 -5
- package/components/shared/actions/ActionsWidget.svelte +118 -0
- package/components/shared/actions/actions.ts +11 -0
- package/components/shared/album/Album.svelte +24 -0
- package/components/shared/album/AlbumWidget.svelte +163 -0
- package/components/shared/album/album.ts +10 -0
- package/components/shared/annex/Annex.svelte +24 -0
- package/components/shared/annex/AnnexWidget.svelte +151 -0
- package/components/shared/annex/annex.ts +10 -0
- package/components/shared/attendance/Attendance.svelte +24 -0
- package/components/shared/attendance/AttendanceWidget.svelte +136 -0
- package/components/shared/attendance/attendance.ts +12 -0
- package/components/shared/backdrop/Backdrop.svelte +24 -0
- package/components/shared/backdrop/BackdropWidget.svelte +345 -0
- package/components/shared/backdrop/backdrop.ts +10 -0
- package/components/shared/chronicle/Chronicle.svelte +36 -0
- package/components/shared/chronicle/ChronicleWidget.svelte +569 -0
- package/components/shared/chronicle/chronicle.ts +11 -0
- package/components/{sessions → shared}/lore-entries/LoreEntries.svelte +1 -1
- package/components/{sessions → shared}/lore-entries/LoreEntriesWidget.svelte +3 -3
- package/components/shared/map-canvas/MapCanvas.svelte +171 -0
- package/components/shared/map-canvas/index.ts +390 -0
- package/components/{sessions → shared}/messages/MessageComposer.svelte +1 -1
- package/components/{sessions → shared}/messages/MessageControls.svelte +42 -0
- package/components/{sessions → shared}/messages/MessageStateLedger.svelte +19 -8
- package/components/{sessions → shared}/messages/Messages.svelte +1 -1
- package/components/{sessions → shared}/messages/MessagesWidget.svelte +126 -40
- package/components/{sessions → shared}/messages/NextCharacterBlock.svelte +17 -14
- package/components/shared/messages/SceneCueChip.svelte +82 -0
- package/components/shared/messages/SceneDivider.svelte +399 -0
- package/components/{sessions → shared}/messages/SessionComposer.svelte +33 -9
- package/components/shared/messages/SessionContainer.svelte +651 -0
- package/components/{sessions → shared}/messages/SessionMessage.svelte +52 -7
- package/components/shared/messages/TurnLine.svelte +254 -0
- package/components/{sessions → shared}/messages/conversation.svelte.ts +191 -2
- package/components/shared/messages/sceneMarks.ts +397 -0
- package/components/shared/places/Places.svelte +24 -0
- package/components/shared/places/PlacesWidget.svelte +290 -0
- package/components/shared/places/places.ts +11 -0
- package/components/{sessions → shared}/scene-portraits/ScenePortraits.svelte +1 -1
- package/components/shared/scene-portraits/ScenePortraitsWidget.svelte +404 -0
- package/components/{sessions → shared}/state/SlotControl.svelte +9 -1
- package/components/{sessions → shared}/stats/Stats.svelte +1 -1
- package/components/shared/stats/StatsWidget.svelte +350 -0
- package/components/{sessions → shared}/stats/stats.ts +3 -2
- package/components/shared/turn-order/TurnOrder.svelte +24 -0
- package/components/shared/turn-order/TurnOrderWidget.svelte +167 -0
- package/components/shared/turn-order/turn-order.ts +11 -0
- package/components/{sessions/shared → shared}/widgetRef.svelte.ts +9 -2
- package/components/shared/world-state/WorldState.svelte +33 -0
- package/components/shared/world-state/world-state.ts +10 -0
- package/components/tsconfig.json +2 -2
- package/dist/components/actions.js +294 -0
- package/dist/components/actions.source.json +1 -0
- package/dist/components/album.js +386 -0
- package/dist/components/album.source.json +1 -0
- package/dist/components/annex.js +457 -0
- package/dist/components/annex.source.json +1 -0
- package/dist/components/attendance.js +353 -0
- package/dist/components/attendance.source.json +1 -0
- package/dist/components/authors-note.js +5 -5
- package/dist/components/authors-note.source.json +1 -1
- package/dist/components/backdrop.js +561 -0
- package/dist/components/backdrop.source.json +1 -0
- package/dist/components/chronicle.js +1141 -0
- package/dist/components/chronicle.source.json +1 -0
- 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 +3014 -2489
- package/dist/components/messages.source.json +1 -1
- package/dist/components/places.js +1133 -0
- package/dist/components/places.source.json +1 -0
- package/dist/components/scene-portraits.js +514 -345
- package/dist/components/scene-portraits.source.json +1 -1
- package/dist/components/shared-3K7SOGH7.js +16 -0
- package/dist/components/shared-452PIS46.js +156 -0
- package/dist/components/shared-GEDAMORM.js +45 -0
- package/dist/components/{shared-TCQZXBE3.js → shared-GXTL5G2H.js} +4 -3
- package/dist/components/shared-ITSLBJB5.js +478 -0
- package/dist/components/shared-NK7QSVMU.js +400 -0
- package/dist/components/shared-TDWKI2QV.js +58 -0
- package/dist/components/{shared-UAQVMZZK.js → shared-XBPH6USH.js} +586 -18
- package/dist/components/{shared-AINANAIA.js → shared-XISPHAKY.js} +502 -98
- package/dist/components/stats.js +8 -208
- package/dist/components/stats.source.json +1 -1
- package/dist/components/turn-order.js +461 -0
- package/dist/components/turn-order.source.json +1 -0
- package/dist/components/world-state.js +14 -202
- 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} +10 -39
- 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 +18 -0
- package/dist/genres/adventure/advanceTime.js +24 -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/illustrateScene.d.ts +7 -0
- package/dist/genres/adventure/illustrateScene.js +19 -0
- package/dist/genres/adventure/index.d.ts +45 -0
- package/dist/genres/adventure/index.js +45 -0
- package/dist/genres/adventure/keeperAction.d.ts +43 -0
- package/dist/genres/adventure/keeperAction.js +217 -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} +74 -65
- package/dist/{adventure.js → genres/adventure/respond.js} +125 -65
- package/dist/genres/adventure/rest.d.ts +10 -0
- package/dist/genres/adventure/rest.js +16 -0
- package/dist/genres/adventure/summarizeScene.d.ts +7 -0
- package/dist/genres/adventure/summarizeScene.js +14 -0
- package/dist/genres/adventure/turnOrder.d.ts +10 -0
- package/dist/genres/adventure/turnOrder.js +27 -0
- package/dist/genres/chat/advanceTime.d.ts +7 -0
- package/dist/genres/chat/advanceTime.js +17 -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} +26 -22
- package/dist/genres/chat/illustrateScene.d.ts +8 -0
- package/dist/genres/chat/illustrateScene.js +19 -0
- package/dist/genres/chat/index.d.ts +18 -0
- package/dist/genres/chat/index.js +19 -0
- package/dist/{narrate.d.ts → genres/chat/narrate.d.ts} +3 -3
- package/dist/{narrate.js → genres/chat/narrate.js} +37 -12
- package/dist/{narrateCharacter.d.ts → genres/chat/narrateCharacter.d.ts} +2 -2
- package/dist/{narrateCharacter.js → genres/chat/narrateCharacter.js} +39 -17
- package/dist/genres/chat/respond.d.ts +25 -0
- package/dist/{respond.js → genres/chat/respond.js} +91 -23
- package/dist/genres/chat/summarizeScene.d.ts +7 -0
- package/dist/genres/chat/summarizeScene.js +14 -0
- 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 +10 -0
- package/dist/genres/guide/index.js +10 -0
- package/dist/{guide.d.ts → genres/guide/respond.d.ts} +1 -20
- package/dist/{guide.js → genres/guide/respond.js} +32 -61
- package/dist/genres/guide/summarizeScene.d.ts +7 -0
- package/dist/genres/guide/summarizeScene.js +14 -0
- 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/advanceTime.d.ts +7 -0
- package/dist/genres/lair/advanceTime.js +17 -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 +62 -0
- package/dist/genres/lair/index.js +63 -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} +46 -59
- package/dist/{lair.js → genres/lair/respond.js} +55 -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/summarizeScene.d.ts +39 -0
- package/dist/genres/lair/summarizeScene.js +51 -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 +52 -29
- package/dist/index.js +192 -86
- package/dist/loadouts.d.ts +37 -0
- package/dist/loadouts.js +105 -0
- package/dist/{entries.d.ts → registry/entries.d.ts} +1 -1
- package/dist/{genres.js → registry/genres.js} +40 -6
- package/dist/{ui/sessions → registry}/layouts.d.ts +41 -27
- package/dist/{ui/sessions → registry}/layouts.js +90 -49
- package/dist/{ui/sessions → registry}/widgets.d.ts +22 -0
- package/dist/registry/widgets.js +1294 -0
- package/dist/{presets.js → seed/presets.js} +28 -13
- package/dist/{prompts.d.ts → seed/prompts.d.ts} +10 -5
- package/dist/{prompts.js → seed/prompts.js} +225 -176
- package/dist/{annexField.d.ts → shared/annexField.d.ts} +12 -8
- package/dist/{annexField.js → shared/annexField.js} +16 -15
- 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/describeLikeness.d.ts +14 -0
- package/dist/shared/describeLikeness.js +65 -0
- package/dist/shared/illustrateScene.d.ts +28 -0
- package/dist/shared/illustrateScene.js +181 -0
- package/dist/shared/portrait.d.ts +21 -0
- package/dist/shared/portrait.js +101 -0
- package/dist/shared/spriteFill.d.ts +14 -0
- package/dist/shared/spriteFill.js +107 -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 +12 -0
- package/dist/shared/summarize/index.js +12 -0
- package/dist/shared/summarize/scene.d.ts +38 -0
- package/dist/shared/summarize/scene.js +42 -0
- package/dist/shared/summarize/sceneIds.d.ts +17 -0
- package/dist/shared/summarize/sceneIds.js +17 -0
- package/dist/shared/summarize/summarizeScene.d.ts +113 -0
- package/dist/shared/summarize/summarizeScene.js +234 -0
- package/dist/shared/summarize/summarizeSpec.d.ts +54 -0
- package/dist/{summarize.js → shared/summarize/summarizeSpec.js} +23 -53
- package/dist/shared/summarize/world.d.ts +8 -0
- package/dist/shared/summarize/world.js +9 -0
- package/dist/shared/timePasses.d.ts +56 -0
- package/dist/shared/timePasses.js +86 -0
- package/dist/{toolLoop.d.ts → shared/toolLoop.d.ts} +25 -3
- package/dist/{toolLoop.js → shared/toolLoop.js} +70 -14
- package/dist/shared/ui/actions/index.d.ts +117 -0
- package/dist/shared/ui/actions/index.js +154 -0
- package/dist/shared/ui/album/index.d.ts +115 -0
- package/dist/shared/ui/album/index.js +178 -0
- package/dist/shared/ui/annex/index.d.ts +163 -0
- package/dist/shared/ui/annex/index.js +273 -0
- package/dist/shared/ui/attendance/index.d.ts +97 -0
- package/dist/shared/ui/attendance/index.js +89 -0
- package/dist/shared/ui/backdrop/index.d.ts +78 -0
- package/dist/shared/ui/backdrop/index.js +98 -0
- package/dist/shared/ui/chronicle/index.d.ts +230 -0
- package/dist/shared/ui/chronicle/index.js +249 -0
- package/dist/shared/ui/conversation/dossier.d.ts +33 -0
- package/dist/shared/ui/conversation/dossier.js +31 -0
- package/dist/{ui/sessions → shared/ui}/conversation/index.d.ts +2 -1
- package/dist/{ui/sessions → shared/ui}/conversation/index.js +3 -1
- package/dist/{ui/sessions → shared/ui}/conversation/messageVerbState.d.ts +1 -1
- package/dist/shared/ui/conversation/storyDays.d.ts +21 -0
- package/dist/shared/ui/conversation/storyDays.js +23 -0
- 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 +2 -2
- package/dist/shared/ui/places/index.d.ts +148 -0
- package/dist/shared/ui/places/index.js +249 -0
- 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/shared/ui/scene-portraits/portraits.d.ts +191 -0
- package/dist/shared/ui/scene-portraits/portraits.js +223 -0
- package/dist/shared/ui/session-state/index.d.ts +16 -0
- package/dist/shared/ui/session-state/index.js +16 -0
- package/dist/{ui/sessions → shared/ui}/session-state/shapes.d.ts +2 -2
- package/dist/shared/ui/session-state/stateView.d.ts +249 -0
- package/dist/shared/ui/session-state/stateView.js +247 -0
- package/dist/shared/ui/turn-order/index.d.ts +146 -0
- package/dist/shared/ui/turn-order/index.js +257 -0
- package/dist/{ui/sessions → shared/ui}/widgetContext.d.ts +19 -10
- package/package.json +69 -30
- package/components/sessions/messages/SessionContainer.svelte +0 -459
- package/components/sessions/scene-portraits/ScenePortraitsWidget.svelte +0 -249
- package/components/sessions/stats/StatsWidget.svelte +0 -112
- package/components/sessions/world-state/WorldStateWidget.svelte +0 -112
- package/components/sessions/world-state/world-state.ts +0 -10
- 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/dist/ui/sessions/conversation/dossier.d.ts +0 -328
- package/dist/ui/sessions/conversation/dossier.js +0 -31
- package/dist/ui/sessions/scene-portraits/portraits.d.ts +0 -95
- package/dist/ui/sessions/scene-portraits/portraits.js +0 -115
- package/dist/ui/sessions/session-state/index.d.ts +0 -15
- package/dist/ui/sessions/session-state/index.js +0 -15
- package/dist/ui/sessions/session-state/stateView.d.ts +0 -155
- package/dist/ui/sessions/session-state/stateView.js +0 -141
- package/dist/ui/sessions/widgets.js +0 -567
- 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/MessageMediaStrip.svelte +0 -0
- package/components/{sessions → shared}/messages/MessagePartsView.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/entryFinder.ts +0 -0
- package/components/{sessions → shared}/state/slotWriter.svelte.ts +0 -0
- package/dist/components/{shared-RJDGOAVC.js → shared-FTRGUE7G.js} +78 -78
- /package/dist/{ui/sessions → genres/chat/ui}/authors-note/index.js +0 -0
- /package/dist/{entries.js → registry/entries.js} +0 -0
- /package/dist/{genres.d.ts → registry/genres.d.ts} +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/{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/{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/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.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}/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.js +0 -0
- /package/dist/{ui/sessions → shared/ui}/widgetContext.js +0 -0
|
@@ -9,8 +9,13 @@
|
|
|
9
9
|
* with a bigger prompt and more tools, and "read the reference pipeline" is a
|
|
10
10
|
* better answer than a paragraph describing one. And it is what the
|
|
11
11
|
* integration suite runs — the loop block, the three tool nodes and the carry
|
|
12
|
-
* all exercised end to end against a
|
|
13
|
-
*
|
|
12
|
+
* all exercised end to end against a database, rather than asserted about in
|
|
13
|
+
* isolation where a wiring mistake cannot show.
|
|
14
|
+
*
|
|
15
|
+
* **Not a seeded pipeline** (ruled 2026-10-05): it left `CORE_SPECS`, so no
|
|
16
|
+
* install publishes it. It stays exported as an example and a test fixture; a
|
|
17
|
+
* test that runs it publishes `toolLoopSpec()` and seeds `TOOL_LOOP_PROMPT`
|
|
18
|
+
* itself.
|
|
14
19
|
*
|
|
15
20
|
* **Deliberately bound to no genre.** It declares no `genre` in its taxonomy
|
|
16
21
|
* and no lock on its input, so it is not offered on Chat sessions and does not
|
|
@@ -46,10 +51,14 @@
|
|
|
46
51
|
* would be N writes, which `validate.ts` refuses (F7), and correctly.
|
|
47
52
|
*/
|
|
48
53
|
import { compile, handlebars, slot, spec } from '@serene-pub/sdk';
|
|
54
|
+
import { CORE_LOADOUT } from '../loadouts.js';
|
|
49
55
|
import * as C from '@serene-pub/contracts';
|
|
50
|
-
import { withSpriteTail } from './sprites.js';
|
|
51
56
|
/** @experimental */
|
|
52
57
|
export const TOOL_LOOP_SPEC_ID = 'core:spec/tool-loop';
|
|
58
|
+
// ⚠ 1.0.0, edited in place (2026-10-05, sprites in-pipeline) —
|
|
59
|
+
// content-addressed; `specHashes.test.ts` records the move. The sprite step is
|
|
60
|
+
// written out after `save` (`spritePick`, `spriteShow`) where the retired
|
|
61
|
+
// `withSpriteTail` wrapper appended nodes this source never named.
|
|
53
62
|
/** @internal */
|
|
54
63
|
export const TOOL_LOOP_VERSION = '1.0.0';
|
|
55
64
|
/**
|
|
@@ -62,9 +71,9 @@ export const TOOL_LOOP_VERSION = '1.0.0';
|
|
|
62
71
|
* pipeline — what it asks, what it offers and how it repeats — is one file.
|
|
63
72
|
*
|
|
64
73
|
* ⚠ The instructions it opens and closes with are NOT here. `system` and
|
|
65
|
-
* `postHistory` are the `prompts` slot `tools.item.prompt` owns
|
|
66
|
-
* `
|
|
67
|
-
* the wording in the panel and this file holds the layout alone. Written into
|
|
74
|
+
* `postHistory` are the `prompts` slot `tools.item.prompt` owns: a pool row
|
|
75
|
+
* (`TOOL_LOOP_PROMPT`, below) like every shipped step's prompt — so a person
|
|
76
|
+
* edits the wording in the panel and this file holds the layout alone. Written into
|
|
68
77
|
* the template as literal prose they would be a second copy of text the pool
|
|
69
78
|
* already ships, and the panel's box would edit the copy nobody reads.
|
|
70
79
|
*
|
|
@@ -100,10 +109,40 @@ export const TOOL_LOOP_TEMPLATE = `{{{system}}}
|
|
|
100
109
|
{{#if postHistory}}
|
|
101
110
|
{{{postHistory}}}
|
|
102
111
|
{{/if}}`;
|
|
112
|
+
/**
|
|
113
|
+
* The reference agentic turn's own pool row (20 §9): the `system` and
|
|
114
|
+
* `postHistory` text `TOOL_LOOP_TEMPLATE` renders. It left `CORE_PROMPTS`
|
|
115
|
+
* with the spec (ruled 2026-10-05); a test that publishes `toolLoopSpec()`
|
|
116
|
+
* seeds it.
|
|
117
|
+
*
|
|
118
|
+
* `core:task/assemble@2` is the node type, so this pool is shared with
|
|
119
|
+
* nothing: tool-loop is the only spec that wires `slot.prompts()` on an
|
|
120
|
+
* assemble node — the reply and narrator pipelines author their text on their
|
|
121
|
+
* own context builders.
|
|
122
|
+
*
|
|
123
|
+
* ⚠ `system` is the paragraph `TOOL_LOOP_TEMPLATE` used to open with, moved
|
|
124
|
+
* out byte-for-byte. It lives in exactly one place: a template carrying a
|
|
125
|
+
* literal copy would be the text the model actually reads, leaving the
|
|
126
|
+
* panel's prompt box editing prose with no effect.
|
|
127
|
+
*
|
|
128
|
+
* ⚠ `postHistory` is new prose with no legacy counterpart — 0.5 shipped no
|
|
129
|
+
* tool loop — so it is outside the drift canary's subject.
|
|
130
|
+
* @internal
|
|
131
|
+
*/
|
|
132
|
+
export const TOOL_LOOP_PROMPT = {
|
|
133
|
+
nodeType: "core:task/assemble",
|
|
134
|
+
slot: "prompts",
|
|
135
|
+
createdForSpec: TOOL_LOOP_SPEC_ID,
|
|
136
|
+
defaultForSpecs: [TOOL_LOOP_SPEC_ID],
|
|
137
|
+
seedKey: "pipeline-prompt:core:task/assemble:prompts:tool-loop-default",
|
|
138
|
+
name: "Tool loop",
|
|
139
|
+
fields: {
|
|
140
|
+
system: "You are answering inside a story. Answer from what you can\nverify rather than from what you can guess: the tools below read this\nsession's own lore and transcript, and using one is cheaper than being wrong.",
|
|
141
|
+
postHistory: "Remember: to call a tool, reply with the fenced tool_call block and nothing else. Reply in the story's voice when you already have what you need."
|
|
142
|
+
}
|
|
143
|
+
};
|
|
103
144
|
/** @experimental */
|
|
104
|
-
export const toolLoopSpec = () => compile(
|
|
105
|
-
// The sprite tail (DESIGN-sprites §5): after `save`, choose the line's face.
|
|
106
|
-
withSpriteTail(spec(TOOL_LOOP_SPEC_ID, {
|
|
145
|
+
export const toolLoopSpec = () => compile(spec(TOOL_LOOP_SPEC_ID, {
|
|
107
146
|
version: TOOL_LOOP_VERSION,
|
|
108
147
|
/**
|
|
109
148
|
* No `genre`, on purpose — see the header. `action` because a
|
|
@@ -207,10 +246,10 @@ withSpriteTail(spec(TOOL_LOOP_SPEC_ID, {
|
|
|
207
246
|
// its own `prompts` slot (the binding never
|
|
208
247
|
// forwards it), so this is the one place the
|
|
209
248
|
// text is authored and the panel offers one
|
|
210
|
-
// box, not two. The pool's
|
|
211
|
-
// `
|
|
212
|
-
//
|
|
213
|
-
//
|
|
249
|
+
// box, not two. The pool's row is
|
|
250
|
+
// `TOOL_LOOP_PROMPT`, which is what the
|
|
251
|
+
// template's `system` and `postHistory`
|
|
252
|
+
// render.
|
|
214
253
|
prompts: slot.prompts(),
|
|
215
254
|
variables: slot.variables(),
|
|
216
255
|
params: slot.params(),
|
|
@@ -259,6 +298,21 @@ withSpriteTail(spec(TOOL_LOOP_SPEC_ID, {
|
|
|
259
298
|
.outlet('save', ($) => C.updateMessage.v1({
|
|
260
299
|
target: $.placeholder.messageId,
|
|
261
300
|
text: $.answer.text,
|
|
301
|
+
}))
|
|
302
|
+
/**
|
|
303
|
+
* The line's face (DESIGN-sprites §5) — see `respond`. The text
|
|
304
|
+
* is the answer the loop settled on, as `save` wrote it.
|
|
305
|
+
*/
|
|
306
|
+
.oracle('spritePick', ($) => C.pickSprite.v1({
|
|
307
|
+
text: $.answer.text,
|
|
308
|
+
speaker: $.input.speaker,
|
|
309
|
+
scope: $.input.sessionScope,
|
|
310
|
+
params: slot.params(),
|
|
311
|
+
}), { expose: { session: true } })
|
|
312
|
+
.outlet('spriteShow', ($) => C.showSprite.v1({
|
|
313
|
+
target: $.save.messageId,
|
|
314
|
+
pick: $.spritePick.main,
|
|
315
|
+
source: 'picker',
|
|
262
316
|
}))
|
|
263
317
|
/**
|
|
264
318
|
* What the reference ships, and the only place its two authored
|
|
@@ -273,6 +327,8 @@ withSpriteTail(spec(TOOL_LOOP_SPEC_ID, {
|
|
|
273
327
|
source: TOOL_LOOP_TEMPLATE,
|
|
274
328
|
engine: handlebars.id,
|
|
275
329
|
})
|
|
276
|
-
.params('answer', { path: 'answer' })
|
|
330
|
+
.params('answer', { path: 'answer' })
|
|
331
|
+
// The loop's model call runs on Tool calling (I12).
|
|
332
|
+
.loadout('tools.item.generate', slot.loadout(CORE_LOADOUT.toolCalling)))
|
|
277
333
|
.build());
|
|
278
334
|
//# sourceMappingURL=toolLoop.js.map
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@serene-pub/core-catalog/actions` — the plain-TypeScript half of core's
|
|
3
|
+
* Actions widget (PLAN-core-widgets W8): its settings, the grouping of the
|
|
4
|
+
* session's listed actions, and the one view it draws — a button per action
|
|
5
|
+
* with the verdict the composer's chips read. The widget's Svelte source
|
|
6
|
+
* lives in `components/shared/actions/` and ships built
|
|
7
|
+
* (`dist/components/actions.js`); a host imports only this half, which
|
|
8
|
+
* carries no Svelte runtime.
|
|
9
|
+
*
|
|
10
|
+
* **The groups** come from fields `actions.v1` already carries, never from a
|
|
11
|
+
* genre's name: an action from outside the genre's namespace (`origin:
|
|
12
|
+
* 'foreign'`, switched on for it) is **added**; otherwise the **extra** venue
|
|
13
|
+
* is the **turn controls** (Continue, Pick who speaks, Regenerate, …) and the
|
|
14
|
+
* **composer** venue the **genre's** own. A message's actions (pressed on a
|
|
15
|
+
* row) and a widget's own controls are other surfaces' and are not drawn.
|
|
16
|
+
*
|
|
17
|
+
* **The verdict** is the chips' (`paletteRowState`): the audience's sentence,
|
|
18
|
+
* then the declared enabled-when's reason in the viewer's language. The
|
|
19
|
+
* busy rule rides the listing (`session.generating` is a predicate the host
|
|
20
|
+
* judges), and the `item.*` predicates of a turn control acting on the
|
|
21
|
+
* newest row are left to the host's refusal: this widget reads no messages.
|
|
22
|
+
* A greyed action stays listed with its reason, never hidden.
|
|
23
|
+
*
|
|
24
|
+
* 🚧 Provisional with the widget.
|
|
25
|
+
*/
|
|
26
|
+
import { type ActionsV1, type WidgetAction } from '@serene-pub/sdk';
|
|
27
|
+
/** A translation: English source in, the viewer's words out. @experimental */
|
|
28
|
+
export type ActionsT = (source: string) => string;
|
|
29
|
+
/**
|
|
30
|
+
* One group of buttons: the **turn** controls (the `extra` venue), the
|
|
31
|
+
* **genre**'s own (the `composer` venue), and the **foreign** actions — from
|
|
32
|
+
* another namespace than the genre's, switched on for it. @experimental
|
|
33
|
+
*/
|
|
34
|
+
export type ActionsGroupKey = 'turn' | 'genre' | 'foreign';
|
|
35
|
+
/** The groups in the order they are drawn. @experimental */
|
|
36
|
+
export declare const ACTIONS_GROUP_ORDER: readonly ActionsGroupKey[];
|
|
37
|
+
/** Each group's heading, English source. @experimental */
|
|
38
|
+
export declare const ACTIONS_GROUP_TITLES: Readonly<Record<ActionsGroupKey, string>>;
|
|
39
|
+
/** The widget's settings, complete — the declared defaults wherever an instance has none. @experimental */
|
|
40
|
+
export interface ActionsSettings {
|
|
41
|
+
/** Every group, or one alone. */
|
|
42
|
+
groups: 'all' | ActionsGroupKey;
|
|
43
|
+
/** `compact` — chips that wrap; `large` — a tile grid a finger lands on. */
|
|
44
|
+
size: 'compact' | 'large';
|
|
45
|
+
/**
|
|
46
|
+
* List the questions waiting on the viewer's answer. Declared, not drawn
|
|
47
|
+
* yet: no section this widget reads carries a session's open forms.
|
|
48
|
+
*/
|
|
49
|
+
showWaiting: boolean;
|
|
50
|
+
}
|
|
51
|
+
/** @experimental */
|
|
52
|
+
export declare const ACTIONS_DEFAULTS: ActionsSettings;
|
|
53
|
+
/** Read one settings payload (`settings.v1`) into the complete object above. @experimental */
|
|
54
|
+
export declare function readActionsSettings(raw: Record<string, unknown> | undefined): ActionsSettings;
|
|
55
|
+
/**
|
|
56
|
+
* The group one listed action belongs to, or null for one this widget does
|
|
57
|
+
* not draw (a message's, a widget's own control, an admin surface's).
|
|
58
|
+
* @experimental
|
|
59
|
+
*/
|
|
60
|
+
export declare function actionsGroupOf(a: Pick<WidgetAction, 'venue' | 'origin'>): ActionsGroupKey | null;
|
|
61
|
+
/**
|
|
62
|
+
* The listed actions by group, in the order drawn, each action once — its
|
|
63
|
+
* venue's primary set first, then the overflow's rest. A group with nothing
|
|
64
|
+
* in it is left out.
|
|
65
|
+
* @experimental
|
|
66
|
+
*/
|
|
67
|
+
export declare function actionsGroups(actions: ActionsV1 | undefined, groups?: ActionsSettings['groups']): {
|
|
68
|
+
key: ActionsGroupKey;
|
|
69
|
+
actions: WidgetAction[];
|
|
70
|
+
}[];
|
|
71
|
+
/** One button, as the widget draws it. @experimental */
|
|
72
|
+
export interface ActionsButtonView {
|
|
73
|
+
/** `<spec slug>#<key>` — what a press invokes, and the row's key. */
|
|
74
|
+
identity: string;
|
|
75
|
+
name: string;
|
|
76
|
+
/** A kebab-case icon name; `play` where the action declares none, as the overflow draws it. */
|
|
77
|
+
icon: string;
|
|
78
|
+
/** What the icon says standing alone. */
|
|
79
|
+
iconAlt: string;
|
|
80
|
+
description: string | null;
|
|
81
|
+
disabled: boolean;
|
|
82
|
+
/** Why it is greyed — the sentence the host refuses a press with. Null when it may be pressed. */
|
|
83
|
+
reason: string | null;
|
|
84
|
+
/** The button's `title`: its name and why it is grey, else what it does. */
|
|
85
|
+
title: string;
|
|
86
|
+
/** The viewer has not met this action yet. */
|
|
87
|
+
isNew: boolean;
|
|
88
|
+
}
|
|
89
|
+
/** @experimental */
|
|
90
|
+
export interface ActionsGroupView {
|
|
91
|
+
key: ActionsGroupKey;
|
|
92
|
+
title: string;
|
|
93
|
+
buttons: ActionsButtonView[];
|
|
94
|
+
}
|
|
95
|
+
/** @experimental */
|
|
96
|
+
export interface ActionsView {
|
|
97
|
+
groups: ActionsGroupView[];
|
|
98
|
+
/** What an empty widget says instead. Null when there is a button. */
|
|
99
|
+
empty: string | null;
|
|
100
|
+
/** The identities drawn wearing the *new* mark — what the widget tells the host it has met. */
|
|
101
|
+
fresh: string[];
|
|
102
|
+
}
|
|
103
|
+
/** What `actionsView` reads. @experimental */
|
|
104
|
+
export interface ActionsInputs {
|
|
105
|
+
actions: ActionsV1 | undefined;
|
|
106
|
+
settings: ActionsSettings;
|
|
107
|
+
/** `locale.v1`, for a listed reason's own words. */
|
|
108
|
+
locale: string | undefined;
|
|
109
|
+
t: ActionsT;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Draw the session's actions: a group per kind, a button per action, each
|
|
113
|
+
* with the chips' verdict and its reason.
|
|
114
|
+
* @experimental
|
|
115
|
+
*/
|
|
116
|
+
export declare function actionsView(inputs: ActionsInputs): ActionsView;
|
|
117
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@serene-pub/core-catalog/actions` — the plain-TypeScript half of core's
|
|
3
|
+
* Actions widget (PLAN-core-widgets W8): its settings, the grouping of the
|
|
4
|
+
* session's listed actions, and the one view it draws — a button per action
|
|
5
|
+
* with the verdict the composer's chips read. The widget's Svelte source
|
|
6
|
+
* lives in `components/shared/actions/` and ships built
|
|
7
|
+
* (`dist/components/actions.js`); a host imports only this half, which
|
|
8
|
+
* carries no Svelte runtime.
|
|
9
|
+
*
|
|
10
|
+
* **The groups** come from fields `actions.v1` already carries, never from a
|
|
11
|
+
* genre's name: an action from outside the genre's namespace (`origin:
|
|
12
|
+
* 'foreign'`, switched on for it) is **added**; otherwise the **extra** venue
|
|
13
|
+
* is the **turn controls** (Continue, Pick who speaks, Regenerate, …) and the
|
|
14
|
+
* **composer** venue the **genre's** own. A message's actions (pressed on a
|
|
15
|
+
* row) and a widget's own controls are other surfaces' and are not drawn.
|
|
16
|
+
*
|
|
17
|
+
* **The verdict** is the chips' (`paletteRowState`): the audience's sentence,
|
|
18
|
+
* then the declared enabled-when's reason in the viewer's language. The
|
|
19
|
+
* busy rule rides the listing (`session.generating` is a predicate the host
|
|
20
|
+
* judges), and the `item.*` predicates of a turn control acting on the
|
|
21
|
+
* newest row are left to the host's refusal: this widget reads no messages.
|
|
22
|
+
* A greyed action stays listed with its reason, never hidden.
|
|
23
|
+
*
|
|
24
|
+
* 🚧 Provisional with the widget.
|
|
25
|
+
*/
|
|
26
|
+
import { actionIdentity } from '@serene-pub/sdk';
|
|
27
|
+
import { paletteRowState } from '../conversation/slashPalette.js';
|
|
28
|
+
import { statusTextIn } from '../conversation/text.js';
|
|
29
|
+
/** The groups in the order they are drawn. @experimental */
|
|
30
|
+
export const ACTIONS_GROUP_ORDER = Object.freeze([
|
|
31
|
+
'turn',
|
|
32
|
+
'genre',
|
|
33
|
+
'foreign',
|
|
34
|
+
]);
|
|
35
|
+
/** Each group's heading, English source. @experimental */
|
|
36
|
+
export const ACTIONS_GROUP_TITLES = Object.freeze({
|
|
37
|
+
turn: 'Turn controls',
|
|
38
|
+
genre: 'Genre actions',
|
|
39
|
+
foreign: 'Added actions',
|
|
40
|
+
});
|
|
41
|
+
/** @experimental */
|
|
42
|
+
export const ACTIONS_DEFAULTS = Object.freeze({
|
|
43
|
+
groups: 'all',
|
|
44
|
+
size: 'compact',
|
|
45
|
+
showWaiting: true,
|
|
46
|
+
});
|
|
47
|
+
const GROUP_SETTINGS = ['all', ...ACTIONS_GROUP_ORDER];
|
|
48
|
+
/** Read one settings payload (`settings.v1`) into the complete object above. @experimental */
|
|
49
|
+
export function readActionsSettings(raw) {
|
|
50
|
+
const v = raw ?? {};
|
|
51
|
+
return {
|
|
52
|
+
groups: GROUP_SETTINGS.includes(v.groups)
|
|
53
|
+
? v.groups
|
|
54
|
+
: ACTIONS_DEFAULTS.groups,
|
|
55
|
+
size: v.size === 'compact' || v.size === 'large' ? v.size : ACTIONS_DEFAULTS.size,
|
|
56
|
+
showWaiting: typeof v.showWaiting === 'boolean' ? v.showWaiting : ACTIONS_DEFAULTS.showWaiting,
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* The group one listed action belongs to, or null for one this widget does
|
|
61
|
+
* not draw (a message's, a widget's own control, an admin surface's).
|
|
62
|
+
* @experimental
|
|
63
|
+
*/
|
|
64
|
+
export function actionsGroupOf(a) {
|
|
65
|
+
if (a.venue !== 'extra' && a.venue !== 'composer')
|
|
66
|
+
return null;
|
|
67
|
+
if (a.origin === 'foreign')
|
|
68
|
+
return 'foreign';
|
|
69
|
+
return a.venue === 'extra' ? 'turn' : 'genre';
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* The listed actions by group, in the order drawn, each action once — its
|
|
73
|
+
* venue's primary set first, then the overflow's rest. A group with nothing
|
|
74
|
+
* in it is left out.
|
|
75
|
+
* @experimental
|
|
76
|
+
*/
|
|
77
|
+
export function actionsGroups(actions, groups = 'all') {
|
|
78
|
+
const by = new Map();
|
|
79
|
+
const seen = new Set();
|
|
80
|
+
for (const venue of ['extra', 'composer']) {
|
|
81
|
+
const listed = actions?.[venue];
|
|
82
|
+
if (!listed)
|
|
83
|
+
continue;
|
|
84
|
+
for (const a of [...(listed.primary ?? []), ...(listed.overflow ?? [])]) {
|
|
85
|
+
const group = actionsGroupOf(a);
|
|
86
|
+
if (!group || (groups !== 'all' && group !== groups))
|
|
87
|
+
continue;
|
|
88
|
+
const identity = actionIdentity(a);
|
|
89
|
+
if (seen.has(identity))
|
|
90
|
+
continue;
|
|
91
|
+
seen.add(identity);
|
|
92
|
+
by.set(group, [...(by.get(group) ?? []), a]);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
return ACTIONS_GROUP_ORDER.filter((k) => by.has(k)).map((key) => ({
|
|
96
|
+
key,
|
|
97
|
+
actions: by.get(key),
|
|
98
|
+
}));
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Draw the session's actions: a group per kind, a button per action, each
|
|
102
|
+
* with the chips' verdict and its reason.
|
|
103
|
+
* @experimental
|
|
104
|
+
*/
|
|
105
|
+
export function actionsView(inputs) {
|
|
106
|
+
const { actions, settings, t } = inputs;
|
|
107
|
+
const locale = inputs.locale ?? 'en';
|
|
108
|
+
const fresh = [];
|
|
109
|
+
const groups = actionsGroups(actions, settings.groups).map(({ key, actions: listed }) => ({
|
|
110
|
+
key,
|
|
111
|
+
title: t(ACTIONS_GROUP_TITLES[key]),
|
|
112
|
+
buttons: listed.map((a) => {
|
|
113
|
+
const identity = actionIdentity(a);
|
|
114
|
+
const verdict = paletteRowState({
|
|
115
|
+
name: a.name,
|
|
116
|
+
audience: { act: a.audience?.act ?? [] },
|
|
117
|
+
canAct: a.canAct,
|
|
118
|
+
...(a.enabled !== undefined ? { enabled: a.enabled } : {}),
|
|
119
|
+
...(a.reason ? { reason: statusTextIn(a.reason, locale, t) } : {}),
|
|
120
|
+
venue: a.venue,
|
|
121
|
+
}, { generating: false });
|
|
122
|
+
// The chips' words as the chips say them (`Regenerate — wait for
|
|
123
|
+
// the reply to finish`); a grey with no sentence still says so.
|
|
124
|
+
const reason = verdict.disabled ? verdict.reason || t('not available right now') : null;
|
|
125
|
+
if (a.isNew)
|
|
126
|
+
fresh.push(identity);
|
|
127
|
+
return {
|
|
128
|
+
identity,
|
|
129
|
+
name: a.name,
|
|
130
|
+
icon: a.icon || 'play',
|
|
131
|
+
iconAlt: a.iconAlt || a.name,
|
|
132
|
+
description: a.description ?? null,
|
|
133
|
+
disabled: verdict.disabled,
|
|
134
|
+
reason,
|
|
135
|
+
title: reason
|
|
136
|
+
? `${a.name} — ${reason}`
|
|
137
|
+
: a.description
|
|
138
|
+
? `${a.name} — ${a.description}`
|
|
139
|
+
: a.name,
|
|
140
|
+
isNew: !!a.isNew,
|
|
141
|
+
};
|
|
142
|
+
}),
|
|
143
|
+
}));
|
|
144
|
+
return {
|
|
145
|
+
groups,
|
|
146
|
+
empty: groups.length
|
|
147
|
+
? null
|
|
148
|
+
: settings.groups === 'all'
|
|
149
|
+
? t('This session offers no actions here.')
|
|
150
|
+
: t('This session offers none of these actions here.'),
|
|
151
|
+
fresh,
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@serene-pub/core-catalog/album` — the plain-TypeScript half of core's
|
|
3
|
+
* Album widget (PLAN-core-widgets W2): its settings, and the one reading it
|
|
4
|
+
* draws — every picture on the session's lines, newest first, each with
|
|
5
|
+
* where it came from and who showed it when. The widget's Svelte source
|
|
6
|
+
* lives in `components/shared/album/` and ships built
|
|
7
|
+
* (`dist/components/album.js`); a host imports only this half, which carries
|
|
8
|
+
* no Svelte runtime.
|
|
9
|
+
*
|
|
10
|
+
* **What it reads** is the log (`messages.v1`): each row's `core:image`
|
|
11
|
+
* parts, the step's shown revision only, in the order the media strip
|
|
12
|
+
* under the line draws them (`mediaStripItems`). A part with no usable
|
|
13
|
+
* `assetId` is no file anyone can fetch and is left out, as the strip
|
|
14
|
+
* leaves it out. A hidden row's pictures are not drawn. A file part
|
|
15
|
+
* (`core:file`) is not a picture and is the strip's alone.
|
|
16
|
+
*
|
|
17
|
+
* **Where a picture came from** is the row's: a person's line (`role:
|
|
18
|
+
* 'user'`) holds what they **attached**; any other line holds what a run
|
|
19
|
+
* **generated** — image generation, or an outlet that attached its bytes.
|
|
20
|
+
* The part itself names no origin today (`mediaPartFor` writes the same
|
|
21
|
+
* part for all three writers). A line's sprite is not a part — the line
|
|
22
|
+
* records its set and label, the picture is the character's — so the album
|
|
23
|
+
* never draws one.
|
|
24
|
+
*
|
|
25
|
+
* ⚠ Not a **gallery** (a character's or persona's own image set), not the
|
|
26
|
+
* **media strip** (one message's files, under its card) and not the
|
|
27
|
+
* **Media** collection (every file a person stored).
|
|
28
|
+
*
|
|
29
|
+
* Every sentence is English source handed through the widget's `t`, so the
|
|
30
|
+
* same words speak the viewer's language natively or in a worker.
|
|
31
|
+
*
|
|
32
|
+
* 🚧 Provisional with the widget.
|
|
33
|
+
*/
|
|
34
|
+
import { type MessageV1 } from '@serene-pub/sdk';
|
|
35
|
+
/** A translation: English source in, the viewer's words out. @experimental */
|
|
36
|
+
export type AlbumT = (source: string) => string;
|
|
37
|
+
/** Which pictures the album shows. @experimental */
|
|
38
|
+
export type AlbumSource = 'all' | 'attached' | 'generated';
|
|
39
|
+
/** How large a tile is drawn. @experimental */
|
|
40
|
+
export type AlbumTileSize = 'small' | 'medium' | 'large';
|
|
41
|
+
/** `grid`: every tile one size. `latest`: the newest large, the rest a strip. @experimental */
|
|
42
|
+
export type AlbumArrangement = 'grid' | 'latest';
|
|
43
|
+
/** Where one picture came from. @experimental */
|
|
44
|
+
export type AlbumOrigin = 'attached' | 'generated';
|
|
45
|
+
/** The widget's settings, complete — the declared defaults wherever an instance has none. @experimental */
|
|
46
|
+
export interface AlbumSettings {
|
|
47
|
+
source: AlbumSource;
|
|
48
|
+
tile: AlbumTileSize;
|
|
49
|
+
arrangement: AlbumArrangement;
|
|
50
|
+
/** One channel's slug, trimmed; `''` for every channel. */
|
|
51
|
+
channel: string;
|
|
52
|
+
}
|
|
53
|
+
/** @experimental */
|
|
54
|
+
export declare const ALBUM_DEFAULTS: AlbumSettings;
|
|
55
|
+
/** Read one settings payload (`settings.v1`) into the complete object above. @experimental */
|
|
56
|
+
export declare function readAlbumSettings(raw: Record<string, unknown> | undefined): AlbumSettings;
|
|
57
|
+
/** One picture the album shows. @experimental */
|
|
58
|
+
export interface AlbumItem {
|
|
59
|
+
/** The part's id — the key. */
|
|
60
|
+
partId: number;
|
|
61
|
+
/** The line it is on. */
|
|
62
|
+
messageId: number;
|
|
63
|
+
/** `files.id` — the part's `data.assetId`. */
|
|
64
|
+
assetId: number;
|
|
65
|
+
/** What a reader is told: the part's alt, then its file's name, then *Image*. */
|
|
66
|
+
label: string;
|
|
67
|
+
origin: AlbumOrigin;
|
|
68
|
+
/** Who showed it, as the line names them; `''` when the host had no name. */
|
|
69
|
+
speaker: string;
|
|
70
|
+
/** When, in the viewer's clock; `''` when the line carries no time. */
|
|
71
|
+
time: string;
|
|
72
|
+
/** `speaker · time`, whichever of the two there is. */
|
|
73
|
+
caption: string;
|
|
74
|
+
width: number | null;
|
|
75
|
+
height: number | null;
|
|
76
|
+
}
|
|
77
|
+
/** The address of one representation (`/media/{id}`, plus `?v=` for a derived one) — the media strip's. @experimental */
|
|
78
|
+
export declare function albumSrc(assetId: number, variant?: 'thumb' | 'fitted'): string;
|
|
79
|
+
/** What `albumItems` needs beyond the rows and the settings. @experimental */
|
|
80
|
+
export interface AlbumItemsOptions {
|
|
81
|
+
/** `locale.v1`, for the clock. */
|
|
82
|
+
locale?: string;
|
|
83
|
+
t?: AlbumT;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* The album: every picture on `rows` (the log, in its order) the settings
|
|
87
|
+
* let through, **newest line first**, a line's own pictures in the strip's
|
|
88
|
+
* order. `channel`, set, keeps one channel's lines — its every lane — as a
|
|
89
|
+
* Messages copy's `channel` claims one; empty keeps every channel. `source`
|
|
90
|
+
* keeps the attached or the generated alone.
|
|
91
|
+
* @experimental
|
|
92
|
+
*/
|
|
93
|
+
export declare function albumItems(rows: readonly MessageV1[] | null | undefined, settings: Pick<AlbumSettings, 'source' | 'channel'>, options?: AlbumItemsOptions): AlbumItem[];
|
|
94
|
+
/**
|
|
95
|
+
* The `view-image` request for opening picture `index` of `items` (the
|
|
96
|
+
* album as drawn, in display order, less any whose file is gone): the
|
|
97
|
+
* picture itself, full size, and every other as the lightbox's pages,
|
|
98
|
+
* captioned by their names as the media strip captions them.
|
|
99
|
+
* @experimental
|
|
100
|
+
*/
|
|
101
|
+
export declare function albumViewImageParams(items: readonly AlbumItem[], index: number): {
|
|
102
|
+
src: string;
|
|
103
|
+
gallery: {
|
|
104
|
+
srcs: string[];
|
|
105
|
+
index: number;
|
|
106
|
+
captions: string[];
|
|
107
|
+
};
|
|
108
|
+
};
|
|
109
|
+
/** What the album says when it has nothing to draw, by `source`. @experimental */
|
|
110
|
+
export declare const ALBUM_EMPTY: Readonly<Record<AlbumSource, string>>;
|
|
111
|
+
/** A tile's name for a reader: *Open attached image cat.png, Wren · 9:41 PM, 2 of 7*. @experimental */
|
|
112
|
+
export declare function albumOpenLabel(item: AlbumItem, at: number, total: number, t?: AlbumT): string;
|
|
113
|
+
/** The origin glyph's words, for its `title`. @experimental */
|
|
114
|
+
export declare const ALBUM_ORIGIN_NAMES: Readonly<Record<AlbumOrigin, string>>;
|
|
115
|
+
//# sourceMappingURL=index.d.ts.map
|