@dsh-agentic-roleplay/core 0.12.5 → 0.12.7

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 (35) hide show
  1. package/lib/{access-DjA0kvPM.js → access-5vtPAT3O.js} +2 -2
  2. package/lib/{authoring-tools-DqAttdUN.js → authoring-tools-Bi9YQ9QH.js} +52 -18
  3. package/lib/authoring.js +228 -35
  4. package/lib/{child-SMvjNsb8.js → child-Bfj7-Iuo.js} +11 -13
  5. package/lib/client.js +910 -526
  6. package/lib/client.js.map +1 -1
  7. package/lib/compaction.js +4 -4
  8. package/lib/doctor.js +3 -3
  9. package/lib/{library-D6AcyxGZ.js → gallery-BT5lf-T5.js} +212 -7
  10. package/lib/helper.js +2 -2
  11. package/lib/{hooks-OLl-1AOS.js → hooks-DR-HqE50.js} +6 -4
  12. package/lib/images.js +3 -4
  13. package/lib/index.js +131 -23
  14. package/lib/{presenter-agent-CGCJrg7V.js → interpreter-BYNrjYZo.js} +155 -64
  15. package/lib/{jail-CDW5iymd.js → jail-D83JnxKg.js} +2 -2
  16. package/lib/{lorebook-author-tools-CXV1KD4Q.js → lorebook-author-tools-BI-r8fEt.js} +6 -6
  17. package/lib/lorebook-authoring.js +5 -5
  18. package/lib/{narration-Bnrvl0UQ.js → narration-CUZIXzab.js} +9 -3
  19. package/lib/orchestration.js +59 -19
  20. package/lib/{pack-jail-CZAmlgE1.js → pack-jail-Y1XPbqHw.js} +20 -14
  21. package/lib/{packs-DUVCSHqi.js → packs-DD-v-Epl.js} +2 -2
  22. package/lib/presenter-agent-00sOVGI9.js +59 -0
  23. package/lib/{preset-BYfXYvp0.js → preset-Bnx3jhUv.js} +4 -4
  24. package/lib/{preset-author-tools-DYxTLm9U.js → preset-author-tools-DYrBcieA.js} +6 -6
  25. package/lib/preset-authoring.js +5 -5
  26. package/lib/{reflection-C3zdufN9.js → reflection-DqxoV9xE.js} +10 -9
  27. package/lib/{serial-Bh6gqb3f.js → serial-CS46qAvI.js} +57 -11
  28. package/lib/{turn-guard-CNFvmz_F.js → turn-guard-bZkxzRXJ.js} +3 -3
  29. package/package.json +32 -31
  30. package/prompts/en/import/finish-ok.md +2 -0
  31. package/prompts/en/roleplay/image-worth.md +5 -0
  32. package/prompts/zh/import/finish-ok.md +2 -0
  33. package/prompts/zh/roleplay/image-worth.md +5 -0
  34. package/lib/gallery-Dahi5TkO.js +0 -190
  35. package/lib/generator-BvSZGpzy.js +0 -150
package/lib/client.js CHANGED
@@ -470,9 +470,9 @@ window.__ModuleLoader__.load({
470
470
  tag$52.textContent = css$52;
471
471
  var RoleplayPanel_module_css_default = {
472
472
  "title": "rp_ua5gBa_title",
473
- "header": "rp_ua5gBa_header",
474
473
  "panel": "rp_ua5gBa_panel",
475
- "body": "rp_ua5gBa_body"
474
+ "body": "rp_ua5gBa_body",
475
+ "header": "rp_ua5gBa_header"
476
476
  };
477
477
  // src/client/panel/RoleplayPanel.tsx
478
478
  /** Header, page navigation and the selected page. */
@@ -906,14 +906,14 @@ window.__ModuleLoader__.load({
906
906
  }
907
907
  tag$51.textContent = css$51;
908
908
  var Button_module_css_default = {
909
+ "rpSm": "rp_wwotfa_rpSm",
910
+ "rpIcon": "rp_wwotfa_rpIcon",
911
+ "rpOutline": "rp_wwotfa_rpOutline",
909
912
  "rpGhost": "rp_wwotfa_rpGhost",
910
- "rpToolbar": "rp_wwotfa_rpToolbar",
911
- "rpButton": "rp_wwotfa_rpButton",
912
913
  "rpMd": "rp_wwotfa_rpMd",
913
- "rpSm": "rp_wwotfa_rpSm",
914
914
  "rpPrimary": "rp_wwotfa_rpPrimary",
915
- "rpOutline": "rp_wwotfa_rpOutline",
916
- "rpIcon": "rp_wwotfa_rpIcon"
915
+ "rpToolbar": "rp_wwotfa_rpToolbar",
916
+ "rpButton": "rp_wwotfa_rpButton"
917
917
  };
918
918
  // src/client/ui/Button.tsx
919
919
  /** Render a button; native button attributes pass through, and `icon` is a leading 16px node. */
@@ -1180,8 +1180,8 @@ window.__ModuleLoader__.load({
1180
1180
  }
1181
1181
  tag$47.textContent = css$47;
1182
1182
  var Input_module_css_default = {
1183
- "rpInputIcon": "rp_QU88dW_rpInputIcon",
1184
1183
  "rpInput": "rp_QU88dW_rpInput",
1184
+ "rpInputIcon": "rp_QU88dW_rpInputIcon",
1185
1185
  "rpInputWrap": "rp_QU88dW_rpInputWrap"
1186
1186
  };
1187
1187
  // src/client/ui/Input.tsx
@@ -1273,34 +1273,34 @@ window.__ModuleLoader__.load({
1273
1273
  }
1274
1274
  tag$45.textContent = css$45;
1275
1275
  var ImportCard_module_css_default = {
1276
- "choice": "rp_5cvtma_choice",
1277
- "choiceText": "rp_5cvtma_choiceText",
1278
1276
  "preview": "rp_5cvtma_preview",
1279
- "space": "rp_5cvtma_space",
1280
- "about": "rp_5cvtma_about",
1277
+ "choice": "rp_5cvtma_choice",
1278
+ "label": "rp_5cvtma_label",
1279
+ "body": "rp_5cvtma_body",
1280
+ "error": "rp_5cvtma_error",
1281
1281
  "page": "rp_5cvtma_page",
1282
+ "field": "rp_5cvtma_field",
1283
+ "about": "rp_5cvtma_about",
1282
1284
  "title": "rp_5cvtma_title",
1283
- "tags": "rp_5cvtma_tags",
1285
+ "text": "rp_5cvtma_text",
1286
+ "heading": "rp_5cvtma_heading",
1284
1287
  "section": "rp_5cvtma_section",
1288
+ "header": "rp_5cvtma_header",
1289
+ "tags": "rp_5cvtma_tags",
1285
1290
  "note": "rp_5cvtma_note",
1286
1291
  "row": "rp_5cvtma_row",
1292
+ "entry": "rp_5cvtma_entry",
1287
1293
  "fieldHead": "rp_5cvtma_fieldHead",
1288
- "fieldTitle": "rp_5cvtma_fieldTitle",
1289
- "error": "rp_5cvtma_error",
1290
- "header": "rp_5cvtma_header",
1291
- "entryHead": "rp_5cvtma_entryHead",
1292
- "noPicture": "rp_5cvtma_noPicture",
1294
+ "space": "rp_5cvtma_space",
1293
1295
  "picture": "rp_5cvtma_picture",
1294
- "entry": "rp_5cvtma_entry",
1296
+ "entryHead": "rp_5cvtma_entryHead",
1297
+ "fieldTitle": "rp_5cvtma_fieldTitle",
1295
1298
  "top": "rp_5cvtma_top",
1299
+ "noPicture": "rp_5cvtma_noPicture",
1296
1300
  "entryTitle": "rp_5cvtma_entryTitle",
1297
1301
  "fieldMeta": "rp_5cvtma_fieldMeta",
1298
1302
  "entryOff": "rp_5cvtma_entryOff",
1299
- "heading": "rp_5cvtma_heading",
1300
- "text": "rp_5cvtma_text",
1301
- "field": "rp_5cvtma_field",
1302
- "label": "rp_5cvtma_label",
1303
- "body": "rp_5cvtma_body"
1303
+ "choiceText": "rp_5cvtma_choiceText"
1304
1304
  };
1305
1305
  // src/client/widgets/import-card/ImportCard.tsx
1306
1306
  const pictureUrl = (id) => `${API_PREFIX}/worlds/import/picture?id=${encodeURIComponent(id)}`;
@@ -1351,6 +1351,7 @@ window.__ModuleLoader__.load({
1351
1351
  const [name, setName] = (0, react.useState)(preview.choices.name);
1352
1352
  const [off, setOff] = (0, react.useState)(() => new Set(preview.choices.disabledEntries));
1353
1353
  const [opening, setOpening] = (0, react.useState)(preview.choices.opening);
1354
+ const [fetchPictures, setFetchPictures] = (0, react.useState)(preview.choices.fetchPictures !== false);
1354
1355
  const [open, setOpen] = (0, react.useState)(/* @__PURE__ */ new Set());
1355
1356
  const [update, setUpdate] = (0, react.useState)(() => initialUpdate ?? defaultTarget(preview.targets));
1356
1357
  const [promptLanguage, setPromptLanguage] = (0, react.useState)(() => primaryLanguage(language));
@@ -1385,7 +1386,8 @@ window.__ModuleLoader__.load({
1385
1386
  const choices = () => ({
1386
1387
  name: name.trim(),
1387
1388
  disabledEntries: [...off],
1388
- opening
1389
+ opening,
1390
+ ...fetchPictures ? {} : { fetchPictures: false }
1389
1391
  });
1390
1392
  const start = () => {
1391
1393
  if (name.trim() === "" || starting) return;
@@ -1714,6 +1716,45 @@ window.__ModuleLoader__.load({
1714
1716
  })
1715
1717
  ]
1716
1718
  }),
1719
+ (card.urls ?? []).length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
1720
+ className: ImportCard_module_css_default.section,
1721
+ "data-testid": "roleplay-import-links",
1722
+ children: [
1723
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", {
1724
+ className: ImportCard_module_css_default.heading,
1725
+ children: t("ic_links")
1726
+ }),
1727
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
1728
+ className: ImportCard_module_css_default.note,
1729
+ children: t("ic_linksHelp", { count: (card.urls ?? []).length })
1730
+ }),
1731
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
1732
+ className: ImportCard_module_css_default.choice,
1733
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
1734
+ type: "checkbox",
1735
+ "aria-label": t("ic_fetchPictures"),
1736
+ checked: fetchPictures,
1737
+ disabled: starting,
1738
+ onChange: (event) => {
1739
+ setFetchPictures(event.target.checked);
1740
+ }
1741
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1742
+ className: ImportCard_module_css_default.choiceText,
1743
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1744
+ className: ImportCard_module_css_default.fieldTitle,
1745
+ children: t("ic_fetchPictures")
1746
+ })
1747
+ })]
1748
+ }),
1749
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("details", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("summary", {
1750
+ className: ImportCard_module_css_default.note,
1751
+ children: t("ic_linksShow")
1752
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", {
1753
+ className: ImportCard_module_css_default.note,
1754
+ children: (card.urls ?? []).map((url) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", { children: url }, url))
1755
+ })] })
1756
+ ]
1757
+ }),
1717
1758
  entries.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
1718
1759
  className: ImportCard_module_css_default.section,
