@dsh-agentic-roleplay/core 0.1.1 → 0.2.1

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 (40) hide show
  1. package/README.md +1 -1
  2. package/lib/{activity-BbqFG9-3.js → activity-t7OBgHlc.js} +255 -61
  3. package/lib/authoring.js +295 -14
  4. package/lib/client.js +1896 -453
  5. package/lib/client.js.map +1 -1
  6. package/lib/compaction.js +1 -1
  7. package/lib/{documents-ZVoUTnD2.js → documents-Bu5uYRZB.js} +3 -3
  8. package/lib/{gallery-KGCdeCnM.js → gallery-DUeBMHQX.js} +2 -2
  9. package/lib/{generator-NYnNdpWb.js → generator-HPifO3Kk.js} +125 -20
  10. package/lib/images.js +3 -3
  11. package/lib/index.js +638 -14
  12. package/lib/{narration-DcnCqA1l.js → narration-BRyHU0H2.js} +10 -4
  13. package/lib/orchestration.js +303 -161
  14. package/lib/packs-ByP1J-zj.js +1334 -0
  15. package/lib/{presenter-agent-7j1c7QEz.js → presenter-agent-G43ODV8I.js} +3 -3
  16. package/package.json +4 -3
  17. package/prompts/en/roleplay/ask-answerer.md +3 -0
  18. package/prompts/en/roleplay/ask-question.md +2 -0
  19. package/prompts/en/roleplay/character-decide.md +1 -1
  20. package/prompts/en/roleplay/character-lookup.md +1 -1
  21. package/prompts/en/roleplay/game-master.md +5 -1
  22. package/prompts/en/roleplay/ooc-empty.md +1 -1
  23. package/prompts/en/world/procedure.md +1 -1
  24. package/prompts/zh/roleplay/ask-answerer.md +3 -0
  25. package/prompts/zh/roleplay/ask-question.md +2 -0
  26. package/prompts/zh/roleplay/character-decide.md +1 -1
  27. package/prompts/zh/roleplay/character-lookup.md +1 -1
  28. package/prompts/zh/roleplay/game-master.md +5 -1
  29. package/prompts/zh/roleplay/ooc-empty.md +1 -1
  30. package/prompts/zh/world/procedure.md +1 -1
  31. package/starter-worlds/blackwater-observatory/ui/notebook/map.html +12 -0
  32. package/starter-worlds/blackwater-observatory/ui/notebook/map.js +40 -0
  33. package/starter-worlds/blackwater-observatory/ui/notebook/notebook.html +29 -0
  34. package/starter-worlds/blackwater-observatory/ui/notebook/notebook.js +45 -0
  35. package/starter-worlds/blackwater-observatory/ui/notebook/pack.json +31 -0
  36. package/starter-worlds/blackwater-observatory/ui/notebook/skin.css +16 -0
  37. package/starter-worlds/blackwater-observatory/ui/notebook/strip.html +11 -0
  38. package/starter-worlds/blackwater-observatory/ui/notebook/strip.js +12 -0
  39. package/starter-worlds/blackwater-observatory/ui/notebook/style.css +23 -0
  40. package/lib/worlds-DYgjdH8O.js +0 -504
