@serene-pub/core-catalog 0.6.0-pr-8 → 0.6.0-pr-9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (147) hide show
  1. package/README.md +1 -1
  2. package/components/shared/chronicle/ChronicleWidget.svelte +127 -57
  3. package/components/shared/composer/ComposerWidget.svelte +17 -5
  4. package/components/shared/composer/settings.ts +6 -2
  5. package/components/shared/composer/target.ts +19 -0
  6. package/components/shared/dialogue-box/DialogueBoxWidget.svelte +2 -2
  7. package/components/shared/lore-entries/LoreEntriesWidget.svelte +39 -35
  8. package/components/shared/messages/MessageBlocksView.svelte +1 -1
  9. package/components/shared/messages/MessageControls.svelte +21 -4
  10. package/components/shared/messages/MessagesWidget.svelte +24 -8
  11. package/components/shared/messages/NextCharacterBlock.svelte +18 -3
  12. package/components/shared/messages/SceneDivider.svelte +22 -12
  13. package/components/shared/messages/SessionComposer.svelte +67 -22
  14. package/components/shared/messages/SessionContainer.svelte +87 -32
  15. package/components/shared/messages/SessionMessage.svelte +68 -29
  16. package/components/shared/messages/SpokenLine.svelte +45 -13
  17. package/components/shared/messages/TurnLine.svelte +233 -45
  18. package/components/shared/messages/conversation.svelte.ts +30 -2
  19. package/components/shared/messages/rowFacts.ts +44 -0
  20. package/components/shared/messages/spokenLine.ts +63 -14
  21. package/components/shared/places/PlacesWidget.svelte +32 -20
  22. package/components/shared/routine-log/routineLog.ts +5 -21
  23. package/components/shared/session-runs/SessionRunsWidget.svelte +16 -12
  24. package/dist/components/actions.js +5 -5
  25. package/dist/components/actions.source.json +1 -1
  26. package/dist/components/album.js +1 -1
  27. package/dist/components/album.source.json +1 -1
  28. package/dist/components/annex.js +1 -1
  29. package/dist/components/annex.source.json +1 -1
  30. package/dist/components/attendance.js +1 -1
  31. package/dist/components/attendance.source.json +1 -1
  32. package/dist/components/authors-note.js +1 -1
  33. package/dist/components/authors-note.source.json +1 -1
  34. package/dist/components/backdrop.js +3 -3
  35. package/dist/components/backdrop.source.json +1 -1
  36. package/dist/components/chronicle.js +641 -484
  37. package/dist/components/chronicle.source.json +1 -1
  38. package/dist/components/composer.js +188 -153
  39. package/dist/components/composer.source.json +1 -1
  40. package/dist/components/core-ui.json +1 -1
  41. package/dist/components/dialogue-box.js +11 -11
  42. package/dist/components/dialogue-box.source.json +1 -1
  43. package/dist/components/lore-entries.js +101 -92
  44. package/dist/components/lore-entries.source.json +1 -1
  45. package/dist/components/messages.js +351 -275
  46. package/dist/components/messages.source.json +1 -1
  47. package/dist/components/places.js +237 -202
  48. package/dist/components/places.source.json +1 -1
  49. package/dist/components/routine-log.js +6 -17
  50. package/dist/components/routine-log.source.json +1 -1
  51. package/dist/components/scene-portraits.js +4 -4
  52. package/dist/components/scene-portraits.source.json +1 -1
  53. package/dist/components/session-runs.js +118 -211
  54. package/dist/components/session-runs.source.json +1 -1
  55. package/dist/components/{shared-OVDOAXYZ.js → shared-47J4TNSF.js} +1 -1
  56. package/dist/components/{shared-ASZVJYPD.js → shared-EFMMT76D.js} +56 -3
  57. package/dist/components/{shared-N7FFW5TX.js → shared-FOVKPMSK.js} +3 -3
  58. package/dist/components/{shared-7SWDK5MC.js → shared-HEAKNNZB.js} +4 -0
  59. package/dist/components/shared-JXP6SHKF.js +159 -0
  60. package/dist/components/{shared-TNJZHTMT.js → shared-JXYPKSTQ.js} +1 -1
  61. package/dist/components/{shared-2FMI3LEE.js → shared-KJIOSSE3.js} +2 -2
  62. package/dist/components/{shared-RQYMTMHF.js → shared-KLURQFWI.js} +2 -2
  63. package/dist/components/{shared-BR2KXM25.js → shared-MHCNUDUT.js} +96 -12
  64. package/dist/components/{shared-6S23SGJB.js → shared-NICRJ4Z2.js} +1 -1
  65. package/dist/components/{shared-M7AYID43.js → shared-W2BBJCNE.js} +7 -7
  66. package/dist/components/{shared-XJD6Y2OU.js → shared-YYYXFDZU.js} +387 -248
  67. package/dist/components/stats.js +5 -5
  68. package/dist/components/stats.source.json +1 -1
  69. package/dist/components/turn-line.js +384 -112
  70. package/dist/components/turn-line.source.json +1 -1
  71. package/dist/components/turn-order.js +4 -4
  72. package/dist/components/turn-order.source.json +1 -1
  73. package/dist/factories/answerForm.d.ts +6 -0
  74. package/dist/factories/answerForm.js +104 -96
  75. package/dist/factories/turnOrder.d.ts +84 -107
  76. package/dist/factories/turnOrder.js +89 -131
  77. package/dist/genres/chat/create.js +2 -0
  78. package/dist/genres/chat/memory.js +64 -43
  79. package/dist/genres/chat/respond.d.ts +7 -6
  80. package/dist/genres/chat/respond.js +13 -4
  81. package/dist/genres/chat/turnOrder.d.ts +2 -2
  82. package/dist/genres/chat/turnOrder.js +28 -12
  83. package/dist/genres/defaults.d.ts +8 -2
  84. package/dist/genres/defaults.js +51 -27
  85. package/dist/genres/dungeon-crawler/journal.d.ts +1 -1
  86. package/dist/genres/dungeon-crawler/journal.js +1 -1
  87. package/dist/genres/dungeon-crawler/rest.js +5 -3
  88. package/dist/genres/dungeon-crawler/story.d.ts +2 -1
  89. package/dist/genres/dungeon-crawler/story.js +7 -4
  90. package/dist/genres/dungeon-crawler/storyScripts.js +85 -9
  91. package/dist/genres/dungeon-crawler/turnOrder.d.ts +8 -9
  92. package/dist/genres/dungeon-crawler/turnOrder.js +33 -23
  93. package/dist/genres/guide/create.js +2 -0
  94. package/dist/genres/guide/turnOrder.d.ts +3 -3
  95. package/dist/genres/guide/turnOrder.js +29 -13
  96. package/dist/genres/lair/answerForm.js +4 -1
  97. package/dist/genres/lair/buildRoom.js +4 -3
  98. package/dist/genres/lair/castellanAction.js +160 -154
  99. package/dist/genres/lair/fileCurrentRoom.js +13 -10
  100. package/dist/genres/lair/fileRoom.js +4 -3
  101. package/dist/genres/lair/keeper.js +2 -0
  102. package/dist/genres/lair/names.d.ts +2 -0
  103. package/dist/genres/lair/names.js +2 -0
  104. package/dist/genres/lair/reply.js +16 -6
  105. package/dist/genres/lair/roomAnswer.js +4 -3
  106. package/dist/genres/lair/scratchpad.js +9 -7
  107. package/dist/genres/lair/turnOrder.d.ts +3 -2
  108. package/dist/genres/lair/turnOrder.js +45 -16
  109. package/dist/genres/story/create.d.ts +1 -0
  110. package/dist/genres/story/create.js +1 -0
  111. package/dist/genres/story/reckon.js +43 -10
  112. package/dist/genres/story/turnOrder.d.ts +13 -3
  113. package/dist/genres/story/turnOrder.js +79 -22
  114. package/dist/index.js +8 -8
  115. package/dist/primers/ninth-mile.d.ts +3 -4
  116. package/dist/registry/entries.js +16 -5
  117. package/dist/registry/genres.d.ts +61 -54
  118. package/dist/registry/genres.js +123 -106
  119. package/dist/registry/widgets.js +12 -1
  120. package/dist/seed/presets.js +11 -7
  121. package/dist/seed/scripts.js +3 -0
  122. package/dist/shared/lore.d.ts +13 -0
  123. package/dist/shared/lore.js +37 -1
  124. package/dist/shared/reckoning.d.ts +7 -1
  125. package/dist/shared/reckoning.js +24 -17
  126. package/dist/shared/sceneBoundaries.js +7 -6
  127. package/dist/shared/speakMessage.d.ts +9 -2
  128. package/dist/shared/speakMessage.js +32 -9
  129. package/dist/shared/ui/chronicle/index.d.ts +7 -2
  130. package/dist/shared/ui/chronicle/index.js +21 -12
  131. package/dist/shared/ui/conversation/index.d.ts +1 -0
  132. package/dist/shared/ui/conversation/index.js +2 -0
  133. package/dist/shared/ui/conversation/messageVerbState.d.ts +5 -0
  134. package/dist/shared/ui/conversation/messageVerbState.js +3 -3
  135. package/dist/shared/ui/conversation/rewindStrip.d.ts +11 -4
  136. package/dist/shared/ui/conversation/rewindStrip.js +9 -7
  137. package/dist/shared/ui/conversation/runsInProgress.d.ts +30 -0
  138. package/dist/shared/ui/conversation/runsInProgress.js +47 -0
  139. package/dist/shared/ui/conversation/tableChannel.d.ts +8 -11
  140. package/dist/shared/ui/conversation/tableChannel.js +8 -9
  141. package/dist/shared/ui/routine-log/index.d.ts +3 -0
  142. package/dist/shared/ui/routine-log/index.js +22 -0
  143. package/dist/shared/ui/session-runs/index.d.ts +9 -1
  144. package/dist/shared/ui/session-runs/index.js +20 -14
  145. package/dist/shared/ui/turn-order/index.d.ts +0 -9
  146. package/dist/shared/ui/turn-order/index.js +1 -2
  147. package/package.json +8 -8
