@dsh-agentic-roleplay/core 0.7.3 → 0.8.2

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 (58) hide show
  1. package/README.md +1 -1
  2. package/lib/{access-DtOxFKBK.js → access-CfQWbNZP.js} +4 -7
  3. package/lib/authoring-tools-BgmC2oqU.js +3691 -0
  4. package/lib/authoring.js +59 -24
  5. package/lib/{child-CyCViUKa.js → child-lYYeOwl2.js} +147 -46
  6. package/lib/client.js +931 -860
  7. package/lib/client.js.map +1 -1
  8. package/lib/compaction.js +8 -13
  9. package/lib/{doctor-chat-ByDfCMeo.js → doctor-chat-hL1a61hp.js} +2 -3
  10. package/lib/doctor.js +6 -8
  11. package/lib/{gallery-DmBZ2L5l.js → gallery-D1V4h8vh.js} +3 -4
  12. package/lib/{generator-BmdoTIL2.js → generator-CLPosooC.js} +3 -4
  13. package/lib/helper.js +2 -3
  14. package/lib/{hooks-C8eELrni.js → hooks-rQTTeOC4.js} +144 -88
  15. package/lib/images.js +4 -4
  16. package/lib/index.js +1024 -913
  17. package/lib/{library-lVNf9qG_.js → library-Dfu0dgRj.js} +32 -21
  18. package/lib/{lorebook-author-tools-BDOs4i5C.js → lorebook-author-tools-BAaAqZZm.js} +11 -14
  19. package/lib/lorebook-authoring.js +5 -6
  20. package/lib/{narration-DvFBqmqe.js → narration-CjB_KwwY.js} +58 -20
  21. package/lib/orchestration.js +138 -72
  22. package/lib/{pack-jail-DeTscGT2.js → pack-jail-CN-314ln.js} +94 -137
  23. package/lib/{packs-CY8ms8v_.js → packs-DIj5BEfq.js} +6 -10
  24. package/lib/{presenter-agent-cFR4sos3.js → presenter-agent-DR0KvLE0.js} +13 -19
  25. package/lib/{preset-n4-j6k4S.js → preset-CscHj1-Y.js} +5 -5
  26. package/lib/{preset-author-tools-2m4BLtws.js → preset-author-tools-CxluF8qc.js} +13 -15
  27. package/lib/preset-authoring.js +6 -7
  28. package/lib/presets-HB8kJTaE.js +3993 -0
  29. package/lib/{reflection-CJB5s0ip.js → reflection-Dg1xtOTW.js} +137 -148
  30. package/lib/{text-Cwl5s0j0.js → text-DyRN4nDP.js} +13 -7
  31. package/lib/{turn-guard-BvCs1VxB.js → turn-guard-g_hDn0jR.js} +6 -7
  32. package/package.json +29 -29
  33. package/prompts/en/import/casting.md +14 -0
  34. package/prompts/en/import/character.md +1 -0
  35. package/prompts/en/import/classifier.md +9 -0
  36. package/prompts/en/import/finish-draft.md +1 -0
  37. package/prompts/en/import/generator.md +8 -0
  38. package/prompts/en/import/notice-repair.md +4 -0
  39. package/prompts/en/import/repair-again.md +3 -0
  40. package/prompts/en/import/roster.md +1 -0
  41. package/prompts/en/import/variables.md +1 -0
  42. package/prompts/en/roleplay/game-master.md +3 -0
  43. package/prompts/en/roleplay/standing.md +1 -0
  44. package/prompts/en/world/author.md +1 -1
  45. package/prompts/zh/import/casting.md +14 -0
  46. package/prompts/zh/import/character.md +1 -0
  47. package/prompts/zh/import/classifier.md +9 -0
  48. package/prompts/zh/import/finish-draft.md +1 -0
  49. package/prompts/zh/import/generator.md +8 -0
  50. package/prompts/zh/import/notice-repair.md +4 -0
  51. package/prompts/zh/import/repair-again.md +3 -0
  52. package/prompts/zh/import/roster.md +1 -0
  53. package/prompts/zh/import/variables.md +1 -0
  54. package/prompts/zh/roleplay/game-master.md +3 -0
  55. package/prompts/zh/roleplay/standing.md +1 -0
  56. package/prompts/zh/world/author.md +1 -1
  57. package/lib/authoring-tools-CIsWbq0B.js +0 -6317
  58. package/lib/route-C6SHz9j2.js +0 -518
package/lib/client.js CHANGED
@@ -10,7 +10,7 @@ window.__ModuleLoader__.load({
10
10
  let _deepseek_ai_dsh_client_store = require("@deepseek-ai/dsh-client-store");
11
11
  let _deepseek_ai_dsh_client_ui_slots = require("@deepseek-ai/dsh-client-ui-slots");
12
12
  let react_dom = require("react-dom");
13
- //#region src/shared/ids.ts
13
+ // src/shared/ids.ts
14
14
  /**
15
15
  * Profile entry id of the core plugin's row. Settings forms are addressed by
16
16
  * it, so the bundle patch row must use the same id.
@@ -18,14 +18,12 @@ window.__ModuleLoader__.load({
18
18
  const ENTRY_ID = "roleplay";
19
19
  /** Id shared by the sidebar entry and the main panel it opens. */
20
20
  const PANEL_ID = "roleplay";
21
- //#endregion
22
- //#region src/client/panel/PanelIcon.tsx
21
+ // src/client/panel/PanelIcon.tsx
23
22
  /** Sidebar glyph; the sidebar owns the button, label and selected state around it. */
24
23
  function PanelIcon({ size }) {
25
24
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconUsersOutlineRegular, { size });
26
25
  }
27
- //#endregion
28
- //#region \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/panel/PageTabs.module.css.mjs
26
+ // \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/panel/PageTabs.module.css.mjs
29
27
  const css$34 = ".rp_Poldga_tabs{scrollbar-width:none;gap:24px;margin-bottom:-1px;display:flex;overflow-x:auto}.rp_Poldga_tabs::-webkit-scrollbar{display:none}.rp_Poldga_tab{font:inherit;color:var(--dsw-alias-label-secondary);cursor:pointer;white-space:nowrap;background:0 0;border:0;margin:0;padding:8px 0;font-size:13px;line-height:20px;box-shadow:inset 0 -2px #0000}.rp_Poldga_tab:hover{color:var(--dsw-alias-label-primary)}.rp_Poldga_tab[aria-selected=true]{color:var(--dsw-alias-state-business-primary);font-weight:500;box-shadow:inset 0 -2px}.rp_Poldga_tab:focus-visible{outline:var(--dsw-focus-ring-width) solid var(--dsw-focus-ring-color);outline-offset:2px;border-radius:var(--dsw-radius-xs)}";
30
28
  const key$34 = "src/client/panel/PageTabs.module.css";
31
29
  let tag$34 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$34) + "]");
@@ -40,8 +38,7 @@ window.__ModuleLoader__.load({
40
38
  "tabs": "rp_Poldga_tabs",
41
39
  "tab": "rp_Poldga_tab"
42
40
  };
43
- //#endregion
44
- //#region src/client/panel/PageTabs.tsx
41
+ // src/client/panel/PageTabs.tsx
45
42
  /** Underlined text tabs; arrow keys, Home and End move between them. */
46
43
  function PageTabs({ tabs, value, label, onChange }) {
47
44
  const onKeyDown = (event, index) => {
@@ -80,8 +77,7 @@ window.__ModuleLoader__.load({
80
77
  }, tab.id))
81
78
  });
82
79
  }
83
- //#endregion
84
- //#region \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/panel/RoleplayPanel.module.css.mjs
80
+ // \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/panel/RoleplayPanel.module.css.mjs
85
81
  const css$33 = ".rp_ua5gBa_panel{min-height:0;color:var(--dsw-alias-label-primary);flex-direction:column;flex:1 1 0;display:flex}.rp_ua5gBa_header{border-bottom:.5px solid var(--dsw-alias-border-l2);flex:none;padding:12px 24px 0}.rp_ua5gBa_title{margin:0 0 4px;font-size:14px;font-weight:500;line-height:22px}.rp_ua5gBa_body{flex-direction:column;flex:1 1 0;min-height:0;padding:12px 24px 16px;display:flex}@media (width<=640px){.rp_ua5gBa_header,.rp_ua5gBa_body{padding-inline:16px}}";
86
82
  const key$33 = "src/client/panel/RoleplayPanel.module.css";
87
83
  let tag$33 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$33) + "]");
@@ -93,13 +89,12 @@ window.__ModuleLoader__.load({
93
89
  }
94
90
  tag$33.textContent = css$33;
95
91
  var RoleplayPanel_module_css_default = {
92
+ "header": "rp_ua5gBa_header",
96
93
  "title": "rp_ua5gBa_title",
97
- "body": "rp_ua5gBa_body",
98
94
  "panel": "rp_ua5gBa_panel",
99
- "header": "rp_ua5gBa_header"
95
+ "body": "rp_ua5gBa_body"
100
96
  };
101
- //#endregion
102
- //#region src/client/panel/RoleplayPanel.tsx
97
+ // src/client/panel/RoleplayPanel.tsx
103
98
  /** Header, page navigation and the selected page. */
104
99
  function RoleplayPanel({ t, renderSlot, useStore, actions, usePages }) {
105
100
  const idBase = (0, react.useId)();
@@ -141,8 +136,7 @@ window.__ModuleLoader__.load({
141
136
  }, active.id)]
142
137
  });
143
138
  }