package/lib/client.js CHANGED
@@ -9,6 +9,7 @@ window.__ModuleLoader__.load({
9
9
  let react = require("react");
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
+ let react_dom = require("react-dom");
12
13
  //#region src/shared/ids.ts
13
14
  /**
14
15
  * Profile entry id of the core plugin's row. Settings forms are addressed by
@@ -25,19 +26,19 @@ window.__ModuleLoader__.load({
25
26
  }
26
27
  //#endregion
27
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
28
- const css$21 = ".rp_Poldga_tabs{gap:24px;margin-bottom:-1px;display:flex}.rp_Poldga_tab{font:inherit;color:var(--dsw-alias-label-secondary);cursor:pointer;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)}";
29
- const key$21 = "src/client/panel/PageTabs.module.css";
30
- let tag$21 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$21) + "]");
31
- if (tag$21 === null) {
32
- tag$21 = document.createElement("style");
33
- tag$21.dataset.plugin = "@dsh-agentic-roleplay/core";
34
- tag$21.dataset.pluginCss = key$21;
35
- document.head.appendChild(tag$21);
36
- }
37
- tag$21.textContent = css$21;
29
+ const css$23 = ".rp_Poldga_tabs{gap:24px;margin-bottom:-1px;display:flex}.rp_Poldga_tab{font:inherit;color:var(--dsw-alias-label-secondary);cursor:pointer;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
+ const key$23 = "src/client/panel/PageTabs.module.css";
31
+ let tag$23 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$23) + "]");
32
+ if (tag$23 === null) {
33
+ tag$23 = document.createElement("style");
34
+ tag$23.dataset.plugin = "@dsh-agentic-roleplay/core";
35
+ tag$23.dataset.pluginCss = key$23;
36
+ document.head.appendChild(tag$23);
37
+ }
38
+ tag$23.textContent = css$23;
38
39
  var PageTabs_module_css_default = {
39
- "tab": "rp_Poldga_tab",
40
- "tabs": "rp_Poldga_tabs"
40
+ "tabs": "rp_Poldga_tabs",
41
+ "tab": "rp_Poldga_tab"
41
42
  };
42
43
  //#endregion
43
44
  //#region src/client/panel/PageTabs.tsx
@@ -81,21 +82,21 @@ window.__ModuleLoader__.load({
81
82
  }
82
83
  //#endregion
83
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
84
- const css$20 = ".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:1px 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}";
85
- const key$20 = "src/client/panel/RoleplayPanel.module.css";
86
- let tag$20 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$20) + "]");
87
- if (tag$20 === null) {
88
- tag$20 = document.createElement("style");
89
- tag$20.dataset.plugin = "@dsh-agentic-roleplay/core";
90
- tag$20.dataset.pluginCss = key$20;
91
- document.head.appendChild(tag$20);
92
- }
93
- tag$20.textContent = css$20;
85
+ const css$22 = ".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:1px 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}";
86
+ const key$22 = "src/client/panel/RoleplayPanel.module.css";
87
+ let tag$22 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$22) + "]");
88
+ if (tag$22 === null) {
89
+ tag$22 = document.createElement("style");
90
+ tag$22.dataset.plugin = "@dsh-agentic-roleplay/core";
91
+ tag$22.dataset.pluginCss = key$22;
92
+ document.head.appendChild(tag$22);
93
+ }
94
+ tag$22.textContent = css$22;
94
95
  var RoleplayPanel_module_css_default = {
95
- "title": "rp_ua5gBa_title",
96
96
  "panel": "rp_ua5gBa_panel",
97
- "body": "rp_ua5gBa_body",
98
- "header": "rp_ua5gBa_header"
97
+ "title": "rp_ua5gBa_title",
98
+ "header": "rp_ua5gBa_header",
99
+ "body": "rp_ua5gBa_body"
99
100
  };
100
101
  //#endregion
101
102
  //#region src/client/panel/RoleplayPanel.tsx
@@ -142,7 +143,7 @@ window.__ModuleLoader__.load({
142
143
  }
143
144
  //#endregion
144
145
  //#region src/client/panel/locales.ts
145
- const dictionaries$10 = {
146
+ const dictionaries$11 = {
146
147
  en: {
147
148
  label: "Role Play",
148
149
  heading: "DSH Agentic Role Play",
@@ -199,11 +200,11 @@ window.__ModuleLoader__.load({
199
200
  }
200
201
  //#endregion
201
202
  //#region src/client/panel/index.ts
202
- const NAMESPACE$9 = "roleplay.panel";
203
+ const NAMESPACE$10 = "roleplay.panel";
203
204
  /** Adds the Role Play entry to the sidebar and the main panel it opens. */
204
205
  function registerPanel(ctx) {
205
- const t = ctx.locale.bind(NAMESPACE$9);
206
- ctx.effect(() => ctx.locale.register(NAMESPACE$9, dictionaries$10), "roleplay: panel dictionaries");
206
+ const t = ctx.locale.bind(NAMESPACE$10);
207
+ ctx.effect(() => ctx.locale.register(NAMESPACE$10, dictionaries$11), "roleplay: panel dictionaries");
207
208
  const pages = createPagesSource(ctx);
208
209
  ctx.effect(() => pages.start(), "roleplay: page list");
209
210
  const handle = createPanelStore();
@@ -215,7 +216,7 @@ window.__ModuleLoader__.load({
215
216
  ctx.slots.inject("main", () => ctx.slots.register({
216
217
  name: "main",
217
218
  key: PANEL_ID,
218
- locale: NAMESPACE$9,
219
+ locale: NAMESPACE$10,
219
220
  store,
220
221
  inject: () => ({ hooks: { pages: pages.store } }),
221
222
  children: { "roleplay.page": {
@@ -228,7 +229,7 @@ window.__ModuleLoader__.load({
228
229
  id: PANEL_ID,
229
230
  order: 5,
230
231
  label: () => t("label"),
231
- locale: NAMESPACE$9
232
+ locale: NAMESPACE$10
232
233
  }, PanelIcon));
233
234
  }
234
235
  //#endregion
@@ -733,51 +734,51 @@ window.__ModuleLoader__.load({
733
734
  const isDirty = (character, draft) => Object.keys(editOf$1(character, draft)).length > 0;
734
735
  //#endregion
735
736
  //#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
736
- const css$19 = ".rp_5ZMIxq_panel{flex-direction:column;flex:1 1 0;min-height:0;display:flex}.rp_5ZMIxq_tabs{border-bottom:1px 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:1px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);width:150px;height:auto;display:block}.rp_5ZMIxq_portraitBox{border-radius:var(--dsw-radius-sm);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-sm) var(--dsw-radius-sm);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:1px 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:1px 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{font-size:16px;font-weight:500}.rp_5ZMIxq_row{flex-wrap:wrap;align-items:center;gap:8px;display:flex}.rp_5ZMIxq_grid{grid-template-columns:repeat(auto-fill,minmax(160px,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:1px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);width:100%;min-height:32px;color:inherit;font:inherit;background:0 0;padding:4px 8px;font-size:13px}.rp_5ZMIxq_area{box-sizing:border-box;border:1px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);width:100%;color:inherit;font:inherit;resize:vertical;background:0 0;padding:6px 8px;font-size:13px;line-height:20px}.rp_5ZMIxq_goal{border:1px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-sm);flex-direction:column;gap:8px;padding:10px;display:flex}.rp_5ZMIxq_row>.rp_5ZMIxq_select{width:auto;min-width:110px}";
737
- const key$19 = "src/client/world-editor/CharactersPanel.module.css";
738
- let tag$19 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$19) + "]");
739
- if (tag$19 === null) {
740
- tag$19 = document.createElement("style");
741
- tag$19.dataset.plugin = "@dsh-agentic-roleplay/core";
742
- tag$19.dataset.pluginCss = key$19;
743
- document.head.appendChild(tag$19);
737
+ const css$21 = ".rp_5ZMIxq_panel{flex-direction:column;flex:1 1 0;min-height:0;display:flex}.rp_5ZMIxq_tabs{border-bottom:1px 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:1px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);width:150px;height:auto;display:block}.rp_5ZMIxq_portraitBox{border-radius:var(--dsw-radius-sm);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-sm) var(--dsw-radius-sm);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:1px 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:1px 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{font-size:16px;font-weight:500}.rp_5ZMIxq_row{flex-wrap:wrap;align-items:center;gap:8px;display:flex}.rp_5ZMIxq_grid{grid-template-columns:repeat(auto-fill,minmax(160px,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:1px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);width:100%;min-height:32px;color:inherit;font:inherit;background:0 0;padding:4px 8px;font-size:13px}.rp_5ZMIxq_area{box-sizing:border-box;border:1px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);width:100%;color:inherit;font:inherit;resize:vertical;background:0 0;padding:6px 8px;font-size:13px;line-height:20px}.rp_5ZMIxq_goal{border:1px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-sm);flex-direction:column;gap:8px;padding:10px;display:flex}.rp_5ZMIxq_row>.rp_5ZMIxq_select{width:auto;min-width:110px}";
738
+ const key$21 = "src/client/world-editor/CharactersPanel.module.css";
739
+ let tag$21 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$21) + "]");
740
+ if (tag$21 === null) {
741
+ tag$21 = document.createElement("style");
742
+ tag$21.dataset.plugin = "@dsh-agentic-roleplay/core";
743
+ tag$21.dataset.pluginCss = key$21;
744
+ document.head.appendChild(tag$21);
744
745
  }
745
- tag$19.textContent = css$19;
746
+ tag$21.textContent = css$21;
746
747
  var CharactersPanel_module_css_default = {
747
- "missing": "rp_5ZMIxq_missing",
748
- "nameInput": "rp_5ZMIxq_nameInput",
749
- "tabsSpace": "rp_5ZMIxq_tabsSpace",
750
- "portraitAction": "rp_5ZMIxq_portraitAction",
751
- "empty": "rp_5ZMIxq_empty",
752
- "portraitHint": "rp_5ZMIxq_portraitHint",
753
748
  "panel": "rp_5ZMIxq_panel",
749
+ "sheet": "rp_5ZMIxq_sheet",
750
+ "body": "rp_5ZMIxq_body",
751
+ "portraitError": "rp_5ZMIxq_portraitError",
754
752
  "placeholder": "rp_5ZMIxq_placeholder",
755
- "grid": "rp_5ZMIxq_grid",
756
- "portraitBox": "rp_5ZMIxq_portraitBox",
757
- "tabs": "rp_5ZMIxq_tabs",
758
- "field": "rp_5ZMIxq_field",
753
+ "tabOn": "rp_5ZMIxq_tabOn",
759
754
  "meta": "rp_5ZMIxq_meta",
760
- "sectionTitle": "rp_5ZMIxq_sectionTitle",
761
- "section": "rp_5ZMIxq_section",
762
- "portraitError": "rp_5ZMIxq_portraitError",
763
- "area": "rp_5ZMIxq_area",
764
- "goal": "rp_5ZMIxq_goal",
765
- "error": "rp_5ZMIxq_error",
755
+ "head": "rp_5ZMIxq_head",
766
756
  "barText": "rp_5ZMIxq_barText",
767
- "body": "rp_5ZMIxq_body",
757
+ "portraitAction": "rp_5ZMIxq_portraitAction",
758
+ "initial": "rp_5ZMIxq_initial",
759
+ "missing": "rp_5ZMIxq_missing",
760
+ "tabsSpace": "rp_5ZMIxq_tabsSpace",
768
761
  "voiceInline": "rp_5ZMIxq_voiceInline",
769
- "tab": "rp_5ZMIxq_tab",
770
- "sheet": "rp_5ZMIxq_sheet",
771
- "row": "rp_5ZMIxq_row",
762
+ "goal": "rp_5ZMIxq_goal",
763
+ "grid": "rp_5ZMIxq_grid",
764
+ "portrait": "rp_5ZMIxq_portrait",
765
+ "empty": "rp_5ZMIxq_empty",
766
+ "portraitBox": "rp_5ZMIxq_portraitBox",
767
+ "bar": "rp_5ZMIxq_bar",
768
+ "field": "rp_5ZMIxq_field",
772
769
  "label": "rp_5ZMIxq_label",
773
- "tabOn": "rp_5ZMIxq_tabOn",
770
+ "sectionTitle": "rp_5ZMIxq_sectionTitle",
774
771
  "help": "rp_5ZMIxq_help",
775
772
  "select": "rp_5ZMIxq_select",
776
- "portrait": "rp_5ZMIxq_portrait",
777
- "head": "rp_5ZMIxq_head",
773
+ "nameInput": "rp_5ZMIxq_nameInput",
774
+ "row": "rp_5ZMIxq_row",
775
+ "error": "rp_5ZMIxq_error",
776
+ "area": "rp_5ZMIxq_area",
778
777
  "wide": "rp_5ZMIxq_wide",
779
- "bar": "rp_5ZMIxq_bar",
780
- "initial": "rp_5ZMIxq_initial"
778
+ "portraitHint": "rp_5ZMIxq_portraitHint",
779
+ "tabs": "rp_5ZMIxq_tabs",
780
+ "tab": "rp_5ZMIxq_tab",
781
+ "section": "rp_5ZMIxq_section"
781
782
  };
782
783
  //#endregion
783
784
  //#region src/client/world-editor/CharactersPanel.tsx
@@ -2335,50 +2336,50 @@ window.__ModuleLoader__.load({
2335
2336
  }
2336
2337
  //#endregion
2337
2338
  //#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
2338
- const css$18 = ".rp_7pEHTW_panel{flex-direction:column;flex:1 1 0;min-height:0;display:flex;position:relative}.rp_7pEHTW_toolbar{border-bottom:1px solid var(--dsw-alias-border-l2);align-items:center;gap:4px;padding:8px 16px;display:flex}.rp_7pEHTW_filter{border-radius:var(--dsw-radius-sm);color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:0;padding:5px 9px}.rp_7pEHTW_filterOn{color:var(--dsw-alias-state-business-primary);background:var(--dsw-alias-bg-layer-2)}.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:1px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);max-width:150px;color:inherit;background:0 0;padding:4px 6px}.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:1px solid var(--dsw-alias-border-l3);overflow-y:auto}.rp_7pEHTW_edge{border:0;border-bottom:1px solid var(--dsw-alias-border-l4);width:100%;color:inherit;text-align:left;cursor:pointer;background:0 0;flex-direction:column;gap:2px;padding:10px 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:11px}.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:17px}.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:1px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);width:100%;color:inherit;font:inherit;background:0 0;padding:7px 9px}.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:1px solid var(--dsw-alias-border-l4);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:11px}.rp_7pEHTW_graphInspector{box-sizing:border-box;border:1px solid var(--dsw-alias-border-l2);border-radius:var(--dsw-radius-md);background:var(--dsw-alias-bg-layer-1);width:min(480px,100% - 40px);max-height:62%;padding:18px;position:absolute;bottom:20px;right:20px;overflow-y:auto;box-shadow:0 8px 30px #0000002e}@media (width<=760px){.rp_7pEHTW_workspace{grid-template-columns:1fr}.rp_7pEHTW_list{border-right:0;border-bottom:1px solid var(--dsw-alias-border-l3);max-height:220px}.rp_7pEHTW_metrics{grid-template-columns:repeat(2,1fr)}}";
2339
- const key$18 = "src/client/world-editor/RelationsPanel.module.css";
2340
- let tag$18 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$18) + "]");
2341
- if (tag$18 === null) {
2342
- tag$18 = document.createElement("style");
2343
- tag$18.dataset.plugin = "@dsh-agentic-roleplay/core";
2344
- tag$18.dataset.pluginCss = key$18;
2345
- document.head.appendChild(tag$18);
2339
+ const css$20 = ".rp_7pEHTW_panel{flex-direction:column;flex:1 1 0;min-height:0;display:flex;position:relative}.rp_7pEHTW_toolbar{border-bottom:1px solid var(--dsw-alias-border-l2);align-items:center;gap:4px;padding:8px 16px;display:flex}.rp_7pEHTW_filter{border-radius:var(--dsw-radius-sm);color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:0;padding:5px 9px}.rp_7pEHTW_filterOn{color:var(--dsw-alias-state-business-primary);background:var(--dsw-alias-bg-layer-2)}.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:1px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);max-width:150px;color:inherit;background:0 0;padding:4px 6px}.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:1px solid var(--dsw-alias-border-l3);overflow-y:auto}.rp_7pEHTW_edge{border:0;border-bottom:1px solid var(--dsw-alias-border-l4);width:100%;color:inherit;text-align:left;cursor:pointer;background:0 0;flex-direction:column;gap:2px;padding:10px 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:11px}.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:17px}.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:1px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);width:100%;color:inherit;font:inherit;background:0 0;padding:7px 9px}.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:1px solid var(--dsw-alias-border-l4);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:11px}.rp_7pEHTW_graphInspector{box-sizing:border-box;border:1px solid var(--dsw-alias-border-l2);border-radius:var(--dsw-radius-md);background:var(--dsw-alias-bg-layer-1);width:min(480px,100% - 40px);max-height:62%;padding:18px;position:absolute;bottom:20px;right:20px;overflow-y:auto;box-shadow:0 8px 30px #0000002e}@media (width<=760px){.rp_7pEHTW_workspace{grid-template-columns:1fr}.rp_7pEHTW_list{border-right:0;border-bottom:1px solid var(--dsw-alias-border-l3);max-height:220px}.rp_7pEHTW_metrics{grid-template-columns:repeat(2,1fr)}}";
2340
+ const key$20 = "src/client/world-editor/RelationsPanel.module.css";
2341
+ let tag$20 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$20) + "]");
2342
+ if (tag$20 === null) {
2343
+ tag$20 = document.createElement("style");
2344
+ tag$20.dataset.plugin = "@dsh-agentic-roleplay/core";
2345
+ tag$20.dataset.pluginCss = key$20;
2346
+ document.head.appendChild(tag$20);
2346
2347
  }
2347
- tag$18.textContent = css$18;
2348
+ tag$20.textContent = css$20;
2348
2349
  var RelationsPanel_module_css_default = {
2350
+ "status": "rp_7pEHTW_status",
2351
+ "error": "rp_7pEHTW_error",
2349
2352
  "space": "rp_7pEHTW_space",
2350
- "perspective": "rp_7pEHTW_perspective",
2351
2353
  "edgeKind": "rp_7pEHTW_edgeKind",
2352
- "head": "rp_7pEHTW_head",
2353
- "form": "rp_7pEHTW_form",
2354
- "actions": "rp_7pEHTW_actions",
2355
- "graphInspector": "rp_7pEHTW_graphInspector",
2356
2354
  "graph": "rp_7pEHTW_graph",
2355
+ "toolbar": "rp_7pEHTW_toolbar",
2356
+ "node_character": "rp_7pEHTW_node_character",
2357
+ "empty": "rp_7pEHTW_empty",
2358
+ "graphInspector": "rp_7pEHTW_graphInspector",
2357
2359
  "node_location": "rp_7pEHTW_node_location",
2358
- "node": "rp_7pEHTW_node",
2359
- "entities": "rp_7pEHTW_entities",
2360
- "node_item": "rp_7pEHTW_node_item",
2360
+ "head": "rp_7pEHTW_head",
2361
2361
  "node_faction": "rp_7pEHTW_node_faction",
2362
- "filter": "rp_7pEHTW_filter",
2363
- "status": "rp_7pEHTW_status",
2364
- "graphEdgeOn": "rp_7pEHTW_graphEdgeOn",
2365
- "edgeOn": "rp_7pEHTW_edgeOn",
2366
- "metrics": "rp_7pEHTW_metrics",
2362
+ "list": "rp_7pEHTW_list",
2367
2363
  "edgeTitle": "rp_7pEHTW_edgeTitle",
2368
- "error": "rp_7pEHTW_error",
2369
- "panel": "rp_7pEHTW_panel",
2364
+ "node_item": "rp_7pEHTW_node_item",
2365
+ "graphEdge": "rp_7pEHTW_graphEdge",
2366
+ "workspace": "rp_7pEHTW_workspace",
2370
2367
  "edge": "rp_7pEHTW_edge",
2368
+ "edgeOn": "rp_7pEHTW_edgeOn",
2369
+ "entities": "rp_7pEHTW_entities",
2370
+ "node": "rp_7pEHTW_node",
2371
2371
  "notice": "rp_7pEHTW_notice",
2372
- "empty": "rp_7pEHTW_empty",
2373
2372
  "wide": "rp_7pEHTW_wide",
2373
+ "perspective": "rp_7pEHTW_perspective",
2374
+ "actions": "rp_7pEHTW_actions",
2375
+ "graphEdgeOn": "rp_7pEHTW_graphEdgeOn",
2376
+ "form": "rp_7pEHTW_form",
2374
2377
  "inspector": "rp_7pEHTW_inspector",
2375
- "list": "rp_7pEHTW_list",
2376
- "graphEdge": "rp_7pEHTW_graphEdge",
2377
- "toolbar": "rp_7pEHTW_toolbar",
2378
- "check": "rp_7pEHTW_check",
2379
- "workspace": "rp_7pEHTW_workspace",
2380
- "node_character": "rp_7pEHTW_node_character",
2381
- "filterOn": "rp_7pEHTW_filterOn"
2378
+ "filterOn": "rp_7pEHTW_filterOn",
2379
+ "filter": "rp_7pEHTW_filter",
2380
+ "panel": "rp_7pEHTW_panel",
2381
+ "metrics": "rp_7pEHTW_metrics",
2382
+ "check": "rp_7pEHTW_check"
2382
2383
  };
2383
2384
  //#endregion
2384
2385
  //#region src/client/world-editor/RelationsPanel.tsx
@@ -3503,7 +3504,7 @@ window.__ModuleLoader__.load({
3503
3504
  }
3504
3505
  //#endregion
3505
3506
  //#region src/client/world-editor/world-files-api.ts
3506
- async function read$1(response) {
3507
+ async function read$2(response) {
3507
3508
  if (!response.ok) {
3508
3509
  const body = await response.json().catch(() => void 0);
3509
3510
  const message = (Array.isArray(body?.problems) ? body.problems.join("; ") : void 0) ?? (typeof body?.message === "string" ? body.message : `${response.status} ${response.statusText}`.trim());
@@ -3521,20 +3522,20 @@ window.__ModuleLoader__.load({
3521
3522
  body: JSON.stringify(body)
3522
3523
  }
3523
3524
  });
3524
- const loadInfo = async (world, signal) => await read$1(await fetch(`${API_PREFIX}/worlds/info?${query(world)}`, init("GET", signal)));
3525
- const saveInfo = async (world, edit, signal) => await read$1(await fetch(`${API_PREFIX}/worlds/info?${query(world)}`, init("PUT", signal, edit)));
3526
- const loadPrompts = async (world, language, signal) => await read$1(await fetch(`${API_PREFIX}/worlds/prompts?${query(world, language)}`, init("GET", signal)));
3527
- const loadPrompt = async (world, language, prompt, signal) => await read$1(await fetch(`${API_PREFIX}/worlds/prompts/item?${query(world, language, prompt)}`, init("GET", signal)));
3525
+ const loadInfo = async (world, signal) => await read$2(await fetch(`${API_PREFIX}/worlds/info?${query(world)}`, init("GET", signal)));
3526
+ const saveInfo = async (world, edit, signal) => await read$2(await fetch(`${API_PREFIX}/worlds/info?${query(world)}`, init("PUT", signal, edit)));
3527
+ const loadPrompts = async (world, language, signal) => await read$2(await fetch(`${API_PREFIX}/worlds/prompts?${query(world, language)}`, init("GET", signal)));
3528
+ const loadPrompt = async (world, language, prompt, signal) => await read$2(await fetch(`${API_PREFIX}/worlds/prompts/item?${query(world, language, prompt)}`, init("GET", signal)));
3528
3529
  const savePrompt = async (world, language, prompt, text, signal) => {
3529
- await read$1(await fetch(`${API_PREFIX}/worlds/prompts/item?${query(world, language, prompt)}`, init("PUT", signal, { text })));
3530
+ await read$2(await fetch(`${API_PREFIX}/worlds/prompts/item?${query(world, language, prompt)}`, init("PUT", signal, { text })));
3530
3531
  };
3531
3532
  const removePrompt = async (world, language, prompt, signal) => {
3532
- await read$1(await fetch(`${API_PREFIX}/worlds/prompts/item?${query(world, language, prompt)}`, init("DELETE", signal)));
3533
+ await read$2(await fetch(`${API_PREFIX}/worlds/prompts/item?${query(world, language, prompt)}`, init("DELETE", signal)));
3533
3534
  };
3534
- const loadRoutines = async (world, signal) => await read$1(await fetch(`${API_PREFIX}/worlds/routines?${query(world)}`, init("GET", signal)));
3535
- const saveRoutine = async (world, key, windows, signal) => await read$1(await fetch(`${API_PREFIX}/worlds/routines/item?${query(world)}&key=${encodeURIComponent(key)}`, init("PUT", signal, { windows })));
3536
- const loadVariables = async (world, signal) => await read$1(await fetch(`${API_PREFIX}/worlds/variables?${query(world)}`, init("GET", signal)));
3537
- const saveVariables = async (world, variables, signal) => await read$1(await fetch(`${API_PREFIX}/worlds/variables?${query(world)}`, init("PUT", signal, { variables })));
3535
+ const loadRoutines = async (world, signal) => await read$2(await fetch(`${API_PREFIX}/worlds/routines?${query(world)}`, init("GET", signal)));
3536
+ const saveRoutine = async (world, key, windows, signal) => await read$2(await fetch(`${API_PREFIX}/worlds/routines/item?${query(world)}&key=${encodeURIComponent(key)}`, init("PUT", signal, { windows })));
3537
+ const loadVariables = async (world, signal) => await read$2(await fetch(`${API_PREFIX}/worlds/variables?${query(world)}`, init("GET", signal)));
3538
+ const saveVariables = async (world, variables, signal) => await read$2(await fetch(`${API_PREFIX}/worlds/variables?${query(world)}`, init("PUT", signal, { variables })));
3538
3539
  //#endregion
3539
3540
  //#region src/client/world-editor/InfoPanel.tsx
3540
3541
  const draftOf$1 = (info) => ({
@@ -4745,46 +4746,46 @@ window.__ModuleLoader__.load({
4745
4746
  const imageUrl = (target, image) => `${route(target, "/file")}&path=${encodeURIComponent(image.path)}&v=${encodeURIComponent(image.createdAt)}`;
4746
4747
  //#endregion
4747
4748
  //#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
4748
- const css$17 = ".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{align-items:center;gap:8px;display:flex}.rp_9pSHmG_select{border:1px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);height:28px;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:1px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);background:var(--dsw-alias-bg-layer-2);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-sm);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:11px;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:11px;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:11px}.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:1px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);background:var(--dsw-alias-bg-layer-2);font:inherit;color:var(--dsw-alias-label-primary);padding:6px 8px;font-size:13px}.rp_9pSHmG_editArea{resize:vertical}";
4749
- const key$17 = "src/client/widgets/gallery-view/GalleryView.module.css";
4750
- let tag$17 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$17) + "]");
4751
- if (tag$17 === null) {
4752
- tag$17 = document.createElement("style");
4753
- tag$17.dataset.plugin = "@dsh-agentic-roleplay/core";
4754
- tag$17.dataset.pluginCss = key$17;
4755
- document.head.appendChild(tag$17);
4749
+ const css$19 = ".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{align-items:center;gap:8px;display:flex}.rp_9pSHmG_select{border:1px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);height:28px;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:1px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);background:var(--dsw-alias-bg-layer-2);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-sm);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:11px;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:11px;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:11px}.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:1px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);background:var(--dsw-alias-bg-layer-2);font:inherit;color:var(--dsw-alias-label-primary);padding:6px 8px;font-size:13px}.rp_9pSHmG_editArea{resize:vertical}";
4750
+ const key$19 = "src/client/widgets/gallery-view/GalleryView.module.css";
4751
+ let tag$19 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$19) + "]");
4752
+ if (tag$19 === null) {
4753
+ tag$19 = document.createElement("style");
4754
+ tag$19.dataset.plugin = "@dsh-agentic-roleplay/core";
4755
+ tag$19.dataset.pluginCss = key$19;
4756
+ document.head.appendChild(tag$19);
4756
4757
  }
4757
- tag$17.textContent = css$17;
4758
+ tag$19.textContent = css$19;
4758
4759
  var GalleryView_module_css_default = {
4759
- "reusable": "rp_9pSHmG_reusable",
4760
- "editField": "rp_9pSHmG_editField",
4761
- "facts": "rp_9pSHmG_facts",
4762
- "caption": "rp_9pSHmG_caption",
4763
- "editHelp": "rp_9pSHmG_editHelp",
4764
- "grid": "rp_9pSHmG_grid",
4765
4760
  "detail": "rp_9pSHmG_detail",
4766
- "error": "rp_9pSHmG_error",
4767
- "page": "rp_9pSHmG_page",
4768
- "cell": "rp_9pSHmG_cell",
4769
- "select": "rp_9pSHmG_select",
4770
- "pre": "rp_9pSHmG_pre",
4771
4761
  "editInput": "rp_9pSHmG_editInput",
4772
- "note": "rp_9pSHmG_note",
4762
+ "editButton": "rp_9pSHmG_editButton",
4773
4763
  "count": "rp_9pSHmG_count",
4764
+ "select": "rp_9pSHmG_select",
4765
+ "error": "rp_9pSHmG_error",
4766
+ "toolbar": "rp_9pSHmG_toolbar",
4774
4767
  "status": "rp_9pSHmG_status",
4775
- "actions": "rp_9pSHmG_actions",
4768
+ "page": "rp_9pSHmG_page",
4776
4769
  "editLabel": "rp_9pSHmG_editLabel",
4777
4770
  "editArea": "rp_9pSHmG_editArea",
4778
- "thumb": "rp_9pSHmG_thumb",
4779
- "edit": "rp_9pSHmG_edit",
4780
- "editButton": "rp_9pSHmG_editButton",
4781
- "open": "rp_9pSHmG_open",
4782
- "message": "rp_9pSHmG_message",
4771
+ "facts": "rp_9pSHmG_facts",
4783
4772
  "statusError": "rp_9pSHmG_statusError",
4773
+ "tags": "rp_9pSHmG_tags",
4784
4774
  "image": "rp_9pSHmG_image",
4785
- "toolbar": "rp_9pSHmG_toolbar",
4775
+ "thumb": "rp_9pSHmG_thumb",
4786
4776
  "large": "rp_9pSHmG_large",
4787
- "tags": "rp_9pSHmG_tags"
4777
+ "cell": "rp_9pSHmG_cell",
4778
+ "editHelp": "rp_9pSHmG_editHelp",
4779
+ "editField": "rp_9pSHmG_editField",
4780
+ "actions": "rp_9pSHmG_actions",
4781
+ "message": "rp_9pSHmG_message",
4782
+ "grid": "rp_9pSHmG_grid",
4783
+ "edit": "rp_9pSHmG_edit",
4784
+ "caption": "rp_9pSHmG_caption",
4785
+ "open": "rp_9pSHmG_open",
4786
+ "pre": "rp_9pSHmG_pre",
4787
+ "note": "rp_9pSHmG_note",
4788
+ "reusable": "rp_9pSHmG_reusable"
4788
4789
  };
4789
4790
  //#endregion
4790
4791
  //#region src/client/widgets/gallery-view/GalleryView.tsx
@@ -5114,24 +5115,24 @@ window.__ModuleLoader__.load({
5114
5115
  }
5115
5116
  //#endregion
5116
5117
  //#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
5117
- const css$16 = ".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:1px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);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:1px 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-sm);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}.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}";
5118
- const key$16 = "src/client/world-editor/WorldEditor.module.css";
5119
- let tag$16 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$16) + "]");
5120
- if (tag$16 === null) {
5121
- tag$16 = document.createElement("style");
5122
- tag$16.dataset.plugin = "@dsh-agentic-roleplay/core";
5123
- tag$16.dataset.pluginCss = key$16;
5124
- document.head.appendChild(tag$16);
5118
+ const css$18 = ".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:1px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);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:1px 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-sm);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}.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}";
5119
+ const key$18 = "src/client/world-editor/WorldEditor.module.css";
5120
+ let tag$18 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$18) + "]");
5121
+ if (tag$18 === null) {
5122
+ tag$18 = document.createElement("style");
5123
+ tag$18.dataset.plugin = "@dsh-agentic-roleplay/core";
5124
+ tag$18.dataset.pluginCss = key$18;
5125
+ document.head.appendChild(tag$18);
5125
5126
  }
5126
- tag$16.textContent = css$16;
5127
+ tag$18.textContent = css$18;
5127
5128
  var WorldEditor_module_css_default = {
5128
- "drawer": "rp__swA3a_drawer",
5129
- "view": "rp__swA3a_view",
5130
- "content": "rp__swA3a_content",
5131
- "drawerItem": "rp__swA3a_drawerItem",
5129
+ "drawerItemOn": "rp__swA3a_drawerItemOn",
5132
5130
  "warning": "rp__swA3a_warning",
5133
5131
  "message": "rp__swA3a_message",
5134
- "drawerItemOn": "rp__swA3a_drawerItemOn"
5132
+ "drawer": "rp__swA3a_drawer",
5133
+ "content": "rp__swA3a_content",
5134
+ "view": "rp__swA3a_view",
5135
+ "drawerItem": "rp__swA3a_drawerItem"
5135
5136
  };
5136
5137
  //#endregion
5137
5138
  //#region src/client/world-editor/WorldEditor.tsx
@@ -5429,38 +5430,38 @@ window.__ModuleLoader__.load({
5429
5430
  }
5430
5431
  //#endregion
5431
5432
  //#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
5432
- const css$15 = ".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{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:1px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);background:var(--dsw-alias-bg-layer-2);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-sm);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:1px 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}";
5433
- const key$15 = "src/client/pages/avatars/AvatarsPage.module.css";
5434
- let tag$15 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$15) + "]");
5435
- if (tag$15 === null) {
5436
- tag$15 = document.createElement("style");
5437
- tag$15.dataset.plugin = "@dsh-agentic-roleplay/core";
5438
- tag$15.dataset.pluginCss = key$15;
5439
- document.head.appendChild(tag$15);
5433
+ const css$17 = ".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{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:1px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);background:var(--dsw-alias-bg-layer-2);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-sm);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:1px 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}";
5434
+ const key$17 = "src/client/pages/avatars/AvatarsPage.module.css";
5435
+ let tag$17 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$17) + "]");
5436
+ if (tag$17 === null) {
5437
+ tag$17 = document.createElement("style");
5438
+ tag$17.dataset.plugin = "@dsh-agentic-roleplay/core";
5439
+ tag$17.dataset.pluginCss = key$17;
5440
+ document.head.appendChild(tag$17);
5440
5441
  }
5441
- tag$15.textContent = css$15;
5442
+ tag$17.textContent = css$17;
5442
5443
  var AvatarsPage_module_css_default = {
5443
- "text": "rp_pQOzEG_text",
5444
- "card": "rp_pQOzEG_card",
5445
- "editHeader": "rp_pQOzEG_editHeader",
5446
- "label": "rp_pQOzEG_label",
5447
- "name": "rp_pQOzEG_name",
5448
5444
  "field": "rp_pQOzEG_field",
5449
- "editTitle": "rp_pQOzEG_editTitle",
5445
+ "actions": "rp_pQOzEG_actions",
5446
+ "toolbar": "rp_pQOzEG_toolbar",
5447
+ "viewport": "rp_pQOzEG_viewport",
5448
+ "placeholder": "rp_pQOzEG_placeholder",
5449
+ "editHeader": "rp_pQOzEG_editHeader",
5450
5450
  "page": "rp_pQOzEG_page",
5451
+ "form": "rp_pQOzEG_form",
5452
+ "card": "rp_pQOzEG_card",
5453
+ "error": "rp_pQOzEG_error",
5451
5454
  "summary": "rp_pQOzEG_summary",
5455
+ "message": "rp_pQOzEG_message",
5456
+ "name": "rp_pQOzEG_name",
5452
5457
  "grid": "rp_pQOzEG_grid",
5453
5458
  "portrait": "rp_pQOzEG_portrait",
5454
- "editBody": "rp_pQOzEG_editBody",
5455
- "form": "rp_pQOzEG_form",
5456
- "actions": "rp_pQOzEG_actions",
5457
- "message": "rp_pQOzEG_message",
5458
- "error": "rp_pQOzEG_error",
5459
- "viewport": "rp_pQOzEG_viewport",
5460
- "count": "rp_pQOzEG_count",
5461
- "placeholder": "rp_pQOzEG_placeholder",
5462
5459
  "open": "rp_pQOzEG_open",
5463
- "toolbar": "rp_pQOzEG_toolbar"
5460
+ "text": "rp_pQOzEG_text",
5461
+ "count": "rp_pQOzEG_count",
5462
+ "label": "rp_pQOzEG_label",
5463
+ "editTitle": "rp_pQOzEG_editTitle",
5464
+ "editBody": "rp_pQOzEG_editBody"
5464
5465
  };
5465
5466
  //#endregion
5466
5467
  //#region src/client/pages/avatars/AvatarsPage.tsx
@@ -5741,7 +5742,7 @@ window.__ModuleLoader__.load({
5741
5742
  }
5742
5743
  //#endregion
5743
5744
  //#region src/client/widgets/gallery-view/locales.ts
5744
- const dictionaries$9 = {
5745
+ const dictionaries$10 = {
5745
5746
  en: {
5746
5747
  tab: "Gallery",
5747
5748
  notRoleplay: "This chat is not a roleplay session, so it has no gallery.",
@@ -5819,7 +5820,7 @@ window.__ModuleLoader__.load({
5819
5820
  cancel: "取消"
5820
5821
  }
5821
5822
  };
5822
- const dictionaries$8 = withDictionaries({
5823
+ const dictionaries$9 = withDictionaries({
5823
5824
  en: {
5824
5825
  language: "en",
5825
5826
  sectionInfo: "About",
@@ -6336,8 +6337,8 @@ window.__ModuleLoader__.load({
6336
6337
  relationCancel: "取消",
6337
6338
  relationCreate: "创建"
6338
6339
  }
6339
- }, prefixed(dictionaries$9, "gallery_"));
6340
- const dictionaries$7 = withDictionaries({
6340
+ }, prefixed(dictionaries$10, "gallery_"));
6341
+ const dictionaries$8 = withDictionaries({
6341
6342
  en: {
6342
6343
  nav: "Avatars",
6343
6344
  avatarsLoading: "Loading avatars…",
@@ -6390,14 +6391,14 @@ window.__ModuleLoader__.load({
6390
6391
  avatarDeleteFailed: "无法删除角色形象:{message}",
6391
6392
  avatarEdit: "编辑"
6392
6393
  }
6393
- }, dictionaries$8);
6394
+ }, dictionaries$9);
6394
6395
  //#endregion
6395
6396
  //#region src/client/pages/avatars/index.ts
6396
- const NAMESPACE$8 = "roleplay.avatars";
6397
+ const NAMESPACE$9 = "roleplay.avatars";
6397
6398
  /** Adds the Avatars page to the Role Play panel: characters to play in any world. */
6398
6399
  function registerAvatarsPage(ctx) {
6399
- const t = ctx.locale.bind(NAMESPACE$8);
6400
- ctx.effect(() => ctx.locale.register(NAMESPACE$8, dictionaries$7), "roleplay: avatars dictionaries");
6400
+ const t = ctx.locale.bind(NAMESPACE$9);
6401
+ ctx.effect(() => ctx.locale.register(NAMESPACE$9, dictionaries$8), "roleplay: avatars dictionaries");
6401
6402
  const avatars = new AvatarsController();
6402
6403
  ctx.effect(() => () => {
6403
6404
  avatars.dispose();
@@ -6407,7 +6408,7 @@ window.__ModuleLoader__.load({
6407
6408
  id: "avatars",
6408
6409
  order: 5,
6409
6410
  label: () => t("nav"),
6410
- locale: NAMESPACE$8,
6411
+ locale: NAMESPACE$9,
6411
6412
  inject: () => avatars.inject()
6412
6413
  }, AvatarsPage));
6413
6414
  }
@@ -6441,19 +6442,19 @@ window.__ModuleLoader__.load({
6441
6442
  }
6442
6443
  //#endregion
6443
6444
  //#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
6444
- const css$14 = ".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}";
6445
- const key$14 = "src/client/widgets/pager/Pager.module.css";
6446
- let tag$14 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$14) + "]");
6447
- if (tag$14 === null) {
6448
- tag$14 = document.createElement("style");
6449
- tag$14.dataset.plugin = "@dsh-agentic-roleplay/core";
6450
- tag$14.dataset.pluginCss = key$14;
6451
- document.head.appendChild(tag$14);
6445
+ const css$16 = ".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}";
6446
+ const key$16 = "src/client/widgets/pager/Pager.module.css";
6447
+ let tag$16 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$16) + "]");
6448
+ if (tag$16 === null) {
6449
+ tag$16 = document.createElement("style");
6450
+ tag$16.dataset.plugin = "@dsh-agentic-roleplay/core";
6451
+ tag$16.dataset.pluginCss = key$16;
6452
+ document.head.appendChild(tag$16);
6452
6453
  }
6453
- tag$14.textContent = css$14;
6454
+ tag$16.textContent = css$16;
6454
6455
  var Pager_module_css_default = {
6455
- "pager": "rp_KBAD0W_pager",
6456
- "position": "rp_KBAD0W_position"
6456
+ "position": "rp_KBAD0W_position",
6457
+ "pager": "rp_KBAD0W_pager"
6457
6458
  };
6458
6459
  //#endregion
6459
6460
  //#region src/client/widgets/pager/Pager.tsx
@@ -6488,16 +6489,16 @@ window.__ModuleLoader__.load({
6488
6489
  }
6489
6490
  //#endregion
6490
6491
  //#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
6491
- const css$13 = ".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)}";
6492
- const key$13 = "src/client/widgets/problem-list/ProblemList.module.css";
6493
- let tag$13 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$13) + "]");
6494
- if (tag$13 === null) {
6495
- tag$13 = document.createElement("style");
6496
- tag$13.dataset.plugin = "@dsh-agentic-roleplay/core";
6497
- tag$13.dataset.pluginCss = key$13;
6498
- document.head.appendChild(tag$13);
6492
+ const css$15 = ".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)}";
6493
+ const key$15 = "src/client/widgets/problem-list/ProblemList.module.css";
6494
+ let tag$15 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$15) + "]");
6495
+ if (tag$15 === null) {
6496
+ tag$15 = document.createElement("style");
6497
+ tag$15.dataset.plugin = "@dsh-agentic-roleplay/core";
6498
+ tag$15.dataset.pluginCss = key$15;
6499
+ document.head.appendChild(tag$15);
6499
6500
  }
6500
- tag$13.textContent = css$13;
6501
+ tag$15.textContent = css$15;
6501
6502
  var ProblemList_module_css_default = { "problems": "rp_LZh3Iq_problems" };
6502
6503
  //#endregion
6503
6504
  //#region src/client/widgets/problem-list/ProblemList.tsx
@@ -6515,20 +6516,20 @@ window.__ModuleLoader__.load({
6515
6516
  }
6516
6517
  //#endregion
6517
6518
  //#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
6518
- const css$12 = ".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_error{color:var(--dsw-alias-state-error-primary);font-size:12px}";
6519
- const key$12 = "src/client/pages/sessions/DeleteSessionDialog.module.css";
6520
- let tag$12 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$12) + "]");
6521
- if (tag$12 === null) {
6522
- tag$12 = document.createElement("style");
6523
- tag$12.dataset.plugin = "@dsh-agentic-roleplay/core";
6524
- tag$12.dataset.pluginCss = key$12;
6525
- document.head.appendChild(tag$12);
6519
+ const css$14 = ".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_error{color:var(--dsw-alias-state-error-primary);font-size:12px}";
6520
+ const key$14 = "src/client/pages/sessions/DeleteSessionDialog.module.css";
6521
+ let tag$14 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$14) + "]");
6522
+ if (tag$14 === null) {
6523
+ tag$14 = document.createElement("style");
6524
+ tag$14.dataset.plugin = "@dsh-agentic-roleplay/core";
6525
+ tag$14.dataset.pluginCss = key$14;
6526
+ document.head.appendChild(tag$14);
6526
6527
  }
6527
- tag$12.textContent = css$12;
6528
+ tag$14.textContent = css$14;
6528
6529
  var DeleteSessionDialog_module_css_default = {
6530
+ "warning": "rp_FifHrW_warning",
6529
6531
  "body": "rp_FifHrW_body",
6530
6532
  "question": "rp_FifHrW_question",
6531
- "warning": "rp_FifHrW_warning",
6532
6533
  "error": "rp_FifHrW_error"
6533
6534
  };
6534
6535
  //#endregion
@@ -6625,39 +6626,39 @@ window.__ModuleLoader__.load({
6625
6626
  }
6626
6627
  //#endregion
6627
6628
  //#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
6628
- const css$11 = ".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}.rp_24z4eW_scrolls{overflow-y:auto}.rp_24z4eW_fits{overflow:hidden}.rp_24z4eW_table{border-collapse:collapse;table-layout:fixed;width:100%}.rp_24z4eW_actionsColumn{width:132px}.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:1px 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:1px 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:1px 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:11px}";
6629
- const key$11 = "src/client/pages/sessions/SessionsPage.module.css";
6630
- let tag$11 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$11) + "]");
6631
- if (tag$11 === null) {
6632
- tag$11 = document.createElement("style");
6633
- tag$11.dataset.plugin = "@dsh-agentic-roleplay/core";
6634
- tag$11.dataset.pluginCss = key$11;
6635
- document.head.appendChild(tag$11);
6629
+ const css$13 = ".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}.rp_24z4eW_scrolls{overflow-y:auto}.rp_24z4eW_fits{overflow:hidden}.rp_24z4eW_table{border-collapse:collapse;table-layout:fixed;width:100%}.rp_24z4eW_actionsColumn{width:132px}.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:1px 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:1px 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:1px 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:11px}";
6630
+ const key$13 = "src/client/pages/sessions/SessionsPage.module.css";
6631
+ let tag$13 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$13) + "]");
6632
+ if (tag$13 === null) {
6633
+ tag$13 = document.createElement("style");
6634
+ tag$13.dataset.plugin = "@dsh-agentic-roleplay/core";
6635
+ tag$13.dataset.pluginCss = key$13;
6636
+ document.head.appendChild(tag$13);
6636
6637
  }
6637
- tag$11.textContent = css$11;
6638
+ tag$13.textContent = css$13;
6638
6639
  var SessionsPage_module_css_default = {
6639
- "fits": "rp_24z4eW_fits",
6640
- "turnsColumn": "rp_24z4eW_turnsColumn",
6640
+ "page": "rp_24z4eW_page",
6641
6641
  "count": "rp_24z4eW_count",
6642
- "name": "rp_24z4eW_name",
6642
+ "fits": "rp_24z4eW_fits",
6643
+ "scrolls": "rp_24z4eW_scrolls",
6644
+ "message": "rp_24z4eW_message",
6643
6645
  "secondary": "rp_24z4eW_secondary",
6644
- "notice": "rp_24z4eW_notice",
6645
6646
  "number": "rp_24z4eW_number",
6646
- "actions": "rp_24z4eW_actions",
6647
- "archived": "rp_24z4eW_archived",
6648
- "message": "rp_24z4eW_message",
6649
6647
  "spinning": "rp_24z4eW_spinning",
6650
- "timeColumn": "rp_24z4eW_timeColumn",
6651
- "actionsColumn": "rp_24z4eW_actionsColumn",
6652
- "badge": "rp_24z4eW_badge",
6653
6648
  "nameColumn": "rp_24z4eW_nameColumn",
6654
- "toolbar": "rp_24z4eW_toolbar",
6655
- "page": "rp_24z4eW_page",
6656
- "spin": "rp_24z4eW_spin",
6657
6649
  "viewport": "rp_24z4eW_viewport",
6658
- "scrolls": "rp_24z4eW_scrolls",
6650
+ "timeColumn": "rp_24z4eW_timeColumn",
6651
+ "spin": "rp_24z4eW_spin",
6659
6652
  "table": "rp_24z4eW_table",
6660
- "worldColumn": "rp_24z4eW_worldColumn"
6653
+ "name": "rp_24z4eW_name",
6654
+ "notice": "rp_24z4eW_notice",
6655
+ "worldColumn": "rp_24z4eW_worldColumn",
6656
+ "archived": "rp_24z4eW_archived",
6657
+ "actions": "rp_24z4eW_actions",
6658
+ "toolbar": "rp_24z4eW_toolbar",
6659
+ "turnsColumn": "rp_24z4eW_turnsColumn",
6660
+ "badge": "rp_24z4eW_badge",
6661
+ "actionsColumn": "rp_24z4eW_actionsColumn"
6661
6662
  };
6662
6663
  //#endregion
6663
6664
  //#region src/client/pages/sessions/SessionsPage.tsx
@@ -6874,7 +6875,7 @@ window.__ModuleLoader__.load({
6874
6875
  }
6875
6876
  //#endregion
6876
6877
  //#region src/client/pages/sessions/locales.ts
6877
- const dictionaries$6 = {
6878
+ const dictionaries$7 = {
6878
6879
  en: {
6879
6880
  nav: "Sessions",
6880
6881
  loading: "Loading sessions…",
@@ -7136,11 +7137,11 @@ window.__ModuleLoader__.load({
7136
7137
  };
7137
7138
  //#endregion
7138
7139
  //#region src/client/pages/sessions/index.ts
7139
- const NAMESPACE$7 = "roleplay.sessions";
7140
+ const NAMESPACE$8 = "roleplay.sessions";
7140
7141
  /** Adds the Sessions page to the Role Play panel. */
7141
7142
  function registerSessionsPage(ctx) {
7142
- const t = ctx.locale.bind(NAMESPACE$7);
7143
- ctx.effect(() => ctx.locale.register(NAMESPACE$7, dictionaries$6), "roleplay: sessions dictionaries");
7143
+ const t = ctx.locale.bind(NAMESPACE$8);
7144
+ ctx.effect(() => ctx.locale.register(NAMESPACE$8, dictionaries$7), "roleplay: sessions dictionaries");
7144
7145
  const sessions = new SessionsController(createChatOpener(ctx));
7145
7146
  ctx.effect(() => () => {
7146
7147
  sessions.dispose();
@@ -7150,33 +7151,33 @@ window.__ModuleLoader__.load({
7150
7151
  id: "sessions",
7151
7152
  order: 10,
7152
7153
  label: () => t("nav"),
7153
- locale: NAMESPACE$7,
7154
+ locale: NAMESPACE$8,
7154
7155
  inject: () => sessions.inject()
7155
7156
  }, SessionsPage));
7156
7157
  }
7157
7158
  //#endregion
7158
7159
  //#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
7159
- const css$10 = ".rp_Bvxx5q_card{border:1px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);background:var(--dsw-alias-bg-layer-2);flex-direction:column;flex:auto;min-width:0;transition:border-color .12s;display:flex;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{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_open{cursor:pointer}";
7160
- const key$10 = "src/client/widgets/world-card/WorldCard.module.css";
7161
- let tag$10 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$10) + "]");
7162
- if (tag$10 === null) {
7163
- tag$10 = document.createElement("style");
7164
- tag$10.dataset.plugin = "@dsh-agentic-roleplay/core";
7165
- tag$10.dataset.pluginCss = key$10;
7166
- document.head.appendChild(tag$10);
7160
+ const css$12 = ".rp_Bvxx5q_card{border:1px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);background:var(--dsw-alias-bg-layer-2);flex-direction:column;flex:auto;min-width:0;transition:border-color .12s;display:flex;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{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_open{cursor:pointer}";
7161
+ const key$12 = "src/client/widgets/world-card/WorldCard.module.css";
7162
+ let tag$12 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$12) + "]");
7163
+ if (tag$12 === null) {
7164
+ tag$12 = document.createElement("style");
7165
+ tag$12.dataset.plugin = "@dsh-agentic-roleplay/core";
7166
+ tag$12.dataset.pluginCss = key$12;
7167
+ document.head.appendChild(tag$12);
7167
7168
  }
7168
- tag$10.textContent = css$10;
7169
+ tag$12.textContent = css$12;
7169
7170
  var WorldCard_module_css_default = {
7170
- "tag": "rp_Bvxx5q_tag",
7171
- "info": "rp_Bvxx5q_info",
7172
- "placeholder": "rp_Bvxx5q_placeholder",
7173
- "cover": "rp_Bvxx5q_cover",
7174
- "image": "rp_Bvxx5q_image",
7175
7171
  "card": "rp_Bvxx5q_card",
7176
- "play": "rp_Bvxx5q_play",
7172
+ "cover": "rp_Bvxx5q_cover",
7177
7173
  "tags": "rp_Bvxx5q_tags",
7174
+ "image": "rp_Bvxx5q_image",
7175
+ "tag": "rp_Bvxx5q_tag",
7176
+ "placeholder": "rp_Bvxx5q_placeholder",
7178
7177
  "name": "rp_Bvxx5q_name",
7179
- "open": "rp_Bvxx5q_open"
7178
+ "open": "rp_Bvxx5q_open",
7179
+ "info": "rp_Bvxx5q_info",
7180
+ "play": "rp_Bvxx5q_play"
7180
7181
  };
7181
7182
  //#endregion
7182
7183
  //#region src/client/widgets/world-card/WorldCard.tsx
@@ -7259,21 +7260,21 @@ window.__ModuleLoader__.load({
7259
7260
  }
7260
7261
  //#endregion
7261
7262
  //#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
7262
- const css$9 = ".rp_YCstOG_option{border:1px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);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}";
7263
- const key$9 = "src/client/widgets/avatar-choices/AvatarChoices.module.css";
7264
- let tag$9 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$9) + "]");
7265
- if (tag$9 === null) {
7266
- tag$9 = document.createElement("style");
7267
- tag$9.dataset.plugin = "@dsh-agentic-roleplay/core";
7268
- tag$9.dataset.pluginCss = key$9;
7269
- document.head.appendChild(tag$9);
7263
+ const css$11 = ".rp_YCstOG_option{border:1px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);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}";
7264
+ const key$11 = "src/client/widgets/avatar-choices/AvatarChoices.module.css";
7265
+ let tag$11 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$11) + "]");
7266
+ if (tag$11 === null) {
7267
+ tag$11 = document.createElement("style");
7268
+ tag$11.dataset.plugin = "@dsh-agentic-roleplay/core";
7269
+ tag$11.dataset.pluginCss = key$11;
7270
+ document.head.appendChild(tag$11);
7270
7271
  }
7271
- tag$9.textContent = css$9;
7272
+ tag$11.textContent = css$11;
7272
7273
  var AvatarChoices_module_css_default = {
7274
+ "summary": "rp_YCstOG_summary",
7273
7275
  "option": "rp_YCstOG_option",
7274
7276
  "name": "rp_YCstOG_name",
7275
- "text": "rp_YCstOG_text",
7276
- "summary": "rp_YCstOG_summary"
7277
+ "text": "rp_YCstOG_text"
7277
7278
  };
7278
7279
  //#endregion
7279
7280
  //#region src/client/widgets/avatar-choices/AvatarChoices.tsx
@@ -7302,28 +7303,28 @@ window.__ModuleLoader__.load({
7302
7303
  }
7303
7304
  //#endregion
7304
7305
  //#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
7305
- const css$8 = ".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:1px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);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:1px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);flex-direction:column;gap:12px;max-height:320px;padding:12px;display:flex;overflow-y:auto}";
7306
- const key$8 = "src/client/pages/worlds/StartSessionDialog.module.css";
7307
- let tag$8 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$8) + "]");
7308
- if (tag$8 === null) {
7309
- tag$8 = document.createElement("style");
7310
- tag$8.dataset.plugin = "@dsh-agentic-roleplay/core";
7311
- tag$8.dataset.pluginCss = key$8;
7312
- document.head.appendChild(tag$8);
7306
+ const css$10 = ".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:1px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);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:1px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);flex-direction:column;gap:12px;max-height:320px;padding:12px;display:flex;overflow-y:auto}";
7307
+ const key$10 = "src/client/pages/worlds/StartSessionDialog.module.css";
7308
+ let tag$10 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$10) + "]");
7309
+ if (tag$10 === null) {
7310
+ tag$10 = document.createElement("style");
7311
+ tag$10.dataset.plugin = "@dsh-agentic-roleplay/core";
7312
+ tag$10.dataset.pluginCss = key$10;
7313
+ document.head.appendChild(tag$10);
7313
7314
  }
7314
- tag$8.textContent = css$8;
7315
+ tag$10.textContent = css$10;
7315
7316
  var StartSessionDialog_module_css_default = {
7316
- "message": "rp_AnbLKG_message",
7317
- "optionSummary": "rp_AnbLKG_optionSummary",
7318
- "optionName": "rp_AnbLKG_optionName",
7319
7317
  "optionText": "rp_AnbLKG_optionText",
7320
- "advancedBody": "rp_AnbLKG_advancedBody",
7321
- "label": "rp_AnbLKG_label",
7322
- "field": "rp_AnbLKG_field",
7323
7318
  "error": "rp_AnbLKG_error",
7324
7319
  "form": "rp_AnbLKG_form",
7320
+ "advancedBody": "rp_AnbLKG_advancedBody",
7321
+ "optionName": "rp_AnbLKG_optionName",
7322
+ "label": "rp_AnbLKG_label",
7325
7323
  "advanced": "rp_AnbLKG_advanced",
7324
+ "optionSummary": "rp_AnbLKG_optionSummary",
7325
+ "message": "rp_AnbLKG_message",
7326
7326
  "advancedToggle": "rp_AnbLKG_advancedToggle",
7327
+ "field": "rp_AnbLKG_field",
7327
7328
  "option": "rp_AnbLKG_option"
7328
7329
  };
7329
7330
  //#endregion
@@ -7444,7 +7445,7 @@ window.__ModuleLoader__.load({
7444
7445
  options,
7445
7446
  fallback
7446
7447
  });
7447
- const text = (max, fallback) => ({
7448
+ const text$1 = (max, fallback) => ({
7448
7449
  kind: "text",
7449
7450
  max,
7450
7451
  fallback
@@ -7459,7 +7460,9 @@ window.__ModuleLoader__.load({
7459
7460
  lookupCalls: integer(1, 20, 5),
7460
7461
  verify: flag(true),
7461
7462
  backlogRounds: integer(1, 100, 6),
7462
- overRetrieve: integer(1, 10, 4)
7463
+ overRetrieve: integer(1, 10, 4),
7464
+ associate: integer(0, 10, 2),
7465
+ diversity: ratio(0, 1, .3)
7463
7466
  },
7464
7467
  context: {
7465
7468
  limitTokens: integer(0, 1e6, 0),
@@ -7476,10 +7479,11 @@ window.__ModuleLoader__.load({
7476
7479
  },
7477
7480
  clock: {
7478
7481
  mode: choice(CLOCK_MODES, "simulated"),
7479
- timeZone: text(64, ""),
7482
+ timeZone: text$1(64, ""),
7480
7483
  roundSeconds: integer(0, 3600, 30),
7481
7484
  maxSkipDays: integer(1, 3650, 30)
7482
7485
  },
7486
+ diagnostics: { keepRuns: flag(false) },
7483
7487
  offstage: {
7484
7488
  perTurn: integer(0, 5, 2),
7485
7489
  perCharacter: integer(1, 3, 1),
@@ -7489,24 +7493,26 @@ window.__ModuleLoader__.load({
7489
7493
  sampling: {
7490
7494
  master: ratio(0, 2, .7),
7491
7495
  characters: ratio(0, 2, .8),
7492
- suggestions: ratio(0, 2, .8),
7496
+ suggestions: ratio(0, 2, .2),
7493
7497
  authoring: ratio(0, 2, .4),
7494
7498
  records: ratio(0, 2, .1),
7495
7499
  tools: choice(["auto", "required"], "required"),
7496
7500
  maxTokens: integer(256, 64e3, 8e3),
7497
- shortMaxTokens: integer(256, 64e3, 2e3)
7501
+ shortMaxTokens: integer(256, 64e3, 2e3),
7502
+ headroom: ratio(1, 10, 2)
7498
7503
  },
7499
- prompts: { language: text(8, "en") },
7500
- reasoning: { children: text(40, "") },
7504
+ prompts: { language: text$1(8, "en") },
7505
+ reasoning: { children: text$1(40, "") },
7501
7506
  factions: {
7502
7507
  perTurn: integer(0, 3, 1),
7503
7508
  everyDays: integer(1, 365, 3)
7504
7509
  },
7505
7510
  models: {
7506
- characters: text(200, ""),
7507
- records: text(200, ""),
7508
- suggestions: text(200, ""),
7509
- authoring: text(200, "")
7511
+ characters: text$1(200, ""),
7512
+ background: text$1(200, ""),
7513
+ records: text$1(200, ""),
7514
+ suggestions: text$1(200, ""),
7515
+ authoring: text$1(200, "")
7510
7516
  },
7511
7517
  triggers: {
7512
7518
  enabled: flag(true),
@@ -7515,8 +7521,9 @@ window.__ModuleLoader__.load({
7515
7521
  cueTurns: integer(1, 20, 2),
7516
7522
  judgedPerTurn: integer(0, 5, 2)
7517
7523
  },
7524
+ interface: { pack: text$1(60, "") },
7518
7525
  rewind: { keepSnapshots: integer(0, 500, 30) },
7519
- rules: { own: text(MAX_OWN_RULES, "") },
7526
+ rules: { own: text$1(MAX_OWN_RULES, "") },
7520
7527
  preview: { enabled: flag(true) },
7521
7528
  suggestions: { count: integer(0, 5, 3) },
7522
7529
  images: {
@@ -7533,8 +7540,8 @@ window.__ModuleLoader__.load({
7533
7540
  reuse: flag(true),
7534
7541
  highRes: flag(false),
7535
7542
  interpret: flag(true),
7536
- interpreterModel: text(200, ""),
7537
- captioner: text(200, "")
7543
+ interpreterModel: text$1(200, ""),
7544
+ captioner: text$1(200, "")
7538
7545
  },
7539
7546
  embedding: { options: record() }
7540
7547
  };
@@ -7589,6 +7596,18 @@ window.__ModuleLoader__.load({
7589
7596
  label: "overRetrieve",
7590
7597
  help: "overRetrieveHelp"
7591
7598
  },
7599
+ {
7600
+ path: ["memory", "associate"],
7601
+ kind: "integer",
7602
+ label: "associate",
7603
+ help: "associateHelp"
7604
+ },
7605
+ {
7606
+ path: ["memory", "diversity"],
7607
+ kind: "decimal",
7608
+ label: "diversity",
7609
+ help: "diversityHelp"
7610
+ },
7592
7611
  {
7593
7612
  path: ["memory", "lookup"],
7594
7613
  kind: "flag",
@@ -7715,6 +7734,14 @@ window.__ModuleLoader__.load({
7715
7734
  zone: false,
7716
7735
  placeholder: "localai/model-id"
7717
7736
  },
7737
+ {
7738
+ path: ["models", "background"],
7739
+ kind: "text",
7740
+ label: "modelsBackground",
7741
+ help: "modelsBackgroundHelp",
7742
+ zone: false,
7743
+ placeholder: "localai/model-id"
7744
+ },
7718
7745
  {
7719
7746
  path: ["models", "records"],
7720
7747
  kind: "text",
@@ -7926,6 +7953,20 @@ window.__ModuleLoader__.load({
7926
7953
  kind: "percent",
7927
7954
  label: "retainRatio",
7928
7955
  help: "retainRatioHelp"
7956
+ },
7957
+ {
7958
+ path: ["interface", "pack"],
7959
+ kind: "text",
7960
+ label: "interfacePack",
7961
+ help: "interfacePackHelp",
7962
+ zone: false,
7963
+ placeholder: "none"
7964
+ },
7965
+ {
7966
+ path: ["diagnostics", "keepRuns"],
7967
+ kind: "flag",
7968
+ label: "diagnosticsKeepRuns",
7969
+ help: "diagnosticsKeepRunsHelp"
7929
7970
  }
7930
7971
  ];
7931
7972
  /**
@@ -7943,7 +7984,7 @@ window.__ModuleLoader__.load({
7943
7984
  "authoring.enabled": false
7944
7985
  };
7945
7986
  const keyOf = (field) => field.path.join(".");
7946
- function read(root, path) {
7987
+ function read$1(root, path) {
7947
7988
  return path.reduce((node, key) => node[key], root);
7948
7989
  }
7949
7990
  /** The key of the draft of one request option of the embedding provider. */
@@ -7951,7 +7992,7 @@ window.__ModuleLoader__.load({
7951
7992
  /** What each setting of the form starts as, and each request option the embedding provider offers. */
7952
7993
  function toDrafts(settings, options = []) {
7953
7994
  const fixed = FORM_FIELDS.map((field) => {
7954
- const value = read(settings, field.path);
7995
+ const value = read$1(settings, field.path);
7955
7996
  return [keyOf(field), field.kind === "flag" ? value === true : field.kind === "percent" ? String(Math.round(value * 100)) : String(value)];
7956
7997
  });
7957
7998
  const requested = options.map((option) => {
@@ -7962,7 +8003,7 @@ window.__ModuleLoader__.load({
7962
8003
  }
7963
8004
  /** The bounds of a field as the form shows them: percentages for a share. */
7964
8005
  function boundsOf(field) {
7965
- const spec = read(SETTINGS_SPEC, field.path);
8006
+ const spec = read$1(SETTINGS_SPEC, field.path);
7966
8007
  return field.kind === "percent" ? {
7967
8008
  min: Math.round((spec.min ?? 0) * 100),
7968
8009
  max: Math.round((spec.max ?? 1) * 100)
@@ -8071,30 +8112,30 @@ window.__ModuleLoader__.load({
8071
8112
  }
8072
8113
  //#endregion
8073
8114
  //#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
8074
- const css$7 = ".rp_Rhi3yq_row{flex-direction:column;gap:6px;display:flex}.rp_Rhi3yq_field{flex-direction:column;gap:6px;max-width:200px;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:1px 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:1px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);width:100%;max-width:560px;color:inherit;font:inherit;resize:vertical;background:0 0;padding:6px 8px;font-size:13px}";
8075
- const key$7 = "src/client/settings-form/SettingsFields.module.css";
8076
- let tag$7 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$7) + "]");
8077
- if (tag$7 === null) {
8078
- tag$7 = document.createElement("style");
8079
- tag$7.dataset.plugin = "@dsh-agentic-roleplay/core";
8080
- tag$7.dataset.pluginCss = key$7;
8081
- document.head.appendChild(tag$7);
8115
+ const css$9 = ".rp_Rhi3yq_row{flex-direction:column;gap:6px;display:flex}.rp_Rhi3yq_field{flex-direction:column;gap:6px;max-width:200px;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:1px 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:1px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);width:100%;max-width:560px;color:inherit;font:inherit;resize:vertical;background:0 0;padding:6px 8px;font-size:13px}";
8116
+ const key$9 = "src/client/settings-form/SettingsFields.module.css";
8117
+ let tag$9 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$9) + "]");
8118
+ if (tag$9 === null) {
8119
+ tag$9 = document.createElement("style");
8120
+ tag$9.dataset.plugin = "@dsh-agentic-roleplay/core";
8121
+ tag$9.dataset.pluginCss = key$9;
8122
+ document.head.appendChild(tag$9);
8082
8123
  }
8083
- tag$7.textContent = css$7;
8124
+ tag$9.textContent = css$9;
8084
8125
  var SettingsFields_module_css_default = {
8085
- "group": "rp_Rhi3yq_group",
8086
- "groupTitle": "rp_Rhi3yq_groupTitle",
8087
- "label": "rp_Rhi3yq_label",
8088
- "area": "rp_Rhi3yq_area",
8089
- "row": "rp_Rhi3yq_row",
8090
- "field": "rp_Rhi3yq_field",
8126
+ "error": "rp_Rhi3yq_error",
8091
8127
  "help": "rp_Rhi3yq_help",
8092
- "error": "rp_Rhi3yq_error"
8128
+ "field": "rp_Rhi3yq_field",
8129
+ "row": "rp_Rhi3yq_row",
8130
+ "area": "rp_Rhi3yq_area",
8131
+ "groupTitle": "rp_Rhi3yq_groupTitle",
8132
+ "group": "rp_Rhi3yq_group",
8133
+ "label": "rp_Rhi3yq_label"
8093
8134
  };
8094
8135
  //#endregion
8095
8136
  //#region src/client/settings-form/SettingsFields.tsx
8096
8137
  /** The settings of a chat as editable fields: one control with its explanation under each. */
8097
- function SettingsFields({ t, drafts, onChange, onPreset, options = [], disabled = false, locked = {} }) {
8138
+ function SettingsFields({ t, drafts, onChange, onPreset, options = [], disabled = false, locked = {}, hidden = [] }) {
8098
8139
  const bad = problemsOf(drafts, options);
8099
8140
  const locale = t("localeId");
8100
8141
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
@@ -8120,7 +8161,7 @@ window.__ModuleLoader__.load({
8120
8161
  children: t("presetFastHelp")
8121
8162
  })]
8122
8163
  }),
8123
- FORM_FIELDS.map((field) => {
8164
+ FORM_FIELDS.filter((field) => !hidden.includes(keyOf(field))).map((field) => {
8124
8165
  const key = keyOf(field);
8125
8166
  const { min, max } = field.kind === "choice" || field.kind === "text" ? {
8126
8167
  min: 0,
@@ -8657,36 +8698,36 @@ window.__ModuleLoader__.load({
8657
8698
  }
8658
8699
  //#endregion
8659
8700
  //#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
8660
- const css$6 = ".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{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:1px solid var(--dsw-alias-border-l3);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:1px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);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}";
8661
- const key$6 = "src/client/pages/worlds/WorldsPage.module.css";
8662
- let tag$6 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$6) + "]");
8663
- if (tag$6 === null) {
8664
- tag$6 = document.createElement("style");
8665
- tag$6.dataset.plugin = "@dsh-agentic-roleplay/core";
8666
- tag$6.dataset.pluginCss = key$6;
8667
- document.head.appendChild(tag$6);
8701
+ 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{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:1px solid var(--dsw-alias-border-l3);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:1px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);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}";
8702
+ const key$8 = "src/client/pages/worlds/WorldsPage.module.css";
8703
+ let tag$8 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$8) + "]");
8704
+ if (tag$8 === null) {
8705
+ tag$8 = document.createElement("style");
8706
+ tag$8.dataset.plugin = "@dsh-agentic-roleplay/core";
8707
+ tag$8.dataset.pluginCss = key$8;
8708
+ document.head.appendChild(tag$8);
8668
8709
  }
8669
- tag$6.textContent = css$6;
8710
+ tag$8.textContent = css$8;
8670
8711
  var WorldsPage_module_css_default = {
8671
- "viewport": "rp_FHUyRq_viewport",
8672
- "starters": "rp_FHUyRq_starters",
8673
- "message": "rp_FHUyRq_message",
8674
- "spin": "rp_FHUyRq_spin",
8675
- "notice": "rp_FHUyRq_notice",
8676
8712
  "grid": "rp_FHUyRq_grid",
8677
- "editTitle": "rp_FHUyRq_editTitle",
8713
+ "authorButton": "rp_FHUyRq_authorButton",
8714
+ "notice": "rp_FHUyRq_notice",
8715
+ "cell": "rp_FHUyRq_cell",
8716
+ "editHeader": "rp_FHUyRq_editHeader",
8717
+ "viewport": "rp_FHUyRq_viewport",
8678
8718
  "editBody": "rp_FHUyRq_editBody",
8719
+ "starters": "rp_FHUyRq_starters",
8720
+ "starter": "rp_FHUyRq_starter",
8721
+ "toolbarActions": "rp_FHUyRq_toolbarActions",
8722
+ "spinning": "rp_FHUyRq_spinning",
8679
8723
  "page": "rp_FHUyRq_page",
8680
8724
  "toolbar": "rp_FHUyRq_toolbar",
8681
- "spinning": "rp_FHUyRq_spinning",
8682
- "count": "rp_FHUyRq_count",
8683
- "editHeader": "rp_FHUyRq_editHeader",
8684
- "cell": "rp_FHUyRq_cell",
8685
- "authorButton": "rp_FHUyRq_authorButton",
8725
+ "editTitle": "rp_FHUyRq_editTitle",
8686
8726
  "fits": "rp_FHUyRq_fits",
8687
- "toolbarActions": "rp_FHUyRq_toolbarActions",
8688
8727
  "scrolls": "rp_FHUyRq_scrolls",
8689
- "starter": "rp_FHUyRq_starter"
8728
+ "message": "rp_FHUyRq_message",
8729
+ "spin": "rp_FHUyRq_spin",
8730
+ "count": "rp_FHUyRq_count"
8690
8731
  };
8691
8732
  //#endregion
8692
8733
  //#region src/client/pages/worlds/StarterWorlds.tsx
@@ -8785,44 +8826,44 @@ window.__ModuleLoader__.load({
8785
8826
  const pictureUrl = (id) => `${API_PREFIX}/worlds/import/picture?id=${encodeURIComponent(id)}`;
8786
8827
  //#endregion
8787
8828
  //#region \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/pages/worlds/ImportCardPage.module.css.mjs
8788
- const css$5 = ".rp_DmG_oG_page{flex-direction:column;flex:1 1 0;min-height:0;display:flex}.rp_DmG_oG_header{border-bottom:1px solid var(--dsw-alias-border-l3);flex:none;align-items:center;gap:8px;padding:8px 16px;display:flex}.rp_DmG_oG_title{color:var(--dsw-alias-label-primary);font-size:14px;font-weight:500}.rp_DmG_oG_space{flex:auto}.rp_DmG_oG_error{color:var(--dsw-alias-state-error-primary);margin:0;padding:8px 16px;font-size:12px}.rp_DmG_oG_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_DmG_oG_body>*{flex:none;width:100%;max-width:860px}.rp_DmG_oG_top{align-items:flex-start;gap:20px;display:flex}.rp_DmG_oG_picture{object-fit:cover;border:1px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);flex:0 0 120px;width:120px;height:160px}.rp_DmG_oG_noPicture{box-sizing:border-box;color:var(--dsw-alias-label-tertiary);justify-content:center;align-items:center;font-size:12px;display:flex}.rp_DmG_oG_about{flex-direction:column;flex:1 1 0;gap:8px;min-width:0;display:flex}.rp_DmG_oG_label{color:var(--dsw-alias-label-tertiary);flex-direction:column;gap:4px;font-size:12px;display:flex}.rp_DmG_oG_tags{flex-wrap:wrap;gap:6px;display:flex}.rp_DmG_oG_note{color:var(--dsw-alias-label-tertiary);margin:0;font-size:12px;line-height:18px}.rp_DmG_oG_section{flex-direction:column;gap:8px;display:flex}.rp_DmG_oG_heading{color:var(--dsw-alias-label-primary);margin:0;font-size:14px;font-weight:500}.rp_DmG_oG_row{align-items:center;gap:8px;display:flex}.rp_DmG_oG_field,.rp_DmG_oG_entry{border:1px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-sm)}.rp_DmG_oG_fieldHead,.rp_DmG_oG_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_DmG_oG_fieldHead{cursor:pointer}.rp_DmG_oG_fieldTitle,.rp_DmG_oG_entryTitle{min-width:0;color:var(--dsw-alias-label-primary);flex:auto;font-size:13px}.rp_DmG_oG_entryTitle{font:inherit;text-align:left;cursor:pointer;background:0 0;border:0;padding:0;font-size:13px}.rp_DmG_oG_fieldMeta{color:var(--dsw-alias-label-tertiary);font-size:12px}.rp_DmG_oG_field .rp_DmG_oG_note,.rp_DmG_oG_entry .rp_DmG_oG_note{padding:0 10px 6px}.rp_DmG_oG_text{white-space:pre-wrap;word-break:break-word;max-height:320px;font:inherit;color:var(--dsw-alias-label-secondary);border-top:1px solid var(--dsw-alias-border-l4);margin:0;padding:8px 10px 10px;font-size:12px;line-height:18px;overflow:auto}.rp_DmG_oG_entryOff .rp_DmG_oG_entryTitle{color:var(--dsw-alias-label-tertiary);text-decoration:line-through}.rp_DmG_oG_choice{border:1px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-sm);cursor:pointer;align-items:flex-start;gap:10px;padding:8px 10px;display:flex}.rp_DmG_oG_choice input{margin-top:3px}.rp_DmG_oG_choiceText{flex-direction:column;gap:4px;min-width:0;display:flex}.rp_DmG_oG_preview{white-space:pre-wrap;word-break:break-word;color:var(--dsw-alias-label-secondary);font-size:12px;line-height:18px}";
8789
- const key$5 = "src/client/pages/worlds/ImportCardPage.module.css";
8790
- let tag$5 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$5) + "]");
8791
- if (tag$5 === null) {
8792
- tag$5 = document.createElement("style");
8793
- tag$5.dataset.plugin = "@dsh-agentic-roleplay/core";
8794
- tag$5.dataset.pluginCss = key$5;
8795
- document.head.appendChild(tag$5);
8829
+ const css$7 = ".rp_DmG_oG_page{flex-direction:column;flex:1 1 0;min-height:0;display:flex}.rp_DmG_oG_header{border-bottom:1px solid var(--dsw-alias-border-l3);flex:none;align-items:center;gap:8px;padding:8px 16px;display:flex}.rp_DmG_oG_title{color:var(--dsw-alias-label-primary);font-size:14px;font-weight:500}.rp_DmG_oG_space{flex:auto}.rp_DmG_oG_error{color:var(--dsw-alias-state-error-primary);margin:0;padding:8px 16px;font-size:12px}.rp_DmG_oG_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_DmG_oG_body>*{flex:none;width:100%;max-width:860px}.rp_DmG_oG_top{align-items:flex-start;gap:20px;display:flex}.rp_DmG_oG_picture{object-fit:cover;border:1px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);flex:0 0 120px;width:120px;height:160px}.rp_DmG_oG_noPicture{box-sizing:border-box;color:var(--dsw-alias-label-tertiary);justify-content:center;align-items:center;font-size:12px;display:flex}.rp_DmG_oG_about{flex-direction:column;flex:1 1 0;gap:8px;min-width:0;display:flex}.rp_DmG_oG_label{color:var(--dsw-alias-label-tertiary);flex-direction:column;gap:4px;font-size:12px;display:flex}.rp_DmG_oG_tags{flex-wrap:wrap;gap:6px;display:flex}.rp_DmG_oG_note{color:var(--dsw-alias-label-tertiary);margin:0;font-size:12px;line-height:18px}.rp_DmG_oG_section{flex-direction:column;gap:8px;display:flex}.rp_DmG_oG_heading{color:var(--dsw-alias-label-primary);margin:0;font-size:14px;font-weight:500}.rp_DmG_oG_row{align-items:center;gap:8px;display:flex}.rp_DmG_oG_field,.rp_DmG_oG_entry{border:1px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-sm)}.rp_DmG_oG_fieldHead,.rp_DmG_oG_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_DmG_oG_fieldHead{cursor:pointer}.rp_DmG_oG_fieldTitle,.rp_DmG_oG_entryTitle{min-width:0;color:var(--dsw-alias-label-primary);flex:auto;font-size:13px}.rp_DmG_oG_entryTitle{font:inherit;text-align:left;cursor:pointer;background:0 0;border:0;padding:0;font-size:13px}.rp_DmG_oG_fieldMeta{color:var(--dsw-alias-label-tertiary);font-size:12px}.rp_DmG_oG_field .rp_DmG_oG_note,.rp_DmG_oG_entry .rp_DmG_oG_note{padding:0 10px 6px}.rp_DmG_oG_text{white-space:pre-wrap;word-break:break-word;max-height:320px;font:inherit;color:var(--dsw-alias-label-secondary);border-top:1px solid var(--dsw-alias-border-l4);margin:0;padding:8px 10px 10px;font-size:12px;line-height:18px;overflow:auto}.rp_DmG_oG_entryOff .rp_DmG_oG_entryTitle{color:var(--dsw-alias-label-tertiary);text-decoration:line-through}.rp_DmG_oG_choice{border:1px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-sm);cursor:pointer;align-items:flex-start;gap:10px;padding:8px 10px;display:flex}.rp_DmG_oG_choice input{margin-top:3px}.rp_DmG_oG_choiceText{flex-direction:column;gap:4px;min-width:0;display:flex}.rp_DmG_oG_preview{white-space:pre-wrap;word-break:break-word;color:var(--dsw-alias-label-secondary);font-size:12px;line-height:18px}";
8830
+ const key$7 = "src/client/pages/worlds/ImportCardPage.module.css";
8831
+ let tag$7 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$7) + "]");
8832
+ if (tag$7 === null) {
8833
+ tag$7 = document.createElement("style");
8834
+ tag$7.dataset.plugin = "@dsh-agentic-roleplay/core";
8835
+ tag$7.dataset.pluginCss = key$7;
8836
+ document.head.appendChild(tag$7);
8796
8837
  }
8797
- tag$5.textContent = css$5;
8838
+ tag$7.textContent = css$7;
8798
8839
  var ImportCardPage_module_css_default = {
8799
- "field": "rp_DmG_oG_field",
8800
- "choiceText": "rp_DmG_oG_choiceText",
8801
- "entryTitle": "rp_DmG_oG_entryTitle",
8802
- "note": "rp_DmG_oG_note",
8803
- "title": "rp_DmG_oG_title",
8804
- "space": "rp_DmG_oG_space",
8840
+ "header": "rp_DmG_oG_header",
8841
+ "picture": "rp_DmG_oG_picture",
8842
+ "top": "rp_DmG_oG_top",
8843
+ "label": "rp_DmG_oG_label",
8805
8844
  "tags": "rp_DmG_oG_tags",
8806
- "row": "rp_DmG_oG_row",
8845
+ "entry": "rp_DmG_oG_entry",
8846
+ "error": "rp_DmG_oG_error",
8807
8847
  "fieldMeta": "rp_DmG_oG_fieldMeta",
8808
- "fieldTitle": "rp_DmG_oG_fieldTitle",
8848
+ "text": "rp_DmG_oG_text",
8849
+ "title": "rp_DmG_oG_title",
8850
+ "about": "rp_DmG_oG_about",
8851
+ "choice": "rp_DmG_oG_choice",
8852
+ "space": "rp_DmG_oG_space",
8809
8853
  "page": "rp_DmG_oG_page",
8810
- "fieldHead": "rp_DmG_oG_fieldHead",
8811
- "top": "rp_DmG_oG_top",
8812
8854
  "heading": "rp_DmG_oG_heading",
8813
- "text": "rp_DmG_oG_text",
8855
+ "body": "rp_DmG_oG_body",
8856
+ "fieldHead": "rp_DmG_oG_fieldHead",
8814
8857
  "section": "rp_DmG_oG_section",
8815
- "entry": "rp_DmG_oG_entry",
8816
- "header": "rp_DmG_oG_header",
8817
- "picture": "rp_DmG_oG_picture",
8818
8858
  "entryHead": "rp_DmG_oG_entryHead",
8819
- "entryOff": "rp_DmG_oG_entryOff",
8820
- "body": "rp_DmG_oG_body",
8859
+ "fieldTitle": "rp_DmG_oG_fieldTitle",
8860
+ "choiceText": "rp_DmG_oG_choiceText",
8861
+ "field": "rp_DmG_oG_field",
8862
+ "row": "rp_DmG_oG_row",
8821
8863
  "noPicture": "rp_DmG_oG_noPicture",
8822
- "choice": "rp_DmG_oG_choice",
8823
- "error": "rp_DmG_oG_error",
8824
- "label": "rp_DmG_oG_label",
8825
- "about": "rp_DmG_oG_about",
8864
+ "note": "rp_DmG_oG_note",
8865
+ "entryOff": "rp_DmG_oG_entryOff",
8866
+ "entryTitle": "rp_DmG_oG_entryTitle",
8826
8867
  "preview": "rp_DmG_oG_preview"
8827
8868
  };
8828
8869
  //#endregion
@@ -9436,7 +9477,7 @@ window.__ModuleLoader__.load({
9436
9477
  }
9437
9478
  //#endregion
9438
9479
  //#region src/client/settings-form/locales.ts
9439
- const dictionaries$5 = {
9480
+ const dictionaries$6 = {
9440
9481
  en: {
9441
9482
  samplingMaster: "Temperature: game master",
9442
9483
  samplingMasterHelp: "How freely the game master decides and narrates (0 to 2). Lower keeps its calls and the world consistent.",
@@ -9458,6 +9499,10 @@ window.__ModuleLoader__.load({
9458
9499
  recallHelp: "The most memories brought back to a character each time it acts, chosen by what the moment calls to mind.",
9459
9500
  overRetrieve: "Memories considered per memory recalled",
9460
9501
  overRetrieveHelp: "To choose what a character is reminded of, this many times as many candidates are retrieved (by the moment's cues, by words and by meaning) and the best are kept; a reranking service, when one is configured, judges the wider net. 1 chooses straight from the first search.",
9502
+ associate: "Memories that come to mind with others",
9503
+ associateHelp: "The most extra memories a character is reminded of because they are strongly tied (the same people together with the same place or tags) to something the moment called to mind, and matter enough. 0 turns it off.",
9504
+ diversity: "Spread of what is recalled",
9505
+ diversityHelp: "From 0 to 1: how much a memory that says what one already chosen says counts against it, so that a character is not reminded of the same moment several times. 0 chooses by score alone.",
9461
9506
  lookup: "Characters can look up memories",
9462
9507
  lookupHelp: "While it decides, a character can ask itself about something it remembers beyond what the moment already brought to mind. Each character only reaches its own memories. It makes a character's turn a little longer.",
9463
9508
  lookupCalls: "Memory look-ups per decision",
@@ -9514,6 +9559,8 @@ window.__ModuleLoader__.load({
9514
9559
  factionsPerTurnHelp: "The most organisations that decide what they do after one of your messages, when story time has passed since they last did. Each is one request in the background. 0 turns it off.",
9515
9560
  factionsEveryDays: "Days between their decisions",
9516
9561
  factionsEveryDaysHelp: "How many days of story time pass before an organisation decides again.",
9562
+ modelsBackground: "Model for background characters",
9563
+ modelsBackgroundHelp: "As provider/model. Characters of the background tier (crowds, passers-by) run on this model; empty uses the model for characters. They take part in the same way as the others, only on a cheaper model.",
9517
9564
  modelsCharacters: "Model for characters",
9518
9565
  modelsCharactersHelp: "As provider/model. Leave empty to use the chat's own model. Characters run side by side and write short answers, so a smaller, faster model often does as well.",
9519
9566
  modelsRecords: "Model for the record keeper",
@@ -9533,6 +9580,10 @@ window.__ModuleLoader__.load({
9533
9580
  offstagePerTurn: "Characters acting off stage per turn",
9534
9581
  offstagePerCharacter: "Times one character acts off stage per turn",
9535
9582
  offstagePerCharacterHelp: "A character with several things due is asked about the first; the rest wait for your next turn. With the limit above, this caps what the world does without you: nothing runs while you are away from the chat, and each message you send lets at most this many characters act.",
9583
+ interfacePack: "Interface pack",
9584
+ interfacePackHelp: "The interface pack this story uses. Empty uses the first pack the story carries; \"none\" turns packs off and shows the plain chat; a name picks that pack of the story, or of your roleplay folder's ui folder.",
9585
+ diagnosticsKeepRuns: "Keep what the helpers were told",
9586
+ diagnosticsKeepRunsHelp: "Each helper run (a character, the record keeper, the suggestions) keeps its instructions, what it was asked, its tool calls and its result, for the latest 60 runs. Open a run in the activity list to see why it said or wrote what it did. The texts include what the characters know in private, so leave it off unless you are looking for a problem.",
9536
9587
  offstageJoint: "Meetings happen between people",
9537
9588
  offstageJointHelp: "The people of one off-stage commitment decide one after another, each told who has already meant to come, so they meet instead of each guessing. It takes longer in the background but asks the same number of times. Off: each decides alone, all at once.",
9538
9589
  offstageSummary: "Tell me what happened meanwhile",
@@ -9581,6 +9632,10 @@ window.__ModuleLoader__.load({
9581
9632
  recallHelp: "角色每次行动时最多被唤起的记忆条数,按当前情境联想到的内容挑选。",
9582
9633
  overRetrieve: "每条回忆的候选倍数",
9583
9634
  overRetrieveHelp: "为了选出角色被唤起的记忆,会先检索出此倍数的候选(按情境线索、字词和语义),再保留最好的;若已配置重排序服务,则由它评判这张更大的网。1 表示直接从第一次检索中选取。",
9635
+ diversity: "回忆的分散程度",
9636
+ diversityHelp: "0 到 1:与已选中的某条记忆说的是同一件事的记忆要被扣多少分,这样角色就不会把同一个时刻想起好几遍。0 表示只按得分选择。",
9637
+ associate: "顺带想起的记忆",
9638
+ associateHelp: "角色会因为与当前情境唤起的某件事紧密相连(相同的人物,加上相同的地点或标签)且足够重要,而顺带想起的额外记忆的最大条数。0 表示关闭。",
9584
9639
  lookup: "角色可主动回忆",
9585
9640
  lookupHelp: "角色在决定行动时,可以主动向自己追问更多记忆,超出当前情境已唤起的部分。每个角色只能查到自己的记忆。会让角色的回合稍长一些。",
9586
9641
  lookupCalls: "每次决定的记忆查询次数",
@@ -9637,6 +9692,8 @@ window.__ModuleLoader__.load({
9637
9692
  factionsPerTurnHelp: "你发送一条消息后,最多让多少个组织决定自己的行动(前提是自它们上次行动以来故事时间已经过去)。每个组织占用一次后台请求。0 表示关闭。",
9638
9693
  factionsEveryDays: "决策间隔天数",
9639
9694
  factionsEveryDaysHelp: "组织再次决策之前要经过多少天故事时间。",
9695
+ modelsBackground: "背景角色使用的模型",
9696
+ modelsBackgroundHelp: "写成 提供方/模型。背景层级的角色(人群、路人)使用此模型;留空则使用“角色使用的模型”。它们的参与方式与其他角色相同,只是换成更便宜的模型。",
9640
9697
  modelsCharacters: "角色使用的模型",
9641
9698
  modelsCharactersHelp: "写成 提供方/模型。留空则使用对话自己的模型。角色并行运行且回答简短,较小较快的模型通常也能胜任。",
9642
9699
  modelsRecords: "记录员使用的模型",
@@ -9656,6 +9713,10 @@ window.__ModuleLoader__.load({
9656
9713
  offstagePerTurn: "每轮台下行动的角色数",
9657
9714
  offstagePerCharacter: "每个角色每轮台下行动次数",
9658
9715
  offstagePerCharacterHelp: "同一角色有多件事到期时,只询问第一件,其余等你的下一轮。配合上面的上限,这限制了世界在无人操作时的行动:你离开聊天时什么都不会运行,你每发一条消息最多让这么多次角色行动。",
9716
+ interfacePack: "界面包",
9717
+ interfacePackHelp: "此故事使用的界面包。留空则使用故事自带的第一个包;填 \"none\" 则关闭界面包并显示普通聊天;填名称则选用故事中的该包,或角色扮演目录 ui 文件夹中的该包。",
9718
+ diagnosticsKeepRuns: "保留助手收到的内容",
9719
+ diagnosticsKeepRunsHelp: "每次助手运行(角色、记录员、建议)都会保存它的指令、被问的内容、工具调用和结果,保留最近 60 次。在活动列表中打开一次运行,可查看它为何那样说或写。内容包含角色私下所知的信息,因此除非要排查问题,请保持关闭。",
9659
9720
  offstageJoint: "约定在人与人之间发生",
9660
9721
  offstageJointHelp: "同一个台下约定的人依次决定,后者会被告知谁已决定前来,因此他们会碰面而不是各自猜测。后台耗时更长,但请求次数不变。关闭则各自同时独立决定。",
9661
9722
  offstageSummary: "告诉我期间发生了什么",
@@ -9684,7 +9745,7 @@ window.__ModuleLoader__.load({
9684
9745
  embeddingOptionsHelp: "所选嵌入提供方允许本对话为每次请求设置的内容。留空则使用提供方自己的设置。"
9685
9746
  }
9686
9747
  };
9687
- const dictionaries$4 = withDictionaries(withDictionaries({
9748
+ const dictionaries$5 = withDictionaries(withDictionaries({
9688
9749
  en: {
9689
9750
  nav: "Worlds",
9690
9751
  loading: "Loading worlds…",
@@ -9875,7 +9936,7 @@ window.__ModuleLoader__.load({
9875
9936
  startAvatars: "带上角色形象",
9876
9937
  startAvatarsHelp: "勾选要带进这个存档的角色形象,它们会成为存档中的角色,你也可以扮演它们。世界本身不会改变。"
9877
9938
  }
9878
- }, dictionaries$5), dictionaries$8);
9939
+ }, dictionaries$6), dictionaries$9);
9879
9940
  //#endregion
9880
9941
  //#region src/client/pages/worlds/worlds-controller.ts
9881
9942
  async function request$1(path, init, signal) {
@@ -10108,11 +10169,11 @@ window.__ModuleLoader__.load({
10108
10169
  };
10109
10170
  //#endregion
10110
10171
  //#region src/client/pages/worlds/index.ts
10111
- const NAMESPACE$6 = "roleplay.worlds";
10172
+ const NAMESPACE$7 = "roleplay.worlds";
10112
10173
  /** Adds the Worlds page to the Role Play panel. */
10113
10174
  function registerWorldsPage(ctx) {
10114
- const t = ctx.locale.bind(NAMESPACE$6);
10115
- ctx.effect(() => ctx.locale.register(NAMESPACE$6, dictionaries$4), "roleplay: worlds dictionaries");
10175
+ const t = ctx.locale.bind(NAMESPACE$7);
10176
+ ctx.effect(() => ctx.locale.register(NAMESPACE$7, dictionaries$5), "roleplay: worlds dictionaries");
10116
10177
  const worlds = new WorldsController(createChatOpener(ctx), () => t("language"));
10117
10178
  ctx.effect(() => () => {
10118
10179
  worlds.dispose();
@@ -10122,7 +10183,7 @@ window.__ModuleLoader__.load({
10122
10183
  id: "worlds",
10123
10184
  order: 0,
10124
10185
  label: () => t("nav"),
10125
- locale: NAMESPACE$6,
10186
+ locale: NAMESPACE$7,
10126
10187
  inject: () => worlds.inject()
10127
10188
  }, WorldsPage));
10128
10189
  }
@@ -10222,20 +10283,20 @@ window.__ModuleLoader__.load({
10222
10283
  };
10223
10284
  //#endregion
10224
10285
  //#region \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/branch/BranchDialog.module.css.mjs
10225
- const css$4 = ".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}";
10226
- const key$4 = "src/client/branch/BranchDialog.module.css";
10227
- let tag$4 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$4) + "]");
10228
- if (tag$4 === null) {
10229
- tag$4 = document.createElement("style");
10230
- tag$4.dataset.plugin = "@dsh-agentic-roleplay/core";
10231
- tag$4.dataset.pluginCss = key$4;
10232
- document.head.appendChild(tag$4);
10286
+ const css$6 = ".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}";
10287
+ const key$6 = "src/client/branch/BranchDialog.module.css";
10288
+ let tag$6 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$6) + "]");
10289
+ if (tag$6 === null) {
10290
+ tag$6 = document.createElement("style");
10291
+ tag$6.dataset.plugin = "@dsh-agentic-roleplay/core";
10292
+ tag$6.dataset.pluginCss = key$6;
10293
+ document.head.appendChild(tag$6);
10233
10294
  }
10234
- tag$4.textContent = css$4;
10295
+ tag$6.textContent = css$6;
10235
10296
  var BranchDialog_module_css_default = {
10236
- "label": "rp_Dy1TaW_label",
10237
10297
  "field": "rp_Dy1TaW_field",
10238
10298
  "form": "rp_Dy1TaW_form",
10299
+ "label": "rp_Dy1TaW_label",
10239
10300
  "error": "rp_Dy1TaW_error"
10240
10301
  };
10241
10302
  //#endregion
@@ -10305,7 +10366,7 @@ window.__ModuleLoader__.load({
10305
10366
  }
10306
10367
  //#endregion
10307
10368
  //#region src/client/branch/locales.ts
10308
- const dictionaries$3 = {
10369
+ const dictionaries$4 = {
10309
10370
  en: {
10310
10371
  title: "Name the branch",
10311
10372
  description: "A new session was made from the story at this point; the first one is as it was.",
@@ -10329,10 +10390,10 @@ window.__ModuleLoader__.load({
10329
10390
  };
10330
10391
  //#endregion
10331
10392
  //#region src/client/branch/index.ts
10332
- const NAMESPACE$5 = "roleplay.branch";
10393
+ const NAMESPACE$6 = "roleplay.branch";
10333
10394
  /** 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. */
10334
10395
  function registerBranchNaming(ctx) {
10335
- ctx.effect(() => ctx.locale.register(NAMESPACE$5, dictionaries$3), "roleplay: branch dictionaries");
10396
+ ctx.effect(() => ctx.locale.register(NAMESPACE$6, dictionaries$4), "roleplay: branch dictionaries");
10336
10397
  const branches = new BranchController();
10337
10398
  ctx.inject(["sessions"], (inner) => {
10338
10399
  const sessions = inner.get("sessions");
@@ -10341,7 +10402,7 @@ window.__ModuleLoader__.load({
10341
10402
  ctx.slots.inject("shell.overlay", () => ctx.slots.register({
10342
10403
  name: "shell.overlay",
10343
10404
  id: "roleplay-branch",
10344
- locale: NAMESPACE$5,
10405
+ locale: NAMESPACE$6,
10345
10406
  inject: () => branches.inject()
10346
10407
  }, BranchDialog));
10347
10408
  }
@@ -10365,11 +10426,11 @@ window.__ModuleLoader__.load({
10365
10426
  }
10366
10427
  //#endregion
10367
10428
  //#region src/client/gallery/index.ts
10368
- const NAMESPACE$4 = "roleplay.gallery";
10369
- const VIEW_ID$2 = "roleplay-gallery";
10429
+ const NAMESPACE$5 = "roleplay.gallery";
10430
+ const VIEW_ID$3 = "roleplay-gallery";
10370
10431
  /** The shell activates a data target for every view tab; this tab reads from the host itself, so its target is empty. */
10371
10432
  const galleryTarget = {
10372
- target: VIEW_ID$2,
10433
+ target: VIEW_ID$3,
10373
10434
  create: () => ({
10374
10435
  empty: {},
10375
10436
  replace: () => ({}),
@@ -10378,20 +10439,941 @@ window.__ModuleLoader__.load({
10378
10439
  };
10379
10440
  /** Adds the Gallery tab beside Chat and World: every image of the session in a grid. */
10380
10441
  function registerGallery(ctx) {
10381
- const t = ctx.locale.bind(NAMESPACE$4);
10382
- ctx.effect(() => ctx.locale.register(NAMESPACE$4, dictionaries$9), "roleplay: gallery dictionaries");
10442
+ const t = ctx.locale.bind(NAMESPACE$5);
10443
+ ctx.effect(() => ctx.locale.register(NAMESPACE$5, dictionaries$10), "roleplay: gallery dictionaries");
10383
10444
  ctx.inject(["uiConversation"], (scope) => {
10384
10445
  scope.uiConversation.views.register(galleryTarget);
10385
10446
  scope.slots.inject("conversation.view", () => scope.slots.register({
10386
10447
  name: "conversation.view",
10387
- id: VIEW_ID$2,
10448
+ id: VIEW_ID$3,
10388
10449
  order: 15,
10389
10450
  label: () => t("tab"),
10390
- locale: NAMESPACE$4
10451
+ locale: NAMESPACE$5
10391
10452
  }, GalleryTab));
10392
10453
  });
10393
10454
  }
10394
10455
  //#endregion
10456
+ //#region src/client/chat-input.ts
10457
+ /** 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. */
10458
+ function facadeOf(scope, sessionId) {
10459
+ const input = () => {
10460
+ const actx = scope.get("sessions")?.scope(sessionId);
10461
+ const conversation = actx?.get("conversation");
10462
+ if (actx === void 0 || conversation === void 0) throw new Error("the input of this chat is not available");
10463
+ return conversation.input.for(actx);
10464
+ };
10465
+ return {
10466
+ pick: (text) => {
10467
+ input().setDraft(text);
10468
+ },
10469
+ fill: (text, send) => {
10470
+ const facade = input();
10471
+ facade.setDraft(text);
10472
+ if (send) facade.submit();
10473
+ }
10474
+ };
10475
+ }
10476
+ //#endregion
10477
+ //#region src/client/interface/api.ts
10478
+ /** The host says why in `message`; a failure that has none is told by its status. */
10479
+ async function read(response, what) {
10480
+ if (!response.ok) throw new Error((await response.json().catch(() => ({}))).message ?? `${what} (${response.status})`);
10481
+ return await response.json();
10482
+ }
10483
+ const enc = encodeURIComponent;
10484
+ async function packOf(session) {
10485
+ return read(await fetch(`roleplay-api/sessions/interface?id=${enc(session)}`), "the interface pack could not be read");
10486
+ }
10487
+ async function viewOf(session, revision) {
10488
+ return read(await fetch(`roleplay-api/sessions/interface/view?id=${enc(session)}${revision === void 0 ? "" : `&revision=${enc(revision)}`}`), "the story could not be read");
10489
+ }
10490
+ async function historyOf(session, limit) {
10491
+ return read(await fetch(`roleplay-api/sessions/interface/history?id=${enc(session)}&limit=${limit}`), "the story so far could not be read");
10492
+ }
10493
+ async function storeOf(session, request) {
10494
+ return (await read(await fetch(`roleplay-api/sessions/interface/storage?id=${enc(session)}`, {
10495
+ method: "POST",
10496
+ headers: { "content-type": "application/json" },
10497
+ body: JSON.stringify(request)
10498
+ }), "the pack could not keep that")).value;
10499
+ }
10500
+ async function availability() {
10501
+ return read(await fetch("roleplay-api/interface/availability"), "the interface packs could not be looked up");
10502
+ }
10503
+ /** The address of a surface of the pack: its files are found beside it by their relative addresses, so the key stands in the path. */
10504
+ const frameAddress = (key, file, revision) => `roleplay-api/sessions/interface/frame/${enc(key)}/${file.split("/").map(enc).join("/")}?r=${enc(revision)}`;
10505
+ //#endregion
10506
+ //#region src/client/interface/conversation-body.ts
10507
+ /**
10508
+ * The element that holds a session's transcript and what is drawn behind it, found from something inside the same
10509
+ * conversation: the closest ancestor that contains the scrolling body of the chat, and that body's parent.
10510
+ */
10511
+ function conversationBody(from) {
10512
+ for (let at = from.parentElement; at !== null; at = at.parentElement) {
10513
+ const scroll = at.querySelector("[class*=\"_scrollBody\"]");
10514
+ if (scroll?.parentElement != null) return {
10515
+ body: scroll.parentElement,
10516
+ scroll
10517
+ };
10518
+ }
10519
+ }
10520
+ //#endregion
10521
+ //#region src/client/interface/backdrop.ts
10522
+ const LIFTED = "data-rp-lifted";
10523
+ const STYLE = "data-roleplay-backdrop-style";
10524
+ /**
10525
+ * A layer behind the transcript of the chat that `anchor` stands in, for a pack's backdrop. The conversation paints its
10526
+ * own opaque background and its scrolling body above any layer under it, so the layer is put first in the body and the
10527
+ * scrolling body is lifted over it; both stay transparent to clicks. When the page is not built as expected there is
10528
+ * no layer and a note in the console, and the story plays as it does without a backdrop.
10529
+ */
10530
+ function useBackdropHost(anchor, enabled) {
10531
+ const [host, setHost] = (0, react.useState)(void 0);
10532
+ (0, react.useEffect)(() => {
10533
+ const from = anchor.current;
10534
+ if (!enabled || from === null) {
10535
+ setHost(void 0);
10536
+ return;
10537
+ }
10538
+ const found = conversationBody(from);
10539
+ if (found === void 0) {
10540
+ console.warn("roleplay: the interface pack has a backdrop, but this page has no place for one");
10541
+ setHost(void 0);
10542
+ return;
10543
+ }
10544
+ const layer = document.createElement("div");
10545
+ layer.setAttribute("data-rp", "backdrop");
10546
+ layer.style.cssText = "position:absolute;inset:0;z-index:0;pointer-events:none;overflow:hidden";
10547
+ found.body.insertBefore(layer, found.body.firstChild);
10548
+ found.scroll.setAttribute(LIFTED, "");
10549
+ let style = document.head.querySelector(`style[${STYLE}]`);
10550
+ if (style === null) {
10551
+ style = document.createElement("style");
10552
+ style.setAttribute(STYLE, "");
10553
+ style.textContent = `[${LIFTED}]{position:relative;z-index:1}`;
10554
+ document.head.append(style);
10555
+ }
10556
+ setHost(layer);
10557
+ return () => {
10558
+ layer.remove();
10559
+ found.scroll.removeAttribute(LIFTED);
10560
+ if (document.querySelector(`[${LIFTED}]`) === null) document.head.querySelector(`style[${STYLE}]`)?.remove();
10561
+ setHost(void 0);
10562
+ };
10563
+ }, [anchor, enabled]);
10564
+ return host;
10565
+ }
10566
+ //#endregion
10567
+ //#region src/client/interface/hooks.ts
10568
+ const PACK_POLL_MS = 4e3;
10569
+ const VIEW_POLL_MS = 2e3;
10570
+ /**
10571
+ * One poll of the host for everyone who wants the same thing: the strips, the tab and the backdrop of a story all
10572
+ * read the same pack and view, so they share the request instead of each making their own.
10573
+ */
10574
+ function useShared(cache, key, active, fetch, onError, interval) {
10575
+ const [value, setValue] = (0, react.useState)(key === void 0 ? void 0 : cache.get(key)?.value);
10576
+ (0, react.useEffect)(() => {
10577
+ if (key === void 0 || !active) {
10578
+ setValue(void 0);
10579
+ return;
10580
+ }
10581
+ let entry = cache.get(key);
10582
+ if (entry === void 0) {
10583
+ const created = {
10584
+ listeners: /* @__PURE__ */ new Set(),
10585
+ value: void 0,
10586
+ stop: () => void 0
10587
+ };
10588
+ entry = created;
10589
+ cache.set(key, created);
10590
+ let stopped = false;
10591
+ let timer;
10592
+ const look = () => {
10593
+ fetch(created.value).then((next) => {
10594
+ created.value = next;
10595
+ }, (error) => {
10596
+ created.value = onError(error);
10597
+ }).finally(() => {
10598
+ if (stopped) return;
10599
+ for (const listener of created.listeners) listener(created.value);
10600
+ timer = setTimeout(look, interval);
10601
+ });
10602
+ };
10603
+ created.stop = () => {
10604
+ stopped = true;
10605
+ if (timer !== void 0) clearTimeout(timer);
10606
+ };
10607
+ look();
10608
+ }
10609
+ const listener = (next) => {
10610
+ setValue((previous) => previous === next ? previous : next);
10611
+ };
10612
+ entry.listeners.add(listener);
10613
+ setValue(entry.value);
10614
+ return () => {
10615
+ entry.listeners.delete(listener);
10616
+ if (entry.listeners.size === 0) {
10617
+ entry.stop();
10618
+ cache.delete(key);
10619
+ }
10620
+ };
10621
+ }, [
10622
+ cache,
10623
+ key,
10624
+ active,
10625
+ interval
10626
+ ]);
10627
+ return value;
10628
+ }
10629
+ const packs = /* @__PURE__ */ new Map();
10630
+ const views = /* @__PURE__ */ new Map();
10631
+ /** The interface pack of a story, looked at again from time to time so that an edited file shows. A session the host does not know has none. */
10632
+ function usePack(session) {
10633
+ return useShared(packs, session, true, async (previous) => {
10634
+ const found = await packOf(session);
10635
+ return previous !== void 0 && JSON.stringify(previous) === JSON.stringify(found) ? previous : found;
10636
+ }, () => ({
10637
+ pack: null,
10638
+ problems: []
10639
+ }), PACK_POLL_MS);
10640
+ }
10641
+ /** What the player may know of the story, kept up to date while `active`. */
10642
+ function usePlayerView(session, active) {
10643
+ return useShared(views, session, active, async (previous) => {
10644
+ const reply = await viewOf(session, previous?.revision);
10645
+ return reply.unchanged !== true && "view" in reply ? reply.view : previous;
10646
+ }, (error) => {
10647
+ console.warn("roleplay: the story could not be read for the interface pack", error);
10648
+ }, VIEW_POLL_MS);
10649
+ }
10650
+ //#endregion
10651
+ //#region src/shared/interface-pack.ts
10652
+ /** The surfaces that sit in a strip of the chat and so have a height of their own, with the heights they may ask for. */
10653
+ const STRIP_HEIGHTS = {
10654
+ hud: {
10655
+ min: 24,
10656
+ max: 320,
10657
+ fallback: 56
10658
+ },
10659
+ dock: {
10660
+ min: 24,
10661
+ max: 320,
10662
+ fallback: 48
10663
+ },
10664
+ opening: {
10665
+ min: 120,
10666
+ max: 640,
10667
+ fallback: 320
10668
+ }
10669
+ };
10670
+ const isStrip = (name) => name in STRIP_HEIGHTS;
10671
+ const PACK_LIMITS = {
10672
+ files: 200,
10673
+ bytes: 5242880,
10674
+ fileBytes: 1048576,
10675
+ depth: 4,
10676
+ storageBytes: 65536,
10677
+ history: {
10678
+ fallback: 20,
10679
+ max: 100
10680
+ }
10681
+ };
10682
+ /** The longest words a surface may send as the player. */
10683
+ const MAX_WORDS = 2e3;
10684
+ /** How long a surface waits before it may speak again when the turn does not move. */
10685
+ const SAY_AGAIN_AFTER_MS = 3e4;
10686
+ /** Reads what came through `postMessage`; anything that is not the protocol is nothing. */
10687
+ function parseFrameMessage(data) {
10688
+ if (typeof data !== "object" || data === null) return void 0;
10689
+ const message = data;
10690
+ if (message["rp"] !== 1) return void 0;
10691
+ if (message["type"] === "hello") return { type: "hello" };
10692
+ if (message["type"] === "resize") return typeof message["height"] === "number" && Number.isFinite(message["height"]) ? {
10693
+ type: "resize",
10694
+ height: message["height"]
10695
+ } : void 0;
10696
+ if (message["type"] === "request" && typeof message["id"] === "number" && typeof message["method"] === "string") {
10697
+ const params = message["params"];
10698
+ return {
10699
+ type: "request",
10700
+ id: message["id"],
10701
+ method: message["method"],
10702
+ params: typeof params === "object" && params !== null && !Array.isArray(params) ? params : {}
10703
+ };
10704
+ }
10705
+ }
10706
+ /** The height a surface may ask for, as the interface allows it for that strip. */
10707
+ function clampHeight(height, surface) {
10708
+ const { min, max } = STRIP_HEIGHTS[surface];
10709
+ return Math.min(max, Math.max(min, Math.round(height)));
10710
+ }
10711
+ const text = (params, name) => {
10712
+ const value = params[name];
10713
+ if (typeof value !== "string") throw new Error(`${name} must be text`);
10714
+ return value;
10715
+ };
10716
+ /** Answers a surface's requests: what the pack was allowed to ask in its manifest, within limits, nothing else. */
10717
+ var Bridge = class {
10718
+ env;
10719
+ stamps = [];
10720
+ spoke;
10721
+ constructor(env) {
10722
+ this.env = env;
10723
+ }
10724
+ async answer(message) {
10725
+ try {
10726
+ return {
10727
+ ok: true,
10728
+ value: await this.run(message.method, message.params)
10729
+ };
10730
+ } catch (error) {
10731
+ return {
10732
+ ok: false,
10733
+ error: error instanceof Error ? error.message : String(error)
10734
+ };
10735
+ }
10736
+ }
10737
+ allowed(action) {
10738
+ if (!this.env.actions.includes(action)) throw new Error(`the pack did not ask for "${action}" in its pack.json actions`);
10739
+ }
10740
+ words(params) {
10741
+ const words = text(params, "text").trim();
10742
+ if (words === "") throw new Error("there are no words");
10743
+ if (words.length > 2e3) throw new Error(`words are at most ${MAX_WORDS} characters`);
10744
+ return words;
10745
+ }
10746
+ async run(method, params) {
10747
+ const now = this.env.now();
10748
+ while (this.stamps.length > 0 && now - this.stamps[0] >= 1e3) this.stamps.shift();
10749
+ if (this.stamps.length >= 20) throw new Error("too many requests; at most 20 a second");
10750
+ this.stamps.push(now);
10751
+ const view = this.env.view();
10752
+ switch (method) {
10753
+ case "state":
10754
+ if (view === void 0) throw new Error("the story has not been read yet");
10755
+ return view;
10756
+ case "say": {
10757
+ this.allowed("say");
10758
+ const turn = view?.story.turn ?? 0;
10759
+ if (this.spoke !== void 0 && this.spoke.turn === turn && now - this.spoke.at < SAY_AGAIN_AFTER_MS) throw new Error("already said something this turn; wait for the story to answer");
10760
+ const words = this.words(params);
10761
+ this.spoke = {
10762
+ turn,
10763
+ at: now
10764
+ };
10765
+ await this.env.say(words);
10766
+ return null;
10767
+ }
10768
+ case "fill":
10769
+ this.allowed("fill");
10770
+ await this.env.fill(this.words(params));
10771
+ return null;
10772
+ case "choose": {
10773
+ this.allowed("choose");
10774
+ const index = params["index"];
10775
+ const chosen = typeof index === "number" && Number.isInteger(index) ? view?.suggestions[index] : void 0;
10776
+ if (chosen === void 0) throw new Error("there is no such suggestion");
10777
+ await this.env.fill(chosen);
10778
+ return null;
10779
+ }
10780
+ case "open": {
10781
+ this.allowed("open");
10782
+ const surface = params["surface"];
10783
+ if (surface !== "tab" && surface !== "sidebar") throw new Error("surface must be \"tab\" or \"sidebar\"");
10784
+ await this.env.open(surface);
10785
+ return null;
10786
+ }
10787
+ case "storage.get": return await this.env.storage("get", text(params, "key"));
10788
+ case "storage.set":
10789
+ await this.env.storage("set", text(params, "key"), params["value"]);
10790
+ return null;
10791
+ case "storage.remove":
10792
+ await this.env.storage("remove", text(params, "key"));
10793
+ return null;
10794
+ case "history": {
10795
+ const asked = params["limit"];
10796
+ const limit = typeof asked === "number" && Number.isInteger(asked) && asked >= 1 ? Math.min(asked, PACK_LIMITS.history.max) : PACK_LIMITS.history.fallback;
10797
+ return await this.env.history(limit);
10798
+ }
10799
+ case "theme": return this.env.theme();
10800
+ default: throw new Error(`there is no rp.${method}`);
10801
+ }
10802
+ }
10803
+ };
10804
+ //#endregion
10805
+ //#region \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/interface/PackFrame.module.css.mjs
10806
+ const css$5 = ".rp_bMXf9W_frame{background:0 0;border:0;width:100%;display:block}.rp_bMXf9W_fill{height:100%;min-height:0}.rp_bMXf9W_message{color:var(--dsw-alias-label-secondary);margin:0;padding:16px 24px;font-size:13px;line-height:20px}.rp_bMXf9W_problems{color:var(--dsw-alias-label-tertiary);margin:8px 0 0;padding-left:18px;font-size:12px}.rp_bMXf9W_hud{box-sizing:border-box;width:min(800px,100%);margin:0 auto 8px;padding:0 16px}.rp_bMXf9W_tab{flex-direction:column;flex:1 1 0;width:100%;min-height:0;display:flex}";
10807
+ const key$5 = "src/client/interface/PackFrame.module.css";
10808
+ let tag$5 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$5) + "]");
10809
+ if (tag$5 === null) {
10810
+ tag$5 = document.createElement("style");
10811
+ tag$5.dataset.plugin = "@dsh-agentic-roleplay/core";
10812
+ tag$5.dataset.pluginCss = key$5;
10813
+ document.head.appendChild(tag$5);
10814
+ }
10815
+ tag$5.textContent = css$5;
10816
+ var PackFrame_module_css_default = {
10817
+ "frame": "rp_bMXf9W_frame",
10818
+ "fill": "rp_bMXf9W_fill",
10819
+ "message": "rp_bMXf9W_message",
10820
+ "hud": "rp_bMXf9W_hud",
10821
+ "tab": "rp_bMXf9W_tab",
10822
+ "problems": "rp_bMXf9W_problems"
10823
+ };
10824
+ //#endregion
10825
+ //#region src/client/interface/theme.ts
10826
+ /** The colours of DSH a surface is given, so that it looks right in light and dark. */
10827
+ const SHARED_TOKENS = [
10828
+ "--dsw-alias-bg-base",
10829
+ "--dsw-alias-bg-layer-1",
10830
+ "--dsw-alias-bg-layer-2",
10831
+ "--dsw-alias-bg-overlay",
10832
+ "--dsw-alias-border-l1",
10833
+ "--dsw-alias-border-l2",
10834
+ "--dsw-alias-border-l3",
10835
+ "--dsw-alias-border-l4",
10836
+ "--dsw-alias-brand-primary",
10837
+ "--dsw-alias-label-primary",
10838
+ "--dsw-alias-label-secondary",
10839
+ "--dsw-alias-label-tertiary",
10840
+ "--dsw-alias-link",
10841
+ "--dsw-alias-state-business-primary",
10842
+ "--dsw-alias-state-error-primary",
10843
+ "--dsw-alias-state-idle-primary",
10844
+ "--dsw-alias-state-success-primary",
10845
+ "--dsw-alias-state-warn-primary",
10846
+ "--dsw-radius-sm"
10847
+ ];
10848
+ const DARK_ATTRIBUTE = "data-ds-dark-theme";
10849
+ /** The scheme and the colours the page uses now. */
10850
+ function readTheme(body = document.body) {
10851
+ const style = getComputedStyle(body);
10852
+ const tokens = {};
10853
+ for (const name of SHARED_TOKENS) {
10854
+ const value = style.getPropertyValue(name).trim();
10855
+ if (value !== "") tokens[name] = value;
10856
+ }
10857
+ return {
10858
+ scheme: body.hasAttribute(DARK_ATTRIBUTE) ? "dark" : "light",
10859
+ tokens
10860
+ };
10861
+ }
10862
+ /** Calls back when the page changes its scheme or its colours. @returns stop. */
10863
+ function watchTheme(callback, body = document.body) {
10864
+ const observer = new MutationObserver(callback);
10865
+ observer.observe(body, {
10866
+ attributes: true,
10867
+ attributeFilter: [
10868
+ DARK_ATTRIBUTE,
10869
+ "style",
10870
+ "class"
10871
+ ]
10872
+ });
10873
+ return () => {
10874
+ observer.disconnect();
10875
+ };
10876
+ }
10877
+ //#endregion
10878
+ //#region src/client/interface/PackFrame.tsx
10879
+ /**
10880
+ * A surface of a pack, in a frame that can run its scripts and nothing more: no access to this page,
10881
+ * its storage or the network. The only way out is the bridge, which answers what the pack asked for.
10882
+ */
10883
+ function PackFrame({ session, pack, surface, view, input, onResize, fill, height, title }) {
10884
+ const frame = (0, react.useRef)(null);
10885
+ const [ready, setReady] = (0, react.useState)(false);
10886
+ const latest = (0, react.useRef)({
10887
+ view,
10888
+ input,
10889
+ actions: pack.actions
10890
+ });
10891
+ const before = (0, react.useRef)(void 0);
10892
+ latest.current = {
10893
+ view,
10894
+ input,
10895
+ actions: pack.actions
10896
+ };
10897
+ const file = pack.surfaces[surface]?.file;
10898
+ const bridge = (0, react.useMemo)(() => {
10899
+ return new Bridge({
10900
+ get actions() {
10901
+ return latest.current.actions;
10902
+ },
10903
+ view: () => latest.current.view,
10904
+ say: (text) => {
10905
+ latest.current.input.say(text);
10906
+ },
10907
+ fill: (text) => {
10908
+ latest.current.input.fill(text);
10909
+ },
10910
+ open: (surface) => {
10911
+ latest.current.input.open(surface);
10912
+ },
10913
+ history: (limit) => historyOf(session, limit),
10914
+ storage: (op, key, value) => storeOf(session, {
10915
+ op,
10916
+ key,
10917
+ ...value === void 0 ? {} : { value }
10918
+ }),
10919
+ theme: () => readTheme(),
10920
+ now: () => Date.now()
10921
+ });
10922
+ }, [session]);
10923
+ const send = (message) => {
10924
+ frame.current?.contentWindow?.postMessage({
10925
+ rp: 1,
10926
+ ...message
10927
+ }, "*");
10928
+ };
10929
+ (0, react.useEffect)(() => {
10930
+ setReady(false);
10931
+ before.current = void 0;
10932
+ const onMessage = (event) => {
10933
+ if (event.source === null || event.source !== frame.current?.contentWindow) return;
10934
+ const message = parseFrameMessage(event.data);
10935
+ if (message === void 0) return;
10936
+ if (message.type === "hello") setReady(true);
10937
+ else if (message.type === "resize") {
10938
+ if (isStrip(surface)) onResize?.(clampHeight(message.height, surface));
10939
+ } else bridge.answer(message).then((answer) => {
10940
+ send({
10941
+ type: "response",
10942
+ id: message.id,
10943
+ ...answer.ok ? {
10944
+ ok: true,
10945
+ value: answer.value
10946
+ } : {
10947
+ ok: false,
10948
+ error: answer.error
10949
+ }
10950
+ });
10951
+ });
10952
+ };
10953
+ window.addEventListener("message", onMessage);
10954
+ return () => {
10955
+ window.removeEventListener("message", onMessage);
10956
+ };
10957
+ }, [
10958
+ bridge,
10959
+ file,
10960
+ pack.revision,
10961
+ onResize,
10962
+ surface
10963
+ ]);
10964
+ (0, react.useEffect)(() => {
10965
+ if (!ready) return void 0;
10966
+ const push = () => {
10967
+ send({
10968
+ type: "event",
10969
+ name: "theme",
10970
+ data: readTheme()
10971
+ });
10972
+ };
10973
+ push();
10974
+ return watchTheme(push);
10975
+ }, [ready]);
10976
+ (0, react.useEffect)(() => {
10977
+ if (!ready || view === void 0) return;
10978
+ send({
10979
+ type: "event",
10980
+ name: "state",
10981
+ data: view
10982
+ });
10983
+ const previous = before.current;
10984
+ if (previous !== void 0 && view.story.turn !== previous.story.turn) send({
10985
+ type: "event",
10986
+ name: "turn",
10987
+ data: { turn: view.story.turn }
10988
+ });
10989
+ if (previous !== void 0 && JSON.stringify(view.suggestions) !== JSON.stringify(previous.suggestions)) send({
10990
+ type: "event",
10991
+ name: "suggestions",
10992
+ data: view.suggestions
10993
+ });
10994
+ before.current = view;
10995
+ }, [ready, view]);
10996
+ if (file === void 0) return null;
10997
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("iframe", {
10998
+ ref: frame,
10999
+ className: `${PackFrame_module_css_default.frame}${fill === true ? ` ${PackFrame_module_css_default.fill}` : ""}`,
11000
+ style: fill === true ? void 0 : { height: `${height ?? pack.surfaces[surface]?.height ?? 56}px` },
11001
+ title,
11002
+ src: frameAddress(pack.frame, file, pack.revision),
11003
+ sandbox: "allow-scripts",
11004
+ referrerPolicy: "no-referrer",
11005
+ "data-rp-frame": surface
11006
+ });
11007
+ }
11008
+ //#endregion
11009
+ //#region src/client/interface/PackDock.tsx
11010
+ /**
11011
+ * A strip of the story's interface pack in the chat: `hud` above the input box and its docks, `dock` just above the
11012
+ * input, `opening` in the place of both until the first turn has been played. The `hud` one also puts the pack's
11013
+ * colours and skin into the page, so that they come with the pack even when it has no strip. Renders nothing for a
11014
+ * story without such a strip.
11015
+ */
11016
+ function PackDock({ sessionId, surface, frameInput, overrideTokens, useSession, t }) {
11017
+ const session = roleplaySessionOf(sessionId);
11018
+ const pack = usePack(session)?.pack ?? void 0;
11019
+ const strip = pack?.surfaces[surface];
11020
+ const backdrop = surface === "hud" ? pack?.surfaces.backdrop : void 0;
11021
+ const anchor = (0, react.useRef)(null);
11022
+ const layer = useBackdropHost(anchor, backdrop !== void 0);
11023
+ const running = useSession((state) => state.running);
11024
+ const view = usePlayerView(session, strip !== void 0 || backdrop !== void 0);
11025
+ const [height, setHeight] = (0, react.useState)(void 0);
11026
+ const resize = (0, react.useCallback)((next) => {
11027
+ setHeight(next);
11028
+ }, []);
11029
+ (0, react.useEffect)(() => {
11030
+ if (surface !== "hud" || pack === void 0 || pack.skin === "") return void 0;
11031
+ const style = document.createElement("style");
11032
+ style.setAttribute("data-roleplay-pack", pack.id);
11033
+ style.textContent = pack.skin;
11034
+ document.head.append(style);
11035
+ return () => {
11036
+ style.remove();
11037
+ };
11038
+ }, [
11039
+ surface,
11040
+ pack?.id,
11041
+ pack?.skin
11042
+ ]);
11043
+ const tokens = pack?.theme;
11044
+ (0, react.useEffect)(() => {
11045
+ if (surface !== "hud" || tokens === void 0 || Object.keys(tokens).length === 0) return void 0;
11046
+ return overrideTokens("roleplay-pack", tokens);
11047
+ }, [
11048
+ surface,
11049
+ tokens,
11050
+ overrideTokens
11051
+ ]);
11052
+ if (session === void 0 || pack === void 0) return null;
11053
+ const shown = strip !== void 0 && !(surface === "opening" && (running || view === void 0 || view.story.turn > 0));
11054
+ if (!shown && backdrop === void 0) return null;
11055
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
11056
+ shown && strip !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
11057
+ className: PackFrame_module_css_default.hud,
11058
+ "data-rp": surface,
11059
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PackFrame, {
11060
+ session,
11061
+ pack,
11062
+ surface,
11063
+ view,
11064
+ input: frameInput,
11065
+ onResize: resize,
11066
+ ...height === void 0 && strip.height === void 0 ? {} : { height: height ?? strip.height },
11067
+ title: t(surface)
11068
+ })
11069
+ }),
11070
+ backdrop !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
11071
+ ref: anchor,
11072
+ hidden: true
11073
+ }),
11074
+ layer !== void 0 && (0, react_dom.createPortal)(/* @__PURE__ */ (0, react_jsx_runtime.jsx)(PackFrame, {
11075
+ session,
11076
+ pack,
11077
+ surface: "backdrop",
11078
+ view,
11079
+ input: frameInput,
11080
+ fill: true,
11081
+ title: t("backdrop")
11082
+ }), layer)
11083
+ ] });
11084
+ }
11085
+ //#endregion
11086
+ //#region src/client/interface/InterfaceTab.tsx
11087
+ /** The tab of the story's interface pack: a page of its own beside Chat. */
11088
+ function InterfaceTab({ sessionId, frameInput, t }) {
11089
+ const session = roleplaySessionOf(sessionId);
11090
+ const payload = usePack(session);
11091
+ const pack = payload?.pack ?? void 0;
11092
+ const tab = pack?.surfaces.tab;
11093
+ const view = usePlayerView(session, tab !== void 0);
11094
+ if (session === void 0) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
11095
+ className: PackFrame_module_css_default.message,
11096
+ children: t("notRoleplay")
11097
+ });
11098
+ if (payload === void 0) return null;
11099
+ if (pack === void 0) return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
11100
+ className: PackFrame_module_css_default.message,
11101
+ children: [payload.problems.length === 0 ? t("noPack") : t("problems"), payload.problems.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", {
11102
+ className: PackFrame_module_css_default.problems,
11103
+ children: payload.problems.map((problem, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", { children: problem.file === "" ? problem.message : `${problem.file}: ${problem.message}` }, index))
11104
+ })]
11105
+ });
11106
+ if (tab === void 0) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
11107
+ className: PackFrame_module_css_default.message,
11108
+ children: t("noTab")
11109
+ });
11110
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
11111
+ className: PackFrame_module_css_default.tab,
11112
+ "data-rp": "tab",
11113
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PackFrame, {
11114
+ session,
11115
+ pack,
11116
+ surface: "tab",
11117
+ view,
11118
+ input: frameInput(sessionId),
11119
+ fill: true,
11120
+ title: tab.title === "" ? pack.name : tab.title
11121
+ })
11122
+ });
11123
+ }
11124
+ //#endregion
11125
+ //#region \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/interface/SidebarPage.module.css.mjs
11126
+ const css$4 = ".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:11px;line-height:1.4;overflow:hidden}";
11127
+ const key$4 = "src/client/interface/SidebarPage.module.css";
11128
+ let tag$4 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$4) + "]");
11129
+ if (tag$4 === null) {
11130
+ tag$4 = document.createElement("style");
11131
+ tag$4.dataset.plugin = "@dsh-agentic-roleplay/core";
11132
+ tag$4.dataset.pluginCss = key$4;
11133
+ document.head.appendChild(tag$4);
11134
+ }
11135
+ tag$4.textContent = css$4;
11136
+ var SidebarPage_module_css_default = {
11137
+ "bar": "rp_Ptco8a_bar",
11138
+ "name": "rp_Ptco8a_name",
11139
+ "content": "rp_Ptco8a_content",
11140
+ "main": "rp_Ptco8a_main",
11141
+ "page": "rp_Ptco8a_page",
11142
+ "message": "rp_Ptco8a_message",
11143
+ "entry": "rp_Ptco8a_entry",
11144
+ "icon": "rp_Ptco8a_icon",
11145
+ "text": "rp_Ptco8a_text",
11146
+ "title": "rp_Ptco8a_title",
11147
+ "description": "rp_Ptco8a_description"
11148
+ };
11149
+ //#endregion
11150
+ //#region src/client/interface/SidebarPage.tsx
11151
+ /** The kind of the tab type, and the identity it registers its card and body under. */
11152
+ const SIDEBAR_KIND = "roleplay-pack";
11153
+ const SIDEBAR_ID = "@dsh-agentic-roleplay/core/interface-sidebar";
11154
+ /**
11155
+ * The entry of the guide page of the right sidebar that opens the pack's own page, drawn like the entries of DSH's own
11156
+ * pages. It is there only for a story whose pack has such a page, so an ordinary chat's guide is left as it was.
11157
+ */
11158
+ function SidebarGuide({ sessionId, useTabInfo, description, t }) {
11159
+ const pack = usePack(roleplaySessionOf(sessionId))?.pack ?? void 0;
11160
+ const page = pack?.surfaces.sidebar;
11161
+ const { tab } = useTabInfo();
11162
+ if (pack === void 0 || page === void 0) return null;
11163
+ const title = page.title === "" ? pack.name : page.title;
11164
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
11165
+ className: SidebarPage_module_css_default.entry,
11166
+ "data-sidebar-right-guide-entry": SIDEBAR_KIND,
11167
+ children: [
11168
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
11169
+ variant: "ghost",
11170
+ className: SidebarPage_module_css_default.main,
11171
+ "aria-label": title,
11172
+ onClick: () => {
11173
+ tab.actions.openTab(SIDEBAR_KIND, { replaceTab: true });
11174
+ }
11175
+ }),
11176
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
11177
+ className: SidebarPage_module_css_default.icon,
11178
+ "aria-hidden": "true",
11179
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconGlobeOutlineRegular, { size: description === void 0 ? 22 : 26 })
11180
+ }),
11181
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
11182
+ className: SidebarPage_module_css_default.text,
11183
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
11184
+ className: SidebarPage_module_css_default.title,
11185
+ "aria-hidden": "true",
11186
+ children: title
11187
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
11188
+ className: SidebarPage_module_css_default.description,
11189
+ "aria-hidden": "true",
11190
+ children: t("sidebarDescription")
11191
+ })]
11192
+ })
11193
+ ]
11194
+ });
11195
+ }
11196
+ /**
11197
+ * The body of the tab: a bar of ours with a way back to the guide, and under it the pack's page, which has the rest of
11198
+ * the sidebar to itself. The page is kept while the tab is hidden, so what it draws goes on between looks.
11199
+ */
11200
+ function SidebarBody({ sessionId, useTabInfo, frameInput, t }) {
11201
+ const session = roleplaySessionOf(sessionId);
11202
+ const { tab } = useTabInfo();
11203
+ const pack = usePack(session)?.pack ?? void 0;
11204
+ const page = pack?.surfaces.sidebar;
11205
+ const view = usePlayerView(session, tab.visible && page !== void 0);
11206
+ const back = () => {
11207
+ tab.actions.openTab("guide", { replaceTab: true });
11208
+ };
11209
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
11210
+ className: SidebarPage_module_css_default.page,
11211
+ "data-rp": "sidebar",
11212
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
11213
+ className: SidebarPage_module_css_default.bar,
11214
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_deepseek_ai_dsh_client_ui_primitives.Button, {
11215
+ variant: "ghost",
11216
+ size: "sm",
11217
+ onClick: back,
11218
+ children: ["← ", t("sidebarBack")]
11219
+ }), pack !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
11220
+ className: SidebarPage_module_css_default.name,
11221
+ children: page?.title === void 0 || page.title === "" ? pack.name : page.title
11222
+ })]
11223
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
11224
+ className: SidebarPage_module_css_default.content,
11225
+ children: session === void 0 || pack === void 0 || page === void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
11226
+ className: SidebarPage_module_css_default.message,
11227
+ children: t("sidebarNone")
11228
+ }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PackFrame, {
11229
+ session,
11230
+ pack,
11231
+ surface: "sidebar",
11232
+ view,
11233
+ input: frameInput,
11234
+ fill: true,
11235
+ title: page.title === "" ? pack.name : page.title
11236
+ })
11237
+ })]
11238
+ });
11239
+ }
11240
+ //#endregion
11241
+ //#region src/client/interface/locales.ts
11242
+ const dictionaries$3 = {
11243
+ en: {
11244
+ tab: "Interface",
11245
+ notRoleplay: "This chat is not a roleplay session.",
11246
+ noPack: "This story has no interface pack. A world can carry one in its ui folder, or you can put one in the ui folder of your roleplay folder and name it in the story's settings.",
11247
+ noTab: "The interface pack of this story has no tab.",
11248
+ problems: "The interface pack cannot be used:",
11249
+ hud: "Status",
11250
+ dock: "Actions",
11251
+ opening: "Opening",
11252
+ backdrop: "Backdrop",
11253
+ sidebar: "Sidebar page",
11254
+ sidebarTitle: "Interface page",
11255
+ sidebarDescription: "A page of this story's interface pack",
11256
+ sidebarBack: "Back",
11257
+ sidebarNone: "This story's interface pack has no page for the sidebar."
11258
+ },
11259
+ zh: {
11260
+ tab: "界面",
11261
+ notRoleplay: "此聊天不是角色扮演会话。",
11262
+ noPack: "此故事没有界面包。世界可以在其 ui 文件夹中携带界面包,也可以把界面包放进角色扮演目录的 ui 文件夹,并在故事设置中指定名称。",
11263
+ noTab: "此故事的界面包没有标签页。",
11264
+ problems: "无法使用界面包:",
11265
+ hud: "状态",
11266
+ dock: "操作",
11267
+ opening: "开场",
11268
+ backdrop: "背景",
11269
+ sidebar: "侧栏页面",
11270
+ sidebarTitle: "界面页面",
11271
+ sidebarDescription: "此故事界面包的一个页面",
11272
+ sidebarBack: "返回",
11273
+ sidebarNone: "此故事的界面包没有侧栏页面。"
11274
+ }
11275
+ };
11276
+ //#endregion
11277
+ //#region src/client/interface/index.ts
11278
+ const NAMESPACE$4 = "roleplay.interface";
11279
+ const VIEW_ID$2 = "roleplay-interface";
11280
+ /** The shell activates a data target for every view tab; the pack's tab reads from the host itself, so its target is empty. */
11281
+ const target = {
11282
+ target: VIEW_ID$2,
11283
+ create: () => ({
11284
+ empty: {},
11285
+ replace: () => ({}),
11286
+ apply: () => ({})
11287
+ })
11288
+ };
11289
+ /**
11290
+ * Interface packs: what a story's files add to the page. The status strip and the pack's colours and skin come with the
11291
+ * dock above the input box; the tab is offered only when some pack has one, which the host is asked when the page loads.
11292
+ */
11293
+ function registerInterface(ctx) {
11294
+ const t = ctx.locale.bind(NAMESPACE$4);
11295
+ ctx.effect(() => ctx.locale.register(NAMESPACE$4, dictionaries$3), "roleplay: interface dictionaries");
11296
+ ctx.inject(["uiConversation"], (scope) => {
11297
+ const input = (sessionId) => {
11298
+ const facade = facadeOf(scope, sessionId);
11299
+ return {
11300
+ say: (text) => {
11301
+ facade.fill(text, true);
11302
+ },
11303
+ fill: (text) => {
11304
+ facade.fill(text, false);
11305
+ },
11306
+ open: (surface) => {
11307
+ if (surface === "sidebar") scope.get("sidebarRight")?.openTab(SIDEBAR_KIND);
11308
+ else scope.uiConversation.binding(sessionId).activate(VIEW_ID$2);
11309
+ }
11310
+ };
11311
+ };
11312
+ const overrideTokens = (source, tokens) => scope.get("theme")?.overrideTokens(source, tokens) ?? (() => void 0);
11313
+ for (const [surface, order] of [
11314
+ ["opening", 1],
11315
+ ["hud", 3],
11316
+ ["dock", 20]
11317
+ ]) scope.slots.inject("conversation.input.dock", () => scope.slots.register({
11318
+ name: "conversation.input.dock",
11319
+ id: `roleplay-${surface}`,
11320
+ order,
11321
+ locale: NAMESPACE$4,
11322
+ inject: (sessionId) => ({
11323
+ surface,
11324
+ frameInput: input(sessionId),
11325
+ overrideTokens
11326
+ })
11327
+ }, PackDock));
11328
+ scope.inject(["sidebarRight", "sidebarRightTabs"], (right) => {
11329
+ right.effect(() => right.sidebarRightTabs.register({
11330
+ id: SIDEBAR_ID,
11331
+ kind: SIDEBAR_KIND,
11332
+ keepMounted: true,
11333
+ title: () => t("sidebarTitle"),
11334
+ guide: [{
11335
+ id: "page",
11336
+ order: 30,
11337
+ title: () => t("sidebarTitle"),
11338
+ description: () => t("sidebarDescription"),
11339
+ icon: _deepseek_ai_dsh_client_ui_primitives.IconGlobeOutlineRegular
11340
+ }]
11341
+ }), "roleplay: sidebar tab type");
11342
+ right.effect(() => right.slots.inject("sidebar.right.tab.guide.entry", () => right.slots.register({
11343
+ name: "sidebar.right.tab.guide.entry",
11344
+ key: SIDEBAR_ID,
11345
+ locale: NAMESPACE$4,
11346
+ inject: (sessionId) => ({ sessionId })
11347
+ }, SidebarGuide)), "roleplay: sidebar guide entry");
11348
+ right.effect(() => right.slots.inject("sidebar.right.pane.tab", () => right.slots.register({
11349
+ name: "sidebar.right.pane.tab",
11350
+ key: SIDEBAR_ID,
11351
+ locale: NAMESPACE$4,
11352
+ inject: (sessionId) => ({
11353
+ sessionId,
11354
+ frameInput: input(sessionId)
11355
+ })
11356
+ }, SidebarBody)), "roleplay: sidebar body");
11357
+ });
11358
+ let offered = false;
11359
+ availability().then((found) => {
11360
+ if (!found.tab || offered) return;
11361
+ offered = true;
11362
+ scope.uiConversation.views.register(target);
11363
+ scope.slots.inject("conversation.view", () => scope.slots.register({
11364
+ name: "conversation.view",
11365
+ id: VIEW_ID$2,
11366
+ order: 18,
11367
+ label: () => t("tab"),
11368
+ locale: NAMESPACE$4,
11369
+ inject: () => ({ frameInput: input })
11370
+ }, InterfaceTab));
11371
+ }).catch((error) => {
11372
+ console.warn("roleplay: the interface packs could not be looked up", error);
11373
+ });
11374
+ });
11375
+ }
11376
+ //#endregion
10395
11377
  //#region src/shared/authoring-chat.ts
10396
11378
  const PREFIX = "world-author-";
10397
11379
  /** The authored world named by a dedicated authoring chat. */
@@ -10463,7 +11445,7 @@ window.__ModuleLoader__.load({
10463
11445
  /** Adds the World tab beside Chat: the state of the story, by the part of the world. */
10464
11446
  function registerWorld(ctx) {
10465
11447
  const t = ctx.locale.bind(NAMESPACE$3);
10466
- ctx.effect(() => ctx.locale.register(NAMESPACE$3, dictionaries$8), "roleplay: world dictionaries");
11448
+ ctx.effect(() => ctx.locale.register(NAMESPACE$3, dictionaries$9), "roleplay: world dictionaries");
10467
11449
  ctx.inject(["uiConversation"], (scope) => {
10468
11450
  scope.uiConversation.views.register(worldTarget);
10469
11451
  scope.slots.inject("conversation.view", () => scope.slots.register({
@@ -10477,7 +11459,7 @@ window.__ModuleLoader__.load({
10477
11459
  }
10478
11460
  //#endregion
10479
11461
  //#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
10480
- const css$3 = ".rp_wLpbxW_view{box-sizing:border-box;flex-direction:column;gap:16px;width:100%;max-width:640px;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;max-width:200px;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{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:1px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);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_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;width:100%;font-size:12px}.rp_wLpbxW_table th,.rp_wLpbxW_table td{border-bottom:1px solid var(--dsw-alias-border-l4);text-align:left;vertical-align:top;overflow-wrap:anywhere;padding:3px 8px 3px 0}.rp_wLpbxW_table th{color:var(--dsw-alias-label-tertiary);font-weight:400}.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}";
11462
+ const css$3 = ".rp_wLpbxW_view{box-sizing:border-box;flex-direction:column;gap:16px;width:100%;max-width:640px;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;max-width:200px;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{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:1px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);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_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;width:100%;font-size:12px}.rp_wLpbxW_table th,.rp_wLpbxW_table td{border-bottom:1px solid var(--dsw-alias-border-l4);text-align:left;vertical-align:top;overflow-wrap:anywhere;padding:3px 8px 3px 0}.rp_wLpbxW_table th{color:var(--dsw-alias-label-tertiary);font-weight:400}.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:1px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-sm);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:1px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);background:var(--dsw-alias-bg-layer-1);width:100%;max-width:320px;height:28px;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}";
10481
11463
  const key$3 = "src/client/chat-settings/ChatSettingsView.module.css";
10482
11464
  let tag$3 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$3) + "]");
10483
11465
  if (tag$3 === null) {
@@ -10488,21 +11470,26 @@ window.__ModuleLoader__.load({
10488
11470
  }
10489
11471
  tag$3.textContent = css$3;
10490
11472
  var ChatSettingsView_module_css_default = {
10491
- "saved": "rp_wLpbxW_saved",
10492
- "activity": "rp_wLpbxW_activity",
11473
+ "title": "rp_wLpbxW_title",
11474
+ "pre": "rp_wLpbxW_pre",
11475
+ "select": "rp_wLpbxW_select",
11476
+ "table": "rp_wLpbxW_table",
10493
11477
  "view": "rp_wLpbxW_view",
10494
11478
  "field": "rp_wLpbxW_field",
10495
- "description": "rp_wLpbxW_description",
10496
- "message": "rp_wLpbxW_message",
10497
- "link": "rp_wLpbxW_link",
10498
11479
  "row": "rp_wLpbxW_row",
10499
- "actions": "rp_wLpbxW_actions",
10500
11480
  "label": "rp_wLpbxW_label",
10501
11481
  "help": "rp_wLpbxW_help",
10502
- "title": "rp_wLpbxW_title",
10503
- "table": "rp_wLpbxW_table",
11482
+ "run": "rp_wLpbxW_run",
11483
+ "saved": "rp_wLpbxW_saved",
11484
+ "description": "rp_wLpbxW_description",
11485
+ "message": "rp_wLpbxW_message",
11486
+ "link": "rp_wLpbxW_link",
11487
+ "notice": "rp_wLpbxW_notice",
11488
+ "activity": "rp_wLpbxW_activity",
11489
+ "reasons": "rp_wLpbxW_reasons",
11490
+ "list": "rp_wLpbxW_list",
10504
11491
  "error": "rp_wLpbxW_error",
10505
- "notice": "rp_wLpbxW_notice"
11492
+ "actions": "rp_wLpbxW_actions"
10506
11493
  };
10507
11494
  //#endregion
10508
11495
  //#region src/client/chat-settings/settings-api.ts
@@ -10543,6 +11530,193 @@ window.__ModuleLoader__.load({
10543
11530
  });
10544
11531
  if (!response.ok) throw new Error(`${response.status} ${response.statusText}`.trim());
10545
11532
  }
11533
+ /** What a helper run was told and did; nothing when the run was not kept or has been dropped. */
11534
+ async function loadRun(id, run, signal) {
11535
+ const response = await fetch(`${API_PREFIX}/sessions/activity/run?id=${encodeURIComponent(id)}&run=${encodeURIComponent(run)}`, {
11536
+ credentials: "same-origin",
11537
+ signal
11538
+ });
11539
+ if (response.status === 404) return void 0;
11540
+ if (!response.ok) throw new Error(`${response.status} ${response.statusText}`.trim());
11541
+ return await response.json();
11542
+ }
11543
+ async function interfaceReply(response) {
11544
+ if (!response.ok) {
11545
+ const body = await response.json().catch(() => void 0);
11546
+ const problems = Array.isArray(body?.problems) ? body.problems.map((problem) => `${problem.path ?? ""} ${problem.message ?? ""}`.trim()).join("; ") : "";
11547
+ throw new Error(`${typeof body?.message === "string" ? body.message : `${response.status} ${response.statusText}`.trim()}${problems === "" ? "" : ` (${problems})`}`);
11548
+ }
11549
+ return await response.json();
11550
+ }
11551
+ /** The interface pack of the chat's story: the one in use, the ones it could use, and how the world's compare with its copies. */
11552
+ async function loadInterfaceStatus(id, signal) {
11553
+ return await interfaceReply(await fetch(`${API_PREFIX}/sessions/interface/status?id=${encodeURIComponent(id)}`, {
11554
+ credentials: "same-origin",
11555
+ signal
11556
+ }));
11557
+ }
11558
+ /** Brings the world's interface packs into the chat's story. */
11559
+ async function syncInterface(id, signal) {
11560
+ return await interfaceReply(await fetch(`${API_PREFIX}/sessions/interface/sync?id=${encodeURIComponent(id)}`, {
11561
+ method: "POST",
11562
+ credentials: "same-origin",
11563
+ signal
11564
+ }));
11565
+ }
11566
+ //#endregion
11567
+ //#region src/client/chat-settings/InterfaceSection.tsx
11568
+ const message = (failure) => failure instanceof Error ? failure.message : String(failure);
11569
+ /**
11570
+ * 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
11571
+ * with the other settings, so it is saved with them), and, when the world's packs are not what the story copied, a way
11572
+ * to bring them in.
11573
+ */
11574
+ function InterfaceSection({ t, session, value, onChange, saved, disabled }) {
11575
+ const [status, setStatus] = (0, react.useState)(void 0);
11576
+ const [failure, setFailure] = (0, react.useState)(void 0);
11577
+ const [report, setReport] = (0, react.useState)(void 0);
11578
+ const [sure, setSure] = (0, react.useState)(false);
11579
+ const [version, setVersion] = (0, react.useState)(0);
11580
+ (0, react.useEffect)(() => {
11581
+ const abort = new AbortController();
11582
+ loadInterfaceStatus(session, abort.signal).then((next) => {
11583
+ setStatus(next);
11584
+ setFailure(void 0);
11585
+ }, (error) => {
11586
+ if (!abort.signal.aborted) setFailure(message(error));
11587
+ });
11588
+ return () => {
11589
+ abort.abort();
11590
+ };
11591
+ }, [
11592
+ session,
11593
+ saved,
11594
+ version
11595
+ ]);
11596
+ const update = () => {
11597
+ setSure(false);
11598
+ syncInterface(session, new AbortController().signal).then((done) => {
11599
+ setReport(t("packUpdated", {
11600
+ updated: done.updated.join(", ") || "-",
11601
+ added: done.added.join(", ") || "-"
11602
+ }));
11603
+ setFailure(void 0);
11604
+ setVersion((number) => number + 1);
11605
+ }, (error) => {
11606
+ setReport(void 0);
11607
+ setFailure(t("packSyncFailed", { message: message(error) }));
11608
+ });
11609
+ };
11610
+ if (status === void 0) return failure === void 0 ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
11611
+ className: ChatSettingsView_module_css_default.error,
11612
+ role: "alert",
11613
+ children: t("packLoadFailed", { message: failure })
11614
+ });
11615
+ const inUse = status.available.find((entry) => entry.id === status.active);
11616
+ const changed = status.world?.packs.filter((entry) => entry.state === "different").map((entry) => entry.id) ?? [];
11617
+ const fresh = status.world?.packs.filter((entry) => entry.state === "new").map((entry) => entry.id) ?? [];
11618
+ const broken = status.world?.packs.filter((entry) => entry.problems.length > 0).map((entry) => entry.id) ?? [];
11619
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
11620
+ className: ChatSettingsView_module_css_default.activity,
11621
+ "data-testid": "roleplay-interface-pack",
11622
+ children: [
11623
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", { children: t("packTitle") }),
11624
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
11625
+ className: ChatSettingsView_module_css_default.description,
11626
+ children: t("packHelp")
11627
+ }),
11628
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
11629
+ className: ChatSettingsView_module_css_default.description,
11630
+ children: status.setting === "none" ? t("packOff") : inUse === void 0 ? t("packNone") : t("packActive", { name: inUse.name })
11631
+ }),
11632
+ inUse !== void 0 && inUse.surfaces.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
11633
+ className: ChatSettingsView_module_css_default.help,
11634
+ children: t("packSurfaces", { surfaces: inUse.surfaces.join(", ") })
11635
+ }),
11636
+ status.problems.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
11637
+ role: "alert",
11638
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
11639
+ className: ChatSettingsView_module_css_default.error,
11640
+ children: t("packProblems")
11641
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", {
11642
+ className: ChatSettingsView_module_css_default.list,
11643
+ children: status.problems.map((problem, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", { children: problem.file === "" ? problem.message : `${problem.file}: ${problem.message}` }, index))
11644
+ })]
11645
+ }),
11646
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
11647
+ className: ChatSettingsView_module_css_default.field,
11648
+ style: { maxWidth: "none" },
11649
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
11650
+ className: ChatSettingsView_module_css_default.label,
11651
+ children: t("packChoose")
11652
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("select", {
11653
+ className: ChatSettingsView_module_css_default.select,
11654
+ value,
11655
+ disabled,
11656
+ onChange: (event) => {
11657
+ onChange(event.target.value);
11658
+ },
11659
+ children: [
11660
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
11661
+ value: "",
11662
+ children: t("packFirst")
11663
+ }),
11664
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
11665
+ value: "none",
11666
+ children: t("packPlain")
11667
+ }),
11668
+ status.available.map((entry) => {
11669
+ const name = status.available.filter((other) => other.name === entry.name).length > 1 ? `${entry.name} — ${entry.id}` : entry.name;
11670
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
11671
+ value: entry.id,
11672
+ children: entry.problems.length > 0 ? t("packBroken", { name }) : entry.from === "root" ? t("packFromRoot", { name }) : name
11673
+ }, entry.id);
11674
+ })
11675
+ ]
11676
+ })]
11677
+ }),
11678
+ changed.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
11679
+ className: ChatSettingsView_module_css_default.description,
11680
+ children: t("packWorldChanged", { names: changed.join(", ") })
11681
+ }),
11682
+ fresh.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
11683
+ className: ChatSettingsView_module_css_default.description,
11684
+ children: t("packWorldNew", { names: fresh.join(", ") })
11685
+ }),
11686
+ broken.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
11687
+ className: ChatSettingsView_module_css_default.error,
11688
+ children: t("packWorldProblems", { names: broken.join(", ") })
11689
+ }),
11690
+ (changed.length > 0 || fresh.length > 0) && broken.length === 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
11691
+ variant: "ghost",
11692
+ size: "sm",
11693
+ disabled,
11694
+ onClick: () => {
11695
+ if (sure) update();
11696
+ else setSure(true);
11697
+ },
11698
+ children: sure ? t("packUpdateConfirm") : t("packUpdate")
11699
+ }), sure && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
11700
+ type: "button",
11701
+ className: ChatSettingsView_module_css_default.link,
11702
+ onClick: () => {
11703
+ setSure(false);
11704
+ },
11705
+ children: t("vectorsCancel")
11706
+ })] }),
11707
+ report !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
11708
+ className: ChatSettingsView_module_css_default.description,
11709
+ role: "status",
11710
+ children: report
11711
+ }),
11712
+ failure !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
11713
+ className: ChatSettingsView_module_css_default.error,
11714
+ role: "alert",
11715
+ children: failure
11716
+ })
11717
+ ]
11718
+ });
11719
+ }
10546
11720
  //#endregion