package/README.md CHANGED
@@ -33,7 +33,7 @@ Importing the package registers its declarations, so it lists those modules in
33
33
  | --------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
34
34
  | `src/genres/<genre>/` | one genre's pipelines, one spec per file (create, reply, actions, answer form, turn order), and its own widgets (`genres/chat/ui/authors-note/`) |
35
35
  | `src/shared/` | what more than one genre uses: the built-in message verbs, summarize, the annex field, sprites, the story graph build, the tool-loop example, and the shared widgets (`shared/ui/`) |
36
- | `src/factories/` | `answerFormSpec()` and `turnOrderSpec()`, which a plugin genre calls too |
36
+ | `src/factories/` | `answerFormSpec()`, `turnOrderSpec()` and its five builders (`roundRobinTurnOrder` …), which a plugin genre calls too |
37
37
  | `src/registry/` | genres, slots, stat shapes, entry types, widget declarations and layouts |
38
38
  | `src/seed/` | the shipped prompts, presets and the guide mascot |
39
39
  | `components/` | the Svelte sources, mirrored the same way (`components/shared/*`, `components/genres/chat/authors-note`) |
@@ -36,6 +36,11 @@
36
36
  * history entry holds yet, by day (*Undated* last), each row the same as a
37
37
  * Scenes row; 🚧 ★S6-1 each day's **Compile** (`compile-history-entry`).