144
- //#endregion
145
- //#region src/client/panel/locales.ts
139
+ // src/client/panel/locales.ts
146
140
  const dictionaries$22 = {
147
141
  en: {
148
142
  label: "Role Play",
@@ -155,8 +149,7 @@ window.__ModuleLoader__.load({
155
149
  navLabel: "角色扮演栏目"
156
150
  }
157
151
  };
158
- //#endregion
159
- //#region src/client/panel/pages-source.ts
152
+ // src/client/panel/pages-source.ts
160
153
  /**
161
154
  * Pages registered into `roleplay.page`, ordered, with their current labels.
162
155
  * Labels are functions of the active language, so the list is rebuilt when
@@ -188,8 +181,7 @@ window.__ModuleLoader__.load({
188
181
  }
189
182
  };
190
183
  }
191
- //#endregion
192
- //#region src/client/panel/panel-store.ts
184
+ // src/client/panel/panel-store.ts
193
185
  function createPanelStore() {
194
186
  return (0, _deepseek_ai_dsh_client_store.defineStore)({
195
187
  init: () => ({ page: void 0 }),
@@ -198,8 +190,7 @@ window.__ModuleLoader__.load({
198
190
  } }
199
191
  });
200
192
  }
201
- //#endregion
202
- //#region src/client/panel/index.ts
193
+ // src/client/panel/index.ts
203
194
  const NAMESPACE$14 = "roleplay.panel";
204
195
  /** Adds the Role Play entry to the sidebar and the main panel it opens. */
205
196
  function registerPanel(ctx) {
@@ -232,8 +223,7 @@ window.__ModuleLoader__.load({
232
223
  locale: NAMESPACE$14
233
224
  }, PanelIcon));
234
225
  }
235
- //#endregion
236
- //#region src/client/chat/open-chat.ts
226
+ // src/client/chat/open-chat.ts
237
227
  /** Resolves the workspace service on use, so a client without it fails at the click, not at load. */
238
228
  function createChatOpener(ctx) {
239
229
  return (chatSessionId) => {
@@ -242,8 +232,7 @@ window.__ModuleLoader__.load({
242
232
  workspace.openSession(chatSessionId);
243
233
  };
244
234
  }
245
- //#endregion
246
- //#region src/shared/text.ts
235
+ // src/shared/text.ts
247
236
  /** Remove characters from either end without a backtracking regular expression. */
248
237
  function trimCharacters(value, characters, edge = "both") {
249
238
  let start = 0;
@@ -257,8 +246,7 @@ window.__ModuleLoader__.load({
257
246
  const dot = value.lastIndexOf(".");
258
247
  return dot < 0 ? value : value.slice(0, dot);
259
248
  }
260
- //#endregion
261
- //#region src/shared/catalogue.ts
249
+ // src/shared/catalogue.ts
262
250
  /** What a credential reference is: letters, digits and `_`, not starting with a digit (DSH's grammar). */
263
251
  const CREDENTIAL_REF = /^[A-Za-z_][A-Za-z0-9_]*$/;
264
252
  /** The credential a catalogue's key is stored under when its entry names none. Names with other characters get a short checksum so that two of them never share a key. */
@@ -271,8 +259,7 @@ window.__ModuleLoader__.load({
271
259
  }
272
260
  /** The browser event settings fires after a key is stored or removed, so that the catalogue page reads its sources again. */
273
261
  const CATALOGUE_KEYS_CHANGED = "roleplay:catalogue-keys-changed";
274
- //#endregion
275
- //#region src/shared/worlds.ts
262
+ // src/shared/worlds.ts
276
263
  /** Path prefix of the plugin's HTTP API. Relative, so a mounted deployment resolves it against the page. */
277
264
  const API_PREFIX = "roleplay-api";
278
265
  function worldCoverPath(id, version) {
@@ -281,8 +268,7 @@ window.__ModuleLoader__.load({
281
268
  v: version
282
269
  })}`;
283
270
  }
284
- //#endregion
285
- //#region src/client/pages/catalogue/catalogue-api.ts
271
+ // src/client/pages/catalogue/catalogue-api.ts
286
272
  /** The host refused to go on because of something the person can decide: a world they already have, or one they changed. */
287
273
  var InstallConflict = class extends Error {
288
274
  reason;
@@ -364,8 +350,7 @@ window.__ModuleLoader__.load({
364
350
  function downloadUrl(baseUrl, versionId) {
365
351
  return `${trimCharacters(baseUrl.trim(), "/", "end")}/versions/${encodeURIComponent(versionId)}/download`;
366
352
  }
367
- //#endregion
368
- //#region src/client/pages/catalogue/catalogue-controller.ts
353
+ // src/client/pages/catalogue/catalogue-controller.ts
369
354
  const messageOf$13 = (error) => error instanceof Error ? error.message : String(error);
370
355
  /** The configured catalogues as the host sees them, read again whenever the settings change. */
371
356
  var CatalogueController = class {
@@ -416,8 +401,7 @@ window.__ModuleLoader__.load({
416
401
  this.abort.abort();
417
402
  }
418
403
  };
419
- //#endregion
420
- //#region \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/widgets/import-card/ImportCard.module.css.mjs
404
+ // \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/widgets/import-card/ImportCard.module.css.mjs
421
405
  const css$32 = ".rp_5cvtma_page{flex-direction:column;flex:1 1 0;min-height:0;display:flex}.rp_5cvtma_header{border-bottom:.5px solid var(--dsw-alias-border-l3);flex:none;align-items:center;gap:8px;padding:8px 16px;display:flex}.rp_5cvtma_title{color:var(--dsw-alias-label-primary);font-size:14px;font-weight:500}.rp_5cvtma_space{flex:auto}.rp_5cvtma_error{color:var(--dsw-alias-state-error-primary);margin:0;padding:8px 16px;font-size:12px}.rp_5cvtma_body{box-sizing:border-box;flex-direction:column;flex:1 1 0;gap:20px;min-height:0;padding:20px 24px 40px;display:flex;overflow-y:auto}.rp_5cvtma_body>*{flex:none;width:100%;max-width:860px}.rp_5cvtma_top{align-items:flex-start;gap:20px;display:flex}.rp_5cvtma_picture{object-fit:cover;border:.5px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-lg);flex:0 0 120px;width:120px;height:160px}.rp_5cvtma_noPicture{box-sizing:border-box;color:var(--dsw-alias-label-tertiary);justify-content:center;align-items:center;font-size:12px;display:flex}.rp_5cvtma_about{flex-direction:column;flex:1 1 0;gap:8px;min-width:0;display:flex}.rp_5cvtma_label{color:var(--dsw-alias-label-tertiary);flex-direction:column;gap:4px;font-size:12px;display:flex}.rp_5cvtma_tags{flex-wrap:wrap;gap:6px;display:flex}.rp_5cvtma_note{color:var(--dsw-alias-label-tertiary);margin:0;font-size:12px;line-height:18px}.rp_5cvtma_section{flex-direction:column;gap:8px;display:flex}.rp_5cvtma_heading{color:var(--dsw-alias-label-primary);margin:0;font-size:14px;font-weight:500}.rp_5cvtma_row{align-items:center;gap:8px;display:flex}.rp_5cvtma_field,.rp_5cvtma_entry{border:.5px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-lg)}.rp_5cvtma_fieldHead,.rp_5cvtma_entryHead{box-sizing:border-box;width:100%;font:inherit;text-align:left;color:inherit;background:0 0;border:0;align-items:center;gap:8px;padding:8px 10px;display:flex}.rp_5cvtma_fieldHead{cursor:pointer}.rp_5cvtma_fieldTitle,.rp_5cvtma_entryTitle{min-width:0;color:var(--dsw-alias-label-primary);flex:auto;font-size:13px}.rp_5cvtma_entryTitle{font:inherit;text-align:left;cursor:pointer;background:0 0;border:0;padding:0;font-size:13px}.rp_5cvtma_fieldMeta{color:var(--dsw-alias-label-tertiary);font-size:12px}.rp_5cvtma_field .rp_5cvtma_note,.rp_5cvtma_entry .rp_5cvtma_note{padding:0 10px 6px}.rp_5cvtma_text{white-space:pre-wrap;word-break:break-word;max-height:320px;font:inherit;color:var(--dsw-alias-label-secondary);border-top:.5px solid var(--dsw-alias-border-l4);margin:0;padding:8px 10px 10px;font-size:12px;line-height:18px;overflow:auto}.rp_5cvtma_entryOff .rp_5cvtma_entryTitle{color:var(--dsw-alias-label-tertiary);text-decoration:line-through}.rp_5cvtma_choice{border:.5px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-lg);cursor:pointer;align-items:flex-start;gap:10px;padding:8px 10px;display:flex}@media (width<=640px){.rp_5cvtma_body{padding-inline:16px}.rp_5cvtma_top{flex-direction:column}.rp_5cvtma_picture{width:96px;height:128px}.rp_5cvtma_row{flex-wrap:wrap}}.rp_5cvtma_choice input{margin-top:3px}.rp_5cvtma_choiceText{flex-direction:column;gap:4px;min-width:0;display:flex}.rp_5cvtma_preview{white-space:pre-wrap;word-break:break-word;color:var(--dsw-alias-label-secondary);font-size:12px;line-height:18px}";
422
406
  const key$32 = "src/client/widgets/import-card/ImportCard.module.css";
423
407
  let tag$32 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$32) + "]");
@@ -429,37 +413,36 @@ window.__ModuleLoader__.load({
429
413
  }
430
414
  tag$32.textContent = css$32;
431
415
  var ImportCard_module_css_default = {
432
- "fieldMeta": "rp_5cvtma_fieldMeta",
433
- "entryHead": "rp_5cvtma_entryHead",
434
- "tags": "rp_5cvtma_tags",
416
+ "error": "rp_5cvtma_error",
435
417
  "text": "rp_5cvtma_text",
418
+ "note": "rp_5cvtma_note",
436
419
  "entryOff": "rp_5cvtma_entryOff",
437
- "section": "rp_5cvtma_section",
438
- "error": "rp_5cvtma_error",
439
- "fieldHead": "rp_5cvtma_fieldHead",
440
- "fieldTitle": "rp_5cvtma_fieldTitle",
441
- "choice": "rp_5cvtma_choice",
442
- "choiceText": "rp_5cvtma_choiceText",
443
420
  "about": "rp_5cvtma_about",
444
- "title": "rp_5cvtma_title",
445
- "preview": "rp_5cvtma_preview",
421
+ "top": "rp_5cvtma_top",
422
+ "row": "rp_5cvtma_row",
423
+ "header": "rp_5cvtma_header",
424
+ "field": "rp_5cvtma_field",
446
425
  "space": "rp_5cvtma_space",
447
- "note": "rp_5cvtma_note",
426
+ "entryHead": "rp_5cvtma_entryHead",
448
427
  "body": "rp_5cvtma_body",
428
+ "entry": "rp_5cvtma_entry",
429
+ "fieldMeta": "rp_5cvtma_fieldMeta",
430
+ "title": "rp_5cvtma_title",
449
431
  "noPicture": "rp_5cvtma_noPicture",
450
432
  "label": "rp_5cvtma_label",
433
+ "picture": "rp_5cvtma_picture",
434
+ "tags": "rp_5cvtma_tags",
451
435
  "heading": "rp_5cvtma_heading",
452
- "page": "rp_5cvtma_page",
453
- "top": "rp_5cvtma_top",
454
- "row": "rp_5cvtma_row",
455
- "field": "rp_5cvtma_field",
456
- "entry": "rp_5cvtma_entry",
436
+ "fieldHead": "rp_5cvtma_fieldHead",
457
437
  "entryTitle": "rp_5cvtma_entryTitle",
458
- "picture": "rp_5cvtma_picture",
459
- "header": "rp_5cvtma_header"
438
+ "choice": "rp_5cvtma_choice",
439
+ "choiceText": "rp_5cvtma_choiceText",
440
+ "section": "rp_5cvtma_section",
441
+ "fieldTitle": "rp_5cvtma_fieldTitle",
442
+ "preview": "rp_5cvtma_preview",
443
+ "page": "rp_5cvtma_page"
460
444
  };
461
- //#endregion
462
- //#region src/client/widgets/import-card/ImportCard.tsx
445
+ // src/client/widgets/import-card/ImportCard.tsx
463
446
  const pictureUrl = (id) => `${API_PREFIX}/worlds/import/picture?id=${encodeURIComponent(id)}`;
464
447
  /** What the person is offered first: updating the world of that name nobody changed, otherwise a new world. */
465
448
  const defaultTarget = (targets) => targets?.find((target) => target.sameName && target.edited === "no")?.worldId;
@@ -500,7 +483,7 @@ window.__ModuleLoader__.load({
500
483
  * What a card holds, for the person to look through and decide what becomes of it: which lorebook entries are read at all, and which greeting opens the story.
501
484
  * The caller says what starting and cancelling do, because a card comes from a file or from a catalogue.
502
485
  */
503
- function ImportCard({ t, preview, initialUpdate, start: begin, discard, onCancelled, onStarted }) {
486
+ function ImportCard({ t, preview, initialUpdate, start: begin, startPlain, discard, onCancelled, onStarted, onImportedPlain }) {
504
487
  const { card } = preview;
505
488
  const entries = card.book?.entries ?? [];
506
489
  const [name, setName] = (0, react.useState)(preview.choices.name);
@@ -552,6 +535,17 @@ window.__ModuleLoader__.load({
552
535
  setError(failure instanceof Error ? failure.message : String(failure));
553
536
  });
554
537
  };
538
+ const startWithoutModel = () => {
539
+ if (name.trim() === "" || starting || startPlain === void 0) return;
540
+ setStarting(true);
541
+ setError(void 0);
542
+ startPlain(choices()).then((done) => {
543
+ onImportedPlain?.(done.worldId, done.draft);
544
+ }, (failure) => {
545
+ setStarting(false);
546
+ setError(failure instanceof Error ? failure.message : String(failure));
547
+ });
548
+ };
555
549
  const cancel = () => {
556
550
  discard().finally(onCancelled);
557
551
  };
@@ -575,6 +569,17 @@ window.__ModuleLoader__.load({
575
569
  onClick: cancel,
576
570
  children: t("ic_cancel")
577
571
  }),
572
+ startPlain !== void 0 && update === void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Tooltip, {
573
+ label: t("ic_startPlainHelp"),
574
+ portal: true,
575
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
576
+ variant: "ghost",
577
+ size: "sm",
578
+ disabled: name.trim() === "" || starting,
579
+ onClick: startWithoutModel,
580
+ children: t("ic_startPlain")
581
+ })
582
+ }),
578
583
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
579
584
  variant: "primary",
580
585
  size: "sm",
@@ -905,8 +910,7 @@ window.__ModuleLoader__.load({
905
910
  ]
906
911
  });
907
912
  }
908
- //#endregion
909
- //#region \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/pages/catalogue/CataloguePage.module.css.mjs
913
+ // \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/pages/catalogue/CataloguePage.module.css.mjs
910
914
  const css$31 = ".rp_qK1u-G_page{flex-direction:column;flex:1 1 0;gap:8px;min-height:0;display:flex}.rp_qK1u-G_toolbar{flex-wrap:wrap;flex:none;align-items:center;gap:8px;min-height:32px;display:flex}.rp_qK1u-G_spacer{flex:auto}.rp_qK1u-G_select,.rp_qK1u-G_search{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_qK1u-G_search{min-width:200px}.rp_qK1u-G_select:focus-visible,.rp_qK1u-G_search:focus-visible{border-color:var(--dsw-alias-state-business-primary);outline:none}.rp_qK1u-G_status{color:var(--dsw-alias-label-tertiary);margin:0;font-size:12px}.rp_qK1u-G_notice{color:var(--dsw-alias-state-error-primary);margin:0;font-size:12px}.rp_qK1u-G_viewport{flex:1 1 0;min-height:0;padding:4px;overflow-y:auto}.rp_qK1u-G_grid{grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:12px;margin:0;padding:0;list-style:none;display:grid}.rp_qK1u-G_card{border:.5px solid var(--dsw-alias-settings-card-stroke);border-radius:var(--dsw-radius-xl);min-width:0;font:inherit;text-align:left;color:inherit;background:var(--dsw-alias-settings-card-fill);cursor:pointer;flex-direction:column;padding:0;transition:border-color .12s;display:flex;overflow:hidden}.rp_qK1u-G_card:hover{border-color:var(--dsw-alias-border-l4)}.rp_qK1u-G_card:focus-visible{outline:var(--dsw-focus-ring-width) solid var(--dsw-focus-ring-color);outline-offset:2px}.rp_qK1u-G_cover{aspect-ratio:4/3;background:var(--dsw-alias-bg-layer-3)}.rp_qK1u-G_image{object-fit:cover;width:100%;height:100%;display:block}.rp_qK1u-G_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:36px;font-weight:500;display:flex}.rp_qK1u-G_body{flex-direction:column;gap:4px;padding:8px 10px 10px;display:flex}.rp_qK1u-G_name{text-overflow:ellipsis;white-space:nowrap;color:var(--dsw-alias-label-primary);font-size:13px;font-weight:500;overflow:hidden}.rp_qK1u-G_meta{color:var(--dsw-alias-label-secondary);font-size:12px}.rp_qK1u-G_tags{flex-wrap:wrap;gap:4px;display:flex}.rp_qK1u-G_more{justify-content:center;padding:12px 0;display:flex}.rp_qK1u-G_message{text-align:center;color:var(--dsw-alias-label-secondary);margin:0;padding:40px 24px;font-size:13px}.rp_qK1u-G_form{flex-direction:column;gap:8px;display:flex}.rp_qK1u-G_field{flex-direction:column;gap:4px;display:flex}.rp_qK1u-G_label{color:var(--dsw-alias-label-tertiary);font-size:12px}.rp_qK1u-G_detail{flex-direction:column;gap:8px;font-size:13px;display:flex}.rp_qK1u-G_description{white-space:pre-wrap;max-height:240px;color:var(--dsw-alias-label-secondary);margin:0;overflow-y:auto}.rp_qK1u-G_success{color:var(--dsw-alias-label-secondary);margin:0;font-size:12px}.rp_qK1u-G_kinds{border-bottom:1px solid var(--dsw-alias-border-l2);flex:none;gap:16px;display:flex}.rp_qK1u-G_kind{font:inherit;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:0;border-bottom:2px solid #0000;margin-bottom:-1px;padding:4px 0 6px;font-size:13px}.rp_qK1u-G_kind[aria-selected=true]{border-bottom-color:var(--dsw-alias-state-business-primary);color:var(--dsw-alias-state-business-primary);font-weight:500}.rp_qK1u-G_kind:focus-visible{outline:2px solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));outline-offset:2px}.rp_qK1u-G_updates{color:var(--dsw-alias-label-secondary);flex-wrap:wrap;flex:none;align-items:center;gap:4px 8px;margin:0;padding:0;font-size:12px;list-style:none;display:flex}.rp_qK1u-G_update{border:.5px solid var(--dsw-alias-state-business-primary);border-radius:var(--dsw-radius-sm);font:inherit;color:var(--dsw-alias-state-business-primary);cursor:pointer;background:0 0;padding:2px 8px}.rp_qK1u-G_warning{border:.5px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-sm);color:var(--dsw-alias-label-secondary);flex-direction:column;gap:8px;padding:8px 12px;font-size:12px;display:flex}.rp_qK1u-G_warning p{margin:0}.rp_qK1u-G_changes{font-family:var(--dsw-font-mono,monospace);color:var(--dsw-alias-label-tertiary);margin:0;padding-left:16px;font-size:12px}.rp_qK1u-G_actions{flex-wrap:wrap;gap:8px;display:flex}";
911
915
  const key$31 = "src/client/pages/catalogue/CataloguePage.module.css";
912
916
  let tag$31 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$31) + "]");
@@ -918,41 +922,40 @@ window.__ModuleLoader__.load({
918
922
  }
919
923
  tag$31.textContent = css$31;
920
924
  var CataloguePage_module_css_default = {
925
+ "description": "rp_qK1u-G_description",
926
+ "toolbar": "rp_qK1u-G_toolbar",
927
+ "meta": "rp_qK1u-G_meta",
928
+ "more": "rp_qK1u-G_more",
921
929
  "update": "rp_qK1u-G_update",
930
+ "select": "rp_qK1u-G_select",
931
+ "cover": "rp_qK1u-G_cover",
922
932
  "card": "rp_qK1u-G_card",
923
- "field": "rp_qK1u-G_field",
924
- "meta": "rp_qK1u-G_meta",
925
- "image": "rp_qK1u-G_image",
926
- "tags": "rp_qK1u-G_tags",
927
- "description": "rp_qK1u-G_description",
928
- "changes": "rp_qK1u-G_changes",
929
- "notice": "rp_qK1u-G_notice",
930
- "updates": "rp_qK1u-G_updates",
933
+ "warning": "rp_qK1u-G_warning",
931
934
  "actions": "rp_qK1u-G_actions",
932
- "success": "rp_qK1u-G_success",
933
- "name": "rp_qK1u-G_name",
935
+ "notice": "rp_qK1u-G_notice",
934
936
  "label": "rp_qK1u-G_label",
935
- "kinds": "rp_qK1u-G_kinds",
936
- "cover": "rp_qK1u-G_cover",
937
- "detail": "rp_qK1u-G_detail",
938
- "select": "rp_qK1u-G_select",
939
- "status": "rp_qK1u-G_status",
940
- "placeholder": "rp_qK1u-G_placeholder",
941
937
  "form": "rp_qK1u-G_form",
942
938
  "body": "rp_qK1u-G_body",
939
+ "name": "rp_qK1u-G_name",
940
+ "image": "rp_qK1u-G_image",
943
941
  "search": "rp_qK1u-G_search",
944
- "grid": "rp_qK1u-G_grid",
942
+ "field": "rp_qK1u-G_field",
943
+ "placeholder": "rp_qK1u-G_placeholder",
944
+ "detail": "rp_qK1u-G_detail",
945
945
  "kind": "rp_qK1u-G_kind",
946
- "toolbar": "rp_qK1u-G_toolbar",
946
+ "success": "rp_qK1u-G_success",
947
+ "viewport": "rp_qK1u-G_viewport",
947
948
  "message": "rp_qK1u-G_message",
948
- "page": "rp_qK1u-G_page",
949
949
  "spacer": "rp_qK1u-G_spacer",
950
- "warning": "rp_qK1u-G_warning",
951
- "viewport": "rp_qK1u-G_viewport",
952
- "more": "rp_qK1u-G_more"
950
+ "tags": "rp_qK1u-G_tags",
951
+ "updates": "rp_qK1u-G_updates",
952
+ "kinds": "rp_qK1u-G_kinds",
953
+ "grid": "rp_qK1u-G_grid",
954
+ "changes": "rp_qK1u-G_changes",
955
+ "status": "rp_qK1u-G_status",
956
+ "page": "rp_qK1u-G_page"
953
957
  };
954
- //#endregion
955
- //#region src/client/pages/catalogue/ImportUrlDialog.tsx
958
+ // src/client/pages/catalogue/ImportUrlDialog.tsx
956
959
  /** Installs a world from the address of its archive; an address on a configured catalogue's site is asked for with that catalogue's key. */
957
960
  function ImportUrlDialog({ t, onClose, onInstalled }) {
958
961
  const formId = (0, react.useId)();
@@ -1016,8 +1019,7 @@ window.__ModuleLoader__.load({
1016
1019
  })
1017
1020
  });
1018
1021
  }
1019
- //#endregion
1020
- //#region src/client/import-selection-api.ts
1022
+ // src/client/import-selection-api.ts
1021
1023
  async function reply$4(response) {
1022
1024
  if (!response.ok) {
1023
1025
  const body = await response.json().catch(() => void 0);
@@ -1095,8 +1097,7 @@ window.__ModuleLoader__.load({
1095
1097
  worldId
1096
1098
  }, signal)));
1097
1099
  }
1098
- //#endregion
1099
- //#region src/shared/sampling.ts
1100
+ // src/shared/sampling.ts
1100
1101
  /** Each control's range and the value that leaves the choice to the model's server (and so is never sent). */
1101
1102
  const SAMPLING_RANGES = {
1102
1103
  master: {
@@ -1139,8 +1140,7 @@ window.__ModuleLoader__.load({
1139
1140
  }
1140
1141
  };
1141
1142
  const SAMPLING_KEYS = Object.keys(SAMPLING_RANGES);
1142
- //#endregion
1143
- //#region \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/widgets/import-selection/ImportSelection.module.css.mjs
1143
+ // \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/widgets/import-selection/ImportSelection.module.css.mjs
1144
1144
  const css$30 = ".rp_Jx0l4q_body{flex-direction:column;gap:12px;min-width:min(640px,100%);max-height:calc(100vh - 220px);display:flex;overflow-y:auto}.rp_Jx0l4q_help{color:var(--dsw-alias-label-secondary);margin:0;font-size:12px}.rp_Jx0l4q_bar{flex-wrap:wrap;align-items:center;gap:8px;display:flex}.rp_Jx0l4q_count{color:var(--dsw-alias-label-tertiary);margin-right:auto;font-size:12px}.rp_Jx0l4q_list{border:.5px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);flex-direction:column;max-height:max(120px,min(420px,100vh - 560px));margin:0;padding:0;list-style:none;display:flex;overflow-y:auto}.rp_Jx0l4q_row{border-bottom:.5px solid var(--dsw-alias-border-l3);gap:8px;padding:6px 8px;display:flex}.rp_Jx0l4q_row:last-child{border-bottom:0}.rp_Jx0l4q_row[data-usable=false]{opacity:.55}.rp_Jx0l4q_text{min-width:0;color:var(--dsw-alias-label-primary);flex-direction:column;flex:1 1 0;gap:2px;font-size:13px;display:flex}.rp_Jx0l4q_meta{color:var(--dsw-alias-label-tertiary);overflow-wrap:anywhere;font-size:12px}.rp_Jx0l4q_note{color:var(--dsw-alias-label-secondary);font-size:12px}.rp_Jx0l4q_full{max-height:200px;font:12px/18px var(--dsw-font-mono,monospace);white-space:pre-wrap;overflow-wrap:anywhere;background:var(--dsw-alias-bg-layer-1);border-radius:var(--dsw-radius-sm);margin:4px 0 0;padding:6px 8px;overflow:auto}.rp_Jx0l4q_sampling{border:.5px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);flex-direction:column;gap:4px;padding:8px;display:flex}.rp_Jx0l4q_error{color:var(--dsw-alias-state-error-primary);margin:0;font-size:12px}.rp_Jx0l4q_extra{display:block}";
1145
1145
  const key$30 = "src/client/widgets/import-selection/ImportSelection.module.css";
1146
1146
  let tag$30 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$30) + "]");
@@ -1152,22 +1152,21 @@ window.__ModuleLoader__.load({
1152
1152
  }
1153
1153
  tag$30.textContent = css$30;
1154
1154
  var ImportSelection_module_css_default = {
1155
- "full": "rp_Jx0l4q_full",
1156
- "sampling": "rp_Jx0l4q_sampling",
1157
- "error": "rp_Jx0l4q_error",
1158
- "extra": "rp_Jx0l4q_extra",
1159
1155
  "meta": "rp_Jx0l4q_meta",
1160
1156
  "note": "rp_Jx0l4q_note",
1161
- "text": "rp_Jx0l4q_text",
1162
- "count": "rp_Jx0l4q_count",
1163
- "body": "rp_Jx0l4q_body",
1157
+ "sampling": "rp_Jx0l4q_sampling",
1158
+ "extra": "rp_Jx0l4q_extra",
1159
+ "error": "rp_Jx0l4q_error",
1164
1160
  "help": "rp_Jx0l4q_help",
1165
- "bar": "rp_Jx0l4q_bar",
1161
+ "text": "rp_Jx0l4q_text",
1166
1162
  "list": "rp_Jx0l4q_list",
1163
+ "full": "rp_Jx0l4q_full",
1164
+ "bar": "rp_Jx0l4q_bar",
1165
+ "body": "rp_Jx0l4q_body",
1166
+ "count": "rp_Jx0l4q_count",
1167
1167
  "row": "rp_Jx0l4q_row"
1168
1168
  };
1169
- //#endregion
1170
- //#region src/client/widgets/import-selection/ImportSelection.tsx
1169
+ // src/client/widgets/import-selection/ImportSelection.tsx
1171
1170
  const messageOf$12 = (failure) => failure instanceof Error ? failure.message : String(failure);
1172
1171
  /**
1173
1172
  * The choice of what an imported preset or lorebook brings: every item the file offers, each ticked or not, and the file's sampling. Only the ticked items reach the conversion.
@@ -1395,8 +1394,7 @@ window.__ModuleLoader__.load({
1395
1394
  })
1396
1395
  });
1397
1396
  }
1398
- //#endregion
1399
- //#region src/client/pages/catalogue/WorldDialog.tsx
1397
+ // src/client/pages/catalogue/WorldDialog.tsx
1400
1398
  const sizeOf = (bytes) => bytes >= 1048576 ? `${(bytes / 1024 / 1024).toFixed(1)} MB` : `${Math.max(1, Math.round(bytes / 1024))} KB`;
1401
1399
  const dateOf = (iso) => {
1402
1400
  const date = new Date(iso);
@@ -1720,8 +1718,7 @@ window.__ModuleLoader__.load({
1720
1718
  onConfirm: importChosen
1721
1719
  })] });
1722
1720
  }
1723
- //#endregion
1724
- //#region src/client/pages/catalogue/CataloguePage.tsx
1721
+ // src/client/pages/catalogue/CataloguePage.tsx
1725
1722
  const hueOf$5 = (name) => Array.from(name).reduce((hash, char) => (hash * 31 + char.charCodeAt(0)) % 360, 0);
1726
1723
  /** The worlds of the configured catalogues, to look through and install. */
1727
1724
  function CataloguePage({ t, useCatalogue, load, openChat }) {
@@ -2120,8 +2117,7 @@ window.__ModuleLoader__.load({
2120
2117
  ]
2121
2118
  });
2122
2119
  }
2123
- //#endregion
2124
- //#region src/client/i18n.ts
2120
+ // src/client/i18n.ts
2125
2121
  /** A feature's copy together with the copy of a shared piece it embeds. */
2126
2122
  function withDictionaries(own, shared) {
2127
2123
  return Object.fromEntries(Object.keys(own).map((locale) => [locale, {
@@ -2133,8 +2129,7 @@ window.__ModuleLoader__.load({
2133
2129
  function prefixed(dictionaries, prefix) {
2134
2130
  return Object.fromEntries(Object.keys(dictionaries).map((locale) => [locale, Object.fromEntries(Object.entries(dictionaries[locale]).map(([key, value]) => [`${prefix}${key}`, value]))]));
2135
2131
  }
2136
- //#endregion
2137
- //#region src/client/widgets/import-card/locales.ts
2132
+ // src/client/widgets/import-card/locales.ts
2138
2133
  const dictionaries$21 = {
2139
2134
  en: {
2140
2135
  ic_title: "Import a character card",
@@ -2177,6 +2172,8 @@ window.__ModuleLoader__.load({
2177
2172
  ic_noKeys: "No keys",
2178
2173
  ic_scripts: "{count} scripts and settings of the tool that made the card are not imported.",
2179
2174
  ic_start: "Import",
2175
+ ic_startPlain: "Import without a model",
2176
+ ic_startPlainHelp: "Carries over the card's own character, its lorebook (for the game master only) and its instructions as they are written, with no model: places, factions and other people are not read out of it.",
2180
2177
  ic_starting: "Starting…",
2181
2178
  ic_startFailed: "Could not start the import: {message}",
2182
2179
  ic_cancel: "Cancel",
@@ -2223,14 +2220,15 @@ window.__ModuleLoader__.load({
2223
2220
  ic_noKeys: "无关键词",
2224
2221
  ic_scripts: "制作角色卡的工具的 {count} 个脚本和设置不会导入。",
2225
2222
  ic_start: "导入",
2223
+ ic_startPlain: "不使用模型导入",
2224
+ ic_startPlainHelp: "不使用模型,原样带入卡片自己的角色、世界书(仅游戏主持人可读)和指令;不会从中识别地点、势力或其他人物。",
2226
2225
  ic_starting: "正在开始…",
2227
2226
  ic_startFailed: "无法开始导入:{message}",
2228
2227
  ic_cancel: "取消",
2229
2228
  ic_empty: "(空)"
2230
2229
  }
2231
2230
  };
2232
- //#endregion
2233
- //#region src/client/widgets/import-selection/locales.ts
2231
+ // src/client/widgets/import-selection/locales.ts
2234
2232
  const dictionaries$20 = {
2235
2233
  en: {
2236
2234
  is_title_preset: "Choose what to import from {name}",
@@ -2503,8 +2501,7 @@ window.__ModuleLoader__.load({
2503
2501
  openChat: "打开对话"
2504
2502
  }
2505
2503
  }, dictionaries$20), dictionaries$21);
2506
- //#endregion
2507
- //#region src/client/pages/catalogue/index.ts
2504
+ // src/client/pages/catalogue/index.ts
2508
2505
  const NAMESPACE$13 = "roleplay.catalogue";
2509
2506
  /** Adds the Catalogue page to the Role Play panel: worlds of the catalogues set up in the settings. */
2510
2507
  function registerCataloguePage(ctx) {
@@ -2535,12 +2532,10 @@ window.__ModuleLoader__.load({
2535
2532
  inject: () => catalogue.inject()
2536
2533
  }, CataloguePage));
2537
2534
  }
2538
- //#endregion
2539
- //#region src/shared/avatars.ts
2535
+ // src/shared/avatars.ts
2540
2536
  /** The id under which the player avatars are served by the world editor's routes: they are edited as the cast of a world of their own. */
2541
2537
  const AVATARS_WORLD_ID = "@avatars";
2542
- //#endregion
2543
- //#region src/client/avatars-api.ts
2538
+ // src/client/avatars-api.ts
2544
2539
  async function failure$1(response) {
2545
2540
  const body = await response.json().catch(() => void 0);
2546
2541
  const problems = Array.isArray(body?.problems) ? body.problems.join("; ") : void 0;
@@ -2591,8 +2586,7 @@ window.__ModuleLoader__.load({
2591
2586
  if (!response.ok) throw await failure$1(response);
2592
2587
  return (await response.json()).added;
2593
2588
  }
2594
- //#endregion
2595
- //#region src/client/pages/avatars/avatars-controller.ts
2589
+ // src/client/pages/avatars/avatars-controller.ts
2596
2590
  const messageOf$10 = (error) => error instanceof Error ? error.message : String(error);
2597
2591
  /** Reads the player avatars from the host and makes and removes them. */
2598
2592
  var AvatarsController = class {
@@ -2650,8 +2644,7 @@ window.__ModuleLoader__.load({
2650
2644
  }
2651
2645
  }
2652
2646
  };
2653
- //#endregion
2654
- //#region src/client/world-editor/source.ts
2647
+ // src/client/world-editor/source.ts
2655
2648
  /** The chat or the world is not something that can be edited: it does not exist, or is not a roleplay session. */
2656
2649
  var NotEditableError = class extends Error {};
2657
2650
  /** What the host said when it refused an edit, in its words. */
@@ -2728,8 +2721,7 @@ window.__ModuleLoader__.load({
2728
2721
  }];
2729
2722
  });
2730
2723
  }
2731
- //#endregion
2732
- //#region src/client/world-editor/authored-world-source.ts
2724
+ // src/client/world-editor/authored-world-source.ts
2733
2725
  /** An authored world's files, shared by the catalogue editor and its authoring chat. */
2734
2726
  function worldSource(worldId) {
2735
2727
  const id = encodeURIComponent(worldId);
@@ -2775,8 +2767,7 @@ window.__ModuleLoader__.load({
2775
2767
  uploadImage: async (kind, key, file, signal) => await postFile(`${API_PREFIX}/worlds/state/${kind}/image/upload?id=${id}&key=${encodeURIComponent(key)}`, file, signal)
2776
2768
  };
2777
2769
  }
2778
- //#endregion
2779
- //#region ../dsh-roleplay-model/src/character.ts
2770
+ // ../dsh-roleplay-model/src/character.ts
2780
2771
  const CHARACTER_ROLES = ["playable", "npc"];
2781
2772
  const CHARACTER_TIERS = [
2782
2773
  "principal",
@@ -2784,8 +2775,7 @@ window.__ModuleLoader__.load({
2784
2775
  "background"
2785
2776
  ];
2786
2777
  const CHARACTER_KINDS = ["person", "group"];
2787
- //#endregion
2788
- //#region ../dsh-roleplay-model/src/intent.ts
2778
+ // ../dsh-roleplay-model/src/intent.ts
2789
2779
  const INTENT_STATUSES = [
2790
2780
  "active",
2791
2781
  "paused",
@@ -2793,15 +2783,13 @@ window.__ModuleLoader__.load({
2793
2783
  "failed",
2794
2784
  "abandoned"
2795
2785
  ];
2796
- //#endregion
2797
- //#region ../dsh-roleplay-model/src/clock.ts
2786
+ // ../dsh-roleplay-model/src/clock.ts
2798
2787
  /**
2799
2788
  * How the story's time passes: `simulated` moves only when the story does (the game master says how
2800
2789
  * long things take and may skip ahead), `real` follows the wall clock.
2801
2790
  */
2802
2791
  const CLOCK_MODES = ["simulated", "real"];
2803
- //#endregion
2804
- //#region ../dsh-roleplay-model/src/variable.ts
2792
+ // ../dsh-roleplay-model/src/variable.ts
2805
2793
  /** What a variable holds: a number within bounds, a yes or no, or one of a list of words. */
2806
2794
  const VARIABLE_KINDS = [
2807
2795
  "number",
@@ -2925,8 +2913,7 @@ window.__ModuleLoader__.load({
2925
2913
  always: false,
2926
2914
  builtin: true
2927
2915
  }));
2928
- //#endregion
2929
- //#region ../dsh-roleplay-model/src/lore.ts
2916
+ // ../dsh-roleplay-model/src/lore.ts
2930
2917
  const LORE_KINDS = [
2931
2918
  "history",
2932
2919
  "culture",
@@ -2940,8 +2927,7 @@ window.__ModuleLoader__.load({
2940
2927
  ];
2941
2928
  /** Who knows an entry: `everyone` is common knowledge of the story's world, `listed` only the characters that have a knowledge edge to it (the game master always reads all of it). */
2942
2929
  const LORE_SCOPES = ["everyone", "listed"];
2943
- //#endregion
2944
- //#region src/client/world-editor/character-draft.ts
2930
+ // src/client/world-editor/character-draft.ts
2945
2931
  const lines$1 = (text) => text.split("\n").map((line) => line.trim()).filter((line) => line !== "");
2946
2932
  const commas = (text) => text.split(",").map((part) => part.trim()).filter((part) => part !== "");
2947
2933
  function toDraft(character) {
@@ -3048,8 +3034,7 @@ window.__ModuleLoader__.load({
3048
3034
  return edit;
3049
3035
  }
3050
3036
  const isDirty = (character, draft) => Object.keys(editOf$1(character, draft)).length > 0;
3051
- //#endregion
3052
- //#region \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/world-editor/CharactersPanel.module.css.mjs
3037
+ // \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/world-editor/CharactersPanel.module.css.mjs
3053
3038
  const css$29 = ".rp_5ZMIxq_panel{flex-direction:column;flex:1 1 0;min-height:0;display:flex}.rp_5ZMIxq_tabs{border-bottom:.5px solid var(--dsw-alias-border-l2);flex:none;gap:4px;padding:0 24px;display:flex;overflow-x:auto}.rp_5ZMIxq_tab{font:inherit;white-space:nowrap;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:0;border-bottom:2px solid #0000;flex:none;margin-bottom:-1px;padding:12px 10px 10px;font-size:13px;line-height:20px}.rp_5ZMIxq_tabOn{color:var(--dsw-alias-state-business-primary);border-bottom-color:var(--dsw-alias-state-business-primary);font-weight:500}.rp_5ZMIxq_body{flex:1 1 0;min-height:0;overflow-y:auto}.rp_5ZMIxq_sheet{box-sizing:border-box;flex-direction:column;gap:20px;max-width:760px;padding:24px 24px 240px;display:flex}.rp_5ZMIxq_head{align-items:flex-start;gap:20px;display:flex}.rp_5ZMIxq_portrait{aspect-ratio:3/4;object-fit:cover;border:.5px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-lg);width:150px;height:auto;display:block}.rp_5ZMIxq_portraitBox{border-radius:var(--dsw-radius-lg);width:150px;height:200px;color:inherit;font:inherit;cursor:pointer;background:0 0;border:0;flex:0 0 150px;padding:0;display:block;position:relative}.rp_5ZMIxq_portraitBox:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:2px}.rp_5ZMIxq_portraitBox:disabled{cursor:not-allowed}.rp_5ZMIxq_portraitAction{box-sizing:border-box;border-radius:0 0 var(--dsw-radius-lg) var(--dsw-radius-lg);color:#fff;text-align:center;opacity:0;background:#0000009e;padding:7px 6px;font-size:12px;line-height:16px;transition:opacity .12s;position:absolute;bottom:1px;left:1px;right:1px}.rp_5ZMIxq_portraitBox:hover .rp_5ZMIxq_portraitAction,.rp_5ZMIxq_portraitBox:focus-visible .rp_5ZMIxq_portraitAction,.rp_5ZMIxq_portraitBox:disabled .rp_5ZMIxq_portraitAction{opacity:1}.rp_5ZMIxq_portraitError,.rp_5ZMIxq_portraitHint{margin:12px 24px 0;font-size:12px}.rp_5ZMIxq_portraitError{color:var(--dsw-alias-state-danger-primary)}.rp_5ZMIxq_portraitHint{color:var(--dsw-alias-label-secondary)}.rp_5ZMIxq_placeholder{box-sizing:border-box;color:var(--dsw-alias-label-secondary);flex-direction:column;justify-content:center;align-items:center;gap:8px;display:flex}.rp_5ZMIxq_initial{opacity:.6;font-size:48px;font-weight:500;line-height:1}.rp_5ZMIxq_missing{color:var(--dsw-alias-label-tertiary);font-size:12px}.rp_5ZMIxq_meta{flex-direction:column;flex:1 1 0;gap:10px;min-width:0;display:flex}.rp_5ZMIxq_section{border-top:.5px solid var(--dsw-alias-border-l4);flex-direction:column;gap:6px;padding-top:16px;display:flex}.rp_5ZMIxq_sectionTitle{color:var(--dsw-alias-label-primary);margin:0;font-size:13px;font-weight:500;line-height:20px}.rp_5ZMIxq_empty{color:var(--dsw-alias-label-tertiary);margin:0;padding:0 24px;font-size:13px}.rp_5ZMIxq_section .rp_5ZMIxq_empty{padding:0}.rp_5ZMIxq_tabsSpace{flex:auto}.rp_5ZMIxq_voiceInline{min-width:220px;color:var(--dsw-alias-label-tertiary);align-items:center;gap:6px;font-size:12px;display:flex}.rp_5ZMIxq_bar{border-bottom:.5px solid var(--dsw-alias-border-l4);background:var(--dsw-alias-bg-layer-2);flex:none;justify-content:flex-end;align-items:center;gap:8px;padding:6px 24px;display:flex}.rp_5ZMIxq_barText{color:var(--dsw-alias-label-secondary);margin-right:auto;font-size:12px}.rp_5ZMIxq_nameInput{box-sizing:border-box;border:.5px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-md);background:var(--dsw-alias-bg-layer-1);width:100%;min-height:32px;color:var(--dsw-alias-label-primary);font:inherit;padding:4px 8px;font-size:14px;line-height:22px}.rp_5ZMIxq_row{flex-wrap:wrap;align-items:center;gap:8px;display:flex}.rp_5ZMIxq_grid{grid-template-columns:repeat(auto-fit,minmax(min(240px,100%),1fr));gap:10px 12px;display:grid}.rp_5ZMIxq_field{flex-direction:column;gap:4px;min-width:0;display:flex}.rp_5ZMIxq_wide{grid-column:1/-1}.rp_5ZMIxq_label,.rp_5ZMIxq_help{color:var(--dsw-alias-label-tertiary);font-size:12px}.rp_5ZMIxq_error{color:var(--dsw-alias-state-error-primary);font-size:12px}.rp_5ZMIxq_select{box-sizing:border-box;border:.5px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-md);background:var(--dsw-alias-bg-layer-1);width:100%;min-height:32px;color:inherit;font:inherit;padding:4px 8px;font-size:13px}.rp_5ZMIxq_area{box-sizing:border-box;border:.5px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-md);background:var(--dsw-alias-bg-layer-1);width:100%;min-height:96px;color:inherit;font:inherit;resize:vertical;padding:6px 8px;font-size:13px;line-height:20px}.rp_5ZMIxq_goal{border:.5px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-lg);flex-direction:column;gap:8px;padding:10px;display:flex}.rp_5ZMIxq_row>.rp_5ZMIxq_select{width:auto;min-width:110px}.rp_5ZMIxq_select:focus-visible,.rp_5ZMIxq_area:focus-visible,.rp_5ZMIxq_nameInput:focus-visible{border-color:var(--dsw-alias-state-business-primary);outline:none}@media (width<=640px){.rp_5ZMIxq_sheet{padding-inline:16px}.rp_5ZMIxq_head{flex-direction:column}.rp_5ZMIxq_portraitBox,.rp_5ZMIxq_portrait{width:120px}.rp_5ZMIxq_portraitBox{flex-basis:120px;height:160px}.rp_5ZMIxq_bar{flex-wrap:wrap;padding-inline:16px}.rp_5ZMIxq_voiceInline{width:100%;min-width:0}}";
3054
3039
  const key$29 = "src/client/world-editor/CharactersPanel.module.css";
3055
3040
  let tag$29 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$29) + "]");
@@ -3061,43 +3046,42 @@ window.__ModuleLoader__.load({
3061
3046
  }
3062
3047
  tag$29.textContent = css$29;
3063
3048
  var CharactersPanel_module_css_default = {
3064
- "field": "rp_5ZMIxq_field",
3065
- "wide": "rp_5ZMIxq_wide",
3066
3049
  "help": "rp_5ZMIxq_help",
3050
+ "tabs": "rp_5ZMIxq_tabs",
3051
+ "voiceInline": "rp_5ZMIxq_voiceInline",
3052
+ "portraitHint": "rp_5ZMIxq_portraitHint",
3067
3053
  "section": "rp_5ZMIxq_section",
3068
- "empty": "rp_5ZMIxq_empty",
3069
- "placeholder": "rp_5ZMIxq_placeholder",
3070
- "portraitAction": "rp_5ZMIxq_portraitAction",
3054
+ "select": "rp_5ZMIxq_select",
3055
+ "goal": "rp_5ZMIxq_goal",
3056
+ "missing": "rp_5ZMIxq_missing",
3057
+ "portraitError": "rp_5ZMIxq_portraitError",
3071
3058
  "panel": "rp_5ZMIxq_panel",
3072
- "portraitBox": "rp_5ZMIxq_portraitBox",
3059
+ "sectionTitle": "rp_5ZMIxq_sectionTitle",
3060
+ "grid": "rp_5ZMIxq_grid",
3061
+ "portraitAction": "rp_5ZMIxq_portraitAction",
3062
+ "label": "rp_5ZMIxq_label",
3063
+ "portrait": "rp_5ZMIxq_portrait",
3073
3064
  "bar": "rp_5ZMIxq_bar",
3074
- "goal": "rp_5ZMIxq_goal",
3075
- "tabs": "rp_5ZMIxq_tabs",
3076
- "body": "rp_5ZMIxq_body",
3077
3065
  "area": "rp_5ZMIxq_area",
3078
- "sectionTitle": "rp_5ZMIxq_sectionTitle",
3079
- "voiceInline": "rp_5ZMIxq_voiceInline",
3066
+ "sheet": "rp_5ZMIxq_sheet",
3080
3067
  "nameInput": "rp_5ZMIxq_nameInput",
3081
- "tabsSpace": "rp_5ZMIxq_tabsSpace",
3082
- "initial": "rp_5ZMIxq_initial",
3083
- "select": "rp_5ZMIxq_select",
3084
- "row": "rp_5ZMIxq_row",
3085
- "portraitError": "rp_5ZMIxq_portraitError",
3086
- "portraitHint": "rp_5ZMIxq_portraitHint",
3087
- "tabOn": "rp_5ZMIxq_tabOn",
3088
- "missing": "rp_5ZMIxq_missing",
3068
+ "field": "rp_5ZMIxq_field",
3069
+ "error": "rp_5ZMIxq_error",
3089
3070
  "tab": "rp_5ZMIxq_tab",
3071
+ "tabOn": "rp_5ZMIxq_tabOn",
3090
3072
  "head": "rp_5ZMIxq_head",
3091
- "sheet": "rp_5ZMIxq_sheet",
3092
- "grid": "rp_5ZMIxq_grid",
3093
- "meta": "rp_5ZMIxq_meta",
3073
+ "row": "rp_5ZMIxq_row",
3074
+ "empty": "rp_5ZMIxq_empty",
3075
+ "tabsSpace": "rp_5ZMIxq_tabsSpace",
3076
+ "portraitBox": "rp_5ZMIxq_portraitBox",
3094
3077
  "barText": "rp_5ZMIxq_barText",
3095
- "error": "rp_5ZMIxq_error",
3096
- "label": "rp_5ZMIxq_label",
3097
- "portrait": "rp_5ZMIxq_portrait"
3078
+ "wide": "rp_5ZMIxq_wide",
3079
+ "placeholder": "rp_5ZMIxq_placeholder",
3080
+ "meta": "rp_5ZMIxq_meta",
3081
+ "initial": "rp_5ZMIxq_initial",
3082
+ "body": "rp_5ZMIxq_body"
3098
3083
  };
3099
- //#endregion
3100
- //#region src/client/world-editor/EditorTabs.tsx
3084
+ // src/client/world-editor/EditorTabs.tsx
3101
3085
  /** Adds expected arrow, Home and End navigation to an existing editor tab strip. */
3102
3086
  function navigateEditorTabs(event) {
3103
3087
  if (event.defaultPrevented || !(event.target instanceof HTMLButtonElement) || event.target.getAttribute("role") !== "tab") return;
@@ -3143,8 +3127,7 @@ window.__ModuleLoader__.load({
3143
3127
  }, tab.key)), children]
3144
3128
  });
3145
3129
  }
3146
- //#endregion
3147
- //#region src/client/world-editor/CharactersPanel.tsx
3130
+ // src/client/world-editor/CharactersPanel.tsx
3148
3131
  /** A steady colour per name, for a portrait that does not exist yet. */
3149
3132
  function hueOf$4(name) {
3150
3133
  let hash = 0;
@@ -3812,8 +3795,7 @@ window.__ModuleLoader__.load({
3812
3795
  ]
3813
3796
  });
3814
3797
  }
3815
- //#endregion
3816
- //#region src/client/world-editor/EntityImage.tsx
3798
+ // src/client/world-editor/EntityImage.tsx
3817
3799
  /** A steady colour per name, for a picture that does not exist yet. */
3818
3800
  function hueOf$3(name) {
3819
3801
  let hash = 0;
@@ -3906,8 +3888,7 @@ window.__ModuleLoader__.load({
3906
3888
  ]
3907
3889
  });
3908
3890
  }
3909
- //#endregion
3910
- //#region src/client/world-editor/EntityPanels.tsx
3891
+ // src/client/world-editor/EntityPanels.tsx
3911
3892
  const split = (value) => value.split(",").map((part) => part.trim()).filter(Boolean);
3912
3893
  const visual = (description, tags, negativeTags, globalId) => description.trim() === "" ? null : {
3913
3894
  description: description.trim(),
@@ -4542,8 +4523,7 @@ window.__ModuleLoader__.load({
4542
4523
  ]
4543
4524
  });
4544
4525
  }
4545
- //#endregion
4546
- //#region src/client/world-editor/FactionsPanel.tsx
4526
+ // src/client/world-editor/FactionsPanel.tsx
4547
4527
  const list$2 = (text) => text.split(",").map((value) => value.trim()).filter(Boolean);
4548
4528
  function FactionsPanel({ t, world, source, onChanged, actions }) {
4549
4529
  const [chosen, setChosen] = (0, react.useState)();
@@ -4806,8 +4786,7 @@ window.__ModuleLoader__.load({
4806
4786
  ]
4807
4787
  });
4808
4788
  }
4809
- //#endregion
4810
- //#region \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/world-editor/RelationsPanel.module.css.mjs
4789
+ // \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/world-editor/RelationsPanel.module.css.mjs
4811
4790
  const css$28 = ".rp_7pEHTW_panel{flex-direction:column;flex:1 1 0;min-height:0;display:flex;position:relative}.rp_7pEHTW_toolbar{border-bottom:.5px solid var(--dsw-alias-border-l2);flex-wrap:wrap;align-items:center;gap:4px;padding:8px 16px;display:flex}.rp_7pEHTW_filter{border-radius:var(--dsw-radius-sm);min-height:28px;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:0;padding:4px 10px}.rp_7pEHTW_filterOn{color:var(--dsw-alias-state-business-primary);background:var(--dsw-alias-bg-layer-2)}.rp_7pEHTW_filter:focus-visible,.rp_7pEHTW_edge:focus-visible,.rp_7pEHTW_graphEdge:focus-visible{outline:var(--dsw-focus-ring-width) solid var(--dsw-focus-ring-color);outline-offset:-2px}.rp_7pEHTW_space{flex:1}.rp_7pEHTW_perspective{color:var(--dsw-alias-label-tertiary);align-items:center;gap:6px;font-size:12px;display:flex}.rp_7pEHTW_perspective select{border:.5px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-md);background:var(--dsw-alias-bg-layer-1);max-width:180px;min-height:32px;color:inherit;padding:4px 8px}.rp_7pEHTW_workspace{flex:1 1 0;grid-template-columns:minmax(220px,34%) minmax(320px,1fr);min-height:0;display:grid}.rp_7pEHTW_list{border-right:.5px solid var(--dsw-alias-border-l3);overflow-y:auto}.rp_7pEHTW_edge{border:0;border-bottom:.5px solid var(--dsw-alias-border-l4);width:100%;min-height:48px;color:inherit;text-align:left;cursor:pointer;background:0 0;flex-direction:column;gap:2px;padding:8px 16px;display:flex}.rp_7pEHTW_edgeOn{background:var(--dsw-alias-bg-layer-2)}.rp_7pEHTW_edgeTitle{text-overflow:ellipsis;white-space:nowrap;font-size:13px;overflow:hidden}.rp_7pEHTW_edgeKind{color:var(--dsw-alias-label-tertiary);font-size:12px}.rp_7pEHTW_empty{color:var(--dsw-alias-label-tertiary);padding:20px}.rp_7pEHTW_inspector{min-width:0;padding:24px 24px 240px;overflow-y:auto}.rp_7pEHTW_head h2{margin:0 0 8px;font-size:16px}.rp_7pEHTW_entities{color:var(--dsw-alias-label-secondary);flex-wrap:wrap;align-items:center;gap:6px;display:flex}.rp_7pEHTW_notice{color:var(--dsw-alias-label-secondary);margin:24px 0}.rp_7pEHTW_form{grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin-top:24px;display:grid}.rp_7pEHTW_form label{color:var(--dsw-alias-label-tertiary);flex-direction:column;gap:5px;font-size:12px;display:flex}.rp_7pEHTW_form select,.rp_7pEHTW_form textarea{box-sizing:border-box;border:.5px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-md);background:var(--dsw-alias-bg-layer-1);width:100%;min-height:32px;color:inherit;font:inherit;padding:6px 8px}.rp_7pEHTW_form textarea{resize:vertical;min-height:96px}.rp_7pEHTW_form select:focus-visible,.rp_7pEHTW_form textarea:focus-visible{border-color:var(--dsw-alias-state-business-primary);outline:none}.rp_7pEHTW_wide{grid-column:1/-1}.rp_7pEHTW_metrics{grid-column:1/-1;grid-template-columns:repeat(4,minmax(90px,1fr));gap:10px;display:grid}.rp_7pEHTW_check{align-self:end;align-items:center;min-height:32px;flex-direction:row!important}.rp_7pEHTW_actions{border-top:.5px solid var(--dsw-alias-border-l4);flex-wrap:wrap;justify-content:flex-end;align-items:center;gap:8px;margin-top:28px;padding-top:12px;display:flex}.rp_7pEHTW_status{color:var(--dsw-alias-label-secondary);margin-right:auto}.rp_7pEHTW_error{color:var(--dsw-alias-state-error-primary);margin-right:auto}.rp_7pEHTW_graph{background:radial-gradient(circle, var(--dsw-alias-bg-layer-2), transparent 70%);flex:1 1 0;min-height:360px;position:relative;overflow:hidden}.rp_7pEHTW_graph svg{width:100%;height:100%;min-height:520px}.rp_7pEHTW_graphEdge{cursor:pointer;stroke:var(--dsw-alias-border-l1);stroke-width:2px}.rp_7pEHTW_graphEdge:hover,.rp_7pEHTW_graphEdgeOn{stroke:var(--dsw-alias-state-business-primary);stroke-width:4px}.rp_7pEHTW_node circle{fill:var(--dsw-alias-bg-layer-1);stroke:var(--dsw-alias-border-l1);stroke-width:2px}.rp_7pEHTW_node_character circle{fill:color-mix(in srgb, var(--dsw-alias-state-business-primary) 18%, var(--dsw-alias-bg-layer-1))}.rp_7pEHTW_node_location circle{fill:color-mix(in srgb, #4a9 20%, var(--dsw-alias-bg-layer-1))}.rp_7pEHTW_node_item circle{fill:color-mix(in srgb, #c90 20%, var(--dsw-alias-bg-layer-1))}.rp_7pEHTW_node_faction circle{fill:color-mix(in srgb, #96c 20%, var(--dsw-alias-bg-layer-1))}.rp_7pEHTW_node text{fill:var(--dsw-alias-label-primary);pointer-events:none;font-size:12px}.rp_7pEHTW_graphInspector{box-sizing:border-box;border-radius:var(--dsw-radius-panel);background:var(--dsw-alias-bg-layer-1);width:min(480px,100% - 40px);max-height:62%;box-shadow:var(--dsw-elevation-panel);border:0;padding:18px;position:absolute;bottom:20px;right:20px;overflow-y:auto}@media (width<=760px){.rp_7pEHTW_workspace{grid-template-columns:1fr}.rp_7pEHTW_list{border-right:0;border-bottom:.5px solid var(--dsw-alias-border-l3);max-height:220px}.rp_7pEHTW_inspector{padding-inline:16px}.rp_7pEHTW_form{grid-template-columns:1fr}.rp_7pEHTW_wide,.rp_7pEHTW_metrics{grid-column:1}.rp_7pEHTW_metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.rp_7pEHTW_graphInspector{width:calc(100% - 24px);bottom:12px;right:12px}}@media (pointer:coarse){.rp_7pEHTW_filter{min-height:44px}}";
4812
4791
  const key$28 = "src/client/world-editor/RelationsPanel.module.css";
4813
4792
  let tag$28 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$28) + "]");
@@ -4819,42 +4798,41 @@ window.__ModuleLoader__.load({
4819
4798
  }
4820
4799
  tag$28.textContent = css$28;
4821
4800
  var RelationsPanel_module_css_default = {
4822
- "toolbar": "rp_7pEHTW_toolbar",
4823
- "node_character": "rp_7pEHTW_node_character",
4824
- "head": "rp_7pEHTW_head",
4825
- "notice": "rp_7pEHTW_notice",
4826
- "node_location": "rp_7pEHTW_node_location",
4827
- "graphEdge": "rp_7pEHTW_graphEdge",
4828
- "edgeKind": "rp_7pEHTW_edgeKind",
4829
- "actions": "rp_7pEHTW_actions",
4801
+ "filterOn": "rp_7pEHTW_filterOn",
4802
+ "perspective": "rp_7pEHTW_perspective",
4830
4803
  "space": "rp_7pEHTW_space",
4831
- "node_item": "rp_7pEHTW_node_item",
4804
+ "panel": "rp_7pEHTW_panel",
4805
+ "node_location": "rp_7pEHTW_node_location",
4806
+ "filter": "rp_7pEHTW_filter",
4807
+ "empty": "rp_7pEHTW_empty",
4832
4808
  "error": "rp_7pEHTW_error",
4833
- "workspace": "rp_7pEHTW_workspace",
4834
- "check": "rp_7pEHTW_check",
4835
- "node_faction": "rp_7pEHTW_node_faction",
4809
+ "metrics": "rp_7pEHTW_metrics",
4810
+ "edgeKind": "rp_7pEHTW_edgeKind",
4811
+ "node_character": "rp_7pEHTW_node_character",
4812
+ "toolbar": "rp_7pEHTW_toolbar",
4836
4813
  "node": "rp_7pEHTW_node",
4837
- "filter": "rp_7pEHTW_filter",
4838
- "graphEdgeOn": "rp_7pEHTW_graphEdgeOn",
4839
4814
  "wide": "rp_7pEHTW_wide",
4840
- "panel": "rp_7pEHTW_panel",
4841
4815
  "graphInspector": "rp_7pEHTW_graphInspector",
4842
- "edgeOn": "rp_7pEHTW_edgeOn",
4816
+ "node_faction": "rp_7pEHTW_node_faction",
4817
+ "status": "rp_7pEHTW_status",
4818
+ "workspace": "rp_7pEHTW_workspace",
4843
4819
  "form": "rp_7pEHTW_form",
4844
- "metrics": "rp_7pEHTW_metrics",
4845
- "edgeTitle": "rp_7pEHTW_edgeTitle",
4846
- "filterOn": "rp_7pEHTW_filterOn",
4847
- "empty": "rp_7pEHTW_empty",
4848
- "graph": "rp_7pEHTW_graph",
4849
4820
  "inspector": "rp_7pEHTW_inspector",
4850
- "perspective": "rp_7pEHTW_perspective",
4821
+ "node_item": "rp_7pEHTW_node_item",
4822
+ "edgeOn": "rp_7pEHTW_edgeOn",
4823
+ "edgeTitle": "rp_7pEHTW_edgeTitle",
4824
+ "notice": "rp_7pEHTW_notice",
4851
4825
  "list": "rp_7pEHTW_list",
4852
- "edge": "rp_7pEHTW_edge",
4853
4826
  "entities": "rp_7pEHTW_entities",
4854
- "status": "rp_7pEHTW_status"
4827
+ "graph": "rp_7pEHTW_graph",
4828
+ "head": "rp_7pEHTW_head",
4829
+ "actions": "rp_7pEHTW_actions",
4830
+ "graphEdge": "rp_7pEHTW_graphEdge",
4831
+ "graphEdgeOn": "rp_7pEHTW_graphEdgeOn",
4832
+ "check": "rp_7pEHTW_check",
4833
+ "edge": "rp_7pEHTW_edge"
4855
4834
  };
4856
- //#endregion
4857
- //#region src/client/world-editor/RelationsPanel.tsx
4835
+ // src/client/world-editor/RelationsPanel.tsx
4858
4836
  const title = (relation) => `${relation.from.name} → ${relation.to.name}`;
4859
4837
  const numeric = (value) => Number.isFinite(Number(value)) ? Number(value) : 0;
4860
4838
  const kindLabel = (t, kind) => t(`relation${kind[0].toUpperCase()}${kind.slice(1)}`);
@@ -5521,8 +5499,7 @@ window.__ModuleLoader__.load({
5521
5499
  onChange: (event) => onChange(Math.max(min, Math.min(1, numeric(event.target.value))))
5522
5500
  })] });
5523
5501
  }
5524
- //#endregion
5525
- //#region src/client/world-editor/LorePanel.tsx
5502
+ // src/client/world-editor/LorePanel.tsx
5526
5503
  function LorePanel({ t, world: rawWorld, source, onChanged, actions }) {
5527
5504
  const world = {
5528
5505
  ...rawWorld,
@@ -5875,8 +5852,7 @@ window.__ModuleLoader__.load({
5875
5852
  ]
5876
5853
  });
5877
5854
  }
5878
- //#endregion
5879
- //#region src/client/world-editor/PlotsPanel.tsx
5855
+ // src/client/world-editor/PlotsPanel.tsx
5880
5856
  const newPlot = () => ({
5881
5857
  id: "new-plot",
5882
5858
  name: "New plot",
@@ -6021,8 +5997,7 @@ window.__ModuleLoader__.load({
6021
5997
  ]
6022
5998
  });
6023
5999
  }
6024
- //#endregion
6025
- //#region src/shared/interface-pack.ts
6000
+ // src/shared/interface-pack.ts
6026
6001
  /** The places in the interface that take a surface. */
6027
6002
  const SURFACE_NAMES = [
6028
6003
  "hud",
@@ -6062,8 +6037,7 @@ window.__ModuleLoader__.load({
6062
6037
  max: 100
6063
6038
  }
6064
6039
  };
6065
- //#endregion
6066
- //#region src/client/widgets/pack-frame/frame-api.ts
6040
+ // src/client/widgets/pack-frame/frame-api.ts
6067
6041
  const enc$1 = encodeURIComponent;
6068
6042
  async function read$3(response, what) {
6069
6043
  if (!response.ok) throw new Error((await response.json().catch(() => ({}))).message ?? `${what} (${response.status})`);
@@ -6213,8 +6187,7 @@ window.__ModuleLoader__.load({
6213
6187
  }
6214
6188
  }
6215
6189
  };
6216
- //#endregion
6217
- //#region \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/widgets/pack-frame/PackFrame.module.css.mjs
6190
+ // \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/widgets/pack-frame/PackFrame.module.css.mjs
6218
6191
  const css$27 = ".rp_h_sbFq_frame{background:0 0;border:0;width:100%;display:block}.rp_h_sbFq_fill{height:100%;min-height:0}.rp_h_sbFq_message{color:var(--dsw-alias-label-secondary);margin:0;padding:16px 24px;font-size:13px;line-height:20px}.rp_h_sbFq_problems{color:var(--dsw-alias-label-tertiary);margin:8px 0 0;padding-left:18px;font-size:12px}.rp_h_sbFq_hud{box-sizing:border-box;width:min(800px,100%);margin:0 auto 8px;padding:0 16px}.rp_h_sbFq_tab{flex-direction:column;flex:1 1 0;width:100%;min-height:0;display:flex}";
6219
6192
  const key$27 = "src/client/widgets/pack-frame/PackFrame.module.css";
6220
6193
  let tag$27 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$27) + "]");
@@ -6226,15 +6199,14 @@ window.__ModuleLoader__.load({
6226
6199
  }
6227
6200
  tag$27.textContent = css$27;
6228
6201
  var PackFrame_module_css_default = {
6229
- "hud": "rp_h_sbFq_hud",
6230
6202
  "problems": "rp_h_sbFq_problems",
6231
- "frame": "rp_h_sbFq_frame",
6232
- "tab": "rp_h_sbFq_tab",
6203
+ "hud": "rp_h_sbFq_hud",
6233
6204
  "fill": "rp_h_sbFq_fill",
6234
- "message": "rp_h_sbFq_message"
6205
+ "message": "rp_h_sbFq_message",
6206
+ "tab": "rp_h_sbFq_tab",
6207
+ "frame": "rp_h_sbFq_frame"
6235
6208
  };
6236
- //#endregion
6237
- //#region src/client/widgets/pack-frame/theme.ts
6209
+ // src/client/widgets/pack-frame/theme.ts
6238
6210
  /** The colours of DSH a surface is given, so that it looks right in light and dark. */
6239
6211
  const SHARED_TOKENS = [
6240
6212
  "--dsw-alias-bg-base",
@@ -6296,8 +6268,7 @@ window.__ModuleLoader__.load({
6296
6268
  observer.disconnect();
6297
6269
  };
6298
6270
  }
6299
- //#endregion
6300
- //#region src/client/widgets/pack-frame/PackFrame.tsx
6271
+ // src/client/widgets/pack-frame/PackFrame.tsx
6301
6272
  /**
6302
6273
  * A surface of a pack, in a frame that can run its scripts and nothing more: no access to this page,
6303
6274
  * its storage or the network. The only way out is the bridge, which answers what the pack asked for.
@@ -6423,8 +6394,7 @@ window.__ModuleLoader__.load({
6423
6394
  "data-rp-frame": surface
6424
6395
  });
6425
6396
  }
6426
- //#endregion
6427
- //#region src/client/world-editor/world-files-api.ts
6397
+ // src/client/world-editor/world-files-api.ts
6428
6398
  async function read$2(response) {
6429
6399
  if (!response.ok) {
6430
6400
  const body = await response.json().catch(() => void 0);
@@ -6481,8 +6451,7 @@ window.__ModuleLoader__.load({
6481
6451
  const savePackFile = async (world, pack, path, text, signal) => (await read$2(await fetch(`${API_PREFIX}/worlds/interface/file?${packQuery(world, pack, path)}`, init("PUT", signal, { text })))).problems;
6482
6452
  const removePackFile = async (world, pack, path, signal) => (await read$2(await fetch(`${API_PREFIX}/worlds/interface/file?${packQuery(world, pack, path)}`, init("DELETE", signal)))).problems;
6483
6453
  const createPack = async (world, pack, name, signal) => (await read$2(await fetch(`${API_PREFIX}/worlds/interface/pack?${packQuery(world, pack)}`, init("POST", signal, { name })))).problems;
6484
- //#endregion
6485
- //#region \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/world-editor/PacksPanel.module.css.mjs
6454
+ // \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/world-editor/PacksPanel.module.css.mjs
6486
6455
  const css$26 = ".rp_FLaP7q_controls{flex-wrap:wrap;align-items:center;gap:8px 16px;margin:8px 0;display:flex}.rp_FLaP7q_group{color:var(--dsw-alias-label-tertiary);align-items:center;gap:4px;font-size:12px;display:inline-flex}.rp_FLaP7q_stage{border:1px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);background:var(--dsw-alias-bg-base);max-width:100%;overflow:hidden}.rp_FLaP7q_stageTall{height:420px}.rp_FLaP7q_log{color:var(--dsw-alias-label-secondary);margin:4px 0 0;padding-left:16px;font-size:12px}.rp_FLaP7q_files{columns:2 220px;margin:4px 0 0;padding-left:16px;font-size:12px}.rp_FLaP7q_note{color:var(--dsw-alias-label-tertiary);font-size:12px}";
6487
6456
  const key$26 = "src/client/world-editor/PacksPanel.module.css";
6488
6457
  let tag$26 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$26) + "]");
@@ -6494,16 +6463,15 @@ window.__ModuleLoader__.load({
6494
6463
  }
6495
6464
  tag$26.textContent = css$26;
6496
6465
  var PacksPanel_module_css_default = {
6497
- "stageTall": "rp_FLaP7q_stageTall",
6498
6466
  "log": "rp_FLaP7q_log",
6467
+ "note": "rp_FLaP7q_note",
6468
+ "controls": "rp_FLaP7q_controls",
6499
6469
  "group": "rp_FLaP7q_group",
6470
+ "stage": "rp_FLaP7q_stage",
6500
6471
  "files": "rp_FLaP7q_files",
6501
- "controls": "rp_FLaP7q_controls",
6502
- "note": "rp_FLaP7q_note",
6503
- "stage": "rp_FLaP7q_stage"
6472
+ "stageTall": "rp_FLaP7q_stageTall"
6504
6473
  };
6505
- //#endregion
6506
- //#region src/client/world-editor/PacksPanel.tsx
6474
+ // src/client/world-editor/PacksPanel.tsx
6507
6475
  const WIDTHS = {
6508
6476
  narrow: 360,
6509
6477
  medium: 720,
@@ -7001,8 +6969,7 @@ window.__ModuleLoader__.load({
7001
6969
  })]
7002
6970
  });
7003
6971
  }
7004
- //#endregion
7005
- //#region src/client/world-editor/trigger-text.ts
6972
+ // src/client/world-editor/trigger-text.ts
7006
6973
  function namesOf(world) {
7007
6974
  const by = (list) => {
7008
6975
  const names = new Map((list ?? []).map((entry) => [entry.key, entry.name]));
@@ -7082,8 +7049,7 @@ window.__ModuleLoader__.load({
7082
7049
  });
7083
7050
  return effect.while === void 0 ? text : `${text} (${say("only", { condition: describeCondition(say, names, effect.while) })})`;
7084
7051
  }
7085
- //#endregion
7086
- //#region src/client/world-editor/TriggersPanel.tsx
7052
+ // src/client/world-editor/TriggersPanel.tsx
7087
7053
  const STATUS = {
7088
7054
  fired: "fired",
7089
7055
  failed: "failed",
@@ -7395,8 +7361,7 @@ window.__ModuleLoader__.load({
7395
7361
  ]
7396
7362
  });
7397
7363
  }
7398
- //#endregion
7399
- //#region src/client/lorebooks-api.ts
7364
+ // src/client/lorebooks-api.ts
7400
7365
  async function reply$3(response) {
7401
7366
  if (!response.ok) {
7402
7367
  const body = await response.json().catch(() => void 0);
@@ -7484,8 +7449,7 @@ window.__ModuleLoader__.load({
7484
7449
  signal
7485
7450
  }));
7486
7451
  }
7487
- //#endregion
7488
- //#region src/client/presets-api.ts
7452
+ // src/client/presets-api.ts
7489
7453
  async function reply$2(response) {
7490
7454
  if (!response.ok) {
7491
7455
  const body = await response.json().catch(() => void 0);
@@ -7588,8 +7552,7 @@ window.__ModuleLoader__.load({
7588
7552
  signal
7589
7553
  }));
7590
7554
  }
7591
- //#endregion
7592
- //#region \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/widgets/sampling-fields/SamplingFields.module.css.mjs
7555
+ // \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/widgets/sampling-fields/SamplingFields.module.css.mjs
7593
7556
  const css$25 = ".rp_9vxYSG_root{flex-direction:column;gap:8px;display:flex}.rp_9vxYSG_grid{grid-template-columns:repeat(auto-fill,minmax(190px,1fr));gap:8px 12px;display:grid}.rp_9vxYSG_field{flex-direction:column;gap:4px;display:flex}.rp_9vxYSG_label{color:var(--dsw-alias-label-tertiary);font-size:12px}.rp_9vxYSG_input{font:inherit;border:1px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);color:inherit;background:0 0;min-width:0;padding:4px 8px;font-size:13px}.rp_9vxYSG_input:disabled{opacity:.6}.rp_9vxYSG_help{color:var(--dsw-alias-label-tertiary);margin:0;font-size:12px}";
7594
7557
  const key$25 = "src/client/widgets/sampling-fields/SamplingFields.module.css";
7595
7558
  let tag$25 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$25) + "]");
@@ -7601,15 +7564,14 @@ window.__ModuleLoader__.load({
7601
7564
  }
7602
7565
  tag$25.textContent = css$25;
7603
7566
  var SamplingFields_module_css_default = {
7604
- "root": "rp_9vxYSG_root",
7605
- "label": "rp_9vxYSG_label",
7606
7567
  "input": "rp_9vxYSG_input",
7607
- "grid": "rp_9vxYSG_grid",
7568
+ "root": "rp_9vxYSG_root",
7608
7569
  "field": "rp_9vxYSG_field",
7609
- "help": "rp_9vxYSG_help"
7570
+ "label": "rp_9vxYSG_label",
7571
+ "help": "rp_9vxYSG_help",
7572
+ "grid": "rp_9vxYSG_grid"
7610
7573
  };
7611
- //#endregion
7612
- //#region src/client/widgets/sampling-fields/SamplingFields.tsx
7574
+ // src/client/widgets/sampling-fields/SamplingFields.tsx
7613
7575
  const samplingTexts = (sampling) => Object.fromEntries(SAMPLING_KEYS.map((key) => [key, sampling[key]?.toString() ?? ""]));
7614
7576
  /** The controls typed so far; a text that is not a number in range is left out, which the host then reports when the form is saved. */
7615
7577
  function samplingOfTexts(texts) {
@@ -7654,8 +7616,7 @@ window.__ModuleLoader__.load({
7654
7616
  })]
7655
7617
  });
7656
7618
  }
7657
- //#endregion
7658
- //#region src/client/world-editor/InfoPanel.tsx
7619
+ // src/client/world-editor/InfoPanel.tsx
7659
7620
  const draftOf$4 = (info) => ({
7660
7621
  name: info.name,
7661
7622
  description: info.description,
@@ -8078,8 +8039,7 @@ window.__ModuleLoader__.load({
8078
8039
  ]
8079
8040
  });
8080
8041
  }
8081
- //#endregion
8082
- //#region src/client/world-editor/PromptsPanel.tsx
8042
+ // src/client/world-editor/PromptsPanel.tsx
8083
8043
  const messageOf$9 = (error) => error instanceof Error ? error.message : String(error);
8084
8044
  /** The prompts the models are given: the world can carry its own version of each, which replaces the shipped one in the sessions it starts. */
8085
8045
  function PromptsPanel({ t, worldId, language, actions }) {
@@ -8311,8 +8271,7 @@ window.__ModuleLoader__.load({
8311
8271
  })]
8312
8272
  });
8313
8273
  }
8314
- //#endregion
8315
- //#region src/client/world-editor/RoutinesPanel.tsx
8274
+ // src/client/world-editor/RoutinesPanel.tsx
8316
8275
  const DAYS = [
8317
8276
  "mon",
8318
8277
  "tue",
@@ -8661,8 +8620,7 @@ window.__ModuleLoader__.load({
8661
8620
  ]
8662
8621
  });
8663
8622
  }
8664
- //#endregion
8665
- //#region src/client/world-editor/CalendarPanel.tsx
8623
+ // src/client/world-editor/CalendarPanel.tsx
8666
8624
  const draftOf$3 = (calendar) => ({
8667
8625
  hemisphere: calendar.hemisphere,
8668
8626
  holidays: calendar.holidays.map((holiday) => ({
@@ -8869,8 +8827,7 @@ window.__ModuleLoader__.load({
8869
8827
  ]
8870
8828
  });
8871
8829
  }
8872
- //#endregion
8873
- //#region src/client/widgets/tool-switches/tools-api.ts
8830
+ // src/client/widgets/tool-switches/tools-api.ts
8874
8831
  /** The tools other plugins registered for everyone (a file or shell tool, an MCP server's), which an agent can be given. */
8875
8832
  async function loadExternalTools(signal) {
8876
8833
  const response = await fetch(`${API_PREFIX}/tools`, {
@@ -8880,8 +8837,7 @@ window.__ModuleLoader__.load({
8880
8837
  if (!response.ok) throw new Error(`${response.status} ${response.statusText}`.trim());
8881
8838
  return (await response.json()).tools ?? [];
8882
8839
  }
8883
- //#endregion
8884
- //#region src/shared/tools.ts
8840
+ // src/shared/tools.ts
8885
8841
  /** The kinds of agent whose tools can be chosen. A character is not one agent but a kind: the choice is for all of them. */
8886
8842
  const AGENT_KINDS = [
8887
8843
  "gameMaster",
@@ -9010,8 +8966,7 @@ window.__ModuleLoader__.load({
9010
8966
  if (Object.keys(mine).length === 0) delete next[agent];
9011
8967
  return next;
9012
8968
  }
9013
- //#endregion
9014
- //#region \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/widgets/tool-switches/ToolSwitches.module.css.mjs
8969
+ // \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/widgets/tool-switches/ToolSwitches.module.css.mjs
9015
8970
  const css$24 = ".rp_CjoFLq_root{flex-direction:column;gap:12px;display:flex}.rp_CjoFLq_title{margin:0;font-size:16px;font-weight:500;line-height:24px}.rp_CjoFLq_help{color:var(--dsw-alias-label-secondary);margin:0;font-size:13px}.rp_CjoFLq_agent{border-top:1px solid var(--dsw-alias-border-l3);flex-direction:column;gap:6px;padding:8px 0;display:flex}.rp_CjoFLq_agentName{font-size:14px;font-weight:500}.rp_CjoFLq_hint{color:var(--dsw-alias-label-tertiary);font-size:12px}.rp_CjoFLq_tool{cursor:pointer;align-items:flex-start;gap:8px;font-size:13px;display:flex}.rp_CjoFLq_tool input{margin-top:3px}.rp_CjoFLq_toolText{flex-direction:column;display:flex}.rp_CjoFLq_default{color:var(--dsw-alias-label-tertiary);margin-left:6px;font-size:12px}.rp_CjoFLq_error{color:var(--dsw-alias-state-error-primary);font-size:12px}.rp_CjoFLq_external{flex-direction:column;gap:6px;margin-top:4px;display:flex}.rp_CjoFLq_external>summary{cursor:pointer}";
9016
8971
  const key$24 = "src/client/widgets/tool-switches/ToolSwitches.module.css";
9017
8972
  let tag$24 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$24) + "]");
@@ -9023,20 +8978,19 @@ window.__ModuleLoader__.load({
9023
8978
  }
9024
8979
  tag$24.textContent = css$24;
9025
8980
  var ToolSwitches_module_css_default = {
9026
- "error": "rp_CjoFLq_error",
9027
- "root": "rp_CjoFLq_root",
9028
- "agent": "rp_CjoFLq_agent",
9029
- "default": "rp_CjoFLq_default",
9030
8981
  "external": "rp_CjoFLq_external",
9031
8982
  "tool": "rp_CjoFLq_tool",
9032
- "toolText": "rp_CjoFLq_toolText",
9033
8983
  "help": "rp_CjoFLq_help",
9034
- "title": "rp_CjoFLq_title",
8984
+ "agentName": "rp_CjoFLq_agentName",
8985
+ "root": "rp_CjoFLq_root",
8986
+ "default": "rp_CjoFLq_default",
9035
8987
  "hint": "rp_CjoFLq_hint",
9036
- "agentName": "rp_CjoFLq_agentName"
8988
+ "toolText": "rp_CjoFLq_toolText",
8989
+ "agent": "rp_CjoFLq_agent",
8990
+ "title": "rp_CjoFLq_title",
8991
+ "error": "rp_CjoFLq_error"
9037
8992
  };
9038
- //#endregion
9039
- //#region src/client/widgets/tool-switches/ToolSwitches.tsx
8993
+ // src/client/widgets/tool-switches/ToolSwitches.tsx
9040
8994
  /**
9041
8995
  * The optional tools of each kind of agent, each a switch. It shows only the tools this version offers: names in the board it does not know
9042
8996
  * stay in it untouched, so that what a world or a settings file carries from another version survives a change made here.
@@ -9144,8 +9098,7 @@ window.__ModuleLoader__.load({
9144
9098
  ]
9145
9099
  });
9146
9100
  }
9147
- //#endregion
9148
- //#region src/client/world-editor/ToolsPanel.tsx
9101
+ // src/client/world-editor/ToolsPanel.tsx
9149
9102
  /** The optional tools the world's agents have, kept in `world.json` and given to every story started from the world; a story can change them for itself later. */
9150
9103
  function ToolsPanel({ t, worldId, actions }) {
9151
9104
  const [board, setBoard] = (0, react.useState)();
@@ -9202,8 +9155,7 @@ window.__ModuleLoader__.load({
9202
9155
  })]
9203
9156
  });
9204
9157
  }
9205
- //#endregion
9206
- //#region src/client/world-editor/DicePanel.tsx
9158
+ // src/client/world-editor/DicePanel.tsx
9207
9159
  const draftOf$2 = (dice) => dice.checks.map((check) => ({
9208
9160
  key: check.key,
9209
9161
  name: check.name,
@@ -9602,8 +9554,7 @@ window.__ModuleLoader__.load({
9602
9554
  ]
9603
9555
  });
9604
9556
  }
9605
- //#endregion
9606
- //#region src/client/world-editor/variables-draft.ts
9557
+ // src/client/world-editor/variables-draft.ts
9607
9558
  const list$1 = (value) => value.split(/[,,\n]/).map((entry) => entry.trim()).filter((entry) => entry !== "");
9608
9559
  const NEW = {
9609
9560
  key: "",
@@ -9675,8 +9626,7 @@ window.__ModuleLoader__.load({
9675
9626
  ...draft.kind === "number" && bands.length > 0 ? { bands } : {}
9676
9627
  };
9677
9628
  }
9678
- //#endregion
9679
- //#region src/client/world-editor/VariablesPanel.tsx
9629
+ // src/client/world-editor/VariablesPanel.tsx
9680
9630
  /** What the world tracks beyond what every story does: numbers, flags and choices about characters, things, places or the world, with how each is told. */
9681
9631
  function VariablesPanel({ t, worldId, actions }) {
9682
9632
  const [saved, setSaved] = (0, react.useState)();
@@ -9936,8 +9886,7 @@ window.__ModuleLoader__.load({
9936
9886
  ]
9937
9887
  });
9938
9888
  }
9939
- //#endregion
9940
- //#region src/client/widgets/media-image/MediaImage.tsx
9889
+ // src/client/widgets/media-image/MediaImage.tsx
9941
9890
  const MAX_PROMPT = 360;
9942
9891
  /** What the tooltip of an image says: what it shows, who is in it, and the prompt it was made from. */
9943
9892
  function imageSummary(details, labels) {
@@ -9989,8 +9938,7 @@ window.__ModuleLoader__.load({
9989
9938
  }
9990
9939
  })] });
9991
9940
  }
9992
- //#endregion
9993
- //#region src/client/widgets/gallery-view/gallery-api.ts
9941
+ // src/client/widgets/gallery-view/gallery-api.ts
9994
9942
  const route = (target, path = "") => `${API_PREFIX}/${target.kind}/gallery${path}?id=${encodeURIComponent(target.id)}`;
9995
9943
  async function failure(response) {
9996
9944
  const body = await response.json().catch(() => void 0);
@@ -10031,8 +9979,7 @@ window.__ModuleLoader__.load({
10031
9979
  return await response.json();
10032
9980
  }
10033
9981
  const imageUrl = (target, image) => `${route(target, "/file")}&path=${encodeURIComponent(image.path)}&v=${encodeURIComponent(image.createdAt)}`;
10034
- //#endregion
10035
- //#region \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
9982
+ // \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
10036
9983
  const css$23 = ".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))}}";
10037
9984
  const key$23 = "src/client/widgets/gallery-view/GalleryView.module.css";
10038
9985
  let tag$23 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$23) + "]");
@@ -10044,38 +9991,37 @@ window.__ModuleLoader__.load({
10044
9991
  }
10045
9992
  tag$23.textContent = css$23;
10046
9993
  var GalleryView_module_css_default = {
10047
- "message": "rp_9pSHmG_message",
10048
- "facts": "rp_9pSHmG_facts",
10049
- "editField": "rp_9pSHmG_editField",
10050
- "image": "rp_9pSHmG_image",
10051
9994
  "tags": "rp_9pSHmG_tags",
10052
- "select": "rp_9pSHmG_select",
10053
- "status": "rp_9pSHmG_status",
9995
+ "editLabel": "rp_9pSHmG_editLabel",
9996
+ "toolbar": "rp_9pSHmG_toolbar",
9997
+ "editField": "rp_9pSHmG_editField",
9998
+ "reusable": "rp_9pSHmG_reusable",
9999
+ "note": "rp_9pSHmG_note",
10054
10000
  "editInput": "rp_9pSHmG_editInput",
10055
- "large": "rp_9pSHmG_large",
10056
- "edit": "rp_9pSHmG_edit",
10001
+ "status": "rp_9pSHmG_status",
10002
+ "editButton": "rp_9pSHmG_editButton",
10003
+ "count": "rp_9pSHmG_count",
10004
+ "actions": "rp_9pSHmG_actions",
10057
10005
  "detail": "rp_9pSHmG_detail",
10058
- "note": "rp_9pSHmG_note",
10006
+ "editHelp": "rp_9pSHmG_editHelp",
10007
+ "editArea": "rp_9pSHmG_editArea",
10059
10008
  "cell": "rp_9pSHmG_cell",
10060
- "thumb": "rp_9pSHmG_thumb",
10061
- "actions": "rp_9pSHmG_actions",
10009
+ "edit": "rp_9pSHmG_edit",
10010
+ "open": "rp_9pSHmG_open",
10011
+ "statusError": "rp_9pSHmG_statusError",
10062
10012
  "error": "rp_9pSHmG_error",
10063
- "toolbar": "rp_9pSHmG_toolbar",
10064
- "editLabel": "rp_9pSHmG_editLabel",
10065
- "editArea": "rp_9pSHmG_editArea",
10066
- "count": "rp_9pSHmG_count",
10013
+ "image": "rp_9pSHmG_image",
10067
10014
  "caption": "rp_9pSHmG_caption",
10015
+ "thumb": "rp_9pSHmG_thumb",
10016
+ "facts": "rp_9pSHmG_facts",
10017
+ "large": "rp_9pSHmG_large",
10068
10018
  "pre": "rp_9pSHmG_pre",
10069
- "editHelp": "rp_9pSHmG_editHelp",
10019
+ "select": "rp_9pSHmG_select",
10070
10020
  "grid": "rp_9pSHmG_grid",
10071
- "editButton": "rp_9pSHmG_editButton",
10072
- "page": "rp_9pSHmG_page",
10073
- "open": "rp_9pSHmG_open",
10074
- "statusError": "rp_9pSHmG_statusError",
10075
- "reusable": "rp_9pSHmG_reusable"
10021
+ "message": "rp_9pSHmG_message",
10022
+ "page": "rp_9pSHmG_page"
10076
10023
  };
10077
- //#endregion
10078
- //#region src/client/widgets/gallery-view/GalleryView.tsx
10024
+ // src/client/widgets/gallery-view/GalleryView.tsx
10079
10025
  /** How often the list is read again while pictures are waiting to be described. */
10080
10026
  const POLL_MS$2 = 3e3;
10081
10027
  const messageOf$8 = (error) => error instanceof Error ? error.message : String(error);
@@ -10400,8 +10346,7 @@ window.__ModuleLoader__.load({
10400
10346
  ]
10401
10347
  });
10402
10348
  }
10403
- //#endregion
10404
- //#region \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/world-editor/WorldEditor.module.css.mjs
10349
+ // \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/world-editor/WorldEditor.module.css.mjs
10405
10350
  const css$22 = ".rp__swA3a_view{flex:1 1 0;width:100%;min-height:0;display:flex}.rp__swA3a_message{color:var(--dsw-alias-label-secondary);margin:0;padding:24px;font-size:13px}.rp__swA3a_warning{color:var(--dsw-alias-label-primary);border:.5px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-lg);background:var(--dsw-alias-bg-layer-2);margin:0 0 12px;padding:8px 12px;font-size:13px}.rp__swA3a_drawer{box-sizing:border-box;border-right:.5px solid var(--dsw-alias-border-l3);flex-direction:column;flex:0 0 168px;gap:2px;padding:16px 8px;display:flex}.rp__swA3a_drawerItem{border-radius:var(--dsw-radius-md);width:100%;font:inherit;text-align:left;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:0;padding:6px 12px;font-size:13px;line-height:20px;display:block}@media (width<=720px){.rp__swA3a_view{flex-direction:column}.rp__swA3a_drawer{border-right:0;border-bottom:.5px solid var(--dsw-alias-border-l3);flex-direction:row;flex:none;width:100%;padding:8px;overflow-x:auto}.rp__swA3a_drawerItem{white-space:nowrap;flex:none;width:auto}}.rp__swA3a_drawerItem:disabled{color:var(--dsw-alias-label-tertiary);cursor:default}.rp__swA3a_drawerItemOn{color:var(--dsw-alias-state-business-primary);background:var(--dsw-alias-bg-layer-2);font-weight:500}.rp__swA3a_content{flex-direction:column;flex:1 1 0;min-width:0;min-height:0;display:flex}";
10406
10351
  const key$22 = "src/client/world-editor/WorldEditor.module.css";
10407
10352
  let tag$22 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$22) + "]");
@@ -10413,16 +10358,15 @@ window.__ModuleLoader__.load({
10413
10358
  }
10414
10359
  tag$22.textContent = css$22;
10415
10360
  var WorldEditor_module_css_default = {
10416
- "drawerItem": "rp__swA3a_drawerItem",
10417
- "drawerItemOn": "rp__swA3a_drawerItemOn",
10418
- "content": "rp__swA3a_content",
10419
10361
  "drawer": "rp__swA3a_drawer",
10420
10362
  "warning": "rp__swA3a_warning",
10363
+ "content": "rp__swA3a_content",
10364
+ "drawerItem": "rp__swA3a_drawerItem",
10421
10365
  "view": "rp__swA3a_view",
10366
+ "drawerItemOn": "rp__swA3a_drawerItemOn",
10422
10367
  "message": "rp__swA3a_message"
10423
10368
  };
10424
- //#endregion
10425
- //#region src/client/world-editor/WorldEditor.tsx
10369
+ // src/client/world-editor/WorldEditor.tsx
10426
10370
  const SECTIONS = [
10427
10371
  {
10428
10372
  id: "info",
@@ -10802,8 +10746,7 @@ window.__ModuleLoader__.load({
10802
10746
  })]
10803
10747
  });
10804
10748
  }
10805
- //#endregion
10806
- //#region \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/pages/avatars/AvatarsPage.module.css.mjs
10749
+ // \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/pages/avatars/AvatarsPage.module.css.mjs
10807
10750
  const css$21 = ".rp_pQOzEG_page{flex-direction:column;flex:1 1 0;gap:8px;min-height:0;display:flex}.rp_pQOzEG_toolbar{flex:none;justify-content:space-between;align-items:center;gap:12px;min-height:28px;display:flex}.rp_pQOzEG_count{color:var(--dsw-alias-label-tertiary);font-size:12px}.rp_pQOzEG_actions{flex-wrap:wrap;align-items:center;gap:8px;display:flex}.rp_pQOzEG_viewport{flex:1 1 0;min-height:0;padding:4px;overflow-y:auto}.rp_pQOzEG_grid{grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:12px;margin:0;padding:0;list-style:none;display:grid}.rp_pQOzEG_card{border:.5px solid var(--dsw-alias-settings-card-stroke);border-radius:var(--dsw-radius-xl);background:var(--dsw-alias-settings-card-fill);align-items:center;gap:4px;min-width:0;padding-right:8px;display:flex}.rp_pQOzEG_card:hover{border-color:var(--dsw-alias-border-l4)}.rp_pQOzEG_open{min-width:0;font:inherit;text-align:left;color:inherit;cursor:pointer;background:0 0;border:0;flex:auto;align-items:center;gap:12px;padding:10px 0 10px 10px;display:flex}.rp_pQOzEG_open:focus-visible{outline:var(--dsw-focus-ring-width) solid var(--dsw-focus-ring-color);outline-offset:2px}.rp_pQOzEG_portrait,.rp_pQOzEG_placeholder{border-radius:var(--dsw-radius-lg);object-fit:cover;flex:none;width:48px;height:48px}.rp_pQOzEG_placeholder{color:var(--dsw-alias-label-secondary);justify-content:center;align-items:center;font-size:20px;font-weight:500;display:flex}.rp_pQOzEG_text{flex-direction:column;gap:2px;min-width:0;display:flex}.rp_pQOzEG_name{text-overflow:ellipsis;white-space:nowrap;color:var(--dsw-alias-label-primary);font-size:13px;font-weight:500;overflow:hidden}.rp_pQOzEG_summary{color:var(--dsw-alias-label-secondary);-webkit-line-clamp:2;-webkit-box-orient:vertical;font-size:12px;line-height:18px;display:-webkit-box;overflow:hidden}.rp_pQOzEG_message{text-align:center;color:var(--dsw-alias-label-secondary);margin:0;padding:40px 0;font-size:13px}.rp_pQOzEG_error{color:var(--dsw-alias-state-error-primary);margin:0;font-size:12px}.rp_pQOzEG_editHeader{border-bottom:.5px solid var(--dsw-alias-border-l3);flex:none;align-items:center;gap:8px;padding:8px 16px;display:flex}.rp_pQOzEG_editTitle{color:var(--dsw-alias-label-primary);font-size:14px;font-weight:500}.rp_pQOzEG_editBody{flex:1 1 0;min-height:0;display:flex}.rp_pQOzEG_form{flex-direction:column;gap:16px;min-width:min(420px,100%);display:flex}.rp_pQOzEG_field{flex-direction:column;gap:6px;min-width:0;display:flex}.rp_pQOzEG_label{color:var(--dsw-alias-label-secondary);font-size:12px}@media (width<=640px){.rp_pQOzEG_toolbar{align-items:flex-start}.rp_pQOzEG_count{padding-top:6px}.rp_pQOzEG_grid{grid-template-columns:1fr}.rp_pQOzEG_form{min-width:0}}";
10808
10751
  const key$21 = "src/client/pages/avatars/AvatarsPage.module.css";
10809
10752
  let tag$21 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$21) + "]");
@@ -10815,30 +10758,29 @@ window.__ModuleLoader__.load({
10815
10758
  }
10816
10759
  tag$21.textContent = css$21;
10817
10760
  var AvatarsPage_module_css_default = {
10818
- "portrait": "rp_pQOzEG_portrait",
10819
- "editTitle": "rp_pQOzEG_editTitle",
10820
- "editBody": "rp_pQOzEG_editBody",
10821
- "error": "rp_pQOzEG_error",
10822
- "name": "rp_pQOzEG_name",
10823
- "summary": "rp_pQOzEG_summary",
10761
+ "open": "rp_pQOzEG_open",
10824
10762
  "placeholder": "rp_pQOzEG_placeholder",
10825
- "actions": "rp_pQOzEG_actions",
10826
- "viewport": "rp_pQOzEG_viewport",
10827
- "toolbar": "rp_pQOzEG_toolbar",
10828
- "card": "rp_pQOzEG_card",
10829
- "message": "rp_pQOzEG_message",
10830
- "page": "rp_pQOzEG_page",
10831
- "editHeader": "rp_pQOzEG_editHeader",
10832
- "field": "rp_pQOzEG_field",
10833
- "label": "rp_pQOzEG_label",
10834
- "grid": "rp_pQOzEG_grid",
10835
10763
  "form": "rp_pQOzEG_form",
10764
+ "error": "rp_pQOzEG_error",
10765
+ "page": "rp_pQOzEG_page",
10766
+ "portrait": "rp_pQOzEG_portrait",
10767
+ "message": "rp_pQOzEG_message",
10836
10768
  "count": "rp_pQOzEG_count",
10837
10769
  "text": "rp_pQOzEG_text",
10838
- "open": "rp_pQOzEG_open"
10770
+ "name": "rp_pQOzEG_name",
10771
+ "field": "rp_pQOzEG_field",
10772
+ "grid": "rp_pQOzEG_grid",
10773
+ "card": "rp_pQOzEG_card",
10774
+ "actions": "rp_pQOzEG_actions",
10775
+ "editHeader": "rp_pQOzEG_editHeader",
10776
+ "toolbar": "rp_pQOzEG_toolbar",
10777
+ "editTitle": "rp_pQOzEG_editTitle",
10778
+ "editBody": "rp_pQOzEG_editBody",
10779
+ "viewport": "rp_pQOzEG_viewport",
10780
+ "summary": "rp_pQOzEG_summary",
10781
+ "label": "rp_pQOzEG_label"
10839
10782
  };
10840
- //#endregion
10841
- //#region src/client/pages/avatars/AvatarsPage.tsx
10783
+ // src/client/pages/avatars/AvatarsPage.tsx
10842
10784
  const hueOf$2 = (name) => Array.from(name).reduce((hash, char) => (hash * 31 + char.charCodeAt(0)) % 360, 0);
10843
10785
  function Card({ avatar, editLabel, deleteLabel, onEdit, onDelete }) {
10844
10786
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("li", {
@@ -11103,8 +11045,7 @@ window.__ModuleLoader__.load({
11103
11045
  ]
11104
11046
  });
11105
11047
  }
11106
- //#endregion
11107
- //#region src/client/widgets/sampling-fields/locales.ts
11048
+ // src/client/widgets/sampling-fields/locales.ts
11108
11049
  const dictionaries$18 = {
11109
11050
  en: {
11110
11051
  sf_master: "Narrator temperature (0 to 2)",
@@ -11129,8 +11070,7 @@ window.__ModuleLoader__.load({
11129
11070
  sf_help: "由此开始的故事向模型提出请求的方式,只对那个故事生效:开始时它自己的选择优先。留空表示不作建议。温度之外的值作用于叙述者和角色,不会用于需要精确的辅助者。"
11130
11071
  }
11131
11072
  };
11132
- //#endregion
11133
- //#region src/client/widgets/tool-switches/locales.ts
11073
+ // src/client/widgets/tool-switches/locales.ts
11134
11074
  const dictionaries$17 = {
11135
11075
  en: {
11136
11076
  sw_title: "Tools",
@@ -11209,8 +11149,7 @@ window.__ModuleLoader__.load({
11209
11149
  sw_tool_list_items_hint: "记录员可以查看故事中的物品及其位置。"
11210
11150
  }
11211
11151
  };
11212
- //#endregion
11213
- //#region src/client/widgets/gallery-view/locales.ts
11152
+ // src/client/widgets/gallery-view/locales.ts
11214
11153
  const dictionaries$16 = {
11215
11154
  en: {
11216
11155
  tab: "Gallery",
@@ -12248,8 +12187,7 @@ window.__ModuleLoader__.load({
12248
12187
  avatarEdit: "编辑"
12249
12188
  }
12250
12189
  }, dictionaries$12);
12251
- //#endregion
12252
- //#region src/client/pages/avatars/index.ts
12190
+ // src/client/pages/avatars/index.ts
12253
12191
  const NAMESPACE$12 = "roleplay.avatars";
12254
12192
  /** Adds the Avatars page to the Role Play panel: characters to play in any world. */
12255
12193
  function registerAvatarsPage(ctx) {
@@ -12268,8 +12206,7 @@ window.__ModuleLoader__.load({
12268
12206
  inject: () => avatars.inject()
12269
12207
  }, AvatarsPage));
12270
12208
  }
12271
- //#endregion
12272
- //#region \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/pages/lorebooks/LorebooksPage.module.css.mjs
12209
+ // \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/pages/lorebooks/LorebooksPage.module.css.mjs
12273
12210
  const css$20 = ".rp_VV-Eha_page{flex-direction:column;flex:1 1 0;gap:8px;min-height:0;display:flex}.rp_VV-Eha_toolbar{flex:none;justify-content:space-between;align-items:center;gap:12px;min-height:28px;display:flex}.rp_VV-Eha_count{color:var(--dsw-alias-label-tertiary);font-size:12px}.rp_VV-Eha_actions{flex-wrap:wrap;align-items:center;gap:8px;display:flex}.rp_VV-Eha_viewport{flex:1 1 0;min-height:0;padding:4px;overflow-y:auto}.rp_VV-Eha_grid{grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:12px;margin:0;padding:0;list-style:none;display:grid}.rp_VV-Eha_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;gap:8px;min-width:0;padding:12px;display:flex}.rp_VV-Eha_card:hover{border-color:var(--dsw-alias-border-l4)}.rp_VV-Eha_head{flex-direction:column;gap:2px;min-width:0;display:flex}.rp_VV-Eha_title{text-overflow:ellipsis;white-space:nowrap;color:var(--dsw-alias-label-primary);font-size:13px;font-weight:500;overflow:hidden}.rp_VV-Eha_name{color:var(--dsw-alias-label-tertiary);font-size:12px}.rp_VV-Eha_description{color:var(--dsw-alias-label-secondary);-webkit-line-clamp:3;-webkit-box-orient:vertical;margin:0;font-size:12px;line-height:18px;display:-webkit-box;overflow:hidden}.rp_VV-Eha_meta{color:var(--dsw-alias-label-tertiary);font-size:12px}.rp_VV-Eha_cardActions{flex-wrap:wrap;gap:4px;margin-top:auto;display:flex}.rp_VV-Eha_message{text-align:center;color:var(--dsw-alias-label-secondary);margin:0;padding:40px 0;font-size:13px}.rp_VV-Eha_error{color:var(--dsw-alias-state-error-primary);margin:0;font-size:12px}.rp_VV-Eha_warning{color:var(--dsw-alias-state-warning-primary,var(--dsw-alias-state-error-primary));margin:0;font-size:12px}.rp_VV-Eha_ok{color:var(--dsw-alias-label-secondary);margin:0;font-size:12px}.rp_VV-Eha_editHeader{border-bottom:.5px solid var(--dsw-alias-border-l3);flex:none;align-items:center;gap:8px;padding:8px 16px;display:flex}.rp_VV-Eha_editTitle{color:var(--dsw-alias-label-primary);flex:auto;font-size:14px;font-weight:500}.rp_VV-Eha_editBody{flex-direction:column;flex:1 1 0;gap:24px;min-height:0;padding:16px 24px;display:flex;overflow-y:auto}.rp_VV-Eha_section{flex-direction:column;gap:12px;max-width:720px;display:flex}.rp_VV-Eha_sectionTitle{color:var(--dsw-alias-label-primary);margin:0;font-size:16px;font-weight:500;line-height:24px}.rp_VV-Eha_help{color:var(--dsw-alias-label-secondary);margin:0;font-size:13px}.rp_VV-Eha_row{flex-wrap:wrap;gap:12px;display:flex}.rp_VV-Eha_form{flex-direction:column;gap:16px;min-width:min(420px,100%);display:flex}.rp_VV-Eha_field{flex-direction:column;flex:200px;gap:6px;min-width:0;display:flex}.rp_VV-Eha_label{color:var(--dsw-alias-label-tertiary);font-size:12px}.rp_VV-Eha_area{box-sizing:border-box;border:.5px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);background:var(--dsw-alias-bg-layer-1);width:100%;min-height:280px;font:13px/20px var(--dsw-font-mono,monospace);color:var(--dsw-alias-label-primary);resize:vertical;padding:8px}.rp_VV-Eha_input{box-sizing:border-box;border:.5px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);background:var(--dsw-alias-bg-layer-1);width:100%;font:inherit;color:var(--dsw-alias-label-primary);padding:6px 8px;font-size:13px}@media (width<=640px){.rp_VV-Eha_grid{grid-template-columns:1fr}.rp_VV-Eha_form{min-width:0}.rp_VV-Eha_editBody{padding:16px}}.rp_VV-Eha_select{box-sizing:border-box;border:.5px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);background:var(--dsw-alias-bg-layer-1);max-width:100%;font:inherit;color:var(--dsw-alias-label-primary);padding:4px 6px;font-size:13px}.rp_VV-Eha_entryArea{box-sizing:border-box;border:.5px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);background:var(--dsw-alias-bg-layer-1);width:100%;min-height:200px;font:inherit;color:var(--dsw-alias-label-primary);resize:vertical;padding:8px;font-size:13px;line-height:20px}";
12274
12211
  const key$20 = "src/client/pages/lorebooks/LorebooksPage.module.css";
12275
12212
  let tag$20 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$20) + "]");
@@ -12281,40 +12218,39 @@ window.__ModuleLoader__.load({
12281
12218
  }
12282
12219
  tag$20.textContent = css$20;
12283
12220
  var LorebooksPage_module_css_default = {
12284
- "actions": "rp_VV-Eha_actions",
12285
- "title": "rp_VV-Eha_title",
12286
- "help": "rp_VV-Eha_help",
12287
- "field": "rp_VV-Eha_field",
12288
- "card": "rp_VV-Eha_card",
12289
- "error": "rp_VV-Eha_error",
12290
- "label": "rp_VV-Eha_label",
12291
- "meta": "rp_VV-Eha_meta",
12292
- "page": "rp_VV-Eha_page",
12293
12221
  "head": "rp_VV-Eha_head",
12222
+ "description": "rp_VV-Eha_description",
12223
+ "section": "rp_VV-Eha_section",
12224
+ "meta": "rp_VV-Eha_meta",
12225
+ "input": "rp_VV-Eha_input",
12226
+ "ok": "rp_VV-Eha_ok",
12227
+ "entryArea": "rp_VV-Eha_entryArea",
12294
12228
  "count": "rp_VV-Eha_count",
12295
- "viewport": "rp_VV-Eha_viewport",
12296
12229
  "editTitle": "rp_VV-Eha_editTitle",
12230
+ "help": "rp_VV-Eha_help",
12231
+ "select": "rp_VV-Eha_select",
12232
+ "error": "rp_VV-Eha_error",
12233
+ "actions": "rp_VV-Eha_actions",
12234
+ "editHeader": "rp_VV-Eha_editHeader",
12235
+ "message": "rp_VV-Eha_message",
12236
+ "page": "rp_VV-Eha_page",
12237
+ "title": "rp_VV-Eha_title",
12297
12238
  "warning": "rp_VV-Eha_warning",
12298
- "section": "rp_VV-Eha_section",
12299
12239
  "toolbar": "rp_VV-Eha_toolbar",
12300
- "editHeader": "rp_VV-Eha_editHeader",
12301
- "editBody": "rp_VV-Eha_editBody",
12302
- "area": "rp_VV-Eha_area",
12303
- "cardActions": "rp_VV-Eha_cardActions",
12304
- "input": "rp_VV-Eha_input",
12305
12240
  "grid": "rp_VV-Eha_grid",
12241
+ "cardActions": "rp_VV-Eha_cardActions",
12242
+ "area": "rp_VV-Eha_area",
12243
+ "label": "rp_VV-Eha_label",
12244
+ "card": "rp_VV-Eha_card",
12245
+ "editBody": "rp_VV-Eha_editBody",
12246
+ "viewport": "rp_VV-Eha_viewport",
12306
12247
  "sectionTitle": "rp_VV-Eha_sectionTitle",
12307
12248
  "name": "rp_VV-Eha_name",
12308
12249
  "row": "rp_VV-Eha_row",
12309
- "form": "rp_VV-Eha_form",
12310
- "ok": "rp_VV-Eha_ok",
12311
- "entryArea": "rp_VV-Eha_entryArea",
12312
- "message": "rp_VV-Eha_message",
12313
- "select": "rp_VV-Eha_select",
12314
- "description": "rp_VV-Eha_description"
12250
+ "field": "rp_VV-Eha_field",
12251
+ "form": "rp_VV-Eha_form"
12315
12252
  };
12316
- //#endregion
12317
- //#region src/client/pages/lorebooks/LorebookEditor.tsx
12253
+ // src/client/pages/lorebooks/LorebookEditor.tsx
12318
12254
  const messageOf$7 = (failure) => failure instanceof Error ? failure.message : String(failure);
12319
12255
  const KINDS = [
12320
12256
  "history",
@@ -12706,8 +12642,7 @@ window.__ModuleLoader__.load({
12706
12642
  })]
12707
12643
  });
12708
12644
  }
12709
- //#endregion
12710
- //#region src/client/pages/lorebooks/LorebooksPage.tsx
12645
+ // src/client/pages/lorebooks/LorebooksPage.tsx
12711
12646
  const NAME$1 = /^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$/;
12712
12647
  const messageOf$6 = (failure) => failure instanceof Error ? failure.message : String(failure);
12713
12648
  const nameFromFile$1 = (file) => trimCharacters(withoutExtension(file).replace(/[^A-Za-z0-9_-]+/g, "-"), "-_").slice(0, 64);
@@ -13230,8 +13165,7 @@ window.__ModuleLoader__.load({
13230
13165
  kind_other: "其他"
13231
13166
  }
13232
13167
  }, dictionaries$20);
13233
- //#endregion
13234
- //#region src/client/pages/lorebooks/lorebooks-controller.ts
13168
+ // src/client/pages/lorebooks/lorebooks-controller.ts
13235
13169
  const messageOf$5 = (error) => error instanceof Error ? error.message : String(error);
13236
13170
  /** Reads the lorebook library from the host and makes, removes and opens its lorebooks. */
13237
13171
  var LorebooksController = class {
@@ -13322,8 +13256,7 @@ window.__ModuleLoader__.load({
13322
13256
  }
13323
13257
  }
13324
13258
  };
13325
- //#endregion
13326
- //#region src/client/pages/lorebooks/index.ts
13259
+ // src/client/pages/lorebooks/index.ts
13327
13260
  const NAMESPACE$11 = "roleplay.lorebooks";
13328
13261
  /** Adds the Lorebooks page to the Role Play panel: reusable background knowledge that stories start with. */
13329
13262
  function registerLorebooksPage(ctx) {
@@ -13342,8 +13275,7 @@ window.__ModuleLoader__.load({
13342
13275
  inject: () => lorebooks.inject()
13343
13276
  }, LorebooksPage));
13344
13277
  }
13345
- //#endregion
13346
- //#region \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/pages/presets/PresetsPage.module.css.mjs
13278
+ // \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/pages/presets/PresetsPage.module.css.mjs
13347
13279
  const css$19 = ".rp_ZK89ba_page{flex-direction:column;flex:1 1 0;gap:8px;min-height:0;display:flex}.rp_ZK89ba_toolbar{flex:none;justify-content:space-between;align-items:center;gap:12px;min-height:28px;display:flex}.rp_ZK89ba_count{color:var(--dsw-alias-label-tertiary);font-size:12px}.rp_ZK89ba_actions{flex-wrap:wrap;align-items:center;gap:8px;display:flex}.rp_ZK89ba_viewport{flex:1 1 0;min-height:0;padding:4px;overflow-y:auto}.rp_ZK89ba_grid{grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:12px;margin:0;padding:0;list-style:none;display:grid}.rp_ZK89ba_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;gap:8px;min-width:0;padding:12px;display:flex}.rp_ZK89ba_card:hover{border-color:var(--dsw-alias-border-l4)}.rp_ZK89ba_head{flex-direction:column;gap:2px;min-width:0;display:flex}.rp_ZK89ba_title{text-overflow:ellipsis;white-space:nowrap;color:var(--dsw-alias-label-primary);font-size:13px;font-weight:500;overflow:hidden}.rp_ZK89ba_name{color:var(--dsw-alias-label-tertiary);font-size:12px}.rp_ZK89ba_description{color:var(--dsw-alias-label-secondary);-webkit-line-clamp:3;-webkit-box-orient:vertical;margin:0;font-size:12px;line-height:18px;display:-webkit-box;overflow:hidden}.rp_ZK89ba_meta{color:var(--dsw-alias-label-tertiary);font-size:12px}.rp_ZK89ba_cardActions{flex-wrap:wrap;gap:4px;margin-top:auto;display:flex}.rp_ZK89ba_message{text-align:center;color:var(--dsw-alias-label-secondary);margin:0;padding:40px 0;font-size:13px}.rp_ZK89ba_error{color:var(--dsw-alias-state-error-primary);margin:0;font-size:12px}.rp_ZK89ba_warning{color:var(--dsw-alias-state-warning-primary,var(--dsw-alias-state-error-primary));margin:0;font-size:12px}.rp_ZK89ba_ok{color:var(--dsw-alias-label-secondary);margin:0;font-size:12px}.rp_ZK89ba_editHeader{border-bottom:.5px solid var(--dsw-alias-border-l3);flex:none;align-items:center;gap:8px;padding:8px 16px;display:flex}.rp_ZK89ba_editTitle{color:var(--dsw-alias-label-primary);flex:auto;font-size:14px;font-weight:500}.rp_ZK89ba_editBody{flex-direction:column;flex:1 1 0;gap:24px;min-height:0;padding:16px 24px;display:flex;overflow-y:auto}.rp_ZK89ba_section{flex-direction:column;gap:12px;max-width:720px;display:flex}.rp_ZK89ba_sectionTitle{color:var(--dsw-alias-label-primary);margin:0;font-size:16px;font-weight:500;line-height:24px}.rp_ZK89ba_help{color:var(--dsw-alias-label-secondary);margin:0;font-size:13px}.rp_ZK89ba_row{flex-wrap:wrap;gap:12px;display:flex}.rp_ZK89ba_form{flex-direction:column;gap:16px;min-width:min(420px,100%);display:flex}.rp_ZK89ba_field{flex-direction:column;flex:200px;gap:6px;min-width:0;display:flex}.rp_ZK89ba_label{color:var(--dsw-alias-label-tertiary);font-size:12px}.rp_ZK89ba_area{box-sizing:border-box;border:.5px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);background:var(--dsw-alias-bg-layer-1);width:100%;min-height:280px;font:13px/20px var(--dsw-font-mono,monospace);color:var(--dsw-alias-label-primary);resize:vertical;padding:8px}.rp_ZK89ba_input{box-sizing:border-box;border:.5px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);background:var(--dsw-alias-bg-layer-1);width:100%;font:inherit;color:var(--dsw-alias-label-primary);padding:6px 8px;font-size:13px}@media (width<=640px){.rp_ZK89ba_grid{grid-template-columns:1fr}.rp_ZK89ba_form{min-width:0}.rp_ZK89ba_editBody{padding:16px}}";
13348
13280
  const key$19 = "src/client/pages/presets/PresetsPage.module.css";
13349
13281
  let tag$19 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$19) + "]");
@@ -13355,38 +13287,37 @@ window.__ModuleLoader__.load({
13355
13287
  }
13356
13288
  tag$19.textContent = css$19;
13357
13289
  var PresetsPage_module_css_default = {
13358
- "grid": "rp_ZK89ba_grid",
13359
- "actions": "rp_ZK89ba_actions",
13360
- "name": "rp_ZK89ba_name",
13290
+ "card": "rp_ZK89ba_card",
13291
+ "meta": "rp_ZK89ba_meta",
13292
+ "cardActions": "rp_ZK89ba_cardActions",
13293
+ "editTitle": "rp_ZK89ba_editTitle",
13294
+ "ok": "rp_ZK89ba_ok",
13295
+ "section": "rp_ZK89ba_section",
13296
+ "field": "rp_ZK89ba_field",
13361
13297
  "head": "rp_ZK89ba_head",
13362
- "editHeader": "rp_ZK89ba_editHeader",
13298
+ "help": "rp_ZK89ba_help",
13299
+ "actions": "rp_ZK89ba_actions",
13363
13300
  "label": "rp_ZK89ba_label",
13364
- "cardActions": "rp_ZK89ba_cardActions",
13365
- "card": "rp_ZK89ba_card",
13301
+ "editBody": "rp_ZK89ba_editBody",
13366
13302
  "title": "rp_ZK89ba_title",
13303
+ "sectionTitle": "rp_ZK89ba_sectionTitle",
13304
+ "message": "rp_ZK89ba_message",
13367
13305
  "form": "rp_ZK89ba_form",
13368
- "section": "rp_ZK89ba_section",
13369
- "field": "rp_ZK89ba_field",
13370
- "warning": "rp_ZK89ba_warning",
13306
+ "description": "rp_ZK89ba_description",
13371
13307
  "count": "rp_ZK89ba_count",
13308
+ "editHeader": "rp_ZK89ba_editHeader",
13372
13309
  "row": "rp_ZK89ba_row",
13373
13310
  "toolbar": "rp_ZK89ba_toolbar",
13311
+ "input": "rp_ZK89ba_input",
13374
13312
  "page": "rp_ZK89ba_page",
13313
+ "grid": "rp_ZK89ba_grid",
13375
13314
  "area": "rp_ZK89ba_area",
13376
- "message": "rp_ZK89ba_message",
13377
- "viewport": "rp_ZK89ba_viewport",
13378
13315
  "error": "rp_ZK89ba_error",
13379
- "help": "rp_ZK89ba_help",
13380
- "meta": "rp_ZK89ba_meta",
13381
- "editTitle": "rp_ZK89ba_editTitle",
13382
- "ok": "rp_ZK89ba_ok",
13383
- "editBody": "rp_ZK89ba_editBody",
13384
- "input": "rp_ZK89ba_input",
13385
- "description": "rp_ZK89ba_description",
13386
- "sectionTitle": "rp_ZK89ba_sectionTitle"
13316
+ "warning": "rp_ZK89ba_warning",
13317
+ "viewport": "rp_ZK89ba_viewport",
13318
+ "name": "rp_ZK89ba_name"
13387
13319
  };
13388
- //#endregion
13389
- //#region src/client/pages/presets/PresetEditor.tsx
13320
+ // src/client/pages/presets/PresetEditor.tsx
13390
13321
  const messageOf$4 = (failure) => failure instanceof Error ? failure.message : String(failure);
13391
13322
  const PROMPT_IDS = [
13392
13323
  "roleplay/persona",
@@ -13802,8 +13733,7 @@ window.__ModuleLoader__.load({
13802
13733
  })]
13803
13734
  });
13804
13735
  }
13805
- //#endregion
13806
- //#region src/client/pages/presets/PresetsPage.tsx
13736
+ // src/client/pages/presets/PresetsPage.tsx
13807
13737
  const NAME = /^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$/;
13808
13738
  const messageOf$3 = (failure) => failure instanceof Error ? failure.message : String(failure);
13809
13739
  const nameFromFile = (file) => trimCharacters(withoutExtension(file).replace(/[^A-Za-z0-9_-]+/g, "-"), "-_").slice(0, 64);
@@ -14307,8 +14237,7 @@ window.__ModuleLoader__.load({
14307
14237
  "prompt_roleplay/character-style": "角色风格"
14308
14238
  }
14309
14239
  }, dictionaries$18), dictionaries$20);
14310
- //#endregion
14311
- //#region src/client/pages/presets/presets-controller.ts
14240
+ // src/client/pages/presets/presets-controller.ts
14312
14241
  const messageOf$2 = (error) => error instanceof Error ? error.message : String(error);
14313
14242
  /** Reads the preset library from the host and makes, removes and opens its presets. */
14314
14243
  var PresetsController = class {
@@ -14395,8 +14324,7 @@ window.__ModuleLoader__.load({
14395
14324
  }
14396
14325
  }
14397
14326
  };
14398
- //#endregion
14399
- //#region src/client/pages/presets/index.ts
14327
+ // src/client/pages/presets/index.ts
14400
14328
  const NAMESPACE$10 = "roleplay.presets";
14401
14329
  /** Adds the Presets page to the Role Play panel: reusable writing instructions for stories. */
14402
14330
  function registerPresetsPage(ctx) {
@@ -14433,8 +14361,7 @@ window.__ModuleLoader__.load({
14433
14361
  const lastPage = pageCount(total, pageSize) - 1;
14434
14362
  return Math.min(Math.floor(Math.max(0, index) / pageSize), lastPage) * pageSize;
14435
14363
  }
14436
- //#endregion
14437
- //#region \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/widgets/pager/Pager.module.css.mjs
14364
+ // \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/widgets/pager/Pager.module.css.mjs
14438
14365
  const css$18 = ".rp_KBAD0W_pager{flex:none;justify-content:center;align-items:center;gap:8px;display:flex}.rp_KBAD0W_position{text-align:center;min-width:120px;color:var(--dsw-alias-label-tertiary);font-size:12px}";
14439
14366
  const key$18 = "src/client/widgets/pager/Pager.module.css";
14440
14367
  let tag$18 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$18) + "]");
@@ -14446,11 +14373,10 @@ window.__ModuleLoader__.load({
14446
14373
  }
14447
14374
  tag$18.textContent = css$18;
14448
14375
  var Pager_module_css_default = {
14449
- "pager": "rp_KBAD0W_pager",
14450
- "position": "rp_KBAD0W_position"
14376
+ "position": "rp_KBAD0W_position",
14377
+ "pager": "rp_KBAD0W_pager"
14451
14378
  };
14452
- //#endregion
14453
- //#region src/client/widgets/pager/Pager.tsx
14379
+ // src/client/widgets/pager/Pager.tsx
14454
14380
  /** Previous and next buttons around the current position; the owner supplies every label. */
14455
14381
  function Pager({ label, previousLabel, nextLabel, positionLabel, hasPrevious, hasNext, onPrevious, onNext }) {
14456
14382
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("nav", {
@@ -14480,8 +14406,7 @@ window.__ModuleLoader__.load({
14480
14406
  ]
14481
14407
  });
14482
14408
  }
14483
- //#endregion
14484
- //#region \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/widgets/problem-list/ProblemList.module.css.mjs
14409
+ // \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/widgets/problem-list/ProblemList.module.css.mjs
14485
14410
  const css$17 = ".rp_LZh3Iq_problems{color:var(--dsw-alias-state-warn-primary);flex:none;font-size:12px}.rp_LZh3Iq_problems summary{cursor:pointer}.rp_LZh3Iq_problems ul{color:var(--dsw-alias-label-secondary);margin:8px 0 0;padding-left:20px}.rp_LZh3Iq_problems code{font-family:var(--dsw-font-mono);color:var(--dsw-alias-label-primary)}";
14486
14411
  const key$17 = "src/client/widgets/problem-list/ProblemList.module.css";
14487
14412
  let tag$17 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$17) + "]");
@@ -14493,8 +14418,7 @@ window.__ModuleLoader__.load({
14493
14418
  }
14494
14419
  tag$17.textContent = css$17;
14495
14420
  var ProblemList_module_css_default = { "problems": "rp_LZh3Iq_problems" };
14496
- //#endregion
14497
- //#region src/client/widgets/problem-list/ProblemList.tsx
14421
+ // src/client/widgets/problem-list/ProblemList.tsx
14498
14422
  /** A collapsed list of what went wrong while reading files; renders nothing when nothing did. */
14499
14423
  function ProblemList({ summary, problems }) {
14500
14424
  if (problems.length === 0) return null;
@@ -14507,8 +14431,7 @@ window.__ModuleLoader__.load({
14507
14431
  ] }, `${problem.path}:${problem.message}`)) })]
14508
14432
  });
14509
14433
  }
14510
- //#endregion
14511
- //#region \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/pages/sessions/DeleteSessionDialog.module.css.mjs
14434
+ // \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/pages/sessions/DeleteSessionDialog.module.css.mjs
14512
14435
  const css$16 = ".rp_FifHrW_body{flex-direction:column;gap:8px;min-width:min(380px,100%);display:flex}.rp_FifHrW_body p{margin:0}.rp_FifHrW_question{color:var(--dsw-alias-label-primary);overflow-wrap:anywhere;font-size:13px;line-height:20px}.rp_FifHrW_warning{color:var(--dsw-alias-label-secondary);font-size:12px;line-height:18px}.rp_FifHrW_choice{color:var(--dsw-alias-label-primary);border:0;flex-direction:column;gap:4px;margin:4px 0 0;padding:0;font-size:13px;line-height:20px;display:flex}.rp_FifHrW_choice legend{color:var(--dsw-alias-label-tertiary);margin-bottom:4px;padding:0;font-size:12px}.rp_FifHrW_error{color:var(--dsw-alias-state-error-primary);font-size:12px}";
14513
14436
  const key$16 = "src/client/pages/sessions/DeleteSessionDialog.module.css";
14514
14437
  let tag$16 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$16) + "]");
@@ -14520,14 +14443,13 @@ window.__ModuleLoader__.load({
14520
14443
  }
14521
14444
  tag$16.textContent = css$16;
14522
14445
  var DeleteSessionDialog_module_css_default = {
14523
- "question": "rp_FifHrW_question",
14524
- "body": "rp_FifHrW_body",
14525
14446
  "choice": "rp_FifHrW_choice",
14447
+ "warning": "rp_FifHrW_warning",
14526
14448
  "error": "rp_FifHrW_error",
14527
- "warning": "rp_FifHrW_warning"
14449
+ "body": "rp_FifHrW_body",
14450
+ "question": "rp_FifHrW_question"
14528
14451
  };
14529
- //#endregion
14530
- //#region src/client/pages/sessions/DeleteSessionDialog.tsx
14452
+ // src/client/pages/sessions/DeleteSessionDialog.tsx
14531
14453
  /** Asks for confirmation before a session and everything saved with it is removed. */
14532
14454
  function DeleteSessionDialog({ t, removal, onConfirm, onCancel, onEverywhere }) {
14533
14455
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Modal, {
@@ -14598,8 +14520,7 @@ window.__ModuleLoader__.load({
14598
14520
  })
14599
14521
  });
14600
14522
  }
14601
- //#endregion
14602
- //#region src/client/paging/use-fit.ts
14523
+ // src/client/paging/use-fit.ts
14603
14524
  /**
14604
14525
  * How many items fit in the element, measured whenever it resizes; 0 until
14605
14526
  * measured. `compute` receives the content box and the element's styles, where
@@ -14629,14 +14550,12 @@ window.__ModuleLoader__.load({
14629
14550
  const value = Number.parseFloat(style.getPropertyValue(name));
14630
14551
  return Number.isFinite(value) ? value : void 0;
14631
14552
  }
14632
- //#endregion
14633
- //#region src/client/pages/sessions/row-layout.ts
14553
+ // src/client/pages/sessions/row-layout.ts
14634
14554
  /** How many whole rows fit under the header without scrolling. */
14635
14555
  function rowsThatFit(box, { rowHeight, headerHeight }) {
14636
14556
  return Math.max(0, Math.floor((box.height - headerHeight) / rowHeight));
14637
14557
  }
14638
- //#endregion
14639
- //#region src/client/pages/sessions/use-row-fit.ts
14558
+ // src/client/pages/sessions/use-row-fit.ts
14640
14559
  function rowFit(box, style) {
14641
14560
  const rowHeight = pixels(style, "--rp-row-height");
14642
14561
  const headerHeight = pixels(style, "--rp-header-height");
@@ -14649,8 +14568,7 @@ window.__ModuleLoader__.load({
14649
14568
  function useRowFit(viewport) {
14650
14569
  return useFit(viewport, rowFit);
14651
14570
  }
14652
- //#endregion
14653
- //#region \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/pages/sessions/SessionsPage.module.css.mjs
14571
+ // \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/pages/sessions/SessionsPage.module.css.mjs
14654
14572
  const css$15 = ".rp_24z4eW_page{flex-direction:column;flex:1 1 0;gap:8px;min-height:0;display:flex}.rp_24z4eW_toolbar{flex:none;justify-content:space-between;align-items:center;gap:12px;min-height:28px;display:flex}.rp_24z4eW_count{color:var(--dsw-alias-label-tertiary);font-size:12px}.rp_24z4eW_spinning{animation:.9s linear infinite rp_24z4eW_spin}@keyframes rp_24z4eW_spin{to{transform:rotate(360deg)}}@media (prefers-reduced-motion:reduce){.rp_24z4eW_spinning{animation:none}}.rp_24z4eW_notice{color:var(--dsw-alias-state-error-primary);margin:0;font-size:12px}.rp_24z4eW_viewport{--rp-row-height:40px;--rp-header-height:32px;flex:1 1 0;min-height:0;overflow-x:auto}.rp_24z4eW_scrolls{overflow-y:auto}.rp_24z4eW_fits{overflow-y:hidden}.rp_24z4eW_table{border-collapse:collapse;table-layout:fixed;width:100%;min-width:720px}.rp_24z4eW_actionsColumn{width:104px}.rp_24z4eW_nameColumn{width:30%}.rp_24z4eW_worldColumn{width:26%}.rp_24z4eW_timeColumn{width:16%}.rp_24z4eW_turnsColumn{width:10%}.rp_24z4eW_table th{height:var(--rp-header-height);border-bottom:.5px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-1);text-align:left;color:var(--dsw-alias-label-tertiary);padding:0 12px;font-size:12px;font-weight:400;position:sticky;top:0}.rp_24z4eW_table td{height:var(--rp-row-height);border-bottom:.5px solid var(--dsw-alias-border-l1);text-overflow:ellipsis;white-space:nowrap;padding:0 12px;font-size:13px;overflow:hidden}.rp_24z4eW_name{color:var(--dsw-alias-label-primary);font-weight:500}.rp_24z4eW_secondary{color:var(--dsw-alias-label-secondary);font-size:12px}.rp_24z4eW_table .rp_24z4eW_number{text-align:right}.rp_24z4eW_table .rp_24z4eW_actions{text-align:center;white-space:nowrap;padding:0 8px}.rp_24z4eW_message{text-align:center;color:var(--dsw-alias-label-secondary);margin:0;padding:40px 0;font-size:13px}.rp_24z4eW_archived td{opacity:.6}.rp_24z4eW_badge{border:.5px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);color:var(--dsw-alias-label-tertiary);margin-left:6px;padding:0 6px;font-size:12px}@media (width<=640px){.rp_24z4eW_viewport{--rp-row-height:196px;--rp-header-height:0px;overflow-x:hidden}.rp_24z4eW_table,.rp_24z4eW_table tbody,.rp_24z4eW_table tr,.rp_24z4eW_table td{width:100%;display:block}.rp_24z4eW_table{min-width:0}.rp_24z4eW_table colgroup,.rp_24z4eW_table thead{display:none}.rp_24z4eW_table tr{box-sizing:border-box;min-height:var(--rp-row-height);border-bottom:.5px solid var(--dsw-alias-border-l2);padding:10px 12px}.rp_24z4eW_table td{box-sizing:border-box;text-align:start;text-overflow:clip;white-space:normal;overflow-wrap:anywhere;border:0;grid-template-columns:minmax(88px,34%) minmax(0,1fr);align-items:baseline;height:auto;min-height:24px;padding:2px 0;display:grid;overflow:visible}.rp_24z4eW_table td:before{content:attr(data-label);color:var(--dsw-alias-label-tertiary);padding-inline-end:10px;font-size:12px;font-weight:400}.rp_24z4eW_table .rp_24z4eW_number{text-align:start}.rp_24z4eW_table .rp_24z4eW_actions{justify-content:flex-end;min-height:36px;padding-top:4px;display:flex}.rp_24z4eW_table .rp_24z4eW_actions:before{margin-inline-end:auto}}";
14655
14573
  const key$15 = "src/client/pages/sessions/SessionsPage.module.css";
14656
14574
  let tag$15 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$15) + "]");
@@ -14662,31 +14580,30 @@ window.__ModuleLoader__.load({
14662
14580
  }
14663
14581
  tag$15.textContent = css$15;
14664
14582
  var SessionsPage_module_css_default = {
14583
+ "fits": "rp_24z4eW_fits",
14665
14584
  "spinning": "rp_24z4eW_spinning",
14666
- "toolbar": "rp_24z4eW_toolbar",
14667
- "spin": "rp_24z4eW_spin",
14668
- "count": "rp_24z4eW_count",
14585
+ "notice": "rp_24z4eW_notice",
14586
+ "number": "rp_24z4eW_number",
14587
+ "page": "rp_24z4eW_page",
14588
+ "timeColumn": "rp_24z4eW_timeColumn",
14669
14589
  "worldColumn": "rp_24z4eW_worldColumn",
14590
+ "count": "rp_24z4eW_count",
14670
14591
  "viewport": "rp_24z4eW_viewport",
14671
- "page": "rp_24z4eW_page",
14672
- "secondary": "rp_24z4eW_secondary",
14673
- "number": "rp_24z4eW_number",
14674
- "actions": "rp_24z4eW_actions",
14675
- "badge": "rp_24z4eW_badge",
14676
- "actionsColumn": "rp_24z4eW_actionsColumn",
14677
14592
  "turnsColumn": "rp_24z4eW_turnsColumn",
14678
- "scrolls": "rp_24z4eW_scrolls",
14593
+ "badge": "rp_24z4eW_badge",
14679
14594
  "table": "rp_24z4eW_table",
14680
- "message": "rp_24z4eW_message",
14595
+ "actionsColumn": "rp_24z4eW_actionsColumn",
14681
14596
  "name": "rp_24z4eW_name",
14597
+ "message": "rp_24z4eW_message",
14598
+ "spin": "rp_24z4eW_spin",
14599
+ "scrolls": "rp_24z4eW_scrolls",
14682
14600
  "nameColumn": "rp_24z4eW_nameColumn",
14683
- "fits": "rp_24z4eW_fits",
14684
- "timeColumn": "rp_24z4eW_timeColumn",
14685
- "archived": "rp_24z4eW_archived",
14686
- "notice": "rp_24z4eW_notice"
14601
+ "secondary": "rp_24z4eW_secondary",
14602
+ "actions": "rp_24z4eW_actions",
14603
+ "toolbar": "rp_24z4eW_toolbar",
14604
+ "archived": "rp_24z4eW_archived"
14687
14605
  };
14688
- //#endregion
14689
- //#region src/client/pages/sessions/SessionsPage.tsx
14606
+ // src/client/pages/sessions/SessionsPage.tsx
14690
14607
  /** The sessions as a table, one page at a time, the most recently played first. */
14691
14608
  function SessionsPage({ t, useRoleplaySessions, load, refresh, open, archive, restore, askRemoval, cancelRemoval, confirmRemoval, setEverywhere }) {
14692
14609
  const state = useRoleplaySessions((snapshot) => snapshot);
@@ -14905,8 +14822,7 @@ window.__ModuleLoader__.load({
14905
14822
  ]
14906
14823
  });
14907
14824
  }
14908
- //#endregion
14909
- //#region src/client/pages/sessions/locales.ts
14825
+ // src/client/pages/sessions/locales.ts
14910
14826
  const dictionaries$8 = {
14911
14827
  en: {
14912
14828
  nav: "Sessions",
@@ -14989,8 +14905,7 @@ window.__ModuleLoader__.load({
14989
14905
  dateLocale: "zh-CN"
14990
14906
  }
14991
14907
  };
14992
- //#endregion
14993
- //#region src/shared/sync.ts
14908
+ // src/shared/sync.ts
14994
14909
  const DEFAULT_SYNC = {
14995
14910
  remote: "",
14996
14911
  rclone: "",
@@ -15000,8 +14915,7 @@ window.__ModuleLoader__.load({
15000
14915
  };
15001
14916
  const SYNC_PASSWORD_REF = "ROLEPLAY_SYNC_RCLONE_CONFIG_PASS";
15002
14917
  const SYNC_CHANGED = "roleplay-sync-changed";
15003
- //#endregion
15004
- //#region src/client/sync-api.ts
14918
+ // src/client/sync-api.ts
15005
14919
  async function reply$1(response) {
15006
14920
  if (!response.ok) {
15007
14921
  const body = await response.json().catch(() => void 0);
@@ -15069,8 +14983,7 @@ window.__ModuleLoader__.load({
15069
14983
  globalThis.dispatchEvent(new Event(SYNC_CHANGED));
15070
14984
  return status;
15071
14985
  }
15072
- //#endregion
15073
- //#region src/client/pages/sessions/sessions-controller.ts
14986
+ // src/client/pages/sessions/sessions-controller.ts
15074
14987
  /** Reads the sessions list from the host. */
15075
14988
  var SessionsController = class {
15076
14989
  store = (0, _deepseek_ai_dsh_client_store.createSnapshotStore)({
@@ -15269,8 +15182,7 @@ window.__ModuleLoader__.load({
15269
15182
  }
15270
15183
  }
15271
15184
  };
15272
- //#endregion
15273
- //#region src/client/pages/sessions/index.ts
15185
+ // src/client/pages/sessions/index.ts
15274
15186
  const NAMESPACE$9 = "roleplay.sessions";
15275
15187
  /** Adds the Sessions page to the Role Play panel. */
15276
15188
  function registerSessionsPage(ctx) {
@@ -15289,9 +15201,8 @@ window.__ModuleLoader__.load({
15289
15201
  inject: () => sessions.inject()
15290
15202
  }, SessionsPage));
15291
15203
  }
15292
- //#endregion
15293
- //#region \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/pages/sync/SyncPage.module.css.mjs
15294
- const css$14 = ".rp_Gk-byG_page{flex-direction:column;flex:1 1 0;gap:8px;min-height:0;display:flex}.rp_Gk-byG_toolbar{flex:none;justify-content:space-between;align-items:center;gap:12px;min-height:28px;display:flex}.rp_Gk-byG_meta{color:var(--dsw-alias-label-tertiary);font-size:12px}.rp_Gk-byG_actions{flex-wrap:wrap;align-items:center;gap:8px;display:flex}.rp_Gk-byG_viewport{flex:1 1 0;min-height:0;overflow:auto}.rp_Gk-byG_table{border-collapse:collapse;width:100%;font-size:13px}.rp_Gk-byG_table th{text-align:left;color:var(--dsw-alias-label-tertiary);background:var(--dsw-alias-bg-layer-1);border-bottom:.5px solid var(--dsw-alias-border-l3);padding:6px 8px;font-size:12px;font-weight:400;position:sticky;top:0}.rp_Gk-byG_table td{vertical-align:top;border-bottom:.5px solid var(--dsw-alias-border-l4);color:var(--dsw-alias-label-primary);padding:6px 8px}.rp_Gk-byG_unit{font-family:var(--dsw-font-mono,monospace);word-break:break-all;font-size:12px}.rp_Gk-byG_conflict{color:var(--dsw-alias-state-warn-primary,var(--dsw-alias-state-error-primary))}.rp_Gk-byG_failed{color:var(--dsw-alias-state-error-primary)}.rp_Gk-byG_detail{color:var(--dsw-alias-label-secondary);flex-direction:column;gap:6px;margin:0;font-size:12px;display:flex}.rp_Gk-byG_choices{flex-wrap:wrap;gap:4px;display:flex}.rp_Gk-byG_message{text-align:center;color:var(--dsw-alias-label-secondary);margin:0;padding:40px 0;font-size:13px}.rp_Gk-byG_error{color:var(--dsw-alias-state-error-primary);margin:0;font-size:12px}.rp_Gk-byG_problem{color:var(--dsw-alias-state-warn-primary,var(--dsw-alias-state-error-primary));margin:0;font-size:12px}.rp_Gk-byG_confirmation{max-width:60ch;color:var(--dsw-alias-label-primary);overflow-wrap:anywhere;margin:0}";
15204
+ // \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/pages/sync/SyncPage.module.css.mjs
15205
+ const css$14 = ".rp_Gk-byG_page{flex-direction:column;flex:1 1 0;gap:8px;min-height:0;display:flex}.rp_Gk-byG_toolbar{flex:none;justify-content:space-between;align-items:center;gap:12px;min-height:28px;display:flex}.rp_Gk-byG_meta{color:var(--dsw-alias-label-tertiary);font-size:12px}.rp_Gk-byG_actions{flex-wrap:wrap;align-items:center;gap:8px;display:flex}.rp_Gk-byG_viewport{flex:1 1 0;min-height:0;overflow:auto}.rp_Gk-byG_table{table-layout:fixed;border-collapse:collapse;width:100%;min-width:720px;font-size:13px}.rp_Gk-byG_unitColumn{width:18%}.rp_Gk-byG_kindColumn{width:13%}.rp_Gk-byG_stateColumn{width:14%}.rp_Gk-byG_syncedColumn{width:16%}.rp_Gk-byG_detailsColumn{width:29%}.rp_Gk-byG_actionsColumn{width:10%}.rp_Gk-byG_caption{clip:rect(0, 0, 0, 0);white-space:nowrap;border:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.rp_Gk-byG_table th{text-align:left;color:var(--dsw-alias-label-tertiary);background:var(--dsw-alias-bg-layer-1);border-bottom:.5px solid var(--dsw-alias-border-l3);padding:6px 8px;font-size:12px;font-weight:400;position:sticky;top:0}.rp_Gk-byG_table .rp_Gk-byG_actionHeading{text-align:right}.rp_Gk-byG_table td{vertical-align:top;border-bottom:.5px solid var(--dsw-alias-border-l4);color:var(--dsw-alias-label-primary);padding:6px 8px}.rp_Gk-byG_table td:last-child{text-align:right}.rp_Gk-byG_unit{font-family:var(--dsw-font-mono,monospace);word-break:break-all;font-size:12px}.rp_Gk-byG_conflict{color:var(--dsw-alias-state-warn-primary,var(--dsw-alias-state-error-primary))}.rp_Gk-byG_failed{color:var(--dsw-alias-state-error-primary);overflow-wrap:anywhere;display:block}.rp_Gk-byG_detail{color:var(--dsw-alias-label-secondary);flex-direction:column;gap:6px;margin:0;font-size:12px;display:flex}.rp_Gk-byG_detail>span:first-child{overflow-wrap:anywhere}.rp_Gk-byG_choices{flex-wrap:wrap;gap:4px;display:flex}.rp_Gk-byG_message{text-align:center;color:var(--dsw-alias-label-secondary);margin:0;padding:40px 0;font-size:13px}.rp_Gk-byG_error{color:var(--dsw-alias-state-error-primary);margin:0;font-size:12px}.rp_Gk-byG_problem{color:var(--dsw-alias-state-warn-primary,var(--dsw-alias-state-error-primary));margin:0;font-size:12px}.rp_Gk-byG_confirmation{max-width:60ch;color:var(--dsw-alias-label-primary);overflow-wrap:anywhere;margin:0}";
15295
15206
  const key$14 = "src/client/pages/sync/SyncPage.module.css";
15296
15207
  let tag$14 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$14) + "]");
15297
15208
  if (tag$14 === null) {
@@ -15302,24 +15213,31 @@ window.__ModuleLoader__.load({
15302
15213
  }
15303
15214
  tag$14.textContent = css$14;
15304
15215
  var SyncPage_module_css_default = {
15305
- "meta": "rp_Gk-byG_meta",
15306
- "choices": "rp_Gk-byG_choices",
15307
- "unit": "rp_Gk-byG_unit",
15308
- "detail": "rp_Gk-byG_detail",
15309
15216
  "problem": "rp_Gk-byG_problem",
15310
- "error": "rp_Gk-byG_error",
15217
+ "conflict": "rp_Gk-byG_conflict",
15218
+ "unitColumn": "rp_Gk-byG_unitColumn",
15219
+ "kindColumn": "rp_Gk-byG_kindColumn",
15311
15220
  "table": "rp_Gk-byG_table",
15221
+ "stateColumn": "rp_Gk-byG_stateColumn",
15222
+ "actionsColumn": "rp_Gk-byG_actionsColumn",
15223
+ "detail": "rp_Gk-byG_detail",
15224
+ "viewport": "rp_Gk-byG_viewport",
15225
+ "syncedColumn": "rp_Gk-byG_syncedColumn",
15226
+ "choices": "rp_Gk-byG_choices",
15312
15227
  "message": "rp_Gk-byG_message",
15228
+ "detailsColumn": "rp_Gk-byG_detailsColumn",
15229
+ "toolbar": "rp_Gk-byG_toolbar",
15230
+ "actions": "rp_Gk-byG_actions",
15231
+ "caption": "rp_Gk-byG_caption",
15232
+ "meta": "rp_Gk-byG_meta",
15233
+ "actionHeading": "rp_Gk-byG_actionHeading",
15234
+ "unit": "rp_Gk-byG_unit",
15313
15235
  "failed": "rp_Gk-byG_failed",
15314
- "conflict": "rp_Gk-byG_conflict",
15315
15236
  "confirmation": "rp_Gk-byG_confirmation",
15316
- "page": "rp_Gk-byG_page",
15317
- "viewport": "rp_Gk-byG_viewport",
15318
- "actions": "rp_Gk-byG_actions",
15319
- "toolbar": "rp_Gk-byG_toolbar"
15237
+ "error": "rp_Gk-byG_error",
15238
+ "page": "rp_Gk-byG_page"
15320
15239
  };
15321
- //#endregion
15322
- //#region src/client/pages/sync/SyncPage.tsx
15240
+ // src/client/pages/sync/SyncPage.tsx
15323
15241
  const when = (iso, never, locale) => iso === void 0 ? never : new Date(iso).toLocaleString(locale);
15324
15242
  function Details({ t, unit, working, face, confirmDeletion }) {
15325
15243
  if (unit.state === "ignored") return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", {
@@ -15502,42 +15420,76 @@ window.__ModuleLoader__.load({
15502
15420
  }),
15503
15421
  status !== void 0 && status.units.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("table", {
15504
15422
  className: SyncPage_module_css_default.table,
15505
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("thead", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("tr", { children: [
15506
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("th", { children: t("unit") }),
15507
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("th", { children: t("kind") }),
15508
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("th", { children: t("state") }),
15509
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("th", { children: t("synced") }),
15510
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("th", { children: t("details") }),
15511
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("th", {})
15512
- ] }) }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("tbody", { children: status.units.map((unit) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("tr", { children: [
15513
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", {
15514
- className: SyncPage_module_css_default.unit,
15515
- children: unit.id
15423
+ children: [
15424
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("caption", {
15425
+ className: SyncPage_module_css_default.caption,
15426
+ children: t("tableCaption")
15516
15427
  }),
15517
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", { children: t(`kind_${unit.kind}`) }),
15518
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", { children: t(`state_${unit.state}`) }),
15519
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", { children: when(unit.at, t("never"), t("dateLocale")) }),
15520
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Details, {
15521
- t,
15522
- unit,
15523
- working: busy,
15524
- face: {
15525
- resolve,
15526
- forget,
15527
- restore
15528
- },
15529
- confirmDeletion: setDeletion
15530
- }) }),
15531
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
15532
- size: "sm",
15533
- variant: "ghost",
15534
- disabled: busy || status.problem !== void 0 || unit.state === "conflict" || unit.state === "ignored",
15535
- onClick: () => {
15536
- run(unit.id);
15537
- },
15538
- children: t("runOne")
15539
- }) })
15540
- ] }, unit.id)) })]
15428
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("colgroup", { children: [
15429
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("col", { className: SyncPage_module_css_default.unitColumn }),
15430
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("col", { className: SyncPage_module_css_default.kindColumn }),
15431
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("col", { className: SyncPage_module_css_default.stateColumn }),
15432
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("col", { className: SyncPage_module_css_default.syncedColumn }),
15433
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("col", { className: SyncPage_module_css_default.detailsColumn }),
15434
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("col", { className: SyncPage_module_css_default.actionsColumn })
15435
+ ] }),
15436
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("thead", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("tr", { children: [
15437
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("th", {
15438
+ scope: "col",
15439
+ children: t("unit")
15440
+ }),
15441
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("th", {
15442
+ scope: "col",
15443
+ children: t("kind")
15444
+ }),
15445
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("th", {
15446
+ scope: "col",
15447
+ children: t("state")
15448
+ }),
15449
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("th", {
15450
+ scope: "col",
15451
+ children: t("synced")
15452
+ }),
15453
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("th", {
15454
+ scope: "col",
15455
+ children: t("details")
15456
+ }),
15457
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("th", {
15458
+ scope: "col",
15459
+ className: SyncPage_module_css_default.actionHeading,
15460
+ children: t("actions")
15461
+ })
15462
+ ] }) }),
15463
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("tbody", { children: status.units.map((unit) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("tr", { children: [
15464
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", {
15465
+ className: SyncPage_module_css_default.unit,
15466
+ children: unit.id
15467
+ }),
15468
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", { children: t(`kind_${unit.kind}`) }),
15469
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", { children: t(`state_${unit.state}`) }),
15470
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", { children: when(unit.at, t("never"), t("dateLocale")) }),
15471
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Details, {
15472
+ t,
15473
+ unit,
15474
+ working: busy,
15475
+ face: {
15476
+ resolve,
15477
+ forget,
15478
+ restore
15479
+ },
15480
+ confirmDeletion: setDeletion
15481
+ }) }),
15482
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
15483
+ size: "sm",
15484
+ variant: "ghost",
15485
+ disabled: busy || status.problem !== void 0 || unit.state === "conflict" || unit.state === "ignored",
15486
+ onClick: () => {
15487
+ run(unit.id);
15488
+ },
15489
+ children: t("runOne")
15490
+ }) })
15491
+ ] }, unit.id)) })
15492
+ ]
15541
15493
  })
15542
15494
  ]
15543
15495
  }),
@@ -15573,8 +15525,7 @@ window.__ModuleLoader__.load({
15573
15525
  ]
15574
15526
  });
15575
15527
  }
15576
- //#endregion
15577
- //#region src/client/pages/sync/locales.ts
15528
+ // src/client/pages/sync/locales.ts
15578
15529
  const dictionaries$7 = {
15579
15530
  en: {
15580
15531
  nav: "Sync",
@@ -15595,6 +15546,8 @@ window.__ModuleLoader__.load({
15595
15546
  state: "State",
15596
15547
  synced: "Last synced",
15597
15548
  details: "Details",
15549
+ actions: "Actions",
15550
+ tableCaption: "Roleplay content sync status",
15598
15551
  kind_world: "World",
15599
15552
  kind_session: "Session",
15600
15553
  kind_shared: "Shared folder",
@@ -15644,6 +15597,8 @@ window.__ModuleLoader__.load({
15644
15597
  state: "状态",
15645
15598
  synced: "上次同步",
15646
15599
  details: "详情",
15600
+ actions: "操作",
15601
+ tableCaption: "角色扮演内容同步状态",
15647
15602
  kind_world: "世界",
15648
15603
  kind_session: "会话",
15649
15604
  kind_shared: "共享文件夹",
@@ -15675,8 +15630,7 @@ window.__ModuleLoader__.load({
15675
15630
  close: "关闭"
15676
15631
  }
15677
15632
  };
15678
- //#endregion
15679
- //#region src/client/pages/sync/sync-controller.ts
15633
+ // src/client/pages/sync/sync-controller.ts
15680
15634
  const messageOf$1 = (error) => error instanceof Error ? error.message : String(error);
15681
15635
  /** Reads what the sync knows of each unit and starts runs and choices; while one runs the page keeps reading. */
15682
15636
  var SyncController = class {
@@ -15763,8 +15717,7 @@ window.__ModuleLoader__.load({
15763
15717
  }
15764
15718
  }
15765
15719
  };
15766
- //#endregion
15767
- //#region src/client/pages/sync/index.ts
15720
+ // src/client/pages/sync/index.ts
15768
15721
  const NAMESPACE$8 = "roleplay.sync";
15769
15722
  /** Adds the Sync page to the Role Play panel: what is in step with the remote and what needs a choice. */
15770
15723
  function registerSyncPage(ctx) {
@@ -15783,8 +15736,7 @@ window.__ModuleLoader__.load({
15783
15736
  inject: () => sync.inject()
15784
15737
  }, SyncPage));
15785
15738
  }
15786
- //#endregion
15787
- //#region \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
15739
+ // \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
15788
15740
  const css$13 = ".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}";
15789
15741
  const key$13 = "src/client/widgets/world-card/WorldCard.module.css";
15790
15742
  let tag$13 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$13) + "]");
@@ -15796,19 +15748,18 @@ window.__ModuleLoader__.load({
15796
15748
  }
15797
15749
  tag$13.textContent = css$13;
15798
15750
  var WorldCard_module_css_default = {
15751
+ "name": "rp_Bvxx5q_name",
15799
15752
  "image": "rp_Bvxx5q_image",
15800
- "info": "rp_Bvxx5q_info",
15801
15753
  "tags": "rp_Bvxx5q_tags",
15802
- "tag": "rp_Bvxx5q_tag",
15803
- "name": "rp_Bvxx5q_name",
15804
- "cover": "rp_Bvxx5q_cover",
15805
15754
  "openButton": "rp_Bvxx5q_openButton",
15806
15755
  "play": "rp_Bvxx5q_play",
15756
+ "tag": "rp_Bvxx5q_tag",
15757
+ "placeholder": "rp_Bvxx5q_placeholder",
15758
+ "cover": "rp_Bvxx5q_cover",
15807
15759
  "card": "rp_Bvxx5q_card",
15808
- "placeholder": "rp_Bvxx5q_placeholder"
15760
+ "info": "rp_Bvxx5q_info"
15809
15761
  };
15810
- //#endregion
15811
- //#region src/client/widgets/world-card/WorldCard.tsx
15762
+ // src/client/widgets/world-card/WorldCard.tsx
15812
15763
  /** Stable hue per name, so a world without a cover keeps the same colour. */
15813
15764
  function hueOf$1(name) {
15814
15765
  let hash = 0;
@@ -15816,7 +15767,7 @@ window.__ModuleLoader__.load({
15816
15767
  return hash;
15817
15768
  }
15818
15769
  /** A world as a card. It fills the grid cell it is placed in. */
15819
- function WorldCard({ world, playLabel, openLabel, onPlay, onOpen }) {
15770
+ function WorldCard({ world, playLabel, openLabel, draftLabel, onPlay, onOpen }) {
15820
15771
  const coverSrc = world.coverVersion === void 0 ? void 0 : worldCoverPath(world.id, world.coverVersion);
15821
15772
  const [failedSrc, setFailedSrc] = (0, react.useState)();
15822
15773
  const showCover = coverSrc !== void 0 && coverSrc !== failedSrc;
@@ -15870,9 +15821,14 @@ window.__ModuleLoader__.load({
15870
15821
  }),
15871
15822
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
15872
15823
  className: WorldCard_module_css_default.info,
15873
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
15824
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
15874
15825
  className: WorldCard_module_css_default.name,
15875
- children: world.name
15826
+ children: [world.name, draftLabel !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Tag, {
15827
+ tone: "warning",
15828
+ className: WorldCard_module_css_default.tag,
15829
+ "data-testid": "world-draft",
15830
+ children: draftLabel
15831
+ })]
15876
15832
  }), world.tags.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
15877
15833
  className: WorldCard_module_css_default.tags,
15878
15834
  children: world.tags.map((tag) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Tag, {
@@ -15886,8 +15842,7 @@ window.__ModuleLoader__.load({
15886
15842
  })
15887
15843
  });
15888
15844
  }
15889
- //#endregion
15890
- //#region \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/widgets/avatar-choices/AvatarChoices.module.css.mjs
15845
+ // \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/widgets/avatar-choices/AvatarChoices.module.css.mjs
15891
15846
  const css$12 = ".rp_YCstOG_option{border:.5px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-lg);cursor:pointer;align-items:flex-start;gap:10px;padding:8px 10px;display:flex}.rp_YCstOG_option:has(input:checked){border-color:var(--dsw-alias-state-business-primary)}.rp_YCstOG_option input{accent-color:var(--dsw-alias-state-business-primary);margin:3px 0 0}.rp_YCstOG_text{flex-direction:column;gap:2px;min-width:0;display:flex}.rp_YCstOG_name{font-size:13px;font-weight:500}.rp_YCstOG_summary{color:var(--dsw-alias-label-secondary);font-size:12px}";
15892
15847
  const key$12 = "src/client/widgets/avatar-choices/AvatarChoices.module.css";
15893
15848
  let tag$12 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$12) + "]");
@@ -15899,13 +15854,12 @@ window.__ModuleLoader__.load({
15899
15854
  }
15900
15855
  tag$12.textContent = css$12;
15901
15856
  var AvatarChoices_module_css_default = {
15857
+ "summary": "rp_YCstOG_summary",
15902
15858
  "option": "rp_YCstOG_option",
15903
15859
  "text": "rp_YCstOG_text",
15904
- "summary": "rp_YCstOG_summary",
15905
15860
  "name": "rp_YCstOG_name"
15906
15861
  };
15907
- //#endregion
15908
- //#region src/client/widgets/avatar-choices/AvatarChoices.tsx
15862
+ // src/client/widgets/avatar-choices/AvatarChoices.tsx
15909
15863
  /** A list of avatars to tick: the ones brought into a world or a session. */
15910
15864
  function AvatarChoices({ avatars, selected, disabled, onToggle }) {
15911
15865
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children: avatars.map((avatar) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
@@ -15929,8 +15883,7 @@ window.__ModuleLoader__.load({
15929
15883
  })]
15930
15884
  }, avatar.key)) });
15931
15885
  }
15932
- //#endregion
15933
- //#region \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/pages/worlds/StartSessionDialog.module.css.mjs
15886
+ // \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/pages/worlds/StartSessionDialog.module.css.mjs
15934
15887
  const css$11 = ".rp_AnbLKG_form{flex-direction:column;gap:16px;min-width:min(420px,100%);display:flex}.rp_AnbLKG_field{border:0;flex-direction:column;gap:6px;min-width:0;margin:0;padding:0;display:flex}.rp_AnbLKG_label{color:var(--dsw-alias-label-secondary);padding:0;font-size:12px}.rp_AnbLKG_option{border:.5px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-lg);cursor:pointer;align-items:flex-start;gap:10px;padding:8px 10px;display:flex}.rp_AnbLKG_option:has(input:checked){border-color:var(--dsw-alias-state-business-primary)}.rp_AnbLKG_option input{accent-color:var(--dsw-alias-state-business-primary);margin:3px 0 0}.rp_AnbLKG_optionText{flex-direction:column;gap:2px;min-width:0;display:flex}.rp_AnbLKG_optionName{color:var(--dsw-alias-label-primary);font-size:13px;font-weight:500;line-height:20px}.rp_AnbLKG_optionSummary{color:var(--dsw-alias-label-secondary);font-size:12px;line-height:18px}.rp_AnbLKG_message{color:var(--dsw-alias-label-secondary);margin:0;font-size:12px}.rp_AnbLKG_error{color:var(--dsw-alias-state-error-primary);margin:0;font-size:12px}.rp_AnbLKG_advanced{flex-direction:column;gap:8px;display:flex}.rp_AnbLKG_advancedToggle{font:inherit;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:0;align-self:flex-start;align-items:center;gap:6px;padding:0;font-size:12px;display:inline-flex}.rp_AnbLKG_advancedToggle:hover{color:var(--dsw-alias-label-primary)}.rp_AnbLKG_advancedBody{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:12px;max-height:320px;padding:12px;display:flex;overflow-y:auto}@media (width<=520px){.rp_AnbLKG_form{min-width:0}}";
15935
15888
  const key$11 = "src/client/pages/worlds/StartSessionDialog.module.css";
15936
15889
  let tag$11 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$11) + "]");
@@ -15942,21 +15895,20 @@ window.__ModuleLoader__.load({
15942
15895
  }
15943
15896
  tag$11.textContent = css$11;
15944
15897
  var StartSessionDialog_module_css_default = {
15945
- "form": "rp_AnbLKG_form",
15946
- "optionText": "rp_AnbLKG_optionText",
15898
+ "advancedToggle": "rp_AnbLKG_advancedToggle",
15899
+ "error": "rp_AnbLKG_error",
15947
15900
  "field": "rp_AnbLKG_field",
15901
+ "optionText": "rp_AnbLKG_optionText",
15902
+ "form": "rp_AnbLKG_form",
15948
15903
  "optionName": "rp_AnbLKG_optionName",
15949
- "message": "rp_AnbLKG_message",
15950
- "advanced": "rp_AnbLKG_advanced",
15951
- "advancedToggle": "rp_AnbLKG_advancedToggle",
15952
- "optionSummary": "rp_AnbLKG_optionSummary",
15953
- "option": "rp_AnbLKG_option",
15954
15904
  "advancedBody": "rp_AnbLKG_advancedBody",
15955
15905
  "label": "rp_AnbLKG_label",
15956
- "error": "rp_AnbLKG_error"
15906
+ "optionSummary": "rp_AnbLKG_optionSummary",
15907
+ "option": "rp_AnbLKG_option",
15908
+ "message": "rp_AnbLKG_message",
15909
+ "advanced": "rp_AnbLKG_advanced"
15957
15910
  };
15958
- //#endregion
15959
- //#region src/client/pages/worlds/AddAvatarsDialog.tsx
15911
+ // src/client/pages/worlds/AddAvatarsDialog.tsx
15960
15912
  /** Asks which avatars become characters of a world's own files. */
15961
15913
  function AddAvatarsDialog({ t, worldId, worldName, onAdded, onClose }) {
15962
15914
  const formId = (0, react.useId)();
@@ -16042,8 +15994,7 @@ window.__ModuleLoader__.load({
16042
15994
  })
16043
15995
  });
16044
15996
  }
16045
- //#endregion
16046
- //#region src/shared/decisions.ts
15997
+ // src/shared/decisions.ts
16047
15998
  /** The places where a language model's closed-choice judgement can be given to a decision model instead, or, for the gates, a check can be made at all. */
16048
15999
  const DECISION_SITES = [
16049
16000
  "triggers",
@@ -16069,12 +16020,10 @@ window.__ModuleLoader__.load({
16069
16020
  ];
16070
16021
  /** What a gate can be set to: the modes of any site, or off. */
16071
16022
  const GATE_MODES = ["off", ...DECISION_MODES];
16072
- //#endregion
16073
- //#region src/shared/rules.ts
16023
+ // src/shared/rules.ts
16074
16024
  /** The longest text of the player's own rules. */
16075
16025
  const MAX_OWN_RULES = 2e3;
16076
- //#endregion
16077
- //#region src/shared/settings.ts
16026
+ // src/shared/settings.ts
16078
16027
  const integer = (min, max, fallback) => ({
16079
16028
  kind: "integer",
16080
16029
  min,
@@ -16197,7 +16146,7 @@ window.__ModuleLoader__.load({
16197
16146
  judgedPerTurn: integer(0, 5, 2)
16198
16147
  },
16199
16148
  decisions: {
16200
- triggers: choice(DECISION_MODES, "llm"),
16149
+ triggers: choice(DECISION_MODES, "hybrid"),
16201
16150
  reflection: choice(DECISION_MODES, "llm"),
16202
16151
  agency: choice(GATE_MODES, "off"),
16203
16152
  refusal: choice(GATE_MODES, "off"),
@@ -16249,8 +16198,7 @@ window.__ModuleLoader__.load({
16249
16198
  }
16250
16199
  /** A model as `provider/model`: both parts present, no spaces. */
16251
16200
  const MODEL_NAME = /^[^\s/]+\/\S+$/;
16252
- //#endregion
16253
- //#region src/client/settings-form/fields.ts
16201
+ // src/client/settings-form/fields.ts
16254
16202
  /** The settings the form offers, in the order shown. The rest are in the settings file. */
16255
16203
  const FORM_FIELDS = [
16256
16204
  {
@@ -17054,8 +17002,7 @@ window.__ModuleLoader__.load({
17054
17002
  }
17055
17003
  return next;
17056
17004
  }
17057
- //#endregion
17058
- //#region ../../node_modules/.pnpm/@dsh-ai-providers+core@0.5.0_@deepseek-ai+cordis@4.0.5_@deepseek-ai+dsh-llm@0.2.1-rc.3_@deepseek-ai+cordis@4.0.5_/node_modules/@dsh-ai-providers/core/lib/index.js
17005
+ // ../../node_modules/.pnpm/@dsh-ai-providers+core@0.5.4_@deepseek-ai+cordis@4.0.5_@deepseek-ai+dsh-llm@0.2.1-rc.5_@deepseek-ai+cordis@4.0.5_/node_modules/@dsh-ai-providers/core/lib/index.js
17059
17006
  /**
17060
17007
  * The browser API of the main plugin, which the UI of the main plugin and of every vendor plugin
17061
17008
  * uses. Paths are relative to the prefix, and the browser calls them with relative URLs so that a
@@ -17076,8 +17023,7 @@ window.__ModuleLoader__.load({
17076
17023
  if (typeof text === "string") return text;
17077
17024
  return text[locale] ?? text["en"] ?? Object.values(text)[0] ?? "";
17078
17025
  }
17079
- //#endregion
17080
- //#region src/client/settings-form/embedding-options.ts
17026
+ // src/client/settings-form/embedding-options.ts
17081
17027
  /**
17082
17028
  * What the selected embedding provider lets a request set, as the provider describes it, for the chat
17083
17029
  * settings to offer. It asks the AI providers plugin; without it, or without a provider selected, or
@@ -17104,8 +17050,7 @@ window.__ModuleLoader__.load({
17104
17050
  }, [only]);
17105
17051
  return options;
17106
17052
  }
17107
- //#endregion
17108
- //#region \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/settings-form/SettingsFields.module.css.mjs
17053
+ // \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/settings-form/SettingsFields.module.css.mjs
17109
17054
  const css$10 = ".rp_Rhi3yq_row{flex-direction:column;gap:6px;display:flex}.rp_Rhi3yq_field{flex-direction:column;gap:6px;width:min(100%,320px);display:flex}.rp_Rhi3yq_label{color:var(--dsw-alias-label-secondary);font-size:12px}.rp_Rhi3yq_help{max-width:560px;color:var(--dsw-alias-label-tertiary);margin:0;font-size:12px;line-height:18px}.rp_Rhi3yq_error{color:var(--dsw-alias-state-error-primary);margin:0;font-size:12px}.rp_Rhi3yq_group{border-top:.5px solid var(--dsw-alias-border-l3);flex-direction:column;gap:12px;padding-top:12px;display:flex}.rp_Rhi3yq_groupTitle{color:var(--dsw-alias-label-primary);margin:0;font-size:14px;font-weight:500}.rp_Rhi3yq_area{box-sizing:border-box;border:.5px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-md);background:var(--dsw-alias-bg-layer-1);width:100%;max-width:560px;min-height:96px;color:inherit;font:inherit;resize:vertical;padding:6px 8px;font-size:13px}.rp_Rhi3yq_area:focus-visible{border-color:var(--dsw-alias-state-business-primary);outline:none}";
17110
17055
  const key$10 = "src/client/settings-form/SettingsFields.module.css";
17111
17056
  let tag$10 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$10) + "]");
@@ -17117,17 +17062,16 @@ window.__ModuleLoader__.load({
17117
17062
  }
17118
17063
  tag$10.textContent = css$10;
17119
17064
  var SettingsFields_module_css_default = {
17120
- "groupTitle": "rp_Rhi3yq_groupTitle",
17121
- "row": "rp_Rhi3yq_row",
17122
- "group": "rp_Rhi3yq_group",
17123
17065
  "label": "rp_Rhi3yq_label",
17124
- "help": "rp_Rhi3yq_help",
17066
+ "groupTitle": "rp_Rhi3yq_groupTitle",
17125
17067
  "error": "rp_Rhi3yq_error",
17126
- "area": "rp_Rhi3yq_area",
17127
- "field": "rp_Rhi3yq_field"
17068
+ "help": "rp_Rhi3yq_help",
17069
+ "group": "rp_Rhi3yq_group",
17070
+ "row": "rp_Rhi3yq_row",
17071
+ "field": "rp_Rhi3yq_field",
17072
+ "area": "rp_Rhi3yq_area"
17128
17073
  };
17129
- //#endregion
17130
- //#region src/client/settings-form/SettingsFields.tsx
17074
+ // src/client/settings-form/SettingsFields.tsx
17131
17075
  /** The settings of a chat as editable fields: one control with its explanation under each. */
17132
17076
  function SettingsFields({ t, drafts, onChange, onPreset, options = [], disabled = false, locked = {}, hidden = [] }) {
17133
17077
  const bad = problemsOf(drafts, options);
@@ -17301,8 +17245,7 @@ window.__ModuleLoader__.load({
17301
17245
  })
17302
17246
  ] });
17303
17247
  }
17304
- //#endregion
17305
- //#region src/client/pages/worlds/import-api.ts
17248
+ // src/client/pages/worlds/import-api.ts
17306
17249
  async function answer$1(response) {
17307
17250
  if (!response.ok) {
17308
17251
  const body = await response.json().catch(() => void 0);
@@ -17335,6 +17278,17 @@ window.__ModuleLoader__.load({
17335
17278
  })
17336
17279
  }));
17337
17280
  }
17281
+ async function importWithoutModel(id, choices, language) {
17282
+ return await answer$1(await fetch(`${API_PREFIX}/worlds/import/structure?id=${encodeURIComponent(id)}`, {
17283
+ method: "POST",
17284
+ credentials: "same-origin",
17285
+ headers: { "content-type": "application/json" },
17286
+ body: JSON.stringify({
17287
+ ...choices,
17288
+ language
17289
+ })
17290
+ }));
17291
+ }
17338
17292
  async function discardImport(id) {
17339
17293
  await fetch(`${API_PREFIX}/worlds/import?id=${encodeURIComponent(id)}`, {
17340
17294
  method: "DELETE",
@@ -17352,8 +17306,26 @@ window.__ModuleLoader__.load({
17352
17306
  credentials: "same-origin"
17353
17307
  }));
17354
17308
  }
17355
- //#endregion
17356
- //#region src/client/pages/worlds/translate-api.ts
17309
+ /** Whether a world is a draft (an import written but not yet able to start), and what is wrong with it. */
17310
+ async function draftStatus(worldId, signal) {
17311
+ return await answer$1(await fetch(`${API_PREFIX}/worlds/import/draft?id=${encodeURIComponent(worldId)}`, {
17312
+ credentials: "same-origin",
17313
+ ...signal === void 0 ? {} : { signal }
17314
+ }));
17315
+ }
17316
+ /** What the person decides about a draft: have the assistant try again, keep it as it is, or discard it. */
17317
+ async function decideDraft(worldId, action, language) {
17318
+ return await answer$1(await fetch(`${API_PREFIX}/worlds/import/draft?id=${encodeURIComponent(worldId)}`, {
17319
+ method: "POST",
17320
+ credentials: "same-origin",
17321
+ headers: { "content-type": "application/json" },
17322
+ body: JSON.stringify({
17323
+ action,
17324
+ language
17325
+ })
17326
+ }));
17327
+ }
17328
+ // src/client/pages/worlds/translate-api.ts
17357
17329
  /** The language a world is written in, or nothing when it has too little text to tell. */
17358
17330
  async function worldLanguage(worldId, signal) {
17359
17331
  const { language } = await answer$1(await fetch(`${API_PREFIX}/worlds/language?id=${encodeURIComponent(worldId)}`, {
@@ -17377,9 +17349,8 @@ window.__ModuleLoader__.load({
17377
17349
  }
17378
17350
  /** The language of the interface or of a setting, as one of the two the plugin writes in. */
17379
17351
  const storyLanguageOf = (code) => code.trim().toLowerCase().startsWith("zh") ? "zh" : "en";
17380
- //#endregion
17381
- //#region \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/pages/worlds/TranslateBanner.module.css.mjs
17382
- const css$9 = ".rp_Lx8vJa_banner{border:1px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);color:var(--dsw-alias-label-secondary);align-items:center;gap:12px;margin:0 0 8px;padding:8px 12px;font-size:12px;line-height:18px;display:flex}.rp_Lx8vJa_text{flex:auto}.rp_Lx8vJa_error{color:var(--dsw-alias-state-error-primary);margin:0 0 8px;font-size:12px}";
17352
+ // \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/pages/worlds/TranslateBanner.module.css.mjs
17353
+ const css$9 = ".rp_Lx8vJa_banner{border:.5px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-lg);color:var(--dsw-alias-label-secondary);flex-wrap:wrap;align-items:center;gap:12px;margin:0 0 8px;padding:8px 12px;font-size:12px;line-height:18px;display:flex}.rp_Lx8vJa_text{flex:360px;min-width:0}.rp_Lx8vJa_text ul{margin:4px 0 0;padding-left:20px}.rp_Lx8vJa_bannerActions{flex-wrap:wrap;flex:0 auto;justify-content:flex-end;gap:8px;display:flex}.rp_Lx8vJa_error{color:var(--dsw-alias-state-error-primary);margin:0 0 8px;font-size:12px}";
17383
17354
  const key$9 = "src/client/pages/worlds/TranslateBanner.module.css";
17384
17355
  let tag$9 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$9) + "]");
17385
17356
  if (tag$9 === null) {
@@ -17390,12 +17361,12 @@ window.__ModuleLoader__.load({
17390
17361
  }
17391
17362
  tag$9.textContent = css$9;
17392
17363
  var TranslateBanner_module_css_default = {
17393
- "error": "rp_Lx8vJa_error",
17364
+ "banner": "rp_Lx8vJa_banner",
17394
17365
  "text": "rp_Lx8vJa_text",
17395
- "banner": "rp_Lx8vJa_banner"
17366
+ "bannerActions": "rp_Lx8vJa_bannerActions",
17367
+ "error": "rp_Lx8vJa_error"
17396
17368
  };
17397
- //#endregion
17398
- //#region src/client/pages/worlds/TranslateBanner.tsx
17369
+ // src/client/pages/worlds/TranslateBanner.tsx
17399
17370
  const languageName = (t, language) => language === "zh" ? t("languageChinese") : t("languageEnglish");
17400
17371
  /** The language a world is written in, read from the host; nothing while it is being read or when it cannot be told. */
17401
17372
  function useWorldLanguage(worldId) {
@@ -17452,8 +17423,7 @@ window.__ModuleLoader__.load({
17452
17423
  children: failure
17453
17424
  })] });
17454
17425
  }
17455
- //#endregion
17456
- //#region src/client/pages/worlds/StartSessionDialog.tsx
17426
+ // src/client/pages/worlds/StartSessionDialog.tsx
17457
17427
  /** Asks what a new session needs: its name and which playable character the player takes. */
17458
17428
  function StartSessionDialog({ t, dialog, onStart, onClose }) {
17459
17429
  const formId = (0, react.useId)();
@@ -17781,16 +17751,14 @@ window.__ModuleLoader__.load({
17781
17751
  })
17782
17752
  });
17783
17753
  }
17784
- //#endregion
17785
- //#region src/client/pages/worlds/grid-layout.ts
17754
+ // src/client/pages/worlds/grid-layout.ts
17786
17755
  /** How many whole cards fit in the box without scrolling. */
17787
17756
  function cardsThatFit(box, { cardWidth, cardHeight, gap }) {
17788
17757
  const columns = Math.floor((box.width + gap) / (cardWidth + gap));
17789
17758
  const rows = Math.floor((box.height + gap) / (cardHeight + gap));
17790
17759
  return Math.max(0, columns) * Math.max(0, rows);
17791
17760
  }
17792
- //#endregion
17793
- //#region src/client/pages/worlds/use-grid-fit.ts
17761
+ // src/client/pages/worlds/use-grid-fit.ts
17794
17762
  function gridFit(box, style) {
17795
17763
  const cardWidth = pixels(style, "--rp-card-width");
17796
17764
  const cardHeight = pixels(style, "--rp-card-height");
@@ -17805,8 +17773,7 @@ window.__ModuleLoader__.load({
17805
17773
  function useGridFit(viewport) {
17806
17774
  return useFit(viewport, gridFit);
17807
17775
  }
17808
- //#endregion
17809
- //#region src/client/pages/worlds/CreateWorldDialog.tsx
17776
+ // src/client/pages/worlds/CreateWorldDialog.tsx
17810
17777
  function CreateWorldDialog({ t, onCreated, onClose }) {
17811
17778
  const formId = (0, react.useId)();
17812
17779
  const [folder, setFolder] = (0, react.useState)("");
@@ -17945,8 +17912,7 @@ window.__ModuleLoader__.load({
17945
17912
  })
17946
17913
  });
17947
17914
  }
17948
- //#endregion
17949
- //#region src/client/pages/worlds/starter-api.ts
17915
+ // src/client/pages/worlds/starter-api.ts
17950
17916
  async function answer(response) {
17951
17917
  if (!response.ok) {
17952
17918
  const body = await response.json().catch(() => void 0);
@@ -17970,9 +17936,8 @@ window.__ModuleLoader__.load({
17970
17936
  body: JSON.stringify({ folder })
17971
17937
  }));
17972
17938
  }
17973
- //#endregion
17974
- //#region \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/pages/worlds/WorldsPage.module.css.mjs
17975
- const css$8 = ".rp_FHUyRq_page{flex-direction:column;flex:1 1 0;gap:8px;min-height:0;display:flex}.rp_FHUyRq_toolbar{flex:none;justify-content:space-between;align-items:center;gap:12px;min-height:28px;display:flex}.rp_FHUyRq_count{color:var(--dsw-alias-label-tertiary);font-size:12px}.rp_FHUyRq_toolbarActions{flex-wrap:wrap;justify-content:flex-end;align-items:center;gap:8px;display:flex}.rp_FHUyRq_spinning{animation:.9s linear infinite rp_FHUyRq_spin}@keyframes rp_FHUyRq_spin{to{transform:rotate(360deg)}}@media (prefers-reduced-motion:reduce){.rp_FHUyRq_spinning{animation:none}}.rp_FHUyRq_notice{color:var(--dsw-alias-state-error-primary);margin:0;font-size:12px}.rp_FHUyRq_viewport{--rp-card-width:168px;--rp-card-height:288px;--rp-card-gap:16px;flex:1 1 0;min-height:0;padding:4px}.rp_FHUyRq_scrolls{overflow-y:auto}.rp_FHUyRq_fits{overflow:hidden}.rp_FHUyRq_grid{grid-auto-rows:var(--rp-card-height);grid-template-columns:repeat(auto-fill, var(--rp-card-width));gap:var(--rp-card-gap);margin:0;padding:0;list-style:none;display:grid}.rp_FHUyRq_cell{min-width:0;display:flex}.rp_FHUyRq_message{text-align:center;color:var(--dsw-alias-label-secondary);margin:0;padding:40px 0;font-size:13px}.rp_FHUyRq_editHeader{border-bottom:.5px solid var(--dsw-alias-border-l3);flex-wrap:wrap;flex:none;align-items:center;gap:8px;padding:8px 16px;display:flex}.rp_FHUyRq_editTitle{color:var(--dsw-alias-label-primary);font-size:14px;font-weight:500}.rp_FHUyRq_authorButton{margin-left:auto}.rp_FHUyRq_editBody{flex:1 1 0;min-height:0;display:flex}.rp_FHUyRq_starters{flex-direction:column;align-items:center;gap:8px;padding-bottom:24px;display:flex}.rp_FHUyRq_starter{border:.5px solid var(--dsw-alias-settings-card-stroke);border-radius:var(--dsw-radius-xl);background:var(--dsw-alias-settings-card-fill);text-align:center;max-width:480px;color:var(--dsw-alias-label-secondary);flex-direction:column;align-items:center;gap:6px;padding:12px 16px;font-size:13px;display:flex}@media (width<=640px){.rp_FHUyRq_toolbar{align-items:flex-start}.rp_FHUyRq_count{padding-top:6px}.rp_FHUyRq_toolbarActions{max-width:75%}.rp_FHUyRq_editTitle{text-overflow:ellipsis;white-space:nowrap;flex:calc(100% - 96px);overflow:hidden}.rp_FHUyRq_authorButton{margin-left:0}}";
17939
+ // \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/pages/worlds/WorldsPage.module.css.mjs
17940
+ const css$8 = ".rp_FHUyRq_page{flex-direction:column;flex:1 1 0;gap:8px;min-height:0;display:flex}.rp_FHUyRq_toolbar{flex:none;justify-content:space-between;align-items:center;gap:12px;min-height:28px;display:flex}.rp_FHUyRq_count{color:var(--dsw-alias-label-tertiary);font-size:12px}.rp_FHUyRq_toolbarActions{flex-wrap:wrap;justify-content:flex-end;align-items:center;gap:8px;display:flex}.rp_FHUyRq_spinning{animation:.9s linear infinite rp_FHUyRq_spin}@keyframes rp_FHUyRq_spin{to{transform:rotate(360deg)}}@media (prefers-reduced-motion:reduce){.rp_FHUyRq_spinning{animation:none}}.rp_FHUyRq_notice{color:var(--dsw-alias-state-error-primary);margin:0;font-size:12px}.rp_FHUyRq_info{color:var(--dsw-alias-label-secondary);margin:0;font-size:12px}.rp_FHUyRq_viewport{--rp-card-width:168px;--rp-card-height:288px;--rp-card-gap:16px;flex:1 1 0;min-height:0;padding:4px}.rp_FHUyRq_scrolls{overflow-y:auto}.rp_FHUyRq_fits{overflow:hidden}.rp_FHUyRq_grid{grid-auto-rows:var(--rp-card-height);grid-template-columns:repeat(auto-fill, var(--rp-card-width));gap:var(--rp-card-gap);margin:0;padding:0;list-style:none;display:grid}.rp_FHUyRq_cell{min-width:0;display:flex}.rp_FHUyRq_message{text-align:center;color:var(--dsw-alias-label-secondary);margin:0;padding:40px 0;font-size:13px}.rp_FHUyRq_editHeader{border-bottom:.5px solid var(--dsw-alias-border-l3);flex-wrap:wrap;flex:none;align-items:center;gap:8px;padding:8px 16px;display:flex}.rp_FHUyRq_editTitle{min-width:0;color:var(--dsw-alias-label-primary);text-overflow:ellipsis;white-space:nowrap;flex:180px;font-size:14px;font-weight:500;overflow:hidden}.rp_FHUyRq_editActions{flex-wrap:wrap;flex:0 auto;justify-content:flex-end;gap:8px;display:flex}.rp_FHUyRq_editBody{flex:1 1 0;min-height:0;display:flex}.rp_FHUyRq_starters{flex-direction:column;align-items:center;gap:8px;padding-bottom:24px;display:flex}.rp_FHUyRq_starter{border:.5px solid var(--dsw-alias-settings-card-stroke);border-radius:var(--dsw-radius-xl);background:var(--dsw-alias-settings-card-fill);text-align:center;max-width:480px;color:var(--dsw-alias-label-secondary);flex-direction:column;align-items:center;gap:6px;padding:12px 16px;font-size:13px;display:flex}@media (width<=640px){.rp_FHUyRq_toolbar{align-items:flex-start}.rp_FHUyRq_count{padding-top:6px}.rp_FHUyRq_toolbarActions{max-width:75%}.rp_FHUyRq_editTitle{text-overflow:ellipsis;white-space:nowrap;flex:calc(100% - 96px);overflow:hidden}.rp_FHUyRq_editActions{flex:0 0 100%;justify-content:flex-start}}";
17976
17941
  const key$8 = "src/client/pages/worlds/WorldsPage.module.css";
17977
17942
  let tag$8 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$8) + "]");
17978
17943
  if (tag$8 === null) {
@@ -17983,28 +17948,28 @@ window.__ModuleLoader__.load({
17983
17948
  }
17984
17949
  tag$8.textContent = css$8;
17985
17950
  var WorldsPage_module_css_default = {
17986
- "count": "rp_FHUyRq_count",
17987
- "message": "rp_FHUyRq_message",
17988
- "toolbarActions": "rp_FHUyRq_toolbarActions",
17989
17951
  "editBody": "rp_FHUyRq_editBody",
17990
- "cell": "rp_FHUyRq_cell",
17991
- "page": "rp_FHUyRq_page",
17992
- "spin": "rp_FHUyRq_spin",
17993
- "fits": "rp_FHUyRq_fits",
17952
+ "starters": "rp_FHUyRq_starters",
17994
17953
  "grid": "rp_FHUyRq_grid",
17954
+ "count": "rp_FHUyRq_count",
17955
+ "cell": "rp_FHUyRq_cell",
17995
17956
  "toolbar": "rp_FHUyRq_toolbar",
17996
- "editHeader": "rp_FHUyRq_editHeader",
17997
- "spinning": "rp_FHUyRq_spinning",
17998
- "scrolls": "rp_FHUyRq_scrolls",
17999
- "authorButton": "rp_FHUyRq_authorButton",
18000
- "editTitle": "rp_FHUyRq_editTitle",
18001
- "starter": "rp_FHUyRq_starter",
18002
17957
  "viewport": "rp_FHUyRq_viewport",
17958
+ "starter": "rp_FHUyRq_starter",
17959
+ "page": "rp_FHUyRq_page",
18003
17960
  "notice": "rp_FHUyRq_notice",
18004
- "starters": "rp_FHUyRq_starters"
17961
+ "editTitle": "rp_FHUyRq_editTitle",
17962
+ "editHeader": "rp_FHUyRq_editHeader",
17963
+ "info": "rp_FHUyRq_info",
17964
+ "editActions": "rp_FHUyRq_editActions",
17965
+ "toolbarActions": "rp_FHUyRq_toolbarActions",
17966
+ "spinning": "rp_FHUyRq_spinning",
17967
+ "fits": "rp_FHUyRq_fits",
17968
+ "message": "rp_FHUyRq_message",
17969
+ "spin": "rp_FHUyRq_spin",
17970
+ "scrolls": "rp_FHUyRq_scrolls"
18005
17971
  };
18006
- //#endregion
18007
- //#region src/client/pages/worlds/StarterWorlds.tsx
17972
+ // src/client/pages/worlds/StarterWorlds.tsx
18008
17973
  /** The worlds that ship with the plugin and are not yet the person's, offered where the list of worlds is empty. */
18009
17974
  function StarterWorlds({ t, onAdded }) {
18010
17975
  const [offered, setOffered] = (0, react.useState)([]);
@@ -18058,8 +18023,105 @@ window.__ModuleLoader__.load({
18058
18023
  })]
18059
18024
  });
18060
18025
  }
18061
- //#endregion
18062
- //#region src/client/pages/worlds/RevertUpdateDialog.tsx
18026
+ // src/client/pages/worlds/DraftBanner.tsx
18027
+ /** The most problems the banner lists: the rest are counted. */
18028
+ const SHOWN = 5;
18029
+ /** Says that a world is an import written as a draft, what is wrong with it, and lets the person have it repaired, keep it as it is or discard it. */
18030
+ function DraftBanner({ t, worldId, version, openChat, onChanged, onDiscarded }) {
18031
+ const [status, setStatus] = (0, react.useState)();
18032
+ const [busy, setBusy] = (0, react.useState)(false);
18033
+ const [confirming, setConfirming] = (0, react.useState)(false);
18034
+ const [failure, setFailure] = (0, react.useState)();
18035
+ (0, react.useEffect)(() => {
18036
+ const abort = new AbortController();
18037
+ setStatus(void 0);
18038
+ setFailure(void 0);
18039
+ draftStatus(worldId, abort.signal).then(setStatus, (error) => {
18040
+ if (!abort.signal.aborted) setFailure(t("draftFailed", { message: error instanceof Error ? error.message : String(error) }));
18041
+ });
18042
+ return () => {
18043
+ abort.abort();
18044
+ };
18045
+ }, [worldId, version]);
18046
+ if (status?.draft !== true) return failure === void 0 ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
18047
+ className: TranslateBanner_module_css_default.error,
18048
+ role: "alert",
18049
+ children: failure
18050
+ });
18051
+ const decide = (action) => {
18052
+ setBusy(true);
18053
+ setFailure(void 0);
18054
+ decideDraft(worldId, action, t("language")).then((done) => {
18055
+ setBusy(false);
18056
+ setConfirming(false);
18057
+ if (action === "discard") onDiscarded();
18058
+ else onChanged();
18059
+ if (action === "ask" && done.started !== void 0) openChat(done.started.chatSessionId);
18060
+ }, (error) => {
18061
+ setBusy(false);
18062
+ setFailure(t("draftFailed", { message: error instanceof Error ? error.message : String(error) }));
18063
+ });
18064
+ };
18065
+ const problems = status.check?.problems ?? [];
18066
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
18067
+ className: TranslateBanner_module_css_default.banner,
18068
+ role: "note",
18069
+ "data-testid": "roleplay-draft-banner",
18070
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
18071
+ className: TranslateBanner_module_css_default.text,
18072
+ children: [
18073
+ t("draftWarning"),
18074
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", { children: problems.slice(0, SHOWN).map((problem) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("li", { children: [
18075
+ problem.where,
18076
+ ": ",
18077
+ problem.message
18078
+ ] }, `${problem.where}:${problem.message}`)) }),
18079
+ problems.length + (status.check?.more ?? 0) > SHOWN && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("draftMore", { count: problems.length + (status.check?.more ?? 0) - SHOWN }) }),
18080
+ confirming && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
18081
+ role: "alert",
18082
+ children: t("draftDiscardConfirm")
18083
+ })
18084
+ ]
18085
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
18086
+ className: TranslateBanner_module_css_default.bannerActions,
18087
+ children: [
18088
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
18089
+ variant: "primary",
18090
+ size: "sm",
18091
+ disabled: busy,
18092
+ onClick: () => {
18093
+ decide("ask");
18094
+ },
18095
+ children: busy ? t("draftBusy") : t("draftAsk")
18096
+ }),
18097
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
18098
+ variant: "outline",
18099
+ size: "sm",
18100
+ disabled: busy,
18101
+ onClick: () => {
18102
+ decide("keep");
18103
+ },
18104
+ children: t("draftKeep")
18105
+ }),
18106
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
18107
+ variant: "outline",
18108
+ size: "sm",
18109
+ disabled: busy,
18110
+ onClick: () => {
18111
+ if (confirming) decide("discard");
18112
+ else setConfirming(true);
18113
+ },
18114
+ children: t("draftDiscard")
18115
+ })
18116
+ ]
18117
+ })]
18118
+ }), failure !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
18119
+ className: TranslateBanner_module_css_default.error,
18120
+ role: "alert",
18121
+ children: failure
18122
+ })] });
18123
+ }
18124
+ // src/client/pages/worlds/RevertUpdateDialog.tsx
18063
18125
  /** Asks before a world goes back to how it was before its last card update. */
18064
18126
  function RevertUpdateDialog({ t, revert, onDone, onClose }) {
18065
18127
  const [busy, setBusy] = (0, react.useState)(false);
@@ -18098,8 +18160,7 @@ window.__ModuleLoader__.load({
18098
18160
  })
18099
18161
  });
18100
18162
  }
18101
- //#endregion
18102
- //#region src/client/pages/worlds/WorldsPage.tsx
18163
+ // src/client/pages/worlds/WorldsPage.tsx
18103
18164
  /** The worlds, one page of cards at a time. */
18104
18165
  function WorldsPage({ t, useWorlds, load, refresh, openStartDialog, closeStartDialog, startSession, dismissStarted, openAuthoring, openChat }) {
18105
18166
  const state = useWorlds((snapshot) => snapshot);
@@ -18118,6 +18179,7 @@ window.__ModuleLoader__.load({
18118
18179
  const [updateBusy, setUpdateBusy] = (0, react.useState)(false);
18119
18180
  const [uploading, setUploading] = (0, react.useState)(false);
18120
18181
  const [importNotice, setImportNotice] = (0, react.useState)();
18182
+ const [importDone, setImportDone] = (0, react.useState)();
18121
18183
  const picker = (0, react.useRef)(null);
18122
18184
  const presetPicker = (0, react.useRef)(null);
18123
18185
  const [presetBusy, setPresetBusy] = (0, react.useState)(false);
@@ -18155,6 +18217,7 @@ window.__ModuleLoader__.load({
18155
18217
  if (file === void 0) return;
18156
18218
  setUploading(true);
18157
18219
  setImportNotice(void 0);
18220
+ setImportDone(void 0);
18158
18221
  uploadCard(file).then((preview) => {
18159
18222
  setUploading(false);
18160
18223
  setImporting(preview);
@@ -18204,6 +18267,14 @@ window.__ModuleLoader__.load({
18204
18267
  preview: importing,
18205
18268
  ...updating === void 0 ? {} : { initialUpdate: updating },
18206
18269
  start: (choices, update) => startImport(importing.id, choices, t("language"), update),
18270
+ startPlain: (choices) => importWithoutModel(importing.id, choices, t("language")),
18271
+ onImportedPlain: (_world, draft) => {
18272
+ setImporting(void 0);
18273
+ setUpdating(void 0);
18274
+ refresh();
18275
+ if (draft) setImportNotice(t("importPlainDraft"));
18276
+ else setImportDone(t("importPlainDone"));
18277
+ },
18207
18278
  discard: () => discardImport(importing.id),
18208
18279
  onCancelled: () => {
18209
18280
  setImporting(void 0);
@@ -18249,23 +18320,6 @@ window.__ModuleLoader__.load({
18249
18320
  event.target.value = "";
18250
18321
  }
18251
18322
  }),
18252
- cardStatus?.fromCard === true && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
18253
- variant: "outline",
18254
- size: "sm",
18255
- disabled: updateBusy,
18256
- onClick: () => {
18257
- updatePicker.current?.click();
18258
- },
18259
- children: updateBusy ? t("updateReading") : t("updateFromCard")
18260
- }),
18261
- cardStatus?.revertible === true && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
18262
- variant: "outline",
18263
- size: "sm",
18264
- onClick: () => {
18265
- setReverting(true);
18266
- },
18267
- children: t("revertUpdate")
18268
- }),
18269
18323
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
18270
18324
  ref: presetPicker,
18271
18325
  type: "file",
@@ -18277,32 +18331,53 @@ window.__ModuleLoader__.load({
18277
18331
  event.target.value = "";
18278
18332
  }
18279
18333
  }),
18280
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
18281
- className: WorldsPage_module_css_default.authorButton,
18282
- variant: "outline",
18283
- size: "sm",
18284
- disabled: presetBusy,
18285
- onClick: () => {
18286
- presetPicker.current?.click();
18287
- },
18288
- children: presetBusy ? t("presetReading") : t("importPreset")
18289
- }),
18290
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
18291
- variant: "outline",
18292
- size: "sm",
18293
- onClick: () => {
18294
- setAddingAvatars(true);
18295
- },
18296
- children: t("addAvatars")
18297
- }),
18298
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
18299
- variant: "primary",
18300
- size: "sm",
18301
- disabled: state.authoring?.worldId === editing.id && state.authoring.error === void 0,
18302
- onClick: () => {
18303
- openAuthoring(editing.id, t("authoringChatTitle", { name: editing.name }));
18304
- },
18305
- children: state.authoring?.worldId === editing.id && state.authoring.error === void 0 ? t("openingAuthor") : t("authorWorld")
18334
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
18335
+ className: WorldsPage_module_css_default.editActions,
18336
+ children: [
18337
+ cardStatus?.fromCard === true && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
18338
+ variant: "outline",
18339
+ size: "sm",
18340
+ disabled: updateBusy,
18341
+ onClick: () => {
18342
+ updatePicker.current?.click();
18343
+ },
18344
+ children: updateBusy ? t("updateReading") : t("updateFromCard")
18345
+ }),
18346
+ cardStatus?.revertible === true && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
18347
+ variant: "outline",
18348
+ size: "sm",
18349
+ onClick: () => {
18350
+ setReverting(true);
18351
+ },
18352
+ children: t("revertUpdate")
18353
+ }),
18354
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
18355
+ variant: "outline",
18356
+ size: "sm",
18357
+ disabled: presetBusy,
18358
+ onClick: () => {
18359
+ presetPicker.current?.click();
18360
+ },
18361
+ children: presetBusy ? t("presetReading") : t("importPreset")
18362
+ }),
18363
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
18364
+ variant: "outline",
18365
+ size: "sm",
18366
+ onClick: () => {
18367
+ setAddingAvatars(true);
18368
+ },
18369
+ children: t("addAvatars")
18370
+ }),
18371
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
18372
+ variant: "primary",
18373
+ size: "sm",
18374
+ disabled: state.authoring?.worldId === editing.id && state.authoring.error === void 0,
18375
+ onClick: () => {
18376
+ openAuthoring(editing.id, t("authoringChatTitle", { name: editing.name }));
18377
+ },
18378
+ children: state.authoring?.worldId === editing.id && state.authoring.error === void 0 ? t("openingAuthor") : t("authorWorld")
18379
+ })
18380
+ ]
18306
18381
  })
18307
18382
  ]
18308
18383
  }),
@@ -18334,6 +18409,20 @@ window.__ModuleLoader__.load({
18334
18409
  openChat(opened.chatSessionId);
18335
18410
  }
18336
18411
  }),
18412
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DraftBanner, {
18413
+ t,
18414
+ worldId: editing.id,
18415
+ version: editorVersion,
18416
+ openChat,
18417
+ onChanged: () => {
18418
+ refresh();
18419
+ setEditorVersion((version) => version + 1);
18420
+ },
18421
+ onDiscarded: () => {
18422
+ refresh();
18423
+ setEditing(void 0);
18424
+ }
18425
+ }),
18337
18426
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TranslateBanner, {
18338
18427
  t,
18339
18428
  worldId: editing.id,
@@ -18431,6 +18520,11 @@ window.__ModuleLoader__.load({
18431
18520
  role: "alert",
18432
18521
  children: importNotice
18433
18522
  }),
18523
+ importDone !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
18524
+ className: WorldsPage_module_css_default.info,
18525
+ role: "status",
18526
+ children: importDone
18527
+ }),
18434
18528
  state.error !== void 0 && !failedWithoutData && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
18435
18529
  className: WorldsPage_module_css_default.notice,
18436
18530
  role: "alert",
@@ -18464,9 +18558,9 @@ window.__ModuleLoader__.load({
18464
18558
  world,
18465
18559
  playLabel: t("play"),
18466
18560
  openLabel: t("openWorld", { name: world.name }),
18467
- onPlay: () => {
18561
+ ...world.draft === true ? { draftLabel: t("draftBadge") } : { onPlay: () => {
18468
18562
  openStartDialog(world.id, world.name);
18469
- },
18563
+ } },
18470
18564
  onOpen: () => {
18471
18565
  setEditing({
18472
18566
  id: world.id,
@@ -18524,8 +18618,7 @@ window.__ModuleLoader__.load({
18524
18618
  ]
18525
18619
  });
18526
18620
  }
18527
- //#endregion
18528
- //#region src/client/settings-form/locales.ts
18621
+ // src/client/settings-form/locales.ts
18529
18622
  const dictionaries$6 = {
18530
18623
  en: {
18531
18624
  samplingMaster: "Temperature: game master",
@@ -18970,6 +19063,8 @@ window.__ModuleLoader__.load({
18970
19063
  importUploading: "Reading the card…",
18971
19064
  importUploadFailed: "Could not read the card: {message}",
18972
19065
  importTags: "Tags",
19066
+ importPlainDone: "The card was imported without a model: its character, its lorebook and its instructions are in the new world. Open it to add places and other people yourself, or have an assistant do it.",
19067
+ importPlainDraft: "The card was imported without a model, but the world would not start yet: open it to see what is missing.",
18973
19068
  importNotStarted: "The world was made, but the import has not started: open its authoring chat and send the /import-st command yourself.",
18974
19069
  chatNotOpened: "Started the session \"{name}\", but could not open its chat: {message}",
18975
19070
  advanced: "Advanced settings",
@@ -18995,7 +19090,7 @@ window.__ModuleLoader__.load({
18995
19090
  startTimeHelp: "Local time in {zone}, like 1912-04-14T23:40:00. Leave empty for the world's own start. Not used when the story follows the real clock.",
18996
19091
  loadingCharacters: "Loading characters…",
18997
19092
  charactersFailed: "Could not load the characters: {message}",
18998
- noPlayable: "This world has no playable characters, so a session cannot be started.",
19093
+ noPlayable: "This world has no playable character of its own. Bring one of your avatars to play it; make one on the Avatars tab first if you have none.",
18999
19094
  start: "Start",
19000
19095
  starting: "Starting…",
19001
19096
  cancel: "Cancel",
@@ -19015,6 +19110,15 @@ window.__ModuleLoader__.load({
19015
19110
  updateFromCard: "Update from card",
19016
19111
  updateReading: "Reading the card…",
19017
19112
  updateNotFromCard: "This world was not made from a character card, so a card cannot update it.",
19113
+ draftBadge: "Draft",
19114
+ draftWarning: "This import was written as a draft because the world would not start yet. Its problems:",
19115
+ draftAsk: "Ask the assistant to repair it",
19116
+ draftKeep: "Keep as it is",
19117
+ draftDiscard: "Discard",
19118
+ draftDiscardConfirm: "Discard this world? It goes to the trash folder of the roleplay root.",
19119
+ draftBusy: "Working…",
19120
+ draftFailed: "Could not do that: {message}",
19121
+ draftMore: "and {count} more",
19018
19122
  revertUpdate: "Undo card update",
19019
19123
  revertTitle: "Undo the last card update?",
19020
19124
  revertHelp: "The world goes back to how it was before the update, including the card it was made from. What it holds now is kept in the world's .trash folder, so changes you made since can still be found. Pictures are not part of this.",
@@ -19074,6 +19178,8 @@ window.__ModuleLoader__.load({
19074
19178
  importUploading: "正在读取角色卡…",
19075
19179
  importUploadFailed: "无法读取角色卡:{message}",
19076
19180
  importTags: "标签",
19181
+ importPlainDone: "卡片已在不使用模型的情况下导入:它的角色、世界书和指令都已在新世界中。可以打开它自己补充地点和其他人物,或请助手来做。",
19182
+ importPlainDraft: "卡片已在不使用模型的情况下导入,但世界还无法开始:打开它查看缺少什么。",
19077
19183
  importNotStarted: "世界已创建,但导入尚未开始:请打开它的编辑对话,并自行发送 /import-st 指令。",
19078
19184
  chatNotOpened: "已开始存档“{name}”,但无法打开对话:{message}",
19079
19185
  advanced: "高级设置",
@@ -19099,7 +19205,7 @@ window.__ModuleLoader__.load({
19099
19205
  startTimeHelp: "{zone} 的本地时间,例如 1912-04-14T23:40:00。留空则使用世界自带的开始时间。故事跟随真实时钟时不适用。",
19100
19206
  loadingCharacters: "正在加载角色…",
19101
19207
  charactersFailed: "无法加载角色:{message}",
19102
- noPlayable: "这张世界卡没有可扮演的角色,无法开始存档。",
19208
+ noPlayable: "这个世界自己没有可扮演的角色。请带上你的一个角色形象来扮演;如果还没有,先到“角色形象”标签页做一个。",
19103
19209
  start: "开始",
19104
19210
  starting: "正在开始…",
19105
19211
  cancel: "取消",
@@ -19119,6 +19225,15 @@ window.__ModuleLoader__.load({
19119
19225
  updateFromCard: "用角色卡更新",
19120
19226
  updateReading: "正在读取角色卡…",
19121
19227
  updateNotFromCard: "这个世界不是由角色卡导入的,无法用角色卡更新。",
19228
+ draftBadge: "草稿",
19229
+ draftWarning: "这次导入作为草稿写入,因为这个世界目前还无法开始。它的问题:",
19230
+ draftAsk: "请助手修复",
19231
+ draftKeep: "保持现状",
19232
+ draftDiscard: "丢弃",
19233
+ draftDiscardConfirm: "丢弃这个世界吗?它会被移到角色扮演根目录的回收文件夹。",
19234
+ draftBusy: "处理中…",
19235
+ draftFailed: "无法完成:{message}",
19236
+ draftMore: "还有 {count} 个",
19122
19237
  revertUpdate: "撤销卡片更新",
19123
19238
  revertTitle: "撤销上一次卡片更新?",
19124
19239
  revertHelp: "世界会回到更新之前的样子,包括它所依据的角色卡。现在的内容会保存在世界的 .trash 文件夹里,之后做的修改仍然可以找回。图片不在撤销范围内。",
@@ -19156,8 +19271,7 @@ window.__ModuleLoader__.load({
19156
19271
  startAvatarsHelp: "勾选要带进这个存档的角色形象,它们会成为存档中的角色,你也可以扮演它们。世界本身不会改变。"
19157
19272
  }
19158
19273
  }, dictionaries$6), dictionaries$12), dictionaries$20), dictionaries$21);
19159
- //#endregion
19160
- //#region src/client/pages/worlds/worlds-controller.ts
19274
+ // src/client/pages/worlds/worlds-controller.ts
19161
19275
  async function request$1(path, init, signal) {
19162
19276
  const response = await fetch(`${API_PREFIX}${path}`, {
19163
19277
  ...init,
@@ -19402,8 +19516,7 @@ window.__ModuleLoader__.load({
19402
19516
  }
19403
19517
  }
19404
19518
  };
19405
- //#endregion
19406
- //#region src/client/pages/worlds/index.ts
19519
+ // src/client/pages/worlds/index.ts
19407
19520
  const NAMESPACE$7 = "roleplay.worlds";
19408
19521
  /** Adds the Worlds page to the Role Play panel. */
19409
19522
  function registerWorldsPage(ctx) {
@@ -19422,8 +19535,7 @@ window.__ModuleLoader__.load({
19422
19535
  inject: () => worlds.inject()
19423
19536
  }, WorldsPage));
19424
19537
  }
19425
- //#endregion
19426
- //#region src/shared/chat.ts
19538
+ // src/shared/chat.ts
19427
19539
  const CHAT_PREFIX = "session-";
19428
19540
  const UUID_V4 = /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/;
19429
19541
  /** The roleplay session a DSH chat id could belong to; ordinary DSH chats have ids of the same shape. */
@@ -19432,8 +19544,7 @@ window.__ModuleLoader__.load({
19432
19544
  const id = chat.slice(8);
19433
19545
  return UUID_V4.test(id) ? id : void 0;
19434
19546
  }
19435
- //#endregion
19436
- //#region src/client/branch/branch-controller.ts
19547
+ // src/client/branch/branch-controller.ts
19437
19548
  /**
19438
19549
  * A chat DSH makes as a branch of a roleplay chat is given a session by the host, named after the first. Here the player is asked
19439
19550
  * for a name for it. Only a chat that appears while the client runs is asked about, never one that was already there.
@@ -19516,8 +19627,7 @@ window.__ModuleLoader__.load({
19516
19627
  }
19517
19628
  }
19518
19629
  };
19519
- //#endregion
19520
- //#region \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/branch/BranchDialog.module.css.mjs
19630
+ // \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/branch/BranchDialog.module.css.mjs
19521
19631
  const css$7 = ".rp_Dy1TaW_form{flex-direction:column;gap:12px;min-width:min(420px,100%);display:flex}.rp_Dy1TaW_field{flex-direction:column;gap:6px;min-width:0;display:flex}.rp_Dy1TaW_label{color:var(--dsw-alias-label-secondary);font-size:12px}.rp_Dy1TaW_error{color:var(--dsw-alias-state-danger-primary);margin:0;font-size:12px}";
19522
19632
  const key$7 = "src/client/branch/BranchDialog.module.css";
19523
19633
  let tag$7 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$7) + "]");
@@ -19531,11 +19641,10 @@ window.__ModuleLoader__.load({
19531
19641
  var BranchDialog_module_css_default = {
19532
19642
  "field": "rp_Dy1TaW_field",
19533
19643
  "label": "rp_Dy1TaW_label",
19534
- "error": "rp_Dy1TaW_error",
19535
- "form": "rp_Dy1TaW_form"
19644
+ "form": "rp_Dy1TaW_form",
19645
+ "error": "rp_Dy1TaW_error"
19536
19646
  };
19537
- //#endregion
19538
- //#region src/client/branch/BranchDialog.tsx
19647
+ // src/client/branch/BranchDialog.tsx
19539
19648
  /** Asks for the name of a session that was just branched off another. */
19540
19649
  function BranchDialog({ t, useBranch, save, keep }) {
19541
19650
  const state = useBranch((snapshot) => snapshot);
@@ -19599,8 +19708,7 @@ window.__ModuleLoader__.load({
19599
19708
  })
19600
19709
  });
19601
19710
  }
19602
- //#endregion
19603
- //#region src/client/branch/locales.ts
19711
+ // src/client/branch/locales.ts
19604
19712
  const dictionaries$4 = {
19605
19713
  en: {
19606
19714
  title: "Name the branch",
@@ -19623,8 +19731,7 @@ window.__ModuleLoader__.load({
19623
19731
  failed: "无法重命名会话:{message}"
19624
19732
  }
19625
19733
  };
19626
- //#endregion
19627
- //#region src/client/branch/index.ts
19734
+ // src/client/branch/index.ts
19628
19735
  const NAMESPACE$6 = "roleplay.branch";
19629
19736
  /** Asks for a name when DSH's fork of a roleplay chat has made a session of its own. Forks of ordinary chats are not touched. */
19630
19737
  function registerBranchNaming(ctx) {
@@ -19641,8 +19748,7 @@ window.__ModuleLoader__.load({
19641
19748
  inject: () => branches.inject()
19642
19749
  }, BranchDialog));
19643
19750
  }
19644
- //#endregion
19645
- //#region src/client/gallery/GalleryTab.tsx
19751
+ // src/client/gallery/GalleryTab.tsx
19646
19752
  /** The Gallery tab of a chat: the pictures of its roleplay session. */
19647
19753
  function GalleryTab({ t, sessionId }) {
19648
19754
  const session = roleplaySessionOf(sessionId);
@@ -19659,8 +19765,7 @@ window.__ModuleLoader__.load({
19659
19765
  target
19660
19766
  });
19661
19767
  }
19662
- //#endregion
19663
- //#region src/client/gallery/index.ts
19768
+ // src/client/gallery/index.ts
19664
19769
  const NAMESPACE$5 = "roleplay.gallery";
19665
19770
  const VIEW_ID$3 = "roleplay-gallery";
19666
19771
  /** The shell activates a data target for every view tab; this tab reads from the host itself, so its target is empty. */
@@ -19687,8 +19792,7 @@ window.__ModuleLoader__.load({
19687
19792
  }, GalleryTab));
19688
19793
  });
19689
19794
  }
19690
- //#endregion
19691
- //#region src/client/chat-input.ts
19795
+ // src/client/chat-input.ts
19692
19796
  /** What can be done with the input box of a session: put words in it, and send them. Resolved on use, so a client without it fails at the click. */
19693
19797
  function facadeOf(scope, sessionId) {
19694
19798
  const input = () => {
@@ -19708,8 +19812,7 @@ window.__ModuleLoader__.load({
19708
19812
  }
19709
19813
  };
19710
19814
  }
19711
- //#endregion
19712
- //#region src/client/interface/api.ts
19815
+ // src/client/interface/api.ts
19713
19816
  /** The host says why in `message`; a failure that has none is told by its status. */
19714
19817
  async function read(response, what) {
19715
19818
  if (!response.ok) throw new Error((await response.json().catch(() => ({}))).message ?? `${what} (${response.status})`);
@@ -19725,8 +19828,7 @@ window.__ModuleLoader__.load({
19725
19828
  async function availability() {
19726
19829
  return read(await fetch("roleplay-api/interface/availability"), "the interface packs could not be looked up");
19727
19830
  }
19728
- //#endregion
19729
- //#region src/client/interface/conversation-body.ts
19831
+ // src/client/interface/conversation-body.ts
19730
19832
  /** How the conversation's scrolling body is found: DSH's class name ends in this, with a prefix of its build's own. */
19731
19833
  const SCROLL_BODY = "_scrollBody";
19732
19834
  /**
@@ -19742,8 +19844,7 @@ window.__ModuleLoader__.load({
19742
19844
  };
19743
19845
  }
19744
19846
  }
19745
- //#endregion
19746
- //#region src/client/interface/backdrop.ts
19847
+ // src/client/interface/backdrop.ts
19747
19848
  const LIFTED = "data-rp-lifted";
19748
19849
  const STYLE = "data-roleplay-backdrop-style";
19749
19850
  /**
@@ -19788,8 +19889,7 @@ window.__ModuleLoader__.load({
19788
19889
  }, [anchor, enabled]);
19789
19890
  return host;
19790
19891
  }
19791
- //#endregion
19792
- //#region src/client/interface/hooks.ts
19892
+ // src/client/interface/hooks.ts
19793
19893
  const PACK_POLL_MS = 4e3;
19794
19894
  const VIEW_POLL_MS = 2e3;
19795
19895
  /**
@@ -19872,8 +19972,7 @@ window.__ModuleLoader__.load({
19872
19972
  console.warn("roleplay: the story could not be read for the interface pack", error);
19873
19973
  }, VIEW_POLL_MS);
19874
19974
  }
19875
- //#endregion
19876
- //#region src/client/interface/PackDock.tsx
19975
+ // src/client/interface/PackDock.tsx
19877
19976
  /**
19878
19977
  * A strip of the story's interface pack in the chat: `hud` above the input box and its docks, `dock` just above the
19879
19978
  * input, `opening` in the place of both until the first turn has been played. The `hud` one also puts the pack's
@@ -19949,8 +20048,7 @@ window.__ModuleLoader__.load({
19949
20048
  }), layer)
19950
20049
  ] });
19951
20050
  }
19952
- //#endregion
19953
- //#region src/client/interface/InterfaceTab.tsx
20051
+ // src/client/interface/InterfaceTab.tsx
19954
20052
  /** The tab of the story's interface pack: a page of its own beside Chat. */
19955
20053
  function InterfaceTab({ sessionId, frameInput, t }) {
19956
20054
  const session = roleplaySessionOf(sessionId);
@@ -19988,8 +20086,7 @@ window.__ModuleLoader__.load({
19988
20086
  })
19989
20087
  });
19990
20088
  }
19991
- //#endregion
19992
- //#region \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/interface/SidebarPage.module.css.mjs
20089
+ // \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/interface/SidebarPage.module.css.mjs
19993
20090
  const css$6 = ".rp_Ptco8a_page{flex-direction:column;width:100%;height:100%;min-height:0;display:flex}.rp_Ptco8a_bar{border-bottom:.5px solid var(--dsw-alias-border-l3);flex:none;align-items:center;gap:8px;padding:4px 8px;display:flex}.rp_Ptco8a_name{min-width:0;color:var(--dsw-alias-label-tertiary);text-overflow:ellipsis;white-space:nowrap;font-size:12px;overflow:hidden}.rp_Ptco8a_content{flex:1 1 0;min-height:0;position:relative}.rp_Ptco8a_message{color:var(--dsw-alias-label-secondary);margin:0;padding:16px;font-size:13px;line-height:20px}.rp_Ptco8a_entry{box-sizing:border-box;border:.5px solid var(--dsw-alias-border-l3);border-radius:var(--dsl-guide-entry-radius,var(--dsw-radius-sm));background:var(--dsw-alias-bg-layer-1);align-items:center;gap:14px;width:100%;min-height:56px;padding:14px 20px;display:flex;position:relative;overflow:hidden}.rp_Ptco8a_main{border-radius:0;width:100%;height:100%;position:absolute;inset:0}.rp_Ptco8a_icon{width:26px;height:26px;color:var(--dsw-alias-label-secondary);pointer-events:none;flex:none;justify-content:center;align-items:center;display:flex;position:relative}.rp_Ptco8a_text{pointer-events:none;flex-direction:column;flex:1;gap:3px;min-width:0;display:flex;position:relative}.rp_Ptco8a_title{color:var(--dsw-alias-label-primary);text-overflow:ellipsis;white-space:nowrap;font-size:14px;line-height:1.4;overflow:hidden}.rp_Ptco8a_description{color:var(--dsw-alias-label-tertiary);text-overflow:ellipsis;white-space:nowrap;font-size:12px;line-height:1.4;overflow:hidden}";
19994
20091
  const key$6 = "src/client/interface/SidebarPage.module.css";
19995
20092
  let tag$6 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$6) + "]");
@@ -20001,20 +20098,19 @@ window.__ModuleLoader__.load({
20001
20098
  }
20002
20099
  tag$6.textContent = css$6;
20003
20100
  var SidebarPage_module_css_default = {
20101
+ "entry": "rp_Ptco8a_entry",
20102
+ "icon": "rp_Ptco8a_icon",
20103
+ "bar": "rp_Ptco8a_bar",
20004
20104
  "page": "rp_Ptco8a_page",
20005
- "content": "rp_Ptco8a_content",
20006
20105
  "name": "rp_Ptco8a_name",
20106
+ "message": "rp_Ptco8a_message",
20107
+ "main": "rp_Ptco8a_main",
20007
20108
  "text": "rp_Ptco8a_text",
20008
- "entry": "rp_Ptco8a_entry",
20109
+ "content": "rp_Ptco8a_content",
20009
20110
  "title": "rp_Ptco8a_title",
20010
- "main": "rp_Ptco8a_main",
20011
- "icon": "rp_Ptco8a_icon",
20012
- "bar": "rp_Ptco8a_bar",
20013
- "description": "rp_Ptco8a_description",
20014
- "message": "rp_Ptco8a_message"
20111
+ "description": "rp_Ptco8a_description"
20015
20112
  };
20016
- //#endregion
20017
- //#region src/client/interface/SidebarPage.tsx
20113
+ // src/client/interface/SidebarPage.tsx
20018
20114
  /** The kind of the tab type, and the identity it registers its card and body under. */
20019
20115
  const SIDEBAR_KIND = "roleplay-pack";
20020
20116
  const SIDEBAR_ID = "@dsh-agentic-roleplay/core/interface-sidebar";
@@ -20104,8 +20200,7 @@ window.__ModuleLoader__.load({
20104
20200
  })]
20105
20201
  });
20106
20202
  }
20107
- //#endregion
20108
- //#region src/client/interface/locales.ts
20203
+ // src/client/interface/locales.ts
20109
20204
  const dictionaries$3 = {
20110
20205
  en: {
20111
20206
  tab: "Interface",
@@ -20140,8 +20235,7 @@ window.__ModuleLoader__.load({
20140
20235
  sidebarNone: "此故事的界面包没有侧栏页面。"
20141
20236
  }
20142
20237
  };
20143
- //#endregion
20144
- //#region src/client/interface/index.ts
20238
+ // src/client/interface/index.ts
20145
20239
  const NAMESPACE$4 = "roleplay.interface";
20146
20240
  const VIEW_ID$2 = "roleplay-interface";
20147
20241
  /** The shell activates a data target for every view tab; the pack's tab reads from the host itself, so its target is empty. */
@@ -20240,8 +20334,7 @@ window.__ModuleLoader__.load({
20240
20334
  });
20241
20335
  });
20242
20336
  }
20243
- //#endregion
20244
- //#region src/shared/authoring-chat.ts
20337
+ // src/shared/authoring-chat.ts
20245
20338
  const PREFIX = "world-author-";
20246
20339
  /** The authored world named by a dedicated authoring chat. */
20247
20340
  function authoredWorldOf(chatSessionId) {
@@ -20253,8 +20346,7 @@ window.__ModuleLoader__.load({
20253
20346
  return;
20254
20347
  }
20255
20348
  }
20256
- //#endregion
20257
- //#region src/client/world/session-source.ts
20349
+ // src/client/world/session-source.ts
20258
20350
  /** The story of a roleplay session, as the World tab reads and edits it. */
20259
20351
  function sessionSource(session) {
20260
20352
  const id = encodeURIComponent(session);
@@ -20278,8 +20370,7 @@ window.__ModuleLoader__.load({
20278
20370
  uploadImage: async (kind, key, file, signal) => await postFile(`${API_PREFIX}/sessions/world/${kind}/image/upload?id=${id}&key=${encodeURIComponent(key)}`, file, signal)
20279
20371
  };
20280
20372
  }
20281
- //#endregion
20282
- //#region src/client/world/WorldTab.tsx
20373
+ // src/client/world/WorldTab.tsx
20283
20374
  /** The story of the current chat, to read and to author. Ordinary DSH chats have ids of the same shape, so the host decides whether this one is a roleplay session. */
20284
20375
  function WorldTab({ t, sessionId }) {
20285
20376
  const session = roleplaySessionOf(sessionId);
@@ -20298,8 +20389,7 @@ window.__ModuleLoader__.load({
20298
20389
  notEditable: t("notRoleplay")
20299
20390
  });
20300
20391
  }
20301
- //#endregion
20302
- //#region src/client/world/index.ts
20392
+ // src/client/world/index.ts
20303
20393
  const NAMESPACE$3 = "roleplay.world";
20304
20394
  const VIEW_ID$1 = "roleplay-world";
20305
20395
  /** The shell activates a data target for every view tab; this tab reads from the host itself, so its target is empty. */
@@ -20326,8 +20416,7 @@ window.__ModuleLoader__.load({
20326
20416
  }, WorldTab));
20327
20417
  });
20328
20418
  }
20329
- //#endregion
20330
- //#region \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/chat-settings/ChatSettingsView.module.css.mjs
20419
+ // \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/chat-settings/ChatSettingsView.module.css.mjs
20331
20420
  const css$5 = ".rp_wLpbxW_view{box-sizing:border-box;flex-direction:column;gap:16px;width:100%;max-width:720px;margin:0 auto;padding:24px 24px 240px;display:flex}.rp_wLpbxW_title{color:var(--dsw-alias-label-primary);margin:0;font-size:16px;font-weight:500;line-height:24px}.rp_wLpbxW_description{color:var(--dsw-alias-label-secondary);margin:0;font-size:13px}.rp_wLpbxW_field{flex-direction:column;gap:6px;width:min(100%,320px);display:flex}.rp_wLpbxW_label{color:var(--dsw-alias-label-secondary);font-size:12px}.rp_wLpbxW_help{max-width:560px;color:var(--dsw-alias-label-tertiary);margin:0;font-size:12px;line-height:18px}.rp_wLpbxW_actions{flex-wrap:wrap;align-items:center;gap:12px;display:flex}.rp_wLpbxW_message{text-align:center;color:var(--dsw-alias-label-secondary);margin:40px 0;font-size:13px}.rp_wLpbxW_error{color:var(--dsw-alias-state-error-primary);margin:0;font-size:12px}.rp_wLpbxW_saved{color:var(--dsw-alias-label-secondary);font-size:12px}.rp_wLpbxW_row{flex-direction:column;gap:6px;display:flex}.rp_wLpbxW_notice{border:.5px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-lg);background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-secondary);margin:0;padding:8px 12px;font-size:12px}.rp_wLpbxW_activity{color:var(--dsw-alias-label-secondary);flex-direction:column;gap:6px;font-size:13px;display:flex}.rp_wLpbxW_activity summary{cursor:pointer;color:var(--dsw-alias-label-primary);font-weight:500}.rp_wLpbxW_activityBody{flex-direction:column;gap:8px;padding-top:8px;display:flex}.rp_wLpbxW_link{font:inherit;color:var(--dsw-alias-state-business-primary);cursor:pointer;background:0 0;border:0;align-self:flex-start;padding:0;font-size:12px}.rp_wLpbxW_table{border-collapse:collapse;font-variant-numeric:tabular-nums;width:100%;min-width:920px;font-size:12px}.rp_wLpbxW_tableViewport{border:.5px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-lg);background:var(--dsw-alias-bg-layer-1);max-width:100%;overflow-x:auto}.rp_wLpbxW_tableViewport:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:2px}.rp_wLpbxW_table th,.rp_wLpbxW_table td{border-bottom:.5px solid var(--dsw-alias-border-l4);text-align:left;vertical-align:top;overflow-wrap:anywhere;padding:6px 10px}.rp_wLpbxW_table th{color:var(--dsw-alias-label-tertiary);font-weight:400}.rp_wLpbxW_table tbody th{color:var(--dsw-alias-label-primary);font-weight:500}.rp_wLpbxW_table tbody tr:last-child>*{border-bottom:0}.rp_wLpbxW_table th:first-child,.rp_wLpbxW_table td:first-child,.rp_wLpbxW_table th:nth-child(3),.rp_wLpbxW_table td:nth-child(3),.rp_wLpbxW_table th:nth-child(4),.rp_wLpbxW_table td:nth-child(4),.rp_wLpbxW_table th:nth-child(5),.rp_wLpbxW_table td:nth-child(5){white-space:nowrap}.rp_wLpbxW_run{flex-direction:column;gap:4px;padding:4px 0 8px;display:flex}.rp_wLpbxW_pre{border:.5px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-lg);background:var(--dsw-alias-markdown-code-block);white-space:pre-wrap;overflow-wrap:anywhere;max-height:240px;margin:4px 0;padding:6px 8px;font-size:12px;overflow:auto}.rp_wLpbxW_reasons{color:var(--dsw-alias-label-secondary);overflow-wrap:anywhere;margin:4px 0;padding-left:20px;font-size:12px}.rp_wLpbxW_select{box-sizing:border-box;border:.5px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-md);background:var(--dsw-alias-bg-layer-1);width:100%;max-width:320px;height:32px;color:var(--dsw-alias-label-primary);font:inherit;padding:0 8px;font-size:13px}.rp_wLpbxW_list{color:var(--dsw-alias-label-tertiary);margin:0;padding-left:18px;font-size:12px;line-height:18px}@media (width<=640px){.rp_wLpbxW_view{padding-inline:16px}}";
20332
20421
  const key$5 = "src/client/chat-settings/ChatSettingsView.module.css";
20333
20422
  let tag$5 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$5) + "]");
@@ -20339,31 +20428,30 @@ window.__ModuleLoader__.load({
20339
20428
  }
20340
20429
  tag$5.textContent = css$5;
20341
20430
  var ChatSettingsView_module_css_default = {
20431
+ "reasons": "rp_wLpbxW_reasons",
20432
+ "view": "rp_wLpbxW_view",
20433
+ "row": "rp_wLpbxW_row",
20342
20434
  "table": "rp_wLpbxW_table",
20343
- "description": "rp_wLpbxW_description",
20344
20435
  "title": "rp_wLpbxW_title",
20345
- "notice": "rp_wLpbxW_notice",
20346
- "help": "rp_wLpbxW_help",
20347
- "tableViewport": "rp_wLpbxW_tableViewport",
20348
- "select": "rp_wLpbxW_select",
20436
+ "message": "rp_wLpbxW_message",
20437
+ "activity": "rp_wLpbxW_activity",
20438
+ "actions": "rp_wLpbxW_actions",
20349
20439
  "error": "rp_wLpbxW_error",
20350
- "reasons": "rp_wLpbxW_reasons",
20351
- "list": "rp_wLpbxW_list",
20352
- "pre": "rp_wLpbxW_pre",
20353
- "saved": "rp_wLpbxW_saved",
20354
20440
  "field": "rp_wLpbxW_field",
20441
+ "tableViewport": "rp_wLpbxW_tableViewport",
20355
20442
  "link": "rp_wLpbxW_link",
20356
- "label": "rp_wLpbxW_label",
20357
- "view": "rp_wLpbxW_view",
20358
- "actions": "rp_wLpbxW_actions",
20359
- "row": "rp_wLpbxW_row",
20360
- "activityBody": "rp_wLpbxW_activityBody",
20361
20443
  "run": "rp_wLpbxW_run",
20362
- "message": "rp_wLpbxW_message",
20363
- "activity": "rp_wLpbxW_activity"
20444
+ "description": "rp_wLpbxW_description",
20445
+ "pre": "rp_wLpbxW_pre",
20446
+ "activityBody": "rp_wLpbxW_activityBody",
20447
+ "saved": "rp_wLpbxW_saved",
20448
+ "label": "rp_wLpbxW_label",
20449
+ "notice": "rp_wLpbxW_notice",
20450
+ "select": "rp_wLpbxW_select",
20451
+ "list": "rp_wLpbxW_list",
20452
+ "help": "rp_wLpbxW_help"
20364
20453
  };
20365
- //#endregion
20366
- //#region src/client/chat-settings/settings-api.ts
20454
+ // src/client/chat-settings/settings-api.ts
20367
20455
  /** The chat is not a roleplay session, so it has no settings. */
20368
20456
  var NotRoleplayError = class extends Error {};
20369
20457
  async function receive(response) {
@@ -20474,14 +20562,12 @@ window.__ModuleLoader__.load({
20474
20562
  }
20475
20563
  return await response.json();
20476
20564
  }
20477
- //#endregion
20478
- //#region src/client/chat-settings/decision-figures.ts
20565
+ // src/client/chat-settings/decision-figures.ts
20479
20566
  /** The average time of a run, or a dash when the site has not run. */
20480
20567
  const perRun = (total, runs) => runs === 0 ? "–" : `${Math.round(total / runs)} ms`;
20481
20568
  /** The share of compared judgements that the decision model made the way the language model did, or a dash when none were compared. */
20482
20569
  const agreement = (stats) => stats.agreed + stats.disagreed === 0 ? "–" : `${Math.round(100 * stats.agreed / (stats.agreed + stats.disagreed))}%`;
20483
- //#endregion
20484
- //#region src/client/chat-settings/DecisionsSection.tsx
20570
+ // src/client/chat-settings/DecisionsSection.tsx
20485
20571
  const MODE_LABEL = {
20486
20572
  off: "decisionOff",
20487
20573
  llm: "decisionLlm",
@@ -20664,8 +20750,7 @@ window.__ModuleLoader__.load({
20664
20750
  })]
20665
20751
  });
20666
20752
  }
20667
- //#endregion
20668
- //#region src/client/chat-settings/InterfaceSection.tsx
20753
+ // src/client/chat-settings/InterfaceSection.tsx
20669
20754
  const message$4 = (failure) => failure instanceof Error ? failure.message : String(failure);
20670
20755
  /**
20671
20756
  * The interface pack of the story: which one is in use or why none is, a choice of the packs the story could use (kept
@@ -20818,8 +20903,7 @@ window.__ModuleLoader__.load({
20818
20903
  ]
20819
20904
  });
20820
20905
  }
20821
- //#endregion
20822
- //#region src/client/chat-settings/LorebookSection.tsx
20906
+ // src/client/chat-settings/LorebookSection.tsx
20823
20907
  const message$3 = (failure) => failure instanceof Error ? failure.message : String(failure);
20824
20908
  /** The lorebooks the story holds, with a way to add one from the library or take one out. */
20825
20909
  function LorebookSection({ t, session, disabled }) {
@@ -20952,8 +21036,7 @@ window.__ModuleLoader__.load({
20952
21036
  ]
20953
21037
  });
20954
21038
  }
20955
- //#endregion
20956
- //#region src/client/chat-settings/PresetSection.tsx
21039
+ // src/client/chat-settings/PresetSection.tsx
20957
21040
  const message$2 = (failure) => failure instanceof Error ? failure.message : String(failure);
20958
21041
  /** The writing preset the story's prompts came from, whether it still matches the library, and a way to switch or take it out. */
20959
21042
  function PresetSection({ t, session, disabled }) {
@@ -21069,8 +21152,7 @@ window.__ModuleLoader__.load({
21069
21152
  ]
21070
21153
  });
21071
21154
  }
21072
- //#endregion
21073
- //#region src/client/chat-settings/ReflectionSection.tsx
21155
+ // src/client/chat-settings/ReflectionSection.tsx
21074
21156
  const POLL_MS$1 = 3e3;
21075
21157
  /** When the characters last sorted what they took in, and a way to have them do it now. */
21076
21158
  function ReflectionSection({ t, status, onStart, onRefresh, disabled }) {
@@ -21128,8 +21210,7 @@ window.__ModuleLoader__.load({
21128
21210
  ]
21129
21211
  });
21130
21212
  }
21131
- //#endregion
21132
- //#region src/client/chat-settings/VectorsSection.tsx
21213
+ // src/client/chat-settings/VectorsSection.tsx
21133
21214
  /** What the search by meaning stands on, and a way to start it again with another embedding model. */
21134
21215
  function VectorsSection({ t, status, onReset, disabled }) {
21135
21216
  const [sure, setSure] = (0, react.useState)(false);
@@ -21176,16 +21257,14 @@ window.__ModuleLoader__.load({
21176
21257
  ]
21177
21258
  });
21178
21259
  }
21179
- //#endregion
21180
- //#region src/shared/usage.ts
21260
+ // src/shared/usage.ts
21181
21261
  const addTokens = (a, b) => ({
21182
21262
  input: a.input + b.input,
21183
21263
  cached: a.cached + b.cached,
21184
21264
  output: a.output + b.output
21185
21265
  });
21186
21266
  const totalTokens = (count) => count.input + count.cached + count.output;
21187
- //#endregion
21188
- //#region src/client/chat-settings/ActivityList.tsx
21267
+ // src/client/chat-settings/ActivityList.tsx
21189
21268
  const seconds = (ms) => `${(ms / 1e3).toFixed(ms < 1e4 ? 1 : 0)} s`;
21190
21269
  const count = (value) => value.toLocaleString();
21191
21270
  /** Fresh input plus output, and what came from the service's cache beside it when there was any. */
@@ -21392,8 +21471,7 @@ window.__ModuleLoader__.load({
21392
21471
  })]
21393
21472
  ].join(" · ");
21394
21473
  }
21395
- //#endregion
21396
- //#region src/client/chat-settings/InterventionList.tsx
21474
+ // src/client/chat-settings/InterventionList.tsx
21397
21475
  /** What the story's triggers delivered lately, and whether the game master or the characters took it up, newest first. */
21398
21476
  function InterventionList({ t, entries }) {
21399
21477
  const shown = [...entries].reverse();
@@ -21426,8 +21504,7 @@ window.__ModuleLoader__.load({
21426
21504
  ]
21427
21505
  });
21428
21506
  }
21429
- //#endregion
21430
- //#region src/client/chat-settings/ChatSettingsView.tsx
21507
+ // src/client/chat-settings/ChatSettingsView.tsx
21431
21508
  /** The settings of one chat. Ordinary DSH chats have ids of the same shape, so the host decides whether this one is a roleplay session. */
21432
21509
  function ChatSettingsView({ t, sessionId, openChat }) {
21433
21510
  const session = roleplaySessionOf(sessionId);
@@ -22069,8 +22146,7 @@ window.__ModuleLoader__.load({
22069
22146
  saveFailed: "无法保存设置:{message}"
22070
22147
  }
22071
22148
  }, dictionaries$6), dictionaries$17);
22072
- //#endregion
22073
- //#region src/client/chat-settings/index.ts
22149
+ // src/client/chat-settings/index.ts
22074
22150
  const NAMESPACE$2 = "roleplay.chatSettings";
22075
22151
  const VIEW_ID = "roleplay-settings";
22076
22152
  /** The shell activates a data target for every view tab; this tab has no data, so its target is empty. */
@@ -22098,8 +22174,7 @@ window.__ModuleLoader__.load({
22098
22174
  }, ChatSettingsView));
22099
22175
  });
22100
22176
  }
22101
- //#endregion
22102
- //#region \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/settings/CatalogueSettings.module.css.mjs
22177
+ // \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/settings/CatalogueSettings.module.css.mjs
22103
22178
  const css$4 = ".rp_KPhXDa_section{flex-direction:column;gap:8px;margin-top:24px;display:flex}.rp_KPhXDa_title{margin:0;font-size:16px;font-weight:500;line-height:24px}.rp_KPhXDa_hint{color:var(--dsw-alias-label-secondary);margin:0;font-size:13px}.rp_KPhXDa_row{border-bottom:.5px solid var(--dsw-alias-border-l3);grid-template-columns:minmax(80px,1fr) minmax(160px,2fr) auto;align-items:end;gap:8px;padding-bottom:8px;display:grid}.rp_KPhXDa_field{flex-direction:column;gap:4px;min-width:0;display:flex}.rp_KPhXDa_label{color:var(--dsw-alias-label-tertiary);font-size:12px}.rp_KPhXDa_problem{color:var(--dsw-alias-state-error-primary);grid-column:1/-1;margin:0;font-size:12px}.rp_KPhXDa_keyHint{color:var(--dsw-alias-label-tertiary);grid-column:1/-1;margin:0;font-size:12px}.rp_KPhXDa_actions{flex-wrap:wrap;gap:8px;display:flex}.rp_KPhXDa_keyArea{grid-column:1/-1;grid-template-columns:minmax(120px,1fr) minmax(160px,2fr) auto;align-items:end;gap:8px;display:grid}@media (width<=720px){.rp_KPhXDa_row,.rp_KPhXDa_keyArea{grid-template-columns:minmax(0,1fr);align-items:stretch}.rp_KPhXDa_actions{justify-content:flex-start}}";
22104
22179
  const key$4 = "src/client/settings/CatalogueSettings.module.css";
22105
22180
  let tag$4 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$4) + "]");
@@ -22111,19 +22186,18 @@ window.__ModuleLoader__.load({
22111
22186
  }
22112
22187
  tag$4.textContent = css$4;
22113
22188
  var CatalogueSettings_module_css_default = {
22114
- "row": "rp_KPhXDa_row",
22115
- "keyArea": "rp_KPhXDa_keyArea",
22116
- "section": "rp_KPhXDa_section",
22189
+ "problem": "rp_KPhXDa_problem",
22190
+ "title": "rp_KPhXDa_title",
22117
22191
  "label": "rp_KPhXDa_label",
22118
- "actions": "rp_KPhXDa_actions",
22119
- "field": "rp_KPhXDa_field",
22192
+ "section": "rp_KPhXDa_section",
22120
22193
  "hint": "rp_KPhXDa_hint",
22194
+ "field": "rp_KPhXDa_field",
22121
22195
  "keyHint": "rp_KPhXDa_keyHint",
22122
- "problem": "rp_KPhXDa_problem",
22123
- "title": "rp_KPhXDa_title"
22196
+ "actions": "rp_KPhXDa_actions",
22197
+ "row": "rp_KPhXDa_row",
22198
+ "keyArea": "rp_KPhXDa_keyArea"
22124
22199
  };
22125
- //#endregion
22126
- //#region src/client/settings/AuthoringToolSettings.tsx
22200
+ // src/client/settings/AuthoringToolSettings.tsx
22127
22201
  const boardOf = (text) => {
22128
22202
  try {
22129
22203
  const parsed = JSON.parse(text === "" ? "{}" : text);
@@ -22198,8 +22272,7 @@ window.__ModuleLoader__.load({
22198
22272
  ]
22199
22273
  });
22200
22274
  }
22201
- //#endregion
22202
- //#region src/client/settings/assistants.ts
22275
+ // src/client/settings/assistants.ts
22203
22276
  /** The settings of the helper agents of imports and authoring: each is one field of the plugin's configuration, written only when it differs from the default. */
22204
22277
  const ASSISTANT_FIELDS = [
22205
22278
  {
@@ -22228,13 +22301,29 @@ window.__ModuleLoader__.load({
22228
22301
  max: 2,
22229
22302
  placeholder: "0.2"
22230
22303
  },
22304
+ {
22305
+ field: "importStructuredOutput",
22306
+ group: "assistants",
22307
+ kind: "choice",
22308
+ choices: ["tool", "schema"],
22309
+ labels: ["importStructuredTool", "importStructuredSchema"],
22310
+ placeholder: "schema"
22311
+ },
22231
22312
  {
22232
22313
  field: "importMaxTokens",
22233
22314
  group: "assistants",
22234
22315
  kind: "integer",
22235
- min: 1e3,
22236
- max: 2e5,
22237
- placeholder: "16000"
22316
+ min: 0,
22317
+ max: 1e6,
22318
+ placeholder: "0"
22319
+ },
22320
+ {
22321
+ field: "importVariablesPerRequest",
22322
+ group: "assistants",
22323
+ kind: "integer",
22324
+ min: 5,
22325
+ max: 500,
22326
+ placeholder: "25"
22238
22327
  },
22239
22328
  {
22240
22329
  field: "importTimeoutMinutes",
@@ -22326,8 +22415,7 @@ window.__ModuleLoader__.load({
22326
22415
  format: (value) => typeof value === "string" || typeof value === "number" ? String(value) : "",
22327
22416
  parse: (draft) => parseDraft(spec, draft)
22328
22417
  }));
22329
- //#endregion
22330
- //#region \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/settings/AssistantSettings.module.css.mjs
22418
+ // \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/settings/AssistantSettings.module.css.mjs
22331
22419
  const css$3 = ".rp_ZwzM4q_section{flex-direction:column;gap:8px;margin-top:24px;display:flex}.rp_ZwzM4q_title{margin:0;font-size:16px;font-weight:500;line-height:24px}.rp_ZwzM4q_hint,.rp_ZwzM4q_fieldHint,.rp_ZwzM4q_invalid{margin:0;font-size:12px;line-height:18px}.rp_ZwzM4q_hint{color:var(--dsw-alias-label-secondary);font-size:13px}.rp_ZwzM4q_fields{min-width:0}.rp_ZwzM4q_fields>*+*{border-top:.5px solid var(--dsw-alias-border-l2)}.rp_ZwzM4q_field{flex-direction:column;gap:6px;padding:12px 0;display:flex}.rp_ZwzM4q_head,.rp_ZwzM4q_badges{align-items:center;gap:8px;display:flex}.rp_ZwzM4q_label{min-width:0;color:var(--dsw-alias-label-primary);flex:1;font-size:13px;font-weight:500;line-height:20px}.rp_ZwzM4q_reset{color:var(--dsw-alias-label-secondary);font:inherit;cursor:pointer;background:0 0;border:0;padding:0;font-size:12px}.rp_ZwzM4q_reset:hover:not(:disabled){color:var(--dsw-alias-label-primary)}.rp_ZwzM4q_reset:focus-visible{outline:var(--dsw-focus-ring-width) solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));outline-offset:2px}.rp_ZwzM4q_select{border:.5px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-md);background:var(--dsw-alias-bg-layer-3);width:100%;height:34px;color:var(--dsw-alias-label-primary);font:inherit;padding:0 12px;font-size:13px}.rp_ZwzM4q_select:focus-visible{border-color:var(--dsw-alias-state-business-primary);outline:none}.rp_ZwzM4q_select[aria-invalid=true]{border-color:var(--dsw-alias-state-error-primary)}.rp_ZwzM4q_fieldHint{color:var(--dsw-alias-label-tertiary)}.rp_ZwzM4q_invalid{color:var(--dsw-alias-state-error-primary)}@media (width<=520px){.rp_ZwzM4q_head{align-items:flex-start}.rp_ZwzM4q_badges{flex-wrap:wrap;justify-content:flex-end}}";
22332
22420
  const key$3 = "src/client/settings/AssistantSettings.module.css";
22333
22421
  let tag$3 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$3) + "]");
@@ -22339,21 +22427,20 @@ window.__ModuleLoader__.load({
22339
22427
  }
22340
22428
  tag$3.textContent = css$3;
22341
22429
  var AssistantSettings_module_css_default = {
22430
+ "fieldHint": "rp_ZwzM4q_fieldHint",
22431
+ "field": "rp_ZwzM4q_field",
22432
+ "label": "rp_ZwzM4q_label",
22433
+ "hint": "rp_ZwzM4q_hint",
22342
22434
  "reset": "rp_ZwzM4q_reset",
22435
+ "head": "rp_ZwzM4q_head",
22436
+ "invalid": "rp_ZwzM4q_invalid",
22343
22437
  "fields": "rp_ZwzM4q_fields",
22344
- "field": "rp_ZwzM4q_field",
22345
22438
  "select": "rp_ZwzM4q_select",
22346
- "title": "rp_ZwzM4q_title",
22347
- "fieldHint": "rp_ZwzM4q_fieldHint",
22348
22439
  "section": "rp_ZwzM4q_section",
22349
- "head": "rp_ZwzM4q_head",
22350
22440
  "badges": "rp_ZwzM4q_badges",
22351
- "hint": "rp_ZwzM4q_hint",
22352
- "label": "rp_ZwzM4q_label",
22353
- "invalid": "rp_ZwzM4q_invalid"
22441
+ "title": "rp_ZwzM4q_title"
22354
22442
  };
22355
- //#endregion
22356
- //#region src/client/settings/AssistantSettings.tsx
22443
+ // src/client/settings/AssistantSettings.tsx
22357
22444
  function ChoiceField({ t, spec, state, disabled, onEdit, onReset }) {
22358
22445
  const id = `roleplay-${spec.field}`;
22359
22446
  const messageId = `${id}-message`;
@@ -22459,8 +22546,7 @@ window.__ModuleLoader__.load({
22459
22546
  ]
22460
22547
  });
22461
22548
  }
22462
- //#endregion
22463
- //#region src/client/settings/catalogue-keys-api.ts
22549
+ // src/client/settings/catalogue-keys-api.ts
22464
22550
  async function reply(response) {
22465
22551
  if (!response.ok) {
22466
22552
  const body = await response.json().catch(() => void 0);
@@ -22490,8 +22576,7 @@ window.__ModuleLoader__.load({
22490
22576
  window.dispatchEvent(new Event(CATALOGUE_KEYS_CHANGED));
22491
22577
  return status;
22492
22578
  }
22493
- //#endregion
22494
- //#region src/client/settings/catalogues.ts
22579
+ // src/client/settings/catalogues.ts
22495
22580
  /** The credential a row's key lives under, or nothing while the row has no name to derive it from. */
22496
22581
  const keyRefOf = (row) => row.apiKeyRef.trim() !== "" ? row.apiKeyRef.trim() : row.name.trim() === "" ? void 0 : catalogueKeyRef(row.name);
22497
22582
  const rowOf = (value) => {
@@ -22563,8 +22648,7 @@ window.__ModuleLoader__.load({
22563
22648
  }
22564
22649
  }
22565
22650
  };
22566
- //#endregion
22567
- //#region src/client/settings/CatalogueKey.tsx
22651
+ // src/client/settings/CatalogueKey.tsx
22568
22652
  const message$1 = (failure) => failure instanceof Error ? failure.message : String(failure);
22569
22653
  /**
22570
22654
  * The key of one catalogue: a name in the credential store and a write-only box. The key is kept by the store the profile uses
@@ -22703,8 +22787,7 @@ window.__ModuleLoader__.load({
22703
22787
  ]
22704
22788
  });
22705
22789
  }
22706
- //#endregion
22707
- //#region src/client/settings/CatalogueSettings.tsx
22790
+ // src/client/settings/CatalogueSettings.tsx
22708
22791
  const PROBLEM_TEXT$1 = {
22709
22792
  name: "catalogueProblemName",
22710
22793
  address: "catalogueProblemAddress",
@@ -22817,8 +22900,7 @@ window.__ModuleLoader__.load({
22817
22900
  ]
22818
22901
  });
22819
22902
  }
22820
- //#endregion
22821
- //#region src/client/settings/setup-api.ts
22903
+ // src/client/settings/setup-api.ts
22822
22904
  /** The ids of the plugin rows the profile holds more than once; empty when the profile is as it should be. */
22823
22905
  async function loadRedundantLayers(signal) {
22824
22906
  const response = await fetch(`${API_PREFIX}/setup`, {
@@ -22829,8 +22911,7 @@ window.__ModuleLoader__.load({
22829
22911
  const body = await response.json();
22830
22912
  return Array.isArray(body.redundantLayers) ? body.redundantLayers.filter((id) => typeof id === "string") : [];
22831
22913
  }
22832
- //#endregion
22833
- //#region src/client/settings/SetupNotice.tsx
22914
+ // src/client/settings/SetupNotice.tsx
22834
22915
  /** Says why the settings cannot be saved when the profile holds a plugin row twice; nothing is shown otherwise. */
22835
22916
  function SetupNotice({ t }) {
22836
22917
  const [rows, setRows] = (0, react.useState)([]);
@@ -22854,8 +22935,7 @@ window.__ModuleLoader__.load({
22854
22935
  ]
22855
22936
  });
22856
22937
  }
22857
- //#endregion
22858
- //#region src/client/settings/sync.ts
22938
+ // src/client/settings/sync.ts
22859
22939
  const text = (value) => typeof value === "string" ? value : "";
22860
22940
  function syncOf(value) {
22861
22941
  const row = typeof value === "object" && value !== null ? value : {};
@@ -22911,8 +22991,7 @@ window.__ModuleLoader__.load({
22911
22991
  };
22912
22992
  }
22913
22993
  };
22914
- //#endregion
22915
- //#region src/client/settings/SyncSettings.tsx
22994
+ // src/client/settings/SyncSettings.tsx
22916
22995
  const PROBLEM_TEXT = {
22917
22996
  remote: "syncProblemRemote",
22918
22997
  config: "syncProblemConfig",
@@ -23129,8 +23208,7 @@ window.__ModuleLoader__.load({
23129
23208
  ]
23130
23209
  });
23131
23210
  }
23132
- //#endregion
23133
- //#region src/client/settings/locales.ts
23211
+ // src/client/settings/locales.ts
23134
23212
  const dictionaries$1 = {
23135
23213
  en: {
23136
23214
  nav: "Role Play",
@@ -23178,7 +23256,13 @@ window.__ModuleLoader__.load({
23178
23256
  importTemperatureLabel: "Temperature",
23179
23257
  importTemperatureHint: "How freely they write, from 0 to 2. Low, because they copy and sort what a card says. Default 0.2.",
23180
23258
  importMaxTokensLabel: "Most tokens per request",
23181
- importMaxTokensHint: "The most one model request of a helper may produce, thinking included. Default 16000.",
23259
+ importMaxTokensHint: "The most one model request of a helper may produce, thinking included. 0 (the default) is a tenth of the model's context window, at least 16000.",
23260
+ importStructuredOutputLabel: "How helpers give their result",
23261
+ importStructuredOutputHint: "Call a tool (works with every model), or reply with JSON the endpoint constrains to the result's shape (the model cannot ramble first; needs an OpenAI-compatible endpoint that takes a JSON schema, such as LocalAI, vLLM or OpenAI). Default: the constrained JSON reply; a model whose endpoint refuses it is asked by a tool call from then on.",
23262
+ importStructuredTool: "Call a tool",
23263
+ importStructuredSchema: "Constrained JSON reply",
23264
+ importVariablesPerRequestLabel: "Tracked values per request",
23265
+ importVariablesPerRequestHint: "How many tracked values (meters, stats, flags) one request is asked to declare, 5 to 500. A card that tracks more is asked again for the rest. Default 25.",
23182
23266
  importTimeoutMinutesLabel: "Minutes before a helper is stopped",
23183
23267
  importTimeoutMinutesHint: "A helper that has not given its result after this long is stopped and the step reports why, so a run-away helper never holds an import for hours. 0 never stops it. Default 15.",
23184
23268
  importConcurrencyLabel: "Helpers at once",
@@ -23270,7 +23354,13 @@ window.__ModuleLoader__.load({
23270
23354
  importTemperatureLabel: "温度",
23271
23355
  importTemperatureHint: "它们写作的自由度,0 到 2。取低值,因为它们是在抄写和整理卡片的内容。默认 0.2。",
23272
23356
  importMaxTokensLabel: "每次请求的最大 token 数",
23273
- importMaxTokensHint: "助手一次模型请求最多产生的 token 数,包括思考。默认 16000。",
23357
+ importMaxTokensHint: "助手一次模型请求最多产生的 token 数,包括思考。0(默认)表示模型上下文窗口的十分之一,至少 16000。",
23358
+ importStructuredOutputLabel: "助手如何给出结果",
23359
+ importStructuredOutputHint: "调用工具(所有模型都可用),或用端点按结果结构约束的 JSON 回复(模型不会先写一大段分析;需要支持 JSON schema 的 OpenAI 兼容端点,如 LocalAI、vLLM 或 OpenAI)。默认:约束 JSON 回复;如果模型的端点不接受,之后会改用调用工具的方式。",
23360
+ importStructuredTool: "调用工具",
23361
+ importStructuredSchema: "约束 JSON 回复",
23362
+ importVariablesPerRequestLabel: "每次请求声明的追踪数值数",
23363
+ importVariablesPerRequestHint: "一次请求最多要求声明多少个追踪数值(量表、属性、标记),5 到 500。追踪更多的卡片会再次询问其余的。默认 25。",
23274
23364
  importTimeoutMinutesLabel: "助手的时限(分钟)",
23275
23365
  importTimeoutMinutesHint: "助手超过这个时间仍没有给出结果就会被停止,该步骤会说明原因,因此失控的助手不会让导入卡上几个小时。0 表示不限制。默认 15。",
23276
23366
  importConcurrencyLabel: "同时运行的助手数",
@@ -23326,8 +23416,7 @@ window.__ModuleLoader__.load({
23326
23416
  saving: t("saving")
23327
23417
  };
23328
23418
  }
23329
- //#endregion
23330
- //#region src/client/settings/RoleplaySection.tsx
23419
+ // src/client/settings/RoleplaySection.tsx
23331
23420
  function RoleplaySection(props) {
23332
23421
  const { t } = props;
23333
23422
  const state = props.useRoleplaySettings((snapshot) => snapshot);
@@ -23410,8 +23499,7 @@ window.__ModuleLoader__.load({
23410
23499
  })
23411
23500
  ] });
23412
23501
  }
23413
- //#endregion
23414
- //#region src/client/settings/settings-controller.ts
23502
+ // src/client/settings/settings-controller.ts
23415
23503
  /** Stages the role play settings form over the host plugin's configuration entry. */
23416
23504
  var RoleplaySettingsController = class {
23417
23505
  form;
@@ -23443,8 +23531,7 @@ window.__ModuleLoader__.load({
23443
23531
  this.form.dispose();
23444
23532
  }
23445
23533
  };
23446
- //#endregion
23447
- //#region src/client/settings/index.ts
23534
+ // src/client/settings/index.ts
23448
23535
  const NAMESPACE$1 = "roleplay.settings";
23449
23536
  /** Adds the Role Play section to the settings modal. */
23450
23537
  function registerSettings(ctx) {
@@ -23463,8 +23550,7 @@ window.__ModuleLoader__.load({
23463
23550
  inject: () => settings.inject()
23464
23551
  }, RoleplaySection))), "roleplay: settings section");
23465
23552
  }
23466
- //#endregion
23467
- //#region src/shared/narration.ts
23553
+ // src/shared/narration.ts
23468
23554
  const OPEN = "<roleplay-output>";
23469
23555
  const CLOSE = "</roleplay-output>";
23470
23556
  const PREVIEW_OPEN = "<roleplay-preview>";
@@ -23511,8 +23597,7 @@ window.__ModuleLoader__.load({
23511
23597
  return;
23512
23598
  }
23513
23599
  }
23514
- //#endregion
23515
- //#region src/client/transcript/definitions.ts
23600
+ // src/client/transcript/definitions.ts
23516
23601
  const NARRATION_NODE = "roleplay-narration";
23517
23602
  const PREVIEW_NODE = "roleplay-preview";
23518
23603
  /** The words of the text blocks of a message. */
@@ -23618,8 +23703,7 @@ window.__ModuleLoader__.load({
23618
23703
  };
23619
23704
  }
23620
23705
  };
23621
- //#endregion
23622
- //#region \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/transcript/NarrationView.module.css.mjs
23706
+ // \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/transcript/NarrationView.module.css.mjs
23623
23707
  const css$2 = ".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_playAll,.rp_NFPimG_playLine{color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:0;justify-content:center;align-items:center}.rp_NFPimG_playAll{float:right;gap:4px;min-height:28px;margin:0 0 8px 12px;padding:2px 4px;font-size:12px;display:inline-flex}.rp_NFPimG_playLine{vertical-align:middle;width:28px;height:28px;margin:-5px -6px -5px 4px;padding:6px;display:inline-flex}.rp_NFPimG_playAll svg,.rp_NFPimG_playLine svg{width:14px;height:14px}.rp_NFPimG_playAll:disabled,.rp_NFPimG_playLine:disabled{cursor:wait;opacity:.5}.rp_NFPimG_playAll:hover,.rp_NFPimG_playLine:hover{color:var(--dsw-alias-label-primary)}.rp_NFPimG_playAll:focus-visible,.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_playAll,.rp_NFPimG_playLine{min-width:44px;min-height:44px}.rp_NFPimG_playLine{width:44px;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}";
23624
23708
  const key$2 = "src/client/transcript/NarrationView.module.css";
23625
23709
  let tag$2 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$2) + "]");
@@ -23631,31 +23715,30 @@ window.__ModuleLoader__.load({
23631
23715
  }
23632
23716
  tag$2.textContent = css$2;
23633
23717
  var NarrationView_module_css_default = {
23634
- "oocLabel": "rp_NFPimG_oocLabel",
23635
- "oocRefused": "rp_NFPimG_oocRefused",
23636
- "imageButton": "rp_NFPimG_imageButton",
23637
- "imageStatus": "rp_NFPimG_imageStatus",
23718
+ "images": "rp_NFPimG_images",
23719
+ "preview": "rp_NFPimG_preview",
23638
23720
  "line": "rp_NFPimG_line",
23639
- "output": "rp_NFPimG_output",
23640
- "imageError": "rp_NFPimG_imageError",
23721
+ "words": "rp_NFPimG_words",
23722
+ "avatar": "rp_NFPimG_avatar",
23723
+ "playAll": "rp_NFPimG_playAll",
23641
23724
  "note": "rp_NFPimG_note",
23642
- "dice": "rp_NFPimG_dice",
23643
23725
  "diceSummary": "rp_NFPimG_diceSummary",
23644
23726
  "sceneImage": "rp_NFPimG_sceneImage",
23645
- "playAll": "rp_NFPimG_playAll",
23727
+ "oocNote": "rp_NFPimG_oocNote",
23728
+ "name": "rp_NFPimG_name",
23729
+ "imageButton": "rp_NFPimG_imageButton",
23646
23730
  "playLine": "rp_NFPimG_playLine",
23731
+ "oocRefused": "rp_NFPimG_oocRefused",
23732
+ "oocLabel": "rp_NFPimG_oocLabel",
23733
+ "imageStatus": "rp_NFPimG_imageStatus",
23734
+ "output": "rp_NFPimG_output",
23735
+ "imageError": "rp_NFPimG_imageError",
23736
+ "dice": "rp_NFPimG_dice",
23647
23737
  "diceList": "rp_NFPimG_diceList",
23648
23738
  "speech": "rp_NFPimG_speech",
23649
- "words": "rp_NFPimG_words",
23650
- "narration": "rp_NFPimG_narration",
23651
- "avatar": "rp_NFPimG_avatar",
23652
- "name": "rp_NFPimG_name",
23653
- "images": "rp_NFPimG_images",
23654
- "preview": "rp_NFPimG_preview",
23655
- "oocNote": "rp_NFPimG_oocNote"
23739
+ "narration": "rp_NFPimG_narration"
23656
23740
  };
23657
- //#endregion
23658
- //#region src/client/transcript/PreviewNode.tsx
23741
+ // src/client/transcript/PreviewNode.tsx
23659
23742
  /**
23660
23743
  * How the game master opened the scene while the rest of the turn was worked out. Once the output of the turn
23661
23744
  * has arrived (a later narration), the view no longer shows it: the log keeps both.
@@ -23671,8 +23754,7 @@ window.__ModuleLoader__.load({
23671
23754
  })
23672
23755
  });
23673
23756
  }
23674
- //#endregion
23675
- //#region src/client/transcript/NarrationView.tsx
23757
+ // src/client/transcript/NarrationView.tsx
23676
23758
  /** A steady colour per speaker, so a character looks the same wherever it speaks. */
23677
23759
  function hueOf(name) {
23678
23760
  let hash = 0;
@@ -23805,8 +23887,7 @@ window.__ModuleLoader__.load({
23805
23887
  ]
23806
23888
  });
23807
23889
  }
23808
- //#endregion
23809
- //#region src/client/transcript/SceneImages.tsx
23890
+ // src/client/transcript/SceneImages.tsx
23810
23891
  async function request(chat, node, method) {
23811
23892
  const id = roleplaySessionOf(chat);
23812
23893
  if (id === void 0) throw new Error("this chat is not a roleplay session");
@@ -23888,8 +23969,7 @@ window.__ModuleLoader__.load({
23888
23969
  ]
23889
23970
  });
23890
23971
  }
23891
- //#endregion
23892
- //#region src/client/transcript/NarrationNode.tsx
23972
+ // src/client/transcript/NarrationNode.tsx
23893
23973
  /** The output of a turn inside the normal Chat; the Chat gives its own translator, so ours comes from outside. */
23894
23974
  function narrationNode(t) {
23895
23975
  return function NarrationNode({ node, sessionId }) {
@@ -23904,8 +23984,7 @@ window.__ModuleLoader__.load({
23904
23984
  })] });
23905
23985
  };
23906
23986
  }
23907
- //#endregion
23908
- //#region \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/transcript/SuggestionsDock.module.css.mjs
23987
+ // \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/transcript/SuggestionsDock.module.css.mjs
23909
23988
  const css$1 = ".rp_rWH4DG_dock{box-sizing:border-box;flex-direction:column;align-items:stretch;gap:4px;width:min(800px,100%);min-width:0;margin:0 auto 8px;padding:0 16px;display:flex}.rp_rWH4DG_label{color:var(--dsw-alias-label-tertiary);flex:none;font-size:12px}.rp_rWH4DG_chip{border:.5px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-md);background:var(--dsw-alias-bg-layer-1);width:100%;min-height:32px;color:var(--dsw-alias-label-secondary);font:inherit;text-align:left;cursor:pointer;overflow-wrap:anywhere;padding:5px 10px;font-size:13px;line-height:20px}.rp_rWH4DG_chip:hover,.rp_rWH4DG_chip:focus-visible{border-color:var(--dsw-alias-state-business-primary);color:var(--dsw-alias-state-business-primary);outline:none}.rp_rWH4DG_card{border:.5px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-lg);background:var(--dsw-alias-bg-layer-2);flex-direction:column;gap:2px;padding:6px 10px;display:flex}.rp_rWH4DG_lines{color:var(--dsw-alias-label-secondary);overflow-wrap:anywhere;margin:0;padding-left:16px;font-size:13px;line-height:20px}@media (pointer:coarse){.rp_rWH4DG_chip{min-height:44px}}";
23910
23989
  const key$1 = "src/client/transcript/SuggestionsDock.module.css";
23911
23990
  let tag$1 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$1) + "]");
@@ -23917,14 +23996,13 @@ window.__ModuleLoader__.load({
23917
23996
  }
23918
23997
  tag$1.textContent = css$1;
23919
23998
  var SuggestionsDock_module_css_default = {
23920
- "dock": "rp_rWH4DG_dock",
23999
+ "lines": "rp_rWH4DG_lines",
23921
24000
  "card": "rp_rWH4DG_card",
23922
- "chip": "rp_rWH4DG_chip",
23923
24001
  "label": "rp_rWH4DG_label",
23924
- "lines": "rp_rWH4DG_lines"
24002
+ "chip": "rp_rWH4DG_chip",
24003
+ "dock": "rp_rWH4DG_dock"
23925
24004
  };
23926
- //#endregion
23927
- //#region src/client/transcript/SuggestionsDock.tsx
24005
+ // src/client/transcript/SuggestionsDock.tsx
23928
24006
  /** The suggestions are made after the output is shown, so they are asked for until they are there. */
23929
24007
  const POLL_MS = 2e3;
23930
24008
  const GIVE_UP_AFTER = 45;
@@ -24028,8 +24106,7 @@ window.__ModuleLoader__.load({
24028
24106
  ]
24029
24107
  });
24030
24108
  }
24031
- //#endregion
24032
- //#region \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/transcript/TurnsDock.module.css.mjs
24109
+ // \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/transcript/TurnsDock.module.css.mjs
24033
24110
  const css = ".rp_f4YLlq_dock{box-sizing:border-box;width:min(800px,100%);min-width:0;color:var(--dsw-alias-label-tertiary);flex-wrap:wrap;align-items:center;gap:4px 8px;margin:0 auto 8px;padding:0 16px;font-size:12px;display:flex}.rp_f4YLlq_group{align-items:center;gap:2px;display:flex}.rp_f4YLlq_button{border:.5px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);min-height:28px;color:var(--dsw-alias-label-secondary);font:inherit;cursor:pointer;background:0 0;padding:2px 10px;line-height:18px}.rp_f4YLlq_button:hover:not(:disabled),.rp_f4YLlq_button:focus-visible{border-color:var(--dsw-alias-state-business-primary);color:var(--dsw-alias-state-business-primary);outline:none}.rp_f4YLlq_button:disabled{opacity:.5;cursor:default}.rp_f4YLlq_count{text-align:center;min-width:32px}.rp_f4YLlq_select{border:.5px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);min-width:96px;max-width:220px;min-height:28px;color:var(--dsw-alias-label-secondary);font:inherit;background:0 0;padding:2px 6px}.rp_f4YLlq_error{color:var(--dsw-alias-state-error-primary)}@media (pointer:coarse){.rp_f4YLlq_button,.rp_f4YLlq_select{min-height:44px}}";
24034
24111
  const key = "src/client/transcript/TurnsDock.module.css";
24035
24112
  let tag = document.querySelector("style[data-plugin-css=" + JSON.stringify(key) + "]");
@@ -24041,22 +24118,20 @@ window.__ModuleLoader__.load({
24041
24118
  }
24042
24119
  tag.textContent = css;
24043
24120
  var TurnsDock_module_css_default = {
24121
+ "error": "rp_f4YLlq_error",
24044
24122
  "dock": "rp_f4YLlq_dock",
24045
- "select": "rp_f4YLlq_select",
24046
24123
  "count": "rp_f4YLlq_count",
24047
- "group": "rp_f4YLlq_group",
24048
24124
  "button": "rp_f4YLlq_button",
24049
- "error": "rp_f4YLlq_error"
24125
+ "select": "rp_f4YLlq_select",
24126
+ "group": "rp_f4YLlq_group"
24050
24127
  };
24051
- //#endregion
24052
- //#region src/client/transcript/withdrawn.ts
24128
+ // src/client/transcript/withdrawn.ts
24053
24129
  /** The rows of the transcript that belong to turns the story is not at, by the key DSH gives each row. */
24054
24130
  function withdrawnKeys(nodes, withdrawn) {
24055
24131
  if (withdrawn.length === 0) return [];
24056
24132
  return [...nodes].flatMap((node) => node.key !== void 0 && node.anchorSeq !== void 0 && withdrawn.some((range) => node.anchorSeq >= range.from && node.anchorSeq <= range.to) ? [node.key] : []);
24057
24133
  }
24058
- //#endregion
24059
- //#region src/client/transcript/TurnsDock.tsx
24134
+ // src/client/transcript/TurnsDock.tsx
24060
24135
  const START = "start";
24061
24136
  const LABEL_LENGTH = 40;
24062
24137
  const escapeAttribute = (value) => value.replace(/["\\]/g, (match) => `\\${match}`);
@@ -24231,8 +24306,7 @@ window.__ModuleLoader__.load({
24231
24306
  ]
24232
24307
  });
24233
24308
  }
24234
- //#endregion
24235
- //#region src/client/transcript/locales.ts
24309
+ // src/client/transcript/locales.ts
24236
24310
  const dictionaries = {
24237
24311
  en: {
24238
24312
  unwritten: "{count} round(s) not yet written into the story's memory",
@@ -24315,8 +24389,7 @@ window.__ModuleLoader__.load({
24315
24389
  dicePlayer: "你掷出:"
24316
24390
  }
24317
24391
  };
24318
- //#endregion
24319
- //#region src/client/transcript/index.ts
24392
+ // src/client/transcript/index.ts
24320
24393
  const NAMESPACE = "roleplay.transcript";
24321
24394
  /** The turns of a roleplay session, as the host keeps them. */
24322
24395
  async function timelineOf(chat) {
@@ -24401,8 +24474,7 @@ window.__ModuleLoader__.load({
24401
24474
  }, narrationNode(t)));
24402
24475
  });
24403
24476
  }
24404
- //#endregion
24405
- //#region src/client/index.ts
24477
+ // src/client/index.ts
24406
24478
  /** Union of what every feature needs. */
24407
24479
  const inject = [
24408
24480
  "slots",
@@ -24426,7 +24498,6 @@ window.__ModuleLoader__.load({
24426
24498
  registerInterface(ctx);
24427
24499
  registerBranchNaming(ctx);
24428
24500
  }
24429
- //#endregion
24430
24501
  exports.apply = apply;
24431
24502
  exports.inject = inject;
24432
24503
  return module.exports;