10547
11721
  //#region src/client/chat-settings/VectorsSection.tsx
10548
11722
  /** What the search by meaning stands on, and a way to start it again with another embedding model. */
@@ -10595,8 +11769,30 @@ window.__ModuleLoader__.load({
10595
11769
  //#region src/client/chat-settings/ActivityList.tsx
10596
11770
  const seconds = (ms) => `${(ms / 1e3).toFixed(ms < 1e4 ? 1 : 0)} s`;
10597
11771
  /** What the story's helper agents did lately and how long it took, newest first, to see where a slow turn went or why a helper gave up. */
10598
- function ActivityList({ t, entries, onRefresh }) {
11772
+ function ActivityList({ t, session, entries, onRefresh }) {
10599
11773
  const shown = entries.slice(-20).reverse();
11774
+ const [open, setOpen] = (0, react.useState)();
11775
+ const toggle = (run) => {
11776
+ if (open?.run === run) {
11777
+ setOpen(void 0);
11778
+ return;
11779
+ }
11780
+ setOpen({
11781
+ run,
11782
+ detail: "loading"
11783
+ });
11784
+ loadRun(session, run, new AbortController().signal).then((detail) => {
11785
+ setOpen((current) => current?.run === run ? {
11786
+ run,
11787
+ detail: detail ?? "gone"
11788
+ } : current);
11789
+ }, (failure) => {
11790
+ setOpen((current) => current?.run === run ? {
11791
+ run,
11792
+ detail: { error: failure instanceof Error ? failure.message : String(failure) }
11793
+ } : current);
11794
+ });
11795
+ };
10600
11796
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("details", {
10601
11797
  className: ChatSettingsView_module_css_default.activity,
10602
11798
  "data-testid": "roleplay-activity",
@@ -10623,8 +11819,9 @@ window.__ModuleLoader__.load({
10623
11819
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("th", { children: t("activityModel") }),
10624
11820
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("th", { children: t("activityTook") }),
10625
11821
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("th", { children: t("activityCalls") }),
10626
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("th", { children: t("activityResult") })
10627
- ] }) }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("tbody", { children: shown.map((entry) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("tr", { children: [
11822
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("th", { children: t("activityResult") }),
11823
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("th", {})
11824
+ ] }) }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("tbody", { children: shown.flatMap((entry) => [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("tr", { children: [
10628
11825
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", { children: new Date(entry.at).toLocaleTimeString() }),
10629
11826
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", { children: entry.label }),
10630
11827
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", { children: entry.model === "" ? t("activityOwnModel") : entry.model }),
@@ -10634,8 +11831,139 @@ window.__ModuleLoader__.load({
10634
11831
  className: entry.error === void 0 ? void 0 : ChatSettingsView_module_css_default.error,
10635
11832
  title: entry.error,
10636
11833
  children: entry.error === void 0 ? t("activityDone") : t("activityFailed", { reason: entry.error })
11834
+ }),
11835
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", { children: entry.run === void 0 ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
11836
+ type: "button",
11837
+ className: ChatSettingsView_module_css_default.link,
11838
+ onClick: () => {
11839
+ toggle(entry.run);
11840
+ },
11841
+ children: open?.run === entry.run ? t("runHide") : t("runShow")
11842
+ }) })
11843
+ ] }, `${entry.at}-${entry.label}`), ...entry.run !== void 0 && open?.run === entry.run ? [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("tr", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", {
11844
+ colSpan: 7,
11845
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RunView, {
11846
+ t,
11847
+ detail: open.detail
10637
11848
  })
10638
- ] }, `${entry.at}-${entry.label}`)) })]
11849
+ }) }, `${entry.at}-${entry.label}-run`)] : []]) })]
11850
+ })
11851
+ ]
11852
+ });
11853
+ }
11854
+ function RunView({ t, detail }) {
11855
+ if (detail === "loading") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
11856
+ className: ChatSettingsView_module_css_default.description,
11857
+ children: t("loading")
11858
+ });
11859
+ if (detail === "gone") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
11860
+ className: ChatSettingsView_module_css_default.description,
11861
+ children: t("runGone")
11862
+ });
11863
+ if ("error" in detail) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
11864
+ className: ChatSettingsView_module_css_default.description,
11865
+ role: "alert",
11866
+ children: t("runFailed", { message: detail.error })
11867
+ });
11868
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
11869
+ className: ChatSettingsView_module_css_default.run,
11870
+ "data-testid": "roleplay-run",
11871
+ children: [
11872
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("details", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("summary", { children: t("runPersona") }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("pre", {
11873
+ className: ChatSettingsView_module_css_default.pre,
11874
+ children: detail.persona
11875
+ })] }),
11876
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("details", {
11877
+ open: true,
11878
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("summary", { children: t("runPrompt") }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("pre", {
11879
+ className: ChatSettingsView_module_css_default.pre,
11880
+ children: detail.prompt
11881
+ })]
11882
+ }),
11883
+ detail.recalled !== void 0 && detail.recalled.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("details", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("summary", { children: t("runRecalled") }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", {
11884
+ className: ChatSettingsView_module_css_default.reasons,
11885
+ "data-testid": "roleplay-run-recalled",
11886
+ children: detail.recalled.map((memory, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("li", { children: [
11887
+ `${memory.clarity}, turn ${memory.turn}: ${memory.text}`,
11888
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("br", {}),
11889
+ whyText(t, memory.why)
11890
+ ] }, index))
11891
+ })] }),
11892
+ detail.calls.map((call, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("details", { children: [
11893
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("summary", {
11894
+ className: call.failed ? ChatSettingsView_module_css_default.error : void 0,
11895
+ children: `${index + 1}. ${call.tool}${call.failed ? ` (${t("runRefused")})` : ""}`
11896
+ }),
11897
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("pre", {
11898
+ className: ChatSettingsView_module_css_default.pre,
11899
+ children: call.args
11900
+ }),
11901
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("pre", {
11902
+ className: ChatSettingsView_module_css_default.pre,
11903
+ children: call.outcome
11904
+ })
11905
+ ] }, index)),
11906
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("details", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("summary", { children: t("runResult") }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("pre", {
11907
+ className: ChatSettingsView_module_css_default.pre,
11908
+ children: detail.result ?? t("runNoResult")
11909
+ })] })
11910
+ ]
11911
+ });
11912
+ }
11913
+ const figure = (value) => (Math.round(value * 100) / 100).toString();
11914
+ /** The reasons a thing came back, one short line. */
11915
+ function whyText(t, why) {
11916
+ if (why === void 0) return "";
11917
+ return [
11918
+ t("whyCues", {
11919
+ people: figure(why.cues.people),
11920
+ words: figure(why.cues.words),
11921
+ place: figure(why.cues.place)
11922
+ }),
11923
+ ...why.lexical === void 0 ? [] : [t("whyIndex", { value: figure(why.lexical) })],
11924
+ ...why.dense === void 0 ? [] : [t("whyMeaning", { value: figure(why.dense) })],
11925
+ ...why.rerank === void 0 ? [] : [t("whyRerank", { value: figure(why.rerank) })],
11926
+ t("whyMatters", { value: why.importance }),
11927
+ t("whyAge", { value: figure(why.ageDays) }),
11928
+ ...why.retention === void 0 ? [] : [t("whyKept", { value: figure(why.retention) })],
11929
+ t("whyScore", { value: figure(why.score) }),
11930
+ ...why.linked === void 0 ? [] : [t("whyLinked", {
11931
+ people: why.linked.people,
11932
+ tags: why.linked.tags,
11933
+ place: why.linked.place ? t("whyLinkedPlace") : ""
11934
+ })]
11935
+ ].join(" · ");
11936
+ }
11937
+ //#endregion
11938
+ //#region src/client/chat-settings/InterventionList.tsx
11939
+ /** What the story's triggers delivered lately, and whether the game master or the characters took it up, newest first. */
11940
+ function InterventionList({ t, entries }) {
11941
+ const shown = [...entries].reverse();
11942
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("details", {
11943
+ className: ChatSettingsView_module_css_default.activity,
11944
+ "data-testid": "roleplay-interventions",
11945
+ children: [
11946
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("summary", { children: t("interventionsTitle") }),
11947
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
11948
+ className: ChatSettingsView_module_css_default.description,
11949
+ children: t("interventionsHelp")
11950
+ }),
11951
+ shown.length === 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
11952
+ className: ChatSettingsView_module_css_default.description,
11953
+ children: t("interventionsEmpty")
11954
+ }) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("table", {
11955
+ className: ChatSettingsView_module_css_default.table,
11956
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("thead", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("tr", { children: [
11957
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("th", { children: t("interventionTurn") }),
11958
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("th", { children: t("interventionKind") }),
11959
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("th", { children: t("interventionText") }),
11960
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("th", { children: t("interventionStatus") })
11961
+ ] }) }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("tbody", { children: shown.map((entry) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("tr", { children: [
11962
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", { children: entry.turn }),
11963
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", { children: entry.kind === "beat" ? t("interventionBeat") : t("interventionCue", { who: entry.characters.join(", ") }) }),
11964
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", { children: entry.text }),
11965
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", { children: t(entry.status === "waiting" ? "interventionWaiting" : entry.status === "taken" ? "interventionTaken" : "interventionLapsed") })
11966
+ ] }, `${entry.turn}-${entry.kind}-${entry.trigger}-${entry.text}`)) })]
10639
11967
  })