38
38
  *
39
+ * 🚧 A lorebook with no timeline (owner 2026-11-15, ★T-C6; `timeline`
40
+ * false): no clock, no Now, no Earlier and no days — the session's scenes
41
+ * (all of them, in played order) and its open scene stay, and a note says
42
+ * why in the clock's place.
43
+ *
39
44
  * The markup carries no look (STYLE-GUIDE §6.16): its elements carry
40
45
  * `chronicle.*` widget parts; a scene's colour rides on its swatch's
41
46
  * `data-swatch`, an entry that says nothing yet on `data-blank`. Earlier
@@ -74,6 +79,7 @@
74
79
  /** A press in flight: its controls wait. */
75
80
  let busy = $state<string | null>(null)
76
81
 
82
+ const timeless = $derived(answer?.timeline === false)
77
83
  const view = $derived(chronicleView(answer, settings, widget?.current?.viewer?.v1, t))
78
84
 
79
85
  const reason = (e: unknown) => (e instanceof Error ? e.message : String(e))
@@ -203,7 +209,12 @@
203
209
 
204
210
  /** Set the clock to the form's date (Set the clock, or Enter in a field). */
205
211
  async function submitMove() {
206
- const read = chronicleClockFromDraft(draft)
212
+ // A part not drawn stays in the draft but is not read.
213
+ const read = chronicleClockFromDraft({
214
+ ...draft,
215
+ day: draft.month.trim() === "" ? "" : draft.day,
216
+ minute: draft.hour.trim() === "" ? "" : draft.minute
217
+ })
207
218
  if (read.problem !== undefined) {
208
219
  formProblem = t(read.problem)
209
220
  return
@@ -221,6 +232,9 @@
221
232
  ]
222
233
 
223
234
  // ── the entries and scenes ───────────────────────────────────────────────
235
+ /** The session's notes are the owner's: a guest reads the Chronicle and opens none of it. */
236
+ const canOpen = $derived(widget?.current?.viewer?.v1?.isGuest !== true)
237
+
224
238
  function openEntry(entryId?: number) {
225
239
  const lorebookId = answer?.lorebookId ?? undefined
226
240
  void press("open", "open-lore", {
@@ -239,6 +253,14 @@
239
253
  })
240
254
  }
241
255
 
256
+ function openScenes() {
257
+ const lorebookId = answer?.lorebookId ?? undefined
258
+ void press("open", "open-lore", {
259
+ ...(lorebookId != null ? { lorebookId } : {}),
260
+ scope: "scenes"
261
+ })
262
+ }
263
+
242
264
  async function startEntry() {
243
265
  const made = await press("start", "start-history-entry", {})
244
266
  if (!made) return
@@ -249,29 +271,45 @@
249
271
  }
250
272
  </script>
251
273
 
274
+ {#snippet sceneOpenBody(s: ChronicleSceneView)}
275
+ <span data-widget-part="chronicle.scene-swatch" data-swatch={s.swatch}></span>
276
+ <span data-widget-part="chronicle.scene-name">{s.name}</span>
277
+ <span data-widget-part="chronicle.scene-span">{s.span}</span>
278
+ <span
279
+ data-widget-part="chronicle.scene-status"
280
+ data-status={s.status}
281
+ role="img"
282
+ aria-label={s.statusLabel}
283
+ title={s.statusLabel}
284
+ ></span>
285
+ {/snippet}
286
+
287
+ {#snippet earlierBody(e: (typeof view.earlier)[number])}
288
+ <span data-widget-part="chronicle.entry-date">{e.date}</span>
289
+ <span data-widget-part="chronicle.entry-line" data-blank={e.blank ? "" : undefined}>
290
+ {e.firstLine}
291
+ </span>
292
+ <span data-widget-part="chronicle.entry-scenes">{e.scenes}</span>
293
+ {/snippet}
294
+
252
295
  {#snippet sceneRow(s: ChronicleSceneView)}
253
296
  <li
254
297
  data-widget-part="chronicle.scene row"
255
298
  data-scene-id={s.id}
256
299
  data-open={s.open ? "" : undefined}
257
300
  >
258
- <button
259
- type="button"
260
- data-widget-part="chronicle.scene-open"
261
- title={t("Open in lorebook")}
262
- onclick={() => openScene(s.id)}
263
- >
264
- <span data-widget-part="chronicle.scene-swatch" data-swatch={s.swatch}></span>
265
- <span data-widget-part="chronicle.scene-name">{s.name}</span>
266
- <span data-widget-part="chronicle.scene-span">{s.span}</span>
267
- <span
268
- data-widget-part="chronicle.scene-status"
269
- data-status={s.status}
270
- role="img"
271
- aria-label={s.statusLabel}
272
- title={s.statusLabel}
273
- ></span>
274
- </button>
301
+ {#if canOpen}
302
+ <button
303
+ type="button"
304
+ data-widget-part="chronicle.scene-open"
305
+ title={t("Open in lorebook")}
306
+ onclick={() => openScene(s.id)}
307
+ >
308
+ {@render sceneOpenBody(s)}
309
+ </button>
310
+ {:else}
311
+ <span data-widget-part="chronicle.scene-open">{@render sceneOpenBody(s)}</span>
312
+ {/if}
275
313
  {#if s.canSummarize}
276
314
  <button
277
315
  type="button"
@@ -310,7 +348,9 @@
310
348
  <p data-widget-part="chronicle.alert" role="alert">{alert}</p>
311
349
  {/if}
312
350
 
313
- {#if view.clock}
351
+ {#if timeless}
352
+ <p data-widget-part="chronicle.note">{t("This lorebook keeps no timeline, so there are no story dates here.")}</p>
353
+ {:else if view.clock}
314
354
  <section data-widget-part="chronicle.clock" aria-label={t("Story clock")}>
315
355
  <div data-widget-part="chronicle.clock-head">
316
356
  <span data-widget-part="chronicle.clock-date">{view.clock.date}</span>
@@ -365,22 +405,42 @@
365
405
  >
366
406
  <div data-widget-part="chronicle.fields">
367
407
  {#each FIELDS as f (f.key)}
368
- <label data-widget-part="chronicle.field">
369
- <span data-widget-part="chronicle.field-label label">{t(f.label)}</span>
370
- <input
371
- type="text"
372
- data-widget-part="chronicle.field-input"
373
- name={f.key}
374
- value={draft[f.key]}
375
- oninput={(e) => (draft = { ...draft, [f.key]: e.currentTarget.value })}
376
- onkeydown={(e) => {
377
- if (e.key === "Enter") {
378
- e.preventDefault()
379
- void submitMove()
380
- }
381
- }}
382
- />
383
- </label>
408
+ {#if (f.key !== "day" || draft.month.trim() !== "") && (f.key !== "minute" || draft.hour.trim() !== "")}
409
+ {#if f.key === "month" && answer?.clock.months?.length}
410
+ <!-- The combobox draws its own label. -->
411
+ <div data-widget-part="chronicle.field">
412
+ <sp-combobox
413
+ data-widget-part="chronicle.field-input"
414
+ label={t(f.label)}
415
+ trigger-label={t("Choose a month")}
416
+ value={draft.month}
417
+ onchange={(e: CustomEvent<{ value: string }>) => (draft = { ...draft, month: e.detail.value })}
418
+ >
419
+ <sp-option value="">{t("No month")}</sp-option>
420
+ {#each answer.clock.months as monthName, i (i)}
421
+ <sp-option value={String(i + 1)}>{monthName}</sp-option>
422
+ {/each}
423
+ </sp-combobox>
424
+ </div>
425
+ {:else}
426
+ <label data-widget-part="chronicle.field">
427
+ <span data-widget-part="chronicle.field-label label">{t(f.label)}</span>
428
+ <input
429
+ type="number"
430
+ data-widget-part="chronicle.field-input"
431
+ name={f.key}
432
+ value={draft[f.key]}
433
+ oninput={(e) => (draft = { ...draft, [f.key]: e.currentTarget.value })}
434
+ onkeydown={(e) => {
435
+ if (e.key === "Enter") {
436
+ e.preventDefault()
437
+ void submitMove()
438
+ }
439
+ }}
440
+ />
441
+ </label>
442
+ {/if}
443
+ {/if}
384
444
  {/each}
385
445
  </div>
386
446
  {#if formProblem}
@@ -465,6 +525,7 @@
465
525
  </section>
466
526
  {/if}
467
527
 
528
+ {#if !timeless}
468
529
  <section data-widget-part="chronicle.now" aria-labelledby="{uid}-now">
469
530
  <h3 id="{uid}-now" data-widget-part="chronicle.heading label">{t("Now")}</h3>
470
531
  {#if view.now}
@@ -477,14 +538,16 @@
477
538
  </div>
478
539
  {/if}
479
540
  <div data-widget-part="chronicle.toolbar toolbar">
480
- <button
481
- type="button"
482
- data-widget-part="chronicle.open"
483
- onclick={() => openEntry(view.now?.id)}
484
- >
485
- <sp-icon name="external-link" size="14"></sp-icon>
486
- {t("Open in lorebook")}
487
- </button>
541
+ {#if canOpen}
542
+ <button
543
+ type="button"
544
+ data-widget-part="chronicle.open"
545
+ onclick={() => openEntry(view.now?.id)}
546
+ >
547
+ <sp-icon name="external-link" size="14"></sp-icon>
548
+ {t("Open in lorebook")}
549
+ </button>
550
+ {/if}
488
551
  {#if view.canWrite && view.now}
489
552
  <button
490
553
  type="button"
@@ -498,8 +561,9 @@
498
561
  {/if}
499
562
  </div>
500
563
  </section>
564
+ {/if}
501
565
 
502
- {#if view.now}
566
+ {#if view.now || timeless}
503
567
  <section data-widget-part="chronicle.scenes" aria-labelledby="{uid}-scenes">
504
568
  <h3 id="{uid}-scenes" data-widget-part="chronicle.heading label">{t("Scenes")}</h3>
505
569
  {#if view.scenes.length}
@@ -509,8 +573,14 @@
509
573
  {/each}
510
574
  </ul>
511
575
  {/if}
512
- {#if view.canSummarize || view.extend || view.summarizeAll}
576
+ {#if (timeless && canOpen) || view.canSummarize || view.extend || view.summarizeAll}
513
577
  <div data-widget-part="chronicle.scene-actions toolbar">
578
+ {#if timeless && canOpen}
579
+ <button type="button" data-widget-part="chronicle.open" onclick={openScenes}>
580
+ <sp-icon name="external-link" size="14"></sp-icon>
581
+ {t("Open in lorebook")}
582
+ </button>
583
+ {/if}
514
584
  {#if view.canSummarize}
515
585
  <button
516
586
  type="button"
@@ -588,18 +658,18 @@
588
658
  <ul data-widget-part="chronicle.earlier-list list">
589
659
  {#each view.earlier as e (e.id)}
590
660
  <li data-widget-part="chronicle.earlier-row row" data-entry-id={e.id}>
591
- <button
592
- type="button"
593
- data-widget-part="chronicle.earlier-entry"
594
- title={t("Open in lorebook")}
595
- onclick={() => openEntry(e.id)}
596
- >
597
- <span data-widget-part="chronicle.entry-date">{e.date}</span>
598
- <span data-widget-part="chronicle.entry-line" data-blank={e.blank ? "" : undefined}>
599
- {e.firstLine}
600
- </span>
601
- <span data-widget-part="chronicle.entry-scenes">{e.scenes}</span>
602
- </button>
661
+ {#if canOpen}
662
+ <button
663
+ type="button"
664
+ data-widget-part="chronicle.earlier-entry"
665
+ title={t("Open in lorebook")}
666
+ onclick={() => openEntry(e.id)}
667
+ >
668
+ {@render earlierBody(e)}
669
+ </button>
670
+ {:else}
671
+ <span data-widget-part="chronicle.earlier-entry">{@render earlierBody(e)}</span>
672
+ {/if}
603
673
  </li>
604
674
  {/each}
605
675
  </ul>
@@ -20,7 +20,20 @@
20
20
 
21
21
  const fields = $derived(composerTargetOf(conversation?.dossier))
22
22
  const target = $derived(fields.target)
23
- const writingTo = $derived(fields.writingTo)
23
+ /**
24
+ * Where a line goes, named: the host's label, except the default channel
25
+ * (`main`, the story's own log) with no label declared, which reads *the
26
+ * story* rather than a title-cased slug.
27
+ */
28
+ const writingTo = $derived.by(() => {
29
+ const w = fields.writingTo
30
+ if (!w) return null
31
+ // The default channel's slug (`DEFAULT_CHANNEL` in the SDK).
32
+ const slug = w.channel.split(":")[0]
33
+ return slug === "main" && !conversation?.dossier?.composer?.channelLabels?.[slug]
34
+ ? { ...w, label: conversation!.t("the story") }
35
+ : w
36
+ })
24
37
  /**
25
38
  * Folio's rule, the target's: its presentation when the host says it, else
26
39
  * what its channel IS (`channelRole`). No target: the primary log's.
@@ -91,10 +104,9 @@
91
104
  <div data-widget-part="messages.read-only composer.read-only" role="status">
92
105
  <sp-icon name="lock" size="20" data-widget-part="messages.read-only-icon composer.read-only-icon"></sp-icon>
93
106
  <div data-widget-part="messages.read-only-text composer.read-only-text">
94
- <p data-widget-part="messages.read-only-title composer.read-only-title">This session is read-only.</p>
107
+ <p data-widget-part="messages.read-only-title composer.read-only-title">This session is read-only: its genre is not available (not installed, or switched off).</p>
95
108
  <p>
96
- Its mode ({dossier.readOnly.genreId}) is not installed. Messages are safe to
97
- read; new turns resume when the mode returns.
109
+ Messages are safe to read; new turns resume when the genre is available again.
98
110
  </p>
99
111
  </div>
100
112
  </div>
@@ -127,7 +139,7 @@
127
139
  {/if}
128
140
  </p>
129
141
  {/if}
130
- <SessionComposer {composerSkin} showActions={settings.showActions} />
142
+ <SessionComposer {composerSkin} showActions={settings.showActions} showSend={settings.showSend} />
131
143
  {/if}
132
144
  </div>
133
145
  </div>
@@ -16,13 +16,16 @@ export interface ComposerSettings {
16
16
  */
17
17
  otherTabsComposer: ComposerSkin | "same"
18
18
  showActions: boolean
19
+ /** 🚧 Draw Send and Stop; at the compact width they always show. */
20
+ showSend: boolean
19
21
  }
20
22
 
21
23
  /** The declared defaults (`CORE_WIDGETS`, the `composer` entry). */
22
24
  export const COMPOSER_DEFAULTS: ComposerSettings = {
23
25
  composerSkin: "classic",
24
26
  otherTabsComposer: "same",
25
- showActions: true
27
+ showActions: true,
28
+ showSend: true
26
29
  }
27
30
 
28
31
  function pickEnum<T extends string>(raw: unknown, of: readonly T[], fallback: T): T {
@@ -50,6 +53,7 @@ export function readComposerSettings(
50
53
  ["same", "classic", "minimal", "writer", "quill"],
51
54
  d.otherTabsComposer
52
55
  ),
53
- showActions: typeof v.showActions === "boolean" ? v.showActions : d.showActions
56
+ showActions: typeof v.showActions === "boolean" ? v.showActions : d.showActions,
57
+ showSend: typeof v.showSend === "boolean" ? v.showSend : d.showSend
54
58
  }
55
59
  }
@@ -8,6 +8,7 @@
8
8
  * Those two fields are not yet in the SDK's `ConversationComposerV1`, so they
9
9
  * are read here, structurally, in ONE place; nothing else touches the shape.
10
10
  */
11
+ import type { SessionDossierV1 } from "@serene-pub/sdk/component"
11
12
 
12
13
  export type TargetLineWidth = "column" | "full" | "comfortable"
13
14
  export type TargetPresentation = "rows" | "folio"
@@ -58,3 +59,21 @@ export function composerTargetOf(dossier: unknown): ComposerTargetFields {
58
59
  w && str(w.channel) ? { channel: w.channel, label: typeof w.label === "string" && w.label ? w.label : w.channel } : null
59
60
  return { target, writingTo }
60
61
  }
62
+
63
+ /**
64
+ * 🚧 Whether the Composer beside this Turn line draws Send (`dossier.composer.sendShown`,
65
+ * the host's answer from the layout). `undefined` when the host says nothing: read as shown.
66
+ */
67
+ export function composerSendShownOf(dossier: SessionDossierV1 | null | undefined): boolean | undefined {
68
+ return dossier?.composer?.sendShown
69
+ }
70
+
71
+ /**
72
+ * 🚧 Whether Send is shown: the one rule the Composer and the Turn line both read.
73
+ * At the compact (phone) width Enter writes a new line and only the button sends,
74
+ * so Send shows whatever the setting says; otherwise the setting, absent read as
75
+ * shown. @experimental
76
+ */
77
+ export function composerSendShown(setting: boolean | undefined, tier: string | undefined): boolean {
78
+ return tier === "compact" || setting !== false
79
+ }
@@ -25,7 +25,7 @@
25
25
  import {
26
26
  isSpeaking,
27
27
  readAloudOf,
28
- spokenAudioItem,
28
+ spokenAudioItems,
29
29
  spokenOf,
30
30
  spokenPendingOf,
31
31
  spokenPlaybackOf
@@ -86,7 +86,7 @@
86
86
  const dossier = $derived(conversation?.dossier ?? null)
87
87
  const spoken = $derived(shown ? spokenOf(shown.metadata) : null)
88
88
  const hasAudio = $derived(
89
- !!shown && !!spoken && !!spokenAudioItem(mediaStripItems(shown.parts, shown.activeRevisions ?? { "0": 0 }))
89
+ !!shown && !!spoken && spokenAudioItems(mediaStripItems(shown.parts, shown.activeRevisions ?? { "0": 0 }), spoken).length > 0
90
90
  )
91
91
  const pendingRaw = $derived(shown ? spokenPendingOf(shown.metadata) : null)
92
92
 
@@ -222,42 +222,46 @@
222
222
  <sp-icon name="refresh-cw" size="14"></sp-icon>
223
223
  </button>
224
224
  </div>
225
- <div data-widget-part="lore-entries.filter-bar toolbar">
226
- <div data-widget-part="lore-entries.filters" role="radiogroup" aria-label={t("Show")}>
227
- {#each LORE_ENTRIES_FILTERS as f (f.value)}
228
- <!-- Chosen is the radio's own `:checked`: the sheet reads it, no state attribute. -->
229
- <label data-widget-part="lore-entries.filter chip">
230
- <input
231
- type="radio"
232
- data-widget-part="lore-entries.filter-input"
233
- name={filterGroup}
234
- value={f.value}
235
- checked={filter === f.value}
236
- onchange={() => setFilter(f.value)}
237
- />
238
- {t(f.label)}
239
- </label>
240
- {/each}
241
- </div>
242
- <span data-widget-part="lore-entries.sort">
243
- <!-- The combobox's own label is the one visible "Sort" (the host draws it). -->
244
- <sp-combobox
245
- data-widget-part="lore-entries.sort-field"
246
- label={t("Sort")}
247
- value={effectiveSort}
248
- onchange={(e: CustomEvent<{ value: string }>) => {
249
- const next = LORE_ENTRIES_SORTS.find((s) => s.value === e.detail.value)
250
- if (!next) return
251
- sort = next.value
252
- offset = 0
253
- }}
254
- >
255
- {#each LORE_ENTRIES_SORTS as o (o.value)}
256
- <sp-option value={o.value}>{t(o.label)}</sp-option>
225
+ <!-- A widget with nothing to show draws nothing (STYLE-GUIDE §6.7): no filters or Sort over a book
226
+ answered as empty. Before the first answer they are drawn, so they do not arrive after the list. -->
227
+ {#if !answer || answer.total > 0 || searched || filter !== "all"}
228
+ <div data-widget-part="lore-entries.filter-bar toolbar">
229
+ <div data-widget-part="lore-entries.filters" role="radiogroup" aria-label={t("Show")}>
230
+ {#each LORE_ENTRIES_FILTERS as f (f.value)}
231
+ <!-- Chosen is the radio's own `:checked`: the sheet reads it, no state attribute. -->
232
+ <label data-widget-part="lore-entries.filter chip">
233
+ <input
234
+ type="radio"
235
+ data-widget-part="lore-entries.filter-input"
236
+ name={filterGroup}
237
+ value={f.value}
238
+ checked={filter === f.value}
239
+ onchange={() => setFilter(f.value)}
240
+ />
241
+ {t(f.label)}
242
+ </label>
257
243
  {/each}
258
- </sp-combobox>
259
- </span>
260
- </div>
244
+ </div>
245
+ <span data-widget-part="lore-entries.sort">
246
+ <!-- The combobox's own label is the one visible "Sort" (the host draws it). -->
247
+ <sp-combobox
248
+ data-widget-part="lore-entries.sort-field"
249
+ label={t("Sort")}
250
+ value={effectiveSort}
251
+ onchange={(e: CustomEvent<{ value: string }>) => {
252
+ const next = LORE_ENTRIES_SORTS.find((s) => s.value === e.detail.value)
253
+ if (!next) return
254
+ sort = next.value
255
+ offset = 0
256
+ }}
257
+ >
258
+ {#each LORE_ENTRIES_SORTS as o (o.value)}
259
+ <sp-option value={o.value}>{t(o.label)}</sp-option>
260
+ {/each}
261
+ </sp-combobox>
262
+ </span>
263
+ </div>
264
+ {/if}
261
265
 
262
266
  {#if readError}
263
267
  <p data-widget-part="lore-entries.alert" role="alert">{readError}</p>
@@ -434,7 +434,7 @@
434
434
  {:else if d.type === "enum"}
435
435
  <sp-combobox
436
436
  data-widget-part="messages.block-select"
437
- label={key}
437
+ label={fieldLabel(key, d)}
438
438
  value={String(formDrafts[i]?.[key] ?? d.default ?? "")}
439
439
  onchange={(e: CustomEvent<{ value: string }>) =>
440
440
  editField(i, key, e.detail.value)}
@@ -8,7 +8,7 @@
8
8
  import { actionIdentity } from "@serene-pub/sdk/component"
9
9
  import { useConversation } from "./conversation.svelte"
10
10
  import type { MessageV1, WidgetAction } from "@serene-pub/sdk/component"
11
- import { playbackOf } from "./spokenLine"
11
+ import { fileCountLabel, fileCountSr, playbackOf } from "./spokenLine"
12
12
 
13
13
  /**
14
14
  * A message's ⋮ menu: every verb the session offers on it, named in words.
@@ -26,6 +26,8 @@
26
26
  */
27
27
  speech?: {
28
28
  src: string | null
29
+ /** The line's files as the `audio` `playlist` (2+ files); `src` is then not drawn. */
30
+ playlist?: string | null
29
31
  hasAudio: boolean
30
32
  /** A take is on file (even under playback `never`): Read aloud reads Say it again. */
31
33
  sayItAgain?: boolean
@@ -132,6 +134,7 @@
132
134
  canControl,
133
135
  canRerun,
134
136
  canDelete,
137
+ waitFor: conv.dossier?.rerunWaitsFor,
135
138
  extendRefusal,
136
139
  speechReason: conv.dossier?.speech?.canSpeak === false ? conv.dossier.speech.reason : undefined,
137
140
  refOfMember: conv.refOfMember
@@ -164,7 +167,16 @@
164
167
  )
165
168
  /** ⋮ › Speech holds the full player alone: drawn only where there is one. */
166
169
  const speechPlayer = $derived(!!speech?.hasAudio && !!speech.src && speech.playback !== "never")
167
- const reportAt = (e: Event) => conv.speech.reportMenuAt(msg.id, playbackOf((e as CustomEvent).detail))
170
+ /** The file the ⋮ player is on (0-based), off its playhead. */
171
+ let menuFile = $state(0)
172
+ const menuFiles = $derived(speech?.playlist ? speech.playlist.split(" ").length : 1)
173
+ const reportAt = (e: Event) => {
174
+ const at = playbackOf((e as CustomEvent).detail)
175
+ if (at) menuFile = at.playlistIndex ?? 0
176
+ conv.speech.reportMenuAt(msg.id, at)
177
+ }
178
+ const menuCount = $derived(fileCountLabel(menuFile, menuFiles))
179
+ const menuCountSr = $derived(fileCountSr(menuFile, menuFiles))
168
180
  const speechTake = $derived(conv.speech.take(msg.id, "menu"))
169
181
  const menuPlayAttr = $derived(conv.speech.isPlaying(msg.id, "menu") ? { playing: "" } : {})
170
182
  const speakName = (a: WidgetAction) =>
@@ -219,6 +231,9 @@
219
231
  * wrote this reply and opens the inspector (`inspect-run`), or says there
220
232
  * is none.
221
233
  */
234
+ // Inspect run is offered on a reply, and `SessionMessage.svelte` draws an
235
+ // administrator's failure detail under a line only where it is not: the two
236
+ // conditions stay each other's opposite, or the detail shows in neither place.
222
237
  const isReply = $derived(!!msg.characterId || !!msg.isNarratorResponse)
223
238
 
224
239
  /**
@@ -313,7 +328,7 @@
313
328
  </span>
314
329
  {/if}
315
330
  {/each}
316
- {#if conv.dossier?.writes.lore && !msg.isGenerating && conv.select.offered}
331
+ {#if conv.dossier?.isOwner && conv.dossier.writes.lore && !msg.isGenerating && conv.select.offered}
317
332
  <button
318
333
  data-widget-part="messages.message-option"
319
334
  title="Select for summary"
@@ -470,7 +485,8 @@
470
485
  aria-label="Spoken line player"
471
486
  controls
472
487
  preload="none"
473
- src={speech.src}
488
+ src={speech.playlist ? null : speech.src}
489
+ {...(speech.playlist ? { playlist: speech.playlist } : {})}
474
490
  {...menuPlayAttr}
475
491
  onplay={(e) => {
476
492
  reportAt(e)
@@ -488,6 +504,7 @@
488
504
  onloadedmetadata={reportAt}
489
505
  ></audio>
490
506
  {/key}
507
+ {#if menuCount}<span data-widget-part="messages.message-speech-count"><span aria-hidden="true">{menuCount}</span><span data-widget-part="messages.spoken-sr">{menuCountSr}</span></span>{/if}
491
508
  </div>
492
509
  </sp-popover>
493
510
  {/if}
@@ -202,13 +202,13 @@
202
202
  const selectionRefusal = $derived(
203
203
  conversation?.scenes.refusal?.at === "selection" ? conversation.scenes.refusal.text : null
204
204
  )
205
- /** Every line a scene has not already captured. */
206
- const selectable = $derived.by(() => {
205
+ /** Every line a scene has not already captured, worked out when *Select all* is pressed. */
206
+ const selectable = () => {
207
207
  const taken = new Set(conversation?.dossier?.scened ?? [])
208
208
  return ((conversation?.rows ?? []) as Array<{ id: number }>)
209
209
  .map((m) => m.id)
210
210
  .filter((id) => !taken.has(id))
211
- })
211
+ }
212
212
  let settings = $derived.by(() => {
213
213
  const raw = ctx?.current.settings.v1 as Record<string, unknown> | undefined
214
214
  // The claimed channel's role, when the host says it (the dossier's
@@ -244,8 +244,22 @@
244
244
  * its history read. Written by the effect below, never read tracked there.
245
245
  */
246
246
  const seen = new SvelteMap<string, number>()
247
+ /**
248
+ * What the tabs' news reads off a row (`newestNewsOn`): id, channel,
249
+ * userId, role, isHidden, isGenerating — and nothing else. A streamed
250
+ * token that changes none of them reruns neither the effect nor `dots`.
251
+ * Empty without tabs, which read no rows.
252
+ */
253
+ const newsKey = $derived(
254
+ tabs.length
255
+ ? ((conversation?.rows ?? []) as Array<Record<string, unknown>>)
256
+ .map((m) => `${m.id}|${m.channel ?? ""}|${typeof m.userId}:${String(m.userId)}|${m.role ?? "user"}|${m.isHidden ? 1 : 0}|${m.isGenerating ? 1 : 0}`)
257
+ .join(",")
258
+ : ""
259
+ )
247
260
  $effect(() => {
248
- const rows = (conversation?.rows ?? []) as Parameters<typeof newestNewsOn>[0]
261
+ void newsKey
262
+ const rows = untrack(() => (conversation?.rows ?? []) as Parameters<typeof newestNewsOn>[0])
249
263
  for (const tab of tabs) {
250
264
  const newest = newestNewsOn(rows, tab, viewerId)
251
265
  const active = tab === activeTab
@@ -255,9 +269,11 @@
255
269
  }
256
270
  })
257
271
  /** The tabs with a line nobody has shown the viewer yet. */
258
- const dots = $derived(
259
- channelTabDots(tabs, activeTab, (conversation?.rows ?? []) as Parameters<typeof newestNewsOn>[0], viewerId, seen)
260
- )
272
+ const dots = $derived.by(() => {
273
+ void newsKey
274
+ const rows = untrack(() => (conversation?.rows ?? []) as Parameters<typeof newestNewsOn>[0])
275
+ return channelTabDots(tabs, activeTab, rows, viewerId, seen)
276
+ })
261
277
  /** A tab's name, said with its news to a screen reader (the trigger's own label). */
262
278
  const tabLabel = (slug: string) =>
263
279
  `${conversation?.channelName(slug) ?? slug}${dots.has(slug) ? " (new lines)" : ""}`
@@ -391,7 +407,7 @@
391
407
  <button
392
408
  data-widget-part="messages.select-all messages.selection-button"
393
409
  title="Select all"
394
- onclick={() => conversation.select.set(selectable)}
410
+ onclick={() => conversation.select.set(selectable())}
395
411
  >
396
412
  <sp-icon name="check-square" size="16"></sp-icon>
397
413
  <span data-widget-part="messages.selection-button-label">Select all</span>