1719
1760
  children: [
@@ -1808,17 +1849,17 @@ window.__ModuleLoader__.load({
1808
1849
  }
1809
1850
  tag$44.textContent = css$44;
1810
1851
  var Modal_module_css_default = {
1811
- "content": "rp_46MuuW_content",
1812
- "description": "rp_46MuuW_description",
1813
1852
  "mask": "rp_46MuuW_mask",
1814
- "root": "rp_46MuuW_root",
1815
- "header": "rp_46MuuW_header",
1853
+ "dialog": "rp_46MuuW_dialog",
1816
1854
  "close": "rp_46MuuW_close",
1817
- "rpModalEnter": "rp_46MuuW_rpModalEnter",
1818
- "title": "rp_46MuuW_title",
1855
+ "content": "rp_46MuuW_content",
1819
1856
  "body": "rp_46MuuW_body",
1857
+ "rpModalEnter": "rp_46MuuW_rpModalEnter",
1858
+ "header": "rp_46MuuW_header",
1859
+ "description": "rp_46MuuW_description",
1820
1860
  "footer": "rp_46MuuW_footer",
1821
- "dialog": "rp_46MuuW_dialog"
1861
+ "root": "rp_46MuuW_root",
1862
+ "title": "rp_46MuuW_title"
1822
1863
  };
1823
1864
  // src/client/ui/Modal.tsx
1824
1865
  const FOCUSABLE = "button:not(:disabled), input:not(:disabled), textarea:not(:disabled), select:not(:disabled), a[href], [tabindex=\"0\"]";
@@ -1955,38 +1996,38 @@ window.__ModuleLoader__.load({
1955
1996
  }
1956
1997
  tag$43.textContent = css$43;
1957
1998
  var CataloguePage_module_css_default = {
1958
- "status": "rp_qK1u-G_status",
1959
- "kind": "rp_qK1u-G_kind",
1960
- "toolbar": "rp_qK1u-G_toolbar",
1961
- "tags": "rp_qK1u-G_tags",
1962
- "form": "rp_qK1u-G_form",
1999
+ "image": "rp_qK1u-G_image",
2000
+ "name": "rp_qK1u-G_name",
2001
+ "detail": "rp_qK1u-G_detail",
2002
+ "grid": "rp_qK1u-G_grid",
1963
2003
  "search": "rp_qK1u-G_search",
1964
- "message": "rp_qK1u-G_message",
2004
+ "actions": "rp_qK1u-G_actions",
2005
+ "notice": "rp_qK1u-G_notice",
1965
2006
  "meta": "rp_qK1u-G_meta",
1966
- "spacer": "rp_qK1u-G_spacer",
1967
- "page": "rp_qK1u-G_page",
1968
- "grid": "rp_qK1u-G_grid",
1969
- "update": "rp_qK1u-G_update",
1970
- "field": "rp_qK1u-G_field",
1971
- "viewport": "rp_qK1u-G_viewport",
1972
2007
  "select": "rp_qK1u-G_select",
1973
- "name": "rp_qK1u-G_name",
1974
- "updates": "rp_qK1u-G_updates",
2008
+ "update": "rp_qK1u-G_update",
2009
+ "changes": "rp_qK1u-G_changes",
2010
+ "page": "rp_qK1u-G_page",
1975
2011
  "cover": "rp_qK1u-G_cover",
1976
- "label": "rp_qK1u-G_label",
1977
- "detail": "rp_qK1u-G_detail",
1978
- "description": "rp_qK1u-G_description",
1979
- "success": "rp_qK1u-G_success",
1980
- "warning": "rp_qK1u-G_warning",
1981
- "notice": "rp_qK1u-G_notice",
1982
2012
  "card": "rp_qK1u-G_card",
1983
- "actions": "rp_qK1u-G_actions",
1984
- "image": "rp_qK1u-G_image",
1985
2013
  "placeholder": "rp_qK1u-G_placeholder",
2014
+ "status": "rp_qK1u-G_status",
2015
+ "success": "rp_qK1u-G_success",
2016
+ "kind": "rp_qK1u-G_kind",
2017
+ "label": "rp_qK1u-G_label",
2018
+ "description": "rp_qK1u-G_description",
2019
+ "form": "rp_qK1u-G_form",
2020
+ "kinds": "rp_qK1u-G_kinds",
1986
2021
  "more": "rp_qK1u-G_more",
2022
+ "message": "rp_qK1u-G_message",
1987
2023
  "body": "rp_qK1u-G_body",
1988
- "changes": "rp_qK1u-G_changes",
1989
- "kinds": "rp_qK1u-G_kinds"
2024
+ "field": "rp_qK1u-G_field",
2025
+ "viewport": "rp_qK1u-G_viewport",
2026
+ "spacer": "rp_qK1u-G_spacer",
2027
+ "toolbar": "rp_qK1u-G_toolbar",
2028
+ "tags": "rp_qK1u-G_tags",
2029
+ "updates": "rp_qK1u-G_updates",
2030
+ "warning": "rp_qK1u-G_warning"
1990
2031
  };
1991
2032
  // src/client/pages/catalogue/ImportUrlDialog.tsx
1992
2033
  /** Installs a world from the address of its archive, or opens the resource a page address of a configured catalogue names; an address on a configured catalogue's site is asked for with that catalogue's key. */
@@ -2190,19 +2231,19 @@ window.__ModuleLoader__.load({
2190
2231
  }
2191
2232
  tag$42.textContent = css$42;
2192
2233
  var ImportSelection_module_css_default = {
2193
- "meta": "rp_Jx0l4q_meta",
2194
- "note": "rp_Jx0l4q_note",
2234
+ "body": "rp_Jx0l4q_body",
2235
+ "row": "rp_Jx0l4q_row",
2195
2236
  "full": "rp_Jx0l4q_full",
2196
- "help": "rp_Jx0l4q_help",
2197
- "sampling": "rp_Jx0l4q_sampling",
2198
- "error": "rp_Jx0l4q_error",
2199
2237
  "count": "rp_Jx0l4q_count",
2200
- "extra": "rp_Jx0l4q_extra",
2201
- "text": "rp_Jx0l4q_text",
2238
+ "note": "rp_Jx0l4q_note",
2239
+ "meta": "rp_Jx0l4q_meta",
2240
+ "error": "rp_Jx0l4q_error",
2241
+ "sampling": "rp_Jx0l4q_sampling",
2242
+ "help": "rp_Jx0l4q_help",
2202
2243
  "bar": "rp_Jx0l4q_bar",
2203
- "body": "rp_Jx0l4q_body",
2204
2244
  "list": "rp_Jx0l4q_list",
2205
- "row": "rp_Jx0l4q_row"
2245
+ "text": "rp_Jx0l4q_text",
2246
+ "extra": "rp_Jx0l4q_extra"
2206
2247
  };
2207
2248
  // src/client/widgets/import-selection/ImportSelection.tsx
2208
2249
  const messageOf$14 = (failure) => failure instanceof Error ? failure.message : String(failure);
@@ -3280,7 +3321,11 @@ window.__ModuleLoader__.load({
3280
3321
  ic_starting: "Starting…",
3281
3322
  ic_startFailed: "Could not start the import: {message}",
3282
3323
  ic_cancel: "Cancel",
3283
- ic_empty: "(empty)"
3324
+ ic_empty: "(empty)",
3325
+ ic_links: "Web addresses",
3326
+ ic_linksHelp: "The card contains {count} web addresses. Those that look like pictures are downloaded into the world's image library while it is imported; nothing else is fetched, and no script of the card is run.",
3327
+ ic_fetchPictures: "Download the pictures these addresses point to",
3328
+ ic_linksShow: "Show the addresses"
3284
3329
  },
3285
3330
  zh: {
3286
3331
  ic_promptLanguage: "提示词语言",
@@ -3333,7 +3378,11 @@ window.__ModuleLoader__.load({
3333
3378
  ic_starting: "正在开始…",
3334
3379
  ic_startFailed: "无法开始导入:{message}",
3335
3380
  ic_cancel: "取消",
3336
- ic_empty: "(空)"
3381
+ ic_empty: "(空)",
3382
+ ic_links: "网址",
3383
+ ic_linksHelp: "这张卡片包含 {count} 个网址。导入时,看起来是图片的会下载到世界的图片库;其他内容一概不会获取,卡片里的脚本也不会运行。",
3384
+ ic_fetchPictures: "下载这些网址指向的图片",
3385
+ ic_linksShow: "显示网址"
3337
3386
  },
3338
3387
  ja: {
3339
3388
  ic_promptLanguage: "プロンプトの言語",
@@ -3386,7 +3435,11 @@ window.__ModuleLoader__.load({
3386
3435
  ic_starting: "開始中…",
3387
3436
  ic_startFailed: "読み込みを開始できませんでした:{message}",
3388
3437
  ic_cancel: "キャンセル",
3389
- ic_empty: "(空)"
3438
+ ic_empty: "(空)",
3439
+ ic_links: "Web アドレス",
3440
+ ic_linksHelp: "このカードには {count} 件の Web アドレスがあります。画像のように見えるものは、読み込み中にワールドの画像ライブラリへダウンロードされます。それ以外は取得せず、カードのスクリプトも実行しません。",
3441
+ ic_fetchPictures: "これらのアドレスが指す画像をダウンロードする",
3442
+ ic_linksShow: "アドレスを表示"
3390
3443
  },
3391
3444
  es: {
3392
3445
  ic_promptLanguage: "Idioma de las instrucciones",
@@ -3439,7 +3492,11 @@ window.__ModuleLoader__.load({
3439
3492
  ic_starting: "Iniciando…",
3440
3493
  ic_startFailed: "No se ha podido iniciar la importación: {message}",
3441
3494
  ic_cancel: "Cancelar",
3442
- ic_empty: "(vacío)"
3495
+ ic_empty: "(vacío)",
3496
+ ic_links: "Direcciones web",
3497
+ ic_linksHelp: "La tarjeta contiene {count} direcciones web. Las que parecen imágenes se descargan en la biblioteca de imágenes del mundo durante la importación; no se obtiene nada más y no se ejecuta ningún script de la tarjeta.",
3498
+ ic_fetchPictures: "Descargar las imágenes a las que apuntan estas direcciones",
3499
+ ic_linksShow: "Mostrar las direcciones"
3443
3500
  },
3444
3501
  fr: {
3445
3502
  ic_promptLanguage: "Langue des instructions",
@@ -3492,7 +3549,11 @@ window.__ModuleLoader__.load({
3492
3549
  ic_starting: "Démarrage…",
3493
3550
  ic_startFailed: "Impossible de démarrer l’importation : {message}",
3494
3551
  ic_cancel: "Annuler",
3495
- ic_empty: "(vide)"
3552
+ ic_empty: "(vide)",
3553
+ ic_links: "Adresses web",
3554
+ ic_linksHelp: "La carte contient {count} adresses web. Celles qui ressemblent à des images sont téléchargées dans la bibliothèque d’images du monde pendant l’importation ; rien d’autre n’est récupéré et aucun script de la carte n’est exécuté.",
3555
+ ic_fetchPictures: "Télécharger les images vers lesquelles ces adresses pointent",
3556
+ ic_linksShow: "Afficher les adresses"
3496
3557
  },
3497
3558
  de: {
3498
3559
  ic_promptLanguage: "Sprache der Anweisungen",
@@ -3545,7 +3606,11 @@ window.__ModuleLoader__.load({
3545
3606
  ic_starting: "Wird gestartet…",
3546
3607
  ic_startFailed: "Der Import konnte nicht gestartet werden: {message}",
3547
3608
  ic_cancel: "Abbrechen",
3548
- ic_empty: "(leer)"
3609
+ ic_empty: "(leer)",
3610
+ ic_links: "Webadressen",
3611
+ ic_linksHelp: "Die Karte enthält {count} Webadressen. Solche, die nach Bildern aussehen, werden beim Import in die Bildbibliothek der Welt heruntergeladen; sonst wird nichts abgerufen, und kein Skript der Karte wird ausgeführt.",
3612
+ ic_fetchPictures: "Bilder herunterladen, auf die diese Adressen zeigen",
3613
+ ic_linksShow: "Adressen anzeigen"
3549
3614
  },
3550
3615
  ru: {
3551
3616
  ic_promptLanguage: "Язык инструкций",
@@ -3598,7 +3663,11 @@ window.__ModuleLoader__.load({
3598
3663
  ic_starting: "Запуск…",
3599
3664
  ic_startFailed: "Не удалось запустить импорт: {message}",
3600
3665
  ic_cancel: "Отмена",
3601
- ic_empty: "(пусто)"
3666
+ ic_empty: "(пусто)",
3667
+ ic_links: "Веб-адреса",
3668
+ ic_linksHelp: "В карточке {count} веб-адресов. Те, что похожи на изображения, при импорте загружаются в библиотеку изображений мира; ничего другого не запрашивается, и скрипты карточки не выполняются.",
3669
+ ic_fetchPictures: "Загружать изображения, на которые указывают эти адреса",
3670
+ ic_linksShow: "Показать адреса"
3602
3671
  },
3603
3672
  pt: {
3604
3673
  ic_promptLanguage: "Idioma das instruções",
@@ -3651,7 +3720,11 @@ window.__ModuleLoader__.load({
3651
3720
  ic_starting: "A iniciar…",
3652
3721
  ic_startFailed: "Não foi possível iniciar a importação: {message}",
3653
3722
  ic_cancel: "Cancelar",
3654
- ic_empty: "(vazio)"
3723
+ ic_empty: "(vazio)",
3724
+ ic_links: "Endereços web",
3725
+ ic_linksHelp: "O cartão contém {count} endereços web. Os que parecem imagens são transferidos para a biblioteca de imagens do mundo durante a importação; nada mais é obtido e nenhum script do cartão é executado.",
3726
+ ic_fetchPictures: "Transferir as imagens para as quais estes endereços apontam",
3727
+ ic_linksShow: "Mostrar os endereços"
3655
3728
  }
3656
3729
  };
3657
3730
  // src/client/widgets/import-selection/locales.ts
@@ -5319,46 +5392,46 @@ window.__ModuleLoader__.load({
5319
5392
  }
5320
5393
  tag$41.textContent = css$41;
5321
5394
  var CharactersPanel_module_css_default = {
5322
- "tabOn": "rp_5ZMIxq_tabOn",
5395
+ "itemActions": "rp_5ZMIxq_itemActions",
5396
+ "placeholder": "rp_5ZMIxq_placeholder",
5397
+ "bar": "rp_5ZMIxq_bar",
5398
+ "help": "rp_5ZMIxq_help",
5399
+ "head": "rp_5ZMIxq_head",
5400
+ "nameInput": "rp_5ZMIxq_nameInput",
5401
+ "barText": "rp_5ZMIxq_barText",
5402
+ "panel": "rp_5ZMIxq_panel",
5403
+ "tab": "rp_5ZMIxq_tab",
5323
5404
  "initial": "rp_5ZMIxq_initial",
5405
+ "optionFields": "rp_5ZMIxq_optionFields",
5406
+ "questionActions": "rp_5ZMIxq_questionActions",
5324
5407
  "area": "rp_5ZMIxq_area",
5325
- "portraitAction": "rp_5ZMIxq_portraitAction",
5326
- "portrait": "rp_5ZMIxq_portrait",
5327
5408
  "label": "rp_5ZMIxq_label",
5328
- "missing": "rp_5ZMIxq_missing",
5329
- "itemActions": "rp_5ZMIxq_itemActions",
5330
- "nameInput": "rp_5ZMIxq_nameInput",
5331
- "empty": "rp_5ZMIxq_empty",
5332
- "help": "rp_5ZMIxq_help",
5333
5409
  "optionTitle": "rp_5ZMIxq_optionTitle",
5334
- "section": "rp_5ZMIxq_section",
5335
5410
  "voiceInline": "rp_5ZMIxq_voiceInline",
5336
- "wide": "rp_5ZMIxq_wide",
5337
- "panel": "rp_5ZMIxq_panel",
5338
- "optionFields": "rp_5ZMIxq_optionFields",
5339
- "tabs": "rp_5ZMIxq_tabs",
5340
- "select": "rp_5ZMIxq_select",
5341
- "portraitHint": "rp_5ZMIxq_portraitHint",
5342
- "meta": "rp_5ZMIxq_meta",
5343
- "row": "rp_5ZMIxq_row",
5344
5411
  "error": "rp_5ZMIxq_error",
5412
+ "missing": "rp_5ZMIxq_missing",
5413
+ "select": "rp_5ZMIxq_select",
5414
+ "portraitAction": "rp_5ZMIxq_portraitAction",
5345
5415
  "tabsSpace": "rp_5ZMIxq_tabsSpace",
5346
- "sectionTitle": "rp_5ZMIxq_sectionTitle",
5347
- "questionActions": "rp_5ZMIxq_questionActions",
5348
- "tab": "rp_5ZMIxq_tab",
5349
- "bar": "rp_5ZMIxq_bar",
5350
- "question": "rp_5ZMIxq_question",
5351
- "sheet": "rp_5ZMIxq_sheet",
5352
- "placeholder": "rp_5ZMIxq_placeholder",
5353
- "questionTitle": "rp_5ZMIxq_questionTitle",
5416
+ "section": "rp_5ZMIxq_section",
5417
+ "empty": "rp_5ZMIxq_empty",
5354
5418
  "grid": "rp_5ZMIxq_grid",
5355
- "portraitBox": "rp_5ZMIxq_portraitBox",
5356
- "barText": "rp_5ZMIxq_barText",
5419
+ "question": "rp_5ZMIxq_question",
5357
5420
  "field": "rp_5ZMIxq_field",
5421
+ "portraitHint": "rp_5ZMIxq_portraitHint",
5358
5422
  "goal": "rp_5ZMIxq_goal",
5423
+ "portraitBox": "rp_5ZMIxq_portraitBox",
5424
+ "sectionTitle": "rp_5ZMIxq_sectionTitle",
5425
+ "tabOn": "rp_5ZMIxq_tabOn",
5359
5426
  "body": "rp_5ZMIxq_body",
5427
+ "questionTitle": "rp_5ZMIxq_questionTitle",
5428
+ "row": "rp_5ZMIxq_row",
5429
+ "wide": "rp_5ZMIxq_wide",
5360
5430
  "portraitError": "rp_5ZMIxq_portraitError",
5361
- "head": "rp_5ZMIxq_head"
5431
+ "tabs": "rp_5ZMIxq_tabs",
5432
+ "portrait": "rp_5ZMIxq_portrait",
5433
+ "meta": "rp_5ZMIxq_meta",
5434
+ "sheet": "rp_5ZMIxq_sheet"
5362
5435
  };
5363
5436
  // src/client/world-editor/EditorTabs.tsx
5364
5437
  /** Adds expected arrow, Home and End navigation to an existing editor tab strip. */
@@ -7077,39 +7150,39 @@ window.__ModuleLoader__.load({
7077
7150
  }
7078
7151
  tag$40.textContent = css$40;
7079
7152
  var RelationsPanel_module_css_default = {
7080
- "graphEdge": "rp_7pEHTW_graphEdge",
7081
- "empty": "rp_7pEHTW_empty",
7082
- "edge": "rp_7pEHTW_edge",
7083
- "head": "rp_7pEHTW_head",
7084
- "edgeOn": "rp_7pEHTW_edgeOn",
7085
- "actions": "rp_7pEHTW_actions",
7086
- "check": "rp_7pEHTW_check",
7087
- "filter": "rp_7pEHTW_filter",
7088
- "error": "rp_7pEHTW_error",
7153
+ "filterOn": "rp_7pEHTW_filterOn",
7089
7154
  "workspace": "rp_7pEHTW_workspace",
7090
- "notice": "rp_7pEHTW_notice",
7155
+ "node": "rp_7pEHTW_node",
7156
+ "list": "rp_7pEHTW_list",
7157
+ "edgeKind": "rp_7pEHTW_edgeKind",
7091
7158
  "node_location": "rp_7pEHTW_node_location",
7092
- "node_item": "rp_7pEHTW_node_item",
7093
- "filterOn": "rp_7pEHTW_filterOn",
7094
- "perspective": "rp_7pEHTW_perspective",
7159
+ "form": "rp_7pEHTW_form",
7095
7160
  "entities": "rp_7pEHTW_entities",
7096
- "status": "rp_7pEHTW_status",
7097
- "list": "rp_7pEHTW_list",
7098
- "wide": "rp_7pEHTW_wide",
7099
- "node": "rp_7pEHTW_node",
7100
- "graphEdgeOn": "rp_7pEHTW_graphEdgeOn",
7101
- "graphInspector": "rp_7pEHTW_graphInspector",
7161
+ "actions": "rp_7pEHTW_actions",
7102
7162
  "toolbar": "rp_7pEHTW_toolbar",
7103
- "panel": "rp_7pEHTW_panel",
7104
- "edgeKind": "rp_7pEHTW_edgeKind",
7105
- "metrics": "rp_7pEHTW_metrics",
7163
+ "graphEdgeOn": "rp_7pEHTW_graphEdgeOn",
7106
7164
  "edgeTitle": "rp_7pEHTW_edgeTitle",
7107
- "space": "rp_7pEHTW_space",
7108
- "form": "rp_7pEHTW_form",
7109
7165
  "node_faction": "rp_7pEHTW_node_faction",
7166
+ "check": "rp_7pEHTW_check",
7110
7167
  "inspector": "rp_7pEHTW_inspector",
7168
+ "empty": "rp_7pEHTW_empty",
7169
+ "graphInspector": "rp_7pEHTW_graphInspector",
7170
+ "edgeOn": "rp_7pEHTW_edgeOn",
7171
+ "filter": "rp_7pEHTW_filter",
7172
+ "node_item": "rp_7pEHTW_node_item",
7173
+ "space": "rp_7pEHTW_space",
7174
+ "status": "rp_7pEHTW_status",
7175
+ "notice": "rp_7pEHTW_notice",
7176
+ "node_character": "rp_7pEHTW_node_character",
7111
7177
  "graph": "rp_7pEHTW_graph",
7112
- "node_character": "rp_7pEHTW_node_character"
7178
+ "perspective": "rp_7pEHTW_perspective",
7179
+ "head": "rp_7pEHTW_head",
7180
+ "edge": "rp_7pEHTW_edge",
7181
+ "wide": "rp_7pEHTW_wide",
7182
+ "graphEdge": "rp_7pEHTW_graphEdge",
7183
+ "error": "rp_7pEHTW_error",
7184
+ "panel": "rp_7pEHTW_panel",
7185
+ "metrics": "rp_7pEHTW_metrics"
7113
7186
  };
7114
7187
  // src/client/world-editor/RelationsPanel.tsx
7115
7188
  const title = (relation) => `${relation.from.name} → ${relation.to.name}`;
@@ -8479,11 +8552,11 @@ window.__ModuleLoader__.load({
8479
8552
  tag$39.textContent = css$39;
8480
8553
  var PackFrame_module_css_default = {
8481
8554
  "fill": "rp_h_sbFq_fill",
8482
- "message": "rp_h_sbFq_message",
8555
+ "frame": "rp_h_sbFq_frame",
8483
8556
  "problems": "rp_h_sbFq_problems",
8484
- "tab": "rp_h_sbFq_tab",
8485
8557
  "hud": "rp_h_sbFq_hud",
8486
- "frame": "rp_h_sbFq_frame"
8558
+ "message": "rp_h_sbFq_message",
8559
+ "tab": "rp_h_sbFq_tab"
8487
8560
  };
8488
8561
  // src/client/widgets/pack-frame/theme.ts
8489
8562
  /** The colours of DSH a surface is given, so that it looks right in light and dark. */
@@ -8745,13 +8818,13 @@ window.__ModuleLoader__.load({
8745
8818
  }
8746
8819
  tag$38.textContent = css$38;
8747
8820
  var PacksPanel_module_css_default = {
8748
- "stage": "rp_FLaP7q_stage",
8749
- "group": "rp_FLaP7q_group",
8750
- "controls": "rp_FLaP7q_controls",
8751
- "stageTall": "rp_FLaP7q_stageTall",
8752
8821
  "files": "rp_FLaP7q_files",
8822
+ "log": "rp_FLaP7q_log",
8753
8823
  "note": "rp_FLaP7q_note",
8754
- "log": "rp_FLaP7q_log"
8824
+ "stageTall": "rp_FLaP7q_stageTall",
8825
+ "group": "rp_FLaP7q_group",
8826
+ "stage": "rp_FLaP7q_stage",
8827
+ "controls": "rp_FLaP7q_controls"
8755
8828
  };
8756
8829
  // src/client/world-editor/PacksPanel.tsx
8757
8830
  const WIDTHS = {
@@ -9644,13 +9717,107 @@ window.__ModuleLoader__.load({
9644
9717
  });
9645
9718
  }
9646
9719
  // src/shared/opening.ts
9647
- /** Whether any part is spoken by a character: an opening with none is only narration, which a plain text says as well. */
9648
- const hasSpeech = (parts) => parts.some((part) => part.type === "utterance");
9720
+ /** The words of an opening as one text: its parts, a blank line between. */
9721
+ const partsText = (parts) => parts.flatMap((part) => part.type === "image" ? [] : [part.text]).join("\n\n");
9722
+ /** The folders of a world's `images/` that a story starts with a copy of; an opening may show a picture from any of them. */
9723
+ const IMAGE_FOLDERS = [
9724
+ "library",
9725
+ "characters",
9726
+ "locations",
9727
+ "items",
9728
+ "global"
9729
+ ];
9730
+ /** Whether a path names a picture of a world's `images/` that its stories carry: relative, in one of the copied folders, with no dot segments and no backslashes. */
9731
+ function isImagePath(path) {
9732
+ const segments = path.split("/");
9733
+ const extension = /\.([a-z0-9]+)$/i.exec(path)?.[1]?.toLowerCase();
9734
+ const served = extension === "png" || segments[0] === "library" && [
9735
+ "jpg",
9736
+ "jpeg",
9737
+ "webp",
9738
+ "gif",
9739
+ "avif"
9740
+ ].includes(extension ?? "");
9741
+ return path.length <= 300 && served && !path.includes("\\") && segments.length >= 2 && IMAGE_FOLDERS.includes(segments[0]) && segments.every((segment) => segment !== "" && segment !== "." && segment !== "..");
9742
+ }
9743
+ // src/client/widgets/gallery-view/gallery-api.ts
9744
+ const route = (target, path = "") => `${API_PREFIX}/${target.kind}/gallery${path}?id=${encodeURIComponent(target.id)}`;
9745
+ async function failure$1(response) {
9746
+ const body = await response.json().catch(() => void 0);
9747
+ return new Error(typeof body?.message === "string" ? body.message : `${response.status} ${response.statusText}`.trim());
9748
+ }
9749
+ async function loadGallery(target, signal) {
9750
+ const response = await fetch(route(target), {
9751
+ credentials: "same-origin",
9752
+ signal
9753
+ });
9754
+ if (!response.ok) throw await failure$1(response);
9755
+ return await response.json();
9756
+ }
9757
+ /** Adds a picture to the library. @returns its path. */
9758
+ async function uploadImage(target, file, signal) {
9759
+ const response = await fetch(route(target, "/upload"), {
9760
+ method: "POST",
9761
+ credentials: "same-origin",
9762
+ headers: {
9763
+ "x-file-name": encodeURIComponent(file.name),
9764
+ "content-type": "application/octet-stream"
9765
+ },
9766
+ body: file,
9767
+ signal
9768
+ });
9769
+ if (!response.ok) throw await failure$1(response);
9770
+ return (await response.json()).path;
9771
+ }
9772
+ async function updateImage(target, path, update, signal) {
9773
+ const response = await fetch(`${route(target)}&path=${encodeURIComponent(path)}`, {
9774
+ method: "PUT",
9775
+ credentials: "same-origin",
9776
+ headers: { "content-type": "application/json" },
9777
+ body: JSON.stringify(update),
9778
+ signal
9779
+ });
9780
+ if (!response.ok) throw await failure$1(response);
9781
+ return await response.json();
9782
+ }
9783
+ /** Has a model that reads images describe a picture of a world, replacing its description, tags and subjects. */
9784
+ async function describeImage(target, path, signal) {
9785
+ const response = await fetch(`${route(target, "/describe")}&path=${encodeURIComponent(path)}`, {
9786
+ method: "POST",
9787
+ credentials: "same-origin",
9788
+ signal
9789
+ });
9790
+ if (!response.ok) throw await failure$1(response);
9791
+ return await response.json();
9792
+ }
9793
+ const imageUrl = (target, image) => `${route(target, "/file")}&path=${encodeURIComponent(image.path)}&v=${encodeURIComponent(image.createdAt)}`;
9649
9794
  // src/client/world-editor/OpeningEditor.tsx
9650
- const words$1 = (parts) => parts.map((part) => part.text).join("\n\n");
9795
+ const words$1 = partsText;
9796
+ /** What a picture is called in a list: what it shows, else the name it was added under, else its path. */
9797
+ const nameOf$1 = (image) => image.description?.trim().slice(0, 70) || image.originalName || image.path;
9651
9798
  /** An opening, as plain narration or as ordered parts of narration and spoken lines; the person chooses the form and nothing is converted behind their back. */
9652
- function OpeningEditor({ t, value, characters, rows = 6, onChange }) {
9799
+ function OpeningEditor({ t, value, characters, worldId, rows = 6, onChange }) {
9653
9800
  const parts = value.parts;
9801
+ const [pictures, setPictures] = (0, react.useState)([]);
9802
+ const target = worldId === void 0 ? void 0 : {
9803
+ kind: "worlds",
9804
+ id: worldId
9805
+ };
9806
+ (0, react.useEffect)(() => {
9807
+ if (worldId === void 0) return;
9808
+ const abort = new AbortController();
9809
+ loadGallery({
9810
+ kind: "worlds",
9811
+ id: worldId
9812
+ }, abort.signal).then((contents) => {
9813
+ setPictures(contents.images.filter((image) => image.unreadable !== true && isImagePath(image.path)));
9814
+ }, () => {
9815
+ setPictures([]);
9816
+ });
9817
+ return () => {
9818
+ abort.abort();
9819
+ };
9820
+ }, [worldId]);
9654
9821
  if (parts === void 0) return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
9655
9822
  className: CharactersPanel_module_css_default.wide,
9656
9823
  children: [
@@ -9705,7 +9872,77 @@ window.__ModuleLoader__.load({
9705
9872
  className: CharactersPanel_module_css_default.help,
9706
9873
  children: t("op_partsHelp")
9707
9874
  }),
9708
- parts.map((part, at) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
9875
+ parts.map((part, at) => part.type === "image" ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
9876
+ className: CharactersPanel_module_css_default.grid,
9877
+ "data-testid": "roleplay-opening-picture",
9878
+ children: [
9879
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
9880
+ className: CharactersPanel_module_css_default.field,
9881
+ children: [
9882
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
9883
+ className: CharactersPanel_module_css_default.label,
9884
+ children: t("op_picture")
9885
+ }),
9886
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("select", {
9887
+ className: CharactersPanel_module_css_default.select,
9888
+ value: part.path,
9889
+ onChange: (event) => {
9890
+ change(at, {
9891
+ type: "image",
9892
+ path: event.target.value
9893
+ });
9894
+ },
9895
+ children: [!pictures.some((image) => image.path === part.path) && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
9896
+ value: part.path,
9897
+ children: part.path
9898
+ }), pictures.map((image) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
9899
+ value: image.path,
9900
+ children: nameOf$1(image)
9901
+ }, image.path))]
9902
+ }),
9903
+ !pictures.some((image) => image.path === part.path) && pictures.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
9904
+ className: CharactersPanel_module_css_default.help,
9905
+ children: t("op_pictureMissing")
9906
+ })
9907
+ ]
9908
+ }),
9909
+ target !== void 0 && pictures.find((image) => image.path === part.path) !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("img", {
9910
+ src: imageUrl(target, pictures.find((image) => image.path === part.path)),
9911
+ alt: "",
9912
+ style: {
9913
+ maxHeight: 72,
9914
+ maxWidth: 128,
9915
+ objectFit: "cover"
9916
+ }
9917
+ }),
9918
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
9919
+ variant: "ghost",
9920
+ size: "sm",
9921
+ disabled: at === 0,
9922
+ onClick: () => {
9923
+ move(at, -1);
9924
+ },
9925
+ children: t("op_up")
9926
+ }),
9927
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
9928
+ variant: "ghost",
9929
+ size: "sm",
9930
+ disabled: at === parts.length - 1,
9931
+ onClick: () => {
9932
+ move(at, 1);
9933
+ },
9934
+ children: t("op_down")
9935
+ }),
9936
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
9937
+ variant: "ghost",
9938
+ size: "sm",
9939
+ onClick: () => {
9940
+ set(parts.filter((_, index) => index !== at));
9941
+ },
9942
+ children: t("op_remove")
9943
+ })
9944
+ ]
9945
+ }, at) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
9709
9946
  className: CharactersPanel_module_css_default.grid,
9710
9947
  children: [
9711
9948
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
@@ -9814,8 +10051,21 @@ window.__ModuleLoader__.load({
9814
10051
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
9815
10052
  variant: "ghost",
9816
10053
  size: "sm",
9817
- disabled: hasSpeech(parts),
9818
- title: hasSpeech(parts) ? t("op_toPlainBlocked") : void 0,
10054
+ disabled: worldId === void 0 || pictures.length === 0,
10055
+ title: pictures.length === 0 ? t("op_noPictures") : t("op_choosePicture"),
10056
+ onClick: () => {
10057
+ set([...parts, {
10058
+ type: "image",
10059
+ path: pictures[0].path
10060
+ }]);
10061
+ },
10062
+ children: t("op_addImage")
10063
+ }),
10064
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
10065
+ variant: "ghost",
10066
+ size: "sm",
10067
+ disabled: parts.some((part) => part.type !== "narration"),
10068
+ title: parts.some((part) => part.type !== "narration") ? t("op_toPlainBlockedMore") : void 0,
9819
10069
  onClick: () => {
9820
10070
  onChange({ text: words$1(parts) });
9821
10071
  },
@@ -10027,12 +10277,12 @@ window.__ModuleLoader__.load({
10027
10277
  }
10028
10278
  tag$37.textContent = css$37;
10029
10279
  var SamplingFields_module_css_default = {
10030
- "grid": "rp_9vxYSG_grid",
10031
- "field": "rp_9vxYSG_field",
10280
+ "root": "rp_9vxYSG_root",
10032
10281
  "input": "rp_9vxYSG_input",
10033
10282
  "label": "rp_9vxYSG_label",
10034
- "help": "rp_9vxYSG_help",
10035
- "root": "rp_9vxYSG_root"
10283
+ "grid": "rp_9vxYSG_grid",
10284
+ "field": "rp_9vxYSG_field",
10285
+ "help": "rp_9vxYSG_help"
10036
10286
  };
10037
10287
  // src/client/widgets/sampling-fields/SamplingFields.tsx
10038
10288
  const samplingTexts = (sampling) => Object.fromEntries(SAMPLING_KEYS.map((key) => [key, sampling[key]?.toString() ?? ""]));
@@ -10463,7 +10713,7 @@ window.__ModuleLoader__.load({
10463
10713
  title: entry.title.trim(),
10464
10714
  ...entry.parts === void 0 ? { text: entry.text.trim() } : { parts: entry.parts },
10465
10715
  ...(entry.character ?? "") === "" ? {} : { character: entry.character }
10466
- })).filter((entry) => "text" in entry ? entry.text !== "" : entry.parts.some((part) => part.text.trim() !== ""));
10716
+ })).filter((entry) => "text" in entry ? entry.text !== "" : entry.parts.some((part) => part.type === "image" || part.text.trim() !== ""));
10467
10717
  if (JSON.stringify(cleaned(draft.alternates)) !== JSON.stringify(cleaned(saved.alternates))) edit["alternateOpenings"] = cleaned(draft.alternates);
10468
10718
  if (JSON.stringify(questionsOfDraft(draft.questions)) !== JSON.stringify(questionsOfDraft(saved.questions))) edit["startQuestions"] = questionsOfDraft(draft.questions);
10469
10719
  return edit;
@@ -10649,6 +10899,7 @@ window.__ModuleLoader__.load({
10649
10899
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)(OpeningEditor, {
10650
10900
  t,
10651
10901
  characters: cast,
10902
+ worldId,
10652
10903
  rows: 8,
10653
10904
  value: {
10654
10905
  text: draft.opening,
@@ -10712,6 +10963,7 @@ window.__ModuleLoader__.load({
10712
10963
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(OpeningEditor, {
10713
10964
  t,
10714
10965
  characters: cast,
10966
+ worldId,
10715
10967
  rows: 5,
10716
10968
  value: {
10717
10969
  text: entry.text,
@@ -11885,16 +12137,16 @@ window.__ModuleLoader__.load({
11885
12137
  tag$36.textContent = css$36;
11886
12138
  var ToolSwitches_module_css_default = {
11887
12139
  "tool": "rp_CjoFLq_tool",
12140
+ "help": "rp_CjoFLq_help",
12141
+ "error": "rp_CjoFLq_error",
11888
12142
  "root": "rp_CjoFLq_root",
11889
- "agentName": "rp_CjoFLq_agentName",
11890
12143
  "toolText": "rp_CjoFLq_toolText",
11891
- "default": "rp_CjoFLq_default",
11892
- "help": "rp_CjoFLq_help",
11893
12144
  "agent": "rp_CjoFLq_agent",
11894
- "error": "rp_CjoFLq_error",
11895
- "title": "rp_CjoFLq_title",
11896
12145
  "hint": "rp_CjoFLq_hint",
11897
- "external": "rp_CjoFLq_external"
12146
+ "default": "rp_CjoFLq_default",
12147
+ "title": "rp_CjoFLq_title",
12148
+ "external": "rp_CjoFLq_external",
12149
+ "agentName": "rp_CjoFLq_agentName"
11898
12150
  };
11899
12151
  // src/client/widgets/tool-switches/ToolSwitches.tsx
11900
12152
  /**
@@ -13113,47 +13365,6 @@ window.__ModuleLoader__.load({
13113
13365
  page.removeEventListener?.("visibilitychange", listener);
13114
13366
  };
13115
13367
  }
13116
- // src/client/widgets/gallery-view/gallery-api.ts
13117
- const route = (target, path = "") => `${API_PREFIX}/${target.kind}/gallery${path}?id=${encodeURIComponent(target.id)}`;
13118
- async function failure$1(response) {
13119
- const body = await response.json().catch(() => void 0);
13120
- return new Error(typeof body?.message === "string" ? body.message : `${response.status} ${response.statusText}`.trim());
13121
- }
13122
- async function loadGallery(target, signal) {
13123
- const response = await fetch(route(target), {
13124
- credentials: "same-origin",
13125
- signal
13126
- });
13127
- if (!response.ok) throw await failure$1(response);
13128
- return await response.json();
13129
- }
13130
- /** Adds a picture to the library. @returns its path. */
13131
- async function uploadImage(target, file, signal) {
13132
- const response = await fetch(route(target, "/upload"), {
13133
- method: "POST",
13134
- credentials: "same-origin",
13135
- headers: {
13136
- "x-file-name": encodeURIComponent(file.name),
13137
- "content-type": "application/octet-stream"
13138
- },
13139
- body: file,
13140
- signal
13141
- });
13142
- if (!response.ok) throw await failure$1(response);
13143
- return (await response.json()).path;
13144
- }
13145
- async function updateImage(target, path, update, signal) {
13146
- const response = await fetch(`${route(target)}&path=${encodeURIComponent(path)}`, {
13147
- method: "PUT",
13148
- credentials: "same-origin",
13149
- headers: { "content-type": "application/json" },
13150
- body: JSON.stringify(update),
13151
- signal
13152
- });
13153
- if (!response.ok) throw await failure$1(response);
13154
- return await response.json();
13155
- }
13156
- const imageUrl = (target, image) => `${route(target, "/file")}&path=${encodeURIComponent(image.path)}&v=${encodeURIComponent(image.createdAt)}`;
13157
13368
  // \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/widgets/gallery-view/GalleryView.module.css.mjs
13158
13369
  const css$34 = ".rp_9pSHmG_page{flex-direction:column;flex:1 1 0;gap:8px;min-height:0;padding:16px 24px;display:flex;overflow-y:auto}.rp_9pSHmG_toolbar{flex:none;justify-content:space-between;align-items:center;gap:12px;display:flex}.rp_9pSHmG_count{color:var(--dsw-alias-label-tertiary);font-size:12px}.rp_9pSHmG_actions{flex-wrap:wrap;align-items:center;gap:8px;display:flex}.rp_9pSHmG_select{border:.5px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-md);height:32px;font:inherit;background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-primary);padding:0 8px;font-size:12px}.rp_9pSHmG_message{text-align:center;color:var(--dsw-alias-label-secondary);margin:0;padding:40px 24px;font-size:13px}.rp_9pSHmG_grid{grid-template-columns:repeat(auto-fill,minmax(160px,1fr));gap:12px;margin:0;padding:0;list-style:none;display:grid}.rp_9pSHmG_cell{min-width:0}.rp_9pSHmG_thumb{border:.5px solid var(--dsw-alias-settings-card-stroke);border-radius:var(--dsw-radius-xl);background:var(--dsw-alias-settings-card-fill);width:100%;font:inherit;text-align:left;color:inherit;cursor:pointer;flex-direction:column;padding:0;display:flex;overflow:hidden}.rp_9pSHmG_open{cursor:zoom-in;background:0 0;border:0;padding:0;display:block}.rp_9pSHmG_thumb:hover{border-color:var(--dsw-alias-border-l4)}.rp_9pSHmG_image{aspect-ratio:1;object-fit:cover;background:var(--dsw-alias-bg-layer-3);width:100%;display:block}.rp_9pSHmG_caption{text-overflow:ellipsis;white-space:nowrap;color:var(--dsw-alias-label-secondary);padding:6px 8px;font-size:12px;overflow:hidden}.rp_9pSHmG_detail{flex-direction:column;gap:12px;width:min(640px,100%);max-height:70vh;display:flex;overflow-y:auto}.rp_9pSHmG_large{border-radius:var(--dsw-radius-lg);object-fit:contain;max-width:100%;max-height:32vh;margin:0 auto;display:block}.rp_9pSHmG_facts{grid-template-columns:max-content 1fr;gap:6px 12px;margin:0;font-size:12px;line-height:18px;display:grid}.rp_9pSHmG_facts dt{color:var(--dsw-alias-label-tertiary)}.rp_9pSHmG_facts dd{min-width:0;color:var(--dsw-alias-label-primary);margin:0}.rp_9pSHmG_pre{white-space:pre-wrap;overflow-wrap:anywhere;max-height:160px;overflow-y:auto}.rp_9pSHmG_tags{flex-wrap:wrap;gap:4px;display:flex}.rp_9pSHmG_note{color:var(--dsw-alias-label-secondary);margin:0;font-size:12px}.rp_9pSHmG_error{color:var(--dsw-alias-state-error-primary);margin:0;font-size:12px}.rp_9pSHmG_status,.rp_9pSHmG_statusError{color:var(--dsw-alias-label-tertiary);padding:0 8px 6px;font-size:12px;line-height:16px}.rp_9pSHmG_statusError{color:var(--dsw-alias-state-error-primary)}.rp_9pSHmG_reusable{color:var(--dsw-alias-label-secondary);cursor:pointer;align-items:center;gap:6px;padding:0 8px 6px;font-size:12px;display:flex}.rp_9pSHmG_reusable input{accent-color:var(--dsw-alias-state-business-primary);margin:0}.rp_9pSHmG_editButton{font:inherit;color:var(--dsw-alias-state-business-primary);cursor:pointer;background:0 0;border:0;align-self:flex-start;margin:0 8px 4px;padding:0;font-size:12px}.rp_9pSHmG_edit{flex-direction:column;gap:12px;width:min(480px,100%);display:flex}.rp_9pSHmG_editField{flex-direction:column;gap:4px;display:flex}.rp_9pSHmG_editLabel{color:var(--dsw-alias-label-secondary);font-size:12px}.rp_9pSHmG_editHelp{color:var(--dsw-alias-label-tertiary);font-size:12px}.rp_9pSHmG_editArea,.rp_9pSHmG_editInput{border:.5px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-md);background:var(--dsw-alias-bg-layer-1);font:inherit;color:var(--dsw-alias-label-primary);padding:6px 8px;font-size:13px}.rp_9pSHmG_editArea{resize:vertical;min-height:96px}.rp_9pSHmG_editArea:focus-visible,.rp_9pSHmG_editInput:focus-visible,.rp_9pSHmG_select:focus-visible{border-color:var(--dsw-alias-state-business-primary);outline:none}@media (width<=640px){.rp_9pSHmG_page{padding-inline:16px}.rp_9pSHmG_toolbar{align-items:flex-start}.rp_9pSHmG_grid{grid-template-columns:repeat(auto-fill,minmax(136px,1fr))}}";
13159
13370
  const key$34 = "src/client/widgets/gallery-view/GalleryView.module.css";
@@ -13166,35 +13377,35 @@ window.__ModuleLoader__.load({
13166
13377
  }
13167
13378
  tag$34.textContent = css$34;
13168
13379
  var GalleryView_module_css_default = {
13380
+ "actions": "rp_9pSHmG_actions",
13381
+ "editButton": "rp_9pSHmG_editButton",
13382
+ "open": "rp_9pSHmG_open",
13169
13383
  "error": "rp_9pSHmG_error",
13170
- "detail": "rp_9pSHmG_detail",
13171
- "editHelp": "rp_9pSHmG_editHelp",
13172
- "editInput": "rp_9pSHmG_editInput",
13173
- "message": "rp_9pSHmG_message",
13174
- "tags": "rp_9pSHmG_tags",
13175
- "large": "rp_9pSHmG_large",
13176
- "cell": "rp_9pSHmG_cell",
13177
- "image": "rp_9pSHmG_image",
13178
- "reusable": "rp_9pSHmG_reusable",
13179
- "thumb": "rp_9pSHmG_thumb",
13180
- "caption": "rp_9pSHmG_caption",
13384
+ "facts": "rp_9pSHmG_facts",
13385
+ "editArea": "rp_9pSHmG_editArea",
13386
+ "toolbar": "rp_9pSHmG_toolbar",
13181
13387
  "count": "rp_9pSHmG_count",
13182
- "edit": "rp_9pSHmG_edit",
13388
+ "page": "rp_9pSHmG_page",
13389
+ "editHelp": "rp_9pSHmG_editHelp",
13183
13390
  "status": "rp_9pSHmG_status",
13391
+ "image": "rp_9pSHmG_image",
13184
13392
  "note": "rp_9pSHmG_note",
13185
- "editLabel": "rp_9pSHmG_editLabel",
13186
- "actions": "rp_9pSHmG_actions",
13187
- "toolbar": "rp_9pSHmG_toolbar",
13188
- "grid": "rp_9pSHmG_grid",
13189
- "open": "rp_9pSHmG_open",
13190
- "editButton": "rp_9pSHmG_editButton",
13191
- "editArea": "rp_9pSHmG_editArea",
13393
+ "edit": "rp_9pSHmG_edit",
13192
13394
  "select": "rp_9pSHmG_select",
13193
- "facts": "rp_9pSHmG_facts",
13194
- "editField": "rp_9pSHmG_editField",
13395
+ "message": "rp_9pSHmG_message",
13396
+ "editInput": "rp_9pSHmG_editInput",
13397
+ "large": "rp_9pSHmG_large",
13398
+ "reusable": "rp_9pSHmG_reusable",
13195
13399
  "pre": "rp_9pSHmG_pre",
13400
+ "detail": "rp_9pSHmG_detail",
13401
+ "editField": "rp_9pSHmG_editField",
13402
+ "tags": "rp_9pSHmG_tags",
13196
13403
  "statusError": "rp_9pSHmG_statusError",
13197
- "page": "rp_9pSHmG_page"
13404
+ "grid": "rp_9pSHmG_grid",
13405
+ "cell": "rp_9pSHmG_cell",
13406
+ "thumb": "rp_9pSHmG_thumb",
13407
+ "caption": "rp_9pSHmG_caption",
13408
+ "editLabel": "rp_9pSHmG_editLabel"
13198
13409
  };
13199
13410
  // src/client/widgets/gallery-view/GalleryView.tsx
13200
13411
  /** How often the list is read again while pictures are waiting to be described. */
@@ -13270,6 +13481,18 @@ window.__ModuleLoader__.load({
13270
13481
  })
13271
13482
  ]
13272
13483
  }),
13484
+ image.cardLinks !== void 0 && image.cardLinks.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
13485
+ className: GalleryView_module_css_default.editField,
13486
+ title: t("cardSourceHelp"),
13487
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
13488
+ className: GalleryView_module_css_default.editLabel,
13489
+ children: t("cardSource")
13490
+ }), image.cardLinks.map((link) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
13491
+ className: GalleryView_module_css_default.editHelp,
13492
+ "data-testid": "roleplay-gallery-source",
13493
+ children: [link.url, link.pieces.length === 0 ? "" : ` (${link.pieces.join(", ")})`]
13494
+ }, link.url))]
13495
+ }),
13273
13496
  error !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
13274
13497
  className: GalleryView_module_css_default.error,
13275
13498
  role: "alert",
@@ -13288,6 +13511,7 @@ window.__ModuleLoader__.load({
13288
13511
  const [notice, setNotice] = (0, react.useState)();
13289
13512
  const picker = (0, react.useRef)(null);
13290
13513
  const [editing, setEditing] = (0, react.useState)();
13514
+ const [describing, setDescribing] = (0, react.useState)(/* @__PURE__ */ new Set());
13291
13515
  const read = (0, react.useCallback)((signal) => {
13292
13516
  setRefreshing(true);
13293
13517
  loadGallery(target, signal).then((contents) => {
@@ -13371,6 +13595,19 @@ window.__ModuleLoader__.load({
13371
13595
  setNotice(t("updateFailed", { message: messageOf$10(failure) }));
13372
13596
  });
13373
13597
  };
13598
+ const describe = (image) => {
13599
+ setDescribing((current) => new Set(current).add(image.path));
13600
+ setNotice(void 0);
13601
+ describeImage(target, image.path, new AbortController().signal).then(replace, (failure) => {
13602
+ setNotice(t("describeError", { message: messageOf$10(failure) }));
13603
+ }).finally(() => {
13604
+ setDescribing((current) => {
13605
+ const next = new Set(current);
13606
+ next.delete(image.path);
13607
+ return next;
13608
+ });
13609
+ });
13610
+ };
13374
13611
  const { images, failures } = load.contents;
13375
13612
  const labels = {
13376
13613
  description: t("description") ?? "",
@@ -13496,6 +13733,15 @@ window.__ModuleLoader__.load({
13496
13733
  },
13497
13734
  children: t("edit")
13498
13735
  }),
13736
+ image.unreadable !== true && target.kind === "worlds" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
13737
+ type: "button",
13738
+ className: GalleryView_module_css_default.editButton,
13739
+ disabled: describing.has(image.path),
13740
+ onClick: () => {
13741
+ describe(image);
13742
+ },
13743
+ children: describing.has(image.path) ? t("describing") : t("describeNow")
13744
+ }),
13499
13745
  image.origin === "generated" && image.unreadable !== true && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
13500
13746
  className: GalleryView_module_css_default.reusable,
13501
13747
  title: t("reusableHint"),
@@ -13538,12 +13784,12 @@ window.__ModuleLoader__.load({
13538
13784
  tag$33.textContent = css$33;
13539
13785
  var WorldEditor_module_css_default = {
13540
13786
  "view": "rp__swA3a_view",
13541
- "message": "rp__swA3a_message",
13542
- "content": "rp__swA3a_content",
13543
13787
  "drawer": "rp__swA3a_drawer",
13544
13788
  "warning": "rp__swA3a_warning",
13545
13789
  "drawerItemOn": "rp__swA3a_drawerItemOn",
13546
- "drawerItem": "rp__swA3a_drawerItem"
13790
+ "drawerItem": "rp__swA3a_drawerItem",
13791
+ "content": "rp__swA3a_content",
13792
+ "message": "rp__swA3a_message"
13547
13793
  };
13548
13794
  // src/client/world-editor/WorldEditor.tsx
13549
13795
  const SECTIONS = [
@@ -13957,27 +14203,27 @@ window.__ModuleLoader__.load({
13957
14203
  }
13958
14204
  tag$32.textContent = css$32;
13959
14205
  var AvatarsPage_module_css_default = {
13960
- "editHeader": "rp_pQOzEG_editHeader",
13961
14206
  "actions": "rp_pQOzEG_actions",
13962
- "editBody": "rp_pQOzEG_editBody",
14207
+ "grid": "rp_pQOzEG_grid",
13963
14208
  "count": "rp_pQOzEG_count",
13964
- "page": "rp_pQOzEG_page",
14209
+ "text": "rp_pQOzEG_text",
14210
+ "placeholder": "rp_pQOzEG_placeholder",
14211
+ "toolbar": "rp_pQOzEG_toolbar",
14212
+ "portrait": "rp_pQOzEG_portrait",
14213
+ "viewport": "rp_pQOzEG_viewport",
13965
14214
  "message": "rp_pQOzEG_message",
13966
- "editTitle": "rp_pQOzEG_editTitle",
13967
14215
  "error": "rp_pQOzEG_error",
13968
- "field": "rp_pQOzEG_field",
13969
- "name": "rp_pQOzEG_name",
14216
+ "editTitle": "rp_pQOzEG_editTitle",
14217
+ "editBody": "rp_pQOzEG_editBody",
13970
14218
  "summary": "rp_pQOzEG_summary",
13971
- "placeholder": "rp_pQOzEG_placeholder",
13972
- "viewport": "rp_pQOzEG_viewport",
14219
+ "editHeader": "rp_pQOzEG_editHeader",
14220
+ "form": "rp_pQOzEG_form",
14221
+ "card": "rp_pQOzEG_card",
13973
14222
  "open": "rp_pQOzEG_open",
13974
- "text": "rp_pQOzEG_text",
13975
- "toolbar": "rp_pQOzEG_toolbar",
14223
+ "field": "rp_pQOzEG_field",
14224
+ "page": "rp_pQOzEG_page",
13976
14225
  "label": "rp_pQOzEG_label",
13977
- "grid": "rp_pQOzEG_grid",
13978
- "card": "rp_pQOzEG_card",
13979
- "form": "rp_pQOzEG_form",
13980
- "portrait": "rp_pQOzEG_portrait"
14226
+ "name": "rp_pQOzEG_name"
13981
14227
  };
13982
14228
  // src/client/pages/avatars/AvatarsPage.tsx
13983
14229
  const hueOf$2 = (name) => Array.from(name).reduce((hash, char) => (hash * 31 + char.charCodeAt(0)) % 360, 0);
@@ -14667,7 +14913,7 @@ window.__ModuleLoader__.load({
14667
14913
  reusable: "Reusable",
14668
14914
  reusableHint: "May be shown again in a later scene. Images you add are always reusable.",
14669
14915
  pending: "Waiting to be described…",
14670
- pendingWorld: "Not described yet: a session started from this world describes it, or describe it yourself.",
14916
+ pendingWorld: "Not described yet: a session started from this world describes it, or use Describe with AI or write it yourself.",
14671
14917
  describeFailed: "Could not be described: {message}",
14672
14918
  upload: "Add images",
14673
14919
  uploading: "Adding…",
@@ -14682,7 +14928,12 @@ window.__ModuleLoader__.load({
14682
14928
  saving: "Saving…",
14683
14929
  cancel: "Cancel",
14684
14930
  guideText: "Scene images, portraits and your own pictures, beside the chat",
14685
- back: "Back"
14931
+ back: "Back",
14932
+ describeNow: "Describe with AI",
14933
+ describing: "Describing…",
14934
+ describeError: "Could not describe the picture: {message}",
14935
+ cardSource: "From the card",
14936
+ cardSourceHelp: "The address and card piece this picture was downloaded from."
14686
14937
  },
14687
14938
  zh: {
14688
14939
  tab: "图库",
@@ -14722,7 +14973,12 @@ window.__ModuleLoader__.load({
14722
14973
  saving: "正在保存…",
14723
14974
  cancel: "取消",
14724
14975
  guideText: "场景图、立绘和你自己的图片,与对话并排查看",
14725
- back: "返回"
14976
+ back: "返回",
14977
+ describeNow: "用 AI 描述",
14978
+ describing: "正在描述…",
14979
+ describeError: "无法描述这张图片:{message}",
14980
+ cardSource: "来自角色卡",
14981
+ cardSourceHelp: "这张图片下载自的网址与角色卡片段。"
14726
14982
  },
14727
14983
  ja: {
14728
14984
  tab: "ギャラリー",
@@ -14762,7 +15018,12 @@ window.__ModuleLoader__.load({
14762
15018
  saving: "保存中…",
14763
15019
  cancel: "キャンセル",
14764
15020
  guideText: "場面画像、ポートレート、自分の画像をチャットの横で表示",
14765
- back: "戻る"
15021
+ back: "戻る",
15022
+ describeNow: "AI で説明",
15023
+ describing: "説明中…",
15024
+ describeError: "画像を説明できませんでした:{message}",
15025
+ cardSource: "カードから",
15026
+ cardSourceHelp: "この画像のダウンロード元のアドレスとカードの箇所。"
14766
15027
  },
14767
15028
  es: {
14768
15029
  tab: "Galería",
@@ -14802,7 +15063,12 @@ window.__ModuleLoader__.load({
14802
15063
  saving: "Guardando…",
14803
15064
  cancel: "Cancelar",
14804
15065
  guideText: "Escenas, retratos e imágenes propias junto al chat",
14805
- back: "Atrás"
15066
+ back: "Atrás",
15067
+ describeNow: "Describir con IA",
15068
+ describing: "Describiendo…",
15069
+ describeError: "No se pudo describir la imagen: {message}",
15070
+ cardSource: "De la tarjeta",
15071
+ cardSourceHelp: "La dirección y la parte de la tarjeta de donde se descargó esta imagen."
14806
15072
  },
14807
15073
  fr: {
14808
15074
  tab: "Galerie",
@@ -14842,7 +15108,12 @@ window.__ModuleLoader__.load({
14842
15108
  saving: "Enregistrement…",
14843
15109
  cancel: "Annuler",
14844
15110
  guideText: "Scènes, portraits et images personnelles à côté de la discussion",
14845
- back: "Retour"
15111
+ back: "Retour",
15112
+ describeNow: "Décrire avec l’IA",
15113
+ describing: "Description…",
15114
+ describeError: "Impossible de décrire l’image : {message}",
15115
+ cardSource: "De la carte",
15116
+ cardSourceHelp: "L’adresse et la partie de la carte d’où cette image a été téléchargée."
14846
15117
  },
14847
15118
  de: {
14848
15119
  tab: "Galerie",
@@ -14882,7 +15153,12 @@ window.__ModuleLoader__.load({
14882
15153
  saving: "Wird gespeichert…",
14883
15154
  cancel: "Abbrechen",
14884
15155
  guideText: "Szenenbilder, Porträts und eigene Bilder neben dem Chat",
14885
- back: "Zurück"
15156
+ back: "Zurück",
15157
+ describeNow: "Mit KI beschreiben",
15158
+ describing: "Wird beschrieben…",
15159
+ describeError: "Das Bild konnte nicht beschrieben werden: {message}",
15160
+ cardSource: "Aus der Karte",
15161
+ cardSourceHelp: "Die Adresse und der Kartenabschnitt, von denen dieses Bild heruntergeladen wurde."
14886
15162
  },
14887
15163
  ru: {
14888
15164
  tab: "Галерея",
@@ -14922,7 +15198,12 @@ window.__ModuleLoader__.load({
14922
15198
  saving: "Сохранение…",
14923
15199
  cancel: "Отмена",
14924
15200
  guideText: "Сцены, портреты и ваши изображения рядом с чатом",
14925
- back: "Назад"
15201
+ back: "Назад",
15202
+ describeNow: "Описать с помощью ИИ",
15203
+ describing: "Описываю…",
15204
+ describeError: "Не удалось описать изображение: {message}",
15205
+ cardSource: "Из карточки",
15206
+ cardSourceHelp: "Адрес и часть карточки, откуда загружено это изображение."
14926
15207
  },
14927
15208
  pt: {
14928
15209
  tab: "Galeria",
@@ -14962,7 +15243,12 @@ window.__ModuleLoader__.load({
14962
15243
  saving: "A guardar…",
14963
15244
  cancel: "Cancelar",
14964
15245
  guideText: "Cenas, retratos e imagens próprias junto à conversa",
14965
- back: "Voltar"
15246
+ back: "Voltar",
15247
+ describeNow: "Descrever com IA",
15248
+ describing: "A descrever…",
15249
+ describeError: "Não foi possível descrever a imagem: {message}",
15250
+ cardSource: "Do cartão",
15251
+ cardSourceHelp: "O endereço e a parte do cartão de onde esta imagem foi descarregada."
14966
15252
  }
14967
15253
  };
14968
15254
  // src/client/world-editor/dice-locales.ts
@@ -15708,7 +15994,13 @@ window.__ModuleLoader__.load({
15708
15994
  speech: "Spoken line",
15709
15995
  speaker: "Who speaks",
15710
15996
  noSpeaker: "Choose a character",
15711
- text: "Text"
15997
+ text: "Text",
15998
+ addImage: "Add a picture",
15999
+ picture: "Picture",
16000
+ choosePicture: "Choose a picture",
16001
+ noPictures: "The world has no pictures yet: add some in Images first.",
16002
+ pictureMissing: "This picture is not in the world's images any more",
16003
+ toPlainBlockedMore: "A picture or a spoken line needs parts: remove them first"
15712
16004
  },
15713
16005
  zh: {
15714
16006
  plainHelp: "纯文本只是叙述。拆分成多个部分后,才能给角色安排台词。",
@@ -15725,7 +16017,13 @@ window.__ModuleLoader__.load({
15725
16017
  speech: "台词",
15726
16018
  speaker: "说话者",
15727
16019
  noSpeaker: "选择角色",
15728
- text: "内容"
16020
+ text: "内容",
16021
+ addImage: "添加图片",
16022
+ picture: "图片",
16023
+ choosePicture: "选择图片",
16024
+ noPictures: "世界里还没有图片:请先在“图片”里添加。",
16025
+ pictureMissing: "这张图片已不在世界的图片里",
16026
+ toPlainBlockedMore: "图片或台词需要分成多个部分:请先移除它们"
15729
16027
  },
15730
16028
  ja: {
15731
16029
  plainHelp: "プレーンテキストはナレーションのみです。キャラクターのセリフを入れるにはパートに分けます。",
@@ -15742,7 +16040,13 @@ window.__ModuleLoader__.load({
15742
16040
  speech: "セリフ",
15743
16041
  speaker: "話し手",
15744
16042
  noSpeaker: "キャラクターを選択",
15745
- text: "本文"
16043
+ text: "本文",
16044
+ addImage: "画像を追加",
16045
+ picture: "画像",
16046
+ choosePicture: "画像を選択",
16047
+ noPictures: "このワールドにはまだ画像がありません。先に「画像」で追加してください。",
16048
+ pictureMissing: "この画像はワールドの画像にもうありません",
16049
+ toPlainBlockedMore: "画像やセリフにはパートが必要です。先に削除してください"
15746
16050
  },
15747
16051
  es: {
15748
16052
  plainHelp: "El texto sin formato es solo narración. Divídelo en partes para dar líneas a los personajes.",
@@ -15759,7 +16063,13 @@ window.__ModuleLoader__.load({
15759
16063
  speech: "Línea hablada",
15760
16064
  speaker: "Quién habla",
15761
16065
  noSpeaker: "Elige un personaje",
15762
- text: "Texto"
16066
+ text: "Texto",
16067
+ addImage: "Añadir una imagen",
16068
+ picture: "Imagen",
16069
+ choosePicture: "Elige una imagen",
16070
+ noPictures: "El mundo aún no tiene imágenes: añade algunas primero en Imágenes.",
16071
+ pictureMissing: "Esta imagen ya no está en las imágenes del mundo",
16072
+ toPlainBlockedMore: "Una imagen o una línea hablada necesita partes: quítalas primero"
15763
16073
  },
15764
16074
  fr: {
15765
16075
  plainHelp: "Le texte simple n’est que de la narration. Découpez-le en parties pour donner des répliques aux personnages.",
@@ -15776,7 +16086,13 @@ window.__ModuleLoader__.load({
15776
16086
  speech: "Réplique",
15777
16087
  speaker: "Qui parle",
15778
16088
  noSpeaker: "Choisir un personnage",
15779
- text: "Texte"
16089
+ text: "Texte",
16090
+ addImage: "Ajouter une image",
16091
+ picture: "Image",
16092
+ choosePicture: "Choisissez une image",
16093
+ noPictures: "Le monde n’a pas encore d’images : ajoutez-en d’abord dans Images.",
16094
+ pictureMissing: "Cette image n’est plus dans les images du monde",
16095
+ toPlainBlockedMore: "Une image ou une réplique demande des parties : retirez-les d’abord"
15780
16096
  },
15781
16097
  de: {
15782
16098
  plainHelp: "Reiner Text ist nur Erzählung. Teile ihn in Abschnitte, um Figuren Zeilen zu geben.",
@@ -15793,7 +16109,13 @@ window.__ModuleLoader__.load({
15793
16109
  speech: "Gesprochene Zeile",
15794
16110
  speaker: "Wer spricht",
15795
16111
  noSpeaker: "Figur wählen",
15796
- text: "Text"
16112
+ text: "Text",
16113
+ addImage: "Bild hinzufügen",
16114
+ picture: "Bild",
16115
+ choosePicture: "Bild wählen",
16116
+ noPictures: "Die Welt hat noch keine Bilder: Füge zuerst unter Bilder welche hinzu.",
16117
+ pictureMissing: "Dieses Bild ist nicht mehr in den Bildern der Welt",
16118
+ toPlainBlockedMore: "Ein Bild oder eine gesprochene Zeile braucht Teile: Entferne sie zuerst"
15797
16119
  },
15798
16120
  ru: {
15799
16121
  plainHelp: "Простой текст — это только повествование. Разбейте его на части, чтобы дать персонажам реплики.",
@@ -15810,7 +16132,13 @@ window.__ModuleLoader__.load({
15810
16132
  speech: "Реплика",
15811
16133
  speaker: "Кто говорит",
15812
16134
  noSpeaker: "Выберите персонажа",
15813
- text: "Текст"
16135
+ text: "Текст",
16136
+ addImage: "Добавить изображение",
16137
+ picture: "Изображение",
16138
+ choosePicture: "Выберите изображение",
16139
+ noPictures: "В мире пока нет изображений: сначала добавьте их в разделе «Изображения».",
16140
+ pictureMissing: "Этого изображения больше нет среди изображений мира",
16141
+ toPlainBlockedMore: "Изображение или реплика требуют частей: сначала удалите их"
15814
16142
  },
15815
16143
  pt: {
15816
16144
  plainHelp: "Texto simples é só narração. Divida em partes para dar falas aos personagens.",
@@ -15827,7 +16155,13 @@ window.__ModuleLoader__.load({
15827
16155
  speech: "Fala",
15828
16156
  speaker: "Quem fala",
15829
16157
  noSpeaker: "Escolha um personagem",
15830
- text: "Texto"
16158
+ text: "Texto",
16159
+ addImage: "Adicionar uma imagem",
16160
+ picture: "Imagem",
16161
+ choosePicture: "Escolha uma imagem",
16162
+ noPictures: "O mundo ainda não tem imagens: adicione algumas primeiro em Imagens.",
16163
+ pictureMissing: "Esta imagem já não está nas imagens do mundo",
16164
+ toPlainBlockedMore: "Uma imagem ou uma fala precisa de partes: remova-as primeiro"
15831
16165
  }
15832
16166
  };
15833
16167
  // src/client/world-editor/questions-locales.ts
@@ -19249,37 +19583,37 @@ window.__ModuleLoader__.load({
19249
19583
  }
19250
19584
  tag$31.textContent = css$31;
19251
19585
  var LorebooksPage_module_css_default = {
19252
- "editHeader": "rp_VV-Eha_editHeader",
19253
- "name": "rp_VV-Eha_name",
19254
- "select": "rp_VV-Eha_select",
19586
+ "label": "rp_VV-Eha_label",
19587
+ "field": "rp_VV-Eha_field",
19588
+ "page": "rp_VV-Eha_page",
19589
+ "form": "rp_VV-Eha_form",
19255
19590
  "message": "rp_VV-Eha_message",
19591
+ "actions": "rp_VV-Eha_actions",
19256
19592
  "editTitle": "rp_VV-Eha_editTitle",
19257
- "title": "rp_VV-Eha_title",
19258
- "grid": "rp_VV-Eha_grid",
19593
+ "select": "rp_VV-Eha_select",
19594
+ "toolbar": "rp_VV-Eha_toolbar",
19595
+ "editBody": "rp_VV-Eha_editBody",
19259
19596
  "section": "rp_VV-Eha_section",
19597
+ "sectionTitle": "rp_VV-Eha_sectionTitle",
19598
+ "row": "rp_VV-Eha_row",
19260
19599
  "viewport": "rp_VV-Eha_viewport",
19261
- "count": "rp_VV-Eha_count",
19262
- "card": "rp_VV-Eha_card",
19263
- "warning": "rp_VV-Eha_warning",
19264
- "label": "rp_VV-Eha_label",
19265
- "actions": "rp_VV-Eha_actions",
19266
- "toolbar": "rp_VV-Eha_toolbar",
19267
19600
  "meta": "rp_VV-Eha_meta",
19601
+ "warning": "rp_VV-Eha_warning",
19602
+ "name": "rp_VV-Eha_name",
19603
+ "area": "rp_VV-Eha_area",
19604
+ "card": "rp_VV-Eha_card",
19605
+ "description": "rp_VV-Eha_description",
19268
19606
  "ok": "rp_VV-Eha_ok",
19269
- "input": "rp_VV-Eha_input",
19607
+ "head": "rp_VV-Eha_head",
19270
19608
  "entryArea": "rp_VV-Eha_entryArea",
19271
- "editBody": "rp_VV-Eha_editBody",
19272
- "row": "rp_VV-Eha_row",
19273
- "field": "rp_VV-Eha_field",
19274
- "page": "rp_VV-Eha_page",
19275
- "help": "rp_VV-Eha_help",
19276
- "form": "rp_VV-Eha_form",
19277
- "cardActions": "rp_VV-Eha_cardActions",
19278
- "area": "rp_VV-Eha_area",
19609
+ "editHeader": "rp_VV-Eha_editHeader",
19279
19610
  "error": "rp_VV-Eha_error",
19280
- "description": "rp_VV-Eha_description",
19281
- "sectionTitle": "rp_VV-Eha_sectionTitle",
19282
- "head": "rp_VV-Eha_head"
19611
+ "title": "rp_VV-Eha_title",
19612
+ "cardActions": "rp_VV-Eha_cardActions",
19613
+ "input": "rp_VV-Eha_input",
19614
+ "help": "rp_VV-Eha_help",
19615
+ "count": "rp_VV-Eha_count",
19616
+ "grid": "rp_VV-Eha_grid"
19283
19617
  };
19284
19618
  // src/client/pages/lorebooks/LorebookEditor.tsx
19285
19619
  const messageOf$9 = (failure) => failure instanceof Error ? failure.message : String(failure);
@@ -20781,35 +21115,35 @@ window.__ModuleLoader__.load({
20781
21115
  }
20782
21116
  tag$30.textContent = css$30;
20783
21117
  var PresetsPage_module_css_default = {
20784
- "page": "rp_ZK89ba_page",
21118
+ "ok": "rp_ZK89ba_ok",
21119
+ "editHeader": "rp_ZK89ba_editHeader",
21120
+ "title": "rp_ZK89ba_title",
20785
21121
  "grid": "rp_ZK89ba_grid",
20786
- "head": "rp_ZK89ba_head",
21122
+ "actions": "rp_ZK89ba_actions",
21123
+ "sectionTitle": "rp_ZK89ba_sectionTitle",
20787
21124
  "editTitle": "rp_ZK89ba_editTitle",
21125
+ "warning": "rp_ZK89ba_warning",
21126
+ "head": "rp_ZK89ba_head",
21127
+ "error": "rp_ZK89ba_error",
21128
+ "area": "rp_ZK89ba_area",
21129
+ "label": "rp_ZK89ba_label",
21130
+ "meta": "rp_ZK89ba_meta",
20788
21131
  "name": "rp_ZK89ba_name",
21132
+ "viewport": "rp_ZK89ba_viewport",
20789
21133
  "section": "rp_ZK89ba_section",
20790
- "sectionTitle": "rp_ZK89ba_sectionTitle",
20791
21134
  "card": "rp_ZK89ba_card",
20792
- "ok": "rp_ZK89ba_ok",
20793
- "title": "rp_ZK89ba_title",
20794
- "help": "rp_ZK89ba_help",
20795
- "meta": "rp_ZK89ba_meta",
20796
21135
  "cardActions": "rp_ZK89ba_cardActions",
20797
- "row": "rp_ZK89ba_row",
20798
- "editBody": "rp_ZK89ba_editBody",
20799
- "viewport": "rp_ZK89ba_viewport",
20800
- "area": "rp_ZK89ba_area",
20801
- "form": "rp_ZK89ba_form",
20802
21136
  "input": "rp_ZK89ba_input",
21137
+ "page": "rp_ZK89ba_page",
20803
21138
  "message": "rp_ZK89ba_message",
20804
21139
  "toolbar": "rp_ZK89ba_toolbar",
21140
+ "field": "rp_ZK89ba_field",
20805
21141
  "count": "rp_ZK89ba_count",
20806
21142
  "description": "rp_ZK89ba_description",
20807
- "actions": "rp_ZK89ba_actions",
20808
- "error": "rp_ZK89ba_error",
20809
- "warning": "rp_ZK89ba_warning",
20810
- "editHeader": "rp_ZK89ba_editHeader",
20811
- "field": "rp_ZK89ba_field",
20812
- "label": "rp_ZK89ba_label"
21143
+ "editBody": "rp_ZK89ba_editBody",
21144
+ "help": "rp_ZK89ba_help",
21145
+ "row": "rp_ZK89ba_row",
21146
+ "form": "rp_ZK89ba_form"
20813
21147
  };
20814
21148
  // src/client/pages/presets/PresetEditor.tsx
20815
21149
  const messageOf$6 = (failure) => failure instanceof Error ? failure.message : String(failure);
@@ -22298,34 +22632,34 @@ window.__ModuleLoader__.load({
22298
22632
  }
22299
22633
  tag$29.textContent = css$29;
22300
22634
  var PromptsPage_module_css_default = {
22301
- "area": "rp_DLg_5G_area",
22302
- "panes": "rp_DLg_5G_panes",
22303
- "toolbar": "rp_DLg_5G_toolbar",
22304
- "list": "rp_DLg_5G_list",
22305
- "shipped": "rp_DLg_5G_shipped",
22306
- "rowLanguage": "rp_DLg_5G_rowLanguage",
22307
- "viewport": "rp_DLg_5G_viewport",
22308
- "pane": "rp_DLg_5G_pane",
22635
+ "label": "rp_DLg_5G_label",
22309
22636
  "sign": "rp_DLg_5G_sign",
22637
+ "message": "rp_DLg_5G_message",
22638
+ "shipped": "rp_DLg_5G_shipped",
22639
+ "actions": "rp_DLg_5G_actions",
22640
+ "help": "rp_DLg_5G_help",
22641
+ "editBody": "rp_DLg_5G_editBody",
22310
22642
  "count": "rp_DLg_5G_count",
22643
+ "list": "rp_DLg_5G_list",
22644
+ "check": "rp_DLg_5G_check",
22311
22645
  "rowName": "rp_DLg_5G_rowName",
22312
- "warning": "rp_DLg_5G_warning",
22646
+ "toolbar": "rp_DLg_5G_toolbar",
22647
+ "spacer": "rp_DLg_5G_spacer",
22648
+ "editTitle": "rp_DLg_5G_editTitle",
22649
+ "editHeader": "rp_DLg_5G_editHeader",
22650
+ "pane": "rp_DLg_5G_pane",
22651
+ "viewport": "rp_DLg_5G_viewport",
22652
+ "area": "rp_DLg_5G_area",
22313
22653
  "line": "rp_DLg_5G_line",
22654
+ "rowLanguage": "rp_DLg_5G_rowLanguage",
22655
+ "error": "rp_DLg_5G_error",
22314
22656
  "group": "rp_DLg_5G_group",
22315
- "check": "rp_DLg_5G_check",
22316
22657
  "missing": "rp_DLg_5G_missing",
22317
- "label": "rp_DLg_5G_label",
22318
- "editHeader": "rp_DLg_5G_editHeader",
22319
22658
  "page": "rp_DLg_5G_page",
22320
- "message": "rp_DLg_5G_message",
22659
+ "warning": "rp_DLg_5G_warning",
22321
22660
  "ok": "rp_DLg_5G_ok",
22322
- "help": "rp_DLg_5G_help",
22323
- "editTitle": "rp_DLg_5G_editTitle",
22324
- "editBody": "rp_DLg_5G_editBody",
22325
- "spacer": "rp_DLg_5G_spacer",
22326
- "row": "rp_DLg_5G_row",
22327
- "actions": "rp_DLg_5G_actions",
22328
- "error": "rp_DLg_5G_error"
22661
+ "panes": "rp_DLg_5G_panes",
22662
+ "row": "rp_DLg_5G_row"
22329
22663
  };
22330
22664
  // src/client/pages/prompts/PromptEditor.tsx
22331
22665
  const messageOf$3 = (failure) => failure instanceof Error ? failure.message : String(failure);
@@ -23185,11 +23519,11 @@ window.__ModuleLoader__.load({
23185
23519
  }
23186
23520
  tag$26.textContent = css$26;
23187
23521
  var DeleteSessionDialog_module_css_default = {
23188
- "error": "rp_FifHrW_error",
23189
- "body": "rp_FifHrW_body",
23190
23522
  "question": "rp_FifHrW_question",
23191
23523
  "warning": "rp_FifHrW_warning",
23192
- "choice": "rp_FifHrW_choice"
23524
+ "body": "rp_FifHrW_body",
23525
+ "choice": "rp_FifHrW_choice",
23526
+ "error": "rp_FifHrW_error"
23193
23527
  };
23194
23528
  // src/client/pages/sessions/DeleteSessionDialog.tsx
23195
23529
  /** Asks for confirmation before a session and everything saved with it is removed. */
@@ -23713,28 +24047,28 @@ window.__ModuleLoader__.load({
23713
24047
  }
23714
24048
  tag$25.textContent = css$25;
23715
24049
  var SessionsPage_module_css_default = {
23716
- "secondary": "rp_24z4eW_secondary",
23717
- "toolbar": "rp_24z4eW_toolbar",
23718
- "message": "rp_24z4eW_message",
23719
- "fits": "rp_24z4eW_fits",
23720
- "viewport": "rp_24z4eW_viewport",
23721
- "scrolls": "rp_24z4eW_scrolls",
23722
- "spinning": "rp_24z4eW_spinning",
23723
- "turnsColumn": "rp_24z4eW_turnsColumn",
23724
24050
  "name": "rp_24z4eW_name",
24051
+ "actions": "rp_24z4eW_actions",
24052
+ "fits": "rp_24z4eW_fits",
23725
24053
  "count": "rp_24z4eW_count",
24054
+ "message": "rp_24z4eW_message",
24055
+ "number": "rp_24z4eW_number",
23726
24056
  "worldColumn": "rp_24z4eW_worldColumn",
24057
+ "nameColumn": "rp_24z4eW_nameColumn",
24058
+ "toolbar": "rp_24z4eW_toolbar",
24059
+ "secondary": "rp_24z4eW_secondary",
24060
+ "viewport": "rp_24z4eW_viewport",
24061
+ "timeColumn": "rp_24z4eW_timeColumn",
24062
+ "notice": "rp_24z4eW_notice",
23727
24063
  "archived": "rp_24z4eW_archived",
24064
+ "scrolls": "rp_24z4eW_scrolls",
23728
24065
  "page": "rp_24z4eW_page",
23729
24066
  "actionsColumn": "rp_24z4eW_actionsColumn",
23730
- "actions": "rp_24z4eW_actions",
23731
- "number": "rp_24z4eW_number",
24067
+ "turnsColumn": "rp_24z4eW_turnsColumn",
24068
+ "spinning": "rp_24z4eW_spinning",
23732
24069
  "table": "rp_24z4eW_table",
23733
- "notice": "rp_24z4eW_notice",
23734
- "spin": "rp_24z4eW_spin",
23735
- "timeColumn": "rp_24z4eW_timeColumn",
23736
- "nameColumn": "rp_24z4eW_nameColumn",
23737
- "badge": "rp_24z4eW_badge"
24070
+ "badge": "rp_24z4eW_badge",
24071
+ "spin": "rp_24z4eW_spin"
23738
24072
  };
23739
24073
  // src/client/pages/sessions/SessionsPage.tsx
23740
24074
  /** The sessions as a table, one page at a time, the most recently played first. */
@@ -24473,29 +24807,29 @@ window.__ModuleLoader__.load({
24473
24807
  }
24474
24808
  tag$24.textContent = css$24;
24475
24809
  var SyncPage_module_css_default = {
24476
- "detail": "rp_Gk-byG_detail",
24477
- "unit": "rp_Gk-byG_unit",
24478
- "failed": "rp_Gk-byG_failed",
24810
+ "meta": "rp_Gk-byG_meta",
24811
+ "conflict": "rp_Gk-byG_conflict",
24479
24812
  "error": "rp_Gk-byG_error",
24480
24813
  "problem": "rp_Gk-byG_problem",
24481
- "conflict": "rp_Gk-byG_conflict",
24482
- "message": "rp_Gk-byG_message",
24483
- "choices": "rp_Gk-byG_choices",
24484
- "syncedColumn": "rp_Gk-byG_syncedColumn",
24485
- "caption": "rp_Gk-byG_caption",
24486
- "viewport": "rp_Gk-byG_viewport",
24814
+ "detailsColumn": "rp_Gk-byG_detailsColumn",
24487
24815
  "kindColumn": "rp_Gk-byG_kindColumn",
24488
- "stateColumn": "rp_Gk-byG_stateColumn",
24489
- "toolbar": "rp_Gk-byG_toolbar",
24490
- "page": "rp_Gk-byG_page",
24491
- "meta": "rp_Gk-byG_meta",
24492
- "confirmation": "rp_Gk-byG_confirmation",
24816
+ "actionHeading": "rp_Gk-byG_actionHeading",
24493
24817
  "actions": "rp_Gk-byG_actions",
24494
- "actionsColumn": "rp_Gk-byG_actionsColumn",
24818
+ "viewport": "rp_Gk-byG_viewport",
24495
24819
  "unitColumn": "rp_Gk-byG_unitColumn",
24496
- "actionHeading": "rp_Gk-byG_actionHeading",
24497
- "detailsColumn": "rp_Gk-byG_detailsColumn",
24498
- "table": "rp_Gk-byG_table"
24820
+ "unit": "rp_Gk-byG_unit",
24821
+ "actionsColumn": "rp_Gk-byG_actionsColumn",
24822
+ "confirmation": "rp_Gk-byG_confirmation",
24823
+ "syncedColumn": "rp_Gk-byG_syncedColumn",
24824
+ "choices": "rp_Gk-byG_choices",
24825
+ "page": "rp_Gk-byG_page",
24826
+ "failed": "rp_Gk-byG_failed",
24827
+ "toolbar": "rp_Gk-byG_toolbar",
24828
+ "detail": "rp_Gk-byG_detail",
24829
+ "message": "rp_Gk-byG_message",
24830
+ "table": "rp_Gk-byG_table",
24831
+ "caption": "rp_Gk-byG_caption",
24832
+ "stateColumn": "rp_Gk-byG_stateColumn"
24499
24833
  };
24500
24834
  // src/client/pages/sync/SyncPage.tsx
24501
24835
  const when = (iso, never, locale) => iso === void 0 ? never : new Date(iso).toLocaleString(locale);
@@ -25320,14 +25654,14 @@ window.__ModuleLoader__.load({
25320
25654
  }
25321
25655
  tag$23.textContent = css$23;
25322
25656
  var Toast_module_css_default = {
25323
- "text": "rp_jnVj9q_text",
25324
25657
  "rpToastEnter": "rp_jnVj9q_rpToastEnter",
25325
- "actionButton": "rp_jnVj9q_actionButton",
25326
- "action": "rp_jnVj9q_action",
25658
+ "prefix": "rp_jnVj9q_prefix",
25327
25659
  "fading": "rp_jnVj9q_fading",
25328
- "banner": "rp_jnVj9q_banner",
25660
+ "action": "rp_jnVj9q_action",
25329
25661
  "success": "rp_jnVj9q_success",
25330
- "prefix": "rp_jnVj9q_prefix"
25662
+ "actionButton": "rp_jnVj9q_actionButton",
25663
+ "banner": "rp_jnVj9q_banner",
25664
+ "text": "rp_jnVj9q_text"
25331
25665
  };
25332
25666
  // src/client/ui/Toast.tsx
25333
25667
  const FADE_MS = 200;
@@ -25385,7 +25719,7 @@ window.__ModuleLoader__.load({
25385
25719
  });
25386
25720
  }
25387
25721
  // \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/widgets/world-card/WorldCard.module.css.mjs
25388
- const css$22 = ".rp_Bvxx5q_card{border:.5px solid var(--dsw-alias-settings-card-stroke);border-radius:var(--dsw-radius-xl);background:var(--dsw-alias-settings-card-fill);flex-direction:column;flex:auto;min-width:0;transition:border-color .12s;display:flex;position:relative;overflow:hidden}.rp_Bvxx5q_card:hover{border-color:var(--dsw-alias-border-l4)}.rp_Bvxx5q_card:focus-visible{outline:var(--dsw-focus-ring-width) solid var(--dsw-focus-ring-color);outline-offset:2px}.rp_Bvxx5q_cover{background:var(--dsw-alias-bg-layer-3);flex:1 1 0;min-height:0;position:relative;overflow:hidden}.rp_Bvxx5q_image{object-fit:cover;width:100%;height:100%;display:block}.rp_Bvxx5q_placeholder{color:#ffffffd9;background:linear-gradient(145deg, hsl(var(--rp-hue) 38% 46%), hsl(calc(var(--rp-hue) + 35) 38% 32%));user-select:none;justify-content:center;align-items:center;width:100%;height:100%;font-size:40px;font-weight:500;display:flex}.rp_Bvxx5q_play{z-index:2;corner-shape:round;color:#fff;opacity:.6;cursor:pointer;background:#00000059;border:0;border-radius:50%;justify-content:center;align-items:center;width:28px;height:28px;padding:0;transition:opacity .12s,background-color .12s;display:flex;position:absolute;top:8px;right:8px}.rp_Bvxx5q_card:hover .rp_Bvxx5q_play,.rp_Bvxx5q_play:focus-visible{opacity:1}.rp_Bvxx5q_play:hover{background:#0000008c}.rp_Bvxx5q_play:focus-visible{outline:var(--dsw-focus-ring-width) solid var(--dsw-focus-ring-color);outline-offset:2px}.rp_Bvxx5q_info{flex-direction:column;flex:none;gap:4px;padding:8px 10px;display:flex}.rp_Bvxx5q_name{text-overflow:ellipsis;white-space:nowrap;color:var(--dsw-alias-label-primary);font-size:13px;font-weight:500;line-height:20px;overflow:hidden}.rp_Bvxx5q_tags{gap:4px;display:flex;overflow:hidden;mask-image:linear-gradient(90deg,#000 calc(100% - 20px),#0000)}.rp_Bvxx5q_tag{flex:none}.rp_Bvxx5q_openButton{z-index:1;border-radius:inherit;cursor:pointer;background:0 0;border:0;width:100%;padding:0;position:absolute;inset:0}.rp_Bvxx5q_openButton:focus-visible{outline:var(--dsw-focus-ring-width) solid var(--dsw-focus-ring-color);outline-offset:-2px}";
25722
+ const css$22 = ".rp_Bvxx5q_card{border:.5px solid var(--dsw-alias-settings-card-stroke);border-radius:var(--dsw-radius-xl);background:var(--dsw-alias-settings-card-fill);flex-direction:column;flex:auto;min-width:0;transition:border-color .12s;display:flex;position:relative;overflow:hidden}.rp_Bvxx5q_card:hover{border-color:var(--dsw-alias-border-l4)}.rp_Bvxx5q_card:focus-visible{outline:var(--dsw-focus-ring-width) solid var(--dsw-focus-ring-color);outline-offset:2px}.rp_Bvxx5q_cover{background:var(--dsw-alias-bg-layer-3);flex:1 1 0;min-height:0;position:relative;overflow:hidden}.rp_Bvxx5q_image{object-fit:cover;width:100%;height:100%;display:block}.rp_Bvxx5q_placeholder{color:#ffffffd9;background:linear-gradient(145deg, hsl(var(--rp-hue) 38% 46%), hsl(calc(var(--rp-hue) + 35) 38% 32%));user-select:none;justify-content:center;align-items:center;width:100%;height:100%;font-size:40px;font-weight:500;display:flex}.rp_Bvxx5q_play{z-index:2;corner-shape:round;color:#fff;opacity:.6;cursor:pointer;background:#00000059;border:0;border-radius:50%;justify-content:center;align-items:center;width:28px;height:28px;padding:0;transition:opacity .12s,background-color .12s;display:flex;position:absolute;top:8px;right:8px}.rp_Bvxx5q_card:hover .rp_Bvxx5q_play,.rp_Bvxx5q_play:focus-visible{opacity:1}.rp_Bvxx5q_play:hover{background:#0000008c}.rp_Bvxx5q_play:focus-visible{outline:var(--dsw-focus-ring-width) solid var(--dsw-focus-ring-color);outline-offset:2px}.rp_Bvxx5q_info{flex-direction:column;flex:none;gap:4px;padding:8px 10px;display:flex}.rp_Bvxx5q_name{text-overflow:ellipsis;white-space:nowrap;color:var(--dsw-alias-label-primary);font-size:13px;font-weight:500;line-height:20px;overflow:hidden}.rp_Bvxx5q_tags{gap:4px;height:19px;display:flex;overflow:hidden;mask-image:linear-gradient(90deg,#000 calc(100% - 20px),#0000)}.rp_Bvxx5q_tag{flex:none}.rp_Bvxx5q_openButton{z-index:1;border-radius:inherit;cursor:pointer;background:0 0;border:0;width:100%;padding:0;position:absolute;inset:0}.rp_Bvxx5q_openButton:focus-visible{outline:var(--dsw-focus-ring-width) solid var(--dsw-focus-ring-color);outline-offset:-2px}";
25389
25723
  const key$22 = "src/client/widgets/world-card/WorldCard.module.css";
25390
25724
  let tag$22 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$22) + "]");
25391
25725
  if (tag$22 === null) {
@@ -25396,16 +25730,16 @@ window.__ModuleLoader__.load({
25396
25730
  }
25397
25731
  tag$22.textContent = css$22;
25398
25732
  var WorldCard_module_css_default = {
25399
- "tags": "rp_Bvxx5q_tags",
25733
+ "tag": "rp_Bvxx5q_tag",
25400
25734
  "info": "rp_Bvxx5q_info",
25401
25735
  "cover": "rp_Bvxx5q_cover",
25402
- "name": "rp_Bvxx5q_name",
25403
25736
  "openButton": "rp_Bvxx5q_openButton",
25404
- "card": "rp_Bvxx5q_card",
25737
+ "tags": "rp_Bvxx5q_tags",
25405
25738
  "placeholder": "rp_Bvxx5q_placeholder",
25406
- "play": "rp_Bvxx5q_play",
25407
25739
  "image": "rp_Bvxx5q_image",
25408
- "tag": "rp_Bvxx5q_tag"
25740
+ "play": "rp_Bvxx5q_play",
25741
+ "card": "rp_Bvxx5q_card",
25742
+ "name": "rp_Bvxx5q_name"
25409
25743
  };
25410
25744
  // src/client/widgets/world-card/WorldCard.tsx
25411
25745
  /** Stable hue per name, so a world without a cover keeps the same colour. */
@@ -25477,7 +25811,7 @@ window.__ModuleLoader__.load({
25477
25811
  "data-testid": "world-draft",
25478
25812
  children: draftLabel
25479
25813
  })]
25480
- }), world.tags.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
25814
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
25481
25815
  className: WorldCard_module_css_default.tags,
25482
25816
  children: world.tags.map((tag) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Tag, {
25483
25817
  tone: "neutral",
@@ -25502,9 +25836,9 @@ window.__ModuleLoader__.load({
25502
25836
  }
25503
25837
  tag$21.textContent = css$21;
25504
25838
  var AvatarChoices_module_css_default = {
25505
- "summary": "rp_YCstOG_summary",
25506
- "option": "rp_YCstOG_option",
25507
25839
  "text": "rp_YCstOG_text",
25840
+ "option": "rp_YCstOG_option",
25841
+ "summary": "rp_YCstOG_summary",
25508
25842
  "name": "rp_YCstOG_name"
25509
25843
  };
25510
25844
  // src/client/widgets/avatar-choices/AvatarChoices.tsx
@@ -25543,18 +25877,18 @@ window.__ModuleLoader__.load({
25543
25877
  }
25544
25878
  tag$20.textContent = css$20;
25545
25879
  var StartSessionDialog_module_css_default = {
25546
- "error": "rp_AnbLKG_error",
25880
+ "optionText": "rp_AnbLKG_optionText",
25881
+ "advancedToggle": "rp_AnbLKG_advancedToggle",
25882
+ "form": "rp_AnbLKG_form",
25883
+ "option": "rp_AnbLKG_option",
25884
+ "field": "rp_AnbLKG_field",
25885
+ "optionSummary": "rp_AnbLKG_optionSummary",
25886
+ "message": "rp_AnbLKG_message",
25547
25887
  "advancedBody": "rp_AnbLKG_advancedBody",
25548
25888
  "label": "rp_AnbLKG_label",
25549
25889
  "optionName": "rp_AnbLKG_optionName",
25550
- "advancedToggle": "rp_AnbLKG_advancedToggle",
25551
- "field": "rp_AnbLKG_field",
25552
- "option": "rp_AnbLKG_option",
25553
25890
  "advanced": "rp_AnbLKG_advanced",
25554
- "form": "rp_AnbLKG_form",
25555
- "optionText": "rp_AnbLKG_optionText",
25556
- "optionSummary": "rp_AnbLKG_optionSummary",
25557
- "message": "rp_AnbLKG_message"
25891
+ "error": "rp_AnbLKG_error"
25558
25892
  };
25559
25893
  // src/client/pages/worlds/AddAvatarsDialog.tsx
25560
25894
  /** Asks which avatars become characters of a world's own files. */
@@ -25846,6 +26180,7 @@ window.__ModuleLoader__.load({
25846
26180
  mode: choice([
25847
26181
  "off",
25848
26182
  "manual",
26183
+ "important",
25849
26184
  "every-turn"
25850
26185
  ], "manual"),
25851
26186
  references: choice([
@@ -26478,6 +26813,10 @@ window.__ModuleLoader__.load({
26478
26813
  value: "manual",
26479
26814
  label: "imagesManual"
26480
26815
  },
26816
+ {
26817
+ value: "important",
26818
+ label: "imagesImportant"
26819
+ },
26481
26820
  {
26482
26821
  value: "every-turn",
26483
26822
  label: "imagesEveryTurn"
@@ -26874,13 +27213,8 @@ window.__ModuleLoader__.load({
26874
27213
  }
26875
27214
  return next;
26876
27215
  }
26877
- // ../../node_modules/.pnpm/@dsh-ai-providers+core@0.7.0_@deepseek-ai+cordis@4.1.0_@deepseek-ai+dsh-llm@0.2.2-rc.1_@deepseek-ai+cordis@4.1.0_/node_modules/@dsh-ai-providers/core/lib/index.js
26878
- /**
26879
- * The browser API of the main plugin, which the UI of the main plugin and of every vendor plugin
26880
- * uses. Paths are relative to the prefix, and the browser calls them with relative URLs so that a
26881
- * mounted deployment works.
26882
- */
26883
- const AI_API_PREFIX = "ai-api";
27216
+ /** What the browser prepends to a route: absolute, so a mounted deployment resolves it against the origin. */
27217
+ const AI_API_PREFIX = `/api/ai-api`;
26884
27218
  const AI_API_ROUTES = {
26885
27219
  capabilities: "/capabilities",
26886
27220
  credentials: "/credentials",
@@ -26934,8 +27268,8 @@ window.__ModuleLoader__.load({
26934
27268
  }
26935
27269
  tag$19.textContent = css$19;
26936
27270
  var SegmentedControl_module_css_default = {
26937
- "rpTab": "rp_wN4Tqa_rpTab",
26938
27271
  "rpControl": "rp_wN4Tqa_rpControl",
27272
+ "rpTab": "rp_wN4Tqa_rpTab",
26939
27273
  "rpIndicator": "rp_wN4Tqa_rpIndicator"
26940
27274
  };
26941
27275
  // src/client/ui/walk.ts
@@ -27029,15 +27363,15 @@ window.__ModuleLoader__.load({
27029
27363
  }
27030
27364
  tag$18.textContent = css$18;
27031
27365
  var SettingsFields_module_css_default = {
27366
+ "help": "rp_Rhi3yq_help",
27032
27367
  "row": "rp_Rhi3yq_row",
27033
- "choiceField": "rp_Rhi3yq_choiceField",
27034
27368
  "label": "rp_Rhi3yq_label",
27035
- "help": "rp_Rhi3yq_help",
27036
- "groupTitle": "rp_Rhi3yq_groupTitle",
27369
+ "choiceField": "rp_Rhi3yq_choiceField",
27037
27370
  "field": "rp_Rhi3yq_field",
27038
- "error": "rp_Rhi3yq_error",
27371
+ "area": "rp_Rhi3yq_area",
27039
27372
  "group": "rp_Rhi3yq_group",
27040
- "area": "rp_Rhi3yq_area"
27373
+ "error": "rp_Rhi3yq_error",
27374
+ "groupTitle": "rp_Rhi3yq_groupTitle"
27041
27375
  };
27042
27376
  // src/client/settings-form/SettingsFields.tsx
27043
27377
  /** The settings of a chat as editable fields: one control with its explanation under each. */
@@ -27986,25 +28320,25 @@ window.__ModuleLoader__.load({
27986
28320
  }
27987
28321
  tag$16.textContent = css$16;
27988
28322
  var WorldsPage_module_css_default = {
27989
- "spinning": "rp_FHUyRq_spinning",
27990
- "editTitle": "rp_FHUyRq_editTitle",
27991
- "toolbar": "rp_FHUyRq_toolbar",
27992
28323
  "message": "rp_FHUyRq_message",
27993
- "editActions": "rp_FHUyRq_editActions",
27994
- "count": "rp_FHUyRq_count",
27995
- "spin": "rp_FHUyRq_spin",
27996
- "info": "rp_FHUyRq_info",
27997
- "starters": "rp_FHUyRq_starters",
27998
28324
  "grid": "rp_FHUyRq_grid",
28325
+ "editHeader": "rp_FHUyRq_editHeader",
28326
+ "toolbar": "rp_FHUyRq_toolbar",
28327
+ "count": "rp_FHUyRq_count",
27999
28328
  "notice": "rp_FHUyRq_notice",
28000
28329
  "page": "rp_FHUyRq_page",
28001
- "viewport": "rp_FHUyRq_viewport",
28330
+ "scrolls": "rp_FHUyRq_scrolls",
28331
+ "spinning": "rp_FHUyRq_spinning",
28332
+ "spin": "rp_FHUyRq_spin",
28002
28333
  "cell": "rp_FHUyRq_cell",
28003
- "toolbarActions": "rp_FHUyRq_toolbarActions",
28334
+ "viewport": "rp_FHUyRq_viewport",
28335
+ "info": "rp_FHUyRq_info",
28004
28336
  "editBody": "rp_FHUyRq_editBody",
28005
- "scrolls": "rp_FHUyRq_scrolls",
28337
+ "starters": "rp_FHUyRq_starters",
28006
28338
  "starter": "rp_FHUyRq_starter",
28007
- "editHeader": "rp_FHUyRq_editHeader",
28339
+ "toolbarActions": "rp_FHUyRq_toolbarActions",
28340
+ "editActions": "rp_FHUyRq_editActions",
28341
+ "editTitle": "rp_FHUyRq_editTitle",
28008
28342
  "fits": "rp_FHUyRq_fits"
28009
28343
  };
28010
28344
  // src/client/pages/worlds/StarterWorlds.tsx
@@ -29191,7 +29525,7 @@ window.__ModuleLoader__.load({
29191
29525
  suggestionsCount: "Suggested actions",
29192
29526
  suggestionsCountHelp: "After each turn, a helper writes this many things your character could do next from what you just read, in the background. Click one to put it in the input box (you can edit it before sending). 0 offers none and makes no model call.",
29193
29527
  imagesMode: "Scene illustrations",
29194
- imagesModeHelp: "Manual offers an image button beneath each delivered turn. Every turn also starts an image author in the background after the text appears. Off makes no image calls.",
29528
+ imagesModeHelp: "Manual offers an image button beneath each delivered turn. Every turn also starts an image author in the background after the text appears. When it matters asks a helper after each turn whether the moment is worth a picture, and makes one only if it is. Off makes no image calls.",
29195
29529
  imagesHighRes: "Hires fix",
29196
29530
  imagesHighResHelp: "Render each picture twice: first at the configured size, then again larger from that result, which adds detail while keeping the composition. Slower; only image services that can repaint an image do it, the others ignore it.",
29197
29531
  imagesReuse: "Reuse existing images",
@@ -29274,6 +29608,7 @@ window.__ModuleLoader__.load({
29274
29608
  imagesOff: "Off",
29275
29609
  imagesManual: "Manual",
29276
29610
  imagesEveryTurn: "Every turn",
29611
+ imagesImportant: "When it matters",
29277
29612
  imageReferences: "Canonical references",
29278
29613
  imageReferencesHelp: "Reference images improve consistency when the provider supports image editing. Require makes a missing reference before illustrating; Prefer uses those already present; Text only sends descriptions.",
29279
29614
  imageReferencesText: "Text only",
@@ -29441,7 +29776,7 @@ window.__ModuleLoader__.load({
29441
29776
  suggestionsCount: "行动建议数量",
29442
29777
  suggestionsCountHelp: "每轮结束后,一个助手会根据你刚读到的内容,在后台写出这么多条你的角色接下来可以做的事。点击其中一条即可填入输入框(发送前可以修改)。0 表示不提供,也不会调用模型。",
29443
29778
  imagesMode: "场景插图",
29444
- imagesModeHelp: "手动模式会在每轮叙述下方提供生成按钮;每轮模式还会在文字显示后于后台启动图像作者;关闭后不会调用图像服务。",
29779
+ imagesModeHelp: "手动模式会在每轮叙述下方提供生成按钮;每轮模式还会在文字显示后于后台启动图像作者;“重要时”会在每轮之后让助手判断这一刻值不值得配图,值得才生成;关闭后不会调用图像服务。",
29445
29780
  imagesHighRes: "高清修复",
29446
29781
  imagesHighResHelp: "每张图渲染两次:先按设定尺寸,再以该结果为基础放大重绘,保持构图并增加细节。更慢;只有支持图生图的图像服务才会执行,其他服务会忽略。",
29447
29782
  imagesReuse: "复用已有图像",
@@ -29524,6 +29859,7 @@ window.__ModuleLoader__.load({
29524
29859
  imagesOff: "关闭",
29525
29860
  imagesManual: "手动",
29526
29861
  imagesEveryTurn: "每轮",
29862
+ imagesImportant: "重要时",
29527
29863
  imageReferences: "规范参考图",
29528
29864
  imageReferencesHelp: "提供方支持图像编辑时,参考图可提高一致性。必须会先补齐缺少的参考图;优先只使用已有参考图;纯文本只发送描述。",
29529
29865
  imageReferencesText: "纯文本",
@@ -29712,6 +30048,7 @@ window.__ModuleLoader__.load({
29712
30048
  imagesOff: "オフ",
29713
30049
  imagesManual: "手動",
29714
30050
  imagesEveryTurn: "毎ターン",
30051
+ imagesImportant: "重要な場面だけ",
29715
30052
  imagesHighRes: "高解像度補正",
29716
30053
  imagesHighResHelp: "画像を設定サイズで作り、その結果を使って大きく描き直します。構図を保ちながら細部を増やせますが、遅くなります。画像編集に対応するサービスだけが実行し、ほかは無視します。",
29717
30054
  imagesReuse: "既存画像を再利用",
@@ -29963,6 +30300,7 @@ window.__ModuleLoader__.load({
29963
30300
  imagesOff: "Desactivadas",
29964
30301
  imagesManual: "Manual",
29965
30302
  imagesEveryTurn: "Cada turno",
30303
+ imagesImportant: "Cuando importa",
29966
30304
  imagesHighRes: "Mejora de alta resolución",
29967
30305
  imagesHighResHelp: "Renderiza cada imagen dos veces: primero al tamaño configurado y luego más grande a partir del resultado, para añadir detalle sin cambiar la composición. Es más lento y solo funciona con servicios capaces de repintar una imagen.",
29968
30306
  imagesReuse: "Reutilizar imágenes existentes",
@@ -30214,6 +30552,7 @@ window.__ModuleLoader__.load({
30214
30552
  imagesOff: "Désactivées",
30215
30553
  imagesManual: "Manuel",
30216
30554
  imagesEveryTurn: "Chaque tour",
30555
+ imagesImportant: "Quand c’est important",
30217
30556
  imagesHighRes: "Amélioration haute résolution",
30218
30557
  imagesHighResHelp: "Rend chaque image deux fois : d’abord à la taille configurée, puis en plus grand à partir du résultat, afin d’ajouter des détails sans changer la composition. Plus lent ; seuls les services capables de repeindre une image l’utilisent.",
30219
30558
  imagesReuse: "Réutiliser les images existantes",
@@ -30465,6 +30804,7 @@ window.__ModuleLoader__.load({
30465
30804
  imagesOff: "Aus",
30466
30805
  imagesManual: "Manuell",
30467
30806
  imagesEveryTurn: "Jeder Zug",
30807
+ imagesImportant: "Wenn es wichtig ist",
30468
30808
  imagesHighRes: "Hochauflösende Verfeinerung",
30469
30809
  imagesHighResHelp: "Rendert jedes Bild zweimal: zuerst in der eingestellten Größe, dann größer auf Grundlage des Ergebnisses. Das fügt Details hinzu und bewahrt die Komposition, ist aber langsamer. Nur Bilddienste mit Bearbeitung unterstützen es.",
30470
30810
  imagesReuse: "Vorhandene Bilder wiederverwenden",
@@ -30716,6 +31056,7 @@ window.__ModuleLoader__.load({
30716
31056
  imagesOff: "Выкл.",
30717
31057
  imagesManual: "Вручную",
30718
31058
  imagesEveryTurn: "Каждый ход",
31059
+ imagesImportant: "Только в важные моменты",
30719
31060
  imagesHighRes: "Повышение разрешения",
30720
31061
  imagesHighResHelp: "Создаёт каждое изображение дважды: сначала в заданном размере, затем крупнее на основе результата, добавляя детали и сохраняя композицию. Это медленнее и работает только со службами, умеющими перерисовывать изображение.",
30721
31062
  imagesReuse: "Повторно использовать изображения",
@@ -30967,6 +31308,7 @@ window.__ModuleLoader__.load({
30967
31308
  imagesOff: "Desligadas",
30968
31309
  imagesManual: "Manual",
30969
31310
  imagesEveryTurn: "Todos os turnos",
31311
+ imagesImportant: "Quando importa",
30970
31312
  imagesHighRes: "Melhoria de alta resolução",
30971
31313
  imagesHighResHelp: "Renderiza cada imagem duas vezes: primeiro no tamanho configurado e depois maior a partir do resultado, acrescentando pormenor sem alterar a composição. É mais lento e só funciona com serviços que conseguem repintar uma imagem.",
30972
31314
  imagesReuse: "Reutilizar imagens existentes",
@@ -32639,7 +32981,20 @@ window.__ModuleLoader__.load({
32639
32981
  look();
32640
32982
  return list.subscribe(look);
32641
32983
  }
32984
+ /** Follows the branches the transcript's Branch control makes: DSH's fork no longer says which chat it came from, so the control says so. */
32985
+ listen() {
32986
+ const heard = (event) => {
32987
+ const chat = event.detail?.chat;
32988
+ if (typeof chat === "string" && roleplaySessionOf(chat) !== void 0) this.ask(chat);
32989
+ };
32990
+ const page = globalThis.window;
32991
+ page?.addEventListener("roleplay:branched", heard);
32992
+ return () => {
32993
+ page?.removeEventListener("roleplay:branched", heard);
32994
+ };
32995
+ }
32642
32996
  async ask(chat) {
32997
+ if (this.store.getSnapshot().pending !== void 0) return;
32643
32998
  const response = await fetch(`${API_PREFIX}/sessions`);
32644
32999
  if (!response.ok) return;
32645
33000
  const session = (await response.json()).sessions.find((candidate) => candidate.chatSessionId === chat);
@@ -32690,9 +33045,9 @@ window.__ModuleLoader__.load({
32690
33045
  }
32691
33046
  tag$15.textContent = css$15;
32692
33047
  var BranchDialog_module_css_default = {
33048
+ "error": "rp_Dy1TaW_error",
32693
33049
  "label": "rp_Dy1TaW_label",
32694
33050
  "field": "rp_Dy1TaW_field",
32695
- "error": "rp_Dy1TaW_error",
32696
33051
  "form": "rp_Dy1TaW_form"
32697
33052
  };
32698
33053
  // src/client/branch/BranchDialog.tsx
@@ -32848,6 +33203,7 @@ window.__ModuleLoader__.load({
32848
33203
  function registerBranchNaming(ctx) {
32849
33204
  ctx.effect(() => ctx.locale.register(NAMESPACE$8, dictionaries$7), "roleplay: branch dictionaries");
32850
33205
  const branches = new BranchController();
33206
+ ctx.effect(() => branches.listen(), "roleplay: branch listener");
32851
33207
  ctx.inject(["sessions"], (inner) => {
32852
33208
  const sessions = inner.get("sessions");
32853
33209
  if (sessions !== void 0) inner.effect(() => branches.watch(sessions.list), "roleplay: branch watch");
@@ -32871,11 +33227,11 @@ window.__ModuleLoader__.load({
32871
33227
  }
32872
33228
  tag$14.textContent = css$14;
32873
33229
  var SidebarGuideEntry_module_css_default = {
32874
- "text": "rp_Okaj1q_text",
32875
- "icon": "rp_Okaj1q_icon",
32876
33230
  "description": "rp_Okaj1q_description",
32877
- "main": "rp_Okaj1q_main",
32878
33231
  "entry": "rp_Okaj1q_entry",
33232
+ "icon": "rp_Okaj1q_icon",
33233
+ "text": "rp_Okaj1q_text",
33234
+ "main": "rp_Okaj1q_main",
32879
33235
  "title": "rp_Okaj1q_title"
32880
33236
  };
32881
33237
  // src/client/widgets/sidebar-guide/SidebarGuideEntry.tsx
@@ -32923,9 +33279,9 @@ window.__ModuleLoader__.load({
32923
33279
  }
32924
33280
  tag$13.textContent = css$13;
32925
33281
  var GalleryTab_module_css_default = {
32926
- "page": "rp_W688Pa_page",
33282
+ "bar": "rp_W688Pa_bar",
32927
33283
  "message": "rp_W688Pa_message",
32928
- "bar": "rp_W688Pa_bar"
33284
+ "page": "rp_W688Pa_page"
32929
33285
  };
32930
33286
  // src/client/gallery/GalleryTab.tsx
32931
33287
  /** The kind of the tab type, and the identity it registers its card and body under. */
@@ -33342,17 +33698,17 @@ window.__ModuleLoader__.load({
33342
33698
  }
33343
33699
  tag$12.textContent = css$12;
33344
33700
  var SidebarPage_module_css_default = {
33345
- "content": "rp_Ptco8a_content",
33346
33701
  "page": "rp_Ptco8a_page",
33347
- "name": "rp_Ptco8a_name",
33348
- "bar": "rp_Ptco8a_bar",
33349
- "title": "rp_Ptco8a_title",
33350
- "description": "rp_Ptco8a_description",
33351
- "entry": "rp_Ptco8a_entry",
33352
33702
  "text": "rp_Ptco8a_text",
33703
+ "name": "rp_Ptco8a_name",
33704
+ "content": "rp_Ptco8a_content",
33705
+ "main": "rp_Ptco8a_main",
33353
33706
  "message": "rp_Ptco8a_message",
33707
+ "entry": "rp_Ptco8a_entry",
33354
33708
  "icon": "rp_Ptco8a_icon",
33355
- "main": "rp_Ptco8a_main"
33709
+ "title": "rp_Ptco8a_title",
33710
+ "description": "rp_Ptco8a_description",
33711
+ "bar": "rp_Ptco8a_bar"
33356
33712
  };
33357
33713
  // src/client/interface/SidebarPage.tsx
33358
33714
  /** The kind of the tab type, and the identity it registers its card and body under. */
@@ -33981,24 +34337,24 @@ window.__ModuleLoader__.load({
33981
34337
  }
33982
34338
  tag$11.textContent = css$11;
33983
34339
  var RecallTab_module_css_default = {
33984
- "form": "rp_jl9CIq_form",
33985
- "list": "rp_jl9CIq_list",
33986
- "item": "rp_jl9CIq_item",
33987
- "hint": "rp_jl9CIq_hint",
33988
- "area": "rp_jl9CIq_area",
33989
- "actions": "rp_jl9CIq_actions",
33990
- "heading": "rp_jl9CIq_heading",
33991
- "place": "rp_jl9CIq_place",
33992
- "body": "rp_jl9CIq_body",
33993
- "label": "rp_jl9CIq_label",
33994
- "bar": "rp_jl9CIq_bar",
33995
34340
  "page": "rp_jl9CIq_page",
33996
- "name": "rp_jl9CIq_name",
34341
+ "body": "rp_jl9CIq_body",
33997
34342
  "field": "rp_jl9CIq_field",
34343
+ "label": "rp_jl9CIq_label",
34344
+ "hint": "rp_jl9CIq_hint",
34345
+ "person": "rp_jl9CIq_person",
34346
+ "note": "rp_jl9CIq_note",
33998
34347
  "meta": "rp_jl9CIq_meta",
34348
+ "heading": "rp_jl9CIq_heading",
34349
+ "bar": "rp_jl9CIq_bar",
33999
34350
  "error": "rp_jl9CIq_error",
34000
- "person": "rp_jl9CIq_person",
34001
- "note": "rp_jl9CIq_note"
34351
+ "name": "rp_jl9CIq_name",
34352
+ "list": "rp_jl9CIq_list",
34353
+ "item": "rp_jl9CIq_item",
34354
+ "form": "rp_jl9CIq_form",
34355
+ "actions": "rp_jl9CIq_actions",
34356
+ "area": "rp_jl9CIq_area",
34357
+ "place": "rp_jl9CIq_place"
34002
34358
  };
34003
34359
  // src/client/recall/RecallTab.tsx
34004
34360
  /** The kind of the tab type, and the identity it registers its card and body under. */
@@ -34854,11 +35210,11 @@ window.__ModuleLoader__.load({
34854
35210
  }
34855
35211
  tag$10.textContent = css$10;
34856
35212
  var ReferenceTab_module_css_default = {
34857
- "page": "rp_7BGO2a_page",
34858
35213
  "bar": "rp_7BGO2a_bar",
34859
- "nav": "rp_7BGO2a_nav",
34860
35214
  "body": "rp_7BGO2a_body",
34861
- "message": "rp_7BGO2a_message"
35215
+ "message": "rp_7BGO2a_message",
35216
+ "nav": "rp_7BGO2a_nav",
35217
+ "page": "rp_7BGO2a_page"
34862
35218
  };
34863
35219
  // src/client/reference/ReferenceTab.tsx
34864
35220
  /** The kind of the tab type, and the identity it registers its card and body under. */
@@ -34978,28 +35334,28 @@ window.__ModuleLoader__.load({
34978
35334
  }
34979
35335
  tag$9.textContent = css$9;
34980
35336
  var Page_module_css_default = {
34981
- "link": "rp_bG1sCa_link",
34982
- "head": "rp_bG1sCa_head",
34983
- "text": "rp_bG1sCa_text",
34984
- "heading": "rp_bG1sCa_heading",
35337
+ "meta": "rp_bG1sCa_meta",
35338
+ "name": "rp_bG1sCa_name",
34985
35339
  "place": "rp_bG1sCa_place",
34986
- "edgeLabel": "rp_bG1sCa_edgeLabel",
34987
35340
  "journal": "rp_bG1sCa_journal",
34988
- "name": "rp_bG1sCa_name",
35341
+ "edgeLabel": "rp_bG1sCa_edgeLabel",
34989
35342
  "closedWay": "rp_bG1sCa_closedWay",
34990
- "here": "rp_bG1sCa_here",
34991
- "title": "rp_bG1sCa_title",
34992
- "meta": "rp_bG1sCa_meta",
34993
- "map": "rp_bG1sCa_map",
34994
- "entry": "rp_bG1sCa_entry",
35343
+ "tag": "rp_bG1sCa_tag",
34995
35344
  "way": "rp_bG1sCa_way",
35345
+ "text": "rp_bG1sCa_text",
35346
+ "link": "rp_bG1sCa_link",
35347
+ "notes": "rp_bG1sCa_notes",
34996
35348
  "list": "rp_bG1sCa_list",
35349
+ "entry": "rp_bG1sCa_entry",
35350
+ "head": "rp_bG1sCa_head",
35351
+ "map": "rp_bG1sCa_map",
35352
+ "here": "rp_bG1sCa_here",
34997
35353
  "placeName": "rp_bG1sCa_placeName",
34998
- "sub": "rp_bG1sCa_sub",
34999
35354
  "block": "rp_bG1sCa_block",
35355
+ "sub": "rp_bG1sCa_sub",
35000
35356
  "opened": "rp_bG1sCa_opened",
35001
- "tag": "rp_bG1sCa_tag",
35002
- "notes": "rp_bG1sCa_notes",
35357
+ "heading": "rp_bG1sCa_heading",
35358
+ "title": "rp_bG1sCa_title",
35003
35359
  "message": "rp_bG1sCa_message"
35004
35360
  };
35005
35361
  // src/client/reference/sections/Journal.tsx
@@ -36096,28 +36452,28 @@ window.__ModuleLoader__.load({
36096
36452
  }
36097
36453
  tag$8.textContent = css$8;
36098
36454
  var ChatSettingsView_module_css_default = {
36099
- "message": "rp_wLpbxW_message",
36100
- "activity": "rp_wLpbxW_activity",
36101
- "tableViewport": "rp_wLpbxW_tableViewport",
36102
- "description": "rp_wLpbxW_description",
36455
+ "table": "rp_wLpbxW_table",
36456
+ "label": "rp_wLpbxW_label",
36457
+ "select": "rp_wLpbxW_select",
36458
+ "notice": "rp_wLpbxW_notice",
36103
36459
  "pre": "rp_wLpbxW_pre",
36460
+ "title": "rp_wLpbxW_title",
36461
+ "reasons": "rp_wLpbxW_reasons",
36462
+ "list": "rp_wLpbxW_list",
36463
+ "description": "rp_wLpbxW_description",
36464
+ "help": "rp_wLpbxW_help",
36104
36465
  "actions": "rp_wLpbxW_actions",
36105
- "row": "rp_wLpbxW_row",
36106
- "saved": "rp_wLpbxW_saved",
36466
+ "tableViewport": "rp_wLpbxW_tableViewport",
36467
+ "activity": "rp_wLpbxW_activity",
36468
+ "run": "rp_wLpbxW_run",
36107
36469
  "view": "rp_wLpbxW_view",
36470
+ "error": "rp_wLpbxW_error",
36108
36471
  "activityBody": "rp_wLpbxW_activityBody",
36109
- "select": "rp_wLpbxW_select",
36110
- "link": "rp_wLpbxW_link",
36111
- "list": "rp_wLpbxW_list",
36112
36472
  "field": "rp_wLpbxW_field",
36113
- "label": "rp_wLpbxW_label",
36114
- "error": "rp_wLpbxW_error",
36115
- "reasons": "rp_wLpbxW_reasons",
36116
- "table": "rp_wLpbxW_table",
36117
- "help": "rp_wLpbxW_help",
36118
- "notice": "rp_wLpbxW_notice",
36119
- "title": "rp_wLpbxW_title",
36120
- "run": "rp_wLpbxW_run"
36473
+ "saved": "rp_wLpbxW_saved",
36474
+ "row": "rp_wLpbxW_row",
36475
+ "link": "rp_wLpbxW_link",
36476
+ "message": "rp_wLpbxW_message"
36121
36477
  };
36122
36478
  // src/client/chat-settings/settings-api.ts
36123
36479
  /** The chat is not a roleplay session, so it has no settings. */
@@ -40649,12 +41005,12 @@ window.__ModuleLoader__.load({
40649
41005
  }
40650
41006
  tag$7.textContent = css$7;
40651
41007
  var SettingsForm_module_css_default = {
40652
- "failed": "rp_eL0Ehq_failed",
40653
- "readOnly": "rp_eL0Ehq_readOnly",
40654
- "unavailable": "rp_eL0Ehq_unavailable",
40655
41008
  "form": "rp_eL0Ehq_form",
41009
+ "unavailable": "rp_eL0Ehq_unavailable",
41010
+ "failed": "rp_eL0Ehq_failed",
40656
41011
  "footer": "rp_eL0Ehq_footer",
40657
- "save": "rp_eL0Ehq_save"
41012
+ "save": "rp_eL0Ehq_save",
41013
+ "readOnly": "rp_eL0Ehq_readOnly"
40658
41014
  };
40659
41015
  // src/client/ui/SettingsForm.tsx
40660
41016
  /**
@@ -40711,17 +41067,17 @@ window.__ModuleLoader__.load({
40711
41067
  }
40712
41068
  tag$6.textContent = css$6;
40713
41069
  var SettingsValueField_module_css_default = {
40714
- "reset": "rp_AFBKEG_reset",
40715
- "head": "rp_AFBKEG_head",
40716
- "hint": "rp_AFBKEG_hint",
40717
- "badges": "rp_AFBKEG_badges",
40718
- "helpButton": "rp_AFBKEG_helpButton",
40719
41070
  "field": "rp_AFBKEG_field",
40720
41071
  "help": "rp_AFBKEG_help",
40721
- "labelGroup": "rp_AFBKEG_labelGroup",
41072
+ "reset": "rp_AFBKEG_reset",
41073
+ "helpButton": "rp_AFBKEG_helpButton",
40722
41074
  "input": "rp_AFBKEG_input",
41075
+ "invalid": "rp_AFBKEG_invalid",
40723
41076
  "label": "rp_AFBKEG_label",
40724
- "invalid": "rp_AFBKEG_invalid"
41077
+ "hint": "rp_AFBKEG_hint",
41078
+ "badges": "rp_AFBKEG_badges",
41079
+ "head": "rp_AFBKEG_head",
41080
+ "labelGroup": "rp_AFBKEG_labelGroup"
40725
41081
  };
40726
41082
  // src/client/ui/SettingsValueField.tsx
40727
41083
  /**
@@ -40807,16 +41163,16 @@ window.__ModuleLoader__.load({
40807
41163
  }
40808
41164
  tag$5.textContent = css$5;
40809
41165
  var CatalogueSettings_module_css_default = {
40810
- "keyHint": "rp_KPhXDa_keyHint",
40811
- "actions": "rp_KPhXDa_actions",
40812
41166
  "label": "rp_KPhXDa_label",
41167
+ "actions": "rp_KPhXDa_actions",
41168
+ "keyHint": "rp_KPhXDa_keyHint",
40813
41169
  "keyArea": "rp_KPhXDa_keyArea",
41170
+ "title": "rp_KPhXDa_title",
41171
+ "row": "rp_KPhXDa_row",
41172
+ "problem": "rp_KPhXDa_problem",
40814
41173
  "field": "rp_KPhXDa_field",
40815
41174
  "hint": "rp_KPhXDa_hint",
40816
- "problem": "rp_KPhXDa_problem",
40817
- "row": "rp_KPhXDa_row",
40818
- "section": "rp_KPhXDa_section",
40819
- "title": "rp_KPhXDa_title"
41175
+ "section": "rp_KPhXDa_section"
40820
41176
  };
40821
41177
  // src/client/settings/AuthoringToolSettings.tsx
40822
41178
  const boardOf = (text) => {
@@ -41056,18 +41412,18 @@ window.__ModuleLoader__.load({
41056
41412
  }
41057
41413
  tag$4.textContent = css$4;
41058
41414
  var AssistantSettings_module_css_default = {
41059
- "field": "rp_ZwzM4q_field",
41060
- "section": "rp_ZwzM4q_section",
41061
- "reset": "rp_ZwzM4q_reset",
41062
- "title": "rp_ZwzM4q_title",
41063
- "select": "rp_ZwzM4q_select",
41064
- "head": "rp_ZwzM4q_head",
41065
- "hint": "rp_ZwzM4q_hint",
41066
- "fieldHint": "rp_ZwzM4q_fieldHint",
41067
- "badges": "rp_ZwzM4q_badges",
41068
41415
  "invalid": "rp_ZwzM4q_invalid",
41416
+ "fieldHint": "rp_ZwzM4q_fieldHint",
41417
+ "hint": "rp_ZwzM4q_hint",
41069
41418
  "fields": "rp_ZwzM4q_fields",
41070
- "label": "rp_ZwzM4q_label"
41419
+ "head": "rp_ZwzM4q_head",
41420
+ "select": "rp_ZwzM4q_select",
41421
+ "label": "rp_ZwzM4q_label",
41422
+ "badges": "rp_ZwzM4q_badges",
41423
+ "section": "rp_ZwzM4q_section",
41424
+ "title": "rp_ZwzM4q_title",
41425
+ "field": "rp_ZwzM4q_field",
41426
+ "reset": "rp_ZwzM4q_reset"
41071
41427
  };
41072
41428
  // src/client/settings/AssistantSettings.tsx
41073
41429
  function ChoiceField({ t, spec, state, disabled, onEdit, onReset }) {
@@ -43359,6 +43715,7 @@ window.__ModuleLoader__.load({
43359
43715
  if (typeof value !== "object" || value === null) return false;
43360
43716
  const segment = value;
43361
43717
  if (segment["type"] === "narration") return typeof segment["text"] === "string";
43718
+ if (segment["type"] === "image") return typeof segment["path"] === "string" && segment["path"] !== "";
43362
43719
  return segment["type"] === "utterance" && typeof segment["character"] === "string" && typeof segment["name"] === "string" && typeof segment["text"] === "string";
43363
43720
  }
43364
43721
  /** The output encoded in a tool result's text, or nothing when the text carries none. */
@@ -43492,7 +43849,7 @@ window.__ModuleLoader__.load({
43492
43849
  }
43493
43850
  };
43494
43851
  // \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/transcript/NarrationView.module.css.mjs
43495
- const css$3 = ".rp_NFPimG_output{flex-direction:column;gap:8px;min-width:0;margin:8px 0;display:flex}.rp_NFPimG_narration{color:var(--dsw-alias-label-primary);white-space:pre-wrap;overflow-wrap:anywhere;margin:0;font-size:13px;line-height:22px}.rp_NFPimG_line{align-items:flex-start;gap:10px;min-width:0;display:flex}.rp_NFPimG_avatar{corner-shape:round;color:#fff;border-radius:14px;flex:none;justify-content:center;align-items:center;width:28px;height:28px;font-size:12px;font-weight:500;display:flex}.rp_NFPimG_speech{border:.5px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-lg);background:var(--dsw-alias-bg-layer-1);flex-direction:column;gap:2px;min-width:0;max-width:100%;padding:6px 10px;display:flex}.rp_NFPimG_name{color:var(--dsw-alias-label-secondary);font-size:12px;font-weight:500;line-height:18px}.rp_NFPimG_words{color:var(--dsw-alias-label-primary);white-space:pre-wrap;overflow-wrap:anywhere;font-size:13px;line-height:20px}.rp_NFPimG_note{color:var(--dsw-alias-label-tertiary);font-size:12px}.rp_NFPimG_preview{opacity:.8}.rp_NFPimG_oocNote,.rp_NFPimG_oocRefused{border-left:2px solid var(--dsw-alias-border-l2);color:var(--dsw-alias-label-secondary);margin:0;padding:6px 10px;font-size:12px;line-height:18px}.rp_NFPimG_oocRefused{border-left-color:var(--dsw-alias-state-error-primary)}.rp_NFPimG_oocLabel{font-weight:500}.rp_NFPimG_images{flex-direction:column;align-items:flex-start;gap:6px;margin:8px 0 12px;display:flex}.rp_NFPimG_sceneImage{object-fit:contain;border:.5px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-lg);width:auto;max-width:min(100%,480px);height:auto;max-height:50vh;display:block}.rp_NFPimG_imageButton{cursor:zoom-in;background:0 0;border:0;padding:0}.rp_NFPimG_imageStatus,.rp_NFPimG_imageError{color:var(--dsw-alias-label-tertiary);font-size:12px}.rp_NFPimG_imageError{color:var(--dsw-alias-state-error-primary)}.rp_NFPimG_playLine{color:var(--dsw-alias-label-secondary);cursor:pointer;vertical-align:middle;background:0 0;border:0;justify-content:center;align-items:center;width:28px;height:28px;margin:-5px -6px -5px 4px;padding:6px;display:inline-flex}.rp_NFPimG_playLine svg{width:14px;height:14px}.rp_NFPimG_playLine:disabled{cursor:wait;opacity:.5}.rp_NFPimG_playLine:hover{color:var(--dsw-alias-label-primary)}.rp_NFPimG_playLine:focus-visible{outline:var(--dsw-focus-ring-width) solid var(--dsw-focus-ring-color);outline-offset:2px;border-radius:var(--dsw-radius-xs)}@media (pointer:coarse){.rp_NFPimG_playLine{width:44px;min-width:44px;height:44px;min-height:44px;margin-block:-13px}}.rp_NFPimG_dice{color:var(--dsw-alias-label-tertiary);margin:0;font-size:12px;line-height:18px}.rp_NFPimG_diceSummary{cursor:pointer;color:var(--dsw-alias-label-secondary)}.rp_NFPimG_diceList{margin:4px 0 0;padding:0 0 0 18px}.rp_NFPimG_avatarImage{object-fit:cover}.rp_NFPimG_actions{flex-wrap:wrap;align-items:center;gap:6px 8px;display:flex}";
43852
+ const css$3 = ".rp_NFPimG_output{flex-direction:column;gap:8px;min-width:0;margin:8px 0;display:flex}.rp_NFPimG_picture{border-radius:var(--dsw-radius-sm);object-fit:contain;max-width:100%;max-height:420px;display:block}.rp_NFPimG_narration{color:var(--dsw-alias-label-primary);white-space:pre-wrap;overflow-wrap:anywhere;margin:0;font-size:13px;line-height:22px}.rp_NFPimG_line{align-items:flex-start;gap:10px;min-width:0;display:flex}.rp_NFPimG_avatar{corner-shape:round;color:#fff;border-radius:14px;flex:none;justify-content:center;align-items:center;width:28px;height:28px;font-size:12px;font-weight:500;display:flex}.rp_NFPimG_speech{border:.5px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-lg);background:var(--dsw-alias-bg-layer-1);flex-direction:column;gap:2px;min-width:0;max-width:100%;padding:6px 10px;display:flex}.rp_NFPimG_name{color:var(--dsw-alias-label-secondary);font-size:12px;font-weight:500;line-height:18px}.rp_NFPimG_words{color:var(--dsw-alias-label-primary);white-space:pre-wrap;overflow-wrap:anywhere;font-size:13px;line-height:20px}.rp_NFPimG_note{color:var(--dsw-alias-label-tertiary);font-size:12px}.rp_NFPimG_preview{opacity:.8}.rp_NFPimG_oocNote,.rp_NFPimG_oocRefused{border-left:2px solid var(--dsw-alias-border-l2);color:var(--dsw-alias-label-secondary);margin:0;padding:6px 10px;font-size:12px;line-height:18px}.rp_NFPimG_oocRefused{border-left-color:var(--dsw-alias-state-error-primary)}.rp_NFPimG_oocLabel{font-weight:500}.rp_NFPimG_images{flex-direction:column;align-items:flex-start;gap:6px;margin:8px 0 12px;display:flex}.rp_NFPimG_sceneImage{object-fit:contain;border:.5px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-lg);width:auto;max-width:min(100%,480px);height:auto;max-height:50vh;display:block}.rp_NFPimG_imageButton{cursor:zoom-in;background:0 0;border:0;padding:0}.rp_NFPimG_imageStatus,.rp_NFPimG_imageError{color:var(--dsw-alias-label-tertiary);font-size:12px}.rp_NFPimG_imageError{color:var(--dsw-alias-state-error-primary)}.rp_NFPimG_playLine{color:var(--dsw-alias-label-secondary);cursor:pointer;vertical-align:middle;background:0 0;border:0;justify-content:center;align-items:center;width:28px;height:28px;margin:-5px -6px -5px 4px;padding:6px;display:inline-flex}.rp_NFPimG_playLine svg{width:14px;height:14px}.rp_NFPimG_playLine:disabled{cursor:wait;opacity:.5}.rp_NFPimG_playLine:hover{color:var(--dsw-alias-label-primary)}.rp_NFPimG_playLine:focus-visible{outline:var(--dsw-focus-ring-width) solid var(--dsw-focus-ring-color);outline-offset:2px;border-radius:var(--dsw-radius-xs)}@media (pointer:coarse){.rp_NFPimG_playLine{width:44px;min-width:44px;height:44px;min-height:44px;margin-block:-13px}}.rp_NFPimG_dice{color:var(--dsw-alias-label-tertiary);margin:0;font-size:12px;line-height:18px}.rp_NFPimG_diceSummary{cursor:pointer;color:var(--dsw-alias-label-secondary)}.rp_NFPimG_diceList{margin:4px 0 0;padding:0 0 0 18px}.rp_NFPimG_avatarImage{object-fit:cover}.rp_NFPimG_actions{flex-wrap:wrap;align-items:center;gap:6px 8px;display:flex}";
43496
43853
  const key$3 = "src/client/transcript/NarrationView.module.css";
43497
43854
  let tag$3 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$3) + "]");
43498
43855
  if (tag$3 === null) {
@@ -43503,29 +43860,30 @@ window.__ModuleLoader__.load({
43503
43860
  }
43504
43861
  tag$3.textContent = css$3;
43505
43862
  var NarrationView_module_css_default = {
43863
+ "diceList": "rp_NFPimG_diceList",
43864
+ "avatar": "rp_NFPimG_avatar",
43865
+ "speech": "rp_NFPimG_speech",
43866
+ "imageButton": "rp_NFPimG_imageButton",
43867
+ "picture": "rp_NFPimG_picture",
43868
+ "oocLabel": "rp_NFPimG_oocLabel",
43869
+ "preview": "rp_NFPimG_preview",
43870
+ "note": "rp_NFPimG_note",
43871
+ "sceneImage": "rp_NFPimG_sceneImage",
43872
+ "oocRefused": "rp_NFPimG_oocRefused",
43873
+ "images": "rp_NFPimG_images",
43874
+ "words": "rp_NFPimG_words",
43506
43875
  "narration": "rp_NFPimG_narration",
43507
- "oocNote": "rp_NFPimG_oocNote",
43876
+ "line": "rp_NFPimG_line",
43508
43877
  "imageStatus": "rp_NFPimG_imageStatus",
43509
- "preview": "rp_NFPimG_preview",
43878
+ "avatarImage": "rp_NFPimG_avatarImage",
43879
+ "diceSummary": "rp_NFPimG_diceSummary",
43510
43880
  "actions": "rp_NFPimG_actions",
43511
- "oocLabel": "rp_NFPimG_oocLabel",
43512
- "imageButton": "rp_NFPimG_imageButton",
43513
- "oocRefused": "rp_NFPimG_oocRefused",
43881
+ "dice": "rp_NFPimG_dice",
43514
43882
  "imageError": "rp_NFPimG_imageError",
43515
- "speech": "rp_NFPimG_speech",
43516
- "name": "rp_NFPimG_name",
43517
- "sceneImage": "rp_NFPimG_sceneImage",
43518
- "diceList": "rp_NFPimG_diceList",
43519
43883
  "output": "rp_NFPimG_output",
43520
- "words": "rp_NFPimG_words",
43521
43884
  "playLine": "rp_NFPimG_playLine",
43522
- "line": "rp_NFPimG_line",
43523
- "note": "rp_NFPimG_note",
43524
- "avatar": "rp_NFPimG_avatar",
43525
- "images": "rp_NFPimG_images",
43526
- "dice": "rp_NFPimG_dice",
43527
- "diceSummary": "rp_NFPimG_diceSummary",
43528
- "avatarImage": "rp_NFPimG_avatarImage"
43885
+ "name": "rp_NFPimG_name",
43886
+ "oocNote": "rp_NFPimG_oocNote"
43529
43887
  };
43530
43888
  // src/client/transcript/PreviewNode.tsx
43531
43889
  /**
@@ -43543,6 +43901,35 @@ window.__ModuleLoader__.load({
43543
43901
  })
43544
43902
  });
43545
43903
  }
43904
+ // src/client/transcript/branching.ts
43905
+ /** Told to the window when a branch has its session, so that the player can be asked to name it; the branch feature listens. */
43906
+ const BRANCHED_EVENT = "roleplay:branched";
43907
+ /**
43908
+ * Branches a roleplay chat after the turn that ended at `atSeq`, and shows the new chat.
43909
+ * Resolved on use, so a client without the services fails at the click.
43910
+ */
43911
+ async function branchAt(scope, chat, atSeq) {
43912
+ const sessions = scope.get("sessions");
43913
+ const workspace = scope.get("uiWorkspace");
43914
+ if (sessions === void 0 || workspace === void 0) throw new Error("branching is not available in this client");
43915
+ const branch = await sessions.fork({
43916
+ sessionId: chat,
43917
+ atSeq,
43918
+ increaseTitle: true
43919
+ });
43920
+ const response = await fetch("roleplay-api/sessions/branch", {
43921
+ method: "POST",
43922
+ headers: { "content-type": "application/json" },
43923
+ body: JSON.stringify({
43924
+ chat: branch,
43925
+ parent: chat,
43926
+ atSeq
43927
+ })
43928
+ });
43929
+ if (!response.ok) throw new Error((await response.json().catch(() => ({}))).message ?? `the branch could not be made (${response.status})`);
43930
+ globalThis.window?.dispatchEvent(new CustomEvent(BRANCHED_EVENT, { detail: { chat: branch } }));
43931
+ workspace.openSession(branch);
43932
+ }
43546
43933
  // src/client/media-capabilities.ts
43547
43934
  /** A choice in the provider settings takes effect without a restart, so the answer is asked for again after a short while. */
43548
43935
  const FRESH_MS = 15e3;
@@ -43632,10 +44019,10 @@ window.__ModuleLoader__.load({
43632
44019
  const id = sessionId.startsWith("session-") ? sessionId.slice(8) : sessionId;
43633
44020
  const state = await (await fetch(`roleplay-api/sessions/world?id=${encodeURIComponent(id)}`)).json();
43634
44021
  const voices = new Map(state.characters.map((character) => [character.key, character.voice]));
43635
- const parts = segments.map((segment) => ({
44022
+ const parts = segments.flatMap((segment) => segment.type === "image" ? [] : [{
43636
44023
  text: segment.text,
43637
44024
  voice: segment.type === "utterance" ? voices.get(segment.character) : state.narrationVoice
43638
- }));
44025
+ }]);
43639
44026
  const response = await fetch("roleplay-api/speech/synthesize", {
43640
44027
  method: "POST",
43641
44028
  headers: { "content-type": "application/json" },
@@ -43701,7 +44088,15 @@ window.__ModuleLoader__.load({
43701
44088
  data.ooc.note
43702
44089
  ]
43703
44090
  }),
43704
- data.segments.map((segment, index) => segment.type === "narration" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
44091
+ data.segments.map((segment, index) => segment.type === "image" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("img", {
44092
+ className: NarrationView_module_css_default.picture,
44093
+ "data-rp": "picture",
44094
+ "data-testid": "roleplay-picture",
44095
+ src: `roleplay-api/sessions/gallery/file?id=${encodeURIComponent(sessionId.startsWith("session-") ? sessionId.slice(8) : sessionId)}&path=${encodeURIComponent(segment.path)}`,
44096
+ alt: "",
44097
+ loading: "lazy",
44098
+ decoding: "async"
44099
+ }, index) : segment.type === "narration" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
43705
44100
  className: NarrationView_module_css_default.narration,
43706
44101
  "data-rp": "prose",
43707
44102
  children: segment.text
@@ -43889,9 +44284,9 @@ window.__ModuleLoader__.load({
43889
44284
  }
43890
44285
  tag$2.textContent = css$2;
43891
44286
  var SuggestionsDock_module_css_default = {
44287
+ "label": "rp_rWH4DG_label",
43892
44288
  "dock": "rp_rWH4DG_dock",
43893
44289
  "chip": "rp_rWH4DG_chip",
43894
- "label": "rp_rWH4DG_label",
43895
44290
  "card": "rp_rWH4DG_card",
43896
44291
  "lines": "rp_rWH4DG_lines"
43897
44292
  };
@@ -44092,9 +44487,9 @@ window.__ModuleLoader__.load({
44092
44487
  tag$1.textContent = css$1;
44093
44488
  var Menu_module_css_default = {
44094
44489
  "chevron": "rp_6CY8oG_chevron",
44095
- "list": "rp_6CY8oG_list",
44096
44490
  "heading": "rp_6CY8oG_heading",
44097
- "item": "rp_6CY8oG_item"
44491
+ "item": "rp_6CY8oG_item",
44492
+ "list": "rp_6CY8oG_list"
44098
44493
  };
44099
44494
  // src/client/ui/Menu.tsx
44100
44495
  const GAP = 4;
@@ -44229,17 +44624,17 @@ window.__ModuleLoader__.load({
44229
44624
  }
44230
44625
  tag.textContent = css;
44231
44626
  var TurnsDock_module_css_default = {
44232
- "dock": "rp_f4YLlq_dock",
44233
- "comparison": "rp_f4YLlq_comparison",
44234
- "fold": "rp_f4YLlq_fold",
44235
- "comparisonLine": "rp_f4YLlq_comparisonLine",
44236
44627
  "error": "rp_f4YLlq_error",
44237
- "comparisonHead": "rp_f4YLlq_comparisonHead",
44628
+ "fold": "rp_f4YLlq_fold",
44629
+ "count": "rp_f4YLlq_count",
44238
44630
  "comparisonSubject": "rp_f4YLlq_comparisonSubject",
44631
+ "comparison": "rp_f4YLlq_comparison",
44239
44632
  "group": "rp_f4YLlq_group",
44240
- "count": "rp_f4YLlq_count",
44241
- "select": "rp_f4YLlq_select",
44242
- "button": "rp_f4YLlq_button"
44633
+ "button": "rp_f4YLlq_button",
44634
+ "dock": "rp_f4YLlq_dock",
44635
+ "comparisonHead": "rp_f4YLlq_comparisonHead",
44636
+ "comparisonLine": "rp_f4YLlq_comparisonLine",
44637
+ "select": "rp_f4YLlq_select"
44243
44638
  };
44244
44639
  // src/client/transcript/withdrawn.ts
44245
44640
  /** The rows of the transcript that belong to turns the story is not at, by the key DSH gives each row. */
@@ -45081,17 +45476,6 @@ window.__ModuleLoader__.load({
45081
45476
  if (!response.ok) throw new Error((await response.json().catch(() => ({}))).message ?? `the states could not be compared (${response.status})`);
45082
45477
  return await response.json();
45083
45478
  }
45084
- /** Branches a roleplay chat after the turn that ended at `atSeq`, and shows the new chat. Resolved on use, so a client without the services fails at the click. */
45085
- async function branchAt(scope, chat, atSeq) {
45086
- const sessions = scope.get("sessions");
45087
- const workspace = scope.get("uiWorkspace");
45088
- if (sessions === void 0 || workspace === void 0) throw new Error("branching is not available in this client");
45089
- workspace.openSession(await sessions.fork({
45090
- sessionId: chat,
45091
- atSeq,
45092
- increaseTitle: true
45093
- }));
45094
- }
45095
45479
  /** The notes the host keeps for the player beside the story; none for a chat that is not a roleplay session. */
45096
45480
  async function notesOf(chat) {
45097
45481
  const id = roleplaySessionOf(chat);