10640
11968
  ]
10641
11969
  });
@@ -10708,6 +12036,7 @@ window.__ModuleLoader__.load({
10708
12036
  payload: {
10709
12037
  ...payload,
10710
12038
  activity: next.activity,
12039
+ interventions: next.interventions,
10711
12040
  vectors: next.vectors,
10712
12041
  pendingRecords: next.pendingRecords,
10713
12042
  pendingConsolidation: next.pendingConsolidation
@@ -10774,16 +12103,32 @@ window.__ModuleLoader__.load({
10774
12103
  },
10775
12104
  options,
10776
12105
  disabled: saving,
12106
+ hidden: ["interface.pack"],
10777
12107
  locked: payload.clockMode === "simulated" ? { "clock.mode": { real: t("clockLocked") } } : {}
10778
12108
  }),
12109
+ session !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(InterfaceSection, {
12110
+ t,
12111
+ session,
12112
+ value: String(drafts["interface.pack"] ?? ""),
12113
+ onChange: (next) => {
12114
+ change("interface.pack", next);
12115
+ },
12116
+ saved: payload.settings.interface.pack,
12117
+ disabled: saving
12118
+ }),
10779
12119
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)(VectorsSection, {
10780
12120
  t,
10781
12121
  status: payload.vectors,
10782
12122
  disabled: saving,
10783
12123
  onReset: reset
10784
12124
  }),
10785
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ActivityList, {
12125
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(InterventionList, {
10786
12126
  t,
12127
+ entries: payload.interventions
12128
+ }),
12129
+ session !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ActivityList, {
12130
+ t,
12131
+ session,
10787
12132
  entries: payload.activity,
10788
12133
  onRefresh: refreshActivity
10789
12134
  }),
@@ -10818,6 +12163,18 @@ window.__ModuleLoader__.load({
10818
12163
  notRoleplay: "This chat is not a roleplay session, so it has no roleplay settings.",
10819
12164
  pendingConsolidation: "{count} character(s), place(s) or thing(s) made up in play are waiting to be fitted into the world (connected to the rest, given relationships). It is done in the background.",
10820
12165
  pendingRecords: "{count} round(s) are waiting to be written into the story's memory. The game master records them when the story moves on, or once too many pile up.",
12166
+ interventionsTitle: "What the world put in front of the story",
12167
+ interventionsHelp: "Beats and cues that triggers delivered lately. A beat is for the game master to weave in; a cue is for characters. Taken up means it was used; lapsed means nobody did within its time.",
12168
+ interventionsEmpty: "No trigger has delivered anything yet.",
12169
+ interventionTurn: "Turn",
12170
+ interventionKind: "For",
12171
+ interventionText: "What",
12172
+ interventionStatus: "Became of it",
12173
+ interventionBeat: "Game master (beat)",
12174
+ interventionCue: "Cue for {who}",
12175
+ interventionWaiting: "Waiting",
12176
+ interventionTaken: "Taken up",
12177
+ interventionLapsed: "Lapsed, nobody took it up",
10821
12178
  activityTitle: "What the helpers did lately",
10822
12179
  activityHelp: "Characters, the record keeper, the suggestion writer and the authors run in the background of a turn. The latest runs are listed here, with how long each took.",
10823
12180
  activityRefresh: "Refresh",
@@ -10831,6 +12188,26 @@ window.__ModuleLoader__.load({
10831
12188
  activityOwnModel: "chat model",
10832
12189
  activityDone: "done",
10833
12190
  activityFailed: "failed: {reason}",
12191
+ runShow: "Show",
12192
+ runHide: "Hide",
12193
+ runGone: "This run was not kept, or has been dropped to make room for newer ones.",
12194
+ runFailed: "Could not load the run: {message}",
12195
+ runPersona: "Instructions",
12196
+ runPrompt: "What it was asked",
12197
+ runRefused: "refused",
12198
+ runResult: "Result",
12199
+ runRecalled: "What it was reminded of, and why",
12200
+ whyCues: "cues: names {people}, words {words}, place {place}",
12201
+ whyIndex: "words search {value}",
12202
+ whyMeaning: "meaning search {value}",
12203
+ whyRerank: "reranker {value}",
12204
+ whyMatters: "matters {value}/5",
12205
+ whyAge: "{value} story days ago",
12206
+ whyKept: "still in mind {value}",
12207
+ whyScore: "ranked {value}",
12208
+ whyLinked: "came to mind with another memory (shares {people} people, {tags} tags{place})",
12209
+ whyLinkedPlace: ", the place",
12210
+ runNoResult: "It submitted no result.",
10834
12211
  vectorsTitle: "Search by meaning",
10835
12212
  vectorsUnavailable: "Vector search is not available here, so memories are found by their words only.",
10836
12213
  vectorsNone: "No vectors are stored yet ({pending} texts waiting). They are made in the background once an embedding model is selected and the story searches.",
@@ -10840,6 +12217,26 @@ window.__ModuleLoader__.load({
10840
12217
  vectorsCancel: "Cancel",
10841
12218
  vectorsHelp: "Use this after you select another embedding model. The texts stay; they are embedded again by the new model as the story needs them, and until then memories are found by their words.",
10842
12219
  vectorsFailed: "Could not reset the vectors: {message}",
12220
+ packTitle: "Interface pack",
12221
+ packHelp: "A pack changes how this story looks and can add a status strip, buttons, an opening card, a backdrop or a tab. A world can carry packs; yours go in the ui folder of your roleplay folder.",
12222
+ packActive: "In use: {name}",
12223
+ packNone: "No pack is in use.",
12224
+ packOff: "Packs are turned off for this story.",
12225
+ packProblems: "The pack cannot be used:",
12226
+ packChoose: "Pack",
12227
+ packFirst: "The first pack of the story",
12228
+ packPlain: "None (plain chat)",
12229
+ packFromRoot: "{name} (from your ui folder)",
12230
+ packWorldChanged: "The world has changed {names} since this story started.",
12231
+ packWorldNew: "The world has {names}, which this story does not have.",
12232
+ packWorldProblems: "The world's packs cannot be brought in yet: {names} has problems.",
12233
+ packUpdate: "Update from the world",
12234
+ packUpdateConfirm: "Replace the story's copies?",
12235
+ packUpdated: "Updated: {updated}. Added: {added}. The replaced copies were kept in the story's .trash folder.",
12236
+ packSyncFailed: "Could not update the packs: {message}",
12237
+ packSurfaces: "Shows: {surfaces}",
12238
+ packLoadFailed: "Could not read the interface pack: {message}",
12239
+ packBroken: "{name} (has problems)",
10843
12240
  save: "Save",
10844
12241
  saving: "Saving…",
10845
12242
  saved: "Saved.",
@@ -10854,6 +12251,18 @@ window.__ModuleLoader__.load({
10854
12251
  notRoleplay: "此对话不是角色扮演存档,没有角色扮演设置。",
10855
12252
  pendingConsolidation: "有 {count} 个在故事中新建的角色、地点或物品等待融入世界(与其余部分建立连接和关系),将在后台完成。",
10856
12253
  pendingRecords: "有 {count} 个回合等待写入故事记忆。主持人会在故事推进时记录,积压过多时也会自动记录。",
12254
+ interventionsTitle: "世界摆到故事面前的东西",
12255
+ interventionsHelp: "触发器最近送出的节拍与提示。节拍交给游戏主持人织入故事,提示交给角色。“已采用”表示被用上了,“已失效”表示在期限内没有人理会。",
12256
+ interventionsEmpty: "还没有触发器送出过任何东西。",
12257
+ interventionTurn: "回合",
12258
+ interventionKind: "送给",
12259
+ interventionText: "内容",
12260
+ interventionStatus: "结果",
12261
+ interventionBeat: "游戏主持人(节拍)",
12262
+ interventionCue: "给 {who} 的提示",
12263
+ interventionWaiting: "等待中",
12264
+ interventionTaken: "已采用",
12265
+ interventionLapsed: "已失效,无人理会",
10857
12266
  activityTitle: "助手最近做了什么",
10858
12267
  activityHelp: "角色、记录员、建议作者和世界作者都在每一轮的后台运行。这里列出最近的运行及各自耗时。",
10859
12268
  activityRefresh: "刷新",
@@ -10867,6 +12276,26 @@ window.__ModuleLoader__.load({
10867
12276
  activityOwnModel: "对话模型",
10868
12277
  activityDone: "完成",
10869
12278
  activityFailed: "失败:{reason}",
12279
+ runShow: "查看",
12280
+ runHide: "收起",
12281
+ runGone: "这次运行没有保留,或已被较新的运行挤出。",
12282
+ runFailed: "无法加载这次运行:{message}",
12283
+ runPersona: "指令",
12284
+ runPrompt: "被问的内容",
12285
+ runRefused: "被拒绝",
12286
+ runResult: "结果",
12287
+ runRecalled: "它被提醒了什么,以及原因",
12288
+ whyCues: "线索:人名 {people},字词 {words},地点 {place}",
12289
+ whyIndex: "字词检索 {value}",
12290
+ whyMeaning: "含义检索 {value}",
12291
+ whyRerank: "重排序 {value}",
12292
+ whyMatters: "重要性 {value}/5",
12293
+ whyAge: "{value} 个故事日前",
12294
+ whyKept: "记忆保留 {value}",
12295
+ whyScore: "排名分 {value}",
12296
+ whyLinked: "与另一条记忆一同想起(共有 {people} 个人物、{tags} 个标签{place})",
12297
+ whyLinkedPlace: "、地点",
12298
+ runNoResult: "它没有提交结果。",
10870
12299
  vectorsTitle: "按含义检索",
10871
12300
  vectorsUnavailable: "此处无法使用向量检索,记忆只按字词查找。",
10872
12301
  vectorsNone: "尚未存储向量({pending} 条文本等待中)。选择嵌入模型并在故事检索时会在后台生成。",
@@ -10876,12 +12305,32 @@ window.__ModuleLoader__.load({
10876
12305
  vectorsCancel: "取消",
10877
12306
  vectorsHelp: "更换嵌入模型后使用。文本会保留,之后按需由新模型重新生成向量,在此之前记忆只按字词查找。",
10878
12307
  vectorsFailed: "无法重置向量:{message}",
12308
+ packTitle: "界面包",
12309
+ packHelp: "界面包会改变此故事的外观,并可添加状态条、按钮、开场卡片、背景或标签页。世界可以自带界面包;你自己的放在角色扮演目录的 ui 文件夹中。",
12310
+ packActive: "使用中:{name}",
12311
+ packNone: "没有使用界面包。",
12312
+ packOff: "此故事已关闭界面包。",
12313
+ packProblems: "无法使用此界面包:",
12314
+ packChoose: "界面包",
12315
+ packFirst: "故事中的第一个包",
12316
+ packPlain: "无(普通聊天)",
12317
+ packFromRoot: "{name}(来自你的 ui 文件夹)",
12318
+ packWorldChanged: "自此故事开始以来,世界已更改:{names}。",
12319
+ packWorldNew: "世界有此故事没有的包:{names}。",
12320
+ packWorldProblems: "暂时无法带入世界的界面包:{names} 有问题。",
12321
+ packUpdate: "从世界更新",
12322
+ packUpdateConfirm: "替换故事中的副本?",
12323
+ packUpdated: "已更新:{updated}。已添加:{added}。被替换的副本保存在故事的 .trash 文件夹中。",
12324
+ packSyncFailed: "无法更新界面包:{message}",
12325
+ packSurfaces: "显示位置:{surfaces}",
12326
+ packLoadFailed: "无法读取界面包:{message}",
12327
+ packBroken: "{name}(有问题)",
10879
12328
  save: "保存",
10880
12329
  saving: "正在保存…",
10881
12330
  saved: "已保存。",
10882
12331
  saveFailed: "无法保存设置:{message}"
10883
12332
  }
10884
- }, dictionaries$5);
12333
+ }, dictionaries$6);
10885
12334
  //#endregion
10886
12335
  //#region src/client/chat-settings/index.ts
10887
12336
  const NAMESPACE$2 = "roleplay.chatSettings";
@@ -11197,25 +12646,25 @@ window.__ModuleLoader__.load({
11197
12646
  }
11198
12647
  tag$2.textContent = css$2;
11199
12648
  var NarrationView_module_css_default = {
11200
- "oocLabel": "rp_NFPimG_oocLabel",
11201
12649
  "images": "rp_NFPimG_images",
11202
- "output": "rp_NFPimG_output",
11203
- "words": "rp_NFPimG_words",
11204
12650
  "speech": "rp_NFPimG_speech",
11205
- "name": "rp_NFPimG_name",
11206
- "imageButton": "rp_NFPimG_imageButton",
11207
- "imageStatus": "rp_NFPimG_imageStatus",
11208
- "imageError": "rp_NFPimG_imageError",
12651
+ "preview": "rp_NFPimG_preview",
11209
12652
  "oocRefused": "rp_NFPimG_oocRefused",
11210
- "playAll": "rp_NFPimG_playAll",
12653
+ "words": "rp_NFPimG_words",
12654
+ "name": "rp_NFPimG_name",
11211
12655
  "narration": "rp_NFPimG_narration",
11212
- "note": "rp_NFPimG_note",
11213
- "playLine": "rp_NFPimG_playLine",
11214
12656
  "avatar": "rp_NFPimG_avatar",
11215
- "oocNote": "rp_NFPimG_oocNote",
11216
12657
  "sceneImage": "rp_NFPimG_sceneImage",
12658
+ "oocNote": "rp_NFPimG_oocNote",
12659
+ "playLine": "rp_NFPimG_playLine",
12660
+ "note": "rp_NFPimG_note",
11217
12661
  "line": "rp_NFPimG_line",
11218
- "preview": "rp_NFPimG_preview"
12662
+ "playAll": "rp_NFPimG_playAll",
12663
+ "imageButton": "rp_NFPimG_imageButton",
12664
+ "output": "rp_NFPimG_output",
12665
+ "imageStatus": "rp_NFPimG_imageStatus",
12666
+ "oocLabel": "rp_NFPimG_oocLabel",
12667
+ "imageError": "rp_NFPimG_imageError"
11219
12668
  };
11220
12669
  //#endregion
11221
12670
  //#region src/client/transcript/PreviewNode.tsx
@@ -11280,6 +12729,7 @@ window.__ModuleLoader__.load({
11280
12729
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
11281
12730
  className: NarrationView_module_css_default.output,
11282
12731
  "data-testid": "roleplay-narration",
12732
+ "data-rp": "narration",
11283
12733
  children: [
11284
12734
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
11285
12735
  type: "button",
@@ -11294,10 +12744,11 @@ window.__ModuleLoader__.load({
11294
12744
  data.ooc !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", {
11295
12745
  className: data.ooc.legal ? NarrationView_module_css_default.oocNote : NarrationView_module_css_default.oocRefused,
11296
12746
  "data-testid": "roleplay-ooc",
12747
+ "data-rp": "ooc",
11297
12748
  children: [
11298
12749
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
11299
12750
  className: NarrationView_module_css_default.oocLabel,
11300
- children: t(data.ooc.legal ? "oocDone" : "oocRefused")
12751
+ children: t(data.ooc.question === true ? "oocAnswer" : data.ooc.legal ? "oocDone" : "oocRefused")
11301
12752
  }),
11302
12753
  " ",
11303
12754
  data.ooc.note
@@ -11305,12 +12756,15 @@ window.__ModuleLoader__.load({
11305
12756
  }),
11306
12757
  data.segments.map((segment, index) => segment.type === "narration" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
11307
12758
  className: NarrationView_module_css_default.narration,
12759
+ "data-rp": "prose",
11308
12760
  children: segment.text
11309
12761
  }, index) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
11310
12762
  className: NarrationView_module_css_default.line,
11311
12763
  "data-testid": "roleplay-utterance",
12764
+ "data-rp": "utterance",
11312
12765
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
11313
12766
  className: NarrationView_module_css_default.avatar,
12767
+ "data-rp": "avatar",
11314
12768
  style: { background: `hsl(${hueOf(segment.name)} 32% 40%)` },
11315
12769
  "aria-hidden": "true",
11316
12770
  children: Array.from(segment.name)[0]?.toUpperCase()
@@ -11318,6 +12772,7 @@ window.__ModuleLoader__.load({
11318
12772
  className: NarrationView_module_css_default.speech,
11319
12773
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
11320
12774
  className: NarrationView_module_css_default.name,
12775
+ "data-rp": "speaker",
11321
12776
  children: [segment.name, /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
11322
12777
  type: "button",
11323
12778
  className: NarrationView_module_css_default.playLine,
@@ -11330,6 +12785,7 @@ window.__ModuleLoader__.load({
11330
12785
  })]
11331
12786
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
11332
12787
  className: NarrationView_module_css_default.words,
12788
+ "data-rp": "words",
11333
12789
  children: segment.text
11334
12790
  })]
11335
12791
  })]
@@ -11453,11 +12909,11 @@ window.__ModuleLoader__.load({
11453
12909
  }
11454
12910
  tag$1.textContent = css$1;
11455
12911
  var SuggestionsDock_module_css_default = {
11456
- "card": "rp_rWH4DG_card",
11457
- "chip": "rp_rWH4DG_chip",
12912
+ "dock": "rp_rWH4DG_dock",
11458
12913
  "lines": "rp_rWH4DG_lines",
11459
12914
  "label": "rp_rWH4DG_label",
11460
- "dock": "rp_rWH4DG_dock"
12915
+ "chip": "rp_rWH4DG_chip",
12916
+ "card": "rp_rWH4DG_card"
11461
12917
  };
11462
12918
  //#endregion
11463
12919
  //#region src/client/transcript/SuggestionsDock.tsx
@@ -11514,6 +12970,7 @@ window.__ModuleLoader__.load({
11514
12970
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
11515
12971
  className: SuggestionsDock_module_css_default.dock,
11516
12972
  "data-testid": "roleplay-suggestions",
12973
+ "data-rp": "suggestions",
11517
12974
  children: [
11518
12975
  unfinished.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
11519
12976
  className: SuggestionsDock_module_css_default.card,
@@ -11544,6 +13001,7 @@ window.__ModuleLoader__.load({
11544
13001
  offered.map((text) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
11545
13002
  type: "button",
11546
13003
  className: SuggestionsDock_module_css_default.chip,
13004
+ "data-rp": "suggestion",
11547
13005
  title: t("suggestionHint"),
11548
13006
  onClick: () => {
11549
13007
  pick(text);
@@ -11567,11 +13025,11 @@ window.__ModuleLoader__.load({
11567
13025
  tag.textContent = css;
11568
13026
  var TurnsDock_module_css_default = {
11569
13027
  "select": "rp_f4YLlq_select",
11570
- "group": "rp_f4YLlq_group",
11571
13028
  "dock": "rp_f4YLlq_dock",
11572
13029
  "button": "rp_f4YLlq_button",
11573
13030
  "count": "rp_f4YLlq_count",
11574
- "error": "rp_f4YLlq_error"
13031
+ "error": "rp_f4YLlq_error",
13032
+ "group": "rp_f4YLlq_group"
11575
13033
  };
11576
13034
  //#endregion
11577
13035
  //#region src/client/transcript/withdrawn.ts
@@ -11640,6 +13098,7 @@ window.__ModuleLoader__.load({
11640
13098
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
11641
13099
  className: TurnsDock_module_css_default.dock,
11642
13100
  "data-testid": "roleplay-turns",
13101
+ "data-rp": "turns",
11643
13102
  children: [
11644
13103
  style,
11645
13104
  alternatives.length > 1 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
@@ -11770,6 +13229,7 @@ window.__ModuleLoader__.load({
11770
13229
  swapNext: "The next turn played from the same place",
11771
13230
  oocDone: "Out of character:",
11772
13231
  oocRefused: "Out of character, refused:",
13232
+ oocAnswer: "Out of character, answer:",
11773
13233
  redo: "↷ Forward",
11774
13234
  branch: "⑂ Branch from…",
11775
13235
  after: "After",
@@ -11806,6 +13266,7 @@ window.__ModuleLoader__.load({
11806
13266
  swapNext: "从同一处出发的下一个回合",
11807
13267
  oocDone: "场外:",
11808
13268
  oocRefused: "场外,已拒绝:",
13269
+ oocAnswer: "场外,回答:",
11809
13270
  redo: "↷ 前进",
11810
13271
  branch: "⑂ 分支自…",
11811
13272
  after: "在此之后:",
@@ -11834,25 +13295,6 @@ window.__ModuleLoader__.load({
11834
13295
  //#endregion
11835
13296
  //#region src/client/transcript/index.ts
11836
13297
  const NAMESPACE = "roleplay.transcript";
11837
- /** 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. */
11838
- function facadeOf(scope, sessionId) {
11839
- const input = () => {
11840
- const actx = scope.get("sessions")?.scope(sessionId);
11841
- const conversation = actx?.get("conversation");
11842
- if (actx === void 0 || conversation === void 0) throw new Error("the input of this chat is not available");
11843
- return conversation.input.for(actx);
11844
- };
11845
- return {
11846
- pick: (text) => {
11847
- input().setDraft(text);
11848
- },
11849
- fill: (text, send) => {
11850
- const facade = input();
11851
- facade.setDraft(text);
11852
- if (send) facade.submit();
11853
- }
11854
- };
11855
- }
11856
13298
  /** The turns of a roleplay session, as the host keeps them. */
11857
13299
  async function timelineOf(chat) {
11858
13300
  const id = roleplaySessionOf(chat);
@@ -11953,6 +13395,7 @@ window.__ModuleLoader__.load({
11953
13395
  registerChatSettings(ctx);
11954
13396
  registerWorld(ctx);
11955
13397
  registerGallery(ctx);
13398
+ registerInterface(ctx);
11956
13399
  registerBranchNaming(ctx);
11957
13400
  }
11958
13401
  //#endregion